ui-thing 0.0.14 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/index.js +323 -82
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/comps.ts +77 -3
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as he,b as sn,f as fe}from"./chunk-QMEJXGGM.js";var xs=he(Xn=>{"use strict";var vs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");Xn.encode=function(s){if(0<=s&&s<vs.length)return vs[s];throw new TypeError("Must be between 0 and 63: "+s)};Xn.decode=function(s){var n=65,e=90,t=97,r=122,i=48,a=57,o=43,l=47,c=26,p=52;return n<=s&&s<=e?s-n:t<=s&&s<=r?s-t+c:i<=s&&s<=a?s-i+p:s==o?62:s==l?63:-1}});var Zn=he(Yn=>{"use strict";var Ps=xs(),Qn=5,Ts=1<<Qn,ws=Ts-1,Cs=Ts;function Ga(s){return s<0?(-s<<1)+1:(s<<1)+0}function Ka(s){var n=(s&1)===1,e=s>>1;return n?-e:e}Yn.encode=function(n){var e="",t,r=Ga(n);do t=r&ws,r>>>=Qn,r>0&&(t|=Cs),e+=Ps.encode(t);while(r>0);return e};Yn.decode=function(n,e,t){var r=n.length,i=0,a=0,o,l;do{if(e>=r)throw new Error("Expected more digits in base 64 VLQ value.");if(l=Ps.decode(n.charCodeAt(e++)),l===-1)throw new Error("Invalid base64 digit: "+n.charAt(e-1));o=!!(l&Cs),l&=ws,i=i+(l<<a),a+=Qn}while(o);t.value=Ka(i),t.rest=e}});var st=he(ee=>{"use strict";function Ja(s,n,e){if(n in s)return s[n];if(arguments.length===3)return e;throw new Error('"'+n+'" is a required argument.')}ee.getArg=Ja;var Ss=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Xa=/^data:.+\,.+$/;function St(s){var n=s.match(Ss);return n?{scheme:n[1],auth:n[2],host:n[3],port:n[4],path:n[5]}:null}ee.urlParse=St;function rt(s){var n="";return s.scheme&&(n+=s.scheme+":"),n+="//",s.auth&&(n+=s.auth+"@"),s.host&&(n+=s.host),s.port&&(n+=":"+s.port),s.path&&(n+=s.path),n}ee.urlGenerate=rt;var Qa=32;function Ya(s){var n=[];return function(e){for(var t=0;t<n.length;t++)if(n[t].input===e){var r=n[0];return n[0]=n[t],n[t]=r,n[0].result}var i=s(e);return n.unshift({input:e,result:i}),n.length>Qa&&n.pop(),i}}var er=Ya(function(n){var e=n,t=St(n);if(t){if(!t.path)return n;e=t.path}for(var r=ee.isAbsolute(e),i=[],a=0,o=0;;)if(a=o,o=e.indexOf("/",a),o===-1){i.push(e.slice(a));break}else for(i.push(e.slice(a,o));o<e.length&&e[o]==="/";)o++;for(var l,c=0,o=i.length-1;o>=0;o--)l=i[o],l==="."?i.splice(o,1):l===".."?c++:c>0&&(l===""?(i.splice(o+1,c),c=0):(i.splice(o,2),c--));return e=i.join("/"),e===""&&(e=r?"/":"."),t?(t.path=e,rt(t)):e});ee.normalize=er;function Es(s,n){s===""&&(s="."),n===""&&(n=".");var e=St(n),t=St(s);if(t&&(s=t.path||"/"),e&&!e.scheme)return t&&(e.scheme=t.scheme),rt(e);if(e||n.match(Xa))return n;if(t&&!t.host&&!t.path)return t.host=n,rt(t);var r=n.charAt(0)==="/"?n:er(s.replace(/\/+$/,"")+"/"+n);return t?(t.path=r,rt(t)):r}ee.join=Es;ee.isAbsolute=function(s){return s.charAt(0)==="/"||Ss.test(s)};function Za(s,n){s===""&&(s="."),s=s.replace(/\/$/,"");for(var e=0;n.indexOf(s+"/")!==0;){var t=s.lastIndexOf("/");if(t<0||(s=s.slice(0,t),s.match(/^([^\/]+:\/)?\/*$/)))return n;++e}return Array(e+1).join("../")+n.substr(s.length+1)}ee.relative=Za;var Is=function(){var s=Object.create(null);return!("__proto__"in s)}();function As(s){return s}function eo(s){return ks(s)?"$"+s:s}ee.toSetString=Is?As:eo;function to(s){return ks(s)?s.slice(1):s}ee.fromSetString=Is?As:to;function ks(s){if(!s)return!1;var n=s.length;if(n<9||s.charCodeAt(n-1)!==95||s.charCodeAt(n-2)!==95||s.charCodeAt(n-3)!==111||s.charCodeAt(n-4)!==116||s.charCodeAt(n-5)!==111||s.charCodeAt(n-6)!==114||s.charCodeAt(n-7)!==112||s.charCodeAt(n-8)!==95||s.charCodeAt(n-9)!==95)return!1;for(var e=n-10;e>=0;e--)if(s.charCodeAt(e)!==36)return!1;return!0}function no(s,n,e){var t=De(s.source,n.source);return t!==0||(t=s.originalLine-n.originalLine,t!==0)||(t=s.originalColumn-n.originalColumn,t!==0||e)||(t=s.generatedColumn-n.generatedColumn,t!==0)||(t=s.generatedLine-n.generatedLine,t!==0)?t:De(s.name,n.name)}ee.compareByOriginalPositions=no;function ro(s,n,e){var t;return t=s.originalLine-n.originalLine,t!==0||(t=s.originalColumn-n.originalColumn,t!==0||e)||(t=s.generatedColumn-n.generatedColumn,t!==0)||(t=s.generatedLine-n.generatedLine,t!==0)?t:De(s.name,n.name)}ee.compareByOriginalPositionsNoSource=ro;function so(s,n,e){var t=s.generatedLine-n.generatedLine;return t!==0||(t=s.generatedColumn-n.generatedColumn,t!==0||e)||(t=De(s.source,n.source),t!==0)||(t=s.originalLine-n.originalLine,t!==0)||(t=s.originalColumn-n.originalColumn,t!==0)?t:De(s.name,n.name)}ee.compareByGeneratedPositionsDeflated=so;function io(s,n,e){var t=s.generatedColumn-n.generatedColumn;return t!==0||e||(t=De(s.source,n.source),t!==0)||(t=s.originalLine-n.originalLine,t!==0)||(t=s.originalColumn-n.originalColumn,t!==0)?t:De(s.name,n.name)}ee.compareByGeneratedPositionsDeflatedNoLine=io;function De(s,n){return s===n?0:s===null?1:n===null?-1:s>n?1:-1}function ao(s,n){var e=s.generatedLine-n.generatedLine;return e!==0||(e=s.generatedColumn-n.generatedColumn,e!==0)||(e=De(s.source,n.source),e!==0)||(e=s.originalLine-n.originalLine,e!==0)||(e=s.originalColumn-n.originalColumn,e!==0)?e:De(s.name,n.name)}ee.compareByGeneratedPositionsInflated=ao;function oo(s){return JSON.parse(s.replace(/^\)]}'[^\n]*\n/,""))}ee.parseSourceMapInput=oo;function lo(s,n,e){if(n=n||"",s&&(s[s.length-1]!=="/"&&n[0]!=="/"&&(s+="/"),n=s+n),e){var t=St(e);if(!t)throw new Error("sourceMapURL could not be parsed");if(t.path){var r=t.path.lastIndexOf("/");r>=0&&(t.path=t.path.substring(0,r+1))}n=Es(rt(t),n)}return er(n)}ee.computeSourceURL=lo});var rr=he(Ns=>{"use strict";var tr=st(),nr=Object.prototype.hasOwnProperty,Ke=typeof Map<"u";function Le(){this._array=[],this._set=Ke?new Map:Object.create(null)}Le.fromArray=function(n,e){for(var t=new Le,r=0,i=n.length;r<i;r++)t.add(n[r],e);return t};Le.prototype.size=function(){return Ke?this._set.size:Object.getOwnPropertyNames(this._set).length};Le.prototype.add=function(n,e){var t=Ke?n:tr.toSetString(n),r=Ke?this.has(n):nr.call(this._set,t),i=this._array.length;(!r||e)&&this._array.push(n),r||(Ke?this._set.set(n,i):this._set[t]=i)};Le.prototype.has=function(n){if(Ke)return this._set.has(n);var e=tr.toSetString(n);return nr.call(this._set,e)};Le.prototype.indexOf=function(n){if(Ke){var e=this._set.get(n);if(e>=0)return e}else{var t=tr.toSetString(n);if(nr.call(this._set,t))return this._set[t]}throw new Error('"'+n+'" is not in the set.')};Le.prototype.at=function(n){if(n>=0&&n<this._array.length)return this._array[n];throw new Error("No element indexed by "+n)};Le.prototype.toArray=function(){return this._array.slice()};Ns.ArraySet=Le});var Ls=he(Ds=>{"use strict";var Ms=st();function co(s,n){var e=s.generatedLine,t=n.generatedLine,r=s.generatedColumn,i=n.generatedColumn;return t>e||t==e&&i>=r||Ms.compareByGeneratedPositionsInflated(s,n)<=0}function on(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}on.prototype.unsortedForEach=function(n,e){this._array.forEach(n,e)};on.prototype.add=function(n){co(this._last,n)?(this._last=n,this._array.push(n)):(this._sorted=!1,this._array.push(n))};on.prototype.toArray=function(){return this._sorted||(this._array.sort(Ms.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};Ds.MappingList=on});var sr=he(Os=>{"use strict";var Et=Zn(),Q=st(),ln=rr().ArraySet,po=Ls().MappingList;function me(s){s||(s={}),this._file=Q.getArg(s,"file",null),this._sourceRoot=Q.getArg(s,"sourceRoot",null),this._skipValidation=Q.getArg(s,"skipValidation",!1),this._sources=new ln,this._names=new ln,this._mappings=new po,this._sourcesContents=null}me.prototype._version=3;me.fromSourceMap=function(n){var e=n.sourceRoot,t=new me({file:n.file,sourceRoot:e});return n.eachMapping(function(r){var i={generated:{line:r.generatedLine,column:r.generatedColumn}};r.source!=null&&(i.source=r.source,e!=null&&(i.source=Q.relative(e,i.source)),i.original={line:r.originalLine,column:r.originalColumn},r.name!=null&&(i.name=r.name)),t.addMapping(i)}),n.sources.forEach(function(r){var i=r;e!==null&&(i=Q.relative(e,r)),t._sources.has(i)||t._sources.add(i);var a=n.sourceContentFor(r);a!=null&&t.setSourceContent(r,a)}),t};me.prototype.addMapping=function(n){var e=Q.getArg(n,"generated"),t=Q.getArg(n,"original",null),r=Q.getArg(n,"source",null),i=Q.getArg(n,"name",null);this._skipValidation||this._validateMapping(e,t,r,i),r!=null&&(r=String(r),this._sources.has(r)||this._sources.add(r)),i!=null&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:e.line,generatedColumn:e.column,originalLine:t!=null&&t.line,originalColumn:t!=null&&t.column,source:r,name:i})};me.prototype.setSourceContent=function(n,e){var t=n;this._sourceRoot!=null&&(t=Q.relative(this._sourceRoot,t)),e!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[Q.toSetString(t)]=e):this._sourcesContents&&(delete this._sourcesContents[Q.toSetString(t)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};me.prototype.applySourceMap=function(n,e,t){var r=e;if(e==null){if(n.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);r=n.file}var i=this._sourceRoot;i!=null&&(r=Q.relative(i,r));var a=new ln,o=new ln;this._mappings.unsortedForEach(function(l){if(l.source===r&&l.originalLine!=null){var c=n.originalPositionFor({line:l.originalLine,column:l.originalColumn});c.source!=null&&(l.source=c.source,t!=null&&(l.source=Q.join(t,l.source)),i!=null&&(l.source=Q.relative(i,l.source)),l.originalLine=c.line,l.originalColumn=c.column,c.name!=null&&(l.name=c.name))}var p=l.source;p!=null&&!a.has(p)&&a.add(p);var u=l.name;u!=null&&!o.has(u)&&o.add(u)},this),this._sources=a,this._names=o,n.sources.forEach(function(l){var c=n.sourceContentFor(l);c!=null&&(t!=null&&(l=Q.join(t,l)),i!=null&&(l=Q.relative(i,l)),this.setSourceContent(l,c))},this)};me.prototype._validateMapping=function(n,e,t,r){if(e&&typeof e.line!="number"&&typeof e.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(n&&"line"in n&&"column"in n&&n.line>0&&n.column>=0&&!e&&!t&&!r)){if(n&&"line"in n&&"column"in n&&e&&"line"in e&&"column"in e&&n.line>0&&n.column>=0&&e.line>0&&e.column>=0&&t)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:n,source:t,original:e,name:r}))}};me.prototype._serializeMappings=function(){for(var n=0,e=1,t=0,r=0,i=0,a=0,o="",l,c,p,u,h=this._mappings.toArray(),m=0,d=h.length;m<d;m++){if(c=h[m],l="",c.generatedLine!==e)for(n=0;c.generatedLine!==e;)l+=";",e++;else if(m>0){if(!Q.compareByGeneratedPositionsInflated(c,h[m-1]))continue;l+=","}l+=Et.encode(c.generatedColumn-n),n=c.generatedColumn,c.source!=null&&(u=this._sources.indexOf(c.source),l+=Et.encode(u-a),a=u,l+=Et.encode(c.originalLine-1-r),r=c.originalLine-1,l+=Et.encode(c.originalColumn-t),t=c.originalColumn,c.name!=null&&(p=this._names.indexOf(c.name),l+=Et.encode(p-i),i=p)),o+=l}return o};me.prototype._generateSourcesContent=function(n,e){return n.map(function(t){if(!this._sourcesContents)return null;e!=null&&(t=Q.relative(e,t));var r=Q.toSetString(t);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)};me.prototype.toJSON=function(){var n={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(n.file=this._file),this._sourceRoot!=null&&(n.sourceRoot=this._sourceRoot),this._sourcesContents&&(n.sourcesContent=this._generateSourcesContent(n.sources,n.sourceRoot)),n};me.prototype.toString=function(){return JSON.stringify(this.toJSON())};Os.SourceMapGenerator=me});var Fs=he(Je=>{"use strict";Je.GREATEST_LOWER_BOUND=1;Je.LEAST_UPPER_BOUND=2;function ir(s,n,e,t,r,i){var a=Math.floor((n-s)/2)+s,o=r(e,t[a],!0);return o===0?a:o>0?n-a>1?ir(a,n,e,t,r,i):i==Je.LEAST_UPPER_BOUND?n<t.length?n:-1:a:a-s>1?ir(s,a,e,t,r,i):i==Je.LEAST_UPPER_BOUND?a:s<0?-1:s}Je.search=function(n,e,t,r){if(e.length===0)return-1;var i=ir(-1,e.length,n,e,t,r||Je.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&t(e[i],e[i-1],!0)===0;)--i;return i}});var Bs=he(Us=>{"use strict";function uo(s){function n(r,i,a){var o=r[i];r[i]=r[a],r[a]=o}function e(r,i){return Math.round(r+Math.random()*(i-r))}function t(r,i,a,o){if(a<o){var l=e(a,o),c=a-1;n(r,l,o);for(var p=r[o],u=a;u<o;u++)i(r[u],p,!1)<=0&&(c+=1,n(r,c,u));n(r,c+1,u);var h=c+1;t(r,i,a,h-1),t(r,i,h+1,o)}}return t}function ho(s){let n=uo.toString();return new Function(`return ${n}`)()(s)}var _s=new WeakMap;Us.quickSort=function(s,n,e=0){let t=_s.get(n);t===void 0&&(t=ho(n),_s.set(n,t)),t(s,n,e,s.length-1)}});var Vs=he(cn=>{"use strict";var M=st(),or=Fs(),it=rr().ArraySet,fo=Zn(),It=Bs().quickSort;function W(s,n){var e=s;return typeof s=="string"&&(e=M.parseSourceMapInput(s)),e.sections!=null?new ve(e,n):new te(e,n)}W.fromSourceMap=function(s,n){return te.fromSourceMap(s,n)};W.prototype._version=3;W.prototype.__generatedMappings=null;Object.defineProperty(W.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});W.prototype.__originalMappings=null;Object.defineProperty(W.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});W.prototype._charIsMappingSeparator=function(n,e){var t=n.charAt(e);return t===";"||t===","};W.prototype._parseMappings=function(n,e){throw new Error("Subclasses must implement _parseMappings")};W.GENERATED_ORDER=1;W.ORIGINAL_ORDER=2;W.GREATEST_LOWER_BOUND=1;W.LEAST_UPPER_BOUND=2;W.prototype.eachMapping=function(n,e,t){var r=e||null,i=t||W.GENERATED_ORDER,a;switch(i){case W.GENERATED_ORDER:a=this._generatedMappings;break;case W.ORIGINAL_ORDER:a=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var o=this.sourceRoot,l=n.bind(r),c=this._names,p=this._sources,u=this._sourceMapURL,h=0,m=a.length;h<m;h++){var d=a[h],y=d.source===null?null:p.at(d.source);y=M.computeSourceURL(o,y,u),l({source:y,generatedLine:d.generatedLine,generatedColumn:d.generatedColumn,originalLine:d.originalLine,originalColumn:d.originalColumn,name:d.name===null?null:c.at(d.name)})}};W.prototype.allGeneratedPositionsFor=function(n){var e=M.getArg(n,"line"),t={source:M.getArg(n,"source"),originalLine:e,originalColumn:M.getArg(n,"column",0)};if(t.source=this._findSourceIndex(t.source),t.source<0)return[];var r=[],i=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",M.compareByOriginalPositions,or.LEAST_UPPER_BOUND);if(i>=0){var a=this._originalMappings[i];if(n.column===void 0)for(var o=a.originalLine;a&&a.originalLine===o;)r.push({line:M.getArg(a,"generatedLine",null),column:M.getArg(a,"generatedColumn",null),lastColumn:M.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++i];else for(var l=a.originalColumn;a&&a.originalLine===e&&a.originalColumn==l;)r.push({line:M.getArg(a,"generatedLine",null),column:M.getArg(a,"generatedColumn",null),lastColumn:M.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++i]}return r};cn.SourceMapConsumer=W;function te(s,n){var e=s;typeof s=="string"&&(e=M.parseSourceMapInput(s));var t=M.getArg(e,"version"),r=M.getArg(e,"sources"),i=M.getArg(e,"names",[]),a=M.getArg(e,"sourceRoot",null),o=M.getArg(e,"sourcesContent",null),l=M.getArg(e,"mappings"),c=M.getArg(e,"file",null);if(t!=this._version)throw new Error("Unsupported version: "+t);a&&(a=M.normalize(a)),r=r.map(String).map(M.normalize).map(function(p){return a&&M.isAbsolute(a)&&M.isAbsolute(p)?M.relative(a,p):p}),this._names=it.fromArray(i.map(String),!0),this._sources=it.fromArray(r,!0),this._absoluteSources=this._sources.toArray().map(function(p){return M.computeSourceURL(a,p,n)}),this.sourceRoot=a,this.sourcesContent=o,this._mappings=l,this._sourceMapURL=n,this.file=c}te.prototype=Object.create(W.prototype);te.prototype.consumer=W;te.prototype._findSourceIndex=function(s){var n=s;if(this.sourceRoot!=null&&(n=M.relative(this.sourceRoot,n)),this._sources.has(n))return this._sources.indexOf(n);var e;for(e=0;e<this._absoluteSources.length;++e)if(this._absoluteSources[e]==s)return e;return-1};te.fromSourceMap=function(n,e){var t=Object.create(te.prototype),r=t._names=it.fromArray(n._names.toArray(),!0),i=t._sources=it.fromArray(n._sources.toArray(),!0);t.sourceRoot=n._sourceRoot,t.sourcesContent=n._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=n._file,t._sourceMapURL=e,t._absoluteSources=t._sources.toArray().map(function(m){return M.computeSourceURL(t.sourceRoot,m,e)});for(var a=n._mappings.toArray().slice(),o=t.__generatedMappings=[],l=t.__originalMappings=[],c=0,p=a.length;c<p;c++){var u=a[c],h=new js;h.generatedLine=u.generatedLine,h.generatedColumn=u.generatedColumn,u.source&&(h.source=i.indexOf(u.source),h.originalLine=u.originalLine,h.originalColumn=u.originalColumn,u.name&&(h.name=r.indexOf(u.name)),l.push(h)),o.push(h)}return It(t.__originalMappings,M.compareByOriginalPositions),t};te.prototype._version=3;Object.defineProperty(te.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function js(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}var ar=M.compareByGeneratedPositionsDeflatedNoLine;function Rs(s,n){let e=s.length,t=s.length-n;if(!(t<=1))if(t==2){let r=s[n],i=s[n+1];ar(r,i)>0&&(s[n]=i,s[n+1]=r)}else if(t<20)for(let r=n;r<e;r++)for(let i=r;i>n;i--){let a=s[i-1],o=s[i];if(ar(a,o)<=0)break;s[i-1]=o,s[i]=a}else It(s,ar,n)}te.prototype._parseMappings=function(n,e){var t=1,r=0,i=0,a=0,o=0,l=0,c=n.length,p=0,u={},h={},m=[],d=[],y,f,v,w,I;let x=0;for(;p<c;)if(n.charAt(p)===";")t++,p++,r=0,Rs(d,x),x=d.length;else if(n.charAt(p)===",")p++;else{for(y=new js,y.generatedLine=t,w=p;w<c&&!this._charIsMappingSeparator(n,w);w++);for(f=n.slice(p,w),v=[];p<w;)fo.decode(n,p,h),I=h.value,p=h.rest,v.push(I);if(v.length===2)throw new Error("Found a source, but no line and column");if(v.length===3)throw new Error("Found a source and line, but no column");if(y.generatedColumn=r+v[0],r=y.generatedColumn,v.length>1&&(y.source=o+v[1],o+=v[1],y.originalLine=i+v[2],i=y.originalLine,y.originalLine+=1,y.originalColumn=a+v[3],a=y.originalColumn,v.length>4&&(y.name=l+v[4],l+=v[4])),d.push(y),typeof y.originalLine=="number"){let C=y.source;for(;m.length<=C;)m.push(null);m[C]===null&&(m[C]=[]),m[C].push(y)}}Rs(d,x),this.__generatedMappings=d;for(var P=0;P<m.length;P++)m[P]!=null&&It(m[P],M.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...m)};te.prototype._findMapping=function(n,e,t,r,i,a){if(n[t]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+n[t]);if(n[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+n[r]);return or.search(n,e,i,a)};te.prototype.computeColumnSpans=function(){for(var n=0;n<this._generatedMappings.length;++n){var e=this._generatedMappings[n];if(n+1<this._generatedMappings.length){var t=this._generatedMappings[n+1];if(e.generatedLine===t.generatedLine){e.lastGeneratedColumn=t.generatedColumn-1;continue}}e.lastGeneratedColumn=1/0}};te.prototype.originalPositionFor=function(n){var e={generatedLine:M.getArg(n,"line"),generatedColumn:M.getArg(n,"column")},t=this._findMapping(e,this._generatedMappings,"generatedLine","generatedColumn",M.compareByGeneratedPositionsDeflated,M.getArg(n,"bias",W.GREATEST_LOWER_BOUND));if(t>=0){var r=this._generatedMappings[t];if(r.generatedLine===e.generatedLine){var i=M.getArg(r,"source",null);i!==null&&(i=this._sources.at(i),i=M.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var a=M.getArg(r,"name",null);return a!==null&&(a=this._names.at(a)),{source:i,line:M.getArg(r,"originalLine",null),column:M.getArg(r,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}};te.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(n){return n==null}):!1};te.prototype.sourceContentFor=function(n,e){if(!this.sourcesContent)return null;var t=this._findSourceIndex(n);if(t>=0)return this.sourcesContent[t];var r=n;this.sourceRoot!=null&&(r=M.relative(this.sourceRoot,r));var i;if(this.sourceRoot!=null&&(i=M.urlParse(this.sourceRoot))){var a=r.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(a))return this.sourcesContent[this._sources.indexOf(a)];if((!i.path||i.path=="/")&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(e)return null;throw new Error('"'+r+'" is not in the SourceMap.')};te.prototype.generatedPositionFor=function(n){var e=M.getArg(n,"source");if(e=this._findSourceIndex(e),e<0)return{line:null,column:null,lastColumn:null};var t={source:e,originalLine:M.getArg(n,"line"),originalColumn:M.getArg(n,"column")},r=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",M.compareByOriginalPositions,M.getArg(n,"bias",W.GREATEST_LOWER_BOUND));if(r>=0){var i=this._originalMappings[r];if(i.source===t.source)return{line:M.getArg(i,"generatedLine",null),column:M.getArg(i,"generatedColumn",null),lastColumn:M.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};cn.BasicSourceMapConsumer=te;function ve(s,n){var e=s;typeof s=="string"&&(e=M.parseSourceMapInput(s));var t=M.getArg(e,"version"),r=M.getArg(e,"sections");if(t!=this._version)throw new Error("Unsupported version: "+t);this._sources=new it,this._names=new it;var i={line:-1,column:0};this._sections=r.map(function(a){if(a.url)throw new Error("Support for url field in sections not implemented.");var o=M.getArg(a,"offset"),l=M.getArg(o,"line"),c=M.getArg(o,"column");if(l<i.line||l===i.line&&c<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=o,{generatedOffset:{generatedLine:l+1,generatedColumn:c+1},consumer:new W(M.getArg(a,"map"),n)}})}ve.prototype=Object.create(W.prototype);ve.prototype.constructor=W;ve.prototype._version=3;Object.defineProperty(ve.prototype,"sources",{get:function(){for(var s=[],n=0;n<this._sections.length;n++)for(var e=0;e<this._sections[n].consumer.sources.length;e++)s.push(this._sections[n].consumer.sources[e]);return s}});ve.prototype.originalPositionFor=function(n){var e={generatedLine:M.getArg(n,"line"),generatedColumn:M.getArg(n,"column")},t=or.search(e,this._sections,function(i,a){var o=i.generatedLine-a.generatedOffset.generatedLine;return o||i.generatedColumn-a.generatedOffset.generatedColumn}),r=this._sections[t];return r?r.consumer.originalPositionFor({line:e.generatedLine-(r.generatedOffset.generatedLine-1),column:e.generatedColumn-(r.generatedOffset.generatedLine===e.generatedLine?r.generatedOffset.generatedColumn-1:0),bias:n.bias}):{source:null,line:null,column:null,name:null}};ve.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(n){return n.consumer.hasContentsOfAllSources()})};ve.prototype.sourceContentFor=function(n,e){for(var t=0;t<this._sections.length;t++){var r=this._sections[t],i=r.consumer.sourceContentFor(n,!0);if(i)return i}if(e)return null;throw new Error('"'+n+'" is not in the SourceMap.')};ve.prototype.generatedPositionFor=function(n){for(var e=0;e<this._sections.length;e++){var t=this._sections[e];if(t.consumer._findSourceIndex(M.getArg(n,"source"))!==-1){var r=t.consumer.generatedPositionFor(n);if(r){var i={line:r.line+(t.generatedOffset.generatedLine-1),column:r.column+(t.generatedOffset.generatedLine===r.line?t.generatedOffset.generatedColumn-1:0)};return i}}}return{line:null,column:null}};ve.prototype._parseMappings=function(n,e){this.__generatedMappings=[],this.__originalMappings=[];for(var t=0;t<this._sections.length;t++)for(var r=this._sections[t],i=r.consumer._generatedMappings,a=0;a<i.length;a++){var o=i[a],l=r.consumer._sources.at(o.source);l=M.computeSourceURL(r.consumer.sourceRoot,l,this._sourceMapURL),this._sources.add(l),l=this._sources.indexOf(l);var c=null;o.name&&(c=r.consumer._names.at(o.name),this._names.add(c),c=this._names.indexOf(c));var p={source:l,generatedLine:o.generatedLine+(r.generatedOffset.generatedLine-1),generatedColumn:o.generatedColumn+(r.generatedOffset.generatedLine===o.generatedLine?r.generatedOffset.generatedColumn-1:0),originalLine:o.originalLine,originalColumn:o.originalColumn,name:c};this.__generatedMappings.push(p),typeof p.originalLine=="number"&&this.__originalMappings.push(p)}It(this.__generatedMappings,M.compareByGeneratedPositionsDeflated),It(this.__originalMappings,M.compareByOriginalPositions)};cn.IndexedSourceMapConsumer=ve});var $s=he(zs=>{"use strict";var mo=sr().SourceMapGenerator,pn=st(),bo=/(\r?\n)/,yo=10,at="$$$isSourceNode$$$";function le(s,n,e,t,r){this.children=[],this.sourceContents={},this.line=s??null,this.column=n??null,this.source=e??null,this.name=r??null,this[at]=!0,t!=null&&this.add(t)}le.fromStringWithSourceMap=function(n,e,t){var r=new le,i=n.split(bo),a=0,o=function(){var h=d(),m=d()||"";return h+m;function d(){return a<i.length?i[a++]:void 0}},l=1,c=0,p=null;return e.eachMapping(function(h){if(p!==null)if(l<h.generatedLine)u(p,o()),l++,c=0;else{var m=i[a]||"",d=m.substr(0,h.generatedColumn-c);i[a]=m.substr(h.generatedColumn-c),c=h.generatedColumn,u(p,d),p=h;return}for(;l<h.generatedLine;)r.add(o()),l++;if(c<h.generatedColumn){var m=i[a]||"";r.add(m.substr(0,h.generatedColumn)),i[a]=m.substr(h.generatedColumn),c=h.generatedColumn}p=h},this),a<i.length&&(p&&u(p,o()),r.add(i.splice(a).join(""))),e.sources.forEach(function(h){var m=e.sourceContentFor(h);m!=null&&(t!=null&&(h=pn.join(t,h)),r.setSourceContent(h,m))}),r;function u(h,m){if(h===null||h.source===void 0)r.add(m);else{var d=t?pn.join(t,h.source):h.source;r.add(new le(h.originalLine,h.originalColumn,d,m,h.name))}}};le.prototype.add=function(n){if(Array.isArray(n))n.forEach(function(e){this.add(e)},this);else if(n[at]||typeof n=="string")n&&this.children.push(n);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+n);return this};le.prototype.prepend=function(n){if(Array.isArray(n))for(var e=n.length-1;e>=0;e--)this.prepend(n[e]);else if(n[at]||typeof n=="string")this.children.unshift(n);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+n);return this};le.prototype.walk=function(n){for(var e,t=0,r=this.children.length;t<r;t++)e=this.children[t],e[at]?e.walk(n):e!==""&&n(e,{source:this.source,line:this.line,column:this.column,name:this.name})};le.prototype.join=function(n){var e,t,r=this.children.length;if(r>0){for(e=[],t=0;t<r-1;t++)e.push(this.children[t]),e.push(n);e.push(this.children[t]),this.children=e}return this};le.prototype.replaceRight=function(n,e){var t=this.children[this.children.length-1];return t[at]?t.replaceRight(n,e):typeof t=="string"?this.children[this.children.length-1]=t.replace(n,e):this.children.push("".replace(n,e)),this};le.prototype.setSourceContent=function(n,e){this.sourceContents[pn.toSetString(n)]=e};le.prototype.walkSourceContents=function(n){for(var e=0,t=this.children.length;e<t;e++)this.children[e][at]&&this.children[e].walkSourceContents(n);for(var r=Object.keys(this.sourceContents),e=0,t=r.length;e<t;e++)n(pn.fromSetString(r[e]),this.sourceContents[r[e]])};le.prototype.toString=function(){var n="";return this.walk(function(e){n+=e}),n};le.prototype.toStringWithSourceMap=function(n){var e={code:"",line:1,column:0},t=new mo(n),r=!1,i=null,a=null,o=null,l=null;return this.walk(function(c,p){e.code+=c,p.source!==null&&p.line!==null&&p.column!==null?((i!==p.source||a!==p.line||o!==p.column||l!==p.name)&&t.addMapping({source:p.source,original:{line:p.line,column:p.column},generated:{line:e.line,column:e.column},name:p.name}),i=p.source,a=p.line,o=p.column,l=p.name,r=!0):r&&(t.addMapping({generated:{line:e.line,column:e.column}}),i=null,r=!1);for(var u=0,h=c.length;u<h;u++)c.charCodeAt(u)===yo?(e.line++,e.column=0,u+1===h?(i=null,r=!1):r&&t.addMapping({source:p.source,original:{line:p.line,column:p.column},generated:{line:e.line,column:e.column},name:p.name})):e.column++}),this.walkSourceContents(function(c,p){t.setSourceContent(c,p)}),{code:e.code,map:t}};zs.SourceNode=le});var lr=he(un=>{"use strict";un.SourceMapGenerator=sr().SourceMapGenerator;un.SourceMapConsumer=Vs().SourceMapConsumer;un.SourceNode=$s().SourceNode});var qr=he(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});function gn(s,n){if(s==null)return{};var e={},t=Object.keys(s),r,i;for(i=0;i<t.length;i++)r=t[i],!(n.indexOf(r)>=0)&&(e[r]=s[r]);return e}var ke=class{constructor(n,e,t){this.line=void 0,this.column=void 0,this.index=void 0,this.line=n,this.column=e,this.index=t}},pt=class{constructor(n,e){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=n,this.end=e}};function se(s,n){let{line:e,column:t,index:r}=s;return new ke(e,t+n,r+n)}var qs="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",go={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:qs},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:qs}},Hs={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},fn=({type:s,prefix:n})=>s==="UpdateExpression"?Hs.UpdateExpression[String(n)]:Hs[s],vo={AccessorIsGenerator:({kind:s})=>`A ${s}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncFunction:"'await' is only allowed within async functions.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:s})=>`Missing initializer in ${s} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:s})=>`\`${s}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",DynamicImportPhaseRequiresImportExpressions:({phase:s})=>`'import.${s}(...)' can only be parsed when using the 'createImportExpressions' option.`,ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:s,exportName:n})=>`A string literal cannot be used as an exported binding without \`from\`.
|
|
2
|
+
import{a as he,b as sn,f as fe}from"./chunk-QMEJXGGM.js";var xs=he(Xn=>{"use strict";var vs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");Xn.encode=function(s){if(0<=s&&s<vs.length)return vs[s];throw new TypeError("Must be between 0 and 63: "+s)};Xn.decode=function(s){var n=65,e=90,t=97,r=122,i=48,a=57,o=43,l=47,c=26,p=52;return n<=s&&s<=e?s-n:t<=s&&s<=r?s-t+c:i<=s&&s<=a?s-i+p:s==o?62:s==l?63:-1}});var Zn=he(Yn=>{"use strict";var Ps=xs(),Qn=5,Ts=1<<Qn,ws=Ts-1,Cs=Ts;function Ga(s){return s<0?(-s<<1)+1:(s<<1)+0}function Ka(s){var n=(s&1)===1,e=s>>1;return n?-e:e}Yn.encode=function(n){var e="",t,r=Ga(n);do t=r&ws,r>>>=Qn,r>0&&(t|=Cs),e+=Ps.encode(t);while(r>0);return e};Yn.decode=function(n,e,t){var r=n.length,i=0,a=0,o,l;do{if(e>=r)throw new Error("Expected more digits in base 64 VLQ value.");if(l=Ps.decode(n.charCodeAt(e++)),l===-1)throw new Error("Invalid base64 digit: "+n.charAt(e-1));o=!!(l&Cs),l&=ws,i=i+(l<<a),a+=Qn}while(o);t.value=Ka(i),t.rest=e}});var st=he(ee=>{"use strict";function Ja(s,n,e){if(n in s)return s[n];if(arguments.length===3)return e;throw new Error('"'+n+'" is a required argument.')}ee.getArg=Ja;var Ss=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Xa=/^data:.+\,.+$/;function St(s){var n=s.match(Ss);return n?{scheme:n[1],auth:n[2],host:n[3],port:n[4],path:n[5]}:null}ee.urlParse=St;function rt(s){var n="";return s.scheme&&(n+=s.scheme+":"),n+="//",s.auth&&(n+=s.auth+"@"),s.host&&(n+=s.host),s.port&&(n+=":"+s.port),s.path&&(n+=s.path),n}ee.urlGenerate=rt;var Qa=32;function Ya(s){var n=[];return function(e){for(var t=0;t<n.length;t++)if(n[t].input===e){var r=n[0];return n[0]=n[t],n[t]=r,n[0].result}var i=s(e);return n.unshift({input:e,result:i}),n.length>Qa&&n.pop(),i}}var er=Ya(function(n){var e=n,t=St(n);if(t){if(!t.path)return n;e=t.path}for(var r=ee.isAbsolute(e),i=[],a=0,o=0;;)if(a=o,o=e.indexOf("/",a),o===-1){i.push(e.slice(a));break}else for(i.push(e.slice(a,o));o<e.length&&e[o]==="/";)o++;for(var l,c=0,o=i.length-1;o>=0;o--)l=i[o],l==="."?i.splice(o,1):l===".."?c++:c>0&&(l===""?(i.splice(o+1,c),c=0):(i.splice(o,2),c--));return e=i.join("/"),e===""&&(e=r?"/":"."),t?(t.path=e,rt(t)):e});ee.normalize=er;function Is(s,n){s===""&&(s="."),n===""&&(n=".");var e=St(n),t=St(s);if(t&&(s=t.path||"/"),e&&!e.scheme)return t&&(e.scheme=t.scheme),rt(e);if(e||n.match(Xa))return n;if(t&&!t.host&&!t.path)return t.host=n,rt(t);var r=n.charAt(0)==="/"?n:er(s.replace(/\/+$/,"")+"/"+n);return t?(t.path=r,rt(t)):r}ee.join=Is;ee.isAbsolute=function(s){return s.charAt(0)==="/"||Ss.test(s)};function Za(s,n){s===""&&(s="."),s=s.replace(/\/$/,"");for(var e=0;n.indexOf(s+"/")!==0;){var t=s.lastIndexOf("/");if(t<0||(s=s.slice(0,t),s.match(/^([^\/]+:\/)?\/*$/)))return n;++e}return Array(e+1).join("../")+n.substr(s.length+1)}ee.relative=Za;var Es=function(){var s=Object.create(null);return!("__proto__"in s)}();function As(s){return s}function eo(s){return ks(s)?"$"+s:s}ee.toSetString=Es?As:eo;function to(s){return ks(s)?s.slice(1):s}ee.fromSetString=Es?As:to;function ks(s){if(!s)return!1;var n=s.length;if(n<9||s.charCodeAt(n-1)!==95||s.charCodeAt(n-2)!==95||s.charCodeAt(n-3)!==111||s.charCodeAt(n-4)!==116||s.charCodeAt(n-5)!==111||s.charCodeAt(n-6)!==114||s.charCodeAt(n-7)!==112||s.charCodeAt(n-8)!==95||s.charCodeAt(n-9)!==95)return!1;for(var e=n-10;e>=0;e--)if(s.charCodeAt(e)!==36)return!1;return!0}function no(s,n,e){var t=De(s.source,n.source);return t!==0||(t=s.originalLine-n.originalLine,t!==0)||(t=s.originalColumn-n.originalColumn,t!==0||e)||(t=s.generatedColumn-n.generatedColumn,t!==0)||(t=s.generatedLine-n.generatedLine,t!==0)?t:De(s.name,n.name)}ee.compareByOriginalPositions=no;function ro(s,n,e){var t;return t=s.originalLine-n.originalLine,t!==0||(t=s.originalColumn-n.originalColumn,t!==0||e)||(t=s.generatedColumn-n.generatedColumn,t!==0)||(t=s.generatedLine-n.generatedLine,t!==0)?t:De(s.name,n.name)}ee.compareByOriginalPositionsNoSource=ro;function so(s,n,e){var t=s.generatedLine-n.generatedLine;return t!==0||(t=s.generatedColumn-n.generatedColumn,t!==0||e)||(t=De(s.source,n.source),t!==0)||(t=s.originalLine-n.originalLine,t!==0)||(t=s.originalColumn-n.originalColumn,t!==0)?t:De(s.name,n.name)}ee.compareByGeneratedPositionsDeflated=so;function io(s,n,e){var t=s.generatedColumn-n.generatedColumn;return t!==0||e||(t=De(s.source,n.source),t!==0)||(t=s.originalLine-n.originalLine,t!==0)||(t=s.originalColumn-n.originalColumn,t!==0)?t:De(s.name,n.name)}ee.compareByGeneratedPositionsDeflatedNoLine=io;function De(s,n){return s===n?0:s===null?1:n===null?-1:s>n?1:-1}function ao(s,n){var e=s.generatedLine-n.generatedLine;return e!==0||(e=s.generatedColumn-n.generatedColumn,e!==0)||(e=De(s.source,n.source),e!==0)||(e=s.originalLine-n.originalLine,e!==0)||(e=s.originalColumn-n.originalColumn,e!==0)?e:De(s.name,n.name)}ee.compareByGeneratedPositionsInflated=ao;function oo(s){return JSON.parse(s.replace(/^\)]}'[^\n]*\n/,""))}ee.parseSourceMapInput=oo;function lo(s,n,e){if(n=n||"",s&&(s[s.length-1]!=="/"&&n[0]!=="/"&&(s+="/"),n=s+n),e){var t=St(e);if(!t)throw new Error("sourceMapURL could not be parsed");if(t.path){var r=t.path.lastIndexOf("/");r>=0&&(t.path=t.path.substring(0,r+1))}n=Is(rt(t),n)}return er(n)}ee.computeSourceURL=lo});var rr=he(Ns=>{"use strict";var tr=st(),nr=Object.prototype.hasOwnProperty,Ke=typeof Map<"u";function Le(){this._array=[],this._set=Ke?new Map:Object.create(null)}Le.fromArray=function(n,e){for(var t=new Le,r=0,i=n.length;r<i;r++)t.add(n[r],e);return t};Le.prototype.size=function(){return Ke?this._set.size:Object.getOwnPropertyNames(this._set).length};Le.prototype.add=function(n,e){var t=Ke?n:tr.toSetString(n),r=Ke?this.has(n):nr.call(this._set,t),i=this._array.length;(!r||e)&&this._array.push(n),r||(Ke?this._set.set(n,i):this._set[t]=i)};Le.prototype.has=function(n){if(Ke)return this._set.has(n);var e=tr.toSetString(n);return nr.call(this._set,e)};Le.prototype.indexOf=function(n){if(Ke){var e=this._set.get(n);if(e>=0)return e}else{var t=tr.toSetString(n);if(nr.call(this._set,t))return this._set[t]}throw new Error('"'+n+'" is not in the set.')};Le.prototype.at=function(n){if(n>=0&&n<this._array.length)return this._array[n];throw new Error("No element indexed by "+n)};Le.prototype.toArray=function(){return this._array.slice()};Ns.ArraySet=Le});var Ls=he(Ds=>{"use strict";var Ms=st();function co(s,n){var e=s.generatedLine,t=n.generatedLine,r=s.generatedColumn,i=n.generatedColumn;return t>e||t==e&&i>=r||Ms.compareByGeneratedPositionsInflated(s,n)<=0}function on(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}on.prototype.unsortedForEach=function(n,e){this._array.forEach(n,e)};on.prototype.add=function(n){co(this._last,n)?(this._last=n,this._array.push(n)):(this._sorted=!1,this._array.push(n))};on.prototype.toArray=function(){return this._sorted||(this._array.sort(Ms.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};Ds.MappingList=on});var sr=he(Os=>{"use strict";var It=Zn(),Q=st(),ln=rr().ArraySet,po=Ls().MappingList;function me(s){s||(s={}),this._file=Q.getArg(s,"file",null),this._sourceRoot=Q.getArg(s,"sourceRoot",null),this._skipValidation=Q.getArg(s,"skipValidation",!1),this._sources=new ln,this._names=new ln,this._mappings=new po,this._sourcesContents=null}me.prototype._version=3;me.fromSourceMap=function(n){var e=n.sourceRoot,t=new me({file:n.file,sourceRoot:e});return n.eachMapping(function(r){var i={generated:{line:r.generatedLine,column:r.generatedColumn}};r.source!=null&&(i.source=r.source,e!=null&&(i.source=Q.relative(e,i.source)),i.original={line:r.originalLine,column:r.originalColumn},r.name!=null&&(i.name=r.name)),t.addMapping(i)}),n.sources.forEach(function(r){var i=r;e!==null&&(i=Q.relative(e,r)),t._sources.has(i)||t._sources.add(i);var a=n.sourceContentFor(r);a!=null&&t.setSourceContent(r,a)}),t};me.prototype.addMapping=function(n){var e=Q.getArg(n,"generated"),t=Q.getArg(n,"original",null),r=Q.getArg(n,"source",null),i=Q.getArg(n,"name",null);this._skipValidation||this._validateMapping(e,t,r,i),r!=null&&(r=String(r),this._sources.has(r)||this._sources.add(r)),i!=null&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:e.line,generatedColumn:e.column,originalLine:t!=null&&t.line,originalColumn:t!=null&&t.column,source:r,name:i})};me.prototype.setSourceContent=function(n,e){var t=n;this._sourceRoot!=null&&(t=Q.relative(this._sourceRoot,t)),e!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[Q.toSetString(t)]=e):this._sourcesContents&&(delete this._sourcesContents[Q.toSetString(t)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};me.prototype.applySourceMap=function(n,e,t){var r=e;if(e==null){if(n.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);r=n.file}var i=this._sourceRoot;i!=null&&(r=Q.relative(i,r));var a=new ln,o=new ln;this._mappings.unsortedForEach(function(l){if(l.source===r&&l.originalLine!=null){var c=n.originalPositionFor({line:l.originalLine,column:l.originalColumn});c.source!=null&&(l.source=c.source,t!=null&&(l.source=Q.join(t,l.source)),i!=null&&(l.source=Q.relative(i,l.source)),l.originalLine=c.line,l.originalColumn=c.column,c.name!=null&&(l.name=c.name))}var p=l.source;p!=null&&!a.has(p)&&a.add(p);var u=l.name;u!=null&&!o.has(u)&&o.add(u)},this),this._sources=a,this._names=o,n.sources.forEach(function(l){var c=n.sourceContentFor(l);c!=null&&(t!=null&&(l=Q.join(t,l)),i!=null&&(l=Q.relative(i,l)),this.setSourceContent(l,c))},this)};me.prototype._validateMapping=function(n,e,t,r){if(e&&typeof e.line!="number"&&typeof e.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(n&&"line"in n&&"column"in n&&n.line>0&&n.column>=0&&!e&&!t&&!r)){if(n&&"line"in n&&"column"in n&&e&&"line"in e&&"column"in e&&n.line>0&&n.column>=0&&e.line>0&&e.column>=0&&t)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:n,source:t,original:e,name:r}))}};me.prototype._serializeMappings=function(){for(var n=0,e=1,t=0,r=0,i=0,a=0,o="",l,c,p,u,h=this._mappings.toArray(),m=0,d=h.length;m<d;m++){if(c=h[m],l="",c.generatedLine!==e)for(n=0;c.generatedLine!==e;)l+=";",e++;else if(m>0){if(!Q.compareByGeneratedPositionsInflated(c,h[m-1]))continue;l+=","}l+=It.encode(c.generatedColumn-n),n=c.generatedColumn,c.source!=null&&(u=this._sources.indexOf(c.source),l+=It.encode(u-a),a=u,l+=It.encode(c.originalLine-1-r),r=c.originalLine-1,l+=It.encode(c.originalColumn-t),t=c.originalColumn,c.name!=null&&(p=this._names.indexOf(c.name),l+=It.encode(p-i),i=p)),o+=l}return o};me.prototype._generateSourcesContent=function(n,e){return n.map(function(t){if(!this._sourcesContents)return null;e!=null&&(t=Q.relative(e,t));var r=Q.toSetString(t);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)};me.prototype.toJSON=function(){var n={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(n.file=this._file),this._sourceRoot!=null&&(n.sourceRoot=this._sourceRoot),this._sourcesContents&&(n.sourcesContent=this._generateSourcesContent(n.sources,n.sourceRoot)),n};me.prototype.toString=function(){return JSON.stringify(this.toJSON())};Os.SourceMapGenerator=me});var Fs=he(Je=>{"use strict";Je.GREATEST_LOWER_BOUND=1;Je.LEAST_UPPER_BOUND=2;function ir(s,n,e,t,r,i){var a=Math.floor((n-s)/2)+s,o=r(e,t[a],!0);return o===0?a:o>0?n-a>1?ir(a,n,e,t,r,i):i==Je.LEAST_UPPER_BOUND?n<t.length?n:-1:a:a-s>1?ir(s,a,e,t,r,i):i==Je.LEAST_UPPER_BOUND?a:s<0?-1:s}Je.search=function(n,e,t,r){if(e.length===0)return-1;var i=ir(-1,e.length,n,e,t,r||Je.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&t(e[i],e[i-1],!0)===0;)--i;return i}});var Bs=he(_s=>{"use strict";function uo(s){function n(r,i,a){var o=r[i];r[i]=r[a],r[a]=o}function e(r,i){return Math.round(r+Math.random()*(i-r))}function t(r,i,a,o){if(a<o){var l=e(a,o),c=a-1;n(r,l,o);for(var p=r[o],u=a;u<o;u++)i(r[u],p,!1)<=0&&(c+=1,n(r,c,u));n(r,c+1,u);var h=c+1;t(r,i,a,h-1),t(r,i,h+1,o)}}return t}function ho(s){let n=uo.toString();return new Function(`return ${n}`)()(s)}var Us=new WeakMap;_s.quickSort=function(s,n,e=0){let t=Us.get(n);t===void 0&&(t=ho(n),Us.set(n,t)),t(s,n,e,s.length-1)}});var Vs=he(cn=>{"use strict";var M=st(),or=Fs(),it=rr().ArraySet,fo=Zn(),Et=Bs().quickSort;function W(s,n){var e=s;return typeof s=="string"&&(e=M.parseSourceMapInput(s)),e.sections!=null?new ve(e,n):new te(e,n)}W.fromSourceMap=function(s,n){return te.fromSourceMap(s,n)};W.prototype._version=3;W.prototype.__generatedMappings=null;Object.defineProperty(W.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});W.prototype.__originalMappings=null;Object.defineProperty(W.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});W.prototype._charIsMappingSeparator=function(n,e){var t=n.charAt(e);return t===";"||t===","};W.prototype._parseMappings=function(n,e){throw new Error("Subclasses must implement _parseMappings")};W.GENERATED_ORDER=1;W.ORIGINAL_ORDER=2;W.GREATEST_LOWER_BOUND=1;W.LEAST_UPPER_BOUND=2;W.prototype.eachMapping=function(n,e,t){var r=e||null,i=t||W.GENERATED_ORDER,a;switch(i){case W.GENERATED_ORDER:a=this._generatedMappings;break;case W.ORIGINAL_ORDER:a=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var o=this.sourceRoot,l=n.bind(r),c=this._names,p=this._sources,u=this._sourceMapURL,h=0,m=a.length;h<m;h++){var d=a[h],g=d.source===null?null:p.at(d.source);g=M.computeSourceURL(o,g,u),l({source:g,generatedLine:d.generatedLine,generatedColumn:d.generatedColumn,originalLine:d.originalLine,originalColumn:d.originalColumn,name:d.name===null?null:c.at(d.name)})}};W.prototype.allGeneratedPositionsFor=function(n){var e=M.getArg(n,"line"),t={source:M.getArg(n,"source"),originalLine:e,originalColumn:M.getArg(n,"column",0)};if(t.source=this._findSourceIndex(t.source),t.source<0)return[];var r=[],i=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",M.compareByOriginalPositions,or.LEAST_UPPER_BOUND);if(i>=0){var a=this._originalMappings[i];if(n.column===void 0)for(var o=a.originalLine;a&&a.originalLine===o;)r.push({line:M.getArg(a,"generatedLine",null),column:M.getArg(a,"generatedColumn",null),lastColumn:M.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++i];else for(var l=a.originalColumn;a&&a.originalLine===e&&a.originalColumn==l;)r.push({line:M.getArg(a,"generatedLine",null),column:M.getArg(a,"generatedColumn",null),lastColumn:M.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++i]}return r};cn.SourceMapConsumer=W;function te(s,n){var e=s;typeof s=="string"&&(e=M.parseSourceMapInput(s));var t=M.getArg(e,"version"),r=M.getArg(e,"sources"),i=M.getArg(e,"names",[]),a=M.getArg(e,"sourceRoot",null),o=M.getArg(e,"sourcesContent",null),l=M.getArg(e,"mappings"),c=M.getArg(e,"file",null);if(t!=this._version)throw new Error("Unsupported version: "+t);a&&(a=M.normalize(a)),r=r.map(String).map(M.normalize).map(function(p){return a&&M.isAbsolute(a)&&M.isAbsolute(p)?M.relative(a,p):p}),this._names=it.fromArray(i.map(String),!0),this._sources=it.fromArray(r,!0),this._absoluteSources=this._sources.toArray().map(function(p){return M.computeSourceURL(a,p,n)}),this.sourceRoot=a,this.sourcesContent=o,this._mappings=l,this._sourceMapURL=n,this.file=c}te.prototype=Object.create(W.prototype);te.prototype.consumer=W;te.prototype._findSourceIndex=function(s){var n=s;if(this.sourceRoot!=null&&(n=M.relative(this.sourceRoot,n)),this._sources.has(n))return this._sources.indexOf(n);var e;for(e=0;e<this._absoluteSources.length;++e)if(this._absoluteSources[e]==s)return e;return-1};te.fromSourceMap=function(n,e){var t=Object.create(te.prototype),r=t._names=it.fromArray(n._names.toArray(),!0),i=t._sources=it.fromArray(n._sources.toArray(),!0);t.sourceRoot=n._sourceRoot,t.sourcesContent=n._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=n._file,t._sourceMapURL=e,t._absoluteSources=t._sources.toArray().map(function(m){return M.computeSourceURL(t.sourceRoot,m,e)});for(var a=n._mappings.toArray().slice(),o=t.__generatedMappings=[],l=t.__originalMappings=[],c=0,p=a.length;c<p;c++){var u=a[c],h=new js;h.generatedLine=u.generatedLine,h.generatedColumn=u.generatedColumn,u.source&&(h.source=i.indexOf(u.source),h.originalLine=u.originalLine,h.originalColumn=u.originalColumn,u.name&&(h.name=r.indexOf(u.name)),l.push(h)),o.push(h)}return Et(t.__originalMappings,M.compareByOriginalPositions),t};te.prototype._version=3;Object.defineProperty(te.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function js(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}var ar=M.compareByGeneratedPositionsDeflatedNoLine;function Rs(s,n){let e=s.length,t=s.length-n;if(!(t<=1))if(t==2){let r=s[n],i=s[n+1];ar(r,i)>0&&(s[n]=i,s[n+1]=r)}else if(t<20)for(let r=n;r<e;r++)for(let i=r;i>n;i--){let a=s[i-1],o=s[i];if(ar(a,o)<=0)break;s[i-1]=o,s[i]=a}else Et(s,ar,n)}te.prototype._parseMappings=function(n,e){var t=1,r=0,i=0,a=0,o=0,l=0,c=n.length,p=0,u={},h={},m=[],d=[],g,f,v,w,E;let x=0;for(;p<c;)if(n.charAt(p)===";")t++,p++,r=0,Rs(d,x),x=d.length;else if(n.charAt(p)===",")p++;else{for(g=new js,g.generatedLine=t,w=p;w<c&&!this._charIsMappingSeparator(n,w);w++);for(f=n.slice(p,w),v=[];p<w;)fo.decode(n,p,h),E=h.value,p=h.rest,v.push(E);if(v.length===2)throw new Error("Found a source, but no line and column");if(v.length===3)throw new Error("Found a source and line, but no column");if(g.generatedColumn=r+v[0],r=g.generatedColumn,v.length>1&&(g.source=o+v[1],o+=v[1],g.originalLine=i+v[2],i=g.originalLine,g.originalLine+=1,g.originalColumn=a+v[3],a=g.originalColumn,v.length>4&&(g.name=l+v[4],l+=v[4])),d.push(g),typeof g.originalLine=="number"){let C=g.source;for(;m.length<=C;)m.push(null);m[C]===null&&(m[C]=[]),m[C].push(g)}}Rs(d,x),this.__generatedMappings=d;for(var P=0;P<m.length;P++)m[P]!=null&&Et(m[P],M.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...m)};te.prototype._findMapping=function(n,e,t,r,i,a){if(n[t]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+n[t]);if(n[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+n[r]);return or.search(n,e,i,a)};te.prototype.computeColumnSpans=function(){for(var n=0;n<this._generatedMappings.length;++n){var e=this._generatedMappings[n];if(n+1<this._generatedMappings.length){var t=this._generatedMappings[n+1];if(e.generatedLine===t.generatedLine){e.lastGeneratedColumn=t.generatedColumn-1;continue}}e.lastGeneratedColumn=1/0}};te.prototype.originalPositionFor=function(n){var e={generatedLine:M.getArg(n,"line"),generatedColumn:M.getArg(n,"column")},t=this._findMapping(e,this._generatedMappings,"generatedLine","generatedColumn",M.compareByGeneratedPositionsDeflated,M.getArg(n,"bias",W.GREATEST_LOWER_BOUND));if(t>=0){var r=this._generatedMappings[t];if(r.generatedLine===e.generatedLine){var i=M.getArg(r,"source",null);i!==null&&(i=this._sources.at(i),i=M.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var a=M.getArg(r,"name",null);return a!==null&&(a=this._names.at(a)),{source:i,line:M.getArg(r,"originalLine",null),column:M.getArg(r,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}};te.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(n){return n==null}):!1};te.prototype.sourceContentFor=function(n,e){if(!this.sourcesContent)return null;var t=this._findSourceIndex(n);if(t>=0)return this.sourcesContent[t];var r=n;this.sourceRoot!=null&&(r=M.relative(this.sourceRoot,r));var i;if(this.sourceRoot!=null&&(i=M.urlParse(this.sourceRoot))){var a=r.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(a))return this.sourcesContent[this._sources.indexOf(a)];if((!i.path||i.path=="/")&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(e)return null;throw new Error('"'+r+'" is not in the SourceMap.')};te.prototype.generatedPositionFor=function(n){var e=M.getArg(n,"source");if(e=this._findSourceIndex(e),e<0)return{line:null,column:null,lastColumn:null};var t={source:e,originalLine:M.getArg(n,"line"),originalColumn:M.getArg(n,"column")},r=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",M.compareByOriginalPositions,M.getArg(n,"bias",W.GREATEST_LOWER_BOUND));if(r>=0){var i=this._originalMappings[r];if(i.source===t.source)return{line:M.getArg(i,"generatedLine",null),column:M.getArg(i,"generatedColumn",null),lastColumn:M.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};cn.BasicSourceMapConsumer=te;function ve(s,n){var e=s;typeof s=="string"&&(e=M.parseSourceMapInput(s));var t=M.getArg(e,"version"),r=M.getArg(e,"sections");if(t!=this._version)throw new Error("Unsupported version: "+t);this._sources=new it,this._names=new it;var i={line:-1,column:0};this._sections=r.map(function(a){if(a.url)throw new Error("Support for url field in sections not implemented.");var o=M.getArg(a,"offset"),l=M.getArg(o,"line"),c=M.getArg(o,"column");if(l<i.line||l===i.line&&c<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=o,{generatedOffset:{generatedLine:l+1,generatedColumn:c+1},consumer:new W(M.getArg(a,"map"),n)}})}ve.prototype=Object.create(W.prototype);ve.prototype.constructor=W;ve.prototype._version=3;Object.defineProperty(ve.prototype,"sources",{get:function(){for(var s=[],n=0;n<this._sections.length;n++)for(var e=0;e<this._sections[n].consumer.sources.length;e++)s.push(this._sections[n].consumer.sources[e]);return s}});ve.prototype.originalPositionFor=function(n){var e={generatedLine:M.getArg(n,"line"),generatedColumn:M.getArg(n,"column")},t=or.search(e,this._sections,function(i,a){var o=i.generatedLine-a.generatedOffset.generatedLine;return o||i.generatedColumn-a.generatedOffset.generatedColumn}),r=this._sections[t];return r?r.consumer.originalPositionFor({line:e.generatedLine-(r.generatedOffset.generatedLine-1),column:e.generatedColumn-(r.generatedOffset.generatedLine===e.generatedLine?r.generatedOffset.generatedColumn-1:0),bias:n.bias}):{source:null,line:null,column:null,name:null}};ve.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(n){return n.consumer.hasContentsOfAllSources()})};ve.prototype.sourceContentFor=function(n,e){for(var t=0;t<this._sections.length;t++){var r=this._sections[t],i=r.consumer.sourceContentFor(n,!0);if(i)return i}if(e)return null;throw new Error('"'+n+'" is not in the SourceMap.')};ve.prototype.generatedPositionFor=function(n){for(var e=0;e<this._sections.length;e++){var t=this._sections[e];if(t.consumer._findSourceIndex(M.getArg(n,"source"))!==-1){var r=t.consumer.generatedPositionFor(n);if(r){var i={line:r.line+(t.generatedOffset.generatedLine-1),column:r.column+(t.generatedOffset.generatedLine===r.line?t.generatedOffset.generatedColumn-1:0)};return i}}}return{line:null,column:null}};ve.prototype._parseMappings=function(n,e){this.__generatedMappings=[],this.__originalMappings=[];for(var t=0;t<this._sections.length;t++)for(var r=this._sections[t],i=r.consumer._generatedMappings,a=0;a<i.length;a++){var o=i[a],l=r.consumer._sources.at(o.source);l=M.computeSourceURL(r.consumer.sourceRoot,l,this._sourceMapURL),this._sources.add(l),l=this._sources.indexOf(l);var c=null;o.name&&(c=r.consumer._names.at(o.name),this._names.add(c),c=this._names.indexOf(c));var p={source:l,generatedLine:o.generatedLine+(r.generatedOffset.generatedLine-1),generatedColumn:o.generatedColumn+(r.generatedOffset.generatedLine===o.generatedLine?r.generatedOffset.generatedColumn-1:0),originalLine:o.originalLine,originalColumn:o.originalColumn,name:c};this.__generatedMappings.push(p),typeof p.originalLine=="number"&&this.__originalMappings.push(p)}Et(this.__generatedMappings,M.compareByGeneratedPositionsDeflated),Et(this.__originalMappings,M.compareByOriginalPositions)};cn.IndexedSourceMapConsumer=ve});var $s=he(zs=>{"use strict";var mo=sr().SourceMapGenerator,pn=st(),bo=/(\r?\n)/,go=10,at="$$$isSourceNode$$$";function le(s,n,e,t,r){this.children=[],this.sourceContents={},this.line=s??null,this.column=n??null,this.source=e??null,this.name=r??null,this[at]=!0,t!=null&&this.add(t)}le.fromStringWithSourceMap=function(n,e,t){var r=new le,i=n.split(bo),a=0,o=function(){var h=d(),m=d()||"";return h+m;function d(){return a<i.length?i[a++]:void 0}},l=1,c=0,p=null;return e.eachMapping(function(h){if(p!==null)if(l<h.generatedLine)u(p,o()),l++,c=0;else{var m=i[a]||"",d=m.substr(0,h.generatedColumn-c);i[a]=m.substr(h.generatedColumn-c),c=h.generatedColumn,u(p,d),p=h;return}for(;l<h.generatedLine;)r.add(o()),l++;if(c<h.generatedColumn){var m=i[a]||"";r.add(m.substr(0,h.generatedColumn)),i[a]=m.substr(h.generatedColumn),c=h.generatedColumn}p=h},this),a<i.length&&(p&&u(p,o()),r.add(i.splice(a).join(""))),e.sources.forEach(function(h){var m=e.sourceContentFor(h);m!=null&&(t!=null&&(h=pn.join(t,h)),r.setSourceContent(h,m))}),r;function u(h,m){if(h===null||h.source===void 0)r.add(m);else{var d=t?pn.join(t,h.source):h.source;r.add(new le(h.originalLine,h.originalColumn,d,m,h.name))}}};le.prototype.add=function(n){if(Array.isArray(n))n.forEach(function(e){this.add(e)},this);else if(n[at]||typeof n=="string")n&&this.children.push(n);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+n);return this};le.prototype.prepend=function(n){if(Array.isArray(n))for(var e=n.length-1;e>=0;e--)this.prepend(n[e]);else if(n[at]||typeof n=="string")this.children.unshift(n);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+n);return this};le.prototype.walk=function(n){for(var e,t=0,r=this.children.length;t<r;t++)e=this.children[t],e[at]?e.walk(n):e!==""&&n(e,{source:this.source,line:this.line,column:this.column,name:this.name})};le.prototype.join=function(n){var e,t,r=this.children.length;if(r>0){for(e=[],t=0;t<r-1;t++)e.push(this.children[t]),e.push(n);e.push(this.children[t]),this.children=e}return this};le.prototype.replaceRight=function(n,e){var t=this.children[this.children.length-1];return t[at]?t.replaceRight(n,e):typeof t=="string"?this.children[this.children.length-1]=t.replace(n,e):this.children.push("".replace(n,e)),this};le.prototype.setSourceContent=function(n,e){this.sourceContents[pn.toSetString(n)]=e};le.prototype.walkSourceContents=function(n){for(var e=0,t=this.children.length;e<t;e++)this.children[e][at]&&this.children[e].walkSourceContents(n);for(var r=Object.keys(this.sourceContents),e=0,t=r.length;e<t;e++)n(pn.fromSetString(r[e]),this.sourceContents[r[e]])};le.prototype.toString=function(){var n="";return this.walk(function(e){n+=e}),n};le.prototype.toStringWithSourceMap=function(n){var e={code:"",line:1,column:0},t=new mo(n),r=!1,i=null,a=null,o=null,l=null;return this.walk(function(c,p){e.code+=c,p.source!==null&&p.line!==null&&p.column!==null?((i!==p.source||a!==p.line||o!==p.column||l!==p.name)&&t.addMapping({source:p.source,original:{line:p.line,column:p.column},generated:{line:e.line,column:e.column},name:p.name}),i=p.source,a=p.line,o=p.column,l=p.name,r=!0):r&&(t.addMapping({generated:{line:e.line,column:e.column}}),i=null,r=!1);for(var u=0,h=c.length;u<h;u++)c.charCodeAt(u)===go?(e.line++,e.column=0,u+1===h?(i=null,r=!1):r&&t.addMapping({source:p.source,original:{line:p.line,column:p.column},generated:{line:e.line,column:e.column},name:p.name})):e.column++}),this.walkSourceContents(function(c,p){t.setSourceContent(c,p)}),{code:e.code,map:t}};zs.SourceNode=le});var lr=he(un=>{"use strict";un.SourceMapGenerator=sr().SourceMapGenerator;un.SourceMapConsumer=Vs().SourceMapConsumer;un.SourceNode=$s().SourceNode});var qr=he(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});function yn(s,n){if(s==null)return{};var e={},t=Object.keys(s),r,i;for(i=0;i<t.length;i++)r=t[i],!(n.indexOf(r)>=0)&&(e[r]=s[r]);return e}var ke=class{constructor(n,e,t){this.line=void 0,this.column=void 0,this.index=void 0,this.line=n,this.column=e,this.index=t}},pt=class{constructor(n,e){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=n,this.end=e}};function se(s,n){let{line:e,column:t,index:r}=s;return new ke(e,t+n,r+n)}var qs="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",yo={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:qs},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:qs}},Hs={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},fn=({type:s,prefix:n})=>s==="UpdateExpression"?Hs.UpdateExpression[String(n)]:Hs[s],vo={AccessorIsGenerator:({kind:s})=>`A ${s}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncFunction:"'await' is only allowed within async functions.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:s})=>`Missing initializer in ${s} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:s})=>`\`${s}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",DynamicImportPhaseRequiresImportExpressions:({phase:s})=>`'import.${s}(...)' can only be parsed when using the 'createImportExpressions' option.`,ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:s,exportName:n})=>`A string literal cannot be used as an exported binding without \`from\`.
|
|
3
3
|
- Did you mean \`export { '${s}' as '${n}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:s})=>`'${s==="ForInStatement"?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:s})=>`Unsyntactic ${s==="BreakStatement"?"break":"continue"}.`,IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list.",IllegalReturn:"'return' outside of function.",ImportAttributesUseAssert:"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedAssertSyntax: true` option in the import attributes plugin to suppress this error.",ImportBindingIsString:({importName:s})=>`A string literal cannot be used as an imported binding.
|
|
4
|
-
- Did you mean \`import { "${s}" as foo }\`?`,ImportCallArgumentTrailingComma:"Trailing comma is disallowed inside import(...) arguments.",ImportCallArity:({maxArgumentCount:s})=>`\`import()\` requires exactly ${s===1?"one argument":"one or two arguments"}.`,ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:s})=>`Expected number in radix ${s}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:s})=>`Escape sequence in keyword ${s}.`,InvalidIdentifier:({identifierName:s})=>`Invalid identifier ${s}.`,InvalidLhs:({ancestor:s})=>`Invalid left-hand side in ${fn(s)}.`,InvalidLhsBinding:({ancestor:s})=>`Binding invalid left-hand side in ${fn(s)}.`,InvalidLhsOptionalChaining:({ancestor:s})=>`Invalid optional chaining in the left-hand side of ${fn(s)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:s})=>`Unexpected character '${s}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:s})=>`Private name #${s} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:s})=>`Label '${s}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:s})=>`This experimental syntax requires enabling the parser plugin: ${s.map(n=>JSON.stringify(n)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:s})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${s.map(n=>JSON.stringify(n)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:s})=>`Duplicate key "${s}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:s})=>`An export name cannot include a lone surrogate, found '\\u${s.toString(16)}'.`,ModuleExportUndefined:({localName:s})=>`Export '${s}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:s})=>`Private names are only allowed in property accesses (\`obj.#${s}\`) or in \`in\` expressions (\`#${s} in obj\`).`,PrivateNameRedeclaration:({identifierName:s})=>`Duplicate private name #${s}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:s})=>`Unexpected keyword '${s}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:s})=>`Unexpected reserved word '${s}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:s,unexpected:n})=>`Unexpected token${n?` '${n}'.`:""}${s?`, expected "${s}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script`.",UnsupportedBind:"Binding should be performed on object property.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:s,onlyValidPropertyName:n})=>`The only valid meta property for ${s} is ${s}.${n}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:s})=>`Identifier '${s}' has already been declared.`,YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},xo={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:s})=>`Assigning to '${s}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:s})=>`Binding '${s}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},Po=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),To={PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:s})=>`Invalid topic token ${s}. In order to use ${s} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${s}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:s})=>`Hack-style pipe body cannot be an unparenthesized ${fn({type:s})}; please wrap it in parentheses.`,PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",PrimaryTopicNotAllowed:"Topic reference was used in a lexical context without topic binding.",PrimaryTopicRequiresSmartPipeline:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'},wo=["toMessage"],Co=["message"];function Ws(s,n,e){Object.defineProperty(s,n,{enumerable:!1,configurable:!0,value:e})}function So(s){let{toMessage:n}=s,e=gn(s,wo);return function t({loc:r,details:i}){let a=new SyntaxError;return Object.assign(a,e,{loc:r,pos:r.index}),"missingPlugin"in i&&Object.assign(a,{missingPlugin:i.missingPlugin}),Ws(a,"clone",function(l={}){var c;let{line:p,column:u,index:h}=(c=l.loc)!=null?c:r;return t({loc:new ke(p,u,h),details:Object.assign({},i,l.details)})}),Ws(a,"details",i),Object.defineProperty(a,"message",{configurable:!0,get(){let o=`${n(i)} (${r.line}:${r.column})`;return this.message=o,o},set(o){Object.defineProperty(this,"message",{value:o,writable:!0})}}),a}}function Ue(s,n){if(Array.isArray(s))return t=>Ue(t,s[0]);let e={};for(let t of Object.keys(s)){let r=s[t],i=typeof r=="string"?{message:()=>r}:typeof r=="function"?{message:r}:r,{message:a}=i,o=gn(i,Co),l=typeof a=="string"?()=>a:a;e[t]=So(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:t,toMessage:l},n?{syntaxPlugin:n}:{},o))}return e}var b=Object.assign({},Ue(go),Ue(vo),Ue(xo),Ue`pipelineOperator`(To)),{defineProperty:Eo}=Object,Gs=(s,n)=>Eo(s,n,{enumerable:!1,value:s[n]});function At(s){return s.loc.start&&Gs(s.loc.start,"index"),s.loc.end&&Gs(s.loc.end,"index"),s}var Io=s=>class extends s{parse(){let e=At(super.parse());return this.options.tokens&&(e.tokens=e.tokens.map(At)),e}parseRegExpLiteral({pattern:e,flags:t}){let r=null;try{r=new RegExp(e,t)}catch{}let i=this.estreeParseLiteral(r);return i.regex={pattern:e,flags:t},i}parseBigIntLiteral(e){let t;try{t=BigInt(e)}catch{t=null}let r=this.estreeParseLiteral(t);return r.bigint=String(r.value||e),r}parseDecimalLiteral(e){let r=this.estreeParseLiteral(null);return r.decimal=String(r.value||e),r}estreeParseLiteral(e){return this.parseLiteral(e,"Literal")}parseStringLiteral(e){return this.estreeParseLiteral(e)}parseNumericLiteral(e){return this.estreeParseLiteral(e)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(e){return this.estreeParseLiteral(e)}directiveToStmt(e){let t=e.value;delete e.value,t.type="Literal",t.raw=t.extra.raw,t.value=t.extra.expressionValue;let r=e;return r.type="ExpressionStatement",r.expression=t,r.directive=t.extra.rawValue,delete t.extra,r}initFunction(e,t){super.initFunction(e,t),e.expression=!1}checkDeclaration(e){e!=null&&this.isObjectProperty(e)?this.checkDeclaration(e.value):super.checkDeclaration(e)}getObjectOrClassMethodParams(e){return e.value.params}isValidDirective(e){var t;return e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&!((t=e.expression.extra)!=null&&t.parenthesized)}parseBlockBody(e,t,r,i,a){super.parseBlockBody(e,t,r,i,a);let o=e.directives.map(l=>this.directiveToStmt(l));e.body=o.concat(e.body),delete e.directives}pushClassMethod(e,t,r,i,a,o){this.parseMethod(t,r,i,a,o,"ClassMethod",!0),t.typeParameters&&(t.value.typeParameters=t.typeParameters,delete t.typeParameters),e.body.push(t)}parsePrivateName(){let e=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(e):e}convertPrivateNameToPrivateIdentifier(e){let t=super.getPrivateNameSV(e);return e=e,delete e.id,e.name=t,e.type="PrivateIdentifier",e}isPrivateName(e){return this.getPluginOption("estree","classFeatures")?e.type==="PrivateIdentifier":super.isPrivateName(e)}getPrivateNameSV(e){return this.getPluginOption("estree","classFeatures")?e.name:super.getPrivateNameSV(e)}parseLiteral(e,t){let r=super.parseLiteral(e,t);return r.raw=r.extra.raw,delete r.extra,r}parseFunctionBody(e,t,r=!1){super.parseFunctionBody(e,t,r),e.expression=e.body.type!=="BlockStatement"}parseMethod(e,t,r,i,a,o,l=!1){let c=this.startNode();return c.kind=e.kind,c=super.parseMethod(c,t,r,i,a,o,l),c.type="FunctionExpression",delete c.kind,e.value=c,o==="ClassPrivateMethod"&&(e.computed=!1),this.finishNode(e,"MethodDefinition")}parseClassProperty(...e){let t=super.parseClassProperty(...e);return this.getPluginOption("estree","classFeatures")&&(t.type="PropertyDefinition"),t}parseClassPrivateProperty(...e){let t=super.parseClassPrivateProperty(...e);return this.getPluginOption("estree","classFeatures")&&(t.type="PropertyDefinition",t.computed=!1),t}parseObjectMethod(e,t,r,i,a){let o=super.parseObjectMethod(e,t,r,i,a);return o&&(o.type="Property",o.kind==="method"&&(o.kind="init"),o.shorthand=!1),o}parseObjectProperty(e,t,r,i){let a=super.parseObjectProperty(e,t,r,i);return a&&(a.kind="init",a.type="Property"),a}isValidLVal(e,t,r){return e==="Property"?"value":super.isValidLVal(e,t,r)}isAssignable(e,t){return e!=null&&this.isObjectProperty(e)?this.isAssignable(e.value,t):super.isAssignable(e,t)}toAssignable(e,t=!1){if(e!=null&&this.isObjectProperty(e)){let{key:r,value:i}=e;this.isPrivateName(r)&&this.classScope.usePrivateName(this.getPrivateNameSV(r),r.loc.start),this.toAssignable(i,t)}else super.toAssignable(e,t)}toAssignableObjectExpressionProp(e,t,r){e.kind==="get"||e.kind==="set"?this.raise(b.PatternHasAccessor,{at:e.key}):e.method?this.raise(b.PatternHasMethod,{at:e.key}):super.toAssignableObjectExpressionProp(e,t,r)}finishCallExpression(e,t){let r=super.finishCallExpression(e,t);if(r.callee.type==="Import"){if(r.type="ImportExpression",r.source=r.arguments[0],this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions")){var i,a;r.options=(i=r.arguments[1])!=null?i:null,r.attributes=(a=r.arguments[1])!=null?a:null}delete r.arguments,delete r.callee}return r}toReferencedArguments(e){e.type!=="ImportExpression"&&super.toReferencedArguments(e)}parseExport(e,t){let r=this.state.lastTokStartLoc,i=super.parseExport(e,t);switch(i.type){case"ExportAllDeclaration":i.exported=null;break;case"ExportNamedDeclaration":i.specifiers.length===1&&i.specifiers[0].type==="ExportNamespaceSpecifier"&&(i.type="ExportAllDeclaration",i.exported=i.specifiers[0].exported,delete i.specifiers);case"ExportDefaultDeclaration":{var a;let{declaration:o}=i;o?.type==="ClassDeclaration"&&((a=o.decorators)==null?void 0:a.length)>0&&o.start===i.start&&this.resetStartLocation(i,r)}break}return i}parseSubscript(e,t,r,i){let a=super.parseSubscript(e,t,r,i);if(i.optionalChainMember){if((a.type==="OptionalMemberExpression"||a.type==="OptionalCallExpression")&&(a.type=a.type.substring(8)),i.stop){let o=this.startNodeAtNode(a);return o.expression=a,this.finishNode(o,"ChainExpression")}}else(a.type==="MemberExpression"||a.type==="CallExpression")&&(a.optional=!1);return a}isOptionalMemberExpression(e){return e.type==="ChainExpression"?e.expression.type==="MemberExpression":super.isOptionalMemberExpression(e)}hasPropertyAsPrivateName(e){return e.type==="ChainExpression"&&(e=e.expression),super.hasPropertyAsPrivateName(e)}isObjectProperty(e){return e.type==="Property"&&e.kind==="init"&&!e.method}isObjectMethod(e){return e.method||e.kind==="get"||e.kind==="set"}finishNodeAt(e,t,r){return At(super.finishNodeAt(e,t,r))}resetStartLocation(e,t){super.resetStartLocation(e,t),At(e)}resetEndLocation(e,t=this.state.lastTokEndLoc){super.resetEndLocation(e,t),At(e)}},Qe=class{constructor(n,e){this.token=void 0,this.preserveSpace=void 0,this.token=n,this.preserveSpace=!!e}},V={brace:new Qe("{"),j_oTag:new Qe("<tag"),j_cTag:new Qe("</tag"),j_expr:new Qe("<tag>...</tag>",!0)};V.template=new Qe("`",!0);var U=!0,A=!0,cr=!0,kt=!0,Ve=!0,Ao=!0,vn=class{constructor(n,e={}){this.label=void 0,this.keyword=void 0,this.beforeExpr=void 0,this.startsExpr=void 0,this.rightAssociative=void 0,this.isLoop=void 0,this.isAssign=void 0,this.prefix=void 0,this.postfix=void 0,this.binop=void 0,this.label=n,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.rightAssociative=!!e.rightAssociative,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop!=null?e.binop:null,this.updateContext=null}},Or=new Map;function B(s,n={}){n.keyword=s;let e=D(s,n);return Or.set(s,e),e}function re(s,n){return D(s,{beforeExpr:U,binop:n})}var Lt=-1,Fe=[],Fr=[],_r=[],Ur=[],Br=[],Rr=[];function D(s,n={}){var e,t,r,i;return++Lt,Fr.push(s),_r.push((e=n.binop)!=null?e:-1),Ur.push((t=n.beforeExpr)!=null?t:!1),Br.push((r=n.startsExpr)!=null?r:!1),Rr.push((i=n.prefix)!=null?i:!1),Fe.push(new vn(s,n)),Lt}function _(s,n={}){var e,t,r,i;return++Lt,Or.set(s,Lt),Fr.push(s),_r.push((e=n.binop)!=null?e:-1),Ur.push((t=n.beforeExpr)!=null?t:!1),Br.push((r=n.startsExpr)!=null?r:!1),Rr.push((i=n.prefix)!=null?i:!1),Fe.push(new vn("name",n)),Lt}var ko={bracketL:D("[",{beforeExpr:U,startsExpr:A}),bracketHashL:D("#[",{beforeExpr:U,startsExpr:A}),bracketBarL:D("[|",{beforeExpr:U,startsExpr:A}),bracketR:D("]"),bracketBarR:D("|]"),braceL:D("{",{beforeExpr:U,startsExpr:A}),braceBarL:D("{|",{beforeExpr:U,startsExpr:A}),braceHashL:D("#{",{beforeExpr:U,startsExpr:A}),braceR:D("}"),braceBarR:D("|}"),parenL:D("(",{beforeExpr:U,startsExpr:A}),parenR:D(")"),comma:D(",",{beforeExpr:U}),semi:D(";",{beforeExpr:U}),colon:D(":",{beforeExpr:U}),doubleColon:D("::",{beforeExpr:U}),dot:D("."),question:D("?",{beforeExpr:U}),questionDot:D("?."),arrow:D("=>",{beforeExpr:U}),template:D("template"),ellipsis:D("...",{beforeExpr:U}),backQuote:D("`",{startsExpr:A}),dollarBraceL:D("${",{beforeExpr:U,startsExpr:A}),templateTail:D("...`",{startsExpr:A}),templateNonTail:D("...${",{beforeExpr:U,startsExpr:A}),at:D("@"),hash:D("#",{startsExpr:A}),interpreterDirective:D("#!..."),eq:D("=",{beforeExpr:U,isAssign:kt}),assign:D("_=",{beforeExpr:U,isAssign:kt}),slashAssign:D("_=",{beforeExpr:U,isAssign:kt}),xorAssign:D("_=",{beforeExpr:U,isAssign:kt}),moduloAssign:D("_=",{beforeExpr:U,isAssign:kt}),incDec:D("++/--",{prefix:Ve,postfix:Ao,startsExpr:A}),bang:D("!",{beforeExpr:U,prefix:Ve,startsExpr:A}),tilde:D("~",{beforeExpr:U,prefix:Ve,startsExpr:A}),doubleCaret:D("^^",{startsExpr:A}),doubleAt:D("@@",{startsExpr:A}),pipeline:re("|>",0),nullishCoalescing:re("??",1),logicalOR:re("||",1),logicalAND:re("&&",2),bitwiseOR:re("|",3),bitwiseXOR:re("^",4),bitwiseAND:re("&",5),equality:re("==/!=/===/!==",6),lt:re("</>/<=/>=",7),gt:re("</>/<=/>=",7),relational:re("</>/<=/>=",7),bitShift:re("<</>>/>>>",8),bitShiftL:re("<</>>/>>>",8),bitShiftR:re("<</>>/>>>",8),plusMin:D("+/-",{beforeExpr:U,binop:9,prefix:Ve,startsExpr:A}),modulo:D("%",{binop:10,startsExpr:A}),star:D("*",{binop:10}),slash:re("/",10),exponent:D("**",{beforeExpr:U,binop:11,rightAssociative:!0}),_in:B("in",{beforeExpr:U,binop:7}),_instanceof:B("instanceof",{beforeExpr:U,binop:7}),_break:B("break"),_case:B("case",{beforeExpr:U}),_catch:B("catch"),_continue:B("continue"),_debugger:B("debugger"),_default:B("default",{beforeExpr:U}),_else:B("else",{beforeExpr:U}),_finally:B("finally"),_function:B("function",{startsExpr:A}),_if:B("if"),_return:B("return",{beforeExpr:U}),_switch:B("switch"),_throw:B("throw",{beforeExpr:U,prefix:Ve,startsExpr:A}),_try:B("try"),_var:B("var"),_const:B("const"),_with:B("with"),_new:B("new",{beforeExpr:U,startsExpr:A}),_this:B("this",{startsExpr:A}),_super:B("super",{startsExpr:A}),_class:B("class",{startsExpr:A}),_extends:B("extends",{beforeExpr:U}),_export:B("export"),_import:B("import",{startsExpr:A}),_null:B("null",{startsExpr:A}),_true:B("true",{startsExpr:A}),_false:B("false",{startsExpr:A}),_typeof:B("typeof",{beforeExpr:U,prefix:Ve,startsExpr:A}),_void:B("void",{beforeExpr:U,prefix:Ve,startsExpr:A}),_delete:B("delete",{beforeExpr:U,prefix:Ve,startsExpr:A}),_do:B("do",{isLoop:cr,beforeExpr:U}),_for:B("for",{isLoop:cr}),_while:B("while",{isLoop:cr}),_as:_("as",{startsExpr:A}),_assert:_("assert",{startsExpr:A}),_async:_("async",{startsExpr:A}),_await:_("await",{startsExpr:A}),_defer:_("defer",{startsExpr:A}),_from:_("from",{startsExpr:A}),_get:_("get",{startsExpr:A}),_let:_("let",{startsExpr:A}),_meta:_("meta",{startsExpr:A}),_of:_("of",{startsExpr:A}),_sent:_("sent",{startsExpr:A}),_set:_("set",{startsExpr:A}),_source:_("source",{startsExpr:A}),_static:_("static",{startsExpr:A}),_using:_("using",{startsExpr:A}),_yield:_("yield",{startsExpr:A}),_asserts:_("asserts",{startsExpr:A}),_checks:_("checks",{startsExpr:A}),_exports:_("exports",{startsExpr:A}),_global:_("global",{startsExpr:A}),_implements:_("implements",{startsExpr:A}),_intrinsic:_("intrinsic",{startsExpr:A}),_infer:_("infer",{startsExpr:A}),_is:_("is",{startsExpr:A}),_mixins:_("mixins",{startsExpr:A}),_proto:_("proto",{startsExpr:A}),_require:_("require",{startsExpr:A}),_satisfies:_("satisfies",{startsExpr:A}),_keyof:_("keyof",{startsExpr:A}),_readonly:_("readonly",{startsExpr:A}),_unique:_("unique",{startsExpr:A}),_abstract:_("abstract",{startsExpr:A}),_declare:_("declare",{startsExpr:A}),_enum:_("enum",{startsExpr:A}),_module:_("module",{startsExpr:A}),_namespace:_("namespace",{startsExpr:A}),_interface:_("interface",{startsExpr:A}),_type:_("type",{startsExpr:A}),_opaque:_("opaque",{startsExpr:A}),name:D("name",{startsExpr:A}),string:D("string",{startsExpr:A}),num:D("num",{startsExpr:A}),bigint:D("bigint",{startsExpr:A}),decimal:D("decimal",{startsExpr:A}),regexp:D("regexp",{startsExpr:A}),privateName:D("#name",{startsExpr:A}),eof:D("eof"),jsxName:D("jsxName"),jsxText:D("jsxText",{beforeExpr:!0}),jsxTagStart:D("jsxTagStart",{startsExpr:!0}),jsxTagEnd:D("jsxTagEnd"),placeholder:D("%%",{startsExpr:!0})};function R(s){return s>=93&&s<=132}function No(s){return s<=92}function xe(s){return s>=58&&s<=132}function ai(s){return s>=58&&s<=136}function Mo(s){return Ur[s]}function fr(s){return Br[s]}function Do(s){return s>=29&&s<=33}function Ks(s){return s>=129&&s<=131}function Lo(s){return s>=90&&s<=92}function jr(s){return s>=58&&s<=92}function Oo(s){return s>=39&&s<=59}function Fo(s){return s===34}function _o(s){return Rr[s]}function Uo(s){return s>=121&&s<=123}function Bo(s){return s>=124&&s<=130}function qe(s){return Fr[s]}function mn(s){return _r[s]}function Ro(s){return s===57}function xn(s){return s>=24&&s<=25}function Oe(s){return Fe[s]}Fe[8].updateContext=s=>{s.pop()},Fe[5].updateContext=Fe[7].updateContext=Fe[23].updateContext=s=>{s.push(V.brace)},Fe[22].updateContext=s=>{s[s.length-1]===V.template?s.pop():s.push(V.template)},Fe[142].updateContext=s=>{s.push(V.j_expr,V.j_oTag)};var Vr="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",oi="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",jo=new RegExp("["+Vr+"]"),Vo=new RegExp("["+Vr+oi+"]");Vr=oi=null;var li=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],zo=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239];function mr(s,n){let e=65536;for(let t=0,r=n.length;t<r;t+=2){if(e+=n[t],e>s)return!1;if(e+=n[t+1],e>=s)return!0}return!1}function _e(s){return s<65?s===36:s<=90?!0:s<97?s===95:s<=122?!0:s<=65535?s>=170&&jo.test(String.fromCharCode(s)):mr(s,li)}function lt(s){return s<48?s===36:s<58?!0:s<65?!1:s<=90?!0:s<97?s===95:s<=122?!0:s<=65535?s>=170&&Vo.test(String.fromCharCode(s)):mr(s,li)||mr(s,zo)}var zr={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},$o=new Set(zr.keyword),qo=new Set(zr.strict),Ho=new Set(zr.strictBind);function ci(s,n){return n&&s==="await"||s==="enum"}function pi(s,n){return ci(s,n)||qo.has(s)}function ui(s){return Ho.has(s)}function di(s,n){return pi(s,n)||ui(s)}function Wo(s){return $o.has(s)}function Go(s,n,e){return s===64&&n===64&&_e(e)}var Ko=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function Jo(s){return Ko.has(s)}var Ft=class{constructor(n){this.var=new Set,this.lexical=new Set,this.functions=new Set,this.flags=n}},_t=class{constructor(n,e){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=n,this.inModule=e}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let n=this.currentThisScopeFlags();return(n&64)>0&&(n&2)===0}get inStaticBlock(){for(let n=this.scopeStack.length-1;;n--){let{flags:e}=this.scopeStack[n];if(e&128)return!0;if(e&451)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(n){return new Ft(n)}enter(n){this.scopeStack.push(this.createScope(n))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(n){return!!(n.flags&130||!this.parser.inModule&&n.flags&1)}declareName(n,e,t){let r=this.currentScope();if(e&8||e&16)this.checkRedeclarationInScope(r,n,e,t),e&16?r.functions.add(n):r.lexical.add(n),e&8&&this.maybeExportDefined(r,n);else if(e&4)for(let i=this.scopeStack.length-1;i>=0&&(r=this.scopeStack[i],this.checkRedeclarationInScope(r,n,e,t),r.var.add(n),this.maybeExportDefined(r,n),!(r.flags&387));--i);this.parser.inModule&&r.flags&1&&this.undefinedExports.delete(n)}maybeExportDefined(n,e){this.parser.inModule&&n.flags&1&&this.undefinedExports.delete(e)}checkRedeclarationInScope(n,e,t,r){this.isRedeclaredInScope(n,e,t)&&this.parser.raise(b.VarRedeclaration,{at:r,identifierName:e})}isRedeclaredInScope(n,e,t){return t&1?t&8?n.lexical.has(e)||n.functions.has(e)||n.var.has(e):t&16?n.lexical.has(e)||!this.treatFunctionsAsVarInScope(n)&&n.var.has(e):n.lexical.has(e)&&!(n.flags&8&&n.lexical.values().next().value===e)||!this.treatFunctionsAsVarInScope(n)&&n.functions.has(e):!1}checkLocalExport(n){let{name:e}=n,t=this.scopeStack[0];!t.lexical.has(e)&&!t.var.has(e)&&!t.functions.has(e)&&this.undefinedExports.set(e,n.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let n=this.scopeStack.length-1;;n--){let{flags:e}=this.scopeStack[n];if(e&387)return e}}currentThisScopeFlags(){for(let n=this.scopeStack.length-1;;n--){let{flags:e}=this.scopeStack[n];if(e&451&&!(e&4))return e}}},br=class extends Ft{constructor(...n){super(...n),this.declareFunctions=new Set}},yr=class extends _t{createScope(n){return new br(n)}declareName(n,e,t){let r=this.currentScope();if(e&2048){this.checkRedeclarationInScope(r,n,e,t),this.maybeExportDefined(r,n),r.declareFunctions.add(n);return}super.declareName(n,e,t)}isRedeclaredInScope(n,e,t){return super.isRedeclaredInScope(n,e,t)?!0:t&2048?!n.declareFunctions.has(e)&&(n.lexical.has(e)||n.functions.has(e)):!1}checkLocalExport(n){this.scopeStack[0].declareFunctions.has(n.name)||super.checkLocalExport(n)}},gr=class{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}hasPlugin(n){if(typeof n=="string")return this.plugins.has(n);{let[e,t]=n;if(!this.hasPlugin(e))return!1;let r=this.plugins.get(e);for(let i of Object.keys(t))if(r?.[i]!==t[i])return!1;return!0}}getPluginOption(n,e){var t;return(t=this.plugins.get(n))==null?void 0:t[e]}};function hi(s,n){s.trailingComments===void 0?s.trailingComments=n:s.trailingComments.unshift(...n)}function Xo(s,n){s.leadingComments===void 0?s.leadingComments=n:s.leadingComments.unshift(...n)}function Ut(s,n){s.innerComments===void 0?s.innerComments=n:s.innerComments.unshift(...n)}function Nt(s,n,e){let t=null,r=n.length;for(;t===null&&r>0;)t=n[--r];t===null||t.start>e.start?Ut(s,e.comments):hi(t,e.comments)}var vr=class extends gr{addComment(n){this.filename&&(n.loc.filename=this.filename),this.state.comments.push(n)}processComment(n){let{commentStack:e}=this.state,t=e.length;if(t===0)return;let r=t-1,i=e[r];i.start===n.end&&(i.leadingNode=n,r--);let{start:a}=n;for(;r>=0;r--){let o=e[r],l=o.end;if(l>a)o.containingNode=n,this.finalizeComment(o),e.splice(r,1);else{l===a&&(o.trailingNode=n);break}}}finalizeComment(n){let{comments:e}=n;if(n.leadingNode!==null||n.trailingNode!==null)n.leadingNode!==null&&hi(n.leadingNode,e),n.trailingNode!==null&&Xo(n.trailingNode,e);else{let{containingNode:t,start:r}=n;if(this.input.charCodeAt(r-1)===44)switch(t.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":Nt(t,t.properties,n);break;case"CallExpression":case"OptionalCallExpression":Nt(t,t.arguments,n);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":Nt(t,t.params,n);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":Nt(t,t.elements,n);break;case"ExportNamedDeclaration":case"ImportDeclaration":Nt(t,t.specifiers,n);break;default:Ut(t,e)}else Ut(t,e)}}finalizeRemainingComments(){let{commentStack:n}=this.state;for(let e=n.length-1;e>=0;e--)this.finalizeComment(n[e]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(n){let{commentStack:e}=this.state,{length:t}=e;if(t===0)return;let r=e[t-1];r.leadingNode===n&&(r.leadingNode=null)}resetPreviousIdentifierLeadingComments(n){let{commentStack:e}=this.state,{length:t}=e;t!==0&&(e[t-1].trailingNode===n?e[t-1].trailingNode=null:t>=2&&e[t-2].trailingNode===n&&(e[t-2].trailingNode=null))}takeSurroundingComments(n,e,t){let{commentStack:r}=this.state,i=r.length;if(i===0)return;let a=i-1;for(;a>=0;a--){let o=r[a],l=o.end;if(o.start===t)o.leadingNode=n;else if(l===e)o.trailingNode=n;else if(l<e)break}}},fi=/\r\n?|[\n\u2028\u2029]/,dn=new RegExp(fi.source,"g");function Ot(s){switch(s){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}var pr=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,bn=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g,Js=new RegExp("(?=("+bn.source+"))\\1"+/(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source,"y");function Qo(s){switch(s){case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}var xr=class s{constructor(){this.strict=void 0,this.curLine=void 0,this.lineStart=void 0,this.startLoc=void 0,this.endLoc=void 0,this.errors=[],this.potentialArrowAt=-1,this.noArrowAt=[],this.noArrowParamsConversionAt=[],this.maybeInArrowParameters=!1,this.inType=!1,this.noAnonFunctionType=!1,this.hasFlowComment=!1,this.isAmbientContext=!1,this.inAbstractClass=!1,this.inDisallowConditionalTypesContext=!1,this.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null},this.soloAwait=!1,this.inFSharpPipelineDirectBody=!1,this.labels=[],this.comments=[],this.commentStack=[],this.pos=0,this.type=139,this.value=null,this.start=0,this.end=0,this.lastTokEndLoc=null,this.lastTokStartLoc=null,this.lastTokStart=0,this.context=[V.brace],this.canStartJSXElement=!0,this.containsEsc=!1,this.firstInvalidTemplateEscapePos=null,this.strictErrors=new Map,this.tokensLength=0}init({strictMode:n,sourceType:e,startLine:t,startColumn:r}){this.strict=n===!1?!1:n===!0?!0:e==="module",this.curLine=t,this.lineStart=-r,this.startLoc=this.endLoc=new ke(t,r,0)}curPosition(){return new ke(this.curLine,this.pos-this.lineStart,this.pos)}clone(n){let e=new s,t=Object.keys(this);for(let r=0,i=t.length;r<i;r++){let a=t[r],o=this[a];!n&&Array.isArray(o)&&(o=o.slice()),e[a]=o}return e}},Yo=function(n){return n>=48&&n<=57},Xs={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},hn={bin:s=>s===48||s===49,oct:s=>s>=48&&s<=55,dec:s=>s>=48&&s<=57,hex:s=>s>=48&&s<=57||s>=65&&s<=70||s>=97&&s<=102};function Qs(s,n,e,t,r,i){let a=e,o=t,l=r,c="",p=null,u=e,{length:h}=n;for(;;){if(e>=h){i.unterminated(a,o,l),c+=n.slice(u,e);break}let m=n.charCodeAt(e);if(Zo(s,m,n,e)){c+=n.slice(u,e);break}if(m===92){c+=n.slice(u,e);let d=el(n,e,t,r,s==="template",i);d.ch===null&&!p?p={pos:e,lineStart:t,curLine:r}:c+=d.ch,{pos:e,lineStart:t,curLine:r}=d,u=e}else m===8232||m===8233?(++e,++r,t=e):m===10||m===13?s==="template"?(c+=n.slice(u,e)+`
|
|
4
|
+
- Did you mean \`import { "${s}" as foo }\`?`,ImportCallArgumentTrailingComma:"Trailing comma is disallowed inside import(...) arguments.",ImportCallArity:({maxArgumentCount:s})=>`\`import()\` requires exactly ${s===1?"one argument":"one or two arguments"}.`,ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:s})=>`Expected number in radix ${s}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:s})=>`Escape sequence in keyword ${s}.`,InvalidIdentifier:({identifierName:s})=>`Invalid identifier ${s}.`,InvalidLhs:({ancestor:s})=>`Invalid left-hand side in ${fn(s)}.`,InvalidLhsBinding:({ancestor:s})=>`Binding invalid left-hand side in ${fn(s)}.`,InvalidLhsOptionalChaining:({ancestor:s})=>`Invalid optional chaining in the left-hand side of ${fn(s)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:s})=>`Unexpected character '${s}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:s})=>`Private name #${s} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:s})=>`Label '${s}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:s})=>`This experimental syntax requires enabling the parser plugin: ${s.map(n=>JSON.stringify(n)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:s})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${s.map(n=>JSON.stringify(n)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:s})=>`Duplicate key "${s}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:s})=>`An export name cannot include a lone surrogate, found '\\u${s.toString(16)}'.`,ModuleExportUndefined:({localName:s})=>`Export '${s}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:s})=>`Private names are only allowed in property accesses (\`obj.#${s}\`) or in \`in\` expressions (\`#${s} in obj\`).`,PrivateNameRedeclaration:({identifierName:s})=>`Duplicate private name #${s}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:s})=>`Unexpected keyword '${s}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:s})=>`Unexpected reserved word '${s}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:s,unexpected:n})=>`Unexpected token${n?` '${n}'.`:""}${s?`, expected "${s}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script`.",UnsupportedBind:"Binding should be performed on object property.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:s,onlyValidPropertyName:n})=>`The only valid meta property for ${s} is ${s}.${n}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:s})=>`Identifier '${s}' has already been declared.`,YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},xo={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:s})=>`Assigning to '${s}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:s})=>`Binding '${s}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},Po=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),To={PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:s})=>`Invalid topic token ${s}. In order to use ${s} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${s}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:s})=>`Hack-style pipe body cannot be an unparenthesized ${fn({type:s})}; please wrap it in parentheses.`,PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",PrimaryTopicNotAllowed:"Topic reference was used in a lexical context without topic binding.",PrimaryTopicRequiresSmartPipeline:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'},wo=["toMessage"],Co=["message"];function Ws(s,n,e){Object.defineProperty(s,n,{enumerable:!1,configurable:!0,value:e})}function So(s){let{toMessage:n}=s,e=yn(s,wo);return function t({loc:r,details:i}){let a=new SyntaxError;return Object.assign(a,e,{loc:r,pos:r.index}),"missingPlugin"in i&&Object.assign(a,{missingPlugin:i.missingPlugin}),Ws(a,"clone",function(l={}){var c;let{line:p,column:u,index:h}=(c=l.loc)!=null?c:r;return t({loc:new ke(p,u,h),details:Object.assign({},i,l.details)})}),Ws(a,"details",i),Object.defineProperty(a,"message",{configurable:!0,get(){let o=`${n(i)} (${r.line}:${r.column})`;return this.message=o,o},set(o){Object.defineProperty(this,"message",{value:o,writable:!0})}}),a}}function _e(s,n){if(Array.isArray(s))return t=>_e(t,s[0]);let e={};for(let t of Object.keys(s)){let r=s[t],i=typeof r=="string"?{message:()=>r}:typeof r=="function"?{message:r}:r,{message:a}=i,o=yn(i,Co),l=typeof a=="string"?()=>a:a;e[t]=So(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:t,toMessage:l},n?{syntaxPlugin:n}:{},o))}return e}var b=Object.assign({},_e(yo),_e(vo),_e(xo),_e`pipelineOperator`(To)),{defineProperty:Io}=Object,Gs=(s,n)=>Io(s,n,{enumerable:!1,value:s[n]});function At(s){return s.loc.start&&Gs(s.loc.start,"index"),s.loc.end&&Gs(s.loc.end,"index"),s}var Eo=s=>class extends s{parse(){let e=At(super.parse());return this.options.tokens&&(e.tokens=e.tokens.map(At)),e}parseRegExpLiteral({pattern:e,flags:t}){let r=null;try{r=new RegExp(e,t)}catch{}let i=this.estreeParseLiteral(r);return i.regex={pattern:e,flags:t},i}parseBigIntLiteral(e){let t;try{t=BigInt(e)}catch{t=null}let r=this.estreeParseLiteral(t);return r.bigint=String(r.value||e),r}parseDecimalLiteral(e){let r=this.estreeParseLiteral(null);return r.decimal=String(r.value||e),r}estreeParseLiteral(e){return this.parseLiteral(e,"Literal")}parseStringLiteral(e){return this.estreeParseLiteral(e)}parseNumericLiteral(e){return this.estreeParseLiteral(e)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(e){return this.estreeParseLiteral(e)}directiveToStmt(e){let t=e.value;delete e.value,t.type="Literal",t.raw=t.extra.raw,t.value=t.extra.expressionValue;let r=e;return r.type="ExpressionStatement",r.expression=t,r.directive=t.extra.rawValue,delete t.extra,r}initFunction(e,t){super.initFunction(e,t),e.expression=!1}checkDeclaration(e){e!=null&&this.isObjectProperty(e)?this.checkDeclaration(e.value):super.checkDeclaration(e)}getObjectOrClassMethodParams(e){return e.value.params}isValidDirective(e){var t;return e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&!((t=e.expression.extra)!=null&&t.parenthesized)}parseBlockBody(e,t,r,i,a){super.parseBlockBody(e,t,r,i,a);let o=e.directives.map(l=>this.directiveToStmt(l));e.body=o.concat(e.body),delete e.directives}pushClassMethod(e,t,r,i,a,o){this.parseMethod(t,r,i,a,o,"ClassMethod",!0),t.typeParameters&&(t.value.typeParameters=t.typeParameters,delete t.typeParameters),e.body.push(t)}parsePrivateName(){let e=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(e):e}convertPrivateNameToPrivateIdentifier(e){let t=super.getPrivateNameSV(e);return e=e,delete e.id,e.name=t,e.type="PrivateIdentifier",e}isPrivateName(e){return this.getPluginOption("estree","classFeatures")?e.type==="PrivateIdentifier":super.isPrivateName(e)}getPrivateNameSV(e){return this.getPluginOption("estree","classFeatures")?e.name:super.getPrivateNameSV(e)}parseLiteral(e,t){let r=super.parseLiteral(e,t);return r.raw=r.extra.raw,delete r.extra,r}parseFunctionBody(e,t,r=!1){super.parseFunctionBody(e,t,r),e.expression=e.body.type!=="BlockStatement"}parseMethod(e,t,r,i,a,o,l=!1){let c=this.startNode();return c.kind=e.kind,c=super.parseMethod(c,t,r,i,a,o,l),c.type="FunctionExpression",delete c.kind,e.value=c,o==="ClassPrivateMethod"&&(e.computed=!1),this.finishNode(e,"MethodDefinition")}parseClassProperty(...e){let t=super.parseClassProperty(...e);return this.getPluginOption("estree","classFeatures")&&(t.type="PropertyDefinition"),t}parseClassPrivateProperty(...e){let t=super.parseClassPrivateProperty(...e);return this.getPluginOption("estree","classFeatures")&&(t.type="PropertyDefinition",t.computed=!1),t}parseObjectMethod(e,t,r,i,a){let o=super.parseObjectMethod(e,t,r,i,a);return o&&(o.type="Property",o.kind==="method"&&(o.kind="init"),o.shorthand=!1),o}parseObjectProperty(e,t,r,i){let a=super.parseObjectProperty(e,t,r,i);return a&&(a.kind="init",a.type="Property"),a}isValidLVal(e,t,r){return e==="Property"?"value":super.isValidLVal(e,t,r)}isAssignable(e,t){return e!=null&&this.isObjectProperty(e)?this.isAssignable(e.value,t):super.isAssignable(e,t)}toAssignable(e,t=!1){if(e!=null&&this.isObjectProperty(e)){let{key:r,value:i}=e;this.isPrivateName(r)&&this.classScope.usePrivateName(this.getPrivateNameSV(r),r.loc.start),this.toAssignable(i,t)}else super.toAssignable(e,t)}toAssignableObjectExpressionProp(e,t,r){e.kind==="get"||e.kind==="set"?this.raise(b.PatternHasAccessor,{at:e.key}):e.method?this.raise(b.PatternHasMethod,{at:e.key}):super.toAssignableObjectExpressionProp(e,t,r)}finishCallExpression(e,t){let r=super.finishCallExpression(e,t);if(r.callee.type==="Import"){if(r.type="ImportExpression",r.source=r.arguments[0],this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions")){var i,a;r.options=(i=r.arguments[1])!=null?i:null,r.attributes=(a=r.arguments[1])!=null?a:null}delete r.arguments,delete r.callee}return r}toReferencedArguments(e){e.type!=="ImportExpression"&&super.toReferencedArguments(e)}parseExport(e,t){let r=this.state.lastTokStartLoc,i=super.parseExport(e,t);switch(i.type){case"ExportAllDeclaration":i.exported=null;break;case"ExportNamedDeclaration":i.specifiers.length===1&&i.specifiers[0].type==="ExportNamespaceSpecifier"&&(i.type="ExportAllDeclaration",i.exported=i.specifiers[0].exported,delete i.specifiers);case"ExportDefaultDeclaration":{var a;let{declaration:o}=i;o?.type==="ClassDeclaration"&&((a=o.decorators)==null?void 0:a.length)>0&&o.start===i.start&&this.resetStartLocation(i,r)}break}return i}parseSubscript(e,t,r,i){let a=super.parseSubscript(e,t,r,i);if(i.optionalChainMember){if((a.type==="OptionalMemberExpression"||a.type==="OptionalCallExpression")&&(a.type=a.type.substring(8)),i.stop){let o=this.startNodeAtNode(a);return o.expression=a,this.finishNode(o,"ChainExpression")}}else(a.type==="MemberExpression"||a.type==="CallExpression")&&(a.optional=!1);return a}isOptionalMemberExpression(e){return e.type==="ChainExpression"?e.expression.type==="MemberExpression":super.isOptionalMemberExpression(e)}hasPropertyAsPrivateName(e){return e.type==="ChainExpression"&&(e=e.expression),super.hasPropertyAsPrivateName(e)}isObjectProperty(e){return e.type==="Property"&&e.kind==="init"&&!e.method}isObjectMethod(e){return e.method||e.kind==="get"||e.kind==="set"}finishNodeAt(e,t,r){return At(super.finishNodeAt(e,t,r))}resetStartLocation(e,t){super.resetStartLocation(e,t),At(e)}resetEndLocation(e,t=this.state.lastTokEndLoc){super.resetEndLocation(e,t),At(e)}},Qe=class{constructor(n,e){this.token=void 0,this.preserveSpace=void 0,this.token=n,this.preserveSpace=!!e}},V={brace:new Qe("{"),j_oTag:new Qe("<tag"),j_cTag:new Qe("</tag"),j_expr:new Qe("<tag>...</tag>",!0)};V.template=new Qe("`",!0);var _=!0,A=!0,cr=!0,kt=!0,Ve=!0,Ao=!0,vn=class{constructor(n,e={}){this.label=void 0,this.keyword=void 0,this.beforeExpr=void 0,this.startsExpr=void 0,this.rightAssociative=void 0,this.isLoop=void 0,this.isAssign=void 0,this.prefix=void 0,this.postfix=void 0,this.binop=void 0,this.label=n,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.rightAssociative=!!e.rightAssociative,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop!=null?e.binop:null,this.updateContext=null}},Or=new Map;function B(s,n={}){n.keyword=s;let e=D(s,n);return Or.set(s,e),e}function re(s,n){return D(s,{beforeExpr:_,binop:n})}var Lt=-1,Fe=[],Fr=[],Ur=[],_r=[],Br=[],Rr=[];function D(s,n={}){var e,t,r,i;return++Lt,Fr.push(s),Ur.push((e=n.binop)!=null?e:-1),_r.push((t=n.beforeExpr)!=null?t:!1),Br.push((r=n.startsExpr)!=null?r:!1),Rr.push((i=n.prefix)!=null?i:!1),Fe.push(new vn(s,n)),Lt}function U(s,n={}){var e,t,r,i;return++Lt,Or.set(s,Lt),Fr.push(s),Ur.push((e=n.binop)!=null?e:-1),_r.push((t=n.beforeExpr)!=null?t:!1),Br.push((r=n.startsExpr)!=null?r:!1),Rr.push((i=n.prefix)!=null?i:!1),Fe.push(new vn("name",n)),Lt}var ko={bracketL:D("[",{beforeExpr:_,startsExpr:A}),bracketHashL:D("#[",{beforeExpr:_,startsExpr:A}),bracketBarL:D("[|",{beforeExpr:_,startsExpr:A}),bracketR:D("]"),bracketBarR:D("|]"),braceL:D("{",{beforeExpr:_,startsExpr:A}),braceBarL:D("{|",{beforeExpr:_,startsExpr:A}),braceHashL:D("#{",{beforeExpr:_,startsExpr:A}),braceR:D("}"),braceBarR:D("|}"),parenL:D("(",{beforeExpr:_,startsExpr:A}),parenR:D(")"),comma:D(",",{beforeExpr:_}),semi:D(";",{beforeExpr:_}),colon:D(":",{beforeExpr:_}),doubleColon:D("::",{beforeExpr:_}),dot:D("."),question:D("?",{beforeExpr:_}),questionDot:D("?."),arrow:D("=>",{beforeExpr:_}),template:D("template"),ellipsis:D("...",{beforeExpr:_}),backQuote:D("`",{startsExpr:A}),dollarBraceL:D("${",{beforeExpr:_,startsExpr:A}),templateTail:D("...`",{startsExpr:A}),templateNonTail:D("...${",{beforeExpr:_,startsExpr:A}),at:D("@"),hash:D("#",{startsExpr:A}),interpreterDirective:D("#!..."),eq:D("=",{beforeExpr:_,isAssign:kt}),assign:D("_=",{beforeExpr:_,isAssign:kt}),slashAssign:D("_=",{beforeExpr:_,isAssign:kt}),xorAssign:D("_=",{beforeExpr:_,isAssign:kt}),moduloAssign:D("_=",{beforeExpr:_,isAssign:kt}),incDec:D("++/--",{prefix:Ve,postfix:Ao,startsExpr:A}),bang:D("!",{beforeExpr:_,prefix:Ve,startsExpr:A}),tilde:D("~",{beforeExpr:_,prefix:Ve,startsExpr:A}),doubleCaret:D("^^",{startsExpr:A}),doubleAt:D("@@",{startsExpr:A}),pipeline:re("|>",0),nullishCoalescing:re("??",1),logicalOR:re("||",1),logicalAND:re("&&",2),bitwiseOR:re("|",3),bitwiseXOR:re("^",4),bitwiseAND:re("&",5),equality:re("==/!=/===/!==",6),lt:re("</>/<=/>=",7),gt:re("</>/<=/>=",7),relational:re("</>/<=/>=",7),bitShift:re("<</>>/>>>",8),bitShiftL:re("<</>>/>>>",8),bitShiftR:re("<</>>/>>>",8),plusMin:D("+/-",{beforeExpr:_,binop:9,prefix:Ve,startsExpr:A}),modulo:D("%",{binop:10,startsExpr:A}),star:D("*",{binop:10}),slash:re("/",10),exponent:D("**",{beforeExpr:_,binop:11,rightAssociative:!0}),_in:B("in",{beforeExpr:_,binop:7}),_instanceof:B("instanceof",{beforeExpr:_,binop:7}),_break:B("break"),_case:B("case",{beforeExpr:_}),_catch:B("catch"),_continue:B("continue"),_debugger:B("debugger"),_default:B("default",{beforeExpr:_}),_else:B("else",{beforeExpr:_}),_finally:B("finally"),_function:B("function",{startsExpr:A}),_if:B("if"),_return:B("return",{beforeExpr:_}),_switch:B("switch"),_throw:B("throw",{beforeExpr:_,prefix:Ve,startsExpr:A}),_try:B("try"),_var:B("var"),_const:B("const"),_with:B("with"),_new:B("new",{beforeExpr:_,startsExpr:A}),_this:B("this",{startsExpr:A}),_super:B("super",{startsExpr:A}),_class:B("class",{startsExpr:A}),_extends:B("extends",{beforeExpr:_}),_export:B("export"),_import:B("import",{startsExpr:A}),_null:B("null",{startsExpr:A}),_true:B("true",{startsExpr:A}),_false:B("false",{startsExpr:A}),_typeof:B("typeof",{beforeExpr:_,prefix:Ve,startsExpr:A}),_void:B("void",{beforeExpr:_,prefix:Ve,startsExpr:A}),_delete:B("delete",{beforeExpr:_,prefix:Ve,startsExpr:A}),_do:B("do",{isLoop:cr,beforeExpr:_}),_for:B("for",{isLoop:cr}),_while:B("while",{isLoop:cr}),_as:U("as",{startsExpr:A}),_assert:U("assert",{startsExpr:A}),_async:U("async",{startsExpr:A}),_await:U("await",{startsExpr:A}),_defer:U("defer",{startsExpr:A}),_from:U("from",{startsExpr:A}),_get:U("get",{startsExpr:A}),_let:U("let",{startsExpr:A}),_meta:U("meta",{startsExpr:A}),_of:U("of",{startsExpr:A}),_sent:U("sent",{startsExpr:A}),_set:U("set",{startsExpr:A}),_source:U("source",{startsExpr:A}),_static:U("static",{startsExpr:A}),_using:U("using",{startsExpr:A}),_yield:U("yield",{startsExpr:A}),_asserts:U("asserts",{startsExpr:A}),_checks:U("checks",{startsExpr:A}),_exports:U("exports",{startsExpr:A}),_global:U("global",{startsExpr:A}),_implements:U("implements",{startsExpr:A}),_intrinsic:U("intrinsic",{startsExpr:A}),_infer:U("infer",{startsExpr:A}),_is:U("is",{startsExpr:A}),_mixins:U("mixins",{startsExpr:A}),_proto:U("proto",{startsExpr:A}),_require:U("require",{startsExpr:A}),_satisfies:U("satisfies",{startsExpr:A}),_keyof:U("keyof",{startsExpr:A}),_readonly:U("readonly",{startsExpr:A}),_unique:U("unique",{startsExpr:A}),_abstract:U("abstract",{startsExpr:A}),_declare:U("declare",{startsExpr:A}),_enum:U("enum",{startsExpr:A}),_module:U("module",{startsExpr:A}),_namespace:U("namespace",{startsExpr:A}),_interface:U("interface",{startsExpr:A}),_type:U("type",{startsExpr:A}),_opaque:U("opaque",{startsExpr:A}),name:D("name",{startsExpr:A}),string:D("string",{startsExpr:A}),num:D("num",{startsExpr:A}),bigint:D("bigint",{startsExpr:A}),decimal:D("decimal",{startsExpr:A}),regexp:D("regexp",{startsExpr:A}),privateName:D("#name",{startsExpr:A}),eof:D("eof"),jsxName:D("jsxName"),jsxText:D("jsxText",{beforeExpr:!0}),jsxTagStart:D("jsxTagStart",{startsExpr:!0}),jsxTagEnd:D("jsxTagEnd"),placeholder:D("%%",{startsExpr:!0})};function R(s){return s>=93&&s<=132}function No(s){return s<=92}function xe(s){return s>=58&&s<=132}function ai(s){return s>=58&&s<=136}function Mo(s){return _r[s]}function fr(s){return Br[s]}function Do(s){return s>=29&&s<=33}function Ks(s){return s>=129&&s<=131}function Lo(s){return s>=90&&s<=92}function jr(s){return s>=58&&s<=92}function Oo(s){return s>=39&&s<=59}function Fo(s){return s===34}function Uo(s){return Rr[s]}function _o(s){return s>=121&&s<=123}function Bo(s){return s>=124&&s<=130}function qe(s){return Fr[s]}function mn(s){return Ur[s]}function Ro(s){return s===57}function xn(s){return s>=24&&s<=25}function Oe(s){return Fe[s]}Fe[8].updateContext=s=>{s.pop()},Fe[5].updateContext=Fe[7].updateContext=Fe[23].updateContext=s=>{s.push(V.brace)},Fe[22].updateContext=s=>{s[s.length-1]===V.template?s.pop():s.push(V.template)},Fe[142].updateContext=s=>{s.push(V.j_expr,V.j_oTag)};var Vr="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",oi="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",jo=new RegExp("["+Vr+"]"),Vo=new RegExp("["+Vr+oi+"]");Vr=oi=null;var li=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],zo=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239];function mr(s,n){let e=65536;for(let t=0,r=n.length;t<r;t+=2){if(e+=n[t],e>s)return!1;if(e+=n[t+1],e>=s)return!0}return!1}function Ue(s){return s<65?s===36:s<=90?!0:s<97?s===95:s<=122?!0:s<=65535?s>=170&&jo.test(String.fromCharCode(s)):mr(s,li)}function lt(s){return s<48?s===36:s<58?!0:s<65?!1:s<=90?!0:s<97?s===95:s<=122?!0:s<=65535?s>=170&&Vo.test(String.fromCharCode(s)):mr(s,li)||mr(s,zo)}var zr={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},$o=new Set(zr.keyword),qo=new Set(zr.strict),Ho=new Set(zr.strictBind);function ci(s,n){return n&&s==="await"||s==="enum"}function pi(s,n){return ci(s,n)||qo.has(s)}function ui(s){return Ho.has(s)}function di(s,n){return pi(s,n)||ui(s)}function Wo(s){return $o.has(s)}function Go(s,n,e){return s===64&&n===64&&Ue(e)}var Ko=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function Jo(s){return Ko.has(s)}var Ft=class{constructor(n){this.var=new Set,this.lexical=new Set,this.functions=new Set,this.flags=n}},Ut=class{constructor(n,e){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=n,this.inModule=e}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let n=this.currentThisScopeFlags();return(n&64)>0&&(n&2)===0}get inStaticBlock(){for(let n=this.scopeStack.length-1;;n--){let{flags:e}=this.scopeStack[n];if(e&128)return!0;if(e&451)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(n){return new Ft(n)}enter(n){this.scopeStack.push(this.createScope(n))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(n){return!!(n.flags&130||!this.parser.inModule&&n.flags&1)}declareName(n,e,t){let r=this.currentScope();if(e&8||e&16)this.checkRedeclarationInScope(r,n,e,t),e&16?r.functions.add(n):r.lexical.add(n),e&8&&this.maybeExportDefined(r,n);else if(e&4)for(let i=this.scopeStack.length-1;i>=0&&(r=this.scopeStack[i],this.checkRedeclarationInScope(r,n,e,t),r.var.add(n),this.maybeExportDefined(r,n),!(r.flags&387));--i);this.parser.inModule&&r.flags&1&&this.undefinedExports.delete(n)}maybeExportDefined(n,e){this.parser.inModule&&n.flags&1&&this.undefinedExports.delete(e)}checkRedeclarationInScope(n,e,t,r){this.isRedeclaredInScope(n,e,t)&&this.parser.raise(b.VarRedeclaration,{at:r,identifierName:e})}isRedeclaredInScope(n,e,t){return t&1?t&8?n.lexical.has(e)||n.functions.has(e)||n.var.has(e):t&16?n.lexical.has(e)||!this.treatFunctionsAsVarInScope(n)&&n.var.has(e):n.lexical.has(e)&&!(n.flags&8&&n.lexical.values().next().value===e)||!this.treatFunctionsAsVarInScope(n)&&n.functions.has(e):!1}checkLocalExport(n){let{name:e}=n,t=this.scopeStack[0];!t.lexical.has(e)&&!t.var.has(e)&&!t.functions.has(e)&&this.undefinedExports.set(e,n.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let n=this.scopeStack.length-1;;n--){let{flags:e}=this.scopeStack[n];if(e&387)return e}}currentThisScopeFlags(){for(let n=this.scopeStack.length-1;;n--){let{flags:e}=this.scopeStack[n];if(e&451&&!(e&4))return e}}},br=class extends Ft{constructor(...n){super(...n),this.declareFunctions=new Set}},gr=class extends Ut{createScope(n){return new br(n)}declareName(n,e,t){let r=this.currentScope();if(e&2048){this.checkRedeclarationInScope(r,n,e,t),this.maybeExportDefined(r,n),r.declareFunctions.add(n);return}super.declareName(n,e,t)}isRedeclaredInScope(n,e,t){return super.isRedeclaredInScope(n,e,t)?!0:t&2048?!n.declareFunctions.has(e)&&(n.lexical.has(e)||n.functions.has(e)):!1}checkLocalExport(n){this.scopeStack[0].declareFunctions.has(n.name)||super.checkLocalExport(n)}},yr=class{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}hasPlugin(n){if(typeof n=="string")return this.plugins.has(n);{let[e,t]=n;if(!this.hasPlugin(e))return!1;let r=this.plugins.get(e);for(let i of Object.keys(t))if(r?.[i]!==t[i])return!1;return!0}}getPluginOption(n,e){var t;return(t=this.plugins.get(n))==null?void 0:t[e]}};function hi(s,n){s.trailingComments===void 0?s.trailingComments=n:s.trailingComments.unshift(...n)}function Xo(s,n){s.leadingComments===void 0?s.leadingComments=n:s.leadingComments.unshift(...n)}function _t(s,n){s.innerComments===void 0?s.innerComments=n:s.innerComments.unshift(...n)}function Nt(s,n,e){let t=null,r=n.length;for(;t===null&&r>0;)t=n[--r];t===null||t.start>e.start?_t(s,e.comments):hi(t,e.comments)}var vr=class extends yr{addComment(n){this.filename&&(n.loc.filename=this.filename),this.state.comments.push(n)}processComment(n){let{commentStack:e}=this.state,t=e.length;if(t===0)return;let r=t-1,i=e[r];i.start===n.end&&(i.leadingNode=n,r--);let{start:a}=n;for(;r>=0;r--){let o=e[r],l=o.end;if(l>a)o.containingNode=n,this.finalizeComment(o),e.splice(r,1);else{l===a&&(o.trailingNode=n);break}}}finalizeComment(n){let{comments:e}=n;if(n.leadingNode!==null||n.trailingNode!==null)n.leadingNode!==null&&hi(n.leadingNode,e),n.trailingNode!==null&&Xo(n.trailingNode,e);else{let{containingNode:t,start:r}=n;if(this.input.charCodeAt(r-1)===44)switch(t.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":Nt(t,t.properties,n);break;case"CallExpression":case"OptionalCallExpression":Nt(t,t.arguments,n);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":Nt(t,t.params,n);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":Nt(t,t.elements,n);break;case"ExportNamedDeclaration":case"ImportDeclaration":Nt(t,t.specifiers,n);break;default:_t(t,e)}else _t(t,e)}}finalizeRemainingComments(){let{commentStack:n}=this.state;for(let e=n.length-1;e>=0;e--)this.finalizeComment(n[e]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(n){let{commentStack:e}=this.state,{length:t}=e;if(t===0)return;let r=e[t-1];r.leadingNode===n&&(r.leadingNode=null)}resetPreviousIdentifierLeadingComments(n){let{commentStack:e}=this.state,{length:t}=e;t!==0&&(e[t-1].trailingNode===n?e[t-1].trailingNode=null:t>=2&&e[t-2].trailingNode===n&&(e[t-2].trailingNode=null))}takeSurroundingComments(n,e,t){let{commentStack:r}=this.state,i=r.length;if(i===0)return;let a=i-1;for(;a>=0;a--){let o=r[a],l=o.end;if(o.start===t)o.leadingNode=n;else if(l===e)o.trailingNode=n;else if(l<e)break}}},fi=/\r\n?|[\n\u2028\u2029]/,dn=new RegExp(fi.source,"g");function Ot(s){switch(s){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}var pr=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,bn=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g,Js=new RegExp("(?=("+bn.source+"))\\1"+/(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source,"y");function Qo(s){switch(s){case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}var xr=class s{constructor(){this.strict=void 0,this.curLine=void 0,this.lineStart=void 0,this.startLoc=void 0,this.endLoc=void 0,this.errors=[],this.potentialArrowAt=-1,this.noArrowAt=[],this.noArrowParamsConversionAt=[],this.maybeInArrowParameters=!1,this.inType=!1,this.noAnonFunctionType=!1,this.hasFlowComment=!1,this.isAmbientContext=!1,this.inAbstractClass=!1,this.inDisallowConditionalTypesContext=!1,this.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null},this.soloAwait=!1,this.inFSharpPipelineDirectBody=!1,this.labels=[],this.comments=[],this.commentStack=[],this.pos=0,this.type=139,this.value=null,this.start=0,this.end=0,this.lastTokEndLoc=null,this.lastTokStartLoc=null,this.lastTokStart=0,this.context=[V.brace],this.canStartJSXElement=!0,this.containsEsc=!1,this.firstInvalidTemplateEscapePos=null,this.strictErrors=new Map,this.tokensLength=0}init({strictMode:n,sourceType:e,startLine:t,startColumn:r}){this.strict=n===!1?!1:n===!0?!0:e==="module",this.curLine=t,this.lineStart=-r,this.startLoc=this.endLoc=new ke(t,r,0)}curPosition(){return new ke(this.curLine,this.pos-this.lineStart,this.pos)}clone(n){let e=new s,t=Object.keys(this);for(let r=0,i=t.length;r<i;r++){let a=t[r],o=this[a];!n&&Array.isArray(o)&&(o=o.slice()),e[a]=o}return e}},Yo=function(n){return n>=48&&n<=57},Xs={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},hn={bin:s=>s===48||s===49,oct:s=>s>=48&&s<=55,dec:s=>s>=48&&s<=57,hex:s=>s>=48&&s<=57||s>=65&&s<=70||s>=97&&s<=102};function Qs(s,n,e,t,r,i){let a=e,o=t,l=r,c="",p=null,u=e,{length:h}=n;for(;;){if(e>=h){i.unterminated(a,o,l),c+=n.slice(u,e);break}let m=n.charCodeAt(e);if(Zo(s,m,n,e)){c+=n.slice(u,e);break}if(m===92){c+=n.slice(u,e);let d=el(n,e,t,r,s==="template",i);d.ch===null&&!p?p={pos:e,lineStart:t,curLine:r}:c+=d.ch,{pos:e,lineStart:t,curLine:r}=d,u=e}else m===8232||m===8233?(++e,++r,t=e):m===10||m===13?s==="template"?(c+=n.slice(u,e)+`
|
|
5
5
|
`,++e,m===13&&n.charCodeAt(e)===10&&++e,++r,u=t=e):i.unterminated(a,o,l):++e}return{pos:e,str:c,firstInvalidLoc:p,lineStart:t,curLine:r,containsInvalid:!!p}}function Zo(s,n,e,t){return s==="template"?n===96||n===36&&e.charCodeAt(t+1)===123:n===(s==="double"?34:39)}function el(s,n,e,t,r,i){let a=!r;n++;let o=c=>({pos:n,ch:c,lineStart:e,curLine:t}),l=s.charCodeAt(n++);switch(l){case 110:return o(`
|
|
6
|
-
`);case 114:return o("\r");case 120:{let c;return{code:c,pos:n}=Pr(s,n,e,t,2,!1,a,i),o(c===null?null:String.fromCharCode(c))}case 117:{let c;return{code:c,pos:n}=bi(s,n,e,t,a,i),o(c===null?null:String.fromCodePoint(c))}case 116:return o(" ");case 98:return o("\b");case 118:return o("\v");case 102:return o("\f");case 13:s.charCodeAt(n)===10&&++n;case 10:e=n,++t;case 8232:case 8233:return o("");case 56:case 57:if(r)return o(null);i.strictNumericEscape(n-1,e,t);default:if(l>=48&&l<=55){let c=n-1,u=s.slice(c,n+2).match(/^[0-7]+/)[0],h=parseInt(u,8);h>255&&(u=u.slice(0,-1),h=parseInt(u,8)),n+=u.length-1;let m=s.charCodeAt(n);if(u!=="0"||m===56||m===57){if(r)return o(null);i.strictNumericEscape(c,e,t)}return o(String.fromCharCode(h))}return o(String.fromCharCode(l))}}function Pr(s,n,e,t,r,i,a,o){let l=n,c;return{n:c,pos:n}=mi(s,n,e,t,16,r,i,!1,o,!a),c===null&&(a?o.invalidEscapeSequence(l,e,t):n=l-1),{code:c,pos:n}}function mi(s,n,e,t,r,i,a,o,l,c){let p=n,u=r===16?Xs.hex:Xs.decBinOct,h=r===16?hn.hex:r===10?hn.dec:r===8?hn.oct:hn.bin,m=!1,d=0;for(let y=0,f=i??1/0;y<f;++y){let v=s.charCodeAt(n),w;if(v===95&&o!=="bail"){let I=s.charCodeAt(n-1),x=s.charCodeAt(n+1);if(o){if(Number.isNaN(x)||!h(x)||u.has(I)||u.has(x)){if(c)return{n:null,pos:n};l.unexpectedNumericSeparator(n,e,t)}}else{if(c)return{n:null,pos:n};l.numericSeparatorInEscapeSequence(n,e,t)}++n;continue}if(v>=97?w=v-97+10:v>=65?w=v-65+10:Yo(v)?w=v-48:w=1/0,w>=r){if(w<=9&&c)return{n:null,pos:n};if(w<=9&&l.invalidDigit(n,e,t,r))w=0;else if(a)w=0,m=!0;else break}++n,d=d*r+w}return n===p||i!=null&&n-p!==i||m?{n:null,pos:n}:{n:d,pos:n}}function bi(s,n,e,t,r,i){let a=s.charCodeAt(n),o;if(a===123){if(++n,{code:o,pos:n}=Pr(s,n,e,t,s.indexOf("}",n)-n,!0,r,i),++n,o!==null&&o>1114111)if(r)i.invalidCodePoint(n,e,t);else return{code:null,pos:n}}else({code:o,pos:n}=Pr(s,n,e,t,4,!1,r,i));return{code:o,pos:n}}var tl=["at"],nl=["at"];function Mt(s,n,e){return new ke(e,s-n,s)}var rl=new Set([103,109,115,105,121,117,100,118]),Ae=class{constructor(n){this.type=n.type,this.value=n.value,this.start=n.start,this.end=n.end,this.loc=new pt(n.startLoc,n.endLoc)}},Tr=class extends vr{constructor(n,e){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(t,r,i,a)=>this.options.errorRecovery?(this.raise(b.InvalidDigit,{at:Mt(t,r,i),radix:a}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(b.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(b.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(b.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(b.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(t,r,i)=>{this.recordStrictModeErrors(b.StrictNumericEscape,{at:Mt(t,r,i)})},unterminated:(t,r,i)=>{throw this.raise(b.UnterminatedString,{at:Mt(t-1,r,i)})}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(b.StrictNumericEscape),unterminated:(t,r,i)=>{throw this.raise(b.UnterminatedTemplate,{at:Mt(t,r,i)})}}),this.state=new xr,this.state.init(n),this.input=e,this.length=e.length,this.isLookahead=!1}pushToken(n){this.tokens.length=this.state.tokensLength,this.tokens.push(n),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.options.tokens&&this.pushToken(new Ae(this.state)),this.state.lastTokStart=this.state.start,this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(n){return this.match(n)?(this.next(),!0):!1}match(n){return this.state.type===n}createLookaheadState(n){return{pos:n.pos,value:null,type:n.type,start:n.start,end:n.end,context:[this.curContext()],inType:n.inType,startLoc:n.startLoc,lastTokEndLoc:n.lastTokEndLoc,curLine:n.curLine,lineStart:n.lineStart,curPosition:n.curPosition}}lookahead(){let n=this.state;this.state=this.createLookaheadState(n),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let e=this.state;return this.state=n,e}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(n){return pr.lastIndex=n,pr.test(this.input)?pr.lastIndex:n}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(n){return bn.lastIndex=n,bn.test(this.input)?bn.lastIndex:n}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(n){let e=this.input.charCodeAt(n);if((e&64512)===55296&&++n<this.input.length){let t=this.input.charCodeAt(n);(t&64512)===56320&&(e=65536+((e&1023)<<10)+(t&1023))}return e}setStrict(n){this.state.strict=n,n&&(this.state.strictErrors.forEach(([e,t])=>this.raise(e,{at:t})),this.state.strictErrors.clear())}curContext(){return this.state.context[this.state.context.length-1]}nextToken(){if(this.skipSpace(),this.state.start=this.state.pos,this.isLookahead||(this.state.startLoc=this.state.curPosition()),this.state.pos>=this.length){this.finishToken(139);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(n){let e;this.isLookahead||(e=this.state.curPosition());let t=this.state.pos,r=this.input.indexOf(n,t+2);if(r===-1)throw this.raise(b.UnterminatedComment,{at:this.state.curPosition()});for(this.state.pos=r+n.length,dn.lastIndex=t+2;dn.test(this.input)&&dn.lastIndex<=r;)++this.state.curLine,this.state.lineStart=dn.lastIndex;if(this.isLookahead)return;let i={type:"CommentBlock",value:this.input.slice(t+2,r),start:t,end:r+n.length,loc:new pt(e,this.state.curPosition())};return this.options.tokens&&this.pushToken(i),i}skipLineComment(n){let e=this.state.pos,t;this.isLookahead||(t=this.state.curPosition());let r=this.input.charCodeAt(this.state.pos+=n);if(this.state.pos<this.length)for(;!Ot(r)&&++this.state.pos<this.length;)r=this.input.charCodeAt(this.state.pos);if(this.isLookahead)return;let i=this.state.pos,o={type:"CommentLine",value:this.input.slice(e+n,i),start:e,end:i,loc:new pt(t,this.state.curPosition())};return this.options.tokens&&this.pushToken(o),o}skipSpace(){let n=this.state.pos,e=[];e:for(;this.state.pos<this.length;){let t=this.input.charCodeAt(this.state.pos);switch(t){case 32:case 160:case 9:++this.state.pos;break;case 13:this.input.charCodeAt(this.state.pos+1)===10&&++this.state.pos;case 10:case 8232:case 8233:++this.state.pos,++this.state.curLine,this.state.lineStart=this.state.pos;break;case 47:switch(this.input.charCodeAt(this.state.pos+1)){case 42:{let r=this.skipBlockComment("*/");r!==void 0&&(this.addComment(r),this.options.attachComment&&e.push(r));break}case 47:{let r=this.skipLineComment(2);r!==void 0&&(this.addComment(r),this.options.attachComment&&e.push(r));break}default:break e}break;default:if(Qo(t))++this.state.pos;else if(t===45&&!this.inModule&&this.options.annexB){let r=this.state.pos;if(this.input.charCodeAt(r+1)===45&&this.input.charCodeAt(r+2)===62&&(n===0||this.state.lineStart>n)){let i=this.skipLineComment(3);i!==void 0&&(this.addComment(i),this.options.attachComment&&e.push(i))}else break e}else if(t===60&&!this.inModule&&this.options.annexB){let r=this.state.pos;if(this.input.charCodeAt(r+1)===33&&this.input.charCodeAt(r+2)===45&&this.input.charCodeAt(r+3)===45){let i=this.skipLineComment(4);i!==void 0&&(this.addComment(i),this.options.attachComment&&e.push(i))}else break e}else break e}}if(e.length>0){let t=this.state.pos,r={start:n,end:t,comments:e,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(r)}}finishToken(n,e){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let t=this.state.type;this.state.type=n,this.state.value=e,this.isLookahead||this.updateContext(t)}replaceToken(n){this.state.type=n,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let n=this.state.pos+1,e=this.codePointAtPos(n);if(e>=48&&e<=57)throw this.raise(b.UnexpectedDigitAfterHash,{at:this.state.curPosition()});if(e===123||e===91&&this.hasPlugin("recordAndTuple")){if(this.expectPlugin("recordAndTuple"),this.getPluginOption("recordAndTuple","syntaxType")==="bar")throw this.raise(e===123?b.RecordExpressionHashIncorrectStartSyntaxType:b.TupleExpressionHashIncorrectStartSyntaxType,{at:this.state.curPosition()});this.state.pos+=2,e===123?this.finishToken(7):this.finishToken(1)}else _e(e)?(++this.state.pos,this.finishToken(138,this.readWord1(e))):e===92?(++this.state.pos,this.finishToken(138,this.readWord1())):this.finishOp(27,1)}readToken_dot(){let n=this.input.charCodeAt(this.state.pos+1);if(n>=48&&n<=57){this.readNumber(!0);return}n===46&&this.input.charCodeAt(this.state.pos+2)===46?(this.state.pos+=3,this.finishToken(21)):(++this.state.pos,this.finishToken(16))}readToken_slash(){this.input.charCodeAt(this.state.pos+1)===61?this.finishOp(31,2):this.finishOp(56,1)}readToken_interpreter(){if(this.state.pos!==0||this.length<2)return!1;let n=this.input.charCodeAt(this.state.pos+1);if(n!==33)return!1;let e=this.state.pos;for(this.state.pos+=1;!Ot(n)&&++this.state.pos<this.length;)n=this.input.charCodeAt(this.state.pos);let t=this.input.slice(e+2,this.state.pos);return this.finishToken(28,t),!0}readToken_mult_modulo(n){let e=n===42?55:54,t=1,r=this.input.charCodeAt(this.state.pos+1);n===42&&r===42&&(t++,r=this.input.charCodeAt(this.state.pos+2),e=57),r===61&&!this.state.inType&&(t++,e=n===37?33:30),this.finishOp(e,t)}readToken_pipe_amp(n){let e=this.input.charCodeAt(this.state.pos+1);if(e===n){this.input.charCodeAt(this.state.pos+2)===61?this.finishOp(30,3):this.finishOp(n===124?41:42,2);return}if(n===124){if(e===62){this.finishOp(39,2);return}if(this.hasPlugin("recordAndTuple")&&e===125){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(b.RecordExpressionBarIncorrectEndSyntaxType,{at:this.state.curPosition()});this.state.pos+=2,this.finishToken(9);return}if(this.hasPlugin("recordAndTuple")&&e===93){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(b.TupleExpressionBarIncorrectEndSyntaxType,{at:this.state.curPosition()});this.state.pos+=2,this.finishToken(4);return}}if(e===61){this.finishOp(30,2);return}this.finishOp(n===124?43:45,1)}readToken_caret(){let n=this.input.charCodeAt(this.state.pos+1);n===61&&!this.state.inType?this.finishOp(32,2):n===94&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"^^"}])?(this.finishOp(37,2),this.input.codePointAt(this.state.pos)===94&&this.unexpected()):this.finishOp(44,1)}readToken_atSign(){this.input.charCodeAt(this.state.pos+1)===64&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"@@"}])?this.finishOp(38,2):this.finishOp(26,1)}readToken_plus_min(n){let e=this.input.charCodeAt(this.state.pos+1);if(e===n){this.finishOp(34,2);return}e===61?this.finishOp(30,2):this.finishOp(53,1)}readToken_lt(){let{pos:n}=this.state,e=this.input.charCodeAt(n+1);if(e===60){if(this.input.charCodeAt(n+2)===61){this.finishOp(30,3);return}this.finishOp(51,2);return}if(e===61){this.finishOp(49,2);return}this.finishOp(47,1)}readToken_gt(){let{pos:n}=this.state,e=this.input.charCodeAt(n+1);if(e===62){let t=this.input.charCodeAt(n+2)===62?3:2;if(this.input.charCodeAt(n+t)===61){this.finishOp(30,t+1);return}this.finishOp(52,t);return}if(e===61){this.finishOp(49,2);return}this.finishOp(48,1)}readToken_eq_excl(n){let e=this.input.charCodeAt(this.state.pos+1);if(e===61){this.finishOp(46,this.input.charCodeAt(this.state.pos+2)===61?3:2);return}if(n===61&&e===62){this.state.pos+=2,this.finishToken(19);return}this.finishOp(n===61?29:35,1)}readToken_question(){let n=this.input.charCodeAt(this.state.pos+1),e=this.input.charCodeAt(this.state.pos+2);n===63?e===61?this.finishOp(30,3):this.finishOp(40,2):n===46&&!(e>=48&&e<=57)?(this.state.pos+=2,this.finishToken(18)):(++this.state.pos,this.finishToken(17))}getTokenFromCode(n){switch(n){case 46:this.readToken_dot();return;case 40:++this.state.pos,this.finishToken(10);return;case 41:++this.state.pos,this.finishToken(11);return;case 59:++this.state.pos,this.finishToken(13);return;case 44:++this.state.pos,this.finishToken(12);return;case 91:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(b.TupleExpressionBarIncorrectStartSyntaxType,{at:this.state.curPosition()});this.state.pos+=2,this.finishToken(2)}else++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(3);return;case 123:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(b.RecordExpressionBarIncorrectStartSyntaxType,{at:this.state.curPosition()});this.state.pos+=2,this.finishToken(6)}else++this.state.pos,this.finishToken(5);return;case 125:++this.state.pos,this.finishToken(8);return;case 58:this.hasPlugin("functionBind")&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(15,2):(++this.state.pos,this.finishToken(14));return;case 63:this.readToken_question();return;case 96:this.readTemplateToken();return;case 48:{let e=this.input.charCodeAt(this.state.pos+1);if(e===120||e===88){this.readRadixNumber(16);return}if(e===111||e===79){this.readRadixNumber(8);return}if(e===98||e===66){this.readRadixNumber(2);return}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:this.readNumber(!1);return;case 34:case 39:this.readString(n);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(n);return;case 124:case 38:this.readToken_pipe_amp(n);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(n);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(n);return;case 126:this.finishOp(36,1);return;case 64:this.readToken_atSign();return;case 35:this.readToken_numberSign();return;case 92:this.readWord();return;default:if(_e(n)){this.readWord(n);return}}throw this.raise(b.InvalidOrUnexpectedToken,{at:this.state.curPosition(),unexpected:String.fromCodePoint(n)})}finishOp(n,e){let t=this.input.slice(this.state.pos,this.state.pos+e);this.state.pos+=e,this.finishToken(n,t)}readRegexp(){let n=this.state.startLoc,e=this.state.start+1,t,r,{pos:i}=this.state;for(;;++i){if(i>=this.length)throw this.raise(b.UnterminatedRegExp,{at:se(n,1)});let c=this.input.charCodeAt(i);if(Ot(c))throw this.raise(b.UnterminatedRegExp,{at:se(n,1)});if(t)t=!1;else{if(c===91)r=!0;else if(c===93&&r)r=!1;else if(c===47&&!r)break;t=c===92}}let a=this.input.slice(e,i);++i;let o="",l=()=>se(n,i+2-e);for(;i<this.length;){let c=this.codePointAtPos(i),p=String.fromCharCode(c);if(rl.has(c))c===118?o.includes("u")&&this.raise(b.IncompatibleRegExpUVFlags,{at:l()}):c===117&&o.includes("v")&&this.raise(b.IncompatibleRegExpUVFlags,{at:l()}),o.includes(p)&&this.raise(b.DuplicateRegExpFlags,{at:l()});else if(lt(c)||c===92)this.raise(b.MalformedRegExpFlags,{at:l()});else break;++i,o+=p}this.state.pos=i,this.finishToken(137,{pattern:a,flags:o})}readInt(n,e,t=!1,r=!0){let{n:i,pos:a}=mi(this.input,this.state.pos,this.state.lineStart,this.state.curLine,n,e,t,r,this.errorHandlers_readInt,!1);return this.state.pos=a,i}readRadixNumber(n){let e=this.state.curPosition(),t=!1;this.state.pos+=2;let r=this.readInt(n);r==null&&this.raise(b.InvalidDigit,{at:se(e,2),radix:n});let i=this.input.charCodeAt(this.state.pos);if(i===110)++this.state.pos,t=!0;else if(i===109)throw this.raise(b.InvalidDecimal,{at:e});if(_e(this.codePointAtPos(this.state.pos)))throw this.raise(b.NumberIdentifier,{at:this.state.curPosition()});if(t){let a=this.input.slice(e.index,this.state.pos).replace(/[_n]/g,"");this.finishToken(135,a);return}this.finishToken(134,r)}readNumber(n){let e=this.state.pos,t=this.state.curPosition(),r=!1,i=!1,a=!1,o=!1,l=!1;!n&&this.readInt(10)===null&&this.raise(b.InvalidNumber,{at:this.state.curPosition()});let c=this.state.pos-e>=2&&this.input.charCodeAt(e)===48;if(c){let m=this.input.slice(e,this.state.pos);if(this.recordStrictModeErrors(b.StrictOctalLiteral,{at:t}),!this.state.strict){let d=m.indexOf("_");d>0&&this.raise(b.ZeroDigitNumericSeparator,{at:se(t,d)})}l=c&&!/[89]/.test(m)}let p=this.input.charCodeAt(this.state.pos);if(p===46&&!l&&(++this.state.pos,this.readInt(10),r=!0,p=this.input.charCodeAt(this.state.pos)),(p===69||p===101)&&!l&&(p=this.input.charCodeAt(++this.state.pos),(p===43||p===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(b.InvalidOrMissingExponent,{at:t}),r=!0,o=!0,p=this.input.charCodeAt(this.state.pos)),p===110&&((r||c)&&this.raise(b.InvalidBigIntLiteral,{at:t}),++this.state.pos,i=!0),p===109&&(this.expectPlugin("decimal",this.state.curPosition()),(o||c)&&this.raise(b.InvalidDecimal,{at:t}),++this.state.pos,a=!0),_e(this.codePointAtPos(this.state.pos)))throw this.raise(b.NumberIdentifier,{at:this.state.curPosition()});let u=this.input.slice(e,this.state.pos).replace(/[_mn]/g,"");if(i){this.finishToken(135,u);return}if(a){this.finishToken(136,u);return}let h=l?parseInt(u,8):parseFloat(u);this.finishToken(134,h)}readCodePoint(n){let{code:e,pos:t}=bi(this.input,this.state.pos,this.state.lineStart,this.state.curLine,n,this.errorHandlers_readCodePoint);return this.state.pos=t,e}readString(n){let{str:e,pos:t,curLine:r,lineStart:i}=Qs(n===34?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=t+1,this.state.lineStart=i,this.state.curLine=r,this.finishToken(133,e)}readTemplateContinuation(){this.match(8)||this.unexpected(null,8),this.state.pos--,this.readTemplateToken()}readTemplateToken(){let n=this.input[this.state.pos],{str:e,firstInvalidLoc:t,pos:r,curLine:i,lineStart:a}=Qs("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=r+1,this.state.lineStart=a,this.state.curLine=i,t&&(this.state.firstInvalidTemplateEscapePos=new ke(t.curLine,t.pos-t.lineStart,t.pos)),this.input.codePointAt(r)===96?this.finishToken(24,t?null:n+e+"`"):(this.state.pos++,this.finishToken(25,t?null:n+e+"${"))}recordStrictModeErrors(n,{at:e}){let t=e.index;this.state.strict&&!this.state.strictErrors.has(t)?this.raise(n,{at:e}):this.state.strictErrors.set(t,[n,e])}readWord1(n){this.state.containsEsc=!1;let e="",t=this.state.pos,r=this.state.pos;for(n!==void 0&&(this.state.pos+=n<=65535?1:2);this.state.pos<this.length;){let i=this.codePointAtPos(this.state.pos);if(lt(i))this.state.pos+=i<=65535?1:2;else if(i===92){this.state.containsEsc=!0,e+=this.input.slice(r,this.state.pos);let a=this.state.curPosition(),o=this.state.pos===t?_e:lt;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(b.MissingUnicodeEscape,{at:this.state.curPosition()}),r=this.state.pos-1;continue}++this.state.pos;let l=this.readCodePoint(!0);l!==null&&(o(l)||this.raise(b.EscapedCharNotAnIdentifier,{at:a}),e+=String.fromCodePoint(l)),r=this.state.pos}else break}return e+this.input.slice(r,this.state.pos)}readWord(n){let e=this.readWord1(n),t=Or.get(e);t!==void 0?this.finishToken(t,qe(t)):this.finishToken(132,e)}checkKeywordEscapes(){let{type:n}=this.state;jr(n)&&this.state.containsEsc&&this.raise(b.InvalidEscapedReservedWord,{at:this.state.startLoc,reservedWord:qe(n)})}raise(n,e){let{at:t}=e,r=gn(e,tl),i=t instanceof ke?t:t.loc.start,a=n({loc:i,details:r});if(!this.options.errorRecovery)throw a;return this.isLookahead||this.state.errors.push(a),a}raiseOverwrite(n,e){let{at:t}=e,r=gn(e,nl),i=t instanceof ke?t:t.loc.start,a=i.index,o=this.state.errors;for(let l=o.length-1;l>=0;l--){let c=o[l];if(c.loc.index===a)return o[l]=n({loc:i,details:r});if(c.loc.index<a)break}return this.raise(n,e)}updateContext(n){}unexpected(n,e){throw this.raise(b.UnexpectedToken,{expected:e?qe(e):null,at:n??this.state.startLoc})}expectPlugin(n,e){if(this.hasPlugin(n))return!0;throw this.raise(b.MissingPlugin,{at:e??this.state.startLoc,missingPlugin:[n]})}expectOnePlugin(n){if(!n.some(e=>this.hasPlugin(e)))throw this.raise(b.MissingOneOfPlugins,{at:this.state.startLoc,missingPlugin:n})}errorBuilder(n){return(e,t,r)=>{this.raise(n,{at:Mt(e,t,r)})}}},wr=class{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}},Cr=class{constructor(n){this.parser=void 0,this.stack=[],this.undefinedPrivateNames=new Map,this.parser=n}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new wr)}exit(){let n=this.stack.pop(),e=this.current();for(let[t,r]of Array.from(n.undefinedPrivateNames))e?e.undefinedPrivateNames.has(t)||e.undefinedPrivateNames.set(t,r):this.parser.raise(b.InvalidPrivateFieldResolution,{at:r,identifierName:t})}declarePrivateName(n,e,t){let{privateNames:r,loneAccessors:i,undefinedPrivateNames:a}=this.current(),o=r.has(n);if(e&3){let l=o&&i.get(n);if(l){let c=l&4,p=e&4,u=l&3,h=e&3;o=u===h||c!==p,o||i.delete(n)}else o||i.set(n,e)}o&&this.parser.raise(b.PrivateNameRedeclaration,{at:t,identifierName:n}),r.add(n),a.delete(n)}usePrivateName(n,e){let t;for(t of this.stack)if(t.privateNames.has(n))return;t?t.undefinedPrivateNames.set(n,e):this.parser.raise(b.InvalidPrivateFieldResolution,{at:e,identifierName:n})}},ut=class{constructor(n=0){this.type=n}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},Pn=class extends ut{constructor(n){super(n),this.declarationErrors=new Map}recordDeclarationError(n,{at:e}){let t=e.index;this.declarationErrors.set(t,[n,e])}clearDeclarationError(n){this.declarationErrors.delete(n)}iterateErrors(n){this.declarationErrors.forEach(n)}},Sr=class{constructor(n){this.parser=void 0,this.stack=[new ut],this.parser=n}enter(n){this.stack.push(n)}exit(){this.stack.pop()}recordParameterInitializerError(n,{at:e}){let t={at:e.loc.start},{stack:r}=this,i=r.length-1,a=r[i];for(;!a.isCertainlyParameterDeclaration();){if(a.canBeArrowParameterDeclaration())a.recordDeclarationError(n,t);else return;a=r[--i]}this.parser.raise(n,t)}recordArrowParameterBindingError(n,{at:e}){let{stack:t}=this,r=t[t.length-1],i={at:e.loc.start};if(r.isCertainlyParameterDeclaration())this.parser.raise(n,i);else if(r.canBeArrowParameterDeclaration())r.recordDeclarationError(n,i);else return}recordAsyncArrowParametersError({at:n}){let{stack:e}=this,t=e.length-1,r=e[t];for(;r.canBeArrowParameterDeclaration();)r.type===2&&r.recordDeclarationError(b.AwaitBindingIdentifier,{at:n}),r=e[--t]}validateAsPattern(){let{stack:n}=this,e=n[n.length-1];e.canBeArrowParameterDeclaration()&&e.iterateErrors(([t,r])=>{this.parser.raise(t,{at:r});let i=n.length-2,a=n[i];for(;a.canBeArrowParameterDeclaration();)a.clearDeclarationError(r.index),a=n[--i]})}};function sl(){return new ut(3)}function il(){return new Pn(1)}function al(){return new Pn(2)}function yi(){return new ut}var Er=class{constructor(){this.stacks=[]}enter(n){this.stacks.push(n)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(this.currentFlags()&2)>0}get hasYield(){return(this.currentFlags()&1)>0}get hasReturn(){return(this.currentFlags()&4)>0}get hasIn(){return(this.currentFlags()&8)>0}};function yn(s,n){return(s?2:0)|(n?1:0)}var Ir=class extends Tr{addExtra(n,e,t,r=!0){if(!n)return;let i=n.extra=n.extra||{};r?i[e]=t:Object.defineProperty(i,e,{enumerable:r,value:t})}isContextual(n){return this.state.type===n&&!this.state.containsEsc}isUnparsedContextual(n,e){let t=n+e.length;if(this.input.slice(n,t)===e){let r=this.input.charCodeAt(t);return!(lt(r)||(r&64512)===55296)}return!1}isLookaheadContextual(n){let e=this.nextTokenStart();return this.isUnparsedContextual(e,n)}eatContextual(n){return this.isContextual(n)?(this.next(),!0):!1}expectContextual(n,e){if(!this.eatContextual(n)){if(e!=null)throw this.raise(e,{at:this.state.startLoc});this.unexpected(null,n)}}canInsertSemicolon(){return this.match(139)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return fi.test(this.input.slice(this.state.lastTokEndLoc.index,this.state.start))}hasFollowingLineBreak(){return Js.lastIndex=this.state.end,Js.test(this.input)}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(n=!0){(n?this.isLineTerminator():this.eat(13))||this.raise(b.MissingSemicolon,{at:this.state.lastTokEndLoc})}expect(n,e){this.eat(n)||this.unexpected(e,n)}tryParse(n,e=this.state.clone()){let t={node:null};try{let r=n((i=null)=>{throw t.node=i,t});if(this.state.errors.length>e.errors.length){let i=this.state;return this.state=e,this.state.tokensLength=i.tokensLength,{node:r,error:i.errors[e.errors.length],thrown:!1,aborted:!1,failState:i}}return{node:r,error:null,thrown:!1,aborted:!1,failState:null}}catch(r){let i=this.state;if(this.state=e,r instanceof SyntaxError)return{node:null,error:r,thrown:!0,aborted:!1,failState:i};if(r===t)return{node:t.node,error:null,thrown:!1,aborted:!0,failState:i};throw r}}checkExpressionErrors(n,e){if(!n)return!1;let{shorthandAssignLoc:t,doubleProtoLoc:r,privateKeyLoc:i,optionalParametersLoc:a}=n,o=!!t||!!r||!!a||!!i;if(!e)return o;t!=null&&this.raise(b.InvalidCoverInitializedName,{at:t}),r!=null&&this.raise(b.DuplicateProto,{at:r}),i!=null&&this.raise(b.UnexpectedPrivateField,{at:i}),a!=null&&this.unexpected(a)}isLiteralPropertyName(){return ai(this.state.type)}isPrivateName(n){return n.type==="PrivateName"}getPrivateNameSV(n){return n.id.name}hasPropertyAsPrivateName(n){return(n.type==="MemberExpression"||n.type==="OptionalMemberExpression")&&this.isPrivateName(n.property)}isObjectProperty(n){return n.type==="ObjectProperty"}isObjectMethod(n){return n.type==="ObjectMethod"}initializeScopes(n=this.options.sourceType==="module"){let e=this.state.labels;this.state.labels=[];let t=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let r=this.inModule;this.inModule=n;let i=this.scope,a=this.getScopeHandler();this.scope=new a(this,n);let o=this.prodParam;this.prodParam=new Er;let l=this.classScope;this.classScope=new Cr(this);let c=this.expressionScope;return this.expressionScope=new Sr(this),()=>{this.state.labels=e,this.exportedIdentifiers=t,this.inModule=r,this.scope=i,this.prodParam=o,this.classScope=l,this.expressionScope=c}}enterInitialScopes(){let n=0;this.inModule&&(n|=2),this.scope.enter(1),this.prodParam.enter(n)}checkDestructuringPrivate(n){let{privateKeyLoc:e}=n;e!==null&&this.expectPlugin("destructuringPrivate",e)}},ct=class{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null}},dt=class{constructor(n,e,t){this.type="",this.start=e,this.end=0,this.loc=new pt(t),n!=null&&n.options.ranges&&(this.range=[e,0]),n!=null&&n.filename&&(this.loc.filename=n.filename)}},$r=dt.prototype;$r.__clone=function(){let s=new dt(void 0,this.start,this.loc.start),n=Object.keys(this);for(let e=0,t=n.length;e<t;e++){let r=n[e];r!=="leadingComments"&&r!=="trailingComments"&&r!=="innerComments"&&(s[r]=this[r])}return s};function ol(s){return Be(s)}function Be(s){let{type:n,start:e,end:t,loc:r,range:i,extra:a,name:o}=s,l=Object.create($r);return l.type=n,l.start=e,l.end=t,l.loc=r,l.range=i,l.extra=a,l.name=o,n==="Placeholder"&&(l.expectedNode=s.expectedNode),l}function ll(s){let{type:n,start:e,end:t,loc:r,range:i,extra:a}=s;if(n==="Placeholder")return ol(s);let o=Object.create($r);return o.type=n,o.start=e,o.end=t,o.loc=r,o.range=i,s.raw!==void 0?o.raw=s.raw:o.extra=a,o.value=s.value,o}var Ar=class extends Ir{startNode(){return new dt(this,this.state.start,this.state.startLoc)}startNodeAt(n){return new dt(this,n.index,n)}startNodeAtNode(n){return this.startNodeAt(n.loc.start)}finishNode(n,e){return this.finishNodeAt(n,e,this.state.lastTokEndLoc)}finishNodeAt(n,e,t){return n.type=e,n.end=t.index,n.loc.end=t,this.options.ranges&&(n.range[1]=t.index),this.options.attachComment&&this.processComment(n),n}resetStartLocation(n,e){n.start=e.index,n.loc.start=e,this.options.ranges&&(n.range[0]=e.index)}resetEndLocation(n,e=this.state.lastTokEndLoc){n.end=e.index,n.loc.end=e,this.options.ranges&&(n.range[1]=e.index)}resetStartLocationFromNode(n,e){this.resetStartLocation(n,e.loc.start)}},cl=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),L=Ue`flow`({AmbiguousConditionalArrow:"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:s})=>`Cannot overwrite reserved type ${s}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:s,enumName:n})=>`Boolean enum members need to be initialized. Use either \`${s} = true,\` or \`${s} = false,\` in enum \`${n}\`.`,EnumDuplicateMemberName:({memberName:s,enumName:n})=>`Enum member names need to be unique, but the name \`${s}\` has already been used before in enum \`${n}\`.`,EnumInconsistentMemberValues:({enumName:s})=>`Enum \`${s}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:s,enumName:n})=>`Enum type \`${s}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${n}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:s})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${s}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:s,memberName:n,explicitType:e})=>`Enum \`${s}\` has type \`${e}\`, so the initializer of \`${n}\` needs to be a ${e} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:s,memberName:n})=>`Symbol enum members cannot be initialized. Use \`${n},\` in enum \`${s}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:s,memberName:n})=>`The enum member initializer for \`${n}\` needs to be a literal (either a boolean, number, or string) in enum \`${s}\`.`,EnumInvalidMemberName:({enumName:s,memberName:n,suggestion:e})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${n}\`, consider using \`${e}\`, in enum \`${s}\`.`,EnumNumberMemberNotInitialized:({enumName:s,memberName:n})=>`Number enum members need to be initialized, e.g. \`${n} = 1\` in enum \`${s}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:s})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${s}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` or `typeof` keyword.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:Object.assign({message:"A binding pattern parameter cannot be optional in an implementation signature."},{reasonCode:"OptionalBindingPattern"}),SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:s})=>`Unexpected reserved type ${s}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:s,suggestion:n})=>`\`declare export ${s}\` is not supported. Use \`${n}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function pl(s){return s.type==="DeclareExportAllDeclaration"||s.type==="DeclareExportDeclaration"&&(!s.declaration||s.declaration.type!=="TypeAlias"&&s.declaration.type!=="InterfaceDeclaration")}function Ys(s){return s.importKind==="type"||s.importKind==="typeof"}var ul={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function dl(s,n){let e=[],t=[];for(let r=0;r<s.length;r++)(n(s[r],r,s)?e:t).push(s[r]);return[e,t]}var hl=/\*?\s*@((?:no)?flow)\b/,fl=s=>class extends s{constructor(...e){super(...e),this.flowPragma=void 0}getScopeHandler(){return yr}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}shouldParseEnums(){return!!this.getPluginOption("flow","enums")}finishToken(e,t){e!==133&&e!==13&&e!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,t)}addComment(e){if(this.flowPragma===void 0){let t=hl.exec(e.value);if(t)if(t[1]==="flow")this.flowPragma="flow";else if(t[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(e)}flowParseTypeInitialiser(e){let t=this.state.inType;this.state.inType=!0,this.expect(e||14);let r=this.flowParseType();return this.state.inType=t,r}flowParsePredicate(){let e=this.startNode(),t=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStart>t.index+1&&this.raise(L.UnexpectedSpaceBetweenModuloChecks,{at:t}),this.eat(10)?(e.value=super.parseExpression(),this.expect(11),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){let e=this.state.inType;this.state.inType=!0,this.expect(14);let t=null,r=null;return this.match(54)?(this.state.inType=e,r=this.flowParsePredicate()):(t=this.flowParseType(),this.state.inType=e,this.match(54)&&(r=this.flowParsePredicate())),[t,r]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")}flowParseDeclareFunction(e){this.next();let t=e.id=this.parseIdentifier(),r=this.startNode(),i=this.startNode();this.match(47)?r.typeParameters=this.flowParseTypeParameterDeclaration():r.typeParameters=null,this.expect(10);let a=this.flowParseFunctionTypeParams();return r.params=a.params,r.rest=a.rest,r.this=a._this,this.expect(11),[r.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),i.typeAnnotation=this.finishNode(r,"FunctionTypeAnnotation"),t.typeAnnotation=this.finishNode(i,"TypeAnnotation"),this.resetEndLocation(t),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.loc.start),this.finishNode(e,"DeclareFunction")}flowParseDeclare(e,t){if(this.match(80))return this.flowParseDeclareClass(e);if(this.match(68))return this.flowParseDeclareFunction(e);if(this.match(74))return this.flowParseDeclareVariable(e);if(this.eatContextual(127))return this.match(16)?this.flowParseDeclareModuleExports(e):(t&&this.raise(L.NestedDeclareModule,{at:this.state.lastTokStartLoc}),this.flowParseDeclareModule(e));if(this.isContextual(130))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(131))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(129))return this.flowParseDeclareInterface(e);if(this.match(82))return this.flowParseDeclareExportDeclaration(e,t);this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(!0),this.scope.declareName(e.id.name,5,e.id.loc.start),this.semicolon(),this.finishNode(e,"DeclareVariable")}flowParseDeclareModule(e){this.scope.enter(0),this.match(133)?e.id=super.parseExprAtom():e.id=this.parseIdentifier();let t=e.body=this.startNode(),r=t.body=[];for(this.expect(5);!this.match(8);){let o=this.startNode();this.match(83)?(this.next(),!this.isContextual(130)&&!this.match(87)&&this.raise(L.InvalidNonTypeImportInDeclareModule,{at:this.state.lastTokStartLoc}),super.parseImport(o)):(this.expectContextual(125,L.UnsupportedStatementInDeclareModule),o=this.flowParseDeclare(o,!0)),r.push(o)}this.scope.exit(),this.expect(8),this.finishNode(t,"BlockStatement");let i=null,a=!1;return r.forEach(o=>{pl(o)?(i==="CommonJS"&&this.raise(L.AmbiguousDeclareModuleKind,{at:o}),i="ES"):o.type==="DeclareModuleExports"&&(a&&this.raise(L.DuplicateDeclareModuleExports,{at:o}),i==="ES"&&this.raise(L.AmbiguousDeclareModuleKind,{at:o}),i="CommonJS",a=!0)}),e.kind=i||"CommonJS",this.finishNode(e,"DeclareModule")}flowParseDeclareExportDeclaration(e,t){if(this.expect(82),this.eat(65))return this.match(68)||this.match(80)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,"DeclareExportDeclaration");if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!t){let r=this.state.value;throw this.raise(L.UnsupportedDeclareExportKind,{at:this.state.startLoc,unsupportedExportKind:r,suggestion:ul[r]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(131))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration");if(this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131))return e=this.parseExport(e,null),e.type==="ExportNamedDeclaration"&&(e.type="ExportDeclaration",e.default=!1,delete e.exportKind),e.type="Declare"+e.type,e;this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual(111),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")}flowParseDeclareTypeAlias(e){this.next();let t=this.flowParseTypeAlias(e);return t.type="DeclareTypeAlias",t}flowParseDeclareOpaqueType(e){this.next();let t=this.flowParseOpaqueType(e,!0);return t.type="DeclareOpaqueType",t}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,"DeclareInterface")}flowParseInterfaceish(e,t){if(e.id=this.flowParseRestrictedIdentifier(!t,!0),this.scope.declareName(e.id.name,t?17:8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(!t&&this.eat(12));if(t){if(e.implements=[],e.mixins=[],this.eatContextual(117))do e.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(113))do e.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}e.body=this.flowParseObjectType({allowStatic:t,allowExact:!1,allowSpread:!1,allowProto:t,allowInexact:!1})}flowParseInterfaceExtends(){let e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.match(47)?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"InterfaceExtends")}flowParseInterface(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,"InterfaceDeclaration")}checkNotUnderscore(e){e==="_"&&this.raise(L.UnexpectedReservedUnderscore,{at:this.state.startLoc})}checkReservedType(e,t,r){cl.has(e)&&this.raise(r?L.AssignReservedType:L.UnexpectedReservedType,{at:t,reservedType:e})}flowParseRestrictedIdentifier(e,t){return this.checkReservedType(this.state.value,this.state.startLoc,t),this.parseIdentifier(e)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(e,"TypeAlias")}flowParseOpaqueType(e,t){return this.expectContextual(130),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.supertype=null,this.match(14)&&(e.supertype=this.flowParseTypeInitialiser(14)),e.impltype=null,t||(e.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(e,"OpaqueType")}flowParseTypeParameter(e=!1){let t=this.state.startLoc,r=this.startNode(),i=this.flowParseVariance(),a=this.flowParseTypeAnnotatableIdentifier();return r.name=a.name,r.variance=i,r.bound=a.typeAnnotation,this.match(29)?(this.eat(29),r.default=this.flowParseType()):e&&this.raise(L.MissingTypeParamDefault,{at:t}),this.finishNode(r,"TypeParameter")}flowParseTypeParameterDeclaration(){let e=this.state.inType,t=this.startNode();t.params=[],this.state.inType=!0,this.match(47)||this.match(142)?this.next():this.unexpected();let r=!1;do{let i=this.flowParseTypeParameter(r);t.params.push(i),i.default&&(r=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=e,this.finishNode(t,"TypeParameterDeclaration")}flowParseTypeParameterInstantiation(){let e=this.startNode(),t=this.state.inType;e.params=[],this.state.inType=!0,this.expect(47);let r=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(48);)e.params.push(this.flowParseType()),this.match(48)||this.expect(12);return this.state.noAnonFunctionType=r,this.expect(48),this.state.inType=t,this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){let e=this.startNode(),t=this.state.inType;for(e.params=[],this.state.inType=!0,this.expect(47);!this.match(48);)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(48)||this.expect(12);return this.expect(48),this.state.inType=t,this.finishNode(e,"TypeParameterInstantiation")}flowParseInterfaceType(){let e=this.startNode();if(this.expectContextual(129),e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(this.eat(12));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(134)||this.match(133)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,t,r){return e.static=t,this.lookahead().type===14?(e.id=this.flowParseObjectPropertyKey(),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(3),e.value=this.flowParseTypeInitialiser(),e.variance=r,this.finishNode(e,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(e,t){return e.static=t,e.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start))):(e.method=!1,this.eat(17)&&(e.optional=!0),e.value=this.flowParseTypeInitialiser()),this.finishNode(e,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(e){for(e.params=[],e.rest=null,e.typeParameters=null,e.this=null,this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(10),this.match(78)&&(e.this=this.flowParseFunctionTypeParam(!0),e.this.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.params.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(e.rest=this.flowParseFunctionTypeParam(!1)),this.expect(11),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(e,t){let r=this.startNode();return e.static=t,e.value=this.flowParseObjectTypeMethodish(r),this.finishNode(e,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:e,allowExact:t,allowSpread:r,allowProto:i,allowInexact:a}){let o=this.state.inType;this.state.inType=!0;let l=this.startNode();l.callProperties=[],l.properties=[],l.indexers=[],l.internalSlots=[];let c,p,u=!1;for(t&&this.match(6)?(this.expect(6),c=9,p=!0):(this.expect(5),c=8,p=!1),l.exact=p;!this.match(c);){let m=!1,d=null,y=null,f=this.startNode();if(i&&this.isContextual(118)){let w=this.lookahead();w.type!==14&&w.type!==17&&(this.next(),d=this.state.startLoc,e=!1)}if(e&&this.isContextual(106)){let w=this.lookahead();w.type!==14&&w.type!==17&&(this.next(),m=!0)}let v=this.flowParseVariance();if(this.eat(0))d!=null&&this.unexpected(d),this.eat(0)?(v&&this.unexpected(v.loc.start),l.internalSlots.push(this.flowParseObjectTypeInternalSlot(f,m))):l.indexers.push(this.flowParseObjectTypeIndexer(f,m,v));else if(this.match(10)||this.match(47))d!=null&&this.unexpected(d),v&&this.unexpected(v.loc.start),l.callProperties.push(this.flowParseObjectTypeCallProperty(f,m));else{let w="init";if(this.isContextual(99)||this.isContextual(104)){let x=this.lookahead();ai(x.type)&&(w=this.state.value,this.next())}let I=this.flowParseObjectTypeProperty(f,m,d,v,w,r,a??!p);I===null?(u=!0,y=this.state.lastTokStartLoc):l.properties.push(I)}this.flowObjectTypeSemicolon(),y&&!this.match(8)&&!this.match(9)&&this.raise(L.UnexpectedExplicitInexactInObject,{at:y})}this.expect(c),r&&(l.inexact=u);let h=this.finishNode(l,"ObjectTypeAnnotation");return this.state.inType=o,h}flowParseObjectTypeProperty(e,t,r,i,a,o,l){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(o?l||this.raise(L.InexactInsideExact,{at:this.state.lastTokStartLoc}):this.raise(L.InexactInsideNonObject,{at:this.state.lastTokStartLoc}),i&&this.raise(L.InexactVariance,{at:i}),null):(o||this.raise(L.UnexpectedSpreadType,{at:this.state.lastTokStartLoc}),r!=null&&this.unexpected(r),i&&this.raise(L.SpreadVariance,{at:i}),e.argument=this.flowParseType(),this.finishNode(e,"ObjectTypeSpreadProperty"));{e.key=this.flowParseObjectPropertyKey(),e.static=t,e.proto=r!=null,e.kind=a;let c=!1;return this.match(47)||this.match(10)?(e.method=!0,r!=null&&this.unexpected(r),i&&this.unexpected(i.loc.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start)),(a==="get"||a==="set")&&this.flowCheckGetterSetterParams(e),!o&&e.key.name==="constructor"&&e.value.this&&this.raise(L.ThisParamBannedInConstructor,{at:e.value.this})):(a!=="init"&&this.unexpected(),e.method=!1,this.eat(17)&&(c=!0),e.value=this.flowParseTypeInitialiser(),e.variance=i),e.optional=c,this.finishNode(e,"ObjectTypeProperty")}}flowCheckGetterSetterParams(e){let t=e.kind==="get"?0:1,r=e.value.params.length+(e.value.rest?1:0);e.value.this&&this.raise(e.kind==="get"?L.GetterMayNotHaveThisParam:L.SetterMayNotHaveThisParam,{at:e.value.this}),r!==t&&this.raise(e.kind==="get"?b.BadGetterArity:b.BadSetterArity,{at:e}),e.kind==="set"&&e.value.rest&&this.raise(b.BadSetterRestParameter,{at:e})}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,t){var r;(r=e)!=null||(e=this.state.startLoc);let i=t||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){let a=this.startNodeAt(e);a.qualification=i,a.id=this.flowParseRestrictedIdentifier(!0),i=this.finishNode(a,"QualifiedTypeIdentifier")}return i}flowParseGenericType(e,t){let r=this.startNodeAt(e);return r.typeParameters=null,r.id=this.flowParseQualifiedTypeIdentifier(e,t),this.match(47)&&(r.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(r,"GenericTypeAnnotation")}flowParseTypeofType(){let e=this.startNode();return this.expect(87),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")}flowParseTupleType(){let e=this.startNode();for(e.types=[],this.expect(0);this.state.pos<this.length&&!this.match(3)&&(e.types.push(this.flowParseType()),!this.match(3));)this.expect(12);return this.expect(3),this.finishNode(e,"TupleTypeAnnotation")}flowParseFunctionTypeParam(e){let t=null,r=!1,i=null,a=this.startNode(),o=this.lookahead(),l=this.state.type===78;return o.type===14||o.type===17?(l&&!e&&this.raise(L.ThisParamMustBeFirst,{at:a}),t=this.parseIdentifier(l),this.eat(17)&&(r=!0,l&&this.raise(L.ThisParamMayNotBeOptional,{at:a})),i=this.flowParseTypeInitialiser()):i=this.flowParseType(),a.name=t,a.optional=r,a.typeAnnotation=i,this.finishNode(a,"FunctionTypeParam")}reinterpretTypeAsFunctionTypeParam(e){let t=this.startNodeAt(e.loc.start);return t.name=null,t.optional=!1,t.typeAnnotation=e,this.finishNode(t,"FunctionTypeParam")}flowParseFunctionTypeParams(e=[]){let t=null,r=null;for(this.match(78)&&(r=this.flowParseFunctionTypeParam(!0),r.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(t=this.flowParseFunctionTypeParam(!1)),{params:e,rest:t,_this:r}}flowIdentToTypeAnnotation(e,t,r){switch(r.name){case"any":return this.finishNode(t,"AnyTypeAnnotation");case"bool":case"boolean":return this.finishNode(t,"BooleanTypeAnnotation");case"mixed":return this.finishNode(t,"MixedTypeAnnotation");case"empty":return this.finishNode(t,"EmptyTypeAnnotation");case"number":return this.finishNode(t,"NumberTypeAnnotation");case"string":return this.finishNode(t,"StringTypeAnnotation");case"symbol":return this.finishNode(t,"SymbolTypeAnnotation");default:return this.checkNotUnderscore(r.name),this.flowParseGenericType(e,r)}}flowParsePrimaryType(){let e=this.state.startLoc,t=this.startNode(),r,i,a=!1,o=this.state.noAnonFunctionType;switch(this.state.type){case 5:return this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!0,allowProto:!1,allowInexact:!0});case 6:return this.flowParseObjectType({allowStatic:!1,allowExact:!0,allowSpread:!0,allowProto:!1,allowInexact:!1});case 0:return this.state.noAnonFunctionType=!1,i=this.flowParseTupleType(),this.state.noAnonFunctionType=o,i;case 47:return t.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(10),r=this.flowParseFunctionTypeParams(),t.params=r.params,t.rest=r.rest,t.this=r._this,this.expect(11),this.expect(19),t.returnType=this.flowParseType(),this.finishNode(t,"FunctionTypeAnnotation");case 10:if(this.next(),!this.match(11)&&!this.match(21))if(R(this.state.type)||this.match(78)){let l=this.lookahead().type;a=l!==17&&l!==14}else a=!0;if(a){if(this.state.noAnonFunctionType=!1,i=this.flowParseType(),this.state.noAnonFunctionType=o,this.state.noAnonFunctionType||!(this.match(12)||this.match(11)&&this.lookahead().type===19))return this.expect(11),i;this.eat(12)}return i?r=this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(i)]):r=this.flowParseFunctionTypeParams(),t.params=r.params,t.rest=r.rest,t.this=r._this,this.expect(11),this.expect(19),t.returnType=this.flowParseType(),t.typeParameters=null,this.finishNode(t,"FunctionTypeAnnotation");case 133:return this.parseLiteral(this.state.value,"StringLiteralTypeAnnotation");case 85:case 86:return t.value=this.match(85),this.next(),this.finishNode(t,"BooleanLiteralTypeAnnotation");case 53:if(this.state.value==="-"){if(this.next(),this.match(134))return this.parseLiteralAtNode(-this.state.value,"NumberLiteralTypeAnnotation",t);if(this.match(135))return this.parseLiteralAtNode(-this.state.value,"BigIntLiteralTypeAnnotation",t);throw this.raise(L.UnexpectedSubtractionOperand,{at:this.state.startLoc})}this.unexpected();return;case 134:return this.parseLiteral(this.state.value,"NumberLiteralTypeAnnotation");case 135:return this.parseLiteral(this.state.value,"BigIntLiteralTypeAnnotation");case 88:return this.next(),this.finishNode(t,"VoidTypeAnnotation");case 84:return this.next(),this.finishNode(t,"NullLiteralTypeAnnotation");case 78:return this.next(),this.finishNode(t,"ThisTypeAnnotation");case 55:return this.next(),this.finishNode(t,"ExistsTypeAnnotation");case 87:return this.flowParseTypeofType();default:if(jr(this.state.type)){let l=qe(this.state.type);return this.next(),super.createIdentifier(t,l)}else if(R(this.state.type))return this.isContextual(129)?this.flowParseInterfaceType():this.flowIdentToTypeAnnotation(e,t,this.parseIdentifier())}this.unexpected()}flowParsePostfixType(){let e=this.state.startLoc,t=this.flowParsePrimaryType(),r=!1;for(;(this.match(0)||this.match(18))&&!this.canInsertSemicolon();){let i=this.startNodeAt(e),a=this.eat(18);r=r||a,this.expect(0),!a&&this.match(3)?(i.elementType=t,this.next(),t=this.finishNode(i,"ArrayTypeAnnotation")):(i.objectType=t,i.indexType=this.flowParseType(),this.expect(3),r?(i.optional=a,t=this.finishNode(i,"OptionalIndexedAccessType")):t=this.finishNode(i,"IndexedAccessType"))}return t}flowParsePrefixType(){let e=this.startNode();return this.eat(17)?(e.typeAnnotation=this.flowParsePrefixType(),this.finishNode(e,"NullableTypeAnnotation")):this.flowParsePostfixType()}flowParseAnonFunctionWithoutParens(){let e=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(19)){let t=this.startNodeAt(e.loc.start);return t.params=[this.reinterpretTypeAsFunctionTypeParam(e)],t.rest=null,t.this=null,t.returnType=this.flowParseType(),t.typeParameters=null,this.finishNode(t,"FunctionTypeAnnotation")}return e}flowParseIntersectionType(){let e=this.startNode();this.eat(45);let t=this.flowParseAnonFunctionWithoutParens();for(e.types=[t];this.eat(45);)e.types.push(this.flowParseAnonFunctionWithoutParens());return e.types.length===1?t:this.finishNode(e,"IntersectionTypeAnnotation")}flowParseUnionType(){let e=this.startNode();this.eat(43);let t=this.flowParseIntersectionType();for(e.types=[t];this.eat(43);)e.types.push(this.flowParseIntersectionType());return e.types.length===1?t:this.finishNode(e,"UnionTypeAnnotation")}flowParseType(){let e=this.state.inType;this.state.inType=!0;let t=this.flowParseUnionType();return this.state.inType=e,t}flowParseTypeOrImplicitInstantiation(){if(this.state.type===132&&this.state.value==="_"){let e=this.state.startLoc,t=this.parseIdentifier();return this.flowParseGenericType(e,t)}else return this.flowParseType()}flowParseTypeAnnotation(){let e=this.startNode();return e.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(e,"TypeAnnotation")}flowParseTypeAnnotatableIdentifier(e){let t=e?this.parseIdentifier():this.flowParseRestrictedIdentifier();return this.match(14)&&(t.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(t)),t}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocation(e.expression,e.typeAnnotation.loc.end),e.expression}flowParseVariance(){let e=null;return this.match(53)?(e=this.startNode(),this.state.value==="+"?e.kind="plus":e.kind="minus",this.next(),this.finishNode(e,"Variance")):e}parseFunctionBody(e,t,r=!1){if(t){this.forwardNoArrowParamsConversionAt(e,()=>super.parseFunctionBody(e,!0,r));return}super.parseFunctionBody(e,!1,r)}parseFunctionBodyAndFinish(e,t,r=!1){if(this.match(14)){let i=this.startNode();[i.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),e.returnType=i.typeAnnotation?this.finishNode(i,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(e,t,r)}parseStatementLike(e){if(this.state.strict&&this.isContextual(129)){let r=this.lookahead();if(xe(r.type)){let i=this.startNode();return this.next(),this.flowParseInterface(i)}}else if(this.shouldParseEnums()&&this.isContextual(126)){let r=this.startNode();return this.next(),this.flowParseEnumDeclaration(r)}let t=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(t)&&(this.flowPragma=null),t}parseExpressionStatement(e,t,r){if(t.type==="Identifier"){if(t.name==="declare"){if(this.match(80)||R(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(e)}else if(R(this.state.type)){if(t.name==="interface")return this.flowParseInterface(e);if(t.name==="type")return this.flowParseTypeAlias(e);if(t.name==="opaque")return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,t,r)}shouldParseExportDeclaration(){let{type:e}=this.state;return Ks(e)||this.shouldParseEnums()&&e===126?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return Ks(e)||this.shouldParseEnums()&&e===126?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.shouldParseEnums()&&this.isContextual(126)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,t,r){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){let h=this.lookaheadCharCode();if(h===44||h===61||h===58||h===41)return this.setOptionalParametersError(r),e}this.expect(17);let i=this.state.clone(),a=this.state.noArrowAt,o=this.startNodeAt(t),{consequent:l,failed:c}=this.tryParseConditionalConsequent(),[p,u]=this.getArrowLikeExpressions(l);if(c||u.length>0){let h=[...a];if(u.length>0){this.state=i,this.state.noArrowAt=h;for(let m=0;m<u.length;m++)h.push(u[m].start);({consequent:l,failed:c}=this.tryParseConditionalConsequent()),[p,u]=this.getArrowLikeExpressions(l)}c&&p.length>1&&this.raise(L.AmbiguousConditionalArrow,{at:i.startLoc}),c&&p.length===1&&(this.state=i,h.push(p[0].start),this.state.noArrowAt=h,{consequent:l,failed:c}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(l,!0),this.state.noArrowAt=a,this.expect(14),o.test=e,o.consequent=l,o.alternate=this.forwardNoArrowParamsConversionAt(o,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(o,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let e=this.parseMaybeAssignAllowIn(),t=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:t}}getArrowLikeExpressions(e,t){let r=[e],i=[];for(;r.length!==0;){let a=r.pop();a.type==="ArrowFunctionExpression"?(a.typeParameters||!a.returnType?this.finishArrowValidation(a):i.push(a),r.push(a.body)):a.type==="ConditionalExpression"&&(r.push(a.consequent),r.push(a.alternate))}return t?(i.forEach(a=>this.finishArrowValidation(a)),[i,[]]):dl(i,a=>a.params.every(o=>this.isAssignable(o,!0)))}finishArrowValidation(e){var t;this.toAssignableList(e.params,(t=e.extra)==null?void 0:t.trailingCommaLoc,!1),this.scope.enter(6),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,t){let r;return this.state.noArrowParamsConversionAt.indexOf(e.start)!==-1?(this.state.noArrowParamsConversionAt.push(this.state.start),r=t(),this.state.noArrowParamsConversionAt.pop()):r=t(),r}parseParenItem(e,t){if(e=super.parseParenItem(e,t),this.eat(17)&&(e.optional=!0,this.resetEndLocation(e)),this.match(14)){let r=this.startNodeAt(t);return r.expression=e,r.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(r,"TypeCastExpression")}return e}assertModuleNodeAllowed(e){e.type==="ImportDeclaration"&&(e.importKind==="type"||e.importKind==="typeof")||e.type==="ExportNamedDeclaration"&&e.exportKind==="type"||e.type==="ExportAllDeclaration"&&e.exportKind==="type"||super.assertModuleNodeAllowed(e)}parseExportDeclaration(e){if(this.isContextual(130)){e.exportKind="type";let t=this.startNode();return this.next(),this.match(5)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(t)}else if(this.isContextual(131)){e.exportKind="type";let t=this.startNode();return this.next(),this.flowParseOpaqueType(t,!1)}else if(this.isContextual(129)){e.exportKind="type";let t=this.startNode();return this.next(),this.flowParseInterface(t)}else if(this.shouldParseEnums()&&this.isContextual(126)){e.exportKind="value";let t=this.startNode();return this.next(),this.flowParseEnumDeclaration(t)}else return super.parseExportDeclaration(e)}eatExportStar(e){return super.eatExportStar(e)?!0:this.isContextual(130)&&this.lookahead().type===55?(e.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(e){let{startLoc:t}=this.state,r=super.maybeParseExportNamespaceSpecifier(e);return r&&e.exportKind==="type"&&this.unexpected(t),r}parseClassId(e,t,r){super.parseClassId(e,t,r),this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,t,r){let{startLoc:i}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(e,t))return;t.declare=!0}super.parseClassMember(e,t,r),t.declare&&(t.type!=="ClassProperty"&&t.type!=="ClassPrivateProperty"&&t.type!=="PropertyDefinition"?this.raise(L.DeclareClassElement,{at:i}):t.value&&this.raise(L.DeclareClassFieldInitializer,{at:t.value}))}isIterator(e){return e==="iterator"||e==="asyncIterator"}readIterator(){let e=super.readWord1(),t="@@"+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(b.InvalidIdentifier,{at:this.state.curPosition(),identifierName:t}),this.finishToken(132,t)}getTokenFromCode(e){let t=this.input.charCodeAt(this.state.pos+1);e===123&&t===124?this.finishOp(6,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?48:47,1):this.state.inType&&e===63?t===46?this.finishOp(18,2):this.finishOp(17,1):Go(e,t,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,t){return e.type==="TypeCastExpression"?this.isAssignable(e.expression,t):super.isAssignable(e,t)}toAssignable(e,t=!1){!t&&e.type==="AssignmentExpression"&&e.left.type==="TypeCastExpression"&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,t)}toAssignableList(e,t,r){for(let i=0;i<e.length;i++){let a=e[i];a?.type==="TypeCastExpression"&&(e[i]=this.typeCastToParameter(a))}super.toAssignableList(e,t,r)}toReferencedList(e,t){for(let i=0;i<e.length;i++){var r;let a=e[i];a&&a.type==="TypeCastExpression"&&!((r=a.extra)!=null&&r.parenthesized)&&(e.length>1||!t)&&this.raise(L.TypeCastInPattern,{at:a.typeAnnotation})}return e}parseArrayLike(e,t,r,i){let a=super.parseArrayLike(e,t,r,i);return t&&!this.state.maybeInArrowParameters&&this.toReferencedList(a.elements),a}isValidLVal(e,t,r){return e==="TypeCastExpression"||super.isValidLVal(e,t,r)}parseClassProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(14)&&super.isNonstaticConstructor(e)}pushClassMethod(e,t,r,i,a,o){if(t.variance&&this.unexpected(t.variance.loc.start),delete t.variance,this.match(47)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,t,r,i,a,o),t.params&&a){let l=t.params;l.length>0&&this.isThisParam(l[0])&&this.raise(L.ThisParamBannedInConstructor,{at:t})}else if(t.type==="MethodDefinition"&&a&&t.value.params){let l=t.value.params;l.length>0&&this.isThisParam(l[0])&&this.raise(L.ThisParamBannedInConstructor,{at:t})}}pushClassPrivateMethod(e,t,r,i){t.variance&&this.unexpected(t.variance.loc.start),delete t.variance,this.match(47)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,t,r,i)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&this.match(47)&&(e.superTypeParameters=this.flowParseTypeParameterInstantiation()),this.isContextual(113)){this.next();let t=e.implements=[];do{let r=this.startNode();r.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?r.typeParameters=this.flowParseTypeParameterInstantiation():r.typeParameters=null,t.push(this.finishNode(r,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);let t=this.getObjectOrClassMethodParams(e);if(t.length>0){let r=t[0];this.isThisParam(r)&&e.kind==="get"?this.raise(L.GetterMayNotHaveThisParam,{at:r}):this.isThisParam(r)&&this.raise(L.SetterMayNotHaveThisParam,{at:r})}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,t,r,i,a,o,l){e.variance&&this.unexpected(e.variance.loc.start),delete e.variance;let c;this.match(47)&&!o&&(c=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());let p=super.parseObjPropValue(e,t,r,i,a,o,l);return c&&((p.value||p).typeParameters=c),p}parseAssignableListItemTypes(e){return this.eat(17)&&(e.type!=="Identifier"&&this.raise(L.PatternIsOptional,{at:e}),this.isThisParam(e)&&this.raise(L.ThisParamMayNotBeOptional,{at:e}),e.optional=!0),this.match(14)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(L.ThisParamAnnotationRequired,{at:e}),this.match(29)&&this.isThisParam(e)&&this.raise(L.ThisParamNoDefault,{at:e}),this.resetEndLocation(e),e}parseMaybeDefault(e,t){let r=super.parseMaybeDefault(e,t);return r.type==="AssignmentPattern"&&r.typeAnnotation&&r.right.start<r.typeAnnotation.start&&this.raise(L.TypeBeforeInitializer,{at:r.typeAnnotation}),r}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(L.ImportReflectionHasImportType,{at:e.specifiers[0].loc.start})}parseImportSpecifierLocal(e,t,r){t.local=Ys(e)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(t,r))}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){if(!e)return!0;let t=this.lookaheadCharCode();return t===123||t===42}return!e&&this.isContextual(87)}applyImportPhase(e,t,r,i){if(super.applyImportPhase(e,t,r,i),t){if(!r&&this.match(65))return;e.exportKind=r==="type"?r:"value"}else r==="type"&&this.match(55)&&this.unexpected(),e.importKind=r==="type"||r==="typeof"?r:"value"}parseImportSpecifier(e,t,r,i,a){let o=e.imported,l=null;o.type==="Identifier"&&(o.name==="type"?l="type":o.name==="typeof"&&(l="typeof"));let c=!1;if(this.isContextual(93)&&!this.isLookaheadContextual("as")){let u=this.parseIdentifier(!0);l!==null&&!xe(this.state.type)?(e.imported=u,e.importKind=l,e.local=Be(u)):(e.imported=o,e.importKind=null,e.local=this.parseIdentifier())}else{if(l!==null&&xe(this.state.type))e.imported=this.parseIdentifier(!0),e.importKind=l;else{if(t)throw this.raise(b.ImportBindingIsString,{at:e,importName:o.value});e.imported=o,e.importKind=null}this.eatContextual(93)?e.local=this.parseIdentifier():(c=!0,e.local=Be(e.imported))}let p=Ys(e);return r&&p&&this.raise(L.ImportTypeShorthandOnlyInPureImport,{at:e}),(r||p)&&this.checkReservedType(e.local.name,e.local.loc.start,!0),c&&!r&&!p&&this.checkReservedWord(e.local.name,e.loc.start,!0,!0),this.finishImportSpecifier(e,"ImportSpecifier")}parseBindingAtom(){switch(this.state.type){case 78:return this.parseIdentifier(!0);default:return super.parseBindingAtom()}}parseFunctionParams(e,t){let r=e.kind;r!=="get"&&r!=="set"&&this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),super.parseFunctionParams(e,t)}parseVarId(e,t){super.parseVarId(e,t),this.match(14)&&(e.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,t){if(this.match(14)){let r=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,e.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=r}return super.parseAsyncArrowFromCallExpression(e,t)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}parseMaybeAssign(e,t){var r;let i=null,a;if(this.hasPlugin("jsx")&&(this.match(142)||this.match(47))){if(i=this.state.clone(),a=this.tryParse(()=>super.parseMaybeAssign(e,t),i),!a.error)return a.node;let{context:c}=this.state,p=c[c.length-1];(p===V.j_oTag||p===V.j_expr)&&c.pop()}if((r=a)!=null&&r.error||this.match(47)){var o,l;i=i||this.state.clone();let c,p=this.tryParse(h=>{var m;c=this.flowParseTypeParameterDeclaration();let d=this.forwardNoArrowParamsConversionAt(c,()=>{let f=super.parseMaybeAssign(e,t);return this.resetStartLocationFromNode(f,c),f});(m=d.extra)!=null&&m.parenthesized&&h();let y=this.maybeUnwrapTypeCastExpression(d);return y.type!=="ArrowFunctionExpression"&&h(),y.typeParameters=c,this.resetStartLocationFromNode(y,c),d},i),u=null;if(p.node&&this.maybeUnwrapTypeCastExpression(p.node).type==="ArrowFunctionExpression"){if(!p.error&&!p.aborted)return p.node.async&&this.raise(L.UnexpectedTypeParameterBeforeAsyncArrowFunction,{at:c}),p.node;u=p.node}if((o=a)!=null&&o.node)return this.state=a.failState,a.node;if(u)return this.state=p.failState,u;throw(l=a)!=null&&l.thrown?a.error:p.thrown?p.error:this.raise(L.UnexpectedTokenAfterTypeParameter,{at:c})}return super.parseMaybeAssign(e,t)}parseArrow(e){if(this.match(14)){let t=this.tryParse(()=>{let r=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let i=this.startNode();return[i.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=r,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),i});if(t.thrown)return null;t.error&&(this.state=t.failState),e.returnType=t.node.typeAnnotation?this.finishNode(t.node,"TypeAnnotation"):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(14)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,t){this.state.noArrowParamsConversionAt.indexOf(e.start)!==-1?e.params=t:super.setArrowFunctionParameters(e,t)}checkParams(e,t,r,i=!0){if(!(r&&this.state.noArrowParamsConversionAt.indexOf(e.start)!==-1)){for(let a=0;a<e.params.length;a++)this.isThisParam(e.params[a])&&a>0&&this.raise(L.ThisParamMustBeFirst,{at:e.params[a]});super.checkParams(e,t,r,i)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&this.state.noArrowAt.indexOf(this.state.start)===-1)}parseSubscripts(e,t,r){if(e.type==="Identifier"&&e.name==="async"&&this.state.noArrowAt.indexOf(t.index)!==-1){this.next();let i=this.startNodeAt(t);i.callee=e,i.arguments=super.parseCallExpressionArguments(11,!1),e=this.finishNode(i,"CallExpression")}else if(e.type==="Identifier"&&e.name==="async"&&this.match(47)){let i=this.state.clone(),a=this.tryParse(l=>this.parseAsyncArrowWithTypeParameters(t)||l(),i);if(!a.error&&!a.aborted)return a.node;let o=this.tryParse(()=>super.parseSubscripts(e,t,r),i);if(o.node&&!o.error)return o.node;if(a.node)return this.state=a.failState,a.node;if(o.node)return this.state=o.failState,o.node;throw a.error||o.error}return super.parseSubscripts(e,t,r)}parseSubscript(e,t,r,i){if(this.match(18)&&this.isLookaheadToken_lt()){if(i.optionalChainMember=!0,r)return i.stop=!0,e;this.next();let a=this.startNodeAt(t);return a.callee=e,a.typeArguments=this.flowParseTypeParameterInstantiation(),this.expect(10),a.arguments=this.parseCallExpressionArguments(11,!1),a.optional=!0,this.finishCallExpression(a,!0)}else if(!r&&this.shouldParseTypes()&&this.match(47)){let a=this.startNodeAt(t);a.callee=e;let o=this.tryParse(()=>(a.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),a.arguments=super.parseCallExpressionArguments(11,!1),i.optionalChainMember&&(a.optional=!1),this.finishCallExpression(a,i.optionalChainMember)));if(o.node)return o.error&&(this.state=o.failState),o.node}return super.parseSubscript(e,t,r,i)}parseNewCallee(e){super.parseNewCallee(e);let t=null;this.shouldParseTypes()&&this.match(47)&&(t=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=t}parseAsyncArrowWithTypeParameters(e){let t=this.startNodeAt(e);if(this.parseFunctionParams(t,!1),!!this.parseArrow(t))return super.parseArrowExpression(t,void 0,!0)}readToken_mult_modulo(e){let t=this.input.charCodeAt(this.state.pos+1);if(e===42&&t===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(e)}readToken_pipe_amp(e){let t=this.input.charCodeAt(this.state.pos+1);if(e===124&&t===125){this.finishOp(9,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,t){let r=super.parseTopLevel(e,t);return this.state.hasFlowComment&&this.raise(L.UnterminatedFlowComment,{at:this.state.curPosition()}),r}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(L.NestedFlowComment,{at:this.state.startLoc});this.hasFlowCommentCompletion();let e=this.skipFlowComment();e&&(this.state.pos+=e,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:e}=this.state,t=2;for(;[32,9].includes(this.input.charCodeAt(e+t));)t++;let r=this.input.charCodeAt(t+e),i=this.input.charCodeAt(t+e+1);return r===58&&i===58?t+2:this.input.slice(t+e,t+e+12)==="flow-include"?t+12:r===58&&i!==58?t:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(b.UnterminatedComment,{at:this.state.curPosition()})}flowEnumErrorBooleanMemberNotInitialized(e,{enumName:t,memberName:r}){this.raise(L.EnumBooleanMemberNotInitialized,{at:e,memberName:r,enumName:t})}flowEnumErrorInvalidMemberInitializer(e,t){return this.raise(t.explicitType?t.explicitType==="symbol"?L.EnumInvalidMemberInitializerSymbolType:L.EnumInvalidMemberInitializerPrimaryType:L.EnumInvalidMemberInitializerUnknownType,Object.assign({at:e},t))}flowEnumErrorNumberMemberNotInitialized(e,{enumName:t,memberName:r}){this.raise(L.EnumNumberMemberNotInitialized,{at:e,enumName:t,memberName:r})}flowEnumErrorStringMemberInconsistentlyInitialized(e,{enumName:t}){this.raise(L.EnumStringMemberInconsistentlyInitialized,{at:e,enumName:t})}flowEnumMemberInit(){let e=this.state.startLoc,t=()=>this.match(12)||this.match(8);switch(this.state.type){case 134:{let r=this.parseNumericLiteral(this.state.value);return t()?{type:"number",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}case 133:{let r=this.parseStringLiteral(this.state.value);return t()?{type:"string",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}case 85:case 86:{let r=this.parseBooleanLiteral(this.match(85));return t()?{type:"boolean",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}default:return{type:"invalid",loc:e}}}flowEnumMemberRaw(){let e=this.state.startLoc,t=this.parseIdentifier(!0),r=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:e};return{id:t,init:r}}flowEnumCheckExplicitTypeMismatch(e,t,r){let{explicitType:i}=t;i!==null&&i!==r&&this.flowEnumErrorInvalidMemberInitializer(e,t)}flowEnumMembers({enumName:e,explicitType:t}){let r=new Set,i={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},a=!1;for(;!this.match(8);){if(this.eat(21)){a=!0;break}let o=this.startNode(),{id:l,init:c}=this.flowEnumMemberRaw(),p=l.name;if(p==="")continue;/^[a-z]/.test(p)&&this.raise(L.EnumInvalidMemberName,{at:l,memberName:p,suggestion:p[0].toUpperCase()+p.slice(1),enumName:e}),r.has(p)&&this.raise(L.EnumDuplicateMemberName,{at:l,memberName:p,enumName:e}),r.add(p);let u={enumName:e,explicitType:t,memberName:p};switch(o.id=l,c.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(c.loc,u,"boolean"),o.init=c.value,i.booleanMembers.push(this.finishNode(o,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(c.loc,u,"number"),o.init=c.value,i.numberMembers.push(this.finishNode(o,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(c.loc,u,"string"),o.init=c.value,i.stringMembers.push(this.finishNode(o,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(c.loc,u);case"none":switch(t){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(c.loc,u);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(c.loc,u);break;default:i.defaultedMembers.push(this.finishNode(o,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:i,hasUnknownMembers:a}}flowEnumStringMembers(e,t,{enumName:r}){if(e.length===0)return t;if(t.length===0)return e;if(t.length>e.length){for(let i of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(i,{enumName:r});return t}else{for(let i of t)this.flowEnumErrorStringMemberInconsistentlyInitialized(i,{enumName:r});return e}}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(102))return null;if(!R(this.state.type))throw this.raise(L.EnumInvalidExplicitTypeUnknownSupplied,{at:this.state.startLoc,enumName:e});let{value:t}=this.state;return this.next(),t!=="boolean"&&t!=="number"&&t!=="string"&&t!=="symbol"&&this.raise(L.EnumInvalidExplicitType,{at:this.state.startLoc,enumName:e,invalidEnumType:t}),t}flowEnumBody(e,t){let r=t.name,i=t.loc.start,a=this.flowEnumParseExplicitType({enumName:r});this.expect(5);let{members:o,hasUnknownMembers:l}=this.flowEnumMembers({enumName:r,explicitType:a});switch(e.hasUnknownMembers=l,a){case"boolean":return e.explicitType=!0,e.members=o.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody");case"number":return e.explicitType=!0,e.members=o.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody");case"string":return e.explicitType=!0,e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:r}),this.expect(8),this.finishNode(e,"EnumStringBody");case"symbol":return e.members=o.defaultedMembers,this.expect(8),this.finishNode(e,"EnumSymbolBody");default:{let c=()=>(e.members=[],this.expect(8),this.finishNode(e,"EnumStringBody"));e.explicitType=!1;let p=o.booleanMembers.length,u=o.numberMembers.length,h=o.stringMembers.length,m=o.defaultedMembers.length;if(!p&&!u&&!h&&!m)return c();if(!p&&!u)return e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:r}),this.expect(8),this.finishNode(e,"EnumStringBody");if(!u&&!h&&p>=m){for(let d of o.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(d.loc.start,{enumName:r,memberName:d.id.name});return e.members=o.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody")}else if(!p&&!h&&u>=m){for(let d of o.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(d.loc.start,{enumName:r,memberName:d.id.name});return e.members=o.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody")}else return this.raise(L.EnumInconsistentMemberValues,{at:i,enumName:r}),c()}}}flowParseEnumDeclaration(e){let t=this.parseIdentifier();return e.id=t,e.body=this.flowEnumBody(this.startNode(),t),this.finishNode(e,"EnumDeclaration")}isLookaheadToken_lt(){let e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){let t=this.input.charCodeAt(e+1);return t!==60&&t!==61}return!1}maybeUnwrapTypeCastExpression(e){return e.type==="TypeCastExpression"?e.expression:e}},ml={__proto__:null,quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"},Xe=Ue`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:s})=>`Expected corresponding JSX closing tag for <${s}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:s,HTMLEntity:n})=>`Unexpected token \`${s}\`. Did you mean \`${n}\` or \`{'${s}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"});function ze(s){return s?s.type==="JSXOpeningFragment"||s.type==="JSXClosingFragment":!1}function ot(s){if(s.type==="JSXIdentifier")return s.name;if(s.type==="JSXNamespacedName")return s.namespace.name+":"+s.name.name;if(s.type==="JSXMemberExpression")return ot(s.object)+"."+ot(s.property);throw new Error("Node had unexpected type: "+s.type)}var bl=s=>class extends s{jsxReadToken(){let e="",t=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(Xe.UnterminatedJsxContent,{at:this.state.startLoc});let r=this.input.charCodeAt(this.state.pos);switch(r){case 60:case 123:if(this.state.pos===this.state.start){r===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(142)):super.getTokenFromCode(r);return}e+=this.input.slice(t,this.state.pos),this.finishToken(141,e);return;case 38:e+=this.input.slice(t,this.state.pos),e+=this.jsxReadEntity(),t=this.state.pos;break;case 62:case 125:default:Ot(r)?(e+=this.input.slice(t,this.state.pos),e+=this.jsxReadNewLine(!0),t=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){let t=this.input.charCodeAt(this.state.pos),r;return++this.state.pos,t===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,r=e?`
|
|
6
|
+
`);case 114:return o("\r");case 120:{let c;return{code:c,pos:n}=Pr(s,n,e,t,2,!1,a,i),o(c===null?null:String.fromCharCode(c))}case 117:{let c;return{code:c,pos:n}=bi(s,n,e,t,a,i),o(c===null?null:String.fromCodePoint(c))}case 116:return o(" ");case 98:return o("\b");case 118:return o("\v");case 102:return o("\f");case 13:s.charCodeAt(n)===10&&++n;case 10:e=n,++t;case 8232:case 8233:return o("");case 56:case 57:if(r)return o(null);i.strictNumericEscape(n-1,e,t);default:if(l>=48&&l<=55){let c=n-1,u=s.slice(c,n+2).match(/^[0-7]+/)[0],h=parseInt(u,8);h>255&&(u=u.slice(0,-1),h=parseInt(u,8)),n+=u.length-1;let m=s.charCodeAt(n);if(u!=="0"||m===56||m===57){if(r)return o(null);i.strictNumericEscape(c,e,t)}return o(String.fromCharCode(h))}return o(String.fromCharCode(l))}}function Pr(s,n,e,t,r,i,a,o){let l=n,c;return{n:c,pos:n}=mi(s,n,e,t,16,r,i,!1,o,!a),c===null&&(a?o.invalidEscapeSequence(l,e,t):n=l-1),{code:c,pos:n}}function mi(s,n,e,t,r,i,a,o,l,c){let p=n,u=r===16?Xs.hex:Xs.decBinOct,h=r===16?hn.hex:r===10?hn.dec:r===8?hn.oct:hn.bin,m=!1,d=0;for(let g=0,f=i??1/0;g<f;++g){let v=s.charCodeAt(n),w;if(v===95&&o!=="bail"){let E=s.charCodeAt(n-1),x=s.charCodeAt(n+1);if(o){if(Number.isNaN(x)||!h(x)||u.has(E)||u.has(x)){if(c)return{n:null,pos:n};l.unexpectedNumericSeparator(n,e,t)}}else{if(c)return{n:null,pos:n};l.numericSeparatorInEscapeSequence(n,e,t)}++n;continue}if(v>=97?w=v-97+10:v>=65?w=v-65+10:Yo(v)?w=v-48:w=1/0,w>=r){if(w<=9&&c)return{n:null,pos:n};if(w<=9&&l.invalidDigit(n,e,t,r))w=0;else if(a)w=0,m=!0;else break}++n,d=d*r+w}return n===p||i!=null&&n-p!==i||m?{n:null,pos:n}:{n:d,pos:n}}function bi(s,n,e,t,r,i){let a=s.charCodeAt(n),o;if(a===123){if(++n,{code:o,pos:n}=Pr(s,n,e,t,s.indexOf("}",n)-n,!0,r,i),++n,o!==null&&o>1114111)if(r)i.invalidCodePoint(n,e,t);else return{code:null,pos:n}}else({code:o,pos:n}=Pr(s,n,e,t,4,!1,r,i));return{code:o,pos:n}}var tl=["at"],nl=["at"];function Mt(s,n,e){return new ke(e,s-n,s)}var rl=new Set([103,109,115,105,121,117,100,118]),Ae=class{constructor(n){this.type=n.type,this.value=n.value,this.start=n.start,this.end=n.end,this.loc=new pt(n.startLoc,n.endLoc)}},Tr=class extends vr{constructor(n,e){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(t,r,i,a)=>this.options.errorRecovery?(this.raise(b.InvalidDigit,{at:Mt(t,r,i),radix:a}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(b.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(b.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(b.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(b.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(t,r,i)=>{this.recordStrictModeErrors(b.StrictNumericEscape,{at:Mt(t,r,i)})},unterminated:(t,r,i)=>{throw this.raise(b.UnterminatedString,{at:Mt(t-1,r,i)})}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(b.StrictNumericEscape),unterminated:(t,r,i)=>{throw this.raise(b.UnterminatedTemplate,{at:Mt(t,r,i)})}}),this.state=new xr,this.state.init(n),this.input=e,this.length=e.length,this.isLookahead=!1}pushToken(n){this.tokens.length=this.state.tokensLength,this.tokens.push(n),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.options.tokens&&this.pushToken(new Ae(this.state)),this.state.lastTokStart=this.state.start,this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(n){return this.match(n)?(this.next(),!0):!1}match(n){return this.state.type===n}createLookaheadState(n){return{pos:n.pos,value:null,type:n.type,start:n.start,end:n.end,context:[this.curContext()],inType:n.inType,startLoc:n.startLoc,lastTokEndLoc:n.lastTokEndLoc,curLine:n.curLine,lineStart:n.lineStart,curPosition:n.curPosition}}lookahead(){let n=this.state;this.state=this.createLookaheadState(n),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let e=this.state;return this.state=n,e}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(n){return pr.lastIndex=n,pr.test(this.input)?pr.lastIndex:n}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(n){return bn.lastIndex=n,bn.test(this.input)?bn.lastIndex:n}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(n){let e=this.input.charCodeAt(n);if((e&64512)===55296&&++n<this.input.length){let t=this.input.charCodeAt(n);(t&64512)===56320&&(e=65536+((e&1023)<<10)+(t&1023))}return e}setStrict(n){this.state.strict=n,n&&(this.state.strictErrors.forEach(([e,t])=>this.raise(e,{at:t})),this.state.strictErrors.clear())}curContext(){return this.state.context[this.state.context.length-1]}nextToken(){if(this.skipSpace(),this.state.start=this.state.pos,this.isLookahead||(this.state.startLoc=this.state.curPosition()),this.state.pos>=this.length){this.finishToken(139);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(n){let e;this.isLookahead||(e=this.state.curPosition());let t=this.state.pos,r=this.input.indexOf(n,t+2);if(r===-1)throw this.raise(b.UnterminatedComment,{at:this.state.curPosition()});for(this.state.pos=r+n.length,dn.lastIndex=t+2;dn.test(this.input)&&dn.lastIndex<=r;)++this.state.curLine,this.state.lineStart=dn.lastIndex;if(this.isLookahead)return;let i={type:"CommentBlock",value:this.input.slice(t+2,r),start:t,end:r+n.length,loc:new pt(e,this.state.curPosition())};return this.options.tokens&&this.pushToken(i),i}skipLineComment(n){let e=this.state.pos,t;this.isLookahead||(t=this.state.curPosition());let r=this.input.charCodeAt(this.state.pos+=n);if(this.state.pos<this.length)for(;!Ot(r)&&++this.state.pos<this.length;)r=this.input.charCodeAt(this.state.pos);if(this.isLookahead)return;let i=this.state.pos,o={type:"CommentLine",value:this.input.slice(e+n,i),start:e,end:i,loc:new pt(t,this.state.curPosition())};return this.options.tokens&&this.pushToken(o),o}skipSpace(){let n=this.state.pos,e=[];e:for(;this.state.pos<this.length;){let t=this.input.charCodeAt(this.state.pos);switch(t){case 32:case 160:case 9:++this.state.pos;break;case 13:this.input.charCodeAt(this.state.pos+1)===10&&++this.state.pos;case 10:case 8232:case 8233:++this.state.pos,++this.state.curLine,this.state.lineStart=this.state.pos;break;case 47:switch(this.input.charCodeAt(this.state.pos+1)){case 42:{let r=this.skipBlockComment("*/");r!==void 0&&(this.addComment(r),this.options.attachComment&&e.push(r));break}case 47:{let r=this.skipLineComment(2);r!==void 0&&(this.addComment(r),this.options.attachComment&&e.push(r));break}default:break e}break;default:if(Qo(t))++this.state.pos;else if(t===45&&!this.inModule&&this.options.annexB){let r=this.state.pos;if(this.input.charCodeAt(r+1)===45&&this.input.charCodeAt(r+2)===62&&(n===0||this.state.lineStart>n)){let i=this.skipLineComment(3);i!==void 0&&(this.addComment(i),this.options.attachComment&&e.push(i))}else break e}else if(t===60&&!this.inModule&&this.options.annexB){let r=this.state.pos;if(this.input.charCodeAt(r+1)===33&&this.input.charCodeAt(r+2)===45&&this.input.charCodeAt(r+3)===45){let i=this.skipLineComment(4);i!==void 0&&(this.addComment(i),this.options.attachComment&&e.push(i))}else break e}else break e}}if(e.length>0){let t=this.state.pos,r={start:n,end:t,comments:e,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(r)}}finishToken(n,e){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let t=this.state.type;this.state.type=n,this.state.value=e,this.isLookahead||this.updateContext(t)}replaceToken(n){this.state.type=n,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let n=this.state.pos+1,e=this.codePointAtPos(n);if(e>=48&&e<=57)throw this.raise(b.UnexpectedDigitAfterHash,{at:this.state.curPosition()});if(e===123||e===91&&this.hasPlugin("recordAndTuple")){if(this.expectPlugin("recordAndTuple"),this.getPluginOption("recordAndTuple","syntaxType")==="bar")throw this.raise(e===123?b.RecordExpressionHashIncorrectStartSyntaxType:b.TupleExpressionHashIncorrectStartSyntaxType,{at:this.state.curPosition()});this.state.pos+=2,e===123?this.finishToken(7):this.finishToken(1)}else Ue(e)?(++this.state.pos,this.finishToken(138,this.readWord1(e))):e===92?(++this.state.pos,this.finishToken(138,this.readWord1())):this.finishOp(27,1)}readToken_dot(){let n=this.input.charCodeAt(this.state.pos+1);if(n>=48&&n<=57){this.readNumber(!0);return}n===46&&this.input.charCodeAt(this.state.pos+2)===46?(this.state.pos+=3,this.finishToken(21)):(++this.state.pos,this.finishToken(16))}readToken_slash(){this.input.charCodeAt(this.state.pos+1)===61?this.finishOp(31,2):this.finishOp(56,1)}readToken_interpreter(){if(this.state.pos!==0||this.length<2)return!1;let n=this.input.charCodeAt(this.state.pos+1);if(n!==33)return!1;let e=this.state.pos;for(this.state.pos+=1;!Ot(n)&&++this.state.pos<this.length;)n=this.input.charCodeAt(this.state.pos);let t=this.input.slice(e+2,this.state.pos);return this.finishToken(28,t),!0}readToken_mult_modulo(n){let e=n===42?55:54,t=1,r=this.input.charCodeAt(this.state.pos+1);n===42&&r===42&&(t++,r=this.input.charCodeAt(this.state.pos+2),e=57),r===61&&!this.state.inType&&(t++,e=n===37?33:30),this.finishOp(e,t)}readToken_pipe_amp(n){let e=this.input.charCodeAt(this.state.pos+1);if(e===n){this.input.charCodeAt(this.state.pos+2)===61?this.finishOp(30,3):this.finishOp(n===124?41:42,2);return}if(n===124){if(e===62){this.finishOp(39,2);return}if(this.hasPlugin("recordAndTuple")&&e===125){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(b.RecordExpressionBarIncorrectEndSyntaxType,{at:this.state.curPosition()});this.state.pos+=2,this.finishToken(9);return}if(this.hasPlugin("recordAndTuple")&&e===93){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(b.TupleExpressionBarIncorrectEndSyntaxType,{at:this.state.curPosition()});this.state.pos+=2,this.finishToken(4);return}}if(e===61){this.finishOp(30,2);return}this.finishOp(n===124?43:45,1)}readToken_caret(){let n=this.input.charCodeAt(this.state.pos+1);n===61&&!this.state.inType?this.finishOp(32,2):n===94&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"^^"}])?(this.finishOp(37,2),this.input.codePointAt(this.state.pos)===94&&this.unexpected()):this.finishOp(44,1)}readToken_atSign(){this.input.charCodeAt(this.state.pos+1)===64&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"@@"}])?this.finishOp(38,2):this.finishOp(26,1)}readToken_plus_min(n){let e=this.input.charCodeAt(this.state.pos+1);if(e===n){this.finishOp(34,2);return}e===61?this.finishOp(30,2):this.finishOp(53,1)}readToken_lt(){let{pos:n}=this.state,e=this.input.charCodeAt(n+1);if(e===60){if(this.input.charCodeAt(n+2)===61){this.finishOp(30,3);return}this.finishOp(51,2);return}if(e===61){this.finishOp(49,2);return}this.finishOp(47,1)}readToken_gt(){let{pos:n}=this.state,e=this.input.charCodeAt(n+1);if(e===62){let t=this.input.charCodeAt(n+2)===62?3:2;if(this.input.charCodeAt(n+t)===61){this.finishOp(30,t+1);return}this.finishOp(52,t);return}if(e===61){this.finishOp(49,2);return}this.finishOp(48,1)}readToken_eq_excl(n){let e=this.input.charCodeAt(this.state.pos+1);if(e===61){this.finishOp(46,this.input.charCodeAt(this.state.pos+2)===61?3:2);return}if(n===61&&e===62){this.state.pos+=2,this.finishToken(19);return}this.finishOp(n===61?29:35,1)}readToken_question(){let n=this.input.charCodeAt(this.state.pos+1),e=this.input.charCodeAt(this.state.pos+2);n===63?e===61?this.finishOp(30,3):this.finishOp(40,2):n===46&&!(e>=48&&e<=57)?(this.state.pos+=2,this.finishToken(18)):(++this.state.pos,this.finishToken(17))}getTokenFromCode(n){switch(n){case 46:this.readToken_dot();return;case 40:++this.state.pos,this.finishToken(10);return;case 41:++this.state.pos,this.finishToken(11);return;case 59:++this.state.pos,this.finishToken(13);return;case 44:++this.state.pos,this.finishToken(12);return;case 91:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(b.TupleExpressionBarIncorrectStartSyntaxType,{at:this.state.curPosition()});this.state.pos+=2,this.finishToken(2)}else++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(3);return;case 123:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(b.RecordExpressionBarIncorrectStartSyntaxType,{at:this.state.curPosition()});this.state.pos+=2,this.finishToken(6)}else++this.state.pos,this.finishToken(5);return;case 125:++this.state.pos,this.finishToken(8);return;case 58:this.hasPlugin("functionBind")&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(15,2):(++this.state.pos,this.finishToken(14));return;case 63:this.readToken_question();return;case 96:this.readTemplateToken();return;case 48:{let e=this.input.charCodeAt(this.state.pos+1);if(e===120||e===88){this.readRadixNumber(16);return}if(e===111||e===79){this.readRadixNumber(8);return}if(e===98||e===66){this.readRadixNumber(2);return}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:this.readNumber(!1);return;case 34:case 39:this.readString(n);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(n);return;case 124:case 38:this.readToken_pipe_amp(n);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(n);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(n);return;case 126:this.finishOp(36,1);return;case 64:this.readToken_atSign();return;case 35:this.readToken_numberSign();return;case 92:this.readWord();return;default:if(Ue(n)){this.readWord(n);return}}throw this.raise(b.InvalidOrUnexpectedToken,{at:this.state.curPosition(),unexpected:String.fromCodePoint(n)})}finishOp(n,e){let t=this.input.slice(this.state.pos,this.state.pos+e);this.state.pos+=e,this.finishToken(n,t)}readRegexp(){let n=this.state.startLoc,e=this.state.start+1,t,r,{pos:i}=this.state;for(;;++i){if(i>=this.length)throw this.raise(b.UnterminatedRegExp,{at:se(n,1)});let c=this.input.charCodeAt(i);if(Ot(c))throw this.raise(b.UnterminatedRegExp,{at:se(n,1)});if(t)t=!1;else{if(c===91)r=!0;else if(c===93&&r)r=!1;else if(c===47&&!r)break;t=c===92}}let a=this.input.slice(e,i);++i;let o="",l=()=>se(n,i+2-e);for(;i<this.length;){let c=this.codePointAtPos(i),p=String.fromCharCode(c);if(rl.has(c))c===118?o.includes("u")&&this.raise(b.IncompatibleRegExpUVFlags,{at:l()}):c===117&&o.includes("v")&&this.raise(b.IncompatibleRegExpUVFlags,{at:l()}),o.includes(p)&&this.raise(b.DuplicateRegExpFlags,{at:l()});else if(lt(c)||c===92)this.raise(b.MalformedRegExpFlags,{at:l()});else break;++i,o+=p}this.state.pos=i,this.finishToken(137,{pattern:a,flags:o})}readInt(n,e,t=!1,r=!0){let{n:i,pos:a}=mi(this.input,this.state.pos,this.state.lineStart,this.state.curLine,n,e,t,r,this.errorHandlers_readInt,!1);return this.state.pos=a,i}readRadixNumber(n){let e=this.state.curPosition(),t=!1;this.state.pos+=2;let r=this.readInt(n);r==null&&this.raise(b.InvalidDigit,{at:se(e,2),radix:n});let i=this.input.charCodeAt(this.state.pos);if(i===110)++this.state.pos,t=!0;else if(i===109)throw this.raise(b.InvalidDecimal,{at:e});if(Ue(this.codePointAtPos(this.state.pos)))throw this.raise(b.NumberIdentifier,{at:this.state.curPosition()});if(t){let a=this.input.slice(e.index,this.state.pos).replace(/[_n]/g,"");this.finishToken(135,a);return}this.finishToken(134,r)}readNumber(n){let e=this.state.pos,t=this.state.curPosition(),r=!1,i=!1,a=!1,o=!1,l=!1;!n&&this.readInt(10)===null&&this.raise(b.InvalidNumber,{at:this.state.curPosition()});let c=this.state.pos-e>=2&&this.input.charCodeAt(e)===48;if(c){let m=this.input.slice(e,this.state.pos);if(this.recordStrictModeErrors(b.StrictOctalLiteral,{at:t}),!this.state.strict){let d=m.indexOf("_");d>0&&this.raise(b.ZeroDigitNumericSeparator,{at:se(t,d)})}l=c&&!/[89]/.test(m)}let p=this.input.charCodeAt(this.state.pos);if(p===46&&!l&&(++this.state.pos,this.readInt(10),r=!0,p=this.input.charCodeAt(this.state.pos)),(p===69||p===101)&&!l&&(p=this.input.charCodeAt(++this.state.pos),(p===43||p===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(b.InvalidOrMissingExponent,{at:t}),r=!0,o=!0,p=this.input.charCodeAt(this.state.pos)),p===110&&((r||c)&&this.raise(b.InvalidBigIntLiteral,{at:t}),++this.state.pos,i=!0),p===109&&(this.expectPlugin("decimal",this.state.curPosition()),(o||c)&&this.raise(b.InvalidDecimal,{at:t}),++this.state.pos,a=!0),Ue(this.codePointAtPos(this.state.pos)))throw this.raise(b.NumberIdentifier,{at:this.state.curPosition()});let u=this.input.slice(e,this.state.pos).replace(/[_mn]/g,"");if(i){this.finishToken(135,u);return}if(a){this.finishToken(136,u);return}let h=l?parseInt(u,8):parseFloat(u);this.finishToken(134,h)}readCodePoint(n){let{code:e,pos:t}=bi(this.input,this.state.pos,this.state.lineStart,this.state.curLine,n,this.errorHandlers_readCodePoint);return this.state.pos=t,e}readString(n){let{str:e,pos:t,curLine:r,lineStart:i}=Qs(n===34?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=t+1,this.state.lineStart=i,this.state.curLine=r,this.finishToken(133,e)}readTemplateContinuation(){this.match(8)||this.unexpected(null,8),this.state.pos--,this.readTemplateToken()}readTemplateToken(){let n=this.input[this.state.pos],{str:e,firstInvalidLoc:t,pos:r,curLine:i,lineStart:a}=Qs("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=r+1,this.state.lineStart=a,this.state.curLine=i,t&&(this.state.firstInvalidTemplateEscapePos=new ke(t.curLine,t.pos-t.lineStart,t.pos)),this.input.codePointAt(r)===96?this.finishToken(24,t?null:n+e+"`"):(this.state.pos++,this.finishToken(25,t?null:n+e+"${"))}recordStrictModeErrors(n,{at:e}){let t=e.index;this.state.strict&&!this.state.strictErrors.has(t)?this.raise(n,{at:e}):this.state.strictErrors.set(t,[n,e])}readWord1(n){this.state.containsEsc=!1;let e="",t=this.state.pos,r=this.state.pos;for(n!==void 0&&(this.state.pos+=n<=65535?1:2);this.state.pos<this.length;){let i=this.codePointAtPos(this.state.pos);if(lt(i))this.state.pos+=i<=65535?1:2;else if(i===92){this.state.containsEsc=!0,e+=this.input.slice(r,this.state.pos);let a=this.state.curPosition(),o=this.state.pos===t?Ue:lt;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(b.MissingUnicodeEscape,{at:this.state.curPosition()}),r=this.state.pos-1;continue}++this.state.pos;let l=this.readCodePoint(!0);l!==null&&(o(l)||this.raise(b.EscapedCharNotAnIdentifier,{at:a}),e+=String.fromCodePoint(l)),r=this.state.pos}else break}return e+this.input.slice(r,this.state.pos)}readWord(n){let e=this.readWord1(n),t=Or.get(e);t!==void 0?this.finishToken(t,qe(t)):this.finishToken(132,e)}checkKeywordEscapes(){let{type:n}=this.state;jr(n)&&this.state.containsEsc&&this.raise(b.InvalidEscapedReservedWord,{at:this.state.startLoc,reservedWord:qe(n)})}raise(n,e){let{at:t}=e,r=yn(e,tl),i=t instanceof ke?t:t.loc.start,a=n({loc:i,details:r});if(!this.options.errorRecovery)throw a;return this.isLookahead||this.state.errors.push(a),a}raiseOverwrite(n,e){let{at:t}=e,r=yn(e,nl),i=t instanceof ke?t:t.loc.start,a=i.index,o=this.state.errors;for(let l=o.length-1;l>=0;l--){let c=o[l];if(c.loc.index===a)return o[l]=n({loc:i,details:r});if(c.loc.index<a)break}return this.raise(n,e)}updateContext(n){}unexpected(n,e){throw this.raise(b.UnexpectedToken,{expected:e?qe(e):null,at:n??this.state.startLoc})}expectPlugin(n,e){if(this.hasPlugin(n))return!0;throw this.raise(b.MissingPlugin,{at:e??this.state.startLoc,missingPlugin:[n]})}expectOnePlugin(n){if(!n.some(e=>this.hasPlugin(e)))throw this.raise(b.MissingOneOfPlugins,{at:this.state.startLoc,missingPlugin:n})}errorBuilder(n){return(e,t,r)=>{this.raise(n,{at:Mt(e,t,r)})}}},wr=class{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}},Cr=class{constructor(n){this.parser=void 0,this.stack=[],this.undefinedPrivateNames=new Map,this.parser=n}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new wr)}exit(){let n=this.stack.pop(),e=this.current();for(let[t,r]of Array.from(n.undefinedPrivateNames))e?e.undefinedPrivateNames.has(t)||e.undefinedPrivateNames.set(t,r):this.parser.raise(b.InvalidPrivateFieldResolution,{at:r,identifierName:t})}declarePrivateName(n,e,t){let{privateNames:r,loneAccessors:i,undefinedPrivateNames:a}=this.current(),o=r.has(n);if(e&3){let l=o&&i.get(n);if(l){let c=l&4,p=e&4,u=l&3,h=e&3;o=u===h||c!==p,o||i.delete(n)}else o||i.set(n,e)}o&&this.parser.raise(b.PrivateNameRedeclaration,{at:t,identifierName:n}),r.add(n),a.delete(n)}usePrivateName(n,e){let t;for(t of this.stack)if(t.privateNames.has(n))return;t?t.undefinedPrivateNames.set(n,e):this.parser.raise(b.InvalidPrivateFieldResolution,{at:e,identifierName:n})}},ut=class{constructor(n=0){this.type=n}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},Pn=class extends ut{constructor(n){super(n),this.declarationErrors=new Map}recordDeclarationError(n,{at:e}){let t=e.index;this.declarationErrors.set(t,[n,e])}clearDeclarationError(n){this.declarationErrors.delete(n)}iterateErrors(n){this.declarationErrors.forEach(n)}},Sr=class{constructor(n){this.parser=void 0,this.stack=[new ut],this.parser=n}enter(n){this.stack.push(n)}exit(){this.stack.pop()}recordParameterInitializerError(n,{at:e}){let t={at:e.loc.start},{stack:r}=this,i=r.length-1,a=r[i];for(;!a.isCertainlyParameterDeclaration();){if(a.canBeArrowParameterDeclaration())a.recordDeclarationError(n,t);else return;a=r[--i]}this.parser.raise(n,t)}recordArrowParameterBindingError(n,{at:e}){let{stack:t}=this,r=t[t.length-1],i={at:e.loc.start};if(r.isCertainlyParameterDeclaration())this.parser.raise(n,i);else if(r.canBeArrowParameterDeclaration())r.recordDeclarationError(n,i);else return}recordAsyncArrowParametersError({at:n}){let{stack:e}=this,t=e.length-1,r=e[t];for(;r.canBeArrowParameterDeclaration();)r.type===2&&r.recordDeclarationError(b.AwaitBindingIdentifier,{at:n}),r=e[--t]}validateAsPattern(){let{stack:n}=this,e=n[n.length-1];e.canBeArrowParameterDeclaration()&&e.iterateErrors(([t,r])=>{this.parser.raise(t,{at:r});let i=n.length-2,a=n[i];for(;a.canBeArrowParameterDeclaration();)a.clearDeclarationError(r.index),a=n[--i]})}};function sl(){return new ut(3)}function il(){return new Pn(1)}function al(){return new Pn(2)}function gi(){return new ut}var Ir=class{constructor(){this.stacks=[]}enter(n){this.stacks.push(n)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(this.currentFlags()&2)>0}get hasYield(){return(this.currentFlags()&1)>0}get hasReturn(){return(this.currentFlags()&4)>0}get hasIn(){return(this.currentFlags()&8)>0}};function gn(s,n){return(s?2:0)|(n?1:0)}var Er=class extends Tr{addExtra(n,e,t,r=!0){if(!n)return;let i=n.extra=n.extra||{};r?i[e]=t:Object.defineProperty(i,e,{enumerable:r,value:t})}isContextual(n){return this.state.type===n&&!this.state.containsEsc}isUnparsedContextual(n,e){let t=n+e.length;if(this.input.slice(n,t)===e){let r=this.input.charCodeAt(t);return!(lt(r)||(r&64512)===55296)}return!1}isLookaheadContextual(n){let e=this.nextTokenStart();return this.isUnparsedContextual(e,n)}eatContextual(n){return this.isContextual(n)?(this.next(),!0):!1}expectContextual(n,e){if(!this.eatContextual(n)){if(e!=null)throw this.raise(e,{at:this.state.startLoc});this.unexpected(null,n)}}canInsertSemicolon(){return this.match(139)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return fi.test(this.input.slice(this.state.lastTokEndLoc.index,this.state.start))}hasFollowingLineBreak(){return Js.lastIndex=this.state.end,Js.test(this.input)}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(n=!0){(n?this.isLineTerminator():this.eat(13))||this.raise(b.MissingSemicolon,{at:this.state.lastTokEndLoc})}expect(n,e){this.eat(n)||this.unexpected(e,n)}tryParse(n,e=this.state.clone()){let t={node:null};try{let r=n((i=null)=>{throw t.node=i,t});if(this.state.errors.length>e.errors.length){let i=this.state;return this.state=e,this.state.tokensLength=i.tokensLength,{node:r,error:i.errors[e.errors.length],thrown:!1,aborted:!1,failState:i}}return{node:r,error:null,thrown:!1,aborted:!1,failState:null}}catch(r){let i=this.state;if(this.state=e,r instanceof SyntaxError)return{node:null,error:r,thrown:!0,aborted:!1,failState:i};if(r===t)return{node:t.node,error:null,thrown:!1,aborted:!0,failState:i};throw r}}checkExpressionErrors(n,e){if(!n)return!1;let{shorthandAssignLoc:t,doubleProtoLoc:r,privateKeyLoc:i,optionalParametersLoc:a}=n,o=!!t||!!r||!!a||!!i;if(!e)return o;t!=null&&this.raise(b.InvalidCoverInitializedName,{at:t}),r!=null&&this.raise(b.DuplicateProto,{at:r}),i!=null&&this.raise(b.UnexpectedPrivateField,{at:i}),a!=null&&this.unexpected(a)}isLiteralPropertyName(){return ai(this.state.type)}isPrivateName(n){return n.type==="PrivateName"}getPrivateNameSV(n){return n.id.name}hasPropertyAsPrivateName(n){return(n.type==="MemberExpression"||n.type==="OptionalMemberExpression")&&this.isPrivateName(n.property)}isObjectProperty(n){return n.type==="ObjectProperty"}isObjectMethod(n){return n.type==="ObjectMethod"}initializeScopes(n=this.options.sourceType==="module"){let e=this.state.labels;this.state.labels=[];let t=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let r=this.inModule;this.inModule=n;let i=this.scope,a=this.getScopeHandler();this.scope=new a(this,n);let o=this.prodParam;this.prodParam=new Ir;let l=this.classScope;this.classScope=new Cr(this);let c=this.expressionScope;return this.expressionScope=new Sr(this),()=>{this.state.labels=e,this.exportedIdentifiers=t,this.inModule=r,this.scope=i,this.prodParam=o,this.classScope=l,this.expressionScope=c}}enterInitialScopes(){let n=0;this.inModule&&(n|=2),this.scope.enter(1),this.prodParam.enter(n)}checkDestructuringPrivate(n){let{privateKeyLoc:e}=n;e!==null&&this.expectPlugin("destructuringPrivate",e)}},ct=class{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null}},dt=class{constructor(n,e,t){this.type="",this.start=e,this.end=0,this.loc=new pt(t),n!=null&&n.options.ranges&&(this.range=[e,0]),n!=null&&n.filename&&(this.loc.filename=n.filename)}},$r=dt.prototype;$r.__clone=function(){let s=new dt(void 0,this.start,this.loc.start),n=Object.keys(this);for(let e=0,t=n.length;e<t;e++){let r=n[e];r!=="leadingComments"&&r!=="trailingComments"&&r!=="innerComments"&&(s[r]=this[r])}return s};function ol(s){return Be(s)}function Be(s){let{type:n,start:e,end:t,loc:r,range:i,extra:a,name:o}=s,l=Object.create($r);return l.type=n,l.start=e,l.end=t,l.loc=r,l.range=i,l.extra=a,l.name=o,n==="Placeholder"&&(l.expectedNode=s.expectedNode),l}function ll(s){let{type:n,start:e,end:t,loc:r,range:i,extra:a}=s;if(n==="Placeholder")return ol(s);let o=Object.create($r);return o.type=n,o.start=e,o.end=t,o.loc=r,o.range=i,s.raw!==void 0?o.raw=s.raw:o.extra=a,o.value=s.value,o}var Ar=class extends Er{startNode(){return new dt(this,this.state.start,this.state.startLoc)}startNodeAt(n){return new dt(this,n.index,n)}startNodeAtNode(n){return this.startNodeAt(n.loc.start)}finishNode(n,e){return this.finishNodeAt(n,e,this.state.lastTokEndLoc)}finishNodeAt(n,e,t){return n.type=e,n.end=t.index,n.loc.end=t,this.options.ranges&&(n.range[1]=t.index),this.options.attachComment&&this.processComment(n),n}resetStartLocation(n,e){n.start=e.index,n.loc.start=e,this.options.ranges&&(n.range[0]=e.index)}resetEndLocation(n,e=this.state.lastTokEndLoc){n.end=e.index,n.loc.end=e,this.options.ranges&&(n.range[1]=e.index)}resetStartLocationFromNode(n,e){this.resetStartLocation(n,e.loc.start)}},cl=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),L=_e`flow`({AmbiguousConditionalArrow:"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:s})=>`Cannot overwrite reserved type ${s}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:s,enumName:n})=>`Boolean enum members need to be initialized. Use either \`${s} = true,\` or \`${s} = false,\` in enum \`${n}\`.`,EnumDuplicateMemberName:({memberName:s,enumName:n})=>`Enum member names need to be unique, but the name \`${s}\` has already been used before in enum \`${n}\`.`,EnumInconsistentMemberValues:({enumName:s})=>`Enum \`${s}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:s,enumName:n})=>`Enum type \`${s}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${n}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:s})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${s}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:s,memberName:n,explicitType:e})=>`Enum \`${s}\` has type \`${e}\`, so the initializer of \`${n}\` needs to be a ${e} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:s,memberName:n})=>`Symbol enum members cannot be initialized. Use \`${n},\` in enum \`${s}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:s,memberName:n})=>`The enum member initializer for \`${n}\` needs to be a literal (either a boolean, number, or string) in enum \`${s}\`.`,EnumInvalidMemberName:({enumName:s,memberName:n,suggestion:e})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${n}\`, consider using \`${e}\`, in enum \`${s}\`.`,EnumNumberMemberNotInitialized:({enumName:s,memberName:n})=>`Number enum members need to be initialized, e.g. \`${n} = 1\` in enum \`${s}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:s})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${s}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` or `typeof` keyword.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:Object.assign({message:"A binding pattern parameter cannot be optional in an implementation signature."},{reasonCode:"OptionalBindingPattern"}),SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:s})=>`Unexpected reserved type ${s}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:s,suggestion:n})=>`\`declare export ${s}\` is not supported. Use \`${n}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function pl(s){return s.type==="DeclareExportAllDeclaration"||s.type==="DeclareExportDeclaration"&&(!s.declaration||s.declaration.type!=="TypeAlias"&&s.declaration.type!=="InterfaceDeclaration")}function Ys(s){return s.importKind==="type"||s.importKind==="typeof"}var ul={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function dl(s,n){let e=[],t=[];for(let r=0;r<s.length;r++)(n(s[r],r,s)?e:t).push(s[r]);return[e,t]}var hl=/\*?\s*@((?:no)?flow)\b/,fl=s=>class extends s{constructor(...e){super(...e),this.flowPragma=void 0}getScopeHandler(){return gr}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}shouldParseEnums(){return!!this.getPluginOption("flow","enums")}finishToken(e,t){e!==133&&e!==13&&e!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,t)}addComment(e){if(this.flowPragma===void 0){let t=hl.exec(e.value);if(t)if(t[1]==="flow")this.flowPragma="flow";else if(t[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(e)}flowParseTypeInitialiser(e){let t=this.state.inType;this.state.inType=!0,this.expect(e||14);let r=this.flowParseType();return this.state.inType=t,r}flowParsePredicate(){let e=this.startNode(),t=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStart>t.index+1&&this.raise(L.UnexpectedSpaceBetweenModuloChecks,{at:t}),this.eat(10)?(e.value=super.parseExpression(),this.expect(11),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){let e=this.state.inType;this.state.inType=!0,this.expect(14);let t=null,r=null;return this.match(54)?(this.state.inType=e,r=this.flowParsePredicate()):(t=this.flowParseType(),this.state.inType=e,this.match(54)&&(r=this.flowParsePredicate())),[t,r]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")}flowParseDeclareFunction(e){this.next();let t=e.id=this.parseIdentifier(),r=this.startNode(),i=this.startNode();this.match(47)?r.typeParameters=this.flowParseTypeParameterDeclaration():r.typeParameters=null,this.expect(10);let a=this.flowParseFunctionTypeParams();return r.params=a.params,r.rest=a.rest,r.this=a._this,this.expect(11),[r.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),i.typeAnnotation=this.finishNode(r,"FunctionTypeAnnotation"),t.typeAnnotation=this.finishNode(i,"TypeAnnotation"),this.resetEndLocation(t),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.loc.start),this.finishNode(e,"DeclareFunction")}flowParseDeclare(e,t){if(this.match(80))return this.flowParseDeclareClass(e);if(this.match(68))return this.flowParseDeclareFunction(e);if(this.match(74))return this.flowParseDeclareVariable(e);if(this.eatContextual(127))return this.match(16)?this.flowParseDeclareModuleExports(e):(t&&this.raise(L.NestedDeclareModule,{at:this.state.lastTokStartLoc}),this.flowParseDeclareModule(e));if(this.isContextual(130))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(131))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(129))return this.flowParseDeclareInterface(e);if(this.match(82))return this.flowParseDeclareExportDeclaration(e,t);this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(!0),this.scope.declareName(e.id.name,5,e.id.loc.start),this.semicolon(),this.finishNode(e,"DeclareVariable")}flowParseDeclareModule(e){this.scope.enter(0),this.match(133)?e.id=super.parseExprAtom():e.id=this.parseIdentifier();let t=e.body=this.startNode(),r=t.body=[];for(this.expect(5);!this.match(8);){let o=this.startNode();this.match(83)?(this.next(),!this.isContextual(130)&&!this.match(87)&&this.raise(L.InvalidNonTypeImportInDeclareModule,{at:this.state.lastTokStartLoc}),super.parseImport(o)):(this.expectContextual(125,L.UnsupportedStatementInDeclareModule),o=this.flowParseDeclare(o,!0)),r.push(o)}this.scope.exit(),this.expect(8),this.finishNode(t,"BlockStatement");let i=null,a=!1;return r.forEach(o=>{pl(o)?(i==="CommonJS"&&this.raise(L.AmbiguousDeclareModuleKind,{at:o}),i="ES"):o.type==="DeclareModuleExports"&&(a&&this.raise(L.DuplicateDeclareModuleExports,{at:o}),i==="ES"&&this.raise(L.AmbiguousDeclareModuleKind,{at:o}),i="CommonJS",a=!0)}),e.kind=i||"CommonJS",this.finishNode(e,"DeclareModule")}flowParseDeclareExportDeclaration(e,t){if(this.expect(82),this.eat(65))return this.match(68)||this.match(80)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,"DeclareExportDeclaration");if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!t){let r=this.state.value;throw this.raise(L.UnsupportedDeclareExportKind,{at:this.state.startLoc,unsupportedExportKind:r,suggestion:ul[r]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(131))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration");if(this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131))return e=this.parseExport(e,null),e.type==="ExportNamedDeclaration"&&(e.type="ExportDeclaration",e.default=!1,delete e.exportKind),e.type="Declare"+e.type,e;this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual(111),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")}flowParseDeclareTypeAlias(e){this.next();let t=this.flowParseTypeAlias(e);return t.type="DeclareTypeAlias",t}flowParseDeclareOpaqueType(e){this.next();let t=this.flowParseOpaqueType(e,!0);return t.type="DeclareOpaqueType",t}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,"DeclareInterface")}flowParseInterfaceish(e,t){if(e.id=this.flowParseRestrictedIdentifier(!t,!0),this.scope.declareName(e.id.name,t?17:8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(!t&&this.eat(12));if(t){if(e.implements=[],e.mixins=[],this.eatContextual(117))do e.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(113))do e.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}e.body=this.flowParseObjectType({allowStatic:t,allowExact:!1,allowSpread:!1,allowProto:t,allowInexact:!1})}flowParseInterfaceExtends(){let e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.match(47)?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"InterfaceExtends")}flowParseInterface(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,"InterfaceDeclaration")}checkNotUnderscore(e){e==="_"&&this.raise(L.UnexpectedReservedUnderscore,{at:this.state.startLoc})}checkReservedType(e,t,r){cl.has(e)&&this.raise(r?L.AssignReservedType:L.UnexpectedReservedType,{at:t,reservedType:e})}flowParseRestrictedIdentifier(e,t){return this.checkReservedType(this.state.value,this.state.startLoc,t),this.parseIdentifier(e)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(e,"TypeAlias")}flowParseOpaqueType(e,t){return this.expectContextual(130),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.supertype=null,this.match(14)&&(e.supertype=this.flowParseTypeInitialiser(14)),e.impltype=null,t||(e.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(e,"OpaqueType")}flowParseTypeParameter(e=!1){let t=this.state.startLoc,r=this.startNode(),i=this.flowParseVariance(),a=this.flowParseTypeAnnotatableIdentifier();return r.name=a.name,r.variance=i,r.bound=a.typeAnnotation,this.match(29)?(this.eat(29),r.default=this.flowParseType()):e&&this.raise(L.MissingTypeParamDefault,{at:t}),this.finishNode(r,"TypeParameter")}flowParseTypeParameterDeclaration(){let e=this.state.inType,t=this.startNode();t.params=[],this.state.inType=!0,this.match(47)||this.match(142)?this.next():this.unexpected();let r=!1;do{let i=this.flowParseTypeParameter(r);t.params.push(i),i.default&&(r=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=e,this.finishNode(t,"TypeParameterDeclaration")}flowParseTypeParameterInstantiation(){let e=this.startNode(),t=this.state.inType;e.params=[],this.state.inType=!0,this.expect(47);let r=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(48);)e.params.push(this.flowParseType()),this.match(48)||this.expect(12);return this.state.noAnonFunctionType=r,this.expect(48),this.state.inType=t,this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){let e=this.startNode(),t=this.state.inType;for(e.params=[],this.state.inType=!0,this.expect(47);!this.match(48);)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(48)||this.expect(12);return this.expect(48),this.state.inType=t,this.finishNode(e,"TypeParameterInstantiation")}flowParseInterfaceType(){let e=this.startNode();if(this.expectContextual(129),e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(this.eat(12));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(134)||this.match(133)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,t,r){return e.static=t,this.lookahead().type===14?(e.id=this.flowParseObjectPropertyKey(),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(3),e.value=this.flowParseTypeInitialiser(),e.variance=r,this.finishNode(e,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(e,t){return e.static=t,e.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start))):(e.method=!1,this.eat(17)&&(e.optional=!0),e.value=this.flowParseTypeInitialiser()),this.finishNode(e,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(e){for(e.params=[],e.rest=null,e.typeParameters=null,e.this=null,this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(10),this.match(78)&&(e.this=this.flowParseFunctionTypeParam(!0),e.this.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.params.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(e.rest=this.flowParseFunctionTypeParam(!1)),this.expect(11),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(e,t){let r=this.startNode();return e.static=t,e.value=this.flowParseObjectTypeMethodish(r),this.finishNode(e,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:e,allowExact:t,allowSpread:r,allowProto:i,allowInexact:a}){let o=this.state.inType;this.state.inType=!0;let l=this.startNode();l.callProperties=[],l.properties=[],l.indexers=[],l.internalSlots=[];let c,p,u=!1;for(t&&this.match(6)?(this.expect(6),c=9,p=!0):(this.expect(5),c=8,p=!1),l.exact=p;!this.match(c);){let m=!1,d=null,g=null,f=this.startNode();if(i&&this.isContextual(118)){let w=this.lookahead();w.type!==14&&w.type!==17&&(this.next(),d=this.state.startLoc,e=!1)}if(e&&this.isContextual(106)){let w=this.lookahead();w.type!==14&&w.type!==17&&(this.next(),m=!0)}let v=this.flowParseVariance();if(this.eat(0))d!=null&&this.unexpected(d),this.eat(0)?(v&&this.unexpected(v.loc.start),l.internalSlots.push(this.flowParseObjectTypeInternalSlot(f,m))):l.indexers.push(this.flowParseObjectTypeIndexer(f,m,v));else if(this.match(10)||this.match(47))d!=null&&this.unexpected(d),v&&this.unexpected(v.loc.start),l.callProperties.push(this.flowParseObjectTypeCallProperty(f,m));else{let w="init";if(this.isContextual(99)||this.isContextual(104)){let x=this.lookahead();ai(x.type)&&(w=this.state.value,this.next())}let E=this.flowParseObjectTypeProperty(f,m,d,v,w,r,a??!p);E===null?(u=!0,g=this.state.lastTokStartLoc):l.properties.push(E)}this.flowObjectTypeSemicolon(),g&&!this.match(8)&&!this.match(9)&&this.raise(L.UnexpectedExplicitInexactInObject,{at:g})}this.expect(c),r&&(l.inexact=u);let h=this.finishNode(l,"ObjectTypeAnnotation");return this.state.inType=o,h}flowParseObjectTypeProperty(e,t,r,i,a,o,l){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(o?l||this.raise(L.InexactInsideExact,{at:this.state.lastTokStartLoc}):this.raise(L.InexactInsideNonObject,{at:this.state.lastTokStartLoc}),i&&this.raise(L.InexactVariance,{at:i}),null):(o||this.raise(L.UnexpectedSpreadType,{at:this.state.lastTokStartLoc}),r!=null&&this.unexpected(r),i&&this.raise(L.SpreadVariance,{at:i}),e.argument=this.flowParseType(),this.finishNode(e,"ObjectTypeSpreadProperty"));{e.key=this.flowParseObjectPropertyKey(),e.static=t,e.proto=r!=null,e.kind=a;let c=!1;return this.match(47)||this.match(10)?(e.method=!0,r!=null&&this.unexpected(r),i&&this.unexpected(i.loc.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start)),(a==="get"||a==="set")&&this.flowCheckGetterSetterParams(e),!o&&e.key.name==="constructor"&&e.value.this&&this.raise(L.ThisParamBannedInConstructor,{at:e.value.this})):(a!=="init"&&this.unexpected(),e.method=!1,this.eat(17)&&(c=!0),e.value=this.flowParseTypeInitialiser(),e.variance=i),e.optional=c,this.finishNode(e,"ObjectTypeProperty")}}flowCheckGetterSetterParams(e){let t=e.kind==="get"?0:1,r=e.value.params.length+(e.value.rest?1:0);e.value.this&&this.raise(e.kind==="get"?L.GetterMayNotHaveThisParam:L.SetterMayNotHaveThisParam,{at:e.value.this}),r!==t&&this.raise(e.kind==="get"?b.BadGetterArity:b.BadSetterArity,{at:e}),e.kind==="set"&&e.value.rest&&this.raise(b.BadSetterRestParameter,{at:e})}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,t){var r;(r=e)!=null||(e=this.state.startLoc);let i=t||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){let a=this.startNodeAt(e);a.qualification=i,a.id=this.flowParseRestrictedIdentifier(!0),i=this.finishNode(a,"QualifiedTypeIdentifier")}return i}flowParseGenericType(e,t){let r=this.startNodeAt(e);return r.typeParameters=null,r.id=this.flowParseQualifiedTypeIdentifier(e,t),this.match(47)&&(r.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(r,"GenericTypeAnnotation")}flowParseTypeofType(){let e=this.startNode();return this.expect(87),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")}flowParseTupleType(){let e=this.startNode();for(e.types=[],this.expect(0);this.state.pos<this.length&&!this.match(3)&&(e.types.push(this.flowParseType()),!this.match(3));)this.expect(12);return this.expect(3),this.finishNode(e,"TupleTypeAnnotation")}flowParseFunctionTypeParam(e){let t=null,r=!1,i=null,a=this.startNode(),o=this.lookahead(),l=this.state.type===78;return o.type===14||o.type===17?(l&&!e&&this.raise(L.ThisParamMustBeFirst,{at:a}),t=this.parseIdentifier(l),this.eat(17)&&(r=!0,l&&this.raise(L.ThisParamMayNotBeOptional,{at:a})),i=this.flowParseTypeInitialiser()):i=this.flowParseType(),a.name=t,a.optional=r,a.typeAnnotation=i,this.finishNode(a,"FunctionTypeParam")}reinterpretTypeAsFunctionTypeParam(e){let t=this.startNodeAt(e.loc.start);return t.name=null,t.optional=!1,t.typeAnnotation=e,this.finishNode(t,"FunctionTypeParam")}flowParseFunctionTypeParams(e=[]){let t=null,r=null;for(this.match(78)&&(r=this.flowParseFunctionTypeParam(!0),r.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(t=this.flowParseFunctionTypeParam(!1)),{params:e,rest:t,_this:r}}flowIdentToTypeAnnotation(e,t,r){switch(r.name){case"any":return this.finishNode(t,"AnyTypeAnnotation");case"bool":case"boolean":return this.finishNode(t,"BooleanTypeAnnotation");case"mixed":return this.finishNode(t,"MixedTypeAnnotation");case"empty":return this.finishNode(t,"EmptyTypeAnnotation");case"number":return this.finishNode(t,"NumberTypeAnnotation");case"string":return this.finishNode(t,"StringTypeAnnotation");case"symbol":return this.finishNode(t,"SymbolTypeAnnotation");default:return this.checkNotUnderscore(r.name),this.flowParseGenericType(e,r)}}flowParsePrimaryType(){let e=this.state.startLoc,t=this.startNode(),r,i,a=!1,o=this.state.noAnonFunctionType;switch(this.state.type){case 5:return this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!0,allowProto:!1,allowInexact:!0});case 6:return this.flowParseObjectType({allowStatic:!1,allowExact:!0,allowSpread:!0,allowProto:!1,allowInexact:!1});case 0:return this.state.noAnonFunctionType=!1,i=this.flowParseTupleType(),this.state.noAnonFunctionType=o,i;case 47:return t.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(10),r=this.flowParseFunctionTypeParams(),t.params=r.params,t.rest=r.rest,t.this=r._this,this.expect(11),this.expect(19),t.returnType=this.flowParseType(),this.finishNode(t,"FunctionTypeAnnotation");case 10:if(this.next(),!this.match(11)&&!this.match(21))if(R(this.state.type)||this.match(78)){let l=this.lookahead().type;a=l!==17&&l!==14}else a=!0;if(a){if(this.state.noAnonFunctionType=!1,i=this.flowParseType(),this.state.noAnonFunctionType=o,this.state.noAnonFunctionType||!(this.match(12)||this.match(11)&&this.lookahead().type===19))return this.expect(11),i;this.eat(12)}return i?r=this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(i)]):r=this.flowParseFunctionTypeParams(),t.params=r.params,t.rest=r.rest,t.this=r._this,this.expect(11),this.expect(19),t.returnType=this.flowParseType(),t.typeParameters=null,this.finishNode(t,"FunctionTypeAnnotation");case 133:return this.parseLiteral(this.state.value,"StringLiteralTypeAnnotation");case 85:case 86:return t.value=this.match(85),this.next(),this.finishNode(t,"BooleanLiteralTypeAnnotation");case 53:if(this.state.value==="-"){if(this.next(),this.match(134))return this.parseLiteralAtNode(-this.state.value,"NumberLiteralTypeAnnotation",t);if(this.match(135))return this.parseLiteralAtNode(-this.state.value,"BigIntLiteralTypeAnnotation",t);throw this.raise(L.UnexpectedSubtractionOperand,{at:this.state.startLoc})}this.unexpected();return;case 134:return this.parseLiteral(this.state.value,"NumberLiteralTypeAnnotation");case 135:return this.parseLiteral(this.state.value,"BigIntLiteralTypeAnnotation");case 88:return this.next(),this.finishNode(t,"VoidTypeAnnotation");case 84:return this.next(),this.finishNode(t,"NullLiteralTypeAnnotation");case 78:return this.next(),this.finishNode(t,"ThisTypeAnnotation");case 55:return this.next(),this.finishNode(t,"ExistsTypeAnnotation");case 87:return this.flowParseTypeofType();default:if(jr(this.state.type)){let l=qe(this.state.type);return this.next(),super.createIdentifier(t,l)}else if(R(this.state.type))return this.isContextual(129)?this.flowParseInterfaceType():this.flowIdentToTypeAnnotation(e,t,this.parseIdentifier())}this.unexpected()}flowParsePostfixType(){let e=this.state.startLoc,t=this.flowParsePrimaryType(),r=!1;for(;(this.match(0)||this.match(18))&&!this.canInsertSemicolon();){let i=this.startNodeAt(e),a=this.eat(18);r=r||a,this.expect(0),!a&&this.match(3)?(i.elementType=t,this.next(),t=this.finishNode(i,"ArrayTypeAnnotation")):(i.objectType=t,i.indexType=this.flowParseType(),this.expect(3),r?(i.optional=a,t=this.finishNode(i,"OptionalIndexedAccessType")):t=this.finishNode(i,"IndexedAccessType"))}return t}flowParsePrefixType(){let e=this.startNode();return this.eat(17)?(e.typeAnnotation=this.flowParsePrefixType(),this.finishNode(e,"NullableTypeAnnotation")):this.flowParsePostfixType()}flowParseAnonFunctionWithoutParens(){let e=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(19)){let t=this.startNodeAt(e.loc.start);return t.params=[this.reinterpretTypeAsFunctionTypeParam(e)],t.rest=null,t.this=null,t.returnType=this.flowParseType(),t.typeParameters=null,this.finishNode(t,"FunctionTypeAnnotation")}return e}flowParseIntersectionType(){let e=this.startNode();this.eat(45);let t=this.flowParseAnonFunctionWithoutParens();for(e.types=[t];this.eat(45);)e.types.push(this.flowParseAnonFunctionWithoutParens());return e.types.length===1?t:this.finishNode(e,"IntersectionTypeAnnotation")}flowParseUnionType(){let e=this.startNode();this.eat(43);let t=this.flowParseIntersectionType();for(e.types=[t];this.eat(43);)e.types.push(this.flowParseIntersectionType());return e.types.length===1?t:this.finishNode(e,"UnionTypeAnnotation")}flowParseType(){let e=this.state.inType;this.state.inType=!0;let t=this.flowParseUnionType();return this.state.inType=e,t}flowParseTypeOrImplicitInstantiation(){if(this.state.type===132&&this.state.value==="_"){let e=this.state.startLoc,t=this.parseIdentifier();return this.flowParseGenericType(e,t)}else return this.flowParseType()}flowParseTypeAnnotation(){let e=this.startNode();return e.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(e,"TypeAnnotation")}flowParseTypeAnnotatableIdentifier(e){let t=e?this.parseIdentifier():this.flowParseRestrictedIdentifier();return this.match(14)&&(t.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(t)),t}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocation(e.expression,e.typeAnnotation.loc.end),e.expression}flowParseVariance(){let e=null;return this.match(53)?(e=this.startNode(),this.state.value==="+"?e.kind="plus":e.kind="minus",this.next(),this.finishNode(e,"Variance")):e}parseFunctionBody(e,t,r=!1){if(t){this.forwardNoArrowParamsConversionAt(e,()=>super.parseFunctionBody(e,!0,r));return}super.parseFunctionBody(e,!1,r)}parseFunctionBodyAndFinish(e,t,r=!1){if(this.match(14)){let i=this.startNode();[i.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),e.returnType=i.typeAnnotation?this.finishNode(i,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(e,t,r)}parseStatementLike(e){if(this.state.strict&&this.isContextual(129)){let r=this.lookahead();if(xe(r.type)){let i=this.startNode();return this.next(),this.flowParseInterface(i)}}else if(this.shouldParseEnums()&&this.isContextual(126)){let r=this.startNode();return this.next(),this.flowParseEnumDeclaration(r)}let t=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(t)&&(this.flowPragma=null),t}parseExpressionStatement(e,t,r){if(t.type==="Identifier"){if(t.name==="declare"){if(this.match(80)||R(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(e)}else if(R(this.state.type)){if(t.name==="interface")return this.flowParseInterface(e);if(t.name==="type")return this.flowParseTypeAlias(e);if(t.name==="opaque")return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,t,r)}shouldParseExportDeclaration(){let{type:e}=this.state;return Ks(e)||this.shouldParseEnums()&&e===126?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return Ks(e)||this.shouldParseEnums()&&e===126?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.shouldParseEnums()&&this.isContextual(126)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,t,r){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){let h=this.lookaheadCharCode();if(h===44||h===61||h===58||h===41)return this.setOptionalParametersError(r),e}this.expect(17);let i=this.state.clone(),a=this.state.noArrowAt,o=this.startNodeAt(t),{consequent:l,failed:c}=this.tryParseConditionalConsequent(),[p,u]=this.getArrowLikeExpressions(l);if(c||u.length>0){let h=[...a];if(u.length>0){this.state=i,this.state.noArrowAt=h;for(let m=0;m<u.length;m++)h.push(u[m].start);({consequent:l,failed:c}=this.tryParseConditionalConsequent()),[p,u]=this.getArrowLikeExpressions(l)}c&&p.length>1&&this.raise(L.AmbiguousConditionalArrow,{at:i.startLoc}),c&&p.length===1&&(this.state=i,h.push(p[0].start),this.state.noArrowAt=h,{consequent:l,failed:c}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(l,!0),this.state.noArrowAt=a,this.expect(14),o.test=e,o.consequent=l,o.alternate=this.forwardNoArrowParamsConversionAt(o,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(o,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let e=this.parseMaybeAssignAllowIn(),t=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:t}}getArrowLikeExpressions(e,t){let r=[e],i=[];for(;r.length!==0;){let a=r.pop();a.type==="ArrowFunctionExpression"?(a.typeParameters||!a.returnType?this.finishArrowValidation(a):i.push(a),r.push(a.body)):a.type==="ConditionalExpression"&&(r.push(a.consequent),r.push(a.alternate))}return t?(i.forEach(a=>this.finishArrowValidation(a)),[i,[]]):dl(i,a=>a.params.every(o=>this.isAssignable(o,!0)))}finishArrowValidation(e){var t;this.toAssignableList(e.params,(t=e.extra)==null?void 0:t.trailingCommaLoc,!1),this.scope.enter(6),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,t){let r;return this.state.noArrowParamsConversionAt.indexOf(e.start)!==-1?(this.state.noArrowParamsConversionAt.push(this.state.start),r=t(),this.state.noArrowParamsConversionAt.pop()):r=t(),r}parseParenItem(e,t){if(e=super.parseParenItem(e,t),this.eat(17)&&(e.optional=!0,this.resetEndLocation(e)),this.match(14)){let r=this.startNodeAt(t);return r.expression=e,r.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(r,"TypeCastExpression")}return e}assertModuleNodeAllowed(e){e.type==="ImportDeclaration"&&(e.importKind==="type"||e.importKind==="typeof")||e.type==="ExportNamedDeclaration"&&e.exportKind==="type"||e.type==="ExportAllDeclaration"&&e.exportKind==="type"||super.assertModuleNodeAllowed(e)}parseExportDeclaration(e){if(this.isContextual(130)){e.exportKind="type";let t=this.startNode();return this.next(),this.match(5)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(t)}else if(this.isContextual(131)){e.exportKind="type";let t=this.startNode();return this.next(),this.flowParseOpaqueType(t,!1)}else if(this.isContextual(129)){e.exportKind="type";let t=this.startNode();return this.next(),this.flowParseInterface(t)}else if(this.shouldParseEnums()&&this.isContextual(126)){e.exportKind="value";let t=this.startNode();return this.next(),this.flowParseEnumDeclaration(t)}else return super.parseExportDeclaration(e)}eatExportStar(e){return super.eatExportStar(e)?!0:this.isContextual(130)&&this.lookahead().type===55?(e.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(e){let{startLoc:t}=this.state,r=super.maybeParseExportNamespaceSpecifier(e);return r&&e.exportKind==="type"&&this.unexpected(t),r}parseClassId(e,t,r){super.parseClassId(e,t,r),this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,t,r){let{startLoc:i}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(e,t))return;t.declare=!0}super.parseClassMember(e,t,r),t.declare&&(t.type!=="ClassProperty"&&t.type!=="ClassPrivateProperty"&&t.type!=="PropertyDefinition"?this.raise(L.DeclareClassElement,{at:i}):t.value&&this.raise(L.DeclareClassFieldInitializer,{at:t.value}))}isIterator(e){return e==="iterator"||e==="asyncIterator"}readIterator(){let e=super.readWord1(),t="@@"+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(b.InvalidIdentifier,{at:this.state.curPosition(),identifierName:t}),this.finishToken(132,t)}getTokenFromCode(e){let t=this.input.charCodeAt(this.state.pos+1);e===123&&t===124?this.finishOp(6,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?48:47,1):this.state.inType&&e===63?t===46?this.finishOp(18,2):this.finishOp(17,1):Go(e,t,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,t){return e.type==="TypeCastExpression"?this.isAssignable(e.expression,t):super.isAssignable(e,t)}toAssignable(e,t=!1){!t&&e.type==="AssignmentExpression"&&e.left.type==="TypeCastExpression"&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,t)}toAssignableList(e,t,r){for(let i=0;i<e.length;i++){let a=e[i];a?.type==="TypeCastExpression"&&(e[i]=this.typeCastToParameter(a))}super.toAssignableList(e,t,r)}toReferencedList(e,t){for(let i=0;i<e.length;i++){var r;let a=e[i];a&&a.type==="TypeCastExpression"&&!((r=a.extra)!=null&&r.parenthesized)&&(e.length>1||!t)&&this.raise(L.TypeCastInPattern,{at:a.typeAnnotation})}return e}parseArrayLike(e,t,r,i){let a=super.parseArrayLike(e,t,r,i);return t&&!this.state.maybeInArrowParameters&&this.toReferencedList(a.elements),a}isValidLVal(e,t,r){return e==="TypeCastExpression"||super.isValidLVal(e,t,r)}parseClassProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(14)&&super.isNonstaticConstructor(e)}pushClassMethod(e,t,r,i,a,o){if(t.variance&&this.unexpected(t.variance.loc.start),delete t.variance,this.match(47)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,t,r,i,a,o),t.params&&a){let l=t.params;l.length>0&&this.isThisParam(l[0])&&this.raise(L.ThisParamBannedInConstructor,{at:t})}else if(t.type==="MethodDefinition"&&a&&t.value.params){let l=t.value.params;l.length>0&&this.isThisParam(l[0])&&this.raise(L.ThisParamBannedInConstructor,{at:t})}}pushClassPrivateMethod(e,t,r,i){t.variance&&this.unexpected(t.variance.loc.start),delete t.variance,this.match(47)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,t,r,i)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&this.match(47)&&(e.superTypeParameters=this.flowParseTypeParameterInstantiation()),this.isContextual(113)){this.next();let t=e.implements=[];do{let r=this.startNode();r.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?r.typeParameters=this.flowParseTypeParameterInstantiation():r.typeParameters=null,t.push(this.finishNode(r,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);let t=this.getObjectOrClassMethodParams(e);if(t.length>0){let r=t[0];this.isThisParam(r)&&e.kind==="get"?this.raise(L.GetterMayNotHaveThisParam,{at:r}):this.isThisParam(r)&&this.raise(L.SetterMayNotHaveThisParam,{at:r})}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,t,r,i,a,o,l){e.variance&&this.unexpected(e.variance.loc.start),delete e.variance;let c;this.match(47)&&!o&&(c=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());let p=super.parseObjPropValue(e,t,r,i,a,o,l);return c&&((p.value||p).typeParameters=c),p}parseAssignableListItemTypes(e){return this.eat(17)&&(e.type!=="Identifier"&&this.raise(L.PatternIsOptional,{at:e}),this.isThisParam(e)&&this.raise(L.ThisParamMayNotBeOptional,{at:e}),e.optional=!0),this.match(14)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(L.ThisParamAnnotationRequired,{at:e}),this.match(29)&&this.isThisParam(e)&&this.raise(L.ThisParamNoDefault,{at:e}),this.resetEndLocation(e),e}parseMaybeDefault(e,t){let r=super.parseMaybeDefault(e,t);return r.type==="AssignmentPattern"&&r.typeAnnotation&&r.right.start<r.typeAnnotation.start&&this.raise(L.TypeBeforeInitializer,{at:r.typeAnnotation}),r}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(L.ImportReflectionHasImportType,{at:e.specifiers[0].loc.start})}parseImportSpecifierLocal(e,t,r){t.local=Ys(e)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(t,r))}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){if(!e)return!0;let t=this.lookaheadCharCode();return t===123||t===42}return!e&&this.isContextual(87)}applyImportPhase(e,t,r,i){if(super.applyImportPhase(e,t,r,i),t){if(!r&&this.match(65))return;e.exportKind=r==="type"?r:"value"}else r==="type"&&this.match(55)&&this.unexpected(),e.importKind=r==="type"||r==="typeof"?r:"value"}parseImportSpecifier(e,t,r,i,a){let o=e.imported,l=null;o.type==="Identifier"&&(o.name==="type"?l="type":o.name==="typeof"&&(l="typeof"));let c=!1;if(this.isContextual(93)&&!this.isLookaheadContextual("as")){let u=this.parseIdentifier(!0);l!==null&&!xe(this.state.type)?(e.imported=u,e.importKind=l,e.local=Be(u)):(e.imported=o,e.importKind=null,e.local=this.parseIdentifier())}else{if(l!==null&&xe(this.state.type))e.imported=this.parseIdentifier(!0),e.importKind=l;else{if(t)throw this.raise(b.ImportBindingIsString,{at:e,importName:o.value});e.imported=o,e.importKind=null}this.eatContextual(93)?e.local=this.parseIdentifier():(c=!0,e.local=Be(e.imported))}let p=Ys(e);return r&&p&&this.raise(L.ImportTypeShorthandOnlyInPureImport,{at:e}),(r||p)&&this.checkReservedType(e.local.name,e.local.loc.start,!0),c&&!r&&!p&&this.checkReservedWord(e.local.name,e.loc.start,!0,!0),this.finishImportSpecifier(e,"ImportSpecifier")}parseBindingAtom(){switch(this.state.type){case 78:return this.parseIdentifier(!0);default:return super.parseBindingAtom()}}parseFunctionParams(e,t){let r=e.kind;r!=="get"&&r!=="set"&&this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),super.parseFunctionParams(e,t)}parseVarId(e,t){super.parseVarId(e,t),this.match(14)&&(e.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,t){if(this.match(14)){let r=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,e.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=r}return super.parseAsyncArrowFromCallExpression(e,t)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}parseMaybeAssign(e,t){var r;let i=null,a;if(this.hasPlugin("jsx")&&(this.match(142)||this.match(47))){if(i=this.state.clone(),a=this.tryParse(()=>super.parseMaybeAssign(e,t),i),!a.error)return a.node;let{context:c}=this.state,p=c[c.length-1];(p===V.j_oTag||p===V.j_expr)&&c.pop()}if((r=a)!=null&&r.error||this.match(47)){var o,l;i=i||this.state.clone();let c,p=this.tryParse(h=>{var m;c=this.flowParseTypeParameterDeclaration();let d=this.forwardNoArrowParamsConversionAt(c,()=>{let f=super.parseMaybeAssign(e,t);return this.resetStartLocationFromNode(f,c),f});(m=d.extra)!=null&&m.parenthesized&&h();let g=this.maybeUnwrapTypeCastExpression(d);return g.type!=="ArrowFunctionExpression"&&h(),g.typeParameters=c,this.resetStartLocationFromNode(g,c),d},i),u=null;if(p.node&&this.maybeUnwrapTypeCastExpression(p.node).type==="ArrowFunctionExpression"){if(!p.error&&!p.aborted)return p.node.async&&this.raise(L.UnexpectedTypeParameterBeforeAsyncArrowFunction,{at:c}),p.node;u=p.node}if((o=a)!=null&&o.node)return this.state=a.failState,a.node;if(u)return this.state=p.failState,u;throw(l=a)!=null&&l.thrown?a.error:p.thrown?p.error:this.raise(L.UnexpectedTokenAfterTypeParameter,{at:c})}return super.parseMaybeAssign(e,t)}parseArrow(e){if(this.match(14)){let t=this.tryParse(()=>{let r=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let i=this.startNode();return[i.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=r,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),i});if(t.thrown)return null;t.error&&(this.state=t.failState),e.returnType=t.node.typeAnnotation?this.finishNode(t.node,"TypeAnnotation"):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(14)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,t){this.state.noArrowParamsConversionAt.indexOf(e.start)!==-1?e.params=t:super.setArrowFunctionParameters(e,t)}checkParams(e,t,r,i=!0){if(!(r&&this.state.noArrowParamsConversionAt.indexOf(e.start)!==-1)){for(let a=0;a<e.params.length;a++)this.isThisParam(e.params[a])&&a>0&&this.raise(L.ThisParamMustBeFirst,{at:e.params[a]});super.checkParams(e,t,r,i)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&this.state.noArrowAt.indexOf(this.state.start)===-1)}parseSubscripts(e,t,r){if(e.type==="Identifier"&&e.name==="async"&&this.state.noArrowAt.indexOf(t.index)!==-1){this.next();let i=this.startNodeAt(t);i.callee=e,i.arguments=super.parseCallExpressionArguments(11,!1),e=this.finishNode(i,"CallExpression")}else if(e.type==="Identifier"&&e.name==="async"&&this.match(47)){let i=this.state.clone(),a=this.tryParse(l=>this.parseAsyncArrowWithTypeParameters(t)||l(),i);if(!a.error&&!a.aborted)return a.node;let o=this.tryParse(()=>super.parseSubscripts(e,t,r),i);if(o.node&&!o.error)return o.node;if(a.node)return this.state=a.failState,a.node;if(o.node)return this.state=o.failState,o.node;throw a.error||o.error}return super.parseSubscripts(e,t,r)}parseSubscript(e,t,r,i){if(this.match(18)&&this.isLookaheadToken_lt()){if(i.optionalChainMember=!0,r)return i.stop=!0,e;this.next();let a=this.startNodeAt(t);return a.callee=e,a.typeArguments=this.flowParseTypeParameterInstantiation(),this.expect(10),a.arguments=this.parseCallExpressionArguments(11,!1),a.optional=!0,this.finishCallExpression(a,!0)}else if(!r&&this.shouldParseTypes()&&this.match(47)){let a=this.startNodeAt(t);a.callee=e;let o=this.tryParse(()=>(a.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),a.arguments=super.parseCallExpressionArguments(11,!1),i.optionalChainMember&&(a.optional=!1),this.finishCallExpression(a,i.optionalChainMember)));if(o.node)return o.error&&(this.state=o.failState),o.node}return super.parseSubscript(e,t,r,i)}parseNewCallee(e){super.parseNewCallee(e);let t=null;this.shouldParseTypes()&&this.match(47)&&(t=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=t}parseAsyncArrowWithTypeParameters(e){let t=this.startNodeAt(e);if(this.parseFunctionParams(t,!1),!!this.parseArrow(t))return super.parseArrowExpression(t,void 0,!0)}readToken_mult_modulo(e){let t=this.input.charCodeAt(this.state.pos+1);if(e===42&&t===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(e)}readToken_pipe_amp(e){let t=this.input.charCodeAt(this.state.pos+1);if(e===124&&t===125){this.finishOp(9,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,t){let r=super.parseTopLevel(e,t);return this.state.hasFlowComment&&this.raise(L.UnterminatedFlowComment,{at:this.state.curPosition()}),r}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(L.NestedFlowComment,{at:this.state.startLoc});this.hasFlowCommentCompletion();let e=this.skipFlowComment();e&&(this.state.pos+=e,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:e}=this.state,t=2;for(;[32,9].includes(this.input.charCodeAt(e+t));)t++;let r=this.input.charCodeAt(t+e),i=this.input.charCodeAt(t+e+1);return r===58&&i===58?t+2:this.input.slice(t+e,t+e+12)==="flow-include"?t+12:r===58&&i!==58?t:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(b.UnterminatedComment,{at:this.state.curPosition()})}flowEnumErrorBooleanMemberNotInitialized(e,{enumName:t,memberName:r}){this.raise(L.EnumBooleanMemberNotInitialized,{at:e,memberName:r,enumName:t})}flowEnumErrorInvalidMemberInitializer(e,t){return this.raise(t.explicitType?t.explicitType==="symbol"?L.EnumInvalidMemberInitializerSymbolType:L.EnumInvalidMemberInitializerPrimaryType:L.EnumInvalidMemberInitializerUnknownType,Object.assign({at:e},t))}flowEnumErrorNumberMemberNotInitialized(e,{enumName:t,memberName:r}){this.raise(L.EnumNumberMemberNotInitialized,{at:e,enumName:t,memberName:r})}flowEnumErrorStringMemberInconsistentlyInitialized(e,{enumName:t}){this.raise(L.EnumStringMemberInconsistentlyInitialized,{at:e,enumName:t})}flowEnumMemberInit(){let e=this.state.startLoc,t=()=>this.match(12)||this.match(8);switch(this.state.type){case 134:{let r=this.parseNumericLiteral(this.state.value);return t()?{type:"number",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}case 133:{let r=this.parseStringLiteral(this.state.value);return t()?{type:"string",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}case 85:case 86:{let r=this.parseBooleanLiteral(this.match(85));return t()?{type:"boolean",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}default:return{type:"invalid",loc:e}}}flowEnumMemberRaw(){let e=this.state.startLoc,t=this.parseIdentifier(!0),r=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:e};return{id:t,init:r}}flowEnumCheckExplicitTypeMismatch(e,t,r){let{explicitType:i}=t;i!==null&&i!==r&&this.flowEnumErrorInvalidMemberInitializer(e,t)}flowEnumMembers({enumName:e,explicitType:t}){let r=new Set,i={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},a=!1;for(;!this.match(8);){if(this.eat(21)){a=!0;break}let o=this.startNode(),{id:l,init:c}=this.flowEnumMemberRaw(),p=l.name;if(p==="")continue;/^[a-z]/.test(p)&&this.raise(L.EnumInvalidMemberName,{at:l,memberName:p,suggestion:p[0].toUpperCase()+p.slice(1),enumName:e}),r.has(p)&&this.raise(L.EnumDuplicateMemberName,{at:l,memberName:p,enumName:e}),r.add(p);let u={enumName:e,explicitType:t,memberName:p};switch(o.id=l,c.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(c.loc,u,"boolean"),o.init=c.value,i.booleanMembers.push(this.finishNode(o,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(c.loc,u,"number"),o.init=c.value,i.numberMembers.push(this.finishNode(o,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(c.loc,u,"string"),o.init=c.value,i.stringMembers.push(this.finishNode(o,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(c.loc,u);case"none":switch(t){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(c.loc,u);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(c.loc,u);break;default:i.defaultedMembers.push(this.finishNode(o,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:i,hasUnknownMembers:a}}flowEnumStringMembers(e,t,{enumName:r}){if(e.length===0)return t;if(t.length===0)return e;if(t.length>e.length){for(let i of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(i,{enumName:r});return t}else{for(let i of t)this.flowEnumErrorStringMemberInconsistentlyInitialized(i,{enumName:r});return e}}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(102))return null;if(!R(this.state.type))throw this.raise(L.EnumInvalidExplicitTypeUnknownSupplied,{at:this.state.startLoc,enumName:e});let{value:t}=this.state;return this.next(),t!=="boolean"&&t!=="number"&&t!=="string"&&t!=="symbol"&&this.raise(L.EnumInvalidExplicitType,{at:this.state.startLoc,enumName:e,invalidEnumType:t}),t}flowEnumBody(e,t){let r=t.name,i=t.loc.start,a=this.flowEnumParseExplicitType({enumName:r});this.expect(5);let{members:o,hasUnknownMembers:l}=this.flowEnumMembers({enumName:r,explicitType:a});switch(e.hasUnknownMembers=l,a){case"boolean":return e.explicitType=!0,e.members=o.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody");case"number":return e.explicitType=!0,e.members=o.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody");case"string":return e.explicitType=!0,e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:r}),this.expect(8),this.finishNode(e,"EnumStringBody");case"symbol":return e.members=o.defaultedMembers,this.expect(8),this.finishNode(e,"EnumSymbolBody");default:{let c=()=>(e.members=[],this.expect(8),this.finishNode(e,"EnumStringBody"));e.explicitType=!1;let p=o.booleanMembers.length,u=o.numberMembers.length,h=o.stringMembers.length,m=o.defaultedMembers.length;if(!p&&!u&&!h&&!m)return c();if(!p&&!u)return e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:r}),this.expect(8),this.finishNode(e,"EnumStringBody");if(!u&&!h&&p>=m){for(let d of o.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(d.loc.start,{enumName:r,memberName:d.id.name});return e.members=o.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody")}else if(!p&&!h&&u>=m){for(let d of o.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(d.loc.start,{enumName:r,memberName:d.id.name});return e.members=o.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody")}else return this.raise(L.EnumInconsistentMemberValues,{at:i,enumName:r}),c()}}}flowParseEnumDeclaration(e){let t=this.parseIdentifier();return e.id=t,e.body=this.flowEnumBody(this.startNode(),t),this.finishNode(e,"EnumDeclaration")}isLookaheadToken_lt(){let e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){let t=this.input.charCodeAt(e+1);return t!==60&&t!==61}return!1}maybeUnwrapTypeCastExpression(e){return e.type==="TypeCastExpression"?e.expression:e}},ml={__proto__:null,quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"},Xe=_e`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:s})=>`Expected corresponding JSX closing tag for <${s}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:s,HTMLEntity:n})=>`Unexpected token \`${s}\`. Did you mean \`${n}\` or \`{'${s}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"});function ze(s){return s?s.type==="JSXOpeningFragment"||s.type==="JSXClosingFragment":!1}function ot(s){if(s.type==="JSXIdentifier")return s.name;if(s.type==="JSXNamespacedName")return s.namespace.name+":"+s.name.name;if(s.type==="JSXMemberExpression")return ot(s.object)+"."+ot(s.property);throw new Error("Node had unexpected type: "+s.type)}var bl=s=>class extends s{jsxReadToken(){let e="",t=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(Xe.UnterminatedJsxContent,{at:this.state.startLoc});let r=this.input.charCodeAt(this.state.pos);switch(r){case 60:case 123:if(this.state.pos===this.state.start){r===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(142)):super.getTokenFromCode(r);return}e+=this.input.slice(t,this.state.pos),this.finishToken(141,e);return;case 38:e+=this.input.slice(t,this.state.pos),e+=this.jsxReadEntity(),t=this.state.pos;break;case 62:case 125:default:Ot(r)?(e+=this.input.slice(t,this.state.pos),e+=this.jsxReadNewLine(!0),t=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){let t=this.input.charCodeAt(this.state.pos),r;return++this.state.pos,t===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,r=e?`
|
|
7
7
|
`:`\r
|
|
8
|
-
`):r=String.fromCharCode(t),++this.state.curLine,this.state.lineStart=this.state.pos,r}jsxReadString(e){let t="",r=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(b.UnterminatedString,{at:this.state.startLoc});let i=this.input.charCodeAt(this.state.pos);if(i===e)break;i===38?(t+=this.input.slice(r,this.state.pos),t+=this.jsxReadEntity(),r=this.state.pos):Ot(i)?(t+=this.input.slice(r,this.state.pos),t+=this.jsxReadNewLine(!1),r=this.state.pos):++this.state.pos}t+=this.input.slice(r,this.state.pos++),this.finishToken(133,t)}jsxReadEntity(){let e=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let t=10;this.codePointAtPos(this.state.pos)===120&&(t=16,++this.state.pos);let r=this.readInt(t,void 0,!1,"bail");if(r!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(r)}else{let t=0,r=!1;for(;t++<10&&this.state.pos<this.length&&!(r=this.codePointAtPos(this.state.pos)==59);)++this.state.pos;if(r){let i=this.input.slice(e,this.state.pos),a=ml[i];if(++this.state.pos,a)return a}}return this.state.pos=e,"&"}jsxReadWord(){let e,t=this.state.pos;do e=this.input.charCodeAt(++this.state.pos);while(lt(e)||e===45);this.finishToken(140,this.input.slice(t,this.state.pos))}jsxParseIdentifier(){let e=this.startNode();return this.match(140)?e.name=this.state.value:jr(this.state.type)?e.name=qe(this.state.type):this.unexpected(),this.next(),this.finishNode(e,"JSXIdentifier")}jsxParseNamespacedName(){let e=this.state.startLoc,t=this.jsxParseIdentifier();if(!this.eat(14))return t;let r=this.startNodeAt(e);return r.namespace=t,r.name=this.jsxParseIdentifier(),this.finishNode(r,"JSXNamespacedName")}jsxParseElementName(){let e=this.state.startLoc,t=this.jsxParseNamespacedName();if(t.type==="JSXNamespacedName")return t;for(;this.eat(16);){let r=this.startNodeAt(e);r.object=t,r.property=this.jsxParseIdentifier(),t=this.finishNode(r,"JSXMemberExpression")}return t}jsxParseAttributeValue(){let e;switch(this.state.type){case 5:return e=this.startNode(),this.setContext(V.brace),this.next(),e=this.jsxParseExpressionContainer(e,V.j_oTag),e.expression.type==="JSXEmptyExpression"&&this.raise(Xe.AttributeIsEmpty,{at:e}),e;case 142:case 133:return this.parseExprAtom();default:throw this.raise(Xe.UnsupportedJsxValue,{at:this.state.startLoc})}}jsxParseEmptyExpression(){let e=this.startNodeAt(this.state.lastTokEndLoc);return this.finishNodeAt(e,"JSXEmptyExpression",this.state.startLoc)}jsxParseSpreadChild(e){return this.next(),e.expression=this.parseExpression(),this.setContext(V.j_expr),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXSpreadChild")}jsxParseExpressionContainer(e,t){if(this.match(8))e.expression=this.jsxParseEmptyExpression();else{let r=this.parseExpression();e.expression=r}return this.setContext(t),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXExpressionContainer")}jsxParseAttribute(){let e=this.startNode();return this.match(5)?(this.setContext(V.brace),this.next(),this.expect(21),e.argument=this.parseMaybeAssignAllowIn(),this.setContext(V.j_oTag),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXSpreadAttribute")):(e.name=this.jsxParseNamespacedName(),e.value=this.eat(29)?this.jsxParseAttributeValue():null,this.finishNode(e,"JSXAttribute"))}jsxParseOpeningElementAt(e){let t=this.startNodeAt(e);return this.eat(143)?this.finishNode(t,"JSXOpeningFragment"):(t.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(t))}jsxParseOpeningElementAfterName(e){let t=[];for(;!this.match(56)&&!this.match(143);)t.push(this.jsxParseAttribute());return e.attributes=t,e.selfClosing=this.eat(56),this.expect(143),this.finishNode(e,"JSXOpeningElement")}jsxParseClosingElementAt(e){let t=this.startNodeAt(e);return this.eat(143)?this.finishNode(t,"JSXClosingFragment"):(t.name=this.jsxParseElementName(),this.expect(143),this.finishNode(t,"JSXClosingElement"))}jsxParseElementAt(e){let t=this.startNodeAt(e),r=[],i=this.jsxParseOpeningElementAt(e),a=null;if(!i.selfClosing){e:for(;;)switch(this.state.type){case 142:if(e=this.state.startLoc,this.next(),this.eat(56)){a=this.jsxParseClosingElementAt(e);break e}r.push(this.jsxParseElementAt(e));break;case 141:r.push(this.parseExprAtom());break;case 5:{let o=this.startNode();this.setContext(V.brace),this.next(),this.match(21)?r.push(this.jsxParseSpreadChild(o)):r.push(this.jsxParseExpressionContainer(o,V.j_expr));break}default:this.unexpected()}ze(i)&&!ze(a)&&a!==null?this.raise(Xe.MissingClosingTagFragment,{at:a}):!ze(i)&&ze(a)?this.raise(Xe.MissingClosingTagElement,{at:a,openingTagName:ot(i.name)}):!ze(i)&&!ze(a)&&ot(a.name)!==ot(i.name)&&this.raise(Xe.MissingClosingTagElement,{at:a,openingTagName:ot(i.name)})}if(ze(i)?(t.openingFragment=i,t.closingFragment=a):(t.openingElement=i,t.closingElement=a),t.children=r,this.match(47))throw this.raise(Xe.UnwrappedAdjacentJSXElements,{at:this.state.startLoc});return ze(i)?this.finishNode(t,"JSXFragment"):this.finishNode(t,"JSXElement")}jsxParseElement(){let e=this.state.startLoc;return this.next(),this.jsxParseElementAt(e)}setContext(e){let{context:t}=this.state;t[t.length-1]=e}parseExprAtom(e){return this.match(141)?this.parseLiteral(this.state.value,"JSXText"):this.match(142)?this.jsxParseElement():this.match(47)&&this.input.charCodeAt(this.state.pos)!==33?(this.replaceToken(142),this.jsxParseElement()):super.parseExprAtom(e)}skipSpace(){this.curContext().preserveSpace||super.skipSpace()}getTokenFromCode(e){let t=this.curContext();if(t===V.j_expr){this.jsxReadToken();return}if(t===V.j_oTag||t===V.j_cTag){if(_e(e)){this.jsxReadWord();return}if(e===62){++this.state.pos,this.finishToken(143);return}if((e===34||e===39)&&t===V.j_oTag){this.jsxReadString(e);return}}if(e===60&&this.state.canStartJSXElement&&this.input.charCodeAt(this.state.pos+1)!==33){++this.state.pos,this.finishToken(142);return}super.getTokenFromCode(e)}updateContext(e){let{context:t,type:r}=this.state;if(r===56&&e===142)t.splice(-2,2,V.j_cTag),this.state.canStartJSXElement=!1;else if(r===142)t.push(V.j_oTag);else if(r===143){let i=t[t.length-1];i===V.j_oTag&&e===56||i===V.j_cTag?(t.pop(),this.state.canStartJSXElement=t[t.length-1]===V.j_expr):(this.setContext(V.j_expr),this.state.canStartJSXElement=!0)}else this.state.canStartJSXElement=Mo(r)}},kr=class extends Ft{constructor(...n){super(...n),this.types=new Set,this.enums=new Set,this.constEnums=new Set,this.classes=new Set,this.exportOnlyBindings=new Set}},Nr=class extends _t{constructor(...n){super(...n),this.importsStack=[]}createScope(n){return this.importsStack.push(new Set),new kr(n)}enter(n){n==256&&this.importsStack.push(new Set),super.enter(n)}exit(){let n=super.exit();return n==256&&this.importsStack.pop(),n}hasImport(n,e){let t=this.importsStack.length;if(this.importsStack[t-1].has(n))return!0;if(!e&&t>1){for(let r=0;r<t-1;r++)if(this.importsStack[r].has(n))return!0}return!1}declareName(n,e,t){if(e&4096){this.hasImport(n,!0)&&this.parser.raise(b.VarRedeclaration,{at:t,identifierName:n}),this.importsStack[this.importsStack.length-1].add(n);return}let r=this.currentScope();if(e&1024){this.maybeExportDefined(r,n),r.exportOnlyBindings.add(n);return}super.declareName(n,e,t),e&2&&(e&1||(this.checkRedeclarationInScope(r,n,e,t),this.maybeExportDefined(r,n)),r.types.add(n)),e&256&&r.enums.add(n),e&512&&r.constEnums.add(n),e&128&&r.classes.add(n)}isRedeclaredInScope(n,e,t){if(n.enums.has(e)){if(t&256){let r=!!(t&512),i=n.constEnums.has(e);return r!==i}return!0}return t&128&&n.classes.has(e)?n.lexical.has(e)?!!(t&1):!1:t&2&&n.types.has(e)?!0:super.isRedeclaredInScope(n,e,t)}checkLocalExport(n){let{name:e}=n;if(this.hasImport(e))return;let t=this.scopeStack.length;for(let r=t-1;r>=0;r--){let i=this.scopeStack[r];if(i.types.has(e)||i.exportOnlyBindings.has(e))return}super.checkLocalExport(n)}},yl=(s,n)=>Object.hasOwnProperty.call(s,n)&&s[n],gi=s=>s.type==="ParenthesizedExpression"?gi(s.expression):s,Mr=class extends Ar{toAssignable(n,e=!1){var t,r;let i;switch((n.type==="ParenthesizedExpression"||(t=n.extra)!=null&&t.parenthesized)&&(i=gi(n),e?i.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(b.InvalidParenthesizedAssignment,{at:n}):i.type!=="MemberExpression"&&!this.isOptionalMemberExpression(i)&&this.raise(b.InvalidParenthesizedAssignment,{at:n}):this.raise(b.InvalidParenthesizedAssignment,{at:n})),n.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":n.type="ObjectPattern";for(let o=0,l=n.properties.length,c=l-1;o<l;o++){var a;let p=n.properties[o],u=o===c;this.toAssignableObjectExpressionProp(p,u,e),u&&p.type==="RestElement"&&(a=n.extra)!=null&&a.trailingCommaLoc&&this.raise(b.RestTrailingComma,{at:n.extra.trailingCommaLoc})}break;case"ObjectProperty":{let{key:o,value:l}=n;this.isPrivateName(o)&&this.classScope.usePrivateName(this.getPrivateNameSV(o),o.loc.start),this.toAssignable(l,e);break}case"SpreadElement":throw new Error("Internal @babel/parser error (this is a bug, please report it). SpreadElement should be converted by .toAssignable's caller.");case"ArrayExpression":n.type="ArrayPattern",this.toAssignableList(n.elements,(r=n.extra)==null?void 0:r.trailingCommaLoc,e);break;case"AssignmentExpression":n.operator!=="="&&this.raise(b.MissingEqInAssignment,{at:n.left.loc.end}),n.type="AssignmentPattern",delete n.operator,this.toAssignable(n.left,e);break;case"ParenthesizedExpression":this.toAssignable(i,e);break}}toAssignableObjectExpressionProp(n,e,t){if(n.type==="ObjectMethod")this.raise(n.kind==="get"||n.kind==="set"?b.PatternHasAccessor:b.PatternHasMethod,{at:n.key});else if(n.type==="SpreadElement"){n.type="RestElement";let r=n.argument;this.checkToRestConversion(r,!1),this.toAssignable(r,t),e||this.raise(b.RestTrailingComma,{at:n})}else this.toAssignable(n,t)}toAssignableList(n,e,t){let r=n.length-1;for(let i=0;i<=r;i++){let a=n[i];if(a){if(a.type==="SpreadElement"){a.type="RestElement";let o=a.argument;this.checkToRestConversion(o,!0),this.toAssignable(o,t)}else this.toAssignable(a,t);a.type==="RestElement"&&(i<r?this.raise(b.RestTrailingComma,{at:a}):e&&this.raise(b.RestTrailingComma,{at:e}))}}}isAssignable(n,e){switch(n.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":return!0;case"ObjectExpression":{let t=n.properties.length-1;return n.properties.every((r,i)=>r.type!=="ObjectMethod"&&(i===t||r.type!=="SpreadElement")&&this.isAssignable(r))}case"ObjectProperty":return this.isAssignable(n.value);case"SpreadElement":return this.isAssignable(n.argument);case"ArrayExpression":return n.elements.every(t=>t===null||this.isAssignable(t));case"AssignmentExpression":return n.operator==="=";case"ParenthesizedExpression":return this.isAssignable(n.expression);case"MemberExpression":case"OptionalMemberExpression":return!e;default:return!1}}toReferencedList(n,e){return n}toReferencedListDeep(n,e){this.toReferencedList(n,e);for(let t of n)t?.type==="ArrayExpression"&&this.toReferencedListDeep(t.elements)}parseSpread(n){let e=this.startNode();return this.next(),e.argument=this.parseMaybeAssignAllowIn(n,void 0),this.finishNode(e,"SpreadElement")}parseRestBinding(){let n=this.startNode();return this.next(),n.argument=this.parseBindingAtom(),this.finishNode(n,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{let n=this.startNode();return this.next(),n.elements=this.parseBindingList(3,93,1),this.finishNode(n,"ArrayPattern")}case 5:return this.parseObjectLike(8,!0)}return this.parseIdentifier()}parseBindingList(n,e,t){let r=t&1,i=[],a=!0;for(;!this.eat(n);)if(a?a=!1:this.expect(12),r&&this.match(12))i.push(null);else{if(this.eat(n))break;if(this.match(21)){if(i.push(this.parseAssignableListItemTypes(this.parseRestBinding(),t)),!this.checkCommaAfterRest(e)){this.expect(n);break}}else{let o=[];for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(b.UnsupportedParameterDecorator,{at:this.state.startLoc});this.match(26);)o.push(this.parseDecorator());i.push(this.parseAssignableListItem(t,o))}}return i}parseBindingRestProperty(n){return this.next(),n.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(n,"RestElement")}parseBindingProperty(){let n=this.startNode(),{type:e,startLoc:t}=this.state;return e===21?this.parseBindingRestProperty(n):(e===138?(this.expectPlugin("destructuringPrivate",t),this.classScope.usePrivateName(this.state.value,t),n.key=this.parsePrivateName()):this.parsePropertyName(n),n.method=!1,this.parseObjPropValue(n,t,!1,!1,!0,!1))}parseAssignableListItem(n,e){let t=this.parseMaybeDefault();this.parseAssignableListItemTypes(t,n);let r=this.parseMaybeDefault(t.loc.start,t);return e.length&&(t.decorators=e),r}parseAssignableListItemTypes(n,e){return n}parseMaybeDefault(n,e){var t,r;if((t=n)!=null||(n=this.state.startLoc),e=(r=e)!=null?r:this.parseBindingAtom(),!this.eat(29))return e;let i=this.startNodeAt(n);return i.left=e,i.right=this.parseMaybeAssignAllowIn(),this.finishNode(i,"AssignmentPattern")}isValidLVal(n,e,t){return yl({AssignmentPattern:"left",RestElement:"argument",ObjectProperty:"value",ParenthesizedExpression:"expression",ArrayPattern:"elements",ObjectPattern:"properties"},n)}isOptionalMemberExpression(n){return n.type==="OptionalMemberExpression"}checkLVal(n,{in:e,binding:t=64,checkClashes:r=!1,strictModeChanged:i=!1,hasParenthesizedAncestor:a=!1}){var o;let l=n.type;if(this.isObjectMethod(n))return;let c=this.isOptionalMemberExpression(n);if(c||l==="MemberExpression"){c&&(this.expectPlugin("optionalChainingAssign",n.loc.start),e.type!=="AssignmentExpression"&&this.raise(b.InvalidLhsOptionalChaining,{at:n,ancestor:e})),t!==64&&this.raise(b.InvalidPropertyBindingPattern,{at:n});return}if(l==="Identifier"){this.checkIdentifier(n,t,i);let{name:d}=n;r&&(r.has(d)?this.raise(b.ParamDupe,{at:n}):r.add(d));return}let p=this.isValidLVal(l,!(a||(o=n.extra)!=null&&o.parenthesized)&&e.type==="AssignmentExpression",t);if(p===!0)return;if(p===!1){let d=t===64?b.InvalidLhs:b.InvalidLhsBinding;this.raise(d,{at:n,ancestor:e});return}let[u,h]=Array.isArray(p)?p:[p,l==="ParenthesizedExpression"],m=l==="ArrayPattern"||l==="ObjectPattern"?{type:l}:e;for(let d of[].concat(n[u]))d&&this.checkLVal(d,{in:m,binding:t,checkClashes:r,strictModeChanged:i,hasParenthesizedAncestor:h})}checkIdentifier(n,e,t=!1){this.state.strict&&(t?di(n.name,this.inModule):ui(n.name))&&(e===64?this.raise(b.StrictEvalArguments,{at:n,referenceName:n.name}):this.raise(b.StrictEvalArgumentsBinding,{at:n,bindingName:n.name})),e&8192&&n.name==="let"&&this.raise(b.LetInLexicalBinding,{at:n}),e&64||this.declareNameFromIdentifier(n,e)}declareNameFromIdentifier(n,e){this.scope.declareName(n.name,e,n.loc.start)}checkToRestConversion(n,e){switch(n.type){case"ParenthesizedExpression":this.checkToRestConversion(n.expression,e);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(e)break;default:this.raise(b.InvalidRestAssignmentPattern,{at:n})}}checkCommaAfterRest(n){return this.match(12)?(this.raise(this.lookaheadCharCode()===n?b.RestTrailingComma:b.ElementAfterRest,{at:this.state.startLoc}),!0):!1}},gl=(s,n)=>Object.hasOwnProperty.call(s,n)&&s[n];function vl(s){if(s==null)throw new Error(`Unexpected ${s} value.`);return s}function Zs(s){if(!s)throw new Error("Assert fail")}var k=Ue`typescript`({AbstractMethodHasImplementation:({methodName:s})=>`Method '${s}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:s})=>`Property '${s}' cannot have an initializer because it is marked abstract.`,AccesorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccesorCannotHaveTypeParameters:"An accessor cannot have type parameters.",AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:s})=>`'declare' is not allowed in ${s}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:({modifier:s})=>"Accessibility modifier already seen.",DuplicateModifier:({modifier:s})=>`Duplicate modifier: '${s}'.`,EmptyHeritageClauseType:({token:s})=>`'${s}' list cannot be empty.`,EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` modifier",IncompatibleModifiers:({modifiers:s})=>`'${s[0]}' modifier cannot be used with '${s[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:s})=>`Index signatures cannot have an accessibility modifier ('${s}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidModifierOnTypeMember:({modifier:s})=>`'${s}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:s})=>`'${s}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:s})=>`'${s}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:s})=>`'${s[0]}' modifier must precede '${s[1]}' modifier.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifer:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:s})=>`Private elements cannot have an accessibility modifier ('${s}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccesorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccesorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccesorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:s})=>`Single type parameter ${s} should have a trailing comma. Example usage: <${s},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:s})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${s}.`});function xl(s){switch(s){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}function ei(s){return s==="private"||s==="public"||s==="protected"}function Pl(s){return s==="in"||s==="out"}var Tl=s=>class extends s{constructor(...e){super(...e),this.tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:k.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:k.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:k.InvalidModifierOnTypeParameter})}getScopeHandler(){return Nr}tsIsIdentifier(){return R(this.state.type)}tsTokenCanFollowModifier(){return(this.match(0)||this.match(5)||this.match(55)||this.match(21)||this.match(138)||this.isLiteralPropertyName())&&!this.hasPrecedingLineBreak()}tsNextTokenCanFollowModifier(){return this.next(),this.tsTokenCanFollowModifier()}tsParseModifier(e,t){if(!R(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;let r=this.state.value;if(e.indexOf(r)!==-1){if(t&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return r}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:t,stopOnStartOfClassStaticBlock:r,errorTemplate:i=k.InvalidModifierOnTypeMember},a){let o=(c,p,u,h)=>{p===u&&a[h]&&this.raise(k.InvalidModifiersOrder,{at:c,orderedModifiers:[u,h]})},l=(c,p,u,h)=>{(a[u]&&p===h||a[h]&&p===u)&&this.raise(k.IncompatibleModifiers,{at:c,modifiers:[u,h]})};for(;;){let{startLoc:c}=this.state,p=this.tsParseModifier(e.concat(t??[]),r);if(!p)break;ei(p)?a.accessibility?this.raise(k.DuplicateAccessibilityModifier,{at:c,modifier:p}):(o(c,p,p,"override"),o(c,p,p,"static"),o(c,p,p,"readonly"),a.accessibility=p):Pl(p)?(a[p]&&this.raise(k.DuplicateModifier,{at:c,modifier:p}),a[p]=!0,o(c,p,"in","out")):(Object.hasOwnProperty.call(a,p)?this.raise(k.DuplicateModifier,{at:c,modifier:p}):(o(c,p,"static","readonly"),o(c,p,"static","override"),o(c,p,"override","readonly"),o(c,p,"abstract","override"),l(c,p,"declare","override"),l(c,p,"static","abstract")),a[p]=!0),t!=null&&t.includes(p)&&this.raise(i,{at:c,modifier:p})}}tsIsListTerminator(e){switch(e){case"EnumMembers":case"TypeMembers":return this.match(8);case"HeritageClauseElement":return this.match(5);case"TupleElementTypes":return this.match(3);case"TypeParametersOrArguments":return this.match(48)}}tsParseList(e,t){let r=[];for(;!this.tsIsListTerminator(e);)r.push(t());return r}tsParseDelimitedList(e,t,r){return vl(this.tsParseDelimitedListWorker(e,t,!0,r))}tsParseDelimitedListWorker(e,t,r,i){let a=[],o=-1;for(;!this.tsIsListTerminator(e);){o=-1;let l=t();if(l==null)return;if(a.push(l),this.eat(12)){o=this.state.lastTokStart;continue}if(this.tsIsListTerminator(e))break;r&&this.expect(12);return}return i&&(i.value=o),a}tsParseBracketedList(e,t,r,i,a){i||(r?this.expect(0):this.expect(47));let o=this.tsParseDelimitedList(e,t,a);return r?this.expect(3):this.expect(48),o}tsParseImportType(){let e=this.startNode();return this.expect(83),this.expect(10),this.match(133)||this.raise(k.UnsupportedImportTypeArgument,{at:this.state.startLoc}),e.argument=super.parseExprAtom(),this.expect(11),this.eat(16)&&(e.qualifier=this.tsParseEntityName()),this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSImportType")}tsParseEntityName(e=!0){let t=this.parseIdentifier(e);for(;this.eat(16);){let r=this.startNodeAtNode(t);r.left=t,r.right=this.parseIdentifier(e),t=this.finishNode(r,"TSQualifiedName")}return t}tsParseTypeReference(){let e=this.startNode();return e.typeName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeReference")}tsParseThisTypePredicate(e){this.next();let t=this.startNodeAtNode(e);return t.parameterName=e,t.typeAnnotation=this.tsParseTypeAnnotation(!1),t.asserts=!1,this.finishNode(t,"TSTypePredicate")}tsParseThisTypeNode(){let e=this.startNode();return this.next(),this.finishNode(e,"TSThisType")}tsParseTypeQuery(){let e=this.startNode();return this.expect(87),this.match(83)?e.exprName=this.tsParseImportType():e.exprName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeQuery")}tsParseTypeParameter(e){let t=this.startNode();return e(t),t.name=this.tsParseTypeParameterName(),t.constraint=this.tsEatThenParseType(81),t.default=this.tsEatThenParseType(29),this.finishNode(t,"TSTypeParameter")}tsTryParseTypeParameters(e){if(this.match(47))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){let t=this.startNode();this.match(47)||this.match(142)?this.next():this.unexpected();let r={value:-1};return t.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,e),!1,!0,r),t.params.length===0&&this.raise(k.EmptyTypeParameters,{at:t}),r.value!==-1&&this.addExtra(t,"trailingComma",r.value),this.finishNode(t,"TSTypeParameterDeclaration")}tsFillSignature(e,t){let r=e===19,i="parameters",a="typeAnnotation";t.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),t[i]=this.tsParseBindingListForSignature(),r?t[a]=this.tsParseTypeOrTypePredicateAnnotation(e):this.match(e)&&(t[a]=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){let e=super.parseBindingList(11,41,2);for(let t of e){let{type:r}=t;(r==="AssignmentPattern"||r==="TSParameterProperty")&&this.raise(k.UnsupportedSignatureParameterKind,{at:t,type:r})}return e}tsParseTypeMemberSemicolon(){!this.eat(12)&&!this.isLineTerminator()&&this.expect(13)}tsParseSignatureMember(e,t){return this.tsFillSignature(14,t),this.tsParseTypeMemberSemicolon(),this.finishNode(t,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),R(this.state.type)?(this.next(),this.match(14)):!1}tsTryParseIndexSignature(e){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);let t=this.parseIdentifier();t.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(t),this.expect(3),e.parameters=[t];let r=this.tsTryParseTypeAnnotation();return r&&(e.typeAnnotation=r),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSIndexSignature")}tsParsePropertyOrMethodSignature(e,t){this.eat(17)&&(e.optional=!0);let r=e;if(this.match(10)||this.match(47)){t&&this.raise(k.ReadonlyForMethodSignature,{at:e});let i=r;i.kind&&this.match(47)&&this.raise(k.AccesorCannotHaveTypeParameters,{at:this.state.curPosition()}),this.tsFillSignature(14,i),this.tsParseTypeMemberSemicolon();let a="parameters",o="typeAnnotation";if(i.kind==="get")i[a].length>0&&(this.raise(b.BadGetterArity,{at:this.state.curPosition()}),this.isThisParam(i[a][0])&&this.raise(k.AccesorCannotDeclareThisParameter,{at:this.state.curPosition()}));else if(i.kind==="set"){if(i[a].length!==1)this.raise(b.BadSetterArity,{at:this.state.curPosition()});else{let l=i[a][0];this.isThisParam(l)&&this.raise(k.AccesorCannotDeclareThisParameter,{at:this.state.curPosition()}),l.type==="Identifier"&&l.optional&&this.raise(k.SetAccesorCannotHaveOptionalParameter,{at:this.state.curPosition()}),l.type==="RestElement"&&this.raise(k.SetAccesorCannotHaveRestParameter,{at:this.state.curPosition()})}i[o]&&this.raise(k.SetAccesorCannotHaveReturnType,{at:i[o]})}else i.kind="method";return this.finishNode(i,"TSMethodSignature")}else{let i=r;t&&(i.readonly=!0);let a=this.tsTryParseTypeAnnotation();return a&&(i.typeAnnotation=a),this.tsParseTypeMemberSemicolon(),this.finishNode(i,"TSPropertySignature")}}tsParseTypeMember(){let e=this.startNode();if(this.match(10)||this.match(47))return this.tsParseSignatureMember("TSCallSignatureDeclaration",e);if(this.match(77)){let r=this.startNode();return this.next(),this.match(10)||this.match(47)?this.tsParseSignatureMember("TSConstructSignatureDeclaration",e):(e.key=this.createIdentifier(r,"new"),this.tsParsePropertyOrMethodSignature(e,!1))}this.tsParseModifiers({allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]},e);let t=this.tsTryParseIndexSignature(e);return t||(super.parsePropertyName(e),!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.tsTokenCanFollowModifier()&&(e.kind=e.key.name,super.parsePropertyName(e)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))}tsParseTypeLiteral(){let e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(5);let e=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(8),e}tsIsStartOfMappedType(){return this.next(),this.eat(53)?this.isContextual(122):(this.isContextual(122)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(58)))}tsParseMappedTypeParameter(){let e=this.startNode();return e.name=this.tsParseTypeParameterName(),e.constraint=this.tsExpectThenParseType(58),this.finishNode(e,"TSTypeParameter")}tsParseMappedType(){let e=this.startNode();return this.expect(5),this.match(53)?(e.readonly=this.state.value,this.next(),this.expectContextual(122)):this.eatContextual(122)&&(e.readonly=!0),this.expect(0),e.typeParameter=this.tsParseMappedTypeParameter(),e.nameType=this.eatContextual(93)?this.tsParseType():null,this.expect(3),this.match(53)?(e.optional=this.state.value,this.next(),this.expect(17)):this.eat(17)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(8),this.finishNode(e,"TSMappedType")}tsParseTupleType(){let e=this.startNode();e.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let t=!1;return e.elementTypes.forEach(r=>{let{type:i}=r;t&&i!=="TSRestType"&&i!=="TSOptionalType"&&!(i==="TSNamedTupleMember"&&r.optional)&&this.raise(k.OptionalTypeBeforeRequired,{at:r}),t||(t=i==="TSNamedTupleMember"&&r.optional||i==="TSOptionalType")}),this.finishNode(e,"TSTupleType")}tsParseTupleElementType(){let{startLoc:e}=this.state,t=this.eat(21),r,i,a,o,c=xe(this.state.type)?this.lookaheadCharCode():null;if(c===58)r=!0,a=!1,i=this.parseIdentifier(!0),this.expect(14),o=this.tsParseType();else if(c===63){a=!0;let p=this.state.startLoc,u=this.state.value,h=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(r=!0,i=this.createIdentifier(this.startNodeAt(p),u),this.expect(17),this.expect(14),o=this.tsParseType()):(r=!1,o=h,this.expect(17))}else o=this.tsParseType(),a=this.eat(17),r=this.eat(14);if(r){let p;i?(p=this.startNodeAtNode(i),p.optional=a,p.label=i,p.elementType=o,this.eat(17)&&(p.optional=!0,this.raise(k.TupleOptionalAfterType,{at:this.state.lastTokStartLoc}))):(p=this.startNodeAtNode(o),p.optional=a,this.raise(k.InvalidTupleMemberLabel,{at:o}),p.label=o,p.elementType=this.tsParseType()),o=this.finishNode(p,"TSNamedTupleMember")}else if(a){let p=this.startNodeAtNode(o);p.typeAnnotation=o,o=this.finishNode(p,"TSOptionalType")}if(t){let p=this.startNodeAt(e);p.typeAnnotation=o,o=this.finishNode(p,"TSRestType")}return o}tsParseParenthesizedType(){let e=this.startNode();return this.expect(10),e.typeAnnotation=this.tsParseType(),this.expect(11),this.finishNode(e,"TSParenthesizedType")}tsParseFunctionOrConstructorType(e,t){let r=this.startNode();return e==="TSConstructorType"&&(r.abstract=!!t,t&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,r)),this.finishNode(r,e)}tsParseLiteralTypeNode(){let e=this.startNode();switch(this.state.type){case 134:case 135:case 133:case 85:case 86:e.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(e,"TSLiteralType")}tsParseTemplateLiteralType(){let e=this.startNode();return e.literal=super.parseTemplate(!1),this.finishNode(e,"TSLiteralType")}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let e=this.tsParseThisTypeNode();return this.isContextual(116)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseNonArrayType(){switch(this.state.type){case 133:case 134:case 135:case 85:case 86:return this.tsParseLiteralTypeNode();case 53:if(this.state.value==="-"){let e=this.startNode(),t=this.lookahead();return t.type!==134&&t.type!==135&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,"TSLiteralType")}break;case 78:return this.tsParseThisTypeOrThisTypePredicate();case 87:return this.tsParseTypeQuery();case 83:return this.tsParseImportType();case 5:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 10:return this.tsParseParenthesizedType();case 25:case 24:return this.tsParseTemplateLiteralType();default:{let{type:e}=this.state;if(R(e)||e===88||e===84){let t=e===88?"TSVoidKeyword":e===84?"TSNullKeyword":xl(this.state.value);if(t!==void 0&&this.lookaheadCharCode()!==46){let r=this.startNode();return this.next(),this.finishNode(r,t)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let e=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(3)){let t=this.startNodeAtNode(e);t.elementType=e,this.expect(3),e=this.finishNode(t,"TSArrayType")}else{let t=this.startNodeAtNode(e);t.objectType=e,t.indexType=this.tsParseType(),this.expect(3),e=this.finishNode(t,"TSIndexedAccessType")}return e}tsParseTypeOperator(){let e=this.startNode(),t=this.state.value;return this.next(),e.operator=t,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),t==="readonly"&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(k.UnexpectedReadonly,{at:e})}}tsParseInferType(){let e=this.startNode();this.expectContextual(115);let t=this.startNode();return t.name=this.tsParseTypeParameterName(),t.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(t,"TSTypeParameter"),this.finishNode(e,"TSInferType")}tsParseConstraintForInferType(){if(this.eat(81)){let e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(17))return e}}tsParseTypeOperatorOrHigher(){return Uo(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(115)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,t,r){let i=this.startNode(),a=this.eat(r),o=[];do o.push(t());while(this.eat(r));return o.length===1&&!a?o[0]:(i.types=o,this.finishNode(i,e))}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),45)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),43)}tsIsStartOfFunctionType(){return this.match(47)?!0:this.match(10)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(R(this.state.type)||this.match(78))return this.next(),!0;if(this.match(5)){let{errors:e}=this.state,t=e.length;try{return this.parseObjectLike(8,!0),e.length===t}catch{return!1}}if(this.match(0)){this.next();let{errors:e}=this.state,t=e.length;try{return super.parseBindingList(3,93,1),e.length===t}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(11)||this.match(21)||this.tsSkipParameterStart()&&(this.match(14)||this.match(12)||this.match(17)||this.match(29)||this.match(11)&&(this.next(),this.match(19))))}tsParseTypeOrTypePredicateAnnotation(e){return this.tsInType(()=>{let t=this.startNode();this.expect(e);let r=this.startNode(),i=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(i&&this.match(78)){let l=this.tsParseThisTypeOrThisTypePredicate();return l.type==="TSThisType"?(r.parameterName=l,r.asserts=!0,r.typeAnnotation=null,l=this.finishNode(r,"TSTypePredicate")):(this.resetStartLocationFromNode(l,r),l.asserts=!0),t.typeAnnotation=l,this.finishNode(t,"TSTypeAnnotation")}let a=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!a)return i?(r.parameterName=this.parseIdentifier(),r.asserts=i,r.typeAnnotation=null,t.typeAnnotation=this.finishNode(r,"TSTypePredicate"),this.finishNode(t,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,t);let o=this.tsParseTypeAnnotation(!1);return r.parameterName=a,r.typeAnnotation=o,r.asserts=i,t.typeAnnotation=this.finishNode(r,"TSTypePredicate"),this.finishNode(t,"TSTypeAnnotation")})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(14))return this.tsParseTypeOrTypePredicateAnnotation(14)}tsTryParseTypeAnnotation(){if(this.match(14))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(14)}tsParseTypePredicatePrefix(){let e=this.parseIdentifier();if(this.isContextual(116)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(this.state.type!==109)return!1;let e=this.state.containsEsc;return this.next(),!R(this.state.type)&&!this.match(78)?!1:(e&&this.raise(b.InvalidEscapedReservedWord,{at:this.state.lastTokStartLoc,reservedWord:"asserts"}),!0)}tsParseTypeAnnotation(e=!0,t=this.startNode()){return this.tsInType(()=>{e&&this.expect(14),t.typeAnnotation=this.tsParseType()}),this.finishNode(t,"TSTypeAnnotation")}tsParseType(){Zs(this.state.inType);let e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(81))return e;let t=this.startNodeAtNode(e);return t.checkType=e,t.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(17),t.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(14),t.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(t,"TSConditionalType")}isAbstractConstructorSignature(){return this.isContextual(124)&&this.lookahead().type===77}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(77)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(k.ReservedTypeAssertion,{at:this.state.startLoc});let e=this.startNode();return e.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?this.tsParseTypeReference():this.tsParseType())),this.expect(48),e.expression=this.parseMaybeUnary(),this.finishNode(e,"TSTypeAssertion")}tsParseHeritageClause(e){let t=this.state.startLoc,r=this.tsParseDelimitedList("HeritageClauseElement",()=>{let i=this.startNode();return i.expression=this.tsParseEntityName(),this.match(47)&&(i.typeParameters=this.tsParseTypeArguments()),this.finishNode(i,"TSExpressionWithTypeArguments")});return r.length||this.raise(k.EmptyHeritageClauseType,{at:t,token:e}),r}tsParseInterfaceDeclaration(e,t={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(129),t.declare&&(e.declare=!0),R(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(k.MissingInterfaceName,{at:this.state.startLoc})),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81)&&(e.extends=this.tsParseHeritageClause("extends"));let r=this.startNode();return r.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(r,"TSInterfaceBody"),this.finishNode(e,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(e){return e.id=this.parseIdentifier(),this.checkIdentifier(e.id,2),e.typeAnnotation=this.tsInType(()=>{if(e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(29),this.isContextual(114)&&this.lookahead().type!==16){let t=this.startNode();return this.next(),this.finishNode(t,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(e,"TSTypeAliasDeclaration")}tsInNoContext(e){let t=this.state.context;this.state.context=[t[0]];try{return e()}finally{this.state.context=t}}tsInType(e){let t=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=t}}tsInDisallowConditionalTypesContext(e){let t=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.state.inDisallowConditionalTypesContext=t}}tsInAllowConditionalTypesContext(e){let t=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.state.inDisallowConditionalTypesContext=t}}tsEatThenParseType(e){if(this.match(e))return this.tsNextThenParseType()}tsExpectThenParseType(e){return this.tsInType(()=>(this.expect(e),this.tsParseType()))}tsNextThenParseType(){return this.tsInType(()=>(this.next(),this.tsParseType()))}tsParseEnumMember(){let e=this.startNode();return e.id=this.match(133)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(29)&&(e.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(e,"TSEnumMember")}tsParseEnumDeclaration(e,t={}){return t.const&&(e.const=!0),t.declare&&(e.declare=!0),this.expectContextual(126),e.id=this.parseIdentifier(),this.checkIdentifier(e.id,e.const?8971:8459),this.expect(5),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(e,"TSEnumDeclaration")}tsParseModuleBlock(){let e=this.startNode();return this.scope.enter(0),this.expect(5),super.parseBlockOrModuleBlockBody(e.body=[],void 0,!0,8),this.scope.exit(),this.finishNode(e,"TSModuleBlock")}tsParseModuleOrNamespaceDeclaration(e,t=!1){if(e.id=this.parseIdentifier(),t||this.checkIdentifier(e.id,1024),this.eat(16)){let r=this.startNode();this.tsParseModuleOrNamespaceDeclaration(r,!0),e.body=r}else this.scope.enter(256),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit();return this.finishNode(e,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(e){return this.isContextual(112)?(e.global=!0,e.id=this.parseIdentifier()):this.match(133)?e.id=super.parseStringLiteral(this.state.value):this.unexpected(),this.match(5)?(this.scope.enter(256),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit()):this.semicolon(),this.finishNode(e,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(e,t,r){e.isExport=r||!1,e.id=t||this.parseIdentifier(),this.checkIdentifier(e.id,4096),this.expect(29);let i=this.tsParseModuleReference();return e.importKind==="type"&&i.type!=="TSExternalModuleReference"&&this.raise(k.ImportAliasHasImportType,{at:i}),e.moduleReference=i,this.semicolon(),this.finishNode(e,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(119)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)}tsParseExternalModuleReference(){let e=this.startNode();return this.expectContextual(119),this.expect(10),this.match(133)||this.unexpected(),e.expression=super.parseExprAtom(),this.expect(11),this.sawUnambiguousESM=!0,this.finishNode(e,"TSExternalModuleReference")}tsLookAhead(e){let t=this.state.clone(),r=e();return this.state=t,r}tsTryParseAndCatch(e){let t=this.tryParse(r=>e()||r());if(!(t.aborted||!t.node))return t.error&&(this.state=t.failState),t.node}tsTryParse(e){let t=this.state.clone(),r=e();if(r!==void 0&&r!==!1)return r;this.state=t}tsTryParseDeclare(e){if(this.isLineTerminator())return;let t=this.state.type,r;return this.isContextual(100)&&(t=74,r="let"),this.tsInAmbientContext(()=>{switch(t){case 68:return e.declare=!0,super.parseFunctionStatement(e,!1,!1);case 80:return e.declare=!0,this.parseClass(e,!0,!1);case 126:return this.tsParseEnumDeclaration(e,{declare:!0});case 112:return this.tsParseAmbientExternalModuleDeclaration(e);case 75:case 74:return!this.match(75)||!this.isLookaheadContextual("enum")?(e.declare=!0,this.parseVarStatement(e,r||this.state.value,!0)):(this.expect(75),this.tsParseEnumDeclaration(e,{const:!0,declare:!0}));case 129:{let i=this.tsParseInterfaceDeclaration(e,{declare:!0});if(i)return i}default:if(R(t))return this.tsParseDeclaration(e,this.state.value,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.value,!0,null)}tsParseExpressionStatement(e,t,r){switch(t.name){case"declare":{let i=this.tsTryParseDeclare(e);return i&&(i.declare=!0),i}case"global":if(this.match(5)){this.scope.enter(256),this.prodParam.enter(0);let i=e;return i.global=!0,i.id=t,i.body=this.tsParseModuleBlock(),this.scope.exit(),this.prodParam.exit(),this.finishNode(i,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(e,t.name,!1,r)}}tsParseDeclaration(e,t,r,i){switch(t){case"abstract":if(this.tsCheckLineTerminator(r)&&(this.match(80)||R(this.state.type)))return this.tsParseAbstractDeclaration(e,i);break;case"module":if(this.tsCheckLineTerminator(r)){if(this.match(133))return this.tsParseAmbientExternalModuleDeclaration(e);if(R(this.state.type))return this.tsParseModuleOrNamespaceDeclaration(e)}break;case"namespace":if(this.tsCheckLineTerminator(r)&&R(this.state.type))return this.tsParseModuleOrNamespaceDeclaration(e);break;case"type":if(this.tsCheckLineTerminator(r)&&R(this.state.type))return this.tsParseTypeAliasDeclaration(e);break}}tsCheckLineTerminator(e){return e?this.hasFollowingLineBreak()?!1:(this.next(),!0):!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(e){if(!this.match(47))return;let t=this.state.maybeInArrowParameters;this.state.maybeInArrowParameters=!0;let r=this.tsTryParseAndCatch(()=>{let i=this.startNodeAt(e);return i.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(i),i.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(19),i});if(this.state.maybeInArrowParameters=t,!!r)return super.parseArrowExpression(r,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===47)return this.tsParseTypeArguments()}tsParseTypeArguments(){let e=this.startNode();return e.params=this.tsInType(()=>this.tsInNoContext(()=>(this.expect(47),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),e.params.length===0?this.raise(k.EmptyTypeArguments,{at:e}):!this.state.inType&&this.curContext()===V.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return Bo(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseAssignableListItem(e,t){let r=this.state.startLoc,i={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},i);let a=i.accessibility,o=i.override,l=i.readonly;!(e&4)&&(a||l||o)&&this.raise(k.UnexpectedParameterModifier,{at:r});let c=this.parseMaybeDefault();this.parseAssignableListItemTypes(c,e);let p=this.parseMaybeDefault(c.loc.start,c);if(a||l||o){let u=this.startNodeAt(r);return t.length&&(u.decorators=t),a&&(u.accessibility=a),l&&(u.readonly=l),o&&(u.override=o),p.type!=="Identifier"&&p.type!=="AssignmentPattern"&&this.raise(k.UnsupportedParameterPropertyKind,{at:u}),u.parameter=p,this.finishNode(u,"TSParameterProperty")}return t.length&&(c.decorators=t),p}isSimpleParameter(e){return e.type==="TSParameterProperty"&&super.isSimpleParameter(e.parameter)||super.isSimpleParameter(e)}tsDisallowOptionalPattern(e){for(let t of e.params)t.type!=="Identifier"&&t.optional&&!this.state.isAmbientContext&&this.raise(k.PatternIsOptional,{at:t})}setArrowFunctionParameters(e,t,r){super.setArrowFunctionParameters(e,t,r),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,t,r=!1){this.match(14)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(14));let i=t==="FunctionDeclaration"?"TSDeclareFunction":t==="ClassMethod"||t==="ClassPrivateMethod"?"TSDeclareMethod":void 0;return i&&!this.match(5)&&this.isLineTerminator()?this.finishNode(e,i):i==="TSDeclareFunction"&&this.state.isAmbientContext&&(this.raise(k.DeclareFunctionHasImplementation,{at:e}),e.declare)?super.parseFunctionBodyAndFinish(e,i,r):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,t,r))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,1024):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(t=>{t?.type==="TSTypeCastExpression"&&this.raise(k.UnexpectedTypeAnnotation,{at:t.typeAnnotation})})}toReferencedList(e,t){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,t,r,i){let a=super.parseArrayLike(e,t,r,i);return a.type==="ArrayExpression"&&this.tsCheckForInvalidTypeCasts(a.elements),a}parseSubscript(e,t,r,i){if(!this.hasPrecedingLineBreak()&&this.match(35)){this.state.canStartJSXElement=!1,this.next();let o=this.startNodeAt(t);return o.expression=e,this.finishNode(o,"TSNonNullExpression")}let a=!1;if(this.match(18)&&this.lookaheadCharCode()===60){if(r)return i.stop=!0,e;i.optionalChainMember=a=!0,this.next()}if(this.match(47)||this.match(51)){let o,l=this.tsTryParseAndCatch(()=>{if(!r&&this.atPossibleAsyncArrow(e)){let h=this.tsTryParseGenericAsyncArrowFunction(t);if(h)return h}let c=this.tsParseTypeArgumentsInExpression();if(!c)return;if(a&&!this.match(10)){o=this.state.curPosition();return}if(xn(this.state.type)){let h=super.parseTaggedTemplateExpression(e,t,i);return h.typeParameters=c,h}if(!r&&this.eat(10)){let h=this.startNodeAt(t);return h.callee=e,h.arguments=this.parseCallExpressionArguments(11,!1),this.tsCheckForInvalidTypeCasts(h.arguments),h.typeParameters=c,i.optionalChainMember&&(h.optional=a),this.finishCallExpression(h,i.optionalChainMember)}let p=this.state.type;if(p===48||p===52||p!==10&&fr(p)&&!this.hasPrecedingLineBreak())return;let u=this.startNodeAt(t);return u.expression=e,u.typeParameters=c,this.finishNode(u,"TSInstantiationExpression")});if(o&&this.unexpected(o,10),l)return l.type==="TSInstantiationExpression"&&(this.match(16)||this.match(18)&&this.lookaheadCharCode()!==40)&&this.raise(k.InvalidPropertyAccessAfterInstantiationExpression,{at:this.state.startLoc}),l}return super.parseSubscript(e,t,r,i)}parseNewCallee(e){var t;super.parseNewCallee(e);let{callee:r}=e;r.type==="TSInstantiationExpression"&&!((t=r.extra)!=null&&t.parenthesized)&&(e.typeParameters=r.typeParameters,e.callee=r.expression)}parseExprOp(e,t,r){let i;if(mn(58)>r&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(i=this.isContextual(120)))){let a=this.startNodeAt(t);return a.expression=e,a.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?(i&&this.raise(b.UnexpectedKeyword,{at:this.state.startLoc,keyword:"const"}),this.tsParseTypeReference()):this.tsParseType())),this.finishNode(a,i?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(a,t,r)}return super.parseExprOp(e,t,r)}checkReservedWord(e,t,r,i){this.state.isAmbientContext||super.checkReservedWord(e,t,r,i)}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(k.ImportReflectionHasImportType,{at:e.specifiers[0].loc.start})}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){let t=this.lookaheadCharCode();return e?t===123||t===42:t!==61}return!e&&this.isContextual(87)}applyImportPhase(e,t,r,i){super.applyImportPhase(e,t,r,i),t?e.exportKind=r==="type"?"type":"value":e.importKind=r==="type"||r==="typeof"?r:"value"}parseImport(e){if(this.match(133))return e.importKind="value",super.parseImport(e);let t;if(R(this.state.type)&&this.lookaheadCharCode()===61)return e.importKind="value",this.tsParseImportEqualsDeclaration(e);if(this.isContextual(130)){let r=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.tsParseImportEqualsDeclaration(e,r);t=super.parseImportSpecifiersAndAfter(e,r)}else t=super.parseImport(e);return t.importKind==="type"&&t.specifiers.length>1&&t.specifiers[0].type==="ImportDefaultSpecifier"&&this.raise(k.TypeImportCannotSpecifyDefaultAndNamed,{at:t}),t}parseExport(e,t){if(this.match(83)){this.next();let r=null;return this.isContextual(130)&&this.isPotentialImportPhase(!1)?r=this.parseMaybeImportPhase(e,!1):e.importKind="value",this.tsParseImportEqualsDeclaration(e,r,!0)}else if(this.eat(29)){let r=e;return r.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(r,"TSExportAssignment")}else if(this.eatContextual(93)){let r=e;return this.expectContextual(128),r.id=this.parseIdentifier(),this.semicolon(),this.finishNode(r,"TSNamespaceExportDeclaration")}else return super.parseExport(e,t)}isAbstractClass(){return this.isContextual(124)&&this.lookahead().type===80}parseExportDefaultExpression(){if(this.isAbstractClass()){let e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0,!0)}if(this.match(129)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultExpression()}parseVarStatement(e,t,r=!1){let{isAmbientContext:i}=this.state,a=super.parseVarStatement(e,t,r||i);if(!i)return a;for(let{id:o,init:l}of a.declarations)l&&(t!=="const"||o.typeAnnotation?this.raise(k.InitializerNotAllowedInAmbientContext,{at:l}):Cl(l,this.hasPlugin("estree"))||this.raise(k.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference,{at:l}));return a}parseStatementContent(e,t){if(this.match(75)&&this.isLookaheadContextual("enum")){let r=this.startNode();return this.expect(75),this.tsParseEnumDeclaration(r,{const:!0})}if(this.isContextual(126))return this.tsParseEnumDeclaration(this.startNode());if(this.isContextual(129)){let r=this.tsParseInterfaceDeclaration(this.startNode());if(r)return r}return super.parseStatementContent(e,t)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(e,t){return t.some(r=>ei(r)?e.accessibility===r:!!e[r])}tsIsStartOfStaticBlocks(){return this.isContextual(106)&&this.lookaheadCharCode()===123}parseClassMember(e,t,r){let i=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:i,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:k.InvalidModifierOnTypeParameterPositions},t);let a=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(t,i)&&this.raise(k.StaticBlockCannotHaveModifier,{at:this.state.curPosition()}),super.parseClassStaticBlock(e,t)):this.parseClassMemberWithIsStatic(e,t,r,!!t.static)};t.declare?this.tsInAmbientContext(a):a()}parseClassMemberWithIsStatic(e,t,r,i){let a=this.tsTryParseIndexSignature(t);if(a){e.body.push(a),t.abstract&&this.raise(k.IndexSignatureHasAbstract,{at:t}),t.accessibility&&this.raise(k.IndexSignatureHasAccessibility,{at:t,modifier:t.accessibility}),t.declare&&this.raise(k.IndexSignatureHasDeclare,{at:t}),t.override&&this.raise(k.IndexSignatureHasOverride,{at:t});return}!this.state.inAbstractClass&&t.abstract&&this.raise(k.NonAbstractClassHasAbstractMethod,{at:t}),t.override&&(r.hadSuperClass||this.raise(k.OverrideNotInSubClass,{at:t})),super.parseClassMemberWithIsStatic(e,t,r,i)}parsePostMemberNameModifiers(e){this.eat(17)&&(e.optional=!0),e.readonly&&this.match(10)&&this.raise(k.ClassMethodHasReadonly,{at:e}),e.declare&&this.match(10)&&this.raise(k.ClassMethodHasDeclare,{at:e})}parseExpressionStatement(e,t,r){return(t.type==="Identifier"?this.tsParseExpressionStatement(e,t,r):void 0)||super.parseExpressionStatement(e,t,r)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(e,t,r){if(!this.state.maybeInArrowParameters||!this.match(17))return super.parseConditional(e,t,r);let i=this.tryParse(()=>super.parseConditional(e,t));return i.node?(i.error&&(this.state=i.failState),i.node):(i.error&&super.setOptionalParametersError(r,i.error),e)}parseParenItem(e,t){if(e=super.parseParenItem(e,t),this.eat(17)&&(e.optional=!0,this.resetEndLocation(e)),this.match(14)){let r=this.startNodeAt(t);return r.expression=e,r.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(r,"TSTypeCastExpression")}return e}parseExportDeclaration(e){if(!this.state.isAmbientContext&&this.isContextual(125))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));let t=this.state.startLoc,r=this.eatContextual(125);if(r&&(this.isContextual(125)||!this.shouldParseExportDeclaration()))throw this.raise(k.ExpectedAmbientAfterExportDeclare,{at:this.state.startLoc});let a=R(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return a?((a.type==="TSInterfaceDeclaration"||a.type==="TSTypeAliasDeclaration"||r)&&(e.exportKind="type"),r&&(this.resetStartLocation(a,t),a.declare=!0),a):null}parseClassId(e,t,r,i){if((!t||r)&&this.isContextual(113))return;super.parseClassId(e,t,r,e.declare?1024:8331);let a=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);a&&(e.typeParameters=a)}parseClassPropertyAnnotation(e){e.optional||(this.eat(35)?e.definite=!0:this.eat(17)&&(e.optional=!0));let t=this.tsTryParseTypeAnnotation();t&&(e.typeAnnotation=t)}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&!(e.readonly&&!e.typeAnnotation)&&this.match(29)&&this.raise(k.DeclareClassFieldHasInitializer,{at:this.state.startLoc}),e.abstract&&this.match(29)){let{key:t}=e;this.raise(k.AbstractPropertyHasInitializer,{at:this.state.startLoc,propertyName:t.type==="Identifier"&&!e.computed?t.name:`[${this.input.slice(t.start,t.end)}]`})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(k.PrivateElementHasAbstract,{at:e}),e.accessibility&&this.raise(k.PrivateElementHasAccessibility,{at:e,modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(k.AccessorCannotBeOptional,{at:e}),super.parseClassAccessorProperty(e)}pushClassMethod(e,t,r,i,a,o){let l=this.tsTryParseTypeParameters(this.tsParseConstModifier);l&&a&&this.raise(k.ConstructorHasTypeParameters,{at:l});let{declare:c=!1,kind:p}=t;c&&(p==="get"||p==="set")&&this.raise(k.DeclareAccessor,{at:t,kind:p}),l&&(t.typeParameters=l),super.pushClassMethod(e,t,r,i,a,o)}pushClassPrivateMethod(e,t,r,i){let a=this.tsTryParseTypeParameters(this.tsParseConstModifier);a&&(t.typeParameters=a),super.pushClassPrivateMethod(e,t,r,i)}declareClassPrivateMethodInScope(e,t){e.type!=="TSDeclareMethod"&&(e.type==="MethodDefinition"&&!e.value.body||super.declareClassPrivateMethodInScope(e,t))}parseClassSuper(e){super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeParameters=this.tsParseTypeArgumentsInExpression()),this.eatContextual(113)&&(e.implements=this.tsParseHeritageClause("implements"))}parseObjPropValue(e,t,r,i,a,o,l){let c=this.tsTryParseTypeParameters(this.tsParseConstModifier);return c&&(e.typeParameters=c),super.parseObjPropValue(e,t,r,i,a,o,l)}parseFunctionParams(e,t){let r=this.tsTryParseTypeParameters(this.tsParseConstModifier);r&&(e.typeParameters=r),super.parseFunctionParams(e,t)}parseVarId(e,t){super.parseVarId(e,t),e.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(35)&&(e.definite=!0);let r=this.tsTryParseTypeAnnotation();r&&(e.id.typeAnnotation=r,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,t){return this.match(14)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,t)}parseMaybeAssign(e,t){var r,i,a,o,l;let c,p,u;if(this.hasPlugin("jsx")&&(this.match(142)||this.match(47))){if(c=this.state.clone(),p=this.tryParse(()=>super.parseMaybeAssign(e,t),c),!p.error)return p.node;let{context:d}=this.state,y=d[d.length-1];(y===V.j_oTag||y===V.j_expr)&&d.pop()}if(!((r=p)!=null&&r.error)&&!this.match(47))return super.parseMaybeAssign(e,t);(!c||c===this.state)&&(c=this.state.clone());let h,m=this.tryParse(d=>{var y,f;h=this.tsParseTypeParameters(this.tsParseConstModifier);let v=super.parseMaybeAssign(e,t);return(v.type!=="ArrowFunctionExpression"||(y=v.extra)!=null&&y.parenthesized)&&d(),((f=h)==null?void 0:f.params.length)!==0&&this.resetStartLocationFromNode(v,h),v.typeParameters=h,v},c);if(!m.error&&!m.aborted)return h&&this.reportReservedArrowTypeParam(h),m.node;if(!p&&(Zs(!this.hasPlugin("jsx")),u=this.tryParse(()=>super.parseMaybeAssign(e,t),c),!u.error))return u.node;if((i=p)!=null&&i.node)return this.state=p.failState,p.node;if(m.node)return this.state=m.failState,h&&this.reportReservedArrowTypeParam(h),m.node;if((a=u)!=null&&a.node)return this.state=u.failState,u.node;throw((o=p)==null?void 0:o.error)||m.error||((l=u)==null?void 0:l.error)}reportReservedArrowTypeParam(e){var t;e.params.length===1&&!e.params[0].constraint&&!((t=e.extra)!=null&&t.trailingComma)&&this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(k.ReservedArrowTypeParam,{at:e})}parseMaybeUnary(e,t){return!this.hasPlugin("jsx")&&this.match(47)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,t)}parseArrow(e){if(this.match(14)){let t=this.tryParse(r=>{let i=this.tsParseTypeOrTypePredicateAnnotation(14);return(this.canInsertSemicolon()||!this.match(19))&&r(),i});if(t.aborted)return;t.thrown||(t.error&&(this.state=t.failState),e.returnType=t.node)}return super.parseArrow(e)}parseAssignableListItemTypes(e,t){if(!(t&2))return e;this.eat(17)&&(e.optional=!0);let r=this.tsTryParseTypeAnnotation();return r&&(e.typeAnnotation=r),this.resetEndLocation(e),e}isAssignable(e,t){switch(e.type){case"TSTypeCastExpression":return this.isAssignable(e.expression,t);case"TSParameterProperty":return!0;default:return super.isAssignable(e,t)}}toAssignable(e,t=!1){switch(e.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(e,t);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":t?this.expressionScope.recordArrowParameterBindingError(k.UnexpectedTypeCastInParameter,{at:e}):this.raise(k.UnexpectedTypeCastInParameter,{at:e}),this.toAssignable(e.expression,t);break;case"AssignmentExpression":!t&&e.left.type==="TSTypeCastExpression"&&(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,t)}}toAssignableParenthesizedExpression(e,t){switch(e.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(e.expression,t);break;default:super.toAssignable(e,t)}}checkToRestConversion(e,t){switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(e.expression,!1);break;default:super.checkToRestConversion(e,t)}}isValidLVal(e,t,r){return gl({TSTypeCastExpression:!0,TSParameterProperty:"parameter",TSNonNullExpression:"expression",TSAsExpression:(r!==64||!t)&&["expression",!0],TSSatisfiesExpression:(r!==64||!t)&&["expression",!0],TSTypeAssertion:(r!==64||!t)&&["expression",!0]},e)||super.isValidLVal(e,t,r)}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e){if(this.match(47)||this.match(51)){let t=this.tsParseTypeArgumentsInExpression();if(this.match(10)){let r=super.parseMaybeDecoratorArguments(e);return r.typeParameters=t,r}this.unexpected(null,10)}return super.parseMaybeDecoratorArguments(e)}checkCommaAfterRest(e){return this.state.isAmbientContext&&this.match(12)&&this.lookaheadCharCode()===e?(this.next(),!1):super.checkCommaAfterRest(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(35)||this.match(14)||super.isClassProperty()}parseMaybeDefault(e,t){let r=super.parseMaybeDefault(e,t);return r.type==="AssignmentPattern"&&r.typeAnnotation&&r.right.start<r.typeAnnotation.start&&this.raise(k.TypeAnnotationAfterAssign,{at:r.typeAnnotation}),r}getTokenFromCode(e){if(this.state.inType){if(e===62){this.finishOp(48,1);return}if(e===60){this.finishOp(47,1);return}}super.getTokenFromCode(e)}reScan_lt_gt(){let{type:e}=this.state;e===47?(this.state.pos-=1,this.readToken_lt()):e===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===51?(this.state.pos-=2,this.finishOp(47,1),47):e}toAssignableList(e,t,r){for(let i=0;i<e.length;i++){let a=e[i];a?.type==="TSTypeCastExpression"&&(e[i]=this.typeCastToParameter(a))}super.toAssignableList(e,t,r)}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocation(e.expression,e.typeAnnotation.loc.end),e.expression}shouldParseArrow(e){return this.match(14)?e.every(t=>this.isAssignable(t,!0)):super.shouldParseArrow(e)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(e){if(this.match(47)||this.match(51)){let t=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());t&&(e.typeParameters=t)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){let t=super.getGetterSetterExpectedParamCount(e),i=this.getObjectOrClassMethodParams(e)[0];return i&&this.isThisParam(i)?t+1:t}parseCatchClauseParam(){let e=super.parseCatchClauseParam(),t=this.tsTryParseTypeAnnotation();return t&&(e.typeAnnotation=t,this.resetEndLocation(e)),e}tsInAmbientContext(e){let t=this.state.isAmbientContext;this.state.isAmbientContext=!0;try{return e()}finally{this.state.isAmbientContext=t}}parseClass(e,t,r){let i=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,t,r)}finally{this.state.inAbstractClass=i}}tsParseAbstractDeclaration(e,t){if(this.match(80))return e.abstract=!0,this.maybeTakeDecorators(t,this.parseClass(e,!0,!1));if(this.isContextual(129)){if(!this.hasFollowingLineBreak())return e.abstract=!0,this.raise(k.NonClassMethodPropertyHasAbstractModifer,{at:e}),this.tsParseInterfaceDeclaration(e)}else this.unexpected(null,80)}parseMethod(e,t,r,i,a,o,l){let c=super.parseMethod(e,t,r,i,a,o,l);if(c.abstract&&(this.hasPlugin("estree")?!!c.value.body:!!c.body)){let{key:u}=c;this.raise(k.AbstractMethodHasImplementation,{at:c,methodName:u.type==="Identifier"&&!c.computed?u.name:`[${this.input.slice(u.start,u.end)}]`})}return c}tsParseTypeParameterName(){return this.parseIdentifier().name}shouldParseAsAmbientContext(){return!!this.getPluginOption("typescript","dts")}parse(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.parse()}getExpression(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.getExpression()}parseExportSpecifier(e,t,r,i){return!t&&i?(this.parseTypeOnlyImportExportSpecifier(e,!1,r),this.finishNode(e,"ExportSpecifier")):(e.exportKind="value",super.parseExportSpecifier(e,t,r,i))}parseImportSpecifier(e,t,r,i,a){return!t&&i?(this.parseTypeOnlyImportExportSpecifier(e,!0,r),this.finishNode(e,"ImportSpecifier")):(e.importKind="value",super.parseImportSpecifier(e,t,r,i,r?4098:4096))}parseTypeOnlyImportExportSpecifier(e,t,r){let i=t?"imported":"local",a=t?"local":"exported",o=e[i],l,c=!1,p=!0,u=o.loc.start;if(this.isContextual(93)){let m=this.parseIdentifier();if(this.isContextual(93)){let d=this.parseIdentifier();xe(this.state.type)?(c=!0,o=m,l=t?this.parseIdentifier():this.parseModuleExportName(),p=!1):(l=d,p=!1)}else xe(this.state.type)?(p=!1,l=t?this.parseIdentifier():this.parseModuleExportName()):(c=!0,o=m)}else xe(this.state.type)&&(c=!0,t?(o=this.parseIdentifier(!0),this.isContextual(93)||this.checkReservedWord(o.name,o.loc.start,!0,!0)):o=this.parseModuleExportName());c&&r&&this.raise(t?k.TypeModifierIsUsedInTypeImports:k.TypeModifierIsUsedInTypeExports,{at:u}),e[i]=o,e[a]=l;let h=t?"importKind":"exportKind";e[h]=c?"type":"value",p&&this.eatContextual(93)&&(e[a]=t?this.parseIdentifier():this.parseModuleExportName()),e[a]||(e[a]=Be(e[i])),t&&this.checkIdentifier(e[a],c?4098:4096)}};function wl(s){if(s.type!=="MemberExpression")return!1;let{computed:n,property:e}=s;return n&&e.type!=="StringLiteral"&&(e.type!=="TemplateLiteral"||e.expressions.length>0)?!1:xi(s.object)}function Cl(s,n){var e;let{type:t}=s;if((e=s.extra)!=null&&e.parenthesized)return!1;if(n){if(t==="Literal"){let{value:r}=s;if(typeof r=="string"||typeof r=="boolean")return!0}}else if(t==="StringLiteral"||t==="BooleanLiteral")return!0;return!!(vi(s,n)||Sl(s,n)||t==="TemplateLiteral"&&s.expressions.length===0||wl(s))}function vi(s,n){return n?s.type==="Literal"&&(typeof s.value=="number"||"bigint"in s):s.type==="NumericLiteral"||s.type==="BigIntLiteral"}function Sl(s,n){if(s.type==="UnaryExpression"){let{operator:e,argument:t}=s;if(e==="-"&&vi(t,n))return!0}return!1}function xi(s){return s.type==="Identifier"?!0:s.type!=="MemberExpression"||s.computed?!1:xi(s.object)}var ti=Ue`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."}),El=s=>class extends s{parsePlaceholder(e){if(this.match(144)){let t=this.startNode();return this.next(),this.assertNoSpace(),t.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(144),this.finishPlaceholder(t,e)}}finishPlaceholder(e,t){let r=!!(e.expectedNode&&e.type==="Placeholder");return e.expectedNode=t,r?e:this.finishNode(e,"Placeholder")}getTokenFromCode(e){e===37&&this.input.charCodeAt(this.state.pos+1)===37?this.finishOp(144,2):super.getTokenFromCode(e)}parseExprAtom(e){return this.parsePlaceholder("Expression")||super.parseExprAtom(e)}parseIdentifier(e){return this.parsePlaceholder("Identifier")||super.parseIdentifier(e)}checkReservedWord(e,t,r,i){e!==void 0&&super.checkReservedWord(e,t,r,i)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(e,t,r){return e==="Placeholder"||super.isValidLVal(e,t,r)}toAssignable(e,t){e&&e.type==="Placeholder"&&e.expectedNode==="Expression"?e.expectedNode="Pattern":super.toAssignable(e,t)}chStartsBindingIdentifier(e,t){return!!(super.chStartsBindingIdentifier(e,t)||this.lookahead().type===144)}verifyBreakContinue(e,t){e.label&&e.label.type==="Placeholder"||super.verifyBreakContinue(e,t)}parseExpressionStatement(e,t){var r;if(t.type!=="Placeholder"||(r=t.extra)!=null&&r.parenthesized)return super.parseExpressionStatement(e,t);if(this.match(14)){let i=e;return i.label=this.finishPlaceholder(t,"Identifier"),this.next(),i.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(i,"LabeledStatement")}return this.semicolon(),e.name=t.name,this.finishPlaceholder(e,"Statement")}parseBlock(e,t,r){return this.parsePlaceholder("BlockStatement")||super.parseBlock(e,t,r)}parseFunctionId(e){return this.parsePlaceholder("Identifier")||super.parseFunctionId(e)}parseClass(e,t,r){let i=t?"ClassDeclaration":"ClassExpression";this.next();let a=this.state.strict,o=this.parsePlaceholder("Identifier");if(o)if(this.match(81)||this.match(144)||this.match(5))e.id=o;else{if(r||!t)return e.id=null,e.body=this.finishPlaceholder(o,"ClassBody"),this.finishNode(e,i);throw this.raise(ti.ClassNameIsRequired,{at:this.state.startLoc})}else this.parseClassId(e,t,r);return super.parseClassSuper(e),e.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!e.superClass,a),this.finishNode(e,i)}parseExport(e,t){let r=this.parsePlaceholder("Identifier");if(!r)return super.parseExport(e,t);if(!this.isContextual(98)&&!this.match(12))return e.specifiers=[],e.source=null,e.declaration=this.finishPlaceholder(r,"Declaration"),this.finishNode(e,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");let i=this.startNode();return i.exported=r,e.specifiers=[this.finishNode(i,"ExportDefaultSpecifier")],super.parseExport(e,t)}isExportDefaultSpecifier(){if(this.match(65)){let e=this.nextTokenStart();if(this.isUnparsedContextual(e,"from")&&this.input.startsWith(qe(144),this.nextTokenStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,t){var r;return(r=e.specifiers)!=null&&r.length?!0:super.maybeParseExportDefaultSpecifier(e,t)}checkExport(e){let{specifiers:t}=e;t!=null&&t.length&&(e.specifiers=t.filter(r=>r.exported.type==="Placeholder")),super.checkExport(e),e.specifiers=t}parseImport(e){let t=this.parsePlaceholder("Identifier");if(!t)return super.parseImport(e);if(e.specifiers=[],!this.isContextual(98)&&!this.match(12))return e.source=this.finishPlaceholder(t,"StringLiteral"),this.semicolon(),this.finishNode(e,"ImportDeclaration");let r=this.startNodeAtNode(t);return r.local=t,e.specifiers.push(this.finishNode(r,"ImportDefaultSpecifier")),this.eat(12)&&(this.maybeParseStarImportSpecifier(e)||this.parseNamedImportSpecifiers(e)),this.expectContextual(98),e.source=this.parseImportSource(),this.semicolon(),this.finishNode(e,"ImportDeclaration")}parseImportSource(){return this.parsePlaceholder("StringLiteral")||super.parseImportSource()}assertNoSpace(){this.state.start>this.state.lastTokEndLoc.index&&this.raise(ti.UnexpectedSpace,{at:this.state.lastTokEndLoc})}},Il=s=>class extends s{parseV8Intrinsic(){if(this.match(54)){let e=this.state.startLoc,t=this.startNode();if(this.next(),R(this.state.type)){let r=this.parseIdentifierName(),i=this.createIdentifier(t,r);if(i.type="V8IntrinsicIdentifier",this.match(10))return i}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}};function Y(s,n){let[e,t]=typeof n=="string"?[n,{}]:n,r=Object.keys(t),i=r.length===0;return s.some(a=>{if(typeof a=="string")return i&&a===e;{let[o,l]=a;if(o!==e)return!1;for(let c of r)if(l[c]!==t[c])return!1;return!0}})}function $e(s,n,e){let t=s.find(r=>Array.isArray(r)?r[0]===n:r===n);return t&&Array.isArray(t)&&t.length>1?t[1][e]:null}var ni=["minimal","fsharp","hack","smart"],ri=["^^","@@","^","%","#"],si=["hash","bar"];function Al(s){if(Y(s,"decorators")){if(Y(s,"decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");let n=$e(s,"decorators","decoratorsBeforeExport");if(n!=null&&typeof n!="boolean")throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");let e=$e(s,"decorators","allowCallParenthesized");if(e!=null&&typeof e!="boolean")throw new Error("'allowCallParenthesized' must be a boolean.")}if(Y(s,"flow")&&Y(s,"typescript"))throw new Error("Cannot combine flow and typescript plugins.");if(Y(s,"placeholders")&&Y(s,"v8intrinsic"))throw new Error("Cannot combine placeholders and v8intrinsic plugins.");if(Y(s,"pipelineOperator")){let n=$e(s,"pipelineOperator","proposal");if(!ni.includes(n)){let t=ni.map(r=>`"${r}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${t}.`)}let e=Y(s,["recordAndTuple",{syntaxType:"hash"}]);if(n==="hack"){if(Y(s,"placeholders"))throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");if(Y(s,"v8intrinsic"))throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");let t=$e(s,"pipelineOperator","topicToken");if(!ri.includes(t)){let r=ri.map(i=>`"${i}"`).join(", ");throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${r}.`)}if(t==="#"&&e)throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "hack", topicToken: "#" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.')}else if(n==="smart"&&e)throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "smart" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.')}if(Y(s,"moduleAttributes")){if(Y(s,"importAssertions")||Y(s,"importAttributes"))throw new Error("Cannot combine importAssertions, importAttributes and moduleAttributes plugins.");if($e(s,"moduleAttributes","version")!=="may-2020")throw new Error("The 'moduleAttributes' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is 'may-2020'.")}if(Y(s,"importAssertions")&&Y(s,"importAttributes"))throw new Error("Cannot combine importAssertions and importAttributes plugins.");if(Y(s,"recordAndTuple")&&$e(s,"recordAndTuple","syntaxType")!=null&&!si.includes($e(s,"recordAndTuple","syntaxType")))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+si.map(n=>`'${n}'`).join(", "));if(Y(s,"asyncDoExpressions")&&!Y(s,"doExpressions")){let n=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw n.missingPlugins="doExpressions",n}if(Y(s,"optionalChainingAssign")&&$e(s,"optionalChainingAssign","version")!=="2023-07")throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.")}var Pi={estree:Io,jsx:bl,flow:fl,typescript:Tl,v8intrinsic:Il,placeholders:El},kl=Object.keys(Pi),ur={sourceType:"script",sourceFilename:void 0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,plugins:[],strictMode:null,ranges:!1,tokens:!1,createImportExpressions:!1,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0};function Nl(s){if(s==null)return Object.assign({},ur);if(s.annexB!=null&&s.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");let n={};for(let t of Object.keys(ur)){var e;n[t]=(e=s[t])!=null?e:ur[t]}return n}var Dr=class extends Mr{checkProto(n,e,t,r){if(n.type==="SpreadElement"||this.isObjectMethod(n)||n.computed||n.shorthand)return;let i=n.key;if((i.type==="Identifier"?i.name:i.value)==="__proto__"){if(e){this.raise(b.RecordNoProto,{at:i});return}t.used&&(r?r.doubleProtoLoc===null&&(r.doubleProtoLoc=i.loc.start):this.raise(b.DuplicateProto,{at:i})),t.used=!0}}shouldExitDescending(n,e){return n.type==="ArrowFunctionExpression"&&n.start===e}getExpression(){this.enterInitialScopes(),this.nextToken();let n=this.parseExpression();return this.match(139)||this.unexpected(),this.finalizeRemainingComments(),n.comments=this.state.comments,n.errors=this.state.errors,this.options.tokens&&(n.tokens=this.tokens),n}parseExpression(n,e){return n?this.disallowInAnd(()=>this.parseExpressionBase(e)):this.allowInAnd(()=>this.parseExpressionBase(e))}parseExpressionBase(n){let e=this.state.startLoc,t=this.parseMaybeAssign(n);if(this.match(12)){let r=this.startNodeAt(e);for(r.expressions=[t];this.eat(12);)r.expressions.push(this.parseMaybeAssign(n));return this.toReferencedList(r.expressions),this.finishNode(r,"SequenceExpression")}return t}parseMaybeAssignDisallowIn(n,e){return this.disallowInAnd(()=>this.parseMaybeAssign(n,e))}parseMaybeAssignAllowIn(n,e){return this.allowInAnd(()=>this.parseMaybeAssign(n,e))}setOptionalParametersError(n,e){var t;n.optionalParametersLoc=(t=e?.loc)!=null?t:this.state.startLoc}parseMaybeAssign(n,e){let t=this.state.startLoc;if(this.isContextual(108)&&this.prodParam.hasYield){let o=this.parseYield();return e&&(o=e.call(this,o,t)),o}let r;n?r=!1:(n=new ct,r=!0);let{type:i}=this.state;(i===10||R(i))&&(this.state.potentialArrowAt=this.state.start);let a=this.parseMaybeConditional(n);if(e&&(a=e.call(this,a,t)),Do(this.state.type)){let o=this.startNodeAt(t),l=this.state.value;if(o.operator=l,this.match(29)){this.toAssignable(a,!0),o.left=a;let c=t.index;n.doubleProtoLoc!=null&&n.doubleProtoLoc.index>=c&&(n.doubleProtoLoc=null),n.shorthandAssignLoc!=null&&n.shorthandAssignLoc.index>=c&&(n.shorthandAssignLoc=null),n.privateKeyLoc!=null&&n.privateKeyLoc.index>=c&&(this.checkDestructuringPrivate(n),n.privateKeyLoc=null)}else o.left=a;return this.next(),o.right=this.parseMaybeAssign(),this.checkLVal(a,{in:this.finishNode(o,"AssignmentExpression")}),o}else r&&this.checkExpressionErrors(n,!0);return a}parseMaybeConditional(n){let e=this.state.startLoc,t=this.state.potentialArrowAt,r=this.parseExprOps(n);return this.shouldExitDescending(r,t)?r:this.parseConditional(r,e,n)}parseConditional(n,e,t){if(this.eat(17)){let r=this.startNodeAt(e);return r.test=n,r.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),r.alternate=this.parseMaybeAssign(),this.finishNode(r,"ConditionalExpression")}return n}parseMaybeUnaryOrPrivate(n){return this.match(138)?this.parsePrivateName():this.parseMaybeUnary(n)}parseExprOps(n){let e=this.state.startLoc,t=this.state.potentialArrowAt,r=this.parseMaybeUnaryOrPrivate(n);return this.shouldExitDescending(r,t)?r:this.parseExprOp(r,e,-1)}parseExprOp(n,e,t){if(this.isPrivateName(n)){let i=this.getPrivateNameSV(n);(t>=mn(58)||!this.prodParam.hasIn||!this.match(58))&&this.raise(b.PrivateInExpectedIn,{at:n,identifierName:i}),this.classScope.usePrivateName(i,n.loc.start)}let r=this.state.type;if(Oo(r)&&(this.prodParam.hasIn||!this.match(58))){let i=mn(r);if(i>t){if(r===39){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return n;this.checkPipelineAtInfixOperator(n,e)}let a=this.startNodeAt(e);a.left=n,a.operator=this.state.value;let o=r===41||r===42,l=r===40;if(l&&(i=mn(42)),this.next(),r===39&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])&&this.state.type===96&&this.prodParam.hasAwait)throw this.raise(b.UnexpectedAwaitAfterPipelineBody,{at:this.state.startLoc});a.right=this.parseExprOpRightExpr(r,i);let c=this.finishNode(a,o||l?"LogicalExpression":"BinaryExpression"),p=this.state.type;if(l&&(p===41||p===42)||o&&p===40)throw this.raise(b.MixingCoalesceWithLogical,{at:this.state.startLoc});return this.parseExprOp(c,e,t)}}return n}parseExprOpRightExpr(n,e){let t=this.state.startLoc;switch(n){case 39:switch(this.getPluginOption("pipelineOperator","proposal")){case"hack":return this.withTopicBindingContext(()=>this.parseHackPipeBody());case"smart":return this.withTopicBindingContext(()=>{if(this.prodParam.hasYield&&this.isContextual(108))throw this.raise(b.PipeBodyIsTighter,{at:this.state.startLoc});return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(n,e),t)});case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(e))}default:return this.parseExprOpBaseRightExpr(n,e)}}parseExprOpBaseRightExpr(n,e){let t=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),t,Ro(n)?e-1:e)}parseHackPipeBody(){var n;let{startLoc:e}=this.state,t=this.parseMaybeAssign();return Po.has(t.type)&&!((n=t.extra)!=null&&n.parenthesized)&&this.raise(b.PipeUnparenthesizedBody,{at:e,type:t.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(b.PipeTopicUnused,{at:e}),t}checkExponentialAfterUnary(n){this.match(57)&&this.raise(b.UnexpectedTokenUnaryExponentiation,{at:n.argument})}parseMaybeUnary(n,e){let t=this.state.startLoc,r=this.isContextual(96);if(r&&this.isAwaitAllowed()){this.next();let l=this.parseAwait(t);return e||this.checkExponentialAfterUnary(l),l}let i=this.match(34),a=this.startNode();if(_o(this.state.type)){a.operator=this.state.value,a.prefix=!0,this.match(72)&&this.expectPlugin("throwExpressions");let l=this.match(89);if(this.next(),a.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(n,!0),this.state.strict&&l){let c=a.argument;c.type==="Identifier"?this.raise(b.StrictDelete,{at:a}):this.hasPropertyAsPrivateName(c)&&this.raise(b.DeletePrivateField,{at:a})}if(!i)return e||this.checkExponentialAfterUnary(a),this.finishNode(a,"UnaryExpression")}let o=this.parseUpdate(a,i,n);if(r){let{type:l}=this.state;if((this.hasPlugin("v8intrinsic")?fr(l):fr(l)&&!this.match(54))&&!this.isAmbiguousAwait())return this.raiseOverwrite(b.AwaitNotInAsyncContext,{at:t}),this.parseAwait(t)}return o}parseUpdate(n,e,t){if(e){let a=n;return this.checkLVal(a.argument,{in:this.finishNode(a,"UpdateExpression")}),n}let r=this.state.startLoc,i=this.parseExprSubscripts(t);if(this.checkExpressionErrors(t,!1))return i;for(;Fo(this.state.type)&&!this.canInsertSemicolon();){let a=this.startNodeAt(r);a.operator=this.state.value,a.prefix=!1,a.argument=i,this.next(),this.checkLVal(i,{in:i=this.finishNode(a,"UpdateExpression")})}return i}parseExprSubscripts(n){let e=this.state.startLoc,t=this.state.potentialArrowAt,r=this.parseExprAtom(n);return this.shouldExitDescending(r,t)?r:this.parseSubscripts(r,e)}parseSubscripts(n,e,t){let r={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(n),stop:!1};do n=this.parseSubscript(n,e,t,r),r.maybeAsyncArrow=!1;while(!r.stop);return n}parseSubscript(n,e,t,r){let{type:i}=this.state;if(!t&&i===15)return this.parseBind(n,e,t,r);if(xn(i))return this.parseTaggedTemplateExpression(n,e,r);let a=!1;if(i===18){if(t&&(this.raise(b.OptionalChainingNoNew,{at:this.state.startLoc}),this.lookaheadCharCode()===40))return r.stop=!0,n;r.optionalChainMember=a=!0,this.next()}if(!t&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(n,e,r,a);{let o=this.eat(0);return o||a||this.eat(16)?this.parseMember(n,e,r,o,a):(r.stop=!0,n)}}parseMember(n,e,t,r,i){let a=this.startNodeAt(e);return a.object=n,a.computed=r,r?(a.property=this.parseExpression(),this.expect(3)):this.match(138)?(n.type==="Super"&&this.raise(b.SuperPrivateField,{at:e}),this.classScope.usePrivateName(this.state.value,this.state.startLoc),a.property=this.parsePrivateName()):a.property=this.parseIdentifier(!0),t.optionalChainMember?(a.optional=i,this.finishNode(a,"OptionalMemberExpression")):this.finishNode(a,"MemberExpression")}parseBind(n,e,t,r){let i=this.startNodeAt(e);return i.object=n,this.next(),i.callee=this.parseNoCallExpr(),r.stop=!0,this.parseSubscripts(this.finishNode(i,"BindExpression"),e,t)}parseCoverCallAndAsyncArrowHead(n,e,t,r){let i=this.state.maybeInArrowParameters,a=null;this.state.maybeInArrowParameters=!0,this.next();let o=this.startNodeAt(e);o.callee=n;let{maybeAsyncArrow:l,optionalChainMember:c}=t;l&&(this.expressionScope.enter(al()),a=new ct),c&&(o.optional=r),r?o.arguments=this.parseCallExpressionArguments(11):o.arguments=this.parseCallExpressionArguments(11,n.type==="Import",n.type!=="Super",o,a);let p=this.finishCallExpression(o,c);return l&&this.shouldParseAsyncArrow()&&!r?(t.stop=!0,this.checkDestructuringPrivate(a),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),p=this.parseAsyncArrowFromCallExpression(this.startNodeAt(e),p)):(l&&(this.checkExpressionErrors(a,!0),this.expressionScope.exit()),this.toReferencedArguments(p)),this.state.maybeInArrowParameters=i,p}toReferencedArguments(n,e){this.toReferencedListDeep(n.arguments,e)}parseTaggedTemplateExpression(n,e,t){let r=this.startNodeAt(e);return r.tag=n,r.quasi=this.parseTemplate(!0),t.optionalChainMember&&this.raise(b.OptionalChainingNoTemplate,{at:e}),this.finishNode(r,"TaggedTemplateExpression")}atPossibleAsyncArrow(n){return n.type==="Identifier"&&n.name==="async"&&this.state.lastTokEndLoc.index===n.end&&!this.canInsertSemicolon()&&n.end-n.start===5&&n.start===this.state.potentialArrowAt}expectImportAttributesPlugin(){this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes")}finishCallExpression(n,e){if(n.callee.type==="Import")if(n.arguments.length===2&&(this.hasPlugin("moduleAttributes")||this.expectImportAttributesPlugin()),n.arguments.length===0||n.arguments.length>2)this.raise(b.ImportCallArity,{at:n,maxArgumentCount:this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions")||this.hasPlugin("moduleAttributes")?2:1});else for(let t of n.arguments)t.type==="SpreadElement"&&this.raise(b.ImportCallSpreadArgument,{at:t});return this.finishNode(n,e?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(n,e,t,r,i){let a=[],o=!0,l=this.state.inFSharpPipelineDirectBody;for(this.state.inFSharpPipelineDirectBody=!1;!this.eat(n);){if(o)o=!1;else if(this.expect(12),this.match(n)){e&&!this.hasPlugin("importAttributes")&&!this.hasPlugin("importAssertions")&&!this.hasPlugin("moduleAttributes")&&this.raise(b.ImportCallArgumentTrailingComma,{at:this.state.lastTokStartLoc}),r&&this.addTrailingCommaExtraToNode(r),this.next();break}a.push(this.parseExprListItem(!1,i,t))}return this.state.inFSharpPipelineDirectBody=l,a}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(n,e){var t;return this.resetPreviousNodeTrailingComments(e),this.expect(19),this.parseArrowExpression(n,e.arguments,!0,(t=e.extra)==null?void 0:t.trailingCommaLoc),e.innerComments&&Ut(n,e.innerComments),e.callee.trailingComments&&Ut(n,e.callee.trailingComments),n}parseNoCallExpr(){let n=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),n,!0)}parseExprAtom(n){let e,t=null,{type:r}=this.state;switch(r){case 79:return this.parseSuper();case 83:return e=this.startNode(),this.next(),this.match(16)?this.parseImportMetaProperty(e):this.match(10)?this.options.createImportExpressions?this.parseImportCall(e):this.finishNode(e,"Import"):(this.raise(b.UnsupportedImport,{at:this.state.lastTokStartLoc}),this.finishNode(e,"Import"));case 78:return e=this.startNode(),this.next(),this.finishNode(e,"ThisExpression");case 90:return this.parseDo(this.startNode(),!1);case 56:case 31:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 134:return this.parseNumericLiteral(this.state.value);case 135:return this.parseBigIntLiteral(this.state.value);case 136:return this.parseDecimalLiteral(this.state.value);case 133:return this.parseStringLiteral(this.state.value);case 84:return this.parseNullLiteral();case 85:return this.parseBooleanLiteral(!0);case 86:return this.parseBooleanLiteral(!1);case 10:{let i=this.state.potentialArrowAt===this.state.start;return this.parseParenAndDistinguishExpression(i)}case 2:case 1:return this.parseArrayLike(this.state.type===2?4:3,!1,!0);case 0:return this.parseArrayLike(3,!0,!1,n);case 6:case 7:return this.parseObjectLike(this.state.type===6?9:8,!1,!0);case 5:return this.parseObjectLike(8,!1,!1,n);case 68:return this.parseFunctionOrFunctionSent();case 26:t=this.parseDecorators();case 80:return this.parseClass(this.maybeTakeDecorators(t,this.startNode()),!1);case 77:return this.parseNewOrNewTarget();case 25:case 24:return this.parseTemplate(!1);case 15:{e=this.startNode(),this.next(),e.object=null;let i=e.callee=this.parseNoCallExpr();if(i.type==="MemberExpression")return this.finishNode(e,"BindExpression");throw this.raise(b.UnsupportedBind,{at:i})}case 138:return this.raise(b.PrivateInExpectedIn,{at:this.state.startLoc,identifierName:this.state.value}),this.parsePrivateName();case 33:return this.parseTopicReferenceThenEqualsSign(54,"%");case 32:return this.parseTopicReferenceThenEqualsSign(44,"^");case 37:case 38:return this.parseTopicReference("hack");case 44:case 54:case 27:{let i=this.getPluginOption("pipelineOperator","proposal");if(i)return this.parseTopicReference(i);this.unexpected();break}case 47:{let i=this.input.codePointAt(this.nextTokenStart());_e(i)||i===62?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected();break}default:if(R(r)){if(this.isContextual(127)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let i=this.state.potentialArrowAt===this.state.start,a=this.state.containsEsc,o=this.parseIdentifier();if(!a&&o.name==="async"&&!this.canInsertSemicolon()){let{type:l}=this.state;if(l===68)return this.resetPreviousNodeTrailingComments(o),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(o));if(R(l))return this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(o)):o;if(l===90)return this.resetPreviousNodeTrailingComments(o),this.parseDo(this.startNodeAtNode(o),!0)}return i&&this.match(19)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(o),[o],!1)):o}else this.unexpected()}}parseTopicReferenceThenEqualsSign(n,e){let t=this.getPluginOption("pipelineOperator","proposal");if(t)return this.state.type=n,this.state.value=e,this.state.pos--,this.state.end--,this.state.endLoc=se(this.state.endLoc,-1),this.parseTopicReference(t);this.unexpected()}parseTopicReference(n){let e=this.startNode(),t=this.state.startLoc,r=this.state.type;return this.next(),this.finishTopicReference(e,t,n,r)}finishTopicReference(n,e,t,r){if(this.testTopicReferenceConfiguration(t,e,r)){let i=t==="smart"?"PipelinePrimaryTopicReference":"TopicReference";return this.topicReferenceIsAllowedInCurrentContext()||this.raise(t==="smart"?b.PrimaryTopicNotAllowed:b.PipeTopicUnbound,{at:e}),this.registerTopicReference(),this.finishNode(n,i)}else throw this.raise(b.PipeTopicUnconfiguredToken,{at:e,token:qe(r)})}testTopicReferenceConfiguration(n,e,t){switch(n){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:qe(t)}]);case"smart":return t===27;default:throw this.raise(b.PipeTopicRequiresHackPipes,{at:e})}}parseAsyncArrowUnaryFunction(n){this.prodParam.enter(yn(!0,this.prodParam.hasYield));let e=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(b.LineTerminatorBeforeArrow,{at:this.state.curPosition()}),this.expect(19),this.parseArrowExpression(n,e,!0)}parseDo(n,e){this.expectPlugin("doExpressions"),e&&this.expectPlugin("asyncDoExpressions"),n.async=e,this.next();let t=this.state.labels;return this.state.labels=[],e?(this.prodParam.enter(2),n.body=this.parseBlock(),this.prodParam.exit()):n.body=this.parseBlock(),this.state.labels=t,this.finishNode(n,"DoExpression")}parseSuper(){let n=this.startNode();return this.next(),this.match(10)&&!this.scope.allowDirectSuper&&!this.options.allowSuperOutsideMethod?this.raise(b.SuperNotAllowed,{at:n}):!this.scope.allowSuper&&!this.options.allowSuperOutsideMethod&&this.raise(b.UnexpectedSuper,{at:n}),!this.match(10)&&!this.match(0)&&!this.match(16)&&this.raise(b.UnsupportedSuper,{at:n}),this.finishNode(n,"Super")}parsePrivateName(){let n=this.startNode(),e=this.startNodeAt(se(this.state.startLoc,1)),t=this.state.value;return this.next(),n.id=this.createIdentifier(e,t),this.finishNode(n,"PrivateName")}parseFunctionOrFunctionSent(){let n=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(n),"function");return this.next(),this.match(103)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected(),this.parseMetaProperty(n,e,"sent")}return this.parseFunction(n)}parseMetaProperty(n,e,t){n.meta=e;let r=this.state.containsEsc;return n.property=this.parseIdentifier(!0),(n.property.name!==t||r)&&this.raise(b.UnsupportedMetaProperty,{at:n.property,target:e.name,onlyValidPropertyName:t}),this.finishNode(n,"MetaProperty")}parseImportMetaProperty(n){let e=this.createIdentifier(this.startNodeAtNode(n),"import");if(this.next(),this.isContextual(101))this.inModule||this.raise(b.ImportMetaOutsideModule,{at:e}),this.sawUnambiguousESM=!0;else if(this.isContextual(105)||this.isContextual(97)){let t=this.isContextual(105);if(t||this.unexpected(),this.expectPlugin(t?"sourcePhaseImports":"deferredImportEvaluation"),!this.options.createImportExpressions)throw this.raise(b.DynamicImportPhaseRequiresImportExpressions,{at:this.state.startLoc,phase:this.state.value});return this.next(),n.phase=t?"source":"defer",this.parseImportCall(n)}return this.parseMetaProperty(n,e,"meta")}parseLiteralAtNode(n,e,t){return this.addExtra(t,"rawValue",n),this.addExtra(t,"raw",this.input.slice(t.start,this.state.end)),t.value=n,this.next(),this.finishNode(t,e)}parseLiteral(n,e){let t=this.startNode();return this.parseLiteralAtNode(n,e,t)}parseStringLiteral(n){return this.parseLiteral(n,"StringLiteral")}parseNumericLiteral(n){return this.parseLiteral(n,"NumericLiteral")}parseBigIntLiteral(n){return this.parseLiteral(n,"BigIntLiteral")}parseDecimalLiteral(n){return this.parseLiteral(n,"DecimalLiteral")}parseRegExpLiteral(n){let e=this.parseLiteral(n.value,"RegExpLiteral");return e.pattern=n.pattern,e.flags=n.flags,e}parseBooleanLiteral(n){let e=this.startNode();return e.value=n,this.next(),this.finishNode(e,"BooleanLiteral")}parseNullLiteral(){let n=this.startNode();return this.next(),this.finishNode(n,"NullLiteral")}parseParenAndDistinguishExpression(n){let e=this.state.startLoc,t;this.next(),this.expressionScope.enter(il());let r=this.state.maybeInArrowParameters,i=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;let a=this.state.startLoc,o=[],l=new ct,c=!0,p,u;for(;!this.match(11);){if(c)c=!1;else if(this.expect(12,l.optionalParametersLoc===null?null:l.optionalParametersLoc),this.match(11)){u=this.state.startLoc;break}if(this.match(21)){let d=this.state.startLoc;if(p=this.state.startLoc,o.push(this.parseParenItem(this.parseRestBinding(),d)),!this.checkCommaAfterRest(41))break}else o.push(this.parseMaybeAssignAllowIn(l,this.parseParenItem))}let h=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=r,this.state.inFSharpPipelineDirectBody=i;let m=this.startNodeAt(e);return n&&this.shouldParseArrow(o)&&(m=this.parseArrow(m))?(this.checkDestructuringPrivate(l),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(m,o,!1),m):(this.expressionScope.exit(),o.length||this.unexpected(this.state.lastTokStartLoc),u&&this.unexpected(u),p&&this.unexpected(p),this.checkExpressionErrors(l,!0),this.toReferencedListDeep(o,!0),o.length>1?(t=this.startNodeAt(a),t.expressions=o,this.finishNode(t,"SequenceExpression"),this.resetEndLocation(t,h)):t=o[0],this.wrapParenthesis(e,t))}wrapParenthesis(n,e){if(!this.options.createParenthesizedExpressions)return this.addExtra(e,"parenthesized",!0),this.addExtra(e,"parenStart",n.index),this.takeSurroundingComments(e,n.index,this.state.lastTokEndLoc.index),e;let t=this.startNodeAt(n);return t.expression=e,this.finishNode(t,"ParenthesizedExpression")}shouldParseArrow(n){return!this.canInsertSemicolon()}parseArrow(n){if(this.eat(19))return n}parseParenItem(n,e){return n}parseNewOrNewTarget(){let n=this.startNode();if(this.next(),this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(n),"new");this.next();let t=this.parseMetaProperty(n,e,"target");return!this.scope.inNonArrowFunction&&!this.scope.inClass&&!this.options.allowNewTargetOutsideFunction&&this.raise(b.UnexpectedNewTarget,{at:t}),t}return this.parseNew(n)}parseNew(n){if(this.parseNewCallee(n),this.eat(10)){let e=this.parseExprList(11);this.toReferencedList(e),n.arguments=e}else n.arguments=[];return this.finishNode(n,"NewExpression")}parseNewCallee(n){let e=this.match(83),t=this.parseNoCallExpr();n.callee=t,e&&(t.type==="Import"||t.type==="ImportExpression")&&this.raise(b.ImportCallNotNewExpression,{at:t})}parseTemplateElement(n){let{start:e,startLoc:t,end:r,value:i}=this.state,a=e+1,o=this.startNodeAt(se(t,1));i===null&&(n||this.raise(b.InvalidEscapeSequenceTemplate,{at:se(this.state.firstInvalidTemplateEscapePos,1)}));let l=this.match(24),c=l?-1:-2,p=r+c;o.value={raw:this.input.slice(a,p).replace(/\r\n?/g,`
|
|
9
|
-
`),cooked:i===null?null:i.slice(1,c)},o.tail=l,this.next();let u=this.finishNode(o,"TemplateElement");return this.resetEndLocation(u,se(this.state.lastTokEndLoc,c)),u}parseTemplate(n){let e=this.startNode();e.expressions=[];let t=this.parseTemplateElement(n);for(e.quasis=[t];!t.tail;)e.expressions.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),e.quasis.push(t=this.parseTemplateElement(n));return this.finishNode(e,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(n,e,t,r){t&&this.expectPlugin("recordAndTuple");let i=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let a=Object.create(null),o=!0,l=this.startNode();for(l.properties=[],this.next();!this.match(n);){if(o)o=!1;else if(this.expect(12),this.match(n)){this.addTrailingCommaExtraToNode(l);break}let p;e?p=this.parseBindingProperty():(p=this.parsePropertyDefinition(r),this.checkProto(p,t,a,r)),t&&!this.isObjectProperty(p)&&p.type!=="SpreadElement"&&this.raise(b.InvalidRecordProperty,{at:p}),p.shorthand&&this.addExtra(p,"shorthand",!0),l.properties.push(p)}this.next(),this.state.inFSharpPipelineDirectBody=i;let c="ObjectExpression";return e?c="ObjectPattern":t&&(c="RecordExpression"),this.finishNode(l,c)}addTrailingCommaExtraToNode(n){this.addExtra(n,"trailingComma",this.state.lastTokStart),this.addExtra(n,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(n){return!n.computed&&n.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(n){let e=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(b.UnsupportedPropertyDecorator,{at:this.state.startLoc});this.match(26);)e.push(this.parseDecorator());let t=this.startNode(),r=!1,i=!1,a;if(this.match(21))return e.length&&this.unexpected(),this.parseSpread();e.length&&(t.decorators=e,e=[]),t.method=!1,n&&(a=this.state.startLoc);let o=this.eat(55);this.parsePropertyNamePrefixOperator(t);let l=this.state.containsEsc,c=this.parsePropertyName(t,n);if(!o&&!l&&this.maybeAsyncOrAccessorProp(t)){let p=c.name;p==="async"&&!this.hasPrecedingLineBreak()&&(r=!0,this.resetPreviousNodeTrailingComments(c),o=this.eat(55),this.parsePropertyName(t)),(p==="get"||p==="set")&&(i=!0,this.resetPreviousNodeTrailingComments(c),t.kind=p,this.match(55)&&(o=!0,this.raise(b.AccessorIsGenerator,{at:this.state.curPosition(),kind:p}),this.next()),this.parsePropertyName(t))}return this.parseObjPropValue(t,a,o,r,!1,i,n)}getGetterSetterExpectedParamCount(n){return n.kind==="get"?0:1}getObjectOrClassMethodParams(n){return n.params}checkGetterSetterParams(n){var e;let t=this.getGetterSetterExpectedParamCount(n),r=this.getObjectOrClassMethodParams(n);r.length!==t&&this.raise(n.kind==="get"?b.BadGetterArity:b.BadSetterArity,{at:n}),n.kind==="set"&&((e=r[r.length-1])==null?void 0:e.type)==="RestElement"&&this.raise(b.BadSetterRestParameter,{at:n})}parseObjectMethod(n,e,t,r,i){if(i){let a=this.parseMethod(n,e,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(a),a}if(t||e||this.match(10))return r&&this.unexpected(),n.kind="method",n.method=!0,this.parseMethod(n,e,t,!1,!1,"ObjectMethod")}parseObjectProperty(n,e,t,r){if(n.shorthand=!1,this.eat(14))return n.value=t?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowIn(r),this.finishNode(n,"ObjectProperty");if(!n.computed&&n.key.type==="Identifier"){if(this.checkReservedWord(n.key.name,n.key.loc.start,!0,!1),t)n.value=this.parseMaybeDefault(e,Be(n.key));else if(this.match(29)){let i=this.state.startLoc;r!=null?r.shorthandAssignLoc===null&&(r.shorthandAssignLoc=i):this.raise(b.InvalidCoverInitializedName,{at:i}),n.value=this.parseMaybeDefault(e,Be(n.key))}else n.value=Be(n.key);return n.shorthand=!0,this.finishNode(n,"ObjectProperty")}}parseObjPropValue(n,e,t,r,i,a,o){let l=this.parseObjectMethod(n,t,r,i,a)||this.parseObjectProperty(n,e,i,o);return l||this.unexpected(),l}parsePropertyName(n,e){if(this.eat(0))n.computed=!0,n.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let{type:t,value:r}=this.state,i;if(xe(t))i=this.parseIdentifier(!0);else switch(t){case 134:i=this.parseNumericLiteral(r);break;case 133:i=this.parseStringLiteral(r);break;case 135:i=this.parseBigIntLiteral(r);break;case 136:i=this.parseDecimalLiteral(r);break;case 138:{let a=this.state.startLoc;e!=null?e.privateKeyLoc===null&&(e.privateKeyLoc=a):this.raise(b.UnexpectedPrivateField,{at:a}),i=this.parsePrivateName();break}default:this.unexpected()}n.key=i,t!==138&&(n.computed=!1)}return n.key}initFunction(n,e){n.id=null,n.generator=!1,n.async=e}parseMethod(n,e,t,r,i,a,o=!1){this.initFunction(n,t),n.generator=e,this.scope.enter(18|(o?64:0)|(i?32:0)),this.prodParam.enter(yn(t,n.generator)),this.parseFunctionParams(n,r);let l=this.parseFunctionBodyAndFinish(n,a,!0);return this.prodParam.exit(),this.scope.exit(),l}parseArrayLike(n,e,t,r){t&&this.expectPlugin("recordAndTuple");let i=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let a=this.startNode();return this.next(),a.elements=this.parseExprList(n,!t,r,a),this.state.inFSharpPipelineDirectBody=i,this.finishNode(a,t?"TupleExpression":"ArrayExpression")}parseArrowExpression(n,e,t,r){this.scope.enter(6);let i=yn(t,!1);!this.match(5)&&this.prodParam.hasIn&&(i|=8),this.prodParam.enter(i),this.initFunction(n,t);let a=this.state.maybeInArrowParameters;return e&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(n,e,r)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(n,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=a,this.finishNode(n,"ArrowFunctionExpression")}setArrowFunctionParameters(n,e,t){this.toAssignableList(e,t,!1),n.params=e}parseFunctionBodyAndFinish(n,e,t=!1){return this.parseFunctionBody(n,!1,t),this.finishNode(n,e)}parseFunctionBody(n,e,t=!1){let r=e&&!this.match(5);if(this.expressionScope.enter(yi()),r)n.body=this.parseMaybeAssign(),this.checkParams(n,!1,e,!1);else{let i=this.state.strict,a=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),n.body=this.parseBlock(!0,!1,o=>{let l=!this.isSimpleParamList(n.params);o&&l&&this.raise(b.IllegalLanguageModeDirective,{at:(n.kind==="method"||n.kind==="constructor")&&n.key?n.key.loc.end:n});let c=!i&&this.state.strict;this.checkParams(n,!this.state.strict&&!e&&!t&&!l,e,c),this.state.strict&&n.id&&this.checkIdentifier(n.id,65,c)}),this.prodParam.exit(),this.state.labels=a}this.expressionScope.exit()}isSimpleParameter(n){return n.type==="Identifier"}isSimpleParamList(n){for(let e=0,t=n.length;e<t;e++)if(!this.isSimpleParameter(n[e]))return!1;return!0}checkParams(n,e,t,r=!0){let i=!e&&new Set,a={type:"FormalParameters"};for(let o of n.params)this.checkLVal(o,{in:a,binding:5,checkClashes:i,strictModeChanged:r})}parseExprList(n,e,t,r){let i=[],a=!0;for(;!this.eat(n);){if(a)a=!1;else if(this.expect(12),this.match(n)){r&&this.addTrailingCommaExtraToNode(r),this.next();break}i.push(this.parseExprListItem(e,t))}return i}parseExprListItem(n,e,t){let r;if(this.match(12))n||this.raise(b.UnexpectedToken,{at:this.state.curPosition(),unexpected:","}),r=null;else if(this.match(21)){let i=this.state.startLoc;r=this.parseParenItem(this.parseSpread(e),i)}else if(this.match(17)){this.expectPlugin("partialApplication"),t||this.raise(b.UnexpectedArgumentPlaceholder,{at:this.state.startLoc});let i=this.startNode();this.next(),r=this.finishNode(i,"ArgumentPlaceholder")}else r=this.parseMaybeAssignAllowIn(e,this.parseParenItem);return r}parseIdentifier(n){let e=this.startNode(),t=this.parseIdentifierName(n);return this.createIdentifier(e,t)}createIdentifier(n,e){return n.name=e,n.loc.identifierName=e,this.finishNode(n,"Identifier")}parseIdentifierName(n){let e,{startLoc:t,type:r}=this.state;xe(r)?e=this.state.value:this.unexpected();let i=No(r);return n?i&&this.replaceToken(132):this.checkReservedWord(e,t,i,!1),this.next(),e}checkReservedWord(n,e,t,r){if(n.length>10||!Jo(n))return;if(t&&Wo(n)){this.raise(b.UnexpectedKeyword,{at:e,keyword:n});return}if((this.state.strict?r?di:pi:ci)(n,this.inModule)){this.raise(b.UnexpectedReservedWord,{at:e,reservedWord:n});return}else if(n==="yield"){if(this.prodParam.hasYield){this.raise(b.YieldBindingIdentifier,{at:e});return}}else if(n==="await"){if(this.prodParam.hasAwait){this.raise(b.AwaitBindingIdentifier,{at:e});return}if(this.scope.inStaticBlock){this.raise(b.AwaitBindingIdentifierInStaticBlock,{at:e});return}this.expressionScope.recordAsyncArrowParametersError({at:e})}else if(n==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(b.ArgumentsInClass,{at:e});return}}isAwaitAllowed(){return!!(this.prodParam.hasAwait||this.options.allowAwaitOutsideFunction&&!this.scope.inFunction)}parseAwait(n){let e=this.startNodeAt(n);return this.expressionScope.recordParameterInitializerError(b.AwaitExpressionFormalParameter,{at:e}),this.eat(55)&&this.raise(b.ObsoleteAwaitStar,{at:e}),!this.scope.inFunction&&!this.options.allowAwaitOutsideFunction&&(this.isAmbiguousAwait()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),this.state.soloAwait||(e.argument=this.parseMaybeUnary(null,!0)),this.finishNode(e,"AwaitExpression")}isAmbiguousAwait(){if(this.hasPrecedingLineBreak())return!0;let{type:n}=this.state;return n===53||n===10||n===0||xn(n)||n===102&&!this.state.containsEsc||n===137||n===56||this.hasPlugin("v8intrinsic")&&n===54}parseYield(){let n=this.startNode();this.expressionScope.recordParameterInitializerError(b.YieldInParameter,{at:n}),this.next();let e=!1,t=null;if(!this.hasPrecedingLineBreak())switch(e=this.eat(55),this.state.type){case 13:case 139:case 8:case 11:case 3:case 9:case 14:case 12:if(!e)break;default:t=this.parseMaybeAssign()}return n.delegate=e,n.argument=t,this.finishNode(n,"YieldExpression")}parseImportCall(n){return this.next(),n.source=this.parseMaybeAssignAllowIn(),(this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions"))&&(n.options=null),this.eat(12)&&(this.expectImportAttributesPlugin(),this.match(11)||(n.options=this.parseMaybeAssignAllowIn(),this.eat(12))),this.expect(11),this.finishNode(n,"ImportExpression")}checkPipelineAtInfixOperator(n,e){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&n.type==="SequenceExpression"&&this.raise(b.PipelineHeadSequenceExpression,{at:e})}parseSmartPipelineBodyInStyle(n,e){if(this.isSimpleReference(n)){let t=this.startNodeAt(e);return t.callee=n,this.finishNode(t,"PipelineBareFunction")}else{let t=this.startNodeAt(e);return this.checkSmartPipeTopicBodyEarlyErrors(e),t.expression=n,this.finishNode(t,"PipelineTopicExpression")}}isSimpleReference(n){switch(n.type){case"MemberExpression":return!n.computed&&this.isSimpleReference(n.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(n){if(this.match(19))throw this.raise(b.PipelineBodyNoArrow,{at:this.state.startLoc});this.topicReferenceWasUsedInCurrentContext()||this.raise(b.PipelineTopicUnused,{at:n})}withTopicBindingContext(n){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return n()}finally{this.state.topicContext=e}}withSmartMixTopicForbiddingContext(n){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return n()}finally{this.state.topicContext=e}}else return n()}withSoloAwaitPermittingContext(n){let e=this.state.soloAwait;this.state.soloAwait=!0;try{return n()}finally{this.state.soloAwait=e}}allowInAnd(n){let e=this.prodParam.currentFlags();if(8&~e){this.prodParam.enter(e|8);try{return n()}finally{this.prodParam.exit()}}return n()}disallowInAnd(n){let e=this.prodParam.currentFlags();if(8&e){this.prodParam.enter(e&-9);try{return n()}finally{this.prodParam.exit()}}return n()}registerTopicReference(){this.state.topicContext.maxTopicIndex=0}topicReferenceIsAllowedInCurrentContext(){return this.state.topicContext.maxNumOfResolvableTopics>=1}topicReferenceWasUsedInCurrentContext(){return this.state.topicContext.maxTopicIndex!=null&&this.state.topicContext.maxTopicIndex>=0}parseFSharpPipelineBody(n){let e=this.state.startLoc;this.state.potentialArrowAt=this.state.start;let t=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;let r=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),e,n);return this.state.inFSharpPipelineDirectBody=t,r}parseModuleExpression(){this.expectPlugin("moduleBlocks");let n=this.startNode();this.next(),this.match(5)||this.unexpected(null,5);let e=this.startNodeAt(this.state.endLoc);this.next();let t=this.initializeScopes(!0);this.enterInitialScopes();try{n.body=this.parseProgram(e,8,"module")}finally{t()}return this.finishNode(n,"ModuleExpression")}parsePropertyNamePrefixOperator(n){}},dr={kind:"loop"},Ml={kind:"switch"},Dl=/[\uD800-\uDFFF]/u,hr=/in(?:stanceof)?/y;function Ll(s,n){for(let e=0;e<s.length;e++){let t=s[e],{type:r}=t;if(typeof r=="number"){{if(r===138){let{loc:i,start:a,value:o,end:l}=t,c=a+1,p=se(i.start,1);s.splice(e,1,new Ae({type:Oe(27),value:"#",start:a,end:c,startLoc:i.start,endLoc:p}),new Ae({type:Oe(132),value:o,start:c,end:l,startLoc:p,endLoc:i.end})),e++;continue}if(xn(r)){let{loc:i,start:a,value:o,end:l}=t,c=a+1,p=se(i.start,1),u;n.charCodeAt(a)===96?u=new Ae({type:Oe(22),value:"`",start:a,end:c,startLoc:i.start,endLoc:p}):u=new Ae({type:Oe(8),value:"}",start:a,end:c,startLoc:i.start,endLoc:p});let h,m,d,y;r===24?(m=l-1,d=se(i.end,-1),h=o===null?null:o.slice(1,-1),y=new Ae({type:Oe(22),value:"`",start:m,end:l,startLoc:d,endLoc:i.end})):(m=l-2,d=se(i.end,-2),h=o===null?null:o.slice(1,-2),y=new Ae({type:Oe(23),value:"${",start:m,end:l,startLoc:d,endLoc:i.end})),s.splice(e,1,u,new Ae({type:Oe(20),value:h,start:c,end:m,startLoc:p,endLoc:d}),y),e+=2;continue}}t.type=Oe(r)}}return s}var Lr=class extends Dr{parseTopLevel(n,e){return n.program=this.parseProgram(e),n.comments=this.state.comments,this.options.tokens&&(n.tokens=Ll(this.tokens,this.input)),this.finishNode(n,"File")}parseProgram(n,e=139,t=this.options.sourceType){if(n.sourceType=t,n.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(n,!0,!0,e),this.inModule&&!this.options.allowUndeclaredExports&&this.scope.undefinedExports.size>0)for(let[i,a]of Array.from(this.scope.undefinedExports))this.raise(b.ModuleExportUndefined,{at:a,localName:i});let r;return e===139?r=this.finishNode(n,"Program"):r=this.finishNodeAt(n,"Program",se(this.state.startLoc,-1)),r}stmtToDirective(n){let e=n;e.type="Directive",e.value=e.expression,delete e.expression;let t=e.value,r=t.value,i=this.input.slice(t.start,t.end),a=t.value=i.slice(1,-1);return this.addExtra(t,"raw",i),this.addExtra(t,"rawValue",a),this.addExtra(t,"expressionValue",r),t.type="DirectiveLiteral",e}parseInterpreterDirective(){if(!this.match(28))return null;let n=this.startNode();return n.value=this.state.value,this.next(),this.finishNode(n,"InterpreterDirective")}isLet(){return this.isContextual(100)?this.hasFollowingBindingAtom():!1}chStartsBindingIdentifier(n,e){if(_e(n)){if(hr.lastIndex=e,hr.test(this.input)){let t=this.codePointAtPos(hr.lastIndex);if(!lt(t)&&t!==92)return!1}return!0}else return n===92}chStartsBindingPattern(n){return n===91||n===123}hasFollowingBindingAtom(){let n=this.nextTokenStart(),e=this.codePointAtPos(n);return this.chStartsBindingPattern(e)||this.chStartsBindingIdentifier(e,n)}hasInLineFollowingBindingIdentifier(){let n=this.nextTokenInLineStart(),e=this.codePointAtPos(n);return this.chStartsBindingIdentifier(e,n)}startsUsingForOf(){let{type:n,containsEsc:e}=this.lookahead();if(n===102&&!e)return!1;if(R(n)&&!this.hasFollowingLineBreak())return this.expectPlugin("explicitResourceManagement"),!0}startsAwaitUsing(){let n=this.nextTokenInLineStart();if(this.isUnparsedContextual(n,"using")){n=this.nextTokenInLineStartSince(n+5);let e=this.codePointAtPos(n);if(this.chStartsBindingIdentifier(e,n))return this.expectPlugin("explicitResourceManagement"),!0}return!1}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(n=!1){let e=0;return this.options.annexB&&!this.state.strict&&(e|=4,n&&(e|=8)),this.parseStatementLike(e)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(n){let e=null;return this.match(26)&&(e=this.parseDecorators(!0)),this.parseStatementContent(n,e)}parseStatementContent(n,e){let t=this.state.type,r=this.startNode(),i=!!(n&2),a=!!(n&4),o=n&1;switch(t){case 60:return this.parseBreakContinueStatement(r,!0);case 63:return this.parseBreakContinueStatement(r,!1);case 64:return this.parseDebuggerStatement(r);case 90:return this.parseDoWhileStatement(r);case 91:return this.parseForStatement(r);case 68:if(this.lookaheadCharCode()===46)break;return a||this.raise(this.state.strict?b.StrictFunction:this.options.annexB?b.SloppyFunctionAnnexB:b.SloppyFunction,{at:this.state.startLoc}),this.parseFunctionStatement(r,!1,!i&&a);case 80:return i||this.unexpected(),this.parseClass(this.maybeTakeDecorators(e,r),!0);case 69:return this.parseIfStatement(r);case 70:return this.parseReturnStatement(r);case 71:return this.parseSwitchStatement(r);case 72:return this.parseThrowStatement(r);case 73:return this.parseTryStatement(r);case 96:if(!this.state.containsEsc&&this.startsAwaitUsing())return this.isAwaitAllowed()?i||this.raise(b.UnexpectedLexicalDeclaration,{at:r}):this.raise(b.AwaitUsingNotInAsyncContext,{at:r}),this.next(),this.parseVarStatement(r,"await using");break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifier())break;return this.expectPlugin("explicitResourceManagement"),!this.scope.inModule&&this.scope.inTopLevel?this.raise(b.UnexpectedUsingDeclaration,{at:this.state.startLoc}):i||this.raise(b.UnexpectedLexicalDeclaration,{at:this.state.startLoc}),this.parseVarStatement(r,"using");case 100:{if(this.state.containsEsc)break;let p=this.nextTokenStart(),u=this.codePointAtPos(p);if(u!==91&&(!i&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(u,p)&&u!==123))break}case 75:i||this.raise(b.UnexpectedLexicalDeclaration,{at:this.state.startLoc});case 74:{let p=this.state.value;return this.parseVarStatement(r,p)}case 92:return this.parseWhileStatement(r);case 76:return this.parseWithStatement(r);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(r);case 83:{let p=this.lookaheadCharCode();if(p===40||p===46)break}case 82:{!this.options.allowImportExportEverywhere&&!o&&this.raise(b.UnexpectedImportExport,{at:this.state.startLoc}),this.next();let p;return t===83?(p=this.parseImport(r),p.type==="ImportDeclaration"&&(!p.importKind||p.importKind==="value")&&(this.sawUnambiguousESM=!0)):(p=this.parseExport(r,e),(p.type==="ExportNamedDeclaration"&&(!p.exportKind||p.exportKind==="value")||p.type==="ExportAllDeclaration"&&(!p.exportKind||p.exportKind==="value")||p.type==="ExportDefaultDeclaration")&&(this.sawUnambiguousESM=!0)),this.assertModuleNodeAllowed(p),p}default:if(this.isAsyncFunction())return i||this.raise(b.AsyncFunctionInSingleStatementContext,{at:this.state.startLoc}),this.next(),this.parseFunctionStatement(r,!0,!i&&a)}let l=this.state.value,c=this.parseExpression();return R(t)&&c.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(r,l,c,n):this.parseExpressionStatement(r,c,e)}assertModuleNodeAllowed(n){!this.options.allowImportExportEverywhere&&!this.inModule&&this.raise(b.ImportOutsideModule,{at:n})}decoratorsEnabledBeforeExport(){return this.hasPlugin("decorators-legacy")?!0:this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(n,e,t){return n&&(e.decorators&&e.decorators.length>0?(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!="boolean"&&this.raise(b.DecoratorsBeforeAfterExport,{at:e.decorators[0]}),e.decorators.unshift(...n)):e.decorators=n,this.resetStartLocationFromNode(e,n[0]),t&&this.resetStartLocationFromNode(t,e)),e}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(n){let e=[];do e.push(this.parseDecorator());while(this.match(26));if(this.match(82))n||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(b.DecoratorExportClass,{at:this.state.startLoc});else if(!this.canHaveLeadingDecorator())throw this.raise(b.UnexpectedLeadingDecorator,{at:this.state.startLoc});return e}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let n=this.startNode();if(this.next(),this.hasPlugin("decorators")){let e=this.state.startLoc,t;if(this.match(10)){let r=this.state.startLoc;this.next(),t=this.parseExpression(),this.expect(11),t=this.wrapParenthesis(r,t);let i=this.state.startLoc;n.expression=this.parseMaybeDecoratorArguments(t),this.getPluginOption("decorators","allowCallParenthesized")===!1&&n.expression!==t&&this.raise(b.DecoratorArgumentsOutsideParentheses,{at:i})}else{for(t=this.parseIdentifier(!1);this.eat(16);){let r=this.startNodeAt(e);r.object=t,this.match(138)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),r.property=this.parsePrivateName()):r.property=this.parseIdentifier(!0),r.computed=!1,t=this.finishNode(r,"MemberExpression")}n.expression=this.parseMaybeDecoratorArguments(t)}}else n.expression=this.parseExprSubscripts();return this.finishNode(n,"Decorator")}parseMaybeDecoratorArguments(n){if(this.eat(10)){let e=this.startNodeAtNode(n);return e.callee=n,e.arguments=this.parseCallExpressionArguments(11,!1),this.toReferencedList(e.arguments),this.finishNode(e,"CallExpression")}return n}parseBreakContinueStatement(n,e){return this.next(),this.isLineTerminator()?n.label=null:(n.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(n,e),this.finishNode(n,e?"BreakStatement":"ContinueStatement")}verifyBreakContinue(n,e){let t;for(t=0;t<this.state.labels.length;++t){let r=this.state.labels[t];if((n.label==null||r.name===n.label.name)&&(r.kind!=null&&(e||r.kind==="loop")||n.label&&e))break}if(t===this.state.labels.length){let r=e?"BreakStatement":"ContinueStatement";this.raise(b.IllegalBreakContinue,{at:n,type:r})}}parseDebuggerStatement(n){return this.next(),this.semicolon(),this.finishNode(n,"DebuggerStatement")}parseHeaderExpression(){this.expect(10);let n=this.parseExpression();return this.expect(11),n}parseDoWhileStatement(n){return this.next(),this.state.labels.push(dr),n.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.expect(92),n.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(n,"DoWhileStatement")}parseForStatement(n){this.next(),this.state.labels.push(dr);let e=null;if(this.isAwaitAllowed()&&this.eatContextual(96)&&(e=this.state.lastTokStartLoc),this.scope.enter(0),this.expect(10),this.match(13))return e!==null&&this.unexpected(e),this.parseFor(n,null);let t=this.isContextual(100);{let l=this.isContextual(96)&&this.startsAwaitUsing(),c=l||this.isContextual(107)&&this.startsUsingForOf(),p=t&&this.hasFollowingBindingAtom()||c;if(this.match(74)||this.match(75)||p){let u=this.startNode(),h;l?(h="await using",this.isAwaitAllowed()||this.raise(b.AwaitUsingNotInAsyncContext,{at:this.state.startLoc}),this.next()):h=this.state.value,this.next(),this.parseVar(u,!0,h);let m=this.finishNode(u,"VariableDeclaration"),d=this.match(58);return d&&c&&this.raise(b.ForInUsing,{at:m}),(d||this.isContextual(102))&&m.declarations.length===1?this.parseForIn(n,m,e):(e!==null&&this.unexpected(e),this.parseFor(n,m))}}let r=this.isContextual(95),i=new ct,a=this.parseExpression(!0,i),o=this.isContextual(102);if(o&&(t&&this.raise(b.ForOfLet,{at:a}),e===null&&r&&a.type==="Identifier"&&this.raise(b.ForOfAsync,{at:a})),o||this.match(58)){this.checkDestructuringPrivate(i),this.toAssignable(a,!0);let l=o?"ForOfStatement":"ForInStatement";return this.checkLVal(a,{in:{type:l}}),this.parseForIn(n,a,e)}else this.checkExpressionErrors(i,!0);return e!==null&&this.unexpected(e),this.parseFor(n,a)}parseFunctionStatement(n,e,t){return this.next(),this.parseFunction(n,1|(t?2:0)|(e?8:0))}parseIfStatement(n){return this.next(),n.test=this.parseHeaderExpression(),n.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),n.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(n,"IfStatement")}parseReturnStatement(n){return!this.prodParam.hasReturn&&!this.options.allowReturnOutsideFunction&&this.raise(b.IllegalReturn,{at:this.state.startLoc}),this.next(),this.isLineTerminator()?n.argument=null:(n.argument=this.parseExpression(),this.semicolon()),this.finishNode(n,"ReturnStatement")}parseSwitchStatement(n){this.next(),n.discriminant=this.parseHeaderExpression();let e=n.cases=[];this.expect(5),this.state.labels.push(Ml),this.scope.enter(0);let t;for(let r;!this.match(8);)if(this.match(61)||this.match(65)){let i=this.match(61);t&&this.finishNode(t,"SwitchCase"),e.push(t=this.startNode()),t.consequent=[],this.next(),i?t.test=this.parseExpression():(r&&this.raise(b.MultipleDefaultsInSwitch,{at:this.state.lastTokStartLoc}),r=!0,t.test=null),this.expect(14)}else t?t.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(n,"SwitchStatement")}parseThrowStatement(n){return this.next(),this.hasPrecedingLineBreak()&&this.raise(b.NewlineAfterThrow,{at:this.state.lastTokEndLoc}),n.argument=this.parseExpression(),this.semicolon(),this.finishNode(n,"ThrowStatement")}parseCatchClauseParam(){let n=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&n.type==="Identifier"?8:0),this.checkLVal(n,{in:{type:"CatchClause"},binding:9}),n}parseTryStatement(n){if(this.next(),n.block=this.parseBlock(),n.handler=null,this.match(62)){let e=this.startNode();this.next(),this.match(10)?(this.expect(10),e.param=this.parseCatchClauseParam(),this.expect(11)):(e.param=null,this.scope.enter(0)),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),n.handler=this.finishNode(e,"CatchClause")}return n.finalizer=this.eat(67)?this.parseBlock():null,!n.handler&&!n.finalizer&&this.raise(b.NoCatchOrFinally,{at:n}),this.finishNode(n,"TryStatement")}parseVarStatement(n,e,t=!1){return this.next(),this.parseVar(n,!1,e,t),this.semicolon(),this.finishNode(n,"VariableDeclaration")}parseWhileStatement(n){return this.next(),n.test=this.parseHeaderExpression(),this.state.labels.push(dr),n.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(n,"WhileStatement")}parseWithStatement(n){return this.state.strict&&this.raise(b.StrictWith,{at:this.state.startLoc}),this.next(),n.object=this.parseHeaderExpression(),n.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(n,"WithStatement")}parseEmptyStatement(n){return this.next(),this.finishNode(n,"EmptyStatement")}parseLabeledStatement(n,e,t,r){for(let a of this.state.labels)a.name===e&&this.raise(b.LabelRedeclaration,{at:t,labelName:e});let i=Lo(this.state.type)?"loop":this.match(71)?"switch":null;for(let a=this.state.labels.length-1;a>=0;a--){let o=this.state.labels[a];if(o.statementStart===n.start)o.statementStart=this.state.start,o.kind=i;else break}return this.state.labels.push({name:e,kind:i,statementStart:this.state.start}),n.body=r&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),n.label=t,this.finishNode(n,"LabeledStatement")}parseExpressionStatement(n,e,t){return n.expression=e,this.semicolon(),this.finishNode(n,"ExpressionStatement")}parseBlock(n=!1,e=!0,t){let r=this.startNode();return n&&this.state.strictErrors.clear(),this.expect(5),e&&this.scope.enter(0),this.parseBlockBody(r,n,!1,8,t),e&&this.scope.exit(),this.finishNode(r,"BlockStatement")}isValidDirective(n){return n.type==="ExpressionStatement"&&n.expression.type==="StringLiteral"&&!n.expression.extra.parenthesized}parseBlockBody(n,e,t,r,i){let a=n.body=[],o=n.directives=[];this.parseBlockOrModuleBlockBody(a,e?o:void 0,t,r,i)}parseBlockOrModuleBlockBody(n,e,t,r,i){let a=this.state.strict,o=!1,l=!1;for(;!this.match(r);){let c=t?this.parseModuleItem():this.parseStatementListItem();if(e&&!l){if(this.isValidDirective(c)){let p=this.stmtToDirective(c);e.push(p),!o&&p.value.value==="use strict"&&(o=!0,this.setStrict(!0));continue}l=!0,this.state.strictErrors.clear()}n.push(c)}i?.call(this,o),a||this.setStrict(!1),this.next()}parseFor(n,e){return n.init=e,this.semicolon(!1),n.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),n.update=this.match(11)?null:this.parseExpression(),this.expect(11),n.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(n,"ForStatement")}parseForIn(n,e,t){let r=this.match(58);return this.next(),r?t!==null&&this.unexpected(t):n.await=t!==null,e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!r||!this.options.annexB||this.state.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(b.ForInOfLoopInitializer,{at:e,type:r?"ForInStatement":"ForOfStatement"}),e.type==="AssignmentPattern"&&this.raise(b.InvalidLhs,{at:e,ancestor:{type:"ForStatement"}}),n.left=e,n.right=r?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),n.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(n,r?"ForInStatement":"ForOfStatement")}parseVar(n,e,t,r=!1){let i=n.declarations=[];for(n.kind=t;;){let a=this.startNode();if(this.parseVarId(a,t),a.init=this.eat(29)?e?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,a.init===null&&!r&&(a.id.type!=="Identifier"&&!(e&&(this.match(58)||this.isContextual(102)))?this.raise(b.DeclarationMissingInitializer,{at:this.state.lastTokEndLoc,kind:"destructuring"}):t==="const"&&!(this.match(58)||this.isContextual(102))&&this.raise(b.DeclarationMissingInitializer,{at:this.state.lastTokEndLoc,kind:"const"})),i.push(this.finishNode(a,"VariableDeclarator")),!this.eat(12))break}return n}parseVarId(n,e){let t=this.parseBindingAtom();this.checkLVal(t,{in:{type:"VariableDeclarator"},binding:e==="var"?5:8201}),n.id=t}parseAsyncFunctionExpression(n){return this.parseFunction(n,8)}parseFunction(n,e=0){let t=e&2,r=!!(e&1),i=r&&!(e&4),a=!!(e&8);this.initFunction(n,a),this.match(55)&&(t&&this.raise(b.GeneratorInSingleStatementContext,{at:this.state.startLoc}),this.next(),n.generator=!0),r&&(n.id=this.parseFunctionId(i));let o=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(2),this.prodParam.enter(yn(a,n.generator)),r||(n.id=this.parseFunctionId()),this.parseFunctionParams(n,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(n,r?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),r&&!t&&this.registerFunctionStatementId(n),this.state.maybeInArrowParameters=o,n}parseFunctionId(n){return n||R(this.state.type)?this.parseIdentifier():null}parseFunctionParams(n,e){this.expect(10),this.expressionScope.enter(sl()),n.params=this.parseBindingList(11,41,2|(e?4:0)),this.expressionScope.exit()}registerFunctionStatementId(n){n.id&&this.scope.declareName(n.id.name,!this.options.annexB||this.state.strict||n.generator||n.async?this.scope.treatFunctionsAsVar?5:8201:17,n.id.loc.start)}parseClass(n,e,t){this.next();let r=this.state.strict;return this.state.strict=!0,this.parseClassId(n,e,t),this.parseClassSuper(n),n.body=this.parseClassBody(!!n.superClass,r),this.finishNode(n,e?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}isNonstaticConstructor(n){return!n.computed&&!n.static&&(n.key.name==="constructor"||n.key.value==="constructor")}parseClassBody(n,e){this.classScope.enter();let t={hadConstructor:!1,hadSuperClass:n},r=[],i=this.startNode();if(i.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(r.length>0)throw this.raise(b.DecoratorSemicolon,{at:this.state.lastTokEndLoc});continue}if(this.match(26)){r.push(this.parseDecorator());continue}let a=this.startNode();r.length&&(a.decorators=r,this.resetStartLocationFromNode(a,r[0]),r=[]),this.parseClassMember(i,a,t),a.kind==="constructor"&&a.decorators&&a.decorators.length>0&&this.raise(b.DecoratorConstructor,{at:a})}}),this.state.strict=e,this.next(),r.length)throw this.raise(b.TrailingDecorator,{at:this.state.startLoc});return this.classScope.exit(),this.finishNode(i,"ClassBody")}parseClassMemberFromModifier(n,e){let t=this.parseIdentifier(!0);if(this.isClassMethod()){let r=e;return r.kind="method",r.computed=!1,r.key=t,r.static=!1,this.pushClassMethod(n,r,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let r=e;return r.computed=!1,r.key=t,r.static=!1,n.body.push(this.parseClassProperty(r)),!0}return this.resetPreviousNodeTrailingComments(t),!1}parseClassMember(n,e,t){let r=this.isContextual(106);if(r){if(this.parseClassMemberFromModifier(n,e))return;if(this.eat(5)){this.parseClassStaticBlock(n,e);return}}this.parseClassMemberWithIsStatic(n,e,t,r)}parseClassMemberWithIsStatic(n,e,t,r){let i=e,a=e,o=e,l=e,c=e,p=i,u=i;if(e.static=r,this.parsePropertyNamePrefixOperator(e),this.eat(55)){p.kind="method";let f=this.match(138);if(this.parseClassElementName(p),f){this.pushClassPrivateMethod(n,a,!0,!1);return}this.isNonstaticConstructor(i)&&this.raise(b.ConstructorIsGenerator,{at:i.key}),this.pushClassMethod(n,i,!0,!1,!1,!1);return}let h=R(this.state.type)&&!this.state.containsEsc,m=this.match(138),d=this.parseClassElementName(e),y=this.state.startLoc;if(this.parsePostMemberNameModifiers(u),this.isClassMethod()){if(p.kind="method",m){this.pushClassPrivateMethod(n,a,!1,!1);return}let f=this.isNonstaticConstructor(i),v=!1;f&&(i.kind="constructor",t.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(b.DuplicateConstructor,{at:d}),f&&this.hasPlugin("typescript")&&e.override&&this.raise(b.OverrideOnConstructor,{at:d}),t.hadConstructor=!0,v=t.hadSuperClass),this.pushClassMethod(n,i,!1,!1,f,v)}else if(this.isClassProperty())m?this.pushClassPrivateProperty(n,l):this.pushClassProperty(n,o);else if(h&&d.name==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(d);let f=this.eat(55);u.optional&&this.unexpected(y),p.kind="method";let v=this.match(138);this.parseClassElementName(p),this.parsePostMemberNameModifiers(u),v?this.pushClassPrivateMethod(n,a,f,!0):(this.isNonstaticConstructor(i)&&this.raise(b.ConstructorIsAsync,{at:i.key}),this.pushClassMethod(n,i,f,!0,!1,!1))}else if(h&&(d.name==="get"||d.name==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(d),p.kind=d.name;let f=this.match(138);this.parseClassElementName(i),f?this.pushClassPrivateMethod(n,a,!1,!1):(this.isNonstaticConstructor(i)&&this.raise(b.ConstructorIsAccessor,{at:i.key}),this.pushClassMethod(n,i,!1,!1,!1,!1)),this.checkGetterSetterParams(i)}else if(h&&d.name==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(d);let f=this.match(138);this.parseClassElementName(o),this.pushClassAccessorProperty(n,c,f)}else this.isLineTerminator()?m?this.pushClassPrivateProperty(n,l):this.pushClassProperty(n,o):this.unexpected()}parseClassElementName(n){let{type:e,value:t}=this.state;if((e===132||e===133)&&n.static&&t==="prototype"&&this.raise(b.StaticPrototype,{at:this.state.startLoc}),e===138){t==="constructor"&&this.raise(b.ConstructorClassPrivateField,{at:this.state.startLoc});let r=this.parsePrivateName();return n.key=r,r}return this.parsePropertyName(n)}parseClassStaticBlock(n,e){var t;this.scope.enter(208);let r=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let i=e.body=[];this.parseBlockOrModuleBlockBody(i,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=r,n.body.push(this.finishNode(e,"StaticBlock")),(t=e.decorators)!=null&&t.length&&this.raise(b.DecoratorStaticBlock,{at:e})}pushClassProperty(n,e){!e.computed&&(e.key.name==="constructor"||e.key.value==="constructor")&&this.raise(b.ConstructorClassField,{at:e.key}),n.body.push(this.parseClassProperty(e))}pushClassPrivateProperty(n,e){let t=this.parseClassPrivateProperty(e);n.body.push(t),this.classScope.declarePrivateName(this.getPrivateNameSV(t.key),0,t.key.loc.start)}pushClassAccessorProperty(n,e,t){if(!t&&!e.computed){let i=e.key;(i.name==="constructor"||i.value==="constructor")&&this.raise(b.ConstructorClassField,{at:i})}let r=this.parseClassAccessorProperty(e);n.body.push(r),t&&this.classScope.declarePrivateName(this.getPrivateNameSV(r.key),0,r.key.loc.start)}pushClassMethod(n,e,t,r,i,a){n.body.push(this.parseMethod(e,t,r,i,a,"ClassMethod",!0))}pushClassPrivateMethod(n,e,t,r){let i=this.parseMethod(e,t,r,!1,!1,"ClassPrivateMethod",!0);n.body.push(i);let a=i.kind==="get"?i.static?6:2:i.kind==="set"?i.static?5:1:0;this.declareClassPrivateMethodInScope(i,a)}declareClassPrivateMethodInScope(n,e){this.classScope.declarePrivateName(this.getPrivateNameSV(n.key),e,n.key.loc.start)}parsePostMemberNameModifiers(n){}parseClassPrivateProperty(n){return this.parseInitializer(n),this.semicolon(),this.finishNode(n,"ClassPrivateProperty")}parseClassProperty(n){return this.parseInitializer(n),this.semicolon(),this.finishNode(n,"ClassProperty")}parseClassAccessorProperty(n){return this.parseInitializer(n),this.semicolon(),this.finishNode(n,"ClassAccessorProperty")}parseInitializer(n){this.scope.enter(80),this.expressionScope.enter(yi()),this.prodParam.enter(0),n.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(n,e,t,r=8331){if(R(this.state.type))n.id=this.parseIdentifier(),e&&this.declareNameFromIdentifier(n.id,r);else if(t||!e)n.id=null;else throw this.raise(b.MissingClassName,{at:this.state.startLoc})}parseClassSuper(n){n.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(n,e){let t=this.parseMaybeImportPhase(n,!0),r=this.maybeParseExportDefaultSpecifier(n,t),i=!r||this.eat(12),a=i&&this.eatExportStar(n),o=a&&this.maybeParseExportNamespaceSpecifier(n),l=i&&(!o||this.eat(12)),c=r||a;if(a&&!o){if(r&&this.unexpected(),e)throw this.raise(b.UnsupportedDecoratorExport,{at:n});return this.parseExportFrom(n,!0),this.finishNode(n,"ExportAllDeclaration")}let p=this.maybeParseExportNamedSpecifiers(n);r&&i&&!a&&!p&&this.unexpected(null,5),o&&l&&this.unexpected(null,98);let u;if(c||p){if(u=!1,e)throw this.raise(b.UnsupportedDecoratorExport,{at:n});this.parseExportFrom(n,c)}else u=this.maybeParseExportDeclaration(n);if(c||p||u){var h;let m=n;if(this.checkExport(m,!0,!1,!!m.source),((h=m.declaration)==null?void 0:h.type)==="ClassDeclaration")this.maybeTakeDecorators(e,m.declaration,m);else if(e)throw this.raise(b.UnsupportedDecoratorExport,{at:n});return this.finishNode(m,"ExportNamedDeclaration")}if(this.eat(65)){let m=n,d=this.parseExportDefaultExpression();if(m.declaration=d,d.type==="ClassDeclaration")this.maybeTakeDecorators(e,d,m);else if(e)throw this.raise(b.UnsupportedDecoratorExport,{at:n});return this.checkExport(m,!0,!0),this.finishNode(m,"ExportDefaultDeclaration")}this.unexpected(null,5)}eatExportStar(n){return this.eat(55)}maybeParseExportDefaultSpecifier(n,e){if(e||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",e?.loc.start);let t=e||this.parseIdentifier(!0),r=this.startNodeAtNode(t);return r.exported=t,n.specifiers=[this.finishNode(r,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(n){if(this.isContextual(93)){n.specifiers||(n.specifiers=[]);let e=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),e.exported=this.parseModuleExportName(),n.specifiers.push(this.finishNode(e,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(n){if(this.match(5)){n.specifiers||(n.specifiers=[]);let e=n.exportKind==="type";return n.specifiers.push(...this.parseExportSpecifiers(e)),n.source=null,n.declaration=null,this.hasPlugin("importAssertions")&&(n.assertions=[]),!0}return!1}maybeParseExportDeclaration(n){return this.shouldParseExportDeclaration()?(n.specifiers=[],n.source=null,this.hasPlugin("importAssertions")&&(n.assertions=[]),n.declaration=this.parseExportDeclaration(n),!0):!1}isAsyncFunction(){if(!this.isContextual(95))return!1;let n=this.nextTokenInLineStart();return this.isUnparsedContextual(n,"function")}parseExportDefaultExpression(){let n=this.startNode();if(this.match(68))return this.next(),this.parseFunction(n,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(n,13);if(this.match(80))return this.parseClass(n,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(b.DecoratorBeforeExport,{at:this.state.startLoc}),this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(75)||this.match(74)||this.isLet())throw this.raise(b.UnsupportedDefaultExport,{at:this.state.startLoc});let e=this.parseMaybeAssignAllowIn();return this.semicolon(),e}parseExportDeclaration(n){return this.match(80)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:n}=this.state;if(R(n)){if(n===95&&!this.state.containsEsc||n===100)return!1;if((n===130||n===129)&&!this.state.containsEsc){let{type:r}=this.lookahead();if(R(r)&&r!==98||r===5)return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;let e=this.nextTokenStart(),t=this.isUnparsedContextual(e,"from");if(this.input.charCodeAt(e)===44||R(this.state.type)&&t)return!0;if(this.match(65)&&t){let r=this.input.charCodeAt(this.nextTokenStartSince(e+4));return r===34||r===39}return!1}parseExportFrom(n,e){this.eatContextual(98)?(n.source=this.parseImportSource(),this.checkExport(n),this.maybeParseImportAttributes(n),this.checkJSONModuleImport(n)):e&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:n}=this.state;return n===26&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?(this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(b.DecoratorBeforeExport,{at:this.state.startLoc}),!0):n===74||n===75||n===68||n===80||this.isLet()||this.isAsyncFunction()}checkExport(n,e,t,r){if(e){var i;if(t){if(this.checkDuplicateExports(n,"default"),this.hasPlugin("exportDefaultFrom")){var a;let o=n.declaration;o.type==="Identifier"&&o.name==="from"&&o.end-o.start===4&&!((a=o.extra)!=null&&a.parenthesized)&&this.raise(b.ExportDefaultFromAsIdentifier,{at:o})}}else if((i=n.specifiers)!=null&&i.length)for(let o of n.specifiers){let{exported:l}=o,c=l.type==="Identifier"?l.name:l.value;if(this.checkDuplicateExports(o,c),!r&&o.local){let{local:p}=o;p.type!=="Identifier"?this.raise(b.ExportBindingIsString,{at:o,localName:p.value,exportName:c}):(this.checkReservedWord(p.name,p.loc.start,!0,!1),this.scope.checkLocalExport(p))}}else if(n.declaration){if(n.declaration.type==="FunctionDeclaration"||n.declaration.type==="ClassDeclaration"){let o=n.declaration.id;if(!o)throw new Error("Assertion failure");this.checkDuplicateExports(n,o.name)}else if(n.declaration.type==="VariableDeclaration")for(let o of n.declaration.declarations)this.checkDeclaration(o.id)}}}checkDeclaration(n){if(n.type==="Identifier")this.checkDuplicateExports(n,n.name);else if(n.type==="ObjectPattern")for(let e of n.properties)this.checkDeclaration(e);else if(n.type==="ArrayPattern")for(let e of n.elements)e&&this.checkDeclaration(e);else n.type==="ObjectProperty"?this.checkDeclaration(n.value):n.type==="RestElement"?this.checkDeclaration(n.argument):n.type==="AssignmentPattern"&&this.checkDeclaration(n.left)}checkDuplicateExports(n,e){this.exportedIdentifiers.has(e)&&(e==="default"?this.raise(b.DuplicateDefaultExport,{at:n}):this.raise(b.DuplicateExport,{at:n,exportName:e})),this.exportedIdentifiers.add(e)}parseExportSpecifiers(n){let e=[],t=!0;for(this.expect(5);!this.eat(8);){if(t)t=!1;else if(this.expect(12),this.eat(8))break;let r=this.isContextual(130),i=this.match(133),a=this.startNode();a.local=this.parseModuleExportName(),e.push(this.parseExportSpecifier(a,i,n,r))}return e}parseExportSpecifier(n,e,t,r){return this.eatContextual(93)?n.exported=this.parseModuleExportName():e?n.exported=ll(n.local):n.exported||(n.exported=Be(n.local)),this.finishNode(n,"ExportSpecifier")}parseModuleExportName(){if(this.match(133)){let n=this.parseStringLiteral(this.state.value),e=n.value.match(Dl);return e&&this.raise(b.ModuleExportNameHasLoneSurrogate,{at:n,surrogateCharCode:e[0].charCodeAt(0)}),n}return this.parseIdentifier(!0)}isJSONModuleImport(n){return n.assertions!=null?n.assertions.some(({key:e,value:t})=>t.value==="json"&&(e.type==="Identifier"?e.name==="type":e.value==="type")):!1}checkImportReflection(n){let{specifiers:e}=n,t=e.length===1?e[0].type:null;if(n.phase==="source")t!=="ImportDefaultSpecifier"&&this.raise(b.SourcePhaseImportRequiresDefault,{at:e[0].loc.start});else if(n.phase==="defer")t!=="ImportNamespaceSpecifier"&&this.raise(b.DeferImportRequiresNamespace,{at:e[0].loc.start});else if(n.module){var r;t!=="ImportDefaultSpecifier"&&this.raise(b.ImportReflectionNotBinding,{at:e[0].loc.start}),((r=n.assertions)==null?void 0:r.length)>0&&this.raise(b.ImportReflectionHasAssertion,{at:n.specifiers[0].loc.start})}}checkJSONModuleImport(n){if(this.isJSONModuleImport(n)&&n.type!=="ExportAllDeclaration"){let{specifiers:e}=n;if(e!=null){let t=e.find(r=>{let i;if(r.type==="ExportSpecifier"?i=r.local:r.type==="ImportSpecifier"&&(i=r.imported),i!==void 0)return i.type==="Identifier"?i.name!=="default":i.value!=="default"});t!==void 0&&this.raise(b.ImportJSONBindingNotDefault,{at:t.loc.start})}}}isPotentialImportPhase(n){return n?!1:this.isContextual(105)||this.isContextual(97)||this.isContextual(127)}applyImportPhase(n,e,t,r){e||(t==="module"?(this.expectPlugin("importReflection",r),n.module=!0):this.hasPlugin("importReflection")&&(n.module=!1),t==="source"?(this.expectPlugin("sourcePhaseImports",r),n.phase="source"):t==="defer"?(this.expectPlugin("deferredImportEvaluation",r),n.phase="defer"):this.hasPlugin("sourcePhaseImports")&&(n.phase=null))}parseMaybeImportPhase(n,e){if(!this.isPotentialImportPhase(e))return this.applyImportPhase(n,e,null),null;let t=this.parseIdentifier(!0),{type:r}=this.state;return(xe(r)?r!==98||this.lookaheadCharCode()===102:r!==12)?(this.resetPreviousIdentifierLeadingComments(t),this.applyImportPhase(n,e,t.name,t.loc.start),null):(this.applyImportPhase(n,e,null),t)}isPrecedingIdImportPhase(n){let{type:e}=this.state;return R(e)?e!==98||this.lookaheadCharCode()===102:e!==12}parseImport(n){return this.match(133)?this.parseImportSourceAndAttributes(n):this.parseImportSpecifiersAndAfter(n,this.parseMaybeImportPhase(n,!1))}parseImportSpecifiersAndAfter(n,e){n.specifiers=[];let r=!this.maybeParseDefaultImportSpecifier(n,e)||this.eat(12),i=r&&this.maybeParseStarImportSpecifier(n);return r&&!i&&this.parseNamedImportSpecifiers(n),this.expectContextual(98),this.parseImportSourceAndAttributes(n)}parseImportSourceAndAttributes(n){var e;return(e=n.specifiers)!=null||(n.specifiers=[]),n.source=this.parseImportSource(),this.maybeParseImportAttributes(n),this.checkImportReflection(n),this.checkJSONModuleImport(n),this.semicolon(),this.finishNode(n,"ImportDeclaration")}parseImportSource(){return this.match(133)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(n,e,t){e.local=this.parseIdentifier(),n.specifiers.push(this.finishImportSpecifier(e,t))}finishImportSpecifier(n,e,t=8201){return this.checkLVal(n.local,{in:{type:e},binding:t}),this.finishNode(n,e)}parseImportAttributes(){this.expect(5);let n=[],e=new Set;do{if(this.match(8))break;let t=this.startNode(),r=this.state.value;if(e.has(r)&&this.raise(b.ModuleAttributesWithDuplicateKeys,{at:this.state.startLoc,key:r}),e.add(r),this.match(133)?t.key=this.parseStringLiteral(r):t.key=this.parseIdentifier(!0),this.expect(14),!this.match(133))throw this.raise(b.ModuleAttributeInvalidValue,{at:this.state.startLoc});t.value=this.parseStringLiteral(this.state.value),n.push(this.finishNode(t,"ImportAttribute"))}while(this.eat(12));return this.expect(8),n}parseModuleAttributes(){let n=[],e=new Set;do{let t=this.startNode();if(t.key=this.parseIdentifier(!0),t.key.name!=="type"&&this.raise(b.ModuleAttributeDifferentFromType,{at:t.key}),e.has(t.key.name)&&this.raise(b.ModuleAttributesWithDuplicateKeys,{at:t.key,key:t.key.name}),e.add(t.key.name),this.expect(14),!this.match(133))throw this.raise(b.ModuleAttributeInvalidValue,{at:this.state.startLoc});t.value=this.parseStringLiteral(this.state.value),n.push(this.finishNode(t,"ImportAttribute"))}while(this.eat(12));return n}maybeParseImportAttributes(n){let e,t=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),this.hasPlugin("moduleAttributes")?e=this.parseModuleAttributes():(this.expectImportAttributesPlugin(),e=this.parseImportAttributes()),t=!0}else if(this.isContextual(94)&&!this.hasPrecedingLineBreak())this.hasPlugin("importAttributes")?(this.getPluginOption("importAttributes","deprecatedAssertSyntax")!==!0&&this.raise(b.ImportAttributesUseAssert,{at:this.state.startLoc}),this.addExtra(n,"deprecatedAssertSyntax",!0)):this.expectOnePlugin(["importAttributes","importAssertions"]),this.next(),e=this.parseImportAttributes();else if(this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions"))e=[];else if(this.hasPlugin("moduleAttributes"))e=[];else return;!t&&this.hasPlugin("importAssertions")?n.assertions=e:n.attributes=e}maybeParseDefaultImportSpecifier(n,e){if(e){let t=this.startNodeAtNode(e);return t.local=e,n.specifiers.push(this.finishImportSpecifier(t,"ImportDefaultSpecifier")),!0}else if(xe(this.state.type))return this.parseImportSpecifierLocal(n,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(n){if(this.match(55)){let e=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(n,e,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(n){let e=!0;for(this.expect(5);!this.eat(8);){if(e)e=!1;else{if(this.eat(14))throw this.raise(b.DestructureNamedImport,{at:this.state.startLoc});if(this.expect(12),this.eat(8))break}let t=this.startNode(),r=this.match(133),i=this.isContextual(130);t.imported=this.parseModuleExportName();let a=this.parseImportSpecifier(t,r,n.importKind==="type"||n.importKind==="typeof",i,void 0);n.specifiers.push(a)}}parseImportSpecifier(n,e,t,r,i){if(this.eatContextual(93))n.local=this.parseIdentifier();else{let{imported:a}=n;if(e)throw this.raise(b.ImportBindingIsString,{at:n,importName:a.value});this.checkReservedWord(a.name,n.loc.start,!0,!0),n.local||(n.local=Be(a))}return this.finishImportSpecifier(n,"ImportSpecifier",i)}isThisParam(n){return n.type==="Identifier"&&n.name==="this"}},Tn=class extends Lr{constructor(n,e){n=Nl(n),super(n,e),this.options=n,this.initializeScopes(),this.plugins=Ol(this.options.plugins),this.filename=n.sourceFilename}getScopeHandler(){return _t}parse(){this.enterInitialScopes();let n=this.startNode(),e=this.startNode();return this.nextToken(),n.errors=null,this.parseTopLevel(n,e),n.errors=this.state.errors,n}};function Ol(s){let n=new Map;for(let e of s){let[t,r]=Array.isArray(e)?e:[e,{}];n.has(t)||n.set(t,r||{})}return n}function Fl(s,n){var e;if(((e=n)==null?void 0:e.sourceType)==="unambiguous"){n=Object.assign({},n);try{n.sourceType="module";let t=Dt(n,s),r=t.parse();if(t.sawUnambiguousESM)return r;if(t.ambiguousScriptDifferentAst)try{return n.sourceType="script",Dt(n,s).parse()}catch{}else r.program.sourceType="script";return r}catch(t){try{return n.sourceType="script",Dt(n,s).parse()}catch{}throw t}}else return Dt(n,s).parse()}function _l(s,n){let e=Dt(n,s);return e.options.strictMode&&(e.state.strict=!0),e.getExpression()}function Ul(s){let n={};for(let e of Object.keys(s))n[e]=Oe(s[e]);return n}var Bl=Ul(ko);function Dt(s,n){let e=Tn;return s!=null&&s.plugins&&(Al(s.plugins),e=Rl(s.plugins)),new e(s,n)}var ii={};function Rl(s){let n=kl.filter(r=>Y(s,r)),e=n.join("/"),t=ii[e];if(!t){t=Tn;for(let r of n)t=Pi[r](t);ii[e]=t}return t}Bt.parse=Fl;Bt.parseExpression=_l;Bt.tokTypes=Bl});import{Command as tu}from"commander";import en from"node:path";import{Command as Np}from"commander";import ae from"kleur";import tn from"lodash";import wt from"prompts";var an=[{name:"Accordion",value:"accordion",deps:["radix-vue","tailwind-variants"],devDeps:["tailwindcss-animate","nuxt-icon"],nuxtModules:["nuxt-icon"],instructions:["Remember to add the accordion animations to your tailwind.config.js"],files:[{fileName:"Accordion/Accordion.vue",dirPath:"components/UI",fileContent:`<template>\r
|
|
8
|
+
`):r=String.fromCharCode(t),++this.state.curLine,this.state.lineStart=this.state.pos,r}jsxReadString(e){let t="",r=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(b.UnterminatedString,{at:this.state.startLoc});let i=this.input.charCodeAt(this.state.pos);if(i===e)break;i===38?(t+=this.input.slice(r,this.state.pos),t+=this.jsxReadEntity(),r=this.state.pos):Ot(i)?(t+=this.input.slice(r,this.state.pos),t+=this.jsxReadNewLine(!1),r=this.state.pos):++this.state.pos}t+=this.input.slice(r,this.state.pos++),this.finishToken(133,t)}jsxReadEntity(){let e=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let t=10;this.codePointAtPos(this.state.pos)===120&&(t=16,++this.state.pos);let r=this.readInt(t,void 0,!1,"bail");if(r!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(r)}else{let t=0,r=!1;for(;t++<10&&this.state.pos<this.length&&!(r=this.codePointAtPos(this.state.pos)==59);)++this.state.pos;if(r){let i=this.input.slice(e,this.state.pos),a=ml[i];if(++this.state.pos,a)return a}}return this.state.pos=e,"&"}jsxReadWord(){let e,t=this.state.pos;do e=this.input.charCodeAt(++this.state.pos);while(lt(e)||e===45);this.finishToken(140,this.input.slice(t,this.state.pos))}jsxParseIdentifier(){let e=this.startNode();return this.match(140)?e.name=this.state.value:jr(this.state.type)?e.name=qe(this.state.type):this.unexpected(),this.next(),this.finishNode(e,"JSXIdentifier")}jsxParseNamespacedName(){let e=this.state.startLoc,t=this.jsxParseIdentifier();if(!this.eat(14))return t;let r=this.startNodeAt(e);return r.namespace=t,r.name=this.jsxParseIdentifier(),this.finishNode(r,"JSXNamespacedName")}jsxParseElementName(){let e=this.state.startLoc,t=this.jsxParseNamespacedName();if(t.type==="JSXNamespacedName")return t;for(;this.eat(16);){let r=this.startNodeAt(e);r.object=t,r.property=this.jsxParseIdentifier(),t=this.finishNode(r,"JSXMemberExpression")}return t}jsxParseAttributeValue(){let e;switch(this.state.type){case 5:return e=this.startNode(),this.setContext(V.brace),this.next(),e=this.jsxParseExpressionContainer(e,V.j_oTag),e.expression.type==="JSXEmptyExpression"&&this.raise(Xe.AttributeIsEmpty,{at:e}),e;case 142:case 133:return this.parseExprAtom();default:throw this.raise(Xe.UnsupportedJsxValue,{at:this.state.startLoc})}}jsxParseEmptyExpression(){let e=this.startNodeAt(this.state.lastTokEndLoc);return this.finishNodeAt(e,"JSXEmptyExpression",this.state.startLoc)}jsxParseSpreadChild(e){return this.next(),e.expression=this.parseExpression(),this.setContext(V.j_expr),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXSpreadChild")}jsxParseExpressionContainer(e,t){if(this.match(8))e.expression=this.jsxParseEmptyExpression();else{let r=this.parseExpression();e.expression=r}return this.setContext(t),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXExpressionContainer")}jsxParseAttribute(){let e=this.startNode();return this.match(5)?(this.setContext(V.brace),this.next(),this.expect(21),e.argument=this.parseMaybeAssignAllowIn(),this.setContext(V.j_oTag),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXSpreadAttribute")):(e.name=this.jsxParseNamespacedName(),e.value=this.eat(29)?this.jsxParseAttributeValue():null,this.finishNode(e,"JSXAttribute"))}jsxParseOpeningElementAt(e){let t=this.startNodeAt(e);return this.eat(143)?this.finishNode(t,"JSXOpeningFragment"):(t.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(t))}jsxParseOpeningElementAfterName(e){let t=[];for(;!this.match(56)&&!this.match(143);)t.push(this.jsxParseAttribute());return e.attributes=t,e.selfClosing=this.eat(56),this.expect(143),this.finishNode(e,"JSXOpeningElement")}jsxParseClosingElementAt(e){let t=this.startNodeAt(e);return this.eat(143)?this.finishNode(t,"JSXClosingFragment"):(t.name=this.jsxParseElementName(),this.expect(143),this.finishNode(t,"JSXClosingElement"))}jsxParseElementAt(e){let t=this.startNodeAt(e),r=[],i=this.jsxParseOpeningElementAt(e),a=null;if(!i.selfClosing){e:for(;;)switch(this.state.type){case 142:if(e=this.state.startLoc,this.next(),this.eat(56)){a=this.jsxParseClosingElementAt(e);break e}r.push(this.jsxParseElementAt(e));break;case 141:r.push(this.parseExprAtom());break;case 5:{let o=this.startNode();this.setContext(V.brace),this.next(),this.match(21)?r.push(this.jsxParseSpreadChild(o)):r.push(this.jsxParseExpressionContainer(o,V.j_expr));break}default:this.unexpected()}ze(i)&&!ze(a)&&a!==null?this.raise(Xe.MissingClosingTagFragment,{at:a}):!ze(i)&&ze(a)?this.raise(Xe.MissingClosingTagElement,{at:a,openingTagName:ot(i.name)}):!ze(i)&&!ze(a)&&ot(a.name)!==ot(i.name)&&this.raise(Xe.MissingClosingTagElement,{at:a,openingTagName:ot(i.name)})}if(ze(i)?(t.openingFragment=i,t.closingFragment=a):(t.openingElement=i,t.closingElement=a),t.children=r,this.match(47))throw this.raise(Xe.UnwrappedAdjacentJSXElements,{at:this.state.startLoc});return ze(i)?this.finishNode(t,"JSXFragment"):this.finishNode(t,"JSXElement")}jsxParseElement(){let e=this.state.startLoc;return this.next(),this.jsxParseElementAt(e)}setContext(e){let{context:t}=this.state;t[t.length-1]=e}parseExprAtom(e){return this.match(141)?this.parseLiteral(this.state.value,"JSXText"):this.match(142)?this.jsxParseElement():this.match(47)&&this.input.charCodeAt(this.state.pos)!==33?(this.replaceToken(142),this.jsxParseElement()):super.parseExprAtom(e)}skipSpace(){this.curContext().preserveSpace||super.skipSpace()}getTokenFromCode(e){let t=this.curContext();if(t===V.j_expr){this.jsxReadToken();return}if(t===V.j_oTag||t===V.j_cTag){if(Ue(e)){this.jsxReadWord();return}if(e===62){++this.state.pos,this.finishToken(143);return}if((e===34||e===39)&&t===V.j_oTag){this.jsxReadString(e);return}}if(e===60&&this.state.canStartJSXElement&&this.input.charCodeAt(this.state.pos+1)!==33){++this.state.pos,this.finishToken(142);return}super.getTokenFromCode(e)}updateContext(e){let{context:t,type:r}=this.state;if(r===56&&e===142)t.splice(-2,2,V.j_cTag),this.state.canStartJSXElement=!1;else if(r===142)t.push(V.j_oTag);else if(r===143){let i=t[t.length-1];i===V.j_oTag&&e===56||i===V.j_cTag?(t.pop(),this.state.canStartJSXElement=t[t.length-1]===V.j_expr):(this.setContext(V.j_expr),this.state.canStartJSXElement=!0)}else this.state.canStartJSXElement=Mo(r)}},kr=class extends Ft{constructor(...n){super(...n),this.types=new Set,this.enums=new Set,this.constEnums=new Set,this.classes=new Set,this.exportOnlyBindings=new Set}},Nr=class extends Ut{constructor(...n){super(...n),this.importsStack=[]}createScope(n){return this.importsStack.push(new Set),new kr(n)}enter(n){n==256&&this.importsStack.push(new Set),super.enter(n)}exit(){let n=super.exit();return n==256&&this.importsStack.pop(),n}hasImport(n,e){let t=this.importsStack.length;if(this.importsStack[t-1].has(n))return!0;if(!e&&t>1){for(let r=0;r<t-1;r++)if(this.importsStack[r].has(n))return!0}return!1}declareName(n,e,t){if(e&4096){this.hasImport(n,!0)&&this.parser.raise(b.VarRedeclaration,{at:t,identifierName:n}),this.importsStack[this.importsStack.length-1].add(n);return}let r=this.currentScope();if(e&1024){this.maybeExportDefined(r,n),r.exportOnlyBindings.add(n);return}super.declareName(n,e,t),e&2&&(e&1||(this.checkRedeclarationInScope(r,n,e,t),this.maybeExportDefined(r,n)),r.types.add(n)),e&256&&r.enums.add(n),e&512&&r.constEnums.add(n),e&128&&r.classes.add(n)}isRedeclaredInScope(n,e,t){if(n.enums.has(e)){if(t&256){let r=!!(t&512),i=n.constEnums.has(e);return r!==i}return!0}return t&128&&n.classes.has(e)?n.lexical.has(e)?!!(t&1):!1:t&2&&n.types.has(e)?!0:super.isRedeclaredInScope(n,e,t)}checkLocalExport(n){let{name:e}=n;if(this.hasImport(e))return;let t=this.scopeStack.length;for(let r=t-1;r>=0;r--){let i=this.scopeStack[r];if(i.types.has(e)||i.exportOnlyBindings.has(e))return}super.checkLocalExport(n)}},gl=(s,n)=>Object.hasOwnProperty.call(s,n)&&s[n],yi=s=>s.type==="ParenthesizedExpression"?yi(s.expression):s,Mr=class extends Ar{toAssignable(n,e=!1){var t,r;let i;switch((n.type==="ParenthesizedExpression"||(t=n.extra)!=null&&t.parenthesized)&&(i=yi(n),e?i.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(b.InvalidParenthesizedAssignment,{at:n}):i.type!=="MemberExpression"&&!this.isOptionalMemberExpression(i)&&this.raise(b.InvalidParenthesizedAssignment,{at:n}):this.raise(b.InvalidParenthesizedAssignment,{at:n})),n.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":n.type="ObjectPattern";for(let o=0,l=n.properties.length,c=l-1;o<l;o++){var a;let p=n.properties[o],u=o===c;this.toAssignableObjectExpressionProp(p,u,e),u&&p.type==="RestElement"&&(a=n.extra)!=null&&a.trailingCommaLoc&&this.raise(b.RestTrailingComma,{at:n.extra.trailingCommaLoc})}break;case"ObjectProperty":{let{key:o,value:l}=n;this.isPrivateName(o)&&this.classScope.usePrivateName(this.getPrivateNameSV(o),o.loc.start),this.toAssignable(l,e);break}case"SpreadElement":throw new Error("Internal @babel/parser error (this is a bug, please report it). SpreadElement should be converted by .toAssignable's caller.");case"ArrayExpression":n.type="ArrayPattern",this.toAssignableList(n.elements,(r=n.extra)==null?void 0:r.trailingCommaLoc,e);break;case"AssignmentExpression":n.operator!=="="&&this.raise(b.MissingEqInAssignment,{at:n.left.loc.end}),n.type="AssignmentPattern",delete n.operator,this.toAssignable(n.left,e);break;case"ParenthesizedExpression":this.toAssignable(i,e);break}}toAssignableObjectExpressionProp(n,e,t){if(n.type==="ObjectMethod")this.raise(n.kind==="get"||n.kind==="set"?b.PatternHasAccessor:b.PatternHasMethod,{at:n.key});else if(n.type==="SpreadElement"){n.type="RestElement";let r=n.argument;this.checkToRestConversion(r,!1),this.toAssignable(r,t),e||this.raise(b.RestTrailingComma,{at:n})}else this.toAssignable(n,t)}toAssignableList(n,e,t){let r=n.length-1;for(let i=0;i<=r;i++){let a=n[i];if(a){if(a.type==="SpreadElement"){a.type="RestElement";let o=a.argument;this.checkToRestConversion(o,!0),this.toAssignable(o,t)}else this.toAssignable(a,t);a.type==="RestElement"&&(i<r?this.raise(b.RestTrailingComma,{at:a}):e&&this.raise(b.RestTrailingComma,{at:e}))}}}isAssignable(n,e){switch(n.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":return!0;case"ObjectExpression":{let t=n.properties.length-1;return n.properties.every((r,i)=>r.type!=="ObjectMethod"&&(i===t||r.type!=="SpreadElement")&&this.isAssignable(r))}case"ObjectProperty":return this.isAssignable(n.value);case"SpreadElement":return this.isAssignable(n.argument);case"ArrayExpression":return n.elements.every(t=>t===null||this.isAssignable(t));case"AssignmentExpression":return n.operator==="=";case"ParenthesizedExpression":return this.isAssignable(n.expression);case"MemberExpression":case"OptionalMemberExpression":return!e;default:return!1}}toReferencedList(n,e){return n}toReferencedListDeep(n,e){this.toReferencedList(n,e);for(let t of n)t?.type==="ArrayExpression"&&this.toReferencedListDeep(t.elements)}parseSpread(n){let e=this.startNode();return this.next(),e.argument=this.parseMaybeAssignAllowIn(n,void 0),this.finishNode(e,"SpreadElement")}parseRestBinding(){let n=this.startNode();return this.next(),n.argument=this.parseBindingAtom(),this.finishNode(n,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{let n=this.startNode();return this.next(),n.elements=this.parseBindingList(3,93,1),this.finishNode(n,"ArrayPattern")}case 5:return this.parseObjectLike(8,!0)}return this.parseIdentifier()}parseBindingList(n,e,t){let r=t&1,i=[],a=!0;for(;!this.eat(n);)if(a?a=!1:this.expect(12),r&&this.match(12))i.push(null);else{if(this.eat(n))break;if(this.match(21)){if(i.push(this.parseAssignableListItemTypes(this.parseRestBinding(),t)),!this.checkCommaAfterRest(e)){this.expect(n);break}}else{let o=[];for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(b.UnsupportedParameterDecorator,{at:this.state.startLoc});this.match(26);)o.push(this.parseDecorator());i.push(this.parseAssignableListItem(t,o))}}return i}parseBindingRestProperty(n){return this.next(),n.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(n,"RestElement")}parseBindingProperty(){let n=this.startNode(),{type:e,startLoc:t}=this.state;return e===21?this.parseBindingRestProperty(n):(e===138?(this.expectPlugin("destructuringPrivate",t),this.classScope.usePrivateName(this.state.value,t),n.key=this.parsePrivateName()):this.parsePropertyName(n),n.method=!1,this.parseObjPropValue(n,t,!1,!1,!0,!1))}parseAssignableListItem(n,e){let t=this.parseMaybeDefault();this.parseAssignableListItemTypes(t,n);let r=this.parseMaybeDefault(t.loc.start,t);return e.length&&(t.decorators=e),r}parseAssignableListItemTypes(n,e){return n}parseMaybeDefault(n,e){var t,r;if((t=n)!=null||(n=this.state.startLoc),e=(r=e)!=null?r:this.parseBindingAtom(),!this.eat(29))return e;let i=this.startNodeAt(n);return i.left=e,i.right=this.parseMaybeAssignAllowIn(),this.finishNode(i,"AssignmentPattern")}isValidLVal(n,e,t){return gl({AssignmentPattern:"left",RestElement:"argument",ObjectProperty:"value",ParenthesizedExpression:"expression",ArrayPattern:"elements",ObjectPattern:"properties"},n)}isOptionalMemberExpression(n){return n.type==="OptionalMemberExpression"}checkLVal(n,{in:e,binding:t=64,checkClashes:r=!1,strictModeChanged:i=!1,hasParenthesizedAncestor:a=!1}){var o;let l=n.type;if(this.isObjectMethod(n))return;let c=this.isOptionalMemberExpression(n);if(c||l==="MemberExpression"){c&&(this.expectPlugin("optionalChainingAssign",n.loc.start),e.type!=="AssignmentExpression"&&this.raise(b.InvalidLhsOptionalChaining,{at:n,ancestor:e})),t!==64&&this.raise(b.InvalidPropertyBindingPattern,{at:n});return}if(l==="Identifier"){this.checkIdentifier(n,t,i);let{name:d}=n;r&&(r.has(d)?this.raise(b.ParamDupe,{at:n}):r.add(d));return}let p=this.isValidLVal(l,!(a||(o=n.extra)!=null&&o.parenthesized)&&e.type==="AssignmentExpression",t);if(p===!0)return;if(p===!1){let d=t===64?b.InvalidLhs:b.InvalidLhsBinding;this.raise(d,{at:n,ancestor:e});return}let[u,h]=Array.isArray(p)?p:[p,l==="ParenthesizedExpression"],m=l==="ArrayPattern"||l==="ObjectPattern"?{type:l}:e;for(let d of[].concat(n[u]))d&&this.checkLVal(d,{in:m,binding:t,checkClashes:r,strictModeChanged:i,hasParenthesizedAncestor:h})}checkIdentifier(n,e,t=!1){this.state.strict&&(t?di(n.name,this.inModule):ui(n.name))&&(e===64?this.raise(b.StrictEvalArguments,{at:n,referenceName:n.name}):this.raise(b.StrictEvalArgumentsBinding,{at:n,bindingName:n.name})),e&8192&&n.name==="let"&&this.raise(b.LetInLexicalBinding,{at:n}),e&64||this.declareNameFromIdentifier(n,e)}declareNameFromIdentifier(n,e){this.scope.declareName(n.name,e,n.loc.start)}checkToRestConversion(n,e){switch(n.type){case"ParenthesizedExpression":this.checkToRestConversion(n.expression,e);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(e)break;default:this.raise(b.InvalidRestAssignmentPattern,{at:n})}}checkCommaAfterRest(n){return this.match(12)?(this.raise(this.lookaheadCharCode()===n?b.RestTrailingComma:b.ElementAfterRest,{at:this.state.startLoc}),!0):!1}},yl=(s,n)=>Object.hasOwnProperty.call(s,n)&&s[n];function vl(s){if(s==null)throw new Error(`Unexpected ${s} value.`);return s}function Zs(s){if(!s)throw new Error("Assert fail")}var k=_e`typescript`({AbstractMethodHasImplementation:({methodName:s})=>`Method '${s}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:s})=>`Property '${s}' cannot have an initializer because it is marked abstract.`,AccesorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccesorCannotHaveTypeParameters:"An accessor cannot have type parameters.",AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:s})=>`'declare' is not allowed in ${s}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:({modifier:s})=>"Accessibility modifier already seen.",DuplicateModifier:({modifier:s})=>`Duplicate modifier: '${s}'.`,EmptyHeritageClauseType:({token:s})=>`'${s}' list cannot be empty.`,EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` modifier",IncompatibleModifiers:({modifiers:s})=>`'${s[0]}' modifier cannot be used with '${s[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:s})=>`Index signatures cannot have an accessibility modifier ('${s}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidModifierOnTypeMember:({modifier:s})=>`'${s}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:s})=>`'${s}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:s})=>`'${s}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:s})=>`'${s[0]}' modifier must precede '${s[1]}' modifier.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifer:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:s})=>`Private elements cannot have an accessibility modifier ('${s}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccesorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccesorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccesorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:s})=>`Single type parameter ${s} should have a trailing comma. Example usage: <${s},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:s})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${s}.`});function xl(s){switch(s){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}function ei(s){return s==="private"||s==="public"||s==="protected"}function Pl(s){return s==="in"||s==="out"}var Tl=s=>class extends s{constructor(...e){super(...e),this.tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:k.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:k.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:k.InvalidModifierOnTypeParameter})}getScopeHandler(){return Nr}tsIsIdentifier(){return R(this.state.type)}tsTokenCanFollowModifier(){return(this.match(0)||this.match(5)||this.match(55)||this.match(21)||this.match(138)||this.isLiteralPropertyName())&&!this.hasPrecedingLineBreak()}tsNextTokenCanFollowModifier(){return this.next(),this.tsTokenCanFollowModifier()}tsParseModifier(e,t){if(!R(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;let r=this.state.value;if(e.indexOf(r)!==-1){if(t&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return r}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:t,stopOnStartOfClassStaticBlock:r,errorTemplate:i=k.InvalidModifierOnTypeMember},a){let o=(c,p,u,h)=>{p===u&&a[h]&&this.raise(k.InvalidModifiersOrder,{at:c,orderedModifiers:[u,h]})},l=(c,p,u,h)=>{(a[u]&&p===h||a[h]&&p===u)&&this.raise(k.IncompatibleModifiers,{at:c,modifiers:[u,h]})};for(;;){let{startLoc:c}=this.state,p=this.tsParseModifier(e.concat(t??[]),r);if(!p)break;ei(p)?a.accessibility?this.raise(k.DuplicateAccessibilityModifier,{at:c,modifier:p}):(o(c,p,p,"override"),o(c,p,p,"static"),o(c,p,p,"readonly"),a.accessibility=p):Pl(p)?(a[p]&&this.raise(k.DuplicateModifier,{at:c,modifier:p}),a[p]=!0,o(c,p,"in","out")):(Object.hasOwnProperty.call(a,p)?this.raise(k.DuplicateModifier,{at:c,modifier:p}):(o(c,p,"static","readonly"),o(c,p,"static","override"),o(c,p,"override","readonly"),o(c,p,"abstract","override"),l(c,p,"declare","override"),l(c,p,"static","abstract")),a[p]=!0),t!=null&&t.includes(p)&&this.raise(i,{at:c,modifier:p})}}tsIsListTerminator(e){switch(e){case"EnumMembers":case"TypeMembers":return this.match(8);case"HeritageClauseElement":return this.match(5);case"TupleElementTypes":return this.match(3);case"TypeParametersOrArguments":return this.match(48)}}tsParseList(e,t){let r=[];for(;!this.tsIsListTerminator(e);)r.push(t());return r}tsParseDelimitedList(e,t,r){return vl(this.tsParseDelimitedListWorker(e,t,!0,r))}tsParseDelimitedListWorker(e,t,r,i){let a=[],o=-1;for(;!this.tsIsListTerminator(e);){o=-1;let l=t();if(l==null)return;if(a.push(l),this.eat(12)){o=this.state.lastTokStart;continue}if(this.tsIsListTerminator(e))break;r&&this.expect(12);return}return i&&(i.value=o),a}tsParseBracketedList(e,t,r,i,a){i||(r?this.expect(0):this.expect(47));let o=this.tsParseDelimitedList(e,t,a);return r?this.expect(3):this.expect(48),o}tsParseImportType(){let e=this.startNode();return this.expect(83),this.expect(10),this.match(133)||this.raise(k.UnsupportedImportTypeArgument,{at:this.state.startLoc}),e.argument=super.parseExprAtom(),this.expect(11),this.eat(16)&&(e.qualifier=this.tsParseEntityName()),this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSImportType")}tsParseEntityName(e=!0){let t=this.parseIdentifier(e);for(;this.eat(16);){let r=this.startNodeAtNode(t);r.left=t,r.right=this.parseIdentifier(e),t=this.finishNode(r,"TSQualifiedName")}return t}tsParseTypeReference(){let e=this.startNode();return e.typeName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeReference")}tsParseThisTypePredicate(e){this.next();let t=this.startNodeAtNode(e);return t.parameterName=e,t.typeAnnotation=this.tsParseTypeAnnotation(!1),t.asserts=!1,this.finishNode(t,"TSTypePredicate")}tsParseThisTypeNode(){let e=this.startNode();return this.next(),this.finishNode(e,"TSThisType")}tsParseTypeQuery(){let e=this.startNode();return this.expect(87),this.match(83)?e.exprName=this.tsParseImportType():e.exprName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeQuery")}tsParseTypeParameter(e){let t=this.startNode();return e(t),t.name=this.tsParseTypeParameterName(),t.constraint=this.tsEatThenParseType(81),t.default=this.tsEatThenParseType(29),this.finishNode(t,"TSTypeParameter")}tsTryParseTypeParameters(e){if(this.match(47))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){let t=this.startNode();this.match(47)||this.match(142)?this.next():this.unexpected();let r={value:-1};return t.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,e),!1,!0,r),t.params.length===0&&this.raise(k.EmptyTypeParameters,{at:t}),r.value!==-1&&this.addExtra(t,"trailingComma",r.value),this.finishNode(t,"TSTypeParameterDeclaration")}tsFillSignature(e,t){let r=e===19,i="parameters",a="typeAnnotation";t.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),t[i]=this.tsParseBindingListForSignature(),r?t[a]=this.tsParseTypeOrTypePredicateAnnotation(e):this.match(e)&&(t[a]=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){let e=super.parseBindingList(11,41,2);for(let t of e){let{type:r}=t;(r==="AssignmentPattern"||r==="TSParameterProperty")&&this.raise(k.UnsupportedSignatureParameterKind,{at:t,type:r})}return e}tsParseTypeMemberSemicolon(){!this.eat(12)&&!this.isLineTerminator()&&this.expect(13)}tsParseSignatureMember(e,t){return this.tsFillSignature(14,t),this.tsParseTypeMemberSemicolon(),this.finishNode(t,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),R(this.state.type)?(this.next(),this.match(14)):!1}tsTryParseIndexSignature(e){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);let t=this.parseIdentifier();t.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(t),this.expect(3),e.parameters=[t];let r=this.tsTryParseTypeAnnotation();return r&&(e.typeAnnotation=r),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSIndexSignature")}tsParsePropertyOrMethodSignature(e,t){this.eat(17)&&(e.optional=!0);let r=e;if(this.match(10)||this.match(47)){t&&this.raise(k.ReadonlyForMethodSignature,{at:e});let i=r;i.kind&&this.match(47)&&this.raise(k.AccesorCannotHaveTypeParameters,{at:this.state.curPosition()}),this.tsFillSignature(14,i),this.tsParseTypeMemberSemicolon();let a="parameters",o="typeAnnotation";if(i.kind==="get")i[a].length>0&&(this.raise(b.BadGetterArity,{at:this.state.curPosition()}),this.isThisParam(i[a][0])&&this.raise(k.AccesorCannotDeclareThisParameter,{at:this.state.curPosition()}));else if(i.kind==="set"){if(i[a].length!==1)this.raise(b.BadSetterArity,{at:this.state.curPosition()});else{let l=i[a][0];this.isThisParam(l)&&this.raise(k.AccesorCannotDeclareThisParameter,{at:this.state.curPosition()}),l.type==="Identifier"&&l.optional&&this.raise(k.SetAccesorCannotHaveOptionalParameter,{at:this.state.curPosition()}),l.type==="RestElement"&&this.raise(k.SetAccesorCannotHaveRestParameter,{at:this.state.curPosition()})}i[o]&&this.raise(k.SetAccesorCannotHaveReturnType,{at:i[o]})}else i.kind="method";return this.finishNode(i,"TSMethodSignature")}else{let i=r;t&&(i.readonly=!0);let a=this.tsTryParseTypeAnnotation();return a&&(i.typeAnnotation=a),this.tsParseTypeMemberSemicolon(),this.finishNode(i,"TSPropertySignature")}}tsParseTypeMember(){let e=this.startNode();if(this.match(10)||this.match(47))return this.tsParseSignatureMember("TSCallSignatureDeclaration",e);if(this.match(77)){let r=this.startNode();return this.next(),this.match(10)||this.match(47)?this.tsParseSignatureMember("TSConstructSignatureDeclaration",e):(e.key=this.createIdentifier(r,"new"),this.tsParsePropertyOrMethodSignature(e,!1))}this.tsParseModifiers({allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]},e);let t=this.tsTryParseIndexSignature(e);return t||(super.parsePropertyName(e),!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.tsTokenCanFollowModifier()&&(e.kind=e.key.name,super.parsePropertyName(e)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))}tsParseTypeLiteral(){let e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(5);let e=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(8),e}tsIsStartOfMappedType(){return this.next(),this.eat(53)?this.isContextual(122):(this.isContextual(122)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(58)))}tsParseMappedTypeParameter(){let e=this.startNode();return e.name=this.tsParseTypeParameterName(),e.constraint=this.tsExpectThenParseType(58),this.finishNode(e,"TSTypeParameter")}tsParseMappedType(){let e=this.startNode();return this.expect(5),this.match(53)?(e.readonly=this.state.value,this.next(),this.expectContextual(122)):this.eatContextual(122)&&(e.readonly=!0),this.expect(0),e.typeParameter=this.tsParseMappedTypeParameter(),e.nameType=this.eatContextual(93)?this.tsParseType():null,this.expect(3),this.match(53)?(e.optional=this.state.value,this.next(),this.expect(17)):this.eat(17)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(8),this.finishNode(e,"TSMappedType")}tsParseTupleType(){let e=this.startNode();e.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let t=!1;return e.elementTypes.forEach(r=>{let{type:i}=r;t&&i!=="TSRestType"&&i!=="TSOptionalType"&&!(i==="TSNamedTupleMember"&&r.optional)&&this.raise(k.OptionalTypeBeforeRequired,{at:r}),t||(t=i==="TSNamedTupleMember"&&r.optional||i==="TSOptionalType")}),this.finishNode(e,"TSTupleType")}tsParseTupleElementType(){let{startLoc:e}=this.state,t=this.eat(21),r,i,a,o,c=xe(this.state.type)?this.lookaheadCharCode():null;if(c===58)r=!0,a=!1,i=this.parseIdentifier(!0),this.expect(14),o=this.tsParseType();else if(c===63){a=!0;let p=this.state.startLoc,u=this.state.value,h=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(r=!0,i=this.createIdentifier(this.startNodeAt(p),u),this.expect(17),this.expect(14),o=this.tsParseType()):(r=!1,o=h,this.expect(17))}else o=this.tsParseType(),a=this.eat(17),r=this.eat(14);if(r){let p;i?(p=this.startNodeAtNode(i),p.optional=a,p.label=i,p.elementType=o,this.eat(17)&&(p.optional=!0,this.raise(k.TupleOptionalAfterType,{at:this.state.lastTokStartLoc}))):(p=this.startNodeAtNode(o),p.optional=a,this.raise(k.InvalidTupleMemberLabel,{at:o}),p.label=o,p.elementType=this.tsParseType()),o=this.finishNode(p,"TSNamedTupleMember")}else if(a){let p=this.startNodeAtNode(o);p.typeAnnotation=o,o=this.finishNode(p,"TSOptionalType")}if(t){let p=this.startNodeAt(e);p.typeAnnotation=o,o=this.finishNode(p,"TSRestType")}return o}tsParseParenthesizedType(){let e=this.startNode();return this.expect(10),e.typeAnnotation=this.tsParseType(),this.expect(11),this.finishNode(e,"TSParenthesizedType")}tsParseFunctionOrConstructorType(e,t){let r=this.startNode();return e==="TSConstructorType"&&(r.abstract=!!t,t&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,r)),this.finishNode(r,e)}tsParseLiteralTypeNode(){let e=this.startNode();switch(this.state.type){case 134:case 135:case 133:case 85:case 86:e.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(e,"TSLiteralType")}tsParseTemplateLiteralType(){let e=this.startNode();return e.literal=super.parseTemplate(!1),this.finishNode(e,"TSLiteralType")}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let e=this.tsParseThisTypeNode();return this.isContextual(116)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseNonArrayType(){switch(this.state.type){case 133:case 134:case 135:case 85:case 86:return this.tsParseLiteralTypeNode();case 53:if(this.state.value==="-"){let e=this.startNode(),t=this.lookahead();return t.type!==134&&t.type!==135&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,"TSLiteralType")}break;case 78:return this.tsParseThisTypeOrThisTypePredicate();case 87:return this.tsParseTypeQuery();case 83:return this.tsParseImportType();case 5:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 10:return this.tsParseParenthesizedType();case 25:case 24:return this.tsParseTemplateLiteralType();default:{let{type:e}=this.state;if(R(e)||e===88||e===84){let t=e===88?"TSVoidKeyword":e===84?"TSNullKeyword":xl(this.state.value);if(t!==void 0&&this.lookaheadCharCode()!==46){let r=this.startNode();return this.next(),this.finishNode(r,t)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let e=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(3)){let t=this.startNodeAtNode(e);t.elementType=e,this.expect(3),e=this.finishNode(t,"TSArrayType")}else{let t=this.startNodeAtNode(e);t.objectType=e,t.indexType=this.tsParseType(),this.expect(3),e=this.finishNode(t,"TSIndexedAccessType")}return e}tsParseTypeOperator(){let e=this.startNode(),t=this.state.value;return this.next(),e.operator=t,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),t==="readonly"&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(k.UnexpectedReadonly,{at:e})}}tsParseInferType(){let e=this.startNode();this.expectContextual(115);let t=this.startNode();return t.name=this.tsParseTypeParameterName(),t.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(t,"TSTypeParameter"),this.finishNode(e,"TSInferType")}tsParseConstraintForInferType(){if(this.eat(81)){let e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(17))return e}}tsParseTypeOperatorOrHigher(){return _o(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(115)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,t,r){let i=this.startNode(),a=this.eat(r),o=[];do o.push(t());while(this.eat(r));return o.length===1&&!a?o[0]:(i.types=o,this.finishNode(i,e))}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),45)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),43)}tsIsStartOfFunctionType(){return this.match(47)?!0:this.match(10)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(R(this.state.type)||this.match(78))return this.next(),!0;if(this.match(5)){let{errors:e}=this.state,t=e.length;try{return this.parseObjectLike(8,!0),e.length===t}catch{return!1}}if(this.match(0)){this.next();let{errors:e}=this.state,t=e.length;try{return super.parseBindingList(3,93,1),e.length===t}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(11)||this.match(21)||this.tsSkipParameterStart()&&(this.match(14)||this.match(12)||this.match(17)||this.match(29)||this.match(11)&&(this.next(),this.match(19))))}tsParseTypeOrTypePredicateAnnotation(e){return this.tsInType(()=>{let t=this.startNode();this.expect(e);let r=this.startNode(),i=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(i&&this.match(78)){let l=this.tsParseThisTypeOrThisTypePredicate();return l.type==="TSThisType"?(r.parameterName=l,r.asserts=!0,r.typeAnnotation=null,l=this.finishNode(r,"TSTypePredicate")):(this.resetStartLocationFromNode(l,r),l.asserts=!0),t.typeAnnotation=l,this.finishNode(t,"TSTypeAnnotation")}let a=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!a)return i?(r.parameterName=this.parseIdentifier(),r.asserts=i,r.typeAnnotation=null,t.typeAnnotation=this.finishNode(r,"TSTypePredicate"),this.finishNode(t,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,t);let o=this.tsParseTypeAnnotation(!1);return r.parameterName=a,r.typeAnnotation=o,r.asserts=i,t.typeAnnotation=this.finishNode(r,"TSTypePredicate"),this.finishNode(t,"TSTypeAnnotation")})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(14))return this.tsParseTypeOrTypePredicateAnnotation(14)}tsTryParseTypeAnnotation(){if(this.match(14))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(14)}tsParseTypePredicatePrefix(){let e=this.parseIdentifier();if(this.isContextual(116)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(this.state.type!==109)return!1;let e=this.state.containsEsc;return this.next(),!R(this.state.type)&&!this.match(78)?!1:(e&&this.raise(b.InvalidEscapedReservedWord,{at:this.state.lastTokStartLoc,reservedWord:"asserts"}),!0)}tsParseTypeAnnotation(e=!0,t=this.startNode()){return this.tsInType(()=>{e&&this.expect(14),t.typeAnnotation=this.tsParseType()}),this.finishNode(t,"TSTypeAnnotation")}tsParseType(){Zs(this.state.inType);let e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(81))return e;let t=this.startNodeAtNode(e);return t.checkType=e,t.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(17),t.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(14),t.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(t,"TSConditionalType")}isAbstractConstructorSignature(){return this.isContextual(124)&&this.lookahead().type===77}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(77)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(k.ReservedTypeAssertion,{at:this.state.startLoc});let e=this.startNode();return e.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?this.tsParseTypeReference():this.tsParseType())),this.expect(48),e.expression=this.parseMaybeUnary(),this.finishNode(e,"TSTypeAssertion")}tsParseHeritageClause(e){let t=this.state.startLoc,r=this.tsParseDelimitedList("HeritageClauseElement",()=>{let i=this.startNode();return i.expression=this.tsParseEntityName(),this.match(47)&&(i.typeParameters=this.tsParseTypeArguments()),this.finishNode(i,"TSExpressionWithTypeArguments")});return r.length||this.raise(k.EmptyHeritageClauseType,{at:t,token:e}),r}tsParseInterfaceDeclaration(e,t={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(129),t.declare&&(e.declare=!0),R(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(k.MissingInterfaceName,{at:this.state.startLoc})),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81)&&(e.extends=this.tsParseHeritageClause("extends"));let r=this.startNode();return r.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(r,"TSInterfaceBody"),this.finishNode(e,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(e){return e.id=this.parseIdentifier(),this.checkIdentifier(e.id,2),e.typeAnnotation=this.tsInType(()=>{if(e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(29),this.isContextual(114)&&this.lookahead().type!==16){let t=this.startNode();return this.next(),this.finishNode(t,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(e,"TSTypeAliasDeclaration")}tsInNoContext(e){let t=this.state.context;this.state.context=[t[0]];try{return e()}finally{this.state.context=t}}tsInType(e){let t=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=t}}tsInDisallowConditionalTypesContext(e){let t=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.state.inDisallowConditionalTypesContext=t}}tsInAllowConditionalTypesContext(e){let t=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.state.inDisallowConditionalTypesContext=t}}tsEatThenParseType(e){if(this.match(e))return this.tsNextThenParseType()}tsExpectThenParseType(e){return this.tsInType(()=>(this.expect(e),this.tsParseType()))}tsNextThenParseType(){return this.tsInType(()=>(this.next(),this.tsParseType()))}tsParseEnumMember(){let e=this.startNode();return e.id=this.match(133)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(29)&&(e.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(e,"TSEnumMember")}tsParseEnumDeclaration(e,t={}){return t.const&&(e.const=!0),t.declare&&(e.declare=!0),this.expectContextual(126),e.id=this.parseIdentifier(),this.checkIdentifier(e.id,e.const?8971:8459),this.expect(5),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(e,"TSEnumDeclaration")}tsParseModuleBlock(){let e=this.startNode();return this.scope.enter(0),this.expect(5),super.parseBlockOrModuleBlockBody(e.body=[],void 0,!0,8),this.scope.exit(),this.finishNode(e,"TSModuleBlock")}tsParseModuleOrNamespaceDeclaration(e,t=!1){if(e.id=this.parseIdentifier(),t||this.checkIdentifier(e.id,1024),this.eat(16)){let r=this.startNode();this.tsParseModuleOrNamespaceDeclaration(r,!0),e.body=r}else this.scope.enter(256),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit();return this.finishNode(e,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(e){return this.isContextual(112)?(e.global=!0,e.id=this.parseIdentifier()):this.match(133)?e.id=super.parseStringLiteral(this.state.value):this.unexpected(),this.match(5)?(this.scope.enter(256),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit()):this.semicolon(),this.finishNode(e,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(e,t,r){e.isExport=r||!1,e.id=t||this.parseIdentifier(),this.checkIdentifier(e.id,4096),this.expect(29);let i=this.tsParseModuleReference();return e.importKind==="type"&&i.type!=="TSExternalModuleReference"&&this.raise(k.ImportAliasHasImportType,{at:i}),e.moduleReference=i,this.semicolon(),this.finishNode(e,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(119)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)}tsParseExternalModuleReference(){let e=this.startNode();return this.expectContextual(119),this.expect(10),this.match(133)||this.unexpected(),e.expression=super.parseExprAtom(),this.expect(11),this.sawUnambiguousESM=!0,this.finishNode(e,"TSExternalModuleReference")}tsLookAhead(e){let t=this.state.clone(),r=e();return this.state=t,r}tsTryParseAndCatch(e){let t=this.tryParse(r=>e()||r());if(!(t.aborted||!t.node))return t.error&&(this.state=t.failState),t.node}tsTryParse(e){let t=this.state.clone(),r=e();if(r!==void 0&&r!==!1)return r;this.state=t}tsTryParseDeclare(e){if(this.isLineTerminator())return;let t=this.state.type,r;return this.isContextual(100)&&(t=74,r="let"),this.tsInAmbientContext(()=>{switch(t){case 68:return e.declare=!0,super.parseFunctionStatement(e,!1,!1);case 80:return e.declare=!0,this.parseClass(e,!0,!1);case 126:return this.tsParseEnumDeclaration(e,{declare:!0});case 112:return this.tsParseAmbientExternalModuleDeclaration(e);case 75:case 74:return!this.match(75)||!this.isLookaheadContextual("enum")?(e.declare=!0,this.parseVarStatement(e,r||this.state.value,!0)):(this.expect(75),this.tsParseEnumDeclaration(e,{const:!0,declare:!0}));case 129:{let i=this.tsParseInterfaceDeclaration(e,{declare:!0});if(i)return i}default:if(R(t))return this.tsParseDeclaration(e,this.state.value,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.value,!0,null)}tsParseExpressionStatement(e,t,r){switch(t.name){case"declare":{let i=this.tsTryParseDeclare(e);return i&&(i.declare=!0),i}case"global":if(this.match(5)){this.scope.enter(256),this.prodParam.enter(0);let i=e;return i.global=!0,i.id=t,i.body=this.tsParseModuleBlock(),this.scope.exit(),this.prodParam.exit(),this.finishNode(i,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(e,t.name,!1,r)}}tsParseDeclaration(e,t,r,i){switch(t){case"abstract":if(this.tsCheckLineTerminator(r)&&(this.match(80)||R(this.state.type)))return this.tsParseAbstractDeclaration(e,i);break;case"module":if(this.tsCheckLineTerminator(r)){if(this.match(133))return this.tsParseAmbientExternalModuleDeclaration(e);if(R(this.state.type))return this.tsParseModuleOrNamespaceDeclaration(e)}break;case"namespace":if(this.tsCheckLineTerminator(r)&&R(this.state.type))return this.tsParseModuleOrNamespaceDeclaration(e);break;case"type":if(this.tsCheckLineTerminator(r)&&R(this.state.type))return this.tsParseTypeAliasDeclaration(e);break}}tsCheckLineTerminator(e){return e?this.hasFollowingLineBreak()?!1:(this.next(),!0):!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(e){if(!this.match(47))return;let t=this.state.maybeInArrowParameters;this.state.maybeInArrowParameters=!0;let r=this.tsTryParseAndCatch(()=>{let i=this.startNodeAt(e);return i.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(i),i.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(19),i});if(this.state.maybeInArrowParameters=t,!!r)return super.parseArrowExpression(r,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===47)return this.tsParseTypeArguments()}tsParseTypeArguments(){let e=this.startNode();return e.params=this.tsInType(()=>this.tsInNoContext(()=>(this.expect(47),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),e.params.length===0?this.raise(k.EmptyTypeArguments,{at:e}):!this.state.inType&&this.curContext()===V.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return Bo(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseAssignableListItem(e,t){let r=this.state.startLoc,i={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},i);let a=i.accessibility,o=i.override,l=i.readonly;!(e&4)&&(a||l||o)&&this.raise(k.UnexpectedParameterModifier,{at:r});let c=this.parseMaybeDefault();this.parseAssignableListItemTypes(c,e);let p=this.parseMaybeDefault(c.loc.start,c);if(a||l||o){let u=this.startNodeAt(r);return t.length&&(u.decorators=t),a&&(u.accessibility=a),l&&(u.readonly=l),o&&(u.override=o),p.type!=="Identifier"&&p.type!=="AssignmentPattern"&&this.raise(k.UnsupportedParameterPropertyKind,{at:u}),u.parameter=p,this.finishNode(u,"TSParameterProperty")}return t.length&&(c.decorators=t),p}isSimpleParameter(e){return e.type==="TSParameterProperty"&&super.isSimpleParameter(e.parameter)||super.isSimpleParameter(e)}tsDisallowOptionalPattern(e){for(let t of e.params)t.type!=="Identifier"&&t.optional&&!this.state.isAmbientContext&&this.raise(k.PatternIsOptional,{at:t})}setArrowFunctionParameters(e,t,r){super.setArrowFunctionParameters(e,t,r),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,t,r=!1){this.match(14)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(14));let i=t==="FunctionDeclaration"?"TSDeclareFunction":t==="ClassMethod"||t==="ClassPrivateMethod"?"TSDeclareMethod":void 0;return i&&!this.match(5)&&this.isLineTerminator()?this.finishNode(e,i):i==="TSDeclareFunction"&&this.state.isAmbientContext&&(this.raise(k.DeclareFunctionHasImplementation,{at:e}),e.declare)?super.parseFunctionBodyAndFinish(e,i,r):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,t,r))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,1024):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(t=>{t?.type==="TSTypeCastExpression"&&this.raise(k.UnexpectedTypeAnnotation,{at:t.typeAnnotation})})}toReferencedList(e,t){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,t,r,i){let a=super.parseArrayLike(e,t,r,i);return a.type==="ArrayExpression"&&this.tsCheckForInvalidTypeCasts(a.elements),a}parseSubscript(e,t,r,i){if(!this.hasPrecedingLineBreak()&&this.match(35)){this.state.canStartJSXElement=!1,this.next();let o=this.startNodeAt(t);return o.expression=e,this.finishNode(o,"TSNonNullExpression")}let a=!1;if(this.match(18)&&this.lookaheadCharCode()===60){if(r)return i.stop=!0,e;i.optionalChainMember=a=!0,this.next()}if(this.match(47)||this.match(51)){let o,l=this.tsTryParseAndCatch(()=>{if(!r&&this.atPossibleAsyncArrow(e)){let h=this.tsTryParseGenericAsyncArrowFunction(t);if(h)return h}let c=this.tsParseTypeArgumentsInExpression();if(!c)return;if(a&&!this.match(10)){o=this.state.curPosition();return}if(xn(this.state.type)){let h=super.parseTaggedTemplateExpression(e,t,i);return h.typeParameters=c,h}if(!r&&this.eat(10)){let h=this.startNodeAt(t);return h.callee=e,h.arguments=this.parseCallExpressionArguments(11,!1),this.tsCheckForInvalidTypeCasts(h.arguments),h.typeParameters=c,i.optionalChainMember&&(h.optional=a),this.finishCallExpression(h,i.optionalChainMember)}let p=this.state.type;if(p===48||p===52||p!==10&&fr(p)&&!this.hasPrecedingLineBreak())return;let u=this.startNodeAt(t);return u.expression=e,u.typeParameters=c,this.finishNode(u,"TSInstantiationExpression")});if(o&&this.unexpected(o,10),l)return l.type==="TSInstantiationExpression"&&(this.match(16)||this.match(18)&&this.lookaheadCharCode()!==40)&&this.raise(k.InvalidPropertyAccessAfterInstantiationExpression,{at:this.state.startLoc}),l}return super.parseSubscript(e,t,r,i)}parseNewCallee(e){var t;super.parseNewCallee(e);let{callee:r}=e;r.type==="TSInstantiationExpression"&&!((t=r.extra)!=null&&t.parenthesized)&&(e.typeParameters=r.typeParameters,e.callee=r.expression)}parseExprOp(e,t,r){let i;if(mn(58)>r&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(i=this.isContextual(120)))){let a=this.startNodeAt(t);return a.expression=e,a.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?(i&&this.raise(b.UnexpectedKeyword,{at:this.state.startLoc,keyword:"const"}),this.tsParseTypeReference()):this.tsParseType())),this.finishNode(a,i?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(a,t,r)}return super.parseExprOp(e,t,r)}checkReservedWord(e,t,r,i){this.state.isAmbientContext||super.checkReservedWord(e,t,r,i)}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(k.ImportReflectionHasImportType,{at:e.specifiers[0].loc.start})}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){let t=this.lookaheadCharCode();return e?t===123||t===42:t!==61}return!e&&this.isContextual(87)}applyImportPhase(e,t,r,i){super.applyImportPhase(e,t,r,i),t?e.exportKind=r==="type"?"type":"value":e.importKind=r==="type"||r==="typeof"?r:"value"}parseImport(e){if(this.match(133))return e.importKind="value",super.parseImport(e);let t;if(R(this.state.type)&&this.lookaheadCharCode()===61)return e.importKind="value",this.tsParseImportEqualsDeclaration(e);if(this.isContextual(130)){let r=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.tsParseImportEqualsDeclaration(e,r);t=super.parseImportSpecifiersAndAfter(e,r)}else t=super.parseImport(e);return t.importKind==="type"&&t.specifiers.length>1&&t.specifiers[0].type==="ImportDefaultSpecifier"&&this.raise(k.TypeImportCannotSpecifyDefaultAndNamed,{at:t}),t}parseExport(e,t){if(this.match(83)){this.next();let r=null;return this.isContextual(130)&&this.isPotentialImportPhase(!1)?r=this.parseMaybeImportPhase(e,!1):e.importKind="value",this.tsParseImportEqualsDeclaration(e,r,!0)}else if(this.eat(29)){let r=e;return r.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(r,"TSExportAssignment")}else if(this.eatContextual(93)){let r=e;return this.expectContextual(128),r.id=this.parseIdentifier(),this.semicolon(),this.finishNode(r,"TSNamespaceExportDeclaration")}else return super.parseExport(e,t)}isAbstractClass(){return this.isContextual(124)&&this.lookahead().type===80}parseExportDefaultExpression(){if(this.isAbstractClass()){let e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0,!0)}if(this.match(129)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultExpression()}parseVarStatement(e,t,r=!1){let{isAmbientContext:i}=this.state,a=super.parseVarStatement(e,t,r||i);if(!i)return a;for(let{id:o,init:l}of a.declarations)l&&(t!=="const"||o.typeAnnotation?this.raise(k.InitializerNotAllowedInAmbientContext,{at:l}):Cl(l,this.hasPlugin("estree"))||this.raise(k.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference,{at:l}));return a}parseStatementContent(e,t){if(this.match(75)&&this.isLookaheadContextual("enum")){let r=this.startNode();return this.expect(75),this.tsParseEnumDeclaration(r,{const:!0})}if(this.isContextual(126))return this.tsParseEnumDeclaration(this.startNode());if(this.isContextual(129)){let r=this.tsParseInterfaceDeclaration(this.startNode());if(r)return r}return super.parseStatementContent(e,t)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(e,t){return t.some(r=>ei(r)?e.accessibility===r:!!e[r])}tsIsStartOfStaticBlocks(){return this.isContextual(106)&&this.lookaheadCharCode()===123}parseClassMember(e,t,r){let i=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:i,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:k.InvalidModifierOnTypeParameterPositions},t);let a=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(t,i)&&this.raise(k.StaticBlockCannotHaveModifier,{at:this.state.curPosition()}),super.parseClassStaticBlock(e,t)):this.parseClassMemberWithIsStatic(e,t,r,!!t.static)};t.declare?this.tsInAmbientContext(a):a()}parseClassMemberWithIsStatic(e,t,r,i){let a=this.tsTryParseIndexSignature(t);if(a){e.body.push(a),t.abstract&&this.raise(k.IndexSignatureHasAbstract,{at:t}),t.accessibility&&this.raise(k.IndexSignatureHasAccessibility,{at:t,modifier:t.accessibility}),t.declare&&this.raise(k.IndexSignatureHasDeclare,{at:t}),t.override&&this.raise(k.IndexSignatureHasOverride,{at:t});return}!this.state.inAbstractClass&&t.abstract&&this.raise(k.NonAbstractClassHasAbstractMethod,{at:t}),t.override&&(r.hadSuperClass||this.raise(k.OverrideNotInSubClass,{at:t})),super.parseClassMemberWithIsStatic(e,t,r,i)}parsePostMemberNameModifiers(e){this.eat(17)&&(e.optional=!0),e.readonly&&this.match(10)&&this.raise(k.ClassMethodHasReadonly,{at:e}),e.declare&&this.match(10)&&this.raise(k.ClassMethodHasDeclare,{at:e})}parseExpressionStatement(e,t,r){return(t.type==="Identifier"?this.tsParseExpressionStatement(e,t,r):void 0)||super.parseExpressionStatement(e,t,r)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(e,t,r){if(!this.state.maybeInArrowParameters||!this.match(17))return super.parseConditional(e,t,r);let i=this.tryParse(()=>super.parseConditional(e,t));return i.node?(i.error&&(this.state=i.failState),i.node):(i.error&&super.setOptionalParametersError(r,i.error),e)}parseParenItem(e,t){if(e=super.parseParenItem(e,t),this.eat(17)&&(e.optional=!0,this.resetEndLocation(e)),this.match(14)){let r=this.startNodeAt(t);return r.expression=e,r.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(r,"TSTypeCastExpression")}return e}parseExportDeclaration(e){if(!this.state.isAmbientContext&&this.isContextual(125))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));let t=this.state.startLoc,r=this.eatContextual(125);if(r&&(this.isContextual(125)||!this.shouldParseExportDeclaration()))throw this.raise(k.ExpectedAmbientAfterExportDeclare,{at:this.state.startLoc});let a=R(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return a?((a.type==="TSInterfaceDeclaration"||a.type==="TSTypeAliasDeclaration"||r)&&(e.exportKind="type"),r&&(this.resetStartLocation(a,t),a.declare=!0),a):null}parseClassId(e,t,r,i){if((!t||r)&&this.isContextual(113))return;super.parseClassId(e,t,r,e.declare?1024:8331);let a=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);a&&(e.typeParameters=a)}parseClassPropertyAnnotation(e){e.optional||(this.eat(35)?e.definite=!0:this.eat(17)&&(e.optional=!0));let t=this.tsTryParseTypeAnnotation();t&&(e.typeAnnotation=t)}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&!(e.readonly&&!e.typeAnnotation)&&this.match(29)&&this.raise(k.DeclareClassFieldHasInitializer,{at:this.state.startLoc}),e.abstract&&this.match(29)){let{key:t}=e;this.raise(k.AbstractPropertyHasInitializer,{at:this.state.startLoc,propertyName:t.type==="Identifier"&&!e.computed?t.name:`[${this.input.slice(t.start,t.end)}]`})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(k.PrivateElementHasAbstract,{at:e}),e.accessibility&&this.raise(k.PrivateElementHasAccessibility,{at:e,modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(k.AccessorCannotBeOptional,{at:e}),super.parseClassAccessorProperty(e)}pushClassMethod(e,t,r,i,a,o){let l=this.tsTryParseTypeParameters(this.tsParseConstModifier);l&&a&&this.raise(k.ConstructorHasTypeParameters,{at:l});let{declare:c=!1,kind:p}=t;c&&(p==="get"||p==="set")&&this.raise(k.DeclareAccessor,{at:t,kind:p}),l&&(t.typeParameters=l),super.pushClassMethod(e,t,r,i,a,o)}pushClassPrivateMethod(e,t,r,i){let a=this.tsTryParseTypeParameters(this.tsParseConstModifier);a&&(t.typeParameters=a),super.pushClassPrivateMethod(e,t,r,i)}declareClassPrivateMethodInScope(e,t){e.type!=="TSDeclareMethod"&&(e.type==="MethodDefinition"&&!e.value.body||super.declareClassPrivateMethodInScope(e,t))}parseClassSuper(e){super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeParameters=this.tsParseTypeArgumentsInExpression()),this.eatContextual(113)&&(e.implements=this.tsParseHeritageClause("implements"))}parseObjPropValue(e,t,r,i,a,o,l){let c=this.tsTryParseTypeParameters(this.tsParseConstModifier);return c&&(e.typeParameters=c),super.parseObjPropValue(e,t,r,i,a,o,l)}parseFunctionParams(e,t){let r=this.tsTryParseTypeParameters(this.tsParseConstModifier);r&&(e.typeParameters=r),super.parseFunctionParams(e,t)}parseVarId(e,t){super.parseVarId(e,t),e.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(35)&&(e.definite=!0);let r=this.tsTryParseTypeAnnotation();r&&(e.id.typeAnnotation=r,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,t){return this.match(14)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,t)}parseMaybeAssign(e,t){var r,i,a,o,l;let c,p,u;if(this.hasPlugin("jsx")&&(this.match(142)||this.match(47))){if(c=this.state.clone(),p=this.tryParse(()=>super.parseMaybeAssign(e,t),c),!p.error)return p.node;let{context:d}=this.state,g=d[d.length-1];(g===V.j_oTag||g===V.j_expr)&&d.pop()}if(!((r=p)!=null&&r.error)&&!this.match(47))return super.parseMaybeAssign(e,t);(!c||c===this.state)&&(c=this.state.clone());let h,m=this.tryParse(d=>{var g,f;h=this.tsParseTypeParameters(this.tsParseConstModifier);let v=super.parseMaybeAssign(e,t);return(v.type!=="ArrowFunctionExpression"||(g=v.extra)!=null&&g.parenthesized)&&d(),((f=h)==null?void 0:f.params.length)!==0&&this.resetStartLocationFromNode(v,h),v.typeParameters=h,v},c);if(!m.error&&!m.aborted)return h&&this.reportReservedArrowTypeParam(h),m.node;if(!p&&(Zs(!this.hasPlugin("jsx")),u=this.tryParse(()=>super.parseMaybeAssign(e,t),c),!u.error))return u.node;if((i=p)!=null&&i.node)return this.state=p.failState,p.node;if(m.node)return this.state=m.failState,h&&this.reportReservedArrowTypeParam(h),m.node;if((a=u)!=null&&a.node)return this.state=u.failState,u.node;throw((o=p)==null?void 0:o.error)||m.error||((l=u)==null?void 0:l.error)}reportReservedArrowTypeParam(e){var t;e.params.length===1&&!e.params[0].constraint&&!((t=e.extra)!=null&&t.trailingComma)&&this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(k.ReservedArrowTypeParam,{at:e})}parseMaybeUnary(e,t){return!this.hasPlugin("jsx")&&this.match(47)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,t)}parseArrow(e){if(this.match(14)){let t=this.tryParse(r=>{let i=this.tsParseTypeOrTypePredicateAnnotation(14);return(this.canInsertSemicolon()||!this.match(19))&&r(),i});if(t.aborted)return;t.thrown||(t.error&&(this.state=t.failState),e.returnType=t.node)}return super.parseArrow(e)}parseAssignableListItemTypes(e,t){if(!(t&2))return e;this.eat(17)&&(e.optional=!0);let r=this.tsTryParseTypeAnnotation();return r&&(e.typeAnnotation=r),this.resetEndLocation(e),e}isAssignable(e,t){switch(e.type){case"TSTypeCastExpression":return this.isAssignable(e.expression,t);case"TSParameterProperty":return!0;default:return super.isAssignable(e,t)}}toAssignable(e,t=!1){switch(e.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(e,t);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":t?this.expressionScope.recordArrowParameterBindingError(k.UnexpectedTypeCastInParameter,{at:e}):this.raise(k.UnexpectedTypeCastInParameter,{at:e}),this.toAssignable(e.expression,t);break;case"AssignmentExpression":!t&&e.left.type==="TSTypeCastExpression"&&(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,t)}}toAssignableParenthesizedExpression(e,t){switch(e.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(e.expression,t);break;default:super.toAssignable(e,t)}}checkToRestConversion(e,t){switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(e.expression,!1);break;default:super.checkToRestConversion(e,t)}}isValidLVal(e,t,r){return yl({TSTypeCastExpression:!0,TSParameterProperty:"parameter",TSNonNullExpression:"expression",TSAsExpression:(r!==64||!t)&&["expression",!0],TSSatisfiesExpression:(r!==64||!t)&&["expression",!0],TSTypeAssertion:(r!==64||!t)&&["expression",!0]},e)||super.isValidLVal(e,t,r)}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e){if(this.match(47)||this.match(51)){let t=this.tsParseTypeArgumentsInExpression();if(this.match(10)){let r=super.parseMaybeDecoratorArguments(e);return r.typeParameters=t,r}this.unexpected(null,10)}return super.parseMaybeDecoratorArguments(e)}checkCommaAfterRest(e){return this.state.isAmbientContext&&this.match(12)&&this.lookaheadCharCode()===e?(this.next(),!1):super.checkCommaAfterRest(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(35)||this.match(14)||super.isClassProperty()}parseMaybeDefault(e,t){let r=super.parseMaybeDefault(e,t);return r.type==="AssignmentPattern"&&r.typeAnnotation&&r.right.start<r.typeAnnotation.start&&this.raise(k.TypeAnnotationAfterAssign,{at:r.typeAnnotation}),r}getTokenFromCode(e){if(this.state.inType){if(e===62){this.finishOp(48,1);return}if(e===60){this.finishOp(47,1);return}}super.getTokenFromCode(e)}reScan_lt_gt(){let{type:e}=this.state;e===47?(this.state.pos-=1,this.readToken_lt()):e===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===51?(this.state.pos-=2,this.finishOp(47,1),47):e}toAssignableList(e,t,r){for(let i=0;i<e.length;i++){let a=e[i];a?.type==="TSTypeCastExpression"&&(e[i]=this.typeCastToParameter(a))}super.toAssignableList(e,t,r)}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocation(e.expression,e.typeAnnotation.loc.end),e.expression}shouldParseArrow(e){return this.match(14)?e.every(t=>this.isAssignable(t,!0)):super.shouldParseArrow(e)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(e){if(this.match(47)||this.match(51)){let t=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());t&&(e.typeParameters=t)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){let t=super.getGetterSetterExpectedParamCount(e),i=this.getObjectOrClassMethodParams(e)[0];return i&&this.isThisParam(i)?t+1:t}parseCatchClauseParam(){let e=super.parseCatchClauseParam(),t=this.tsTryParseTypeAnnotation();return t&&(e.typeAnnotation=t,this.resetEndLocation(e)),e}tsInAmbientContext(e){let t=this.state.isAmbientContext;this.state.isAmbientContext=!0;try{return e()}finally{this.state.isAmbientContext=t}}parseClass(e,t,r){let i=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,t,r)}finally{this.state.inAbstractClass=i}}tsParseAbstractDeclaration(e,t){if(this.match(80))return e.abstract=!0,this.maybeTakeDecorators(t,this.parseClass(e,!0,!1));if(this.isContextual(129)){if(!this.hasFollowingLineBreak())return e.abstract=!0,this.raise(k.NonClassMethodPropertyHasAbstractModifer,{at:e}),this.tsParseInterfaceDeclaration(e)}else this.unexpected(null,80)}parseMethod(e,t,r,i,a,o,l){let c=super.parseMethod(e,t,r,i,a,o,l);if(c.abstract&&(this.hasPlugin("estree")?!!c.value.body:!!c.body)){let{key:u}=c;this.raise(k.AbstractMethodHasImplementation,{at:c,methodName:u.type==="Identifier"&&!c.computed?u.name:`[${this.input.slice(u.start,u.end)}]`})}return c}tsParseTypeParameterName(){return this.parseIdentifier().name}shouldParseAsAmbientContext(){return!!this.getPluginOption("typescript","dts")}parse(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.parse()}getExpression(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.getExpression()}parseExportSpecifier(e,t,r,i){return!t&&i?(this.parseTypeOnlyImportExportSpecifier(e,!1,r),this.finishNode(e,"ExportSpecifier")):(e.exportKind="value",super.parseExportSpecifier(e,t,r,i))}parseImportSpecifier(e,t,r,i,a){return!t&&i?(this.parseTypeOnlyImportExportSpecifier(e,!0,r),this.finishNode(e,"ImportSpecifier")):(e.importKind="value",super.parseImportSpecifier(e,t,r,i,r?4098:4096))}parseTypeOnlyImportExportSpecifier(e,t,r){let i=t?"imported":"local",a=t?"local":"exported",o=e[i],l,c=!1,p=!0,u=o.loc.start;if(this.isContextual(93)){let m=this.parseIdentifier();if(this.isContextual(93)){let d=this.parseIdentifier();xe(this.state.type)?(c=!0,o=m,l=t?this.parseIdentifier():this.parseModuleExportName(),p=!1):(l=d,p=!1)}else xe(this.state.type)?(p=!1,l=t?this.parseIdentifier():this.parseModuleExportName()):(c=!0,o=m)}else xe(this.state.type)&&(c=!0,t?(o=this.parseIdentifier(!0),this.isContextual(93)||this.checkReservedWord(o.name,o.loc.start,!0,!0)):o=this.parseModuleExportName());c&&r&&this.raise(t?k.TypeModifierIsUsedInTypeImports:k.TypeModifierIsUsedInTypeExports,{at:u}),e[i]=o,e[a]=l;let h=t?"importKind":"exportKind";e[h]=c?"type":"value",p&&this.eatContextual(93)&&(e[a]=t?this.parseIdentifier():this.parseModuleExportName()),e[a]||(e[a]=Be(e[i])),t&&this.checkIdentifier(e[a],c?4098:4096)}};function wl(s){if(s.type!=="MemberExpression")return!1;let{computed:n,property:e}=s;return n&&e.type!=="StringLiteral"&&(e.type!=="TemplateLiteral"||e.expressions.length>0)?!1:xi(s.object)}function Cl(s,n){var e;let{type:t}=s;if((e=s.extra)!=null&&e.parenthesized)return!1;if(n){if(t==="Literal"){let{value:r}=s;if(typeof r=="string"||typeof r=="boolean")return!0}}else if(t==="StringLiteral"||t==="BooleanLiteral")return!0;return!!(vi(s,n)||Sl(s,n)||t==="TemplateLiteral"&&s.expressions.length===0||wl(s))}function vi(s,n){return n?s.type==="Literal"&&(typeof s.value=="number"||"bigint"in s):s.type==="NumericLiteral"||s.type==="BigIntLiteral"}function Sl(s,n){if(s.type==="UnaryExpression"){let{operator:e,argument:t}=s;if(e==="-"&&vi(t,n))return!0}return!1}function xi(s){return s.type==="Identifier"?!0:s.type!=="MemberExpression"||s.computed?!1:xi(s.object)}var ti=_e`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."}),Il=s=>class extends s{parsePlaceholder(e){if(this.match(144)){let t=this.startNode();return this.next(),this.assertNoSpace(),t.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(144),this.finishPlaceholder(t,e)}}finishPlaceholder(e,t){let r=!!(e.expectedNode&&e.type==="Placeholder");return e.expectedNode=t,r?e:this.finishNode(e,"Placeholder")}getTokenFromCode(e){e===37&&this.input.charCodeAt(this.state.pos+1)===37?this.finishOp(144,2):super.getTokenFromCode(e)}parseExprAtom(e){return this.parsePlaceholder("Expression")||super.parseExprAtom(e)}parseIdentifier(e){return this.parsePlaceholder("Identifier")||super.parseIdentifier(e)}checkReservedWord(e,t,r,i){e!==void 0&&super.checkReservedWord(e,t,r,i)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(e,t,r){return e==="Placeholder"||super.isValidLVal(e,t,r)}toAssignable(e,t){e&&e.type==="Placeholder"&&e.expectedNode==="Expression"?e.expectedNode="Pattern":super.toAssignable(e,t)}chStartsBindingIdentifier(e,t){return!!(super.chStartsBindingIdentifier(e,t)||this.lookahead().type===144)}verifyBreakContinue(e,t){e.label&&e.label.type==="Placeholder"||super.verifyBreakContinue(e,t)}parseExpressionStatement(e,t){var r;if(t.type!=="Placeholder"||(r=t.extra)!=null&&r.parenthesized)return super.parseExpressionStatement(e,t);if(this.match(14)){let i=e;return i.label=this.finishPlaceholder(t,"Identifier"),this.next(),i.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(i,"LabeledStatement")}return this.semicolon(),e.name=t.name,this.finishPlaceholder(e,"Statement")}parseBlock(e,t,r){return this.parsePlaceholder("BlockStatement")||super.parseBlock(e,t,r)}parseFunctionId(e){return this.parsePlaceholder("Identifier")||super.parseFunctionId(e)}parseClass(e,t,r){let i=t?"ClassDeclaration":"ClassExpression";this.next();let a=this.state.strict,o=this.parsePlaceholder("Identifier");if(o)if(this.match(81)||this.match(144)||this.match(5))e.id=o;else{if(r||!t)return e.id=null,e.body=this.finishPlaceholder(o,"ClassBody"),this.finishNode(e,i);throw this.raise(ti.ClassNameIsRequired,{at:this.state.startLoc})}else this.parseClassId(e,t,r);return super.parseClassSuper(e),e.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!e.superClass,a),this.finishNode(e,i)}parseExport(e,t){let r=this.parsePlaceholder("Identifier");if(!r)return super.parseExport(e,t);if(!this.isContextual(98)&&!this.match(12))return e.specifiers=[],e.source=null,e.declaration=this.finishPlaceholder(r,"Declaration"),this.finishNode(e,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");let i=this.startNode();return i.exported=r,e.specifiers=[this.finishNode(i,"ExportDefaultSpecifier")],super.parseExport(e,t)}isExportDefaultSpecifier(){if(this.match(65)){let e=this.nextTokenStart();if(this.isUnparsedContextual(e,"from")&&this.input.startsWith(qe(144),this.nextTokenStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,t){var r;return(r=e.specifiers)!=null&&r.length?!0:super.maybeParseExportDefaultSpecifier(e,t)}checkExport(e){let{specifiers:t}=e;t!=null&&t.length&&(e.specifiers=t.filter(r=>r.exported.type==="Placeholder")),super.checkExport(e),e.specifiers=t}parseImport(e){let t=this.parsePlaceholder("Identifier");if(!t)return super.parseImport(e);if(e.specifiers=[],!this.isContextual(98)&&!this.match(12))return e.source=this.finishPlaceholder(t,"StringLiteral"),this.semicolon(),this.finishNode(e,"ImportDeclaration");let r=this.startNodeAtNode(t);return r.local=t,e.specifiers.push(this.finishNode(r,"ImportDefaultSpecifier")),this.eat(12)&&(this.maybeParseStarImportSpecifier(e)||this.parseNamedImportSpecifiers(e)),this.expectContextual(98),e.source=this.parseImportSource(),this.semicolon(),this.finishNode(e,"ImportDeclaration")}parseImportSource(){return this.parsePlaceholder("StringLiteral")||super.parseImportSource()}assertNoSpace(){this.state.start>this.state.lastTokEndLoc.index&&this.raise(ti.UnexpectedSpace,{at:this.state.lastTokEndLoc})}},El=s=>class extends s{parseV8Intrinsic(){if(this.match(54)){let e=this.state.startLoc,t=this.startNode();if(this.next(),R(this.state.type)){let r=this.parseIdentifierName(),i=this.createIdentifier(t,r);if(i.type="V8IntrinsicIdentifier",this.match(10))return i}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}};function Y(s,n){let[e,t]=typeof n=="string"?[n,{}]:n,r=Object.keys(t),i=r.length===0;return s.some(a=>{if(typeof a=="string")return i&&a===e;{let[o,l]=a;if(o!==e)return!1;for(let c of r)if(l[c]!==t[c])return!1;return!0}})}function $e(s,n,e){let t=s.find(r=>Array.isArray(r)?r[0]===n:r===n);return t&&Array.isArray(t)&&t.length>1?t[1][e]:null}var ni=["minimal","fsharp","hack","smart"],ri=["^^","@@","^","%","#"],si=["hash","bar"];function Al(s){if(Y(s,"decorators")){if(Y(s,"decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");let n=$e(s,"decorators","decoratorsBeforeExport");if(n!=null&&typeof n!="boolean")throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");let e=$e(s,"decorators","allowCallParenthesized");if(e!=null&&typeof e!="boolean")throw new Error("'allowCallParenthesized' must be a boolean.")}if(Y(s,"flow")&&Y(s,"typescript"))throw new Error("Cannot combine flow and typescript plugins.");if(Y(s,"placeholders")&&Y(s,"v8intrinsic"))throw new Error("Cannot combine placeholders and v8intrinsic plugins.");if(Y(s,"pipelineOperator")){let n=$e(s,"pipelineOperator","proposal");if(!ni.includes(n)){let t=ni.map(r=>`"${r}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${t}.`)}let e=Y(s,["recordAndTuple",{syntaxType:"hash"}]);if(n==="hack"){if(Y(s,"placeholders"))throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");if(Y(s,"v8intrinsic"))throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");let t=$e(s,"pipelineOperator","topicToken");if(!ri.includes(t)){let r=ri.map(i=>`"${i}"`).join(", ");throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${r}.`)}if(t==="#"&&e)throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "hack", topicToken: "#" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.')}else if(n==="smart"&&e)throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "smart" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.')}if(Y(s,"moduleAttributes")){if(Y(s,"importAssertions")||Y(s,"importAttributes"))throw new Error("Cannot combine importAssertions, importAttributes and moduleAttributes plugins.");if($e(s,"moduleAttributes","version")!=="may-2020")throw new Error("The 'moduleAttributes' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is 'may-2020'.")}if(Y(s,"importAssertions")&&Y(s,"importAttributes"))throw new Error("Cannot combine importAssertions and importAttributes plugins.");if(Y(s,"recordAndTuple")&&$e(s,"recordAndTuple","syntaxType")!=null&&!si.includes($e(s,"recordAndTuple","syntaxType")))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+si.map(n=>`'${n}'`).join(", "));if(Y(s,"asyncDoExpressions")&&!Y(s,"doExpressions")){let n=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw n.missingPlugins="doExpressions",n}if(Y(s,"optionalChainingAssign")&&$e(s,"optionalChainingAssign","version")!=="2023-07")throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.")}var Pi={estree:Eo,jsx:bl,flow:fl,typescript:Tl,v8intrinsic:El,placeholders:Il},kl=Object.keys(Pi),ur={sourceType:"script",sourceFilename:void 0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,plugins:[],strictMode:null,ranges:!1,tokens:!1,createImportExpressions:!1,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0};function Nl(s){if(s==null)return Object.assign({},ur);if(s.annexB!=null&&s.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");let n={};for(let t of Object.keys(ur)){var e;n[t]=(e=s[t])!=null?e:ur[t]}return n}var Dr=class extends Mr{checkProto(n,e,t,r){if(n.type==="SpreadElement"||this.isObjectMethod(n)||n.computed||n.shorthand)return;let i=n.key;if((i.type==="Identifier"?i.name:i.value)==="__proto__"){if(e){this.raise(b.RecordNoProto,{at:i});return}t.used&&(r?r.doubleProtoLoc===null&&(r.doubleProtoLoc=i.loc.start):this.raise(b.DuplicateProto,{at:i})),t.used=!0}}shouldExitDescending(n,e){return n.type==="ArrowFunctionExpression"&&n.start===e}getExpression(){this.enterInitialScopes(),this.nextToken();let n=this.parseExpression();return this.match(139)||this.unexpected(),this.finalizeRemainingComments(),n.comments=this.state.comments,n.errors=this.state.errors,this.options.tokens&&(n.tokens=this.tokens),n}parseExpression(n,e){return n?this.disallowInAnd(()=>this.parseExpressionBase(e)):this.allowInAnd(()=>this.parseExpressionBase(e))}parseExpressionBase(n){let e=this.state.startLoc,t=this.parseMaybeAssign(n);if(this.match(12)){let r=this.startNodeAt(e);for(r.expressions=[t];this.eat(12);)r.expressions.push(this.parseMaybeAssign(n));return this.toReferencedList(r.expressions),this.finishNode(r,"SequenceExpression")}return t}parseMaybeAssignDisallowIn(n,e){return this.disallowInAnd(()=>this.parseMaybeAssign(n,e))}parseMaybeAssignAllowIn(n,e){return this.allowInAnd(()=>this.parseMaybeAssign(n,e))}setOptionalParametersError(n,e){var t;n.optionalParametersLoc=(t=e?.loc)!=null?t:this.state.startLoc}parseMaybeAssign(n,e){let t=this.state.startLoc;if(this.isContextual(108)&&this.prodParam.hasYield){let o=this.parseYield();return e&&(o=e.call(this,o,t)),o}let r;n?r=!1:(n=new ct,r=!0);let{type:i}=this.state;(i===10||R(i))&&(this.state.potentialArrowAt=this.state.start);let a=this.parseMaybeConditional(n);if(e&&(a=e.call(this,a,t)),Do(this.state.type)){let o=this.startNodeAt(t),l=this.state.value;if(o.operator=l,this.match(29)){this.toAssignable(a,!0),o.left=a;let c=t.index;n.doubleProtoLoc!=null&&n.doubleProtoLoc.index>=c&&(n.doubleProtoLoc=null),n.shorthandAssignLoc!=null&&n.shorthandAssignLoc.index>=c&&(n.shorthandAssignLoc=null),n.privateKeyLoc!=null&&n.privateKeyLoc.index>=c&&(this.checkDestructuringPrivate(n),n.privateKeyLoc=null)}else o.left=a;return this.next(),o.right=this.parseMaybeAssign(),this.checkLVal(a,{in:this.finishNode(o,"AssignmentExpression")}),o}else r&&this.checkExpressionErrors(n,!0);return a}parseMaybeConditional(n){let e=this.state.startLoc,t=this.state.potentialArrowAt,r=this.parseExprOps(n);return this.shouldExitDescending(r,t)?r:this.parseConditional(r,e,n)}parseConditional(n,e,t){if(this.eat(17)){let r=this.startNodeAt(e);return r.test=n,r.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),r.alternate=this.parseMaybeAssign(),this.finishNode(r,"ConditionalExpression")}return n}parseMaybeUnaryOrPrivate(n){return this.match(138)?this.parsePrivateName():this.parseMaybeUnary(n)}parseExprOps(n){let e=this.state.startLoc,t=this.state.potentialArrowAt,r=this.parseMaybeUnaryOrPrivate(n);return this.shouldExitDescending(r,t)?r:this.parseExprOp(r,e,-1)}parseExprOp(n,e,t){if(this.isPrivateName(n)){let i=this.getPrivateNameSV(n);(t>=mn(58)||!this.prodParam.hasIn||!this.match(58))&&this.raise(b.PrivateInExpectedIn,{at:n,identifierName:i}),this.classScope.usePrivateName(i,n.loc.start)}let r=this.state.type;if(Oo(r)&&(this.prodParam.hasIn||!this.match(58))){let i=mn(r);if(i>t){if(r===39){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return n;this.checkPipelineAtInfixOperator(n,e)}let a=this.startNodeAt(e);a.left=n,a.operator=this.state.value;let o=r===41||r===42,l=r===40;if(l&&(i=mn(42)),this.next(),r===39&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])&&this.state.type===96&&this.prodParam.hasAwait)throw this.raise(b.UnexpectedAwaitAfterPipelineBody,{at:this.state.startLoc});a.right=this.parseExprOpRightExpr(r,i);let c=this.finishNode(a,o||l?"LogicalExpression":"BinaryExpression"),p=this.state.type;if(l&&(p===41||p===42)||o&&p===40)throw this.raise(b.MixingCoalesceWithLogical,{at:this.state.startLoc});return this.parseExprOp(c,e,t)}}return n}parseExprOpRightExpr(n,e){let t=this.state.startLoc;switch(n){case 39:switch(this.getPluginOption("pipelineOperator","proposal")){case"hack":return this.withTopicBindingContext(()=>this.parseHackPipeBody());case"smart":return this.withTopicBindingContext(()=>{if(this.prodParam.hasYield&&this.isContextual(108))throw this.raise(b.PipeBodyIsTighter,{at:this.state.startLoc});return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(n,e),t)});case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(e))}default:return this.parseExprOpBaseRightExpr(n,e)}}parseExprOpBaseRightExpr(n,e){let t=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),t,Ro(n)?e-1:e)}parseHackPipeBody(){var n;let{startLoc:e}=this.state,t=this.parseMaybeAssign();return Po.has(t.type)&&!((n=t.extra)!=null&&n.parenthesized)&&this.raise(b.PipeUnparenthesizedBody,{at:e,type:t.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(b.PipeTopicUnused,{at:e}),t}checkExponentialAfterUnary(n){this.match(57)&&this.raise(b.UnexpectedTokenUnaryExponentiation,{at:n.argument})}parseMaybeUnary(n,e){let t=this.state.startLoc,r=this.isContextual(96);if(r&&this.isAwaitAllowed()){this.next();let l=this.parseAwait(t);return e||this.checkExponentialAfterUnary(l),l}let i=this.match(34),a=this.startNode();if(Uo(this.state.type)){a.operator=this.state.value,a.prefix=!0,this.match(72)&&this.expectPlugin("throwExpressions");let l=this.match(89);if(this.next(),a.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(n,!0),this.state.strict&&l){let c=a.argument;c.type==="Identifier"?this.raise(b.StrictDelete,{at:a}):this.hasPropertyAsPrivateName(c)&&this.raise(b.DeletePrivateField,{at:a})}if(!i)return e||this.checkExponentialAfterUnary(a),this.finishNode(a,"UnaryExpression")}let o=this.parseUpdate(a,i,n);if(r){let{type:l}=this.state;if((this.hasPlugin("v8intrinsic")?fr(l):fr(l)&&!this.match(54))&&!this.isAmbiguousAwait())return this.raiseOverwrite(b.AwaitNotInAsyncContext,{at:t}),this.parseAwait(t)}return o}parseUpdate(n,e,t){if(e){let a=n;return this.checkLVal(a.argument,{in:this.finishNode(a,"UpdateExpression")}),n}let r=this.state.startLoc,i=this.parseExprSubscripts(t);if(this.checkExpressionErrors(t,!1))return i;for(;Fo(this.state.type)&&!this.canInsertSemicolon();){let a=this.startNodeAt(r);a.operator=this.state.value,a.prefix=!1,a.argument=i,this.next(),this.checkLVal(i,{in:i=this.finishNode(a,"UpdateExpression")})}return i}parseExprSubscripts(n){let e=this.state.startLoc,t=this.state.potentialArrowAt,r=this.parseExprAtom(n);return this.shouldExitDescending(r,t)?r:this.parseSubscripts(r,e)}parseSubscripts(n,e,t){let r={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(n),stop:!1};do n=this.parseSubscript(n,e,t,r),r.maybeAsyncArrow=!1;while(!r.stop);return n}parseSubscript(n,e,t,r){let{type:i}=this.state;if(!t&&i===15)return this.parseBind(n,e,t,r);if(xn(i))return this.parseTaggedTemplateExpression(n,e,r);let a=!1;if(i===18){if(t&&(this.raise(b.OptionalChainingNoNew,{at:this.state.startLoc}),this.lookaheadCharCode()===40))return r.stop=!0,n;r.optionalChainMember=a=!0,this.next()}if(!t&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(n,e,r,a);{let o=this.eat(0);return o||a||this.eat(16)?this.parseMember(n,e,r,o,a):(r.stop=!0,n)}}parseMember(n,e,t,r,i){let a=this.startNodeAt(e);return a.object=n,a.computed=r,r?(a.property=this.parseExpression(),this.expect(3)):this.match(138)?(n.type==="Super"&&this.raise(b.SuperPrivateField,{at:e}),this.classScope.usePrivateName(this.state.value,this.state.startLoc),a.property=this.parsePrivateName()):a.property=this.parseIdentifier(!0),t.optionalChainMember?(a.optional=i,this.finishNode(a,"OptionalMemberExpression")):this.finishNode(a,"MemberExpression")}parseBind(n,e,t,r){let i=this.startNodeAt(e);return i.object=n,this.next(),i.callee=this.parseNoCallExpr(),r.stop=!0,this.parseSubscripts(this.finishNode(i,"BindExpression"),e,t)}parseCoverCallAndAsyncArrowHead(n,e,t,r){let i=this.state.maybeInArrowParameters,a=null;this.state.maybeInArrowParameters=!0,this.next();let o=this.startNodeAt(e);o.callee=n;let{maybeAsyncArrow:l,optionalChainMember:c}=t;l&&(this.expressionScope.enter(al()),a=new ct),c&&(o.optional=r),r?o.arguments=this.parseCallExpressionArguments(11):o.arguments=this.parseCallExpressionArguments(11,n.type==="Import",n.type!=="Super",o,a);let p=this.finishCallExpression(o,c);return l&&this.shouldParseAsyncArrow()&&!r?(t.stop=!0,this.checkDestructuringPrivate(a),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),p=this.parseAsyncArrowFromCallExpression(this.startNodeAt(e),p)):(l&&(this.checkExpressionErrors(a,!0),this.expressionScope.exit()),this.toReferencedArguments(p)),this.state.maybeInArrowParameters=i,p}toReferencedArguments(n,e){this.toReferencedListDeep(n.arguments,e)}parseTaggedTemplateExpression(n,e,t){let r=this.startNodeAt(e);return r.tag=n,r.quasi=this.parseTemplate(!0),t.optionalChainMember&&this.raise(b.OptionalChainingNoTemplate,{at:e}),this.finishNode(r,"TaggedTemplateExpression")}atPossibleAsyncArrow(n){return n.type==="Identifier"&&n.name==="async"&&this.state.lastTokEndLoc.index===n.end&&!this.canInsertSemicolon()&&n.end-n.start===5&&n.start===this.state.potentialArrowAt}expectImportAttributesPlugin(){this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes")}finishCallExpression(n,e){if(n.callee.type==="Import")if(n.arguments.length===2&&(this.hasPlugin("moduleAttributes")||this.expectImportAttributesPlugin()),n.arguments.length===0||n.arguments.length>2)this.raise(b.ImportCallArity,{at:n,maxArgumentCount:this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions")||this.hasPlugin("moduleAttributes")?2:1});else for(let t of n.arguments)t.type==="SpreadElement"&&this.raise(b.ImportCallSpreadArgument,{at:t});return this.finishNode(n,e?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(n,e,t,r,i){let a=[],o=!0,l=this.state.inFSharpPipelineDirectBody;for(this.state.inFSharpPipelineDirectBody=!1;!this.eat(n);){if(o)o=!1;else if(this.expect(12),this.match(n)){e&&!this.hasPlugin("importAttributes")&&!this.hasPlugin("importAssertions")&&!this.hasPlugin("moduleAttributes")&&this.raise(b.ImportCallArgumentTrailingComma,{at:this.state.lastTokStartLoc}),r&&this.addTrailingCommaExtraToNode(r),this.next();break}a.push(this.parseExprListItem(!1,i,t))}return this.state.inFSharpPipelineDirectBody=l,a}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(n,e){var t;return this.resetPreviousNodeTrailingComments(e),this.expect(19),this.parseArrowExpression(n,e.arguments,!0,(t=e.extra)==null?void 0:t.trailingCommaLoc),e.innerComments&&_t(n,e.innerComments),e.callee.trailingComments&&_t(n,e.callee.trailingComments),n}parseNoCallExpr(){let n=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),n,!0)}parseExprAtom(n){let e,t=null,{type:r}=this.state;switch(r){case 79:return this.parseSuper();case 83:return e=this.startNode(),this.next(),this.match(16)?this.parseImportMetaProperty(e):this.match(10)?this.options.createImportExpressions?this.parseImportCall(e):this.finishNode(e,"Import"):(this.raise(b.UnsupportedImport,{at:this.state.lastTokStartLoc}),this.finishNode(e,"Import"));case 78:return e=this.startNode(),this.next(),this.finishNode(e,"ThisExpression");case 90:return this.parseDo(this.startNode(),!1);case 56:case 31:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 134:return this.parseNumericLiteral(this.state.value);case 135:return this.parseBigIntLiteral(this.state.value);case 136:return this.parseDecimalLiteral(this.state.value);case 133:return this.parseStringLiteral(this.state.value);case 84:return this.parseNullLiteral();case 85:return this.parseBooleanLiteral(!0);case 86:return this.parseBooleanLiteral(!1);case 10:{let i=this.state.potentialArrowAt===this.state.start;return this.parseParenAndDistinguishExpression(i)}case 2:case 1:return this.parseArrayLike(this.state.type===2?4:3,!1,!0);case 0:return this.parseArrayLike(3,!0,!1,n);case 6:case 7:return this.parseObjectLike(this.state.type===6?9:8,!1,!0);case 5:return this.parseObjectLike(8,!1,!1,n);case 68:return this.parseFunctionOrFunctionSent();case 26:t=this.parseDecorators();case 80:return this.parseClass(this.maybeTakeDecorators(t,this.startNode()),!1);case 77:return this.parseNewOrNewTarget();case 25:case 24:return this.parseTemplate(!1);case 15:{e=this.startNode(),this.next(),e.object=null;let i=e.callee=this.parseNoCallExpr();if(i.type==="MemberExpression")return this.finishNode(e,"BindExpression");throw this.raise(b.UnsupportedBind,{at:i})}case 138:return this.raise(b.PrivateInExpectedIn,{at:this.state.startLoc,identifierName:this.state.value}),this.parsePrivateName();case 33:return this.parseTopicReferenceThenEqualsSign(54,"%");case 32:return this.parseTopicReferenceThenEqualsSign(44,"^");case 37:case 38:return this.parseTopicReference("hack");case 44:case 54:case 27:{let i=this.getPluginOption("pipelineOperator","proposal");if(i)return this.parseTopicReference(i);this.unexpected();break}case 47:{let i=this.input.codePointAt(this.nextTokenStart());Ue(i)||i===62?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected();break}default:if(R(r)){if(this.isContextual(127)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let i=this.state.potentialArrowAt===this.state.start,a=this.state.containsEsc,o=this.parseIdentifier();if(!a&&o.name==="async"&&!this.canInsertSemicolon()){let{type:l}=this.state;if(l===68)return this.resetPreviousNodeTrailingComments(o),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(o));if(R(l))return this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(o)):o;if(l===90)return this.resetPreviousNodeTrailingComments(o),this.parseDo(this.startNodeAtNode(o),!0)}return i&&this.match(19)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(o),[o],!1)):o}else this.unexpected()}}parseTopicReferenceThenEqualsSign(n,e){let t=this.getPluginOption("pipelineOperator","proposal");if(t)return this.state.type=n,this.state.value=e,this.state.pos--,this.state.end--,this.state.endLoc=se(this.state.endLoc,-1),this.parseTopicReference(t);this.unexpected()}parseTopicReference(n){let e=this.startNode(),t=this.state.startLoc,r=this.state.type;return this.next(),this.finishTopicReference(e,t,n,r)}finishTopicReference(n,e,t,r){if(this.testTopicReferenceConfiguration(t,e,r)){let i=t==="smart"?"PipelinePrimaryTopicReference":"TopicReference";return this.topicReferenceIsAllowedInCurrentContext()||this.raise(t==="smart"?b.PrimaryTopicNotAllowed:b.PipeTopicUnbound,{at:e}),this.registerTopicReference(),this.finishNode(n,i)}else throw this.raise(b.PipeTopicUnconfiguredToken,{at:e,token:qe(r)})}testTopicReferenceConfiguration(n,e,t){switch(n){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:qe(t)}]);case"smart":return t===27;default:throw this.raise(b.PipeTopicRequiresHackPipes,{at:e})}}parseAsyncArrowUnaryFunction(n){this.prodParam.enter(gn(!0,this.prodParam.hasYield));let e=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(b.LineTerminatorBeforeArrow,{at:this.state.curPosition()}),this.expect(19),this.parseArrowExpression(n,e,!0)}parseDo(n,e){this.expectPlugin("doExpressions"),e&&this.expectPlugin("asyncDoExpressions"),n.async=e,this.next();let t=this.state.labels;return this.state.labels=[],e?(this.prodParam.enter(2),n.body=this.parseBlock(),this.prodParam.exit()):n.body=this.parseBlock(),this.state.labels=t,this.finishNode(n,"DoExpression")}parseSuper(){let n=this.startNode();return this.next(),this.match(10)&&!this.scope.allowDirectSuper&&!this.options.allowSuperOutsideMethod?this.raise(b.SuperNotAllowed,{at:n}):!this.scope.allowSuper&&!this.options.allowSuperOutsideMethod&&this.raise(b.UnexpectedSuper,{at:n}),!this.match(10)&&!this.match(0)&&!this.match(16)&&this.raise(b.UnsupportedSuper,{at:n}),this.finishNode(n,"Super")}parsePrivateName(){let n=this.startNode(),e=this.startNodeAt(se(this.state.startLoc,1)),t=this.state.value;return this.next(),n.id=this.createIdentifier(e,t),this.finishNode(n,"PrivateName")}parseFunctionOrFunctionSent(){let n=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(n),"function");return this.next(),this.match(103)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected(),this.parseMetaProperty(n,e,"sent")}return this.parseFunction(n)}parseMetaProperty(n,e,t){n.meta=e;let r=this.state.containsEsc;return n.property=this.parseIdentifier(!0),(n.property.name!==t||r)&&this.raise(b.UnsupportedMetaProperty,{at:n.property,target:e.name,onlyValidPropertyName:t}),this.finishNode(n,"MetaProperty")}parseImportMetaProperty(n){let e=this.createIdentifier(this.startNodeAtNode(n),"import");if(this.next(),this.isContextual(101))this.inModule||this.raise(b.ImportMetaOutsideModule,{at:e}),this.sawUnambiguousESM=!0;else if(this.isContextual(105)||this.isContextual(97)){let t=this.isContextual(105);if(t||this.unexpected(),this.expectPlugin(t?"sourcePhaseImports":"deferredImportEvaluation"),!this.options.createImportExpressions)throw this.raise(b.DynamicImportPhaseRequiresImportExpressions,{at:this.state.startLoc,phase:this.state.value});return this.next(),n.phase=t?"source":"defer",this.parseImportCall(n)}return this.parseMetaProperty(n,e,"meta")}parseLiteralAtNode(n,e,t){return this.addExtra(t,"rawValue",n),this.addExtra(t,"raw",this.input.slice(t.start,this.state.end)),t.value=n,this.next(),this.finishNode(t,e)}parseLiteral(n,e){let t=this.startNode();return this.parseLiteralAtNode(n,e,t)}parseStringLiteral(n){return this.parseLiteral(n,"StringLiteral")}parseNumericLiteral(n){return this.parseLiteral(n,"NumericLiteral")}parseBigIntLiteral(n){return this.parseLiteral(n,"BigIntLiteral")}parseDecimalLiteral(n){return this.parseLiteral(n,"DecimalLiteral")}parseRegExpLiteral(n){let e=this.parseLiteral(n.value,"RegExpLiteral");return e.pattern=n.pattern,e.flags=n.flags,e}parseBooleanLiteral(n){let e=this.startNode();return e.value=n,this.next(),this.finishNode(e,"BooleanLiteral")}parseNullLiteral(){let n=this.startNode();return this.next(),this.finishNode(n,"NullLiteral")}parseParenAndDistinguishExpression(n){let e=this.state.startLoc,t;this.next(),this.expressionScope.enter(il());let r=this.state.maybeInArrowParameters,i=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;let a=this.state.startLoc,o=[],l=new ct,c=!0,p,u;for(;!this.match(11);){if(c)c=!1;else if(this.expect(12,l.optionalParametersLoc===null?null:l.optionalParametersLoc),this.match(11)){u=this.state.startLoc;break}if(this.match(21)){let d=this.state.startLoc;if(p=this.state.startLoc,o.push(this.parseParenItem(this.parseRestBinding(),d)),!this.checkCommaAfterRest(41))break}else o.push(this.parseMaybeAssignAllowIn(l,this.parseParenItem))}let h=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=r,this.state.inFSharpPipelineDirectBody=i;let m=this.startNodeAt(e);return n&&this.shouldParseArrow(o)&&(m=this.parseArrow(m))?(this.checkDestructuringPrivate(l),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(m,o,!1),m):(this.expressionScope.exit(),o.length||this.unexpected(this.state.lastTokStartLoc),u&&this.unexpected(u),p&&this.unexpected(p),this.checkExpressionErrors(l,!0),this.toReferencedListDeep(o,!0),o.length>1?(t=this.startNodeAt(a),t.expressions=o,this.finishNode(t,"SequenceExpression"),this.resetEndLocation(t,h)):t=o[0],this.wrapParenthesis(e,t))}wrapParenthesis(n,e){if(!this.options.createParenthesizedExpressions)return this.addExtra(e,"parenthesized",!0),this.addExtra(e,"parenStart",n.index),this.takeSurroundingComments(e,n.index,this.state.lastTokEndLoc.index),e;let t=this.startNodeAt(n);return t.expression=e,this.finishNode(t,"ParenthesizedExpression")}shouldParseArrow(n){return!this.canInsertSemicolon()}parseArrow(n){if(this.eat(19))return n}parseParenItem(n,e){return n}parseNewOrNewTarget(){let n=this.startNode();if(this.next(),this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(n),"new");this.next();let t=this.parseMetaProperty(n,e,"target");return!this.scope.inNonArrowFunction&&!this.scope.inClass&&!this.options.allowNewTargetOutsideFunction&&this.raise(b.UnexpectedNewTarget,{at:t}),t}return this.parseNew(n)}parseNew(n){if(this.parseNewCallee(n),this.eat(10)){let e=this.parseExprList(11);this.toReferencedList(e),n.arguments=e}else n.arguments=[];return this.finishNode(n,"NewExpression")}parseNewCallee(n){let e=this.match(83),t=this.parseNoCallExpr();n.callee=t,e&&(t.type==="Import"||t.type==="ImportExpression")&&this.raise(b.ImportCallNotNewExpression,{at:t})}parseTemplateElement(n){let{start:e,startLoc:t,end:r,value:i}=this.state,a=e+1,o=this.startNodeAt(se(t,1));i===null&&(n||this.raise(b.InvalidEscapeSequenceTemplate,{at:se(this.state.firstInvalidTemplateEscapePos,1)}));let l=this.match(24),c=l?-1:-2,p=r+c;o.value={raw:this.input.slice(a,p).replace(/\r\n?/g,`
|
|
9
|
+
`),cooked:i===null?null:i.slice(1,c)},o.tail=l,this.next();let u=this.finishNode(o,"TemplateElement");return this.resetEndLocation(u,se(this.state.lastTokEndLoc,c)),u}parseTemplate(n){let e=this.startNode();e.expressions=[];let t=this.parseTemplateElement(n);for(e.quasis=[t];!t.tail;)e.expressions.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),e.quasis.push(t=this.parseTemplateElement(n));return this.finishNode(e,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(n,e,t,r){t&&this.expectPlugin("recordAndTuple");let i=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let a=Object.create(null),o=!0,l=this.startNode();for(l.properties=[],this.next();!this.match(n);){if(o)o=!1;else if(this.expect(12),this.match(n)){this.addTrailingCommaExtraToNode(l);break}let p;e?p=this.parseBindingProperty():(p=this.parsePropertyDefinition(r),this.checkProto(p,t,a,r)),t&&!this.isObjectProperty(p)&&p.type!=="SpreadElement"&&this.raise(b.InvalidRecordProperty,{at:p}),p.shorthand&&this.addExtra(p,"shorthand",!0),l.properties.push(p)}this.next(),this.state.inFSharpPipelineDirectBody=i;let c="ObjectExpression";return e?c="ObjectPattern":t&&(c="RecordExpression"),this.finishNode(l,c)}addTrailingCommaExtraToNode(n){this.addExtra(n,"trailingComma",this.state.lastTokStart),this.addExtra(n,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(n){return!n.computed&&n.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(n){let e=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(b.UnsupportedPropertyDecorator,{at:this.state.startLoc});this.match(26);)e.push(this.parseDecorator());let t=this.startNode(),r=!1,i=!1,a;if(this.match(21))return e.length&&this.unexpected(),this.parseSpread();e.length&&(t.decorators=e,e=[]),t.method=!1,n&&(a=this.state.startLoc);let o=this.eat(55);this.parsePropertyNamePrefixOperator(t);let l=this.state.containsEsc,c=this.parsePropertyName(t,n);if(!o&&!l&&this.maybeAsyncOrAccessorProp(t)){let p=c.name;p==="async"&&!this.hasPrecedingLineBreak()&&(r=!0,this.resetPreviousNodeTrailingComments(c),o=this.eat(55),this.parsePropertyName(t)),(p==="get"||p==="set")&&(i=!0,this.resetPreviousNodeTrailingComments(c),t.kind=p,this.match(55)&&(o=!0,this.raise(b.AccessorIsGenerator,{at:this.state.curPosition(),kind:p}),this.next()),this.parsePropertyName(t))}return this.parseObjPropValue(t,a,o,r,!1,i,n)}getGetterSetterExpectedParamCount(n){return n.kind==="get"?0:1}getObjectOrClassMethodParams(n){return n.params}checkGetterSetterParams(n){var e;let t=this.getGetterSetterExpectedParamCount(n),r=this.getObjectOrClassMethodParams(n);r.length!==t&&this.raise(n.kind==="get"?b.BadGetterArity:b.BadSetterArity,{at:n}),n.kind==="set"&&((e=r[r.length-1])==null?void 0:e.type)==="RestElement"&&this.raise(b.BadSetterRestParameter,{at:n})}parseObjectMethod(n,e,t,r,i){if(i){let a=this.parseMethod(n,e,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(a),a}if(t||e||this.match(10))return r&&this.unexpected(),n.kind="method",n.method=!0,this.parseMethod(n,e,t,!1,!1,"ObjectMethod")}parseObjectProperty(n,e,t,r){if(n.shorthand=!1,this.eat(14))return n.value=t?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowIn(r),this.finishNode(n,"ObjectProperty");if(!n.computed&&n.key.type==="Identifier"){if(this.checkReservedWord(n.key.name,n.key.loc.start,!0,!1),t)n.value=this.parseMaybeDefault(e,Be(n.key));else if(this.match(29)){let i=this.state.startLoc;r!=null?r.shorthandAssignLoc===null&&(r.shorthandAssignLoc=i):this.raise(b.InvalidCoverInitializedName,{at:i}),n.value=this.parseMaybeDefault(e,Be(n.key))}else n.value=Be(n.key);return n.shorthand=!0,this.finishNode(n,"ObjectProperty")}}parseObjPropValue(n,e,t,r,i,a,o){let l=this.parseObjectMethod(n,t,r,i,a)||this.parseObjectProperty(n,e,i,o);return l||this.unexpected(),l}parsePropertyName(n,e){if(this.eat(0))n.computed=!0,n.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let{type:t,value:r}=this.state,i;if(xe(t))i=this.parseIdentifier(!0);else switch(t){case 134:i=this.parseNumericLiteral(r);break;case 133:i=this.parseStringLiteral(r);break;case 135:i=this.parseBigIntLiteral(r);break;case 136:i=this.parseDecimalLiteral(r);break;case 138:{let a=this.state.startLoc;e!=null?e.privateKeyLoc===null&&(e.privateKeyLoc=a):this.raise(b.UnexpectedPrivateField,{at:a}),i=this.parsePrivateName();break}default:this.unexpected()}n.key=i,t!==138&&(n.computed=!1)}return n.key}initFunction(n,e){n.id=null,n.generator=!1,n.async=e}parseMethod(n,e,t,r,i,a,o=!1){this.initFunction(n,t),n.generator=e,this.scope.enter(18|(o?64:0)|(i?32:0)),this.prodParam.enter(gn(t,n.generator)),this.parseFunctionParams(n,r);let l=this.parseFunctionBodyAndFinish(n,a,!0);return this.prodParam.exit(),this.scope.exit(),l}parseArrayLike(n,e,t,r){t&&this.expectPlugin("recordAndTuple");let i=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let a=this.startNode();return this.next(),a.elements=this.parseExprList(n,!t,r,a),this.state.inFSharpPipelineDirectBody=i,this.finishNode(a,t?"TupleExpression":"ArrayExpression")}parseArrowExpression(n,e,t,r){this.scope.enter(6);let i=gn(t,!1);!this.match(5)&&this.prodParam.hasIn&&(i|=8),this.prodParam.enter(i),this.initFunction(n,t);let a=this.state.maybeInArrowParameters;return e&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(n,e,r)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(n,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=a,this.finishNode(n,"ArrowFunctionExpression")}setArrowFunctionParameters(n,e,t){this.toAssignableList(e,t,!1),n.params=e}parseFunctionBodyAndFinish(n,e,t=!1){return this.parseFunctionBody(n,!1,t),this.finishNode(n,e)}parseFunctionBody(n,e,t=!1){let r=e&&!this.match(5);if(this.expressionScope.enter(gi()),r)n.body=this.parseMaybeAssign(),this.checkParams(n,!1,e,!1);else{let i=this.state.strict,a=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),n.body=this.parseBlock(!0,!1,o=>{let l=!this.isSimpleParamList(n.params);o&&l&&this.raise(b.IllegalLanguageModeDirective,{at:(n.kind==="method"||n.kind==="constructor")&&n.key?n.key.loc.end:n});let c=!i&&this.state.strict;this.checkParams(n,!this.state.strict&&!e&&!t&&!l,e,c),this.state.strict&&n.id&&this.checkIdentifier(n.id,65,c)}),this.prodParam.exit(),this.state.labels=a}this.expressionScope.exit()}isSimpleParameter(n){return n.type==="Identifier"}isSimpleParamList(n){for(let e=0,t=n.length;e<t;e++)if(!this.isSimpleParameter(n[e]))return!1;return!0}checkParams(n,e,t,r=!0){let i=!e&&new Set,a={type:"FormalParameters"};for(let o of n.params)this.checkLVal(o,{in:a,binding:5,checkClashes:i,strictModeChanged:r})}parseExprList(n,e,t,r){let i=[],a=!0;for(;!this.eat(n);){if(a)a=!1;else if(this.expect(12),this.match(n)){r&&this.addTrailingCommaExtraToNode(r),this.next();break}i.push(this.parseExprListItem(e,t))}return i}parseExprListItem(n,e,t){let r;if(this.match(12))n||this.raise(b.UnexpectedToken,{at:this.state.curPosition(),unexpected:","}),r=null;else if(this.match(21)){let i=this.state.startLoc;r=this.parseParenItem(this.parseSpread(e),i)}else if(this.match(17)){this.expectPlugin("partialApplication"),t||this.raise(b.UnexpectedArgumentPlaceholder,{at:this.state.startLoc});let i=this.startNode();this.next(),r=this.finishNode(i,"ArgumentPlaceholder")}else r=this.parseMaybeAssignAllowIn(e,this.parseParenItem);return r}parseIdentifier(n){let e=this.startNode(),t=this.parseIdentifierName(n);return this.createIdentifier(e,t)}createIdentifier(n,e){return n.name=e,n.loc.identifierName=e,this.finishNode(n,"Identifier")}parseIdentifierName(n){let e,{startLoc:t,type:r}=this.state;xe(r)?e=this.state.value:this.unexpected();let i=No(r);return n?i&&this.replaceToken(132):this.checkReservedWord(e,t,i,!1),this.next(),e}checkReservedWord(n,e,t,r){if(n.length>10||!Jo(n))return;if(t&&Wo(n)){this.raise(b.UnexpectedKeyword,{at:e,keyword:n});return}if((this.state.strict?r?di:pi:ci)(n,this.inModule)){this.raise(b.UnexpectedReservedWord,{at:e,reservedWord:n});return}else if(n==="yield"){if(this.prodParam.hasYield){this.raise(b.YieldBindingIdentifier,{at:e});return}}else if(n==="await"){if(this.prodParam.hasAwait){this.raise(b.AwaitBindingIdentifier,{at:e});return}if(this.scope.inStaticBlock){this.raise(b.AwaitBindingIdentifierInStaticBlock,{at:e});return}this.expressionScope.recordAsyncArrowParametersError({at:e})}else if(n==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(b.ArgumentsInClass,{at:e});return}}isAwaitAllowed(){return!!(this.prodParam.hasAwait||this.options.allowAwaitOutsideFunction&&!this.scope.inFunction)}parseAwait(n){let e=this.startNodeAt(n);return this.expressionScope.recordParameterInitializerError(b.AwaitExpressionFormalParameter,{at:e}),this.eat(55)&&this.raise(b.ObsoleteAwaitStar,{at:e}),!this.scope.inFunction&&!this.options.allowAwaitOutsideFunction&&(this.isAmbiguousAwait()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),this.state.soloAwait||(e.argument=this.parseMaybeUnary(null,!0)),this.finishNode(e,"AwaitExpression")}isAmbiguousAwait(){if(this.hasPrecedingLineBreak())return!0;let{type:n}=this.state;return n===53||n===10||n===0||xn(n)||n===102&&!this.state.containsEsc||n===137||n===56||this.hasPlugin("v8intrinsic")&&n===54}parseYield(){let n=this.startNode();this.expressionScope.recordParameterInitializerError(b.YieldInParameter,{at:n}),this.next();let e=!1,t=null;if(!this.hasPrecedingLineBreak())switch(e=this.eat(55),this.state.type){case 13:case 139:case 8:case 11:case 3:case 9:case 14:case 12:if(!e)break;default:t=this.parseMaybeAssign()}return n.delegate=e,n.argument=t,this.finishNode(n,"YieldExpression")}parseImportCall(n){return this.next(),n.source=this.parseMaybeAssignAllowIn(),(this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions"))&&(n.options=null),this.eat(12)&&(this.expectImportAttributesPlugin(),this.match(11)||(n.options=this.parseMaybeAssignAllowIn(),this.eat(12))),this.expect(11),this.finishNode(n,"ImportExpression")}checkPipelineAtInfixOperator(n,e){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&n.type==="SequenceExpression"&&this.raise(b.PipelineHeadSequenceExpression,{at:e})}parseSmartPipelineBodyInStyle(n,e){if(this.isSimpleReference(n)){let t=this.startNodeAt(e);return t.callee=n,this.finishNode(t,"PipelineBareFunction")}else{let t=this.startNodeAt(e);return this.checkSmartPipeTopicBodyEarlyErrors(e),t.expression=n,this.finishNode(t,"PipelineTopicExpression")}}isSimpleReference(n){switch(n.type){case"MemberExpression":return!n.computed&&this.isSimpleReference(n.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(n){if(this.match(19))throw this.raise(b.PipelineBodyNoArrow,{at:this.state.startLoc});this.topicReferenceWasUsedInCurrentContext()||this.raise(b.PipelineTopicUnused,{at:n})}withTopicBindingContext(n){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return n()}finally{this.state.topicContext=e}}withSmartMixTopicForbiddingContext(n){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return n()}finally{this.state.topicContext=e}}else return n()}withSoloAwaitPermittingContext(n){let e=this.state.soloAwait;this.state.soloAwait=!0;try{return n()}finally{this.state.soloAwait=e}}allowInAnd(n){let e=this.prodParam.currentFlags();if(8&~e){this.prodParam.enter(e|8);try{return n()}finally{this.prodParam.exit()}}return n()}disallowInAnd(n){let e=this.prodParam.currentFlags();if(8&e){this.prodParam.enter(e&-9);try{return n()}finally{this.prodParam.exit()}}return n()}registerTopicReference(){this.state.topicContext.maxTopicIndex=0}topicReferenceIsAllowedInCurrentContext(){return this.state.topicContext.maxNumOfResolvableTopics>=1}topicReferenceWasUsedInCurrentContext(){return this.state.topicContext.maxTopicIndex!=null&&this.state.topicContext.maxTopicIndex>=0}parseFSharpPipelineBody(n){let e=this.state.startLoc;this.state.potentialArrowAt=this.state.start;let t=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;let r=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),e,n);return this.state.inFSharpPipelineDirectBody=t,r}parseModuleExpression(){this.expectPlugin("moduleBlocks");let n=this.startNode();this.next(),this.match(5)||this.unexpected(null,5);let e=this.startNodeAt(this.state.endLoc);this.next();let t=this.initializeScopes(!0);this.enterInitialScopes();try{n.body=this.parseProgram(e,8,"module")}finally{t()}return this.finishNode(n,"ModuleExpression")}parsePropertyNamePrefixOperator(n){}},dr={kind:"loop"},Ml={kind:"switch"},Dl=/[\uD800-\uDFFF]/u,hr=/in(?:stanceof)?/y;function Ll(s,n){for(let e=0;e<s.length;e++){let t=s[e],{type:r}=t;if(typeof r=="number"){{if(r===138){let{loc:i,start:a,value:o,end:l}=t,c=a+1,p=se(i.start,1);s.splice(e,1,new Ae({type:Oe(27),value:"#",start:a,end:c,startLoc:i.start,endLoc:p}),new Ae({type:Oe(132),value:o,start:c,end:l,startLoc:p,endLoc:i.end})),e++;continue}if(xn(r)){let{loc:i,start:a,value:o,end:l}=t,c=a+1,p=se(i.start,1),u;n.charCodeAt(a)===96?u=new Ae({type:Oe(22),value:"`",start:a,end:c,startLoc:i.start,endLoc:p}):u=new Ae({type:Oe(8),value:"}",start:a,end:c,startLoc:i.start,endLoc:p});let h,m,d,g;r===24?(m=l-1,d=se(i.end,-1),h=o===null?null:o.slice(1,-1),g=new Ae({type:Oe(22),value:"`",start:m,end:l,startLoc:d,endLoc:i.end})):(m=l-2,d=se(i.end,-2),h=o===null?null:o.slice(1,-2),g=new Ae({type:Oe(23),value:"${",start:m,end:l,startLoc:d,endLoc:i.end})),s.splice(e,1,u,new Ae({type:Oe(20),value:h,start:c,end:m,startLoc:p,endLoc:d}),g),e+=2;continue}}t.type=Oe(r)}}return s}var Lr=class extends Dr{parseTopLevel(n,e){return n.program=this.parseProgram(e),n.comments=this.state.comments,this.options.tokens&&(n.tokens=Ll(this.tokens,this.input)),this.finishNode(n,"File")}parseProgram(n,e=139,t=this.options.sourceType){if(n.sourceType=t,n.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(n,!0,!0,e),this.inModule&&!this.options.allowUndeclaredExports&&this.scope.undefinedExports.size>0)for(let[i,a]of Array.from(this.scope.undefinedExports))this.raise(b.ModuleExportUndefined,{at:a,localName:i});let r;return e===139?r=this.finishNode(n,"Program"):r=this.finishNodeAt(n,"Program",se(this.state.startLoc,-1)),r}stmtToDirective(n){let e=n;e.type="Directive",e.value=e.expression,delete e.expression;let t=e.value,r=t.value,i=this.input.slice(t.start,t.end),a=t.value=i.slice(1,-1);return this.addExtra(t,"raw",i),this.addExtra(t,"rawValue",a),this.addExtra(t,"expressionValue",r),t.type="DirectiveLiteral",e}parseInterpreterDirective(){if(!this.match(28))return null;let n=this.startNode();return n.value=this.state.value,this.next(),this.finishNode(n,"InterpreterDirective")}isLet(){return this.isContextual(100)?this.hasFollowingBindingAtom():!1}chStartsBindingIdentifier(n,e){if(Ue(n)){if(hr.lastIndex=e,hr.test(this.input)){let t=this.codePointAtPos(hr.lastIndex);if(!lt(t)&&t!==92)return!1}return!0}else return n===92}chStartsBindingPattern(n){return n===91||n===123}hasFollowingBindingAtom(){let n=this.nextTokenStart(),e=this.codePointAtPos(n);return this.chStartsBindingPattern(e)||this.chStartsBindingIdentifier(e,n)}hasInLineFollowingBindingIdentifier(){let n=this.nextTokenInLineStart(),e=this.codePointAtPos(n);return this.chStartsBindingIdentifier(e,n)}startsUsingForOf(){let{type:n,containsEsc:e}=this.lookahead();if(n===102&&!e)return!1;if(R(n)&&!this.hasFollowingLineBreak())return this.expectPlugin("explicitResourceManagement"),!0}startsAwaitUsing(){let n=this.nextTokenInLineStart();if(this.isUnparsedContextual(n,"using")){n=this.nextTokenInLineStartSince(n+5);let e=this.codePointAtPos(n);if(this.chStartsBindingIdentifier(e,n))return this.expectPlugin("explicitResourceManagement"),!0}return!1}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(n=!1){let e=0;return this.options.annexB&&!this.state.strict&&(e|=4,n&&(e|=8)),this.parseStatementLike(e)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(n){let e=null;return this.match(26)&&(e=this.parseDecorators(!0)),this.parseStatementContent(n,e)}parseStatementContent(n,e){let t=this.state.type,r=this.startNode(),i=!!(n&2),a=!!(n&4),o=n&1;switch(t){case 60:return this.parseBreakContinueStatement(r,!0);case 63:return this.parseBreakContinueStatement(r,!1);case 64:return this.parseDebuggerStatement(r);case 90:return this.parseDoWhileStatement(r);case 91:return this.parseForStatement(r);case 68:if(this.lookaheadCharCode()===46)break;return a||this.raise(this.state.strict?b.StrictFunction:this.options.annexB?b.SloppyFunctionAnnexB:b.SloppyFunction,{at:this.state.startLoc}),this.parseFunctionStatement(r,!1,!i&&a);case 80:return i||this.unexpected(),this.parseClass(this.maybeTakeDecorators(e,r),!0);case 69:return this.parseIfStatement(r);case 70:return this.parseReturnStatement(r);case 71:return this.parseSwitchStatement(r);case 72:return this.parseThrowStatement(r);case 73:return this.parseTryStatement(r);case 96:if(!this.state.containsEsc&&this.startsAwaitUsing())return this.isAwaitAllowed()?i||this.raise(b.UnexpectedLexicalDeclaration,{at:r}):this.raise(b.AwaitUsingNotInAsyncContext,{at:r}),this.next(),this.parseVarStatement(r,"await using");break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifier())break;return this.expectPlugin("explicitResourceManagement"),!this.scope.inModule&&this.scope.inTopLevel?this.raise(b.UnexpectedUsingDeclaration,{at:this.state.startLoc}):i||this.raise(b.UnexpectedLexicalDeclaration,{at:this.state.startLoc}),this.parseVarStatement(r,"using");case 100:{if(this.state.containsEsc)break;let p=this.nextTokenStart(),u=this.codePointAtPos(p);if(u!==91&&(!i&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(u,p)&&u!==123))break}case 75:i||this.raise(b.UnexpectedLexicalDeclaration,{at:this.state.startLoc});case 74:{let p=this.state.value;return this.parseVarStatement(r,p)}case 92:return this.parseWhileStatement(r);case 76:return this.parseWithStatement(r);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(r);case 83:{let p=this.lookaheadCharCode();if(p===40||p===46)break}case 82:{!this.options.allowImportExportEverywhere&&!o&&this.raise(b.UnexpectedImportExport,{at:this.state.startLoc}),this.next();let p;return t===83?(p=this.parseImport(r),p.type==="ImportDeclaration"&&(!p.importKind||p.importKind==="value")&&(this.sawUnambiguousESM=!0)):(p=this.parseExport(r,e),(p.type==="ExportNamedDeclaration"&&(!p.exportKind||p.exportKind==="value")||p.type==="ExportAllDeclaration"&&(!p.exportKind||p.exportKind==="value")||p.type==="ExportDefaultDeclaration")&&(this.sawUnambiguousESM=!0)),this.assertModuleNodeAllowed(p),p}default:if(this.isAsyncFunction())return i||this.raise(b.AsyncFunctionInSingleStatementContext,{at:this.state.startLoc}),this.next(),this.parseFunctionStatement(r,!0,!i&&a)}let l=this.state.value,c=this.parseExpression();return R(t)&&c.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(r,l,c,n):this.parseExpressionStatement(r,c,e)}assertModuleNodeAllowed(n){!this.options.allowImportExportEverywhere&&!this.inModule&&this.raise(b.ImportOutsideModule,{at:n})}decoratorsEnabledBeforeExport(){return this.hasPlugin("decorators-legacy")?!0:this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(n,e,t){return n&&(e.decorators&&e.decorators.length>0?(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!="boolean"&&this.raise(b.DecoratorsBeforeAfterExport,{at:e.decorators[0]}),e.decorators.unshift(...n)):e.decorators=n,this.resetStartLocationFromNode(e,n[0]),t&&this.resetStartLocationFromNode(t,e)),e}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(n){let e=[];do e.push(this.parseDecorator());while(this.match(26));if(this.match(82))n||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(b.DecoratorExportClass,{at:this.state.startLoc});else if(!this.canHaveLeadingDecorator())throw this.raise(b.UnexpectedLeadingDecorator,{at:this.state.startLoc});return e}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let n=this.startNode();if(this.next(),this.hasPlugin("decorators")){let e=this.state.startLoc,t;if(this.match(10)){let r=this.state.startLoc;this.next(),t=this.parseExpression(),this.expect(11),t=this.wrapParenthesis(r,t);let i=this.state.startLoc;n.expression=this.parseMaybeDecoratorArguments(t),this.getPluginOption("decorators","allowCallParenthesized")===!1&&n.expression!==t&&this.raise(b.DecoratorArgumentsOutsideParentheses,{at:i})}else{for(t=this.parseIdentifier(!1);this.eat(16);){let r=this.startNodeAt(e);r.object=t,this.match(138)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),r.property=this.parsePrivateName()):r.property=this.parseIdentifier(!0),r.computed=!1,t=this.finishNode(r,"MemberExpression")}n.expression=this.parseMaybeDecoratorArguments(t)}}else n.expression=this.parseExprSubscripts();return this.finishNode(n,"Decorator")}parseMaybeDecoratorArguments(n){if(this.eat(10)){let e=this.startNodeAtNode(n);return e.callee=n,e.arguments=this.parseCallExpressionArguments(11,!1),this.toReferencedList(e.arguments),this.finishNode(e,"CallExpression")}return n}parseBreakContinueStatement(n,e){return this.next(),this.isLineTerminator()?n.label=null:(n.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(n,e),this.finishNode(n,e?"BreakStatement":"ContinueStatement")}verifyBreakContinue(n,e){let t;for(t=0;t<this.state.labels.length;++t){let r=this.state.labels[t];if((n.label==null||r.name===n.label.name)&&(r.kind!=null&&(e||r.kind==="loop")||n.label&&e))break}if(t===this.state.labels.length){let r=e?"BreakStatement":"ContinueStatement";this.raise(b.IllegalBreakContinue,{at:n,type:r})}}parseDebuggerStatement(n){return this.next(),this.semicolon(),this.finishNode(n,"DebuggerStatement")}parseHeaderExpression(){this.expect(10);let n=this.parseExpression();return this.expect(11),n}parseDoWhileStatement(n){return this.next(),this.state.labels.push(dr),n.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.expect(92),n.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(n,"DoWhileStatement")}parseForStatement(n){this.next(),this.state.labels.push(dr);let e=null;if(this.isAwaitAllowed()&&this.eatContextual(96)&&(e=this.state.lastTokStartLoc),this.scope.enter(0),this.expect(10),this.match(13))return e!==null&&this.unexpected(e),this.parseFor(n,null);let t=this.isContextual(100);{let l=this.isContextual(96)&&this.startsAwaitUsing(),c=l||this.isContextual(107)&&this.startsUsingForOf(),p=t&&this.hasFollowingBindingAtom()||c;if(this.match(74)||this.match(75)||p){let u=this.startNode(),h;l?(h="await using",this.isAwaitAllowed()||this.raise(b.AwaitUsingNotInAsyncContext,{at:this.state.startLoc}),this.next()):h=this.state.value,this.next(),this.parseVar(u,!0,h);let m=this.finishNode(u,"VariableDeclaration"),d=this.match(58);return d&&c&&this.raise(b.ForInUsing,{at:m}),(d||this.isContextual(102))&&m.declarations.length===1?this.parseForIn(n,m,e):(e!==null&&this.unexpected(e),this.parseFor(n,m))}}let r=this.isContextual(95),i=new ct,a=this.parseExpression(!0,i),o=this.isContextual(102);if(o&&(t&&this.raise(b.ForOfLet,{at:a}),e===null&&r&&a.type==="Identifier"&&this.raise(b.ForOfAsync,{at:a})),o||this.match(58)){this.checkDestructuringPrivate(i),this.toAssignable(a,!0);let l=o?"ForOfStatement":"ForInStatement";return this.checkLVal(a,{in:{type:l}}),this.parseForIn(n,a,e)}else this.checkExpressionErrors(i,!0);return e!==null&&this.unexpected(e),this.parseFor(n,a)}parseFunctionStatement(n,e,t){return this.next(),this.parseFunction(n,1|(t?2:0)|(e?8:0))}parseIfStatement(n){return this.next(),n.test=this.parseHeaderExpression(),n.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),n.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(n,"IfStatement")}parseReturnStatement(n){return!this.prodParam.hasReturn&&!this.options.allowReturnOutsideFunction&&this.raise(b.IllegalReturn,{at:this.state.startLoc}),this.next(),this.isLineTerminator()?n.argument=null:(n.argument=this.parseExpression(),this.semicolon()),this.finishNode(n,"ReturnStatement")}parseSwitchStatement(n){this.next(),n.discriminant=this.parseHeaderExpression();let e=n.cases=[];this.expect(5),this.state.labels.push(Ml),this.scope.enter(0);let t;for(let r;!this.match(8);)if(this.match(61)||this.match(65)){let i=this.match(61);t&&this.finishNode(t,"SwitchCase"),e.push(t=this.startNode()),t.consequent=[],this.next(),i?t.test=this.parseExpression():(r&&this.raise(b.MultipleDefaultsInSwitch,{at:this.state.lastTokStartLoc}),r=!0,t.test=null),this.expect(14)}else t?t.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(n,"SwitchStatement")}parseThrowStatement(n){return this.next(),this.hasPrecedingLineBreak()&&this.raise(b.NewlineAfterThrow,{at:this.state.lastTokEndLoc}),n.argument=this.parseExpression(),this.semicolon(),this.finishNode(n,"ThrowStatement")}parseCatchClauseParam(){let n=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&n.type==="Identifier"?8:0),this.checkLVal(n,{in:{type:"CatchClause"},binding:9}),n}parseTryStatement(n){if(this.next(),n.block=this.parseBlock(),n.handler=null,this.match(62)){let e=this.startNode();this.next(),this.match(10)?(this.expect(10),e.param=this.parseCatchClauseParam(),this.expect(11)):(e.param=null,this.scope.enter(0)),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),n.handler=this.finishNode(e,"CatchClause")}return n.finalizer=this.eat(67)?this.parseBlock():null,!n.handler&&!n.finalizer&&this.raise(b.NoCatchOrFinally,{at:n}),this.finishNode(n,"TryStatement")}parseVarStatement(n,e,t=!1){return this.next(),this.parseVar(n,!1,e,t),this.semicolon(),this.finishNode(n,"VariableDeclaration")}parseWhileStatement(n){return this.next(),n.test=this.parseHeaderExpression(),this.state.labels.push(dr),n.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(n,"WhileStatement")}parseWithStatement(n){return this.state.strict&&this.raise(b.StrictWith,{at:this.state.startLoc}),this.next(),n.object=this.parseHeaderExpression(),n.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(n,"WithStatement")}parseEmptyStatement(n){return this.next(),this.finishNode(n,"EmptyStatement")}parseLabeledStatement(n,e,t,r){for(let a of this.state.labels)a.name===e&&this.raise(b.LabelRedeclaration,{at:t,labelName:e});let i=Lo(this.state.type)?"loop":this.match(71)?"switch":null;for(let a=this.state.labels.length-1;a>=0;a--){let o=this.state.labels[a];if(o.statementStart===n.start)o.statementStart=this.state.start,o.kind=i;else break}return this.state.labels.push({name:e,kind:i,statementStart:this.state.start}),n.body=r&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),n.label=t,this.finishNode(n,"LabeledStatement")}parseExpressionStatement(n,e,t){return n.expression=e,this.semicolon(),this.finishNode(n,"ExpressionStatement")}parseBlock(n=!1,e=!0,t){let r=this.startNode();return n&&this.state.strictErrors.clear(),this.expect(5),e&&this.scope.enter(0),this.parseBlockBody(r,n,!1,8,t),e&&this.scope.exit(),this.finishNode(r,"BlockStatement")}isValidDirective(n){return n.type==="ExpressionStatement"&&n.expression.type==="StringLiteral"&&!n.expression.extra.parenthesized}parseBlockBody(n,e,t,r,i){let a=n.body=[],o=n.directives=[];this.parseBlockOrModuleBlockBody(a,e?o:void 0,t,r,i)}parseBlockOrModuleBlockBody(n,e,t,r,i){let a=this.state.strict,o=!1,l=!1;for(;!this.match(r);){let c=t?this.parseModuleItem():this.parseStatementListItem();if(e&&!l){if(this.isValidDirective(c)){let p=this.stmtToDirective(c);e.push(p),!o&&p.value.value==="use strict"&&(o=!0,this.setStrict(!0));continue}l=!0,this.state.strictErrors.clear()}n.push(c)}i?.call(this,o),a||this.setStrict(!1),this.next()}parseFor(n,e){return n.init=e,this.semicolon(!1),n.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),n.update=this.match(11)?null:this.parseExpression(),this.expect(11),n.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(n,"ForStatement")}parseForIn(n,e,t){let r=this.match(58);return this.next(),r?t!==null&&this.unexpected(t):n.await=t!==null,e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!r||!this.options.annexB||this.state.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(b.ForInOfLoopInitializer,{at:e,type:r?"ForInStatement":"ForOfStatement"}),e.type==="AssignmentPattern"&&this.raise(b.InvalidLhs,{at:e,ancestor:{type:"ForStatement"}}),n.left=e,n.right=r?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),n.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(n,r?"ForInStatement":"ForOfStatement")}parseVar(n,e,t,r=!1){let i=n.declarations=[];for(n.kind=t;;){let a=this.startNode();if(this.parseVarId(a,t),a.init=this.eat(29)?e?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,a.init===null&&!r&&(a.id.type!=="Identifier"&&!(e&&(this.match(58)||this.isContextual(102)))?this.raise(b.DeclarationMissingInitializer,{at:this.state.lastTokEndLoc,kind:"destructuring"}):t==="const"&&!(this.match(58)||this.isContextual(102))&&this.raise(b.DeclarationMissingInitializer,{at:this.state.lastTokEndLoc,kind:"const"})),i.push(this.finishNode(a,"VariableDeclarator")),!this.eat(12))break}return n}parseVarId(n,e){let t=this.parseBindingAtom();this.checkLVal(t,{in:{type:"VariableDeclarator"},binding:e==="var"?5:8201}),n.id=t}parseAsyncFunctionExpression(n){return this.parseFunction(n,8)}parseFunction(n,e=0){let t=e&2,r=!!(e&1),i=r&&!(e&4),a=!!(e&8);this.initFunction(n,a),this.match(55)&&(t&&this.raise(b.GeneratorInSingleStatementContext,{at:this.state.startLoc}),this.next(),n.generator=!0),r&&(n.id=this.parseFunctionId(i));let o=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(2),this.prodParam.enter(gn(a,n.generator)),r||(n.id=this.parseFunctionId()),this.parseFunctionParams(n,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(n,r?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),r&&!t&&this.registerFunctionStatementId(n),this.state.maybeInArrowParameters=o,n}parseFunctionId(n){return n||R(this.state.type)?this.parseIdentifier():null}parseFunctionParams(n,e){this.expect(10),this.expressionScope.enter(sl()),n.params=this.parseBindingList(11,41,2|(e?4:0)),this.expressionScope.exit()}registerFunctionStatementId(n){n.id&&this.scope.declareName(n.id.name,!this.options.annexB||this.state.strict||n.generator||n.async?this.scope.treatFunctionsAsVar?5:8201:17,n.id.loc.start)}parseClass(n,e,t){this.next();let r=this.state.strict;return this.state.strict=!0,this.parseClassId(n,e,t),this.parseClassSuper(n),n.body=this.parseClassBody(!!n.superClass,r),this.finishNode(n,e?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}isNonstaticConstructor(n){return!n.computed&&!n.static&&(n.key.name==="constructor"||n.key.value==="constructor")}parseClassBody(n,e){this.classScope.enter();let t={hadConstructor:!1,hadSuperClass:n},r=[],i=this.startNode();if(i.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(r.length>0)throw this.raise(b.DecoratorSemicolon,{at:this.state.lastTokEndLoc});continue}if(this.match(26)){r.push(this.parseDecorator());continue}let a=this.startNode();r.length&&(a.decorators=r,this.resetStartLocationFromNode(a,r[0]),r=[]),this.parseClassMember(i,a,t),a.kind==="constructor"&&a.decorators&&a.decorators.length>0&&this.raise(b.DecoratorConstructor,{at:a})}}),this.state.strict=e,this.next(),r.length)throw this.raise(b.TrailingDecorator,{at:this.state.startLoc});return this.classScope.exit(),this.finishNode(i,"ClassBody")}parseClassMemberFromModifier(n,e){let t=this.parseIdentifier(!0);if(this.isClassMethod()){let r=e;return r.kind="method",r.computed=!1,r.key=t,r.static=!1,this.pushClassMethod(n,r,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let r=e;return r.computed=!1,r.key=t,r.static=!1,n.body.push(this.parseClassProperty(r)),!0}return this.resetPreviousNodeTrailingComments(t),!1}parseClassMember(n,e,t){let r=this.isContextual(106);if(r){if(this.parseClassMemberFromModifier(n,e))return;if(this.eat(5)){this.parseClassStaticBlock(n,e);return}}this.parseClassMemberWithIsStatic(n,e,t,r)}parseClassMemberWithIsStatic(n,e,t,r){let i=e,a=e,o=e,l=e,c=e,p=i,u=i;if(e.static=r,this.parsePropertyNamePrefixOperator(e),this.eat(55)){p.kind="method";let f=this.match(138);if(this.parseClassElementName(p),f){this.pushClassPrivateMethod(n,a,!0,!1);return}this.isNonstaticConstructor(i)&&this.raise(b.ConstructorIsGenerator,{at:i.key}),this.pushClassMethod(n,i,!0,!1,!1,!1);return}let h=R(this.state.type)&&!this.state.containsEsc,m=this.match(138),d=this.parseClassElementName(e),g=this.state.startLoc;if(this.parsePostMemberNameModifiers(u),this.isClassMethod()){if(p.kind="method",m){this.pushClassPrivateMethod(n,a,!1,!1);return}let f=this.isNonstaticConstructor(i),v=!1;f&&(i.kind="constructor",t.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(b.DuplicateConstructor,{at:d}),f&&this.hasPlugin("typescript")&&e.override&&this.raise(b.OverrideOnConstructor,{at:d}),t.hadConstructor=!0,v=t.hadSuperClass),this.pushClassMethod(n,i,!1,!1,f,v)}else if(this.isClassProperty())m?this.pushClassPrivateProperty(n,l):this.pushClassProperty(n,o);else if(h&&d.name==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(d);let f=this.eat(55);u.optional&&this.unexpected(g),p.kind="method";let v=this.match(138);this.parseClassElementName(p),this.parsePostMemberNameModifiers(u),v?this.pushClassPrivateMethod(n,a,f,!0):(this.isNonstaticConstructor(i)&&this.raise(b.ConstructorIsAsync,{at:i.key}),this.pushClassMethod(n,i,f,!0,!1,!1))}else if(h&&(d.name==="get"||d.name==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(d),p.kind=d.name;let f=this.match(138);this.parseClassElementName(i),f?this.pushClassPrivateMethod(n,a,!1,!1):(this.isNonstaticConstructor(i)&&this.raise(b.ConstructorIsAccessor,{at:i.key}),this.pushClassMethod(n,i,!1,!1,!1,!1)),this.checkGetterSetterParams(i)}else if(h&&d.name==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(d);let f=this.match(138);this.parseClassElementName(o),this.pushClassAccessorProperty(n,c,f)}else this.isLineTerminator()?m?this.pushClassPrivateProperty(n,l):this.pushClassProperty(n,o):this.unexpected()}parseClassElementName(n){let{type:e,value:t}=this.state;if((e===132||e===133)&&n.static&&t==="prototype"&&this.raise(b.StaticPrototype,{at:this.state.startLoc}),e===138){t==="constructor"&&this.raise(b.ConstructorClassPrivateField,{at:this.state.startLoc});let r=this.parsePrivateName();return n.key=r,r}return this.parsePropertyName(n)}parseClassStaticBlock(n,e){var t;this.scope.enter(208);let r=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let i=e.body=[];this.parseBlockOrModuleBlockBody(i,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=r,n.body.push(this.finishNode(e,"StaticBlock")),(t=e.decorators)!=null&&t.length&&this.raise(b.DecoratorStaticBlock,{at:e})}pushClassProperty(n,e){!e.computed&&(e.key.name==="constructor"||e.key.value==="constructor")&&this.raise(b.ConstructorClassField,{at:e.key}),n.body.push(this.parseClassProperty(e))}pushClassPrivateProperty(n,e){let t=this.parseClassPrivateProperty(e);n.body.push(t),this.classScope.declarePrivateName(this.getPrivateNameSV(t.key),0,t.key.loc.start)}pushClassAccessorProperty(n,e,t){if(!t&&!e.computed){let i=e.key;(i.name==="constructor"||i.value==="constructor")&&this.raise(b.ConstructorClassField,{at:i})}let r=this.parseClassAccessorProperty(e);n.body.push(r),t&&this.classScope.declarePrivateName(this.getPrivateNameSV(r.key),0,r.key.loc.start)}pushClassMethod(n,e,t,r,i,a){n.body.push(this.parseMethod(e,t,r,i,a,"ClassMethod",!0))}pushClassPrivateMethod(n,e,t,r){let i=this.parseMethod(e,t,r,!1,!1,"ClassPrivateMethod",!0);n.body.push(i);let a=i.kind==="get"?i.static?6:2:i.kind==="set"?i.static?5:1:0;this.declareClassPrivateMethodInScope(i,a)}declareClassPrivateMethodInScope(n,e){this.classScope.declarePrivateName(this.getPrivateNameSV(n.key),e,n.key.loc.start)}parsePostMemberNameModifiers(n){}parseClassPrivateProperty(n){return this.parseInitializer(n),this.semicolon(),this.finishNode(n,"ClassPrivateProperty")}parseClassProperty(n){return this.parseInitializer(n),this.semicolon(),this.finishNode(n,"ClassProperty")}parseClassAccessorProperty(n){return this.parseInitializer(n),this.semicolon(),this.finishNode(n,"ClassAccessorProperty")}parseInitializer(n){this.scope.enter(80),this.expressionScope.enter(gi()),this.prodParam.enter(0),n.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(n,e,t,r=8331){if(R(this.state.type))n.id=this.parseIdentifier(),e&&this.declareNameFromIdentifier(n.id,r);else if(t||!e)n.id=null;else throw this.raise(b.MissingClassName,{at:this.state.startLoc})}parseClassSuper(n){n.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(n,e){let t=this.parseMaybeImportPhase(n,!0),r=this.maybeParseExportDefaultSpecifier(n,t),i=!r||this.eat(12),a=i&&this.eatExportStar(n),o=a&&this.maybeParseExportNamespaceSpecifier(n),l=i&&(!o||this.eat(12)),c=r||a;if(a&&!o){if(r&&this.unexpected(),e)throw this.raise(b.UnsupportedDecoratorExport,{at:n});return this.parseExportFrom(n,!0),this.finishNode(n,"ExportAllDeclaration")}let p=this.maybeParseExportNamedSpecifiers(n);r&&i&&!a&&!p&&this.unexpected(null,5),o&&l&&this.unexpected(null,98);let u;if(c||p){if(u=!1,e)throw this.raise(b.UnsupportedDecoratorExport,{at:n});this.parseExportFrom(n,c)}else u=this.maybeParseExportDeclaration(n);if(c||p||u){var h;let m=n;if(this.checkExport(m,!0,!1,!!m.source),((h=m.declaration)==null?void 0:h.type)==="ClassDeclaration")this.maybeTakeDecorators(e,m.declaration,m);else if(e)throw this.raise(b.UnsupportedDecoratorExport,{at:n});return this.finishNode(m,"ExportNamedDeclaration")}if(this.eat(65)){let m=n,d=this.parseExportDefaultExpression();if(m.declaration=d,d.type==="ClassDeclaration")this.maybeTakeDecorators(e,d,m);else if(e)throw this.raise(b.UnsupportedDecoratorExport,{at:n});return this.checkExport(m,!0,!0),this.finishNode(m,"ExportDefaultDeclaration")}this.unexpected(null,5)}eatExportStar(n){return this.eat(55)}maybeParseExportDefaultSpecifier(n,e){if(e||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",e?.loc.start);let t=e||this.parseIdentifier(!0),r=this.startNodeAtNode(t);return r.exported=t,n.specifiers=[this.finishNode(r,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(n){if(this.isContextual(93)){n.specifiers||(n.specifiers=[]);let e=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),e.exported=this.parseModuleExportName(),n.specifiers.push(this.finishNode(e,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(n){if(this.match(5)){n.specifiers||(n.specifiers=[]);let e=n.exportKind==="type";return n.specifiers.push(...this.parseExportSpecifiers(e)),n.source=null,n.declaration=null,this.hasPlugin("importAssertions")&&(n.assertions=[]),!0}return!1}maybeParseExportDeclaration(n){return this.shouldParseExportDeclaration()?(n.specifiers=[],n.source=null,this.hasPlugin("importAssertions")&&(n.assertions=[]),n.declaration=this.parseExportDeclaration(n),!0):!1}isAsyncFunction(){if(!this.isContextual(95))return!1;let n=this.nextTokenInLineStart();return this.isUnparsedContextual(n,"function")}parseExportDefaultExpression(){let n=this.startNode();if(this.match(68))return this.next(),this.parseFunction(n,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(n,13);if(this.match(80))return this.parseClass(n,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(b.DecoratorBeforeExport,{at:this.state.startLoc}),this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(75)||this.match(74)||this.isLet())throw this.raise(b.UnsupportedDefaultExport,{at:this.state.startLoc});let e=this.parseMaybeAssignAllowIn();return this.semicolon(),e}parseExportDeclaration(n){return this.match(80)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:n}=this.state;if(R(n)){if(n===95&&!this.state.containsEsc||n===100)return!1;if((n===130||n===129)&&!this.state.containsEsc){let{type:r}=this.lookahead();if(R(r)&&r!==98||r===5)return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;let e=this.nextTokenStart(),t=this.isUnparsedContextual(e,"from");if(this.input.charCodeAt(e)===44||R(this.state.type)&&t)return!0;if(this.match(65)&&t){let r=this.input.charCodeAt(this.nextTokenStartSince(e+4));return r===34||r===39}return!1}parseExportFrom(n,e){this.eatContextual(98)?(n.source=this.parseImportSource(),this.checkExport(n),this.maybeParseImportAttributes(n),this.checkJSONModuleImport(n)):e&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:n}=this.state;return n===26&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?(this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(b.DecoratorBeforeExport,{at:this.state.startLoc}),!0):n===74||n===75||n===68||n===80||this.isLet()||this.isAsyncFunction()}checkExport(n,e,t,r){if(e){var i;if(t){if(this.checkDuplicateExports(n,"default"),this.hasPlugin("exportDefaultFrom")){var a;let o=n.declaration;o.type==="Identifier"&&o.name==="from"&&o.end-o.start===4&&!((a=o.extra)!=null&&a.parenthesized)&&this.raise(b.ExportDefaultFromAsIdentifier,{at:o})}}else if((i=n.specifiers)!=null&&i.length)for(let o of n.specifiers){let{exported:l}=o,c=l.type==="Identifier"?l.name:l.value;if(this.checkDuplicateExports(o,c),!r&&o.local){let{local:p}=o;p.type!=="Identifier"?this.raise(b.ExportBindingIsString,{at:o,localName:p.value,exportName:c}):(this.checkReservedWord(p.name,p.loc.start,!0,!1),this.scope.checkLocalExport(p))}}else if(n.declaration){if(n.declaration.type==="FunctionDeclaration"||n.declaration.type==="ClassDeclaration"){let o=n.declaration.id;if(!o)throw new Error("Assertion failure");this.checkDuplicateExports(n,o.name)}else if(n.declaration.type==="VariableDeclaration")for(let o of n.declaration.declarations)this.checkDeclaration(o.id)}}}checkDeclaration(n){if(n.type==="Identifier")this.checkDuplicateExports(n,n.name);else if(n.type==="ObjectPattern")for(let e of n.properties)this.checkDeclaration(e);else if(n.type==="ArrayPattern")for(let e of n.elements)e&&this.checkDeclaration(e);else n.type==="ObjectProperty"?this.checkDeclaration(n.value):n.type==="RestElement"?this.checkDeclaration(n.argument):n.type==="AssignmentPattern"&&this.checkDeclaration(n.left)}checkDuplicateExports(n,e){this.exportedIdentifiers.has(e)&&(e==="default"?this.raise(b.DuplicateDefaultExport,{at:n}):this.raise(b.DuplicateExport,{at:n,exportName:e})),this.exportedIdentifiers.add(e)}parseExportSpecifiers(n){let e=[],t=!0;for(this.expect(5);!this.eat(8);){if(t)t=!1;else if(this.expect(12),this.eat(8))break;let r=this.isContextual(130),i=this.match(133),a=this.startNode();a.local=this.parseModuleExportName(),e.push(this.parseExportSpecifier(a,i,n,r))}return e}parseExportSpecifier(n,e,t,r){return this.eatContextual(93)?n.exported=this.parseModuleExportName():e?n.exported=ll(n.local):n.exported||(n.exported=Be(n.local)),this.finishNode(n,"ExportSpecifier")}parseModuleExportName(){if(this.match(133)){let n=this.parseStringLiteral(this.state.value),e=n.value.match(Dl);return e&&this.raise(b.ModuleExportNameHasLoneSurrogate,{at:n,surrogateCharCode:e[0].charCodeAt(0)}),n}return this.parseIdentifier(!0)}isJSONModuleImport(n){return n.assertions!=null?n.assertions.some(({key:e,value:t})=>t.value==="json"&&(e.type==="Identifier"?e.name==="type":e.value==="type")):!1}checkImportReflection(n){let{specifiers:e}=n,t=e.length===1?e[0].type:null;if(n.phase==="source")t!=="ImportDefaultSpecifier"&&this.raise(b.SourcePhaseImportRequiresDefault,{at:e[0].loc.start});else if(n.phase==="defer")t!=="ImportNamespaceSpecifier"&&this.raise(b.DeferImportRequiresNamespace,{at:e[0].loc.start});else if(n.module){var r;t!=="ImportDefaultSpecifier"&&this.raise(b.ImportReflectionNotBinding,{at:e[0].loc.start}),((r=n.assertions)==null?void 0:r.length)>0&&this.raise(b.ImportReflectionHasAssertion,{at:n.specifiers[0].loc.start})}}checkJSONModuleImport(n){if(this.isJSONModuleImport(n)&&n.type!=="ExportAllDeclaration"){let{specifiers:e}=n;if(e!=null){let t=e.find(r=>{let i;if(r.type==="ExportSpecifier"?i=r.local:r.type==="ImportSpecifier"&&(i=r.imported),i!==void 0)return i.type==="Identifier"?i.name!=="default":i.value!=="default"});t!==void 0&&this.raise(b.ImportJSONBindingNotDefault,{at:t.loc.start})}}}isPotentialImportPhase(n){return n?!1:this.isContextual(105)||this.isContextual(97)||this.isContextual(127)}applyImportPhase(n,e,t,r){e||(t==="module"?(this.expectPlugin("importReflection",r),n.module=!0):this.hasPlugin("importReflection")&&(n.module=!1),t==="source"?(this.expectPlugin("sourcePhaseImports",r),n.phase="source"):t==="defer"?(this.expectPlugin("deferredImportEvaluation",r),n.phase="defer"):this.hasPlugin("sourcePhaseImports")&&(n.phase=null))}parseMaybeImportPhase(n,e){if(!this.isPotentialImportPhase(e))return this.applyImportPhase(n,e,null),null;let t=this.parseIdentifier(!0),{type:r}=this.state;return(xe(r)?r!==98||this.lookaheadCharCode()===102:r!==12)?(this.resetPreviousIdentifierLeadingComments(t),this.applyImportPhase(n,e,t.name,t.loc.start),null):(this.applyImportPhase(n,e,null),t)}isPrecedingIdImportPhase(n){let{type:e}=this.state;return R(e)?e!==98||this.lookaheadCharCode()===102:e!==12}parseImport(n){return this.match(133)?this.parseImportSourceAndAttributes(n):this.parseImportSpecifiersAndAfter(n,this.parseMaybeImportPhase(n,!1))}parseImportSpecifiersAndAfter(n,e){n.specifiers=[];let r=!this.maybeParseDefaultImportSpecifier(n,e)||this.eat(12),i=r&&this.maybeParseStarImportSpecifier(n);return r&&!i&&this.parseNamedImportSpecifiers(n),this.expectContextual(98),this.parseImportSourceAndAttributes(n)}parseImportSourceAndAttributes(n){var e;return(e=n.specifiers)!=null||(n.specifiers=[]),n.source=this.parseImportSource(),this.maybeParseImportAttributes(n),this.checkImportReflection(n),this.checkJSONModuleImport(n),this.semicolon(),this.finishNode(n,"ImportDeclaration")}parseImportSource(){return this.match(133)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(n,e,t){e.local=this.parseIdentifier(),n.specifiers.push(this.finishImportSpecifier(e,t))}finishImportSpecifier(n,e,t=8201){return this.checkLVal(n.local,{in:{type:e},binding:t}),this.finishNode(n,e)}parseImportAttributes(){this.expect(5);let n=[],e=new Set;do{if(this.match(8))break;let t=this.startNode(),r=this.state.value;if(e.has(r)&&this.raise(b.ModuleAttributesWithDuplicateKeys,{at:this.state.startLoc,key:r}),e.add(r),this.match(133)?t.key=this.parseStringLiteral(r):t.key=this.parseIdentifier(!0),this.expect(14),!this.match(133))throw this.raise(b.ModuleAttributeInvalidValue,{at:this.state.startLoc});t.value=this.parseStringLiteral(this.state.value),n.push(this.finishNode(t,"ImportAttribute"))}while(this.eat(12));return this.expect(8),n}parseModuleAttributes(){let n=[],e=new Set;do{let t=this.startNode();if(t.key=this.parseIdentifier(!0),t.key.name!=="type"&&this.raise(b.ModuleAttributeDifferentFromType,{at:t.key}),e.has(t.key.name)&&this.raise(b.ModuleAttributesWithDuplicateKeys,{at:t.key,key:t.key.name}),e.add(t.key.name),this.expect(14),!this.match(133))throw this.raise(b.ModuleAttributeInvalidValue,{at:this.state.startLoc});t.value=this.parseStringLiteral(this.state.value),n.push(this.finishNode(t,"ImportAttribute"))}while(this.eat(12));return n}maybeParseImportAttributes(n){let e,t=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),this.hasPlugin("moduleAttributes")?e=this.parseModuleAttributes():(this.expectImportAttributesPlugin(),e=this.parseImportAttributes()),t=!0}else if(this.isContextual(94)&&!this.hasPrecedingLineBreak())this.hasPlugin("importAttributes")?(this.getPluginOption("importAttributes","deprecatedAssertSyntax")!==!0&&this.raise(b.ImportAttributesUseAssert,{at:this.state.startLoc}),this.addExtra(n,"deprecatedAssertSyntax",!0)):this.expectOnePlugin(["importAttributes","importAssertions"]),this.next(),e=this.parseImportAttributes();else if(this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions"))e=[];else if(this.hasPlugin("moduleAttributes"))e=[];else return;!t&&this.hasPlugin("importAssertions")?n.assertions=e:n.attributes=e}maybeParseDefaultImportSpecifier(n,e){if(e){let t=this.startNodeAtNode(e);return t.local=e,n.specifiers.push(this.finishImportSpecifier(t,"ImportDefaultSpecifier")),!0}else if(xe(this.state.type))return this.parseImportSpecifierLocal(n,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(n){if(this.match(55)){let e=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(n,e,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(n){let e=!0;for(this.expect(5);!this.eat(8);){if(e)e=!1;else{if(this.eat(14))throw this.raise(b.DestructureNamedImport,{at:this.state.startLoc});if(this.expect(12),this.eat(8))break}let t=this.startNode(),r=this.match(133),i=this.isContextual(130);t.imported=this.parseModuleExportName();let a=this.parseImportSpecifier(t,r,n.importKind==="type"||n.importKind==="typeof",i,void 0);n.specifiers.push(a)}}parseImportSpecifier(n,e,t,r,i){if(this.eatContextual(93))n.local=this.parseIdentifier();else{let{imported:a}=n;if(e)throw this.raise(b.ImportBindingIsString,{at:n,importName:a.value});this.checkReservedWord(a.name,n.loc.start,!0,!0),n.local||(n.local=Be(a))}return this.finishImportSpecifier(n,"ImportSpecifier",i)}isThisParam(n){return n.type==="Identifier"&&n.name==="this"}},Tn=class extends Lr{constructor(n,e){n=Nl(n),super(n,e),this.options=n,this.initializeScopes(),this.plugins=Ol(this.options.plugins),this.filename=n.sourceFilename}getScopeHandler(){return Ut}parse(){this.enterInitialScopes();let n=this.startNode(),e=this.startNode();return this.nextToken(),n.errors=null,this.parseTopLevel(n,e),n.errors=this.state.errors,n}};function Ol(s){let n=new Map;for(let e of s){let[t,r]=Array.isArray(e)?e:[e,{}];n.has(t)||n.set(t,r||{})}return n}function Fl(s,n){var e;if(((e=n)==null?void 0:e.sourceType)==="unambiguous"){n=Object.assign({},n);try{n.sourceType="module";let t=Dt(n,s),r=t.parse();if(t.sawUnambiguousESM)return r;if(t.ambiguousScriptDifferentAst)try{return n.sourceType="script",Dt(n,s).parse()}catch{}else r.program.sourceType="script";return r}catch(t){try{return n.sourceType="script",Dt(n,s).parse()}catch{}throw t}}else return Dt(n,s).parse()}function Ul(s,n){let e=Dt(n,s);return e.options.strictMode&&(e.state.strict=!0),e.getExpression()}function _l(s){let n={};for(let e of Object.keys(s))n[e]=Oe(s[e]);return n}var Bl=_l(ko);function Dt(s,n){let e=Tn;return s!=null&&s.plugins&&(Al(s.plugins),e=Rl(s.plugins)),new e(s,n)}var ii={};function Rl(s){let n=kl.filter(r=>Y(s,r)),e=n.join("/"),t=ii[e];if(!t){t=Tn;for(let r of n)t=Pi[r](t);ii[e]=t}return t}Bt.parse=Fl;Bt.parseExpression=Ul;Bt.tokTypes=Bl});import{Command as tu}from"commander";import en from"node:path";import{Command as Np}from"commander";import ae from"kleur";import tn from"lodash";import wt from"prompts";var an=[{name:"Accordion",value:"accordion",deps:["radix-vue","tailwind-variants"],devDeps:["tailwindcss-animate","nuxt-icon"],nuxtModules:["nuxt-icon"],instructions:["Remember to add the accordion animations to your tailwind.config.js"],files:[{fileName:"Accordion/Accordion.vue",dirPath:"components/UI",fileContent:`<template>\r
|
|
10
10
|
<AccordionRoot v-bind="forwarded">\r
|
|
11
11
|
<slot :items="items">\r
|
|
12
12
|
<template v-for="(item, i) in items" :key="i">\r
|
|
@@ -7057,8 +7057,38 @@ export function useFormField() {\r
|
|
|
7057
7057
|
base: "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
7058
7058
|
});
|
|
7059
7059
|
</script>
|
|
7060
|
+
`},{fileName:"Tabs/Indicator.vue",dirPath:"components/UI",fileContent:`<template>\r
|
|
7061
|
+
<ClientOnly>\r
|
|
7062
|
+
<TabsIndicator\r
|
|
7063
|
+
v-bind="{ ...reactiveOmit(props, 'class'), ...$attrs }"\r
|
|
7064
|
+
:class="styles({ class: props.class })"\r
|
|
7065
|
+
>\r
|
|
7066
|
+
<slot>\r
|
|
7067
|
+
<div class="h-full w-full rounded-md bg-primary"></div>\r
|
|
7068
|
+
</slot>\r
|
|
7069
|
+
</TabsIndicator>\r
|
|
7070
|
+
</ClientOnly>\r
|
|
7071
|
+
</template>\r
|
|
7072
|
+
\r
|
|
7073
|
+
<script lang="ts" setup>\r
|
|
7074
|
+
import { TabsIndicator, withDefault } from "radix-vue";\r
|
|
7075
|
+
import type { TabsIndicatorProps } from "radix-vue";\r
|
|
7076
|
+
\r
|
|
7077
|
+
defineOptions({ inheritAttrs: false });\r
|
|
7078
|
+
\r
|
|
7079
|
+
const props = defineProps<\r
|
|
7080
|
+
TabsIndicatorProps & {\r
|
|
7081
|
+
/** Custom class(es) to add to parent element */\r
|
|
7082
|
+
class?: any;\r
|
|
7083
|
+
}\r
|
|
7084
|
+
>();\r
|
|
7085
|
+
\r
|
|
7086
|
+
const styles = tv({\r
|
|
7087
|
+
base: "absolute bottom-0 left-0 h-[3px] w-[--radix-tabs-indicator-size] translate-x-[--radix-tabs-indicator-position] rounded-full px-1 transition-[width,transform] duration-300",\r
|
|
7088
|
+
});\r
|
|
7089
|
+
</script>\r
|
|
7060
7090
|
`},{fileName:"Tabs/List.vue",dirPath:"components/UI",fileContent:`<template>
|
|
7061
|
-
<TabsList :class="styles({ class: props.class })" v-bind="reactiveOmit(props, 'class')">
|
|
7091
|
+
<TabsList :class="styles({ pill, class: props.class })" v-bind="reactiveOmit(props, 'class')">
|
|
7062
7092
|
<slot></slot>
|
|
7063
7093
|
</TabsList>
|
|
7064
7094
|
</template>
|
|
@@ -7067,15 +7097,25 @@ export function useFormField() {\r
|
|
|
7067
7097
|
import { TabsList } from "radix-vue";
|
|
7068
7098
|
import type { TabsListProps } from "radix-vue";
|
|
7069
7099
|
|
|
7070
|
-
const props =
|
|
7071
|
-
|
|
7072
|
-
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
|
|
7100
|
+
const props = withDefaults(
|
|
7101
|
+
defineProps<
|
|
7102
|
+
TabsListProps & {
|
|
7103
|
+
/** Custom class(es) to add to parent element */
|
|
7104
|
+
class?: any;
|
|
7105
|
+
pill?: boolean;
|
|
7106
|
+
}
|
|
7107
|
+
>(),
|
|
7108
|
+
{ pill: true }
|
|
7109
|
+
);
|
|
7076
7110
|
|
|
7077
7111
|
const styles = tv({
|
|
7078
|
-
base: "inline-flex h-10 items-center justify-center rounded-md
|
|
7112
|
+
base: "inline-flex h-10 items-center justify-center rounded-md p-1 text-muted-foreground",
|
|
7113
|
+
variants: {
|
|
7114
|
+
pill: {
|
|
7115
|
+
true: "bg-muted",
|
|
7116
|
+
false: "",
|
|
7117
|
+
},
|
|
7118
|
+
},
|
|
7079
7119
|
});
|
|
7080
7120
|
</script>
|
|
7081
7121
|
`},{fileName:"Tabs/Tabs.vue",dirPath:"components/UI",fileContent:`<template>
|
|
@@ -7088,7 +7128,7 @@ export function useFormField() {\r
|
|
|
7088
7128
|
import { TabsRoot, useForwardPropsEmits } from "radix-vue";
|
|
7089
7129
|
import type { TabsRootEmits, TabsRootProps } from "radix-vue";
|
|
7090
7130
|
|
|
7091
|
-
const props = withDefaults(defineProps<TabsRootProps
|
|
7131
|
+
const props = withDefaults(defineProps<TabsRootProps>(), {
|
|
7092
7132
|
orientation: "horizontal",
|
|
7093
7133
|
activationMode: "automatic",
|
|
7094
7134
|
});
|
|
@@ -7096,7 +7136,7 @@ export function useFormField() {\r
|
|
|
7096
7136
|
const forwarded = useForwardPropsEmits(props, emits);
|
|
7097
7137
|
</script>
|
|
7098
7138
|
`},{fileName:"Tabs/Trigger.vue",dirPath:"components/UI",fileContent:`<template>
|
|
7099
|
-
<TabsTrigger v-bind="reactiveOmit(props, 'class')" :class="styles({ class: props.class })">
|
|
7139
|
+
<TabsTrigger v-bind="reactiveOmit(props, 'class')" :class="styles({ pill, class: props.class })">
|
|
7100
7140
|
<slot></slot>
|
|
7101
7141
|
</TabsTrigger>
|
|
7102
7142
|
</template>
|
|
@@ -7105,17 +7145,151 @@ export function useFormField() {\r
|
|
|
7105
7145
|
import { TabsTrigger } from "radix-vue";
|
|
7106
7146
|
import type { TabsTriggerProps } from "radix-vue";
|
|
7107
7147
|
|
|
7108
|
-
const props =
|
|
7109
|
-
|
|
7110
|
-
|
|
7111
|
-
|
|
7148
|
+
const props = withDefaults(
|
|
7149
|
+
defineProps<
|
|
7150
|
+
TabsTriggerProps & {
|
|
7151
|
+
/** Custom class(es) to add to parent element */
|
|
7152
|
+
class?: any;
|
|
7153
|
+
/** Whether the trigger should be pill-shaped */
|
|
7154
|
+
pill?: boolean;
|
|
7155
|
+
}
|
|
7156
|
+
>(),
|
|
7157
|
+
{
|
|
7158
|
+
pill: true,
|
|
7112
7159
|
}
|
|
7113
|
-
|
|
7160
|
+
);
|
|
7114
7161
|
|
|
7115
7162
|
const styles = tv({
|
|
7116
|
-
base: "inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50
|
|
7163
|
+
base: "inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 ",
|
|
7164
|
+
variants: {
|
|
7165
|
+
pill: {
|
|
7166
|
+
true: "data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
|
|
7167
|
+
false:
|
|
7168
|
+
"data-[state=active]:bg-transparent data-[state=active]:text-foreground data-[state=active]:shadow-none",
|
|
7169
|
+
},
|
|
7170
|
+
},
|
|
7117
7171
|
});
|
|
7118
7172
|
</script>
|
|
7173
|
+
`}],utils:[],composables:[],plugins:[]},{name:"Tags Input",value:"tags-input",deps:["tailwind-variants","radix-vue"],devDeps:[],nuxtModules:[],files:[{fileName:"TagsInput/Clear.vue",dirPath:"components/UI",fileContent:`<template>\r
|
|
7174
|
+
<TagsInputClear v-bind="props" :class="styles({ class: props.class })">\r
|
|
7175
|
+
<slot>\r
|
|
7176
|
+
<Icon v-if="icon" :name="icon" class="h-3.5 w-3.5" />\r
|
|
7177
|
+
</slot>\r
|
|
7178
|
+
</TagsInputClear>\r
|
|
7179
|
+
</template>\r
|
|
7180
|
+
\r
|
|
7181
|
+
<script lang="ts" setup>\r
|
|
7182
|
+
import { TagsInputClear } from "radix-vue";\r
|
|
7183
|
+
import type { TagsInputClearProps } from "radix-vue";\r
|
|
7184
|
+
\r
|
|
7185
|
+
const props = withDefaults(defineProps<TagsInputClearProps & { icon?: string; class?: any }>(), {\r
|
|
7186
|
+
icon: "lucide:x",\r
|
|
7187
|
+
});\r
|
|
7188
|
+
const styles = tv({\r
|
|
7189
|
+
base: "flex items-center justify-center rounded bg-transparent p-1 opacity-40 transition hover:bg-muted-foreground hover:opacity-100 focus:opacity-100 focus-visible:outline-none",\r
|
|
7190
|
+
});\r
|
|
7191
|
+
</script>\r
|
|
7192
|
+
`},{fileName:"TagsInput/Field.vue",dirPath:"components/UI",fileContent:`<template>\r
|
|
7193
|
+
<TagsInputInput v-bind="reactiveOmit(props, 'class')" :class="styles({ class: props.class })">\r
|
|
7194
|
+
<slot></slot>\r
|
|
7195
|
+
</TagsInputInput>\r
|
|
7196
|
+
</template>\r
|
|
7197
|
+
\r
|
|
7198
|
+
<script lang="ts" setup>\r
|
|
7199
|
+
import { TagsInputInput } from "radix-vue";\r
|
|
7200
|
+
import type { TagsInputInputProps } from "radix-vue";\r
|
|
7201
|
+
\r
|
|
7202
|
+
const props = defineProps<TagsInputInputProps & { class?: any }>();\r
|
|
7203
|
+
\r
|
|
7204
|
+
const styles = tv({\r
|
|
7205
|
+
base: "flex-1 bg-transparent focus:outline-none sm:text-sm",\r
|
|
7206
|
+
});\r
|
|
7207
|
+
</script>\r
|
|
7208
|
+
`},{fileName:"TagsInput/Item.vue",dirPath:"components/UI",fileContent:`<template>\r
|
|
7209
|
+
<TagsInputItem\r
|
|
7210
|
+
v-bind="reactiveOmit(props, 'class', 'icon')"\r
|
|
7211
|
+
:class="styles({ class: props.class })"\r
|
|
7212
|
+
>\r
|
|
7213
|
+
<slot>\r
|
|
7214
|
+
<slot name="text">\r
|
|
7215
|
+
<UiTagsInputItemText />\r
|
|
7216
|
+
</slot>\r
|
|
7217
|
+
<slot name="delete">\r
|
|
7218
|
+
<UiTagsInputItemDelete :icon="icon" />\r
|
|
7219
|
+
</slot>\r
|
|
7220
|
+
</slot>\r
|
|
7221
|
+
</TagsInputItem>\r
|
|
7222
|
+
</template>\r
|
|
7223
|
+
\r
|
|
7224
|
+
<script lang="ts" setup>\r
|
|
7225
|
+
import { TagsInputItem } from "radix-vue";\r
|
|
7226
|
+
import type { TagsInputItemProps } from "radix-vue";\r
|
|
7227
|
+
\r
|
|
7228
|
+
const props = defineProps<TagsInputItemProps & { class?: any; icon?: string }>();\r
|
|
7229
|
+
const styles = tv({\r
|
|
7230
|
+
base: "inline-flex h-6 shrink-0 items-center gap-1.5 rounded bg-primary pl-2 pr-1 leading-none text-primary-foreground sm:text-sm",\r
|
|
7231
|
+
});\r
|
|
7232
|
+
</script>\r
|
|
7233
|
+
`},{fileName:"TagsInput/ItemDelete.vue",dirPath:"components/UI",fileContent:`<template>\r
|
|
7234
|
+
<TagsInputItemDelete\r
|
|
7235
|
+
v-bind="reactiveOmit(props, 'icon', 'class')"\r
|
|
7236
|
+
:class="styles({ class: props.class })"\r
|
|
7237
|
+
>\r
|
|
7238
|
+
<slot>\r
|
|
7239
|
+
<Icon v-if="icon" :name="icon" class="h-3.5 w-3.5" />\r
|
|
7240
|
+
</slot>\r
|
|
7241
|
+
</TagsInputItemDelete>\r
|
|
7242
|
+
</template>\r
|
|
7243
|
+
\r
|
|
7244
|
+
<script lang="ts" setup>\r
|
|
7245
|
+
import { TagsInputItemDelete } from "radix-vue";\r
|
|
7246
|
+
import type { TagsInputItemDeleteProps } from "radix-vue";\r
|
|
7247
|
+
\r
|
|
7248
|
+
const props = withDefaults(\r
|
|
7249
|
+
defineProps<TagsInputItemDeleteProps & { icon?: string; class?: any }>(),\r
|
|
7250
|
+
{\r
|
|
7251
|
+
icon: "lucide:x",\r
|
|
7252
|
+
}\r
|
|
7253
|
+
);\r
|
|
7254
|
+
\r
|
|
7255
|
+
const styles = tv({\r
|
|
7256
|
+
base: "flex items-center justify-center rounded bg-transparent opacity-40 transition hover:bg-muted-foreground hover:opacity-100 focus:opacity-100 focus-visible:outline-none",\r
|
|
7257
|
+
});\r
|
|
7258
|
+
</script>\r
|
|
7259
|
+
`},{fileName:"TagsInput/ItemText.vue",dirPath:"components/UI",fileContent:`<template>\r
|
|
7260
|
+
<TagsInputItemText v-bind="reactiveOmit(props, 'class')" :class="styles({ class: props.class })">\r
|
|
7261
|
+
<slot></slot>\r
|
|
7262
|
+
</TagsInputItemText>\r
|
|
7263
|
+
</template>\r
|
|
7264
|
+
\r
|
|
7265
|
+
<script lang="ts" setup>\r
|
|
7266
|
+
import { TagsInputItemText } from "radix-vue";\r
|
|
7267
|
+
import type { TagsInputItemTextProps } from "radix-vue";\r
|
|
7268
|
+
\r
|
|
7269
|
+
const props = defineProps<TagsInputItemTextProps & { class?: any }>();\r
|
|
7270
|
+
\r
|
|
7271
|
+
const styles = tv({\r
|
|
7272
|
+
base: "leading-none sm:text-sm",\r
|
|
7273
|
+
});\r
|
|
7274
|
+
</script>\r
|
|
7275
|
+
`},{fileName:"TagsInput/TagsInput.vue",dirPath:"components/UI",fileContent:`<template>\r
|
|
7276
|
+
<TagsInputRoot v-bind="forwarded" :class="styles({ class: props.class })">\r
|
|
7277
|
+
<slot></slot>\r
|
|
7278
|
+
</TagsInputRoot>\r
|
|
7279
|
+
</template>\r
|
|
7280
|
+
\r
|
|
7281
|
+
<script lang="ts" setup>\r
|
|
7282
|
+
import { TagsInputRoot, useForwardPropsEmits } from "radix-vue";\r
|
|
7283
|
+
import type { TagsInputRootEmits, TagsInputRootProps } from "radix-vue";\r
|
|
7284
|
+
\r
|
|
7285
|
+
const props = defineProps<TagsInputRootProps & { class?: any }>();\r
|
|
7286
|
+
const emits = defineEmits<TagsInputRootEmits>();\r
|
|
7287
|
+
const forwarded = useForwardPropsEmits(reactiveOmit(props, "class"), emits);\r
|
|
7288
|
+
\r
|
|
7289
|
+
const styles = tv({\r
|
|
7290
|
+
base: "flex min-h-[40px] w-full flex-wrap items-center gap-2 rounded-md border border-input bg-background px-3 py-2 leading-none transition focus-within:outline-none focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2 focus-within:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",\r
|
|
7291
|
+
});\r
|
|
7292
|
+
</script>\r
|
|
7119
7293
|
`}],utils:[],composables:[],plugins:[]},{name:"Tanstack Table",value:"tanstacktable",deps:["tailwind-variants","@tanstack/vue-table"],devDeps:["nuxt-icon"],nuxtModules:["nuxt-icon"],components:["checkbox"],files:[{fileName:"TanStackTable.vue",dirPath:"components/UI",fileContent:`<template>
|
|
7120
7294
|
<div>
|
|
7121
7295
|
<div :class="styles({ class: props.class })">
|
|
@@ -8732,6 +8906,73 @@ export { toast, useToast };
|
|
|
8732
8906
|
syncVModel: true,\r
|
|
8733
8907
|
});\r
|
|
8734
8908
|
</script>\r
|
|
8909
|
+
`}],utils:[],composables:[],plugins:[]},{name:"VeeTagsInput",value:"vee-tags-input",deps:["@vee-validate/nuxt","radix-vue","@morev/vue-transitions","tailwind-variants"],askValidator:!0,devDeps:["nuxt-icon"],nuxtModules:["@vee-validate/nuxt","@morev/vue-transitions/nuxt","nuxt-icon"],components:["tags-input","label"],files:[{fileName:"Vee/TagsInput.vue",dirPath:"components/UI",fileContent:`<template>\r
|
|
8910
|
+
<div class="w-full">\r
|
|
8911
|
+
<UILabel\r
|
|
8912
|
+
:for="inputId"\r
|
|
8913
|
+
v-if="label"\r
|
|
8914
|
+
:class="[disabled && 'text-muted-foreground', errorMessage && 'text-destructive', 'mb-2']"\r
|
|
8915
|
+
>{{ label }}</UILabel\r
|
|
8916
|
+
>\r
|
|
8917
|
+
<div class="relative">\r
|
|
8918
|
+
<slot name="icon">\r
|
|
8919
|
+
<span v-if="hasIcon" class="absolute inset-y-0 left-3 flex items-center justify-center">\r
|
|
8920
|
+
<Icon :name="icon" v-if="icon" class="h-4 w-4 text-muted-foreground/70" />\r
|
|
8921
|
+
</span>\r
|
|
8922
|
+
</slot>\r
|
|
8923
|
+
<UiTagsInput\r
|
|
8924
|
+
v-model="value"\r
|
|
8925
|
+
:name="name"\r
|
|
8926
|
+
:disabled="disabled"\r
|
|
8927
|
+
v-bind="$attrs"\r
|
|
8928
|
+
:class="[hasIcon && 'pl-9']"\r
|
|
8929
|
+
>\r
|
|
8930
|
+
<UiTagsInputItem v-for="tag in value" :key="tag" :value="tag" />\r
|
|
8931
|
+
<UiTagsInputField :id="inputId" :placeholder="placeholder" />\r
|
|
8932
|
+
</UiTagsInput>\r
|
|
8933
|
+
</div>\r
|
|
8934
|
+
<TransitionSlide group tag="div">\r
|
|
8935
|
+
<p key="hint" class="mt-1.5 text-sm text-muted-foreground" v-if="hint && !errorMessage">\r
|
|
8936
|
+
{{ hint }}\r
|
|
8937
|
+
</p>\r
|
|
8938
|
+
\r
|
|
8939
|
+
<p key="errorMessage" class="mt-1.5 text-sm text-destructive" v-if="errorMessage">\r
|
|
8940
|
+
{{ errorMessage }}\r
|
|
8941
|
+
</p>\r
|
|
8942
|
+
</TransitionSlide>\r
|
|
8943
|
+
</div>\r
|
|
8944
|
+
</template>\r
|
|
8945
|
+
\r
|
|
8946
|
+
<script lang="ts" setup>\r
|
|
8947
|
+
import { useId } from "radix-vue";\r
|
|
8948
|
+
\r
|
|
8949
|
+
const props = defineProps<{\r
|
|
8950
|
+
label?: string;\r
|
|
8951
|
+
icon?: string;\r
|
|
8952
|
+
hint?: string;\r
|
|
8953
|
+
disabled?: boolean;\r
|
|
8954
|
+
modelValue?: string[];\r
|
|
8955
|
+
name?: string;\r
|
|
8956
|
+
id?: string;\r
|
|
8957
|
+
rules?: any;\r
|
|
8958
|
+
validateOnMount?: boolean;\r
|
|
8959
|
+
type?: string;\r
|
|
8960
|
+
placeholder?: string;\r
|
|
8961
|
+
}>();\r
|
|
8962
|
+
\r
|
|
8963
|
+
defineOptions({ inheritAttrs: false });\r
|
|
8964
|
+
\r
|
|
8965
|
+
const inputId = useId(props.id);\r
|
|
8966
|
+
\r
|
|
8967
|
+
const hasIcon = computed(() => Boolean(props.icon) || Boolean(useSlots().icon));\r
|
|
8968
|
+
\r
|
|
8969
|
+
const { errorMessage, value, handleBlur } = useField(() => props.name || inputId, props.rules, {\r
|
|
8970
|
+
initialValue: props.modelValue,\r
|
|
8971
|
+
label: props.label,\r
|
|
8972
|
+
validateOnMount: props.validateOnMount,\r
|
|
8973
|
+
syncVModel: true,\r
|
|
8974
|
+
});\r
|
|
8975
|
+
</script>\r
|
|
8735
8976
|
`}],utils:[],composables:[],plugins:[]},{name:"VeeTextarea",value:"vee-textarea",deps:["@vee-validate/nuxt","radix-vue","@morev/vue-transitions","tailwind-variants"],askValidator:!0,devDeps:["nuxt-icon"],nuxtModules:["@vee-validate/nuxt","@morev/vue-transitions/nuxt","nuxt-icon"],components:["textarea","label"],files:[{fileName:"Vee/Textarea.vue",dirPath:"components/UI",fileContent:`<template>\r
|
|
8736
8977
|
<div class="w-full">\r
|
|
8737
8978
|
<UILabel :for="inputId" v-if="label" :class="[errorMessage && 'text-destructive', 'mb-2']">{{\r
|
|
@@ -8842,109 +9083,109 @@ export { toast, useToast };
|
|
|
8842
9083
|
@apply bg-muted-foreground;\r
|
|
8843
9084
|
}\r
|
|
8844
9085
|
</style>\r
|
|
8845
|
-
`}],utils:[],composables:[],plugins:[]}];import{join as vp}from"path";import{loadConfig as xp}from"c12";import Se from"fs-extra";import Pa from"kleur";import Pp from"lodash";import{promises as Kr}from"node:fs";var Bn=sn(lr(),1),_i=sn(qr(),1);function pe(s){var n=s.use(J),e=n.Type,t=n.builtInTypes,r=t.number;function i(c){return e.from(p=>r.check(p)&&p>=c,r+" >= "+c)}let a={null:function(){return null},emptyArray:function(){return[]},false:function(){return!1},true:function(){return!0},undefined:function(){},"use strict":function(){return"use strict"}};var o=e.or(t.string,t.number,t.boolean,t.null,t.undefined);let l=e.from(c=>{if(c===null)return!0;var p=typeof c;return!(p==="object"||p==="function")},o.toString());return{geq:i,defaults:a,isPrimitive:l}}function z(s){try{var n=s(),e=n.exports,t=e.default}catch{return}t&&t!==e&&typeof e=="object"&&(Object.assign(t,e,{default:t}),e.__esModule&&Object.defineProperty(t,"__esModule",{value:!0}),n.exports=t)}var jl=Object.defineProperty,Vl=(s,n,e)=>n in s?jl(s,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[n]=e,ie=(s,n,e)=>(Vl(s,typeof n!="symbol"?n+"":n,e),e),Ui=Object.prototype,Mn=Ui.toString,be=Ui.hasOwnProperty,tt=class{assert(n,e){if(!this.check(n,e)){var t=ss(n);throw new Error(t+" does not match type "+this)}return!0}arrayOf(){let n=this;return new Gt(n)}},Gt=class extends tt{constructor(n){super(),this.elemType=n,ie(this,"kind","ArrayType")}toString(){return"["+this.elemType+"]"}check(n,e){return Array.isArray(n)&&n.every(t=>this.elemType.check(t,e))}},Dn=class extends tt{constructor(n){super(),this.value=n,ie(this,"kind","IdentityType")}toString(){return String(this.value)}check(n,e){let t=n===this.value;return!t&&typeof e=="function"&&e(this,n),t}},Ln=class extends tt{constructor(n){super(),this.fields=n,ie(this,"kind","ObjectType")}toString(){return"{ "+this.fields.join(", ")+" }"}check(n,e){return Mn.call(n)===Mn.call({})&&this.fields.every(t=>t.type.check(n[t.name],e))}},On=class extends tt{constructor(n){super(),this.types=n,ie(this,"kind","OrType")}toString(){return this.types.join(" | ")}check(n,e){return this.types.some(t=>t.check(n,!!e))?!0:(typeof e=="function"&&e(this,n),!1)}},et=class extends tt{constructor(n,e){super(),this.name=n,this.predicate=e,ie(this,"kind","PredicateType")}toString(){return this.name}check(n,e){let t=this.predicate(n,e);return!t&&typeof e=="function"&&e(this,n),t}},Ht=class s{constructor(n,e){this.type=n,this.typeName=e,ie(this,"baseNames",[]),ie(this,"ownFields",Object.create(null)),ie(this,"allSupertypes",Object.create(null)),ie(this,"supertypeList",[]),ie(this,"allFields",Object.create(null)),ie(this,"fieldNames",[]),ie(this,"finalized",!1),ie(this,"buildable",!1),ie(this,"buildParams",[])}isSupertypeOf(n){if(n instanceof s){if(this.finalized!==!0||n.finalized!==!0)throw new Error("");return be.call(n.allSupertypes,this.typeName)}else throw new Error(n+" is not a Def")}checkAllFields(n,e){var t=this.allFields;if(this.finalized!==!0)throw new Error(""+this.typeName);function r(i){var a=t[i],o=a.type,l=a.getValue(n);return o.check(l,e)}return n!==null&&typeof n=="object"&&Object.keys(t).every(r)}bases(...n){var e=this.baseNames;if(this.finalized){if(n.length!==e.length)throw new Error("");for(var t=0;t<n.length;t++)if(n[t]!==e[t])throw new Error("");return this}return n.forEach(r=>{e.indexOf(r)<0&&e.push(r)}),this}},Fn=class{constructor(n,e,t,r){this.name=n,this.type=e,this.defaultFn=t,ie(this,"hidden"),this.hidden=!!r}toString(){return JSON.stringify(this.name)+": "+this.type}getValue(n){var e=n[this.name];return typeof e<"u"||typeof this.defaultFn=="function"&&(e=this.defaultFn.call(n)),e}};function ss(s){return Array.isArray(s)?"["+s.map(ss).join(", ")+"]":s&&typeof s=="object"?"{ "+Object.keys(s).map(function(n){return n+": "+s[n]}).join(", ")+" }":JSON.stringify(s)}function J(s){let n={or(...S){return new On(S.map(E=>n.from(E)))},from(S,E){if(S instanceof Gt||S instanceof Dn||S instanceof Ln||S instanceof On||S instanceof et)return S;if(S instanceof Ht)return S.type;if(o.check(S)){if(S.length!==1)throw new Error("only one element type is permitted for typed arrays");return new Gt(n.from(S[0]))}if(l.check(S))return new Ln(Object.keys(S).map(F=>new Fn(F,n.from(S[F],F))));if(typeof S=="function"){var O=e.indexOf(S);if(O>=0)return t[O];if(typeof E!="string")throw new Error("missing name");return new et(E,S)}return new Dn(S)},def(S){return be.call(v,S)?v[S]:v[S]=new I(S)},hasDef(S){return be.call(v,S)}};var e=[],t=[];function r(S,E){let O=Mn.call(E),F=new et(S,$=>Mn.call($)===O);return E&&typeof E.constructor=="function"&&(e.push(E.constructor),t.push(F)),F}let i=r("string","truthy"),a=r("function",function(){}),o=r("array",[]),l=r("object",{}),c=r("RegExp",/./),p=r("Date",new Date),u=r("number",3),h=r("boolean",!0),m=r("null",null),d=r("undefined",void 0),y=typeof BigInt=="function"?r("BigInt",BigInt(1234)):new et("BigInt",()=>!1),f={string:i,function:a,array:o,object:l,RegExp:c,Date:p,number:u,boolean:h,null:m,undefined:d,BigInt:y};var v=Object.create(null);function w(S){if(S&&typeof S=="object"){var E=S.type;if(typeof E=="string"&&be.call(v,E)){var O=v[E];if(O.finalized)return O}}return null}class I extends Ht{constructor(E){super(new et(E,(O,F)=>this.check(O,F)),E)}check(E,O){if(this.finalized!==!0)throw new Error("prematurely checking unfinalized type "+this.typeName);if(E===null||typeof E!="object")return!1;var F=w(E);return F?O&&F===this?this.checkAllFields(E,O):this.isSupertypeOf(F)?O?F.checkAllFields(E,O)&&this.checkAllFields(E,!1):!0:!1:this.typeName==="SourceLocation"||this.typeName==="Position"?this.checkAllFields(E,O):!1}build(...E){if(this.buildParams=E,this.buildable)return this;this.field("type",String,()=>this.typeName),this.buildable=!0;let O=($,H,K,de)=>{if(!be.call($,H)){var Me=this.allFields;if(!be.call(Me,H))throw new Error(""+H);var rn=Me[H],qa=rn.type,Ct;if(de)Ct=K;else if(rn.defaultFn)Ct=rn.defaultFn.call($);else{var Ha="no value or default function given for field "+JSON.stringify(H)+" of "+this.typeName+"("+this.buildParams.map(function(Wa){return Me[Wa]}).join(", ")+")";throw new Error(Ha)}if(!qa.check(Ct))throw new Error(ss(Ct)+" does not match field "+rn+" of type "+this.typeName);$[H]=Ct}},F=(...$)=>{var H=$.length;if(!this.finalized)throw new Error("attempting to instantiate unfinalized type "+this.typeName);var K=Object.create(N);if(this.buildParams.forEach(function(de,Me){Me<H?O(K,de,$[Me],!0):O(K,de,null,!1)}),Object.keys(this.allFields).forEach(function(de){O(K,de,null,!1)}),K.type!==this.typeName)throw new Error("");return K};return F.from=$=>{if(!this.finalized)throw new Error("attempting to instantiate unfinalized type "+this.typeName);var H=Object.create(N);if(Object.keys(this.allFields).forEach(function(K){be.call($,K)?O(H,K,$[K],!0):O(H,K,null,!1)}),H.type!==this.typeName)throw new Error("");return H},Object.defineProperty(C,oe(this.typeName),{enumerable:!0,value:F}),this}field(E,O,F,$){return this.finalized?(console.error("Ignoring attempt to redefine field "+JSON.stringify(E)+" of finalized type "+JSON.stringify(this.typeName)),this):(this.ownFields[E]=new Fn(E,n.from(O),F,$),this)}finalize(){if(!this.finalized){var E=this.allFields,O=this.allSupertypes;this.baseNames.forEach($=>{var H=v[$];if(H instanceof Ht)H.finalize(),Jn(E,H.allFields),Jn(O,H.allSupertypes);else{var K="unknown supertype name "+JSON.stringify($)+" for subtype "+JSON.stringify(this.typeName);throw new Error(K)}}),Jn(E,this.ownFields),O[this.typeName]=this,this.fieldNames.length=0;for(var F in E)be.call(E,F)&&!E[F].hidden&&this.fieldNames.push(F);Object.defineProperty(gs,this.typeName,{enumerable:!0,value:this.type}),this.finalized=!0,za(this.typeName,this.supertypeList),this.buildable&&this.supertypeList.lastIndexOf("Expression")>=0&&Va(this.typeName)}}}function x(S){if(!be.call(v,S))throw new Error("");var E=v[S];if(E.finalized!==!0)throw new Error("");return E.supertypeList.slice(1)}function P(S){for(var E={},O=Object.keys(v),F=O.length,$=0;$<F;++$){var H=O[$],K=v[H];if(K.finalized!==!0)throw new Error(""+H);for(var de=0;de<K.supertypeList.length;++de){var Me=K.supertypeList[de];if(be.call(S,Me)){E[H]=Me;break}}}return E}var C=Object.create(null),N={};function q(S,E){var O=N[S];return d.check(E)?delete N[S]:(a.assert(E),Object.defineProperty(N,S,{enumerable:!0,configurable:!0,value:E})),O}function oe(S){return S.replace(/^[A-Z]+/,function(E){var O=E.length;switch(O){case 0:return"";case 1:return E.toLowerCase();default:return E.slice(0,O-1).toLowerCase()+E.charAt(O-1)}})}function Ie(S){return S=oe(S),S.replace(/(Expression)?$/,"Statement")}var gs={};function Gn(S){var E=w(S);if(E)return E.fieldNames.slice(0);if("type"in S)throw new Error("did not recognize object of type "+JSON.stringify(S.type));return Object.keys(S)}function Kn(S,E){var O=w(S);if(O){var F=O.allFields[E];if(F)return F.getValue(S)}return S&&S[E]}function Ra(S,E,O){Gn(S).forEach(function(F){E.call(this,F,Kn(S,F))},O)}function ja(S,E,O){return Gn(S).some(function(F){return E.call(this,F,Kn(S,F))},O)}function Va(S){var E=Ie(S);if(C[E])return;var O=C[oe(S)];if(!O)return;let F=function(...$){return C.expressionStatement(O.apply(C,$))};F.from=function(...$){return C.expressionStatement(O.from.apply(C,$))},C[E]=F}function za(S,E){E.length=0,E.push(S);for(var O=Object.create(null),F=0;F<E.length;++F){S=E[F];var $=v[S];if($.finalized!==!0)throw new Error("");be.call(O,S)&&delete E[O[S]],O[S]=F,E.push.apply(E,$.baseNames)}for(var H=0,K=H,de=E.length;K<de;++K)be.call(E,K)&&(E[H++]=E[K]);E.length=H}function Jn(S,E){return Object.keys(E).forEach(function(O){S[O]=E[O]}),S}function $a(){Object.keys(v).forEach(function(S){v[S].finalize()})}return{Type:n,builtInTypes:f,getSupertypeNames:x,computeSupertypeLookupTable:P,builders:C,defineMethod:q,getBuilderName:oe,getStatementBuilderName:Ie,namedTypes:gs,getFieldNames:Gn,getFieldValue:Kn,eachField:Ra,someField:ja,finalize:$a}}z(()=>module);var zl=Object.prototype,wn=zl.hasOwnProperty;function Bi(s){var n=s.use(J),e=n.builtInTypes.array,t=n.builtInTypes.number;let r=function u(h,m,d){if(!(this instanceof u))throw new Error("Path constructor cannot be invoked without 'new'");if(m){if(!(m instanceof u))throw new Error("")}else m=null,d=null;this.value=h,this.parentPath=m,this.name=d,this.__childCache=null};var i=r.prototype;function a(u){return u.__childCache||(u.__childCache=Object.create(null))}function o(u,h){var m=a(u),d=u.getValueProperty(h),y=m[h];return(!wn.call(m,h)||y.value!==d)&&(y=m[h]=new u.constructor(d,u,h)),y}i.getValueProperty=function(h){return this.value[h]},i.get=function(...h){for(var m=this,d=h.length,y=0;y<d;++y)m=o(m,h[y]);return m},i.each=function(h,m){for(var d=[],y=this.value.length,f=0,f=0;f<y;++f)wn.call(this.value,f)&&(d[f]=this.get(f));for(m=m||this,f=0;f<y;++f)wn.call(d,f)&&h.call(m,d[f])},i.map=function(h,m){var d=[];return this.each(function(y){d.push(h.call(this,y))},m),d},i.filter=function(h,m){var d=[];return this.each(function(y){h.call(this,y)&&d.push(y)},m),d};function l(){}function c(u,h,m,d){if(e.assert(u.value),h===0)return l;var y=u.value.length;if(y<1)return l;var f=arguments.length;f===2?(m=0,d=y):f===3?(m=Math.max(m,0),d=y):(m=Math.max(m,0),d=Math.min(d,y)),t.assert(m),t.assert(d);for(var v=Object.create(null),w=a(u),I=m;I<d;++I)if(wn.call(u.value,I)){var x=u.get(I);if(x.name!==I)throw new Error("");var P=I+h;x.name=P,v[P]=x,delete w[I]}return delete w.length,function(){for(var C in v){var N=v[C];if(N.name!==+C)throw new Error("");w[C]=N,u.value[C]=N.value}}}i.shift=function(){var h=c(this,-1),m=this.value.shift();return h(),m},i.unshift=function(...h){var m=c(this,h.length),d=this.value.unshift.apply(this.value,h);return m(),d},i.push=function(...h){return e.assert(this.value),delete a(this).length,this.value.push.apply(this.value,h)},i.pop=function(){e.assert(this.value);var h=a(this);return delete h[this.value.length-1],delete h.length,this.value.pop()},i.insertAt=function(h){var m=arguments.length,d=c(this,m-1,h);if(d===l&&m<=1)return this;h=Math.max(h,0);for(var y=1;y<m;++y)this.value[h+y-1]=arguments[y];return d(),this},i.insertBefore=function(...h){for(var m=this.parentPath,d=h.length,y=[this.name],f=0;f<d;++f)y.push(h[f]);return m.insertAt.apply(m,y)},i.insertAfter=function(...h){for(var m=this.parentPath,d=h.length,y=[this.name+1],f=0;f<d;++f)y.push(h[f]);return m.insertAt.apply(m,y)};function p(u){if(!(u instanceof r))throw new Error("");var h=u.parentPath;if(!h)return u;var m=h.value,d=a(h);if(m[u.name]===u.value)d[u.name]=u;else if(e.check(m)){var y=m.indexOf(u.value);y>=0&&(d[u.name=y]=u)}else m[u.name]=u.value,d[u.name]=u;if(m[u.name]!==u.value)throw new Error("");if(u.parentPath.get(u.name)!==u)throw new Error("");return u}return i.replace=function(h){var m=[],d=this.parentPath.value,y=a(this.parentPath),f=arguments.length;if(p(this),e.check(d)){for(var v=d.length,w=c(this.parentPath,f-1,this.name+1),I=[this.name,1],x=0;x<f;++x)I.push(arguments[x]);var P=d.splice.apply(d,I);if(P[0]!==this.value)throw new Error("");if(d.length!==v-1+f)throw new Error("");if(w(),f===0)delete this.value,delete y[this.name],this.__childCache=null;else{if(d[this.name]!==h)throw new Error("");for(this.value!==h&&(this.value=h,this.__childCache=null),x=0;x<f;++x)m.push(this.parentPath.get(this.name+x));if(m[0]!==this)throw new Error("")}}else if(f===1)this.value!==h&&(this.__childCache=null),this.value=d[this.name]=h,m.push(this);else if(f===0)delete d[this.name],delete this.value,this.__childCache=null;else throw new Error("Could not replace path");return m},r}z(()=>module);var ht=Object.prototype.hasOwnProperty;function $l(s){var n=s.use(J),e=n.Type,t=n.namedTypes,r=t.Node,i=t.Expression,a=n.builtInTypes.array,o=n.builders;let l=function x(P,C){if(!(this instanceof x))throw new Error("Scope constructor cannot be invoked without 'new'");p.check(P.value)||c.assert(P.value);var N;if(C){if(!(C instanceof x))throw new Error("");N=C.depth+1}else C=null,N=0;Object.defineProperties(this,{path:{value:P},node:{value:P.value},isGlobal:{value:!C,enumerable:!0},depth:{value:N},parent:{value:C},bindings:{value:{}},types:{value:{}}})};var c=e.or(t.Program,t.Function,t.CatchClause),p=e.or(t.Function,t.ClassDeclaration,t.ClassExpression,t.InterfaceDeclaration,t.TSInterfaceDeclaration,t.TypeAlias,t.TSTypeAliasDeclaration),u=e.or(t.TypeParameter,t.TSTypeParameter);l.isEstablishedBy=function(x){return c.check(x)||p.check(x)};var h=l.prototype;h.didScan=!1,h.declares=function(x){return this.scan(),ht.call(this.bindings,x)},h.declaresType=function(x){return this.scan(),ht.call(this.types,x)},h.declareTemporary=function(x){if(x){if(!/^[a-z$_]/i.test(x))throw new Error("")}else x="t$";x+=this.depth.toString(36)+"$",this.scan();for(var P=0;this.declares(x+P);)++P;var C=x+P;return this.bindings[C]=n.builders.identifier(C)},h.injectTemporary=function(x,P){x||(x=this.declareTemporary());var C=this.path.get("body");return t.BlockStatement.check(C.value)&&(C=C.get("body")),C.unshift(o.variableDeclaration("var",[o.variableDeclarator(x,P||null)])),x},h.scan=function(x){if(x||!this.didScan){for(var P in this.bindings)delete this.bindings[P];for(var P in this.types)delete this.types[P];m(this.path,this.bindings,this.types),this.didScan=!0}},h.getBindings=function(){return this.scan(),this.bindings},h.getTypes=function(){return this.scan(),this.types};function m(x,P,C){var N=x.value;if(p.check(N)){let q=x.get("typeParameters","params");a.check(q.value)&&q.each(oe=>{I(oe,C)})}c.check(N)&&(t.CatchClause.check(N)?v(x.get("param"),P):d(x,P,C))}function d(x,P,C){var N=x.value;x.parent&&t.FunctionExpression.check(x.parent.node)&&x.parent.node.id&&v(x.parent.get("id"),P),N&&(a.check(N)?x.each(q=>{f(q,P,C)}):t.Function.check(N)?(x.get("params").each(q=>{v(q,P)}),f(x.get("body"),P,C),d(x.get("typeParameters"),P,C)):t.TypeAlias&&t.TypeAlias.check(N)||t.InterfaceDeclaration&&t.InterfaceDeclaration.check(N)||t.TSTypeAliasDeclaration&&t.TSTypeAliasDeclaration.check(N)||t.TSInterfaceDeclaration&&t.TSInterfaceDeclaration.check(N)?w(x.get("id"),C):t.VariableDeclarator.check(N)?(v(x.get("id"),P),f(x.get("init"),P,C)):N.type==="ImportSpecifier"||N.type==="ImportNamespaceSpecifier"||N.type==="ImportDefaultSpecifier"?v(x.get(N.local?"local":N.name?"name":"id"),P):r.check(N)&&!i.check(N)&&n.eachField(N,function(q,oe){var Ie=x.get(q);if(!y(Ie,oe))throw new Error("");f(Ie,P,C)}))}function y(x,P){return!!(x.value===P||Array.isArray(x.value)&&x.value.length===0&&Array.isArray(P)&&P.length===0)}function f(x,P,C){var N=x.value;if(!(!N||i.check(N)))if(t.FunctionDeclaration.check(N)&&N.id!==null)v(x.get("id"),P);else if(t.ClassDeclaration&&t.ClassDeclaration.check(N)&&N.id!==null)v(x.get("id"),P),d(x.get("typeParameters"),P,C);else if(t.InterfaceDeclaration&&t.InterfaceDeclaration.check(N)||t.TSInterfaceDeclaration&&t.TSInterfaceDeclaration.check(N))w(x.get("id"),C);else if(c.check(N)){if(t.CatchClause.check(N)&&t.Identifier.check(N.param)){var q=N.param.name,oe=ht.call(P,q);d(x.get("body"),P,C),oe||delete P[q]}}else d(x,P,C)}function v(x,P){var C=x.value;t.Pattern.assert(C),t.Identifier.check(C)?ht.call(P,C.name)?P[C.name].push(x):P[C.name]=[x]:t.AssignmentPattern&&t.AssignmentPattern.check(C)?v(x.get("left"),P):t.ObjectPattern&&t.ObjectPattern.check(C)?x.get("properties").each(function(N){var q=N.value;t.Pattern.check(q)?v(N,P):t.Property.check(q)||t.ObjectProperty&&t.ObjectProperty.check(q)?v(N.get("value"),P):t.SpreadProperty&&t.SpreadProperty.check(q)&&v(N.get("argument"),P)}):t.ArrayPattern&&t.ArrayPattern.check(C)?x.get("elements").each(function(N){var q=N.value;t.Pattern.check(q)?v(N,P):t.SpreadElement&&t.SpreadElement.check(q)&&v(N.get("argument"),P)}):t.PropertyPattern&&t.PropertyPattern.check(C)?v(x.get("pattern"),P):(t.SpreadElementPattern&&t.SpreadElementPattern.check(C)||t.RestElement&&t.RestElement.check(C)||t.SpreadPropertyPattern&&t.SpreadPropertyPattern.check(C))&&v(x.get("argument"),P)}function w(x,P){var C=x.value;t.Pattern.assert(C),t.Identifier.check(C)&&(ht.call(P,C.name)?P[C.name].push(x):P[C.name]=[x])}function I(x,P){var C=x.value;u.assert(C),ht.call(P,C.name)?P[C.name].push(x):P[C.name]=[x]}return h.lookup=function(x){for(var P=this;P&&!P.declares(x);P=P.parent);return P},h.lookupType=function(x){for(var P=this;P&&!P.declaresType(x);P=P.parent);return P},h.getGlobalScope=function(){for(var x=this;!x.isGlobal;)x=x.parent;return x},l}z(()=>module);function Ri(s){var n=s.use(J),e=n.namedTypes,t=n.builders,r=n.builtInTypes.number,i=n.builtInTypes.array,a=s.use(Bi),o=s.use($l);let l=function f(v,w,I){if(!(this instanceof f))throw new Error("NodePath constructor cannot be invoked without 'new'");a.call(this,v,w,I)};var c=l.prototype=Object.create(a.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}});Object.defineProperties(c,{node:{get:function(){return Object.defineProperty(this,"node",{configurable:!0,value:this._computeNode()}),this.node}},parent:{get:function(){return Object.defineProperty(this,"parent",{configurable:!0,value:this._computeParent()}),this.parent}},scope:{get:function(){return Object.defineProperty(this,"scope",{configurable:!0,value:this._computeScope()}),this.scope}}}),c.replace=function(){return delete this.node,delete this.parent,delete this.scope,a.prototype.replace.apply(this,arguments)},c.prune=function(){var f=this.parent;return this.replace(),d(f)},c._computeNode=function(){var f=this.value;if(e.Node.check(f))return f;var v=this.parentPath;return v&&v.node||null},c._computeParent=function(){var f=this.value,v=this.parentPath;if(!e.Node.check(f)){for(;v&&!e.Node.check(v.value);)v=v.parentPath;v&&(v=v.parentPath)}for(;v&&!e.Node.check(v.value);)v=v.parentPath;return v||null},c._computeScope=function(){var f=this.value,v=this.parentPath,w=v&&v.scope;return e.Node.check(f)&&o.isEstablishedBy(f)&&(w=new o(this,w)),w||null},c.getValueProperty=function(f){return n.getFieldValue(this.value,f)},c.needsParens=function(f){var v=this.parentPath;if(!v)return!1;var w=this.value;if(!e.Expression.check(w)||w.type==="Identifier")return!1;for(;!e.Node.check(v.value);)if(v=v.parentPath,!v)return!1;var I=v.value;switch(w.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return I.type==="MemberExpression"&&this.name==="object"&&I.object===w;case"BinaryExpression":case"LogicalExpression":switch(I.type){case"CallExpression":return this.name==="callee"&&I.callee===w;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return this.name==="object"&&I.object===w;case"BinaryExpression":case"LogicalExpression":{let x=w,P=I.operator,C=u[P],N=x.operator,q=u[N];if(C>q)return!0;if(C===q&&this.name==="right"){if(I.right!==x)throw new Error("Nodes must be equal");return!0}}default:return!1}case"SequenceExpression":switch(I.type){case"ForStatement":return!1;case"ExpressionStatement":return this.name!=="expression";default:return!0}case"YieldExpression":switch(I.type){case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"CallExpression":case"MemberExpression":case"NewExpression":case"ConditionalExpression":case"YieldExpression":return!0;default:return!1}case"Literal":return I.type==="MemberExpression"&&r.check(w.value)&&this.name==="object"&&I.object===w;case"AssignmentExpression":case"ConditionalExpression":switch(I.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":return this.name==="callee"&&I.callee===w;case"ConditionalExpression":return this.name==="test"&&I.test===w;case"MemberExpression":return this.name==="object"&&I.object===w;default:return!1}default:if(I.type==="NewExpression"&&this.name==="callee"&&I.callee===w)return h(w)}return!!(f!==!0&&!this.canBeFirstInStatement()&&this.firstInStatement())};function p(f){return e.BinaryExpression.check(f)||e.LogicalExpression.check(f)}var u={};[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(f,v){f.forEach(function(w){u[w]=v})});function h(f){return e.CallExpression.check(f)?!0:i.check(f)?f.some(h):e.Node.check(f)?n.someField(f,function(v,w){return h(w)}):!1}c.canBeFirstInStatement=function(){var f=this.node;return!e.FunctionExpression.check(f)&&!e.ObjectExpression.check(f)},c.firstInStatement=function(){return m(this)};function m(f){for(var v,w;f.parent;f=f.parent){if(v=f.node,w=f.parent.node,e.BlockStatement.check(w)&&f.parent.name==="body"&&f.name===0){if(w.body[0]!==v)throw new Error("Nodes must be equal");return!0}if(e.ExpressionStatement.check(w)&&f.name==="expression"){if(w.expression!==v)throw new Error("Nodes must be equal");return!0}if(e.SequenceExpression.check(w)&&f.parent.name==="expressions"&&f.name===0){if(w.expressions[0]!==v)throw new Error("Nodes must be equal");continue}if(e.CallExpression.check(w)&&f.name==="callee"){if(w.callee!==v)throw new Error("Nodes must be equal");continue}if(e.MemberExpression.check(w)&&f.name==="object"){if(w.object!==v)throw new Error("Nodes must be equal");continue}if(e.ConditionalExpression.check(w)&&f.name==="test"){if(w.test!==v)throw new Error("Nodes must be equal");continue}if(p(w)&&f.name==="left"){if(w.left!==v)throw new Error("Nodes must be equal");continue}if(e.UnaryExpression.check(w)&&!w.prefix&&f.name==="argument"){if(w.argument!==v)throw new Error("Nodes must be equal");continue}return!1}return!0}function d(f){if(e.VariableDeclaration.check(f.node)){var v=f.get("declarations").value;if(!v||v.length===0)return f.prune()}else if(e.ExpressionStatement.check(f.node)){if(!f.get("expression").value)return f.prune()}else e.IfStatement.check(f.node)&&y(f);return f}function y(f){var v=f.get("test").value,w=f.get("alternate").value,I=f.get("consequent").value;if(!I&&!w){var x=t.expressionStatement(v);f.replace(x)}else if(!I&&w){var P=t.unaryExpression("!",v,!0);e.UnaryExpression.check(v)&&v.operator==="!"&&(P=v.argument),f.get("test").replace(P),f.get("consequent").replace(w),f.get("alternate").replace()}}return l}z(()=>module);var Cn=Object.prototype.hasOwnProperty;function ql(s){var n=s.use(J),e=s.use(Ri),t=n.builtInTypes.array,r=n.builtInTypes.object,i=n.builtInTypes.function,a;let o=function d(){if(!(this instanceof d))throw new Error("PathVisitor constructor cannot be invoked without 'new'");this._reusableContextStack=[],this._methodNameTable=l(this),this._shouldVisitComments=Cn.call(this._methodNameTable,"Block")||Cn.call(this._methodNameTable,"Line"),this.Context=h(this),this._visiting=!1,this._changeReported=!1};function l(d){var y=Object.create(null);for(var f in d)/^visit[A-Z]/.test(f)&&(y[f.slice(5)]=!0);for(var v=n.computeSupertypeLookupTable(y),w=Object.create(null),I=Object.keys(v),x=I.length,P=0;P<x;++P){var C=I[P];f="visit"+v[C],i.check(d[f])&&(w[C]=f)}return w}o.fromMethodsObject=function(y){if(y instanceof o)return y;if(!r.check(y))return new o;let f=function w(){if(!(this instanceof w))throw new Error("Visitor constructor cannot be invoked without 'new'");o.call(this)};var v=f.prototype=Object.create(p);return v.constructor=f,c(v,y),c(f,o),i.assert(f.fromMethodsObject),i.assert(f.visit),new f};function c(d,y){for(var f in y)Cn.call(y,f)&&(d[f]=y[f]);return d}o.visit=function(y,f){return o.fromMethodsObject(f).visit(y)};var p=o.prototype;p.visit=function(){if(this._visiting)throw new Error("Recursively calling visitor.visit(path) resets visitor state. Try this.visit(path) or this.traverse(path) instead.");this._visiting=!0,this._changeReported=!1,this._abortRequested=!1;for(var d=arguments.length,y=new Array(d),f=0;f<d;++f)y[f]=arguments[f];y[0]instanceof e||(y[0]=new e({root:y[0]}).get("root")),this.reset.apply(this,y);var v;try{var w=this.visitWithoutReset(y[0]);v=!0}finally{if(this._visiting=!1,!v&&this._abortRequested)return y[0].value}return w},p.AbortRequest=function(){},p.abort=function(){var d=this;d._abortRequested=!0;var y=new d.AbortRequest;throw y.cancel=function(){d._abortRequested=!1},y},p.reset=function(d){},p.visitWithoutReset=function(d){if(this instanceof this.Context)return this.visitor.visitWithoutReset(d);if(!(d instanceof e))throw new Error("");var y=d.value,f=y&&typeof y=="object"&&typeof y.type=="string"&&this._methodNameTable[y.type];if(f){var v=this.acquireContext(d);try{return v.invokeVisitorMethod(f)}finally{this.releaseContext(v)}}else return u(d,this)};function u(d,y){if(!(d instanceof e))throw new Error("");if(!(y instanceof o))throw new Error("");var f=d.value;if(t.check(f))d.each(y.visitWithoutReset,y);else if(r.check(f)){var v=n.getFieldNames(f);y._shouldVisitComments&&f.comments&&v.indexOf("comments")<0&&v.push("comments");for(var w=v.length,I=[],x=0;x<w;++x){var P=v[x];Cn.call(f,P)||(f[P]=n.getFieldValue(f,P)),I.push(d.get(P))}for(var x=0;x<w;++x)y.visitWithoutReset(I[x])}return d.value}p.acquireContext=function(d){return this._reusableContextStack.length===0?new this.Context(d):this._reusableContextStack.pop().reset(d)},p.releaseContext=function(d){if(!(d instanceof this.Context))throw new Error("");this._reusableContextStack.push(d),d.currentPath=null},p.reportChanged=function(){this._changeReported=!0},p.wasChangeReported=function(){return this._changeReported};function h(d){function y(v){if(!(this instanceof y))throw new Error("");if(!(this instanceof o))throw new Error("");if(!(v instanceof e))throw new Error("");Object.defineProperty(this,"visitor",{value:d,writable:!1,enumerable:!0,configurable:!1}),this.currentPath=v,this.needToCallTraverse=!0,Object.seal(this)}if(!(d instanceof o))throw new Error("");var f=y.prototype=Object.create(d);return f.constructor=y,c(f,m),y}var m=Object.create(null);return m.reset=function(y){if(!(this instanceof this.Context))throw new Error("");if(!(y instanceof e))throw new Error("");return this.currentPath=y,this.needToCallTraverse=!0,this},m.invokeVisitorMethod=function(y){if(!(this instanceof this.Context))throw new Error("");if(!(this.currentPath instanceof e))throw new Error("");var f=this.visitor[y].call(this,this.currentPath);if(f===!1?this.needToCallTraverse=!1:f!==a&&(this.currentPath=this.currentPath.replace(f)[0],this.needToCallTraverse&&this.traverse(this.currentPath)),this.needToCallTraverse!==!1)throw new Error("Must either call this.traverse or return false in "+y);var v=this.currentPath;return v&&v.value},m.traverse=function(y,f){if(!(this instanceof this.Context))throw new Error("");if(!(y instanceof e))throw new Error("");if(!(this.currentPath instanceof e))throw new Error("");return this.needToCallTraverse=!1,u(y,o.fromMethodsObject(f||this.visitor))},m.visit=function(y,f){if(!(this instanceof this.Context))throw new Error("");if(!(y instanceof e))throw new Error("");if(!(this.currentPath instanceof e))throw new Error("");return this.needToCallTraverse=!1,o.fromMethodsObject(f||this.visitor).visitWithoutReset(y)},m.reportChanged=function(){this.visitor.reportChanged()},m.abort=function(){this.needToCallTraverse=!1,this.visitor.abort()},o}z(()=>module);function Hl(s){var n=s.use(J),e=n.getFieldNames,t=n.getFieldValue,r=n.builtInTypes.array,i=n.builtInTypes.object,a=n.builtInTypes.Date,o=n.builtInTypes.RegExp,l=Object.prototype.hasOwnProperty;function c(d,y,f){return r.check(f)?f.length=0:f=null,u(d,y,f)}c.assert=function(d,y){var f=[];if(!c(d,y,f))if(f.length===0){if(d!==y)throw new Error("Nodes must be equal")}else throw new Error("Nodes differ in the following path: "+f.map(p).join(""))};function p(d){return/[_$a-z][_$a-z0-9]*/i.test(d)?"."+d:"["+JSON.stringify(d)+"]"}function u(d,y,f){return d===y?!0:r.check(d)?h(d,y,f):i.check(d)?m(d,y,f):a.check(d)?a.check(y)&&+d==+y:o.check(d)?o.check(y)&&d.source===y.source&&d.global===y.global&&d.multiline===y.multiline&&d.ignoreCase===y.ignoreCase:d==y}function h(d,y,f){r.assert(d);var v=d.length;if(!r.check(y)||y.length!==v)return f&&f.push("length"),!1;for(var w=0;w<v;++w){if(f&&f.push(w),w in d!=w in y||!u(d[w],y[w],f))return!1;if(f){var I=f.pop();if(I!==w)throw new Error(""+I)}}return!0}function m(d,y,f){if(i.assert(d),!i.check(y))return!1;if(d.type!==y.type)return f&&f.push("type"),!1;var v=e(d),w=v.length,I=e(y),x=I.length;if(w===x){for(var P=0;P<w;++P){var C=v[P],N=t(d,C),q=t(y,C);if(f&&f.push(C),!u(N,q,f))return!1;if(f){var oe=f.pop();if(oe!==C)throw new Error(""+oe)}}return!0}if(!f)return!1;var Ie=Object.create(null);for(P=0;P<w;++P)Ie[v[P]]=!0;for(P=0;P<x;++P){if(C=I[P],!l.call(Ie,C))return f.push(C),!1;delete Ie[C]}for(C in Ie){f.push(C);break}return!1}return c}z(()=>module);function Wl(s){let n=Gl(),e=n.use(J);s.forEach(n.use),e.finalize();let t=n.use(ql);return{Type:e.Type,builtInTypes:e.builtInTypes,namedTypes:e.namedTypes,builders:e.builders,defineMethod:e.defineMethod,getFieldNames:e.getFieldNames,getFieldValue:e.getFieldValue,eachField:e.eachField,someField:e.someField,getSupertypeNames:e.getSupertypeNames,getBuilderName:e.getBuilderName,astNodesAreEquivalent:n.use(Hl),finalize:e.finalize,Path:n.use(Bi),NodePath:n.use(Ri),PathVisitor:t,use:n.use,visit:t.visit}}function Gl(){let s=[],n=[];function e(r){var i=s.indexOf(r);return i===-1&&(i=s.length,s.push(r),n[i]=r(t)),n[i]}var t={use:e};return t}z(()=>module);function ji(){return{BinaryOperators:["==","!=","===","!==","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof"],AssignmentOperators:["=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&="],LogicalOperators:["||","&&"]}}z(()=>module);function Vi(s){let n=s.use(ji);return n.BinaryOperators.indexOf("**")<0&&n.BinaryOperators.push("**"),n.AssignmentOperators.indexOf("**=")<0&&n.AssignmentOperators.push("**="),n}z(()=>module);function zi(s){let n=s.use(Vi);return n.LogicalOperators.indexOf("??")<0&&n.LogicalOperators.push("??"),n}z(()=>module);function Kl(s){let n=s.use(zi);return n.LogicalOperators.forEach(e=>{let t=e+"=";n.AssignmentOperators.indexOf(t)<0&&n.AssignmentOperators.push(t)}),n}z(()=>module);function Jl(s){var n=s.use(J),e=n.Type,t=e.def,r=e.or,i=s.use(pe),a=i.defaults,o=i.geq;let{BinaryOperators:l,AssignmentOperators:c,LogicalOperators:p}=s.use(ji);t("Printable").field("loc",r(t("SourceLocation"),null),a.null,!0),t("Node").bases("Printable").field("type",String).field("comments",r([t("Comment")],null),a.null,!0),t("SourceLocation").field("start",t("Position")).field("end",t("Position")).field("source",r(String,null),a.null),t("Position").field("line",o(1)).field("column",o(0)),t("File").bases("Node").build("program","name").field("program",t("Program")).field("name",r(String,null),a.null),t("Program").bases("Node").build("body").field("body",[t("Statement")]),t("Function").bases("Node").field("id",r(t("Identifier"),null),a.null).field("params",[t("Pattern")]).field("body",t("BlockStatement")).field("generator",Boolean,a.false).field("async",Boolean,a.false),t("Statement").bases("Node"),t("EmptyStatement").bases("Statement").build(),t("BlockStatement").bases("Statement").build("body").field("body",[t("Statement")]),t("ExpressionStatement").bases("Statement").build("expression").field("expression",t("Expression")),t("IfStatement").bases("Statement").build("test","consequent","alternate").field("test",t("Expression")).field("consequent",t("Statement")).field("alternate",r(t("Statement"),null),a.null),t("LabeledStatement").bases("Statement").build("label","body").field("label",t("Identifier")).field("body",t("Statement")),t("BreakStatement").bases("Statement").build("label").field("label",r(t("Identifier"),null),a.null),t("ContinueStatement").bases("Statement").build("label").field("label",r(t("Identifier"),null),a.null),t("WithStatement").bases("Statement").build("object","body").field("object",t("Expression")).field("body",t("Statement")),t("SwitchStatement").bases("Statement").build("discriminant","cases","lexical").field("discriminant",t("Expression")).field("cases",[t("SwitchCase")]).field("lexical",Boolean,a.false),t("ReturnStatement").bases("Statement").build("argument").field("argument",r(t("Expression"),null)),t("ThrowStatement").bases("Statement").build("argument").field("argument",t("Expression")),t("TryStatement").bases("Statement").build("block","handler","finalizer").field("block",t("BlockStatement")).field("handler",r(t("CatchClause"),null),function(){return this.handlers&&this.handlers[0]||null}).field("handlers",[t("CatchClause")],function(){return this.handler?[this.handler]:[]},!0).field("guardedHandlers",[t("CatchClause")],a.emptyArray).field("finalizer",r(t("BlockStatement"),null),a.null),t("CatchClause").bases("Node").build("param","guard","body").field("param",t("Pattern")).field("guard",r(t("Expression"),null),a.null).field("body",t("BlockStatement")),t("WhileStatement").bases("Statement").build("test","body").field("test",t("Expression")).field("body",t("Statement")),t("DoWhileStatement").bases("Statement").build("body","test").field("body",t("Statement")).field("test",t("Expression")),t("ForStatement").bases("Statement").build("init","test","update","body").field("init",r(t("VariableDeclaration"),t("Expression"),null)).field("test",r(t("Expression"),null)).field("update",r(t("Expression"),null)).field("body",t("Statement")),t("ForInStatement").bases("Statement").build("left","right","body").field("left",r(t("VariableDeclaration"),t("Expression"))).field("right",t("Expression")).field("body",t("Statement")),t("DebuggerStatement").bases("Statement").build(),t("Declaration").bases("Statement"),t("FunctionDeclaration").bases("Function","Declaration").build("id","params","body").field("id",t("Identifier")),t("FunctionExpression").bases("Function","Expression").build("id","params","body"),t("VariableDeclaration").bases("Declaration").build("kind","declarations").field("kind",r("var","let","const")).field("declarations",[t("VariableDeclarator")]),t("VariableDeclarator").bases("Node").build("id","init").field("id",t("Pattern")).field("init",r(t("Expression"),null),a.null),t("Expression").bases("Node"),t("ThisExpression").bases("Expression").build(),t("ArrayExpression").bases("Expression").build("elements").field("elements",[r(t("Expression"),null)]),t("ObjectExpression").bases("Expression").build("properties").field("properties",[t("Property")]),t("Property").bases("Node").build("kind","key","value").field("kind",r("init","get","set")).field("key",r(t("Literal"),t("Identifier"))).field("value",t("Expression")),t("SequenceExpression").bases("Expression").build("expressions").field("expressions",[t("Expression")]);var u=r("-","+","!","~","typeof","void","delete");t("UnaryExpression").bases("Expression").build("operator","argument","prefix").field("operator",u).field("argument",t("Expression")).field("prefix",Boolean,a.true);let h=r(...l);t("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",h).field("left",t("Expression")).field("right",t("Expression"));let m=r(...c);t("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",m).field("left",r(t("Pattern"),t("MemberExpression"))).field("right",t("Expression"));var d=r("++","--");t("UpdateExpression").bases("Expression").build("operator","argument","prefix").field("operator",d).field("argument",t("Expression")).field("prefix",Boolean);var y=r(...p);t("LogicalExpression").bases("Expression").build("operator","left","right").field("operator",y).field("left",t("Expression")).field("right",t("Expression")),t("ConditionalExpression").bases("Expression").build("test","consequent","alternate").field("test",t("Expression")).field("consequent",t("Expression")).field("alternate",t("Expression")),t("NewExpression").bases("Expression").build("callee","arguments").field("callee",t("Expression")).field("arguments",[t("Expression")]),t("CallExpression").bases("Expression").build("callee","arguments").field("callee",t("Expression")).field("arguments",[t("Expression")]),t("MemberExpression").bases("Expression").build("object","property","computed").field("object",t("Expression")).field("property",r(t("Identifier"),t("Expression"))).field("computed",Boolean,function(){var f=this.property.type;return f==="Literal"||f==="MemberExpression"||f==="BinaryExpression"}),t("Pattern").bases("Node"),t("SwitchCase").bases("Node").build("test","consequent").field("test",r(t("Expression"),null)).field("consequent",[t("Statement")]),t("Identifier").bases("Expression","Pattern").build("name").field("name",String).field("optional",Boolean,a.false),t("Literal").bases("Expression").build("value").field("value",r(String,Boolean,null,Number,RegExp,BigInt)),t("Comment").bases("Printable").field("value",String).field("leading",Boolean,a.true).field("trailing",Boolean,a.false)}z(()=>module);function Xl(s){s.use(Jl);let n=s.use(J),e=n.Type.def,t=n.Type.or,r=s.use(pe).defaults;e("Function").field("generator",Boolean,r.false).field("expression",Boolean,r.false).field("defaults",[t(e("Expression"),null)],r.emptyArray).field("rest",t(e("Identifier"),null),r.null),e("RestElement").bases("Pattern").build("argument").field("argument",e("Pattern")).field("typeAnnotation",t(e("TypeAnnotation"),e("TSTypeAnnotation"),null),r.null),e("SpreadElementPattern").bases("Pattern").build("argument").field("argument",e("Pattern")),e("FunctionDeclaration").build("id","params","body","generator","expression").field("id",t(e("Identifier"),null)),e("FunctionExpression").build("id","params","body","generator","expression"),e("ArrowFunctionExpression").bases("Function","Expression").build("params","body","expression").field("id",null,r.null).field("body",t(e("BlockStatement"),e("Expression"))).field("generator",!1,r.false),e("ForOfStatement").bases("Statement").build("left","right","body").field("left",t(e("VariableDeclaration"),e("Pattern"))).field("right",e("Expression")).field("body",e("Statement")),e("YieldExpression").bases("Expression").build("argument","delegate").field("argument",t(e("Expression"),null)).field("delegate",Boolean,r.false),e("GeneratorExpression").bases("Expression").build("body","blocks","filter").field("body",e("Expression")).field("blocks",[e("ComprehensionBlock")]).field("filter",t(e("Expression"),null)),e("ComprehensionExpression").bases("Expression").build("body","blocks","filter").field("body",e("Expression")).field("blocks",[e("ComprehensionBlock")]).field("filter",t(e("Expression"),null)),e("ComprehensionBlock").bases("Node").build("left","right","each").field("left",e("Pattern")).field("right",e("Expression")).field("each",Boolean),e("Property").field("key",t(e("Literal"),e("Identifier"),e("Expression"))).field("value",t(e("Expression"),e("Pattern"))).field("method",Boolean,r.false).field("shorthand",Boolean,r.false).field("computed",Boolean,r.false),e("ObjectProperty").field("shorthand",Boolean,r.false),e("PropertyPattern").bases("Pattern").build("key","pattern").field("key",t(e("Literal"),e("Identifier"),e("Expression"))).field("pattern",e("Pattern")).field("computed",Boolean,r.false),e("ObjectPattern").bases("Pattern").build("properties").field("properties",[t(e("PropertyPattern"),e("Property"))]),e("ArrayPattern").bases("Pattern").build("elements").field("elements",[t(e("Pattern"),null)]),e("SpreadElement").bases("Node").build("argument").field("argument",e("Expression")),e("ArrayExpression").field("elements",[t(e("Expression"),e("SpreadElement"),e("RestElement"),null)]),e("NewExpression").field("arguments",[t(e("Expression"),e("SpreadElement"))]),e("CallExpression").field("arguments",[t(e("Expression"),e("SpreadElement"))]),e("AssignmentPattern").bases("Pattern").build("left","right").field("left",e("Pattern")).field("right",e("Expression")),e("MethodDefinition").bases("Declaration").build("kind","key","value","static").field("kind",t("constructor","method","get","set")).field("key",e("Expression")).field("value",e("Function")).field("computed",Boolean,r.false).field("static",Boolean,r.false);let i=t(e("MethodDefinition"),e("VariableDeclarator"),e("ClassPropertyDefinition"),e("ClassProperty"),e("StaticBlock"));e("ClassProperty").bases("Declaration").build("key").field("key",t(e("Literal"),e("Identifier"),e("Expression"))).field("computed",Boolean,r.false),e("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition",i),e("ClassBody").bases("Declaration").build("body").field("body",[i]),e("ClassDeclaration").bases("Declaration").build("id","body","superClass").field("id",t(e("Identifier"),null)).field("body",e("ClassBody")).field("superClass",t(e("Expression"),null),r.null),e("ClassExpression").bases("Expression").build("id","body","superClass").field("id",t(e("Identifier"),null),r.null).field("body",e("ClassBody")).field("superClass",t(e("Expression"),null),r.null),e("Super").bases("Expression").build(),e("Specifier").bases("Node"),e("ModuleSpecifier").bases("Specifier").field("local",t(e("Identifier"),null),r.null).field("id",t(e("Identifier"),null),r.null).field("name",t(e("Identifier"),null),r.null),e("ImportSpecifier").bases("ModuleSpecifier").build("imported","local").field("imported",e("Identifier")),e("ImportDefaultSpecifier").bases("ModuleSpecifier").build("local"),e("ImportNamespaceSpecifier").bases("ModuleSpecifier").build("local"),e("ImportDeclaration").bases("Declaration").build("specifiers","source","importKind").field("specifiers",[t(e("ImportSpecifier"),e("ImportNamespaceSpecifier"),e("ImportDefaultSpecifier"))],r.emptyArray).field("source",e("Literal")).field("importKind",t("value","type"),function(){return"value"}),e("ExportNamedDeclaration").bases("Declaration").build("declaration","specifiers","source").field("declaration",t(e("Declaration"),null)).field("specifiers",[e("ExportSpecifier")],r.emptyArray).field("source",t(e("Literal"),null),r.null),e("ExportSpecifier").bases("ModuleSpecifier").build("local","exported").field("exported",e("Identifier")),e("ExportDefaultDeclaration").bases("Declaration").build("declaration").field("declaration",t(e("Declaration"),e("Expression"))),e("ExportAllDeclaration").bases("Declaration").build("source").field("source",e("Literal")),e("TaggedTemplateExpression").bases("Expression").build("tag","quasi").field("tag",e("Expression")).field("quasi",e("TemplateLiteral")),e("TemplateLiteral").bases("Expression").build("quasis","expressions").field("quasis",[e("TemplateElement")]).field("expressions",[e("Expression")]),e("TemplateElement").bases("Node").build("value","tail").field("value",{cooked:String,raw:String}).field("tail",Boolean),e("MetaProperty").bases("Expression").build("meta","property").field("meta",e("Identifier")).field("property",e("Identifier"))}z(()=>module);function Ql(s){s.use(Vi),s.use(Xl)}z(()=>module);function Yl(s){s.use(Ql);let e=s.use(J).Type.def,t=s.use(pe).defaults;e("Function").field("async",Boolean,t.false),e("AwaitExpression").bases("Expression").build("argument").field("argument",e("Expression"))}z(()=>module);function Zl(s){s.use(Yl);let n=s.use(J),e=n.Type.def,t=n.Type.or,r=s.use(pe).defaults;e("ForOfStatement").field("await",Boolean,r.false),e("SpreadProperty").bases("Node").build("argument").field("argument",e("Expression")),e("ObjectExpression").field("properties",[t(e("Property"),e("SpreadProperty"),e("SpreadElement"))]),e("TemplateElement").field("value",{cooked:t(String,null),raw:String}),e("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument",e("Pattern")),e("ObjectPattern").field("properties",[t(e("PropertyPattern"),e("Property"),e("RestElement"),e("SpreadPropertyPattern"))])}z(()=>module);function ec(s){s.use(Zl);let n=s.use(J),e=n.Type.def,t=n.Type.or,r=s.use(pe).defaults;e("CatchClause").field("param",t(e("Pattern"),null),r.null)}z(()=>module);function tc(s){s.use(zi),s.use(ec);let n=s.use(J),e=n.Type.def,t=n.Type.or,i=s.use(pe).defaults;e("ImportExpression").bases("Expression").build("source").field("source",e("Expression")),e("ExportAllDeclaration").bases("Declaration").build("source","exported").field("source",e("Literal")).field("exported",t(e("Identifier"),null,void 0),i.null),e("ChainElement").bases("Node").field("optional",Boolean,i.false),e("CallExpression").bases("Expression","ChainElement"),e("MemberExpression").bases("Expression","ChainElement"),e("ChainExpression").bases("Expression").build("expression").field("expression",e("ChainElement")),e("OptionalCallExpression").bases("CallExpression").build("callee","arguments","optional").field("optional",Boolean,i.true),e("OptionalMemberExpression").bases("MemberExpression").build("object","property","computed","optional").field("optional",Boolean,i.true)}z(()=>module);function nc(s){s.use(Kl),s.use(tc)}z(()=>module);function rc(s){s.use(nc);let e=s.use(J).Type.def;e("StaticBlock").bases("Declaration").build("body").field("body",[e("Statement")])}z(()=>module);function Qt(s){s.use(rc);let n=s.use(J),e=n.Type,t=n.Type.def,r=e.or,a=s.use(pe).defaults;t("AwaitExpression").build("argument","all").field("argument",r(t("Expression"),null)).field("all",Boolean,a.false),t("Decorator").bases("Node").build("expression").field("expression",t("Expression")),t("Property").field("decorators",r([t("Decorator")],null),a.null),t("MethodDefinition").field("decorators",r([t("Decorator")],null),a.null),t("PrivateName").bases("Expression","Pattern").build("id").field("id",t("Identifier")),t("ClassPrivateProperty").bases("ClassProperty").build("key","value").field("key",t("PrivateName")).field("value",r(t("Expression"),null),a.null),t("ImportAttribute").bases("Node").build("key","value").field("key",r(t("Identifier"),t("Literal"))).field("value",t("Expression")),["ImportDeclaration","ExportAllDeclaration","ExportNamedDeclaration"].forEach(o=>{t(o).field("assertions",[t("ImportAttribute")],a.emptyArray)}),t("RecordExpression").bases("Expression").build("properties").field("properties",[r(t("ObjectProperty"),t("ObjectMethod"),t("SpreadElement"))]),t("TupleExpression").bases("Expression").build("elements").field("elements",[r(t("Expression"),t("SpreadElement"),null)]),t("ModuleExpression").bases("Node").build("body").field("body",t("Program"))}z(()=>module);function sc(s){s.use(Qt);let n=s.use(J),e=n.Type.def,t=n.Type.or,r=s.use(pe).defaults;e("JSXAttribute").bases("Node").build("name","value").field("name",t(e("JSXIdentifier"),e("JSXNamespacedName"))).field("value",t(e("Literal"),e("JSXExpressionContainer"),e("JSXElement"),e("JSXFragment"),null),r.null),e("JSXIdentifier").bases("Identifier").build("name").field("name",String),e("JSXNamespacedName").bases("Node").build("namespace","name").field("namespace",e("JSXIdentifier")).field("name",e("JSXIdentifier")),e("JSXMemberExpression").bases("MemberExpression").build("object","property").field("object",t(e("JSXIdentifier"),e("JSXMemberExpression"))).field("property",e("JSXIdentifier")).field("computed",Boolean,r.false);let i=t(e("JSXIdentifier"),e("JSXNamespacedName"),e("JSXMemberExpression"));e("JSXSpreadAttribute").bases("Node").build("argument").field("argument",e("Expression"));let a=[t(e("JSXAttribute"),e("JSXSpreadAttribute"))];e("JSXExpressionContainer").bases("Expression").build("expression").field("expression",t(e("Expression"),e("JSXEmptyExpression")));let o=[t(e("JSXText"),e("JSXExpressionContainer"),e("JSXSpreadChild"),e("JSXElement"),e("JSXFragment"),e("Literal"))];e("JSXElement").bases("Expression").build("openingElement","closingElement","children").field("openingElement",e("JSXOpeningElement")).field("closingElement",t(e("JSXClosingElement"),null),r.null).field("children",o,r.emptyArray).field("name",i,function(){return this.openingElement.name},!0).field("selfClosing",Boolean,function(){return this.openingElement.selfClosing},!0).field("attributes",a,function(){return this.openingElement.attributes},!0),e("JSXOpeningElement").bases("Node").build("name","attributes","selfClosing").field("name",i).field("attributes",a,r.emptyArray).field("selfClosing",Boolean,r.false),e("JSXClosingElement").bases("Node").build("name").field("name",i),e("JSXFragment").bases("Expression").build("openingFragment","closingFragment","children").field("openingFragment",e("JSXOpeningFragment")).field("closingFragment",e("JSXClosingFragment")).field("children",o,r.emptyArray),e("JSXOpeningFragment").bases("Node").build(),e("JSXClosingFragment").bases("Node").build(),e("JSXText").bases("Literal").build("value","raw").field("value",String).field("raw",String,function(){return this.value}),e("JSXEmptyExpression").bases("Node").build(),e("JSXSpreadChild").bases("Node").build("expression").field("expression",e("Expression"))}z(()=>module);function $i(s){var n=s.use(J),e=n.Type.def,t=n.Type.or,r=s.use(pe).defaults,i=t(e("TypeAnnotation"),e("TSTypeAnnotation"),null),a=t(e("TypeParameterDeclaration"),e("TSTypeParameterDeclaration"),null);e("Identifier").field("typeAnnotation",i,r.null),e("ObjectPattern").field("typeAnnotation",i,r.null),e("Function").field("returnType",i,r.null).field("typeParameters",a,r.null),e("ClassProperty").build("key","value","typeAnnotation","static").field("value",t(e("Expression"),null)).field("static",Boolean,r.false).field("typeAnnotation",i,r.null),["ClassDeclaration","ClassExpression"].forEach(o=>{e(o).field("typeParameters",a,r.null).field("superTypeParameters",t(e("TypeParameterInstantiation"),e("TSTypeParameterInstantiation"),null),r.null).field("implements",t([e("ClassImplements")],[e("TSExpressionWithTypeArguments")]),r.emptyArray)})}z(()=>module);function qi(s){s.use(Qt),s.use($i);let n=s.use(J),e=n.Type.def,t=n.Type.or,r=s.use(pe).defaults;e("Flow").bases("Node"),e("FlowType").bases("Flow"),e("AnyTypeAnnotation").bases("FlowType").build(),e("EmptyTypeAnnotation").bases("FlowType").build(),e("MixedTypeAnnotation").bases("FlowType").build(),e("VoidTypeAnnotation").bases("FlowType").build(),e("SymbolTypeAnnotation").bases("FlowType").build(),e("NumberTypeAnnotation").bases("FlowType").build(),e("BigIntTypeAnnotation").bases("FlowType").build(),e("NumberLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),e("NumericLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),e("BigIntLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",null).field("raw",String),e("StringTypeAnnotation").bases("FlowType").build(),e("StringLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",String).field("raw",String),e("BooleanTypeAnnotation").bases("FlowType").build(),e("BooleanLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Boolean).field("raw",String),e("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",e("FlowType")),e("NullableTypeAnnotation").bases("FlowType").build("typeAnnotation").field("typeAnnotation",e("FlowType")),e("NullLiteralTypeAnnotation").bases("FlowType").build(),e("NullTypeAnnotation").bases("FlowType").build(),e("ThisTypeAnnotation").bases("FlowType").build(),e("ExistsTypeAnnotation").bases("FlowType").build(),e("ExistentialTypeParam").bases("FlowType").build(),e("FunctionTypeAnnotation").bases("FlowType").build("params","returnType","rest","typeParameters").field("params",[e("FunctionTypeParam")]).field("returnType",e("FlowType")).field("rest",t(e("FunctionTypeParam"),null)).field("typeParameters",t(e("TypeParameterDeclaration"),null)),e("FunctionTypeParam").bases("Node").build("name","typeAnnotation","optional").field("name",t(e("Identifier"),null)).field("typeAnnotation",e("FlowType")).field("optional",Boolean),e("ArrayTypeAnnotation").bases("FlowType").build("elementType").field("elementType",e("FlowType")),e("ObjectTypeAnnotation").bases("FlowType").build("properties","indexers","callProperties").field("properties",[t(e("ObjectTypeProperty"),e("ObjectTypeSpreadProperty"))]).field("indexers",[e("ObjectTypeIndexer")],r.emptyArray).field("callProperties",[e("ObjectTypeCallProperty")],r.emptyArray).field("inexact",t(Boolean,void 0),r.undefined).field("exact",Boolean,r.false).field("internalSlots",[e("ObjectTypeInternalSlot")],r.emptyArray),e("Variance").bases("Node").build("kind").field("kind",t("plus","minus"));let i=t(e("Variance"),"plus","minus",null);e("ObjectTypeProperty").bases("Node").build("key","value","optional").field("key",t(e("Literal"),e("Identifier"))).field("value",e("FlowType")).field("optional",Boolean).field("variance",i,r.null),e("ObjectTypeIndexer").bases("Node").build("id","key","value").field("id",e("Identifier")).field("key",e("FlowType")).field("value",e("FlowType")).field("variance",i,r.null).field("static",Boolean,r.false),e("ObjectTypeCallProperty").bases("Node").build("value").field("value",e("FunctionTypeAnnotation")).field("static",Boolean,r.false),e("QualifiedTypeIdentifier").bases("Node").build("qualification","id").field("qualification",t(e("Identifier"),e("QualifiedTypeIdentifier"))).field("id",e("Identifier")),e("GenericTypeAnnotation").bases("FlowType").build("id","typeParameters").field("id",t(e("Identifier"),e("QualifiedTypeIdentifier"))).field("typeParameters",t(e("TypeParameterInstantiation"),null)),e("MemberTypeAnnotation").bases("FlowType").build("object","property").field("object",e("Identifier")).field("property",t(e("MemberTypeAnnotation"),e("GenericTypeAnnotation"))),e("IndexedAccessType").bases("FlowType").build("objectType","indexType").field("objectType",e("FlowType")).field("indexType",e("FlowType")),e("OptionalIndexedAccessType").bases("FlowType").build("objectType","indexType","optional").field("objectType",e("FlowType")).field("indexType",e("FlowType")).field("optional",Boolean),e("UnionTypeAnnotation").bases("FlowType").build("types").field("types",[e("FlowType")]),e("IntersectionTypeAnnotation").bases("FlowType").build("types").field("types",[e("FlowType")]),e("TypeofTypeAnnotation").bases("FlowType").build("argument").field("argument",e("FlowType")),e("ObjectTypeSpreadProperty").bases("Node").build("argument").field("argument",e("FlowType")),e("ObjectTypeInternalSlot").bases("Node").build("id","value","optional","static","method").field("id",e("Identifier")).field("value",e("FlowType")).field("optional",Boolean).field("static",Boolean).field("method",Boolean),e("TypeParameterDeclaration").bases("Node").build("params").field("params",[e("TypeParameter")]),e("TypeParameterInstantiation").bases("Node").build("params").field("params",[e("FlowType")]),e("TypeParameter").bases("FlowType").build("name","variance","bound","default").field("name",String).field("variance",i,r.null).field("bound",t(e("TypeAnnotation"),null),r.null).field("default",t(e("FlowType"),null),r.null),e("ClassProperty").field("variance",i,r.null),e("ClassImplements").bases("Node").build("id").field("id",e("Identifier")).field("superClass",t(e("Expression"),null),r.null).field("typeParameters",t(e("TypeParameterInstantiation"),null),r.null),e("InterfaceTypeAnnotation").bases("FlowType").build("body","extends").field("body",e("ObjectTypeAnnotation")).field("extends",t([e("InterfaceExtends")],null),r.null),e("InterfaceDeclaration").bases("Declaration").build("id","body","extends").field("id",e("Identifier")).field("typeParameters",t(e("TypeParameterDeclaration"),null),r.null).field("body",e("ObjectTypeAnnotation")).field("extends",[e("InterfaceExtends")]),e("DeclareInterface").bases("InterfaceDeclaration").build("id","body","extends"),e("InterfaceExtends").bases("Node").build("id").field("id",e("Identifier")).field("typeParameters",t(e("TypeParameterInstantiation"),null),r.null),e("TypeAlias").bases("Declaration").build("id","typeParameters","right").field("id",e("Identifier")).field("typeParameters",t(e("TypeParameterDeclaration"),null)).field("right",e("FlowType")),e("DeclareTypeAlias").bases("TypeAlias").build("id","typeParameters","right"),e("OpaqueType").bases("Declaration").build("id","typeParameters","impltype","supertype").field("id",e("Identifier")).field("typeParameters",t(e("TypeParameterDeclaration"),null)).field("impltype",e("FlowType")).field("supertype",t(e("FlowType"),null)),e("DeclareOpaqueType").bases("OpaqueType").build("id","typeParameters","supertype").field("impltype",t(e("FlowType"),null)),e("TypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",e("Expression")).field("typeAnnotation",e("TypeAnnotation")),e("TupleTypeAnnotation").bases("FlowType").build("types").field("types",[e("FlowType")]),e("DeclareVariable").bases("Statement").build("id").field("id",e("Identifier")),e("DeclareFunction").bases("Statement").build("id").field("id",e("Identifier")).field("predicate",t(e("FlowPredicate"),null),r.null),e("DeclareClass").bases("InterfaceDeclaration").build("id"),e("DeclareModule").bases("Statement").build("id","body").field("id",t(e("Identifier"),e("Literal"))).field("body",e("BlockStatement")),e("DeclareModuleExports").bases("Statement").build("typeAnnotation").field("typeAnnotation",e("TypeAnnotation")),e("DeclareExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",t(e("DeclareVariable"),e("DeclareFunction"),e("DeclareClass"),e("FlowType"),e("TypeAlias"),e("DeclareOpaqueType"),e("InterfaceDeclaration"),null)).field("specifiers",[t(e("ExportSpecifier"),e("ExportBatchSpecifier"))],r.emptyArray).field("source",t(e("Literal"),null),r.null),e("DeclareExportAllDeclaration").bases("Declaration").build("source").field("source",t(e("Literal"),null),r.null),e("ImportDeclaration").field("importKind",t("value","type","typeof"),()=>"value"),e("FlowPredicate").bases("Flow"),e("InferredPredicate").bases("FlowPredicate").build(),e("DeclaredPredicate").bases("FlowPredicate").build("value").field("value",e("Expression")),e("Function").field("predicate",t(e("FlowPredicate"),null),r.null),e("CallExpression").field("typeArguments",t(null,e("TypeParameterInstantiation")),r.null),e("NewExpression").field("typeArguments",t(null,e("TypeParameterInstantiation")),r.null),e("EnumDeclaration").bases("Declaration").build("id","body").field("id",e("Identifier")).field("body",t(e("EnumBooleanBody"),e("EnumNumberBody"),e("EnumStringBody"),e("EnumSymbolBody"))),e("EnumBooleanBody").build("members","explicitType").field("members",[e("EnumBooleanMember")]).field("explicitType",Boolean),e("EnumNumberBody").build("members","explicitType").field("members",[e("EnumNumberMember")]).field("explicitType",Boolean),e("EnumStringBody").build("members","explicitType").field("members",t([e("EnumStringMember")],[e("EnumDefaultedMember")])).field("explicitType",Boolean),e("EnumSymbolBody").build("members").field("members",[e("EnumDefaultedMember")]),e("EnumBooleanMember").build("id","init").field("id",e("Identifier")).field("init",t(e("Literal"),Boolean)),e("EnumNumberMember").build("id","init").field("id",e("Identifier")).field("init",e("Literal")),e("EnumStringMember").build("id","init").field("id",e("Identifier")).field("init",e("Literal")),e("EnumDefaultedMember").build("id").field("id",e("Identifier"))}z(()=>module);function ic(s){s.use(Qt);var n=s.use(J),e=s.use(pe).defaults,t=n.Type.def,r=n.Type.or;t("VariableDeclaration").field("declarations",[r(t("VariableDeclarator"),t("Identifier"))]),t("Property").field("value",r(t("Expression"),t("Pattern"))),t("ArrayPattern").field("elements",[r(t("Pattern"),t("SpreadElement"),null)]),t("ObjectPattern").field("properties",[r(t("Property"),t("PropertyPattern"),t("SpreadPropertyPattern"),t("SpreadProperty"))]),t("ExportSpecifier").bases("ModuleSpecifier").build("id","name"),t("ExportBatchSpecifier").bases("Specifier").build(),t("ExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",r(t("Declaration"),t("Expression"),null)).field("specifiers",[r(t("ExportSpecifier"),t("ExportBatchSpecifier"))],e.emptyArray).field("source",r(t("Literal"),null),e.null),t("Block").bases("Comment").build("value","leading","trailing"),t("Line").bases("Comment").build("value","leading","trailing")}z(()=>module);function Hi(s){s.use(Qt);let n=s.use(J),e=s.use(pe).defaults,t=n.Type.def,r=n.Type.or,{undefined:i}=n.builtInTypes;t("Noop").bases("Statement").build(),t("DoExpression").bases("Expression").build("body").field("body",[t("Statement")]),t("BindExpression").bases("Expression").build("object","callee").field("object",r(t("Expression"),null)).field("callee",t("Expression")),t("ParenthesizedExpression").bases("Expression").build("expression").field("expression",t("Expression")),t("ExportNamespaceSpecifier").bases("Specifier").build("exported").field("exported",t("Identifier")),t("ExportDefaultSpecifier").bases("Specifier").build("exported").field("exported",t("Identifier")),t("CommentBlock").bases("Comment").build("value","leading","trailing"),t("CommentLine").bases("Comment").build("value","leading","trailing"),t("Directive").bases("Node").build("value").field("value",t("DirectiveLiteral")),t("DirectiveLiteral").bases("Node","Expression").build("value").field("value",String,e["use strict"]),t("InterpreterDirective").bases("Node").build("value").field("value",String),t("BlockStatement").bases("Statement").build("body").field("body",[t("Statement")]).field("directives",[t("Directive")],e.emptyArray),t("Program").bases("Node").build("body").field("body",[t("Statement")]).field("directives",[t("Directive")],e.emptyArray).field("interpreter",r(t("InterpreterDirective"),null),e.null);function a(p=String,u){return["extra",{rawValue:p,raw:String},function(){let m=n.getFieldValue(this,"value");return{rawValue:m,raw:u?u(m):String(m)}}]}t("StringLiteral").bases("Literal").build("value").field("value",String).field(...a(String,p=>JSON.stringify(p))),t("NumericLiteral").bases("Literal").build("value").field("value",Number).field("raw",r(String,null),e.null).field(...a(Number)),t("BigIntLiteral").bases("Literal").build("value").field("value",r(String,Number)).field(...a(String,p=>p+"n")),t("DecimalLiteral").bases("Literal").build("value").field("value",String).field(...a(String,p=>p+"m")),t("NullLiteral").bases("Literal").build().field("value",null,e.null),t("BooleanLiteral").bases("Literal").build("value").field("value",Boolean),t("RegExpLiteral").bases("Literal").build("pattern","flags").field("pattern",String).field("flags",String).field("value",RegExp,function(){return new RegExp(this.pattern,this.flags)}).field(...a(r(RegExp,i),p=>`/${p.pattern}/${p.flags||""}`)).field("regex",{pattern:String,flags:String},function(){return{pattern:this.pattern,flags:this.flags}});var o=r(t("Property"),t("ObjectMethod"),t("ObjectProperty"),t("SpreadProperty"),t("SpreadElement"));t("ObjectExpression").bases("Expression").build("properties").field("properties",[o]),t("ObjectMethod").bases("Node","Function").build("kind","key","params","body","computed").field("kind",r("method","get","set")).field("key",r(t("Literal"),t("Identifier"),t("Expression"))).field("params",[t("Pattern")]).field("body",t("BlockStatement")).field("computed",Boolean,e.false).field("generator",Boolean,e.false).field("async",Boolean,e.false).field("accessibility",r(t("Literal"),null),e.null).field("decorators",r([t("Decorator")],null),e.null),t("ObjectProperty").bases("Node").build("key","value").field("key",r(t("Literal"),t("Identifier"),t("Expression"))).field("value",r(t("Expression"),t("Pattern"))).field("accessibility",r(t("Literal"),null),e.null).field("computed",Boolean,e.false);var l=r(t("MethodDefinition"),t("VariableDeclarator"),t("ClassPropertyDefinition"),t("ClassProperty"),t("ClassPrivateProperty"),t("ClassMethod"),t("ClassPrivateMethod"),t("ClassAccessorProperty"),t("StaticBlock"));t("ClassBody").bases("Declaration").build("body").field("body",[l]),t("ClassMethod").bases("Declaration","Function").build("kind","key","params","body","computed","static").field("key",r(t("Literal"),t("Identifier"),t("Expression"))),t("ClassPrivateMethod").bases("Declaration","Function").build("key","params","body","kind","computed","static").field("key",t("PrivateName")),t("ClassAccessorProperty").bases("Declaration").build("key","value","decorators","computed","static").field("key",r(t("Literal"),t("Identifier"),t("PrivateName"),t("Expression"))).field("value",r(t("Expression"),null),e.null),["ClassMethod","ClassPrivateMethod"].forEach(p=>{t(p).field("kind",r("get","set","method","constructor"),()=>"method").field("body",t("BlockStatement")).field("access",r("public","private","protected",null),e.null)}),["ClassMethod","ClassPrivateMethod","ClassAccessorProperty"].forEach(p=>{t(p).field("computed",Boolean,e.false).field("static",Boolean,e.false).field("abstract",Boolean,e.false).field("accessibility",r("public","private","protected",null),e.null).field("decorators",r([t("Decorator")],null),e.null).field("definite",Boolean,e.false).field("optional",Boolean,e.false).field("override",Boolean,e.false).field("readonly",Boolean,e.false)});var c=r(t("Property"),t("PropertyPattern"),t("SpreadPropertyPattern"),t("SpreadProperty"),t("ObjectProperty"),t("RestProperty"),t("RestElement"));t("ObjectPattern").bases("Pattern").build("properties").field("properties",[c]).field("decorators",r([t("Decorator")],null),e.null),t("SpreadProperty").bases("Node").build("argument").field("argument",t("Expression")),t("RestProperty").bases("Node").build("argument").field("argument",t("Expression")),t("ForAwaitStatement").bases("Statement").build("left","right","body").field("left",r(t("VariableDeclaration"),t("Expression"))).field("right",t("Expression")).field("body",t("Statement")),t("Import").bases("Expression").build()}z(()=>module);function ac(s){let e=s.use(J).Type.def;s.use(Hi),s.use(qi),e("V8IntrinsicIdentifier").bases("Expression").build("name").field("name",String),e("TopicReference").bases("Expression").build()}z(()=>module);function oc(s){s.use(Hi),s.use($i);var n=s.use(J),e=n.namedTypes,t=n.Type.def,r=n.Type.or,i=s.use(pe).defaults,a=n.Type.from(function(p,u){return!!(e.StringLiteral&&e.StringLiteral.check(p,u)||e.Literal&&e.Literal.check(p,u)&&typeof p.value=="string")},"StringLiteral");t("TSType").bases("Node");var o=r(t("Identifier"),t("TSQualifiedName"));t("TSTypeReference").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("typeName","typeParameters").field("typeName",o),t("TSHasOptionalTypeParameterInstantiation").field("typeParameters",r(t("TSTypeParameterInstantiation"),null),i.null),t("TSHasOptionalTypeParameters").field("typeParameters",r(t("TSTypeParameterDeclaration"),null,void 0),i.null),t("TSHasOptionalTypeAnnotation").field("typeAnnotation",r(t("TSTypeAnnotation"),null),i.null),t("TSQualifiedName").bases("Node").build("left","right").field("left",o).field("right",o),t("TSAsExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",t("Expression")).field("typeAnnotation",t("TSType")).field("extra",r({parenthesized:Boolean},null),i.null),t("TSTypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",t("Expression")).field("typeAnnotation",t("TSType")),t("TSSatisfiesExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",t("Expression")).field("typeAnnotation",t("TSType")),t("TSNonNullExpression").bases("Expression","Pattern").build("expression").field("expression",t("Expression")),["TSAnyKeyword","TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSObjectKeyword","TSStringKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSUnknownKeyword","TSVoidKeyword","TSIntrinsicKeyword","TSThisType"].forEach(p=>{t(p).bases("TSType").build()}),t("TSArrayType").bases("TSType").build("elementType").field("elementType",t("TSType")),t("TSLiteralType").bases("TSType").build("literal").field("literal",r(t("NumericLiteral"),t("StringLiteral"),t("BooleanLiteral"),t("TemplateLiteral"),t("UnaryExpression"),t("BigIntLiteral"))),t("TemplateLiteral").field("expressions",r([t("Expression")],[t("TSType")])),["TSUnionType","TSIntersectionType"].forEach(p=>{t(p).bases("TSType").build("types").field("types",[t("TSType")])}),t("TSConditionalType").bases("TSType").build("checkType","extendsType","trueType","falseType").field("checkType",t("TSType")).field("extendsType",t("TSType")).field("trueType",t("TSType")).field("falseType",t("TSType")),t("TSInferType").bases("TSType").build("typeParameter").field("typeParameter",t("TSTypeParameter")),t("TSParenthesizedType").bases("TSType").build("typeAnnotation").field("typeAnnotation",t("TSType"));var l=[r(t("Identifier"),t("RestElement"),t("ArrayPattern"),t("ObjectPattern"))];["TSFunctionType","TSConstructorType"].forEach(p=>{t(p).bases("TSType","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters").field("parameters",l)}),t("TSDeclareFunction").bases("Declaration","TSHasOptionalTypeParameters").build("id","params","returnType").field("declare",Boolean,i.false).field("async",Boolean,i.false).field("generator",Boolean,i.false).field("id",r(t("Identifier"),null),i.null).field("params",[t("Pattern")]).field("returnType",r(t("TSTypeAnnotation"),t("Noop"),null),i.null),t("TSDeclareMethod").bases("Declaration","TSHasOptionalTypeParameters").build("key","params","returnType").field("async",Boolean,i.false).field("generator",Boolean,i.false).field("params",[t("Pattern")]).field("abstract",Boolean,i.false).field("accessibility",r("public","private","protected",void 0),i.undefined).field("static",Boolean,i.false).field("computed",Boolean,i.false).field("optional",Boolean,i.false).field("key",r(t("Identifier"),t("StringLiteral"),t("NumericLiteral"),t("Expression"))).field("kind",r("get","set","method","constructor"),function(){return"method"}).field("access",r("public","private","protected",void 0),i.undefined).field("decorators",r([t("Decorator")],null),i.null).field("returnType",r(t("TSTypeAnnotation"),t("Noop"),null),i.null),t("TSMappedType").bases("TSType").build("typeParameter","typeAnnotation").field("readonly",r(Boolean,"+","-"),i.false).field("typeParameter",t("TSTypeParameter")).field("optional",r(Boolean,"+","-"),i.false).field("typeAnnotation",r(t("TSType"),null),i.null),t("TSTupleType").bases("TSType").build("elementTypes").field("elementTypes",[r(t("TSType"),t("TSNamedTupleMember"))]),t("TSNamedTupleMember").bases("TSType").build("label","elementType","optional").field("label",t("Identifier")).field("optional",Boolean,i.false).field("elementType",t("TSType")),t("TSRestType").bases("TSType").build("typeAnnotation").field("typeAnnotation",t("TSType")),t("TSOptionalType").bases("TSType").build("typeAnnotation").field("typeAnnotation",t("TSType")),t("TSIndexedAccessType").bases("TSType").build("objectType","indexType").field("objectType",t("TSType")).field("indexType",t("TSType")),t("TSTypeOperator").bases("TSType").build("operator").field("operator",String).field("typeAnnotation",t("TSType")),t("TSTypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",r(t("TSType"),t("TSTypeAnnotation"))),t("TSIndexSignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",[t("Identifier")]).field("readonly",Boolean,i.false),t("TSPropertySignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("key","typeAnnotation","optional").field("key",t("Expression")).field("computed",Boolean,i.false).field("readonly",Boolean,i.false).field("optional",Boolean,i.false).field("initializer",r(t("Expression"),null),i.null),t("TSMethodSignature").bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("key","parameters","typeAnnotation").field("key",t("Expression")).field("computed",Boolean,i.false).field("optional",Boolean,i.false).field("parameters",l),t("TSTypePredicate").bases("TSTypeAnnotation","TSType").build("parameterName","typeAnnotation","asserts").field("parameterName",r(t("Identifier"),t("TSThisType"))).field("typeAnnotation",r(t("TSTypeAnnotation"),null),i.null).field("asserts",Boolean,i.false),["TSCallSignatureDeclaration","TSConstructSignatureDeclaration"].forEach(p=>{t(p).bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",l)}),t("TSEnumMember").bases("Node").build("id","initializer").field("id",r(t("Identifier"),a)).field("initializer",r(t("Expression"),null),i.null),t("TSTypeQuery").bases("TSType").build("exprName").field("exprName",r(o,t("TSImportType")));var c=r(t("TSCallSignatureDeclaration"),t("TSConstructSignatureDeclaration"),t("TSIndexSignature"),t("TSMethodSignature"),t("TSPropertySignature"));t("TSTypeLiteral").bases("TSType").build("members").field("members",[c]),t("TSTypeParameter").bases("Identifier").build("name","constraint","default").field("name",r(t("Identifier"),String)).field("constraint",r(t("TSType"),void 0),i.undefined).field("default",r(t("TSType"),void 0),i.undefined),t("TSTypeAssertion").bases("Expression","Pattern").build("typeAnnotation","expression").field("typeAnnotation",t("TSType")).field("expression",t("Expression")).field("extra",r({parenthesized:Boolean},null),i.null),t("TSTypeParameterDeclaration").bases("Declaration").build("params").field("params",[t("TSTypeParameter")]),t("TSInstantiationExpression").bases("Expression","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",t("Expression")),t("TSTypeParameterInstantiation").bases("Node").build("params").field("params",[t("TSType")]),t("TSEnumDeclaration").bases("Declaration").build("id","members").field("id",t("Identifier")).field("const",Boolean,i.false).field("declare",Boolean,i.false).field("members",[t("TSEnumMember")]).field("initializer",r(t("Expression"),null),i.null),t("TSTypeAliasDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","typeAnnotation").field("id",t("Identifier")).field("declare",Boolean,i.false).field("typeAnnotation",t("TSType")),t("TSModuleBlock").bases("Node").build("body").field("body",[t("Statement")]),t("TSModuleDeclaration").bases("Declaration").build("id","body").field("id",r(a,o)).field("declare",Boolean,i.false).field("global",Boolean,i.false).field("body",r(t("TSModuleBlock"),t("TSModuleDeclaration"),null),i.null),t("TSImportType").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("argument","qualifier","typeParameters").field("argument",a).field("qualifier",r(o,void 0),i.undefined),t("TSImportEqualsDeclaration").bases("Declaration").build("id","moduleReference").field("id",t("Identifier")).field("isExport",Boolean,i.false).field("moduleReference",r(o,t("TSExternalModuleReference"))),t("TSExternalModuleReference").bases("Declaration").build("expression").field("expression",a),t("TSExportAssignment").bases("Statement").build("expression").field("expression",t("Expression")),t("TSNamespaceExportDeclaration").bases("Declaration").build("id").field("id",t("Identifier")),t("TSInterfaceBody").bases("Node").build("body").field("body",[c]),t("TSExpressionWithTypeArguments").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",o),t("TSInterfaceDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","body").field("id",o).field("declare",Boolean,i.false).field("extends",r([t("TSExpressionWithTypeArguments")],null),i.null).field("body",t("TSInterfaceBody")),t("TSParameterProperty").bases("Pattern").build("parameter").field("accessibility",r("public","private","protected",void 0),i.undefined).field("readonly",Boolean,i.false).field("parameter",r(t("Identifier"),t("AssignmentPattern"))),t("ClassProperty").field("access",r("public","private","protected",void 0),i.undefined),t("ClassAccessorProperty").bases("Declaration","TSHasOptionalTypeAnnotation"),t("ClassBody").field("body",[r(t("MethodDefinition"),t("VariableDeclarator"),t("ClassPropertyDefinition"),t("ClassProperty"),t("ClassPrivateProperty"),t("ClassAccessorProperty"),t("ClassMethod"),t("ClassPrivateMethod"),t("StaticBlock"),t("TSDeclareMethod"),c)])}z(()=>module);var we;we||(we={});var{astNodesAreEquivalent:Mu,builders:Yt,builtInTypes:Ce,defineMethod:Du,eachField:Lu,finalize:Ou,getBuilderName:Fu,getFieldNames:lc,getFieldValue:Re,getSupertypeNames:_u,namedTypes:cc,NodePath:pc,Path:Uu,PathVisitor:Bu,someField:uc,Type:Ru,use:ju,visit:Vu}=Wl([Qt,sc,qi,ic,ac,oc]);Object.assign(we,cc);var Sn=we,Ti=Bn.default.SourceMapConsumer,dc=Bn.default.SourceMapGenerator,Wi=Object.prototype.hasOwnProperty;function hc(){return`
|
|
8846
|
-
`}function wi(s,n,e){return s&&Wi.call(s,n)?s[n]:e}function fc(...s){let n={},e=s.length;for(let t=0;t<e;++t){let r=Object.keys(s[t]),i=r.length;for(let a=0;a<i;++a)n[r[a]]=!0}return n}function j(s,n){return s.line-n.line||s.column-n.column}function We(s){return{line:s.line,column:s.column}}function mc(s,n){if(s){if(!n)return s}else return n||null;let e=new Ti(s),t=new Ti(n),r=new dc({file:n.file,sourceRoot:n.sourceRoot}),i={};return t.eachMapping(function(a){let o=e.originalPositionFor({line:a.originalLine,column:a.originalColumn}),l=o.source;if(l===null)return;r.addMapping({source:l,original:We(o),generated:{line:a.generatedLine,column:a.generatedColumn},name:a.name});let c=e.sourceContentFor(l);c&&!Wi.call(i,l)&&(i[l]=c,r.setSourceContent(l,c))}),r.toJSON()}function Gi(s,n){if(!s.loc)return null;let e={start:s.loc.start,end:s.loc.end};function t(r){Jr(e,r.loc)}return s.declaration&&s.declaration.decorators&&Rn(s)&&s.declaration.decorators.forEach(t),j(e.start,e.end)<0&&(e.start=We(e.start),n.skipSpaces(e.start,!1,!0),j(e.start,e.end)<0&&(e.end=We(e.end),n.skipSpaces(e.end,!0,!0))),s.comments&&s.comments.forEach(t),e}function Jr(s,n){s&&n&&(j(n.start,s.start)<0&&(s.start=n.start),j(s.end,n.end)<0&&(s.end=n.end))}function is(s,n){let e=s.loc;if(e&&(e.start.line<1&&(e.start.line=1),e.end.line<1&&(e.end.line=1)),s.type==="File"&&(e.start=n.firstPos(),e.end=n.lastPos()),bc(s,n),
|
|
9086
|
+
`}],utils:[],composables:[],plugins:[]}];import{join as vp}from"path";import{loadConfig as xp}from"c12";import Se from"fs-extra";import Pa from"kleur";import Pp from"lodash";import{promises as Kr}from"node:fs";var Bn=sn(lr(),1),Ui=sn(qr(),1);function pe(s){var n=s.use(J),e=n.Type,t=n.builtInTypes,r=t.number;function i(c){return e.from(p=>r.check(p)&&p>=c,r+" >= "+c)}let a={null:function(){return null},emptyArray:function(){return[]},false:function(){return!1},true:function(){return!0},undefined:function(){},"use strict":function(){return"use strict"}};var o=e.or(t.string,t.number,t.boolean,t.null,t.undefined);let l=e.from(c=>{if(c===null)return!0;var p=typeof c;return!(p==="object"||p==="function")},o.toString());return{geq:i,defaults:a,isPrimitive:l}}function z(s){try{var n=s(),e=n.exports,t=e.default}catch{return}t&&t!==e&&typeof e=="object"&&(Object.assign(t,e,{default:t}),e.__esModule&&Object.defineProperty(t,"__esModule",{value:!0}),n.exports=t)}var jl=Object.defineProperty,Vl=(s,n,e)=>n in s?jl(s,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[n]=e,ie=(s,n,e)=>(Vl(s,typeof n!="symbol"?n+"":n,e),e),_i=Object.prototype,Mn=_i.toString,be=_i.hasOwnProperty,tt=class{assert(n,e){if(!this.check(n,e)){var t=ss(n);throw new Error(t+" does not match type "+this)}return!0}arrayOf(){let n=this;return new Gt(n)}},Gt=class extends tt{constructor(n){super(),this.elemType=n,ie(this,"kind","ArrayType")}toString(){return"["+this.elemType+"]"}check(n,e){return Array.isArray(n)&&n.every(t=>this.elemType.check(t,e))}},Dn=class extends tt{constructor(n){super(),this.value=n,ie(this,"kind","IdentityType")}toString(){return String(this.value)}check(n,e){let t=n===this.value;return!t&&typeof e=="function"&&e(this,n),t}},Ln=class extends tt{constructor(n){super(),this.fields=n,ie(this,"kind","ObjectType")}toString(){return"{ "+this.fields.join(", ")+" }"}check(n,e){return Mn.call(n)===Mn.call({})&&this.fields.every(t=>t.type.check(n[t.name],e))}},On=class extends tt{constructor(n){super(),this.types=n,ie(this,"kind","OrType")}toString(){return this.types.join(" | ")}check(n,e){return this.types.some(t=>t.check(n,!!e))?!0:(typeof e=="function"&&e(this,n),!1)}},et=class extends tt{constructor(n,e){super(),this.name=n,this.predicate=e,ie(this,"kind","PredicateType")}toString(){return this.name}check(n,e){let t=this.predicate(n,e);return!t&&typeof e=="function"&&e(this,n),t}},Ht=class s{constructor(n,e){this.type=n,this.typeName=e,ie(this,"baseNames",[]),ie(this,"ownFields",Object.create(null)),ie(this,"allSupertypes",Object.create(null)),ie(this,"supertypeList",[]),ie(this,"allFields",Object.create(null)),ie(this,"fieldNames",[]),ie(this,"finalized",!1),ie(this,"buildable",!1),ie(this,"buildParams",[])}isSupertypeOf(n){if(n instanceof s){if(this.finalized!==!0||n.finalized!==!0)throw new Error("");return be.call(n.allSupertypes,this.typeName)}else throw new Error(n+" is not a Def")}checkAllFields(n,e){var t=this.allFields;if(this.finalized!==!0)throw new Error(""+this.typeName);function r(i){var a=t[i],o=a.type,l=a.getValue(n);return o.check(l,e)}return n!==null&&typeof n=="object"&&Object.keys(t).every(r)}bases(...n){var e=this.baseNames;if(this.finalized){if(n.length!==e.length)throw new Error("");for(var t=0;t<n.length;t++)if(n[t]!==e[t])throw new Error("");return this}return n.forEach(r=>{e.indexOf(r)<0&&e.push(r)}),this}},Fn=class{constructor(n,e,t,r){this.name=n,this.type=e,this.defaultFn=t,ie(this,"hidden"),this.hidden=!!r}toString(){return JSON.stringify(this.name)+": "+this.type}getValue(n){var e=n[this.name];return typeof e<"u"||typeof this.defaultFn=="function"&&(e=this.defaultFn.call(n)),e}};function ss(s){return Array.isArray(s)?"["+s.map(ss).join(", ")+"]":s&&typeof s=="object"?"{ "+Object.keys(s).map(function(n){return n+": "+s[n]}).join(", ")+" }":JSON.stringify(s)}function J(s){let n={or(...S){return new On(S.map(I=>n.from(I)))},from(S,I){if(S instanceof Gt||S instanceof Dn||S instanceof Ln||S instanceof On||S instanceof et)return S;if(S instanceof Ht)return S.type;if(o.check(S)){if(S.length!==1)throw new Error("only one element type is permitted for typed arrays");return new Gt(n.from(S[0]))}if(l.check(S))return new Ln(Object.keys(S).map(F=>new Fn(F,n.from(S[F],F))));if(typeof S=="function"){var O=e.indexOf(S);if(O>=0)return t[O];if(typeof I!="string")throw new Error("missing name");return new et(I,S)}return new Dn(S)},def(S){return be.call(v,S)?v[S]:v[S]=new E(S)},hasDef(S){return be.call(v,S)}};var e=[],t=[];function r(S,I){let O=Mn.call(I),F=new et(S,$=>Mn.call($)===O);return I&&typeof I.constructor=="function"&&(e.push(I.constructor),t.push(F)),F}let i=r("string","truthy"),a=r("function",function(){}),o=r("array",[]),l=r("object",{}),c=r("RegExp",/./),p=r("Date",new Date),u=r("number",3),h=r("boolean",!0),m=r("null",null),d=r("undefined",void 0),g=typeof BigInt=="function"?r("BigInt",BigInt(1234)):new et("BigInt",()=>!1),f={string:i,function:a,array:o,object:l,RegExp:c,Date:p,number:u,boolean:h,null:m,undefined:d,BigInt:g};var v=Object.create(null);function w(S){if(S&&typeof S=="object"){var I=S.type;if(typeof I=="string"&&be.call(v,I)){var O=v[I];if(O.finalized)return O}}return null}class E extends Ht{constructor(I){super(new et(I,(O,F)=>this.check(O,F)),I)}check(I,O){if(this.finalized!==!0)throw new Error("prematurely checking unfinalized type "+this.typeName);if(I===null||typeof I!="object")return!1;var F=w(I);return F?O&&F===this?this.checkAllFields(I,O):this.isSupertypeOf(F)?O?F.checkAllFields(I,O)&&this.checkAllFields(I,!1):!0:!1:this.typeName==="SourceLocation"||this.typeName==="Position"?this.checkAllFields(I,O):!1}build(...I){if(this.buildParams=I,this.buildable)return this;this.field("type",String,()=>this.typeName),this.buildable=!0;let O=($,H,K,de)=>{if(!be.call($,H)){var Me=this.allFields;if(!be.call(Me,H))throw new Error(""+H);var rn=Me[H],qa=rn.type,Ct;if(de)Ct=K;else if(rn.defaultFn)Ct=rn.defaultFn.call($);else{var Ha="no value or default function given for field "+JSON.stringify(H)+" of "+this.typeName+"("+this.buildParams.map(function(Wa){return Me[Wa]}).join(", ")+")";throw new Error(Ha)}if(!qa.check(Ct))throw new Error(ss(Ct)+" does not match field "+rn+" of type "+this.typeName);$[H]=Ct}},F=(...$)=>{var H=$.length;if(!this.finalized)throw new Error("attempting to instantiate unfinalized type "+this.typeName);var K=Object.create(N);if(this.buildParams.forEach(function(de,Me){Me<H?O(K,de,$[Me],!0):O(K,de,null,!1)}),Object.keys(this.allFields).forEach(function(de){O(K,de,null,!1)}),K.type!==this.typeName)throw new Error("");return K};return F.from=$=>{if(!this.finalized)throw new Error("attempting to instantiate unfinalized type "+this.typeName);var H=Object.create(N);if(Object.keys(this.allFields).forEach(function(K){be.call($,K)?O(H,K,$[K],!0):O(H,K,null,!1)}),H.type!==this.typeName)throw new Error("");return H},Object.defineProperty(C,oe(this.typeName),{enumerable:!0,value:F}),this}field(I,O,F,$){return this.finalized?(console.error("Ignoring attempt to redefine field "+JSON.stringify(I)+" of finalized type "+JSON.stringify(this.typeName)),this):(this.ownFields[I]=new Fn(I,n.from(O),F,$),this)}finalize(){if(!this.finalized){var I=this.allFields,O=this.allSupertypes;this.baseNames.forEach($=>{var H=v[$];if(H instanceof Ht)H.finalize(),Jn(I,H.allFields),Jn(O,H.allSupertypes);else{var K="unknown supertype name "+JSON.stringify($)+" for subtype "+JSON.stringify(this.typeName);throw new Error(K)}}),Jn(I,this.ownFields),O[this.typeName]=this,this.fieldNames.length=0;for(var F in I)be.call(I,F)&&!I[F].hidden&&this.fieldNames.push(F);Object.defineProperty(ys,this.typeName,{enumerable:!0,value:this.type}),this.finalized=!0,za(this.typeName,this.supertypeList),this.buildable&&this.supertypeList.lastIndexOf("Expression")>=0&&Va(this.typeName)}}}function x(S){if(!be.call(v,S))throw new Error("");var I=v[S];if(I.finalized!==!0)throw new Error("");return I.supertypeList.slice(1)}function P(S){for(var I={},O=Object.keys(v),F=O.length,$=0;$<F;++$){var H=O[$],K=v[H];if(K.finalized!==!0)throw new Error(""+H);for(var de=0;de<K.supertypeList.length;++de){var Me=K.supertypeList[de];if(be.call(S,Me)){I[H]=Me;break}}}return I}var C=Object.create(null),N={};function q(S,I){var O=N[S];return d.check(I)?delete N[S]:(a.assert(I),Object.defineProperty(N,S,{enumerable:!0,configurable:!0,value:I})),O}function oe(S){return S.replace(/^[A-Z]+/,function(I){var O=I.length;switch(O){case 0:return"";case 1:return I.toLowerCase();default:return I.slice(0,O-1).toLowerCase()+I.charAt(O-1)}})}function Ee(S){return S=oe(S),S.replace(/(Expression)?$/,"Statement")}var ys={};function Gn(S){var I=w(S);if(I)return I.fieldNames.slice(0);if("type"in S)throw new Error("did not recognize object of type "+JSON.stringify(S.type));return Object.keys(S)}function Kn(S,I){var O=w(S);if(O){var F=O.allFields[I];if(F)return F.getValue(S)}return S&&S[I]}function Ra(S,I,O){Gn(S).forEach(function(F){I.call(this,F,Kn(S,F))},O)}function ja(S,I,O){return Gn(S).some(function(F){return I.call(this,F,Kn(S,F))},O)}function Va(S){var I=Ee(S);if(C[I])return;var O=C[oe(S)];if(!O)return;let F=function(...$){return C.expressionStatement(O.apply(C,$))};F.from=function(...$){return C.expressionStatement(O.from.apply(C,$))},C[I]=F}function za(S,I){I.length=0,I.push(S);for(var O=Object.create(null),F=0;F<I.length;++F){S=I[F];var $=v[S];if($.finalized!==!0)throw new Error("");be.call(O,S)&&delete I[O[S]],O[S]=F,I.push.apply(I,$.baseNames)}for(var H=0,K=H,de=I.length;K<de;++K)be.call(I,K)&&(I[H++]=I[K]);I.length=H}function Jn(S,I){return Object.keys(I).forEach(function(O){S[O]=I[O]}),S}function $a(){Object.keys(v).forEach(function(S){v[S].finalize()})}return{Type:n,builtInTypes:f,getSupertypeNames:x,computeSupertypeLookupTable:P,builders:C,defineMethod:q,getBuilderName:oe,getStatementBuilderName:Ee,namedTypes:ys,getFieldNames:Gn,getFieldValue:Kn,eachField:Ra,someField:ja,finalize:$a}}z(()=>module);var zl=Object.prototype,wn=zl.hasOwnProperty;function Bi(s){var n=s.use(J),e=n.builtInTypes.array,t=n.builtInTypes.number;let r=function u(h,m,d){if(!(this instanceof u))throw new Error("Path constructor cannot be invoked without 'new'");if(m){if(!(m instanceof u))throw new Error("")}else m=null,d=null;this.value=h,this.parentPath=m,this.name=d,this.__childCache=null};var i=r.prototype;function a(u){return u.__childCache||(u.__childCache=Object.create(null))}function o(u,h){var m=a(u),d=u.getValueProperty(h),g=m[h];return(!wn.call(m,h)||g.value!==d)&&(g=m[h]=new u.constructor(d,u,h)),g}i.getValueProperty=function(h){return this.value[h]},i.get=function(...h){for(var m=this,d=h.length,g=0;g<d;++g)m=o(m,h[g]);return m},i.each=function(h,m){for(var d=[],g=this.value.length,f=0,f=0;f<g;++f)wn.call(this.value,f)&&(d[f]=this.get(f));for(m=m||this,f=0;f<g;++f)wn.call(d,f)&&h.call(m,d[f])},i.map=function(h,m){var d=[];return this.each(function(g){d.push(h.call(this,g))},m),d},i.filter=function(h,m){var d=[];return this.each(function(g){h.call(this,g)&&d.push(g)},m),d};function l(){}function c(u,h,m,d){if(e.assert(u.value),h===0)return l;var g=u.value.length;if(g<1)return l;var f=arguments.length;f===2?(m=0,d=g):f===3?(m=Math.max(m,0),d=g):(m=Math.max(m,0),d=Math.min(d,g)),t.assert(m),t.assert(d);for(var v=Object.create(null),w=a(u),E=m;E<d;++E)if(wn.call(u.value,E)){var x=u.get(E);if(x.name!==E)throw new Error("");var P=E+h;x.name=P,v[P]=x,delete w[E]}return delete w.length,function(){for(var C in v){var N=v[C];if(N.name!==+C)throw new Error("");w[C]=N,u.value[C]=N.value}}}i.shift=function(){var h=c(this,-1),m=this.value.shift();return h(),m},i.unshift=function(...h){var m=c(this,h.length),d=this.value.unshift.apply(this.value,h);return m(),d},i.push=function(...h){return e.assert(this.value),delete a(this).length,this.value.push.apply(this.value,h)},i.pop=function(){e.assert(this.value);var h=a(this);return delete h[this.value.length-1],delete h.length,this.value.pop()},i.insertAt=function(h){var m=arguments.length,d=c(this,m-1,h);if(d===l&&m<=1)return this;h=Math.max(h,0);for(var g=1;g<m;++g)this.value[h+g-1]=arguments[g];return d(),this},i.insertBefore=function(...h){for(var m=this.parentPath,d=h.length,g=[this.name],f=0;f<d;++f)g.push(h[f]);return m.insertAt.apply(m,g)},i.insertAfter=function(...h){for(var m=this.parentPath,d=h.length,g=[this.name+1],f=0;f<d;++f)g.push(h[f]);return m.insertAt.apply(m,g)};function p(u){if(!(u instanceof r))throw new Error("");var h=u.parentPath;if(!h)return u;var m=h.value,d=a(h);if(m[u.name]===u.value)d[u.name]=u;else if(e.check(m)){var g=m.indexOf(u.value);g>=0&&(d[u.name=g]=u)}else m[u.name]=u.value,d[u.name]=u;if(m[u.name]!==u.value)throw new Error("");if(u.parentPath.get(u.name)!==u)throw new Error("");return u}return i.replace=function(h){var m=[],d=this.parentPath.value,g=a(this.parentPath),f=arguments.length;if(p(this),e.check(d)){for(var v=d.length,w=c(this.parentPath,f-1,this.name+1),E=[this.name,1],x=0;x<f;++x)E.push(arguments[x]);var P=d.splice.apply(d,E);if(P[0]!==this.value)throw new Error("");if(d.length!==v-1+f)throw new Error("");if(w(),f===0)delete this.value,delete g[this.name],this.__childCache=null;else{if(d[this.name]!==h)throw new Error("");for(this.value!==h&&(this.value=h,this.__childCache=null),x=0;x<f;++x)m.push(this.parentPath.get(this.name+x));if(m[0]!==this)throw new Error("")}}else if(f===1)this.value!==h&&(this.__childCache=null),this.value=d[this.name]=h,m.push(this);else if(f===0)delete d[this.name],delete this.value,this.__childCache=null;else throw new Error("Could not replace path");return m},r}z(()=>module);var ht=Object.prototype.hasOwnProperty;function $l(s){var n=s.use(J),e=n.Type,t=n.namedTypes,r=t.Node,i=t.Expression,a=n.builtInTypes.array,o=n.builders;let l=function x(P,C){if(!(this instanceof x))throw new Error("Scope constructor cannot be invoked without 'new'");p.check(P.value)||c.assert(P.value);var N;if(C){if(!(C instanceof x))throw new Error("");N=C.depth+1}else C=null,N=0;Object.defineProperties(this,{path:{value:P},node:{value:P.value},isGlobal:{value:!C,enumerable:!0},depth:{value:N},parent:{value:C},bindings:{value:{}},types:{value:{}}})};var c=e.or(t.Program,t.Function,t.CatchClause),p=e.or(t.Function,t.ClassDeclaration,t.ClassExpression,t.InterfaceDeclaration,t.TSInterfaceDeclaration,t.TypeAlias,t.TSTypeAliasDeclaration),u=e.or(t.TypeParameter,t.TSTypeParameter);l.isEstablishedBy=function(x){return c.check(x)||p.check(x)};var h=l.prototype;h.didScan=!1,h.declares=function(x){return this.scan(),ht.call(this.bindings,x)},h.declaresType=function(x){return this.scan(),ht.call(this.types,x)},h.declareTemporary=function(x){if(x){if(!/^[a-z$_]/i.test(x))throw new Error("")}else x="t$";x+=this.depth.toString(36)+"$",this.scan();for(var P=0;this.declares(x+P);)++P;var C=x+P;return this.bindings[C]=n.builders.identifier(C)},h.injectTemporary=function(x,P){x||(x=this.declareTemporary());var C=this.path.get("body");return t.BlockStatement.check(C.value)&&(C=C.get("body")),C.unshift(o.variableDeclaration("var",[o.variableDeclarator(x,P||null)])),x},h.scan=function(x){if(x||!this.didScan){for(var P in this.bindings)delete this.bindings[P];for(var P in this.types)delete this.types[P];m(this.path,this.bindings,this.types),this.didScan=!0}},h.getBindings=function(){return this.scan(),this.bindings},h.getTypes=function(){return this.scan(),this.types};function m(x,P,C){var N=x.value;if(p.check(N)){let q=x.get("typeParameters","params");a.check(q.value)&&q.each(oe=>{E(oe,C)})}c.check(N)&&(t.CatchClause.check(N)?v(x.get("param"),P):d(x,P,C))}function d(x,P,C){var N=x.value;x.parent&&t.FunctionExpression.check(x.parent.node)&&x.parent.node.id&&v(x.parent.get("id"),P),N&&(a.check(N)?x.each(q=>{f(q,P,C)}):t.Function.check(N)?(x.get("params").each(q=>{v(q,P)}),f(x.get("body"),P,C),d(x.get("typeParameters"),P,C)):t.TypeAlias&&t.TypeAlias.check(N)||t.InterfaceDeclaration&&t.InterfaceDeclaration.check(N)||t.TSTypeAliasDeclaration&&t.TSTypeAliasDeclaration.check(N)||t.TSInterfaceDeclaration&&t.TSInterfaceDeclaration.check(N)?w(x.get("id"),C):t.VariableDeclarator.check(N)?(v(x.get("id"),P),f(x.get("init"),P,C)):N.type==="ImportSpecifier"||N.type==="ImportNamespaceSpecifier"||N.type==="ImportDefaultSpecifier"?v(x.get(N.local?"local":N.name?"name":"id"),P):r.check(N)&&!i.check(N)&&n.eachField(N,function(q,oe){var Ee=x.get(q);if(!g(Ee,oe))throw new Error("");f(Ee,P,C)}))}function g(x,P){return!!(x.value===P||Array.isArray(x.value)&&x.value.length===0&&Array.isArray(P)&&P.length===0)}function f(x,P,C){var N=x.value;if(!(!N||i.check(N)))if(t.FunctionDeclaration.check(N)&&N.id!==null)v(x.get("id"),P);else if(t.ClassDeclaration&&t.ClassDeclaration.check(N)&&N.id!==null)v(x.get("id"),P),d(x.get("typeParameters"),P,C);else if(t.InterfaceDeclaration&&t.InterfaceDeclaration.check(N)||t.TSInterfaceDeclaration&&t.TSInterfaceDeclaration.check(N))w(x.get("id"),C);else if(c.check(N)){if(t.CatchClause.check(N)&&t.Identifier.check(N.param)){var q=N.param.name,oe=ht.call(P,q);d(x.get("body"),P,C),oe||delete P[q]}}else d(x,P,C)}function v(x,P){var C=x.value;t.Pattern.assert(C),t.Identifier.check(C)?ht.call(P,C.name)?P[C.name].push(x):P[C.name]=[x]:t.AssignmentPattern&&t.AssignmentPattern.check(C)?v(x.get("left"),P):t.ObjectPattern&&t.ObjectPattern.check(C)?x.get("properties").each(function(N){var q=N.value;t.Pattern.check(q)?v(N,P):t.Property.check(q)||t.ObjectProperty&&t.ObjectProperty.check(q)?v(N.get("value"),P):t.SpreadProperty&&t.SpreadProperty.check(q)&&v(N.get("argument"),P)}):t.ArrayPattern&&t.ArrayPattern.check(C)?x.get("elements").each(function(N){var q=N.value;t.Pattern.check(q)?v(N,P):t.SpreadElement&&t.SpreadElement.check(q)&&v(N.get("argument"),P)}):t.PropertyPattern&&t.PropertyPattern.check(C)?v(x.get("pattern"),P):(t.SpreadElementPattern&&t.SpreadElementPattern.check(C)||t.RestElement&&t.RestElement.check(C)||t.SpreadPropertyPattern&&t.SpreadPropertyPattern.check(C))&&v(x.get("argument"),P)}function w(x,P){var C=x.value;t.Pattern.assert(C),t.Identifier.check(C)&&(ht.call(P,C.name)?P[C.name].push(x):P[C.name]=[x])}function E(x,P){var C=x.value;u.assert(C),ht.call(P,C.name)?P[C.name].push(x):P[C.name]=[x]}return h.lookup=function(x){for(var P=this;P&&!P.declares(x);P=P.parent);return P},h.lookupType=function(x){for(var P=this;P&&!P.declaresType(x);P=P.parent);return P},h.getGlobalScope=function(){for(var x=this;!x.isGlobal;)x=x.parent;return x},l}z(()=>module);function Ri(s){var n=s.use(J),e=n.namedTypes,t=n.builders,r=n.builtInTypes.number,i=n.builtInTypes.array,a=s.use(Bi),o=s.use($l);let l=function f(v,w,E){if(!(this instanceof f))throw new Error("NodePath constructor cannot be invoked without 'new'");a.call(this,v,w,E)};var c=l.prototype=Object.create(a.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}});Object.defineProperties(c,{node:{get:function(){return Object.defineProperty(this,"node",{configurable:!0,value:this._computeNode()}),this.node}},parent:{get:function(){return Object.defineProperty(this,"parent",{configurable:!0,value:this._computeParent()}),this.parent}},scope:{get:function(){return Object.defineProperty(this,"scope",{configurable:!0,value:this._computeScope()}),this.scope}}}),c.replace=function(){return delete this.node,delete this.parent,delete this.scope,a.prototype.replace.apply(this,arguments)},c.prune=function(){var f=this.parent;return this.replace(),d(f)},c._computeNode=function(){var f=this.value;if(e.Node.check(f))return f;var v=this.parentPath;return v&&v.node||null},c._computeParent=function(){var f=this.value,v=this.parentPath;if(!e.Node.check(f)){for(;v&&!e.Node.check(v.value);)v=v.parentPath;v&&(v=v.parentPath)}for(;v&&!e.Node.check(v.value);)v=v.parentPath;return v||null},c._computeScope=function(){var f=this.value,v=this.parentPath,w=v&&v.scope;return e.Node.check(f)&&o.isEstablishedBy(f)&&(w=new o(this,w)),w||null},c.getValueProperty=function(f){return n.getFieldValue(this.value,f)},c.needsParens=function(f){var v=this.parentPath;if(!v)return!1;var w=this.value;if(!e.Expression.check(w)||w.type==="Identifier")return!1;for(;!e.Node.check(v.value);)if(v=v.parentPath,!v)return!1;var E=v.value;switch(w.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return E.type==="MemberExpression"&&this.name==="object"&&E.object===w;case"BinaryExpression":case"LogicalExpression":switch(E.type){case"CallExpression":return this.name==="callee"&&E.callee===w;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return this.name==="object"&&E.object===w;case"BinaryExpression":case"LogicalExpression":{let x=w,P=E.operator,C=u[P],N=x.operator,q=u[N];if(C>q)return!0;if(C===q&&this.name==="right"){if(E.right!==x)throw new Error("Nodes must be equal");return!0}}default:return!1}case"SequenceExpression":switch(E.type){case"ForStatement":return!1;case"ExpressionStatement":return this.name!=="expression";default:return!0}case"YieldExpression":switch(E.type){case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"CallExpression":case"MemberExpression":case"NewExpression":case"ConditionalExpression":case"YieldExpression":return!0;default:return!1}case"Literal":return E.type==="MemberExpression"&&r.check(w.value)&&this.name==="object"&&E.object===w;case"AssignmentExpression":case"ConditionalExpression":switch(E.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":return this.name==="callee"&&E.callee===w;case"ConditionalExpression":return this.name==="test"&&E.test===w;case"MemberExpression":return this.name==="object"&&E.object===w;default:return!1}default:if(E.type==="NewExpression"&&this.name==="callee"&&E.callee===w)return h(w)}return!!(f!==!0&&!this.canBeFirstInStatement()&&this.firstInStatement())};function p(f){return e.BinaryExpression.check(f)||e.LogicalExpression.check(f)}var u={};[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(f,v){f.forEach(function(w){u[w]=v})});function h(f){return e.CallExpression.check(f)?!0:i.check(f)?f.some(h):e.Node.check(f)?n.someField(f,function(v,w){return h(w)}):!1}c.canBeFirstInStatement=function(){var f=this.node;return!e.FunctionExpression.check(f)&&!e.ObjectExpression.check(f)},c.firstInStatement=function(){return m(this)};function m(f){for(var v,w;f.parent;f=f.parent){if(v=f.node,w=f.parent.node,e.BlockStatement.check(w)&&f.parent.name==="body"&&f.name===0){if(w.body[0]!==v)throw new Error("Nodes must be equal");return!0}if(e.ExpressionStatement.check(w)&&f.name==="expression"){if(w.expression!==v)throw new Error("Nodes must be equal");return!0}if(e.SequenceExpression.check(w)&&f.parent.name==="expressions"&&f.name===0){if(w.expressions[0]!==v)throw new Error("Nodes must be equal");continue}if(e.CallExpression.check(w)&&f.name==="callee"){if(w.callee!==v)throw new Error("Nodes must be equal");continue}if(e.MemberExpression.check(w)&&f.name==="object"){if(w.object!==v)throw new Error("Nodes must be equal");continue}if(e.ConditionalExpression.check(w)&&f.name==="test"){if(w.test!==v)throw new Error("Nodes must be equal");continue}if(p(w)&&f.name==="left"){if(w.left!==v)throw new Error("Nodes must be equal");continue}if(e.UnaryExpression.check(w)&&!w.prefix&&f.name==="argument"){if(w.argument!==v)throw new Error("Nodes must be equal");continue}return!1}return!0}function d(f){if(e.VariableDeclaration.check(f.node)){var v=f.get("declarations").value;if(!v||v.length===0)return f.prune()}else if(e.ExpressionStatement.check(f.node)){if(!f.get("expression").value)return f.prune()}else e.IfStatement.check(f.node)&&g(f);return f}function g(f){var v=f.get("test").value,w=f.get("alternate").value,E=f.get("consequent").value;if(!E&&!w){var x=t.expressionStatement(v);f.replace(x)}else if(!E&&w){var P=t.unaryExpression("!",v,!0);e.UnaryExpression.check(v)&&v.operator==="!"&&(P=v.argument),f.get("test").replace(P),f.get("consequent").replace(w),f.get("alternate").replace()}}return l}z(()=>module);var Cn=Object.prototype.hasOwnProperty;function ql(s){var n=s.use(J),e=s.use(Ri),t=n.builtInTypes.array,r=n.builtInTypes.object,i=n.builtInTypes.function,a;let o=function d(){if(!(this instanceof d))throw new Error("PathVisitor constructor cannot be invoked without 'new'");this._reusableContextStack=[],this._methodNameTable=l(this),this._shouldVisitComments=Cn.call(this._methodNameTable,"Block")||Cn.call(this._methodNameTable,"Line"),this.Context=h(this),this._visiting=!1,this._changeReported=!1};function l(d){var g=Object.create(null);for(var f in d)/^visit[A-Z]/.test(f)&&(g[f.slice(5)]=!0);for(var v=n.computeSupertypeLookupTable(g),w=Object.create(null),E=Object.keys(v),x=E.length,P=0;P<x;++P){var C=E[P];f="visit"+v[C],i.check(d[f])&&(w[C]=f)}return w}o.fromMethodsObject=function(g){if(g instanceof o)return g;if(!r.check(g))return new o;let f=function w(){if(!(this instanceof w))throw new Error("Visitor constructor cannot be invoked without 'new'");o.call(this)};var v=f.prototype=Object.create(p);return v.constructor=f,c(v,g),c(f,o),i.assert(f.fromMethodsObject),i.assert(f.visit),new f};function c(d,g){for(var f in g)Cn.call(g,f)&&(d[f]=g[f]);return d}o.visit=function(g,f){return o.fromMethodsObject(f).visit(g)};var p=o.prototype;p.visit=function(){if(this._visiting)throw new Error("Recursively calling visitor.visit(path) resets visitor state. Try this.visit(path) or this.traverse(path) instead.");this._visiting=!0,this._changeReported=!1,this._abortRequested=!1;for(var d=arguments.length,g=new Array(d),f=0;f<d;++f)g[f]=arguments[f];g[0]instanceof e||(g[0]=new e({root:g[0]}).get("root")),this.reset.apply(this,g);var v;try{var w=this.visitWithoutReset(g[0]);v=!0}finally{if(this._visiting=!1,!v&&this._abortRequested)return g[0].value}return w},p.AbortRequest=function(){},p.abort=function(){var d=this;d._abortRequested=!0;var g=new d.AbortRequest;throw g.cancel=function(){d._abortRequested=!1},g},p.reset=function(d){},p.visitWithoutReset=function(d){if(this instanceof this.Context)return this.visitor.visitWithoutReset(d);if(!(d instanceof e))throw new Error("");var g=d.value,f=g&&typeof g=="object"&&typeof g.type=="string"&&this._methodNameTable[g.type];if(f){var v=this.acquireContext(d);try{return v.invokeVisitorMethod(f)}finally{this.releaseContext(v)}}else return u(d,this)};function u(d,g){if(!(d instanceof e))throw new Error("");if(!(g instanceof o))throw new Error("");var f=d.value;if(t.check(f))d.each(g.visitWithoutReset,g);else if(r.check(f)){var v=n.getFieldNames(f);g._shouldVisitComments&&f.comments&&v.indexOf("comments")<0&&v.push("comments");for(var w=v.length,E=[],x=0;x<w;++x){var P=v[x];Cn.call(f,P)||(f[P]=n.getFieldValue(f,P)),E.push(d.get(P))}for(var x=0;x<w;++x)g.visitWithoutReset(E[x])}return d.value}p.acquireContext=function(d){return this._reusableContextStack.length===0?new this.Context(d):this._reusableContextStack.pop().reset(d)},p.releaseContext=function(d){if(!(d instanceof this.Context))throw new Error("");this._reusableContextStack.push(d),d.currentPath=null},p.reportChanged=function(){this._changeReported=!0},p.wasChangeReported=function(){return this._changeReported};function h(d){function g(v){if(!(this instanceof g))throw new Error("");if(!(this instanceof o))throw new Error("");if(!(v instanceof e))throw new Error("");Object.defineProperty(this,"visitor",{value:d,writable:!1,enumerable:!0,configurable:!1}),this.currentPath=v,this.needToCallTraverse=!0,Object.seal(this)}if(!(d instanceof o))throw new Error("");var f=g.prototype=Object.create(d);return f.constructor=g,c(f,m),g}var m=Object.create(null);return m.reset=function(g){if(!(this instanceof this.Context))throw new Error("");if(!(g instanceof e))throw new Error("");return this.currentPath=g,this.needToCallTraverse=!0,this},m.invokeVisitorMethod=function(g){if(!(this instanceof this.Context))throw new Error("");if(!(this.currentPath instanceof e))throw new Error("");var f=this.visitor[g].call(this,this.currentPath);if(f===!1?this.needToCallTraverse=!1:f!==a&&(this.currentPath=this.currentPath.replace(f)[0],this.needToCallTraverse&&this.traverse(this.currentPath)),this.needToCallTraverse!==!1)throw new Error("Must either call this.traverse or return false in "+g);var v=this.currentPath;return v&&v.value},m.traverse=function(g,f){if(!(this instanceof this.Context))throw new Error("");if(!(g instanceof e))throw new Error("");if(!(this.currentPath instanceof e))throw new Error("");return this.needToCallTraverse=!1,u(g,o.fromMethodsObject(f||this.visitor))},m.visit=function(g,f){if(!(this instanceof this.Context))throw new Error("");if(!(g instanceof e))throw new Error("");if(!(this.currentPath instanceof e))throw new Error("");return this.needToCallTraverse=!1,o.fromMethodsObject(f||this.visitor).visitWithoutReset(g)},m.reportChanged=function(){this.visitor.reportChanged()},m.abort=function(){this.needToCallTraverse=!1,this.visitor.abort()},o}z(()=>module);function Hl(s){var n=s.use(J),e=n.getFieldNames,t=n.getFieldValue,r=n.builtInTypes.array,i=n.builtInTypes.object,a=n.builtInTypes.Date,o=n.builtInTypes.RegExp,l=Object.prototype.hasOwnProperty;function c(d,g,f){return r.check(f)?f.length=0:f=null,u(d,g,f)}c.assert=function(d,g){var f=[];if(!c(d,g,f))if(f.length===0){if(d!==g)throw new Error("Nodes must be equal")}else throw new Error("Nodes differ in the following path: "+f.map(p).join(""))};function p(d){return/[_$a-z][_$a-z0-9]*/i.test(d)?"."+d:"["+JSON.stringify(d)+"]"}function u(d,g,f){return d===g?!0:r.check(d)?h(d,g,f):i.check(d)?m(d,g,f):a.check(d)?a.check(g)&&+d==+g:o.check(d)?o.check(g)&&d.source===g.source&&d.global===g.global&&d.multiline===g.multiline&&d.ignoreCase===g.ignoreCase:d==g}function h(d,g,f){r.assert(d);var v=d.length;if(!r.check(g)||g.length!==v)return f&&f.push("length"),!1;for(var w=0;w<v;++w){if(f&&f.push(w),w in d!=w in g||!u(d[w],g[w],f))return!1;if(f){var E=f.pop();if(E!==w)throw new Error(""+E)}}return!0}function m(d,g,f){if(i.assert(d),!i.check(g))return!1;if(d.type!==g.type)return f&&f.push("type"),!1;var v=e(d),w=v.length,E=e(g),x=E.length;if(w===x){for(var P=0;P<w;++P){var C=v[P],N=t(d,C),q=t(g,C);if(f&&f.push(C),!u(N,q,f))return!1;if(f){var oe=f.pop();if(oe!==C)throw new Error(""+oe)}}return!0}if(!f)return!1;var Ee=Object.create(null);for(P=0;P<w;++P)Ee[v[P]]=!0;for(P=0;P<x;++P){if(C=E[P],!l.call(Ee,C))return f.push(C),!1;delete Ee[C]}for(C in Ee){f.push(C);break}return!1}return c}z(()=>module);function Wl(s){let n=Gl(),e=n.use(J);s.forEach(n.use),e.finalize();let t=n.use(ql);return{Type:e.Type,builtInTypes:e.builtInTypes,namedTypes:e.namedTypes,builders:e.builders,defineMethod:e.defineMethod,getFieldNames:e.getFieldNames,getFieldValue:e.getFieldValue,eachField:e.eachField,someField:e.someField,getSupertypeNames:e.getSupertypeNames,getBuilderName:e.getBuilderName,astNodesAreEquivalent:n.use(Hl),finalize:e.finalize,Path:n.use(Bi),NodePath:n.use(Ri),PathVisitor:t,use:n.use,visit:t.visit}}function Gl(){let s=[],n=[];function e(r){var i=s.indexOf(r);return i===-1&&(i=s.length,s.push(r),n[i]=r(t)),n[i]}var t={use:e};return t}z(()=>module);function ji(){return{BinaryOperators:["==","!=","===","!==","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof"],AssignmentOperators:["=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&="],LogicalOperators:["||","&&"]}}z(()=>module);function Vi(s){let n=s.use(ji);return n.BinaryOperators.indexOf("**")<0&&n.BinaryOperators.push("**"),n.AssignmentOperators.indexOf("**=")<0&&n.AssignmentOperators.push("**="),n}z(()=>module);function zi(s){let n=s.use(Vi);return n.LogicalOperators.indexOf("??")<0&&n.LogicalOperators.push("??"),n}z(()=>module);function Kl(s){let n=s.use(zi);return n.LogicalOperators.forEach(e=>{let t=e+"=";n.AssignmentOperators.indexOf(t)<0&&n.AssignmentOperators.push(t)}),n}z(()=>module);function Jl(s){var n=s.use(J),e=n.Type,t=e.def,r=e.or,i=s.use(pe),a=i.defaults,o=i.geq;let{BinaryOperators:l,AssignmentOperators:c,LogicalOperators:p}=s.use(ji);t("Printable").field("loc",r(t("SourceLocation"),null),a.null,!0),t("Node").bases("Printable").field("type",String).field("comments",r([t("Comment")],null),a.null,!0),t("SourceLocation").field("start",t("Position")).field("end",t("Position")).field("source",r(String,null),a.null),t("Position").field("line",o(1)).field("column",o(0)),t("File").bases("Node").build("program","name").field("program",t("Program")).field("name",r(String,null),a.null),t("Program").bases("Node").build("body").field("body",[t("Statement")]),t("Function").bases("Node").field("id",r(t("Identifier"),null),a.null).field("params",[t("Pattern")]).field("body",t("BlockStatement")).field("generator",Boolean,a.false).field("async",Boolean,a.false),t("Statement").bases("Node"),t("EmptyStatement").bases("Statement").build(),t("BlockStatement").bases("Statement").build("body").field("body",[t("Statement")]),t("ExpressionStatement").bases("Statement").build("expression").field("expression",t("Expression")),t("IfStatement").bases("Statement").build("test","consequent","alternate").field("test",t("Expression")).field("consequent",t("Statement")).field("alternate",r(t("Statement"),null),a.null),t("LabeledStatement").bases("Statement").build("label","body").field("label",t("Identifier")).field("body",t("Statement")),t("BreakStatement").bases("Statement").build("label").field("label",r(t("Identifier"),null),a.null),t("ContinueStatement").bases("Statement").build("label").field("label",r(t("Identifier"),null),a.null),t("WithStatement").bases("Statement").build("object","body").field("object",t("Expression")).field("body",t("Statement")),t("SwitchStatement").bases("Statement").build("discriminant","cases","lexical").field("discriminant",t("Expression")).field("cases",[t("SwitchCase")]).field("lexical",Boolean,a.false),t("ReturnStatement").bases("Statement").build("argument").field("argument",r(t("Expression"),null)),t("ThrowStatement").bases("Statement").build("argument").field("argument",t("Expression")),t("TryStatement").bases("Statement").build("block","handler","finalizer").field("block",t("BlockStatement")).field("handler",r(t("CatchClause"),null),function(){return this.handlers&&this.handlers[0]||null}).field("handlers",[t("CatchClause")],function(){return this.handler?[this.handler]:[]},!0).field("guardedHandlers",[t("CatchClause")],a.emptyArray).field("finalizer",r(t("BlockStatement"),null),a.null),t("CatchClause").bases("Node").build("param","guard","body").field("param",t("Pattern")).field("guard",r(t("Expression"),null),a.null).field("body",t("BlockStatement")),t("WhileStatement").bases("Statement").build("test","body").field("test",t("Expression")).field("body",t("Statement")),t("DoWhileStatement").bases("Statement").build("body","test").field("body",t("Statement")).field("test",t("Expression")),t("ForStatement").bases("Statement").build("init","test","update","body").field("init",r(t("VariableDeclaration"),t("Expression"),null)).field("test",r(t("Expression"),null)).field("update",r(t("Expression"),null)).field("body",t("Statement")),t("ForInStatement").bases("Statement").build("left","right","body").field("left",r(t("VariableDeclaration"),t("Expression"))).field("right",t("Expression")).field("body",t("Statement")),t("DebuggerStatement").bases("Statement").build(),t("Declaration").bases("Statement"),t("FunctionDeclaration").bases("Function","Declaration").build("id","params","body").field("id",t("Identifier")),t("FunctionExpression").bases("Function","Expression").build("id","params","body"),t("VariableDeclaration").bases("Declaration").build("kind","declarations").field("kind",r("var","let","const")).field("declarations",[t("VariableDeclarator")]),t("VariableDeclarator").bases("Node").build("id","init").field("id",t("Pattern")).field("init",r(t("Expression"),null),a.null),t("Expression").bases("Node"),t("ThisExpression").bases("Expression").build(),t("ArrayExpression").bases("Expression").build("elements").field("elements",[r(t("Expression"),null)]),t("ObjectExpression").bases("Expression").build("properties").field("properties",[t("Property")]),t("Property").bases("Node").build("kind","key","value").field("kind",r("init","get","set")).field("key",r(t("Literal"),t("Identifier"))).field("value",t("Expression")),t("SequenceExpression").bases("Expression").build("expressions").field("expressions",[t("Expression")]);var u=r("-","+","!","~","typeof","void","delete");t("UnaryExpression").bases("Expression").build("operator","argument","prefix").field("operator",u).field("argument",t("Expression")).field("prefix",Boolean,a.true);let h=r(...l);t("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",h).field("left",t("Expression")).field("right",t("Expression"));let m=r(...c);t("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",m).field("left",r(t("Pattern"),t("MemberExpression"))).field("right",t("Expression"));var d=r("++","--");t("UpdateExpression").bases("Expression").build("operator","argument","prefix").field("operator",d).field("argument",t("Expression")).field("prefix",Boolean);var g=r(...p);t("LogicalExpression").bases("Expression").build("operator","left","right").field("operator",g).field("left",t("Expression")).field("right",t("Expression")),t("ConditionalExpression").bases("Expression").build("test","consequent","alternate").field("test",t("Expression")).field("consequent",t("Expression")).field("alternate",t("Expression")),t("NewExpression").bases("Expression").build("callee","arguments").field("callee",t("Expression")).field("arguments",[t("Expression")]),t("CallExpression").bases("Expression").build("callee","arguments").field("callee",t("Expression")).field("arguments",[t("Expression")]),t("MemberExpression").bases("Expression").build("object","property","computed").field("object",t("Expression")).field("property",r(t("Identifier"),t("Expression"))).field("computed",Boolean,function(){var f=this.property.type;return f==="Literal"||f==="MemberExpression"||f==="BinaryExpression"}),t("Pattern").bases("Node"),t("SwitchCase").bases("Node").build("test","consequent").field("test",r(t("Expression"),null)).field("consequent",[t("Statement")]),t("Identifier").bases("Expression","Pattern").build("name").field("name",String).field("optional",Boolean,a.false),t("Literal").bases("Expression").build("value").field("value",r(String,Boolean,null,Number,RegExp,BigInt)),t("Comment").bases("Printable").field("value",String).field("leading",Boolean,a.true).field("trailing",Boolean,a.false)}z(()=>module);function Xl(s){s.use(Jl);let n=s.use(J),e=n.Type.def,t=n.Type.or,r=s.use(pe).defaults;e("Function").field("generator",Boolean,r.false).field("expression",Boolean,r.false).field("defaults",[t(e("Expression"),null)],r.emptyArray).field("rest",t(e("Identifier"),null),r.null),e("RestElement").bases("Pattern").build("argument").field("argument",e("Pattern")).field("typeAnnotation",t(e("TypeAnnotation"),e("TSTypeAnnotation"),null),r.null),e("SpreadElementPattern").bases("Pattern").build("argument").field("argument",e("Pattern")),e("FunctionDeclaration").build("id","params","body","generator","expression").field("id",t(e("Identifier"),null)),e("FunctionExpression").build("id","params","body","generator","expression"),e("ArrowFunctionExpression").bases("Function","Expression").build("params","body","expression").field("id",null,r.null).field("body",t(e("BlockStatement"),e("Expression"))).field("generator",!1,r.false),e("ForOfStatement").bases("Statement").build("left","right","body").field("left",t(e("VariableDeclaration"),e("Pattern"))).field("right",e("Expression")).field("body",e("Statement")),e("YieldExpression").bases("Expression").build("argument","delegate").field("argument",t(e("Expression"),null)).field("delegate",Boolean,r.false),e("GeneratorExpression").bases("Expression").build("body","blocks","filter").field("body",e("Expression")).field("blocks",[e("ComprehensionBlock")]).field("filter",t(e("Expression"),null)),e("ComprehensionExpression").bases("Expression").build("body","blocks","filter").field("body",e("Expression")).field("blocks",[e("ComprehensionBlock")]).field("filter",t(e("Expression"),null)),e("ComprehensionBlock").bases("Node").build("left","right","each").field("left",e("Pattern")).field("right",e("Expression")).field("each",Boolean),e("Property").field("key",t(e("Literal"),e("Identifier"),e("Expression"))).field("value",t(e("Expression"),e("Pattern"))).field("method",Boolean,r.false).field("shorthand",Boolean,r.false).field("computed",Boolean,r.false),e("ObjectProperty").field("shorthand",Boolean,r.false),e("PropertyPattern").bases("Pattern").build("key","pattern").field("key",t(e("Literal"),e("Identifier"),e("Expression"))).field("pattern",e("Pattern")).field("computed",Boolean,r.false),e("ObjectPattern").bases("Pattern").build("properties").field("properties",[t(e("PropertyPattern"),e("Property"))]),e("ArrayPattern").bases("Pattern").build("elements").field("elements",[t(e("Pattern"),null)]),e("SpreadElement").bases("Node").build("argument").field("argument",e("Expression")),e("ArrayExpression").field("elements",[t(e("Expression"),e("SpreadElement"),e("RestElement"),null)]),e("NewExpression").field("arguments",[t(e("Expression"),e("SpreadElement"))]),e("CallExpression").field("arguments",[t(e("Expression"),e("SpreadElement"))]),e("AssignmentPattern").bases("Pattern").build("left","right").field("left",e("Pattern")).field("right",e("Expression")),e("MethodDefinition").bases("Declaration").build("kind","key","value","static").field("kind",t("constructor","method","get","set")).field("key",e("Expression")).field("value",e("Function")).field("computed",Boolean,r.false).field("static",Boolean,r.false);let i=t(e("MethodDefinition"),e("VariableDeclarator"),e("ClassPropertyDefinition"),e("ClassProperty"),e("StaticBlock"));e("ClassProperty").bases("Declaration").build("key").field("key",t(e("Literal"),e("Identifier"),e("Expression"))).field("computed",Boolean,r.false),e("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition",i),e("ClassBody").bases("Declaration").build("body").field("body",[i]),e("ClassDeclaration").bases("Declaration").build("id","body","superClass").field("id",t(e("Identifier"),null)).field("body",e("ClassBody")).field("superClass",t(e("Expression"),null),r.null),e("ClassExpression").bases("Expression").build("id","body","superClass").field("id",t(e("Identifier"),null),r.null).field("body",e("ClassBody")).field("superClass",t(e("Expression"),null),r.null),e("Super").bases("Expression").build(),e("Specifier").bases("Node"),e("ModuleSpecifier").bases("Specifier").field("local",t(e("Identifier"),null),r.null).field("id",t(e("Identifier"),null),r.null).field("name",t(e("Identifier"),null),r.null),e("ImportSpecifier").bases("ModuleSpecifier").build("imported","local").field("imported",e("Identifier")),e("ImportDefaultSpecifier").bases("ModuleSpecifier").build("local"),e("ImportNamespaceSpecifier").bases("ModuleSpecifier").build("local"),e("ImportDeclaration").bases("Declaration").build("specifiers","source","importKind").field("specifiers",[t(e("ImportSpecifier"),e("ImportNamespaceSpecifier"),e("ImportDefaultSpecifier"))],r.emptyArray).field("source",e("Literal")).field("importKind",t("value","type"),function(){return"value"}),e("ExportNamedDeclaration").bases("Declaration").build("declaration","specifiers","source").field("declaration",t(e("Declaration"),null)).field("specifiers",[e("ExportSpecifier")],r.emptyArray).field("source",t(e("Literal"),null),r.null),e("ExportSpecifier").bases("ModuleSpecifier").build("local","exported").field("exported",e("Identifier")),e("ExportDefaultDeclaration").bases("Declaration").build("declaration").field("declaration",t(e("Declaration"),e("Expression"))),e("ExportAllDeclaration").bases("Declaration").build("source").field("source",e("Literal")),e("TaggedTemplateExpression").bases("Expression").build("tag","quasi").field("tag",e("Expression")).field("quasi",e("TemplateLiteral")),e("TemplateLiteral").bases("Expression").build("quasis","expressions").field("quasis",[e("TemplateElement")]).field("expressions",[e("Expression")]),e("TemplateElement").bases("Node").build("value","tail").field("value",{cooked:String,raw:String}).field("tail",Boolean),e("MetaProperty").bases("Expression").build("meta","property").field("meta",e("Identifier")).field("property",e("Identifier"))}z(()=>module);function Ql(s){s.use(Vi),s.use(Xl)}z(()=>module);function Yl(s){s.use(Ql);let e=s.use(J).Type.def,t=s.use(pe).defaults;e("Function").field("async",Boolean,t.false),e("AwaitExpression").bases("Expression").build("argument").field("argument",e("Expression"))}z(()=>module);function Zl(s){s.use(Yl);let n=s.use(J),e=n.Type.def,t=n.Type.or,r=s.use(pe).defaults;e("ForOfStatement").field("await",Boolean,r.false),e("SpreadProperty").bases("Node").build("argument").field("argument",e("Expression")),e("ObjectExpression").field("properties",[t(e("Property"),e("SpreadProperty"),e("SpreadElement"))]),e("TemplateElement").field("value",{cooked:t(String,null),raw:String}),e("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument",e("Pattern")),e("ObjectPattern").field("properties",[t(e("PropertyPattern"),e("Property"),e("RestElement"),e("SpreadPropertyPattern"))])}z(()=>module);function ec(s){s.use(Zl);let n=s.use(J),e=n.Type.def,t=n.Type.or,r=s.use(pe).defaults;e("CatchClause").field("param",t(e("Pattern"),null),r.null)}z(()=>module);function tc(s){s.use(zi),s.use(ec);let n=s.use(J),e=n.Type.def,t=n.Type.or,i=s.use(pe).defaults;e("ImportExpression").bases("Expression").build("source").field("source",e("Expression")),e("ExportAllDeclaration").bases("Declaration").build("source","exported").field("source",e("Literal")).field("exported",t(e("Identifier"),null,void 0),i.null),e("ChainElement").bases("Node").field("optional",Boolean,i.false),e("CallExpression").bases("Expression","ChainElement"),e("MemberExpression").bases("Expression","ChainElement"),e("ChainExpression").bases("Expression").build("expression").field("expression",e("ChainElement")),e("OptionalCallExpression").bases("CallExpression").build("callee","arguments","optional").field("optional",Boolean,i.true),e("OptionalMemberExpression").bases("MemberExpression").build("object","property","computed","optional").field("optional",Boolean,i.true)}z(()=>module);function nc(s){s.use(Kl),s.use(tc)}z(()=>module);function rc(s){s.use(nc);let e=s.use(J).Type.def;e("StaticBlock").bases("Declaration").build("body").field("body",[e("Statement")])}z(()=>module);function Qt(s){s.use(rc);let n=s.use(J),e=n.Type,t=n.Type.def,r=e.or,a=s.use(pe).defaults;t("AwaitExpression").build("argument","all").field("argument",r(t("Expression"),null)).field("all",Boolean,a.false),t("Decorator").bases("Node").build("expression").field("expression",t("Expression")),t("Property").field("decorators",r([t("Decorator")],null),a.null),t("MethodDefinition").field("decorators",r([t("Decorator")],null),a.null),t("PrivateName").bases("Expression","Pattern").build("id").field("id",t("Identifier")),t("ClassPrivateProperty").bases("ClassProperty").build("key","value").field("key",t("PrivateName")).field("value",r(t("Expression"),null),a.null),t("ImportAttribute").bases("Node").build("key","value").field("key",r(t("Identifier"),t("Literal"))).field("value",t("Expression")),["ImportDeclaration","ExportAllDeclaration","ExportNamedDeclaration"].forEach(o=>{t(o).field("assertions",[t("ImportAttribute")],a.emptyArray)}),t("RecordExpression").bases("Expression").build("properties").field("properties",[r(t("ObjectProperty"),t("ObjectMethod"),t("SpreadElement"))]),t("TupleExpression").bases("Expression").build("elements").field("elements",[r(t("Expression"),t("SpreadElement"),null)]),t("ModuleExpression").bases("Node").build("body").field("body",t("Program"))}z(()=>module);function sc(s){s.use(Qt);let n=s.use(J),e=n.Type.def,t=n.Type.or,r=s.use(pe).defaults;e("JSXAttribute").bases("Node").build("name","value").field("name",t(e("JSXIdentifier"),e("JSXNamespacedName"))).field("value",t(e("Literal"),e("JSXExpressionContainer"),e("JSXElement"),e("JSXFragment"),null),r.null),e("JSXIdentifier").bases("Identifier").build("name").field("name",String),e("JSXNamespacedName").bases("Node").build("namespace","name").field("namespace",e("JSXIdentifier")).field("name",e("JSXIdentifier")),e("JSXMemberExpression").bases("MemberExpression").build("object","property").field("object",t(e("JSXIdentifier"),e("JSXMemberExpression"))).field("property",e("JSXIdentifier")).field("computed",Boolean,r.false);let i=t(e("JSXIdentifier"),e("JSXNamespacedName"),e("JSXMemberExpression"));e("JSXSpreadAttribute").bases("Node").build("argument").field("argument",e("Expression"));let a=[t(e("JSXAttribute"),e("JSXSpreadAttribute"))];e("JSXExpressionContainer").bases("Expression").build("expression").field("expression",t(e("Expression"),e("JSXEmptyExpression")));let o=[t(e("JSXText"),e("JSXExpressionContainer"),e("JSXSpreadChild"),e("JSXElement"),e("JSXFragment"),e("Literal"))];e("JSXElement").bases("Expression").build("openingElement","closingElement","children").field("openingElement",e("JSXOpeningElement")).field("closingElement",t(e("JSXClosingElement"),null),r.null).field("children",o,r.emptyArray).field("name",i,function(){return this.openingElement.name},!0).field("selfClosing",Boolean,function(){return this.openingElement.selfClosing},!0).field("attributes",a,function(){return this.openingElement.attributes},!0),e("JSXOpeningElement").bases("Node").build("name","attributes","selfClosing").field("name",i).field("attributes",a,r.emptyArray).field("selfClosing",Boolean,r.false),e("JSXClosingElement").bases("Node").build("name").field("name",i),e("JSXFragment").bases("Expression").build("openingFragment","closingFragment","children").field("openingFragment",e("JSXOpeningFragment")).field("closingFragment",e("JSXClosingFragment")).field("children",o,r.emptyArray),e("JSXOpeningFragment").bases("Node").build(),e("JSXClosingFragment").bases("Node").build(),e("JSXText").bases("Literal").build("value","raw").field("value",String).field("raw",String,function(){return this.value}),e("JSXEmptyExpression").bases("Node").build(),e("JSXSpreadChild").bases("Node").build("expression").field("expression",e("Expression"))}z(()=>module);function $i(s){var n=s.use(J),e=n.Type.def,t=n.Type.or,r=s.use(pe).defaults,i=t(e("TypeAnnotation"),e("TSTypeAnnotation"),null),a=t(e("TypeParameterDeclaration"),e("TSTypeParameterDeclaration"),null);e("Identifier").field("typeAnnotation",i,r.null),e("ObjectPattern").field("typeAnnotation",i,r.null),e("Function").field("returnType",i,r.null).field("typeParameters",a,r.null),e("ClassProperty").build("key","value","typeAnnotation","static").field("value",t(e("Expression"),null)).field("static",Boolean,r.false).field("typeAnnotation",i,r.null),["ClassDeclaration","ClassExpression"].forEach(o=>{e(o).field("typeParameters",a,r.null).field("superTypeParameters",t(e("TypeParameterInstantiation"),e("TSTypeParameterInstantiation"),null),r.null).field("implements",t([e("ClassImplements")],[e("TSExpressionWithTypeArguments")]),r.emptyArray)})}z(()=>module);function qi(s){s.use(Qt),s.use($i);let n=s.use(J),e=n.Type.def,t=n.Type.or,r=s.use(pe).defaults;e("Flow").bases("Node"),e("FlowType").bases("Flow"),e("AnyTypeAnnotation").bases("FlowType").build(),e("EmptyTypeAnnotation").bases("FlowType").build(),e("MixedTypeAnnotation").bases("FlowType").build(),e("VoidTypeAnnotation").bases("FlowType").build(),e("SymbolTypeAnnotation").bases("FlowType").build(),e("NumberTypeAnnotation").bases("FlowType").build(),e("BigIntTypeAnnotation").bases("FlowType").build(),e("NumberLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),e("NumericLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),e("BigIntLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",null).field("raw",String),e("StringTypeAnnotation").bases("FlowType").build(),e("StringLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",String).field("raw",String),e("BooleanTypeAnnotation").bases("FlowType").build(),e("BooleanLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Boolean).field("raw",String),e("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",e("FlowType")),e("NullableTypeAnnotation").bases("FlowType").build("typeAnnotation").field("typeAnnotation",e("FlowType")),e("NullLiteralTypeAnnotation").bases("FlowType").build(),e("NullTypeAnnotation").bases("FlowType").build(),e("ThisTypeAnnotation").bases("FlowType").build(),e("ExistsTypeAnnotation").bases("FlowType").build(),e("ExistentialTypeParam").bases("FlowType").build(),e("FunctionTypeAnnotation").bases("FlowType").build("params","returnType","rest","typeParameters").field("params",[e("FunctionTypeParam")]).field("returnType",e("FlowType")).field("rest",t(e("FunctionTypeParam"),null)).field("typeParameters",t(e("TypeParameterDeclaration"),null)),e("FunctionTypeParam").bases("Node").build("name","typeAnnotation","optional").field("name",t(e("Identifier"),null)).field("typeAnnotation",e("FlowType")).field("optional",Boolean),e("ArrayTypeAnnotation").bases("FlowType").build("elementType").field("elementType",e("FlowType")),e("ObjectTypeAnnotation").bases("FlowType").build("properties","indexers","callProperties").field("properties",[t(e("ObjectTypeProperty"),e("ObjectTypeSpreadProperty"))]).field("indexers",[e("ObjectTypeIndexer")],r.emptyArray).field("callProperties",[e("ObjectTypeCallProperty")],r.emptyArray).field("inexact",t(Boolean,void 0),r.undefined).field("exact",Boolean,r.false).field("internalSlots",[e("ObjectTypeInternalSlot")],r.emptyArray),e("Variance").bases("Node").build("kind").field("kind",t("plus","minus"));let i=t(e("Variance"),"plus","minus",null);e("ObjectTypeProperty").bases("Node").build("key","value","optional").field("key",t(e("Literal"),e("Identifier"))).field("value",e("FlowType")).field("optional",Boolean).field("variance",i,r.null),e("ObjectTypeIndexer").bases("Node").build("id","key","value").field("id",e("Identifier")).field("key",e("FlowType")).field("value",e("FlowType")).field("variance",i,r.null).field("static",Boolean,r.false),e("ObjectTypeCallProperty").bases("Node").build("value").field("value",e("FunctionTypeAnnotation")).field("static",Boolean,r.false),e("QualifiedTypeIdentifier").bases("Node").build("qualification","id").field("qualification",t(e("Identifier"),e("QualifiedTypeIdentifier"))).field("id",e("Identifier")),e("GenericTypeAnnotation").bases("FlowType").build("id","typeParameters").field("id",t(e("Identifier"),e("QualifiedTypeIdentifier"))).field("typeParameters",t(e("TypeParameterInstantiation"),null)),e("MemberTypeAnnotation").bases("FlowType").build("object","property").field("object",e("Identifier")).field("property",t(e("MemberTypeAnnotation"),e("GenericTypeAnnotation"))),e("IndexedAccessType").bases("FlowType").build("objectType","indexType").field("objectType",e("FlowType")).field("indexType",e("FlowType")),e("OptionalIndexedAccessType").bases("FlowType").build("objectType","indexType","optional").field("objectType",e("FlowType")).field("indexType",e("FlowType")).field("optional",Boolean),e("UnionTypeAnnotation").bases("FlowType").build("types").field("types",[e("FlowType")]),e("IntersectionTypeAnnotation").bases("FlowType").build("types").field("types",[e("FlowType")]),e("TypeofTypeAnnotation").bases("FlowType").build("argument").field("argument",e("FlowType")),e("ObjectTypeSpreadProperty").bases("Node").build("argument").field("argument",e("FlowType")),e("ObjectTypeInternalSlot").bases("Node").build("id","value","optional","static","method").field("id",e("Identifier")).field("value",e("FlowType")).field("optional",Boolean).field("static",Boolean).field("method",Boolean),e("TypeParameterDeclaration").bases("Node").build("params").field("params",[e("TypeParameter")]),e("TypeParameterInstantiation").bases("Node").build("params").field("params",[e("FlowType")]),e("TypeParameter").bases("FlowType").build("name","variance","bound","default").field("name",String).field("variance",i,r.null).field("bound",t(e("TypeAnnotation"),null),r.null).field("default",t(e("FlowType"),null),r.null),e("ClassProperty").field("variance",i,r.null),e("ClassImplements").bases("Node").build("id").field("id",e("Identifier")).field("superClass",t(e("Expression"),null),r.null).field("typeParameters",t(e("TypeParameterInstantiation"),null),r.null),e("InterfaceTypeAnnotation").bases("FlowType").build("body","extends").field("body",e("ObjectTypeAnnotation")).field("extends",t([e("InterfaceExtends")],null),r.null),e("InterfaceDeclaration").bases("Declaration").build("id","body","extends").field("id",e("Identifier")).field("typeParameters",t(e("TypeParameterDeclaration"),null),r.null).field("body",e("ObjectTypeAnnotation")).field("extends",[e("InterfaceExtends")]),e("DeclareInterface").bases("InterfaceDeclaration").build("id","body","extends"),e("InterfaceExtends").bases("Node").build("id").field("id",e("Identifier")).field("typeParameters",t(e("TypeParameterInstantiation"),null),r.null),e("TypeAlias").bases("Declaration").build("id","typeParameters","right").field("id",e("Identifier")).field("typeParameters",t(e("TypeParameterDeclaration"),null)).field("right",e("FlowType")),e("DeclareTypeAlias").bases("TypeAlias").build("id","typeParameters","right"),e("OpaqueType").bases("Declaration").build("id","typeParameters","impltype","supertype").field("id",e("Identifier")).field("typeParameters",t(e("TypeParameterDeclaration"),null)).field("impltype",e("FlowType")).field("supertype",t(e("FlowType"),null)),e("DeclareOpaqueType").bases("OpaqueType").build("id","typeParameters","supertype").field("impltype",t(e("FlowType"),null)),e("TypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",e("Expression")).field("typeAnnotation",e("TypeAnnotation")),e("TupleTypeAnnotation").bases("FlowType").build("types").field("types",[e("FlowType")]),e("DeclareVariable").bases("Statement").build("id").field("id",e("Identifier")),e("DeclareFunction").bases("Statement").build("id").field("id",e("Identifier")).field("predicate",t(e("FlowPredicate"),null),r.null),e("DeclareClass").bases("InterfaceDeclaration").build("id"),e("DeclareModule").bases("Statement").build("id","body").field("id",t(e("Identifier"),e("Literal"))).field("body",e("BlockStatement")),e("DeclareModuleExports").bases("Statement").build("typeAnnotation").field("typeAnnotation",e("TypeAnnotation")),e("DeclareExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",t(e("DeclareVariable"),e("DeclareFunction"),e("DeclareClass"),e("FlowType"),e("TypeAlias"),e("DeclareOpaqueType"),e("InterfaceDeclaration"),null)).field("specifiers",[t(e("ExportSpecifier"),e("ExportBatchSpecifier"))],r.emptyArray).field("source",t(e("Literal"),null),r.null),e("DeclareExportAllDeclaration").bases("Declaration").build("source").field("source",t(e("Literal"),null),r.null),e("ImportDeclaration").field("importKind",t("value","type","typeof"),()=>"value"),e("FlowPredicate").bases("Flow"),e("InferredPredicate").bases("FlowPredicate").build(),e("DeclaredPredicate").bases("FlowPredicate").build("value").field("value",e("Expression")),e("Function").field("predicate",t(e("FlowPredicate"),null),r.null),e("CallExpression").field("typeArguments",t(null,e("TypeParameterInstantiation")),r.null),e("NewExpression").field("typeArguments",t(null,e("TypeParameterInstantiation")),r.null),e("EnumDeclaration").bases("Declaration").build("id","body").field("id",e("Identifier")).field("body",t(e("EnumBooleanBody"),e("EnumNumberBody"),e("EnumStringBody"),e("EnumSymbolBody"))),e("EnumBooleanBody").build("members","explicitType").field("members",[e("EnumBooleanMember")]).field("explicitType",Boolean),e("EnumNumberBody").build("members","explicitType").field("members",[e("EnumNumberMember")]).field("explicitType",Boolean),e("EnumStringBody").build("members","explicitType").field("members",t([e("EnumStringMember")],[e("EnumDefaultedMember")])).field("explicitType",Boolean),e("EnumSymbolBody").build("members").field("members",[e("EnumDefaultedMember")]),e("EnumBooleanMember").build("id","init").field("id",e("Identifier")).field("init",t(e("Literal"),Boolean)),e("EnumNumberMember").build("id","init").field("id",e("Identifier")).field("init",e("Literal")),e("EnumStringMember").build("id","init").field("id",e("Identifier")).field("init",e("Literal")),e("EnumDefaultedMember").build("id").field("id",e("Identifier"))}z(()=>module);function ic(s){s.use(Qt);var n=s.use(J),e=s.use(pe).defaults,t=n.Type.def,r=n.Type.or;t("VariableDeclaration").field("declarations",[r(t("VariableDeclarator"),t("Identifier"))]),t("Property").field("value",r(t("Expression"),t("Pattern"))),t("ArrayPattern").field("elements",[r(t("Pattern"),t("SpreadElement"),null)]),t("ObjectPattern").field("properties",[r(t("Property"),t("PropertyPattern"),t("SpreadPropertyPattern"),t("SpreadProperty"))]),t("ExportSpecifier").bases("ModuleSpecifier").build("id","name"),t("ExportBatchSpecifier").bases("Specifier").build(),t("ExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",r(t("Declaration"),t("Expression"),null)).field("specifiers",[r(t("ExportSpecifier"),t("ExportBatchSpecifier"))],e.emptyArray).field("source",r(t("Literal"),null),e.null),t("Block").bases("Comment").build("value","leading","trailing"),t("Line").bases("Comment").build("value","leading","trailing")}z(()=>module);function Hi(s){s.use(Qt);let n=s.use(J),e=s.use(pe).defaults,t=n.Type.def,r=n.Type.or,{undefined:i}=n.builtInTypes;t("Noop").bases("Statement").build(),t("DoExpression").bases("Expression").build("body").field("body",[t("Statement")]),t("BindExpression").bases("Expression").build("object","callee").field("object",r(t("Expression"),null)).field("callee",t("Expression")),t("ParenthesizedExpression").bases("Expression").build("expression").field("expression",t("Expression")),t("ExportNamespaceSpecifier").bases("Specifier").build("exported").field("exported",t("Identifier")),t("ExportDefaultSpecifier").bases("Specifier").build("exported").field("exported",t("Identifier")),t("CommentBlock").bases("Comment").build("value","leading","trailing"),t("CommentLine").bases("Comment").build("value","leading","trailing"),t("Directive").bases("Node").build("value").field("value",t("DirectiveLiteral")),t("DirectiveLiteral").bases("Node","Expression").build("value").field("value",String,e["use strict"]),t("InterpreterDirective").bases("Node").build("value").field("value",String),t("BlockStatement").bases("Statement").build("body").field("body",[t("Statement")]).field("directives",[t("Directive")],e.emptyArray),t("Program").bases("Node").build("body").field("body",[t("Statement")]).field("directives",[t("Directive")],e.emptyArray).field("interpreter",r(t("InterpreterDirective"),null),e.null);function a(p=String,u){return["extra",{rawValue:p,raw:String},function(){let m=n.getFieldValue(this,"value");return{rawValue:m,raw:u?u(m):String(m)}}]}t("StringLiteral").bases("Literal").build("value").field("value",String).field(...a(String,p=>JSON.stringify(p))),t("NumericLiteral").bases("Literal").build("value").field("value",Number).field("raw",r(String,null),e.null).field(...a(Number)),t("BigIntLiteral").bases("Literal").build("value").field("value",r(String,Number)).field(...a(String,p=>p+"n")),t("DecimalLiteral").bases("Literal").build("value").field("value",String).field(...a(String,p=>p+"m")),t("NullLiteral").bases("Literal").build().field("value",null,e.null),t("BooleanLiteral").bases("Literal").build("value").field("value",Boolean),t("RegExpLiteral").bases("Literal").build("pattern","flags").field("pattern",String).field("flags",String).field("value",RegExp,function(){return new RegExp(this.pattern,this.flags)}).field(...a(r(RegExp,i),p=>`/${p.pattern}/${p.flags||""}`)).field("regex",{pattern:String,flags:String},function(){return{pattern:this.pattern,flags:this.flags}});var o=r(t("Property"),t("ObjectMethod"),t("ObjectProperty"),t("SpreadProperty"),t("SpreadElement"));t("ObjectExpression").bases("Expression").build("properties").field("properties",[o]),t("ObjectMethod").bases("Node","Function").build("kind","key","params","body","computed").field("kind",r("method","get","set")).field("key",r(t("Literal"),t("Identifier"),t("Expression"))).field("params",[t("Pattern")]).field("body",t("BlockStatement")).field("computed",Boolean,e.false).field("generator",Boolean,e.false).field("async",Boolean,e.false).field("accessibility",r(t("Literal"),null),e.null).field("decorators",r([t("Decorator")],null),e.null),t("ObjectProperty").bases("Node").build("key","value").field("key",r(t("Literal"),t("Identifier"),t("Expression"))).field("value",r(t("Expression"),t("Pattern"))).field("accessibility",r(t("Literal"),null),e.null).field("computed",Boolean,e.false);var l=r(t("MethodDefinition"),t("VariableDeclarator"),t("ClassPropertyDefinition"),t("ClassProperty"),t("ClassPrivateProperty"),t("ClassMethod"),t("ClassPrivateMethod"),t("ClassAccessorProperty"),t("StaticBlock"));t("ClassBody").bases("Declaration").build("body").field("body",[l]),t("ClassMethod").bases("Declaration","Function").build("kind","key","params","body","computed","static").field("key",r(t("Literal"),t("Identifier"),t("Expression"))),t("ClassPrivateMethod").bases("Declaration","Function").build("key","params","body","kind","computed","static").field("key",t("PrivateName")),t("ClassAccessorProperty").bases("Declaration").build("key","value","decorators","computed","static").field("key",r(t("Literal"),t("Identifier"),t("PrivateName"),t("Expression"))).field("value",r(t("Expression"),null),e.null),["ClassMethod","ClassPrivateMethod"].forEach(p=>{t(p).field("kind",r("get","set","method","constructor"),()=>"method").field("body",t("BlockStatement")).field("access",r("public","private","protected",null),e.null)}),["ClassMethod","ClassPrivateMethod","ClassAccessorProperty"].forEach(p=>{t(p).field("computed",Boolean,e.false).field("static",Boolean,e.false).field("abstract",Boolean,e.false).field("accessibility",r("public","private","protected",null),e.null).field("decorators",r([t("Decorator")],null),e.null).field("definite",Boolean,e.false).field("optional",Boolean,e.false).field("override",Boolean,e.false).field("readonly",Boolean,e.false)});var c=r(t("Property"),t("PropertyPattern"),t("SpreadPropertyPattern"),t("SpreadProperty"),t("ObjectProperty"),t("RestProperty"),t("RestElement"));t("ObjectPattern").bases("Pattern").build("properties").field("properties",[c]).field("decorators",r([t("Decorator")],null),e.null),t("SpreadProperty").bases("Node").build("argument").field("argument",t("Expression")),t("RestProperty").bases("Node").build("argument").field("argument",t("Expression")),t("ForAwaitStatement").bases("Statement").build("left","right","body").field("left",r(t("VariableDeclaration"),t("Expression"))).field("right",t("Expression")).field("body",t("Statement")),t("Import").bases("Expression").build()}z(()=>module);function ac(s){let e=s.use(J).Type.def;s.use(Hi),s.use(qi),e("V8IntrinsicIdentifier").bases("Expression").build("name").field("name",String),e("TopicReference").bases("Expression").build()}z(()=>module);function oc(s){s.use(Hi),s.use($i);var n=s.use(J),e=n.namedTypes,t=n.Type.def,r=n.Type.or,i=s.use(pe).defaults,a=n.Type.from(function(p,u){return!!(e.StringLiteral&&e.StringLiteral.check(p,u)||e.Literal&&e.Literal.check(p,u)&&typeof p.value=="string")},"StringLiteral");t("TSType").bases("Node");var o=r(t("Identifier"),t("TSQualifiedName"));t("TSTypeReference").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("typeName","typeParameters").field("typeName",o),t("TSHasOptionalTypeParameterInstantiation").field("typeParameters",r(t("TSTypeParameterInstantiation"),null),i.null),t("TSHasOptionalTypeParameters").field("typeParameters",r(t("TSTypeParameterDeclaration"),null,void 0),i.null),t("TSHasOptionalTypeAnnotation").field("typeAnnotation",r(t("TSTypeAnnotation"),null),i.null),t("TSQualifiedName").bases("Node").build("left","right").field("left",o).field("right",o),t("TSAsExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",t("Expression")).field("typeAnnotation",t("TSType")).field("extra",r({parenthesized:Boolean},null),i.null),t("TSTypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",t("Expression")).field("typeAnnotation",t("TSType")),t("TSSatisfiesExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",t("Expression")).field("typeAnnotation",t("TSType")),t("TSNonNullExpression").bases("Expression","Pattern").build("expression").field("expression",t("Expression")),["TSAnyKeyword","TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSObjectKeyword","TSStringKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSUnknownKeyword","TSVoidKeyword","TSIntrinsicKeyword","TSThisType"].forEach(p=>{t(p).bases("TSType").build()}),t("TSArrayType").bases("TSType").build("elementType").field("elementType",t("TSType")),t("TSLiteralType").bases("TSType").build("literal").field("literal",r(t("NumericLiteral"),t("StringLiteral"),t("BooleanLiteral"),t("TemplateLiteral"),t("UnaryExpression"),t("BigIntLiteral"))),t("TemplateLiteral").field("expressions",r([t("Expression")],[t("TSType")])),["TSUnionType","TSIntersectionType"].forEach(p=>{t(p).bases("TSType").build("types").field("types",[t("TSType")])}),t("TSConditionalType").bases("TSType").build("checkType","extendsType","trueType","falseType").field("checkType",t("TSType")).field("extendsType",t("TSType")).field("trueType",t("TSType")).field("falseType",t("TSType")),t("TSInferType").bases("TSType").build("typeParameter").field("typeParameter",t("TSTypeParameter")),t("TSParenthesizedType").bases("TSType").build("typeAnnotation").field("typeAnnotation",t("TSType"));var l=[r(t("Identifier"),t("RestElement"),t("ArrayPattern"),t("ObjectPattern"))];["TSFunctionType","TSConstructorType"].forEach(p=>{t(p).bases("TSType","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters").field("parameters",l)}),t("TSDeclareFunction").bases("Declaration","TSHasOptionalTypeParameters").build("id","params","returnType").field("declare",Boolean,i.false).field("async",Boolean,i.false).field("generator",Boolean,i.false).field("id",r(t("Identifier"),null),i.null).field("params",[t("Pattern")]).field("returnType",r(t("TSTypeAnnotation"),t("Noop"),null),i.null),t("TSDeclareMethod").bases("Declaration","TSHasOptionalTypeParameters").build("key","params","returnType").field("async",Boolean,i.false).field("generator",Boolean,i.false).field("params",[t("Pattern")]).field("abstract",Boolean,i.false).field("accessibility",r("public","private","protected",void 0),i.undefined).field("static",Boolean,i.false).field("computed",Boolean,i.false).field("optional",Boolean,i.false).field("key",r(t("Identifier"),t("StringLiteral"),t("NumericLiteral"),t("Expression"))).field("kind",r("get","set","method","constructor"),function(){return"method"}).field("access",r("public","private","protected",void 0),i.undefined).field("decorators",r([t("Decorator")],null),i.null).field("returnType",r(t("TSTypeAnnotation"),t("Noop"),null),i.null),t("TSMappedType").bases("TSType").build("typeParameter","typeAnnotation").field("readonly",r(Boolean,"+","-"),i.false).field("typeParameter",t("TSTypeParameter")).field("optional",r(Boolean,"+","-"),i.false).field("typeAnnotation",r(t("TSType"),null),i.null),t("TSTupleType").bases("TSType").build("elementTypes").field("elementTypes",[r(t("TSType"),t("TSNamedTupleMember"))]),t("TSNamedTupleMember").bases("TSType").build("label","elementType","optional").field("label",t("Identifier")).field("optional",Boolean,i.false).field("elementType",t("TSType")),t("TSRestType").bases("TSType").build("typeAnnotation").field("typeAnnotation",t("TSType")),t("TSOptionalType").bases("TSType").build("typeAnnotation").field("typeAnnotation",t("TSType")),t("TSIndexedAccessType").bases("TSType").build("objectType","indexType").field("objectType",t("TSType")).field("indexType",t("TSType")),t("TSTypeOperator").bases("TSType").build("operator").field("operator",String).field("typeAnnotation",t("TSType")),t("TSTypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",r(t("TSType"),t("TSTypeAnnotation"))),t("TSIndexSignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",[t("Identifier")]).field("readonly",Boolean,i.false),t("TSPropertySignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("key","typeAnnotation","optional").field("key",t("Expression")).field("computed",Boolean,i.false).field("readonly",Boolean,i.false).field("optional",Boolean,i.false).field("initializer",r(t("Expression"),null),i.null),t("TSMethodSignature").bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("key","parameters","typeAnnotation").field("key",t("Expression")).field("computed",Boolean,i.false).field("optional",Boolean,i.false).field("parameters",l),t("TSTypePredicate").bases("TSTypeAnnotation","TSType").build("parameterName","typeAnnotation","asserts").field("parameterName",r(t("Identifier"),t("TSThisType"))).field("typeAnnotation",r(t("TSTypeAnnotation"),null),i.null).field("asserts",Boolean,i.false),["TSCallSignatureDeclaration","TSConstructSignatureDeclaration"].forEach(p=>{t(p).bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",l)}),t("TSEnumMember").bases("Node").build("id","initializer").field("id",r(t("Identifier"),a)).field("initializer",r(t("Expression"),null),i.null),t("TSTypeQuery").bases("TSType").build("exprName").field("exprName",r(o,t("TSImportType")));var c=r(t("TSCallSignatureDeclaration"),t("TSConstructSignatureDeclaration"),t("TSIndexSignature"),t("TSMethodSignature"),t("TSPropertySignature"));t("TSTypeLiteral").bases("TSType").build("members").field("members",[c]),t("TSTypeParameter").bases("Identifier").build("name","constraint","default").field("name",r(t("Identifier"),String)).field("constraint",r(t("TSType"),void 0),i.undefined).field("default",r(t("TSType"),void 0),i.undefined),t("TSTypeAssertion").bases("Expression","Pattern").build("typeAnnotation","expression").field("typeAnnotation",t("TSType")).field("expression",t("Expression")).field("extra",r({parenthesized:Boolean},null),i.null),t("TSTypeParameterDeclaration").bases("Declaration").build("params").field("params",[t("TSTypeParameter")]),t("TSInstantiationExpression").bases("Expression","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",t("Expression")),t("TSTypeParameterInstantiation").bases("Node").build("params").field("params",[t("TSType")]),t("TSEnumDeclaration").bases("Declaration").build("id","members").field("id",t("Identifier")).field("const",Boolean,i.false).field("declare",Boolean,i.false).field("members",[t("TSEnumMember")]).field("initializer",r(t("Expression"),null),i.null),t("TSTypeAliasDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","typeAnnotation").field("id",t("Identifier")).field("declare",Boolean,i.false).field("typeAnnotation",t("TSType")),t("TSModuleBlock").bases("Node").build("body").field("body",[t("Statement")]),t("TSModuleDeclaration").bases("Declaration").build("id","body").field("id",r(a,o)).field("declare",Boolean,i.false).field("global",Boolean,i.false).field("body",r(t("TSModuleBlock"),t("TSModuleDeclaration"),null),i.null),t("TSImportType").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("argument","qualifier","typeParameters").field("argument",a).field("qualifier",r(o,void 0),i.undefined),t("TSImportEqualsDeclaration").bases("Declaration").build("id","moduleReference").field("id",t("Identifier")).field("isExport",Boolean,i.false).field("moduleReference",r(o,t("TSExternalModuleReference"))),t("TSExternalModuleReference").bases("Declaration").build("expression").field("expression",a),t("TSExportAssignment").bases("Statement").build("expression").field("expression",t("Expression")),t("TSNamespaceExportDeclaration").bases("Declaration").build("id").field("id",t("Identifier")),t("TSInterfaceBody").bases("Node").build("body").field("body",[c]),t("TSExpressionWithTypeArguments").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",o),t("TSInterfaceDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","body").field("id",o).field("declare",Boolean,i.false).field("extends",r([t("TSExpressionWithTypeArguments")],null),i.null).field("body",t("TSInterfaceBody")),t("TSParameterProperty").bases("Pattern").build("parameter").field("accessibility",r("public","private","protected",void 0),i.undefined).field("readonly",Boolean,i.false).field("parameter",r(t("Identifier"),t("AssignmentPattern"))),t("ClassProperty").field("access",r("public","private","protected",void 0),i.undefined),t("ClassAccessorProperty").bases("Declaration","TSHasOptionalTypeAnnotation"),t("ClassBody").field("body",[r(t("MethodDefinition"),t("VariableDeclarator"),t("ClassPropertyDefinition"),t("ClassProperty"),t("ClassPrivateProperty"),t("ClassAccessorProperty"),t("ClassMethod"),t("ClassPrivateMethod"),t("StaticBlock"),t("TSDeclareMethod"),c)])}z(()=>module);var we;we||(we={});var{astNodesAreEquivalent:Mu,builders:Yt,builtInTypes:Ce,defineMethod:Du,eachField:Lu,finalize:Ou,getBuilderName:Fu,getFieldNames:lc,getFieldValue:Re,getSupertypeNames:Uu,namedTypes:cc,NodePath:pc,Path:_u,PathVisitor:Bu,someField:uc,Type:Ru,use:ju,visit:Vu}=Wl([Qt,sc,qi,ic,ac,oc]);Object.assign(we,cc);var Sn=we,Ti=Bn.default.SourceMapConsumer,dc=Bn.default.SourceMapGenerator,Wi=Object.prototype.hasOwnProperty;function hc(){return`
|
|
9087
|
+
`}function wi(s,n,e){return s&&Wi.call(s,n)?s[n]:e}function fc(...s){let n={},e=s.length;for(let t=0;t<e;++t){let r=Object.keys(s[t]),i=r.length;for(let a=0;a<i;++a)n[r[a]]=!0}return n}function j(s,n){return s.line-n.line||s.column-n.column}function We(s){return{line:s.line,column:s.column}}function mc(s,n){if(s){if(!n)return s}else return n||null;let e=new Ti(s),t=new Ti(n),r=new dc({file:n.file,sourceRoot:n.sourceRoot}),i={};return t.eachMapping(function(a){let o=e.originalPositionFor({line:a.originalLine,column:a.originalColumn}),l=o.source;if(l===null)return;r.addMapping({source:l,original:We(o),generated:{line:a.generatedLine,column:a.generatedColumn},name:a.name});let c=e.sourceContentFor(l);c&&!Wi.call(i,l)&&(i[l]=c,r.setSourceContent(l,c))}),r.toJSON()}function Gi(s,n){if(!s.loc)return null;let e={start:s.loc.start,end:s.loc.end};function t(r){Jr(e,r.loc)}return s.declaration&&s.declaration.decorators&&Rn(s)&&s.declaration.decorators.forEach(t),j(e.start,e.end)<0&&(e.start=We(e.start),n.skipSpaces(e.start,!1,!0),j(e.start,e.end)<0&&(e.end=We(e.end),n.skipSpaces(e.end,!0,!0))),s.comments&&s.comments.forEach(t),e}function Jr(s,n){s&&n&&(j(n.start,s.start)<0&&(s.start=n.start),j(s.end,n.end)<0&&(s.end=n.end))}function is(s,n){let e=s.loc;if(e&&(e.start.line<1&&(e.start.line=1),e.end.line<1&&(e.end.line=1)),s.type==="File"&&(e.start=n.firstPos(),e.end=n.lastPos()),bc(s,n),gc(s,n),e&&s.decorators)s.decorators.forEach(function(t){Jr(e,t.loc)});else if(s.declaration&&Rn(s)){s.declaration.loc=null;let t=s.declaration.decorators;t&&t.forEach(function(r){Jr(e,r.loc)})}else if(Sn.MethodDefinition&&Sn.MethodDefinition.check(s)||Sn.Property.check(s)&&(s.method||s.shorthand))s.value.loc=null,Sn.FunctionExpression.check(s.value)&&(s.value.id=null);else if(s.type==="ObjectTypeProperty"){let t=s.loc,r=t&&t.end;r&&(r=We(r),n.prevPos(r)&&n.charAt(r)===","&&(r=n.skipSpaces(r,!0,!0))&&(t.end=r))}}function bc(s,n){if(s.type!=="ForStatement")return;function e(t){let r=t&&t.loc,i=r&&r.start,a=r&&We(r.end);for(;i&&a&&j(i,a)<0&&(n.prevPos(a),n.charAt(a)===";");)r.end.line=a.line,r.end.column=a.column}e(s.init),e(s.test),e(s.update)}function gc(s,n){if(s.type==="TemplateLiteral"&&s.quasis.length!==0){if(s.loc){let e=We(s.loc.start),t=s.quasis[0];j(t.loc.start,e)<0&&(t.loc.start=e);let r=We(s.loc.end),i=s.quasis[s.quasis.length-1];j(r,i.loc.end)<0&&(i.loc.end=r)}s.expressions.forEach(function(e,t){let r=n.skipSpaces(e.loc.start,!0,!1);if(n.prevPos(r)&&n.charAt(r)==="{"&&n.prevPos(r)&&n.charAt(r)==="$"){let a=s.quasis[t];j(r,a.loc.end)<0&&(a.loc.end=r)}let i=n.skipSpaces(e.loc.end,!1,!1);if(n.charAt(i)==="}"){let a=s.quasis[t+1];j(a.loc.start,i)<0&&(a.loc.start=i)}})}}function Rn(s){if(s)switch(s.type){case"ExportDeclaration":case"ExportDefaultDeclaration":case"ExportDefaultSpecifier":case"DeclareExportDeclaration":case"ExportNamedDeclaration":case"ExportAllDeclaration":return!0}return!1}function Ki(s){let n=s.getParentNode();return s.getName()==="declaration"&&Rn(n)?n:null}function Wt(s,n){let e=s.trailingComma;return typeof e=="object"?!!e[n]:!!e}var Xr={tabWidth:4,useTabs:!1,reuseWhitespace:!0,lineTerminator:hc(),wrapColumn:74,sourceFileName:null,sourceMapName:null,sourceRoot:null,inputSourceMap:null,range:!1,tolerant:!0,quote:null,trailingComma:!1,arrayBracketSpacing:!1,objectCurlySpacing:!0,arrowParensAlways:!1,flowObjectCommas:!0,tokens:!0},yc=Xr.hasOwnProperty;function jn(s){let n=s||Xr;function e(t){return yc.call(n,t)?n[t]:Xr[t]}return{tabWidth:+e("tabWidth"),useTabs:!!e("useTabs"),reuseWhitespace:!!e("reuseWhitespace"),lineTerminator:e("lineTerminator"),wrapColumn:Math.max(e("wrapColumn"),0),sourceFileName:e("sourceFileName"),sourceMapName:e("sourceMapName"),sourceRoot:e("sourceRoot"),inputSourceMap:e("inputSourceMap"),parser:e("esprima")||e("parser"),range:e("range"),tolerant:e("tolerant"),quote:e("quote"),trailingComma:e("trailingComma"),arrayBracketSpacing:e("arrayBracketSpacing"),objectCurlySpacing:e("objectCurlySpacing"),arrowParensAlways:e("arrowParensAlways"),flowObjectCommas:e("flowObjectCommas"),tokens:!!e("tokens")}}var Qr=class s{constructor(n,e,t=e){this.sourceLines=n,this.sourceLoc=e,this.targetLoc=t}slice(n,e,t=n.lastPos()){let r=this.sourceLines,i=this.sourceLoc,a=this.targetLoc;function o(l){let c=i[l],p=a[l],u=e;return l==="end"&&(u=t),vc(r,c,n,p,u)}if(j(e,a.start)<=0)if(j(a.end,t)<=0)a={start:He(a.start,e.line,e.column),end:He(a.end,e.line,e.column)};else{if(j(t,a.start)<=0)return null;i={start:i.start,end:o("end")},a={start:He(a.start,e.line,e.column),end:He(t,e.line,e.column)}}else{if(j(a.end,e)<=0)return null;j(a.end,t)<=0?(i={start:o("start"),end:i.end},a={start:{line:1,column:0},end:He(a.end,e.line,e.column)}):(i={start:o("start"),end:o("end")},a={start:{line:1,column:0},end:He(t,e.line,e.column)})}return new s(this.sourceLines,i,a)}add(n,e){return new s(this.sourceLines,this.sourceLoc,{start:Ci(this.targetLoc.start,n,e),end:Ci(this.targetLoc.end,n,e)})}subtract(n,e){return new s(this.sourceLines,this.sourceLoc,{start:He(this.targetLoc.start,n,e),end:He(this.targetLoc.end,n,e)})}indent(n,e=!1,t=!1){if(n===0)return this;let r=this.targetLoc,i=r.start.line,a=r.end.line;if(e&&i===1&&a===1)return this;if(r={start:r.start,end:r.end},!e||i>1){let o=r.start.column+n;r.start={line:i,column:t?Math.max(0,o):o}}if(!e||a>1){let o=r.end.column+n;r.end={line:a,column:t?Math.max(0,o):o}}return new s(this.sourceLines,this.sourceLoc,r)}};function Ci(s,n,e){return{line:s.line+n-1,column:s.line===1?s.column+e:s.column}}function He(s,n,e){return{line:s.line-n+1,column:s.line===n?s.column-e:s.column}}function vc(s,n,e,t,r){let i=j(t,r);if(i===0)return n;let a,o;if(i<0){a=s.skipSpaces(n)||s.lastPos(),o=e.skipSpaces(t)||e.lastPos();let l=r.line-o.line;for(a.line+=l,o.line+=l,l>0&&(a.column=0,o.column=0);j(o,r)<0&&e.nextPos(o,!0););}else{a=s.skipSpaces(n,!0)||s.firstPos(),o=e.skipSpaces(t,!0)||e.firstPos();let l=r.line-o.line;for(a.line+=l,o.line+=l,l<0&&(a.column=s.getLineLength(a.line),o.column=e.getLineLength(o.line));j(r,o)<0&&e.prevPos(o,!0););}return a}var xc=Object.defineProperty,Pc=(s,n,e)=>n in s?xc(s,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[n]=e,Rt=(s,n,e)=>(Pc(s,typeof n!="symbol"?n+"":n,e),e),yt=class s{constructor(n,e=null){this.infos=n,Rt(this,"length"),Rt(this,"name"),Rt(this,"mappings",[]),Rt(this,"cachedSourceMap",null),Rt(this,"cachedTabWidth"),this.length=n.length,this.name=e||null,this.name&&this.mappings.push(new Qr(this,{start:this.firstPos(),end:this.lastPos()}))}toString(n){return this.sliceString(this.firstPos(),this.lastPos(),n)}getSourceMap(n,e){if(!n)return null;let t=this;function r(o){return o=o||{},o.file=n,e&&(o.sourceRoot=e),o}if(t.cachedSourceMap)return r(t.cachedSourceMap.toJSON());let i=new Bn.default.SourceMapGenerator(r()),a={};return t.mappings.forEach(function(o){let l=o.sourceLines.skipSpaces(o.sourceLoc.start)||o.sourceLines.lastPos(),c=t.skipSpaces(o.targetLoc.start)||t.lastPos();for(;j(l,o.sourceLoc.end)<0&&j(c,o.targetLoc.end)<0;){o.sourceLines.charAt(l),t.charAt(c);let p=o.sourceLines.name;if(i.addMapping({source:p,original:{line:l.line,column:l.column},generated:{line:c.line,column:c.column}}),!Yr.call(a,p)){let u=o.sourceLines.toString();i.setSourceContent(p,u),a[p]=u}t.nextPos(c,!0),o.sourceLines.nextPos(l,!0)}}),t.cachedSourceMap=i,i.toJSON()}bootstrapCharAt(n){let e=n.line,t=n.column,r=this.toString().split(Zr),i=r[e-1];return typeof i>"u"?"":t===i.length&&e<r.length?`
|
|
8847
9088
|
`:t>=i.length?"":i.charAt(t)}charAt(n){let e=n.line,t=n.column,r=this,i=r.infos,a=i[e-1],o=t;if(typeof a>"u"||o<0)return"";let l=this.getIndentAt(e);return o<l?" ":(o+=a.sliceStart-l,o===a.sliceEnd&&e<this.length?`
|
|
8848
9089
|
`:o>=a.sliceEnd?"":a.line.charAt(o))}stripMargin(n,e){if(n===0)return this;if(e&&this.length===1)return this;let t=new s(this.infos.map(function(r,i){return r.line&&(i>0||!e)&&(r={...r,indent:Math.max(0,r.indent-n)}),r}));if(this.mappings.length>0){let r=t.mappings;this.mappings.forEach(function(i){r.push(i.indent(n,e,!0))})}return t}indent(n){if(n===0)return this;let e=new s(this.infos.map(function(t){return t.line&&!t.locked&&(t={...t,indent:t.indent+n}),t}));if(this.mappings.length>0){let t=e.mappings;this.mappings.forEach(function(r){t.push(r.indent(n))})}return e}indentTail(n){if(n===0)return this;if(this.length<2)return this;let e=new s(this.infos.map(function(t,r){return r>0&&t.line&&!t.locked&&(t={...t,indent:t.indent+n}),t}));if(this.mappings.length>0){let t=e.mappings;this.mappings.forEach(function(r){t.push(r.indent(n,!0))})}return e}lockIndentTail(){return this.length<2?this:new s(this.infos.map((n,e)=>({...n,locked:e>0})))}getIndentAt(n){return Math.max(this.infos[n-1].indent,0)}guessTabWidth(){if(typeof this.cachedTabWidth=="number")return this.cachedTabWidth;let n=[],e=0;for(let i=1,a=this.length;i<=a;++i){let o=this.infos[i-1],l=o.line.slice(o.sliceStart,o.sliceEnd);if(ft(l))continue;let c=Math.abs(o.indent-e);n[c]=~~n[c]+1,e=o.indent}let t=-1,r=2;for(let i=1;i<n.length;i+=1)Yr.call(n,i)&&n[i]>t&&(t=n[i],r=i);return this.cachedTabWidth=r}startsWithComment(){if(this.infos.length===0)return!1;let n=this.infos[0],e=n.sliceStart,t=n.sliceEnd,r=n.line.slice(e,t).trim();return r.length===0||r.slice(0,2)==="//"||r.slice(0,2)==="/*"}isOnlyWhitespace(){return ft(this.toString())}isPrecededOnlyByWhitespace(n){let e=this.infos[n.line-1],t=Math.max(e.indent,0),r=n.column-t;if(r<=0)return!0;let i=e.sliceStart,a=Math.min(i+r,e.sliceEnd),o=e.line.slice(i,a);return ft(o)}getLineLength(n){let e=this.infos[n-1];return this.getIndentAt(n)+e.sliceEnd-e.sliceStart}nextPos(n,e=!1){let t=Math.max(n.line,0);return Math.max(n.column,0)<this.getLineLength(t)?(n.column+=1,e?!!this.skipSpaces(n,!1,!0):!0):t<this.length?(n.line+=1,n.column=0,e?!!this.skipSpaces(n,!1,!0):!0):!1}prevPos(n,e=!1){let t=n.line,r=n.column;if(r<1){if(t-=1,t<1)return!1;r=this.getLineLength(t)}else r=Math.min(r-1,this.getLineLength(t));return n.line=t,n.column=r,e?!!this.skipSpaces(n,!0,!0):!0}firstPos(){return{line:1,column:0}}lastPos(){return{line:this.length,column:this.getLineLength(this.length)}}skipSpaces(n,e=!1,t=!1){if(n?n=t?n:{line:n.line,column:n.column}:e?n=this.lastPos():n=this.firstPos(),e){for(;this.prevPos(n);)if(!ft(this.charAt(n))&&this.nextPos(n))return n;return null}else{for(;ft(this.charAt(n));)if(!this.nextPos(n))return null;return n}}trimLeft(){let n=this.skipSpaces(this.firstPos(),!1,!0);return n?this.slice(n):Ze}trimRight(){let n=this.skipSpaces(this.lastPos(),!0,!0);return n?this.slice(this.firstPos(),n):Ze}trim(){let n=this.skipSpaces(this.firstPos(),!1,!0);if(n===null)return Ze;let e=this.skipSpaces(this.lastPos(),!0,!0);return e===null?Ze:this.slice(n,e)}eachPos(n,e=this.firstPos(),t=!1){let r=this.firstPos();if(e&&(r.line=e.line,r.column=e.column),!(t&&!this.skipSpaces(r,!1,!0)))do n.call(this,r);while(this.nextPos(r,t))}bootstrapSlice(n,e){let t=this.toString().split(Zr).slice(n.line-1,e.line);return t.length>0&&(t.push(t.pop().slice(0,e.column)),t[0]=t[0].slice(n.column)),T(t.join(`
|
|
8849
|
-
`))}slice(n,e){if(!e){if(!n)return this;e=this.lastPos()}if(!n)throw new Error("cannot slice with end but not start");let t=this.infos.slice(n.line-1,e.line);n.line===e.line?t[0]=mt(t[0],n.column,e.column):(t[0]=mt(t[0],n.column),t.push(mt(t.pop(),0,e.column)));let r=new s(t);if(this.mappings.length>0){let i=r.mappings;this.mappings.forEach(function(a){let o=a.slice(this,n,e);o&&i.push(o)},this)}return r}bootstrapSliceString(n,e,t){return this.slice(n,e).toString(t)}sliceString(n=this.firstPos(),e=this.lastPos(),t){let{tabWidth:r,useTabs:i,reuseWhitespace:a,lineTerminator:o}=jn(t),l=[];for(let c=n.line;c<=e.line;++c){let p=this.infos[c-1];c===n.line?c===e.line?p=mt(p,n.column,e.column):p=mt(p,n.column):c===e.line&&(p=mt(p,0,e.column));let u=Math.max(p.indent,0),h=p.line.slice(0,p.sliceStart);if(a&&ft(h)&&Ji(h,r)===u){l.push(p.line.slice(0,p.sliceEnd));continue}let m=0,d=u;i&&(m=Math.floor(u/r),d-=m*r);let
|
|
8850
|
-
`);else if(r instanceof
|
|
9090
|
+
`))}slice(n,e){if(!e){if(!n)return this;e=this.lastPos()}if(!n)throw new Error("cannot slice with end but not start");let t=this.infos.slice(n.line-1,e.line);n.line===e.line?t[0]=mt(t[0],n.column,e.column):(t[0]=mt(t[0],n.column),t.push(mt(t.pop(),0,e.column)));let r=new s(t);if(this.mappings.length>0){let i=r.mappings;this.mappings.forEach(function(a){let o=a.slice(this,n,e);o&&i.push(o)},this)}return r}bootstrapSliceString(n,e,t){return this.slice(n,e).toString(t)}sliceString(n=this.firstPos(),e=this.lastPos(),t){let{tabWidth:r,useTabs:i,reuseWhitespace:a,lineTerminator:o}=jn(t),l=[];for(let c=n.line;c<=e.line;++c){let p=this.infos[c-1];c===n.line?c===e.line?p=mt(p,n.column,e.column):p=mt(p,n.column):c===e.line&&(p=mt(p,0,e.column));let u=Math.max(p.indent,0),h=p.line.slice(0,p.sliceStart);if(a&&ft(h)&&Ji(h,r)===u){l.push(p.line.slice(0,p.sliceEnd));continue}let m=0,d=u;i&&(m=Math.floor(u/r),d-=m*r);let g="";m>0&&(g+=new Array(m+1).join(" ")),d>0&&(g+=new Array(d+1).join(" ")),g+=p.line.slice(p.sliceStart,p.sliceEnd),l.push(g)}return l.join(o)}isEmpty(){return this.length<2&&this.getLineLength(1)<1}join(n){let e=this,t=[],r=[],i;function a(c){if(c!==null){if(i){let p=c.infos[0],u=new Array(p.indent+1).join(" "),h=t.length,m=Math.max(i.indent,0)+i.sliceEnd-i.sliceStart;i.line=i.line.slice(0,i.sliceEnd)+u+p.line.slice(p.sliceStart,p.sliceEnd),i.locked=i.locked||p.locked,i.sliceEnd=i.line.length,c.mappings.length>0&&c.mappings.forEach(function(d){r.push(d.add(h,m))})}else c.mappings.length>0&&r.push.apply(r,c.mappings);c.infos.forEach(function(p,u){(!i||u>0)&&(i={...p},t.push(i))})}}function o(c,p){p>0&&a(e),a(c)}if(n.map(function(c){let p=T(c);return p.isEmpty()?null:p}).forEach((c,p)=>{e.isEmpty()?a(c):o(c,p)}),t.length<1)return Ze;let l=new s(t);return l.mappings=r,l}concat(...n){let e=[this];return e.push.apply(e,n),Ze.join(e)}},kn={},Yr=kn.hasOwnProperty,Tc=10;function Ji(s,n){let e=0,t=s.length;for(let r=0;r<t;++r)switch(s.charCodeAt(r)){case 9:{let i=Math.ceil(e/n)*n;i===e?e+=n:e=i;break}case 11:case 12:case 13:case 65279:break;case 32:default:e+=1;break}return e}var wc=/^\s*/,Zr=/\u000D\u000A|\u000D(?!\u000A)|\u000A|\u2028|\u2029/;function T(s,n){if(s instanceof yt)return s;s+="";let e=n&&n.tabWidth,t=s.indexOf(" ")<0,r=!n&&t&&s.length<=Tc;if(r&&Yr.call(kn,s))return kn[s];let i=new yt(s.split(Zr).map(function(a){let o=wc.exec(a)[0];return{line:a,indent:Ji(o,e),locked:!1,sliceStart:o.length,sliceEnd:a.length}}),jn(n).sourceFileName);return r&&(kn[s]=i),i}function ft(s){return!/\S/.test(s)}function mt(s,n,e){let t=s.sliceStart,r=s.sliceEnd,i=Math.max(s.indent,0),a=i+r-t;return typeof e>"u"&&(e=a),n=Math.max(n,0),e=Math.min(e,a),e=Math.max(e,n),e<i?(i=e,r=t):r-=a-e,a=e,a-=n,n<i?i-=n:(n-=i,i=0,t+=n),s.indent===i&&s.sliceStart===t&&s.sliceEnd===r?s:{line:s.line,indent:i,locked:!1,sliceStart:t,sliceEnd:r}}function y(s){return Ze.join(s)}var Ze=T(""),vt=we,Xi=Ce.array,Cc=Ce.object,Si=new WeakMap;function Qi(s,n,e){if(!s)return e;if(is(s,n),e){if(vt.Node.check(s)&&vt.SourceLocation.check(s.loc)){let r=e.length-1;for(;r>=0;--r){let i=e[r];if(i&&i.loc&&j(i.loc.end,s.loc.start)<=0)break}return e.splice(r+1,0,s),e}}else{let r=Si.get(s);if(r)return r}let t;if(Xi.check(s))t=Object.keys(s);else if(Cc.check(s))t=lc(s);else return e;e||Si.set(s,e=[]);for(let r=0,i=t.length;r<i;++r)Qi(s[t[r]],n,e);return e}function Yi(s,n,e){let t=Qi(s,e),r=0,i=t&&t.length,a,o;for(;typeof i=="number"&&r<i;){let l=r+i>>1,c=t[l];if(j(c.loc.start,n.loc.start)<=0&&j(n.loc.end,c.loc.end)<=0){Yi(n.enclosingNode=c,n,e);return}if(j(c.loc.end,n.loc.start)<=0){a=c,r=l+1;continue}if(j(n.loc.end,c.loc.start)<=0){o=c,i=l;continue}throw new Error("Comment location overlaps with node location")}a&&(n.precedingNode=a),o&&(n.followingNode=o)}function Sc(s,n,e){if(!Xi.check(s))return;let t=[];s.forEach(function(r){r.loc.lines=e,Yi(n,r,e);let i=r.precedingNode,a=r.enclosingNode,o=r.followingNode;if(i&&o){let l=t.length;l>0&&t[l-1].followingNode!==r.followingNode&&jt(t,e),t.push(r)}else if(i)jt(t,e),ea(i,r);else if(o)jt(t,e),Zi(o,r);else if(a)jt(t,e),Ic(a,r);else throw new Error("AST contains no nodes at all?")}),jt(t,e),s.forEach(function(r){delete r.precedingNode,delete r.enclosingNode,delete r.followingNode})}function jt(s,n){let e=s.length;if(e===0)return;let t=s[0].precedingNode,r=s[0].followingNode,i=r.loc.start,a=e,o;for(;a>0;--a){o=s[a-1];let l=n.sliceString(o.loc.end,i);if(/\S/.test(l))break;i=o.loc.start}for(;a<=e&&(o=s[a])&&(o.type==="Line"||o.type==="CommentLine")&&o.loc.start.column>r.loc.start.column;)++a;if(a){let{enclosingNode:l}=s[a-1];l?.type==="CallExpression"&&--a}s.forEach(function(l,c){c<a?ea(t,l):Zi(r,l)}),s.length=0}function as(s,n){(s.comments||(s.comments=[])).push(n)}function Zi(s,n){n.leading=!0,n.trailing=!1,as(s,n)}function Ic(s,n){n.leading=!1,n.trailing=!1,as(s,n)}function ea(s,n){n.leading=!1,n.trailing=!0,as(s,n)}function Ec(s,n){let e=s.getValue();vt.Comment.assert(e);let t=e.loc,r=t&&t.lines,i=[n(s)];if(e.trailing)i.push(`
|
|
9091
|
+
`);else if(r instanceof yt){let a=r.slice(t.end,r.skipSpaces(t.end)||r.lastPos());a.length===1?i.push(a):i.push(new Array(a.length).join(`
|
|
8851
9092
|
`))}else i.push(`
|
|
8852
|
-
`);return
|
|
8853
|
-
`))}return i.push(n(s)),g(i)}function Ei(s,n){let e=s.getValue(),t=n(s),r=vt.Node.check(e)&&Re(e,"comments");if(!r||r.length===0)return t;let i=[],a=[t];return s.each(function(o){let l=o.getValue(),c=Re(l,"leading"),p=Re(l,"trailing");c||p&&!(vt.Statement.check(e)||l.type==="Block"||l.type==="CommentBlock")?i.push(Ic(o,n)):p&&a.push(Ac(o,n))},"comments"),i.push.apply(i,a),g(i)}var kc=Yt,Nc=Ce.object,Mc=Ce.array;function Dc(s,n){n=jn(n);let e=T(s,n),t=e.toString({tabWidth:n.tabWidth,reuseWhitespace:!1,useTabs:!1}),r=[],i=n.parser.parse(t,{jsx:!0,loc:!0,locations:!0,range:n.range,comment:!0,onComment:r,tolerant:wi(n,"tolerant",!0),ecmaVersion:6,sourceType:wi(n,"sourceType","module")}),a=Array.isArray(i.tokens)?i.tokens:!1;delete i.tokens,a.forEach(function(p){typeof p.value!="string"&&(p.value=e.sliceString(p.loc.start,p.loc.end))}),Array.isArray(i.comments)&&(r=i.comments,delete i.comments),i.loc?is(i,e):i.loc={start:e.firstPos(),end:e.lastPos()},i.loc.lines=e,i.loc.indent=0;let o,l;i.type==="Program"?(l=i,o=kc.file(i,n.sourceFileName||null),o.loc={start:e.firstPos(),end:e.lastPos(),lines:e,indent:0}):i.type==="File"&&(o=i,l=o.program),n.tokens&&(o.tokens=a);let c=Gi({type:l.type,loc:l.loc,body:[],comments:r},e);return l.loc.start=c.start,l.loc.end=c.end,Sc(r,l.body.length?o.program:o,e),new ta(e,a).copy(o)}var ta=function(n,e){this.lines=n,this.tokens=e,this.startTokenIndex=0,this.endTokenIndex=e.length,this.indent=0,this.seen=new Map},na=ta.prototype;na.copy=function(s){if(this.seen.has(s))return this.seen.get(s);if(Mc.check(s)){let c=new Array(s.length);return this.seen.set(s,c),s.forEach(function(p,u){c[u]=this.copy(p)},this),c}if(!Nc.check(s))return s;is(s,this.lines);let n=Object.create(Object.getPrototypeOf(s),{original:{value:s,configurable:!1,enumerable:!1,writable:!0}});this.seen.set(s,n);let e=s.loc,t=this.indent,r=t,i=this.startTokenIndex,a=this.endTokenIndex;e&&((s.type==="Block"||s.type==="Line"||s.type==="CommentBlock"||s.type==="CommentLine"||this.lines.isPrecededOnlyByWhitespace(e.start))&&(r=this.indent=e.start.column),e.lines=this.lines,e.tokens=this.tokens,e.indent=r,this.findTokenRange(e));let o=Object.keys(s),l=o.length;for(let c=0;c<l;++c){let p=o[c];p==="loc"||p==="tokens"&&s.type==="File"?n[p]=s[p]:n[p]=this.copy(s[p])}return this.indent=t,this.startTokenIndex=i,this.endTokenIndex=a,n};na.findTokenRange=function(s){for(;this.startTokenIndex>0;){let n=s.tokens[this.startTokenIndex];if(j(s.start,n.loc.start)<0)--this.startTokenIndex;else break}for(;this.endTokenIndex<s.tokens.length;){let n=s.tokens[this.endTokenIndex];if(j(n.loc.end,s.end)<0)++this.endTokenIndex;else break}for(;this.startTokenIndex<this.endTokenIndex;){let n=s.tokens[this.startTokenIndex];if(j(n.loc.start,s.start)<0)++this.startTokenIndex;else break}for(s.start.token=this.startTokenIndex;this.endTokenIndex>this.startTokenIndex;){let n=s.tokens[this.endTokenIndex-1];if(j(s.end,n.loc.end)<0)--this.endTokenIndex;else break}s.end.token=this.endTokenIndex};var G=we,Lc=Ce.array,Oc=Ce.number,es={};[["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]].forEach(function(s,n){s.forEach(function(e){es[e]=n})});var Te=function(n){this.stack=[n]},ne=Te.prototype;Te.from=function(s){if(s instanceof Te)return s.copy();if(s instanceof pc){let n=Object.create(Te.prototype),e=[s.value];for(let t;t=s.parentPath;s=t)e.push(s.name,t.value);return n.stack=e.reverse(),n}return new Te(s)};ne.copy=function(){let n=Object.create(Te.prototype);return n.stack=this.stack.slice(0),n};ne.getName=function(){let n=this.stack,e=n.length;return e>1?n[e-2]:null};ne.getValue=function(){let n=this.stack;return n[n.length-1]};ne.valueIsDuplicate=function(){let s=this.stack,n=s.length-1;return s.lastIndexOf(s[n],n-1)>=0};function ra(s,n){let e=s.stack;for(let t=e.length-1;t>=0;t-=2){let r=e[t];if(G.Node.check(r)&&--n<0)return r}return null}ne.getNode=function(n=0){return ra(this,~~n)};ne.getParentNode=function(n=0){return ra(this,~~n+1)};ne.getRootValue=function(){let n=this.stack;return n.length%2===0?n[1]:n[0]};ne.call=function(n){let e=this.stack,t=e.length,r=e[t-1],i=arguments.length;for(let o=1;o<i;++o){let l=arguments[o];r=r[l],e.push(l,r)}let a=n(this);return e.length=t,a};ne.each=function(n){let e=this.stack,t=e.length,r=e[t-1],i=arguments.length;for(let a=1;a<i;++a){let o=arguments[a];r=r[o],e.push(o,r)}for(let a=0;a<r.length;++a)a in r&&(e.push(a,r[a]),n(this),e.length-=2);e.length=t};ne.map=function(n){let e=this.stack,t=e.length,r=e[t-1],i=arguments.length;for(let o=1;o<i;++o){let l=arguments[o];r=r[l],e.push(l,r)}let a=new Array(r.length);for(let o=0;o<r.length;++o)o in r&&(e.push(o,r[o]),a[o]=n(this,o),e.length-=2);return e.length=t,a};ne.hasParens=function(){let s=this.getNode(),n=this.getPrevToken(s);if(!n)return!1;let e=this.getNextToken(s);return e?!!(n.value==="("&&(e.value===")"||!this.canBeFirstInStatement()&&this.firstInStatement()&&!this.needsParens(!0))):!1};ne.getPrevToken=function(s){s=s||this.getNode();let n=s&&s.loc,e=n&&n.tokens;if(e&&n.start.token>0){let t=e[n.start.token-1];if(t){let r=this.getRootValue().loc;if(j(r.start,t.loc.start)<=0)return t}}return null};ne.getNextToken=function(s){s=s||this.getNode();let n=s&&s.loc,e=n&&n.tokens;if(e&&n.end.token<e.length){let t=e[n.end.token];if(t){let r=this.getRootValue().loc;if(j(t.loc.end,r.end)<=0)return t}}return null};ne.needsParens=function(s){let n=this.getNode();if(n.type==="AssignmentExpression"&&n.left.type==="ObjectPattern")return!0;let e=this.getParentNode(),t=this.getName();if(this.getValue()!==n||G.Statement.check(n)||n.type==="Identifier"||e&&e.type==="ParenthesizedExpression")return!1;if(n.extra&&n.extra.parenthesized)return!0;if(!e)return!1;if(n.type==="UnaryExpression"&&e.type==="BinaryExpression"&&t==="left"&&e.left===n&&e.operator==="**")return!0;switch(n.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return e.type==="MemberExpression"&&t==="object"&&e.object===n;case"BinaryExpression":case"LogicalExpression":switch(e.type){case"CallExpression":return t==="callee"&&e.callee===n;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return t==="object"&&e.object===n;case"BinaryExpression":case"LogicalExpression":{let r=e.operator,i=es[r],a=n.operator,o=es[a];if(i>o||i===o&&t==="right")return!0;break}default:return!1}break;case"SequenceExpression":switch(e.type){case"ReturnStatement":return!1;case"ForStatement":return!1;case"ExpressionStatement":return t!=="expression";default:return!0}case"OptionalIndexedAccessType":return n.optional&&e.type==="IndexedAccessType";case"IntersectionTypeAnnotation":case"UnionTypeAnnotation":return e.type==="NullableTypeAnnotation";case"Literal":return e.type==="MemberExpression"&&Oc.check(n.value)&&t==="object"&&e.object===n;case"NumericLiteral":return e.type==="MemberExpression"&&t==="object"&&e.object===n;case"YieldExpression":case"AwaitExpression":case"AssignmentExpression":case"ConditionalExpression":switch(e.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":case"NewExpression":return t==="callee"&&e.callee===n;case"ConditionalExpression":return t==="test"&&e.test===n;case"MemberExpression":return t==="object"&&e.object===n;default:return!1}case"ArrowFunctionExpression":return G.CallExpression.check(e)&&t==="callee"&&e.callee===n||G.MemberExpression.check(e)&&t==="object"&&e.object===n||G.TSAsExpression&&G.TSAsExpression.check(e)&&t==="expression"&&e.expression===n?!0:sa(e);case"ObjectExpression":if(e.type==="ArrowFunctionExpression"&&t==="body"&&e.body===n)return!0;break;case"TSAsExpression":if(e.type==="ArrowFunctionExpression"&&t==="body"&&e.body===n&&n.expression.type==="ObjectExpression")return!0;break;case"CallExpression":if(t==="declaration"&&G.ExportDefaultDeclaration.check(e)&&G.FunctionExpression.check(n.callee))return!0}return e.type==="NewExpression"&&t==="callee"&&e.callee===n?ts(n):!!(s!==!0&&!this.canBeFirstInStatement()&&this.firstInStatement())};function sa(s){return G.BinaryExpression.check(s)||G.LogicalExpression.check(s)}function ts(s){return G.CallExpression.check(s)?!0:Lc.check(s)?s.some(ts):G.Node.check(s)?uc(s,(n,e)=>ts(e)):!1}ne.canBeFirstInStatement=function(){let s=this.getNode();return!(G.FunctionExpression.check(s)||G.ObjectExpression.check(s)||G.ClassExpression.check(s))};ne.firstInStatement=function(){let s=this.stack,n,e,t,r;for(let i=s.length-1;i>=0;i-=2)if(G.Node.check(s[i])&&(t=n,r=e,n=s[i-1],e=s[i]),!(!e||!r)){if(G.BlockStatement.check(e)&&n==="body"&&t===0||G.ExpressionStatement.check(e)&&t==="expression"||G.AssignmentExpression.check(e)&&t==="left"||G.ArrowFunctionExpression.check(e)&&t==="body")return!0;if(!(G.SequenceExpression.check(e)&&s[i+1]==="expressions"&&t===0)&&!(G.CallExpression.check(e)&&t==="callee")&&!(G.MemberExpression.check(e)&&t==="object")&&!(G.ConditionalExpression.check(e)&&t==="test")&&!(sa(e)&&t==="left")&&!(G.UnaryExpression.check(e)&&!e.prefix&&t==="argument"))return!1}return!0};var Kt=we.Printable,Ii=we.Expression,Fc=we.ReturnStatement,_c=we.SourceLocation,Jt=Ce.object,ns=Ce.array,Uc=Ce.string,_n=/[0-9a-z_$]/i,ia=function(n){let e=this,t=[];e.replace=function(r,i){Uc.check(i)&&(i=T(i)),t.push({lines:i,start:r.start,end:r.end})},e.get=function(r){r=r||{start:{line:1,column:0},end:{line:n.length,column:n.getLineLength(n.length)}};let i=r.start,a=[];function o(l,c){a.push(n.slice(l,c))}return t.sort((l,c)=>j(l.start,c.start)).forEach(function(l){j(i,l.start)>0||(o(i,l.start),a.push(l.lines),i=l.end)}),o(i,r.end),g(a)}},aa=ia.prototype;aa.tryToReprintComments=function(s,n,e){let t=this;if(!s.comments&&!n.comments)return!0;let r=Te.from(s),i=Te.from(n);r.stack.push("comments",Ai(s)),i.stack.push("comments",Ai(n));let a=[],o=la(r,i,a);return o&&a.length>0&&a.forEach(function(l){let c=l.oldPath.getValue();t.replace(c.loc,e(l.newPath).indentTail(c.loc.indent))}),o};function Ai(s){let n=[];return s.comments&&s.comments.length>0&&s.comments.forEach(function(e){(e.leading||e.trailing)&&n.push(e)}),n}aa.deleteComments=function(s){if(!s.comments)return;let n=this;s.comments.forEach(function(e){e.leading?n.replace({start:e.loc.start,end:s.loc.lines.skipSpaces(e.loc.end,!1,!1)},""):e.trailing&&n.replace({start:s.loc.lines.skipSpaces(e.loc.start,!0,!1),end:e.loc.end},"")})};function Bc(s){let n=s.getValue();if(!Kt.check(n))return;let e=n.original,t=e&&e.loc,r=t&&t.lines,i=[];if(!(!r||!Vc(s,i)))return function(a){let o=new ia(r);i.forEach(function(c){let p=c.newPath.getValue(),u=c.oldPath.getValue();_c.assert(u.loc,!0);let h=!o.tryToReprintComments(p,u,a);h&&o.deleteComments(u);let m=a(c.newPath,{includeComments:h,avoidRootParens:u.type===p.type&&c.oldPath.hasParens()}).indentTail(u.loc.indent),d=Rc(r,u.loc,m),y=jc(r,u.loc,m);if(d||y){let f=[];d&&f.push(" "),f.push(m),y&&f.push(" "),m=g(f)}o.replace(u.loc,m)});let l=o.get(t).indentTail(-e.loc.indent);return s.needsParens()?g(["(",l,")"]):l}}function Rc(s,n,e){let t=We(n.start),r=s.prevPos(t)&&s.charAt(t),i=e.charAt(e.firstPos());return r&&_n.test(r)&&i&&_n.test(i)}function jc(s,n,e){let t=s.charAt(n.end),r=e.lastPos(),i=e.prevPos(r)&&e.charAt(r);return i&&_n.test(i)&&t&&_n.test(t)}function Vc(s,n){let e=s.getValue();Kt.assert(e);let t=e.original;if(Kt.assert(t),e.type!==t.type)return!1;let r=new Te(t),i=rs(s,r,n);return i||(n.length=0),i}function oa(s,n,e){let t=s.getValue(),r=n.getValue();return t===r?!0:ns.check(t)?la(s,n,e):Jt.check(t)?zc(s,n,e):!1}function la(s,n,e){let t=s.getValue(),r=n.getValue();if(t===r||s.valueIsDuplicate()||n.valueIsDuplicate())return!0;ns.assert(t);let i=t.length;if(!(ns.check(r)&&r.length===i))return!1;for(let a=0;a<i;++a){s.stack.push(a,t[a]),n.stack.push(a,r[a]);let o=oa(s,n,e);if(s.stack.length-=2,n.stack.length-=2,!o)return!1}return!0}function zc(s,n,e){let t=s.getValue();if(Jt.assert(t),t.original===null)return!1;let r=n.getValue();if(!Jt.check(r))return!1;if(t===r||s.valueIsDuplicate()||n.valueIsDuplicate())return!0;if(Kt.check(t)){if(!Kt.check(r))return!1;let i=s.getParentNode(),a=n.getParentNode();if(a!==null&&a.type==="FunctionTypeAnnotation"&&i!==null&&i.type==="FunctionTypeAnnotation"){let o=a.params.length!==1||!!a.params[0].name,l=i.params.length!==1||!!i.params[0].name;if(!o&&l)return!1}if(t.type===r.type){let o=[];if(rs(s,n,o))e.push.apply(e,o);else if(r.loc)e.push({oldPath:n.copy(),newPath:s.copy()});else return!1;return!0}return Ii.check(t)&&Ii.check(r)&&r.loc?(e.push({oldPath:n.copy(),newPath:s.copy()}),!0):!1}return rs(s,n,e)}function rs(s,n,e){let t=s.getValue(),r=n.getValue();if(Jt.assert(t),Jt.assert(r),t.original===null||s.needsParens()&&!n.hasParens())return!1;let i=fc(r,t);(r.type==="File"||t.type==="File")&&delete i.tokens,delete i.loc;let a=e.length;for(let o in i){if(o.charAt(0)==="_")continue;s.stack.push(o,Re(t,o)),n.stack.push(o,Re(r,o));let l=oa(s,n,e);if(s.stack.length-=2,n.stack.length-=2,!l)return!1}return!(Fc.check(s.getNode())&&e.length>a)}var X=we,os=Ce.string,$c=Ce.object,Un=function(n,e){os.assert(n),this.code=n,e&&($c.assert(e),this.map=e)},qc=Un.prototype,ki=!1;qc.toString=function(){return ki||(console.warn("Deprecation warning: recast.print now returns an object with a .code property. You appear to be treating the object as a string, which might still work but is strongly discouraged."),ki=!0),this.code};var Ni=new Un(""),Hc=function(n){let e=n&&n.tabWidth;n=jn(n),n.sourceFileName=null;function t(i,a){return i=Object.assign({},i,a),o=>r(o,i)}function r(i,a){if(a=a||{},a.includeComments)return Ei(i,t(a,{includeComments:!1}));let o=n.tabWidth;if(!e){let p=i.getNode().loc;p&&p.lines&&p.lines.guessTabWidth&&(n.tabWidth=p.lines.guessTabWidth())}let l=Bc(i),c=l?l(r):Mi(i,n,a,t(a,{includeComments:!0,avoidRootParens:!1}));return n.tabWidth=o,c}this.print=function(i){if(!i)return Ni;let a=r(Te.from(i),{includeComments:!0,avoidRootParens:!1});return new Un(a.toString(n),mc(n.inputSourceMap,a.getSourceMap(n.sourceMapName,n.sourceRoot)))},this.printGenerically=function(i){if(!i)return Ni;function a(p){return Ei(p,u=>Mi(u,n,{includeComments:!0,avoidRootParens:!1},a))}let o=Te.from(i),l=n.reuseWhitespace;n.reuseWhitespace=!1;let c=new Un(a(o).toString(n));return n.reuseWhitespace=l,c}};function Mi(s,n,e,t){let r=s.getValue(),i=[],a=Wc(s,n,t);if(!r||a.isEmpty())return a;let o=!1,l=Gc(s,t);return l.isEmpty()?e.avoidRootParens||(o=s.needsParens()):i.push(l),o&&i.unshift("("),i.push(a),o&&i.push(")"),g(i)}function Wc(s,n,e){let t=s.getValue();if(!t)return T("");if(typeof t=="string")return T(t,n);X.Printable.assert(t);let r=[];switch(t.type){case"File":return s.call(e,"program");case"Program":return t.directives&&s.each(function(i){r.push(e(i),`;
|
|
8854
|
-
`)},"directives"),t.interpreter&&r.push(s.call(e,"interpreter")),r.push(s.call(i=>bt(i,n,e),"body")),
|
|
9093
|
+
`);return y(i)}function Ac(s,n){let e=s.getValue(s);vt.Comment.assert(e);let t=e.loc,r=t&&t.lines,i=[];if(r instanceof yt){let a=r.skipSpaces(t.start,!0)||r.firstPos(),o=r.slice(a,t.start);o.length===1?i.push(o):i.push(new Array(o.length).join(`
|
|
9094
|
+
`))}return i.push(n(s)),y(i)}function Ii(s,n){let e=s.getValue(),t=n(s),r=vt.Node.check(e)&&Re(e,"comments");if(!r||r.length===0)return t;let i=[],a=[t];return s.each(function(o){let l=o.getValue(),c=Re(l,"leading"),p=Re(l,"trailing");c||p&&!(vt.Statement.check(e)||l.type==="Block"||l.type==="CommentBlock")?i.push(Ec(o,n)):p&&a.push(Ac(o,n))},"comments"),i.push.apply(i,a),y(i)}var kc=Yt,Nc=Ce.object,Mc=Ce.array;function Dc(s,n){n=jn(n);let e=T(s,n),t=e.toString({tabWidth:n.tabWidth,reuseWhitespace:!1,useTabs:!1}),r=[],i=n.parser.parse(t,{jsx:!0,loc:!0,locations:!0,range:n.range,comment:!0,onComment:r,tolerant:wi(n,"tolerant",!0),ecmaVersion:6,sourceType:wi(n,"sourceType","module")}),a=Array.isArray(i.tokens)?i.tokens:!1;delete i.tokens,a.forEach(function(p){typeof p.value!="string"&&(p.value=e.sliceString(p.loc.start,p.loc.end))}),Array.isArray(i.comments)&&(r=i.comments,delete i.comments),i.loc?is(i,e):i.loc={start:e.firstPos(),end:e.lastPos()},i.loc.lines=e,i.loc.indent=0;let o,l;i.type==="Program"?(l=i,o=kc.file(i,n.sourceFileName||null),o.loc={start:e.firstPos(),end:e.lastPos(),lines:e,indent:0}):i.type==="File"&&(o=i,l=o.program),n.tokens&&(o.tokens=a);let c=Gi({type:l.type,loc:l.loc,body:[],comments:r},e);return l.loc.start=c.start,l.loc.end=c.end,Sc(r,l.body.length?o.program:o,e),new ta(e,a).copy(o)}var ta=function(n,e){this.lines=n,this.tokens=e,this.startTokenIndex=0,this.endTokenIndex=e.length,this.indent=0,this.seen=new Map},na=ta.prototype;na.copy=function(s){if(this.seen.has(s))return this.seen.get(s);if(Mc.check(s)){let c=new Array(s.length);return this.seen.set(s,c),s.forEach(function(p,u){c[u]=this.copy(p)},this),c}if(!Nc.check(s))return s;is(s,this.lines);let n=Object.create(Object.getPrototypeOf(s),{original:{value:s,configurable:!1,enumerable:!1,writable:!0}});this.seen.set(s,n);let e=s.loc,t=this.indent,r=t,i=this.startTokenIndex,a=this.endTokenIndex;e&&((s.type==="Block"||s.type==="Line"||s.type==="CommentBlock"||s.type==="CommentLine"||this.lines.isPrecededOnlyByWhitespace(e.start))&&(r=this.indent=e.start.column),e.lines=this.lines,e.tokens=this.tokens,e.indent=r,this.findTokenRange(e));let o=Object.keys(s),l=o.length;for(let c=0;c<l;++c){let p=o[c];p==="loc"||p==="tokens"&&s.type==="File"?n[p]=s[p]:n[p]=this.copy(s[p])}return this.indent=t,this.startTokenIndex=i,this.endTokenIndex=a,n};na.findTokenRange=function(s){for(;this.startTokenIndex>0;){let n=s.tokens[this.startTokenIndex];if(j(s.start,n.loc.start)<0)--this.startTokenIndex;else break}for(;this.endTokenIndex<s.tokens.length;){let n=s.tokens[this.endTokenIndex];if(j(n.loc.end,s.end)<0)++this.endTokenIndex;else break}for(;this.startTokenIndex<this.endTokenIndex;){let n=s.tokens[this.startTokenIndex];if(j(n.loc.start,s.start)<0)++this.startTokenIndex;else break}for(s.start.token=this.startTokenIndex;this.endTokenIndex>this.startTokenIndex;){let n=s.tokens[this.endTokenIndex-1];if(j(s.end,n.loc.end)<0)--this.endTokenIndex;else break}s.end.token=this.endTokenIndex};var G=we,Lc=Ce.array,Oc=Ce.number,es={};[["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]].forEach(function(s,n){s.forEach(function(e){es[e]=n})});var Te=function(n){this.stack=[n]},ne=Te.prototype;Te.from=function(s){if(s instanceof Te)return s.copy();if(s instanceof pc){let n=Object.create(Te.prototype),e=[s.value];for(let t;t=s.parentPath;s=t)e.push(s.name,t.value);return n.stack=e.reverse(),n}return new Te(s)};ne.copy=function(){let n=Object.create(Te.prototype);return n.stack=this.stack.slice(0),n};ne.getName=function(){let n=this.stack,e=n.length;return e>1?n[e-2]:null};ne.getValue=function(){let n=this.stack;return n[n.length-1]};ne.valueIsDuplicate=function(){let s=this.stack,n=s.length-1;return s.lastIndexOf(s[n],n-1)>=0};function ra(s,n){let e=s.stack;for(let t=e.length-1;t>=0;t-=2){let r=e[t];if(G.Node.check(r)&&--n<0)return r}return null}ne.getNode=function(n=0){return ra(this,~~n)};ne.getParentNode=function(n=0){return ra(this,~~n+1)};ne.getRootValue=function(){let n=this.stack;return n.length%2===0?n[1]:n[0]};ne.call=function(n){let e=this.stack,t=e.length,r=e[t-1],i=arguments.length;for(let o=1;o<i;++o){let l=arguments[o];r=r[l],e.push(l,r)}let a=n(this);return e.length=t,a};ne.each=function(n){let e=this.stack,t=e.length,r=e[t-1],i=arguments.length;for(let a=1;a<i;++a){let o=arguments[a];r=r[o],e.push(o,r)}for(let a=0;a<r.length;++a)a in r&&(e.push(a,r[a]),n(this),e.length-=2);e.length=t};ne.map=function(n){let e=this.stack,t=e.length,r=e[t-1],i=arguments.length;for(let o=1;o<i;++o){let l=arguments[o];r=r[l],e.push(l,r)}let a=new Array(r.length);for(let o=0;o<r.length;++o)o in r&&(e.push(o,r[o]),a[o]=n(this,o),e.length-=2);return e.length=t,a};ne.hasParens=function(){let s=this.getNode(),n=this.getPrevToken(s);if(!n)return!1;let e=this.getNextToken(s);return e?!!(n.value==="("&&(e.value===")"||!this.canBeFirstInStatement()&&this.firstInStatement()&&!this.needsParens(!0))):!1};ne.getPrevToken=function(s){s=s||this.getNode();let n=s&&s.loc,e=n&&n.tokens;if(e&&n.start.token>0){let t=e[n.start.token-1];if(t){let r=this.getRootValue().loc;if(j(r.start,t.loc.start)<=0)return t}}return null};ne.getNextToken=function(s){s=s||this.getNode();let n=s&&s.loc,e=n&&n.tokens;if(e&&n.end.token<e.length){let t=e[n.end.token];if(t){let r=this.getRootValue().loc;if(j(t.loc.end,r.end)<=0)return t}}return null};ne.needsParens=function(s){let n=this.getNode();if(n.type==="AssignmentExpression"&&n.left.type==="ObjectPattern")return!0;let e=this.getParentNode(),t=this.getName();if(this.getValue()!==n||G.Statement.check(n)||n.type==="Identifier"||e&&e.type==="ParenthesizedExpression")return!1;if(n.extra&&n.extra.parenthesized)return!0;if(!e)return!1;if(n.type==="UnaryExpression"&&e.type==="BinaryExpression"&&t==="left"&&e.left===n&&e.operator==="**")return!0;switch(n.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return e.type==="MemberExpression"&&t==="object"&&e.object===n;case"BinaryExpression":case"LogicalExpression":switch(e.type){case"CallExpression":return t==="callee"&&e.callee===n;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return t==="object"&&e.object===n;case"BinaryExpression":case"LogicalExpression":{let r=e.operator,i=es[r],a=n.operator,o=es[a];if(i>o||i===o&&t==="right")return!0;break}default:return!1}break;case"SequenceExpression":switch(e.type){case"ReturnStatement":return!1;case"ForStatement":return!1;case"ExpressionStatement":return t!=="expression";default:return!0}case"OptionalIndexedAccessType":return n.optional&&e.type==="IndexedAccessType";case"IntersectionTypeAnnotation":case"UnionTypeAnnotation":return e.type==="NullableTypeAnnotation";case"Literal":return e.type==="MemberExpression"&&Oc.check(n.value)&&t==="object"&&e.object===n;case"NumericLiteral":return e.type==="MemberExpression"&&t==="object"&&e.object===n;case"YieldExpression":case"AwaitExpression":case"AssignmentExpression":case"ConditionalExpression":switch(e.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":case"NewExpression":return t==="callee"&&e.callee===n;case"ConditionalExpression":return t==="test"&&e.test===n;case"MemberExpression":return t==="object"&&e.object===n;default:return!1}case"ArrowFunctionExpression":return G.CallExpression.check(e)&&t==="callee"&&e.callee===n||G.MemberExpression.check(e)&&t==="object"&&e.object===n||G.TSAsExpression&&G.TSAsExpression.check(e)&&t==="expression"&&e.expression===n?!0:sa(e);case"ObjectExpression":if(e.type==="ArrowFunctionExpression"&&t==="body"&&e.body===n)return!0;break;case"TSAsExpression":if(e.type==="ArrowFunctionExpression"&&t==="body"&&e.body===n&&n.expression.type==="ObjectExpression")return!0;break;case"CallExpression":if(t==="declaration"&&G.ExportDefaultDeclaration.check(e)&&G.FunctionExpression.check(n.callee))return!0}return e.type==="NewExpression"&&t==="callee"&&e.callee===n?ts(n):!!(s!==!0&&!this.canBeFirstInStatement()&&this.firstInStatement())};function sa(s){return G.BinaryExpression.check(s)||G.LogicalExpression.check(s)}function ts(s){return G.CallExpression.check(s)?!0:Lc.check(s)?s.some(ts):G.Node.check(s)?uc(s,(n,e)=>ts(e)):!1}ne.canBeFirstInStatement=function(){let s=this.getNode();return!(G.FunctionExpression.check(s)||G.ObjectExpression.check(s)||G.ClassExpression.check(s))};ne.firstInStatement=function(){let s=this.stack,n,e,t,r;for(let i=s.length-1;i>=0;i-=2)if(G.Node.check(s[i])&&(t=n,r=e,n=s[i-1],e=s[i]),!(!e||!r)){if(G.BlockStatement.check(e)&&n==="body"&&t===0||G.ExpressionStatement.check(e)&&t==="expression"||G.AssignmentExpression.check(e)&&t==="left"||G.ArrowFunctionExpression.check(e)&&t==="body")return!0;if(!(G.SequenceExpression.check(e)&&s[i+1]==="expressions"&&t===0)&&!(G.CallExpression.check(e)&&t==="callee")&&!(G.MemberExpression.check(e)&&t==="object")&&!(G.ConditionalExpression.check(e)&&t==="test")&&!(sa(e)&&t==="left")&&!(G.UnaryExpression.check(e)&&!e.prefix&&t==="argument"))return!1}return!0};var Kt=we.Printable,Ei=we.Expression,Fc=we.ReturnStatement,Uc=we.SourceLocation,Jt=Ce.object,ns=Ce.array,_c=Ce.string,Un=/[0-9a-z_$]/i,ia=function(n){let e=this,t=[];e.replace=function(r,i){_c.check(i)&&(i=T(i)),t.push({lines:i,start:r.start,end:r.end})},e.get=function(r){r=r||{start:{line:1,column:0},end:{line:n.length,column:n.getLineLength(n.length)}};let i=r.start,a=[];function o(l,c){a.push(n.slice(l,c))}return t.sort((l,c)=>j(l.start,c.start)).forEach(function(l){j(i,l.start)>0||(o(i,l.start),a.push(l.lines),i=l.end)}),o(i,r.end),y(a)}},aa=ia.prototype;aa.tryToReprintComments=function(s,n,e){let t=this;if(!s.comments&&!n.comments)return!0;let r=Te.from(s),i=Te.from(n);r.stack.push("comments",Ai(s)),i.stack.push("comments",Ai(n));let a=[],o=la(r,i,a);return o&&a.length>0&&a.forEach(function(l){let c=l.oldPath.getValue();t.replace(c.loc,e(l.newPath).indentTail(c.loc.indent))}),o};function Ai(s){let n=[];return s.comments&&s.comments.length>0&&s.comments.forEach(function(e){(e.leading||e.trailing)&&n.push(e)}),n}aa.deleteComments=function(s){if(!s.comments)return;let n=this;s.comments.forEach(function(e){e.leading?n.replace({start:e.loc.start,end:s.loc.lines.skipSpaces(e.loc.end,!1,!1)},""):e.trailing&&n.replace({start:s.loc.lines.skipSpaces(e.loc.start,!0,!1),end:e.loc.end},"")})};function Bc(s){let n=s.getValue();if(!Kt.check(n))return;let e=n.original,t=e&&e.loc,r=t&&t.lines,i=[];if(!(!r||!Vc(s,i)))return function(a){let o=new ia(r);i.forEach(function(c){let p=c.newPath.getValue(),u=c.oldPath.getValue();Uc.assert(u.loc,!0);let h=!o.tryToReprintComments(p,u,a);h&&o.deleteComments(u);let m=a(c.newPath,{includeComments:h,avoidRootParens:u.type===p.type&&c.oldPath.hasParens()}).indentTail(u.loc.indent),d=Rc(r,u.loc,m),g=jc(r,u.loc,m);if(d||g){let f=[];d&&f.push(" "),f.push(m),g&&f.push(" "),m=y(f)}o.replace(u.loc,m)});let l=o.get(t).indentTail(-e.loc.indent);return s.needsParens()?y(["(",l,")"]):l}}function Rc(s,n,e){let t=We(n.start),r=s.prevPos(t)&&s.charAt(t),i=e.charAt(e.firstPos());return r&&Un.test(r)&&i&&Un.test(i)}function jc(s,n,e){let t=s.charAt(n.end),r=e.lastPos(),i=e.prevPos(r)&&e.charAt(r);return i&&Un.test(i)&&t&&Un.test(t)}function Vc(s,n){let e=s.getValue();Kt.assert(e);let t=e.original;if(Kt.assert(t),e.type!==t.type)return!1;let r=new Te(t),i=rs(s,r,n);return i||(n.length=0),i}function oa(s,n,e){let t=s.getValue(),r=n.getValue();return t===r?!0:ns.check(t)?la(s,n,e):Jt.check(t)?zc(s,n,e):!1}function la(s,n,e){let t=s.getValue(),r=n.getValue();if(t===r||s.valueIsDuplicate()||n.valueIsDuplicate())return!0;ns.assert(t);let i=t.length;if(!(ns.check(r)&&r.length===i))return!1;for(let a=0;a<i;++a){s.stack.push(a,t[a]),n.stack.push(a,r[a]);let o=oa(s,n,e);if(s.stack.length-=2,n.stack.length-=2,!o)return!1}return!0}function zc(s,n,e){let t=s.getValue();if(Jt.assert(t),t.original===null)return!1;let r=n.getValue();if(!Jt.check(r))return!1;if(t===r||s.valueIsDuplicate()||n.valueIsDuplicate())return!0;if(Kt.check(t)){if(!Kt.check(r))return!1;let i=s.getParentNode(),a=n.getParentNode();if(a!==null&&a.type==="FunctionTypeAnnotation"&&i!==null&&i.type==="FunctionTypeAnnotation"){let o=a.params.length!==1||!!a.params[0].name,l=i.params.length!==1||!!i.params[0].name;if(!o&&l)return!1}if(t.type===r.type){let o=[];if(rs(s,n,o))e.push.apply(e,o);else if(r.loc)e.push({oldPath:n.copy(),newPath:s.copy()});else return!1;return!0}return Ei.check(t)&&Ei.check(r)&&r.loc?(e.push({oldPath:n.copy(),newPath:s.copy()}),!0):!1}return rs(s,n,e)}function rs(s,n,e){let t=s.getValue(),r=n.getValue();if(Jt.assert(t),Jt.assert(r),t.original===null||s.needsParens()&&!n.hasParens())return!1;let i=fc(r,t);(r.type==="File"||t.type==="File")&&delete i.tokens,delete i.loc;let a=e.length;for(let o in i){if(o.charAt(0)==="_")continue;s.stack.push(o,Re(t,o)),n.stack.push(o,Re(r,o));let l=oa(s,n,e);if(s.stack.length-=2,n.stack.length-=2,!l)return!1}return!(Fc.check(s.getNode())&&e.length>a)}var X=we,os=Ce.string,$c=Ce.object,_n=function(n,e){os.assert(n),this.code=n,e&&($c.assert(e),this.map=e)},qc=_n.prototype,ki=!1;qc.toString=function(){return ki||(console.warn("Deprecation warning: recast.print now returns an object with a .code property. You appear to be treating the object as a string, which might still work but is strongly discouraged."),ki=!0),this.code};var Ni=new _n(""),Hc=function(n){let e=n&&n.tabWidth;n=jn(n),n.sourceFileName=null;function t(i,a){return i=Object.assign({},i,a),o=>r(o,i)}function r(i,a){if(a=a||{},a.includeComments)return Ii(i,t(a,{includeComments:!1}));let o=n.tabWidth;if(!e){let p=i.getNode().loc;p&&p.lines&&p.lines.guessTabWidth&&(n.tabWidth=p.lines.guessTabWidth())}let l=Bc(i),c=l?l(r):Mi(i,n,a,t(a,{includeComments:!0,avoidRootParens:!1}));return n.tabWidth=o,c}this.print=function(i){if(!i)return Ni;let a=r(Te.from(i),{includeComments:!0,avoidRootParens:!1});return new _n(a.toString(n),mc(n.inputSourceMap,a.getSourceMap(n.sourceMapName,n.sourceRoot)))},this.printGenerically=function(i){if(!i)return Ni;function a(p){return Ii(p,u=>Mi(u,n,{includeComments:!0,avoidRootParens:!1},a))}let o=Te.from(i),l=n.reuseWhitespace;n.reuseWhitespace=!1;let c=new _n(a(o).toString(n));return n.reuseWhitespace=l,c}};function Mi(s,n,e,t){let r=s.getValue(),i=[],a=Wc(s,n,t);if(!r||a.isEmpty())return a;let o=!1,l=Gc(s,t);return l.isEmpty()?e.avoidRootParens||(o=s.needsParens()):i.push(l),o&&i.unshift("("),i.push(a),o&&i.push(")"),y(i)}function Wc(s,n,e){let t=s.getValue();if(!t)return T("");if(typeof t=="string")return T(t,n);X.Printable.assert(t);let r=[];switch(t.type){case"File":return s.call(e,"program");case"Program":return t.directives&&s.each(function(i){r.push(e(i),`;
|
|
9095
|
+
`)},"directives"),t.interpreter&&r.push(s.call(e,"interpreter")),r.push(s.call(i=>bt(i,n,e),"body")),y(r);case"Noop":case"EmptyStatement":return T("");case"ExpressionStatement":return y([s.call(e,"expression"),";"]);case"ParenthesizedExpression":return y(["(",s.call(e,"expression"),")"]);case"BinaryExpression":case"LogicalExpression":case"AssignmentExpression":return T(" ").join([s.call(e,"left"),t.operator,s.call(e,"right")]);case"AssignmentPattern":return y([s.call(e,"left")," = ",s.call(e,"right")]);case"MemberExpression":case"OptionalMemberExpression":{r.push(s.call(e,"object"));let i=s.call(e,"property"),a=Re(t,"optional");return t.computed?r.push(a?"?.[":"[",i,"]"):r.push(a?"?.":".",i),y(r)}case"ChainExpression":return s.call(e,"expression");case"MetaProperty":return y([s.call(e,"meta"),".",s.call(e,"property")]);case"BindExpression":return t.object&&r.push(s.call(e,"object")),r.push("::",s.call(e,"callee")),y(r);case"Path":return T(".").join(t.body);case"Identifier":return y([T(t.name,n),t.optional?"?":"",s.call(e,"typeAnnotation")]);case"SpreadElement":case"SpreadElementPattern":case"RestProperty":case"SpreadProperty":case"SpreadPropertyPattern":case"ObjectTypeSpreadProperty":case"RestElement":return y(["...",s.call(e,"argument"),s.call(e,"typeAnnotation")]);case"FunctionDeclaration":case"FunctionExpression":case"TSDeclareFunction":return t.declare&&r.push("declare "),t.async&&r.push("async "),r.push("function"),t.generator&&r.push("*"),t.id?r.push(" ",s.call(e,"id"),s.call(e,"typeParameters")):t.typeParameters&&r.push(s.call(e,"typeParameters")),r.push("(",Ne(s,n,e),")",s.call(e,"returnType")),t.body&&r.push(" ",s.call(e,"body")),y(r);case"ArrowFunctionExpression":return t.async&&r.push("async "),t.typeParameters&&r.push(s.call(e,"typeParameters")),!n.arrowParensAlways&&t.params.length===1&&!t.rest&&t.params[0].type==="Identifier"&&!t.params[0].typeAnnotation&&!t.returnType?r.push(s.call(e,"params",0)):r.push("(",Ne(s,n,e),")",s.call(e,"returnType")),r.push(" => ",s.call(e,"body")),y(r);case"MethodDefinition":return Hr(s,n,e);case"YieldExpression":return r.push("yield"),t.delegate&&r.push("*"),t.argument&&r.push(" ",s.call(e,"argument")),y(r);case"AwaitExpression":return r.push("await"),t.all&&r.push("*"),t.argument&&r.push(" ",s.call(e,"argument")),y(r);case"ModuleExpression":return y([`module {
|
|
8855
9096
|
`,s.call(e,"body").indent(n.tabWidth),`
|
|
8856
|
-
}`]);case"ModuleDeclaration":return r.push("module",s.call(e,"id")),t.source?r.push("from",s.call(e,"source")):r.push(s.call(e,"body")),T(" ").join(r);case"ImportSpecifier":return t.importKind&&t.importKind!=="value"&&r.push(t.importKind+" "),t.imported?(r.push(s.call(e,"imported")),t.local&&t.local.name!==t.imported.name&&r.push(" as ",s.call(e,"local"))):t.id&&(r.push(s.call(e,"id")),t.name&&r.push(" as ",s.call(e,"name"))),
|
|
9097
|
+
}`]);case"ModuleDeclaration":return r.push("module",s.call(e,"id")),t.source?r.push("from",s.call(e,"source")):r.push(s.call(e,"body")),T(" ").join(r);case"ImportSpecifier":return t.importKind&&t.importKind!=="value"&&r.push(t.importKind+" "),t.imported?(r.push(s.call(e,"imported")),t.local&&t.local.name!==t.imported.name&&r.push(" as ",s.call(e,"local"))):t.id&&(r.push(s.call(e,"id")),t.name&&r.push(" as ",s.call(e,"name"))),y(r);case"ExportSpecifier":return t.exportKind&&t.exportKind!=="value"&&r.push(t.exportKind+" "),t.local?(r.push(s.call(e,"local")),t.exported&&t.exported.name!==t.local.name&&r.push(" as ",s.call(e,"exported"))):t.id&&(r.push(s.call(e,"id")),t.name&&r.push(" as ",s.call(e,"name"))),y(r);case"ExportBatchSpecifier":return T("*");case"ImportNamespaceSpecifier":return r.push("* as "),t.local?r.push(s.call(e,"local")):t.id&&r.push(s.call(e,"id")),y(r);case"ImportDefaultSpecifier":return t.local?s.call(e,"local"):s.call(e,"id");case"TSExportAssignment":return y(["export = ",s.call(e,"expression")]);case"ExportDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":return Li(s,n,e);case"ExportAllDeclaration":return r.push("export *"),t.exported&&r.push(" as ",s.call(e,"exported")),r.push(" from ",s.call(e,"source"),";"),y(r);case"TSNamespaceExportDeclaration":return r.push("export as namespace ",s.call(e,"id")),Nn(y(r));case"ExportNamespaceSpecifier":return y(["* as ",s.call(e,"exported")]);case"ExportDefaultSpecifier":return s.call(e,"exported");case"Import":return T("import",n);case"ImportExpression":return y(["import(",s.call(e,"source"),")"]);case"ImportDeclaration":{if(r.push("import "),t.importKind&&t.importKind!=="value"&&r.push(t.importKind+" "),t.specifiers&&t.specifiers.length>0){let i=[],a=[];if(s.each(function(o){let l=o.getValue();l.type==="ImportSpecifier"?a.push(e(o)):(l.type==="ImportDefaultSpecifier"||l.type==="ImportNamespaceSpecifier")&&i.push(e(o))},"specifiers"),i.forEach((o,l)=>{l>0&&r.push(", "),r.push(o)}),a.length>0){let o=T(", ").join(a);o.getLineLength(1)>n.wrapColumn&&(o=y([T(`,
|
|
8857
9098
|
`).join(a).indent(n.tabWidth),","])),i.length>0&&r.push(", "),o.length>1?r.push(`{
|
|
8858
9099
|
`,o,`
|
|
8859
|
-
}`):n.objectCurlySpacing?r.push("{ ",o," }"):r.push("{",o,"}")}r.push(" from ")}return r.push(s.call(e,"source"),pa(s,n,e),";"),
|
|
9100
|
+
}`):n.objectCurlySpacing?r.push("{ ",o," }"):r.push("{",o,"}")}r.push(" from ")}return r.push(s.call(e,"source"),pa(s,n,e),";"),y(r)}case"ImportAttribute":return y([s.call(e,"key"),": ",s.call(e,"value")]);case"StaticBlock":r.push("static ");case"BlockStatement":{let i=s.call(a=>bt(a,n,e),"body");return i.isEmpty()&&(!t.directives||t.directives.length===0)?(r.push("{}"),y(r)):(r.push(`{
|
|
8860
9101
|
`),t.directives&&s.each(function(a){r.push(Nn(e(a).indent(n.tabWidth)),t.directives.length>1||!i.isEmpty()?`
|
|
8861
9102
|
`:"")},"directives"),r.push(i.indent(n.tabWidth)),r.push(`
|
|
8862
|
-
}`),
|
|
9103
|
+
}`),y(r))}case"ReturnStatement":{if(r.push("return"),t.argument){let i=s.call(e,"argument");i.startsWithComment()||i.length>1&&X.JSXElement&&X.JSXElement.check(t.argument)?r.push(` (
|
|
8863
9104
|
`,i.indent(n.tabWidth),`
|
|
8864
|
-
)`):r.push(" ",i)}return r.push(";"),
|
|
8865
|
-
`);let m=r.length-1,d=0;if(o.forEach(function(
|
|
9105
|
+
)`):r.push(" ",i)}return r.push(";"),y(r)}case"CallExpression":case"OptionalCallExpression":return r.push(s.call(e,"callee")),t.typeParameters&&r.push(s.call(e,"typeParameters")),t.typeArguments&&r.push(s.call(e,"typeArguments")),Re(t,"optional")&&r.push("?."),r.push(Di(s,n,e)),y(r);case"RecordExpression":r.push("#");case"ObjectExpression":case"ObjectPattern":case"ObjectTypeAnnotation":{let i=t.type==="ObjectTypeAnnotation",a=n.flowObjectCommas?",":i?";":",",o=[],l=!1;i&&(o.push("indexers","callProperties"),t.internalSlots!=null&&o.push("internalSlots")),o.push("properties");let c=0;o.forEach(function(g){c+=t[g].length});let p=i&&c===1||c===0,u=t.exact?"{|":"{",h=t.exact?"|}":"}";r.push(p?u:u+`
|
|
9106
|
+
`);let m=r.length-1,d=0;if(o.forEach(function(g){s.each(function(f){let v=e(f);p||(v=v.indent(n.tabWidth));let w=!i&&v.length>1;w&&l&&r.push(`
|
|
8866
9107
|
`),r.push(v),d<c-1?(r.push(a+(w?`
|
|
8867
9108
|
|
|
8868
9109
|
`:`
|
|
8869
|
-
`)),l=!w):(c!==1&&i||!p&&Wt(n,"objects")&&f.getValue().type!=="RestElement")&&r.push(a),d++},
|
|
8870
|
-
`,
|
|
8871
|
-
`+h),d!==0&&p&&n.objectCurlySpacing&&(r[m]=u+" ",r[r.length-1]=" "+h),t.typeAnnotation&&r.push(s.call(e,"typeAnnotation")),
|
|
9110
|
+
`)),l=!w):(c!==1&&i||!p&&Wt(n,"objects")&&f.getValue().type!=="RestElement")&&r.push(a),d++},g)}),t.inexact){let g=T("...",n);p?(c>0&&r.push(a," "),r.push(g)):r.push(`
|
|
9111
|
+
`,g.indent(n.tabWidth))}return r.push(p?h:`
|
|
9112
|
+
`+h),d!==0&&p&&n.objectCurlySpacing&&(r[m]=u+" ",r[r.length-1]=" "+h),t.typeAnnotation&&r.push(s.call(e,"typeAnnotation")),y(r)}case"PropertyPattern":return y([s.call(e,"key"),": ",s.call(e,"pattern")]);case"ObjectProperty":case"Property":{if(t.method||t.kind==="get"||t.kind==="set")return Hr(s,n,e);if(t.shorthand&&t.value.type==="AssignmentPattern")return s.call(e,"value");let i=s.call(e,"key");return t.computed?r.push("[",i,"]"):r.push(i),(!t.shorthand||t.key.name!==t.value.name)&&r.push(": ",s.call(e,"value")),y(r)}case"ClassMethod":case"ObjectMethod":case"ClassPrivateMethod":case"TSDeclareMethod":return Hr(s,n,e);case"PrivateName":return y(["#",s.call(e,"id")]);case"Decorator":return y(["@",s.call(e,"expression")]);case"TupleExpression":r.push("#");case"ArrayExpression":case"ArrayPattern":{let a=t.elements.length,o=s.map(e,"elements"),c=T(", ").join(o).getLineLength(1)<=n.wrapColumn;return c?n.arrayBracketSpacing?r.push("[ "):r.push("["):r.push(`[
|
|
8872
9113
|
`),s.each(function(p){let u=p.getName();if(!p.getValue())r.push(",");else{let m=o[u];c?u>0&&r.push(" "):m=m.indent(n.tabWidth),r.push(m),(u<a-1||!c&&Wt(n,"arrays"))&&r.push(","),c||r.push(`
|
|
8873
|
-
`)}},"elements"),c&&n.arrayBracketSpacing?r.push(" ]"):r.push("]"),t.typeAnnotation&&r.push(s.call(e,"typeAnnotation")),
|
|
8874
|
-
`,n);case"ModuleSpecifier":if(t.local)throw new Error("The ESTree ModuleSpecifier type should be abstract");return T($t(t.value,n),n);case"UnaryExpression":return r.push(t.operator),/[a-z]$/.test(t.operator)&&r.push(" "),r.push(s.call(e,"argument")),
|
|
8875
|
-
`).join(a).indentTail(t.kind.length+1)):r.push(a[0]);let o=s.getParentNode();return!X.ForStatement.check(o)&&!X.ForInStatement.check(o)&&!(X.ForOfStatement&&X.ForOfStatement.check(o))&&!(X.ForAwaitStatement&&X.ForAwaitStatement.check(o))&&r.push(";"),
|
|
8876
|
-
else`,Ye(s.call(e,"alternate"),n)),
|
|
8877
|
-
`:"; ",o="for (",l=T(a).join([i,s.call(e,"test"),s.call(e,"update")]).indentTail(o.length),c=
|
|
8878
|
-
`),p=p.trimLeft()),r.push(p),
|
|
8879
|
-
while`),r.push(" (",s.call(e,"test"),");"),
|
|
9114
|
+
`)}},"elements"),c&&n.arrayBracketSpacing?r.push(" ]"):r.push("]"),t.typeAnnotation&&r.push(s.call(e,"typeAnnotation")),y(r)}case"SequenceExpression":return T(", ").join(s.map(e,"expressions"));case"ThisExpression":return T("this");case"Super":return T("super");case"NullLiteral":return T("null");case"RegExpLiteral":return T(gt(t)||`/${t.pattern}/${t.flags||""}`,n);case"BigIntLiteral":return T(gt(t)||t.value+"n",n);case"NumericLiteral":return T(gt(t)||t.value,n);case"DecimalLiteral":return T(gt(t)||t.value+"m",n);case"StringLiteral":return T($t(t.value,n));case"BooleanLiteral":case"Literal":return T(gt(t)||(typeof t.value=="string"?$t(t.value,n):t.value),n);case"Directive":return s.call(e,"value");case"DirectiveLiteral":return T(gt(t)||$t(t.value,n),n);case"InterpreterDirective":return T(`#!${t.value}
|
|
9115
|
+
`,n);case"ModuleSpecifier":if(t.local)throw new Error("The ESTree ModuleSpecifier type should be abstract");return T($t(t.value,n),n);case"UnaryExpression":return r.push(t.operator),/[a-z]$/.test(t.operator)&&r.push(" "),r.push(s.call(e,"argument")),y(r);case"UpdateExpression":return r.push(s.call(e,"argument"),t.operator),t.prefix&&r.reverse(),y(r);case"ConditionalExpression":return y([s.call(e,"test")," ? ",s.call(e,"consequent")," : ",s.call(e,"alternate")]);case"NewExpression":return r.push("new ",s.call(e,"callee")),t.typeParameters&&r.push(s.call(e,"typeParameters")),t.typeArguments&&r.push(s.call(e,"typeArguments")),t.arguments&&r.push(Di(s,n,e)),y(r);case"VariableDeclaration":{t.declare&&r.push("declare "),r.push(t.kind," ");let i=0,a=s.map(function(l){let c=e(l);return i=Math.max(c.length,i),c},"declarations");i===1?r.push(T(", ").join(a)):a.length>1?r.push(T(`,
|
|
9116
|
+
`).join(a).indentTail(t.kind.length+1)):r.push(a[0]);let o=s.getParentNode();return!X.ForStatement.check(o)&&!X.ForInStatement.check(o)&&!(X.ForOfStatement&&X.ForOfStatement.check(o))&&!(X.ForAwaitStatement&&X.ForAwaitStatement.check(o))&&r.push(";"),y(r)}case"VariableDeclarator":return t.init?T(" = ").join([s.call(e,"id"),s.call(e,"init")]):s.call(e,"id");case"WithStatement":return y(["with (",s.call(e,"object"),") ",s.call(e,"body")]);case"IfStatement":{let i=Ye(s.call(e,"consequent"),n);return r.push("if (",s.call(e,"test"),")",i),t.alternate&&r.push(Oi(i)?" else":`
|
|
9117
|
+
else`,Ye(s.call(e,"alternate"),n)),y(r)}case"ForStatement":{let i=s.call(e,"init"),a=i.length>1?`;
|
|
9118
|
+
`:"; ",o="for (",l=T(a).join([i,s.call(e,"test"),s.call(e,"update")]).indentTail(o.length),c=y([o,l,")"]),p=Ye(s.call(e,"body"),n);return r.push(c),c.length>1&&(r.push(`
|
|
9119
|
+
`),p=p.trimLeft()),r.push(p),y(r)}case"WhileStatement":return y(["while (",s.call(e,"test"),")",Ye(s.call(e,"body"),n)]);case"ForInStatement":return y([t.each?"for each (":"for (",s.call(e,"left")," in ",s.call(e,"right"),")",Ye(s.call(e,"body"),n)]);case"ForOfStatement":case"ForAwaitStatement":return r.push("for "),(t.await||t.type==="ForAwaitStatement")&&r.push("await "),r.push("(",s.call(e,"left")," of ",s.call(e,"right"),")",Ye(s.call(e,"body"),n)),y(r);case"DoWhileStatement":{let i=y(["do",Ye(s.call(e,"body"),n)]);return r.push(i),Oi(i)?r.push(" while"):r.push(`
|
|
9120
|
+
while`),r.push(" (",s.call(e,"test"),");"),y(r)}case"DoExpression":{let i=s.call(a=>bt(a,n,e),"body");return y([`do {
|
|
8880
9121
|
`,i.indent(n.tabWidth),`
|
|
8881
|
-
}`])}case"BreakStatement":return r.push("break"),t.label&&r.push(" ",s.call(e,"label")),r.push(";"),
|
|
8882
|
-
`,s.call(e,"body")]);case"TryStatement":return r.push("try ",s.call(e,"block")),t.handler?r.push(" ",s.call(e,"handler")):t.handlers&&s.each(function(i){r.push(" ",e(i))},"handlers"),t.finalizer&&r.push(" finally ",s.call(e,"finalizer")),
|
|
9122
|
+
}`])}case"BreakStatement":return r.push("break"),t.label&&r.push(" ",s.call(e,"label")),r.push(";"),y(r);case"ContinueStatement":return r.push("continue"),t.label&&r.push(" ",s.call(e,"label")),r.push(";"),y(r);case"LabeledStatement":return y([s.call(e,"label"),`:
|
|
9123
|
+
`,s.call(e,"body")]);case"TryStatement":return r.push("try ",s.call(e,"block")),t.handler?r.push(" ",s.call(e,"handler")):t.handlers&&s.each(function(i){r.push(" ",e(i))},"handlers"),t.finalizer&&r.push(" finally ",s.call(e,"finalizer")),y(r);case"CatchClause":return r.push("catch "),t.param&&r.push("(",s.call(e,"param")),t.guard&&r.push(" if ",s.call(e,"guard")),t.param&&r.push(") "),r.push(s.call(e,"body")),y(r);case"ThrowStatement":return y(["throw ",s.call(e,"argument"),";"]);case"SwitchStatement":return y(["switch (",s.call(e,"discriminant"),`) {
|
|
8883
9124
|
`,T(`
|
|
8884
9125
|
`).join(s.map(e,"cases")),`
|
|
8885
9126
|
}`]);case"SwitchCase":return t.test?r.push("case ",s.call(e,"test"),":"):r.push("default:"),t.consequent.length>0&&r.push(`
|
|
8886
|
-
`,s.call(i=>bt(i,n,e),"consequent").indent(n.tabWidth)),
|
|
8887
|
-
`}return e(p)},"children")).indentTail(n.tabWidth),c=s.call(e,a);return
|
|
8888
|
-
`)}),a=
|
|
9127
|
+
`,s.call(i=>bt(i,n,e),"consequent").indent(n.tabWidth)),y(r);case"DebuggerStatement":return T("debugger;");case"JSXAttribute":return r.push(s.call(e,"name")),t.value&&r.push("=",s.call(e,"value")),y(r);case"JSXIdentifier":return T(t.name,n);case"JSXNamespacedName":return T(":").join([s.call(e,"namespace"),s.call(e,"name")]);case"JSXMemberExpression":return T(".").join([s.call(e,"object"),s.call(e,"property")]);case"JSXSpreadAttribute":return y(["{...",s.call(e,"argument"),"}"]);case"JSXSpreadChild":return y(["{...",s.call(e,"expression"),"}"]);case"JSXExpressionContainer":return y(["{",s.call(e,"expression"),"}"]);case"JSXElement":case"JSXFragment":{let i="opening"+(t.type==="JSXElement"?"Element":"Fragment"),a="closing"+(t.type==="JSXElement"?"Element":"Fragment"),o=s.call(e,i);if(t[i].selfClosing)return o;let l=y(s.map(function(p){let u=p.getValue();if(X.Literal.check(u)&&typeof u.value=="string"){if(/\S/.test(u.value))return u.value.replace(/^\s+|\s+$/g,"");if(/\n/.test(u.value))return`
|
|
9128
|
+
`}return e(p)},"children")).indentTail(n.tabWidth),c=s.call(e,a);return y([o,l,c])}case"JSXOpeningElement":{r.push("<",s.call(e,"name"));let i=[];s.each(function(l){i.push(" ",e(l))},"attributes");let a=y(i);return(a.length>1||a.getLineLength(1)>n.wrapColumn)&&(i.forEach(function(l,c){l===" "&&(i[c]=`
|
|
9129
|
+
`)}),a=y(i).indentTail(n.tabWidth)),r.push(a,t.selfClosing?" />":">"),y(r)}case"JSXClosingElement":return y(["</",s.call(e,"name"),">"]);case"JSXOpeningFragment":return T("<>");case"JSXClosingFragment":return T("</>");case"JSXText":return T(t.value,n);case"JSXEmptyExpression":return T("");case"TypeAnnotatedIdentifier":return y([s.call(e,"annotation")," ",s.call(e,"identifier")]);case"ClassBody":return t.body.length===0?T("{}"):y([`{
|
|
8889
9130
|
`,s.call(i=>bt(i,n,e),"body").indent(n.tabWidth),`
|
|
8890
|
-
}`]);case"ClassPropertyDefinition":return r.push("static ",s.call(e,"definition")),X.MethodDefinition.check(t.definition)||r.push(";"),
|
|
9131
|
+
}`]);case"ClassPropertyDefinition":return r.push("static ",s.call(e,"definition")),X.MethodDefinition.check(t.definition)||r.push(";"),y(r);case"ClassProperty":{t.declare&&r.push("declare ");let i=t.accessibility||t.access;typeof i=="string"&&r.push(i," "),t.static&&r.push("static "),t.abstract&&r.push("abstract "),t.readonly&&r.push("readonly ");let a=s.call(e,"key");return t.computed&&(a=y(["[",a,"]"])),t.variance&&(a=y([zt(s,e),a])),r.push(a),t.optional&&r.push("?"),t.definite&&r.push("!"),t.typeAnnotation&&r.push(s.call(e,"typeAnnotation")),t.value&&r.push(" = ",s.call(e,"value")),r.push(";"),y(r)}case"ClassPrivateProperty":return t.static&&r.push("static "),r.push(s.call(e,"key")),t.typeAnnotation&&r.push(s.call(e,"typeAnnotation")),t.value&&r.push(" = ",s.call(e,"value")),r.push(";"),y(r);case"ClassAccessorProperty":return r.push(...ca(t),"accessor "),t.computed?r.push("[",s.call(e,"key"),"]"):r.push(s.call(e,"key")),t.optional&&r.push("?"),t.definite&&r.push("!"),t.typeAnnotation&&r.push(s.call(e,"typeAnnotation")),t.value&&r.push(" = ",s.call(e,"value")),r.push(";"),y(r);case"ClassDeclaration":case"ClassExpression":case"DeclareClass":return t.declare&&r.push("declare "),t.abstract&&r.push("abstract "),r.push("class"),t.id&&r.push(" ",s.call(e,"id")),t.typeParameters&&r.push(s.call(e,"typeParameters")),t.superClass&&r.push(" extends ",s.call(e,"superClass"),s.call(e,"superTypeParameters")),t.extends&&t.extends.length>0&&r.push(" extends ",T(", ").join(s.map(e,"extends"))),t.implements&&t.implements.length>0&&r.push(" implements ",T(", ").join(s.map(e,"implements"))),r.push(" ",s.call(e,"body")),t.type==="DeclareClass"?Vt(s,r):y(r);case"TemplateElement":return T(t.value.raw,n).lockIndentTail();case"TemplateLiteral":{let i=s.map(e,"expressions");return r.push("`"),s.each(function(a){let o=a.getName();r.push(e(a)),o<i.length&&r.push("${",i[o],"}")},"quasis"),r.push("`"),y(r).lockIndentTail()}case"TaggedTemplateExpression":return y([s.call(e,"tag"),s.call(e,"quasi")]);case"Node":case"Printable":case"SourceLocation":case"Position":case"Statement":case"Function":case"Pattern":case"Expression":case"Declaration":case"Specifier":case"NamedSpecifier":case"Comment":case"Flow":case"FlowType":case"FlowPredicate":case"MemberTypeAnnotation":case"Type":case"TSHasOptionalTypeParameterInstantiation":case"TSHasOptionalTypeParameters":case"TSHasOptionalTypeAnnotation":case"ChainElement":throw new Error("unprintable type: "+JSON.stringify(t.type));case"CommentBlock":case"Block":return y(["/*",T(t.value,n),"*/"]);case"CommentLine":case"Line":return y(["//",T(t.value,n)]);case"TypeAnnotation":return t.typeAnnotation?(t.typeAnnotation.type!=="FunctionTypeAnnotation"&&r.push(": "),r.push(s.call(e,"typeAnnotation")),y(r)):T("");case"ExistentialTypeParam":case"ExistsTypeAnnotation":return T("*",n);case"EmptyTypeAnnotation":return T("empty",n);case"AnyTypeAnnotation":return T("any",n);case"MixedTypeAnnotation":return T("mixed",n);case"ArrayTypeAnnotation":return y([s.call(e,"elementType"),"[]"]);case"TupleTypeAnnotation":{let i=s.map(e,"types"),o=T(", ").join(i).getLineLength(1)<=n.wrapColumn;return o?n.arrayBracketSpacing?r.push("[ "):r.push("["):r.push(`[
|
|
8891
9132
|
`),s.each(function(l){let c=l.getName();if(!l.getValue())r.push(",");else{let u=i[c];o?c>0&&r.push(" "):u=u.indent(n.tabWidth),r.push(u),(c<t.types.length-1||!o&&Wt(n,"arrays"))&&r.push(","),o||r.push(`
|
|
8892
|
-
`)}},"types"),o&&n.arrayBracketSpacing?r.push(" ]"):r.push("]"),
|
|
9133
|
+
`)}},"types"),o&&n.arrayBracketSpacing?r.push(" ]"):r.push("]"),y(r)}case"BooleanTypeAnnotation":return T("boolean",n);case"BooleanLiteralTypeAnnotation":return T(""+t.value,n);case"InterfaceTypeAnnotation":return r.push("interface"),t.extends&&t.extends.length>0&&r.push(" extends ",T(", ").join(s.map(e,"extends"))),r.push(" ",s.call(e,"body")),y(r);case"DeclareFunction":return Vt(s,["function ",s.call(e,"id"),";"]);case"DeclareModule":return Vt(s,["module ",s.call(e,"id")," ",s.call(e,"body")]);case"DeclareModuleExports":return Vt(s,["module.exports",s.call(e,"typeAnnotation")]);case"DeclareVariable":return Vt(s,["var ",s.call(e,"id"),";"]);case"DeclareExportDeclaration":case"DeclareExportAllDeclaration":return y(["declare ",Li(s,n,e)]);case"EnumDeclaration":return y(["enum ",s.call(e,"id"),s.call(e,"body")]);case"EnumBooleanBody":case"EnumNumberBody":case"EnumStringBody":case"EnumSymbolBody":return(t.type==="EnumSymbolBody"||t.explicitType)&&r.push(" of ",t.type.slice(4,-4).toLowerCase()),r.push(` {
|
|
8893
9134
|
`,T(`
|
|
8894
9135
|
`).join(s.map(e,"members")).indent(n.tabWidth),`
|
|
8895
|
-
}`),
|
|
8896
|
-
`,
|
|
8897
|
-
}`]);case"TSTupleType":return
|
|
9136
|
+
}`),y(r);case"EnumDefaultedMember":return y([s.call(e,"id"),","]);case"EnumBooleanMember":case"EnumNumberMember":case"EnumStringMember":return y([s.call(e,"id")," = ",s.call(e,"init"),","]);case"InferredPredicate":return T("%checks",n);case"DeclaredPredicate":return y(["%checks(",s.call(e,"value"),")"]);case"FunctionTypeAnnotation":{let i=s.getParentNode(0),a=!(X.ObjectTypeCallProperty.check(i)||X.ObjectTypeInternalSlot.check(i)&&i.method||X.DeclareFunction.check(s.getParentNode(2)));a&&!X.FunctionTypeParam.check(i)&&!X.TypeAlias.check(i)&&r.push(": ");let l=!!t.typeParameters,c=l||t.params.length!==1||t.params[0].name;return r.push(l?s.call(e,"typeParameters"):"",c?"(":"",Ne(s,n,e),c?")":""),t.returnType&&r.push(a?" => ":": ",s.call(e,"returnType")),y(r)}case"FunctionTypeParam":{let i=s.call(e,"name");return r.push(i),t.optional&&r.push("?"),i.infos[0].line&&r.push(": "),r.push(s.call(e,"typeAnnotation")),y(r)}case"GenericTypeAnnotation":return y([s.call(e,"id"),s.call(e,"typeParameters")]);case"DeclareInterface":r.push("declare ");case"InterfaceDeclaration":case"TSInterfaceDeclaration":return t.declare&&r.push("declare "),r.push("interface ",s.call(e,"id"),s.call(e,"typeParameters")," "),t.extends&&t.extends.length>0&&r.push("extends ",T(", ").join(s.map(e,"extends"))," "),t.body&&r.push(s.call(e,"body")),y(r);case"ClassImplements":case"InterfaceExtends":return y([s.call(e,"id"),s.call(e,"typeParameters")]);case"IntersectionTypeAnnotation":return T(" & ").join(s.map(e,"types"));case"NullableTypeAnnotation":return y(["?",s.call(e,"typeAnnotation")]);case"NullLiteralTypeAnnotation":return T("null",n);case"ThisTypeAnnotation":return T("this",n);case"NumberTypeAnnotation":return T("number",n);case"ObjectTypeCallProperty":return s.call(e,"value");case"ObjectTypeIndexer":return t.static&&r.push("static "),r.push(zt(s,e),"["),t.id&&r.push(s.call(e,"id"),": "),r.push(s.call(e,"key"),"]: ",s.call(e,"value")),y(r);case"ObjectTypeProperty":return y([zt(s,e),s.call(e,"key"),t.optional?"?":"",": ",s.call(e,"value")]);case"ObjectTypeInternalSlot":return y([t.static?"static ":"","[[",s.call(e,"id"),"]]",t.optional?"?":"",t.value.type!=="FunctionTypeAnnotation"?": ":"",s.call(e,"value")]);case"QualifiedTypeIdentifier":return y([s.call(e,"qualification"),".",s.call(e,"id")]);case"StringLiteralTypeAnnotation":return T($t(t.value,n),n);case"NumberLiteralTypeAnnotation":case"NumericLiteralTypeAnnotation":return T(JSON.stringify(t.value),n);case"BigIntLiteralTypeAnnotation":return T(t.raw,n);case"StringTypeAnnotation":return T("string",n);case"DeclareTypeAlias":r.push("declare ");case"TypeAlias":return y(["type ",s.call(e,"id"),s.call(e,"typeParameters")," = ",s.call(e,"right"),";"]);case"DeclareOpaqueType":r.push("declare ");case"OpaqueType":return r.push("opaque type ",s.call(e,"id"),s.call(e,"typeParameters")),t.supertype&&r.push(": ",s.call(e,"supertype")),t.impltype&&r.push(" = ",s.call(e,"impltype")),r.push(";"),y(r);case"TypeCastExpression":return y(["(",s.call(e,"expression"),s.call(e,"typeAnnotation"),")"]);case"TypeParameterDeclaration":case"TypeParameterInstantiation":return y(["<",T(", ").join(s.map(e,"params")),">"]);case"Variance":return t.kind==="plus"?T("+"):t.kind==="minus"?T("-"):T("");case"TypeParameter":return t.variance&&r.push(zt(s,e)),r.push(s.call(e,"name")),t.bound&&r.push(s.call(e,"bound")),t.default&&r.push("=",s.call(e,"default")),y(r);case"TypeofTypeAnnotation":return y([T("typeof ",n),s.call(e,"argument")]);case"IndexedAccessType":case"OptionalIndexedAccessType":return y([s.call(e,"objectType"),t.optional?"?.":"","[",s.call(e,"indexType"),"]"]);case"UnionTypeAnnotation":return T(" | ").join(s.map(e,"types"));case"VoidTypeAnnotation":return T("void",n);case"NullTypeAnnotation":return T("null",n);case"SymbolTypeAnnotation":return T("symbol",n);case"BigIntTypeAnnotation":return T("bigint",n);case"TSType":throw new Error("unprintable type: "+JSON.stringify(t.type));case"TSNumberKeyword":return T("number",n);case"TSBigIntKeyword":return T("bigint",n);case"TSObjectKeyword":return T("object",n);case"TSBooleanKeyword":return T("boolean",n);case"TSStringKeyword":return T("string",n);case"TSSymbolKeyword":return T("symbol",n);case"TSAnyKeyword":return T("any",n);case"TSVoidKeyword":return T("void",n);case"TSIntrinsicKeyword":return T("intrinsic",n);case"TSThisType":return T("this",n);case"TSNullKeyword":return T("null",n);case"TSUndefinedKeyword":return T("undefined",n);case"TSUnknownKeyword":return T("unknown",n);case"TSNeverKeyword":return T("never",n);case"TSArrayType":return y([s.call(e,"elementType"),"[]"]);case"TSLiteralType":return s.call(e,"literal");case"TSUnionType":return T(" | ").join(s.map(e,"types"));case"TSIntersectionType":return T(" & ").join(s.map(e,"types"));case"TSConditionalType":return r.push(s.call(e,"checkType")," extends ",s.call(e,"extendsType")," ? ",s.call(e,"trueType")," : ",s.call(e,"falseType")),y(r);case"TSInferType":return r.push("infer ",s.call(e,"typeParameter")),y(r);case"TSParenthesizedType":return y(["(",s.call(e,"typeAnnotation"),")"]);case"TSFunctionType":return y([s.call(e,"typeParameters"),"(",Ne(s,n,e),") => ",s.call(e,"typeAnnotation","typeAnnotation")]);case"TSConstructorType":return y(["new ",s.call(e,"typeParameters"),"(",Ne(s,n,e),") => ",s.call(e,"typeAnnotation","typeAnnotation")]);case"TSMappedType":return r.push(t.readonly?"readonly ":"","[",s.call(e,"typeParameter"),"]",t.optional?"?":""),t.typeAnnotation&&r.push(": ",s.call(e,"typeAnnotation"),";"),y([`{
|
|
9137
|
+
`,y(r).indent(n.tabWidth),`
|
|
9138
|
+
}`]);case"TSTupleType":return y(["[",T(", ").join(s.map(e,"elementTypes")),"]"]);case"TSNamedTupleMember":return r.push(s.call(e,"label")),t.optional&&r.push("?"),r.push(": ",s.call(e,"elementType")),y(r);case"TSRestType":return y(["...",s.call(e,"typeAnnotation")]);case"TSOptionalType":return y([s.call(e,"typeAnnotation"),"?"]);case"TSIndexedAccessType":return y([s.call(e,"objectType"),"[",s.call(e,"indexType"),"]"]);case"TSTypeOperator":return y([s.call(e,"operator")," ",s.call(e,"typeAnnotation")]);case"TSTypeLiteral":{let i=T(`
|
|
8898
9139
|
`).join(s.map(e,"members").map(a=>Xt(a)!==";"?a.concat(";"):a));return i.isEmpty()?T("{}",n):(r.push(`{
|
|
8899
9140
|
`,i.indent(n.tabWidth),`
|
|
8900
|
-
}`),
|
|
9141
|
+
}`),y(r))}case"TSEnumMember":return r.push(s.call(e,"id")),t.initializer&&r.push(" = ",s.call(e,"initializer")),y(r);case"TSTypeQuery":return y(["typeof ",s.call(e,"exprName")]);case"TSParameterProperty":return t.accessibility&&r.push(t.accessibility," "),t.export&&r.push("export "),t.static&&r.push("static "),t.readonly&&r.push("readonly "),r.push(s.call(e,"parameter")),y(r);case"TSTypeReference":return y([s.call(e,"typeName"),s.call(e,"typeParameters")]);case"TSQualifiedName":return y([s.call(e,"left"),".",s.call(e,"right")]);case"TSAsExpression":case"TSSatisfiesExpression":{let i=s.call(e,"expression");return r.push(i,t.type==="TSSatisfiesExpression"?" satisfies ":" as ",s.call(e,"typeAnnotation")),y(r)}case"TSTypeCastExpression":return y([s.call(e,"expression"),s.call(e,"typeAnnotation")]);case"TSNonNullExpression":return y([s.call(e,"expression"),"!"]);case"TSTypeAnnotation":return y([": ",s.call(e,"typeAnnotation")]);case"TSIndexSignature":return y([t.readonly?"readonly ":"","[",s.map(e,"parameters"),"]",s.call(e,"typeAnnotation")]);case"TSPropertySignature":return r.push(zt(s,e),t.readonly?"readonly ":""),t.computed?r.push("[",s.call(e,"key"),"]"):r.push(s.call(e,"key")),r.push(t.optional?"?":"",s.call(e,"typeAnnotation")),y(r);case"TSMethodSignature":return t.computed?r.push("[",s.call(e,"key"),"]"):r.push(s.call(e,"key")),t.optional&&r.push("?"),r.push(s.call(e,"typeParameters"),"(",Ne(s,n,e),")",s.call(e,"typeAnnotation")),y(r);case"TSTypePredicate":return t.asserts&&r.push("asserts "),r.push(s.call(e,"parameterName")),t.typeAnnotation&&r.push(" is ",s.call(e,"typeAnnotation","typeAnnotation")),y(r);case"TSCallSignatureDeclaration":return y([s.call(e,"typeParameters"),"(",Ne(s,n,e),")",s.call(e,"typeAnnotation")]);case"TSConstructSignatureDeclaration":return t.typeParameters?r.push("new",s.call(e,"typeParameters")):r.push("new "),r.push("(",Ne(s,n,e),")",s.call(e,"typeAnnotation")),y(r);case"TSTypeAliasDeclaration":return y([t.declare?"declare ":"","type ",s.call(e,"id"),s.call(e,"typeParameters")," = ",s.call(e,"typeAnnotation"),";"]);case"TSTypeParameter":{r.push(s.call(e,"name"));let i=s.getParentNode(0),a=X.TSMappedType.check(i);return t.constraint&&r.push(a?" in ":" extends ",s.call(e,"constraint")),t.default&&r.push(" = ",s.call(e,"default")),y(r)}case"TSTypeAssertion":return r.push("<",s.call(e,"typeAnnotation"),"> ",s.call(e,"expression")),y(r);case"TSTypeParameterDeclaration":case"TSTypeParameterInstantiation":return y(["<",T(", ").join(s.map(e,"params")),">"]);case"TSEnumDeclaration":{r.push(t.declare?"declare ":"",t.const?"const ":"","enum ",s.call(e,"id"));let i=T(`,
|
|
8901
9142
|
`).join(s.map(e,"members"));return i.isEmpty()?r.push(" {}"):r.push(` {
|
|
8902
9143
|
`,i.indent(n.tabWidth),`
|
|
8903
|
-
}`),
|
|
8904
|
-
`).join(s.map(e,"body").map(a=>Xt(a)!==";"?a.concat(";"):a));return i.isEmpty()?T("{}",n):
|
|
9144
|
+
}`),y(r)}case"TSExpressionWithTypeArguments":return y([s.call(e,"expression"),s.call(e,"typeParameters")]);case"TSInterfaceBody":{let i=T(`
|
|
9145
|
+
`).join(s.map(e,"body").map(a=>Xt(a)!==";"?a.concat(";"):a));return i.isEmpty()?T("{}",n):y([`{
|
|
8905
9146
|
`,i.indent(n.tabWidth),`
|
|
8906
|
-
}`])}case"TSImportType":return r.push("import(",s.call(e,"argument"),")"),t.qualifier&&r.push(".",s.call(e,"qualifier")),t.typeParameters&&r.push(s.call(e,"typeParameters")),
|
|
9147
|
+
}`])}case"TSImportType":return r.push("import(",s.call(e,"argument"),")"),t.qualifier&&r.push(".",s.call(e,"qualifier")),t.typeParameters&&r.push(s.call(e,"typeParameters")),y(r);case"TSImportEqualsDeclaration":return t.isExport&&r.push("export "),r.push("import ",s.call(e,"id")," = ",s.call(e,"moduleReference")),Nn(y(r));case"TSExternalModuleReference":return y(["require(",s.call(e,"expression"),")"]);case"TSModuleDeclaration":return s.getParentNode().type==="TSModuleDeclaration"?r.push("."):(t.declare&&r.push("declare "),t.global||(t.id.type==="StringLiteral"||t.id.type==="Literal"&&typeof t.id.value=="string"||t.loc&&t.loc.lines&&t.id.loc&&t.loc.lines.sliceString(t.loc.start,t.id.loc.start).indexOf("module")>=0?r.push("module "):r.push("namespace "))),r.push(s.call(e,"id")),t.body&&(r.push(" "),r.push(s.call(e,"body"))),y(r);case"TSModuleBlock":{let i=s.call(a=>bt(a,n,e),"body");return i.isEmpty()?r.push("{}"):r.push(`{
|
|
8907
9148
|
`,i.indent(n.tabWidth),`
|
|
8908
|
-
}`),
|
|
9149
|
+
}`),y(r)}case"TSInstantiationExpression":return r.push(s.call(e,"expression"),s.call(e,"typeParameters")),y(r);case"V8IntrinsicIdentifier":return y(["%",s.call(e,"name")]);case"TopicReference":return T("#");case"ClassHeritage":case"ComprehensionBlock":case"ComprehensionExpression":case"Glob":case"GeneratorExpression":case"LetStatement":case"LetExpression":case"GraphExpression":case"GraphIndexExpression":case"XMLDefaultDeclaration":case"XMLAnyName":case"XMLQualifiedIdentifier":case"XMLFunctionQualifiedIdentifier":case"XMLAttributeSelector":case"XMLFilterExpression":case"XML":case"XMLElement":case"XMLList":case"XMLEscape":case"XMLText":case"XMLStartTag":case"XMLEndTag":case"XMLPointTag":case"XMLName":case"XMLAttribute":case"XMLCdata":case"XMLComment":case"XMLProcessingInstruction":default:debugger;throw new Error("unknown type: "+JSON.stringify(t.type))}}function Gc(s,n){let e=[],t=s.getValue();return t.decorators&&t.decorators.length>0&&!Ki(s)?s.each(function(r){e.push(n(r),`
|
|
8909
9150
|
`)},"decorators"):Rn(t)&&t.declaration&&t.declaration.decorators&&s.each(function(r){e.push(n(r),`
|
|
8910
|
-
`)},"declaration","decorators"),
|
|
9151
|
+
`)},"declaration","decorators"),y(e)}function bt(s,n,e){let t=[];s.each(function(o){let l=o.getValue();l&&(l.type==="EmptyStatement"&&!(l.comments&&l.comments.length>0)||(X.Comment.check(l)||X.Statement.check(l)||os.assert(l),t.push({node:l,printed:e(o)})))});let r=null,i=t.length,a=[];return t.forEach(function(o,l){let c=o.printed,p=o.node,u=c.length>1,h=l>0,m=l<i-1,d,g,f=p&&p.loc&&p.loc.lines,v=f&&n.reuseWhitespace&&Gi(p,f);if(h)if(v){let w=f.skipSpaces(v.start,!0),E=w?w.line:1,x=v.start.line-E;d=Array(x+1).join(`
|
|
8911
9152
|
`)}else d=u?`
|
|
8912
9153
|
|
|
8913
9154
|
`:`
|
|
8914
|
-
`;else d="";if(m)if(v){let w=f.skipSpaces(v.end),x=(w?w.line:f.length)-v.end.line;
|
|
8915
|
-
`)}else
|
|
9155
|
+
`;else d="";if(m)if(v){let w=f.skipSpaces(v.end),x=(w?w.line:f.length)-v.end.line;g=Array(x+1).join(`
|
|
9156
|
+
`)}else g=u?`
|
|
8916
9157
|
|
|
8917
9158
|
`:`
|
|
8918
|
-
`;else
|
|
8919
|
-
`).join(t),
|
|
9159
|
+
`;else g="";a.push(Kc(r,d),c),m?r=g:g&&a.push(g)}),y(a)}function Kc(s,n){if(!s&&!n)return T("");if(!s)return T(n);if(!n)return T(s);let e=T(s),t=T(n);return t.length>e.length?t:e}function ca(s){let n=[];s.declare&&n.push("declare ");let e=s.accessibility||s.access;return typeof e=="string"&&n.push(e," "),s.static&&n.push("static "),s.override&&n.push("override "),s.abstract&&n.push("abstract "),s.readonly&&n.push("readonly "),n}function Hr(s,n,e){let t=s.getNode(),r=t.kind,i=[],a=t.value;X.FunctionExpression.check(a)||(a=t),i.push(...ca(t)),a.async&&i.push("async "),a.generator&&i.push("*"),(r==="get"||r==="set")&&i.push(r," ");let o=s.call(e,"key");return t.computed&&(o=y(["[",o,"]"])),i.push(o),t.optional&&i.push("?"),t===a?(i.push(s.call(e,"typeParameters"),"(",Ne(s,n,e),")",s.call(e,"returnType")),t.body?i.push(" ",s.call(e,"body")):i.push(";")):(i.push(s.call(e,"value","typeParameters"),"(",s.call(l=>Ne(l,n,e),"value"),")",s.call(e,"value","returnType")),a.body?i.push(" ",s.call(e,"value","body")):i.push(";")),y(i)}function Di(s,n,e){let t=s.map(e,"arguments"),r=Wt(n,"parameters"),i=T(", ").join(t);return i.getLineLength(1)>n.wrapColumn?(i=T(`,
|
|
9160
|
+
`).join(t),y([`(
|
|
8920
9161
|
`,i.indent(n.tabWidth),r?`,
|
|
8921
9162
|
)`:`
|
|
8922
|
-
)`])):
|
|
8923
|
-
`).join(i),Wt(n,"parameters")&&!t.rest&&r[r.length-1].type!=="RestElement"?a=
|
|
8924
|
-
`]):a=
|
|
8925
|
-
`]),
|
|
9163
|
+
)`])):y(["(",i,")"])}function Ne(s,n,e){let t=s.getValue(),r,i=[];t.params?(r=t.params,i=s.map(e,"params")):t.parameters&&(r=t.parameters,i=s.map(e,"parameters")),t.defaults&&s.each(function(o){let l=o.getName(),c=i[l];c&&o.getValue()&&(i[l]=y([c," = ",e(o)]))},"defaults"),t.rest&&i.push(y(["...",s.call(e,"rest")]));let a=T(", ").join(i);return a.length>1||a.getLineLength(1)>n.wrapColumn?(a=T(`,
|
|
9164
|
+
`).join(i),Wt(n,"parameters")&&!t.rest&&r[r.length-1].type!=="RestElement"?a=y([a,`,
|
|
9165
|
+
`]):a=y([a,`
|
|
9166
|
+
`]),y([`
|
|
8926
9167
|
`,a.indent(n.tabWidth)])):a}function pa(s,n,e){let t=s.getValue();if(t.assertions&&t.assertions.length>0){let r=[" assert {"],i=s.map(e,"assertions"),a=T(", ").join(i);return a.length>1||a.getLineLength(1)>n.wrapColumn?r.push(`
|
|
8927
9168
|
`,T(`,
|
|
8928
9169
|
`).join(i).indent(n.tabWidth),`
|
|
8929
|
-
}`):r.push(" ",a," }"),
|
|
9170
|
+
}`):r.push(" ",a," }"),y(r)}return T("")}function Li(s,n,e){let t=s.getValue(),r=["export "];t.exportKind&&t.exportKind==="type"&&(t.declaration||r.push("type "));let i=n.objectCurlySpacing;if(X.Declaration.assert(t),(t.default||t.type==="ExportDefaultDeclaration")&&r.push("default "),t.declaration)r.push(s.call(e,"declaration"));else if(t.specifiers){if(t.specifiers.length===1&&t.specifiers[0].type==="ExportBatchSpecifier")r.push("*");else if(t.specifiers.length===0)r.push("{}");else if(t.specifiers[0].type==="ExportDefaultSpecifier"){let o=[],l=[];if(s.each(function(c){c.getValue().type==="ExportDefaultSpecifier"?o.push(e(c)):l.push(e(c))},"specifiers"),o.forEach((c,p)=>{p>0&&r.push(", "),r.push(c)}),l.length>0){let c=T(", ").join(l);c.getLineLength(1)>n.wrapColumn&&(c=y([T(`,
|
|
8930
9171
|
`).join(l).indent(n.tabWidth),","])),o.length>0&&r.push(", "),c.length>1?r.push(`{
|
|
8931
9172
|
`,c,`
|
|
8932
|
-
}`):n.objectCurlySpacing?r.push("{ ",c," }"):r.push("{",c,"}")}}else r.push(i?"{ ":"{",T(", ").join(s.map(e,"specifiers")),i?" }":"}");t.source&&r.push(" from ",s.call(e,"source"),pa(s,n,e))}let a=
|
|
8933
|
-
`,Nn(s).indent(n.tabWidth)])}function Xt(s){let n=s.lastPos();do{let e=s.charAt(n);if(/\S/.test(e))return e}while(s.prevPos(n))}function Oi(s){return Xt(s)==="}"}function
|
|
8934
|
-
};`.indexOf(n)<0?
|
|
9173
|
+
}`):n.objectCurlySpacing?r.push("{ ",c," }"):r.push("{",c,"}")}}else r.push(i?"{ ":"{",T(", ").join(s.map(e,"specifiers")),i?" }":"}");t.source&&r.push(" from ",s.call(e,"source"),pa(s,n,e))}let a=y(r);return Xt(a)!==";"&&!(t.declaration&&(t.declaration.type==="FunctionDeclaration"||t.declaration.type==="ClassDeclaration"||t.declaration.type==="TSModuleDeclaration"||t.declaration.type==="TSInterfaceDeclaration"||t.declaration.type==="TSEnumDeclaration"))&&(a=y([a,";"])),a}function Vt(s,n){return Ki(s)||n.unshift("declare "),y(n)}function zt(s,n){return s.call(function(e){let t=e.getValue();return t?t==="plus"?T("+"):t==="minus"?T("-"):n(e):T("")},"variance")}function Ye(s,n){return s.length>1?y([" ",s]):y([`
|
|
9174
|
+
`,Nn(s).indent(n.tabWidth)])}function Xt(s){let n=s.lastPos();do{let e=s.charAt(n);if(/\S/.test(e))return e}while(s.prevPos(n))}function Oi(s){return Xt(s)==="}"}function In(s){return s.replace(/['"]/g,n=>n==='"'?"'":'"')}function gt(s){let n=Re(s,"value"),e=Re(s,"extra");if(e&&typeof e.raw=="string"&&n==e.rawValue)return e.raw;if(s.type==="Literal"){let t=s.raw;if(typeof t=="string"&&n==t)return t}}function En(s){return JSON.stringify(s).replace(/[\u2028\u2029]/g,function(n){return"\\u"+n.charCodeAt(0).toString(16)})}function $t(s,n){switch(os.assert(s),n.quote){case"auto":{let e=En(s),t=In(En(In(s)));return e.length>t.length?t:e}case"single":return In(En(In(s)));case"double":default:return En(s)}}function Nn(s){let n=Xt(s);return!n||`
|
|
9175
|
+
};`.indexOf(n)<0?y([s,";"]):s}function Jc(s,n){return new Hc(n).print(s)}var An;function Xc(){if(An)return An;let s=Qc();return An={parse(n,e){return Ui.parse(n,{...s,...e})}},An}function Qc(){return{sourceType:"module",strictMode:!1,allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,startLine:1,tokens:!0,plugins:["asyncGenerators","bigInt","classPrivateMethods","classPrivateProperties","classProperties","classStaticBlock","decimal","decorators-legacy","doExpressions","dynamicImport","exportDefaultFrom","exportExtensions","exportNamespaceFrom","functionBind","functionSent","importAssertions","importMeta","nullishCoalescingOperator","numericSeparator","objectRestSpread","optionalCatchBinding","optionalChaining",["pipelineOperator",{proposal:"minimal"}],["recordAndTuple",{syntaxType:"hash"}],"throwExpressions","topLevelAwait","v8intrinsic","jsx","typescript"]}}var Yc=Object.defineProperty,Zc=(s,n,e)=>n in s?Yc(s,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[n]=e,Fi=(s,n,e)=>(Zc(s,typeof n!="symbol"?n+"":n,e),e),ye=class extends Error{constructor(n,e){if(super(""),Fi(this,"rawMessage"),Fi(this,"options"),this.name="MagicastError",this.rawMessage=n,this.options=e,e?.ast&&e?.code&&e.ast.loc){let{line:t,column:r}=e.ast.loc.start,i=e.code.split(`
|
|
8935
9176
|
`),a=Math.max(0,t-3),o=Math.min(i.length,t+3),l=i.slice(a,o).map((c,p)=>(c=`${(a+p+1).toString().padStart(3," ")} | ${c}`,a+p===t-1&&(c+=`
|
|
8936
9177
|
${" ".repeat(6+r)}^`),c));n+=`
|
|
8937
9178
|
|
|
8938
9179
|
${l.join(`
|
|
8939
9180
|
`)}
|
|
8940
|
-
`}this.message=n}},ep=new Set(["Literal","StringLiteral","NumericLiteral","BooleanLiteral","NullLiteral","RegExpLiteral","BigIntLiteral"]),ua=new Set(["string","number","boolean","bigint","symbol","undefined"]),Z=Yt;function tp(s){return/^[$A-Z_a-z][\w$]*$/.test(s)}var ls="__magicast_proxy";function
|
|
8941
|
-
`),u=!1;for(let h of p){let m=h.trim();if(m.length!==0){if(e.wrapColumn&&h.length>a&&(a=h.length),e.indent){let d=h.match(/^\s+/)?.[0]||"";d.length>0&&(d.length>0&&d.length<t&&(t=d.length),d[0]===" "?r++:d.length>0&&r--)}if(m.at(-1)===";"?i++:m.length>0&&i--,e.quote||e.arrowParens){let d=m.matchAll(l);for(let
|
|
9181
|
+
`}this.message=n}},ep=new Set(["Literal","StringLiteral","NumericLiteral","BooleanLiteral","NullLiteral","RegExpLiteral","BigIntLiteral"]),ua=new Set(["string","number","boolean","bigint","symbol","undefined"]),Z=Yt;function tp(s){return/^[$A-Z_a-z][\w$]*$/.test(s)}var ls="__magicast_proxy";function ge(s,n=new Set){if(s===void 0)return Z.identifier("undefined");if(s===null)return Z.literal(null);if(ua.has(typeof s))return Z.literal(s);if(n.has(s))throw new ye("Can not serialize circular reference");if(n.add(s),s[ls])return s.$ast;if(s instanceof RegExp){let e=Z.regExpLiteral(s.source,s.flags);return delete e.extra.raw,e}return s instanceof Set?Z.newExpression(Z.identifier("Set"),[Z.arrayExpression([...s].map(e=>ge(e,n)))]):s instanceof Date?Z.newExpression(Z.identifier("Date"),[Z.literal(s.toISOString())]):s instanceof Map?Z.newExpression(Z.identifier("Map"),[Z.arrayExpression([...s].map(([e,t])=>Z.arrayExpression([ge(e,n),ge(t,n)])))]):Array.isArray(s)?Z.arrayExpression(s.map(e=>ge(e,n))):typeof s=="object"?Z.objectExpression(Object.entries(s).map(([e,t])=>Z.property("init",/^[$A-Z_a-z][\w$]*$/g.test(e)?Z.identifier(e):Z.literal(e),ge(t,n)))):Z.literal(s)}function np(s,n={}){let e=n;return e[ls]=!0,e.$ast=s,e.$type||(e.$type="object"),e}var rp={enumerable:!0,configurable:!0};function je(s,n,e){let t=np(s,n);return new Proxy({},{ownKeys(){return Object.keys(t).filter(r=>r!==ls&&!r.startsWith("$"))},getOwnPropertyDescriptor(){return rp},has(r,i){return i in t},...e,get(r,i,a){if(i in t)return t[i];if(e.get)return e.get(r,i,a)},set(r,i,a,o){return i in t?(t[i]=a,!0):e.set?e.set(r,i,a,o):!1}})}var Pe=Yt,Wr=new WeakMap;function sp(s,n,e){if(Wr.has(n))return Wr.get(n);let t=je(n,{get $declaration(){return s},get imported(){return n.type==="ImportDefaultSpecifier"?"default":n.type==="ImportNamespaceSpecifier"?"*":n.imported.type==="Identifier"?n.imported.name:n.imported.value},set imported(r){if(n.type!=="ImportSpecifier")throw new ye("Changing import name is not yet implemented");n.imported.type==="Identifier"?n.imported.name=r:n.imported.value=r},get local(){return n.local.name},set local(r){n.local.name=r},get from(){return s.source.value},set from(r){if(r===s.source.value)return;s.specifiers=s.specifiers.filter(a=>a!==n),s.specifiers.length===0&&(e.body=e.body.filter(a=>a!==s));let i=e.body.find(a=>a.type==="ImportDeclaration"&&a.source.value===r);i?i.specifiers.push(n):e.body.unshift(Pe.importDeclaration([n],Pe.stringLiteral(r)))},toJSON(){return{imported:this.imported,local:this.local,from:this.from}}},{ownKeys(){return["imported","local","from","toJSON"]}});return Wr.set(n,t),t}function ip(s,n){let e=()=>{let a=[];for(let o of s.body)if(o.type==="ImportDeclaration")for(let l of o.specifiers)a.push(sp(o,l,s));return a},t=(a,o)=>{let l=e(),c=l.find(m=>m.local===a),p=o.local||a;if(c)return c.imported=o.imported,c.local=p,c.from=o.from,!0;let u=o.imported==="default"?Pe.importDefaultSpecifier(Pe.identifier(p)):o.imported==="*"?Pe.importNamespaceSpecifier(Pe.identifier(p)):Pe.importSpecifier(Pe.identifier(o.imported),Pe.identifier(p)),h=l.find(m=>m.from===o.from)?.$declaration;return h?h.specifiers.push(u):s.body.unshift(Pe.importDeclaration([u],Pe.stringLiteral(o.from))),!0},r=a=>{let o=e().find(p=>p.local===a);if(!o)return!1;let l=o.$declaration,c=o.$ast;return l.specifiers=l.specifiers.filter(p=>p!==c),l.specifiers.length===0&&(s.body=s.body.filter(p=>p!==l)),!0},i=je(s,{$type:"imports",$add(a){i[a.local||a.imported]=a},get $items(){return e()},toJSON(){return e().reduce((a,o)=>(a[o.local]=o,a),{})}},{get(a,o){return e().find(l=>l.local===o)},set(a,o,l){return t(o,l)},deleteProperty(a,o){return r(o)},ownKeys(){return e().map(a=>a.local)},has(a,o){return e().some(l=>l.local===o)}});return i}function cs(s,n,e){let t=i=>n[i],r=(i,a)=>{n[i]=a};return je(s,{$type:"array",push(i){n.push(ge(i))},pop(){return ce(n.pop(),e)},unshift(i){n.unshift(ge(i))},shift(){return ce(n.shift(),e)},splice(i,a,...o){return n.splice(i,a,...o.map(c=>ge(c))).map(c=>ce(c,e))},find(i){return n.map(a=>ce(a,e)).find(i)},findIndex(i){return n.map(a=>ce(a,e)).findIndex(i)},includes(i){return n.map(a=>ce(a,e)).includes(i)},toJSON(){return n.map(i=>ce(i,e))}},{get(i,a){if(a==="length")return n.length;if(a===Symbol.iterator)return function*(){for(let c of n)yield ce(c,e)};if(typeof a=="symbol")return;let o=+a;if(Number.isNaN(o))return;let l=t(o);if(l)return ce(l,e)},set(i,a,o){if(typeof a=="symbol")return!1;let l=+a;return Number.isNaN(l)?!1:(r(l,ge(o)),!0)},deleteProperty(i,a){if(typeof a=="symbol")return!1;let o=+a;return Number.isNaN(o)?!1:(n[o]=ge(void 0),!0)},ownKeys(){return["length",...n.map((i,a)=>a.toString())]}})}function ap(s,n){if("elements"in s)return cs(s,s.elements,n)}function op(s,n){if(s.type!=="CallExpression")throw new ye("Not a function call");function e(r){if(r.type==="Identifier")return r.name;if(r.type==="MemberExpression")return`${e(r.object)}.${e(r.property)}`;throw new ye("Not implemented")}let t=cs(s,s.arguments,n);return je(s,{$type:"function-call",$callee:e(s.callee),$args:t},{})}var lp=Yt;function cp(s,n){if(!("properties"in s))return;let e=i=>{for(let a of s.properties){if("key"in a&&"name"in a.key&&a.key.name===i)return a.value;if(a.type==="ObjectProperty"&&(a.key.type==="StringLiteral"||a.key.type==="NumericLiteral"||a.key.type==="BooleanLiteral")&&a.key.value.toString()===i)return a.value.value??a.value}},t=(i,a=!1)=>{if("key"in i&&"name"in i.key)return i.key.name;if(i.type==="ObjectProperty"&&(i.key.type==="StringLiteral"||i.key.type==="NumericLiteral"||i.key.type==="BooleanLiteral"))return i.key.value.toString();if(a)throw new ye(`Casting "${i.type}" is not supported`,{ast:i,code:n?.$code})},r=(i,a)=>{let o=s.properties.find(l=>t(l)===i);o?o.value=a:tp(i)?s.properties.push({type:"Property",key:{type:"Identifier",name:i},value:a}):s.properties.push({type:"ObjectProperty",key:lp.stringLiteral(i),value:a})};return je(s,{$type:"object",toJSON(){return s.properties.reduce((i,a)=>("key"in a&&"name"in a.key&&(i[a.key.name]=ce(a.value,n)),i),{})}},{get(i,a){let o=e(a);if(o)return ce(o,n)},set(i,a,o){return typeof a!="string"&&(a=String(a)),r(a,ge(o)),!0},deleteProperty(i,a){typeof a!="string"&&(a=String(a));let o=s.properties.findIndex(l=>"key"in l&&"name"in l.key&&l.key.name===a);return o!==-1&&s.properties.splice(o,1),!0},ownKeys(){return s.properties.map(i=>t(i,!0)).filter(Boolean)}})}function pp(s,n){if(s.type!=="NewExpression")throw new ye("Not a new expression");function e(r){if(r.type==="Identifier")return r.name;if(r.type==="MemberExpression")return`${e(r.object)}.${e(r.property)}`;throw new ye("Not implemented")}let t=cs(s,s.arguments,n);return je(s,{$type:"new-expression",$callee:e(s.callee),$args:t},{})}function up(s){if(s.type!=="Identifier")throw new ye("Not an identifier");return je(s,{$type:"identifier",$name:s.name},{})}var Gr=new WeakMap;function ce(s,n){if(ua.has(typeof s))return s;if(ep.has(s.type))return s.value;if(Gr.has(s))return Gr.get(s);let e;switch(s.type){case"ObjectExpression":{e=cp(s,n);break}case"ArrayExpression":{e=ap(s,n);break}case"CallExpression":{e=op(s,n);break}case"NewExpression":{e=pp(s,n);break}case"Identifier":{e=up(s);break}case"TSAsExpression":case"TSSatisfiesExpression":{e=ce(s.expression,n);break}default:throw new ye(`Casting "${s.type}" is not supported`,{ast:s,code:n?.$code})}return Gr.set(s,e),e}var qt=Yt;function dp(s,n){let e=r=>{let i=r==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration";for(let a of s.body)if(a.type===i){if(r==="default")return a.declaration;if(a.declaration&&"declarations"in a.declaration){let o=a.declaration.declarations[0];if("name"in o.id&&o.id.name===r)return o.init}}},t=(r,i)=>{let a=r==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration",o=ge(i);for(let l of s.body)if(l.type===a){if(r==="default"){l.declaration=o;return}if(l.declaration&&"declarations"in l.declaration){let c=l.declaration.declarations[0];if("name"in c.id&&c.id.name===r){c.init=o;return}}}s.body.push(r==="default"?qt.exportDefaultDeclaration(o):qt.exportNamedDeclaration(qt.variableDeclaration("const",[qt.variableDeclarator(qt.identifier(r),o)])))};return je(s,{$type:"exports"},{get(r,i){let a=e(i);if(a)return ce(a,n)},set(r,i,a){return t(i,a),!0},ownKeys(){return s.body.flatMap(r=>r.type==="ExportDefaultDeclaration"?["default"]:r.type==="ExportNamedDeclaration"&&r.declaration&&"declarations"in r.declaration?r.declaration.declarations.map(i=>"name"in i.id?i.id.name:""):[]).filter(Boolean)},deleteProperty(r,i){let a=i==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration";for(let o=0;o<s.body.length;o++){let l=s.body[o];if(l.type===a){if(i==="default")return s.body.splice(o,1),!0;if(l.declaration&&"declarations"in l.declaration){let c=l.declaration.declarations[0];if("name"in c.id&&c.id.name===i)return s.body.splice(o,1),!0}}}return!1}})}function hp(s,n){let e=s.program;if(e.type!=="Program")throw new ye(`Cannot proxify ${s.type} as module`);let t={$code:n,$type:"module"},r=je(e,t,{ownKeys(){return["imports","exports","generate"]}});return t.exports=dp(e,r),t.imports=ip(e),t.generate=i=>da(r,i),r}function fp(s,n={}){let e={wrapColumn:n.wrapColumn===void 0,indent:n.tabWidth===void 0||n.useTabs===void 0,quote:n.quote===void 0,arrowParens:n.arrowParensAlways===void 0,trailingComma:n.trailingComma===void 0},t=2,r=0,i=0,a=0,o=0,l=/(?<doubleQuote>"[^"]+")|(?<singleQuote>'[^']+')|(?<singleParam>\([^),]+\)\s*=>)|(?<trailingComma>,\s*[\]}])/g,c={doubleQuote:0,singleQuote:0,singleParam:0,trailingComma:0},p=(s||"").split(`
|
|
9182
|
+
`),u=!1;for(let h of p){let m=h.trim();if(m.length!==0){if(e.wrapColumn&&h.length>a&&(a=h.length),e.indent){let d=h.match(/^\s+/)?.[0]||"";d.length>0&&(d.length>0&&d.length<t&&(t=d.length),d[0]===" "?r++:d.length>0&&r--)}if(m.at(-1)===";"?i++:m.length>0&&i--,e.quote||e.arrowParens){let d=m.matchAll(l);for(let g of d)if(g.groups)for(let f in c)g.groups[f]&&c[f]++}e.trailingComma&&((h.startsWith("}")||h.startsWith("]"))&&(u?o++:o--),u=m.endsWith(","))}}return{wrapColumn:a,useTabs:r>0,tabWidth:t,quote:c.singleQuote>c.doubleQuote?"single":"double",arrowParensAlways:c.singleParam>0,trailingComma:o>0||c.trailingComma>0,useSemi:i>0,arrayBracketSpacing:void 0,objectCurlySpacing:void 0,...n}}function mp(s,n){let e=Dc(s,{parser:n?.parser||Xc(),...n});return hp(e,s)}function da(s,n={}){let e=s.$ast||s,t=n.format===!1||!("$code"in s)?{}:fp(s.$code,n.format),{code:r,map:i}=Jc(e,{...n,...t});return{code:r,map:i}}async function ha(s,n={}){let e=await Kr.readFile(s,"utf8");return n.sourceFileName=n.sourceFileName??s,mp(e,n)}async function fa(s,n,e){let t="$ast"in s?s.$ast:s,{code:r,map:i}=da(t,e);await Kr.writeFile(n,r),i&&await Kr.writeFile(n+".map",i)}var $u=sn(lr(),1),qu=sn(qr(),1);function ma(s,n){if(typeof n=="object")for(let e in n)typeof s[e]=="object"&&typeof n[e]=="object"?ma(s[e],n[e]):s[e]=n[e]}function ps(s){return bp(s.exports.default)}function bp(s){return s.$type==="function-call"?s.$args[0]:s}function ba(s,n,e,t){let r=ps(s);r.modules||(r.modules=[]),r.modules.includes(n)||r.modules.push(n),e&&(r[e]||(r[e]={}),ma(r[e],t))}import Tp from"prompts";import gp from"kleur";import yp from"prompts";var ga=["radix-vue","tailwind-variants"],ya=["typescript","tailwindcss-animate","nuxt-icon","prettier-plugin-tailwindcss","prettier","@nuxtjs/tailwindcss","@nuxtjs/color-mode","@ianvs/prettier-plugin-sort-imports","@vueuse/nuxt"],va=["@nuxtjs/tailwindcss","@nuxtjs/color-mode","@vueuse/nuxt","nuxt-icon"],Vn=[{title:"Zinc",value:"zinc"},{title:"Slate",value:"slate"},{title:"Stone",value:"stone"},{title:"Gray",value:"gray"},{title:"Neutral",value:"neutral"},{title:"Red",value:"red"},{title:"Rose",value:"rose"},{title:"Orange",value:"orange"},{title:"Green",value:"green"},{title:"Blue",value:"blue"},{title:"Yellow",value:"yellow"},{title:"Violet",value:"violet"}];var xa=async()=>{let s=await yp([{name:"theme",type:"autocomplete",message:"Which theme do you want to start with?",choices:Vn},{name:"tailwindCSSLocation",type:"text",message:"Where is your tailwind.css file located?",initial:"assets/css/tailwind.css"},{name:"tailwindConfigLocation",type:"text",message:"Where is your tailwind.config file located?",initial:"tailwind.config.js"},{name:"componentsLocation",type:"text",message:"Where should your components be stored?",initial:"components/UI"},{name:"composablesLocation",type:"text",message:"Where should your composables be stored?",initial:"composables"},{name:"utilsLocation",type:"text",message:"Where should your utils be stored?",initial:"utils"},{name:"force",type:"confirm",message:"Should we just replace component files if they already exist?",initial:!0},{name:"useDefaultFilename",type:"confirm",message:"Would you like to use the default filename when adding components?",initial:!0},{name:"packageManager",type:"select",message:"Which package manager do you use?",choices:[{title:"NPM",value:"npm"},{title:"Yarn",value:"yarn"},{title:"PNPM",value:"pnpm"},{title:"Bun",value:"bun"}]}]);return!s||Object.keys(s).length<9?(console.log(gp.red("Incomplete configuration submitted. Exiting...")),process.exit(0)):s};var wp=process.cwd(),us="ui-thing.config.ts",xt=async()=>{if(!Se.existsSync("nuxt.config.ts"))return console.log(Pa.red(`No ${Pa.bgWhite("nuxt.config.ts")} file found. Exiting...`)),process.exit(0);let s=await ha(vp(wp,"nuxt.config.ts")),n=ps(s);return{nuxtConfig:s,defaultExport:n}},Ie=async s=>{let n=Se.existsSync(us),e={};if(!n||s?.force){if(e=await xa(),await Se.writeFile(us,`export default ${JSON.stringify(e,null,2)}`),e.packageManager==="pnpm")if(Se.existsSync(".npmrc")){let{confirmCreateNpmrc:r}=await Tp({type:"confirm",name:"confirmCreateNpmrc",message:"A .npmrc file already exists. Do you want to overwrite it?",initial:!1});r&&await Se.writeFile(".npmrc",`shamefully-hoist=true
|
|
8942
9183
|
strict-peer-dependencies=false
|
|
8943
9184
|
`)}else await Se.writeFile(".npmrc",`shamefully-hoist=true
|
|
8944
9185
|
strict-peer-dependencies=false
|
|
8945
|
-
`)}else e=(await xp({configFile:us.replace(".ts","")})).config;return Pp.isEmpty(e)&&await
|
|
8946
|
-
`),console.log(Ep
|
|
8947
|
-
${e}`)};import Ap from"prompts";var Ta=async()=>{let{components:s}=await Ap({type:"autocompleteMultiselect",name:"components",message:"Select the components you want to add",choices:an.map(n=>({title:n.name,value:n.value})),onRender(n){this.msg=n.bgCyan(" Choose components ")+" Select the components you want to add"}});return s};import fs from"node:fs";import kp from"node:path";var Zt=async(s,n)=>{if(!await nt(s)){let t=kp.dirname(s);fs.existsSync(t)||fs.mkdirSync(t,{recursive:!0})}fs.writeFileSync(s,n)};var nn=process.cwd(),qn=s=>an.find(n=>n.value.toLowerCase()===s.toLowerCase()),wa=new Np().name("add").command("add").description("Add a list of components to your project.").argument("[componentNames...]","Components that you want to add.").action(async s=>{let n=await xt(),e=await
|
|
9186
|
+
`)}else e=(await xp({configFile:us.replace(".ts","")})).config;return Pp.isEmpty(e)&&await Ie({force:!0}),Cp(e),e},Cp=s=>{s.tailwindCSSLocation&&Se.ensureFileSync(s.tailwindConfigLocation),s.tailwindConfigLocation&&Se.ensureFileSync(s.tailwindCSSLocation),s.componentsLocation&&Se.ensureDirSync(s.componentsLocation),s.composablesLocation&&Se.ensureDirSync(s.composablesLocation),s.utilsLocation&&Se.ensureDirSync(s.utilsLocation)},Pt=(s,n)=>(typeof n=="string"&&(n=[n]),n.forEach(e=>ba(s,e)),s),Tt=async(s,n="nuxt.config.ts")=>{await fa(s.$ast,n)};var zn=async()=>{let s=await Ie(),n={theme:"string",tailwindCSSLocation:"string",tailwindConfigLocation:"string",componentsLocation:"string",composablesLocation:"string",utilsLocation:"string",force:!0,useDefaultFilename:!0,packageManager:"string"},e=[];for(let t of Object.keys(n))s[t]===void 0&&e.push(t);return!(e.length>0)};import ds from"node:fs";var nt=async s=>{try{return await ds.promises.access(s,ds.constants.F_OK||ds.constants.W_OK),!0}catch{return!1}};import{execa as hs}from"execa";import $n from"lodash";import Sp from"ora";var Ge=async(s,n,e)=>{typeof n=="string"&&(n=[n]),typeof e=="string"&&(e=[e]);let t=Sp("Installing dependencies...").start();!$n.isUndefined(n)&&!$n.isEmpty(n)&&await hs(s,[s==="yarn"?"add":"install",...n]),t.text="Installing dev dependencies...",!$n.isUndefined(e)&&!$n.isEmpty(e)&&await hs(s,[s==="yarn"?"add":"install","-D",...e]),await hs(s,["run","postinstall"]),t.succeed("Installed dependencies!")};import Ip from"boxen";import Ep from"figlet";var ue=(s,n,e)=>{console.log(`
|
|
9187
|
+
`),console.log(Ip(Ep.textSync(s),{borderColor:"greenBright",padding:1,borderStyle:"round",titleAlignment:"center",...n})),e&&console.log(`
|
|
9188
|
+
${e}`)};import Ap from"prompts";var Ta=async()=>{let{components:s}=await Ap({type:"autocompleteMultiselect",name:"components",message:"Select the components you want to add",choices:an.map(n=>({title:n.name,value:n.value})),onRender(n){this.msg=n.bgCyan(" Choose components ")+" Select the components you want to add"}});return s};import fs from"node:fs";import kp from"node:path";var Zt=async(s,n)=>{if(!await nt(s)){let t=kp.dirname(s);fs.existsSync(t)||fs.mkdirSync(t,{recursive:!0})}fs.writeFileSync(s,n)};var nn=process.cwd(),qn=s=>an.find(n=>n.value.toLowerCase()===s.toLowerCase()),wa=new Np().name("add").command("add").description("Add a list of components to your project.").argument("[componentNames...]","Components that you want to add.").action(async s=>{let n=await xt(),e=await Ie();await zn()||(e=await Ie({force:!0})),tn.isEmpty(e)&&(fe.info("Config file not set. Exiting..."),process.exit(0));let r=s;if(r.length===0){let u=await Ta();(u&&u.length===0||!u)&&(fe.info("No components selected. Exiting..."),process.exit(0)),r=u}let i=[];r.forEach(u=>{qn(u)||i.push(u)}),i.length>0&&fe.error(`The following components were not found: ${ae.bgRed(i.join(", "))}`);let a=[];r.forEach(u=>{qn(u)&&a.push(qn(u))});for(let u=0;u<a.length;u++){let h=a[u];if(h.components)for(let m=0;m<h.components.length;m++){let d=h.components[m];a.find(g=>g.value===d)||a.push(qn(d))}}for(let u=0;u<a.length;u++){let h=a[u];e:for(let m=0;m<h.files.length;m++){let d=h.files[m],g=d.fileName,f=e.componentsLocation,v=en.join(nn,f,g);if(!e.useDefaultFilename){let E=await wt({type:"text",name:"value",message:"Where should we add the file",initial:f,onRender(x){this.msg=x.bgCyan(" Location ")+` Where should we add the file ${x.cyan(`${g}`)} `}});E.value&&(f=E.value,v=en.join(nn,E.value,g))}if(await nt(v)&&!e.force&&!(await wt({type:"confirm",name:"value",message:`The file that we are trying to add ${ae.bold(g)} to is already taken. Overwrite?`,initial:!1})).value){fe.info(`We will not overwrite the file for ${ae.cyan(g)}`);continue e}await Zt(v,d.fileContent),h.value==="vue-sonner"&&(n.defaultExport.imports||={},n.defaultExport.build||={},n.defaultExport.imports.imports||=[],n.defaultExport.build.transpile||=[],n.defaultExport.imports.imports.find(P=>P.from==="vue-sonner"&&P.name==="toast")||n.defaultExport.imports.imports.push({from:"vue-sonner",name:"toast",as:"useSonner"}),n.defaultExport.build.transpile.find(P=>"vue-sonner")||n.defaultExport.build.transpile.push("vue-sonner")),h.value==="datatable"&&(n.defaultExport.app||={},n.defaultExport.app.head||={},n.defaultExport.app.head.script||=[],n.defaultExport.app.head.script.find(P=>P.src==="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js")||n.defaultExport.app.head.script.push({src:"https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js",defer:!0}),n.defaultExport.app.head.script.find(P=>P.src==="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.min.js")||n.defaultExport.app.head.script.push({src:"https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.min.js",defer:!0}));t:for(let E=0;E<h.utils.length;E++){let x=h.utils[E],P=en.join(nn,e.utilsLocation,x.fileName);if(await nt(P)&&!e.force&&!(await wt({type:"confirm",name:"value",message:`The utils file that we are trying to add ${ae.bold(x.fileName)} already exists. Overwrite?`,initial:!0})).value){fe.info(`We will not overwrite the file for ${ae.cyan(x.fileName)}`);continue t}await Zt(P,x.fileContent)}t:for(let E=0;E<h.composables.length;E++){let x=h.composables[E],P=en.join(nn,e.composablesLocation,x.fileName);if(await nt(P)&&!e.force&&!(await wt({type:"confirm",name:"value",message:`The composables file that we are trying to add ${ae.bold(x.fileName)} already exists. Overwrite?`,initial:!0})).value){fe.info(`We will not overwrite the file for ${ae.cyan(x.fileName)}`);continue t}await Zt(P,x.fileContent)}t:for(let E=0;E<h.plugins.length;E++){let x=h.plugins[E],P=en.join(nn,x.dirPath,x.fileName);if(await nt(P)&&!e.force&&!(await wt({type:"confirm",name:"value",message:`The plugins file that we are trying to add ${ae.bold(x.fileName)} already exists. Overwrite?`,initial:!0})).value){fe.info(`We will not overwrite the file for ${ae.cyan(x.fileName)}`);continue t}await Zt(P,x.fileContent)}}}Pt(n.nuxtConfig,tn.uniq(a.map(u=>u.nuxtModules).flat())),await Tt(n.nuxtConfig,"nuxt.config.ts");let o=tn.uniq(a.map(u=>u.deps).flat()),l=tn.uniq(a.map(u=>u.devDeps).flat()),{confirmInstall:c}=await wt({type:"confirm",name:"confirmInstall",message:`Do you want to install the following packages: ${ae.cyan(o.join(", "))} ${ae.cyan(l.join(", "))}`,initial:!0});c&&await Ge(e.packageManager,o,l),ue("All Done!",{title:"Components Added"},`Run the ${ae.cyan("ui-thing@latest --help")} command to learn more.
|
|
8948
9189
|
`);let p=a.map(u=>u.instructions).flat();tn.remove(p,u=>!u),p.length>0&&(console.log(ae.bgCyan(" Instructions ")),p.forEach(u=>{console.log(`${ae.cyan("-")} ${u}`)}))});import{Command as Kp}from"commander";import{defu as ms}from"defu";import Aa from"fs-extra";import Jp from"kleur";var Mp=`@import url("https://rsms.me/inter/inter.css");
|
|
8949
9190
|
|
|
8950
9191
|
@tailwind base;
|
|
@@ -9106,7 +9347,7 @@ ${e}`)};import Ap from"prompts";var Ta=async()=>{let{components:s}=await Ap({typ
|
|
|
9106
9347
|
}
|
|
9107
9348
|
}
|
|
9108
9349
|
|
|
9109
|
-
`,
|
|
9350
|
+
`,Up=`
|
|
9110
9351
|
@layer base {
|
|
9111
9352
|
:root {
|
|
9112
9353
|
--background: 0 0% 100%;
|
|
@@ -9154,7 +9395,7 @@ ${e}`)};import Ap from"prompts";var Ta=async()=>{let{components:s}=await Ap({typ
|
|
|
9154
9395
|
}
|
|
9155
9396
|
}
|
|
9156
9397
|
|
|
9157
|
-
`,
|
|
9398
|
+
`,_p=`
|
|
9158
9399
|
@layer base {
|
|
9159
9400
|
:root {
|
|
9160
9401
|
--background: 0 0% 100%;
|
|
@@ -9538,7 +9779,7 @@ ${e}`)};import Ap from"prompts";var Ta=async()=>{let{components:s}=await Ap({typ
|
|
|
9538
9779
|
}
|
|
9539
9780
|
}
|
|
9540
9781
|
|
|
9541
|
-
`,Ca={ZINC:Lp,SLATE:Op,STONE:Fp,GRAY:
|
|
9782
|
+
`,Ca={ZINC:Lp,SLATE:Op,STONE:Fp,GRAY:Up,NEUTRAL:_p,RED:Bp,ROSE:Rp,ORANGE:jp,GREEN:Vp,BLUE:zp,YELLOW:$p,VIOLET:qp};var Sa=`const { fontFamily } = require("tailwindcss/defaultTheme");
|
|
9542
9783
|
|
|
9543
9784
|
/**@type {import('tailwindcss').Config} */
|
|
9544
9785
|
module.exports = {
|
|
@@ -9638,7 +9879,7 @@ module.exports = {
|
|
|
9638
9879
|
plugins: [require("tailwindcss-animate")],
|
|
9639
9880
|
};
|
|
9640
9881
|
|
|
9641
|
-
`;import{$ as Hp}from"execa";import
|
|
9882
|
+
`;import{$ as Hp}from"execa";import Ea from"fs-extra";import Wp from"ora";import Gp from"prompts";var Ia=`{
|
|
9642
9883
|
"arrowParens": "always",
|
|
9643
9884
|
"endOfLine": "lf",
|
|
9644
9885
|
"plugins": ["@ianvs/prettier-plugin-sort-imports", "prettier-plugin-tailwindcss"],
|
|
@@ -9653,7 +9894,7 @@ module.exports = {
|
|
|
9653
9894
|
"importOrder": ["<BUILTIN_MODULES>", "<THIRD_PARTY_MODULES>", "<TYPES>", "", "^[.]"]
|
|
9654
9895
|
}
|
|
9655
9896
|
|
|
9656
|
-
`;var Wn=async(s=process.cwd(),n=!0)=>{if(
|
|
9897
|
+
`;var Wn=async(s=process.cwd(),n=!0)=>{if(Ea.existsSync(`${s}/.prettierrc`)&&!(await Gp({name:"overwrite",type:"confirm",message:"A prettier config file already exists. Overwrite?",initial:!0})).overwrite)return!1;if(await Ea.writeFile(`${s}/.prettierrc`,Ia,"utf-8"),!n)return!0;let e=Wp("Formatting files with prettier...").start();return await Hp`npx prettier --write .`,e.succeed("Files formatted with prettier"),!0};var ka=new Kp().command("init").name("init").description("Initialize UI Thing in your Nuxt3 project. This will: 1. Create a tailwind.config.js file 2. Update your nuxt.config.ts file 3. Add the necessary dependencies 4. Create a ui-thing.config.ts file with the default configuration").option("-f --force","Overwrite config file if it exists.",!1).action(async s=>{let n=await xt(),e=await Ie(s);await Aa.writeFile(e.tailwindConfigLocation,Sa,"utf-8"),Aa.writeFileSync(e.tailwindCSSLocation,Hn(e.theme.toUpperCase()),"utf-8"),Pt(n.nuxtConfig,va),n.defaultExport.tailwindcss=ms(n.defaultExport.tailwindcss,{exposeConfig:!0}),n.defaultExport.colorMode=ms(n.defaultExport.colorMode,{classSuffix:""}),n.defaultExport.typescript=ms(n.defaultExport.typescript,{shim:!1}),n.defaultExport.imports||={},n.defaultExport.imports.imports||=[],n.defaultExport.imports.imports.find(i=>i.from==="tailwind-variants"&&i.name==="tv")||n.defaultExport.imports.imports.push({from:"tailwind-variants",name:"tv"}),n.defaultExport.imports.imports.find(i=>i.from==="tailwind-variants"&&i.name==="VariantProps")||n.defaultExport.imports.imports.push({from:"tailwind-variants",name:"VariantProps",type:!0}),await Tt(n.nuxtConfig,"nuxt.config.ts"),await Ge(e.packageManager,ga,ya),await Wn(),ue("Initialized",{title:"Complete"},`Feel free to start adding components with the ${Jp.bgWhite(" add ")} command.`)});import{Command as Xp}from"commander";import Qp from"prompts";var Na=new Xp().command("prettier").name("prettier").description("Add prettier to your project.").action(async()=>{if(!await Wn(void 0,!1)){ue("Not Added",{title:"Prettier Not Added",borderColor:"red"},"Prettier config was not added.");return}let{pkgManager:n}=await Qp({name:"pkgManager",type:"select",message:"Which package manager are you using?",choices:[{title:"npm",value:"npm"},{title:"yarn",value:"yarn"},{title:"pnpm",value:"pnpm"},{title:"bun",value:"bun"}]});if(!n)return process.exit(0);await Ge(n,void 0,["prettier","prettier-plugin-tailwindcss","@ianvs/prettier-plugin-sort-imports"]),ue("All Done!",{title:"Prettier Added"},"A .prettierrc file has been added to your project and the code formatted. Enjoy!")});import{Command as Yp}from"commander";import Zp from"prompts";import bs from"fs-extra";var Ma=`import { logicAnd, logicNot } from "@vueuse/math";
|
|
9657
9898
|
import { computed, ref } from "vue";
|
|
9658
9899
|
import type { ComputedRef, WatchSource } from "vue";
|
|
9659
9900
|
|
|
@@ -9867,5 +10108,5 @@ export const defineShortcuts = (config: ShortcutsConfig, options: ShortcutsOptio
|
|
|
9867
10108
|
};
|
|
9868
10109
|
|
|
9869
10110
|
export const useShortcuts = createSharedComposable(_useShortcuts);
|
|
9870
|
-
`;var La=async(s=process.cwd())=>{await bs.ensureDir(`${s}/composables`),await bs.writeFile(`${s}/composables/defineShortcuts.ts`,Ma,"utf-8"),await bs.writeFile(`${s}/composables/useShortcuts.ts`,Da,"utf-8")};var Oa=new Yp().command("shortcuts").name("shortcuts").description("Add the defineShortcuts & useShortcuts composables to your project.").action(async()=>{await La();let s=await xt();Pt(s.nuxtConfig,["@vueuse/nuxt"]),await Tt(s.nuxtConfig,"nuxt.config.ts");let{pkgManager:n}=await Zp({name:"pkgManager",type:"select",message:"Which package manager are you using?",choices:[{title:"npm",value:"npm"},{title:"yarn",value:"yarn"},{title:"pnpm",value:"pnpm"},{title:"bun",value:"bun"}]});if(!n)return process.exit(0);await Ge(n,void 0,["@vueuse/math","@vueuse/nuxt"]),ue("All Done!",{title:"Shortcuts Added"},"Check the composables folder for the defineShortcuts & useShortcuts composables.")});import{Command as eu}from"commander";import Fa from"fs-extra";import
|
|
10111
|
+
`;var La=async(s=process.cwd())=>{await bs.ensureDir(`${s}/composables`),await bs.writeFile(`${s}/composables/defineShortcuts.ts`,Ma,"utf-8"),await bs.writeFile(`${s}/composables/useShortcuts.ts`,Da,"utf-8")};var Oa=new Yp().command("shortcuts").name("shortcuts").description("Add the defineShortcuts & useShortcuts composables to your project.").action(async()=>{await La();let s=await xt();Pt(s.nuxtConfig,["@vueuse/nuxt"]),await Tt(s.nuxtConfig,"nuxt.config.ts");let{pkgManager:n}=await Zp({name:"pkgManager",type:"select",message:"Which package manager are you using?",choices:[{title:"npm",value:"npm"},{title:"yarn",value:"yarn"},{title:"pnpm",value:"pnpm"},{title:"bun",value:"bun"}]});if(!n)return process.exit(0);await Ge(n,void 0,["@vueuse/math","@vueuse/nuxt"]),ue("All Done!",{title:"Shortcuts Added"},"Check the composables folder for the defineShortcuts & useShortcuts composables.")});import{Command as eu}from"commander";import Fa from"fs-extra";import gs from"lodash";import Ua from"prompts";var _a=new eu().command("theme").name("theme").description("Add a new theme to your project.").action(async()=>{let s=await Ie();await zn()||(s=await Ie({force:!0})),gs.isEmpty(s)&&(fe.info("Config file not set. Exiting..."),process.exit(0));let{theme:e}=await Ua([{name:"theme",type:"autocomplete",message:"Which theme do you want to add?",choices:Vn}]);if(!e)return console.log("No theme selected. Exiting..."),process.exit(0);if(Fa.existsSync(s.tailwindCSSLocation)){let{force:t}=await Ua([{name:"force",type:"confirm",message:"Do you want to overwrite your current css file?",initial:!0}]);if(!t)return console.log("Exiting..."),process.exit(0)}Fa.writeFileSync(s.tailwindCSSLocation,Hn(e.toUpperCase()),"utf-8"),ue(`${gs.capitalize(e)}`,{title:"New Theme Added"},`${gs.capitalize(e)} theme has been added to ${s.tailwindCSSLocation}`)});process.on("SIGINT",()=>process.exit(0));process.on("SIGTERM",()=>process.exit(0));process.on("SIGTSTP",()=>process.exit(0));var Ba=new tu;console.clear();ue("UI Thing",{title:"Welcome"});console.log();Ba.name("ui-thing").description("CLI for adding ui-thing components to your Nuxt 3 application").version("0.0.1").addCommand(ka).addCommand(wa).addCommand(_a).addCommand(Oa).addCommand(Na);Ba.parse(process.argv);
|
|
9871
10112
|
//# sourceMappingURL=index.js.map
|