builder.io 1.3.2 → 1.3.4
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/cli/index.cjs +254 -254
- package/cli/index.cjs.map +3 -3
- package/core/index.cjs +39 -39
- package/core/index.mjs +39 -39
- package/node/index.cjs +135 -95
- package/node/index.mjs +135 -95
- package/package.json +1 -1
- package/server/index.cjs +3 -3
- package/server/index.mjs +3 -3
- package/types/cli/builder-add/interface.d.ts +2 -2
- package/types/cli/code.d.ts +1 -0
- package/types/cli/constants.d.ts +1 -1
- package/types/core/adapters/angular/angular-app-routes-update.unit.d.ts +1 -0
- package/types/core/adapters/angular/types.d.ts +11 -0
- package/types/node/node-sys.d.ts +2 -0
- package/types/types.d.ts +1 -0
package/node/index.mjs
CHANGED
|
@@ -1,106 +1,146 @@
|
|
|
1
|
-
var ua=Object.create;var Cs=Object.defineProperty;var ha=Object.getOwnPropertyDescriptor;var pa=Object.getOwnPropertyNames;var fa=Object.getPrototypeOf,da=Object.prototype.hasOwnProperty;var he=(i,s)=>()=>(s||i((s={exports:{}}).exports,s),s.exports),ma=(i,s)=>{for(var e in s)Cs(i,e,{get:s[e],enumerable:!0})},ya=(i,s,e,t)=>{if(s&&typeof s=="object"||typeof s=="function")for(let r of pa(s))!da.call(i,r)&&r!==e&&Cs(i,r,{get:()=>s[r],enumerable:!(t=ha(s,r))||t.enumerable});return i};var Is=(i,s,e)=>(e=i!=null?ua(fa(i)):{},ya(s||!i||!i.__esModule?Cs(e,"default",{value:i,enumerable:!0}):e,i));var Kr=he((cu,Jr)=>{"use strict";Jr.exports=function(){if(process.env.npm_config_user_agent)return ga(process.env.npm_config_user_agent)};function ga(i){let s=i.split(" ")[0],e=s.lastIndexOf("/"),t=s.substring(0,e);return{name:t==="npminstall"?"cnpm":t,version:s.substring(e+1)}}});var Zr=he(ks=>{var Yr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");ks.encode=function(i){if(0<=i&&i<Yr.length)return Yr[i];throw new TypeError("Must be between 0 and 63: "+i)};ks.decode=function(i){var s=65,e=90,t=97,r=122,n=48,a=57,o=43,l=47,c=26,u=52;return s<=i&&i<=e?i-s:t<=i&&i<=r?i-t+c:n<=i&&i<=a?i-n+u:i==o?62:i==l?63:-1}});var Os=he(Ds=>{var ei=Zr(),Ls=5,ti=1<<Ls,si=ti-1,ri=ti;function Ta(i){return i<0?(-i<<1)+1:(i<<1)+0}function Pa(i){var s=(i&1)===1,e=i>>1;return s?-e:e}Ds.encode=function(s){var e="",t,r=Ta(s);do t=r&si,r>>>=Ls,r>0&&(t|=ri),e+=ei.encode(t);while(r>0);return e};Ds.decode=function(s,e,t){var r=s.length,n=0,a=0,o,l;do{if(e>=r)throw new Error("Expected more digits in base 64 VLQ value.");if(l=ei.decode(s.charCodeAt(e++)),l===-1)throw new Error("Invalid base64 digit: "+s.charAt(e-1));o=!!(l&ri),l&=si,n=n+(l<<a),a+=Ls}while(o);t.value=Pa(n),t.rest=e}});var Qe=he(ee=>{function Sa(i,s,e){if(s in i)return i[s];if(arguments.length===3)return e;throw new Error('"'+s+'" is a required argument.')}ee.getArg=Sa;var ii=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Aa=/^data:.+\,.+$/;function yt(i){var s=i.match(ii);return s?{scheme:s[1],auth:s[2],host:s[3],port:s[4],path:s[5]}:null}ee.urlParse=yt;function Ge(i){var s="";return i.scheme&&(s+=i.scheme+":"),s+="//",i.auth&&(s+=i.auth+"@"),i.host&&(s+=i.host),i.port&&(s+=":"+i.port),i.path&&(s+=i.path),s}ee.urlGenerate=Ge;var Ea=32;function wa(i){var s=[];return function(e){for(var t=0;t<s.length;t++)if(s[t].input===e){var r=s[0];return s[0]=s[t],s[t]=r,s[0].result}var n=i(e);return s.unshift({input:e,result:n}),s.length>Ea&&s.pop(),n}}var Ms=wa(function(s){var e=s,t=yt(s);if(t){if(!t.path)return s;e=t.path}for(var r=ee.isAbsolute(e),n=[],a=0,o=0;;)if(a=o,o=e.indexOf("/",a),o===-1){n.push(e.slice(a));break}else for(n.push(e.slice(a,o));o<e.length&&e[o]==="/";)o++;for(var l,c=0,o=n.length-1;o>=0;o--)l=n[o],l==="."?n.splice(o,1):l===".."?c++:c>0&&(l===""?(n.splice(o+1,c),c=0):(n.splice(o,2),c--));return e=n.join("/"),e===""&&(e=r?"/":"."),t?(t.path=e,Ge(t)):e});ee.normalize=Ms;function ni(i,s){i===""&&(i="."),s===""&&(s=".");var e=yt(s),t=yt(i);if(t&&(i=t.path||"/"),e&&!e.scheme)return t&&(e.scheme=t.scheme),Ge(e);if(e||s.match(Aa))return s;if(t&&!t.host&&!t.path)return t.host=s,Ge(t);var r=s.charAt(0)==="/"?s:Ms(i.replace(/\/+$/,"")+"/"+s);return t?(t.path=r,Ge(t)):r}ee.join=ni;ee.isAbsolute=function(i){return i.charAt(0)==="/"||ii.test(i)};function va(i,s){i===""&&(i="."),i=i.replace(/\/$/,"");for(var e=0;s.indexOf(i+"/")!==0;){var t=i.lastIndexOf("/");if(t<0||(i=i.slice(0,t),i.match(/^([^\/]+:\/)?\/*$/)))return s;++e}return Array(e+1).join("../")+s.substr(i.length+1)}ee.relative=va;var ai=function(){var i=Object.create(null);return!("__proto__"in i)}();function oi(i){return i}function Ca(i){return li(i)?"$"+i:i}ee.toSetString=ai?oi:Ca;function Ia(i){return li(i)?i.slice(1):i}ee.fromSetString=ai?oi:Ia;function li(i){if(!i)return!1;var s=i.length;if(s<9||i.charCodeAt(s-1)!==95||i.charCodeAt(s-2)!==95||i.charCodeAt(s-3)!==111||i.charCodeAt(s-4)!==116||i.charCodeAt(s-5)!==111||i.charCodeAt(s-6)!==114||i.charCodeAt(s-7)!==112||i.charCodeAt(s-8)!==95||i.charCodeAt(s-9)!==95)return!1;for(var e=s-10;e>=0;e--)if(i.charCodeAt(e)!==36)return!1;return!0}function Na(i,s,e){var t=Ne(i.source,s.source);return t!==0||(t=i.originalLine-s.originalLine,t!==0)||(t=i.originalColumn-s.originalColumn,t!==0||e)||(t=i.generatedColumn-s.generatedColumn,t!==0)||(t=i.generatedLine-s.generatedLine,t!==0)?t:Ne(i.name,s.name)}ee.compareByOriginalPositions=Na;function ka(i,s,e){var t;return t=i.originalLine-s.originalLine,t!==0||(t=i.originalColumn-s.originalColumn,t!==0||e)||(t=i.generatedColumn-s.generatedColumn,t!==0)||(t=i.generatedLine-s.generatedLine,t!==0)?t:Ne(i.name,s.name)}ee.compareByOriginalPositionsNoSource=ka;function La(i,s,e){var t=i.generatedLine-s.generatedLine;return t!==0||(t=i.generatedColumn-s.generatedColumn,t!==0||e)||(t=Ne(i.source,s.source),t!==0)||(t=i.originalLine-s.originalLine,t!==0)||(t=i.originalColumn-s.originalColumn,t!==0)?t:Ne(i.name,s.name)}ee.compareByGeneratedPositionsDeflated=La;function Da(i,s,e){var t=i.generatedColumn-s.generatedColumn;return t!==0||e||(t=Ne(i.source,s.source),t!==0)||(t=i.originalLine-s.originalLine,t!==0)||(t=i.originalColumn-s.originalColumn,t!==0)?t:Ne(i.name,s.name)}ee.compareByGeneratedPositionsDeflatedNoLine=Da;function Ne(i,s){return i===s?0:i===null?1:s===null?-1:i>s?1:-1}function Oa(i,s){var e=i.generatedLine-s.generatedLine;return e!==0||(e=i.generatedColumn-s.generatedColumn,e!==0)||(e=Ne(i.source,s.source),e!==0)||(e=i.originalLine-s.originalLine,e!==0)||(e=i.originalColumn-s.originalColumn,e!==0)?e:Ne(i.name,s.name)}ee.compareByGeneratedPositionsInflated=Oa;function Ma(i){return JSON.parse(i.replace(/^\)]}'[^\n]*\n/,""))}ee.parseSourceMapInput=Ma;function Fa(i,s,e){if(s=s||"",i&&(i[i.length-1]!=="/"&&s[0]!=="/"&&(i+="/"),s=i+s),e){var t=yt(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))}s=ni(Ge(t),s)}return Ms(s)}ee.computeSourceURL=Fa});var _s=he(ci=>{var Fs=Qe(),Bs=Object.prototype.hasOwnProperty,$e=typeof Map<"u";function ke(){this._array=[],this._set=$e?new Map:Object.create(null)}ke.fromArray=function(s,e){for(var t=new ke,r=0,n=s.length;r<n;r++)t.add(s[r],e);return t};ke.prototype.size=function(){return $e?this._set.size:Object.getOwnPropertyNames(this._set).length};ke.prototype.add=function(s,e){var t=$e?s:Fs.toSetString(s),r=$e?this.has(s):Bs.call(this._set,t),n=this._array.length;(!r||e)&&this._array.push(s),r||($e?this._set.set(s,n):this._set[t]=n)};ke.prototype.has=function(s){if($e)return this._set.has(s);var e=Fs.toSetString(s);return Bs.call(this._set,e)};ke.prototype.indexOf=function(s){if($e){var e=this._set.get(s);if(e>=0)return e}else{var t=Fs.toSetString(s);if(Bs.call(this._set,t))return this._set[t]}throw new Error('"'+s+'" is not in the set.')};ke.prototype.at=function(s){if(s>=0&&s<this._array.length)return this._array[s];throw new Error("No element indexed by "+s)};ke.prototype.toArray=function(){return this._array.slice()};ci.ArraySet=ke});var pi=he(hi=>{var ui=Qe();function Ba(i,s){var e=i.generatedLine,t=s.generatedLine,r=i.generatedColumn,n=s.generatedColumn;return t>e||t==e&&n>=r||ui.compareByGeneratedPositionsInflated(i,s)<=0}function zt(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}zt.prototype.unsortedForEach=function(s,e){this._array.forEach(s,e)};zt.prototype.add=function(s){Ba(this._last,s)?(this._last=s,this._array.push(s)):(this._sorted=!1,this._array.push(s))};zt.prototype.toArray=function(){return this._sorted||(this._array.sort(ui.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};hi.MappingList=zt});var js=he(fi=>{var gt=Os(),Q=Qe(),Wt=_s().ArraySet,_a=pi().MappingList;function ye(i){i||(i={}),this._file=Q.getArg(i,"file",null),this._sourceRoot=Q.getArg(i,"sourceRoot",null),this._skipValidation=Q.getArg(i,"skipValidation",!1),this._ignoreInvalidMapping=Q.getArg(i,"ignoreInvalidMapping",!1),this._sources=new Wt,this._names=new Wt,this._mappings=new _a,this._sourcesContents=null}ye.prototype._version=3;ye.fromSourceMap=function(s,e){var t=s.sourceRoot,r=new ye(Object.assign(e||{},{file:s.file,sourceRoot:t}));return s.eachMapping(function(n){var a={generated:{line:n.generatedLine,column:n.generatedColumn}};n.source!=null&&(a.source=n.source,t!=null&&(a.source=Q.relative(t,a.source)),a.original={line:n.originalLine,column:n.originalColumn},n.name!=null&&(a.name=n.name)),r.addMapping(a)}),s.sources.forEach(function(n){var a=n;t!==null&&(a=Q.relative(t,n)),r._sources.has(a)||r._sources.add(a);var o=s.sourceContentFor(n);o!=null&&r.setSourceContent(n,o)}),r};ye.prototype.addMapping=function(s){var e=Q.getArg(s,"generated"),t=Q.getArg(s,"original",null),r=Q.getArg(s,"source",null),n=Q.getArg(s,"name",null);!this._skipValidation&&this._validateMapping(e,t,r,n)===!1||(r!=null&&(r=String(r),this._sources.has(r)||this._sources.add(r)),n!=null&&(n=String(n),this._names.has(n)||this._names.add(n)),this._mappings.add({generatedLine:e.line,generatedColumn:e.column,originalLine:t!=null&&t.line,originalColumn:t!=null&&t.column,source:r,name:n}))};ye.prototype.setSourceContent=function(s,e){var t=s;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))};ye.prototype.applySourceMap=function(s,e,t){var r=e;if(e==null){if(s.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=s.file}var n=this._sourceRoot;n!=null&&(r=Q.relative(n,r));var a=new Wt,o=new Wt;this._mappings.unsortedForEach(function(l){if(l.source===r&&l.originalLine!=null){var c=s.originalPositionFor({line:l.originalLine,column:l.originalColumn});c.source!=null&&(l.source=c.source,t!=null&&(l.source=Q.join(t,l.source)),n!=null&&(l.source=Q.relative(n,l.source)),l.originalLine=c.line,l.originalColumn=c.column,c.name!=null&&(l.name=c.name))}var u=l.source;u!=null&&!a.has(u)&&a.add(u);var h=l.name;h!=null&&!o.has(h)&&o.add(h)},this),this._sources=a,this._names=o,s.sources.forEach(function(l){var c=s.sourceContentFor(l);c!=null&&(t!=null&&(l=Q.join(t,l)),n!=null&&(l=Q.relative(n,l)),this.setSourceContent(l,c))},this)};ye.prototype._validateMapping=function(s,e,t,r){if(e&&typeof e.line!="number"&&typeof e.column!="number"){var n="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(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(n),!1;throw new Error(n)}if(!(s&&"line"in s&&"column"in s&&s.line>0&&s.column>=0&&!e&&!t&&!r)){if(s&&"line"in s&&"column"in s&&e&&"line"in e&&"column"in e&&s.line>0&&s.column>=0&&e.line>0&&e.column>=0&&t)return;var n="Invalid mapping: "+JSON.stringify({generated:s,source:t,original:e,name:r});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(n),!1;throw new Error(n)}};ye.prototype._serializeMappings=function(){for(var s=0,e=1,t=0,r=0,n=0,a=0,o="",l,c,u,h,f=this._mappings.toArray(),d=0,p=f.length;d<p;d++){if(c=f[d],l="",c.generatedLine!==e)for(s=0;c.generatedLine!==e;)l+=";",e++;else if(d>0){if(!Q.compareByGeneratedPositionsInflated(c,f[d-1]))continue;l+=","}l+=gt.encode(c.generatedColumn-s),s=c.generatedColumn,c.source!=null&&(h=this._sources.indexOf(c.source),l+=gt.encode(h-a),a=h,l+=gt.encode(c.originalLine-1-r),r=c.originalLine-1,l+=gt.encode(c.originalColumn-t),t=c.originalColumn,c.name!=null&&(u=this._names.indexOf(c.name),l+=gt.encode(u-n),n=u)),o+=l}return o};ye.prototype._generateSourcesContent=function(s,e){return s.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)};ye.prototype.toJSON=function(){var s={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(s.file=this._file),this._sourceRoot!=null&&(s.sourceRoot=this._sourceRoot),this._sourcesContents&&(s.sourcesContent=this._generateSourcesContent(s.sources,s.sourceRoot)),s};ye.prototype.toString=function(){return JSON.stringify(this.toJSON())};fi.SourceMapGenerator=ye});var di=he(qe=>{qe.GREATEST_LOWER_BOUND=1;qe.LEAST_UPPER_BOUND=2;function Rs(i,s,e,t,r,n){var a=Math.floor((s-i)/2)+i,o=r(e,t[a],!0);return o===0?a:o>0?s-a>1?Rs(a,s,e,t,r,n):n==qe.LEAST_UPPER_BOUND?s<t.length?s:-1:a:a-i>1?Rs(i,a,e,t,r,n):n==qe.LEAST_UPPER_BOUND?a:i<0?-1:i}qe.search=function(s,e,t,r){if(e.length===0)return-1;var n=Rs(-1,e.length,s,e,t,r||qe.GREATEST_LOWER_BOUND);if(n<0)return-1;for(;n-1>=0&&t(e[n],e[n-1],!0)===0;)--n;return n}});var gi=he(yi=>{function ja(i){function s(r,n,a){var o=r[n];r[n]=r[a],r[a]=o}function e(r,n){return Math.round(r+Math.random()*(n-r))}function t(r,n,a,o){if(a<o){var l=e(a,o),c=a-1;s(r,l,o);for(var u=r[o],h=a;h<o;h++)n(r[h],u,!1)<=0&&(c+=1,s(r,c,h));s(r,c+1,h);var f=c+1;t(r,n,a,f-1),t(r,n,f+1,o)}}return t}function Ra(i){let s=ja.toString();return new Function(`return ${s}`)()(i)}var mi=new WeakMap;yi.quickSort=function(i,s,e=0){let t=mi.get(s);t===void 0&&(t=Ra(s),mi.set(s,t)),t(i,s,e,i.length-1)}});var Ti=he(Jt=>{var N=Qe(),Vs=di(),Ye=_s().ArraySet,Ua=Os(),xt=gi().quickSort;function K(i,s){var e=i;return typeof i=="string"&&(e=N.parseSourceMapInput(i)),e.sections!=null?new be(e,s):new te(e,s)}K.fromSourceMap=function(i,s){return te.fromSourceMap(i,s)};K.prototype._version=3;K.prototype.__generatedMappings=null;Object.defineProperty(K.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});K.prototype.__originalMappings=null;Object.defineProperty(K.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});K.prototype._charIsMappingSeparator=function(s,e){var t=s.charAt(e);return t===";"||t===","};K.prototype._parseMappings=function(s,e){throw new Error("Subclasses must implement _parseMappings")};K.GENERATED_ORDER=1;K.ORIGINAL_ORDER=2;K.GREATEST_LOWER_BOUND=1;K.LEAST_UPPER_BOUND=2;K.prototype.eachMapping=function(s,e,t){var r=e||null,n=t||K.GENERATED_ORDER,a;switch(n){case K.GENERATED_ORDER:a=this._generatedMappings;break;case K.ORIGINAL_ORDER:a=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var o=this.sourceRoot,l=s.bind(r),c=this._names,u=this._sources,h=this._sourceMapURL,f=0,d=a.length;f<d;f++){var p=a[f],g=p.source===null?null:u.at(p.source);g!==null&&(g=N.computeSourceURL(o,g,h)),l({source:g,generatedLine:p.generatedLine,generatedColumn:p.generatedColumn,originalLine:p.originalLine,originalColumn:p.originalColumn,name:p.name===null?null:c.at(p.name)})}};K.prototype.allGeneratedPositionsFor=function(s){var e=N.getArg(s,"line"),t={source:N.getArg(s,"source"),originalLine:e,originalColumn:N.getArg(s,"column",0)};if(t.source=this._findSourceIndex(t.source),t.source<0)return[];var r=[],n=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",N.compareByOriginalPositions,Vs.LEAST_UPPER_BOUND);if(n>=0){var a=this._originalMappings[n];if(s.column===void 0)for(var o=a.originalLine;a&&a.originalLine===o;)r.push({line:N.getArg(a,"generatedLine",null),column:N.getArg(a,"generatedColumn",null),lastColumn:N.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++n];else for(var l=a.originalColumn;a&&a.originalLine===e&&a.originalColumn==l;)r.push({line:N.getArg(a,"generatedLine",null),column:N.getArg(a,"generatedColumn",null),lastColumn:N.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++n]}return r};Jt.SourceMapConsumer=K;function te(i,s){var e=i;typeof i=="string"&&(e=N.parseSourceMapInput(i));var t=N.getArg(e,"version"),r=N.getArg(e,"sources"),n=N.getArg(e,"names",[]),a=N.getArg(e,"sourceRoot",null),o=N.getArg(e,"sourcesContent",null),l=N.getArg(e,"mappings"),c=N.getArg(e,"file",null);if(t!=this._version)throw new Error("Unsupported version: "+t);a&&(a=N.normalize(a)),r=r.map(String).map(N.normalize).map(function(u){return a&&N.isAbsolute(a)&&N.isAbsolute(u)?N.relative(a,u):u}),this._names=Ye.fromArray(n.map(String),!0),this._sources=Ye.fromArray(r,!0),this._absoluteSources=this._sources.toArray().map(function(u){return N.computeSourceURL(a,u,s)}),this.sourceRoot=a,this.sourcesContent=o,this._mappings=l,this._sourceMapURL=s,this.file=c}te.prototype=Object.create(K.prototype);te.prototype.consumer=K;te.prototype._findSourceIndex=function(i){var s=i;if(this.sourceRoot!=null&&(s=N.relative(this.sourceRoot,s)),this._sources.has(s))return this._sources.indexOf(s);var e;for(e=0;e<this._absoluteSources.length;++e)if(this._absoluteSources[e]==i)return e;return-1};te.fromSourceMap=function(s,e){var t=Object.create(te.prototype),r=t._names=Ye.fromArray(s._names.toArray(),!0),n=t._sources=Ye.fromArray(s._sources.toArray(),!0);t.sourceRoot=s._sourceRoot,t.sourcesContent=s._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=s._file,t._sourceMapURL=e,t._absoluteSources=t._sources.toArray().map(function(d){return N.computeSourceURL(t.sourceRoot,d,e)});for(var a=s._mappings.toArray().slice(),o=t.__generatedMappings=[],l=t.__originalMappings=[],c=0,u=a.length;c<u;c++){var h=a[c],f=new bi;f.generatedLine=h.generatedLine,f.generatedColumn=h.generatedColumn,h.source&&(f.source=n.indexOf(h.source),f.originalLine=h.originalLine,f.originalColumn=h.originalColumn,h.name&&(f.name=r.indexOf(h.name)),l.push(f)),o.push(f)}return xt(t.__originalMappings,N.compareByOriginalPositions),t};te.prototype._version=3;Object.defineProperty(te.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function bi(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}var Us=N.compareByGeneratedPositionsDeflatedNoLine;function xi(i,s){let e=i.length,t=i.length-s;if(!(t<=1))if(t==2){let r=i[s],n=i[s+1];Us(r,n)>0&&(i[s]=n,i[s+1]=r)}else if(t<20)for(let r=s;r<e;r++)for(let n=r;n>s;n--){let a=i[n-1],o=i[n];if(Us(a,o)<=0)break;i[n-1]=o,i[n]=a}else xt(i,Us,s)}te.prototype._parseMappings=function(s,e){var t=1,r=0,n=0,a=0,o=0,l=0,c=s.length,u=0,h={},f={},d=[],p=[],g,y,b,P,k;let T=0;for(;u<c;)if(s.charAt(u)===";")t++,u++,r=0,xi(p,T),T=p.length;else if(s.charAt(u)===",")u++;else{for(g=new bi,g.generatedLine=t,P=u;P<c&&!this._charIsMappingSeparator(s,P);P++);for(y=s.slice(u,P),b=[];u<P;)Ua.decode(s,u,f),k=f.value,u=f.rest,b.push(k);if(b.length===2)throw new Error("Found a source, but no line and column");if(b.length===3)throw new Error("Found a source and line, but no column");if(g.generatedColumn=r+b[0],r=g.generatedColumn,b.length>1&&(g.source=o+b[1],o+=b[1],g.originalLine=n+b[2],n=g.originalLine,g.originalLine+=1,g.originalColumn=a+b[3],a=g.originalColumn,b.length>4&&(g.name=l+b[4],l+=b[4])),p.push(g),typeof g.originalLine=="number"){let E=g.source;for(;d.length<=E;)d.push(null);d[E]===null&&(d[E]=[]),d[E].push(g)}}xi(p,T),this.__generatedMappings=p;for(var A=0;A<d.length;A++)d[A]!=null&&xt(d[A],N.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...d)};te.prototype._findMapping=function(s,e,t,r,n,a){if(s[t]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+s[t]);if(s[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+s[r]);return Vs.search(s,e,n,a)};te.prototype.computeColumnSpans=function(){for(var s=0;s<this._generatedMappings.length;++s){var e=this._generatedMappings[s];if(s+1<this._generatedMappings.length){var t=this._generatedMappings[s+1];if(e.generatedLine===t.generatedLine){e.lastGeneratedColumn=t.generatedColumn-1;continue}}e.lastGeneratedColumn=1/0}};te.prototype.originalPositionFor=function(s){var e={generatedLine:N.getArg(s,"line"),generatedColumn:N.getArg(s,"column")},t=this._findMapping(e,this._generatedMappings,"generatedLine","generatedColumn",N.compareByGeneratedPositionsDeflated,N.getArg(s,"bias",K.GREATEST_LOWER_BOUND));if(t>=0){var r=this._generatedMappings[t];if(r.generatedLine===e.generatedLine){var n=N.getArg(r,"source",null);n!==null&&(n=this._sources.at(n),n=N.computeSourceURL(this.sourceRoot,n,this._sourceMapURL));var a=N.getArg(r,"name",null);return a!==null&&(a=this._names.at(a)),{source:n,line:N.getArg(r,"originalLine",null),column:N.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(s){return s==null}):!1};te.prototype.sourceContentFor=function(s,e){if(!this.sourcesContent)return null;var t=this._findSourceIndex(s);if(t>=0)return this.sourcesContent[t];var r=s;this.sourceRoot!=null&&(r=N.relative(this.sourceRoot,r));var n;if(this.sourceRoot!=null&&(n=N.urlParse(this.sourceRoot))){var a=r.replace(/^file:\/\//,"");if(n.scheme=="file"&&this._sources.has(a))return this.sourcesContent[this._sources.indexOf(a)];if((!n.path||n.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(s){var e=N.getArg(s,"source");if(e=this._findSourceIndex(e),e<0)return{line:null,column:null,lastColumn:null};var t={source:e,originalLine:N.getArg(s,"line"),originalColumn:N.getArg(s,"column")},r=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",N.compareByOriginalPositions,N.getArg(s,"bias",K.GREATEST_LOWER_BOUND));if(r>=0){var n=this._originalMappings[r];if(n.source===t.source)return{line:N.getArg(n,"generatedLine",null),column:N.getArg(n,"generatedColumn",null),lastColumn:N.getArg(n,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};Jt.BasicSourceMapConsumer=te;function be(i,s){var e=i;typeof i=="string"&&(e=N.parseSourceMapInput(i));var t=N.getArg(e,"version"),r=N.getArg(e,"sections");if(t!=this._version)throw new Error("Unsupported version: "+t);this._sources=new Ye,this._names=new Ye;var n={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=N.getArg(a,"offset"),l=N.getArg(o,"line"),c=N.getArg(o,"column");if(l<n.line||l===n.line&&c<n.column)throw new Error("Section offsets must be ordered and non-overlapping.");return n=o,{generatedOffset:{generatedLine:l+1,generatedColumn:c+1},consumer:new K(N.getArg(a,"map"),s)}})}be.prototype=Object.create(K.prototype);be.prototype.constructor=K;be.prototype._version=3;Object.defineProperty(be.prototype,"sources",{get:function(){for(var i=[],s=0;s<this._sections.length;s++)for(var e=0;e<this._sections[s].consumer.sources.length;e++)i.push(this._sections[s].consumer.sources[e]);return i}});be.prototype.originalPositionFor=function(s){var e={generatedLine:N.getArg(s,"line"),generatedColumn:N.getArg(s,"column")},t=Vs.search(e,this._sections,function(n,a){var o=n.generatedLine-a.generatedOffset.generatedLine;return o||n.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:s.bias}):{source:null,line:null,column:null,name:null}};be.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(s){return s.consumer.hasContentsOfAllSources()})};be.prototype.sourceContentFor=function(s,e){for(var t=0;t<this._sections.length;t++){var r=this._sections[t],n=r.consumer.sourceContentFor(s,!0);if(n||n==="")return n}if(e)return null;throw new Error('"'+s+'" is not in the SourceMap.')};be.prototype.generatedPositionFor=function(s){for(var e=0;e<this._sections.length;e++){var t=this._sections[e];if(t.consumer._findSourceIndex(N.getArg(s,"source"))!==-1){var r=t.consumer.generatedPositionFor(s);if(r){var n={line:r.line+(t.generatedOffset.generatedLine-1),column:r.column+(t.generatedOffset.generatedLine===r.line?t.generatedOffset.generatedColumn-1:0)};return n}}}return{line:null,column:null}};be.prototype._parseMappings=function(s,e){this.__generatedMappings=[],this.__originalMappings=[];for(var t=0;t<this._sections.length;t++)for(var r=this._sections[t],n=r.consumer._generatedMappings,a=0;a<n.length;a++){var o=n[a],l=r.consumer._sources.at(o.source);l!==null&&(l=N.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 u={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(u),typeof u.originalLine=="number"&&this.__originalMappings.push(u)}xt(this.__generatedMappings,N.compareByGeneratedPositionsDeflated),xt(this.__originalMappings,N.compareByOriginalPositions)};Jt.IndexedSourceMapConsumer=be});var Si=he(Pi=>{var Va=js().SourceMapGenerator,Kt=Qe(),$a=/(\r?\n)/,qa=10,Ze="$$$isSourceNode$$$";function pe(i,s,e,t,r){this.children=[],this.sourceContents={},this.line=i??null,this.column=s??null,this.source=e??null,this.name=r??null,this[Ze]=!0,t!=null&&this.add(t)}pe.fromStringWithSourceMap=function(s,e,t){var r=new pe,n=s.split($a),a=0,o=function(){var f=p(),d=p()||"";return f+d;function p(){return a<n.length?n[a++]:void 0}},l=1,c=0,u=null;return e.eachMapping(function(f){if(u!==null)if(l<f.generatedLine)h(u,o()),l++,c=0;else{var d=n[a]||"",p=d.substr(0,f.generatedColumn-c);n[a]=d.substr(f.generatedColumn-c),c=f.generatedColumn,h(u,p),u=f;return}for(;l<f.generatedLine;)r.add(o()),l++;if(c<f.generatedColumn){var d=n[a]||"";r.add(d.substr(0,f.generatedColumn)),n[a]=d.substr(f.generatedColumn),c=f.generatedColumn}u=f},this),a<n.length&&(u&&h(u,o()),r.add(n.splice(a).join(""))),e.sources.forEach(function(f){var d=e.sourceContentFor(f);d!=null&&(t!=null&&(f=Kt.join(t,f)),r.setSourceContent(f,d))}),r;function h(f,d){if(f===null||f.source===void 0)r.add(d);else{var p=t?Kt.join(t,f.source):f.source;r.add(new pe(f.originalLine,f.originalColumn,p,d,f.name))}}};pe.prototype.add=function(s){if(Array.isArray(s))s.forEach(function(e){this.add(e)},this);else if(s[Ze]||typeof s=="string")s&&this.children.push(s);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+s);return this};pe.prototype.prepend=function(s){if(Array.isArray(s))for(var e=s.length-1;e>=0;e--)this.prepend(s[e]);else if(s[Ze]||typeof s=="string")this.children.unshift(s);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+s);return this};pe.prototype.walk=function(s){for(var e,t=0,r=this.children.length;t<r;t++)e=this.children[t],e[Ze]?e.walk(s):e!==""&&s(e,{source:this.source,line:this.line,column:this.column,name:this.name})};pe.prototype.join=function(s){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(s);e.push(this.children[t]),this.children=e}return this};pe.prototype.replaceRight=function(s,e){var t=this.children[this.children.length-1];return t[Ze]?t.replaceRight(s,e):typeof t=="string"?this.children[this.children.length-1]=t.replace(s,e):this.children.push("".replace(s,e)),this};pe.prototype.setSourceContent=function(s,e){this.sourceContents[Kt.toSetString(s)]=e};pe.prototype.walkSourceContents=function(s){for(var e=0,t=this.children.length;e<t;e++)this.children[e][Ze]&&this.children[e].walkSourceContents(s);for(var r=Object.keys(this.sourceContents),e=0,t=r.length;e<t;e++)s(Kt.fromSetString(r[e]),this.sourceContents[r[e]])};pe.prototype.toString=function(){var s="";return this.walk(function(e){s+=e}),s};pe.prototype.toStringWithSourceMap=function(s){var e={code:"",line:1,column:0},t=new Va(s),r=!1,n=null,a=null,o=null,l=null;return this.walk(function(c,u){e.code+=c,u.source!==null&&u.line!==null&&u.column!==null?((n!==u.source||a!==u.line||o!==u.column||l!==u.name)&&t.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:e.line,column:e.column},name:u.name}),n=u.source,a=u.line,o=u.column,l=u.name,r=!0):r&&(t.addMapping({generated:{line:e.line,column:e.column}}),n=null,r=!1);for(var h=0,f=c.length;h<f;h++)c.charCodeAt(h)===qa?(e.line++,e.column=0,h+1===f?(n=null,r=!1):r&&t.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:e.line,column:e.column},name:u.name})):e.column++}),this.walkSourceContents(function(c,u){t.setSourceContent(c,u)}),{code:e.code,map:t}};Pi.SourceNode=pe});var Ai=he(Ht=>{Ht.SourceMapGenerator=js().SourceMapGenerator;Ht.SourceMapConsumer=Ti().SourceMapConsumer;Ht.SourceNode=Si().SourceNode});var en=he(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});function za(i,s){if(i==null)return{};var e={};for(var t in i)if({}.hasOwnProperty.call(i,t)){if(s.includes(t))continue;e[t]=i[t]}return e}var ve=class{constructor(s,e,t){this.line=void 0,this.column=void 0,this.index=void 0,this.line=s,this.column=e,this.index=t}},it=class{constructor(s,e){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=s,this.end=e}};function ne(i,s){let{line:e,column:t,index:r}=i;return new ve(e,t+s,r+s)}var Ei="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",Wa={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:Ei},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:Ei}},wi={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"},Qt=i=>i.type==="UpdateExpression"?wi.UpdateExpression[`${i.prefix}`]:wi[i.type],Ja={AccessorIsGenerator:({kind:i})=>`A ${i}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:i})=>`Missing initializer in ${i} 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:i})=>`\`${i}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",DynamicImportPhaseRequiresImportExpressions:({phase:i})=>`'import.${i}(...)' can only be parsed when using the 'createImportExpressions' option.`,ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:i,exportName:s})=>`A string literal cannot be used as an exported binding without \`from\`.
|
|
2
|
-
- Did you mean \`export { '${
|
|
3
|
-
- Did you mean \`import { "${i}" as foo }\`?`,ImportCallArgumentTrailingComma:"Trailing comma is disallowed inside import(...) arguments.",ImportCallArity:({maxArgumentCount:i})=>`\`import()\` requires exactly ${i===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:i})=>`Expected number in radix ${i}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:i})=>`Escape sequence in keyword ${i}.`,InvalidIdentifier:({identifierName:i})=>`Invalid identifier ${i}.`,InvalidLhs:({ancestor:i})=>`Invalid left-hand side in ${Qt(i)}.`,InvalidLhsBinding:({ancestor:i})=>`Binding invalid left-hand side in ${Qt(i)}.`,InvalidLhsOptionalChaining:({ancestor:i})=>`Invalid optional chaining in the left-hand side of ${Qt(i)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:i})=>`Unexpected character '${i}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:i})=>`Private name #${i} 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:i})=>`Label '${i}' 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:i})=>`This experimental syntax requires enabling the parser plugin: ${i.map(s=>JSON.stringify(s)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:i})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${i.map(s=>JSON.stringify(s)).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:i})=>`Duplicate key "${i}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:i})=>`An export name cannot include a lone surrogate, found '\\u${i.toString(16)}'.`,ModuleExportUndefined:({localName:i})=>`Export '${i}' 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:i})=>`Private names are only allowed in property accesses (\`obj.#${i}\`) or in \`in\` expressions (\`#${i} in obj\`).`,PrivateNameRedeclaration:({identifierName:i})=>`Duplicate private name #${i}.`,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:i})=>`Unexpected keyword '${i}'.`,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:i})=>`Unexpected reserved word '${i}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:i,unexpected:s})=>`Unexpected token${s?` '${s}'.`:""}${i?`, expected "${i}"`:""}`,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:i,onlyValidPropertyName:s})=>`The only valid meta property for ${i} is ${i}.${s}.`,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.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:i})=>`Identifier '${i}' 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."},Ka={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:i})=>`Assigning to '${i}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:i})=>`Binding '${i}' 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."},Ha=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),Xa={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:i})=>`Invalid topic token ${i}. In order to use ${i} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${i}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:i})=>`Hack-style pipe body cannot be an unparenthesized ${Qt({type:i})}; 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.'},Ga=["message"];function vi(i,s,e){Object.defineProperty(i,s,{enumerable:!1,configurable:!0,value:e})}function Qa({toMessage:i,code:s,reasonCode:e,syntaxPlugin:t}){let r=e==="MissingPlugin"||e==="MissingOneOfPlugins";{let n={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};n[e]&&(e=n[e])}return function n(a,o){let l=new SyntaxError;return l.code=s,l.reasonCode=e,l.loc=a,l.pos=a.index,l.syntaxPlugin=t,r&&(l.missingPlugin=o.missingPlugin),vi(l,"clone",function(u={}){var h;let{line:f,column:d,index:p}=(h=u.loc)!=null?h:a;return n(new ve(f,d,p),Object.assign({},o,u.details))}),vi(l,"details",o),Object.defineProperty(l,"message",{configurable:!0,get(){let c=`${i(o)} (${a.line}:${a.column})`;return this.message=c,c},set(c){Object.defineProperty(this,"message",{value:c,writable:!0})}}),l}}function Me(i,s){if(Array.isArray(i))return t=>Me(t,i[0]);let e={};for(let t of Object.keys(i)){let r=i[t],n=typeof r=="string"?{message:()=>r}:typeof r=="function"?{message:r}:r,{message:a}=n,o=za(n,Ga),l=typeof a=="string"?()=>a:a;e[t]=Qa(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:t,toMessage:l},s?{syntaxPlugin:s}:{},o))}return e}var m=Object.assign({},Me(Wa),Me(Ja),Me(Ka),Me`pipelineOperator`(Xa)),{defineProperty:Ya}=Object,Ci=(i,s)=>{i&&Ya(i,s,{enumerable:!1,value:i[s]})};function bt(i){return Ci(i.loc.start,"index"),Ci(i.loc.end,"index"),i}var Za=i=>class extends i{parse(){let e=bt(super.parse());return this.options.tokens&&(e.tokens=e.tokens.map(bt)),e}parseRegExpLiteral({pattern:e,flags:t}){let r=null;try{r=new RegExp(e,t)}catch{}let n=this.estreeParseLiteral(r);return n.regex={pattern:e,flags:t},n}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,n,a){super.parseBlockBody(e,t,r,n,a);let o=e.directives.map(l=>this.directiveToStmt(l));e.body=o.concat(e.body),delete e.directives}pushClassMethod(e,t,r,n,a,o){this.parseMethod(t,r,n,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,n,a,o,l=!1){let c=this.startNode();return c.kind=e.kind,c=super.parseMethod(c,t,r,n,a,o,l),c.type="FunctionExpression",delete c.kind,e.value=c,o==="ClassPrivateMethod"&&(e.computed=!1),this.finishNode(e,"MethodDefinition")}nameIsConstructor(e){return e.type==="Literal"?e.value==="constructor":super.nameIsConstructor(e)}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,n,a){let o=super.parseObjectMethod(e,t,r,n,a);return o&&(o.type="Property",o.kind==="method"&&(o.kind="init"),o.shorthand=!1),o}parseObjectProperty(e,t,r,n){let a=super.parseObjectProperty(e,t,r,n);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:n}=e;this.isPrivateName(r)&&this.classScope.usePrivateName(this.getPrivateNameSV(r),r.loc.start),this.toAssignable(n,t)}else super.toAssignable(e,t)}toAssignableObjectExpressionProp(e,t,r){e.type==="Property"&&(e.kind==="get"||e.kind==="set")?this.raise(m.PatternHasAccessor,e.key):e.type==="Property"&&e.method?this.raise(m.PatternHasMethod,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 n,a;r.options=(n=r.arguments[1])!=null?n: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,n=super.parseExport(e,t);switch(n.type){case"ExportAllDeclaration":n.exported=null;break;case"ExportNamedDeclaration":n.specifiers.length===1&&n.specifiers[0].type==="ExportNamespaceSpecifier"&&(n.type="ExportAllDeclaration",n.exported=n.specifiers[0].exported,delete n.specifiers);case"ExportDefaultDeclaration":{var a;let{declaration:o}=n;o?.type==="ClassDeclaration"&&((a=o.decorators)==null?void 0:a.length)>0&&o.start===n.start&&this.resetStartLocation(n,r)}break}return n}parseSubscript(e,t,r,n){let a=super.parseSubscript(e,t,r,n);if(n.optionalChainMember){if((a.type==="OptionalMemberExpression"||a.type==="OptionalCallExpression")&&(a.type=a.type.substring(8)),n.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.type==="Property"&&(e.method||e.kind==="get"||e.kind==="set")}finishNodeAt(e,t,r){return bt(super.finishNodeAt(e,t,r))}resetStartLocation(e,t){super.resetStartLocation(e,t),bt(e)}resetEndLocation(e,t=this.state.lastTokEndLoc){super.resetEndLocation(e,t),bt(e)}},We=class{constructor(s,e){this.token=void 0,this.preserveSpace=void 0,this.token=s,this.preserveSpace=!!e}},V={brace:new We("{"),j_oTag:new We("<tag"),j_cTag:new We("</tag"),j_expr:new We("<tag>...</tag>",!0)};V.template=new We("`",!0);var _=!0,C=!0,$s=!0,Tt=!0,_e=!0,eo=!0,es=class{constructor(s,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=s,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}},dr=new Map;function j(i,s={}){s.keyword=i;let e=D(i,s);return dr.set(i,e),e}function ie(i,s){return D(i,{beforeExpr:_,binop:s})}var Et=-1,De=[],mr=[],yr=[],gr=[],xr=[],br=[];function D(i,s={}){var e,t,r,n;return++Et,mr.push(i),yr.push((e=s.binop)!=null?e:-1),gr.push((t=s.beforeExpr)!=null?t:!1),xr.push((r=s.startsExpr)!=null?r:!1),br.push((n=s.prefix)!=null?n:!1),De.push(new es(i,s)),Et}function B(i,s={}){var e,t,r,n;return++Et,dr.set(i,Et),mr.push(i),yr.push((e=s.binop)!=null?e:-1),gr.push((t=s.beforeExpr)!=null?t:!1),xr.push((r=s.startsExpr)!=null?r:!1),br.push((n=s.prefix)!=null?n:!1),De.push(new es("name",s)),Et}var to={bracketL:D("[",{beforeExpr:_,startsExpr:C}),bracketHashL:D("#[",{beforeExpr:_,startsExpr:C}),bracketBarL:D("[|",{beforeExpr:_,startsExpr:C}),bracketR:D("]"),bracketBarR:D("|]"),braceL:D("{",{beforeExpr:_,startsExpr:C}),braceBarL:D("{|",{beforeExpr:_,startsExpr:C}),braceHashL:D("#{",{beforeExpr:_,startsExpr:C}),braceR:D("}"),braceBarR:D("|}"),parenL:D("(",{beforeExpr:_,startsExpr:C}),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:C}),dollarBraceL:D("${",{beforeExpr:_,startsExpr:C}),templateTail:D("...`",{startsExpr:C}),templateNonTail:D("...${",{beforeExpr:_,startsExpr:C}),at:D("@"),hash:D("#",{startsExpr:C}),interpreterDirective:D("#!..."),eq:D("=",{beforeExpr:_,isAssign:Tt}),assign:D("_=",{beforeExpr:_,isAssign:Tt}),slashAssign:D("_=",{beforeExpr:_,isAssign:Tt}),xorAssign:D("_=",{beforeExpr:_,isAssign:Tt}),moduloAssign:D("_=",{beforeExpr:_,isAssign:Tt}),incDec:D("++/--",{prefix:_e,postfix:eo,startsExpr:C}),bang:D("!",{beforeExpr:_,prefix:_e,startsExpr:C}),tilde:D("~",{beforeExpr:_,prefix:_e,startsExpr:C}),doubleCaret:D("^^",{startsExpr:C}),doubleAt:D("@@",{startsExpr:C}),pipeline:ie("|>",0),nullishCoalescing:ie("??",1),logicalOR:ie("||",1),logicalAND:ie("&&",2),bitwiseOR:ie("|",3),bitwiseXOR:ie("^",4),bitwiseAND:ie("&",5),equality:ie("==/!=/===/!==",6),lt:ie("</>/<=/>=",7),gt:ie("</>/<=/>=",7),relational:ie("</>/<=/>=",7),bitShift:ie("<</>>/>>>",8),bitShiftL:ie("<</>>/>>>",8),bitShiftR:ie("<</>>/>>>",8),plusMin:D("+/-",{beforeExpr:_,binop:9,prefix:_e,startsExpr:C}),modulo:D("%",{binop:10,startsExpr:C}),star:D("*",{binop:10}),slash:ie("/",10),exponent:D("**",{beforeExpr:_,binop:11,rightAssociative:!0}),_in:j("in",{beforeExpr:_,binop:7}),_instanceof:j("instanceof",{beforeExpr:_,binop:7}),_break:j("break"),_case:j("case",{beforeExpr:_}),_catch:j("catch"),_continue:j("continue"),_debugger:j("debugger"),_default:j("default",{beforeExpr:_}),_else:j("else",{beforeExpr:_}),_finally:j("finally"),_function:j("function",{startsExpr:C}),_if:j("if"),_return:j("return",{beforeExpr:_}),_switch:j("switch"),_throw:j("throw",{beforeExpr:_,prefix:_e,startsExpr:C}),_try:j("try"),_var:j("var"),_const:j("const"),_with:j("with"),_new:j("new",{beforeExpr:_,startsExpr:C}),_this:j("this",{startsExpr:C}),_super:j("super",{startsExpr:C}),_class:j("class",{startsExpr:C}),_extends:j("extends",{beforeExpr:_}),_export:j("export"),_import:j("import",{startsExpr:C}),_null:j("null",{startsExpr:C}),_true:j("true",{startsExpr:C}),_false:j("false",{startsExpr:C}),_typeof:j("typeof",{beforeExpr:_,prefix:_e,startsExpr:C}),_void:j("void",{beforeExpr:_,prefix:_e,startsExpr:C}),_delete:j("delete",{beforeExpr:_,prefix:_e,startsExpr:C}),_do:j("do",{isLoop:$s,beforeExpr:_}),_for:j("for",{isLoop:$s}),_while:j("while",{isLoop:$s}),_as:B("as",{startsExpr:C}),_assert:B("assert",{startsExpr:C}),_async:B("async",{startsExpr:C}),_await:B("await",{startsExpr:C}),_defer:B("defer",{startsExpr:C}),_from:B("from",{startsExpr:C}),_get:B("get",{startsExpr:C}),_let:B("let",{startsExpr:C}),_meta:B("meta",{startsExpr:C}),_of:B("of",{startsExpr:C}),_sent:B("sent",{startsExpr:C}),_set:B("set",{startsExpr:C}),_source:B("source",{startsExpr:C}),_static:B("static",{startsExpr:C}),_using:B("using",{startsExpr:C}),_yield:B("yield",{startsExpr:C}),_asserts:B("asserts",{startsExpr:C}),_checks:B("checks",{startsExpr:C}),_exports:B("exports",{startsExpr:C}),_global:B("global",{startsExpr:C}),_implements:B("implements",{startsExpr:C}),_intrinsic:B("intrinsic",{startsExpr:C}),_infer:B("infer",{startsExpr:C}),_is:B("is",{startsExpr:C}),_mixins:B("mixins",{startsExpr:C}),_proto:B("proto",{startsExpr:C}),_require:B("require",{startsExpr:C}),_satisfies:B("satisfies",{startsExpr:C}),_keyof:B("keyof",{startsExpr:C}),_readonly:B("readonly",{startsExpr:C}),_unique:B("unique",{startsExpr:C}),_abstract:B("abstract",{startsExpr:C}),_declare:B("declare",{startsExpr:C}),_enum:B("enum",{startsExpr:C}),_module:B("module",{startsExpr:C}),_namespace:B("namespace",{startsExpr:C}),_interface:B("interface",{startsExpr:C}),_type:B("type",{startsExpr:C}),_opaque:B("opaque",{startsExpr:C}),name:D("name",{startsExpr:C}),string:D("string",{startsExpr:C}),num:D("num",{startsExpr:C}),bigint:D("bigint",{startsExpr:C}),decimal:D("decimal",{startsExpr:C}),regexp:D("regexp",{startsExpr:C}),privateName:D("#name",{startsExpr:C}),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(i){return i>=93&&i<=132}function so(i){return i<=92}function Te(i){return i>=58&&i<=132}function Ri(i){return i>=58&&i<=136}function ro(i){return gr[i]}function Hs(i){return xr[i]}function io(i){return i>=29&&i<=33}function Ii(i){return i>=129&&i<=131}function no(i){return i>=90&&i<=92}function Tr(i){return i>=58&&i<=92}function ao(i){return i>=39&&i<=59}function oo(i){return i===34}function lo(i){return br[i]}function co(i){return i>=121&&i<=123}function uo(i){return i>=124&&i<=130}function Re(i){return mr[i]}function Yt(i){return yr[i]}function ho(i){return i===57}function ts(i){return i>=24&&i<=25}function Le(i){return De[i]}De[8].updateContext=i=>{i.pop()},De[5].updateContext=De[7].updateContext=De[23].updateContext=i=>{i.push(V.brace)},De[22].updateContext=i=>{i[i.length-1]===V.template?i.pop():i.push(V.template)},De[142].updateContext=i=>{i.push(V.j_expr,V.j_oTag)};var Pr="\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-\u1C8A\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-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\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",Ui="\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\u0897-\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",po=new RegExp("["+Pr+"]"),fo=new RegExp("["+Pr+Ui+"]");Pr=Ui=null;var Vi=[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,4,51,13,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,39,27,10,22,251,41,7,1,17,2,60,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,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,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,200,32,32,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,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,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,229,29,3,0,496,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],mo=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,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,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,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,343,9,54,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,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,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,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239];function Xs(i,s){let e=65536;for(let t=0,r=s.length;t<r;t+=2){if(e+=s[t],e>i)return!1;if(e+=s[t+1],e>=i)return!0}return!1}function Oe(i){return i<65?i===36:i<=90?!0:i<97?i===95:i<=122?!0:i<=65535?i>=170&&po.test(String.fromCharCode(i)):Xs(i,Vi)}function tt(i){return i<48?i===36:i<58?!0:i<65?!1:i<=90?!0:i<97?i===95:i<=122?!0:i<=65535?i>=170&&fo.test(String.fromCharCode(i)):Xs(i,Vi)||Xs(i,mo)}var Sr={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"]},yo=new Set(Sr.keyword),go=new Set(Sr.strict),xo=new Set(Sr.strictBind);function $i(i,s){return s&&i==="await"||i==="enum"}function qi(i,s){return $i(i,s)||go.has(i)}function zi(i){return xo.has(i)}function Wi(i,s){return qi(i,s)||zi(i)}function bo(i){return yo.has(i)}function To(i,s,e){return i===64&&s===64&&Oe(e)}var Po=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 So(i){return Po.has(i)}var wt=class{constructor(s){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=s}},vt=class{constructor(s,e){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=s,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 s=this.currentThisScopeFlags();return(s&64)>0&&(s&2)===0}get inStaticBlock(){for(let s=this.scopeStack.length-1;;s--){let{flags:e}=this.scopeStack[s];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(s){return new wt(s)}enter(s){this.scopeStack.push(this.createScope(s))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(s){return!!(s.flags&130||!this.parser.inModule&&s.flags&1)}declareName(s,e,t){let r=this.currentScope();if(e&8||e&16){this.checkRedeclarationInScope(r,s,e,t);let n=r.names.get(s)||0;e&16?n=n|4:(r.firstLexicalName||(r.firstLexicalName=s),n=n|2),r.names.set(s,n),e&8&&this.maybeExportDefined(r,s)}else if(e&4)for(let n=this.scopeStack.length-1;n>=0&&(r=this.scopeStack[n],this.checkRedeclarationInScope(r,s,e,t),r.names.set(s,(r.names.get(s)||0)|1),this.maybeExportDefined(r,s),!(r.flags&387));--n);this.parser.inModule&&r.flags&1&&this.undefinedExports.delete(s)}maybeExportDefined(s,e){this.parser.inModule&&s.flags&1&&this.undefinedExports.delete(e)}checkRedeclarationInScope(s,e,t,r){this.isRedeclaredInScope(s,e,t)&&this.parser.raise(m.VarRedeclaration,r,{identifierName:e})}isRedeclaredInScope(s,e,t){if(!(t&1))return!1;if(t&8)return s.names.has(e);let r=s.names.get(e);return t&16?(r&2)>0||!this.treatFunctionsAsVarInScope(s)&&(r&1)>0:(r&2)>0&&!(s.flags&8&&s.firstLexicalName===e)||!this.treatFunctionsAsVarInScope(s)&&(r&4)>0}checkLocalExport(s){let{name:e}=s;this.scopeStack[0].names.has(e)||this.undefinedExports.set(e,s.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let s=this.scopeStack.length-1;;s--){let{flags:e}=this.scopeStack[s];if(e&387)return e}}currentThisScopeFlags(){for(let s=this.scopeStack.length-1;;s--){let{flags:e}=this.scopeStack[s];if(e&451&&!(e&4))return e}}},Gs=class extends wt{constructor(...s){super(...s),this.declareFunctions=new Set}},Qs=class extends vt{createScope(s){return new Gs(s)}declareName(s,e,t){let r=this.currentScope();if(e&2048){this.checkRedeclarationInScope(r,s,e,t),this.maybeExportDefined(r,s),r.declareFunctions.add(s);return}super.declareName(s,e,t)}isRedeclaredInScope(s,e,t){if(super.isRedeclaredInScope(s,e,t))return!0;if(t&2048&&!s.declareFunctions.has(e)){let r=s.names.get(e);return(r&4)>0||(r&2)>0}return!1}checkLocalExport(s){this.scopeStack[0].declareFunctions.has(s.name)||super.checkLocalExport(s)}},Ys=class{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}hasPlugin(s){if(typeof s=="string")return this.plugins.has(s);{let[e,t]=s;if(!this.hasPlugin(e))return!1;let r=this.plugins.get(e);for(let n of Object.keys(t))if(r?.[n]!==t[n])return!1;return!0}}getPluginOption(s,e){var t;return(t=this.plugins.get(s))==null?void 0:t[e]}};function Ji(i,s){i.trailingComments===void 0?i.trailingComments=s:i.trailingComments.unshift(...s)}function Ao(i,s){i.leadingComments===void 0?i.leadingComments=s:i.leadingComments.unshift(...s)}function Ct(i,s){i.innerComments===void 0?i.innerComments=s:i.innerComments.unshift(...s)}function Pt(i,s,e){let t=null,r=s.length;for(;t===null&&r>0;)t=s[--r];t===null||t.start>e.start?Ct(i,e.comments):Ji(t,e.comments)}var Zs=class extends Ys{addComment(s){this.filename&&(s.loc.filename=this.filename);let{commentsLen:e}=this.state;this.comments.length!==e&&(this.comments.length=e),this.comments.push(s),this.state.commentsLen++}processComment(s){let{commentStack:e}=this.state,t=e.length;if(t===0)return;let r=t-1,n=e[r];n.start===s.end&&(n.leadingNode=s,r--);let{start:a}=s;for(;r>=0;r--){let o=e[r],l=o.end;if(l>a)o.containingNode=s,this.finalizeComment(o),e.splice(r,1);else{l===a&&(o.trailingNode=s);break}}}finalizeComment(s){let{comments:e}=s;if(s.leadingNode!==null||s.trailingNode!==null)s.leadingNode!==null&&Ji(s.leadingNode,e),s.trailingNode!==null&&Ao(s.trailingNode,e);else{let{containingNode:t,start:r}=s;if(this.input.charCodeAt(r-1)===44)switch(t.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":Pt(t,t.properties,s);break;case"CallExpression":case"OptionalCallExpression":Pt(t,t.arguments,s);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":Pt(t,t.params,s);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":Pt(t,t.elements,s);break;case"ExportNamedDeclaration":case"ImportDeclaration":Pt(t,t.specifiers,s);break;default:Ct(t,e)}else Ct(t,e)}}finalizeRemainingComments(){let{commentStack:s}=this.state;for(let e=s.length-1;e>=0;e--)this.finalizeComment(s[e]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(s){let{commentStack:e}=this.state,{length:t}=e;if(t===0)return;let r=e[t-1];r.leadingNode===s&&(r.leadingNode=null)}resetPreviousIdentifierLeadingComments(s){let{commentStack:e}=this.state,{length:t}=e;t!==0&&(e[t-1].trailingNode===s?e[t-1].trailingNode=null:t>=2&&e[t-2].trailingNode===s&&(e[t-2].trailingNode=null))}takeSurroundingComments(s,e,t){let{commentStack:r}=this.state,n=r.length;if(n===0)return;let a=n-1;for(;a>=0;a--){let o=r[a],l=o.end;if(o.start===t)o.leadingNode=s;else if(l===e)o.trailingNode=s;else if(l<e)break}}},Eo=/\r\n|[\r\n\u2028\u2029]/,Xt=new RegExp(Eo.source,"g");function st(i){switch(i){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function Ni(i,s,e){for(let t=s;t<e;t++)if(st(i.charCodeAt(t)))return!0;return!1}var qs=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,zs=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function wo(i){switch(i){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 er=class i{constructor(){this.flags=1024,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.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null},this.labels=[],this.commentsLen=0,this.commentStack=[],this.pos=0,this.type=139,this.value=null,this.start=0,this.end=0,this.lastTokEndLoc=null,this.lastTokStartLoc=null,this.context=[V.brace],this.firstInvalidTemplateEscapePos=null,this.strictErrors=new Map,this.tokensLength=0}get strict(){return(this.flags&1)>0}set strict(s){s?this.flags|=1:this.flags&=-2}init({strictMode:s,sourceType:e,startLine:t,startColumn:r}){this.strict=s===!1?!1:s===!0?!0:e==="module",this.curLine=t,this.lineStart=-r,this.startLoc=this.endLoc=new ve(t,r,0)}get maybeInArrowParameters(){return(this.flags&2)>0}set maybeInArrowParameters(s){s?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(s){s?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(s){s?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(s){s?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(s){s?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(s){s?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(s){s?this.flags|=128:this.flags&=-129}get soloAwait(){return(this.flags&256)>0}set soloAwait(s){s?this.flags|=256:this.flags&=-257}get inFSharpPipelineDirectBody(){return(this.flags&512)>0}set inFSharpPipelineDirectBody(s){s?this.flags|=512:this.flags&=-513}get canStartJSXElement(){return(this.flags&1024)>0}set canStartJSXElement(s){s?this.flags|=1024:this.flags&=-1025}get containsEsc(){return(this.flags&2048)>0}set containsEsc(s){s?this.flags|=2048:this.flags&=-2049}get hasTopLevelAwait(){return(this.flags&4096)>0}set hasTopLevelAwait(s){s?this.flags|=4096:this.flags&=-4097}curPosition(){return new ve(this.curLine,this.pos-this.lineStart,this.pos)}clone(){let s=new i;return s.flags=this.flags,s.curLine=this.curLine,s.lineStart=this.lineStart,s.startLoc=this.startLoc,s.endLoc=this.endLoc,s.errors=this.errors.slice(),s.potentialArrowAt=this.potentialArrowAt,s.noArrowAt=this.noArrowAt.slice(),s.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),s.topicContext=this.topicContext,s.labels=this.labels.slice(),s.commentsLen=this.commentsLen,s.commentStack=this.commentStack.slice(),s.pos=this.pos,s.type=this.type,s.value=this.value,s.start=this.start,s.end=this.end,s.lastTokEndLoc=this.lastTokEndLoc,s.lastTokStartLoc=this.lastTokStartLoc,s.context=this.context.slice(),s.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,s.strictErrors=this.strictErrors,s.tokensLength=this.tokensLength,s}},vo=function(s){return s>=48&&s<=57},ki={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},Gt={bin:i=>i===48||i===49,oct:i=>i>=48&&i<=55,dec:i=>i>=48&&i<=57,hex:i=>i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102};function Li(i,s,e,t,r,n){let a=e,o=t,l=r,c="",u=null,h=e,{length:f}=s;for(;;){if(e>=f){n.unterminated(a,o,l),c+=s.slice(h,e);break}let d=s.charCodeAt(e);if(Co(i,d,s,e)){c+=s.slice(h,e);break}if(d===92){c+=s.slice(h,e);let p=Io(s,e,t,r,i==="template",n);p.ch===null&&!u?u={pos:e,lineStart:t,curLine:r}:c+=p.ch,{pos:e,lineStart:t,curLine:r}=p,h=e}else d===8232||d===8233?(++e,++r,t=e):d===10||d===13?i==="template"?(c+=s.slice(h,e)+`
|
|
4
|
-
`,++e,d===13&&
|
|
5
|
-
`);case 114:return o("\r");case 120:{let c;return{code:c,pos:s}=tr(i,s,e,t,2,!1,a,n),o(c===null?null:String.fromCharCode(c))}case 117:{let c;return{code:c,pos:s}=Hi(i,s,e,t,a,n),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:i.charCodeAt(s)===10&&++s;case 10:e=s,++t;case 8232:case 8233:return o("");case 56:case 57:if(r)return o(null);n.strictNumericEscape(s-1,e,t);default:if(l>=48&&l<=55){let c=s-1,h=/^[0-7]+/.exec(i.slice(c,s+2))[0],f=parseInt(h,8);f>255&&(h=h.slice(0,-1),f=parseInt(h,8)),s+=h.length-1;let d=i.charCodeAt(s);if(h!=="0"||d===56||d===57){if(r)return o(null);n.strictNumericEscape(c,e,t)}return o(String.fromCharCode(f))}return o(String.fromCharCode(l))}}function tr(i,s,e,t,r,n,a,o){let l=s,c;return{n:c,pos:s}=Ki(i,s,e,t,16,r,n,!1,o,!a),c===null&&(a?o.invalidEscapeSequence(l,e,t):s=l-1),{code:c,pos:s}}function Ki(i,s,e,t,r,n,a,o,l,c){let u=s,h=r===16?ki.hex:ki.decBinOct,f=r===16?Gt.hex:r===10?Gt.dec:r===8?Gt.oct:Gt.bin,d=!1,p=0;for(let g=0,y=n??1/0;g<y;++g){let b=i.charCodeAt(s),P;if(b===95&&o!=="bail"){let k=i.charCodeAt(s-1),T=i.charCodeAt(s+1);if(o){if(Number.isNaN(T)||!f(T)||h.has(k)||h.has(T)){if(c)return{n:null,pos:s};l.unexpectedNumericSeparator(s,e,t)}}else{if(c)return{n:null,pos:s};l.numericSeparatorInEscapeSequence(s,e,t)}++s;continue}if(b>=97?P=b-97+10:b>=65?P=b-65+10:vo(b)?P=b-48:P=1/0,P>=r){if(P<=9&&c)return{n:null,pos:s};if(P<=9&&l.invalidDigit(s,e,t,r))P=0;else if(a)P=0,d=!0;else break}++s,p=p*r+P}return s===u||n!=null&&s-u!==n||d?{n:null,pos:s}:{n:p,pos:s}}function Hi(i,s,e,t,r,n){let a=i.charCodeAt(s),o;if(a===123){if(++s,{code:o,pos:s}=tr(i,s,e,t,i.indexOf("}",s)-s,!0,r,n),++s,o!==null&&o>1114111)if(r)n.invalidCodePoint(s,e,t);else return{code:null,pos:s}}else({code:o,pos:s}=tr(i,s,e,t,4,!1,r,n));return{code:o,pos:s}}function St(i,s,e){return new ve(e,i-s,i)}var No=new Set([103,109,115,105,121,117,100,118]),we=class{constructor(s){this.type=s.type,this.value=s.value,this.start=s.start,this.end=s.end,this.loc=new it(s.startLoc,s.endLoc)}},sr=class extends Zs{constructor(s,e){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(t,r,n,a)=>this.options.errorRecovery?(this.raise(m.InvalidDigit,St(t,r,n),{radix:a}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(m.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(m.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(m.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(m.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(t,r,n)=>{this.recordStrictModeErrors(m.StrictNumericEscape,St(t,r,n))},unterminated:(t,r,n)=>{throw this.raise(m.UnterminatedString,St(t-1,r,n))}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(m.StrictNumericEscape),unterminated:(t,r,n)=>{throw this.raise(m.UnterminatedTemplate,St(t,r,n))}}),this.state=new er,this.state.init(s),this.input=e,this.length=e.length,this.comments=[],this.isLookahead=!1}pushToken(s){this.tokens.length=this.state.tokensLength,this.tokens.push(s),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.options.tokens&&this.pushToken(new we(this.state)),this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(s){return this.match(s)?(this.next(),!0):!1}match(s){return this.state.type===s}createLookaheadState(s){return{pos:s.pos,value:null,type:s.type,start:s.start,end:s.end,context:[this.curContext()],inType:s.inType,startLoc:s.startLoc,lastTokEndLoc:s.lastTokEndLoc,curLine:s.curLine,lineStart:s.lineStart,curPosition:s.curPosition}}lookahead(){let s=this.state;this.state=this.createLookaheadState(s),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let e=this.state;return this.state=s,e}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(s){return qs.lastIndex=s,qs.test(this.input)?qs.lastIndex:s}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(s){return zs.lastIndex=s,zs.test(this.input)?zs.lastIndex:s}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(s){let e=this.input.charCodeAt(s);if((e&64512)===55296&&++s<this.input.length){let t=this.input.charCodeAt(s);(t&64512)===56320&&(e=65536+((e&1023)<<10)+(t&1023))}return e}setStrict(s){this.state.strict=s,s&&(this.state.strictErrors.forEach(([e,t])=>this.raise(e,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(s){let e;this.isLookahead||(e=this.state.curPosition());let t=this.state.pos,r=this.input.indexOf(s,t+2);if(r===-1)throw this.raise(m.UnterminatedComment,this.state.curPosition());for(this.state.pos=r+s.length,Xt.lastIndex=t+2;Xt.test(this.input)&&Xt.lastIndex<=r;)++this.state.curLine,this.state.lineStart=Xt.lastIndex;if(this.isLookahead)return;let n={type:"CommentBlock",value:this.input.slice(t+2,r),start:t,end:r+s.length,loc:new it(e,this.state.curPosition())};return this.options.tokens&&this.pushToken(n),n}skipLineComment(s){let e=this.state.pos,t;this.isLookahead||(t=this.state.curPosition());let r=this.input.charCodeAt(this.state.pos+=s);if(this.state.pos<this.length)for(;!st(r)&&++this.state.pos<this.length;)r=this.input.charCodeAt(this.state.pos);if(this.isLookahead)return;let n=this.state.pos,o={type:"CommentLine",value:this.input.slice(e+s,n),start:e,end:n,loc:new it(t,this.state.curPosition())};return this.options.tokens&&this.pushToken(o),o}skipSpace(){let s=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(wo(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&&(s===0||this.state.lineStart>s)){let n=this.skipLineComment(3);n!==void 0&&(this.addComment(n),this.options.attachComment&&e.push(n))}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 n=this.skipLineComment(4);n!==void 0&&(this.addComment(n),this.options.attachComment&&e.push(n))}else break e}else break e}}if(e.length>0){let t=this.state.pos,r={start:s,end:t,comments:e,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(r)}}finishToken(s,e){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let t=this.state.type;this.state.type=s,this.state.value=e,this.isLookahead||this.updateContext(t)}replaceToken(s){this.state.type=s,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let s=this.state.pos+1,e=this.codePointAtPos(s);if(e>=48&&e<=57)throw this.raise(m.UnexpectedDigitAfterHash,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?m.RecordExpressionHashIncorrectStartSyntaxType:m.TupleExpressionHashIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,e===123?this.finishToken(7):this.finishToken(1)}else Oe(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 s=this.input.charCodeAt(this.state.pos+1);if(s>=48&&s<=57){this.readNumber(!0);return}s===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 s=this.input.charCodeAt(this.state.pos+1);if(s!==33)return!1;let e=this.state.pos;for(this.state.pos+=1;!st(s)&&++this.state.pos<this.length;)s=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(s){let e=s===42?55:54,t=1,r=this.input.charCodeAt(this.state.pos+1);s===42&&r===42&&(t++,r=this.input.charCodeAt(this.state.pos+2),e=57),r===61&&!this.state.inType&&(t++,e=s===37?33:30),this.finishOp(e,t)}readToken_pipe_amp(s){let e=this.input.charCodeAt(this.state.pos+1);if(e===s){this.input.charCodeAt(this.state.pos+2)===61?this.finishOp(30,3):this.finishOp(s===124?41:42,2);return}if(s===124){if(e===62){this.finishOp(39,2);return}if(this.hasPlugin("recordAndTuple")&&e===125){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(m.RecordExpressionBarIncorrectEndSyntaxType,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(m.TupleExpressionBarIncorrectEndSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(4);return}}if(e===61){this.finishOp(30,2);return}this.finishOp(s===124?43:45,1)}readToken_caret(){let s=this.input.charCodeAt(this.state.pos+1);s===61&&!this.state.inType?this.finishOp(32,2):s===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(s){let e=this.input.charCodeAt(this.state.pos+1);if(e===s){this.finishOp(34,2);return}e===61?this.finishOp(30,2):this.finishOp(53,1)}readToken_lt(){let{pos:s}=this.state,e=this.input.charCodeAt(s+1);if(e===60){if(this.input.charCodeAt(s+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:s}=this.state,e=this.input.charCodeAt(s+1);if(e===62){let t=this.input.charCodeAt(s+2)===62?3:2;if(this.input.charCodeAt(s+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(s){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(s===61&&e===62){this.state.pos+=2,this.finishToken(19);return}this.finishOp(s===61?29:35,1)}readToken_question(){let s=this.input.charCodeAt(this.state.pos+1),e=this.input.charCodeAt(this.state.pos+2);s===63?e===61?this.finishOp(30,3):this.finishOp(40,2):s===46&&!(e>=48&&e<=57)?(this.state.pos+=2,this.finishToken(18)):(++this.state.pos,this.finishToken(17))}getTokenFromCode(s){switch(s){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(m.TupleExpressionBarIncorrectStartSyntaxType,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(m.RecordExpressionBarIncorrectStartSyntaxType,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(s);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(s);return;case 124:case 38:this.readToken_pipe_amp(s);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(s);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(s);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(Oe(s)){this.readWord(s);return}}throw this.raise(m.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(s)})}finishOp(s,e){let t=this.input.slice(this.state.pos,this.state.pos+e);this.state.pos+=e,this.finishToken(s,t)}readRegexp(){let s=this.state.startLoc,e=this.state.start+1,t,r,{pos:n}=this.state;for(;;++n){if(n>=this.length)throw this.raise(m.UnterminatedRegExp,ne(s,1));let c=this.input.charCodeAt(n);if(st(c))throw this.raise(m.UnterminatedRegExp,ne(s,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,n);++n;let o="",l=()=>ne(s,n+2-e);for(;n<this.length;){let c=this.codePointAtPos(n),u=String.fromCharCode(c);if(No.has(c))c===118?o.includes("u")&&this.raise(m.IncompatibleRegExpUVFlags,l()):c===117&&o.includes("v")&&this.raise(m.IncompatibleRegExpUVFlags,l()),o.includes(u)&&this.raise(m.DuplicateRegExpFlags,l());else if(tt(c)||c===92)this.raise(m.MalformedRegExpFlags,l());else break;++n,o+=u}this.state.pos=n,this.finishToken(137,{pattern:a,flags:o})}readInt(s,e,t=!1,r=!0){let{n,pos:a}=Ki(this.input,this.state.pos,this.state.lineStart,this.state.curLine,s,e,t,r,this.errorHandlers_readInt,!1);return this.state.pos=a,n}readRadixNumber(s){let e=this.state.curPosition(),t=!1;this.state.pos+=2;let r=this.readInt(s);r==null&&this.raise(m.InvalidDigit,ne(e,2),{radix:s});let n=this.input.charCodeAt(this.state.pos);if(n===110)++this.state.pos,t=!0;else if(n===109)throw this.raise(m.InvalidDecimal,e);if(Oe(this.codePointAtPos(this.state.pos)))throw this.raise(m.NumberIdentifier,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(s){let e=this.state.pos,t=this.state.curPosition(),r=!1,n=!1,a=!1,o=!1;!s&&this.readInt(10)===null&&this.raise(m.InvalidNumber,this.state.curPosition());let l=this.state.pos-e>=2&&this.input.charCodeAt(e)===48;if(l){let d=this.input.slice(e,this.state.pos);if(this.recordStrictModeErrors(m.StrictOctalLiteral,t),!this.state.strict){let p=d.indexOf("_");p>0&&this.raise(m.ZeroDigitNumericSeparator,ne(t,p))}o=l&&!/[89]/.test(d)}let c=this.input.charCodeAt(this.state.pos);if(c===46&&!o&&(++this.state.pos,this.readInt(10),r=!0,c=this.input.charCodeAt(this.state.pos)),(c===69||c===101)&&!o&&(c=this.input.charCodeAt(++this.state.pos),(c===43||c===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(m.InvalidOrMissingExponent,t),r=!0,a=!0,c=this.input.charCodeAt(this.state.pos)),c===110&&((r||l)&&this.raise(m.InvalidBigIntLiteral,t),++this.state.pos,n=!0),c===109){this.expectPlugin("decimal",this.state.curPosition()),(a||l)&&this.raise(m.InvalidDecimal,t),++this.state.pos;var u=!0}if(Oe(this.codePointAtPos(this.state.pos)))throw this.raise(m.NumberIdentifier,this.state.curPosition());let h=this.input.slice(e,this.state.pos).replace(/[_mn]/g,"");if(n){this.finishToken(135,h);return}if(u){this.finishToken(136,h);return}let f=o?parseInt(h,8):parseFloat(h);this.finishToken(134,f)}readCodePoint(s){let{code:e,pos:t}=Hi(this.input,this.state.pos,this.state.lineStart,this.state.curLine,s,this.errorHandlers_readCodePoint);return this.state.pos=t,e}readString(s){let{str:e,pos:t,curLine:r,lineStart:n}=Li(s===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=n,this.state.curLine=r,this.finishToken(133,e)}readTemplateContinuation(){this.match(8)||this.unexpected(null,8),this.state.pos--,this.readTemplateToken()}readTemplateToken(){let s=this.input[this.state.pos],{str:e,firstInvalidLoc:t,pos:r,curLine:n,lineStart:a}=Li("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=n,t&&(this.state.firstInvalidTemplateEscapePos=new ve(t.curLine,t.pos-t.lineStart,t.pos)),this.input.codePointAt(r)===96?this.finishToken(24,t?null:s+e+"`"):(this.state.pos++,this.finishToken(25,t?null:s+e+"${"))}recordStrictModeErrors(s,e){let t=e.index;this.state.strict&&!this.state.strictErrors.has(t)?this.raise(s,e):this.state.strictErrors.set(t,[s,e])}readWord1(s){this.state.containsEsc=!1;let e="",t=this.state.pos,r=this.state.pos;for(s!==void 0&&(this.state.pos+=s<=65535?1:2);this.state.pos<this.length;){let n=this.codePointAtPos(this.state.pos);if(tt(n))this.state.pos+=n<=65535?1:2;else if(n===92){this.state.containsEsc=!0,e+=this.input.slice(r,this.state.pos);let a=this.state.curPosition(),o=this.state.pos===t?Oe:tt;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(m.MissingUnicodeEscape,this.state.curPosition()),r=this.state.pos-1;continue}++this.state.pos;let l=this.readCodePoint(!0);l!==null&&(o(l)||this.raise(m.EscapedCharNotAnIdentifier,a),e+=String.fromCodePoint(l)),r=this.state.pos}else break}return e+this.input.slice(r,this.state.pos)}readWord(s){let e=this.readWord1(s),t=dr.get(e);t!==void 0?this.finishToken(t,Re(t)):this.finishToken(132,e)}checkKeywordEscapes(){let{type:s}=this.state;Tr(s)&&this.state.containsEsc&&this.raise(m.InvalidEscapedReservedWord,this.state.startLoc,{reservedWord:Re(s)})}raise(s,e,t={}){let r=e instanceof ve?e:e.loc.start,n=s(r,t);if(!this.options.errorRecovery)throw n;return this.isLookahead||this.state.errors.push(n),n}raiseOverwrite(s,e,t={}){let r=e instanceof ve?e:e.loc.start,n=r.index,a=this.state.errors;for(let o=a.length-1;o>=0;o--){let l=a[o];if(l.loc.index===n)return a[o]=s(r,t);if(l.loc.index<n)break}return this.raise(s,e,t)}updateContext(s){}unexpected(s,e){throw this.raise(m.UnexpectedToken,s??this.state.startLoc,{expected:e?Re(e):null})}expectPlugin(s,e){if(this.hasPlugin(s))return!0;throw this.raise(m.MissingPlugin,e??this.state.startLoc,{missingPlugin:[s]})}expectOnePlugin(s){if(!s.some(e=>this.hasPlugin(e)))throw this.raise(m.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:s})}errorBuilder(s){return(e,t,r)=>{this.raise(s,St(e,t,r))}}},rr=class{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}},ir=class{constructor(s){this.parser=void 0,this.stack=[],this.undefinedPrivateNames=new Map,this.parser=s}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new rr)}exit(){let s=this.stack.pop(),e=this.current();for(let[t,r]of Array.from(s.undefinedPrivateNames))e?e.undefinedPrivateNames.has(t)||e.undefinedPrivateNames.set(t,r):this.parser.raise(m.InvalidPrivateFieldResolution,r,{identifierName:t})}declarePrivateName(s,e,t){let{privateNames:r,loneAccessors:n,undefinedPrivateNames:a}=this.current(),o=r.has(s);if(e&3){let l=o&&n.get(s);if(l){let c=l&4,u=e&4,h=l&3,f=e&3;o=h===f||c!==u,o||n.delete(s)}else o||n.set(s,e)}o&&this.parser.raise(m.PrivateNameRedeclaration,t,{identifierName:s}),r.add(s),a.delete(s)}usePrivateName(s,e){let t;for(t of this.stack)if(t.privateNames.has(s))return;t?t.undefinedPrivateNames.set(s,e):this.parser.raise(m.InvalidPrivateFieldResolution,e,{identifierName:s})}},nt=class{constructor(s=0){this.type=s}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},ss=class extends nt{constructor(s){super(s),this.declarationErrors=new Map}recordDeclarationError(s,e){let t=e.index;this.declarationErrors.set(t,[s,e])}clearDeclarationError(s){this.declarationErrors.delete(s)}iterateErrors(s){this.declarationErrors.forEach(s)}},nr=class{constructor(s){this.parser=void 0,this.stack=[new nt],this.parser=s}enter(s){this.stack.push(s)}exit(){this.stack.pop()}recordParameterInitializerError(s,e){let t=e.loc.start,{stack:r}=this,n=r.length-1,a=r[n];for(;!a.isCertainlyParameterDeclaration();){if(a.canBeArrowParameterDeclaration())a.recordDeclarationError(s,t);else return;a=r[--n]}this.parser.raise(s,t)}recordArrowParameterBindingError(s,e){let{stack:t}=this,r=t[t.length-1],n=e.loc.start;if(r.isCertainlyParameterDeclaration())this.parser.raise(s,n);else if(r.canBeArrowParameterDeclaration())r.recordDeclarationError(s,n);else return}recordAsyncArrowParametersError(s){let{stack:e}=this,t=e.length-1,r=e[t];for(;r.canBeArrowParameterDeclaration();)r.type===2&&r.recordDeclarationError(m.AwaitBindingIdentifier,s),r=e[--t]}validateAsPattern(){let{stack:s}=this,e=s[s.length-1];e.canBeArrowParameterDeclaration()&&e.iterateErrors(([t,r])=>{this.parser.raise(t,r);let n=s.length-2,a=s[n];for(;a.canBeArrowParameterDeclaration();)a.clearDeclarationError(r.index),a=s[--n]})}};function ko(){return new nt(3)}function Lo(){return new ss(1)}function Do(){return new ss(2)}function Xi(){return new nt}var ar=class{constructor(){this.stacks=[]}enter(s){this.stacks.push(s)}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 Zt(i,s){return(i?2:0)|(s?1:0)}var or=class extends sr{addExtra(s,e,t,r=!0){if(!s)return;let{extra:n}=s;n==null&&(n={},s.extra=n),r?n[e]=t:Object.defineProperty(n,e,{enumerable:r,value:t})}isContextual(s){return this.state.type===s&&!this.state.containsEsc}isUnparsedContextual(s,e){let t=s+e.length;if(this.input.slice(s,t)===e){let r=this.input.charCodeAt(t);return!(tt(r)||(r&64512)===55296)}return!1}isLookaheadContextual(s){let e=this.nextTokenStart();return this.isUnparsedContextual(e,s)}eatContextual(s){return this.isContextual(s)?(this.next(),!0):!1}expectContextual(s,e){if(!this.eatContextual(s)){if(e!=null)throw this.raise(e,this.state.startLoc);this.unexpected(null,s)}}canInsertSemicolon(){return this.match(139)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return Ni(this.input,this.state.lastTokEndLoc.index,this.state.start)}hasFollowingLineBreak(){return Ni(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(s=!0){(s?this.isLineTerminator():this.eat(13))||this.raise(m.MissingSemicolon,this.state.lastTokEndLoc)}expect(s,e){this.eat(s)||this.unexpected(e,s)}tryParse(s,e=this.state.clone()){let t={node:null};try{let r=s((n=null)=>{throw t.node=n,t});if(this.state.errors.length>e.errors.length){let n=this.state;return this.state=e,this.state.tokensLength=n.tokensLength,{node:r,error:n.errors[e.errors.length],thrown:!1,aborted:!1,failState:n}}return{node:r,error:null,thrown:!1,aborted:!1,failState:null}}catch(r){let n=this.state;if(this.state=e,r instanceof SyntaxError)return{node:null,error:r,thrown:!0,aborted:!1,failState:n};if(r===t)return{node:t.node,error:null,thrown:!1,aborted:!0,failState:n};throw r}}checkExpressionErrors(s,e){if(!s)return!1;let{shorthandAssignLoc:t,doubleProtoLoc:r,privateKeyLoc:n,optionalParametersLoc:a}=s,o=!!t||!!r||!!a||!!n;if(!e)return o;t!=null&&this.raise(m.InvalidCoverInitializedName,t),r!=null&&this.raise(m.DuplicateProto,r),n!=null&&this.raise(m.UnexpectedPrivateField,n),a!=null&&this.unexpected(a)}isLiteralPropertyName(){return Ri(this.state.type)}isPrivateName(s){return s.type==="PrivateName"}getPrivateNameSV(s){return s.id.name}hasPropertyAsPrivateName(s){return(s.type==="MemberExpression"||s.type==="OptionalMemberExpression")&&this.isPrivateName(s.property)}isObjectProperty(s){return s.type==="ObjectProperty"}isObjectMethod(s){return s.type==="ObjectMethod"}initializeScopes(s=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=s;let n=this.scope,a=this.getScopeHandler();this.scope=new a(this,s);let o=this.prodParam;this.prodParam=new ar;let l=this.classScope;this.classScope=new ir(this);let c=this.expressionScope;return this.expressionScope=new nr(this),()=>{this.state.labels=e,this.exportedIdentifiers=t,this.inModule=r,this.scope=n,this.prodParam=o,this.classScope=l,this.expressionScope=c}}enterInitialScopes(){let s=0;this.inModule&&(s|=2),this.scope.enter(1),this.prodParam.enter(s)}checkDestructuringPrivate(s){let{privateKeyLoc:e}=s;e!==null&&this.expectPlugin("destructuringPrivate",e)}},rt=class{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null}},at=class{constructor(s,e,t){this.type="",this.start=e,this.end=0,this.loc=new it(t),s!=null&&s.options.ranges&&(this.range=[e,0]),s!=null&&s.filename&&(this.loc.filename=s.filename)}},Ar=at.prototype;Ar.__clone=function(){let i=new at(void 0,this.start,this.loc.start),s=Object.keys(this);for(let e=0,t=s.length;e<t;e++){let r=s[e];r!=="leadingComments"&&r!=="trailingComments"&&r!=="innerComments"&&(i[r]=this[r])}return i};function Oo(i){return Fe(i)}function Fe(i){let{type:s,start:e,end:t,loc:r,range:n,extra:a,name:o}=i,l=Object.create(Ar);return l.type=s,l.start=e,l.end=t,l.loc=r,l.range=n,l.extra=a,l.name=o,s==="Placeholder"&&(l.expectedNode=i.expectedNode),l}function Mo(i){let{type:s,start:e,end:t,loc:r,range:n,extra:a}=i;if(s==="Placeholder")return Oo(i);let o=Object.create(Ar);return o.type=s,o.start=e,o.end=t,o.loc=r,o.range=n,i.raw!==void 0?o.raw=i.raw:o.extra=a,o.value=i.value,o}var lr=class extends or{startNode(){let s=this.state.startLoc;return new at(this,s.index,s)}startNodeAt(s){return new at(this,s.index,s)}startNodeAtNode(s){return this.startNodeAt(s.loc.start)}finishNode(s,e){return this.finishNodeAt(s,e,this.state.lastTokEndLoc)}finishNodeAt(s,e,t){return s.type=e,s.end=t.index,s.loc.end=t,this.options.ranges&&(s.range[1]=t.index),this.options.attachComment&&this.processComment(s),s}resetStartLocation(s,e){s.start=e.index,s.loc.start=e,this.options.ranges&&(s.range[0]=e.index)}resetEndLocation(s,e=this.state.lastTokEndLoc){s.end=e.index,s.loc.end=e,this.options.ranges&&(s.range[1]=e.index)}resetStartLocationFromNode(s,e){this.resetStartLocation(s,e.loc.start)}},Fo=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),O=Me`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:i})=>`Cannot overwrite reserved type ${i}.`,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:i,enumName:s})=>`Boolean enum members need to be initialized. Use either \`${i} = true,\` or \`${i} = false,\` in enum \`${s}\`.`,EnumDuplicateMemberName:({memberName:i,enumName:s})=>`Enum member names need to be unique, but the name \`${i}\` has already been used before in enum \`${s}\`.`,EnumInconsistentMemberValues:({enumName:i})=>`Enum \`${i}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:i,enumName:s})=>`Enum type \`${i}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${s}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:i})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${i}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:i,memberName:s,explicitType:e})=>`Enum \`${i}\` has type \`${e}\`, so the initializer of \`${s}\` needs to be a ${e} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:i,memberName:s})=>`Symbol enum members cannot be initialized. Use \`${s},\` in enum \`${i}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:i,memberName:s})=>`The enum member initializer for \`${s}\` needs to be a literal (either a boolean, number, or string) in enum \`${i}\`.`,EnumInvalidMemberName:({enumName:i,memberName:s,suggestion:e})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${s}\`, consider using \`${e}\`, in enum \`${i}\`.`,EnumNumberMemberNotInitialized:({enumName:i,memberName:s})=>`Number enum members need to be initialized, e.g. \`${s} = 1\` in enum \`${i}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:i})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${i}\`.`,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:i})=>`Unexpected reserved type ${i}.`,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:i,suggestion:s})=>`\`declare export ${i}\` is not supported. Use \`${s}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function Bo(i){return i.type==="DeclareExportAllDeclaration"||i.type==="DeclareExportDeclaration"&&(!i.declaration||i.declaration.type!=="TypeAlias"&&i.declaration.type!=="InterfaceDeclaration")}function Di(i){return i.importKind==="type"||i.importKind==="typeof"}var _o={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function jo(i,s){let e=[],t=[];for(let r=0;r<i.length;r++)(s(i[r],r,i)?e:t).push(i[r]);return[e,t]}var Ro=/\*?\s*@((?:no)?flow)\b/,Uo=i=>class extends i{constructor(...e){super(...e),this.flowPragma=void 0}getScopeHandler(){return Qs}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}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=Ro.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.lastTokStartLoc.index>t.index+1&&this.raise(O.UnexpectedSpaceBetweenModuloChecks,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(),n=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(),n.typeAnnotation=this.finishNode(r,"FunctionTypeAnnotation"),t.typeAnnotation=this.finishNode(n,"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(O.NestedDeclareModule,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(O.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),super.parseImport(o)):(this.expectContextual(125,O.UnsupportedStatementInDeclareModule),o=this.flowParseDeclare(o,!0)),r.push(o)}this.scope.exit(),this.expect(8),this.finishNode(t,"BlockStatement");let n=null,a=!1;return r.forEach(o=>{Bo(o)?(n==="CommonJS"&&this.raise(O.AmbiguousDeclareModuleKind,o),n="ES"):o.type==="DeclareModuleExports"&&(a&&this.raise(O.DuplicateDeclareModuleExports,o),n==="ES"&&this.raise(O.AmbiguousDeclareModuleKind,o),n="CommonJS",a=!0)}),e.kind=n||"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(O.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:r,suggestion:_o[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(O.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,t,r){Fo.has(e)&&this.raise(r?O.AssignReservedType:O.UnexpectedReservedType,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(),n=this.flowParseVariance(),a=this.flowParseTypeAnnotatableIdentifier();return r.name=a.name,r.variance=n,r.bound=a.typeAnnotation,this.match(29)?(this.eat(29),r.default=this.flowParseType()):e&&this.raise(O.MissingTypeParamDefault,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 n=this.flowParseTypeParameter(r);t.params.push(n),n.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:n,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,u,h=!1;for(t&&this.match(6)?(this.expect(6),c=9,u=!0):(this.expect(5),c=8,u=!1),l.exact=u;!this.match(c);){let d=!1,p=null,g=null,y=this.startNode();if(n&&this.isContextual(118)){let P=this.lookahead();P.type!==14&&P.type!==17&&(this.next(),p=this.state.startLoc,e=!1)}if(e&&this.isContextual(106)){let P=this.lookahead();P.type!==14&&P.type!==17&&(this.next(),d=!0)}let b=this.flowParseVariance();if(this.eat(0))p!=null&&this.unexpected(p),this.eat(0)?(b&&this.unexpected(b.loc.start),l.internalSlots.push(this.flowParseObjectTypeInternalSlot(y,d))):l.indexers.push(this.flowParseObjectTypeIndexer(y,d,b));else if(this.match(10)||this.match(47))p!=null&&this.unexpected(p),b&&this.unexpected(b.loc.start),l.callProperties.push(this.flowParseObjectTypeCallProperty(y,d));else{let P="init";if(this.isContextual(99)||this.isContextual(104)){let T=this.lookahead();Ri(T.type)&&(P=this.state.value,this.next())}let k=this.flowParseObjectTypeProperty(y,d,p,b,P,r,a??!u);k===null?(h=!0,g=this.state.lastTokStartLoc):l.properties.push(k)}this.flowObjectTypeSemicolon(),g&&!this.match(8)&&!this.match(9)&&this.raise(O.UnexpectedExplicitInexactInObject,g)}this.expect(c),r&&(l.inexact=h);let f=this.finishNode(l,"ObjectTypeAnnotation");return this.state.inType=o,f}flowParseObjectTypeProperty(e,t,r,n,a,o,l){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(o?l||this.raise(O.InexactInsideExact,this.state.lastTokStartLoc):this.raise(O.InexactInsideNonObject,this.state.lastTokStartLoc),n&&this.raise(O.InexactVariance,n),null):(o||this.raise(O.UnexpectedSpreadType,this.state.lastTokStartLoc),r!=null&&this.unexpected(r),n&&this.raise(O.SpreadVariance,n),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),n&&this.unexpected(n.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(O.ThisParamBannedInConstructor,e.value.this)):(a!=="init"&&this.unexpected(),e.method=!1,this.eat(17)&&(c=!0),e.value=this.flowParseTypeInitialiser(),e.variance=n),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"?O.GetterMayNotHaveThisParam:O.SetterMayNotHaveThisParam,e.value.this),r!==t&&this.raise(e.kind==="get"?m.BadGetterArity:m.BadSetterArity,e),e.kind==="set"&&e.value.rest&&this.raise(m.BadSetterRestParameter,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 n=t||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){let a=this.startNodeAt(e);a.qualification=n,a.id=this.flowParseRestrictedIdentifier(!0),n=this.finishNode(a,"QualifiedTypeIdentifier")}return n}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,n=null,a=this.startNode(),o=this.lookahead(),l=this.state.type===78;return o.type===14||o.type===17?(l&&!e&&this.raise(O.ThisParamMustBeFirst,a),t=this.parseIdentifier(l),this.eat(17)&&(r=!0,l&&this.raise(O.ThisParamMayNotBeOptional,a)),n=this.flowParseTypeInitialiser()):n=this.flowParseType(),a.name=t,a.optional=r,a.typeAnnotation=n,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,n,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,n=this.flowParseTupleType(),this.state.noAnonFunctionType=o,n;case 47:{let l=this.startNode();return l.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(10),r=this.flowParseFunctionTypeParams(),l.params=r.params,l.rest=r.rest,l.this=r._this,this.expect(11),this.expect(19),l.returnType=this.flowParseType(),this.finishNode(l,"FunctionTypeAnnotation")}case 10:{let l=this.startNode();if(this.next(),!this.match(11)&&!this.match(21))if(R(this.state.type)||this.match(78)){let c=this.lookahead().type;a=c!==17&&c!==14}else a=!0;if(a){if(this.state.noAnonFunctionType=!1,n=this.flowParseType(),this.state.noAnonFunctionType=o,this.state.noAnonFunctionType||!(this.match(12)||this.match(11)&&this.lookahead().type===19))return this.expect(11),n;this.eat(12)}return n?r=this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(n)]):r=this.flowParseFunctionTypeParams(),l.params=r.params,l.rest=r.rest,l.this=r._this,this.expect(11),this.expect(19),l.returnType=this.flowParseType(),l.typeParameters=null,this.finishNode(l,"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(O.UnexpectedSubtractionOperand,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(Tr(this.state.type)){let l=Re(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 n=this.startNodeAt(e),a=this.eat(18);r=r||a,this.expect(0),!a&&this.match(3)?(n.elementType=t,this.next(),t=this.finishNode(n,"ArrayTypeAnnotation")):(n.objectType=t,n.indexType=this.flowParseType(),this.expect(3),r?(n.optional=a,t=this.finishNode(n,"OptionalIndexedAccessType")):t=this.finishNode(n,"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 n=this.startNode();[n.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),e.returnType=n.typeAnnotation?this.finishNode(n,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(e,t,r)}parseStatementLike(e){if(this.state.strict&&this.isContextual(129)){let r=this.lookahead();if(Te(r.type)){let n=this.startNode();return this.next(),this.flowParseInterface(n)}}else if(this.plugins.get("flow").enums&&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 Ii(e)||this.plugins.get("flow").enums&&e===126?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return Ii(e)||this.plugins.get("flow").enums&&e===126?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.plugins.get("flow").enums&&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 f=this.lookaheadCharCode();if(f===44||f===61||f===58||f===41)return this.setOptionalParametersError(r),e}this.expect(17);let n=this.state.clone(),a=this.state.noArrowAt,o=this.startNodeAt(t),{consequent:l,failed:c}=this.tryParseConditionalConsequent(),[u,h]=this.getArrowLikeExpressions(l);if(c||h.length>0){let f=[...a];if(h.length>0){this.state=n,this.state.noArrowAt=f;for(let d=0;d<h.length;d++)f.push(h[d].start);({consequent:l,failed:c}=this.tryParseConditionalConsequent()),[u,h]=this.getArrowLikeExpressions(l)}c&&u.length>1&&this.raise(O.AmbiguousConditionalArrow,n.startLoc),c&&u.length===1&&(this.state=n,f.push(u[0].start),this.state.noArrowAt=f,{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],n=[];for(;r.length!==0;){let a=r.pop();a.type==="ArrowFunctionExpression"&&a.body.type!=="BlockStatement"?(a.typeParameters||!a.returnType?this.finishArrowValidation(a):n.push(a),r.push(a.body)):a.type==="ConditionalExpression"&&(r.push(a.consequent),r.push(a.alternate))}return t?(n.forEach(a=>this.finishArrowValidation(a)),[n,[]]):jo(n,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.includes(e.start)?(this.state.noArrowParamsConversionAt.push(this.state.start),r=t(),this.state.noArrowParamsConversionAt.pop()):r=t(),r}parseParenItem(e,t){let r=super.parseParenItem(e,t);if(this.eat(17)&&(r.optional=!0,this.resetEndLocation(e)),this.match(14)){let n=this.startNodeAt(t);return n.expression=r,n.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(n,"TypeCastExpression")}return r}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.plugins.get("flow").enums&&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:n}=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(O.DeclareClassElement,n):t.value&&this.raise(O.DeclareClassFieldInitializer,t.value))}isIterator(e){return e==="iterator"||e==="asyncIterator"}readIterator(){let e=super.readWord1(),t="@@"+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(m.InvalidIdentifier,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):To(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 n=0;n<e.length;n++){let a=e[n];a?.type==="TypeCastExpression"&&(e[n]=this.typeCastToParameter(a))}super.toAssignableList(e,t,r)}toReferencedList(e,t){for(let n=0;n<e.length;n++){var r;let a=e[n];a&&a.type==="TypeCastExpression"&&!((r=a.extra)!=null&&r.parenthesized)&&(e.length>1||!t)&&this.raise(O.TypeCastInPattern,a.typeAnnotation)}return e}parseArrayLike(e,t,r,n){let a=super.parseArrayLike(e,t,r,n);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,n,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,n,a,o),t.params&&a){let l=t.params;l.length>0&&this.isThisParam(l[0])&&this.raise(O.ThisParamBannedInConstructor,t)}else if(t.type==="MethodDefinition"&&a&&t.value.params){let l=t.value.params;l.length>0&&this.isThisParam(l[0])&&this.raise(O.ThisParamBannedInConstructor,t)}}pushClassPrivateMethod(e,t,r,n){t.variance&&this.unexpected(t.variance.loc.start),delete t.variance,this.match(47)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,t,r,n)}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(O.GetterMayNotHaveThisParam,r):this.isThisParam(r)&&this.raise(O.SetterMayNotHaveThisParam,r)}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,t,r,n,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 u=super.parseObjPropValue(e,t,r,n,a,o,l);return c&&((u.value||u).typeParameters=c),u}parseFunctionParamType(e){return this.eat(17)&&(e.type!=="Identifier"&&this.raise(O.PatternIsOptional,e),this.isThisParam(e)&&this.raise(O.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(14)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(O.ThisParamAnnotationRequired,e),this.match(29)&&this.isThisParam(e)&&this.raise(O.ThisParamNoDefault,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(O.TypeBeforeInitializer,r.typeAnnotation),r}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(O.ImportReflectionHasImportType,e.specifiers[0].loc.start)}parseImportSpecifierLocal(e,t,r){t.local=Di(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,n){if(super.applyImportPhase(e,t,r,n),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,n,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 h=this.parseIdentifier(!0);l!==null&&!Te(this.state.type)?(e.imported=h,e.importKind=l,e.local=Fe(h)):(e.imported=o,e.importKind=null,e.local=this.parseIdentifier())}else{if(l!==null&&Te(this.state.type))e.imported=this.parseIdentifier(!0),e.importKind=l;else{if(t)throw this.raise(m.ImportBindingIsString,e,{importName:o.value});e.imported=o,e.importKind=null}this.eatContextual(93)?e.local=this.parseIdentifier():(c=!0,e.local=Fe(e.imported))}let u=Di(e);return r&&u&&this.raise(O.ImportTypeShorthandOnlyInPureImport,e),(r||u)&&this.checkReservedType(e.local.name,e.local.loc.start,!0),c&&!r&&!u&&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 n=null,a;if(this.hasPlugin("jsx")&&(this.match(142)||this.match(47))){if(n=this.state.clone(),a=this.tryParse(()=>super.parseMaybeAssign(e,t),n),!a.error)return a.node;let{context:c}=this.state,u=c[c.length-1];(u===V.j_oTag||u===V.j_expr)&&c.pop()}if((r=a)!=null&&r.error||this.match(47)){var o,l;n=n||this.state.clone();let c,u=this.tryParse(f=>{var d;c=this.flowParseTypeParameterDeclaration();let p=this.forwardNoArrowParamsConversionAt(c,()=>{let y=super.parseMaybeAssign(e,t);return this.resetStartLocationFromNode(y,c),y});(d=p.extra)!=null&&d.parenthesized&&f();let g=this.maybeUnwrapTypeCastExpression(p);return g.type!=="ArrowFunctionExpression"&&f(),g.typeParameters=c,this.resetStartLocationFromNode(g,c),p},n),h=null;if(u.node&&this.maybeUnwrapTypeCastExpression(u.node).type==="ArrowFunctionExpression"){if(!u.error&&!u.aborted)return u.node.async&&this.raise(O.UnexpectedTypeParameterBeforeAsyncArrowFunction,c),u.node;h=u.node}if((o=a)!=null&&o.node)return this.state=a.failState,a.node;if(h)return this.state=u.failState,h;throw(l=a)!=null&&l.thrown?a.error:u.thrown?u.error:this.raise(O.UnexpectedTokenAfterTypeParameter,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 n=this.startNode();return[n.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=r,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),n});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.includes(e.start)?e.params=t:super.setArrowFunctionParameters(e,t)}checkParams(e,t,r,n=!0){if(!(r&&this.state.noArrowParamsConversionAt.includes(e.start))){for(let a=0;a<e.params.length;a++)this.isThisParam(e.params[a])&&a>0&&this.raise(O.ThisParamMustBeFirst,e.params[a]);super.checkParams(e,t,r,n)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.state.start))}parseSubscripts(e,t,r){if(e.type==="Identifier"&&e.name==="async"&&this.state.noArrowAt.includes(t.index)){this.next();let n=this.startNodeAt(t);n.callee=e,n.arguments=super.parseCallExpressionArguments(11,!1),e=this.finishNode(n,"CallExpression")}else if(e.type==="Identifier"&&e.name==="async"&&this.match(47)){let n=this.state.clone(),a=this.tryParse(l=>this.parseAsyncArrowWithTypeParameters(t)||l(),n);if(!a.error&&!a.aborted)return a.node;let o=this.tryParse(()=>super.parseSubscripts(e,t,r),n);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,n){if(this.match(18)&&this.isLookaheadToken_lt()){if(n.optionalChainMember=!0,r)return n.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),n.optionalChainMember&&(a.optional=!1),this.finishCallExpression(a,n.optionalChainMember)));if(o.node)return o.error&&(this.state=o.failState),o.node}return super.parseSubscript(e,t,r,n)}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(O.UnterminatedFlowComment,this.state.curPosition()),r}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(O.NestedFlowComment,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),n=this.input.charCodeAt(t+e+1);return r===58&&n===58?t+2:this.input.slice(t+e,t+e+12)==="flow-include"?t+12:r===58&&n!==58?t:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(m.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,{enumName:t,memberName:r}){this.raise(O.EnumBooleanMemberNotInitialized,e,{memberName:r,enumName:t})}flowEnumErrorInvalidMemberInitializer(e,t){return this.raise(t.explicitType?t.explicitType==="symbol"?O.EnumInvalidMemberInitializerSymbolType:O.EnumInvalidMemberInitializerPrimaryType:O.EnumInvalidMemberInitializerUnknownType,e,t)}flowEnumErrorNumberMemberNotInitialized(e,t){this.raise(O.EnumNumberMemberNotInitialized,e,t)}flowEnumErrorStringMemberInconsistentlyInitialized(e,t){this.raise(O.EnumStringMemberInconsistentlyInitialized,e,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:n}=t;n!==null&&n!==r&&this.flowEnumErrorInvalidMemberInitializer(e,t)}flowEnumMembers({enumName:e,explicitType:t}){let r=new Set,n={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(),u=l.name;if(u==="")continue;/^[a-z]/.test(u)&&this.raise(O.EnumInvalidMemberName,l,{memberName:u,suggestion:u[0].toUpperCase()+u.slice(1),enumName:e}),r.has(u)&&this.raise(O.EnumDuplicateMemberName,l,{memberName:u,enumName:e}),r.add(u);let h={enumName:e,explicitType:t,memberName:u};switch(o.id=l,c.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(c.loc,h,"boolean"),o.init=c.value,n.booleanMembers.push(this.finishNode(o,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(c.loc,h,"number"),o.init=c.value,n.numberMembers.push(this.finishNode(o,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(c.loc,h,"string"),o.init=c.value,n.stringMembers.push(this.finishNode(o,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(c.loc,h);case"none":switch(t){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(c.loc,h);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(c.loc,h);break;default:n.defaultedMembers.push(this.finishNode(o,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:n,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 n of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(n,{enumName:r});return t}else{for(let n of t)this.flowEnumErrorStringMemberInconsistentlyInitialized(n,{enumName:r});return e}}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(102))return null;if(!R(this.state.type))throw this.raise(O.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});let{value:t}=this.state;return this.next(),t!=="boolean"&&t!=="number"&&t!=="string"&&t!=="symbol"&&this.raise(O.EnumInvalidExplicitType,this.state.startLoc,{enumName:e,invalidEnumType:t}),t}flowEnumBody(e,t){let r=t.name,n=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 u=o.booleanMembers.length,h=o.numberMembers.length,f=o.stringMembers.length,d=o.defaultedMembers.length;if(!u&&!h&&!f&&!d)return c();if(!u&&!h)return e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:r}),this.expect(8),this.finishNode(e,"EnumStringBody");if(!h&&!f&&u>=d){for(let p of o.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(p.loc.start,{enumName:r,memberName:p.id.name});return e.members=o.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody")}else if(!u&&!f&&h>=d){for(let p of o.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(p.loc.start,{enumName:r,memberName:p.id.name});return e.members=o.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody")}else return this.raise(O.EnumInconsistentMemberValues,n,{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}},Vo={__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"},ze=Me`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:i})=>`Expected corresponding JSX closing tag for <${i}>.`,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:i,HTMLEntity:s})=>`Unexpected token \`${i}\`. Did you mean \`${s}\` or \`{'${i}'}\`?`,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 je(i){return i?i.type==="JSXOpeningFragment"||i.type==="JSXClosingFragment":!1}function et(i){if(i.type==="JSXIdentifier")return i.name;if(i.type==="JSXNamespacedName")return i.namespace.name+":"+i.name.name;if(i.type==="JSXMemberExpression")return et(i.object)+"."+et(i.property);throw new Error("Node had unexpected type: "+i.type)}var $o=i=>class extends i{jsxReadToken(){let e="",t=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(ze.UnterminatedJsxContent,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:st(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?`
|
|
1
|
+
var $S=Object.create;var Uo=Object.defineProperty;var HS=Object.getOwnPropertyDescriptor;var VS=Object.getOwnPropertyNames;var YS=Object.getPrototypeOf,WS=Object.prototype.hasOwnProperty;var U=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var _=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),zS=(r,t)=>{for(var e in t)Uo(r,e,{get:t[e],enumerable:!0})},JS=(r,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of VS(t))!WS.call(r,n)&&n!==e&&Uo(r,n,{get:()=>t[n],enumerable:!(s=HS(t,n))||s.enumerable});return r};var gi=(r,t,e)=>(e=r!=null?$S(YS(r)):{},JS(t||!r||!r.__esModule?Uo(e,"default",{value:r,enumerable:!0}):e,r));var zh=_((hO,Wh)=>{"use strict";Wh.exports=function(){if(process.env.npm_config_user_agent)return KS(process.env.npm_config_user_agent)};function KS(r){let t=r.split(" ")[0],e=t.lastIndexOf("/"),s=t.substring(0,e);return{name:s==="npminstall"?"cnpm":s,version:t.substring(e+1)}}});var ed=_(Go=>{var Zh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");Go.encode=function(r){if(0<=r&&r<Zh.length)return Zh[r];throw new TypeError("Must be between 0 and 63: "+r)};Go.decode=function(r){var t=65,e=90,s=97,n=122,i=48,a=57,o=43,c=47,l=26,u=52;return t<=r&&r<=e?r-t:s<=r&&r<=n?r-s+l:i<=r&&r<=a?r-i+u:r==o?62:r==c?63:-1}});var Vo=_(Ho=>{var td=ed(),$o=5,sd=1<<$o,rd=sd-1,nd=sd;function ZS(r){return r<0?(-r<<1)+1:(r<<1)+0}function e_(r){var t=(r&1)===1,e=r>>1;return t?-e:e}Ho.encode=function(t){var e="",s,n=ZS(t);do s=n&rd,n>>>=$o,n>0&&(s|=nd),e+=td.encode(s);while(n>0);return e};Ho.decode=function(t,e,s){var n=t.length,i=0,a=0,o,c;do{if(e>=n)throw new Error("Expected more digits in base 64 VLQ value.");if(c=td.decode(t.charCodeAt(e++)),c===-1)throw new Error("Invalid base64 digit: "+t.charAt(e-1));o=!!(c&nd),c&=rd,i=i+(c<<a),a+=$o}while(o);s.value=e_(i),s.rest=e}});var Hs=_(ye=>{function t_(r,t,e){if(t in r)return r[t];if(arguments.length===3)return e;throw new Error('"'+t+'" is a required argument.')}ye.getArg=t_;var id=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,s_=/^data:.+\,.+$/;function Gr(r){var t=r.match(id);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}ye.urlParse=Gr;function $s(r){var t="";return r.scheme&&(t+=r.scheme+":"),t+="//",r.auth&&(t+=r.auth+"@"),r.host&&(t+=r.host),r.port&&(t+=":"+r.port),r.path&&(t+=r.path),t}ye.urlGenerate=$s;var r_=32;function n_(r){var t=[];return function(e){for(var s=0;s<t.length;s++)if(t[s].input===e){var n=t[0];return t[0]=t[s],t[s]=n,t[0].result}var i=r(e);return t.unshift({input:e,result:i}),t.length>r_&&t.pop(),i}}var Yo=n_(function(t){var e=t,s=Gr(t);if(s){if(!s.path)return t;e=s.path}for(var n=ye.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 c,l=0,o=i.length-1;o>=0;o--)c=i[o],c==="."?i.splice(o,1):c===".."?l++:l>0&&(c===""?(i.splice(o+1,l),l=0):(i.splice(o,2),l--));return e=i.join("/"),e===""&&(e=n?"/":"."),s?(s.path=e,$s(s)):e});ye.normalize=Yo;function ad(r,t){r===""&&(r="."),t===""&&(t=".");var e=Gr(t),s=Gr(r);if(s&&(r=s.path||"/"),e&&!e.scheme)return s&&(e.scheme=s.scheme),$s(e);if(e||t.match(s_))return t;if(s&&!s.host&&!s.path)return s.host=t,$s(s);var n=t.charAt(0)==="/"?t:Yo(r.replace(/\/+$/,"")+"/"+t);return s?(s.path=n,$s(s)):n}ye.join=ad;ye.isAbsolute=function(r){return r.charAt(0)==="/"||id.test(r)};function i_(r,t){r===""&&(r="."),r=r.replace(/\/$/,"");for(var e=0;t.indexOf(r+"/")!==0;){var s=r.lastIndexOf("/");if(s<0||(r=r.slice(0,s),r.match(/^([^\/]+:\/)?\/*$/)))return t;++e}return Array(e+1).join("../")+t.substr(r.length+1)}ye.relative=i_;var od=function(){var r=Object.create(null);return!("__proto__"in r)}();function cd(r){return r}function a_(r){return ld(r)?"$"+r:r}ye.toSetString=od?cd:a_;function o_(r){return ld(r)?r.slice(1):r}ye.fromSetString=od?cd:o_;function ld(r){if(!r)return!1;var t=r.length;if(t<9||r.charCodeAt(t-1)!==95||r.charCodeAt(t-2)!==95||r.charCodeAt(t-3)!==111||r.charCodeAt(t-4)!==116||r.charCodeAt(t-5)!==111||r.charCodeAt(t-6)!==114||r.charCodeAt(t-7)!==112||r.charCodeAt(t-8)!==95||r.charCodeAt(t-9)!==95)return!1;for(var e=t-10;e>=0;e--)if(r.charCodeAt(e)!==36)return!1;return!0}function c_(r,t,e){var s=wt(r.source,t.source);return s!==0||(s=r.originalLine-t.originalLine,s!==0)||(s=r.originalColumn-t.originalColumn,s!==0||e)||(s=r.generatedColumn-t.generatedColumn,s!==0)||(s=r.generatedLine-t.generatedLine,s!==0)?s:wt(r.name,t.name)}ye.compareByOriginalPositions=c_;function l_(r,t,e){var s;return s=r.originalLine-t.originalLine,s!==0||(s=r.originalColumn-t.originalColumn,s!==0||e)||(s=r.generatedColumn-t.generatedColumn,s!==0)||(s=r.generatedLine-t.generatedLine,s!==0)?s:wt(r.name,t.name)}ye.compareByOriginalPositionsNoSource=l_;function u_(r,t,e){var s=r.generatedLine-t.generatedLine;return s!==0||(s=r.generatedColumn-t.generatedColumn,s!==0||e)||(s=wt(r.source,t.source),s!==0)||(s=r.originalLine-t.originalLine,s!==0)||(s=r.originalColumn-t.originalColumn,s!==0)?s:wt(r.name,t.name)}ye.compareByGeneratedPositionsDeflated=u_;function p_(r,t,e){var s=r.generatedColumn-t.generatedColumn;return s!==0||e||(s=wt(r.source,t.source),s!==0)||(s=r.originalLine-t.originalLine,s!==0)||(s=r.originalColumn-t.originalColumn,s!==0)?s:wt(r.name,t.name)}ye.compareByGeneratedPositionsDeflatedNoLine=p_;function wt(r,t){return r===t?0:r===null?1:t===null?-1:r>t?1:-1}function h_(r,t){var e=r.generatedLine-t.generatedLine;return e!==0||(e=r.generatedColumn-t.generatedColumn,e!==0)||(e=wt(r.source,t.source),e!==0)||(e=r.originalLine-t.originalLine,e!==0)||(e=r.originalColumn-t.originalColumn,e!==0)?e:wt(r.name,t.name)}ye.compareByGeneratedPositionsInflated=h_;function d_(r){return JSON.parse(r.replace(/^\)]}'[^\n]*\n/,""))}ye.parseSourceMapInput=d_;function f_(r,t,e){if(t=t||"",r&&(r[r.length-1]!=="/"&&t[0]!=="/"&&(r+="/"),t=r+t),e){var s=Gr(e);if(!s)throw new Error("sourceMapURL could not be parsed");if(s.path){var n=s.path.lastIndexOf("/");n>=0&&(s.path=s.path.substring(0,n+1))}t=ad($s(s),t)}return Yo(t)}ye.computeSourceURL=f_});var Jo=_(ud=>{var Wo=Hs(),zo=Object.prototype.hasOwnProperty,hs=typeof Map<"u";function It(){this._array=[],this._set=hs?new Map:Object.create(null)}It.fromArray=function(t,e){for(var s=new It,n=0,i=t.length;n<i;n++)s.add(t[n],e);return s};It.prototype.size=function(){return hs?this._set.size:Object.getOwnPropertyNames(this._set).length};It.prototype.add=function(t,e){var s=hs?t:Wo.toSetString(t),n=hs?this.has(t):zo.call(this._set,s),i=this._array.length;(!n||e)&&this._array.push(t),n||(hs?this._set.set(t,i):this._set[s]=i)};It.prototype.has=function(t){if(hs)return this._set.has(t);var e=Wo.toSetString(t);return zo.call(this._set,e)};It.prototype.indexOf=function(t){if(hs){var e=this._set.get(t);if(e>=0)return e}else{var s=Wo.toSetString(t);if(zo.call(this._set,s))return this._set[s]}throw new Error('"'+t+'" is not in the set.')};It.prototype.at=function(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)};It.prototype.toArray=function(){return this._array.slice()};ud.ArraySet=It});var dd=_(hd=>{var pd=Hs();function m_(r,t){var e=r.generatedLine,s=t.generatedLine,n=r.generatedColumn,i=t.generatedColumn;return s>e||s==e&&i>=n||pd.compareByGeneratedPositionsInflated(r,t)<=0}function bi(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}bi.prototype.unsortedForEach=function(t,e){this._array.forEach(t,e)};bi.prototype.add=function(t){m_(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))};bi.prototype.toArray=function(){return this._sorted||(this._array.sort(pd.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};hd.MappingList=bi});var Ko=_(fd=>{var $r=Vo(),ce=Hs(),Si=Jo().ArraySet,y_=dd().MappingList;function We(r){r||(r={}),this._file=ce.getArg(r,"file",null),this._sourceRoot=ce.getArg(r,"sourceRoot",null),this._skipValidation=ce.getArg(r,"skipValidation",!1),this._ignoreInvalidMapping=ce.getArg(r,"ignoreInvalidMapping",!1),this._sources=new Si,this._names=new Si,this._mappings=new y_,this._sourcesContents=null}We.prototype._version=3;We.fromSourceMap=function(t,e){var s=t.sourceRoot,n=new We(Object.assign(e||{},{file:t.file,sourceRoot:s}));return t.eachMapping(function(i){var a={generated:{line:i.generatedLine,column:i.generatedColumn}};i.source!=null&&(a.source=i.source,s!=null&&(a.source=ce.relative(s,a.source)),a.original={line:i.originalLine,column:i.originalColumn},i.name!=null&&(a.name=i.name)),n.addMapping(a)}),t.sources.forEach(function(i){var a=i;s!==null&&(a=ce.relative(s,i)),n._sources.has(a)||n._sources.add(a);var o=t.sourceContentFor(i);o!=null&&n.setSourceContent(i,o)}),n};We.prototype.addMapping=function(t){var e=ce.getArg(t,"generated"),s=ce.getArg(t,"original",null),n=ce.getArg(t,"source",null),i=ce.getArg(t,"name",null);!this._skipValidation&&this._validateMapping(e,s,n,i)===!1||(n!=null&&(n=String(n),this._sources.has(n)||this._sources.add(n)),i!=null&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:e.line,generatedColumn:e.column,originalLine:s!=null&&s.line,originalColumn:s!=null&&s.column,source:n,name:i}))};We.prototype.setSourceContent=function(t,e){var s=t;this._sourceRoot!=null&&(s=ce.relative(this._sourceRoot,s)),e!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[ce.toSetString(s)]=e):this._sourcesContents&&(delete this._sourcesContents[ce.toSetString(s)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};We.prototype.applySourceMap=function(t,e,s){var n=e;if(e==null){if(t.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);n=t.file}var i=this._sourceRoot;i!=null&&(n=ce.relative(i,n));var a=new Si,o=new Si;this._mappings.unsortedForEach(function(c){if(c.source===n&&c.originalLine!=null){var l=t.originalPositionFor({line:c.originalLine,column:c.originalColumn});l.source!=null&&(c.source=l.source,s!=null&&(c.source=ce.join(s,c.source)),i!=null&&(c.source=ce.relative(i,c.source)),c.originalLine=l.line,c.originalColumn=l.column,l.name!=null&&(c.name=l.name))}var u=c.source;u!=null&&!a.has(u)&&a.add(u);var p=c.name;p!=null&&!o.has(p)&&o.add(p)},this),this._sources=a,this._names=o,t.sources.forEach(function(c){var l=t.sourceContentFor(c);l!=null&&(s!=null&&(c=ce.join(s,c)),i!=null&&(c=ce.relative(i,c)),this.setSourceContent(c,l))},this)};We.prototype._validateMapping=function(t,e,s,n){if(e&&typeof e.line!="number"&&typeof e.column!="number"){var i="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(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(i),!1;throw new Error(i)}if(!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!e&&!s&&!n)){if(t&&"line"in t&&"column"in t&&e&&"line"in e&&"column"in e&&t.line>0&&t.column>=0&&e.line>0&&e.column>=0&&s)return;var i="Invalid mapping: "+JSON.stringify({generated:t,source:s,original:e,name:n});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(i),!1;throw new Error(i)}};We.prototype._serializeMappings=function(){for(var t=0,e=1,s=0,n=0,i=0,a=0,o="",c,l,u,p,h=this._mappings.toArray(),d=0,f=h.length;d<f;d++){if(l=h[d],c="",l.generatedLine!==e)for(t=0;l.generatedLine!==e;)c+=";",e++;else if(d>0){if(!ce.compareByGeneratedPositionsInflated(l,h[d-1]))continue;c+=","}c+=$r.encode(l.generatedColumn-t),t=l.generatedColumn,l.source!=null&&(p=this._sources.indexOf(l.source),c+=$r.encode(p-a),a=p,c+=$r.encode(l.originalLine-1-n),n=l.originalLine-1,c+=$r.encode(l.originalColumn-s),s=l.originalColumn,l.name!=null&&(u=this._names.indexOf(l.name),c+=$r.encode(u-i),i=u)),o+=c}return o};We.prototype._generateSourcesContent=function(t,e){return t.map(function(s){if(!this._sourcesContents)return null;e!=null&&(s=ce.relative(e,s));var n=ce.toSetString(s);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)};We.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(t.file=this._file),this._sourceRoot!=null&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t};We.prototype.toString=function(){return JSON.stringify(this.toJSON())};fd.SourceMapGenerator=We});var md=_(ds=>{ds.GREATEST_LOWER_BOUND=1;ds.LEAST_UPPER_BOUND=2;function Xo(r,t,e,s,n,i){var a=Math.floor((t-r)/2)+r,o=n(e,s[a],!0);return o===0?a:o>0?t-a>1?Xo(a,t,e,s,n,i):i==ds.LEAST_UPPER_BOUND?t<s.length?t:-1:a:a-r>1?Xo(r,a,e,s,n,i):i==ds.LEAST_UPPER_BOUND?a:r<0?-1:r}ds.search=function(t,e,s,n){if(e.length===0)return-1;var i=Xo(-1,e.length,t,e,s,n||ds.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&s(e[i],e[i-1],!0)===0;)--i;return i}});var bd=_(gd=>{function g_(r){function t(n,i,a){var o=n[i];n[i]=n[a],n[a]=o}function e(n,i){return Math.round(n+Math.random()*(i-n))}function s(n,i,a,o){if(a<o){var c=e(a,o),l=a-1;t(n,c,o);for(var u=n[o],p=a;p<o;p++)i(n[p],u,!1)<=0&&(l+=1,t(n,l,p));t(n,l+1,p);var h=l+1;s(n,i,a,h-1),s(n,i,h+1,o)}}return s}function b_(r){let t=g_.toString();return new Function(`return ${t}`)()(r)}var yd=new WeakMap;gd.quickSort=function(r,t,e=0){let s=yd.get(t);s===void 0&&(s=b_(t),yd.set(t,s)),s(r,t,e,r.length-1)}});var xd=_(_i=>{var M=Hs(),Zo=md(),Vs=Jo().ArraySet,S_=Vo(),Hr=bd().quickSort;function se(r,t){var e=r;return typeof r=="string"&&(e=M.parseSourceMapInput(r)),e.sections!=null?new nt(e,t):new Ee(e,t)}se.fromSourceMap=function(r,t){return Ee.fromSourceMap(r,t)};se.prototype._version=3;se.prototype.__generatedMappings=null;Object.defineProperty(se.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});se.prototype.__originalMappings=null;Object.defineProperty(se.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});se.prototype._charIsMappingSeparator=function(t,e){var s=t.charAt(e);return s===";"||s===","};se.prototype._parseMappings=function(t,e){throw new Error("Subclasses must implement _parseMappings")};se.GENERATED_ORDER=1;se.ORIGINAL_ORDER=2;se.GREATEST_LOWER_BOUND=1;se.LEAST_UPPER_BOUND=2;se.prototype.eachMapping=function(t,e,s){var n=e||null,i=s||se.GENERATED_ORDER,a;switch(i){case se.GENERATED_ORDER:a=this._generatedMappings;break;case se.ORIGINAL_ORDER:a=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var o=this.sourceRoot,c=t.bind(n),l=this._names,u=this._sources,p=this._sourceMapURL,h=0,d=a.length;h<d;h++){var f=a[h],m=f.source===null?null:u.at(f.source);m!==null&&(m=M.computeSourceURL(o,m,p)),c({source:m,generatedLine:f.generatedLine,generatedColumn:f.generatedColumn,originalLine:f.originalLine,originalColumn:f.originalColumn,name:f.name===null?null:l.at(f.name)})}};se.prototype.allGeneratedPositionsFor=function(t){var e=M.getArg(t,"line"),s={source:M.getArg(t,"source"),originalLine:e,originalColumn:M.getArg(t,"column",0)};if(s.source=this._findSourceIndex(s.source),s.source<0)return[];var n=[],i=this._findMapping(s,this._originalMappings,"originalLine","originalColumn",M.compareByOriginalPositions,Zo.LEAST_UPPER_BOUND);if(i>=0){var a=this._originalMappings[i];if(t.column===void 0)for(var o=a.originalLine;a&&a.originalLine===o;)n.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 c=a.originalColumn;a&&a.originalLine===e&&a.originalColumn==c;)n.push({line:M.getArg(a,"generatedLine",null),column:M.getArg(a,"generatedColumn",null),lastColumn:M.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++i]}return n};_i.SourceMapConsumer=se;function Ee(r,t){var e=r;typeof r=="string"&&(e=M.parseSourceMapInput(r));var s=M.getArg(e,"version"),n=M.getArg(e,"sources"),i=M.getArg(e,"names",[]),a=M.getArg(e,"sourceRoot",null),o=M.getArg(e,"sourcesContent",null),c=M.getArg(e,"mappings"),l=M.getArg(e,"file",null);if(s!=this._version)throw new Error("Unsupported version: "+s);a&&(a=M.normalize(a)),n=n.map(String).map(M.normalize).map(function(u){return a&&M.isAbsolute(a)&&M.isAbsolute(u)?M.relative(a,u):u}),this._names=Vs.fromArray(i.map(String),!0),this._sources=Vs.fromArray(n,!0),this._absoluteSources=this._sources.toArray().map(function(u){return M.computeSourceURL(a,u,t)}),this.sourceRoot=a,this.sourcesContent=o,this._mappings=c,this._sourceMapURL=t,this.file=l}Ee.prototype=Object.create(se.prototype);Ee.prototype.consumer=se;Ee.prototype._findSourceIndex=function(r){var t=r;if(this.sourceRoot!=null&&(t=M.relative(this.sourceRoot,t)),this._sources.has(t))return this._sources.indexOf(t);var e;for(e=0;e<this._absoluteSources.length;++e)if(this._absoluteSources[e]==r)return e;return-1};Ee.fromSourceMap=function(t,e){var s=Object.create(Ee.prototype),n=s._names=Vs.fromArray(t._names.toArray(),!0),i=s._sources=Vs.fromArray(t._sources.toArray(),!0);s.sourceRoot=t._sourceRoot,s.sourcesContent=t._generateSourcesContent(s._sources.toArray(),s.sourceRoot),s.file=t._file,s._sourceMapURL=e,s._absoluteSources=s._sources.toArray().map(function(d){return M.computeSourceURL(s.sourceRoot,d,e)});for(var a=t._mappings.toArray().slice(),o=s.__generatedMappings=[],c=s.__originalMappings=[],l=0,u=a.length;l<u;l++){var p=a[l],h=new _d;h.generatedLine=p.generatedLine,h.generatedColumn=p.generatedColumn,p.source&&(h.source=i.indexOf(p.source),h.originalLine=p.originalLine,h.originalColumn=p.originalColumn,p.name&&(h.name=n.indexOf(p.name)),c.push(h)),o.push(h)}return Hr(s.__originalMappings,M.compareByOriginalPositions),s};Ee.prototype._version=3;Object.defineProperty(Ee.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function _d(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}var Qo=M.compareByGeneratedPositionsDeflatedNoLine;function Sd(r,t){let e=r.length,s=r.length-t;if(!(s<=1))if(s==2){let n=r[t],i=r[t+1];Qo(n,i)>0&&(r[t]=i,r[t+1]=n)}else if(s<20)for(let n=t;n<e;n++)for(let i=n;i>t;i--){let a=r[i-1],o=r[i];if(Qo(a,o)<=0)break;r[i-1]=o,r[i]=a}else Hr(r,Qo,t)}Ee.prototype._parseMappings=function(t,e){var s=1,n=0,i=0,a=0,o=0,c=0,l=t.length,u=0,p={},h={},d=[],f=[],m,y,b,x,N;let T=0;for(;u<l;)if(t.charAt(u)===";")s++,u++,n=0,Sd(f,T),T=f.length;else if(t.charAt(u)===",")u++;else{for(m=new _d,m.generatedLine=s,x=u;x<l&&!this._charIsMappingSeparator(t,x);x++);for(y=t.slice(u,x),b=[];u<x;)S_.decode(t,u,h),N=h.value,u=h.rest,b.push(N);if(b.length===2)throw new Error("Found a source, but no line and column");if(b.length===3)throw new Error("Found a source and line, but no column");if(m.generatedColumn=n+b[0],n=m.generatedColumn,b.length>1&&(m.source=o+b[1],o+=b[1],m.originalLine=i+b[2],i=m.originalLine,m.originalLine+=1,m.originalColumn=a+b[3],a=m.originalColumn,b.length>4&&(m.name=c+b[4],c+=b[4])),f.push(m),typeof m.originalLine=="number"){let A=m.source;for(;d.length<=A;)d.push(null);d[A]===null&&(d[A]=[]),d[A].push(m)}}Sd(f,T),this.__generatedMappings=f;for(var P=0;P<d.length;P++)d[P]!=null&&Hr(d[P],M.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...d)};Ee.prototype._findMapping=function(t,e,s,n,i,a){if(t[s]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+t[s]);if(t[n]<0)throw new TypeError("Column must be greater than or equal to 0, got "+t[n]);return Zo.search(t,e,i,a)};Ee.prototype.computeColumnSpans=function(){for(var t=0;t<this._generatedMappings.length;++t){var e=this._generatedMappings[t];if(t+1<this._generatedMappings.length){var s=this._generatedMappings[t+1];if(e.generatedLine===s.generatedLine){e.lastGeneratedColumn=s.generatedColumn-1;continue}}e.lastGeneratedColumn=1/0}};Ee.prototype.originalPositionFor=function(t){var e={generatedLine:M.getArg(t,"line"),generatedColumn:M.getArg(t,"column")},s=this._findMapping(e,this._generatedMappings,"generatedLine","generatedColumn",M.compareByGeneratedPositionsDeflated,M.getArg(t,"bias",se.GREATEST_LOWER_BOUND));if(s>=0){var n=this._generatedMappings[s];if(n.generatedLine===e.generatedLine){var i=M.getArg(n,"source",null);i!==null&&(i=this._sources.at(i),i=M.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var a=M.getArg(n,"name",null);return a!==null&&(a=this._names.at(a)),{source:i,line:M.getArg(n,"originalLine",null),column:M.getArg(n,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}};Ee.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(t){return t==null}):!1};Ee.prototype.sourceContentFor=function(t,e){if(!this.sourcesContent)return null;var s=this._findSourceIndex(t);if(s>=0)return this.sourcesContent[s];var n=t;this.sourceRoot!=null&&(n=M.relative(this.sourceRoot,n));var i;if(this.sourceRoot!=null&&(i=M.urlParse(this.sourceRoot))){var a=n.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("/"+n))return this.sourcesContent[this._sources.indexOf("/"+n)]}if(e)return null;throw new Error('"'+n+'" is not in the SourceMap.')};Ee.prototype.generatedPositionFor=function(t){var e=M.getArg(t,"source");if(e=this._findSourceIndex(e),e<0)return{line:null,column:null,lastColumn:null};var s={source:e,originalLine:M.getArg(t,"line"),originalColumn:M.getArg(t,"column")},n=this._findMapping(s,this._originalMappings,"originalLine","originalColumn",M.compareByOriginalPositions,M.getArg(t,"bias",se.GREATEST_LOWER_BOUND));if(n>=0){var i=this._originalMappings[n];if(i.source===s.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}};_i.BasicSourceMapConsumer=Ee;function nt(r,t){var e=r;typeof r=="string"&&(e=M.parseSourceMapInput(r));var s=M.getArg(e,"version"),n=M.getArg(e,"sections");if(s!=this._version)throw new Error("Unsupported version: "+s);this._sources=new Vs,this._names=new Vs;var i={line:-1,column:0};this._sections=n.map(function(a){if(a.url)throw new Error("Support for url field in sections not implemented.");var o=M.getArg(a,"offset"),c=M.getArg(o,"line"),l=M.getArg(o,"column");if(c<i.line||c===i.line&&l<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=o,{generatedOffset:{generatedLine:c+1,generatedColumn:l+1},consumer:new se(M.getArg(a,"map"),t)}})}nt.prototype=Object.create(se.prototype);nt.prototype.constructor=se;nt.prototype._version=3;Object.defineProperty(nt.prototype,"sources",{get:function(){for(var r=[],t=0;t<this._sections.length;t++)for(var e=0;e<this._sections[t].consumer.sources.length;e++)r.push(this._sections[t].consumer.sources[e]);return r}});nt.prototype.originalPositionFor=function(t){var e={generatedLine:M.getArg(t,"line"),generatedColumn:M.getArg(t,"column")},s=Zo.search(e,this._sections,function(i,a){var o=i.generatedLine-a.generatedOffset.generatedLine;return o||i.generatedColumn-a.generatedOffset.generatedColumn}),n=this._sections[s];return n?n.consumer.originalPositionFor({line:e.generatedLine-(n.generatedOffset.generatedLine-1),column:e.generatedColumn-(n.generatedOffset.generatedLine===e.generatedLine?n.generatedOffset.generatedColumn-1:0),bias:t.bias}):{source:null,line:null,column:null,name:null}};nt.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(t){return t.consumer.hasContentsOfAllSources()})};nt.prototype.sourceContentFor=function(t,e){for(var s=0;s<this._sections.length;s++){var n=this._sections[s],i=n.consumer.sourceContentFor(t,!0);if(i||i==="")return i}if(e)return null;throw new Error('"'+t+'" is not in the SourceMap.')};nt.prototype.generatedPositionFor=function(t){for(var e=0;e<this._sections.length;e++){var s=this._sections[e];if(s.consumer._findSourceIndex(M.getArg(t,"source"))!==-1){var n=s.consumer.generatedPositionFor(t);if(n){var i={line:n.line+(s.generatedOffset.generatedLine-1),column:n.column+(s.generatedOffset.generatedLine===n.line?s.generatedOffset.generatedColumn-1:0)};return i}}}return{line:null,column:null}};nt.prototype._parseMappings=function(t,e){this.__generatedMappings=[],this.__originalMappings=[];for(var s=0;s<this._sections.length;s++)for(var n=this._sections[s],i=n.consumer._generatedMappings,a=0;a<i.length;a++){var o=i[a],c=n.consumer._sources.at(o.source);c!==null&&(c=M.computeSourceURL(n.consumer.sourceRoot,c,this._sourceMapURL)),this._sources.add(c),c=this._sources.indexOf(c);var l=null;o.name&&(l=n.consumer._names.at(o.name),this._names.add(l),l=this._names.indexOf(l));var u={source:c,generatedLine:o.generatedLine+(n.generatedOffset.generatedLine-1),generatedColumn:o.generatedColumn+(n.generatedOffset.generatedLine===o.generatedLine?n.generatedOffset.generatedColumn-1:0),originalLine:o.originalLine,originalColumn:o.originalColumn,name:l};this.__generatedMappings.push(u),typeof u.originalLine=="number"&&this.__originalMappings.push(u)}Hr(this.__generatedMappings,M.compareByGeneratedPositionsDeflated),Hr(this.__originalMappings,M.compareByOriginalPositions)};_i.IndexedSourceMapConsumer=nt});var Td=_(Ed=>{var __=Ko().SourceMapGenerator,xi=Hs(),x_=/(\r?\n)/,E_=10,Ys="$$$isSourceNode$$$";function je(r,t,e,s,n){this.children=[],this.sourceContents={},this.line=r??null,this.column=t??null,this.source=e??null,this.name=n??null,this[Ys]=!0,s!=null&&this.add(s)}je.fromStringWithSourceMap=function(t,e,s){var n=new je,i=t.split(x_),a=0,o=function(){var h=f(),d=f()||"";return h+d;function f(){return a<i.length?i[a++]:void 0}},c=1,l=0,u=null;return e.eachMapping(function(h){if(u!==null)if(c<h.generatedLine)p(u,o()),c++,l=0;else{var d=i[a]||"",f=d.substr(0,h.generatedColumn-l);i[a]=d.substr(h.generatedColumn-l),l=h.generatedColumn,p(u,f),u=h;return}for(;c<h.generatedLine;)n.add(o()),c++;if(l<h.generatedColumn){var d=i[a]||"";n.add(d.substr(0,h.generatedColumn)),i[a]=d.substr(h.generatedColumn),l=h.generatedColumn}u=h},this),a<i.length&&(u&&p(u,o()),n.add(i.splice(a).join(""))),e.sources.forEach(function(h){var d=e.sourceContentFor(h);d!=null&&(s!=null&&(h=xi.join(s,h)),n.setSourceContent(h,d))}),n;function p(h,d){if(h===null||h.source===void 0)n.add(d);else{var f=s?xi.join(s,h.source):h.source;n.add(new je(h.originalLine,h.originalColumn,f,d,h.name))}}};je.prototype.add=function(t){if(Array.isArray(t))t.forEach(function(e){this.add(e)},this);else if(t[Ys]||typeof t=="string")t&&this.children.push(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this};je.prototype.prepend=function(t){if(Array.isArray(t))for(var e=t.length-1;e>=0;e--)this.prepend(t[e]);else if(t[Ys]||typeof t=="string")this.children.unshift(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this};je.prototype.walk=function(t){for(var e,s=0,n=this.children.length;s<n;s++)e=this.children[s],e[Ys]?e.walk(t):e!==""&&t(e,{source:this.source,line:this.line,column:this.column,name:this.name})};je.prototype.join=function(t){var e,s,n=this.children.length;if(n>0){for(e=[],s=0;s<n-1;s++)e.push(this.children[s]),e.push(t);e.push(this.children[s]),this.children=e}return this};je.prototype.replaceRight=function(t,e){var s=this.children[this.children.length-1];return s[Ys]?s.replaceRight(t,e):typeof s=="string"?this.children[this.children.length-1]=s.replace(t,e):this.children.push("".replace(t,e)),this};je.prototype.setSourceContent=function(t,e){this.sourceContents[xi.toSetString(t)]=e};je.prototype.walkSourceContents=function(t){for(var e=0,s=this.children.length;e<s;e++)this.children[e][Ys]&&this.children[e].walkSourceContents(t);for(var n=Object.keys(this.sourceContents),e=0,s=n.length;e<s;e++)t(xi.fromSetString(n[e]),this.sourceContents[n[e]])};je.prototype.toString=function(){var t="";return this.walk(function(e){t+=e}),t};je.prototype.toStringWithSourceMap=function(t){var e={code:"",line:1,column:0},s=new __(t),n=!1,i=null,a=null,o=null,c=null;return this.walk(function(l,u){e.code+=l,u.source!==null&&u.line!==null&&u.column!==null?((i!==u.source||a!==u.line||o!==u.column||c!==u.name)&&s.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:e.line,column:e.column},name:u.name}),i=u.source,a=u.line,o=u.column,c=u.name,n=!0):n&&(s.addMapping({generated:{line:e.line,column:e.column}}),i=null,n=!1);for(var p=0,h=l.length;p<h;p++)l.charCodeAt(p)===E_?(e.line++,e.column=0,p+1===h?(i=null,n=!1):n&&s.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:e.line,column:e.column},name:u.name})):e.column++}),this.walkSourceContents(function(l,u){s.setSourceContent(l,u)}),{code:e.code,map:s}};Ed.SourceNode=je});var Pd=_(Ei=>{Ei.SourceMapGenerator=Ko().SourceMapGenerator;Ei.SourceMapConsumer=xd().SourceMapConsumer;Ei.SourceNode=Td().SourceNode});var tf=_(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});function T_(r,t){if(r==null)return{};var e={};for(var s in r)if({}.hasOwnProperty.call(r,s)){if(t.includes(s))continue;e[s]=r[s]}return e}var mt=class{constructor(t,e,s){this.line=void 0,this.column=void 0,this.index=void 0,this.line=t,this.column=e,this.index=s}},Xs=class{constructor(t,e){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=t,this.end=e}};function De(r,t){let{line:e,column:s,index:n}=r;return new mt(e,s+t,n+t)}var vd="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",P_={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:vd},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:vd}},Ad={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"},vi=r=>r.type==="UpdateExpression"?Ad.UpdateExpression[`${r.prefix}`]:Ad[r.type],v_={AccessorIsGenerator:({kind:r})=>`A ${r}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:r})=>`Missing initializer in ${r} 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:r})=>`\`${r}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",DynamicImportPhaseRequiresImportExpressions:({phase:r})=>`'import.${r}(...)' can only be parsed when using the 'createImportExpressions' option.`,ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:r,exportName:t})=>`A string literal cannot be used as an exported binding without \`from\`.
|
|
2
|
+
- Did you mean \`export { '${r}' as '${t}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:r})=>`'${r==="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:r})=>`Unsyntactic ${r==="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:r})=>`A string literal cannot be used as an imported binding.
|
|
3
|
+
- Did you mean \`import { "${r}" as foo }\`?`,ImportCallArgumentTrailingComma:"Trailing comma is disallowed inside import(...) arguments.",ImportCallArity:({maxArgumentCount:r})=>`\`import()\` requires exactly ${r===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:r})=>`Expected number in radix ${r}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:r})=>`Escape sequence in keyword ${r}.`,InvalidIdentifier:({identifierName:r})=>`Invalid identifier ${r}.`,InvalidLhs:({ancestor:r})=>`Invalid left-hand side in ${vi(r)}.`,InvalidLhsBinding:({ancestor:r})=>`Binding invalid left-hand side in ${vi(r)}.`,InvalidLhsOptionalChaining:({ancestor:r})=>`Invalid optional chaining in the left-hand side of ${vi(r)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:r})=>`Unexpected character '${r}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:r})=>`Private name #${r} 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:r})=>`Label '${r}' 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:r})=>`This experimental syntax requires enabling the parser plugin: ${r.map(t=>JSON.stringify(t)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:r})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${r.map(t=>JSON.stringify(t)).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:r})=>`Duplicate key "${r}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:r})=>`An export name cannot include a lone surrogate, found '\\u${r.toString(16)}'.`,ModuleExportUndefined:({localName:r})=>`Export '${r}' 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:r})=>`Private names are only allowed in property accesses (\`obj.#${r}\`) or in \`in\` expressions (\`#${r} in obj\`).`,PrivateNameRedeclaration:({identifierName:r})=>`Duplicate private name #${r}.`,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:r})=>`Unexpected keyword '${r}'.`,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:r})=>`Unexpected reserved word '${r}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:r,unexpected:t})=>`Unexpected token${t?` '${t}'.`:""}${r?`, expected "${r}"`:""}`,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:r,onlyValidPropertyName:t})=>`The only valid meta property for ${r} is ${r}.${t}.`,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.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:r})=>`Identifier '${r}' 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."},A_={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:r})=>`Assigning to '${r}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:r})=>`Binding '${r}' 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."},C_=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),w_={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:r})=>`Invalid topic token ${r}. In order to use ${r} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${r}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:r})=>`Hack-style pipe body cannot be an unparenthesized ${vi({type:r})}; 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.'},I_=["message"];function Cd(r,t,e){Object.defineProperty(r,t,{enumerable:!1,configurable:!0,value:e})}function N_({toMessage:r,code:t,reasonCode:e,syntaxPlugin:s}){let n=e==="MissingPlugin"||e==="MissingOneOfPlugins";{let i={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};i[e]&&(e=i[e])}return function i(a,o){let c=new SyntaxError;return c.code=t,c.reasonCode=e,c.loc=a,c.pos=a.index,c.syntaxPlugin=s,n&&(c.missingPlugin=o.missingPlugin),Cd(c,"clone",function(u={}){var p;let{line:h,column:d,index:f}=(p=u.loc)!=null?p:a;return i(new mt(h,d,f),Object.assign({},o,u.details))}),Cd(c,"details",o),Object.defineProperty(c,"message",{configurable:!0,get(){let l=`${r(o)} (${a.line}:${a.column})`;return this.message=l,l},set(l){Object.defineProperty(this,"message",{value:l,writable:!0})}}),c}}function Ot(r,t){if(Array.isArray(r))return s=>Ot(s,r[0]);let e={};for(let s of Object.keys(r)){let n=r[s],i=typeof n=="string"?{message:()=>n}:typeof n=="function"?{message:n}:n,{message:a}=i,o=T_(i,I_),c=typeof a=="string"?()=>a:a;e[s]=N_(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:s,toMessage:c},t?{syntaxPlugin:t}:{},o))}return e}var g=Object.assign({},Ot(P_),Ot(v_),Ot(A_),Ot`pipelineOperator`(w_)),{defineProperty:k_}=Object,wd=(r,t)=>{r&&k_(r,t,{enumerable:!1,value:r[t]})};function Vr(r){return wd(r.loc.start,"index"),wd(r.loc.end,"index"),r}var D_=r=>class extends r{parse(){let e=Vr(super.parse());return this.options.tokens&&(e.tokens=e.tokens.map(Vr)),e}parseRegExpLiteral({pattern:e,flags:s}){let n=null;try{n=new RegExp(e,s)}catch{}let i=this.estreeParseLiteral(n);return i.regex={pattern:e,flags:s},i}parseBigIntLiteral(e){let s;try{s=BigInt(e)}catch{s=null}let n=this.estreeParseLiteral(s);return n.bigint=String(n.value||e),n}parseDecimalLiteral(e){let n=this.estreeParseLiteral(null);return n.decimal=String(n.value||e),n}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 s=e.value;delete e.value,s.type="Literal",s.raw=s.extra.raw,s.value=s.extra.expressionValue;let n=e;return n.type="ExpressionStatement",n.expression=s,n.directive=s.extra.rawValue,delete s.extra,n}initFunction(e,s){super.initFunction(e,s),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 s;return e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&!((s=e.expression.extra)!=null&&s.parenthesized)}parseBlockBody(e,s,n,i,a){super.parseBlockBody(e,s,n,i,a);let o=e.directives.map(c=>this.directiveToStmt(c));e.body=o.concat(e.body),delete e.directives}pushClassMethod(e,s,n,i,a,o){this.parseMethod(s,n,i,a,o,"ClassMethod",!0),s.typeParameters&&(s.value.typeParameters=s.typeParameters,delete s.typeParameters),e.body.push(s)}parsePrivateName(){let e=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(e):e}convertPrivateNameToPrivateIdentifier(e){let s=super.getPrivateNameSV(e);return e=e,delete e.id,e.name=s,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,s){let n=super.parseLiteral(e,s);return n.raw=n.extra.raw,delete n.extra,n}parseFunctionBody(e,s,n=!1){super.parseFunctionBody(e,s,n),e.expression=e.body.type!=="BlockStatement"}parseMethod(e,s,n,i,a,o,c=!1){let l=this.startNode();return l.kind=e.kind,l=super.parseMethod(l,s,n,i,a,o,c),l.type="FunctionExpression",delete l.kind,e.value=l,o==="ClassPrivateMethod"&&(e.computed=!1),this.finishNode(e,"MethodDefinition")}nameIsConstructor(e){return e.type==="Literal"?e.value==="constructor":super.nameIsConstructor(e)}parseClassProperty(...e){let s=super.parseClassProperty(...e);return this.getPluginOption("estree","classFeatures")&&(s.type="PropertyDefinition"),s}parseClassPrivateProperty(...e){let s=super.parseClassPrivateProperty(...e);return this.getPluginOption("estree","classFeatures")&&(s.type="PropertyDefinition",s.computed=!1),s}parseObjectMethod(e,s,n,i,a){let o=super.parseObjectMethod(e,s,n,i,a);return o&&(o.type="Property",o.kind==="method"&&(o.kind="init"),o.shorthand=!1),o}parseObjectProperty(e,s,n,i){let a=super.parseObjectProperty(e,s,n,i);return a&&(a.kind="init",a.type="Property"),a}isValidLVal(e,s,n){return e==="Property"?"value":super.isValidLVal(e,s,n)}isAssignable(e,s){return e!=null&&this.isObjectProperty(e)?this.isAssignable(e.value,s):super.isAssignable(e,s)}toAssignable(e,s=!1){if(e!=null&&this.isObjectProperty(e)){let{key:n,value:i}=e;this.isPrivateName(n)&&this.classScope.usePrivateName(this.getPrivateNameSV(n),n.loc.start),this.toAssignable(i,s)}else super.toAssignable(e,s)}toAssignableObjectExpressionProp(e,s,n){e.type==="Property"&&(e.kind==="get"||e.kind==="set")?this.raise(g.PatternHasAccessor,e.key):e.type==="Property"&&e.method?this.raise(g.PatternHasMethod,e.key):super.toAssignableObjectExpressionProp(e,s,n)}finishCallExpression(e,s){let n=super.finishCallExpression(e,s);if(n.callee.type==="Import"){if(n.type="ImportExpression",n.source=n.arguments[0],this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions")){var i,a;n.options=(i=n.arguments[1])!=null?i:null,n.attributes=(a=n.arguments[1])!=null?a:null}delete n.arguments,delete n.callee}return n}toReferencedArguments(e){e.type!=="ImportExpression"&&super.toReferencedArguments(e)}parseExport(e,s){let n=this.state.lastTokStartLoc,i=super.parseExport(e,s);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,n)}break}return i}parseSubscript(e,s,n,i){let a=super.parseSubscript(e,s,n,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.type==="Property"&&(e.method||e.kind==="get"||e.kind==="set")}finishNodeAt(e,s,n){return Vr(super.finishNodeAt(e,s,n))}resetStartLocation(e,s){super.resetStartLocation(e,s),Vr(e)}resetEndLocation(e,s=this.state.lastTokEndLoc){super.resetEndLocation(e,s),Vr(e)}},ms=class{constructor(t,e){this.token=void 0,this.preserveSpace=void 0,this.token=t,this.preserveSpace=!!e}},K={brace:new ms("{"),j_oTag:new ms("<tag"),j_cTag:new ms("</tag"),j_expr:new ms("<tag>...</tag>",!0)};K.template=new ms("`",!0);var $=!0,I=!0,ec=!0,Yr=!0,zt=!0,O_=!0,wi=class{constructor(t,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=t,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}},Ac=new Map;function Y(r,t={}){t.keyword=r;let e=R(r,t);return Ac.set(r,e),e}function ke(r,t){return R(r,{beforeExpr:$,binop:t})}var Kr=-1,kt=[],Cc=[],wc=[],Ic=[],Nc=[],kc=[];function R(r,t={}){var e,s,n,i;return++Kr,Cc.push(r),wc.push((e=t.binop)!=null?e:-1),Ic.push((s=t.beforeExpr)!=null?s:!1),Nc.push((n=t.startsExpr)!=null?n:!1),kc.push((i=t.prefix)!=null?i:!1),kt.push(new wi(r,t)),Kr}function G(r,t={}){var e,s,n,i;return++Kr,Ac.set(r,Kr),Cc.push(r),wc.push((e=t.binop)!=null?e:-1),Ic.push((s=t.beforeExpr)!=null?s:!1),Nc.push((n=t.startsExpr)!=null?n:!1),kc.push((i=t.prefix)!=null?i:!1),kt.push(new wi("name",t)),Kr}var M_={bracketL:R("[",{beforeExpr:$,startsExpr:I}),bracketHashL:R("#[",{beforeExpr:$,startsExpr:I}),bracketBarL:R("[|",{beforeExpr:$,startsExpr:I}),bracketR:R("]"),bracketBarR:R("|]"),braceL:R("{",{beforeExpr:$,startsExpr:I}),braceBarL:R("{|",{beforeExpr:$,startsExpr:I}),braceHashL:R("#{",{beforeExpr:$,startsExpr:I}),braceR:R("}"),braceBarR:R("|}"),parenL:R("(",{beforeExpr:$,startsExpr:I}),parenR:R(")"),comma:R(",",{beforeExpr:$}),semi:R(";",{beforeExpr:$}),colon:R(":",{beforeExpr:$}),doubleColon:R("::",{beforeExpr:$}),dot:R("."),question:R("?",{beforeExpr:$}),questionDot:R("?."),arrow:R("=>",{beforeExpr:$}),template:R("template"),ellipsis:R("...",{beforeExpr:$}),backQuote:R("`",{startsExpr:I}),dollarBraceL:R("${",{beforeExpr:$,startsExpr:I}),templateTail:R("...`",{startsExpr:I}),templateNonTail:R("...${",{beforeExpr:$,startsExpr:I}),at:R("@"),hash:R("#",{startsExpr:I}),interpreterDirective:R("#!..."),eq:R("=",{beforeExpr:$,isAssign:Yr}),assign:R("_=",{beforeExpr:$,isAssign:Yr}),slashAssign:R("_=",{beforeExpr:$,isAssign:Yr}),xorAssign:R("_=",{beforeExpr:$,isAssign:Yr}),moduloAssign:R("_=",{beforeExpr:$,isAssign:Yr}),incDec:R("++/--",{prefix:zt,postfix:O_,startsExpr:I}),bang:R("!",{beforeExpr:$,prefix:zt,startsExpr:I}),tilde:R("~",{beforeExpr:$,prefix:zt,startsExpr:I}),doubleCaret:R("^^",{startsExpr:I}),doubleAt:R("@@",{startsExpr:I}),pipeline:ke("|>",0),nullishCoalescing:ke("??",1),logicalOR:ke("||",1),logicalAND:ke("&&",2),bitwiseOR:ke("|",3),bitwiseXOR:ke("^",4),bitwiseAND:ke("&",5),equality:ke("==/!=/===/!==",6),lt:ke("</>/<=/>=",7),gt:ke("</>/<=/>=",7),relational:ke("</>/<=/>=",7),bitShift:ke("<</>>/>>>",8),bitShiftL:ke("<</>>/>>>",8),bitShiftR:ke("<</>>/>>>",8),plusMin:R("+/-",{beforeExpr:$,binop:9,prefix:zt,startsExpr:I}),modulo:R("%",{binop:10,startsExpr:I}),star:R("*",{binop:10}),slash:ke("/",10),exponent:R("**",{beforeExpr:$,binop:11,rightAssociative:!0}),_in:Y("in",{beforeExpr:$,binop:7}),_instanceof:Y("instanceof",{beforeExpr:$,binop:7}),_break:Y("break"),_case:Y("case",{beforeExpr:$}),_catch:Y("catch"),_continue:Y("continue"),_debugger:Y("debugger"),_default:Y("default",{beforeExpr:$}),_else:Y("else",{beforeExpr:$}),_finally:Y("finally"),_function:Y("function",{startsExpr:I}),_if:Y("if"),_return:Y("return",{beforeExpr:$}),_switch:Y("switch"),_throw:Y("throw",{beforeExpr:$,prefix:zt,startsExpr:I}),_try:Y("try"),_var:Y("var"),_const:Y("const"),_with:Y("with"),_new:Y("new",{beforeExpr:$,startsExpr:I}),_this:Y("this",{startsExpr:I}),_super:Y("super",{startsExpr:I}),_class:Y("class",{startsExpr:I}),_extends:Y("extends",{beforeExpr:$}),_export:Y("export"),_import:Y("import",{startsExpr:I}),_null:Y("null",{startsExpr:I}),_true:Y("true",{startsExpr:I}),_false:Y("false",{startsExpr:I}),_typeof:Y("typeof",{beforeExpr:$,prefix:zt,startsExpr:I}),_void:Y("void",{beforeExpr:$,prefix:zt,startsExpr:I}),_delete:Y("delete",{beforeExpr:$,prefix:zt,startsExpr:I}),_do:Y("do",{isLoop:ec,beforeExpr:$}),_for:Y("for",{isLoop:ec}),_while:Y("while",{isLoop:ec}),_as:G("as",{startsExpr:I}),_assert:G("assert",{startsExpr:I}),_async:G("async",{startsExpr:I}),_await:G("await",{startsExpr:I}),_defer:G("defer",{startsExpr:I}),_from:G("from",{startsExpr:I}),_get:G("get",{startsExpr:I}),_let:G("let",{startsExpr:I}),_meta:G("meta",{startsExpr:I}),_of:G("of",{startsExpr:I}),_sent:G("sent",{startsExpr:I}),_set:G("set",{startsExpr:I}),_source:G("source",{startsExpr:I}),_static:G("static",{startsExpr:I}),_using:G("using",{startsExpr:I}),_yield:G("yield",{startsExpr:I}),_asserts:G("asserts",{startsExpr:I}),_checks:G("checks",{startsExpr:I}),_exports:G("exports",{startsExpr:I}),_global:G("global",{startsExpr:I}),_implements:G("implements",{startsExpr:I}),_intrinsic:G("intrinsic",{startsExpr:I}),_infer:G("infer",{startsExpr:I}),_is:G("is",{startsExpr:I}),_mixins:G("mixins",{startsExpr:I}),_proto:G("proto",{startsExpr:I}),_require:G("require",{startsExpr:I}),_satisfies:G("satisfies",{startsExpr:I}),_keyof:G("keyof",{startsExpr:I}),_readonly:G("readonly",{startsExpr:I}),_unique:G("unique",{startsExpr:I}),_abstract:G("abstract",{startsExpr:I}),_declare:G("declare",{startsExpr:I}),_enum:G("enum",{startsExpr:I}),_module:G("module",{startsExpr:I}),_namespace:G("namespace",{startsExpr:I}),_interface:G("interface",{startsExpr:I}),_type:G("type",{startsExpr:I}),_opaque:G("opaque",{startsExpr:I}),name:R("name",{startsExpr:I}),string:R("string",{startsExpr:I}),num:R("num",{startsExpr:I}),bigint:R("bigint",{startsExpr:I}),decimal:R("decimal",{startsExpr:I}),regexp:R("regexp",{startsExpr:I}),privateName:R("#name",{startsExpr:I}),eof:R("eof"),jsxName:R("jsxName"),jsxText:R("jsxText",{beforeExpr:!0}),jsxTagStart:R("jsxTagStart",{startsExpr:!0}),jsxTagEnd:R("jsxTagEnd"),placeholder:R("%%",{startsExpr:!0})};function z(r){return r>=93&&r<=132}function L_(r){return r<=92}function it(r){return r>=58&&r<=132}function Ud(r){return r>=58&&r<=136}function R_(r){return Ic[r]}function ac(r){return Nc[r]}function F_(r){return r>=29&&r<=33}function Id(r){return r>=129&&r<=131}function B_(r){return r>=90&&r<=92}function Dc(r){return r>=58&&r<=92}function j_(r){return r>=39&&r<=59}function U_(r){return r===34}function q_(r){return kc[r]}function G_(r){return r>=121&&r<=123}function $_(r){return r>=124&&r<=130}function Kt(r){return Cc[r]}function Ai(r){return wc[r]}function H_(r){return r===57}function Ii(r){return r>=24&&r<=25}function Nt(r){return kt[r]}kt[8].updateContext=r=>{r.pop()},kt[5].updateContext=kt[7].updateContext=kt[23].updateContext=r=>{r.push(K.brace)},kt[22].updateContext=r=>{r[r.length-1]===K.template?r.pop():r.push(K.template)},kt[142].updateContext=r=>{r.push(K.j_expr,K.j_oTag)};var Oc="\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-\u1C8A\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-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\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",qd="\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\u0897-\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",V_=new RegExp("["+Oc+"]"),Y_=new RegExp("["+Oc+qd+"]");Oc=qd=null;var Gd=[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,4,51,13,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,39,27,10,22,251,41,7,1,17,2,60,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,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,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,200,32,32,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,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,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,229,29,3,0,496,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],W_=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,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,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,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,343,9,54,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,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,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,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239];function oc(r,t){let e=65536;for(let s=0,n=t.length;s<n;s+=2){if(e+=t[s],e>r)return!1;if(e+=t[s+1],e>=r)return!0}return!1}function Dt(r){return r<65?r===36:r<=90?!0:r<97?r===95:r<=122?!0:r<=65535?r>=170&&V_.test(String.fromCharCode(r)):oc(r,Gd)}function zs(r){return r<48?r===36:r<58?!0:r<65?!1:r<=90?!0:r<97?r===95:r<=122?!0:r<=65535?r>=170&&Y_.test(String.fromCharCode(r)):oc(r,Gd)||oc(r,W_)}var Mc={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"]},z_=new Set(Mc.keyword),J_=new Set(Mc.strict),K_=new Set(Mc.strictBind);function $d(r,t){return t&&r==="await"||r==="enum"}function Hd(r,t){return $d(r,t)||J_.has(r)}function Vd(r){return K_.has(r)}function Yd(r,t){return Hd(r,t)||Vd(r)}function X_(r){return z_.has(r)}function Q_(r,t,e){return r===64&&t===64&&Dt(e)}var Z_=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 ex(r){return Z_.has(r)}var Xr=class{constructor(t){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=t}},Qr=class{constructor(t,e){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=t,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 t=this.currentThisScopeFlags();return(t&64)>0&&(t&2)===0}get inStaticBlock(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];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(t){return new Xr(t)}enter(t){this.scopeStack.push(this.createScope(t))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(t){return!!(t.flags&130||!this.parser.inModule&&t.flags&1)}declareName(t,e,s){let n=this.currentScope();if(e&8||e&16){this.checkRedeclarationInScope(n,t,e,s);let i=n.names.get(t)||0;e&16?i=i|4:(n.firstLexicalName||(n.firstLexicalName=t),i=i|2),n.names.set(t,i),e&8&&this.maybeExportDefined(n,t)}else if(e&4)for(let i=this.scopeStack.length-1;i>=0&&(n=this.scopeStack[i],this.checkRedeclarationInScope(n,t,e,s),n.names.set(t,(n.names.get(t)||0)|1),this.maybeExportDefined(n,t),!(n.flags&387));--i);this.parser.inModule&&n.flags&1&&this.undefinedExports.delete(t)}maybeExportDefined(t,e){this.parser.inModule&&t.flags&1&&this.undefinedExports.delete(e)}checkRedeclarationInScope(t,e,s,n){this.isRedeclaredInScope(t,e,s)&&this.parser.raise(g.VarRedeclaration,n,{identifierName:e})}isRedeclaredInScope(t,e,s){if(!(s&1))return!1;if(s&8)return t.names.has(e);let n=t.names.get(e);return s&16?(n&2)>0||!this.treatFunctionsAsVarInScope(t)&&(n&1)>0:(n&2)>0&&!(t.flags&8&&t.firstLexicalName===e)||!this.treatFunctionsAsVarInScope(t)&&(n&4)>0}checkLocalExport(t){let{name:e}=t;this.scopeStack[0].names.has(e)||this.undefinedExports.set(e,t.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&387)return e}}currentThisScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&451&&!(e&4))return e}}},cc=class extends Xr{constructor(...t){super(...t),this.declareFunctions=new Set}},lc=class extends Qr{createScope(t){return new cc(t)}declareName(t,e,s){let n=this.currentScope();if(e&2048){this.checkRedeclarationInScope(n,t,e,s),this.maybeExportDefined(n,t),n.declareFunctions.add(t);return}super.declareName(t,e,s)}isRedeclaredInScope(t,e,s){if(super.isRedeclaredInScope(t,e,s))return!0;if(s&2048&&!t.declareFunctions.has(e)){let n=t.names.get(e);return(n&4)>0||(n&2)>0}return!1}checkLocalExport(t){this.scopeStack[0].declareFunctions.has(t.name)||super.checkLocalExport(t)}},uc=class{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}hasPlugin(t){if(typeof t=="string")return this.plugins.has(t);{let[e,s]=t;if(!this.hasPlugin(e))return!1;let n=this.plugins.get(e);for(let i of Object.keys(s))if(n?.[i]!==s[i])return!1;return!0}}getPluginOption(t,e){var s;return(s=this.plugins.get(t))==null?void 0:s[e]}};function Wd(r,t){r.trailingComments===void 0?r.trailingComments=t:r.trailingComments.unshift(...t)}function tx(r,t){r.leadingComments===void 0?r.leadingComments=t:r.leadingComments.unshift(...t)}function Zr(r,t){r.innerComments===void 0?r.innerComments=t:r.innerComments.unshift(...t)}function Wr(r,t,e){let s=null,n=t.length;for(;s===null&&n>0;)s=t[--n];s===null||s.start>e.start?Zr(r,e.comments):Wd(s,e.comments)}var pc=class extends uc{addComment(t){this.filename&&(t.loc.filename=this.filename);let{commentsLen:e}=this.state;this.comments.length!==e&&(this.comments.length=e),this.comments.push(t),this.state.commentsLen++}processComment(t){let{commentStack:e}=this.state,s=e.length;if(s===0)return;let n=s-1,i=e[n];i.start===t.end&&(i.leadingNode=t,n--);let{start:a}=t;for(;n>=0;n--){let o=e[n],c=o.end;if(c>a)o.containingNode=t,this.finalizeComment(o),e.splice(n,1);else{c===a&&(o.trailingNode=t);break}}}finalizeComment(t){let{comments:e}=t;if(t.leadingNode!==null||t.trailingNode!==null)t.leadingNode!==null&&Wd(t.leadingNode,e),t.trailingNode!==null&&tx(t.trailingNode,e);else{let{containingNode:s,start:n}=t;if(this.input.charCodeAt(n-1)===44)switch(s.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":Wr(s,s.properties,t);break;case"CallExpression":case"OptionalCallExpression":Wr(s,s.arguments,t);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":Wr(s,s.params,t);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":Wr(s,s.elements,t);break;case"ExportNamedDeclaration":case"ImportDeclaration":Wr(s,s.specifiers,t);break;default:Zr(s,e)}else Zr(s,e)}}finalizeRemainingComments(){let{commentStack:t}=this.state;for(let e=t.length-1;e>=0;e--)this.finalizeComment(t[e]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(t){let{commentStack:e}=this.state,{length:s}=e;if(s===0)return;let n=e[s-1];n.leadingNode===t&&(n.leadingNode=null)}resetPreviousIdentifierLeadingComments(t){let{commentStack:e}=this.state,{length:s}=e;s!==0&&(e[s-1].trailingNode===t?e[s-1].trailingNode=null:s>=2&&e[s-2].trailingNode===t&&(e[s-2].trailingNode=null))}takeSurroundingComments(t,e,s){let{commentStack:n}=this.state,i=n.length;if(i===0)return;let a=i-1;for(;a>=0;a--){let o=n[a],c=o.end;if(o.start===s)o.leadingNode=t;else if(c===e)o.trailingNode=t;else if(c<e)break}}},sx=/\r\n|[\r\n\u2028\u2029]/,Ti=new RegExp(sx.source,"g");function Js(r){switch(r){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function Nd(r,t,e){for(let s=t;s<e;s++)if(Js(r.charCodeAt(s)))return!0;return!1}var tc=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,sc=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function rx(r){switch(r){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 hc=class r{constructor(){this.flags=1024,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.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null},this.labels=[],this.commentsLen=0,this.commentStack=[],this.pos=0,this.type=139,this.value=null,this.start=0,this.end=0,this.lastTokEndLoc=null,this.lastTokStartLoc=null,this.context=[K.brace],this.firstInvalidTemplateEscapePos=null,this.strictErrors=new Map,this.tokensLength=0}get strict(){return(this.flags&1)>0}set strict(t){t?this.flags|=1:this.flags&=-2}init({strictMode:t,sourceType:e,startLine:s,startColumn:n}){this.strict=t===!1?!1:t===!0?!0:e==="module",this.curLine=s,this.lineStart=-n,this.startLoc=this.endLoc=new mt(s,n,0)}get maybeInArrowParameters(){return(this.flags&2)>0}set maybeInArrowParameters(t){t?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(t){t?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(t){t?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(t){t?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(t){t?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(t){t?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(t){t?this.flags|=128:this.flags&=-129}get soloAwait(){return(this.flags&256)>0}set soloAwait(t){t?this.flags|=256:this.flags&=-257}get inFSharpPipelineDirectBody(){return(this.flags&512)>0}set inFSharpPipelineDirectBody(t){t?this.flags|=512:this.flags&=-513}get canStartJSXElement(){return(this.flags&1024)>0}set canStartJSXElement(t){t?this.flags|=1024:this.flags&=-1025}get containsEsc(){return(this.flags&2048)>0}set containsEsc(t){t?this.flags|=2048:this.flags&=-2049}get hasTopLevelAwait(){return(this.flags&4096)>0}set hasTopLevelAwait(t){t?this.flags|=4096:this.flags&=-4097}curPosition(){return new mt(this.curLine,this.pos-this.lineStart,this.pos)}clone(){let t=new r;return t.flags=this.flags,t.curLine=this.curLine,t.lineStart=this.lineStart,t.startLoc=this.startLoc,t.endLoc=this.endLoc,t.errors=this.errors.slice(),t.potentialArrowAt=this.potentialArrowAt,t.noArrowAt=this.noArrowAt.slice(),t.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),t.topicContext=this.topicContext,t.labels=this.labels.slice(),t.commentsLen=this.commentsLen,t.commentStack=this.commentStack.slice(),t.pos=this.pos,t.type=this.type,t.value=this.value,t.start=this.start,t.end=this.end,t.lastTokEndLoc=this.lastTokEndLoc,t.lastTokStartLoc=this.lastTokStartLoc,t.context=this.context.slice(),t.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,t.strictErrors=this.strictErrors,t.tokensLength=this.tokensLength,t}},nx=function(t){return t>=48&&t<=57},kd={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},Pi={bin:r=>r===48||r===49,oct:r=>r>=48&&r<=55,dec:r=>r>=48&&r<=57,hex:r=>r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102};function Dd(r,t,e,s,n,i){let a=e,o=s,c=n,l="",u=null,p=e,{length:h}=t;for(;;){if(e>=h){i.unterminated(a,o,c),l+=t.slice(p,e);break}let d=t.charCodeAt(e);if(ix(r,d,t,e)){l+=t.slice(p,e);break}if(d===92){l+=t.slice(p,e);let f=ax(t,e,s,n,r==="template",i);f.ch===null&&!u?u={pos:e,lineStart:s,curLine:n}:l+=f.ch,{pos:e,lineStart:s,curLine:n}=f,p=e}else d===8232||d===8233?(++e,++n,s=e):d===10||d===13?r==="template"?(l+=t.slice(p,e)+`
|
|
4
|
+
`,++e,d===13&&t.charCodeAt(e)===10&&++e,++n,p=s=e):i.unterminated(a,o,c):++e}return{pos:e,str:l,firstInvalidLoc:u,lineStart:s,curLine:n,containsInvalid:!!u}}function ix(r,t,e,s){return r==="template"?t===96||t===36&&e.charCodeAt(s+1)===123:t===(r==="double"?34:39)}function ax(r,t,e,s,n,i){let a=!n;t++;let o=l=>({pos:t,ch:l,lineStart:e,curLine:s}),c=r.charCodeAt(t++);switch(c){case 110:return o(`
|
|
5
|
+
`);case 114:return o("\r");case 120:{let l;return{code:l,pos:t}=dc(r,t,e,s,2,!1,a,i),o(l===null?null:String.fromCharCode(l))}case 117:{let l;return{code:l,pos:t}=Jd(r,t,e,s,a,i),o(l===null?null:String.fromCodePoint(l))}case 116:return o(" ");case 98:return o("\b");case 118:return o("\v");case 102:return o("\f");case 13:r.charCodeAt(t)===10&&++t;case 10:e=t,++s;case 8232:case 8233:return o("");case 56:case 57:if(n)return o(null);i.strictNumericEscape(t-1,e,s);default:if(c>=48&&c<=55){let l=t-1,p=/^[0-7]+/.exec(r.slice(l,t+2))[0],h=parseInt(p,8);h>255&&(p=p.slice(0,-1),h=parseInt(p,8)),t+=p.length-1;let d=r.charCodeAt(t);if(p!=="0"||d===56||d===57){if(n)return o(null);i.strictNumericEscape(l,e,s)}return o(String.fromCharCode(h))}return o(String.fromCharCode(c))}}function dc(r,t,e,s,n,i,a,o){let c=t,l;return{n:l,pos:t}=zd(r,t,e,s,16,n,i,!1,o,!a),l===null&&(a?o.invalidEscapeSequence(c,e,s):t=c-1),{code:l,pos:t}}function zd(r,t,e,s,n,i,a,o,c,l){let u=t,p=n===16?kd.hex:kd.decBinOct,h=n===16?Pi.hex:n===10?Pi.dec:n===8?Pi.oct:Pi.bin,d=!1,f=0;for(let m=0,y=i??1/0;m<y;++m){let b=r.charCodeAt(t),x;if(b===95&&o!=="bail"){let N=r.charCodeAt(t-1),T=r.charCodeAt(t+1);if(o){if(Number.isNaN(T)||!h(T)||p.has(N)||p.has(T)){if(l)return{n:null,pos:t};c.unexpectedNumericSeparator(t,e,s)}}else{if(l)return{n:null,pos:t};c.numericSeparatorInEscapeSequence(t,e,s)}++t;continue}if(b>=97?x=b-97+10:b>=65?x=b-65+10:nx(b)?x=b-48:x=1/0,x>=n){if(x<=9&&l)return{n:null,pos:t};if(x<=9&&c.invalidDigit(t,e,s,n))x=0;else if(a)x=0,d=!0;else break}++t,f=f*n+x}return t===u||i!=null&&t-u!==i||d?{n:null,pos:t}:{n:f,pos:t}}function Jd(r,t,e,s,n,i){let a=r.charCodeAt(t),o;if(a===123){if(++t,{code:o,pos:t}=dc(r,t,e,s,r.indexOf("}",t)-t,!0,n,i),++t,o!==null&&o>1114111)if(n)i.invalidCodePoint(t,e,s);else return{code:null,pos:t}}else({code:o,pos:t}=dc(r,t,e,s,4,!1,n,i));return{code:o,pos:t}}function zr(r,t,e){return new mt(e,r-t,r)}var ox=new Set([103,109,115,105,121,117,100,118]),ft=class{constructor(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,this.loc=new Xs(t.startLoc,t.endLoc)}},fc=class extends pc{constructor(t,e){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(s,n,i,a)=>this.options.errorRecovery?(this.raise(g.InvalidDigit,zr(s,n,i),{radix:a}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(g.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(g.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(g.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(g.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(s,n,i)=>{this.recordStrictModeErrors(g.StrictNumericEscape,zr(s,n,i))},unterminated:(s,n,i)=>{throw this.raise(g.UnterminatedString,zr(s-1,n,i))}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(g.StrictNumericEscape),unterminated:(s,n,i)=>{throw this.raise(g.UnterminatedTemplate,zr(s,n,i))}}),this.state=new hc,this.state.init(t),this.input=e,this.length=e.length,this.comments=[],this.isLookahead=!1}pushToken(t){this.tokens.length=this.state.tokensLength,this.tokens.push(t),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.options.tokens&&this.pushToken(new ft(this.state)),this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(t){return this.match(t)?(this.next(),!0):!1}match(t){return this.state.type===t}createLookaheadState(t){return{pos:t.pos,value:null,type:t.type,start:t.start,end:t.end,context:[this.curContext()],inType:t.inType,startLoc:t.startLoc,lastTokEndLoc:t.lastTokEndLoc,curLine:t.curLine,lineStart:t.lineStart,curPosition:t.curPosition}}lookahead(){let t=this.state;this.state=this.createLookaheadState(t),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let e=this.state;return this.state=t,e}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(t){return tc.lastIndex=t,tc.test(this.input)?tc.lastIndex:t}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(t){return sc.lastIndex=t,sc.test(this.input)?sc.lastIndex:t}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(t){let e=this.input.charCodeAt(t);if((e&64512)===55296&&++t<this.input.length){let s=this.input.charCodeAt(t);(s&64512)===56320&&(e=65536+((e&1023)<<10)+(s&1023))}return e}setStrict(t){this.state.strict=t,t&&(this.state.strictErrors.forEach(([e,s])=>this.raise(e,s)),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(t){let e;this.isLookahead||(e=this.state.curPosition());let s=this.state.pos,n=this.input.indexOf(t,s+2);if(n===-1)throw this.raise(g.UnterminatedComment,this.state.curPosition());for(this.state.pos=n+t.length,Ti.lastIndex=s+2;Ti.test(this.input)&&Ti.lastIndex<=n;)++this.state.curLine,this.state.lineStart=Ti.lastIndex;if(this.isLookahead)return;let i={type:"CommentBlock",value:this.input.slice(s+2,n),start:s,end:n+t.length,loc:new Xs(e,this.state.curPosition())};return this.options.tokens&&this.pushToken(i),i}skipLineComment(t){let e=this.state.pos,s;this.isLookahead||(s=this.state.curPosition());let n=this.input.charCodeAt(this.state.pos+=t);if(this.state.pos<this.length)for(;!Js(n)&&++this.state.pos<this.length;)n=this.input.charCodeAt(this.state.pos);if(this.isLookahead)return;let i=this.state.pos,o={type:"CommentLine",value:this.input.slice(e+t,i),start:e,end:i,loc:new Xs(s,this.state.curPosition())};return this.options.tokens&&this.pushToken(o),o}skipSpace(){let t=this.state.pos,e=[];e:for(;this.state.pos<this.length;){let s=this.input.charCodeAt(this.state.pos);switch(s){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 n=this.skipBlockComment("*/");n!==void 0&&(this.addComment(n),this.options.attachComment&&e.push(n));break}case 47:{let n=this.skipLineComment(2);n!==void 0&&(this.addComment(n),this.options.attachComment&&e.push(n));break}default:break e}break;default:if(rx(s))++this.state.pos;else if(s===45&&!this.inModule&&this.options.annexB){let n=this.state.pos;if(this.input.charCodeAt(n+1)===45&&this.input.charCodeAt(n+2)===62&&(t===0||this.state.lineStart>t)){let i=this.skipLineComment(3);i!==void 0&&(this.addComment(i),this.options.attachComment&&e.push(i))}else break e}else if(s===60&&!this.inModule&&this.options.annexB){let n=this.state.pos;if(this.input.charCodeAt(n+1)===33&&this.input.charCodeAt(n+2)===45&&this.input.charCodeAt(n+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 s=this.state.pos,n={start:t,end:s,comments:e,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(n)}}finishToken(t,e){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let s=this.state.type;this.state.type=t,this.state.value=e,this.isLookahead||this.updateContext(s)}replaceToken(t){this.state.type=t,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let t=this.state.pos+1,e=this.codePointAtPos(t);if(e>=48&&e<=57)throw this.raise(g.UnexpectedDigitAfterHash,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?g.RecordExpressionHashIncorrectStartSyntaxType:g.TupleExpressionHashIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,e===123?this.finishToken(7):this.finishToken(1)}else Dt(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 t=this.input.charCodeAt(this.state.pos+1);if(t>=48&&t<=57){this.readNumber(!0);return}t===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 t=this.input.charCodeAt(this.state.pos+1);if(t!==33)return!1;let e=this.state.pos;for(this.state.pos+=1;!Js(t)&&++this.state.pos<this.length;)t=this.input.charCodeAt(this.state.pos);let s=this.input.slice(e+2,this.state.pos);return this.finishToken(28,s),!0}readToken_mult_modulo(t){let e=t===42?55:54,s=1,n=this.input.charCodeAt(this.state.pos+1);t===42&&n===42&&(s++,n=this.input.charCodeAt(this.state.pos+2),e=57),n===61&&!this.state.inType&&(s++,e=t===37?33:30),this.finishOp(e,s)}readToken_pipe_amp(t){let e=this.input.charCodeAt(this.state.pos+1);if(e===t){this.input.charCodeAt(this.state.pos+2)===61?this.finishOp(30,3):this.finishOp(t===124?41:42,2);return}if(t===124){if(e===62){this.finishOp(39,2);return}if(this.hasPlugin("recordAndTuple")&&e===125){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(g.RecordExpressionBarIncorrectEndSyntaxType,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(g.TupleExpressionBarIncorrectEndSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(4);return}}if(e===61){this.finishOp(30,2);return}this.finishOp(t===124?43:45,1)}readToken_caret(){let t=this.input.charCodeAt(this.state.pos+1);t===61&&!this.state.inType?this.finishOp(32,2):t===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(t){let e=this.input.charCodeAt(this.state.pos+1);if(e===t){this.finishOp(34,2);return}e===61?this.finishOp(30,2):this.finishOp(53,1)}readToken_lt(){let{pos:t}=this.state,e=this.input.charCodeAt(t+1);if(e===60){if(this.input.charCodeAt(t+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:t}=this.state,e=this.input.charCodeAt(t+1);if(e===62){let s=this.input.charCodeAt(t+2)===62?3:2;if(this.input.charCodeAt(t+s)===61){this.finishOp(30,s+1);return}this.finishOp(52,s);return}if(e===61){this.finishOp(49,2);return}this.finishOp(48,1)}readToken_eq_excl(t){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(t===61&&e===62){this.state.pos+=2,this.finishToken(19);return}this.finishOp(t===61?29:35,1)}readToken_question(){let t=this.input.charCodeAt(this.state.pos+1),e=this.input.charCodeAt(this.state.pos+2);t===63?e===61?this.finishOp(30,3):this.finishOp(40,2):t===46&&!(e>=48&&e<=57)?(this.state.pos+=2,this.finishToken(18)):(++this.state.pos,this.finishToken(17))}getTokenFromCode(t){switch(t){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(g.TupleExpressionBarIncorrectStartSyntaxType,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(g.RecordExpressionBarIncorrectStartSyntaxType,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(t);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(t);return;case 124:case 38:this.readToken_pipe_amp(t);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(t);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(t);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(Dt(t)){this.readWord(t);return}}throw this.raise(g.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(t)})}finishOp(t,e){let s=this.input.slice(this.state.pos,this.state.pos+e);this.state.pos+=e,this.finishToken(t,s)}readRegexp(){let t=this.state.startLoc,e=this.state.start+1,s,n,{pos:i}=this.state;for(;;++i){if(i>=this.length)throw this.raise(g.UnterminatedRegExp,De(t,1));let l=this.input.charCodeAt(i);if(Js(l))throw this.raise(g.UnterminatedRegExp,De(t,1));if(s)s=!1;else{if(l===91)n=!0;else if(l===93&&n)n=!1;else if(l===47&&!n)break;s=l===92}}let a=this.input.slice(e,i);++i;let o="",c=()=>De(t,i+2-e);for(;i<this.length;){let l=this.codePointAtPos(i),u=String.fromCharCode(l);if(ox.has(l))l===118?o.includes("u")&&this.raise(g.IncompatibleRegExpUVFlags,c()):l===117&&o.includes("v")&&this.raise(g.IncompatibleRegExpUVFlags,c()),o.includes(u)&&this.raise(g.DuplicateRegExpFlags,c());else if(zs(l)||l===92)this.raise(g.MalformedRegExpFlags,c());else break;++i,o+=u}this.state.pos=i,this.finishToken(137,{pattern:a,flags:o})}readInt(t,e,s=!1,n=!0){let{n:i,pos:a}=zd(this.input,this.state.pos,this.state.lineStart,this.state.curLine,t,e,s,n,this.errorHandlers_readInt,!1);return this.state.pos=a,i}readRadixNumber(t){let e=this.state.curPosition(),s=!1;this.state.pos+=2;let n=this.readInt(t);n==null&&this.raise(g.InvalidDigit,De(e,2),{radix:t});let i=this.input.charCodeAt(this.state.pos);if(i===110)++this.state.pos,s=!0;else if(i===109)throw this.raise(g.InvalidDecimal,e);if(Dt(this.codePointAtPos(this.state.pos)))throw this.raise(g.NumberIdentifier,this.state.curPosition());if(s){let a=this.input.slice(e.index,this.state.pos).replace(/[_n]/g,"");this.finishToken(135,a);return}this.finishToken(134,n)}readNumber(t){let e=this.state.pos,s=this.state.curPosition(),n=!1,i=!1,a=!1,o=!1;!t&&this.readInt(10)===null&&this.raise(g.InvalidNumber,this.state.curPosition());let c=this.state.pos-e>=2&&this.input.charCodeAt(e)===48;if(c){let d=this.input.slice(e,this.state.pos);if(this.recordStrictModeErrors(g.StrictOctalLiteral,s),!this.state.strict){let f=d.indexOf("_");f>0&&this.raise(g.ZeroDigitNumericSeparator,De(s,f))}o=c&&!/[89]/.test(d)}let l=this.input.charCodeAt(this.state.pos);if(l===46&&!o&&(++this.state.pos,this.readInt(10),n=!0,l=this.input.charCodeAt(this.state.pos)),(l===69||l===101)&&!o&&(l=this.input.charCodeAt(++this.state.pos),(l===43||l===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(g.InvalidOrMissingExponent,s),n=!0,a=!0,l=this.input.charCodeAt(this.state.pos)),l===110&&((n||c)&&this.raise(g.InvalidBigIntLiteral,s),++this.state.pos,i=!0),l===109){this.expectPlugin("decimal",this.state.curPosition()),(a||c)&&this.raise(g.InvalidDecimal,s),++this.state.pos;var u=!0}if(Dt(this.codePointAtPos(this.state.pos)))throw this.raise(g.NumberIdentifier,this.state.curPosition());let p=this.input.slice(e,this.state.pos).replace(/[_mn]/g,"");if(i){this.finishToken(135,p);return}if(u){this.finishToken(136,p);return}let h=o?parseInt(p,8):parseFloat(p);this.finishToken(134,h)}readCodePoint(t){let{code:e,pos:s}=Jd(this.input,this.state.pos,this.state.lineStart,this.state.curLine,t,this.errorHandlers_readCodePoint);return this.state.pos=s,e}readString(t){let{str:e,pos:s,curLine:n,lineStart:i}=Dd(t===34?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=s+1,this.state.lineStart=i,this.state.curLine=n,this.finishToken(133,e)}readTemplateContinuation(){this.match(8)||this.unexpected(null,8),this.state.pos--,this.readTemplateToken()}readTemplateToken(){let t=this.input[this.state.pos],{str:e,firstInvalidLoc:s,pos:n,curLine:i,lineStart:a}=Dd("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=n+1,this.state.lineStart=a,this.state.curLine=i,s&&(this.state.firstInvalidTemplateEscapePos=new mt(s.curLine,s.pos-s.lineStart,s.pos)),this.input.codePointAt(n)===96?this.finishToken(24,s?null:t+e+"`"):(this.state.pos++,this.finishToken(25,s?null:t+e+"${"))}recordStrictModeErrors(t,e){let s=e.index;this.state.strict&&!this.state.strictErrors.has(s)?this.raise(t,e):this.state.strictErrors.set(s,[t,e])}readWord1(t){this.state.containsEsc=!1;let e="",s=this.state.pos,n=this.state.pos;for(t!==void 0&&(this.state.pos+=t<=65535?1:2);this.state.pos<this.length;){let i=this.codePointAtPos(this.state.pos);if(zs(i))this.state.pos+=i<=65535?1:2;else if(i===92){this.state.containsEsc=!0,e+=this.input.slice(n,this.state.pos);let a=this.state.curPosition(),o=this.state.pos===s?Dt:zs;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(g.MissingUnicodeEscape,this.state.curPosition()),n=this.state.pos-1;continue}++this.state.pos;let c=this.readCodePoint(!0);c!==null&&(o(c)||this.raise(g.EscapedCharNotAnIdentifier,a),e+=String.fromCodePoint(c)),n=this.state.pos}else break}return e+this.input.slice(n,this.state.pos)}readWord(t){let e=this.readWord1(t),s=Ac.get(e);s!==void 0?this.finishToken(s,Kt(s)):this.finishToken(132,e)}checkKeywordEscapes(){let{type:t}=this.state;Dc(t)&&this.state.containsEsc&&this.raise(g.InvalidEscapedReservedWord,this.state.startLoc,{reservedWord:Kt(t)})}raise(t,e,s={}){let n=e instanceof mt?e:e.loc.start,i=t(n,s);if(!this.options.errorRecovery)throw i;return this.isLookahead||this.state.errors.push(i),i}raiseOverwrite(t,e,s={}){let n=e instanceof mt?e:e.loc.start,i=n.index,a=this.state.errors;for(let o=a.length-1;o>=0;o--){let c=a[o];if(c.loc.index===i)return a[o]=t(n,s);if(c.loc.index<i)break}return this.raise(t,e,s)}updateContext(t){}unexpected(t,e){throw this.raise(g.UnexpectedToken,t??this.state.startLoc,{expected:e?Kt(e):null})}expectPlugin(t,e){if(this.hasPlugin(t))return!0;throw this.raise(g.MissingPlugin,e??this.state.startLoc,{missingPlugin:[t]})}expectOnePlugin(t){if(!t.some(e=>this.hasPlugin(e)))throw this.raise(g.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:t})}errorBuilder(t){return(e,s,n)=>{this.raise(t,zr(e,s,n))}}},mc=class{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}},yc=class{constructor(t){this.parser=void 0,this.stack=[],this.undefinedPrivateNames=new Map,this.parser=t}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new mc)}exit(){let t=this.stack.pop(),e=this.current();for(let[s,n]of Array.from(t.undefinedPrivateNames))e?e.undefinedPrivateNames.has(s)||e.undefinedPrivateNames.set(s,n):this.parser.raise(g.InvalidPrivateFieldResolution,n,{identifierName:s})}declarePrivateName(t,e,s){let{privateNames:n,loneAccessors:i,undefinedPrivateNames:a}=this.current(),o=n.has(t);if(e&3){let c=o&&i.get(t);if(c){let l=c&4,u=e&4,p=c&3,h=e&3;o=p===h||l!==u,o||i.delete(t)}else o||i.set(t,e)}o&&this.parser.raise(g.PrivateNameRedeclaration,s,{identifierName:t}),n.add(t),a.delete(t)}usePrivateName(t,e){let s;for(s of this.stack)if(s.privateNames.has(t))return;s?s.undefinedPrivateNames.set(t,e):this.parser.raise(g.InvalidPrivateFieldResolution,e,{identifierName:t})}},Qs=class{constructor(t=0){this.type=t}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},Ni=class extends Qs{constructor(t){super(t),this.declarationErrors=new Map}recordDeclarationError(t,e){let s=e.index;this.declarationErrors.set(s,[t,e])}clearDeclarationError(t){this.declarationErrors.delete(t)}iterateErrors(t){this.declarationErrors.forEach(t)}},gc=class{constructor(t){this.parser=void 0,this.stack=[new Qs],this.parser=t}enter(t){this.stack.push(t)}exit(){this.stack.pop()}recordParameterInitializerError(t,e){let s=e.loc.start,{stack:n}=this,i=n.length-1,a=n[i];for(;!a.isCertainlyParameterDeclaration();){if(a.canBeArrowParameterDeclaration())a.recordDeclarationError(t,s);else return;a=n[--i]}this.parser.raise(t,s)}recordArrowParameterBindingError(t,e){let{stack:s}=this,n=s[s.length-1],i=e.loc.start;if(n.isCertainlyParameterDeclaration())this.parser.raise(t,i);else if(n.canBeArrowParameterDeclaration())n.recordDeclarationError(t,i);else return}recordAsyncArrowParametersError(t){let{stack:e}=this,s=e.length-1,n=e[s];for(;n.canBeArrowParameterDeclaration();)n.type===2&&n.recordDeclarationError(g.AwaitBindingIdentifier,t),n=e[--s]}validateAsPattern(){let{stack:t}=this,e=t[t.length-1];e.canBeArrowParameterDeclaration()&&e.iterateErrors(([s,n])=>{this.parser.raise(s,n);let i=t.length-2,a=t[i];for(;a.canBeArrowParameterDeclaration();)a.clearDeclarationError(n.index),a=t[--i]})}};function cx(){return new Qs(3)}function lx(){return new Ni(1)}function ux(){return new Ni(2)}function Kd(){return new Qs}var bc=class{constructor(){this.stacks=[]}enter(t){this.stacks.push(t)}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 Ci(r,t){return(r?2:0)|(t?1:0)}var Sc=class extends fc{addExtra(t,e,s,n=!0){if(!t)return;let{extra:i}=t;i==null&&(i={},t.extra=i),n?i[e]=s:Object.defineProperty(i,e,{enumerable:n,value:s})}isContextual(t){return this.state.type===t&&!this.state.containsEsc}isUnparsedContextual(t,e){let s=t+e.length;if(this.input.slice(t,s)===e){let n=this.input.charCodeAt(s);return!(zs(n)||(n&64512)===55296)}return!1}isLookaheadContextual(t){let e=this.nextTokenStart();return this.isUnparsedContextual(e,t)}eatContextual(t){return this.isContextual(t)?(this.next(),!0):!1}expectContextual(t,e){if(!this.eatContextual(t)){if(e!=null)throw this.raise(e,this.state.startLoc);this.unexpected(null,t)}}canInsertSemicolon(){return this.match(139)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return Nd(this.input,this.state.lastTokEndLoc.index,this.state.start)}hasFollowingLineBreak(){return Nd(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(t=!0){(t?this.isLineTerminator():this.eat(13))||this.raise(g.MissingSemicolon,this.state.lastTokEndLoc)}expect(t,e){this.eat(t)||this.unexpected(e,t)}tryParse(t,e=this.state.clone()){let s={node:null};try{let n=t((i=null)=>{throw s.node=i,s});if(this.state.errors.length>e.errors.length){let i=this.state;return this.state=e,this.state.tokensLength=i.tokensLength,{node:n,error:i.errors[e.errors.length],thrown:!1,aborted:!1,failState:i}}return{node:n,error:null,thrown:!1,aborted:!1,failState:null}}catch(n){let i=this.state;if(this.state=e,n instanceof SyntaxError)return{node:null,error:n,thrown:!0,aborted:!1,failState:i};if(n===s)return{node:s.node,error:null,thrown:!1,aborted:!0,failState:i};throw n}}checkExpressionErrors(t,e){if(!t)return!1;let{shorthandAssignLoc:s,doubleProtoLoc:n,privateKeyLoc:i,optionalParametersLoc:a}=t,o=!!s||!!n||!!a||!!i;if(!e)return o;s!=null&&this.raise(g.InvalidCoverInitializedName,s),n!=null&&this.raise(g.DuplicateProto,n),i!=null&&this.raise(g.UnexpectedPrivateField,i),a!=null&&this.unexpected(a)}isLiteralPropertyName(){return Ud(this.state.type)}isPrivateName(t){return t.type==="PrivateName"}getPrivateNameSV(t){return t.id.name}hasPropertyAsPrivateName(t){return(t.type==="MemberExpression"||t.type==="OptionalMemberExpression")&&this.isPrivateName(t.property)}isObjectProperty(t){return t.type==="ObjectProperty"}isObjectMethod(t){return t.type==="ObjectMethod"}initializeScopes(t=this.options.sourceType==="module"){let e=this.state.labels;this.state.labels=[];let s=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let n=this.inModule;this.inModule=t;let i=this.scope,a=this.getScopeHandler();this.scope=new a(this,t);let o=this.prodParam;this.prodParam=new bc;let c=this.classScope;this.classScope=new yc(this);let l=this.expressionScope;return this.expressionScope=new gc(this),()=>{this.state.labels=e,this.exportedIdentifiers=s,this.inModule=n,this.scope=i,this.prodParam=o,this.classScope=c,this.expressionScope=l}}enterInitialScopes(){let t=0;this.inModule&&(t|=2),this.scope.enter(1),this.prodParam.enter(t)}checkDestructuringPrivate(t){let{privateKeyLoc:e}=t;e!==null&&this.expectPlugin("destructuringPrivate",e)}},Ks=class{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null}},Zs=class{constructor(t,e,s){this.type="",this.start=e,this.end=0,this.loc=new Xs(s),t!=null&&t.options.ranges&&(this.range=[e,0]),t!=null&&t.filename&&(this.loc.filename=t.filename)}},Lc=Zs.prototype;Lc.__clone=function(){let r=new Zs(void 0,this.start,this.loc.start),t=Object.keys(this);for(let e=0,s=t.length;e<s;e++){let n=t[e];n!=="leadingComments"&&n!=="trailingComments"&&n!=="innerComments"&&(r[n]=this[n])}return r};function px(r){return Mt(r)}function Mt(r){let{type:t,start:e,end:s,loc:n,range:i,extra:a,name:o}=r,c=Object.create(Lc);return c.type=t,c.start=e,c.end=s,c.loc=n,c.range=i,c.extra=a,c.name=o,t==="Placeholder"&&(c.expectedNode=r.expectedNode),c}function hx(r){let{type:t,start:e,end:s,loc:n,range:i,extra:a}=r;if(t==="Placeholder")return px(r);let o=Object.create(Lc);return o.type=t,o.start=e,o.end=s,o.loc=n,o.range=i,r.raw!==void 0?o.raw=r.raw:o.extra=a,o.value=r.value,o}var _c=class extends Sc{startNode(){let t=this.state.startLoc;return new Zs(this,t.index,t)}startNodeAt(t){return new Zs(this,t.index,t)}startNodeAtNode(t){return this.startNodeAt(t.loc.start)}finishNode(t,e){return this.finishNodeAt(t,e,this.state.lastTokEndLoc)}finishNodeAt(t,e,s){return t.type=e,t.end=s.index,t.loc.end=s,this.options.ranges&&(t.range[1]=s.index),this.options.attachComment&&this.processComment(t),t}resetStartLocation(t,e){t.start=e.index,t.loc.start=e,this.options.ranges&&(t.range[0]=e.index)}resetEndLocation(t,e=this.state.lastTokEndLoc){t.end=e.index,t.loc.end=e,this.options.ranges&&(t.range[1]=e.index)}resetStartLocationFromNode(t,e){this.resetStartLocation(t,e.loc.start)}},dx=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),F=Ot`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:r})=>`Cannot overwrite reserved type ${r}.`,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:r,enumName:t})=>`Boolean enum members need to be initialized. Use either \`${r} = true,\` or \`${r} = false,\` in enum \`${t}\`.`,EnumDuplicateMemberName:({memberName:r,enumName:t})=>`Enum member names need to be unique, but the name \`${r}\` has already been used before in enum \`${t}\`.`,EnumInconsistentMemberValues:({enumName:r})=>`Enum \`${r}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:r,enumName:t})=>`Enum type \`${r}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:r})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${r}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:r,memberName:t,explicitType:e})=>`Enum \`${r}\` has type \`${e}\`, so the initializer of \`${t}\` needs to be a ${e} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:r,memberName:t})=>`Symbol enum members cannot be initialized. Use \`${t},\` in enum \`${r}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:r,memberName:t})=>`The enum member initializer for \`${t}\` needs to be a literal (either a boolean, number, or string) in enum \`${r}\`.`,EnumInvalidMemberName:({enumName:r,memberName:t,suggestion:e})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${t}\`, consider using \`${e}\`, in enum \`${r}\`.`,EnumNumberMemberNotInitialized:({enumName:r,memberName:t})=>`Number enum members need to be initialized, e.g. \`${t} = 1\` in enum \`${r}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:r})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${r}\`.`,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:r})=>`Unexpected reserved type ${r}.`,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:r,suggestion:t})=>`\`declare export ${r}\` is not supported. Use \`${t}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function fx(r){return r.type==="DeclareExportAllDeclaration"||r.type==="DeclareExportDeclaration"&&(!r.declaration||r.declaration.type!=="TypeAlias"&&r.declaration.type!=="InterfaceDeclaration")}function Od(r){return r.importKind==="type"||r.importKind==="typeof"}var mx={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function yx(r,t){let e=[],s=[];for(let n=0;n<r.length;n++)(t(r[n],n,r)?e:s).push(r[n]);return[e,s]}var gx=/\*?\s*@((?:no)?flow)\b/,bx=r=>class extends r{constructor(...e){super(...e),this.flowPragma=void 0}getScopeHandler(){return lc}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(e,s){e!==133&&e!==13&&e!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,s)}addComment(e){if(this.flowPragma===void 0){let s=gx.exec(e.value);if(s)if(s[1]==="flow")this.flowPragma="flow";else if(s[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(e)}flowParseTypeInitialiser(e){let s=this.state.inType;this.state.inType=!0,this.expect(e||14);let n=this.flowParseType();return this.state.inType=s,n}flowParsePredicate(){let e=this.startNode(),s=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>s.index+1&&this.raise(F.UnexpectedSpaceBetweenModuloChecks,s),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 s=null,n=null;return this.match(54)?(this.state.inType=e,n=this.flowParsePredicate()):(s=this.flowParseType(),this.state.inType=e,this.match(54)&&(n=this.flowParsePredicate())),[s,n]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")}flowParseDeclareFunction(e){this.next();let s=e.id=this.parseIdentifier(),n=this.startNode(),i=this.startNode();this.match(47)?n.typeParameters=this.flowParseTypeParameterDeclaration():n.typeParameters=null,this.expect(10);let a=this.flowParseFunctionTypeParams();return n.params=a.params,n.rest=a.rest,n.this=a._this,this.expect(11),[n.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),i.typeAnnotation=this.finishNode(n,"FunctionTypeAnnotation"),s.typeAnnotation=this.finishNode(i,"TypeAnnotation"),this.resetEndLocation(s),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.loc.start),this.finishNode(e,"DeclareFunction")}flowParseDeclare(e,s){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):(s&&this.raise(F.NestedDeclareModule,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,s);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 s=e.body=this.startNode(),n=s.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(F.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),super.parseImport(o)):(this.expectContextual(125,F.UnsupportedStatementInDeclareModule),o=this.flowParseDeclare(o,!0)),n.push(o)}this.scope.exit(),this.expect(8),this.finishNode(s,"BlockStatement");let i=null,a=!1;return n.forEach(o=>{fx(o)?(i==="CommonJS"&&this.raise(F.AmbiguousDeclareModuleKind,o),i="ES"):o.type==="DeclareModuleExports"&&(a&&this.raise(F.DuplicateDeclareModuleExports,o),i==="ES"&&this.raise(F.AmbiguousDeclareModuleKind,o),i="CommonJS",a=!0)}),e.kind=i||"CommonJS",this.finishNode(e,"DeclareModule")}flowParseDeclareExportDeclaration(e,s){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))&&!s){let n=this.state.value;throw this.raise(F.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:n,suggestion:mx[n]})}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 s=this.flowParseTypeAlias(e);return s.type="DeclareTypeAlias",s}flowParseDeclareOpaqueType(e){this.next();let s=this.flowParseOpaqueType(e,!0);return s.type="DeclareOpaqueType",s}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,"DeclareInterface")}flowParseInterfaceish(e,s){if(e.id=this.flowParseRestrictedIdentifier(!s,!0),this.scope.declareName(e.id.name,s?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(!s&&this.eat(12));if(s){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:s,allowExact:!1,allowSpread:!1,allowProto:s,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(F.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,s,n){dx.has(e)&&this.raise(n?F.AssignReservedType:F.UnexpectedReservedType,s,{reservedType:e})}flowParseRestrictedIdentifier(e,s){return this.checkReservedType(this.state.value,this.state.startLoc,s),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,s){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,s||(e.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(e,"OpaqueType")}flowParseTypeParameter(e=!1){let s=this.state.startLoc,n=this.startNode(),i=this.flowParseVariance(),a=this.flowParseTypeAnnotatableIdentifier();return n.name=a.name,n.variance=i,n.bound=a.typeAnnotation,this.match(29)?(this.eat(29),n.default=this.flowParseType()):e&&this.raise(F.MissingTypeParamDefault,s),this.finishNode(n,"TypeParameter")}flowParseTypeParameterDeclaration(){let e=this.state.inType,s=this.startNode();s.params=[],this.state.inType=!0,this.match(47)||this.match(142)?this.next():this.unexpected();let n=!1;do{let i=this.flowParseTypeParameter(n);s.params.push(i),i.default&&(n=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=e,this.finishNode(s,"TypeParameterDeclaration")}flowParseTypeParameterInstantiation(){let e=this.startNode(),s=this.state.inType;e.params=[],this.state.inType=!0,this.expect(47);let n=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=n,this.expect(48),this.state.inType=s,this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){let e=this.startNode(),s=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=s,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,s,n){return e.static=s,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=n,this.finishNode(e,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(e,s){return e.static=s,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,s){let n=this.startNode();return e.static=s,e.value=this.flowParseObjectTypeMethodish(n),this.finishNode(e,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:e,allowExact:s,allowSpread:n,allowProto:i,allowInexact:a}){let o=this.state.inType;this.state.inType=!0;let c=this.startNode();c.callProperties=[],c.properties=[],c.indexers=[],c.internalSlots=[];let l,u,p=!1;for(s&&this.match(6)?(this.expect(6),l=9,u=!0):(this.expect(5),l=8,u=!1),c.exact=u;!this.match(l);){let d=!1,f=null,m=null,y=this.startNode();if(i&&this.isContextual(118)){let x=this.lookahead();x.type!==14&&x.type!==17&&(this.next(),f=this.state.startLoc,e=!1)}if(e&&this.isContextual(106)){let x=this.lookahead();x.type!==14&&x.type!==17&&(this.next(),d=!0)}let b=this.flowParseVariance();if(this.eat(0))f!=null&&this.unexpected(f),this.eat(0)?(b&&this.unexpected(b.loc.start),c.internalSlots.push(this.flowParseObjectTypeInternalSlot(y,d))):c.indexers.push(this.flowParseObjectTypeIndexer(y,d,b));else if(this.match(10)||this.match(47))f!=null&&this.unexpected(f),b&&this.unexpected(b.loc.start),c.callProperties.push(this.flowParseObjectTypeCallProperty(y,d));else{let x="init";if(this.isContextual(99)||this.isContextual(104)){let T=this.lookahead();Ud(T.type)&&(x=this.state.value,this.next())}let N=this.flowParseObjectTypeProperty(y,d,f,b,x,n,a??!u);N===null?(p=!0,m=this.state.lastTokStartLoc):c.properties.push(N)}this.flowObjectTypeSemicolon(),m&&!this.match(8)&&!this.match(9)&&this.raise(F.UnexpectedExplicitInexactInObject,m)}this.expect(l),n&&(c.inexact=p);let h=this.finishNode(c,"ObjectTypeAnnotation");return this.state.inType=o,h}flowParseObjectTypeProperty(e,s,n,i,a,o,c){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(o?c||this.raise(F.InexactInsideExact,this.state.lastTokStartLoc):this.raise(F.InexactInsideNonObject,this.state.lastTokStartLoc),i&&this.raise(F.InexactVariance,i),null):(o||this.raise(F.UnexpectedSpreadType,this.state.lastTokStartLoc),n!=null&&this.unexpected(n),i&&this.raise(F.SpreadVariance,i),e.argument=this.flowParseType(),this.finishNode(e,"ObjectTypeSpreadProperty"));{e.key=this.flowParseObjectPropertyKey(),e.static=s,e.proto=n!=null,e.kind=a;let l=!1;return this.match(47)||this.match(10)?(e.method=!0,n!=null&&this.unexpected(n),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(F.ThisParamBannedInConstructor,e.value.this)):(a!=="init"&&this.unexpected(),e.method=!1,this.eat(17)&&(l=!0),e.value=this.flowParseTypeInitialiser(),e.variance=i),e.optional=l,this.finishNode(e,"ObjectTypeProperty")}}flowCheckGetterSetterParams(e){let s=e.kind==="get"?0:1,n=e.value.params.length+(e.value.rest?1:0);e.value.this&&this.raise(e.kind==="get"?F.GetterMayNotHaveThisParam:F.SetterMayNotHaveThisParam,e.value.this),n!==s&&this.raise(e.kind==="get"?g.BadGetterArity:g.BadSetterArity,e),e.kind==="set"&&e.value.rest&&this.raise(g.BadSetterRestParameter,e)}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,s){var n;(n=e)!=null||(e=this.state.startLoc);let i=s||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,s){let n=this.startNodeAt(e);return n.typeParameters=null,n.id=this.flowParseQualifiedTypeIdentifier(e,s),this.match(47)&&(n.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(n,"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 s=null,n=!1,i=null,a=this.startNode(),o=this.lookahead(),c=this.state.type===78;return o.type===14||o.type===17?(c&&!e&&this.raise(F.ThisParamMustBeFirst,a),s=this.parseIdentifier(c),this.eat(17)&&(n=!0,c&&this.raise(F.ThisParamMayNotBeOptional,a)),i=this.flowParseTypeInitialiser()):i=this.flowParseType(),a.name=s,a.optional=n,a.typeAnnotation=i,this.finishNode(a,"FunctionTypeParam")}reinterpretTypeAsFunctionTypeParam(e){let s=this.startNodeAt(e.loc.start);return s.name=null,s.optional=!1,s.typeAnnotation=e,this.finishNode(s,"FunctionTypeParam")}flowParseFunctionTypeParams(e=[]){let s=null,n=null;for(this.match(78)&&(n=this.flowParseFunctionTypeParam(!0),n.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)&&(s=this.flowParseFunctionTypeParam(!1)),{params:e,rest:s,_this:n}}flowIdentToTypeAnnotation(e,s,n){switch(n.name){case"any":return this.finishNode(s,"AnyTypeAnnotation");case"bool":case"boolean":return this.finishNode(s,"BooleanTypeAnnotation");case"mixed":return this.finishNode(s,"MixedTypeAnnotation");case"empty":return this.finishNode(s,"EmptyTypeAnnotation");case"number":return this.finishNode(s,"NumberTypeAnnotation");case"string":return this.finishNode(s,"StringTypeAnnotation");case"symbol":return this.finishNode(s,"SymbolTypeAnnotation");default:return this.checkNotUnderscore(n.name),this.flowParseGenericType(e,n)}}flowParsePrimaryType(){let e=this.state.startLoc,s=this.startNode(),n,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:{let c=this.startNode();return c.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(10),n=this.flowParseFunctionTypeParams(),c.params=n.params,c.rest=n.rest,c.this=n._this,this.expect(11),this.expect(19),c.returnType=this.flowParseType(),this.finishNode(c,"FunctionTypeAnnotation")}case 10:{let c=this.startNode();if(this.next(),!this.match(11)&&!this.match(21))if(z(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?n=this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(i)]):n=this.flowParseFunctionTypeParams(),c.params=n.params,c.rest=n.rest,c.this=n._this,this.expect(11),this.expect(19),c.returnType=this.flowParseType(),c.typeParameters=null,this.finishNode(c,"FunctionTypeAnnotation")}case 133:return this.parseLiteral(this.state.value,"StringLiteralTypeAnnotation");case 85:case 86:return s.value=this.match(85),this.next(),this.finishNode(s,"BooleanLiteralTypeAnnotation");case 53:if(this.state.value==="-"){if(this.next(),this.match(134))return this.parseLiteralAtNode(-this.state.value,"NumberLiteralTypeAnnotation",s);if(this.match(135))return this.parseLiteralAtNode(-this.state.value,"BigIntLiteralTypeAnnotation",s);throw this.raise(F.UnexpectedSubtractionOperand,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(s,"VoidTypeAnnotation");case 84:return this.next(),this.finishNode(s,"NullLiteralTypeAnnotation");case 78:return this.next(),this.finishNode(s,"ThisTypeAnnotation");case 55:return this.next(),this.finishNode(s,"ExistsTypeAnnotation");case 87:return this.flowParseTypeofType();default:if(Dc(this.state.type)){let c=Kt(this.state.type);return this.next(),super.createIdentifier(s,c)}else if(z(this.state.type))return this.isContextual(129)?this.flowParseInterfaceType():this.flowIdentToTypeAnnotation(e,s,this.parseIdentifier())}this.unexpected()}flowParsePostfixType(){let e=this.state.startLoc,s=this.flowParsePrimaryType(),n=!1;for(;(this.match(0)||this.match(18))&&!this.canInsertSemicolon();){let i=this.startNodeAt(e),a=this.eat(18);n=n||a,this.expect(0),!a&&this.match(3)?(i.elementType=s,this.next(),s=this.finishNode(i,"ArrayTypeAnnotation")):(i.objectType=s,i.indexType=this.flowParseType(),this.expect(3),n?(i.optional=a,s=this.finishNode(i,"OptionalIndexedAccessType")):s=this.finishNode(i,"IndexedAccessType"))}return s}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 s=this.startNodeAt(e.loc.start);return s.params=[this.reinterpretTypeAsFunctionTypeParam(e)],s.rest=null,s.this=null,s.returnType=this.flowParseType(),s.typeParameters=null,this.finishNode(s,"FunctionTypeAnnotation")}return e}flowParseIntersectionType(){let e=this.startNode();this.eat(45);let s=this.flowParseAnonFunctionWithoutParens();for(e.types=[s];this.eat(45);)e.types.push(this.flowParseAnonFunctionWithoutParens());return e.types.length===1?s:this.finishNode(e,"IntersectionTypeAnnotation")}flowParseUnionType(){let e=this.startNode();this.eat(43);let s=this.flowParseIntersectionType();for(e.types=[s];this.eat(43);)e.types.push(this.flowParseIntersectionType());return e.types.length===1?s:this.finishNode(e,"UnionTypeAnnotation")}flowParseType(){let e=this.state.inType;this.state.inType=!0;let s=this.flowParseUnionType();return this.state.inType=e,s}flowParseTypeOrImplicitInstantiation(){if(this.state.type===132&&this.state.value==="_"){let e=this.state.startLoc,s=this.parseIdentifier();return this.flowParseGenericType(e,s)}else return this.flowParseType()}flowParseTypeAnnotation(){let e=this.startNode();return e.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(e,"TypeAnnotation")}flowParseTypeAnnotatableIdentifier(e){let s=e?this.parseIdentifier():this.flowParseRestrictedIdentifier();return this.match(14)&&(s.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(s)),s}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,s,n=!1){if(s){this.forwardNoArrowParamsConversionAt(e,()=>super.parseFunctionBody(e,!0,n));return}super.parseFunctionBody(e,!1,n)}parseFunctionBodyAndFinish(e,s,n=!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,s,n)}parseStatementLike(e){if(this.state.strict&&this.isContextual(129)){let n=this.lookahead();if(it(n.type)){let i=this.startNode();return this.next(),this.flowParseInterface(i)}}else if(this.plugins.get("flow").enums&&this.isContextual(126)){let n=this.startNode();return this.next(),this.flowParseEnumDeclaration(n)}let s=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(s)&&(this.flowPragma=null),s}parseExpressionStatement(e,s,n){if(s.type==="Identifier"){if(s.name==="declare"){if(this.match(80)||z(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(e)}else if(z(this.state.type)){if(s.name==="interface")return this.flowParseInterface(e);if(s.name==="type")return this.flowParseTypeAlias(e);if(s.name==="opaque")return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,s,n)}shouldParseExportDeclaration(){let{type:e}=this.state;return Id(e)||this.plugins.get("flow").enums&&e===126?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return Id(e)||this.plugins.get("flow").enums&&e===126?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.plugins.get("flow").enums&&this.isContextual(126)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,s,n){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(n),e}this.expect(17);let i=this.state.clone(),a=this.state.noArrowAt,o=this.startNodeAt(s),{consequent:c,failed:l}=this.tryParseConditionalConsequent(),[u,p]=this.getArrowLikeExpressions(c);if(l||p.length>0){let h=[...a];if(p.length>0){this.state=i,this.state.noArrowAt=h;for(let d=0;d<p.length;d++)h.push(p[d].start);({consequent:c,failed:l}=this.tryParseConditionalConsequent()),[u,p]=this.getArrowLikeExpressions(c)}l&&u.length>1&&this.raise(F.AmbiguousConditionalArrow,i.startLoc),l&&u.length===1&&(this.state=i,h.push(u[0].start),this.state.noArrowAt=h,{consequent:c,failed:l}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(c,!0),this.state.noArrowAt=a,this.expect(14),o.test=e,o.consequent=c,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(),s=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:s}}getArrowLikeExpressions(e,s){let n=[e],i=[];for(;n.length!==0;){let a=n.pop();a.type==="ArrowFunctionExpression"&&a.body.type!=="BlockStatement"?(a.typeParameters||!a.returnType?this.finishArrowValidation(a):i.push(a),n.push(a.body)):a.type==="ConditionalExpression"&&(n.push(a.consequent),n.push(a.alternate))}return s?(i.forEach(a=>this.finishArrowValidation(a)),[i,[]]):yx(i,a=>a.params.every(o=>this.isAssignable(o,!0)))}finishArrowValidation(e){var s;this.toAssignableList(e.params,(s=e.extra)==null?void 0:s.trailingCommaLoc,!1),this.scope.enter(6),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,s){let n;return this.state.noArrowParamsConversionAt.includes(e.start)?(this.state.noArrowParamsConversionAt.push(this.state.start),n=s(),this.state.noArrowParamsConversionAt.pop()):n=s(),n}parseParenItem(e,s){let n=super.parseParenItem(e,s);if(this.eat(17)&&(n.optional=!0,this.resetEndLocation(e)),this.match(14)){let i=this.startNodeAt(s);return i.expression=n,i.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(i,"TypeCastExpression")}return n}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 s=this.startNode();return this.next(),this.match(5)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(s)}else if(this.isContextual(131)){e.exportKind="type";let s=this.startNode();return this.next(),this.flowParseOpaqueType(s,!1)}else if(this.isContextual(129)){e.exportKind="type";let s=this.startNode();return this.next(),this.flowParseInterface(s)}else if(this.plugins.get("flow").enums&&this.isContextual(126)){e.exportKind="value";let s=this.startNode();return this.next(),this.flowParseEnumDeclaration(s)}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:s}=this.state,n=super.maybeParseExportNamespaceSpecifier(e);return n&&e.exportKind==="type"&&this.unexpected(s),n}parseClassId(e,s,n){super.parseClassId(e,s,n),this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,s,n){let{startLoc:i}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(e,s))return;s.declare=!0}super.parseClassMember(e,s,n),s.declare&&(s.type!=="ClassProperty"&&s.type!=="ClassPrivateProperty"&&s.type!=="PropertyDefinition"?this.raise(F.DeclareClassElement,i):s.value&&this.raise(F.DeclareClassFieldInitializer,s.value))}isIterator(e){return e==="iterator"||e==="asyncIterator"}readIterator(){let e=super.readWord1(),s="@@"+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(g.InvalidIdentifier,this.state.curPosition(),{identifierName:s}),this.finishToken(132,s)}getTokenFromCode(e){let s=this.input.charCodeAt(this.state.pos+1);e===123&&s===124?this.finishOp(6,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?48:47,1):this.state.inType&&e===63?s===46?this.finishOp(18,2):this.finishOp(17,1):Q_(e,s,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,s){return e.type==="TypeCastExpression"?this.isAssignable(e.expression,s):super.isAssignable(e,s)}toAssignable(e,s=!1){!s&&e.type==="AssignmentExpression"&&e.left.type==="TypeCastExpression"&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,s)}toAssignableList(e,s,n){for(let i=0;i<e.length;i++){let a=e[i];a?.type==="TypeCastExpression"&&(e[i]=this.typeCastToParameter(a))}super.toAssignableList(e,s,n)}toReferencedList(e,s){for(let i=0;i<e.length;i++){var n;let a=e[i];a&&a.type==="TypeCastExpression"&&!((n=a.extra)!=null&&n.parenthesized)&&(e.length>1||!s)&&this.raise(F.TypeCastInPattern,a.typeAnnotation)}return e}parseArrayLike(e,s,n,i){let a=super.parseArrayLike(e,s,n,i);return s&&!this.state.maybeInArrowParameters&&this.toReferencedList(a.elements),a}isValidLVal(e,s,n){return e==="TypeCastExpression"||super.isValidLVal(e,s,n)}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,s,n,i,a,o){if(s.variance&&this.unexpected(s.variance.loc.start),delete s.variance,this.match(47)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,s,n,i,a,o),s.params&&a){let c=s.params;c.length>0&&this.isThisParam(c[0])&&this.raise(F.ThisParamBannedInConstructor,s)}else if(s.type==="MethodDefinition"&&a&&s.value.params){let c=s.value.params;c.length>0&&this.isThisParam(c[0])&&this.raise(F.ThisParamBannedInConstructor,s)}}pushClassPrivateMethod(e,s,n,i){s.variance&&this.unexpected(s.variance.loc.start),delete s.variance,this.match(47)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,s,n,i)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&this.match(47)&&(e.superTypeParameters=this.flowParseTypeParameterInstantiation()),this.isContextual(113)){this.next();let s=e.implements=[];do{let n=this.startNode();n.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?n.typeParameters=this.flowParseTypeParameterInstantiation():n.typeParameters=null,s.push(this.finishNode(n,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);let s=this.getObjectOrClassMethodParams(e);if(s.length>0){let n=s[0];this.isThisParam(n)&&e.kind==="get"?this.raise(F.GetterMayNotHaveThisParam,n):this.isThisParam(n)&&this.raise(F.SetterMayNotHaveThisParam,n)}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,s,n,i,a,o,c){e.variance&&this.unexpected(e.variance.loc.start),delete e.variance;let l;this.match(47)&&!o&&(l=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());let u=super.parseObjPropValue(e,s,n,i,a,o,c);return l&&((u.value||u).typeParameters=l),u}parseFunctionParamType(e){return this.eat(17)&&(e.type!=="Identifier"&&this.raise(F.PatternIsOptional,e),this.isThisParam(e)&&this.raise(F.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(14)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(F.ThisParamAnnotationRequired,e),this.match(29)&&this.isThisParam(e)&&this.raise(F.ThisParamNoDefault,e),this.resetEndLocation(e),e}parseMaybeDefault(e,s){let n=super.parseMaybeDefault(e,s);return n.type==="AssignmentPattern"&&n.typeAnnotation&&n.right.start<n.typeAnnotation.start&&this.raise(F.TypeBeforeInitializer,n.typeAnnotation),n}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(F.ImportReflectionHasImportType,e.specifiers[0].loc.start)}parseImportSpecifierLocal(e,s,n){s.local=Od(e)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(s,n))}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){if(!e)return!0;let s=this.lookaheadCharCode();return s===123||s===42}return!e&&this.isContextual(87)}applyImportPhase(e,s,n,i){if(super.applyImportPhase(e,s,n,i),s){if(!n&&this.match(65))return;e.exportKind=n==="type"?n:"value"}else n==="type"&&this.match(55)&&this.unexpected(),e.importKind=n==="type"||n==="typeof"?n:"value"}parseImportSpecifier(e,s,n,i,a){let o=e.imported,c=null;o.type==="Identifier"&&(o.name==="type"?c="type":o.name==="typeof"&&(c="typeof"));let l=!1;if(this.isContextual(93)&&!this.isLookaheadContextual("as")){let p=this.parseIdentifier(!0);c!==null&&!it(this.state.type)?(e.imported=p,e.importKind=c,e.local=Mt(p)):(e.imported=o,e.importKind=null,e.local=this.parseIdentifier())}else{if(c!==null&&it(this.state.type))e.imported=this.parseIdentifier(!0),e.importKind=c;else{if(s)throw this.raise(g.ImportBindingIsString,e,{importName:o.value});e.imported=o,e.importKind=null}this.eatContextual(93)?e.local=this.parseIdentifier():(l=!0,e.local=Mt(e.imported))}let u=Od(e);return n&&u&&this.raise(F.ImportTypeShorthandOnlyInPureImport,e),(n||u)&&this.checkReservedType(e.local.name,e.local.loc.start,!0),l&&!n&&!u&&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,s){let n=e.kind;n!=="get"&&n!=="set"&&this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),super.parseFunctionParams(e,s)}parseVarId(e,s){super.parseVarId(e,s),this.match(14)&&(e.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,s){if(this.match(14)){let n=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,e.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=n}return super.parseAsyncArrowFromCallExpression(e,s)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}parseMaybeAssign(e,s){var n;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,s),i),!a.error)return a.node;let{context:l}=this.state,u=l[l.length-1];(u===K.j_oTag||u===K.j_expr)&&l.pop()}if((n=a)!=null&&n.error||this.match(47)){var o,c;i=i||this.state.clone();let l,u=this.tryParse(h=>{var d;l=this.flowParseTypeParameterDeclaration();let f=this.forwardNoArrowParamsConversionAt(l,()=>{let y=super.parseMaybeAssign(e,s);return this.resetStartLocationFromNode(y,l),y});(d=f.extra)!=null&&d.parenthesized&&h();let m=this.maybeUnwrapTypeCastExpression(f);return m.type!=="ArrowFunctionExpression"&&h(),m.typeParameters=l,this.resetStartLocationFromNode(m,l),f},i),p=null;if(u.node&&this.maybeUnwrapTypeCastExpression(u.node).type==="ArrowFunctionExpression"){if(!u.error&&!u.aborted)return u.node.async&&this.raise(F.UnexpectedTypeParameterBeforeAsyncArrowFunction,l),u.node;p=u.node}if((o=a)!=null&&o.node)return this.state=a.failState,a.node;if(p)return this.state=u.failState,p;throw(c=a)!=null&&c.thrown?a.error:u.thrown?u.error:this.raise(F.UnexpectedTokenAfterTypeParameter,l)}return super.parseMaybeAssign(e,s)}parseArrow(e){if(this.match(14)){let s=this.tryParse(()=>{let n=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let i=this.startNode();return[i.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=n,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),i});if(s.thrown)return null;s.error&&(this.state=s.failState),e.returnType=s.node.typeAnnotation?this.finishNode(s.node,"TypeAnnotation"):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(14)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,s){this.state.noArrowParamsConversionAt.includes(e.start)?e.params=s:super.setArrowFunctionParameters(e,s)}checkParams(e,s,n,i=!0){if(!(n&&this.state.noArrowParamsConversionAt.includes(e.start))){for(let a=0;a<e.params.length;a++)this.isThisParam(e.params[a])&&a>0&&this.raise(F.ThisParamMustBeFirst,e.params[a]);super.checkParams(e,s,n,i)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.state.start))}parseSubscripts(e,s,n){if(e.type==="Identifier"&&e.name==="async"&&this.state.noArrowAt.includes(s.index)){this.next();let i=this.startNodeAt(s);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(c=>this.parseAsyncArrowWithTypeParameters(s)||c(),i);if(!a.error&&!a.aborted)return a.node;let o=this.tryParse(()=>super.parseSubscripts(e,s,n),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,s,n)}parseSubscript(e,s,n,i){if(this.match(18)&&this.isLookaheadToken_lt()){if(i.optionalChainMember=!0,n)return i.stop=!0,e;this.next();let a=this.startNodeAt(s);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(!n&&this.shouldParseTypes()&&this.match(47)){let a=this.startNodeAt(s);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,s,n,i)}parseNewCallee(e){super.parseNewCallee(e);let s=null;this.shouldParseTypes()&&this.match(47)&&(s=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=s}parseAsyncArrowWithTypeParameters(e){let s=this.startNodeAt(e);if(this.parseFunctionParams(s,!1),!!this.parseArrow(s))return super.parseArrowExpression(s,void 0,!0)}readToken_mult_modulo(e){let s=this.input.charCodeAt(this.state.pos+1);if(e===42&&s===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 s=this.input.charCodeAt(this.state.pos+1);if(e===124&&s===125){this.finishOp(9,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,s){let n=super.parseTopLevel(e,s);return this.state.hasFlowComment&&this.raise(F.UnterminatedFlowComment,this.state.curPosition()),n}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(F.NestedFlowComment,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,s=2;for(;[32,9].includes(this.input.charCodeAt(e+s));)s++;let n=this.input.charCodeAt(s+e),i=this.input.charCodeAt(s+e+1);return n===58&&i===58?s+2:this.input.slice(s+e,s+e+12)==="flow-include"?s+12:n===58&&i!==58?s:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(g.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,{enumName:s,memberName:n}){this.raise(F.EnumBooleanMemberNotInitialized,e,{memberName:n,enumName:s})}flowEnumErrorInvalidMemberInitializer(e,s){return this.raise(s.explicitType?s.explicitType==="symbol"?F.EnumInvalidMemberInitializerSymbolType:F.EnumInvalidMemberInitializerPrimaryType:F.EnumInvalidMemberInitializerUnknownType,e,s)}flowEnumErrorNumberMemberNotInitialized(e,s){this.raise(F.EnumNumberMemberNotInitialized,e,s)}flowEnumErrorStringMemberInconsistentlyInitialized(e,s){this.raise(F.EnumStringMemberInconsistentlyInitialized,e,s)}flowEnumMemberInit(){let e=this.state.startLoc,s=()=>this.match(12)||this.match(8);switch(this.state.type){case 134:{let n=this.parseNumericLiteral(this.state.value);return s()?{type:"number",loc:n.loc.start,value:n}:{type:"invalid",loc:e}}case 133:{let n=this.parseStringLiteral(this.state.value);return s()?{type:"string",loc:n.loc.start,value:n}:{type:"invalid",loc:e}}case 85:case 86:{let n=this.parseBooleanLiteral(this.match(85));return s()?{type:"boolean",loc:n.loc.start,value:n}:{type:"invalid",loc:e}}default:return{type:"invalid",loc:e}}}flowEnumMemberRaw(){let e=this.state.startLoc,s=this.parseIdentifier(!0),n=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:e};return{id:s,init:n}}flowEnumCheckExplicitTypeMismatch(e,s,n){let{explicitType:i}=s;i!==null&&i!==n&&this.flowEnumErrorInvalidMemberInitializer(e,s)}flowEnumMembers({enumName:e,explicitType:s}){let n=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:c,init:l}=this.flowEnumMemberRaw(),u=c.name;if(u==="")continue;/^[a-z]/.test(u)&&this.raise(F.EnumInvalidMemberName,c,{memberName:u,suggestion:u[0].toUpperCase()+u.slice(1),enumName:e}),n.has(u)&&this.raise(F.EnumDuplicateMemberName,c,{memberName:u,enumName:e}),n.add(u);let p={enumName:e,explicitType:s,memberName:u};switch(o.id=c,l.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(l.loc,p,"boolean"),o.init=l.value,i.booleanMembers.push(this.finishNode(o,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(l.loc,p,"number"),o.init=l.value,i.numberMembers.push(this.finishNode(o,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(l.loc,p,"string"),o.init=l.value,i.stringMembers.push(this.finishNode(o,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(l.loc,p);case"none":switch(s){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(l.loc,p);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(l.loc,p);break;default:i.defaultedMembers.push(this.finishNode(o,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:i,hasUnknownMembers:a}}flowEnumStringMembers(e,s,{enumName:n}){if(e.length===0)return s;if(s.length===0)return e;if(s.length>e.length){for(let i of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(i,{enumName:n});return s}else{for(let i of s)this.flowEnumErrorStringMemberInconsistentlyInitialized(i,{enumName:n});return e}}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(102))return null;if(!z(this.state.type))throw this.raise(F.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});let{value:s}=this.state;return this.next(),s!=="boolean"&&s!=="number"&&s!=="string"&&s!=="symbol"&&this.raise(F.EnumInvalidExplicitType,this.state.startLoc,{enumName:e,invalidEnumType:s}),s}flowEnumBody(e,s){let n=s.name,i=s.loc.start,a=this.flowEnumParseExplicitType({enumName:n});this.expect(5);let{members:o,hasUnknownMembers:c}=this.flowEnumMembers({enumName:n,explicitType:a});switch(e.hasUnknownMembers=c,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:n}),this.expect(8),this.finishNode(e,"EnumStringBody");case"symbol":return e.members=o.defaultedMembers,this.expect(8),this.finishNode(e,"EnumSymbolBody");default:{let l=()=>(e.members=[],this.expect(8),this.finishNode(e,"EnumStringBody"));e.explicitType=!1;let u=o.booleanMembers.length,p=o.numberMembers.length,h=o.stringMembers.length,d=o.defaultedMembers.length;if(!u&&!p&&!h&&!d)return l();if(!u&&!p)return e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:n}),this.expect(8),this.finishNode(e,"EnumStringBody");if(!p&&!h&&u>=d){for(let f of o.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(f.loc.start,{enumName:n,memberName:f.id.name});return e.members=o.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody")}else if(!u&&!h&&p>=d){for(let f of o.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(f.loc.start,{enumName:n,memberName:f.id.name});return e.members=o.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody")}else return this.raise(F.EnumInconsistentMemberValues,i,{enumName:n}),l()}}}flowParseEnumDeclaration(e){let s=this.parseIdentifier();return e.id=s,e.body=this.flowEnumBody(this.startNode(),s),this.finishNode(e,"EnumDeclaration")}isLookaheadToken_lt(){let e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){let s=this.input.charCodeAt(e+1);return s!==60&&s!==61}return!1}maybeUnwrapTypeCastExpression(e){return e.type==="TypeCastExpression"?e.expression:e}},Sx={__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"},fs=Ot`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:r})=>`Expected corresponding JSX closing tag for <${r}>.`,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:r,HTMLEntity:t})=>`Unexpected token \`${r}\`. Did you mean \`${t}\` or \`{'${r}'}\`?`,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 Jt(r){return r?r.type==="JSXOpeningFragment"||r.type==="JSXClosingFragment":!1}function Ws(r){if(r.type==="JSXIdentifier")return r.name;if(r.type==="JSXNamespacedName")return r.namespace.name+":"+r.name.name;if(r.type==="JSXMemberExpression")return Ws(r.object)+"."+Ws(r.property);throw new Error("Node had unexpected type: "+r.type)}var _x=r=>class extends r{jsxReadToken(){let e="",s=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(fs.UnterminatedJsxContent,this.state.startLoc);let n=this.input.charCodeAt(this.state.pos);switch(n){case 60:case 123:if(this.state.pos===this.state.start){n===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(142)):super.getTokenFromCode(n);return}e+=this.input.slice(s,this.state.pos),this.finishToken(141,e);return;case 38:e+=this.input.slice(s,this.state.pos),e+=this.jsxReadEntity(),s=this.state.pos;break;case 62:case 125:default:Js(n)?(e+=this.input.slice(s,this.state.pos),e+=this.jsxReadNewLine(!0),s=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){let s=this.input.charCodeAt(this.state.pos),n;return++this.state.pos,s===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,n=e?`
|
|
6
6
|
`:`\r
|
|
7
|
-
`):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(m.UnterminatedString,this.state.startLoc);let n=this.input.charCodeAt(this.state.pos);if(n===e)break;n===38?(t+=this.input.slice(r,this.state.pos),t+=this.jsxReadEntity(),r=this.state.pos):st(n)?(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 n=this.input.slice(e,this.state.pos),a=Vo[n];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(tt(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:Tr(this.state.type)?e.name=Re(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(ze.AttributeIsEmpty,e),e;case 142:case 133:return this.parseExprAtom();default:throw this.raise(ze.UnsupportedJsxValue,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=[],n=this.jsxParseOpeningElementAt(e),a=null;if(!n.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.parseLiteral(this.state.value,"JSXText"));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()}je(n)&&!je(a)&&a!==null?this.raise(ze.MissingClosingTagFragment,a):!je(n)&&je(a)?this.raise(ze.MissingClosingTagElement,a,{openingTagName:et(n.name)}):!je(n)&&!je(a)&&et(a.name)!==et(n.name)&&this.raise(ze.MissingClosingTagElement,a,{openingTagName:et(n.name)})}if(je(n)?(t.openingFragment=n,t.closingFragment=a):(t.openingElement=n,t.closingElement=a),t.children=r,this.match(47))throw this.raise(ze.UnwrappedAdjacentJSXElements,this.state.startLoc);return je(n)?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(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(Oe(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 n=t[t.length-1];n===V.j_oTag&&e===56||n===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=ro(r)}},cr=class extends wt{constructor(...s){super(...s),this.tsNames=new Map}},ur=class extends vt{constructor(...s){super(...s),this.importsStack=[]}createScope(s){return this.importsStack.push(new Set),new cr(s)}enter(s){s===256&&this.importsStack.push(new Set),super.enter(s)}exit(){let s=super.exit();return s===256&&this.importsStack.pop(),s}hasImport(s,e){let t=this.importsStack.length;if(this.importsStack[t-1].has(s))return!0;if(!e&&t>1){for(let r=0;r<t-1;r++)if(this.importsStack[r].has(s))return!0}return!1}declareName(s,e,t){if(e&4096){this.hasImport(s,!0)&&this.parser.raise(m.VarRedeclaration,t,{identifierName:s}),this.importsStack[this.importsStack.length-1].add(s);return}let r=this.currentScope(),n=r.tsNames.get(s)||0;if(e&1024){this.maybeExportDefined(r,s),r.tsNames.set(s,n|16);return}super.declareName(s,e,t),e&2&&(e&1||(this.checkRedeclarationInScope(r,s,e,t),this.maybeExportDefined(r,s)),n=n|1),e&256&&(n=n|2),e&512&&(n=n|4),e&128&&(n=n|8),n&&r.tsNames.set(s,n)}isRedeclaredInScope(s,e,t){let r=s.tsNames.get(e);if((r&2)>0){if(t&256){let n=!!(t&512),a=(r&4)>0;return n!==a}return!0}return t&128&&(r&8)>0?s.names.get(e)&2?!!(t&1):!1:t&2&&(r&1)>0?!0:super.isRedeclaredInScope(s,e,t)}checkLocalExport(s){let{name:e}=s;if(this.hasImport(e))return;let t=this.scopeStack.length;for(let r=t-1;r>=0;r--){let a=this.scopeStack[r].tsNames.get(e);if((a&1)>0||(a&16)>0)return}super.checkLocalExport(s)}},Gi=i=>i.type==="ParenthesizedExpression"?Gi(i.expression):i,hr=class extends lr{toAssignable(s,e=!1){var t,r;let n;switch((s.type==="ParenthesizedExpression"||(t=s.extra)!=null&&t.parenthesized)&&(n=Gi(s),e?n.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(m.InvalidParenthesizedAssignment,s):n.type!=="MemberExpression"&&!this.isOptionalMemberExpression(n)&&this.raise(m.InvalidParenthesizedAssignment,s):this.raise(m.InvalidParenthesizedAssignment,s)),s.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":s.type="ObjectPattern";for(let o=0,l=s.properties.length,c=l-1;o<l;o++){var a;let u=s.properties[o],h=o===c;this.toAssignableObjectExpressionProp(u,h,e),h&&u.type==="RestElement"&&(a=s.extra)!=null&&a.trailingCommaLoc&&this.raise(m.RestTrailingComma,s.extra.trailingCommaLoc)}break;case"ObjectProperty":{let{key:o,value:l}=s;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":s.type="ArrayPattern",this.toAssignableList(s.elements,(r=s.extra)==null?void 0:r.trailingCommaLoc,e);break;case"AssignmentExpression":s.operator!=="="&&this.raise(m.MissingEqInAssignment,s.left.loc.end),s.type="AssignmentPattern",delete s.operator,this.toAssignable(s.left,e);break;case"ParenthesizedExpression":this.toAssignable(n,e);break}}toAssignableObjectExpressionProp(s,e,t){if(s.type==="ObjectMethod")this.raise(s.kind==="get"||s.kind==="set"?m.PatternHasAccessor:m.PatternHasMethod,s.key);else if(s.type==="SpreadElement"){s.type="RestElement";let r=s.argument;this.checkToRestConversion(r,!1),this.toAssignable(r,t),e||this.raise(m.RestTrailingComma,s)}else this.toAssignable(s,t)}toAssignableList(s,e,t){let r=s.length-1;for(let n=0;n<=r;n++){let a=s[n];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"&&(n<r?this.raise(m.RestTrailingComma,a):e&&this.raise(m.RestTrailingComma,e))}}}isAssignable(s,e){switch(s.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":return!0;case"ObjectExpression":{let t=s.properties.length-1;return s.properties.every((r,n)=>r.type!=="ObjectMethod"&&(n===t||r.type!=="SpreadElement")&&this.isAssignable(r))}case"ObjectProperty":return this.isAssignable(s.value);case"SpreadElement":return this.isAssignable(s.argument);case"ArrayExpression":return s.elements.every(t=>t===null||this.isAssignable(t));case"AssignmentExpression":return s.operator==="=";case"ParenthesizedExpression":return this.isAssignable(s.expression);case"MemberExpression":case"OptionalMemberExpression":return!e;default:return!1}}toReferencedList(s,e){return s}toReferencedListDeep(s,e){this.toReferencedList(s,e);for(let t of s)t?.type==="ArrayExpression"&&this.toReferencedListDeep(t.elements)}parseSpread(s){let e=this.startNode();return this.next(),e.argument=this.parseMaybeAssignAllowIn(s,void 0),this.finishNode(e,"SpreadElement")}parseRestBinding(){let s=this.startNode();return this.next(),s.argument=this.parseBindingAtom(),this.finishNode(s,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{let s=this.startNode();return this.next(),s.elements=this.parseBindingList(3,93,1),this.finishNode(s,"ArrayPattern")}case 5:return this.parseObjectLike(8,!0)}return this.parseIdentifier()}parseBindingList(s,e,t){let r=t&1,n=[],a=!0;for(;!this.eat(s);)if(a?a=!1:this.expect(12),r&&this.match(12))n.push(null);else{if(this.eat(s))break;if(this.match(21)){let o=this.parseRestBinding();if((this.hasPlugin("flow")||t&2)&&(o=this.parseFunctionParamType(o)),n.push(o),!this.checkCommaAfterRest(e)){this.expect(s);break}}else{let o=[];for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(m.UnsupportedParameterDecorator,this.state.startLoc);this.match(26);)o.push(this.parseDecorator());n.push(this.parseAssignableListItem(t,o))}}return n}parseBindingRestProperty(s){return this.next(),s.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(s,"RestElement")}parseBindingProperty(){let{type:s,startLoc:e}=this.state;if(s===21)return this.parseBindingRestProperty(this.startNode());let t=this.startNode();return s===138?(this.expectPlugin("destructuringPrivate",e),this.classScope.usePrivateName(this.state.value,e),t.key=this.parsePrivateName()):this.parsePropertyName(t),t.method=!1,this.parseObjPropValue(t,e,!1,!1,!0,!1)}parseAssignableListItem(s,e){let t=this.parseMaybeDefault();(this.hasPlugin("flow")||s&2)&&this.parseFunctionParamType(t);let r=this.parseMaybeDefault(t.loc.start,t);return e.length&&(t.decorators=e),r}parseFunctionParamType(s){return s}parseMaybeDefault(s,e){var t,r;if((t=s)!=null||(s=this.state.startLoc),e=(r=e)!=null?r:this.parseBindingAtom(),!this.eat(29))return e;let n=this.startNodeAt(s);return n.left=e,n.right=this.parseMaybeAssignAllowIn(),this.finishNode(n,"AssignmentPattern")}isValidLVal(s,e,t){switch(s){case"AssignmentPattern":return"left";case"RestElement":return"argument";case"ObjectProperty":return"value";case"ParenthesizedExpression":return"expression";case"ArrayPattern":return"elements";case"ObjectPattern":return"properties"}return!1}isOptionalMemberExpression(s){return s.type==="OptionalMemberExpression"}checkLVal(s,e,t=64,r=!1,n=!1,a=!1){var o;let l=s.type;if(this.isObjectMethod(s))return;let c=this.isOptionalMemberExpression(s);if(c||l==="MemberExpression"){c&&(this.expectPlugin("optionalChainingAssign",s.loc.start),e.type!=="AssignmentExpression"&&this.raise(m.InvalidLhsOptionalChaining,s,{ancestor:e})),t!==64&&this.raise(m.InvalidPropertyBindingPattern,s);return}if(l==="Identifier"){this.checkIdentifier(s,t,n);let{name:g}=s;r&&(r.has(g)?this.raise(m.ParamDupe,s):r.add(g));return}let u=this.isValidLVal(l,!(a||(o=s.extra)!=null&&o.parenthesized)&&e.type==="AssignmentExpression",t);if(u===!0)return;if(u===!1){let g=t===64?m.InvalidLhs:m.InvalidLhsBinding;this.raise(g,s,{ancestor:e});return}let h,f;typeof u=="string"?(h=u,f=l==="ParenthesizedExpression"):[h,f]=u;let d=l==="ArrayPattern"||l==="ObjectPattern"?{type:l}:e,p=s[h];if(Array.isArray(p))for(let g of p)g&&this.checkLVal(g,d,t,r,n,f);else p&&this.checkLVal(p,d,t,r,n,f)}checkIdentifier(s,e,t=!1){this.state.strict&&(t?Wi(s.name,this.inModule):zi(s.name))&&(e===64?this.raise(m.StrictEvalArguments,s,{referenceName:s.name}):this.raise(m.StrictEvalArgumentsBinding,s,{bindingName:s.name})),e&8192&&s.name==="let"&&this.raise(m.LetInLexicalBinding,s),e&64||this.declareNameFromIdentifier(s,e)}declareNameFromIdentifier(s,e){this.scope.declareName(s.name,e,s.loc.start)}checkToRestConversion(s,e){switch(s.type){case"ParenthesizedExpression":this.checkToRestConversion(s.expression,e);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(e)break;default:this.raise(m.InvalidRestAssignmentPattern,s)}}checkCommaAfterRest(s){return this.match(12)?(this.raise(this.lookaheadCharCode()===s?m.RestTrailingComma:m.ElementAfterRest,this.state.startLoc),!0):!1}};function qo(i){if(i==null)throw new Error(`Unexpected ${i} value.`);return i}function Oi(i){if(!i)throw new Error("Assert fail")}var I=Me`typescript`({AbstractMethodHasImplementation:({methodName:i})=>`Method '${i}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:i})=>`Property '${i}' cannot have an initializer because it is marked abstract.`,AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",AccessorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccessorCannotHaveTypeParameters:"An accessor cannot have type parameters.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"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:i})=>`'declare' is not allowed in ${i}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:({modifier:i})=>"Accessibility modifier already seen.",DuplicateModifier:({modifier:i})=>`Duplicate modifier: '${i}'.`,EmptyHeritageClauseType:({token:i})=>`'${i}' 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:i})=>`'${i[0]}' modifier cannot be used with '${i[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:i})=>`Index signatures cannot have an accessibility modifier ('${i}').`,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:i})=>`'${i}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:i})=>`'${i}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:i})=>`'${i}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:i})=>`'${i[0]}' modifier must precede '${i[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:i})=>`Private elements cannot have an accessibility modifier ('${i}').`,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.",SetAccessorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccessorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccessorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:i})=>`Single type parameter ${i} should have a trailing comma. Example usage: <${i},>.`,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:i})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${i}.`});function zo(i){switch(i){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 Mi(i){return i==="private"||i==="public"||i==="protected"}function Wo(i){return i==="in"||i==="out"}var Jo=i=>class extends i{constructor(...e){super(...e),this.tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:I.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:I.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:I.InvalidModifierOnTypeParameter})}getScopeHandler(){return ur}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()}tsNextTokenOnSameLineAndCanFollowModifier(){return this.next(),this.hasPrecedingLineBreak()?!1:this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){return this.match(106)?(this.next(),this.tsTokenCanFollowModifier()):this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(e,t){if(!R(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;let r=this.state.value;if(e.includes(r)){if(t&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return r}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:t,stopOnStartOfClassStaticBlock:r,errorTemplate:n=I.InvalidModifierOnTypeMember},a){let o=(c,u,h,f)=>{u===h&&a[f]&&this.raise(I.InvalidModifiersOrder,c,{orderedModifiers:[h,f]})},l=(c,u,h,f)=>{(a[h]&&u===f||a[f]&&u===h)&&this.raise(I.IncompatibleModifiers,c,{modifiers:[h,f]})};for(;;){let{startLoc:c}=this.state,u=this.tsParseModifier(e.concat(t??[]),r);if(!u)break;Mi(u)?a.accessibility?this.raise(I.DuplicateAccessibilityModifier,c,{modifier:u}):(o(c,u,u,"override"),o(c,u,u,"static"),o(c,u,u,"readonly"),a.accessibility=u):Wo(u)?(a[u]&&this.raise(I.DuplicateModifier,c,{modifier:u}),a[u]=!0,o(c,u,"in","out")):(hasOwnProperty.call(a,u)?this.raise(I.DuplicateModifier,c,{modifier:u}):(o(c,u,"static","readonly"),o(c,u,"static","override"),o(c,u,"override","readonly"),o(c,u,"abstract","override"),l(c,u,"declare","override"),l(c,u,"static","abstract")),a[u]=!0),t!=null&&t.includes(u)&&this.raise(n,c,{modifier:u})}}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 qo(this.tsParseDelimitedListWorker(e,t,!0,r))}tsParseDelimitedListWorker(e,t,r,n){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.lastTokStartLoc.index;continue}if(this.tsIsListTerminator(e))break;r&&this.expect(12);return}return n&&(n.value=o),a}tsParseBracketedList(e,t,r,n,a){n||(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(I.UnsupportedImportTypeArgument,this.state.startLoc),e.argument=super.parseExprAtom(),(this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions"))&&(e.options=null),this.eat(12)&&(this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes"),this.match(11)||(e.options=super.parseMaybeAssignAllowIn(),this.eat(12))),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(I.EmptyTypeParameters,t),r.value!==-1&&this.addExtra(t,"trailingComma",r.value),this.finishNode(t,"TSTypeParameterDeclaration")}tsFillSignature(e,t){let r=e===19,n="parameters",a="typeAnnotation";t.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),t[n]=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(I.UnsupportedSignatureParameterKind,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(I.ReadonlyForMethodSignature,e);let n=r;n.kind&&this.match(47)&&this.raise(I.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(14,n),this.tsParseTypeMemberSemicolon();let a="parameters",o="typeAnnotation";if(n.kind==="get")n[a].length>0&&(this.raise(m.BadGetterArity,this.state.curPosition()),this.isThisParam(n[a][0])&&this.raise(I.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(n.kind==="set"){if(n[a].length!==1)this.raise(m.BadSetterArity,this.state.curPosition());else{let l=n[a][0];this.isThisParam(l)&&this.raise(I.AccessorCannotDeclareThisParameter,this.state.curPosition()),l.type==="Identifier"&&l.optional&&this.raise(I.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),l.type==="RestElement"&&this.raise(I.SetAccessorCannotHaveRestParameter,this.state.curPosition())}n[o]&&this.raise(I.SetAccessorCannotHaveReturnType,n[o])}else n.kind="method";return this.finishNode(n,"TSMethodSignature")}else{let n=r;t&&(n.readonly=!0);let a=this.tsTryParseTypeAnnotation();return a&&(n.typeAnnotation=a),this.tsParseTypeMemberSemicolon(),this.finishNode(n,"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)))}tsParseMappedType(){let e=this.startNode();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);{let t=this.startNode();t.name=this.tsParseTypeParameterName(),t.constraint=this.tsExpectThenParseType(58),e.typeParameter=this.finishNode(t,"TSTypeParameter")}return 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:n}=r;t&&n!=="TSRestType"&&n!=="TSOptionalType"&&!(n==="TSNamedTupleMember"&&r.optional)&&this.raise(I.OptionalTypeBeforeRequired,r),t||(t=n==="TSNamedTupleMember"&&r.optional||n==="TSOptionalType")}),this.finishNode(e,"TSTupleType")}tsParseTupleElementType(){let{startLoc:e}=this.state,t=this.eat(21),r,n,a,o,c=Te(this.state.type)?this.lookaheadCharCode():null;if(c===58)r=!0,a=!1,n=this.parseIdentifier(!0),this.expect(14),o=this.tsParseType();else if(c===63){a=!0;let u=this.state.startLoc,h=this.state.value,f=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(r=!0,n=this.createIdentifier(this.startNodeAt(u),h),this.expect(17),this.expect(14),o=this.tsParseType()):(r=!1,o=f,this.expect(17))}else o=this.tsParseType(),a=this.eat(17),r=this.eat(14);if(r){let u;n?(u=this.startNodeAtNode(n),u.optional=a,u.label=n,u.elementType=o,this.eat(17)&&(u.optional=!0,this.raise(I.TupleOptionalAfterType,this.state.lastTokStartLoc))):(u=this.startNodeAtNode(o),u.optional=a,this.raise(I.InvalidTupleMemberLabel,o),u.label=o,u.elementType=this.tsParseType()),o=this.finishNode(u,"TSNamedTupleMember")}else if(a){let u=this.startNodeAtNode(o);u.typeAnnotation=o,o=this.finishNode(u,"TSOptionalType")}if(t){let u=this.startNodeAt(e);u.typeAnnotation=o,o=this.finishNode(u,"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":zo(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(I.UnexpectedReadonly,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 co(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(115)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,t,r){let n=this.startNode(),a=this.eat(r),o=[];do o.push(t());while(this.eat(r));return o.length===1&&!a?o[0]:(n.types=o,this.finishNode(n,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(),n=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(n&&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 n?(r.parameterName=this.parseIdentifier(),r.asserts=n,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=n,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(m.InvalidEscapedReservedWord,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(){Oi(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(I.ReservedTypeAssertion,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 n=this.startNode();return n.expression=this.tsParseEntityName(),this.match(47)&&(n.typeParameters=this.tsParseTypeArguments()),this.finishNode(n,"TSExpressionWithTypeArguments")});return r.length||this.raise(I.EmptyHeritageClauseType,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(I.MissingInterfaceName,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 n=this.tsParseModuleReference();return e.importKind==="type"&&n.type!=="TSExternalModuleReference"&&this.raise(I.ImportAliasHasImportType,n),e.moduleReference=n,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 n=this.tsParseInterfaceDeclaration(e,{declare:!0});if(n)return n}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 n=this.tsTryParseDeclare(e);return n&&(n.declare=!0),n}case"global":if(this.match(5)){this.scope.enter(256),this.prodParam.enter(0);let n=e;return n.global=!0,n.id=t,n.body=this.tsParseModuleBlock(),this.scope.exit(),this.prodParam.exit(),this.finishNode(n,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(e,t.name,!1,r)}}tsParseDeclaration(e,t,r,n){switch(t){case"abstract":if(this.tsCheckLineTerminator(r)&&(this.match(80)||R(this.state.type)))return this.tsParseAbstractDeclaration(e,n);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 n=this.startNodeAt(e);return n.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(n),n.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(19),n});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(I.EmptyTypeArguments,e):!this.state.inType&&this.curContext()===V.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return uo(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseAssignableListItem(e,t){let r=this.state.startLoc,n={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},n);let a=n.accessibility,o=n.override,l=n.readonly;!(e&4)&&(a||l||o)&&this.raise(I.UnexpectedParameterModifier,r);let c=this.parseMaybeDefault();e&2&&this.parseFunctionParamType(c);let u=this.parseMaybeDefault(c.loc.start,c);if(a||l||o){let h=this.startNodeAt(r);return t.length&&(h.decorators=t),a&&(h.accessibility=a),l&&(h.readonly=l),o&&(h.override=o),u.type!=="Identifier"&&u.type!=="AssignmentPattern"&&this.raise(I.UnsupportedParameterPropertyKind,h),h.parameter=u,this.finishNode(h,"TSParameterProperty")}return t.length&&(c.decorators=t),u}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(I.PatternIsOptional,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 n=t==="FunctionDeclaration"?"TSDeclareFunction":t==="ClassMethod"||t==="ClassPrivateMethod"?"TSDeclareMethod":void 0;return n&&!this.match(5)&&this.isLineTerminator()?this.finishNode(e,n):n==="TSDeclareFunction"&&this.state.isAmbientContext&&(this.raise(I.DeclareFunctionHasImplementation,e),e.declare)?super.parseFunctionBodyAndFinish(e,n,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(I.UnexpectedTypeAnnotation,t.typeAnnotation)})}toReferencedList(e,t){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,t,r,n){let a=super.parseArrayLike(e,t,r,n);return a.type==="ArrayExpression"&&this.tsCheckForInvalidTypeCasts(a.elements),a}parseSubscript(e,t,r,n){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 n.stop=!0,e;n.optionalChainMember=a=!0,this.next()}if(this.match(47)||this.match(51)){let o,l=this.tsTryParseAndCatch(()=>{if(!r&&this.atPossibleAsyncArrow(e)){let f=this.tsTryParseGenericAsyncArrowFunction(t);if(f)return f}let c=this.tsParseTypeArgumentsInExpression();if(!c)return;if(a&&!this.match(10)){o=this.state.curPosition();return}if(ts(this.state.type)){let f=super.parseTaggedTemplateExpression(e,t,n);return f.typeParameters=c,f}if(!r&&this.eat(10)){let f=this.startNodeAt(t);return f.callee=e,f.arguments=this.parseCallExpressionArguments(11,!1),this.tsCheckForInvalidTypeCasts(f.arguments),f.typeParameters=c,n.optionalChainMember&&(f.optional=a),this.finishCallExpression(f,n.optionalChainMember)}let u=this.state.type;if(u===48||u===52||u!==10&&Hs(u)&&!this.hasPrecedingLineBreak())return;let h=this.startNodeAt(t);return h.expression=e,h.typeParameters=c,this.finishNode(h,"TSInstantiationExpression")});if(o&&this.unexpected(o,10),l)return l.type==="TSInstantiationExpression"&&(this.match(16)||this.match(18)&&this.lookaheadCharCode()!==40)&&this.raise(I.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),l}return super.parseSubscript(e,t,r,n)}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 n;if(Yt(58)>r&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(n=this.isContextual(120)))){let a=this.startNodeAt(t);return a.expression=e,a.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?(n&&this.raise(m.UnexpectedKeyword,this.state.startLoc,{keyword:"const"}),this.tsParseTypeReference()):this.tsParseType())),this.finishNode(a,n?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(a,t,r)}return super.parseExprOp(e,t,r)}checkReservedWord(e,t,r,n){this.state.isAmbientContext||super.checkReservedWord(e,t,r,n)}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(I.ImportReflectionHasImportType,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,n){super.applyImportPhase(e,t,r,n),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(I.TypeImportCannotSpecifyDefaultAndNamed,t),t}parseExport(e,t){if(this.match(83)){this.next();let r=e,n=null;return this.isContextual(130)&&this.isPotentialImportPhase(!1)?n=this.parseMaybeImportPhase(r,!1):r.importKind="value",this.tsParseImportEqualsDeclaration(r,n,!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:n}=this.state,a=super.parseVarStatement(e,t,r||n);if(!n)return a;for(let{id:o,init:l}of a.declarations)l&&(t!=="const"||o.typeAnnotation?this.raise(I.InitializerNotAllowedInAmbientContext,l):Ho(l,this.hasPlugin("estree"))||this.raise(I.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,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=>Mi(r)?e.accessibility===r:!!e[r])}tsIsStartOfStaticBlocks(){return this.isContextual(106)&&this.lookaheadCharCode()===123}parseClassMember(e,t,r){let n=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:n,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:I.InvalidModifierOnTypeParameterPositions},t);let a=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(t,n)&&this.raise(I.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(e,t)):this.parseClassMemberWithIsStatic(e,t,r,!!t.static)};t.declare?this.tsInAmbientContext(a):a()}parseClassMemberWithIsStatic(e,t,r,n){let a=this.tsTryParseIndexSignature(t);if(a){e.body.push(a),t.abstract&&this.raise(I.IndexSignatureHasAbstract,t),t.accessibility&&this.raise(I.IndexSignatureHasAccessibility,t,{modifier:t.accessibility}),t.declare&&this.raise(I.IndexSignatureHasDeclare,t),t.override&&this.raise(I.IndexSignatureHasOverride,t);return}!this.state.inAbstractClass&&t.abstract&&this.raise(I.NonAbstractClassHasAbstractMethod,t),t.override&&(r.hadSuperClass||this.raise(I.OverrideNotInSubClass,t)),super.parseClassMemberWithIsStatic(e,t,r,n)}parsePostMemberNameModifiers(e){this.eat(17)&&(e.optional=!0),e.readonly&&this.match(10)&&this.raise(I.ClassMethodHasReadonly,e),e.declare&&this.match(10)&&this.raise(I.ClassMethodHasDeclare,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 n=this.tryParse(()=>super.parseConditional(e,t));return n.node?(n.error&&(this.state=n.failState),n.node):(n.error&&super.setOptionalParametersError(r,n.error),e)}parseParenItem(e,t){let r=super.parseParenItem(e,t);if(this.eat(17)&&(r.optional=!0,this.resetEndLocation(e)),this.match(14)){let n=this.startNodeAt(t);return n.expression=e,n.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(n,"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(I.ExpectedAmbientAfterExportDeclare,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,n){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(I.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(29)){let{key:t}=e;this.raise(I.AbstractPropertyHasInitializer,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(I.PrivateElementHasAbstract,e),e.accessibility&&this.raise(I.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(I.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,t,r,n,a,o){let l=this.tsTryParseTypeParameters(this.tsParseConstModifier);l&&a&&this.raise(I.ConstructorHasTypeParameters,l);let{declare:c=!1,kind:u}=t;c&&(u==="get"||u==="set")&&this.raise(I.DeclareAccessor,t,{kind:u}),l&&(t.typeParameters=l),super.pushClassMethod(e,t,r,n,a,o)}pushClassPrivateMethod(e,t,r,n){let a=this.tsTryParseTypeParameters(this.tsParseConstModifier);a&&(t.typeParameters=a),super.pushClassPrivateMethod(e,t,r,n)}declareClassPrivateMethodInScope(e,t){e.type!=="TSDeclareMethod"&&(e.type==="MethodDefinition"&&!hasOwnProperty.call(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,n,a,o,l){let c=this.tsTryParseTypeParameters(this.tsParseConstModifier);return c&&(e.typeParameters=c),super.parseObjPropValue(e,t,r,n,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,n,a,o,l;let c,u,h;if(this.hasPlugin("jsx")&&(this.match(142)||this.match(47))){if(c=this.state.clone(),u=this.tryParse(()=>super.parseMaybeAssign(e,t),c),!u.error)return u.node;let{context:p}=this.state,g=p[p.length-1];(g===V.j_oTag||g===V.j_expr)&&p.pop()}if(!((r=u)!=null&&r.error)&&!this.match(47))return super.parseMaybeAssign(e,t);(!c||c===this.state)&&(c=this.state.clone());let f,d=this.tryParse(p=>{var g,y;f=this.tsParseTypeParameters(this.tsParseConstModifier);let b=super.parseMaybeAssign(e,t);return(b.type!=="ArrowFunctionExpression"||(g=b.extra)!=null&&g.parenthesized)&&p(),((y=f)==null?void 0:y.params.length)!==0&&this.resetStartLocationFromNode(b,f),b.typeParameters=f,b},c);if(!d.error&&!d.aborted)return f&&this.reportReservedArrowTypeParam(f),d.node;if(!u&&(Oi(!this.hasPlugin("jsx")),h=this.tryParse(()=>super.parseMaybeAssign(e,t),c),!h.error))return h.node;if((n=u)!=null&&n.node)return this.state=u.failState,u.node;if(d.node)return this.state=d.failState,f&&this.reportReservedArrowTypeParam(f),d.node;if((a=h)!=null&&a.node)return this.state=h.failState,h.node;throw((o=u)==null?void 0:o.error)||d.error||((l=h)==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(I.ReservedArrowTypeParam,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 n=this.tsParseTypeOrTypePredicateAnnotation(14);return(this.canInsertSemicolon()||!this.match(19))&&r(),n});if(t.aborted)return;t.thrown||(t.error&&(this.state=t.failState),e.returnType=t.node)}return super.parseArrow(e)}parseFunctionParamType(e){this.eat(17)&&(e.optional=!0);let t=this.tsTryParseTypeAnnotation();return t&&(e.typeAnnotation=t),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(I.UnexpectedTypeCastInParameter,e):this.raise(I.UnexpectedTypeCastInParameter,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){switch(e){case"TSTypeCastExpression":return!0;case"TSParameterProperty":return"parameter";case"TSNonNullExpression":case"TSInstantiationExpression":return"expression";case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return(r!==64||!t)&&["expression",!0];default:return 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(I.TypeAnnotationAfterAssign,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 n=0;n<e.length;n++){let a=e[n];a?.type==="TSTypeCastExpression"&&(e[n]=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),n=this.getObjectOrClassMethodParams(e)[0];return n&&this.isThisParam(n)?t+1:t}parseCatchClauseParam(){let e=super.parseCatchClauseParam(),t=this.tsTryParseTypeAnnotation();return t&&(e.typeAnnotation=t,this.resetEndLocation(e)),e}tsInAmbientContext(e){let{isAmbientContext:t,strict:r}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return e()}finally{this.state.isAmbientContext=t,this.state.strict=r}}parseClass(e,t,r){let n=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,t,r)}finally{this.state.inAbstractClass=n}}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(I.NonClassMethodPropertyHasAbstractModifer,e),this.tsParseInterfaceDeclaration(e)}else this.unexpected(null,80)}parseMethod(e,t,r,n,a,o,l){let c=super.parseMethod(e,t,r,n,a,o,l);if(c.abstract&&(this.hasPlugin("estree")?!!c.value.body:!!c.body)){let{key:h}=c;this.raise(I.AbstractMethodHasImplementation,c,{methodName:h.type==="Identifier"&&!c.computed?h.name:`[${this.input.slice(h.start,h.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,n){return!t&&n?(this.parseTypeOnlyImportExportSpecifier(e,!1,r),this.finishNode(e,"ExportSpecifier")):(e.exportKind="value",super.parseExportSpecifier(e,t,r,n))}parseImportSpecifier(e,t,r,n,a){return!t&&n?(this.parseTypeOnlyImportExportSpecifier(e,!0,r),this.finishNode(e,"ImportSpecifier")):(e.importKind="value",super.parseImportSpecifier(e,t,r,n,r?4098:4096))}parseTypeOnlyImportExportSpecifier(e,t,r){let n=t?"imported":"local",a=t?"local":"exported",o=e[n],l,c=!1,u=!0,h=o.loc.start;if(this.isContextual(93)){let d=this.parseIdentifier();if(this.isContextual(93)){let p=this.parseIdentifier();Te(this.state.type)?(c=!0,o=d,l=t?this.parseIdentifier():this.parseModuleExportName(),u=!1):(l=p,u=!1)}else Te(this.state.type)?(u=!1,l=t?this.parseIdentifier():this.parseModuleExportName()):(c=!0,o=d)}else Te(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?I.TypeModifierIsUsedInTypeImports:I.TypeModifierIsUsedInTypeExports,h),e[n]=o,e[a]=l;let f=t?"importKind":"exportKind";e[f]=c?"type":"value",u&&this.eatContextual(93)&&(e[a]=t?this.parseIdentifier():this.parseModuleExportName()),e[a]||(e[a]=Fe(e[n])),t&&this.checkIdentifier(e[a],c?4098:4096)}};function Ko(i){if(i.type!=="MemberExpression")return!1;let{computed:s,property:e}=i;return s&&e.type!=="StringLiteral"&&(e.type!=="TemplateLiteral"||e.expressions.length>0)?!1:Yi(i.object)}function Ho(i,s){var e;let{type:t}=i;if((e=i.extra)!=null&&e.parenthesized)return!1;if(s){if(t==="Literal"){let{value:r}=i;if(typeof r=="string"||typeof r=="boolean")return!0}}else if(t==="StringLiteral"||t==="BooleanLiteral")return!0;return!!(Qi(i,s)||Xo(i,s)||t==="TemplateLiteral"&&i.expressions.length===0||Ko(i))}function Qi(i,s){return s?i.type==="Literal"&&(typeof i.value=="number"||"bigint"in i):i.type==="NumericLiteral"||i.type==="BigIntLiteral"}function Xo(i,s){if(i.type==="UnaryExpression"){let{operator:e,argument:t}=i;if(e==="-"&&Qi(t,s))return!0}return!1}function Yi(i){return i.type==="Identifier"?!0:i.type!=="MemberExpression"||i.computed?!1:Yi(i.object)}var Fi=Me`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."}),Go=i=>class extends i{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;return(!r.expectedNode||!r.type)&&(r=this.finishNode(r,"Placeholder")),r.expectedNode=t,r}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,n){e!==void 0&&super.checkReservedWord(e,t,r,n)}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 a=e;return a.label=this.finishPlaceholder(t,"Identifier"),this.next(),a.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(a,"LabeledStatement")}this.semicolon();let n=e;return n.name=t.name,this.finishPlaceholder(n,"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 n=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,n);throw this.raise(Fi.ClassNameIsRequired,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,n)}parseExport(e,t){let r=this.parsePlaceholder("Identifier");if(!r)return super.parseExport(e,t);let n=e;if(!this.isContextual(98)&&!this.match(12))return n.specifiers=[],n.source=null,n.declaration=this.finishPlaceholder(r,"Declaration"),this.finishNode(n,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");let a=this.startNode();return a.exported=r,n.specifiers=[this.finishNode(a,"ExportDefaultSpecifier")],super.parseExport(n,t)}isExportDefaultSpecifier(){if(this.match(65)){let e=this.nextTokenStart();if(this.isUnparsedContextual(e,"from")&&this.input.startsWith(Re(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(Fi.UnexpectedSpace,this.state.lastTokEndLoc)}},Qo=i=>class extends i{parseV8Intrinsic(){if(this.match(54)){let e=this.state.startLoc,t=this.startNode();if(this.next(),R(this.state.type)){let r=this.parseIdentifierName(),n=this.createIdentifier(t,r);if(n.type="V8IntrinsicIdentifier",this.match(10))return n}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}},Bi=["minimal","fsharp","hack","smart"],_i=["^^","@@","^","%","#"];function Yo(i){if(i.has("decorators")){if(i.has("decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");let e=i.get("decorators").decoratorsBeforeExport;if(e!=null&&typeof e!="boolean")throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");let t=i.get("decorators").allowCallParenthesized;if(t!=null&&typeof t!="boolean")throw new Error("'allowCallParenthesized' must be a boolean.")}if(i.has("flow")&&i.has("typescript"))throw new Error("Cannot combine flow and typescript plugins.");if(i.has("placeholders")&&i.has("v8intrinsic"))throw new Error("Cannot combine placeholders and v8intrinsic plugins.");if(i.has("pipelineOperator")){var s;let e=i.get("pipelineOperator").proposal;if(!Bi.includes(e)){let r=Bi.map(n=>`"${n}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${r}.`)}let t=((s=i.get("recordAndTuple"))==null?void 0:s.syntaxType)==="hash";if(e==="hack"){if(i.has("placeholders"))throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");if(i.has("v8intrinsic"))throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");let r=i.get("pipelineOperator").topicToken;if(!_i.includes(r)){let n=_i.map(a=>`"${a}"`).join(", ");throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${n}.`)}if(r==="#"&&t)throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple",i.get("recordAndTuple")])}\`.`)}else if(e==="smart"&&t)throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple",i.get("recordAndTuple")])}\`.`)}if(i.has("moduleAttributes")){if(i.has("importAttributes")||i.has("importAssertions"))throw new Error("Cannot combine importAssertions, importAttributes and moduleAttributes plugins.");if(i.get("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(i.has("importAssertions")&&i.has("importAttributes"))throw new Error("Cannot combine importAssertions and importAttributes plugins.");if(i.has("recordAndTuple")){let e=i.get("recordAndTuple").syntaxType;if(e!=null){let t=["hash","bar"];if(!t.includes(e))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+t.map(r=>`'${r}'`).join(", "))}}if(i.has("asyncDoExpressions")&&!i.has("doExpressions")){let e=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw e.missingPlugins="doExpressions",e}if(i.has("optionalChainingAssign")&&i.get("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 Zi={estree:Za,jsx:$o,flow:Uo,typescript:Jo,v8intrinsic:Qo,placeholders:Go},Zo=Object.keys(Zi),Ws={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 el(i){if(i==null)return Object.assign({},Ws);if(i.annexB!=null&&i.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");let s={};for(let t of Object.keys(Ws)){var e;s[t]=(e=i[t])!=null?e:Ws[t]}return s}var pr=class extends hr{checkProto(s,e,t,r){if(s.type==="SpreadElement"||this.isObjectMethod(s)||s.computed||s.shorthand)return;let n=s.key;if((n.type==="Identifier"?n.name:n.value)==="__proto__"){if(e){this.raise(m.RecordNoProto,n);return}t.used&&(r?r.doubleProtoLoc===null&&(r.doubleProtoLoc=n.loc.start):this.raise(m.DuplicateProto,n)),t.used=!0}}shouldExitDescending(s,e){return s.type==="ArrowFunctionExpression"&&s.start===e}getExpression(){this.enterInitialScopes(),this.nextToken();let s=this.parseExpression();return this.match(139)||this.unexpected(),this.finalizeRemainingComments(),s.comments=this.comments,s.errors=this.state.errors,this.options.tokens&&(s.tokens=this.tokens),s}parseExpression(s,e){return s?this.disallowInAnd(()=>this.parseExpressionBase(e)):this.allowInAnd(()=>this.parseExpressionBase(e))}parseExpressionBase(s){let e=this.state.startLoc,t=this.parseMaybeAssign(s);if(this.match(12)){let r=this.startNodeAt(e);for(r.expressions=[t];this.eat(12);)r.expressions.push(this.parseMaybeAssign(s));return this.toReferencedList(r.expressions),this.finishNode(r,"SequenceExpression")}return t}parseMaybeAssignDisallowIn(s,e){return this.disallowInAnd(()=>this.parseMaybeAssign(s,e))}parseMaybeAssignAllowIn(s,e){return this.allowInAnd(()=>this.parseMaybeAssign(s,e))}setOptionalParametersError(s,e){var t;s.optionalParametersLoc=(t=e?.loc)!=null?t:this.state.startLoc}parseMaybeAssign(s,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;s?r=!1:(s=new rt,r=!0);let{type:n}=this.state;(n===10||R(n))&&(this.state.potentialArrowAt=this.state.start);let a=this.parseMaybeConditional(s);if(e&&(a=e.call(this,a,t)),io(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;s.doubleProtoLoc!=null&&s.doubleProtoLoc.index>=c&&(s.doubleProtoLoc=null),s.shorthandAssignLoc!=null&&s.shorthandAssignLoc.index>=c&&(s.shorthandAssignLoc=null),s.privateKeyLoc!=null&&s.privateKeyLoc.index>=c&&(this.checkDestructuringPrivate(s),s.privateKeyLoc=null)}else o.left=a;return this.next(),o.right=this.parseMaybeAssign(),this.checkLVal(a,this.finishNode(o,"AssignmentExpression")),o}else r&&this.checkExpressionErrors(s,!0);return a}parseMaybeConditional(s){let e=this.state.startLoc,t=this.state.potentialArrowAt,r=this.parseExprOps(s);return this.shouldExitDescending(r,t)?r:this.parseConditional(r,e,s)}parseConditional(s,e,t){if(this.eat(17)){let r=this.startNodeAt(e);return r.test=s,r.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),r.alternate=this.parseMaybeAssign(),this.finishNode(r,"ConditionalExpression")}return s}parseMaybeUnaryOrPrivate(s){return this.match(138)?this.parsePrivateName():this.parseMaybeUnary(s)}parseExprOps(s){let e=this.state.startLoc,t=this.state.potentialArrowAt,r=this.parseMaybeUnaryOrPrivate(s);return this.shouldExitDescending(r,t)?r:this.parseExprOp(r,e,-1)}parseExprOp(s,e,t){if(this.isPrivateName(s)){let n=this.getPrivateNameSV(s);(t>=Yt(58)||!this.prodParam.hasIn||!this.match(58))&&this.raise(m.PrivateInExpectedIn,s,{identifierName:n}),this.classScope.usePrivateName(n,s.loc.start)}let r=this.state.type;if(ao(r)&&(this.prodParam.hasIn||!this.match(58))){let n=Yt(r);if(n>t){if(r===39){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return s;this.checkPipelineAtInfixOperator(s,e)}let a=this.startNodeAt(e);a.left=s,a.operator=this.state.value;let o=r===41||r===42,l=r===40;if(l&&(n=Yt(42)),this.next(),r===39&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])&&this.state.type===96&&this.prodParam.hasAwait)throw this.raise(m.UnexpectedAwaitAfterPipelineBody,this.state.startLoc);a.right=this.parseExprOpRightExpr(r,n);let c=this.finishNode(a,o||l?"LogicalExpression":"BinaryExpression"),u=this.state.type;if(l&&(u===41||u===42)||o&&u===40)throw this.raise(m.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(c,e,t)}}return s}parseExprOpRightExpr(s,e){let t=this.state.startLoc;switch(s){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(m.PipeBodyIsTighter,this.state.startLoc);return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(s,e),t)});case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(e))}default:return this.parseExprOpBaseRightExpr(s,e)}}parseExprOpBaseRightExpr(s,e){let t=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),t,ho(s)?e-1:e)}parseHackPipeBody(){var s;let{startLoc:e}=this.state,t=this.parseMaybeAssign();return Ha.has(t.type)&&!((s=t.extra)!=null&&s.parenthesized)&&this.raise(m.PipeUnparenthesizedBody,e,{type:t.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(m.PipeTopicUnused,e),t}checkExponentialAfterUnary(s){this.match(57)&&this.raise(m.UnexpectedTokenUnaryExponentiation,s.argument)}parseMaybeUnary(s,e){let t=this.state.startLoc,r=this.isContextual(96);if(r&&this.recordAwaitIfAllowed()){this.next();let l=this.parseAwait(t);return e||this.checkExponentialAfterUnary(l),l}let n=this.match(34),a=this.startNode();if(lo(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(s,!0),this.state.strict&&l){let c=a.argument;c.type==="Identifier"?this.raise(m.StrictDelete,a):this.hasPropertyAsPrivateName(c)&&this.raise(m.DeletePrivateField,a)}if(!n)return e||this.checkExponentialAfterUnary(a),this.finishNode(a,"UnaryExpression")}let o=this.parseUpdate(a,n,s);if(r){let{type:l}=this.state;if((this.hasPlugin("v8intrinsic")?Hs(l):Hs(l)&&!this.match(54))&&!this.isAmbiguousAwait())return this.raiseOverwrite(m.AwaitNotInAsyncContext,t),this.parseAwait(t)}return o}parseUpdate(s,e,t){if(e){let a=s;return this.checkLVal(a.argument,this.finishNode(a,"UpdateExpression")),s}let r=this.state.startLoc,n=this.parseExprSubscripts(t);if(this.checkExpressionErrors(t,!1))return n;for(;oo(this.state.type)&&!this.canInsertSemicolon();){let a=this.startNodeAt(r);a.operator=this.state.value,a.prefix=!1,a.argument=n,this.next(),this.checkLVal(n,n=this.finishNode(a,"UpdateExpression"))}return n}parseExprSubscripts(s){let e=this.state.startLoc,t=this.state.potentialArrowAt,r=this.parseExprAtom(s);return this.shouldExitDescending(r,t)?r:this.parseSubscripts(r,e)}parseSubscripts(s,e,t){let r={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(s),stop:!1};do s=this.parseSubscript(s,e,t,r),r.maybeAsyncArrow=!1;while(!r.stop);return s}parseSubscript(s,e,t,r){let{type:n}=this.state;if(!t&&n===15)return this.parseBind(s,e,t,r);if(ts(n))return this.parseTaggedTemplateExpression(s,e,r);let a=!1;if(n===18){if(t&&(this.raise(m.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40))return r.stop=!0,s;r.optionalChainMember=a=!0,this.next()}if(!t&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(s,e,r,a);{let o=this.eat(0);return o||a||this.eat(16)?this.parseMember(s,e,r,o,a):(r.stop=!0,s)}}parseMember(s,e,t,r,n){let a=this.startNodeAt(e);return a.object=s,a.computed=r,r?(a.property=this.parseExpression(),this.expect(3)):this.match(138)?(s.type==="Super"&&this.raise(m.SuperPrivateField,e),this.classScope.usePrivateName(this.state.value,this.state.startLoc),a.property=this.parsePrivateName()):a.property=this.parseIdentifier(!0),t.optionalChainMember?(a.optional=n,this.finishNode(a,"OptionalMemberExpression")):this.finishNode(a,"MemberExpression")}parseBind(s,e,t,r){let n=this.startNodeAt(e);return n.object=s,this.next(),n.callee=this.parseNoCallExpr(),r.stop=!0,this.parseSubscripts(this.finishNode(n,"BindExpression"),e,t)}parseCoverCallAndAsyncArrowHead(s,e,t,r){let n=this.state.maybeInArrowParameters,a=null;this.state.maybeInArrowParameters=!0,this.next();let o=this.startNodeAt(e);o.callee=s;let{maybeAsyncArrow:l,optionalChainMember:c}=t;l&&(this.expressionScope.enter(Do()),a=new rt),c&&(o.optional=r),r?o.arguments=this.parseCallExpressionArguments(11):o.arguments=this.parseCallExpressionArguments(11,s.type==="Import",s.type!=="Super",o,a);let u=this.finishCallExpression(o,c);return l&&this.shouldParseAsyncArrow()&&!r?(t.stop=!0,this.checkDestructuringPrivate(a),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),u=this.parseAsyncArrowFromCallExpression(this.startNodeAt(e),u)):(l&&(this.checkExpressionErrors(a,!0),this.expressionScope.exit()),this.toReferencedArguments(u)),this.state.maybeInArrowParameters=n,u}toReferencedArguments(s,e){this.toReferencedListDeep(s.arguments,e)}parseTaggedTemplateExpression(s,e,t){let r=this.startNodeAt(e);return r.tag=s,r.quasi=this.parseTemplate(!0),t.optionalChainMember&&this.raise(m.OptionalChainingNoTemplate,e),this.finishNode(r,"TaggedTemplateExpression")}atPossibleAsyncArrow(s){return s.type==="Identifier"&&s.name==="async"&&this.state.lastTokEndLoc.index===s.end&&!this.canInsertSemicolon()&&s.end-s.start===5&&s.start===this.state.potentialArrowAt}finishCallExpression(s,e){if(s.callee.type==="Import")if(s.arguments.length===2&&(this.hasPlugin("moduleAttributes")||this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes")),s.arguments.length===0||s.arguments.length>2)this.raise(m.ImportCallArity,s,{maxArgumentCount:this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions")||this.hasPlugin("moduleAttributes")?2:1});else for(let t of s.arguments)t.type==="SpreadElement"&&this.raise(m.ImportCallSpreadArgument,t);return this.finishNode(s,e?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(s,e,t,r,n){let a=[],o=!0,l=this.state.inFSharpPipelineDirectBody;for(this.state.inFSharpPipelineDirectBody=!1;!this.eat(s);){if(o)o=!1;else if(this.expect(12),this.match(s)){e&&!this.hasPlugin("importAttributes")&&!this.hasPlugin("importAssertions")&&!this.hasPlugin("moduleAttributes")&&this.raise(m.ImportCallArgumentTrailingComma,this.state.lastTokStartLoc),r&&this.addTrailingCommaExtraToNode(r),this.next();break}a.push(this.parseExprListItem(!1,n,t))}return this.state.inFSharpPipelineDirectBody=l,a}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(s,e){var t;return this.resetPreviousNodeTrailingComments(e),this.expect(19),this.parseArrowExpression(s,e.arguments,!0,(t=e.extra)==null?void 0:t.trailingCommaLoc),e.innerComments&&Ct(s,e.innerComments),e.callee.trailingComments&&Ct(s,e.callee.trailingComments),s}parseNoCallExpr(){let s=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),s,!0)}parseExprAtom(s){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(m.UnsupportedImport,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 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 n=this.state.potentialArrowAt===this.state.start;return this.parseParenAndDistinguishExpression(n)}case 2:case 1:return this.parseArrayLike(this.state.type===2?4:3,!1,!0);case 0:return this.parseArrayLike(3,!0,!1,s);case 6:case 7:return this.parseObjectLike(this.state.type===6?9:8,!1,!0);case 5:return this.parseObjectLike(8,!1,!1,s);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 n=e.callee=this.parseNoCallExpr();if(n.type==="MemberExpression")return this.finishNode(e,"BindExpression");throw this.raise(m.UnsupportedBind,n)}case 138:return this.raise(m.PrivateInExpectedIn,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 n=this.getPluginOption("pipelineOperator","proposal");if(n)return this.parseTopicReference(n);this.unexpected();break}case 47:{let n=this.input.codePointAt(this.nextTokenStart());Oe(n)||n===62?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected();break}default:if(r===136)return this.parseDecimalLiteral(this.state.value);if(R(r)){if(this.isContextual(127)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let n=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 n&&this.match(19)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(o),[o],!1)):o}else this.unexpected()}}parseTopicReferenceThenEqualsSign(s,e){let t=this.getPluginOption("pipelineOperator","proposal");if(t)return this.state.type=s,this.state.value=e,this.state.pos--,this.state.end--,this.state.endLoc=ne(this.state.endLoc,-1),this.parseTopicReference(t);this.unexpected()}parseTopicReference(s){let e=this.startNode(),t=this.state.startLoc,r=this.state.type;return this.next(),this.finishTopicReference(e,t,s,r)}finishTopicReference(s,e,t,r){if(this.testTopicReferenceConfiguration(t,e,r)){let n=t==="smart"?"PipelinePrimaryTopicReference":"TopicReference";return this.topicReferenceIsAllowedInCurrentContext()||this.raise(t==="smart"?m.PrimaryTopicNotAllowed:m.PipeTopicUnbound,e),this.registerTopicReference(),this.finishNode(s,n)}else throw this.raise(m.PipeTopicUnconfiguredToken,e,{token:Re(r)})}testTopicReferenceConfiguration(s,e,t){switch(s){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:Re(t)}]);case"smart":return t===27;default:throw this.raise(m.PipeTopicRequiresHackPipes,e)}}parseAsyncArrowUnaryFunction(s){this.prodParam.enter(Zt(!0,this.prodParam.hasYield));let e=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(m.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(19),this.parseArrowExpression(s,e,!0)}parseDo(s,e){this.expectPlugin("doExpressions"),e&&this.expectPlugin("asyncDoExpressions"),s.async=e,this.next();let t=this.state.labels;return this.state.labels=[],e?(this.prodParam.enter(2),s.body=this.parseBlock(),this.prodParam.exit()):s.body=this.parseBlock(),this.state.labels=t,this.finishNode(s,"DoExpression")}parseSuper(){let s=this.startNode();return this.next(),this.match(10)&&!this.scope.allowDirectSuper&&!this.options.allowSuperOutsideMethod?this.raise(m.SuperNotAllowed,s):!this.scope.allowSuper&&!this.options.allowSuperOutsideMethod&&this.raise(m.UnexpectedSuper,s),!this.match(10)&&!this.match(0)&&!this.match(16)&&this.raise(m.UnsupportedSuper,s),this.finishNode(s,"Super")}parsePrivateName(){let s=this.startNode(),e=this.startNodeAt(ne(this.state.startLoc,1)),t=this.state.value;return this.next(),s.id=this.createIdentifier(e,t),this.finishNode(s,"PrivateName")}parseFunctionOrFunctionSent(){let s=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(s),"function");return this.next(),this.match(103)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected(),this.parseMetaProperty(s,e,"sent")}return this.parseFunction(s)}parseMetaProperty(s,e,t){s.meta=e;let r=this.state.containsEsc;return s.property=this.parseIdentifier(!0),(s.property.name!==t||r)&&this.raise(m.UnsupportedMetaProperty,s.property,{target:e.name,onlyValidPropertyName:t}),this.finishNode(s,"MetaProperty")}parseImportMetaProperty(s){let e=this.createIdentifier(this.startNodeAtNode(s),"import");if(this.next(),this.isContextual(101))this.inModule||this.raise(m.ImportMetaOutsideModule,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(m.DynamicImportPhaseRequiresImportExpressions,this.state.startLoc,{phase:this.state.value});return this.next(),s.phase=t?"source":"defer",this.parseImportCall(s)}return this.parseMetaProperty(s,e,"meta")}parseLiteralAtNode(s,e,t){return this.addExtra(t,"rawValue",s),this.addExtra(t,"raw",this.input.slice(t.start,this.state.end)),t.value=s,this.next(),this.finishNode(t,e)}parseLiteral(s,e){let t=this.startNode();return this.parseLiteralAtNode(s,e,t)}parseStringLiteral(s){return this.parseLiteral(s,"StringLiteral")}parseNumericLiteral(s){return this.parseLiteral(s,"NumericLiteral")}parseBigIntLiteral(s){return this.parseLiteral(s,"BigIntLiteral")}parseDecimalLiteral(s){return this.parseLiteral(s,"DecimalLiteral")}parseRegExpLiteral(s){let e=this.startNode();return this.addExtra(e,"raw",this.input.slice(e.start,this.state.end)),e.pattern=s.pattern,e.flags=s.flags,this.next(),this.finishNode(e,"RegExpLiteral")}parseBooleanLiteral(s){let e=this.startNode();return e.value=s,this.next(),this.finishNode(e,"BooleanLiteral")}parseNullLiteral(){let s=this.startNode();return this.next(),this.finishNode(s,"NullLiteral")}parseParenAndDistinguishExpression(s){let e=this.state.startLoc,t;this.next(),this.expressionScope.enter(Lo());let r=this.state.maybeInArrowParameters,n=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;let a=this.state.startLoc,o=[],l=new rt,c=!0,u,h;for(;!this.match(11);){if(c)c=!1;else if(this.expect(12,l.optionalParametersLoc===null?null:l.optionalParametersLoc),this.match(11)){h=this.state.startLoc;break}if(this.match(21)){let p=this.state.startLoc;if(u=this.state.startLoc,o.push(this.parseParenItem(this.parseRestBinding(),p)),!this.checkCommaAfterRest(41))break}else o.push(this.parseMaybeAssignAllowIn(l,this.parseParenItem))}let f=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=r,this.state.inFSharpPipelineDirectBody=n;let d=this.startNodeAt(e);return s&&this.shouldParseArrow(o)&&(d=this.parseArrow(d))?(this.checkDestructuringPrivate(l),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(d,o,!1),d):(this.expressionScope.exit(),o.length||this.unexpected(this.state.lastTokStartLoc),h&&this.unexpected(h),u&&this.unexpected(u),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,f)):t=o[0],this.wrapParenthesis(e,t))}wrapParenthesis(s,e){if(!this.options.createParenthesizedExpressions)return this.addExtra(e,"parenthesized",!0),this.addExtra(e,"parenStart",s.index),this.takeSurroundingComments(e,s.index,this.state.lastTokEndLoc.index),e;let t=this.startNodeAt(s);return t.expression=e,this.finishNode(t,"ParenthesizedExpression")}shouldParseArrow(s){return!this.canInsertSemicolon()}parseArrow(s){if(this.eat(19))return s}parseParenItem(s,e){return s}parseNewOrNewTarget(){let s=this.startNode();if(this.next(),this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(s),"new");this.next();let t=this.parseMetaProperty(s,e,"target");return!this.scope.inNonArrowFunction&&!this.scope.inClass&&!this.options.allowNewTargetOutsideFunction&&this.raise(m.UnexpectedNewTarget,t),t}return this.parseNew(s)}parseNew(s){if(this.parseNewCallee(s),this.eat(10)){let e=this.parseExprList(11);this.toReferencedList(e),s.arguments=e}else s.arguments=[];return this.finishNode(s,"NewExpression")}parseNewCallee(s){let e=this.match(83),t=this.parseNoCallExpr();s.callee=t,e&&(t.type==="Import"||t.type==="ImportExpression")&&this.raise(m.ImportCallNotNewExpression,t)}parseTemplateElement(s){let{start:e,startLoc:t,end:r,value:n}=this.state,a=e+1,o=this.startNodeAt(ne(t,1));n===null&&(s||this.raise(m.InvalidEscapeSequenceTemplate,ne(this.state.firstInvalidTemplateEscapePos,1)));let l=this.match(24),c=l?-1:-2,u=r+c;o.value={raw:this.input.slice(a,u).replace(/\r\n?/g,`
|
|
8
|
-
`),cooked:n===null?null:n.slice(1,c)},o.tail=l,this.next();let h=this.finishNode(o,"TemplateElement");return this.resetEndLocation(h,ne(this.state.lastTokEndLoc,c)),h}parseTemplate(s){let e=this.startNode(),t=this.parseTemplateElement(s),r=[t],n=[];for(;!t.tail;)n.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),r.push(t=this.parseTemplateElement(s));return e.expressions=n,e.quasis=r,this.finishNode(e,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(s,e,t,r){t&&this.expectPlugin("recordAndTuple");let n=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let a=Object.create(null),o=!0,l=this.startNode();for(l.properties=[],this.next();!this.match(s);){if(o)o=!1;else if(this.expect(12),this.match(s)){this.addTrailingCommaExtraToNode(l);break}let u;e?u=this.parseBindingProperty():(u=this.parsePropertyDefinition(r),this.checkProto(u,t,a,r)),t&&!this.isObjectProperty(u)&&u.type!=="SpreadElement"&&this.raise(m.InvalidRecordProperty,u),u.shorthand&&this.addExtra(u,"shorthand",!0),l.properties.push(u)}this.next(),this.state.inFSharpPipelineDirectBody=n;let c="ObjectExpression";return e?c="ObjectPattern":t&&(c="RecordExpression"),this.finishNode(l,c)}addTrailingCommaExtraToNode(s){this.addExtra(s,"trailingComma",this.state.lastTokStartLoc.index),this.addExtra(s,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(s){return!s.computed&&s.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(s){let e=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(m.UnsupportedPropertyDecorator,this.state.startLoc);this.match(26);)e.push(this.parseDecorator());let t=this.startNode(),r=!1,n=!1,a;if(this.match(21))return e.length&&this.unexpected(),this.parseSpread();e.length&&(t.decorators=e,e=[]),t.method=!1,s&&(a=this.state.startLoc);let o=this.eat(55);this.parsePropertyNamePrefixOperator(t);let l=this.state.containsEsc;if(this.parsePropertyName(t,s),!o&&!l&&this.maybeAsyncOrAccessorProp(t)){let{key:c}=t,u=c.name;u==="async"&&!this.hasPrecedingLineBreak()&&(r=!0,this.resetPreviousNodeTrailingComments(c),o=this.eat(55),this.parsePropertyName(t)),(u==="get"||u==="set")&&(n=!0,this.resetPreviousNodeTrailingComments(c),t.kind=u,this.match(55)&&(o=!0,this.raise(m.AccessorIsGenerator,this.state.curPosition(),{kind:u}),this.next()),this.parsePropertyName(t))}return this.parseObjPropValue(t,a,o,r,!1,n,s)}getGetterSetterExpectedParamCount(s){return s.kind==="get"?0:1}getObjectOrClassMethodParams(s){return s.params}checkGetterSetterParams(s){var e;let t=this.getGetterSetterExpectedParamCount(s),r=this.getObjectOrClassMethodParams(s);r.length!==t&&this.raise(s.kind==="get"?m.BadGetterArity:m.BadSetterArity,s),s.kind==="set"&&((e=r[r.length-1])==null?void 0:e.type)==="RestElement"&&this.raise(m.BadSetterRestParameter,s)}parseObjectMethod(s,e,t,r,n){if(n){let a=this.parseMethod(s,e,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(a),a}if(t||e||this.match(10))return r&&this.unexpected(),s.kind="method",s.method=!0,this.parseMethod(s,e,t,!1,!1,"ObjectMethod")}parseObjectProperty(s,e,t,r){if(s.shorthand=!1,this.eat(14))return s.value=t?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowIn(r),this.finishNode(s,"ObjectProperty");if(!s.computed&&s.key.type==="Identifier"){if(this.checkReservedWord(s.key.name,s.key.loc.start,!0,!1),t)s.value=this.parseMaybeDefault(e,Fe(s.key));else if(this.match(29)){let n=this.state.startLoc;r!=null?r.shorthandAssignLoc===null&&(r.shorthandAssignLoc=n):this.raise(m.InvalidCoverInitializedName,n),s.value=this.parseMaybeDefault(e,Fe(s.key))}else s.value=Fe(s.key);return s.shorthand=!0,this.finishNode(s,"ObjectProperty")}}parseObjPropValue(s,e,t,r,n,a,o){let l=this.parseObjectMethod(s,t,r,n,a)||this.parseObjectProperty(s,e,n,o);return l||this.unexpected(),l}parsePropertyName(s,e){if(this.eat(0))s.computed=!0,s.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let{type:t,value:r}=this.state,n;if(Te(t))n=this.parseIdentifier(!0);else switch(t){case 134:n=this.parseNumericLiteral(r);break;case 133:n=this.parseStringLiteral(r);break;case 135:n=this.parseBigIntLiteral(r);break;case 138:{let a=this.state.startLoc;e!=null?e.privateKeyLoc===null&&(e.privateKeyLoc=a):this.raise(m.UnexpectedPrivateField,a),n=this.parsePrivateName();break}default:if(t===136){n=this.parseDecimalLiteral(r);break}this.unexpected()}s.key=n,t!==138&&(s.computed=!1)}}initFunction(s,e){s.id=null,s.generator=!1,s.async=e}parseMethod(s,e,t,r,n,a,o=!1){this.initFunction(s,t),s.generator=e,this.scope.enter(18|(o?64:0)|(n?32:0)),this.prodParam.enter(Zt(t,s.generator)),this.parseFunctionParams(s,r);let l=this.parseFunctionBodyAndFinish(s,a,!0);return this.prodParam.exit(),this.scope.exit(),l}parseArrayLike(s,e,t,r){t&&this.expectPlugin("recordAndTuple");let n=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let a=this.startNode();return this.next(),a.elements=this.parseExprList(s,!t,r,a),this.state.inFSharpPipelineDirectBody=n,this.finishNode(a,t?"TupleExpression":"ArrayExpression")}parseArrowExpression(s,e,t,r){this.scope.enter(6);let n=Zt(t,!1);!this.match(5)&&this.prodParam.hasIn&&(n|=8),this.prodParam.enter(n),this.initFunction(s,t);let a=this.state.maybeInArrowParameters;return e&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(s,e,r)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(s,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=a,this.finishNode(s,"ArrowFunctionExpression")}setArrowFunctionParameters(s,e,t){this.toAssignableList(e,t,!1),s.params=e}parseFunctionBodyAndFinish(s,e,t=!1){return this.parseFunctionBody(s,!1,t),this.finishNode(s,e)}parseFunctionBody(s,e,t=!1){let r=e&&!this.match(5);if(this.expressionScope.enter(Xi()),r)s.body=this.parseMaybeAssign(),this.checkParams(s,!1,e,!1);else{let n=this.state.strict,a=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),s.body=this.parseBlock(!0,!1,o=>{let l=!this.isSimpleParamList(s.params);o&&l&&this.raise(m.IllegalLanguageModeDirective,(s.kind==="method"||s.kind==="constructor")&&s.key?s.key.loc.end:s);let c=!n&&this.state.strict;this.checkParams(s,!this.state.strict&&!e&&!t&&!l,e,c),this.state.strict&&s.id&&this.checkIdentifier(s.id,65,c)}),this.prodParam.exit(),this.state.labels=a}this.expressionScope.exit()}isSimpleParameter(s){return s.type==="Identifier"}isSimpleParamList(s){for(let e=0,t=s.length;e<t;e++)if(!this.isSimpleParameter(s[e]))return!1;return!0}checkParams(s,e,t,r=!0){let n=!e&&new Set,a={type:"FormalParameters"};for(let o of s.params)this.checkLVal(o,a,5,n,r)}parseExprList(s,e,t,r){let n=[],a=!0;for(;!this.eat(s);){if(a)a=!1;else if(this.expect(12),this.match(s)){r&&this.addTrailingCommaExtraToNode(r),this.next();break}n.push(this.parseExprListItem(e,t))}return n}parseExprListItem(s,e,t){let r;if(this.match(12))s||this.raise(m.UnexpectedToken,this.state.curPosition(),{unexpected:","}),r=null;else if(this.match(21)){let n=this.state.startLoc;r=this.parseParenItem(this.parseSpread(e),n)}else if(this.match(17)){this.expectPlugin("partialApplication"),t||this.raise(m.UnexpectedArgumentPlaceholder,this.state.startLoc);let n=this.startNode();this.next(),r=this.finishNode(n,"ArgumentPlaceholder")}else r=this.parseMaybeAssignAllowIn(e,this.parseParenItem);return r}parseIdentifier(s){let e=this.startNode(),t=this.parseIdentifierName(s);return this.createIdentifier(e,t)}createIdentifier(s,e){return s.name=e,s.loc.identifierName=e,this.finishNode(s,"Identifier")}parseIdentifierName(s){let e,{startLoc:t,type:r}=this.state;Te(r)?e=this.state.value:this.unexpected();let n=so(r);return s?n&&this.replaceToken(132):this.checkReservedWord(e,t,n,!1),this.next(),e}checkReservedWord(s,e,t,r){if(s.length>10||!So(s))return;if(t&&bo(s)){this.raise(m.UnexpectedKeyword,e,{keyword:s});return}if((this.state.strict?r?Wi:qi:$i)(s,this.inModule)){this.raise(m.UnexpectedReservedWord,e,{reservedWord:s});return}else if(s==="yield"){if(this.prodParam.hasYield){this.raise(m.YieldBindingIdentifier,e);return}}else if(s==="await"){if(this.prodParam.hasAwait){this.raise(m.AwaitBindingIdentifier,e);return}if(this.scope.inStaticBlock){this.raise(m.AwaitBindingIdentifierInStaticBlock,e);return}this.expressionScope.recordAsyncArrowParametersError(e)}else if(s==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(m.ArgumentsInClass,e);return}}recordAwaitIfAllowed(){let s=this.prodParam.hasAwait||this.options.allowAwaitOutsideFunction&&!this.scope.inFunction;return s&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),s}parseAwait(s){let e=this.startNodeAt(s);return this.expressionScope.recordParameterInitializerError(m.AwaitExpressionFormalParameter,e),this.eat(55)&&this.raise(m.ObsoleteAwaitStar,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:s}=this.state;return s===53||s===10||s===0||ts(s)||s===102&&!this.state.containsEsc||s===137||s===56||this.hasPlugin("v8intrinsic")&&s===54}parseYield(){let s=this.startNode();this.expressionScope.recordParameterInitializerError(m.YieldInParameter,s),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 s.delegate=e,s.argument=t,this.finishNode(s,"YieldExpression")}parseImportCall(s){return this.next(),s.source=this.parseMaybeAssignAllowIn(),(this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions"))&&(s.options=null),this.eat(12)&&(this.hasPlugin("moduleAttributes")||this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes"),this.match(11)||(s.options=this.parseMaybeAssignAllowIn(),this.eat(12))),this.expect(11),this.finishNode(s,"ImportExpression")}checkPipelineAtInfixOperator(s,e){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&s.type==="SequenceExpression"&&this.raise(m.PipelineHeadSequenceExpression,e)}parseSmartPipelineBodyInStyle(s,e){if(this.isSimpleReference(s)){let t=this.startNodeAt(e);return t.callee=s,this.finishNode(t,"PipelineBareFunction")}else{let t=this.startNodeAt(e);return this.checkSmartPipeTopicBodyEarlyErrors(e),t.expression=s,this.finishNode(t,"PipelineTopicExpression")}}isSimpleReference(s){switch(s.type){case"MemberExpression":return!s.computed&&this.isSimpleReference(s.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(s){if(this.match(19))throw this.raise(m.PipelineBodyNoArrow,this.state.startLoc);this.topicReferenceWasUsedInCurrentContext()||this.raise(m.PipelineTopicUnused,s)}withTopicBindingContext(s){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return s()}finally{this.state.topicContext=e}}withSmartMixTopicForbiddingContext(s){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return s()}finally{this.state.topicContext=e}}else return s()}withSoloAwaitPermittingContext(s){let e=this.state.soloAwait;this.state.soloAwait=!0;try{return s()}finally{this.state.soloAwait=e}}allowInAnd(s){let e=this.prodParam.currentFlags();if(8&~e){this.prodParam.enter(e|8);try{return s()}finally{this.prodParam.exit()}}return s()}disallowInAnd(s){let e=this.prodParam.currentFlags();if(8&e){this.prodParam.enter(e&-9);try{return s()}finally{this.prodParam.exit()}}return s()}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(s){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,s);return this.state.inFSharpPipelineDirectBody=t,r}parseModuleExpression(){this.expectPlugin("moduleBlocks");let s=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{s.body=this.parseProgram(e,8,"module")}finally{t()}return this.finishNode(s,"ModuleExpression")}parsePropertyNamePrefixOperator(s){}},Js={kind:1},tl={kind:2},sl=/[\uD800-\uDFFF]/u,Ks=/in(?:stanceof)?/y;function rl(i,s){for(let e=0;e<i.length;e++){let t=i[e],{type:r}=t;if(typeof r=="number"){{if(r===138){let{loc:n,start:a,value:o,end:l}=t,c=a+1,u=ne(n.start,1);i.splice(e,1,new we({type:Le(27),value:"#",start:a,end:c,startLoc:n.start,endLoc:u}),new we({type:Le(132),value:o,start:c,end:l,startLoc:u,endLoc:n.end})),e++;continue}if(ts(r)){let{loc:n,start:a,value:o,end:l}=t,c=a+1,u=ne(n.start,1),h;s.charCodeAt(a)===96?h=new we({type:Le(22),value:"`",start:a,end:c,startLoc:n.start,endLoc:u}):h=new we({type:Le(8),value:"}",start:a,end:c,startLoc:n.start,endLoc:u});let f,d,p,g;r===24?(d=l-1,p=ne(n.end,-1),f=o===null?null:o.slice(1,-1),g=new we({type:Le(22),value:"`",start:d,end:l,startLoc:p,endLoc:n.end})):(d=l-2,p=ne(n.end,-2),f=o===null?null:o.slice(1,-2),g=new we({type:Le(23),value:"${",start:d,end:l,startLoc:p,endLoc:n.end})),i.splice(e,1,h,new we({type:Le(20),value:f,start:c,end:d,startLoc:u,endLoc:p}),g),e+=2;continue}}t.type=Le(r)}}return i}var fr=class extends pr{parseTopLevel(s,e){return s.program=this.parseProgram(e),s.comments=this.comments,this.options.tokens&&(s.tokens=rl(this.tokens,this.input)),this.finishNode(s,"File")}parseProgram(s,e=139,t=this.options.sourceType){if(s.sourceType=t,s.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(s,!0,!0,e),this.inModule){if(!this.options.allowUndeclaredExports&&this.scope.undefinedExports.size>0)for(let[n,a]of Array.from(this.scope.undefinedExports))this.raise(m.ModuleExportUndefined,a,{localName:n});this.addExtra(s,"topLevelAwait",this.state.hasTopLevelAwait)}let r;return e===139?r=this.finishNode(s,"Program"):r=this.finishNodeAt(s,"Program",ne(this.state.startLoc,-1)),r}stmtToDirective(s){let e=s;e.type="Directive",e.value=e.expression,delete e.expression;let t=e.value,r=t.value,n=this.input.slice(t.start,t.end),a=t.value=n.slice(1,-1);return this.addExtra(t,"raw",n),this.addExtra(t,"rawValue",a),this.addExtra(t,"expressionValue",r),t.type="DirectiveLiteral",e}parseInterpreterDirective(){if(!this.match(28))return null;let s=this.startNode();return s.value=this.state.value,this.next(),this.finishNode(s,"InterpreterDirective")}isLet(){return this.isContextual(100)?this.hasFollowingBindingAtom():!1}chStartsBindingIdentifier(s,e){if(Oe(s)){if(Ks.lastIndex=e,Ks.test(this.input)){let t=this.codePointAtPos(Ks.lastIndex);if(!tt(t)&&t!==92)return!1}return!0}else return s===92}chStartsBindingPattern(s){return s===91||s===123}hasFollowingBindingAtom(){let s=this.nextTokenStart(),e=this.codePointAtPos(s);return this.chStartsBindingPattern(e)||this.chStartsBindingIdentifier(e,s)}hasInLineFollowingBindingIdentifierOrBrace(){let s=this.nextTokenInLineStart(),e=this.codePointAtPos(s);return e===123||this.chStartsBindingIdentifier(e,s)}startsUsingForOf(){let{type:s,containsEsc:e}=this.lookahead();if(s===102&&!e)return!1;if(R(s)&&!this.hasFollowingLineBreak())return this.expectPlugin("explicitResourceManagement"),!0}startsAwaitUsing(){let s=this.nextTokenInLineStart();if(this.isUnparsedContextual(s,"using")){s=this.nextTokenInLineStartSince(s+5);let e=this.codePointAtPos(s);if(this.chStartsBindingIdentifier(e,s))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(s=!1){let e=0;return this.options.annexB&&!this.state.strict&&(e|=4,s&&(e|=8)),this.parseStatementLike(e)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(s){let e=null;return this.match(26)&&(e=this.parseDecorators(!0)),this.parseStatementContent(s,e)}parseStatementContent(s,e){let t=this.state.type,r=this.startNode(),n=!!(s&2),a=!!(s&4),o=s&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?m.StrictFunction:this.options.annexB?m.SloppyFunctionAnnexB:m.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(r,!1,!n&&a);case 80:return n||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.recordAwaitIfAllowed()?n||this.raise(m.UnexpectedLexicalDeclaration,r):this.raise(m.AwaitUsingNotInAsyncContext,r),this.next(),this.parseVarStatement(r,"await using");break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.expectPlugin("explicitResourceManagement"),!this.scope.inModule&&this.scope.inTopLevel?this.raise(m.UnexpectedUsingDeclaration,this.state.startLoc):n||this.raise(m.UnexpectedLexicalDeclaration,this.state.startLoc),this.parseVarStatement(r,"using");case 100:{if(this.state.containsEsc)break;let u=this.nextTokenStart(),h=this.codePointAtPos(u);if(h!==91&&(!n&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(h,u)&&h!==123))break}case 75:n||this.raise(m.UnexpectedLexicalDeclaration,this.state.startLoc);case 74:{let u=this.state.value;return this.parseVarStatement(r,u)}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 u=this.lookaheadCharCode();if(u===40||u===46)break}case 82:{!this.options.allowImportExportEverywhere&&!o&&this.raise(m.UnexpectedImportExport,this.state.startLoc),this.next();let u;return t===83?(u=this.parseImport(r),u.type==="ImportDeclaration"&&(!u.importKind||u.importKind==="value")&&(this.sawUnambiguousESM=!0)):(u=this.parseExport(r,e),(u.type==="ExportNamedDeclaration"&&(!u.exportKind||u.exportKind==="value")||u.type==="ExportAllDeclaration"&&(!u.exportKind||u.exportKind==="value")||u.type==="ExportDefaultDeclaration")&&(this.sawUnambiguousESM=!0)),this.assertModuleNodeAllowed(u),u}default:if(this.isAsyncFunction())return n||this.raise(m.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(r,!0,!n&&a)}let l=this.state.value,c=this.parseExpression();return R(t)&&c.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(r,l,c,s):this.parseExpressionStatement(r,c,e)}assertModuleNodeAllowed(s){!this.options.allowImportExportEverywhere&&!this.inModule&&this.raise(m.ImportOutsideModule,s)}decoratorsEnabledBeforeExport(){return this.hasPlugin("decorators-legacy")?!0:this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(s,e,t){return s&&(e.decorators&&e.decorators.length>0?(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!="boolean"&&this.raise(m.DecoratorsBeforeAfterExport,e.decorators[0]),e.decorators.unshift(...s)):e.decorators=s,this.resetStartLocationFromNode(e,s[0]),t&&this.resetStartLocationFromNode(t,e)),e}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(s){let e=[];do e.push(this.parseDecorator());while(this.match(26));if(this.match(82))s||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(m.DecoratorExportClass,this.state.startLoc);else if(!this.canHaveLeadingDecorator())throw this.raise(m.UnexpectedLeadingDecorator,this.state.startLoc);return e}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let s=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 n=this.state.startLoc;s.expression=this.parseMaybeDecoratorArguments(t),this.getPluginOption("decorators","allowCallParenthesized")===!1&&s.expression!==t&&this.raise(m.DecoratorArgumentsOutsideParentheses,n)}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")}s.expression=this.parseMaybeDecoratorArguments(t)}}else s.expression=this.parseExprSubscripts();return this.finishNode(s,"Decorator")}parseMaybeDecoratorArguments(s){if(this.eat(10)){let e=this.startNodeAtNode(s);return e.callee=s,e.arguments=this.parseCallExpressionArguments(11,!1),this.toReferencedList(e.arguments),this.finishNode(e,"CallExpression")}return s}parseBreakContinueStatement(s,e){return this.next(),this.isLineTerminator()?s.label=null:(s.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(s,e),this.finishNode(s,e?"BreakStatement":"ContinueStatement")}verifyBreakContinue(s,e){let t;for(t=0;t<this.state.labels.length;++t){let r=this.state.labels[t];if((s.label==null||r.name===s.label.name)&&(r.kind!=null&&(e||r.kind===1)||s.label&&e))break}if(t===this.state.labels.length){let r=e?"BreakStatement":"ContinueStatement";this.raise(m.IllegalBreakContinue,s,{type:r})}}parseDebuggerStatement(s){return this.next(),this.semicolon(),this.finishNode(s,"DebuggerStatement")}parseHeaderExpression(){this.expect(10);let s=this.parseExpression();return this.expect(11),s}parseDoWhileStatement(s){return this.next(),this.state.labels.push(Js),s.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.expect(92),s.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(s,"DoWhileStatement")}parseForStatement(s){this.next(),this.state.labels.push(Js);let e=null;if(this.isContextual(96)&&this.recordAwaitIfAllowed()&&(e=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(10),this.match(13))return e!==null&&this.unexpected(e),this.parseFor(s,null);let t=this.isContextual(100);{let l=this.isContextual(96)&&this.startsAwaitUsing(),c=l||this.isContextual(107)&&this.startsUsingForOf(),u=t&&this.hasFollowingBindingAtom()||c;if(this.match(74)||this.match(75)||u){let h=this.startNode(),f;l?(f="await using",this.recordAwaitIfAllowed()||this.raise(m.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):f=this.state.value,this.next(),this.parseVar(h,!0,f);let d=this.finishNode(h,"VariableDeclaration"),p=this.match(58);return p&&c&&this.raise(m.ForInUsing,d),(p||this.isContextual(102))&&d.declarations.length===1?this.parseForIn(s,d,e):(e!==null&&this.unexpected(e),this.parseFor(s,d))}}let r=this.isContextual(95),n=new rt,a=this.parseExpression(!0,n),o=this.isContextual(102);if(o&&(t&&this.raise(m.ForOfLet,a),e===null&&r&&a.type==="Identifier"&&this.raise(m.ForOfAsync,a)),o||this.match(58)){this.checkDestructuringPrivate(n),this.toAssignable(a,!0);let l=o?"ForOfStatement":"ForInStatement";return this.checkLVal(a,{type:l}),this.parseForIn(s,a,e)}else this.checkExpressionErrors(n,!0);return e!==null&&this.unexpected(e),this.parseFor(s,a)}parseFunctionStatement(s,e,t){return this.next(),this.parseFunction(s,1|(t?2:0)|(e?8:0))}parseIfStatement(s){return this.next(),s.test=this.parseHeaderExpression(),s.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),s.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(s,"IfStatement")}parseReturnStatement(s){return!this.prodParam.hasReturn&&!this.options.allowReturnOutsideFunction&&this.raise(m.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?s.argument=null:(s.argument=this.parseExpression(),this.semicolon()),this.finishNode(s,"ReturnStatement")}parseSwitchStatement(s){this.next(),s.discriminant=this.parseHeaderExpression();let e=s.cases=[];this.expect(5),this.state.labels.push(tl),this.scope.enter(0);let t;for(let r;!this.match(8);)if(this.match(61)||this.match(65)){let n=this.match(61);t&&this.finishNode(t,"SwitchCase"),e.push(t=this.startNode()),t.consequent=[],this.next(),n?t.test=this.parseExpression():(r&&this.raise(m.MultipleDefaultsInSwitch,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(s,"SwitchStatement")}parseThrowStatement(s){return this.next(),this.hasPrecedingLineBreak()&&this.raise(m.NewlineAfterThrow,this.state.lastTokEndLoc),s.argument=this.parseExpression(),this.semicolon(),this.finishNode(s,"ThrowStatement")}parseCatchClauseParam(){let s=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&s.type==="Identifier"?8:0),this.checkLVal(s,{type:"CatchClause"},9),s}parseTryStatement(s){if(this.next(),s.block=this.parseBlock(),s.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(),s.handler=this.finishNode(e,"CatchClause")}return s.finalizer=this.eat(67)?this.parseBlock():null,!s.handler&&!s.finalizer&&this.raise(m.NoCatchOrFinally,s),this.finishNode(s,"TryStatement")}parseVarStatement(s,e,t=!1){return this.next(),this.parseVar(s,!1,e,t),this.semicolon(),this.finishNode(s,"VariableDeclaration")}parseWhileStatement(s){return this.next(),s.test=this.parseHeaderExpression(),this.state.labels.push(Js),s.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(s,"WhileStatement")}parseWithStatement(s){return this.state.strict&&this.raise(m.StrictWith,this.state.startLoc),this.next(),s.object=this.parseHeaderExpression(),s.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(s,"WithStatement")}parseEmptyStatement(s){return this.next(),this.finishNode(s,"EmptyStatement")}parseLabeledStatement(s,e,t,r){for(let a of this.state.labels)a.name===e&&this.raise(m.LabelRedeclaration,t,{labelName:e});let n=no(this.state.type)?1:this.match(71)?2:null;for(let a=this.state.labels.length-1;a>=0;a--){let o=this.state.labels[a];if(o.statementStart===s.start)o.statementStart=this.state.start,o.kind=n;else break}return this.state.labels.push({name:e,kind:n,statementStart:this.state.start}),s.body=r&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),s.label=t,this.finishNode(s,"LabeledStatement")}parseExpressionStatement(s,e,t){return s.expression=e,this.semicolon(),this.finishNode(s,"ExpressionStatement")}parseBlock(s=!1,e=!0,t){let r=this.startNode();return s&&this.state.strictErrors.clear(),this.expect(5),e&&this.scope.enter(0),this.parseBlockBody(r,s,!1,8,t),e&&this.scope.exit(),this.finishNode(r,"BlockStatement")}isValidDirective(s){return s.type==="ExpressionStatement"&&s.expression.type==="StringLiteral"&&!s.expression.extra.parenthesized}parseBlockBody(s,e,t,r,n){let a=s.body=[],o=s.directives=[];this.parseBlockOrModuleBlockBody(a,e?o:void 0,t,r,n)}parseBlockOrModuleBlockBody(s,e,t,r,n){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 u=this.stmtToDirective(c);e.push(u),!o&&u.value.value==="use strict"&&(o=!0,this.setStrict(!0));continue}l=!0,this.state.strictErrors.clear()}s.push(c)}n?.call(this,o),a||this.setStrict(!1),this.next()}parseFor(s,e){return s.init=e,this.semicolon(!1),s.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),s.update=this.match(11)?null:this.parseExpression(),this.expect(11),s.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(s,"ForStatement")}parseForIn(s,e,t){let r=this.match(58);return this.next(),r?t!==null&&this.unexpected(t):s.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(m.ForInOfLoopInitializer,e,{type:r?"ForInStatement":"ForOfStatement"}),e.type==="AssignmentPattern"&&this.raise(m.InvalidLhs,e,{ancestor:{type:"ForStatement"}}),s.left=e,s.right=r?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),s.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(s,r?"ForInStatement":"ForOfStatement")}parseVar(s,e,t,r=!1){let n=s.declarations=[];for(s.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(m.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"}):(t==="const"||t==="using"||t==="await using")&&!(this.match(58)||this.isContextual(102))&&this.raise(m.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:t})),n.push(this.finishNode(a,"VariableDeclarator")),!this.eat(12))break}return s}parseVarId(s,e){let t=this.parseBindingAtom();(e==="using"||e==="await using")&&(t.type==="ArrayPattern"||t.type==="ObjectPattern")&&this.raise(m.UsingDeclarationHasBindingPattern,t.loc.start),this.checkLVal(t,{type:"VariableDeclarator"},e==="var"?5:8201),s.id=t}parseAsyncFunctionExpression(s){return this.parseFunction(s,8)}parseFunction(s,e=0){let t=e&2,r=!!(e&1),n=r&&!(e&4),a=!!(e&8);this.initFunction(s,a),this.match(55)&&(t&&this.raise(m.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),s.generator=!0),r&&(s.id=this.parseFunctionId(n));let o=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(2),this.prodParam.enter(Zt(a,s.generator)),r||(s.id=this.parseFunctionId()),this.parseFunctionParams(s,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(s,r?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),r&&!t&&this.registerFunctionStatementId(s),this.state.maybeInArrowParameters=o,s}parseFunctionId(s){return s||R(this.state.type)?this.parseIdentifier():null}parseFunctionParams(s,e){this.expect(10),this.expressionScope.enter(ko()),s.params=this.parseBindingList(11,41,2|(e?4:0)),this.expressionScope.exit()}registerFunctionStatementId(s){s.id&&this.scope.declareName(s.id.name,!this.options.annexB||this.state.strict||s.generator||s.async?this.scope.treatFunctionsAsVar?5:8201:17,s.id.loc.start)}parseClass(s,e,t){this.next();let r=this.state.strict;return this.state.strict=!0,this.parseClassId(s,e,t),this.parseClassSuper(s),s.body=this.parseClassBody(!!s.superClass,r),this.finishNode(s,e?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}nameIsConstructor(s){return s.type==="Identifier"&&s.name==="constructor"||s.type==="StringLiteral"&&s.value==="constructor"}isNonstaticConstructor(s){return!s.computed&&!s.static&&this.nameIsConstructor(s.key)}parseClassBody(s,e){this.classScope.enter();let t={hadConstructor:!1,hadSuperClass:s},r=[],n=this.startNode();if(n.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(r.length>0)throw this.raise(m.DecoratorSemicolon,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(n,a,t),a.kind==="constructor"&&a.decorators&&a.decorators.length>0&&this.raise(m.DecoratorConstructor,a)}}),this.state.strict=e,this.next(),r.length)throw this.raise(m.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(n,"ClassBody")}parseClassMemberFromModifier(s,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(s,r,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let r=e;return r.computed=!1,r.key=t,r.static=!1,s.body.push(this.parseClassProperty(r)),!0}return this.resetPreviousNodeTrailingComments(t),!1}parseClassMember(s,e,t){let r=this.isContextual(106);if(r){if(this.parseClassMemberFromModifier(s,e))return;if(this.eat(5)){this.parseClassStaticBlock(s,e);return}}this.parseClassMemberWithIsStatic(s,e,t,r)}parseClassMemberWithIsStatic(s,e,t,r){let n=e,a=e,o=e,l=e,c=e,u=n,h=n;if(e.static=r,this.parsePropertyNamePrefixOperator(e),this.eat(55)){u.kind="method";let b=this.match(138);if(this.parseClassElementName(u),b){this.pushClassPrivateMethod(s,a,!0,!1);return}this.isNonstaticConstructor(n)&&this.raise(m.ConstructorIsGenerator,n.key),this.pushClassMethod(s,n,!0,!1,!1,!1);return}let f=!this.state.containsEsc&&R(this.state.type),d=this.parseClassElementName(e),p=f?d.name:null,g=this.isPrivateName(d),y=this.state.startLoc;if(this.parsePostMemberNameModifiers(h),this.isClassMethod()){if(u.kind="method",g){this.pushClassPrivateMethod(s,a,!1,!1);return}let b=this.isNonstaticConstructor(n),P=!1;b&&(n.kind="constructor",t.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(m.DuplicateConstructor,d),b&&this.hasPlugin("typescript")&&e.override&&this.raise(m.OverrideOnConstructor,d),t.hadConstructor=!0,P=t.hadSuperClass),this.pushClassMethod(s,n,!1,!1,b,P)}else if(this.isClassProperty())g?this.pushClassPrivateProperty(s,l):this.pushClassProperty(s,o);else if(p==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(d);let b=this.eat(55);h.optional&&this.unexpected(y),u.kind="method";let P=this.match(138);this.parseClassElementName(u),this.parsePostMemberNameModifiers(h),P?this.pushClassPrivateMethod(s,a,b,!0):(this.isNonstaticConstructor(n)&&this.raise(m.ConstructorIsAsync,n.key),this.pushClassMethod(s,n,b,!0,!1,!1))}else if((p==="get"||p==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(d),u.kind=p;let b=this.match(138);this.parseClassElementName(n),b?this.pushClassPrivateMethod(s,a,!1,!1):(this.isNonstaticConstructor(n)&&this.raise(m.ConstructorIsAccessor,n.key),this.pushClassMethod(s,n,!1,!1,!1,!1)),this.checkGetterSetterParams(n)}else if(p==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(d);let b=this.match(138);this.parseClassElementName(o),this.pushClassAccessorProperty(s,c,b)}else this.isLineTerminator()?g?this.pushClassPrivateProperty(s,l):this.pushClassProperty(s,o):this.unexpected()}parseClassElementName(s){let{type:e,value:t}=this.state;if((e===132||e===133)&&s.static&&t==="prototype"&&this.raise(m.StaticPrototype,this.state.startLoc),e===138){t==="constructor"&&this.raise(m.ConstructorClassPrivateField,this.state.startLoc);let r=this.parsePrivateName();return s.key=r,r}return this.parsePropertyName(s),s.key}parseClassStaticBlock(s,e){var t;this.scope.enter(208);let r=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let n=e.body=[];this.parseBlockOrModuleBlockBody(n,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=r,s.body.push(this.finishNode(e,"StaticBlock")),(t=e.decorators)!=null&&t.length&&this.raise(m.DecoratorStaticBlock,e)}pushClassProperty(s,e){!e.computed&&this.nameIsConstructor(e.key)&&this.raise(m.ConstructorClassField,e.key),s.body.push(this.parseClassProperty(e))}pushClassPrivateProperty(s,e){let t=this.parseClassPrivateProperty(e);s.body.push(t),this.classScope.declarePrivateName(this.getPrivateNameSV(t.key),0,t.key.loc.start)}pushClassAccessorProperty(s,e,t){!t&&!e.computed&&this.nameIsConstructor(e.key)&&this.raise(m.ConstructorClassField,e.key);let r=this.parseClassAccessorProperty(e);s.body.push(r),t&&this.classScope.declarePrivateName(this.getPrivateNameSV(r.key),0,r.key.loc.start)}pushClassMethod(s,e,t,r,n,a){s.body.push(this.parseMethod(e,t,r,n,a,"ClassMethod",!0))}pushClassPrivateMethod(s,e,t,r){let n=this.parseMethod(e,t,r,!1,!1,"ClassPrivateMethod",!0);s.body.push(n);let a=n.kind==="get"?n.static?6:2:n.kind==="set"?n.static?5:1:0;this.declareClassPrivateMethodInScope(n,a)}declareClassPrivateMethodInScope(s,e){this.classScope.declarePrivateName(this.getPrivateNameSV(s.key),e,s.key.loc.start)}parsePostMemberNameModifiers(s){}parseClassPrivateProperty(s){return this.parseInitializer(s),this.semicolon(),this.finishNode(s,"ClassPrivateProperty")}parseClassProperty(s){return this.parseInitializer(s),this.semicolon(),this.finishNode(s,"ClassProperty")}parseClassAccessorProperty(s){return this.parseInitializer(s),this.semicolon(),this.finishNode(s,"ClassAccessorProperty")}parseInitializer(s){this.scope.enter(80),this.expressionScope.enter(Xi()),this.prodParam.enter(0),s.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(s,e,t,r=8331){if(R(this.state.type))s.id=this.parseIdentifier(),e&&this.declareNameFromIdentifier(s.id,r);else if(t||!e)s.id=null;else throw this.raise(m.MissingClassName,this.state.startLoc)}parseClassSuper(s){s.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(s,e){let t=this.parseMaybeImportPhase(s,!0),r=this.maybeParseExportDefaultSpecifier(s,t),n=!r||this.eat(12),a=n&&this.eatExportStar(s),o=a&&this.maybeParseExportNamespaceSpecifier(s),l=n&&(!o||this.eat(12)),c=r||a;if(a&&!o){if(r&&this.unexpected(),e)throw this.raise(m.UnsupportedDecoratorExport,s);return this.parseExportFrom(s,!0),this.finishNode(s,"ExportAllDeclaration")}let u=this.maybeParseExportNamedSpecifiers(s);r&&n&&!a&&!u&&this.unexpected(null,5),o&&l&&this.unexpected(null,98);let h;if(c||u){if(h=!1,e)throw this.raise(m.UnsupportedDecoratorExport,s);this.parseExportFrom(s,c)}else h=this.maybeParseExportDeclaration(s);if(c||u||h){var f;let d=s;if(this.checkExport(d,!0,!1,!!d.source),((f=d.declaration)==null?void 0:f.type)==="ClassDeclaration")this.maybeTakeDecorators(e,d.declaration,d);else if(e)throw this.raise(m.UnsupportedDecoratorExport,s);return this.finishNode(d,"ExportNamedDeclaration")}if(this.eat(65)){let d=s,p=this.parseExportDefaultExpression();if(d.declaration=p,p.type==="ClassDeclaration")this.maybeTakeDecorators(e,p,d);else if(e)throw this.raise(m.UnsupportedDecoratorExport,s);return this.checkExport(d,!0,!0),this.finishNode(d,"ExportDefaultDeclaration")}this.unexpected(null,5)}eatExportStar(s){return this.eat(55)}maybeParseExportDefaultSpecifier(s,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,s.specifiers=[this.finishNode(r,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(s){if(this.isContextual(93)){var e,t;(t=(e=s).specifiers)!=null||(e.specifiers=[]);let r=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),r.exported=this.parseModuleExportName(),s.specifiers.push(this.finishNode(r,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(s){if(this.match(5)){let e=s;e.specifiers||(e.specifiers=[]);let t=e.exportKind==="type";return e.specifiers.push(...this.parseExportSpecifiers(t)),e.source=null,e.declaration=null,this.hasPlugin("importAssertions")&&(e.assertions=[]),!0}return!1}maybeParseExportDeclaration(s){return this.shouldParseExportDeclaration()?(s.specifiers=[],s.source=null,this.hasPlugin("importAssertions")&&(s.assertions=[]),s.declaration=this.parseExportDeclaration(s),!0):!1}isAsyncFunction(){if(!this.isContextual(95))return!1;let s=this.nextTokenInLineStart();return this.isUnparsedContextual(s,"function")}parseExportDefaultExpression(){let s=this.startNode();if(this.match(68))return this.next(),this.parseFunction(s,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(s,13);if(this.match(80))return this.parseClass(s,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(m.DecoratorBeforeExport,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(m.UnsupportedDefaultExport,this.state.startLoc);let e=this.parseMaybeAssignAllowIn();return this.semicolon(),e}parseExportDeclaration(s){return this.match(80)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:s}=this.state;if(R(s)){if(s===95&&!this.state.containsEsc||s===100)return!1;if((s===130||s===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(s,e){this.eatContextual(98)?(s.source=this.parseImportSource(),this.checkExport(s),this.maybeParseImportAttributes(s),this.checkJSONModuleImport(s)):e&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:s}=this.state;return s===26&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?(this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(m.DecoratorBeforeExport,this.state.startLoc),!0):this.isContextual(107)?(this.raise(m.UsingDeclarationExport,this.state.startLoc),!0):this.isContextual(96)&&this.startsAwaitUsing()?(this.raise(m.UsingDeclarationExport,this.state.startLoc),!0):s===74||s===75||s===68||s===80||this.isLet()||this.isAsyncFunction()}checkExport(s,e,t,r){if(e){var n;if(t){if(this.checkDuplicateExports(s,"default"),this.hasPlugin("exportDefaultFrom")){var a;let o=s.declaration;o.type==="Identifier"&&o.name==="from"&&o.end-o.start===4&&!((a=o.extra)!=null&&a.parenthesized)&&this.raise(m.ExportDefaultFromAsIdentifier,o)}}else if((n=s.specifiers)!=null&&n.length)for(let o of s.specifiers){let{exported:l}=o,c=l.type==="Identifier"?l.name:l.value;if(this.checkDuplicateExports(o,c),!r&&o.local){let{local:u}=o;u.type!=="Identifier"?this.raise(m.ExportBindingIsString,o,{localName:u.value,exportName:c}):(this.checkReservedWord(u.name,u.loc.start,!0,!1),this.scope.checkLocalExport(u))}}else if(s.declaration){let o=s.declaration;if(o.type==="FunctionDeclaration"||o.type==="ClassDeclaration"){let{id:l}=o;if(!l)throw new Error("Assertion failure");this.checkDuplicateExports(s,l.name)}else if(o.type==="VariableDeclaration")for(let l of o.declarations)this.checkDeclaration(l.id)}}}checkDeclaration(s){if(s.type==="Identifier")this.checkDuplicateExports(s,s.name);else if(s.type==="ObjectPattern")for(let e of s.properties)this.checkDeclaration(e);else if(s.type==="ArrayPattern")for(let e of s.elements)e&&this.checkDeclaration(e);else s.type==="ObjectProperty"?this.checkDeclaration(s.value):s.type==="RestElement"?this.checkDeclaration(s.argument):s.type==="AssignmentPattern"&&this.checkDeclaration(s.left)}checkDuplicateExports(s,e){this.exportedIdentifiers.has(e)&&(e==="default"?this.raise(m.DuplicateDefaultExport,s):this.raise(m.DuplicateExport,s,{exportName:e})),this.exportedIdentifiers.add(e)}parseExportSpecifiers(s){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),n=this.match(133),a=this.startNode();a.local=this.parseModuleExportName(),e.push(this.parseExportSpecifier(a,n,s,r))}return e}parseExportSpecifier(s,e,t,r){return this.eatContextual(93)?s.exported=this.parseModuleExportName():e?s.exported=Mo(s.local):s.exported||(s.exported=Fe(s.local)),this.finishNode(s,"ExportSpecifier")}parseModuleExportName(){if(this.match(133)){let s=this.parseStringLiteral(this.state.value),e=sl.exec(s.value);return e&&this.raise(m.ModuleExportNameHasLoneSurrogate,s,{surrogateCharCode:e[0].charCodeAt(0)}),s}return this.parseIdentifier(!0)}isJSONModuleImport(s){return s.assertions!=null?s.assertions.some(({key:e,value:t})=>t.value==="json"&&(e.type==="Identifier"?e.name==="type":e.value==="type")):!1}checkImportReflection(s){let{specifiers:e}=s,t=e.length===1?e[0].type:null;if(s.phase==="source")t!=="ImportDefaultSpecifier"&&this.raise(m.SourcePhaseImportRequiresDefault,e[0].loc.start);else if(s.phase==="defer")t!=="ImportNamespaceSpecifier"&&this.raise(m.DeferImportRequiresNamespace,e[0].loc.start);else if(s.module){var r;t!=="ImportDefaultSpecifier"&&this.raise(m.ImportReflectionNotBinding,e[0].loc.start),((r=s.assertions)==null?void 0:r.length)>0&&this.raise(m.ImportReflectionHasAssertion,e[0].loc.start)}}checkJSONModuleImport(s){if(this.isJSONModuleImport(s)&&s.type!=="ExportAllDeclaration"){let{specifiers:e}=s;if(e!=null){let t=e.find(r=>{let n;if(r.type==="ExportSpecifier"?n=r.local:r.type==="ImportSpecifier"&&(n=r.imported),n!==void 0)return n.type==="Identifier"?n.name!=="default":n.value!=="default"});t!==void 0&&this.raise(m.ImportJSONBindingNotDefault,t.loc.start)}}}isPotentialImportPhase(s){return s?!1:this.isContextual(105)||this.isContextual(97)||this.isContextual(127)}applyImportPhase(s,e,t,r){e||(t==="module"?(this.expectPlugin("importReflection",r),s.module=!0):this.hasPlugin("importReflection")&&(s.module=!1),t==="source"?(this.expectPlugin("sourcePhaseImports",r),s.phase="source"):t==="defer"?(this.expectPlugin("deferredImportEvaluation",r),s.phase="defer"):this.hasPlugin("sourcePhaseImports")&&(s.phase=null))}parseMaybeImportPhase(s,e){if(!this.isPotentialImportPhase(e))return this.applyImportPhase(s,e,null),null;let t=this.parseIdentifier(!0),{type:r}=this.state;return(Te(r)?r!==98||this.lookaheadCharCode()===102:r!==12)?(this.resetPreviousIdentifierLeadingComments(t),this.applyImportPhase(s,e,t.name,t.loc.start),null):(this.applyImportPhase(s,e,null),t)}isPrecedingIdImportPhase(s){let{type:e}=this.state;return R(e)?e!==98||this.lookaheadCharCode()===102:e!==12}parseImport(s){return this.match(133)?this.parseImportSourceAndAttributes(s):this.parseImportSpecifiersAndAfter(s,this.parseMaybeImportPhase(s,!1))}parseImportSpecifiersAndAfter(s,e){s.specifiers=[];let r=!this.maybeParseDefaultImportSpecifier(s,e)||this.eat(12),n=r&&this.maybeParseStarImportSpecifier(s);return r&&!n&&this.parseNamedImportSpecifiers(s),this.expectContextual(98),this.parseImportSourceAndAttributes(s)}parseImportSourceAndAttributes(s){var e;return(e=s.specifiers)!=null||(s.specifiers=[]),s.source=this.parseImportSource(),this.maybeParseImportAttributes(s),this.checkImportReflection(s),this.checkJSONModuleImport(s),this.semicolon(),this.finishNode(s,"ImportDeclaration")}parseImportSource(){return this.match(133)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(s,e,t){e.local=this.parseIdentifier(),s.specifiers.push(this.finishImportSpecifier(e,t))}finishImportSpecifier(s,e,t=8201){return this.checkLVal(s.local,{type:e},t),this.finishNode(s,e)}parseImportAttributes(){this.expect(5);let s=[],e=new Set;do{if(this.match(8))break;let t=this.startNode(),r=this.state.value;if(e.has(r)&&this.raise(m.ModuleAttributesWithDuplicateKeys,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(m.ModuleAttributeInvalidValue,this.state.startLoc);t.value=this.parseStringLiteral(this.state.value),s.push(this.finishNode(t,"ImportAttribute"))}while(this.eat(12));return this.expect(8),s}parseModuleAttributes(){let s=[],e=new Set;do{let t=this.startNode();if(t.key=this.parseIdentifier(!0),t.key.name!=="type"&&this.raise(m.ModuleAttributeDifferentFromType,t.key),e.has(t.key.name)&&this.raise(m.ModuleAttributesWithDuplicateKeys,t.key,{key:t.key.name}),e.add(t.key.name),this.expect(14),!this.match(133))throw this.raise(m.ModuleAttributeInvalidValue,this.state.startLoc);t.value=this.parseStringLiteral(this.state.value),s.push(this.finishNode(t,"ImportAttribute"))}while(this.eat(12));return s}maybeParseImportAttributes(s){let e;var t=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),this.hasPlugin("moduleAttributes")?e=this.parseModuleAttributes():(this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes"),e=this.parseImportAttributes()),t=!0}else if(this.isContextual(94)&&!this.hasPrecedingLineBreak())this.hasPlugin("importAttributes")?(this.getPluginOption("importAttributes","deprecatedAssertSyntax")!==!0&&this.raise(m.ImportAttributesUseAssert,this.state.startLoc),this.addExtra(s,"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")?s.assertions=e:s.attributes=e}maybeParseDefaultImportSpecifier(s,e){if(e){let t=this.startNodeAtNode(e);return t.local=e,s.specifiers.push(this.finishImportSpecifier(t,"ImportDefaultSpecifier")),!0}else if(Te(this.state.type))return this.parseImportSpecifierLocal(s,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(s){if(this.match(55)){let e=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(s,e,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(s){let e=!0;for(this.expect(5);!this.eat(8);){if(e)e=!1;else{if(this.eat(14))throw this.raise(m.DestructureNamedImport,this.state.startLoc);if(this.expect(12),this.eat(8))break}let t=this.startNode(),r=this.match(133),n=this.isContextual(130);t.imported=this.parseModuleExportName();let a=this.parseImportSpecifier(t,r,s.importKind==="type"||s.importKind==="typeof",n,void 0);s.specifiers.push(a)}}parseImportSpecifier(s,e,t,r,n){if(this.eatContextual(93))s.local=this.parseIdentifier();else{let{imported:a}=s;if(e)throw this.raise(m.ImportBindingIsString,s,{importName:a.value});this.checkReservedWord(a.name,s.loc.start,!0,!0),s.local||(s.local=Fe(a))}return this.finishImportSpecifier(s,"ImportSpecifier",n)}isThisParam(s){return s.type==="Identifier"&&s.name==="this"}},rs=class extends fr{constructor(s,e,t){s=el(s),super(s,e),this.options=s,this.initializeScopes(),this.plugins=t,this.filename=s.sourceFilename}getScopeHandler(){return vt}parse(){this.enterInitialScopes();let s=this.startNode(),e=this.startNode();return this.nextToken(),s.errors=null,this.parseTopLevel(s,e),s.errors=this.state.errors,s.comments.length=this.state.commentsLen,s}};function il(i,s){var e;if(((e=s)==null?void 0:e.sourceType)==="unambiguous"){s=Object.assign({},s);try{s.sourceType="module";let t=At(s,i),r=t.parse();if(t.sawUnambiguousESM)return r;if(t.ambiguousScriptDifferentAst)try{return s.sourceType="script",At(s,i).parse()}catch{}else r.program.sourceType="script";return r}catch(t){try{return s.sourceType="script",At(s,i).parse()}catch{}throw t}}else return At(s,i).parse()}function nl(i,s){let e=At(s,i);return e.options.strictMode&&(e.state.strict=!0),e.getExpression()}function al(i){let s={};for(let e of Object.keys(i))s[e]=Le(i[e]);return s}var ol=al(to);function At(i,s){let e=rs,t=new Map;if(i!=null&&i.plugins){for(let r of i.plugins){let n,a;typeof r=="string"?n=r:[n,a]=r,t.has(n)||t.set(n,a||{})}Yo(t),e=ll(t)}return new e(i,s,t)}var ji=new Map;function ll(i){let s=[];for(let r of Zo)i.has(r)&&s.push(r);let e=s.join("|"),t=ji.get(e);if(!t){t=rs;for(let r of s)t=Zi[r](t);ji.set(e,t)}return t}It.parse=il;It.parseExpression=nl;It.tokTypes=ol});import{access as Rc,mkdir as Uc,readdir as ea,readFile as Vc,stat as $c,unlink as qc,writeFile as zc}from"node:fs/promises";import{createHash as Wc}from"node:crypto";import{existsSync as ce,readdirSync as Jc,readFileSync as Kc,statSync as Hc,unlinkSync as Xc}from"node:fs";import{homedir as Gc,hostname as Qc}from"node:os";import $ from"node:path";import Zn from"prettier";import Yc from"typescript";import Zc from"launch-editor";async function Wr(i,s){let e=i.resolve("/");for(let t=0;t<20;t++){let r=i.join(s,"package.json"),n=await i.readFile(r);if(n)return JSON.parse(n);if(s===e)break;s=i.dirname(s)}return null}var Hr=Is(Kr(),1);function Xr(){try{let i=(0,Hr.default)();if(i?.name)return i.name}catch{}return"npm"}async function Qr(i){let s=[],e=await Wr(i,i.getRepoRootDir());if(e){let t=await xa(e,i);s.push(...t)}return s}async function xa(i,s){let e=[];if(i&&typeof i=="object"){let t=new Set(Object.keys({...i.dependencies,...i.devDependencies}));for(let r of ba)if(t.has(r)&&!e.some(n=>n.name===r)){let n={name:r};Gr.has(r)&&(n.version=await Gr.get(r)(s)),e.push(n)}}return e}function Ns(i){let s=parseInt(i);return Number.isNaN(s)?void 0:s}var Gr=new Map([["next",async i=>{if(!i.spawnSync)return;let s=Xr(),e=s==="npm"?"npx":s,{stdout:t}=i.spawnSync(e,["next","-v"],{encoding:"utf8"});if(!t)return;let r=t.match(/(Next.js v)([\d.]+)/g);if(!r)return;let n=r[0].split("Next.js v")[1],[a,o,l]=n.split(".");return{major:Ns(a),minor:Ns(o),patch:Ns(l)}}]]),ba=["@shopify/remix-oxygen","@shopify/hydrogen","@builder.io/qwik-city","@remix-run/react","@sveltejs/kit","astro","gatsby","next","nuxt","@builder.io/qwik","@angular/core","react","solid-js","svelte","vue"];import{spawnSync as $t}from"node:child_process";var qr={};ma(qr,{MagicastError:()=>se,builders:()=>jc,detectCodeFormat:()=>Gn,generateCode:()=>$r,loadFile:()=>Bc,parseExpression:()=>Yn,parseModule:()=>Qn,writeFile:()=>_c});import{promises as Cr}from"node:fs";var Ts=Is(Ai(),1),yn=Is(en(),1);function de(i){var s=i.use(G),e=s.Type,t=s.builtInTypes,r=t.number;function n(c){return e.from(u=>r.check(u)&&u>=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 u=typeof c;return!(u==="object"||u==="function")},o.toString());return{geq:n,defaults:a,isPrimitive:l}}function q(i){try{var s=i(),e=s.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}),s.exports=t)}var cl=Object.defineProperty,ul=(i,s,e)=>s in i?cl(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e,ae=(i,s,e)=>(ul(i,typeof s!="symbol"?s+"":s,e),e),gn=Object.prototype,fs=gn.toString,ge=gn.hasOwnProperty,Xe=class{assert(s,e){if(!this.check(s,e)){var t=_r(s);throw new Error(t+" does not match type "+this)}return!0}arrayOf(){let s=this;return new _t(s)}},_t=class extends Xe{constructor(s){super(),this.elemType=s,ae(this,"kind","ArrayType")}toString(){return"["+this.elemType+"]"}check(s,e){return Array.isArray(s)&&s.every(t=>this.elemType.check(t,e))}},ds=class extends Xe{constructor(s){super(),this.value=s,ae(this,"kind","IdentityType")}toString(){return String(this.value)}check(s,e){let t=s===this.value;return!t&&typeof e=="function"&&e(this,s),t}},ms=class extends Xe{constructor(s){super(),this.fields=s,ae(this,"kind","ObjectType")}toString(){return"{ "+this.fields.join(", ")+" }"}check(s,e){return fs.call(s)===fs.call({})&&this.fields.every(t=>t.type.check(s[t.name],e))}},ys=class extends Xe{constructor(s){super(),this.types=s,ae(this,"kind","OrType")}toString(){return this.types.join(" | ")}check(s,e){return this.types.some(t=>t.check(s,!!e))?!0:(typeof e=="function"&&e(this,s),!1)}},He=class extends Xe{constructor(s,e){super(),this.name=s,this.predicate=e,ae(this,"kind","PredicateType")}toString(){return this.name}check(s,e){let t=this.predicate(s,e);return!t&&typeof e=="function"&&e(this,s),t}},Ft=class i{constructor(s,e){this.type=s,this.typeName=e,ae(this,"baseNames",[]),ae(this,"ownFields",Object.create(null)),ae(this,"allSupertypes",Object.create(null)),ae(this,"supertypeList",[]),ae(this,"allFields",Object.create(null)),ae(this,"fieldNames",[]),ae(this,"finalized",!1),ae(this,"buildable",!1),ae(this,"buildParams",[])}isSupertypeOf(s){if(s instanceof i){if(this.finalized!==!0||s.finalized!==!0)throw new Error("");return ge.call(s.allSupertypes,this.typeName)}else throw new Error(s+" is not a Def")}checkAllFields(s,e){var t=this.allFields;if(this.finalized!==!0)throw new Error(""+this.typeName);function r(n){var a=t[n],o=a.type,l=a.getValue(s);return o.check(l,e)}return s!==null&&typeof s=="object"&&Object.keys(t).every(r)}bases(...s){var e=this.baseNames;if(this.finalized){if(s.length!==e.length)throw new Error("");for(var t=0;t<s.length;t++)if(s[t]!==e[t])throw new Error("");return this}return s.forEach(r=>{e.indexOf(r)<0&&e.push(r)}),this}},gs=class{constructor(s,e,t,r){this.name=s,this.type=e,this.defaultFn=t,ae(this,"hidden"),this.hidden=!!r}toString(){return JSON.stringify(this.name)+": "+this.type}getValue(s){var e=s[this.name];return typeof e<"u"||typeof this.defaultFn=="function"&&(e=this.defaultFn.call(s)),e}};function _r(i){return Array.isArray(i)?"["+i.map(_r).join(", ")+"]":i&&typeof i=="object"?"{ "+Object.keys(i).map(function(s){return s+": "+i[s]}).join(", ")+" }":JSON.stringify(i)}function G(i){let s={or(...w){return new ys(w.map(v=>s.from(v)))},from(w,v){if(w instanceof _t||w instanceof ds||w instanceof ms||w instanceof ys||w instanceof He)return w;if(w instanceof Ft)return w.type;if(o.check(w)){if(w.length!==1)throw new Error("only one element type is permitted for typed arrays");return new _t(s.from(w[0]))}if(l.check(w))return new ms(Object.keys(w).map(F=>new gs(F,s.from(w[F],F))));if(typeof w=="function"){var M=e.indexOf(w);if(M>=0)return t[M];if(typeof v!="string")throw new Error("missing name");return new He(v,w)}return new ds(w)},def(w){return ge.call(b,w)?b[w]:b[w]=new k(w)},hasDef(w){return ge.call(b,w)}};var e=[],t=[];function r(w,v){let M=fs.call(v),F=new He(w,z=>fs.call(z)===M);return v&&typeof v.constructor=="function"&&(e.push(v.constructor),t.push(F)),F}let n=r("string","truthy"),a=r("function",function(){}),o=r("array",[]),l=r("object",{}),c=r("RegExp",/./),u=r("Date",new Date),h=r("number",3),f=r("boolean",!0),d=r("null",null),p=r("undefined",void 0),g=typeof BigInt=="function"?r("BigInt",BigInt(1234)):new He("BigInt",()=>!1),y={string:n,function:a,array:o,object:l,RegExp:c,Date:u,number:h,boolean:f,null:d,undefined:p,BigInt:g};var b=Object.create(null);function P(w){if(w&&typeof w=="object"){var v=w.type;if(typeof v=="string"&&ge.call(b,v)){var M=b[v];if(M.finalized)return M}}return null}class k extends Ft{constructor(v){super(new He(v,(M,F)=>this.check(M,F)),v)}check(v,M){if(this.finalized!==!0)throw new Error("prematurely checking unfinalized type "+this.typeName);if(v===null||typeof v!="object")return!1;var F=P(v);return F?M&&F===this?this.checkAllFields(v,M):this.isSupertypeOf(F)?M?F.checkAllFields(v,M)&&this.checkAllFields(v,!1):!0:!1:this.typeName==="SourceLocation"||this.typeName==="Position"?this.checkAllFields(v,M):!1}build(...v){if(this.buildParams=v,this.buildable)return this;this.field("type",String,()=>this.typeName),this.buildable=!0;let M=(z,J,X,me)=>{if(!ge.call(z,J)){var Ie=this.allFields;if(!ge.call(Ie,J))throw new Error(""+J);var qt=Ie[J],oa=qt.type,mt;if(me)mt=X;else if(qt.defaultFn)mt=qt.defaultFn.call(z);else{var la="no value or default function given for field "+JSON.stringify(J)+" of "+this.typeName+"("+this.buildParams.map(function(ca){return Ie[ca]}).join(", ")+")";throw new Error(la)}if(!oa.check(mt))throw new Error(_r(mt)+" does not match field "+qt+" of type "+this.typeName);z[J]=mt}},F=(...z)=>{var J=z.length;if(!this.finalized)throw new Error("attempting to instantiate unfinalized type "+this.typeName);var X=Object.create(L);if(this.buildParams.forEach(function(me,Ie){Ie<J?M(X,me,z[Ie],!0):M(X,me,null,!1)}),Object.keys(this.allFields).forEach(function(me){M(X,me,null,!1)}),X.type!==this.typeName)throw new Error("");return X};return F.from=z=>{if(!this.finalized)throw new Error("attempting to instantiate unfinalized type "+this.typeName);var J=Object.create(L);if(Object.keys(this.allFields).forEach(function(X){ge.call(z,X)?M(J,X,z[X],!0):M(J,X,null,!1)}),J.type!==this.typeName)throw new Error("");return J},Object.defineProperty(E,ue(this.typeName),{enumerable:!0,value:F}),this}field(v,M,F,z){return this.finalized?(console.error("Ignoring attempt to redefine field "+JSON.stringify(v)+" of finalized type "+JSON.stringify(this.typeName)),this):(this.ownFields[v]=new gs(v,s.from(M),F,z),this)}finalize(){if(!this.finalized){var v=this.allFields,M=this.allSupertypes;this.baseNames.forEach(z=>{var J=b[z];if(J instanceof Ft)J.finalize(),vs(v,J.allFields),vs(M,J.allSupertypes);else{var X="unknown supertype name "+JSON.stringify(z)+" for subtype "+JSON.stringify(this.typeName);throw new Error(X)}}),vs(v,this.ownFields),M[this.typeName]=this,this.fieldNames.length=0;for(var F in v)ge.call(v,F)&&!v[F].hidden&&this.fieldNames.push(F);Object.defineProperty(zr,this.typeName,{enumerable:!0,value:this.type}),this.finalized=!0,na(this.typeName,this.supertypeList),this.buildable&&this.supertypeList.lastIndexOf("Expression")>=0&&ia(this.typeName)}}}function T(w){if(!ge.call(b,w))throw new Error("");var v=b[w];if(v.finalized!==!0)throw new Error("");return v.supertypeList.slice(1)}function A(w){for(var v={},M=Object.keys(b),F=M.length,z=0;z<F;++z){var J=M[z],X=b[J];if(X.finalized!==!0)throw new Error(""+J);for(var me=0;me<X.supertypeList.length;++me){var Ie=X.supertypeList[me];if(ge.call(w,Ie)){v[J]=Ie;break}}}return v}var E=Object.create(null),L={};function W(w,v){var M=L[w];return p.check(v)?delete L[w]:(a.assert(v),Object.defineProperty(L,w,{enumerable:!0,configurable:!0,value:v})),M}function ue(w){return w.replace(/^[A-Z]+/,function(v){var M=v.length;switch(M){case 0:return"";case 1:return v.toLowerCase();default:return v.slice(0,M-1).toLowerCase()+v.charAt(M-1)}})}function Ee(w){return w=ue(w),w.replace(/(Expression)?$/,"Statement")}var zr={};function Es(w){var v=P(w);if(v)return v.fieldNames.slice(0);if("type"in w)throw new Error("did not recognize object of type "+JSON.stringify(w.type));return Object.keys(w)}function ws(w,v){var M=P(w);if(M){var F=M.allFields[v];if(F)return F.getValue(w)}return w&&w[v]}function sa(w,v,M){Es(w).forEach(function(F){v.call(this,F,ws(w,F))},M)}function ra(w,v,M){return Es(w).some(function(F){return v.call(this,F,ws(w,F))},M)}function ia(w){var v=Ee(w);if(E[v])return;var M=E[ue(w)];if(!M)return;let F=function(...z){return E.expressionStatement(M.apply(E,z))};F.from=function(...z){return E.expressionStatement(M.from.apply(E,z))},E[v]=F}function na(w,v){v.length=0,v.push(w);for(var M=Object.create(null),F=0;F<v.length;++F){w=v[F];var z=b[w];if(z.finalized!==!0)throw new Error("");ge.call(M,w)&&delete v[M[w]],M[w]=F,v.push.apply(v,z.baseNames)}for(var J=0,X=J,me=v.length;X<me;++X)ge.call(v,X)&&(v[J++]=v[X]);v.length=J}function vs(w,v){return Object.keys(v).forEach(function(M){w[M]=v[M]}),w}function aa(){Object.keys(b).forEach(function(w){b[w].finalize()})}return{Type:s,builtInTypes:y,getSupertypeNames:T,computeSupertypeLookupTable:A,builders:E,defineMethod:W,getBuilderName:ue,getStatementBuilderName:Ee,namedTypes:zr,getFieldNames:Es,getFieldValue:ws,eachField:sa,someField:ra,finalize:aa}}q(()=>module);var hl=Object.prototype,is=hl.hasOwnProperty;function xn(i){var s=i.use(G),e=s.builtInTypes.array,t=s.builtInTypes.number;let r=function h(f,d,p){if(!(this instanceof h))throw new Error("Path constructor cannot be invoked without 'new'");if(d){if(!(d instanceof h))throw new Error("")}else d=null,p=null;this.value=f,this.parentPath=d,this.name=p,this.__childCache=null};var n=r.prototype;function a(h){return h.__childCache||(h.__childCache=Object.create(null))}function o(h,f){var d=a(h),p=h.getValueProperty(f),g=d[f];return(!is.call(d,f)||g.value!==p)&&(g=d[f]=new h.constructor(p,h,f)),g}n.getValueProperty=function(f){return this.value[f]},n.get=function(...f){for(var d=this,p=f.length,g=0;g<p;++g)d=o(d,f[g]);return d},n.each=function(f,d){for(var p=[],g=this.value.length,y=0,y=0;y<g;++y)is.call(this.value,y)&&(p[y]=this.get(y));for(d=d||this,y=0;y<g;++y)is.call(p,y)&&f.call(d,p[y])},n.map=function(f,d){var p=[];return this.each(function(g){p.push(f.call(this,g))},d),p},n.filter=function(f,d){var p=[];return this.each(function(g){f.call(this,g)&&p.push(g)},d),p};function l(){}function c(h,f,d,p){if(e.assert(h.value),f===0)return l;var g=h.value.length;if(g<1)return l;var y=arguments.length;y===2?(d=0,p=g):y===3?(d=Math.max(d,0),p=g):(d=Math.max(d,0),p=Math.min(p,g)),t.assert(d),t.assert(p);for(var b=Object.create(null),P=a(h),k=d;k<p;++k)if(is.call(h.value,k)){var T=h.get(k);if(T.name!==k)throw new Error("");var A=k+f;T.name=A,b[A]=T,delete P[k]}return delete P.length,function(){for(var E in b){var L=b[E];if(L.name!==+E)throw new Error("");P[E]=L,h.value[E]=L.value}}}n.shift=function(){var f=c(this,-1),d=this.value.shift();return f(),d},n.unshift=function(...f){var d=c(this,f.length),p=this.value.unshift.apply(this.value,f);return d(),p},n.push=function(...f){return e.assert(this.value),delete a(this).length,this.value.push.apply(this.value,f)},n.pop=function(){e.assert(this.value);var f=a(this);return delete f[this.value.length-1],delete f.length,this.value.pop()},n.insertAt=function(f){var d=arguments.length,p=c(this,d-1,f);if(p===l&&d<=1)return this;f=Math.max(f,0);for(var g=1;g<d;++g)this.value[f+g-1]=arguments[g];return p(),this},n.insertBefore=function(...f){for(var d=this.parentPath,p=f.length,g=[this.name],y=0;y<p;++y)g.push(f[y]);return d.insertAt.apply(d,g)},n.insertAfter=function(...f){for(var d=this.parentPath,p=f.length,g=[this.name+1],y=0;y<p;++y)g.push(f[y]);return d.insertAt.apply(d,g)};function u(h){if(!(h instanceof r))throw new Error("");var f=h.parentPath;if(!f)return h;var d=f.value,p=a(f);if(d[h.name]===h.value)p[h.name]=h;else if(e.check(d)){var g=d.indexOf(h.value);g>=0&&(p[h.name=g]=h)}else d[h.name]=h.value,p[h.name]=h;if(d[h.name]!==h.value)throw new Error("");if(h.parentPath.get(h.name)!==h)throw new Error("");return h}return n.replace=function(f){var d=[],p=this.parentPath.value,g=a(this.parentPath),y=arguments.length;if(u(this),e.check(p)){for(var b=p.length,P=c(this.parentPath,y-1,this.name+1),k=[this.name,1],T=0;T<y;++T)k.push(arguments[T]);var A=p.splice.apply(p,k);if(A[0]!==this.value)throw new Error("");if(p.length!==b-1+y)throw new Error("");if(P(),y===0)delete this.value,delete g[this.name],this.__childCache=null;else{if(p[this.name]!==f)throw new Error("");for(this.value!==f&&(this.value=f,this.__childCache=null),T=0;T<y;++T)d.push(this.parentPath.get(this.name+T));if(d[0]!==this)throw new Error("")}}else if(y===1)this.value!==f&&(this.__childCache=null),this.value=p[this.name]=f,d.push(this);else if(y===0)delete p[this.name],delete this.value,this.__childCache=null;else throw new Error("Could not replace path");return d},r}q(()=>module);var ot=Object.prototype.hasOwnProperty;function pl(i){var s=i.use(G),e=s.Type,t=s.namedTypes,r=t.Node,n=t.Expression,a=s.builtInTypes.array,o=s.builders;let l=function T(A,E){if(!(this instanceof T))throw new Error("Scope constructor cannot be invoked without 'new'");u.check(A.value)||c.assert(A.value);var L;if(E){if(!(E instanceof T))throw new Error("");L=E.depth+1}else E=null,L=0;Object.defineProperties(this,{path:{value:A},node:{value:A.value},isGlobal:{value:!E,enumerable:!0},depth:{value:L},parent:{value:E},bindings:{value:{}},types:{value:{}}})};var c=e.or(t.Program,t.Function,t.CatchClause),u=e.or(t.Function,t.ClassDeclaration,t.ClassExpression,t.InterfaceDeclaration,t.TSInterfaceDeclaration,t.TypeAlias,t.TSTypeAliasDeclaration),h=e.or(t.TypeParameter,t.TSTypeParameter);l.isEstablishedBy=function(T){return c.check(T)||u.check(T)};var f=l.prototype;f.didScan=!1,f.declares=function(T){return this.scan(),ot.call(this.bindings,T)},f.declaresType=function(T){return this.scan(),ot.call(this.types,T)},f.declareTemporary=function(T){if(T){if(!/^[a-z$_]/i.test(T))throw new Error("")}else T="t$";T+=this.depth.toString(36)+"$",this.scan();for(var A=0;this.declares(T+A);)++A;var E=T+A;return this.bindings[E]=s.builders.identifier(E)},f.injectTemporary=function(T,A){T||(T=this.declareTemporary());var E=this.path.get("body");return t.BlockStatement.check(E.value)&&(E=E.get("body")),E.unshift(o.variableDeclaration("var",[o.variableDeclarator(T,A||null)])),T},f.scan=function(T){if(T||!this.didScan){for(var A in this.bindings)delete this.bindings[A];for(var A in this.types)delete this.types[A];d(this.path,this.bindings,this.types),this.didScan=!0}},f.getBindings=function(){return this.scan(),this.bindings},f.getTypes=function(){return this.scan(),this.types};function d(T,A,E){var L=T.value;if(u.check(L)){let W=T.get("typeParameters","params");a.check(W.value)&&W.each(ue=>{k(ue,E)})}c.check(L)&&(t.CatchClause.check(L)?b(T.get("param"),A):p(T,A,E))}function p(T,A,E){var L=T.value;T.parent&&t.FunctionExpression.check(T.parent.node)&&T.parent.node.id&&b(T.parent.get("id"),A),L&&(a.check(L)?T.each(W=>{y(W,A,E)}):t.Function.check(L)?(T.get("params").each(W=>{b(W,A)}),y(T.get("body"),A,E),p(T.get("typeParameters"),A,E)):t.TypeAlias&&t.TypeAlias.check(L)||t.InterfaceDeclaration&&t.InterfaceDeclaration.check(L)||t.TSTypeAliasDeclaration&&t.TSTypeAliasDeclaration.check(L)||t.TSInterfaceDeclaration&&t.TSInterfaceDeclaration.check(L)?P(T.get("id"),E):t.VariableDeclarator.check(L)?(b(T.get("id"),A),y(T.get("init"),A,E)):L.type==="ImportSpecifier"||L.type==="ImportNamespaceSpecifier"||L.type==="ImportDefaultSpecifier"?b(T.get(L.local?"local":L.name?"name":"id"),A):r.check(L)&&!n.check(L)&&s.eachField(L,function(W,ue){var Ee=T.get(W);if(!g(Ee,ue))throw new Error("");y(Ee,A,E)}))}function g(T,A){return!!(T.value===A||Array.isArray(T.value)&&T.value.length===0&&Array.isArray(A)&&A.length===0)}function y(T,A,E){var L=T.value;if(!(!L||n.check(L)))if(t.FunctionDeclaration.check(L)&&L.id!==null)b(T.get("id"),A);else if(t.ClassDeclaration&&t.ClassDeclaration.check(L)&&L.id!==null)b(T.get("id"),A),p(T.get("typeParameters"),A,E);else if(t.InterfaceDeclaration&&t.InterfaceDeclaration.check(L)||t.TSInterfaceDeclaration&&t.TSInterfaceDeclaration.check(L))P(T.get("id"),E);else if(c.check(L)){if(t.CatchClause.check(L)&&t.Identifier.check(L.param)){var W=L.param.name,ue=ot.call(A,W);p(T.get("body"),A,E),ue||delete A[W]}}else p(T,A,E)}function b(T,A){var E=T.value;t.Pattern.assert(E),t.Identifier.check(E)?ot.call(A,E.name)?A[E.name].push(T):A[E.name]=[T]:t.AssignmentPattern&&t.AssignmentPattern.check(E)?b(T.get("left"),A):t.ObjectPattern&&t.ObjectPattern.check(E)?T.get("properties").each(function(L){var W=L.value;t.Pattern.check(W)?b(L,A):t.Property.check(W)||t.ObjectProperty&&t.ObjectProperty.check(W)?b(L.get("value"),A):t.SpreadProperty&&t.SpreadProperty.check(W)&&b(L.get("argument"),A)}):t.ArrayPattern&&t.ArrayPattern.check(E)?T.get("elements").each(function(L){var W=L.value;t.Pattern.check(W)?b(L,A):t.SpreadElement&&t.SpreadElement.check(W)&&b(L.get("argument"),A)}):t.PropertyPattern&&t.PropertyPattern.check(E)?b(T.get("pattern"),A):(t.SpreadElementPattern&&t.SpreadElementPattern.check(E)||t.RestElement&&t.RestElement.check(E)||t.SpreadPropertyPattern&&t.SpreadPropertyPattern.check(E))&&b(T.get("argument"),A)}function P(T,A){var E=T.value;t.Pattern.assert(E),t.Identifier.check(E)&&(ot.call(A,E.name)?A[E.name].push(T):A[E.name]=[T])}function k(T,A){var E=T.value;h.assert(E),ot.call(A,E.name)?A[E.name].push(T):A[E.name]=[T]}return f.lookup=function(T){for(var A=this;A&&!A.declares(T);A=A.parent);return A},f.lookupType=function(T){for(var A=this;A&&!A.declaresType(T);A=A.parent);return A},f.getGlobalScope=function(){for(var T=this;!T.isGlobal;)T=T.parent;return T},l}q(()=>module);function bn(i){var s=i.use(G),e=s.namedTypes,t=s.builders,r=s.builtInTypes.number,n=s.builtInTypes.array,a=i.use(xn),o=i.use(pl);let l=function y(b,P,k){if(!(this instanceof y))throw new Error("NodePath constructor cannot be invoked without 'new'");a.call(this,b,P,k)};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 y=this.parent;return this.replace(),p(y)},c._computeNode=function(){var y=this.value;if(e.Node.check(y))return y;var b=this.parentPath;return b&&b.node||null},c._computeParent=function(){var y=this.value,b=this.parentPath;if(!e.Node.check(y)){for(;b&&!e.Node.check(b.value);)b=b.parentPath;b&&(b=b.parentPath)}for(;b&&!e.Node.check(b.value);)b=b.parentPath;return b||null},c._computeScope=function(){var y=this.value,b=this.parentPath,P=b&&b.scope;return e.Node.check(y)&&o.isEstablishedBy(y)&&(P=new o(this,P)),P||null},c.getValueProperty=function(y){return s.getFieldValue(this.value,y)},c.needsParens=function(y){var b=this.parentPath;if(!b)return!1;var P=this.value;if(!e.Expression.check(P)||P.type==="Identifier")return!1;for(;!e.Node.check(b.value);)if(b=b.parentPath,!b)return!1;var k=b.value;switch(P.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return k.type==="MemberExpression"&&this.name==="object"&&k.object===P;case"BinaryExpression":case"LogicalExpression":switch(k.type){case"CallExpression":return this.name==="callee"&&k.callee===P;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return this.name==="object"&&k.object===P;case"BinaryExpression":case"LogicalExpression":{let T=P,A=k.operator,E=h[A],L=T.operator,W=h[L];if(E>W)return!0;if(E===W&&this.name==="right"){if(k.right!==T)throw new Error("Nodes must be equal");return!0}}default:return!1}case"SequenceExpression":switch(k.type){case"ForStatement":return!1;case"ExpressionStatement":return this.name!=="expression";default:return!0}case"YieldExpression":switch(k.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 k.type==="MemberExpression"&&r.check(P.value)&&this.name==="object"&&k.object===P;case"AssignmentExpression":case"ConditionalExpression":switch(k.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":return this.name==="callee"&&k.callee===P;case"ConditionalExpression":return this.name==="test"&&k.test===P;case"MemberExpression":return this.name==="object"&&k.object===P;default:return!1}default:if(k.type==="NewExpression"&&this.name==="callee"&&k.callee===P)return f(P)}return!!(y!==!0&&!this.canBeFirstInStatement()&&this.firstInStatement())};function u(y){return e.BinaryExpression.check(y)||e.LogicalExpression.check(y)}var h={};[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(y,b){y.forEach(function(P){h[P]=b})});function f(y){return e.CallExpression.check(y)?!0:n.check(y)?y.some(f):e.Node.check(y)?s.someField(y,function(b,P){return f(P)}):!1}c.canBeFirstInStatement=function(){var y=this.node;return!e.FunctionExpression.check(y)&&!e.ObjectExpression.check(y)},c.firstInStatement=function(){return d(this)};function d(y){for(var b,P;y.parent;y=y.parent){if(b=y.node,P=y.parent.node,e.BlockStatement.check(P)&&y.parent.name==="body"&&y.name===0){if(P.body[0]!==b)throw new Error("Nodes must be equal");return!0}if(e.ExpressionStatement.check(P)&&y.name==="expression"){if(P.expression!==b)throw new Error("Nodes must be equal");return!0}if(e.SequenceExpression.check(P)&&y.parent.name==="expressions"&&y.name===0){if(P.expressions[0]!==b)throw new Error("Nodes must be equal");continue}if(e.CallExpression.check(P)&&y.name==="callee"){if(P.callee!==b)throw new Error("Nodes must be equal");continue}if(e.MemberExpression.check(P)&&y.name==="object"){if(P.object!==b)throw new Error("Nodes must be equal");continue}if(e.ConditionalExpression.check(P)&&y.name==="test"){if(P.test!==b)throw new Error("Nodes must be equal");continue}if(u(P)&&y.name==="left"){if(P.left!==b)throw new Error("Nodes must be equal");continue}if(e.UnaryExpression.check(P)&&!P.prefix&&y.name==="argument"){if(P.argument!==b)throw new Error("Nodes must be equal");continue}return!1}return!0}function p(y){if(e.VariableDeclaration.check(y.node)){var b=y.get("declarations").value;if(!b||b.length===0)return y.prune()}else if(e.ExpressionStatement.check(y.node)){if(!y.get("expression").value)return y.prune()}else e.IfStatement.check(y.node)&&g(y);return y}function g(y){var b=y.get("test").value,P=y.get("alternate").value,k=y.get("consequent").value;if(!k&&!P){var T=t.expressionStatement(b);y.replace(T)}else if(!k&&P){var A=t.unaryExpression("!",b,!0);e.UnaryExpression.check(b)&&b.operator==="!"&&(A=b.argument),y.get("test").replace(A),y.get("consequent").replace(P),y.get("alternate").replace()}}return l}q(()=>module);var ns=Object.prototype.hasOwnProperty;function fl(i){var s=i.use(G),e=i.use(bn),t=s.builtInTypes.array,r=s.builtInTypes.object,n=s.builtInTypes.function,a;let o=function p(){if(!(this instanceof p))throw new Error("PathVisitor constructor cannot be invoked without 'new'");this._reusableContextStack=[],this._methodNameTable=l(this),this._shouldVisitComments=ns.call(this._methodNameTable,"Block")||ns.call(this._methodNameTable,"Line"),this.Context=f(this),this._visiting=!1,this._changeReported=!1};function l(p){var g=Object.create(null);for(var y in p)/^visit[A-Z]/.test(y)&&(g[y.slice(5)]=!0);for(var b=s.computeSupertypeLookupTable(g),P=Object.create(null),k=Object.keys(b),T=k.length,A=0;A<T;++A){var E=k[A];y="visit"+b[E],n.check(p[y])&&(P[E]=y)}return P}o.fromMethodsObject=function(g){if(g instanceof o)return g;if(!r.check(g))return new o;let y=function P(){if(!(this instanceof P))throw new Error("Visitor constructor cannot be invoked without 'new'");o.call(this)};var b=y.prototype=Object.create(u);return b.constructor=y,c(b,g),c(y,o),n.assert(y.fromMethodsObject),n.assert(y.visit),new y};function c(p,g){for(var y in g)ns.call(g,y)&&(p[y]=g[y]);return p}o.visit=function(g,y){return o.fromMethodsObject(y).visit(g)};var u=o.prototype;u.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 p=arguments.length,g=new Array(p),y=0;y<p;++y)g[y]=arguments[y];g[0]instanceof e||(g[0]=new e({root:g[0]}).get("root")),this.reset.apply(this,g);var b;try{var P=this.visitWithoutReset(g[0]);b=!0}finally{if(this._visiting=!1,!b&&this._abortRequested)return g[0].value}return P},u.AbortRequest=function(){},u.abort=function(){var p=this;p._abortRequested=!0;var g=new p.AbortRequest;throw g.cancel=function(){p._abortRequested=!1},g},u.reset=function(p){},u.visitWithoutReset=function(p){if(this instanceof this.Context)return this.visitor.visitWithoutReset(p);if(!(p instanceof e))throw new Error("");var g=p.value,y=g&&typeof g=="object"&&typeof g.type=="string"&&this._methodNameTable[g.type];if(y){var b=this.acquireContext(p);try{return b.invokeVisitorMethod(y)}finally{this.releaseContext(b)}}else return h(p,this)};function h(p,g){if(!(p instanceof e))throw new Error("");if(!(g instanceof o))throw new Error("");var y=p.value;if(t.check(y))p.each(g.visitWithoutReset,g);else if(r.check(y)){var b=s.getFieldNames(y);g._shouldVisitComments&&y.comments&&b.indexOf("comments")<0&&b.push("comments");for(var P=b.length,k=[],T=0;T<P;++T){var A=b[T];ns.call(y,A)||(y[A]=s.getFieldValue(y,A)),k.push(p.get(A))}for(var T=0;T<P;++T)g.visitWithoutReset(k[T])}return p.value}u.acquireContext=function(p){return this._reusableContextStack.length===0?new this.Context(p):this._reusableContextStack.pop().reset(p)},u.releaseContext=function(p){if(!(p instanceof this.Context))throw new Error("");this._reusableContextStack.push(p),p.currentPath=null},u.reportChanged=function(){this._changeReported=!0},u.wasChangeReported=function(){return this._changeReported};function f(p){function g(b){if(!(this instanceof g))throw new Error("");if(!(this instanceof o))throw new Error("");if(!(b instanceof e))throw new Error("");Object.defineProperty(this,"visitor",{value:p,writable:!1,enumerable:!0,configurable:!1}),this.currentPath=b,this.needToCallTraverse=!0,Object.seal(this)}if(!(p instanceof o))throw new Error("");var y=g.prototype=Object.create(p);return y.constructor=g,c(y,d),g}var d=Object.create(null);return d.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},d.invokeVisitorMethod=function(g){if(!(this instanceof this.Context))throw new Error("");if(!(this.currentPath instanceof e))throw new Error("");var y=this.visitor[g].call(this,this.currentPath);if(y===!1?this.needToCallTraverse=!1:y!==a&&(this.currentPath=this.currentPath.replace(y)[0],this.needToCallTraverse&&this.traverse(this.currentPath)),this.needToCallTraverse!==!1)throw new Error("Must either call this.traverse or return false in "+g);var b=this.currentPath;return b&&b.value},d.traverse=function(g,y){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,h(g,o.fromMethodsObject(y||this.visitor))},d.visit=function(g,y){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(y||this.visitor).visitWithoutReset(g)},d.reportChanged=function(){this.visitor.reportChanged()},d.abort=function(){this.needToCallTraverse=!1,this.visitor.abort()},o}q(()=>module);function dl(i){var s=i.use(G),e=s.getFieldNames,t=s.getFieldValue,r=s.builtInTypes.array,n=s.builtInTypes.object,a=s.builtInTypes.Date,o=s.builtInTypes.RegExp,l=Object.prototype.hasOwnProperty;function c(p,g,y){return r.check(y)?y.length=0:y=null,h(p,g,y)}c.assert=function(p,g){var y=[];if(!c(p,g,y))if(y.length===0){if(p!==g)throw new Error("Nodes must be equal")}else throw new Error("Nodes differ in the following path: "+y.map(u).join(""))};function u(p){return/[_$a-z][_$a-z0-9]*/i.test(p)?"."+p:"["+JSON.stringify(p)+"]"}function h(p,g,y){return p===g?!0:r.check(p)?f(p,g,y):n.check(p)?d(p,g,y):a.check(p)?a.check(g)&&+p==+g:o.check(p)?o.check(g)&&p.source===g.source&&p.global===g.global&&p.multiline===g.multiline&&p.ignoreCase===g.ignoreCase:p==g}function f(p,g,y){r.assert(p);var b=p.length;if(!r.check(g)||g.length!==b)return y&&y.push("length"),!1;for(var P=0;P<b;++P){if(y&&y.push(P),P in p!=P in g||!h(p[P],g[P],y))return!1;if(y){var k=y.pop();if(k!==P)throw new Error(""+k)}}return!0}function d(p,g,y){if(n.assert(p),!n.check(g))return!1;if(p.type!==g.type)return y&&y.push("type"),!1;var b=e(p),P=b.length,k=e(g),T=k.length;if(P===T){for(var A=0;A<P;++A){var E=b[A],L=t(p,E),W=t(g,E);if(y&&y.push(E),!h(L,W,y))return!1;if(y){var ue=y.pop();if(ue!==E)throw new Error(""+ue)}}return!0}if(!y)return!1;var Ee=Object.create(null);for(A=0;A<P;++A)Ee[b[A]]=!0;for(A=0;A<T;++A){if(E=k[A],!l.call(Ee,E))return y.push(E),!1;delete Ee[E]}for(E in Ee){y.push(E);break}return!1}return c}q(()=>module);function ml(i){let s=yl(),e=s.use(G);i.forEach(s.use),e.finalize();let t=s.use(fl);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:s.use(dl),finalize:e.finalize,Path:s.use(xn),NodePath:s.use(bn),PathVisitor:t,use:s.use,visit:t.visit}}function yl(){let i=[],s=[];function e(r){var n=i.indexOf(r);return n===-1&&(n=i.length,i.push(r),s[n]=r(t)),s[n]}var t={use:e};return t}q(()=>module);function Tn(){return{BinaryOperators:["==","!=","===","!==","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof"],AssignmentOperators:["=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&="],LogicalOperators:["||","&&"]}}q(()=>module);function Pn(i){let s=i.use(Tn);return s.BinaryOperators.indexOf("**")<0&&s.BinaryOperators.push("**"),s.AssignmentOperators.indexOf("**=")<0&&s.AssignmentOperators.push("**="),s}q(()=>module);function Sn(i){let s=i.use(Pn);return s.LogicalOperators.indexOf("??")<0&&s.LogicalOperators.push("??"),s}q(()=>module);function gl(i){let s=i.use(Sn);return s.LogicalOperators.forEach(e=>{let t=e+"=";s.AssignmentOperators.indexOf(t)<0&&s.AssignmentOperators.push(t)}),s}q(()=>module);function xl(i){var s=i.use(G),e=s.Type,t=e.def,r=e.or,n=i.use(de),a=n.defaults,o=n.geq;let{BinaryOperators:l,AssignmentOperators:c,LogicalOperators:u}=i.use(Tn);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 h=r("-","+","!","~","typeof","void","delete");t("UnaryExpression").bases("Expression").build("operator","argument","prefix").field("operator",h).field("argument",t("Expression")).field("prefix",Boolean,a.true);let f=r(...l);t("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",f).field("left",t("Expression")).field("right",t("Expression"));let d=r(...c);t("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",d).field("left",r(t("Pattern"),t("MemberExpression"))).field("right",t("Expression"));var p=r("++","--");t("UpdateExpression").bases("Expression").build("operator","argument","prefix").field("operator",p).field("argument",t("Expression")).field("prefix",Boolean);var g=r(...u);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 y=this.property.type;return y==="Literal"||y==="MemberExpression"||y==="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)}q(()=>module);function bl(i){i.use(xl);let s=i.use(G),e=s.Type.def,t=s.Type.or,r=i.use(de).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 n=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",n),e("ClassBody").bases("Declaration").build("body").field("body",[n]),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"))}q(()=>module);function Tl(i){i.use(Pn),i.use(bl)}q(()=>module);function Pl(i){i.use(Tl);let e=i.use(G).Type.def,t=i.use(de).defaults;e("Function").field("async",Boolean,t.false),e("AwaitExpression").bases("Expression").build("argument").field("argument",e("Expression"))}q(()=>module);function Sl(i){i.use(Pl);let s=i.use(G),e=s.Type.def,t=s.Type.or,r=i.use(de).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"))])}q(()=>module);function Al(i){i.use(Sl);let s=i.use(G),e=s.Type.def,t=s.Type.or,r=i.use(de).defaults;e("CatchClause").field("param",t(e("Pattern"),null),r.null)}q(()=>module);function El(i){i.use(Sn),i.use(Al);let s=i.use(G),e=s.Type.def,t=s.Type.or,n=i.use(de).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),n.null),e("ChainElement").bases("Node").field("optional",Boolean,n.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,n.true),e("OptionalMemberExpression").bases("MemberExpression").build("object","property","computed","optional").field("optional",Boolean,n.true)}q(()=>module);function wl(i){i.use(gl),i.use(El)}q(()=>module);function vl(i){i.use(wl);let e=i.use(G).Type.def;e("StaticBlock").bases("Declaration").build("body").field("body",[e("Statement")])}q(()=>module);function Vt(i){i.use(vl);let s=i.use(G),e=s.Type,t=s.Type.def,r=e.or,a=i.use(de).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"))}q(()=>module);function Cl(i){i.use(Vt);let s=i.use(G),e=s.Type.def,t=s.Type.or,r=i.use(de).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 n=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",n,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",n).field("attributes",a,r.emptyArray).field("selfClosing",Boolean,r.false),e("JSXClosingElement").bases("Node").build("name").field("name",n),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"))}q(()=>module);function An(i){var s=i.use(G),e=s.Type.def,t=s.Type.or,r=i.use(de).defaults,n=t(e("TypeAnnotation"),e("TSTypeAnnotation"),null),a=t(e("TypeParameterDeclaration"),e("TSTypeParameterDeclaration"),null);e("Identifier").field("typeAnnotation",n,r.null),e("ObjectPattern").field("typeAnnotation",n,r.null),e("Function").field("returnType",n,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",n,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)})}q(()=>module);function En(i){i.use(Vt),i.use(An);let s=i.use(G),e=s.Type.def,t=s.Type.or,r=i.use(de).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 n=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",n,r.null),e("ObjectTypeIndexer").bases("Node").build("id","key","value").field("id",e("Identifier")).field("key",e("FlowType")).field("value",e("FlowType")).field("variance",n,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",n,r.null).field("bound",t(e("TypeAnnotation"),null),r.null).field("default",t(e("FlowType"),null),r.null),e("ClassProperty").field("variance",n,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"))}q(()=>module);function Il(i){i.use(Vt);var s=i.use(G),e=i.use(de).defaults,t=s.Type.def,r=s.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")}q(()=>module);function wn(i){i.use(Vt);let s=i.use(G),e=i.use(de).defaults,t=s.Type.def,r=s.Type.or,{undefined:n}=s.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(u=String,h){return["extra",{rawValue:u,raw:String},function(){let d=s.getFieldValue(this,"value");return{rawValue:d,raw:h?h(d):String(d)}}]}t("StringLiteral").bases("Literal").build("value").field("value",String).field(...a(String,u=>JSON.stringify(u))),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,u=>u+"n")),t("DecimalLiteral").bases("Literal").build("value").field("value",String).field(...a(String,u=>u+"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,n),u=>`/${u.pattern}/${u.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(u=>{t(u).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(u=>{t(u).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()}q(()=>module);function Nl(i){let e=i.use(G).Type.def;i.use(wn),i.use(En),e("V8IntrinsicIdentifier").bases("Expression").build("name").field("name",String),e("TopicReference").bases("Expression").build()}q(()=>module);function kl(i){i.use(wn),i.use(An);var s=i.use(G),e=s.namedTypes,t=s.Type.def,r=s.Type.or,n=i.use(de).defaults,a=s.Type.from(function(u,h){return!!(e.StringLiteral&&e.StringLiteral.check(u,h)||e.Literal&&e.Literal.check(u,h)&&typeof u.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),n.null),t("TSHasOptionalTypeParameters").field("typeParameters",r(t("TSTypeParameterDeclaration"),null,void 0),n.null),t("TSHasOptionalTypeAnnotation").field("typeAnnotation",r(t("TSTypeAnnotation"),null),n.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),n.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(u=>{t(u).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(u=>{t(u).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(u=>{t(u).bases("TSType","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters").field("parameters",l)}),t("TSDeclareFunction").bases("Declaration","TSHasOptionalTypeParameters").build("id","params","returnType").field("declare",Boolean,n.false).field("async",Boolean,n.false).field("generator",Boolean,n.false).field("id",r(t("Identifier"),null),n.null).field("params",[t("Pattern")]).field("returnType",r(t("TSTypeAnnotation"),t("Noop"),null),n.null),t("TSDeclareMethod").bases("Declaration","TSHasOptionalTypeParameters").build("key","params","returnType").field("async",Boolean,n.false).field("generator",Boolean,n.false).field("params",[t("Pattern")]).field("abstract",Boolean,n.false).field("accessibility",r("public","private","protected",void 0),n.undefined).field("static",Boolean,n.false).field("computed",Boolean,n.false).field("optional",Boolean,n.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),n.undefined).field("decorators",r([t("Decorator")],null),n.null).field("returnType",r(t("TSTypeAnnotation"),t("Noop"),null),n.null),t("TSMappedType").bases("TSType").build("typeParameter","typeAnnotation").field("readonly",r(Boolean,"+","-"),n.false).field("typeParameter",t("TSTypeParameter")).field("optional",r(Boolean,"+","-"),n.false).field("typeAnnotation",r(t("TSType"),null),n.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,n.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,n.false),t("TSPropertySignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("key","typeAnnotation","optional").field("key",t("Expression")).field("computed",Boolean,n.false).field("readonly",Boolean,n.false).field("optional",Boolean,n.false).field("initializer",r(t("Expression"),null),n.null),t("TSMethodSignature").bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("key","parameters","typeAnnotation").field("key",t("Expression")).field("computed",Boolean,n.false).field("optional",Boolean,n.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),n.null).field("asserts",Boolean,n.false),["TSCallSignatureDeclaration","TSConstructSignatureDeclaration"].forEach(u=>{t(u).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),n.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),n.undefined).field("default",r(t("TSType"),void 0),n.undefined),t("TSTypeAssertion").bases("Expression","Pattern").build("typeAnnotation","expression").field("typeAnnotation",t("TSType")).field("expression",t("Expression")).field("extra",r({parenthesized:Boolean},null),n.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,n.false).field("declare",Boolean,n.false).field("members",[t("TSEnumMember")]).field("initializer",r(t("Expression"),null),n.null),t("TSTypeAliasDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","typeAnnotation").field("id",t("Identifier")).field("declare",Boolean,n.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,n.false).field("global",Boolean,n.false).field("body",r(t("TSModuleBlock"),t("TSModuleDeclaration"),null),n.null),t("TSImportType").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("argument","qualifier","typeParameters").field("argument",a).field("qualifier",r(o,void 0),n.undefined),t("TSImportEqualsDeclaration").bases("Declaration").build("id","moduleReference").field("id",t("Identifier")).field("isExport",Boolean,n.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,n.false).field("extends",r([t("TSExpressionWithTypeArguments")],null),n.null).field("body",t("TSInterfaceBody")),t("TSParameterProperty").bases("Pattern").build("parameter").field("accessibility",r("public","private","protected",void 0),n.undefined).field("readonly",Boolean,n.false).field("parameter",r(t("Identifier"),t("AssignmentPattern"))),t("ClassProperty").field("access",r("public","private","protected",void 0),n.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)])}q(()=>module);var Se;Se||(Se={});var{astNodesAreEquivalent:Ou,builders:dt,builtInTypes:Ae,defineMethod:Mu,eachField:Fu,finalize:Bu,getBuilderName:_u,getFieldNames:Ll,getFieldValue:Be,getSupertypeNames:ju,namedTypes:Dl,NodePath:Ol,Path:Ru,PathVisitor:Uu,someField:Ml,Type:Vu,use:$u,visit:qu}=ml([Vt,Cl,En,Il,Nl,kl]);Object.assign(Se,Dl);var as=Se,tn=Ts.default.SourceMapConsumer,Fl=Ts.default.SourceMapGenerator,vn=Object.prototype.hasOwnProperty;function Bl(){return`
|
|
9
|
-
`
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
`))}slice(s,e){if(!e){if(!s)return this;e=this.lastPos()}if(!s)throw new Error("cannot slice with end but not start");let t=this.infos.slice(s.line-1,e.line);s.line===e.line?t[0]=ct(t[0],s.column,e.column):(t[0]=ct(t[0],s.column),t.push(ct(t.pop(),0,e.column)));let r=new i(t);if(this.mappings.length>0){let n=r.mappings;this.mappings.forEach(function(a){let o=a.slice(this,s,e);o&&n.push(o)},this)}return r}bootstrapSliceString(s,e,t){return this.slice(s,e).toString(t)}sliceString(s=this.firstPos(),e=this.lastPos(),t){let{tabWidth:r,useTabs:n,reuseWhitespace:a,lineTerminator:o}=Ss(t),l=[];for(let c=s.line;c<=e.line;++c){let u=this.infos[c-1];c===s.line?c===e.line?u=ct(u,s.column,e.column):u=ct(u,s.column):c===e.line&&(u=ct(u,0,e.column));let h=Math.max(u.indent,0),f=u.line.slice(0,u.sliceStart);if(a&<(f)&&Nn(f,r)===h){l.push(u.line.slice(0,u.sliceEnd));continue}let d=0,p=h;n&&(d=Math.floor(h/r),p-=d*r);let g="";d>0&&(g+=new Array(d+1).join(" ")),p>0&&(g+=new Array(p+1).join(" ")),g+=u.line.slice(u.sliceStart,u.sliceEnd),l.push(g)}return l.join(o)}isEmpty(){return this.length<2&&this.getLineLength(1)<1}join(s){let e=this,t=[],r=[],n;function a(c){if(c!==null){if(n){let u=c.infos[0],h=new Array(u.indent+1).join(" "),f=t.length,d=Math.max(n.indent,0)+n.sliceEnd-n.sliceStart;n.line=n.line.slice(0,n.sliceEnd)+h+u.line.slice(u.sliceStart,u.sliceEnd),n.locked=n.locked||u.locked,n.sliceEnd=n.line.length,c.mappings.length>0&&c.mappings.forEach(function(p){r.push(p.add(f,d))})}else c.mappings.length>0&&r.push.apply(r,c.mappings);c.infos.forEach(function(u,h){(!n||h>0)&&(n={...u},t.push(n))})}}function o(c,u){u>0&&a(e),a(c)}if(s.map(function(c){let u=S(c);return u.isEmpty()?null:u}).forEach((c,u)=>{e.isEmpty()?a(c):o(c,u)}),t.length<1)return Ke;let l=new i(t);return l.mappings=r,l}concat(...s){let e=[this];return e.push.apply(e,s),Ke.join(e)}},hs={},Lr=hs.hasOwnProperty,Wl=10;function Nn(i,s){let e=0,t=i.length;for(let r=0;r<t;++r)switch(i.charCodeAt(r)){case 9:{let n=Math.ceil(e/s)*s;n===e?e+=s:e=n;break}case 11:case 12:case 13:case 65279:break;case 32:default:e+=1;break}return e}var Jl=/^\s*/,Dr=/\u000D\u000A|\u000D(?!\u000A)|\u000A|\u2028|\u2029/;function S(i,s){if(i instanceof pt)return i;i+="";let e=s&&s.tabWidth,t=i.indexOf(" ")<0,r=!s&&t&&i.length<=Wl;if(r&&Lr.call(hs,i))return hs[i];let n=new pt(i.split(Dr).map(function(a){let o=Jl.exec(a)[0];return{line:a,indent:Nn(o,e),locked:!1,sliceStart:o.length,sliceEnd:a.length}}),Ss(s).sourceFileName);return r&&(hs[i]=n),n}function lt(i){return!/\S/.test(i)}function ct(i,s,e){let t=i.sliceStart,r=i.sliceEnd,n=Math.max(i.indent,0),a=n+r-t;return typeof e>"u"&&(e=a),s=Math.max(s,0),e=Math.min(e,a),e=Math.max(e,s),e<n?(n=e,r=t):r-=a-e,a=e,a-=s,s<n?n-=s:(s-=n,n=0,t+=s),i.indent===n&&i.sliceStart===t&&i.sliceEnd===r?i:{line:i.line,indent:n,locked:!1,sliceStart:t,sliceEnd:r}}function x(i){return Ke.join(i)}var Ke=S(""),ft=Se,kn=Ae.array,Kl=Ae.object,nn=new WeakMap;function Ln(i,s,e){if(!i)return e;if(jr(i,s),e){if(ft.Node.check(i)&&ft.SourceLocation.check(i.loc)){let r=e.length-1;for(;r>=0;--r){let n=e[r];if(n&&n.loc&&U(n.loc.end,i.loc.start)<=0)break}return e.splice(r+1,0,i),e}}else{let r=nn.get(i);if(r)return r}let t;if(kn.check(i))t=Object.keys(i);else if(Kl.check(i))t=Ll(i);else return e;e||nn.set(i,e=[]);for(let r=0,n=t.length;r<n;++r)Ln(i[t[r]],s,e);return e}function Dn(i,s,e){let t=Ln(i,e),r=0,n=t&&t.length,a,o;for(;typeof n=="number"&&r<n;){let l=r+n>>1,c=t[l];if(U(c.loc.start,s.loc.start)<=0&&U(s.loc.end,c.loc.end)<=0){Dn(s.enclosingNode=c,s,e);return}if(U(c.loc.end,s.loc.start)<=0){a=c,r=l+1;continue}if(U(s.loc.end,c.loc.start)<=0){o=c,n=l;continue}throw new Error("Comment location overlaps with node location")}a&&(s.precedingNode=a),o&&(s.followingNode=o)}function Hl(i,s,e){if(!kn.check(i))return;let t=[];i.forEach(function(r){r.loc.lines=e,Dn(s,r,e);let n=r.precedingNode,a=r.enclosingNode,o=r.followingNode;if(n&&o){let l=t.length;l>0&&t[l-1].followingNode!==r.followingNode&&kt(t,e),t.push(r)}else if(n)kt(t,e),Mn(n,r);else if(o)kt(t,e),On(o,r);else if(a)kt(t,e),Xl(a,r);else throw new Error("AST contains no nodes at all?")}),kt(t,e),i.forEach(function(r){delete r.precedingNode,delete r.enclosingNode,delete r.followingNode})}function kt(i,s){let e=i.length;if(e===0)return;let t=i[0].precedingNode,r=i[0].followingNode,n=r.loc.start,a=e,o;for(;a>0;--a){o=i[a-1];let l=s.sliceString(o.loc.end,n);if(/\S/.test(l))break;n=o.loc.start}for(;a<=e&&(o=i[a])&&(o.type==="Line"||o.type==="CommentLine")&&o.loc.start.column>r.loc.start.column;)++a;if(a){let{enclosingNode:l}=i[a-1];l?.type==="CallExpression"&&--a}i.forEach(function(l,c){c<a?Mn(t,l):On(r,l)}),i.length=0}function Rr(i,s){(i.comments||(i.comments=[])).push(s)}function On(i,s){s.leading=!0,s.trailing=!1,Rr(i,s)}function Xl(i,s){s.leading=!1,s.trailing=!1,Rr(i,s)}function Mn(i,s){s.leading=!1,s.trailing=!0,Rr(i,s)}function Gl(i,s){let e=i.getValue();ft.Comment.assert(e);let t=e.loc,r=t&&t.lines,n=[s(i)];if(e.trailing)n.push(`
|
|
13
|
-
|
|
14
|
-
`))}else n.push(`
|
|
15
|
-
|
|
16
|
-
`))}return n.push(s(i)),x(n)}function an(i,s){let e=i.getValue(),t=s(i),r=ft.Node.check(e)&&Be(e,"comments");if(!r||r.length===0)return t;let n=[],a=[t];return i.each(function(o){let l=o.getValue(),c=Be(l,"leading"),u=Be(l,"trailing");c||u&&!(ft.Statement.check(e)||l.type==="Block"||l.type==="CommentBlock")?n.push(Gl(o,s)):u&&a.push(Ql(o,s))},"comments"),n.push.apply(n,a),x(n)}var Yl=dt,Zl=Ae.object,ec=Ae.array;function Fn(i,s){s=Ss(s);let e=S(i,s),t=e.toString({tabWidth:s.tabWidth,reuseWhitespace:!1,useTabs:!1}),r=[],n=s.parser.parse(t,{jsx:!0,loc:!0,locations:!0,range:s.range,comment:!0,onComment:r,tolerant:sn(s,"tolerant",!0),ecmaVersion:6,sourceType:sn(s,"sourceType","module")}),a=Array.isArray(n.tokens)?n.tokens:!1;delete n.tokens,a.forEach(function(u){typeof u.value!="string"&&(u.value=e.sliceString(u.loc.start,u.loc.end))}),Array.isArray(n.comments)&&(r=n.comments,delete n.comments),n.loc?jr(n,e):n.loc={start:e.firstPos(),end:e.lastPos()},n.loc.lines=e,n.loc.indent=0;let o,l;n.type==="Program"?(l=n,o=Yl.file(n,s.sourceFileName||null),o.loc={start:e.firstPos(),end:e.lastPos(),lines:e,indent:0}):n.type==="File"&&(o=n,l=o.program),s.tokens&&(o.tokens=a);let c=Cn({type:l.type,loc:l.loc,body:[],comments:r},e);return l.loc.start=c.start,l.loc.end=c.end,Hl(r,l.body.length?o.program:o,e),new Bn(e,a).copy(o)}var Bn=function(s,e){this.lines=s,this.tokens=e,this.startTokenIndex=0,this.endTokenIndex=e.length,this.indent=0,this.seen=new Map},_n=Bn.prototype;_n.copy=function(i){if(this.seen.has(i))return this.seen.get(i);if(ec.check(i)){let c=new Array(i.length);return this.seen.set(i,c),i.forEach(function(u,h){c[h]=this.copy(u)},this),c}if(!Zl.check(i))return i;jr(i,this.lines);let s=Object.create(Object.getPrototypeOf(i),{original:{value:i,configurable:!1,enumerable:!1,writable:!0}});this.seen.set(i,s);let e=i.loc,t=this.indent,r=t,n=this.startTokenIndex,a=this.endTokenIndex;e&&((i.type==="Block"||i.type==="Line"||i.type==="CommentBlock"||i.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(i),l=o.length;for(let c=0;c<l;++c){let u=o[c];u==="loc"||u==="tokens"&&i.type==="File"?s[u]=i[u]:s[u]=this.copy(i[u])}return this.indent=t,this.startTokenIndex=n,this.endTokenIndex=a,s};_n.findTokenRange=function(i){for(;this.startTokenIndex>0;){let s=i.tokens[this.startTokenIndex];if(U(i.start,s.loc.start)<0)--this.startTokenIndex;else break}for(;this.endTokenIndex<i.tokens.length;){let s=i.tokens[this.endTokenIndex];if(U(s.loc.end,i.end)<0)++this.endTokenIndex;else break}for(;this.startTokenIndex<this.endTokenIndex;){let s=i.tokens[this.startTokenIndex];if(U(s.loc.start,i.start)<0)++this.startTokenIndex;else break}for(i.start.token=this.startTokenIndex;this.endTokenIndex>this.startTokenIndex;){let s=i.tokens[this.endTokenIndex-1];if(U(i.end,s.loc.end)<0)--this.endTokenIndex;else break}i.end.token=this.endTokenIndex};var H=Se,tc=Ae.array,sc=Ae.number,Or={};[["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]].forEach(function(i,s){i.forEach(function(e){Or[e]=s})});var Pe=function(s){this.stack=[s]},re=Pe.prototype;Pe.from=function(i){if(i instanceof Pe)return i.copy();if(i instanceof Ol){let s=Object.create(Pe.prototype),e=[i.value];for(let t;t=i.parentPath;i=t)e.push(i.name,t.value);return s.stack=e.reverse(),s}return new Pe(i)};re.copy=function(){let s=Object.create(Pe.prototype);return s.stack=this.stack.slice(0),s};re.getName=function(){let s=this.stack,e=s.length;return e>1?s[e-2]:null};re.getValue=function(){let s=this.stack;return s[s.length-1]};re.valueIsDuplicate=function(){let i=this.stack,s=i.length-1;return i.lastIndexOf(i[s],s-1)>=0};function jn(i,s){let e=i.stack;for(let t=e.length-1;t>=0;t-=2){let r=e[t];if(H.Node.check(r)&&--s<0)return r}return null}re.getNode=function(s=0){return jn(this,~~s)};re.getParentNode=function(s=0){return jn(this,~~s+1)};re.getRootValue=function(){let s=this.stack;return s.length%2===0?s[1]:s[0]};re.call=function(s){let e=this.stack,t=e.length,r=e[t-1],n=arguments.length;for(let o=1;o<n;++o){let l=arguments[o];r=r[l],e.push(l,r)}let a=s(this);return e.length=t,a};re.each=function(s){let e=this.stack,t=e.length,r=e[t-1],n=arguments.length;for(let a=1;a<n;++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]),s(this),e.length-=2);e.length=t};re.map=function(s){let e=this.stack,t=e.length,r=e[t-1],n=arguments.length;for(let o=1;o<n;++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]=s(this,o),e.length-=2);return e.length=t,a};re.hasParens=function(){let i=this.getNode(),s=this.getPrevToken(i);if(!s)return!1;let e=this.getNextToken(i);return e?!!(s.value==="("&&(e.value===")"||!this.canBeFirstInStatement()&&this.firstInStatement()&&!this.needsParens(!0))):!1};re.getPrevToken=function(i){i=i||this.getNode();let s=i&&i.loc,e=s&&s.tokens;if(e&&s.start.token>0){let t=e[s.start.token-1];if(t){let r=this.getRootValue().loc;if(U(r.start,t.loc.start)<=0)return t}}return null};re.getNextToken=function(i){i=i||this.getNode();let s=i&&i.loc,e=s&&s.tokens;if(e&&s.end.token<e.length){let t=e[s.end.token];if(t){let r=this.getRootValue().loc;if(U(t.loc.end,r.end)<=0)return t}}return null};re.needsParens=function(i){let s=this.getNode();if(s.type==="AssignmentExpression"&&s.left.type==="ObjectPattern")return!0;let e=this.getParentNode(),t=this.getName();if(this.getValue()!==s||H.Statement.check(s)||s.type==="Identifier"||e&&e.type==="ParenthesizedExpression")return!1;if(s.extra&&s.extra.parenthesized)return!0;if(!e)return!1;if(s.type==="UnaryExpression"&&e.type==="BinaryExpression"&&t==="left"&&e.left===s&&e.operator==="**")return!0;switch(s.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return e.type==="MemberExpression"&&t==="object"&&e.object===s;case"BinaryExpression":case"LogicalExpression":switch(e.type){case"CallExpression":return t==="callee"&&e.callee===s;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return t==="object"&&e.object===s;case"BinaryExpression":case"LogicalExpression":{let r=e.operator,n=Or[r],a=s.operator,o=Or[a];if(n>o||n===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 s.optional&&e.type==="IndexedAccessType";case"IntersectionTypeAnnotation":case"UnionTypeAnnotation":return e.type==="NullableTypeAnnotation";case"Literal":return e.type==="MemberExpression"&&sc.check(s.value)&&t==="object"&&e.object===s;case"NumericLiteral":return e.type==="MemberExpression"&&t==="object"&&e.object===s;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===s;case"ConditionalExpression":return t==="test"&&e.test===s;case"MemberExpression":return t==="object"&&e.object===s;default:return!1}case"ArrowFunctionExpression":return H.CallExpression.check(e)&&t==="callee"&&e.callee===s||H.MemberExpression.check(e)&&t==="object"&&e.object===s||H.TSAsExpression&&H.TSAsExpression.check(e)&&t==="expression"&&e.expression===s?!0:Rn(e);case"ObjectExpression":if(e.type==="ArrowFunctionExpression"&&t==="body"&&e.body===s)return!0;break;case"TSAsExpression":if(e.type==="ArrowFunctionExpression"&&t==="body"&&e.body===s&&s.expression.type==="ObjectExpression")return!0;break;case"CallExpression":if(t==="declaration"&&H.ExportDefaultDeclaration.check(e)&&H.FunctionExpression.check(s.callee))return!0}return e.type==="NewExpression"&&t==="callee"&&e.callee===s?Mr(s):!!(i!==!0&&!this.canBeFirstInStatement()&&this.firstInStatement())};function Rn(i){return H.BinaryExpression.check(i)||H.LogicalExpression.check(i)}function Mr(i){return H.CallExpression.check(i)?!0:tc.check(i)?i.some(Mr):H.Node.check(i)?Ml(i,(s,e)=>Mr(e)):!1}re.canBeFirstInStatement=function(){let i=this.getNode();return!(H.FunctionExpression.check(i)||H.ObjectExpression.check(i)||H.ClassExpression.check(i))};re.firstInStatement=function(){let i=this.stack,s,e,t,r;for(let n=i.length-1;n>=0;n-=2)if(H.Node.check(i[n])&&(t=s,r=e,s=i[n-1],e=i[n]),!(!e||!r)){if(H.BlockStatement.check(e)&&s==="body"&&t===0||H.ExpressionStatement.check(e)&&t==="expression"||H.AssignmentExpression.check(e)&&t==="left"||H.ArrowFunctionExpression.check(e)&&t==="body")return!0;if(!(H.SequenceExpression.check(e)&&i[n+1]==="expressions"&&t===0)&&!(H.CallExpression.check(e)&&t==="callee")&&!(H.MemberExpression.check(e)&&t==="object")&&!(H.ConditionalExpression.check(e)&&t==="test")&&!(Rn(e)&&t==="left")&&!(H.UnaryExpression.check(e)&&!e.prefix&&t==="argument"))return!1}return!0};var jt=Se.Printable,on=Se.Expression,rc=Se.ReturnStatement,ic=Se.SourceLocation,Rt=Ae.object,Fr=Ae.array,nc=Ae.string,xs=/[0-9a-z_$]/i,Un=function(s){let e=this,t=[];e.replace=function(r,n){nc.check(n)&&(n=S(n)),t.push({lines:n,start:r.start,end:r.end})},e.get=function(r){r=r||{start:{line:1,column:0},end:{line:s.length,column:s.getLineLength(s.length)}};let n=r.start,a=[];function o(l,c){a.push(s.slice(l,c))}return t.sort((l,c)=>U(l.start,c.start)).forEach(function(l){U(n,l.start)>0||(o(n,l.start),a.push(l.lines),n=l.end)}),o(n,r.end),x(a)}},Vn=Un.prototype;Vn.tryToReprintComments=function(i,s,e){let t=this;if(!i.comments&&!s.comments)return!0;let r=Pe.from(i),n=Pe.from(s);r.stack.push("comments",ln(i)),n.stack.push("comments",ln(s));let a=[],o=qn(r,n,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 ln(i){let s=[];return i.comments&&i.comments.length>0&&i.comments.forEach(function(e){(e.leading||e.trailing)&&s.push(e)}),s}Vn.deleteComments=function(i){if(!i.comments)return;let s=this;i.comments.forEach(function(e){e.leading?s.replace({start:e.loc.start,end:i.loc.lines.skipSpaces(e.loc.end,!1,!1)},""):e.trailing&&s.replace({start:i.loc.lines.skipSpaces(e.loc.start,!0,!1),end:e.loc.end},"")})};function ac(i){let s=i.getValue();if(!jt.check(s))return;let e=s.original,t=e&&e.loc,r=t&&t.lines,n=[];if(!(!r||!cc(i,n)))return function(a){let o=new Un(r);n.forEach(function(c){let u=c.newPath.getValue(),h=c.oldPath.getValue();ic.assert(h.loc,!0);let f=!o.tryToReprintComments(u,h,a);f&&o.deleteComments(h);let d=a(c.newPath,{includeComments:f,avoidRootParens:h.type===u.type&&c.oldPath.hasParens()}).indentTail(h.loc.indent),p=oc(r,h.loc,d),g=lc(r,h.loc,d);if(p||g){let y=[];p&&y.push(" "),y.push(d),g&&y.push(" "),d=x(y)}o.replace(h.loc,d)});let l=o.get(t).indentTail(-e.loc.indent);return i.needsParens()?x(["(",l,")"]):l}}function oc(i,s,e){let t=Ve(s.start),r=i.prevPos(t)&&i.charAt(t),n=e.charAt(e.firstPos());return r&&xs.test(r)&&n&&xs.test(n)}function lc(i,s,e){let t=i.charAt(s.end),r=e.lastPos(),n=e.prevPos(r)&&e.charAt(r);return n&&xs.test(n)&&t&&xs.test(t)}function cc(i,s){let e=i.getValue();jt.assert(e);let t=e.original;if(jt.assert(t),e.type!==t.type)return!1;let r=new Pe(t),n=Br(i,r,s);return n||(s.length=0),n}function $n(i,s,e){let t=i.getValue(),r=s.getValue();return t===r?!0:Fr.check(t)?qn(i,s,e):Rt.check(t)?uc(i,s,e):!1}function qn(i,s,e){let t=i.getValue(),r=s.getValue();if(t===r||i.valueIsDuplicate()||s.valueIsDuplicate())return!0;Fr.assert(t);let n=t.length;if(!(Fr.check(r)&&r.length===n))return!1;for(let a=0;a<n;++a){i.stack.push(a,t[a]),s.stack.push(a,r[a]);let o=$n(i,s,e);if(i.stack.length-=2,s.stack.length-=2,!o)return!1}return!0}function uc(i,s,e){let t=i.getValue();if(Rt.assert(t),t.original===null)return!1;let r=s.getValue();if(!Rt.check(r))return!1;if(t===r||i.valueIsDuplicate()||s.valueIsDuplicate())return!0;if(jt.check(t)){if(!jt.check(r))return!1;let n=i.getParentNode(),a=s.getParentNode();if(a!==null&&a.type==="FunctionTypeAnnotation"&&n!==null&&n.type==="FunctionTypeAnnotation"){let o=a.params.length!==1||!!a.params[0].name,l=n.params.length!==1||!!n.params[0].name;if(!o&&l)return!1}if(t.type===r.type){let o=[];if(Br(i,s,o))e.push.apply(e,o);else if(r.loc)e.push({oldPath:s.copy(),newPath:i.copy()});else return!1;return!0}return on.check(t)&&on.check(r)&&r.loc?(e.push({oldPath:s.copy(),newPath:i.copy()}),!0):!1}return Br(i,s,e)}function Br(i,s,e){let t=i.getValue(),r=s.getValue();if(Rt.assert(t),Rt.assert(r),t.original===null||i.needsParens()&&!s.hasParens())return!1;let n=_l(r,t);(r.type==="File"||t.type==="File")&&delete n.tokens,delete n.loc;let a=e.length;for(let o in n){if(o.charAt(0)==="_")continue;i.stack.push(o,Be(t,o)),s.stack.push(o,Be(r,o));let l=$n(i,s,e);if(i.stack.length-=2,s.stack.length-=2,!l)return!1}return!(rc.check(i.getNode())&&e.length>a)}var Y=Se,Ur=Ae.string,hc=Ae.object,bs=function(s,e){Ur.assert(s),this.code=s,e&&(hc.assert(e),this.map=e)},pc=bs.prototype,cn=!1;pc.toString=function(){return cn||(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."),cn=!0),this.code};var un=new bs(""),fc=function(s){let e=s&&s.tabWidth;s=Ss(s),s.sourceFileName=null;function t(n,a){return n=Object.assign({},n,a),o=>r(o,n)}function r(n,a){if(a=a||{},a.includeComments)return an(n,t(a,{includeComments:!1}));let o=s.tabWidth;if(!e){let u=n.getNode().loc;u&&u.lines&&u.lines.guessTabWidth&&(s.tabWidth=u.lines.guessTabWidth())}let l=ac(n),c=l?l(r):hn(n,s,a,t(a,{includeComments:!0,avoidRootParens:!1}));return s.tabWidth=o,c}this.print=function(n){if(!n)return un;let a=r(Pe.from(n),{includeComments:!0,avoidRootParens:!1});return new bs(a.toString(s),jl(s.inputSourceMap,a.getSourceMap(s.sourceMapName,s.sourceRoot)))},this.printGenerically=function(n){if(!n)return un;function a(u){return an(u,h=>hn(h,s,{includeComments:!0,avoidRootParens:!1},a))}let o=Pe.from(n),l=s.reuseWhitespace;s.reuseWhitespace=!1;let c=new bs(a(o).toString(s));return s.reuseWhitespace=l,c}};function hn(i,s,e,t){let r=i.getValue(),n=[],a=dc(i,s,t);if(!r||a.isEmpty())return a;let o=!1,l=mc(i,t);return l.isEmpty()?e.avoidRootParens||(o=i.needsParens()):n.push(l),o&&n.unshift("("),n.push(a),o&&n.push(")"),x(n)}function dc(i,s,e){let t=i.getValue();if(!t)return S("");if(typeof t=="string")return S(t,s);Y.Printable.assert(t);let r=[];switch(t.type){case"File":return i.call(e,"program");case"Program":return t.directives&&i.each(function(n){r.push(e(n),`;
|
|
17
|
-
`)},"directives"),t.interpreter&&r.push(i.call(e,"interpreter")),r.push(i.call(n=>ut(n,s,e),"body")),x(r);case"Noop":case"EmptyStatement":return S("");case"ExpressionStatement":return x([i.call(e,"expression"),";"]);case"ParenthesizedExpression":return x(["(",i.call(e,"expression"),")"]);case"BinaryExpression":case"LogicalExpression":case"AssignmentExpression":return S(" ").join([i.call(e,"left"),t.operator,i.call(e,"right")]);case"AssignmentPattern":return x([i.call(e,"left")," = ",i.call(e,"right")]);case"MemberExpression":case"OptionalMemberExpression":{r.push(i.call(e,"object"));let n=i.call(e,"property"),a=Be(t,"optional");return t.computed?r.push(a?"?.[":"[",n,"]"):r.push(a?"?.":".",n),x(r)}case"ChainExpression":return i.call(e,"expression");case"MetaProperty":return x([i.call(e,"meta"),".",i.call(e,"property")]);case"BindExpression":return t.object&&r.push(i.call(e,"object")),r.push("::",i.call(e,"callee")),x(r);case"Path":return S(".").join(t.body);case"Identifier":return x([S(t.name,s),t.optional?"?":"",i.call(e,"typeAnnotation")]);case"SpreadElement":case"SpreadElementPattern":case"RestProperty":case"SpreadProperty":case"SpreadPropertyPattern":case"ObjectTypeSpreadProperty":case"RestElement":return x(["...",i.call(e,"argument"),i.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(" ",i.call(e,"id"),i.call(e,"typeParameters")):t.typeParameters&&r.push(i.call(e,"typeParameters")),r.push("(",Ce(i,s,e),")",i.call(e,"returnType")),t.body&&r.push(" ",i.call(e,"body")),x(r);case"ArrowFunctionExpression":return t.async&&r.push("async "),t.typeParameters&&r.push(i.call(e,"typeParameters")),!s.arrowParensAlways&&t.params.length===1&&!t.rest&&t.params[0].type==="Identifier"&&!t.params[0].typeAnnotation&&!t.returnType?r.push(i.call(e,"params",0)):r.push("(",Ce(i,s,e),")",i.call(e,"returnType")),r.push(" => ",i.call(e,"body")),x(r);case"MethodDefinition":return Er(i,s,e);case"YieldExpression":return r.push("yield"),t.delegate&&r.push("*"),t.argument&&r.push(" ",i.call(e,"argument")),x(r);case"AwaitExpression":return r.push("await"),t.all&&r.push("*"),t.argument&&r.push(" ",i.call(e,"argument")),x(r);case"ModuleExpression":return x([`module {
|
|
18
|
-
`,i.call(e,"body").indent(s.tabWidth),`
|
|
19
|
-
}`
|
|
20
|
-
|
|
7
|
+
`):n=String.fromCharCode(s),++this.state.curLine,this.state.lineStart=this.state.pos,n}jsxReadString(e){let s="",n=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(g.UnterminatedString,this.state.startLoc);let i=this.input.charCodeAt(this.state.pos);if(i===e)break;i===38?(s+=this.input.slice(n,this.state.pos),s+=this.jsxReadEntity(),n=this.state.pos):Js(i)?(s+=this.input.slice(n,this.state.pos),s+=this.jsxReadNewLine(!1),n=this.state.pos):++this.state.pos}s+=this.input.slice(n,this.state.pos++),this.finishToken(133,s)}jsxReadEntity(){let e=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let s=10;this.codePointAtPos(this.state.pos)===120&&(s=16,++this.state.pos);let n=this.readInt(s,void 0,!1,"bail");if(n!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(n)}else{let s=0,n=!1;for(;s++<10&&this.state.pos<this.length&&!(n=this.codePointAtPos(this.state.pos)===59);)++this.state.pos;if(n){let i=this.input.slice(e,this.state.pos),a=Sx[i];if(++this.state.pos,a)return a}}return this.state.pos=e,"&"}jsxReadWord(){let e,s=this.state.pos;do e=this.input.charCodeAt(++this.state.pos);while(zs(e)||e===45);this.finishToken(140,this.input.slice(s,this.state.pos))}jsxParseIdentifier(){let e=this.startNode();return this.match(140)?e.name=this.state.value:Dc(this.state.type)?e.name=Kt(this.state.type):this.unexpected(),this.next(),this.finishNode(e,"JSXIdentifier")}jsxParseNamespacedName(){let e=this.state.startLoc,s=this.jsxParseIdentifier();if(!this.eat(14))return s;let n=this.startNodeAt(e);return n.namespace=s,n.name=this.jsxParseIdentifier(),this.finishNode(n,"JSXNamespacedName")}jsxParseElementName(){let e=this.state.startLoc,s=this.jsxParseNamespacedName();if(s.type==="JSXNamespacedName")return s;for(;this.eat(16);){let n=this.startNodeAt(e);n.object=s,n.property=this.jsxParseIdentifier(),s=this.finishNode(n,"JSXMemberExpression")}return s}jsxParseAttributeValue(){let e;switch(this.state.type){case 5:return e=this.startNode(),this.setContext(K.brace),this.next(),e=this.jsxParseExpressionContainer(e,K.j_oTag),e.expression.type==="JSXEmptyExpression"&&this.raise(fs.AttributeIsEmpty,e),e;case 142:case 133:return this.parseExprAtom();default:throw this.raise(fs.UnsupportedJsxValue,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(K.j_expr),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXSpreadChild")}jsxParseExpressionContainer(e,s){if(this.match(8))e.expression=this.jsxParseEmptyExpression();else{let n=this.parseExpression();e.expression=n}return this.setContext(s),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXExpressionContainer")}jsxParseAttribute(){let e=this.startNode();return this.match(5)?(this.setContext(K.brace),this.next(),this.expect(21),e.argument=this.parseMaybeAssignAllowIn(),this.setContext(K.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 s=this.startNodeAt(e);return this.eat(143)?this.finishNode(s,"JSXOpeningFragment"):(s.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(s))}jsxParseOpeningElementAfterName(e){let s=[];for(;!this.match(56)&&!this.match(143);)s.push(this.jsxParseAttribute());return e.attributes=s,e.selfClosing=this.eat(56),this.expect(143),this.finishNode(e,"JSXOpeningElement")}jsxParseClosingElementAt(e){let s=this.startNodeAt(e);return this.eat(143)?this.finishNode(s,"JSXClosingFragment"):(s.name=this.jsxParseElementName(),this.expect(143),this.finishNode(s,"JSXClosingElement"))}jsxParseElementAt(e){let s=this.startNodeAt(e),n=[],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}n.push(this.jsxParseElementAt(e));break;case 141:n.push(this.parseLiteral(this.state.value,"JSXText"));break;case 5:{let o=this.startNode();this.setContext(K.brace),this.next(),this.match(21)?n.push(this.jsxParseSpreadChild(o)):n.push(this.jsxParseExpressionContainer(o,K.j_expr));break}default:this.unexpected()}Jt(i)&&!Jt(a)&&a!==null?this.raise(fs.MissingClosingTagFragment,a):!Jt(i)&&Jt(a)?this.raise(fs.MissingClosingTagElement,a,{openingTagName:Ws(i.name)}):!Jt(i)&&!Jt(a)&&Ws(a.name)!==Ws(i.name)&&this.raise(fs.MissingClosingTagElement,a,{openingTagName:Ws(i.name)})}if(Jt(i)?(s.openingFragment=i,s.closingFragment=a):(s.openingElement=i,s.closingElement=a),s.children=n,this.match(47))throw this.raise(fs.UnwrappedAdjacentJSXElements,this.state.startLoc);return Jt(i)?this.finishNode(s,"JSXFragment"):this.finishNode(s,"JSXElement")}jsxParseElement(){let e=this.state.startLoc;return this.next(),this.jsxParseElementAt(e)}setContext(e){let{context:s}=this.state;s[s.length-1]=e}parseExprAtom(e){return 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 s=this.curContext();if(s===K.j_expr){this.jsxReadToken();return}if(s===K.j_oTag||s===K.j_cTag){if(Dt(e)){this.jsxReadWord();return}if(e===62){++this.state.pos,this.finishToken(143);return}if((e===34||e===39)&&s===K.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:s,type:n}=this.state;if(n===56&&e===142)s.splice(-2,2,K.j_cTag),this.state.canStartJSXElement=!1;else if(n===142)s.push(K.j_oTag);else if(n===143){let i=s[s.length-1];i===K.j_oTag&&e===56||i===K.j_cTag?(s.pop(),this.state.canStartJSXElement=s[s.length-1]===K.j_expr):(this.setContext(K.j_expr),this.state.canStartJSXElement=!0)}else this.state.canStartJSXElement=R_(n)}},xc=class extends Xr{constructor(...t){super(...t),this.tsNames=new Map}},Ec=class extends Qr{constructor(...t){super(...t),this.importsStack=[]}createScope(t){return this.importsStack.push(new Set),new xc(t)}enter(t){t===256&&this.importsStack.push(new Set),super.enter(t)}exit(){let t=super.exit();return t===256&&this.importsStack.pop(),t}hasImport(t,e){let s=this.importsStack.length;if(this.importsStack[s-1].has(t))return!0;if(!e&&s>1){for(let n=0;n<s-1;n++)if(this.importsStack[n].has(t))return!0}return!1}declareName(t,e,s){if(e&4096){this.hasImport(t,!0)&&this.parser.raise(g.VarRedeclaration,s,{identifierName:t}),this.importsStack[this.importsStack.length-1].add(t);return}let n=this.currentScope(),i=n.tsNames.get(t)||0;if(e&1024){this.maybeExportDefined(n,t),n.tsNames.set(t,i|16);return}super.declareName(t,e,s),e&2&&(e&1||(this.checkRedeclarationInScope(n,t,e,s),this.maybeExportDefined(n,t)),i=i|1),e&256&&(i=i|2),e&512&&(i=i|4),e&128&&(i=i|8),i&&n.tsNames.set(t,i)}isRedeclaredInScope(t,e,s){let n=t.tsNames.get(e);if((n&2)>0){if(s&256){let i=!!(s&512),a=(n&4)>0;return i!==a}return!0}return s&128&&(n&8)>0?t.names.get(e)&2?!!(s&1):!1:s&2&&(n&1)>0?!0:super.isRedeclaredInScope(t,e,s)}checkLocalExport(t){let{name:e}=t;if(this.hasImport(e))return;let s=this.scopeStack.length;for(let n=s-1;n>=0;n--){let a=this.scopeStack[n].tsNames.get(e);if((a&1)>0||(a&16)>0)return}super.checkLocalExport(t)}},Xd=r=>r.type==="ParenthesizedExpression"?Xd(r.expression):r,Tc=class extends _c{toAssignable(t,e=!1){var s,n;let i;switch((t.type==="ParenthesizedExpression"||(s=t.extra)!=null&&s.parenthesized)&&(i=Xd(t),e?i.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(g.InvalidParenthesizedAssignment,t):i.type!=="MemberExpression"&&!this.isOptionalMemberExpression(i)&&this.raise(g.InvalidParenthesizedAssignment,t):this.raise(g.InvalidParenthesizedAssignment,t)),t.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern";for(let o=0,c=t.properties.length,l=c-1;o<c;o++){var a;let u=t.properties[o],p=o===l;this.toAssignableObjectExpressionProp(u,p,e),p&&u.type==="RestElement"&&(a=t.extra)!=null&&a.trailingCommaLoc&&this.raise(g.RestTrailingComma,t.extra.trailingCommaLoc)}break;case"ObjectProperty":{let{key:o,value:c}=t;this.isPrivateName(o)&&this.classScope.usePrivateName(this.getPrivateNameSV(o),o.loc.start),this.toAssignable(c,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":t.type="ArrayPattern",this.toAssignableList(t.elements,(n=t.extra)==null?void 0:n.trailingCommaLoc,e);break;case"AssignmentExpression":t.operator!=="="&&this.raise(g.MissingEqInAssignment,t.left.loc.end),t.type="AssignmentPattern",delete t.operator,this.toAssignable(t.left,e);break;case"ParenthesizedExpression":this.toAssignable(i,e);break}}toAssignableObjectExpressionProp(t,e,s){if(t.type==="ObjectMethod")this.raise(t.kind==="get"||t.kind==="set"?g.PatternHasAccessor:g.PatternHasMethod,t.key);else if(t.type==="SpreadElement"){t.type="RestElement";let n=t.argument;this.checkToRestConversion(n,!1),this.toAssignable(n,s),e||this.raise(g.RestTrailingComma,t)}else this.toAssignable(t,s)}toAssignableList(t,e,s){let n=t.length-1;for(let i=0;i<=n;i++){let a=t[i];if(a){if(a.type==="SpreadElement"){a.type="RestElement";let o=a.argument;this.checkToRestConversion(o,!0),this.toAssignable(o,s)}else this.toAssignable(a,s);a.type==="RestElement"&&(i<n?this.raise(g.RestTrailingComma,a):e&&this.raise(g.RestTrailingComma,e))}}}isAssignable(t,e){switch(t.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":return!0;case"ObjectExpression":{let s=t.properties.length-1;return t.properties.every((n,i)=>n.type!=="ObjectMethod"&&(i===s||n.type!=="SpreadElement")&&this.isAssignable(n))}case"ObjectProperty":return this.isAssignable(t.value);case"SpreadElement":return this.isAssignable(t.argument);case"ArrayExpression":return t.elements.every(s=>s===null||this.isAssignable(s));case"AssignmentExpression":return t.operator==="=";case"ParenthesizedExpression":return this.isAssignable(t.expression);case"MemberExpression":case"OptionalMemberExpression":return!e;default:return!1}}toReferencedList(t,e){return t}toReferencedListDeep(t,e){this.toReferencedList(t,e);for(let s of t)s?.type==="ArrayExpression"&&this.toReferencedListDeep(s.elements)}parseSpread(t){let e=this.startNode();return this.next(),e.argument=this.parseMaybeAssignAllowIn(t,void 0),this.finishNode(e,"SpreadElement")}parseRestBinding(){let t=this.startNode();return this.next(),t.argument=this.parseBindingAtom(),this.finishNode(t,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{let t=this.startNode();return this.next(),t.elements=this.parseBindingList(3,93,1),this.finishNode(t,"ArrayPattern")}case 5:return this.parseObjectLike(8,!0)}return this.parseIdentifier()}parseBindingList(t,e,s){let n=s&1,i=[],a=!0;for(;!this.eat(t);)if(a?a=!1:this.expect(12),n&&this.match(12))i.push(null);else{if(this.eat(t))break;if(this.match(21)){let o=this.parseRestBinding();if((this.hasPlugin("flow")||s&2)&&(o=this.parseFunctionParamType(o)),i.push(o),!this.checkCommaAfterRest(e)){this.expect(t);break}}else{let o=[];for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(g.UnsupportedParameterDecorator,this.state.startLoc);this.match(26);)o.push(this.parseDecorator());i.push(this.parseAssignableListItem(s,o))}}return i}parseBindingRestProperty(t){return this.next(),t.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(t,"RestElement")}parseBindingProperty(){let{type:t,startLoc:e}=this.state;if(t===21)return this.parseBindingRestProperty(this.startNode());let s=this.startNode();return t===138?(this.expectPlugin("destructuringPrivate",e),this.classScope.usePrivateName(this.state.value,e),s.key=this.parsePrivateName()):this.parsePropertyName(s),s.method=!1,this.parseObjPropValue(s,e,!1,!1,!0,!1)}parseAssignableListItem(t,e){let s=this.parseMaybeDefault();(this.hasPlugin("flow")||t&2)&&this.parseFunctionParamType(s);let n=this.parseMaybeDefault(s.loc.start,s);return e.length&&(s.decorators=e),n}parseFunctionParamType(t){return t}parseMaybeDefault(t,e){var s,n;if((s=t)!=null||(t=this.state.startLoc),e=(n=e)!=null?n:this.parseBindingAtom(),!this.eat(29))return e;let i=this.startNodeAt(t);return i.left=e,i.right=this.parseMaybeAssignAllowIn(),this.finishNode(i,"AssignmentPattern")}isValidLVal(t,e,s){switch(t){case"AssignmentPattern":return"left";case"RestElement":return"argument";case"ObjectProperty":return"value";case"ParenthesizedExpression":return"expression";case"ArrayPattern":return"elements";case"ObjectPattern":return"properties"}return!1}isOptionalMemberExpression(t){return t.type==="OptionalMemberExpression"}checkLVal(t,e,s=64,n=!1,i=!1,a=!1){var o;let c=t.type;if(this.isObjectMethod(t))return;let l=this.isOptionalMemberExpression(t);if(l||c==="MemberExpression"){l&&(this.expectPlugin("optionalChainingAssign",t.loc.start),e.type!=="AssignmentExpression"&&this.raise(g.InvalidLhsOptionalChaining,t,{ancestor:e})),s!==64&&this.raise(g.InvalidPropertyBindingPattern,t);return}if(c==="Identifier"){this.checkIdentifier(t,s,i);let{name:m}=t;n&&(n.has(m)?this.raise(g.ParamDupe,t):n.add(m));return}let u=this.isValidLVal(c,!(a||(o=t.extra)!=null&&o.parenthesized)&&e.type==="AssignmentExpression",s);if(u===!0)return;if(u===!1){let m=s===64?g.InvalidLhs:g.InvalidLhsBinding;this.raise(m,t,{ancestor:e});return}let p,h;typeof u=="string"?(p=u,h=c==="ParenthesizedExpression"):[p,h]=u;let d=c==="ArrayPattern"||c==="ObjectPattern"?{type:c}:e,f=t[p];if(Array.isArray(f))for(let m of f)m&&this.checkLVal(m,d,s,n,i,h);else f&&this.checkLVal(f,d,s,n,i,h)}checkIdentifier(t,e,s=!1){this.state.strict&&(s?Yd(t.name,this.inModule):Vd(t.name))&&(e===64?this.raise(g.StrictEvalArguments,t,{referenceName:t.name}):this.raise(g.StrictEvalArgumentsBinding,t,{bindingName:t.name})),e&8192&&t.name==="let"&&this.raise(g.LetInLexicalBinding,t),e&64||this.declareNameFromIdentifier(t,e)}declareNameFromIdentifier(t,e){this.scope.declareName(t.name,e,t.loc.start)}checkToRestConversion(t,e){switch(t.type){case"ParenthesizedExpression":this.checkToRestConversion(t.expression,e);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(e)break;default:this.raise(g.InvalidRestAssignmentPattern,t)}}checkCommaAfterRest(t){return this.match(12)?(this.raise(this.lookaheadCharCode()===t?g.RestTrailingComma:g.ElementAfterRest,this.state.startLoc),!0):!1}};function xx(r){if(r==null)throw new Error(`Unexpected ${r} value.`);return r}function Md(r){if(!r)throw new Error("Assert fail")}var O=Ot`typescript`({AbstractMethodHasImplementation:({methodName:r})=>`Method '${r}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:r})=>`Property '${r}' cannot have an initializer because it is marked abstract.`,AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",AccessorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccessorCannotHaveTypeParameters:"An accessor cannot have type parameters.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"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:r})=>`'declare' is not allowed in ${r}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:({modifier:r})=>"Accessibility modifier already seen.",DuplicateModifier:({modifier:r})=>`Duplicate modifier: '${r}'.`,EmptyHeritageClauseType:({token:r})=>`'${r}' 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:r})=>`'${r[0]}' modifier cannot be used with '${r[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:r})=>`Index signatures cannot have an accessibility modifier ('${r}').`,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:r})=>`'${r}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:r})=>`'${r}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:r})=>`'${r}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:r})=>`'${r[0]}' modifier must precede '${r[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:r})=>`Private elements cannot have an accessibility modifier ('${r}').`,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.",SetAccessorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccessorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccessorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:r})=>`Single type parameter ${r} should have a trailing comma. Example usage: <${r},>.`,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:r})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${r}.`});function Ex(r){switch(r){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 Ld(r){return r==="private"||r==="public"||r==="protected"}function Tx(r){return r==="in"||r==="out"}var Px=r=>class extends r{constructor(...e){super(...e),this.tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:O.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:O.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:O.InvalidModifierOnTypeParameter})}getScopeHandler(){return Ec}tsIsIdentifier(){return z(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(5)||this.match(55)||this.match(21)||this.match(138)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){return this.next(),this.hasPrecedingLineBreak()?!1:this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){return this.match(106)?(this.next(),this.tsTokenCanFollowModifier()):this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(e,s){if(!z(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;let n=this.state.value;if(e.includes(n)){if(s&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return n}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:s,stopOnStartOfClassStaticBlock:n,errorTemplate:i=O.InvalidModifierOnTypeMember},a){let o=(l,u,p,h)=>{u===p&&a[h]&&this.raise(O.InvalidModifiersOrder,l,{orderedModifiers:[p,h]})},c=(l,u,p,h)=>{(a[p]&&u===h||a[h]&&u===p)&&this.raise(O.IncompatibleModifiers,l,{modifiers:[p,h]})};for(;;){let{startLoc:l}=this.state,u=this.tsParseModifier(e.concat(s??[]),n);if(!u)break;Ld(u)?a.accessibility?this.raise(O.DuplicateAccessibilityModifier,l,{modifier:u}):(o(l,u,u,"override"),o(l,u,u,"static"),o(l,u,u,"readonly"),a.accessibility=u):Tx(u)?(a[u]&&this.raise(O.DuplicateModifier,l,{modifier:u}),a[u]=!0,o(l,u,"in","out")):(hasOwnProperty.call(a,u)?this.raise(O.DuplicateModifier,l,{modifier:u}):(o(l,u,"static","readonly"),o(l,u,"static","override"),o(l,u,"override","readonly"),o(l,u,"abstract","override"),c(l,u,"declare","override"),c(l,u,"static","abstract")),a[u]=!0),s!=null&&s.includes(u)&&this.raise(i,l,{modifier:u})}}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,s){let n=[];for(;!this.tsIsListTerminator(e);)n.push(s());return n}tsParseDelimitedList(e,s,n){return xx(this.tsParseDelimitedListWorker(e,s,!0,n))}tsParseDelimitedListWorker(e,s,n,i){let a=[],o=-1;for(;!this.tsIsListTerminator(e);){o=-1;let c=s();if(c==null)return;if(a.push(c),this.eat(12)){o=this.state.lastTokStartLoc.index;continue}if(this.tsIsListTerminator(e))break;n&&this.expect(12);return}return i&&(i.value=o),a}tsParseBracketedList(e,s,n,i,a){i||(n?this.expect(0):this.expect(47));let o=this.tsParseDelimitedList(e,s,a);return n?this.expect(3):this.expect(48),o}tsParseImportType(){let e=this.startNode();return this.expect(83),this.expect(10),this.match(133)||this.raise(O.UnsupportedImportTypeArgument,this.state.startLoc),e.argument=super.parseExprAtom(),(this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions"))&&(e.options=null),this.eat(12)&&(this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes"),this.match(11)||(e.options=super.parseMaybeAssignAllowIn(),this.eat(12))),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 s=this.parseIdentifier(e);for(;this.eat(16);){let n=this.startNodeAtNode(s);n.left=s,n.right=this.parseIdentifier(e),s=this.finishNode(n,"TSQualifiedName")}return s}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 s=this.startNodeAtNode(e);return s.parameterName=e,s.typeAnnotation=this.tsParseTypeAnnotation(!1),s.asserts=!1,this.finishNode(s,"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 s=this.startNode();return e(s),s.name=this.tsParseTypeParameterName(),s.constraint=this.tsEatThenParseType(81),s.default=this.tsEatThenParseType(29),this.finishNode(s,"TSTypeParameter")}tsTryParseTypeParameters(e){if(this.match(47))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){let s=this.startNode();this.match(47)||this.match(142)?this.next():this.unexpected();let n={value:-1};return s.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,e),!1,!0,n),s.params.length===0&&this.raise(O.EmptyTypeParameters,s),n.value!==-1&&this.addExtra(s,"trailingComma",n.value),this.finishNode(s,"TSTypeParameterDeclaration")}tsFillSignature(e,s){let n=e===19,i="parameters",a="typeAnnotation";s.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),s[i]=this.tsParseBindingListForSignature(),n?s[a]=this.tsParseTypeOrTypePredicateAnnotation(e):this.match(e)&&(s[a]=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){let e=super.parseBindingList(11,41,2);for(let s of e){let{type:n}=s;(n==="AssignmentPattern"||n==="TSParameterProperty")&&this.raise(O.UnsupportedSignatureParameterKind,s,{type:n})}return e}tsParseTypeMemberSemicolon(){!this.eat(12)&&!this.isLineTerminator()&&this.expect(13)}tsParseSignatureMember(e,s){return this.tsFillSignature(14,s),this.tsParseTypeMemberSemicolon(),this.finishNode(s,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),z(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 s=this.parseIdentifier();s.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(s),this.expect(3),e.parameters=[s];let n=this.tsTryParseTypeAnnotation();return n&&(e.typeAnnotation=n),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSIndexSignature")}tsParsePropertyOrMethodSignature(e,s){this.eat(17)&&(e.optional=!0);let n=e;if(this.match(10)||this.match(47)){s&&this.raise(O.ReadonlyForMethodSignature,e);let i=n;i.kind&&this.match(47)&&this.raise(O.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(14,i),this.tsParseTypeMemberSemicolon();let a="parameters",o="typeAnnotation";if(i.kind==="get")i[a].length>0&&(this.raise(g.BadGetterArity,this.state.curPosition()),this.isThisParam(i[a][0])&&this.raise(O.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(i.kind==="set"){if(i[a].length!==1)this.raise(g.BadSetterArity,this.state.curPosition());else{let c=i[a][0];this.isThisParam(c)&&this.raise(O.AccessorCannotDeclareThisParameter,this.state.curPosition()),c.type==="Identifier"&&c.optional&&this.raise(O.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),c.type==="RestElement"&&this.raise(O.SetAccessorCannotHaveRestParameter,this.state.curPosition())}i[o]&&this.raise(O.SetAccessorCannotHaveReturnType,i[o])}else i.kind="method";return this.finishNode(i,"TSMethodSignature")}else{let i=n;s&&(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 n=this.startNode();return this.next(),this.match(10)||this.match(47)?this.tsParseSignatureMember("TSConstructSignatureDeclaration",e):(e.key=this.createIdentifier(n,"new"),this.tsParsePropertyOrMethodSignature(e,!1))}this.tsParseModifiers({allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]},e);let s=this.tsTryParseIndexSignature(e);return s||(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)))}tsParseMappedType(){let e=this.startNode();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);{let s=this.startNode();s.name=this.tsParseTypeParameterName(),s.constraint=this.tsExpectThenParseType(58),e.typeParameter=this.finishNode(s,"TSTypeParameter")}return 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 s=!1;return e.elementTypes.forEach(n=>{let{type:i}=n;s&&i!=="TSRestType"&&i!=="TSOptionalType"&&!(i==="TSNamedTupleMember"&&n.optional)&&this.raise(O.OptionalTypeBeforeRequired,n),s||(s=i==="TSNamedTupleMember"&&n.optional||i==="TSOptionalType")}),this.finishNode(e,"TSTupleType")}tsParseTupleElementType(){let{startLoc:e}=this.state,s=this.eat(21),n,i,a,o,l=it(this.state.type)?this.lookaheadCharCode():null;if(l===58)n=!0,a=!1,i=this.parseIdentifier(!0),this.expect(14),o=this.tsParseType();else if(l===63){a=!0;let u=this.state.startLoc,p=this.state.value,h=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(n=!0,i=this.createIdentifier(this.startNodeAt(u),p),this.expect(17),this.expect(14),o=this.tsParseType()):(n=!1,o=h,this.expect(17))}else o=this.tsParseType(),a=this.eat(17),n=this.eat(14);if(n){let u;i?(u=this.startNodeAtNode(i),u.optional=a,u.label=i,u.elementType=o,this.eat(17)&&(u.optional=!0,this.raise(O.TupleOptionalAfterType,this.state.lastTokStartLoc))):(u=this.startNodeAtNode(o),u.optional=a,this.raise(O.InvalidTupleMemberLabel,o),u.label=o,u.elementType=this.tsParseType()),o=this.finishNode(u,"TSNamedTupleMember")}else if(a){let u=this.startNodeAtNode(o);u.typeAnnotation=o,o=this.finishNode(u,"TSOptionalType")}if(s){let u=this.startNodeAt(e);u.typeAnnotation=o,o=this.finishNode(u,"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,s){let n=this.startNode();return e==="TSConstructorType"&&(n.abstract=!!s,s&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,n)),this.finishNode(n,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(),s=this.lookahead();return s.type!==134&&s.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(z(e)||e===88||e===84){let s=e===88?"TSVoidKeyword":e===84?"TSNullKeyword":Ex(this.state.value);if(s!==void 0&&this.lookaheadCharCode()!==46){let n=this.startNode();return this.next(),this.finishNode(n,s)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let e=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(3)){let s=this.startNodeAtNode(e);s.elementType=e,this.expect(3),e=this.finishNode(s,"TSArrayType")}else{let s=this.startNodeAtNode(e);s.objectType=e,s.indexType=this.tsParseType(),this.expect(3),e=this.finishNode(s,"TSIndexedAccessType")}return e}tsParseTypeOperator(){let e=this.startNode(),s=this.state.value;return this.next(),e.operator=s,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),s==="readonly"&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(O.UnexpectedReadonly,e)}}tsParseInferType(){let e=this.startNode();this.expectContextual(115);let s=this.startNode();return s.name=this.tsParseTypeParameterName(),s.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(s,"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 G_(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(115)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,s,n){let i=this.startNode(),a=this.eat(n),o=[];do o.push(s());while(this.eat(n));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(z(this.state.type)||this.match(78))return this.next(),!0;if(this.match(5)){let{errors:e}=this.state,s=e.length;try{return this.parseObjectLike(8,!0),e.length===s}catch{return!1}}if(this.match(0)){this.next();let{errors:e}=this.state,s=e.length;try{return super.parseBindingList(3,93,1),e.length===s}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 s=this.startNode();this.expect(e);let n=this.startNode(),i=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(i&&this.match(78)){let c=this.tsParseThisTypeOrThisTypePredicate();return c.type==="TSThisType"?(n.parameterName=c,n.asserts=!0,n.typeAnnotation=null,c=this.finishNode(n,"TSTypePredicate")):(this.resetStartLocationFromNode(c,n),c.asserts=!0),s.typeAnnotation=c,this.finishNode(s,"TSTypeAnnotation")}let a=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!a)return i?(n.parameterName=this.parseIdentifier(),n.asserts=i,n.typeAnnotation=null,s.typeAnnotation=this.finishNode(n,"TSTypePredicate"),this.finishNode(s,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,s);let o=this.tsParseTypeAnnotation(!1);return n.parameterName=a,n.typeAnnotation=o,n.asserts=i,s.typeAnnotation=this.finishNode(n,"TSTypePredicate"),this.finishNode(s,"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(),!z(this.state.type)&&!this.match(78)?!1:(e&&this.raise(g.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:"asserts"}),!0)}tsParseTypeAnnotation(e=!0,s=this.startNode()){return this.tsInType(()=>{e&&this.expect(14),s.typeAnnotation=this.tsParseType()}),this.finishNode(s,"TSTypeAnnotation")}tsParseType(){Md(this.state.inType);let e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(81))return e;let s=this.startNodeAtNode(e);return s.checkType=e,s.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(17),s.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(14),s.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(s,"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(O.ReservedTypeAssertion,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 s=this.state.startLoc,n=this.tsParseDelimitedList("HeritageClauseElement",()=>{let i=this.startNode();return i.expression=this.tsParseEntityName(),this.match(47)&&(i.typeParameters=this.tsParseTypeArguments()),this.finishNode(i,"TSExpressionWithTypeArguments")});return n.length||this.raise(O.EmptyHeritageClauseType,s,{token:e}),n}tsParseInterfaceDeclaration(e,s={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(129),s.declare&&(e.declare=!0),z(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(O.MissingInterfaceName,this.state.startLoc)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81)&&(e.extends=this.tsParseHeritageClause("extends"));let n=this.startNode();return n.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(n,"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 s=this.startNode();return this.next(),this.finishNode(s,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(e,"TSTypeAliasDeclaration")}tsInNoContext(e){let s=this.state.context;this.state.context=[s[0]];try{return e()}finally{this.state.context=s}}tsInType(e){let s=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=s}}tsInDisallowConditionalTypesContext(e){let s=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.state.inDisallowConditionalTypesContext=s}}tsInAllowConditionalTypesContext(e){let s=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.state.inDisallowConditionalTypesContext=s}}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,s={}){return s.const&&(e.const=!0),s.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,s=!1){if(e.id=this.parseIdentifier(),s||this.checkIdentifier(e.id,1024),this.eat(16)){let n=this.startNode();this.tsParseModuleOrNamespaceDeclaration(n,!0),e.body=n}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,s,n){e.isExport=n||!1,e.id=s||this.parseIdentifier(),this.checkIdentifier(e.id,4096),this.expect(29);let i=this.tsParseModuleReference();return e.importKind==="type"&&i.type!=="TSExternalModuleReference"&&this.raise(O.ImportAliasHasImportType,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 s=this.state.clone(),n=e();return this.state=s,n}tsTryParseAndCatch(e){let s=this.tryParse(n=>e()||n());if(!(s.aborted||!s.node))return s.error&&(this.state=s.failState),s.node}tsTryParse(e){let s=this.state.clone(),n=e();if(n!==void 0&&n!==!1)return n;this.state=s}tsTryParseDeclare(e){if(this.isLineTerminator())return;let s=this.state.type,n;return this.isContextual(100)&&(s=74,n="let"),this.tsInAmbientContext(()=>{switch(s){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,n||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(z(s))return this.tsParseDeclaration(e,this.state.value,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.value,!0,null)}tsParseExpressionStatement(e,s,n){switch(s.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=s,i.body=this.tsParseModuleBlock(),this.scope.exit(),this.prodParam.exit(),this.finishNode(i,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(e,s.name,!1,n)}}tsParseDeclaration(e,s,n,i){switch(s){case"abstract":if(this.tsCheckLineTerminator(n)&&(this.match(80)||z(this.state.type)))return this.tsParseAbstractDeclaration(e,i);break;case"module":if(this.tsCheckLineTerminator(n)){if(this.match(133))return this.tsParseAmbientExternalModuleDeclaration(e);if(z(this.state.type))return this.tsParseModuleOrNamespaceDeclaration(e)}break;case"namespace":if(this.tsCheckLineTerminator(n)&&z(this.state.type))return this.tsParseModuleOrNamespaceDeclaration(e);break;case"type":if(this.tsCheckLineTerminator(n)&&z(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 s=this.state.maybeInArrowParameters;this.state.maybeInArrowParameters=!0;let n=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=s,!!n)return super.parseArrowExpression(n,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(O.EmptyTypeArguments,e):!this.state.inType&&this.curContext()===K.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return $_(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseAssignableListItem(e,s){let n=this.state.startLoc,i={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},i);let a=i.accessibility,o=i.override,c=i.readonly;!(e&4)&&(a||c||o)&&this.raise(O.UnexpectedParameterModifier,n);let l=this.parseMaybeDefault();e&2&&this.parseFunctionParamType(l);let u=this.parseMaybeDefault(l.loc.start,l);if(a||c||o){let p=this.startNodeAt(n);return s.length&&(p.decorators=s),a&&(p.accessibility=a),c&&(p.readonly=c),o&&(p.override=o),u.type!=="Identifier"&&u.type!=="AssignmentPattern"&&this.raise(O.UnsupportedParameterPropertyKind,p),p.parameter=u,this.finishNode(p,"TSParameterProperty")}return s.length&&(l.decorators=s),u}isSimpleParameter(e){return e.type==="TSParameterProperty"&&super.isSimpleParameter(e.parameter)||super.isSimpleParameter(e)}tsDisallowOptionalPattern(e){for(let s of e.params)s.type!=="Identifier"&&s.optional&&!this.state.isAmbientContext&&this.raise(O.PatternIsOptional,s)}setArrowFunctionParameters(e,s,n){super.setArrowFunctionParameters(e,s,n),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,s,n=!1){this.match(14)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(14));let i=s==="FunctionDeclaration"?"TSDeclareFunction":s==="ClassMethod"||s==="ClassPrivateMethod"?"TSDeclareMethod":void 0;return i&&!this.match(5)&&this.isLineTerminator()?this.finishNode(e,i):i==="TSDeclareFunction"&&this.state.isAmbientContext&&(this.raise(O.DeclareFunctionHasImplementation,e),e.declare)?super.parseFunctionBodyAndFinish(e,i,n):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,s,n))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,1024):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(s=>{s?.type==="TSTypeCastExpression"&&this.raise(O.UnexpectedTypeAnnotation,s.typeAnnotation)})}toReferencedList(e,s){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,s,n,i){let a=super.parseArrayLike(e,s,n,i);return a.type==="ArrayExpression"&&this.tsCheckForInvalidTypeCasts(a.elements),a}parseSubscript(e,s,n,i){if(!this.hasPrecedingLineBreak()&&this.match(35)){this.state.canStartJSXElement=!1,this.next();let o=this.startNodeAt(s);return o.expression=e,this.finishNode(o,"TSNonNullExpression")}let a=!1;if(this.match(18)&&this.lookaheadCharCode()===60){if(n)return i.stop=!0,e;i.optionalChainMember=a=!0,this.next()}if(this.match(47)||this.match(51)){let o,c=this.tsTryParseAndCatch(()=>{if(!n&&this.atPossibleAsyncArrow(e)){let h=this.tsTryParseGenericAsyncArrowFunction(s);if(h)return h}let l=this.tsParseTypeArgumentsInExpression();if(!l)return;if(a&&!this.match(10)){o=this.state.curPosition();return}if(Ii(this.state.type)){let h=super.parseTaggedTemplateExpression(e,s,i);return h.typeParameters=l,h}if(!n&&this.eat(10)){let h=this.startNodeAt(s);return h.callee=e,h.arguments=this.parseCallExpressionArguments(11,!1),this.tsCheckForInvalidTypeCasts(h.arguments),h.typeParameters=l,i.optionalChainMember&&(h.optional=a),this.finishCallExpression(h,i.optionalChainMember)}let u=this.state.type;if(u===48||u===52||u!==10&&ac(u)&&!this.hasPrecedingLineBreak())return;let p=this.startNodeAt(s);return p.expression=e,p.typeParameters=l,this.finishNode(p,"TSInstantiationExpression")});if(o&&this.unexpected(o,10),c)return c.type==="TSInstantiationExpression"&&(this.match(16)||this.match(18)&&this.lookaheadCharCode()!==40)&&this.raise(O.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),c}return super.parseSubscript(e,s,n,i)}parseNewCallee(e){var s;super.parseNewCallee(e);let{callee:n}=e;n.type==="TSInstantiationExpression"&&!((s=n.extra)!=null&&s.parenthesized)&&(e.typeParameters=n.typeParameters,e.callee=n.expression)}parseExprOp(e,s,n){let i;if(Ai(58)>n&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(i=this.isContextual(120)))){let a=this.startNodeAt(s);return a.expression=e,a.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?(i&&this.raise(g.UnexpectedKeyword,this.state.startLoc,{keyword:"const"}),this.tsParseTypeReference()):this.tsParseType())),this.finishNode(a,i?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(a,s,n)}return super.parseExprOp(e,s,n)}checkReservedWord(e,s,n,i){this.state.isAmbientContext||super.checkReservedWord(e,s,n,i)}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(O.ImportReflectionHasImportType,e.specifiers[0].loc.start)}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){let s=this.lookaheadCharCode();return e?s===123||s===42:s!==61}return!e&&this.isContextual(87)}applyImportPhase(e,s,n,i){super.applyImportPhase(e,s,n,i),s?e.exportKind=n==="type"?"type":"value":e.importKind=n==="type"||n==="typeof"?n:"value"}parseImport(e){if(this.match(133))return e.importKind="value",super.parseImport(e);let s;if(z(this.state.type)&&this.lookaheadCharCode()===61)return e.importKind="value",this.tsParseImportEqualsDeclaration(e);if(this.isContextual(130)){let n=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.tsParseImportEqualsDeclaration(e,n);s=super.parseImportSpecifiersAndAfter(e,n)}else s=super.parseImport(e);return s.importKind==="type"&&s.specifiers.length>1&&s.specifiers[0].type==="ImportDefaultSpecifier"&&this.raise(O.TypeImportCannotSpecifyDefaultAndNamed,s),s}parseExport(e,s){if(this.match(83)){this.next();let n=e,i=null;return this.isContextual(130)&&this.isPotentialImportPhase(!1)?i=this.parseMaybeImportPhase(n,!1):n.importKind="value",this.tsParseImportEqualsDeclaration(n,i,!0)}else if(this.eat(29)){let n=e;return n.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(n,"TSExportAssignment")}else if(this.eatContextual(93)){let n=e;return this.expectContextual(128),n.id=this.parseIdentifier(),this.semicolon(),this.finishNode(n,"TSNamespaceExportDeclaration")}else return super.parseExport(e,s)}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,s,n=!1){let{isAmbientContext:i}=this.state,a=super.parseVarStatement(e,s,n||i);if(!i)return a;for(let{id:o,init:c}of a.declarations)c&&(s!=="const"||o.typeAnnotation?this.raise(O.InitializerNotAllowedInAmbientContext,c):Ax(c,this.hasPlugin("estree"))||this.raise(O.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,c));return a}parseStatementContent(e,s){if(this.match(75)&&this.isLookaheadContextual("enum")){let n=this.startNode();return this.expect(75),this.tsParseEnumDeclaration(n,{const:!0})}if(this.isContextual(126))return this.tsParseEnumDeclaration(this.startNode());if(this.isContextual(129)){let n=this.tsParseInterfaceDeclaration(this.startNode());if(n)return n}return super.parseStatementContent(e,s)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(e,s){return s.some(n=>Ld(n)?e.accessibility===n:!!e[n])}tsIsStartOfStaticBlocks(){return this.isContextual(106)&&this.lookaheadCharCode()===123}parseClassMember(e,s,n){let i=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:i,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:O.InvalidModifierOnTypeParameterPositions},s);let a=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(s,i)&&this.raise(O.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(e,s)):this.parseClassMemberWithIsStatic(e,s,n,!!s.static)};s.declare?this.tsInAmbientContext(a):a()}parseClassMemberWithIsStatic(e,s,n,i){let a=this.tsTryParseIndexSignature(s);if(a){e.body.push(a),s.abstract&&this.raise(O.IndexSignatureHasAbstract,s),s.accessibility&&this.raise(O.IndexSignatureHasAccessibility,s,{modifier:s.accessibility}),s.declare&&this.raise(O.IndexSignatureHasDeclare,s),s.override&&this.raise(O.IndexSignatureHasOverride,s);return}!this.state.inAbstractClass&&s.abstract&&this.raise(O.NonAbstractClassHasAbstractMethod,s),s.override&&(n.hadSuperClass||this.raise(O.OverrideNotInSubClass,s)),super.parseClassMemberWithIsStatic(e,s,n,i)}parsePostMemberNameModifiers(e){this.eat(17)&&(e.optional=!0),e.readonly&&this.match(10)&&this.raise(O.ClassMethodHasReadonly,e),e.declare&&this.match(10)&&this.raise(O.ClassMethodHasDeclare,e)}parseExpressionStatement(e,s,n){return(s.type==="Identifier"?this.tsParseExpressionStatement(e,s,n):void 0)||super.parseExpressionStatement(e,s,n)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(e,s,n){if(!this.state.maybeInArrowParameters||!this.match(17))return super.parseConditional(e,s,n);let i=this.tryParse(()=>super.parseConditional(e,s));return i.node?(i.error&&(this.state=i.failState),i.node):(i.error&&super.setOptionalParametersError(n,i.error),e)}parseParenItem(e,s){let n=super.parseParenItem(e,s);if(this.eat(17)&&(n.optional=!0,this.resetEndLocation(e)),this.match(14)){let i=this.startNodeAt(s);return i.expression=e,i.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(i,"TSTypeCastExpression")}return e}parseExportDeclaration(e){if(!this.state.isAmbientContext&&this.isContextual(125))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));let s=this.state.startLoc,n=this.eatContextual(125);if(n&&(this.isContextual(125)||!this.shouldParseExportDeclaration()))throw this.raise(O.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let a=z(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return a?((a.type==="TSInterfaceDeclaration"||a.type==="TSTypeAliasDeclaration"||n)&&(e.exportKind="type"),n&&(this.resetStartLocation(a,s),a.declare=!0),a):null}parseClassId(e,s,n,i){if((!s||n)&&this.isContextual(113))return;super.parseClassId(e,s,n,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 s=this.tsTryParseTypeAnnotation();s&&(e.typeAnnotation=s)}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&!(e.readonly&&!e.typeAnnotation)&&this.match(29)&&this.raise(O.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(29)){let{key:s}=e;this.raise(O.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:s.type==="Identifier"&&!e.computed?s.name:`[${this.input.slice(s.start,s.end)}]`})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(O.PrivateElementHasAbstract,e),e.accessibility&&this.raise(O.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(O.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,s,n,i,a,o){let c=this.tsTryParseTypeParameters(this.tsParseConstModifier);c&&a&&this.raise(O.ConstructorHasTypeParameters,c);let{declare:l=!1,kind:u}=s;l&&(u==="get"||u==="set")&&this.raise(O.DeclareAccessor,s,{kind:u}),c&&(s.typeParameters=c),super.pushClassMethod(e,s,n,i,a,o)}pushClassPrivateMethod(e,s,n,i){let a=this.tsTryParseTypeParameters(this.tsParseConstModifier);a&&(s.typeParameters=a),super.pushClassPrivateMethod(e,s,n,i)}declareClassPrivateMethodInScope(e,s){e.type!=="TSDeclareMethod"&&(e.type==="MethodDefinition"&&!hasOwnProperty.call(e.value,"body")||super.declareClassPrivateMethodInScope(e,s))}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,s,n,i,a,o,c){let l=this.tsTryParseTypeParameters(this.tsParseConstModifier);return l&&(e.typeParameters=l),super.parseObjPropValue(e,s,n,i,a,o,c)}parseFunctionParams(e,s){let n=this.tsTryParseTypeParameters(this.tsParseConstModifier);n&&(e.typeParameters=n),super.parseFunctionParams(e,s)}parseVarId(e,s){super.parseVarId(e,s),e.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(35)&&(e.definite=!0);let n=this.tsTryParseTypeAnnotation();n&&(e.id.typeAnnotation=n,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,s){return this.match(14)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,s)}parseMaybeAssign(e,s){var n,i,a,o,c;let l,u,p;if(this.hasPlugin("jsx")&&(this.match(142)||this.match(47))){if(l=this.state.clone(),u=this.tryParse(()=>super.parseMaybeAssign(e,s),l),!u.error)return u.node;let{context:f}=this.state,m=f[f.length-1];(m===K.j_oTag||m===K.j_expr)&&f.pop()}if(!((n=u)!=null&&n.error)&&!this.match(47))return super.parseMaybeAssign(e,s);(!l||l===this.state)&&(l=this.state.clone());let h,d=this.tryParse(f=>{var m,y;h=this.tsParseTypeParameters(this.tsParseConstModifier);let b=super.parseMaybeAssign(e,s);return(b.type!=="ArrowFunctionExpression"||(m=b.extra)!=null&&m.parenthesized)&&f(),((y=h)==null?void 0:y.params.length)!==0&&this.resetStartLocationFromNode(b,h),b.typeParameters=h,b},l);if(!d.error&&!d.aborted)return h&&this.reportReservedArrowTypeParam(h),d.node;if(!u&&(Md(!this.hasPlugin("jsx")),p=this.tryParse(()=>super.parseMaybeAssign(e,s),l),!p.error))return p.node;if((i=u)!=null&&i.node)return this.state=u.failState,u.node;if(d.node)return this.state=d.failState,h&&this.reportReservedArrowTypeParam(h),d.node;if((a=p)!=null&&a.node)return this.state=p.failState,p.node;throw((o=u)==null?void 0:o.error)||d.error||((c=p)==null?void 0:c.error)}reportReservedArrowTypeParam(e){var s;e.params.length===1&&!e.params[0].constraint&&!((s=e.extra)!=null&&s.trailingComma)&&this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(O.ReservedArrowTypeParam,e)}parseMaybeUnary(e,s){return!this.hasPlugin("jsx")&&this.match(47)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,s)}parseArrow(e){if(this.match(14)){let s=this.tryParse(n=>{let i=this.tsParseTypeOrTypePredicateAnnotation(14);return(this.canInsertSemicolon()||!this.match(19))&&n(),i});if(s.aborted)return;s.thrown||(s.error&&(this.state=s.failState),e.returnType=s.node)}return super.parseArrow(e)}parseFunctionParamType(e){this.eat(17)&&(e.optional=!0);let s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s),this.resetEndLocation(e),e}isAssignable(e,s){switch(e.type){case"TSTypeCastExpression":return this.isAssignable(e.expression,s);case"TSParameterProperty":return!0;default:return super.isAssignable(e,s)}}toAssignable(e,s=!1){switch(e.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(e,s);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":s?this.expressionScope.recordArrowParameterBindingError(O.UnexpectedTypeCastInParameter,e):this.raise(O.UnexpectedTypeCastInParameter,e),this.toAssignable(e.expression,s);break;case"AssignmentExpression":!s&&e.left.type==="TSTypeCastExpression"&&(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,s)}}toAssignableParenthesizedExpression(e,s){switch(e.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(e.expression,s);break;default:super.toAssignable(e,s)}}checkToRestConversion(e,s){switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(e.expression,!1);break;default:super.checkToRestConversion(e,s)}}isValidLVal(e,s,n){switch(e){case"TSTypeCastExpression":return!0;case"TSParameterProperty":return"parameter";case"TSNonNullExpression":case"TSInstantiationExpression":return"expression";case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return(n!==64||!s)&&["expression",!0];default:return super.isValidLVal(e,s,n)}}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e){if(this.match(47)||this.match(51)){let s=this.tsParseTypeArgumentsInExpression();if(this.match(10)){let n=super.parseMaybeDecoratorArguments(e);return n.typeParameters=s,n}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,s){let n=super.parseMaybeDefault(e,s);return n.type==="AssignmentPattern"&&n.typeAnnotation&&n.right.start<n.typeAnnotation.start&&this.raise(O.TypeAnnotationAfterAssign,n.typeAnnotation),n}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,s,n){for(let i=0;i<e.length;i++){let a=e[i];a?.type==="TSTypeCastExpression"&&(e[i]=this.typeCastToParameter(a))}super.toAssignableList(e,s,n)}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(s=>this.isAssignable(s,!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 s=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());s&&(e.typeParameters=s)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){let s=super.getGetterSetterExpectedParamCount(e),i=this.getObjectOrClassMethodParams(e)[0];return i&&this.isThisParam(i)?s+1:s}parseCatchClauseParam(){let e=super.parseCatchClauseParam(),s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s,this.resetEndLocation(e)),e}tsInAmbientContext(e){let{isAmbientContext:s,strict:n}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return e()}finally{this.state.isAmbientContext=s,this.state.strict=n}}parseClass(e,s,n){let i=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,s,n)}finally{this.state.inAbstractClass=i}}tsParseAbstractDeclaration(e,s){if(this.match(80))return e.abstract=!0,this.maybeTakeDecorators(s,this.parseClass(e,!0,!1));if(this.isContextual(129)){if(!this.hasFollowingLineBreak())return e.abstract=!0,this.raise(O.NonClassMethodPropertyHasAbstractModifer,e),this.tsParseInterfaceDeclaration(e)}else this.unexpected(null,80)}parseMethod(e,s,n,i,a,o,c){let l=super.parseMethod(e,s,n,i,a,o,c);if(l.abstract&&(this.hasPlugin("estree")?!!l.value.body:!!l.body)){let{key:p}=l;this.raise(O.AbstractMethodHasImplementation,l,{methodName:p.type==="Identifier"&&!l.computed?p.name:`[${this.input.slice(p.start,p.end)}]`})}return l}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,s,n,i){return!s&&i?(this.parseTypeOnlyImportExportSpecifier(e,!1,n),this.finishNode(e,"ExportSpecifier")):(e.exportKind="value",super.parseExportSpecifier(e,s,n,i))}parseImportSpecifier(e,s,n,i,a){return!s&&i?(this.parseTypeOnlyImportExportSpecifier(e,!0,n),this.finishNode(e,"ImportSpecifier")):(e.importKind="value",super.parseImportSpecifier(e,s,n,i,n?4098:4096))}parseTypeOnlyImportExportSpecifier(e,s,n){let i=s?"imported":"local",a=s?"local":"exported",o=e[i],c,l=!1,u=!0,p=o.loc.start;if(this.isContextual(93)){let d=this.parseIdentifier();if(this.isContextual(93)){let f=this.parseIdentifier();it(this.state.type)?(l=!0,o=d,c=s?this.parseIdentifier():this.parseModuleExportName(),u=!1):(c=f,u=!1)}else it(this.state.type)?(u=!1,c=s?this.parseIdentifier():this.parseModuleExportName()):(l=!0,o=d)}else it(this.state.type)&&(l=!0,s?(o=this.parseIdentifier(!0),this.isContextual(93)||this.checkReservedWord(o.name,o.loc.start,!0,!0)):o=this.parseModuleExportName());l&&n&&this.raise(s?O.TypeModifierIsUsedInTypeImports:O.TypeModifierIsUsedInTypeExports,p),e[i]=o,e[a]=c;let h=s?"importKind":"exportKind";e[h]=l?"type":"value",u&&this.eatContextual(93)&&(e[a]=s?this.parseIdentifier():this.parseModuleExportName()),e[a]||(e[a]=Mt(e[i])),s&&this.checkIdentifier(e[a],l?4098:4096)}};function vx(r){if(r.type!=="MemberExpression")return!1;let{computed:t,property:e}=r;return t&&e.type!=="StringLiteral"&&(e.type!=="TemplateLiteral"||e.expressions.length>0)?!1:Zd(r.object)}function Ax(r,t){var e;let{type:s}=r;if((e=r.extra)!=null&&e.parenthesized)return!1;if(t){if(s==="Literal"){let{value:n}=r;if(typeof n=="string"||typeof n=="boolean")return!0}}else if(s==="StringLiteral"||s==="BooleanLiteral")return!0;return!!(Qd(r,t)||Cx(r,t)||s==="TemplateLiteral"&&r.expressions.length===0||vx(r))}function Qd(r,t){return t?r.type==="Literal"&&(typeof r.value=="number"||"bigint"in r):r.type==="NumericLiteral"||r.type==="BigIntLiteral"}function Cx(r,t){if(r.type==="UnaryExpression"){let{operator:e,argument:s}=r;if(e==="-"&&Qd(s,t))return!0}return!1}function Zd(r){return r.type==="Identifier"?!0:r.type!=="MemberExpression"||r.computed?!1:Zd(r.object)}var Rd=Ot`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."}),wx=r=>class extends r{parsePlaceholder(e){if(this.match(144)){let s=this.startNode();return this.next(),this.assertNoSpace(),s.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(144),this.finishPlaceholder(s,e)}}finishPlaceholder(e,s){let n=e;return(!n.expectedNode||!n.type)&&(n=this.finishNode(n,"Placeholder")),n.expectedNode=s,n}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,s,n,i){e!==void 0&&super.checkReservedWord(e,s,n,i)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(e,s,n){return e==="Placeholder"||super.isValidLVal(e,s,n)}toAssignable(e,s){e&&e.type==="Placeholder"&&e.expectedNode==="Expression"?e.expectedNode="Pattern":super.toAssignable(e,s)}chStartsBindingIdentifier(e,s){return!!(super.chStartsBindingIdentifier(e,s)||this.lookahead().type===144)}verifyBreakContinue(e,s){e.label&&e.label.type==="Placeholder"||super.verifyBreakContinue(e,s)}parseExpressionStatement(e,s){var n;if(s.type!=="Placeholder"||(n=s.extra)!=null&&n.parenthesized)return super.parseExpressionStatement(e,s);if(this.match(14)){let a=e;return a.label=this.finishPlaceholder(s,"Identifier"),this.next(),a.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(a,"LabeledStatement")}this.semicolon();let i=e;return i.name=s.name,this.finishPlaceholder(i,"Statement")}parseBlock(e,s,n){return this.parsePlaceholder("BlockStatement")||super.parseBlock(e,s,n)}parseFunctionId(e){return this.parsePlaceholder("Identifier")||super.parseFunctionId(e)}parseClass(e,s,n){let i=s?"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(n||!s)return e.id=null,e.body=this.finishPlaceholder(o,"ClassBody"),this.finishNode(e,i);throw this.raise(Rd.ClassNameIsRequired,this.state.startLoc)}else this.parseClassId(e,s,n);return super.parseClassSuper(e),e.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!e.superClass,a),this.finishNode(e,i)}parseExport(e,s){let n=this.parsePlaceholder("Identifier");if(!n)return super.parseExport(e,s);let i=e;if(!this.isContextual(98)&&!this.match(12))return i.specifiers=[],i.source=null,i.declaration=this.finishPlaceholder(n,"Declaration"),this.finishNode(i,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");let a=this.startNode();return a.exported=n,i.specifiers=[this.finishNode(a,"ExportDefaultSpecifier")],super.parseExport(i,s)}isExportDefaultSpecifier(){if(this.match(65)){let e=this.nextTokenStart();if(this.isUnparsedContextual(e,"from")&&this.input.startsWith(Kt(144),this.nextTokenStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,s){var n;return(n=e.specifiers)!=null&&n.length?!0:super.maybeParseExportDefaultSpecifier(e,s)}checkExport(e){let{specifiers:s}=e;s!=null&&s.length&&(e.specifiers=s.filter(n=>n.exported.type==="Placeholder")),super.checkExport(e),e.specifiers=s}parseImport(e){let s=this.parsePlaceholder("Identifier");if(!s)return super.parseImport(e);if(e.specifiers=[],!this.isContextual(98)&&!this.match(12))return e.source=this.finishPlaceholder(s,"StringLiteral"),this.semicolon(),this.finishNode(e,"ImportDeclaration");let n=this.startNodeAtNode(s);return n.local=s,e.specifiers.push(this.finishNode(n,"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(Rd.UnexpectedSpace,this.state.lastTokEndLoc)}},Ix=r=>class extends r{parseV8Intrinsic(){if(this.match(54)){let e=this.state.startLoc,s=this.startNode();if(this.next(),z(this.state.type)){let n=this.parseIdentifierName(),i=this.createIdentifier(s,n);if(i.type="V8IntrinsicIdentifier",this.match(10))return i}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}},Fd=["minimal","fsharp","hack","smart"],Bd=["^^","@@","^","%","#"];function Nx(r){if(r.has("decorators")){if(r.has("decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");let e=r.get("decorators").decoratorsBeforeExport;if(e!=null&&typeof e!="boolean")throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");let s=r.get("decorators").allowCallParenthesized;if(s!=null&&typeof s!="boolean")throw new Error("'allowCallParenthesized' must be a boolean.")}if(r.has("flow")&&r.has("typescript"))throw new Error("Cannot combine flow and typescript plugins.");if(r.has("placeholders")&&r.has("v8intrinsic"))throw new Error("Cannot combine placeholders and v8intrinsic plugins.");if(r.has("pipelineOperator")){var t;let e=r.get("pipelineOperator").proposal;if(!Fd.includes(e)){let n=Fd.map(i=>`"${i}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${n}.`)}let s=((t=r.get("recordAndTuple"))==null?void 0:t.syntaxType)==="hash";if(e==="hack"){if(r.has("placeholders"))throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");if(r.has("v8intrinsic"))throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");let n=r.get("pipelineOperator").topicToken;if(!Bd.includes(n)){let i=Bd.map(a=>`"${a}"`).join(", ");throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${i}.`)}if(n==="#"&&s)throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple",r.get("recordAndTuple")])}\`.`)}else if(e==="smart"&&s)throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple",r.get("recordAndTuple")])}\`.`)}if(r.has("moduleAttributes")){if(r.has("importAttributes")||r.has("importAssertions"))throw new Error("Cannot combine importAssertions, importAttributes and moduleAttributes plugins.");if(r.get("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(r.has("importAssertions")&&r.has("importAttributes"))throw new Error("Cannot combine importAssertions and importAttributes plugins.");if(r.has("recordAndTuple")){let e=r.get("recordAndTuple").syntaxType;if(e!=null){let s=["hash","bar"];if(!s.includes(e))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+s.map(n=>`'${n}'`).join(", "))}}if(r.has("asyncDoExpressions")&&!r.has("doExpressions")){let e=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw e.missingPlugins="doExpressions",e}if(r.has("optionalChainingAssign")&&r.get("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 ef={estree:D_,jsx:_x,flow:bx,typescript:Px,v8intrinsic:Ix,placeholders:wx},kx=Object.keys(ef),rc={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 Dx(r){if(r==null)return Object.assign({},rc);if(r.annexB!=null&&r.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");let t={};for(let s of Object.keys(rc)){var e;t[s]=(e=r[s])!=null?e:rc[s]}return t}var Pc=class extends Tc{checkProto(t,e,s,n){if(t.type==="SpreadElement"||this.isObjectMethod(t)||t.computed||t.shorthand)return;let i=t.key;if((i.type==="Identifier"?i.name:i.value)==="__proto__"){if(e){this.raise(g.RecordNoProto,i);return}s.used&&(n?n.doubleProtoLoc===null&&(n.doubleProtoLoc=i.loc.start):this.raise(g.DuplicateProto,i)),s.used=!0}}shouldExitDescending(t,e){return t.type==="ArrowFunctionExpression"&&t.start===e}getExpression(){this.enterInitialScopes(),this.nextToken();let t=this.parseExpression();return this.match(139)||this.unexpected(),this.finalizeRemainingComments(),t.comments=this.comments,t.errors=this.state.errors,this.options.tokens&&(t.tokens=this.tokens),t}parseExpression(t,e){return t?this.disallowInAnd(()=>this.parseExpressionBase(e)):this.allowInAnd(()=>this.parseExpressionBase(e))}parseExpressionBase(t){let e=this.state.startLoc,s=this.parseMaybeAssign(t);if(this.match(12)){let n=this.startNodeAt(e);for(n.expressions=[s];this.eat(12);)n.expressions.push(this.parseMaybeAssign(t));return this.toReferencedList(n.expressions),this.finishNode(n,"SequenceExpression")}return s}parseMaybeAssignDisallowIn(t,e){return this.disallowInAnd(()=>this.parseMaybeAssign(t,e))}parseMaybeAssignAllowIn(t,e){return this.allowInAnd(()=>this.parseMaybeAssign(t,e))}setOptionalParametersError(t,e){var s;t.optionalParametersLoc=(s=e?.loc)!=null?s:this.state.startLoc}parseMaybeAssign(t,e){let s=this.state.startLoc;if(this.isContextual(108)&&this.prodParam.hasYield){let o=this.parseYield();return e&&(o=e.call(this,o,s)),o}let n;t?n=!1:(t=new Ks,n=!0);let{type:i}=this.state;(i===10||z(i))&&(this.state.potentialArrowAt=this.state.start);let a=this.parseMaybeConditional(t);if(e&&(a=e.call(this,a,s)),F_(this.state.type)){let o=this.startNodeAt(s),c=this.state.value;if(o.operator=c,this.match(29)){this.toAssignable(a,!0),o.left=a;let l=s.index;t.doubleProtoLoc!=null&&t.doubleProtoLoc.index>=l&&(t.doubleProtoLoc=null),t.shorthandAssignLoc!=null&&t.shorthandAssignLoc.index>=l&&(t.shorthandAssignLoc=null),t.privateKeyLoc!=null&&t.privateKeyLoc.index>=l&&(this.checkDestructuringPrivate(t),t.privateKeyLoc=null)}else o.left=a;return this.next(),o.right=this.parseMaybeAssign(),this.checkLVal(a,this.finishNode(o,"AssignmentExpression")),o}else n&&this.checkExpressionErrors(t,!0);return a}parseMaybeConditional(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,n=this.parseExprOps(t);return this.shouldExitDescending(n,s)?n:this.parseConditional(n,e,t)}parseConditional(t,e,s){if(this.eat(17)){let n=this.startNodeAt(e);return n.test=t,n.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),n.alternate=this.parseMaybeAssign(),this.finishNode(n,"ConditionalExpression")}return t}parseMaybeUnaryOrPrivate(t){return this.match(138)?this.parsePrivateName():this.parseMaybeUnary(t)}parseExprOps(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,n=this.parseMaybeUnaryOrPrivate(t);return this.shouldExitDescending(n,s)?n:this.parseExprOp(n,e,-1)}parseExprOp(t,e,s){if(this.isPrivateName(t)){let i=this.getPrivateNameSV(t);(s>=Ai(58)||!this.prodParam.hasIn||!this.match(58))&&this.raise(g.PrivateInExpectedIn,t,{identifierName:i}),this.classScope.usePrivateName(i,t.loc.start)}let n=this.state.type;if(j_(n)&&(this.prodParam.hasIn||!this.match(58))){let i=Ai(n);if(i>s){if(n===39){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return t;this.checkPipelineAtInfixOperator(t,e)}let a=this.startNodeAt(e);a.left=t,a.operator=this.state.value;let o=n===41||n===42,c=n===40;if(c&&(i=Ai(42)),this.next(),n===39&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])&&this.state.type===96&&this.prodParam.hasAwait)throw this.raise(g.UnexpectedAwaitAfterPipelineBody,this.state.startLoc);a.right=this.parseExprOpRightExpr(n,i);let l=this.finishNode(a,o||c?"LogicalExpression":"BinaryExpression"),u=this.state.type;if(c&&(u===41||u===42)||o&&u===40)throw this.raise(g.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(l,e,s)}}return t}parseExprOpRightExpr(t,e){let s=this.state.startLoc;switch(t){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(g.PipeBodyIsTighter,this.state.startLoc);return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(t,e),s)});case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(e))}default:return this.parseExprOpBaseRightExpr(t,e)}}parseExprOpBaseRightExpr(t,e){let s=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),s,H_(t)?e-1:e)}parseHackPipeBody(){var t;let{startLoc:e}=this.state,s=this.parseMaybeAssign();return C_.has(s.type)&&!((t=s.extra)!=null&&t.parenthesized)&&this.raise(g.PipeUnparenthesizedBody,e,{type:s.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(g.PipeTopicUnused,e),s}checkExponentialAfterUnary(t){this.match(57)&&this.raise(g.UnexpectedTokenUnaryExponentiation,t.argument)}parseMaybeUnary(t,e){let s=this.state.startLoc,n=this.isContextual(96);if(n&&this.recordAwaitIfAllowed()){this.next();let c=this.parseAwait(s);return e||this.checkExponentialAfterUnary(c),c}let i=this.match(34),a=this.startNode();if(q_(this.state.type)){a.operator=this.state.value,a.prefix=!0,this.match(72)&&this.expectPlugin("throwExpressions");let c=this.match(89);if(this.next(),a.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),this.state.strict&&c){let l=a.argument;l.type==="Identifier"?this.raise(g.StrictDelete,a):this.hasPropertyAsPrivateName(l)&&this.raise(g.DeletePrivateField,a)}if(!i)return e||this.checkExponentialAfterUnary(a),this.finishNode(a,"UnaryExpression")}let o=this.parseUpdate(a,i,t);if(n){let{type:c}=this.state;if((this.hasPlugin("v8intrinsic")?ac(c):ac(c)&&!this.match(54))&&!this.isAmbiguousAwait())return this.raiseOverwrite(g.AwaitNotInAsyncContext,s),this.parseAwait(s)}return o}parseUpdate(t,e,s){if(e){let a=t;return this.checkLVal(a.argument,this.finishNode(a,"UpdateExpression")),t}let n=this.state.startLoc,i=this.parseExprSubscripts(s);if(this.checkExpressionErrors(s,!1))return i;for(;U_(this.state.type)&&!this.canInsertSemicolon();){let a=this.startNodeAt(n);a.operator=this.state.value,a.prefix=!1,a.argument=i,this.next(),this.checkLVal(i,i=this.finishNode(a,"UpdateExpression"))}return i}parseExprSubscripts(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,n=this.parseExprAtom(t);return this.shouldExitDescending(n,s)?n:this.parseSubscripts(n,e)}parseSubscripts(t,e,s){let n={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(t),stop:!1};do t=this.parseSubscript(t,e,s,n),n.maybeAsyncArrow=!1;while(!n.stop);return t}parseSubscript(t,e,s,n){let{type:i}=this.state;if(!s&&i===15)return this.parseBind(t,e,s,n);if(Ii(i))return this.parseTaggedTemplateExpression(t,e,n);let a=!1;if(i===18){if(s&&(this.raise(g.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40))return n.stop=!0,t;n.optionalChainMember=a=!0,this.next()}if(!s&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(t,e,n,a);{let o=this.eat(0);return o||a||this.eat(16)?this.parseMember(t,e,n,o,a):(n.stop=!0,t)}}parseMember(t,e,s,n,i){let a=this.startNodeAt(e);return a.object=t,a.computed=n,n?(a.property=this.parseExpression(),this.expect(3)):this.match(138)?(t.type==="Super"&&this.raise(g.SuperPrivateField,e),this.classScope.usePrivateName(this.state.value,this.state.startLoc),a.property=this.parsePrivateName()):a.property=this.parseIdentifier(!0),s.optionalChainMember?(a.optional=i,this.finishNode(a,"OptionalMemberExpression")):this.finishNode(a,"MemberExpression")}parseBind(t,e,s,n){let i=this.startNodeAt(e);return i.object=t,this.next(),i.callee=this.parseNoCallExpr(),n.stop=!0,this.parseSubscripts(this.finishNode(i,"BindExpression"),e,s)}parseCoverCallAndAsyncArrowHead(t,e,s,n){let i=this.state.maybeInArrowParameters,a=null;this.state.maybeInArrowParameters=!0,this.next();let o=this.startNodeAt(e);o.callee=t;let{maybeAsyncArrow:c,optionalChainMember:l}=s;c&&(this.expressionScope.enter(ux()),a=new Ks),l&&(o.optional=n),n?o.arguments=this.parseCallExpressionArguments(11):o.arguments=this.parseCallExpressionArguments(11,t.type==="Import",t.type!=="Super",o,a);let u=this.finishCallExpression(o,l);return c&&this.shouldParseAsyncArrow()&&!n?(s.stop=!0,this.checkDestructuringPrivate(a),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),u=this.parseAsyncArrowFromCallExpression(this.startNodeAt(e),u)):(c&&(this.checkExpressionErrors(a,!0),this.expressionScope.exit()),this.toReferencedArguments(u)),this.state.maybeInArrowParameters=i,u}toReferencedArguments(t,e){this.toReferencedListDeep(t.arguments,e)}parseTaggedTemplateExpression(t,e,s){let n=this.startNodeAt(e);return n.tag=t,n.quasi=this.parseTemplate(!0),s.optionalChainMember&&this.raise(g.OptionalChainingNoTemplate,e),this.finishNode(n,"TaggedTemplateExpression")}atPossibleAsyncArrow(t){return t.type==="Identifier"&&t.name==="async"&&this.state.lastTokEndLoc.index===t.end&&!this.canInsertSemicolon()&&t.end-t.start===5&&t.start===this.state.potentialArrowAt}finishCallExpression(t,e){if(t.callee.type==="Import")if(t.arguments.length===2&&(this.hasPlugin("moduleAttributes")||this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes")),t.arguments.length===0||t.arguments.length>2)this.raise(g.ImportCallArity,t,{maxArgumentCount:this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions")||this.hasPlugin("moduleAttributes")?2:1});else for(let s of t.arguments)s.type==="SpreadElement"&&this.raise(g.ImportCallSpreadArgument,s);return this.finishNode(t,e?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(t,e,s,n,i){let a=[],o=!0,c=this.state.inFSharpPipelineDirectBody;for(this.state.inFSharpPipelineDirectBody=!1;!this.eat(t);){if(o)o=!1;else if(this.expect(12),this.match(t)){e&&!this.hasPlugin("importAttributes")&&!this.hasPlugin("importAssertions")&&!this.hasPlugin("moduleAttributes")&&this.raise(g.ImportCallArgumentTrailingComma,this.state.lastTokStartLoc),n&&this.addTrailingCommaExtraToNode(n),this.next();break}a.push(this.parseExprListItem(!1,i,s))}return this.state.inFSharpPipelineDirectBody=c,a}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(t,e){var s;return this.resetPreviousNodeTrailingComments(e),this.expect(19),this.parseArrowExpression(t,e.arguments,!0,(s=e.extra)==null?void 0:s.trailingCommaLoc),e.innerComments&&Zr(t,e.innerComments),e.callee.trailingComments&&Zr(t,e.callee.trailingComments),t}parseNoCallExpr(){let t=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),t,!0)}parseExprAtom(t){let e,s=null,{type:n}=this.state;switch(n){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(g.UnsupportedImport,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 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,t);case 6:case 7:return this.parseObjectLike(this.state.type===6?9:8,!1,!0);case 5:return this.parseObjectLike(8,!1,!1,t);case 68:return this.parseFunctionOrFunctionSent();case 26:s=this.parseDecorators();case 80:return this.parseClass(this.maybeTakeDecorators(s,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(g.UnsupportedBind,i)}case 138:return this.raise(g.PrivateInExpectedIn,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());Dt(i)||i===62?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected();break}default:if(n===136)return this.parseDecimalLiteral(this.state.value);if(z(n)){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:c}=this.state;if(c===68)return this.resetPreviousNodeTrailingComments(o),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(o));if(z(c))return this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(o)):o;if(c===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(t,e){let s=this.getPluginOption("pipelineOperator","proposal");if(s)return this.state.type=t,this.state.value=e,this.state.pos--,this.state.end--,this.state.endLoc=De(this.state.endLoc,-1),this.parseTopicReference(s);this.unexpected()}parseTopicReference(t){let e=this.startNode(),s=this.state.startLoc,n=this.state.type;return this.next(),this.finishTopicReference(e,s,t,n)}finishTopicReference(t,e,s,n){if(this.testTopicReferenceConfiguration(s,e,n)){let i=s==="smart"?"PipelinePrimaryTopicReference":"TopicReference";return this.topicReferenceIsAllowedInCurrentContext()||this.raise(s==="smart"?g.PrimaryTopicNotAllowed:g.PipeTopicUnbound,e),this.registerTopicReference(),this.finishNode(t,i)}else throw this.raise(g.PipeTopicUnconfiguredToken,e,{token:Kt(n)})}testTopicReferenceConfiguration(t,e,s){switch(t){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:Kt(s)}]);case"smart":return s===27;default:throw this.raise(g.PipeTopicRequiresHackPipes,e)}}parseAsyncArrowUnaryFunction(t){this.prodParam.enter(Ci(!0,this.prodParam.hasYield));let e=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(g.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(19),this.parseArrowExpression(t,e,!0)}parseDo(t,e){this.expectPlugin("doExpressions"),e&&this.expectPlugin("asyncDoExpressions"),t.async=e,this.next();let s=this.state.labels;return this.state.labels=[],e?(this.prodParam.enter(2),t.body=this.parseBlock(),this.prodParam.exit()):t.body=this.parseBlock(),this.state.labels=s,this.finishNode(t,"DoExpression")}parseSuper(){let t=this.startNode();return this.next(),this.match(10)&&!this.scope.allowDirectSuper&&!this.options.allowSuperOutsideMethod?this.raise(g.SuperNotAllowed,t):!this.scope.allowSuper&&!this.options.allowSuperOutsideMethod&&this.raise(g.UnexpectedSuper,t),!this.match(10)&&!this.match(0)&&!this.match(16)&&this.raise(g.UnsupportedSuper,t),this.finishNode(t,"Super")}parsePrivateName(){let t=this.startNode(),e=this.startNodeAt(De(this.state.startLoc,1)),s=this.state.value;return this.next(),t.id=this.createIdentifier(e,s),this.finishNode(t,"PrivateName")}parseFunctionOrFunctionSent(){let t=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(t),"function");return this.next(),this.match(103)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected(),this.parseMetaProperty(t,e,"sent")}return this.parseFunction(t)}parseMetaProperty(t,e,s){t.meta=e;let n=this.state.containsEsc;return t.property=this.parseIdentifier(!0),(t.property.name!==s||n)&&this.raise(g.UnsupportedMetaProperty,t.property,{target:e.name,onlyValidPropertyName:s}),this.finishNode(t,"MetaProperty")}parseImportMetaProperty(t){let e=this.createIdentifier(this.startNodeAtNode(t),"import");if(this.next(),this.isContextual(101))this.inModule||this.raise(g.ImportMetaOutsideModule,e),this.sawUnambiguousESM=!0;else if(this.isContextual(105)||this.isContextual(97)){let s=this.isContextual(105);if(s||this.unexpected(),this.expectPlugin(s?"sourcePhaseImports":"deferredImportEvaluation"),!this.options.createImportExpressions)throw this.raise(g.DynamicImportPhaseRequiresImportExpressions,this.state.startLoc,{phase:this.state.value});return this.next(),t.phase=s?"source":"defer",this.parseImportCall(t)}return this.parseMetaProperty(t,e,"meta")}parseLiteralAtNode(t,e,s){return this.addExtra(s,"rawValue",t),this.addExtra(s,"raw",this.input.slice(s.start,this.state.end)),s.value=t,this.next(),this.finishNode(s,e)}parseLiteral(t,e){let s=this.startNode();return this.parseLiteralAtNode(t,e,s)}parseStringLiteral(t){return this.parseLiteral(t,"StringLiteral")}parseNumericLiteral(t){return this.parseLiteral(t,"NumericLiteral")}parseBigIntLiteral(t){return this.parseLiteral(t,"BigIntLiteral")}parseDecimalLiteral(t){return this.parseLiteral(t,"DecimalLiteral")}parseRegExpLiteral(t){let e=this.startNode();return this.addExtra(e,"raw",this.input.slice(e.start,this.state.end)),e.pattern=t.pattern,e.flags=t.flags,this.next(),this.finishNode(e,"RegExpLiteral")}parseBooleanLiteral(t){let e=this.startNode();return e.value=t,this.next(),this.finishNode(e,"BooleanLiteral")}parseNullLiteral(){let t=this.startNode();return this.next(),this.finishNode(t,"NullLiteral")}parseParenAndDistinguishExpression(t){let e=this.state.startLoc,s;this.next(),this.expressionScope.enter(lx());let n=this.state.maybeInArrowParameters,i=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;let a=this.state.startLoc,o=[],c=new Ks,l=!0,u,p;for(;!this.match(11);){if(l)l=!1;else if(this.expect(12,c.optionalParametersLoc===null?null:c.optionalParametersLoc),this.match(11)){p=this.state.startLoc;break}if(this.match(21)){let f=this.state.startLoc;if(u=this.state.startLoc,o.push(this.parseParenItem(this.parseRestBinding(),f)),!this.checkCommaAfterRest(41))break}else o.push(this.parseMaybeAssignAllowIn(c,this.parseParenItem))}let h=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=n,this.state.inFSharpPipelineDirectBody=i;let d=this.startNodeAt(e);return t&&this.shouldParseArrow(o)&&(d=this.parseArrow(d))?(this.checkDestructuringPrivate(c),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(d,o,!1),d):(this.expressionScope.exit(),o.length||this.unexpected(this.state.lastTokStartLoc),p&&this.unexpected(p),u&&this.unexpected(u),this.checkExpressionErrors(c,!0),this.toReferencedListDeep(o,!0),o.length>1?(s=this.startNodeAt(a),s.expressions=o,this.finishNode(s,"SequenceExpression"),this.resetEndLocation(s,h)):s=o[0],this.wrapParenthesis(e,s))}wrapParenthesis(t,e){if(!this.options.createParenthesizedExpressions)return this.addExtra(e,"parenthesized",!0),this.addExtra(e,"parenStart",t.index),this.takeSurroundingComments(e,t.index,this.state.lastTokEndLoc.index),e;let s=this.startNodeAt(t);return s.expression=e,this.finishNode(s,"ParenthesizedExpression")}shouldParseArrow(t){return!this.canInsertSemicolon()}parseArrow(t){if(this.eat(19))return t}parseParenItem(t,e){return t}parseNewOrNewTarget(){let t=this.startNode();if(this.next(),this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(t),"new");this.next();let s=this.parseMetaProperty(t,e,"target");return!this.scope.inNonArrowFunction&&!this.scope.inClass&&!this.options.allowNewTargetOutsideFunction&&this.raise(g.UnexpectedNewTarget,s),s}return this.parseNew(t)}parseNew(t){if(this.parseNewCallee(t),this.eat(10)){let e=this.parseExprList(11);this.toReferencedList(e),t.arguments=e}else t.arguments=[];return this.finishNode(t,"NewExpression")}parseNewCallee(t){let e=this.match(83),s=this.parseNoCallExpr();t.callee=s,e&&(s.type==="Import"||s.type==="ImportExpression")&&this.raise(g.ImportCallNotNewExpression,s)}parseTemplateElement(t){let{start:e,startLoc:s,end:n,value:i}=this.state,a=e+1,o=this.startNodeAt(De(s,1));i===null&&(t||this.raise(g.InvalidEscapeSequenceTemplate,De(this.state.firstInvalidTemplateEscapePos,1)));let c=this.match(24),l=c?-1:-2,u=n+l;o.value={raw:this.input.slice(a,u).replace(/\r\n?/g,`
|
|
8
|
+
`),cooked:i===null?null:i.slice(1,l)},o.tail=c,this.next();let p=this.finishNode(o,"TemplateElement");return this.resetEndLocation(p,De(this.state.lastTokEndLoc,l)),p}parseTemplate(t){let e=this.startNode(),s=this.parseTemplateElement(t),n=[s],i=[];for(;!s.tail;)i.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),n.push(s=this.parseTemplateElement(t));return e.expressions=i,e.quasis=n,this.finishNode(e,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(t,e,s,n){s&&this.expectPlugin("recordAndTuple");let i=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let a=Object.create(null),o=!0,c=this.startNode();for(c.properties=[],this.next();!this.match(t);){if(o)o=!1;else if(this.expect(12),this.match(t)){this.addTrailingCommaExtraToNode(c);break}let u;e?u=this.parseBindingProperty():(u=this.parsePropertyDefinition(n),this.checkProto(u,s,a,n)),s&&!this.isObjectProperty(u)&&u.type!=="SpreadElement"&&this.raise(g.InvalidRecordProperty,u),u.shorthand&&this.addExtra(u,"shorthand",!0),c.properties.push(u)}this.next(),this.state.inFSharpPipelineDirectBody=i;let l="ObjectExpression";return e?l="ObjectPattern":s&&(l="RecordExpression"),this.finishNode(c,l)}addTrailingCommaExtraToNode(t){this.addExtra(t,"trailingComma",this.state.lastTokStartLoc.index),this.addExtra(t,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(t){return!t.computed&&t.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(t){let e=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(g.UnsupportedPropertyDecorator,this.state.startLoc);this.match(26);)e.push(this.parseDecorator());let s=this.startNode(),n=!1,i=!1,a;if(this.match(21))return e.length&&this.unexpected(),this.parseSpread();e.length&&(s.decorators=e,e=[]),s.method=!1,t&&(a=this.state.startLoc);let o=this.eat(55);this.parsePropertyNamePrefixOperator(s);let c=this.state.containsEsc;if(this.parsePropertyName(s,t),!o&&!c&&this.maybeAsyncOrAccessorProp(s)){let{key:l}=s,u=l.name;u==="async"&&!this.hasPrecedingLineBreak()&&(n=!0,this.resetPreviousNodeTrailingComments(l),o=this.eat(55),this.parsePropertyName(s)),(u==="get"||u==="set")&&(i=!0,this.resetPreviousNodeTrailingComments(l),s.kind=u,this.match(55)&&(o=!0,this.raise(g.AccessorIsGenerator,this.state.curPosition(),{kind:u}),this.next()),this.parsePropertyName(s))}return this.parseObjPropValue(s,a,o,n,!1,i,t)}getGetterSetterExpectedParamCount(t){return t.kind==="get"?0:1}getObjectOrClassMethodParams(t){return t.params}checkGetterSetterParams(t){var e;let s=this.getGetterSetterExpectedParamCount(t),n=this.getObjectOrClassMethodParams(t);n.length!==s&&this.raise(t.kind==="get"?g.BadGetterArity:g.BadSetterArity,t),t.kind==="set"&&((e=n[n.length-1])==null?void 0:e.type)==="RestElement"&&this.raise(g.BadSetterRestParameter,t)}parseObjectMethod(t,e,s,n,i){if(i){let a=this.parseMethod(t,e,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(a),a}if(s||e||this.match(10))return n&&this.unexpected(),t.kind="method",t.method=!0,this.parseMethod(t,e,s,!1,!1,"ObjectMethod")}parseObjectProperty(t,e,s,n){if(t.shorthand=!1,this.eat(14))return t.value=s?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowIn(n),this.finishNode(t,"ObjectProperty");if(!t.computed&&t.key.type==="Identifier"){if(this.checkReservedWord(t.key.name,t.key.loc.start,!0,!1),s)t.value=this.parseMaybeDefault(e,Mt(t.key));else if(this.match(29)){let i=this.state.startLoc;n!=null?n.shorthandAssignLoc===null&&(n.shorthandAssignLoc=i):this.raise(g.InvalidCoverInitializedName,i),t.value=this.parseMaybeDefault(e,Mt(t.key))}else t.value=Mt(t.key);return t.shorthand=!0,this.finishNode(t,"ObjectProperty")}}parseObjPropValue(t,e,s,n,i,a,o){let c=this.parseObjectMethod(t,s,n,i,a)||this.parseObjectProperty(t,e,i,o);return c||this.unexpected(),c}parsePropertyName(t,e){if(this.eat(0))t.computed=!0,t.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let{type:s,value:n}=this.state,i;if(it(s))i=this.parseIdentifier(!0);else switch(s){case 134:i=this.parseNumericLiteral(n);break;case 133:i=this.parseStringLiteral(n);break;case 135:i=this.parseBigIntLiteral(n);break;case 138:{let a=this.state.startLoc;e!=null?e.privateKeyLoc===null&&(e.privateKeyLoc=a):this.raise(g.UnexpectedPrivateField,a),i=this.parsePrivateName();break}default:if(s===136){i=this.parseDecimalLiteral(n);break}this.unexpected()}t.key=i,s!==138&&(t.computed=!1)}}initFunction(t,e){t.id=null,t.generator=!1,t.async=e}parseMethod(t,e,s,n,i,a,o=!1){this.initFunction(t,s),t.generator=e,this.scope.enter(18|(o?64:0)|(i?32:0)),this.prodParam.enter(Ci(s,t.generator)),this.parseFunctionParams(t,n);let c=this.parseFunctionBodyAndFinish(t,a,!0);return this.prodParam.exit(),this.scope.exit(),c}parseArrayLike(t,e,s,n){s&&this.expectPlugin("recordAndTuple");let i=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let a=this.startNode();return this.next(),a.elements=this.parseExprList(t,!s,n,a),this.state.inFSharpPipelineDirectBody=i,this.finishNode(a,s?"TupleExpression":"ArrayExpression")}parseArrowExpression(t,e,s,n){this.scope.enter(6);let i=Ci(s,!1);!this.match(5)&&this.prodParam.hasIn&&(i|=8),this.prodParam.enter(i),this.initFunction(t,s);let a=this.state.maybeInArrowParameters;return e&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(t,e,n)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(t,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=a,this.finishNode(t,"ArrowFunctionExpression")}setArrowFunctionParameters(t,e,s){this.toAssignableList(e,s,!1),t.params=e}parseFunctionBodyAndFinish(t,e,s=!1){return this.parseFunctionBody(t,!1,s),this.finishNode(t,e)}parseFunctionBody(t,e,s=!1){let n=e&&!this.match(5);if(this.expressionScope.enter(Kd()),n)t.body=this.parseMaybeAssign(),this.checkParams(t,!1,e,!1);else{let i=this.state.strict,a=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),t.body=this.parseBlock(!0,!1,o=>{let c=!this.isSimpleParamList(t.params);o&&c&&this.raise(g.IllegalLanguageModeDirective,(t.kind==="method"||t.kind==="constructor")&&t.key?t.key.loc.end:t);let l=!i&&this.state.strict;this.checkParams(t,!this.state.strict&&!e&&!s&&!c,e,l),this.state.strict&&t.id&&this.checkIdentifier(t.id,65,l)}),this.prodParam.exit(),this.state.labels=a}this.expressionScope.exit()}isSimpleParameter(t){return t.type==="Identifier"}isSimpleParamList(t){for(let e=0,s=t.length;e<s;e++)if(!this.isSimpleParameter(t[e]))return!1;return!0}checkParams(t,e,s,n=!0){let i=!e&&new Set,a={type:"FormalParameters"};for(let o of t.params)this.checkLVal(o,a,5,i,n)}parseExprList(t,e,s,n){let i=[],a=!0;for(;!this.eat(t);){if(a)a=!1;else if(this.expect(12),this.match(t)){n&&this.addTrailingCommaExtraToNode(n),this.next();break}i.push(this.parseExprListItem(e,s))}return i}parseExprListItem(t,e,s){let n;if(this.match(12))t||this.raise(g.UnexpectedToken,this.state.curPosition(),{unexpected:","}),n=null;else if(this.match(21)){let i=this.state.startLoc;n=this.parseParenItem(this.parseSpread(e),i)}else if(this.match(17)){this.expectPlugin("partialApplication"),s||this.raise(g.UnexpectedArgumentPlaceholder,this.state.startLoc);let i=this.startNode();this.next(),n=this.finishNode(i,"ArgumentPlaceholder")}else n=this.parseMaybeAssignAllowIn(e,this.parseParenItem);return n}parseIdentifier(t){let e=this.startNode(),s=this.parseIdentifierName(t);return this.createIdentifier(e,s)}createIdentifier(t,e){return t.name=e,t.loc.identifierName=e,this.finishNode(t,"Identifier")}parseIdentifierName(t){let e,{startLoc:s,type:n}=this.state;it(n)?e=this.state.value:this.unexpected();let i=L_(n);return t?i&&this.replaceToken(132):this.checkReservedWord(e,s,i,!1),this.next(),e}checkReservedWord(t,e,s,n){if(t.length>10||!ex(t))return;if(s&&X_(t)){this.raise(g.UnexpectedKeyword,e,{keyword:t});return}if((this.state.strict?n?Yd:Hd:$d)(t,this.inModule)){this.raise(g.UnexpectedReservedWord,e,{reservedWord:t});return}else if(t==="yield"){if(this.prodParam.hasYield){this.raise(g.YieldBindingIdentifier,e);return}}else if(t==="await"){if(this.prodParam.hasAwait){this.raise(g.AwaitBindingIdentifier,e);return}if(this.scope.inStaticBlock){this.raise(g.AwaitBindingIdentifierInStaticBlock,e);return}this.expressionScope.recordAsyncArrowParametersError(e)}else if(t==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(g.ArgumentsInClass,e);return}}recordAwaitIfAllowed(){let t=this.prodParam.hasAwait||this.options.allowAwaitOutsideFunction&&!this.scope.inFunction;return t&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),t}parseAwait(t){let e=this.startNodeAt(t);return this.expressionScope.recordParameterInitializerError(g.AwaitExpressionFormalParameter,e),this.eat(55)&&this.raise(g.ObsoleteAwaitStar,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:t}=this.state;return t===53||t===10||t===0||Ii(t)||t===102&&!this.state.containsEsc||t===137||t===56||this.hasPlugin("v8intrinsic")&&t===54}parseYield(){let t=this.startNode();this.expressionScope.recordParameterInitializerError(g.YieldInParameter,t),this.next();let e=!1,s=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:s=this.parseMaybeAssign()}return t.delegate=e,t.argument=s,this.finishNode(t,"YieldExpression")}parseImportCall(t){return this.next(),t.source=this.parseMaybeAssignAllowIn(),(this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions"))&&(t.options=null),this.eat(12)&&(this.hasPlugin("moduleAttributes")||this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes"),this.match(11)||(t.options=this.parseMaybeAssignAllowIn(),this.eat(12))),this.expect(11),this.finishNode(t,"ImportExpression")}checkPipelineAtInfixOperator(t,e){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&t.type==="SequenceExpression"&&this.raise(g.PipelineHeadSequenceExpression,e)}parseSmartPipelineBodyInStyle(t,e){if(this.isSimpleReference(t)){let s=this.startNodeAt(e);return s.callee=t,this.finishNode(s,"PipelineBareFunction")}else{let s=this.startNodeAt(e);return this.checkSmartPipeTopicBodyEarlyErrors(e),s.expression=t,this.finishNode(s,"PipelineTopicExpression")}}isSimpleReference(t){switch(t.type){case"MemberExpression":return!t.computed&&this.isSimpleReference(t.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(t){if(this.match(19))throw this.raise(g.PipelineBodyNoArrow,this.state.startLoc);this.topicReferenceWasUsedInCurrentContext()||this.raise(g.PipelineTopicUnused,t)}withTopicBindingContext(t){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return t()}finally{this.state.topicContext=e}}withSmartMixTopicForbiddingContext(t){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return t()}finally{this.state.topicContext=e}}else return t()}withSoloAwaitPermittingContext(t){let e=this.state.soloAwait;this.state.soloAwait=!0;try{return t()}finally{this.state.soloAwait=e}}allowInAnd(t){let e=this.prodParam.currentFlags();if(8&~e){this.prodParam.enter(e|8);try{return t()}finally{this.prodParam.exit()}}return t()}disallowInAnd(t){let e=this.prodParam.currentFlags();if(8&e){this.prodParam.enter(e&-9);try{return t()}finally{this.prodParam.exit()}}return t()}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(t){let e=this.state.startLoc;this.state.potentialArrowAt=this.state.start;let s=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;let n=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),e,t);return this.state.inFSharpPipelineDirectBody=s,n}parseModuleExpression(){this.expectPlugin("moduleBlocks");let t=this.startNode();this.next(),this.match(5)||this.unexpected(null,5);let e=this.startNodeAt(this.state.endLoc);this.next();let s=this.initializeScopes(!0);this.enterInitialScopes();try{t.body=this.parseProgram(e,8,"module")}finally{s()}return this.finishNode(t,"ModuleExpression")}parsePropertyNamePrefixOperator(t){}},nc={kind:1},Ox={kind:2},Mx=/[\uD800-\uDFFF]/u,ic=/in(?:stanceof)?/y;function Lx(r,t){for(let e=0;e<r.length;e++){let s=r[e],{type:n}=s;if(typeof n=="number"){{if(n===138){let{loc:i,start:a,value:o,end:c}=s,l=a+1,u=De(i.start,1);r.splice(e,1,new ft({type:Nt(27),value:"#",start:a,end:l,startLoc:i.start,endLoc:u}),new ft({type:Nt(132),value:o,start:l,end:c,startLoc:u,endLoc:i.end})),e++;continue}if(Ii(n)){let{loc:i,start:a,value:o,end:c}=s,l=a+1,u=De(i.start,1),p;t.charCodeAt(a)===96?p=new ft({type:Nt(22),value:"`",start:a,end:l,startLoc:i.start,endLoc:u}):p=new ft({type:Nt(8),value:"}",start:a,end:l,startLoc:i.start,endLoc:u});let h,d,f,m;n===24?(d=c-1,f=De(i.end,-1),h=o===null?null:o.slice(1,-1),m=new ft({type:Nt(22),value:"`",start:d,end:c,startLoc:f,endLoc:i.end})):(d=c-2,f=De(i.end,-2),h=o===null?null:o.slice(1,-2),m=new ft({type:Nt(23),value:"${",start:d,end:c,startLoc:f,endLoc:i.end})),r.splice(e,1,p,new ft({type:Nt(20),value:h,start:l,end:d,startLoc:u,endLoc:f}),m),e+=2;continue}}s.type=Nt(n)}}return r}var vc=class extends Pc{parseTopLevel(t,e){return t.program=this.parseProgram(e),t.comments=this.comments,this.options.tokens&&(t.tokens=Lx(this.tokens,this.input)),this.finishNode(t,"File")}parseProgram(t,e=139,s=this.options.sourceType){if(t.sourceType=s,t.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(t,!0,!0,e),this.inModule){if(!this.options.allowUndeclaredExports&&this.scope.undefinedExports.size>0)for(let[i,a]of Array.from(this.scope.undefinedExports))this.raise(g.ModuleExportUndefined,a,{localName:i});this.addExtra(t,"topLevelAwait",this.state.hasTopLevelAwait)}let n;return e===139?n=this.finishNode(t,"Program"):n=this.finishNodeAt(t,"Program",De(this.state.startLoc,-1)),n}stmtToDirective(t){let e=t;e.type="Directive",e.value=e.expression,delete e.expression;let s=e.value,n=s.value,i=this.input.slice(s.start,s.end),a=s.value=i.slice(1,-1);return this.addExtra(s,"raw",i),this.addExtra(s,"rawValue",a),this.addExtra(s,"expressionValue",n),s.type="DirectiveLiteral",e}parseInterpreterDirective(){if(!this.match(28))return null;let t=this.startNode();return t.value=this.state.value,this.next(),this.finishNode(t,"InterpreterDirective")}isLet(){return this.isContextual(100)?this.hasFollowingBindingAtom():!1}chStartsBindingIdentifier(t,e){if(Dt(t)){if(ic.lastIndex=e,ic.test(this.input)){let s=this.codePointAtPos(ic.lastIndex);if(!zs(s)&&s!==92)return!1}return!0}else return t===92}chStartsBindingPattern(t){return t===91||t===123}hasFollowingBindingAtom(){let t=this.nextTokenStart(),e=this.codePointAtPos(t);return this.chStartsBindingPattern(e)||this.chStartsBindingIdentifier(e,t)}hasInLineFollowingBindingIdentifierOrBrace(){let t=this.nextTokenInLineStart(),e=this.codePointAtPos(t);return e===123||this.chStartsBindingIdentifier(e,t)}startsUsingForOf(){let{type:t,containsEsc:e}=this.lookahead();if(t===102&&!e)return!1;if(z(t)&&!this.hasFollowingLineBreak())return this.expectPlugin("explicitResourceManagement"),!0}startsAwaitUsing(){let t=this.nextTokenInLineStart();if(this.isUnparsedContextual(t,"using")){t=this.nextTokenInLineStartSince(t+5);let e=this.codePointAtPos(t);if(this.chStartsBindingIdentifier(e,t))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(t=!1){let e=0;return this.options.annexB&&!this.state.strict&&(e|=4,t&&(e|=8)),this.parseStatementLike(e)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(t){let e=null;return this.match(26)&&(e=this.parseDecorators(!0)),this.parseStatementContent(t,e)}parseStatementContent(t,e){let s=this.state.type,n=this.startNode(),i=!!(t&2),a=!!(t&4),o=t&1;switch(s){case 60:return this.parseBreakContinueStatement(n,!0);case 63:return this.parseBreakContinueStatement(n,!1);case 64:return this.parseDebuggerStatement(n);case 90:return this.parseDoWhileStatement(n);case 91:return this.parseForStatement(n);case 68:if(this.lookaheadCharCode()===46)break;return a||this.raise(this.state.strict?g.StrictFunction:this.options.annexB?g.SloppyFunctionAnnexB:g.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(n,!1,!i&&a);case 80:return i||this.unexpected(),this.parseClass(this.maybeTakeDecorators(e,n),!0);case 69:return this.parseIfStatement(n);case 70:return this.parseReturnStatement(n);case 71:return this.parseSwitchStatement(n);case 72:return this.parseThrowStatement(n);case 73:return this.parseTryStatement(n);case 96:if(!this.state.containsEsc&&this.startsAwaitUsing())return this.recordAwaitIfAllowed()?i||this.raise(g.UnexpectedLexicalDeclaration,n):this.raise(g.AwaitUsingNotInAsyncContext,n),this.next(),this.parseVarStatement(n,"await using");break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.expectPlugin("explicitResourceManagement"),!this.scope.inModule&&this.scope.inTopLevel?this.raise(g.UnexpectedUsingDeclaration,this.state.startLoc):i||this.raise(g.UnexpectedLexicalDeclaration,this.state.startLoc),this.parseVarStatement(n,"using");case 100:{if(this.state.containsEsc)break;let u=this.nextTokenStart(),p=this.codePointAtPos(u);if(p!==91&&(!i&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(p,u)&&p!==123))break}case 75:i||this.raise(g.UnexpectedLexicalDeclaration,this.state.startLoc);case 74:{let u=this.state.value;return this.parseVarStatement(n,u)}case 92:return this.parseWhileStatement(n);case 76:return this.parseWithStatement(n);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(n);case 83:{let u=this.lookaheadCharCode();if(u===40||u===46)break}case 82:{!this.options.allowImportExportEverywhere&&!o&&this.raise(g.UnexpectedImportExport,this.state.startLoc),this.next();let u;return s===83?(u=this.parseImport(n),u.type==="ImportDeclaration"&&(!u.importKind||u.importKind==="value")&&(this.sawUnambiguousESM=!0)):(u=this.parseExport(n,e),(u.type==="ExportNamedDeclaration"&&(!u.exportKind||u.exportKind==="value")||u.type==="ExportAllDeclaration"&&(!u.exportKind||u.exportKind==="value")||u.type==="ExportDefaultDeclaration")&&(this.sawUnambiguousESM=!0)),this.assertModuleNodeAllowed(u),u}default:if(this.isAsyncFunction())return i||this.raise(g.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(n,!0,!i&&a)}let c=this.state.value,l=this.parseExpression();return z(s)&&l.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(n,c,l,t):this.parseExpressionStatement(n,l,e)}assertModuleNodeAllowed(t){!this.options.allowImportExportEverywhere&&!this.inModule&&this.raise(g.ImportOutsideModule,t)}decoratorsEnabledBeforeExport(){return this.hasPlugin("decorators-legacy")?!0:this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(t,e,s){return t&&(e.decorators&&e.decorators.length>0?(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!="boolean"&&this.raise(g.DecoratorsBeforeAfterExport,e.decorators[0]),e.decorators.unshift(...t)):e.decorators=t,this.resetStartLocationFromNode(e,t[0]),s&&this.resetStartLocationFromNode(s,e)),e}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(t){let e=[];do e.push(this.parseDecorator());while(this.match(26));if(this.match(82))t||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(g.DecoratorExportClass,this.state.startLoc);else if(!this.canHaveLeadingDecorator())throw this.raise(g.UnexpectedLeadingDecorator,this.state.startLoc);return e}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let t=this.startNode();if(this.next(),this.hasPlugin("decorators")){let e=this.state.startLoc,s;if(this.match(10)){let n=this.state.startLoc;this.next(),s=this.parseExpression(),this.expect(11),s=this.wrapParenthesis(n,s);let i=this.state.startLoc;t.expression=this.parseMaybeDecoratorArguments(s),this.getPluginOption("decorators","allowCallParenthesized")===!1&&t.expression!==s&&this.raise(g.DecoratorArgumentsOutsideParentheses,i)}else{for(s=this.parseIdentifier(!1);this.eat(16);){let n=this.startNodeAt(e);n.object=s,this.match(138)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),n.property=this.parsePrivateName()):n.property=this.parseIdentifier(!0),n.computed=!1,s=this.finishNode(n,"MemberExpression")}t.expression=this.parseMaybeDecoratorArguments(s)}}else t.expression=this.parseExprSubscripts();return this.finishNode(t,"Decorator")}parseMaybeDecoratorArguments(t){if(this.eat(10)){let e=this.startNodeAtNode(t);return e.callee=t,e.arguments=this.parseCallExpressionArguments(11,!1),this.toReferencedList(e.arguments),this.finishNode(e,"CallExpression")}return t}parseBreakContinueStatement(t,e){return this.next(),this.isLineTerminator()?t.label=null:(t.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(t,e),this.finishNode(t,e?"BreakStatement":"ContinueStatement")}verifyBreakContinue(t,e){let s;for(s=0;s<this.state.labels.length;++s){let n=this.state.labels[s];if((t.label==null||n.name===t.label.name)&&(n.kind!=null&&(e||n.kind===1)||t.label&&e))break}if(s===this.state.labels.length){let n=e?"BreakStatement":"ContinueStatement";this.raise(g.IllegalBreakContinue,t,{type:n})}}parseDebuggerStatement(t){return this.next(),this.semicolon(),this.finishNode(t,"DebuggerStatement")}parseHeaderExpression(){this.expect(10);let t=this.parseExpression();return this.expect(11),t}parseDoWhileStatement(t){return this.next(),this.state.labels.push(nc),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.expect(92),t.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(t,"DoWhileStatement")}parseForStatement(t){this.next(),this.state.labels.push(nc);let e=null;if(this.isContextual(96)&&this.recordAwaitIfAllowed()&&(e=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(10),this.match(13))return e!==null&&this.unexpected(e),this.parseFor(t,null);let s=this.isContextual(100);{let c=this.isContextual(96)&&this.startsAwaitUsing(),l=c||this.isContextual(107)&&this.startsUsingForOf(),u=s&&this.hasFollowingBindingAtom()||l;if(this.match(74)||this.match(75)||u){let p=this.startNode(),h;c?(h="await using",this.recordAwaitIfAllowed()||this.raise(g.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):h=this.state.value,this.next(),this.parseVar(p,!0,h);let d=this.finishNode(p,"VariableDeclaration"),f=this.match(58);return f&&l&&this.raise(g.ForInUsing,d),(f||this.isContextual(102))&&d.declarations.length===1?this.parseForIn(t,d,e):(e!==null&&this.unexpected(e),this.parseFor(t,d))}}let n=this.isContextual(95),i=new Ks,a=this.parseExpression(!0,i),o=this.isContextual(102);if(o&&(s&&this.raise(g.ForOfLet,a),e===null&&n&&a.type==="Identifier"&&this.raise(g.ForOfAsync,a)),o||this.match(58)){this.checkDestructuringPrivate(i),this.toAssignable(a,!0);let c=o?"ForOfStatement":"ForInStatement";return this.checkLVal(a,{type:c}),this.parseForIn(t,a,e)}else this.checkExpressionErrors(i,!0);return e!==null&&this.unexpected(e),this.parseFor(t,a)}parseFunctionStatement(t,e,s){return this.next(),this.parseFunction(t,1|(s?2:0)|(e?8:0))}parseIfStatement(t){return this.next(),t.test=this.parseHeaderExpression(),t.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),t.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(t,"IfStatement")}parseReturnStatement(t){return!this.prodParam.hasReturn&&!this.options.allowReturnOutsideFunction&&this.raise(g.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")}parseSwitchStatement(t){this.next(),t.discriminant=this.parseHeaderExpression();let e=t.cases=[];this.expect(5),this.state.labels.push(Ox),this.scope.enter(0);let s;for(let n;!this.match(8);)if(this.match(61)||this.match(65)){let i=this.match(61);s&&this.finishNode(s,"SwitchCase"),e.push(s=this.startNode()),s.consequent=[],this.next(),i?s.test=this.parseExpression():(n&&this.raise(g.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),n=!0,s.test=null),this.expect(14)}else s?s.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),s&&this.finishNode(s,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(t,"SwitchStatement")}parseThrowStatement(t){return this.next(),this.hasPrecedingLineBreak()&&this.raise(g.NewlineAfterThrow,this.state.lastTokEndLoc),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")}parseCatchClauseParam(){let t=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&t.type==="Identifier"?8:0),this.checkLVal(t,{type:"CatchClause"},9),t}parseTryStatement(t){if(this.next(),t.block=this.parseBlock(),t.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(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(67)?this.parseBlock():null,!t.handler&&!t.finalizer&&this.raise(g.NoCatchOrFinally,t),this.finishNode(t,"TryStatement")}parseVarStatement(t,e,s=!1){return this.next(),this.parseVar(t,!1,e,s),this.semicolon(),this.finishNode(t,"VariableDeclaration")}parseWhileStatement(t){return this.next(),t.test=this.parseHeaderExpression(),this.state.labels.push(nc),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(t,"WhileStatement")}parseWithStatement(t){return this.state.strict&&this.raise(g.StrictWith,this.state.startLoc),this.next(),t.object=this.parseHeaderExpression(),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(t,"WithStatement")}parseEmptyStatement(t){return this.next(),this.finishNode(t,"EmptyStatement")}parseLabeledStatement(t,e,s,n){for(let a of this.state.labels)a.name===e&&this.raise(g.LabelRedeclaration,s,{labelName:e});let i=B_(this.state.type)?1:this.match(71)?2:null;for(let a=this.state.labels.length-1;a>=0;a--){let o=this.state.labels[a];if(o.statementStart===t.start)o.statementStart=this.state.start,o.kind=i;else break}return this.state.labels.push({name:e,kind:i,statementStart:this.state.start}),t.body=n&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),t.label=s,this.finishNode(t,"LabeledStatement")}parseExpressionStatement(t,e,s){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")}parseBlock(t=!1,e=!0,s){let n=this.startNode();return t&&this.state.strictErrors.clear(),this.expect(5),e&&this.scope.enter(0),this.parseBlockBody(n,t,!1,8,s),e&&this.scope.exit(),this.finishNode(n,"BlockStatement")}isValidDirective(t){return t.type==="ExpressionStatement"&&t.expression.type==="StringLiteral"&&!t.expression.extra.parenthesized}parseBlockBody(t,e,s,n,i){let a=t.body=[],o=t.directives=[];this.parseBlockOrModuleBlockBody(a,e?o:void 0,s,n,i)}parseBlockOrModuleBlockBody(t,e,s,n,i){let a=this.state.strict,o=!1,c=!1;for(;!this.match(n);){let l=s?this.parseModuleItem():this.parseStatementListItem();if(e&&!c){if(this.isValidDirective(l)){let u=this.stmtToDirective(l);e.push(u),!o&&u.value.value==="use strict"&&(o=!0,this.setStrict(!0));continue}c=!0,this.state.strictErrors.clear()}t.push(l)}i?.call(this,o),a||this.setStrict(!1),this.next()}parseFor(t,e){return t.init=e,this.semicolon(!1),t.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),t.update=this.match(11)?null:this.parseExpression(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,"ForStatement")}parseForIn(t,e,s){let n=this.match(58);return this.next(),n?s!==null&&this.unexpected(s):t.await=s!==null,e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!n||!this.options.annexB||this.state.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(g.ForInOfLoopInitializer,e,{type:n?"ForInStatement":"ForOfStatement"}),e.type==="AssignmentPattern"&&this.raise(g.InvalidLhs,e,{ancestor:{type:"ForStatement"}}),t.left=e,t.right=n?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,n?"ForInStatement":"ForOfStatement")}parseVar(t,e,s,n=!1){let i=t.declarations=[];for(t.kind=s;;){let a=this.startNode();if(this.parseVarId(a,s),a.init=this.eat(29)?e?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,a.init===null&&!n&&(a.id.type!=="Identifier"&&!(e&&(this.match(58)||this.isContextual(102)))?this.raise(g.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"}):(s==="const"||s==="using"||s==="await using")&&!(this.match(58)||this.isContextual(102))&&this.raise(g.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:s})),i.push(this.finishNode(a,"VariableDeclarator")),!this.eat(12))break}return t}parseVarId(t,e){let s=this.parseBindingAtom();(e==="using"||e==="await using")&&(s.type==="ArrayPattern"||s.type==="ObjectPattern")&&this.raise(g.UsingDeclarationHasBindingPattern,s.loc.start),this.checkLVal(s,{type:"VariableDeclarator"},e==="var"?5:8201),t.id=s}parseAsyncFunctionExpression(t){return this.parseFunction(t,8)}parseFunction(t,e=0){let s=e&2,n=!!(e&1),i=n&&!(e&4),a=!!(e&8);this.initFunction(t,a),this.match(55)&&(s&&this.raise(g.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),t.generator=!0),n&&(t.id=this.parseFunctionId(i));let o=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(2),this.prodParam.enter(Ci(a,t.generator)),n||(t.id=this.parseFunctionId()),this.parseFunctionParams(t,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(t,n?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),n&&!s&&this.registerFunctionStatementId(t),this.state.maybeInArrowParameters=o,t}parseFunctionId(t){return t||z(this.state.type)?this.parseIdentifier():null}parseFunctionParams(t,e){this.expect(10),this.expressionScope.enter(cx()),t.params=this.parseBindingList(11,41,2|(e?4:0)),this.expressionScope.exit()}registerFunctionStatementId(t){t.id&&this.scope.declareName(t.id.name,!this.options.annexB||this.state.strict||t.generator||t.async?this.scope.treatFunctionsAsVar?5:8201:17,t.id.loc.start)}parseClass(t,e,s){this.next();let n=this.state.strict;return this.state.strict=!0,this.parseClassId(t,e,s),this.parseClassSuper(t),t.body=this.parseClassBody(!!t.superClass,n),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}nameIsConstructor(t){return t.type==="Identifier"&&t.name==="constructor"||t.type==="StringLiteral"&&t.value==="constructor"}isNonstaticConstructor(t){return!t.computed&&!t.static&&this.nameIsConstructor(t.key)}parseClassBody(t,e){this.classScope.enter();let s={hadConstructor:!1,hadSuperClass:t},n=[],i=this.startNode();if(i.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(n.length>0)throw this.raise(g.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(26)){n.push(this.parseDecorator());continue}let a=this.startNode();n.length&&(a.decorators=n,this.resetStartLocationFromNode(a,n[0]),n=[]),this.parseClassMember(i,a,s),a.kind==="constructor"&&a.decorators&&a.decorators.length>0&&this.raise(g.DecoratorConstructor,a)}}),this.state.strict=e,this.next(),n.length)throw this.raise(g.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(i,"ClassBody")}parseClassMemberFromModifier(t,e){let s=this.parseIdentifier(!0);if(this.isClassMethod()){let n=e;return n.kind="method",n.computed=!1,n.key=s,n.static=!1,this.pushClassMethod(t,n,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let n=e;return n.computed=!1,n.key=s,n.static=!1,t.body.push(this.parseClassProperty(n)),!0}return this.resetPreviousNodeTrailingComments(s),!1}parseClassMember(t,e,s){let n=this.isContextual(106);if(n){if(this.parseClassMemberFromModifier(t,e))return;if(this.eat(5)){this.parseClassStaticBlock(t,e);return}}this.parseClassMemberWithIsStatic(t,e,s,n)}parseClassMemberWithIsStatic(t,e,s,n){let i=e,a=e,o=e,c=e,l=e,u=i,p=i;if(e.static=n,this.parsePropertyNamePrefixOperator(e),this.eat(55)){u.kind="method";let b=this.match(138);if(this.parseClassElementName(u),b){this.pushClassPrivateMethod(t,a,!0,!1);return}this.isNonstaticConstructor(i)&&this.raise(g.ConstructorIsGenerator,i.key),this.pushClassMethod(t,i,!0,!1,!1,!1);return}let h=!this.state.containsEsc&&z(this.state.type),d=this.parseClassElementName(e),f=h?d.name:null,m=this.isPrivateName(d),y=this.state.startLoc;if(this.parsePostMemberNameModifiers(p),this.isClassMethod()){if(u.kind="method",m){this.pushClassPrivateMethod(t,a,!1,!1);return}let b=this.isNonstaticConstructor(i),x=!1;b&&(i.kind="constructor",s.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(g.DuplicateConstructor,d),b&&this.hasPlugin("typescript")&&e.override&&this.raise(g.OverrideOnConstructor,d),s.hadConstructor=!0,x=s.hadSuperClass),this.pushClassMethod(t,i,!1,!1,b,x)}else if(this.isClassProperty())m?this.pushClassPrivateProperty(t,c):this.pushClassProperty(t,o);else if(f==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(d);let b=this.eat(55);p.optional&&this.unexpected(y),u.kind="method";let x=this.match(138);this.parseClassElementName(u),this.parsePostMemberNameModifiers(p),x?this.pushClassPrivateMethod(t,a,b,!0):(this.isNonstaticConstructor(i)&&this.raise(g.ConstructorIsAsync,i.key),this.pushClassMethod(t,i,b,!0,!1,!1))}else if((f==="get"||f==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(d),u.kind=f;let b=this.match(138);this.parseClassElementName(i),b?this.pushClassPrivateMethod(t,a,!1,!1):(this.isNonstaticConstructor(i)&&this.raise(g.ConstructorIsAccessor,i.key),this.pushClassMethod(t,i,!1,!1,!1,!1)),this.checkGetterSetterParams(i)}else if(f==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(d);let b=this.match(138);this.parseClassElementName(o),this.pushClassAccessorProperty(t,l,b)}else this.isLineTerminator()?m?this.pushClassPrivateProperty(t,c):this.pushClassProperty(t,o):this.unexpected()}parseClassElementName(t){let{type:e,value:s}=this.state;if((e===132||e===133)&&t.static&&s==="prototype"&&this.raise(g.StaticPrototype,this.state.startLoc),e===138){s==="constructor"&&this.raise(g.ConstructorClassPrivateField,this.state.startLoc);let n=this.parsePrivateName();return t.key=n,n}return this.parsePropertyName(t),t.key}parseClassStaticBlock(t,e){var s;this.scope.enter(208);let n=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=n,t.body.push(this.finishNode(e,"StaticBlock")),(s=e.decorators)!=null&&s.length&&this.raise(g.DecoratorStaticBlock,e)}pushClassProperty(t,e){!e.computed&&this.nameIsConstructor(e.key)&&this.raise(g.ConstructorClassField,e.key),t.body.push(this.parseClassProperty(e))}pushClassPrivateProperty(t,e){let s=this.parseClassPrivateProperty(e);t.body.push(s),this.classScope.declarePrivateName(this.getPrivateNameSV(s.key),0,s.key.loc.start)}pushClassAccessorProperty(t,e,s){!s&&!e.computed&&this.nameIsConstructor(e.key)&&this.raise(g.ConstructorClassField,e.key);let n=this.parseClassAccessorProperty(e);t.body.push(n),s&&this.classScope.declarePrivateName(this.getPrivateNameSV(n.key),0,n.key.loc.start)}pushClassMethod(t,e,s,n,i,a){t.body.push(this.parseMethod(e,s,n,i,a,"ClassMethod",!0))}pushClassPrivateMethod(t,e,s,n){let i=this.parseMethod(e,s,n,!1,!1,"ClassPrivateMethod",!0);t.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(t,e){this.classScope.declarePrivateName(this.getPrivateNameSV(t.key),e,t.key.loc.start)}parsePostMemberNameModifiers(t){}parseClassPrivateProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassPrivateProperty")}parseClassProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassProperty")}parseClassAccessorProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassAccessorProperty")}parseInitializer(t){this.scope.enter(80),this.expressionScope.enter(Kd()),this.prodParam.enter(0),t.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(t,e,s,n=8331){if(z(this.state.type))t.id=this.parseIdentifier(),e&&this.declareNameFromIdentifier(t.id,n);else if(s||!e)t.id=null;else throw this.raise(g.MissingClassName,this.state.startLoc)}parseClassSuper(t){t.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(t,e){let s=this.parseMaybeImportPhase(t,!0),n=this.maybeParseExportDefaultSpecifier(t,s),i=!n||this.eat(12),a=i&&this.eatExportStar(t),o=a&&this.maybeParseExportNamespaceSpecifier(t),c=i&&(!o||this.eat(12)),l=n||a;if(a&&!o){if(n&&this.unexpected(),e)throw this.raise(g.UnsupportedDecoratorExport,t);return this.parseExportFrom(t,!0),this.finishNode(t,"ExportAllDeclaration")}let u=this.maybeParseExportNamedSpecifiers(t);n&&i&&!a&&!u&&this.unexpected(null,5),o&&c&&this.unexpected(null,98);let p;if(l||u){if(p=!1,e)throw this.raise(g.UnsupportedDecoratorExport,t);this.parseExportFrom(t,l)}else p=this.maybeParseExportDeclaration(t);if(l||u||p){var h;let d=t;if(this.checkExport(d,!0,!1,!!d.source),((h=d.declaration)==null?void 0:h.type)==="ClassDeclaration")this.maybeTakeDecorators(e,d.declaration,d);else if(e)throw this.raise(g.UnsupportedDecoratorExport,t);return this.finishNode(d,"ExportNamedDeclaration")}if(this.eat(65)){let d=t,f=this.parseExportDefaultExpression();if(d.declaration=f,f.type==="ClassDeclaration")this.maybeTakeDecorators(e,f,d);else if(e)throw this.raise(g.UnsupportedDecoratorExport,t);return this.checkExport(d,!0,!0),this.finishNode(d,"ExportDefaultDeclaration")}this.unexpected(null,5)}eatExportStar(t){return this.eat(55)}maybeParseExportDefaultSpecifier(t,e){if(e||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",e?.loc.start);let s=e||this.parseIdentifier(!0),n=this.startNodeAtNode(s);return n.exported=s,t.specifiers=[this.finishNode(n,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(t){if(this.isContextual(93)){var e,s;(s=(e=t).specifiers)!=null||(e.specifiers=[]);let n=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),n.exported=this.parseModuleExportName(),t.specifiers.push(this.finishNode(n,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(t){if(this.match(5)){let e=t;e.specifiers||(e.specifiers=[]);let s=e.exportKind==="type";return e.specifiers.push(...this.parseExportSpecifiers(s)),e.source=null,e.declaration=null,this.hasPlugin("importAssertions")&&(e.assertions=[]),!0}return!1}maybeParseExportDeclaration(t){return this.shouldParseExportDeclaration()?(t.specifiers=[],t.source=null,this.hasPlugin("importAssertions")&&(t.assertions=[]),t.declaration=this.parseExportDeclaration(t),!0):!1}isAsyncFunction(){if(!this.isContextual(95))return!1;let t=this.nextTokenInLineStart();return this.isUnparsedContextual(t,"function")}parseExportDefaultExpression(){let t=this.startNode();if(this.match(68))return this.next(),this.parseFunction(t,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(t,13);if(this.match(80))return this.parseClass(t,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(g.DecoratorBeforeExport,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(g.UnsupportedDefaultExport,this.state.startLoc);let e=this.parseMaybeAssignAllowIn();return this.semicolon(),e}parseExportDeclaration(t){return this.match(80)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:t}=this.state;if(z(t)){if(t===95&&!this.state.containsEsc||t===100)return!1;if((t===130||t===129)&&!this.state.containsEsc){let{type:n}=this.lookahead();if(z(n)&&n!==98||n===5)return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;let e=this.nextTokenStart(),s=this.isUnparsedContextual(e,"from");if(this.input.charCodeAt(e)===44||z(this.state.type)&&s)return!0;if(this.match(65)&&s){let n=this.input.charCodeAt(this.nextTokenStartSince(e+4));return n===34||n===39}return!1}parseExportFrom(t,e){this.eatContextual(98)?(t.source=this.parseImportSource(),this.checkExport(t),this.maybeParseImportAttributes(t),this.checkJSONModuleImport(t)):e&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:t}=this.state;return t===26&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?(this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(g.DecoratorBeforeExport,this.state.startLoc),!0):this.isContextual(107)?(this.raise(g.UsingDeclarationExport,this.state.startLoc),!0):this.isContextual(96)&&this.startsAwaitUsing()?(this.raise(g.UsingDeclarationExport,this.state.startLoc),!0):t===74||t===75||t===68||t===80||this.isLet()||this.isAsyncFunction()}checkExport(t,e,s,n){if(e){var i;if(s){if(this.checkDuplicateExports(t,"default"),this.hasPlugin("exportDefaultFrom")){var a;let o=t.declaration;o.type==="Identifier"&&o.name==="from"&&o.end-o.start===4&&!((a=o.extra)!=null&&a.parenthesized)&&this.raise(g.ExportDefaultFromAsIdentifier,o)}}else if((i=t.specifiers)!=null&&i.length)for(let o of t.specifiers){let{exported:c}=o,l=c.type==="Identifier"?c.name:c.value;if(this.checkDuplicateExports(o,l),!n&&o.local){let{local:u}=o;u.type!=="Identifier"?this.raise(g.ExportBindingIsString,o,{localName:u.value,exportName:l}):(this.checkReservedWord(u.name,u.loc.start,!0,!1),this.scope.checkLocalExport(u))}}else if(t.declaration){let o=t.declaration;if(o.type==="FunctionDeclaration"||o.type==="ClassDeclaration"){let{id:c}=o;if(!c)throw new Error("Assertion failure");this.checkDuplicateExports(t,c.name)}else if(o.type==="VariableDeclaration")for(let c of o.declarations)this.checkDeclaration(c.id)}}}checkDeclaration(t){if(t.type==="Identifier")this.checkDuplicateExports(t,t.name);else if(t.type==="ObjectPattern")for(let e of t.properties)this.checkDeclaration(e);else if(t.type==="ArrayPattern")for(let e of t.elements)e&&this.checkDeclaration(e);else t.type==="ObjectProperty"?this.checkDeclaration(t.value):t.type==="RestElement"?this.checkDeclaration(t.argument):t.type==="AssignmentPattern"&&this.checkDeclaration(t.left)}checkDuplicateExports(t,e){this.exportedIdentifiers.has(e)&&(e==="default"?this.raise(g.DuplicateDefaultExport,t):this.raise(g.DuplicateExport,t,{exportName:e})),this.exportedIdentifiers.add(e)}parseExportSpecifiers(t){let e=[],s=!0;for(this.expect(5);!this.eat(8);){if(s)s=!1;else if(this.expect(12),this.eat(8))break;let n=this.isContextual(130),i=this.match(133),a=this.startNode();a.local=this.parseModuleExportName(),e.push(this.parseExportSpecifier(a,i,t,n))}return e}parseExportSpecifier(t,e,s,n){return this.eatContextual(93)?t.exported=this.parseModuleExportName():e?t.exported=hx(t.local):t.exported||(t.exported=Mt(t.local)),this.finishNode(t,"ExportSpecifier")}parseModuleExportName(){if(this.match(133)){let t=this.parseStringLiteral(this.state.value),e=Mx.exec(t.value);return e&&this.raise(g.ModuleExportNameHasLoneSurrogate,t,{surrogateCharCode:e[0].charCodeAt(0)}),t}return this.parseIdentifier(!0)}isJSONModuleImport(t){return t.assertions!=null?t.assertions.some(({key:e,value:s})=>s.value==="json"&&(e.type==="Identifier"?e.name==="type":e.value==="type")):!1}checkImportReflection(t){let{specifiers:e}=t,s=e.length===1?e[0].type:null;if(t.phase==="source")s!=="ImportDefaultSpecifier"&&this.raise(g.SourcePhaseImportRequiresDefault,e[0].loc.start);else if(t.phase==="defer")s!=="ImportNamespaceSpecifier"&&this.raise(g.DeferImportRequiresNamespace,e[0].loc.start);else if(t.module){var n;s!=="ImportDefaultSpecifier"&&this.raise(g.ImportReflectionNotBinding,e[0].loc.start),((n=t.assertions)==null?void 0:n.length)>0&&this.raise(g.ImportReflectionHasAssertion,e[0].loc.start)}}checkJSONModuleImport(t){if(this.isJSONModuleImport(t)&&t.type!=="ExportAllDeclaration"){let{specifiers:e}=t;if(e!=null){let s=e.find(n=>{let i;if(n.type==="ExportSpecifier"?i=n.local:n.type==="ImportSpecifier"&&(i=n.imported),i!==void 0)return i.type==="Identifier"?i.name!=="default":i.value!=="default"});s!==void 0&&this.raise(g.ImportJSONBindingNotDefault,s.loc.start)}}}isPotentialImportPhase(t){return t?!1:this.isContextual(105)||this.isContextual(97)||this.isContextual(127)}applyImportPhase(t,e,s,n){e||(s==="module"?(this.expectPlugin("importReflection",n),t.module=!0):this.hasPlugin("importReflection")&&(t.module=!1),s==="source"?(this.expectPlugin("sourcePhaseImports",n),t.phase="source"):s==="defer"?(this.expectPlugin("deferredImportEvaluation",n),t.phase="defer"):this.hasPlugin("sourcePhaseImports")&&(t.phase=null))}parseMaybeImportPhase(t,e){if(!this.isPotentialImportPhase(e))return this.applyImportPhase(t,e,null),null;let s=this.parseIdentifier(!0),{type:n}=this.state;return(it(n)?n!==98||this.lookaheadCharCode()===102:n!==12)?(this.resetPreviousIdentifierLeadingComments(s),this.applyImportPhase(t,e,s.name,s.loc.start),null):(this.applyImportPhase(t,e,null),s)}isPrecedingIdImportPhase(t){let{type:e}=this.state;return z(e)?e!==98||this.lookaheadCharCode()===102:e!==12}parseImport(t){return this.match(133)?this.parseImportSourceAndAttributes(t):this.parseImportSpecifiersAndAfter(t,this.parseMaybeImportPhase(t,!1))}parseImportSpecifiersAndAfter(t,e){t.specifiers=[];let n=!this.maybeParseDefaultImportSpecifier(t,e)||this.eat(12),i=n&&this.maybeParseStarImportSpecifier(t);return n&&!i&&this.parseNamedImportSpecifiers(t),this.expectContextual(98),this.parseImportSourceAndAttributes(t)}parseImportSourceAndAttributes(t){var e;return(e=t.specifiers)!=null||(t.specifiers=[]),t.source=this.parseImportSource(),this.maybeParseImportAttributes(t),this.checkImportReflection(t),this.checkJSONModuleImport(t),this.semicolon(),this.finishNode(t,"ImportDeclaration")}parseImportSource(){return this.match(133)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(t,e,s){e.local=this.parseIdentifier(),t.specifiers.push(this.finishImportSpecifier(e,s))}finishImportSpecifier(t,e,s=8201){return this.checkLVal(t.local,{type:e},s),this.finishNode(t,e)}parseImportAttributes(){this.expect(5);let t=[],e=new Set;do{if(this.match(8))break;let s=this.startNode(),n=this.state.value;if(e.has(n)&&this.raise(g.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:n}),e.add(n),this.match(133)?s.key=this.parseStringLiteral(n):s.key=this.parseIdentifier(!0),this.expect(14),!this.match(133))throw this.raise(g.ModuleAttributeInvalidValue,this.state.startLoc);s.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return this.expect(8),t}parseModuleAttributes(){let t=[],e=new Set;do{let s=this.startNode();if(s.key=this.parseIdentifier(!0),s.key.name!=="type"&&this.raise(g.ModuleAttributeDifferentFromType,s.key),e.has(s.key.name)&&this.raise(g.ModuleAttributesWithDuplicateKeys,s.key,{key:s.key.name}),e.add(s.key.name),this.expect(14),!this.match(133))throw this.raise(g.ModuleAttributeInvalidValue,this.state.startLoc);s.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return t}maybeParseImportAttributes(t){let e;var s=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),this.hasPlugin("moduleAttributes")?e=this.parseModuleAttributes():(this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes"),e=this.parseImportAttributes()),s=!0}else if(this.isContextual(94)&&!this.hasPrecedingLineBreak())this.hasPlugin("importAttributes")?(this.getPluginOption("importAttributes","deprecatedAssertSyntax")!==!0&&this.raise(g.ImportAttributesUseAssert,this.state.startLoc),this.addExtra(t,"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;!s&&this.hasPlugin("importAssertions")?t.assertions=e:t.attributes=e}maybeParseDefaultImportSpecifier(t,e){if(e){let s=this.startNodeAtNode(e);return s.local=e,t.specifiers.push(this.finishImportSpecifier(s,"ImportDefaultSpecifier")),!0}else if(it(this.state.type))return this.parseImportSpecifierLocal(t,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(t){if(this.match(55)){let e=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(t,e,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(t){let e=!0;for(this.expect(5);!this.eat(8);){if(e)e=!1;else{if(this.eat(14))throw this.raise(g.DestructureNamedImport,this.state.startLoc);if(this.expect(12),this.eat(8))break}let s=this.startNode(),n=this.match(133),i=this.isContextual(130);s.imported=this.parseModuleExportName();let a=this.parseImportSpecifier(s,n,t.importKind==="type"||t.importKind==="typeof",i,void 0);t.specifiers.push(a)}}parseImportSpecifier(t,e,s,n,i){if(this.eatContextual(93))t.local=this.parseIdentifier();else{let{imported:a}=t;if(e)throw this.raise(g.ImportBindingIsString,t,{importName:a.value});this.checkReservedWord(a.name,t.loc.start,!0,!0),t.local||(t.local=Mt(a))}return this.finishImportSpecifier(t,"ImportSpecifier",i)}isThisParam(t){return t.type==="Identifier"&&t.name==="this"}},ki=class extends vc{constructor(t,e,s){t=Dx(t),super(t,e),this.options=t,this.initializeScopes(),this.plugins=s,this.filename=t.sourceFilename}getScopeHandler(){return Qr}parse(){this.enterInitialScopes();let t=this.startNode(),e=this.startNode();return this.nextToken(),t.errors=null,this.parseTopLevel(t,e),t.errors=this.state.errors,t.comments.length=this.state.commentsLen,t}};function Rx(r,t){var e;if(((e=t)==null?void 0:e.sourceType)==="unambiguous"){t=Object.assign({},t);try{t.sourceType="module";let s=Jr(t,r),n=s.parse();if(s.sawUnambiguousESM)return n;if(s.ambiguousScriptDifferentAst)try{return t.sourceType="script",Jr(t,r).parse()}catch{}else n.program.sourceType="script";return n}catch(s){try{return t.sourceType="script",Jr(t,r).parse()}catch{}throw s}}else return Jr(t,r).parse()}function Fx(r,t){let e=Jr(t,r);return e.options.strictMode&&(e.state.strict=!0),e.getExpression()}function Bx(r){let t={};for(let e of Object.keys(r))t[e]=Nt(r[e]);return t}var jx=Bx(M_);function Jr(r,t){let e=ki,s=new Map;if(r!=null&&r.plugins){for(let n of r.plugins){let i,a;typeof n=="string"?i=n:[i,a]=n,s.has(i)||s.set(i,a||{})}Nx(s),e=Ux(s)}return new e(r,t,s)}var jd=new Map;function Ux(r){let t=[];for(let n of kx)r.has(n)&&t.push(n);let e=t.join("|"),s=jd.get(e);if(!s){s=ki;for(let n of t)s=ef[n](s);jd.set(e,s)}return s}en.parse=Rx;en.parseExpression=Fx;en.tokTypes=jx});var Ke=_(Te=>{Object.defineProperty(Te,"__esModule",{value:!0});var em=Object.prototype.toString;function gT(r){switch(em.call(r)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Qi(r,Error)}}function cr(r,t){return em.call(r)===`[object ${t}]`}function bT(r){return cr(r,"ErrorEvent")}function ST(r){return cr(r,"DOMError")}function _T(r){return cr(r,"DOMException")}function xT(r){return cr(r,"String")}function ET(r){return r===null||typeof r!="object"&&typeof r!="function"}function tm(r){return cr(r,"Object")}function TT(r){return typeof Event<"u"&&Qi(r,Event)}function PT(r){return typeof Element<"u"&&Qi(r,Element)}function vT(r){return cr(r,"RegExp")}function AT(r){return!!(r&&r.then&&typeof r.then=="function")}function CT(r){return tm(r)&&"nativeEvent"in r&&"preventDefault"in r&&"stopPropagation"in r}function wT(r){return typeof r=="number"&&r!==r}function Qi(r,t){try{return r instanceof t}catch{return!1}}function IT(r){return!!(typeof r=="object"&&r!==null&&(r.__isVue||r._isVue))}Te.isDOMError=ST;Te.isDOMException=_T;Te.isElement=PT;Te.isError=gT;Te.isErrorEvent=bT;Te.isEvent=TT;Te.isInstanceOf=Qi;Te.isNaN=wT;Te.isPlainObject=tm;Te.isPrimitive=ET;Te.isRegExp=vT;Te.isString=xT;Te.isSyntheticEvent=CT;Te.isThenable=AT;Te.isVueViewModel=IT});var mn=_(_s=>{Object.defineProperty(_s,"__esModule",{value:!0});var Zi=Ke();function NT(r,t=0){return typeof r!="string"||t===0||r.length<=t?r:`${r.slice(0,t)}...`}function kT(r,t){let e=r,s=e.length;if(s<=150)return e;t>s&&(t=s);let n=Math.max(t-60,0);n<5&&(n=0);let i=Math.min(n+140,s);return i>s-5&&(i=s),i===s&&(n=Math.max(i-140,0)),e=e.slice(n,i),n>0&&(e=`'{snip} ${e}`),i<s&&(e+=" {snip}"),e}function DT(r,t){if(!Array.isArray(r))return"";let e=[];for(let s=0;s<r.length;s++){let n=r[s];try{Zi.isVueViewModel(n)?e.push("[VueViewModel]"):e.push(String(n))}catch{e.push("[value cannot be serialized]")}}return e.join(t)}function sm(r,t,e=!1){return Zi.isString(r)?Zi.isRegExp(t)?t.test(r):Zi.isString(t)?e?r===t:r.includes(t):!1:!1}function OT(r,t=[],e=!1){return t.some(s=>sm(r,s,e))}_s.isMatchingPattern=sm;_s.safeJoin=DT;_s.snipLine=kT;_s.stringMatchesSomePattern=OT;_s.truncate=NT});var im=_(nl=>{Object.defineProperty(nl,"__esModule",{value:!0});var sl=Ke(),MT=mn();function LT(r,t,e=250,s,n,i,a){if(!i.exception||!i.exception.values||!a||!sl.isInstanceOf(a.originalException,Error))return;let o=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;o&&(i.exception.values=RT(rl(r,t,n,a.originalException,s,i.exception.values,o,0),e))}function rl(r,t,e,s,n,i,a,o){if(i.length>=e+1)return i;let c=[...i];if(sl.isInstanceOf(s[n],Error)){rm(a,o);let l=r(t,s[n]),u=c.length;nm(l,n,u,o),c=rl(r,t,e,s[n],n,[l,...c],l,u)}return Array.isArray(s.errors)&&s.errors.forEach((l,u)=>{if(sl.isInstanceOf(l,Error)){rm(a,o);let p=r(t,l),h=c.length;nm(p,`errors[${u}]`,h,o),c=rl(r,t,e,l,n,[p,...c],p,h)}}),c}function rm(r,t){r.mechanism=r.mechanism||{type:"generic",handled:!0},r.mechanism={...r.mechanism,is_exception_group:!0,exception_id:t}}function nm(r,t,e,s){r.mechanism=r.mechanism||{type:"generic",handled:!0},r.mechanism={...r.mechanism,type:"chained",source:t,exception_id:e,parent_id:s}}function RT(r,t){return r.map(e=>(e.value&&(e.value=MT.truncate(e.value,t)),e))}nl.applyAggregateErrorsToEvent=LT});var Rt=_(yn=>{Object.defineProperty(yn,"__esModule",{value:!0});function ea(r){return r&&r.Math==Math?r:void 0}var il=typeof globalThis=="object"&&ea(globalThis)||typeof window=="object"&&ea(window)||typeof self=="object"&&ea(self)||typeof global=="object"&&ea(global)||function(){return this}()||{};function FT(){return il}function BT(r,t,e){let s=e||il,n=s.__SENTRY__=s.__SENTRY__||{};return n[r]||(n[r]=t())}yn.GLOBAL_OBJ=il;yn.getGlobalObject=FT;yn.getGlobalSingleton=BT});var al=_(gn=>{Object.defineProperty(gn,"__esModule",{value:!0});var jT=Ke(),UT=Rt(),ta=UT.getGlobalObject(),qT=80;function GT(r,t={}){try{let e=r,s=5,n=[],i=0,a=0,o=" > ",c=o.length,l,u=Array.isArray(t)?t:t.keyAttrs,p=!Array.isArray(t)&&t.maxStringLength||qT;for(;e&&i++<s&&(l=$T(e,u),!(l==="html"||i>1&&a+n.length*c+l.length>=p));)n.push(l),a+=l.length,e=e.parentNode;return n.reverse().join(o)}catch{return"<unknown>"}}function $T(r,t){let e=r,s=[],n,i,a,o,c;if(!e||!e.tagName)return"";s.push(e.tagName.toLowerCase());let l=t&&t.length?t.filter(p=>e.getAttribute(p)).map(p=>[p,e.getAttribute(p)]):null;if(l&&l.length)l.forEach(p=>{s.push(`[${p[0]}="${p[1]}"]`)});else if(e.id&&s.push(`#${e.id}`),n=e.className,n&&jT.isString(n))for(i=n.split(/\s+/),c=0;c<i.length;c++)s.push(`.${i[c]}`);let u=["aria-label","type","name","title","alt"];for(c=0;c<u.length;c++)a=u[c],o=e.getAttribute(a),o&&s.push(`[${a}="${o}"]`);return s.join("")}function HT(){try{return ta.document.location.href}catch{return""}}function VT(r){return ta.document&&ta.document.querySelector?ta.document.querySelector(r):null}gn.getDomElement=VT;gn.getLocationHref=HT;gn.htmlTreeAsString=GT});var ur=_(lr=>{Object.defineProperty(lr,"__esModule",{value:!0});var ol=Rt(),YT="Sentry Logger ",cl=["debug","info","warn","error","log","assert","trace"],ll={};function am(r){if(!("console"in ol.GLOBAL_OBJ))return r();let t=ol.GLOBAL_OBJ.console,e={},s=Object.keys(ll);s.forEach(n=>{let i=ll[n];e[n]=t[n],t[n]=i});try{return r()}finally{s.forEach(n=>{t[n]=e[n]})}}function WT(){let r=!1,t={enable:()=>{r=!0},disable:()=>{r=!1}};return typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?cl.forEach(e=>{t[e]=(...s)=>{r&&am(()=>{ol.GLOBAL_OBJ.console[e](`${YT}[${e}]:`,...s)})}}):cl.forEach(e=>{t[e]=()=>{}}),t}var zT=WT();lr.CONSOLE_LEVELS=cl;lr.consoleSandbox=am;lr.logger=zT;lr.originalConsoleMethods=ll});var ul=_(bn=>{Object.defineProperty(bn,"__esModule",{value:!0});var sa=ur(),JT=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function KT(r){return r==="http"||r==="https"}function XT(r,t=!1){let{host:e,path:s,pass:n,port:i,projectId:a,protocol:o,publicKey:c}=r;return`${o}://${c}${t&&n?`:${n}`:""}@${e}${i?`:${i}`:""}/${s&&`${s}/`}${a}`}function om(r){let t=JT.exec(r);if(!t){console.error(`Invalid Sentry Dsn: ${r}`);return}let[e,s,n="",i,a="",o]=t.slice(1),c="",l=o,u=l.split("/");if(u.length>1&&(c=u.slice(0,-1).join("/"),l=u.pop()),l){let p=l.match(/^\d+/);p&&(l=p[0])}return cm({host:i,pass:n,path:c,projectId:l,port:a,protocol:e,publicKey:s})}function cm(r){return{protocol:r.protocol,publicKey:r.publicKey||"",pass:r.pass||"",host:r.host,port:r.port||"",path:r.path||"",projectId:r.projectId}}function QT(r){if(!(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__))return!0;let{port:t,projectId:e,protocol:s}=r;return["protocol","publicKey","host","projectId"].find(a=>r[a]?!1:(sa.logger.error(`Invalid Sentry Dsn: ${a} missing`),!0))?!1:e.match(/^\d+$/)?KT(s)?t&&isNaN(parseInt(t,10))?(sa.logger.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(sa.logger.error(`Invalid Sentry Dsn: Invalid protocol ${s}`),!1):(sa.logger.error(`Invalid Sentry Dsn: Invalid projectId ${e}`),!1)}function ZT(r){let t=typeof r=="string"?om(r):cm(r);if(!(!t||!QT(t)))return t}bn.dsnFromString=om;bn.dsnToString=XT;bn.makeDsn=ZT});var dl=_(hl=>{Object.defineProperty(hl,"__esModule",{value:!0});var pl=class extends Error{constructor(t,e="warn"){super(t),this.message=t,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=e}};hl.SentryError=pl});var xs=_(lt=>{Object.defineProperty(lt,"__esModule",{value:!0});var eP=al(),pr=Ke(),lm=mn();function tP(r,t,e){if(!(t in r))return;let s=r[t],n=e(s);if(typeof n=="function")try{dm(n,s)}catch{}r[t]=n}function hm(r,t,e){Object.defineProperty(r,t,{value:e,writable:!0,configurable:!0})}function dm(r,t){let e=t.prototype||{};r.prototype=t.prototype=e,hm(r,"__sentry_original__",t)}function sP(r){return r.__sentry_original__}function rP(r){return Object.keys(r).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(r[t])}`).join("&")}function fm(r){if(pr.isError(r))return{message:r.message,name:r.name,stack:r.stack,...pm(r)};if(pr.isEvent(r)){let t={type:r.type,target:um(r.target),currentTarget:um(r.currentTarget),...pm(r)};return typeof CustomEvent<"u"&&pr.isInstanceOf(r,CustomEvent)&&(t.detail=r.detail),t}else return r}function um(r){try{return pr.isElement(r)?eP.htmlTreeAsString(r):Object.prototype.toString.call(r)}catch{return"<unknown>"}}function pm(r){if(typeof r=="object"&&r!==null){let t={};for(let e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e]);return t}else return{}}function nP(r,t=40){let e=Object.keys(fm(r));if(e.sort(),!e.length)return"[object has no keys]";if(e[0].length>=t)return lm.truncate(e[0],t);for(let s=e.length;s>0;s--){let n=e.slice(0,s).join(", ");if(!(n.length>t))return s===e.length?n:lm.truncate(n,t)}return""}function iP(r){return fl(r,new Map)}function fl(r,t){if(pr.isPlainObject(r)){let e=t.get(r);if(e!==void 0)return e;let s={};t.set(r,s);for(let n of Object.keys(r))typeof r[n]<"u"&&(s[n]=fl(r[n],t));return s}if(Array.isArray(r)){let e=t.get(r);if(e!==void 0)return e;let s=[];return t.set(r,s),r.forEach(n=>{s.push(fl(n,t))}),s}return r}function aP(r){let t;switch(!0){case r==null:t=new String(r);break;case(typeof r=="symbol"||typeof r=="bigint"):t=Object(r);break;case pr.isPrimitive(r):t=new r.constructor(r);break;default:t=r;break}return t}lt.addNonEnumerableProperty=hm;lt.convertToPlainObject=fm;lt.dropUndefinedKeys=iP;lt.extractExceptionKeysForMessage=nP;lt.fill=tP;lt.getOriginalFunction=sP;lt.markFunctionWrapped=dm;lt.objectify=aP;lt.urlEncode=rP});var mm=_(ml=>{Object.defineProperty(ml,"__esModule",{value:!0});function oP(r){let t=/^\s*[-]{4,}$/,e=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;return s=>{let n=s.match(e);if(n){let i,a,o,c,l;if(n[1]){o=n[1];let f=o.lastIndexOf(".");if(o[f-1]==="."&&f--,f>0){i=o.slice(0,f),a=o.slice(f+1);let m=i.indexOf(".Module");m>0&&(o=o.slice(m+1),i=i.slice(0,m))}c=void 0}a&&(c=i,l=a),a==="<anonymous>"&&(l=void 0,o=void 0),o===void 0&&(l=l||"<anonymous>",o=c?`${c}.${l}`:l);let u=n[2]&&n[2].startsWith("file://")?n[2].slice(7):n[2],p=n[5]==="native";!u&&n[5]&&!p&&(u=n[5]);let d=!(p||u&&!u.startsWith("/")&&!u.includes(":\\")&&!u.startsWith(".")&&!u.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&u!==void 0&&!u.includes("node_modules/");return{filename:u,module:r?r(u):void 0,function:o,lineno:parseInt(n[3],10)||void 0,colno:parseInt(n[4],10)||void 0,in_app:d}}if(s.match(t))return{filename:s}}}ml.node=oP});var ra=_(Es=>{Object.defineProperty(Es,"__esModule",{value:!0});var cP=mm(),bm=50,ym=/\(error: (.*)\)/,gm=/captureMessage|captureException/;function Sm(...r){let t=r.sort((e,s)=>e[0]-s[0]).map(e=>e[1]);return(e,s=0)=>{let n=[],i=e.split(`
|
|
9
|
+
`);for(let a=s;a<i.length;a++){let o=i[a];if(o.length>1024)continue;let c=ym.test(o)?o.replace(ym,"$1"):o;if(!c.match(/\S*Error: /)){for(let l of t){let u=l(c);if(u){n.push(u);break}}if(n.length>=bm)break}}return _m(n)}}function lP(r){return Array.isArray(r)?Sm(...r):r}function _m(r){if(!r.length)return[];let t=Array.from(r);return/sentryWrapped/.test(t[t.length-1].function||"")&&t.pop(),t.reverse(),gm.test(t[t.length-1].function||"")&&(t.pop(),gm.test(t[t.length-1].function||"")&&t.pop()),t.slice(0,bm).map(e=>({...e,filename:e.filename||t[t.length-1].filename,function:e.function||"?"}))}var yl="<anonymous>";function uP(r){try{return!r||typeof r!="function"?yl:r.name||yl}catch{return yl}}function pP(r){return[90,cP.node(r)]}Es.createStackParser=Sm;Es.getFunctionName=uP;Es.nodeStackLineParser=pP;Es.stackParserFromStackParserOptions=lP;Es.stripSentryFramesAndReverse=_m});var Sl=_(gt=>{Object.defineProperty(gt,"__esModule",{value:!0});var hP=ur(),dP=Rt(),na=dP.getGlobalObject();function fP(){try{return new ErrorEvent(""),!0}catch{return!1}}function mP(){try{return new DOMError(""),!0}catch{return!1}}function yP(){try{return new DOMException(""),!0}catch{return!1}}function bl(){if(!("fetch"in na))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function gl(r){return r&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(r.toString())}function gP(){if(!bl())return!1;if(gl(na.fetch))return!0;let r=!1,t=na.document;if(t&&typeof t.createElement=="function")try{let e=t.createElement("iframe");e.hidden=!0,t.head.appendChild(e),e.contentWindow&&e.contentWindow.fetch&&(r=gl(e.contentWindow.fetch)),t.head.removeChild(e)}catch(e){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&hP.logger.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return r}function bP(){return"ReportingObserver"in na}function SP(){if(!bl())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch{return!1}}gt.isNativeFetch=gl;gt.supportsDOMError=mP;gt.supportsDOMException=yP;gt.supportsErrorEvent=fP;gt.supportsFetch=bl;gt.supportsNativeFetch=gP;gt.supportsReferrerPolicy=SP;gt.supportsReportingObserver=bP});var xl=_(_l=>{Object.defineProperty(_l,"__esModule",{value:!0});var _P=Rt(),ia=_P.getGlobalObject();function xP(){let r=ia.chrome,t=r&&r.app&&r.app.runtime,e="history"in ia&&!!ia.history.pushState&&!!ia.history.replaceState;return!t&&e}_l.supportsHistory=xP});var wm=_(Zt=>{Object.defineProperty(Zt,"__esModule",{value:!0});var xm=Ke(),_n=ur(),bt=xs(),EP=ra(),TP=Sl(),Ts=Rt(),PP=xl(),ge=Ts.getGlobalObject(),Sn="__sentry_xhr_v2__",Ps={},Em={};function vP(r){if(!Em[r])switch(Em[r]=!0,r){case"console":wP();break;case"dom":Cm();break;case"xhr":Am();break;case"fetch":IP();break;case"history":NP();break;case"error":MP();break;case"unhandledrejection":LP();break;default:(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_n.logger.warn("unknown instrumentation type:",r);return}}function AP(r,t){Ps[r]=Ps[r]||[],Ps[r].push(t),vP(r)}function CP(){Object.keys(Ps).forEach(r=>{Ps[r]=void 0})}function ut(r,t){if(!(!r||!Ps[r]))for(let e of Ps[r]||[])try{e(t)}catch(s){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_n.logger.error(`Error while triggering instrumentation handler.
|
|
10
|
+
Type: ${r}
|
|
11
|
+
Name: ${EP.getFunctionName(e)}
|
|
12
|
+
Error:`,s)}}function wP(){"console"in Ts.GLOBAL_OBJ&&_n.CONSOLE_LEVELS.forEach(function(r){r in Ts.GLOBAL_OBJ.console&&bt.fill(Ts.GLOBAL_OBJ.console,r,function(t){return _n.originalConsoleMethods[r]=t,function(...e){ut("console",{args:e,level:r});let s=_n.originalConsoleMethods[r];s&&s.apply(Ts.GLOBAL_OBJ.console,e)}})})}function IP(){TP.supportsNativeFetch()&&bt.fill(Ts.GLOBAL_OBJ,"fetch",function(r){return function(...t){let{method:e,url:s}=vm(t),n={args:t,fetchData:{method:e,url:s},startTimestamp:Date.now()};return ut("fetch",{...n}),r.apply(Ts.GLOBAL_OBJ,t).then(i=>(ut("fetch",{...n,endTimestamp:Date.now(),response:i}),i),i=>{throw ut("fetch",{...n,endTimestamp:Date.now(),error:i}),i})}})}function El(r,t){return!!r&&typeof r=="object"&&!!r[t]}function Tm(r){return typeof r=="string"?r:r?El(r,"url")?r.url:r.toString?r.toString():"":""}function vm(r){if(r.length===0)return{method:"GET",url:""};if(r.length===2){let[e,s]=r;return{url:Tm(e),method:El(s,"method")?String(s.method).toUpperCase():"GET"}}let t=r[0];return{url:Tm(t),method:El(t,"method")?String(t.method).toUpperCase():"GET"}}function Am(){if(!ge.XMLHttpRequest)return;let r=XMLHttpRequest.prototype;bt.fill(r,"open",function(t){return function(...e){let s=e[1],n=this[Sn]={method:xm.isString(e[0])?e[0].toUpperCase():e[0],url:e[1],request_headers:{}};xm.isString(s)&&n.method==="POST"&&s.match(/sentry_key/)&&(this.__sentry_own_request__=!0);let i=()=>{let a=this[Sn];if(a&&this.readyState===4){try{a.status_code=this.status}catch{}ut("xhr",{args:e,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:this})}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?bt.fill(this,"onreadystatechange",function(a){return function(...o){return i(),a.apply(this,o)}}):this.addEventListener("readystatechange",i),bt.fill(this,"setRequestHeader",function(a){return function(...o){let[c,l]=o,u=this[Sn];return u&&(u.request_headers[c.toLowerCase()]=l),a.apply(this,o)}}),t.apply(this,e)}}),bt.fill(r,"send",function(t){return function(...e){let s=this[Sn];return s&&e[0]!==void 0&&(s.body=e[0]),ut("xhr",{args:e,startTimestamp:Date.now(),xhr:this}),t.apply(this,e)}})}var aa;function NP(){if(!PP.supportsHistory())return;let r=ge.onpopstate;ge.onpopstate=function(...e){let s=ge.location.href,n=aa;if(aa=s,ut("history",{from:n,to:s}),r)try{return r.apply(this,e)}catch{}};function t(e){return function(...s){let n=s.length>2?s[2]:void 0;if(n){let i=aa,a=String(n);aa=a,ut("history",{from:i,to:a})}return e.apply(this,s)}}bt.fill(ge.history,"pushState",t),bt.fill(ge.history,"replaceState",t)}var kP=1e3,oa,ca;function DP(r,t){if(!r||r.type!==t.type)return!0;try{if(r.target!==t.target)return!0}catch{}return!1}function OP(r){if(r.type!=="keypress")return!1;try{let t=r.target;if(!t||!t.tagName)return!0;if(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable)return!1}catch{}return!0}function Pm(r,t=!1){return e=>{if(!e||ca===e||OP(e))return;let s=e.type==="keypress"?"input":e.type;oa===void 0?(r({event:e,name:s,global:t}),ca=e):DP(ca,e)&&(r({event:e,name:s,global:t}),ca=e),clearTimeout(oa),oa=ge.setTimeout(()=>{oa=void 0},kP)}}function Cm(){if(!ge.document)return;let r=ut.bind(null,"dom"),t=Pm(r,!0);ge.document.addEventListener("click",t,!1),ge.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(e=>{let s=ge[e]&&ge[e].prototype;!s||!s.hasOwnProperty||!s.hasOwnProperty("addEventListener")||(bt.fill(s,"addEventListener",function(n){return function(i,a,o){if(i==="click"||i=="keypress")try{let c=this,l=c.__sentry_instrumentation_handlers__=c.__sentry_instrumentation_handlers__||{},u=l[i]=l[i]||{refCount:0};if(!u.handler){let p=Pm(r);u.handler=p,n.call(this,i,p,o)}u.refCount++}catch{}return n.call(this,i,a,o)}}),bt.fill(s,"removeEventListener",function(n){return function(i,a,o){if(i==="click"||i=="keypress")try{let c=this,l=c.__sentry_instrumentation_handlers__||{},u=l[i];u&&(u.refCount--,u.refCount<=0&&(n.call(this,i,u.handler,o),u.handler=void 0,delete l[i]),Object.keys(l).length===0&&delete c.__sentry_instrumentation_handlers__)}catch{}return n.call(this,i,a,o)}}))})}var la=null;function MP(){la=ge.onerror,ge.onerror=function(r,t,e,s,n){return ut("error",{column:s,error:n,line:e,msg:r,url:t}),la&&!la.__SENTRY_LOADER__?la.apply(this,arguments):!1},ge.onerror.__SENTRY_INSTRUMENTED__=!0}var ua=null;function LP(){ua=ge.onunhandledrejection,ge.onunhandledrejection=function(r){return ut("unhandledrejection",r),ua&&!ua.__SENTRY_LOADER__?ua.apply(this,arguments):!0},ge.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}Zt.SENTRY_XHR_DATA_KEY=Sn;Zt.addInstrumentationHandler=AP;Zt.instrumentDOM=Cm;Zt.instrumentXHR=Am;Zt.parseFetchArgs=vm;Zt.resetInstrumentationHandlers=CP});var Pl=_(Tl=>{Object.defineProperty(Tl,"__esModule",{value:!0});function RP(){let r=typeof WeakSet=="function",t=r?new WeakSet:[];function e(n){if(r)return t.has(n)?!0:(t.add(n),!1);for(let i=0;i<t.length;i++)if(t[i]===n)return!0;return t.push(n),!1}function s(n){if(r)t.delete(n);else for(let i=0;i<t.length;i++)if(t[i]===n){t.splice(i,1);break}}return[e,s]}Tl.memoBuilder=RP});var pa=_(St=>{Object.defineProperty(St,"__esModule",{value:!0});var FP=xs(),vl=mn(),BP=Rt();function jP(){let r=BP.GLOBAL_OBJ,t=r.crypto||r.msCrypto,e=()=>Math.random()*16;try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(e=()=>t.getRandomValues(new Uint8Array(1))[0])}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,s=>(s^(e()&15)>>s/4).toString(16))}function Im(r){return r.exception&&r.exception.values?r.exception.values[0]:void 0}function UP(r){let{message:t,event_id:e}=r;if(t)return t;let s=Im(r);return s?s.type&&s.value?`${s.type}: ${s.value}`:s.type||s.value||e||"<unknown>":e||"<unknown>"}function qP(r,t,e){let s=r.exception=r.exception||{},n=s.values=s.values||[],i=n[0]=n[0]||{};i.value||(i.value=t||""),i.type||(i.type=e||"Error")}function GP(r,t){let e=Im(r);if(!e)return;let s={type:"generic",handled:!0},n=e.mechanism;if(e.mechanism={...s,...n,...t},t&&"data"in t){let i={...n&&n.data,...t.data};e.mechanism.data=i}}var $P=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;function HP(r){let t=r.match($P)||[],e=parseInt(t[1],10),s=parseInt(t[2],10),n=parseInt(t[3],10);return{buildmetadata:t[5],major:isNaN(e)?void 0:e,minor:isNaN(s)?void 0:s,patch:isNaN(n)?void 0:n,prerelease:t[4]}}function VP(r,t,e=5){if(t.lineno===void 0)return;let s=r.length,n=Math.max(Math.min(s-1,t.lineno-1),0);t.pre_context=r.slice(Math.max(0,n-e),n).map(i=>vl.snipLine(i,0)),t.context_line=vl.snipLine(r[Math.min(s-1,n)],t.colno||0),t.post_context=r.slice(Math.min(n+1,s),n+1+e).map(i=>vl.snipLine(i,0))}function YP(r){if(r&&r.__sentry_captured__)return!0;try{FP.addNonEnumerableProperty(r,"__sentry_captured__",!0)}catch{}return!1}function WP(r){return Array.isArray(r)?r:[r]}St.addContextToFrame=VP;St.addExceptionMechanism=GP;St.addExceptionTypeValue=qP;St.arrayify=WP;St.checkOrSetAlreadyCaught=YP;St.getEventDescription=UP;St.parseSemver=HP;St.uuid4=jP});var Al=_(ha=>{Object.defineProperty(ha,"__esModule",{value:!0});function zP(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function JP(){return"npm"}ha.getSDKSource=JP;ha.isBrowserBundle=zP});var Cl=_((xn,fa)=>{Object.defineProperty(xn,"__esModule",{value:!0});var KP=Al();function XP(){return!KP.isBrowserBundle()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function da(r,t){return r.require(t)}function QP(r){let t;try{t=da(fa,r)}catch{}try{let{cwd:e}=da(fa,"process");t=da(fa,`${e()}/node_modules/${r}`)}catch{}return t}xn.dynamicRequire=da;xn.isNodeEnv=XP;xn.loadModule=QP});var Tn=_(En=>{Object.defineProperty(En,"__esModule",{value:!0});var wl=Ke(),ZP=Pl(),ev=xs(),tv=ra();function Nm(r,t=100,e=1/0){try{return ma("",r,t,e)}catch(s){return{ERROR:`**non-serializable** (${s})`}}}function km(r,t=3,e=100*1024){let s=Nm(r,t);return iv(s)>e?km(r,t-1,e):s}function ma(r,t,e=1/0,s=1/0,n=ZP.memoBuilder()){let[i,a]=n;if(t==null||["number","boolean","string"].includes(typeof t)&&!wl.isNaN(t))return t;let o=sv(r,t);if(!o.startsWith("[object "))return o;if(t.__sentry_skip_normalization__)return t;let c=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:e;if(c===0)return o.replace("object ","");if(i(t))return"[Circular ~]";let l=t;if(l&&typeof l.toJSON=="function")try{let d=l.toJSON();return ma("",d,c-1,s,n)}catch{}let u=Array.isArray(t)?[]:{},p=0,h=ev.convertToPlainObject(t);for(let d in h){if(!Object.prototype.hasOwnProperty.call(h,d))continue;if(p>=s){u[d]="[MaxProperties ~]";break}let f=h[d];u[d]=ma(d,f,c-1,s,n),p++}return a(t),u}function sv(r,t){try{if(r==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(r==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(wl.isVueViewModel(t))return"[VueViewModel]";if(wl.isSyntheticEvent(t))return"[SyntheticEvent]";if(typeof t=="number"&&t!==t)return"[NaN]";if(typeof t=="function")return`[Function: ${tv.getFunctionName(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;let e=rv(t);return/^HTML(\w*)Element$/.test(e)?`[HTMLElement: ${e}]`:`[object ${e}]`}catch(e){return`**non-serializable** (${e})`}}function rv(r){let t=Object.getPrototypeOf(r);return t?t.constructor.name:"null prototype"}function nv(r){return~-encodeURI(r).split(/%..|./).length}function iv(r){return nv(JSON.stringify(r))}En.normalize=Nm;En.normalizeToSize=km;En.walk=ma});var Fm=_(Ft=>{Object.defineProperty(Ft,"__esModule",{value:!0});function Om(r,t){let e=0;for(let s=r.length-1;s>=0;s--){let n=r[s];n==="."?r.splice(s,1):n===".."?(r.splice(s,1),e++):e&&(r.splice(s,1),e--)}if(t)for(;e--;e)r.unshift("..");return r}var av=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function Mm(r){let t=r.length>1024?`<truncated>${r.slice(-1024)}`:r,e=av.exec(t);return e?e.slice(1):[]}function Il(...r){let t="",e=!1;for(let s=r.length-1;s>=-1&&!e;s--){let n=s>=0?r[s]:"/";n&&(t=`${n}/${t}`,e=n.charAt(0)==="/")}return t=Om(t.split("/").filter(s=>!!s),!e).join("/"),(e?"/":"")+t||"."}function Dm(r){let t=0;for(;t<r.length&&r[t]==="";t++);let e=r.length-1;for(;e>=0&&r[e]==="";e--);return t>e?[]:r.slice(t,e-t+1)}function ov(r,t){r=Il(r).slice(1),t=Il(t).slice(1);let e=Dm(r.split("/")),s=Dm(t.split("/")),n=Math.min(e.length,s.length),i=n;for(let o=0;o<n;o++)if(e[o]!==s[o]){i=o;break}let a=[];for(let o=i;o<e.length;o++)a.push("..");return a=a.concat(s.slice(i)),a.join("/")}function Lm(r){let t=Rm(r),e=r.slice(-1)==="/",s=Om(r.split("/").filter(n=>!!n),!t).join("/");return!s&&!t&&(s="."),s&&e&&(s+="/"),(t?"/":"")+s}function Rm(r){return r.charAt(0)==="/"}function cv(...r){return Lm(r.join("/"))}function lv(r){let t=Mm(r),e=t[0],s=t[1];return!e&&!s?".":(s&&(s=s.slice(0,s.length-1)),e+s)}function uv(r,t){let e=Mm(r)[2];return t&&e.slice(t.length*-1)===t&&(e=e.slice(0,e.length-t.length)),e}Ft.basename=uv;Ft.dirname=lv;Ft.isAbsolute=Rm;Ft.join=cv;Ft.normalizePath=Lm;Ft.relative=ov;Ft.resolve=Il});var Nl=_(vn=>{Object.defineProperty(vn,"__esModule",{value:!0});var pv=Ke(),Bt;(function(r){r[r.PENDING=0]="PENDING";let e=1;r[r.RESOLVED=e]="RESOLVED";let s=2;r[r.REJECTED=s]="REJECTED"})(Bt||(Bt={}));function hv(r){return new Pn(t=>{t(r)})}function dv(r){return new Pn((t,e)=>{e(r)})}var Pn=class r{constructor(t){r.prototype.__init.call(this),r.prototype.__init2.call(this),r.prototype.__init3.call(this),r.prototype.__init4.call(this),this._state=Bt.PENDING,this._handlers=[];try{t(this._resolve,this._reject)}catch(e){this._reject(e)}}then(t,e){return new r((s,n)=>{this._handlers.push([!1,i=>{if(!t)s(i);else try{s(t(i))}catch(a){n(a)}},i=>{if(!e)n(i);else try{s(e(i))}catch(a){n(a)}}]),this._executeHandlers()})}catch(t){return this.then(e=>e,t)}finally(t){return new r((e,s)=>{let n,i;return this.then(a=>{i=!1,n=a,t&&t()},a=>{i=!0,n=a,t&&t()}).then(()=>{if(i){s(n);return}e(n)})})}__init(){this._resolve=t=>{this._setResult(Bt.RESOLVED,t)}}__init2(){this._reject=t=>{this._setResult(Bt.REJECTED,t)}}__init3(){this._setResult=(t,e)=>{if(this._state===Bt.PENDING){if(pv.isThenable(e)){e.then(this._resolve,this._reject);return}this._state=t,this._value=e,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===Bt.PENDING)return;let t=this._handlers.slice();this._handlers=[],t.forEach(e=>{e[0]||(this._state===Bt.RESOLVED&&e[1](this._value),this._state===Bt.REJECTED&&e[2](this._value),e[0]=!0)})}}};vn.SyncPromise=Pn;vn.rejectedSyncPromise=dv;vn.resolvedSyncPromise=hv});var Bm=_(Dl=>{Object.defineProperty(Dl,"__esModule",{value:!0});var fv=dl(),kl=Nl();function mv(r){let t=[];function e(){return r===void 0||t.length<r}function s(a){return t.splice(t.indexOf(a),1)[0]}function n(a){if(!e())return kl.rejectedSyncPromise(new fv.SentryError("Not adding Promise because buffer limit was reached."));let o=a();return t.indexOf(o)===-1&&t.push(o),o.then(()=>s(o)).then(null,()=>s(o).then(null,()=>{})),o}function i(a){return new kl.SyncPromise((o,c)=>{let l=t.length;if(!l)return o(!0);let u=setTimeout(()=>{a&&a>0&&o(!1)},a);t.forEach(p=>{kl.resolvedSyncPromise(p).then(()=>{--l||(clearTimeout(u),o(!0))},c)})})}return{$:t,add:n,drain:i}}Dl.makePromiseBuffer=mv});var Ol=_(hr=>{Object.defineProperty(hr,"__esModule",{value:!0});function yv(r){if(!r)return{};let t=r.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let e=t[6]||"",s=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:e,hash:s,relative:t[5]+e+s}}function gv(r){return r.split(/[\?#]/,1)[0]}function bv(r){return r.split(/\\?\//).filter(t=>t.length>0&&t!==",").length}function Sv(r){let{protocol:t,host:e,path:s}=r,n=e&&e.replace(/^.*@/,"[filtered]:[filtered]@").replace(":80","").replace(":443","")||"";return`${t?`${t}://`:""}${n}${s}`}hr.getNumberOfUrlSegments=bv;hr.getSanitizedUrlString=Sv;hr.parseUrl=yv;hr.stripUrlQueryAndFragment=gv});var qm=_(dr=>{Object.defineProperty(dr,"__esModule",{value:!0});var jm=Ke(),_v=Tn(),xv=Ol(),Ev={ip:!1,request:!0,transaction:!0,user:!0},Tv=["cookies","data","headers","method","query_string","url"],Pv=["id","username","email"];function vv(r,t,e){r&&((!r.metadata.source||r.metadata.source==="url")&&r.setName(...ya(t,{path:!0,method:!0})),r.setData("url",t.originalUrl||t.url),t.baseUrl&&r.setData("baseUrl",t.baseUrl),r.setData("query",Um(t,e)))}function ya(r,t={}){let e=r.method&&r.method.toUpperCase(),s="",n="url";t.customRoute||r.route?(s=t.customRoute||`${r.baseUrl||""}${r.route&&r.route.path}`,n="route"):(r.originalUrl||r.url)&&(s=xv.stripUrlQueryAndFragment(r.originalUrl||r.url||""));let i="";return t.method&&e&&(i+=e),t.method&&t.path&&(i+=" "),t.path&&s&&(i+=s),[i,n]}function Av(r,t){switch(t){case"path":return ya(r,{path:!0})[0];case"handler":return r.route&&r.route.stack&&r.route.stack[0]&&r.route.stack[0].name||"<anonymous>";case"methodPath":default:return ya(r,{path:!0,method:!0})[0]}}function Cv(r,t){let e={};return(Array.isArray(t)?t:Pv).forEach(n=>{r&&n in r&&(e[n]=r[n])}),e}function Ml(r,t){let{include:e=Tv,deps:s}=t||{},n={},i=r.headers||{},a=r.method,o=r.hostname||r.host||i.host||"<no host>",c=r.protocol==="https"||r.socket&&r.socket.encrypted?"https":"http",l=r.originalUrl||r.url||"",u=`${c}://${o}${l}`;return e.forEach(p=>{switch(p){case"headers":{n.headers=i;break}case"method":{n.method=a;break}case"url":{n.url=u;break}case"cookies":{n.cookies=r.cookies||i.cookie&&s&&s.cookie&&s.cookie.parse(i.cookie)||{};break}case"query_string":{n.query_string=Um(r,s);break}case"data":{if(a==="GET"||a==="HEAD")break;r.body!==void 0&&(n.data=jm.isString(r.body)?r.body:JSON.stringify(_v.normalize(r.body)));break}default:({}).hasOwnProperty.call(r,p)&&(n[p]=r[p])}}),n}function wv(r,t,e){let s={...Ev,...e&&e.include};if(s.request){let n=Array.isArray(s.request)?Ml(t,{include:s.request,deps:e&&e.deps}):Ml(t,{deps:e&&e.deps});r.request={...r.request,...n}}if(s.user){let n=t.user&&jm.isPlainObject(t.user)?Cv(t.user,s.user):{};Object.keys(n).length&&(r.user={...r.user,...n})}if(s.ip){let n=t.ip||t.socket&&t.socket.remoteAddress;n&&(r.user={...r.user,ip_address:n})}return s.transaction&&!r.transaction&&(r.transaction=Av(t,s.transaction)),r}function Um(r,t){let e=r.originalUrl||r.url||"";if(e)return e.startsWith("/")&&(e=`http://dogs.are.great${e}`),r.query||typeof URL!==void 0&&new URL(e).search.replace("?","")||t&&t.url&&t.url.parse(e).query||void 0}dr.addRequestDataToEvent=wv;dr.addRequestDataToTransaction=vv;dr.extractPathForTransaction=ya;dr.extractRequestData=Ml});var Hm=_(An=>{Object.defineProperty(An,"__esModule",{value:!0});var Gm=["fatal","error","warning","log","info","debug"];function Iv(r){return $m(r)}function $m(r){return r==="warn"?"warning":Gm.includes(r)?r:"log"}An.severityFromString=Iv;An.severityLevelFromString=$m;An.validSeverityLevels=Gm});var Rl=_((Xe,Jm)=>{Object.defineProperty(Xe,"__esModule",{value:!0});var Ym=Cl(),Nv=Rt(),Wm=Nv.getGlobalObject(),Ll={nowSeconds:()=>Date.now()/1e3};function kv(){let{performance:r}=Wm;if(!r||!r.now)return;let t=Date.now()-r.now();return{now:()=>r.now(),timeOrigin:t}}function Dv(){try{return Ym.dynamicRequire(Jm,"perf_hooks").performance}catch{return}}var ga=Ym.isNodeEnv()?Dv():kv(),Vm=ga===void 0?Ll:{nowSeconds:()=>(ga.timeOrigin+ga.now())/1e3},Ov=Ll.nowSeconds.bind(Ll),zm=Vm.nowSeconds.bind(Vm),Mv=zm,Lv=ga!==void 0;Xe._browserPerformanceTimeOriginMode=void 0;var Rv=(()=>{let{performance:r}=Wm;if(!r||!r.now){Xe._browserPerformanceTimeOriginMode="none";return}let t=3600*1e3,e=r.now(),s=Date.now(),n=r.timeOrigin?Math.abs(r.timeOrigin+e-s):t,i=n<t,a=r.timing&&r.timing.navigationStart,c=typeof a=="number"?Math.abs(a+e-s):t,l=c<t;return i||l?n<=c?(Xe._browserPerformanceTimeOriginMode="timeOrigin",r.timeOrigin):(Xe._browserPerformanceTimeOriginMode="navigationStart",a):(Xe._browserPerformanceTimeOriginMode="dateNow",s)})();Xe.browserPerformanceTimeOrigin=Rv;Xe.dateTimestampInSeconds=Ov;Xe.timestampInSeconds=zm;Xe.timestampWithMs=Mv;Xe.usingPerformanceAPI=Lv});var Bl=_(es=>{Object.defineProperty(es,"__esModule",{value:!0});var Fv=Ke(),Bv=ur(),jv="baggage",Fl="sentry-",Xm=/^sentry-/,Qm=8192;function Uv(r){if(!Fv.isString(r)&&!Array.isArray(r))return;let t={};if(Array.isArray(r))t=r.reduce((s,n)=>{let i=Km(n);return{...s,...i}},{});else{if(!r)return;t=Km(r)}let e=Object.entries(t).reduce((s,[n,i])=>{if(n.match(Xm)){let a=n.slice(Fl.length);s[a]=i}return s},{});if(Object.keys(e).length>0)return e}function qv(r){if(!r)return;let t=Object.entries(r).reduce((e,[s,n])=>(n&&(e[`${Fl}${s}`]=n),e),{});return Gv(t)}function Km(r){return r.split(",").map(t=>t.split("=").map(e=>decodeURIComponent(e.trim()))).reduce((t,[e,s])=>(t[e]=s,t),{})}function Gv(r){if(Object.keys(r).length!==0)return Object.entries(r).reduce((t,[e,s],n)=>{let i=`${encodeURIComponent(e)}=${encodeURIComponent(s)}`,a=n===0?i:`${t},${i}`;return a.length>Qm?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Bv.logger.warn(`Not adding key: ${e} with val: ${s} to baggage header due to exceeding baggage size limits.`),t):a},"")}es.BAGGAGE_HEADER_NAME=jv;es.MAX_BAGGAGE_STRING_LENGTH=Qm;es.SENTRY_BAGGAGE_KEY_PREFIX=Fl;es.SENTRY_BAGGAGE_KEY_PREFIX_REGEX=Xm;es.baggageHeaderToDynamicSamplingContext=Uv;es.dynamicSamplingContextToSentryBaggageHeader=qv});var ty=_(fr=>{Object.defineProperty(fr,"__esModule",{value:!0});var $v=Bl(),ba=pa(),Zm=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function ey(r){if(!r)return;let t=r.match(Zm);if(!t)return;let e;return t[3]==="1"?e=!0:t[3]==="0"&&(e=!1),{traceId:t[1],parentSampled:e,parentSpanId:t[2]}}function Hv(r,t){let e=ey(r),s=$v.baggageHeaderToDynamicSamplingContext(t),{traceId:n,parentSpanId:i,parentSampled:a}=e||{},o={traceId:n||ba.uuid4(),spanId:ba.uuid4().substring(16),sampled:a};return i&&(o.parentSpanId=i),s&&(o.dsc=s),{traceparentData:e,dynamicSamplingContext:s,propagationContext:o}}function Vv(r=ba.uuid4(),t=ba.uuid4().substring(16),e){let s="";return e!==void 0&&(s=e?"-1":"-0"),`${r}-${t}${s}`}fr.TRACEPARENT_REGEXP=Zm;fr.extractTraceparentData=ey;fr.generateSentryTraceHeader=Vv;fr.tracingContextFromHeaders=Hv});var Ul=_(Qe=>{Object.defineProperty(Qe,"__esModule",{value:!0});var Yv=ul(),Wv=Tn(),sy=xs();function zv(r,t=[]){return[r,t]}function Jv(r,t){let[e,s]=r;return[e,[...s,t]]}function ry(r,t){let e=r[1];for(let s of e){let n=s[0].type;if(t(s,n))return!0}return!1}function Kv(r,t){return ry(r,(e,s)=>t.includes(s))}function jl(r,t){return(t||new TextEncoder).encode(r)}function Xv(r,t){let[e,s]=r,n=JSON.stringify(e);function i(a){typeof n=="string"?n=typeof a=="string"?n+a:[jl(n,t),a]:n.push(typeof a=="string"?jl(a,t):a)}for(let a of s){let[o,c]=a;if(i(`
|
|
13
|
+
${JSON.stringify(o)}
|
|
14
|
+
`),typeof c=="string"||c instanceof Uint8Array)i(c);else{let l;try{l=JSON.stringify(c)}catch{l=JSON.stringify(Wv.normalize(c))}i(l)}}return typeof n=="string"?n:Qv(n)}function Qv(r){let t=r.reduce((n,i)=>n+i.length,0),e=new Uint8Array(t),s=0;for(let n of r)e.set(n,s),s+=n.length;return e}function Zv(r,t,e){let s=typeof r=="string"?t.encode(r):r;function n(c){let l=s.subarray(0,c);return s=s.subarray(c+1),l}function i(){let c=s.indexOf(10);return c<0&&(c=s.length),JSON.parse(e.decode(n(c)))}let a=i(),o=[];for(;s.length;){let c=i(),l=typeof c.length=="number"?c.length:void 0;o.push([c,l?n(l):i()])}return[a,o]}function e0(r,t){let e=typeof r.data=="string"?jl(r.data,t):r.data;return[sy.dropUndefinedKeys({type:"attachment",length:e.length,filename:r.filename,content_type:r.contentType,attachment_type:r.attachmentType}),e]}var t0={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor"};function s0(r){return t0[r]}function r0(r){if(!r||!r.sdk)return;let{name:t,version:e}=r.sdk;return{name:t,version:e}}function n0(r,t,e,s){let n=r.sdkProcessingMetadata&&r.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:r.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!e&&{dsn:Yv.dsnToString(s)},...n&&{trace:sy.dropUndefinedKeys({...n})}}}Qe.addItemToEnvelope=Jv;Qe.createAttachmentEnvelopeItem=e0;Qe.createEnvelope=zv;Qe.createEventEnvelopeHeaders=n0;Qe.envelopeContainsItemType=Kv;Qe.envelopeItemTypeToDataCategory=s0;Qe.forEachEnvelopeItem=ry;Qe.getSdkMetadataForEnvelopeHeader=r0;Qe.parseEnvelope=Zv;Qe.serializeEnvelope=Xv});var ny=_(ql=>{Object.defineProperty(ql,"__esModule",{value:!0});var i0=Ul(),a0=Rl();function o0(r,t,e){let s=[{type:"client_report"},{timestamp:e||a0.dateTimestampInSeconds(),discarded_events:r}];return i0.createEnvelope(t?{dsn:t}:{},[s])}ql.createClientReportEnvelope=o0});var cy=_(vs=>{Object.defineProperty(vs,"__esModule",{value:!0});var iy=60*1e3;function ay(r,t=Date.now()){let e=parseInt(`${r}`,10);if(!isNaN(e))return e*1e3;let s=Date.parse(`${r}`);return isNaN(s)?iy:s-t}function oy(r,t){return r[t]||r.all||0}function c0(r,t,e=Date.now()){return oy(r,t)>e}function l0(r,{statusCode:t,headers:e},s=Date.now()){let n={...r},i=e&&e["x-sentry-rate-limits"],a=e&&e["retry-after"];if(i)for(let o of i.trim().split(",")){let[c,l]=o.split(":",2),u=parseInt(c,10),p=(isNaN(u)?60:u)*1e3;if(!l)n.all=s+p;else for(let h of l.split(";"))n[h]=s+p}else a?n.all=s+ay(a,s):t===429&&(n.all=s+60*1e3);return n}vs.DEFAULT_RETRY_AFTER=iy;vs.disabledUntil=oy;vs.isRateLimited=c0;vs.parseRetryAfterHeader=ay;vs.updateRateLimits=l0});var py=_(Gl=>{Object.defineProperty(Gl,"__esModule",{value:!0});function ly(r,t,e){let s=t.match(/([a-z_]+)\.(.*)/i);if(s===null)r[t]=e;else{let n=r[s[1]];ly(n,s[2],e)}}function u0(r,t,e={}){return Array.isArray(t)?uy(r,t,e):p0(r,t,e)}function uy(r,t,e){let s=t.find(n=>n.name===r.name);if(s){for(let[n,i]of Object.entries(e))ly(s,n,i);return t}return[...t,r]}function p0(r,t,e){return n=>{let i=t(n);return r.allowExclusionByUser&&!i.find(o=>o.name===r.name)?i:uy(r,i,e)}}Gl.addOrUpdateIntegration=u0});var hy=_($l=>{Object.defineProperty($l,"__esModule",{value:!0});function h0(r){let t=[],e={};return{add(s,n){for(;t.length>=r;){let i=t.shift();i!==void 0&&delete e[i]}e[s]&&this.delete(s),t.push(s),e[s]=n},clear(){e={},t=[]},get(s){return e[s]},size(){return t.length},delete(s){if(!e[s])return!1;delete e[s];for(let n=0;n<t.length;n++)if(t[n]===s){t.splice(n,1);break}return!0}}}$l.makeFifoCache=h0});var yy=_(mr=>{Object.defineProperty(mr,"__esModule",{value:!0});var dy=Ke(),fy=pa(),d0=Tn(),f0=xs();function Hl(r,t){return r(t.stack||"",1)}function my(r,t){let e={type:t.name||t.constructor.name,value:t.message},s=Hl(r,t);return s.length&&(e.stacktrace={frames:s}),e}function m0(r,t,e,s){let n=e,a=s&&s.data&&s.data.mechanism||{handled:!0,type:"generic"};if(!dy.isError(e)){if(dy.isPlainObject(e)){let c=`Non-Error exception captured with keys: ${f0.extractExceptionKeysForMessage(e)}`,l=r(),u=l.getClient(),p=u&&u.getOptions().normalizeDepth;l.configureScope(h=>{h.setExtra("__serialized__",d0.normalizeToSize(e,p))}),n=s&&s.syntheticException||new Error(c),n.message=c}else n=s&&s.syntheticException||new Error(e),n.message=e;a.synthetic=!0}let o={exception:{values:[my(t,n)]}};return fy.addExceptionTypeValue(o,void 0,void 0),fy.addExceptionMechanism(o,a),{...o,event_id:s&&s.event_id}}function y0(r,t,e="info",s,n){let i={event_id:s&&s.event_id,level:e,message:t};if(n&&s&&s.syntheticException){let a=Hl(r,s.syntheticException);a.length&&(i.exception={values:[{value:t,stacktrace:{frames:a}}]})}return i}mr.eventFromMessage=y0;mr.eventFromUnknownInput=m0;mr.exceptionFromError=my;mr.parseStackFrames=Hl});var gy=_(Vl=>{Object.defineProperty(Vl,"__esModule",{value:!0});function g0(r){return r.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}Vl.escapeStringForRegex=g0});var L=_(E=>{Object.defineProperty(E,"__esModule",{value:!0});var b0=im(),Yl=al(),Wl=ul(),S0=dl(),zl=Rt(),yr=wm(),Re=Ke(),Sa=ur(),_0=Pl(),ts=pa(),Jl=Cl(),Kl=Tn(),jt=xs(),As=Fm(),x0=Bm(),_a=qm(),Xl=Hm(),Cn=ra(),wn=mn(),ss=Sl(),Ql=Nl(),gr=Rl(),xa=ty(),by=Al(),_t=Ul(),E0=ny(),In=cy(),br=Bl(),Ea=Ol(),T0=py(),P0=hy(),Ta=yy(),v0=gy(),A0=xl();E.applyAggregateErrorsToEvent=b0.applyAggregateErrorsToEvent;E.getDomElement=Yl.getDomElement;E.getLocationHref=Yl.getLocationHref;E.htmlTreeAsString=Yl.htmlTreeAsString;E.dsnFromString=Wl.dsnFromString;E.dsnToString=Wl.dsnToString;E.makeDsn=Wl.makeDsn;E.SentryError=S0.SentryError;E.GLOBAL_OBJ=zl.GLOBAL_OBJ;E.getGlobalObject=zl.getGlobalObject;E.getGlobalSingleton=zl.getGlobalSingleton;E.SENTRY_XHR_DATA_KEY=yr.SENTRY_XHR_DATA_KEY;E.addInstrumentationHandler=yr.addInstrumentationHandler;E.instrumentDOM=yr.instrumentDOM;E.instrumentXHR=yr.instrumentXHR;E.parseFetchArgs=yr.parseFetchArgs;E.resetInstrumentationHandlers=yr.resetInstrumentationHandlers;E.isDOMError=Re.isDOMError;E.isDOMException=Re.isDOMException;E.isElement=Re.isElement;E.isError=Re.isError;E.isErrorEvent=Re.isErrorEvent;E.isEvent=Re.isEvent;E.isInstanceOf=Re.isInstanceOf;E.isNaN=Re.isNaN;E.isPlainObject=Re.isPlainObject;E.isPrimitive=Re.isPrimitive;E.isRegExp=Re.isRegExp;E.isString=Re.isString;E.isSyntheticEvent=Re.isSyntheticEvent;E.isThenable=Re.isThenable;E.isVueViewModel=Re.isVueViewModel;E.CONSOLE_LEVELS=Sa.CONSOLE_LEVELS;E.consoleSandbox=Sa.consoleSandbox;E.logger=Sa.logger;E.originalConsoleMethods=Sa.originalConsoleMethods;E.memoBuilder=_0.memoBuilder;E.addContextToFrame=ts.addContextToFrame;E.addExceptionMechanism=ts.addExceptionMechanism;E.addExceptionTypeValue=ts.addExceptionTypeValue;E.arrayify=ts.arrayify;E.checkOrSetAlreadyCaught=ts.checkOrSetAlreadyCaught;E.getEventDescription=ts.getEventDescription;E.parseSemver=ts.parseSemver;E.uuid4=ts.uuid4;E.dynamicRequire=Jl.dynamicRequire;E.isNodeEnv=Jl.isNodeEnv;E.loadModule=Jl.loadModule;E.normalize=Kl.normalize;E.normalizeToSize=Kl.normalizeToSize;E.walk=Kl.walk;E.addNonEnumerableProperty=jt.addNonEnumerableProperty;E.convertToPlainObject=jt.convertToPlainObject;E.dropUndefinedKeys=jt.dropUndefinedKeys;E.extractExceptionKeysForMessage=jt.extractExceptionKeysForMessage;E.fill=jt.fill;E.getOriginalFunction=jt.getOriginalFunction;E.markFunctionWrapped=jt.markFunctionWrapped;E.objectify=jt.objectify;E.urlEncode=jt.urlEncode;E.basename=As.basename;E.dirname=As.dirname;E.isAbsolute=As.isAbsolute;E.join=As.join;E.normalizePath=As.normalizePath;E.relative=As.relative;E.resolve=As.resolve;E.makePromiseBuffer=x0.makePromiseBuffer;E.addRequestDataToEvent=_a.addRequestDataToEvent;E.addRequestDataToTransaction=_a.addRequestDataToTransaction;E.extractPathForTransaction=_a.extractPathForTransaction;E.extractRequestData=_a.extractRequestData;E.severityFromString=Xl.severityFromString;E.severityLevelFromString=Xl.severityLevelFromString;E.validSeverityLevels=Xl.validSeverityLevels;E.createStackParser=Cn.createStackParser;E.getFunctionName=Cn.getFunctionName;E.nodeStackLineParser=Cn.nodeStackLineParser;E.stackParserFromStackParserOptions=Cn.stackParserFromStackParserOptions;E.stripSentryFramesAndReverse=Cn.stripSentryFramesAndReverse;E.isMatchingPattern=wn.isMatchingPattern;E.safeJoin=wn.safeJoin;E.snipLine=wn.snipLine;E.stringMatchesSomePattern=wn.stringMatchesSomePattern;E.truncate=wn.truncate;E.isNativeFetch=ss.isNativeFetch;E.supportsDOMError=ss.supportsDOMError;E.supportsDOMException=ss.supportsDOMException;E.supportsErrorEvent=ss.supportsErrorEvent;E.supportsFetch=ss.supportsFetch;E.supportsNativeFetch=ss.supportsNativeFetch;E.supportsReferrerPolicy=ss.supportsReferrerPolicy;E.supportsReportingObserver=ss.supportsReportingObserver;E.SyncPromise=Ql.SyncPromise;E.rejectedSyncPromise=Ql.rejectedSyncPromise;E.resolvedSyncPromise=Ql.resolvedSyncPromise;Object.defineProperty(E,"_browserPerformanceTimeOriginMode",{enumerable:!0,get:()=>gr._browserPerformanceTimeOriginMode});E.browserPerformanceTimeOrigin=gr.browserPerformanceTimeOrigin;E.dateTimestampInSeconds=gr.dateTimestampInSeconds;E.timestampInSeconds=gr.timestampInSeconds;E.timestampWithMs=gr.timestampWithMs;E.usingPerformanceAPI=gr.usingPerformanceAPI;E.TRACEPARENT_REGEXP=xa.TRACEPARENT_REGEXP;E.extractTraceparentData=xa.extractTraceparentData;E.generateSentryTraceHeader=xa.generateSentryTraceHeader;E.tracingContextFromHeaders=xa.tracingContextFromHeaders;E.getSDKSource=by.getSDKSource;E.isBrowserBundle=by.isBrowserBundle;E.addItemToEnvelope=_t.addItemToEnvelope;E.createAttachmentEnvelopeItem=_t.createAttachmentEnvelopeItem;E.createEnvelope=_t.createEnvelope;E.createEventEnvelopeHeaders=_t.createEventEnvelopeHeaders;E.envelopeContainsItemType=_t.envelopeContainsItemType;E.envelopeItemTypeToDataCategory=_t.envelopeItemTypeToDataCategory;E.forEachEnvelopeItem=_t.forEachEnvelopeItem;E.getSdkMetadataForEnvelopeHeader=_t.getSdkMetadataForEnvelopeHeader;E.parseEnvelope=_t.parseEnvelope;E.serializeEnvelope=_t.serializeEnvelope;E.createClientReportEnvelope=E0.createClientReportEnvelope;E.DEFAULT_RETRY_AFTER=In.DEFAULT_RETRY_AFTER;E.disabledUntil=In.disabledUntil;E.isRateLimited=In.isRateLimited;E.parseRetryAfterHeader=In.parseRetryAfterHeader;E.updateRateLimits=In.updateRateLimits;E.BAGGAGE_HEADER_NAME=br.BAGGAGE_HEADER_NAME;E.MAX_BAGGAGE_STRING_LENGTH=br.MAX_BAGGAGE_STRING_LENGTH;E.SENTRY_BAGGAGE_KEY_PREFIX=br.SENTRY_BAGGAGE_KEY_PREFIX;E.SENTRY_BAGGAGE_KEY_PREFIX_REGEX=br.SENTRY_BAGGAGE_KEY_PREFIX_REGEX;E.baggageHeaderToDynamicSamplingContext=br.baggageHeaderToDynamicSamplingContext;E.dynamicSamplingContextToSentryBaggageHeader=br.dynamicSamplingContextToSentryBaggageHeader;E.getNumberOfUrlSegments=Ea.getNumberOfUrlSegments;E.getSanitizedUrlString=Ea.getSanitizedUrlString;E.parseUrl=Ea.parseUrl;E.stripUrlQueryAndFragment=Ea.stripUrlQueryAndFragment;E.addOrUpdateIntegration=T0.addOrUpdateIntegration;E.makeFifoCache=P0.makeFifoCache;E.eventFromMessage=Ta.eventFromMessage;E.eventFromUnknownInput=Ta.eventFromUnknownInput;E.exceptionFromError=Ta.exceptionFromError;E.parseStackFrames=Ta.parseStackFrames;E.escapeStringForRegex=v0.escapeStringForRegex;E.supportsHistory=A0.supportsHistory});var Nn=_(Zl=>{Object.defineProperty(Zl,"__esModule",{value:!0});var C0="production";Zl.DEFAULT_ENVIRONMENT=C0});var On=_(Dn=>{Object.defineProperty(Dn,"__esModule",{value:!0});var kn=L();function w0(r){let t=kn.timestampInSeconds(),e={sid:kn.uuid4(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>N0(e)};return r&&eu(e,r),e}function eu(r,t={}){if(t.user&&(!r.ipAddress&&t.user.ip_address&&(r.ipAddress=t.user.ip_address),!r.did&&!t.did&&(r.did=t.user.id||t.user.email||t.user.username)),r.timestamp=t.timestamp||kn.timestampInSeconds(),t.ignoreDuration&&(r.ignoreDuration=t.ignoreDuration),t.sid&&(r.sid=t.sid.length===32?t.sid:kn.uuid4()),t.init!==void 0&&(r.init=t.init),!r.did&&t.did&&(r.did=`${t.did}`),typeof t.started=="number"&&(r.started=t.started),r.ignoreDuration)r.duration=void 0;else if(typeof t.duration=="number")r.duration=t.duration;else{let e=r.timestamp-r.started;r.duration=e>=0?e:0}t.release&&(r.release=t.release),t.environment&&(r.environment=t.environment),!r.ipAddress&&t.ipAddress&&(r.ipAddress=t.ipAddress),!r.userAgent&&t.userAgent&&(r.userAgent=t.userAgent),typeof t.errors=="number"&&(r.errors=t.errors),t.status&&(r.status=t.status)}function I0(r,t){let e={};t?e={status:t}:r.status==="ok"&&(e={status:"exited"}),eu(r,e)}function N0(r){return kn.dropUndefinedKeys({sid:`${r.sid}`,init:r.init,started:new Date(r.started*1e3).toISOString(),timestamp:new Date(r.timestamp*1e3).toISOString(),status:r.status,errors:r.errors,did:typeof r.did=="number"||typeof r.did=="string"?`${r.did}`:void 0,duration:r.duration,attrs:{release:r.release,environment:r.environment,ip_address:r.ipAddress,user_agent:r.userAgent}})}Dn.closeSession=I0;Dn.makeSession=w0;Dn.updateSession=eu});var Mn=_(Pa=>{Object.defineProperty(Pa,"__esModule",{value:!0});var Ut=L(),k0=On(),D0=100,tu=class r{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=Sy()}static clone(t){let e=new r;return t&&(e._breadcrumbs=[...t._breadcrumbs],e._tags={...t._tags},e._extra={...t._extra},e._contexts={...t._contexts},e._user=t._user,e._level=t._level,e._span=t._span,e._session=t._session,e._transactionName=t._transactionName,e._fingerprint=t._fingerprint,e._eventProcessors=[...t._eventProcessors],e._requestSession=t._requestSession,e._attachments=[...t._attachments],e._sdkProcessingMetadata={...t._sdkProcessingMetadata},e._propagationContext={...t._propagationContext}),e}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{},this._session&&k0.updateSession(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(t){return this._requestSession=t,this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,e){return this._tags={...this._tags,[t]:e},this._notifyScopeListeners(),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,e){return this._extra={...this._extra,[t]:e},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,e){return e===null?delete this._contexts[t]:this._contexts[t]=e,this._notifyScopeListeners(),this}setSpan(t){return this._span=t,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){let t=this.getSpan();return t&&t.transaction}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;if(typeof t=="function"){let e=t(this);return e instanceof r?e:this}return t instanceof r?(this._tags={...this._tags,...t._tags},this._extra={...this._extra,...t._extra},this._contexts={...this._contexts,...t._contexts},t._user&&Object.keys(t._user).length&&(this._user=t._user),t._level&&(this._level=t._level),t._fingerprint&&(this._fingerprint=t._fingerprint),t._requestSession&&(this._requestSession=t._requestSession),t._propagationContext&&(this._propagationContext=t._propagationContext)):Ut.isPlainObject(t)&&(t=t,this._tags={...this._tags,...t.tags},this._extra={...this._extra,...t.extra},this._contexts={...this._contexts,...t.contexts},t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession),t.propagationContext&&(this._propagationContext=t.propagationContext)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=Sy(),this}addBreadcrumb(t,e){let s=typeof e=="number"?e:D0;if(s<=0)return this;let n={timestamp:Ut.dateTimestampInSeconds(),...t},i=this._breadcrumbs;return i.push(n),this._breadcrumbs=i.length>s?i.slice(-s):i,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(t,e={}){if(this._extra&&Object.keys(this._extra).length&&(t.extra={...this._extra,...t.extra}),this._tags&&Object.keys(this._tags).length&&(t.tags={...this._tags,...t.tags}),this._user&&Object.keys(this._user).length&&(t.user={...this._user,...t.user}),this._contexts&&Object.keys(this._contexts).length&&(t.contexts={...this._contexts,...t.contexts}),this._level&&(t.level=this._level),this._transactionName&&(t.transaction=this._transactionName),this._span){t.contexts={trace:this._span.getTraceContext(),...t.contexts};let i=this._span.transaction;if(i){t.sdkProcessingMetadata={dynamicSamplingContext:i.getDynamicSamplingContext(),...t.sdkProcessingMetadata};let a=i.name;a&&(t.tags={transaction:a,...t.tags})}}this._applyFingerprint(t);let s=this._getBreadcrumbs(),n=[...t.breadcrumbs||[],...s];return t.breadcrumbs=n.length>0?n:void 0,t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...this._sdkProcessingMetadata,propagationContext:this._propagationContext},this._notifyEventProcessors([..._y(),...this._eventProcessors],t,e)}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...t},this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}_getBreadcrumbs(){return this._breadcrumbs}_notifyEventProcessors(t,e,s,n=0){return new Ut.SyncPromise((i,a)=>{let o=t[n];if(e===null||typeof o!="function")i(e);else{let c=o({...e},s);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&o.id&&c===null&&Ut.logger.log(`Event processor "${o.id}" dropped event`),Ut.isThenable(c)?c.then(l=>this._notifyEventProcessors(t,l,s,n+1).then(i)).then(null,a):this._notifyEventProcessors(t,c,s,n+1).then(i).then(null,a)}})}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}_applyFingerprint(t){t.fingerprint=t.fingerprint?Ut.arrayify(t.fingerprint):[],this._fingerprint&&(t.fingerprint=t.fingerprint.concat(this._fingerprint)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}};function _y(){return Ut.getGlobalSingleton("globalEventProcessors",()=>[])}function O0(r){_y().push(r)}function Sy(){return{traceId:Ut.uuid4(),spanId:Ut.uuid4().substring(16)}}Pa.Scope=tu;Pa.addGlobalEventProcessor=O0});var tt=_(et=>{Object.defineProperty(et,"__esModule",{value:!0});var Ze=L(),M0=Nn(),ru=Mn(),su=On(),va=4,L0=100,Sr=class{constructor(t,e=new ru.Scope,s=va){this._version=s,this._stack=[{scope:e}],t&&this.bindClient(t)}isOlderThan(t){return this._version<t}bindClient(t){let e=this.getStackTop();e.client=t,t&&t.setupIntegrations&&t.setupIntegrations()}pushScope(){let t=ru.Scope.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:t}),t}popScope(){return this.getStack().length<=1?!1:!!this.getStack().pop()}withScope(t){let e=this.pushScope();try{t(e)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(t,e){let s=this._lastEventId=e&&e.event_id?e.event_id:Ze.uuid4(),n=new Error("Sentry syntheticException");return this._withClient((i,a)=>{i.captureException(t,{originalException:t,syntheticException:n,...e,event_id:s},a)}),s}captureMessage(t,e,s){let n=this._lastEventId=s&&s.event_id?s.event_id:Ze.uuid4(),i=new Error(t);return this._withClient((a,o)=>{a.captureMessage(t,e,{originalException:t,syntheticException:i,...s,event_id:n},o)}),n}captureEvent(t,e){let s=e&&e.event_id?e.event_id:Ze.uuid4();return t.type||(this._lastEventId=s),this._withClient((n,i)=>{n.captureEvent(t,{...e,event_id:s},i)}),s}lastEventId(){return this._lastEventId}addBreadcrumb(t,e){let{scope:s,client:n}=this.getStackTop();if(!n)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:a=L0}=n.getOptions&&n.getOptions()||{};if(a<=0)return;let c={timestamp:Ze.dateTimestampInSeconds(),...t},l=i?Ze.consoleSandbox(()=>i(c,e)):c;l!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",l,e),s.addBreadcrumb(l,a))}setUser(t){this.getScope().setUser(t)}setTags(t){this.getScope().setTags(t)}setExtras(t){this.getScope().setExtras(t)}setTag(t,e){this.getScope().setTag(t,e)}setExtra(t,e){this.getScope().setExtra(t,e)}setContext(t,e){this.getScope().setContext(t,e)}configureScope(t){let{scope:e,client:s}=this.getStackTop();s&&t(e)}run(t){let e=nu(this);try{t(this)}finally{nu(e)}}getIntegration(t){let e=this.getClient();if(!e)return null;try{return e.getIntegration(t)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ze.logger.warn(`Cannot retrieve integration ${t.id} from the current Hub`),null}}startTransaction(t,e){let s=this._callExtensionMethod("startTransaction",t,e);if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&!s){let n=this.getClient();console.warn(n?`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
|
|
15
|
+
Sentry.addTracingExtensions();
|
|
16
|
+
Sentry.init({...});
|
|
17
|
+
`:"Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return s}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(t=!1){if(t)return this.endSession();this._sendSessionUpdate()}endSession(){let e=this.getStackTop().scope,s=e.getSession();s&&su.closeSession(s),this._sendSessionUpdate(),e.setSession()}startSession(t){let{scope:e,client:s}=this.getStackTop(),{release:n,environment:i=M0.DEFAULT_ENVIRONMENT}=s&&s.getOptions()||{},{userAgent:a}=Ze.GLOBAL_OBJ.navigator||{},o=su.makeSession({release:n,environment:i,user:e.getUser(),...a&&{userAgent:a},...t}),c=e.getSession&&e.getSession();return c&&c.status==="ok"&&su.updateSession(c,{status:"exited"}),this.endSession(),e.setSession(o),o}shouldSendDefaultPii(){let t=this.getClient(),e=t&&t.getOptions();return!!(e&&e.sendDefaultPii)}_sendSessionUpdate(){let{scope:t,client:e}=this.getStackTop(),s=t.getSession();s&&e&&e.captureSession&&e.captureSession(s)}_withClient(t){let{scope:e,client:s}=this.getStackTop();s&&t(s,e)}_callExtensionMethod(t,...e){let n=Cs().__SENTRY__;if(n&&n.extensions&&typeof n.extensions[t]=="function")return n.extensions[t].apply(this,e);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ze.logger.warn(`Extension method ${t} couldn't be found, doing nothing.`)}};function Cs(){return Ze.GLOBAL_OBJ.__SENTRY__=Ze.GLOBAL_OBJ.__SENTRY__||{extensions:{},hub:void 0},Ze.GLOBAL_OBJ}function nu(r){let t=Cs(),e=Ln(t);return Aa(t,r),e}function R0(){let r=Cs();if(r.__SENTRY__&&r.__SENTRY__.acs){let t=r.__SENTRY__.acs.getCurrentHub();if(t)return t}return xy(r)}function xy(r=Cs()){return(!Ey(r)||Ln(r).isOlderThan(va))&&Aa(r,new Sr),Ln(r)}function F0(r,t=xy()){if(!Ey(r)||Ln(r).isOlderThan(va)){let e=t.getStackTop();Aa(r,new Sr(e.client,ru.Scope.clone(e.scope)))}}function B0(r){let t=Cs();t.__SENTRY__=t.__SENTRY__||{},t.__SENTRY__.acs=r}function j0(r,t={}){let e=Cs();return e.__SENTRY__&&e.__SENTRY__.acs?e.__SENTRY__.acs.runWithAsyncContext(r,t):r()}function Ey(r){return!!(r&&r.__SENTRY__&&r.__SENTRY__.hub)}function Ln(r){return Ze.getGlobalSingleton("hub",()=>new Sr,r)}function Aa(r,t){if(!r)return!1;let e=r.__SENTRY__=r.__SENTRY__||{};return e.hub=t,!0}et.API_VERSION=va;et.Hub=Sr;et.ensureHubOnCarrier=F0;et.getCurrentHub=R0;et.getHubFromCarrier=Ln;et.getMainCarrier=Cs;et.makeMain=nu;et.runWithAsyncContext=j0;et.setAsyncContextStrategy=B0;et.setHubOnCarrier=Aa});var Ca=_(iu=>{Object.defineProperty(iu,"__esModule",{value:!0});var U0=tt();function q0(r){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let t=U0.getCurrentHub().getClient(),e=r||t&&t.getOptions();return!!e&&(e.enableTracing||"tracesSampleRate"in e||"tracesSampler"in e)}iu.hasTracingEnabled=q0});var wa=_(_r=>{Object.defineProperty(_r,"__esModule",{value:!0});var G0=tt(),au=L();function $0(r){return(r||G0.getCurrentHub()).getScope().getTransaction()}_r.TRACEPARENT_REGEXP=au.TRACEPARENT_REGEXP;_r.extractTraceparentData=au.extractTraceparentData;_r.stripUrlQueryAndFragment=au.stripUrlQueryAndFragment;_r.getActiveTransaction=$0});var Py=_(lu=>{Object.defineProperty(lu,"__esModule",{value:!0});var ou=L(),H0=wa(),Ty=!1;function V0(){Ty||(Ty=!0,ou.addInstrumentationHandler("error",cu),ou.addInstrumentationHandler("unhandledrejection",cu))}function cu(){let r=H0.getActiveTransaction();if(r){let t="internal_error";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ou.logger.log(`[Tracing] Transaction: ${t} -> Global error occured`),r.setStatus(t)}}cu.tag="sentry_tracingErrorCallback";lu.registerErrorInstrumentation=V0});var Ia=_(Rn=>{Object.defineProperty(Rn,"__esModule",{value:!0});var xt=L(),uu=class{constructor(t=1e3){this._maxlen=t,this.spans=[]}add(t){this.spans.length>this._maxlen?t.spanRecorder=void 0:this.spans.push(t)}},pu=class r{constructor(t={}){this.traceId=t.traceId||xt.uuid4(),this.spanId=t.spanId||xt.uuid4().substring(16),this.startTimestamp=t.startTimestamp||xt.timestampInSeconds(),this.tags=t.tags||{},this.data=t.data||{},this.instrumenter=t.instrumenter||"sentry",this.origin=t.origin||"manual",t.parentSpanId&&(this.parentSpanId=t.parentSpanId),"sampled"in t&&(this.sampled=t.sampled),t.op&&(this.op=t.op),t.description&&(this.description=t.description),t.name&&(this.description=t.name),t.status&&(this.status=t.status),t.endTimestamp&&(this.endTimestamp=t.endTimestamp)}get name(){return this.description||""}set name(t){this.setName(t)}startChild(t){let e=new r({...t,parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId});if(e.spanRecorder=this.spanRecorder,e.spanRecorder&&e.spanRecorder.add(e),e.transaction=this.transaction,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&e.transaction){let s=t&&t.op||"< unknown op >",n=e.transaction.name||"< unknown name >",i=e.transaction.spanId,a=`[Tracing] Starting '${s}' span on transaction '${n}' (${i}).`;e.transaction.metadata.spanMetadata[e.spanId]={logMessage:a},xt.logger.log(a)}return e}setTag(t,e){return this.tags={...this.tags,[t]:e},this}setData(t,e){return this.data={...this.data,[t]:e},this}setStatus(t){return this.status=t,this}setHttpStatus(t){this.setTag("http.status_code",String(t)),this.setData("http.response.status_code",t);let e=vy(t);return e!=="unknown_error"&&this.setStatus(e),this}setName(t){this.description=t}isSuccess(){return this.status==="ok"}finish(t){if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this.transaction&&this.transaction.spanId!==this.spanId){let{logMessage:e}=this.transaction.metadata.spanMetadata[this.spanId];e&&xt.logger.log(e.replace("Starting","Finishing"))}this.endTimestamp=typeof t=="number"?t:xt.timestampInSeconds()}toTraceparent(){return xt.generateSentryTraceHeader(this.traceId,this.spanId,this.sampled)}toContext(){return xt.dropUndefinedKeys({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})}updateWithContext(t){return this.data=t.data||{},this.description=t.description,this.endTimestamp=t.endTimestamp,this.op=t.op,this.parentSpanId=t.parentSpanId,this.sampled=t.sampled,this.spanId=t.spanId||this.spanId,this.startTimestamp=t.startTimestamp||this.startTimestamp,this.status=t.status,this.tags=t.tags||{},this.traceId=t.traceId||this.traceId,this}getTraceContext(){return xt.dropUndefinedKeys({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})}toJSON(){return xt.dropUndefinedKeys({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId,origin:this.origin})}};function vy(r){if(r<400&&r>=100)return"ok";if(r>=400&&r<500)switch(r){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(r>=500&&r<600)switch(r){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}Rn.Span=pu;Rn.SpanRecorder=uu;Rn.spanStatusfromHttpCode=vy});var Fn=_(hu=>{Object.defineProperty(hu,"__esModule",{value:!0});var Y0=L(),W0=Nn();function z0(r,t,e){let s=t.getOptions(),{publicKey:n}=t.getDsn()||{},{segment:i}=e&&e.getUser()||{},a=Y0.dropUndefinedKeys({environment:s.environment||W0.DEFAULT_ENVIRONMENT,release:s.release,user_segment:i,public_key:n,trace_id:r});return t.emit&&t.emit("createDsc",a),a}hu.getDynamicSamplingContextFromClient=z0});var Na=_(fu=>{Object.defineProperty(fu,"__esModule",{value:!0});var Bn=L(),Ay=tt(),J0=Fn(),Cy=Ia(),du=class extends Cy.Span{constructor(t,e){super(t),delete this.description,this._measurements={},this._contexts={},this._hub=e||Ay.getCurrentHub(),this._name=t.name||"",this.metadata={source:"custom",...t.metadata,spanMetadata:{}},this._trimEnd=t.trimEnd,this.transaction=this;let s=this.metadata.dynamicSamplingContext;s&&(this._frozenDynamicSamplingContext={...s})}get name(){return this._name}set name(t){this.setName(t)}setName(t,e="custom"){this._name=t,this.metadata.source=e}initSpanRecorder(t=1e3){this.spanRecorder||(this.spanRecorder=new Cy.SpanRecorder(t)),this.spanRecorder.add(this)}setContext(t,e){e===null?delete this._contexts[t]:this._contexts[t]=e}setMeasurement(t,e,s=""){this._measurements[t]={value:e,unit:s}}setMetadata(t){this.metadata={...this.metadata,...t}}finish(t){if(this.endTimestamp!==void 0)return;this.name||((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Bn.logger.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this.name="<unlabeled transaction>"),super.finish(t);let e=this._hub.getClient();if(e&&e.emit&&e.emit("finishTransaction",this),this.sampled!==!0){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Bn.logger.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),e&&e.recordDroppedEvent("sample_rate","transaction");return}let s=this.spanRecorder?this.spanRecorder.spans.filter(o=>o!==this&&o.endTimestamp):[];this._trimEnd&&s.length>0&&(this.endTimestamp=s.reduce((o,c)=>o.endTimestamp&&c.endTimestamp?o.endTimestamp>c.endTimestamp?o:c:o).endTimestamp);let n=this.metadata,i={contexts:{...this._contexts,trace:this.getTraceContext()},spans:s,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",sdkProcessingMetadata:{...n,dynamicSamplingContext:this.getDynamicSamplingContext()},...n.source&&{transaction_info:{source:n.source}}};return Object.keys(this._measurements).length>0&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Bn.logger.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),i.measurements=this._measurements),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Bn.logger.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),this._hub.captureEvent(i)}toContext(){let t=super.toContext();return Bn.dropUndefinedKeys({...t,name:this.name,trimEnd:this._trimEnd})}updateWithContext(t){return super.updateWithContext(t),this.name=t.name||"",this._trimEnd=t.trimEnd,this}getDynamicSamplingContext(){if(this._frozenDynamicSamplingContext)return this._frozenDynamicSamplingContext;let t=this._hub||Ay.getCurrentHub(),e=t.getClient();if(!e)return{};let s=t.getScope(),n=J0.getDynamicSamplingContextFromClient(this.traceId,e,s),i=this.metadata.sampleRate;i!==void 0&&(n.sample_rate=`${i}`);let a=this.metadata.source;return a&&a!=="url"&&(n.transaction=this.name),this.sampled!==void 0&&(n.sampled=String(this.sampled)),n}setHub(t){this._hub=t}};fu.Transaction=du});var yu=_(jn=>{Object.defineProperty(jn,"__esModule",{value:!0});var Pe=L(),K0=Ia(),X0=Na(),ka={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},Q0="finishReason",xr=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"],Da=class extends K0.SpanRecorder{constructor(t,e,s,n){super(n),this._pushActivity=t,this._popActivity=e,this.transactionSpanId=s}add(t){t.spanId!==this.transactionSpanId&&(t.finish=e=>{t.endTimestamp=typeof e=="number"?e:Pe.timestampInSeconds(),this._popActivity(t.spanId)},t.endTimestamp===void 0&&this._pushActivity(t.spanId)),super.add(t)}},mu=class extends X0.Transaction{constructor(t,e,s=ka.idleTimeout,n=ka.finalTimeout,i=ka.heartbeatInterval,a=!1){super(t,e),this._idleHub=e,this._idleTimeout=s,this._finalTimeout=n,this._heartbeatInterval=i,this._onScope=a,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=xr[4],a&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Pe.logger.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`),e.configureScope(o=>o.setSpan(this))),this._restartIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=xr[3],this.finish())},this._finalTimeout)}finish(t=Pe.timestampInSeconds()){if(this._finished=!0,this.activities={},this.op==="ui.action.click"&&this.setTag(Q0,this._finishReason),this.spanRecorder){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Pe.logger.log("[Tracing] finishing IdleTransaction",new Date(t*1e3).toISOString(),this.op);for(let e of this._beforeFinishCallbacks)e(this,t);this.spanRecorder.spans=this.spanRecorder.spans.filter(e=>{if(e.spanId===this.spanId)return!0;e.endTimestamp||(e.endTimestamp=t,e.setStatus("cancelled"),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Pe.logger.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(e,void 0,2)));let s=e.startTimestamp<t,n=(this._finalTimeout+this._idleTimeout)/1e3,i=e.endTimestamp-this.startTimestamp<n;if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){let a=JSON.stringify(e,void 0,2);s?i||Pe.logger.log("[Tracing] discarding Span since it finished after Transaction final timeout",a):Pe.logger.log("[Tracing] discarding Span since it happened after Transaction was finished",a)}return s&&i}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Pe.logger.log("[Tracing] flushing IdleTransaction")}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Pe.logger.log("[Tracing] No active IdleTransaction");if(this._onScope){let e=this._idleHub.getScope();e.getTransaction()===this&&e.setSpan(void 0)}return super.finish(t)}registerBeforeFinishCallback(t){this._beforeFinishCallbacks.push(t)}initSpanRecorder(t){if(!this.spanRecorder){let e=n=>{this._finished||this._pushActivity(n)},s=n=>{this._finished||this._popActivity(n)};this.spanRecorder=new Da(e,s,this.spanId,t),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Pe.logger.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(t,{restartOnChildSpanChange:e}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=e===!1,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,Object.keys(this.activities).length===0&&this._idleTimeoutCanceledPermanently&&(this._finishReason=xr[5],this.finish(t)))}setFinishReason(t){this._finishReason=t}_restartIdleTimeout(t){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout(()=>{!this._finished&&Object.keys(this.activities).length===0&&(this._finishReason=xr[1],this.finish(t))},this._idleTimeout)}_pushActivity(t){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Pe.logger.log(`[Tracing] pushActivity: ${t}`),this.activities[t]=!0,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Pe.logger.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(t){if(this.activities[t]&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Pe.logger.log(`[Tracing] popActivity ${t}`),delete this.activities[t],(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Pe.logger.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){let e=Pe.timestampInSeconds();this._idleTimeoutCanceledPermanently?(this._finishReason=xr[5],this.finish(e)):this._restartIdleTimeout(e+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;let t=Object.keys(this.activities).join("");t===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=t,this._heartbeatCounter>=3?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Pe.logger.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=xr[0],this.finish()):this._pingHeartbeat()}_pingHeartbeat(){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Pe.logger.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}};jn.IdleTransaction=mu;jn.IdleTransactionSpanRecorder=Da;jn.TRACING_DEFAULTS=ka});var gu=_(Oa=>{Object.defineProperty(Oa,"__esModule",{value:!0});var rs=L(),Z0=tt(),eA=Ca(),tA=Py(),sA=yu(),rA=Na();function nA(){let t=this.getScope().getSpan();return t?{"sentry-trace":t.toTraceparent()}:{}}function wy(r,t,e){if(!eA.hasTracingEnabled(t))return r.sampled=!1,r;if(r.sampled!==void 0)return r.setMetadata({sampleRate:Number(r.sampled)}),r;let s;return typeof t.tracesSampler=="function"?(s=t.tracesSampler(e),r.setMetadata({sampleRate:Number(s)})):e.parentSampled!==void 0?s=e.parentSampled:typeof t.tracesSampleRate<"u"?(s=t.tracesSampleRate,r.setMetadata({sampleRate:Number(s)})):(s=1,r.setMetadata({sampleRate:s})),iA(s)?s?(r.sampled=Math.random()<s,r.sampled?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&rs.logger.log(`[Tracing] starting ${r.op} transaction - ${r.name}`),r):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&rs.logger.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(s)})`),r)):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&rs.logger.log(`[Tracing] Discarding transaction because ${typeof t.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),r.sampled=!1,r):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&rs.logger.warn("[Tracing] Discarding transaction because of invalid sample rate."),r.sampled=!1,r)}function iA(r){return rs.isNaN(r)||!(typeof r=="number"||typeof r=="boolean")?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&rs.logger.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(r)} of type ${JSON.stringify(typeof r)}.`),!1):r<0||r>1?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&rs.logger.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${r}.`),!1):!0}function aA(r,t){let e=this.getClient(),s=e&&e.getOptions()||{},n=s.instrumenter||"sentry",i=r.instrumenter||"sentry";n!==i&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&rs.logger.error(`A transaction was started with instrumenter=\`${i}\`, but the SDK is configured with the \`${n}\` instrumenter.
|
|
18
|
+
The transaction will not be sampled. Please use the ${n} instrumentation to start transactions.`),r.sampled=!1);let a=new rA.Transaction(r,this);return a=wy(a,s,{parentSampled:r.parentSampled,transactionContext:r,...t}),a.sampled&&a.initSpanRecorder(s._experiments&&s._experiments.maxSpans),e&&e.emit&&e.emit("startTransaction",a),a}function oA(r,t,e,s,n,i,a){let o=r.getClient(),c=o&&o.getOptions()||{},l=new sA.IdleTransaction(t,r,e,s,a,n);return l=wy(l,c,{parentSampled:t.parentSampled,transactionContext:t,...i}),l.sampled&&l.initSpanRecorder(c._experiments&&c._experiments.maxSpans),o&&o.emit&&o.emit("startTransaction",l),l}function cA(){let r=Z0.getMainCarrier();r.__SENTRY__&&(r.__SENTRY__.extensions=r.__SENTRY__.extensions||{},r.__SENTRY__.extensions.startTransaction||(r.__SENTRY__.extensions.startTransaction=aA),r.__SENTRY__.extensions.traceHeaders||(r.__SENTRY__.extensions.traceHeaders=nA),tA.registerErrorInstrumentation())}Oa.addTracingExtensions=cA;Oa.startIdleTransaction=oA});var bu=_(Un=>{Object.defineProperty(Un,"__esModule",{value:!0});Un.SpanStatus=void 0;(function(r){let t="ok";r.Ok=t;let e="deadline_exceeded";r.DeadlineExceeded=e;let s="unauthenticated";r.Unauthenticated=s;let n="permission_denied";r.PermissionDenied=n;let i="not_found";r.NotFound=i;let a="resource_exhausted";r.ResourceExhausted=a;let o="invalid_argument";r.InvalidArgument=o;let c="unimplemented";r.Unimplemented=c;let l="unavailable";r.Unavailable=l;let u="internal_error";r.InternalError=u;let p="unknown_error";r.UnknownError=p;let h="cancelled";r.Cancelled=h;let d="already_exists";r.AlreadyExists=d;let f="failed_precondition";r.FailedPrecondition=f;let m="aborted";r.Aborted=m;let y="out_of_range";r.OutOfRange=y;let b="data_loss";r.DataLoss=b})(Un.SpanStatus||(Un.SpanStatus={}))});var Dy=_(ns=>{Object.defineProperty(ns,"__esModule",{value:!0});var Su=L(),qn=tt(),Iy=Ca();function lA(r,t,e=()=>{}){let s=xu(r),n=qn.getCurrentHub(),i=n.getScope(),a=i.getSpan(),o=_u(n,a,s);i.setSpan(o);function c(){o&&o.finish(),n.getScope().setSpan(a)}let l;try{l=t(o)}catch(u){throw o&&o.setStatus("internal_error"),e(u),c(),u}return Su.isThenable(l)?Promise.resolve(l).then(()=>{c()},u=>{o&&o.setStatus("internal_error"),e(u),c()}):c(),l}function Ny(r,t){let e=xu(r),s=qn.getCurrentHub(),n=s.getScope(),i=n.getSpan(),a=_u(s,i,e);n.setSpan(a);function o(){a&&a.finish(),s.getScope().setSpan(i)}let c;try{c=t(a)}catch(l){throw a&&a.setStatus("internal_error"),o(),l}return Su.isThenable(c)?Promise.resolve(c).then(()=>{o()},()=>{a&&a.setStatus("internal_error"),o()}):o(),c}var uA=Ny;function pA(r,t){let e=xu(r),s=qn.getCurrentHub(),n=s.getScope(),i=n.getSpan(),a=_u(s,i,e);n.setSpan(a);function o(){a&&a.finish(),s.getScope().setSpan(i)}let c;try{c=t(a,o)}catch(l){throw a&&a.setStatus("internal_error"),l}return Su.isThenable(c)&&Promise.resolve(c).then(void 0,()=>{a&&a.setStatus("internal_error")}),c}function hA(r){if(!Iy.hasTracingEnabled())return;let t={...r};t.name!==void 0&&t.description===void 0&&(t.description=t.name);let e=qn.getCurrentHub(),s=ky();return s?s.startChild(t):e.startTransaction(t)}function ky(){return qn.getCurrentHub().getScope().getSpan()}function _u(r,t,e){if(Iy.hasTracingEnabled())return t?t.startChild(e):r.startTransaction(e)}function xu(r){let t={...r};return t.name!==void 0&&t.description===void 0&&(t.description=t.name),t}ns.getActiveSpan=ky;ns.startActiveSpan=uA;ns.startInactiveSpan=hA;ns.startSpan=Ny;ns.startSpanManual=pA;ns.trace=lA});var Oy=_(Eu=>{Object.defineProperty(Eu,"__esModule",{value:!0});var dA=wa();function fA(r,t,e){let s=dA.getActiveTransaction();s&&s.setMeasurement(r,t,e)}Eu.setMeasurement=fA});var My=_(de=>{Object.defineProperty(de,"__esModule",{value:!0});var Gn=L(),ve=tt();function mA(r,t){return ve.getCurrentHub().captureException(r,{captureContext:t})}function yA(r,t){let e=typeof t=="string"?t:void 0,s=typeof t!="string"?{captureContext:t}:void 0;return ve.getCurrentHub().captureMessage(r,e,s)}function gA(r,t){return ve.getCurrentHub().captureEvent(r,t)}function bA(r){ve.getCurrentHub().configureScope(r)}function SA(r){ve.getCurrentHub().addBreadcrumb(r)}function _A(r,t){ve.getCurrentHub().setContext(r,t)}function xA(r){ve.getCurrentHub().setExtras(r)}function EA(r,t){ve.getCurrentHub().setExtra(r,t)}function TA(r){ve.getCurrentHub().setTags(r)}function PA(r,t){ve.getCurrentHub().setTag(r,t)}function vA(r){ve.getCurrentHub().setUser(r)}function AA(r){ve.getCurrentHub().withScope(r)}function CA(r,t){return ve.getCurrentHub().startTransaction({...r},t)}function wA(r,t){let e=ve.getCurrentHub(),s=e.getScope(),n=e.getClient();if(!n)(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Gn.logger.warn("Cannot capture check-in. No client defined.");else if(!n.captureCheckIn)(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Gn.logger.warn("Cannot capture check-in. Client does not support sending check-ins.");else return n.captureCheckIn(r,t,s);return Gn.uuid4()}async function IA(r){let t=ve.getCurrentHub().getClient();return t?t.flush(r):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Gn.logger.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}async function NA(r){let t=ve.getCurrentHub().getClient();return t?t.close(r):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Gn.logger.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))}function kA(){return ve.getCurrentHub().lastEventId()}de.addBreadcrumb=SA;de.captureCheckIn=wA;de.captureEvent=gA;de.captureException=mA;de.captureMessage=yA;de.close=NA;de.configureScope=bA;de.flush=IA;de.lastEventId=kA;de.setContext=_A;de.setExtra=EA;de.setExtras=xA;de.setTag=PA;de.setTags=TA;de.setUser=vA;de.startTransaction=CA;de.withScope=AA});var Ly=_(Pu=>{Object.defineProperty(Pu,"__esModule",{value:!0});var DA=L(),OA=tt(),Tu=class{constructor(t,e){this._client=t,this.flushTimeout=60,this._pendingAggregates={},this._isEnabled=!0,this._intervalId=setInterval(()=>this.flush(),this.flushTimeout*1e3),this._sessionAttrs=e}flush(){let t=this.getSessionAggregates();t.aggregates.length!==0&&(this._pendingAggregates={},this._client.sendSession(t))}getSessionAggregates(){let t=Object.keys(this._pendingAggregates).map(s=>this._pendingAggregates[parseInt(s)]),e={attrs:this._sessionAttrs,aggregates:t};return DA.dropUndefinedKeys(e)}close(){clearInterval(this._intervalId),this._isEnabled=!1,this.flush()}incrementSessionStatusCount(){if(!this._isEnabled)return;let t=OA.getCurrentHub().getScope(),e=t.getRequestSession();e&&e.status&&(this._incrementSessionStatusCount(e.status,new Date),t.setRequestSession(void 0))}_incrementSessionStatusCount(t,e){let s=new Date(e).setSeconds(0,0);this._pendingAggregates[s]=this._pendingAggregates[s]||{};let n=this._pendingAggregates[s];switch(n.started||(n.started=new Date(s).toISOString()),t){case"errored":return n.errored=(n.errored||0)+1,n.errored;case"ok":return n.exited=(n.exited||0)+1,n.exited;default:return n.crashed=(n.crashed||0)+1,n.crashed}}};Pu.SessionFlusher=Tu});var La=_(Ma=>{Object.defineProperty(Ma,"__esModule",{value:!0});var vu=L(),MA="7";function Ry(r){let t=r.protocol?`${r.protocol}:`:"",e=r.port?`:${r.port}`:"";return`${t}//${r.host}${e}${r.path?`/${r.path}`:""}/api/`}function LA(r){return`${Ry(r)}${r.projectId}/envelope/`}function RA(r,t){return vu.urlEncode({sentry_key:r.publicKey,sentry_version:MA,...t&&{sentry_client:`${t.name}/${t.version}`}})}function FA(r,t={}){let e=typeof t=="string"?t:t.tunnel,s=typeof t=="string"||!t._metadata?void 0:t._metadata.sdk;return e||`${LA(r)}?${RA(r,s)}`}function BA(r,t){let e=vu.makeDsn(r);if(!e)return"";let s=`${Ry(e)}embed/error-page/`,n=`dsn=${vu.dsnToString(e)}`;for(let i in t)if(i!=="dsn")if(i==="user"){let a=t.user;if(!a)continue;a.name&&(n+=`&name=${encodeURIComponent(a.name)}`),a.email&&(n+=`&email=${encodeURIComponent(a.email)}`)}else n+=`&${encodeURIComponent(i)}=${encodeURIComponent(t[i])}`;return`${s}?${n}`}Ma.getEnvelopeEndpointWithUrlEncodedAuth=FA;Ma.getReportDialogEndpoint=BA});var Fy=_(Ra=>{Object.defineProperty(Ra,"__esModule",{value:!0});var Er=L();function jA(r,t){return t&&(r.sdk=r.sdk||{},r.sdk.name=r.sdk.name||t.name,r.sdk.version=r.sdk.version||t.version,r.sdk.integrations=[...r.sdk.integrations||[],...t.integrations||[]],r.sdk.packages=[...r.sdk.packages||[],...t.packages||[]]),r}function UA(r,t,e,s){let n=Er.getSdkMetadataForEnvelopeHeader(e),i={sent_at:new Date().toISOString(),...n&&{sdk:n},...!!s&&{dsn:Er.dsnToString(t)}},a="aggregates"in r?[{type:"sessions"},r]:[{type:"session"},r.toJSON()];return Er.createEnvelope(i,[a])}function qA(r,t,e,s){let n=Er.getSdkMetadataForEnvelopeHeader(e),i=r.type&&r.type!=="replay_event"?r.type:"event";jA(r,e&&e.sdk);let a=Er.createEventEnvelopeHeaders(r,n,s,t);delete r.sdkProcessingMetadata;let o=[{type:i},r];return Er.createEnvelope(a,[o])}Ra.createEventEnvelope=qA;Ra.createSessionEnvelope=UA});var Cu=_(Tr=>{Object.defineProperty(Tr,"__esModule",{value:!0});var By=L(),GA=tt(),$A=Mn(),Au=[];function HA(r){let t={};return r.forEach(e=>{let{name:s}=e,n=t[s];n&&!n.isDefaultInstance&&e.isDefaultInstance||(t[s]=e)}),Object.keys(t).map(e=>t[e])}function VA(r){let t=r.defaultIntegrations||[],e=r.integrations;t.forEach(a=>{a.isDefaultInstance=!0});let s;Array.isArray(e)?s=[...t,...e]:typeof e=="function"?s=By.arrayify(e(t)):s=t;let n=HA(s),i=WA(n,a=>a.name==="Debug");if(i!==-1){let[a]=n.splice(i,1);n.push(a)}return n}function YA(r,t){let e={};return t.forEach(s=>{s&&jy(r,s,e)}),e}function jy(r,t,e){if(e[t.name]=t,Au.indexOf(t.name)===-1&&(t.setupOnce($A.addGlobalEventProcessor,GA.getCurrentHub),Au.push(t.name)),r.on&&typeof t.preprocessEvent=="function"){let s=t.preprocessEvent.bind(t);r.on("preprocessEvent",(n,i)=>s(n,i,r))}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&By.logger.log(`Integration installed: ${t.name}`)}function WA(r,t){for(let e=0;e<r.length;e++)if(t(r[e])===!0)return e;return-1}Tr.getIntegrationsToSetup=VA;Tr.installedIntegrations=Au;Tr.setupIntegration=jy;Tr.setupIntegrations=YA});var wu=_($n=>{Object.defineProperty($n,"__esModule",{value:!0});var Ge=L(),zA=Nn(),JA=Mn();function KA(r,t,e,s){let{normalizeDepth:n=3,normalizeMaxBreadth:i=1e3}=r,a={...t,event_id:t.event_id||e.event_id||Ge.uuid4(),timestamp:t.timestamp||Ge.dateTimestampInSeconds()},o=e.integrations||r.integrations.map(u=>u.name);XA(a,r),QA(a,o),t.type===void 0&&qy(a,r.stackParser);let c=s;e.captureContext&&(c=JA.Scope.clone(c).update(e.captureContext));let l=Ge.resolvedSyncPromise(a);if(c){if(c.getAttachments){let u=[...e.attachments||[],...c.getAttachments()];u.length&&(e.attachments=u)}l=c.applyToEvent(a,e)}return l.then(u=>(u&&Gy(u),typeof n=="number"&&n>0?ZA(u,n,i):u))}function XA(r,t){let{environment:e,release:s,dist:n,maxValueLength:i=250}=t;"environment"in r||(r.environment="environment"in t?e:zA.DEFAULT_ENVIRONMENT),r.release===void 0&&s!==void 0&&(r.release=s),r.dist===void 0&&n!==void 0&&(r.dist=n),r.message&&(r.message=Ge.truncate(r.message,i));let a=r.exception&&r.exception.values&&r.exception.values[0];a&&a.value&&(a.value=Ge.truncate(a.value,i));let o=r.request;o&&o.url&&(o.url=Ge.truncate(o.url,i))}var Uy=new WeakMap;function qy(r,t){let e=Ge.GLOBAL_OBJ._sentryDebugIds;if(!e)return;let s,n=Uy.get(t);n?s=n:(s=new Map,Uy.set(t,s));let i=Object.keys(e).reduce((a,o)=>{let c,l=s.get(o);l?c=l:(c=t(o),s.set(o,c));for(let u=c.length-1;u>=0;u--){let p=c[u];if(p.filename){a[p.filename]=e[o];break}}return a},{});try{r.exception.values.forEach(a=>{a.stacktrace.frames.forEach(o=>{o.filename&&(o.debug_id=i[o.filename])})})}catch{}}function Gy(r){let t={};try{r.exception.values.forEach(s=>{s.stacktrace.frames.forEach(n=>{n.debug_id&&(n.abs_path?t[n.abs_path]=n.debug_id:n.filename&&(t[n.filename]=n.debug_id),delete n.debug_id)})})}catch{}if(Object.keys(t).length===0)return;r.debug_meta=r.debug_meta||{},r.debug_meta.images=r.debug_meta.images||[];let e=r.debug_meta.images;Object.keys(t).forEach(s=>{e.push({type:"sourcemap",code_file:s,debug_id:t[s]})})}function QA(r,t){t.length>0&&(r.sdk=r.sdk||{},r.sdk.integrations=[...r.sdk.integrations||[],...t])}function ZA(r,t,e){if(!r)return null;let s={...r,...r.breadcrumbs&&{breadcrumbs:r.breadcrumbs.map(n=>({...n,...n.data&&{data:Ge.normalize(n.data,t,e)}}))},...r.user&&{user:Ge.normalize(r.user,t,e)},...r.contexts&&{contexts:Ge.normalize(r.contexts,t,e)},...r.extra&&{extra:Ge.normalize(r.extra,t,e)}};return r.contexts&&r.contexts.trace&&s.contexts&&(s.contexts.trace=r.contexts.trace,r.contexts.trace.data&&(s.contexts.trace.data=Ge.normalize(r.contexts.trace.data,t,e))),r.spans&&(s.spans=r.spans.map(n=>(n.data&&(n.data=Ge.normalize(n.data,t,e)),n))),s}$n.applyDebugIds=qy;$n.applyDebugMeta=Gy;$n.prepareEvent=KA});var ku=_(Nu=>{Object.defineProperty(Nu,"__esModule",{value:!0});var W=L(),eC=La(),$y=Fy(),Hy=Cu(),Vy=On(),tC=Fn(),sC=wu(),Yy="Not capturing exception because it's already been captured.",Iu=class{constructor(t){if(this._options=t,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},t.dsn?this._dsn=W.makeDsn(t.dsn):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&W.logger.warn("No DSN provided, client will not do anything."),this._dsn){let e=eC.getEnvelopeEndpointWithUrlEncodedAuth(this._dsn,t);this._transport=t.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:e})}}captureException(t,e,s){if(W.checkOrSetAlreadyCaught(t)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&W.logger.log(Yy);return}let n=e&&e.event_id;return this._process(this.eventFromException(t,e).then(i=>this._captureEvent(i,e,s)).then(i=>{n=i})),n}captureMessage(t,e,s,n){let i=s&&s.event_id,a=W.isPrimitive(t)?this.eventFromMessage(String(t),e,s):this.eventFromException(t,s);return this._process(a.then(o=>this._captureEvent(o,s,n)).then(o=>{i=o})),i}captureEvent(t,e,s){if(e&&e.originalException&&W.checkOrSetAlreadyCaught(e.originalException)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&W.logger.log(Yy);return}let n=e&&e.event_id;return this._process(this._captureEvent(t,e,s).then(i=>{n=i})),n}captureSession(t){if(!this._isEnabled()){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&W.logger.warn("SDK not enabled, will not capture session.");return}typeof t.release!="string"?(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&W.logger.warn("Discarded session because of missing or non-string release"):(this.sendSession(t),Vy.updateSession(t,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(t){let e=this._transport;return e?this._isClientDoneProcessing(t).then(s=>e.flush(t).then(n=>s&&n)):W.resolvedSyncPromise(!0)}close(t){return this.flush(t).then(e=>(this.getOptions().enabled=!1,e))}setupIntegrations(){this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=Hy.setupIntegrations(this,this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(t){return this._integrations[t]}getIntegration(t){try{return this._integrations[t.id]||null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&W.logger.warn(`Cannot retrieve integration ${t.id} from the current Client`),null}}addIntegration(t){Hy.setupIntegration(this,t,this._integrations)}sendEvent(t,e={}){if(this.emit("beforeSendEvent",t,e),this._dsn){let s=$y.createEventEnvelope(t,this._dsn,this._options._metadata,this._options.tunnel);for(let i of e.attachments||[])s=W.addItemToEnvelope(s,W.createAttachmentEnvelopeItem(i,this._options.transportOptions&&this._options.transportOptions.textEncoder));let n=this._sendEnvelope(s);n&&n.then(i=>this.emit("afterSendEvent",t,i),null)}}sendSession(t){if(this._dsn){let e=$y.createSessionEnvelope(t,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(e)}}recordDroppedEvent(t,e,s){if(this._options.sendClientReports){let n=`${t}:${e}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&W.logger.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}on(t,e){this._hooks[t]||(this._hooks[t]=[]),this._hooks[t].push(e)}emit(t,...e){this._hooks[t]&&this._hooks[t].forEach(s=>s(...e))}_updateSessionFromEvent(t,e){let s=!1,n=!1,i=e.exception&&e.exception.values;if(i){n=!0;for(let c of i){let l=c.mechanism;if(l&&l.handled===!1){s=!0;break}}}let a=t.status==="ok";(a&&t.errors===0||a&&s)&&(Vy.updateSession(t,{...s&&{status:"crashed"},errors:t.errors||Number(n||s)}),this.captureSession(t))}_isClientDoneProcessing(t){return new W.SyncPromise(e=>{let s=0,n=1,i=setInterval(()=>{this._numProcessing==0?(clearInterval(i),e(!0)):(s+=n,t&&s>=t&&(clearInterval(i),e(!1)))},n)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._dsn!==void 0}_prepareEvent(t,e,s){let n=this.getOptions(),i=Object.keys(this._integrations);return!e.integrations&&i.length>0&&(e.integrations=i),this.emit("preprocessEvent",t,e),sC.prepareEvent(n,t,e,s).then(a=>{if(a===null)return a;let{propagationContext:o}=a.sdkProcessingMetadata||{};if(!(a.contexts&&a.contexts.trace)&&o){let{traceId:l,spanId:u,parentSpanId:p,dsc:h}=o;a.contexts={trace:{trace_id:l,span_id:u,parent_span_id:p},...a.contexts};let d=h||tC.getDynamicSamplingContextFromClient(l,this,s);a.sdkProcessingMetadata={dynamicSamplingContext:d,...a.sdkProcessingMetadata}}return a})}_captureEvent(t,e={},s){return this._processEvent(t,e,s).then(n=>n.event_id,n=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){let i=n;i.logLevel==="log"?W.logger.log(i.message):W.logger.warn(i)}})}_processEvent(t,e,s){let n=this.getOptions(),{sampleRate:i}=n;if(!this._isEnabled())return W.rejectedSyncPromise(new W.SentryError("SDK not enabled, will not capture event.","log"));let a=zy(t),o=Wy(t),c=t.type||"error",l=`before send for type \`${c}\``;if(o&&typeof i=="number"&&Math.random()>i)return this.recordDroppedEvent("sample_rate","error",t),W.rejectedSyncPromise(new W.SentryError(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));let u=c==="replay_event"?"replay":c;return this._prepareEvent(t,e,s).then(p=>{if(p===null)throw this.recordDroppedEvent("event_processor",u,t),new W.SentryError("An event processor returned `null`, will not send event.","log");if(e.data&&e.data.__sentry__===!0)return p;let d=nC(n,p,e);return rC(d,l)}).then(p=>{if(p===null)throw this.recordDroppedEvent("before_send",u,t),new W.SentryError(`${l} returned \`null\`, will not send event.`,"log");let h=s&&s.getSession();!a&&h&&this._updateSessionFromEvent(h,p);let d=p.transaction_info;if(a&&d&&p.transaction!==t.transaction){let f="custom";p.transaction_info={...d,source:f}}return this.sendEvent(p,e),p}).then(null,p=>{throw p instanceof W.SentryError?p:(this.captureException(p,{data:{__sentry__:!0},originalException:p}),new W.SentryError(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
19
|
+
Reason: ${p}`))})}_process(t){this._numProcessing++,t.then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e))}_sendEnvelope(t){if(this._transport&&this._dsn)return this.emit("beforeEnvelope",t),this._transport.send(t).then(null,e=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&W.logger.error("Error while sending event:",e)});(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&W.logger.error("Transport disabled")}_clearOutcomes(){let t=this._outcomes;return this._outcomes={},Object.keys(t).map(e=>{let[s,n]=e.split(":");return{reason:s,category:n,quantity:t[e]}})}};function rC(r,t){let e=`${t} must return \`null\` or a valid event.`;if(W.isThenable(r))return r.then(s=>{if(!W.isPlainObject(s)&&s!==null)throw new W.SentryError(e);return s},s=>{throw new W.SentryError(`${t} rejected with ${s}`)});if(!W.isPlainObject(r)&&r!==null)throw new W.SentryError(e);return r}function nC(r,t,e){let{beforeSend:s,beforeSendTransaction:n}=r;return Wy(t)&&s?s(t,e):zy(t)&&n?n(t,e):t}function Wy(r){return r.type===void 0}function zy(r){return r.type==="transaction"}Nu.BaseClient=Iu});var Mu=_(Ou=>{Object.defineProperty(Ou,"__esModule",{value:!0});var Du=L();function iC(r,t,e,s,n){let i={sent_at:new Date().toISOString()};e&&e.sdk&&(i.sdk={name:e.sdk.name,version:e.sdk.version}),s&&n&&(i.dsn=Du.dsnToString(n)),t&&(i.trace=Du.dropUndefinedKeys(t));let a=aC(r);return Du.createEnvelope(i,[a])}function aC(r){return[{type:"check_in"},r]}Ou.createCheckInEnvelope=iC});var Jy=_(Ru=>{Object.defineProperty(Ru,"__esModule",{value:!0});var Hn=L(),oC=ku(),cC=Mu(),lC=tt(),uC=gu(),pC=Fn();bu();var Lu=class extends oC.BaseClient{constructor(t){uC.addTracingExtensions(),super(t)}eventFromException(t,e){return Promise.resolve(Hn.eventFromUnknownInput(lC.getCurrentHub,this._options.stackParser,t,e))}eventFromMessage(t,e="info",s){return Promise.resolve(Hn.eventFromMessage(this._options.stackParser,t,e,s,this._options.attachStacktrace))}captureCheckIn(t,e,s){let n=t.status!=="in_progress"&&t.checkInId?t.checkInId:Hn.uuid4();if(!this._isEnabled())return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Hn.logger.warn("SDK not enabled, will not capture checkin."),n;let i=this.getOptions(),{release:a,environment:o,tunnel:c}=i,l={check_in_id:n,monitor_slug:t.monitorSlug,status:t.status,release:a,environment:o};t.status!=="in_progress"&&(l.duration=t.duration),e&&(l.monitor_config={schedule:e.schedule,checkin_margin:e.checkinMargin,max_runtime:e.maxRuntime,timezone:e.timezone});let[u,p]=this._getTraceInfoFromScope(s);p&&(l.contexts={trace:p});let h=cC.createCheckInEnvelope(l,u,this.getSdkMetadata(),c,this.getDsn());return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Hn.logger.info("Sending checkin:",t.monitorSlug,t.status),this._sendEnvelope(h),n}_prepareEvent(t,e,s){return this._options.platform&&(t.platform=t.platform||this._options.platform),this._options.runtime&&(t.contexts={...t.contexts,runtime:(t.contexts||{}).runtime||this._options.runtime}),this._options.serverName&&(t.server_name=t.server_name||this._options.serverName),super._prepareEvent(t,e,s)}_getTraceInfoFromScope(t){if(!t)return[void 0,void 0];let e=t.getSpan();if(e)return[e.transaction?e.transaction.getDynamicSamplingContext():void 0,e.getTraceContext()];let{traceId:s,spanId:n,parentSpanId:i,dsc:a}=t.getPropagationContext(),o={trace_id:s,span_id:n,parent_span_id:i};return a?[a,o]:[pC.getDynamicSamplingContextFromClient(s,this,t),o]}};Ru.ServerRuntimeClient=Lu});var Ky=_(Fu=>{Object.defineProperty(Fu,"__esModule",{value:!0});var hC=L(),dC=tt();function fC(r,t){t.debug===!0&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?hC.logger.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));let e=dC.getCurrentHub();e.getScope().update(t.initialScope);let n=new r(t);e.bindClient(n)}Fu.initAndBind=fC});var Zy=_(Fa=>{Object.defineProperty(Fa,"__esModule",{value:!0});var Fe=L(),Qy=30;function mC(r,t,e=Fe.makePromiseBuffer(r.bufferSize||Qy)){let s={},n=a=>e.drain(a);function i(a){let o=[];if(Fe.forEachEnvelopeItem(a,(p,h)=>{let d=Fe.envelopeItemTypeToDataCategory(h);if(Fe.isRateLimited(s,d)){let f=Xy(p,h);r.recordDroppedEvent("ratelimit_backoff",d,f)}else o.push(p)}),o.length===0)return Fe.resolvedSyncPromise();let c=Fe.createEnvelope(a[0],o),l=p=>{Fe.forEachEnvelopeItem(c,(h,d)=>{let f=Xy(h,d);r.recordDroppedEvent(p,Fe.envelopeItemTypeToDataCategory(d),f)})},u=()=>t({body:Fe.serializeEnvelope(c,r.textEncoder)}).then(p=>(p.statusCode!==void 0&&(p.statusCode<200||p.statusCode>=300)&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Fe.logger.warn(`Sentry responded with status code ${p.statusCode} to sent event.`),s=Fe.updateRateLimits(s,p),p),p=>{throw l("network_error"),p});return e.add(u).then(p=>p,p=>{if(p instanceof Fe.SentryError)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Fe.logger.error("Skipped sending event because buffer is full."),l("queue_overflow"),Fe.resolvedSyncPromise();throw p})}return i.__sentry__baseTransport__=!0,{send:i,flush:n}}function Xy(r,t){if(!(t!=="event"&&t!=="transaction"))return Array.isArray(r)?r[1]:void 0}Fa.DEFAULT_TRANSPORT_BUFFER_SIZE=Qy;Fa.createTransport=mC});var tg=_(Vn=>{Object.defineProperty(Vn,"__esModule",{value:!0});var ju=L(),eg=100,Uu=5e3,yC=36e5;function Bu(r,t){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ju.logger.info(`[Offline]: ${r}`,t)}function gC(r){return t=>{let e=r(t),s=t.createStore?t.createStore(t):void 0,n=Uu,i;function a(u,p,h){return ju.envelopeContainsItemType(u,["replay_event","replay_recording","client_report"])?!1:t.shouldStore?t.shouldStore(u,p,h):!0}function o(u){s&&(i&&clearTimeout(i),i=setTimeout(async()=>{i=void 0;let p=await s.pop();p&&(Bu("Attempting to send previously queued event"),l(p).catch(h=>{Bu("Failed to retry sending",h)}))},u),typeof i!="number"&&i.unref&&i.unref())}function c(){i||(o(n),n=Math.min(n*2,yC))}async function l(u){try{let p=await e.send(u),h=eg;if(p){if(p.headers&&p.headers["retry-after"])h=ju.parseRetryAfterHeader(p.headers["retry-after"]);else if((p.statusCode||0)>=400)return p}return o(h),n=Uu,p}catch(p){if(s&&await a(u,p,n))return await s.insert(u),c(),Bu("Error sending. Event queued",p),{};throw p}}return t.flushAtStartup&&c(),{send:l,flush:u=>e.flush(u)}}}Vn.MIN_DELAY=eg;Vn.START_DELAY=Uu;Vn.makeOfflineTransport=gC});var rg=_(Ba=>{Object.defineProperty(Ba,"__esModule",{value:!0});var sg=L(),bC=La();function qu(r,t){let e;return sg.forEachEnvelopeItem(r,(s,n)=>(t.includes(n)&&(e=Array.isArray(s)?s[1]:void 0),!!e)),e}function SC(r,t){return e=>{let s=r(e);return{send:async n=>{let i=qu(n,["event","transaction","profile","replay_event"]);return i&&(i.release=t),s.send(n)},flush:n=>s.flush(n)}}}function _C(r,t){return e=>{let s=r(e),n={};function i(c,l){let u=l?`${c}:${l}`:c;if(!n[u]){let p=sg.dsnFromString(c);if(!p)return;let h=bC.getEnvelopeEndpointWithUrlEncodedAuth(p);n[u]=l?SC(r,l)({...e,url:h}):r({...e,url:h})}return n[u]}async function a(c){function l(h){let d=h&&h.length?h:["event"];return qu(c,d)}let u=t({envelope:c,getEvent:l}).map(h=>typeof h=="string"?i(h,void 0):i(h.dsn,h.release)).filter(h=>!!h);return u.length===0&&u.push(s),(await Promise.all(u.map(h=>h.send(c))))[0]}async function o(c){let l=[...Object.keys(n).map(p=>n[p]),s];return(await Promise.all(l.map(p=>p.flush(c)))).every(p=>p)}return{send:a,flush:o}}}Ba.eventFromEnvelope=qu;Ba.makeMultiplexedTransport=_C});var ng=_(Gu=>{Object.defineProperty(Gu,"__esModule",{value:!0});var xC="7.69.0";Gu.SDK_VERSION=xC});var Hu=_($u=>{Object.defineProperty($u,"__esModule",{value:!0});var EC=L(),ig,ja=class r{static __initStatic(){this.id="FunctionToString"}constructor(){this.name=r.id}setupOnce(){ig=Function.prototype.toString;try{Function.prototype.toString=function(...t){let e=EC.getOriginalFunction(this)||this;return ig.apply(e,t)}}catch{}}};ja.__initStatic();$u.FunctionToString=ja});var Vu=_(Yn=>{Object.defineProperty(Yn,"__esModule",{value:!0});var be=L(),TC=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],PC=[/^.*healthcheck.*$/,/^.*healthy.*$/,/^.*live.*$/,/^.*ready.*$/,/^.*heartbeat.*$/,/^.*\/health$/,/^.*\/healthz$/],Ua=class r{static __initStatic(){this.id="InboundFilters"}constructor(t={}){this.name=r.id,this._options=t}setupOnce(t,e){let s=n=>{let i=e();if(i){let a=i.getIntegration(r);if(a){let o=i.getClient(),c=o?o.getOptions():{},l=ag(a._options,c);return og(n,l)?null:n}}return n};s.id=this.name,t(s)}};Ua.__initStatic();function ag(r={},t={}){return{allowUrls:[...r.allowUrls||[],...t.allowUrls||[]],denyUrls:[...r.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...r.ignoreErrors||[],...t.ignoreErrors||[],...r.disableErrorDefaults?[]:TC],ignoreTransactions:[...r.ignoreTransactions||[],...t.ignoreTransactions||[],...r.disableTransactionDefaults?[]:PC],ignoreInternal:r.ignoreInternal!==void 0?r.ignoreInternal:!0}}function og(r,t){return t.ignoreInternal&&NC(r)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&be.logger.warn(`Event dropped due to being internal Sentry Error.
|
|
20
|
+
Event: ${be.getEventDescription(r)}`),!0):vC(r,t.ignoreErrors)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&be.logger.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
21
|
+
Event: ${be.getEventDescription(r)}`),!0):AC(r,t.ignoreTransactions)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&be.logger.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
22
|
+
Event: ${be.getEventDescription(r)}`),!0):CC(r,t.denyUrls)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&be.logger.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
23
|
+
Event: ${be.getEventDescription(r)}.
|
|
24
|
+
Url: ${qa(r)}`),!0):wC(r,t.allowUrls)?!1:((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&be.logger.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
25
|
+
Event: ${be.getEventDescription(r)}.
|
|
26
|
+
Url: ${qa(r)}`),!0)}function vC(r,t){return r.type||!t||!t.length?!1:IC(r).some(e=>be.stringMatchesSomePattern(e,t))}function AC(r,t){if(r.type!=="transaction"||!t||!t.length)return!1;let e=r.transaction;return e?be.stringMatchesSomePattern(e,t):!1}function CC(r,t){if(!t||!t.length)return!1;let e=qa(r);return e?be.stringMatchesSomePattern(e,t):!1}function wC(r,t){if(!t||!t.length)return!0;let e=qa(r);return e?be.stringMatchesSomePattern(e,t):!0}function IC(r){let t=[];r.message&&t.push(r.message);let e;try{e=r.exception.values[r.exception.values.length-1]}catch{}return e&&e.value&&(t.push(e.value),e.type&&t.push(`${e.type}: ${e.value}`)),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&t.length===0&&be.logger.error(`Could not extract message for event ${be.getEventDescription(r)}`),t}function NC(r){try{return r.exception.values[0].type==="SentryError"}catch{}return!1}function kC(r=[]){for(let t=r.length-1;t>=0;t--){let e=r[t];if(e&&e.filename!=="<anonymous>"&&e.filename!=="[native code]")return e.filename||null}return null}function qa(r){try{let t;try{t=r.exception.values[0].stacktrace.frames}catch{}return t?kC(t):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&be.logger.error(`Cannot extract url for event ${be.getEventDescription(r)}`),null}}Yn.InboundFilters=Ua;Yn._mergeOptions=ag;Yn._shouldDropEvent=og});var cg=_(Ga=>{Object.defineProperty(Ga,"__esModule",{value:!0});var DC=Hu(),OC=Vu();Ga.FunctionToString=DC.FunctionToString;Ga.InboundFilters=OC.InboundFilters});var hg=_(Wn=>{Object.defineProperty(Wn,"__esModule",{value:!0});var Yu=L(),ug=new Map,lg=new Set;function MC(r){if(Yu.GLOBAL_OBJ._sentryModuleMetadata)for(let t of Object.keys(Yu.GLOBAL_OBJ._sentryModuleMetadata)){let e=Yu.GLOBAL_OBJ._sentryModuleMetadata[t];if(lg.has(t))continue;lg.add(t);let s=r(t);for(let n of s.reverse())if(n.filename){ug.set(n.filename,e);break}}}function pg(r,t){return MC(r),ug.get(t)}function LC(r,t){try{t.exception.values.forEach(e=>{if(e.stacktrace)for(let s of e.stacktrace.frames||[]){if(!s.filename)continue;let n=pg(r,s.filename);n&&(s.module_metadata=n)}})}catch{}}function RC(r){try{r.exception.values.forEach(t=>{if(t.stacktrace)for(let e of t.stacktrace.frames||[])delete e.module_metadata})}catch{}}Wn.addMetadataToStackFrames=LC;Wn.getMetadataForUrl=pg;Wn.stripMetadataFromStackFrames=RC});var fg=_(Wu=>{Object.defineProperty(Wu,"__esModule",{value:!0});var FC=L(),dg=hg(),$a=class r{static __initStatic(){this.id="ModuleMetadata"}constructor(){this.name=r.id}setupOnce(t,e){let s=e().getClient();if(!s||typeof s.on!="function")return;s.on("beforeEnvelope",i=>{FC.forEachEnvelopeItem(i,(a,o)=>{if(o==="event"){let c=Array.isArray(a)?a[1]:void 0;c&&(dg.stripMetadataFromStackFrames(c),a[1]=c)}})});let n=s.getOptions().stackParser;t(i=>(dg.addMetadataToStackFrames(n,i),i))}};$a.__initStatic();Wu.ModuleMetadata=$a});var ie=_(D=>{Object.defineProperty(D,"__esModule",{value:!0});var mg=gu(),yg=yu(),gg=Ia(),BC=Na(),jC=wa(),UC=bu(),Pr=Dy(),qC=Fn(),GC=Oy(),Ae=My(),qt=tt(),zu=On(),$C=Ly(),bg=Mn(),Sg=La(),HC=ku(),VC=Jy(),YC=Ky(),WC=Zy(),zC=tg(),JC=rg(),KC=ng(),XC=Cu(),QC=cg(),ZC=wu(),ew=Mu(),tw=Ca(),sw=Nn(),rw=fg(),nw=Hu(),iw=Vu(),aw=L();D.addTracingExtensions=mg.addTracingExtensions;D.startIdleTransaction=mg.startIdleTransaction;D.IdleTransaction=yg.IdleTransaction;D.TRACING_DEFAULTS=yg.TRACING_DEFAULTS;D.Span=gg.Span;D.spanStatusfromHttpCode=gg.spanStatusfromHttpCode;D.Transaction=BC.Transaction;D.getActiveTransaction=jC.getActiveTransaction;Object.defineProperty(D,"SpanStatus",{enumerable:!0,get:()=>UC.SpanStatus});D.getActiveSpan=Pr.getActiveSpan;D.startActiveSpan=Pr.startActiveSpan;D.startInactiveSpan=Pr.startInactiveSpan;D.startSpan=Pr.startSpan;D.startSpanManual=Pr.startSpanManual;D.trace=Pr.trace;D.getDynamicSamplingContextFromClient=qC.getDynamicSamplingContextFromClient;D.setMeasurement=GC.setMeasurement;D.addBreadcrumb=Ae.addBreadcrumb;D.captureCheckIn=Ae.captureCheckIn;D.captureEvent=Ae.captureEvent;D.captureException=Ae.captureException;D.captureMessage=Ae.captureMessage;D.close=Ae.close;D.configureScope=Ae.configureScope;D.flush=Ae.flush;D.lastEventId=Ae.lastEventId;D.setContext=Ae.setContext;D.setExtra=Ae.setExtra;D.setExtras=Ae.setExtras;D.setTag=Ae.setTag;D.setTags=Ae.setTags;D.setUser=Ae.setUser;D.startTransaction=Ae.startTransaction;D.withScope=Ae.withScope;D.Hub=qt.Hub;D.ensureHubOnCarrier=qt.ensureHubOnCarrier;D.getCurrentHub=qt.getCurrentHub;D.getHubFromCarrier=qt.getHubFromCarrier;D.getMainCarrier=qt.getMainCarrier;D.makeMain=qt.makeMain;D.runWithAsyncContext=qt.runWithAsyncContext;D.setAsyncContextStrategy=qt.setAsyncContextStrategy;D.setHubOnCarrier=qt.setHubOnCarrier;D.closeSession=zu.closeSession;D.makeSession=zu.makeSession;D.updateSession=zu.updateSession;D.SessionFlusher=$C.SessionFlusher;D.Scope=bg.Scope;D.addGlobalEventProcessor=bg.addGlobalEventProcessor;D.getEnvelopeEndpointWithUrlEncodedAuth=Sg.getEnvelopeEndpointWithUrlEncodedAuth;D.getReportDialogEndpoint=Sg.getReportDialogEndpoint;D.BaseClient=HC.BaseClient;D.ServerRuntimeClient=VC.ServerRuntimeClient;D.initAndBind=YC.initAndBind;D.createTransport=WC.createTransport;D.makeOfflineTransport=zC.makeOfflineTransport;D.makeMultiplexedTransport=JC.makeMultiplexedTransport;D.SDK_VERSION=KC.SDK_VERSION;D.getIntegrationsToSetup=XC.getIntegrationsToSetup;D.Integrations=QC;D.prepareEvent=ZC.prepareEvent;D.createCheckInEnvelope=ew.createCheckInEnvelope;D.hasTracingEnabled=tw.hasTracingEnabled;D.DEFAULT_ENVIRONMENT=sw.DEFAULT_ENVIRONMENT;D.ModuleMetadata=rw.ModuleMetadata;D.FunctionToString=nw.FunctionToString;D.InboundFilters=iw.InboundFilters;D.extractTraceparentData=aw.extractTraceparentData});var Ku=_(Ju=>{Object.defineProperty(Ju,"__esModule",{value:!0});function ow(r,t){return r??t()}Ju._nullishCoalesce=ow});var _g=_(Xu=>{Object.defineProperty(Xu,"__esModule",{value:!0});var cw=Ku();async function lw(r,t){return cw._nullishCoalesce(r,t)}Xu._asyncNullishCoalesce=lw});var Zu=_(Qu=>{Object.defineProperty(Qu,"__esModule",{value:!0});async function uw(r){let t,e=r[0],s=1;for(;s<r.length;){let n=r[s],i=r[s+1];if(s+=2,(n==="optionalAccess"||n==="optionalCall")&&e==null)return;n==="access"||n==="optionalAccess"?(t=e,e=await i(e)):(n==="call"||n==="optionalCall")&&(e=await i((...a)=>e.call(t,...a)),t=void 0)}return e}Qu._asyncOptionalChain=uw});var xg=_(ep=>{Object.defineProperty(ep,"__esModule",{value:!0});var pw=Zu();async function hw(r){let t=await pw._asyncOptionalChain(r);return t??!0}ep._asyncOptionalChainDelete=hw});var sp=_(tp=>{Object.defineProperty(tp,"__esModule",{value:!0});function dw(r){let t,e=r[0],s=1;for(;s<r.length;){let n=r[s],i=r[s+1];if(s+=2,(n==="optionalAccess"||n==="optionalCall")&&e==null)return;n==="access"||n==="optionalAccess"?(t=e,e=i(e)):(n==="call"||n==="optionalCall")&&(e=i((...a)=>e.call(t,...a)),t=void 0)}return e}tp._optionalChain=dw});var Eg=_(rp=>{Object.defineProperty(rp,"__esModule",{value:!0});var fw=sp();function mw(r){let t=fw._optionalChain(r);return t??!0}rp._optionalChainDelete=mw});var ue=_(is=>{Object.defineProperty(is,"__esModule",{value:!0});var yw=_g(),gw=Zu(),bw=xg(),Sw=Ku(),_w=sp(),xw=Eg();is._asyncNullishCoalesce=yw._asyncNullishCoalesce;is._asyncOptionalChain=gw._asyncOptionalChain;is._asyncOptionalChainDelete=bw._asyncOptionalChainDelete;is._nullishCoalesce=Sw._nullishCoalesce;is._optionalChain=_w._optionalChain;is._optionalChainDelete=xw._optionalChainDelete});var as=_(np=>{var{_optionalChain:Tg}=ue();Object.defineProperty(np,"__esModule",{value:!0});function Ew(r){let t=Tg([r,"call",s=>s(),"access",s=>s.getClient,"call",s=>s(),"optionalAccess",s=>s.getOptions,"call",s=>s()]);return(Tg([t,"optionalAccess",s=>s.instrumenter])||"sentry")!=="sentry"}np.shouldDisableAutoInstrumentation=Ew});var vg=_(ip=>{var{_optionalChain:zn}=ue();Object.defineProperty(ip,"__esModule",{value:!0});var pt=L(),Tw=as(),Ha=class r{static __initStatic(){this.id="Express"}constructor(t={}){this.name=r.id,this._router=t.router||t.app,this._methods=(Array.isArray(t.methods)?t.methods:[]).concat("use")}setupOnce(t,e){if(!this._router){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pt.logger.error("ExpressIntegration is missing an Express instance");return}if(Tw.shouldDisableAutoInstrumentation(e)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pt.logger.log("Express Integration is skipped because of instrumenter configuration.");return}Aw(this._router,this._methods),Cw(this._router)}};Ha.__initStatic();function Pg(r,t){let e=r.length;switch(e){case 2:return function(s,n){let i=n.__sentry_transaction;if(i){let a=i.startChild({description:r.name,op:`middleware.express.${t}`,origin:"auto.middleware.express"});n.once("finish",()=>{a.finish()})}return r.call(this,s,n)};case 3:return function(s,n,i){let a=n.__sentry_transaction,o=zn([a,"optionalAccess",c=>c.startChild,"call",c=>c({description:r.name,op:`middleware.express.${t}`,origin:"auto.middleware.express"})]);r.call(this,s,n,function(...c){zn([o,"optionalAccess",l=>l.finish,"call",l=>l()]),i.call(this,...c)})};case 4:return function(s,n,i,a){let o=i.__sentry_transaction,c=zn([o,"optionalAccess",l=>l.startChild,"call",l=>l({description:r.name,op:`middleware.express.${t}`,origin:"auto.middleware.express"})]);r.call(this,s,n,i,function(...l){zn([c,"optionalAccess",u=>u.finish,"call",u=>u()]),a.call(this,...l)})};default:throw new Error(`Express middleware takes 2-4 arguments. Got: ${e}`)}}function Pw(r,t){return r.map(e=>typeof e=="function"?Pg(e,t):Array.isArray(e)?e.map(s=>typeof s=="function"?Pg(s,t):s):e)}function vw(r,t){let e=r[t];return r[t]=function(...s){return e.call(this,...Pw(s,t))},r}function Aw(r,t=[]){t.forEach(e=>vw(r,e))}function Cw(r){let t="settings"in r;t&&r._router===void 0&&r.lazyrouter&&r.lazyrouter();let e=t?r._router:r;if(!e){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pt.logger.debug("Cannot instrument router for URL Parameterization (did not find a valid router)."),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pt.logger.debug("Routing instrumentation is currently only supported in Express 4.");return}let s=Object.getPrototypeOf(e),n=s.process_params;s.process_params=function(a,o,c,l,u){c._reconstructedRoute||(c._reconstructedRoute="");let{layerRoutePath:p,isRegex:h,isArray:d,numExtraSegments:f}=ww(a);(p||h||d)&&(c._hasParameters=!0);let y=(p||a.path||"").split("/").filter(N=>N.length>0&&(h||d||!N.includes("*"))).join("/");y&&y.length>0&&(c._reconstructedRoute+=`/${y}${h?"/":""}`);let b=pt.getNumberOfUrlSegments(c.originalUrl||"")+f,x=pt.getNumberOfUrlSegments(c._reconstructedRoute);if(b===x){c._hasParameters||c._reconstructedRoute!==c.originalUrl&&(c._reconstructedRoute=c.originalUrl?pt.stripUrlQueryAndFragment(c.originalUrl):c.originalUrl);let N=l.__sentry_transaction;if(N&&N.metadata.source!=="custom"){let T=c._reconstructedRoute||"/";N.setName(...pt.extractPathForTransaction(c,{path:!0,method:!0,customRoute:T}))}}return n.call(this,a,o,c,l,u)}}function ww(r){let t=zn([r,"access",a=>a.route,"optionalAccess",a=>a.path]),e=pt.isRegExp(t),s=Array.isArray(t);if(!t)return{isRegex:e,isArray:s,numExtraSegments:0};let n=s?Math.max(Iw(t)-pt.getNumberOfUrlSegments(r.path||""),0):0;return{layerRoutePath:Nw(s,t),isRegex:e,isArray:s,numExtraSegments:n}}function Iw(r){return r.reduce((t,e)=>t+pt.getNumberOfUrlSegments(e.toString()),0)}function Nw(r,t){return r?t.map(e=>e.toString()).join(","):t&&t.toString()}ip.Express=Ha});var Ag=_(ap=>{var{_optionalChain:vr}=ue();Object.defineProperty(ap,"__esModule",{value:!0});var Ar=L(),kw=as(),Va=class r{static __initStatic(){this.id="Postgres"}constructor(t={}){this.name=r.id,this._usePgNative=!!t.usePgNative}loadDependency(){return this._module=this._module||Ar.loadModule("pg")}setupOnce(t,e){if(kw.shouldDisableAutoInstrumentation(e)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ar.logger.log("Postgres Integration is skipped because of instrumenter configuration.");return}let s=this.loadDependency();if(!s){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ar.logger.error("Postgres Integration was unable to require `pg` package.");return}if(this._usePgNative&&!vr([s,"access",i=>i.native,"optionalAccess",i=>i.Client])){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ar.logger.error("Postgres Integration was unable to access 'pg-native' bindings.");return}let{Client:n}=this._usePgNative?s.native:s;Ar.fill(n.prototype,"query",function(i){return function(a,o,c){let u=e().getScope().getSpan(),p={"db.system":"postgresql"};try{this.database&&(p["db.name"]=this.database),this.host&&(p["server.address"]=this.host),this.port&&(p["server.port"]=this.port),this.user&&(p["db.user"]=this.user)}catch{}let h=vr([u,"optionalAccess",f=>f.startChild,"call",f=>f({description:typeof a=="string"?a:a.text,op:"db",origin:"auto.db.postgres",data:p})]);if(typeof c=="function")return i.call(this,a,o,function(f,m){vr([h,"optionalAccess",y=>y.finish,"call",y=>y()]),c(f,m)});if(typeof o=="function")return i.call(this,a,function(f,m){vr([h,"optionalAccess",y=>y.finish,"call",y=>y()]),o(f,m)});let d=typeof o<"u"?i.call(this,a,o):i.call(this,a);return Ar.isThenable(d)?d.then(f=>(vr([h,"optionalAccess",m=>m.finish,"call",m=>m()]),f)):(vr([h,"optionalAccess",f=>f.finish,"call",f=>f()]),d)}})}};Va.__initStatic();ap.Postgres=Va});var Cg=_(op=>{var{_optionalChain:Dw}=ue();Object.defineProperty(op,"__esModule",{value:!0});var Jn=L(),Ow=as(),Ya=class r{static __initStatic(){this.id="Mysql"}constructor(){this.name=r.id}loadDependency(){return this._module=this._module||Jn.loadModule("mysql/lib/Connection.js")}setupOnce(t,e){if(Ow.shouldDisableAutoInstrumentation(e)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Jn.logger.log("Mysql Integration is skipped because of instrumenter configuration.");return}let s=this.loadDependency();if(!s){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Jn.logger.error("Mysql Integration was unable to require `mysql` package.");return}let n;try{s.prototype.connect=new Proxy(s.prototype.connect,{apply(o,c,l){return n||(n=c.config),o.apply(c,l)}})}catch{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Jn.logger.error("Mysql Integration was unable to instrument `mysql` config.")}function i(){return n?{"server.address":n.host,"server.port":n.port,"db.user":n.user}:{}}function a(o){if(!o)return;let c=i();Object.keys(c).forEach(l=>{o.setData(l,c[l])}),o.finish()}Jn.fill(s,"createQuery",function(o){return function(c,l,u){let h=e().getScope().getSpan(),d=Dw([h,"optionalAccess",f=>f.startChild,"call",f=>f({description:typeof c=="string"?c:c.sql,op:"db",origin:"auto.db.mysql",data:{"db.system":"mysql"}})]);return typeof u=="function"?o.call(this,c,l,function(f,m,y){a(d),u(f,m,y)}):typeof l=="function"?o.call(this,c,function(f,m,y){a(d),l(f,m,y)}):o.call(this,c,l,function(){a(d)})}})}};Ya.__initStatic();op.Mysql=Ya});var wg=_(cp=>{var{_optionalChain:ws}=ue();Object.defineProperty(cp,"__esModule",{value:!0});var Kn=L(),Mw=as(),Lw=["aggregate","bulkWrite","countDocuments","createIndex","createIndexes","deleteMany","deleteOne","distinct","drop","dropIndex","dropIndexes","estimatedDocumentCount","find","findOne","findOneAndDelete","findOneAndReplace","findOneAndUpdate","indexes","indexExists","indexInformation","initializeOrderedBulkOp","insertMany","insertOne","isCapped","mapReduce","options","parallelCollectionScan","rename","replaceOne","stats","updateMany","updateOne"],Rw={bulkWrite:["operations"],countDocuments:["query"],createIndex:["fieldOrSpec"],createIndexes:["indexSpecs"],deleteMany:["filter"],deleteOne:["filter"],distinct:["key","query"],dropIndex:["indexName"],find:["query"],findOne:["query"],findOneAndDelete:["filter"],findOneAndReplace:["filter","replacement"],findOneAndUpdate:["filter","update"],indexExists:["indexes"],insertMany:["docs"],insertOne:["doc"],mapReduce:["map","reduce"],rename:["newName"],replaceOne:["filter","doc"],updateMany:["filter","update"],updateOne:["filter","update"]};function Fw(r){return r&&typeof r=="object"&&r.once&&typeof r.once=="function"}var Wa=class r{static __initStatic(){this.id="Mongo"}constructor(t={}){this.name=r.id,this._operations=Array.isArray(t.operations)?t.operations:Lw,this._describeOperations="describeOperations"in t?t.describeOperations:!0,this._useMongoose=!!t.useMongoose}loadDependency(){let t=this._useMongoose?"mongoose":"mongodb";return this._module=this._module||Kn.loadModule(t)}setupOnce(t,e){if(Mw.shouldDisableAutoInstrumentation(e)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Kn.logger.log("Mongo Integration is skipped because of instrumenter configuration.");return}let s=this.loadDependency();if(!s){let n=this._useMongoose?"mongoose":"mongodb";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Kn.logger.error(`Mongo Integration was unable to require \`${n}\` package.`);return}this._instrumentOperations(s.Collection,this._operations,e)}_instrumentOperations(t,e,s){e.forEach(n=>this._patchOperation(t,n,s))}_patchOperation(t,e,s){if(!(e in t.prototype))return;let n=this._getSpanContextFromOperationArguments.bind(this);Kn.fill(t.prototype,e,function(i){return function(...a){let o=a[a.length-1],l=s().getScope().getSpan();if(typeof o!="function"||e==="mapReduce"&&a.length===2){let p=ws([l,"optionalAccess",d=>d.startChild,"call",d=>d(n(this,e,a))]),h=i.call(this,...a);if(Kn.isThenable(h))return h.then(d=>(ws([p,"optionalAccess",f=>f.finish,"call",f=>f()]),d));if(Fw(h)){let d=h;try{d.once("close",()=>{ws([p,"optionalAccess",f=>f.finish,"call",f=>f()])})}catch{ws([p,"optionalAccess",m=>m.finish,"call",m=>m()])}return d}else return ws([p,"optionalAccess",d=>d.finish,"call",d=>d()]),h}let u=ws([l,"optionalAccess",p=>p.startChild,"call",p=>p(n(this,e,a.slice(0,-1)))]);return i.call(this,...a.slice(0,-1),function(p,h){ws([u,"optionalAccess",d=>d.finish,"call",d=>d()]),o(p,h)})}})}_getSpanContextFromOperationArguments(t,e,s){let n={"db.system":"mongodb","db.name":t.dbName,"db.operation":e,"db.mongodb.collection":t.collectionName},i={op:"db",origin:"auto.db.mongo",description:e,data:n},a=Rw[e],o=Array.isArray(this._describeOperations)?this._describeOperations.includes(e):this._describeOperations;if(!a||!o)return i;try{if(e==="mapReduce"){let[c,l]=s;n[a[0]]=typeof c=="string"?c:c.name||"<anonymous>",n[a[1]]=typeof l=="string"?l:l.name||"<anonymous>"}else for(let c=0;c<a.length;c++)n[`db.mongodb.${a[c]}`]=JSON.stringify(s[c])}catch{}return i}};Wa.__initStatic();cp.Mongo=Wa});var kg=_(lp=>{Object.defineProperty(lp,"__esModule",{value:!0});var Ig=ie(),Ng=L(),Bw=as();function jw(r){return!!r&&!!r.$use}var za=class r{static __initStatic(){this.id="Prisma"}constructor(t={}){if(this.name=r.id,jw(t.client)&&!t.client._sentryInstrumented){Ng.addNonEnumerableProperty(t.client,"_sentryInstrumented",!0);let e={};try{let s=t.client._engineConfig;if(s){let{activeProvider:n,clientVersion:i}=s;n&&(e["db.system"]=n),i&&(e["db.prisma.version"]=i)}}catch{}t.client.$use((s,n)=>{if(Bw.shouldDisableAutoInstrumentation(Ig.getCurrentHub))return n(s);let i=s.action,a=s.model;return Ig.trace({name:a?`${a} ${i}`:i,op:"db.sql.prisma",origin:"auto.db.prisma",data:{...e,"db.operation":i}},()=>n(s))})}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ng.logger.warn("Unsupported Prisma client provided to PrismaIntegration. Provided client:",t.client)}setupOnce(){}};za.__initStatic();lp.Prisma=za});var Dg=_(up=>{var{_optionalChain:Cr}=ue();Object.defineProperty(up,"__esModule",{value:!0});var Xn=L(),Uw=as(),Ja=class r{static __initStatic(){this.id="GraphQL"}constructor(){this.name=r.id}loadDependency(){return this._module=this._module||Xn.loadModule("graphql/execution/execute.js")}setupOnce(t,e){if(Uw.shouldDisableAutoInstrumentation(e)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Xn.logger.log("GraphQL Integration is skipped because of instrumenter configuration.");return}let s=this.loadDependency();if(!s){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Xn.logger.error("GraphQL Integration was unable to require graphql/execution package.");return}Xn.fill(s,"execute",function(n){return function(...i){let a=e().getScope(),o=a.getSpan(),c=Cr([o,"optionalAccess",u=>u.startChild,"call",u=>u({description:"execute",op:"graphql.execute",origin:"auto.graphql.graphql"})]);Cr([a,"optionalAccess",u=>u.setSpan,"call",u=>u(c)]);let l=n.call(this,...i);return Xn.isThenable(l)?l.then(u=>(Cr([c,"optionalAccess",p=>p.finish,"call",p=>p()]),Cr([a,"optionalAccess",p=>p.setSpan,"call",p=>p(o)]),u)):(Cr([c,"optionalAccess",u=>u.finish,"call",u=>u()]),Cr([a,"optionalAccess",u=>u.setSpan,"call",u=>u(o)]),l)}})}};Ja.__initStatic();up.GraphQL=Ja});var Mg=_(hp=>{var{_optionalChain:pp}=ue();Object.defineProperty(hp,"__esModule",{value:!0});var Ie=L(),qw=as(),Ka=class r{static __initStatic(){this.id="Apollo"}constructor(t={useNestjs:!1}){this.name=r.id,this._useNest=!!t.useNestjs}loadDependency(){return this._useNest?this._module=this._module||Ie.loadModule("@nestjs/graphql"):this._module=this._module||Ie.loadModule("apollo-server-core"),this._module}setupOnce(t,e){if(qw.shouldDisableAutoInstrumentation(e)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ie.logger.log("Apollo Integration is skipped because of instrumenter configuration.");return}if(this._useNest){let s=this.loadDependency();if(!s){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ie.logger.error("Apollo-NestJS Integration was unable to require @nestjs/graphql package.");return}Ie.fill(s.GraphQLFactory.prototype,"mergeWithSchema",function(n){return function(...i){return Ie.fill(this.resolversExplorerService,"explore",function(a){return function(){let o=Ie.arrayify(a.call(this));return Og(o,e)}}),n.call(this,...i)}})}else{let s=this.loadDependency();if(!s){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ie.logger.error("Apollo Integration was unable to require apollo-server-core package.");return}Ie.fill(s.ApolloServerBase.prototype,"constructSchema",function(n){return function(){if(!this.config.resolvers)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&(this.config.schema?(Ie.logger.warn("Apollo integration is not able to trace `ApolloServer` instances constructed via `schema` property.If you are using NestJS with Apollo, please use `Sentry.Integrations.Apollo({ useNestjs: true })` instead."),Ie.logger.warn()):this.config.modules&&Ie.logger.warn("Apollo integration is not able to trace `ApolloServer` instances constructed via `modules` property."),Ie.logger.error("Skipping tracing as no resolvers found on the `ApolloServer` instance.")),n.call(this);let i=Ie.arrayify(this.config.resolvers);return this.config.resolvers=Og(i,e),n.call(this)}})}}};Ka.__initStatic();function Og(r,t){return r.map(e=>(Object.keys(e).forEach(s=>{Object.keys(e[s]).forEach(n=>{typeof e[s][n]=="function"&&Gw(e,s,n,t)})}),e))}function Gw(r,t,e,s){Ie.fill(r[t],e,function(n){return function(...i){let o=s().getScope().getSpan(),c=pp([o,"optionalAccess",u=>u.startChild,"call",u=>u({description:`${t}.${e}`,op:"graphql.resolve",origin:"auto.graphql.apollo"})]),l=n.call(this,...i);return Ie.isThenable(l)?l.then(u=>(pp([c,"optionalAccess",p=>p.finish,"call",p=>p()]),u)):(pp([c,"optionalAccess",u=>u.finish,"call",u=>u()]),l)}})}hp.Apollo=Ka});var Lg=_((dp,os)=>{Object.defineProperty(dp,"__esModule",{value:!0});var Is=L(),$w=[()=>{let r=Is.dynamicRequire(os,"./apollo");return new r.Apollo},()=>{let r=Is.dynamicRequire(os,"./apollo");return new r.Apollo({useNestjs:!0})},()=>{let r=Is.dynamicRequire(os,"./graphql");return new r.GraphQL},()=>{let r=Is.dynamicRequire(os,"./mongo");return new r.Mongo},()=>{let r=Is.dynamicRequire(os,"./mongo");return new r.Mongo({mongoose:!0})},()=>{let r=Is.dynamicRequire(os,"./mysql");return new r.Mysql},()=>{let r=Is.dynamicRequire(os,"./postgres");return new r.Postgres}];dp.lazyLoadedNodePerformanceMonitoringIntegrations=$w});var Gt=_(fp=>{Object.defineProperty(fp,"__esModule",{value:!0});var Hw=L(),Vw=Hw.GLOBAL_OBJ;fp.WINDOW=Vw});var Fg=_(mp=>{Object.defineProperty(mp,"__esModule",{value:!0});var Yw=ie(),Rg=L(),Xa=Gt();function Ww(){Xa.WINDOW&&Xa.WINDOW.document?Xa.WINDOW.document.addEventListener("visibilitychange",()=>{let r=Yw.getActiveTransaction();if(Xa.WINDOW.document.hidden&&r){let t="cancelled";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Rg.logger.log(`[Tracing] Transaction: ${t} -> since tab moved to the background, op: ${r.op}`),r.status||r.setStatus(t),r.setTag("visibilitychange","document.hidden"),r.finish()}}):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Rg.logger.warn("[Tracing] Could not set up background tab detection due to lack of global document")}mp.registerBackgroundTabDetection=Ww});var Qa=_(yp=>{Object.defineProperty(yp,"__esModule",{value:!0});var zw=(r,t,e)=>{let s,n;return i=>{t.value>=0&&(i||e)&&(n=t.value-(s||0),(n||s===void 0)&&(s=t.value,t.delta=n,r(t)))}};yp.bindReporter=zw});var Bg=_(gp=>{Object.defineProperty(gp,"__esModule",{value:!0});var Jw=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`;gp.generateUniqueID=Jw});var Sp=_(bp=>{Object.defineProperty(bp,"__esModule",{value:!0});var Qn=Gt(),Kw=()=>{let r=Qn.WINDOW.performance.timing,t=Qn.WINDOW.performance.navigation.type,e={entryType:"navigation",startTime:0,type:t==2?"back_forward":t===1?"reload":"navigate"};for(let s in r)s!=="navigationStart"&&s!=="toJSON"&&(e[s]=Math.max(r[s]-r.navigationStart,0));return e},Xw=()=>Qn.WINDOW.__WEB_VITALS_POLYFILL__?Qn.WINDOW.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||Kw()):Qn.WINDOW.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];bp.getNavigationEntry=Xw});var xp=_(_p=>{Object.defineProperty(_p,"__esModule",{value:!0});var Qw=Sp(),Zw=()=>{let r=Qw.getNavigationEntry();return r&&r.activationStart||0};_p.getActivationStart=Zw});var Za=_(Ep=>{Object.defineProperty(Ep,"__esModule",{value:!0});var eI=Gt(),tI=Bg(),sI=xp(),rI=Sp(),nI=(r,t)=>{let e=rI.getNavigationEntry(),s="navigate";return e&&(eI.WINDOW.document.prerendering||sI.getActivationStart()>0?s="prerender":s=e.type.replace(/_/g,"-")),{name:r,value:typeof t>"u"?-1:t,rating:"good",delta:0,entries:[],id:tI.generateUniqueID(),navigationType:s}};Ep.initMetric=nI});var Zn=_(Tp=>{Object.defineProperty(Tp,"__esModule",{value:!0});var iI=(r,t,e)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(r)){let s=new PerformanceObserver(n=>{t(n.getEntries())});return s.observe(Object.assign({type:r,buffered:!0},e||{})),s}}catch{}};Tp.observe=iI});var ei=_(Pp=>{Object.defineProperty(Pp,"__esModule",{value:!0});var aI=Gt(),oI=(r,t)=>{let e=s=>{(s.type==="pagehide"||aI.WINDOW.document.visibilityState==="hidden")&&(r(s),t&&(removeEventListener("visibilitychange",e,!0),removeEventListener("pagehide",e,!0)))};addEventListener("visibilitychange",e,!0),addEventListener("pagehide",e,!0)};Pp.onHidden=oI});var jg=_(vp=>{Object.defineProperty(vp,"__esModule",{value:!0});var cI=Qa(),lI=Za(),uI=Zn(),pI=ei(),hI=r=>{let t=lI.initMetric("CLS",0),e,s=0,n=[],i=o=>{o.forEach(c=>{if(!c.hadRecentInput){let l=n[0],u=n[n.length-1];s&&n.length!==0&&c.startTime-u.startTime<1e3&&c.startTime-l.startTime<5e3?(s+=c.value,n.push(c)):(s=c.value,n=[c]),s>t.value&&(t.value=s,t.entries=n,e&&e())}})},a=uI.observe("layout-shift",i);if(a){e=cI.bindReporter(r,t);let o=()=>{i(a.takeRecords()),e(!0)};return pI.onHidden(o),o}};vp.onCLS=hI});var to=_(Ap=>{Object.defineProperty(Ap,"__esModule",{value:!0});var Ug=Gt(),dI=ei(),eo=-1,fI=()=>Ug.WINDOW.document.visibilityState==="hidden"&&!Ug.WINDOW.document.prerendering?0:1/0,mI=()=>{dI.onHidden(({timeStamp:r})=>{eo=r},!0)},yI=()=>(eo<0&&(eo=fI(),mI()),{get firstHiddenTime(){return eo}});Ap.getVisibilityWatcher=yI});var qg=_(Cp=>{Object.defineProperty(Cp,"__esModule",{value:!0});var gI=Qa(),bI=to(),SI=Za(),_I=Zn(),xI=ei(),EI=r=>{let t=bI.getVisibilityWatcher(),e=SI.initMetric("FID"),s,n=o=>{o.startTime<t.firstHiddenTime&&(e.value=o.processingStart-o.startTime,e.entries.push(o),s(!0))},i=o=>{o.forEach(n)},a=_I.observe("first-input",i);s=gI.bindReporter(r,e),a&&xI.onHidden(()=>{i(a.takeRecords()),a.disconnect()},!0)};Cp.onFID=EI});var $g=_(wp=>{Object.defineProperty(wp,"__esModule",{value:!0});var TI=Qa(),PI=xp(),vI=to(),AI=Za(),CI=Zn(),wI=ei(),Gg={},II=r=>{let t=vI.getVisibilityWatcher(),e=AI.initMetric("LCP"),s,n=a=>{let o=a[a.length-1];if(o){let c=Math.max(o.startTime-PI.getActivationStart(),0);c<t.firstHiddenTime&&(e.value=c,e.entries=[o],s())}},i=CI.observe("largest-contentful-paint",n);if(i){s=TI.bindReporter(r,e);let a=()=>{Gg[e.id]||(n(i.takeRecords()),i.disconnect(),Gg[e.id]=!0,s(!0))};return["keydown","click"].forEach(o=>{addEventListener(o,a,{once:!0,capture:!0})}),wI.onHidden(a,!0),a}};wp.onLCP=II});var Hg=_(so=>{Object.defineProperty(so,"__esModule",{value:!0});function NI(r){return typeof r=="number"&&isFinite(r)}function kI(r,{startTimestamp:t,...e}){return t&&r.startTimestamp>t&&(r.startTimestamp=t),r.startChild({startTimestamp:t,...e})}so._startChild=kI;so.isMeasurementValue=NI});var Xg=_(cs=>{Object.defineProperty(cs,"__esModule",{value:!0});var Yg=ie(),fe=L(),Ns=Gt(),DI=jg(),OI=qg(),MI=$g(),LI=to(),Wg=Zn(),$t=Hg();function me(r){return r/1e3}function zg(){return Ns.WINDOW&&Ns.WINDOW.addEventListener&&Ns.WINDOW.performance}var Vg=0,oe={},Et,ti;function RI(){let r=zg();if(r&&fe.browserPerformanceTimeOrigin){r.mark&&Ns.WINDOW.performance.mark("sentry-tracing-init"),qI();let t=jI(),e=UI();return()=>{t&&t(),e&&e()}}return()=>{}}function FI(){let r=t=>{for(let e of t){let s=Yg.getActiveTransaction();if(!s)return;let n=me(fe.browserPerformanceTimeOrigin+e.startTime),i=me(e.duration);s.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:n,endTimestamp:n+i})}};Wg.observe("longtask",r)}function BI(){let r=t=>{for(let e of t){let s=Yg.getActiveTransaction();if(!s)return;if(e.name==="click"){let n=me(fe.browserPerformanceTimeOrigin+e.startTime),i=me(e.duration);s.startChild({description:fe.htmlTreeAsString(e.target),op:`ui.interaction.${e.name}`,origin:"auto.ui.browser.metrics",startTimestamp:n,endTimestamp:n+i})}}};Wg.observe("event",r,{durationThreshold:0})}function jI(){return DI.onCLS(r=>{let t=r.entries.pop();t&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&fe.logger.log("[Measurements] Adding CLS"),oe.cls={value:r.value,unit:""},ti=t)})}function UI(){return MI.onLCP(r=>{let t=r.entries.pop();t&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&fe.logger.log("[Measurements] Adding LCP"),oe.lcp={value:r.value,unit:"millisecond"},Et=t)})}function qI(){OI.onFID(r=>{let t=r.entries.pop();if(!t)return;let e=me(fe.browserPerformanceTimeOrigin),s=me(t.startTime);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&fe.logger.log("[Measurements] Adding FID"),oe.fid={value:r.value,unit:"millisecond"},oe["mark.fid"]={value:e+s,unit:"second"}})}function GI(r){let t=zg();if(!t||!Ns.WINDOW.performance.getEntries||!fe.browserPerformanceTimeOrigin)return;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&fe.logger.log("[Tracing] Adding & adjusting spans using Performance API");let e=me(fe.browserPerformanceTimeOrigin),s=t.getEntries(),n,i;if(s.slice(Vg).forEach(a=>{let o=me(a.startTime),c=me(a.duration);if(!(r.op==="navigation"&&e+o<r.startTimestamp))switch(a.entryType){case"navigation":{$I(r,a,e),n=e+me(a.responseStart),i=e+me(a.requestStart);break}case"mark":case"paint":case"measure":{Jg(r,a,o,c,e);let l=LI.getVisibilityWatcher(),u=a.startTime<l.firstHiddenTime;a.name==="first-paint"&&u&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&fe.logger.log("[Measurements] Adding FP"),oe.fp={value:a.startTime,unit:"millisecond"}),a.name==="first-contentful-paint"&&u&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&fe.logger.log("[Measurements] Adding FCP"),oe.fcp={value:a.startTime,unit:"millisecond"});break}case"resource":{let l=a.name.replace(Ns.WINDOW.location.origin,"");Kg(r,a,l,o,c,e);break}}}),Vg=Math.max(s.length-1,0),VI(r),r.op==="pageload"){typeof n=="number"&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&fe.logger.log("[Measurements] Adding TTFB"),oe.ttfb={value:(n-r.startTimestamp)*1e3,unit:"millisecond"},typeof i=="number"&&i<=n&&(oe["ttfb.requestTime"]={value:(n-i)*1e3,unit:"millisecond"})),["fcp","fp","lcp"].forEach(o=>{if(!oe[o]||e>=r.startTimestamp)return;let c=oe[o].value,l=e+me(c),u=Math.abs((l-r.startTimestamp)*1e3),p=u-c;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&fe.logger.log(`[Measurements] Normalized ${o} from ${c} to ${u} (${p})`),oe[o].value=u});let a=oe["mark.fid"];a&&oe.fid&&($t._startChild(r,{description:"first input delay",endTimestamp:a.value+me(oe.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:a.value}),delete oe["mark.fid"]),"fcp"in oe||delete oe.cls,Object.keys(oe).forEach(o=>{r.setMeasurement(o,oe[o].value,oe[o].unit)}),YI(r)}Et=void 0,ti=void 0,oe={}}function Jg(r,t,e,s,n){let i=n+e,a=i+s;return $t._startChild(r,{description:t.name,endTimestamp:a,op:t.entryType,origin:"auto.resource.browser.metrics",startTimestamp:i}),i}function $I(r,t,e){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(s=>{ro(r,t,s,e)}),ro(r,t,"secureConnection",e,"TLS/SSL","connectEnd"),ro(r,t,"fetch",e,"cache","domainLookupStart"),ro(r,t,"domainLookup",e,"DNS"),HI(r,t,e)}function ro(r,t,e,s,n,i){let a=i?t[i]:t[`${e}End`],o=t[`${e}Start`];!o||!a||$t._startChild(r,{op:"browser",origin:"auto.browser.browser.metrics",description:n||e,startTimestamp:s+me(o),endTimestamp:s+me(a)})}function HI(r,t,e){$t._startChild(r,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:e+me(t.requestStart),endTimestamp:e+me(t.responseEnd)}),$t._startChild(r,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:e+me(t.responseStart),endTimestamp:e+me(t.responseEnd)})}function Kg(r,t,e,s,n,i){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;let a={};"transferSize"in t&&(a["http.response_transfer_size"]=t.transferSize),"encodedBodySize"in t&&(a["http.response_content_length"]=t.encodedBodySize),"decodedBodySize"in t&&(a["http.decoded_response_content_length"]=t.decodedBodySize),"renderBlockingStatus"in t&&(a["resource.render_blocking_status"]=t.renderBlockingStatus);let o=i+s,c=o+n;$t._startChild(r,{description:e,endTimestamp:c,op:t.initiatorType?`resource.${t.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:o,data:a})}function VI(r){let t=Ns.WINDOW.navigator;if(!t)return;let e=t.connection;e&&(e.effectiveType&&r.setTag("effectiveConnectionType",e.effectiveType),e.type&&r.setTag("connectionType",e.type),$t.isMeasurementValue(e.rtt)&&(oe["connection.rtt"]={value:e.rtt,unit:"millisecond"})),$t.isMeasurementValue(t.deviceMemory)&&r.setTag("deviceMemory",`${t.deviceMemory} GB`),$t.isMeasurementValue(t.hardwareConcurrency)&&r.setTag("hardwareConcurrency",String(t.hardwareConcurrency))}function YI(r){Et&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&fe.logger.log("[Measurements] Adding LCP Data"),Et.element&&r.setTag("lcp.element",fe.htmlTreeAsString(Et.element)),Et.id&&r.setTag("lcp.id",Et.id),Et.url&&r.setTag("lcp.url",Et.url.trim().slice(0,200)),r.setTag("lcp.size",Et.size)),ti&&ti.sources&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&fe.logger.log("[Measurements] Adding CLS Data"),ti.sources.forEach((t,e)=>r.setTag(`cls.source.${e+1}`,fe.htmlTreeAsString(t.node))))}cs._addMeasureSpans=Jg;cs._addResourceSpans=Kg;cs.addPerformanceEntries=GI;cs.startTrackingInteractions=BI;cs.startTrackingLongTasks=FI;cs.startTrackingWebVitals=RI});var Np=_(Pt=>{Object.defineProperty(Pt,"__esModule",{value:!0});var wr=ie(),Ne=L(),no=["localhost",/^\/(?!\/)/],Ip={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:no,tracePropagationTargets:no};function WI(r){let{traceFetch:t,traceXHR:e,tracePropagationTargets:s,tracingOrigins:n,shouldCreateSpanForRequest:i,enableHTTPTimings:a}={traceFetch:Ip.traceFetch,traceXHR:Ip.traceXHR,...r},o=typeof i=="function"?i:u=>!0,c=u=>tb(u,s||n),l={};t&&Ne.addInstrumentationHandler("fetch",u=>{let p=sb(u,o,c,l);a&&p&&Qg(p)}),e&&Ne.addInstrumentationHandler("xhr",u=>{let p=nb(u,o,c,l);a&&p&&Qg(p)})}function zI(r){return r.entryType==="resource"&&"initiatorType"in r&&typeof r.nextHopProtocol=="string"&&(r.initiatorType==="fetch"||r.initiatorType==="xmlhttprequest")}function Qg(r){let t=r.data.url,e=new PerformanceObserver(s=>{s.getEntries().forEach(i=>{zI(i)&&i.name.endsWith(t)&&(JI(i).forEach(o=>r.setData(...o)),e.disconnect())})});e.observe({entryTypes:["resource"]})}function eb(r){let t="unknown",e="unknown",s="";for(let n of r){if(n==="/"){[t,e]=r.split("/");break}if(!isNaN(Number(n))){t=s==="h"?"http":s,e=r.split(s)[1];break}s+=n}return s===r&&(t=s),{name:t,version:e}}function Tt(r=0){return((Ne.browserPerformanceTimeOrigin||performance.timeOrigin)+r)/1e3}function JI(r){let{name:t,version:e}=eb(r.nextHopProtocol),s=[];return s.push(["network.protocol.version",e],["network.protocol.name",t]),Ne.browserPerformanceTimeOrigin?[...s,["http.request.redirect_start",Tt(r.redirectStart)],["http.request.fetch_start",Tt(r.fetchStart)],["http.request.domain_lookup_start",Tt(r.domainLookupStart)],["http.request.domain_lookup_end",Tt(r.domainLookupEnd)],["http.request.connect_start",Tt(r.connectStart)],["http.request.secure_connection_start",Tt(r.secureConnectionStart)],["http.request.connection_end",Tt(r.connectEnd)],["http.request.request_start",Tt(r.requestStart)],["http.request.response_start",Tt(r.responseStart)],["http.request.response_end",Tt(r.responseEnd)]]:s}function tb(r,t){return Ne.stringMatchesSomePattern(r,t||no)}function sb(r,t,e,s){if(!wr.hasTracingEnabled()||!r.fetchData)return;let n=t(r.fetchData.url);if(r.endTimestamp&&n){let h=r.fetchData.__span;if(!h)return;let d=s[h];if(d){if(r.response){d.setHttpStatus(r.response.status);let f=r.response&&r.response.headers&&r.response.headers.get("content-length"),m=parseInt(f);m>0&&d.setData("http.response_content_length",m)}else r.error&&d.setStatus("internal_error");d.finish(),delete s[h]}return}let i=wr.getCurrentHub(),a=i.getScope(),o=i.getClient(),c=a.getSpan(),{method:l,url:u}=r.fetchData,p=n&&c?c.startChild({data:{url:u,type:"fetch","http.method":l},description:`${l} ${u}`,op:"http.client",origin:"auto.http.browser"}):void 0;if(p&&(r.fetchData.__span=p.spanId,s[p.spanId]=p),e(r.fetchData.url)&&o){let h=r.args[0];r.args[1]=r.args[1]||{};let d=r.args[1];d.headers=rb(h,o,a,d,p)}return p}function rb(r,t,e,s,n){let i=n||e.getSpan(),a=i&&i.transaction,{traceId:o,sampled:c,dsc:l}=e.getPropagationContext(),u=i?i.toTraceparent():Ne.generateSentryTraceHeader(o,void 0,c),p=a?a.getDynamicSamplingContext():l||wr.getDynamicSamplingContextFromClient(o,t,e),h=Ne.dynamicSamplingContextToSentryBaggageHeader(p),d=typeof Request<"u"&&Ne.isInstanceOf(r,Request)?r.headers:s.headers;if(d)if(typeof Headers<"u"&&Ne.isInstanceOf(d,Headers)){let f=new Headers(d);return f.append("sentry-trace",u),h&&f.append(Ne.BAGGAGE_HEADER_NAME,h),f}else if(Array.isArray(d)){let f=[...d,["sentry-trace",u]];return h&&f.push([Ne.BAGGAGE_HEADER_NAME,h]),f}else{let f="baggage"in d?d.baggage:void 0,m=[];return Array.isArray(f)?m.push(...f):f&&m.push(f),h&&m.push(h),{...d,"sentry-trace":u,baggage:m.length>0?m.join(","):void 0}}else return{"sentry-trace":u,baggage:h}}function nb(r,t,e,s){let n=r.xhr,i=n&&n[Ne.SENTRY_XHR_DATA_KEY];if(!wr.hasTracingEnabled()||n&&n.__sentry_own_request__||!n||!i)return;let a=t(i.url);if(r.endTimestamp&&a){let p=n.__sentry_xhr_span_id__;if(!p)return;let h=s[p];h&&(h.setHttpStatus(i.status_code),h.finish(),delete s[p]);return}let o=wr.getCurrentHub(),c=o.getScope(),l=c.getSpan(),u=a&&l?l.startChild({data:{...i.data,type:"xhr","http.method":i.method,url:i.url},description:`${i.method} ${i.url}`,op:"http.client",origin:"auto.http.browser"}):void 0;if(u&&(n.__sentry_xhr_span_id__=u.spanId,s[n.__sentry_xhr_span_id__]=u),n.setRequestHeader&&e(i.url))if(u){let p=u&&u.transaction,h=p&&p.getDynamicSamplingContext(),d=Ne.dynamicSamplingContextToSentryBaggageHeader(h);Zg(n,u.toTraceparent(),d)}else{let p=o.getClient(),{traceId:h,sampled:d,dsc:f}=c.getPropagationContext(),m=Ne.generateSentryTraceHeader(h,void 0,d),y=f||(p?wr.getDynamicSamplingContextFromClient(h,p,c):void 0),b=Ne.dynamicSamplingContextToSentryBaggageHeader(y);Zg(n,m,b)}return u}function Zg(r,t,e){try{r.setRequestHeader("sentry-trace",t),e&&r.setRequestHeader(Ne.BAGGAGE_HEADER_NAME,e)}catch{}}Pt.DEFAULT_TRACE_PROPAGATION_TARGETS=no;Pt.addTracingHeadersToFetchRequest=rb;Pt.defaultRequestInstrumentationOptions=Ip;Pt.extractNetworkProtocol=eb;Pt.fetchCallback=sb;Pt.instrumentOutgoingRequests=WI;Pt.shouldAttachHeaders=tb;Pt.xhrCallback=nb});var ib=_(kp=>{Object.defineProperty(kp,"__esModule",{value:!0});var si=L(),ri=Gt();function KI(r,t=!0,e=!0){if(!ri.WINDOW||!ri.WINDOW.location){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&si.logger.warn("Could not initialize routing instrumentation due to invalid location");return}let s=ri.WINDOW.location.href,n;t&&(n=r({name:ri.WINDOW.location.pathname,startTimestamp:si.browserPerformanceTimeOrigin?si.browserPerformanceTimeOrigin/1e3:void 0,op:"pageload",origin:"auto.pageload.browser",metadata:{source:"url"}})),e&&si.addInstrumentationHandler("history",({to:i,from:a})=>{if(a===void 0&&s&&s.indexOf(i)!==-1){s=void 0;return}a!==i&&(s=void 0,n&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&si.logger.log(`[Tracing] Finishing current transaction with op: ${n.op}`),n.finish()),n=r({name:ri.WINDOW.location.pathname,op:"navigation",origin:"auto.navigation.browser",metadata:{source:"url"}}))})}kp.instrumentRoutingWithDefaults=KI});var lb=_(ii=>{Object.defineProperty(ii,"__esModule",{value:!0});var ni=ie(),Ht=L(),XI=Fg(),io=Xg(),ob=Np(),QI=ib(),ab=Gt(),cb="BrowserTracing",ZI={...ni.TRACING_DEFAULTS,markBackgroundTransactions:!0,routingInstrumentation:QI.instrumentRoutingWithDefaults,startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,_experiments:{},...ob.defaultRequestInstrumentationOptions},Dp=class{constructor(t){this.name=cb,this._hasSetTracePropagationTargets=!1,ni.addTracingExtensions(),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&(this._hasSetTracePropagationTargets=!!(t&&(t.tracePropagationTargets||t.tracingOrigins))),this.options={...ZI,...t},this.options._experiments.enableLongTask!==void 0&&(this.options.enableLongTask=this.options._experiments.enableLongTask),t&&!t.tracePropagationTargets&&t.tracingOrigins&&(this.options.tracePropagationTargets=t.tracingOrigins),this._collectWebVitals=io.startTrackingWebVitals(),this.options.enableLongTask&&io.startTrackingLongTasks(),this.options._experiments.enableInteractions&&io.startTrackingInteractions()}setupOnce(t,e){this._getCurrentHub=e;let n=e().getClient(),i=n&&n.getOptions(),{routingInstrumentation:a,startTransactionOnLocationChange:o,startTransactionOnPageLoad:c,markBackgroundTransactions:l,traceFetch:u,traceXHR:p,shouldCreateSpanForRequest:h,enableHTTPTimings:d,_experiments:f}=this.options,m=i&&i.tracePropagationTargets,y=m||this.options.tracePropagationTargets;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this._hasSetTracePropagationTargets&&m&&Ht.logger.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used."),a(b=>{let x=this._createRouteTransaction(b);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(x,b,e),x},c,o),l&&XI.registerBackgroundTabDetection(),f.enableInteractions&&this._registerInteractionListener(),ob.instrumentOutgoingRequests({traceFetch:u,traceXHR:p,tracePropagationTargets:y,shouldCreateSpanForRequest:h,enableHTTPTimings:d})}_createRouteTransaction(t){if(!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ht.logger.warn(`[Tracing] Did not create ${t.op} transaction because _getCurrentHub is invalid.`);return}let e=this._getCurrentHub(),{beforeNavigate:s,idleTimeout:n,finalTimeout:i,heartbeatInterval:a}=this.options,o=t.op==="pageload",c=o?Op("sentry-trace"):"",l=o?Op("baggage"):"",{traceparentData:u,dynamicSamplingContext:p,propagationContext:h}=Ht.tracingContextFromHeaders(c,l),d={...t,...u,metadata:{...t.metadata,dynamicSamplingContext:u&&!p?{}:p},trimEnd:!0},f=typeof s=="function"?s(d):d,m=f===void 0?{...d,sampled:!1}:f;m.metadata=m.name!==d.name?{...m.metadata,source:"custom"}:m.metadata,this._latestRouteName=m.name,this._latestRouteSource=m.metadata&&m.metadata.source,m.sampled===!1&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ht.logger.log(`[Tracing] Will not send ${m.op} transaction because of beforeNavigate.`),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ht.logger.log(`[Tracing] Starting ${m.op} transaction on scope`);let{location:y}=ab.WINDOW,b=ni.startIdleTransaction(e,m,n,i,!0,{location:y},a),x=e.getScope();return o&&u?x.setPropagationContext(h):x.setPropagationContext({traceId:b.traceId,spanId:b.spanId,parentSpanId:b.parentSpanId,sampled:b.sampled}),b.registerBeforeFinishCallback(N=>{this._collectWebVitals(),io.addPerformanceEntries(N)}),b}_registerInteractionListener(){let t,e=()=>{let{idleTimeout:s,finalTimeout:n,heartbeatInterval:i}=this.options,a="ui.action.click",o=ni.getActiveTransaction();if(o&&o.op&&["navigation","pageload"].includes(o.op)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ht.logger.warn(`[Tracing] Did not create ${a} transaction because a pageload or navigation transaction is in progress.`);return}if(t&&(t.setFinishReason("interactionInterrupted"),t.finish(),t=void 0),!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ht.logger.warn(`[Tracing] Did not create ${a} transaction because _getCurrentHub is invalid.`);return}if(!this._latestRouteName){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ht.logger.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}let c=this._getCurrentHub(),{location:l}=ab.WINDOW,u={name:this._latestRouteName,op:a,trimEnd:!0,metadata:{source:this._latestRouteSource||"url"}};t=ni.startIdleTransaction(c,u,s,n,!0,{location:l},i)};["click"].forEach(s=>{addEventListener(s,e,{once:!1,capture:!0})})}};function Op(r){let t=Ht.getDomElement(`meta[name=${r}]`);return t?t.getAttribute("content"):void 0}ii.BROWSER_TRACING_INTEGRATION_ID=cb;ii.BrowserTracing=Dp;ii.getMetaContent=Op});var pb=_((Mp,ai)=>{Object.defineProperty(Mp,"__esModule",{value:!0});var ub=ie(),Ir=L();function e1(){let r=ub.getMainCarrier();if(!r.__SENTRY__)return;let t={mongodb(){let s=Ir.dynamicRequire(ai,"./node/integrations/mongo");return new s.Mongo},mongoose(){let s=Ir.dynamicRequire(ai,"./node/integrations/mongo");return new s.Mongo},mysql(){let s=Ir.dynamicRequire(ai,"./node/integrations/mysql");return new s.Mysql},pg(){let s=Ir.dynamicRequire(ai,"./node/integrations/postgres");return new s.Postgres}},e=Object.keys(t).filter(s=>!!Ir.loadModule(s)).map(s=>{try{return t[s]()}catch{return}}).filter(s=>s);e.length>0&&(r.__SENTRY__.integrations=[...r.__SENTRY__.integrations||[],...e])}function t1(){ub.addTracingExtensions(),Ir.isNodeEnv()&&e1()}Mp.addExtensionMethods=t1});var Rp=_(ee=>{Object.defineProperty(ee,"__esModule",{value:!0});var Vt=ie(),hb=L(),s1=vg(),r1=Ag(),n1=Cg(),i1=wg(),a1=kg(),o1=Dg(),c1=Mg(),l1=Lg(),db=lb(),Lp=Np(),u1=pb();ee.IdleTransaction=Vt.IdleTransaction;ee.Span=Vt.Span;ee.SpanStatus=Vt.SpanStatus;ee.Transaction=Vt.Transaction;ee.extractTraceparentData=Vt.extractTraceparentData;ee.getActiveTransaction=Vt.getActiveTransaction;ee.hasTracingEnabled=Vt.hasTracingEnabled;ee.spanStatusfromHttpCode=Vt.spanStatusfromHttpCode;ee.startIdleTransaction=Vt.startIdleTransaction;ee.TRACEPARENT_REGEXP=hb.TRACEPARENT_REGEXP;ee.stripUrlQueryAndFragment=hb.stripUrlQueryAndFragment;ee.Express=s1.Express;ee.Postgres=r1.Postgres;ee.Mysql=n1.Mysql;ee.Mongo=i1.Mongo;ee.Prisma=a1.Prisma;ee.GraphQL=o1.GraphQL;ee.Apollo=c1.Apollo;ee.lazyLoadedNodePerformanceMonitoringIntegrations=l1.lazyLoadedNodePerformanceMonitoringIntegrations;ee.BROWSER_TRACING_INTEGRATION_ID=db.BROWSER_TRACING_INTEGRATION_ID;ee.BrowserTracing=db.BrowserTracing;ee.addTracingHeadersToFetchRequest=Lp.addTracingHeadersToFetchRequest;ee.defaultRequestInstrumentationOptions=Lp.defaultRequestInstrumentationOptions;ee.instrumentOutgoingRequests=Lp.instrumentOutgoingRequests;ee.addExtensionMethods=u1.addExtensionMethods});var fb=_(Fp=>{Object.defineProperty(Fp,"__esModule",{value:!0});var p1=Rp(),h1=L();function d1(){let r=p1.lazyLoadedNodePerformanceMonitoringIntegrations.map(t=>{try{return t()}catch{return}}).filter(t=>!!t);return r.length===0&&h1.logger.warn("Performance monitoring integrations could not be automatically loaded."),r.filter(t=>!!t.loadDependency())}Fp.autoDiscoverNodePerformanceMonitoringIntegrations=d1});var jp=_(kr=>{Object.defineProperty(kr,"__esModule",{value:!0});var f1=ie(),Nr=L();function Bp(r,t){return r(t.stack||"",1)}function mb(r,t){let e={type:t.name||t.constructor.name,value:t.message},s=Bp(r,t);return s.length&&(e.stacktrace={frames:s}),e}function m1(r,t,e){let s=t,i=e&&e.data&&e.data.mechanism||{handled:!0,type:"generic"};if(!Nr.isError(t)){if(Nr.isPlainObject(t)){let o=`Non-Error exception captured with keys: ${Nr.extractExceptionKeysForMessage(t)}`,c=f1.getCurrentHub(),l=c.getClient(),u=l&&l.getOptions().normalizeDepth;c.configureScope(p=>{p.setExtra("__serialized__",Nr.normalizeToSize(t,u))}),s=e&&e.syntheticException||new Error(o),s.message=o}else s=e&&e.syntheticException||new Error(t),s.message=t;i.synthetic=!0}let a={exception:{values:[mb(r,s)]}};return Nr.addExceptionTypeValue(a,void 0,void 0),Nr.addExceptionMechanism(a,i),{...a,event_id:e&&e.event_id}}function y1(r,t,e="info",s,n){let i={event_id:s&&s.event_id,level:e,message:t};if(n&&s&&s.syntheticException){let a=Bp(r,s.syntheticException);a.length&&(i.exception={values:[{value:t,stacktrace:{frames:a}}]})}return i}kr.eventFromMessage=y1;kr.eventFromUnknownInput=m1;kr.exceptionFromError=mb;kr.parseStackFrames=Bp});var Gp=_(qp=>{var{_optionalChain:ao}=ue();Object.defineProperty(qp,"__esModule",{value:!0});var ks=ie(),Ds=L(),g1=U("os"),b1=U("util"),yb=jp(),Up=class extends ks.BaseClient{constructor(t){t._metadata=t._metadata||{},t._metadata.sdk=t._metadata.sdk||{name:"sentry.javascript.node",packages:[{name:"npm:@sentry/node",version:ks.SDK_VERSION}],version:ks.SDK_VERSION},t.transportOptions={textEncoder:new b1.TextEncoder,...t.transportOptions},ks.addTracingExtensions(),super(t)}captureException(t,e,s){if(this._options.autoSessionTracking&&this._sessionFlusher&&s){let n=s.getRequestSession();n&&n.status==="ok"&&(n.status="errored")}return super.captureException(t,e,s)}captureEvent(t,e,s){if(this._options.autoSessionTracking&&this._sessionFlusher&&s&&(t.type||"exception")==="exception"&&t.exception&&t.exception.values&&t.exception.values.length>0){let a=s.getRequestSession();a&&a.status==="ok"&&(a.status="errored")}return super.captureEvent(t,e,s)}close(t){return ao([this,"access",e=>e._sessionFlusher,"optionalAccess",e=>e.close,"call",e=>e()]),super.close(t)}initSessionFlusher(){let{release:t,environment:e}=this._options;t?this._sessionFlusher=new ks.SessionFlusher(this,{release:t,environment:e}):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ds.logger.warn("Cannot initialise an instance of SessionFlusher if no release is provided!")}eventFromException(t,e){return Ds.resolvedSyncPromise(yb.eventFromUnknownInput(this._options.stackParser,t,e))}eventFromMessage(t,e="info",s){return Ds.resolvedSyncPromise(yb.eventFromMessage(this._options.stackParser,t,e,s,this._options.attachStacktrace))}captureCheckIn(t,e,s){let n=t.status!=="in_progress"&&t.checkInId?t.checkInId:Ds.uuid4();if(!this._isEnabled())return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ds.logger.warn("SDK not enabled, will not capture checkin."),n;let i=this.getOptions(),{release:a,environment:o,tunnel:c}=i,l={check_in_id:n,monitor_slug:t.monitorSlug,status:t.status,release:a,environment:o};t.status!=="in_progress"&&(l.duration=t.duration),e&&(l.monitor_config={schedule:e.schedule,checkin_margin:e.checkinMargin,max_runtime:e.maxRuntime,timezone:e.timezone});let[u,p]=this._getTraceInfoFromScope(s);p&&(l.contexts={trace:p});let h=ks.createCheckInEnvelope(l,u,this.getSdkMetadata(),c,this.getDsn());return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ds.logger.info("Sending checkin:",t.monitorSlug,t.status),this._sendEnvelope(h),n}_prepareEvent(t,e,s){return t.platform=t.platform||"node",t.contexts={...t.contexts,runtime:ao([t,"access",n=>n.contexts,"optionalAccess",n=>n.runtime])||{name:"node",version:global.process.version}},t.server_name=t.server_name||this.getOptions().serverName||global.process.env.SENTRY_NAME||g1.hostname(),super._prepareEvent(t,e,s)}_captureRequestSession(){this._sessionFlusher?this._sessionFlusher.incrementSessionStatusCount():(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ds.logger.warn("Discarded request mode session because autoSessionTracking option was disabled")}_getTraceInfoFromScope(t){if(!t)return[void 0,void 0];let e=t.getSpan();if(e)return[ao([e,"optionalAccess",c=>c.transaction,"optionalAccess",c=>c.getDynamicSamplingContext,"call",c=>c()]),ao([e,"optionalAccess",c=>c.getTraceContext,"call",c=>c()])];let{traceId:s,spanId:n,parentSpanId:i,dsc:a}=t.getPropagationContext(),o={trace_id:s,span_id:n,parent_span_id:i};return a?[a,o]:[ks.getDynamicSamplingContextFromClient(s,this,t),o]}};qp.NodeClient=Up});var bb=_((VL,gb)=>{var Dr=1e3,Or=Dr*60,Mr=Or*60,Os=Mr*24,S1=Os*7,_1=Os*365.25;gb.exports=function(r,t){t=t||{};var e=typeof r;if(e==="string"&&r.length>0)return x1(r);if(e==="number"&&isFinite(r))return t.long?T1(r):E1(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function x1(r){if(r=String(r),!(r.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(t){var e=parseFloat(t[1]),s=(t[2]||"ms").toLowerCase();switch(s){case"years":case"year":case"yrs":case"yr":case"y":return e*_1;case"weeks":case"week":case"w":return e*S1;case"days":case"day":case"d":return e*Os;case"hours":case"hour":case"hrs":case"hr":case"h":return e*Mr;case"minutes":case"minute":case"mins":case"min":case"m":return e*Or;case"seconds":case"second":case"secs":case"sec":case"s":return e*Dr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return e;default:return}}}}function E1(r){var t=Math.abs(r);return t>=Os?Math.round(r/Os)+"d":t>=Mr?Math.round(r/Mr)+"h":t>=Or?Math.round(r/Or)+"m":t>=Dr?Math.round(r/Dr)+"s":r+"ms"}function T1(r){var t=Math.abs(r);return t>=Os?oo(r,t,Os,"day"):t>=Mr?oo(r,t,Mr,"hour"):t>=Or?oo(r,t,Or,"minute"):t>=Dr?oo(r,t,Dr,"second"):r+" ms"}function oo(r,t,e,s){var n=t>=e*1.5;return Math.round(r/e)+" "+s+(n?"s":"")}});var $p=_((YL,Sb)=>{function P1(r){e.debug=e,e.default=e,e.coerce=c,e.disable=a,e.enable=n,e.enabled=o,e.humanize=bb(),e.destroy=l,Object.keys(r).forEach(u=>{e[u]=r[u]}),e.names=[],e.skips=[],e.formatters={};function t(u){let p=0;for(let h=0;h<u.length;h++)p=(p<<5)-p+u.charCodeAt(h),p|=0;return e.colors[Math.abs(p)%e.colors.length]}e.selectColor=t;function e(u){let p,h=null,d,f;function m(...y){if(!m.enabled)return;let b=m,x=Number(new Date),N=x-(p||x);b.diff=N,b.prev=p,b.curr=x,p=x,y[0]=e.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let T=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(A,k)=>{if(A==="%%")return"%";T++;let H=e.formatters[k];if(typeof H=="function"){let xe=y[T];A=H.call(b,xe),y.splice(T,1),T--}return A}),e.formatArgs.call(b,y),(b.log||e.log).apply(b,y)}return m.namespace=u,m.useColors=e.useColors(),m.color=e.selectColor(u),m.extend=s,m.destroy=e.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(d!==e.namespaces&&(d=e.namespaces,f=e.enabled(u)),f),set:y=>{h=y}}),typeof e.init=="function"&&e.init(m),m}function s(u,p){let h=e(this.namespace+(typeof p>"u"?":":p)+u);return h.log=this.log,h}function n(u){e.save(u),e.namespaces=u,e.names=[],e.skips=[];let p=(typeof u=="string"?u:"").trim().replace(" ",",").split(",").filter(Boolean);for(let h of p)h[0]==="-"?e.skips.push(h.slice(1)):e.names.push(h)}function i(u,p){let h=0,d=0,f=-1,m=0;for(;h<u.length;)if(d<p.length&&(p[d]===u[h]||p[d]==="*"))p[d]==="*"?(f=d,m=h,d++):(h++,d++);else if(f!==-1)d=f+1,m++,h=m;else return!1;for(;d<p.length&&p[d]==="*";)d++;return d===p.length}function a(){let u=[...e.names,...e.skips.map(p=>"-"+p)].join(",");return e.enable(""),u}function o(u){for(let p of e.skips)if(i(u,p))return!1;for(let p of e.names)if(i(u,p))return!0;return!1}function c(u){return u instanceof Error?u.stack||u.message:u}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return e.enable(e.load()),e}Sb.exports=P1});var _b=_(($e,co)=>{$e.formatArgs=A1;$e.save=C1;$e.load=w1;$e.useColors=v1;$e.storage=I1();$e.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();$e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function v1(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let r;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(r=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(r[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function A1(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+co.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;r.splice(1,0,t,"color: inherit");let e=0,s=0;r[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(e++,n==="%c"&&(s=e))}),r.splice(s,0,t)}$e.log=console.debug||console.log||(()=>{});function C1(r){try{r?$e.storage.setItem("debug",r):$e.storage.removeItem("debug")}catch{}}function w1(){let r;try{r=$e.storage.getItem("debug")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function I1(){try{return localStorage}catch{}}co.exports=$p()($e);var{formatters:N1}=co.exports;N1.j=function(r){try{return JSON.stringify(r)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Eb=_((WL,xb)=>{"use strict";xb.exports=(r,t=process.argv)=>{let e=r.startsWith("-")?"":r.length===1?"-":"--",s=t.indexOf(e+r),n=t.indexOf("--");return s!==-1&&(n===-1||s<n)}});var vb=_((zL,Pb)=>{"use strict";var k1=U("os"),Tb=U("tty"),st=Eb(),{env:Se}=process,lo;st("no-color")||st("no-colors")||st("color=false")||st("color=never")?lo=0:(st("color")||st("colors")||st("color=true")||st("color=always"))&&(lo=1);function D1(){if("FORCE_COLOR"in Se)return Se.FORCE_COLOR==="true"?1:Se.FORCE_COLOR==="false"?0:Se.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Se.FORCE_COLOR,10),3)}function O1(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function M1(r,{streamIsTTY:t,sniffFlags:e=!0}={}){let s=D1();s!==void 0&&(lo=s);let n=e?lo:s;if(n===0)return 0;if(e){if(st("color=16m")||st("color=full")||st("color=truecolor"))return 3;if(st("color=256"))return 2}if(r&&!t&&n===void 0)return 0;let i=n||0;if(Se.TERM==="dumb")return i;if(process.platform==="win32"){let a=k1.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in Se)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(a=>a in Se)||Se.CI_NAME==="codeship"?1:i;if("TEAMCITY_VERSION"in Se)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Se.TEAMCITY_VERSION)?1:0;if(Se.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Se){let a=Number.parseInt((Se.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Se.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Se.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Se.TERM)||"COLORTERM"in Se?1:i}function Hp(r,t={}){let e=M1(r,{streamIsTTY:r&&r.isTTY,...t});return O1(e)}Pb.exports={supportsColor:Hp,stdout:Hp({isTTY:Tb.isatty(1)}),stderr:Hp({isTTY:Tb.isatty(2)})}});var Cb=_((_e,po)=>{var L1=U("tty"),uo=U("util");_e.init=G1;_e.log=j1;_e.formatArgs=F1;_e.save=U1;_e.load=q1;_e.useColors=R1;_e.destroy=uo.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");_e.colors=[6,2,3,4,5,1];try{let r=vb();r&&(r.stderr||r).level>=2&&(_e.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}_e.inspectOpts=Object.keys(process.env).filter(r=>/^debug_/i.test(r)).reduce((r,t)=>{let e=t.substring(6).toLowerCase().replace(/_([a-z])/g,(n,i)=>i.toUpperCase()),s=process.env[t];return/^(yes|on|true|enabled)$/i.test(s)?s=!0:/^(no|off|false|disabled)$/i.test(s)?s=!1:s==="null"?s=null:s=Number(s),r[e]=s,r},{});function R1(){return"colors"in _e.inspectOpts?!!_e.inspectOpts.colors:L1.isatty(process.stderr.fd)}function F1(r){let{namespace:t,useColors:e}=this;if(e){let s=this.color,n="\x1B[3"+(s<8?s:"8;5;"+s),i=` ${n};1m${t} \x1B[0m`;r[0]=i+r[0].split(`
|
|
27
|
+
`).join(`
|
|
28
|
+
`+i),r.push(n+"m+"+po.exports.humanize(this.diff)+"\x1B[0m")}else r[0]=B1()+t+" "+r[0]}function B1(){return _e.inspectOpts.hideDate?"":new Date().toISOString()+" "}function j1(...r){return process.stderr.write(uo.formatWithOptions(_e.inspectOpts,...r)+`
|
|
29
|
+
`)}function U1(r){r?process.env.DEBUG=r:delete process.env.DEBUG}function q1(){return process.env.DEBUG}function G1(r){r.inspectOpts={};let t=Object.keys(_e.inspectOpts);for(let e=0;e<t.length;e++)r.inspectOpts[t[e]]=_e.inspectOpts[t[e]]}po.exports=$p()(_e);var{formatters:Ab}=po.exports;Ab.o=function(r){return this.inspectOpts.colors=this.useColors,uo.inspect(r,this.inspectOpts).split(`
|
|
30
|
+
`).map(t=>t.trim()).join(" ")};Ab.O=function(r){return this.inspectOpts.colors=this.useColors,uo.inspect(r,this.inspectOpts)}});var ho=_((JL,Vp)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Vp.exports=_b():Vp.exports=Cb()});var wb=_(Yp=>{"use strict";Object.defineProperty(Yp,"__esModule",{value:!0});function $1(r){return function(t,e){return new Promise((s,n)=>{r.call(this,t,e,(i,a)=>{i?n(i):s(a)})})}}Yp.default=$1});var kb=_((zp,Nb)=>{"use strict";var Ib=zp&&zp.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},H1=U("events"),V1=Ib(ho()),Y1=Ib(wb()),oi=V1.default("agent-base");function W1(r){return!!r&&typeof r.addRequest=="function"}function Wp(){let{stack:r}=new Error;return typeof r!="string"?!1:r.split(`
|
|
31
|
+
`).some(t=>t.indexOf("(https.js:")!==-1||t.indexOf("node:https:")!==-1)}function fo(r,t){return new fo.Agent(r,t)}(function(r){class t extends H1.EventEmitter{constructor(s,n){super();let i=n;typeof s=="function"?this.callback=s:s&&(i=s),this.timeout=null,i&&typeof i.timeout=="number"&&(this.timeout=i.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return typeof this.explicitDefaultPort=="number"?this.explicitDefaultPort:Wp()?443:80}set defaultPort(s){this.explicitDefaultPort=s}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:Wp()?"https:":"http:"}set protocol(s){this.explicitProtocol=s}callback(s,n,i){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(s,n){let i=Object.assign({},n);typeof i.secureEndpoint!="boolean"&&(i.secureEndpoint=Wp()),i.host==null&&(i.host="localhost"),i.port==null&&(i.port=i.secureEndpoint?443:80),i.protocol==null&&(i.protocol=i.secureEndpoint?"https:":"http:"),i.host&&i.path&&delete i.path,delete i.agent,delete i.hostname,delete i._defaultAgent,delete i.defaultPort,delete i.createConnection,s._last=!0,s.shouldKeepAlive=!1;let a=!1,o=null,c=i.timeout||this.timeout,l=d=>{s._hadError||(s.emit("error",d),s._hadError=!0)},u=()=>{o=null,a=!0;let d=new Error(`A "socket" was not created for HTTP request before ${c}ms`);d.code="ETIMEOUT",l(d)},p=d=>{a||(o!==null&&(clearTimeout(o),o=null),l(d))},h=d=>{if(a)return;if(o!=null&&(clearTimeout(o),o=null),W1(d)){oi("Callback returned another Agent instance %o",d.constructor.name),d.addRequest(s,i);return}if(d){d.once("free",()=>{this.freeSocket(d,i)}),s.onSocket(d);return}let f=new Error(`no Duplex stream was returned to agent-base for \`${s.method} ${s.path}\``);l(f)};if(typeof this.callback!="function"){l(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(oi("Converting legacy callback function to promise"),this.promisifiedCallback=Y1.default(this.callback)):this.promisifiedCallback=this.callback),typeof c=="number"&&c>0&&(o=setTimeout(u,c)),"port"in i&&typeof i.port!="number"&&(i.port=Number(i.port));try{oi("Resolving socket for %o request: %o",i.protocol,`${s.method} ${s.path}`),Promise.resolve(this.promisifiedCallback(s,i)).then(h,p)}catch(d){Promise.reject(d).catch(p)}}freeSocket(s,n){oi("Freeing socket %o %o",s.constructor.name,n),s.destroy()}destroy(){oi("Destroying agent %o",this.constructor.name)}}r.Agent=t,r.prototype=r.Agent.prototype})(fo||(fo={}));Nb.exports=fo});var Db=_(li=>{"use strict";var z1=li&&li.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(li,"__esModule",{value:!0});var J1=z1(ho()),ci=J1.default("https-proxy-agent:parse-proxy-response");function K1(r){return new Promise((t,e)=>{let s=0,n=[];function i(){let p=r.read();p?u(p):r.once("readable",i)}function a(){r.removeListener("end",c),r.removeListener("error",l),r.removeListener("close",o),r.removeListener("readable",i)}function o(p){ci("onclose had error %o",p)}function c(){ci("onend")}function l(p){a(),ci("onerror %o",p),e(p)}function u(p){n.push(p),s+=p.length;let h=Buffer.concat(n,s);if(h.indexOf(`\r
|
|
32
|
+
\r
|
|
33
|
+
`)===-1){ci("have not received end of HTTP headers yet..."),i();return}let f=h.toString("ascii",0,h.indexOf(`\r
|
|
34
|
+
`)),m=+f.split(" ")[1];ci("got proxy server response: %o",f),t({statusCode:m,buffered:h})}r.on("error",l),r.on("close",o),r.on("end",c),i()})}li.default=K1});var Lb=_(Ms=>{"use strict";var X1=Ms&&Ms.__awaiter||function(r,t,e,s){function n(i){return i instanceof e?i:new e(function(a){a(i)})}return new(e||(e=Promise))(function(i,a){function o(u){try{l(s.next(u))}catch(p){a(p)}}function c(u){try{l(s.throw(u))}catch(p){a(p)}}function l(u){u.done?i(u.value):n(u.value).then(o,c)}l((s=s.apply(r,t||[])).next())})},Lr=Ms&&Ms.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ms,"__esModule",{value:!0});var Ob=Lr(U("net")),Mb=Lr(U("tls")),Q1=Lr(U("url")),Z1=Lr(U("assert")),eN=Lr(ho()),tN=kb(),sN=Lr(Db()),ui=eN.default("https-proxy-agent:agent"),Jp=class extends tN.Agent{constructor(t){let e;if(typeof t=="string"?e=Q1.default.parse(t):e=t,!e)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");ui("creating new HttpsProxyAgent instance: %o",e),super(e);let s=Object.assign({},e);this.secureProxy=e.secureProxy||iN(s.protocol),s.host=s.hostname||s.host,typeof s.port=="string"&&(s.port=parseInt(s.port,10)),!s.port&&s.host&&(s.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in s)&&(s.ALPNProtocols=["http 1.1"]),s.host&&s.path&&(delete s.path,delete s.pathname),this.proxy=s}callback(t,e){return X1(this,void 0,void 0,function*(){let{proxy:s,secureProxy:n}=this,i;n?(ui("Creating `tls.Socket`: %o",s),i=Mb.default.connect(s)):(ui("Creating `net.Socket`: %o",s),i=Ob.default.connect(s));let a=Object.assign({},s.headers),c=`CONNECT ${`${e.host}:${e.port}`} HTTP/1.1\r
|
|
35
|
+
`;s.auth&&(a["Proxy-Authorization"]=`Basic ${Buffer.from(s.auth).toString("base64")}`);let{host:l,port:u,secureEndpoint:p}=e;nN(u,p)||(l+=`:${u}`),a.Host=l,a.Connection="close";for(let y of Object.keys(a))c+=`${y}: ${a[y]}\r
|
|
36
|
+
`;let h=sN.default(i);i.write(`${c}\r
|
|
37
|
+
`);let{statusCode:d,buffered:f}=yield h;if(d===200){if(t.once("socket",rN),e.secureEndpoint){ui("Upgrading socket connection to TLS");let y=e.servername||e.host;return Mb.default.connect(Object.assign(Object.assign({},aN(e,"host","hostname","path","port")),{socket:i,servername:y}))}return i}i.destroy();let m=new Ob.default.Socket({writable:!1});return m.readable=!0,t.once("socket",y=>{ui("replaying proxy buffer for failed request"),Z1.default(y.listenerCount("data")>0),y.push(f),y.push(null)}),m})}};Ms.default=Jp;function rN(r){r.resume()}function nN(r,t){return!!(!t&&r===80||t&&r===443)}function iN(r){return typeof r=="string"?/^https:?$/i.test(r):!1}function aN(r,...t){let e={},s;for(s in r)t.includes(s)||(e[s]=r[s]);return e}});var Fb=_((Qp,Rb)=>{"use strict";var oN=Qp&&Qp.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},Kp=oN(Lb());function Xp(r){return new Kp.default(r)}(function(r){r.HttpsProxyAgent=Kp.default,r.prototype=Kp.default.prototype})(Xp||(Xp={}));Rb.exports=Xp});var th=_(eh=>{var{_nullishCoalesce:Zp}=ue();Object.defineProperty(eh,"__esModule",{value:!0});var Bb=ie(),cN=U("http"),lN=U("https"),uN=Fb(),pN=U("stream"),jb=U("url"),hN=U("zlib"),dN=1024*32;function fN(r){return new pN.Readable({read(){this.push(r),this.push(null)}})}function mN(r){let t;try{t=new jb.URL(r.url)}catch{return console.warn("[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used."),Bb.createTransport(r,()=>Promise.resolve({}))}let e=t.protocol==="https:",s=yN(t,r.proxy||(e?process.env.https_proxy:void 0)||process.env.http_proxy),n=e?lN:cN,i=r.keepAlive===void 0?!1:r.keepAlive,a=s?new uN.HttpsProxyAgent(s):new n.Agent({keepAlive:i,maxSockets:30,timeout:2e3}),o=gN(r,Zp(r.httpModule,()=>n),a);return Bb.createTransport(r,o)}function yN(r,t){let{no_proxy:e}=process.env;if(!(e&&e.split(",").some(n=>r.host.endsWith(n)||r.hostname.endsWith(n))))return t}function gN(r,t,e){let{hostname:s,pathname:n,port:i,protocol:a,search:o}=new jb.URL(r.url);return function(l){return new Promise((u,p)=>{let h=fN(l.body),d={...r.headers};l.body.length>dN&&(d["content-encoding"]="gzip",h=h.pipe(hN.createGzip()));let f=t.request({method:"POST",agent:e,headers:d,hostname:s,path:`${n}${o}`,port:i,protocol:a,ca:r.caCerts},m=>{m.on("data",()=>{}),m.on("end",()=>{}),m.setEncoding("utf8");let y=Zp(m.headers["retry-after"],()=>null),b=Zp(m.headers["x-sentry-rate-limits"],()=>null);u({statusCode:m.statusCode,headers:{"retry-after":y,"x-sentry-rate-limits":Array.isArray(b)?b[0]:b}})});f.on("error",p),h.pipe(f)})}}eh.makeNodeTransport=mN});var Rr=_(sh=>{Object.defineProperty(sh,"__esModule",{value:!0});var bN=L(),SN=bN.parseSemver(process.versions.node);sh.NODE_VERSION=SN});var Gb=_(rh=>{var{_optionalChain:_N}=ue();Object.defineProperty(rh,"__esModule",{value:!0});var Ls=ie(),Ub=U("domain");function qb(){return Ub.active}function xN(){let r=qb();if(r)return Ls.ensureHubOnCarrier(r),Ls.getHubFromCarrier(r)}function EN(r){let t={};return Ls.ensureHubOnCarrier(t,r),Ls.getHubFromCarrier(t)}function TN(r,t){let e=qb();if(e&&_N([t,"optionalAccess",a=>a.reuseExisting]))return r();let s=Ub.create(),n=e?Ls.getHubFromCarrier(e):void 0,i=EN(n);return Ls.setHubOnCarrier(s,i),s.bind(()=>r())()}function PN(){Ls.setAsyncContextStrategy({getCurrentHub:xN,runWithAsyncContext:TN})}rh.setDomainAsyncContextStrategy=PN});var $b=_(ih=>{var{_optionalChain:vN}=ue();Object.defineProperty(ih,"__esModule",{value:!0});var nh=ie(),AN=U("async_hooks"),mo;function CN(){mo||(mo=new AN.AsyncLocalStorage);function r(){return mo.getStore()}function t(s){let n={};return nh.ensureHubOnCarrier(n,s),nh.getHubFromCarrier(n)}function e(s,n){let i=r();if(i&&vN([n,"optionalAccess",o=>o.reuseExisting]))return s();let a=t(i);return mo.run(a,()=>s())}nh.setAsyncContextStrategy({getCurrentHub:r,runWithAsyncContext:e})}ih.setHooksAsyncContextStrategy=CN});var Vb=_(ah=>{Object.defineProperty(ah,"__esModule",{value:!0});var Hb=Rr(),wN=Gb(),IN=$b();function NN(){Hb.NODE_VERSION.major&&Hb.NODE_VERSION.major>=14?IN.setHooksAsyncContextStrategy():wN.setDomainAsyncContextStrategy()}ah.setNodeAsyncContextStrategy=NN});var ch=_(oh=>{Object.defineProperty(oh,"__esModule",{value:!0});var kN=ie(),Yb=L(),DN=U("util"),yo=class r{constructor(){r.prototype.__init.call(this)}static __initStatic(){this.id="Console"}__init(){this.name=r.id}setupOnce(){Yb.addInstrumentationHandler("console",({args:t,level:e})=>{let s=kN.getCurrentHub();s.getIntegration(r)&&s.addBreadcrumb({category:"console",level:Yb.severityLevelFromString(e),message:DN.format.apply(void 0,t)},{input:[...t],level:e})})}};yo.__initStatic();oh.Console=yo});var pi=_(go=>{(function(r,t){let e=typeof go=="object"?go:typeof r=="object"?r:{};t(e),typeof define=="function"&&define.amd&&define("lru",e)})(go,function(r){let t=Symbol("newer"),e=Symbol("older");function s(c,l){typeof c!="number"&&(l=c,c=0),this.size=0,this.limit=c,this.oldest=this.newest=void 0,this._keymap=new Map,l&&(this.assign(l),c<1&&(this.limit=this.size))}r.LRUMap=s;function n(c,l){this.key=c,this.value=l,this[t]=void 0,this[e]=void 0}s.prototype._markEntryAsUsed=function(c){c!==this.newest&&(c[t]&&(c===this.oldest&&(this.oldest=c[t]),c[t][e]=c[e]),c[e]&&(c[e][t]=c[t]),c[t]=void 0,c[e]=this.newest,this.newest&&(this.newest[t]=c),this.newest=c)},s.prototype.assign=function(c){let l,u=this.limit||Number.MAX_VALUE;this._keymap.clear();let p=c[Symbol.iterator]();for(let h=p.next();!h.done;h=p.next()){let d=new n(h.value[0],h.value[1]);if(this._keymap.set(d.key,d),l?(l[t]=d,d[e]=l):this.oldest=d,l=d,u--==0)throw new Error("overflow")}this.newest=l,this.size=this._keymap.size},s.prototype.get=function(c){var l=this._keymap.get(c);if(l)return this._markEntryAsUsed(l),l.value},s.prototype.set=function(c,l){var u=this._keymap.get(c);return u?(u.value=l,this._markEntryAsUsed(u),this):(this._keymap.set(c,u=new n(c,l)),this.newest?(this.newest[t]=u,u[e]=this.newest):this.oldest=u,this.newest=u,++this.size,this.size>this.limit&&this.shift(),this)},s.prototype.shift=function(){var c=this.oldest;if(c)return this.oldest[t]?(this.oldest=this.oldest[t],this.oldest[e]=void 0):(this.oldest=void 0,this.newest=void 0),c[t]=c[e]=void 0,this._keymap.delete(c.key),--this.size,[c.key,c.value]},s.prototype.find=function(c){let l=this._keymap.get(c);return l?l.value:void 0},s.prototype.has=function(c){return this._keymap.has(c)},s.prototype.delete=function(c){var l=this._keymap.get(c);if(l)return this._keymap.delete(l.key),l[t]&&l[e]?(l[e][t]=l[t],l[t][e]=l[e]):l[t]?(l[t][e]=void 0,this.oldest=l[t]):l[e]?(l[e][t]=void 0,this.newest=l[e]):this.oldest=this.newest=void 0,this.size--,l.value},s.prototype.clear=function(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()};function i(c){this.entry=c}i.prototype[Symbol.iterator]=function(){return this},i.prototype.next=function(){let c=this.entry;return c?(this.entry=c[t],{done:!1,value:[c.key,c.value]}):{done:!0,value:void 0}};function a(c){this.entry=c}a.prototype[Symbol.iterator]=function(){return this},a.prototype.next=function(){let c=this.entry;return c?(this.entry=c[t],{done:!1,value:c.key}):{done:!0,value:void 0}};function o(c){this.entry=c}o.prototype[Symbol.iterator]=function(){return this},o.prototype.next=function(){let c=this.entry;return c?(this.entry=c[t],{done:!1,value:c.value}):{done:!0,value:void 0}},s.prototype.keys=function(){return new a(this.oldest)},s.prototype.values=function(){return new o(this.oldest)},s.prototype.entries=function(){return this},s.prototype[Symbol.iterator]=function(){return new i(this.oldest)},s.prototype.forEach=function(c,l){typeof l!="object"&&(l=this);let u=this.oldest;for(;u;)c.call(l,u.value,u.key,this),u=u[t]},s.prototype.toJSON=function(){for(var c=new Array(this.size),l=0,u=this.oldest;u;)c[l++]={key:u.key,value:u.value},u=u[t];return c},s.prototype.toString=function(){for(var c="",l=this.oldest;l;)c+=String(l.key)+":"+l.value,l=l[t],l&&(c+=" < ");return c}})});var uh=_(ls=>{var{_optionalChain:ht}=ue();Object.defineProperty(ls,"__esModule",{value:!0});var ON=ie(),Wb=U("url"),zb=Rr();function MN(r){let t=ht([ON.getCurrentHub,"call",e=>e(),"access",e=>e.getClient,"call",e=>e(),"optionalAccess",e=>e.getDsn,"call",e=>e()]);return t?r.includes(t.host):!1}function LN(r){let t=r.protocol||"",e=r.hostname||r.host||"",s=!r.port||r.port===80||r.port===443?"":`:${r.port}`,n=r.path?r.path:"/";return`${t}//${e}${s}${n}`}function Jb(r){let t=r.protocol||"",e=r.hostname||r.host||"",s=!r.port||r.port===80||r.port===443?"":`:${r.port}`,n=r.pathname||"/",i=r.auth?RN(r.auth):"";return`${t}//${i}${e}${s}${n}`}function RN(r){let[t,e]=r.split(":");return`${t?"[Filtered]":""}:${e?"[Filtered]":""}@`}function FN(r,t,e){if(!r)return r;let[s,n]=r.split(" ");return t.host&&!t.protocol&&(t.protocol=ht([e,"optionalAccess",i=>i.agent,"optionalAccess",i=>i.protocol]),n=Jb(t)),ht([n,"optionalAccess",i=>i.startsWith,"call",i=>i("///")])&&(n=n.slice(2)),`${s} ${n}`}function lh(r){let t={protocol:r.protocol,hostname:typeof r.hostname=="string"&&r.hostname.startsWith("[")?r.hostname.slice(1,-1):r.hostname,hash:r.hash,search:r.search,pathname:r.pathname,path:`${r.pathname||""}${r.search||""}`,href:r.href};return r.port!==""&&(t.port=Number(r.port)),(r.username||r.password)&&(t.auth=`${r.username}:${r.password}`),t}function BN(r,t){let e,s;return typeof t[t.length-1]=="function"&&(e=t.pop()),typeof t[0]=="string"?s=lh(new Wb.URL(t[0])):t[0]instanceof Wb.URL?s=lh(t[0]):s=t[0],t.length===2&&(s={...s,...t[1]}),s.protocol===void 0&&(zb.NODE_VERSION.major&&zb.NODE_VERSION.major>8?s.protocol=ht([ht([r,"optionalAccess",n=>n.globalAgent]),"optionalAccess",n=>n.protocol])||ht([s.agent,"optionalAccess",n=>n.protocol])||ht([s._defaultAgent,"optionalAccess",n=>n.protocol]):s.protocol=ht([s.agent,"optionalAccess",n=>n.protocol])||ht([s._defaultAgent,"optionalAccess",n=>n.protocol])||ht([ht([r,"optionalAccess",n=>n.globalAgent]),"optionalAccess",n=>n.protocol])),e?[s,e]:[s]}ls.cleanSpanDescription=FN;ls.extractRawUrl=LN;ls.extractUrl=Jb;ls.isSentryRequest=MN;ls.normalizeRequestArgs=BN;ls.urlToOptions=lh});var hh=_(ph=>{var{_optionalChain:Rs}=ue();Object.defineProperty(ph,"__esModule",{value:!0});var bo=ie(),vt=L(),Kb=pi(),Xb=Rr(),Fr=uh(),hi=class r{static __initStatic(){this.id="Http"}__init(){this.name=r.id}constructor(t={}){r.prototype.__init.call(this),this._breadcrumbs=typeof t.breadcrumbs>"u"?!0:t.breadcrumbs,this._tracing=t.tracing?t.tracing===!0?{}:t.tracing:void 0}setupOnce(t,e){if(!this._breadcrumbs&&!this._tracing)return;let s=Rs([e,"call",c=>c(),"access",c=>c.getClient,"call",c=>c(),"optionalAccess",c=>c.getOptions,"call",c=>c()]);if(s&&s.instrumenter!=="sentry"){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&vt.logger.log("HTTP Integration is skipped because of instrumenter configuration.");return}let n=Rs([this,"access",c=>c._tracing,"optionalAccess",c=>c.shouldCreateSpanForRequest])||Rs([s,"optionalAccess",c=>c.shouldCreateSpanForRequest]),i=Rs([s,"optionalAccess",c=>c.tracePropagationTargets])||Rs([this,"access",c=>c._tracing,"optionalAccess",c=>c.tracePropagationTargets]),a=U("http"),o=Qb(a,this._breadcrumbs,n,i);if(vt.fill(a,"get",o),vt.fill(a,"request",o),Xb.NODE_VERSION.major&&Xb.NODE_VERSION.major>8){let c=U("https"),l=Qb(c,this._breadcrumbs,n,i);vt.fill(c,"get",l),vt.fill(c,"request",l)}}};hi.__initStatic();function Qb(r,t,e,s){let n=new Kb.LRUMap(100),i=new Kb.LRUMap(100),a=l=>{if(e===void 0)return!0;let u=n.get(l);if(u!==void 0)return u;let p=e(l);return n.set(l,p),p},o=l=>{if(s===void 0)return!0;let u=i.get(l);if(u!==void 0)return u;let p=vt.stringMatchesSomePattern(l,s);return i.set(l,p),p};function c(l,u,p,h){bo.getCurrentHub().getIntegration(hi)&&bo.getCurrentHub().addBreadcrumb({category:"http",data:{status_code:h&&h.statusCode,...u},type:"http"},{event:l,request:p,response:h})}return function(u){return function(...h){let d=Fr.normalizeRequestArgs(r,h),f=d[0],m=Fr.extractRawUrl(f),y=Fr.extractUrl(f);if(Fr.isSentryRequest(y))return u.apply(r,d);let b=bo.getCurrentHub(),x=b.getScope(),N=x.getSpan(),T=jN(y,f),P=a(m)?Rs([N,"optionalAccess",A=>A.startChild,"call",A=>A({op:"http.client",origin:"auto.http.node.http",description:`${T["http.method"]} ${T.url}`,data:T})]):void 0;if(o(m))if(P){let A=P.toTraceparent(),k=Rs([P,"optionalAccess",H=>H.transaction,"optionalAccess",H=>H.getDynamicSamplingContext,"call",H=>H()]);Zb(f,y,A,k)}else{let A=b.getClient(),{traceId:k,sampled:H,dsc:xe}=x.getPropagationContext(),Ve=vt.generateSentryTraceHeader(k,void 0,H),mi=xe||(A?bo.getDynamicSamplingContextFromClient(k,A,x):void 0);Zb(f,y,Ve,mi)}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&vt.logger.log(`[Tracing] Not adding sentry-trace header to outgoing request (${y}) due to mismatching tracePropagationTargets option.`);return u.apply(r,d).once("response",function(A){let k=this;t&&c("response",T,k,A),P&&(A.statusCode&&P.setHttpStatus(A.statusCode),P.description=Fr.cleanSpanDescription(P.description,f,k),P.finish())}).once("error",function(){let A=this;t&&c("error",T,A),P&&(P.setHttpStatus(500),P.description=Fr.cleanSpanDescription(P.description,f,A),P.finish())})}}}function Zb(r,t,e,s){if((r.headers||{})["sentry-trace"])return;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&vt.logger.log(`[Tracing] Adding sentry-trace header ${e} to outgoing request to "${t}": `);let i=vt.dynamicSamplingContextToSentryBaggageHeader(s),a=i&&i.length>0?UN(r,i):void 0;r.headers={...r.headers,"sentry-trace":e,...a&&{baggage:a}}}function jN(r,t){let e=t.method||"GET",s={url:r,"http.method":e};return t.hash&&(s["http.fragment"]=t.hash.substring(1)),t.search&&(s["http.query"]=t.search.substring(1)),s}function UN(r,t){if(!r.headers||!r.headers.baggage)return t;if(t){if(Array.isArray(r.headers.baggage))return[...r.headers.baggage,t]}else return r.headers.baggage;return[r.headers.baggage,t]}ph.Http=hi});var mh=_(fh=>{Object.defineProperty(fh,"__esModule",{value:!0});var qN=ie(),dh=L(),GN=2e3;function $N(r){console.error(r);let t=qN.getCurrentHub().getClient();t===void 0&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&dh.logger.warn("No NodeClient was defined, we are exiting the process now."),global.process.exit(1));let e=t.getOptions(),s=e&&e.shutdownTimeout&&e.shutdownTimeout>0&&e.shutdownTimeout||GN;t.close(s).then(n=>{n||(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&dh.logger.warn("We reached the timeout for emptying the request buffer, still exiting now!"),global.process.exit(1)},n=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&dh.logger.error(n)})}fh.logAndExitProcess=$N});var gh=_(yh=>{Object.defineProperty(yh,"__esModule",{value:!0});var eS=ie(),HN=L(),tS=mh(),So=class r{static __initStatic(){this.id="OnUncaughtException"}__init(){this.name=r.id}__init2(){this.handler=this._makeErrorHandler()}constructor(t={}){r.prototype.__init.call(this),r.prototype.__init2.call(this),this._options={exitEvenIfOtherHandlersAreRegistered:!0,...t}}setupOnce(){global.process.on("uncaughtException",this.handler)}_makeErrorHandler(){let e=!1,s=!1,n=!1,i;return a=>{let o=tS.logAndExitProcess,c=eS.getCurrentHub().getClient();this._options.onFatalError?o=this._options.onFatalError:c&&c.getOptions().onFatalError&&(o=c.getOptions().onFatalError);let u=global.process.listeners("uncaughtException").reduce((h,d)=>d.name==="domainUncaughtExceptionClear"||d.tag&&d.tag==="sentry_tracingErrorCallback"||d===this.handler?h:h+1,0)===0,p=this._options.exitEvenIfOtherHandlersAreRegistered||u;if(e)p&&(n?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&HN.logger.warn("uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown"),tS.logAndExitProcess(a)):s||(s=!0,setTimeout(()=>{n||(n=!0,o(i,a))},2e3)));else{let h=eS.getCurrentHub();i=a,e=!0,h.getIntegration(r)?h.withScope(d=>{d.setLevel("fatal"),h.captureException(a,{originalException:a,data:{mechanism:{handled:!1,type:"onuncaughtexception"}}}),!n&&p&&(n=!0,o(a))}):!n&&p&&(n=!0,o(a))}}}};So.__initStatic();yh.OnUncaughtException=So});var Sh=_(bh=>{Object.defineProperty(bh,"__esModule",{value:!0});var VN=ie(),sS=L(),YN=mh(),_o=class r{static __initStatic(){this.id="OnUnhandledRejection"}__init(){this.name=r.id}constructor(t={mode:"warn"}){this._options=t,r.prototype.__init.call(this)}setupOnce(){global.process.on("unhandledRejection",this.sendUnhandledPromise.bind(this))}sendUnhandledPromise(t,e){let s=VN.getCurrentHub();s.getIntegration(r)&&s.withScope(n=>{n.setExtra("unhandledPromiseRejection",!0),s.captureException(t,{originalException:e,data:{mechanism:{handled:!1,type:"onunhandledrejection"}}})}),this._handleRejection(t)}_handleRejection(t){let e="This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:";this._options.mode==="warn"?sS.consoleSandbox(()=>{console.warn(e),console.error(t&&t.stack?t.stack:t)}):this._options.mode==="strict"&&(sS.consoleSandbox(()=>{console.warn(e)}),YN.logAndExitProcess(t))}};_o.__initStatic();bh.OnUnhandledRejection=_o});var xh=_(_h=>{Object.defineProperty(_h,"__esModule",{value:!0});var WN=L(),zN=jp(),JN="cause",KN=5,xo=class r{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=r.id}constructor(t={}){r.prototype.__init.call(this),this._key=t.key||JN,this._limit=t.limit||KN}setupOnce(){}preprocessEvent(t,e,s){let n=s.getOptions();WN.applyAggregateErrorsToEvent(zN.exceptionFromError,n.stackParser,n.maxValueLength,this._key,this._limit,t,e)}};xo.__initStatic();_h.LinkedErrors=xo});var Ph=_(Th=>{Object.defineProperty(Th,"__esModule",{value:!0});var rS=U("fs"),nS=U("path"),Eh;function XN(){try{return U.cache?Object.keys(U.cache):[]}catch{return[]}}function QN(){let r=U.main&&U.main.paths||[],t=XN(),e={},s={};return t.forEach(n=>{let i=n,a=()=>{let o=i;if(i=nS.dirname(o),!i||o===i||s[o])return;if(r.indexOf(i)<0)return a();let c=nS.join(o,"package.json");if(s[o]=!0,!rS.existsSync(c))return a();try{let l=JSON.parse(rS.readFileSync(c,"utf8"));e[l.name]=l.version}catch{}};a()}),e}var Eo=class r{constructor(){r.prototype.__init.call(this)}static __initStatic(){this.id="Modules"}__init(){this.name=r.id}setupOnce(t,e){t(s=>e().getIntegration(r)?{...s,modules:{...s.modules,...this._getModules()}}:s)}_getModules(){return Eh||(Eh=QN()),Eh}};Eo.__initStatic();Th.Modules=Eo});var Ch=_(Ah=>{var{_optionalChain:vh}=ue();Object.defineProperty(Ah,"__esModule",{value:!0});var ZN=L(),ek=U("fs"),tk=pi(),To=new tk.LRUMap(100),sk=7;function rk(r){return new Promise((t,e)=>{ek.readFile(r,"utf8",(s,n)=>{s?e(s):t(n)})})}var Po=class r{static __initStatic(){this.id="ContextLines"}__init(){this.name=r.id}constructor(t={}){this._options=t,r.prototype.__init.call(this)}get _contextLines(){return this._options.frameContextLines!==void 0?this._options.frameContextLines:sk}setupOnce(t,e){t(s=>e().getIntegration(r)?this.addSourceContext(s):s)}async addSourceContext(t){let e={},s=[];if(this._contextLines>0&&vh([t,"access",n=>n.exception,"optionalAccess",n=>n.values])){for(let n of t.exception.values)if(vh([n,"access",i=>i.stacktrace,"optionalAccess",i=>i.frames]))for(let i=n.stacktrace.frames.length-1;i>=0;i--){let a=n.stacktrace.frames[i];a.filename&&!e[a.filename]&&!To.get(a.filename)&&(s.push(nk(a.filename)),e[a.filename]=1)}}if(s.length>0&&await Promise.all(s),this._contextLines>0&&vh([t,"access",n=>n.exception,"optionalAccess",n=>n.values]))for(let n of t.exception.values)n.stacktrace&&n.stacktrace.frames&&await this.addSourceContextToFrames(n.stacktrace.frames);return t}addSourceContextToFrames(t){for(let e of t)if(e.filename&&e.context_line===void 0){let s=To.get(e.filename);if(s)try{ZN.addContextToFrame(s,e,this._contextLines)}catch{}}}};Po.__initStatic();async function nk(r){let t=To.get(r);if(t===null)return null;if(t!==void 0)return t;let e=null;try{e=(await rk(r)).split(`
|
|
38
|
+
`)}catch{}return To.set(r,e),e}Ah.ContextLines=Po});var wh=_(Br=>{var{_optionalChain:Fs}=ue();Object.defineProperty(Br,"__esModule",{value:!0});var ik=U("child_process"),aS=U("fs"),rt=U("os"),ak=U("path"),oS=U("util"),cS=oS.promisify(aS.readFile),lS=oS.promisify(aS.readdir),vo=class r{static __initStatic(){this.id="Context"}__init(){this.name=r.id}constructor(t={app:!0,os:!0,device:!0,culture:!0,cloudResource:!0}){this._options=t,r.prototype.__init.call(this)}setupOnce(t){t(e=>this.addContext(e))}async addContext(t){this._cachedContext===void 0&&(this._cachedContext=this._getContexts());let e=this._updateContext(await this._cachedContext);return t.contexts={...t.contexts,app:{...e.app,...Fs([t,"access",s=>s.contexts,"optionalAccess",s=>s.app])},os:{...e.os,...Fs([t,"access",s=>s.contexts,"optionalAccess",s=>s.os])},device:{...e.device,...Fs([t,"access",s=>s.contexts,"optionalAccess",s=>s.device])},culture:{...e.culture,...Fs([t,"access",s=>s.contexts,"optionalAccess",s=>s.culture])},cloud_resource:{...e.cloud_resource,...Fs([t,"access",s=>s.contexts,"optionalAccess",s=>s.cloud_resource])}},t}_updateContext(t){return Fs([t,"optionalAccess",e=>e.app,"optionalAccess",e=>e.app_memory])&&(t.app.app_memory=process.memoryUsage().rss),Fs([t,"optionalAccess",e=>e.device,"optionalAccess",e=>e.free_memory])&&(t.device.free_memory=rt.freemem()),t}async _getContexts(){let t={};if(this._options.os&&(t.os=await ok()),this._options.app&&(t.app=lk()),this._options.device&&(t.device=uS(this._options.device)),this._options.culture){let e=ck();e&&(t.culture=e)}return this._options.cloudResource&&(t.cloud_resource=mk()),t}};vo.__initStatic();async function ok(){let r=rt.platform();switch(r){case"darwin":return dk();case"linux":return fk();default:return{name:uk[r]||r,version:rt.release()}}}function ck(){try{if(typeof process.versions.icu!="string")return;let r=new Date(9e8);if(new Intl.DateTimeFormat("es",{month:"long"}).format(r)==="enero"){let e=Intl.DateTimeFormat().resolvedOptions();return{locale:e.locale,timezone:e.timeZone}}}catch{}}function lk(){let r=process.memoryUsage().rss;return{app_start_time:new Date(Date.now()-process.uptime()*1e3).toISOString(),app_memory:r}}function uS(r){let t={},e;try{e=rt.uptime&&rt.uptime()}catch{}if(typeof e=="number"&&(t.boot_time=new Date(Date.now()-e*1e3).toISOString()),t.arch=rt.arch(),(r===!0||r.memory)&&(t.memory_size=rt.totalmem(),t.free_memory=rt.freemem()),r===!0||r.cpu){let s=rt.cpus();if(s&&s.length){let n=s[0];t.processor_count=s.length,t.cpu_description=n.model,t.processor_frequency=n.speed}}return t}var uk={aix:"IBM AIX",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",win32:"Windows"},pk=[{name:"fedora-release",distros:["Fedora"]},{name:"redhat-release",distros:["Red Hat Linux","Centos"]},{name:"redhat_version",distros:["Red Hat Linux"]},{name:"SuSE-release",distros:["SUSE Linux"]},{name:"lsb-release",distros:["Ubuntu Linux","Arch Linux"]},{name:"debian_version",distros:["Debian"]},{name:"debian_release",distros:["Debian"]},{name:"arch-release",distros:["Arch Linux"]},{name:"gentoo-release",distros:["Gentoo Linux"]},{name:"novell-release",distros:["SUSE Linux"]},{name:"alpine-release",distros:["Alpine Linux"]}],hk={alpine:r=>r,arch:r=>At(/distrib_release=(.*)/,r),centos:r=>At(/release ([^ ]+)/,r),debian:r=>r,fedora:r=>At(/release (..)/,r),mint:r=>At(/distrib_release=(.*)/,r),red:r=>At(/release ([^ ]+)/,r),suse:r=>At(/VERSION = (.*)\n/,r),ubuntu:r=>At(/distrib_release=(.*)/,r)};function At(r,t){let e=r.exec(t);return e?e[1]:void 0}async function dk(){let r={kernel_version:rt.release(),name:"Mac OS X",version:`10.${Number(rt.release().split(".")[0])-4}`};try{let t=await new Promise((e,s)=>{ik.execFile("/usr/bin/sw_vers",(n,i)=>{if(n){s(n);return}e(i)})});r.name=At(/^ProductName:\s+(.*)$/m,t),r.version=At(/^ProductVersion:\s+(.*)$/m,t),r.build=At(/^BuildVersion:\s+(.*)$/m,t)}catch{}return r}function iS(r){return r.split(" ")[0].toLowerCase()}async function fk(){let r={kernel_version:rt.release(),name:"Linux"};try{let t=await lS("/etc"),e=pk.find(o=>t.includes(o.name));if(!e)return r;let s=ak.join("/etc",e.name),n=(await cS(s,{encoding:"utf-8"})).toLowerCase(),{distros:i}=e;r.name=i.find(o=>n.indexOf(iS(o))>=0)||i[0];let a=iS(r.name);r.version=hk[a](n)}catch{}return r}function mk(){return process.env.VERCEL?{"cloud.provider":"vercel","cloud.region":process.env.VERCEL_REGION}:process.env.AWS_REGION?{"cloud.provider":"aws","cloud.region":process.env.AWS_REGION,"cloud.platform":process.env.AWS_EXECUTION_ENV}:process.env.GCP_PROJECT?{"cloud.provider":"gcp"}:process.env.ALIYUN_REGION_ID?{"cloud.provider":"alibaba_cloud","cloud.region":process.env.ALIYUN_REGION_ID}:process.env.WEBSITE_SITE_NAME&&process.env.REGION_NAME?{"cloud.provider":"azure","cloud.region":process.env.REGION_NAME}:process.env.IBM_CLOUD_REGION?{"cloud.provider":"ibm_cloud","cloud.region":process.env.IBM_CLOUD_REGION}:process.env.TENCENTCLOUD_REGION?{"cloud.provider":"tencent_cloud","cloud.region":process.env.TENCENTCLOUD_REGION,"cloud.account.id":process.env.TENCENTCLOUD_APPID,"cloud.availability_zone":process.env.TENCENTCLOUD_ZONE}:process.env.NETLIFY?{"cloud.provider":"netlify"}:process.env.FLY_REGION?{"cloud.provider":"fly.io","cloud.region":process.env.FLY_REGION}:process.env.DYNO?{"cloud.provider":"heroku"}:void 0}Br.Context=vo;Br.getDeviceContext=uS;Br.readDirAsync=lS;Br.readFileAsync=cS});var pS=_(Ih=>{"use strict";Ih.parse=bk;Ih.serialize=Sk;var yk=decodeURIComponent,gk=encodeURIComponent,Ao=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function bk(r,t){if(typeof r!="string")throw new TypeError("argument str must be a string");for(var e={},s=t||{},n=r.split(";"),i=s.decode||yk,a=0;a<n.length;a++){var o=n[a],c=o.indexOf("=");if(!(c<0)){var l=o.substring(0,c).trim();if(e[l]==null){var u=o.substring(c+1,o.length).trim();u[0]==='"'&&(u=u.slice(1,-1)),e[l]=_k(u,i)}}}return e}function Sk(r,t,e){var s=e||{},n=s.encode||gk;if(typeof n!="function")throw new TypeError("option encode is invalid");if(!Ao.test(r))throw new TypeError("argument name is invalid");var i=n(t);if(i&&!Ao.test(i))throw new TypeError("argument val is invalid");var a=r+"="+i;if(s.maxAge!=null){var o=s.maxAge-0;if(isNaN(o)||!isFinite(o))throw new TypeError("option maxAge is invalid");a+="; Max-Age="+Math.floor(o)}if(s.domain){if(!Ao.test(s.domain))throw new TypeError("option domain is invalid");a+="; Domain="+s.domain}if(s.path){if(!Ao.test(s.path))throw new TypeError("option path is invalid");a+="; Path="+s.path}if(s.expires){if(typeof s.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+="; Expires="+s.expires.toUTCString()}if(s.httpOnly&&(a+="; HttpOnly"),s.secure&&(a+="; Secure"),s.sameSite){var c=typeof s.sameSite=="string"?s.sameSite.toLowerCase():s.sameSite;switch(c){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return a}function _k(r,t){try{return t(r)}catch{return r}}});var di=_(jr=>{var{_optionalChain:xk}=ue();Object.defineProperty(jr,"__esModule",{value:!0});var Co=L(),Ek=pS(),Tk=U("url"),Pk={ip:!1,request:!0,transaction:!0,user:!0},vk=["cookies","data","headers","method","query_string","url"],hS=["id","username","email"];function Nh(r,t={}){let e=r.method&&r.method.toUpperCase(),s="",n="url";t.customRoute||r.route?(s=t.customRoute||`${r.baseUrl||""}${r.route&&r.route.path}`,n="route"):(r.originalUrl||r.url)&&(s=Co.stripUrlQueryAndFragment(r.originalUrl||r.url||""));let i="";return t.method&&e&&(i+=e),t.method&&t.path&&(i+=" "),t.path&&s&&(i+=s),[i,n]}function Ak(r,t){switch(t){case"path":return Nh(r,{path:!0})[0];case"handler":return r.route&&r.route.stack&&r.route.stack[0]&&r.route.stack[0].name||"<anonymous>";case"methodPath":default:return Nh(r,{path:!0,method:!0})[0]}}function Ck(r,t){let e={};return(Array.isArray(t)?t:hS).forEach(n=>{r&&n in r&&(e[n]=r[n])}),e}function kh(r,t){let{include:e=vk}=t||{},s={},n=r.headers||{},i=r.method,a=r.hostname||r.host||n.host||"<no host>",o=r.protocol==="https"||r.socket&&r.socket.encrypted?"https":"http",c=r.originalUrl||r.url||"",l=c.startsWith(o)?c:`${o}://${a}${c}`;return e.forEach(u=>{switch(u){case"headers":{s.headers=n,e.includes("cookies")||delete s.headers.cookie;break}case"method":{s.method=i;break}case"url":{s.url=l;break}case"cookies":{s.cookies=r.cookies||n.cookie&&Ek.parse(n.cookie)||{};break}case"query_string":{s.query_string=Ik(r);break}case"data":{if(i==="GET"||i==="HEAD")break;r.body!==void 0&&(s.data=Co.isString(r.body)?r.body:JSON.stringify(Co.normalize(r.body)));break}default:({}).hasOwnProperty.call(r,u)&&(s[u]=r[u])}}),s}function wk(r,t,e){let s={...Pk,...xk([e,"optionalAccess",n=>n.include])};if(s.request){let n=Array.isArray(s.request)?kh(t,{include:s.request}):kh(t);r.request={...r.request,...n}}if(s.user){let n=t.user&&Co.isPlainObject(t.user)?Ck(t.user,s.user):{};Object.keys(n).length&&(r.user={...r.user,...n})}if(s.ip){let n=t.ip||t.socket&&t.socket.remoteAddress;n&&(r.user={...r.user,ip_address:n})}return s.transaction&&!r.transaction&&(r.transaction=Ak(t,s.transaction)),r}function Ik(r){let t=r.originalUrl||r.url||"";if(t)return t.startsWith("/")&&(t=`http://dogs.are.great${t}`),r.query||typeof URL!==void 0&&new URL(t).search.replace("?","")||Tk.parse(t).query||void 0}jr.DEFAULT_USER_INCLUDES=hS;jr.addRequestDataToEvent=wk;jr.extractPathForTransaction=Nh;jr.extractRequestData=kh});var Mh=_(Oh=>{Object.defineProperty(Oh,"__esModule",{value:!0});var Nk=L(),kk=di(),Dh={include:{cookies:!0,data:!0,headers:!0,ip:!1,query_string:!0,url:!0,user:{id:!0,username:!0,email:!0}},transactionNamingScheme:"methodPath"},wo=class r{static __initStatic(){this.id="RequestData"}__init(){this.name=r.id}constructor(t={}){r.prototype.__init.call(this),this._addRequestData=kk.addRequestDataToEvent,this._options={...Dh,...t,include:{method:!0,...Dh.include,...t.include,user:t.include&&typeof t.include.user=="boolean"?t.include.user:{...Dh.include.user,...(t.include||{}).user}}}}setupOnce(t,e){let{transactionNamingScheme:s}=this._options;t(n=>{let i=e(),a=i.getIntegration(r),{sdkProcessingMetadata:o={}}=n,c=o.request;if(!a||!c)return n;let l=o.requestDataOptionsFromExpressHandler||o.requestDataOptionsFromGCPWrapper||Dk(this._options),u=this._addRequestData(n,c,l);if(n.type==="transaction"||s==="handler")return u;let h=c._sentryTransaction;if(h){let d=Ok(i)==="sentry.javascript.nextjs"?h.name.startsWith("/api"):s!=="path",[f]=Nk.extractPathForTransaction(c,{path:!0,method:d,customRoute:h.name});u.transaction=f}return u})}};wo.__initStatic();function Dk(r){let{transactionNamingScheme:t,include:{ip:e,user:s,...n}}=r,i=[];for(let[o,c]of Object.entries(n))c&&i.push(o);let a;if(s===void 0)a=!0;else if(typeof s=="boolean")a=s;else{let o=[];for(let[c,l]of Object.entries(s))l&&o.push(c);a=o}return{include:{ip:e,user:a,request:i.length!==0?i:void 0,transaction:t}}}function Ok(r){try{return r.getClient().getOptions()._metadata.sdk.name}catch{return}}Oh.RequestData=wo});var Fh=_(No=>{var{_optionalChain:he}=ue();Object.defineProperty(No,"__esModule",{value:!0});var Mk=L(),Lk=pi(),Rk=Rr();function Rh(r){let t=[],e=!1;function s(a){t=[],!e&&(e=!0,r(a))}t.push(s);function n(a){t.push(a)}function i(a){let o=t.pop()||s;try{o(a)}catch{s(a)}}return{add:n,next:i}}var Lh=class{constructor(){let{Session:t}=U("inspector");this._session=new t}configureAndConnect(t,e){this._session.connect(),this._session.on("Debugger.paused",s=>{t(s,()=>{this._session.post("Debugger.resume")})}),this._session.post("Debugger.enable"),this._session.post("Debugger.setPauseOnExceptions",{state:e?"all":"uncaught"})}getLocalVariables(t,e){this._getProperties(t,s=>{let{add:n,next:i}=Rh(e);for(let a of s)if(he([a,"optionalAccess",o=>o.value,"optionalAccess",o=>o.objectId])&&he([a,"optionalAccess",o=>o.value,"access",o=>o.className])==="Array"){let o=a.value.objectId;n(c=>this._unrollArray(o,a.name,c,i))}else if(he([a,"optionalAccess",o=>o.value,"optionalAccess",o=>o.objectId])&&he([a,"optionalAccess",o=>o.value,"optionalAccess",o=>o.className])==="Object"){let o=a.value.objectId;n(c=>this._unrollObject(o,a.name,c,i))}else(he([a,"optionalAccess",o=>o.value,"optionalAccess",o=>o.value])||he([a,"optionalAccess",o=>o.value,"optionalAccess",o=>o.description]))&&n(o=>this._unrollOther(a,o,i));i({})})}_getProperties(t,e){this._session.post("Runtime.getProperties",{objectId:t,ownProperties:!0},(s,n)=>{e(s?[]:n.result)})}_unrollArray(t,e,s,n){this._getProperties(t,i=>{s[e]=i.filter(a=>a.name!=="length"&&!isNaN(parseInt(a.name,10))).sort((a,o)=>parseInt(a.name,10)-parseInt(o.name,10)).map(a=>he([a,"optionalAccess",o=>o.value,"optionalAccess",o=>o.value])),n(s)})}_unrollObject(t,e,s,n){this._getProperties(t,i=>{s[e]=i.map(a=>[a.name,he([a,"optionalAccess",o=>o.value,"optionalAccess",o=>o.value])]).reduce((a,[o,c])=>(a[o]=c,a),{}),n(s)})}_unrollOther(t,e,s){he([t,"optionalAccess",n=>n.value,"optionalAccess",n=>n.value])?e[t.name]=t.value.value:he([t,"optionalAccess",n=>n.value,"optionalAccess",n=>n.description])&&he([t,"optionalAccess",n=>n.value,"optionalAccess",n=>n.type])!=="function"&&(e[t.name]=`<${t.value.description}>`),s(e)}};function Fk(){try{return new Lh}catch{return}}function dS(r){return r!==void 0&&["","?","<anonymous>"].includes(r)}function Bk(r,t){return r===t||dS(r)&&dS(t)}function fS(r){if(r!==void 0)return r.slice(-10).reduce((t,e)=>`${t},${e.function},${e.lineno},${e.colno}`,"")}function jk(r,t){if(t!==void 0)return fS(r(t,1))}var Io=class r{static __initStatic(){this.id="LocalVariables"}__init(){this.name=r.id}__init2(){this._cachedFrames=new Lk.LRUMap(20)}constructor(t={},e=Fk()){this._options=t,this._session=e,r.prototype.__init.call(this),r.prototype.__init2.call(this)}setupOnce(t,e){this._setup(t,he([e,"call",s=>s(),"access",s=>s.getClient,"call",s=>s(),"optionalAccess",s=>s.getOptions,"call",s=>s()]))}_setup(t,e){if(this._session&&he([e,"optionalAccess",s=>s.includeLocalVariables])){if((Rk.NODE_VERSION.major||0)<18){Mk.logger.log("The `LocalVariables` integration is only supported on Node >= v18.");return}this._session.configureAndConnect((n,i)=>this._handlePaused(e.stackParser,n,i),!!this._options.captureAllExceptions),t(async n=>this._addLocalVariables(n))}}_handlePaused(t,{params:{reason:e,data:s,callFrames:n}},i){if(e!=="exception"&&e!=="promiseRejection"){i();return}let a=jk(t,he([s,"optionalAccess",l=>l.description]));if(a==null){i();return}let{add:o,next:c}=Rh(l=>{this._cachedFrames.set(a,l),i()});for(let l=0;l<Math.min(n.length,5);l++){let{scopeChain:u,functionName:p,this:h}=n[l],d=u.find(m=>m.type==="local"),f=h.className==="global"||!h.className?p:`${h.className}.${p}`;if(he([d,"optionalAccess",m=>m.object,"access",m=>m.objectId])===void 0)o(m=>{m[l]={function:f},c(m)});else{let m=d.object.objectId;o(y=>he([this,"access",b=>b._session,"optionalAccess",b=>b.getLocalVariables,"call",b=>b(m,x=>{y[l]={function:f,vars:x},c(y)})]))}}c([])}_addLocalVariables(t){for(let e of he([t,"optionalAccess",s=>s.exception,"optionalAccess",s=>s.values])||[])this._addLocalVariablesToException(e);return t}_addLocalVariablesToException(t){let e=fS(he([t,"optionalAccess",i=>i.stacktrace,"optionalAccess",i=>i.frames]));if(e===void 0)return;let s=this._cachedFrames.delete(e);if(s===void 0)return;let n=he([t,"access",i=>i.stacktrace,"optionalAccess",i=>i.frames,"optionalAccess",i=>i.length])||0;for(let i=0;i<n;i++){let a=n-i-1;if(!he([t,"optionalAccess",o=>o.stacktrace,"optionalAccess",o=>o.frames,"optionalAccess",o=>o[a]])||!s[i])break;s[i].vars===void 0||t.stacktrace.frames[a].in_app===!1||!Bk(t.stacktrace.frames[a].function,s[i].function)||(t.stacktrace.frames[a].vars=s[i].vars)}}};Io.__initStatic();No.LocalVariables=Io;No.createCallbackList=Rh});var jh=_((Yt,SS)=>{var{_optionalChain:bS}=ue();Object.defineProperty(Yt,"__esModule",{value:!0});var ko=ie(),Bs=L(),mS=pi(),yS=Rr(),Bh=uh();Yt.ChannelName=void 0;(function(r){let t="undici:request:create";r.RequestCreate=t;let e="undici:request:headers";r.RequestEnd=e;let s="undici:request:error";r.RequestError=s})(Yt.ChannelName||(Yt.ChannelName={}));var Do=class r{static __initStatic(){this.id="Undici"}__init(){this.name=r.id}__init2(){this._createSpanUrlMap=new mS.LRUMap(100)}__init3(){this._headersUrlMap=new mS.LRUMap(100)}constructor(t={}){r.prototype.__init.call(this),r.prototype.__init2.call(this),r.prototype.__init3.call(this),r.prototype.__init4.call(this),r.prototype.__init5.call(this),r.prototype.__init6.call(this),this._options={breadcrumbs:t.breadcrumbs===void 0?!0:t.breadcrumbs,shouldCreateSpanForRequest:t.shouldCreateSpanForRequest}}setupOnce(t){if(yS.NODE_VERSION.major&&yS.NODE_VERSION.major<16)return;let e;try{e=Bs.dynamicRequire(SS,"diagnostics_channel")}catch{}!e||!e.subscribe||(e.subscribe(Yt.ChannelName.RequestCreate,this._onRequestCreate),e.subscribe(Yt.ChannelName.RequestEnd,this._onRequestEnd),e.subscribe(Yt.ChannelName.RequestError,this._onRequestError))}_shouldCreateSpan(t){if(this._options.shouldCreateSpanForRequest===void 0)return!0;let e=this._createSpanUrlMap.get(t);if(e!==void 0)return e;let s=this._options.shouldCreateSpanForRequest(t);return this._createSpanUrlMap.set(t,s),s}__init4(){this._onRequestCreate=t=>{let e=ko.getCurrentHub();if(!e.getIntegration(r))return;let{request:s}=t,n=s.origin?s.origin.toString()+s.path:s.path;if(Bh.isSentryRequest(n)||s.__sentry_span__!==void 0)return;let i=e.getClient();if(!i)return;let a=i.getOptions(),o=e.getScope(),c=o.getSpan(),l=this._shouldCreateSpan(n)?Uk(c,s,n):void 0;if(l&&(s.__sentry_span__=l),(p=>{if(a.tracePropagationTargets===void 0)return!0;let h=this._headersUrlMap.get(p);if(h!==void 0)return h;let d=Bs.stringMatchesSomePattern(p,a.tracePropagationTargets);return this._headersUrlMap.set(p,d),d})(n))if(l){let p=bS([l,"optionalAccess",d=>d.transaction,"optionalAccess",d=>d.getDynamicSamplingContext,"call",d=>d()]),h=Bs.dynamicSamplingContextToSentryBaggageHeader(p);gS(s,l.toTraceparent(),h)}else{let{traceId:p,sampled:h,dsc:d}=o.getPropagationContext(),f=Bs.generateSentryTraceHeader(p,void 0,h),m=d||ko.getDynamicSamplingContextFromClient(p,i,o),y=Bs.dynamicSamplingContextToSentryBaggageHeader(m);gS(s,f,y)}}}__init5(){this._onRequestEnd=t=>{let e=ko.getCurrentHub();if(!e.getIntegration(r))return;let{request:s,response:n}=t,i=s.origin?s.origin.toString()+s.path:s.path;if(Bh.isSentryRequest(i))return;let a=s.__sentry_span__;a&&(a.setHttpStatus(n.statusCode),a.finish()),this._options.breadcrumbs&&e.addBreadcrumb({category:"http",data:{method:s.method,status_code:n.statusCode,url:i},type:"http"},{event:"response",request:s,response:n})}}__init6(){this._onRequestError=t=>{let e=ko.getCurrentHub();if(!e.getIntegration(r))return;let{request:s}=t,n=s.origin?s.origin.toString()+s.path:s.path;if(Bh.isSentryRequest(n))return;let i=s.__sentry_span__;i&&(i.setStatus("internal_error"),i.finish()),this._options.breadcrumbs&&e.addBreadcrumb({category:"http",data:{method:s.method,url:n},level:"error",type:"http"},{event:"error",request:s})}}};Do.__initStatic();function gS(r,t,e){r.__sentry_has_headers__||(r.addHeader("sentry-trace",t),e&&r.addHeader("baggage",e),r.__sentry_has_headers__=!0)}function Uk(r,t,e){let s=Bs.parseUrl(e),n=t.method||"GET",i={"http.method":n};return s.search&&(i["http.query"]=s.search),s.hash&&(i["http.fragment"]=s.hash),bS([r,"optionalAccess",a=>a.startChild,"call",a=>a({op:"http.client",origin:"auto.http.node.undici",description:`${n} ${Bs.getSanitizedUrlString(s)}`,data:i})])}Yt.Undici=Do});var qh=_(Uh=>{Object.defineProperty(Uh,"__esModule",{value:!0});var _S=U("path"),qk=_S.sep==="\\";function Gk(r){return r.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}function $k(r,t=qk){if(!r)return;let e=t?Gk(r):r,{root:s,dir:n,base:i,ext:a}=_S.posix.parse(e),c=`${U&&U.main&&U.main.filename&&n||global.process.cwd()}/`,l=i;a===".js"&&(l=l.slice(0,l.length-3)),!s&&!n&&(n=".");let u=n.lastIndexOf("/node_modules/");if(u>-1)return`${n.slice(u+14).replace(/\//g,".")}:${l}`;if(u=`${n}/`.lastIndexOf(c,0),u===0){let p=n.slice(c.length).replace(/\//g,".");return p&&(p+=":"),p+=l,p}return l}Uh.getModuleFromFilename=$k});var Gh=_(qs=>{var{_optionalChain:Hk}=ue();Object.defineProperty(qs,"__esModule",{value:!0});var js=ie(),Us=L(),Vk=Vb(),Yk=Gp(),Wk=ch(),zk=hh(),Jk=gh(),Kk=Sh(),Xk=xh(),Qk=Ph(),Zk=Ch(),eD=wh(),tD=Mh(),sD=Fh(),rD=jh(),nD=qh(),iD=th(),xS=[new js.Integrations.InboundFilters,new js.Integrations.FunctionToString,new Wk.Console,new zk.Http,new rD.Undici,new Jk.OnUncaughtException,new Kk.OnUnhandledRejection,new Zk.ContextLines,new sD.LocalVariables,new eD.Context,new Qk.Modules,new tD.RequestData,new Xk.LinkedErrors];function aD(r={}){let t=js.getMainCarrier();Vk.setNodeAsyncContextStrategy();let e=Hk([t,"access",i=>i.__SENTRY__,"optionalAccess",i=>i.integrations])||[];r.defaultIntegrations=r.defaultIntegrations===!1?[]:[...Array.isArray(r.defaultIntegrations)?r.defaultIntegrations:xS,...e],r.dsn===void 0&&process.env.SENTRY_DSN&&(r.dsn=process.env.SENTRY_DSN);let s=process.env.SENTRY_TRACES_SAMPLE_RATE;if(r.tracesSampleRate===void 0&&s){let i=parseFloat(s);isFinite(i)&&(r.tracesSampleRate=i)}if(r.release===void 0){let i=ES();i!==void 0?r.release=i:r.autoSessionTracking=!1}r.environment===void 0&&process.env.SENTRY_ENVIRONMENT&&(r.environment=process.env.SENTRY_ENVIRONMENT),r.autoSessionTracking===void 0&&r.dsn!==void 0&&(r.autoSessionTracking=!0),r.instrumenter===void 0&&(r.instrumenter="sentry");let n={...r,stackParser:Us.stackParserFromStackParserOptions(r.stackParser||TS),integrations:js.getIntegrationsToSetup(r),transport:r.transport||iD.makeNodeTransport};js.initAndBind(r.clientClass||Yk.NodeClient,n),r.autoSessionTracking&&cD(),lD()}function oD(r){if(r===void 0)return!1;let t=r&&r.getOptions();return t&&t.autoSessionTracking!==void 0?t.autoSessionTracking:!1}function ES(r){return process.env.SENTRY_RELEASE?process.env.SENTRY_RELEASE:Us.GLOBAL_OBJ.SENTRY_RELEASE&&Us.GLOBAL_OBJ.SENTRY_RELEASE.id?Us.GLOBAL_OBJ.SENTRY_RELEASE.id:process.env.GITHUB_SHA||process.env.COMMIT_REF||process.env.VERCEL_GIT_COMMIT_SHA||process.env.VERCEL_GITHUB_COMMIT_SHA||process.env.VERCEL_GITLAB_COMMIT_SHA||process.env.VERCEL_BITBUCKET_COMMIT_SHA||process.env.ZEIT_GITHUB_COMMIT_SHA||process.env.ZEIT_GITLAB_COMMIT_SHA||process.env.ZEIT_BITBUCKET_COMMIT_SHA||r}var TS=Us.createStackParser(Us.nodeStackLineParser(nD.getModuleFromFilename));function cD(){let r=js.getCurrentHub();r.startSession(),process.on("beforeExit",()=>{let t=r.getScope().getSession();t&&!["exited","crashed"].includes(t.status)&&r.endSession()})}function lD(){let r=(process.env.SENTRY_USE_ENVIRONMENT||"").toLowerCase();if(!["false","n","no","off","0"].includes(r)){let t=process.env.SENTRY_TRACE,e=process.env.SENTRY_BAGGAGE,{propagationContext:s}=Us.tracingContextFromHeaders(t,e);js.getCurrentHub().getScope().setPropagationContext(s)}}qs.defaultIntegrations=xS;qs.defaultStackParser=TS;qs.getSentryRelease=ES;qs.init=aD;qs.isAutoSessionTrackingEnabled=oD});var PS=_(Hh=>{Object.defineProperty(Hh,"__esModule",{value:!0});var Oo=U("fs"),$h=U("path");function uD(r){let t=$h.resolve(r);if(!Oo.existsSync(t))throw new Error(`Cannot read contents of ${t}. Directory does not exist.`);if(!Oo.statSync(t).isDirectory())throw new Error(`Cannot read contents of ${t}, because it is not a directory.`);let e=s=>Oo.readdirSync(s).reduce((n,i)=>{let a=$h.join(s,i);return Oo.statSync(a).isDirectory()?n.concat(e(a)):(n.push(a),n)},[]);return e(t).map(s=>$h.relative(t,s))}Hh.deepReadDirSync=uD});var AS=_(Mo=>{Object.defineProperty(Mo,"__esModule",{value:!0});var vS=di();function pD(r,t){return vS.extractRequestData(r,{include:t})}function hD(r,t,e={}){return vS.addRequestDataToEvent(r,t,{include:e})}Mo.extractRequestData=pD;Mo.parseRequest=hD});var wS=_(ps=>{var{_optionalChain:Ur}=ue();Object.defineProperty(ps,"__esModule",{value:!0});var dt=ie(),us=L(),dD=di(),Lo=Gh(),CS=AS();function fD(){return function(t,e,s){let n=dt.getCurrentHub(),i=Ur([n,"access",f=>f.getClient,"call",f=>f(),"optionalAccess",f=>f.getOptions,"call",f=>f()]);if(!i||i.instrumenter!=="sentry"||Ur([t,"access",f=>f.method,"optionalAccess",f=>f.toUpperCase,"call",f=>f()])==="OPTIONS"||Ur([t,"access",f=>f.method,"optionalAccess",f=>f.toUpperCase,"call",f=>f()])==="HEAD")return s();let a=t.headers&&us.isString(t.headers["sentry-trace"])?t.headers["sentry-trace"]:void 0,o=Ur([t,"access",f=>f.headers,"optionalAccess",f=>f.baggage]),{traceparentData:c,dynamicSamplingContext:l,propagationContext:u}=us.tracingContextFromHeaders(a,o);if(n.getScope().setPropagationContext(u),!dt.hasTracingEnabled(i))return s();let[p,h]=us.extractPathForTransaction(t,{path:!0,method:!0}),d=dt.startTransaction({name:p,op:"http.server",origin:"auto.http.node.tracingHandler",...c,metadata:{dynamicSamplingContext:c&&!l?{}:l,request:t,source:h}},{request:dD.extractRequestData(t)});n.configureScope(f=>{f.setSpan(d)}),e.__sentry_transaction=d,e.once("finish",()=>{setImmediate(()=>{us.addRequestDataToTransaction(d,t),d.setHttpStatus(e.statusCode),d.finish()})}),s()}}function mD(r={}){let t;if("include"in r)t={include:r.include};else{let{ip:e,request:s,transaction:n,user:i}=r;(e||s||n||i)&&(t={include:us.dropUndefinedKeys({ip:e,request:s,transaction:n,user:i})})}return t}function yD(r){let t=mD(r),e=dt.getCurrentHub(),s=e.getClient();if(s&&Lo.isAutoSessionTrackingEnabled(s)){s.initSessionFlusher();let n=e.getScope();n.getSession()&&n.setSession()}return function(i,a,o){if(r&&r.flushTimeout&&r.flushTimeout>0){let c=a.end;a.end=function(l,u,p){dt.flush(r.flushTimeout).then(()=>{c.call(this,l,u,p)}).then(null,h=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&us.logger.error(h),c.call(this,l,u,p)})}}dt.runWithAsyncContext(()=>{let c=dt.getCurrentHub();c.configureScope(l=>{l.setSDKProcessingMetadata({request:i,requestDataOptionsFromExpressHandler:t});let u=c.getClient();Lo.isAutoSessionTrackingEnabled(u)&&c.getScope().setRequestSession({status:"ok"})}),a.once("finish",()=>{let l=c.getClient();Lo.isAutoSessionTrackingEnabled(l)&&setImmediate(()=>{l&&l._captureRequestSession&&l._captureRequestSession()})}),o()})}}function gD(r){let t=r.status||r.statusCode||r.status_code||r.output&&r.output.statusCode;return t?parseInt(t,10):500}function bD(r){return gD(r)>=500}function SD(r){return function(e,s,n,i){if((r&&r.shouldHandleError||bD)(e)){dt.withScope(o=>{o.setSDKProcessingMetadata({request:s});let c=n.__sentry_transaction;c&&o.getSpan()===void 0&&o.setSpan(c);let l=dt.getCurrentHub().getClient();if(l&&Lo.isAutoSessionTrackingEnabled(l)&&l._sessionFlusher!==void 0){let h=o.getRequestSession();h&&h.status!==void 0&&(h.status="crashed")}o.addEventProcessor(p=>(us.addExceptionMechanism(p,{type:"middleware",handled:!1}),p));let u=dt.captureException(e);n.sentry=u,i(e)});return}i(e)}}function _D(r={}){return function({path:t,type:e,next:s,rawInput:n}){let i=dt.getCurrentHub(),a=Ur([i,"access",c=>c.getClient,"call",c=>c(),"optionalAccess",c=>c.getOptions,"call",c=>c()]),o=i.getScope().getTransaction();if(o){o.setName(`trpc/${t}`,"route"),o.op="rpc.server";let c={procedure_type:e};(r.attachRpcInput!==void 0?r.attachRpcInput:Ur([a,"optionalAccess",l=>l.sendDefaultPii]))&&(c.input=us.normalize(n)),o.setContext("trpc",c)}return s()}}ps.extractRequestData=CS.extractRequestData;ps.parseRequest=CS.parseRequest;ps.errorHandler=SD;ps.requestHandler=yD;ps.tracingHandler=fD;ps.trpcMiddleware=_D});var IS=_(He=>{Object.defineProperty(He,"__esModule",{value:!0});var xD=ch(),ED=hh(),TD=gh(),PD=Sh(),vD=xh(),AD=Ph(),CD=Ch(),wD=wh(),ID=Mh(),ND=Fh(),kD=jh();He.Console=xD.Console;He.Http=ED.Http;He.OnUncaughtException=TD.OnUncaughtException;He.OnUnhandledRejection=PD.OnUnhandledRejection;He.LinkedErrors=vD.LinkedErrors;He.Modules=AD.Modules;He.ContextLines=CD.ContextLines;He.Context=wD.Context;He.RequestData=ID.RequestData;He.LocalVariables=ND.LocalVariables;He.Undici=kD.Undici});var NS=_(Wt=>{Object.defineProperty(Wt,"__esModule",{value:!0});var Gs=Rp();Wt.Apollo=Gs.Apollo;Wt.Express=Gs.Express;Wt.GraphQL=Gs.GraphQL;Wt.Mongo=Gs.Mongo;Wt.Mysql=Gs.Mysql;Wt.Postgres=Gs.Postgres;Wt.Prisma=Gs.Prisma});var kS=_(j=>{Object.defineProperty(j,"__esModule",{value:!0});var V=ie(),DD=fb(),OD=Gp(),MD=th(),Ro=Gh(),Vh=di(),LD=PS(),RD=qh(),FD=wS(),BD=IS(),jD=NS(),UD={...V.Integrations,...BD,...jD};j.Hub=V.Hub;j.SDK_VERSION=V.SDK_VERSION;j.Scope=V.Scope;j.addBreadcrumb=V.addBreadcrumb;j.addGlobalEventProcessor=V.addGlobalEventProcessor;j.captureCheckIn=V.captureCheckIn;j.captureEvent=V.captureEvent;j.captureException=V.captureException;j.captureMessage=V.captureMessage;j.close=V.close;j.configureScope=V.configureScope;j.createTransport=V.createTransport;j.extractTraceparentData=V.extractTraceparentData;j.flush=V.flush;j.getActiveSpan=V.getActiveSpan;j.getActiveTransaction=V.getActiveTransaction;j.getCurrentHub=V.getCurrentHub;j.getHubFromCarrier=V.getHubFromCarrier;j.lastEventId=V.lastEventId;j.makeMain=V.makeMain;j.runWithAsyncContext=V.runWithAsyncContext;j.setContext=V.setContext;j.setExtra=V.setExtra;j.setExtras=V.setExtras;j.setMeasurement=V.setMeasurement;j.setTag=V.setTag;j.setTags=V.setTags;j.setUser=V.setUser;j.spanStatusfromHttpCode=V.spanStatusfromHttpCode;j.startActiveSpan=V.startActiveSpan;j.startInactiveSpan=V.startInactiveSpan;j.startSpan=V.startSpan;j.startSpanManual=V.startSpanManual;j.startTransaction=V.startTransaction;j.trace=V.trace;j.withScope=V.withScope;j.autoDiscoverNodePerformanceMonitoringIntegrations=DD.autoDiscoverNodePerformanceMonitoringIntegrations;j.NodeClient=OD.NodeClient;j.makeNodeTransport=MD.makeNodeTransport;j.defaultIntegrations=Ro.defaultIntegrations;j.defaultStackParser=Ro.defaultStackParser;j.getSentryRelease=Ro.getSentryRelease;j.init=Ro.init;j.DEFAULT_USER_INCLUDES=Vh.DEFAULT_USER_INCLUDES;j.addRequestDataToEvent=Vh.addRequestDataToEvent;j.extractRequestData=Vh.extractRequestData;j.deepReadDirSync=LD.deepReadDirSync;j.getModuleFromFilename=RD.getModuleFromFilename;j.Handlers=FD;j.Integrations=UD});import{access as qD,mkdir as GD,readdir as OS,readFile as $D,stat as HD,unlink as VD,writeFile as YD}from"node:fs/promises";import{createHash as WD}from"node:crypto";import{existsSync as Be,readdirSync as zD,readFileSync as JD,statSync as KD,unlinkSync as XD}from"node:fs";import{homedir as QD,hostname as ZD}from"node:os";import X from"node:path";import DS from"prettier";import eO from"typescript";import tO from"launch-editor";async function Yh(r,t){let e=r.resolve("/");for(let s=0;s<20;s++){let n=r.join(t,"package.json"),i=await r.readFile(n);if(i)return JSON.parse(i);if(t===e)break;t=r.dirname(t)}return null}var Jh=gi(zh(),1);function Kh(){try{let r=(0,Jh.default)();if(r?.name)return r.name}catch{}return"npm"}async function Qh(r){let t=[],e=await Yh(r,r.getRepoRootDir());if(e){let s=await XS(e,r);t.push(...s)}return t}async function XS(r,t){let e=[];if(r&&typeof r=="object"){let s=new Set(Object.keys({...r.dependencies,...r.devDependencies}));for(let n of QS)if(s.has(n)&&!e.some(i=>i.name===n)){let i={name:n};Xh.has(n)&&(i.version=await Xh.get(n)(t)),e.push(i)}}return e}function qo(r){let t=parseInt(r);return Number.isNaN(t)?void 0:t}var Xh=new Map([["next",async r=>{if(!r.spawnSync)return;let t=Kh(),e=t==="npm"?"npx":t,{stdout:s}=r.spawnSync(e,["next","-v"],{encoding:"utf8"});if(!s)return;let n=s.match(/(Next.js v)([\d.]+)/g);if(!n)return;let i=n[0].split("Next.js v")[1],[a,o,c]=i.split(".");return{major:qo(a),minor:qo(o),patch:qo(c)}}]]),QS=["@shopify/remix-oxygen","@shopify/hydrogen","@builder.io/qwik-city","@remix-run/react","@sveltejs/kit","astro","gatsby","next","nuxt","@builder.io/qwik","@angular/core","react","solid-js","svelte","vue"];import{spawnSync as fi}from"node:child_process";var tl={};zS(tl,{MagicastError:()=>Ce,builders:()=>yT,detectCodeFormat:()=>Xf,generateCode:()=>el,loadFile:()=>fT,parseExpression:()=>Zf,parseModule:()=>Qf,writeFile:()=>mT});import{promises as jc}from"node:fs";var zi=gi(Pd(),1),gf=gi(tf(),1);function qe(r){var t=r.use(ae),e=t.Type,s=t.builtInTypes,n=s.number;function i(l){return e.from(u=>n.check(u)&&u>=l,n+" >= "+l)}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(s.string,s.number,s.boolean,s.null,s.undefined);let c=e.from(l=>{if(l===null)return!0;var u=typeof l;return!(u==="object"||u==="function")},o.toString());return{geq:i,defaults:a,isPrimitive:c}}function Q(r){try{var t=r(),e=t.exports,s=e.default}catch{return}s&&s!==e&&typeof e=="object"&&(Object.assign(s,e,{default:s}),e.__esModule&&Object.defineProperty(s,"__esModule",{value:!0}),t.exports=s)}var qx=Object.defineProperty,Gx=(r,t,e)=>t in r?qx(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Oe=(r,t,e)=>(Gx(r,typeof t!="symbol"?t+"":t,e),e),bf=Object.prototype,qi=bf.toString,ze=bf.hasOwnProperty,Ss=class{assert(t,e){if(!this.check(t,e)){var s=Jc(t);throw new Error(s+" does not match type "+this)}return!0}arrayOf(){let t=this;return new un(t)}},un=class extends Ss{constructor(t){super(),this.elemType=t,Oe(this,"kind","ArrayType")}toString(){return"["+this.elemType+"]"}check(t,e){return Array.isArray(t)&&t.every(s=>this.elemType.check(s,e))}},Gi=class extends Ss{constructor(t){super(),this.value=t,Oe(this,"kind","IdentityType")}toString(){return String(this.value)}check(t,e){let s=t===this.value;return!s&&typeof e=="function"&&e(this,t),s}},$i=class extends Ss{constructor(t){super(),this.fields=t,Oe(this,"kind","ObjectType")}toString(){return"{ "+this.fields.join(", ")+" }"}check(t,e){return qi.call(t)===qi.call({})&&this.fields.every(s=>s.type.check(t[s.name],e))}},Hi=class extends Ss{constructor(t){super(),this.types=t,Oe(this,"kind","OrType")}toString(){return this.types.join(" | ")}check(t,e){return this.types.some(s=>s.check(t,!!e))?!0:(typeof e=="function"&&e(this,t),!1)}},bs=class extends Ss{constructor(t,e){super(),this.name=t,this.predicate=e,Oe(this,"kind","PredicateType")}toString(){return this.name}check(t,e){let s=this.predicate(t,e);return!s&&typeof e=="function"&&e(this,t),s}},cn=class r{constructor(t,e){this.type=t,this.typeName=e,Oe(this,"baseNames",[]),Oe(this,"ownFields",Object.create(null)),Oe(this,"allSupertypes",Object.create(null)),Oe(this,"supertypeList",[]),Oe(this,"allFields",Object.create(null)),Oe(this,"fieldNames",[]),Oe(this,"finalized",!1),Oe(this,"buildable",!1),Oe(this,"buildParams",[])}isSupertypeOf(t){if(t instanceof r){if(this.finalized!==!0||t.finalized!==!0)throw new Error("");return ze.call(t.allSupertypes,this.typeName)}else throw new Error(t+" is not a Def")}checkAllFields(t,e){var s=this.allFields;if(this.finalized!==!0)throw new Error(""+this.typeName);function n(i){var a=s[i],o=a.type,c=a.getValue(t);return o.check(c,e)}return t!==null&&typeof t=="object"&&Object.keys(s).every(n)}bases(...t){var e=this.baseNames;if(this.finalized){if(t.length!==e.length)throw new Error("");for(var s=0;s<t.length;s++)if(t[s]!==e[s])throw new Error("");return this}return t.forEach(n=>{e.indexOf(n)<0&&e.push(n)}),this}},Vi=class{constructor(t,e,s,n){this.name=t,this.type=e,this.defaultFn=s,Oe(this,"hidden"),this.hidden=!!n}toString(){return JSON.stringify(this.name)+": "+this.type}getValue(t){var e=t[this.name];return typeof e<"u"||typeof this.defaultFn=="function"&&(e=this.defaultFn.call(t)),e}};function Jc(r){return Array.isArray(r)?"["+r.map(Jc).join(", ")+"]":r&&typeof r=="object"?"{ "+Object.keys(r).map(function(t){return t+": "+r[t]}).join(", ")+" }":JSON.stringify(r)}function ae(r){let t={or(...C){return new Hi(C.map(w=>t.from(w)))},from(C,w){if(C instanceof un||C instanceof Gi||C instanceof $i||C instanceof Hi||C instanceof bs)return C;if(C instanceof cn)return C.type;if(o.check(C)){if(C.length!==1)throw new Error("only one element type is permitted for typed arrays");return new un(t.from(C[0]))}if(c.check(C))return new $i(Object.keys(C).map(q=>new Vi(q,t.from(C[q],q))));if(typeof C=="function"){var B=e.indexOf(C);if(B>=0)return s[B];if(typeof w!="string")throw new Error("missing name");return new bs(w,C)}return new Gi(C)},def(C){return ze.call(b,C)?b[C]:b[C]=new N(C)},hasDef(C){return ze.call(b,C)}};var e=[],s=[];function n(C,w){let B=qi.call(w),q=new bs(C,Z=>qi.call(Z)===B);return w&&typeof w.constructor=="function"&&(e.push(w.constructor),s.push(q)),q}let i=n("string","truthy"),a=n("function",function(){}),o=n("array",[]),c=n("object",{}),l=n("RegExp",/./),u=n("Date",new Date),p=n("number",3),h=n("boolean",!0),d=n("null",null),f=n("undefined",void 0),m=typeof BigInt=="function"?n("BigInt",BigInt(1234)):new bs("BigInt",()=>!1),y={string:i,function:a,array:o,object:c,RegExp:l,Date:u,number:p,boolean:h,null:d,undefined:f,BigInt:m};var b=Object.create(null);function x(C){if(C&&typeof C=="object"){var w=C.type;if(typeof w=="string"&&ze.call(b,w)){var B=b[w];if(B.finalized)return B}}return null}class N extends cn{constructor(w){super(new bs(w,(B,q)=>this.check(B,q)),w)}check(w,B){if(this.finalized!==!0)throw new Error("prematurely checking unfinalized type "+this.typeName);if(w===null||typeof w!="object")return!1;var q=x(w);return q?B&&q===this?this.checkAllFields(w,B):this.isSupertypeOf(q)?B?q.checkAllFields(w,B)&&this.checkAllFields(w,!1):!0:!1:this.typeName==="SourceLocation"||this.typeName==="Position"?this.checkAllFields(w,B):!1}build(...w){if(this.buildParams=w,this.buildable)return this;this.field("type",String,()=>this.typeName),this.buildable=!0;let B=(Z,te,ne,Ye)=>{if(!ze.call(Z,te)){var Ct=this.allFields;if(!ze.call(Ct,te))throw new Error(""+te);var yi=Ct[te],US=yi.type,qr;if(Ye)qr=ne;else if(yi.defaultFn)qr=yi.defaultFn.call(Z);else{var qS="no value or default function given for field "+JSON.stringify(te)+" of "+this.typeName+"("+this.buildParams.map(function(GS){return Ct[GS]}).join(", ")+")";throw new Error(qS)}if(!US.check(qr))throw new Error(Jc(qr)+" does not match field "+yi+" of type "+this.typeName);Z[te]=qr}},q=(...Z)=>{var te=Z.length;if(!this.finalized)throw new Error("attempting to instantiate unfinalized type "+this.typeName);var ne=Object.create(k);if(this.buildParams.forEach(function(Ye,Ct){Ct<te?B(ne,Ye,Z[Ct],!0):B(ne,Ye,null,!1)}),Object.keys(this.allFields).forEach(function(Ye){B(ne,Ye,null,!1)}),ne.type!==this.typeName)throw new Error("");return ne};return q.from=Z=>{if(!this.finalized)throw new Error("attempting to instantiate unfinalized type "+this.typeName);var te=Object.create(k);if(Object.keys(this.allFields).forEach(function(ne){ze.call(Z,ne)?B(te,ne,Z[ne],!0):B(te,ne,null,!1)}),te.type!==this.typeName)throw new Error("");return te},Object.defineProperty(A,xe(this.typeName),{enumerable:!0,value:q}),this}field(w,B,q,Z){return this.finalized?(console.error("Ignoring attempt to redefine field "+JSON.stringify(w)+" of finalized type "+JSON.stringify(this.typeName)),this):(this.ownFields[w]=new Vi(w,t.from(B),q,Z),this)}finalize(){if(!this.finalized){var w=this.allFields,B=this.allSupertypes;this.baseNames.forEach(Z=>{var te=b[Z];if(te instanceof cn)te.finalize(),jo(w,te.allFields),jo(B,te.allSupertypes);else{var ne="unknown supertype name "+JSON.stringify(Z)+" for subtype "+JSON.stringify(this.typeName);throw new Error(ne)}}),jo(w,this.ownFields),B[this.typeName]=this,this.fieldNames.length=0;for(var q in w)ze.call(w,q)&&!w[q].hidden&&this.fieldNames.push(q);Object.defineProperty(mi,this.typeName,{enumerable:!0,value:this.type}),this.finalized=!0,BS(this.typeName,this.supertypeList),this.buildable&&this.supertypeList.lastIndexOf("Expression")>=0&&FS(this.typeName)}}}function T(C){if(!ze.call(b,C))throw new Error("");var w=b[C];if(w.finalized!==!0)throw new Error("");return w.supertypeList.slice(1)}function P(C){for(var w={},B=Object.keys(b),q=B.length,Z=0;Z<q;++Z){var te=B[Z],ne=b[te];if(ne.finalized!==!0)throw new Error(""+te);for(var Ye=0;Ye<ne.supertypeList.length;++Ye){var Ct=ne.supertypeList[Ye];if(ze.call(C,Ct)){w[te]=Ct;break}}}return w}var A=Object.create(null),k={};function H(C,w){var B=k[C];return f.check(w)?delete k[C]:(a.assert(w),Object.defineProperty(k,C,{enumerable:!0,configurable:!0,value:w})),B}function xe(C){return C.replace(/^[A-Z]+/,function(w){var B=w.length;switch(B){case 0:return"";case 1:return w.toLowerCase();default:return w.slice(0,B-1).toLowerCase()+w.charAt(B-1)}})}function Ve(C){return C=xe(C),C.replace(/(Expression)?$/,"Statement")}var mi={};function Fo(C){var w=x(C);if(w)return w.fieldNames.slice(0);if("type"in C)throw new Error("did not recognize object of type "+JSON.stringify(C.type));return Object.keys(C)}function Bo(C,w){var B=x(C);if(B){var q=B.allFields[w];if(q)return q.getValue(C)}return C&&C[w]}function LS(C,w,B){Fo(C).forEach(function(q){w.call(this,q,Bo(C,q))},B)}function RS(C,w,B){return Fo(C).some(function(q){return w.call(this,q,Bo(C,q))},B)}function FS(C){var w=Ve(C);if(A[w])return;var B=A[xe(C)];if(!B)return;let q=function(...Z){return A.expressionStatement(B.apply(A,Z))};q.from=function(...Z){return A.expressionStatement(B.from.apply(A,Z))},A[w]=q}function BS(C,w){w.length=0,w.push(C);for(var B=Object.create(null),q=0;q<w.length;++q){C=w[q];var Z=b[C];if(Z.finalized!==!0)throw new Error("");ze.call(B,C)&&delete w[B[C]],B[C]=q,w.push.apply(w,Z.baseNames)}for(var te=0,ne=te,Ye=w.length;ne<Ye;++ne)ze.call(w,ne)&&(w[te++]=w[ne]);w.length=te}function jo(C,w){return Object.keys(w).forEach(function(B){C[B]=w[B]}),C}function jS(){Object.keys(b).forEach(function(C){b[C].finalize()})}return{Type:t,builtInTypes:y,getSupertypeNames:T,computeSupertypeLookupTable:P,builders:A,defineMethod:H,getBuilderName:xe,getStatementBuilderName:Ve,namedTypes:mi,getFieldNames:Fo,getFieldValue:Bo,eachField:LS,someField:RS,finalize:jS}}Q(()=>module);var $x=Object.prototype,Di=$x.hasOwnProperty;function Sf(r){var t=r.use(ae),e=t.builtInTypes.array,s=t.builtInTypes.number;let n=function p(h,d,f){if(!(this instanceof p))throw new Error("Path constructor cannot be invoked without 'new'");if(d){if(!(d instanceof p))throw new Error("")}else d=null,f=null;this.value=h,this.parentPath=d,this.name=f,this.__childCache=null};var i=n.prototype;function a(p){return p.__childCache||(p.__childCache=Object.create(null))}function o(p,h){var d=a(p),f=p.getValueProperty(h),m=d[h];return(!Di.call(d,h)||m.value!==f)&&(m=d[h]=new p.constructor(f,p,h)),m}i.getValueProperty=function(h){return this.value[h]},i.get=function(...h){for(var d=this,f=h.length,m=0;m<f;++m)d=o(d,h[m]);return d},i.each=function(h,d){for(var f=[],m=this.value.length,y=0,y=0;y<m;++y)Di.call(this.value,y)&&(f[y]=this.get(y));for(d=d||this,y=0;y<m;++y)Di.call(f,y)&&h.call(d,f[y])},i.map=function(h,d){var f=[];return this.each(function(m){f.push(h.call(this,m))},d),f},i.filter=function(h,d){var f=[];return this.each(function(m){h.call(this,m)&&f.push(m)},d),f};function c(){}function l(p,h,d,f){if(e.assert(p.value),h===0)return c;var m=p.value.length;if(m<1)return c;var y=arguments.length;y===2?(d=0,f=m):y===3?(d=Math.max(d,0),f=m):(d=Math.max(d,0),f=Math.min(f,m)),s.assert(d),s.assert(f);for(var b=Object.create(null),x=a(p),N=d;N<f;++N)if(Di.call(p.value,N)){var T=p.get(N);if(T.name!==N)throw new Error("");var P=N+h;T.name=P,b[P]=T,delete x[N]}return delete x.length,function(){for(var A in b){var k=b[A];if(k.name!==+A)throw new Error("");x[A]=k,p.value[A]=k.value}}}i.shift=function(){var h=l(this,-1),d=this.value.shift();return h(),d},i.unshift=function(...h){var d=l(this,h.length),f=this.value.unshift.apply(this.value,h);return d(),f},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 d=arguments.length,f=l(this,d-1,h);if(f===c&&d<=1)return this;h=Math.max(h,0);for(var m=1;m<d;++m)this.value[h+m-1]=arguments[m];return f(),this},i.insertBefore=function(...h){for(var d=this.parentPath,f=h.length,m=[this.name],y=0;y<f;++y)m.push(h[y]);return d.insertAt.apply(d,m)},i.insertAfter=function(...h){for(var d=this.parentPath,f=h.length,m=[this.name+1],y=0;y<f;++y)m.push(h[y]);return d.insertAt.apply(d,m)};function u(p){if(!(p instanceof n))throw new Error("");var h=p.parentPath;if(!h)return p;var d=h.value,f=a(h);if(d[p.name]===p.value)f[p.name]=p;else if(e.check(d)){var m=d.indexOf(p.value);m>=0&&(f[p.name=m]=p)}else d[p.name]=p.value,f[p.name]=p;if(d[p.name]!==p.value)throw new Error("");if(p.parentPath.get(p.name)!==p)throw new Error("");return p}return i.replace=function(h){var d=[],f=this.parentPath.value,m=a(this.parentPath),y=arguments.length;if(u(this),e.check(f)){for(var b=f.length,x=l(this.parentPath,y-1,this.name+1),N=[this.name,1],T=0;T<y;++T)N.push(arguments[T]);var P=f.splice.apply(f,N);if(P[0]!==this.value)throw new Error("");if(f.length!==b-1+y)throw new Error("");if(x(),y===0)delete this.value,delete m[this.name],this.__childCache=null;else{if(f[this.name]!==h)throw new Error("");for(this.value!==h&&(this.value=h,this.__childCache=null),T=0;T<y;++T)d.push(this.parentPath.get(this.name+T));if(d[0]!==this)throw new Error("")}}else if(y===1)this.value!==h&&(this.__childCache=null),this.value=f[this.name]=h,d.push(this);else if(y===0)delete f[this.name],delete this.value,this.__childCache=null;else throw new Error("Could not replace path");return d},n}Q(()=>module);var er=Object.prototype.hasOwnProperty;function Hx(r){var t=r.use(ae),e=t.Type,s=t.namedTypes,n=s.Node,i=s.Expression,a=t.builtInTypes.array,o=t.builders;let c=function T(P,A){if(!(this instanceof T))throw new Error("Scope constructor cannot be invoked without 'new'");u.check(P.value)||l.assert(P.value);var k;if(A){if(!(A instanceof T))throw new Error("");k=A.depth+1}else A=null,k=0;Object.defineProperties(this,{path:{value:P},node:{value:P.value},isGlobal:{value:!A,enumerable:!0},depth:{value:k},parent:{value:A},bindings:{value:{}},types:{value:{}}})};var l=e.or(s.Program,s.Function,s.CatchClause),u=e.or(s.Function,s.ClassDeclaration,s.ClassExpression,s.InterfaceDeclaration,s.TSInterfaceDeclaration,s.TypeAlias,s.TSTypeAliasDeclaration),p=e.or(s.TypeParameter,s.TSTypeParameter);c.isEstablishedBy=function(T){return l.check(T)||u.check(T)};var h=c.prototype;h.didScan=!1,h.declares=function(T){return this.scan(),er.call(this.bindings,T)},h.declaresType=function(T){return this.scan(),er.call(this.types,T)},h.declareTemporary=function(T){if(T){if(!/^[a-z$_]/i.test(T))throw new Error("")}else T="t$";T+=this.depth.toString(36)+"$",this.scan();for(var P=0;this.declares(T+P);)++P;var A=T+P;return this.bindings[A]=t.builders.identifier(A)},h.injectTemporary=function(T,P){T||(T=this.declareTemporary());var A=this.path.get("body");return s.BlockStatement.check(A.value)&&(A=A.get("body")),A.unshift(o.variableDeclaration("var",[o.variableDeclarator(T,P||null)])),T},h.scan=function(T){if(T||!this.didScan){for(var P in this.bindings)delete this.bindings[P];for(var P in this.types)delete this.types[P];d(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 d(T,P,A){var k=T.value;if(u.check(k)){let H=T.get("typeParameters","params");a.check(H.value)&&H.each(xe=>{N(xe,A)})}l.check(k)&&(s.CatchClause.check(k)?b(T.get("param"),P):f(T,P,A))}function f(T,P,A){var k=T.value;T.parent&&s.FunctionExpression.check(T.parent.node)&&T.parent.node.id&&b(T.parent.get("id"),P),k&&(a.check(k)?T.each(H=>{y(H,P,A)}):s.Function.check(k)?(T.get("params").each(H=>{b(H,P)}),y(T.get("body"),P,A),f(T.get("typeParameters"),P,A)):s.TypeAlias&&s.TypeAlias.check(k)||s.InterfaceDeclaration&&s.InterfaceDeclaration.check(k)||s.TSTypeAliasDeclaration&&s.TSTypeAliasDeclaration.check(k)||s.TSInterfaceDeclaration&&s.TSInterfaceDeclaration.check(k)?x(T.get("id"),A):s.VariableDeclarator.check(k)?(b(T.get("id"),P),y(T.get("init"),P,A)):k.type==="ImportSpecifier"||k.type==="ImportNamespaceSpecifier"||k.type==="ImportDefaultSpecifier"?b(T.get(k.local?"local":k.name?"name":"id"),P):n.check(k)&&!i.check(k)&&t.eachField(k,function(H,xe){var Ve=T.get(H);if(!m(Ve,xe))throw new Error("");y(Ve,P,A)}))}function m(T,P){return!!(T.value===P||Array.isArray(T.value)&&T.value.length===0&&Array.isArray(P)&&P.length===0)}function y(T,P,A){var k=T.value;if(!(!k||i.check(k)))if(s.FunctionDeclaration.check(k)&&k.id!==null)b(T.get("id"),P);else if(s.ClassDeclaration&&s.ClassDeclaration.check(k)&&k.id!==null)b(T.get("id"),P),f(T.get("typeParameters"),P,A);else if(s.InterfaceDeclaration&&s.InterfaceDeclaration.check(k)||s.TSInterfaceDeclaration&&s.TSInterfaceDeclaration.check(k))x(T.get("id"),A);else if(l.check(k)){if(s.CatchClause.check(k)&&s.Identifier.check(k.param)){var H=k.param.name,xe=er.call(P,H);f(T.get("body"),P,A),xe||delete P[H]}}else f(T,P,A)}function b(T,P){var A=T.value;s.Pattern.assert(A),s.Identifier.check(A)?er.call(P,A.name)?P[A.name].push(T):P[A.name]=[T]:s.AssignmentPattern&&s.AssignmentPattern.check(A)?b(T.get("left"),P):s.ObjectPattern&&s.ObjectPattern.check(A)?T.get("properties").each(function(k){var H=k.value;s.Pattern.check(H)?b(k,P):s.Property.check(H)||s.ObjectProperty&&s.ObjectProperty.check(H)?b(k.get("value"),P):s.SpreadProperty&&s.SpreadProperty.check(H)&&b(k.get("argument"),P)}):s.ArrayPattern&&s.ArrayPattern.check(A)?T.get("elements").each(function(k){var H=k.value;s.Pattern.check(H)?b(k,P):s.SpreadElement&&s.SpreadElement.check(H)&&b(k.get("argument"),P)}):s.PropertyPattern&&s.PropertyPattern.check(A)?b(T.get("pattern"),P):(s.SpreadElementPattern&&s.SpreadElementPattern.check(A)||s.RestElement&&s.RestElement.check(A)||s.SpreadPropertyPattern&&s.SpreadPropertyPattern.check(A))&&b(T.get("argument"),P)}function x(T,P){var A=T.value;s.Pattern.assert(A),s.Identifier.check(A)&&(er.call(P,A.name)?P[A.name].push(T):P[A.name]=[T])}function N(T,P){var A=T.value;p.assert(A),er.call(P,A.name)?P[A.name].push(T):P[A.name]=[T]}return h.lookup=function(T){for(var P=this;P&&!P.declares(T);P=P.parent);return P},h.lookupType=function(T){for(var P=this;P&&!P.declaresType(T);P=P.parent);return P},h.getGlobalScope=function(){for(var T=this;!T.isGlobal;)T=T.parent;return T},c}Q(()=>module);function _f(r){var t=r.use(ae),e=t.namedTypes,s=t.builders,n=t.builtInTypes.number,i=t.builtInTypes.array,a=r.use(Sf),o=r.use(Hx);let c=function y(b,x,N){if(!(this instanceof y))throw new Error("NodePath constructor cannot be invoked without 'new'");a.call(this,b,x,N)};var l=c.prototype=Object.create(a.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}});Object.defineProperties(l,{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}}}),l.replace=function(){return delete this.node,delete this.parent,delete this.scope,a.prototype.replace.apply(this,arguments)},l.prune=function(){var y=this.parent;return this.replace(),f(y)},l._computeNode=function(){var y=this.value;if(e.Node.check(y))return y;var b=this.parentPath;return b&&b.node||null},l._computeParent=function(){var y=this.value,b=this.parentPath;if(!e.Node.check(y)){for(;b&&!e.Node.check(b.value);)b=b.parentPath;b&&(b=b.parentPath)}for(;b&&!e.Node.check(b.value);)b=b.parentPath;return b||null},l._computeScope=function(){var y=this.value,b=this.parentPath,x=b&&b.scope;return e.Node.check(y)&&o.isEstablishedBy(y)&&(x=new o(this,x)),x||null},l.getValueProperty=function(y){return t.getFieldValue(this.value,y)},l.needsParens=function(y){var b=this.parentPath;if(!b)return!1;var x=this.value;if(!e.Expression.check(x)||x.type==="Identifier")return!1;for(;!e.Node.check(b.value);)if(b=b.parentPath,!b)return!1;var N=b.value;switch(x.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return N.type==="MemberExpression"&&this.name==="object"&&N.object===x;case"BinaryExpression":case"LogicalExpression":switch(N.type){case"CallExpression":return this.name==="callee"&&N.callee===x;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return this.name==="object"&&N.object===x;case"BinaryExpression":case"LogicalExpression":{let T=x,P=N.operator,A=p[P],k=T.operator,H=p[k];if(A>H)return!0;if(A===H&&this.name==="right"){if(N.right!==T)throw new Error("Nodes must be equal");return!0}}default:return!1}case"SequenceExpression":switch(N.type){case"ForStatement":return!1;case"ExpressionStatement":return this.name!=="expression";default:return!0}case"YieldExpression":switch(N.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 N.type==="MemberExpression"&&n.check(x.value)&&this.name==="object"&&N.object===x;case"AssignmentExpression":case"ConditionalExpression":switch(N.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":return this.name==="callee"&&N.callee===x;case"ConditionalExpression":return this.name==="test"&&N.test===x;case"MemberExpression":return this.name==="object"&&N.object===x;default:return!1}default:if(N.type==="NewExpression"&&this.name==="callee"&&N.callee===x)return h(x)}return!!(y!==!0&&!this.canBeFirstInStatement()&&this.firstInStatement())};function u(y){return e.BinaryExpression.check(y)||e.LogicalExpression.check(y)}var p={};[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(y,b){y.forEach(function(x){p[x]=b})});function h(y){return e.CallExpression.check(y)?!0:i.check(y)?y.some(h):e.Node.check(y)?t.someField(y,function(b,x){return h(x)}):!1}l.canBeFirstInStatement=function(){var y=this.node;return!e.FunctionExpression.check(y)&&!e.ObjectExpression.check(y)},l.firstInStatement=function(){return d(this)};function d(y){for(var b,x;y.parent;y=y.parent){if(b=y.node,x=y.parent.node,e.BlockStatement.check(x)&&y.parent.name==="body"&&y.name===0){if(x.body[0]!==b)throw new Error("Nodes must be equal");return!0}if(e.ExpressionStatement.check(x)&&y.name==="expression"){if(x.expression!==b)throw new Error("Nodes must be equal");return!0}if(e.SequenceExpression.check(x)&&y.parent.name==="expressions"&&y.name===0){if(x.expressions[0]!==b)throw new Error("Nodes must be equal");continue}if(e.CallExpression.check(x)&&y.name==="callee"){if(x.callee!==b)throw new Error("Nodes must be equal");continue}if(e.MemberExpression.check(x)&&y.name==="object"){if(x.object!==b)throw new Error("Nodes must be equal");continue}if(e.ConditionalExpression.check(x)&&y.name==="test"){if(x.test!==b)throw new Error("Nodes must be equal");continue}if(u(x)&&y.name==="left"){if(x.left!==b)throw new Error("Nodes must be equal");continue}if(e.UnaryExpression.check(x)&&!x.prefix&&y.name==="argument"){if(x.argument!==b)throw new Error("Nodes must be equal");continue}return!1}return!0}function f(y){if(e.VariableDeclaration.check(y.node)){var b=y.get("declarations").value;if(!b||b.length===0)return y.prune()}else if(e.ExpressionStatement.check(y.node)){if(!y.get("expression").value)return y.prune()}else e.IfStatement.check(y.node)&&m(y);return y}function m(y){var b=y.get("test").value,x=y.get("alternate").value,N=y.get("consequent").value;if(!N&&!x){var T=s.expressionStatement(b);y.replace(T)}else if(!N&&x){var P=s.unaryExpression("!",b,!0);e.UnaryExpression.check(b)&&b.operator==="!"&&(P=b.argument),y.get("test").replace(P),y.get("consequent").replace(x),y.get("alternate").replace()}}return c}Q(()=>module);var Oi=Object.prototype.hasOwnProperty;function Vx(r){var t=r.use(ae),e=r.use(_f),s=t.builtInTypes.array,n=t.builtInTypes.object,i=t.builtInTypes.function,a;let o=function f(){if(!(this instanceof f))throw new Error("PathVisitor constructor cannot be invoked without 'new'");this._reusableContextStack=[],this._methodNameTable=c(this),this._shouldVisitComments=Oi.call(this._methodNameTable,"Block")||Oi.call(this._methodNameTable,"Line"),this.Context=h(this),this._visiting=!1,this._changeReported=!1};function c(f){var m=Object.create(null);for(var y in f)/^visit[A-Z]/.test(y)&&(m[y.slice(5)]=!0);for(var b=t.computeSupertypeLookupTable(m),x=Object.create(null),N=Object.keys(b),T=N.length,P=0;P<T;++P){var A=N[P];y="visit"+b[A],i.check(f[y])&&(x[A]=y)}return x}o.fromMethodsObject=function(m){if(m instanceof o)return m;if(!n.check(m))return new o;let y=function x(){if(!(this instanceof x))throw new Error("Visitor constructor cannot be invoked without 'new'");o.call(this)};var b=y.prototype=Object.create(u);return b.constructor=y,l(b,m),l(y,o),i.assert(y.fromMethodsObject),i.assert(y.visit),new y};function l(f,m){for(var y in m)Oi.call(m,y)&&(f[y]=m[y]);return f}o.visit=function(m,y){return o.fromMethodsObject(y).visit(m)};var u=o.prototype;u.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 f=arguments.length,m=new Array(f),y=0;y<f;++y)m[y]=arguments[y];m[0]instanceof e||(m[0]=new e({root:m[0]}).get("root")),this.reset.apply(this,m);var b;try{var x=this.visitWithoutReset(m[0]);b=!0}finally{if(this._visiting=!1,!b&&this._abortRequested)return m[0].value}return x},u.AbortRequest=function(){},u.abort=function(){var f=this;f._abortRequested=!0;var m=new f.AbortRequest;throw m.cancel=function(){f._abortRequested=!1},m},u.reset=function(f){},u.visitWithoutReset=function(f){if(this instanceof this.Context)return this.visitor.visitWithoutReset(f);if(!(f instanceof e))throw new Error("");var m=f.value,y=m&&typeof m=="object"&&typeof m.type=="string"&&this._methodNameTable[m.type];if(y){var b=this.acquireContext(f);try{return b.invokeVisitorMethod(y)}finally{this.releaseContext(b)}}else return p(f,this)};function p(f,m){if(!(f instanceof e))throw new Error("");if(!(m instanceof o))throw new Error("");var y=f.value;if(s.check(y))f.each(m.visitWithoutReset,m);else if(n.check(y)){var b=t.getFieldNames(y);m._shouldVisitComments&&y.comments&&b.indexOf("comments")<0&&b.push("comments");for(var x=b.length,N=[],T=0;T<x;++T){var P=b[T];Oi.call(y,P)||(y[P]=t.getFieldValue(y,P)),N.push(f.get(P))}for(var T=0;T<x;++T)m.visitWithoutReset(N[T])}return f.value}u.acquireContext=function(f){return this._reusableContextStack.length===0?new this.Context(f):this._reusableContextStack.pop().reset(f)},u.releaseContext=function(f){if(!(f instanceof this.Context))throw new Error("");this._reusableContextStack.push(f),f.currentPath=null},u.reportChanged=function(){this._changeReported=!0},u.wasChangeReported=function(){return this._changeReported};function h(f){function m(b){if(!(this instanceof m))throw new Error("");if(!(this instanceof o))throw new Error("");if(!(b instanceof e))throw new Error("");Object.defineProperty(this,"visitor",{value:f,writable:!1,enumerable:!0,configurable:!1}),this.currentPath=b,this.needToCallTraverse=!0,Object.seal(this)}if(!(f instanceof o))throw new Error("");var y=m.prototype=Object.create(f);return y.constructor=m,l(y,d),m}var d=Object.create(null);return d.reset=function(m){if(!(this instanceof this.Context))throw new Error("");if(!(m instanceof e))throw new Error("");return this.currentPath=m,this.needToCallTraverse=!0,this},d.invokeVisitorMethod=function(m){if(!(this instanceof this.Context))throw new Error("");if(!(this.currentPath instanceof e))throw new Error("");var y=this.visitor[m].call(this,this.currentPath);if(y===!1?this.needToCallTraverse=!1:y!==a&&(this.currentPath=this.currentPath.replace(y)[0],this.needToCallTraverse&&this.traverse(this.currentPath)),this.needToCallTraverse!==!1)throw new Error("Must either call this.traverse or return false in "+m);var b=this.currentPath;return b&&b.value},d.traverse=function(m,y){if(!(this instanceof this.Context))throw new Error("");if(!(m instanceof e))throw new Error("");if(!(this.currentPath instanceof e))throw new Error("");return this.needToCallTraverse=!1,p(m,o.fromMethodsObject(y||this.visitor))},d.visit=function(m,y){if(!(this instanceof this.Context))throw new Error("");if(!(m instanceof e))throw new Error("");if(!(this.currentPath instanceof e))throw new Error("");return this.needToCallTraverse=!1,o.fromMethodsObject(y||this.visitor).visitWithoutReset(m)},d.reportChanged=function(){this.visitor.reportChanged()},d.abort=function(){this.needToCallTraverse=!1,this.visitor.abort()},o}Q(()=>module);function Yx(r){var t=r.use(ae),e=t.getFieldNames,s=t.getFieldValue,n=t.builtInTypes.array,i=t.builtInTypes.object,a=t.builtInTypes.Date,o=t.builtInTypes.RegExp,c=Object.prototype.hasOwnProperty;function l(f,m,y){return n.check(y)?y.length=0:y=null,p(f,m,y)}l.assert=function(f,m){var y=[];if(!l(f,m,y))if(y.length===0){if(f!==m)throw new Error("Nodes must be equal")}else throw new Error("Nodes differ in the following path: "+y.map(u).join(""))};function u(f){return/[_$a-z][_$a-z0-9]*/i.test(f)?"."+f:"["+JSON.stringify(f)+"]"}function p(f,m,y){return f===m?!0:n.check(f)?h(f,m,y):i.check(f)?d(f,m,y):a.check(f)?a.check(m)&&+f==+m:o.check(f)?o.check(m)&&f.source===m.source&&f.global===m.global&&f.multiline===m.multiline&&f.ignoreCase===m.ignoreCase:f==m}function h(f,m,y){n.assert(f);var b=f.length;if(!n.check(m)||m.length!==b)return y&&y.push("length"),!1;for(var x=0;x<b;++x){if(y&&y.push(x),x in f!=x in m||!p(f[x],m[x],y))return!1;if(y){var N=y.pop();if(N!==x)throw new Error(""+N)}}return!0}function d(f,m,y){if(i.assert(f),!i.check(m))return!1;if(f.type!==m.type)return y&&y.push("type"),!1;var b=e(f),x=b.length,N=e(m),T=N.length;if(x===T){for(var P=0;P<x;++P){var A=b[P],k=s(f,A),H=s(m,A);if(y&&y.push(A),!p(k,H,y))return!1;if(y){var xe=y.pop();if(xe!==A)throw new Error(""+xe)}}return!0}if(!y)return!1;var Ve=Object.create(null);for(P=0;P<x;++P)Ve[b[P]]=!0;for(P=0;P<T;++P){if(A=N[P],!c.call(Ve,A))return y.push(A),!1;delete Ve[A]}for(A in Ve){y.push(A);break}return!1}return l}Q(()=>module);function Wx(r){let t=zx(),e=t.use(ae);r.forEach(t.use),e.finalize();let s=t.use(Vx);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:t.use(Yx),finalize:e.finalize,Path:t.use(Sf),NodePath:t.use(_f),PathVisitor:s,use:t.use,visit:s.visit}}function zx(){let r=[],t=[];function e(n){var i=r.indexOf(n);return i===-1&&(i=r.length,r.push(n),t[i]=n(s)),t[i]}var s={use:e};return s}Q(()=>module);function xf(){return{BinaryOperators:["==","!=","===","!==","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof"],AssignmentOperators:["=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&="],LogicalOperators:["||","&&"]}}Q(()=>module);function Ef(r){let t=r.use(xf);return t.BinaryOperators.indexOf("**")<0&&t.BinaryOperators.push("**"),t.AssignmentOperators.indexOf("**=")<0&&t.AssignmentOperators.push("**="),t}Q(()=>module);function Tf(r){let t=r.use(Ef);return t.LogicalOperators.indexOf("??")<0&&t.LogicalOperators.push("??"),t}Q(()=>module);function Jx(r){let t=r.use(Tf);return t.LogicalOperators.forEach(e=>{let s=e+"=";t.AssignmentOperators.indexOf(s)<0&&t.AssignmentOperators.push(s)}),t}Q(()=>module);function Kx(r){var t=r.use(ae),e=t.Type,s=e.def,n=e.or,i=r.use(qe),a=i.defaults,o=i.geq;let{BinaryOperators:c,AssignmentOperators:l,LogicalOperators:u}=r.use(xf);s("Printable").field("loc",n(s("SourceLocation"),null),a.null,!0),s("Node").bases("Printable").field("type",String).field("comments",n([s("Comment")],null),a.null,!0),s("SourceLocation").field("start",s("Position")).field("end",s("Position")).field("source",n(String,null),a.null),s("Position").field("line",o(1)).field("column",o(0)),s("File").bases("Node").build("program","name").field("program",s("Program")).field("name",n(String,null),a.null),s("Program").bases("Node").build("body").field("body",[s("Statement")]),s("Function").bases("Node").field("id",n(s("Identifier"),null),a.null).field("params",[s("Pattern")]).field("body",s("BlockStatement")).field("generator",Boolean,a.false).field("async",Boolean,a.false),s("Statement").bases("Node"),s("EmptyStatement").bases("Statement").build(),s("BlockStatement").bases("Statement").build("body").field("body",[s("Statement")]),s("ExpressionStatement").bases("Statement").build("expression").field("expression",s("Expression")),s("IfStatement").bases("Statement").build("test","consequent","alternate").field("test",s("Expression")).field("consequent",s("Statement")).field("alternate",n(s("Statement"),null),a.null),s("LabeledStatement").bases("Statement").build("label","body").field("label",s("Identifier")).field("body",s("Statement")),s("BreakStatement").bases("Statement").build("label").field("label",n(s("Identifier"),null),a.null),s("ContinueStatement").bases("Statement").build("label").field("label",n(s("Identifier"),null),a.null),s("WithStatement").bases("Statement").build("object","body").field("object",s("Expression")).field("body",s("Statement")),s("SwitchStatement").bases("Statement").build("discriminant","cases","lexical").field("discriminant",s("Expression")).field("cases",[s("SwitchCase")]).field("lexical",Boolean,a.false),s("ReturnStatement").bases("Statement").build("argument").field("argument",n(s("Expression"),null)),s("ThrowStatement").bases("Statement").build("argument").field("argument",s("Expression")),s("TryStatement").bases("Statement").build("block","handler","finalizer").field("block",s("BlockStatement")).field("handler",n(s("CatchClause"),null),function(){return this.handlers&&this.handlers[0]||null}).field("handlers",[s("CatchClause")],function(){return this.handler?[this.handler]:[]},!0).field("guardedHandlers",[s("CatchClause")],a.emptyArray).field("finalizer",n(s("BlockStatement"),null),a.null),s("CatchClause").bases("Node").build("param","guard","body").field("param",s("Pattern")).field("guard",n(s("Expression"),null),a.null).field("body",s("BlockStatement")),s("WhileStatement").bases("Statement").build("test","body").field("test",s("Expression")).field("body",s("Statement")),s("DoWhileStatement").bases("Statement").build("body","test").field("body",s("Statement")).field("test",s("Expression")),s("ForStatement").bases("Statement").build("init","test","update","body").field("init",n(s("VariableDeclaration"),s("Expression"),null)).field("test",n(s("Expression"),null)).field("update",n(s("Expression"),null)).field("body",s("Statement")),s("ForInStatement").bases("Statement").build("left","right","body").field("left",n(s("VariableDeclaration"),s("Expression"))).field("right",s("Expression")).field("body",s("Statement")),s("DebuggerStatement").bases("Statement").build(),s("Declaration").bases("Statement"),s("FunctionDeclaration").bases("Function","Declaration").build("id","params","body").field("id",s("Identifier")),s("FunctionExpression").bases("Function","Expression").build("id","params","body"),s("VariableDeclaration").bases("Declaration").build("kind","declarations").field("kind",n("var","let","const")).field("declarations",[s("VariableDeclarator")]),s("VariableDeclarator").bases("Node").build("id","init").field("id",s("Pattern")).field("init",n(s("Expression"),null),a.null),s("Expression").bases("Node"),s("ThisExpression").bases("Expression").build(),s("ArrayExpression").bases("Expression").build("elements").field("elements",[n(s("Expression"),null)]),s("ObjectExpression").bases("Expression").build("properties").field("properties",[s("Property")]),s("Property").bases("Node").build("kind","key","value").field("kind",n("init","get","set")).field("key",n(s("Literal"),s("Identifier"))).field("value",s("Expression")),s("SequenceExpression").bases("Expression").build("expressions").field("expressions",[s("Expression")]);var p=n("-","+","!","~","typeof","void","delete");s("UnaryExpression").bases("Expression").build("operator","argument","prefix").field("operator",p).field("argument",s("Expression")).field("prefix",Boolean,a.true);let h=n(...c);s("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",h).field("left",s("Expression")).field("right",s("Expression"));let d=n(...l);s("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",d).field("left",n(s("Pattern"),s("MemberExpression"))).field("right",s("Expression"));var f=n("++","--");s("UpdateExpression").bases("Expression").build("operator","argument","prefix").field("operator",f).field("argument",s("Expression")).field("prefix",Boolean);var m=n(...u);s("LogicalExpression").bases("Expression").build("operator","left","right").field("operator",m).field("left",s("Expression")).field("right",s("Expression")),s("ConditionalExpression").bases("Expression").build("test","consequent","alternate").field("test",s("Expression")).field("consequent",s("Expression")).field("alternate",s("Expression")),s("NewExpression").bases("Expression").build("callee","arguments").field("callee",s("Expression")).field("arguments",[s("Expression")]),s("CallExpression").bases("Expression").build("callee","arguments").field("callee",s("Expression")).field("arguments",[s("Expression")]),s("MemberExpression").bases("Expression").build("object","property","computed").field("object",s("Expression")).field("property",n(s("Identifier"),s("Expression"))).field("computed",Boolean,function(){var y=this.property.type;return y==="Literal"||y==="MemberExpression"||y==="BinaryExpression"}),s("Pattern").bases("Node"),s("SwitchCase").bases("Node").build("test","consequent").field("test",n(s("Expression"),null)).field("consequent",[s("Statement")]),s("Identifier").bases("Expression","Pattern").build("name").field("name",String).field("optional",Boolean,a.false),s("Literal").bases("Expression").build("value").field("value",n(String,Boolean,null,Number,RegExp,BigInt)),s("Comment").bases("Printable").field("value",String).field("leading",Boolean,a.true).field("trailing",Boolean,a.false)}Q(()=>module);function Xx(r){r.use(Kx);let t=r.use(ae),e=t.Type.def,s=t.Type.or,n=r.use(qe).defaults;e("Function").field("generator",Boolean,n.false).field("expression",Boolean,n.false).field("defaults",[s(e("Expression"),null)],n.emptyArray).field("rest",s(e("Identifier"),null),n.null),e("RestElement").bases("Pattern").build("argument").field("argument",e("Pattern")).field("typeAnnotation",s(e("TypeAnnotation"),e("TSTypeAnnotation"),null),n.null),e("SpreadElementPattern").bases("Pattern").build("argument").field("argument",e("Pattern")),e("FunctionDeclaration").build("id","params","body","generator","expression").field("id",s(e("Identifier"),null)),e("FunctionExpression").build("id","params","body","generator","expression"),e("ArrowFunctionExpression").bases("Function","Expression").build("params","body","expression").field("id",null,n.null).field("body",s(e("BlockStatement"),e("Expression"))).field("generator",!1,n.false),e("ForOfStatement").bases("Statement").build("left","right","body").field("left",s(e("VariableDeclaration"),e("Pattern"))).field("right",e("Expression")).field("body",e("Statement")),e("YieldExpression").bases("Expression").build("argument","delegate").field("argument",s(e("Expression"),null)).field("delegate",Boolean,n.false),e("GeneratorExpression").bases("Expression").build("body","blocks","filter").field("body",e("Expression")).field("blocks",[e("ComprehensionBlock")]).field("filter",s(e("Expression"),null)),e("ComprehensionExpression").bases("Expression").build("body","blocks","filter").field("body",e("Expression")).field("blocks",[e("ComprehensionBlock")]).field("filter",s(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",s(e("Literal"),e("Identifier"),e("Expression"))).field("value",s(e("Expression"),e("Pattern"))).field("method",Boolean,n.false).field("shorthand",Boolean,n.false).field("computed",Boolean,n.false),e("ObjectProperty").field("shorthand",Boolean,n.false),e("PropertyPattern").bases("Pattern").build("key","pattern").field("key",s(e("Literal"),e("Identifier"),e("Expression"))).field("pattern",e("Pattern")).field("computed",Boolean,n.false),e("ObjectPattern").bases("Pattern").build("properties").field("properties",[s(e("PropertyPattern"),e("Property"))]),e("ArrayPattern").bases("Pattern").build("elements").field("elements",[s(e("Pattern"),null)]),e("SpreadElement").bases("Node").build("argument").field("argument",e("Expression")),e("ArrayExpression").field("elements",[s(e("Expression"),e("SpreadElement"),e("RestElement"),null)]),e("NewExpression").field("arguments",[s(e("Expression"),e("SpreadElement"))]),e("CallExpression").field("arguments",[s(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",s("constructor","method","get","set")).field("key",e("Expression")).field("value",e("Function")).field("computed",Boolean,n.false).field("static",Boolean,n.false);let i=s(e("MethodDefinition"),e("VariableDeclarator"),e("ClassPropertyDefinition"),e("ClassProperty"),e("StaticBlock"));e("ClassProperty").bases("Declaration").build("key").field("key",s(e("Literal"),e("Identifier"),e("Expression"))).field("computed",Boolean,n.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",s(e("Identifier"),null)).field("body",e("ClassBody")).field("superClass",s(e("Expression"),null),n.null),e("ClassExpression").bases("Expression").build("id","body","superClass").field("id",s(e("Identifier"),null),n.null).field("body",e("ClassBody")).field("superClass",s(e("Expression"),null),n.null),e("Super").bases("Expression").build(),e("Specifier").bases("Node"),e("ModuleSpecifier").bases("Specifier").field("local",s(e("Identifier"),null),n.null).field("id",s(e("Identifier"),null),n.null).field("name",s(e("Identifier"),null),n.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",[s(e("ImportSpecifier"),e("ImportNamespaceSpecifier"),e("ImportDefaultSpecifier"))],n.emptyArray).field("source",e("Literal")).field("importKind",s("value","type"),function(){return"value"}),e("ExportNamedDeclaration").bases("Declaration").build("declaration","specifiers","source").field("declaration",s(e("Declaration"),null)).field("specifiers",[e("ExportSpecifier")],n.emptyArray).field("source",s(e("Literal"),null),n.null),e("ExportSpecifier").bases("ModuleSpecifier").build("local","exported").field("exported",e("Identifier")),e("ExportDefaultDeclaration").bases("Declaration").build("declaration").field("declaration",s(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"))}Q(()=>module);function Qx(r){r.use(Ef),r.use(Xx)}Q(()=>module);function Zx(r){r.use(Qx);let e=r.use(ae).Type.def,s=r.use(qe).defaults;e("Function").field("async",Boolean,s.false),e("AwaitExpression").bases("Expression").build("argument").field("argument",e("Expression"))}Q(()=>module);function eE(r){r.use(Zx);let t=r.use(ae),e=t.Type.def,s=t.Type.or,n=r.use(qe).defaults;e("ForOfStatement").field("await",Boolean,n.false),e("SpreadProperty").bases("Node").build("argument").field("argument",e("Expression")),e("ObjectExpression").field("properties",[s(e("Property"),e("SpreadProperty"),e("SpreadElement"))]),e("TemplateElement").field("value",{cooked:s(String,null),raw:String}),e("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument",e("Pattern")),e("ObjectPattern").field("properties",[s(e("PropertyPattern"),e("Property"),e("RestElement"),e("SpreadPropertyPattern"))])}Q(()=>module);function tE(r){r.use(eE);let t=r.use(ae),e=t.Type.def,s=t.Type.or,n=r.use(qe).defaults;e("CatchClause").field("param",s(e("Pattern"),null),n.null)}Q(()=>module);function sE(r){r.use(Tf),r.use(tE);let t=r.use(ae),e=t.Type.def,s=t.Type.or,i=r.use(qe).defaults;e("ImportExpression").bases("Expression").build("source").field("source",e("Expression")),e("ExportAllDeclaration").bases("Declaration").build("source","exported").field("source",e("Literal")).field("exported",s(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)}Q(()=>module);function rE(r){r.use(Jx),r.use(sE)}Q(()=>module);function nE(r){r.use(rE);let e=r.use(ae).Type.def;e("StaticBlock").bases("Declaration").build("body").field("body",[e("Statement")])}Q(()=>module);function fn(r){r.use(nE);let t=r.use(ae),e=t.Type,s=t.Type.def,n=e.or,a=r.use(qe).defaults;s("AwaitExpression").build("argument","all").field("argument",n(s("Expression"),null)).field("all",Boolean,a.false),s("Decorator").bases("Node").build("expression").field("expression",s("Expression")),s("Property").field("decorators",n([s("Decorator")],null),a.null),s("MethodDefinition").field("decorators",n([s("Decorator")],null),a.null),s("PrivateName").bases("Expression","Pattern").build("id").field("id",s("Identifier")),s("ClassPrivateProperty").bases("ClassProperty").build("key","value").field("key",s("PrivateName")).field("value",n(s("Expression"),null),a.null),s("ImportAttribute").bases("Node").build("key","value").field("key",n(s("Identifier"),s("Literal"))).field("value",s("Expression")),["ImportDeclaration","ExportAllDeclaration","ExportNamedDeclaration"].forEach(o=>{s(o).field("assertions",[s("ImportAttribute")],a.emptyArray)}),s("RecordExpression").bases("Expression").build("properties").field("properties",[n(s("ObjectProperty"),s("ObjectMethod"),s("SpreadElement"))]),s("TupleExpression").bases("Expression").build("elements").field("elements",[n(s("Expression"),s("SpreadElement"),null)]),s("ModuleExpression").bases("Node").build("body").field("body",s("Program"))}Q(()=>module);function iE(r){r.use(fn);let t=r.use(ae),e=t.Type.def,s=t.Type.or,n=r.use(qe).defaults;e("JSXAttribute").bases("Node").build("name","value").field("name",s(e("JSXIdentifier"),e("JSXNamespacedName"))).field("value",s(e("Literal"),e("JSXExpressionContainer"),e("JSXElement"),e("JSXFragment"),null),n.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",s(e("JSXIdentifier"),e("JSXMemberExpression"))).field("property",e("JSXIdentifier")).field("computed",Boolean,n.false);let i=s(e("JSXIdentifier"),e("JSXNamespacedName"),e("JSXMemberExpression"));e("JSXSpreadAttribute").bases("Node").build("argument").field("argument",e("Expression"));let a=[s(e("JSXAttribute"),e("JSXSpreadAttribute"))];e("JSXExpressionContainer").bases("Expression").build("expression").field("expression",s(e("Expression"),e("JSXEmptyExpression")));let o=[s(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",s(e("JSXClosingElement"),null),n.null).field("children",o,n.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,n.emptyArray).field("selfClosing",Boolean,n.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,n.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"))}Q(()=>module);function Pf(r){var t=r.use(ae),e=t.Type.def,s=t.Type.or,n=r.use(qe).defaults,i=s(e("TypeAnnotation"),e("TSTypeAnnotation"),null),a=s(e("TypeParameterDeclaration"),e("TSTypeParameterDeclaration"),null);e("Identifier").field("typeAnnotation",i,n.null),e("ObjectPattern").field("typeAnnotation",i,n.null),e("Function").field("returnType",i,n.null).field("typeParameters",a,n.null),e("ClassProperty").build("key","value","typeAnnotation","static").field("value",s(e("Expression"),null)).field("static",Boolean,n.false).field("typeAnnotation",i,n.null),["ClassDeclaration","ClassExpression"].forEach(o=>{e(o).field("typeParameters",a,n.null).field("superTypeParameters",s(e("TypeParameterInstantiation"),e("TSTypeParameterInstantiation"),null),n.null).field("implements",s([e("ClassImplements")],[e("TSExpressionWithTypeArguments")]),n.emptyArray)})}Q(()=>module);function vf(r){r.use(fn),r.use(Pf);let t=r.use(ae),e=t.Type.def,s=t.Type.or,n=r.use(qe).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",s(e("FunctionTypeParam"),null)).field("typeParameters",s(e("TypeParameterDeclaration"),null)),e("FunctionTypeParam").bases("Node").build("name","typeAnnotation","optional").field("name",s(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",[s(e("ObjectTypeProperty"),e("ObjectTypeSpreadProperty"))]).field("indexers",[e("ObjectTypeIndexer")],n.emptyArray).field("callProperties",[e("ObjectTypeCallProperty")],n.emptyArray).field("inexact",s(Boolean,void 0),n.undefined).field("exact",Boolean,n.false).field("internalSlots",[e("ObjectTypeInternalSlot")],n.emptyArray),e("Variance").bases("Node").build("kind").field("kind",s("plus","minus"));let i=s(e("Variance"),"plus","minus",null);e("ObjectTypeProperty").bases("Node").build("key","value","optional").field("key",s(e("Literal"),e("Identifier"))).field("value",e("FlowType")).field("optional",Boolean).field("variance",i,n.null),e("ObjectTypeIndexer").bases("Node").build("id","key","value").field("id",e("Identifier")).field("key",e("FlowType")).field("value",e("FlowType")).field("variance",i,n.null).field("static",Boolean,n.false),e("ObjectTypeCallProperty").bases("Node").build("value").field("value",e("FunctionTypeAnnotation")).field("static",Boolean,n.false),e("QualifiedTypeIdentifier").bases("Node").build("qualification","id").field("qualification",s(e("Identifier"),e("QualifiedTypeIdentifier"))).field("id",e("Identifier")),e("GenericTypeAnnotation").bases("FlowType").build("id","typeParameters").field("id",s(e("Identifier"),e("QualifiedTypeIdentifier"))).field("typeParameters",s(e("TypeParameterInstantiation"),null)),e("MemberTypeAnnotation").bases("FlowType").build("object","property").field("object",e("Identifier")).field("property",s(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,n.null).field("bound",s(e("TypeAnnotation"),null),n.null).field("default",s(e("FlowType"),null),n.null),e("ClassProperty").field("variance",i,n.null),e("ClassImplements").bases("Node").build("id").field("id",e("Identifier")).field("superClass",s(e("Expression"),null),n.null).field("typeParameters",s(e("TypeParameterInstantiation"),null),n.null),e("InterfaceTypeAnnotation").bases("FlowType").build("body","extends").field("body",e("ObjectTypeAnnotation")).field("extends",s([e("InterfaceExtends")],null),n.null),e("InterfaceDeclaration").bases("Declaration").build("id","body","extends").field("id",e("Identifier")).field("typeParameters",s(e("TypeParameterDeclaration"),null),n.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",s(e("TypeParameterInstantiation"),null),n.null),e("TypeAlias").bases("Declaration").build("id","typeParameters","right").field("id",e("Identifier")).field("typeParameters",s(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",s(e("TypeParameterDeclaration"),null)).field("impltype",e("FlowType")).field("supertype",s(e("FlowType"),null)),e("DeclareOpaqueType").bases("OpaqueType").build("id","typeParameters","supertype").field("impltype",s(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",s(e("FlowPredicate"),null),n.null),e("DeclareClass").bases("InterfaceDeclaration").build("id"),e("DeclareModule").bases("Statement").build("id","body").field("id",s(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",s(e("DeclareVariable"),e("DeclareFunction"),e("DeclareClass"),e("FlowType"),e("TypeAlias"),e("DeclareOpaqueType"),e("InterfaceDeclaration"),null)).field("specifiers",[s(e("ExportSpecifier"),e("ExportBatchSpecifier"))],n.emptyArray).field("source",s(e("Literal"),null),n.null),e("DeclareExportAllDeclaration").bases("Declaration").build("source").field("source",s(e("Literal"),null),n.null),e("ImportDeclaration").field("importKind",s("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",s(e("FlowPredicate"),null),n.null),e("CallExpression").field("typeArguments",s(null,e("TypeParameterInstantiation")),n.null),e("NewExpression").field("typeArguments",s(null,e("TypeParameterInstantiation")),n.null),e("EnumDeclaration").bases("Declaration").build("id","body").field("id",e("Identifier")).field("body",s(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",s([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",s(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"))}Q(()=>module);function aE(r){r.use(fn);var t=r.use(ae),e=r.use(qe).defaults,s=t.Type.def,n=t.Type.or;s("VariableDeclaration").field("declarations",[n(s("VariableDeclarator"),s("Identifier"))]),s("Property").field("value",n(s("Expression"),s("Pattern"))),s("ArrayPattern").field("elements",[n(s("Pattern"),s("SpreadElement"),null)]),s("ObjectPattern").field("properties",[n(s("Property"),s("PropertyPattern"),s("SpreadPropertyPattern"),s("SpreadProperty"))]),s("ExportSpecifier").bases("ModuleSpecifier").build("id","name"),s("ExportBatchSpecifier").bases("Specifier").build(),s("ExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",n(s("Declaration"),s("Expression"),null)).field("specifiers",[n(s("ExportSpecifier"),s("ExportBatchSpecifier"))],e.emptyArray).field("source",n(s("Literal"),null),e.null),s("Block").bases("Comment").build("value","leading","trailing"),s("Line").bases("Comment").build("value","leading","trailing")}Q(()=>module);function Af(r){r.use(fn);let t=r.use(ae),e=r.use(qe).defaults,s=t.Type.def,n=t.Type.or,{undefined:i}=t.builtInTypes;s("Noop").bases("Statement").build(),s("DoExpression").bases("Expression").build("body").field("body",[s("Statement")]),s("BindExpression").bases("Expression").build("object","callee").field("object",n(s("Expression"),null)).field("callee",s("Expression")),s("ParenthesizedExpression").bases("Expression").build("expression").field("expression",s("Expression")),s("ExportNamespaceSpecifier").bases("Specifier").build("exported").field("exported",s("Identifier")),s("ExportDefaultSpecifier").bases("Specifier").build("exported").field("exported",s("Identifier")),s("CommentBlock").bases("Comment").build("value","leading","trailing"),s("CommentLine").bases("Comment").build("value","leading","trailing"),s("Directive").bases("Node").build("value").field("value",s("DirectiveLiteral")),s("DirectiveLiteral").bases("Node","Expression").build("value").field("value",String,e["use strict"]),s("InterpreterDirective").bases("Node").build("value").field("value",String),s("BlockStatement").bases("Statement").build("body").field("body",[s("Statement")]).field("directives",[s("Directive")],e.emptyArray),s("Program").bases("Node").build("body").field("body",[s("Statement")]).field("directives",[s("Directive")],e.emptyArray).field("interpreter",n(s("InterpreterDirective"),null),e.null);function a(u=String,p){return["extra",{rawValue:u,raw:String},function(){let d=t.getFieldValue(this,"value");return{rawValue:d,raw:p?p(d):String(d)}}]}s("StringLiteral").bases("Literal").build("value").field("value",String).field(...a(String,u=>JSON.stringify(u))),s("NumericLiteral").bases("Literal").build("value").field("value",Number).field("raw",n(String,null),e.null).field(...a(Number)),s("BigIntLiteral").bases("Literal").build("value").field("value",n(String,Number)).field(...a(String,u=>u+"n")),s("DecimalLiteral").bases("Literal").build("value").field("value",String).field(...a(String,u=>u+"m")),s("NullLiteral").bases("Literal").build().field("value",null,e.null),s("BooleanLiteral").bases("Literal").build("value").field("value",Boolean),s("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(n(RegExp,i),u=>`/${u.pattern}/${u.flags||""}`)).field("regex",{pattern:String,flags:String},function(){return{pattern:this.pattern,flags:this.flags}});var o=n(s("Property"),s("ObjectMethod"),s("ObjectProperty"),s("SpreadProperty"),s("SpreadElement"));s("ObjectExpression").bases("Expression").build("properties").field("properties",[o]),s("ObjectMethod").bases("Node","Function").build("kind","key","params","body","computed").field("kind",n("method","get","set")).field("key",n(s("Literal"),s("Identifier"),s("Expression"))).field("params",[s("Pattern")]).field("body",s("BlockStatement")).field("computed",Boolean,e.false).field("generator",Boolean,e.false).field("async",Boolean,e.false).field("accessibility",n(s("Literal"),null),e.null).field("decorators",n([s("Decorator")],null),e.null),s("ObjectProperty").bases("Node").build("key","value").field("key",n(s("Literal"),s("Identifier"),s("Expression"))).field("value",n(s("Expression"),s("Pattern"))).field("accessibility",n(s("Literal"),null),e.null).field("computed",Boolean,e.false);var c=n(s("MethodDefinition"),s("VariableDeclarator"),s("ClassPropertyDefinition"),s("ClassProperty"),s("ClassPrivateProperty"),s("ClassMethod"),s("ClassPrivateMethod"),s("ClassAccessorProperty"),s("StaticBlock"));s("ClassBody").bases("Declaration").build("body").field("body",[c]),s("ClassMethod").bases("Declaration","Function").build("kind","key","params","body","computed","static").field("key",n(s("Literal"),s("Identifier"),s("Expression"))),s("ClassPrivateMethod").bases("Declaration","Function").build("key","params","body","kind","computed","static").field("key",s("PrivateName")),s("ClassAccessorProperty").bases("Declaration").build("key","value","decorators","computed","static").field("key",n(s("Literal"),s("Identifier"),s("PrivateName"),s("Expression"))).field("value",n(s("Expression"),null),e.null),["ClassMethod","ClassPrivateMethod"].forEach(u=>{s(u).field("kind",n("get","set","method","constructor"),()=>"method").field("body",s("BlockStatement")).field("access",n("public","private","protected",null),e.null)}),["ClassMethod","ClassPrivateMethod","ClassAccessorProperty"].forEach(u=>{s(u).field("computed",Boolean,e.false).field("static",Boolean,e.false).field("abstract",Boolean,e.false).field("accessibility",n("public","private","protected",null),e.null).field("decorators",n([s("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 l=n(s("Property"),s("PropertyPattern"),s("SpreadPropertyPattern"),s("SpreadProperty"),s("ObjectProperty"),s("RestProperty"),s("RestElement"));s("ObjectPattern").bases("Pattern").build("properties").field("properties",[l]).field("decorators",n([s("Decorator")],null),e.null),s("SpreadProperty").bases("Node").build("argument").field("argument",s("Expression")),s("RestProperty").bases("Node").build("argument").field("argument",s("Expression")),s("ForAwaitStatement").bases("Statement").build("left","right","body").field("left",n(s("VariableDeclaration"),s("Expression"))).field("right",s("Expression")).field("body",s("Statement")),s("Import").bases("Expression").build()}Q(()=>module);function oE(r){let e=r.use(ae).Type.def;r.use(Af),r.use(vf),e("V8IntrinsicIdentifier").bases("Expression").build("name").field("name",String),e("TopicReference").bases("Expression").build()}Q(()=>module);function cE(r){r.use(Af),r.use(Pf);var t=r.use(ae),e=t.namedTypes,s=t.Type.def,n=t.Type.or,i=r.use(qe).defaults,a=t.Type.from(function(u,p){return!!(e.StringLiteral&&e.StringLiteral.check(u,p)||e.Literal&&e.Literal.check(u,p)&&typeof u.value=="string")},"StringLiteral");s("TSType").bases("Node");var o=n(s("Identifier"),s("TSQualifiedName"));s("TSTypeReference").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("typeName","typeParameters").field("typeName",o),s("TSHasOptionalTypeParameterInstantiation").field("typeParameters",n(s("TSTypeParameterInstantiation"),null),i.null),s("TSHasOptionalTypeParameters").field("typeParameters",n(s("TSTypeParameterDeclaration"),null,void 0),i.null),s("TSHasOptionalTypeAnnotation").field("typeAnnotation",n(s("TSTypeAnnotation"),null),i.null),s("TSQualifiedName").bases("Node").build("left","right").field("left",o).field("right",o),s("TSAsExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",s("Expression")).field("typeAnnotation",s("TSType")).field("extra",n({parenthesized:Boolean},null),i.null),s("TSTypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",s("Expression")).field("typeAnnotation",s("TSType")),s("TSSatisfiesExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",s("Expression")).field("typeAnnotation",s("TSType")),s("TSNonNullExpression").bases("Expression","Pattern").build("expression").field("expression",s("Expression")),["TSAnyKeyword","TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSObjectKeyword","TSStringKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSUnknownKeyword","TSVoidKeyword","TSIntrinsicKeyword","TSThisType"].forEach(u=>{s(u).bases("TSType").build()}),s("TSArrayType").bases("TSType").build("elementType").field("elementType",s("TSType")),s("TSLiteralType").bases("TSType").build("literal").field("literal",n(s("NumericLiteral"),s("StringLiteral"),s("BooleanLiteral"),s("TemplateLiteral"),s("UnaryExpression"),s("BigIntLiteral"))),s("TemplateLiteral").field("expressions",n([s("Expression")],[s("TSType")])),["TSUnionType","TSIntersectionType"].forEach(u=>{s(u).bases("TSType").build("types").field("types",[s("TSType")])}),s("TSConditionalType").bases("TSType").build("checkType","extendsType","trueType","falseType").field("checkType",s("TSType")).field("extendsType",s("TSType")).field("trueType",s("TSType")).field("falseType",s("TSType")),s("TSInferType").bases("TSType").build("typeParameter").field("typeParameter",s("TSTypeParameter")),s("TSParenthesizedType").bases("TSType").build("typeAnnotation").field("typeAnnotation",s("TSType"));var c=[n(s("Identifier"),s("RestElement"),s("ArrayPattern"),s("ObjectPattern"))];["TSFunctionType","TSConstructorType"].forEach(u=>{s(u).bases("TSType","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters").field("parameters",c)}),s("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",n(s("Identifier"),null),i.null).field("params",[s("Pattern")]).field("returnType",n(s("TSTypeAnnotation"),s("Noop"),null),i.null),s("TSDeclareMethod").bases("Declaration","TSHasOptionalTypeParameters").build("key","params","returnType").field("async",Boolean,i.false).field("generator",Boolean,i.false).field("params",[s("Pattern")]).field("abstract",Boolean,i.false).field("accessibility",n("public","private","protected",void 0),i.undefined).field("static",Boolean,i.false).field("computed",Boolean,i.false).field("optional",Boolean,i.false).field("key",n(s("Identifier"),s("StringLiteral"),s("NumericLiteral"),s("Expression"))).field("kind",n("get","set","method","constructor"),function(){return"method"}).field("access",n("public","private","protected",void 0),i.undefined).field("decorators",n([s("Decorator")],null),i.null).field("returnType",n(s("TSTypeAnnotation"),s("Noop"),null),i.null),s("TSMappedType").bases("TSType").build("typeParameter","typeAnnotation").field("readonly",n(Boolean,"+","-"),i.false).field("typeParameter",s("TSTypeParameter")).field("optional",n(Boolean,"+","-"),i.false).field("typeAnnotation",n(s("TSType"),null),i.null),s("TSTupleType").bases("TSType").build("elementTypes").field("elementTypes",[n(s("TSType"),s("TSNamedTupleMember"))]),s("TSNamedTupleMember").bases("TSType").build("label","elementType","optional").field("label",s("Identifier")).field("optional",Boolean,i.false).field("elementType",s("TSType")),s("TSRestType").bases("TSType").build("typeAnnotation").field("typeAnnotation",s("TSType")),s("TSOptionalType").bases("TSType").build("typeAnnotation").field("typeAnnotation",s("TSType")),s("TSIndexedAccessType").bases("TSType").build("objectType","indexType").field("objectType",s("TSType")).field("indexType",s("TSType")),s("TSTypeOperator").bases("TSType").build("operator").field("operator",String).field("typeAnnotation",s("TSType")),s("TSTypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",n(s("TSType"),s("TSTypeAnnotation"))),s("TSIndexSignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",[s("Identifier")]).field("readonly",Boolean,i.false),s("TSPropertySignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("key","typeAnnotation","optional").field("key",s("Expression")).field("computed",Boolean,i.false).field("readonly",Boolean,i.false).field("optional",Boolean,i.false).field("initializer",n(s("Expression"),null),i.null),s("TSMethodSignature").bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("key","parameters","typeAnnotation").field("key",s("Expression")).field("computed",Boolean,i.false).field("optional",Boolean,i.false).field("parameters",c),s("TSTypePredicate").bases("TSTypeAnnotation","TSType").build("parameterName","typeAnnotation","asserts").field("parameterName",n(s("Identifier"),s("TSThisType"))).field("typeAnnotation",n(s("TSTypeAnnotation"),null),i.null).field("asserts",Boolean,i.false),["TSCallSignatureDeclaration","TSConstructSignatureDeclaration"].forEach(u=>{s(u).bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",c)}),s("TSEnumMember").bases("Node").build("id","initializer").field("id",n(s("Identifier"),a)).field("initializer",n(s("Expression"),null),i.null),s("TSTypeQuery").bases("TSType").build("exprName").field("exprName",n(o,s("TSImportType")));var l=n(s("TSCallSignatureDeclaration"),s("TSConstructSignatureDeclaration"),s("TSIndexSignature"),s("TSMethodSignature"),s("TSPropertySignature"));s("TSTypeLiteral").bases("TSType").build("members").field("members",[l]),s("TSTypeParameter").bases("Identifier").build("name","constraint","default").field("name",n(s("Identifier"),String)).field("constraint",n(s("TSType"),void 0),i.undefined).field("default",n(s("TSType"),void 0),i.undefined),s("TSTypeAssertion").bases("Expression","Pattern").build("typeAnnotation","expression").field("typeAnnotation",s("TSType")).field("expression",s("Expression")).field("extra",n({parenthesized:Boolean},null),i.null),s("TSTypeParameterDeclaration").bases("Declaration").build("params").field("params",[s("TSTypeParameter")]),s("TSInstantiationExpression").bases("Expression","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",s("Expression")),s("TSTypeParameterInstantiation").bases("Node").build("params").field("params",[s("TSType")]),s("TSEnumDeclaration").bases("Declaration").build("id","members").field("id",s("Identifier")).field("const",Boolean,i.false).field("declare",Boolean,i.false).field("members",[s("TSEnumMember")]).field("initializer",n(s("Expression"),null),i.null),s("TSTypeAliasDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","typeAnnotation").field("id",s("Identifier")).field("declare",Boolean,i.false).field("typeAnnotation",s("TSType")),s("TSModuleBlock").bases("Node").build("body").field("body",[s("Statement")]),s("TSModuleDeclaration").bases("Declaration").build("id","body").field("id",n(a,o)).field("declare",Boolean,i.false).field("global",Boolean,i.false).field("body",n(s("TSModuleBlock"),s("TSModuleDeclaration"),null),i.null),s("TSImportType").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("argument","qualifier","typeParameters").field("argument",a).field("qualifier",n(o,void 0),i.undefined),s("TSImportEqualsDeclaration").bases("Declaration").build("id","moduleReference").field("id",s("Identifier")).field("isExport",Boolean,i.false).field("moduleReference",n(o,s("TSExternalModuleReference"))),s("TSExternalModuleReference").bases("Declaration").build("expression").field("expression",a),s("TSExportAssignment").bases("Statement").build("expression").field("expression",s("Expression")),s("TSNamespaceExportDeclaration").bases("Declaration").build("id").field("id",s("Identifier")),s("TSInterfaceBody").bases("Node").build("body").field("body",[l]),s("TSExpressionWithTypeArguments").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",o),s("TSInterfaceDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","body").field("id",o).field("declare",Boolean,i.false).field("extends",n([s("TSExpressionWithTypeArguments")],null),i.null).field("body",s("TSInterfaceBody")),s("TSParameterProperty").bases("Pattern").build("parameter").field("accessibility",n("public","private","protected",void 0),i.undefined).field("readonly",Boolean,i.false).field("parameter",n(s("Identifier"),s("AssignmentPattern"))),s("ClassProperty").field("access",n("public","private","protected",void 0),i.undefined),s("ClassAccessorProperty").bases("Declaration","TSHasOptionalTypeAnnotation"),s("ClassBody").field("body",[n(s("MethodDefinition"),s("VariableDeclarator"),s("ClassPropertyDefinition"),s("ClassProperty"),s("ClassPrivateProperty"),s("ClassAccessorProperty"),s("ClassMethod"),s("ClassPrivateMethod"),s("StaticBlock"),s("TSDeclareMethod"),l)])}Q(()=>module);var ot;ot||(ot={});var{astNodesAreEquivalent:RO,builders:or,builtInTypes:ct,defineMethod:FO,eachField:BO,finalize:jO,getBuilderName:UO,getFieldNames:lE,getFieldValue:Lt,getSupertypeNames:qO,namedTypes:uE,NodePath:pE,Path:GO,PathVisitor:$O,someField:hE,Type:HO,use:VO,visit:YO}=Wx([fn,iE,vf,aE,oE,cE]);Object.assign(ot,uE);var Mi=ot,sf=zi.default.SourceMapConsumer,dE=zi.default.SourceMapGenerator,Cf=Object.prototype.hasOwnProperty;function fE(){return`
|
|
39
|
+
`}function rf(r,t,e){return r&&Cf.call(r,t)?r[t]:e}function mE(...r){let t={},e=r.length;for(let s=0;s<e;++s){let n=Object.keys(r[s]),i=n.length;for(let a=0;a<i;++a)t[n[a]]=!0}return t}function J(r,t){return r.line-t.line||r.column-t.column}function Qt(r){return{line:r.line,column:r.column}}function yE(r,t){if(r){if(!t)return r}else return t||null;let e=new sf(r),s=new sf(t),n=new dE({file:t.file,sourceRoot:t.sourceRoot}),i={};return s.eachMapping(function(a){let o=e.originalPositionFor({line:a.originalLine,column:a.originalColumn}),c=o.source;if(c===null)return;n.addMapping({source:c,original:Qt(o),generated:{line:a.generatedLine,column:a.generatedColumn},name:a.name});let l=e.sourceContentFor(c);l&&!Cf.call(i,c)&&(i[c]=l,n.setSourceContent(c,l))}),n.toJSON()}function wf(r,t){if(!r.loc)return null;let e={start:r.loc.start,end:r.loc.end};function s(n){Uc(e,n.loc)}return r.declaration&&r.declaration.decorators&&Ji(r)&&r.declaration.decorators.forEach(s),J(e.start,e.end)<0&&(e.start=Qt(e.start),t.skipSpaces(e.start,!1,!0),J(e.start,e.end)<0&&(e.end=Qt(e.end),t.skipSpaces(e.end,!0,!0))),r.comments&&r.comments.forEach(s),e}function Uc(r,t){r&&t&&(J(t.start,r.start)<0&&(r.start=t.start),J(r.end,t.end)<0&&(r.end=t.end))}function Kc(r,t){let e=r.loc;if(e&&(e.start.line<1&&(e.start.line=1),e.end.line<1&&(e.end.line=1)),r.type==="File"&&(e.start=t.firstPos(),e.end=t.lastPos()),gE(r,t),bE(r,t),e&&r.decorators)r.decorators.forEach(function(s){Uc(e,s.loc)});else if(r.declaration&&Ji(r)){r.declaration.loc=null;let s=r.declaration.decorators;s&&s.forEach(function(n){Uc(e,n.loc)})}else if(Mi.MethodDefinition&&Mi.MethodDefinition.check(r)||Mi.Property.check(r)&&(r.method||r.shorthand))r.value.loc=null,Mi.FunctionExpression.check(r.value)&&(r.value.id=null);else if(r.type==="ObjectTypeProperty"){let s=r.loc,n=s&&s.end;n&&(n=Qt(n),t.prevPos(n)&&t.charAt(n)===","&&(n=t.skipSpaces(n,!0,!0))&&(s.end=n))}}function gE(r,t){if(r.type!=="ForStatement")return;function e(s){let n=s&&s.loc,i=n&&n.start,a=n&&Qt(n.end);for(;i&&a&&J(i,a)<0&&(t.prevPos(a),t.charAt(a)===";");)n.end.line=a.line,n.end.column=a.column}e(r.init),e(r.test),e(r.update)}function bE(r,t){if(r.type==="TemplateLiteral"&&r.quasis.length!==0){if(r.loc){let e=Qt(r.loc.start),s=r.quasis[0];J(s.loc.start,e)<0&&(s.loc.start=e);let n=Qt(r.loc.end),i=r.quasis[r.quasis.length-1];J(n,i.loc.end)<0&&(i.loc.end=n)}r.expressions.forEach(function(e,s){let n=t.skipSpaces(e.loc.start,!0,!1);if(t.prevPos(n)&&t.charAt(n)==="{"&&t.prevPos(n)&&t.charAt(n)==="$"){let a=r.quasis[s];J(n,a.loc.end)<0&&(a.loc.end=n)}let i=t.skipSpaces(e.loc.end,!1,!1);if(t.charAt(i)==="}"){let a=r.quasis[s+1];J(a.loc.start,i)<0&&(a.loc.start=i)}})}}function Ji(r){if(r)switch(r.type){case"ExportDeclaration":case"ExportDefaultDeclaration":case"ExportDefaultSpecifier":case"DeclareExportDeclaration":case"ExportNamedDeclaration":case"ExportAllDeclaration":return!0}return!1}function If(r){let t=r.getParentNode();return r.getName()==="declaration"&&Ji(t)?t:null}function ln(r,t){let e=r.trailingComma;return typeof e=="object"?!!e[t]:!!e}var qc={tabWidth:4,useTabs:!1,reuseWhitespace:!0,lineTerminator:fE(),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},SE=qc.hasOwnProperty;function Ki(r){let t=r||qc;function e(s){return SE.call(t,s)?t[s]:qc[s]}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 Gc=class r{constructor(t,e,s=e){this.sourceLines=t,this.sourceLoc=e,this.targetLoc=s}slice(t,e,s=t.lastPos()){let n=this.sourceLines,i=this.sourceLoc,a=this.targetLoc;function o(c){let l=i[c],u=a[c],p=e;return c==="end"&&(p=s),_E(n,l,t,u,p)}if(J(e,a.start)<=0)if(J(a.end,s)<=0)a={start:Xt(a.start,e.line,e.column),end:Xt(a.end,e.line,e.column)};else{if(J(s,a.start)<=0)return null;i={start:i.start,end:o("end")},a={start:Xt(a.start,e.line,e.column),end:Xt(s,e.line,e.column)}}else{if(J(a.end,e)<=0)return null;J(a.end,s)<=0?(i={start:o("start"),end:i.end},a={start:{line:1,column:0},end:Xt(a.end,e.line,e.column)}):(i={start:o("start"),end:o("end")},a={start:{line:1,column:0},end:Xt(s,e.line,e.column)})}return new r(this.sourceLines,i,a)}add(t,e){return new r(this.sourceLines,this.sourceLoc,{start:nf(this.targetLoc.start,t,e),end:nf(this.targetLoc.end,t,e)})}subtract(t,e){return new r(this.sourceLines,this.sourceLoc,{start:Xt(this.targetLoc.start,t,e),end:Xt(this.targetLoc.end,t,e)})}indent(t,e=!1,s=!1){if(t===0)return this;let n=this.targetLoc,i=n.start.line,a=n.end.line;if(e&&i===1&&a===1)return this;if(n={start:n.start,end:n.end},!e||i>1){let o=n.start.column+t;n.start={line:i,column:s?Math.max(0,o):o}}if(!e||a>1){let o=n.end.column+t;n.end={line:a,column:s?Math.max(0,o):o}}return new r(this.sourceLines,this.sourceLoc,n)}};function nf(r,t,e){return{line:r.line+t-1,column:r.line===1?r.column+e:r.column}}function Xt(r,t,e){return{line:r.line-t+1,column:r.line===t?r.column-e:r.column}}function _E(r,t,e,s,n){let i=J(s,n);if(i===0)return t;let a,o;if(i<0){a=r.skipSpaces(t)||r.lastPos(),o=e.skipSpaces(s)||e.lastPos();let c=n.line-o.line;for(a.line+=c,o.line+=c,c>0&&(a.column=0,o.column=0);J(o,n)<0&&e.nextPos(o,!0););}else{a=r.skipSpaces(t,!0)||r.firstPos(),o=e.skipSpaces(s,!0)||e.firstPos();let c=n.line-o.line;for(a.line+=c,o.line+=c,c<0&&(a.column=r.getLineLength(a.line),o.column=e.getLineLength(o.line));J(n,o)<0&&e.prevPos(o,!0););}return a}var xE=Object.defineProperty,EE=(r,t,e)=>t in r?xE(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,tn=(r,t,e)=>(EE(r,typeof t!="symbol"?t+"":t,e),e),ir=class r{constructor(t,e=null){this.infos=t,tn(this,"length"),tn(this,"name"),tn(this,"mappings",[]),tn(this,"cachedSourceMap",null),tn(this,"cachedTabWidth"),this.length=t.length,this.name=e||null,this.name&&this.mappings.push(new Gc(this,{start:this.firstPos(),end:this.lastPos()}))}toString(t){return this.sliceString(this.firstPos(),this.lastPos(),t)}getSourceMap(t,e){if(!t)return null;let s=this;function n(o){return o=o||{},o.file=t,e&&(o.sourceRoot=e),o}if(s.cachedSourceMap)return n(s.cachedSourceMap.toJSON());let i=new zi.default.SourceMapGenerator(n()),a={};return s.mappings.forEach(function(o){let c=o.sourceLines.skipSpaces(o.sourceLoc.start)||o.sourceLines.lastPos(),l=s.skipSpaces(o.targetLoc.start)||s.lastPos();for(;J(c,o.sourceLoc.end)<0&&J(l,o.targetLoc.end)<0;){o.sourceLines.charAt(c),s.charAt(l);let u=o.sourceLines.name;if(i.addMapping({source:u,original:{line:c.line,column:c.column},generated:{line:l.line,column:l.column}}),!$c.call(a,u)){let p=o.sourceLines.toString();i.setSourceContent(u,p),a[u]=p}s.nextPos(l,!0),o.sourceLines.nextPos(c,!0)}}),s.cachedSourceMap=i,i.toJSON()}bootstrapCharAt(t){let e=t.line,s=t.column,n=this.toString().split(Hc),i=n[e-1];return typeof i>"u"?"":s===i.length&&e<n.length?`
|
|
40
|
+
`:s>=i.length?"":i.charAt(s)}charAt(t){let e=t.line,s=t.column,n=this,i=n.infos,a=i[e-1],o=s;if(typeof a>"u"||o<0)return"";let c=this.getIndentAt(e);return o<c?" ":(o+=a.sliceStart-c,o===a.sliceEnd&&e<this.length?`
|
|
41
|
+
`:o>=a.sliceEnd?"":a.line.charAt(o))}stripMargin(t,e){if(t===0)return this;if(e&&this.length===1)return this;let s=new r(this.infos.map(function(n,i){return n.line&&(i>0||!e)&&(n={...n,indent:Math.max(0,n.indent-t)}),n}));if(this.mappings.length>0){let n=s.mappings;this.mappings.forEach(function(i){n.push(i.indent(t,e,!0))})}return s}indent(t){if(t===0)return this;let e=new r(this.infos.map(function(s){return s.line&&!s.locked&&(s={...s,indent:s.indent+t}),s}));if(this.mappings.length>0){let s=e.mappings;this.mappings.forEach(function(n){s.push(n.indent(t))})}return e}indentTail(t){if(t===0)return this;if(this.length<2)return this;let e=new r(this.infos.map(function(s,n){return n>0&&s.line&&!s.locked&&(s={...s,indent:s.indent+t}),s}));if(this.mappings.length>0){let s=e.mappings;this.mappings.forEach(function(n){s.push(n.indent(t,!0))})}return e}lockIndentTail(){return this.length<2?this:new r(this.infos.map((t,e)=>({...t,locked:e>0})))}getIndentAt(t){return Math.max(this.infos[t-1].indent,0)}guessTabWidth(){if(typeof this.cachedTabWidth=="number")return this.cachedTabWidth;let t=[],e=0;for(let i=1,a=this.length;i<=a;++i){let o=this.infos[i-1],c=o.line.slice(o.sliceStart,o.sliceEnd);if(tr(c))continue;let l=Math.abs(o.indent-e);t[l]=~~t[l]+1,e=o.indent}let s=-1,n=2;for(let i=1;i<t.length;i+=1)$c.call(t,i)&&t[i]>s&&(s=t[i],n=i);return this.cachedTabWidth=n}startsWithComment(){if(this.infos.length===0)return!1;let t=this.infos[0],e=t.sliceStart,s=t.sliceEnd,n=t.line.slice(e,s).trim();return n.length===0||n.slice(0,2)==="//"||n.slice(0,2)==="/*"}isOnlyWhitespace(){return tr(this.toString())}isPrecededOnlyByWhitespace(t){let e=this.infos[t.line-1],s=Math.max(e.indent,0),n=t.column-s;if(n<=0)return!0;let i=e.sliceStart,a=Math.min(i+n,e.sliceEnd),o=e.line.slice(i,a);return tr(o)}getLineLength(t){let e=this.infos[t-1];return this.getIndentAt(t)+e.sliceEnd-e.sliceStart}nextPos(t,e=!1){let s=Math.max(t.line,0);return Math.max(t.column,0)<this.getLineLength(s)?(t.column+=1,e?!!this.skipSpaces(t,!1,!0):!0):s<this.length?(t.line+=1,t.column=0,e?!!this.skipSpaces(t,!1,!0):!0):!1}prevPos(t,e=!1){let s=t.line,n=t.column;if(n<1){if(s-=1,s<1)return!1;n=this.getLineLength(s)}else n=Math.min(n-1,this.getLineLength(s));return t.line=s,t.column=n,e?!!this.skipSpaces(t,!0,!0):!0}firstPos(){return{line:1,column:0}}lastPos(){return{line:this.length,column:this.getLineLength(this.length)}}skipSpaces(t,e=!1,s=!1){if(t?t=s?t:{line:t.line,column:t.column}:e?t=this.lastPos():t=this.firstPos(),e){for(;this.prevPos(t);)if(!tr(this.charAt(t))&&this.nextPos(t))return t;return null}else{for(;tr(this.charAt(t));)if(!this.nextPos(t))return null;return t}}trimLeft(){let t=this.skipSpaces(this.firstPos(),!1,!0);return t?this.slice(t):gs}trimRight(){let t=this.skipSpaces(this.lastPos(),!0,!0);return t?this.slice(this.firstPos(),t):gs}trim(){let t=this.skipSpaces(this.firstPos(),!1,!0);if(t===null)return gs;let e=this.skipSpaces(this.lastPos(),!0,!0);return e===null?gs:this.slice(t,e)}eachPos(t,e=this.firstPos(),s=!1){let n=this.firstPos();if(e&&(n.line=e.line,n.column=e.column),!(s&&!this.skipSpaces(n,!1,!0)))do t.call(this,n);while(this.nextPos(n,s))}bootstrapSlice(t,e){let s=this.toString().split(Hc).slice(t.line-1,e.line);return s.length>0&&(s.push(s.pop().slice(0,e.column)),s[0]=s[0].slice(t.column)),v(s.join(`
|
|
42
|
+
`))}slice(t,e){if(!e){if(!t)return this;e=this.lastPos()}if(!t)throw new Error("cannot slice with end but not start");let s=this.infos.slice(t.line-1,e.line);t.line===e.line?s[0]=sr(s[0],t.column,e.column):(s[0]=sr(s[0],t.column),s.push(sr(s.pop(),0,e.column)));let n=new r(s);if(this.mappings.length>0){let i=n.mappings;this.mappings.forEach(function(a){let o=a.slice(this,t,e);o&&i.push(o)},this)}return n}bootstrapSliceString(t,e,s){return this.slice(t,e).toString(s)}sliceString(t=this.firstPos(),e=this.lastPos(),s){let{tabWidth:n,useTabs:i,reuseWhitespace:a,lineTerminator:o}=Ki(s),c=[];for(let l=t.line;l<=e.line;++l){let u=this.infos[l-1];l===t.line?l===e.line?u=sr(u,t.column,e.column):u=sr(u,t.column):l===e.line&&(u=sr(u,0,e.column));let p=Math.max(u.indent,0),h=u.line.slice(0,u.sliceStart);if(a&&tr(h)&&Nf(h,n)===p){c.push(u.line.slice(0,u.sliceEnd));continue}let d=0,f=p;i&&(d=Math.floor(p/n),f-=d*n);let m="";d>0&&(m+=new Array(d+1).join(" ")),f>0&&(m+=new Array(f+1).join(" ")),m+=u.line.slice(u.sliceStart,u.sliceEnd),c.push(m)}return c.join(o)}isEmpty(){return this.length<2&&this.getLineLength(1)<1}join(t){let e=this,s=[],n=[],i;function a(l){if(l!==null){if(i){let u=l.infos[0],p=new Array(u.indent+1).join(" "),h=s.length,d=Math.max(i.indent,0)+i.sliceEnd-i.sliceStart;i.line=i.line.slice(0,i.sliceEnd)+p+u.line.slice(u.sliceStart,u.sliceEnd),i.locked=i.locked||u.locked,i.sliceEnd=i.line.length,l.mappings.length>0&&l.mappings.forEach(function(f){n.push(f.add(h,d))})}else l.mappings.length>0&&n.push.apply(n,l.mappings);l.infos.forEach(function(u,p){(!i||p>0)&&(i={...u},s.push(i))})}}function o(l,u){u>0&&a(e),a(l)}if(t.map(function(l){let u=v(l);return u.isEmpty()?null:u}).forEach((l,u)=>{e.isEmpty()?a(l):o(l,u)}),s.length<1)return gs;let c=new r(s);return c.mappings=n,c}concat(...t){let e=[this];return e.push.apply(e,t),gs.join(e)}},ji={},$c=ji.hasOwnProperty,TE=10;function Nf(r,t){let e=0,s=r.length;for(let n=0;n<s;++n)switch(r.charCodeAt(n)){case 9:{let i=Math.ceil(e/t)*t;i===e?e+=t:e=i;break}case 11:case 12:case 13:case 65279:break;case 32:default:e+=1;break}return e}var PE=/^\s*/,Hc=/\u000D\u000A|\u000D(?!\u000A)|\u000A|\u2028|\u2029/;function v(r,t){if(r instanceof ir)return r;r+="";let e=t&&t.tabWidth,s=r.indexOf(" ")<0,n=!t&&s&&r.length<=TE;if(n&&$c.call(ji,r))return ji[r];let i=new ir(r.split(Hc).map(function(a){let o=PE.exec(a)[0];return{line:a,indent:Nf(o,e),locked:!1,sliceStart:o.length,sliceEnd:a.length}}),Ki(t).sourceFileName);return n&&(ji[r]=i),i}function tr(r){return!/\S/.test(r)}function sr(r,t,e){let s=r.sliceStart,n=r.sliceEnd,i=Math.max(r.indent,0),a=i+n-s;return typeof e>"u"&&(e=a),t=Math.max(t,0),e=Math.min(e,a),e=Math.max(e,t),e<i?(i=e,n=s):n-=a-e,a=e,a-=t,t<i?i-=t:(t-=i,i=0,s+=t),r.indent===i&&r.sliceStart===s&&r.sliceEnd===n?r:{line:r.line,indent:i,locked:!1,sliceStart:s,sliceEnd:n}}function S(r){return gs.join(r)}var gs=v(""),ar=ot,kf=ct.array,vE=ct.object,af=new WeakMap;function Df(r,t,e){if(!r)return e;if(Kc(r,t),e){if(ar.Node.check(r)&&ar.SourceLocation.check(r.loc)){let n=e.length-1;for(;n>=0;--n){let i=e[n];if(i&&i.loc&&J(i.loc.end,r.loc.start)<=0)break}return e.splice(n+1,0,r),e}}else{let n=af.get(r);if(n)return n}let s;if(kf.check(r))s=Object.keys(r);else if(vE.check(r))s=lE(r);else return e;e||af.set(r,e=[]);for(let n=0,i=s.length;n<i;++n)Df(r[s[n]],t,e);return e}function Of(r,t,e){let s=Df(r,e),n=0,i=s&&s.length,a,o;for(;typeof i=="number"&&n<i;){let c=n+i>>1,l=s[c];if(J(l.loc.start,t.loc.start)<=0&&J(t.loc.end,l.loc.end)<=0){Of(t.enclosingNode=l,t,e);return}if(J(l.loc.end,t.loc.start)<=0){a=l,n=c+1;continue}if(J(t.loc.end,l.loc.start)<=0){o=l,i=c;continue}throw new Error("Comment location overlaps with node location")}a&&(t.precedingNode=a),o&&(t.followingNode=o)}function AE(r,t,e){if(!kf.check(r))return;let s=[];r.forEach(function(n){n.loc.lines=e,Of(t,n,e);let i=n.precedingNode,a=n.enclosingNode,o=n.followingNode;if(i&&o){let c=s.length;c>0&&s[c-1].followingNode!==n.followingNode&&sn(s,e),s.push(n)}else if(i)sn(s,e),Lf(i,n);else if(o)sn(s,e),Mf(o,n);else if(a)sn(s,e),CE(a,n);else throw new Error("AST contains no nodes at all?")}),sn(s,e),r.forEach(function(n){delete n.precedingNode,delete n.enclosingNode,delete n.followingNode})}function sn(r,t){let e=r.length;if(e===0)return;let s=r[0].precedingNode,n=r[0].followingNode,i=n.loc.start,a=e,o;for(;a>0;--a){o=r[a-1];let c=t.sliceString(o.loc.end,i);if(/\S/.test(c))break;i=o.loc.start}for(;a<=e&&(o=r[a])&&(o.type==="Line"||o.type==="CommentLine")&&o.loc.start.column>n.loc.start.column;)++a;if(a){let{enclosingNode:c}=r[a-1];c?.type==="CallExpression"&&--a}r.forEach(function(c,l){l<a?Lf(s,c):Mf(n,c)}),r.length=0}function Xc(r,t){(r.comments||(r.comments=[])).push(t)}function Mf(r,t){t.leading=!0,t.trailing=!1,Xc(r,t)}function CE(r,t){t.leading=!1,t.trailing=!1,Xc(r,t)}function Lf(r,t){t.leading=!1,t.trailing=!0,Xc(r,t)}function wE(r,t){let e=r.getValue();ar.Comment.assert(e);let s=e.loc,n=s&&s.lines,i=[t(r)];if(e.trailing)i.push(`
|
|
43
|
+
`);else if(n instanceof ir){let a=n.slice(s.end,n.skipSpaces(s.end)||n.lastPos());a.length===1?i.push(a):i.push(new Array(a.length).join(`
|
|
44
|
+
`))}else i.push(`
|
|
45
|
+
`);return S(i)}function IE(r,t){let e=r.getValue(r);ar.Comment.assert(e);let s=e.loc,n=s&&s.lines,i=[];if(n instanceof ir){let a=n.skipSpaces(s.start,!0)||n.firstPos(),o=n.slice(a,s.start);o.length===1?i.push(o):i.push(new Array(o.length).join(`
|
|
46
|
+
`))}return i.push(t(r)),S(i)}function of(r,t){let e=r.getValue(),s=t(r),n=ar.Node.check(e)&&Lt(e,"comments");if(!n||n.length===0)return s;let i=[],a=[s];return r.each(function(o){let c=o.getValue(),l=Lt(c,"leading"),u=Lt(c,"trailing");l||u&&!(ar.Statement.check(e)||c.type==="Block"||c.type==="CommentBlock")?i.push(wE(o,t)):u&&a.push(IE(o,t))},"comments"),i.push.apply(i,a),S(i)}var NE=or,kE=ct.object,DE=ct.array;function Rf(r,t){t=Ki(t);let e=v(r,t),s=e.toString({tabWidth:t.tabWidth,reuseWhitespace:!1,useTabs:!1}),n=[],i=t.parser.parse(s,{jsx:!0,loc:!0,locations:!0,range:t.range,comment:!0,onComment:n,tolerant:rf(t,"tolerant",!0),ecmaVersion:6,sourceType:rf(t,"sourceType","module")}),a=Array.isArray(i.tokens)?i.tokens:!1;delete i.tokens,a.forEach(function(u){typeof u.value!="string"&&(u.value=e.sliceString(u.loc.start,u.loc.end))}),Array.isArray(i.comments)&&(n=i.comments,delete i.comments),i.loc?Kc(i,e):i.loc={start:e.firstPos(),end:e.lastPos()},i.loc.lines=e,i.loc.indent=0;let o,c;i.type==="Program"?(c=i,o=NE.file(i,t.sourceFileName||null),o.loc={start:e.firstPos(),end:e.lastPos(),lines:e,indent:0}):i.type==="File"&&(o=i,c=o.program),t.tokens&&(o.tokens=a);let l=wf({type:c.type,loc:c.loc,body:[],comments:n},e);return c.loc.start=l.start,c.loc.end=l.end,AE(n,c.body.length?o.program:o,e),new Ff(e,a).copy(o)}var Ff=function(t,e){this.lines=t,this.tokens=e,this.startTokenIndex=0,this.endTokenIndex=e.length,this.indent=0,this.seen=new Map},Bf=Ff.prototype;Bf.copy=function(r){if(this.seen.has(r))return this.seen.get(r);if(DE.check(r)){let l=new Array(r.length);return this.seen.set(r,l),r.forEach(function(u,p){l[p]=this.copy(u)},this),l}if(!kE.check(r))return r;Kc(r,this.lines);let t=Object.create(Object.getPrototypeOf(r),{original:{value:r,configurable:!1,enumerable:!1,writable:!0}});this.seen.set(r,t);let e=r.loc,s=this.indent,n=s,i=this.startTokenIndex,a=this.endTokenIndex;e&&((r.type==="Block"||r.type==="Line"||r.type==="CommentBlock"||r.type==="CommentLine"||this.lines.isPrecededOnlyByWhitespace(e.start))&&(n=this.indent=e.start.column),e.lines=this.lines,e.tokens=this.tokens,e.indent=n,this.findTokenRange(e));let o=Object.keys(r),c=o.length;for(let l=0;l<c;++l){let u=o[l];u==="loc"||u==="tokens"&&r.type==="File"?t[u]=r[u]:t[u]=this.copy(r[u])}return this.indent=s,this.startTokenIndex=i,this.endTokenIndex=a,t};Bf.findTokenRange=function(r){for(;this.startTokenIndex>0;){let t=r.tokens[this.startTokenIndex];if(J(r.start,t.loc.start)<0)--this.startTokenIndex;else break}for(;this.endTokenIndex<r.tokens.length;){let t=r.tokens[this.endTokenIndex];if(J(t.loc.end,r.end)<0)++this.endTokenIndex;else break}for(;this.startTokenIndex<this.endTokenIndex;){let t=r.tokens[this.startTokenIndex];if(J(t.loc.start,r.start)<0)++this.startTokenIndex;else break}for(r.start.token=this.startTokenIndex;this.endTokenIndex>this.startTokenIndex;){let t=r.tokens[this.endTokenIndex-1];if(J(r.end,t.loc.end)<0)--this.endTokenIndex;else break}r.end.token=this.endTokenIndex};var re=ot,OE=ct.array,ME=ct.number,Vc={};[["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]].forEach(function(r,t){r.forEach(function(e){Vc[e]=t})});var at=function(t){this.stack=[t]},we=at.prototype;at.from=function(r){if(r instanceof at)return r.copy();if(r instanceof pE){let t=Object.create(at.prototype),e=[r.value];for(let s;s=r.parentPath;r=s)e.push(r.name,s.value);return t.stack=e.reverse(),t}return new at(r)};we.copy=function(){let t=Object.create(at.prototype);return t.stack=this.stack.slice(0),t};we.getName=function(){let t=this.stack,e=t.length;return e>1?t[e-2]:null};we.getValue=function(){let t=this.stack;return t[t.length-1]};we.valueIsDuplicate=function(){let r=this.stack,t=r.length-1;return r.lastIndexOf(r[t],t-1)>=0};function jf(r,t){let e=r.stack;for(let s=e.length-1;s>=0;s-=2){let n=e[s];if(re.Node.check(n)&&--t<0)return n}return null}we.getNode=function(t=0){return jf(this,~~t)};we.getParentNode=function(t=0){return jf(this,~~t+1)};we.getRootValue=function(){let t=this.stack;return t.length%2===0?t[1]:t[0]};we.call=function(t){let e=this.stack,s=e.length,n=e[s-1],i=arguments.length;for(let o=1;o<i;++o){let c=arguments[o];n=n[c],e.push(c,n)}let a=t(this);return e.length=s,a};we.each=function(t){let e=this.stack,s=e.length,n=e[s-1],i=arguments.length;for(let a=1;a<i;++a){let o=arguments[a];n=n[o],e.push(o,n)}for(let a=0;a<n.length;++a)a in n&&(e.push(a,n[a]),t(this),e.length-=2);e.length=s};we.map=function(t){let e=this.stack,s=e.length,n=e[s-1],i=arguments.length;for(let o=1;o<i;++o){let c=arguments[o];n=n[c],e.push(c,n)}let a=new Array(n.length);for(let o=0;o<n.length;++o)o in n&&(e.push(o,n[o]),a[o]=t(this,o),e.length-=2);return e.length=s,a};we.hasParens=function(){let r=this.getNode(),t=this.getPrevToken(r);if(!t)return!1;let e=this.getNextToken(r);return e?!!(t.value==="("&&(e.value===")"||!this.canBeFirstInStatement()&&this.firstInStatement()&&!this.needsParens(!0))):!1};we.getPrevToken=function(r){r=r||this.getNode();let t=r&&r.loc,e=t&&t.tokens;if(e&&t.start.token>0){let s=e[t.start.token-1];if(s){let n=this.getRootValue().loc;if(J(n.start,s.loc.start)<=0)return s}}return null};we.getNextToken=function(r){r=r||this.getNode();let t=r&&r.loc,e=t&&t.tokens;if(e&&t.end.token<e.length){let s=e[t.end.token];if(s){let n=this.getRootValue().loc;if(J(s.loc.end,n.end)<=0)return s}}return null};we.needsParens=function(r){let t=this.getNode();if(t.type==="AssignmentExpression"&&t.left.type==="ObjectPattern")return!0;let e=this.getParentNode(),s=this.getName();if(this.getValue()!==t||re.Statement.check(t)||t.type==="Identifier"||e&&e.type==="ParenthesizedExpression")return!1;if(t.extra&&t.extra.parenthesized)return!0;if(!e)return!1;if(t.type==="UnaryExpression"&&e.type==="BinaryExpression"&&s==="left"&&e.left===t&&e.operator==="**")return!0;switch(t.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return e.type==="MemberExpression"&&s==="object"&&e.object===t;case"BinaryExpression":case"LogicalExpression":switch(e.type){case"CallExpression":return s==="callee"&&e.callee===t;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return s==="object"&&e.object===t;case"BinaryExpression":case"LogicalExpression":{let n=e.operator,i=Vc[n],a=t.operator,o=Vc[a];if(i>o||i===o&&s==="right")return!0;break}default:return!1}break;case"SequenceExpression":switch(e.type){case"ReturnStatement":return!1;case"ForStatement":return!1;case"ExpressionStatement":return s!=="expression";default:return!0}case"OptionalIndexedAccessType":return t.optional&&e.type==="IndexedAccessType";case"IntersectionTypeAnnotation":case"UnionTypeAnnotation":return e.type==="NullableTypeAnnotation";case"Literal":return e.type==="MemberExpression"&&ME.check(t.value)&&s==="object"&&e.object===t;case"NumericLiteral":return e.type==="MemberExpression"&&s==="object"&&e.object===t;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 s==="callee"&&e.callee===t;case"ConditionalExpression":return s==="test"&&e.test===t;case"MemberExpression":return s==="object"&&e.object===t;default:return!1}case"ArrowFunctionExpression":return re.CallExpression.check(e)&&s==="callee"&&e.callee===t||re.MemberExpression.check(e)&&s==="object"&&e.object===t||re.TSAsExpression&&re.TSAsExpression.check(e)&&s==="expression"&&e.expression===t?!0:Uf(e);case"ObjectExpression":if(e.type==="ArrowFunctionExpression"&&s==="body"&&e.body===t)return!0;break;case"TSAsExpression":if(e.type==="ArrowFunctionExpression"&&s==="body"&&e.body===t&&t.expression.type==="ObjectExpression")return!0;break;case"CallExpression":if(s==="declaration"&&re.ExportDefaultDeclaration.check(e)&&re.FunctionExpression.check(t.callee))return!0}return e.type==="NewExpression"&&s==="callee"&&e.callee===t?Yc(t):!!(r!==!0&&!this.canBeFirstInStatement()&&this.firstInStatement())};function Uf(r){return re.BinaryExpression.check(r)||re.LogicalExpression.check(r)}function Yc(r){return re.CallExpression.check(r)?!0:OE.check(r)?r.some(Yc):re.Node.check(r)?hE(r,(t,e)=>Yc(e)):!1}we.canBeFirstInStatement=function(){let r=this.getNode();return!(re.FunctionExpression.check(r)||re.ObjectExpression.check(r)||re.ClassExpression.check(r))};we.firstInStatement=function(){let r=this.stack,t,e,s,n;for(let i=r.length-1;i>=0;i-=2)if(re.Node.check(r[i])&&(s=t,n=e,t=r[i-1],e=r[i]),!(!e||!n)){if(re.BlockStatement.check(e)&&t==="body"&&s===0||re.ExpressionStatement.check(e)&&s==="expression"||re.AssignmentExpression.check(e)&&s==="left"||re.ArrowFunctionExpression.check(e)&&s==="body")return!0;if(!(re.SequenceExpression.check(e)&&r[i+1]==="expressions"&&s===0)&&!(re.CallExpression.check(e)&&s==="callee")&&!(re.MemberExpression.check(e)&&s==="object")&&!(re.ConditionalExpression.check(e)&&s==="test")&&!(Uf(e)&&s==="left")&&!(re.UnaryExpression.check(e)&&!e.prefix&&s==="argument"))return!1}return!0};var pn=ot.Printable,cf=ot.Expression,LE=ot.ReturnStatement,RE=ot.SourceLocation,hn=ct.object,Wc=ct.array,FE=ct.string,Yi=/[0-9a-z_$]/i,qf=function(t){let e=this,s=[];e.replace=function(n,i){FE.check(i)&&(i=v(i)),s.push({lines:i,start:n.start,end:n.end})},e.get=function(n){n=n||{start:{line:1,column:0},end:{line:t.length,column:t.getLineLength(t.length)}};let i=n.start,a=[];function o(c,l){a.push(t.slice(c,l))}return s.sort((c,l)=>J(c.start,l.start)).forEach(function(c){J(i,c.start)>0||(o(i,c.start),a.push(c.lines),i=c.end)}),o(i,n.end),S(a)}},Gf=qf.prototype;Gf.tryToReprintComments=function(r,t,e){let s=this;if(!r.comments&&!t.comments)return!0;let n=at.from(r),i=at.from(t);n.stack.push("comments",lf(r)),i.stack.push("comments",lf(t));let a=[],o=Hf(n,i,a);return o&&a.length>0&&a.forEach(function(c){let l=c.oldPath.getValue();s.replace(l.loc,e(c.newPath).indentTail(l.loc.indent))}),o};function lf(r){let t=[];return r.comments&&r.comments.length>0&&r.comments.forEach(function(e){(e.leading||e.trailing)&&t.push(e)}),t}Gf.deleteComments=function(r){if(!r.comments)return;let t=this;r.comments.forEach(function(e){e.leading?t.replace({start:e.loc.start,end:r.loc.lines.skipSpaces(e.loc.end,!1,!1)},""):e.trailing&&t.replace({start:r.loc.lines.skipSpaces(e.loc.start,!0,!1),end:e.loc.end},"")})};function BE(r){let t=r.getValue();if(!pn.check(t))return;let e=t.original,s=e&&e.loc,n=s&&s.lines,i=[];if(!(!n||!qE(r,i)))return function(a){let o=new qf(n);i.forEach(function(l){let u=l.newPath.getValue(),p=l.oldPath.getValue();RE.assert(p.loc,!0);let h=!o.tryToReprintComments(u,p,a);h&&o.deleteComments(p);let d=a(l.newPath,{includeComments:h,avoidRootParens:p.type===u.type&&l.oldPath.hasParens()}).indentTail(p.loc.indent),f=jE(n,p.loc,d),m=UE(n,p.loc,d);if(f||m){let y=[];f&&y.push(" "),y.push(d),m&&y.push(" "),d=S(y)}o.replace(p.loc,d)});let c=o.get(s).indentTail(-e.loc.indent);return r.needsParens()?S(["(",c,")"]):c}}function jE(r,t,e){let s=Qt(t.start),n=r.prevPos(s)&&r.charAt(s),i=e.charAt(e.firstPos());return n&&Yi.test(n)&&i&&Yi.test(i)}function UE(r,t,e){let s=r.charAt(t.end),n=e.lastPos(),i=e.prevPos(n)&&e.charAt(n);return i&&Yi.test(i)&&s&&Yi.test(s)}function qE(r,t){let e=r.getValue();pn.assert(e);let s=e.original;if(pn.assert(s),e.type!==s.type)return!1;let n=new at(s),i=zc(r,n,t);return i||(t.length=0),i}function $f(r,t,e){let s=r.getValue(),n=t.getValue();return s===n?!0:Wc.check(s)?Hf(r,t,e):hn.check(s)?GE(r,t,e):!1}function Hf(r,t,e){let s=r.getValue(),n=t.getValue();if(s===n||r.valueIsDuplicate()||t.valueIsDuplicate())return!0;Wc.assert(s);let i=s.length;if(!(Wc.check(n)&&n.length===i))return!1;for(let a=0;a<i;++a){r.stack.push(a,s[a]),t.stack.push(a,n[a]);let o=$f(r,t,e);if(r.stack.length-=2,t.stack.length-=2,!o)return!1}return!0}function GE(r,t,e){let s=r.getValue();if(hn.assert(s),s.original===null)return!1;let n=t.getValue();if(!hn.check(n))return!1;if(s===n||r.valueIsDuplicate()||t.valueIsDuplicate())return!0;if(pn.check(s)){if(!pn.check(n))return!1;let i=r.getParentNode(),a=t.getParentNode();if(a!==null&&a.type==="FunctionTypeAnnotation"&&i!==null&&i.type==="FunctionTypeAnnotation"){let o=a.params.length!==1||!!a.params[0].name,c=i.params.length!==1||!!i.params[0].name;if(!o&&c)return!1}if(s.type===n.type){let o=[];if(zc(r,t,o))e.push.apply(e,o);else if(n.loc)e.push({oldPath:t.copy(),newPath:r.copy()});else return!1;return!0}return cf.check(s)&&cf.check(n)&&n.loc?(e.push({oldPath:t.copy(),newPath:r.copy()}),!0):!1}return zc(r,t,e)}function zc(r,t,e){let s=r.getValue(),n=t.getValue();if(hn.assert(s),hn.assert(n),s.original===null||r.needsParens()&&!t.hasParens())return!1;let i=mE(n,s);(n.type==="File"||s.type==="File")&&delete i.tokens,delete i.loc;let a=e.length;for(let o in i){if(o.charAt(0)==="_")continue;r.stack.push(o,Lt(s,o)),t.stack.push(o,Lt(n,o));let c=$f(r,t,e);if(r.stack.length-=2,t.stack.length-=2,!c)return!1}return!(LE.check(r.getNode())&&e.length>a)}var le=ot,Qc=ct.string,$E=ct.object,Wi=function(t,e){Qc.assert(t),this.code=t,e&&($E.assert(e),this.map=e)},HE=Wi.prototype,uf=!1;HE.toString=function(){return uf||(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."),uf=!0),this.code};var pf=new Wi(""),VE=function(t){let e=t&&t.tabWidth;t=Ki(t),t.sourceFileName=null;function s(i,a){return i=Object.assign({},i,a),o=>n(o,i)}function n(i,a){if(a=a||{},a.includeComments)return of(i,s(a,{includeComments:!1}));let o=t.tabWidth;if(!e){let u=i.getNode().loc;u&&u.lines&&u.lines.guessTabWidth&&(t.tabWidth=u.lines.guessTabWidth())}let c=BE(i),l=c?c(n):hf(i,t,a,s(a,{includeComments:!0,avoidRootParens:!1}));return t.tabWidth=o,l}this.print=function(i){if(!i)return pf;let a=n(at.from(i),{includeComments:!0,avoidRootParens:!1});return new Wi(a.toString(t),yE(t.inputSourceMap,a.getSourceMap(t.sourceMapName,t.sourceRoot)))},this.printGenerically=function(i){if(!i)return pf;function a(u){return of(u,p=>hf(p,t,{includeComments:!0,avoidRootParens:!1},a))}let o=at.from(i),c=t.reuseWhitespace;t.reuseWhitespace=!1;let l=new Wi(a(o).toString(t));return t.reuseWhitespace=c,l}};function hf(r,t,e,s){let n=r.getValue(),i=[],a=YE(r,t,s);if(!n||a.isEmpty())return a;let o=!1,c=WE(r,s);return c.isEmpty()?e.avoidRootParens||(o=r.needsParens()):i.push(c),o&&i.unshift("("),i.push(a),o&&i.push(")"),S(i)}function YE(r,t,e){let s=r.getValue();if(!s)return v("");if(typeof s=="string")return v(s,t);le.Printable.assert(s);let n=[];switch(s.type){case"File":return r.call(e,"program");case"Program":return s.directives&&r.each(function(i){n.push(e(i),`;
|
|
47
|
+
`)},"directives"),s.interpreter&&n.push(r.call(e,"interpreter")),n.push(r.call(i=>rr(i,t,e),"body")),S(n);case"Noop":case"EmptyStatement":return v("");case"ExpressionStatement":return S([r.call(e,"expression"),";"]);case"ParenthesizedExpression":return S(["(",r.call(e,"expression"),")"]);case"BinaryExpression":case"LogicalExpression":case"AssignmentExpression":return v(" ").join([r.call(e,"left"),s.operator,r.call(e,"right")]);case"AssignmentPattern":return S([r.call(e,"left")," = ",r.call(e,"right")]);case"MemberExpression":case"OptionalMemberExpression":{n.push(r.call(e,"object"));let i=r.call(e,"property"),a=Lt(s,"optional");return s.computed?n.push(a?"?.[":"[",i,"]"):n.push(a?"?.":".",i),S(n)}case"ChainExpression":return r.call(e,"expression");case"MetaProperty":return S([r.call(e,"meta"),".",r.call(e,"property")]);case"BindExpression":return s.object&&n.push(r.call(e,"object")),n.push("::",r.call(e,"callee")),S(n);case"Path":return v(".").join(s.body);case"Identifier":return S([v(s.name,t),s.optional?"?":"",r.call(e,"typeAnnotation")]);case"SpreadElement":case"SpreadElementPattern":case"RestProperty":case"SpreadProperty":case"SpreadPropertyPattern":case"ObjectTypeSpreadProperty":case"RestElement":return S(["...",r.call(e,"argument"),r.call(e,"typeAnnotation")]);case"FunctionDeclaration":case"FunctionExpression":case"TSDeclareFunction":return s.declare&&n.push("declare "),s.async&&n.push("async "),n.push("function"),s.generator&&n.push("*"),s.id?n.push(" ",r.call(e,"id"),r.call(e,"typeParameters")):s.typeParameters&&n.push(r.call(e,"typeParameters")),n.push("(",yt(r,t,e),")",r.call(e,"returnType")),s.body&&n.push(" ",r.call(e,"body")),S(n);case"ArrowFunctionExpression":return s.async&&n.push("async "),s.typeParameters&&n.push(r.call(e,"typeParameters")),!t.arrowParensAlways&&s.params.length===1&&!s.rest&&s.params[0].type==="Identifier"&&!s.params[0].typeAnnotation&&!s.returnType?n.push(r.call(e,"params",0)):n.push("(",yt(r,t,e),")",r.call(e,"returnType")),n.push(" => ",r.call(e,"body")),S(n);case"MethodDefinition":return Rc(r,t,e);case"YieldExpression":return n.push("yield"),s.delegate&&n.push("*"),s.argument&&n.push(" ",r.call(e,"argument")),S(n);case"AwaitExpression":return n.push("await"),s.all&&n.push("*"),s.argument&&n.push(" ",r.call(e,"argument")),S(n);case"ModuleExpression":return S([`module {
|
|
48
|
+
`,r.call(e,"body").indent(t.tabWidth),`
|
|
49
|
+
}`]);case"ModuleDeclaration":return n.push("module",r.call(e,"id")),s.source?n.push("from",r.call(e,"source")):n.push(r.call(e,"body")),v(" ").join(n);case"ImportSpecifier":return s.importKind&&s.importKind!=="value"&&n.push(s.importKind+" "),s.imported?(n.push(r.call(e,"imported")),s.local&&s.local.name!==s.imported.name&&n.push(" as ",r.call(e,"local"))):s.id&&(n.push(r.call(e,"id")),s.name&&n.push(" as ",r.call(e,"name"))),S(n);case"ExportSpecifier":return s.exportKind&&s.exportKind!=="value"&&n.push(s.exportKind+" "),s.local?(n.push(r.call(e,"local")),s.exported&&s.exported.name!==s.local.name&&n.push(" as ",r.call(e,"exported"))):s.id&&(n.push(r.call(e,"id")),s.name&&n.push(" as ",r.call(e,"name"))),S(n);case"ExportBatchSpecifier":return v("*");case"ImportNamespaceSpecifier":return n.push("* as "),s.local?n.push(r.call(e,"local")):s.id&&n.push(r.call(e,"id")),S(n);case"ImportDefaultSpecifier":return s.local?r.call(e,"local"):r.call(e,"id");case"TSExportAssignment":return S(["export = ",r.call(e,"expression")]);case"ExportDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":return ff(r,t,e);case"ExportAllDeclaration":return n.push("export *"),s.exported&&n.push(" as ",r.call(e,"exported")),n.push(" from ",r.call(e,"source"),";"),S(n);case"TSNamespaceExportDeclaration":return n.push("export as namespace ",r.call(e,"id")),Ui(S(n));case"ExportNamespaceSpecifier":return S(["* as ",r.call(e,"exported")]);case"ExportDefaultSpecifier":return r.call(e,"exported");case"Import":return v("import",t);case"ImportExpression":return S(["import(",r.call(e,"source"),")"]);case"ImportDeclaration":{if(n.push("import "),s.importKind&&s.importKind!=="value"&&n.push(s.importKind+" "),s.specifiers&&s.specifiers.length>0){let i=[],a=[];if(r.each(function(o){let c=o.getValue();c.type==="ImportSpecifier"?a.push(e(o)):(c.type==="ImportDefaultSpecifier"||c.type==="ImportNamespaceSpecifier")&&i.push(e(o))},"specifiers"),i.forEach((o,c)=>{c>0&&n.push(", "),n.push(o)}),a.length>0){let o=v(", ").join(a);o.getLineLength(1)>t.wrapColumn&&(o=S([v(`,
|
|
50
|
+
`).join(a).indent(t.tabWidth),","])),i.length>0&&n.push(", "),o.length>1?n.push(`{
|
|
21
51
|
`,o,`
|
|
22
|
-
}`):
|
|
23
|
-
`),
|
|
24
|
-
`:"")},"directives"),
|
|
25
|
-
}`),
|
|
26
|
-
`,
|
|
27
|
-
)`):
|
|
28
|
-
`);let d=
|
|
29
|
-
`),
|
|
52
|
+
}`):t.objectCurlySpacing?n.push("{ ",o," }"):n.push("{",o,"}")}n.push(" from ")}return n.push(r.call(e,"source"),Yf(r,t,e),";"),S(n)}case"ImportAttribute":return S([r.call(e,"key"),": ",r.call(e,"value")]);case"StaticBlock":n.push("static ");case"BlockStatement":{let i=r.call(a=>rr(a,t,e),"body");return i.isEmpty()&&(!s.directives||s.directives.length===0)?(n.push("{}"),S(n)):(n.push(`{
|
|
53
|
+
`),s.directives&&r.each(function(a){n.push(Ui(e(a).indent(t.tabWidth)),s.directives.length>1||!i.isEmpty()?`
|
|
54
|
+
`:"")},"directives"),n.push(i.indent(t.tabWidth)),n.push(`
|
|
55
|
+
}`),S(n))}case"ReturnStatement":{if(n.push("return"),s.argument){let i=r.call(e,"argument");i.startsWithComment()||i.length>1&&le.JSXElement&&le.JSXElement.check(s.argument)?n.push(` (
|
|
56
|
+
`,i.indent(t.tabWidth),`
|
|
57
|
+
)`):n.push(" ",i)}return n.push(";"),S(n)}case"CallExpression":case"OptionalCallExpression":return n.push(r.call(e,"callee")),s.typeParameters&&n.push(r.call(e,"typeParameters")),s.typeArguments&&n.push(r.call(e,"typeArguments")),Lt(s,"optional")&&n.push("?."),n.push(df(r,t,e)),S(n);case"RecordExpression":n.push("#");case"ObjectExpression":case"ObjectPattern":case"ObjectTypeAnnotation":{let i=s.type==="ObjectTypeAnnotation",a=t.flowObjectCommas?",":i?";":",",o=[],c=!1;i&&(o.push("indexers","callProperties"),s.internalSlots!=null&&o.push("internalSlots")),o.push("properties");let l=0;o.forEach(function(m){l+=s[m].length});let u=i&&l===1||l===0,p=s.exact?"{|":"{",h=s.exact?"|}":"}";n.push(u?p:p+`
|
|
58
|
+
`);let d=n.length-1,f=0;if(o.forEach(function(m){r.each(function(y){let b=e(y);u||(b=b.indent(t.tabWidth));let x=!i&&b.length>1;x&&c&&n.push(`
|
|
59
|
+
`),n.push(b),f<l-1?(n.push(a+(x?`
|
|
30
60
|
|
|
31
61
|
`:`
|
|
32
|
-
`)),
|
|
33
|
-
`,
|
|
34
|
-
`+
|
|
35
|
-
`),
|
|
36
|
-
`)}},"elements"),
|
|
37
|
-
`,
|
|
38
|
-
`).join(a).indentTail(
|
|
39
|
-
else`,
|
|
40
|
-
`:"; ",o="for (",
|
|
41
|
-
`),u=u.trimLeft()),
|
|
42
|
-
while`),
|
|
43
|
-
`,
|
|
44
|
-
}`])}case"BreakStatement":return
|
|
45
|
-
`,
|
|
46
|
-
`,
|
|
47
|
-
`).join(
|
|
48
|
-
}`]);case"SwitchCase":return
|
|
49
|
-
`,
|
|
50
|
-
`}return e(u)},"children")).indentTail(
|
|
51
|
-
`)}),a=
|
|
52
|
-
`,
|
|
53
|
-
}`]);case"ClassPropertyDefinition":return
|
|
54
|
-
`),
|
|
55
|
-
`)}},"types"),o&&
|
|
56
|
-
`,
|
|
57
|
-
`).join(
|
|
58
|
-
}`),
|
|
59
|
-
`,
|
|
60
|
-
}`]);case"TSTupleType":return
|
|
61
|
-
`).join(
|
|
62
|
-
`,
|
|
63
|
-
}`),
|
|
64
|
-
`).join(
|
|
65
|
-
`,
|
|
66
|
-
}`),
|
|
67
|
-
`).join(
|
|
68
|
-
`,
|
|
69
|
-
}`])}case"TSImportType":return
|
|
70
|
-
`,
|
|
71
|
-
}`),
|
|
72
|
-
`)},"decorators"):
|
|
73
|
-
`)},"declaration","decorators"),
|
|
74
|
-
`)}else p
|
|
62
|
+
`)),c=!x):(l!==1&&i||!u&&ln(t,"objects")&&y.getValue().type!=="RestElement")&&n.push(a),f++},m)}),s.inexact){let m=v("...",t);u?(l>0&&n.push(a," "),n.push(m)):n.push(`
|
|
63
|
+
`,m.indent(t.tabWidth))}return n.push(u?h:`
|
|
64
|
+
`+h),f!==0&&u&&t.objectCurlySpacing&&(n[d]=p+" ",n[n.length-1]=" "+h),s.typeAnnotation&&n.push(r.call(e,"typeAnnotation")),S(n)}case"PropertyPattern":return S([r.call(e,"key"),": ",r.call(e,"pattern")]);case"ObjectProperty":case"Property":{if(s.method||s.kind==="get"||s.kind==="set")return Rc(r,t,e);if(s.shorthand&&s.value.type==="AssignmentPattern")return r.call(e,"value");let i=r.call(e,"key");return s.computed?n.push("[",i,"]"):n.push(i),(!s.shorthand||s.key.name!==s.value.name)&&n.push(": ",r.call(e,"value")),S(n)}case"ClassMethod":case"ObjectMethod":case"ClassPrivateMethod":case"TSDeclareMethod":return Rc(r,t,e);case"PrivateName":return S(["#",r.call(e,"id")]);case"Decorator":return S(["@",r.call(e,"expression")]);case"TupleExpression":n.push("#");case"ArrayExpression":case"ArrayPattern":{let a=s.elements.length,o=r.map(e,"elements"),l=v(", ").join(o).getLineLength(1)<=t.wrapColumn;return l?t.arrayBracketSpacing?n.push("[ "):n.push("["):n.push(`[
|
|
65
|
+
`),r.each(function(u){let p=u.getName();if(!u.getValue())n.push(",");else{let d=o[p];l?p>0&&n.push(" "):d=d.indent(t.tabWidth),n.push(d),(p<a-1||!l&&ln(t,"arrays"))&&n.push(","),l||n.push(`
|
|
66
|
+
`)}},"elements"),l&&t.arrayBracketSpacing?n.push(" ]"):n.push("]"),s.typeAnnotation&&n.push(r.call(e,"typeAnnotation")),S(n)}case"SequenceExpression":return v(", ").join(r.map(e,"expressions"));case"ThisExpression":return v("this");case"Super":return v("super");case"NullLiteral":return v("null");case"RegExpLiteral":return v(nr(s)||`/${s.pattern}/${s.flags||""}`,t);case"BigIntLiteral":return v(nr(s)||s.value+"n",t);case"NumericLiteral":return v(nr(s)||s.value,t);case"DecimalLiteral":return v(nr(s)||s.value+"m",t);case"StringLiteral":return v(an(s.value,t));case"BooleanLiteral":case"Literal":return v(nr(s)||(typeof s.value=="string"?an(s.value,t):s.value),t);case"Directive":return r.call(e,"value");case"DirectiveLiteral":return v(nr(s)||an(s.value,t),t);case"InterpreterDirective":return v(`#!${s.value}
|
|
67
|
+
`,t);case"ModuleSpecifier":if(s.local)throw new Error("The ESTree ModuleSpecifier type should be abstract");return v(an(s.value,t),t);case"UnaryExpression":return n.push(s.operator),/[a-z]$/.test(s.operator)&&n.push(" "),n.push(r.call(e,"argument")),S(n);case"UpdateExpression":return n.push(r.call(e,"argument"),s.operator),s.prefix&&n.reverse(),S(n);case"ConditionalExpression":return S([r.call(e,"test")," ? ",r.call(e,"consequent")," : ",r.call(e,"alternate")]);case"NewExpression":return n.push("new ",r.call(e,"callee")),s.typeParameters&&n.push(r.call(e,"typeParameters")),s.typeArguments&&n.push(r.call(e,"typeArguments")),s.arguments&&n.push(df(r,t,e)),S(n);case"VariableDeclaration":{s.declare&&n.push("declare "),n.push(s.kind," ");let i=0,a=r.map(function(c){let l=e(c);return i=Math.max(l.length,i),l},"declarations");i===1?n.push(v(", ").join(a)):a.length>1?n.push(v(`,
|
|
68
|
+
`).join(a).indentTail(s.kind.length+1)):n.push(a[0]);let o=r.getParentNode();return!le.ForStatement.check(o)&&!le.ForInStatement.check(o)&&!(le.ForOfStatement&&le.ForOfStatement.check(o))&&!(le.ForAwaitStatement&&le.ForAwaitStatement.check(o))&&n.push(";"),S(n)}case"VariableDeclarator":return s.init?v(" = ").join([r.call(e,"id"),r.call(e,"init")]):r.call(e,"id");case"WithStatement":return S(["with (",r.call(e,"object"),") ",r.call(e,"body")]);case"IfStatement":{let i=ys(r.call(e,"consequent"),t);return n.push("if (",r.call(e,"test"),")",i),s.alternate&&n.push(mf(i)?" else":`
|
|
69
|
+
else`,ys(r.call(e,"alternate"),t)),S(n)}case"ForStatement":{let i=r.call(e,"init"),a=i.length>1?`;
|
|
70
|
+
`:"; ",o="for (",c=v(a).join([i,r.call(e,"test"),r.call(e,"update")]).indentTail(o.length),l=S([o,c,")"]),u=ys(r.call(e,"body"),t);return n.push(l),l.length>1&&(n.push(`
|
|
71
|
+
`),u=u.trimLeft()),n.push(u),S(n)}case"WhileStatement":return S(["while (",r.call(e,"test"),")",ys(r.call(e,"body"),t)]);case"ForInStatement":return S([s.each?"for each (":"for (",r.call(e,"left")," in ",r.call(e,"right"),")",ys(r.call(e,"body"),t)]);case"ForOfStatement":case"ForAwaitStatement":return n.push("for "),(s.await||s.type==="ForAwaitStatement")&&n.push("await "),n.push("(",r.call(e,"left")," of ",r.call(e,"right"),")",ys(r.call(e,"body"),t)),S(n);case"DoWhileStatement":{let i=S(["do",ys(r.call(e,"body"),t)]);return n.push(i),mf(i)?n.push(" while"):n.push(`
|
|
72
|
+
while`),n.push(" (",r.call(e,"test"),");"),S(n)}case"DoExpression":{let i=r.call(a=>rr(a,t,e),"body");return S([`do {
|
|
73
|
+
`,i.indent(t.tabWidth),`
|
|
74
|
+
}`])}case"BreakStatement":return n.push("break"),s.label&&n.push(" ",r.call(e,"label")),n.push(";"),S(n);case"ContinueStatement":return n.push("continue"),s.label&&n.push(" ",r.call(e,"label")),n.push(";"),S(n);case"LabeledStatement":return S([r.call(e,"label"),`:
|
|
75
|
+
`,r.call(e,"body")]);case"TryStatement":return n.push("try ",r.call(e,"block")),s.handler?n.push(" ",r.call(e,"handler")):s.handlers&&r.each(function(i){n.push(" ",e(i))},"handlers"),s.finalizer&&n.push(" finally ",r.call(e,"finalizer")),S(n);case"CatchClause":return n.push("catch "),s.param&&n.push("(",r.call(e,"param")),s.guard&&n.push(" if ",r.call(e,"guard")),s.param&&n.push(") "),n.push(r.call(e,"body")),S(n);case"ThrowStatement":return S(["throw ",r.call(e,"argument"),";"]);case"SwitchStatement":return S(["switch (",r.call(e,"discriminant"),`) {
|
|
76
|
+
`,v(`
|
|
77
|
+
`).join(r.map(e,"cases")),`
|
|
78
|
+
}`]);case"SwitchCase":return s.test?n.push("case ",r.call(e,"test"),":"):n.push("default:"),s.consequent.length>0&&n.push(`
|
|
79
|
+
`,r.call(i=>rr(i,t,e),"consequent").indent(t.tabWidth)),S(n);case"DebuggerStatement":return v("debugger;");case"JSXAttribute":return n.push(r.call(e,"name")),s.value&&n.push("=",r.call(e,"value")),S(n);case"JSXIdentifier":return v(s.name,t);case"JSXNamespacedName":return v(":").join([r.call(e,"namespace"),r.call(e,"name")]);case"JSXMemberExpression":return v(".").join([r.call(e,"object"),r.call(e,"property")]);case"JSXSpreadAttribute":return S(["{...",r.call(e,"argument"),"}"]);case"JSXSpreadChild":return S(["{...",r.call(e,"expression"),"}"]);case"JSXExpressionContainer":return S(["{",r.call(e,"expression"),"}"]);case"JSXElement":case"JSXFragment":{let i="opening"+(s.type==="JSXElement"?"Element":"Fragment"),a="closing"+(s.type==="JSXElement"?"Element":"Fragment"),o=r.call(e,i);if(s[i].selfClosing)return o;let c=S(r.map(function(u){let p=u.getValue();if(le.Literal.check(p)&&typeof p.value=="string"){if(/\S/.test(p.value))return p.value.replace(/^\s+|\s+$/g,"");if(/\n/.test(p.value))return`
|
|
80
|
+
`}return e(u)},"children")).indentTail(t.tabWidth),l=r.call(e,a);return S([o,c,l])}case"JSXOpeningElement":{n.push("<",r.call(e,"name"));let i=[];r.each(function(c){i.push(" ",e(c))},"attributes");let a=S(i);return(a.length>1||a.getLineLength(1)>t.wrapColumn)&&(i.forEach(function(c,l){c===" "&&(i[l]=`
|
|
81
|
+
`)}),a=S(i).indentTail(t.tabWidth)),n.push(a,s.selfClosing?" />":">"),S(n)}case"JSXClosingElement":return S(["</",r.call(e,"name"),">"]);case"JSXOpeningFragment":return v("<>");case"JSXClosingFragment":return v("</>");case"JSXText":return v(s.value,t);case"JSXEmptyExpression":return v("");case"TypeAnnotatedIdentifier":return S([r.call(e,"annotation")," ",r.call(e,"identifier")]);case"ClassBody":return s.body.length===0?v("{}"):S([`{
|
|
82
|
+
`,r.call(i=>rr(i,t,e),"body").indent(t.tabWidth),`
|
|
83
|
+
}`]);case"ClassPropertyDefinition":return n.push("static ",r.call(e,"definition")),le.MethodDefinition.check(s.definition)||n.push(";"),S(n);case"ClassProperty":{s.declare&&n.push("declare ");let i=s.accessibility||s.access;typeof i=="string"&&n.push(i," "),s.static&&n.push("static "),s.abstract&&n.push("abstract "),s.readonly&&n.push("readonly ");let a=r.call(e,"key");return s.computed&&(a=S(["[",a,"]"])),s.variance&&(a=S([nn(r,e),a])),n.push(a),s.optional&&n.push("?"),s.definite&&n.push("!"),s.typeAnnotation&&n.push(r.call(e,"typeAnnotation")),s.value&&n.push(" = ",r.call(e,"value")),n.push(";"),S(n)}case"ClassPrivateProperty":return s.static&&n.push("static "),n.push(r.call(e,"key")),s.typeAnnotation&&n.push(r.call(e,"typeAnnotation")),s.value&&n.push(" = ",r.call(e,"value")),n.push(";"),S(n);case"ClassAccessorProperty":return n.push(...Vf(s),"accessor "),s.computed?n.push("[",r.call(e,"key"),"]"):n.push(r.call(e,"key")),s.optional&&n.push("?"),s.definite&&n.push("!"),s.typeAnnotation&&n.push(r.call(e,"typeAnnotation")),s.value&&n.push(" = ",r.call(e,"value")),n.push(";"),S(n);case"ClassDeclaration":case"ClassExpression":case"DeclareClass":return s.declare&&n.push("declare "),s.abstract&&n.push("abstract "),n.push("class"),s.id&&n.push(" ",r.call(e,"id")),s.typeParameters&&n.push(r.call(e,"typeParameters")),s.superClass&&n.push(" extends ",r.call(e,"superClass"),r.call(e,"superTypeParameters")),s.extends&&s.extends.length>0&&n.push(" extends ",v(", ").join(r.map(e,"extends"))),s.implements&&s.implements.length>0&&n.push(" implements ",v(", ").join(r.map(e,"implements"))),n.push(" ",r.call(e,"body")),s.type==="DeclareClass"?rn(r,n):S(n);case"TemplateElement":return v(s.value.raw,t).lockIndentTail();case"TemplateLiteral":{let i=r.map(e,"expressions");return n.push("`"),r.each(function(a){let o=a.getName();n.push(e(a)),o<i.length&&n.push("${",i[o],"}")},"quasis"),n.push("`"),S(n).lockIndentTail()}case"TaggedTemplateExpression":return S([r.call(e,"tag"),r.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(s.type));case"CommentBlock":case"Block":return S(["/*",v(s.value,t),"*/"]);case"CommentLine":case"Line":return S(["//",v(s.value,t)]);case"TypeAnnotation":return s.typeAnnotation?(s.typeAnnotation.type!=="FunctionTypeAnnotation"&&n.push(": "),n.push(r.call(e,"typeAnnotation")),S(n)):v("");case"ExistentialTypeParam":case"ExistsTypeAnnotation":return v("*",t);case"EmptyTypeAnnotation":return v("empty",t);case"AnyTypeAnnotation":return v("any",t);case"MixedTypeAnnotation":return v("mixed",t);case"ArrayTypeAnnotation":return S([r.call(e,"elementType"),"[]"]);case"TupleTypeAnnotation":{let i=r.map(e,"types"),o=v(", ").join(i).getLineLength(1)<=t.wrapColumn;return o?t.arrayBracketSpacing?n.push("[ "):n.push("["):n.push(`[
|
|
84
|
+
`),r.each(function(c){let l=c.getName();if(!c.getValue())n.push(",");else{let p=i[l];o?l>0&&n.push(" "):p=p.indent(t.tabWidth),n.push(p),(l<s.types.length-1||!o&&ln(t,"arrays"))&&n.push(","),o||n.push(`
|
|
85
|
+
`)}},"types"),o&&t.arrayBracketSpacing?n.push(" ]"):n.push("]"),S(n)}case"BooleanTypeAnnotation":return v("boolean",t);case"BooleanLiteralTypeAnnotation":return v(""+s.value,t);case"InterfaceTypeAnnotation":return n.push("interface"),s.extends&&s.extends.length>0&&n.push(" extends ",v(", ").join(r.map(e,"extends"))),n.push(" ",r.call(e,"body")),S(n);case"DeclareFunction":return rn(r,["function ",r.call(e,"id"),";"]);case"DeclareModule":return rn(r,["module ",r.call(e,"id")," ",r.call(e,"body")]);case"DeclareModuleExports":return rn(r,["module.exports",r.call(e,"typeAnnotation")]);case"DeclareVariable":return rn(r,["var ",r.call(e,"id"),";"]);case"DeclareExportDeclaration":case"DeclareExportAllDeclaration":return S(["declare ",ff(r,t,e)]);case"EnumDeclaration":return S(["enum ",r.call(e,"id"),r.call(e,"body")]);case"EnumBooleanBody":case"EnumNumberBody":case"EnumStringBody":case"EnumSymbolBody":return(s.type==="EnumSymbolBody"||s.explicitType)&&n.push(" of ",s.type.slice(4,-4).toLowerCase()),n.push(` {
|
|
86
|
+
`,v(`
|
|
87
|
+
`).join(r.map(e,"members")).indent(t.tabWidth),`
|
|
88
|
+
}`),S(n);case"EnumDefaultedMember":return S([r.call(e,"id"),","]);case"EnumBooleanMember":case"EnumNumberMember":case"EnumStringMember":return S([r.call(e,"id")," = ",r.call(e,"init"),","]);case"InferredPredicate":return v("%checks",t);case"DeclaredPredicate":return S(["%checks(",r.call(e,"value"),")"]);case"FunctionTypeAnnotation":{let i=r.getParentNode(0),a=!(le.ObjectTypeCallProperty.check(i)||le.ObjectTypeInternalSlot.check(i)&&i.method||le.DeclareFunction.check(r.getParentNode(2)));a&&!le.FunctionTypeParam.check(i)&&!le.TypeAlias.check(i)&&n.push(": ");let c=!!s.typeParameters,l=c||s.params.length!==1||s.params[0].name;return n.push(c?r.call(e,"typeParameters"):"",l?"(":"",yt(r,t,e),l?")":""),s.returnType&&n.push(a?" => ":": ",r.call(e,"returnType")),S(n)}case"FunctionTypeParam":{let i=r.call(e,"name");return n.push(i),s.optional&&n.push("?"),i.infos[0].line&&n.push(": "),n.push(r.call(e,"typeAnnotation")),S(n)}case"GenericTypeAnnotation":return S([r.call(e,"id"),r.call(e,"typeParameters")]);case"DeclareInterface":n.push("declare ");case"InterfaceDeclaration":case"TSInterfaceDeclaration":return s.declare&&n.push("declare "),n.push("interface ",r.call(e,"id"),r.call(e,"typeParameters")," "),s.extends&&s.extends.length>0&&n.push("extends ",v(", ").join(r.map(e,"extends"))," "),s.body&&n.push(r.call(e,"body")),S(n);case"ClassImplements":case"InterfaceExtends":return S([r.call(e,"id"),r.call(e,"typeParameters")]);case"IntersectionTypeAnnotation":return v(" & ").join(r.map(e,"types"));case"NullableTypeAnnotation":return S(["?",r.call(e,"typeAnnotation")]);case"NullLiteralTypeAnnotation":return v("null",t);case"ThisTypeAnnotation":return v("this",t);case"NumberTypeAnnotation":return v("number",t);case"ObjectTypeCallProperty":return r.call(e,"value");case"ObjectTypeIndexer":return s.static&&n.push("static "),n.push(nn(r,e),"["),s.id&&n.push(r.call(e,"id"),": "),n.push(r.call(e,"key"),"]: ",r.call(e,"value")),S(n);case"ObjectTypeProperty":return S([nn(r,e),r.call(e,"key"),s.optional?"?":"",": ",r.call(e,"value")]);case"ObjectTypeInternalSlot":return S([s.static?"static ":"","[[",r.call(e,"id"),"]]",s.optional?"?":"",s.value.type!=="FunctionTypeAnnotation"?": ":"",r.call(e,"value")]);case"QualifiedTypeIdentifier":return S([r.call(e,"qualification"),".",r.call(e,"id")]);case"StringLiteralTypeAnnotation":return v(an(s.value,t),t);case"NumberLiteralTypeAnnotation":case"NumericLiteralTypeAnnotation":return v(JSON.stringify(s.value),t);case"BigIntLiteralTypeAnnotation":return v(s.raw,t);case"StringTypeAnnotation":return v("string",t);case"DeclareTypeAlias":n.push("declare ");case"TypeAlias":return S(["type ",r.call(e,"id"),r.call(e,"typeParameters")," = ",r.call(e,"right"),";"]);case"DeclareOpaqueType":n.push("declare ");case"OpaqueType":return n.push("opaque type ",r.call(e,"id"),r.call(e,"typeParameters")),s.supertype&&n.push(": ",r.call(e,"supertype")),s.impltype&&n.push(" = ",r.call(e,"impltype")),n.push(";"),S(n);case"TypeCastExpression":return S(["(",r.call(e,"expression"),r.call(e,"typeAnnotation"),")"]);case"TypeParameterDeclaration":case"TypeParameterInstantiation":return S(["<",v(", ").join(r.map(e,"params")),">"]);case"Variance":return s.kind==="plus"?v("+"):s.kind==="minus"?v("-"):v("");case"TypeParameter":return s.variance&&n.push(nn(r,e)),n.push(r.call(e,"name")),s.bound&&n.push(r.call(e,"bound")),s.default&&n.push("=",r.call(e,"default")),S(n);case"TypeofTypeAnnotation":return S([v("typeof ",t),r.call(e,"argument")]);case"IndexedAccessType":case"OptionalIndexedAccessType":return S([r.call(e,"objectType"),s.optional?"?.":"","[",r.call(e,"indexType"),"]"]);case"UnionTypeAnnotation":return v(" | ").join(r.map(e,"types"));case"VoidTypeAnnotation":return v("void",t);case"NullTypeAnnotation":return v("null",t);case"SymbolTypeAnnotation":return v("symbol",t);case"BigIntTypeAnnotation":return v("bigint",t);case"TSType":throw new Error("unprintable type: "+JSON.stringify(s.type));case"TSNumberKeyword":return v("number",t);case"TSBigIntKeyword":return v("bigint",t);case"TSObjectKeyword":return v("object",t);case"TSBooleanKeyword":return v("boolean",t);case"TSStringKeyword":return v("string",t);case"TSSymbolKeyword":return v("symbol",t);case"TSAnyKeyword":return v("any",t);case"TSVoidKeyword":return v("void",t);case"TSIntrinsicKeyword":return v("intrinsic",t);case"TSThisType":return v("this",t);case"TSNullKeyword":return v("null",t);case"TSUndefinedKeyword":return v("undefined",t);case"TSUnknownKeyword":return v("unknown",t);case"TSNeverKeyword":return v("never",t);case"TSArrayType":return S([r.call(e,"elementType"),"[]"]);case"TSLiteralType":return r.call(e,"literal");case"TSUnionType":return v(" | ").join(r.map(e,"types"));case"TSIntersectionType":return v(" & ").join(r.map(e,"types"));case"TSConditionalType":return n.push(r.call(e,"checkType")," extends ",r.call(e,"extendsType")," ? ",r.call(e,"trueType")," : ",r.call(e,"falseType")),S(n);case"TSInferType":return n.push("infer ",r.call(e,"typeParameter")),S(n);case"TSParenthesizedType":return S(["(",r.call(e,"typeAnnotation"),")"]);case"TSFunctionType":return S([r.call(e,"typeParameters"),"(",yt(r,t,e),") => ",r.call(e,"typeAnnotation","typeAnnotation")]);case"TSConstructorType":return S(["new ",r.call(e,"typeParameters"),"(",yt(r,t,e),") => ",r.call(e,"typeAnnotation","typeAnnotation")]);case"TSMappedType":return n.push(s.readonly?"readonly ":"","[",r.call(e,"typeParameter"),"]",s.optional?"?":""),s.typeAnnotation&&n.push(": ",r.call(e,"typeAnnotation"),";"),S([`{
|
|
89
|
+
`,S(n).indent(t.tabWidth),`
|
|
90
|
+
}`]);case"TSTupleType":return S(["[",v(", ").join(r.map(e,"elementTypes")),"]"]);case"TSNamedTupleMember":return n.push(r.call(e,"label")),s.optional&&n.push("?"),n.push(": ",r.call(e,"elementType")),S(n);case"TSRestType":return S(["...",r.call(e,"typeAnnotation")]);case"TSOptionalType":return S([r.call(e,"typeAnnotation"),"?"]);case"TSIndexedAccessType":return S([r.call(e,"objectType"),"[",r.call(e,"indexType"),"]"]);case"TSTypeOperator":return S([r.call(e,"operator")," ",r.call(e,"typeAnnotation")]);case"TSTypeLiteral":{let i=v(`
|
|
91
|
+
`).join(r.map(e,"members").map(a=>dn(a)!==";"?a.concat(";"):a));return i.isEmpty()?v("{}",t):(n.push(`{
|
|
92
|
+
`,i.indent(t.tabWidth),`
|
|
93
|
+
}`),S(n))}case"TSEnumMember":return n.push(r.call(e,"id")),s.initializer&&n.push(" = ",r.call(e,"initializer")),S(n);case"TSTypeQuery":return S(["typeof ",r.call(e,"exprName")]);case"TSParameterProperty":return s.accessibility&&n.push(s.accessibility," "),s.export&&n.push("export "),s.static&&n.push("static "),s.readonly&&n.push("readonly "),n.push(r.call(e,"parameter")),S(n);case"TSTypeReference":return S([r.call(e,"typeName"),r.call(e,"typeParameters")]);case"TSQualifiedName":return S([r.call(e,"left"),".",r.call(e,"right")]);case"TSAsExpression":case"TSSatisfiesExpression":{let i=r.call(e,"expression");return n.push(i,s.type==="TSSatisfiesExpression"?" satisfies ":" as ",r.call(e,"typeAnnotation")),S(n)}case"TSTypeCastExpression":return S([r.call(e,"expression"),r.call(e,"typeAnnotation")]);case"TSNonNullExpression":return S([r.call(e,"expression"),"!"]);case"TSTypeAnnotation":return S([": ",r.call(e,"typeAnnotation")]);case"TSIndexSignature":return S([s.readonly?"readonly ":"","[",r.map(e,"parameters"),"]",r.call(e,"typeAnnotation")]);case"TSPropertySignature":return n.push(nn(r,e),s.readonly?"readonly ":""),s.computed?n.push("[",r.call(e,"key"),"]"):n.push(r.call(e,"key")),n.push(s.optional?"?":"",r.call(e,"typeAnnotation")),S(n);case"TSMethodSignature":return s.computed?n.push("[",r.call(e,"key"),"]"):n.push(r.call(e,"key")),s.optional&&n.push("?"),n.push(r.call(e,"typeParameters"),"(",yt(r,t,e),")",r.call(e,"typeAnnotation")),S(n);case"TSTypePredicate":return s.asserts&&n.push("asserts "),n.push(r.call(e,"parameterName")),s.typeAnnotation&&n.push(" is ",r.call(e,"typeAnnotation","typeAnnotation")),S(n);case"TSCallSignatureDeclaration":return S([r.call(e,"typeParameters"),"(",yt(r,t,e),")",r.call(e,"typeAnnotation")]);case"TSConstructSignatureDeclaration":return s.typeParameters?n.push("new",r.call(e,"typeParameters")):n.push("new "),n.push("(",yt(r,t,e),")",r.call(e,"typeAnnotation")),S(n);case"TSTypeAliasDeclaration":return S([s.declare?"declare ":"","type ",r.call(e,"id"),r.call(e,"typeParameters")," = ",r.call(e,"typeAnnotation"),";"]);case"TSTypeParameter":{n.push(r.call(e,"name"));let i=r.getParentNode(0),a=le.TSMappedType.check(i);return s.constraint&&n.push(a?" in ":" extends ",r.call(e,"constraint")),s.default&&n.push(" = ",r.call(e,"default")),S(n)}case"TSTypeAssertion":return n.push("<",r.call(e,"typeAnnotation"),"> ",r.call(e,"expression")),S(n);case"TSTypeParameterDeclaration":case"TSTypeParameterInstantiation":return S(["<",v(", ").join(r.map(e,"params")),">"]);case"TSEnumDeclaration":{n.push(s.declare?"declare ":"",s.const?"const ":"","enum ",r.call(e,"id"));let i=v(`,
|
|
94
|
+
`).join(r.map(e,"members"));return i.isEmpty()?n.push(" {}"):n.push(` {
|
|
95
|
+
`,i.indent(t.tabWidth),`
|
|
96
|
+
}`),S(n)}case"TSExpressionWithTypeArguments":return S([r.call(e,"expression"),r.call(e,"typeParameters")]);case"TSInterfaceBody":{let i=v(`
|
|
97
|
+
`).join(r.map(e,"body").map(a=>dn(a)!==";"?a.concat(";"):a));return i.isEmpty()?v("{}",t):S([`{
|
|
98
|
+
`,i.indent(t.tabWidth),`
|
|
99
|
+
}`])}case"TSImportType":return n.push("import(",r.call(e,"argument"),")"),s.qualifier&&n.push(".",r.call(e,"qualifier")),s.typeParameters&&n.push(r.call(e,"typeParameters")),S(n);case"TSImportEqualsDeclaration":return s.isExport&&n.push("export "),n.push("import ",r.call(e,"id")," = ",r.call(e,"moduleReference")),Ui(S(n));case"TSExternalModuleReference":return S(["require(",r.call(e,"expression"),")"]);case"TSModuleDeclaration":return r.getParentNode().type==="TSModuleDeclaration"?n.push("."):(s.declare&&n.push("declare "),s.global||(s.id.type==="StringLiteral"||s.id.type==="Literal"&&typeof s.id.value=="string"||s.loc&&s.loc.lines&&s.id.loc&&s.loc.lines.sliceString(s.loc.start,s.id.loc.start).indexOf("module")>=0?n.push("module "):n.push("namespace "))),n.push(r.call(e,"id")),s.body&&(n.push(" "),n.push(r.call(e,"body"))),S(n);case"TSModuleBlock":{let i=r.call(a=>rr(a,t,e),"body");return i.isEmpty()?n.push("{}"):n.push(`{
|
|
100
|
+
`,i.indent(t.tabWidth),`
|
|
101
|
+
}`),S(n)}case"TSInstantiationExpression":return n.push(r.call(e,"expression"),r.call(e,"typeParameters")),S(n);case"V8IntrinsicIdentifier":return S(["%",r.call(e,"name")]);case"TopicReference":return v("#");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(s.type))}}function WE(r,t){let e=[],s=r.getValue();return s.decorators&&s.decorators.length>0&&!If(r)?r.each(function(n){e.push(t(n),`
|
|
102
|
+
`)},"decorators"):Ji(s)&&s.declaration&&s.declaration.decorators&&r.each(function(n){e.push(t(n),`
|
|
103
|
+
`)},"declaration","decorators"),S(e)}function rr(r,t,e){let s=[];r.each(function(o){let c=o.getValue();c&&(c.type==="EmptyStatement"&&!(c.comments&&c.comments.length>0)||(le.Comment.check(c)||le.Statement.check(c)||Qc.assert(c),s.push({node:c,printed:e(o)})))});let n=null,i=s.length,a=[];return s.forEach(function(o,c){let l=o.printed,u=o.node,p=l.length>1,h=c>0,d=c<i-1,f,m,y=u&&u.loc&&u.loc.lines,b=y&&t.reuseWhitespace&&wf(u,y);if(h)if(b){let x=y.skipSpaces(b.start,!0),N=x?x.line:1,T=b.start.line-N;f=Array(T+1).join(`
|
|
104
|
+
`)}else f=p?`
|
|
75
105
|
|
|
76
106
|
`:`
|
|
77
|
-
`;else
|
|
78
|
-
`)}else
|
|
107
|
+
`;else f="";if(d)if(b){let x=y.skipSpaces(b.end),T=(x?x.line:y.length)-b.end.line;m=Array(T+1).join(`
|
|
108
|
+
`)}else m=p?`
|
|
79
109
|
|
|
80
110
|
`:`
|
|
81
|
-
`;else
|
|
82
|
-
`).join(
|
|
83
|
-
`,
|
|
111
|
+
`;else m="";a.push(zE(n,f),l),d?n=m:m&&a.push(m)}),S(a)}function zE(r,t){if(!r&&!t)return v("");if(!r)return v(t);if(!t)return v(r);let e=v(r),s=v(t);return s.length>e.length?s:e}function Vf(r){let t=[];r.declare&&t.push("declare ");let e=r.accessibility||r.access;return typeof e=="string"&&t.push(e," "),r.static&&t.push("static "),r.override&&t.push("override "),r.abstract&&t.push("abstract "),r.readonly&&t.push("readonly "),t}function Rc(r,t,e){let s=r.getNode(),n=s.kind,i=[],a=s.value;le.FunctionExpression.check(a)||(a=s),i.push(...Vf(s)),a.async&&i.push("async "),a.generator&&i.push("*"),(n==="get"||n==="set")&&i.push(n," ");let o=r.call(e,"key");return s.computed&&(o=S(["[",o,"]"])),i.push(o),s.optional&&i.push("?"),s===a?(i.push(r.call(e,"typeParameters"),"(",yt(r,t,e),")",r.call(e,"returnType")),s.body?i.push(" ",r.call(e,"body")):i.push(";")):(i.push(r.call(e,"value","typeParameters"),"(",r.call(c=>yt(c,t,e),"value"),")",r.call(e,"value","returnType")),a.body?i.push(" ",r.call(e,"value","body")):i.push(";")),S(i)}function df(r,t,e){let s=r.map(e,"arguments"),n=ln(t,"parameters"),i=v(", ").join(s);return i.getLineLength(1)>t.wrapColumn?(i=v(`,
|
|
112
|
+
`).join(s),S([`(
|
|
113
|
+
`,i.indent(t.tabWidth),n?`,
|
|
84
114
|
)`:`
|
|
85
|
-
)`])):
|
|
86
|
-
`).join(
|
|
87
|
-
`]):a=
|
|
88
|
-
`]),
|
|
89
|
-
`,a.indent(
|
|
90
|
-
`,
|
|
91
|
-
`).join(
|
|
92
|
-
}`):
|
|
93
|
-
`).join(
|
|
94
|
-
`,
|
|
95
|
-
}`):
|
|
96
|
-
`,
|
|
97
|
-
};`.indexOf(
|
|
98
|
-
`),a=Math.max(0,
|
|
99
|
-
${" ".repeat(6+
|
|
115
|
+
)`])):S(["(",i,")"])}function yt(r,t,e){let s=r.getValue(),n,i=[];s.params?(n=s.params,i=r.map(e,"params")):s.parameters&&(n=s.parameters,i=r.map(e,"parameters")),s.defaults&&r.each(function(o){let c=o.getName(),l=i[c];l&&o.getValue()&&(i[c]=S([l," = ",e(o)]))},"defaults"),s.rest&&i.push(S(["...",r.call(e,"rest")]));let a=v(", ").join(i);return a.length>1||a.getLineLength(1)>t.wrapColumn?(a=v(`,
|
|
116
|
+
`).join(i),ln(t,"parameters")&&!s.rest&&n[n.length-1].type!=="RestElement"?a=S([a,`,
|
|
117
|
+
`]):a=S([a,`
|
|
118
|
+
`]),S([`
|
|
119
|
+
`,a.indent(t.tabWidth)])):a}function Yf(r,t,e){let s=r.getValue();if(s.assertions&&s.assertions.length>0){let n=[" assert {"],i=r.map(e,"assertions"),a=v(", ").join(i);return a.length>1||a.getLineLength(1)>t.wrapColumn?n.push(`
|
|
120
|
+
`,v(`,
|
|
121
|
+
`).join(i).indent(t.tabWidth),`
|
|
122
|
+
}`):n.push(" ",a," }"),S(n)}return v("")}function ff(r,t,e){let s=r.getValue(),n=["export "];s.exportKind&&s.exportKind==="type"&&(s.declaration||n.push("type "));let i=t.objectCurlySpacing;if(le.Declaration.assert(s),(s.default||s.type==="ExportDefaultDeclaration")&&n.push("default "),s.declaration)n.push(r.call(e,"declaration"));else if(s.specifiers){if(s.specifiers.length===1&&s.specifiers[0].type==="ExportBatchSpecifier")n.push("*");else if(s.specifiers.length===0)n.push("{}");else if(s.specifiers[0].type==="ExportDefaultSpecifier"){let o=[],c=[];if(r.each(function(l){l.getValue().type==="ExportDefaultSpecifier"?o.push(e(l)):c.push(e(l))},"specifiers"),o.forEach((l,u)=>{u>0&&n.push(", "),n.push(l)}),c.length>0){let l=v(", ").join(c);l.getLineLength(1)>t.wrapColumn&&(l=S([v(`,
|
|
123
|
+
`).join(c).indent(t.tabWidth),","])),o.length>0&&n.push(", "),l.length>1?n.push(`{
|
|
124
|
+
`,l,`
|
|
125
|
+
}`):t.objectCurlySpacing?n.push("{ ",l," }"):n.push("{",l,"}")}}else n.push(i?"{ ":"{",v(", ").join(r.map(e,"specifiers")),i?" }":"}");s.source&&n.push(" from ",r.call(e,"source"),Yf(r,t,e))}let a=S(n);return dn(a)!==";"&&!(s.declaration&&(s.declaration.type==="FunctionDeclaration"||s.declaration.type==="ClassDeclaration"||s.declaration.type==="TSModuleDeclaration"||s.declaration.type==="TSInterfaceDeclaration"||s.declaration.type==="TSEnumDeclaration"))&&(a=S([a,";"])),a}function rn(r,t){return If(r)||t.unshift("declare "),S(t)}function nn(r,t){return r.call(function(e){let s=e.getValue();return s?s==="plus"?v("+"):s==="minus"?v("-"):t(e):v("")},"variance")}function ys(r,t){return r.length>1?S([" ",r]):S([`
|
|
126
|
+
`,Ui(r).indent(t.tabWidth)])}function dn(r){let t=r.lastPos();do{let e=r.charAt(t);if(/\S/.test(e))return e}while(r.prevPos(t))}function mf(r){return dn(r)==="}"}function Li(r){return r.replace(/['"]/g,t=>t==='"'?"'":'"')}function nr(r){let t=Lt(r,"value"),e=Lt(r,"extra");if(e&&typeof e.raw=="string"&&t==e.rawValue)return e.raw;if(r.type==="Literal"){let s=r.raw;if(typeof s=="string"&&t==s)return s}}function Ri(r){return JSON.stringify(r).replace(/[\u2028\u2029]/g,function(t){return"\\u"+t.charCodeAt(0).toString(16)})}function an(r,t){switch(Qc.assert(r),t.quote){case"auto":{let e=Ri(r),s=Li(Ri(Li(r)));return e.length>s.length?s:e}case"single":return Li(Ri(Li(r)));case"double":default:return Ri(r)}}function Ui(r){let t=dn(r);return!t||`
|
|
127
|
+
};`.indexOf(t)<0?S([r,";"]):r}function JE(r,t){return new VE(t).print(r)}var Fi;function Wf(){if(Fi)return Fi;let r=KE();return Fi={parse(t,e){return gf.parse(t,{...r,...e})}},Fi}function KE(){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 XE=Object.defineProperty,QE=(r,t,e)=>t in r?XE(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,yf=(r,t,e)=>(QE(r,typeof t!="symbol"?t+"":t,e),e),Ce=class extends Error{constructor(t,e){if(super(""),yf(this,"rawMessage"),yf(this,"options"),this.name="MagicastError",this.rawMessage=t,this.options=e,e?.ast&&e?.code&&e.ast.loc){let{line:s,column:n}=e.ast.loc.start,i=e.code.split(`
|
|
128
|
+
`),a=Math.max(0,s-3),o=Math.min(i.length,s+3),c=i.slice(a,o).map((l,u)=>(l=`${(a+u+1).toString().padStart(3," ")} | ${l}`,a+u===s-1&&(l+=`
|
|
129
|
+
${" ".repeat(6+n)}^`),l));t+=`
|
|
100
130
|
|
|
101
|
-
${
|
|
131
|
+
${c.join(`
|
|
102
132
|
`)}
|
|
103
|
-
`}this.message=s}},Pc=new Set(["Literal","StringLiteral","NumericLiteral","BooleanLiteral","NullLiteral","RegExpLiteral","BigIntLiteral"]),Kn=new Set(["string","number","boolean","bigint","symbol","undefined"]),Z=dt;function Sc(i){return/^[$A-Z_a-z][\w$]*$/.test(i)}var Vr="__magicast_proxy";function le(i,s=new Set){if(i===void 0)return Z.identifier("undefined");if(i===null)return Z.literal(null);if(Kn.has(typeof i))return Z.literal(i);if(s.has(i))throw new se("Can not serialize circular reference");if(s.add(i),i[Vr])return i.$ast;if(i instanceof RegExp){let e=Z.regExpLiteral(i.source,i.flags);return delete e.extra.raw,e}return i instanceof Set?Z.newExpression(Z.identifier("Set"),[Z.arrayExpression([...i].map(e=>le(e,s)))]):i instanceof Date?Z.newExpression(Z.identifier("Date"),[Z.literal(i.toISOString())]):i instanceof Map?Z.newExpression(Z.identifier("Map"),[Z.arrayExpression([...i].map(([e,t])=>Z.arrayExpression([le(e,s),le(t,s)])))]):Array.isArray(i)?Z.arrayExpression(i.map(e=>le(e,s))):typeof i=="object"?Z.objectExpression(Object.entries(i).map(([e,t])=>Z.property("init",/^[$A-Z_a-z][\w$]*$/g.test(e)?Z.identifier(e):Z.literal(e),le(t,s)))):Z.literal(i)}function Ac(i,s={}){let e=s;return e[Vr]=!0,e.$ast=i,e.$type||(e.$type="object"),e}var Ec={enumerable:!0,configurable:!0};function xe(i,s,e){let t=Ac(i,s);return new Proxy({},{ownKeys(){return Object.keys(t).filter(r=>r!==Vr&&!r.startsWith("$"))},getOwnPropertyDescriptor(){return Ec},has(r,n){return n in t},...e,get(r,n,a){if(n in t)return t[n];if(e.get)return e.get(r,n,a)},set(r,n,a,o){return n in t?(t[n]=a,!0):e.set?e.set(r,n,a,o):!1}})}var fe=dt,wr=new WeakMap;function wc(i,s,e){if(wr.has(s))return wr.get(s);let t=xe(s,{get $declaration(){return i},get imported(){return s.type==="ImportDefaultSpecifier"?"default":s.type==="ImportNamespaceSpecifier"?"*":s.imported.type==="Identifier"?s.imported.name:s.imported.value},set imported(r){if(s.type!=="ImportSpecifier")throw new se("Changing import name is not yet implemented");s.imported.type==="Identifier"?s.imported.name=r:s.imported.value=r},get local(){return s.local.name},set local(r){s.local.name=r},get from(){return i.source.value},set from(r){if(r===i.source.value)return;i.specifiers=i.specifiers.filter(a=>a!==s),i.specifiers.length===0&&(e.body=e.body.filter(a=>a!==i));let n=e.body.find(a=>a.type==="ImportDeclaration"&&a.source.value===r);n?n.specifiers.push(s):e.body.unshift(fe.importDeclaration([s],fe.stringLiteral(r)))},toJSON(){return{imported:this.imported,local:this.local,from:this.from}}},{ownKeys(){return["imported","local","from","toJSON"]}});return wr.set(s,t),t}function vc(i,s){let e=()=>{let a=[];for(let o of i.body)if(o.type==="ImportDeclaration")for(let l of o.specifiers)a.push(wc(o,l,i));return a},t=(a,o,l)=>{let c=e(),u=c.find(p=>p.local===a),h=o.local||a;if(u)return u.imported=o.imported,u.local=h,u.from=o.from,!0;let f=o.imported==="default"?fe.importDefaultSpecifier(fe.identifier(h)):o.imported==="*"?fe.importNamespaceSpecifier(fe.identifier(h)):fe.importSpecifier(fe.identifier(o.imported),fe.identifier(h)),d=c.find(p=>p.from===o.from)?.$declaration;if(d)d.specifiers.push(f);else if(l==="prepend"||c.length===0)i.body.unshift(fe.importDeclaration([f],fe.stringLiteral(o.from)));else{let p=c.at(-1).$declaration,g=i.body.indexOf(p);i.body.splice(g+1,0,fe.importDeclaration([f],fe.stringLiteral(o.from)))}return!0},r=a=>{let o=e().find(u=>u.local===a);if(!o)return!1;let l=o.$declaration,c=o.$ast;return l.specifiers=l.specifiers.filter(u=>u!==c),l.specifiers.length===0&&(i.body=i.body.filter(u=>u!==l)),!0};return xe(i,{$type:"imports",$add(a){t(a.local||a.imported,a,"prepend")},$prepend(a){t(a.local||a.imported,a,"prepend")},$append(a){t(a.local||a.imported,a,"append")},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,"prepend")},deleteProperty(a,o){return r(o)},ownKeys(){return e().map(a=>a.local)},has(a,o){return e().some(l=>l.local===o)}})}function As(i,s,e){let t=n=>s[n],r=(n,a)=>{s[n]=a};return xe(i,{$type:"array",push(n){s.push(le(n))},pop(){return oe(s.pop(),e)},unshift(n){s.unshift(le(n))},shift(){return oe(s.shift(),e)},splice(n,a,...o){return s.splice(n,a,...o.map(c=>le(c))).map(c=>oe(c,e))},find(n){return s.map(a=>oe(a,e)).find(n)},findIndex(n){return s.map(a=>oe(a,e)).findIndex(n)},includes(n){return s.map(a=>oe(a,e)).includes(n)},toJSON(){return s.map(n=>oe(n,e))}},{get(n,a){if(a==="length")return s.length;if(a===Symbol.iterator)return function*(){for(let c of s)yield oe(c,e)};if(typeof a=="symbol")return;let o=+a;if(Number.isNaN(o))return;let l=t(o);if(l)return oe(l,e)},set(n,a,o){if(typeof a=="symbol")return!1;let l=+a;return Number.isNaN(l)?!1:(r(l,le(o)),!0)},deleteProperty(n,a){if(typeof a=="symbol")return!1;let o=+a;return Number.isNaN(o)?!1:(s[o]=le(void 0),!0)},ownKeys(){return["length",...s.map((n,a)=>a.toString())]}})}function Cc(i,s){if("elements"in i)return As(i,i.elements,s)}function Hn(i,s){if(i.type!=="CallExpression")throw new se("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 se("Not implemented")}let t=As(i,i.arguments,s);return xe(i,{$type:"function-call",$callee:e(i.callee),$args:t},{})}function Ic(i,s){if(i.type!=="ArrowFunctionExpression")throw new se("Not an arrow function expression");let e=As(i,i.params,s);return xe(i,{$type:"arrow-function-expression",$params:e,$body:oe(i.body,s)},{})}var Nc=dt;function kc(i,s){if(!("properties"in i))return;let e=n=>{for(let a of i.properties){if("key"in a&&"name"in a.key&&a.key.name===n)return a.value;if(a.type==="ObjectProperty"&&(a.key.type==="StringLiteral"||a.key.type==="NumericLiteral"||a.key.type==="BooleanLiteral")&&a.key.value.toString()===n)return a.value.value??a.value}},t=(n,a=!1)=>{if("key"in n&&"name"in n.key)return n.key.name;if(n.type==="ObjectProperty"&&(n.key.type==="StringLiteral"||n.key.type==="NumericLiteral"||n.key.type==="BooleanLiteral"))return n.key.value.toString();if(a)throw new se(`Casting "${n.type}" is not supported`,{ast:n,code:s?.$code})},r=(n,a)=>{let o=i.properties.find(l=>t(l)===n);o?o.value=a:Sc(n)?i.properties.push({type:"Property",key:{type:"Identifier",name:n},value:a}):i.properties.push({type:"ObjectProperty",key:Nc.stringLiteral(n),value:a})};return xe(i,{$type:"object",toJSON(){return i.properties.reduce((n,a)=>("key"in a&&"name"in a.key&&(n[a.key.name]=oe(a.value,s)),n),{})}},{get(n,a){let o=e(a);if(o)return oe(o,s)},set(n,a,o){return typeof a!="string"&&(a=String(a)),r(a,le(o)),!0},deleteProperty(n,a){typeof a!="string"&&(a=String(a));let o=i.properties.findIndex(l=>"key"in l&&"name"in l.key&&l.key.name===a);return o!==-1&&i.properties.splice(o,1),!0},ownKeys(){return i.properties.map(n=>t(n,!0)).filter(Boolean)}})}function Xn(i,s){if(i.type!=="NewExpression")throw new se("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 se("Not implemented")}let t=As(i,i.arguments,s);return xe(i,{$type:"new-expression",$callee:e(i.callee),$args:t},{})}function Lc(i){if(i.type!=="Identifier")throw new se("Not an identifier");return xe(i,{$type:"identifier",$name:i.name},{})}function Dc(i){if(i.type!=="LogicalExpression")throw new se("Not a logical expression");return xe(i,{$type:"logicalExpression"},{})}function Oc(i){if(i.type!=="MemberExpression")throw new se("Not a member expression");return xe(i,{$type:"memberExpression"},{})}var vr=new WeakMap;function oe(i,s){if(Kn.has(typeof i))return i;if(Pc.has(i.type))return i.value;if(vr.has(i))return vr.get(i);let e;switch(i.type){case"ObjectExpression":{e=kc(i,s);break}case"ArrayExpression":{e=Cc(i,s);break}case"CallExpression":{e=Hn(i,s);break}case"ArrowFunctionExpression":{e=Ic(i,s);break}case"NewExpression":{e=Xn(i,s);break}case"Identifier":{e=Lc(i);break}case"LogicalExpression":{e=Dc(i);break}case"MemberExpression":{e=Oc(i);break}case"TSAsExpression":case"TSSatisfiesExpression":{e=oe(i.expression,s);break}default:throw new se(`Casting "${i.type}" is not supported`,{ast:i,code:s?.$code})}return vr.set(i,e),e}var Mt=dt;function Mc(i,s){let e=r=>{let n=r==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration";for(let a of i.body)if(a.type===n){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,n)=>{let a=r==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration",o=le(n);for(let l of i.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}}}i.body.push(r==="default"?Mt.exportDefaultDeclaration(o):Mt.exportNamedDeclaration(Mt.variableDeclaration("const",[Mt.variableDeclarator(Mt.identifier(r),o)])))};return xe(i,{$type:"exports"},{get(r,n){let a=e(n);if(a)return oe(a,s)},set(r,n,a){return t(n,a),!0},ownKeys(){return i.body.flatMap(r=>r.type==="ExportDefaultDeclaration"?["default"]:r.type==="ExportNamedDeclaration"&&r.declaration&&"declarations"in r.declaration?r.declaration.declarations.map(n=>"name"in n.id?n.id.name:""):[]).filter(Boolean)},deleteProperty(r,n){let a=n==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration";for(let o=0;o<i.body.length;o++){let l=i.body[o];if(l.type===a){if(n==="default")return i.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===n)return i.body.splice(o,1),!0}}}return!1}})}function Fc(i,s){let e=i.program;if(e.type!=="Program")throw new se(`Cannot proxify ${i.type} as module`);let t={$code:s,$type:"module"},r=xe(e,t,{ownKeys(){return["imports","exports","generate"]}});return t.exports=Mc(e,r),t.imports=vc(e),t.generate=n=>$r(r,n),r}function Gn(i,s={}){let e={wrapColumn:s.wrapColumn===void 0,indent:s.tabWidth===void 0||s.useTabs===void 0,quote:s.quote===void 0,arrowParens:s.arrowParensAlways===void 0,trailingComma:s.trailingComma===void 0},t=2,r=0,n=0,a=0,o=0,l=/(?<doubleQuote>"[^"]+")|(?<singleQuote>'[^']+')|(?<singleParam>\([^),]+\)\s*=>)|(?<trailingComma>,\s*[\]}])/g,c={doubleQuote:0,singleQuote:0,singleParam:0,trailingComma:0},u=(i||"").split(`
|
|
104
|
-
`),
|
|
105
|
-
`).map(
|
|
106
|
-
`)[0]),
|
|
133
|
+
`}this.message=t}},ZE=new Set(["Literal","StringLiteral","NumericLiteral","BooleanLiteral","NullLiteral","RegExpLiteral","BigIntLiteral"]),zf=new Set(["string","number","boolean","bigint","symbol","undefined"]),pe=or;function eT(r){return/^[$A-Z_a-z][\w$]*$/.test(r)}var Zc="__magicast_proxy";function Le(r,t=new Set){if(r===void 0)return pe.identifier("undefined");if(r===null)return pe.literal(null);if(zf.has(typeof r))return pe.literal(r);if(t.has(r))throw new Ce("Can not serialize circular reference");if(t.add(r),r[Zc])return r.$ast;if(r instanceof RegExp){let e=pe.regExpLiteral(r.source,r.flags);return delete e.extra.raw,e}return r instanceof Set?pe.newExpression(pe.identifier("Set"),[pe.arrayExpression([...r].map(e=>Le(e,t)))]):r instanceof Date?pe.newExpression(pe.identifier("Date"),[pe.literal(r.toISOString())]):r instanceof Map?pe.newExpression(pe.identifier("Map"),[pe.arrayExpression([...r].map(([e,s])=>pe.arrayExpression([Le(e,t),Le(s,t)])))]):Array.isArray(r)?pe.arrayExpression(r.map(e=>Le(e,t))):typeof r=="object"?pe.objectExpression(Object.entries(r).map(([e,s])=>pe.property("init",/^[$A-Z_a-z][\w$]*$/g.test(e)?pe.identifier(e):pe.literal(e),Le(s,t)))):pe.literal(r)}function tT(r,t={}){let e=t;return e[Zc]=!0,e.$ast=r,e.$type||(e.$type="object"),e}var sT={enumerable:!0,configurable:!0};function Je(r,t,e){let s=tT(r,t);return new Proxy({},{ownKeys(){return Object.keys(s).filter(n=>n!==Zc&&!n.startsWith("$"))},getOwnPropertyDescriptor(){return sT},has(n,i){return i in s},...e,get(n,i,a){if(i in s)return s[i];if(e.get)return e.get(n,i,a)},set(n,i,a,o){return i in s?(s[i]=a,!0):e.set?e.set(n,i,a,o):!1}})}var Ue=or,Fc=new WeakMap;function rT(r,t,e){if(Fc.has(t))return Fc.get(t);let s=Je(t,{get $declaration(){return r},get imported(){return t.type==="ImportDefaultSpecifier"?"default":t.type==="ImportNamespaceSpecifier"?"*":t.imported.type==="Identifier"?t.imported.name:t.imported.value},set imported(n){if(t.type!=="ImportSpecifier")throw new Ce("Changing import name is not yet implemented");t.imported.type==="Identifier"?t.imported.name=n:t.imported.value=n},get local(){return t.local.name},set local(n){t.local.name=n},get from(){return r.source.value},set from(n){if(n===r.source.value)return;r.specifiers=r.specifiers.filter(a=>a!==t),r.specifiers.length===0&&(e.body=e.body.filter(a=>a!==r));let i=e.body.find(a=>a.type==="ImportDeclaration"&&a.source.value===n);i?i.specifiers.push(t):e.body.unshift(Ue.importDeclaration([t],Ue.stringLiteral(n)))},toJSON(){return{imported:this.imported,local:this.local,from:this.from}}},{ownKeys(){return["imported","local","from","toJSON"]}});return Fc.set(t,s),s}function nT(r,t){let e=()=>{let a=[];for(let o of r.body)if(o.type==="ImportDeclaration")for(let c of o.specifiers)a.push(rT(o,c,r));return a},s=(a,o,c)=>{let l=e(),u=l.find(f=>f.local===a),p=o.local||a;if(u)return u.imported=o.imported,u.local=p,u.from=o.from,!0;let h=o.imported==="default"?Ue.importDefaultSpecifier(Ue.identifier(p)):o.imported==="*"?Ue.importNamespaceSpecifier(Ue.identifier(p)):Ue.importSpecifier(Ue.identifier(o.imported),Ue.identifier(p)),d=l.find(f=>f.from===o.from)?.$declaration;if(d)d.specifiers.push(h);else if(c==="prepend"||l.length===0)r.body.unshift(Ue.importDeclaration([h],Ue.stringLiteral(o.from)));else{let f=l.at(-1).$declaration,m=r.body.indexOf(f);r.body.splice(m+1,0,Ue.importDeclaration([h],Ue.stringLiteral(o.from)))}return!0},n=a=>{let o=e().find(u=>u.local===a);if(!o)return!1;let c=o.$declaration,l=o.$ast;return c.specifiers=c.specifiers.filter(u=>u!==l),c.specifiers.length===0&&(r.body=r.body.filter(u=>u!==c)),!0};return Je(r,{$type:"imports",$add(a){s(a.local||a.imported,a,"prepend")},$prepend(a){s(a.local||a.imported,a,"prepend")},$append(a){s(a.local||a.imported,a,"append")},get $items(){return e()},toJSON(){return e().reduce((a,o)=>(a[o.local]=o,a),{})}},{get(a,o){return e().find(c=>c.local===o)},set(a,o,c){return s(o,c,"prepend")},deleteProperty(a,o){return n(o)},ownKeys(){return e().map(a=>a.local)},has(a,o){return e().some(c=>c.local===o)}})}function Xi(r,t,e){let s=i=>t[i],n=(i,a)=>{t[i]=a};return Je(r,{$type:"array",push(i){t.push(Le(i))},pop(){return Me(t.pop(),e)},unshift(i){t.unshift(Le(i))},shift(){return Me(t.shift(),e)},splice(i,a,...o){return t.splice(i,a,...o.map(l=>Le(l))).map(l=>Me(l,e))},find(i){return t.map(a=>Me(a,e)).find(i)},findIndex(i){return t.map(a=>Me(a,e)).findIndex(i)},includes(i){return t.map(a=>Me(a,e)).includes(i)},toJSON(){return t.map(i=>Me(i,e))}},{get(i,a){if(a==="length")return t.length;if(a===Symbol.iterator)return function*(){for(let l of t)yield Me(l,e)};if(typeof a=="symbol")return;let o=+a;if(Number.isNaN(o))return;let c=s(o);if(c)return Me(c,e)},set(i,a,o){if(typeof a=="symbol")return!1;let c=+a;return Number.isNaN(c)?!1:(n(c,Le(o)),!0)},deleteProperty(i,a){if(typeof a=="symbol")return!1;let o=+a;return Number.isNaN(o)?!1:(t[o]=Le(void 0),!0)},ownKeys(){return["length",...t.map((i,a)=>a.toString())]}})}function iT(r,t){if("elements"in r)return Xi(r,r.elements,t)}function Jf(r,t){if(r.type!=="CallExpression")throw new Ce("Not a function call");function e(n){if(n.type==="Identifier")return n.name;if(n.type==="MemberExpression")return`${e(n.object)}.${e(n.property)}`;throw new Ce("Not implemented")}let s=Xi(r,r.arguments,t);return Je(r,{$type:"function-call",$callee:e(r.callee),$args:s},{})}function aT(r,t){if(r.type!=="ArrowFunctionExpression")throw new Ce("Not an arrow function expression");let e=Xi(r,r.params,t);return Je(r,{$type:"arrow-function-expression",$params:e,$body:Me(r.body,t)},{})}var oT=or;function cT(r,t){if(!("properties"in r))return;let e=i=>{for(let a of r.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}},s=(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 Ce(`Casting "${i.type}" is not supported`,{ast:i,code:t?.$code})},n=(i,a)=>{let o=r.properties.find(c=>s(c)===i);o?o.value=a:eT(i)?r.properties.push({type:"Property",key:{type:"Identifier",name:i},value:a}):r.properties.push({type:"ObjectProperty",key:oT.stringLiteral(i),value:a})};return Je(r,{$type:"object",toJSON(){return r.properties.reduce((i,a)=>("key"in a&&"name"in a.key&&(i[a.key.name]=Me(a.value,t)),i),{})}},{get(i,a){let o=e(a);if(o)return Me(o,t)},set(i,a,o){return typeof a!="string"&&(a=String(a)),n(a,Le(o)),!0},deleteProperty(i,a){typeof a!="string"&&(a=String(a));let o=r.properties.findIndex(c=>"key"in c&&"name"in c.key&&c.key.name===a);return o!==-1&&r.properties.splice(o,1),!0},ownKeys(){return r.properties.map(i=>s(i,!0)).filter(Boolean)}})}function Kf(r,t){if(r.type!=="NewExpression")throw new Ce("Not a new expression");function e(n){if(n.type==="Identifier")return n.name;if(n.type==="MemberExpression")return`${e(n.object)}.${e(n.property)}`;throw new Ce("Not implemented")}let s=Xi(r,r.arguments,t);return Je(r,{$type:"new-expression",$callee:e(r.callee),$args:s},{})}function lT(r){if(r.type!=="Identifier")throw new Ce("Not an identifier");return Je(r,{$type:"identifier",$name:r.name},{})}function uT(r){if(r.type!=="LogicalExpression")throw new Ce("Not a logical expression");return Je(r,{$type:"logicalExpression"},{})}function pT(r){if(r.type!=="MemberExpression")throw new Ce("Not a member expression");return Je(r,{$type:"memberExpression"},{})}var Bc=new WeakMap;function Me(r,t){if(zf.has(typeof r))return r;if(ZE.has(r.type))return r.value;if(Bc.has(r))return Bc.get(r);let e;switch(r.type){case"ObjectExpression":{e=cT(r,t);break}case"ArrayExpression":{e=iT(r,t);break}case"CallExpression":{e=Jf(r,t);break}case"ArrowFunctionExpression":{e=aT(r,t);break}case"NewExpression":{e=Kf(r,t);break}case"Identifier":{e=lT(r);break}case"LogicalExpression":{e=uT(r);break}case"MemberExpression":{e=pT(r);break}case"TSAsExpression":case"TSSatisfiesExpression":{e=Me(r.expression,t);break}default:throw new Ce(`Casting "${r.type}" is not supported`,{ast:r,code:t?.$code})}return Bc.set(r,e),e}var on=or;function hT(r,t){let e=n=>{let i=n==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration";for(let a of r.body)if(a.type===i){if(n==="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===n)return o.init}}},s=(n,i)=>{let a=n==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration",o=Le(i);for(let c of r.body)if(c.type===a){if(n==="default"){c.declaration=o;return}if(c.declaration&&"declarations"in c.declaration){let l=c.declaration.declarations[0];if("name"in l.id&&l.id.name===n){l.init=o;return}}}r.body.push(n==="default"?on.exportDefaultDeclaration(o):on.exportNamedDeclaration(on.variableDeclaration("const",[on.variableDeclarator(on.identifier(n),o)])))};return Je(r,{$type:"exports"},{get(n,i){let a=e(i);if(a)return Me(a,t)},set(n,i,a){return s(i,a),!0},ownKeys(){return r.body.flatMap(n=>n.type==="ExportDefaultDeclaration"?["default"]:n.type==="ExportNamedDeclaration"&&n.declaration&&"declarations"in n.declaration?n.declaration.declarations.map(i=>"name"in i.id?i.id.name:""):[]).filter(Boolean)},deleteProperty(n,i){let a=i==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration";for(let o=0;o<r.body.length;o++){let c=r.body[o];if(c.type===a){if(i==="default")return r.body.splice(o,1),!0;if(c.declaration&&"declarations"in c.declaration){let l=c.declaration.declarations[0];if("name"in l.id&&l.id.name===i)return r.body.splice(o,1),!0}}}return!1}})}function dT(r,t){let e=r.program;if(e.type!=="Program")throw new Ce(`Cannot proxify ${r.type} as module`);let s={$code:t,$type:"module"},n=Je(e,s,{ownKeys(){return["imports","exports","generate"]}});return s.exports=hT(e,n),s.imports=nT(e),s.generate=i=>el(n,i),n}function Xf(r,t={}){let e={wrapColumn:t.wrapColumn===void 0,indent:t.tabWidth===void 0||t.useTabs===void 0,quote:t.quote===void 0,arrowParens:t.arrowParensAlways===void 0,trailingComma:t.trailingComma===void 0},s=2,n=0,i=0,a=0,o=0,c=/(?<doubleQuote>"[^"]+")|(?<singleQuote>'[^']+')|(?<singleParam>\([^),]+\)\s*=>)|(?<trailingComma>,\s*[\]}])/g,l={doubleQuote:0,singleQuote:0,singleParam:0,trailingComma:0},u=(r||"").split(`
|
|
134
|
+
`),p=!1;for(let h of u){let d=h.trim();if(d.length!==0){if(e.wrapColumn&&h.length>a&&(a=h.length),e.indent){let f=h.match(/^\s+/)?.[0]||"";f.length>0&&(f.length>0&&f.length<s&&(s=f.length),f[0]===" "?n++:f.length>0&&n--)}if(d.at(-1)===";"?i++:d.length>0&&i--,e.quote||e.arrowParens){let f=d.matchAll(c);for(let m of f)if(m.groups)for(let y in l)m.groups[y]&&l[y]++}e.trailingComma&&((h.startsWith("}")||h.startsWith("]"))&&(p?o++:o--),p=d.endsWith(","))}}return{wrapColumn:a,useTabs:n>0,tabWidth:s,quote:l.singleQuote>l.doubleQuote?"single":"double",arrowParensAlways:l.singleParam>0,trailingComma:o>0||l.trailingComma>0,useSemi:i>0,arrayBracketSpacing:void 0,objectCurlySpacing:void 0,...t}}function Qf(r,t){let e=Rf(r,{parser:t?.parser||Wf(),...t});return dT(e,r)}function Zf(r,t){let e=Rf("("+r+")",{parser:t?.parser||Wf(),...t}),s=e.program.body[0];s.type==="ExpressionStatement"&&(s=s.expression),s.extra?.parenthesized&&(s.extra.parenthesized=!1);let n={$ast:e,$code:" "+r+" ",$type:"module"};return Me(s,n)}function el(r,t={}){let e=r.$ast||r,s=t.format===!1||!("$code"in r)?{}:Xf(r.$code,t.format),{code:n,map:i}=JE(e,{...t,...s});return{code:n,map:i}}async function fT(r,t={}){let e=await jc.readFile(r,"utf8");return t.sourceFileName=t.sourceFileName??r,Qf(e,t)}async function mT(r,t,e){let s="$ast"in r?r.$ast:r,{code:n,map:i}=el(s,e);await jc.writeFile(t,n),i&&await jc.writeFile(t+".map",i)}var Bi=or,yT={functionCall(r,...t){let e=Bi.callExpression(Bi.identifier(r),t.map(s=>Le(s)));return Jf(e)},newExpression(r,...t){let e=Bi.newExpression(Bi.identifier(r),t.map(s=>Le(s)));return Kf(e)},literal(r){return Le(r)},raw(r){return Zf(r)}};var sO=gi(kS(),1);async function MS(r,t){let e=await OS(r,{withFileTypes:!0}),s=[];for(let n of e){let i=X.join(r,n.name);if(n.isDirectory()){if(!t.has(n.name)){let a=await MS(i,t);s.push(...a)}}else s.push(i)}return s}async function rO(r){let t=new Set,e=(...l)=>{if(process.env.DEBUG){let u=new Date,p=`${String(u.getMinutes()).padStart(2,"0")}:${String(u.getSeconds()).padStart(2,"0")}.${String(u.getMilliseconds()).padStart(3,"0")}`;console.debug(p,"[builder-dev-tools]",...l)}},s=async l=>{let u=WD("md5");return u.update(l),u.digest("hex")},n=X.normalize(r.cwd),i=cO(X.normalize(r.cwd))??n,a=lO(X.normalize(r.cwd))??i,o={...X,getCwdDir:()=>n,getRepoRootDir:()=>i,getAppRootDir:()=>a,cwd:()=>process.cwd(),exists:async l=>{try{return await qD(l),!0}catch{return!1}},magicast:tl,existsSync:l=>Be(l),readdir:async(l,u)=>{let p=await OS(l);return u?p.map(h=>X.join(l,h)):p},readdirRecursive:async(l,u)=>MS(l,new Set(u)),readdirSync:l=>zD(l),readFile:async l=>{try{return await $D(l,"utf-8")}catch(u){if(u.code==="ENOENT")return null;throw e(u,l),u}},readFileSync(l){try{return JD(l,"utf-8")}catch(u){if(u.code==="ENOENT")return null;throw e(u,l),u}},spawnSync:fi,stat:async l=>await HD(l),statSync:l=>KD(l),unlinkSync:l=>{XD(l)},unlink:async l=>{await VD(l)},writeFile:async(l,u)=>{l=X.normalize(l);let p={path:l,basename:X.basename(l),dirname:X.dirname(l),extname:X.extname(l)};await GD(X.dirname(l),{recursive:!0}),await YD(l,u);for(let h of t)await h(p)},hash:s,getDeviceId:()=>s(`${ZD()}:${QD()}`),formatCode:async(l,u)=>{let p=null;try{p=await DS.resolveConfig(l)}catch{}try{return DS.format(u,{...p,filepath:l})}catch{}return u},on:(l,u)=>{l==="change"&&t.add(u)},off:(l,u)=>{l==="change"&&t.delete(u)},debug:e,launchEditor:async l=>{try{let u=l.filePath;typeof l.line=="number"&&(u+=`:${l.line}`,typeof l.column=="number"&&(u+=`:${l.column}`)),tO(u,"code",(p,h)=>{console.error(`Failed to launch editor for ${p}`),h&&console.error(h)})}catch(u){console.error(`Failed to launch editor for ${String(u.message||u)}`)}},platform:()=>({runtime:"node",os:process.platform}),getRepoInfo:async()=>{let l=X.normalize(r.cwd);return{remoteUrl:nO(l),defaultBranch:iO(l),commit:aO(l),currentBranch:oO(l)}},getFrameworks:()=>[],ts:eO,Sentry:sO,version:"1.3.4",sdkVersion:null,ignoreMissingConfig:r.ignoreMissingConfig,kind:null},c=await Qh(o);return o.getFrameworks=()=>c,o}function nO(r){try{return(fi("git",["config","--get","remote.origin.url"],{cwd:r}).stdout||"").toString().trim()}catch(t){return console.error("Error getting git remote URL:",t),""}}function iO(r){let t="master";try{let e=fi("git",["branch","-r"],{cwd:r});return e.stdout&&e.stdout.toString().trim().split(`
|
|
135
|
+
`).map(n=>n.trim()).includes("origin/main")?"main":t}catch(e){return console.error("Error getting git default branch name:",e.toString().split(`
|
|
136
|
+
`)[0]),t}}function aO(r){try{return(fi("git",["rev-parse","HEAD"],{cwd:r}).stdout||"").toString().trim()}catch(t){return console.error("Error getting git commit:",t),""}}function oO(r){try{return(fi("git",["branch","--show-current"],{cwd:r}).stdout||"").toString().trim()}catch(t){return console.error("Error getting current branch name:",t),""}}function cO(r){let t=X.resolve("/");for(let e=0;e<20;e++){let s=X.join(r,"package.json");if(Be(s))return r;if(r===t)break;r=X.dirname(r)}return null}function lO(r){let t=X.resolve("/");for(let e=0;e<20;e++){if(Be(X.join(r,"package.json"))||Be(X.join(r,"remix.config.js"))||Be(X.join(r,"remix.config.mjs"))||Be(X.join(r,"remix.config.ts"))||Be(X.join(r,"vite.config.js"))||Be(X.join(r,"vite.config.ts"))||Be(X.join(r,"vite.config.mjs"))||Be(X.join(r,"next.config.js"))||Be(X.join(r,"next.config.ts"))||Be(X.join(r,"angular.json"))||Be(X.join(r,"project.json"))||Be(X.join(r,"tsconfig.json")))return r;if(r===t)break;r=X.dirname(r)}return null}export{rO as createDevToolsNodeSys};
|
|
137
|
+
/*! Bundled license information:
|
|
138
|
+
|
|
139
|
+
cookie/index.js:
|
|
140
|
+
(*!
|
|
141
|
+
* cookie
|
|
142
|
+
* Copyright(c) 2012-2014 Roman Shtylman
|
|
143
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
144
|
+
* MIT Licensed
|
|
145
|
+
*)
|
|
146
|
+
*/
|