monocart-reporter 1.6.36 → 1.7.1
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/README.md +97 -16
- package/lib/cli.js +6 -3
- package/lib/default/options.js +2 -2
- package/lib/generate-report.js +1 -1
- package/lib/index.d.ts +122 -0
- package/lib/index.js +38 -7
- package/lib/index.mjs +5 -2
- package/lib/plugins/coverage/coverage.js +45 -53
- package/lib/plugins/coverage/istanbul/istanbul.js +27 -7
- package/lib/plugins/coverage/v8/source-map.js +5 -12
- package/lib/plugins/coverage/v8/v8-summary.js +2 -2
- package/lib/plugins/coverage/v8/v8.js +2 -19
- package/lib/plugins/state/client.js +153 -0
- package/lib/plugins/state/state.js +178 -0
- package/lib/runtime/monocart-reporter.js +1 -1
- package/lib/runtime/monocart-vendor.js +18 -62
- package/lib/utils/util.js +3 -0
- package/package.json +10 -7
|
@@ -1,65 +1,21 @@
|
|
|
1
|
-
var
|
|
2
|
-
`)),!/^\s*at /.test(t[0])&&/^\s*at /.test(t[1])&&(t=t.slice(1));let
|
|
3
|
-
`).join("")}captureString(t,e=this.captureString){typeof t=="function"&&(e=t,t=1/0);let{stackTraceLimit:i}=Error;t&&(Error.stackTraceLimit=t);let s={};Error.captureStackTrace(s,e);let{stack:a}=s;return Error.stackTraceLimit=i,this.clean(a)}capture(t,e=this.capture){typeof t=="function"&&(e=t,t=1/0);let{prepareStackTrace:i,stackTraceLimit:s}=Error;Error.prepareStackTrace=(o,l)=>this._wrapCallSite?l.map(this._wrapCallSite):l,t&&(Error.stackTraceLimit=t);let a={};Error.captureStackTrace(a,e);let{stack:r}=a;return Object.assign(Error,{prepareStackTrace:i,stackTraceLimit:s}),r}at(t=this.at){let[e]=this.capture(1,t);if(!e)return{};let i={line:e.getLineNumber(),column:e.getColumnNumber()};js(i,e.getFileName(),this._cwd),e.isConstructor()&&Object.defineProperty(i,"constructor",{value:!0,configurable:!0}),e.isEval()&&(i.evalOrigin=e.getEvalOrigin()),e.isNative()&&(i.native=!0);let s;try{s=e.getTypeName()}catch{}s&&s!=="Object"&&s!=="[object Object]"&&(i.type=s);let a=e.getFunctionName();a&&(i.function=a);let r=e.getMethodName();return r&&a!==r&&(i.method=r),i}parseLine(t){let e=t&&t.match(wo);if(!e)return null;let i=e[1]==="new",s=e[2],a=e[3],r=e[4],o=Number(e[5]),l=Number(e[6]),c=e[7],p=e[8],h=e[9],u=e[10]==="native",f=e[11]===")",m,x={};if(p&&(x.line=Number(p)),h&&(x.column=Number(h)),f&&c){let b=0;for(let A=c.length-1;A>0;A--)if(c.charAt(A)===")")b++;else if(c.charAt(A)==="("&&c.charAt(A-1)===" "&&(b--,b===-1&&c.charAt(A-1)===" ")){let N=c.slice(0,A-1);c=c.slice(A+1),s+=` (${N}`;break}}if(s){let b=s.match(Po);b&&(s=b[1],m=b[2])}return js(x,c,this._cwd),i&&Object.defineProperty(x,"constructor",{value:!0,configurable:!0}),a&&(x.evalOrigin=a,x.evalLine=o,x.evalColumn=l,x.evalFile=r&&r.replace(/\\/g,"/")),u&&(x.native=!0),s&&(x.function=s),m&&s!==m&&(x.method=m),x}};function js(n,t,e){t&&(t=t.replace(/\\/g,"/"),t.startsWith(`${e}/`)&&(t=t.slice(e.length+1)),n.file=t)}function bo(n){if(n.length===0)return[];let t=n.map(e=>yo(e));return new RegExp(`[/\\\\]node_modules[/\\\\](?:${t.join("|")})[/\\\\][^:]+:\\d+:\\d+`)}var wo=new RegExp("^(?:\\s*at )?(?:(new) )?(?:(.*?) \\()?(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?(?:(.+?):(\\d+):(\\d+)|(native))(\\)?)$"),Po=/^(.*?) \[as (.*?)\]$/;Us.exports=Oe});var zs=T(pt=>{Object.defineProperty(pt,"__esModule",{value:!0});pt.default=/((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g;pt.matchToToken=function(n){var t={type:"invalid",value:n[0],closed:void 0};return n[1]?(t.type="string",t.closed=!!(n[3]||n[4])):n[5]?t.type="comment":n[6]?(t.type="comment",t.closed=!!n[7]):n[8]?t.type="regex":n[9]?t.type="number":n[10]?t.type="name":n[11]?t.type="punctuator":n[12]&&(t.type="whitespace"),t}});var Ws=T(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.isIdentifierChar=Vs;De.isIdentifierName=So;De.isIdentifierStart=Ks;var Ht="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",Hs="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\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",To=new RegExp("["+Ht+"]"),Ao=new RegExp("["+Ht+Hs+"]");Ht=Hs=null;var $s=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,3104,541,1507,4938,6,4191],Eo=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239];function zt(n,t){let e=65536;for(let i=0,s=t.length;i<s;i+=2){if(e+=t[i],e>n)return!1;if(e+=t[i+1],e>=n)return!0}return!1}function Ks(n){return n<65?n===36:n<=90?!0:n<97?n===95:n<=122?!0:n<=65535?n>=170&&To.test(String.fromCharCode(n)):zt(n,$s)}function Vs(n){return n<48?n===36:n<58?!0:n<65?!1:n<=90?!0:n<97?n===95:n<=122?!0:n<=65535?n>=170&&Ao.test(String.fromCharCode(n)):zt(n,$s)||zt(n,Eo)}function So(n){let t=!0;for(let e=0;e<n.length;e++){let i=n.charCodeAt(e);if((i&64512)===55296&&e+1<n.length){let s=n.charCodeAt(++e);(s&64512)===56320&&(i=65536+((i&1023)<<10)+(s&1023))}if(t){if(t=!1,!Ks(i))return!1}else if(!Vs(i))return!1}return!t}});var Qs=T(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.isKeyword=_o;le.isReservedWord=Gs;le.isStrictBindOnlyReservedWord=Js;le.isStrictBindReservedWord=No;le.isStrictReservedWord=Xs;var $t={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"]},Co=new Set($t.keyword),ko=new Set($t.strict),Io=new Set($t.strictBind);function Gs(n,t){return t&&n==="await"||n==="enum"}function Xs(n,t){return Gs(n,t)||ko.has(n)}function Js(n){return Io.has(n)}function No(n,t){return Xs(n,t)||Js(n)}function _o(n){return Co.has(n)}});var Ys=T($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});Object.defineProperty($,"isIdentifierChar",{enumerable:!0,get:function(){return Kt.isIdentifierChar}});Object.defineProperty($,"isIdentifierName",{enumerable:!0,get:function(){return Kt.isIdentifierName}});Object.defineProperty($,"isIdentifierStart",{enumerable:!0,get:function(){return Kt.isIdentifierStart}});Object.defineProperty($,"isKeyword",{enumerable:!0,get:function(){return Be.isKeyword}});Object.defineProperty($,"isReservedWord",{enumerable:!0,get:function(){return Be.isReservedWord}});Object.defineProperty($,"isStrictBindOnlyReservedWord",{enumerable:!0,get:function(){return Be.isStrictBindOnlyReservedWord}});Object.defineProperty($,"isStrictBindReservedWord",{enumerable:!0,get:function(){return Be.isStrictBindReservedWord}});Object.defineProperty($,"isStrictReservedWord",{enumerable:!0,get:function(){return Be.isStrictReservedWord}});var Kt=Ws(),Be=Qs()});var ea=T((au,Zs)=>{"use strict";var Lo=/[|\\{}()[\]^$+*?.]/g;Zs.exports=function(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(Lo,"\\$&")}});var ia=T((ru,ta)=>{"use strict";ta.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Vt=T((nu,na)=>{var ce=ia(),ra={};for(ht in ce)ce.hasOwnProperty(ht)&&(ra[ce[ht]]=ht);var ht,v=na.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(O in v)if(v.hasOwnProperty(O)){if(!("channels"in v[O]))throw new Error("missing channels property: "+O);if(!("labels"in v[O]))throw new Error("missing channel labels property: "+O);if(v[O].labels.length!==v[O].channels)throw new Error("channel and label counts mismatch: "+O);sa=v[O].channels,aa=v[O].labels,delete v[O].channels,delete v[O].labels,Object.defineProperty(v[O],"channels",{value:sa}),Object.defineProperty(v[O],"labels",{value:aa})}var sa,aa,O;v.rgb.hsl=function(n){var t=n[0]/255,e=n[1]/255,i=n[2]/255,s=Math.min(t,e,i),a=Math.max(t,e,i),r=a-s,o,l,c;return a===s?o=0:t===a?o=(e-i)/r:e===a?o=2+(i-t)/r:i===a&&(o=4+(t-e)/r),o=Math.min(o*60,360),o<0&&(o+=360),c=(s+a)/2,a===s?l=0:c<=.5?l=r/(a+s):l=r/(2-a-s),[o,l*100,c*100]};v.rgb.hsv=function(n){var t,e,i,s,a,r=n[0]/255,o=n[1]/255,l=n[2]/255,c=Math.max(r,o,l),p=c-Math.min(r,o,l),h=function(u){return(c-u)/6/p+1/2};return p===0?s=a=0:(a=p/c,t=h(r),e=h(o),i=h(l),r===c?s=i-e:o===c?s=1/3+t-i:l===c&&(s=2/3+e-t),s<0?s+=1:s>1&&(s-=1)),[s*360,a*100,c*100]};v.rgb.hwb=function(n){var t=n[0],e=n[1],i=n[2],s=v.rgb.hsl(n)[0],a=1/255*Math.min(t,Math.min(e,i));return i=1-1/255*Math.max(t,Math.max(e,i)),[s,a*100,i*100]};v.rgb.cmyk=function(n){var t=n[0]/255,e=n[1]/255,i=n[2]/255,s,a,r,o;return o=Math.min(1-t,1-e,1-i),s=(1-t-o)/(1-o)||0,a=(1-e-o)/(1-o)||0,r=(1-i-o)/(1-o)||0,[s*100,a*100,r*100,o*100]};function Mo(n,t){return Math.pow(n[0]-t[0],2)+Math.pow(n[1]-t[1],2)+Math.pow(n[2]-t[2],2)}v.rgb.keyword=function(n){var t=ra[n];if(t)return t;var e=1/0,i;for(var s in ce)if(ce.hasOwnProperty(s)){var a=ce[s],r=Mo(n,a);r<e&&(e=r,i=s)}return i};v.keyword.rgb=function(n){return ce[n]};v.rgb.xyz=function(n){var t=n[0]/255,e=n[1]/255,i=n[2]/255;t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92;var s=t*.4124+e*.3576+i*.1805,a=t*.2126+e*.7152+i*.0722,r=t*.0193+e*.1192+i*.9505;return[s*100,a*100,r*100]};v.rgb.lab=function(n){var t=v.rgb.xyz(n),e=t[0],i=t[1],s=t[2],a,r,o;return e/=95.047,i/=100,s/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,a=116*i-16,r=500*(e-i),o=200*(i-s),[a,r,o]};v.hsl.rgb=function(n){var t=n[0]/360,e=n[1]/100,i=n[2]/100,s,a,r,o,l;if(e===0)return l=i*255,[l,l,l];i<.5?a=i*(1+e):a=i+e-i*e,s=2*i-a,o=[0,0,0];for(var c=0;c<3;c++)r=t+1/3*-(c-1),r<0&&r++,r>1&&r--,6*r<1?l=s+(a-s)*6*r:2*r<1?l=a:3*r<2?l=s+(a-s)*(2/3-r)*6:l=s,o[c]=l*255;return o};v.hsl.hsv=function(n){var t=n[0],e=n[1]/100,i=n[2]/100,s=e,a=Math.max(i,.01),r,o;return i*=2,e*=i<=1?i:2-i,s*=a<=1?a:2-a,o=(i+e)/2,r=i===0?2*s/(a+s):2*e/(i+e),[t,r*100,o*100]};v.hsv.rgb=function(n){var t=n[0]/60,e=n[1]/100,i=n[2]/100,s=Math.floor(t)%6,a=t-Math.floor(t),r=255*i*(1-e),o=255*i*(1-e*a),l=255*i*(1-e*(1-a));switch(i*=255,s){case 0:return[i,l,r];case 1:return[o,i,r];case 2:return[r,i,l];case 3:return[r,o,i];case 4:return[l,r,i];case 5:return[i,r,o]}};v.hsv.hsl=function(n){var t=n[0],e=n[1]/100,i=n[2]/100,s=Math.max(i,.01),a,r,o;return o=(2-e)*i,a=(2-e)*s,r=e*s,r/=a<=1?a:2-a,r=r||0,o/=2,[t,r*100,o*100]};v.hwb.rgb=function(n){var t=n[0]/360,e=n[1]/100,i=n[2]/100,s=e+i,a,r,o,l;s>1&&(e/=s,i/=s),a=Math.floor(6*t),r=1-i,o=6*t-a,a&1&&(o=1-o),l=e+o*(r-e);var c,p,h;switch(a){default:case 6:case 0:c=r,p=l,h=e;break;case 1:c=l,p=r,h=e;break;case 2:c=e,p=r,h=l;break;case 3:c=e,p=l,h=r;break;case 4:c=l,p=e,h=r;break;case 5:c=r,p=e,h=l;break}return[c*255,p*255,h*255]};v.cmyk.rgb=function(n){var t=n[0]/100,e=n[1]/100,i=n[2]/100,s=n[3]/100,a,r,o;return a=1-Math.min(1,t*(1-s)+s),r=1-Math.min(1,e*(1-s)+s),o=1-Math.min(1,i*(1-s)+s),[a*255,r*255,o*255]};v.xyz.rgb=function(n){var t=n[0]/100,e=n[1]/100,i=n[2]/100,s,a,r;return s=t*3.2406+e*-1.5372+i*-.4986,a=t*-.9689+e*1.8758+i*.0415,r=t*.0557+e*-.204+i*1.057,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:r*12.92,s=Math.min(Math.max(0,s),1),a=Math.min(Math.max(0,a),1),r=Math.min(Math.max(0,r),1),[s*255,a*255,r*255]};v.xyz.lab=function(n){var t=n[0],e=n[1],i=n[2],s,a,r;return t/=95.047,e/=100,i/=108.883,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,s=116*e-16,a=500*(t-e),r=200*(e-i),[s,a,r]};v.lab.xyz=function(n){var t=n[0],e=n[1],i=n[2],s,a,r;a=(t+16)/116,s=e/500+a,r=a-i/200;var o=Math.pow(a,3),l=Math.pow(s,3),c=Math.pow(r,3);return a=o>.008856?o:(a-16/116)/7.787,s=l>.008856?l:(s-16/116)/7.787,r=c>.008856?c:(r-16/116)/7.787,s*=95.047,a*=100,r*=108.883,[s,a,r]};v.lab.lch=function(n){var t=n[0],e=n[1],i=n[2],s,a,r;return s=Math.atan2(i,e),a=s*360/2/Math.PI,a<0&&(a+=360),r=Math.sqrt(e*e+i*i),[t,r,a]};v.lch.lab=function(n){var t=n[0],e=n[1],i=n[2],s,a,r;return r=i/360*2*Math.PI,s=e*Math.cos(r),a=e*Math.sin(r),[t,s,a]};v.rgb.ansi16=function(n){var t=n[0],e=n[1],i=n[2],s=1 in arguments?arguments[1]:v.rgb.hsv(n)[2];if(s=Math.round(s/50),s===0)return 30;var a=30+(Math.round(i/255)<<2|Math.round(e/255)<<1|Math.round(t/255));return s===2&&(a+=60),a};v.hsv.ansi16=function(n){return v.rgb.ansi16(v.hsv.rgb(n),n[2])};v.rgb.ansi256=function(n){var t=n[0],e=n[1],i=n[2];if(t===e&&e===i)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;var s=16+36*Math.round(t/255*5)+6*Math.round(e/255*5)+Math.round(i/255*5);return s};v.ansi16.rgb=function(n){var t=n%10;if(t===0||t===7)return n>50&&(t+=3.5),t=t/10.5*255,[t,t,t];var e=(~~(n>50)+1)*.5,i=(t&1)*e*255,s=(t>>1&1)*e*255,a=(t>>2&1)*e*255;return[i,s,a]};v.ansi256.rgb=function(n){if(n>=232){var t=(n-232)*10+8;return[t,t,t]}n-=16;var e,i=Math.floor(n/36)/5*255,s=Math.floor((e=n%36)/6)/5*255,a=e%6/5*255;return[i,s,a]};v.rgb.hex=function(n){var t=((Math.round(n[0])&255)<<16)+((Math.round(n[1])&255)<<8)+(Math.round(n[2])&255),e=t.toString(16).toUpperCase();return"000000".substring(e.length)+e};v.hex.rgb=function(n){var t=n.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var e=t[0];t[0].length===3&&(e=e.split("").map(function(o){return o+o}).join(""));var i=parseInt(e,16),s=i>>16&255,a=i>>8&255,r=i&255;return[s,a,r]};v.rgb.hcg=function(n){var t=n[0]/255,e=n[1]/255,i=n[2]/255,s=Math.max(Math.max(t,e),i),a=Math.min(Math.min(t,e),i),r=s-a,o,l;return r<1?o=a/(1-r):o=0,r<=0?l=0:s===t?l=(e-i)/r%6:s===e?l=2+(i-t)/r:l=4+(t-e)/r+4,l/=6,l%=1,[l*360,r*100,o*100]};v.hsl.hcg=function(n){var t=n[1]/100,e=n[2]/100,i=1,s=0;return e<.5?i=2*t*e:i=2*t*(1-e),i<1&&(s=(e-.5*i)/(1-i)),[n[0],i*100,s*100]};v.hsv.hcg=function(n){var t=n[1]/100,e=n[2]/100,i=t*e,s=0;return i<1&&(s=(e-i)/(1-i)),[n[0],i*100,s*100]};v.hcg.rgb=function(n){var t=n[0]/360,e=n[1]/100,i=n[2]/100;if(e===0)return[i*255,i*255,i*255];var s=[0,0,0],a=t%1*6,r=a%1,o=1-r,l=0;switch(Math.floor(a)){case 0:s[0]=1,s[1]=r,s[2]=0;break;case 1:s[0]=o,s[1]=1,s[2]=0;break;case 2:s[0]=0,s[1]=1,s[2]=r;break;case 3:s[0]=0,s[1]=o,s[2]=1;break;case 4:s[0]=r,s[1]=0,s[2]=1;break;default:s[0]=1,s[1]=0,s[2]=o}return l=(1-e)*i,[(e*s[0]+l)*255,(e*s[1]+l)*255,(e*s[2]+l)*255]};v.hcg.hsv=function(n){var t=n[1]/100,e=n[2]/100,i=t+e*(1-t),s=0;return i>0&&(s=t/i),[n[0],s*100,i*100]};v.hcg.hsl=function(n){var t=n[1]/100,e=n[2]/100,i=e*(1-t)+.5*t,s=0;return i>0&&i<.5?s=t/(2*i):i>=.5&&i<1&&(s=t/(2*(1-i))),[n[0],s*100,i*100]};v.hcg.hwb=function(n){var t=n[1]/100,e=n[2]/100,i=t+e*(1-t);return[n[0],(i-t)*100,(1-i)*100]};v.hwb.hcg=function(n){var t=n[1]/100,e=n[2]/100,i=1-e,s=i-t,a=0;return s<1&&(a=(i-s)/(1-s)),[n[0],s*100,a*100]};v.apple.rgb=function(n){return[n[0]/65535*255,n[1]/65535*255,n[2]/65535*255]};v.rgb.apple=function(n){return[n[0]/255*65535,n[1]/255*65535,n[2]/255*65535]};v.gray.rgb=function(n){return[n[0]/100*255,n[0]/100*255,n[0]/100*255]};v.gray.hsl=v.gray.hsv=function(n){return[0,0,n[0]]};v.gray.hwb=function(n){return[0,100,n[0]]};v.gray.cmyk=function(n){return[0,0,0,n[0]]};v.gray.lab=function(n){return[n[0],0,0]};v.gray.hex=function(n){var t=Math.round(n[0]/100*255)&255,e=(t<<16)+(t<<8)+t,i=e.toString(16).toUpperCase();return"000000".substring(i.length)+i};v.rgb.gray=function(n){var t=(n[0]+n[1]+n[2])/3;return[t/255*100]}});var la=T((ou,oa)=>{var ut=Vt();function Oo(){for(var n={},t=Object.keys(ut),e=t.length,i=0;i<e;i++)n[t[i]]={distance:-1,parent:null};return n}function Do(n){var t=Oo(),e=[n];for(t[n].distance=0;e.length;)for(var i=e.pop(),s=Object.keys(ut[i]),a=s.length,r=0;r<a;r++){var o=s[r],l=t[o];l.distance===-1&&(l.distance=t[i].distance+1,l.parent=i,e.unshift(o))}return t}function Bo(n,t){return function(e){return t(n(e))}}function Fo(n,t){for(var e=[t[n].parent,n],i=ut[t[n].parent][n],s=t[n].parent;t[s].parent;)e.unshift(t[s].parent),i=Bo(ut[t[s].parent][s],i),s=t[s].parent;return i.conversion=e,i}oa.exports=function(n){for(var t=Do(n),e={},i=Object.keys(t),s=i.length,a=0;a<s;a++){var r=i[a],o=t[r];o.parent!==null&&(e[r]=Fo(r,t))}return e}});var pa=T((lu,ca)=>{var Wt=Vt(),jo=la(),xe={},Ro=Object.keys(Wt);function Uo(n){var t=function(e){return e==null?e:(arguments.length>1&&(e=Array.prototype.slice.call(arguments)),n(e))};return"conversion"in n&&(t.conversion=n.conversion),t}function qo(n){var t=function(e){if(e==null)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var i=n(e);if(typeof i=="object")for(var s=i.length,a=0;a<s;a++)i[a]=Math.round(i[a]);return i};return"conversion"in n&&(t.conversion=n.conversion),t}Ro.forEach(function(n){xe[n]={},Object.defineProperty(xe[n],"channels",{value:Wt[n].channels}),Object.defineProperty(xe[n],"labels",{value:Wt[n].labels});var t=jo(n),e=Object.keys(t);e.forEach(function(i){var s=t[i];xe[n][i]=qo(s),xe[n][i].raw=Uo(s)})});ca.exports=xe});var ua=T((cu,ha)=>{"use strict";var ge=pa(),dt=(n,t)=>function(){return`\x1B[${n.apply(ge,arguments)+t}m`},ft=(n,t)=>function(){let e=n.apply(ge,arguments);return`\x1B[${38+t};5;${e}m`},mt=(n,t)=>function(){let e=n.apply(ge,arguments);return`\x1B[${38+t};2;${e[0]};${e[1]};${e[2]}m`};function zo(){let n=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.grey=t.color.gray;for(let s of Object.keys(t)){let a=t[s];for(let r of Object.keys(a)){let o=a[r];t[r]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},a[r]=t[r],n.set(o[0],o[1])}Object.defineProperty(t,s,{value:a,enumerable:!1}),Object.defineProperty(t,"codes",{value:n,enumerable:!1})}let e=s=>s,i=(s,a,r)=>[s,a,r];t.color.close="\x1B[39m",t.bgColor.close="\x1B[49m",t.color.ansi={ansi:dt(e,0)},t.color.ansi256={ansi256:ft(e,0)},t.color.ansi16m={rgb:mt(i,0)},t.bgColor.ansi={ansi:dt(e,10)},t.bgColor.ansi256={ansi256:ft(e,10)},t.bgColor.ansi16m={rgb:mt(i,10)};for(let s of Object.keys(ge)){if(typeof ge[s]!="object")continue;let a=ge[s];s==="ansi16"&&(s="ansi"),"ansi16"in a&&(t.color.ansi[s]=dt(a.ansi16,0),t.bgColor.ansi[s]=dt(a.ansi16,10)),"ansi256"in a&&(t.color.ansi256[s]=ft(a.ansi256,0),t.bgColor.ansi256[s]=ft(a.ansi256,10)),"rgb"in a&&(t.color.ansi16m[s]=mt(a.rgb,0),t.bgColor.ansi16m[s]=mt(a.rgb,10))}return t}Object.defineProperty(ha,"exports",{enumerable:!0,get:zo})});var fa=T((pu,da)=>{"use strict";da.exports=(n,t)=>{t=t||process.argv;let e=n.startsWith("-")?"":n.length===1?"-":"--",i=t.indexOf(e+n),s=t.indexOf("--");return i!==-1&&(s===-1?!0:i<s)}});var xa=T((hu,ma)=>{"use strict";var Ho=require("os"),R=fa(),M=process.env,ye;R("no-color")||R("no-colors")||R("color=false")?ye=!1:(R("color")||R("colors")||R("color=true")||R("color=always"))&&(ye=!0);"FORCE_COLOR"in M&&(ye=M.FORCE_COLOR.length===0||parseInt(M.FORCE_COLOR,10)!==0);function $o(n){return n===0?!1:{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}function Ko(n){if(ye===!1)return 0;if(R("color=16m")||R("color=full")||R("color=truecolor"))return 3;if(R("color=256"))return 2;if(n&&!n.isTTY&&ye!==!0)return 0;let t=ye?1:0;if(process.platform==="win32"){let e=Ho.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in M)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in M)||M.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in M)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(M.TEAMCITY_VERSION)?1:0;if(M.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in M){let e=parseInt((M.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(M.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(M.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(M.TERM)||"COLORTERM"in M?1:(M.TERM==="dumb",t)}function Gt(n){let t=Ko(n);return $o(t)}ma.exports={supportsColor:Gt,stdout:Gt(process.stdout),stderr:Gt(process.stderr)}});var wa=T((uu,ba)=>{"use strict";var Vo=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,ga=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,Wo=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,Go=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi,Xo=new Map([["n",`
|
|
4
|
-
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function
|
|
5
|
-
`):e+=
|
|
6
|
-
`,
|
|
7
|
-
`);return e.message&&!
|
|
8
|
-
${m}`),i
|
|
9
|
-
- Did you mean \`export { '${
|
|
10
|
-
- Did you mean \`import { "${n}" as foo }\`?`,ImportCallArgumentTrailingComma:"Trailing comma is disallowed inside import(...) arguments.",ImportCallArity:({maxArgumentCount:n})=>`\`import()\` requires exactly ${n===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:n})=>`Expected number in radix ${n}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:n})=>`Escape sequence in keyword ${n}.`,InvalidIdentifier:({identifierName:n})=>`Invalid identifier ${n}.`,InvalidLhs:({ancestor:n})=>`Invalid left-hand side in ${ni(n)}.`,InvalidLhsBinding:({ancestor:n})=>`Binding invalid left-hand side in ${ni(n)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:n})=>`Unexpected character '${n}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:n})=>`Private name #${n} 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:n})=>`Label '${n}' is already declared.`,LetInLexicalBinding:"'let' is not allowed to be used as a name in 'let' or 'const' declarations.",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:n})=>`This experimental syntax requires enabling the parser plugin: ${n.map(t=>JSON.stringify(t)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:n})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${n.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:n})=>`Duplicate key "${n}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:n})=>`An export name cannot include a lone surrogate, found '\\u${n.toString(16)}'.`,ModuleExportUndefined:({localName:n})=>`Export '${n}' 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:n})=>`Private names are only allowed in property accesses (\`obj.#${n}\`) or in \`in\` expressions (\`#${n} in obj\`).`,PrivateNameRedeclaration:({identifierName:n})=>`Duplicate private name #${n}.`,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.",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:n})=>`Unexpected keyword '${n}'.`,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:n})=>`Unexpected reserved word '${n}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:n,unexpected:t})=>`Unexpected token${t?` '${t}'.`:""}${n?`, expected "${n}"`:""}`,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:n,onlyValidPropertyName:t})=>`The only valid meta property for ${n} is ${n}.${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.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:n})=>`Identifier '${n}' 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."},ml={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:n})=>`Assigning to '${n}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:n})=>`Binding '${n}' 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."},xl=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),gl={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:n})=>`Invalid topic token ${n}. In order to use ${n} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${n}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:n})=>`Hack-style pipe body cannot be an unparenthesized ${ni({type:n})}; 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.'},yl=["toMessage"],vl=["message"];function bl(n){let{toMessage:t}=n,e=Et(n,yl);return function i({loc:s,details:a}){return ul(SyntaxError,Object.assign({},e,{loc:s}),{clone(r={}){let o=r.loc||{};return i({loc:new V("line"in o?o.line:this.loc.line,"column"in o?o.column:this.loc.column,"index"in o?o.index:this.loc.index),details:Object.assign({},this.details,r.details)})},details:{value:a,enumerable:!1},message:{get(){return`${t(this.details)} (${this.loc.line}:${this.loc.column})`},set(r){Object.defineProperty(this,"message",{value:r})}},pos:{reflect:"loc.index",enumerable:!0},missingPlugin:"missingPlugin"in a&&{reflect:"details.missingPlugin",enumerable:!0}})}}function ee(n,t){if(Array.isArray(n))return i=>ee(i,n[0]);let e={};for(let i of Object.keys(n)){let s=n[i],a=typeof s=="string"?{message:()=>s}:typeof s=="function"?{message:s}:s,{message:r}=a,o=Et(a,vl),l=typeof r=="string"?()=>r:r;e[i]=bl(Object.assign({code:ri.SyntaxError,reasonCode:i,toMessage:l},t?{syntaxPlugin:t}:{},o))}return e}var d=Object.assign({},ee(dl),ee(fl),ee(ml),ee`pipelineOperator`(gl)),{defineProperty:wl}=Object,ja=(n,t)=>wl(n,t,{enumerable:!1,value:n[t]});function Ue(n){return n.loc.start&&ja(n.loc.start,"index"),n.loc.end&&ja(n.loc.end,"index"),n}var Pl=n=>class extends n{parse(){let e=Ue(super.parse());return this.options.tokens&&(e.tokens=e.tokens.map(Ue)),e}parseRegExpLiteral({pattern:e,flags:i}){let s=null;try{s=new RegExp(e,i)}catch{}let a=this.estreeParseLiteral(s);return a.regex={pattern:e,flags:i},a}parseBigIntLiteral(e){let i;try{i=BigInt(e)}catch{i=null}let s=this.estreeParseLiteral(i);return s.bigint=String(s.value||e),s}parseDecimalLiteral(e){let s=this.estreeParseLiteral(null);return s.decimal=String(s.value||e),s}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 i=e.value;delete e.value,i.type="Literal",i.raw=i.extra.raw,i.value=i.extra.expressionValue;let s=e;return s.type="ExpressionStatement",s.expression=i,s.directive=i.extra.rawValue,delete i.extra,s}initFunction(e,i){super.initFunction(e,i),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 i;return e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&!((i=e.expression.extra)!=null&&i.parenthesized)}parseBlockBody(e,i,s,a,r){super.parseBlockBody(e,i,s,a,r);let o=e.directives.map(l=>this.directiveToStmt(l));e.body=o.concat(e.body),delete e.directives}pushClassMethod(e,i,s,a,r,o){this.parseMethod(i,s,a,r,o,"ClassMethod",!0),i.typeParameters&&(i.value.typeParameters=i.typeParameters,delete i.typeParameters),e.body.push(i)}parsePrivateName(){let e=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(e):e}convertPrivateNameToPrivateIdentifier(e){let i=super.getPrivateNameSV(e);return e=e,delete e.id,e.name=i,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,i){let s=super.parseLiteral(e,i);return s.raw=s.extra.raw,delete s.extra,s}parseFunctionBody(e,i,s=!1){super.parseFunctionBody(e,i,s),e.expression=e.body.type!=="BlockStatement"}parseMethod(e,i,s,a,r,o,l=!1){let c=this.startNode();return c.kind=e.kind,c=super.parseMethod(c,i,s,a,r,o,l),c.type="FunctionExpression",delete c.kind,e.value=c,o==="ClassPrivateMethod"&&(e.computed=!1),this.finishNode(e,"MethodDefinition")}parseClassProperty(...e){let i=super.parseClassProperty(...e);return this.getPluginOption("estree","classFeatures")&&(i.type="PropertyDefinition"),i}parseClassPrivateProperty(...e){let i=super.parseClassPrivateProperty(...e);return this.getPluginOption("estree","classFeatures")&&(i.type="PropertyDefinition",i.computed=!1),i}parseObjectMethod(e,i,s,a,r){let o=super.parseObjectMethod(e,i,s,a,r);return o&&(o.type="Property",o.kind==="method"&&(o.kind="init"),o.shorthand=!1),o}parseObjectProperty(e,i,s,a){let r=super.parseObjectProperty(e,i,s,a);return r&&(r.kind="init",r.type="Property"),r}isValidLVal(e,i,s){return e==="Property"?"value":super.isValidLVal(e,i,s)}isAssignable(e,i){return e!=null&&this.isObjectProperty(e)?this.isAssignable(e.value,i):super.isAssignable(e,i)}toAssignable(e,i=!1){if(e!=null&&this.isObjectProperty(e)){let{key:s,value:a}=e;this.isPrivateName(s)&&this.classScope.usePrivateName(this.getPrivateNameSV(s),s.loc.start),this.toAssignable(a,i)}else super.toAssignable(e,i)}toAssignableObjectExpressionProp(e,i,s){e.kind==="get"||e.kind==="set"?this.raise(d.PatternHasAccessor,{at:e.key}):e.method?this.raise(d.PatternHasMethod,{at:e.key}):super.toAssignableObjectExpressionProp(e,i,s)}finishCallExpression(e,i){let s=super.finishCallExpression(e,i);if(s.callee.type==="Import"){if(s.type="ImportExpression",s.source=s.arguments[0],this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions")){var a;s.attributes=(a=s.arguments[1])!=null?a:null}delete s.arguments,delete s.callee}return s}toReferencedArguments(e){e.type!=="ImportExpression"&&super.toReferencedArguments(e)}parseExport(e,i){let s=this.state.lastTokStartLoc,a=super.parseExport(e,i);switch(a.type){case"ExportAllDeclaration":a.exported=null;break;case"ExportNamedDeclaration":a.specifiers.length===1&&a.specifiers[0].type==="ExportNamespaceSpecifier"&&(a.type="ExportAllDeclaration",a.exported=a.specifiers[0].exported,delete a.specifiers);case"ExportDefaultDeclaration":{var r;let{declaration:o}=a;(o==null?void 0:o.type)==="ClassDeclaration"&&((r=o.decorators)==null?void 0:r.length)>0&&o.start===a.start&&this.resetStartLocation(a,s)}break}return a}parseSubscript(e,i,s,a){let r=super.parseSubscript(e,i,s,a);if(a.optionalChainMember){if((r.type==="OptionalMemberExpression"||r.type==="OptionalCallExpression")&&(r.type=r.type.substring(8)),a.stop){let o=this.startNodeAtNode(r);return o.expression=r,this.finishNode(o,"ChainExpression")}}else(r.type==="MemberExpression"||r.type==="CallExpression")&&(r.optional=!1);return r}hasPropertyAsPrivateName(e){return e.type==="ChainExpression"&&(e=e.expression),super.hasPropertyAsPrivateName(e)}isObjectProperty(e){return e.type==="Property"&&e.kind==="init"&&!e.method}isObjectMethod(e){return e.method||e.kind==="get"||e.kind==="set"}finishNodeAt(e,i,s){return Ue(super.finishNodeAt(e,i,s))}resetStartLocation(e,i){super.resetStartLocation(e,i),Ue(e)}resetEndLocation(e,i=this.state.lastTokEndLoc){super.resetEndLocation(e,i),Ue(e)}},ue=class{constructor(t,e){this.token=void 0,this.preserveSpace=void 0,this.token=t,this.preserveSpace=!!e}},I={brace:new ue("{"),j_oTag:new ue("<tag"),j_cTag:new ue("</tag"),j_expr:new ue("<tag>...</tag>",!0)};I.template=new ue("`",!0);var E=!0,g=!0,Zt=!0,qe=!0,ae=!0,Tl=!0,St=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}},Ii=new Map;function C(n,t={}){t.keyword=n;let e=w(n,t);return Ii.set(n,e),e}function D(n,t){return w(n,{beforeExpr:E,binop:t})}var Ke=-1,Y=[],Ni=[],_i=[],Li=[],Mi=[],Oi=[];function w(n,t={}){var e,i,s,a;return++Ke,Ni.push(n),_i.push((e=t.binop)!=null?e:-1),Li.push((i=t.beforeExpr)!=null?i:!1),Mi.push((s=t.startsExpr)!=null?s:!1),Oi.push((a=t.prefix)!=null?a:!1),Y.push(new St(n,t)),Ke}function S(n,t={}){var e,i,s,a;return++Ke,Ii.set(n,Ke),Ni.push(n),_i.push((e=t.binop)!=null?e:-1),Li.push((i=t.beforeExpr)!=null?i:!1),Mi.push((s=t.startsExpr)!=null?s:!1),Oi.push((a=t.prefix)!=null?a:!1),Y.push(new St("name",t)),Ke}var Al={bracketL:w("[",{beforeExpr:E,startsExpr:g}),bracketHashL:w("#[",{beforeExpr:E,startsExpr:g}),bracketBarL:w("[|",{beforeExpr:E,startsExpr:g}),bracketR:w("]"),bracketBarR:w("|]"),braceL:w("{",{beforeExpr:E,startsExpr:g}),braceBarL:w("{|",{beforeExpr:E,startsExpr:g}),braceHashL:w("#{",{beforeExpr:E,startsExpr:g}),braceR:w("}"),braceBarR:w("|}"),parenL:w("(",{beforeExpr:E,startsExpr:g}),parenR:w(")"),comma:w(",",{beforeExpr:E}),semi:w(";",{beforeExpr:E}),colon:w(":",{beforeExpr:E}),doubleColon:w("::",{beforeExpr:E}),dot:w("."),question:w("?",{beforeExpr:E}),questionDot:w("?."),arrow:w("=>",{beforeExpr:E}),template:w("template"),ellipsis:w("...",{beforeExpr:E}),backQuote:w("`",{startsExpr:g}),dollarBraceL:w("${",{beforeExpr:E,startsExpr:g}),templateTail:w("...`",{startsExpr:g}),templateNonTail:w("...${",{beforeExpr:E,startsExpr:g}),at:w("@"),hash:w("#",{startsExpr:g}),interpreterDirective:w("#!..."),eq:w("=",{beforeExpr:E,isAssign:qe}),assign:w("_=",{beforeExpr:E,isAssign:qe}),slashAssign:w("_=",{beforeExpr:E,isAssign:qe}),xorAssign:w("_=",{beforeExpr:E,isAssign:qe}),moduloAssign:w("_=",{beforeExpr:E,isAssign:qe}),incDec:w("++/--",{prefix:ae,postfix:Tl,startsExpr:g}),bang:w("!",{beforeExpr:E,prefix:ae,startsExpr:g}),tilde:w("~",{beforeExpr:E,prefix:ae,startsExpr:g}),doubleCaret:w("^^",{startsExpr:g}),doubleAt:w("@@",{startsExpr:g}),pipeline:D("|>",0),nullishCoalescing:D("??",1),logicalOR:D("||",1),logicalAND:D("&&",2),bitwiseOR:D("|",3),bitwiseXOR:D("^",4),bitwiseAND:D("&",5),equality:D("==/!=/===/!==",6),lt:D("</>/<=/>=",7),gt:D("</>/<=/>=",7),relational:D("</>/<=/>=",7),bitShift:D("<</>>/>>>",8),bitShiftL:D("<</>>/>>>",8),bitShiftR:D("<</>>/>>>",8),plusMin:w("+/-",{beforeExpr:E,binop:9,prefix:ae,startsExpr:g}),modulo:w("%",{binop:10,startsExpr:g}),star:w("*",{binop:10}),slash:D("/",10),exponent:w("**",{beforeExpr:E,binop:11,rightAssociative:!0}),_in:C("in",{beforeExpr:E,binop:7}),_instanceof:C("instanceof",{beforeExpr:E,binop:7}),_break:C("break"),_case:C("case",{beforeExpr:E}),_catch:C("catch"),_continue:C("continue"),_debugger:C("debugger"),_default:C("default",{beforeExpr:E}),_else:C("else",{beforeExpr:E}),_finally:C("finally"),_function:C("function",{startsExpr:g}),_if:C("if"),_return:C("return",{beforeExpr:E}),_switch:C("switch"),_throw:C("throw",{beforeExpr:E,prefix:ae,startsExpr:g}),_try:C("try"),_var:C("var"),_const:C("const"),_with:C("with"),_new:C("new",{beforeExpr:E,startsExpr:g}),_this:C("this",{startsExpr:g}),_super:C("super",{startsExpr:g}),_class:C("class",{startsExpr:g}),_extends:C("extends",{beforeExpr:E}),_export:C("export"),_import:C("import",{startsExpr:g}),_null:C("null",{startsExpr:g}),_true:C("true",{startsExpr:g}),_false:C("false",{startsExpr:g}),_typeof:C("typeof",{beforeExpr:E,prefix:ae,startsExpr:g}),_void:C("void",{beforeExpr:E,prefix:ae,startsExpr:g}),_delete:C("delete",{beforeExpr:E,prefix:ae,startsExpr:g}),_do:C("do",{isLoop:Zt,beforeExpr:E}),_for:C("for",{isLoop:Zt}),_while:C("while",{isLoop:Zt}),_as:S("as",{startsExpr:g}),_assert:S("assert",{startsExpr:g}),_async:S("async",{startsExpr:g}),_await:S("await",{startsExpr:g}),_from:S("from",{startsExpr:g}),_get:S("get",{startsExpr:g}),_let:S("let",{startsExpr:g}),_meta:S("meta",{startsExpr:g}),_of:S("of",{startsExpr:g}),_sent:S("sent",{startsExpr:g}),_set:S("set",{startsExpr:g}),_static:S("static",{startsExpr:g}),_using:S("using",{startsExpr:g}),_yield:S("yield",{startsExpr:g}),_asserts:S("asserts",{startsExpr:g}),_checks:S("checks",{startsExpr:g}),_exports:S("exports",{startsExpr:g}),_global:S("global",{startsExpr:g}),_implements:S("implements",{startsExpr:g}),_intrinsic:S("intrinsic",{startsExpr:g}),_infer:S("infer",{startsExpr:g}),_is:S("is",{startsExpr:g}),_mixins:S("mixins",{startsExpr:g}),_proto:S("proto",{startsExpr:g}),_require:S("require",{startsExpr:g}),_satisfies:S("satisfies",{startsExpr:g}),_keyof:S("keyof",{startsExpr:g}),_readonly:S("readonly",{startsExpr:g}),_unique:S("unique",{startsExpr:g}),_abstract:S("abstract",{startsExpr:g}),_declare:S("declare",{startsExpr:g}),_enum:S("enum",{startsExpr:g}),_module:S("module",{startsExpr:g}),_namespace:S("namespace",{startsExpr:g}),_interface:S("interface",{startsExpr:g}),_type:S("type",{startsExpr:g}),_opaque:S("opaque",{startsExpr:g}),name:w("name",{startsExpr:g}),string:w("string",{startsExpr:g}),num:w("num",{startsExpr:g}),bigint:w("bigint",{startsExpr:g}),decimal:w("decimal",{startsExpr:g}),regexp:w("regexp",{startsExpr:g}),privateName:w("#name",{startsExpr:g}),eof:w("eof"),jsxName:w("jsxName"),jsxText:w("jsxText",{beforeExpr:!0}),jsxTagStart:w("jsxTagStart",{startsExpr:!0}),jsxTagEnd:w("jsxTagEnd"),placeholder:w("%%",{startsExpr:!0})};function k(n){return n>=93&&n<=130}function El(n){return n<=92}function U(n){return n>=58&&n<=130}function er(n){return n>=58&&n<=134}function Sl(n){return Li[n]}function oi(n){return Mi[n]}function Cl(n){return n>=29&&n<=33}function Ra(n){return n>=127&&n<=129}function kl(n){return n>=90&&n<=92}function Di(n){return n>=58&&n<=92}function Il(n){return n>=39&&n<=59}function Nl(n){return n===34}function _l(n){return Oi[n]}function Ll(n){return n>=119&&n<=121}function Ml(n){return n>=122&&n<=128}function oe(n){return Ni[n]}function wt(n){return _i[n]}function Ol(n){return n===57}function Ct(n){return n>=24&&n<=25}function Q(n){return Y[n]}Y[8].updateContext=n=>{n.pop()},Y[5].updateContext=Y[7].updateContext=Y[23].updateContext=n=>{n.push(I.brace)},Y[22].updateContext=n=>{n[n.length-1]===I.template?n.pop():n.push(I.template)},Y[140].updateContext=n=>{n.push(I.j_expr,I.j_oTag)};var Bi="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",tr="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\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",Dl=new RegExp("["+Bi+"]"),Bl=new RegExp("["+Bi+tr+"]");Bi=tr=null;var ir=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,3104,541,1507,4938,6,4191],Fl=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239];function li(n,t){let e=65536;for(let i=0,s=t.length;i<s;i+=2){if(e+=t[i],e>n)return!1;if(e+=t[i+1],e>=n)return!0}return!1}function Z(n){return n<65?n===36:n<=90?!0:n<97?n===95:n<=122?!0:n<=65535?n>=170&&Dl.test(String.fromCharCode(n)):li(n,ir)}function Ae(n){return n<48?n===36:n<58?!0:n<65?!1:n<=90?!0:n<97?n===95:n<=122?!0:n<=65535?n>=170&&Bl.test(String.fromCharCode(n)):li(n,ir)||li(n,Fl)}var Fi={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"]},jl=new Set(Fi.keyword),Rl=new Set(Fi.strict),Ul=new Set(Fi.strictBind);function sr(n,t){return t&&n==="await"||n==="enum"}function ar(n,t){return sr(n,t)||Rl.has(n)}function rr(n){return Ul.has(n)}function nr(n,t){return ar(n,t)||rr(n)}function ql(n){return jl.has(n)}function zl(n,t,e){return n===64&&t===64&&Z(e)}var Hl=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 $l(n){return Hl.has(n)}var we=0,Pe=1,te=2,ji=4,or=8,kt=16,lr=32,de=64,It=128,Ee=256,yt=Pe|te|It|Ee,W=1,me=2,cr=4,fe=8,Pt=16,pr=64,Nt=128,ci=256,pi=512,Ri=1024,hi=2048,Ve=4096,Dt=8192,hr=W|me|fe|Nt|Dt,Se=W|0|fe|Dt,Kl=W|0|fe|0,_t=W|0|cr|0,ur=W|0|Pt|0,Vl=0|me|0|Nt,Wl=0|me|0|0,dr=W|me|fe|ci|Dt,Ua=0|Ri,ne=0|pr,Gl=W|0|0|pr,Xl=dr|pi,Jl=0|Ri,qa=0|me|0|Ve,Ql=hi,Lt=4,Ui=2,qi=1,ei=Ui|qi,Yl=Ui|Lt,Zl=qi|Lt,ec=Ui,tc=qi,ti=0,Ge=class{constructor(t){this.var=new Set,this.lexical=new Set,this.functions=new Set,this.flags=t}},Xe=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&Pe)>0}get inFunction(){return(this.currentVarScopeFlags()&te)>0}get allowSuper(){return(this.currentThisScopeFlags()&kt)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&lr)>0}get inClass(){return(this.currentThisScopeFlags()&de)>0}get inClassAndNotInNonArrowFunction(){let t=this.currentThisScopeFlags();return(t&de)>0&&(t&te)===0}get inStaticBlock(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&It)return!0;if(e&(yt|de))return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&te)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(t){return new Ge(t)}enter(t){this.scopeStack.push(this.createScope(t))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(t){return!!(t.flags&(te|It)||!this.parser.inModule&&t.flags&Pe)}declareName(t,e,i){let s=this.currentScope();if(e&fe||e&Pt)this.checkRedeclarationInScope(s,t,e,i),e&Pt?s.functions.add(t):s.lexical.add(t),e&fe&&this.maybeExportDefined(s,t);else if(e&cr)for(let a=this.scopeStack.length-1;a>=0&&(s=this.scopeStack[a],this.checkRedeclarationInScope(s,t,e,i),s.var.add(t),this.maybeExportDefined(s,t),!(s.flags&yt));--a);this.parser.inModule&&s.flags&Pe&&this.undefinedExports.delete(t)}maybeExportDefined(t,e){this.parser.inModule&&t.flags&Pe&&this.undefinedExports.delete(e)}checkRedeclarationInScope(t,e,i,s){this.isRedeclaredInScope(t,e,i)&&this.parser.raise(d.VarRedeclaration,{at:s,identifierName:e})}isRedeclaredInScope(t,e,i){return i&W?i&fe?t.lexical.has(e)||t.functions.has(e)||t.var.has(e):i&Pt?t.lexical.has(e)||!this.treatFunctionsAsVarInScope(t)&&t.var.has(e):t.lexical.has(e)&&!(t.flags&or&&t.lexical.values().next().value===e)||!this.treatFunctionsAsVarInScope(t)&&t.functions.has(e):!1}checkLocalExport(t){let{name:e}=t,i=this.scopeStack[0];!i.lexical.has(e)&&!i.var.has(e)&&!i.functions.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&yt)return e}}currentThisScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&(yt|de)&&!(e&ji))return e}}},ui=class extends Ge{constructor(...t){super(...t),this.declareFunctions=new Set}},di=class extends Xe{createScope(t){return new ui(t)}declareName(t,e,i){let s=this.currentScope();if(e&hi){this.checkRedeclarationInScope(s,t,e,i),this.maybeExportDefined(s,t),s.declareFunctions.add(t);return}super.declareName(t,e,i)}isRedeclaredInScope(t,e,i){return super.isRedeclaredInScope(t,e,i)?!0:i&hi?!t.declareFunctions.has(e)&&(t.lexical.has(e)||t.functions.has(e)):!1}checkLocalExport(t){this.scopeStack[0].declareFunctions.has(t.name)||super.checkLocalExport(t)}},fi=class{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}hasPlugin(t){if(typeof t=="string")return this.plugins.has(t);{let[e,i]=t;if(!this.hasPlugin(e))return!1;let s=this.plugins.get(e);for(let a of Object.keys(i))if((s==null?void 0:s[a])!==i[a])return!1;return!0}}getPluginOption(t,e){var i;return(i=this.plugins.get(t))==null?void 0:i[e]}};function fr(n,t){n.trailingComments===void 0?n.trailingComments=t:n.trailingComments.unshift(...t)}function ic(n,t){n.leadingComments===void 0?n.leadingComments=t:n.leadingComments.unshift(...t)}function Je(n,t){n.innerComments===void 0?n.innerComments=t:n.innerComments.unshift(...t)}function ze(n,t,e){let i=null,s=t.length;for(;i===null&&s>0;)i=t[--s];i===null||i.start>e.start?Je(n,e.comments):fr(i,e.comments)}var mi=class extends fi{addComment(t){this.filename&&(t.loc.filename=this.filename),this.state.comments.push(t)}processComment(t){let{commentStack:e}=this.state,i=e.length;if(i===0)return;let s=i-1,a=e[s];a.start===t.end&&(a.leadingNode=t,s--);let{start:r}=t;for(;s>=0;s--){let o=e[s],l=o.end;if(l>r)o.containingNode=t,this.finalizeComment(o),e.splice(s,1);else{l===r&&(o.trailingNode=t);break}}}finalizeComment(t){let{comments:e}=t;if(t.leadingNode!==null||t.trailingNode!==null)t.leadingNode!==null&&fr(t.leadingNode,e),t.trailingNode!==null&&ic(t.trailingNode,e);else{let{containingNode:i,start:s}=t;if(this.input.charCodeAt(s-1)===44)switch(i.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":ze(i,i.properties,t);break;case"CallExpression":case"OptionalCallExpression":ze(i,i.arguments,t);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":ze(i,i.params,t);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":ze(i,i.elements,t);break;case"ExportNamedDeclaration":case"ImportDeclaration":ze(i,i.specifiers,t);break;default:Je(i,e)}else Je(i,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:i}=e;if(i===0)return;let s=e[i-1];s.leadingNode===t&&(s.leadingNode=null)}resetPreviousIdentifierLeadingComments(t){let{commentStack:e}=this.state,{length:i}=e;i!==0&&(e[i-1].trailingNode===t?e[i-1].trailingNode=null:i>=2&&e[i-2].trailingNode===t&&(e[i-2].trailingNode=null))}takeSurroundingComments(t,e,i){let{commentStack:s}=this.state,a=s.length;if(a===0)return;let r=a-1;for(;r>=0;r--){let o=s[r],l=o.end;if(o.start===i)o.leadingNode=t;else if(l===e)o.trailingNode=t;else if(l<e)break}}},mr=/\r\n?|[\n\u2028\u2029]/,vt=new RegExp(mr.source,"g");function We(n){switch(n){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}var ii=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Tt=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g,za=new RegExp("(?=("+Tt.source+"))\\1"+/(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source,"y");function sc(n){switch(n){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 Qe=class{constructor(){this.strict=void 0,this.curLine=void 0,this.lineStart=void 0,this.startLoc=void 0,this.endLoc=void 0,this.errors=[],this.potentialArrowAt=-1,this.noArrowAt=[],this.noArrowParamsConversionAt=[],this.maybeInArrowParameters=!1,this.inType=!1,this.noAnonFunctionType=!1,this.hasFlowComment=!1,this.isAmbientContext=!1,this.inAbstractClass=!1,this.inDisallowConditionalTypesContext=!1,this.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null},this.soloAwait=!1,this.inFSharpPipelineDirectBody=!1,this.labels=[],this.comments=[],this.commentStack=[],this.pos=0,this.type=137,this.value=null,this.start=0,this.end=0,this.lastTokEndLoc=null,this.lastTokStartLoc=null,this.lastTokStart=0,this.context=[I.brace],this.canStartJSXElement=!0,this.containsEsc=!1,this.firstInvalidTemplateEscapePos=null,this.strictErrors=new Map,this.tokensLength=0}init({strictMode:t,sourceType:e,startLine:i,startColumn:s}){this.strict=t===!1?!1:t===!0?!0:e==="module",this.curLine=i,this.lineStart=-s,this.startLoc=this.endLoc=new V(i,s,0)}curPosition(){return new V(this.curLine,this.pos-this.lineStart,this.pos)}clone(t){let e=new Qe,i=Object.keys(this);for(let s=0,a=i.length;s<a;s++){let r=i[s],o=this[r];!t&&Array.isArray(o)&&(o=o.slice()),e[r]=o}return e}},ac=function(t){return t>=48&&t<=57},Ha={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},bt={bin:n=>n===48||n===49,oct:n=>n>=48&&n<=55,dec:n=>n>=48&&n<=57,hex:n=>n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102};function $a(n,t,e,i,s,a){let r=e,o=i,l=s,c="",p=null,h=e,{length:u}=t;for(;;){if(e>=u){a.unterminated(r,o,l),c+=t.slice(h,e);break}let f=t.charCodeAt(e);if(rc(n,f,t,e)){c+=t.slice(h,e);break}if(f===92){c+=t.slice(h,e);let m=nc(t,e,i,s,n==="template",a);m.ch===null&&!p?p={pos:e,lineStart:i,curLine:s}:c+=m.ch,{pos:e,lineStart:i,curLine:s}=m,h=e}else f===8232||f===8233?(++e,++s,i=e):f===10||f===13?n==="template"?(c+=t.slice(h,e)+`
|
|
11
|
-
`,++e,
|
|
12
|
-
`);case 114:return o("\r");case 120:{let c;return{code:c,pos:t}=xi(n,t,e,i,2,!1,r,a),o(c===null?null:String.fromCharCode(c))}case 117:{let c;return{code:c,pos:t}=gr(n,t,e,i,r,a),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:n.charCodeAt(t)===10&&++t;case 10:e=t,++i;case 8232:case 8233:return o("");case 56:case 57:if(s)return o(null);a.strictNumericEscape(t-1,e,i);default:if(l>=48&&l<=55){let c=t-1,h=n.slice(c,t+2).match(/^[0-7]+/)[0],u=parseInt(h,8);u>255&&(h=h.slice(0,-1),u=parseInt(h,8)),t+=h.length-1;let f=n.charCodeAt(t);if(h!=="0"||f===56||f===57){if(s)return o(null);a.strictNumericEscape(c,e,i)}return o(String.fromCharCode(u))}return o(String.fromCharCode(l))}}function xi(n,t,e,i,s,a,r,o){let l=t,c;return{n:c,pos:t}=xr(n,t,e,i,16,s,a,!1,o,!r),c===null&&(r?o.invalidEscapeSequence(l,e,i):t=l-1),{code:c,pos:t}}function xr(n,t,e,i,s,a,r,o,l,c){let p=t,h=s===16?Ha.hex:Ha.decBinOct,u=s===16?bt.hex:s===10?bt.dec:s===8?bt.oct:bt.bin,f=!1,m=0;for(let x=0,b=a??1/0;x<b;++x){let A=n.charCodeAt(t),N;if(A===95&&o!=="bail"){let J=n.charCodeAt(t-1),H=n.charCodeAt(t+1);if(o){if(Number.isNaN(H)||!u(H)||h.has(J)||h.has(H)){if(c)return{n:null,pos:t};l.unexpectedNumericSeparator(t,e,i)}}else{if(c)return{n:null,pos:t};l.numericSeparatorInEscapeSequence(t,e,i)}++t;continue}if(A>=97?N=A-97+10:A>=65?N=A-65+10:ac(A)?N=A-48:N=1/0,N>=s){if(N<=9&&c)return{n:null,pos:t};if(N<=9&&l.invalidDigit(t,e,i,s))N=0;else if(r)N=0,f=!0;else break}++t,m=m*s+N}return t===p||a!=null&&t-p!==a||f?{n:null,pos:t}:{n:m,pos:t}}function gr(n,t,e,i,s,a){let r=n.charCodeAt(t),o;if(r===123){if(++t,{code:o,pos:t}=xi(n,t,e,i,n.indexOf("}",t)-t,!0,s,a),++t,o!==null&&o>1114111)if(s)a.invalidCodePoint(t,e,i);else return{code:null,pos:t}}else({code:o,pos:t}=xi(n,t,e,i,4,!1,s,a));return{code:o,pos:t}}var oc=["at"],lc=["at"];function He(n,t,e){return new V(e,n-t,n)}var cc=new Set([103,109,115,105,121,117,100,118]),K=class{constructor(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,this.loc=new Ie(t.startLoc,t.endLoc)}},gi=class extends mi{constructor(t,e){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(i,s,a,r)=>this.options.errorRecovery?(this.raise(d.InvalidDigit,{at:He(i,s,a),radix:r}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(d.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(d.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(d.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(d.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(i,s,a)=>{this.recordStrictModeErrors(d.StrictNumericEscape,{at:He(i,s,a)})},unterminated:(i,s,a)=>{throw this.raise(d.UnterminatedString,{at:He(i-1,s,a)})}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(d.StrictNumericEscape),unterminated:(i,s,a)=>{throw this.raise(d.UnterminatedTemplate,{at:He(i,s,a)})}}),this.state=new Qe,this.state.init(t),this.input=e,this.length=e.length,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 K(this.state)),this.state.lastTokStart=this.state.start,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 ii.lastIndex=t,ii.test(this.input)?ii.lastIndex:t}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(t){return Tt.lastIndex=t,Tt.test(this.input)?Tt.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 i=this.input.charCodeAt(t);(i&64512)===56320&&(e=65536+((e&1023)<<10)+(i&1023))}return e}setStrict(t){this.state.strict=t,t&&(this.state.strictErrors.forEach(([e,i])=>this.raise(e,{at:i})),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(137);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(t){let e;this.isLookahead||(e=this.state.curPosition());let i=this.state.pos,s=this.input.indexOf(t,i+2);if(s===-1)throw this.raise(d.UnterminatedComment,{at:this.state.curPosition()});for(this.state.pos=s+t.length,vt.lastIndex=i+2;vt.test(this.input)&&vt.lastIndex<=s;)++this.state.curLine,this.state.lineStart=vt.lastIndex;if(this.isLookahead)return;let a={type:"CommentBlock",value:this.input.slice(i+2,s),start:i,end:s+t.length,loc:new Ie(e,this.state.curPosition())};return this.options.tokens&&this.pushToken(a),a}skipLineComment(t){let e=this.state.pos,i;this.isLookahead||(i=this.state.curPosition());let s=this.input.charCodeAt(this.state.pos+=t);if(this.state.pos<this.length)for(;!We(s)&&++this.state.pos<this.length;)s=this.input.charCodeAt(this.state.pos);if(this.isLookahead)return;let a=this.state.pos,o={type:"CommentLine",value:this.input.slice(e+t,a),start:e,end:a,loc:new Ie(i,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 i=this.input.charCodeAt(this.state.pos);switch(i){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 s=this.skipBlockComment("*/");s!==void 0&&(this.addComment(s),this.options.attachComment&&e.push(s));break}case 47:{let s=this.skipLineComment(2);s!==void 0&&(this.addComment(s),this.options.attachComment&&e.push(s));break}default:break e}break;default:if(sc(i))++this.state.pos;else if(i===45&&!this.inModule&&this.options.annexB){let s=this.state.pos;if(this.input.charCodeAt(s+1)===45&&this.input.charCodeAt(s+2)===62&&(t===0||this.state.lineStart>t)){let a=this.skipLineComment(3);a!==void 0&&(this.addComment(a),this.options.attachComment&&e.push(a))}else break e}else if(i===60&&!this.inModule&&this.options.annexB){let s=this.state.pos;if(this.input.charCodeAt(s+1)===33&&this.input.charCodeAt(s+2)===45&&this.input.charCodeAt(s+3)===45){let a=this.skipLineComment(4);a!==void 0&&(this.addComment(a),this.options.attachComment&&e.push(a))}else break e}else break e}}if(e.length>0){let i=this.state.pos,s={start:t,end:i,comments:e,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(s)}}finishToken(t,e){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let i=this.state.type;this.state.type=t,this.state.value=e,this.isLookahead||this.updateContext(i)}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(d.UnexpectedDigitAfterHash,{at:this.state.curPosition()});if(e===123||e===91&&this.hasPlugin("recordAndTuple")){if(this.expectPlugin("recordAndTuple"),this.getPluginOption("recordAndTuple","syntaxType")==="bar")throw this.raise(e===123?d.RecordExpressionHashIncorrectStartSyntaxType:d.TupleExpressionHashIncorrectStartSyntaxType,{at:this.state.curPosition()});this.state.pos+=2,e===123?this.finishToken(7):this.finishToken(1)}else Z(e)?(++this.state.pos,this.finishToken(136,this.readWord1(e))):e===92?(++this.state.pos,this.finishToken(136,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;!We(t)&&++this.state.pos<this.length;)t=this.input.charCodeAt(this.state.pos);let i=this.input.slice(e+2,this.state.pos);return this.finishToken(28,i),!0}readToken_mult_modulo(t){let e=t===42?55:54,i=1,s=this.input.charCodeAt(this.state.pos+1);t===42&&s===42&&(i++,s=this.input.charCodeAt(this.state.pos+2),e=57),s===61&&!this.state.inType&&(i++,e=t===37?33:30),this.finishOp(e,i)}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(d.RecordExpressionBarIncorrectEndSyntaxType,{at:this.state.curPosition()});this.state.pos+=2,this.finishToken(9);return}if(this.hasPlugin("recordAndTuple")&&e===93){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(d.TupleExpressionBarIncorrectEndSyntaxType,{at: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 i=this.input.charCodeAt(t+2)===62?3:2;if(this.input.charCodeAt(t+i)===61){this.finishOp(30,i+1);return}this.finishOp(52,i);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(d.TupleExpressionBarIncorrectStartSyntaxType,{at:this.state.curPosition()});this.state.pos+=2,this.finishToken(2)}else++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(3);return;case 123:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(d.RecordExpressionBarIncorrectStartSyntaxType,{at:this.state.curPosition()});this.state.pos+=2,this.finishToken(6)}else++this.state.pos,this.finishToken(5);return;case 125:++this.state.pos,this.finishToken(8);return;case 58:this.hasPlugin("functionBind")&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(15,2):(++this.state.pos,this.finishToken(14));return;case 63:this.readToken_question();return;case 96:this.readTemplateToken();return;case 48:{let e=this.input.charCodeAt(this.state.pos+1);if(e===120||e===88){this.readRadixNumber(16);return}if(e===111||e===79){this.readRadixNumber(8);return}if(e===98||e===66){this.readRadixNumber(2);return}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:this.readNumber(!1);return;case 34:case 39:this.readString(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(Z(t)){this.readWord(t);return}}throw this.raise(d.InvalidOrUnexpectedToken,{at:this.state.curPosition(),unexpected:String.fromCodePoint(t)})}finishOp(t,e){let i=this.input.slice(this.state.pos,this.state.pos+e);this.state.pos+=e,this.finishToken(t,i)}readRegexp(){let t=this.state.startLoc,e=this.state.start+1,i,s,{pos:a}=this.state;for(;;++a){if(a>=this.length)throw this.raise(d.UnterminatedRegExp,{at:B(t,1)});let c=this.input.charCodeAt(a);if(We(c))throw this.raise(d.UnterminatedRegExp,{at:B(t,1)});if(i)i=!1;else{if(c===91)s=!0;else if(c===93&&s)s=!1;else if(c===47&&!s)break;i=c===92}}let r=this.input.slice(e,a);++a;let o="",l=()=>B(t,a+2-e);for(;a<this.length;){let c=this.codePointAtPos(a),p=String.fromCharCode(c);if(cc.has(c))c===118?o.includes("u")&&this.raise(d.IncompatibleRegExpUVFlags,{at:l()}):c===117&&o.includes("v")&&this.raise(d.IncompatibleRegExpUVFlags,{at:l()}),o.includes(p)&&this.raise(d.DuplicateRegExpFlags,{at:l()});else if(Ae(c)||c===92)this.raise(d.MalformedRegExpFlags,{at:l()});else break;++a,o+=p}this.state.pos=a,this.finishToken(135,{pattern:r,flags:o})}readInt(t,e,i=!1,s=!0){let{n:a,pos:r}=xr(this.input,this.state.pos,this.state.lineStart,this.state.curLine,t,e,i,s,this.errorHandlers_readInt,!1);return this.state.pos=r,a}readRadixNumber(t){let e=this.state.curPosition(),i=!1;this.state.pos+=2;let s=this.readInt(t);s==null&&this.raise(d.InvalidDigit,{at:B(e,2),radix:t});let a=this.input.charCodeAt(this.state.pos);if(a===110)++this.state.pos,i=!0;else if(a===109)throw this.raise(d.InvalidDecimal,{at:e});if(Z(this.codePointAtPos(this.state.pos)))throw this.raise(d.NumberIdentifier,{at:this.state.curPosition()});if(i){let r=this.input.slice(e.index,this.state.pos).replace(/[_n]/g,"");this.finishToken(133,r);return}this.finishToken(132,s)}readNumber(t){let e=this.state.pos,i=this.state.curPosition(),s=!1,a=!1,r=!1,o=!1,l=!1;!t&&this.readInt(10)===null&&this.raise(d.InvalidNumber,{at:this.state.curPosition()});let c=this.state.pos-e>=2&&this.input.charCodeAt(e)===48;if(c){let f=this.input.slice(e,this.state.pos);if(this.recordStrictModeErrors(d.StrictOctalLiteral,{at:i}),!this.state.strict){let m=f.indexOf("_");m>0&&this.raise(d.ZeroDigitNumericSeparator,{at:B(i,m)})}l=c&&!/[89]/.test(f)}let p=this.input.charCodeAt(this.state.pos);if(p===46&&!l&&(++this.state.pos,this.readInt(10),s=!0,p=this.input.charCodeAt(this.state.pos)),(p===69||p===101)&&!l&&(p=this.input.charCodeAt(++this.state.pos),(p===43||p===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(d.InvalidOrMissingExponent,{at:i}),s=!0,o=!0,p=this.input.charCodeAt(this.state.pos)),p===110&&((s||c)&&this.raise(d.InvalidBigIntLiteral,{at:i}),++this.state.pos,a=!0),p===109&&(this.expectPlugin("decimal",this.state.curPosition()),(o||c)&&this.raise(d.InvalidDecimal,{at:i}),++this.state.pos,r=!0),Z(this.codePointAtPos(this.state.pos)))throw this.raise(d.NumberIdentifier,{at:this.state.curPosition()});let h=this.input.slice(e,this.state.pos).replace(/[_mn]/g,"");if(a){this.finishToken(133,h);return}if(r){this.finishToken(134,h);return}let u=l?parseInt(h,8):parseFloat(h);this.finishToken(132,u)}readCodePoint(t){let{code:e,pos:i}=gr(this.input,this.state.pos,this.state.lineStart,this.state.curLine,t,this.errorHandlers_readCodePoint);return this.state.pos=i,e}readString(t){let{str:e,pos:i,curLine:s,lineStart:a}=$a(t===34?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=i+1,this.state.lineStart=a,this.state.curLine=s,this.finishToken(131,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:i,pos:s,curLine:a,lineStart:r}=$a("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=s+1,this.state.lineStart=r,this.state.curLine=a,i&&(this.state.firstInvalidTemplateEscapePos=new V(i.curLine,i.pos-i.lineStart,i.pos)),this.input.codePointAt(s)===96?this.finishToken(24,i?null:t+e+"`"):(this.state.pos++,this.finishToken(25,i?null:t+e+"${"))}recordStrictModeErrors(t,{at:e}){let i=e.index;this.state.strict&&!this.state.strictErrors.has(i)?this.raise(t,{at:e}):this.state.strictErrors.set(i,[t,e])}readWord1(t){this.state.containsEsc=!1;let e="",i=this.state.pos,s=this.state.pos;for(t!==void 0&&(this.state.pos+=t<=65535?1:2);this.state.pos<this.length;){let a=this.codePointAtPos(this.state.pos);if(Ae(a))this.state.pos+=a<=65535?1:2;else if(a===92){this.state.containsEsc=!0,e+=this.input.slice(s,this.state.pos);let r=this.state.curPosition(),o=this.state.pos===i?Z:Ae;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(d.MissingUnicodeEscape,{at:this.state.curPosition()}),s=this.state.pos-1;continue}++this.state.pos;let l=this.readCodePoint(!0);l!==null&&(o(l)||this.raise(d.EscapedCharNotAnIdentifier,{at:r}),e+=String.fromCodePoint(l)),s=this.state.pos}else break}return e+this.input.slice(s,this.state.pos)}readWord(t){let e=this.readWord1(t),i=Ii.get(e);i!==void 0?this.finishToken(i,oe(i)):this.finishToken(130,e)}checkKeywordEscapes(){let{type:t}=this.state;Di(t)&&this.state.containsEsc&&this.raise(d.InvalidEscapedReservedWord,{at:this.state.startLoc,reservedWord:oe(t)})}raise(t,e){let{at:i}=e,s=Et(e,oc),a=i instanceof V?i:i.loc.start,r=t({loc:a,details:s});if(!this.options.errorRecovery)throw r;return this.isLookahead||this.state.errors.push(r),r}raiseOverwrite(t,e){let{at:i}=e,s=Et(e,lc),a=i instanceof V?i:i.loc.start,r=a.index,o=this.state.errors;for(let l=o.length-1;l>=0;l--){let c=o[l];if(c.loc.index===r)return o[l]=t({loc:a,details:s});if(c.loc.index<r)break}return this.raise(t,e)}updateContext(t){}unexpected(t,e){throw this.raise(d.UnexpectedToken,{expected:e?oe(e):null,at:t??this.state.startLoc})}expectPlugin(t,e){if(this.hasPlugin(t))return!0;throw this.raise(d.MissingPlugin,{at:e??this.state.startLoc,missingPlugin:[t]})}expectOnePlugin(t){if(!t.some(e=>this.hasPlugin(e)))throw this.raise(d.MissingOneOfPlugins,{at:this.state.startLoc,missingPlugin:t})}errorBuilder(t){return(e,i,s)=>{this.raise(t,{at:He(e,i,s)})}}},yi=class{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}},vi=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 yi)}exit(){let t=this.stack.pop(),e=this.current();for(let[i,s]of Array.from(t.undefinedPrivateNames))e?e.undefinedPrivateNames.has(i)||e.undefinedPrivateNames.set(i,s):this.parser.raise(d.InvalidPrivateFieldResolution,{at:s,identifierName:i})}declarePrivateName(t,e,i){let{privateNames:s,loneAccessors:a,undefinedPrivateNames:r}=this.current(),o=s.has(t);if(e&ei){let l=o&&a.get(t);if(l){let c=l&Lt,p=e&Lt,h=l&ei,u=e&ei;o=h===u||c!==p,o||a.delete(t)}else o||a.set(t,e)}o&&this.parser.raise(d.PrivateNameRedeclaration,{at:i,identifierName:t}),s.add(t),r.delete(t)}usePrivateName(t,e){let i;for(i of this.stack)if(i.privateNames.has(t))return;i?i.undefinedPrivateNames.set(t,e):this.parser.raise(d.InvalidPrivateFieldResolution,{at:e,identifierName:t})}},pc=0,yr=1,zi=2,vr=3,Ne=class{constructor(t=pc){this.type=void 0,this.type=t}canBeArrowParameterDeclaration(){return this.type===zi||this.type===yr}isCertainlyParameterDeclaration(){return this.type===vr}},Mt=class extends Ne{constructor(t){super(t),this.declarationErrors=new Map}recordDeclarationError(t,{at:e}){let i=e.index;this.declarationErrors.set(i,[t,e])}clearDeclarationError(t){this.declarationErrors.delete(t)}iterateErrors(t){this.declarationErrors.forEach(t)}},bi=class{constructor(t){this.parser=void 0,this.stack=[new Ne],this.parser=t}enter(t){this.stack.push(t)}exit(){this.stack.pop()}recordParameterInitializerError(t,{at:e}){let i={at:e.loc.start},{stack:s}=this,a=s.length-1,r=s[a];for(;!r.isCertainlyParameterDeclaration();){if(r.canBeArrowParameterDeclaration())r.recordDeclarationError(t,i);else return;r=s[--a]}this.parser.raise(t,i)}recordArrowParameterBindingError(t,{at:e}){let{stack:i}=this,s=i[i.length-1],a={at:e.loc.start};if(s.isCertainlyParameterDeclaration())this.parser.raise(t,a);else if(s.canBeArrowParameterDeclaration())s.recordDeclarationError(t,a);else return}recordAsyncArrowParametersError({at:t}){let{stack:e}=this,i=e.length-1,s=e[i];for(;s.canBeArrowParameterDeclaration();)s.type===zi&&s.recordDeclarationError(d.AwaitBindingIdentifier,{at:t}),s=e[--i]}validateAsPattern(){let{stack:t}=this,e=t[t.length-1];e.canBeArrowParameterDeclaration()&&e.iterateErrors(([i,s])=>{this.parser.raise(i,{at:s});let a=t.length-2,r=t[a];for(;r.canBeArrowParameterDeclaration();)r.clearDeclarationError(s.index),r=t[--a]})}};function hc(){return new Ne(vr)}function uc(){return new Mt(yr)}function dc(){return new Mt(zi)}function br(){return new Ne}var Ce=0,wr=1,Bt=2,Pr=4,be=8,wi=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()&Bt)>0}get hasYield(){return(this.currentFlags()&wr)>0}get hasReturn(){return(this.currentFlags()&Pr)>0}get hasIn(){return(this.currentFlags()&be)>0}};function At(n,t){return(n?Bt:0)|(t?wr:0)}var Pi=class extends gi{addExtra(t,e,i,s=!0){if(!t)return;let a=t.extra=t.extra||{};s?a[e]=i:Object.defineProperty(a,e,{enumerable:s,value:i})}isContextual(t){return this.state.type===t&&!this.state.containsEsc}isUnparsedContextual(t,e){let i=t+e.length;if(this.input.slice(t,i)===e){let s=this.input.charCodeAt(i);return!(Ae(s)||(s&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,{at:this.state.startLoc});this.unexpected(null,t)}}canInsertSemicolon(){return this.match(137)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return mr.test(this.input.slice(this.state.lastTokEndLoc.index,this.state.start))}hasFollowingLineBreak(){return za.lastIndex=this.state.end,za.test(this.input)}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(t=!0){(t?this.isLineTerminator():this.eat(13))||this.raise(d.MissingSemicolon,{at:this.state.lastTokEndLoc})}expect(t,e){this.eat(t)||this.unexpected(e,t)}tryParse(t,e=this.state.clone()){let i={node:null};try{let s=t((a=null)=>{throw i.node=a,i});if(this.state.errors.length>e.errors.length){let a=this.state;return this.state=e,this.state.tokensLength=a.tokensLength,{node:s,error:a.errors[e.errors.length],thrown:!1,aborted:!1,failState:a}}return{node:s,error:null,thrown:!1,aborted:!1,failState:null}}catch(s){let a=this.state;if(this.state=e,s instanceof SyntaxError)return{node:null,error:s,thrown:!0,aborted:!1,failState:a};if(s===i)return{node:i.node,error:null,thrown:!1,aborted:!0,failState:a};throw s}}checkExpressionErrors(t,e){if(!t)return!1;let{shorthandAssignLoc:i,doubleProtoLoc:s,privateKeyLoc:a,optionalParametersLoc:r}=t,o=!!i||!!s||!!r||!!a;if(!e)return o;i!=null&&this.raise(d.InvalidCoverInitializedName,{at:i}),s!=null&&this.raise(d.DuplicateProto,{at:s}),a!=null&&this.raise(d.UnexpectedPrivateField,{at:a}),r!=null&&this.unexpected(r)}isLiteralPropertyName(){return er(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 i=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let s=this.inModule;this.inModule=t;let a=this.scope,r=this.getScopeHandler();this.scope=new r(this,t);let o=this.prodParam;this.prodParam=new wi;let l=this.classScope;this.classScope=new vi(this);let c=this.expressionScope;return this.expressionScope=new bi(this),()=>{this.state.labels=e,this.exportedIdentifiers=i,this.inModule=s,this.scope=a,this.prodParam=o,this.classScope=l,this.expressionScope=c}}enterInitialScopes(){let t=Ce;this.inModule&&(t|=Bt),this.scope.enter(Pe),this.prodParam.enter(t)}checkDestructuringPrivate(t){let{privateKeyLoc:e}=t;e!==null&&this.expectPlugin("destructuringPrivate",e)}},ke=class{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null}},_e=class{constructor(t,e,i){this.type="",this.start=e,this.end=0,this.loc=new Ie(i),t!=null&&t.options.ranges&&(this.range=[e,0]),t!=null&&t.filename&&(this.loc.filename=t.filename)}},Hi=_e.prototype;Hi.__clone=function(){let n=new _e(void 0,this.start,this.loc.start),t=Object.keys(this);for(let e=0,i=t.length;e<i;e++){let s=t[e];s!=="leadingComments"&&s!=="trailingComments"&&s!=="innerComments"&&(n[s]=this[s])}return n};function fc(n){return ie(n)}function ie(n){let{type:t,start:e,end:i,loc:s,range:a,extra:r,name:o}=n,l=Object.create(Hi);return l.type=t,l.start=e,l.end=i,l.loc=s,l.range=a,l.extra=r,l.name=o,t==="Placeholder"&&(l.expectedNode=n.expectedNode),l}function mc(n){let{type:t,start:e,end:i,loc:s,range:a,extra:r}=n;if(t==="Placeholder")return fc(n);let o=Object.create(Hi);return o.type=t,o.start=e,o.end=i,o.loc=s,o.range=a,n.raw!==void 0?o.raw=n.raw:o.extra=r,o.value=n.value,o}var Ti=class extends Pi{startNode(){return new _e(this,this.state.start,this.state.startLoc)}startNodeAt(t){return new _e(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,i){return t.type=e,t.end=i.index,t.loc.end=i,this.options.ranges&&(t.range[1]=i.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)}},xc=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),P=ee`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:n})=>`Cannot overwrite reserved type ${n}.`,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:n,enumName:t})=>`Boolean enum members need to be initialized. Use either \`${n} = true,\` or \`${n} = false,\` in enum \`${t}\`.`,EnumDuplicateMemberName:({memberName:n,enumName:t})=>`Enum member names need to be unique, but the name \`${n}\` has already been used before in enum \`${t}\`.`,EnumInconsistentMemberValues:({enumName:n})=>`Enum \`${n}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:n,enumName:t})=>`Enum type \`${n}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:n})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${n}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:n,memberName:t,explicitType:e})=>`Enum \`${n}\` has type \`${e}\`, so the initializer of \`${t}\` needs to be a ${e} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:n,memberName:t})=>`Symbol enum members cannot be initialized. Use \`${t},\` in enum \`${n}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:n,memberName:t})=>`The enum member initializer for \`${t}\` needs to be a literal (either a boolean, number, or string) in enum \`${n}\`.`,EnumInvalidMemberName:({enumName:n,memberName:t,suggestion:e})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${t}\`, consider using \`${e}\`, in enum \`${n}\`.`,EnumNumberMemberNotInitialized:({enumName:n,memberName:t})=>`Number enum members need to be initialized, e.g. \`${t} = 1\` in enum \`${n}\`.`,EnumStringMemberInconsistentlyInitailized:({enumName:n})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${n}\`.`,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:n})=>`Unexpected reserved type ${n}.`,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:n,suggestion:t})=>`\`declare export ${n}\` is not supported. Use \`${t}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function gc(n){return n.type==="DeclareExportAllDeclaration"||n.type==="DeclareExportDeclaration"&&(!n.declaration||n.declaration.type!=="TypeAlias"&&n.declaration.type!=="InterfaceDeclaration")}function Ka(n){return n.importKind==="type"||n.importKind==="typeof"}var yc={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function vc(n,t){let e=[],i=[];for(let s=0;s<n.length;s++)(t(n[s],s,n)?e:i).push(n[s]);return[e,i]}var bc=/\*?\s*@((?:no)?flow)\b/,wc=n=>class extends n{constructor(...e){super(...e),this.flowPragma=void 0}getScopeHandler(){return di}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}shouldParseEnums(){return!!this.getPluginOption("flow","enums")}finishToken(e,i){e!==131&&e!==13&&e!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,i)}addComment(e){if(this.flowPragma===void 0){let i=bc.exec(e.value);if(i)if(i[1]==="flow")this.flowPragma="flow";else if(i[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(e)}flowParseTypeInitialiser(e){let i=this.state.inType;this.state.inType=!0,this.expect(e||14);let s=this.flowParseType();return this.state.inType=i,s}flowParsePredicate(){let e=this.startNode(),i=this.state.startLoc;return this.next(),this.expectContextual(108),this.state.lastTokStart>i.index+1&&this.raise(P.UnexpectedSpaceBetweenModuloChecks,{at:i}),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 i=null,s=null;return this.match(54)?(this.state.inType=e,s=this.flowParsePredicate()):(i=this.flowParseType(),this.state.inType=e,this.match(54)&&(s=this.flowParsePredicate())),[i,s]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")}flowParseDeclareFunction(e){this.next();let i=e.id=this.parseIdentifier(),s=this.startNode(),a=this.startNode();this.match(47)?s.typeParameters=this.flowParseTypeParameterDeclaration():s.typeParameters=null,this.expect(10);let r=this.flowParseFunctionTypeParams();return s.params=r.params,s.rest=r.rest,s.this=r._this,this.expect(11),[s.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),a.typeAnnotation=this.finishNode(s,"FunctionTypeAnnotation"),i.typeAnnotation=this.finishNode(a,"TypeAnnotation"),this.resetEndLocation(i),this.semicolon(),this.scope.declareName(e.id.name,Ql,e.id.loc.start),this.finishNode(e,"DeclareFunction")}flowParseDeclare(e,i){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(125))return this.match(16)?this.flowParseDeclareModuleExports(e):(i&&this.raise(P.NestedDeclareModule,{at:this.state.lastTokStartLoc}),this.flowParseDeclareModule(e));if(this.isContextual(128))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(129))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(127))return this.flowParseDeclareInterface(e);if(this.match(82))return this.flowParseDeclareExportDeclaration(e,i);this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(!0),this.scope.declareName(e.id.name,_t,e.id.loc.start),this.semicolon(),this.finishNode(e,"DeclareVariable")}flowParseDeclareModule(e){this.scope.enter(we),this.match(131)?e.id=super.parseExprAtom():e.id=this.parseIdentifier();let i=e.body=this.startNode(),s=i.body=[];for(this.expect(5);!this.match(8);){let o=this.startNode();this.match(83)?(this.next(),!this.isContextual(128)&&!this.match(87)&&this.raise(P.InvalidNonTypeImportInDeclareModule,{at:this.state.lastTokStartLoc}),super.parseImport(o)):(this.expectContextual(123,P.UnsupportedStatementInDeclareModule),o=this.flowParseDeclare(o,!0)),s.push(o)}this.scope.exit(),this.expect(8),this.finishNode(i,"BlockStatement");let a=null,r=!1;return s.forEach(o=>{gc(o)?(a==="CommonJS"&&this.raise(P.AmbiguousDeclareModuleKind,{at:o}),a="ES"):o.type==="DeclareModuleExports"&&(r&&this.raise(P.DuplicateDeclareModuleExports,{at:o}),a==="ES"&&this.raise(P.AmbiguousDeclareModuleKind,{at:o}),a="CommonJS",r=!0)}),e.kind=a||"CommonJS",this.finishNode(e,"DeclareModule")}flowParseDeclareExportDeclaration(e,i){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(128)||this.isContextual(127))&&!i){let s=this.state.value;throw this.raise(P.UnsupportedDeclareExportKind,{at:this.state.startLoc,unsupportedExportKind:s,suggestion:yc[s]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(129))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration");if(this.match(55)||this.match(5)||this.isContextual(127)||this.isContextual(128)||this.isContextual(129))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(109),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")}flowParseDeclareTypeAlias(e){this.next();let i=this.flowParseTypeAlias(e);return i.type="DeclareTypeAlias",i}flowParseDeclareOpaqueType(e){this.next();let i=this.flowParseOpaqueType(e,!0);return i.type="DeclareOpaqueType",i}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,"DeclareInterface")}flowParseInterfaceish(e,i){if(e.id=this.flowParseRestrictedIdentifier(!i,!0),this.scope.declareName(e.id.name,i?ur:Se,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(!i&&this.eat(12));if(i){if(e.implements=[],e.mixins=[],this.eatContextual(115))do e.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(111))do e.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}e.body=this.flowParseObjectType({allowStatic:i,allowExact:!1,allowSpread:!1,allowProto:i,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(P.UnexpectedReservedUnderscore,{at:this.state.startLoc})}checkReservedType(e,i,s){xc.has(e)&&this.raise(s?P.AssignReservedType:P.UnexpectedReservedType,{at:i,reservedType:e})}flowParseRestrictedIdentifier(e,i){return this.checkReservedType(this.state.value,this.state.startLoc,i),this.parseIdentifier(e)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,Se,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,i){return this.expectContextual(128),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,Se,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,i||(e.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(e,"OpaqueType")}flowParseTypeParameter(e=!1){let i=this.state.startLoc,s=this.startNode(),a=this.flowParseVariance(),r=this.flowParseTypeAnnotatableIdentifier();return s.name=r.name,s.variance=a,s.bound=r.typeAnnotation,this.match(29)?(this.eat(29),s.default=this.flowParseType()):e&&this.raise(P.MissingTypeParamDefault,{at:i}),this.finishNode(s,"TypeParameter")}flowParseTypeParameterDeclaration(){let e=this.state.inType,i=this.startNode();i.params=[],this.state.inType=!0,this.match(47)||this.match(140)?this.next():this.unexpected();let s=!1;do{let a=this.flowParseTypeParameter(s);i.params.push(a),a.default&&(s=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=e,this.finishNode(i,"TypeParameterDeclaration")}flowParseTypeParameterInstantiation(){let e=this.startNode(),i=this.state.inType;e.params=[],this.state.inType=!0,this.expect(47);let s=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=s,this.expect(48),this.state.inType=i,this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){let e=this.startNode(),i=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=i,this.finishNode(e,"TypeParameterInstantiation")}flowParseInterfaceType(){let e=this.startNode();if(this.expectContextual(127),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(132)||this.match(131)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,i,s){return e.static=i,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=s,this.finishNode(e,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(e,i){return e.static=i,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,i){let s=this.startNode();return e.static=i,e.value=this.flowParseObjectTypeMethodish(s),this.finishNode(e,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:e,allowExact:i,allowSpread:s,allowProto:a,allowInexact:r}){let o=this.state.inType;this.state.inType=!0;let l=this.startNode();l.callProperties=[],l.properties=[],l.indexers=[],l.internalSlots=[];let c,p,h=!1;for(i&&this.match(6)?(this.expect(6),c=9,p=!0):(this.expect(5),c=8,p=!1),l.exact=p;!this.match(c);){let f=!1,m=null,x=null,b=this.startNode();if(a&&this.isContextual(116)){let N=this.lookahead();N.type!==14&&N.type!==17&&(this.next(),m=this.state.startLoc,e=!1)}if(e&&this.isContextual(104)){let N=this.lookahead();N.type!==14&&N.type!==17&&(this.next(),f=!0)}let A=this.flowParseVariance();if(this.eat(0))m!=null&&this.unexpected(m),this.eat(0)?(A&&this.unexpected(A.loc.start),l.internalSlots.push(this.flowParseObjectTypeInternalSlot(b,f))):l.indexers.push(this.flowParseObjectTypeIndexer(b,f,A));else if(this.match(10)||this.match(47))m!=null&&this.unexpected(m),A&&this.unexpected(A.loc.start),l.callProperties.push(this.flowParseObjectTypeCallProperty(b,f));else{let N="init";if(this.isContextual(98)||this.isContextual(103)){let H=this.lookahead();er(H.type)&&(N=this.state.value,this.next())}let J=this.flowParseObjectTypeProperty(b,f,m,A,N,s,r??!p);J===null?(h=!0,x=this.state.lastTokStartLoc):l.properties.push(J)}this.flowObjectTypeSemicolon(),x&&!this.match(8)&&!this.match(9)&&this.raise(P.UnexpectedExplicitInexactInObject,{at:x})}this.expect(c),s&&(l.inexact=h);let u=this.finishNode(l,"ObjectTypeAnnotation");return this.state.inType=o,u}flowParseObjectTypeProperty(e,i,s,a,r,o,l){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(o?l||this.raise(P.InexactInsideExact,{at:this.state.lastTokStartLoc}):this.raise(P.InexactInsideNonObject,{at:this.state.lastTokStartLoc}),a&&this.raise(P.InexactVariance,{at:a}),null):(o||this.raise(P.UnexpectedSpreadType,{at:this.state.lastTokStartLoc}),s!=null&&this.unexpected(s),a&&this.raise(P.SpreadVariance,{at:a}),e.argument=this.flowParseType(),this.finishNode(e,"ObjectTypeSpreadProperty"));{e.key=this.flowParseObjectPropertyKey(),e.static=i,e.proto=s!=null,e.kind=r;let c=!1;return this.match(47)||this.match(10)?(e.method=!0,s!=null&&this.unexpected(s),a&&this.unexpected(a.loc.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start)),(r==="get"||r==="set")&&this.flowCheckGetterSetterParams(e),!o&&e.key.name==="constructor"&&e.value.this&&this.raise(P.ThisParamBannedInConstructor,{at:e.value.this})):(r!=="init"&&this.unexpected(),e.method=!1,this.eat(17)&&(c=!0),e.value=this.flowParseTypeInitialiser(),e.variance=a),e.optional=c,this.finishNode(e,"ObjectTypeProperty")}}flowCheckGetterSetterParams(e){let i=e.kind==="get"?0:1,s=e.value.params.length+(e.value.rest?1:0);e.value.this&&this.raise(e.kind==="get"?P.GetterMayNotHaveThisParam:P.SetterMayNotHaveThisParam,{at:e.value.this}),s!==i&&this.raise(e.kind==="get"?d.BadGetterArity:d.BadSetterArity,{at:e}),e.kind==="set"&&e.value.rest&&this.raise(d.BadSetterRestParameter,{at:e})}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,i){var s;(s=e)!=null||(e=this.state.startLoc);let a=i||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){let r=this.startNodeAt(e);r.qualification=a,r.id=this.flowParseRestrictedIdentifier(!0),a=this.finishNode(r,"QualifiedTypeIdentifier")}return a}flowParseGenericType(e,i){let s=this.startNodeAt(e);return s.typeParameters=null,s.id=this.flowParseQualifiedTypeIdentifier(e,i),this.match(47)&&(s.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(s,"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 i=null,s=!1,a=null,r=this.startNode(),o=this.lookahead(),l=this.state.type===78;return o.type===14||o.type===17?(l&&!e&&this.raise(P.ThisParamMustBeFirst,{at:r}),i=this.parseIdentifier(l),this.eat(17)&&(s=!0,l&&this.raise(P.ThisParamMayNotBeOptional,{at:r})),a=this.flowParseTypeInitialiser()):a=this.flowParseType(),r.name=i,r.optional=s,r.typeAnnotation=a,this.finishNode(r,"FunctionTypeParam")}reinterpretTypeAsFunctionTypeParam(e){let i=this.startNodeAt(e.loc.start);return i.name=null,i.optional=!1,i.typeAnnotation=e,this.finishNode(i,"FunctionTypeParam")}flowParseFunctionTypeParams(e=[]){let i=null,s=null;for(this.match(78)&&(s=this.flowParseFunctionTypeParam(!0),s.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)&&(i=this.flowParseFunctionTypeParam(!1)),{params:e,rest:i,_this:s}}flowIdentToTypeAnnotation(e,i,s){switch(s.name){case"any":return this.finishNode(i,"AnyTypeAnnotation");case"bool":case"boolean":return this.finishNode(i,"BooleanTypeAnnotation");case"mixed":return this.finishNode(i,"MixedTypeAnnotation");case"empty":return this.finishNode(i,"EmptyTypeAnnotation");case"number":return this.finishNode(i,"NumberTypeAnnotation");case"string":return this.finishNode(i,"StringTypeAnnotation");case"symbol":return this.finishNode(i,"SymbolTypeAnnotation");default:return this.checkNotUnderscore(s.name),this.flowParseGenericType(e,s)}}flowParsePrimaryType(){let e=this.state.startLoc,i=this.startNode(),s,a,r=!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,a=this.flowParseTupleType(),this.state.noAnonFunctionType=o,a;case 47:return i.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(10),s=this.flowParseFunctionTypeParams(),i.params=s.params,i.rest=s.rest,i.this=s._this,this.expect(11),this.expect(19),i.returnType=this.flowParseType(),this.finishNode(i,"FunctionTypeAnnotation");case 10:if(this.next(),!this.match(11)&&!this.match(21))if(k(this.state.type)||this.match(78)){let l=this.lookahead().type;r=l!==17&&l!==14}else r=!0;if(r){if(this.state.noAnonFunctionType=!1,a=this.flowParseType(),this.state.noAnonFunctionType=o,this.state.noAnonFunctionType||!(this.match(12)||this.match(11)&&this.lookahead().type===19))return this.expect(11),a;this.eat(12)}return a?s=this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(a)]):s=this.flowParseFunctionTypeParams(),i.params=s.params,i.rest=s.rest,i.this=s._this,this.expect(11),this.expect(19),i.returnType=this.flowParseType(),i.typeParameters=null,this.finishNode(i,"FunctionTypeAnnotation");case 131:return this.parseLiteral(this.state.value,"StringLiteralTypeAnnotation");case 85:case 86:return i.value=this.match(85),this.next(),this.finishNode(i,"BooleanLiteralTypeAnnotation");case 53:if(this.state.value==="-"){if(this.next(),this.match(132))return this.parseLiteralAtNode(-this.state.value,"NumberLiteralTypeAnnotation",i);if(this.match(133))return this.parseLiteralAtNode(-this.state.value,"BigIntLiteralTypeAnnotation",i);throw this.raise(P.UnexpectedSubtractionOperand,{at:this.state.startLoc})}this.unexpected();return;case 132:return this.parseLiteral(this.state.value,"NumberLiteralTypeAnnotation");case 133:return this.parseLiteral(this.state.value,"BigIntLiteralTypeAnnotation");case 88:return this.next(),this.finishNode(i,"VoidTypeAnnotation");case 84:return this.next(),this.finishNode(i,"NullLiteralTypeAnnotation");case 78:return this.next(),this.finishNode(i,"ThisTypeAnnotation");case 55:return this.next(),this.finishNode(i,"ExistsTypeAnnotation");case 87:return this.flowParseTypeofType();default:if(Di(this.state.type)){let l=oe(this.state.type);return this.next(),super.createIdentifier(i,l)}else if(k(this.state.type))return this.isContextual(127)?this.flowParseInterfaceType():this.flowIdentToTypeAnnotation(e,i,this.parseIdentifier())}this.unexpected()}flowParsePostfixType(){let e=this.state.startLoc,i=this.flowParsePrimaryType(),s=!1;for(;(this.match(0)||this.match(18))&&!this.canInsertSemicolon();){let a=this.startNodeAt(e),r=this.eat(18);s=s||r,this.expect(0),!r&&this.match(3)?(a.elementType=i,this.next(),i=this.finishNode(a,"ArrayTypeAnnotation")):(a.objectType=i,a.indexType=this.flowParseType(),this.expect(3),s?(a.optional=r,i=this.finishNode(a,"OptionalIndexedAccessType")):i=this.finishNode(a,"IndexedAccessType"))}return i}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 i=this.startNodeAt(e.loc.start);return i.params=[this.reinterpretTypeAsFunctionTypeParam(e)],i.rest=null,i.this=null,i.returnType=this.flowParseType(),i.typeParameters=null,this.finishNode(i,"FunctionTypeAnnotation")}return e}flowParseIntersectionType(){let e=this.startNode();this.eat(45);let i=this.flowParseAnonFunctionWithoutParens();for(e.types=[i];this.eat(45);)e.types.push(this.flowParseAnonFunctionWithoutParens());return e.types.length===1?i:this.finishNode(e,"IntersectionTypeAnnotation")}flowParseUnionType(){let e=this.startNode();this.eat(43);let i=this.flowParseIntersectionType();for(e.types=[i];this.eat(43);)e.types.push(this.flowParseIntersectionType());return e.types.length===1?i:this.finishNode(e,"UnionTypeAnnotation")}flowParseType(){let e=this.state.inType;this.state.inType=!0;let i=this.flowParseUnionType();return this.state.inType=e,i}flowParseTypeOrImplicitInstantiation(){if(this.state.type===130&&this.state.value==="_"){let e=this.state.startLoc,i=this.parseIdentifier();return this.flowParseGenericType(e,i)}else return this.flowParseType()}flowParseTypeAnnotation(){let e=this.startNode();return e.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(e,"TypeAnnotation")}flowParseTypeAnnotatableIdentifier(e){let i=e?this.parseIdentifier():this.flowParseRestrictedIdentifier();return this.match(14)&&(i.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(i)),i}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,i,s=!1){if(i){this.forwardNoArrowParamsConversionAt(e,()=>super.parseFunctionBody(e,!0,s));return}super.parseFunctionBody(e,!1,s)}parseFunctionBodyAndFinish(e,i,s=!1){if(this.match(14)){let a=this.startNode();[a.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),e.returnType=a.typeAnnotation?this.finishNode(a,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(e,i,s)}parseStatementLike(e){if(this.state.strict&&this.isContextual(127)){let s=this.lookahead();if(U(s.type)){let a=this.startNode();return this.next(),this.flowParseInterface(a)}}else if(this.shouldParseEnums()&&this.isContextual(124)){let s=this.startNode();return this.next(),this.flowParseEnumDeclaration(s)}let i=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(i)&&(this.flowPragma=null),i}parseExpressionStatement(e,i,s){if(i.type==="Identifier"){if(i.name==="declare"){if(this.match(80)||k(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(e)}else if(k(this.state.type)){if(i.name==="interface")return this.flowParseInterface(e);if(i.name==="type")return this.flowParseTypeAlias(e);if(i.name==="opaque")return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,i,s)}shouldParseExportDeclaration(){let{type:e}=this.state;return Ra(e)||this.shouldParseEnums()&&e===124?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return Ra(e)||this.shouldParseEnums()&&e===124?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.shouldParseEnums()&&this.isContextual(124)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,i,s){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){let u=this.lookaheadCharCode();if(u===44||u===61||u===58||u===41)return this.setOptionalParametersError(s),e}this.expect(17);let a=this.state.clone(),r=this.state.noArrowAt,o=this.startNodeAt(i),{consequent:l,failed:c}=this.tryParseConditionalConsequent(),[p,h]=this.getArrowLikeExpressions(l);if(c||h.length>0){let u=[...r];if(h.length>0){this.state=a,this.state.noArrowAt=u;for(let f=0;f<h.length;f++)u.push(h[f].start);({consequent:l,failed:c}=this.tryParseConditionalConsequent()),[p,h]=this.getArrowLikeExpressions(l)}c&&p.length>1&&this.raise(P.AmbiguousConditionalArrow,{at:a.startLoc}),c&&p.length===1&&(this.state=a,u.push(p[0].start),this.state.noArrowAt=u,{consequent:l,failed:c}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(l,!0),this.state.noArrowAt=r,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(),i=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:i}}getArrowLikeExpressions(e,i){let s=[e],a=[];for(;s.length!==0;){let r=s.pop();r.type==="ArrowFunctionExpression"?(r.typeParameters||!r.returnType?this.finishArrowValidation(r):a.push(r),s.push(r.body)):r.type==="ConditionalExpression"&&(s.push(r.consequent),s.push(r.alternate))}return i?(a.forEach(r=>this.finishArrowValidation(r)),[a,[]]):vc(a,r=>r.params.every(o=>this.isAssignable(o,!0)))}finishArrowValidation(e){var i;this.toAssignableList(e.params,(i=e.extra)==null?void 0:i.trailingCommaLoc,!1),this.scope.enter(te|ji),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,i){let s;return this.state.noArrowParamsConversionAt.indexOf(e.start)!==-1?(this.state.noArrowParamsConversionAt.push(this.state.start),s=i(),this.state.noArrowParamsConversionAt.pop()):s=i(),s}parseParenItem(e,i){if(e=super.parseParenItem(e,i),this.eat(17)&&(e.optional=!0,this.resetEndLocation(e)),this.match(14)){let s=this.startNodeAt(i);return s.expression=e,s.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(s,"TypeCastExpression")}return e}assertModuleNodeAllowed(e){e.type==="ImportDeclaration"&&(e.importKind==="type"||e.importKind==="typeof")||e.type==="ExportNamedDeclaration"&&e.exportKind==="type"||e.type==="ExportAllDeclaration"&&e.exportKind==="type"||super.assertModuleNodeAllowed(e)}parseExportDeclaration(e){if(this.isContextual(128)){e.exportKind="type";let i=this.startNode();return this.next(),this.match(5)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(i)}else if(this.isContextual(129)){e.exportKind="type";let i=this.startNode();return this.next(),this.flowParseOpaqueType(i,!1)}else if(this.isContextual(127)){e.exportKind="type";let i=this.startNode();return this.next(),this.flowParseInterface(i)}else if(this.shouldParseEnums()&&this.isContextual(124)){e.exportKind="value";let i=this.startNode();return this.next(),this.flowParseEnumDeclaration(i)}else return super.parseExportDeclaration(e)}eatExportStar(e){return super.eatExportStar(e)?!0:this.isContextual(128)&&this.lookahead().type===55?(e.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(e){let{startLoc:i}=this.state,s=super.maybeParseExportNamespaceSpecifier(e);return s&&e.exportKind==="type"&&this.unexpected(i),s}parseClassId(e,i,s){super.parseClassId(e,i,s),this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,i,s){let{startLoc:a}=this.state;if(this.isContextual(123)){if(super.parseClassMemberFromModifier(e,i))return;i.declare=!0}super.parseClassMember(e,i,s),i.declare&&(i.type!=="ClassProperty"&&i.type!=="ClassPrivateProperty"&&i.type!=="PropertyDefinition"?this.raise(P.DeclareClassElement,{at:a}):i.value&&this.raise(P.DeclareClassFieldInitializer,{at:i.value}))}isIterator(e){return e==="iterator"||e==="asyncIterator"}readIterator(){let e=super.readWord1(),i="@@"+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(d.InvalidIdentifier,{at:this.state.curPosition(),identifierName:i}),this.finishToken(130,i)}getTokenFromCode(e){let i=this.input.charCodeAt(this.state.pos+1);e===123&&i===124?this.finishOp(6,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?48:47,1):this.state.inType&&e===63?i===46?this.finishOp(18,2):this.finishOp(17,1):zl(e,i,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,i){return e.type==="TypeCastExpression"?this.isAssignable(e.expression,i):super.isAssignable(e,i)}toAssignable(e,i=!1){!i&&e.type==="AssignmentExpression"&&e.left.type==="TypeCastExpression"&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,i)}toAssignableList(e,i,s){for(let a=0;a<e.length;a++){let r=e[a];(r==null?void 0:r.type)==="TypeCastExpression"&&(e[a]=this.typeCastToParameter(r))}super.toAssignableList(e,i,s)}toReferencedList(e,i){for(let a=0;a<e.length;a++){var s;let r=e[a];r&&r.type==="TypeCastExpression"&&!((s=r.extra)!=null&&s.parenthesized)&&(e.length>1||!i)&&this.raise(P.TypeCastInPattern,{at:r.typeAnnotation})}return e}parseArrayLike(e,i,s,a){let r=super.parseArrayLike(e,i,s,a);return i&&!this.state.maybeInArrowParameters&&this.toReferencedList(r.elements),r}isValidLVal(e,i,s){return e==="TypeCastExpression"||super.isValidLVal(e,i,s)}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,i,s,a,r,o){if(i.variance&&this.unexpected(i.variance.loc.start),delete i.variance,this.match(47)&&(i.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,i,s,a,r,o),i.params&&r){let l=i.params;l.length>0&&this.isThisParam(l[0])&&this.raise(P.ThisParamBannedInConstructor,{at:i})}else if(i.type==="MethodDefinition"&&r&&i.value.params){let l=i.value.params;l.length>0&&this.isThisParam(l[0])&&this.raise(P.ThisParamBannedInConstructor,{at:i})}}pushClassPrivateMethod(e,i,s,a){i.variance&&this.unexpected(i.variance.loc.start),delete i.variance,this.match(47)&&(i.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,i,s,a)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&this.match(47)&&(e.superTypeParameters=this.flowParseTypeParameterInstantiation()),this.isContextual(111)){this.next();let i=e.implements=[];do{let s=this.startNode();s.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?s.typeParameters=this.flowParseTypeParameterInstantiation():s.typeParameters=null,i.push(this.finishNode(s,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);let i=this.getObjectOrClassMethodParams(e);if(i.length>0){let s=i[0];this.isThisParam(s)&&e.kind==="get"?this.raise(P.GetterMayNotHaveThisParam,{at:s}):this.isThisParam(s)&&this.raise(P.SetterMayNotHaveThisParam,{at:s})}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,i,s,a,r,o,l){e.variance&&this.unexpected(e.variance.loc.start),delete e.variance;let c;this.match(47)&&!o&&(c=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());let p=super.parseObjPropValue(e,i,s,a,r,o,l);return c&&((p.value||p).typeParameters=c),p}parseAssignableListItemTypes(e){return this.eat(17)&&(e.type!=="Identifier"&&this.raise(P.PatternIsOptional,{at:e}),this.isThisParam(e)&&this.raise(P.ThisParamMayNotBeOptional,{at:e}),e.optional=!0),this.match(14)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(P.ThisParamAnnotationRequired,{at:e}),this.match(29)&&this.isThisParam(e)&&this.raise(P.ThisParamNoDefault,{at:e}),this.resetEndLocation(e),e}parseMaybeDefault(e,i){let s=super.parseMaybeDefault(e,i);return s.type==="AssignmentPattern"&&s.typeAnnotation&&s.right.start<s.typeAnnotation.start&&this.raise(P.TypeBeforeInitializer,{at:s.typeAnnotation}),s}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(P.ImportReflectionHasImportType,{at:e.specifiers[0].loc.start})}parseImportSpecifierLocal(e,i,s){i.local=Ka(e)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(i,s))}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(128)){if(!e)return!0;let i=this.lookaheadCharCode();return i===123||i===42}return!e&&this.isContextual(87)}applyImportPhase(e,i,s,a){if(super.applyImportPhase(e,i,s,a),i){if(!s&&this.match(65))return;e.exportKind=s==="type"?s:"value"}else s==="type"&&this.match(55)&&this.unexpected(),e.importKind=s==="type"||s==="typeof"?s:"value"}parseImportSpecifier(e,i,s,a,r){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&&!U(this.state.type)?(e.imported=h,e.importKind=l,e.local=ie(h)):(e.imported=o,e.importKind=null,e.local=this.parseIdentifier())}else{if(l!==null&&U(this.state.type))e.imported=this.parseIdentifier(!0),e.importKind=l;else{if(i)throw this.raise(d.ImportBindingIsString,{at:e,importName:o.value});e.imported=o,e.importKind=null}this.eatContextual(93)?e.local=this.parseIdentifier():(c=!0,e.local=ie(e.imported))}let p=Ka(e);return s&&p&&this.raise(P.ImportTypeShorthandOnlyInPureImport,{at:e}),(s||p)&&this.checkReservedType(e.local.name,e.local.loc.start,!0),c&&!s&&!p&&this.checkReservedWord(e.local.name,e.loc.start,!0,!0),this.finishImportSpecifier(e,"ImportSpecifier")}parseBindingAtom(){switch(this.state.type){case 78:return this.parseIdentifier(!0);default:return super.parseBindingAtom()}}parseFunctionParams(e,i){let s=e.kind;s!=="get"&&s!=="set"&&this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),super.parseFunctionParams(e,i)}parseVarId(e,i){super.parseVarId(e,i),this.match(14)&&(e.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,i){if(this.match(14)){let s=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,e.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=s}return super.parseAsyncArrowFromCallExpression(e,i)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}parseMaybeAssign(e,i){var s;let a=null,r;if(this.hasPlugin("jsx")&&(this.match(140)||this.match(47))){if(a=this.state.clone(),r=this.tryParse(()=>super.parseMaybeAssign(e,i),a),!r.error)return r.node;let{context:c}=this.state,p=c[c.length-1];(p===I.j_oTag||p===I.j_expr)&&c.pop()}if((s=r)!=null&&s.error||this.match(47)){var o,l;a=a||this.state.clone();let c,p=this.tryParse(u=>{var f;c=this.flowParseTypeParameterDeclaration();let m=this.forwardNoArrowParamsConversionAt(c,()=>{let b=super.parseMaybeAssign(e,i);return this.resetStartLocationFromNode(b,c),b});(f=m.extra)!=null&&f.parenthesized&&u();let x=this.maybeUnwrapTypeCastExpression(m);return x.type!=="ArrowFunctionExpression"&&u(),x.typeParameters=c,this.resetStartLocationFromNode(x,c),m},a),h=null;if(p.node&&this.maybeUnwrapTypeCastExpression(p.node).type==="ArrowFunctionExpression"){if(!p.error&&!p.aborted)return p.node.async&&this.raise(P.UnexpectedTypeParameterBeforeAsyncArrowFunction,{at:c}),p.node;h=p.node}if((o=r)!=null&&o.node)return this.state=r.failState,r.node;if(h)return this.state=p.failState,h;throw(l=r)!=null&&l.thrown?r.error:p.thrown?p.error:this.raise(P.UnexpectedTokenAfterTypeParameter,{at:c})}return super.parseMaybeAssign(e,i)}parseArrow(e){if(this.match(14)){let i=this.tryParse(()=>{let s=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let a=this.startNode();return[a.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=s,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),a});if(i.thrown)return null;i.error&&(this.state=i.failState),e.returnType=i.node.typeAnnotation?this.finishNode(i.node,"TypeAnnotation"):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(14)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,i){this.state.noArrowParamsConversionAt.indexOf(e.start)!==-1?e.params=i:super.setArrowFunctionParameters(e,i)}checkParams(e,i,s,a=!0){if(!(s&&this.state.noArrowParamsConversionAt.indexOf(e.start)!==-1)){for(let r=0;r<e.params.length;r++)this.isThisParam(e.params[r])&&r>0&&this.raise(P.ThisParamMustBeFirst,{at:e.params[r]});super.checkParams(e,i,s,a)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&this.state.noArrowAt.indexOf(this.state.start)===-1)}parseSubscripts(e,i,s){if(e.type==="Identifier"&&e.name==="async"&&this.state.noArrowAt.indexOf(i.index)!==-1){this.next();let a=this.startNodeAt(i);a.callee=e,a.arguments=super.parseCallExpressionArguments(11,!1),e=this.finishNode(a,"CallExpression")}else if(e.type==="Identifier"&&e.name==="async"&&this.match(47)){let a=this.state.clone(),r=this.tryParse(l=>this.parseAsyncArrowWithTypeParameters(i)||l(),a);if(!r.error&&!r.aborted)return r.node;let o=this.tryParse(()=>super.parseSubscripts(e,i,s),a);if(o.node&&!o.error)return o.node;if(r.node)return this.state=r.failState,r.node;if(o.node)return this.state=o.failState,o.node;throw r.error||o.error}return super.parseSubscripts(e,i,s)}parseSubscript(e,i,s,a){if(this.match(18)&&this.isLookaheadToken_lt()){if(a.optionalChainMember=!0,s)return a.stop=!0,e;this.next();let r=this.startNodeAt(i);return r.callee=e,r.typeArguments=this.flowParseTypeParameterInstantiation(),this.expect(10),r.arguments=this.parseCallExpressionArguments(11,!1),r.optional=!0,this.finishCallExpression(r,!0)}else if(!s&&this.shouldParseTypes()&&this.match(47)){let r=this.startNodeAt(i);r.callee=e;let o=this.tryParse(()=>(r.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),r.arguments=super.parseCallExpressionArguments(11,!1),a.optionalChainMember&&(r.optional=!1),this.finishCallExpression(r,a.optionalChainMember)));if(o.node)return o.error&&(this.state=o.failState),o.node}return super.parseSubscript(e,i,s,a)}parseNewCallee(e){super.parseNewCallee(e);let i=null;this.shouldParseTypes()&&this.match(47)&&(i=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=i}parseAsyncArrowWithTypeParameters(e){let i=this.startNodeAt(e);if(this.parseFunctionParams(i,!1),!!this.parseArrow(i))return super.parseArrowExpression(i,void 0,!0)}readToken_mult_modulo(e){let i=this.input.charCodeAt(this.state.pos+1);if(e===42&&i===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 i=this.input.charCodeAt(this.state.pos+1);if(e===124&&i===125){this.finishOp(9,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,i){let s=super.parseTopLevel(e,i);return this.state.hasFlowComment&&this.raise(P.UnterminatedFlowComment,{at:this.state.curPosition()}),s}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(P.NestedFlowComment,{at:this.state.startLoc});this.hasFlowCommentCompletion();let e=this.skipFlowComment();e&&(this.state.pos+=e,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:e}=this.state,i=2;for(;[32,9].includes(this.input.charCodeAt(e+i));)i++;let s=this.input.charCodeAt(i+e),a=this.input.charCodeAt(i+e+1);return s===58&&a===58?i+2:this.input.slice(i+e,i+e+12)==="flow-include"?i+12:s===58&&a!==58?i:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(d.UnterminatedComment,{at:this.state.curPosition()})}flowEnumErrorBooleanMemberNotInitialized(e,{enumName:i,memberName:s}){this.raise(P.EnumBooleanMemberNotInitialized,{at:e,memberName:s,enumName:i})}flowEnumErrorInvalidMemberInitializer(e,i){return this.raise(i.explicitType?i.explicitType==="symbol"?P.EnumInvalidMemberInitializerSymbolType:P.EnumInvalidMemberInitializerPrimaryType:P.EnumInvalidMemberInitializerUnknownType,Object.assign({at:e},i))}flowEnumErrorNumberMemberNotInitialized(e,{enumName:i,memberName:s}){this.raise(P.EnumNumberMemberNotInitialized,{at:e,enumName:i,memberName:s})}flowEnumErrorStringMemberInconsistentlyInitailized(e,{enumName:i}){this.raise(P.EnumStringMemberInconsistentlyInitailized,{at:e,enumName:i})}flowEnumMemberInit(){let e=this.state.startLoc,i=()=>this.match(12)||this.match(8);switch(this.state.type){case 132:{let s=this.parseNumericLiteral(this.state.value);return i()?{type:"number",loc:s.loc.start,value:s}:{type:"invalid",loc:e}}case 131:{let s=this.parseStringLiteral(this.state.value);return i()?{type:"string",loc:s.loc.start,value:s}:{type:"invalid",loc:e}}case 85:case 86:{let s=this.parseBooleanLiteral(this.match(85));return i()?{type:"boolean",loc:s.loc.start,value:s}:{type:"invalid",loc:e}}default:return{type:"invalid",loc:e}}}flowEnumMemberRaw(){let e=this.state.startLoc,i=this.parseIdentifier(!0),s=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:e};return{id:i,init:s}}flowEnumCheckExplicitTypeMismatch(e,i,s){let{explicitType:a}=i;a!==null&&a!==s&&this.flowEnumErrorInvalidMemberInitializer(e,i)}flowEnumMembers({enumName:e,explicitType:i}){let s=new Set,a={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},r=!1;for(;!this.match(8);){if(this.eat(21)){r=!0;break}let o=this.startNode(),{id:l,init:c}=this.flowEnumMemberRaw(),p=l.name;if(p==="")continue;/^[a-z]/.test(p)&&this.raise(P.EnumInvalidMemberName,{at:l,memberName:p,suggestion:p[0].toUpperCase()+p.slice(1),enumName:e}),s.has(p)&&this.raise(P.EnumDuplicateMemberName,{at:l,memberName:p,enumName:e}),s.add(p);let h={enumName:e,explicitType:i,memberName:p};switch(o.id=l,c.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(c.loc,h,"boolean"),o.init=c.value,a.booleanMembers.push(this.finishNode(o,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(c.loc,h,"number"),o.init=c.value,a.numberMembers.push(this.finishNode(o,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(c.loc,h,"string"),o.init=c.value,a.stringMembers.push(this.finishNode(o,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(c.loc,h);case"none":switch(i){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(c.loc,h);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(c.loc,h);break;default:a.defaultedMembers.push(this.finishNode(o,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:a,hasUnknownMembers:r}}flowEnumStringMembers(e,i,{enumName:s}){if(e.length===0)return i;if(i.length===0)return e;if(i.length>e.length){for(let a of e)this.flowEnumErrorStringMemberInconsistentlyInitailized(a,{enumName:s});return i}else{for(let a of i)this.flowEnumErrorStringMemberInconsistentlyInitailized(a,{enumName:s});return e}}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(101))return null;if(!k(this.state.type))throw this.raise(P.EnumInvalidExplicitTypeUnknownSupplied,{at:this.state.startLoc,enumName:e});let{value:i}=this.state;return this.next(),i!=="boolean"&&i!=="number"&&i!=="string"&&i!=="symbol"&&this.raise(P.EnumInvalidExplicitType,{at:this.state.startLoc,enumName:e,invalidEnumType:i}),i}flowEnumBody(e,i){let s=i.name,a=i.loc.start,r=this.flowEnumParseExplicitType({enumName:s});this.expect(5);let{members:o,hasUnknownMembers:l}=this.flowEnumMembers({enumName:s,explicitType:r});switch(e.hasUnknownMembers=l,r){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:s}),this.expect(8),this.finishNode(e,"EnumStringBody");case"symbol":return e.members=o.defaultedMembers,this.expect(8),this.finishNode(e,"EnumSymbolBody");default:{let c=()=>(e.members=[],this.expect(8),this.finishNode(e,"EnumStringBody"));e.explicitType=!1;let p=o.booleanMembers.length,h=o.numberMembers.length,u=o.stringMembers.length,f=o.defaultedMembers.length;if(!p&&!h&&!u&&!f)return c();if(!p&&!h)return e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:s}),this.expect(8),this.finishNode(e,"EnumStringBody");if(!h&&!u&&p>=f){for(let m of o.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(m.loc.start,{enumName:s,memberName:m.id.name});return e.members=o.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody")}else if(!p&&!u&&h>=f){for(let m of o.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(m.loc.start,{enumName:s,memberName:m.id.name});return e.members=o.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody")}else return this.raise(P.EnumInconsistentMemberValues,{at:a,enumName:s}),c()}}}flowParseEnumDeclaration(e){let i=this.parseIdentifier();return e.id=i,e.body=this.flowEnumBody(this.startNode(),i),this.finishNode(e,"EnumDeclaration")}isLookaheadToken_lt(){let e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){let i=this.input.charCodeAt(e+1);return i!==60&&i!==61}return!1}maybeUnwrapTypeCastExpression(e){return e.type==="TypeCastExpression"?e.expression:e}},Pc={__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"},pe=ee`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:n})=>`Expected corresponding JSX closing tag for <${n}>.`,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:n,HTMLEntity:t})=>`Unexpected token \`${n}\`. Did you mean \`${t}\` or \`{'${n}'}\`?`,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 re(n){return n?n.type==="JSXOpeningFragment"||n.type==="JSXClosingFragment":!1}function Te(n){if(n.type==="JSXIdentifier")return n.name;if(n.type==="JSXNamespacedName")return n.namespace.name+":"+n.name.name;if(n.type==="JSXMemberExpression")return Te(n.object)+"."+Te(n.property);throw new Error("Node had unexpected type: "+n.type)}var Tc=n=>class extends n{jsxReadToken(){let e="",i=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(pe.UnterminatedJsxContent,{at:this.state.startLoc});let s=this.input.charCodeAt(this.state.pos);switch(s){case 60:case 123:if(this.state.pos===this.state.start){s===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(140)):super.getTokenFromCode(s);return}e+=this.input.slice(i,this.state.pos),this.finishToken(139,e);return;case 38:e+=this.input.slice(i,this.state.pos),e+=this.jsxReadEntity(),i=this.state.pos;break;case 62:case 125:default:We(s)?(e+=this.input.slice(i,this.state.pos),e+=this.jsxReadNewLine(!0),i=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){let i=this.input.charCodeAt(this.state.pos),s;return++this.state.pos,i===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,s=e?`
|
|
1
|
+
var On=Object.create;var Et=Object.defineProperty;var Mn=Object.getOwnPropertyDescriptor;var Dn=Object.getOwnPropertyNames;var Bn=Object.getPrototypeOf,Fn=Object.prototype.hasOwnProperty;var I=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),Rn=(r,t)=>{for(var e in t)Et(r,e,{get:t[e],enumerable:!0})},Li=(r,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Dn(t))!Fn.call(r,i)&&i!==e&&Et(r,i,{get:()=>t[i],enumerable:!(s=Mn(t,i))||s.enumerable});return r};var oe=(r,t,e)=>(e=r!=null?On(Bn(r)):{},Li(t||!r||!r.__esModule?Et(e,"default",{value:r,enumerable:!0}):e,r)),Un=r=>Li(Et({},"__esModule",{value:!0}),r);var Mi=I((Ll,Oi)=>{"use strict";var jn=/[|\\{}()[\]^$+*?.-]/g;Oi.exports=r=>{if(typeof r!="string")throw new TypeError("Expected a string");return r.replace(jn,"\\$&")}});var Ri=I((Ol,Fi)=>{"use strict";var $n=Mi(),qn=typeof process=="object"&&process&&typeof process.cwd=="function"?process.cwd():".",Bi=[].concat(require("module").builtinModules,"bootstrap_node","node").map(r=>new RegExp(`(?:\\((?:node:)?${r}(?:\\.js)?:\\d+:\\d+\\)$|^\\s*at (?:node:)?${r}(?:\\.js)?:\\d+:\\d+$)`));Bi.push(/\((?:node:)?internal\/[^:]+:\d+:\d+\)$/,/\s*at (?:node:)?internal\/[^:]+:\d+:\d+$/,/\/\.node-spawn-wrap-\w+-\w+\/node:\d+:\d+\)?$/);var Ke=class{constructor(t){t={ignoredPackages:[],...t},"internals"in t||(t.internals=Ke.nodeInternals()),"cwd"in t||(t.cwd=qn),this._cwd=t.cwd.replace(/\\/g,"/"),this._internals=[].concat(t.internals,Vn(t.ignoredPackages)),this._wrapCallSite=t.wrapCallSite||!1}static nodeInternals(){return[...Bi]}clean(t,e=0){e=" ".repeat(e),Array.isArray(t)||(t=t.split(`
|
|
2
|
+
`)),!/^\s*at /.test(t[0])&&/^\s*at /.test(t[1])&&(t=t.slice(1));let s=!1,i=null,a=[];return t.forEach(n=>{if(n=n.replace(/\\/g,"/"),this._internals.some(u=>u.test(n)))return;let o=/^\s*at /.test(n);s?n=n.trimEnd().replace(/^(\s+)at /,"$1"):(n=n.trim(),o&&(n=n.slice(3))),n=n.replace(`${this._cwd}/`,""),n&&(o?(i&&(a.push(i),i=null),a.push(n)):(s=!0,i=n))}),a.map(n=>`${e}${n}
|
|
3
|
+
`).join("")}captureString(t,e=this.captureString){typeof t=="function"&&(e=t,t=1/0);let{stackTraceLimit:s}=Error;t&&(Error.stackTraceLimit=t);let i={};Error.captureStackTrace(i,e);let{stack:a}=i;return Error.stackTraceLimit=s,this.clean(a)}capture(t,e=this.capture){typeof t=="function"&&(e=t,t=1/0);let{prepareStackTrace:s,stackTraceLimit:i}=Error;Error.prepareStackTrace=(o,u)=>this._wrapCallSite?u.map(this._wrapCallSite):u,t&&(Error.stackTraceLimit=t);let a={};Error.captureStackTrace(a,e);let{stack:n}=a;return Object.assign(Error,{prepareStackTrace:s,stackTraceLimit:i}),n}at(t=this.at){let[e]=this.capture(1,t);if(!e)return{};let s={line:e.getLineNumber(),column:e.getColumnNumber()};Di(s,e.getFileName(),this._cwd),e.isConstructor()&&Object.defineProperty(s,"constructor",{value:!0,configurable:!0}),e.isEval()&&(s.evalOrigin=e.getEvalOrigin()),e.isNative()&&(s.native=!0);let i;try{i=e.getTypeName()}catch{}i&&i!=="Object"&&i!=="[object Object]"&&(s.type=i);let a=e.getFunctionName();a&&(s.function=a);let n=e.getMethodName();return n&&a!==n&&(s.method=n),s}parseLine(t){let e=t&&t.match(Wn);if(!e)return null;let s=e[1]==="new",i=e[2],a=e[3],n=e[4],o=Number(e[5]),u=Number(e[6]),h=e[7],l=e[8],p=e[9],f=e[10]==="native",d=e[11]===")",m,y={};if(l&&(y.line=Number(l)),p&&(y.column=Number(p)),d&&h){let P=0;for(let S=h.length-1;S>0;S--)if(h.charAt(S)===")")P++;else if(h.charAt(S)==="("&&h.charAt(S-1)===" "&&(P--,P===-1&&h.charAt(S-1)===" ")){let _=h.slice(0,S-1);h=h.slice(S+1),i+=` (${_}`;break}}if(i){let P=i.match(zn);P&&(i=P[1],m=P[2])}return Di(y,h,this._cwd),s&&Object.defineProperty(y,"constructor",{value:!0,configurable:!0}),a&&(y.evalOrigin=a,y.evalLine=o,y.evalColumn=u,y.evalFile=n&&n.replace(/\\/g,"/")),f&&(y.native=!0),i&&(y.function=i),m&&i!==m&&(y.method=m),y}};function Di(r,t,e){t&&(t=t.replace(/\\/g,"/"),t.startsWith(`${e}/`)&&(t=t.slice(e.length+1)),r.file=t)}function Vn(r){if(r.length===0)return[];let t=r.map(e=>$n(e));return new RegExp(`[/\\\\]node_modules[/\\\\](?:${t.join("|")})[/\\\\][^:]+:\\d+:\\d+`)}var Wn=new RegExp("^(?:\\s*at )?(?:(new) )?(?:(.*?) \\()?(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?(?:(.+?):(\\d+):(\\d+)|(native))(\\)?)$"),zn=/^(.*?) \[as (.*?)\]$/;Fi.exports=Ke});var Ui=I(vt=>{Object.defineProperty(vt,"__esModule",{value:!0});vt.default=/((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g;vt.matchToToken=function(r){var t={type:"invalid",value:r[0],closed:void 0};return r[1]?(t.type="string",t.closed=!!(r[3]||r[4])):r[5]?t.type="comment":r[6]?(t.type="comment",t.closed=!!r[7]):r[8]?t.type="regex":r[9]?t.type="number":r[10]?t.type="name":r[11]?t.type="punctuator":r[12]&&(t.type="whitespace"),t}});var Wi=I(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.isIdentifierChar=Vi;Ge.isIdentifierName=Xn;Ge.isIdentifierStart=qi;var cs="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",ji="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\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",Hn=new RegExp("["+cs+"]"),Kn=new RegExp("["+cs+ji+"]");cs=ji=null;var $i=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,3104,541,1507,4938,6,4191],Gn=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239];function ls(r,t){let e=65536;for(let s=0,i=t.length;s<i;s+=2){if(e+=t[s],e>r)return!1;if(e+=t[s+1],e>=r)return!0}return!1}function qi(r){return r<65?r===36:r<=90?!0:r<97?r===95:r<=122?!0:r<=65535?r>=170&&Hn.test(String.fromCharCode(r)):ls(r,$i)}function Vi(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&&Kn.test(String.fromCharCode(r)):ls(r,$i)||ls(r,Gn)}function Xn(r){let t=!0;for(let e=0;e<r.length;e++){let s=r.charCodeAt(e);if((s&64512)===55296&&e+1<r.length){let i=r.charCodeAt(++e);(i&64512)===56320&&(s=65536+((s&1023)<<10)+(i&1023))}if(t){if(t=!1,!qi(s))return!1}else if(!Vi(s))return!1}return!t}});var Gi=I(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.isKeyword=eo;ye.isReservedWord=zi;ye.isStrictBindOnlyReservedWord=Ki;ye.isStrictBindReservedWord=Zn;ye.isStrictReservedWord=Hi;var ps={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"]},Jn=new Set(ps.keyword),Yn=new Set(ps.strict),Qn=new Set(ps.strictBind);function zi(r,t){return t&&r==="await"||r==="enum"}function Hi(r,t){return zi(r,t)||Yn.has(r)}function Ki(r){return Qn.has(r)}function Zn(r,t){return Hi(r,t)||Ki(r)}function eo(r){return Jn.has(r)}});var Xi=I(H=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});Object.defineProperty(H,"isIdentifierChar",{enumerable:!0,get:function(){return fs.isIdentifierChar}});Object.defineProperty(H,"isIdentifierName",{enumerable:!0,get:function(){return fs.isIdentifierName}});Object.defineProperty(H,"isIdentifierStart",{enumerable:!0,get:function(){return fs.isIdentifierStart}});Object.defineProperty(H,"isKeyword",{enumerable:!0,get:function(){return Xe.isKeyword}});Object.defineProperty(H,"isReservedWord",{enumerable:!0,get:function(){return Xe.isReservedWord}});Object.defineProperty(H,"isStrictBindOnlyReservedWord",{enumerable:!0,get:function(){return Xe.isStrictBindOnlyReservedWord}});Object.defineProperty(H,"isStrictBindReservedWord",{enumerable:!0,get:function(){return Xe.isStrictBindReservedWord}});Object.defineProperty(H,"isStrictReservedWord",{enumerable:!0,get:function(){return Xe.isStrictReservedWord}});var fs=Wi(),Xe=Gi()});var Yi=I((Rl,Ji)=>{"use strict";var to=/[|\\{}()[\]^$+*?.]/g;Ji.exports=function(r){if(typeof r!="string")throw new TypeError("Expected a string");return r.replace(to,"\\$&")}});var Zi=I((Ul,Qi)=>{"use strict";Qi.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var ds=I((jl,ir)=>{var xe=Zi(),sr={};for(Ct in xe)xe.hasOwnProperty(Ct)&&(sr[xe[Ct]]=Ct);var Ct,b=ir.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(U in b)if(b.hasOwnProperty(U)){if(!("channels"in b[U]))throw new Error("missing channels property: "+U);if(!("labels"in b[U]))throw new Error("missing channel labels property: "+U);if(b[U].labels.length!==b[U].channels)throw new Error("channel and label counts mismatch: "+U);er=b[U].channels,tr=b[U].labels,delete b[U].channels,delete b[U].labels,Object.defineProperty(b[U],"channels",{value:er}),Object.defineProperty(b[U],"labels",{value:tr})}var er,tr,U;b.rgb.hsl=function(r){var t=r[0]/255,e=r[1]/255,s=r[2]/255,i=Math.min(t,e,s),a=Math.max(t,e,s),n=a-i,o,u,h;return a===i?o=0:t===a?o=(e-s)/n:e===a?o=2+(s-t)/n:s===a&&(o=4+(t-e)/n),o=Math.min(o*60,360),o<0&&(o+=360),h=(i+a)/2,a===i?u=0:h<=.5?u=n/(a+i):u=n/(2-a-i),[o,u*100,h*100]};b.rgb.hsv=function(r){var t,e,s,i,a,n=r[0]/255,o=r[1]/255,u=r[2]/255,h=Math.max(n,o,u),l=h-Math.min(n,o,u),p=function(f){return(h-f)/6/l+1/2};return l===0?i=a=0:(a=l/h,t=p(n),e=p(o),s=p(u),n===h?i=s-e:o===h?i=1/3+t-s:u===h&&(i=2/3+e-t),i<0?i+=1:i>1&&(i-=1)),[i*360,a*100,h*100]};b.rgb.hwb=function(r){var t=r[0],e=r[1],s=r[2],i=b.rgb.hsl(r)[0],a=1/255*Math.min(t,Math.min(e,s));return s=1-1/255*Math.max(t,Math.max(e,s)),[i,a*100,s*100]};b.rgb.cmyk=function(r){var t=r[0]/255,e=r[1]/255,s=r[2]/255,i,a,n,o;return o=Math.min(1-t,1-e,1-s),i=(1-t-o)/(1-o)||0,a=(1-e-o)/(1-o)||0,n=(1-s-o)/(1-o)||0,[i*100,a*100,n*100,o*100]};function so(r,t){return Math.pow(r[0]-t[0],2)+Math.pow(r[1]-t[1],2)+Math.pow(r[2]-t[2],2)}b.rgb.keyword=function(r){var t=sr[r];if(t)return t;var e=1/0,s;for(var i in xe)if(xe.hasOwnProperty(i)){var a=xe[i],n=so(r,a);n<e&&(e=n,s=i)}return s};b.keyword.rgb=function(r){return xe[r]};b.rgb.xyz=function(r){var t=r[0]/255,e=r[1]/255,s=r[2]/255;t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,s=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92;var i=t*.4124+e*.3576+s*.1805,a=t*.2126+e*.7152+s*.0722,n=t*.0193+e*.1192+s*.9505;return[i*100,a*100,n*100]};b.rgb.lab=function(r){var t=b.rgb.xyz(r),e=t[0],s=t[1],i=t[2],a,n,o;return e/=95.047,s/=100,i/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,a=116*s-16,n=500*(e-s),o=200*(s-i),[a,n,o]};b.hsl.rgb=function(r){var t=r[0]/360,e=r[1]/100,s=r[2]/100,i,a,n,o,u;if(e===0)return u=s*255,[u,u,u];s<.5?a=s*(1+e):a=s+e-s*e,i=2*s-a,o=[0,0,0];for(var h=0;h<3;h++)n=t+1/3*-(h-1),n<0&&n++,n>1&&n--,6*n<1?u=i+(a-i)*6*n:2*n<1?u=a:3*n<2?u=i+(a-i)*(2/3-n)*6:u=i,o[h]=u*255;return o};b.hsl.hsv=function(r){var t=r[0],e=r[1]/100,s=r[2]/100,i=e,a=Math.max(s,.01),n,o;return s*=2,e*=s<=1?s:2-s,i*=a<=1?a:2-a,o=(s+e)/2,n=s===0?2*i/(a+i):2*e/(s+e),[t,n*100,o*100]};b.hsv.rgb=function(r){var t=r[0]/60,e=r[1]/100,s=r[2]/100,i=Math.floor(t)%6,a=t-Math.floor(t),n=255*s*(1-e),o=255*s*(1-e*a),u=255*s*(1-e*(1-a));switch(s*=255,i){case 0:return[s,u,n];case 1:return[o,s,n];case 2:return[n,s,u];case 3:return[n,o,s];case 4:return[u,n,s];case 5:return[s,n,o]}};b.hsv.hsl=function(r){var t=r[0],e=r[1]/100,s=r[2]/100,i=Math.max(s,.01),a,n,o;return o=(2-e)*s,a=(2-e)*i,n=e*i,n/=a<=1?a:2-a,n=n||0,o/=2,[t,n*100,o*100]};b.hwb.rgb=function(r){var t=r[0]/360,e=r[1]/100,s=r[2]/100,i=e+s,a,n,o,u;i>1&&(e/=i,s/=i),a=Math.floor(6*t),n=1-s,o=6*t-a,a&1&&(o=1-o),u=e+o*(n-e);var h,l,p;switch(a){default:case 6:case 0:h=n,l=u,p=e;break;case 1:h=u,l=n,p=e;break;case 2:h=e,l=n,p=u;break;case 3:h=e,l=u,p=n;break;case 4:h=u,l=e,p=n;break;case 5:h=n,l=e,p=u;break}return[h*255,l*255,p*255]};b.cmyk.rgb=function(r){var t=r[0]/100,e=r[1]/100,s=r[2]/100,i=r[3]/100,a,n,o;return a=1-Math.min(1,t*(1-i)+i),n=1-Math.min(1,e*(1-i)+i),o=1-Math.min(1,s*(1-i)+i),[a*255,n*255,o*255]};b.xyz.rgb=function(r){var t=r[0]/100,e=r[1]/100,s=r[2]/100,i,a,n;return i=t*3.2406+e*-1.5372+s*-.4986,a=t*-.9689+e*1.8758+s*.0415,n=t*.0557+e*-.204+s*1.057,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*12.92,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),n=Math.min(Math.max(0,n),1),[i*255,a*255,n*255]};b.xyz.lab=function(r){var t=r[0],e=r[1],s=r[2],i,a,n;return t/=95.047,e/=100,s/=108.883,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,i=116*e-16,a=500*(t-e),n=200*(e-s),[i,a,n]};b.lab.xyz=function(r){var t=r[0],e=r[1],s=r[2],i,a,n;a=(t+16)/116,i=e/500+a,n=a-s/200;var o=Math.pow(a,3),u=Math.pow(i,3),h=Math.pow(n,3);return a=o>.008856?o:(a-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,n=h>.008856?h:(n-16/116)/7.787,i*=95.047,a*=100,n*=108.883,[i,a,n]};b.lab.lch=function(r){var t=r[0],e=r[1],s=r[2],i,a,n;return i=Math.atan2(s,e),a=i*360/2/Math.PI,a<0&&(a+=360),n=Math.sqrt(e*e+s*s),[t,n,a]};b.lch.lab=function(r){var t=r[0],e=r[1],s=r[2],i,a,n;return n=s/360*2*Math.PI,i=e*Math.cos(n),a=e*Math.sin(n),[t,i,a]};b.rgb.ansi16=function(r){var t=r[0],e=r[1],s=r[2],i=1 in arguments?arguments[1]:b.rgb.hsv(r)[2];if(i=Math.round(i/50),i===0)return 30;var a=30+(Math.round(s/255)<<2|Math.round(e/255)<<1|Math.round(t/255));return i===2&&(a+=60),a};b.hsv.ansi16=function(r){return b.rgb.ansi16(b.hsv.rgb(r),r[2])};b.rgb.ansi256=function(r){var t=r[0],e=r[1],s=r[2];if(t===e&&e===s)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;var i=16+36*Math.round(t/255*5)+6*Math.round(e/255*5)+Math.round(s/255*5);return i};b.ansi16.rgb=function(r){var t=r%10;if(t===0||t===7)return r>50&&(t+=3.5),t=t/10.5*255,[t,t,t];var e=(~~(r>50)+1)*.5,s=(t&1)*e*255,i=(t>>1&1)*e*255,a=(t>>2&1)*e*255;return[s,i,a]};b.ansi256.rgb=function(r){if(r>=232){var t=(r-232)*10+8;return[t,t,t]}r-=16;var e,s=Math.floor(r/36)/5*255,i=Math.floor((e=r%36)/6)/5*255,a=e%6/5*255;return[s,i,a]};b.rgb.hex=function(r){var t=((Math.round(r[0])&255)<<16)+((Math.round(r[1])&255)<<8)+(Math.round(r[2])&255),e=t.toString(16).toUpperCase();return"000000".substring(e.length)+e};b.hex.rgb=function(r){var t=r.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var e=t[0];t[0].length===3&&(e=e.split("").map(function(o){return o+o}).join(""));var s=parseInt(e,16),i=s>>16&255,a=s>>8&255,n=s&255;return[i,a,n]};b.rgb.hcg=function(r){var t=r[0]/255,e=r[1]/255,s=r[2]/255,i=Math.max(Math.max(t,e),s),a=Math.min(Math.min(t,e),s),n=i-a,o,u;return n<1?o=a/(1-n):o=0,n<=0?u=0:i===t?u=(e-s)/n%6:i===e?u=2+(s-t)/n:u=4+(t-e)/n+4,u/=6,u%=1,[u*360,n*100,o*100]};b.hsl.hcg=function(r){var t=r[1]/100,e=r[2]/100,s=1,i=0;return e<.5?s=2*t*e:s=2*t*(1-e),s<1&&(i=(e-.5*s)/(1-s)),[r[0],s*100,i*100]};b.hsv.hcg=function(r){var t=r[1]/100,e=r[2]/100,s=t*e,i=0;return s<1&&(i=(e-s)/(1-s)),[r[0],s*100,i*100]};b.hcg.rgb=function(r){var t=r[0]/360,e=r[1]/100,s=r[2]/100;if(e===0)return[s*255,s*255,s*255];var i=[0,0,0],a=t%1*6,n=a%1,o=1-n,u=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=n,i[2]=0;break;case 1:i[0]=o,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=n;break;case 3:i[0]=0,i[1]=o,i[2]=1;break;case 4:i[0]=n,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=o}return u=(1-e)*s,[(e*i[0]+u)*255,(e*i[1]+u)*255,(e*i[2]+u)*255]};b.hcg.hsv=function(r){var t=r[1]/100,e=r[2]/100,s=t+e*(1-t),i=0;return s>0&&(i=t/s),[r[0],i*100,s*100]};b.hcg.hsl=function(r){var t=r[1]/100,e=r[2]/100,s=e*(1-t)+.5*t,i=0;return s>0&&s<.5?i=t/(2*s):s>=.5&&s<1&&(i=t/(2*(1-s))),[r[0],i*100,s*100]};b.hcg.hwb=function(r){var t=r[1]/100,e=r[2]/100,s=t+e*(1-t);return[r[0],(s-t)*100,(1-s)*100]};b.hwb.hcg=function(r){var t=r[1]/100,e=r[2]/100,s=1-e,i=s-t,a=0;return i<1&&(a=(s-i)/(1-i)),[r[0],i*100,a*100]};b.apple.rgb=function(r){return[r[0]/65535*255,r[1]/65535*255,r[2]/65535*255]};b.rgb.apple=function(r){return[r[0]/255*65535,r[1]/255*65535,r[2]/255*65535]};b.gray.rgb=function(r){return[r[0]/100*255,r[0]/100*255,r[0]/100*255]};b.gray.hsl=b.gray.hsv=function(r){return[0,0,r[0]]};b.gray.hwb=function(r){return[0,100,r[0]]};b.gray.cmyk=function(r){return[0,0,0,r[0]]};b.gray.lab=function(r){return[r[0],0,0]};b.gray.hex=function(r){var t=Math.round(r[0]/100*255)&255,e=(t<<16)+(t<<8)+t,s=e.toString(16).toUpperCase();return"000000".substring(s.length)+s};b.rgb.gray=function(r){var t=(r[0]+r[1]+r[2])/3;return[t/255*100]}});var ar=I(($l,rr)=>{var It=ds();function io(){for(var r={},t=Object.keys(It),e=t.length,s=0;s<e;s++)r[t[s]]={distance:-1,parent:null};return r}function ro(r){var t=io(),e=[r];for(t[r].distance=0;e.length;)for(var s=e.pop(),i=Object.keys(It[s]),a=i.length,n=0;n<a;n++){var o=i[n],u=t[o];u.distance===-1&&(u.distance=t[s].distance+1,u.parent=s,e.unshift(o))}return t}function ao(r,t){return function(e){return t(r(e))}}function no(r,t){for(var e=[t[r].parent,r],s=It[t[r].parent][r],i=t[r].parent;t[i].parent;)e.unshift(t[i].parent),s=ao(It[t[i].parent][i],s),i=t[i].parent;return s.conversion=e,s}rr.exports=function(r){for(var t=ro(r),e={},s=Object.keys(t),i=s.length,a=0;a<i;a++){var n=s[a],o=t[n];o.parent!==null&&(e[n]=no(n,t))}return e}});var or=I((ql,nr)=>{var ms=ds(),oo=ar(),Ce={},uo=Object.keys(ms);function ho(r){var t=function(e){return e==null?e:(arguments.length>1&&(e=Array.prototype.slice.call(arguments)),r(e))};return"conversion"in r&&(t.conversion=r.conversion),t}function lo(r){var t=function(e){if(e==null)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var s=r(e);if(typeof s=="object")for(var i=s.length,a=0;a<i;a++)s[a]=Math.round(s[a]);return s};return"conversion"in r&&(t.conversion=r.conversion),t}uo.forEach(function(r){Ce[r]={},Object.defineProperty(Ce[r],"channels",{value:ms[r].channels}),Object.defineProperty(Ce[r],"labels",{value:ms[r].labels});var t=oo(r),e=Object.keys(t);e.forEach(function(s){var i=t[s];Ce[r][s]=lo(i),Ce[r][s].raw=ho(i)})});nr.exports=Ce});var hr=I((Vl,ur)=>{"use strict";var Ie=or(),Nt=(r,t)=>function(){return`\x1B[${r.apply(Ie,arguments)+t}m`},kt=(r,t)=>function(){let e=r.apply(Ie,arguments);return`\x1B[${38+t};5;${e}m`},_t=(r,t)=>function(){let e=r.apply(Ie,arguments);return`\x1B[${38+t};2;${e[0]};${e[1]};${e[2]}m`};function co(){let r=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.grey=t.color.gray;for(let i of Object.keys(t)){let a=t[i];for(let n of Object.keys(a)){let o=a[n];t[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},a[n]=t[n],r.set(o[0],o[1])}Object.defineProperty(t,i,{value:a,enumerable:!1}),Object.defineProperty(t,"codes",{value:r,enumerable:!1})}let e=i=>i,s=(i,a,n)=>[i,a,n];t.color.close="\x1B[39m",t.bgColor.close="\x1B[49m",t.color.ansi={ansi:Nt(e,0)},t.color.ansi256={ansi256:kt(e,0)},t.color.ansi16m={rgb:_t(s,0)},t.bgColor.ansi={ansi:Nt(e,10)},t.bgColor.ansi256={ansi256:kt(e,10)},t.bgColor.ansi16m={rgb:_t(s,10)};for(let i of Object.keys(Ie)){if(typeof Ie[i]!="object")continue;let a=Ie[i];i==="ansi16"&&(i="ansi"),"ansi16"in a&&(t.color.ansi[i]=Nt(a.ansi16,0),t.bgColor.ansi[i]=Nt(a.ansi16,10)),"ansi256"in a&&(t.color.ansi256[i]=kt(a.ansi256,0),t.bgColor.ansi256[i]=kt(a.ansi256,10)),"rgb"in a&&(t.color.ansi16m[i]=_t(a.rgb,0),t.bgColor.ansi16m[i]=_t(a.rgb,10))}return t}Object.defineProperty(ur,"exports",{enumerable:!0,get:co})});var cr=I((Wl,lr)=>{"use strict";lr.exports=(r,t)=>{t=t||process.argv;let e=r.startsWith("-")?"":r.length===1?"-":"--",s=t.indexOf(e+r),i=t.indexOf("--");return s!==-1&&(i===-1?!0:s<i)}});var fr=I((zl,pr)=>{"use strict";var po=require("os"),V=cr(),B=process.env,Ne;V("no-color")||V("no-colors")||V("color=false")?Ne=!1:(V("color")||V("colors")||V("color=true")||V("color=always"))&&(Ne=!0);"FORCE_COLOR"in B&&(Ne=B.FORCE_COLOR.length===0||parseInt(B.FORCE_COLOR,10)!==0);function fo(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function mo(r){if(Ne===!1)return 0;if(V("color=16m")||V("color=full")||V("color=truecolor"))return 3;if(V("color=256"))return 2;if(r&&!r.isTTY&&Ne!==!0)return 0;let t=Ne?1:0;if(process.platform==="win32"){let e=po.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in B)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in B)||B.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in B)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(B.TEAMCITY_VERSION)?1:0;if(B.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in B){let e=parseInt((B.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(B.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(B.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(B.TERM)||"COLORTERM"in B?1:(B.TERM==="dumb",t)}function ys(r){let t=mo(r);return fo(t)}pr.exports={supportsColor:ys,stdout:ys(process.stdout),stderr:ys(process.stderr)}});var gr=I((Hl,xr)=>{"use strict";var yo=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,dr=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,xo=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,go=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi,bo=new Map([["n",`
|
|
4
|
+
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function yr(r){return r[0]==="u"&&r.length===5||r[0]==="x"&&r.length===3?String.fromCharCode(parseInt(r.slice(1),16)):bo.get(r)||r}function Po(r,t){let e=[],s=t.trim().split(/\s*,\s*/g),i;for(let a of s)if(!isNaN(a))e.push(Number(a));else if(i=a.match(xo))e.push(i[2].replace(go,(n,o,u)=>o?yr(o):u));else throw new Error(`Invalid Chalk template style argument: ${a} (in style '${r}')`);return e}function To(r){dr.lastIndex=0;let t=[],e;for(;(e=dr.exec(r))!==null;){let s=e[1];if(e[2]){let i=Po(s,e[2]);t.push([s].concat(i))}else t.push([s])}return t}function mr(r,t){let e={};for(let i of t)for(let a of i.styles)e[a[0]]=i.inverse?null:a.slice(1);let s=r;for(let i of Object.keys(e))if(Array.isArray(e[i])){if(!(i in s))throw new Error(`Unknown Chalk style: ${i}`);e[i].length>0?s=s[i].apply(s,e[i]):s=s[i]}return s}xr.exports=(r,t)=>{let e=[],s=[],i=[];if(t.replace(yo,(a,n,o,u,h,l)=>{if(n)i.push(yr(n));else if(u){let p=i.join("");i=[],s.push(e.length===0?p:mr(r,e)(p)),e.push({inverse:o,styles:To(u)})}else if(h){if(e.length===0)throw new Error("Found extraneous } in Chalk template literal");s.push(mr(r,e)(i.join(""))),i=[],e.pop()}else i.push(l)}),s.push(i.join("")),e.length>0){let a=`Chalk template literal is missing ${e.length} closing bracket${e.length===1?"":"s"} (\`}\`)`;throw new Error(a)}return s.join("")}});var Sr=I((Kl,Ye)=>{"use strict";var gs=Yi(),L=hr(),xs=fr().stdout,Ao=gr(),Pr=process.platform==="win32"&&!(process.env.TERM||"").toLowerCase().startsWith("xterm"),Tr=["ansi","ansi","ansi256","ansi16m"],Ar=new Set(["gray"]),ke=Object.create(null);function br(r,t){t=t||{};let e=xs?xs.level:0;r.level=t.level===void 0?e:t.level,r.enabled="enabled"in t?t.enabled:r.level>0}function Je(r){if(!this||!(this instanceof Je)||this.template){let t={};return br(t,r),t.template=function(){let e=[].slice.call(arguments);return Eo.apply(null,[t.template].concat(e))},Object.setPrototypeOf(t,Je.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=Je,t.template}br(this,r)}Pr&&(L.blue.open="\x1B[94m");for(let r of Object.keys(L))L[r].closeRe=new RegExp(gs(L[r].close),"g"),ke[r]={get(){let t=L[r];return Lt.call(this,this._styles?this._styles.concat(t):[t],this._empty,r)}};ke.visible={get(){return Lt.call(this,this._styles||[],!0,"visible")}};L.color.closeRe=new RegExp(gs(L.color.close),"g");for(let r of Object.keys(L.color.ansi))Ar.has(r)||(ke[r]={get(){let t=this.level;return function(){let s={open:L.color[Tr[t]][r].apply(null,arguments),close:L.color.close,closeRe:L.color.closeRe};return Lt.call(this,this._styles?this._styles.concat(s):[s],this._empty,r)}}});L.bgColor.closeRe=new RegExp(gs(L.bgColor.close),"g");for(let r of Object.keys(L.bgColor.ansi)){if(Ar.has(r))continue;let t="bg"+r[0].toUpperCase()+r.slice(1);ke[t]={get(){let e=this.level;return function(){let i={open:L.bgColor[Tr[e]][r].apply(null,arguments),close:L.bgColor.close,closeRe:L.bgColor.closeRe};return Lt.call(this,this._styles?this._styles.concat(i):[i],this._empty,r)}}}}var So=Object.defineProperties(()=>{},ke);function Lt(r,t,e){let s=function(){return wo.apply(s,arguments)};s._styles=r,s._empty=t;let i=this;return Object.defineProperty(s,"level",{enumerable:!0,get(){return i.level},set(a){i.level=a}}),Object.defineProperty(s,"enabled",{enumerable:!0,get(){return i.enabled},set(a){i.enabled=a}}),s.hasGrey=this.hasGrey||e==="gray"||e==="grey",s.__proto__=So,s}function wo(){let r=arguments,t=r.length,e=String(arguments[0]);if(t===0)return"";if(t>1)for(let i=1;i<t;i++)e+=" "+r[i];if(!this.enabled||this.level<=0||!e)return this._empty?"":e;let s=L.dim.open;Pr&&this.hasGrey&&(L.dim.open="");for(let i of this._styles.slice().reverse())e=i.open+e.replace(i.closeRe,i.open)+i.close,e=e.replace(/\r?\n/g,`${i.close}$&${i.open}`);return L.dim.open=s,e}function Eo(r,t){if(!Array.isArray(t))return[].slice.call(arguments,1).join(" ");let e=[].slice.call(arguments,2),s=[t.raw[0]];for(let i=1;i<t.length;i++)s.push(String(e[i-1]).replace(/[{}\\]/g,"\\$&")),s.push(String(t.raw[i]));return Ao(r,s.join(""))}Object.defineProperties(Je.prototype,ke);Ye.exports=Je();Ye.exports.supportsColor=xs;Ye.exports.default=Ye.exports});var Nr=I(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});Qe.default=_o;Qe.getChalk=Ir;Qe.shouldHighlight=Cr;var wr=Ui(),Er=Xi(),bs=Sr(),vo=new Set(["as","async","from","get","of","set"]);function Co(r){return{keyword:r.cyan,capitalized:r.yellow,jsxIdentifier:r.yellow,punctuator:r.yellow,number:r.magenta,string:r.green,regex:r.magenta,comment:r.grey,invalid:r.white.bgRed.bold}}var Io=/\r\n|[\n\r\u2028\u2029]/,No=/^[()[\]{}]$/,vr;{let r=/^[a-z][\w-]*$/i,t=function(e,s,i){if(e.type==="name"){if((0,Er.isKeyword)(e.value)||(0,Er.isStrictReservedWord)(e.value,!0)||vo.has(e.value))return"keyword";if(r.test(e.value)&&(i[s-1]==="<"||i.slice(s-2,s)=="</"))return"jsxIdentifier";if(e.value[0]!==e.value[0].toLowerCase())return"capitalized"}return e.type==="punctuator"&&No.test(e.value)?"bracket":e.type==="invalid"&&(e.value==="@"||e.value==="#")?"punctuator":e.type};vr=function*(e){let s;for(;s=wr.default.exec(e);){let i=wr.matchToToken(s);yield{type:t(i,s.index,e),value:i.value}}}}function ko(r,t){let e="";for(let{type:s,value:i}of vr(t)){let a=r[s];a?e+=i.split(Io).map(n=>a(n)).join(`
|
|
5
|
+
`):e+=i}return e}function Cr(r){return!!bs.supportsColor||r.forceColor}function Ir(r){return r.forceColor?new bs.constructor({enabled:!0,level:1}):bs}function _o(r,t={}){if(r!==""&&Cr(t)){let e=Ir(t),s=Co(e);return ko(s,r)}else return r}});var Or=I(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.codeFrameColumns=Lr;Ot.default=Mo;var Ps=Nr(),kr=!1;function Lo(r){return{gutter:r.grey,marker:r.red.bold,message:r.red.bold}}var _r=/\r\n|[\n\r\u2028\u2029]/;function Oo(r,t,e){let s=Object.assign({column:0,line:-1},r.start),i=Object.assign({},s,r.end),{linesAbove:a=2,linesBelow:n=3}=e||{},o=s.line,u=s.column,h=i.line,l=i.column,p=Math.max(o-(a+1),0),f=Math.min(t.length,h+n);o===-1&&(p=0),h===-1&&(f=t.length);let d=h-o,m={};if(d)for(let y=0;y<=d;y++){let P=y+o;if(!u)m[P]=!0;else if(y===0){let S=t[P-1].length;m[P]=[u,S-u+1]}else if(y===d)m[P]=[0,l];else{let S=t[P-y].length;m[P]=[0,S]}}else u===l?u?m[o]=[u,0]:m[o]=!0:m[o]=[u,l-u];return{start:p,end:f,markerLines:m}}function Lr(r,t,e={}){let s=(e.highlightCode||e.forceColor)&&(0,Ps.shouldHighlight)(e),i=(0,Ps.getChalk)(e),a=Lo(i),n=(y,P)=>s?y(P):P,o=r.split(_r),{start:u,end:h,markerLines:l}=Oo(t,o,e),p=t.start&&typeof t.start.column=="number",f=String(h).length,m=(s?(0,Ps.default)(r,e):r).split(_r,h).slice(u,h).map((y,P)=>{let S=u+1+P,R=` ${` ${S}`.slice(-f)} |`,M=l[S],St=!l[S+1];if(M){let me="";if(Array.isArray(M)){let wt=y.slice(0,Math.max(M[0]-1,0)).replace(/[^\t]/g," "),He=M[1]||1;me=[`
|
|
6
|
+
`,n(a.gutter,R.replace(/\d/g," "))," ",wt,n(a.marker,"^").repeat(He)].join(""),St&&e.message&&(me+=" "+n(a.message,e.message))}return[n(a.marker,">"),n(a.gutter,R),y.length>0?` ${y}`:"",me].join("")}else return` ${n(a.gutter,R)}${y.length>0?` ${y}`:""}`}).join(`
|
|
7
|
+
`);return e.message&&!p&&(m=`${" ".repeat(f+1)}${e.message}
|
|
8
|
+
${m}`),s?i.reset(m):m}function Mo(r,t,e,s={}){if(!kr){kr=!0;let a="Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";if(process.emitWarning)process.emitWarning(a,"DeprecationWarning");else{let n=new Error(a);n.name="DeprecationWarning",console.warn(new Error(a))}}return e=Math.max(e,0),Lr(r,{start:{column:e,line:t}},s)}});var wa=I(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});function $t(r,t){if(r==null)return{};var e={},s=Object.keys(r),i,a;for(a=0;a<s.length;a++)i=s[a],!(t.indexOf(i)>=0)&&(e[i]=r[i]);return e}var G=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}},je=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 $(r,t){let{line:e,column:s,index:i}=r;return new G(e,s+t,i+t)}var Cs={SyntaxError:"BABEL_PARSER_SYNTAX_ERROR",SourceTypeModuleError:"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED"},Do=(r,t=r.length-1)=>({get(){return r.reduce((e,s)=>e[s],this)},set(e){r.reduce((s,i,a)=>a===t?s[i]=e:s[i],this)}}),Bo=(r,t,e)=>Object.keys(e).map(s=>[s,e[s]]).filter(([,s])=>!!s).map(([s,i])=>[s,typeof i=="function"?{value:i,enumerable:!1}:typeof i.reflect=="string"?Object.assign({},i,Do(i.reflect.split("."))):i]).reduce((s,[i,a])=>Object.defineProperty(s,i,Object.assign({configurable:!0},a)),Object.assign(new r,t)),Fo={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:Cs.SourceTypeModuleError},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:Cs.SourceTypeModuleError}},Mr={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"},Is=({type:r,prefix:t})=>r==="UpdateExpression"?Mr.UpdateExpression[String(t)]:Mr[r],Ro={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.",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.",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\`.
|
|
9
|
+
- 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.
|
|
10
|
+
- 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 ${Is(r)}.`,InvalidLhsBinding:({ancestor:r})=>`Binding invalid left-hand side in ${Is(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 not allowed to be used as a name in 'let' or 'const' declarations.",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.",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.",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."},Uo={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."},jo=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),$o={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 ${Is({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.'},qo=["toMessage"],Vo=["message"];function Wo(r){let{toMessage:t}=r,e=$t(r,qo);return function s({loc:i,details:a}){return Bo(SyntaxError,Object.assign({},e,{loc:i}),{clone(n={}){let o=n.loc||{};return s({loc:new G("line"in o?o.line:this.loc.line,"column"in o?o.column:this.loc.column,"index"in o?o.index:this.loc.index),details:Object.assign({},this.details,n.details)})},details:{value:a,enumerable:!1},message:{get(){return`${t(this.details)} (${this.loc.line}:${this.loc.column})`},set(n){Object.defineProperty(this,"message",{value:n})}},pos:{reflect:"loc.index",enumerable:!0},missingPlugin:"missingPlugin"in a&&{reflect:"details.missingPlugin",enumerable:!0}})}}function te(r,t){if(Array.isArray(r))return s=>te(s,r[0]);let e={};for(let s of Object.keys(r)){let i=r[s],a=typeof i=="string"?{message:()=>i}:typeof i=="function"?{message:i}:i,{message:n}=a,o=$t(a,Vo),u=typeof n=="string"?()=>n:n;e[s]=Wo(Object.assign({code:Cs.SyntaxError,reasonCode:s,toMessage:u},t?{syntaxPlugin:t}:{},o))}return e}var c=Object.assign({},te(Fo),te(Ro),te(Uo),te`pipelineOperator`($o)),{defineProperty:zo}=Object,Dr=(r,t)=>zo(r,t,{enumerable:!1,value:r[t]});function Ze(r){return r.loc.start&&Dr(r.loc.start,"index"),r.loc.end&&Dr(r.loc.end,"index"),r}var Ho=r=>class extends r{parse(){let e=Ze(super.parse());return this.options.tokens&&(e.tokens=e.tokens.map(Ze)),e}parseRegExpLiteral({pattern:e,flags:s}){let i=null;try{i=new RegExp(e,s)}catch{}let a=this.estreeParseLiteral(i);return a.regex={pattern:e,flags:s},a}parseBigIntLiteral(e){let s;try{s=BigInt(e)}catch{s=null}let i=this.estreeParseLiteral(s);return i.bigint=String(i.value||e),i}parseDecimalLiteral(e){let i=this.estreeParseLiteral(null);return i.decimal=String(i.value||e),i}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 i=e;return i.type="ExpressionStatement",i.expression=s,i.directive=s.extra.rawValue,delete s.extra,i}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,i,a,n){super.parseBlockBody(e,s,i,a,n);let o=e.directives.map(u=>this.directiveToStmt(u));e.body=o.concat(e.body),delete e.directives}pushClassMethod(e,s,i,a,n,o){this.parseMethod(s,i,a,n,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 i=super.parseLiteral(e,s);return i.raw=i.extra.raw,delete i.extra,i}parseFunctionBody(e,s,i=!1){super.parseFunctionBody(e,s,i),e.expression=e.body.type!=="BlockStatement"}parseMethod(e,s,i,a,n,o,u=!1){let h=this.startNode();return h.kind=e.kind,h=super.parseMethod(h,s,i,a,n,o,u),h.type="FunctionExpression",delete h.kind,e.value=h,o==="ClassPrivateMethod"&&(e.computed=!1),this.finishNode(e,"MethodDefinition")}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,i,a,n){let o=super.parseObjectMethod(e,s,i,a,n);return o&&(o.type="Property",o.kind==="method"&&(o.kind="init"),o.shorthand=!1),o}parseObjectProperty(e,s,i,a){let n=super.parseObjectProperty(e,s,i,a);return n&&(n.kind="init",n.type="Property"),n}isValidLVal(e,s,i){return e==="Property"?"value":super.isValidLVal(e,s,i)}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:i,value:a}=e;this.isPrivateName(i)&&this.classScope.usePrivateName(this.getPrivateNameSV(i),i.loc.start),this.toAssignable(a,s)}else super.toAssignable(e,s)}toAssignableObjectExpressionProp(e,s,i){e.kind==="get"||e.kind==="set"?this.raise(c.PatternHasAccessor,{at:e.key}):e.method?this.raise(c.PatternHasMethod,{at:e.key}):super.toAssignableObjectExpressionProp(e,s,i)}finishCallExpression(e,s){let i=super.finishCallExpression(e,s);if(i.callee.type==="Import"){if(i.type="ImportExpression",i.source=i.arguments[0],this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions")){var a;i.attributes=(a=i.arguments[1])!=null?a:null}delete i.arguments,delete i.callee}return i}toReferencedArguments(e){e.type!=="ImportExpression"&&super.toReferencedArguments(e)}parseExport(e,s){let i=this.state.lastTokStartLoc,a=super.parseExport(e,s);switch(a.type){case"ExportAllDeclaration":a.exported=null;break;case"ExportNamedDeclaration":a.specifiers.length===1&&a.specifiers[0].type==="ExportNamespaceSpecifier"&&(a.type="ExportAllDeclaration",a.exported=a.specifiers[0].exported,delete a.specifiers);case"ExportDefaultDeclaration":{var n;let{declaration:o}=a;(o==null?void 0:o.type)==="ClassDeclaration"&&((n=o.decorators)==null?void 0:n.length)>0&&o.start===a.start&&this.resetStartLocation(a,i)}break}return a}parseSubscript(e,s,i,a){let n=super.parseSubscript(e,s,i,a);if(a.optionalChainMember){if((n.type==="OptionalMemberExpression"||n.type==="OptionalCallExpression")&&(n.type=n.type.substring(8)),a.stop){let o=this.startNodeAtNode(n);return o.expression=n,this.finishNode(o,"ChainExpression")}}else(n.type==="MemberExpression"||n.type==="CallExpression")&&(n.optional=!1);return n}hasPropertyAsPrivateName(e){return e.type==="ChainExpression"&&(e=e.expression),super.hasPropertyAsPrivateName(e)}isObjectProperty(e){return e.type==="Property"&&e.kind==="init"&&!e.method}isObjectMethod(e){return e.method||e.kind==="get"||e.kind==="set"}finishNodeAt(e,s,i){return Ze(super.finishNodeAt(e,s,i))}resetStartLocation(e,s){super.resetStartLocation(e,s),Ze(e)}resetEndLocation(e,s=this.state.lastTokEndLoc){super.resetEndLocation(e,s),Ze(e)}},Pe=class{constructor(t,e){this.token=void 0,this.preserveSpace=void 0,this.token=t,this.preserveSpace=!!e}},k={brace:new Pe("{"),j_oTag:new Pe("<tag"),j_cTag:new Pe("</tag"),j_expr:new Pe("<tag>...</tag>",!0)};k.template=new Pe("`",!0);var E=!0,x=!0,Ts=!0,et=!0,ue=!0,Ko=!0,qt=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}},Ys=new Map;function C(r,t={}){t.keyword=r;let e=T(r,t);return Ys.set(r,e),e}function j(r,t){return T(r,{beforeExpr:E,binop:t})}var rt=-1,Z=[],Qs=[],Zs=[],ei=[],ti=[],si=[];function T(r,t={}){var e,s,i,a;return++rt,Qs.push(r),Zs.push((e=t.binop)!=null?e:-1),ei.push((s=t.beforeExpr)!=null?s:!1),ti.push((i=t.startsExpr)!=null?i:!1),si.push((a=t.prefix)!=null?a:!1),Z.push(new qt(r,t)),rt}function v(r,t={}){var e,s,i,a;return++rt,Ys.set(r,rt),Qs.push(r),Zs.push((e=t.binop)!=null?e:-1),ei.push((s=t.beforeExpr)!=null?s:!1),ti.push((i=t.startsExpr)!=null?i:!1),si.push((a=t.prefix)!=null?a:!1),Z.push(new qt("name",t)),rt}var Go={bracketL:T("[",{beforeExpr:E,startsExpr:x}),bracketHashL:T("#[",{beforeExpr:E,startsExpr:x}),bracketBarL:T("[|",{beforeExpr:E,startsExpr:x}),bracketR:T("]"),bracketBarR:T("|]"),braceL:T("{",{beforeExpr:E,startsExpr:x}),braceBarL:T("{|",{beforeExpr:E,startsExpr:x}),braceHashL:T("#{",{beforeExpr:E,startsExpr:x}),braceR:T("}"),braceBarR:T("|}"),parenL:T("(",{beforeExpr:E,startsExpr:x}),parenR:T(")"),comma:T(",",{beforeExpr:E}),semi:T(";",{beforeExpr:E}),colon:T(":",{beforeExpr:E}),doubleColon:T("::",{beforeExpr:E}),dot:T("."),question:T("?",{beforeExpr:E}),questionDot:T("?."),arrow:T("=>",{beforeExpr:E}),template:T("template"),ellipsis:T("...",{beforeExpr:E}),backQuote:T("`",{startsExpr:x}),dollarBraceL:T("${",{beforeExpr:E,startsExpr:x}),templateTail:T("...`",{startsExpr:x}),templateNonTail:T("...${",{beforeExpr:E,startsExpr:x}),at:T("@"),hash:T("#",{startsExpr:x}),interpreterDirective:T("#!..."),eq:T("=",{beforeExpr:E,isAssign:et}),assign:T("_=",{beforeExpr:E,isAssign:et}),slashAssign:T("_=",{beforeExpr:E,isAssign:et}),xorAssign:T("_=",{beforeExpr:E,isAssign:et}),moduloAssign:T("_=",{beforeExpr:E,isAssign:et}),incDec:T("++/--",{prefix:ue,postfix:Ko,startsExpr:x}),bang:T("!",{beforeExpr:E,prefix:ue,startsExpr:x}),tilde:T("~",{beforeExpr:E,prefix:ue,startsExpr:x}),doubleCaret:T("^^",{startsExpr:x}),doubleAt:T("@@",{startsExpr:x}),pipeline:j("|>",0),nullishCoalescing:j("??",1),logicalOR:j("||",1),logicalAND:j("&&",2),bitwiseOR:j("|",3),bitwiseXOR:j("^",4),bitwiseAND:j("&",5),equality:j("==/!=/===/!==",6),lt:j("</>/<=/>=",7),gt:j("</>/<=/>=",7),relational:j("</>/<=/>=",7),bitShift:j("<</>>/>>>",8),bitShiftL:j("<</>>/>>>",8),bitShiftR:j("<</>>/>>>",8),plusMin:T("+/-",{beforeExpr:E,binop:9,prefix:ue,startsExpr:x}),modulo:T("%",{binop:10,startsExpr:x}),star:T("*",{binop:10}),slash:j("/",10),exponent:T("**",{beforeExpr:E,binop:11,rightAssociative:!0}),_in:C("in",{beforeExpr:E,binop:7}),_instanceof:C("instanceof",{beforeExpr:E,binop:7}),_break:C("break"),_case:C("case",{beforeExpr:E}),_catch:C("catch"),_continue:C("continue"),_debugger:C("debugger"),_default:C("default",{beforeExpr:E}),_else:C("else",{beforeExpr:E}),_finally:C("finally"),_function:C("function",{startsExpr:x}),_if:C("if"),_return:C("return",{beforeExpr:E}),_switch:C("switch"),_throw:C("throw",{beforeExpr:E,prefix:ue,startsExpr:x}),_try:C("try"),_var:C("var"),_const:C("const"),_with:C("with"),_new:C("new",{beforeExpr:E,startsExpr:x}),_this:C("this",{startsExpr:x}),_super:C("super",{startsExpr:x}),_class:C("class",{startsExpr:x}),_extends:C("extends",{beforeExpr:E}),_export:C("export"),_import:C("import",{startsExpr:x}),_null:C("null",{startsExpr:x}),_true:C("true",{startsExpr:x}),_false:C("false",{startsExpr:x}),_typeof:C("typeof",{beforeExpr:E,prefix:ue,startsExpr:x}),_void:C("void",{beforeExpr:E,prefix:ue,startsExpr:x}),_delete:C("delete",{beforeExpr:E,prefix:ue,startsExpr:x}),_do:C("do",{isLoop:Ts,beforeExpr:E}),_for:C("for",{isLoop:Ts}),_while:C("while",{isLoop:Ts}),_as:v("as",{startsExpr:x}),_assert:v("assert",{startsExpr:x}),_async:v("async",{startsExpr:x}),_await:v("await",{startsExpr:x}),_from:v("from",{startsExpr:x}),_get:v("get",{startsExpr:x}),_let:v("let",{startsExpr:x}),_meta:v("meta",{startsExpr:x}),_of:v("of",{startsExpr:x}),_sent:v("sent",{startsExpr:x}),_set:v("set",{startsExpr:x}),_static:v("static",{startsExpr:x}),_using:v("using",{startsExpr:x}),_yield:v("yield",{startsExpr:x}),_asserts:v("asserts",{startsExpr:x}),_checks:v("checks",{startsExpr:x}),_exports:v("exports",{startsExpr:x}),_global:v("global",{startsExpr:x}),_implements:v("implements",{startsExpr:x}),_intrinsic:v("intrinsic",{startsExpr:x}),_infer:v("infer",{startsExpr:x}),_is:v("is",{startsExpr:x}),_mixins:v("mixins",{startsExpr:x}),_proto:v("proto",{startsExpr:x}),_require:v("require",{startsExpr:x}),_satisfies:v("satisfies",{startsExpr:x}),_keyof:v("keyof",{startsExpr:x}),_readonly:v("readonly",{startsExpr:x}),_unique:v("unique",{startsExpr:x}),_abstract:v("abstract",{startsExpr:x}),_declare:v("declare",{startsExpr:x}),_enum:v("enum",{startsExpr:x}),_module:v("module",{startsExpr:x}),_namespace:v("namespace",{startsExpr:x}),_interface:v("interface",{startsExpr:x}),_type:v("type",{startsExpr:x}),_opaque:v("opaque",{startsExpr:x}),name:T("name",{startsExpr:x}),string:T("string",{startsExpr:x}),num:T("num",{startsExpr:x}),bigint:T("bigint",{startsExpr:x}),decimal:T("decimal",{startsExpr:x}),regexp:T("regexp",{startsExpr:x}),privateName:T("#name",{startsExpr:x}),eof:T("eof"),jsxName:T("jsxName"),jsxText:T("jsxText",{beforeExpr:!0}),jsxTagStart:T("jsxTagStart",{startsExpr:!0}),jsxTagEnd:T("jsxTagEnd"),placeholder:T("%%",{startsExpr:!0})};function N(r){return r>=93&&r<=130}function Xo(r){return r<=92}function W(r){return r>=58&&r<=130}function Yr(r){return r>=58&&r<=134}function Jo(r){return ei[r]}function Ns(r){return ti[r]}function Yo(r){return r>=29&&r<=33}function Br(r){return r>=127&&r<=129}function Qo(r){return r>=90&&r<=92}function ii(r){return r>=58&&r<=92}function Zo(r){return r>=39&&r<=59}function eu(r){return r===34}function tu(r){return si[r]}function su(r){return r>=119&&r<=121}function iu(r){return r>=122&&r<=128}function ce(r){return Qs[r]}function Ft(r){return Zs[r]}function ru(r){return r===57}function Vt(r){return r>=24&&r<=25}function Q(r){return Z[r]}Z[8].updateContext=r=>{r.pop()},Z[5].updateContext=Z[7].updateContext=Z[23].updateContext=r=>{r.push(k.brace)},Z[22].updateContext=r=>{r[r.length-1]===k.template?r.pop():r.push(k.template)},Z[140].updateContext=r=>{r.push(k.j_expr,k.j_oTag)};var ri="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",Qr="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\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",au=new RegExp("["+ri+"]"),nu=new RegExp("["+ri+Qr+"]");ri=Qr=null;var Zr=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,3104,541,1507,4938,6,4191],ou=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239];function ks(r,t){let e=65536;for(let s=0,i=t.length;s<i;s+=2){if(e+=t[s],e>r)return!1;if(e+=t[s+1],e>=r)return!0}return!1}function ee(r){return r<65?r===36:r<=90?!0:r<97?r===95:r<=122?!0:r<=65535?r>=170&&au.test(String.fromCharCode(r)):ks(r,Zr)}function De(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&&nu.test(String.fromCharCode(r)):ks(r,Zr)||ks(r,ou)}var ai={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"]},uu=new Set(ai.keyword),hu=new Set(ai.strict),lu=new Set(ai.strictBind);function ea(r,t){return t&&r==="await"||r==="enum"}function ta(r,t){return ea(r,t)||hu.has(r)}function sa(r){return lu.has(r)}function ia(r,t){return ta(r,t)||sa(r)}function cu(r){return uu.has(r)}function pu(r,t,e){return r===64&&t===64&&ee(e)}var fu=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 du(r){return fu.has(r)}var Le=0,Oe=1,se=2,ni=4,ra=8,Wt=16,aa=32,Te=64,zt=128,Be=256,Mt=Oe|se|zt|Be,X=1,Se=2,na=4,Ae=8,Rt=16,oa=64,Ht=128,_s=256,Ls=512,oi=1024,Os=2048,at=4096,Yt=8192,ua=X|Se|Ae|Ht|Yt,Fe=X|0|Ae|Yt,mu=X|0|Ae|0,Kt=X|0|na|0,ha=X|0|Rt|0,yu=0|Se|0|Ht,xu=0|Se|0|0,la=X|Se|Ae|_s|Yt,Fr=0|oi,le=0|oa,gu=X|0|0|oa,bu=la|Ls,Pu=0|oi,Rr=0|Se|0|at,Tu=Os,Gt=4,ui=2,hi=1,As=ui|hi,Au=ui|Gt,Su=hi|Gt,wu=ui,Eu=hi,Ss=0,ot=class{constructor(t){this.var=new Set,this.lexical=new Set,this.functions=new Set,this.flags=t}},ut=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&Oe)>0}get inFunction(){return(this.currentVarScopeFlags()&se)>0}get allowSuper(){return(this.currentThisScopeFlags()&Wt)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&aa)>0}get inClass(){return(this.currentThisScopeFlags()&Te)>0}get inClassAndNotInNonArrowFunction(){let t=this.currentThisScopeFlags();return(t&Te)>0&&(t&se)===0}get inStaticBlock(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&zt)return!0;if(e&(Mt|Te))return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&se)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(t){return new ot(t)}enter(t){this.scopeStack.push(this.createScope(t))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(t){return!!(t.flags&(se|zt)||!this.parser.inModule&&t.flags&Oe)}declareName(t,e,s){let i=this.currentScope();if(e&Ae||e&Rt)this.checkRedeclarationInScope(i,t,e,s),e&Rt?i.functions.add(t):i.lexical.add(t),e&Ae&&this.maybeExportDefined(i,t);else if(e&na)for(let a=this.scopeStack.length-1;a>=0&&(i=this.scopeStack[a],this.checkRedeclarationInScope(i,t,e,s),i.var.add(t),this.maybeExportDefined(i,t),!(i.flags&Mt));--a);this.parser.inModule&&i.flags&Oe&&this.undefinedExports.delete(t)}maybeExportDefined(t,e){this.parser.inModule&&t.flags&Oe&&this.undefinedExports.delete(e)}checkRedeclarationInScope(t,e,s,i){this.isRedeclaredInScope(t,e,s)&&this.parser.raise(c.VarRedeclaration,{at:i,identifierName:e})}isRedeclaredInScope(t,e,s){return s&X?s&Ae?t.lexical.has(e)||t.functions.has(e)||t.var.has(e):s&Rt?t.lexical.has(e)||!this.treatFunctionsAsVarInScope(t)&&t.var.has(e):t.lexical.has(e)&&!(t.flags&ra&&t.lexical.values().next().value===e)||!this.treatFunctionsAsVarInScope(t)&&t.functions.has(e):!1}checkLocalExport(t){let{name:e}=t,s=this.scopeStack[0];!s.lexical.has(e)&&!s.var.has(e)&&!s.functions.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&Mt)return e}}currentThisScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&(Mt|Te)&&!(e&ni))return e}}},Ms=class extends ot{constructor(...t){super(...t),this.declareFunctions=new Set}},Ds=class extends ut{createScope(t){return new Ms(t)}declareName(t,e,s){let i=this.currentScope();if(e&Os){this.checkRedeclarationInScope(i,t,e,s),this.maybeExportDefined(i,t),i.declareFunctions.add(t);return}super.declareName(t,e,s)}isRedeclaredInScope(t,e,s){return super.isRedeclaredInScope(t,e,s)?!0:s&Os?!t.declareFunctions.has(e)&&(t.lexical.has(e)||t.functions.has(e)):!1}checkLocalExport(t){this.scopeStack[0].declareFunctions.has(t.name)||super.checkLocalExport(t)}},Bs=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 i=this.plugins.get(e);for(let a of Object.keys(s))if((i==null?void 0:i[a])!==s[a])return!1;return!0}}getPluginOption(t,e){var s;return(s=this.plugins.get(t))==null?void 0:s[e]}};function ca(r,t){r.trailingComments===void 0?r.trailingComments=t:r.trailingComments.unshift(...t)}function vu(r,t){r.leadingComments===void 0?r.leadingComments=t:r.leadingComments.unshift(...t)}function ht(r,t){r.innerComments===void 0?r.innerComments=t:r.innerComments.unshift(...t)}function tt(r,t,e){let s=null,i=t.length;for(;s===null&&i>0;)s=t[--i];s===null||s.start>e.start?ht(r,e.comments):ca(s,e.comments)}var Fs=class extends Bs{addComment(t){this.filename&&(t.loc.filename=this.filename),this.state.comments.push(t)}processComment(t){let{commentStack:e}=this.state,s=e.length;if(s===0)return;let i=s-1,a=e[i];a.start===t.end&&(a.leadingNode=t,i--);let{start:n}=t;for(;i>=0;i--){let o=e[i],u=o.end;if(u>n)o.containingNode=t,this.finalizeComment(o),e.splice(i,1);else{u===n&&(o.trailingNode=t);break}}}finalizeComment(t){let{comments:e}=t;if(t.leadingNode!==null||t.trailingNode!==null)t.leadingNode!==null&&ca(t.leadingNode,e),t.trailingNode!==null&&vu(t.trailingNode,e);else{let{containingNode:s,start:i}=t;if(this.input.charCodeAt(i-1)===44)switch(s.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":tt(s,s.properties,t);break;case"CallExpression":case"OptionalCallExpression":tt(s,s.arguments,t);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":tt(s,s.params,t);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":tt(s,s.elements,t);break;case"ExportNamedDeclaration":case"ImportDeclaration":tt(s,s.specifiers,t);break;default:ht(s,e)}else ht(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 i=e[s-1];i.leadingNode===t&&(i.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:i}=this.state,a=i.length;if(a===0)return;let n=a-1;for(;n>=0;n--){let o=i[n],u=o.end;if(o.start===s)o.leadingNode=t;else if(u===e)o.trailingNode=t;else if(u<e)break}}},pa=/\r\n?|[\n\u2028\u2029]/,Dt=new RegExp(pa.source,"g");function nt(r){switch(r){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}var ws=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Ut=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g,Ur=new RegExp("(?=("+Ut.source+"))\\1"+/(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source,"y");function Cu(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 lt=class{constructor(){this.strict=void 0,this.curLine=void 0,this.lineStart=void 0,this.startLoc=void 0,this.endLoc=void 0,this.errors=[],this.potentialArrowAt=-1,this.noArrowAt=[],this.noArrowParamsConversionAt=[],this.maybeInArrowParameters=!1,this.inType=!1,this.noAnonFunctionType=!1,this.hasFlowComment=!1,this.isAmbientContext=!1,this.inAbstractClass=!1,this.inDisallowConditionalTypesContext=!1,this.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null},this.soloAwait=!1,this.inFSharpPipelineDirectBody=!1,this.labels=[],this.comments=[],this.commentStack=[],this.pos=0,this.type=137,this.value=null,this.start=0,this.end=0,this.lastTokEndLoc=null,this.lastTokStartLoc=null,this.lastTokStart=0,this.context=[k.brace],this.canStartJSXElement=!0,this.containsEsc=!1,this.firstInvalidTemplateEscapePos=null,this.strictErrors=new Map,this.tokensLength=0}init({strictMode:t,sourceType:e,startLine:s,startColumn:i}){this.strict=t===!1?!1:t===!0?!0:e==="module",this.curLine=s,this.lineStart=-i,this.startLoc=this.endLoc=new G(s,i,0)}curPosition(){return new G(this.curLine,this.pos-this.lineStart,this.pos)}clone(t){let e=new lt,s=Object.keys(this);for(let i=0,a=s.length;i<a;i++){let n=s[i],o=this[n];!t&&Array.isArray(o)&&(o=o.slice()),e[n]=o}return e}},Iu=function(t){return t>=48&&t<=57},jr={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},Bt={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 $r(r,t,e,s,i,a){let n=e,o=s,u=i,h="",l=null,p=e,{length:f}=t;for(;;){if(e>=f){a.unterminated(n,o,u),h+=t.slice(p,e);break}let d=t.charCodeAt(e);if(Nu(r,d,t,e)){h+=t.slice(p,e);break}if(d===92){h+=t.slice(p,e);let m=ku(t,e,s,i,r==="template",a);m.ch===null&&!l?l={pos:e,lineStart:s,curLine:i}:h+=m.ch,{pos:e,lineStart:s,curLine:i}=m,p=e}else d===8232||d===8233?(++e,++i,s=e):d===10||d===13?r==="template"?(h+=t.slice(p,e)+`
|
|
11
|
+
`,++e,d===13&&t.charCodeAt(e)===10&&++e,++i,p=s=e):a.unterminated(n,o,u):++e}return{pos:e,str:h,firstInvalidLoc:l,lineStart:s,curLine:i,containsInvalid:!!l}}function Nu(r,t,e,s){return r==="template"?t===96||t===36&&e.charCodeAt(s+1)===123:t===(r==="double"?34:39)}function ku(r,t,e,s,i,a){let n=!i;t++;let o=h=>({pos:t,ch:h,lineStart:e,curLine:s}),u=r.charCodeAt(t++);switch(u){case 110:return o(`
|
|
12
|
+
`);case 114:return o("\r");case 120:{let h;return{code:h,pos:t}=Rs(r,t,e,s,2,!1,n,a),o(h===null?null:String.fromCharCode(h))}case 117:{let h;return{code:h,pos:t}=da(r,t,e,s,n,a),o(h===null?null:String.fromCodePoint(h))}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(i)return o(null);a.strictNumericEscape(t-1,e,s);default:if(u>=48&&u<=55){let h=t-1,p=r.slice(h,t+2).match(/^[0-7]+/)[0],f=parseInt(p,8);f>255&&(p=p.slice(0,-1),f=parseInt(p,8)),t+=p.length-1;let d=r.charCodeAt(t);if(p!=="0"||d===56||d===57){if(i)return o(null);a.strictNumericEscape(h,e,s)}return o(String.fromCharCode(f))}return o(String.fromCharCode(u))}}function Rs(r,t,e,s,i,a,n,o){let u=t,h;return{n:h,pos:t}=fa(r,t,e,s,16,i,a,!1,o,!n),h===null&&(n?o.invalidEscapeSequence(u,e,s):t=u-1),{code:h,pos:t}}function fa(r,t,e,s,i,a,n,o,u,h){let l=t,p=i===16?jr.hex:jr.decBinOct,f=i===16?Bt.hex:i===10?Bt.dec:i===8?Bt.oct:Bt.bin,d=!1,m=0;for(let y=0,P=a??1/0;y<P;++y){let S=r.charCodeAt(t),_;if(S===95&&o!=="bail"){let R=r.charCodeAt(t-1),M=r.charCodeAt(t+1);if(o){if(Number.isNaN(M)||!f(M)||p.has(R)||p.has(M)){if(h)return{n:null,pos:t};u.unexpectedNumericSeparator(t,e,s)}}else{if(h)return{n:null,pos:t};u.numericSeparatorInEscapeSequence(t,e,s)}++t;continue}if(S>=97?_=S-97+10:S>=65?_=S-65+10:Iu(S)?_=S-48:_=1/0,_>=i){if(_<=9&&h)return{n:null,pos:t};if(_<=9&&u.invalidDigit(t,e,s,i))_=0;else if(n)_=0,d=!0;else break}++t,m=m*i+_}return t===l||a!=null&&t-l!==a||d?{n:null,pos:t}:{n:m,pos:t}}function da(r,t,e,s,i,a){let n=r.charCodeAt(t),o;if(n===123){if(++t,{code:o,pos:t}=Rs(r,t,e,s,r.indexOf("}",t)-t,!0,i,a),++t,o!==null&&o>1114111)if(i)a.invalidCodePoint(t,e,s);else return{code:null,pos:t}}else({code:o,pos:t}=Rs(r,t,e,s,4,!1,i,a));return{code:o,pos:t}}var _u=["at"],Lu=["at"];function st(r,t,e){return new G(e,r-t,r)}var Ou=new Set([103,109,115,105,121,117,100,118]),K=class{constructor(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,this.loc=new je(t.startLoc,t.endLoc)}},Us=class extends Fs{constructor(t,e){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(s,i,a,n)=>this.options.errorRecovery?(this.raise(c.InvalidDigit,{at:st(s,i,a),radix:n}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(c.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(c.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(c.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(c.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(s,i,a)=>{this.recordStrictModeErrors(c.StrictNumericEscape,{at:st(s,i,a)})},unterminated:(s,i,a)=>{throw this.raise(c.UnterminatedString,{at:st(s-1,i,a)})}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(c.StrictNumericEscape),unterminated:(s,i,a)=>{throw this.raise(c.UnterminatedTemplate,{at:st(s,i,a)})}}),this.state=new lt,this.state.init(t),this.input=e,this.length=e.length,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 K(this.state)),this.state.lastTokStart=this.state.start,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 ws.lastIndex=t,ws.test(this.input)?ws.lastIndex:t}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(t){return Ut.lastIndex=t,Ut.test(this.input)?Ut.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,{at: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(137);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(t){let e;this.isLookahead||(e=this.state.curPosition());let s=this.state.pos,i=this.input.indexOf(t,s+2);if(i===-1)throw this.raise(c.UnterminatedComment,{at:this.state.curPosition()});for(this.state.pos=i+t.length,Dt.lastIndex=s+2;Dt.test(this.input)&&Dt.lastIndex<=i;)++this.state.curLine,this.state.lineStart=Dt.lastIndex;if(this.isLookahead)return;let a={type:"CommentBlock",value:this.input.slice(s+2,i),start:s,end:i+t.length,loc:new je(e,this.state.curPosition())};return this.options.tokens&&this.pushToken(a),a}skipLineComment(t){let e=this.state.pos,s;this.isLookahead||(s=this.state.curPosition());let i=this.input.charCodeAt(this.state.pos+=t);if(this.state.pos<this.length)for(;!nt(i)&&++this.state.pos<this.length;)i=this.input.charCodeAt(this.state.pos);if(this.isLookahead)return;let a=this.state.pos,o={type:"CommentLine",value:this.input.slice(e+t,a),start:e,end:a,loc:new je(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 i=this.skipBlockComment("*/");i!==void 0&&(this.addComment(i),this.options.attachComment&&e.push(i));break}case 47:{let i=this.skipLineComment(2);i!==void 0&&(this.addComment(i),this.options.attachComment&&e.push(i));break}default:break e}break;default:if(Cu(s))++this.state.pos;else if(s===45&&!this.inModule&&this.options.annexB){let i=this.state.pos;if(this.input.charCodeAt(i+1)===45&&this.input.charCodeAt(i+2)===62&&(t===0||this.state.lineStart>t)){let a=this.skipLineComment(3);a!==void 0&&(this.addComment(a),this.options.attachComment&&e.push(a))}else break e}else if(s===60&&!this.inModule&&this.options.annexB){let i=this.state.pos;if(this.input.charCodeAt(i+1)===33&&this.input.charCodeAt(i+2)===45&&this.input.charCodeAt(i+3)===45){let a=this.skipLineComment(4);a!==void 0&&(this.addComment(a),this.options.attachComment&&e.push(a))}else break e}else break e}}if(e.length>0){let s=this.state.pos,i={start:t,end:s,comments:e,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(i)}}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(c.UnexpectedDigitAfterHash,{at:this.state.curPosition()});if(e===123||e===91&&this.hasPlugin("recordAndTuple")){if(this.expectPlugin("recordAndTuple"),this.getPluginOption("recordAndTuple","syntaxType")==="bar")throw this.raise(e===123?c.RecordExpressionHashIncorrectStartSyntaxType:c.TupleExpressionHashIncorrectStartSyntaxType,{at:this.state.curPosition()});this.state.pos+=2,e===123?this.finishToken(7):this.finishToken(1)}else ee(e)?(++this.state.pos,this.finishToken(136,this.readWord1(e))):e===92?(++this.state.pos,this.finishToken(136,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;!nt(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,i=this.input.charCodeAt(this.state.pos+1);t===42&&i===42&&(s++,i=this.input.charCodeAt(this.state.pos+2),e=57),i===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(c.RecordExpressionBarIncorrectEndSyntaxType,{at:this.state.curPosition()});this.state.pos+=2,this.finishToken(9);return}if(this.hasPlugin("recordAndTuple")&&e===93){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(c.TupleExpressionBarIncorrectEndSyntaxType,{at: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(c.TupleExpressionBarIncorrectStartSyntaxType,{at:this.state.curPosition()});this.state.pos+=2,this.finishToken(2)}else++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(3);return;case 123:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(c.RecordExpressionBarIncorrectStartSyntaxType,{at:this.state.curPosition()});this.state.pos+=2,this.finishToken(6)}else++this.state.pos,this.finishToken(5);return;case 125:++this.state.pos,this.finishToken(8);return;case 58:this.hasPlugin("functionBind")&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(15,2):(++this.state.pos,this.finishToken(14));return;case 63:this.readToken_question();return;case 96:this.readTemplateToken();return;case 48:{let e=this.input.charCodeAt(this.state.pos+1);if(e===120||e===88){this.readRadixNumber(16);return}if(e===111||e===79){this.readRadixNumber(8);return}if(e===98||e===66){this.readRadixNumber(2);return}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:this.readNumber(!1);return;case 34:case 39:this.readString(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(ee(t)){this.readWord(t);return}}throw this.raise(c.InvalidOrUnexpectedToken,{at: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,i,{pos:a}=this.state;for(;;++a){if(a>=this.length)throw this.raise(c.UnterminatedRegExp,{at:$(t,1)});let h=this.input.charCodeAt(a);if(nt(h))throw this.raise(c.UnterminatedRegExp,{at:$(t,1)});if(s)s=!1;else{if(h===91)i=!0;else if(h===93&&i)i=!1;else if(h===47&&!i)break;s=h===92}}let n=this.input.slice(e,a);++a;let o="",u=()=>$(t,a+2-e);for(;a<this.length;){let h=this.codePointAtPos(a),l=String.fromCharCode(h);if(Ou.has(h))h===118?o.includes("u")&&this.raise(c.IncompatibleRegExpUVFlags,{at:u()}):h===117&&o.includes("v")&&this.raise(c.IncompatibleRegExpUVFlags,{at:u()}),o.includes(l)&&this.raise(c.DuplicateRegExpFlags,{at:u()});else if(De(h)||h===92)this.raise(c.MalformedRegExpFlags,{at:u()});else break;++a,o+=l}this.state.pos=a,this.finishToken(135,{pattern:n,flags:o})}readInt(t,e,s=!1,i=!0){let{n:a,pos:n}=fa(this.input,this.state.pos,this.state.lineStart,this.state.curLine,t,e,s,i,this.errorHandlers_readInt,!1);return this.state.pos=n,a}readRadixNumber(t){let e=this.state.curPosition(),s=!1;this.state.pos+=2;let i=this.readInt(t);i==null&&this.raise(c.InvalidDigit,{at:$(e,2),radix:t});let a=this.input.charCodeAt(this.state.pos);if(a===110)++this.state.pos,s=!0;else if(a===109)throw this.raise(c.InvalidDecimal,{at:e});if(ee(this.codePointAtPos(this.state.pos)))throw this.raise(c.NumberIdentifier,{at:this.state.curPosition()});if(s){let n=this.input.slice(e.index,this.state.pos).replace(/[_n]/g,"");this.finishToken(133,n);return}this.finishToken(132,i)}readNumber(t){let e=this.state.pos,s=this.state.curPosition(),i=!1,a=!1,n=!1,o=!1,u=!1;!t&&this.readInt(10)===null&&this.raise(c.InvalidNumber,{at:this.state.curPosition()});let h=this.state.pos-e>=2&&this.input.charCodeAt(e)===48;if(h){let d=this.input.slice(e,this.state.pos);if(this.recordStrictModeErrors(c.StrictOctalLiteral,{at:s}),!this.state.strict){let m=d.indexOf("_");m>0&&this.raise(c.ZeroDigitNumericSeparator,{at:$(s,m)})}u=h&&!/[89]/.test(d)}let l=this.input.charCodeAt(this.state.pos);if(l===46&&!u&&(++this.state.pos,this.readInt(10),i=!0,l=this.input.charCodeAt(this.state.pos)),(l===69||l===101)&&!u&&(l=this.input.charCodeAt(++this.state.pos),(l===43||l===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(c.InvalidOrMissingExponent,{at:s}),i=!0,o=!0,l=this.input.charCodeAt(this.state.pos)),l===110&&((i||h)&&this.raise(c.InvalidBigIntLiteral,{at:s}),++this.state.pos,a=!0),l===109&&(this.expectPlugin("decimal",this.state.curPosition()),(o||h)&&this.raise(c.InvalidDecimal,{at:s}),++this.state.pos,n=!0),ee(this.codePointAtPos(this.state.pos)))throw this.raise(c.NumberIdentifier,{at:this.state.curPosition()});let p=this.input.slice(e,this.state.pos).replace(/[_mn]/g,"");if(a){this.finishToken(133,p);return}if(n){this.finishToken(134,p);return}let f=u?parseInt(p,8):parseFloat(p);this.finishToken(132,f)}readCodePoint(t){let{code:e,pos:s}=da(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:i,lineStart:a}=$r(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=a,this.state.curLine=i,this.finishToken(131,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:i,curLine:a,lineStart:n}=$r("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=i+1,this.state.lineStart=n,this.state.curLine=a,s&&(this.state.firstInvalidTemplateEscapePos=new G(s.curLine,s.pos-s.lineStart,s.pos)),this.input.codePointAt(i)===96?this.finishToken(24,s?null:t+e+"`"):(this.state.pos++,this.finishToken(25,s?null:t+e+"${"))}recordStrictModeErrors(t,{at:e}){let s=e.index;this.state.strict&&!this.state.strictErrors.has(s)?this.raise(t,{at:e}):this.state.strictErrors.set(s,[t,e])}readWord1(t){this.state.containsEsc=!1;let e="",s=this.state.pos,i=this.state.pos;for(t!==void 0&&(this.state.pos+=t<=65535?1:2);this.state.pos<this.length;){let a=this.codePointAtPos(this.state.pos);if(De(a))this.state.pos+=a<=65535?1:2;else if(a===92){this.state.containsEsc=!0,e+=this.input.slice(i,this.state.pos);let n=this.state.curPosition(),o=this.state.pos===s?ee:De;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(c.MissingUnicodeEscape,{at:this.state.curPosition()}),i=this.state.pos-1;continue}++this.state.pos;let u=this.readCodePoint(!0);u!==null&&(o(u)||this.raise(c.EscapedCharNotAnIdentifier,{at:n}),e+=String.fromCodePoint(u)),i=this.state.pos}else break}return e+this.input.slice(i,this.state.pos)}readWord(t){let e=this.readWord1(t),s=Ys.get(e);s!==void 0?this.finishToken(s,ce(s)):this.finishToken(130,e)}checkKeywordEscapes(){let{type:t}=this.state;ii(t)&&this.state.containsEsc&&this.raise(c.InvalidEscapedReservedWord,{at:this.state.startLoc,reservedWord:ce(t)})}raise(t,e){let{at:s}=e,i=$t(e,_u),a=s instanceof G?s:s.loc.start,n=t({loc:a,details:i});if(!this.options.errorRecovery)throw n;return this.isLookahead||this.state.errors.push(n),n}raiseOverwrite(t,e){let{at:s}=e,i=$t(e,Lu),a=s instanceof G?s:s.loc.start,n=a.index,o=this.state.errors;for(let u=o.length-1;u>=0;u--){let h=o[u];if(h.loc.index===n)return o[u]=t({loc:a,details:i});if(h.loc.index<n)break}return this.raise(t,e)}updateContext(t){}unexpected(t,e){throw this.raise(c.UnexpectedToken,{expected:e?ce(e):null,at:t??this.state.startLoc})}expectPlugin(t,e){if(this.hasPlugin(t))return!0;throw this.raise(c.MissingPlugin,{at:e??this.state.startLoc,missingPlugin:[t]})}expectOnePlugin(t){if(!t.some(e=>this.hasPlugin(e)))throw this.raise(c.MissingOneOfPlugins,{at:this.state.startLoc,missingPlugin:t})}errorBuilder(t){return(e,s,i)=>{this.raise(t,{at:st(e,s,i)})}}},js=class{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}},$s=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 js)}exit(){let t=this.stack.pop(),e=this.current();for(let[s,i]of Array.from(t.undefinedPrivateNames))e?e.undefinedPrivateNames.has(s)||e.undefinedPrivateNames.set(s,i):this.parser.raise(c.InvalidPrivateFieldResolution,{at:i,identifierName:s})}declarePrivateName(t,e,s){let{privateNames:i,loneAccessors:a,undefinedPrivateNames:n}=this.current(),o=i.has(t);if(e&As){let u=o&&a.get(t);if(u){let h=u&Gt,l=e&Gt,p=u&As,f=e&As;o=p===f||h!==l,o||a.delete(t)}else o||a.set(t,e)}o&&this.parser.raise(c.PrivateNameRedeclaration,{at:s,identifierName:t}),i.add(t),n.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(c.InvalidPrivateFieldResolution,{at:e,identifierName:t})}},Mu=0,ma=1,li=2,ya=3,$e=class{constructor(t=Mu){this.type=void 0,this.type=t}canBeArrowParameterDeclaration(){return this.type===li||this.type===ma}isCertainlyParameterDeclaration(){return this.type===ya}},Xt=class extends $e{constructor(t){super(t),this.declarationErrors=new Map}recordDeclarationError(t,{at:e}){let s=e.index;this.declarationErrors.set(s,[t,e])}clearDeclarationError(t){this.declarationErrors.delete(t)}iterateErrors(t){this.declarationErrors.forEach(t)}},qs=class{constructor(t){this.parser=void 0,this.stack=[new $e],this.parser=t}enter(t){this.stack.push(t)}exit(){this.stack.pop()}recordParameterInitializerError(t,{at:e}){let s={at:e.loc.start},{stack:i}=this,a=i.length-1,n=i[a];for(;!n.isCertainlyParameterDeclaration();){if(n.canBeArrowParameterDeclaration())n.recordDeclarationError(t,s);else return;n=i[--a]}this.parser.raise(t,s)}recordArrowParameterBindingError(t,{at:e}){let{stack:s}=this,i=s[s.length-1],a={at:e.loc.start};if(i.isCertainlyParameterDeclaration())this.parser.raise(t,a);else if(i.canBeArrowParameterDeclaration())i.recordDeclarationError(t,a);else return}recordAsyncArrowParametersError({at:t}){let{stack:e}=this,s=e.length-1,i=e[s];for(;i.canBeArrowParameterDeclaration();)i.type===li&&i.recordDeclarationError(c.AwaitBindingIdentifier,{at:t}),i=e[--s]}validateAsPattern(){let{stack:t}=this,e=t[t.length-1];e.canBeArrowParameterDeclaration()&&e.iterateErrors(([s,i])=>{this.parser.raise(s,{at:i});let a=t.length-2,n=t[a];for(;n.canBeArrowParameterDeclaration();)n.clearDeclarationError(i.index),n=t[--a]})}};function Du(){return new $e(ya)}function Bu(){return new Xt(ma)}function Fu(){return new Xt(li)}function xa(){return new $e}var Re=0,ga=1,Qt=2,ba=4,_e=8,Vs=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()&Qt)>0}get hasYield(){return(this.currentFlags()&ga)>0}get hasReturn(){return(this.currentFlags()&ba)>0}get hasIn(){return(this.currentFlags()&_e)>0}};function jt(r,t){return(r?Qt:0)|(t?ga:0)}var Ws=class extends Us{addExtra(t,e,s,i=!0){if(!t)return;let a=t.extra=t.extra||{};i?a[e]=s:Object.defineProperty(a,e,{enumerable:i,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 i=this.input.charCodeAt(s);return!(De(i)||(i&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,{at:this.state.startLoc});this.unexpected(null,t)}}canInsertSemicolon(){return this.match(137)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return pa.test(this.input.slice(this.state.lastTokEndLoc.index,this.state.start))}hasFollowingLineBreak(){return Ur.lastIndex=this.state.end,Ur.test(this.input)}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(t=!0){(t?this.isLineTerminator():this.eat(13))||this.raise(c.MissingSemicolon,{at: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 i=t((a=null)=>{throw s.node=a,s});if(this.state.errors.length>e.errors.length){let a=this.state;return this.state=e,this.state.tokensLength=a.tokensLength,{node:i,error:a.errors[e.errors.length],thrown:!1,aborted:!1,failState:a}}return{node:i,error:null,thrown:!1,aborted:!1,failState:null}}catch(i){let a=this.state;if(this.state=e,i instanceof SyntaxError)return{node:null,error:i,thrown:!0,aborted:!1,failState:a};if(i===s)return{node:s.node,error:null,thrown:!1,aborted:!0,failState:a};throw i}}checkExpressionErrors(t,e){if(!t)return!1;let{shorthandAssignLoc:s,doubleProtoLoc:i,privateKeyLoc:a,optionalParametersLoc:n}=t,o=!!s||!!i||!!n||!!a;if(!e)return o;s!=null&&this.raise(c.InvalidCoverInitializedName,{at:s}),i!=null&&this.raise(c.DuplicateProto,{at:i}),a!=null&&this.raise(c.UnexpectedPrivateField,{at:a}),n!=null&&this.unexpected(n)}isLiteralPropertyName(){return Yr(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 i=this.inModule;this.inModule=t;let a=this.scope,n=this.getScopeHandler();this.scope=new n(this,t);let o=this.prodParam;this.prodParam=new Vs;let u=this.classScope;this.classScope=new $s(this);let h=this.expressionScope;return this.expressionScope=new qs(this),()=>{this.state.labels=e,this.exportedIdentifiers=s,this.inModule=i,this.scope=a,this.prodParam=o,this.classScope=u,this.expressionScope=h}}enterInitialScopes(){let t=Re;this.inModule&&(t|=Qt),this.scope.enter(Oe),this.prodParam.enter(t)}checkDestructuringPrivate(t){let{privateKeyLoc:e}=t;e!==null&&this.expectPlugin("destructuringPrivate",e)}},Ue=class{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null}},qe=class{constructor(t,e,s){this.type="",this.start=e,this.end=0,this.loc=new je(s),t!=null&&t.options.ranges&&(this.range=[e,0]),t!=null&&t.filename&&(this.loc.filename=t.filename)}},ci=qe.prototype;ci.__clone=function(){let r=new qe(void 0,this.start,this.loc.start),t=Object.keys(this);for(let e=0,s=t.length;e<s;e++){let i=t[e];i!=="leadingComments"&&i!=="trailingComments"&&i!=="innerComments"&&(r[i]=this[i])}return r};function Ru(r){return ie(r)}function ie(r){let{type:t,start:e,end:s,loc:i,range:a,extra:n,name:o}=r,u=Object.create(ci);return u.type=t,u.start=e,u.end=s,u.loc=i,u.range=a,u.extra=n,u.name=o,t==="Placeholder"&&(u.expectedNode=r.expectedNode),u}function Uu(r){let{type:t,start:e,end:s,loc:i,range:a,extra:n}=r;if(t==="Placeholder")return Ru(r);let o=Object.create(ci);return o.type=t,o.start=e,o.end=s,o.loc=i,o.range=a,r.raw!==void 0?o.raw=r.raw:o.extra=n,o.value=r.value,o}var zs=class extends Ws{startNode(){return new qe(this,this.state.start,this.state.startLoc)}startNodeAt(t){return new qe(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)}},ju=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),A=te`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}\`.`,EnumStringMemberInconsistentlyInitailized:({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 $u(r){return r.type==="DeclareExportAllDeclaration"||r.type==="DeclareExportDeclaration"&&(!r.declaration||r.declaration.type!=="TypeAlias"&&r.declaration.type!=="InterfaceDeclaration")}function qr(r){return r.importKind==="type"||r.importKind==="typeof"}var qu={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function Vu(r,t){let e=[],s=[];for(let i=0;i<r.length;i++)(t(r[i],i,r)?e:s).push(r[i]);return[e,s]}var Wu=/\*?\s*@((?:no)?flow)\b/,zu=r=>class extends r{constructor(...e){super(...e),this.flowPragma=void 0}getScopeHandler(){return Ds}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}shouldParseEnums(){return!!this.getPluginOption("flow","enums")}finishToken(e,s){e!==131&&e!==13&&e!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,s)}addComment(e){if(this.flowPragma===void 0){let s=Wu.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 i=this.flowParseType();return this.state.inType=s,i}flowParsePredicate(){let e=this.startNode(),s=this.state.startLoc;return this.next(),this.expectContextual(108),this.state.lastTokStart>s.index+1&&this.raise(A.UnexpectedSpaceBetweenModuloChecks,{at: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,i=null;return this.match(54)?(this.state.inType=e,i=this.flowParsePredicate()):(s=this.flowParseType(),this.state.inType=e,this.match(54)&&(i=this.flowParsePredicate())),[s,i]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")}flowParseDeclareFunction(e){this.next();let s=e.id=this.parseIdentifier(),i=this.startNode(),a=this.startNode();this.match(47)?i.typeParameters=this.flowParseTypeParameterDeclaration():i.typeParameters=null,this.expect(10);let n=this.flowParseFunctionTypeParams();return i.params=n.params,i.rest=n.rest,i.this=n._this,this.expect(11),[i.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),a.typeAnnotation=this.finishNode(i,"FunctionTypeAnnotation"),s.typeAnnotation=this.finishNode(a,"TypeAnnotation"),this.resetEndLocation(s),this.semicolon(),this.scope.declareName(e.id.name,Tu,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(125))return this.match(16)?this.flowParseDeclareModuleExports(e):(s&&this.raise(A.NestedDeclareModule,{at:this.state.lastTokStartLoc}),this.flowParseDeclareModule(e));if(this.isContextual(128))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(129))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(127))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,Kt,e.id.loc.start),this.semicolon(),this.finishNode(e,"DeclareVariable")}flowParseDeclareModule(e){this.scope.enter(Le),this.match(131)?e.id=super.parseExprAtom():e.id=this.parseIdentifier();let s=e.body=this.startNode(),i=s.body=[];for(this.expect(5);!this.match(8);){let o=this.startNode();this.match(83)?(this.next(),!this.isContextual(128)&&!this.match(87)&&this.raise(A.InvalidNonTypeImportInDeclareModule,{at:this.state.lastTokStartLoc}),super.parseImport(o)):(this.expectContextual(123,A.UnsupportedStatementInDeclareModule),o=this.flowParseDeclare(o,!0)),i.push(o)}this.scope.exit(),this.expect(8),this.finishNode(s,"BlockStatement");let a=null,n=!1;return i.forEach(o=>{$u(o)?(a==="CommonJS"&&this.raise(A.AmbiguousDeclareModuleKind,{at:o}),a="ES"):o.type==="DeclareModuleExports"&&(n&&this.raise(A.DuplicateDeclareModuleExports,{at:o}),a==="ES"&&this.raise(A.AmbiguousDeclareModuleKind,{at:o}),a="CommonJS",n=!0)}),e.kind=a||"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(128)||this.isContextual(127))&&!s){let i=this.state.value;throw this.raise(A.UnsupportedDeclareExportKind,{at:this.state.startLoc,unsupportedExportKind:i,suggestion:qu[i]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(129))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration");if(this.match(55)||this.match(5)||this.isContextual(127)||this.isContextual(128)||this.isContextual(129))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(109),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?ha:Fe,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(115))do e.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(111))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(A.UnexpectedReservedUnderscore,{at:this.state.startLoc})}checkReservedType(e,s,i){ju.has(e)&&this.raise(i?A.AssignReservedType:A.UnexpectedReservedType,{at: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,Fe,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(128),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,Fe,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,i=this.startNode(),a=this.flowParseVariance(),n=this.flowParseTypeAnnotatableIdentifier();return i.name=n.name,i.variance=a,i.bound=n.typeAnnotation,this.match(29)?(this.eat(29),i.default=this.flowParseType()):e&&this.raise(A.MissingTypeParamDefault,{at:s}),this.finishNode(i,"TypeParameter")}flowParseTypeParameterDeclaration(){let e=this.state.inType,s=this.startNode();s.params=[],this.state.inType=!0,this.match(47)||this.match(140)?this.next():this.unexpected();let i=!1;do{let a=this.flowParseTypeParameter(i);s.params.push(a),a.default&&(i=!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 i=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=i,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(127),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(132)||this.match(131)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,s,i){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=i,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 i=this.startNode();return e.static=s,e.value=this.flowParseObjectTypeMethodish(i),this.finishNode(e,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:e,allowExact:s,allowSpread:i,allowProto:a,allowInexact:n}){let o=this.state.inType;this.state.inType=!0;let u=this.startNode();u.callProperties=[],u.properties=[],u.indexers=[],u.internalSlots=[];let h,l,p=!1;for(s&&this.match(6)?(this.expect(6),h=9,l=!0):(this.expect(5),h=8,l=!1),u.exact=l;!this.match(h);){let d=!1,m=null,y=null,P=this.startNode();if(a&&this.isContextual(116)){let _=this.lookahead();_.type!==14&&_.type!==17&&(this.next(),m=this.state.startLoc,e=!1)}if(e&&this.isContextual(104)){let _=this.lookahead();_.type!==14&&_.type!==17&&(this.next(),d=!0)}let S=this.flowParseVariance();if(this.eat(0))m!=null&&this.unexpected(m),this.eat(0)?(S&&this.unexpected(S.loc.start),u.internalSlots.push(this.flowParseObjectTypeInternalSlot(P,d))):u.indexers.push(this.flowParseObjectTypeIndexer(P,d,S));else if(this.match(10)||this.match(47))m!=null&&this.unexpected(m),S&&this.unexpected(S.loc.start),u.callProperties.push(this.flowParseObjectTypeCallProperty(P,d));else{let _="init";if(this.isContextual(98)||this.isContextual(103)){let M=this.lookahead();Yr(M.type)&&(_=this.state.value,this.next())}let R=this.flowParseObjectTypeProperty(P,d,m,S,_,i,n??!l);R===null?(p=!0,y=this.state.lastTokStartLoc):u.properties.push(R)}this.flowObjectTypeSemicolon(),y&&!this.match(8)&&!this.match(9)&&this.raise(A.UnexpectedExplicitInexactInObject,{at:y})}this.expect(h),i&&(u.inexact=p);let f=this.finishNode(u,"ObjectTypeAnnotation");return this.state.inType=o,f}flowParseObjectTypeProperty(e,s,i,a,n,o,u){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(o?u||this.raise(A.InexactInsideExact,{at:this.state.lastTokStartLoc}):this.raise(A.InexactInsideNonObject,{at:this.state.lastTokStartLoc}),a&&this.raise(A.InexactVariance,{at:a}),null):(o||this.raise(A.UnexpectedSpreadType,{at:this.state.lastTokStartLoc}),i!=null&&this.unexpected(i),a&&this.raise(A.SpreadVariance,{at:a}),e.argument=this.flowParseType(),this.finishNode(e,"ObjectTypeSpreadProperty"));{e.key=this.flowParseObjectPropertyKey(),e.static=s,e.proto=i!=null,e.kind=n;let h=!1;return this.match(47)||this.match(10)?(e.method=!0,i!=null&&this.unexpected(i),a&&this.unexpected(a.loc.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start)),(n==="get"||n==="set")&&this.flowCheckGetterSetterParams(e),!o&&e.key.name==="constructor"&&e.value.this&&this.raise(A.ThisParamBannedInConstructor,{at:e.value.this})):(n!=="init"&&this.unexpected(),e.method=!1,this.eat(17)&&(h=!0),e.value=this.flowParseTypeInitialiser(),e.variance=a),e.optional=h,this.finishNode(e,"ObjectTypeProperty")}}flowCheckGetterSetterParams(e){let s=e.kind==="get"?0:1,i=e.value.params.length+(e.value.rest?1:0);e.value.this&&this.raise(e.kind==="get"?A.GetterMayNotHaveThisParam:A.SetterMayNotHaveThisParam,{at:e.value.this}),i!==s&&this.raise(e.kind==="get"?c.BadGetterArity:c.BadSetterArity,{at:e}),e.kind==="set"&&e.value.rest&&this.raise(c.BadSetterRestParameter,{at:e})}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,s){var i;(i=e)!=null||(e=this.state.startLoc);let a=s||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){let n=this.startNodeAt(e);n.qualification=a,n.id=this.flowParseRestrictedIdentifier(!0),a=this.finishNode(n,"QualifiedTypeIdentifier")}return a}flowParseGenericType(e,s){let i=this.startNodeAt(e);return i.typeParameters=null,i.id=this.flowParseQualifiedTypeIdentifier(e,s),this.match(47)&&(i.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(i,"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,i=!1,a=null,n=this.startNode(),o=this.lookahead(),u=this.state.type===78;return o.type===14||o.type===17?(u&&!e&&this.raise(A.ThisParamMustBeFirst,{at:n}),s=this.parseIdentifier(u),this.eat(17)&&(i=!0,u&&this.raise(A.ThisParamMayNotBeOptional,{at:n})),a=this.flowParseTypeInitialiser()):a=this.flowParseType(),n.name=s,n.optional=i,n.typeAnnotation=a,this.finishNode(n,"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,i=null;for(this.match(78)&&(i=this.flowParseFunctionTypeParam(!0),i.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:i}}flowIdentToTypeAnnotation(e,s,i){switch(i.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(i.name),this.flowParseGenericType(e,i)}}flowParsePrimaryType(){let e=this.state.startLoc,s=this.startNode(),i,a,n=!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,a=this.flowParseTupleType(),this.state.noAnonFunctionType=o,a;case 47:return s.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(10),i=this.flowParseFunctionTypeParams(),s.params=i.params,s.rest=i.rest,s.this=i._this,this.expect(11),this.expect(19),s.returnType=this.flowParseType(),this.finishNode(s,"FunctionTypeAnnotation");case 10:if(this.next(),!this.match(11)&&!this.match(21))if(N(this.state.type)||this.match(78)){let u=this.lookahead().type;n=u!==17&&u!==14}else n=!0;if(n){if(this.state.noAnonFunctionType=!1,a=this.flowParseType(),this.state.noAnonFunctionType=o,this.state.noAnonFunctionType||!(this.match(12)||this.match(11)&&this.lookahead().type===19))return this.expect(11),a;this.eat(12)}return a?i=this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(a)]):i=this.flowParseFunctionTypeParams(),s.params=i.params,s.rest=i.rest,s.this=i._this,this.expect(11),this.expect(19),s.returnType=this.flowParseType(),s.typeParameters=null,this.finishNode(s,"FunctionTypeAnnotation");case 131: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(132))return this.parseLiteralAtNode(-this.state.value,"NumberLiteralTypeAnnotation",s);if(this.match(133))return this.parseLiteralAtNode(-this.state.value,"BigIntLiteralTypeAnnotation",s);throw this.raise(A.UnexpectedSubtractionOperand,{at:this.state.startLoc})}this.unexpected();return;case 132:return this.parseLiteral(this.state.value,"NumberLiteralTypeAnnotation");case 133: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(ii(this.state.type)){let u=ce(this.state.type);return this.next(),super.createIdentifier(s,u)}else if(N(this.state.type))return this.isContextual(127)?this.flowParseInterfaceType():this.flowIdentToTypeAnnotation(e,s,this.parseIdentifier())}this.unexpected()}flowParsePostfixType(){let e=this.state.startLoc,s=this.flowParsePrimaryType(),i=!1;for(;(this.match(0)||this.match(18))&&!this.canInsertSemicolon();){let a=this.startNodeAt(e),n=this.eat(18);i=i||n,this.expect(0),!n&&this.match(3)?(a.elementType=s,this.next(),s=this.finishNode(a,"ArrayTypeAnnotation")):(a.objectType=s,a.indexType=this.flowParseType(),this.expect(3),i?(a.optional=n,s=this.finishNode(a,"OptionalIndexedAccessType")):s=this.finishNode(a,"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===130&&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,i=!1){if(s){this.forwardNoArrowParamsConversionAt(e,()=>super.parseFunctionBody(e,!0,i));return}super.parseFunctionBody(e,!1,i)}parseFunctionBodyAndFinish(e,s,i=!1){if(this.match(14)){let a=this.startNode();[a.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),e.returnType=a.typeAnnotation?this.finishNode(a,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(e,s,i)}parseStatementLike(e){if(this.state.strict&&this.isContextual(127)){let i=this.lookahead();if(W(i.type)){let a=this.startNode();return this.next(),this.flowParseInterface(a)}}else if(this.shouldParseEnums()&&this.isContextual(124)){let i=this.startNode();return this.next(),this.flowParseEnumDeclaration(i)}let s=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(s)&&(this.flowPragma=null),s}parseExpressionStatement(e,s,i){if(s.type==="Identifier"){if(s.name==="declare"){if(this.match(80)||N(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(e)}else if(N(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,i)}shouldParseExportDeclaration(){let{type:e}=this.state;return Br(e)||this.shouldParseEnums()&&e===124?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return Br(e)||this.shouldParseEnums()&&e===124?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.shouldParseEnums()&&this.isContextual(124)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,s,i){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(i),e}this.expect(17);let a=this.state.clone(),n=this.state.noArrowAt,o=this.startNodeAt(s),{consequent:u,failed:h}=this.tryParseConditionalConsequent(),[l,p]=this.getArrowLikeExpressions(u);if(h||p.length>0){let f=[...n];if(p.length>0){this.state=a,this.state.noArrowAt=f;for(let d=0;d<p.length;d++)f.push(p[d].start);({consequent:u,failed:h}=this.tryParseConditionalConsequent()),[l,p]=this.getArrowLikeExpressions(u)}h&&l.length>1&&this.raise(A.AmbiguousConditionalArrow,{at:a.startLoc}),h&&l.length===1&&(this.state=a,f.push(l[0].start),this.state.noArrowAt=f,{consequent:u,failed:h}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(u,!0),this.state.noArrowAt=n,this.expect(14),o.test=e,o.consequent=u,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 i=[e],a=[];for(;i.length!==0;){let n=i.pop();n.type==="ArrowFunctionExpression"?(n.typeParameters||!n.returnType?this.finishArrowValidation(n):a.push(n),i.push(n.body)):n.type==="ConditionalExpression"&&(i.push(n.consequent),i.push(n.alternate))}return s?(a.forEach(n=>this.finishArrowValidation(n)),[a,[]]):Vu(a,n=>n.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(se|ni),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,s){let i;return this.state.noArrowParamsConversionAt.indexOf(e.start)!==-1?(this.state.noArrowParamsConversionAt.push(this.state.start),i=s(),this.state.noArrowParamsConversionAt.pop()):i=s(),i}parseParenItem(e,s){if(e=super.parseParenItem(e,s),this.eat(17)&&(e.optional=!0,this.resetEndLocation(e)),this.match(14)){let i=this.startNodeAt(s);return i.expression=e,i.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(i,"TypeCastExpression")}return e}assertModuleNodeAllowed(e){e.type==="ImportDeclaration"&&(e.importKind==="type"||e.importKind==="typeof")||e.type==="ExportNamedDeclaration"&&e.exportKind==="type"||e.type==="ExportAllDeclaration"&&e.exportKind==="type"||super.assertModuleNodeAllowed(e)}parseExportDeclaration(e){if(this.isContextual(128)){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(129)){e.exportKind="type";let s=this.startNode();return this.next(),this.flowParseOpaqueType(s,!1)}else if(this.isContextual(127)){e.exportKind="type";let s=this.startNode();return this.next(),this.flowParseInterface(s)}else if(this.shouldParseEnums()&&this.isContextual(124)){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(128)&&this.lookahead().type===55?(e.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(e){let{startLoc:s}=this.state,i=super.maybeParseExportNamespaceSpecifier(e);return i&&e.exportKind==="type"&&this.unexpected(s),i}parseClassId(e,s,i){super.parseClassId(e,s,i),this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,s,i){let{startLoc:a}=this.state;if(this.isContextual(123)){if(super.parseClassMemberFromModifier(e,s))return;s.declare=!0}super.parseClassMember(e,s,i),s.declare&&(s.type!=="ClassProperty"&&s.type!=="ClassPrivateProperty"&&s.type!=="PropertyDefinition"?this.raise(A.DeclareClassElement,{at:a}):s.value&&this.raise(A.DeclareClassFieldInitializer,{at:s.value}))}isIterator(e){return e==="iterator"||e==="asyncIterator"}readIterator(){let e=super.readWord1(),s="@@"+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(c.InvalidIdentifier,{at:this.state.curPosition(),identifierName:s}),this.finishToken(130,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):pu(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,i){for(let a=0;a<e.length;a++){let n=e[a];(n==null?void 0:n.type)==="TypeCastExpression"&&(e[a]=this.typeCastToParameter(n))}super.toAssignableList(e,s,i)}toReferencedList(e,s){for(let a=0;a<e.length;a++){var i;let n=e[a];n&&n.type==="TypeCastExpression"&&!((i=n.extra)!=null&&i.parenthesized)&&(e.length>1||!s)&&this.raise(A.TypeCastInPattern,{at:n.typeAnnotation})}return e}parseArrayLike(e,s,i,a){let n=super.parseArrayLike(e,s,i,a);return s&&!this.state.maybeInArrowParameters&&this.toReferencedList(n.elements),n}isValidLVal(e,s,i){return e==="TypeCastExpression"||super.isValidLVal(e,s,i)}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,i,a,n,o){if(s.variance&&this.unexpected(s.variance.loc.start),delete s.variance,this.match(47)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,s,i,a,n,o),s.params&&n){let u=s.params;u.length>0&&this.isThisParam(u[0])&&this.raise(A.ThisParamBannedInConstructor,{at:s})}else if(s.type==="MethodDefinition"&&n&&s.value.params){let u=s.value.params;u.length>0&&this.isThisParam(u[0])&&this.raise(A.ThisParamBannedInConstructor,{at:s})}}pushClassPrivateMethod(e,s,i,a){s.variance&&this.unexpected(s.variance.loc.start),delete s.variance,this.match(47)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,s,i,a)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&this.match(47)&&(e.superTypeParameters=this.flowParseTypeParameterInstantiation()),this.isContextual(111)){this.next();let s=e.implements=[];do{let i=this.startNode();i.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?i.typeParameters=this.flowParseTypeParameterInstantiation():i.typeParameters=null,s.push(this.finishNode(i,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);let s=this.getObjectOrClassMethodParams(e);if(s.length>0){let i=s[0];this.isThisParam(i)&&e.kind==="get"?this.raise(A.GetterMayNotHaveThisParam,{at:i}):this.isThisParam(i)&&this.raise(A.SetterMayNotHaveThisParam,{at:i})}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,s,i,a,n,o,u){e.variance&&this.unexpected(e.variance.loc.start),delete e.variance;let h;this.match(47)&&!o&&(h=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());let l=super.parseObjPropValue(e,s,i,a,n,o,u);return h&&((l.value||l).typeParameters=h),l}parseAssignableListItemTypes(e){return this.eat(17)&&(e.type!=="Identifier"&&this.raise(A.PatternIsOptional,{at:e}),this.isThisParam(e)&&this.raise(A.ThisParamMayNotBeOptional,{at:e}),e.optional=!0),this.match(14)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(A.ThisParamAnnotationRequired,{at:e}),this.match(29)&&this.isThisParam(e)&&this.raise(A.ThisParamNoDefault,{at:e}),this.resetEndLocation(e),e}parseMaybeDefault(e,s){let i=super.parseMaybeDefault(e,s);return i.type==="AssignmentPattern"&&i.typeAnnotation&&i.right.start<i.typeAnnotation.start&&this.raise(A.TypeBeforeInitializer,{at:i.typeAnnotation}),i}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(A.ImportReflectionHasImportType,{at:e.specifiers[0].loc.start})}parseImportSpecifierLocal(e,s,i){s.local=qr(e)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(s,i))}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(128)){if(!e)return!0;let s=this.lookaheadCharCode();return s===123||s===42}return!e&&this.isContextual(87)}applyImportPhase(e,s,i,a){if(super.applyImportPhase(e,s,i,a),s){if(!i&&this.match(65))return;e.exportKind=i==="type"?i:"value"}else i==="type"&&this.match(55)&&this.unexpected(),e.importKind=i==="type"||i==="typeof"?i:"value"}parseImportSpecifier(e,s,i,a,n){let o=e.imported,u=null;o.type==="Identifier"&&(o.name==="type"?u="type":o.name==="typeof"&&(u="typeof"));let h=!1;if(this.isContextual(93)&&!this.isLookaheadContextual("as")){let p=this.parseIdentifier(!0);u!==null&&!W(this.state.type)?(e.imported=p,e.importKind=u,e.local=ie(p)):(e.imported=o,e.importKind=null,e.local=this.parseIdentifier())}else{if(u!==null&&W(this.state.type))e.imported=this.parseIdentifier(!0),e.importKind=u;else{if(s)throw this.raise(c.ImportBindingIsString,{at:e,importName:o.value});e.imported=o,e.importKind=null}this.eatContextual(93)?e.local=this.parseIdentifier():(h=!0,e.local=ie(e.imported))}let l=qr(e);return i&&l&&this.raise(A.ImportTypeShorthandOnlyInPureImport,{at:e}),(i||l)&&this.checkReservedType(e.local.name,e.local.loc.start,!0),h&&!i&&!l&&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 i=e.kind;i!=="get"&&i!=="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 i=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,e.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=i}return super.parseAsyncArrowFromCallExpression(e,s)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}parseMaybeAssign(e,s){var i;let a=null,n;if(this.hasPlugin("jsx")&&(this.match(140)||this.match(47))){if(a=this.state.clone(),n=this.tryParse(()=>super.parseMaybeAssign(e,s),a),!n.error)return n.node;let{context:h}=this.state,l=h[h.length-1];(l===k.j_oTag||l===k.j_expr)&&h.pop()}if((i=n)!=null&&i.error||this.match(47)){var o,u;a=a||this.state.clone();let h,l=this.tryParse(f=>{var d;h=this.flowParseTypeParameterDeclaration();let m=this.forwardNoArrowParamsConversionAt(h,()=>{let P=super.parseMaybeAssign(e,s);return this.resetStartLocationFromNode(P,h),P});(d=m.extra)!=null&&d.parenthesized&&f();let y=this.maybeUnwrapTypeCastExpression(m);return y.type!=="ArrowFunctionExpression"&&f(),y.typeParameters=h,this.resetStartLocationFromNode(y,h),m},a),p=null;if(l.node&&this.maybeUnwrapTypeCastExpression(l.node).type==="ArrowFunctionExpression"){if(!l.error&&!l.aborted)return l.node.async&&this.raise(A.UnexpectedTypeParameterBeforeAsyncArrowFunction,{at:h}),l.node;p=l.node}if((o=n)!=null&&o.node)return this.state=n.failState,n.node;if(p)return this.state=l.failState,p;throw(u=n)!=null&&u.thrown?n.error:l.thrown?l.error:this.raise(A.UnexpectedTokenAfterTypeParameter,{at:h})}return super.parseMaybeAssign(e,s)}parseArrow(e){if(this.match(14)){let s=this.tryParse(()=>{let i=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let a=this.startNode();return[a.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=i,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),a});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.indexOf(e.start)!==-1?e.params=s:super.setArrowFunctionParameters(e,s)}checkParams(e,s,i,a=!0){if(!(i&&this.state.noArrowParamsConversionAt.indexOf(e.start)!==-1)){for(let n=0;n<e.params.length;n++)this.isThisParam(e.params[n])&&n>0&&this.raise(A.ThisParamMustBeFirst,{at:e.params[n]});super.checkParams(e,s,i,a)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&this.state.noArrowAt.indexOf(this.state.start)===-1)}parseSubscripts(e,s,i){if(e.type==="Identifier"&&e.name==="async"&&this.state.noArrowAt.indexOf(s.index)!==-1){this.next();let a=this.startNodeAt(s);a.callee=e,a.arguments=super.parseCallExpressionArguments(11,!1),e=this.finishNode(a,"CallExpression")}else if(e.type==="Identifier"&&e.name==="async"&&this.match(47)){let a=this.state.clone(),n=this.tryParse(u=>this.parseAsyncArrowWithTypeParameters(s)||u(),a);if(!n.error&&!n.aborted)return n.node;let o=this.tryParse(()=>super.parseSubscripts(e,s,i),a);if(o.node&&!o.error)return o.node;if(n.node)return this.state=n.failState,n.node;if(o.node)return this.state=o.failState,o.node;throw n.error||o.error}return super.parseSubscripts(e,s,i)}parseSubscript(e,s,i,a){if(this.match(18)&&this.isLookaheadToken_lt()){if(a.optionalChainMember=!0,i)return a.stop=!0,e;this.next();let n=this.startNodeAt(s);return n.callee=e,n.typeArguments=this.flowParseTypeParameterInstantiation(),this.expect(10),n.arguments=this.parseCallExpressionArguments(11,!1),n.optional=!0,this.finishCallExpression(n,!0)}else if(!i&&this.shouldParseTypes()&&this.match(47)){let n=this.startNodeAt(s);n.callee=e;let o=this.tryParse(()=>(n.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),n.arguments=super.parseCallExpressionArguments(11,!1),a.optionalChainMember&&(n.optional=!1),this.finishCallExpression(n,a.optionalChainMember)));if(o.node)return o.error&&(this.state=o.failState),o.node}return super.parseSubscript(e,s,i,a)}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 i=super.parseTopLevel(e,s);return this.state.hasFlowComment&&this.raise(A.UnterminatedFlowComment,{at:this.state.curPosition()}),i}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(A.NestedFlowComment,{at:this.state.startLoc});this.hasFlowCommentCompletion();let e=this.skipFlowComment();e&&(this.state.pos+=e,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:e}=this.state,s=2;for(;[32,9].includes(this.input.charCodeAt(e+s));)s++;let i=this.input.charCodeAt(s+e),a=this.input.charCodeAt(s+e+1);return i===58&&a===58?s+2:this.input.slice(s+e,s+e+12)==="flow-include"?s+12:i===58&&a!==58?s:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(c.UnterminatedComment,{at:this.state.curPosition()})}flowEnumErrorBooleanMemberNotInitialized(e,{enumName:s,memberName:i}){this.raise(A.EnumBooleanMemberNotInitialized,{at:e,memberName:i,enumName:s})}flowEnumErrorInvalidMemberInitializer(e,s){return this.raise(s.explicitType?s.explicitType==="symbol"?A.EnumInvalidMemberInitializerSymbolType:A.EnumInvalidMemberInitializerPrimaryType:A.EnumInvalidMemberInitializerUnknownType,Object.assign({at:e},s))}flowEnumErrorNumberMemberNotInitialized(e,{enumName:s,memberName:i}){this.raise(A.EnumNumberMemberNotInitialized,{at:e,enumName:s,memberName:i})}flowEnumErrorStringMemberInconsistentlyInitailized(e,{enumName:s}){this.raise(A.EnumStringMemberInconsistentlyInitailized,{at:e,enumName:s})}flowEnumMemberInit(){let e=this.state.startLoc,s=()=>this.match(12)||this.match(8);switch(this.state.type){case 132:{let i=this.parseNumericLiteral(this.state.value);return s()?{type:"number",loc:i.loc.start,value:i}:{type:"invalid",loc:e}}case 131:{let i=this.parseStringLiteral(this.state.value);return s()?{type:"string",loc:i.loc.start,value:i}:{type:"invalid",loc:e}}case 85:case 86:{let i=this.parseBooleanLiteral(this.match(85));return s()?{type:"boolean",loc:i.loc.start,value:i}:{type:"invalid",loc:e}}default:return{type:"invalid",loc:e}}}flowEnumMemberRaw(){let e=this.state.startLoc,s=this.parseIdentifier(!0),i=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:e};return{id:s,init:i}}flowEnumCheckExplicitTypeMismatch(e,s,i){let{explicitType:a}=s;a!==null&&a!==i&&this.flowEnumErrorInvalidMemberInitializer(e,s)}flowEnumMembers({enumName:e,explicitType:s}){let i=new Set,a={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},n=!1;for(;!this.match(8);){if(this.eat(21)){n=!0;break}let o=this.startNode(),{id:u,init:h}=this.flowEnumMemberRaw(),l=u.name;if(l==="")continue;/^[a-z]/.test(l)&&this.raise(A.EnumInvalidMemberName,{at:u,memberName:l,suggestion:l[0].toUpperCase()+l.slice(1),enumName:e}),i.has(l)&&this.raise(A.EnumDuplicateMemberName,{at:u,memberName:l,enumName:e}),i.add(l);let p={enumName:e,explicitType:s,memberName:l};switch(o.id=u,h.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(h.loc,p,"boolean"),o.init=h.value,a.booleanMembers.push(this.finishNode(o,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(h.loc,p,"number"),o.init=h.value,a.numberMembers.push(this.finishNode(o,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(h.loc,p,"string"),o.init=h.value,a.stringMembers.push(this.finishNode(o,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(h.loc,p);case"none":switch(s){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(h.loc,p);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(h.loc,p);break;default:a.defaultedMembers.push(this.finishNode(o,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:a,hasUnknownMembers:n}}flowEnumStringMembers(e,s,{enumName:i}){if(e.length===0)return s;if(s.length===0)return e;if(s.length>e.length){for(let a of e)this.flowEnumErrorStringMemberInconsistentlyInitailized(a,{enumName:i});return s}else{for(let a of s)this.flowEnumErrorStringMemberInconsistentlyInitailized(a,{enumName:i});return e}}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(101))return null;if(!N(this.state.type))throw this.raise(A.EnumInvalidExplicitTypeUnknownSupplied,{at:this.state.startLoc,enumName:e});let{value:s}=this.state;return this.next(),s!=="boolean"&&s!=="number"&&s!=="string"&&s!=="symbol"&&this.raise(A.EnumInvalidExplicitType,{at:this.state.startLoc,enumName:e,invalidEnumType:s}),s}flowEnumBody(e,s){let i=s.name,a=s.loc.start,n=this.flowEnumParseExplicitType({enumName:i});this.expect(5);let{members:o,hasUnknownMembers:u}=this.flowEnumMembers({enumName:i,explicitType:n});switch(e.hasUnknownMembers=u,n){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:i}),this.expect(8),this.finishNode(e,"EnumStringBody");case"symbol":return e.members=o.defaultedMembers,this.expect(8),this.finishNode(e,"EnumSymbolBody");default:{let h=()=>(e.members=[],this.expect(8),this.finishNode(e,"EnumStringBody"));e.explicitType=!1;let l=o.booleanMembers.length,p=o.numberMembers.length,f=o.stringMembers.length,d=o.defaultedMembers.length;if(!l&&!p&&!f&&!d)return h();if(!l&&!p)return e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:i}),this.expect(8),this.finishNode(e,"EnumStringBody");if(!p&&!f&&l>=d){for(let m of o.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(m.loc.start,{enumName:i,memberName:m.id.name});return e.members=o.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody")}else if(!l&&!f&&p>=d){for(let m of o.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(m.loc.start,{enumName:i,memberName:m.id.name});return e.members=o.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody")}else return this.raise(A.EnumInconsistentMemberValues,{at:a,enumName:i}),h()}}}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}},Hu={__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"},ge=te`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 he(r){return r?r.type==="JSXOpeningFragment"||r.type==="JSXClosingFragment":!1}function Me(r){if(r.type==="JSXIdentifier")return r.name;if(r.type==="JSXNamespacedName")return r.namespace.name+":"+r.name.name;if(r.type==="JSXMemberExpression")return Me(r.object)+"."+Me(r.property);throw new Error("Node had unexpected type: "+r.type)}var Ku=r=>class extends r{jsxReadToken(){let e="",s=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(ge.UnterminatedJsxContent,{at:this.state.startLoc});let i=this.input.charCodeAt(this.state.pos);switch(i){case 60:case 123:if(this.state.pos===this.state.start){i===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(140)):super.getTokenFromCode(i);return}e+=this.input.slice(s,this.state.pos),this.finishToken(139,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:nt(i)?(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),i;return++this.state.pos,s===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,i=e?`
|
|
13
13
|
`:`\r
|
|
14
|
-
`):s=String.fromCharCode(i),++this.state.curLine,this.state.lineStart=this.state.pos,s}jsxReadString(e){let i="",s=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(d.UnterminatedString,{at:this.state.startLoc});let a=this.input.charCodeAt(this.state.pos);if(a===e)break;a===38?(i+=this.input.slice(s,this.state.pos),i+=this.jsxReadEntity(),s=this.state.pos):We(a)?(i+=this.input.slice(s,this.state.pos),i+=this.jsxReadNewLine(!1),s=this.state.pos):++this.state.pos}i+=this.input.slice(s,this.state.pos++),this.finishToken(131,i)}jsxReadEntity(){let e=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let i=10;this.codePointAtPos(this.state.pos)===120&&(i=16,++this.state.pos);let s=this.readInt(i,void 0,!1,"bail");if(s!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(s)}else{let i=0,s=!1;for(;i++<10&&this.state.pos<this.length&&!(s=this.codePointAtPos(this.state.pos)==59);)++this.state.pos;if(s){let a=this.input.slice(e,this.state.pos),r=Pc[a];if(++this.state.pos,r)return r}}return this.state.pos=e,"&"}jsxReadWord(){let e,i=this.state.pos;do e=this.input.charCodeAt(++this.state.pos);while(Ae(e)||e===45);this.finishToken(138,this.input.slice(i,this.state.pos))}jsxParseIdentifier(){let e=this.startNode();return this.match(138)?e.name=this.state.value:Di(this.state.type)?e.name=oe(this.state.type):this.unexpected(),this.next(),this.finishNode(e,"JSXIdentifier")}jsxParseNamespacedName(){let e=this.state.startLoc,i=this.jsxParseIdentifier();if(!this.eat(14))return i;let s=this.startNodeAt(e);return s.namespace=i,s.name=this.jsxParseIdentifier(),this.finishNode(s,"JSXNamespacedName")}jsxParseElementName(){let e=this.state.startLoc,i=this.jsxParseNamespacedName();if(i.type==="JSXNamespacedName")return i;for(;this.eat(16);){let s=this.startNodeAt(e);s.object=i,s.property=this.jsxParseIdentifier(),i=this.finishNode(s,"JSXMemberExpression")}return i}jsxParseAttributeValue(){let e;switch(this.state.type){case 5:return e=this.startNode(),this.setContext(I.brace),this.next(),e=this.jsxParseExpressionContainer(e,I.j_oTag),e.expression.type==="JSXEmptyExpression"&&this.raise(pe.AttributeIsEmpty,{at:e}),e;case 140:case 131:return this.parseExprAtom();default:throw this.raise(pe.UnsupportedJsxValue,{at:this.state.startLoc})}}jsxParseEmptyExpression(){let e=this.startNodeAt(this.state.lastTokEndLoc);return this.finishNodeAt(e,"JSXEmptyExpression",this.state.startLoc)}jsxParseSpreadChild(e){return this.next(),e.expression=this.parseExpression(),this.setContext(I.j_expr),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXSpreadChild")}jsxParseExpressionContainer(e,i){if(this.match(8))e.expression=this.jsxParseEmptyExpression();else{let s=this.parseExpression();e.expression=s}return this.setContext(i),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXExpressionContainer")}jsxParseAttribute(){let e=this.startNode();return this.match(5)?(this.setContext(I.brace),this.next(),this.expect(21),e.argument=this.parseMaybeAssignAllowIn(),this.setContext(I.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 i=this.startNodeAt(e);return this.eat(141)?this.finishNode(i,"JSXOpeningFragment"):(i.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(i))}jsxParseOpeningElementAfterName(e){let i=[];for(;!this.match(56)&&!this.match(141);)i.push(this.jsxParseAttribute());return e.attributes=i,e.selfClosing=this.eat(56),this.expect(141),this.finishNode(e,"JSXOpeningElement")}jsxParseClosingElementAt(e){let i=this.startNodeAt(e);return this.eat(141)?this.finishNode(i,"JSXClosingFragment"):(i.name=this.jsxParseElementName(),this.expect(141),this.finishNode(i,"JSXClosingElement"))}jsxParseElementAt(e){let i=this.startNodeAt(e),s=[],a=this.jsxParseOpeningElementAt(e),r=null;if(!a.selfClosing){e:for(;;)switch(this.state.type){case 140:if(e=this.state.startLoc,this.next(),this.eat(56)){r=this.jsxParseClosingElementAt(e);break e}s.push(this.jsxParseElementAt(e));break;case 139:s.push(this.parseExprAtom());break;case 5:{let o=this.startNode();this.setContext(I.brace),this.next(),this.match(21)?s.push(this.jsxParseSpreadChild(o)):s.push(this.jsxParseExpressionContainer(o,I.j_expr));break}default:this.unexpected()}re(a)&&!re(r)&&r!==null?this.raise(pe.MissingClosingTagFragment,{at:r}):!re(a)&&re(r)?this.raise(pe.MissingClosingTagElement,{at:r,openingTagName:Te(a.name)}):!re(a)&&!re(r)&&Te(r.name)!==Te(a.name)&&this.raise(pe.MissingClosingTagElement,{at:r,openingTagName:Te(a.name)})}if(re(a)?(i.openingFragment=a,i.closingFragment=r):(i.openingElement=a,i.closingElement=r),i.children=s,this.match(47))throw this.raise(pe.UnwrappedAdjacentJSXElements,{at:this.state.startLoc});return re(a)?this.finishNode(i,"JSXFragment"):this.finishNode(i,"JSXElement")}jsxParseElement(){let e=this.state.startLoc;return this.next(),this.jsxParseElementAt(e)}setContext(e){let{context:i}=this.state;i[i.length-1]=e}parseExprAtom(e){return this.match(139)?this.parseLiteral(this.state.value,"JSXText"):this.match(140)?this.jsxParseElement():this.match(47)&&this.input.charCodeAt(this.state.pos)!==33?(this.replaceToken(140),this.jsxParseElement()):super.parseExprAtom(e)}skipSpace(){this.curContext().preserveSpace||super.skipSpace()}getTokenFromCode(e){let i=this.curContext();if(i===I.j_expr){this.jsxReadToken();return}if(i===I.j_oTag||i===I.j_cTag){if(Z(e)){this.jsxReadWord();return}if(e===62){++this.state.pos,this.finishToken(141);return}if((e===34||e===39)&&i===I.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(140);return}super.getTokenFromCode(e)}updateContext(e){let{context:i,type:s}=this.state;if(s===56&&e===140)i.splice(-2,2,I.j_cTag),this.state.canStartJSXElement=!1;else if(s===140)i.push(I.j_oTag);else if(s===141){let a=i[i.length-1];a===I.j_oTag&&e===56||a===I.j_cTag?(i.pop(),this.state.canStartJSXElement=i[i.length-1]===I.j_expr):(this.setContext(I.j_expr),this.state.canStartJSXElement=!0)}else this.state.canStartJSXElement=Sl(s)}},Ai=class extends Ge{constructor(...t){super(...t),this.types=new Set,this.enums=new Set,this.constEnums=new Set,this.classes=new Set,this.exportOnlyBindings=new Set}},Ei=class extends Xe{constructor(...t){super(...t),this.importsStack=[]}createScope(t){return this.importsStack.push(new Set),new Ai(t)}enter(t){t==Ee&&this.importsStack.push(new Set),super.enter(t)}exit(){let t=super.exit();return t==Ee&&this.importsStack.pop(),t}hasImport(t,e){let i=this.importsStack.length;if(this.importsStack[i-1].has(t))return!0;if(!e&&i>1){for(let s=0;s<i-1;s++)if(this.importsStack[s].has(t))return!0}return!1}declareName(t,e,i){if(e&Ve){this.hasImport(t,!0)&&this.parser.raise(d.VarRedeclaration,{at:i,identifierName:t}),this.importsStack[this.importsStack.length-1].add(t);return}let s=this.currentScope();if(e&Ri){this.maybeExportDefined(s,t),s.exportOnlyBindings.add(t);return}super.declareName(t,e,i),e&me&&(e&W||(this.checkRedeclarationInScope(s,t,e,i),this.maybeExportDefined(s,t)),s.types.add(t)),e&ci&&s.enums.add(t),e&pi&&s.constEnums.add(t),e&Nt&&s.classes.add(t)}isRedeclaredInScope(t,e,i){if(t.enums.has(e)){if(i&ci){let s=!!(i&pi),a=t.constEnums.has(e);return s!==a}return!0}return i&Nt&&t.classes.has(e)?t.lexical.has(e)?!!(i&W):!1:i&me&&t.types.has(e)?!0:super.isRedeclaredInScope(t,e,i)}checkLocalExport(t){let{name:e}=t;if(this.hasImport(e))return;let i=this.scopeStack.length;for(let s=i-1;s>=0;s--){let a=this.scopeStack[s];if(a.types.has(e)||a.exportOnlyBindings.has(e))return}super.checkLocalExport(t)}},Ac=(n,t)=>Object.hasOwnProperty.call(n,t)&&n[t],Tr=n=>n.type==="ParenthesizedExpression"?Tr(n.expression):n,Si=class extends Ti{toAssignable(t,e=!1){var i,s;let a;switch((t.type==="ParenthesizedExpression"||(i=t.extra)!=null&&i.parenthesized)&&(a=Tr(t),e?a.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(d.InvalidParenthesizedAssignment,{at:t}):a.type!=="MemberExpression"&&this.raise(d.InvalidParenthesizedAssignment,{at:t}):this.raise(d.InvalidParenthesizedAssignment,{at:t})),t.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern";for(let o=0,l=t.properties.length,c=l-1;o<l;o++){var r;let p=t.properties[o],h=o===c;this.toAssignableObjectExpressionProp(p,h,e),h&&p.type==="RestElement"&&(r=t.extra)!=null&&r.trailingCommaLoc&&this.raise(d.RestTrailingComma,{at:t.extra.trailingCommaLoc})}break;case"ObjectProperty":{let{key:o,value:l}=t;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":t.type="ArrayPattern",this.toAssignableList(t.elements,(s=t.extra)==null?void 0:s.trailingCommaLoc,e);break;case"AssignmentExpression":t.operator!=="="&&this.raise(d.MissingEqInAssignment,{at:t.left.loc.end}),t.type="AssignmentPattern",delete t.operator,this.toAssignable(t.left,e);break;case"ParenthesizedExpression":this.toAssignable(a,e);break}}toAssignableObjectExpressionProp(t,e,i){if(t.type==="ObjectMethod")this.raise(t.kind==="get"||t.kind==="set"?d.PatternHasAccessor:d.PatternHasMethod,{at:t.key});else if(t.type==="SpreadElement"){t.type="RestElement";let s=t.argument;this.checkToRestConversion(s,!1),this.toAssignable(s,i),e||this.raise(d.RestTrailingComma,{at:t})}else this.toAssignable(t,i)}toAssignableList(t,e,i){let s=t.length-1;for(let a=0;a<=s;a++){let r=t[a];if(r){if(r.type==="SpreadElement"){r.type="RestElement";let o=r.argument;this.checkToRestConversion(o,!0),this.toAssignable(o,i)}else this.toAssignable(r,i);r.type==="RestElement"&&(a<s?this.raise(d.RestTrailingComma,{at:r}):e&&this.raise(d.RestTrailingComma,{at:e}))}}}isAssignable(t,e){switch(t.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":return!0;case"ObjectExpression":{let i=t.properties.length-1;return t.properties.every((s,a)=>s.type!=="ObjectMethod"&&(a===i||s.type!=="SpreadElement")&&this.isAssignable(s))}case"ObjectProperty":return this.isAssignable(t.value);case"SpreadElement":return this.isAssignable(t.argument);case"ArrayExpression":return t.elements.every(i=>i===null||this.isAssignable(i));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 i of t)(i==null?void 0:i.type)==="ArrayExpression"&&this.toReferencedListDeep(i.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,i){let s=i&1,a=[],r=!0;for(;!this.eat(t);)if(r?r=!1:this.expect(12),s&&this.match(12))a.push(null);else{if(this.eat(t))break;if(this.match(21)){if(a.push(this.parseAssignableListItemTypes(this.parseRestBinding(),i)),!this.checkCommaAfterRest(e)){this.expect(t);break}}else{let o=[];for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(d.UnsupportedParameterDecorator,{at:this.state.startLoc});this.match(26);)o.push(this.parseDecorator());a.push(this.parseAssignableListItem(i,o))}}return a}parseBindingRestProperty(t){return this.next(),t.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(t,"RestElement")}parseBindingProperty(){let t=this.startNode(),{type:e,startLoc:i}=this.state;return e===21?this.parseBindingRestProperty(t):(e===136?(this.expectPlugin("destructuringPrivate",i),this.classScope.usePrivateName(this.state.value,i),t.key=this.parsePrivateName()):this.parsePropertyName(t),t.method=!1,this.parseObjPropValue(t,i,!1,!1,!0,!1))}parseAssignableListItem(t,e){let i=this.parseMaybeDefault();this.parseAssignableListItemTypes(i,t);let s=this.parseMaybeDefault(i.loc.start,i);return e.length&&(i.decorators=e),s}parseAssignableListItemTypes(t,e){return t}parseMaybeDefault(t,e){var i,s;if((i=t)!=null||(t=this.state.startLoc),e=(s=e)!=null?s:this.parseBindingAtom(),!this.eat(29))return e;let a=this.startNodeAt(t);return a.left=e,a.right=this.parseMaybeAssignAllowIn(),this.finishNode(a,"AssignmentPattern")}isValidLVal(t,e,i){return Ac({AssignmentPattern:"left",RestElement:"argument",ObjectProperty:"value",ParenthesizedExpression:"expression",ArrayPattern:"elements",ObjectPattern:"properties"},t)}checkLVal(t,{in:e,binding:i=ne,checkClashes:s=!1,strictModeChanged:a=!1,hasParenthesizedAncestor:r=!1}){var o;let l=t.type;if(this.isObjectMethod(t))return;if(l==="MemberExpression"){i!==ne&&this.raise(d.InvalidPropertyBindingPattern,{at:t});return}if(l==="Identifier"){this.checkIdentifier(t,i,a);let{name:f}=t;s&&(s.has(f)?this.raise(d.ParamDupe,{at:t}):s.add(f));return}let c=this.isValidLVal(l,!(r||(o=t.extra)!=null&&o.parenthesized)&&e.type==="AssignmentExpression",i);if(c===!0)return;if(c===!1){let f=i===ne?d.InvalidLhs:d.InvalidLhsBinding;this.raise(f,{at:t,ancestor:e});return}let[p,h]=Array.isArray(c)?c:[c,l==="ParenthesizedExpression"],u=l==="ArrayPattern"||l==="ObjectPattern"||l==="ParenthesizedExpression"?{type:l}:e;for(let f of[].concat(t[p]))f&&this.checkLVal(f,{in:u,binding:i,checkClashes:s,strictModeChanged:a,hasParenthesizedAncestor:h})}checkIdentifier(t,e,i=!1){this.state.strict&&(i?nr(t.name,this.inModule):rr(t.name))&&(e===ne?this.raise(d.StrictEvalArguments,{at:t,referenceName:t.name}):this.raise(d.StrictEvalArgumentsBinding,{at:t,bindingName:t.name})),e&Dt&&t.name==="let"&&this.raise(d.LetInLexicalBinding,{at:t}),e&ne||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(d.InvalidRestAssignmentPattern,{at:t})}}checkCommaAfterRest(t){return this.match(12)?(this.raise(this.lookaheadCharCode()===t?d.RestTrailingComma:d.ElementAfterRest,{at:this.state.startLoc}),!0):!1}},Ec=(n,t)=>Object.hasOwnProperty.call(n,t)&&n[t];function Sc(n){if(n==null)throw new Error(`Unexpected ${n} value.`);return n}function Va(n){if(!n)throw new Error("Assert fail")}var y=ee`typescript`({AbstractMethodHasImplementation:({methodName:n})=>`Method '${n}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:n})=>`Property '${n}' cannot have an initializer because it is marked abstract.`,AccesorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccesorCannotHaveTypeParameters:"An accessor cannot have type parameters.",AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:n})=>`'declare' is not allowed in ${n}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:({modifier:n})=>"Accessibility modifier already seen.",DuplicateModifier:({modifier:n})=>`Duplicate modifier: '${n}'.`,EmptyHeritageClauseType:({token:n})=>`'${n}' 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:n})=>`'${n[0]}' modifier cannot be used with '${n[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:n})=>`Index signatures cannot have an accessibility modifier ('${n}').`,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:n})=>`'${n}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:n})=>`'${n}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:n})=>`'${n}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:n})=>`'${n[0]}' modifier must precede '${n[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.",MixedLabeledAndUnlabeledElements:"Tuple members must all have names or all not have names.",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:n})=>`Private elements cannot have an accessibility modifier ('${n}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccesorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccesorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccesorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:n})=>`Single type parameter ${n} should have a trailing comma. Example usage: <${n},>.`,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:n})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${n}.`});function Cc(n){switch(n){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 Wa(n){return n==="private"||n==="public"||n==="protected"}function kc(n){return n==="in"||n==="out"}var Ic=n=>class extends n{constructor(...e){super(...e),this.tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:y.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:y.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:y.InvalidModifierOnTypeParameter})}getScopeHandler(){return Ei}tsIsIdentifier(){return k(this.state.type)}tsTokenCanFollowModifier(){return(this.match(0)||this.match(5)||this.match(55)||this.match(21)||this.match(136)||this.isLiteralPropertyName())&&!this.hasPrecedingLineBreak()}tsNextTokenCanFollowModifier(){return this.next(),this.tsTokenCanFollowModifier()}tsParseModifier(e,i){if(!k(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;let s=this.state.value;if(e.indexOf(s)!==-1){if(i&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return s}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:i,stopOnStartOfClassStaticBlock:s,errorTemplate:a=y.InvalidModifierOnTypeMember},r){let o=(c,p,h,u)=>{p===h&&r[u]&&this.raise(y.InvalidModifiersOrder,{at:c,orderedModifiers:[h,u]})},l=(c,p,h,u)=>{(r[h]&&p===u||r[u]&&p===h)&&this.raise(y.IncompatibleModifiers,{at:c,modifiers:[h,u]})};for(;;){let{startLoc:c}=this.state,p=this.tsParseModifier(e.concat(i??[]),s);if(!p)break;Wa(p)?r.accessibility?this.raise(y.DuplicateAccessibilityModifier,{at:c,modifier:p}):(o(c,p,p,"override"),o(c,p,p,"static"),o(c,p,p,"readonly"),r.accessibility=p):kc(p)?(r[p]&&this.raise(y.DuplicateModifier,{at:c,modifier:p}),r[p]=!0,o(c,p,"in","out")):(Object.hasOwnProperty.call(r,p)?this.raise(y.DuplicateModifier,{at:c,modifier:p}):(o(c,p,"static","readonly"),o(c,p,"static","override"),o(c,p,"override","readonly"),o(c,p,"abstract","override"),l(c,p,"declare","override"),l(c,p,"static","abstract")),r[p]=!0),i!=null&&i.includes(p)&&this.raise(a,{at:c,modifier:p})}}tsIsListTerminator(e){switch(e){case"EnumMembers":case"TypeMembers":return this.match(8);case"HeritageClauseElement":return this.match(5);case"TupleElementTypes":return this.match(3);case"TypeParametersOrArguments":return this.match(48)}}tsParseList(e,i){let s=[];for(;!this.tsIsListTerminator(e);)s.push(i());return s}tsParseDelimitedList(e,i,s){return Sc(this.tsParseDelimitedListWorker(e,i,!0,s))}tsParseDelimitedListWorker(e,i,s,a){let r=[],o=-1;for(;!this.tsIsListTerminator(e);){o=-1;let l=i();if(l==null)return;if(r.push(l),this.eat(12)){o=this.state.lastTokStart;continue}if(this.tsIsListTerminator(e))break;s&&this.expect(12);return}return a&&(a.value=o),r}tsParseBracketedList(e,i,s,a,r){a||(s?this.expect(0):this.expect(47));let o=this.tsParseDelimitedList(e,i,r);return s?this.expect(3):this.expect(48),o}tsParseImportType(){let e=this.startNode();return this.expect(83),this.expect(10),this.match(131)||this.raise(y.UnsupportedImportTypeArgument,{at:this.state.startLoc}),e.argument=super.parseExprAtom(),this.expect(11),this.eat(16)&&(e.qualifier=this.tsParseEntityName()),this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSImportType")}tsParseEntityName(e=!0){let i=this.parseIdentifier(e);for(;this.eat(16);){let s=this.startNodeAtNode(i);s.left=i,s.right=this.parseIdentifier(e),i=this.finishNode(s,"TSQualifiedName")}return i}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 i=this.startNodeAtNode(e);return i.parameterName=e,i.typeAnnotation=this.tsParseTypeAnnotation(!1),i.asserts=!1,this.finishNode(i,"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 i=this.startNode();return e(i),i.name=this.tsParseTypeParameterName(),i.constraint=this.tsEatThenParseType(81),i.default=this.tsEatThenParseType(29),this.finishNode(i,"TSTypeParameter")}tsTryParseTypeParameters(e){if(this.match(47))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){let i=this.startNode();this.match(47)||this.match(140)?this.next():this.unexpected();let s={value:-1};return i.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,e),!1,!0,s),i.params.length===0&&this.raise(y.EmptyTypeParameters,{at:i}),s.value!==-1&&this.addExtra(i,"trailingComma",s.value),this.finishNode(i,"TSTypeParameterDeclaration")}tsFillSignature(e,i){let s=e===19,a="parameters",r="typeAnnotation";i.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),i[a]=this.tsParseBindingListForSignature(),s?i[r]=this.tsParseTypeOrTypePredicateAnnotation(e):this.match(e)&&(i[r]=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){let e=super.parseBindingList(11,41,2);for(let i of e){let{type:s}=i;(s==="AssignmentPattern"||s==="TSParameterProperty")&&this.raise(y.UnsupportedSignatureParameterKind,{at:i,type:s})}return e}tsParseTypeMemberSemicolon(){!this.eat(12)&&!this.isLineTerminator()&&this.expect(13)}tsParseSignatureMember(e,i){return this.tsFillSignature(14,i),this.tsParseTypeMemberSemicolon(),this.finishNode(i,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),k(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 i=this.parseIdentifier();i.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(i),this.expect(3),e.parameters=[i];let s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSIndexSignature")}tsParsePropertyOrMethodSignature(e,i){this.eat(17)&&(e.optional=!0);let s=e;if(this.match(10)||this.match(47)){i&&this.raise(y.ReadonlyForMethodSignature,{at:e});let a=s;a.kind&&this.match(47)&&this.raise(y.AccesorCannotHaveTypeParameters,{at:this.state.curPosition()}),this.tsFillSignature(14,a),this.tsParseTypeMemberSemicolon();let r="parameters",o="typeAnnotation";if(a.kind==="get")a[r].length>0&&(this.raise(d.BadGetterArity,{at:this.state.curPosition()}),this.isThisParam(a[r][0])&&this.raise(y.AccesorCannotDeclareThisParameter,{at:this.state.curPosition()}));else if(a.kind==="set"){if(a[r].length!==1)this.raise(d.BadSetterArity,{at:this.state.curPosition()});else{let l=a[r][0];this.isThisParam(l)&&this.raise(y.AccesorCannotDeclareThisParameter,{at:this.state.curPosition()}),l.type==="Identifier"&&l.optional&&this.raise(y.SetAccesorCannotHaveOptionalParameter,{at:this.state.curPosition()}),l.type==="RestElement"&&this.raise(y.SetAccesorCannotHaveRestParameter,{at:this.state.curPosition()})}a[o]&&this.raise(y.SetAccesorCannotHaveReturnType,{at:a[o]})}else a.kind="method";return this.finishNode(a,"TSMethodSignature")}else{let a=s;i&&(a.readonly=!0);let r=this.tsTryParseTypeAnnotation();return r&&(a.typeAnnotation=r),this.tsParseTypeMemberSemicolon(),this.finishNode(a,"TSPropertySignature")}}tsParseTypeMember(){let e=this.startNode();if(this.match(10)||this.match(47))return this.tsParseSignatureMember("TSCallSignatureDeclaration",e);if(this.match(77)){let s=this.startNode();return this.next(),this.match(10)||this.match(47)?this.tsParseSignatureMember("TSConstructSignatureDeclaration",e):(e.key=this.createIdentifier(s,"new"),this.tsParsePropertyOrMethodSignature(e,!1))}this.tsParseModifiers({allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]},e);let i=this.tsTryParseIndexSignature(e);return i||(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(120):(this.isContextual(120)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(58)))}tsParseMappedTypeParameter(){let e=this.startNode();return e.name=this.tsParseTypeParameterName(),e.constraint=this.tsExpectThenParseType(58),this.finishNode(e,"TSTypeParameter")}tsParseMappedType(){let e=this.startNode();return this.expect(5),this.match(53)?(e.readonly=this.state.value,this.next(),this.expectContextual(120)):this.eatContextual(120)&&(e.readonly=!0),this.expect(0),e.typeParameter=this.tsParseMappedTypeParameter(),e.nameType=this.eatContextual(93)?this.tsParseType():null,this.expect(3),this.match(53)?(e.optional=this.state.value,this.next(),this.expect(17)):this.eat(17)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(8),this.finishNode(e,"TSMappedType")}tsParseTupleType(){let e=this.startNode();e.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let i=!1,s=null;return e.elementTypes.forEach(a=>{var r;let{type:o}=a;i&&o!=="TSRestType"&&o!=="TSOptionalType"&&!(o==="TSNamedTupleMember"&&a.optional)&&this.raise(y.OptionalTypeBeforeRequired,{at:a}),i||(i=o==="TSNamedTupleMember"&&a.optional||o==="TSOptionalType");let l=o;o==="TSRestType"&&(a=a.typeAnnotation,l=a.type);let c=l==="TSNamedTupleMember";(r=s)!=null||(s=c),s!==c&&this.raise(y.MixedLabeledAndUnlabeledElements,{at:a})}),this.finishNode(e,"TSTupleType")}tsParseTupleElementType(){let{startLoc:e}=this.state,i=this.eat(21),s,a,r,o,c=U(this.state.type)?this.lookaheadCharCode():null;if(c===58)s=!0,r=!1,a=this.parseIdentifier(!0),this.expect(14),o=this.tsParseType();else if(c===63){r=!0;let p=this.state.startLoc,h=this.state.value,u=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(s=!0,a=this.createIdentifier(this.startNodeAt(p),h),this.expect(17),this.expect(14),o=this.tsParseType()):(s=!1,o=u,this.expect(17))}else o=this.tsParseType(),r=this.eat(17),s=this.eat(14);if(s){let p;a?(p=this.startNodeAtNode(a),p.optional=r,p.label=a,p.elementType=o,this.eat(17)&&(p.optional=!0,this.raise(y.TupleOptionalAfterType,{at:this.state.lastTokStartLoc}))):(p=this.startNodeAtNode(o),p.optional=r,this.raise(y.InvalidTupleMemberLabel,{at:o}),p.label=o,p.elementType=this.tsParseType()),o=this.finishNode(p,"TSNamedTupleMember")}else if(r){let p=this.startNodeAtNode(o);p.typeAnnotation=o,o=this.finishNode(p,"TSOptionalType")}if(i){let p=this.startNodeAt(e);p.typeAnnotation=o,o=this.finishNode(p,"TSRestType")}return o}tsParseParenthesizedType(){let e=this.startNode();return this.expect(10),e.typeAnnotation=this.tsParseType(),this.expect(11),this.finishNode(e,"TSParenthesizedType")}tsParseFunctionOrConstructorType(e,i){let s=this.startNode();return e==="TSConstructorType"&&(s.abstract=!!i,i&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,s)),this.finishNode(s,e)}tsParseLiteralTypeNode(){let e=this.startNode();switch(this.state.type){case 132:case 133:case 131: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(114)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseNonArrayType(){switch(this.state.type){case 131:case 132:case 133:case 85:case 86:return this.tsParseLiteralTypeNode();case 53:if(this.state.value==="-"){let e=this.startNode(),i=this.lookahead();return i.type!==132&&i.type!==133&&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(k(e)||e===88||e===84){let i=e===88?"TSVoidKeyword":e===84?"TSNullKeyword":Cc(this.state.value);if(i!==void 0&&this.lookaheadCharCode()!==46){let s=this.startNode();return this.next(),this.finishNode(s,i)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let e=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(3)){let i=this.startNodeAtNode(e);i.elementType=e,this.expect(3),e=this.finishNode(i,"TSArrayType")}else{let i=this.startNodeAtNode(e);i.objectType=e,i.indexType=this.tsParseType(),this.expect(3),e=this.finishNode(i,"TSIndexedAccessType")}return e}tsParseTypeOperator(){let e=this.startNode(),i=this.state.value;return this.next(),e.operator=i,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),i==="readonly"&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(y.UnexpectedReadonly,{at:e})}}tsParseInferType(){let e=this.startNode();this.expectContextual(113);let i=this.startNode();return i.name=this.tsParseTypeParameterName(),i.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(i,"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 Ll(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(113)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,i,s){let a=this.startNode(),r=this.eat(s),o=[];do o.push(i());while(this.eat(s));return o.length===1&&!r?o[0]:(a.types=o,this.finishNode(a,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(k(this.state.type)||this.match(78))return this.next(),!0;if(this.match(5)){let{errors:e}=this.state,i=e.length;try{return this.parseObjectLike(8,!0),e.length===i}catch{return!1}}if(this.match(0)){this.next();let{errors:e}=this.state,i=e.length;try{return super.parseBindingList(3,93,1),e.length===i}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 i=this.startNode();this.expect(e);let s=this.startNode(),a=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(a&&this.match(78)){let l=this.tsParseThisTypeOrThisTypePredicate();return l.type==="TSThisType"?(s.parameterName=l,s.asserts=!0,s.typeAnnotation=null,l=this.finishNode(s,"TSTypePredicate")):(this.resetStartLocationFromNode(l,s),l.asserts=!0),i.typeAnnotation=l,this.finishNode(i,"TSTypeAnnotation")}let r=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!r)return a?(s.parameterName=this.parseIdentifier(),s.asserts=a,s.typeAnnotation=null,i.typeAnnotation=this.finishNode(s,"TSTypePredicate"),this.finishNode(i,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,i);let o=this.tsParseTypeAnnotation(!1);return s.parameterName=r,s.typeAnnotation=o,s.asserts=a,i.typeAnnotation=this.finishNode(s,"TSTypePredicate"),this.finishNode(i,"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(114)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(this.state.type!==107)return!1;let e=this.state.containsEsc;return this.next(),!k(this.state.type)&&!this.match(78)?!1:(e&&this.raise(d.InvalidEscapedReservedWord,{at:this.state.lastTokStartLoc,reservedWord:"asserts"}),!0)}tsParseTypeAnnotation(e=!0,i=this.startNode()){return this.tsInType(()=>{e&&this.expect(14),i.typeAnnotation=this.tsParseType()}),this.finishNode(i,"TSTypeAnnotation")}tsParseType(){Va(this.state.inType);let e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(81))return e;let i=this.startNodeAtNode(e);return i.checkType=e,i.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(17),i.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(14),i.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(i,"TSConditionalType")}isAbstractConstructorSignature(){return this.isContextual(122)&&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(y.ReservedTypeAssertion,{at:this.state.startLoc});let e=this.startNode();return e.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?this.tsParseTypeReference():this.tsParseType())),this.expect(48),e.expression=this.parseMaybeUnary(),this.finishNode(e,"TSTypeAssertion")}tsParseHeritageClause(e){let i=this.state.startLoc,s=this.tsParseDelimitedList("HeritageClauseElement",()=>{let a=this.startNode();return a.expression=this.tsParseEntityName(),this.match(47)&&(a.typeParameters=this.tsParseTypeArguments()),this.finishNode(a,"TSExpressionWithTypeArguments")});return s.length||this.raise(y.EmptyHeritageClauseType,{at:i,token:e}),s}tsParseInterfaceDeclaration(e,i={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(127),i.declare&&(e.declare=!0),k(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,Vl)):(e.id=null,this.raise(y.MissingInterfaceName,{at:this.state.startLoc})),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81)&&(e.extends=this.tsParseHeritageClause("extends"));let s=this.startNode();return s.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(s,"TSInterfaceBody"),this.finishNode(e,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(e){return e.id=this.parseIdentifier(),this.checkIdentifier(e.id,Wl),e.typeAnnotation=this.tsInType(()=>{if(e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(29),this.isContextual(112)&&this.lookahead().type!==16){let i=this.startNode();return this.next(),this.finishNode(i,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(e,"TSTypeAliasDeclaration")}tsInNoContext(e){let i=this.state.context;this.state.context=[i[0]];try{return e()}finally{this.state.context=i}}tsInType(e){let i=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=i}}tsInDisallowConditionalTypesContext(e){let i=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.state.inDisallowConditionalTypesContext=i}}tsInAllowConditionalTypesContext(e){let i=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.state.inDisallowConditionalTypesContext=i}}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(131)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(29)&&(e.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(e,"TSEnumMember")}tsParseEnumDeclaration(e,i={}){return i.const&&(e.const=!0),i.declare&&(e.declare=!0),this.expectContextual(124),e.id=this.parseIdentifier(),this.checkIdentifier(e.id,e.const?Xl:dr),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(we),this.expect(5),super.parseBlockOrModuleBlockBody(e.body=[],void 0,!0,8),this.scope.exit(),this.finishNode(e,"TSModuleBlock")}tsParseModuleOrNamespaceDeclaration(e,i=!1){if(e.id=this.parseIdentifier(),i||this.checkIdentifier(e.id,Jl),this.eat(16)){let s=this.startNode();this.tsParseModuleOrNamespaceDeclaration(s,!0),e.body=s}else this.scope.enter(Ee),this.prodParam.enter(Ce),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit();return this.finishNode(e,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(e){return this.isContextual(110)?(e.global=!0,e.id=this.parseIdentifier()):this.match(131)?e.id=super.parseStringLiteral(this.state.value):this.unexpected(),this.match(5)?(this.scope.enter(Ee),this.prodParam.enter(Ce),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit()):this.semicolon(),this.finishNode(e,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(e,i,s){e.isExport=s||!1,e.id=i||this.parseIdentifier(),this.checkIdentifier(e.id,Ve),this.expect(29);let a=this.tsParseModuleReference();return e.importKind==="type"&&a.type!=="TSExternalModuleReference"&&this.raise(y.ImportAliasHasImportType,{at:a}),e.moduleReference=a,this.semicolon(),this.finishNode(e,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(117)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)}tsParseExternalModuleReference(){let e=this.startNode();return this.expectContextual(117),this.expect(10),this.match(131)||this.unexpected(),e.expression=super.parseExprAtom(),this.expect(11),this.sawUnambiguousESM=!0,this.finishNode(e,"TSExternalModuleReference")}tsLookAhead(e){let i=this.state.clone(),s=e();return this.state=i,s}tsTryParseAndCatch(e){let i=this.tryParse(s=>e()||s());if(!(i.aborted||!i.node))return i.error&&(this.state=i.failState),i.node}tsTryParse(e){let i=this.state.clone(),s=e();if(s!==void 0&&s!==!1)return s;this.state=i}tsTryParseDeclare(e){if(this.isLineTerminator())return;let i=this.state.type,s;return this.isContextual(99)&&(i=74,s="let"),this.tsInAmbientContext(()=>{switch(i){case 68:return e.declare=!0,super.parseFunctionStatement(e,!1,!1);case 80:return e.declare=!0,this.parseClass(e,!0,!1);case 124:return this.tsParseEnumDeclaration(e,{declare:!0});case 110:return this.tsParseAmbientExternalModuleDeclaration(e);case 75:case 74:return!this.match(75)||!this.isLookaheadContextual("enum")?(e.declare=!0,this.parseVarStatement(e,s||this.state.value,!0)):(this.expect(75),this.tsParseEnumDeclaration(e,{const:!0,declare:!0}));case 127:{let a=this.tsParseInterfaceDeclaration(e,{declare:!0});if(a)return a}default:if(k(i))return this.tsParseDeclaration(e,this.state.value,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.value,!0,null)}tsParseExpressionStatement(e,i,s){switch(i.name){case"declare":{let a=this.tsTryParseDeclare(e);return a&&(a.declare=!0),a}case"global":if(this.match(5)){this.scope.enter(Ee),this.prodParam.enter(Ce);let a=e;return a.global=!0,a.id=i,a.body=this.tsParseModuleBlock(),this.scope.exit(),this.prodParam.exit(),this.finishNode(a,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(e,i.name,!1,s)}}tsParseDeclaration(e,i,s,a){switch(i){case"abstract":if(this.tsCheckLineTerminator(s)&&(this.match(80)||k(this.state.type)))return this.tsParseAbstractDeclaration(e,a);break;case"module":if(this.tsCheckLineTerminator(s)){if(this.match(131))return this.tsParseAmbientExternalModuleDeclaration(e);if(k(this.state.type))return this.tsParseModuleOrNamespaceDeclaration(e)}break;case"namespace":if(this.tsCheckLineTerminator(s)&&k(this.state.type))return this.tsParseModuleOrNamespaceDeclaration(e);break;case"type":if(this.tsCheckLineTerminator(s)&&k(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 i=this.state.maybeInArrowParameters;this.state.maybeInArrowParameters=!0;let s=this.tsTryParseAndCatch(()=>{let a=this.startNodeAt(e);return a.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(a),a.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(19),a});if(this.state.maybeInArrowParameters=i,!!s)return super.parseArrowExpression(s,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(y.EmptyTypeArguments,{at:e}):!this.state.inType&&this.curContext()===I.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return Ml(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseAssignableListItem(e,i){let s=this.state.startLoc,a={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},a);let r=a.accessibility,o=a.override,l=a.readonly;!(e&4)&&(r||l||o)&&this.raise(y.UnexpectedParameterModifier,{at:s});let c=this.parseMaybeDefault();this.parseAssignableListItemTypes(c,e);let p=this.parseMaybeDefault(c.loc.start,c);if(r||l||o){let h=this.startNodeAt(s);return i.length&&(h.decorators=i),r&&(h.accessibility=r),l&&(h.readonly=l),o&&(h.override=o),p.type!=="Identifier"&&p.type!=="AssignmentPattern"&&this.raise(y.UnsupportedParameterPropertyKind,{at:h}),h.parameter=p,this.finishNode(h,"TSParameterProperty")}return i.length&&(c.decorators=i),p}isSimpleParameter(e){return e.type==="TSParameterProperty"&&super.isSimpleParameter(e.parameter)||super.isSimpleParameter(e)}tsDisallowOptionalPattern(e){for(let i of e.params)i.type!=="Identifier"&&i.optional&&!this.state.isAmbientContext&&this.raise(y.PatternIsOptional,{at:i})}setArrowFunctionParameters(e,i,s){super.setArrowFunctionParameters(e,i,s),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,i,s=!1){this.match(14)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(14));let a=i==="FunctionDeclaration"?"TSDeclareFunction":i==="ClassMethod"||i==="ClassPrivateMethod"?"TSDeclareMethod":void 0;return a&&!this.match(5)&&this.isLineTerminator()?this.finishNode(e,a):a==="TSDeclareFunction"&&this.state.isAmbientContext&&(this.raise(y.DeclareFunctionHasImplementation,{at:e}),e.declare)?super.parseFunctionBodyAndFinish(e,a,s):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,i,s))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,Ua):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(i=>{(i==null?void 0:i.type)==="TSTypeCastExpression"&&this.raise(y.UnexpectedTypeAnnotation,{at:i.typeAnnotation})})}toReferencedList(e,i){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,i,s,a){let r=super.parseArrayLike(e,i,s,a);return r.type==="ArrayExpression"&&this.tsCheckForInvalidTypeCasts(r.elements),r}parseSubscript(e,i,s,a){if(!this.hasPrecedingLineBreak()&&this.match(35)){this.state.canStartJSXElement=!1,this.next();let o=this.startNodeAt(i);return o.expression=e,this.finishNode(o,"TSNonNullExpression")}let r=!1;if(this.match(18)&&this.lookaheadCharCode()===60){if(s)return a.stop=!0,e;a.optionalChainMember=r=!0,this.next()}if(this.match(47)||this.match(51)){let o,l=this.tsTryParseAndCatch(()=>{if(!s&&this.atPossibleAsyncArrow(e)){let u=this.tsTryParseGenericAsyncArrowFunction(i);if(u)return u}let c=this.tsParseTypeArgumentsInExpression();if(!c)return;if(r&&!this.match(10)){o=this.state.curPosition();return}if(Ct(this.state.type)){let u=super.parseTaggedTemplateExpression(e,i,a);return u.typeParameters=c,u}if(!s&&this.eat(10)){let u=this.startNodeAt(i);return u.callee=e,u.arguments=this.parseCallExpressionArguments(11,!1),this.tsCheckForInvalidTypeCasts(u.arguments),u.typeParameters=c,a.optionalChainMember&&(u.optional=r),this.finishCallExpression(u,a.optionalChainMember)}let p=this.state.type;if(p===48||p===52||p!==10&&oi(p)&&!this.hasPrecedingLineBreak())return;let h=this.startNodeAt(i);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(y.InvalidPropertyAccessAfterInstantiationExpression,{at:this.state.startLoc}),l}return super.parseSubscript(e,i,s,a)}parseNewCallee(e){var i;super.parseNewCallee(e);let{callee:s}=e;s.type==="TSInstantiationExpression"&&!((i=s.extra)!=null&&i.parenthesized)&&(e.typeParameters=s.typeParameters,e.callee=s.expression)}parseExprOp(e,i,s){let a;if(wt(58)>s&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(a=this.isContextual(118)))){let r=this.startNodeAt(i);return r.expression=e,r.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?(a&&this.raise(d.UnexpectedKeyword,{at:this.state.startLoc,keyword:"const"}),this.tsParseTypeReference()):this.tsParseType())),this.finishNode(r,a?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(r,i,s)}return super.parseExprOp(e,i,s)}checkReservedWord(e,i,s,a){this.state.isAmbientContext||super.checkReservedWord(e,i,s,a)}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(y.ImportReflectionHasImportType,{at:e.specifiers[0].loc.start})}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(128)){let i=this.lookaheadCharCode();return e?i===123||i===42:i!==61}return!e&&this.isContextual(87)}applyImportPhase(e,i,s,a){super.applyImportPhase(e,i,s,a),i?e.exportKind=s==="type"?"type":"value":e.importKind=s==="type"||s==="typeof"?s:"value"}parseImport(e){if(this.match(131))return e.importKind="value",super.parseImport(e);let i;if(k(this.state.type)&&this.lookaheadCharCode()===61)return e.importKind="value",this.tsParseImportEqualsDeclaration(e);if(this.isContextual(128)){let s=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.tsParseImportEqualsDeclaration(e,s);i=super.parseImportSpecifiersAndAfter(e,s)}else i=super.parseImport(e);return i.importKind==="type"&&i.specifiers.length>1&&i.specifiers[0].type==="ImportDefaultSpecifier"&&this.raise(y.TypeImportCannotSpecifyDefaultAndNamed,{at:i}),i}parseExport(e,i){if(this.match(83)){this.next();let s=null;return this.isContextual(128)&&this.isPotentialImportPhase(!1)?s=this.parseMaybeImportPhase(e,!1):e.importKind="value",this.tsParseImportEqualsDeclaration(e,s,!0)}else if(this.eat(29)){let s=e;return s.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(s,"TSExportAssignment")}else if(this.eatContextual(93)){let s=e;return this.expectContextual(126),s.id=this.parseIdentifier(),this.semicolon(),this.finishNode(s,"TSNamespaceExportDeclaration")}else return super.parseExport(e,i)}isAbstractClass(){return this.isContextual(122)&&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(127)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultExpression()}parseVarStatement(e,i,s=!1){let{isAmbientContext:a}=this.state,r=super.parseVarStatement(e,i,s||a);if(!a)return r;for(let{id:o,init:l}of r.declarations)l&&(i!=="const"||o.typeAnnotation?this.raise(y.InitializerNotAllowedInAmbientContext,{at:l}):_c(l,this.hasPlugin("estree"))||this.raise(y.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference,{at:l}));return r}parseStatementContent(e,i){if(this.match(75)&&this.isLookaheadContextual("enum")){let s=this.startNode();return this.expect(75),this.tsParseEnumDeclaration(s,{const:!0})}if(this.isContextual(124))return this.tsParseEnumDeclaration(this.startNode());if(this.isContextual(127)){let s=this.tsParseInterfaceDeclaration(this.startNode());if(s)return s}return super.parseStatementContent(e,i)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(e,i){return i.some(s=>Wa(s)?e.accessibility===s:!!e[s])}tsIsStartOfStaticBlocks(){return this.isContextual(104)&&this.lookaheadCharCode()===123}parseClassMember(e,i,s){let a=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:a,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:y.InvalidModifierOnTypeParameterPositions},i);let r=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(i,a)&&this.raise(y.StaticBlockCannotHaveModifier,{at:this.state.curPosition()}),super.parseClassStaticBlock(e,i)):this.parseClassMemberWithIsStatic(e,i,s,!!i.static)};i.declare?this.tsInAmbientContext(r):r()}parseClassMemberWithIsStatic(e,i,s,a){let r=this.tsTryParseIndexSignature(i);if(r){e.body.push(r),i.abstract&&this.raise(y.IndexSignatureHasAbstract,{at:i}),i.accessibility&&this.raise(y.IndexSignatureHasAccessibility,{at:i,modifier:i.accessibility}),i.declare&&this.raise(y.IndexSignatureHasDeclare,{at:i}),i.override&&this.raise(y.IndexSignatureHasOverride,{at:i});return}!this.state.inAbstractClass&&i.abstract&&this.raise(y.NonAbstractClassHasAbstractMethod,{at:i}),i.override&&(s.hadSuperClass||this.raise(y.OverrideNotInSubClass,{at:i})),super.parseClassMemberWithIsStatic(e,i,s,a)}parsePostMemberNameModifiers(e){this.eat(17)&&(e.optional=!0),e.readonly&&this.match(10)&&this.raise(y.ClassMethodHasReadonly,{at:e}),e.declare&&this.match(10)&&this.raise(y.ClassMethodHasDeclare,{at:e})}parseExpressionStatement(e,i,s){return(i.type==="Identifier"?this.tsParseExpressionStatement(e,i,s):void 0)||super.parseExpressionStatement(e,i,s)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(e,i,s){if(!this.state.maybeInArrowParameters||!this.match(17))return super.parseConditional(e,i,s);let a=this.tryParse(()=>super.parseConditional(e,i));return a.node?(a.error&&(this.state=a.failState),a.node):(a.error&&super.setOptionalParametersError(s,a.error),e)}parseParenItem(e,i){if(e=super.parseParenItem(e,i),this.eat(17)&&(e.optional=!0,this.resetEndLocation(e)),this.match(14)){let s=this.startNodeAt(i);return s.expression=e,s.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(s,"TSTypeCastExpression")}return e}parseExportDeclaration(e){if(!this.state.isAmbientContext&&this.isContextual(123))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));let i=this.state.startLoc,s=this.eatContextual(123);if(s&&(this.isContextual(123)||!this.shouldParseExportDeclaration()))throw this.raise(y.ExpectedAmbientAfterExportDeclare,{at:this.state.startLoc});let r=k(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return r?((r.type==="TSInterfaceDeclaration"||r.type==="TSTypeAliasDeclaration"||s)&&(e.exportKind="type"),s&&(this.resetStartLocation(r,i),r.declare=!0),r):null}parseClassId(e,i,s,a){if((!i||s)&&this.isContextual(111))return;super.parseClassId(e,i,s,e.declare?Ua:hr);let r=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);r&&(e.typeParameters=r)}parseClassPropertyAnnotation(e){e.optional||(this.eat(35)?e.definite=!0:this.eat(17)&&(e.optional=!0));let i=this.tsTryParseTypeAnnotation();i&&(e.typeAnnotation=i)}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&!(e.readonly&&!e.typeAnnotation)&&this.match(29)&&this.raise(y.DeclareClassFieldHasInitializer,{at:this.state.startLoc}),e.abstract&&this.match(29)){let{key:i}=e;this.raise(y.AbstractPropertyHasInitializer,{at:this.state.startLoc,propertyName:i.type==="Identifier"&&!e.computed?i.name:`[${this.input.slice(i.start,i.end)}]`})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(y.PrivateElementHasAbstract,{at:e}),e.accessibility&&this.raise(y.PrivateElementHasAccessibility,{at:e,modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(y.AccessorCannotBeOptional,{at:e}),super.parseClassAccessorProperty(e)}pushClassMethod(e,i,s,a,r,o){let l=this.tsTryParseTypeParameters(this.tsParseConstModifier);l&&r&&this.raise(y.ConstructorHasTypeParameters,{at:l});let{declare:c=!1,kind:p}=i;c&&(p==="get"||p==="set")&&this.raise(y.DeclareAccessor,{at:i,kind:p}),l&&(i.typeParameters=l),super.pushClassMethod(e,i,s,a,r,o)}pushClassPrivateMethod(e,i,s,a){let r=this.tsTryParseTypeParameters(this.tsParseConstModifier);r&&(i.typeParameters=r),super.pushClassPrivateMethod(e,i,s,a)}declareClassPrivateMethodInScope(e,i){e.type!=="TSDeclareMethod"&&(e.type==="MethodDefinition"&&!e.value.body||super.declareClassPrivateMethodInScope(e,i))}parseClassSuper(e){super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeParameters=this.tsParseTypeArgumentsInExpression()),this.eatContextual(111)&&(e.implements=this.tsParseHeritageClause("implements"))}parseObjPropValue(e,i,s,a,r,o,l){let c=this.tsTryParseTypeParameters(this.tsParseConstModifier);return c&&(e.typeParameters=c),super.parseObjPropValue(e,i,s,a,r,o,l)}parseFunctionParams(e,i){let s=this.tsTryParseTypeParameters(this.tsParseConstModifier);s&&(e.typeParameters=s),super.parseFunctionParams(e,i)}parseVarId(e,i){super.parseVarId(e,i),e.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(35)&&(e.definite=!0);let s=this.tsTryParseTypeAnnotation();s&&(e.id.typeAnnotation=s,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,i){return this.match(14)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,i)}parseMaybeAssign(e,i){var s,a,r,o,l;let c,p,h;if(this.hasPlugin("jsx")&&(this.match(140)||this.match(47))){if(c=this.state.clone(),p=this.tryParse(()=>super.parseMaybeAssign(e,i),c),!p.error)return p.node;let{context:m}=this.state,x=m[m.length-1];(x===I.j_oTag||x===I.j_expr)&&m.pop()}if(!((s=p)!=null&&s.error)&&!this.match(47))return super.parseMaybeAssign(e,i);(!c||c===this.state)&&(c=this.state.clone());let u,f=this.tryParse(m=>{var x,b;u=this.tsParseTypeParameters(this.tsParseConstModifier);let A=super.parseMaybeAssign(e,i);return(A.type!=="ArrowFunctionExpression"||(x=A.extra)!=null&&x.parenthesized)&&m(),((b=u)==null?void 0:b.params.length)!==0&&this.resetStartLocationFromNode(A,u),A.typeParameters=u,A},c);if(!f.error&&!f.aborted)return u&&this.reportReservedArrowTypeParam(u),f.node;if(!p&&(Va(!this.hasPlugin("jsx")),h=this.tryParse(()=>super.parseMaybeAssign(e,i),c),!h.error))return h.node;if((a=p)!=null&&a.node)return this.state=p.failState,p.node;if(f.node)return this.state=f.failState,u&&this.reportReservedArrowTypeParam(u),f.node;if((r=h)!=null&&r.node)return this.state=h.failState,h.node;throw((o=p)==null?void 0:o.error)||f.error||((l=h)==null?void 0:l.error)}reportReservedArrowTypeParam(e){var i;e.params.length===1&&!e.params[0].constraint&&!((i=e.extra)!=null&&i.trailingComma)&&this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(y.ReservedArrowTypeParam,{at:e})}parseMaybeUnary(e,i){return!this.hasPlugin("jsx")&&this.match(47)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,i)}parseArrow(e){if(this.match(14)){let i=this.tryParse(s=>{let a=this.tsParseTypeOrTypePredicateAnnotation(14);return(this.canInsertSemicolon()||!this.match(19))&&s(),a});if(i.aborted)return;i.thrown||(i.error&&(this.state=i.failState),e.returnType=i.node)}return super.parseArrow(e)}parseAssignableListItemTypes(e,i){if(!(i&2))return e;this.eat(17)&&(e.optional=!0);let s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s),this.resetEndLocation(e),e}isAssignable(e,i){switch(e.type){case"TSTypeCastExpression":return this.isAssignable(e.expression,i);case"TSParameterProperty":return!0;default:return super.isAssignable(e,i)}}toAssignable(e,i=!1){switch(e.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(e,i);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":i?this.expressionScope.recordArrowParameterBindingError(y.UnexpectedTypeCastInParameter,{at:e}):this.raise(y.UnexpectedTypeCastInParameter,{at:e}),this.toAssignable(e.expression,i);break;case"AssignmentExpression":!i&&e.left.type==="TSTypeCastExpression"&&(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,i)}}toAssignableParenthesizedExpression(e,i){switch(e.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(e.expression,i);break;default:super.toAssignable(e,i)}}checkToRestConversion(e,i){switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(e.expression,!1);break;default:super.checkToRestConversion(e,i)}}isValidLVal(e,i,s){return Ec({TSTypeCastExpression:!0,TSParameterProperty:"parameter",TSNonNullExpression:"expression",TSAsExpression:(s!==ne||!i)&&["expression",!0],TSSatisfiesExpression:(s!==ne||!i)&&["expression",!0],TSTypeAssertion:(s!==ne||!i)&&["expression",!0]},e)||super.isValidLVal(e,i,s)}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e){if(this.match(47)||this.match(51)){let i=this.tsParseTypeArgumentsInExpression();if(this.match(10)){let s=super.parseMaybeDecoratorArguments(e);return s.typeParameters=i,s}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,i){let s=super.parseMaybeDefault(e,i);return s.type==="AssignmentPattern"&&s.typeAnnotation&&s.right.start<s.typeAnnotation.start&&this.raise(y.TypeAnnotationAfterAssign,{at:s.typeAnnotation}),s}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,i,s){for(let a=0;a<e.length;a++){let r=e[a];(r==null?void 0:r.type)==="TSTypeCastExpression"&&(e[a]=this.typeCastToParameter(r))}super.toAssignableList(e,i,s)}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(i=>this.isAssignable(i,!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 i=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());i&&(e.typeParameters=i)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){let i=super.getGetterSetterExpectedParamCount(e),a=this.getObjectOrClassMethodParams(e)[0];return a&&this.isThisParam(a)?i+1:i}parseCatchClauseParam(){let e=super.parseCatchClauseParam(),i=this.tsTryParseTypeAnnotation();return i&&(e.typeAnnotation=i,this.resetEndLocation(e)),e}tsInAmbientContext(e){let i=this.state.isAmbientContext;this.state.isAmbientContext=!0;try{return e()}finally{this.state.isAmbientContext=i}}parseClass(e,i,s){let a=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,i,s)}finally{this.state.inAbstractClass=a}}tsParseAbstractDeclaration(e,i){if(this.match(80))return e.abstract=!0,this.maybeTakeDecorators(i,this.parseClass(e,!0,!1));if(this.isContextual(127)){if(!this.hasFollowingLineBreak())return e.abstract=!0,this.raise(y.NonClassMethodPropertyHasAbstractModifer,{at:e}),this.tsParseInterfaceDeclaration(e)}else this.unexpected(null,80)}parseMethod(e,i,s,a,r,o,l){let c=super.parseMethod(e,i,s,a,r,o,l);if(c.abstract&&(this.hasPlugin("estree")?!!c.value.body:!!c.body)){let{key:h}=c;this.raise(y.AbstractMethodHasImplementation,{at: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,i,s,a){return!i&&a?(this.parseTypeOnlyImportExportSpecifier(e,!1,s),this.finishNode(e,"ExportSpecifier")):(e.exportKind="value",super.parseExportSpecifier(e,i,s,a))}parseImportSpecifier(e,i,s,a,r){return!i&&a?(this.parseTypeOnlyImportExportSpecifier(e,!0,s),this.finishNode(e,"ImportSpecifier")):(e.importKind="value",super.parseImportSpecifier(e,i,s,a,s?qa:Ve))}parseTypeOnlyImportExportSpecifier(e,i,s){let a=i?"imported":"local",r=i?"local":"exported",o=e[a],l,c=!1,p=!0,h=o.loc.start;if(this.isContextual(93)){let f=this.parseIdentifier();if(this.isContextual(93)){let m=this.parseIdentifier();U(this.state.type)?(c=!0,o=f,l=i?this.parseIdentifier():this.parseModuleExportName(),p=!1):(l=m,p=!1)}else U(this.state.type)?(p=!1,l=i?this.parseIdentifier():this.parseModuleExportName()):(c=!0,o=f)}else U(this.state.type)&&(c=!0,i?(o=this.parseIdentifier(!0),this.isContextual(93)||this.checkReservedWord(o.name,o.loc.start,!0,!0)):o=this.parseModuleExportName());c&&s&&this.raise(i?y.TypeModifierIsUsedInTypeImports:y.TypeModifierIsUsedInTypeExports,{at:h}),e[a]=o,e[r]=l;let u=i?"importKind":"exportKind";e[u]=c?"type":"value",p&&this.eatContextual(93)&&(e[r]=i?this.parseIdentifier():this.parseModuleExportName()),e[r]||(e[r]=ie(e[a])),i&&this.checkIdentifier(e[r],c?qa:Ve)}};function Nc(n){if(n.type!=="MemberExpression")return!1;let{computed:t,property:e}=n;return t&&e.type!=="StringLiteral"&&(e.type!=="TemplateLiteral"||e.expressions.length>0)?!1:Er(n.object)}function _c(n,t){var e;let{type:i}=n;if((e=n.extra)!=null&&e.parenthesized)return!1;if(t){if(i==="Literal"){let{value:s}=n;if(typeof s=="string"||typeof s=="boolean")return!0}}else if(i==="StringLiteral"||i==="BooleanLiteral")return!0;return!!(Ar(n,t)||Lc(n,t)||i==="TemplateLiteral"&&n.expressions.length===0||Nc(n))}function Ar(n,t){return t?n.type==="Literal"&&(typeof n.value=="number"||"bigint"in n):n.type==="NumericLiteral"||n.type==="BigIntLiteral"}function Lc(n,t){if(n.type==="UnaryExpression"){let{operator:e,argument:i}=n;if(e==="-"&&Ar(i,t))return!0}return!1}function Er(n){return n.type==="Identifier"?!0:n.type!=="MemberExpression"||n.computed?!1:Er(n.object)}var Ga=ee`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."}),Mc=n=>class extends n{parsePlaceholder(e){if(this.match(142)){let i=this.startNode();return this.next(),this.assertNoSpace(),i.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(142),this.finishPlaceholder(i,e)}}finishPlaceholder(e,i){let s=!!(e.expectedNode&&e.type==="Placeholder");return e.expectedNode=i,s?e:this.finishNode(e,"Placeholder")}getTokenFromCode(e){e===37&&this.input.charCodeAt(this.state.pos+1)===37?this.finishOp(142,2):super.getTokenFromCode(e)}parseExprAtom(e){return this.parsePlaceholder("Expression")||super.parseExprAtom(e)}parseIdentifier(e){return this.parsePlaceholder("Identifier")||super.parseIdentifier(e)}checkReservedWord(e,i,s,a){e!==void 0&&super.checkReservedWord(e,i,s,a)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(e,i,s){return e==="Placeholder"||super.isValidLVal(e,i,s)}toAssignable(e,i){e&&e.type==="Placeholder"&&e.expectedNode==="Expression"?e.expectedNode="Pattern":super.toAssignable(e,i)}chStartsBindingIdentifier(e,i){return!!(super.chStartsBindingIdentifier(e,i)||this.lookahead().type===142)}verifyBreakContinue(e,i){e.label&&e.label.type==="Placeholder"||super.verifyBreakContinue(e,i)}parseExpressionStatement(e,i){if(i.type!=="Placeholder"||i.extra&&i.extra.parenthesized)return super.parseExpressionStatement(e,i);if(this.match(14)){let s=e;return s.label=this.finishPlaceholder(i,"Identifier"),this.next(),s.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(s,"LabeledStatement")}return this.semicolon(),e.name=i.name,this.finishPlaceholder(e,"Statement")}parseBlock(e,i,s){return this.parsePlaceholder("BlockStatement")||super.parseBlock(e,i,s)}parseFunctionId(e){return this.parsePlaceholder("Identifier")||super.parseFunctionId(e)}parseClass(e,i,s){let a=i?"ClassDeclaration":"ClassExpression";this.next();let r=this.state.strict,o=this.parsePlaceholder("Identifier");if(o)if(this.match(81)||this.match(142)||this.match(5))e.id=o;else{if(s||!i)return e.id=null,e.body=this.finishPlaceholder(o,"ClassBody"),this.finishNode(e,a);throw this.raise(Ga.ClassNameIsRequired,{at:this.state.startLoc})}else this.parseClassId(e,i,s);return super.parseClassSuper(e),e.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!e.superClass,r),this.finishNode(e,a)}parseExport(e,i){let s=this.parsePlaceholder("Identifier");if(!s)return super.parseExport(e,i);if(!this.isContextual(97)&&!this.match(12))return e.specifiers=[],e.source=null,e.declaration=this.finishPlaceholder(s,"Declaration"),this.finishNode(e,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");let a=this.startNode();return a.exported=s,e.specifiers=[this.finishNode(a,"ExportDefaultSpecifier")],super.parseExport(e,i)}isExportDefaultSpecifier(){if(this.match(65)){let e=this.nextTokenStart();if(this.isUnparsedContextual(e,"from")&&this.input.startsWith(oe(142),this.nextTokenStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,i){var s;return(s=e.specifiers)!=null&&s.length?!0:super.maybeParseExportDefaultSpecifier(e,i)}checkExport(e){let{specifiers:i}=e;i!=null&&i.length&&(e.specifiers=i.filter(s=>s.exported.type==="Placeholder")),super.checkExport(e),e.specifiers=i}parseImport(e){let i=this.parsePlaceholder("Identifier");if(!i)return super.parseImport(e);if(e.specifiers=[],!this.isContextual(97)&&!this.match(12))return e.source=this.finishPlaceholder(i,"StringLiteral"),this.semicolon(),this.finishNode(e,"ImportDeclaration");let s=this.startNodeAtNode(i);return s.local=i,e.specifiers.push(this.finishNode(s,"ImportDefaultSpecifier")),this.eat(12)&&(this.maybeParseStarImportSpecifier(e)||this.parseNamedImportSpecifiers(e)),this.expectContextual(97),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(Ga.UnexpectedSpace,{at:this.state.lastTokEndLoc})}},Oc=n=>class extends n{parseV8Intrinsic(){if(this.match(54)){let e=this.state.startLoc,i=this.startNode();if(this.next(),k(this.state.type)){let s=this.parseIdentifierName(),a=this.createIdentifier(i,s);if(a.type="V8IntrinsicIdentifier",this.match(10))return a}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}};function L(n,t){let[e,i]=typeof t=="string"?[t,{}]:t,s=Object.keys(i),a=s.length===0;return n.some(r=>{if(typeof r=="string")return a&&r===e;{let[o,l]=r;if(o!==e)return!1;for(let c of s)if(l[c]!==i[c])return!1;return!0}})}function he(n,t,e){let i=n.find(s=>Array.isArray(s)?s[0]===t:s===t);return i&&Array.isArray(i)&&i.length>1?i[1][e]:null}var Xa=["minimal","fsharp","hack","smart"],Ja=["^^","@@","^","%","#"],Qa=["hash","bar"];function Dc(n){if(L(n,"decorators")){if(L(n,"decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");let t=he(n,"decorators","decoratorsBeforeExport");if(t!=null&&typeof t!="boolean")throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");let e=he(n,"decorators","allowCallParenthesized");if(e!=null&&typeof e!="boolean")throw new Error("'allowCallParenthesized' must be a boolean.")}if(L(n,"flow")&&L(n,"typescript"))throw new Error("Cannot combine flow and typescript plugins.");if(L(n,"placeholders")&&L(n,"v8intrinsic"))throw new Error("Cannot combine placeholders and v8intrinsic plugins.");if(L(n,"pipelineOperator")){let t=he(n,"pipelineOperator","proposal");if(!Xa.includes(t)){let i=Xa.map(s=>`"${s}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${i}.`)}let e=L(n,["recordAndTuple",{syntaxType:"hash"}]);if(t==="hack"){if(L(n,"placeholders"))throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");if(L(n,"v8intrinsic"))throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");let i=he(n,"pipelineOperator","topicToken");if(!Ja.includes(i)){let s=Ja.map(a=>`"${a}"`).join(", ");throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${s}.`)}if(i==="#"&&e)throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "hack", topicToken: "#" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.')}else if(t==="smart"&&e)throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "smart" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.')}if(L(n,"moduleAttributes")){if(L(n,"importAssertions")||L(n,"importAttributes"))throw new Error("Cannot combine importAssertions, importAttributes and moduleAttributes plugins.");if(he(n,"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(L(n,"importAssertions")&&L(n,"importAttributes"))throw new Error("Cannot combine importAssertions and importAttributes plugins.");if(L(n,"recordAndTuple")&&he(n,"recordAndTuple","syntaxType")!=null&&!Qa.includes(he(n,"recordAndTuple","syntaxType")))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+Qa.map(t=>`'${t}'`).join(", "));if(L(n,"asyncDoExpressions")&&!L(n,"doExpressions")){let t=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw t.missingPlugins="doExpressions",t}}var Sr={estree:Pl,jsx:Tc,flow:wc,typescript:Ic,v8intrinsic:Oc,placeholders:Mc},Bc=Object.keys(Sr),Ya={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,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0};function Fc(n){if(n&&n.annexB!=null&&n.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");let t={};for(let e of Object.keys(Ya))t[e]=n&&n[e]!=null?n[e]:Ya[e];return t}var Ci=class extends Si{checkProto(t,e,i,s){if(t.type==="SpreadElement"||this.isObjectMethod(t)||t.computed||t.shorthand)return;let a=t.key;if((a.type==="Identifier"?a.name:a.value)==="__proto__"){if(e){this.raise(d.RecordNoProto,{at:a});return}i.used&&(s?s.doubleProtoLoc===null&&(s.doubleProtoLoc=a.loc.start):this.raise(d.DuplicateProto,{at:a})),i.used=!0}}shouldExitDescending(t,e){return t.type==="ArrowFunctionExpression"&&t.start===e}getExpression(){this.enterInitialScopes(),this.nextToken();let t=this.parseExpression();return this.match(137)||this.unexpected(),this.finalizeRemainingComments(),t.comments=this.state.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,i=this.parseMaybeAssign(t);if(this.match(12)){let s=this.startNodeAt(e);for(s.expressions=[i];this.eat(12);)s.expressions.push(this.parseMaybeAssign(t));return this.toReferencedList(s.expressions),this.finishNode(s,"SequenceExpression")}return i}parseMaybeAssignDisallowIn(t,e){return this.disallowInAnd(()=>this.parseMaybeAssign(t,e))}parseMaybeAssignAllowIn(t,e){return this.allowInAnd(()=>this.parseMaybeAssign(t,e))}setOptionalParametersError(t,e){var i;t.optionalParametersLoc=(i=e==null?void 0:e.loc)!=null?i:this.state.startLoc}parseMaybeAssign(t,e){let i=this.state.startLoc;if(this.isContextual(106)&&this.prodParam.hasYield){let o=this.parseYield();return e&&(o=e.call(this,o,i)),o}let s;t?s=!1:(t=new ke,s=!0);let{type:a}=this.state;(a===10||k(a))&&(this.state.potentialArrowAt=this.state.start);let r=this.parseMaybeConditional(t);if(e&&(r=e.call(this,r,i)),Cl(this.state.type)){let o=this.startNodeAt(i),l=this.state.value;if(o.operator=l,this.match(29)){this.toAssignable(r,!0),o.left=r;let c=i.index;t.doubleProtoLoc!=null&&t.doubleProtoLoc.index>=c&&(t.doubleProtoLoc=null),t.shorthandAssignLoc!=null&&t.shorthandAssignLoc.index>=c&&(t.shorthandAssignLoc=null),t.privateKeyLoc!=null&&t.privateKeyLoc.index>=c&&(this.checkDestructuringPrivate(t),t.privateKeyLoc=null)}else o.left=r;return this.next(),o.right=this.parseMaybeAssign(),this.checkLVal(r,{in:this.finishNode(o,"AssignmentExpression")}),o}else s&&this.checkExpressionErrors(t,!0);return r}parseMaybeConditional(t){let e=this.state.startLoc,i=this.state.potentialArrowAt,s=this.parseExprOps(t);return this.shouldExitDescending(s,i)?s:this.parseConditional(s,e,t)}parseConditional(t,e,i){if(this.eat(17)){let s=this.startNodeAt(e);return s.test=t,s.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),s.alternate=this.parseMaybeAssign(),this.finishNode(s,"ConditionalExpression")}return t}parseMaybeUnaryOrPrivate(t){return this.match(136)?this.parsePrivateName():this.parseMaybeUnary(t)}parseExprOps(t){let e=this.state.startLoc,i=this.state.potentialArrowAt,s=this.parseMaybeUnaryOrPrivate(t);return this.shouldExitDescending(s,i)?s:this.parseExprOp(s,e,-1)}parseExprOp(t,e,i){if(this.isPrivateName(t)){let a=this.getPrivateNameSV(t);(i>=wt(58)||!this.prodParam.hasIn||!this.match(58))&&this.raise(d.PrivateInExpectedIn,{at:t,identifierName:a}),this.classScope.usePrivateName(a,t.loc.start)}let s=this.state.type;if(Il(s)&&(this.prodParam.hasIn||!this.match(58))){let a=wt(s);if(a>i){if(s===39){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return t;this.checkPipelineAtInfixOperator(t,e)}let r=this.startNodeAt(e);r.left=t,r.operator=this.state.value;let o=s===41||s===42,l=s===40;if(l&&(a=wt(42)),this.next(),s===39&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])&&this.state.type===96&&this.prodParam.hasAwait)throw this.raise(d.UnexpectedAwaitAfterPipelineBody,{at:this.state.startLoc});r.right=this.parseExprOpRightExpr(s,a);let c=this.finishNode(r,o||l?"LogicalExpression":"BinaryExpression"),p=this.state.type;if(l&&(p===41||p===42)||o&&p===40)throw this.raise(d.MixingCoalesceWithLogical,{at:this.state.startLoc});return this.parseExprOp(c,e,i)}}return t}parseExprOpRightExpr(t,e){let i=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(106))throw this.raise(d.PipeBodyIsTighter,{at:this.state.startLoc});return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(t,e),i)});case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(e))}default:return this.parseExprOpBaseRightExpr(t,e)}}parseExprOpBaseRightExpr(t,e){let i=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),i,Ol(t)?e-1:e)}parseHackPipeBody(){var t;let{startLoc:e}=this.state,i=this.parseMaybeAssign();return xl.has(i.type)&&!((t=i.extra)!=null&&t.parenthesized)&&this.raise(d.PipeUnparenthesizedBody,{at:e,type:i.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(d.PipeTopicUnused,{at:e}),i}checkExponentialAfterUnary(t){this.match(57)&&this.raise(d.UnexpectedTokenUnaryExponentiation,{at:t.argument})}parseMaybeUnary(t,e){let i=this.state.startLoc,s=this.isContextual(96);if(s&&this.isAwaitAllowed()){this.next();let l=this.parseAwait(i);return e||this.checkExponentialAfterUnary(l),l}let a=this.match(34),r=this.startNode();if(_l(this.state.type)){r.operator=this.state.value,r.prefix=!0,this.match(72)&&this.expectPlugin("throwExpressions");let l=this.match(89);if(this.next(),r.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),this.state.strict&&l){let c=r.argument;c.type==="Identifier"?this.raise(d.StrictDelete,{at:r}):this.hasPropertyAsPrivateName(c)&&this.raise(d.DeletePrivateField,{at:r})}if(!a)return e||this.checkExponentialAfterUnary(r),this.finishNode(r,"UnaryExpression")}let o=this.parseUpdate(r,a,t);if(s){let{type:l}=this.state;if((this.hasPlugin("v8intrinsic")?oi(l):oi(l)&&!this.match(54))&&!this.isAmbiguousAwait())return this.raiseOverwrite(d.AwaitNotInAsyncContext,{at:i}),this.parseAwait(i)}return o}parseUpdate(t,e,i){if(e){let r=t;return this.checkLVal(r.argument,{in:this.finishNode(r,"UpdateExpression")}),t}let s=this.state.startLoc,a=this.parseExprSubscripts(i);if(this.checkExpressionErrors(i,!1))return a;for(;Nl(this.state.type)&&!this.canInsertSemicolon();){let r=this.startNodeAt(s);r.operator=this.state.value,r.prefix=!1,r.argument=a,this.next(),this.checkLVal(a,{in:a=this.finishNode(r,"UpdateExpression")})}return a}parseExprSubscripts(t){let e=this.state.startLoc,i=this.state.potentialArrowAt,s=this.parseExprAtom(t);return this.shouldExitDescending(s,i)?s:this.parseSubscripts(s,e)}parseSubscripts(t,e,i){let s={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(t),stop:!1};do t=this.parseSubscript(t,e,i,s),s.maybeAsyncArrow=!1;while(!s.stop);return t}parseSubscript(t,e,i,s){let{type:a}=this.state;if(!i&&a===15)return this.parseBind(t,e,i,s);if(Ct(a))return this.parseTaggedTemplateExpression(t,e,s);let r=!1;if(a===18){if(i&&(this.raise(d.OptionalChainingNoNew,{at:this.state.startLoc}),this.lookaheadCharCode()===40))return s.stop=!0,t;s.optionalChainMember=r=!0,this.next()}if(!i&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(t,e,s,r);{let o=this.eat(0);return o||r||this.eat(16)?this.parseMember(t,e,s,o,r):(s.stop=!0,t)}}parseMember(t,e,i,s,a){let r=this.startNodeAt(e);return r.object=t,r.computed=s,s?(r.property=this.parseExpression(),this.expect(3)):this.match(136)?(t.type==="Super"&&this.raise(d.SuperPrivateField,{at:e}),this.classScope.usePrivateName(this.state.value,this.state.startLoc),r.property=this.parsePrivateName()):r.property=this.parseIdentifier(!0),i.optionalChainMember?(r.optional=a,this.finishNode(r,"OptionalMemberExpression")):this.finishNode(r,"MemberExpression")}parseBind(t,e,i,s){let a=this.startNodeAt(e);return a.object=t,this.next(),a.callee=this.parseNoCallExpr(),s.stop=!0,this.parseSubscripts(this.finishNode(a,"BindExpression"),e,i)}parseCoverCallAndAsyncArrowHead(t,e,i,s){let a=this.state.maybeInArrowParameters,r=null;this.state.maybeInArrowParameters=!0,this.next();let o=this.startNodeAt(e);o.callee=t;let{maybeAsyncArrow:l,optionalChainMember:c}=i;l&&(this.expressionScope.enter(dc()),r=new ke),c&&(o.optional=s),s?o.arguments=this.parseCallExpressionArguments(11):o.arguments=this.parseCallExpressionArguments(11,t.type==="Import",t.type!=="Super",o,r);let p=this.finishCallExpression(o,c);return l&&this.shouldParseAsyncArrow()&&!s?(i.stop=!0,this.checkDestructuringPrivate(r),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),p=this.parseAsyncArrowFromCallExpression(this.startNodeAt(e),p)):(l&&(this.checkExpressionErrors(r,!0),this.expressionScope.exit()),this.toReferencedArguments(p)),this.state.maybeInArrowParameters=a,p}toReferencedArguments(t,e){this.toReferencedListDeep(t.arguments,e)}parseTaggedTemplateExpression(t,e,i){let s=this.startNodeAt(e);return s.tag=t,s.quasi=this.parseTemplate(!0),i.optionalChainMember&&this.raise(d.OptionalChainingNoTemplate,{at:e}),this.finishNode(s,"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}expectImportAttributesPlugin(){this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes")}finishCallExpression(t,e){if(t.callee.type==="Import")if(t.arguments.length===2&&(this.hasPlugin("moduleAttributes")||this.expectImportAttributesPlugin()),t.arguments.length===0||t.arguments.length>2)this.raise(d.ImportCallArity,{at:t,maxArgumentCount:this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions")||this.hasPlugin("moduleAttributes")?2:1});else for(let i of t.arguments)i.type==="SpreadElement"&&this.raise(d.ImportCallSpreadArgument,{at:i});return this.finishNode(t,e?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(t,e,i,s,a){let r=[],o=!0,l=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(d.ImportCallArgumentTrailingComma,{at:this.state.lastTokStartLoc}),s&&this.addTrailingCommaExtraToNode(s),this.next();break}r.push(this.parseExprListItem(!1,a,i))}return this.state.inFSharpPipelineDirectBody=l,r}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(t,e){var i;return this.resetPreviousNodeTrailingComments(e),this.expect(19),this.parseArrowExpression(t,e.arguments,!0,(i=e.extra)==null?void 0:i.trailingCommaLoc),e.innerComments&&Je(t,e.innerComments),e.callee.trailingComments&&Je(t,e.callee.trailingComments),t}parseNoCallExpr(){let t=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),t,!0)}parseExprAtom(t){let e,i=null,{type:s}=this.state;switch(s){case 79:return this.parseSuper();case 83:return e=this.startNode(),this.next(),this.match(16)?this.parseImportMetaProperty(e):(this.match(10)||this.raise(d.UnsupportedImport,{at:this.state.lastTokStartLoc}),this.finishNode(e,"Import"));case 78:return e=this.startNode(),this.next(),this.finishNode(e,"ThisExpression");case 90:return this.parseDo(this.startNode(),!1);case 56:case 31:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 132:return this.parseNumericLiteral(this.state.value);case 133:return this.parseBigIntLiteral(this.state.value);case 134:return this.parseDecimalLiteral(this.state.value);case 131: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 a=this.state.potentialArrowAt===this.state.start;return this.parseParenAndDistinguishExpression(a)}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:i=this.parseDecorators();case 80:return this.parseClass(this.maybeTakeDecorators(i,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 a=e.callee=this.parseNoCallExpr();if(a.type==="MemberExpression")return this.finishNode(e,"BindExpression");throw this.raise(d.UnsupportedBind,{at:a})}case 136:return this.raise(d.PrivateInExpectedIn,{at:this.state.startLoc,identifierName:this.state.value}),this.parsePrivateName();case 33:return this.parseTopicReferenceThenEqualsSign(54,"%");case 32:return this.parseTopicReferenceThenEqualsSign(44,"^");case 37:case 38:return this.parseTopicReference("hack");case 44:case 54:case 27:{let a=this.getPluginOption("pipelineOperator","proposal");if(a)return this.parseTopicReference(a);this.unexpected();break}case 47:{let a=this.input.codePointAt(this.nextTokenStart());Z(a)||a===62?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected();break}default:if(k(s)){if(this.isContextual(125)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let a=this.state.potentialArrowAt===this.state.start,r=this.state.containsEsc,o=this.parseIdentifier();if(!r&&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(k(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 a&&this.match(19)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(o),[o],!1)):o}else this.unexpected()}}parseTopicReferenceThenEqualsSign(t,e){let i=this.getPluginOption("pipelineOperator","proposal");if(i)return this.state.type=t,this.state.value=e,this.state.pos--,this.state.end--,this.state.endLoc=B(this.state.endLoc,-1),this.parseTopicReference(i);this.unexpected()}parseTopicReference(t){let e=this.startNode(),i=this.state.startLoc,s=this.state.type;return this.next(),this.finishTopicReference(e,i,t,s)}finishTopicReference(t,e,i,s){if(this.testTopicReferenceConfiguration(i,e,s)){let a=i==="smart"?"PipelinePrimaryTopicReference":"TopicReference";return this.topicReferenceIsAllowedInCurrentContext()||this.raise(i==="smart"?d.PrimaryTopicNotAllowed:d.PipeTopicUnbound,{at:e}),this.registerTopicReference(),this.finishNode(t,a)}else throw this.raise(d.PipeTopicUnconfiguredToken,{at:e,token:oe(s)})}testTopicReferenceConfiguration(t,e,i){switch(t){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:oe(i)}]);case"smart":return i===27;default:throw this.raise(d.PipeTopicRequiresHackPipes,{at:e})}}parseAsyncArrowUnaryFunction(t){this.prodParam.enter(At(!0,this.prodParam.hasYield));let e=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(d.LineTerminatorBeforeArrow,{at: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 i=this.state.labels;return this.state.labels=[],e?(this.prodParam.enter(Bt),t.body=this.parseBlock(),this.prodParam.exit()):t.body=this.parseBlock(),this.state.labels=i,this.finishNode(t,"DoExpression")}parseSuper(){let t=this.startNode();return this.next(),this.match(10)&&!this.scope.allowDirectSuper&&!this.options.allowSuperOutsideMethod?this.raise(d.SuperNotAllowed,{at:t}):!this.scope.allowSuper&&!this.options.allowSuperOutsideMethod&&this.raise(d.UnexpectedSuper,{at:t}),!this.match(10)&&!this.match(0)&&!this.match(16)&&this.raise(d.UnsupportedSuper,{at:t}),this.finishNode(t,"Super")}parsePrivateName(){let t=this.startNode(),e=this.startNodeAt(B(this.state.startLoc,1)),i=this.state.value;return this.next(),t.id=this.createIdentifier(e,i),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(102)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected(),this.parseMetaProperty(t,e,"sent")}return this.parseFunction(t)}parseMetaProperty(t,e,i){t.meta=e;let s=this.state.containsEsc;return t.property=this.parseIdentifier(!0),(t.property.name!==i||s)&&this.raise(d.UnsupportedMetaProperty,{at:t.property,target:e.name,onlyValidPropertyName:i}),this.finishNode(t,"MetaProperty")}parseImportMetaProperty(t){let e=this.createIdentifier(this.startNodeAtNode(t),"import");return this.next(),this.isContextual(100)&&(this.inModule||this.raise(d.ImportMetaOutsideModule,{at:e}),this.sawUnambiguousESM=!0),this.parseMetaProperty(t,e,"meta")}parseLiteralAtNode(t,e,i){return this.addExtra(i,"rawValue",t),this.addExtra(i,"raw",this.input.slice(i.start,this.state.end)),i.value=t,this.next(),this.finishNode(i,e)}parseLiteral(t,e){let i=this.startNode();return this.parseLiteralAtNode(t,e,i)}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.parseLiteral(t.value,"RegExpLiteral");return e.pattern=t.pattern,e.flags=t.flags,e}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,i;this.next(),this.expressionScope.enter(uc());let s=this.state.maybeInArrowParameters,a=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;let r=this.state.startLoc,o=[],l=new ke,c=!0,p,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 m=this.state.startLoc;if(p=this.state.startLoc,o.push(this.parseParenItem(this.parseRestBinding(),m)),!this.checkCommaAfterRest(41))break}else o.push(this.parseMaybeAssignAllowIn(l,this.parseParenItem))}let u=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=s,this.state.inFSharpPipelineDirectBody=a;let f=this.startNodeAt(e);return t&&this.shouldParseArrow(o)&&(f=this.parseArrow(f))?(this.checkDestructuringPrivate(l),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(f,o,!1),f):(this.expressionScope.exit(),o.length||this.unexpected(this.state.lastTokStartLoc),h&&this.unexpected(h),p&&this.unexpected(p),this.checkExpressionErrors(l,!0),this.toReferencedListDeep(o,!0),o.length>1?(i=this.startNodeAt(r),i.expressions=o,this.finishNode(i,"SequenceExpression"),this.resetEndLocation(i,u)):i=o[0],this.wrapParenthesis(e,i))}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 i=this.startNodeAt(t);return i.expression=e,this.finishNode(i,"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 i=this.parseMetaProperty(t,e,"target");return!this.scope.inNonArrowFunction&&!this.scope.inClass&&!this.options.allowNewTargetOutsideFunction&&this.raise(d.UnexpectedNewTarget,{at:i}),i}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){t.callee=this.parseNoCallExpr(),t.callee.type==="Import"&&this.raise(d.ImportCallNotNewExpression,{at:t.callee})}parseTemplateElement(t){let{start:e,startLoc:i,end:s,value:a}=this.state,r=e+1,o=this.startNodeAt(B(i,1));a===null&&(t||this.raise(d.InvalidEscapeSequenceTemplate,{at:B(this.state.firstInvalidTemplateEscapePos,1)}));let l=this.match(24),c=l?-1:-2,p=s+c;o.value={raw:this.input.slice(r,p).replace(/\r\n?/g,`
|
|
15
|
-
`),cooked:a===null?null:a.slice(1,c)},o.tail=l,this.next();let h=this.finishNode(o,"TemplateElement");return this.resetEndLocation(h,B(this.state.lastTokEndLoc,c)),h}parseTemplate(t){let e=this.startNode();e.expressions=[];let i=this.parseTemplateElement(t);for(e.quasis=[i];!i.tail;)e.expressions.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),e.quasis.push(i=this.parseTemplateElement(t));return this.finishNode(e,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(t,e,i,s){i&&this.expectPlugin("recordAndTuple");let a=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let r=Object.create(null),o=!0,l=this.startNode();for(l.properties=[],this.next();!this.match(t);){if(o)o=!1;else if(this.expect(12),this.match(t)){this.addTrailingCommaExtraToNode(l);break}let p;e?p=this.parseBindingProperty():(p=this.parsePropertyDefinition(s),this.checkProto(p,i,r,s)),i&&!this.isObjectProperty(p)&&p.type!=="SpreadElement"&&this.raise(d.InvalidRecordProperty,{at:p}),p.shorthand&&this.addExtra(p,"shorthand",!0),l.properties.push(p)}this.next(),this.state.inFSharpPipelineDirectBody=a;let c="ObjectExpression";return e?c="ObjectPattern":i&&(c="RecordExpression"),this.finishNode(l,c)}addTrailingCommaExtraToNode(t){this.addExtra(t,"trailingComma",this.state.lastTokStart),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(d.UnsupportedPropertyDecorator,{at:this.state.startLoc});this.match(26);)e.push(this.parseDecorator());let i=this.startNode(),s=!1,a=!1,r;if(this.match(21))return e.length&&this.unexpected(),this.parseSpread();e.length&&(i.decorators=e,e=[]),i.method=!1,t&&(r=this.state.startLoc);let o=this.eat(55);this.parsePropertyNamePrefixOperator(i);let l=this.state.containsEsc,c=this.parsePropertyName(i,t);if(!o&&!l&&this.maybeAsyncOrAccessorProp(i)){let p=c.name;p==="async"&&!this.hasPrecedingLineBreak()&&(s=!0,this.resetPreviousNodeTrailingComments(c),o=this.eat(55),this.parsePropertyName(i)),(p==="get"||p==="set")&&(a=!0,this.resetPreviousNodeTrailingComments(c),i.kind=p,this.match(55)&&(o=!0,this.raise(d.AccessorIsGenerator,{at:this.state.curPosition(),kind:p}),this.next()),this.parsePropertyName(i))}return this.parseObjPropValue(i,r,o,s,!1,a,t)}getGetterSetterExpectedParamCount(t){return t.kind==="get"?0:1}getObjectOrClassMethodParams(t){return t.params}checkGetterSetterParams(t){var e;let i=this.getGetterSetterExpectedParamCount(t),s=this.getObjectOrClassMethodParams(t);s.length!==i&&this.raise(t.kind==="get"?d.BadGetterArity:d.BadSetterArity,{at:t}),t.kind==="set"&&((e=s[s.length-1])==null?void 0:e.type)==="RestElement"&&this.raise(d.BadSetterRestParameter,{at:t})}parseObjectMethod(t,e,i,s,a){if(a){let r=this.parseMethod(t,e,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(r),r}if(i||e||this.match(10))return s&&this.unexpected(),t.kind="method",t.method=!0,this.parseMethod(t,e,i,!1,!1,"ObjectMethod")}parseObjectProperty(t,e,i,s){if(t.shorthand=!1,this.eat(14))return t.value=i?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowIn(s),this.finishNode(t,"ObjectProperty");if(!t.computed&&t.key.type==="Identifier"){if(this.checkReservedWord(t.key.name,t.key.loc.start,!0,!1),i)t.value=this.parseMaybeDefault(e,ie(t.key));else if(this.match(29)){let a=this.state.startLoc;s!=null?s.shorthandAssignLoc===null&&(s.shorthandAssignLoc=a):this.raise(d.InvalidCoverInitializedName,{at:a}),t.value=this.parseMaybeDefault(e,ie(t.key))}else t.value=ie(t.key);return t.shorthand=!0,this.finishNode(t,"ObjectProperty")}}parseObjPropValue(t,e,i,s,a,r,o){let l=this.parseObjectMethod(t,i,s,a,r)||this.parseObjectProperty(t,e,a,o);return l||this.unexpected(),l}parsePropertyName(t,e){if(this.eat(0))t.computed=!0,t.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let{type:i,value:s}=this.state,a;if(U(i))a=this.parseIdentifier(!0);else switch(i){case 132:a=this.parseNumericLiteral(s);break;case 131:a=this.parseStringLiteral(s);break;case 133:a=this.parseBigIntLiteral(s);break;case 134:a=this.parseDecimalLiteral(s);break;case 136:{let r=this.state.startLoc;e!=null?e.privateKeyLoc===null&&(e.privateKeyLoc=r):this.raise(d.UnexpectedPrivateField,{at:r}),a=this.parsePrivateName();break}default:this.unexpected()}t.key=a,i!==136&&(t.computed=!1)}return t.key}initFunction(t,e){t.id=null,t.generator=!1,t.async=e}parseMethod(t,e,i,s,a,r,o=!1){this.initFunction(t,i),t.generator=e,this.scope.enter(te|kt|(o?de:0)|(a?lr:0)),this.prodParam.enter(At(i,t.generator)),this.parseFunctionParams(t,s);let l=this.parseFunctionBodyAndFinish(t,r,!0);return this.prodParam.exit(),this.scope.exit(),l}parseArrayLike(t,e,i,s){i&&this.expectPlugin("recordAndTuple");let a=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let r=this.startNode();return this.next(),r.elements=this.parseExprList(t,!i,s,r),this.state.inFSharpPipelineDirectBody=a,this.finishNode(r,i?"TupleExpression":"ArrayExpression")}parseArrowExpression(t,e,i,s){this.scope.enter(te|ji);let a=At(i,!1);!this.match(5)&&this.prodParam.hasIn&&(a|=be),this.prodParam.enter(a),this.initFunction(t,i);let r=this.state.maybeInArrowParameters;return e&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(t,e,s)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(t,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=r,this.finishNode(t,"ArrowFunctionExpression")}setArrowFunctionParameters(t,e,i){this.toAssignableList(e,i,!1),t.params=e}parseFunctionBodyAndFinish(t,e,i=!1){return this.parseFunctionBody(t,!1,i),this.finishNode(t,e)}parseFunctionBody(t,e,i=!1){let s=e&&!this.match(5);if(this.expressionScope.enter(br()),s)t.body=this.parseMaybeAssign(),this.checkParams(t,!1,e,!1);else{let a=this.state.strict,r=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|Pr),t.body=this.parseBlock(!0,!1,o=>{let l=!this.isSimpleParamList(t.params);o&&l&&this.raise(d.IllegalLanguageModeDirective,{at:(t.kind==="method"||t.kind==="constructor")&&t.key?t.key.loc.end:t});let c=!a&&this.state.strict;this.checkParams(t,!this.state.strict&&!e&&!i&&!l,e,c),this.state.strict&&t.id&&this.checkIdentifier(t.id,Gl,c)}),this.prodParam.exit(),this.state.labels=r}this.expressionScope.exit()}isSimpleParameter(t){return t.type==="Identifier"}isSimpleParamList(t){for(let e=0,i=t.length;e<i;e++)if(!this.isSimpleParameter(t[e]))return!1;return!0}checkParams(t,e,i,s=!0){let a=!e&&new Set,r={type:"FormalParameters"};for(let o of t.params)this.checkLVal(o,{in:r,binding:_t,checkClashes:a,strictModeChanged:s})}parseExprList(t,e,i,s){let a=[],r=!0;for(;!this.eat(t);){if(r)r=!1;else if(this.expect(12),this.match(t)){s&&this.addTrailingCommaExtraToNode(s),this.next();break}a.push(this.parseExprListItem(e,i))}return a}parseExprListItem(t,e,i){let s;if(this.match(12))t||this.raise(d.UnexpectedToken,{at:this.state.curPosition(),unexpected:","}),s=null;else if(this.match(21)){let a=this.state.startLoc;s=this.parseParenItem(this.parseSpread(e),a)}else if(this.match(17)){this.expectPlugin("partialApplication"),i||this.raise(d.UnexpectedArgumentPlaceholder,{at:this.state.startLoc});let a=this.startNode();this.next(),s=this.finishNode(a,"ArgumentPlaceholder")}else s=this.parseMaybeAssignAllowIn(e,this.parseParenItem);return s}parseIdentifier(t){let e=this.startNode(),i=this.parseIdentifierName(t);return this.createIdentifier(e,i)}createIdentifier(t,e){return t.name=e,t.loc.identifierName=e,this.finishNode(t,"Identifier")}parseIdentifierName(t){let e,{startLoc:i,type:s}=this.state;U(s)?e=this.state.value:this.unexpected();let a=El(s);return t?a&&this.replaceToken(130):this.checkReservedWord(e,i,a,!1),this.next(),e}checkReservedWord(t,e,i,s){if(t.length>10||!$l(t))return;if(i&&ql(t)){this.raise(d.UnexpectedKeyword,{at:e,keyword:t});return}if((this.state.strict?s?nr:ar:sr)(t,this.inModule)){this.raise(d.UnexpectedReservedWord,{at:e,reservedWord:t});return}else if(t==="yield"){if(this.prodParam.hasYield){this.raise(d.YieldBindingIdentifier,{at:e});return}}else if(t==="await"){if(this.prodParam.hasAwait){this.raise(d.AwaitBindingIdentifier,{at:e});return}if(this.scope.inStaticBlock){this.raise(d.AwaitBindingIdentifierInStaticBlock,{at:e});return}this.expressionScope.recordAsyncArrowParametersError({at:e})}else if(t==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(d.ArgumentsInClass,{at:e});return}}isAwaitAllowed(){return!!(this.prodParam.hasAwait||this.options.allowAwaitOutsideFunction&&!this.scope.inFunction)}parseAwait(t){let e=this.startNodeAt(t);return this.expressionScope.recordParameterInitializerError(d.AwaitExpressionFormalParameter,{at:e}),this.eat(55)&&this.raise(d.ObsoleteAwaitStar,{at:e}),!this.scope.inFunction&&!this.options.allowAwaitOutsideFunction&&(this.isAmbiguousAwait()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),this.state.soloAwait||(e.argument=this.parseMaybeUnary(null,!0)),this.finishNode(e,"AwaitExpression")}isAmbiguousAwait(){if(this.hasPrecedingLineBreak())return!0;let{type:t}=this.state;return t===53||t===10||t===0||Ct(t)||t===101&&!this.state.containsEsc||t===135||t===56||this.hasPlugin("v8intrinsic")&&t===54}parseYield(){let t=this.startNode();this.expressionScope.recordParameterInitializerError(d.YieldInParameter,{at:t}),this.next();let e=!1,i=null;if(!this.hasPrecedingLineBreak())switch(e=this.eat(55),this.state.type){case 13:case 137:case 8:case 11:case 3:case 9:case 14:case 12:if(!e)break;default:i=this.parseMaybeAssign()}return t.delegate=e,t.argument=i,this.finishNode(t,"YieldExpression")}checkPipelineAtInfixOperator(t,e){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&t.type==="SequenceExpression"&&this.raise(d.PipelineHeadSequenceExpression,{at:e})}parseSmartPipelineBodyInStyle(t,e){if(this.isSimpleReference(t)){let i=this.startNodeAt(e);return i.callee=t,this.finishNode(i,"PipelineBareFunction")}else{let i=this.startNodeAt(e);return this.checkSmartPipeTopicBodyEarlyErrors(e),i.expression=t,this.finishNode(i,"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(d.PipelineBodyNoArrow,{at:this.state.startLoc});this.topicReferenceWasUsedInCurrentContext()||this.raise(d.PipelineTopicUnused,{at: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(be&~e){this.prodParam.enter(e|be);try{return t()}finally{this.prodParam.exit()}}return t()}disallowInAnd(t){let e=this.prodParam.currentFlags();if(be&e){this.prodParam.enter(e&~be);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 i=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;let s=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),e,t);return this.state.inFSharpPipelineDirectBody=i,s}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 i=this.initializeScopes(!0);this.enterInitialScopes();try{t.body=this.parseProgram(e,8,"module")}finally{i()}return this.finishNode(t,"ModuleExpression")}parsePropertyNamePrefixOperator(t){}},si={kind:"loop"},jc={kind:"switch"},Rc=/[\uD800-\uDFFF]/u,ai=/in(?:stanceof)?/y;function Uc(n,t){for(let e=0;e<n.length;e++){let i=n[e],{type:s}=i;if(typeof s=="number"){{if(s===136){let{loc:a,start:r,value:o,end:l}=i,c=r+1,p=B(a.start,1);n.splice(e,1,new K({type:Q(27),value:"#",start:r,end:c,startLoc:a.start,endLoc:p}),new K({type:Q(130),value:o,start:c,end:l,startLoc:p,endLoc:a.end})),e++;continue}if(Ct(s)){let{loc:a,start:r,value:o,end:l}=i,c=r+1,p=B(a.start,1),h;t.charCodeAt(r)===96?h=new K({type:Q(22),value:"`",start:r,end:c,startLoc:a.start,endLoc:p}):h=new K({type:Q(8),value:"}",start:r,end:c,startLoc:a.start,endLoc:p});let u,f,m,x;s===24?(f=l-1,m=B(a.end,-1),u=o===null?null:o.slice(1,-1),x=new K({type:Q(22),value:"`",start:f,end:l,startLoc:m,endLoc:a.end})):(f=l-2,m=B(a.end,-2),u=o===null?null:o.slice(1,-2),x=new K({type:Q(23),value:"${",start:f,end:l,startLoc:m,endLoc:a.end})),n.splice(e,1,h,new K({type:Q(20),value:u,start:c,end:f,startLoc:p,endLoc:m}),x),e+=2;continue}}i.type=Q(s)}}return n}var ki=class extends Ci{parseTopLevel(t,e){return t.program=this.parseProgram(e),t.comments=this.state.comments,this.options.tokens&&(t.tokens=Uc(this.tokens,this.input)),this.finishNode(t,"File")}parseProgram(t,e=137,i=this.options.sourceType){if(t.sourceType=i,t.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(t,!0,!0,e),this.inModule&&!this.options.allowUndeclaredExports&&this.scope.undefinedExports.size>0)for(let[a,r]of Array.from(this.scope.undefinedExports))this.raise(d.ModuleExportUndefined,{at:r,localName:a});let s;return e===137?s=this.finishNode(t,"Program"):s=this.finishNodeAt(t,"Program",B(this.state.startLoc,-1)),s}stmtToDirective(t){let e=t;e.type="Directive",e.value=e.expression,delete e.expression;let i=e.value,s=i.value,a=this.input.slice(i.start,i.end),r=i.value=a.slice(1,-1);return this.addExtra(i,"raw",a),this.addExtra(i,"rawValue",r),this.addExtra(i,"expressionValue",s),i.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(99)?this.hasFollowingBindingAtom():!1}chStartsBindingIdentifier(t,e){if(Z(t)){if(ai.lastIndex=e,ai.test(this.input)){let i=this.codePointAtPos(ai.lastIndex);if(!Ae(i)&&i!==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)}hasInLineFollowingBindingIdentifier(){let t=this.nextTokenInLineStart(),e=this.codePointAtPos(t);return this.chStartsBindingIdentifier(e,t)}startsUsingForOf(){let{type:t,containsEsc:e}=this.lookahead();if(t===101&&!e)return!1;if(k(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 i=this.state.type,s=this.startNode(),a=!!(t&2),r=!!(t&4),o=t&1;switch(i){case 60:return this.parseBreakContinueStatement(s,!0);case 63:return this.parseBreakContinueStatement(s,!1);case 64:return this.parseDebuggerStatement(s);case 90:return this.parseDoWhileStatement(s);case 91:return this.parseForStatement(s);case 68:if(this.lookaheadCharCode()===46)break;return r||this.raise(this.state.strict?d.StrictFunction:this.options.annexB?d.SloppyFunctionAnnexB:d.SloppyFunction,{at:this.state.startLoc}),this.parseFunctionStatement(s,!1,!a&&r);case 80:return a||this.unexpected(),this.parseClass(this.maybeTakeDecorators(e,s),!0);case 69:return this.parseIfStatement(s);case 70:return this.parseReturnStatement(s);case 71:return this.parseSwitchStatement(s);case 72:return this.parseThrowStatement(s);case 73:return this.parseTryStatement(s);case 96:if(!this.state.containsEsc&&this.startsAwaitUsing())return this.isAwaitAllowed()?a||this.raise(d.UnexpectedLexicalDeclaration,{at:s}):this.raise(d.AwaitUsingNotInAsyncContext,{at:s}),this.next(),this.parseVarStatement(s,"await using");break;case 105:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifier())break;return this.expectPlugin("explicitResourceManagement"),!this.scope.inModule&&this.scope.inTopLevel?this.raise(d.UnexpectedUsingDeclaration,{at:this.state.startLoc}):a||this.raise(d.UnexpectedLexicalDeclaration,{at:this.state.startLoc}),this.parseVarStatement(s,"using");case 99:{if(this.state.containsEsc)break;let p=this.nextTokenStart(),h=this.codePointAtPos(p);if(h!==91&&(!a&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(h,p)&&h!==123))break}case 75:a||this.raise(d.UnexpectedLexicalDeclaration,{at:this.state.startLoc});case 74:{let p=this.state.value;return this.parseVarStatement(s,p)}case 92:return this.parseWhileStatement(s);case 76:return this.parseWithStatement(s);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(s);case 83:{let p=this.lookaheadCharCode();if(p===40||p===46)break}case 82:{!this.options.allowImportExportEverywhere&&!o&&this.raise(d.UnexpectedImportExport,{at:this.state.startLoc}),this.next();let p;return i===83?(p=this.parseImport(s),p.type==="ImportDeclaration"&&(!p.importKind||p.importKind==="value")&&(this.sawUnambiguousESM=!0)):(p=this.parseExport(s,e),(p.type==="ExportNamedDeclaration"&&(!p.exportKind||p.exportKind==="value")||p.type==="ExportAllDeclaration"&&(!p.exportKind||p.exportKind==="value")||p.type==="ExportDefaultDeclaration")&&(this.sawUnambiguousESM=!0)),this.assertModuleNodeAllowed(p),p}default:if(this.isAsyncFunction())return a||this.raise(d.AsyncFunctionInSingleStatementContext,{at:this.state.startLoc}),this.next(),this.parseFunctionStatement(s,!0,!a&&r)}let l=this.state.value,c=this.parseExpression();return k(i)&&c.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(s,l,c,t):this.parseExpressionStatement(s,c,e)}assertModuleNodeAllowed(t){!this.options.allowImportExportEverywhere&&!this.inModule&&this.raise(d.ImportOutsideModule,{at:t})}decoratorsEnabledBeforeExport(){return this.hasPlugin("decorators-legacy")?!0:this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(t,e,i){return t&&(e.decorators&&e.decorators.length>0?(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!="boolean"&&this.raise(d.DecoratorsBeforeAfterExport,{at:e.decorators[0]}),e.decorators.unshift(...t)):e.decorators=t,this.resetStartLocationFromNode(e,t[0]),i&&this.resetStartLocationFromNode(i,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(d.DecoratorExportClass,{at:this.state.startLoc});else if(!this.canHaveLeadingDecorator())throw this.raise(d.UnexpectedLeadingDecorator,{at: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,i;if(this.match(10)){let s=this.state.startLoc;this.next(),i=this.parseExpression(),this.expect(11),i=this.wrapParenthesis(s,i);let a=this.state.startLoc;t.expression=this.parseMaybeDecoratorArguments(i),this.getPluginOption("decorators","allowCallParenthesized")===!1&&t.expression!==i&&this.raise(d.DecoratorArgumentsOutsideParentheses,{at:a})}else{for(i=this.parseIdentifier(!1);this.eat(16);){let s=this.startNodeAt(e);s.object=i,this.match(136)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),s.property=this.parsePrivateName()):s.property=this.parseIdentifier(!0),s.computed=!1,i=this.finishNode(s,"MemberExpression")}t.expression=this.parseMaybeDecoratorArguments(i)}}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 i;for(i=0;i<this.state.labels.length;++i){let s=this.state.labels[i];if((t.label==null||s.name===t.label.name)&&(s.kind!=null&&(e||s.kind==="loop")||t.label&&e))break}if(i===this.state.labels.length){let s=e?"BreakStatement":"ContinueStatement";this.raise(d.IllegalBreakContinue,{at:t,type:s})}}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(si),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(si);let e=null;if(this.isAwaitAllowed()&&this.eatContextual(96)&&(e=this.state.lastTokStartLoc),this.scope.enter(we),this.expect(10),this.match(13))return e!==null&&this.unexpected(e),this.parseFor(t,null);let i=this.isContextual(99);{let l=this.isContextual(96)&&this.startsAwaitUsing(),c=l||this.isContextual(105)&&this.startsUsingForOf(),p=i&&this.hasFollowingBindingAtom()||c;if(this.match(74)||this.match(75)||p){let h=this.startNode(),u;l?(u="await using",this.isAwaitAllowed()||this.raise(d.AwaitUsingNotInAsyncContext,{at:this.state.startLoc}),this.next()):u=this.state.value,this.next(),this.parseVar(h,!0,u);let f=this.finishNode(h,"VariableDeclaration"),m=this.match(58);return m&&c&&this.raise(d.ForInUsing,{at:f}),(m||this.isContextual(101))&&f.declarations.length===1?this.parseForIn(t,f,e):(e!==null&&this.unexpected(e),this.parseFor(t,f))}}let s=this.isContextual(95),a=new ke,r=this.parseExpression(!0,a),o=this.isContextual(101);if(o&&(i&&this.raise(d.ForOfLet,{at:r}),e===null&&s&&r.type==="Identifier"&&this.raise(d.ForOfAsync,{at:r})),o||this.match(58)){this.checkDestructuringPrivate(a),this.toAssignable(r,!0);let l=o?"ForOfStatement":"ForInStatement";return this.checkLVal(r,{in:{type:l}}),this.parseForIn(t,r,e)}else this.checkExpressionErrors(a,!0);return e!==null&&this.unexpected(e),this.parseFor(t,r)}parseFunctionStatement(t,e,i){return this.next(),this.parseFunction(t,1|(i?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(d.IllegalReturn,{at: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(jc),this.scope.enter(we);let i;for(let s;!this.match(8);)if(this.match(61)||this.match(65)){let a=this.match(61);i&&this.finishNode(i,"SwitchCase"),e.push(i=this.startNode()),i.consequent=[],this.next(),a?i.test=this.parseExpression():(s&&this.raise(d.MultipleDefaultsInSwitch,{at:this.state.lastTokStartLoc}),s=!0,i.test=null),this.expect(14)}else i?i.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),i&&this.finishNode(i,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(t,"SwitchStatement")}parseThrowStatement(t){return this.next(),this.hasPrecedingLineBreak()&&this.raise(d.NewlineAfterThrow,{at: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"?or:0),this.checkLVal(t,{in:{type:"CatchClause"},binding:Kl}),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(we)),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(d.NoCatchOrFinally,{at:t}),this.finishNode(t,"TryStatement")}parseVarStatement(t,e,i=!1){return this.next(),this.parseVar(t,!1,e,i),this.semicolon(),this.finishNode(t,"VariableDeclaration")}parseWhileStatement(t){return this.next(),t.test=this.parseHeaderExpression(),this.state.labels.push(si),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(t,"WhileStatement")}parseWithStatement(t){return this.state.strict&&this.raise(d.StrictWith,{at: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,i,s){for(let r of this.state.labels)r.name===e&&this.raise(d.LabelRedeclaration,{at:i,labelName:e});let a=kl(this.state.type)?"loop":this.match(71)?"switch":null;for(let r=this.state.labels.length-1;r>=0;r--){let o=this.state.labels[r];if(o.statementStart===t.start)o.statementStart=this.state.start,o.kind=a;else break}return this.state.labels.push({name:e,kind:a,statementStart:this.state.start}),t.body=s&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),t.label=i,this.finishNode(t,"LabeledStatement")}parseExpressionStatement(t,e,i){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")}parseBlock(t=!1,e=!0,i){let s=this.startNode();return t&&this.state.strictErrors.clear(),this.expect(5),e&&this.scope.enter(we),this.parseBlockBody(s,t,!1,8,i),e&&this.scope.exit(),this.finishNode(s,"BlockStatement")}isValidDirective(t){return t.type==="ExpressionStatement"&&t.expression.type==="StringLiteral"&&!t.expression.extra.parenthesized}parseBlockBody(t,e,i,s,a){let r=t.body=[],o=t.directives=[];this.parseBlockOrModuleBlockBody(r,e?o:void 0,i,s,a)}parseBlockOrModuleBlockBody(t,e,i,s,a){let r=this.state.strict,o=!1,l=!1;for(;!this.match(s);){let c=i?this.parseModuleItem():this.parseStatementListItem();if(e&&!l){if(this.isValidDirective(c)){let p=this.stmtToDirective(c);e.push(p),!o&&p.value.value==="use strict"&&(o=!0,this.setStrict(!0));continue}l=!0,this.state.strictErrors.clear()}t.push(c)}a&&a.call(this,o),r||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,i){let s=this.match(58);return this.next(),s?i!==null&&this.unexpected(i):t.await=i!==null,e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!s||!this.options.annexB||this.state.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(d.ForInOfLoopInitializer,{at:e,type:s?"ForInStatement":"ForOfStatement"}),e.type==="AssignmentPattern"&&this.raise(d.InvalidLhs,{at:e,ancestor:{type:"ForStatement"}}),t.left=e,t.right=s?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,s?"ForInStatement":"ForOfStatement")}parseVar(t,e,i,s=!1){let a=t.declarations=[];for(t.kind=i;;){let r=this.startNode();if(this.parseVarId(r,i),r.init=this.eat(29)?e?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,r.init===null&&!s&&(r.id.type!=="Identifier"&&!(e&&(this.match(58)||this.isContextual(101)))?this.raise(d.DeclarationMissingInitializer,{at:this.state.lastTokEndLoc,kind:"destructuring"}):i==="const"&&!(this.match(58)||this.isContextual(101))&&this.raise(d.DeclarationMissingInitializer,{at:this.state.lastTokEndLoc,kind:"const"})),a.push(this.finishNode(r,"VariableDeclarator")),!this.eat(12))break}return t}parseVarId(t,e){let i=this.parseBindingAtom();this.checkLVal(i,{in:{type:"VariableDeclarator"},binding:e==="var"?_t:Se}),t.id=i}parseAsyncFunctionExpression(t){return this.parseFunction(t,8)}parseFunction(t,e=0){let i=e&2,s=!!(e&1),a=s&&!(e&4),r=!!(e&8);this.initFunction(t,r),this.match(55)&&(i&&this.raise(d.GeneratorInSingleStatementContext,{at:this.state.startLoc}),this.next(),t.generator=!0),s&&(t.id=this.parseFunctionId(a));let o=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(te),this.prodParam.enter(At(r,t.generator)),s||(t.id=this.parseFunctionId()),this.parseFunctionParams(t,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(t,s?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),s&&!i&&this.registerFunctionStatementId(t),this.state.maybeInArrowParameters=o,t}parseFunctionId(t){return t||k(this.state.type)?this.parseIdentifier():null}parseFunctionParams(t,e){this.expect(10),this.expressionScope.enter(hc()),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?_t:Se:ur,t.id.loc.start)}parseClass(t,e,i){this.next();let s=this.state.strict;return this.state.strict=!0,this.parseClassId(t,e,i),this.parseClassSuper(t),t.body=this.parseClassBody(!!t.superClass,s),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}isNonstaticConstructor(t){return!t.computed&&!t.static&&(t.key.name==="constructor"||t.key.value==="constructor")}parseClassBody(t,e){this.classScope.enter();let i={hadConstructor:!1,hadSuperClass:t},s=[],a=this.startNode();if(a.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(s.length>0)throw this.raise(d.DecoratorSemicolon,{at:this.state.lastTokEndLoc});continue}if(this.match(26)){s.push(this.parseDecorator());continue}let r=this.startNode();s.length&&(r.decorators=s,this.resetStartLocationFromNode(r,s[0]),s=[]),this.parseClassMember(a,r,i),r.kind==="constructor"&&r.decorators&&r.decorators.length>0&&this.raise(d.DecoratorConstructor,{at:r})}}),this.state.strict=e,this.next(),s.length)throw this.raise(d.TrailingDecorator,{at:this.state.startLoc});return this.classScope.exit(),this.finishNode(a,"ClassBody")}parseClassMemberFromModifier(t,e){let i=this.parseIdentifier(!0);if(this.isClassMethod()){let s=e;return s.kind="method",s.computed=!1,s.key=i,s.static=!1,this.pushClassMethod(t,s,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let s=e;return s.computed=!1,s.key=i,s.static=!1,t.body.push(this.parseClassProperty(s)),!0}return this.resetPreviousNodeTrailingComments(i),!1}parseClassMember(t,e,i){let s=this.isContextual(104);if(s){if(this.parseClassMemberFromModifier(t,e))return;if(this.eat(5)){this.parseClassStaticBlock(t,e);return}}this.parseClassMemberWithIsStatic(t,e,i,s)}parseClassMemberWithIsStatic(t,e,i,s){let a=e,r=e,o=e,l=e,c=e,p=a,h=a;if(e.static=s,this.parsePropertyNamePrefixOperator(e),this.eat(55)){p.kind="method";let b=this.match(136);if(this.parseClassElementName(p),b){this.pushClassPrivateMethod(t,r,!0,!1);return}this.isNonstaticConstructor(a)&&this.raise(d.ConstructorIsGenerator,{at:a.key}),this.pushClassMethod(t,a,!0,!1,!1,!1);return}let u=k(this.state.type)&&!this.state.containsEsc,f=this.match(136),m=this.parseClassElementName(e),x=this.state.startLoc;if(this.parsePostMemberNameModifiers(h),this.isClassMethod()){if(p.kind="method",f){this.pushClassPrivateMethod(t,r,!1,!1);return}let b=this.isNonstaticConstructor(a),A=!1;b&&(a.kind="constructor",i.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(d.DuplicateConstructor,{at:m}),b&&this.hasPlugin("typescript")&&e.override&&this.raise(d.OverrideOnConstructor,{at:m}),i.hadConstructor=!0,A=i.hadSuperClass),this.pushClassMethod(t,a,!1,!1,b,A)}else if(this.isClassProperty())f?this.pushClassPrivateProperty(t,l):this.pushClassProperty(t,o);else if(u&&m.name==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(m);let b=this.eat(55);h.optional&&this.unexpected(x),p.kind="method";let A=this.match(136);this.parseClassElementName(p),this.parsePostMemberNameModifiers(h),A?this.pushClassPrivateMethod(t,r,b,!0):(this.isNonstaticConstructor(a)&&this.raise(d.ConstructorIsAsync,{at:a.key}),this.pushClassMethod(t,a,b,!0,!1,!1))}else if(u&&(m.name==="get"||m.name==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(m),p.kind=m.name;let b=this.match(136);this.parseClassElementName(a),b?this.pushClassPrivateMethod(t,r,!1,!1):(this.isNonstaticConstructor(a)&&this.raise(d.ConstructorIsAccessor,{at:a.key}),this.pushClassMethod(t,a,!1,!1,!1,!1)),this.checkGetterSetterParams(a)}else if(u&&m.name==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(m);let b=this.match(136);this.parseClassElementName(o),this.pushClassAccessorProperty(t,c,b)}else this.isLineTerminator()?f?this.pushClassPrivateProperty(t,l):this.pushClassProperty(t,o):this.unexpected()}parseClassElementName(t){let{type:e,value:i}=this.state;if((e===130||e===131)&&t.static&&i==="prototype"&&this.raise(d.StaticPrototype,{at:this.state.startLoc}),e===136){i==="constructor"&&this.raise(d.ConstructorClassPrivateField,{at:this.state.startLoc});let s=this.parsePrivateName();return t.key=s,s}return this.parsePropertyName(t)}parseClassStaticBlock(t,e){var i;this.scope.enter(de|It|kt);let s=this.state.labels;this.state.labels=[],this.prodParam.enter(Ce);let a=e.body=[];this.parseBlockOrModuleBlockBody(a,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=s,t.body.push(this.finishNode(e,"StaticBlock")),(i=e.decorators)!=null&&i.length&&this.raise(d.DecoratorStaticBlock,{at:e})}pushClassProperty(t,e){!e.computed&&(e.key.name==="constructor"||e.key.value==="constructor")&&this.raise(d.ConstructorClassField,{at:e.key}),t.body.push(this.parseClassProperty(e))}pushClassPrivateProperty(t,e){let i=this.parseClassPrivateProperty(e);t.body.push(i),this.classScope.declarePrivateName(this.getPrivateNameSV(i.key),ti,i.key.loc.start)}pushClassAccessorProperty(t,e,i){if(!i&&!e.computed){let a=e.key;(a.name==="constructor"||a.value==="constructor")&&this.raise(d.ConstructorClassField,{at:a})}let s=this.parseClassAccessorProperty(e);t.body.push(s),i&&this.classScope.declarePrivateName(this.getPrivateNameSV(s.key),ti,s.key.loc.start)}pushClassMethod(t,e,i,s,a,r){t.body.push(this.parseMethod(e,i,s,a,r,"ClassMethod",!0))}pushClassPrivateMethod(t,e,i,s){let a=this.parseMethod(e,i,s,!1,!1,"ClassPrivateMethod",!0);t.body.push(a);let r=a.kind==="get"?a.static?Yl:ec:a.kind==="set"?a.static?Zl:tc:ti;this.declareClassPrivateMethodInScope(a,r)}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(de|kt),this.expressionScope.enter(br()),this.prodParam.enter(Ce),t.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(t,e,i,s=hr){if(k(this.state.type))t.id=this.parseIdentifier(),e&&this.declareNameFromIdentifier(t.id,s);else if(i||!e)t.id=null;else throw this.raise(d.MissingClassName,{at:this.state.startLoc})}parseClassSuper(t){t.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(t,e){let i=this.parseMaybeImportPhase(t,!0),s=this.maybeParseExportDefaultSpecifier(t,i),a=!s||this.eat(12),r=a&&this.eatExportStar(t),o=r&&this.maybeParseExportNamespaceSpecifier(t),l=a&&(!o||this.eat(12)),c=s||r;if(r&&!o){if(s&&this.unexpected(),e)throw this.raise(d.UnsupportedDecoratorExport,{at:t});return this.parseExportFrom(t,!0),this.finishNode(t,"ExportAllDeclaration")}let p=this.maybeParseExportNamedSpecifiers(t);s&&a&&!r&&!p&&this.unexpected(null,5),o&&l&&this.unexpected(null,97);let h;if(c||p){if(h=!1,e)throw this.raise(d.UnsupportedDecoratorExport,{at:t});this.parseExportFrom(t,c)}else h=this.maybeParseExportDeclaration(t);if(c||p||h){var u;let f=t;if(this.checkExport(f,!0,!1,!!f.source),((u=f.declaration)==null?void 0:u.type)==="ClassDeclaration")this.maybeTakeDecorators(e,f.declaration,f);else if(e)throw this.raise(d.UnsupportedDecoratorExport,{at:t});return this.finishNode(f,"ExportNamedDeclaration")}if(this.eat(65)){let f=t,m=this.parseExportDefaultExpression();if(f.declaration=m,m.type==="ClassDeclaration")this.maybeTakeDecorators(e,m,f);else if(e)throw this.raise(d.UnsupportedDecoratorExport,{at:t});return this.checkExport(f,!0,!0),this.finishNode(f,"ExportDefaultDeclaration")}this.unexpected(null,5)}eatExportStar(t){return this.eat(55)}maybeParseExportDefaultSpecifier(t,e){if(e||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",e==null?void 0:e.loc.start);let i=e||this.parseIdentifier(!0),s=this.startNodeAtNode(i);return s.exported=i,t.specifiers=[this.finishNode(s,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(t){if(this.isContextual(93)){t.specifiers||(t.specifiers=[]);let e=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),e.exported=this.parseModuleExportName(),t.specifiers.push(this.finishNode(e,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(t){if(this.match(5)){t.specifiers||(t.specifiers=[]);let e=t.exportKind==="type";return t.specifiers.push(...this.parseExportSpecifiers(e)),t.source=null,t.declaration=null,this.hasPlugin("importAssertions")&&(t.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(d.DecoratorBeforeExport,{at:this.state.startLoc}),this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(75)||this.match(74)||this.isLet())throw this.raise(d.UnsupportedDefaultExport,{at: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(k(t)){if(t===95&&!this.state.containsEsc||t===99)return!1;if((t===128||t===127)&&!this.state.containsEsc){let{type:s}=this.lookahead();if(k(s)&&s!==97||s===5)return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;let e=this.nextTokenStart(),i=this.isUnparsedContextual(e,"from");if(this.input.charCodeAt(e)===44||k(this.state.type)&&i)return!0;if(this.match(65)&&i){let s=this.input.charCodeAt(this.nextTokenStartSince(e+4));return s===34||s===39}return!1}parseExportFrom(t,e){this.eatContextual(97)?(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(d.DecoratorBeforeExport,{at:this.state.startLoc}),!0):t===74||t===75||t===68||t===80||this.isLet()||this.isAsyncFunction()}checkExport(t,e,i,s){if(e){if(i){if(this.checkDuplicateExports(t,"default"),this.hasPlugin("exportDefaultFrom")){var a;let r=t.declaration;r.type==="Identifier"&&r.name==="from"&&r.end-r.start===4&&!((a=r.extra)!=null&&a.parenthesized)&&this.raise(d.ExportDefaultFromAsIdentifier,{at:r})}}else if(t.specifiers&&t.specifiers.length)for(let r of t.specifiers){let{exported:o}=r,l=o.type==="Identifier"?o.name:o.value;if(this.checkDuplicateExports(r,l),!s&&r.local){let{local:c}=r;c.type!=="Identifier"?this.raise(d.ExportBindingIsString,{at:r,localName:c.value,exportName:l}):(this.checkReservedWord(c.name,c.loc.start,!0,!1),this.scope.checkLocalExport(c))}}else if(t.declaration){if(t.declaration.type==="FunctionDeclaration"||t.declaration.type==="ClassDeclaration"){let r=t.declaration.id;if(!r)throw new Error("Assertion failure");this.checkDuplicateExports(t,r.name)}else if(t.declaration.type==="VariableDeclaration")for(let r of t.declaration.declarations)this.checkDeclaration(r.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(d.DuplicateDefaultExport,{at:t}):this.raise(d.DuplicateExport,{at:t,exportName:e})),this.exportedIdentifiers.add(e)}parseExportSpecifiers(t){let e=[],i=!0;for(this.expect(5);!this.eat(8);){if(i)i=!1;else if(this.expect(12),this.eat(8))break;let s=this.isContextual(128),a=this.match(131),r=this.startNode();r.local=this.parseModuleExportName(),e.push(this.parseExportSpecifier(r,a,t,s))}return e}parseExportSpecifier(t,e,i,s){return this.eatContextual(93)?t.exported=this.parseModuleExportName():e?t.exported=mc(t.local):t.exported||(t.exported=ie(t.local)),this.finishNode(t,"ExportSpecifier")}parseModuleExportName(){if(this.match(131)){let t=this.parseStringLiteral(this.state.value),e=t.value.match(Rc);return e&&this.raise(d.ModuleExportNameHasLoneSurrogate,{at:t,surrogateCharCode:e[0].charCodeAt(0)}),t}return this.parseIdentifier(!0)}isJSONModuleImport(t){return t.assertions!=null?t.assertions.some(({key:e,value:i})=>i.value==="json"&&(e.type==="Identifier"?e.name==="type":e.value==="type")):!1}checkImportReflection(t){if(t.module){var e;(t.specifiers.length!==1||t.specifiers[0].type!=="ImportDefaultSpecifier")&&this.raise(d.ImportReflectionNotBinding,{at:t.specifiers[0].loc.start}),((e=t.assertions)==null?void 0:e.length)>0&&this.raise(d.ImportReflectionHasAssertion,{at:t.specifiers[0].loc.start})}}checkJSONModuleImport(t){if(this.isJSONModuleImport(t)&&t.type!=="ExportAllDeclaration"){let{specifiers:e}=t;if(e!=null){let i=e.find(s=>{let a;if(s.type==="ExportSpecifier"?a=s.local:s.type==="ImportSpecifier"&&(a=s.imported),a!==void 0)return a.type==="Identifier"?a.name!=="default":a.value!=="default"});i!==void 0&&this.raise(d.ImportJSONBindingNotDefault,{at:i.loc.start})}}}isPotentialImportPhase(t){return!t&&this.isContextual(125)}applyImportPhase(t,e,i,s){e||(i==="module"?(this.expectPlugin("importReflection",s),t.module=!0):this.hasPlugin("importReflection")&&(t.module=!1))}parseMaybeImportPhase(t,e){if(!this.isPotentialImportPhase(e))return this.applyImportPhase(t,e,null),null;let i=this.parseIdentifier(!0),{type:s}=this.state;return(U(s)?s!==97||this.lookaheadCharCode()===102:s!==12)?(this.resetPreviousIdentifierLeadingComments(i),this.applyImportPhase(t,e,i.name,i.loc.start),null):(this.applyImportPhase(t,e,null),i)}isPrecedingIdImportPhase(t){let{type:e}=this.state;return k(e)?e!==97||this.lookaheadCharCode()===102:e!==12}parseImport(t){return this.match(131)?this.parseImportSourceAndAttributes(t):this.parseImportSpecifiersAndAfter(t,this.parseMaybeImportPhase(t,!1))}parseImportSpecifiersAndAfter(t,e){t.specifiers=[];let s=!this.maybeParseDefaultImportSpecifier(t,e)||this.eat(12),a=s&&this.maybeParseStarImportSpecifier(t);return s&&!a&&this.parseNamedImportSpecifiers(t),this.expectContextual(97),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(131)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(t,e,i){e.local=this.parseIdentifier(),t.specifiers.push(this.finishImportSpecifier(e,i))}finishImportSpecifier(t,e,i=Se){return this.checkLVal(t.local,{in:{type:e},binding:i}),this.finishNode(t,e)}parseImportAttributes(){this.expect(5);let t=[],e=new Set;do{if(this.match(8))break;let i=this.startNode(),s=this.state.value;if(e.has(s)&&this.raise(d.ModuleAttributesWithDuplicateKeys,{at:this.state.startLoc,key:s}),e.add(s),this.match(131)?i.key=this.parseStringLiteral(s):i.key=this.parseIdentifier(!0),this.expect(14),!this.match(131))throw this.raise(d.ModuleAttributeInvalidValue,{at:this.state.startLoc});i.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(i,"ImportAttribute"))}while(this.eat(12));return this.expect(8),t}parseModuleAttributes(){let t=[],e=new Set;do{let i=this.startNode();if(i.key=this.parseIdentifier(!0),i.key.name!=="type"&&this.raise(d.ModuleAttributeDifferentFromType,{at:i.key}),e.has(i.key.name)&&this.raise(d.ModuleAttributesWithDuplicateKeys,{at:i.key,key:i.key.name}),e.add(i.key.name),this.expect(14),!this.match(131))throw this.raise(d.ModuleAttributeInvalidValue,{at:this.state.startLoc});i.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(i,"ImportAttribute"))}while(this.eat(12));return t}maybeParseImportAttributes(t){let e,i=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),this.hasPlugin("moduleAttributes")?e=this.parseModuleAttributes():(this.expectImportAttributesPlugin(),e=this.parseImportAttributes()),i=!0}else if(this.isContextual(94)&&!this.hasPrecedingLineBreak())this.hasPlugin("importAttributes")?(this.getPluginOption("importAttributes","deprecatedAssertSyntax")!==!0&&this.raise(d.ImportAttributesUseAssert,{at: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;!i&&this.hasPlugin("importAssertions")?t.assertions=e:t.attributes=e}maybeParseDefaultImportSpecifier(t,e){if(e){let i=this.startNodeAtNode(e);return i.local=e,t.specifiers.push(this.finishImportSpecifier(i,"ImportDefaultSpecifier")),!0}else if(U(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(d.DestructureNamedImport,{at:this.state.startLoc});if(this.expect(12),this.eat(8))break}let i=this.startNode(),s=this.match(131),a=this.isContextual(128);i.imported=this.parseModuleExportName();let r=this.parseImportSpecifier(i,s,t.importKind==="type"||t.importKind==="typeof",a,void 0);t.specifiers.push(r)}}parseImportSpecifier(t,e,i,s,a){if(this.eatContextual(93))t.local=this.parseIdentifier();else{let{imported:r}=t;if(e)throw this.raise(d.ImportBindingIsString,{at:t,importName:r.value});this.checkReservedWord(r.name,t.loc.start,!0,!0),t.local||(t.local=ie(r))}return this.finishImportSpecifier(t,"ImportSpecifier",a)}isThisParam(t){return t.type==="Identifier"&&t.name==="this"}},Ot=class extends ki{constructor(t,e){t=Fc(t),super(t,e),this.options=t,this.initializeScopes(),this.plugins=qc(this.options.plugins),this.filename=t.sourceFilename}getScopeHandler(){return Xe}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}};function qc(n){let t=new Map;for(let e of n){let[i,s]=Array.isArray(e)?e:[e,{}];t.has(i)||t.set(i,s||{})}return t}function zc(n,t){var e;if(((e=t)==null?void 0:e.sourceType)==="unambiguous"){t=Object.assign({},t);try{t.sourceType="module";let i=$e(t,n),s=i.parse();if(i.sawUnambiguousESM)return s;if(i.ambiguousScriptDifferentAst)try{return t.sourceType="script",$e(t,n).parse()}catch{}else s.program.sourceType="script";return s}catch(i){try{return t.sourceType="script",$e(t,n).parse()}catch{}throw i}}else return $e(t,n).parse()}function Hc(n,t){let e=$e(t,n);return e.options.strictMode&&(e.state.strict=!0),e.getExpression()}function $c(n){let t={};for(let e of Object.keys(n))t[e]=Q(n[e]);return t}var Kc=$c(Al);function $e(n,t){let e=Ot;return n!=null&&n.plugins&&(Dc(n.plugins),e=Vc(n.plugins)),new e(n,t)}var Za={};function Vc(n){let t=Bc.filter(s=>L(n,s)),e=t.join("/"),i=Za[e];if(!i){i=Ot;for(let s of t)i=Sr[s](i);Za[e]=i}return i}Ye.parse=zc;Ye.parseExpression=Hc;Ye.tokTypes=Kc});var _r=T((Tu,Nr)=>{"use strict";var kr=require("url"),Ir=1800,$i=class{constructor(t){this.options=t||{},this.cookies=[]}set(t,e){let i=kr.parse(e||""),s=this.parse(t),a;return s.domain?(a=s.domain.replace(/^\./,""),(i.hostname.length<a.length||("."+i.hostname).substr(-a.length+1)!=="."+a)&&(s.domain=i.hostname)):s.domain=i.hostname,s.path||(s.path=this.getPath(i.pathname)),s.expires||(s.expires=new Date(Date.now()+(Number(this.options.sessionTimeout||Ir)||Ir)*1e3)),this.add(s)}get(t){return this.list(t).map(e=>e.name+"="+e.value).join("; ")}list(t){let e=[],i,s;for(i=this.cookies.length-1;i>=0;i--){if(s=this.cookies[i],this.isExpired(s)){this.cookies.splice(i,i);continue}this.match(s,t)&&e.unshift(s)}return e}parse(t){let e={};return(t||"").toString().split(";").forEach(i=>{let s=i.split("="),a=s.shift().trim().toLowerCase(),r=s.join("=").trim(),o;if(a)switch(a){case"expires":r=new Date(r),r.toString()!=="Invalid Date"&&(e.expires=r);break;case"path":e.path=r;break;case"domain":o=r.toLowerCase(),o.length&&o.charAt(0)!=="."&&(o="."+o),e.domain=o;break;case"max-age":e.expires=new Date(Date.now()+(Number(r)||0)*1e3);break;case"secure":e.secure=!0;break;case"httponly":e.httponly=!0;break;default:e.name||(e.name=a,e.value=r)}}),e}match(t,e){let i=kr.parse(e||"");return!(i.hostname!==t.domain&&(t.domain.charAt(0)!=="."||("."+i.hostname).substr(-t.domain.length)!==t.domain)||this.getPath(i.pathname).substr(0,t.path.length)!==t.path||t.secure&&i.protocol!=="https:")}add(t){let e,i;if(!t||!t.name)return!1;for(e=0,i=this.cookies.length;e<i;e++)if(this.compare(this.cookies[e],t))return this.isExpired(t)?(this.cookies.splice(e,1),!1):(this.cookies[e]=t,!0);return this.isExpired(t)||this.cookies.push(t),!0}compare(t,e){return t.name===e.name&&t.path===e.path&&t.domain===e.domain&&t.secure===e.secure&&t.httponly===t.httponly}isExpired(t){return t.expires&&t.expires<new Date||!t.value}getPath(t){let e=(t||"/").split("/");return e.pop(),e=e.join("/").trim(),e.charAt(0)!=="/"&&(e="/"+e),e.substr(-1)!=="/"&&(e+="/"),e}};Nr.exports=$i});var q=T((Au,Wc)=>{Wc.exports={name:"nodemailer",version:"6.9.3",description:"Easy as cake e-mail sending from your Node.js applications",main:"lib/nodemailer.js",scripts:{test:"grunt --trace-warnings"},repository:{type:"git",url:"https://github.com/nodemailer/nodemailer.git"},keywords:["Nodemailer"],author:"Andris Reinman",license:"MIT-0",bugs:{url:"https://github.com/nodemailer/nodemailer/issues"},homepage:"https://nodemailer.com/",devDependencies:{"@aws-sdk/client-ses":"3.341.0","aws-sdk":"2.1386.0",bunyan:"1.8.15",chai:"4.3.7","eslint-config-nodemailer":"1.2.0","eslint-config-prettier":"8.8.0",grunt:"1.6.1","grunt-cli":"1.4.3","grunt-eslint":"24.1.0","grunt-mocha-test":"0.13.3",libbase64:"1.2.1",libmime:"5.2.1",libqp:"2.0.1",mocha:"10.2.0","nodemailer-ntlm-auth":"1.0.3",proxy:"1.0.2","proxy-test-server":"1.0.0",sinon:"15.1.0","smtp-server":"3.12.0"},engines:{node:">=6.0.0"}}});var Ze=T((Eu,Ki)=>{"use strict";var Gc=require("http"),Xc=require("https"),Lr=require("url"),Jc=require("zlib"),Qc=require("stream").PassThrough,Mr=_r(),Yc=q(),Zc=require("net"),ep=5;Ki.exports=function(n,t){return Or(n,t)};Ki.exports.Cookies=Mr;function Or(n,t){t=t||{},t.fetchRes=t.fetchRes||new Qc,t.cookies=t.cookies||new Mr,t.redirects=t.redirects||0,t.maxRedirects=isNaN(t.maxRedirects)?ep:t.maxRedirects,t.cookie&&([].concat(t.cookie||[]).forEach(u=>{t.cookies.set(u,n)}),t.cookie=!1);let e=t.fetchRes,i=Lr.parse(n),s=(t.method||"").toString().trim().toUpperCase()||"GET",a=!1,r,o,l=i.protocol==="https:"?Xc:Gc,c={"accept-encoding":"gzip,deflate","user-agent":"nodemailer/"+Yc.version};if(Object.keys(t.headers||{}).forEach(u=>{c[u.toLowerCase().trim()]=t.headers[u]}),t.userAgent&&(c["user-agent"]=t.userAgent),i.auth&&(c.Authorization="Basic "+Buffer.from(i.auth).toString("base64")),(r=t.cookies.get(n))&&(c.cookie=r),t.body){if(t.contentType!==!1&&(c["Content-Type"]=t.contentType||"application/x-www-form-urlencoded"),typeof t.body.pipe=="function")c["Transfer-Encoding"]="chunked",o=t.body,o.on("error",u=>{a||(a=!0,u.type="FETCH",u.sourceUrl=n,e.emit("error",u))});else{if(t.body instanceof Buffer)o=t.body;else if(typeof t.body=="object")try{o=Buffer.from(Object.keys(t.body).map(u=>{let f=t.body[u].toString().trim();return encodeURIComponent(u)+"="+encodeURIComponent(f)}).join("&"))}catch(u){if(a)return;a=!0,u.type="FETCH",u.sourceUrl=n,e.emit("error",u);return}else o=Buffer.from(t.body.toString().trim());c["Content-Type"]=t.contentType||"application/x-www-form-urlencoded",c["Content-Length"]=o.length}s=(t.method||"").toString().trim().toUpperCase()||"POST"}let p,h={method:s,host:i.hostname,path:i.path,port:i.port?i.port:i.protocol==="https:"?443:80,headers:c,rejectUnauthorized:!1,agent:!1};t.tls&&Object.keys(t.tls).forEach(u=>{h[u]=t.tls[u]}),i.protocol==="https:"&&i.hostname&&i.hostname!==h.host&&!Zc.isIP(i.hostname)&&!h.servername&&(h.servername=i.hostname);try{p=l.request(h)}catch(u){return a=!0,setImmediate(()=>{u.type="FETCH",u.sourceUrl=n,e.emit("error",u)}),e}return t.timeout&&p.setTimeout(t.timeout,()=>{if(a)return;a=!0,p.abort();let u=new Error("Request Timeout");u.type="FETCH",u.sourceUrl=n,e.emit("error",u)}),p.on("error",u=>{a||(a=!0,u.type="FETCH",u.sourceUrl=n,e.emit("error",u))}),p.on("response",u=>{let f;if(!a){switch(u.headers["content-encoding"]){case"gzip":case"deflate":f=Jc.createUnzip();break}if(u.headers["set-cookie"]&&[].concat(u.headers["set-cookie"]||[]).forEach(m=>{t.cookies.set(m,n)}),[301,302,303,307,308].includes(u.statusCode)&&u.headers.location){if(t.redirects++,t.redirects>t.maxRedirects){a=!0;let m=new Error("Maximum redirect count exceeded");m.type="FETCH",m.sourceUrl=n,e.emit("error",m),p.abort();return}return t.method="GET",t.body=!1,Or(Lr.resolve(n,u.headers.location),t)}if(e.statusCode=u.statusCode,e.headers=u.headers,u.statusCode>=300&&!t.allowErrorResponse){a=!0;let m=new Error("Invalid status code "+u.statusCode);m.type="FETCH",m.sourceUrl=n,e.emit("error",m),p.abort();return}u.on("error",m=>{a||(a=!0,m.type="FETCH",m.sourceUrl=n,e.emit("error",m),p.abort())}),f?(u.pipe(f).pipe(e),f.on("error",m=>{a||(a=!0,m.type="FETCH",m.sourceUrl=n,e.emit("error",m),p.abort())})):u.pipe(e)}}),setImmediate(()=>{if(o)try{if(typeof o.pipe=="function")return o.pipe(p);p.write(o)}catch(u){a=!0,u.type="FETCH",u.sourceUrl=n,e.emit("error",u);return}p.end()}),e}});var j=T((Su,F)=>{"use strict";var tp=require("url"),ip=require("util"),sp=require("fs"),ap=Ze(),X=require("dns"),rp=require("net"),np=require("os"),Vi=5*60*1e3,Br;try{Br=np.networkInterfaces()}catch{}F.exports.networkInterfaces=Br;var Fr=(n,t)=>{let e=F.exports.networkInterfaces;return e?Object.keys(e).map(s=>e[s]).reduce((s,a)=>s.concat(a),[]).filter(s=>!s.internal||t).filter(s=>s.family==="IPv"+n||s.family===n).length>0:!0},Dr=(n,t,e,i)=>{if(e=e||{},!Fr(n,e.allowInternalNetworkInterfaces))return i(null,[]);(X.Resolver?new X.Resolver(e):X)["resolve"+n](t,(r,o)=>{if(r){switch(r.code){case X.NODATA:case X.NOTFOUND:case X.NOTIMP:case X.SERVFAIL:case X.CONNREFUSED:case X.REFUSED:case"EAI_AGAIN":return i(null,[])}return i(r)}return i(null,Array.isArray(o)?o:[].concat(o||[]))})},et=F.exports.dnsCache=new Map,G=(n,t)=>n?Object.assign({servername:n.servername,host:!n.addresses||!n.addresses.length?null:n.addresses.length===1?n.addresses[0]:n.addresses[Math.floor(Math.random()*n.addresses.length)]},t||{}):Object.assign({},t||{});F.exports.resolveHostname=(n,t)=>{if(n=n||{},!n.host&&n.servername&&(n.host=n.servername),!n.host||rp.isIP(n.host)){let i={addresses:[n.host],servername:n.servername||!1};return t(null,G(i,{cached:!1}))}let e;if(et.has(n.host)&&(e=et.get(n.host),!e.expires||e.expires>=Date.now()))return t(null,G(e.value,{cached:!0}));Dr(4,n.host,n,(i,s)=>{if(i)return e?t(null,G(e.value,{cached:!0,error:i})):t(i);if(s&&s.length){let a={addresses:s,servername:n.servername||n.host};return et.set(n.host,{value:a,expires:Date.now()+(n.dnsTtl||Vi)}),t(null,G(a,{cached:!1}))}Dr(6,n.host,n,(a,r)=>{if(a)return e?t(null,G(e.value,{cached:!0,error:a})):t(a);if(r&&r.length){let o={addresses:r,servername:n.servername||n.host};return et.set(n.host,{value:o,expires:Date.now()+(n.dnsTtl||Vi)}),t(null,G(o,{cached:!1}))}try{X.lookup(n.host,{all:!0},(o,l)=>{if(o)return e?t(null,G(e.value,{cached:!0,error:o})):t(o);let c=l?l.filter(h=>Fr(h.family)).map(h=>h.address).shift():!1;if(l&&l.length&&!c&&console.warn(`Failed to resolve IPv${l[0].family} addresses with current network`),!c&&e)return t(null,G(e.value,{cached:!0}));let p={addresses:c?[c]:[n.host],servername:n.servername||n.host};return et.set(n.host,{value:p,expires:Date.now()+(n.dnsTtl||Vi)}),t(null,G(p,{cached:!1}))})}catch(o){return e?t(null,G(e.value,{cached:!0,error:o})):t(o)}})})};F.exports.parseConnectionUrl=n=>{n=n||"";let t={};return[tp.parse(n,!0)].forEach(e=>{let i;switch(e.protocol){case"smtp:":t.secure=!1;break;case"smtps:":t.secure=!0;break;case"direct:":t.direct=!0;break}!isNaN(e.port)&&Number(e.port)&&(t.port=Number(e.port)),e.hostname&&(t.host=e.hostname),e.auth&&(i=e.auth.split(":"),t.auth||(t.auth={}),t.auth.user=i.shift(),t.auth.pass=i.join(":")),Object.keys(e.query||{}).forEach(s=>{let a=t,r=s,o=e.query[s];switch(isNaN(o)||(o=Number(o)),o){case"true":o=!0;break;case"false":o=!1;break}if(s.indexOf("tls.")===0)r=s.substr(4),t.tls||(t.tls={}),a=t.tls;else if(s.indexOf(".")>=0)return;r in a||(a[r]=o)})}),t};F.exports._logFunc=(n,t,e,i,s,...a)=>{let r={};Object.keys(e||{}).forEach(o=>{o!=="level"&&(r[o]=e[o])}),Object.keys(i||{}).forEach(o=>{o!=="level"&&(r[o]=i[o])}),n[t](r,s,...a)};F.exports.getLogger=(n,t)=>{n=n||{};let e={},i=["trace","debug","info","warn","error","fatal"];if(!n.logger)return i.forEach(a=>{e[a]=()=>!1}),e;let s=n.logger;return n.logger===!0&&(s=op(i)),i.forEach(a=>{e[a]=(r,o,...l)=>{F.exports._logFunc(s,a,t,r,o,...l)}}),e};F.exports.callbackPromise=(n,t)=>function(){let e=Array.from(arguments),i=e.shift();i?t(i):n(...e)};F.exports.resolveContent=(n,t,e)=>{let i;e||(i=new Promise((o,l)=>{e=F.exports.callbackPromise(o,l)}));let s=n&&n[t]&&n[t].content||n[t],a,r=(typeof n[t]=="object"&&n[t].encoding||"utf8").toString().toLowerCase().replace(/[-_\s]/g,"");if(!s)return e(null,s);if(typeof s=="object"){if(typeof s.pipe=="function")return Wi(s,(o,l)=>{if(o)return e(o);n[t].content?n[t].content=l:n[t]=l,e(null,l)});if(/^https?:\/\//i.test(s.path||s.href))return a=ap(s.path||s.href),Wi(a,e);if(/^data:/i.test(s.path||s.href)){let o=(s.path||s.href).match(/^data:((?:[^;]*;)*(?:[^,]*)),(.*)$/i);return o?e(null,/\bbase64$/i.test(o[1])?Buffer.from(o[2],"base64"):Buffer.from(decodeURIComponent(o[2]))):e(null,Buffer.from(0))}else if(s.path)return Wi(sp.createReadStream(s.path),e)}return typeof n[t].content=="string"&&!["utf8","usascii","ascii"].includes(r)&&(s=Buffer.from(n[t].content,r)),setImmediate(()=>e(null,s)),i};F.exports.assign=function(){let n=Array.from(arguments),t=n.shift()||{};return n.forEach(e=>{Object.keys(e||{}).forEach(i=>{["tls","auth"].includes(i)&&e[i]&&typeof e[i]=="object"?(t[i]||(t[i]={}),Object.keys(e[i]).forEach(s=>{t[i][s]=e[i][s]})):t[i]=e[i]})}),t};F.exports.encodeXText=n=>{if(!/[^\x21-\x2A\x2C-\x3C\x3E-\x7E]/.test(n))return n;let t=Buffer.from(n),e="";for(let i=0,s=t.length;i<s;i++){let a=t[i];a<33||a>126||a===43||a===61?e+="+"+(a<16?"0":"")+a.toString(16).toUpperCase():e+=String.fromCharCode(a)}return e};function Wi(n,t){let e=!1,i=[],s=0;n.on("error",a=>{e||(e=!0,t(a))}),n.on("readable",()=>{let a;for(;(a=n.read())!==null;)i.push(a),s+=a.length}),n.on("end",()=>{if(e)return;e=!0;let a;try{a=Buffer.concat(i,s)}catch(r){return t(r)}t(null,a)})}function op(n){let t=0,e=new Map;n.forEach(a=>{a.length>t&&(t=a.length)}),n.forEach(a=>{let r=a.toUpperCase();r.length<t&&(r+=" ".repeat(t-r.length)),e.set(a,r)});let i=(a,r,o,...l)=>{let c="";r&&(r.tnx==="server"?c="S: ":r.tnx==="client"&&(c="C: "),r.sid&&(c="["+r.sid+"] "+c),r.cid&&(c="[#"+r.cid+"] "+c)),o=ip.format(o,...l),o.split(/\r?\n/).forEach(p=>{console.log("[%s] %s %s",new Date().toISOString().substr(0,19).replace(/T/," "),e.get(a),c+p)})},s={};return n.forEach(a=>{s[a]=i.bind(null,a)}),s}});var Gi=T((Cu,qr)=>{"use strict";var lp=require("path"),jr="application/octet-stream",cp="bin",Rr=new Map([["application/acad","dwg"],["application/applixware","aw"],["application/arj","arj"],["application/atom+xml","xml"],["application/atomcat+xml","atomcat"],["application/atomsvc+xml","atomsvc"],["application/base64",["mm","mme"]],["application/binhex","hqx"],["application/binhex4","hqx"],["application/book",["book","boo"]],["application/ccxml+xml,","ccxml"],["application/cdf","cdf"],["application/cdmi-capability","cdmia"],["application/cdmi-container","cdmic"],["application/cdmi-domain","cdmid"],["application/cdmi-object","cdmio"],["application/cdmi-queue","cdmiq"],["application/clariscad","ccad"],["application/commonground","dp"],["application/cu-seeme","cu"],["application/davmount+xml","davmount"],["application/drafting","drw"],["application/dsptype","tsp"],["application/dssc+der","dssc"],["application/dssc+xml","xdssc"],["application/dxf","dxf"],["application/ecmascript",["js","es"]],["application/emma+xml","emma"],["application/envoy","evy"],["application/epub+zip","epub"],["application/excel",["xls","xl","xla","xlb","xlc","xld","xlk","xll","xlm","xlt","xlv","xlw"]],["application/exi","exi"],["application/font-tdpfr","pfr"],["application/fractals","fif"],["application/freeloader","frl"],["application/futuresplash","spl"],["application/gnutar","tgz"],["application/groupwise","vew"],["application/hlp","hlp"],["application/hta","hta"],["application/hyperstudio","stk"],["application/i-deas","unv"],["application/iges",["iges","igs"]],["application/inf","inf"],["application/internet-property-stream","acx"],["application/ipfix","ipfix"],["application/java","class"],["application/java-archive","jar"],["application/java-byte-code","class"],["application/java-serialized-object","ser"],["application/java-vm","class"],["application/javascript","js"],["application/json","json"],["application/lha","lha"],["application/lzx","lzx"],["application/mac-binary","bin"],["application/mac-binhex","hqx"],["application/mac-binhex40","hqx"],["application/mac-compactpro","cpt"],["application/macbinary","bin"],["application/mads+xml","mads"],["application/marc","mrc"],["application/marcxml+xml","mrcx"],["application/mathematica","ma"],["application/mathml+xml","mathml"],["application/mbedlet","mbd"],["application/mbox","mbox"],["application/mcad","mcd"],["application/mediaservercontrol+xml","mscml"],["application/metalink4+xml","meta4"],["application/mets+xml","mets"],["application/mime","aps"],["application/mods+xml","mods"],["application/mp21","m21"],["application/mp4","mp4"],["application/mspowerpoint",["ppt","pot","pps","ppz"]],["application/msword",["doc","dot","w6w","wiz","word"]],["application/mswrite","wri"],["application/mxf","mxf"],["application/netmc","mcp"],["application/octet-stream",["*"]],["application/oda","oda"],["application/oebps-package+xml","opf"],["application/ogg","ogx"],["application/olescript","axs"],["application/onenote","onetoc"],["application/patch-ops-error+xml","xer"],["application/pdf","pdf"],["application/pgp-encrypted","asc"],["application/pgp-signature","pgp"],["application/pics-rules","prf"],["application/pkcs-12","p12"],["application/pkcs-crl","crl"],["application/pkcs10","p10"],["application/pkcs7-mime",["p7c","p7m"]],["application/pkcs7-signature","p7s"],["application/pkcs8","p8"],["application/pkix-attr-cert","ac"],["application/pkix-cert",["cer","crt"]],["application/pkix-crl","crl"],["application/pkix-pkipath","pkipath"],["application/pkixcmp","pki"],["application/plain","text"],["application/pls+xml","pls"],["application/postscript",["ps","ai","eps"]],["application/powerpoint","ppt"],["application/pro_eng",["part","prt"]],["application/prs.cww","cww"],["application/pskc+xml","pskcxml"],["application/rdf+xml","rdf"],["application/reginfo+xml","rif"],["application/relax-ng-compact-syntax","rnc"],["application/resource-lists+xml","rl"],["application/resource-lists-diff+xml","rld"],["application/ringing-tones","rng"],["application/rls-services+xml","rs"],["application/rsd+xml","rsd"],["application/rss+xml","xml"],["application/rtf",["rtf","rtx"]],["application/sbml+xml","sbml"],["application/scvp-cv-request","scq"],["application/scvp-cv-response","scs"],["application/scvp-vp-request","spq"],["application/scvp-vp-response","spp"],["application/sdp","sdp"],["application/sea","sea"],["application/set","set"],["application/set-payment-initiation","setpay"],["application/set-registration-initiation","setreg"],["application/shf+xml","shf"],["application/sla","stl"],["application/smil",["smi","smil"]],["application/smil+xml","smi"],["application/solids","sol"],["application/sounder","sdr"],["application/sparql-query","rq"],["application/sparql-results+xml","srx"],["application/srgs","gram"],["application/srgs+xml","grxml"],["application/sru+xml","sru"],["application/ssml+xml","ssml"],["application/step",["step","stp"]],["application/streamingmedia","ssm"],["application/tei+xml","tei"],["application/thraud+xml","tfi"],["application/timestamped-data","tsd"],["application/toolbook","tbk"],["application/vda","vda"],["application/vnd.3gpp.pic-bw-large","plb"],["application/vnd.3gpp.pic-bw-small","psb"],["application/vnd.3gpp.pic-bw-var","pvb"],["application/vnd.3gpp2.tcap","tcap"],["application/vnd.3m.post-it-notes","pwn"],["application/vnd.accpac.simply.aso","aso"],["application/vnd.accpac.simply.imp","imp"],["application/vnd.acucobol","acu"],["application/vnd.acucorp","atc"],["application/vnd.adobe.air-application-installer-package+zip","air"],["application/vnd.adobe.fxp","fxp"],["application/vnd.adobe.xdp+xml","xdp"],["application/vnd.adobe.xfdf","xfdf"],["application/vnd.ahead.space","ahead"],["application/vnd.airzip.filesecure.azf","azf"],["application/vnd.airzip.filesecure.azs","azs"],["application/vnd.amazon.ebook","azw"],["application/vnd.americandynamics.acc","acc"],["application/vnd.amiga.ami","ami"],["application/vnd.android.package-archive","apk"],["application/vnd.anser-web-certificate-issue-initiation","cii"],["application/vnd.anser-web-funds-transfer-initiation","fti"],["application/vnd.antix.game-component","atx"],["application/vnd.apple.installer+xml","mpkg"],["application/vnd.apple.mpegurl","m3u8"],["application/vnd.aristanetworks.swi","swi"],["application/vnd.audiograph","aep"],["application/vnd.blueice.multipass","mpm"],["application/vnd.bmi","bmi"],["application/vnd.businessobjects","rep"],["application/vnd.chemdraw+xml","cdxml"],["application/vnd.chipnuts.karaoke-mmd","mmd"],["application/vnd.cinderella","cdy"],["application/vnd.claymore","cla"],["application/vnd.cloanto.rp9","rp9"],["application/vnd.clonk.c4group","c4g"],["application/vnd.cluetrust.cartomobile-config","c11amc"],["application/vnd.cluetrust.cartomobile-config-pkg","c11amz"],["application/vnd.commonspace","csp"],["application/vnd.contact.cmsg","cdbcmsg"],["application/vnd.cosmocaller","cmc"],["application/vnd.crick.clicker","clkx"],["application/vnd.crick.clicker.keyboard","clkk"],["application/vnd.crick.clicker.palette","clkp"],["application/vnd.crick.clicker.template","clkt"],["application/vnd.crick.clicker.wordbank","clkw"],["application/vnd.criticaltools.wbs+xml","wbs"],["application/vnd.ctc-posml","pml"],["application/vnd.cups-ppd","ppd"],["application/vnd.curl.car","car"],["application/vnd.curl.pcurl","pcurl"],["application/vnd.data-vision.rdz","rdz"],["application/vnd.denovo.fcselayout-link","fe_launch"],["application/vnd.dna","dna"],["application/vnd.dolby.mlp","mlp"],["application/vnd.dpgraph","dpg"],["application/vnd.dreamfactory","dfac"],["application/vnd.dvb.ait","ait"],["application/vnd.dvb.service","svc"],["application/vnd.dynageo","geo"],["application/vnd.ecowin.chart","mag"],["application/vnd.enliven","nml"],["application/vnd.epson.esf","esf"],["application/vnd.epson.msf","msf"],["application/vnd.epson.quickanime","qam"],["application/vnd.epson.salt","slt"],["application/vnd.epson.ssf","ssf"],["application/vnd.eszigno3+xml","es3"],["application/vnd.ezpix-album","ez2"],["application/vnd.ezpix-package","ez3"],["application/vnd.fdf","fdf"],["application/vnd.fdsn.seed","seed"],["application/vnd.flographit","gph"],["application/vnd.fluxtime.clip","ftc"],["application/vnd.framemaker","fm"],["application/vnd.frogans.fnc","fnc"],["application/vnd.frogans.ltf","ltf"],["application/vnd.fsc.weblaunch","fsc"],["application/vnd.fujitsu.oasys","oas"],["application/vnd.fujitsu.oasys2","oa2"],["application/vnd.fujitsu.oasys3","oa3"],["application/vnd.fujitsu.oasysgp","fg5"],["application/vnd.fujitsu.oasysprs","bh2"],["application/vnd.fujixerox.ddd","ddd"],["application/vnd.fujixerox.docuworks","xdw"],["application/vnd.fujixerox.docuworks.binder","xbd"],["application/vnd.fuzzysheet","fzs"],["application/vnd.genomatix.tuxedo","txd"],["application/vnd.geogebra.file","ggb"],["application/vnd.geogebra.tool","ggt"],["application/vnd.geometry-explorer","gex"],["application/vnd.geonext","gxt"],["application/vnd.geoplan","g2w"],["application/vnd.geospace","g3w"],["application/vnd.gmx","gmx"],["application/vnd.google-earth.kml+xml","kml"],["application/vnd.google-earth.kmz","kmz"],["application/vnd.grafeq","gqf"],["application/vnd.groove-account","gac"],["application/vnd.groove-help","ghf"],["application/vnd.groove-identity-message","gim"],["application/vnd.groove-injector","grv"],["application/vnd.groove-tool-message","gtm"],["application/vnd.groove-tool-template","tpl"],["application/vnd.groove-vcard","vcg"],["application/vnd.hal+xml","hal"],["application/vnd.handheld-entertainment+xml","zmm"],["application/vnd.hbci","hbci"],["application/vnd.hhe.lesson-player","les"],["application/vnd.hp-hpgl",["hgl","hpg","hpgl"]],["application/vnd.hp-hpid","hpid"],["application/vnd.hp-hps","hps"],["application/vnd.hp-jlyt","jlt"],["application/vnd.hp-pcl","pcl"],["application/vnd.hp-pclxl","pclxl"],["application/vnd.hydrostatix.sof-data","sfd-hdstx"],["application/vnd.hzn-3d-crossword","x3d"],["application/vnd.ibm.minipay","mpy"],["application/vnd.ibm.modcap","afp"],["application/vnd.ibm.rights-management","irm"],["application/vnd.ibm.secure-container","sc"],["application/vnd.iccprofile","icc"],["application/vnd.igloader","igl"],["application/vnd.immervision-ivp","ivp"],["application/vnd.immervision-ivu","ivu"],["application/vnd.insors.igm","igm"],["application/vnd.intercon.formnet","xpw"],["application/vnd.intergeo","i2g"],["application/vnd.intu.qbo","qbo"],["application/vnd.intu.qfx","qfx"],["application/vnd.ipunplugged.rcprofile","rcprofile"],["application/vnd.irepository.package+xml","irp"],["application/vnd.is-xpr","xpr"],["application/vnd.isac.fcs","fcs"],["application/vnd.jam","jam"],["application/vnd.jcp.javame.midlet-rms","rms"],["application/vnd.jisp","jisp"],["application/vnd.joost.joda-archive","joda"],["application/vnd.kahootz","ktz"],["application/vnd.kde.karbon","karbon"],["application/vnd.kde.kchart","chrt"],["application/vnd.kde.kformula","kfo"],["application/vnd.kde.kivio","flw"],["application/vnd.kde.kontour","kon"],["application/vnd.kde.kpresenter","kpr"],["application/vnd.kde.kspread","ksp"],["application/vnd.kde.kword","kwd"],["application/vnd.kenameaapp","htke"],["application/vnd.kidspiration","kia"],["application/vnd.kinar","kne"],["application/vnd.koan","skp"],["application/vnd.kodak-descriptor","sse"],["application/vnd.las.las+xml","lasxml"],["application/vnd.llamagraphics.life-balance.desktop","lbd"],["application/vnd.llamagraphics.life-balance.exchange+xml","lbe"],["application/vnd.lotus-1-2-3","123"],["application/vnd.lotus-approach","apr"],["application/vnd.lotus-freelance","pre"],["application/vnd.lotus-notes","nsf"],["application/vnd.lotus-organizer","org"],["application/vnd.lotus-screencam","scm"],["application/vnd.lotus-wordpro","lwp"],["application/vnd.macports.portpkg","portpkg"],["application/vnd.mcd","mcd"],["application/vnd.medcalcdata","mc1"],["application/vnd.mediastation.cdkey","cdkey"],["application/vnd.mfer","mwf"],["application/vnd.mfmp","mfm"],["application/vnd.micrografx.flo","flo"],["application/vnd.micrografx.igx","igx"],["application/vnd.mif","mif"],["application/vnd.mobius.daf","daf"],["application/vnd.mobius.dis","dis"],["application/vnd.mobius.mbk","mbk"],["application/vnd.mobius.mqy","mqy"],["application/vnd.mobius.msl","msl"],["application/vnd.mobius.plc","plc"],["application/vnd.mobius.txf","txf"],["application/vnd.mophun.application","mpn"],["application/vnd.mophun.certificate","mpc"],["application/vnd.mozilla.xul+xml","xul"],["application/vnd.ms-artgalry","cil"],["application/vnd.ms-cab-compressed","cab"],["application/vnd.ms-excel",["xls","xla","xlc","xlm","xlt","xlw","xlb","xll"]],["application/vnd.ms-excel.addin.macroenabled.12","xlam"],["application/vnd.ms-excel.sheet.binary.macroenabled.12","xlsb"],["application/vnd.ms-excel.sheet.macroenabled.12","xlsm"],["application/vnd.ms-excel.template.macroenabled.12","xltm"],["application/vnd.ms-fontobject","eot"],["application/vnd.ms-htmlhelp","chm"],["application/vnd.ms-ims","ims"],["application/vnd.ms-lrm","lrm"],["application/vnd.ms-officetheme","thmx"],["application/vnd.ms-outlook","msg"],["application/vnd.ms-pki.certstore","sst"],["application/vnd.ms-pki.pko","pko"],["application/vnd.ms-pki.seccat","cat"],["application/vnd.ms-pki.stl","stl"],["application/vnd.ms-pkicertstore","sst"],["application/vnd.ms-pkiseccat","cat"],["application/vnd.ms-pkistl","stl"],["application/vnd.ms-powerpoint",["ppt","pot","pps","ppa","pwz"]],["application/vnd.ms-powerpoint.addin.macroenabled.12","ppam"],["application/vnd.ms-powerpoint.presentation.macroenabled.12","pptm"],["application/vnd.ms-powerpoint.slide.macroenabled.12","sldm"],["application/vnd.ms-powerpoint.slideshow.macroenabled.12","ppsm"],["application/vnd.ms-powerpoint.template.macroenabled.12","potm"],["application/vnd.ms-project","mpp"],["application/vnd.ms-word.document.macroenabled.12","docm"],["application/vnd.ms-word.template.macroenabled.12","dotm"],["application/vnd.ms-works",["wks","wcm","wdb","wps"]],["application/vnd.ms-wpl","wpl"],["application/vnd.ms-xpsdocument","xps"],["application/vnd.mseq","mseq"],["application/vnd.musician","mus"],["application/vnd.muvee.style","msty"],["application/vnd.neurolanguage.nlu","nlu"],["application/vnd.noblenet-directory","nnd"],["application/vnd.noblenet-sealer","nns"],["application/vnd.noblenet-web","nnw"],["application/vnd.nokia.configuration-message","ncm"],["application/vnd.nokia.n-gage.data","ngdat"],["application/vnd.nokia.n-gage.symbian.install","n-gage"],["application/vnd.nokia.radio-preset","rpst"],["application/vnd.nokia.radio-presets","rpss"],["application/vnd.nokia.ringing-tone","rng"],["application/vnd.novadigm.edm","edm"],["application/vnd.novadigm.edx","edx"],["application/vnd.novadigm.ext","ext"],["application/vnd.oasis.opendocument.chart","odc"],["application/vnd.oasis.opendocument.chart-template","otc"],["application/vnd.oasis.opendocument.database","odb"],["application/vnd.oasis.opendocument.formula","odf"],["application/vnd.oasis.opendocument.formula-template","odft"],["application/vnd.oasis.opendocument.graphics","odg"],["application/vnd.oasis.opendocument.graphics-template","otg"],["application/vnd.oasis.opendocument.image","odi"],["application/vnd.oasis.opendocument.image-template","oti"],["application/vnd.oasis.opendocument.presentation","odp"],["application/vnd.oasis.opendocument.presentation-template","otp"],["application/vnd.oasis.opendocument.spreadsheet","ods"],["application/vnd.oasis.opendocument.spreadsheet-template","ots"],["application/vnd.oasis.opendocument.text","odt"],["application/vnd.oasis.opendocument.text-master","odm"],["application/vnd.oasis.opendocument.text-template","ott"],["application/vnd.oasis.opendocument.text-web","oth"],["application/vnd.olpc-sugar","xo"],["application/vnd.oma.dd2+xml","dd2"],["application/vnd.openofficeorg.extension","oxt"],["application/vnd.openxmlformats-officedocument.presentationml.presentation","pptx"],["application/vnd.openxmlformats-officedocument.presentationml.slide","sldx"],["application/vnd.openxmlformats-officedocument.presentationml.slideshow","ppsx"],["application/vnd.openxmlformats-officedocument.presentationml.template","potx"],["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","xlsx"],["application/vnd.openxmlformats-officedocument.spreadsheetml.template","xltx"],["application/vnd.openxmlformats-officedocument.wordprocessingml.document","docx"],["application/vnd.openxmlformats-officedocument.wordprocessingml.template","dotx"],["application/vnd.osgeo.mapguide.package","mgp"],["application/vnd.osgi.dp","dp"],["application/vnd.palm","pdb"],["application/vnd.pawaafile","paw"],["application/vnd.pg.format","str"],["application/vnd.pg.osasli","ei6"],["application/vnd.picsel","efif"],["application/vnd.pmi.widget","wg"],["application/vnd.pocketlearn","plf"],["application/vnd.powerbuilder6","pbd"],["application/vnd.previewsystems.box","box"],["application/vnd.proteus.magazine","mgz"],["application/vnd.publishare-delta-tree","qps"],["application/vnd.pvi.ptid1","ptid"],["application/vnd.quark.quarkxpress","qxd"],["application/vnd.realvnc.bed","bed"],["application/vnd.recordare.musicxml","mxl"],["application/vnd.recordare.musicxml+xml","musicxml"],["application/vnd.rig.cryptonote","cryptonote"],["application/vnd.rim.cod","cod"],["application/vnd.rn-realmedia","rm"],["application/vnd.rn-realplayer","rnx"],["application/vnd.route66.link66+xml","link66"],["application/vnd.sailingtracker.track","st"],["application/vnd.seemail","see"],["application/vnd.sema","sema"],["application/vnd.semd","semd"],["application/vnd.semf","semf"],["application/vnd.shana.informed.formdata","ifm"],["application/vnd.shana.informed.formtemplate","itp"],["application/vnd.shana.informed.interchange","iif"],["application/vnd.shana.informed.package","ipk"],["application/vnd.simtech-mindmapper","twd"],["application/vnd.smaf","mmf"],["application/vnd.smart.teacher","teacher"],["application/vnd.solent.sdkm+xml","sdkm"],["application/vnd.spotfire.dxp","dxp"],["application/vnd.spotfire.sfs","sfs"],["application/vnd.stardivision.calc","sdc"],["application/vnd.stardivision.draw","sda"],["application/vnd.stardivision.impress","sdd"],["application/vnd.stardivision.math","smf"],["application/vnd.stardivision.writer","sdw"],["application/vnd.stardivision.writer-global","sgl"],["application/vnd.stepmania.stepchart","sm"],["application/vnd.sun.xml.calc","sxc"],["application/vnd.sun.xml.calc.template","stc"],["application/vnd.sun.xml.draw","sxd"],["application/vnd.sun.xml.draw.template","std"],["application/vnd.sun.xml.impress","sxi"],["application/vnd.sun.xml.impress.template","sti"],["application/vnd.sun.xml.math","sxm"],["application/vnd.sun.xml.writer","sxw"],["application/vnd.sun.xml.writer.global","sxg"],["application/vnd.sun.xml.writer.template","stw"],["application/vnd.sus-calendar","sus"],["application/vnd.svd","svd"],["application/vnd.symbian.install","sis"],["application/vnd.syncml+xml","xsm"],["application/vnd.syncml.dm+wbxml","bdm"],["application/vnd.syncml.dm+xml","xdm"],["application/vnd.tao.intent-module-archive","tao"],["application/vnd.tmobile-livetv","tmo"],["application/vnd.trid.tpt","tpt"],["application/vnd.triscape.mxs","mxs"],["application/vnd.trueapp","tra"],["application/vnd.ufdl","ufd"],["application/vnd.uiq.theme","utz"],["application/vnd.umajin","umj"],["application/vnd.unity","unityweb"],["application/vnd.uoml+xml","uoml"],["application/vnd.vcx","vcx"],["application/vnd.visio","vsd"],["application/vnd.visionary","vis"],["application/vnd.vsf","vsf"],["application/vnd.wap.wbxml","wbxml"],["application/vnd.wap.wmlc","wmlc"],["application/vnd.wap.wmlscriptc","wmlsc"],["application/vnd.webturbo","wtb"],["application/vnd.wolfram.player","nbp"],["application/vnd.wordperfect","wpd"],["application/vnd.wqd","wqd"],["application/vnd.wt.stf","stf"],["application/vnd.xara",["web","xar"]],["application/vnd.xfdl","xfdl"],["application/vnd.yamaha.hv-dic","hvd"],["application/vnd.yamaha.hv-script","hvs"],["application/vnd.yamaha.hv-voice","hvp"],["application/vnd.yamaha.openscoreformat","osf"],["application/vnd.yamaha.openscoreformat.osfpvg+xml","osfpvg"],["application/vnd.yamaha.smaf-audio","saf"],["application/vnd.yamaha.smaf-phrase","spf"],["application/vnd.yellowriver-custom-menu","cmp"],["application/vnd.zul","zir"],["application/vnd.zzazz.deck+xml","zaz"],["application/vocaltec-media-desc","vmd"],["application/vocaltec-media-file","vmf"],["application/voicexml+xml","vxml"],["application/widget","wgt"],["application/winhlp","hlp"],["application/wordperfect",["wp","wp5","wp6","wpd"]],["application/wordperfect6.0",["w60","wp5"]],["application/wordperfect6.1","w61"],["application/wsdl+xml","wsdl"],["application/wspolicy+xml","wspolicy"],["application/x-123","wk1"],["application/x-7z-compressed","7z"],["application/x-abiword","abw"],["application/x-ace-compressed","ace"],["application/x-aim","aim"],["application/x-authorware-bin","aab"],["application/x-authorware-map","aam"],["application/x-authorware-seg","aas"],["application/x-bcpio","bcpio"],["application/x-binary","bin"],["application/x-binhex40","hqx"],["application/x-bittorrent","torrent"],["application/x-bsh",["bsh","sh","shar"]],["application/x-bytecode.elisp","elc"],["application/x-bytecode.python","pyc"],["application/x-bzip","bz"],["application/x-bzip2",["boz","bz2"]],["application/x-cdf","cdf"],["application/x-cdlink","vcd"],["application/x-chat",["cha","chat"]],["application/x-chess-pgn","pgn"],["application/x-cmu-raster","ras"],["application/x-cocoa","cco"],["application/x-compactpro","cpt"],["application/x-compress","z"],["application/x-compressed",["tgz","gz","z","zip"]],["application/x-conference","nsc"],["application/x-cpio","cpio"],["application/x-cpt","cpt"],["application/x-csh","csh"],["application/x-debian-package","deb"],["application/x-deepv","deepv"],["application/x-director",["dir","dcr","dxr"]],["application/x-doom","wad"],["application/x-dtbncx+xml","ncx"],["application/x-dtbook+xml","dtb"],["application/x-dtbresource+xml","res"],["application/x-dvi","dvi"],["application/x-elc","elc"],["application/x-envoy",["env","evy"]],["application/x-esrehber","es"],["application/x-excel",["xls","xla","xlb","xlc","xld","xlk","xll","xlm","xlt","xlv","xlw"]],["application/x-font-bdf","bdf"],["application/x-font-ghostscript","gsf"],["application/x-font-linux-psf","psf"],["application/x-font-otf","otf"],["application/x-font-pcf","pcf"],["application/x-font-snf","snf"],["application/x-font-ttf","ttf"],["application/x-font-type1","pfa"],["application/x-font-woff","woff"],["application/x-frame","mif"],["application/x-freelance","pre"],["application/x-futuresplash","spl"],["application/x-gnumeric","gnumeric"],["application/x-gsp","gsp"],["application/x-gss","gss"],["application/x-gtar","gtar"],["application/x-gzip",["gz","gzip"]],["application/x-hdf","hdf"],["application/x-helpfile",["help","hlp"]],["application/x-httpd-imap","imap"],["application/x-ima","ima"],["application/x-internet-signup",["ins","isp"]],["application/x-internett-signup","ins"],["application/x-inventor","iv"],["application/x-ip2","ip"],["application/x-iphone","iii"],["application/x-java-class","class"],["application/x-java-commerce","jcm"],["application/x-java-jnlp-file","jnlp"],["application/x-javascript","js"],["application/x-koan",["skd","skm","skp","skt"]],["application/x-ksh","ksh"],["application/x-latex",["latex","ltx"]],["application/x-lha","lha"],["application/x-lisp","lsp"],["application/x-livescreen","ivy"],["application/x-lotus","wq1"],["application/x-lotusscreencam","scm"],["application/x-lzh","lzh"],["application/x-lzx","lzx"],["application/x-mac-binhex40","hqx"],["application/x-macbinary","bin"],["application/x-magic-cap-package-1.0","mc$"],["application/x-mathcad","mcd"],["application/x-meme","mm"],["application/x-midi",["mid","midi"]],["application/x-mif","mif"],["application/x-mix-transfer","nix"],["application/x-mobipocket-ebook","prc"],["application/x-mplayer2","asx"],["application/x-ms-application","application"],["application/x-ms-wmd","wmd"],["application/x-ms-wmz","wmz"],["application/x-ms-xbap","xbap"],["application/x-msaccess","mdb"],["application/x-msbinder","obd"],["application/x-mscardfile","crd"],["application/x-msclip","clp"],["application/x-msdownload",["exe","dll"]],["application/x-msexcel",["xls","xla","xlw"]],["application/x-msmediaview",["mvb","m13","m14"]],["application/x-msmetafile","wmf"],["application/x-msmoney","mny"],["application/x-mspowerpoint","ppt"],["application/x-mspublisher","pub"],["application/x-msschedule","scd"],["application/x-msterminal","trm"],["application/x-mswrite","wri"],["application/x-navi-animation","ani"],["application/x-navidoc","nvd"],["application/x-navimap","map"],["application/x-navistyle","stl"],["application/x-netcdf",["cdf","nc"]],["application/x-newton-compatible-pkg","pkg"],["application/x-nokia-9000-communicator-add-on-software","aos"],["application/x-omc","omc"],["application/x-omcdatamaker","omcd"],["application/x-omcregerator","omcr"],["application/x-pagemaker",["pm4","pm5"]],["application/x-pcl","pcl"],["application/x-perfmon",["pma","pmc","pml","pmr","pmw"]],["application/x-pixclscript","plx"],["application/x-pkcs10","p10"],["application/x-pkcs12",["p12","pfx"]],["application/x-pkcs7-certificates",["p7b","spc"]],["application/x-pkcs7-certreqresp","p7r"],["application/x-pkcs7-mime",["p7m","p7c"]],["application/x-pkcs7-signature",["p7s","p7a"]],["application/x-pointplus","css"],["application/x-portable-anymap","pnm"],["application/x-project",["mpc","mpt","mpv","mpx"]],["application/x-qpro","wb1"],["application/x-rar-compressed","rar"],["application/x-rtf","rtf"],["application/x-sdp","sdp"],["application/x-sea","sea"],["application/x-seelogo","sl"],["application/x-sh","sh"],["application/x-shar",["shar","sh"]],["application/x-shockwave-flash","swf"],["application/x-silverlight-app","xap"],["application/x-sit","sit"],["application/x-sprite",["spr","sprite"]],["application/x-stuffit","sit"],["application/x-stuffitx","sitx"],["application/x-sv4cpio","sv4cpio"],["application/x-sv4crc","sv4crc"],["application/x-tar","tar"],["application/x-tbook",["sbk","tbk"]],["application/x-tcl","tcl"],["application/x-tex","tex"],["application/x-tex-tfm","tfm"],["application/x-texinfo",["texi","texinfo"]],["application/x-troff",["roff","t","tr"]],["application/x-troff-man","man"],["application/x-troff-me","me"],["application/x-troff-ms","ms"],["application/x-troff-msvideo","avi"],["application/x-ustar","ustar"],["application/x-visio",["vsd","vst","vsw"]],["application/x-vnd.audioexplosion.mzz","mzz"],["application/x-vnd.ls-xpix","xpix"],["application/x-vrml","vrml"],["application/x-wais-source",["src","wsrc"]],["application/x-winhelp","hlp"],["application/x-wintalk","wtk"],["application/x-world",["wrl","svr"]],["application/x-wpwin","wpd"],["application/x-wri","wri"],["application/x-x509-ca-cert",["cer","crt","der"]],["application/x-x509-user-cert","crt"],["application/x-xfig","fig"],["application/x-xpinstall","xpi"],["application/x-zip-compressed","zip"],["application/xcap-diff+xml","xdf"],["application/xenc+xml","xenc"],["application/xhtml+xml","xhtml"],["application/xml","xml"],["application/xml-dtd","dtd"],["application/xop+xml","xop"],["application/xslt+xml","xslt"],["application/xspf+xml","xspf"],["application/xv+xml","mxml"],["application/yang","yang"],["application/yin+xml","yin"],["application/ynd.ms-pkipko","pko"],["application/zip","zip"],["audio/adpcm","adp"],["audio/aiff",["aiff","aif","aifc"]],["audio/basic",["snd","au"]],["audio/it","it"],["audio/make",["funk","my","pfunk"]],["audio/make.my.funk","pfunk"],["audio/mid",["mid","rmi"]],["audio/midi",["midi","kar","mid"]],["audio/mod","mod"],["audio/mp4","mp4a"],["audio/mpeg",["mpga","mp3","m2a","mp2","mpa","mpg"]],["audio/mpeg3","mp3"],["audio/nspaudio",["la","lma"]],["audio/ogg","oga"],["audio/s3m","s3m"],["audio/tsp-audio","tsi"],["audio/tsplayer","tsp"],["audio/vnd.dece.audio","uva"],["audio/vnd.digital-winds","eol"],["audio/vnd.dra","dra"],["audio/vnd.dts","dts"],["audio/vnd.dts.hd","dtshd"],["audio/vnd.lucent.voice","lvp"],["audio/vnd.ms-playready.media.pya","pya"],["audio/vnd.nuera.ecelp4800","ecelp4800"],["audio/vnd.nuera.ecelp7470","ecelp7470"],["audio/vnd.nuera.ecelp9600","ecelp9600"],["audio/vnd.qcelp","qcp"],["audio/vnd.rip","rip"],["audio/voc","voc"],["audio/voxware","vox"],["audio/wav","wav"],["audio/webm","weba"],["audio/x-aac","aac"],["audio/x-adpcm","snd"],["audio/x-aiff",["aiff","aif","aifc"]],["audio/x-au","au"],["audio/x-gsm",["gsd","gsm"]],["audio/x-jam","jam"],["audio/x-liveaudio","lam"],["audio/x-mid",["mid","midi"]],["audio/x-midi",["midi","mid"]],["audio/x-mod","mod"],["audio/x-mpeg","mp2"],["audio/x-mpeg-3","mp3"],["audio/x-mpegurl","m3u"],["audio/x-mpequrl","m3u"],["audio/x-ms-wax","wax"],["audio/x-ms-wma","wma"],["audio/x-nspaudio",["la","lma"]],["audio/x-pn-realaudio",["ra","ram","rm","rmm","rmp"]],["audio/x-pn-realaudio-plugin",["ra","rmp","rpm"]],["audio/x-psid","sid"],["audio/x-realaudio","ra"],["audio/x-twinvq","vqf"],["audio/x-twinvq-plugin",["vqe","vql"]],["audio/x-vnd.audioexplosion.mjuicemediafile","mjf"],["audio/x-voc","voc"],["audio/x-wav","wav"],["audio/xm","xm"],["chemical/x-cdx","cdx"],["chemical/x-cif","cif"],["chemical/x-cmdf","cmdf"],["chemical/x-cml","cml"],["chemical/x-csml","csml"],["chemical/x-pdb",["pdb","xyz"]],["chemical/x-xyz","xyz"],["drawing/x-dwf","dwf"],["i-world/i-vrml","ivr"],["image/bmp",["bmp","bm"]],["image/cgm","cgm"],["image/cis-cod","cod"],["image/cmu-raster",["ras","rast"]],["image/fif","fif"],["image/florian",["flo","turbot"]],["image/g3fax","g3"],["image/gif","gif"],["image/ief",["ief","iefs"]],["image/jpeg",["jpeg","jpe","jpg","jfif","jfif-tbnl"]],["image/jutvision","jut"],["image/ktx","ktx"],["image/naplps",["nap","naplps"]],["image/pict",["pic","pict"]],["image/pipeg","jfif"],["image/pjpeg",["jfif","jpe","jpeg","jpg"]],["image/png",["png","x-png"]],["image/prs.btif","btif"],["image/svg+xml","svg"],["image/tiff",["tif","tiff"]],["image/vasa","mcf"],["image/vnd.adobe.photoshop","psd"],["image/vnd.dece.graphic","uvi"],["image/vnd.djvu","djvu"],["image/vnd.dvb.subtitle","sub"],["image/vnd.dwg",["dwg","dxf","svf"]],["image/vnd.dxf","dxf"],["image/vnd.fastbidsheet","fbs"],["image/vnd.fpx","fpx"],["image/vnd.fst","fst"],["image/vnd.fujixerox.edmics-mmr","mmr"],["image/vnd.fujixerox.edmics-rlc","rlc"],["image/vnd.ms-modi","mdi"],["image/vnd.net-fpx",["fpx","npx"]],["image/vnd.rn-realflash","rf"],["image/vnd.rn-realpix","rp"],["image/vnd.wap.wbmp","wbmp"],["image/vnd.xiff","xif"],["image/webp","webp"],["image/x-cmu-raster","ras"],["image/x-cmx","cmx"],["image/x-dwg",["dwg","dxf","svf"]],["image/x-freehand","fh"],["image/x-icon","ico"],["image/x-jg","art"],["image/x-jps","jps"],["image/x-niff",["niff","nif"]],["image/x-pcx","pcx"],["image/x-pict",["pct","pic"]],["image/x-portable-anymap","pnm"],["image/x-portable-bitmap","pbm"],["image/x-portable-graymap","pgm"],["image/x-portable-greymap","pgm"],["image/x-portable-pixmap","ppm"],["image/x-quicktime",["qif","qti","qtif"]],["image/x-rgb","rgb"],["image/x-tiff",["tif","tiff"]],["image/x-windows-bmp","bmp"],["image/x-xbitmap","xbm"],["image/x-xbm","xbm"],["image/x-xpixmap",["xpm","pm"]],["image/x-xwd","xwd"],["image/x-xwindowdump","xwd"],["image/xbm","xbm"],["image/xpm","xpm"],["message/rfc822",["eml","mht","mhtml","nws","mime"]],["model/iges",["iges","igs"]],["model/mesh","msh"],["model/vnd.collada+xml","dae"],["model/vnd.dwf","dwf"],["model/vnd.gdl","gdl"],["model/vnd.gtw","gtw"],["model/vnd.mts","mts"],["model/vnd.vtu","vtu"],["model/vrml",["vrml","wrl","wrz"]],["model/x-pov","pov"],["multipart/x-gzip","gzip"],["multipart/x-ustar","ustar"],["multipart/x-zip","zip"],["music/crescendo",["mid","midi"]],["music/x-karaoke","kar"],["paleovu/x-pv","pvu"],["text/asp","asp"],["text/calendar","ics"],["text/css","css"],["text/csv","csv"],["text/ecmascript","js"],["text/h323","323"],["text/html",["html","htm","stm","acgi","htmls","htx","shtml"]],["text/iuls","uls"],["text/javascript","js"],["text/mcf","mcf"],["text/n3","n3"],["text/pascal","pas"],["text/plain",["txt","bas","c","h","c++","cc","com","conf","cxx","def","f","f90","for","g","hh","idc","jav","java","list","log","lst","m","mar","pl","sdml","text"]],["text/plain-bas","par"],["text/prs.lines.tag","dsc"],["text/richtext",["rtx","rt","rtf"]],["text/scriplet","wsc"],["text/scriptlet","sct"],["text/sgml",["sgm","sgml"]],["text/tab-separated-values","tsv"],["text/troff","t"],["text/turtle","ttl"],["text/uri-list",["uni","unis","uri","uris"]],["text/vnd.abc","abc"],["text/vnd.curl","curl"],["text/vnd.curl.dcurl","dcurl"],["text/vnd.curl.mcurl","mcurl"],["text/vnd.curl.scurl","scurl"],["text/vnd.fly","fly"],["text/vnd.fmi.flexstor","flx"],["text/vnd.graphviz","gv"],["text/vnd.in3d.3dml","3dml"],["text/vnd.in3d.spot","spot"],["text/vnd.rn-realtext","rt"],["text/vnd.sun.j2me.app-descriptor","jad"],["text/vnd.wap.wml","wml"],["text/vnd.wap.wmlscript","wmls"],["text/webviewhtml","htt"],["text/x-asm",["asm","s"]],["text/x-audiosoft-intra","aip"],["text/x-c",["c","cc","cpp"]],["text/x-component","htc"],["text/x-fortran",["for","f","f77","f90"]],["text/x-h",["h","hh"]],["text/x-java-source",["java","jav"]],["text/x-java-source,java","java"],["text/x-la-asf","lsx"],["text/x-m","m"],["text/x-pascal","p"],["text/x-script","hlb"],["text/x-script.csh","csh"],["text/x-script.elisp","el"],["text/x-script.guile","scm"],["text/x-script.ksh","ksh"],["text/x-script.lisp","lsp"],["text/x-script.perl","pl"],["text/x-script.perl-module","pm"],["text/x-script.phyton","py"],["text/x-script.rexx","rexx"],["text/x-script.scheme","scm"],["text/x-script.sh","sh"],["text/x-script.tcl","tcl"],["text/x-script.tcsh","tcsh"],["text/x-script.zsh","zsh"],["text/x-server-parsed-html",["shtml","ssi"]],["text/x-setext","etx"],["text/x-sgml",["sgm","sgml"]],["text/x-speech",["spc","talk"]],["text/x-uil","uil"],["text/x-uuencode",["uu","uue"]],["text/x-vcalendar","vcs"],["text/x-vcard","vcf"],["text/xml","xml"],["video/3gpp","3gp"],["video/3gpp2","3g2"],["video/animaflex","afl"],["video/avi","avi"],["video/avs-video","avs"],["video/dl","dl"],["video/fli","fli"],["video/gl","gl"],["video/h261","h261"],["video/h263","h263"],["video/h264","h264"],["video/jpeg","jpgv"],["video/jpm","jpm"],["video/mj2","mj2"],["video/mp4","mp4"],["video/mpeg",["mpeg","mp2","mpa","mpe","mpg","mpv2","m1v","m2v","mp3"]],["video/msvideo","avi"],["video/ogg","ogv"],["video/quicktime",["mov","qt","moov"]],["video/vdo","vdo"],["video/vivo",["viv","vivo"]],["video/vnd.dece.hd","uvh"],["video/vnd.dece.mobile","uvm"],["video/vnd.dece.pd","uvp"],["video/vnd.dece.sd","uvs"],["video/vnd.dece.video","uvv"],["video/vnd.fvt","fvt"],["video/vnd.mpegurl","mxu"],["video/vnd.ms-playready.media.pyv","pyv"],["video/vnd.rn-realvideo","rv"],["video/vnd.uvvu.mp4","uvu"],["video/vnd.vivo",["viv","vivo"]],["video/vosaic","vos"],["video/webm","webm"],["video/x-amt-demorun","xdr"],["video/x-amt-showrun","xsr"],["video/x-atomic3d-feature","fmf"],["video/x-dl","dl"],["video/x-dv",["dif","dv"]],["video/x-f4v","f4v"],["video/x-fli","fli"],["video/x-flv","flv"],["video/x-gl","gl"],["video/x-isvideo","isu"],["video/x-la-asf",["lsf","lsx"]],["video/x-m4v","m4v"],["video/x-motion-jpeg","mjpg"],["video/x-mpeg",["mp3","mp2"]],["video/x-mpeq2a","mp2"],["video/x-ms-asf",["asf","asr","asx"]],["video/x-ms-asf-plugin","asx"],["video/x-ms-wm","wm"],["video/x-ms-wmv","wmv"],["video/x-ms-wmx","wmx"],["video/x-ms-wvx","wvx"],["video/x-msvideo","avi"],["video/x-qtc","qtc"],["video/x-scm","scm"],["video/x-sgi-movie",["movie","mv"]],["windows/metafile","wmf"],["www/mime","mime"],["x-conference/x-cooltalk","ice"],["x-music/x-midi",["mid","midi"]],["x-world/x-3dmf",["3dm","3dmf","qd3","qd3d"]],["x-world/x-svr","svr"],["x-world/x-vrml",["flr","vrml","wrl","wrz","xaf","xof"]],["x-world/x-vrt","vrt"],["xgl/drawing","xgz"],["xgl/movie","xmz"]]),Ur=new Map([["123","application/vnd.lotus-1-2-3"],["323","text/h323"],["*","application/octet-stream"],["3dm","x-world/x-3dmf"],["3dmf","x-world/x-3dmf"],["3dml","text/vnd.in3d.3dml"],["3g2","video/3gpp2"],["3gp","video/3gpp"],["7z","application/x-7z-compressed"],["a","application/octet-stream"],["aab","application/x-authorware-bin"],["aac","audio/x-aac"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abc","text/vnd.abc"],["abw","application/x-abiword"],["ac","application/pkix-attr-cert"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acgi","text/html"],["acu","application/vnd.acucobol"],["acx","application/internet-property-stream"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afl","video/animaflex"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/postscript"],["aif",["audio/aiff","audio/x-aiff"]],["aifc",["audio/aiff","audio/x-aiff"]],["aiff",["audio/aiff","audio/x-aiff"]],["aim","application/x-aim"],["aip","text/x-audiosoft-intra"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["ani","application/x-navi-animation"],["aos","application/x-nokia-9000-communicator-add-on-software"],["apk","application/vnd.android.package-archive"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["aps","application/mime"],["arc","application/octet-stream"],["arj",["application/arj","application/octet-stream"]],["art","image/x-jg"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asp","text/asp"],["asr","video/x-ms-asf"],["asx",["video/x-ms-asf","application/x-mplayer2","video/x-ms-asf-plugin"]],["atc","application/vnd.acucorp"],["atomcat","application/atomcat+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au",["audio/basic","audio/x-au"]],["avi",["video/avi","video/msvideo","application/x-troff-msvideo","video/x-msvideo"]],["avs","video/avs-video"],["aw","application/applixware"],["axs","application/olescript"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azw","application/vnd.amazon.ebook"],["bas","text/plain"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin",["application/octet-stream","application/mac-binary","application/macbinary","application/x-macbinary","application/x-binary"]],["bm","image/bmp"],["bmi","application/vnd.bmi"],["bmp",["image/bmp","image/x-windows-bmp"]],["boo","application/book"],["book","application/book"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bsh","application/x-bsh"],["btif","image/prs.btif"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c",["text/plain","text/x-c"]],["c++","text/plain"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["c4g","application/vnd.clonk.c4group"],["cab","application/vnd.ms-cab-compressed"],["car","application/vnd.curl.car"],["cat",["application/vnd.ms-pkiseccat","application/vnd.ms-pki.seccat"]],["cc",["text/plain","text/x-c"]],["ccad","application/clariscad"],["cco","application/x-cocoa"],["ccxml","application/ccxml+xml,"],["cdbcmsg","application/vnd.contact.cmsg"],["cdf",["application/cdf","application/x-cdf","application/x-netcdf"]],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer",["application/pkix-cert","application/x-x509-ca-cert"]],["cgm","image/cgm"],["cha","application/x-chat"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cla","application/vnd.claymore"],["class",["application/octet-stream","application/java","application/java-byte-code","application/java-vm","application/x-java-class"]],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod",["image/cis-cod","application/vnd.rim.cod"]],["com",["application/octet-stream","text/plain"]],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt",["application/mac-compactpro","application/x-compactpro","application/x-cpt"]],["crd","application/x-mscardfile"],["crl",["application/pkix-crl","application/pkcs-crl"]],["crt",["application/pkix-cert","application/x-x509-user-cert","application/x-x509-ca-cert"]],["cryptonote","application/vnd.rig.cryptonote"],["csh",["text/x-script.csh","application/x-csh"]],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["css",["text/css","application/x-pointplus"]],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxx","text/plain"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["davmount","application/davmount+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["deb","application/x-debian-package"],["deepv","application/x-deepv"],["def","text/plain"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dif","video/x-dv"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["djvu","image/vnd.djvu"],["dl",["video/dl","video/x-dl"]],["dll","application/x-msdownload"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.document.macroenabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroenabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp",["application/commonground","application/vnd.osgi.dp"]],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drw","application/drafting"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dv","video/x-dv"],["dvi","application/x-dvi"],["dwf",["model/vnd.dwf","drawing/x-dwf"]],["dwg",["application/acad","image/vnd.dwg","image/x-dwg"]],["dxf",["application/dxf","image/vnd.dwg","image/vnd.dxf","image/x-dwg"]],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["el","text/x-script.elisp"],["elc",["application/x-elc","application/x-bytecode.elisp"]],["eml","message/rfc822"],["emma","application/emma+xml"],["env","application/x-envoy"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es",["application/ecmascript","application/x-esrehber"]],["es3","application/vnd.eszigno3+xml"],["esf","application/vnd.epson.esf"],["etx","text/x-setext"],["evy",["application/envoy","application/x-envoy"]],["exe",["application/octet-stream","application/x-msdownload"]],["exi","application/exi"],["ext","application/vnd.novadigm.ext"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f",["text/plain","text/x-fortran"]],["f4v","video/x-f4v"],["f77","text/x-fortran"],["f90",["text/plain","text/x-fortran"]],["fbs","image/vnd.fastbidsheet"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fh","image/x-freehand"],["fif",["application/fractals","image/fif"]],["fig","application/x-xfig"],["fli",["video/fli","video/x-fli"]],["flo",["image/florian","application/vnd.micrografx.flo"]],["flr","x-world/x-vrml"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fmf","video/x-atomic3d-feature"],["fnc","application/vnd.frogans.fnc"],["for",["text/plain","text/x-fortran"]],["fpx",["image/vnd.fpx","image/vnd.net-fpx"]],["frl","application/freeloader"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["funk","audio/make"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g","text/plain"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gdl","model/vnd.gdl"],["geo","application/vnd.dynageo"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["gl",["video/gl","video/x-gl"]],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gph","application/vnd.flographit"],["gqf","application/vnd.grafeq"],["gram","application/srgs"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsd","audio/x-gsm"],["gsf","application/x-font-ghostscript"],["gsm","audio/x-gsm"],["gsp","application/x-gsp"],["gss","application/x-gss"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxt","application/vnd.geonext"],["gz",["application/x-gzip","application/x-compressed"]],["gzip",["multipart/x-gzip","application/x-gzip"]],["h",["text/plain","text/x-h"]],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hdf","application/x-hdf"],["help","application/x-helpfile"],["hgl","application/vnd.hp-hpgl"],["hh",["text/plain","text/x-h"]],["hlb","text/x-script"],["hlp",["application/winhlp","application/hlp","application/x-helpfile","application/x-winhelp"]],["hpg","application/vnd.hp-hpgl"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx",["application/mac-binhex40","application/binhex","application/binhex4","application/mac-binhex","application/x-binhex40","application/x-mac-binhex40"]],["hta","application/hta"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["htmls","text/html"],["htt","text/webviewhtml"],["htx","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["ico","image/x-icon"],["ics","text/calendar"],["idc","text/plain"],["ief","image/ief"],["iefs","image/ief"],["ifm","application/vnd.shana.informed.formdata"],["iges",["application/iges","model/iges"]],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs",["application/iges","model/iges"]],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["iii","application/x-iphone"],["ima","application/x-ima"],["imap","application/x-httpd-imap"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["inf","application/inf"],["ins",["application/x-internet-signup","application/x-internett-signup"]],["ip","application/x-ip2"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["isp","application/x-internet-signup"],["isu","video/x-isvideo"],["it","audio/it"],["itp","application/vnd.shana.informed.formtemplate"],["iv","application/x-inventor"],["ivp","application/vnd.immervision-ivp"],["ivr","i-world/i-vrml"],["ivu","application/vnd.immervision-ivu"],["ivy","application/x-livescreen"],["jad","text/vnd.sun.j2me.app-descriptor"],["jam",["application/vnd.jam","audio/x-jam"]],["jar","application/java-archive"],["jav",["text/plain","text/x-java-source"]],["java",["text/plain","text/x-java-source,java","text/x-java-source"]],["jcm","application/x-java-commerce"],["jfif",["image/pipeg","image/jpeg","image/pjpeg"]],["jfif-tbnl","image/jpeg"],["jisp","application/vnd.jisp"],["jlt","application/vnd.hp-jlyt"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jpe",["image/jpeg","image/pjpeg"]],["jpeg",["image/jpeg","image/pjpeg"]],["jpg",["image/jpeg","image/pjpeg"]],["jpgv","video/jpeg"],["jpm","video/jpm"],["jps","image/x-jps"],["js",["application/javascript","application/ecmascript","text/javascript","text/ecmascript","application/x-javascript"]],["json","application/json"],["jut","image/jutvision"],["kar",["audio/midi","music/x-karaoke"]],["karbon","application/vnd.kde.karbon"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["ksh",["application/x-ksh","text/x-script.ksh"]],["ksp","application/vnd.kde.kspread"],["ktx","image/ktx"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["la",["audio/nspaudio","audio/x-nspaudio"]],["lam","audio/x-liveaudio"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["lha",["application/octet-stream","application/lha","application/x-lha"]],["lhx","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["lma",["audio/nspaudio","audio/x-nspaudio"]],["log","text/plain"],["lrm","application/vnd.ms-lrm"],["lsf","video/x-la-asf"],["lsp",["application/x-lisp","text/x-script.lisp"]],["lst","text/plain"],["lsx",["video/x-la-asf","text/x-la-asf"]],["ltf","application/vnd.frogans.ltf"],["ltx","application/x-latex"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh",["application/octet-stream","application/x-lzh"]],["lzx",["application/lzx","application/octet-stream","application/x-lzx"]],["m",["text/plain","text/x-m"]],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m1v","video/mpeg"],["m21","application/mp21"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3u",["audio/x-mpegurl","audio/x-mpequrl"]],["m3u8","application/vnd.apple.mpegurl"],["m4v","video/x-m4v"],["ma","application/mathematica"],["mads","application/mads+xml"],["mag","application/vnd.ecowin.chart"],["man","application/x-troff-man"],["map","application/x-navimap"],["mar","text/plain"],["mathml","application/mathml+xml"],["mbd","application/mbedlet"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc$","application/x-magic-cap-package-1.0"],["mc1","application/vnd.medcalcdata"],["mcd",["application/mcad","application/vnd.mcd","application/x-mathcad"]],["mcf",["image/vasa","text/mcf"]],["mcp","application/netmc"],["mcurl","text/vnd.curl.mcurl"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["me","application/x-troff-me"],["meta4","application/metalink4+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mht","message/rfc822"],["mhtml","message/rfc822"],["mid",["audio/mid","audio/midi","music/crescendo","x-music/x-midi","audio/x-midi","application/x-midi","audio/x-mid"]],["midi",["audio/midi","music/crescendo","x-music/x-midi","audio/x-midi","application/x-midi","audio/x-mid"]],["mif",["application/vnd.mif","application/x-mif","application/x-frame"]],["mime",["message/rfc822","www/mime"]],["mj2","video/mj2"],["mjf","audio/x-vnd.audioexplosion.mjuicemediafile"],["mjpg","video/x-motion-jpeg"],["mlp","application/vnd.dolby.mlp"],["mm",["application/base64","application/x-meme"]],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mme","application/base64"],["mmf","application/vnd.smaf"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mny","application/x-msmoney"],["mod",["audio/mod","audio/x-mod"]],["mods","application/mods+xml"],["moov","video/quicktime"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2",["video/mpeg","audio/mpeg","video/x-mpeg","audio/x-mpeg","video/x-mpeq2a"]],["mp3",["audio/mpeg","audio/mpeg3","video/mpeg","audio/x-mpeg-3","video/x-mpeg"]],["mp4",["video/mp4","application/mp4"]],["mp4a","audio/mp4"],["mpa",["video/mpeg","audio/mpeg"]],["mpc",["application/vnd.mophun.certificate","application/x-project"]],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg",["video/mpeg","audio/mpeg"]],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/x-project"],["mpv","application/x-project"],["mpv2","video/mpeg"],["mpx","application/x-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","application/x-troff-ms"],["mscml","application/mediaservercontrol+xml"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msl","application/vnd.mobius.msl"],["msty","application/vnd.muvee.style"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musicxml","application/vnd.recordare.musicxml+xml"],["mv","video/x-sgi-movie"],["mvb","application/x-msmediaview"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["my","audio/make"],["mzz","application/x-vnd.audioexplosion.mzz"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nap","image/naplps"],["naplps","image/naplps"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncm","application/vnd.nokia.configuration-message"],["ncx","application/x-dtbncx+xml"],["ngdat","application/vnd.nokia.n-gage.data"],["nif","image/x-niff"],["niff","image/x-niff"],["nix","application/x-mix-transfer"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nvd","application/x-navidoc"],["nws","message/rfc822"],["o","application/octet-stream"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omc","application/x-omc"],["omcd","application/x-omcdatamaker"],["omcr","application/x-omcregerator"],["onetoc","application/onenote"],["opf","application/oebps-package+xml"],["org","application/vnd.lotus-organizer"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","application/x-font-otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p10",["application/pkcs10","application/x-pkcs10"]],["p12",["application/pkcs-12","application/x-pkcs12"]],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c",["application/pkcs7-mime","application/x-pkcs7-mime"]],["p7m",["application/pkcs7-mime","application/x-pkcs7-mime"]],["p7r","application/x-pkcs7-certreqresp"],["p7s",["application/pkcs7-signature","application/x-pkcs7-signature"]],["p8","application/pkcs8"],["par","text/plain-bas"],["part","application/pro_eng"],["pas","text/pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcf","application/x-font-pcf"],["pcl",["application/vnd.hp-pcl","application/x-pcl"]],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb",["application/vnd.palm","chemical/x-pdb"]],["pdf","application/pdf"],["pfa","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfunk",["audio/make","audio/make.my.funk"]],["pfx","application/x-pkcs12"],["pgm",["image/x-portable-graymap","image/x-portable-greymap"]],["pgn","application/x-chess-pgn"],["pgp","application/pgp-signature"],["pic",["image/pict","image/x-pict"]],["pict","image/pict"],["pkg","application/x-newton-compatible-pkg"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pko",["application/ynd.ms-pkipko","application/vnd.ms-pki.pko"]],["pl",["text/plain","text/x-script.perl"]],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["plx","application/x-pixclscript"],["pm",["text/x-script.perl-module","image/x-xpixmap"]],["pm4","application/x-pagemaker"],["pm5","application/x-pagemaker"],["pma","application/x-perfmon"],["pmc","application/x-perfmon"],["pml",["application/vnd.ctc-posml","application/x-perfmon"]],["pmr","application/x-perfmon"],["pmw","application/x-perfmon"],["png","image/png"],["pnm",["application/x-portable-anymap","image/x-portable-anymap"]],["portpkg","application/vnd.macports.portpkg"],["pot",["application/vnd.ms-powerpoint","application/mspowerpoint"]],["potm","application/vnd.ms-powerpoint.template.macroenabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["pov","model/x-pov"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroenabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps",["application/vnd.ms-powerpoint","application/mspowerpoint"]],["ppsm","application/vnd.ms-powerpoint.slideshow.macroenabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt",["application/vnd.ms-powerpoint","application/mspowerpoint","application/powerpoint","application/x-mspowerpoint"]],["pptm","application/vnd.ms-powerpoint.presentation.macroenabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["ppz","application/mspowerpoint"],["prc","application/x-mobipocket-ebook"],["pre",["application/vnd.lotus-freelance","application/x-freelance"]],["prf","application/pics-rules"],["prt","application/pro_eng"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd",["application/octet-stream","image/vnd.adobe.photoshop"]],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pvu","paleovu/x-pv"],["pwn","application/vnd.3m.post-it-notes"],["pwz","application/vnd.ms-powerpoint"],["py","text/x-script.phyton"],["pya","audio/vnd.ms-playready.media.pya"],["pyc","application/x-bytecode.python"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qcp","audio/vnd.qcelp"],["qd3","x-world/x-3dmf"],["qd3d","x-world/x-3dmf"],["qfx","application/vnd.intu.qfx"],["qif","image/x-quicktime"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qtc","video/x-qtc"],["qti","image/x-quicktime"],["qtif","image/x-quicktime"],["qxd","application/vnd.quark.quarkxpress"],["ra",["audio/x-realaudio","audio/x-pn-realaudio","audio/x-pn-realaudio-plugin"]],["ram","audio/x-pn-realaudio"],["rar","application/x-rar-compressed"],["ras",["image/cmu-raster","application/x-cmu-raster","image/x-cmu-raster"]],["rast","image/cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rexx","text/x-script.rexx"],["rf","image/vnd.rn-realflash"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm",["application/vnd.rn-realmedia","audio/x-pn-realaudio"]],["rmi","audio/mid"],["rmm","audio/x-pn-realaudio"],["rmp",["audio/x-pn-realaudio-plugin","audio/x-pn-realaudio"]],["rms","application/vnd.jcp.javame.midlet-rms"],["rnc","application/relax-ng-compact-syntax"],["rng",["application/ringing-tones","application/vnd.nokia.ringing-tone"]],["rnx","application/vnd.rn-realplayer"],["roff","application/x-troff"],["rp","image/vnd.rn-realpix"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsd","application/rsd+xml"],["rt",["text/richtext","text/vnd.rn-realtext"]],["rtf",["application/rtf","text/richtext","application/x-rtf"]],["rtx",["text/richtext","application/rtf"]],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["saveme","application/octet-stream"],["sbk","application/x-tbook"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm",["application/vnd.lotus-screencam","video/x-scm","text/x-script.guile","application/x-lotusscreencam","text/x-script.scheme"]],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["sct","text/scriptlet"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkm","application/vnd.solent.sdkm+xml"],["sdml","text/plain"],["sdp",["application/sdp","application/x-sdp"]],["sdr","application/sounder"],["sdw","application/vnd.stardivision.writer"],["sea",["application/sea","application/x-sea"]],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["ser","application/java-serialized-object"],["set","application/set"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sgl","application/vnd.stardivision.writer-global"],["sgm",["text/sgml","text/x-sgml"]],["sgml",["text/sgml","text/x-sgml"]],["sh",["application/x-shar","application/x-bsh","application/x-sh","text/x-script.sh"]],["shar",["application/x-bsh","application/x-shar"]],["shf","application/shf+xml"],["shtml",["text/html","text/x-server-parsed-html"]],["sid","audio/x-psid"],["sis","application/vnd.symbian.install"],["sit",["application/x-stuffit","application/x-sit"]],["sitx","application/x-stuffitx"],["skd","application/x-koan"],["skm","application/x-koan"],["skp",["application/vnd.koan","application/x-koan"]],["skt","application/x-koan"],["sl","application/x-seelogo"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi",["application/smil","application/smil+xml"]],["smil","application/smil"],["snd",["audio/basic","audio/x-adpcm"]],["snf","application/x-font-snf"],["sol","application/solids"],["spc",["text/x-speech","application/x-pkcs7-certificates"]],["spf","application/vnd.yamaha.smaf-phrase"],["spl",["application/futuresplash","application/x-futuresplash"]],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spr","application/x-sprite"],["sprite","application/x-sprite"],["src","application/x-wais-source"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssi","text/x-server-parsed-html"],["ssm","application/streamingmedia"],["ssml","application/ssml+xml"],["sst",["application/vnd.ms-pkicertstore","application/vnd.ms-pki.certstore"]],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["step","application/step"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl",["application/vnd.ms-pkistl","application/sla","application/vnd.ms-pki.stl","application/x-navistyle"]],["stm","text/html"],["stp","application/step"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["sub","image/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svf",["image/vnd.dwg","image/x-dwg"]],["svg","image/svg+xml"],["svr",["x-world/x-svr","application/x-world"]],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t",["text/troff","application/x-troff"]],["talk","text/x-speech"],["tao","application/vnd.tao.intent-module-archive"],["tar","application/x-tar"],["tbk",["application/toolbook","application/x-tbook"]],["tcap","application/vnd.3gpp2.tcap"],["tcl",["text/x-script.tcl","application/x-tcl"]],["tcsh","text/x-script.tcsh"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text",["application/plain","text/plain"]],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tgz",["application/gnutar","application/x-compressed"]],["thmx","application/vnd.ms-officetheme"],["tif",["image/tiff","image/x-tiff"]],["tiff",["image/tiff","image/x-tiff"]],["tmo","application/vnd.tmobile-livetv"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","application/x-troff"],["tra","application/vnd.trueapp"],["trm","application/x-msterminal"],["tsd","application/timestamped-data"],["tsi","audio/tsp-audio"],["tsp",["application/dsptype","audio/tsplayer"]],["tsv","text/tab-separated-values"],["ttf","application/x-font-ttf"],["ttl","text/turtle"],["turbot","image/florian"],["twd","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["ufd","application/vnd.ufdl"],["uil","text/x-uil"],["uls","text/iuls"],["umj","application/vnd.umajin"],["uni","text/uri-list"],["unis","text/uri-list"],["unityweb","application/vnd.unity"],["unv","application/i-deas"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["ustar",["application/x-ustar","multipart/x-ustar"]],["utz","application/vnd.uiq.theme"],["uu",["application/octet-stream","text/x-uuencode"]],["uue","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vda","application/vda"],["vdo","video/vdo"],["vew","application/groupwise"],["vis","application/vnd.visionary"],["viv",["video/vivo","video/vnd.vivo"]],["vivo",["video/vivo","video/vnd.vivo"]],["vmd","application/vocaltec-media-desc"],["vmf","application/vocaltec-media-file"],["voc",["audio/voc","audio/x-voc"]],["vos","video/vosaic"],["vox","audio/voxware"],["vqe","audio/x-twinvq-plugin"],["vqf","audio/x-twinvq"],["vql","audio/x-twinvq-plugin"],["vrml",["model/vrml","x-world/x-vrml","application/x-vrml"]],["vrt","x-world/x-vrt"],["vsd",["application/vnd.visio","application/x-visio"]],["vsf","application/vnd.vsf"],["vst","application/x-visio"],["vsw","application/x-visio"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w60","application/wordperfect6.0"],["w61","application/wordperfect6.1"],["w6w","application/msword"],["wad","application/x-doom"],["wav",["audio/wav","audio/x-wav"]],["wax","audio/x-ms-wax"],["wb1","application/x-qpro"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/vnd.wap.wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["web","application/vnd.xara"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wiz","application/msword"],["wk1","application/x-123"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf",["windows/metafile","application/x-msmetafile"]],["wml","text/vnd.wap.wml"],["wmlc","application/vnd.wap.wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-ms-wmz"],["woff","application/x-font-woff"],["word","application/msword"],["wp","application/wordperfect"],["wp5",["application/wordperfect","application/wordperfect6.0"]],["wp6","application/wordperfect"],["wpd",["application/wordperfect","application/vnd.wordperfect","application/x-wpwin"]],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wq1","application/x-lotus"],["wqd","application/vnd.wqd"],["wri",["application/mswrite","application/x-wri","application/x-mswrite"]],["wrl",["model/vrml","x-world/x-vrml","application/x-world"]],["wrz",["model/vrml","x-world/x-vrml"]],["wsc","text/scriplet"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wsrc","application/x-wais-source"],["wtb","application/vnd.webturbo"],["wtk","application/x-wintalk"],["wvx","video/x-ms-wvx"],["x-png","image/png"],["x3d","application/vnd.hzn-3d-crossword"],["xaf","x-world/x-vrml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm",["image/xbm","image/x-xbm","image/x-xbitmap"]],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdr","video/x-amt-demorun"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xgz","xgl/drawing"],["xhtml","application/xhtml+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla",["application/vnd.ms-excel","application/excel","application/x-msexcel","application/x-excel"]],["xlam","application/vnd.ms-excel.addin.macroenabled.12"],["xlb",["application/excel","application/vnd.ms-excel","application/x-excel"]],["xlc",["application/vnd.ms-excel","application/excel","application/x-excel"]],["xld",["application/excel","application/x-excel"]],["xlk",["application/excel","application/x-excel"]],["xll",["application/excel","application/vnd.ms-excel","application/x-excel"]],["xlm",["application/vnd.ms-excel","application/excel","application/x-excel"]],["xls",["application/vnd.ms-excel","application/excel","application/x-msexcel","application/x-excel"]],["xlsb","application/vnd.ms-excel.sheet.binary.macroenabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroenabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt",["application/vnd.ms-excel","application/excel","application/x-excel"]],["xltm","application/vnd.ms-excel.template.macroenabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlv",["application/excel","application/x-excel"]],["xlw",["application/vnd.ms-excel","application/excel","application/x-msexcel","application/x-excel"]],["xm","audio/xm"],["xml",["application/xml","text/xml","application/atom+xml","application/rss+xml"]],["xmz","xgl/movie"],["xo","application/vnd.olpc-sugar"],["xof","x-world/x-vrml"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpix","application/x-vnd.ls-xpix"],["xpm",["image/xpm","image/x-xpixmap"]],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xsr","video/x-amt-showrun"],["xul","application/vnd.mozilla.xul+xml"],["xwd",["image/x-xwd","image/x-xwindowdump"]],["xyz",["chemical/x-xyz","chemical/x-pdb"]],["yang","application/yang"],["yin","application/yin+xml"],["z",["application/x-compressed","application/x-compress"]],["zaz","application/vnd.zzazz.deck+xml"],["zip",["application/zip","multipart/x-zip","application/x-zip-compressed","application/x-compressed"]],["zir","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zoo","application/octet-stream"],["zsh","text/x-script.zsh"]]);qr.exports={detectMimeType(n){if(!n)return jr;let t=lp.parse(n),e=(t.ext.substr(1)||t.name||"").split("?").shift().trim().toLowerCase(),i=jr;return Ur.has(e)&&(i=Ur.get(e)),Array.isArray(i)?i[0]:i},detectExtension(n){if(!n)return cp;let t=(n||"").toLowerCase().trim().split("/"),e=t.shift().trim(),i=t.join("/").trim();if(Rr.has(e+"/"+i)){let s=Rr.get(e+"/"+i);return Array.isArray(s)?s[0]:s}switch(e){case"text":return"txt";default:return"bin"}}}});var Yi=T((ku,zr)=>{"use strict";var pp=require("stream").Transform;function Xi(n){return typeof n=="string"&&(n=Buffer.from(n,"utf-8")),n.toString("base64")}function Ji(n,t){if(n=(n||"").toString(),t=t||76,n.length<=t)return n;let e=[],i=0,s=t*1024;for(;i<n.length;){let a=n.substr(i,s).replace(new RegExp(".{"+t+"}","g"),`$&\r
|
|
16
|
-
`).
|
|
17
|
-
`).
|
|
18
|
-
|
|
19
|
-
`){l+=r,e+=r.length;continue}else if(s=r.substr(-o).match(/\n.*?$/)){r=r.substr(0,r.length-(s[0].length-1)),l+=r,e+=r.length;continue}else if(r.length>t-o&&(s=r.substr(-o).match(/[ \t.,!?][^ \t.,!?]*$/)))r=r.substr(0,r.length-(s[0].length-1));else if(r.match(/[=][\da-f]{0,2}$/i))for((s=r.match(/[=][\da-f]{0,1}$/i))&&(r=r.substr(0,r.length-s[0].length));r.length>3&&r.length<i-e&&!r.match(/^(?:=[\da-f]{2}){1,4}$/i)&&(s=r.match(/[=][\da-f]{2}$/gi))&&(a=parseInt(s[0].substr(1,2),16),!(a<128||(r=r.substr(0,r.length-3),a>=192))););e+r.length<i&&r.substr(-1)!==`
|
|
20
|
-
`?(r.length===t&&r.match(/[=][\da-f]{2}$/i)?r=r.substr(0,r.length-3):r.length===t&&(r=r.substr(0,r.length-1)),e+=r.length,r+=`=\r
|
|
21
|
-
`):e+=r.length,l+=r}return l}function up(n,t){for(let e=t.length-1;e>=0;e--)if(t[e].length&&(t[e].length===1&&n===t[e][0]||t[e].length===2&&n>=t[e][0]&&n<=t[e][1]))return!0;return!1}var es=class extends hp{constructor(t){super(),this.options=t||{},this.options.lineLength!==!1&&(this.options.lineLength=this.options.lineLength||76),this._curLine="",this.inputBytes=0,this.outputBytes=0}_transform(t,e,i){let s;if(e!=="buffer"&&(t=Buffer.from(t,e)),!t||!t.length)return i();this.inputBytes+=t.length,this.options.lineLength?(s=this._curLine+Zi(t),s=Hr(s,this.options.lineLength),s=s.replace(/(^|\n)([^\n]*)$/,(a,r,o)=>(this._curLine=o,r)),s&&(this.outputBytes+=s.length,this.push(s))):(s=Zi(t),this.outputBytes+=s.length,this.push(s,"ascii")),i()}_flush(t){this._curLine&&(this.outputBytes+=this._curLine.length,this.push(this._curLine,"ascii")),t()}};$r.exports={encode:Zi,wrap:Hr,Encoder:es}});var it=T((Nu,Vr)=>{"use strict";var tt=Yi(),dp=ts(),Kr=Gi();Vr.exports={isPlainText(n,t){return!(typeof n!="string"||(t?/[\x00-\x08\x0b\x0c\x0e-\x1f"\u0080-\uFFFF]/:/[\x00-\x08\x0b\x0c\x0e-\x1f\u0080-\uFFFF]/).test(n))},hasLongerLines(n,t){return n.length>128*1024?!0:new RegExp("^.{"+(t+1)+",}","m").test(n)},encodeWord(n,t,e){t=(t||"Q").toString().toUpperCase().trim().charAt(0),e=e||0;let i,s="UTF-8";if(e&&e>7+s.length&&(e-=7+s.length),t==="Q"?i=dp.encode(n).replace(/[^a-z0-9!*+\-/=]/gi,a=>{let r=a.charCodeAt(0).toString(16).toUpperCase();return a===" "?"_":"="+(r.length===1?"0"+r:r)}):t==="B"&&(i=typeof n=="string"?n:tt.encode(n),e=e?Math.max(3,(e-e%4)/4*3):0),e&&(t!=="B"?i:tt.encode(n)).length>e)if(t==="Q")i=this.splitMimeEncodedString(i,e).join("?= =?"+s+"?"+t+"?");else{let a=[],r="";for(let o=0,l=i.length;o<l;o++){let c=i.charAt(o);/[\ud83c\ud83d\ud83e]/.test(c)&&o<l-1&&(c+=i.charAt(++o)),Buffer.byteLength(r+c)<=e||o===0?r+=c:(a.push(tt.encode(r)),r=c)}r&&a.push(tt.encode(r)),a.length>1?i=a.join("?= =?"+s+"?"+t+"?"):i=a.join("")}else t==="B"&&(i=tt.encode(n));return"=?"+s+"?"+t+"?"+i+(i.substr(-2)==="?="?"":"?=")},encodeWords(n,t,e,i){e=e||0;let s,a=n.match(/(?:^|\s)([^\s]*["\u0080-\uFFFF])/);if(!a)return n;if(i)return this.encodeWord(n,t,e);let r=n.match(/(["\u0080-\uFFFF][^\s]*)[^"\u0080-\uFFFF]*$/);if(!r)return n;let o=a.index+(a[0].match(/[^\s]/)||{index:0}).index,l=r.index+(r[1]||"").length;return s=(o?n.substr(0,o):"")+this.encodeWord(n.substring(o,l),t||"Q",e)+(l<n.length?n.substr(l):""),s},buildHeaderValue(n){let t=[];return Object.keys(n.params||{}).forEach(e=>{let i=n.params[e];!this.isPlainText(i,!0)||i.length>=75?this.buildHeaderParam(e,i,50).forEach(s=>{!/[\s"\\;:/=(),<>@[\]?]|^[-']|'$/.test(s.value)||s.key.substr(-1)==="*"?t.push(s.key+"="+s.value):t.push(s.key+"="+JSON.stringify(s.value))}):/[\s'"\\;:/=(),<>@[\]?]|^-/.test(i)?t.push(e+"="+JSON.stringify(i)):t.push(e+"="+i)}),n.value+(t.length?"; "+t.join("; "):"")},buildHeaderParam(n,t,e){let i=[],s=typeof t=="string"?t:(t||"").toString(),a,r,o,l,c=0,p,h;if(e=e||50,this.isPlainText(t,!0)){if(s.length<=e)return[{key:n,value:s}];s=s.replace(new RegExp(".{"+e+"}","g"),u=>(i.push({line:u}),"")),s&&i.push({line:s})}else{if(/[\uD800-\uDBFF]/.test(s)){for(a=[],p=0,h=s.length;p<h;p++)r=s.charAt(p),o=r.charCodeAt(0),o>=55296&&o<=56319&&p<h-1?(r+=s.charAt(p+1),a.push(r),p++):a.push(r);s=a}l="utf-8''";let u=!0;for(c=0,p=0,h=s.length;p<h;p++){if(r=s[p],u)r=this.safeEncodeURIComponent(r);else if(r=r===" "?r:this.safeEncodeURIComponent(r),r!==s[p])if((this.safeEncodeURIComponent(l)+r).length>=e)i.push({line:l,encoded:u}),l="",c=p-1;else{u=!0,p=c,l="";continue}(l+r).length>=e?(i.push({line:l,encoded:u}),l=r=s[p]===" "?" ":this.safeEncodeURIComponent(s[p]),r===s[p]?(u=!1,c=p-1):u=!0):l+=r}l&&i.push({line:l,encoded:u})}return i.map((u,f)=>({key:n+"*"+f+(u.encoded?"*":""),value:u.line}))},parseHeaderValue(n){let t={value:!1,params:{}},e=!1,i="",s="value",a=!1,r=!1,o;for(let l=0,c=n.length;l<c;l++)if(o=n.charAt(l),s==="key"){if(o==="="){e=i.trim().toLowerCase(),s="value",i="";continue}i+=o}else{if(r)i+=o;else if(o==="\\"){r=!0;continue}else a&&o===a?a=!1:!a&&o==='"'?a=o:!a&&o===";"?(e===!1?t.value=i.trim():t.params[e]=i.trim(),s="key",i=""):i+=o;r=!1}return s==="value"?e===!1?t.value=i.trim():t.params[e]=i.trim():i.trim()&&(t.params[i.trim().toLowerCase()]=""),Object.keys(t.params).forEach(l=>{let c,p,h,u;(h=l.match(/(\*(\d+)|\*(\d+)\*|\*)$/))&&(c=l.substr(0,h.index),p=Number(h[2]||h[3])||0,(!t.params[c]||typeof t.params[c]!="object")&&(t.params[c]={charset:!1,values:[]}),u=t.params[l],p===0&&h[0].substr(-1)==="*"&&(h=u.match(/^([^']*)'[^']*'(.*)$/))&&(t.params[c].charset=h[1]||"iso-8859-1",u=h[2]),t.params[c].values[p]=u,delete t.params[l])}),Object.keys(t.params).forEach(l=>{let c;t.params[l]&&Array.isArray(t.params[l].values)&&(c=t.params[l].values.map(p=>p||"").join(""),t.params[l].charset?t.params[l]="=?"+t.params[l].charset+"?Q?"+c.replace(/[=?_\s]/g,p=>{let h=p.charCodeAt(0).toString(16);return p===" "?"_":"%"+(h.length<2?"0":"")+h}).replace(/%/g,"=")+"?=":t.params[l]=c)}),t},detectExtension:n=>Kr.detectExtension(n),detectMimeType:n=>Kr.detectMimeType(n),foldLines(n,t,e){n=(n||"").toString(),t=t||76;let i=0,s=n.length,a="",r,o;for(;i<s;){if(r=n.substr(i,t),r.length<t){a+=r;break}if(o=r.match(/^[^\n\r]*(\r?\n|\r)/)){r=o[0],a+=r,i+=r.length;continue}else(o=r.match(/(\s+)[^\s]*$/))&&o[0].length-(e?(o[1]||"").length:0)<r.length?r=r.substr(0,r.length-(o[0].length-(e?(o[1]||"").length:0))):(o=n.substr(i+r.length).match(/^[^\s]+(\s*)/))&&(r=r+o[0].substr(0,o[0].length-(e?0:(o[1]||"").length)));a+=r,i+=r.length,i<s&&(a+=`\r
|
|
22
|
-
`)}return a},splitMimeEncodedString:(n,t)=>{let e,i,s,a,r=[];for(t=Math.max(t||0,12);n.length;){for(e=n.substr(0,t),(i=e.match(/[=][0-9A-F]?$/i))&&(e=e.substr(0,i.index)),a=!1;!a;)a=!0,(i=n.substr(e.length).match(/^[=]([0-9A-F]{2})/i))&&(s=parseInt(i[1],16),s<194&&s>127&&(e=e.substr(0,e.length-3),a=!1));e.length&&r.push(e),n=n.substr(e.length)}return r},encodeURICharComponent:n=>{let t="",e=n.charCodeAt(0).toString(16).toUpperCase();if(e.length%2&&(e="0"+e),e.length>2)for(let i=0,s=e.length/2;i<s;i++)t+="%"+e.substr(i,2);else t+="%"+e;return t},safeEncodeURIComponent(n){n=(n||"").toString();try{n=encodeURIComponent(n)}catch{return n.replace(/[^\x00-\x1F *'()<>@,;:\\"[\]?=\u007F-\uFFFF]+/g,"")}return n.replace(/[\x00-\x1F *'()<>@,;:\\"[\]?=\u007F-\uFFFF]/g,t=>this.encodeURICharComponent(t))}}});var Xr=T((_u,Gr)=>{"use strict";function fp(n){let t,e=!1,i="text",s,a=[],r={address:[],comment:[],group:[],text:[]},o,l;for(o=0,l=n.length;o<l;o++)if(t=n[o],t.type==="operator")switch(t.value){case"<":i="address";break;case"(":i="comment";break;case":":i="group",e=!0;break;default:i="text"}else t.value&&(i==="address"&&(t.value=t.value.replace(/^[^<]*<\s*/,"")),r[i].push(t.value));if(!r.text.length&&r.comment.length&&(r.text=r.comment,r.comment=[]),e)r.text=r.text.join(" "),a.push({name:r.text||s&&s.name,group:r.group.length?Wr(r.group.join(",")):[]});else{if(!r.address.length&&r.text.length){for(o=r.text.length-1;o>=0;o--)if(r.text[o].match(/^[^@\s]+@[^@\s]+$/)){r.address=r.text.splice(o,1);break}let c=function(p){return r.address.length?p:(r.address=[p.trim()]," ")};if(!r.address.length)for(o=r.text.length-1;o>=0&&(r.text[o]=r.text[o].replace(/\s*\b[^@\s]+@[^\s]+\b\s*/,c).trim(),!r.address.length);o--);}if(!r.text.length&&r.comment.length&&(r.text=r.comment,r.comment=[]),r.address.length>1&&(r.text=r.text.concat(r.address.splice(1))),r.text=r.text.join(" "),r.address=r.address.join(" "),!r.address&&e)return[];s={address:r.address||r.text||"",name:r.text||r.address||""},s.address===s.name&&((s.address||"").match(/@/)?s.name="":s.address=""),a.push(s)}return a}var is=class{constructor(t){this.str=(t||"").toString(),this.operatorCurrent="",this.operatorExpecting="",this.node=null,this.escaped=!1,this.list=[],this.operators={'"':'"',"(":")","<":">",",":"",":":";",";":""}}tokenize(){let t,e=[];for(let i=0,s=this.str.length;i<s;i++)t=this.str.charAt(i),this.checkChar(t);return this.list.forEach(i=>{i.value=(i.value||"").toString().trim(),i.value&&e.push(i)}),e}checkChar(t){if(!this.escaped){if(t===this.operatorExpecting){this.node={type:"operator",value:t},this.list.push(this.node),this.node=null,this.operatorExpecting="",this.escaped=!1;return}else if(!this.operatorExpecting&&t in this.operators){this.node={type:"operator",value:t},this.list.push(this.node),this.node=null,this.operatorExpecting=this.operators[t],this.escaped=!1;return}else if(['"',"'"].includes(this.operatorExpecting)&&t==="\\"){this.escaped=!0;return}}this.node||(this.node={type:"text",value:""},this.list.push(this.node)),t===`
|
|
23
|
-
`&&(t=" "),(t.charCodeAt(0)>=33||[" "," "].includes(t))&&(this.node.value+=t),this.escaped=!1}};function Wr(n,t){t=t||{};let i=new is(n).tokenize(),s=[],a=[],r=[];if(i.forEach(o=>{o.type==="operator"&&(o.value===","||o.value===";")?(a.length&&s.push(a),a=[]):a.push(o)}),a.length&&s.push(a),s.forEach(o=>{o=fp(o),o.length&&(r=r.concat(o))}),t.flatten){let o=[],l=c=>{c.forEach(p=>{if(p.group)return l(p.group);o.push(p)})};return l(r),o}return r}Gr.exports=Wr});var Qr=T((Lu,Jr)=>{"use strict";var mp=require("stream").Transform,ss=class extends mp{constructor(){super(),this.lastByte=!1}_transform(t,e,i){t.length&&(this.lastByte=t[t.length-1]),this.push(t),i()}_flush(t){return this.lastByte===10?t():this.lastByte===13?(this.push(Buffer.from(`
|
|
24
|
-
`)),t()):(this.push(Buffer.from(`\r
|
|
25
|
-
`)),t())}};Jr.exports=ss});var rs=T((Mu,Yr)=>{"use strict";var xp=require("stream"),gp=xp.Transform,as=class extends gp{constructor(t){super(t),this.options=t||{},this.lastByte=!1}_transform(t,e,i){let s,a=0;for(let r=0,o=t.length;r<o;r++)t[r]===10&&(r&&t[r-1]!==13||!r&&this.lastByte!==13)&&(r>a&&(s=t.slice(a,r),this.push(s)),this.push(Buffer.from(`\r
|
|
26
|
-
`)),a=r+1);a&&a<t.length?(s=t.slice(a),this.push(s)):a||this.push(t),this.lastByte=t[t.length-1],i()}};Yr.exports=as});var en=T((Ou,Zr)=>{"use strict";var yp=require("stream"),vp=yp.Transform,ns=class extends vp{constructor(t){super(t),this.options=t||{}}_transform(t,e,i){let s,a=0;for(let r=0,o=t.length;r<o;r++)t[r]===13&&(s=t.slice(a,r),a=r+1,this.push(s));a&&a<t.length?(s=t.slice(a),this.push(s)):a||this.push(t),i()}};Zr.exports=ns});var ls=T((Du,tn)=>{"use strict";var os=require("crypto"),bp=require("fs"),wp=require("punycode"),st=require("stream").PassThrough,Pp=j(),z=it(),Tp=ts(),Ap=Yi(),Ep=Xr(),Sp=Ze(),Cp=Qr(),kp=rs(),Ip=en(),at=class{constructor(t,e){this.nodeCounter=0,e=e||{},this.baseBoundary=e.baseBoundary||os.randomBytes(8).toString("hex"),this.boundaryPrefix=e.boundaryPrefix||"--_NmP",this.disableFileAccess=!!e.disableFileAccess,this.disableUrlAccess=!!e.disableUrlAccess,this.normalizeHeaderKey=e.normalizeHeaderKey,this.date=new Date,this.rootNode=e.rootNode||this,this.keepBcc=!!e.keepBcc,e.filename&&(this.filename=e.filename,t||(t=z.detectMimeType(this.filename.split(".").pop()))),this.textEncoding=(e.textEncoding||"").toString().trim().charAt(0).toUpperCase(),this.parentNode=e.parentNode,this.hostname=e.hostname,this.newline=e.newline,this.childNodes=[],this._nodeId=++this.rootNode.nodeCounter,this._headers=[],this._isPlainText=!1,this._hasLongLines=!1,this._envelope=!1,this._raw=!1,this._transforms=[],this._processFuncs=[],t&&this.setHeader("Content-Type",t)}createChild(t,e){!e&&typeof t=="object"&&(e=t,t=void 0);let i=new at(t,e);return this.appendChild(i),i}appendChild(t){return t.rootNode!==this.rootNode&&(t.rootNode=this.rootNode,t._nodeId=++this.rootNode.nodeCounter),t.parentNode=this,this.childNodes.push(t),t}replace(t){return t===this?this:(this.parentNode.childNodes.forEach((e,i)=>{e===this&&(t.rootNode=this.rootNode,t.parentNode=this.parentNode,t._nodeId=this._nodeId,this.rootNode=this,this.parentNode=void 0,t.parentNode.childNodes[i]=t)}),t)}remove(){if(!this.parentNode)return this;for(let t=this.parentNode.childNodes.length-1;t>=0;t--)if(this.parentNode.childNodes[t]===this)return this.parentNode.childNodes.splice(t,1),this.parentNode=void 0,this.rootNode=this,this}setHeader(t,e){let i=!1,s;if(!e&&t&&typeof t=="object")return t.key&&"value"in t?this.setHeader(t.key,t.value):Array.isArray(t)?t.forEach(a=>{this.setHeader(a.key,a.value)}):Object.keys(t).forEach(a=>{this.setHeader(a,t[a])}),this;t=this._normalizeHeaderKey(t),s={key:t,value:e};for(let a=0,r=this._headers.length;a<r;a++)this._headers[a].key===t&&(i?(this._headers.splice(a,1),a--,r--):(this._headers[a]=s,i=!0));return i||this._headers.push(s),this}addHeader(t,e){return!e&&t&&typeof t=="object"?(t.key&&t.value?this.addHeader(t.key,t.value):Array.isArray(t)?t.forEach(i=>{this.addHeader(i.key,i.value)}):Object.keys(t).forEach(i=>{this.addHeader(i,t[i])}),this):Array.isArray(e)?(e.forEach(i=>{this.addHeader(t,i)}),this):(this._headers.push({key:this._normalizeHeaderKey(t),value:e}),this)}getHeader(t){t=this._normalizeHeaderKey(t);for(let e=0,i=this._headers.length;e<i;e++)if(this._headers[e].key===t)return this._headers[e].value}setContent(t){return this.content=t,typeof this.content.pipe=="function"?(this._contentErrorHandler=e=>{this.content.removeListener("error",this._contentErrorHandler),this.content=e},this.content.once("error",this._contentErrorHandler)):typeof this.content=="string"&&(this._isPlainText=z.isPlainText(this.content),this._isPlainText&&z.hasLongerLines(this.content,76)&&(this._hasLongLines=!0)),this}build(t){let e;t||(e=new Promise((o,l)=>{t=Pp.callbackPromise(o,l)}));let i=this.createReadStream(),s=[],a=0,r=!1;return i.on("readable",()=>{let o;for(;(o=i.read())!==null;)s.push(o),a+=o.length}),i.once("error",o=>{if(!r)return r=!0,t(o)}),i.once("end",o=>{if(!r)return r=!0,o&&o.length&&(s.push(o),a+=o.length),t(null,Buffer.concat(s,a))}),e}getTransferEncoding(){let t=!1,e=(this.getHeader("Content-Type")||"").toString().toLowerCase().trim();return this.content&&(t=(this.getHeader("Content-Transfer-Encoding")||"").toString().toLowerCase().trim(),(!t||!["base64","quoted-printable"].includes(t))&&(/^text\//i.test(e)?this._isPlainText&&!this._hasLongLines?t="7bit":typeof this.content=="string"||this.content instanceof Buffer?t=this._getTextEncoding(this.content)==="Q"?"quoted-printable":"base64":t=this.textEncoding==="B"?"base64":"quoted-printable":/^(multipart|message)\//i.test(e)||(t=t||"base64"))),t}buildHeaders(){let t=this.getTransferEncoding(),e=[];return t&&this.setHeader("Content-Transfer-Encoding",t),this.filename&&!this.getHeader("Content-Disposition")&&this.setHeader("Content-Disposition","attachment"),this.rootNode===this&&(this.getHeader("Date")||this.setHeader("Date",this.date.toUTCString().replace(/GMT/,"+0000")),this.messageId(),this.getHeader("MIME-Version")||this.setHeader("MIME-Version","1.0")),this._headers.forEach(i=>{let s=i.key,a=i.value,r,o,l={};if(!(a&&typeof a=="object"&&!["From","Sender","To","Cc","Bcc","Reply-To","Date","References"].includes(s)&&(Object.keys(a).forEach(p=>{p!=="value"&&(l[p]=a[p])}),a=(a.value||"").toString(),!a.trim()))){if(l.prepared){l.foldLines?e.push(z.foldLines(s+": "+a)):e.push(s+": "+a);return}switch(i.key){case"Content-Disposition":r=z.parseHeaderValue(a),this.filename&&(r.params.filename=this.filename),a=z.buildHeaderValue(r);break;case"Content-Type":r=z.parseHeaderValue(a),this._handleContentType(r),r.value.match(/^text\/plain\b/)&&typeof this.content=="string"&&/[\u0080-\uFFFF]/.test(this.content)&&(r.params.charset="utf-8"),a=z.buildHeaderValue(r),this.filename&&(o=this._encodeWords(this.filename),(o!==this.filename||/[\s'"\\;:/=(),<>@[\]?]|^-/.test(o))&&(o='"'+o+'"'),a+="; name="+o);break;case"Bcc":if(!this.keepBcc)return;break}if(a=this._encodeHeaderValue(s,a),!!(a||"").toString().trim()){if(typeof this.normalizeHeaderKey=="function"){let p=this.normalizeHeaderKey(s,a);p&&typeof p=="string"&&p.length&&(s=p)}e.push(z.foldLines(s+": "+a,76))}}}),e.join(`\r
|
|
27
|
-
`)}createReadStream(t){t=t||{};let e=new st(t),i=e,s;this.stream(e,t,a=>{if(a){i.emit("error",a);return}e.end()});for(let a=0,r=this._transforms.length;a<r;a++)s=typeof this._transforms[a]=="function"?this._transforms[a]():this._transforms[a],i.once("error",o=>{s.emit("error",o)}),i=i.pipe(s);s=new Cp,i.once("error",a=>{s.emit("error",a)}),i=i.pipe(s);for(let a=0,r=this._processFuncs.length;a<r;a++)s=this._processFuncs[a],i=s(i);if(this.newline){let r=["win","windows","dos",`\r
|
|
28
|
-
`].includes(this.newline.toString().toLowerCase())?new kp:new Ip,o=i.pipe(r);return i.on("error",l=>o.emit("error",l)),o}return i}transform(t){this._transforms.push(t)}processFunc(t){this._processFuncs.push(t)}stream(t,e,i){let s=this.getTransferEncoding(),a,r,o=!1,l=h=>{o||(o=!0,i(h))},c=()=>{let h=0,u=()=>{if(h>=this.childNodes.length)return t.write(`\r
|
|
29
|
-
--`+this.boundary+`--\r
|
|
30
|
-
`),l();let f=this.childNodes[h++];t.write((h>1?`\r
|
|
31
|
-
`:"")+"--"+this.boundary+`\r
|
|
32
|
-
`),f.stream(t,e,m=>{if(m)return l(m);setImmediate(u)})};if(this.multipart)setImmediate(u);else return l()},p=()=>{if(this.content){if(Object.prototype.toString.call(this.content)==="[object Error]")return l(this.content);typeof this.content.pipe=="function"&&(this.content.removeListener("error",this._contentErrorHandler),this._contentErrorHandler=u=>l(u),this.content.once("error",this._contentErrorHandler));let h=()=>{["quoted-printable","base64"].includes(s)?(a=new(s==="base64"?Ap:Tp).Encoder(e),a.pipe(t,{end:!1}),a.once("end",c),a.once("error",u=>l(u)),r=this._getStream(this.content),r.pipe(a)):(r=this._getStream(this.content),r.pipe(t,{end:!1}),r.once("end",c)),r.once("error",u=>l(u))};if(this.content._resolve){let u=[],f=0,m=!1,x=this._getStream(this.content);x.on("error",b=>{m||(m=!0,l(b))}),x.on("readable",()=>{let b;for(;(b=x.read())!==null;)u.push(b),f+=b.length}),x.on("end",()=>{m||(m=!0,this.content._resolve=!1,this.content._resolvedValue=Buffer.concat(u,f),setImmediate(h))})}else setImmediate(h);return}else return setImmediate(c)};this._raw?setImmediate(()=>{if(Object.prototype.toString.call(this._raw)==="[object Error]")return l(this._raw);typeof this._raw.pipe=="function"&&this._raw.removeListener("error",this._contentErrorHandler);let h=this._getStream(this._raw);h.pipe(t,{end:!1}),h.on("error",u=>t.emit("error",u)),h.on("end",c)}):(t.write(this.buildHeaders()+`\r
|
|
33
|
-
\r
|
|
34
|
-
`),setImmediate(p))}setEnvelope(t){let e;this._envelope={from:!1,to:[]},t.from&&(e=[],this._convertAddresses(this._parseAddresses(t.from),e),e=e.filter(s=>s&&s.address),e.length&&e[0]&&(this._envelope.from=e[0].address)),["to","cc","bcc"].forEach(s=>{t[s]&&this._convertAddresses(this._parseAddresses(t[s]),this._envelope.to)}),this._envelope.to=this._envelope.to.map(s=>s.address).filter(s=>s);let i=["to","cc","bcc","from"];return Object.keys(t).forEach(s=>{i.includes(s)||(this._envelope[s]=t[s])}),this}getAddresses(){let t={};return this._headers.forEach(e=>{let i=e.key.toLowerCase();["from","sender","reply-to","to","cc","bcc"].includes(i)&&(Array.isArray(t[i])||(t[i]=[]),this._convertAddresses(this._parseAddresses(e.value),t[i]))}),t}getEnvelope(){if(this._envelope)return this._envelope;let t={from:!1,to:[]};return this._headers.forEach(e=>{let i=[];e.key==="From"||!t.from&&["Reply-To","Sender"].includes(e.key)?(this._convertAddresses(this._parseAddresses(e.value),i),i.length&&i[0]&&(t.from=i[0].address)):["To","Cc","Bcc"].includes(e.key)&&this._convertAddresses(this._parseAddresses(e.value),t.to)}),t.to=t.to.map(e=>e.address),t}messageId(){let t=this.getHeader("Message-ID");return t||(t=this._generateMessageId(),this.setHeader("Message-ID",t)),t}setRaw(t){return this._raw=t,this._raw&&typeof this._raw.pipe=="function"&&(this._contentErrorHandler=e=>{this._raw.removeListener("error",this._contentErrorHandler),this._raw=e},this._raw.once("error",this._contentErrorHandler)),this}_getStream(t){let e;return t._resolvedValue?(e=new st,setImmediate(()=>{try{e.end(t._resolvedValue)}catch(i){e.emit("error",i)}}),e):typeof t.pipe=="function"?t:t&&typeof t.path=="string"&&!t.href?this.disableFileAccess?(e=new st,setImmediate(()=>e.emit("error",new Error("File access rejected for "+t.path))),e):bp.createReadStream(t.path):t&&typeof t.href=="string"?this.disableUrlAccess?(e=new st,setImmediate(()=>e.emit("error",new Error("Url access rejected for "+t.href))),e):Sp(t.href,{headers:t.httpHeaders}):(e=new st,setImmediate(()=>{try{e.end(t||"")}catch(i){e.emit("error",i)}}),e)}_parseAddresses(t){return[].concat.apply([],[].concat(t).map(e=>e&&e.address?(e.address=this._normalizeAddress(e.address),e.name=e.name||"",[e]):Ep(e)))}_normalizeHeaderKey(t){return t=(t||"").toString().replace(/\r?\n|\r/g," ").trim().toLowerCase().replace(/^X-SMTPAPI$|^(MIME|DKIM|ARC|BIMI)\b|^[a-z]|-(SPF|FBL|ID|MD5)$|-[a-z]/gi,e=>e.toUpperCase()).replace(/^Content-Features$/i,"Content-features"),t}_handleContentType(t){this.contentType=t.value.trim().toLowerCase(),this.multipart=/^multipart\//i.test(this.contentType)?this.contentType.substr(this.contentType.indexOf("/")+1):!1,this.multipart?this.boundary=t.params.boundary=t.params.boundary||this.boundary||this._generateBoundary():this.boundary=!1}_generateBoundary(){return this.rootNode.boundaryPrefix+"-"+this.rootNode.baseBoundary+"-Part_"+this._nodeId}_encodeHeaderValue(t,e){switch(t=this._normalizeHeaderKey(t),t){case"From":case"Sender":case"To":case"Cc":case"Bcc":case"Reply-To":return this._convertAddresses(this._parseAddresses(e));case"Message-ID":case"In-Reply-To":case"Content-Id":return e=(e||"").toString().replace(/\r?\n|\r/g," "),e.charAt(0)!=="<"&&(e="<"+e),e.charAt(e.length-1)!==">"&&(e=e+">"),e;case"References":return e=[].concat.apply([],[].concat(e||"").map(i=>(i=(i||"").toString().replace(/\r?\n|\r/g," ").trim(),i.replace(/<[^>]*>/g,s=>s.replace(/\s/g,"")).split(/\s+/)))).map(i=>(i.charAt(0)!=="<"&&(i="<"+i),i.charAt(i.length-1)!==">"&&(i=i+">"),i)),e.join(" ").trim();case"Date":return Object.prototype.toString.call(e)==="[object Date]"?e.toUTCString().replace(/GMT/,"+0000"):(e=(e||"").toString().replace(/\r?\n|\r/g," "),this._encodeWords(e));case"Content-Type":case"Content-Disposition":return(e||"").toString().replace(/\r?\n|\r/g," ");default:return e=(e||"").toString().replace(/\r?\n|\r/g," "),this._encodeWords(e)}}_convertAddresses(t,e){let i=[];return e=e||[],[].concat(t||[]).forEach(s=>{if(s.address)s.address=this._normalizeAddress(s.address),s.name?s.name&&i.push(`${this._encodeAddressName(s.name)} <${s.address}>`):i.push(s.address.indexOf(" ")>=0?`<${s.address}>`:`${s.address}`),s.address&&(e.filter(a=>a.address===s.address).length||e.push(s));else if(s.group){let a=(s.group.length?this._convertAddresses(s.group,e):"").trim();i.push(`${this._encodeAddressName(s.name)}:${a};`)}}),i.join(", ")}_normalizeAddress(t){t=(t||"").toString().replace(/[\x00-\x1F<>]+/g," ").trim();let e=t.lastIndexOf("@");if(e<0)return t;let i=t.substr(0,e),s=t.substr(e+1),a;try{a=wp.toASCII(s.toLowerCase())}catch{}return i.indexOf(" ")>=0&&(i.charAt(0)!=='"'&&(i='"'+i),i.substr(-1)!=='"'&&(i=i+'"')),`${i}@${a}`}_encodeAddressName(t){return/^[\w ']*$/.test(t)?t:/^[\x20-\x7e]*$/.test(t)?'"'+t.replace(/([\\"])/g,"\\$1")+'"':z.encodeWord(t,this._getTextEncoding(t),52)}_encodeWords(t){return z.encodeWords(t,this._getTextEncoding(t),52,!0)}_getTextEncoding(t){t=(t||"").toString();let e=this.textEncoding,i,s;return e||(s=(t.match(/[\x00-\x08\x0B\x0C\x0E-\x1F\u0080-\uFFFF]/g)||[]).length,i=(t.match(/[a-z]/gi)||[]).length,e=s<i?"Q":"B"),e}_generateMessageId(){return"<"+[2,2,2,6].reduce((t,e)=>t+"-"+os.randomBytes(e).toString("hex"),os.randomBytes(4).toString("hex"))+"@"+(this.getEnvelope().from||this.hostname||"localhost").split("@").pop()+">"}};tn.exports=at});var an=T((Bu,sn)=>{"use strict";var rt=ls(),cs=it(),ps=class{constructor(t){this.mail=t||{},this.message=!1}compile(){return this._alternatives=this.getAlternatives(),this._htmlNode=this._alternatives.filter(t=>/^text\/html\b/i.test(t.contentType)).pop(),this._attachments=this.getAttachments(!!this._htmlNode),this._useRelated=!!(this._htmlNode&&this._attachments.related.length),this._useAlternative=this._alternatives.length>1,this._useMixed=this._attachments.attached.length>1||this._alternatives.length&&this._attachments.attached.length===1,this.mail.raw?this.message=new rt("message/rfc822",{newline:this.mail.newline}).setRaw(this.mail.raw):this._useMixed?this.message=this._createMixed():this._useAlternative?this.message=this._createAlternative():this._useRelated?this.message=this._createRelated():this.message=this._createContentNode(!1,[].concat(this._alternatives||[]).concat(this._attachments.attached||[]).shift()||{contentType:"text/plain",content:""}),this.mail.headers&&this.message.addHeader(this.mail.headers),["from","sender","to","cc","bcc","reply-to","in-reply-to","references","subject","message-id","date"].forEach(t=>{let e=t.replace(/-(\w)/g,(i,s)=>s.toUpperCase());this.mail[e]&&this.message.setHeader(t,this.mail[e])}),this.mail.envelope&&this.message.setEnvelope(this.mail.envelope),this.message.messageId(),this.message}getAttachments(t){let e,i,s=[].concat(this.mail.attachments||[]).map((a,r)=>{let o,l=/^message\//i.test(a.contentType);return/^data:/i.test(a.path||a.href)&&(a=this._processDataUrl(a)),o={contentType:a.contentType||cs.detectMimeType(a.filename||a.path||a.href||"bin"),contentDisposition:a.contentDisposition||(l?"inline":"attachment"),contentTransferEncoding:"contentTransferEncoding"in a?a.contentTransferEncoding:"base64"},a.filename?o.filename=a.filename:!l&&a.filename!==!1&&(o.filename=(a.path||a.href||"").split("/").pop().split("?").shift()||"attachment-"+(r+1),o.filename.indexOf(".")<0&&(o.filename+="."+cs.detectExtension(o.contentType))),/^https?:\/\//i.test(a.path)&&(a.href=a.path,a.path=void 0),a.cid&&(o.cid=a.cid),a.raw?o.raw=a.raw:a.path?o.content={path:a.path}:a.href?o.content={href:a.href,httpHeaders:a.httpHeaders}:o.content=a.content||"",a.encoding&&(o.encoding=a.encoding),a.headers&&(o.headers=a.headers),o});return this.mail.icalEvent&&(typeof this.mail.icalEvent=="object"&&(this.mail.icalEvent.content||this.mail.icalEvent.path||this.mail.icalEvent.href||this.mail.icalEvent.raw)?e=this.mail.icalEvent:e={content:this.mail.icalEvent},i={},Object.keys(e).forEach(a=>{i[a]=e[a]}),i.contentType="application/ics",i.headers||(i.headers={}),i.filename=i.filename||"invite.ics",i.headers["Content-Disposition"]="attachment",i.headers["Content-Transfer-Encoding"]="base64"),t?{attached:s.filter(a=>!a.cid).concat(i||[]),related:s.filter(a=>!!a.cid)}:{attached:s.concat(i||[]),related:[]}}getAlternatives(){let t=[],e,i,s,a,r,o;return this.mail.text&&(typeof this.mail.text=="object"&&(this.mail.text.content||this.mail.text.path||this.mail.text.href||this.mail.text.raw)?e=this.mail.text:e={content:this.mail.text},e.contentType="text/plain; charset=utf-8"),this.mail.watchHtml&&(typeof this.mail.watchHtml=="object"&&(this.mail.watchHtml.content||this.mail.watchHtml.path||this.mail.watchHtml.href||this.mail.watchHtml.raw)?s=this.mail.watchHtml:s={content:this.mail.watchHtml},s.contentType="text/watch-html; charset=utf-8"),this.mail.amp&&(typeof this.mail.amp=="object"&&(this.mail.amp.content||this.mail.amp.path||this.mail.amp.href||this.mail.amp.raw)?a=this.mail.amp:a={content:this.mail.amp},a.contentType="text/x-amp-html; charset=utf-8"),this.mail.icalEvent&&(typeof this.mail.icalEvent=="object"&&(this.mail.icalEvent.content||this.mail.icalEvent.path||this.mail.icalEvent.href||this.mail.icalEvent.raw)?r=this.mail.icalEvent:r={content:this.mail.icalEvent},o={},Object.keys(r).forEach(l=>{o[l]=r[l]}),o.content&&typeof o.content=="object"&&(o.content._resolve=!0),o.filename=!1,o.contentType="text/calendar; charset=utf-8; method="+(o.method||"PUBLISH").toString().trim().toUpperCase(),o.headers||(o.headers={})),this.mail.html&&(typeof this.mail.html=="object"&&(this.mail.html.content||this.mail.html.path||this.mail.html.href||this.mail.html.raw)?i=this.mail.html:i={content:this.mail.html},i.contentType="text/html; charset=utf-8"),[].concat(e||[]).concat(s||[]).concat(a||[]).concat(i||[]).concat(o||[]).concat(this.mail.alternatives||[]).forEach(l=>{let c;/^data:/i.test(l.path||l.href)&&(l=this._processDataUrl(l)),c={contentType:l.contentType||cs.detectMimeType(l.filename||l.path||l.href||"txt"),contentTransferEncoding:l.contentTransferEncoding},l.filename&&(c.filename=l.filename),/^https?:\/\//i.test(l.path)&&(l.href=l.path,l.path=void 0),l.raw?c.raw=l.raw:l.path?c.content={path:l.path}:l.href?c.content={href:l.href}:c.content=l.content||"",l.encoding&&(c.encoding=l.encoding),l.headers&&(c.headers=l.headers),t.push(c)}),t}_createMixed(t){let e;return t?e=t.createChild("multipart/mixed",{disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline}):e=new rt("multipart/mixed",{baseBoundary:this.mail.baseBoundary,textEncoding:this.mail.textEncoding,boundaryPrefix:this.mail.boundaryPrefix,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline}),this._useAlternative?this._createAlternative(e):this._useRelated&&this._createRelated(e),[].concat(!this._useAlternative&&this._alternatives||[]).concat(this._attachments.attached||[]).forEach(i=>{(!this._useRelated||i!==this._htmlNode)&&this._createContentNode(e,i)}),e}_createAlternative(t){let e;return t?e=t.createChild("multipart/alternative",{disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline}):e=new rt("multipart/alternative",{baseBoundary:this.mail.baseBoundary,textEncoding:this.mail.textEncoding,boundaryPrefix:this.mail.boundaryPrefix,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline}),this._alternatives.forEach(i=>{this._useRelated&&this._htmlNode===i?this._createRelated(e):this._createContentNode(e,i)}),e}_createRelated(t){let e;return t?e=t.createChild('multipart/related; type="text/html"',{disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline}):e=new rt('multipart/related; type="text/html"',{baseBoundary:this.mail.baseBoundary,textEncoding:this.mail.textEncoding,boundaryPrefix:this.mail.boundaryPrefix,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline}),this._createContentNode(e,this._htmlNode),this._attachments.related.forEach(i=>this._createContentNode(e,i)),e}_createContentNode(t,e){e=e||{},e.content=e.content||"";let i,s=(e.encoding||"utf8").toString().toLowerCase().replace(/[-_\s]/g,"");return t?i=t.createChild(e.contentType,{filename:e.filename,textEncoding:this.mail.textEncoding,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline}):i=new rt(e.contentType,{filename:e.filename,baseBoundary:this.mail.baseBoundary,textEncoding:this.mail.textEncoding,boundaryPrefix:this.mail.boundaryPrefix,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline}),e.headers&&i.addHeader(e.headers),e.cid&&i.setHeader("Content-Id","<"+e.cid.replace(/[<>]/g,"")+">"),e.contentTransferEncoding?i.setHeader("Content-Transfer-Encoding",e.contentTransferEncoding):this.mail.encoding&&/^text\//i.test(e.contentType)&&i.setHeader("Content-Transfer-Encoding",this.mail.encoding),(!/^text\//i.test(e.contentType)||e.contentDisposition)&&i.setHeader("Content-Disposition",e.contentDisposition||(e.cid?"inline":"attachment")),typeof e.content=="string"&&!["utf8","usascii","ascii"].includes(s)&&(e.content=Buffer.from(e.content,s)),e.raw?i.setRaw(e.raw):i.setContent(e.content),i}_processDataUrl(t){let e=(t.path||t.href).match(/^data:((?:[^;]*;)*(?:[^,]*)),(.*)$/i);return e&&(t.content=/\bbase64$/i.test(e[1])?Buffer.from(e[2],"base64"):Buffer.from(decodeURIComponent(e[2])),"path"in t&&(t.path=!1),"href"in t&&(t.href=!1),e[1].split(";").forEach(i=>{/^\w+\/[^/]+$/i.test(i)&&(t.contentType=t.contentType||i.toLowerCase())})),t}};sn.exports=ps});var nn=T((Fu,rn)=>{"use strict";var Np=require("stream").Transform,hs=class extends Np{constructor(t){super(t),this.lastBytes=Buffer.alloc(4),this.headersParsed=!1,this.headerBytes=0,this.headerChunks=[],this.rawHeaders=!1,this.bodySize=0}updateLastBytes(t){let e=this.lastBytes.length,i=Math.min(t.length,e);for(let s=0,a=e-i;s<a;s++)this.lastBytes[s]=this.lastBytes[s+i];for(let s=1;s<=i;s++)this.lastBytes[e-s]=t[t.length-s]}checkHeaders(t){if(this.headersParsed)return!0;let e=this.lastBytes.length,i=0;this.curLinePos=0;for(let s=0,a=this.lastBytes.length+t.length;s<a;s++){let r;if(s<e?r=this.lastBytes[s]:r=t[s-e],r===10&&s){let o=s-1<e?this.lastBytes[s-1]:t[s-1-e],l=s>1?s-2<e?this.lastBytes[s-2]:t[s-2-e]:!1;if(o===10){this.headersParsed=!0,i=s-e+1,this.headerBytes+=i;break}else if(o===13&&l===10){this.headersParsed=!0,i=s-e+1,this.headerBytes+=i;break}}}if(this.headersParsed){if(this.headerChunks.push(t.slice(0,i)),this.rawHeaders=Buffer.concat(this.headerChunks,this.headerBytes),this.headerChunks=null,this.emit("headers",this.parseHeaders()),t.length-1>i){let s=t.slice(i);this.bodySize+=s.length,setImmediate(()=>this.push(s))}return!1}else this.headerBytes+=t.length,this.headerChunks.push(t);return this.updateLastBytes(t),!1}_transform(t,e,i){if(!t||!t.length)return i();typeof t=="string"&&(t=Buffer.from(t,e));let s;try{s=this.checkHeaders(t)}catch(a){return i(a)}s&&(this.bodySize+=t.length,this.push(t)),setImmediate(i)}_flush(t){if(this.headerChunks){let e=Buffer.concat(this.headerChunks,this.headerBytes);this.bodySize+=e.length,this.push(e),this.headerChunks=null}t()}parseHeaders(){let t=(this.rawHeaders||"").toString().split(/\r?\n/);for(let e=t.length-1;e>0;e--)/^\s/.test(t[e])&&(t[e-1]+=`
|
|
35
|
-
`+t[e],t.splice(e,1));return t.filter(e=>e.trim()).map(e=>({key:e.substr(0,e.indexOf(":")).trim().toLowerCase(),line:e}))}};rn.exports=hs});var ln=T((ju,on)=>{"use strict";var _p=require("stream").Transform,Lp=require("crypto"),us=class extends _p{constructor(t){super(),t=t||{},this.chunkBuffer=[],this.chunkBufferLen=0,this.bodyHash=Lp.createHash(t.hashAlgo||"sha1"),this.remainder="",this.byteLength=0,this.debug=t.debug,this._debugBody=t.debug?[]:!1}updateHash(t){let e,i="",s="file";for(let r=t.length-1;r>=0;r--){let o=t[r];if(!(s==="file"&&(o===10||o===13))){if(s==="file"&&(o===9||o===32))s="line";else if(!(s==="line"&&(o===9||o===32))){if((s==="file"||s==="line")&&(s="body",r===t.length-1))break}}if(r===0){if(s==="file"&&(!this.remainder||/[\r\n]$/.test(this.remainder))||s==="line"&&(!this.remainder||/[ \t]$/.test(this.remainder))){this.remainder+=t.toString("binary");return}else if(s==="line"||s==="file"){i=t.toString("binary"),t=!1;break}}if(s==="body"){i=t.slice(r+1).toString("binary"),t=t.slice(0,r+1);break}}let a=!!this.remainder;if(t&&!a){for(let r=0,o=t.length;r<o;r++)if(r&&t[r]===10&&t[r-1]!==13){a=!0;break}else if(r&&t[r]===13&&t[r-1]===32){a=!0;break}else if(r&&t[r]===32&&t[r-1]===32){a=!0;break}else if(t[r]===9){a=!0;break}}a?(e=this.remainder+(t?t.toString("binary"):""),this.remainder=i,e=e.replace(/\r?\n/g,`
|
|
36
|
-
`).replace(/[ \t]*$/gm,"").replace(/[ \t]+/gm," ").replace(/\n/g,`\r
|
|
37
|
-
`),t=Buffer.from(e,"binary")):i&&(this.remainder=i),this.debug&&this._debugBody.push(t),this.bodyHash.update(t)}_transform(t,e,i){if(!t||!t.length)return i();typeof t=="string"&&(t=Buffer.from(t,e)),this.updateHash(t),this.byteLength+=t.length,this.push(t),i()}_flush(t){/[\r\n]$/.test(this.remainder)&&this.byteLength>2&&this.bodyHash.update(Buffer.from(`\r
|
|
38
|
-
`)),this.byteLength||this.push(Buffer.from(`\r
|
|
39
|
-
`)),this.emit("hash",this.bodyHash.digest("base64"),this.debug?Buffer.concat(this._debugBody):!1),t()}};on.exports=us});var hn=T((Ru,ds)=>{"use strict";var Mp=require("punycode"),Op=it(),Dp=require("crypto");ds.exports=(n,t,e,i)=>{i=i||{};let s="From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive",a=i.headerFieldNames||s,r=cn(n,a,i.skipFields),o=Bp(i.domainName,i.keySelector,r.fieldNames,t,e),l,c;r.headers+="dkim-signature:"+pn(o),l=Dp.createSign(("rsa-"+t).toUpperCase()),l.update(r.headers);try{c=l.sign(i.privateKey,"base64")}catch{return!1}return o+c.replace(/(^.{73}|.{75}(?!\r?\n|\r))/g,`$&\r
|
|
40
|
-
`).trim()};ds.exports.relaxedHeaders=cn;function Bp(n,t,e,i,s){let a=["v=1","a=rsa-"+i,"c=relaxed/relaxed","d="+Mp.toASCII(n),"q=dns/txt","s="+t,"bh="+s,"h="+e].join("; ");return Op.foldLines("DKIM-Signature: "+a,76)+`;\r
|
|
41
|
-
b=`}function cn(n,t,e){let i=new Set,s=new Set,a=new Map;(e||"").toLowerCase().split(":").forEach(l=>{s.add(l.trim())}),(t||"").toLowerCase().split(":").filter(l=>!s.has(l.trim())).forEach(l=>{i.add(l.trim())});for(let l=n.length-1;l>=0;l--){let c=n[l];i.has(c.key)&&!a.has(c.key)&&a.set(c.key,pn(c.line))}let r=[],o=[];return i.forEach(l=>{a.has(l)&&(o.push(l),r.push(l+":"+a.get(l)))}),{headers:r.join(`\r
|
|
42
|
-
`)+`\r
|
|
43
|
-
`,fieldNames:o.join(":")}}function pn(n){return n.substr(n.indexOf(":")+1).replace(/\r?\n/g,"").replace(/\s+/g," ").trim()}});var dn=T((Uu,un)=>{"use strict";var Fp=nn(),jp=ln(),Rp=hn(),fs=require("stream").PassThrough,ms=require("fs"),Up=require("path"),qp=require("crypto"),zp="sha256",Hp=128*1024,xs=class{constructor(t,e,i,s){this.options=t||{},this.keys=e,this.cacheTreshold=Number(this.options.cacheTreshold)||Hp,this.hashAlgo=this.options.hashAlgo||zp,this.cacheDir=this.options.cacheDir||!1,this.chunks=[],this.chunklen=0,this.readPos=0,this.cachePath=this.cacheDir?Up.join(this.cacheDir,"message."+Date.now()+"-"+qp.randomBytes(14).toString("hex")):!1,this.cache=!1,this.headers=!1,this.bodyHash=!1,this.parser=!1,this.relaxedBody=!1,this.input=i,this.output=s,this.output.usingCache=!1,this.hasErrored=!1,this.input.on("error",a=>{this.hasErrored=!0,this.cleanup(),s.emit("error",a)})}cleanup(){!this.cache||!this.cachePath||ms.unlink(this.cachePath,()=>!1)}createReadCache(){this.cache=ms.createReadStream(this.cachePath),this.cache.once("error",t=>{this.cleanup(),this.output.emit("error",t)}),this.cache.once("close",()=>{this.cleanup()}),this.cache.pipe(this.output)}sendNextChunk(){if(this.hasErrored)return;if(this.readPos>=this.chunks.length)return this.cache?this.createReadCache():this.output.end();let t=this.chunks[this.readPos++];if(this.output.write(t)===!1)return this.output.once("drain",()=>{this.sendNextChunk()});setImmediate(()=>this.sendNextChunk())}sendSignedOutput(){let t=0,e=()=>{if(t>=this.keys.length)return this.output.write(this.parser.rawHeaders),setImmediate(()=>this.sendNextChunk());let i=this.keys[t++],s=Rp(this.headers,this.hashAlgo,this.bodyHash,{domainName:i.domainName,keySelector:i.keySelector,privateKey:i.privateKey,headerFieldNames:this.options.headerFieldNames,skipFields:this.options.skipFields});return s&&this.output.write(Buffer.from(s+`\r
|
|
44
|
-
`)),setImmediate(e)};if(this.bodyHash&&this.headers)return e();this.output.write(this.parser.rawHeaders),this.sendNextChunk()}createWriteCache(){this.output.usingCache=!0,this.cache=ms.createWriteStream(this.cachePath),this.cache.once("error",t=>{this.cleanup(),this.relaxedBody.unpipe(this.cache),this.relaxedBody.on("readable",()=>{for(;this.relaxedBody.read()!==null;);}),this.hasErrored=!0,this.output.emit("error",t)}),this.cache.once("close",()=>{this.sendSignedOutput()}),this.relaxedBody.removeAllListeners("readable"),this.relaxedBody.pipe(this.cache)}signStream(){this.parser=new Fp,this.relaxedBody=new jp({hashAlgo:this.hashAlgo}),this.parser.on("headers",t=>{this.headers=t}),this.relaxedBody.on("hash",t=>{this.bodyHash=t}),this.relaxedBody.on("readable",()=>{let t;if(!this.cache){for(;(t=this.relaxedBody.read())!==null;)if(this.chunks.push(t),this.chunklen+=t.length,this.chunklen>=this.cacheTreshold&&this.cachePath)return this.createWriteCache()}}),this.relaxedBody.on("end",()=>{this.cache||this.sendSignedOutput()}),this.parser.pipe(this.relaxedBody),setImmediate(()=>this.input.pipe(this.parser))}},gs=class{constructor(t){this.options=t||{},this.keys=[].concat(this.options.keys||{domainName:t.domainName,keySelector:t.keySelector,privateKey:t.privateKey})}sign(t,e){let i=new fs,s=t,a=!1;Buffer.isBuffer(t)?(a=t,s=new fs):typeof t=="string"&&(a=Buffer.from(t),s=new fs);let r=this.options;e&&Object.keys(e).length&&(r={},Object.keys(this.options||{}).forEach(l=>{r[l]=this.options[l]}),Object.keys(e||{}).forEach(l=>{l in r||(r[l]=e[l])}));let o=new xs(r,this.keys,s,i);return setImmediate(()=>{o.signStream(),a&&setImmediate(()=>{s.end(a)})}),i}};un.exports=gs});var yn=T((qu,gn)=>{"use strict";var fn=require("net"),mn=require("tls"),$p=require("url");function xn(n,t,e,i){let s=$p.parse(n),a,r,o;a={host:s.hostname,port:Number(s.port)?Number(s.port):s.protocol==="https:"?443:80},s.protocol==="https:"?(a.rejectUnauthorized=!1,r=mn.connect.bind(mn)):r=fn.connect.bind(fn);let l=!1,c=h=>{if(!l){l=!0;try{o.destroy()}catch{}i(h)}},p=()=>{let h=new Error("Proxy socket timed out");h.code="ETIMEDOUT",c(h)};o=r(a,()=>{if(l)return;let h={Host:e+":"+t,Connection:"close"};s.auth&&(h["Proxy-Authorization"]="Basic "+Buffer.from(s.auth).toString("base64")),o.write("CONNECT "+e+":"+t+` HTTP/1.1\r
|
|
45
|
-
`+Object.keys(h).map(m=>m+": "+h[m]).join(`\r
|
|
14
|
+
`):i=String.fromCharCode(s),++this.state.curLine,this.state.lineStart=this.state.pos,i}jsxReadString(e){let s="",i=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(c.UnterminatedString,{at:this.state.startLoc});let a=this.input.charCodeAt(this.state.pos);if(a===e)break;a===38?(s+=this.input.slice(i,this.state.pos),s+=this.jsxReadEntity(),i=this.state.pos):nt(a)?(s+=this.input.slice(i,this.state.pos),s+=this.jsxReadNewLine(!1),i=this.state.pos):++this.state.pos}s+=this.input.slice(i,this.state.pos++),this.finishToken(131,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 i=this.readInt(s,void 0,!1,"bail");if(i!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(i)}else{let s=0,i=!1;for(;s++<10&&this.state.pos<this.length&&!(i=this.codePointAtPos(this.state.pos)==59);)++this.state.pos;if(i){let a=this.input.slice(e,this.state.pos),n=Hu[a];if(++this.state.pos,n)return n}}return this.state.pos=e,"&"}jsxReadWord(){let e,s=this.state.pos;do e=this.input.charCodeAt(++this.state.pos);while(De(e)||e===45);this.finishToken(138,this.input.slice(s,this.state.pos))}jsxParseIdentifier(){let e=this.startNode();return this.match(138)?e.name=this.state.value:ii(this.state.type)?e.name=ce(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 i=this.startNodeAt(e);return i.namespace=s,i.name=this.jsxParseIdentifier(),this.finishNode(i,"JSXNamespacedName")}jsxParseElementName(){let e=this.state.startLoc,s=this.jsxParseNamespacedName();if(s.type==="JSXNamespacedName")return s;for(;this.eat(16);){let i=this.startNodeAt(e);i.object=s,i.property=this.jsxParseIdentifier(),s=this.finishNode(i,"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(ge.AttributeIsEmpty,{at:e}),e;case 140:case 131:return this.parseExprAtom();default:throw this.raise(ge.UnsupportedJsxValue,{at:this.state.startLoc})}}jsxParseEmptyExpression(){let e=this.startNodeAt(this.state.lastTokEndLoc);return this.finishNodeAt(e,"JSXEmptyExpression",this.state.startLoc)}jsxParseSpreadChild(e){return this.next(),e.expression=this.parseExpression(),this.setContext(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 i=this.parseExpression();e.expression=i}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(141)?this.finishNode(s,"JSXOpeningFragment"):(s.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(s))}jsxParseOpeningElementAfterName(e){let s=[];for(;!this.match(56)&&!this.match(141);)s.push(this.jsxParseAttribute());return e.attributes=s,e.selfClosing=this.eat(56),this.expect(141),this.finishNode(e,"JSXOpeningElement")}jsxParseClosingElementAt(e){let s=this.startNodeAt(e);return this.eat(141)?this.finishNode(s,"JSXClosingFragment"):(s.name=this.jsxParseElementName(),this.expect(141),this.finishNode(s,"JSXClosingElement"))}jsxParseElementAt(e){let s=this.startNodeAt(e),i=[],a=this.jsxParseOpeningElementAt(e),n=null;if(!a.selfClosing){e:for(;;)switch(this.state.type){case 140:if(e=this.state.startLoc,this.next(),this.eat(56)){n=this.jsxParseClosingElementAt(e);break e}i.push(this.jsxParseElementAt(e));break;case 139:i.push(this.parseExprAtom());break;case 5:{let o=this.startNode();this.setContext(k.brace),this.next(),this.match(21)?i.push(this.jsxParseSpreadChild(o)):i.push(this.jsxParseExpressionContainer(o,k.j_expr));break}default:this.unexpected()}he(a)&&!he(n)&&n!==null?this.raise(ge.MissingClosingTagFragment,{at:n}):!he(a)&&he(n)?this.raise(ge.MissingClosingTagElement,{at:n,openingTagName:Me(a.name)}):!he(a)&&!he(n)&&Me(n.name)!==Me(a.name)&&this.raise(ge.MissingClosingTagElement,{at:n,openingTagName:Me(a.name)})}if(he(a)?(s.openingFragment=a,s.closingFragment=n):(s.openingElement=a,s.closingElement=n),s.children=i,this.match(47))throw this.raise(ge.UnwrappedAdjacentJSXElements,{at:this.state.startLoc});return he(a)?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(139)?this.parseLiteral(this.state.value,"JSXText"):this.match(140)?this.jsxParseElement():this.match(47)&&this.input.charCodeAt(this.state.pos)!==33?(this.replaceToken(140),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(ee(e)){this.jsxReadWord();return}if(e===62){++this.state.pos,this.finishToken(141);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(140);return}super.getTokenFromCode(e)}updateContext(e){let{context:s,type:i}=this.state;if(i===56&&e===140)s.splice(-2,2,k.j_cTag),this.state.canStartJSXElement=!1;else if(i===140)s.push(k.j_oTag);else if(i===141){let a=s[s.length-1];a===k.j_oTag&&e===56||a===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=Jo(i)}},Hs=class extends ot{constructor(...t){super(...t),this.types=new Set,this.enums=new Set,this.constEnums=new Set,this.classes=new Set,this.exportOnlyBindings=new Set}},Ks=class extends ut{constructor(...t){super(...t),this.importsStack=[]}createScope(t){return this.importsStack.push(new Set),new Hs(t)}enter(t){t==Be&&this.importsStack.push(new Set),super.enter(t)}exit(){let t=super.exit();return t==Be&&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 i=0;i<s-1;i++)if(this.importsStack[i].has(t))return!0}return!1}declareName(t,e,s){if(e&at){this.hasImport(t,!0)&&this.parser.raise(c.VarRedeclaration,{at:s,identifierName:t}),this.importsStack[this.importsStack.length-1].add(t);return}let i=this.currentScope();if(e&oi){this.maybeExportDefined(i,t),i.exportOnlyBindings.add(t);return}super.declareName(t,e,s),e&Se&&(e&X||(this.checkRedeclarationInScope(i,t,e,s),this.maybeExportDefined(i,t)),i.types.add(t)),e&_s&&i.enums.add(t),e&Ls&&i.constEnums.add(t),e&Ht&&i.classes.add(t)}isRedeclaredInScope(t,e,s){if(t.enums.has(e)){if(s&_s){let i=!!(s&Ls),a=t.constEnums.has(e);return i!==a}return!0}return s&Ht&&t.classes.has(e)?t.lexical.has(e)?!!(s&X):!1:s&Se&&t.types.has(e)?!0:super.isRedeclaredInScope(t,e,s)}checkLocalExport(t){let{name:e}=t;if(this.hasImport(e))return;let s=this.scopeStack.length;for(let i=s-1;i>=0;i--){let a=this.scopeStack[i];if(a.types.has(e)||a.exportOnlyBindings.has(e))return}super.checkLocalExport(t)}},Gu=(r,t)=>Object.hasOwnProperty.call(r,t)&&r[t],Pa=r=>r.type==="ParenthesizedExpression"?Pa(r.expression):r,Gs=class extends zs{toAssignable(t,e=!1){var s,i;let a;switch((t.type==="ParenthesizedExpression"||(s=t.extra)!=null&&s.parenthesized)&&(a=Pa(t),e?a.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(c.InvalidParenthesizedAssignment,{at:t}):a.type!=="MemberExpression"&&this.raise(c.InvalidParenthesizedAssignment,{at:t}):this.raise(c.InvalidParenthesizedAssignment,{at:t})),t.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern";for(let o=0,u=t.properties.length,h=u-1;o<u;o++){var n;let l=t.properties[o],p=o===h;this.toAssignableObjectExpressionProp(l,p,e),p&&l.type==="RestElement"&&(n=t.extra)!=null&&n.trailingCommaLoc&&this.raise(c.RestTrailingComma,{at:t.extra.trailingCommaLoc})}break;case"ObjectProperty":{let{key:o,value:u}=t;this.isPrivateName(o)&&this.classScope.usePrivateName(this.getPrivateNameSV(o),o.loc.start),this.toAssignable(u,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,(i=t.extra)==null?void 0:i.trailingCommaLoc,e);break;case"AssignmentExpression":t.operator!=="="&&this.raise(c.MissingEqInAssignment,{at:t.left.loc.end}),t.type="AssignmentPattern",delete t.operator,this.toAssignable(t.left,e);break;case"ParenthesizedExpression":this.toAssignable(a,e);break}}toAssignableObjectExpressionProp(t,e,s){if(t.type==="ObjectMethod")this.raise(t.kind==="get"||t.kind==="set"?c.PatternHasAccessor:c.PatternHasMethod,{at:t.key});else if(t.type==="SpreadElement"){t.type="RestElement";let i=t.argument;this.checkToRestConversion(i,!1),this.toAssignable(i,s),e||this.raise(c.RestTrailingComma,{at:t})}else this.toAssignable(t,s)}toAssignableList(t,e,s){let i=t.length-1;for(let a=0;a<=i;a++){let n=t[a];if(n){if(n.type==="SpreadElement"){n.type="RestElement";let o=n.argument;this.checkToRestConversion(o,!0),this.toAssignable(o,s)}else this.toAssignable(n,s);n.type==="RestElement"&&(a<i?this.raise(c.RestTrailingComma,{at:n}):e&&this.raise(c.RestTrailingComma,{at: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((i,a)=>i.type!=="ObjectMethod"&&(a===s||i.type!=="SpreadElement")&&this.isAssignable(i))}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==null?void 0: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 i=s&1,a=[],n=!0;for(;!this.eat(t);)if(n?n=!1:this.expect(12),i&&this.match(12))a.push(null);else{if(this.eat(t))break;if(this.match(21)){if(a.push(this.parseAssignableListItemTypes(this.parseRestBinding(),s)),!this.checkCommaAfterRest(e)){this.expect(t);break}}else{let o=[];for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(c.UnsupportedParameterDecorator,{at:this.state.startLoc});this.match(26);)o.push(this.parseDecorator());a.push(this.parseAssignableListItem(s,o))}}return a}parseBindingRestProperty(t){return this.next(),t.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(t,"RestElement")}parseBindingProperty(){let t=this.startNode(),{type:e,startLoc:s}=this.state;return e===21?this.parseBindingRestProperty(t):(e===136?(this.expectPlugin("destructuringPrivate",s),this.classScope.usePrivateName(this.state.value,s),t.key=this.parsePrivateName()):this.parsePropertyName(t),t.method=!1,this.parseObjPropValue(t,s,!1,!1,!0,!1))}parseAssignableListItem(t,e){let s=this.parseMaybeDefault();this.parseAssignableListItemTypes(s,t);let i=this.parseMaybeDefault(s.loc.start,s);return e.length&&(s.decorators=e),i}parseAssignableListItemTypes(t,e){return t}parseMaybeDefault(t,e){var s,i;if((s=t)!=null||(t=this.state.startLoc),e=(i=e)!=null?i:this.parseBindingAtom(),!this.eat(29))return e;let a=this.startNodeAt(t);return a.left=e,a.right=this.parseMaybeAssignAllowIn(),this.finishNode(a,"AssignmentPattern")}isValidLVal(t,e,s){return Gu({AssignmentPattern:"left",RestElement:"argument",ObjectProperty:"value",ParenthesizedExpression:"expression",ArrayPattern:"elements",ObjectPattern:"properties"},t)}checkLVal(t,{in:e,binding:s=le,checkClashes:i=!1,strictModeChanged:a=!1,hasParenthesizedAncestor:n=!1}){var o;let u=t.type;if(this.isObjectMethod(t))return;if(u==="MemberExpression"){s!==le&&this.raise(c.InvalidPropertyBindingPattern,{at:t});return}if(u==="Identifier"){this.checkIdentifier(t,s,a);let{name:d}=t;i&&(i.has(d)?this.raise(c.ParamDupe,{at:t}):i.add(d));return}let h=this.isValidLVal(u,!(n||(o=t.extra)!=null&&o.parenthesized)&&e.type==="AssignmentExpression",s);if(h===!0)return;if(h===!1){let d=s===le?c.InvalidLhs:c.InvalidLhsBinding;this.raise(d,{at:t,ancestor:e});return}let[l,p]=Array.isArray(h)?h:[h,u==="ParenthesizedExpression"],f=u==="ArrayPattern"||u==="ObjectPattern"||u==="ParenthesizedExpression"?{type:u}:e;for(let d of[].concat(t[l]))d&&this.checkLVal(d,{in:f,binding:s,checkClashes:i,strictModeChanged:a,hasParenthesizedAncestor:p})}checkIdentifier(t,e,s=!1){this.state.strict&&(s?ia(t.name,this.inModule):sa(t.name))&&(e===le?this.raise(c.StrictEvalArguments,{at:t,referenceName:t.name}):this.raise(c.StrictEvalArgumentsBinding,{at:t,bindingName:t.name})),e&Yt&&t.name==="let"&&this.raise(c.LetInLexicalBinding,{at:t}),e&le||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(c.InvalidRestAssignmentPattern,{at:t})}}checkCommaAfterRest(t){return this.match(12)?(this.raise(this.lookaheadCharCode()===t?c.RestTrailingComma:c.ElementAfterRest,{at:this.state.startLoc}),!0):!1}},Xu=(r,t)=>Object.hasOwnProperty.call(r,t)&&r[t];function Ju(r){if(r==null)throw new Error(`Unexpected ${r} value.`);return r}function Vr(r){if(!r)throw new Error("Assert fail")}var g=te`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.`,AccesorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccesorCannotHaveTypeParameters:"An accessor cannot have type parameters.",AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind: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.",MixedLabeledAndUnlabeledElements:"Tuple members must all have names or all not have names.",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.",SetAccesorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccesorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccesorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName: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 Yu(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 Wr(r){return r==="private"||r==="public"||r==="protected"}function Qu(r){return r==="in"||r==="out"}var Zu=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:g.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:g.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:g.InvalidModifierOnTypeParameter})}getScopeHandler(){return Ks}tsIsIdentifier(){return N(this.state.type)}tsTokenCanFollowModifier(){return(this.match(0)||this.match(5)||this.match(55)||this.match(21)||this.match(136)||this.isLiteralPropertyName())&&!this.hasPrecedingLineBreak()}tsNextTokenCanFollowModifier(){return this.next(),this.tsTokenCanFollowModifier()}tsParseModifier(e,s){if(!N(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;let i=this.state.value;if(e.indexOf(i)!==-1){if(s&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return i}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:s,stopOnStartOfClassStaticBlock:i,errorTemplate:a=g.InvalidModifierOnTypeMember},n){let o=(h,l,p,f)=>{l===p&&n[f]&&this.raise(g.InvalidModifiersOrder,{at:h,orderedModifiers:[p,f]})},u=(h,l,p,f)=>{(n[p]&&l===f||n[f]&&l===p)&&this.raise(g.IncompatibleModifiers,{at:h,modifiers:[p,f]})};for(;;){let{startLoc:h}=this.state,l=this.tsParseModifier(e.concat(s??[]),i);if(!l)break;Wr(l)?n.accessibility?this.raise(g.DuplicateAccessibilityModifier,{at:h,modifier:l}):(o(h,l,l,"override"),o(h,l,l,"static"),o(h,l,l,"readonly"),n.accessibility=l):Qu(l)?(n[l]&&this.raise(g.DuplicateModifier,{at:h,modifier:l}),n[l]=!0,o(h,l,"in","out")):(Object.hasOwnProperty.call(n,l)?this.raise(g.DuplicateModifier,{at:h,modifier:l}):(o(h,l,"static","readonly"),o(h,l,"static","override"),o(h,l,"override","readonly"),o(h,l,"abstract","override"),u(h,l,"declare","override"),u(h,l,"static","abstract")),n[l]=!0),s!=null&&s.includes(l)&&this.raise(a,{at:h,modifier:l})}}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 i=[];for(;!this.tsIsListTerminator(e);)i.push(s());return i}tsParseDelimitedList(e,s,i){return Ju(this.tsParseDelimitedListWorker(e,s,!0,i))}tsParseDelimitedListWorker(e,s,i,a){let n=[],o=-1;for(;!this.tsIsListTerminator(e);){o=-1;let u=s();if(u==null)return;if(n.push(u),this.eat(12)){o=this.state.lastTokStart;continue}if(this.tsIsListTerminator(e))break;i&&this.expect(12);return}return a&&(a.value=o),n}tsParseBracketedList(e,s,i,a,n){a||(i?this.expect(0):this.expect(47));let o=this.tsParseDelimitedList(e,s,n);return i?this.expect(3):this.expect(48),o}tsParseImportType(){let e=this.startNode();return this.expect(83),this.expect(10),this.match(131)||this.raise(g.UnsupportedImportTypeArgument,{at:this.state.startLoc}),e.argument=super.parseExprAtom(),this.expect(11),this.eat(16)&&(e.qualifier=this.tsParseEntityName()),this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSImportType")}tsParseEntityName(e=!0){let s=this.parseIdentifier(e);for(;this.eat(16);){let i=this.startNodeAtNode(s);i.left=s,i.right=this.parseIdentifier(e),s=this.finishNode(i,"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(140)?this.next():this.unexpected();let i={value:-1};return s.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,e),!1,!0,i),s.params.length===0&&this.raise(g.EmptyTypeParameters,{at:s}),i.value!==-1&&this.addExtra(s,"trailingComma",i.value),this.finishNode(s,"TSTypeParameterDeclaration")}tsFillSignature(e,s){let i=e===19,a="parameters",n="typeAnnotation";s.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),s[a]=this.tsParseBindingListForSignature(),i?s[n]=this.tsParseTypeOrTypePredicateAnnotation(e):this.match(e)&&(s[n]=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){let e=super.parseBindingList(11,41,2);for(let s of e){let{type:i}=s;(i==="AssignmentPattern"||i==="TSParameterProperty")&&this.raise(g.UnsupportedSignatureParameterKind,{at:s,type:i})}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(),N(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 i=this.tsTryParseTypeAnnotation();return i&&(e.typeAnnotation=i),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSIndexSignature")}tsParsePropertyOrMethodSignature(e,s){this.eat(17)&&(e.optional=!0);let i=e;if(this.match(10)||this.match(47)){s&&this.raise(g.ReadonlyForMethodSignature,{at:e});let a=i;a.kind&&this.match(47)&&this.raise(g.AccesorCannotHaveTypeParameters,{at:this.state.curPosition()}),this.tsFillSignature(14,a),this.tsParseTypeMemberSemicolon();let n="parameters",o="typeAnnotation";if(a.kind==="get")a[n].length>0&&(this.raise(c.BadGetterArity,{at:this.state.curPosition()}),this.isThisParam(a[n][0])&&this.raise(g.AccesorCannotDeclareThisParameter,{at:this.state.curPosition()}));else if(a.kind==="set"){if(a[n].length!==1)this.raise(c.BadSetterArity,{at:this.state.curPosition()});else{let u=a[n][0];this.isThisParam(u)&&this.raise(g.AccesorCannotDeclareThisParameter,{at:this.state.curPosition()}),u.type==="Identifier"&&u.optional&&this.raise(g.SetAccesorCannotHaveOptionalParameter,{at:this.state.curPosition()}),u.type==="RestElement"&&this.raise(g.SetAccesorCannotHaveRestParameter,{at:this.state.curPosition()})}a[o]&&this.raise(g.SetAccesorCannotHaveReturnType,{at:a[o]})}else a.kind="method";return this.finishNode(a,"TSMethodSignature")}else{let a=i;s&&(a.readonly=!0);let n=this.tsTryParseTypeAnnotation();return n&&(a.typeAnnotation=n),this.tsParseTypeMemberSemicolon(),this.finishNode(a,"TSPropertySignature")}}tsParseTypeMember(){let e=this.startNode();if(this.match(10)||this.match(47))return this.tsParseSignatureMember("TSCallSignatureDeclaration",e);if(this.match(77)){let i=this.startNode();return this.next(),this.match(10)||this.match(47)?this.tsParseSignatureMember("TSConstructSignatureDeclaration",e):(e.key=this.createIdentifier(i,"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(120):(this.isContextual(120)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(58)))}tsParseMappedTypeParameter(){let e=this.startNode();return e.name=this.tsParseTypeParameterName(),e.constraint=this.tsExpectThenParseType(58),this.finishNode(e,"TSTypeParameter")}tsParseMappedType(){let e=this.startNode();return this.expect(5),this.match(53)?(e.readonly=this.state.value,this.next(),this.expectContextual(120)):this.eatContextual(120)&&(e.readonly=!0),this.expect(0),e.typeParameter=this.tsParseMappedTypeParameter(),e.nameType=this.eatContextual(93)?this.tsParseType():null,this.expect(3),this.match(53)?(e.optional=this.state.value,this.next(),this.expect(17)):this.eat(17)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(8),this.finishNode(e,"TSMappedType")}tsParseTupleType(){let e=this.startNode();e.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let s=!1,i=null;return e.elementTypes.forEach(a=>{var n;let{type:o}=a;s&&o!=="TSRestType"&&o!=="TSOptionalType"&&!(o==="TSNamedTupleMember"&&a.optional)&&this.raise(g.OptionalTypeBeforeRequired,{at:a}),s||(s=o==="TSNamedTupleMember"&&a.optional||o==="TSOptionalType");let u=o;o==="TSRestType"&&(a=a.typeAnnotation,u=a.type);let h=u==="TSNamedTupleMember";(n=i)!=null||(i=h),i!==h&&this.raise(g.MixedLabeledAndUnlabeledElements,{at:a})}),this.finishNode(e,"TSTupleType")}tsParseTupleElementType(){let{startLoc:e}=this.state,s=this.eat(21),i,a,n,o,h=W(this.state.type)?this.lookaheadCharCode():null;if(h===58)i=!0,n=!1,a=this.parseIdentifier(!0),this.expect(14),o=this.tsParseType();else if(h===63){n=!0;let l=this.state.startLoc,p=this.state.value,f=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(i=!0,a=this.createIdentifier(this.startNodeAt(l),p),this.expect(17),this.expect(14),o=this.tsParseType()):(i=!1,o=f,this.expect(17))}else o=this.tsParseType(),n=this.eat(17),i=this.eat(14);if(i){let l;a?(l=this.startNodeAtNode(a),l.optional=n,l.label=a,l.elementType=o,this.eat(17)&&(l.optional=!0,this.raise(g.TupleOptionalAfterType,{at:this.state.lastTokStartLoc}))):(l=this.startNodeAtNode(o),l.optional=n,this.raise(g.InvalidTupleMemberLabel,{at:o}),l.label=o,l.elementType=this.tsParseType()),o=this.finishNode(l,"TSNamedTupleMember")}else if(n){let l=this.startNodeAtNode(o);l.typeAnnotation=o,o=this.finishNode(l,"TSOptionalType")}if(s){let l=this.startNodeAt(e);l.typeAnnotation=o,o=this.finishNode(l,"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 i=this.startNode();return e==="TSConstructorType"&&(i.abstract=!!s,s&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,i)),this.finishNode(i,e)}tsParseLiteralTypeNode(){let e=this.startNode();switch(this.state.type){case 132:case 133:case 131: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(114)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseNonArrayType(){switch(this.state.type){case 131:case 132:case 133:case 85:case 86:return this.tsParseLiteralTypeNode();case 53:if(this.state.value==="-"){let e=this.startNode(),s=this.lookahead();return s.type!==132&&s.type!==133&&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(N(e)||e===88||e===84){let s=e===88?"TSVoidKeyword":e===84?"TSNullKeyword":Yu(this.state.value);if(s!==void 0&&this.lookaheadCharCode()!==46){let i=this.startNode();return this.next(),this.finishNode(i,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(g.UnexpectedReadonly,{at:e})}}tsParseInferType(){let e=this.startNode();this.expectContextual(113);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 su(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(113)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,s,i){let a=this.startNode(),n=this.eat(i),o=[];do o.push(s());while(this.eat(i));return o.length===1&&!n?o[0]:(a.types=o,this.finishNode(a,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(N(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 i=this.startNode(),a=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(a&&this.match(78)){let u=this.tsParseThisTypeOrThisTypePredicate();return u.type==="TSThisType"?(i.parameterName=u,i.asserts=!0,i.typeAnnotation=null,u=this.finishNode(i,"TSTypePredicate")):(this.resetStartLocationFromNode(u,i),u.asserts=!0),s.typeAnnotation=u,this.finishNode(s,"TSTypeAnnotation")}let n=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!n)return a?(i.parameterName=this.parseIdentifier(),i.asserts=a,i.typeAnnotation=null,s.typeAnnotation=this.finishNode(i,"TSTypePredicate"),this.finishNode(s,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,s);let o=this.tsParseTypeAnnotation(!1);return i.parameterName=n,i.typeAnnotation=o,i.asserts=a,s.typeAnnotation=this.finishNode(i,"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(114)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(this.state.type!==107)return!1;let e=this.state.containsEsc;return this.next(),!N(this.state.type)&&!this.match(78)?!1:(e&&this.raise(c.InvalidEscapedReservedWord,{at: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(){Vr(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(122)&&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(g.ReservedTypeAssertion,{at:this.state.startLoc});let e=this.startNode();return e.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?this.tsParseTypeReference():this.tsParseType())),this.expect(48),e.expression=this.parseMaybeUnary(),this.finishNode(e,"TSTypeAssertion")}tsParseHeritageClause(e){let s=this.state.startLoc,i=this.tsParseDelimitedList("HeritageClauseElement",()=>{let a=this.startNode();return a.expression=this.tsParseEntityName(),this.match(47)&&(a.typeParameters=this.tsParseTypeArguments()),this.finishNode(a,"TSExpressionWithTypeArguments")});return i.length||this.raise(g.EmptyHeritageClauseType,{at:s,token:e}),i}tsParseInterfaceDeclaration(e,s={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(127),s.declare&&(e.declare=!0),N(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,yu)):(e.id=null,this.raise(g.MissingInterfaceName,{at:this.state.startLoc})),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81)&&(e.extends=this.tsParseHeritageClause("extends"));let i=this.startNode();return i.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(i,"TSInterfaceBody"),this.finishNode(e,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(e){return e.id=this.parseIdentifier(),this.checkIdentifier(e.id,xu),e.typeAnnotation=this.tsInType(()=>{if(e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(29),this.isContextual(112)&&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(131)?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(124),e.id=this.parseIdentifier(),this.checkIdentifier(e.id,e.const?bu:la),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(Le),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,Pu),this.eat(16)){let i=this.startNode();this.tsParseModuleOrNamespaceDeclaration(i,!0),e.body=i}else this.scope.enter(Be),this.prodParam.enter(Re),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit();return this.finishNode(e,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(e){return this.isContextual(110)?(e.global=!0,e.id=this.parseIdentifier()):this.match(131)?e.id=super.parseStringLiteral(this.state.value):this.unexpected(),this.match(5)?(this.scope.enter(Be),this.prodParam.enter(Re),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit()):this.semicolon(),this.finishNode(e,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(e,s,i){e.isExport=i||!1,e.id=s||this.parseIdentifier(),this.checkIdentifier(e.id,at),this.expect(29);let a=this.tsParseModuleReference();return e.importKind==="type"&&a.type!=="TSExternalModuleReference"&&this.raise(g.ImportAliasHasImportType,{at:a}),e.moduleReference=a,this.semicolon(),this.finishNode(e,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(117)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)}tsParseExternalModuleReference(){let e=this.startNode();return this.expectContextual(117),this.expect(10),this.match(131)||this.unexpected(),e.expression=super.parseExprAtom(),this.expect(11),this.sawUnambiguousESM=!0,this.finishNode(e,"TSExternalModuleReference")}tsLookAhead(e){let s=this.state.clone(),i=e();return this.state=s,i}tsTryParseAndCatch(e){let s=this.tryParse(i=>e()||i());if(!(s.aborted||!s.node))return s.error&&(this.state=s.failState),s.node}tsTryParse(e){let s=this.state.clone(),i=e();if(i!==void 0&&i!==!1)return i;this.state=s}tsTryParseDeclare(e){if(this.isLineTerminator())return;let s=this.state.type,i;return this.isContextual(99)&&(s=74,i="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 124:return this.tsParseEnumDeclaration(e,{declare:!0});case 110:return this.tsParseAmbientExternalModuleDeclaration(e);case 75:case 74:return!this.match(75)||!this.isLookaheadContextual("enum")?(e.declare=!0,this.parseVarStatement(e,i||this.state.value,!0)):(this.expect(75),this.tsParseEnumDeclaration(e,{const:!0,declare:!0}));case 127:{let a=this.tsParseInterfaceDeclaration(e,{declare:!0});if(a)return a}default:if(N(s))return this.tsParseDeclaration(e,this.state.value,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.value,!0,null)}tsParseExpressionStatement(e,s,i){switch(s.name){case"declare":{let a=this.tsTryParseDeclare(e);return a&&(a.declare=!0),a}case"global":if(this.match(5)){this.scope.enter(Be),this.prodParam.enter(Re);let a=e;return a.global=!0,a.id=s,a.body=this.tsParseModuleBlock(),this.scope.exit(),this.prodParam.exit(),this.finishNode(a,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(e,s.name,!1,i)}}tsParseDeclaration(e,s,i,a){switch(s){case"abstract":if(this.tsCheckLineTerminator(i)&&(this.match(80)||N(this.state.type)))return this.tsParseAbstractDeclaration(e,a);break;case"module":if(this.tsCheckLineTerminator(i)){if(this.match(131))return this.tsParseAmbientExternalModuleDeclaration(e);if(N(this.state.type))return this.tsParseModuleOrNamespaceDeclaration(e)}break;case"namespace":if(this.tsCheckLineTerminator(i)&&N(this.state.type))return this.tsParseModuleOrNamespaceDeclaration(e);break;case"type":if(this.tsCheckLineTerminator(i)&&N(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 i=this.tsTryParseAndCatch(()=>{let a=this.startNodeAt(e);return a.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(a),a.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(19),a});if(this.state.maybeInArrowParameters=s,!!i)return super.parseArrowExpression(i,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(g.EmptyTypeArguments,{at:e}):!this.state.inType&&this.curContext()===k.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return iu(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseAssignableListItem(e,s){let i=this.state.startLoc,a={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},a);let n=a.accessibility,o=a.override,u=a.readonly;!(e&4)&&(n||u||o)&&this.raise(g.UnexpectedParameterModifier,{at:i});let h=this.parseMaybeDefault();this.parseAssignableListItemTypes(h,e);let l=this.parseMaybeDefault(h.loc.start,h);if(n||u||o){let p=this.startNodeAt(i);return s.length&&(p.decorators=s),n&&(p.accessibility=n),u&&(p.readonly=u),o&&(p.override=o),l.type!=="Identifier"&&l.type!=="AssignmentPattern"&&this.raise(g.UnsupportedParameterPropertyKind,{at:p}),p.parameter=l,this.finishNode(p,"TSParameterProperty")}return s.length&&(h.decorators=s),l}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(g.PatternIsOptional,{at:s})}setArrowFunctionParameters(e,s,i){super.setArrowFunctionParameters(e,s,i),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,s,i=!1){this.match(14)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(14));let a=s==="FunctionDeclaration"?"TSDeclareFunction":s==="ClassMethod"||s==="ClassPrivateMethod"?"TSDeclareMethod":void 0;return a&&!this.match(5)&&this.isLineTerminator()?this.finishNode(e,a):a==="TSDeclareFunction"&&this.state.isAmbientContext&&(this.raise(g.DeclareFunctionHasImplementation,{at:e}),e.declare)?super.parseFunctionBodyAndFinish(e,a,i):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,s,i))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,Fr):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(s=>{(s==null?void 0:s.type)==="TSTypeCastExpression"&&this.raise(g.UnexpectedTypeAnnotation,{at:s.typeAnnotation})})}toReferencedList(e,s){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,s,i,a){let n=super.parseArrayLike(e,s,i,a);return n.type==="ArrayExpression"&&this.tsCheckForInvalidTypeCasts(n.elements),n}parseSubscript(e,s,i,a){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 n=!1;if(this.match(18)&&this.lookaheadCharCode()===60){if(i)return a.stop=!0,e;a.optionalChainMember=n=!0,this.next()}if(this.match(47)||this.match(51)){let o,u=this.tsTryParseAndCatch(()=>{if(!i&&this.atPossibleAsyncArrow(e)){let f=this.tsTryParseGenericAsyncArrowFunction(s);if(f)return f}let h=this.tsParseTypeArgumentsInExpression();if(!h)return;if(n&&!this.match(10)){o=this.state.curPosition();return}if(Vt(this.state.type)){let f=super.parseTaggedTemplateExpression(e,s,a);return f.typeParameters=h,f}if(!i&&this.eat(10)){let f=this.startNodeAt(s);return f.callee=e,f.arguments=this.parseCallExpressionArguments(11,!1),this.tsCheckForInvalidTypeCasts(f.arguments),f.typeParameters=h,a.optionalChainMember&&(f.optional=n),this.finishCallExpression(f,a.optionalChainMember)}let l=this.state.type;if(l===48||l===52||l!==10&&Ns(l)&&!this.hasPrecedingLineBreak())return;let p=this.startNodeAt(s);return p.expression=e,p.typeParameters=h,this.finishNode(p,"TSInstantiationExpression")});if(o&&this.unexpected(o,10),u)return u.type==="TSInstantiationExpression"&&(this.match(16)||this.match(18)&&this.lookaheadCharCode()!==40)&&this.raise(g.InvalidPropertyAccessAfterInstantiationExpression,{at:this.state.startLoc}),u}return super.parseSubscript(e,s,i,a)}parseNewCallee(e){var s;super.parseNewCallee(e);let{callee:i}=e;i.type==="TSInstantiationExpression"&&!((s=i.extra)!=null&&s.parenthesized)&&(e.typeParameters=i.typeParameters,e.callee=i.expression)}parseExprOp(e,s,i){let a;if(Ft(58)>i&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(a=this.isContextual(118)))){let n=this.startNodeAt(s);return n.expression=e,n.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?(a&&this.raise(c.UnexpectedKeyword,{at:this.state.startLoc,keyword:"const"}),this.tsParseTypeReference()):this.tsParseType())),this.finishNode(n,a?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(n,s,i)}return super.parseExprOp(e,s,i)}checkReservedWord(e,s,i,a){this.state.isAmbientContext||super.checkReservedWord(e,s,i,a)}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(g.ImportReflectionHasImportType,{at:e.specifiers[0].loc.start})}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(128)){let s=this.lookaheadCharCode();return e?s===123||s===42:s!==61}return!e&&this.isContextual(87)}applyImportPhase(e,s,i,a){super.applyImportPhase(e,s,i,a),s?e.exportKind=i==="type"?"type":"value":e.importKind=i==="type"||i==="typeof"?i:"value"}parseImport(e){if(this.match(131))return e.importKind="value",super.parseImport(e);let s;if(N(this.state.type)&&this.lookaheadCharCode()===61)return e.importKind="value",this.tsParseImportEqualsDeclaration(e);if(this.isContextual(128)){let i=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.tsParseImportEqualsDeclaration(e,i);s=super.parseImportSpecifiersAndAfter(e,i)}else s=super.parseImport(e);return s.importKind==="type"&&s.specifiers.length>1&&s.specifiers[0].type==="ImportDefaultSpecifier"&&this.raise(g.TypeImportCannotSpecifyDefaultAndNamed,{at:s}),s}parseExport(e,s){if(this.match(83)){this.next();let i=null;return this.isContextual(128)&&this.isPotentialImportPhase(!1)?i=this.parseMaybeImportPhase(e,!1):e.importKind="value",this.tsParseImportEqualsDeclaration(e,i,!0)}else if(this.eat(29)){let i=e;return i.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(i,"TSExportAssignment")}else if(this.eatContextual(93)){let i=e;return this.expectContextual(126),i.id=this.parseIdentifier(),this.semicolon(),this.finishNode(i,"TSNamespaceExportDeclaration")}else return super.parseExport(e,s)}isAbstractClass(){return this.isContextual(122)&&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(127)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultExpression()}parseVarStatement(e,s,i=!1){let{isAmbientContext:a}=this.state,n=super.parseVarStatement(e,s,i||a);if(!a)return n;for(let{id:o,init:u}of n.declarations)u&&(s!=="const"||o.typeAnnotation?this.raise(g.InitializerNotAllowedInAmbientContext,{at:u}):th(u,this.hasPlugin("estree"))||this.raise(g.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference,{at:u}));return n}parseStatementContent(e,s){if(this.match(75)&&this.isLookaheadContextual("enum")){let i=this.startNode();return this.expect(75),this.tsParseEnumDeclaration(i,{const:!0})}if(this.isContextual(124))return this.tsParseEnumDeclaration(this.startNode());if(this.isContextual(127)){let i=this.tsParseInterfaceDeclaration(this.startNode());if(i)return i}return super.parseStatementContent(e,s)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(e,s){return s.some(i=>Wr(i)?e.accessibility===i:!!e[i])}tsIsStartOfStaticBlocks(){return this.isContextual(104)&&this.lookaheadCharCode()===123}parseClassMember(e,s,i){let a=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:a,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:g.InvalidModifierOnTypeParameterPositions},s);let n=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(s,a)&&this.raise(g.StaticBlockCannotHaveModifier,{at:this.state.curPosition()}),super.parseClassStaticBlock(e,s)):this.parseClassMemberWithIsStatic(e,s,i,!!s.static)};s.declare?this.tsInAmbientContext(n):n()}parseClassMemberWithIsStatic(e,s,i,a){let n=this.tsTryParseIndexSignature(s);if(n){e.body.push(n),s.abstract&&this.raise(g.IndexSignatureHasAbstract,{at:s}),s.accessibility&&this.raise(g.IndexSignatureHasAccessibility,{at:s,modifier:s.accessibility}),s.declare&&this.raise(g.IndexSignatureHasDeclare,{at:s}),s.override&&this.raise(g.IndexSignatureHasOverride,{at:s});return}!this.state.inAbstractClass&&s.abstract&&this.raise(g.NonAbstractClassHasAbstractMethod,{at:s}),s.override&&(i.hadSuperClass||this.raise(g.OverrideNotInSubClass,{at:s})),super.parseClassMemberWithIsStatic(e,s,i,a)}parsePostMemberNameModifiers(e){this.eat(17)&&(e.optional=!0),e.readonly&&this.match(10)&&this.raise(g.ClassMethodHasReadonly,{at:e}),e.declare&&this.match(10)&&this.raise(g.ClassMethodHasDeclare,{at:e})}parseExpressionStatement(e,s,i){return(s.type==="Identifier"?this.tsParseExpressionStatement(e,s,i):void 0)||super.parseExpressionStatement(e,s,i)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(e,s,i){if(!this.state.maybeInArrowParameters||!this.match(17))return super.parseConditional(e,s,i);let a=this.tryParse(()=>super.parseConditional(e,s));return a.node?(a.error&&(this.state=a.failState),a.node):(a.error&&super.setOptionalParametersError(i,a.error),e)}parseParenItem(e,s){if(e=super.parseParenItem(e,s),this.eat(17)&&(e.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(123))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));let s=this.state.startLoc,i=this.eatContextual(123);if(i&&(this.isContextual(123)||!this.shouldParseExportDeclaration()))throw this.raise(g.ExpectedAmbientAfterExportDeclare,{at:this.state.startLoc});let n=N(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return n?((n.type==="TSInterfaceDeclaration"||n.type==="TSTypeAliasDeclaration"||i)&&(e.exportKind="type"),i&&(this.resetStartLocation(n,s),n.declare=!0),n):null}parseClassId(e,s,i,a){if((!s||i)&&this.isContextual(111))return;super.parseClassId(e,s,i,e.declare?Fr:ua);let n=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);n&&(e.typeParameters=n)}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(g.DeclareClassFieldHasInitializer,{at:this.state.startLoc}),e.abstract&&this.match(29)){let{key:s}=e;this.raise(g.AbstractPropertyHasInitializer,{at: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(g.PrivateElementHasAbstract,{at:e}),e.accessibility&&this.raise(g.PrivateElementHasAccessibility,{at:e,modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(g.AccessorCannotBeOptional,{at:e}),super.parseClassAccessorProperty(e)}pushClassMethod(e,s,i,a,n,o){let u=this.tsTryParseTypeParameters(this.tsParseConstModifier);u&&n&&this.raise(g.ConstructorHasTypeParameters,{at:u});let{declare:h=!1,kind:l}=s;h&&(l==="get"||l==="set")&&this.raise(g.DeclareAccessor,{at:s,kind:l}),u&&(s.typeParameters=u),super.pushClassMethod(e,s,i,a,n,o)}pushClassPrivateMethod(e,s,i,a){let n=this.tsTryParseTypeParameters(this.tsParseConstModifier);n&&(s.typeParameters=n),super.pushClassPrivateMethod(e,s,i,a)}declareClassPrivateMethodInScope(e,s){e.type!=="TSDeclareMethod"&&(e.type==="MethodDefinition"&&!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(111)&&(e.implements=this.tsParseHeritageClause("implements"))}parseObjPropValue(e,s,i,a,n,o,u){let h=this.tsTryParseTypeParameters(this.tsParseConstModifier);return h&&(e.typeParameters=h),super.parseObjPropValue(e,s,i,a,n,o,u)}parseFunctionParams(e,s){let i=this.tsTryParseTypeParameters(this.tsParseConstModifier);i&&(e.typeParameters=i),super.parseFunctionParams(e,s)}parseVarId(e,s){super.parseVarId(e,s),e.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(35)&&(e.definite=!0);let i=this.tsTryParseTypeAnnotation();i&&(e.id.typeAnnotation=i,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,s){return this.match(14)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,s)}parseMaybeAssign(e,s){var i,a,n,o,u;let h,l,p;if(this.hasPlugin("jsx")&&(this.match(140)||this.match(47))){if(h=this.state.clone(),l=this.tryParse(()=>super.parseMaybeAssign(e,s),h),!l.error)return l.node;let{context:m}=this.state,y=m[m.length-1];(y===k.j_oTag||y===k.j_expr)&&m.pop()}if(!((i=l)!=null&&i.error)&&!this.match(47))return super.parseMaybeAssign(e,s);(!h||h===this.state)&&(h=this.state.clone());let f,d=this.tryParse(m=>{var y,P;f=this.tsParseTypeParameters(this.tsParseConstModifier);let S=super.parseMaybeAssign(e,s);return(S.type!=="ArrowFunctionExpression"||(y=S.extra)!=null&&y.parenthesized)&&m(),((P=f)==null?void 0:P.params.length)!==0&&this.resetStartLocationFromNode(S,f),S.typeParameters=f,S},h);if(!d.error&&!d.aborted)return f&&this.reportReservedArrowTypeParam(f),d.node;if(!l&&(Vr(!this.hasPlugin("jsx")),p=this.tryParse(()=>super.parseMaybeAssign(e,s),h),!p.error))return p.node;if((a=l)!=null&&a.node)return this.state=l.failState,l.node;if(d.node)return this.state=d.failState,f&&this.reportReservedArrowTypeParam(f),d.node;if((n=p)!=null&&n.node)return this.state=p.failState,p.node;throw((o=l)==null?void 0:o.error)||d.error||((u=p)==null?void 0:u.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(g.ReservedArrowTypeParam,{at: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(i=>{let a=this.tsParseTypeOrTypePredicateAnnotation(14);return(this.canInsertSemicolon()||!this.match(19))&&i(),a});if(s.aborted)return;s.thrown||(s.error&&(this.state=s.failState),e.returnType=s.node)}return super.parseArrow(e)}parseAssignableListItemTypes(e,s){if(!(s&2))return e;this.eat(17)&&(e.optional=!0);let i=this.tsTryParseTypeAnnotation();return i&&(e.typeAnnotation=i),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(g.UnexpectedTypeCastInParameter,{at:e}):this.raise(g.UnexpectedTypeCastInParameter,{at: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,i){return Xu({TSTypeCastExpression:!0,TSParameterProperty:"parameter",TSNonNullExpression:"expression",TSAsExpression:(i!==le||!s)&&["expression",!0],TSSatisfiesExpression:(i!==le||!s)&&["expression",!0],TSTypeAssertion:(i!==le||!s)&&["expression",!0]},e)||super.isValidLVal(e,s,i)}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 i=super.parseMaybeDecoratorArguments(e);return i.typeParameters=s,i}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 i=super.parseMaybeDefault(e,s);return i.type==="AssignmentPattern"&&i.typeAnnotation&&i.right.start<i.typeAnnotation.start&&this.raise(g.TypeAnnotationAfterAssign,{at:i.typeAnnotation}),i}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,i){for(let a=0;a<e.length;a++){let n=e[a];(n==null?void 0:n.type)==="TSTypeCastExpression"&&(e[a]=this.typeCastToParameter(n))}super.toAssignableList(e,s,i)}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),a=this.getObjectOrClassMethodParams(e)[0];return a&&this.isThisParam(a)?s+1:s}parseCatchClauseParam(){let e=super.parseCatchClauseParam(),s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s,this.resetEndLocation(e)),e}tsInAmbientContext(e){let s=this.state.isAmbientContext;this.state.isAmbientContext=!0;try{return e()}finally{this.state.isAmbientContext=s}}parseClass(e,s,i){let a=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,s,i)}finally{this.state.inAbstractClass=a}}tsParseAbstractDeclaration(e,s){if(this.match(80))return e.abstract=!0,this.maybeTakeDecorators(s,this.parseClass(e,!0,!1));if(this.isContextual(127)){if(!this.hasFollowingLineBreak())return e.abstract=!0,this.raise(g.NonClassMethodPropertyHasAbstractModifer,{at:e}),this.tsParseInterfaceDeclaration(e)}else this.unexpected(null,80)}parseMethod(e,s,i,a,n,o,u){let h=super.parseMethod(e,s,i,a,n,o,u);if(h.abstract&&(this.hasPlugin("estree")?!!h.value.body:!!h.body)){let{key:p}=h;this.raise(g.AbstractMethodHasImplementation,{at:h,methodName:p.type==="Identifier"&&!h.computed?p.name:`[${this.input.slice(p.start,p.end)}]`})}return h}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,i,a){return!s&&a?(this.parseTypeOnlyImportExportSpecifier(e,!1,i),this.finishNode(e,"ExportSpecifier")):(e.exportKind="value",super.parseExportSpecifier(e,s,i,a))}parseImportSpecifier(e,s,i,a,n){return!s&&a?(this.parseTypeOnlyImportExportSpecifier(e,!0,i),this.finishNode(e,"ImportSpecifier")):(e.importKind="value",super.parseImportSpecifier(e,s,i,a,i?Rr:at))}parseTypeOnlyImportExportSpecifier(e,s,i){let a=s?"imported":"local",n=s?"local":"exported",o=e[a],u,h=!1,l=!0,p=o.loc.start;if(this.isContextual(93)){let d=this.parseIdentifier();if(this.isContextual(93)){let m=this.parseIdentifier();W(this.state.type)?(h=!0,o=d,u=s?this.parseIdentifier():this.parseModuleExportName(),l=!1):(u=m,l=!1)}else W(this.state.type)?(l=!1,u=s?this.parseIdentifier():this.parseModuleExportName()):(h=!0,o=d)}else W(this.state.type)&&(h=!0,s?(o=this.parseIdentifier(!0),this.isContextual(93)||this.checkReservedWord(o.name,o.loc.start,!0,!0)):o=this.parseModuleExportName());h&&i&&this.raise(s?g.TypeModifierIsUsedInTypeImports:g.TypeModifierIsUsedInTypeExports,{at:p}),e[a]=o,e[n]=u;let f=s?"importKind":"exportKind";e[f]=h?"type":"value",l&&this.eatContextual(93)&&(e[n]=s?this.parseIdentifier():this.parseModuleExportName()),e[n]||(e[n]=ie(e[a])),s&&this.checkIdentifier(e[n],h?Rr:at)}};function eh(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:Aa(r.object)}function th(r,t){var e;let{type:s}=r;if((e=r.extra)!=null&&e.parenthesized)return!1;if(t){if(s==="Literal"){let{value:i}=r;if(typeof i=="string"||typeof i=="boolean")return!0}}else if(s==="StringLiteral"||s==="BooleanLiteral")return!0;return!!(Ta(r,t)||sh(r,t)||s==="TemplateLiteral"&&r.expressions.length===0||eh(r))}function Ta(r,t){return t?r.type==="Literal"&&(typeof r.value=="number"||"bigint"in r):r.type==="NumericLiteral"||r.type==="BigIntLiteral"}function sh(r,t){if(r.type==="UnaryExpression"){let{operator:e,argument:s}=r;if(e==="-"&&Ta(s,t))return!0}return!1}function Aa(r){return r.type==="Identifier"?!0:r.type!=="MemberExpression"||r.computed?!1:Aa(r.object)}var zr=te`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."}),ih=r=>class extends r{parsePlaceholder(e){if(this.match(142)){let s=this.startNode();return this.next(),this.assertNoSpace(),s.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(142),this.finishPlaceholder(s,e)}}finishPlaceholder(e,s){let i=!!(e.expectedNode&&e.type==="Placeholder");return e.expectedNode=s,i?e:this.finishNode(e,"Placeholder")}getTokenFromCode(e){e===37&&this.input.charCodeAt(this.state.pos+1)===37?this.finishOp(142,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,i,a){e!==void 0&&super.checkReservedWord(e,s,i,a)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(e,s,i){return e==="Placeholder"||super.isValidLVal(e,s,i)}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===142)}verifyBreakContinue(e,s){e.label&&e.label.type==="Placeholder"||super.verifyBreakContinue(e,s)}parseExpressionStatement(e,s){if(s.type!=="Placeholder"||s.extra&&s.extra.parenthesized)return super.parseExpressionStatement(e,s);if(this.match(14)){let i=e;return i.label=this.finishPlaceholder(s,"Identifier"),this.next(),i.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(i,"LabeledStatement")}return this.semicolon(),e.name=s.name,this.finishPlaceholder(e,"Statement")}parseBlock(e,s,i){return this.parsePlaceholder("BlockStatement")||super.parseBlock(e,s,i)}parseFunctionId(e){return this.parsePlaceholder("Identifier")||super.parseFunctionId(e)}parseClass(e,s,i){let a=s?"ClassDeclaration":"ClassExpression";this.next();let n=this.state.strict,o=this.parsePlaceholder("Identifier");if(o)if(this.match(81)||this.match(142)||this.match(5))e.id=o;else{if(i||!s)return e.id=null,e.body=this.finishPlaceholder(o,"ClassBody"),this.finishNode(e,a);throw this.raise(zr.ClassNameIsRequired,{at:this.state.startLoc})}else this.parseClassId(e,s,i);return super.parseClassSuper(e),e.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!e.superClass,n),this.finishNode(e,a)}parseExport(e,s){let i=this.parsePlaceholder("Identifier");if(!i)return super.parseExport(e,s);if(!this.isContextual(97)&&!this.match(12))return e.specifiers=[],e.source=null,e.declaration=this.finishPlaceholder(i,"Declaration"),this.finishNode(e,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");let a=this.startNode();return a.exported=i,e.specifiers=[this.finishNode(a,"ExportDefaultSpecifier")],super.parseExport(e,s)}isExportDefaultSpecifier(){if(this.match(65)){let e=this.nextTokenStart();if(this.isUnparsedContextual(e,"from")&&this.input.startsWith(ce(142),this.nextTokenStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,s){var i;return(i=e.specifiers)!=null&&i.length?!0:super.maybeParseExportDefaultSpecifier(e,s)}checkExport(e){let{specifiers:s}=e;s!=null&&s.length&&(e.specifiers=s.filter(i=>i.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(97)&&!this.match(12))return e.source=this.finishPlaceholder(s,"StringLiteral"),this.semicolon(),this.finishNode(e,"ImportDeclaration");let i=this.startNodeAtNode(s);return i.local=s,e.specifiers.push(this.finishNode(i,"ImportDefaultSpecifier")),this.eat(12)&&(this.maybeParseStarImportSpecifier(e)||this.parseNamedImportSpecifiers(e)),this.expectContextual(97),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(zr.UnexpectedSpace,{at:this.state.lastTokEndLoc})}},rh=r=>class extends r{parseV8Intrinsic(){if(this.match(54)){let e=this.state.startLoc,s=this.startNode();if(this.next(),N(this.state.type)){let i=this.parseIdentifierName(),a=this.createIdentifier(s,i);if(a.type="V8IntrinsicIdentifier",this.match(10))return a}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}};function O(r,t){let[e,s]=typeof t=="string"?[t,{}]:t,i=Object.keys(s),a=i.length===0;return r.some(n=>{if(typeof n=="string")return a&&n===e;{let[o,u]=n;if(o!==e)return!1;for(let h of i)if(u[h]!==s[h])return!1;return!0}})}function be(r,t,e){let s=r.find(i=>Array.isArray(i)?i[0]===t:i===t);return s&&Array.isArray(s)&&s.length>1?s[1][e]:null}var Hr=["minimal","fsharp","hack","smart"],Kr=["^^","@@","^","%","#"],Gr=["hash","bar"];function ah(r){if(O(r,"decorators")){if(O(r,"decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");let t=be(r,"decorators","decoratorsBeforeExport");if(t!=null&&typeof t!="boolean")throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");let e=be(r,"decorators","allowCallParenthesized");if(e!=null&&typeof e!="boolean")throw new Error("'allowCallParenthesized' must be a boolean.")}if(O(r,"flow")&&O(r,"typescript"))throw new Error("Cannot combine flow and typescript plugins.");if(O(r,"placeholders")&&O(r,"v8intrinsic"))throw new Error("Cannot combine placeholders and v8intrinsic plugins.");if(O(r,"pipelineOperator")){let t=be(r,"pipelineOperator","proposal");if(!Hr.includes(t)){let s=Hr.map(i=>`"${i}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${s}.`)}let e=O(r,["recordAndTuple",{syntaxType:"hash"}]);if(t==="hack"){if(O(r,"placeholders"))throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");if(O(r,"v8intrinsic"))throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");let s=be(r,"pipelineOperator","topicToken");if(!Kr.includes(s)){let i=Kr.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(s==="#"&&e)throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "hack", topicToken: "#" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.')}else if(t==="smart"&&e)throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "smart" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.')}if(O(r,"moduleAttributes")){if(O(r,"importAssertions")||O(r,"importAttributes"))throw new Error("Cannot combine importAssertions, importAttributes and moduleAttributes plugins.");if(be(r,"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(O(r,"importAssertions")&&O(r,"importAttributes"))throw new Error("Cannot combine importAssertions and importAttributes plugins.");if(O(r,"recordAndTuple")&&be(r,"recordAndTuple","syntaxType")!=null&&!Gr.includes(be(r,"recordAndTuple","syntaxType")))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+Gr.map(t=>`'${t}'`).join(", "));if(O(r,"asyncDoExpressions")&&!O(r,"doExpressions")){let t=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw t.missingPlugins="doExpressions",t}}var Sa={estree:Ho,jsx:Ku,flow:zu,typescript:Zu,v8intrinsic:rh,placeholders:ih},nh=Object.keys(Sa),Xr={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,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0};function oh(r){if(r&&r.annexB!=null&&r.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");let t={};for(let e of Object.keys(Xr))t[e]=r&&r[e]!=null?r[e]:Xr[e];return t}var Xs=class extends Gs{checkProto(t,e,s,i){if(t.type==="SpreadElement"||this.isObjectMethod(t)||t.computed||t.shorthand)return;let a=t.key;if((a.type==="Identifier"?a.name:a.value)==="__proto__"){if(e){this.raise(c.RecordNoProto,{at:a});return}s.used&&(i?i.doubleProtoLoc===null&&(i.doubleProtoLoc=a.loc.start):this.raise(c.DuplicateProto,{at:a})),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(137)||this.unexpected(),this.finalizeRemainingComments(),t.comments=this.state.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 i=this.startNodeAt(e);for(i.expressions=[s];this.eat(12);)i.expressions.push(this.parseMaybeAssign(t));return this.toReferencedList(i.expressions),this.finishNode(i,"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==null?void 0:e.loc)!=null?s:this.state.startLoc}parseMaybeAssign(t,e){let s=this.state.startLoc;if(this.isContextual(106)&&this.prodParam.hasYield){let o=this.parseYield();return e&&(o=e.call(this,o,s)),o}let i;t?i=!1:(t=new Ue,i=!0);let{type:a}=this.state;(a===10||N(a))&&(this.state.potentialArrowAt=this.state.start);let n=this.parseMaybeConditional(t);if(e&&(n=e.call(this,n,s)),Yo(this.state.type)){let o=this.startNodeAt(s),u=this.state.value;if(o.operator=u,this.match(29)){this.toAssignable(n,!0),o.left=n;let h=s.index;t.doubleProtoLoc!=null&&t.doubleProtoLoc.index>=h&&(t.doubleProtoLoc=null),t.shorthandAssignLoc!=null&&t.shorthandAssignLoc.index>=h&&(t.shorthandAssignLoc=null),t.privateKeyLoc!=null&&t.privateKeyLoc.index>=h&&(this.checkDestructuringPrivate(t),t.privateKeyLoc=null)}else o.left=n;return this.next(),o.right=this.parseMaybeAssign(),this.checkLVal(n,{in:this.finishNode(o,"AssignmentExpression")}),o}else i&&this.checkExpressionErrors(t,!0);return n}parseMaybeConditional(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,i=this.parseExprOps(t);return this.shouldExitDescending(i,s)?i:this.parseConditional(i,e,t)}parseConditional(t,e,s){if(this.eat(17)){let i=this.startNodeAt(e);return i.test=t,i.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),i.alternate=this.parseMaybeAssign(),this.finishNode(i,"ConditionalExpression")}return t}parseMaybeUnaryOrPrivate(t){return this.match(136)?this.parsePrivateName():this.parseMaybeUnary(t)}parseExprOps(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,i=this.parseMaybeUnaryOrPrivate(t);return this.shouldExitDescending(i,s)?i:this.parseExprOp(i,e,-1)}parseExprOp(t,e,s){if(this.isPrivateName(t)){let a=this.getPrivateNameSV(t);(s>=Ft(58)||!this.prodParam.hasIn||!this.match(58))&&this.raise(c.PrivateInExpectedIn,{at:t,identifierName:a}),this.classScope.usePrivateName(a,t.loc.start)}let i=this.state.type;if(Zo(i)&&(this.prodParam.hasIn||!this.match(58))){let a=Ft(i);if(a>s){if(i===39){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return t;this.checkPipelineAtInfixOperator(t,e)}let n=this.startNodeAt(e);n.left=t,n.operator=this.state.value;let o=i===41||i===42,u=i===40;if(u&&(a=Ft(42)),this.next(),i===39&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])&&this.state.type===96&&this.prodParam.hasAwait)throw this.raise(c.UnexpectedAwaitAfterPipelineBody,{at:this.state.startLoc});n.right=this.parseExprOpRightExpr(i,a);let h=this.finishNode(n,o||u?"LogicalExpression":"BinaryExpression"),l=this.state.type;if(u&&(l===41||l===42)||o&&l===40)throw this.raise(c.MixingCoalesceWithLogical,{at:this.state.startLoc});return this.parseExprOp(h,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(106))throw this.raise(c.PipeBodyIsTighter,{at: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,ru(t)?e-1:e)}parseHackPipeBody(){var t;let{startLoc:e}=this.state,s=this.parseMaybeAssign();return jo.has(s.type)&&!((t=s.extra)!=null&&t.parenthesized)&&this.raise(c.PipeUnparenthesizedBody,{at:e,type:s.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(c.PipeTopicUnused,{at:e}),s}checkExponentialAfterUnary(t){this.match(57)&&this.raise(c.UnexpectedTokenUnaryExponentiation,{at:t.argument})}parseMaybeUnary(t,e){let s=this.state.startLoc,i=this.isContextual(96);if(i&&this.isAwaitAllowed()){this.next();let u=this.parseAwait(s);return e||this.checkExponentialAfterUnary(u),u}let a=this.match(34),n=this.startNode();if(tu(this.state.type)){n.operator=this.state.value,n.prefix=!0,this.match(72)&&this.expectPlugin("throwExpressions");let u=this.match(89);if(this.next(),n.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),this.state.strict&&u){let h=n.argument;h.type==="Identifier"?this.raise(c.StrictDelete,{at:n}):this.hasPropertyAsPrivateName(h)&&this.raise(c.DeletePrivateField,{at:n})}if(!a)return e||this.checkExponentialAfterUnary(n),this.finishNode(n,"UnaryExpression")}let o=this.parseUpdate(n,a,t);if(i){let{type:u}=this.state;if((this.hasPlugin("v8intrinsic")?Ns(u):Ns(u)&&!this.match(54))&&!this.isAmbiguousAwait())return this.raiseOverwrite(c.AwaitNotInAsyncContext,{at:s}),this.parseAwait(s)}return o}parseUpdate(t,e,s){if(e){let n=t;return this.checkLVal(n.argument,{in:this.finishNode(n,"UpdateExpression")}),t}let i=this.state.startLoc,a=this.parseExprSubscripts(s);if(this.checkExpressionErrors(s,!1))return a;for(;eu(this.state.type)&&!this.canInsertSemicolon();){let n=this.startNodeAt(i);n.operator=this.state.value,n.prefix=!1,n.argument=a,this.next(),this.checkLVal(a,{in:a=this.finishNode(n,"UpdateExpression")})}return a}parseExprSubscripts(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,i=this.parseExprAtom(t);return this.shouldExitDescending(i,s)?i:this.parseSubscripts(i,e)}parseSubscripts(t,e,s){let i={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(t),stop:!1};do t=this.parseSubscript(t,e,s,i),i.maybeAsyncArrow=!1;while(!i.stop);return t}parseSubscript(t,e,s,i){let{type:a}=this.state;if(!s&&a===15)return this.parseBind(t,e,s,i);if(Vt(a))return this.parseTaggedTemplateExpression(t,e,i);let n=!1;if(a===18){if(s&&(this.raise(c.OptionalChainingNoNew,{at:this.state.startLoc}),this.lookaheadCharCode()===40))return i.stop=!0,t;i.optionalChainMember=n=!0,this.next()}if(!s&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(t,e,i,n);{let o=this.eat(0);return o||n||this.eat(16)?this.parseMember(t,e,i,o,n):(i.stop=!0,t)}}parseMember(t,e,s,i,a){let n=this.startNodeAt(e);return n.object=t,n.computed=i,i?(n.property=this.parseExpression(),this.expect(3)):this.match(136)?(t.type==="Super"&&this.raise(c.SuperPrivateField,{at:e}),this.classScope.usePrivateName(this.state.value,this.state.startLoc),n.property=this.parsePrivateName()):n.property=this.parseIdentifier(!0),s.optionalChainMember?(n.optional=a,this.finishNode(n,"OptionalMemberExpression")):this.finishNode(n,"MemberExpression")}parseBind(t,e,s,i){let a=this.startNodeAt(e);return a.object=t,this.next(),a.callee=this.parseNoCallExpr(),i.stop=!0,this.parseSubscripts(this.finishNode(a,"BindExpression"),e,s)}parseCoverCallAndAsyncArrowHead(t,e,s,i){let a=this.state.maybeInArrowParameters,n=null;this.state.maybeInArrowParameters=!0,this.next();let o=this.startNodeAt(e);o.callee=t;let{maybeAsyncArrow:u,optionalChainMember:h}=s;u&&(this.expressionScope.enter(Fu()),n=new Ue),h&&(o.optional=i),i?o.arguments=this.parseCallExpressionArguments(11):o.arguments=this.parseCallExpressionArguments(11,t.type==="Import",t.type!=="Super",o,n);let l=this.finishCallExpression(o,h);return u&&this.shouldParseAsyncArrow()&&!i?(s.stop=!0,this.checkDestructuringPrivate(n),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),l=this.parseAsyncArrowFromCallExpression(this.startNodeAt(e),l)):(u&&(this.checkExpressionErrors(n,!0),this.expressionScope.exit()),this.toReferencedArguments(l)),this.state.maybeInArrowParameters=a,l}toReferencedArguments(t,e){this.toReferencedListDeep(t.arguments,e)}parseTaggedTemplateExpression(t,e,s){let i=this.startNodeAt(e);return i.tag=t,i.quasi=this.parseTemplate(!0),s.optionalChainMember&&this.raise(c.OptionalChainingNoTemplate,{at:e}),this.finishNode(i,"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}expectImportAttributesPlugin(){this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes")}finishCallExpression(t,e){if(t.callee.type==="Import")if(t.arguments.length===2&&(this.hasPlugin("moduleAttributes")||this.expectImportAttributesPlugin()),t.arguments.length===0||t.arguments.length>2)this.raise(c.ImportCallArity,{at: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(c.ImportCallSpreadArgument,{at:s});return this.finishNode(t,e?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(t,e,s,i,a){let n=[],o=!0,u=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(c.ImportCallArgumentTrailingComma,{at:this.state.lastTokStartLoc}),i&&this.addTrailingCommaExtraToNode(i),this.next();break}n.push(this.parseExprListItem(!1,a,s))}return this.state.inFSharpPipelineDirectBody=u,n}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&&ht(t,e.innerComments),e.callee.trailingComments&&ht(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:i}=this.state;switch(i){case 79:return this.parseSuper();case 83:return e=this.startNode(),this.next(),this.match(16)?this.parseImportMetaProperty(e):(this.match(10)||this.raise(c.UnsupportedImport,{at:this.state.lastTokStartLoc}),this.finishNode(e,"Import"));case 78:return e=this.startNode(),this.next(),this.finishNode(e,"ThisExpression");case 90:return this.parseDo(this.startNode(),!1);case 56:case 31:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 132:return this.parseNumericLiteral(this.state.value);case 133:return this.parseBigIntLiteral(this.state.value);case 134:return this.parseDecimalLiteral(this.state.value);case 131: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 a=this.state.potentialArrowAt===this.state.start;return this.parseParenAndDistinguishExpression(a)}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 a=e.callee=this.parseNoCallExpr();if(a.type==="MemberExpression")return this.finishNode(e,"BindExpression");throw this.raise(c.UnsupportedBind,{at:a})}case 136:return this.raise(c.PrivateInExpectedIn,{at:this.state.startLoc,identifierName:this.state.value}),this.parsePrivateName();case 33:return this.parseTopicReferenceThenEqualsSign(54,"%");case 32:return this.parseTopicReferenceThenEqualsSign(44,"^");case 37:case 38:return this.parseTopicReference("hack");case 44:case 54:case 27:{let a=this.getPluginOption("pipelineOperator","proposal");if(a)return this.parseTopicReference(a);this.unexpected();break}case 47:{let a=this.input.codePointAt(this.nextTokenStart());ee(a)||a===62?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected();break}default:if(N(i)){if(this.isContextual(125)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let a=this.state.potentialArrowAt===this.state.start,n=this.state.containsEsc,o=this.parseIdentifier();if(!n&&o.name==="async"&&!this.canInsertSemicolon()){let{type:u}=this.state;if(u===68)return this.resetPreviousNodeTrailingComments(o),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(o));if(N(u))return this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(o)):o;if(u===90)return this.resetPreviousNodeTrailingComments(o),this.parseDo(this.startNodeAtNode(o),!0)}return a&&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=$(this.state.endLoc,-1),this.parseTopicReference(s);this.unexpected()}parseTopicReference(t){let e=this.startNode(),s=this.state.startLoc,i=this.state.type;return this.next(),this.finishTopicReference(e,s,t,i)}finishTopicReference(t,e,s,i){if(this.testTopicReferenceConfiguration(s,e,i)){let a=s==="smart"?"PipelinePrimaryTopicReference":"TopicReference";return this.topicReferenceIsAllowedInCurrentContext()||this.raise(s==="smart"?c.PrimaryTopicNotAllowed:c.PipeTopicUnbound,{at:e}),this.registerTopicReference(),this.finishNode(t,a)}else throw this.raise(c.PipeTopicUnconfiguredToken,{at:e,token:ce(i)})}testTopicReferenceConfiguration(t,e,s){switch(t){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:ce(s)}]);case"smart":return s===27;default:throw this.raise(c.PipeTopicRequiresHackPipes,{at:e})}}parseAsyncArrowUnaryFunction(t){this.prodParam.enter(jt(!0,this.prodParam.hasYield));let e=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(c.LineTerminatorBeforeArrow,{at: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(Qt),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(c.SuperNotAllowed,{at:t}):!this.scope.allowSuper&&!this.options.allowSuperOutsideMethod&&this.raise(c.UnexpectedSuper,{at:t}),!this.match(10)&&!this.match(0)&&!this.match(16)&&this.raise(c.UnsupportedSuper,{at:t}),this.finishNode(t,"Super")}parsePrivateName(){let t=this.startNode(),e=this.startNodeAt($(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(102)?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 i=this.state.containsEsc;return t.property=this.parseIdentifier(!0),(t.property.name!==s||i)&&this.raise(c.UnsupportedMetaProperty,{at:t.property,target:e.name,onlyValidPropertyName:s}),this.finishNode(t,"MetaProperty")}parseImportMetaProperty(t){let e=this.createIdentifier(this.startNodeAtNode(t),"import");return this.next(),this.isContextual(100)&&(this.inModule||this.raise(c.ImportMetaOutsideModule,{at:e}),this.sawUnambiguousESM=!0),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.parseLiteral(t.value,"RegExpLiteral");return e.pattern=t.pattern,e.flags=t.flags,e}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(Bu());let i=this.state.maybeInArrowParameters,a=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;let n=this.state.startLoc,o=[],u=new Ue,h=!0,l,p;for(;!this.match(11);){if(h)h=!1;else if(this.expect(12,u.optionalParametersLoc===null?null:u.optionalParametersLoc),this.match(11)){p=this.state.startLoc;break}if(this.match(21)){let m=this.state.startLoc;if(l=this.state.startLoc,o.push(this.parseParenItem(this.parseRestBinding(),m)),!this.checkCommaAfterRest(41))break}else o.push(this.parseMaybeAssignAllowIn(u,this.parseParenItem))}let f=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=i,this.state.inFSharpPipelineDirectBody=a;let d=this.startNodeAt(e);return t&&this.shouldParseArrow(o)&&(d=this.parseArrow(d))?(this.checkDestructuringPrivate(u),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),l&&this.unexpected(l),this.checkExpressionErrors(u,!0),this.toReferencedListDeep(o,!0),o.length>1?(s=this.startNodeAt(n),s.expressions=o,this.finishNode(s,"SequenceExpression"),this.resetEndLocation(s,f)):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(c.UnexpectedNewTarget,{at: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){t.callee=this.parseNoCallExpr(),t.callee.type==="Import"&&this.raise(c.ImportCallNotNewExpression,{at:t.callee})}parseTemplateElement(t){let{start:e,startLoc:s,end:i,value:a}=this.state,n=e+1,o=this.startNodeAt($(s,1));a===null&&(t||this.raise(c.InvalidEscapeSequenceTemplate,{at:$(this.state.firstInvalidTemplateEscapePos,1)}));let u=this.match(24),h=u?-1:-2,l=i+h;o.value={raw:this.input.slice(n,l).replace(/\r\n?/g,`
|
|
15
|
+
`),cooked:a===null?null:a.slice(1,h)},o.tail=u,this.next();let p=this.finishNode(o,"TemplateElement");return this.resetEndLocation(p,$(this.state.lastTokEndLoc,h)),p}parseTemplate(t){let e=this.startNode();e.expressions=[];let s=this.parseTemplateElement(t);for(e.quasis=[s];!s.tail;)e.expressions.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),e.quasis.push(s=this.parseTemplateElement(t));return this.finishNode(e,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(t,e,s,i){s&&this.expectPlugin("recordAndTuple");let a=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let n=Object.create(null),o=!0,u=this.startNode();for(u.properties=[],this.next();!this.match(t);){if(o)o=!1;else if(this.expect(12),this.match(t)){this.addTrailingCommaExtraToNode(u);break}let l;e?l=this.parseBindingProperty():(l=this.parsePropertyDefinition(i),this.checkProto(l,s,n,i)),s&&!this.isObjectProperty(l)&&l.type!=="SpreadElement"&&this.raise(c.InvalidRecordProperty,{at:l}),l.shorthand&&this.addExtra(l,"shorthand",!0),u.properties.push(l)}this.next(),this.state.inFSharpPipelineDirectBody=a;let h="ObjectExpression";return e?h="ObjectPattern":s&&(h="RecordExpression"),this.finishNode(u,h)}addTrailingCommaExtraToNode(t){this.addExtra(t,"trailingComma",this.state.lastTokStart),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(c.UnsupportedPropertyDecorator,{at:this.state.startLoc});this.match(26);)e.push(this.parseDecorator());let s=this.startNode(),i=!1,a=!1,n;if(this.match(21))return e.length&&this.unexpected(),this.parseSpread();e.length&&(s.decorators=e,e=[]),s.method=!1,t&&(n=this.state.startLoc);let o=this.eat(55);this.parsePropertyNamePrefixOperator(s);let u=this.state.containsEsc,h=this.parsePropertyName(s,t);if(!o&&!u&&this.maybeAsyncOrAccessorProp(s)){let l=h.name;l==="async"&&!this.hasPrecedingLineBreak()&&(i=!0,this.resetPreviousNodeTrailingComments(h),o=this.eat(55),this.parsePropertyName(s)),(l==="get"||l==="set")&&(a=!0,this.resetPreviousNodeTrailingComments(h),s.kind=l,this.match(55)&&(o=!0,this.raise(c.AccessorIsGenerator,{at:this.state.curPosition(),kind:l}),this.next()),this.parsePropertyName(s))}return this.parseObjPropValue(s,n,o,i,!1,a,t)}getGetterSetterExpectedParamCount(t){return t.kind==="get"?0:1}getObjectOrClassMethodParams(t){return t.params}checkGetterSetterParams(t){var e;let s=this.getGetterSetterExpectedParamCount(t),i=this.getObjectOrClassMethodParams(t);i.length!==s&&this.raise(t.kind==="get"?c.BadGetterArity:c.BadSetterArity,{at:t}),t.kind==="set"&&((e=i[i.length-1])==null?void 0:e.type)==="RestElement"&&this.raise(c.BadSetterRestParameter,{at:t})}parseObjectMethod(t,e,s,i,a){if(a){let n=this.parseMethod(t,e,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(n),n}if(s||e||this.match(10))return i&&this.unexpected(),t.kind="method",t.method=!0,this.parseMethod(t,e,s,!1,!1,"ObjectMethod")}parseObjectProperty(t,e,s,i){if(t.shorthand=!1,this.eat(14))return t.value=s?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowIn(i),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,ie(t.key));else if(this.match(29)){let a=this.state.startLoc;i!=null?i.shorthandAssignLoc===null&&(i.shorthandAssignLoc=a):this.raise(c.InvalidCoverInitializedName,{at:a}),t.value=this.parseMaybeDefault(e,ie(t.key))}else t.value=ie(t.key);return t.shorthand=!0,this.finishNode(t,"ObjectProperty")}}parseObjPropValue(t,e,s,i,a,n,o){let u=this.parseObjectMethod(t,s,i,a,n)||this.parseObjectProperty(t,e,a,o);return u||this.unexpected(),u}parsePropertyName(t,e){if(this.eat(0))t.computed=!0,t.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let{type:s,value:i}=this.state,a;if(W(s))a=this.parseIdentifier(!0);else switch(s){case 132:a=this.parseNumericLiteral(i);break;case 131:a=this.parseStringLiteral(i);break;case 133:a=this.parseBigIntLiteral(i);break;case 134:a=this.parseDecimalLiteral(i);break;case 136:{let n=this.state.startLoc;e!=null?e.privateKeyLoc===null&&(e.privateKeyLoc=n):this.raise(c.UnexpectedPrivateField,{at:n}),a=this.parsePrivateName();break}default:this.unexpected()}t.key=a,s!==136&&(t.computed=!1)}return t.key}initFunction(t,e){t.id=null,t.generator=!1,t.async=e}parseMethod(t,e,s,i,a,n,o=!1){this.initFunction(t,s),t.generator=e,this.scope.enter(se|Wt|(o?Te:0)|(a?aa:0)),this.prodParam.enter(jt(s,t.generator)),this.parseFunctionParams(t,i);let u=this.parseFunctionBodyAndFinish(t,n,!0);return this.prodParam.exit(),this.scope.exit(),u}parseArrayLike(t,e,s,i){s&&this.expectPlugin("recordAndTuple");let a=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let n=this.startNode();return this.next(),n.elements=this.parseExprList(t,!s,i,n),this.state.inFSharpPipelineDirectBody=a,this.finishNode(n,s?"TupleExpression":"ArrayExpression")}parseArrowExpression(t,e,s,i){this.scope.enter(se|ni);let a=jt(s,!1);!this.match(5)&&this.prodParam.hasIn&&(a|=_e),this.prodParam.enter(a),this.initFunction(t,s);let n=this.state.maybeInArrowParameters;return e&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(t,e,i)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(t,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=n,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 i=e&&!this.match(5);if(this.expressionScope.enter(xa()),i)t.body=this.parseMaybeAssign(),this.checkParams(t,!1,e,!1);else{let a=this.state.strict,n=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|ba),t.body=this.parseBlock(!0,!1,o=>{let u=!this.isSimpleParamList(t.params);o&&u&&this.raise(c.IllegalLanguageModeDirective,{at:(t.kind==="method"||t.kind==="constructor")&&t.key?t.key.loc.end:t});let h=!a&&this.state.strict;this.checkParams(t,!this.state.strict&&!e&&!s&&!u,e,h),this.state.strict&&t.id&&this.checkIdentifier(t.id,gu,h)}),this.prodParam.exit(),this.state.labels=n}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,i=!0){let a=!e&&new Set,n={type:"FormalParameters"};for(let o of t.params)this.checkLVal(o,{in:n,binding:Kt,checkClashes:a,strictModeChanged:i})}parseExprList(t,e,s,i){let a=[],n=!0;for(;!this.eat(t);){if(n)n=!1;else if(this.expect(12),this.match(t)){i&&this.addTrailingCommaExtraToNode(i),this.next();break}a.push(this.parseExprListItem(e,s))}return a}parseExprListItem(t,e,s){let i;if(this.match(12))t||this.raise(c.UnexpectedToken,{at:this.state.curPosition(),unexpected:","}),i=null;else if(this.match(21)){let a=this.state.startLoc;i=this.parseParenItem(this.parseSpread(e),a)}else if(this.match(17)){this.expectPlugin("partialApplication"),s||this.raise(c.UnexpectedArgumentPlaceholder,{at:this.state.startLoc});let a=this.startNode();this.next(),i=this.finishNode(a,"ArgumentPlaceholder")}else i=this.parseMaybeAssignAllowIn(e,this.parseParenItem);return i}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:i}=this.state;W(i)?e=this.state.value:this.unexpected();let a=Xo(i);return t?a&&this.replaceToken(130):this.checkReservedWord(e,s,a,!1),this.next(),e}checkReservedWord(t,e,s,i){if(t.length>10||!du(t))return;if(s&&cu(t)){this.raise(c.UnexpectedKeyword,{at:e,keyword:t});return}if((this.state.strict?i?ia:ta:ea)(t,this.inModule)){this.raise(c.UnexpectedReservedWord,{at:e,reservedWord:t});return}else if(t==="yield"){if(this.prodParam.hasYield){this.raise(c.YieldBindingIdentifier,{at:e});return}}else if(t==="await"){if(this.prodParam.hasAwait){this.raise(c.AwaitBindingIdentifier,{at:e});return}if(this.scope.inStaticBlock){this.raise(c.AwaitBindingIdentifierInStaticBlock,{at:e});return}this.expressionScope.recordAsyncArrowParametersError({at:e})}else if(t==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(c.ArgumentsInClass,{at:e});return}}isAwaitAllowed(){return!!(this.prodParam.hasAwait||this.options.allowAwaitOutsideFunction&&!this.scope.inFunction)}parseAwait(t){let e=this.startNodeAt(t);return this.expressionScope.recordParameterInitializerError(c.AwaitExpressionFormalParameter,{at:e}),this.eat(55)&&this.raise(c.ObsoleteAwaitStar,{at:e}),!this.scope.inFunction&&!this.options.allowAwaitOutsideFunction&&(this.isAmbiguousAwait()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),this.state.soloAwait||(e.argument=this.parseMaybeUnary(null,!0)),this.finishNode(e,"AwaitExpression")}isAmbiguousAwait(){if(this.hasPrecedingLineBreak())return!0;let{type:t}=this.state;return t===53||t===10||t===0||Vt(t)||t===101&&!this.state.containsEsc||t===135||t===56||this.hasPlugin("v8intrinsic")&&t===54}parseYield(){let t=this.startNode();this.expressionScope.recordParameterInitializerError(c.YieldInParameter,{at:t}),this.next();let e=!1,s=null;if(!this.hasPrecedingLineBreak())switch(e=this.eat(55),this.state.type){case 13:case 137: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")}checkPipelineAtInfixOperator(t,e){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&t.type==="SequenceExpression"&&this.raise(c.PipelineHeadSequenceExpression,{at: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(c.PipelineBodyNoArrow,{at:this.state.startLoc});this.topicReferenceWasUsedInCurrentContext()||this.raise(c.PipelineTopicUnused,{at: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(_e&~e){this.prodParam.enter(e|_e);try{return t()}finally{this.prodParam.exit()}}return t()}disallowInAnd(t){let e=this.prodParam.currentFlags();if(_e&e){this.prodParam.enter(e&~_e);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 i=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),e,t);return this.state.inFSharpPipelineDirectBody=s,i}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){}},Es={kind:"loop"},uh={kind:"switch"},hh=/[\uD800-\uDFFF]/u,vs=/in(?:stanceof)?/y;function lh(r,t){for(let e=0;e<r.length;e++){let s=r[e],{type:i}=s;if(typeof i=="number"){{if(i===136){let{loc:a,start:n,value:o,end:u}=s,h=n+1,l=$(a.start,1);r.splice(e,1,new K({type:Q(27),value:"#",start:n,end:h,startLoc:a.start,endLoc:l}),new K({type:Q(130),value:o,start:h,end:u,startLoc:l,endLoc:a.end})),e++;continue}if(Vt(i)){let{loc:a,start:n,value:o,end:u}=s,h=n+1,l=$(a.start,1),p;t.charCodeAt(n)===96?p=new K({type:Q(22),value:"`",start:n,end:h,startLoc:a.start,endLoc:l}):p=new K({type:Q(8),value:"}",start:n,end:h,startLoc:a.start,endLoc:l});let f,d,m,y;i===24?(d=u-1,m=$(a.end,-1),f=o===null?null:o.slice(1,-1),y=new K({type:Q(22),value:"`",start:d,end:u,startLoc:m,endLoc:a.end})):(d=u-2,m=$(a.end,-2),f=o===null?null:o.slice(1,-2),y=new K({type:Q(23),value:"${",start:d,end:u,startLoc:m,endLoc:a.end})),r.splice(e,1,p,new K({type:Q(20),value:f,start:h,end:d,startLoc:l,endLoc:m}),y),e+=2;continue}}s.type=Q(i)}}return r}var Js=class extends Xs{parseTopLevel(t,e){return t.program=this.parseProgram(e),t.comments=this.state.comments,this.options.tokens&&(t.tokens=lh(this.tokens,this.input)),this.finishNode(t,"File")}parseProgram(t,e=137,s=this.options.sourceType){if(t.sourceType=s,t.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(t,!0,!0,e),this.inModule&&!this.options.allowUndeclaredExports&&this.scope.undefinedExports.size>0)for(let[a,n]of Array.from(this.scope.undefinedExports))this.raise(c.ModuleExportUndefined,{at:n,localName:a});let i;return e===137?i=this.finishNode(t,"Program"):i=this.finishNodeAt(t,"Program",$(this.state.startLoc,-1)),i}stmtToDirective(t){let e=t;e.type="Directive",e.value=e.expression,delete e.expression;let s=e.value,i=s.value,a=this.input.slice(s.start,s.end),n=s.value=a.slice(1,-1);return this.addExtra(s,"raw",a),this.addExtra(s,"rawValue",n),this.addExtra(s,"expressionValue",i),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(99)?this.hasFollowingBindingAtom():!1}chStartsBindingIdentifier(t,e){if(ee(t)){if(vs.lastIndex=e,vs.test(this.input)){let s=this.codePointAtPos(vs.lastIndex);if(!De(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)}hasInLineFollowingBindingIdentifier(){let t=this.nextTokenInLineStart(),e=this.codePointAtPos(t);return this.chStartsBindingIdentifier(e,t)}startsUsingForOf(){let{type:t,containsEsc:e}=this.lookahead();if(t===101&&!e)return!1;if(N(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,i=this.startNode(),a=!!(t&2),n=!!(t&4),o=t&1;switch(s){case 60:return this.parseBreakContinueStatement(i,!0);case 63:return this.parseBreakContinueStatement(i,!1);case 64:return this.parseDebuggerStatement(i);case 90:return this.parseDoWhileStatement(i);case 91:return this.parseForStatement(i);case 68:if(this.lookaheadCharCode()===46)break;return n||this.raise(this.state.strict?c.StrictFunction:this.options.annexB?c.SloppyFunctionAnnexB:c.SloppyFunction,{at:this.state.startLoc}),this.parseFunctionStatement(i,!1,!a&&n);case 80:return a||this.unexpected(),this.parseClass(this.maybeTakeDecorators(e,i),!0);case 69:return this.parseIfStatement(i);case 70:return this.parseReturnStatement(i);case 71:return this.parseSwitchStatement(i);case 72:return this.parseThrowStatement(i);case 73:return this.parseTryStatement(i);case 96:if(!this.state.containsEsc&&this.startsAwaitUsing())return this.isAwaitAllowed()?a||this.raise(c.UnexpectedLexicalDeclaration,{at:i}):this.raise(c.AwaitUsingNotInAsyncContext,{at:i}),this.next(),this.parseVarStatement(i,"await using");break;case 105:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifier())break;return this.expectPlugin("explicitResourceManagement"),!this.scope.inModule&&this.scope.inTopLevel?this.raise(c.UnexpectedUsingDeclaration,{at:this.state.startLoc}):a||this.raise(c.UnexpectedLexicalDeclaration,{at:this.state.startLoc}),this.parseVarStatement(i,"using");case 99:{if(this.state.containsEsc)break;let l=this.nextTokenStart(),p=this.codePointAtPos(l);if(p!==91&&(!a&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(p,l)&&p!==123))break}case 75:a||this.raise(c.UnexpectedLexicalDeclaration,{at:this.state.startLoc});case 74:{let l=this.state.value;return this.parseVarStatement(i,l)}case 92:return this.parseWhileStatement(i);case 76:return this.parseWithStatement(i);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(i);case 83:{let l=this.lookaheadCharCode();if(l===40||l===46)break}case 82:{!this.options.allowImportExportEverywhere&&!o&&this.raise(c.UnexpectedImportExport,{at:this.state.startLoc}),this.next();let l;return s===83?(l=this.parseImport(i),l.type==="ImportDeclaration"&&(!l.importKind||l.importKind==="value")&&(this.sawUnambiguousESM=!0)):(l=this.parseExport(i,e),(l.type==="ExportNamedDeclaration"&&(!l.exportKind||l.exportKind==="value")||l.type==="ExportAllDeclaration"&&(!l.exportKind||l.exportKind==="value")||l.type==="ExportDefaultDeclaration")&&(this.sawUnambiguousESM=!0)),this.assertModuleNodeAllowed(l),l}default:if(this.isAsyncFunction())return a||this.raise(c.AsyncFunctionInSingleStatementContext,{at:this.state.startLoc}),this.next(),this.parseFunctionStatement(i,!0,!a&&n)}let u=this.state.value,h=this.parseExpression();return N(s)&&h.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(i,u,h,t):this.parseExpressionStatement(i,h,e)}assertModuleNodeAllowed(t){!this.options.allowImportExportEverywhere&&!this.inModule&&this.raise(c.ImportOutsideModule,{at: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(c.DecoratorsBeforeAfterExport,{at: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(c.DecoratorExportClass,{at:this.state.startLoc});else if(!this.canHaveLeadingDecorator())throw this.raise(c.UnexpectedLeadingDecorator,{at: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 i=this.state.startLoc;this.next(),s=this.parseExpression(),this.expect(11),s=this.wrapParenthesis(i,s);let a=this.state.startLoc;t.expression=this.parseMaybeDecoratorArguments(s),this.getPluginOption("decorators","allowCallParenthesized")===!1&&t.expression!==s&&this.raise(c.DecoratorArgumentsOutsideParentheses,{at:a})}else{for(s=this.parseIdentifier(!1);this.eat(16);){let i=this.startNodeAt(e);i.object=s,this.match(136)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),i.property=this.parsePrivateName()):i.property=this.parseIdentifier(!0),i.computed=!1,s=this.finishNode(i,"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 i=this.state.labels[s];if((t.label==null||i.name===t.label.name)&&(i.kind!=null&&(e||i.kind==="loop")||t.label&&e))break}if(s===this.state.labels.length){let i=e?"BreakStatement":"ContinueStatement";this.raise(c.IllegalBreakContinue,{at:t,type:i})}}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(Es),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(Es);let e=null;if(this.isAwaitAllowed()&&this.eatContextual(96)&&(e=this.state.lastTokStartLoc),this.scope.enter(Le),this.expect(10),this.match(13))return e!==null&&this.unexpected(e),this.parseFor(t,null);let s=this.isContextual(99);{let u=this.isContextual(96)&&this.startsAwaitUsing(),h=u||this.isContextual(105)&&this.startsUsingForOf(),l=s&&this.hasFollowingBindingAtom()||h;if(this.match(74)||this.match(75)||l){let p=this.startNode(),f;u?(f="await using",this.isAwaitAllowed()||this.raise(c.AwaitUsingNotInAsyncContext,{at:this.state.startLoc}),this.next()):f=this.state.value,this.next(),this.parseVar(p,!0,f);let d=this.finishNode(p,"VariableDeclaration"),m=this.match(58);return m&&h&&this.raise(c.ForInUsing,{at:d}),(m||this.isContextual(101))&&d.declarations.length===1?this.parseForIn(t,d,e):(e!==null&&this.unexpected(e),this.parseFor(t,d))}}let i=this.isContextual(95),a=new Ue,n=this.parseExpression(!0,a),o=this.isContextual(101);if(o&&(s&&this.raise(c.ForOfLet,{at:n}),e===null&&i&&n.type==="Identifier"&&this.raise(c.ForOfAsync,{at:n})),o||this.match(58)){this.checkDestructuringPrivate(a),this.toAssignable(n,!0);let u=o?"ForOfStatement":"ForInStatement";return this.checkLVal(n,{in:{type:u}}),this.parseForIn(t,n,e)}else this.checkExpressionErrors(a,!0);return e!==null&&this.unexpected(e),this.parseFor(t,n)}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(c.IllegalReturn,{at: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(uh),this.scope.enter(Le);let s;for(let i;!this.match(8);)if(this.match(61)||this.match(65)){let a=this.match(61);s&&this.finishNode(s,"SwitchCase"),e.push(s=this.startNode()),s.consequent=[],this.next(),a?s.test=this.parseExpression():(i&&this.raise(c.MultipleDefaultsInSwitch,{at:this.state.lastTokStartLoc}),i=!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(c.NewlineAfterThrow,{at: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"?ra:0),this.checkLVal(t,{in:{type:"CatchClause"},binding:mu}),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(Le)),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(c.NoCatchOrFinally,{at: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(Es),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(t,"WhileStatement")}parseWithStatement(t){return this.state.strict&&this.raise(c.StrictWith,{at: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,i){for(let n of this.state.labels)n.name===e&&this.raise(c.LabelRedeclaration,{at:s,labelName:e});let a=Qo(this.state.type)?"loop":this.match(71)?"switch":null;for(let n=this.state.labels.length-1;n>=0;n--){let o=this.state.labels[n];if(o.statementStart===t.start)o.statementStart=this.state.start,o.kind=a;else break}return this.state.labels.push({name:e,kind:a,statementStart:this.state.start}),t.body=i&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 i=this.startNode();return t&&this.state.strictErrors.clear(),this.expect(5),e&&this.scope.enter(Le),this.parseBlockBody(i,t,!1,8,s),e&&this.scope.exit(),this.finishNode(i,"BlockStatement")}isValidDirective(t){return t.type==="ExpressionStatement"&&t.expression.type==="StringLiteral"&&!t.expression.extra.parenthesized}parseBlockBody(t,e,s,i,a){let n=t.body=[],o=t.directives=[];this.parseBlockOrModuleBlockBody(n,e?o:void 0,s,i,a)}parseBlockOrModuleBlockBody(t,e,s,i,a){let n=this.state.strict,o=!1,u=!1;for(;!this.match(i);){let h=s?this.parseModuleItem():this.parseStatementListItem();if(e&&!u){if(this.isValidDirective(h)){let l=this.stmtToDirective(h);e.push(l),!o&&l.value.value==="use strict"&&(o=!0,this.setStrict(!0));continue}u=!0,this.state.strictErrors.clear()}t.push(h)}a&&a.call(this,o),n||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 i=this.match(58);return this.next(),i?s!==null&&this.unexpected(s):t.await=s!==null,e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!i||!this.options.annexB||this.state.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(c.ForInOfLoopInitializer,{at:e,type:i?"ForInStatement":"ForOfStatement"}),e.type==="AssignmentPattern"&&this.raise(c.InvalidLhs,{at:e,ancestor:{type:"ForStatement"}}),t.left=e,t.right=i?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,i?"ForInStatement":"ForOfStatement")}parseVar(t,e,s,i=!1){let a=t.declarations=[];for(t.kind=s;;){let n=this.startNode();if(this.parseVarId(n,s),n.init=this.eat(29)?e?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,n.init===null&&!i&&(n.id.type!=="Identifier"&&!(e&&(this.match(58)||this.isContextual(101)))?this.raise(c.DeclarationMissingInitializer,{at:this.state.lastTokEndLoc,kind:"destructuring"}):s==="const"&&!(this.match(58)||this.isContextual(101))&&this.raise(c.DeclarationMissingInitializer,{at:this.state.lastTokEndLoc,kind:"const"})),a.push(this.finishNode(n,"VariableDeclarator")),!this.eat(12))break}return t}parseVarId(t,e){let s=this.parseBindingAtom();this.checkLVal(s,{in:{type:"VariableDeclarator"},binding:e==="var"?Kt:Fe}),t.id=s}parseAsyncFunctionExpression(t){return this.parseFunction(t,8)}parseFunction(t,e=0){let s=e&2,i=!!(e&1),a=i&&!(e&4),n=!!(e&8);this.initFunction(t,n),this.match(55)&&(s&&this.raise(c.GeneratorInSingleStatementContext,{at:this.state.startLoc}),this.next(),t.generator=!0),i&&(t.id=this.parseFunctionId(a));let o=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(se),this.prodParam.enter(jt(n,t.generator)),i||(t.id=this.parseFunctionId()),this.parseFunctionParams(t,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(t,i?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),i&&!s&&this.registerFunctionStatementId(t),this.state.maybeInArrowParameters=o,t}parseFunctionId(t){return t||N(this.state.type)?this.parseIdentifier():null}parseFunctionParams(t,e){this.expect(10),this.expressionScope.enter(Du()),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?Kt:Fe:ha,t.id.loc.start)}parseClass(t,e,s){this.next();let i=this.state.strict;return this.state.strict=!0,this.parseClassId(t,e,s),this.parseClassSuper(t),t.body=this.parseClassBody(!!t.superClass,i),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}isNonstaticConstructor(t){return!t.computed&&!t.static&&(t.key.name==="constructor"||t.key.value==="constructor")}parseClassBody(t,e){this.classScope.enter();let s={hadConstructor:!1,hadSuperClass:t},i=[],a=this.startNode();if(a.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(i.length>0)throw this.raise(c.DecoratorSemicolon,{at:this.state.lastTokEndLoc});continue}if(this.match(26)){i.push(this.parseDecorator());continue}let n=this.startNode();i.length&&(n.decorators=i,this.resetStartLocationFromNode(n,i[0]),i=[]),this.parseClassMember(a,n,s),n.kind==="constructor"&&n.decorators&&n.decorators.length>0&&this.raise(c.DecoratorConstructor,{at:n})}}),this.state.strict=e,this.next(),i.length)throw this.raise(c.TrailingDecorator,{at:this.state.startLoc});return this.classScope.exit(),this.finishNode(a,"ClassBody")}parseClassMemberFromModifier(t,e){let s=this.parseIdentifier(!0);if(this.isClassMethod()){let i=e;return i.kind="method",i.computed=!1,i.key=s,i.static=!1,this.pushClassMethod(t,i,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let i=e;return i.computed=!1,i.key=s,i.static=!1,t.body.push(this.parseClassProperty(i)),!0}return this.resetPreviousNodeTrailingComments(s),!1}parseClassMember(t,e,s){let i=this.isContextual(104);if(i){if(this.parseClassMemberFromModifier(t,e))return;if(this.eat(5)){this.parseClassStaticBlock(t,e);return}}this.parseClassMemberWithIsStatic(t,e,s,i)}parseClassMemberWithIsStatic(t,e,s,i){let a=e,n=e,o=e,u=e,h=e,l=a,p=a;if(e.static=i,this.parsePropertyNamePrefixOperator(e),this.eat(55)){l.kind="method";let P=this.match(136);if(this.parseClassElementName(l),P){this.pushClassPrivateMethod(t,n,!0,!1);return}this.isNonstaticConstructor(a)&&this.raise(c.ConstructorIsGenerator,{at:a.key}),this.pushClassMethod(t,a,!0,!1,!1,!1);return}let f=N(this.state.type)&&!this.state.containsEsc,d=this.match(136),m=this.parseClassElementName(e),y=this.state.startLoc;if(this.parsePostMemberNameModifiers(p),this.isClassMethod()){if(l.kind="method",d){this.pushClassPrivateMethod(t,n,!1,!1);return}let P=this.isNonstaticConstructor(a),S=!1;P&&(a.kind="constructor",s.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(c.DuplicateConstructor,{at:m}),P&&this.hasPlugin("typescript")&&e.override&&this.raise(c.OverrideOnConstructor,{at:m}),s.hadConstructor=!0,S=s.hadSuperClass),this.pushClassMethod(t,a,!1,!1,P,S)}else if(this.isClassProperty())d?this.pushClassPrivateProperty(t,u):this.pushClassProperty(t,o);else if(f&&m.name==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(m);let P=this.eat(55);p.optional&&this.unexpected(y),l.kind="method";let S=this.match(136);this.parseClassElementName(l),this.parsePostMemberNameModifiers(p),S?this.pushClassPrivateMethod(t,n,P,!0):(this.isNonstaticConstructor(a)&&this.raise(c.ConstructorIsAsync,{at:a.key}),this.pushClassMethod(t,a,P,!0,!1,!1))}else if(f&&(m.name==="get"||m.name==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(m),l.kind=m.name;let P=this.match(136);this.parseClassElementName(a),P?this.pushClassPrivateMethod(t,n,!1,!1):(this.isNonstaticConstructor(a)&&this.raise(c.ConstructorIsAccessor,{at:a.key}),this.pushClassMethod(t,a,!1,!1,!1,!1)),this.checkGetterSetterParams(a)}else if(f&&m.name==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(m);let P=this.match(136);this.parseClassElementName(o),this.pushClassAccessorProperty(t,h,P)}else this.isLineTerminator()?d?this.pushClassPrivateProperty(t,u):this.pushClassProperty(t,o):this.unexpected()}parseClassElementName(t){let{type:e,value:s}=this.state;if((e===130||e===131)&&t.static&&s==="prototype"&&this.raise(c.StaticPrototype,{at:this.state.startLoc}),e===136){s==="constructor"&&this.raise(c.ConstructorClassPrivateField,{at:this.state.startLoc});let i=this.parsePrivateName();return t.key=i,i}return this.parsePropertyName(t)}parseClassStaticBlock(t,e){var s;this.scope.enter(Te|zt|Wt);let i=this.state.labels;this.state.labels=[],this.prodParam.enter(Re);let a=e.body=[];this.parseBlockOrModuleBlockBody(a,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=i,t.body.push(this.finishNode(e,"StaticBlock")),(s=e.decorators)!=null&&s.length&&this.raise(c.DecoratorStaticBlock,{at:e})}pushClassProperty(t,e){!e.computed&&(e.key.name==="constructor"||e.key.value==="constructor")&&this.raise(c.ConstructorClassField,{at: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),Ss,s.key.loc.start)}pushClassAccessorProperty(t,e,s){if(!s&&!e.computed){let a=e.key;(a.name==="constructor"||a.value==="constructor")&&this.raise(c.ConstructorClassField,{at:a})}let i=this.parseClassAccessorProperty(e);t.body.push(i),s&&this.classScope.declarePrivateName(this.getPrivateNameSV(i.key),Ss,i.key.loc.start)}pushClassMethod(t,e,s,i,a,n){t.body.push(this.parseMethod(e,s,i,a,n,"ClassMethod",!0))}pushClassPrivateMethod(t,e,s,i){let a=this.parseMethod(e,s,i,!1,!1,"ClassPrivateMethod",!0);t.body.push(a);let n=a.kind==="get"?a.static?Au:wu:a.kind==="set"?a.static?Su:Eu:Ss;this.declareClassPrivateMethodInScope(a,n)}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(Te|Wt),this.expressionScope.enter(xa()),this.prodParam.enter(Re),t.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(t,e,s,i=ua){if(N(this.state.type))t.id=this.parseIdentifier(),e&&this.declareNameFromIdentifier(t.id,i);else if(s||!e)t.id=null;else throw this.raise(c.MissingClassName,{at:this.state.startLoc})}parseClassSuper(t){t.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(t,e){let s=this.parseMaybeImportPhase(t,!0),i=this.maybeParseExportDefaultSpecifier(t,s),a=!i||this.eat(12),n=a&&this.eatExportStar(t),o=n&&this.maybeParseExportNamespaceSpecifier(t),u=a&&(!o||this.eat(12)),h=i||n;if(n&&!o){if(i&&this.unexpected(),e)throw this.raise(c.UnsupportedDecoratorExport,{at:t});return this.parseExportFrom(t,!0),this.finishNode(t,"ExportAllDeclaration")}let l=this.maybeParseExportNamedSpecifiers(t);i&&a&&!n&&!l&&this.unexpected(null,5),o&&u&&this.unexpected(null,97);let p;if(h||l){if(p=!1,e)throw this.raise(c.UnsupportedDecoratorExport,{at:t});this.parseExportFrom(t,h)}else p=this.maybeParseExportDeclaration(t);if(h||l||p){var f;let d=t;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(c.UnsupportedDecoratorExport,{at:t});return this.finishNode(d,"ExportNamedDeclaration")}if(this.eat(65)){let d=t,m=this.parseExportDefaultExpression();if(d.declaration=m,m.type==="ClassDeclaration")this.maybeTakeDecorators(e,m,d);else if(e)throw this.raise(c.UnsupportedDecoratorExport,{at: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==null?void 0:e.loc.start);let s=e||this.parseIdentifier(!0),i=this.startNodeAtNode(s);return i.exported=s,t.specifiers=[this.finishNode(i,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(t){if(this.isContextual(93)){t.specifiers||(t.specifiers=[]);let e=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),e.exported=this.parseModuleExportName(),t.specifiers.push(this.finishNode(e,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(t){if(this.match(5)){t.specifiers||(t.specifiers=[]);let e=t.exportKind==="type";return t.specifiers.push(...this.parseExportSpecifiers(e)),t.source=null,t.declaration=null,this.hasPlugin("importAssertions")&&(t.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(c.DecoratorBeforeExport,{at:this.state.startLoc}),this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(75)||this.match(74)||this.isLet())throw this.raise(c.UnsupportedDefaultExport,{at: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(N(t)){if(t===95&&!this.state.containsEsc||t===99)return!1;if((t===128||t===127)&&!this.state.containsEsc){let{type:i}=this.lookahead();if(N(i)&&i!==97||i===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||N(this.state.type)&&s)return!0;if(this.match(65)&&s){let i=this.input.charCodeAt(this.nextTokenStartSince(e+4));return i===34||i===39}return!1}parseExportFrom(t,e){this.eatContextual(97)?(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(c.DecoratorBeforeExport,{at:this.state.startLoc}),!0):t===74||t===75||t===68||t===80||this.isLet()||this.isAsyncFunction()}checkExport(t,e,s,i){if(e){if(s){if(this.checkDuplicateExports(t,"default"),this.hasPlugin("exportDefaultFrom")){var a;let n=t.declaration;n.type==="Identifier"&&n.name==="from"&&n.end-n.start===4&&!((a=n.extra)!=null&&a.parenthesized)&&this.raise(c.ExportDefaultFromAsIdentifier,{at:n})}}else if(t.specifiers&&t.specifiers.length)for(let n of t.specifiers){let{exported:o}=n,u=o.type==="Identifier"?o.name:o.value;if(this.checkDuplicateExports(n,u),!i&&n.local){let{local:h}=n;h.type!=="Identifier"?this.raise(c.ExportBindingIsString,{at:n,localName:h.value,exportName:u}):(this.checkReservedWord(h.name,h.loc.start,!0,!1),this.scope.checkLocalExport(h))}}else if(t.declaration){if(t.declaration.type==="FunctionDeclaration"||t.declaration.type==="ClassDeclaration"){let n=t.declaration.id;if(!n)throw new Error("Assertion failure");this.checkDuplicateExports(t,n.name)}else if(t.declaration.type==="VariableDeclaration")for(let n of t.declaration.declarations)this.checkDeclaration(n.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(c.DuplicateDefaultExport,{at:t}):this.raise(c.DuplicateExport,{at: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 i=this.isContextual(128),a=this.match(131),n=this.startNode();n.local=this.parseModuleExportName(),e.push(this.parseExportSpecifier(n,a,t,i))}return e}parseExportSpecifier(t,e,s,i){return this.eatContextual(93)?t.exported=this.parseModuleExportName():e?t.exported=Uu(t.local):t.exported||(t.exported=ie(t.local)),this.finishNode(t,"ExportSpecifier")}parseModuleExportName(){if(this.match(131)){let t=this.parseStringLiteral(this.state.value),e=t.value.match(hh);return e&&this.raise(c.ModuleExportNameHasLoneSurrogate,{at: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){if(t.module){var e;(t.specifiers.length!==1||t.specifiers[0].type!=="ImportDefaultSpecifier")&&this.raise(c.ImportReflectionNotBinding,{at:t.specifiers[0].loc.start}),((e=t.assertions)==null?void 0:e.length)>0&&this.raise(c.ImportReflectionHasAssertion,{at:t.specifiers[0].loc.start})}}checkJSONModuleImport(t){if(this.isJSONModuleImport(t)&&t.type!=="ExportAllDeclaration"){let{specifiers:e}=t;if(e!=null){let s=e.find(i=>{let a;if(i.type==="ExportSpecifier"?a=i.local:i.type==="ImportSpecifier"&&(a=i.imported),a!==void 0)return a.type==="Identifier"?a.name!=="default":a.value!=="default"});s!==void 0&&this.raise(c.ImportJSONBindingNotDefault,{at:s.loc.start})}}}isPotentialImportPhase(t){return!t&&this.isContextual(125)}applyImportPhase(t,e,s,i){e||(s==="module"?(this.expectPlugin("importReflection",i),t.module=!0):this.hasPlugin("importReflection")&&(t.module=!1))}parseMaybeImportPhase(t,e){if(!this.isPotentialImportPhase(e))return this.applyImportPhase(t,e,null),null;let s=this.parseIdentifier(!0),{type:i}=this.state;return(W(i)?i!==97||this.lookaheadCharCode()===102:i!==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 N(e)?e!==97||this.lookaheadCharCode()===102:e!==12}parseImport(t){return this.match(131)?this.parseImportSourceAndAttributes(t):this.parseImportSpecifiersAndAfter(t,this.parseMaybeImportPhase(t,!1))}parseImportSpecifiersAndAfter(t,e){t.specifiers=[];let i=!this.maybeParseDefaultImportSpecifier(t,e)||this.eat(12),a=i&&this.maybeParseStarImportSpecifier(t);return i&&!a&&this.parseNamedImportSpecifiers(t),this.expectContextual(97),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(131)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(t,e,s){e.local=this.parseIdentifier(),t.specifiers.push(this.finishImportSpecifier(e,s))}finishImportSpecifier(t,e,s=Fe){return this.checkLVal(t.local,{in:{type:e},binding:s}),this.finishNode(t,e)}parseImportAttributes(){this.expect(5);let t=[],e=new Set;do{if(this.match(8))break;let s=this.startNode(),i=this.state.value;if(e.has(i)&&this.raise(c.ModuleAttributesWithDuplicateKeys,{at:this.state.startLoc,key:i}),e.add(i),this.match(131)?s.key=this.parseStringLiteral(i):s.key=this.parseIdentifier(!0),this.expect(14),!this.match(131))throw this.raise(c.ModuleAttributeInvalidValue,{at: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(c.ModuleAttributeDifferentFromType,{at:s.key}),e.has(s.key.name)&&this.raise(c.ModuleAttributesWithDuplicateKeys,{at:s.key,key:s.key.name}),e.add(s.key.name),this.expect(14),!this.match(131))throw this.raise(c.ModuleAttributeInvalidValue,{at: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,s=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),this.hasPlugin("moduleAttributes")?e=this.parseModuleAttributes():(this.expectImportAttributesPlugin(),e=this.parseImportAttributes()),s=!0}else if(this.isContextual(94)&&!this.hasPrecedingLineBreak())this.hasPlugin("importAttributes")?(this.getPluginOption("importAttributes","deprecatedAssertSyntax")!==!0&&this.raise(c.ImportAttributesUseAssert,{at: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(W(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(c.DestructureNamedImport,{at:this.state.startLoc});if(this.expect(12),this.eat(8))break}let s=this.startNode(),i=this.match(131),a=this.isContextual(128);s.imported=this.parseModuleExportName();let n=this.parseImportSpecifier(s,i,t.importKind==="type"||t.importKind==="typeof",a,void 0);t.specifiers.push(n)}}parseImportSpecifier(t,e,s,i,a){if(this.eatContextual(93))t.local=this.parseIdentifier();else{let{imported:n}=t;if(e)throw this.raise(c.ImportBindingIsString,{at:t,importName:n.value});this.checkReservedWord(n.name,t.loc.start,!0,!0),t.local||(t.local=ie(n))}return this.finishImportSpecifier(t,"ImportSpecifier",a)}isThisParam(t){return t.type==="Identifier"&&t.name==="this"}},Jt=class extends Js{constructor(t,e){t=oh(t),super(t,e),this.options=t,this.initializeScopes(),this.plugins=ch(this.options.plugins),this.filename=t.sourceFilename}getScopeHandler(){return ut}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}};function ch(r){let t=new Map;for(let e of r){let[s,i]=Array.isArray(e)?e:[e,{}];t.has(s)||t.set(s,i||{})}return t}function ph(r,t){var e;if(((e=t)==null?void 0:e.sourceType)==="unambiguous"){t=Object.assign({},t);try{t.sourceType="module";let s=it(t,r),i=s.parse();if(s.sawUnambiguousESM)return i;if(s.ambiguousScriptDifferentAst)try{return t.sourceType="script",it(t,r).parse()}catch{}else i.program.sourceType="script";return i}catch(s){try{return t.sourceType="script",it(t,r).parse()}catch{}throw s}}else return it(t,r).parse()}function fh(r,t){let e=it(t,r);return e.options.strictMode&&(e.state.strict=!0),e.getExpression()}function dh(r){let t={};for(let e of Object.keys(r))t[e]=Q(r[e]);return t}var mh=dh(Go);function it(r,t){let e=Jt;return r!=null&&r.plugins&&(ah(r.plugins),e=yh(r.plugins)),new e(r,t)}var Jr={};function yh(r){let t=nh.filter(i=>O(r,i)),e=t.join("/"),s=Jr[e];if(!s){s=Jt;for(let i of t)s=Sa[i](s);Jr[e]=s}return s}ct.parse=ph;ct.parseExpression=fh;ct.tokTypes=mh});var Ia=I((ic,Ca)=>{"use strict";var{Duplex:xh}=require("stream");function Ea(r){r.emit("close")}function gh(){!this.destroyed&&this._writableState.finished&&this.destroy()}function va(r){this.removeListener("error",va),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function bh(r,t){let e=!0,s=new xh({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(a,n){let o=!n&&s._readableState.objectMode?a.toString():a;s.push(o)||r.pause()}),r.once("error",function(a){s.destroyed||(e=!1,s.destroy(a))}),r.once("close",function(){s.destroyed||s.push(null)}),s._destroy=function(i,a){if(r.readyState===r.CLOSED){a(i),process.nextTick(Ea,s);return}let n=!1;r.once("error",function(u){n=!0,a(u)}),r.once("close",function(){n||a(i),process.nextTick(Ea,s)}),e&&r.terminate()},s._final=function(i){if(r.readyState===r.CONNECTING){r.once("open",function(){s._final(i)});return}r._socket!==null&&(r._socket._writableState.finished?(i(),s._readableState.endEmitted&&s.destroy()):(r._socket.once("finish",function(){i()}),r.close()))},s._read=function(){r.isPaused&&r.resume()},s._write=function(i,a,n){if(r.readyState===r.CONNECTING){r.once("open",function(){s._write(i,a,n)});return}r.send(i,n)},s.on("end",gh),s.on("error",va),s}Ca.exports=bh});var pe=I((rc,Na)=>{"use strict";Na.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var pt=I((ac,Zt)=>{"use strict";var{EMPTY_BUFFER:Ph}=pe(),pi=Buffer[Symbol.species];function Th(r,t){if(r.length===0)return Ph;if(r.length===1)return r[0];let e=Buffer.allocUnsafe(t),s=0;for(let i=0;i<r.length;i++){let a=r[i];e.set(a,s),s+=a.length}return s<t?new pi(e.buffer,e.byteOffset,s):e}function ka(r,t,e,s,i){for(let a=0;a<i;a++)e[s+a]=r[a]^t[a&3]}function _a(r,t){for(let e=0;e<r.length;e++)r[e]^=t[e&3]}function Ah(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function fi(r){if(fi.readOnly=!0,Buffer.isBuffer(r))return r;let t;return r instanceof ArrayBuffer?t=new pi(r):ArrayBuffer.isView(r)?t=new pi(r.buffer,r.byteOffset,r.byteLength):(t=Buffer.from(r),fi.readOnly=!1),t}Zt.exports={concat:Th,mask:ka,toArrayBuffer:Ah,toBuffer:fi,unmask:_a};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=require("bufferutil");Zt.exports.mask=function(t,e,s,i,a){a<48?ka(t,e,s,i,a):r.mask(t,e,s,i,a)},Zt.exports.unmask=function(t,e){t.length<32?_a(t,e):r.unmask(t,e)}}catch{}});var Ma=I((nc,Oa)=>{"use strict";var La=Symbol("kDone"),di=Symbol("kRun"),mi=class{constructor(t){this[La]=()=>{this.pending--,this[di]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[di]()}[di](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[La])}}};Oa.exports=mi});var mt=I((oc,Ra)=>{"use strict";var ft=require("zlib"),Da=pt(),Sh=Ma(),{kStatusCode:Ba}=pe(),wh=Buffer[Symbol.species],Eh=Buffer.from([0,0,255,255]),ss=Symbol("permessage-deflate"),re=Symbol("total-length"),dt=Symbol("callback"),fe=Symbol("buffers"),ts=Symbol("error"),es,yi=class{constructor(t,e,s){if(this._maxPayload=s|0,this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!e,this._deflate=null,this._inflate=null,this.params=null,!es){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;es=new Sh(i)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[dt];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let e=this._options,s=t.find(i=>!(e.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(e.serverMaxWindowBits===!1||typeof e.serverMaxWindowBits=="number"&&e.serverMaxWindowBits>i.server_max_window_bits)||typeof e.clientMaxWindowBits=="number"&&!i.client_max_window_bits));if(!s)throw new Error("None of the extension offers can be accepted");return e.serverNoContextTakeover&&(s.server_no_context_takeover=!0),e.clientNoContextTakeover&&(s.client_no_context_takeover=!0),typeof e.serverMaxWindowBits=="number"&&(s.server_max_window_bits=e.serverMaxWindowBits),typeof e.clientMaxWindowBits=="number"?s.client_max_window_bits=e.clientMaxWindowBits:(s.client_max_window_bits===!0||e.clientMaxWindowBits===!1)&&delete s.client_max_window_bits,s}acceptAsClient(t){let e=t[0];if(this._options.clientNoContextTakeover===!1&&e.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!e.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(e.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&e.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return e}normalizeParams(t){return t.forEach(e=>{Object.keys(e).forEach(s=>{let i=e[s];if(i.length>1)throw new Error(`Parameter "${s}" must have only a single value`);if(i=i[0],s==="client_max_window_bits"){if(i!==!0){let a=+i;if(!Number.isInteger(a)||a<8||a>15)throw new TypeError(`Invalid value for parameter "${s}": ${i}`);i=a}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${s}": ${i}`)}else if(s==="server_max_window_bits"){let a=+i;if(!Number.isInteger(a)||a<8||a>15)throw new TypeError(`Invalid value for parameter "${s}": ${i}`);i=a}else if(s==="client_no_context_takeover"||s==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${s}": ${i}`)}else throw new Error(`Unknown parameter "${s}"`);e[s]=i})}),t}decompress(t,e,s){es.add(i=>{this._decompress(t,e,(a,n)=>{i(),s(a,n)})})}compress(t,e,s){es.add(i=>{this._compress(t,e,(a,n)=>{i(),s(a,n)})})}_decompress(t,e,s){let i=this._isServer?"client":"server";if(!this._inflate){let a=`${i}_max_window_bits`,n=typeof this.params[a]!="number"?ft.Z_DEFAULT_WINDOWBITS:this.params[a];this._inflate=ft.createInflateRaw({...this._options.zlibInflateOptions,windowBits:n}),this._inflate[ss]=this,this._inflate[re]=0,this._inflate[fe]=[],this._inflate.on("error",Ch),this._inflate.on("data",Fa)}this._inflate[dt]=s,this._inflate.write(t),e&&this._inflate.write(Eh),this._inflate.flush(()=>{let a=this._inflate[ts];if(a){this._inflate.close(),this._inflate=null,s(a);return}let n=Da.concat(this._inflate[fe],this._inflate[re]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[re]=0,this._inflate[fe]=[],e&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),s(null,n)})}_compress(t,e,s){let i=this._isServer?"server":"client";if(!this._deflate){let a=`${i}_max_window_bits`,n=typeof this.params[a]!="number"?ft.Z_DEFAULT_WINDOWBITS:this.params[a];this._deflate=ft.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:n}),this._deflate[re]=0,this._deflate[fe]=[],this._deflate.on("data",vh)}this._deflate[dt]=s,this._deflate.write(t),this._deflate.flush(ft.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let a=Da.concat(this._deflate[fe],this._deflate[re]);e&&(a=new wh(a.buffer,a.byteOffset,a.length-4)),this._deflate[dt]=null,this._deflate[re]=0,this._deflate[fe]=[],e&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),s(null,a)})}};Ra.exports=yi;function vh(r){this[fe].push(r),this[re]+=r.length}function Fa(r){if(this[re]+=r.length,this[ss]._maxPayload<1||this[re]<=this[ss]._maxPayload){this[fe].push(r);return}this[ts]=new RangeError("Max payload size exceeded"),this[ts].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[ts][Ba]=1009,this.removeListener("data",Fa),this.reset()}function Ch(r){this[ss]._inflate=null,r[Ba]=1007,this[dt](r)}});var yt=I((uc,is)=>{"use strict";var{isUtf8:Ua}=require("buffer"),Ih=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function Nh(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function xi(r){let t=r.length,e=0;for(;e<t;)if(!(r[e]&128))e++;else if((r[e]&224)===192){if(e+1===t||(r[e+1]&192)!==128||(r[e]&254)===192)return!1;e+=2}else if((r[e]&240)===224){if(e+2>=t||(r[e+1]&192)!==128||(r[e+2]&192)!==128||r[e]===224&&(r[e+1]&224)===128||r[e]===237&&(r[e+1]&224)===160)return!1;e+=3}else if((r[e]&248)===240){if(e+3>=t||(r[e+1]&192)!==128||(r[e+2]&192)!==128||(r[e+3]&192)!==128||r[e]===240&&(r[e+1]&240)===128||r[e]===244&&r[e+1]>143||r[e]>244)return!1;e+=4}else return!1;return!0}is.exports={isValidStatusCode:Nh,isValidUTF8:xi,tokenChars:Ih};if(Ua)is.exports.isValidUTF8=function(r){return r.length<24?xi(r):Ua(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=require("utf-8-validate");is.exports.isValidUTF8=function(t){return t.length<32?xi(t):r(t)}}catch{}});var Ti=I((hc,Ha)=>{"use strict";var{Writable:kh}=require("stream"),ja=mt(),{BINARY_TYPES:_h,EMPTY_BUFFER:$a,kStatusCode:Lh,kWebSocket:Oh}=pe(),{concat:gi,toArrayBuffer:Mh,unmask:Dh}=pt(),{isValidStatusCode:Bh,isValidUTF8:qa}=yt(),rs=Buffer[Symbol.species],xt=0,Va=1,Wa=2,za=3,bi=4,Fh=5,Pi=class extends kh{constructor(t={}){super(),this._binaryType=t.binaryType||_h[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[Oh]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._state=xt,this._loop=!1}_write(t,e,s){if(this._opcode===8&&this._state==xt)return s();this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(s)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let s=this._buffers[0];return this._buffers[0]=new rs(s.buffer,s.byteOffset+t,s.length-t),new rs(s.buffer,s.byteOffset,t)}let e=Buffer.allocUnsafe(t);do{let s=this._buffers[0],i=e.length-t;t>=s.length?e.set(this._buffers.shift(),i):(e.set(new Uint8Array(s.buffer,s.byteOffset,t),i),this._buffers[0]=new rs(s.buffer,s.byteOffset+t,s.length-t)),t-=s.length}while(t>0);return e}startLoop(t){let e;this._loop=!0;do switch(this._state){case xt:e=this.getInfo();break;case Va:e=this.getPayloadLength16();break;case Wa:e=this.getPayloadLength64();break;case za:this.getMask();break;case bi:e=this.getData(t);break;default:this._loop=!1;return}while(this._loop);t(e)}getInfo(){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if(t[0]&48)return this._loop=!1,D(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");let e=(t[0]&64)===64;if(e&&!this._extensions[ja.extensionName])return this._loop=!1,D(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(e)return this._loop=!1,D(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(!this._fragmented)return this._loop=!1,D(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented)return this._loop=!1,D(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");this._compressed=e}else if(this._opcode>7&&this._opcode<11){if(!this._fin)return this._loop=!1,D(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");if(e)return this._loop=!1,D(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1)return this._loop=!1,D(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH")}else return this._loop=!1,D(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked)return this._loop=!1,D(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK")}else if(this._masked)return this._loop=!1,D(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");if(this._payloadLength===126)this._state=Va;else if(this._payloadLength===127)this._state=Wa;else return this.haveLength()}getPayloadLength16(){if(this._bufferedBytes<2){this._loop=!1;return}return this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength()}getPayloadLength64(){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),e=t.readUInt32BE(0);return e>Math.pow(2,53-32)-1?(this._loop=!1,D(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH")):(this._payloadLength=e*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength())}haveLength(){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0))return this._loop=!1,D(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");this._masked?this._state=za:this._state=bi}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=bi}getData(t){let e=$a;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}e=this.consume(this._payloadLength),this._masked&&this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3]&&Dh(e,this._mask)}if(this._opcode>7)return this.controlMessage(e);if(this._compressed){this._state=Fh,this.decompress(e,t);return}return e.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(e)),this.dataMessage()}decompress(t,e){this._extensions[ja.extensionName].decompress(t,this._fin,(i,a)=>{if(i)return e(i);if(a.length){if(this._messageLength+=a.length,this._messageLength>this._maxPayload&&this._maxPayload>0)return e(D(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));this._fragments.push(a)}let n=this.dataMessage();if(n)return e(n);this.startLoop(e)})}dataMessage(){if(this._fin){let t=this._messageLength,e=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let s;this._binaryType==="nodebuffer"?s=gi(e,t):this._binaryType==="arraybuffer"?s=Mh(gi(e,t)):s=e,this.emit("message",s,!0)}else{let s=gi(e,t);if(!this._skipUTF8Validation&&!qa(s))return this._loop=!1,D(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("message",s,!1)}}this._state=xt}controlMessage(t){if(this._opcode===8)if(this._loop=!1,t.length===0)this.emit("conclude",1005,$a),this.end();else{let e=t.readUInt16BE(0);if(!Bh(e))return D(RangeError,`invalid status code ${e}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");let s=new rs(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!qa(s))return D(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("conclude",e,s),this.end()}else this._opcode===9?this.emit("ping",t):this.emit("pong",t);this._state=xt}};Ha.exports=Pi;function D(r,t,e,s,i){let a=new r(e?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(a,D),a.code=i,a[Lh]=s,a}});var Ai=I((pc,Xa)=>{"use strict";var lc=require("net"),cc=require("tls"),{randomFillSync:Rh}=require("crypto"),Ka=mt(),{EMPTY_BUFFER:Uh}=pe(),{isValidStatusCode:jh}=yt(),{mask:Ga,toBuffer:Ve}=pt(),z=Symbol("kByteLength"),$h=Buffer.alloc(4),J=class{constructor(t,e,s){this._extensions=e||{},s&&(this._generateMask=s,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(t,e){let s,i=!1,a=2,n=!1;e.mask&&(s=e.maskBuffer||$h,e.generateMask?e.generateMask(s):Rh(s,0,4),n=(s[0]|s[1]|s[2]|s[3])===0,a=6);let o;typeof t=="string"?(!e.mask||n)&&e[z]!==void 0?o=e[z]:(t=Buffer.from(t),o=t.length):(o=t.length,i=e.mask&&e.readOnly&&!n);let u=o;o>=65536?(a+=8,u=127):o>125&&(a+=2,u=126);let h=Buffer.allocUnsafe(i?o+a:a);return h[0]=e.fin?e.opcode|128:e.opcode,e.rsv1&&(h[0]|=64),h[1]=u,u===126?h.writeUInt16BE(o,2):u===127&&(h[2]=h[3]=0,h.writeUIntBE(o,4,6)),e.mask?(h[1]|=128,h[a-4]=s[0],h[a-3]=s[1],h[a-2]=s[2],h[a-1]=s[3],n?[h,t]:i?(Ga(t,s,h,a,o),[h]):(Ga(t,s,t,0,o),[h,t])):[h,t]}close(t,e,s,i){let a;if(t===void 0)a=Uh;else{if(typeof t!="number"||!jh(t))throw new TypeError("First argument must be a valid error code number");if(e===void 0||!e.length)a=Buffer.allocUnsafe(2),a.writeUInt16BE(t,0);else{let o=Buffer.byteLength(e);if(o>123)throw new RangeError("The message must not be greater than 123 bytes");a=Buffer.allocUnsafe(2+o),a.writeUInt16BE(t,0),typeof e=="string"?a.write(e,2):a.set(e,2)}}let n={[z]:a.length,fin:!0,generateMask:this._generateMask,mask:s,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._deflating?this.enqueue([this.dispatch,a,!1,n,i]):this.sendFrame(J.frame(a,n),i)}ping(t,e,s){let i,a;if(typeof t=="string"?(i=Buffer.byteLength(t),a=!1):(t=Ve(t),i=t.length,a=Ve.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let n={[z]:i,fin:!0,generateMask:this._generateMask,mask:e,maskBuffer:this._maskBuffer,opcode:9,readOnly:a,rsv1:!1};this._deflating?this.enqueue([this.dispatch,t,!1,n,s]):this.sendFrame(J.frame(t,n),s)}pong(t,e,s){let i,a;if(typeof t=="string"?(i=Buffer.byteLength(t),a=!1):(t=Ve(t),i=t.length,a=Ve.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let n={[z]:i,fin:!0,generateMask:this._generateMask,mask:e,maskBuffer:this._maskBuffer,opcode:10,readOnly:a,rsv1:!1};this._deflating?this.enqueue([this.dispatch,t,!1,n,s]):this.sendFrame(J.frame(t,n),s)}send(t,e,s){let i=this._extensions[Ka.extensionName],a=e.binary?2:1,n=e.compress,o,u;if(typeof t=="string"?(o=Buffer.byteLength(t),u=!1):(t=Ve(t),o=t.length,u=Ve.readOnly),this._firstFragment?(this._firstFragment=!1,n&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(n=o>=i._threshold),this._compress=n):(n=!1,a=0),e.fin&&(this._firstFragment=!0),i){let h={[z]:o,fin:e.fin,generateMask:this._generateMask,mask:e.mask,maskBuffer:this._maskBuffer,opcode:a,readOnly:u,rsv1:n};this._deflating?this.enqueue([this.dispatch,t,this._compress,h,s]):this.dispatch(t,this._compress,h,s)}else this.sendFrame(J.frame(t,{[z]:o,fin:e.fin,generateMask:this._generateMask,mask:e.mask,maskBuffer:this._maskBuffer,opcode:a,readOnly:u,rsv1:!1}),s)}dispatch(t,e,s,i){if(!e){this.sendFrame(J.frame(t,s),i);return}let a=this._extensions[Ka.extensionName];this._bufferedBytes+=s[z],this._deflating=!0,a.compress(t,s.fin,(n,o)=>{if(this._socket.destroyed){let u=new Error("The socket was closed while data was being compressed");typeof i=="function"&&i(u);for(let h=0;h<this._queue.length;h++){let l=this._queue[h],p=l[l.length-1];typeof p=="function"&&p(u)}return}this._bufferedBytes-=s[z],this._deflating=!1,s.readOnly=!1,this.sendFrame(J.frame(o,s),i),this.dequeue()})}dequeue(){for(;!this._deflating&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][z],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][z],this._queue.push(t)}sendFrame(t,e){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],e),this._socket.uncork()):this._socket.write(t[0],e)}};Xa.exports=J});var an=I((fc,rn)=>{"use strict";var{kForOnEventAttribute:gt,kListener:Si}=pe(),Ja=Symbol("kCode"),Ya=Symbol("kData"),Qa=Symbol("kError"),Za=Symbol("kMessage"),en=Symbol("kReason"),We=Symbol("kTarget"),tn=Symbol("kType"),sn=Symbol("kWasClean"),ae=class{constructor(t){this[We]=null,this[tn]=t}get target(){return this[We]}get type(){return this[tn]}};Object.defineProperty(ae.prototype,"target",{enumerable:!0});Object.defineProperty(ae.prototype,"type",{enumerable:!0});var we=class extends ae{constructor(t,e={}){super(t),this[Ja]=e.code===void 0?0:e.code,this[en]=e.reason===void 0?"":e.reason,this[sn]=e.wasClean===void 0?!1:e.wasClean}get code(){return this[Ja]}get reason(){return this[en]}get wasClean(){return this[sn]}};Object.defineProperty(we.prototype,"code",{enumerable:!0});Object.defineProperty(we.prototype,"reason",{enumerable:!0});Object.defineProperty(we.prototype,"wasClean",{enumerable:!0});var ze=class extends ae{constructor(t,e={}){super(t),this[Qa]=e.error===void 0?null:e.error,this[Za]=e.message===void 0?"":e.message}get error(){return this[Qa]}get message(){return this[Za]}};Object.defineProperty(ze.prototype,"error",{enumerable:!0});Object.defineProperty(ze.prototype,"message",{enumerable:!0});var bt=class extends ae{constructor(t,e={}){super(t),this[Ya]=e.data===void 0?null:e.data}get data(){return this[Ya]}};Object.defineProperty(bt.prototype,"data",{enumerable:!0});var qh={addEventListener(r,t,e={}){for(let i of this.listeners(r))if(!e[gt]&&i[Si]===t&&!i[gt])return;let s;if(r==="message")s=function(a,n){let o=new bt("message",{data:n?a:a.toString()});o[We]=this,as(t,this,o)};else if(r==="close")s=function(a,n){let o=new we("close",{code:a,reason:n.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});o[We]=this,as(t,this,o)};else if(r==="error")s=function(a){let n=new ze("error",{error:a,message:a.message});n[We]=this,as(t,this,n)};else if(r==="open")s=function(){let a=new ae("open");a[We]=this,as(t,this,a)};else return;s[gt]=!!e[gt],s[Si]=t,e.once?this.once(r,s):this.on(r,s)},removeEventListener(r,t){for(let e of this.listeners(r))if(e[Si]===t&&!e[gt]){this.removeListener(r,e);break}}};rn.exports={CloseEvent:we,ErrorEvent:ze,Event:ae,EventTarget:qh,MessageEvent:bt};function as(r,t,e){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,e):r.call(t,e)}});var wi=I((dc,nn)=>{"use strict";var{tokenChars:Pt}=yt();function Y(r,t,e){r[t]===void 0?r[t]=[e]:r[t].push(e)}function Vh(r){let t=Object.create(null),e=Object.create(null),s=!1,i=!1,a=!1,n,o,u=-1,h=-1,l=-1,p=0;for(;p<r.length;p++)if(h=r.charCodeAt(p),n===void 0)if(l===-1&&Pt[h]===1)u===-1&&(u=p);else if(p!==0&&(h===32||h===9))l===-1&&u!==-1&&(l=p);else if(h===59||h===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${p}`);l===-1&&(l=p);let d=r.slice(u,l);h===44?(Y(t,d,e),e=Object.create(null)):n=d,u=l=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);else if(o===void 0)if(l===-1&&Pt[h]===1)u===-1&&(u=p);else if(h===32||h===9)l===-1&&u!==-1&&(l=p);else if(h===59||h===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${p}`);l===-1&&(l=p),Y(e,r.slice(u,l),!0),h===44&&(Y(t,n,e),e=Object.create(null),n=void 0),u=l=-1}else if(h===61&&u!==-1&&l===-1)o=r.slice(u,p),u=l=-1;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(i){if(Pt[h]!==1)throw new SyntaxError(`Unexpected character at index ${p}`);u===-1?u=p:s||(s=!0),i=!1}else if(a)if(Pt[h]===1)u===-1&&(u=p);else if(h===34&&u!==-1)a=!1,l=p;else if(h===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(h===34&&r.charCodeAt(p-1)===61)a=!0;else if(l===-1&&Pt[h]===1)u===-1&&(u=p);else if(u!==-1&&(h===32||h===9))l===-1&&(l=p);else if(h===59||h===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${p}`);l===-1&&(l=p);let d=r.slice(u,l);s&&(d=d.replace(/\\/g,""),s=!1),Y(e,o,d),h===44&&(Y(t,n,e),e=Object.create(null),n=void 0),o=void 0,u=l=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);if(u===-1||a||h===32||h===9)throw new SyntaxError("Unexpected end of input");l===-1&&(l=p);let f=r.slice(u,l);return n===void 0?Y(t,f,e):(o===void 0?Y(e,f,!0):s?Y(e,o,f.replace(/\\/g,"")):Y(e,o,f),Y(t,n,e)),t}function Wh(r){return Object.keys(r).map(t=>{let e=r[t];return Array.isArray(e)||(e=[e]),e.map(s=>[t].concat(Object.keys(s).map(i=>{let a=s[i];return Array.isArray(a)||(a=[a]),a.map(n=>n===!0?i:`${i}=${n}`).join("; ")})).join("; ")).join(", ")}).join(", ")}nn.exports={format:Wh,parse:Vh}});var Ni=I((yc,xn)=>{"use strict";var zh=require("events"),Hh=require("https"),Kh=require("http"),hn=require("net"),Gh=require("tls"),{randomBytes:Xh,createHash:Jh}=require("crypto"),{Readable:mc}=require("stream"),{URL:Ei}=require("url"),de=mt(),Yh=Ti(),Qh=Ai(),{BINARY_TYPES:on,EMPTY_BUFFER:ns,GUID:Zh,kForOnEventAttribute:vi,kListener:el,kStatusCode:tl,kWebSocket:F,NOOP:ln}=pe(),{EventTarget:{addEventListener:sl,removeEventListener:il}}=an(),{format:rl,parse:al}=wi(),{toBuffer:nl}=pt(),ol=30*1e3,cn=Symbol("kAborted"),Ci=[8,13],ne=["CONNECTING","OPEN","CLOSING","CLOSED"],ul=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,w=class extends zh{constructor(t,e,s){super(),this._binaryType=on[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=ns,this._closeTimer=null,this._extensions={},this._paused=!1,this._protocol="",this._readyState=w.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,e===void 0?e=[]:Array.isArray(e)||(typeof e=="object"&&e!==null?(s=e,e=[]):e=[e]),pn(this,t,e,s)):this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(t){on.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,e,s){let i=new Yh({binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:s.maxPayload,skipUTF8Validation:s.skipUTF8Validation});this._sender=new Qh(t,this._extensions,s.generateMask),this._receiver=i,this._socket=t,i[F]=this,t[F]=this,i.on("conclude",cl),i.on("drain",pl),i.on("error",fl),i.on("message",dl),i.on("ping",ml),i.on("pong",yl),t.setTimeout(0),t.setNoDelay(),e.length>0&&t.unshift(e),t.on("close",dn),t.on("data",us),t.on("end",mn),t.on("error",yn),this._readyState=w.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=w.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[de.extensionName]&&this._extensions[de.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=w.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,e){if(this.readyState!==w.CLOSED){if(this.readyState===w.CONNECTING){let s="WebSocket was closed before the connection was established";q(this,this._req,s);return}if(this.readyState===w.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=w.CLOSING,this._sender.close(t,e,!this._isServer,s=>{s||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),ol)}}pause(){this.readyState===w.CONNECTING||this.readyState===w.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,e,s){if(this.readyState===w.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(s=t,t=e=void 0):typeof e=="function"&&(s=e,e=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==w.OPEN){Ii(this,t,s);return}e===void 0&&(e=!this._isServer),this._sender.ping(t||ns,e,s)}pong(t,e,s){if(this.readyState===w.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(s=t,t=e=void 0):typeof e=="function"&&(s=e,e=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==w.OPEN){Ii(this,t,s);return}e===void 0&&(e=!this._isServer),this._sender.pong(t||ns,e,s)}resume(){this.readyState===w.CONNECTING||this.readyState===w.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,e,s){if(this.readyState===w.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"&&(s=e,e={}),typeof t=="number"&&(t=t.toString()),this.readyState!==w.OPEN){Ii(this,t,s);return}let i={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...e};this._extensions[de.extensionName]||(i.compress=!1),this._sender.send(t||ns,i,s)}terminate(){if(this.readyState!==w.CLOSED){if(this.readyState===w.CONNECTING){let t="WebSocket was closed before the connection was established";q(this,this._req,t);return}this._socket&&(this._readyState=w.CLOSING,this._socket.destroy())}}};Object.defineProperty(w,"CONNECTING",{enumerable:!0,value:ne.indexOf("CONNECTING")});Object.defineProperty(w.prototype,"CONNECTING",{enumerable:!0,value:ne.indexOf("CONNECTING")});Object.defineProperty(w,"OPEN",{enumerable:!0,value:ne.indexOf("OPEN")});Object.defineProperty(w.prototype,"OPEN",{enumerable:!0,value:ne.indexOf("OPEN")});Object.defineProperty(w,"CLOSING",{enumerable:!0,value:ne.indexOf("CLOSING")});Object.defineProperty(w.prototype,"CLOSING",{enumerable:!0,value:ne.indexOf("CLOSING")});Object.defineProperty(w,"CLOSED",{enumerable:!0,value:ne.indexOf("CLOSED")});Object.defineProperty(w.prototype,"CLOSED",{enumerable:!0,value:ne.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(w.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(w.prototype,`on${r}`,{enumerable:!0,get(){for(let t of this.listeners(r))if(t[vi])return t[el];return null},set(t){for(let e of this.listeners(r))if(e[vi]){this.removeListener(r,e);break}typeof t=="function"&&this.addEventListener(r,t,{[vi]:!0})}})});w.prototype.addEventListener=sl;w.prototype.removeEventListener=il;xn.exports=w;function pn(r,t,e,s){let i={protocolVersion:Ci[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...s,createConnection:void 0,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(!Ci.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Ci.join(", ")})`);let a;if(t instanceof Ei)a=t,r._url=t.href;else{try{a=new Ei(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}r._url=t}let n=a.protocol==="wss:",o=a.protocol==="ws+unix:",u;if(a.protocol!=="ws:"&&!n&&!o?u=`The URL's protocol must be one of "ws:", "wss:", or "ws+unix:"`:o&&!a.pathname?u="The URL's pathname is empty":a.hash&&(u="The URL contains a fragment identifier"),u){let y=new SyntaxError(u);if(r._redirects===0)throw y;os(r,y);return}let h=n?443:80,l=Xh(16).toString("base64"),p=n?Hh.request:Kh.request,f=new Set,d;if(i.createConnection=n?ll:hl,i.defaultPort=i.defaultPort||h,i.port=a.port||h,i.host=a.hostname.startsWith("[")?a.hostname.slice(1,-1):a.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":l,Connection:"Upgrade",Upgrade:"websocket"},i.path=a.pathname+a.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(d=new de(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=rl({[de.extensionName]:d.offer()})),e.length){for(let y of e){if(typeof y!="string"||!ul.test(y)||f.has(y))throw new SyntaxError("An invalid or duplicated subprotocol was specified");f.add(y)}i.headers["Sec-WebSocket-Protocol"]=e.join(",")}if(i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(a.username||a.password)&&(i.auth=`${a.username}:${a.password}`),o){let y=i.path.split(":");i.socketPath=y[0],i.path=y[1]}let m;if(i.followRedirects){if(r._redirects===0){r._originalIpc=o,r._originalSecure=n,r._originalHostOrSocketPath=o?i.socketPath:a.host;let y=s&&s.headers;if(s={...s,headers:{}},y)for(let[P,S]of Object.entries(y))s.headers[P.toLowerCase()]=S}else if(r.listenerCount("redirect")===0){let y=o?r._originalIpc?i.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:a.host===r._originalHostOrSocketPath;(!y||r._originalSecure&&!n)&&(delete i.headers.authorization,delete i.headers.cookie,y||delete i.headers.host,i.auth=void 0)}i.auth&&!s.headers.authorization&&(s.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),m=r._req=p(i),r._redirects&&r.emit("redirect",r.url,m)}else m=r._req=p(i);i.timeout&&m.on("timeout",()=>{q(r,m,"Opening handshake has timed out")}),m.on("error",y=>{m===null||m[cn]||(m=r._req=null,os(r,y))}),m.on("response",y=>{let P=y.headers.location,S=y.statusCode;if(P&&i.followRedirects&&S>=300&&S<400){if(++r._redirects>i.maxRedirects){q(r,m,"Maximum redirects exceeded");return}m.abort();let _;try{_=new Ei(P,t)}catch{let M=new SyntaxError(`Invalid URL: ${P}`);os(r,M);return}pn(r,_,e,s)}else r.emit("unexpected-response",m,y)||q(r,m,`Unexpected server response: ${y.statusCode}`)}),m.on("upgrade",(y,P,S)=>{if(r.emit("upgrade",y),r.readyState!==w.CONNECTING)return;if(m=r._req=null,y.headers.upgrade.toLowerCase()!=="websocket"){q(r,P,"Invalid Upgrade header");return}let _=Jh("sha1").update(l+Zh).digest("base64");if(y.headers["sec-websocket-accept"]!==_){q(r,P,"Invalid Sec-WebSocket-Accept header");return}let R=y.headers["sec-websocket-protocol"],M;if(R!==void 0?f.size?f.has(R)||(M="Server sent an invalid subprotocol"):M="Server sent a subprotocol but none was requested":f.size&&(M="Server sent no subprotocol"),M){q(r,P,M);return}R&&(r._protocol=R);let St=y.headers["sec-websocket-extensions"];if(St!==void 0){if(!d){q(r,P,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let me;try{me=al(St)}catch{q(r,P,"Invalid Sec-WebSocket-Extensions header");return}let wt=Object.keys(me);if(wt.length!==1||wt[0]!==de.extensionName){q(r,P,"Server indicated an extension that was not requested");return}try{d.accept(me[de.extensionName])}catch{q(r,P,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[de.extensionName]=d}r.setSocket(P,S,{generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(m,r):m.end()}function os(r,t){r._readyState=w.CLOSING,r.emit("error",t),r.emitClose()}function hl(r){return r.path=r.socketPath,hn.connect(r)}function ll(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=hn.isIP(r.host)?"":r.host),Gh.connect(r)}function q(r,t,e){r._readyState=w.CLOSING;let s=new Error(e);Error.captureStackTrace(s,q),t.setHeader?(t[cn]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(os,r,s)):(t.destroy(s),t.once("error",r.emit.bind(r,"error")),t.once("close",r.emitClose.bind(r)))}function Ii(r,t,e){if(t){let s=nl(t).length;r._socket?r._sender._bufferedBytes+=s:r._bufferedAmount+=s}if(e){let s=new Error(`WebSocket is not open: readyState ${r.readyState} (${ne[r.readyState]})`);process.nextTick(e,s)}}function cl(r,t){let e=this[F];e._closeFrameReceived=!0,e._closeMessage=t,e._closeCode=r,e._socket[F]!==void 0&&(e._socket.removeListener("data",us),process.nextTick(fn,e._socket),r===1005?e.close():e.close(r,t))}function pl(){let r=this[F];r.isPaused||r._socket.resume()}function fl(r){let t=this[F];t._socket[F]!==void 0&&(t._socket.removeListener("data",us),process.nextTick(fn,t._socket),t.close(r[tl])),t.emit("error",r)}function un(){this[F].emitClose()}function dl(r,t){this[F].emit("message",r,t)}function ml(r){let t=this[F];t.pong(r,!t._isServer,ln),t.emit("ping",r)}function yl(r){this[F].emit("pong",r)}function fn(r){r.resume()}function dn(){let r=this[F];this.removeListener("close",dn),this.removeListener("data",us),this.removeListener("end",mn),r._readyState=w.CLOSING;let t;!this._readableState.endEmitted&&!r._closeFrameReceived&&!r._receiver._writableState.errorEmitted&&(t=r._socket.read())!==null&&r._receiver.write(t),r._receiver.end(),this[F]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",un),r._receiver.on("finish",un))}function us(r){this[F]._receiver.write(r)||this.pause()}function mn(){let r=this[F];r._readyState=w.CLOSING,r._receiver.end(),this.end()}function yn(){let r=this[F];this.removeListener("error",yn),this.on("error",ln),r&&(r._readyState=w.CLOSING,this.destroy())}});var bn=I((xc,gn)=>{"use strict";var{tokenChars:xl}=yt();function gl(r){let t=new Set,e=-1,s=-1,i=0;for(i;i<r.length;i++){let n=r.charCodeAt(i);if(s===-1&&xl[n]===1)e===-1&&(e=i);else if(i!==0&&(n===32||n===9))s===-1&&e!==-1&&(s=i);else if(n===44){if(e===-1)throw new SyntaxError(`Unexpected character at index ${i}`);s===-1&&(s=i);let o=r.slice(e,s);if(t.has(o))throw new SyntaxError(`The "${o}" subprotocol is duplicated`);t.add(o),e=s=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(e===-1||s!==-1)throw new SyntaxError("Unexpected end of input");let a=r.slice(e,i);if(t.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);return t.add(a),t}gn.exports={parse:gl}});var vn=I((Tc,En)=>{"use strict";var bl=require("events"),hs=require("http"),gc=require("https"),bc=require("net"),Pc=require("tls"),{createHash:Pl}=require("crypto"),Pn=wi(),Ee=mt(),Tl=bn(),Al=Ni(),{GUID:Sl,kWebSocket:wl}=pe(),El=/^[+/0-9A-Za-z]{22}==$/,Tn=0,An=1,wn=2,ki=class extends bl{constructor(t,e){if(super(),t={maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:Al,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=hs.createServer((s,i)=>{let a=hs.STATUS_CODES[426];i.writeHead(426,{"Content-Length":a.length,"Content-Type":"text/plain"}),i.end(a)}),this._server.listen(t.port,t.host,t.backlog,e)):t.server&&(this._server=t.server),this._server){let s=this.emit.bind(this,"connection");this._removeListeners=vl(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,a,n)=>{this.handleUpgrade(i,a,n,s)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=Tn}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===wn){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(Tt,this);return}if(t&&this.once("close",t),this._state!==An)if(this._state=An,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(Tt,this):process.nextTick(Tt,this);else{let e=this._server;this._removeListeners(),this._removeListeners=this._server=null,e.close(()=>{Tt(this)})}}shouldHandle(t){if(this.options.path){let e=t.url.indexOf("?");if((e!==-1?t.url.slice(0,e):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,e,s,i){e.on("error",Sn);let a=t.headers["sec-websocket-key"],n=+t.headers["sec-websocket-version"];if(t.method!=="GET"){ve(this,t,e,405,"Invalid HTTP method");return}if(t.headers.upgrade.toLowerCase()!=="websocket"){ve(this,t,e,400,"Invalid Upgrade header");return}if(!a||!El.test(a)){ve(this,t,e,400,"Missing or invalid Sec-WebSocket-Key header");return}if(n!==8&&n!==13){ve(this,t,e,400,"Missing or invalid Sec-WebSocket-Version header");return}if(!this.shouldHandle(t)){At(e,400);return}let o=t.headers["sec-websocket-protocol"],u=new Set;if(o!==void 0)try{u=Tl.parse(o)}catch{ve(this,t,e,400,"Invalid Sec-WebSocket-Protocol header");return}let h=t.headers["sec-websocket-extensions"],l={};if(this.options.perMessageDeflate&&h!==void 0){let p=new Ee(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let f=Pn.parse(h);f[Ee.extensionName]&&(p.accept(f[Ee.extensionName]),l[Ee.extensionName]=p)}catch{ve(this,t,e,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let p={origin:t.headers[`${n===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(p,(f,d,m,y)=>{if(!f)return At(e,d||401,m,y);this.completeUpgrade(l,a,u,t,e,s,i)});return}if(!this.options.verifyClient(p))return At(e,401)}this.completeUpgrade(l,a,u,t,e,s,i)}completeUpgrade(t,e,s,i,a,n,o){if(!a.readable||!a.writable)return a.destroy();if(a[wl])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Tn)return At(a,503);let h=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Pl("sha1").update(e+Sl).digest("base64")}`],l=new this.options.WebSocket(null);if(s.size){let p=this.options.handleProtocols?this.options.handleProtocols(s,i):s.values().next().value;p&&(h.push(`Sec-WebSocket-Protocol: ${p}`),l._protocol=p)}if(t[Ee.extensionName]){let p=t[Ee.extensionName].params,f=Pn.format({[Ee.extensionName]:[p]});h.push(`Sec-WebSocket-Extensions: ${f}`),l._extensions=t}this.emit("headers",h,i),a.write(h.concat(`\r
|
|
16
|
+
`).join(`\r
|
|
17
|
+
`)),a.removeListener("error",Sn),l.setSocket(a,n,{maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(l),l.on("close",()=>{this.clients.delete(l),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Tt,this)})),o(l,i)}};En.exports=ki;function vl(r,t){for(let e of Object.keys(t))r.on(e,t[e]);return function(){for(let s of Object.keys(t))r.removeListener(s,t[s])}}function Tt(r){r._state=wn,r.emit("close")}function Sn(){this.destroy()}function At(r,t,e,s){e=e||hs.STATUS_CODES[t],s={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(e),...s},r.once("finish",r.destroy),r.end(`HTTP/1.1 ${t} ${hs.STATUS_CODES[t]}\r
|
|
18
|
+
`+Object.keys(s).map(i=>`${i}: ${s[i]}`).join(`\r
|
|
46
19
|
`)+`\r
|
|
47
20
|
\r
|
|
48
|
-
`);let u="",f=m=>{let x,b;if(!l&&(u+=m.toString("binary"),x=u.match(/\r\n\r\n/))){if(o.removeListener("data",f),b=u.substr(x.index+x[0].length),u=u.substr(0,x.index),b&&o.unshift(Buffer.from(b,"binary")),l=!0,x=u.match(/^HTTP\/\d+\.\d+ (\d+)/i),!x||(x[1]||"").charAt(0)!=="2"){try{o.destroy()}catch{}return i(new Error("Invalid response from proxy"+(x&&": "+x[1]||"")))}return o.removeListener("error",c),o.removeListener("timeout",p),o.setTimeout(0),i(null,o)}};o.on("data",f)}),o.setTimeout(xn.timeout||30*1e3),o.on("timeout",p),o.once("error",c)}gn.exports=xn});var wn=T((zu,bn)=>{"use strict";var vn=j(),Kp=ls(),Le=it(),ys=class{constructor(t,e){this.mailer=t,this.data={},this.message=null,e=e||{};let i=t.options||{},s=t._defaults||{};Object.keys(e).forEach(a=>{this.data[a]=e[a]}),this.data.headers=this.data.headers||{},Object.keys(s).forEach(a=>{a in this.data?a==="headers"&&Object.keys(s.headers).forEach(r=>{r in this.data.headers||(this.data.headers[r]=s.headers[r])}):this.data[a]=s[a]}),["disableFileAccess","disableUrlAccess","normalizeHeaderKey"].forEach(a=>{a in i&&(this.data[a]=i[a])})}resolveContent(...t){return vn.resolveContent(...t)}resolveAll(t){let e=[[this.data,"html"],[this.data,"text"],[this.data,"watchHtml"],[this.data,"amp"],[this.data,"icalEvent"]];this.data.alternatives&&this.data.alternatives.length&&this.data.alternatives.forEach((l,c)=>{e.push([this.data.alternatives,c])}),this.data.attachments&&this.data.attachments.length&&this.data.attachments.forEach((l,c)=>{l.filename||(l.filename=(l.path||l.href||"").split("/").pop().split("?").shift()||"attachment-"+(c+1),l.filename.indexOf(".")<0&&(l.filename+="."+Le.detectExtension(l.contentType))),l.contentType||(l.contentType=Le.detectMimeType(l.filename||l.path||l.href||"bin")),e.push([this.data.attachments,c])});let i=new Kp;["from","to","cc","bcc","sender","replyTo"].forEach(l=>{let c;this.message?c=[].concat(i._parseAddresses(this.message.getHeader(l==="replyTo"?"reply-to":l))||[]):this.data[l]&&(c=[].concat(i._parseAddresses(this.data[l])||[])),c&&c.length?this.data[l]=c:l in this.data&&(this.data[l]=null)}),["from","sender"].forEach(l=>{this.data[l]&&(this.data[l]=this.data[l].shift())});let r=0,o=()=>{if(r>=e.length)return t(null,this.data);let l=e[r++];if(!l[0]||!l[0][l[1]])return o();vn.resolveContent(...l,(c,p)=>{if(c)return t(c);let h={content:p};l[0][l[1]]&&typeof l[0][l[1]]=="object"&&!Buffer.isBuffer(l[0][l[1]])&&Object.keys(l[0][l[1]]).forEach(u=>{!(u in h)&&!["content","path","href","raw"].includes(u)&&(h[u]=l[0][l[1]][u])}),l[0][l[1]]=h,o()})};setImmediate(()=>o())}normalize(t){let e=this.data.envelope||this.message.getEnvelope(),i=this.message.messageId();this.resolveAll((s,a)=>s?t(s):(a.envelope=e,a.messageId=i,["html","text","watchHtml","amp"].forEach(r=>{a[r]&&a[r].content&&(typeof a[r].content=="string"?a[r]=a[r].content:Buffer.isBuffer(a[r].content)&&(a[r]=a[r].content.toString()))}),a.icalEvent&&Buffer.isBuffer(a.icalEvent.content)&&(a.icalEvent.content=a.icalEvent.content.toString("base64"),a.icalEvent.encoding="base64"),a.alternatives&&a.alternatives.length&&a.alternatives.forEach(r=>{r&&r.content&&Buffer.isBuffer(r.content)&&(r.content=r.content.toString("base64"),r.encoding="base64")}),a.attachments&&a.attachments.length&&a.attachments.forEach(r=>{r&&r.content&&Buffer.isBuffer(r.content)&&(r.content=r.content.toString("base64"),r.encoding="base64")}),a.normalizedHeaders={},Object.keys(a.headers||{}).forEach(r=>{let o=[].concat(a.headers[r]||[]).shift();o=o&&o.value||o,o&&(["references","in-reply-to","message-id","content-id"].includes(r)&&(o=this.message._encodeHeaderValue(r,o)),a.normalizedHeaders[r]=o)}),a.list&&typeof a.list=="object"&&this._getListHeaders(a.list).forEach(o=>{a.normalizedHeaders[o.key]=o.value.map(l=>l&&l.value||l).join(", ")}),a.references&&(a.normalizedHeaders.references=this.message._encodeHeaderValue("references",a.references)),a.inReplyTo&&(a.normalizedHeaders["in-reply-to"]=this.message._encodeHeaderValue("in-reply-to",a.inReplyTo)),t(null,a)))}setMailerHeader(){!this.message||!this.data.xMailer||this.message.setHeader("X-Mailer",this.data.xMailer)}setPriorityHeaders(){if(!(!this.message||!this.data.priority))switch((this.data.priority||"").toString().toLowerCase()){case"high":this.message.setHeader("X-Priority","1 (Highest)"),this.message.setHeader("X-MSMail-Priority","High"),this.message.setHeader("Importance","High");break;case"low":this.message.setHeader("X-Priority","5 (Lowest)"),this.message.setHeader("X-MSMail-Priority","Low"),this.message.setHeader("Importance","Low");break;default:}}setListHeaders(){!this.message||!this.data.list||typeof this.data.list!="object"||this.data.list&&typeof this.data.list=="object"&&this._getListHeaders(this.data.list).forEach(t=>{t.value.forEach(e=>{this.message.addHeader(t.key,e)})})}_getListHeaders(t){return Object.keys(t).map(e=>({key:"list-"+e.toLowerCase().trim(),value:[].concat(t[e]||[]).map(i=>({prepared:!0,foldLines:!0,value:[].concat(i||[]).map(s=>{if(typeof s=="string"&&(s={url:s}),s&&s.url){if(e.toLowerCase().trim()==="id"){let r=s.comment||"";return Le.isPlainText(r)?r='"'+r+'"':r=Le.encodeWord(r),(s.comment?r+" ":"")+this._formatListUrl(s.url).replace(/^<[^:]+\/{,2}/,"")}let a=s.comment||"";return Le.isPlainText(a)||(a=Le.encodeWord(a)),this._formatListUrl(s.url)+(s.comment?" ("+a+")":"")}return""}).filter(s=>s).join(", ")}))}))}_formatListUrl(t){return t=t.replace(/[\s<]+|[\s>]+/g,""),/^(https?|mailto|ftp):/.test(t)?"<"+t+">":/^[^@]+@[^@]+$/.test(t)?"<mailto:"+t+">":"<http://"+t+">"}};bn.exports=ys});var En=T((Hu,An)=>{"use strict";var Vp=require("events"),Pn=j(),Wp=Gi(),Gp=an(),Tn=dn(),Xp=yn(),Jp=require("util"),Qp=require("url"),vs=q(),Yp=wn(),Zp=require("net"),eh=require("dns"),th=require("crypto"),bs=class extends Vp{constructor(t,e,i){super(),this.options=e||{},this._defaults=i||{},this._defaultPlugins={compile:[(...s)=>this._convertDataImages(...s)],stream:[]},this._userPlugins={compile:[],stream:[]},this.meta=new Map,this.dkim=this.options.dkim?new Tn(this.options.dkim):!1,this.transporter=t,this.transporter.mailer=this,this.logger=Pn.getLogger(this.options,{component:this.options.component||"mail"}),this.logger.debug({tnx:"create"},"Creating transport: %s",this.getVersionString()),typeof this.transporter.on=="function"&&(this.transporter.on("log",s=>{this.logger.debug({tnx:"transport"},"%s: %s",s.type,s.message)}),this.transporter.on("error",s=>{this.logger.error({err:s,tnx:"transport"},"Transport Error: %s",s.message),this.emit("error",s)}),this.transporter.on("idle",(...s)=>{this.emit("idle",...s)})),["close","isIdle","verify"].forEach(s=>{this[s]=(...a)=>typeof this.transporter[s]=="function"?(s==="verify"&&typeof this.getSocket=="function"&&(this.transporter.getSocket=this.getSocket,this.getSocket=!1),this.transporter[s](...a)):(this.logger.warn({tnx:"transport",methodName:s},"Non existing method %s called for transport",s),!1)}),this.options.proxy&&typeof this.options.proxy=="string"&&this.setupProxy(this.options.proxy)}use(t,e){return t=(t||"").toString(),this._userPlugins.hasOwnProperty(t)?this._userPlugins[t].push(e):this._userPlugins[t]=[e],this}sendMail(t,e=null){let i;e||(i=new Promise((a,r)=>{e=Pn.callbackPromise(a,r)})),typeof this.getSocket=="function"&&(this.transporter.getSocket=this.getSocket,this.getSocket=!1);let s=new Yp(this,t);return this.logger.debug({tnx:"transport",name:this.transporter.name,version:this.transporter.version,action:"send"},"Sending mail using %s/%s",this.transporter.name,this.transporter.version),this._processPlugins("compile",s,a=>{if(a)return this.logger.error({err:a,tnx:"plugin",action:"compile"},"PluginCompile Error: %s",a.message),e(a);s.message=new Gp(s.data).compile(),s.setMailerHeader(),s.setPriorityHeaders(),s.setListHeaders(),this._processPlugins("stream",s,r=>{if(r)return this.logger.error({err:r,tnx:"plugin",action:"stream"},"PluginStream Error: %s",r.message),e(r);(s.data.dkim||this.dkim)&&s.message.processFunc(o=>{let l=s.data.dkim?new Tn(s.data.dkim):this.dkim;return this.logger.debug({tnx:"DKIM",messageId:s.message.messageId(),dkimDomains:l.keys.map(c=>c.keySelector+"."+c.domainName).join(", ")},"Signing outgoing message with %s keys",l.keys.length),l.sign(o,s.data._dkim)}),this.transporter.send(s,(...o)=>{o[0]&&this.logger.error({err:o[0],tnx:"transport",action:"send"},"Send Error: %s",o[0].message),e(...o)})})}),i}getVersionString(){return Jp.format("%s (%s; +%s; %s/%s)",vs.name,vs.version,vs.homepage,this.transporter.name,this.transporter.version)}_processPlugins(t,e,i){if(t=(t||"").toString(),!this._userPlugins.hasOwnProperty(t))return i();let s=this._userPlugins[t]||[],a=this._defaultPlugins[t]||[];if(s.length&&this.logger.debug({tnx:"transaction",pluginCount:s.length,step:t},"Using %s plugins for %s",s.length,t),s.length+a.length===0)return i();let r=0,o="default",l=()=>{let c=o==="default"?a:s;if(r>=c.length)if(o==="default"&&s.length)o="user",r=0,c=s;else return i();let p=c[r++];p(e,h=>{if(h)return i(h);l()})};l()}setupProxy(t){let e=Qp.parse(t);this.getSocket=(i,s)=>{let a=e.protocol.replace(/:$/,"").toLowerCase();if(this.meta.has("proxy_handler_"+a))return this.meta.get("proxy_handler_"+a)(e,i,s);switch(a){case"http":case"https":Xp(e.href,i.port,i.host,(r,o)=>r?s(r):s(null,{connection:o}));return;case"socks":case"socks5":case"socks4":case"socks4a":{if(!this.meta.has("proxy_socks_module"))return s(new Error("Socks module not loaded"));let r=o=>{let l=!!this.meta.get("proxy_socks_module").SocksClient,c=l?this.meta.get("proxy_socks_module").SocksClient:this.meta.get("proxy_socks_module"),p=Number(e.protocol.replace(/\D/g,""))||5,h={proxy:{ipaddress:o,port:Number(e.port),type:p},[l?"destination":"target"]:{host:i.host,port:i.port},command:"connect"};if(e.auth){let u=decodeURIComponent(e.auth.split(":").shift()),f=decodeURIComponent(e.auth.split(":").pop());l?(h.proxy.userId=u,h.proxy.password=f):p===4?h.userid=u:h.authentication={username:u,password:f}}c.createConnection(h,(u,f)=>u?s(u):s(null,{connection:f.socket||f}))};return Zp.isIP(e.hostname)?r(e.hostname):eh.resolve(e.hostname,(o,l)=>{if(o)return s(o);r(Array.isArray(l)?l[0]:l)})}}s(new Error("Unknown proxy configuration"))}}_convertDataImages(t,e){if(!this.options.attachDataUrls&&!t.data.attachDataUrls||!t.data.html)return e();t.resolveContent(t.data,"html",(i,s)=>{if(i)return e(i);let a=0;s=(s||"").toString().replace(/(<img\b[^>]* src\s*=[\s"']*)(data:([^;]+);[^"'>\s]+)/gi,(r,o,l,c)=>{let p=th.randomBytes(10).toString("hex")+"@localhost";return t.data.attachments||(t.data.attachments=[]),Array.isArray(t.data.attachments)||(t.data.attachments=[].concat(t.data.attachments||[])),t.data.attachments.push({path:l,cid:p,filename:"image-"+ ++a+"."+Wp.detectExtension(c)}),o+"cid:"+p}),t.data.html=s,e()})}set(t,e){return this.meta.set(t,e)}get(t){return this.meta.get(t)}};An.exports=bs});var Cn=T(($u,Sn)=>{"use strict";var ih=require("stream"),sh=ih.Transform,ws=class extends sh{constructor(t){super(t),this.options=t||{},this._curLine="",this.inByteCount=0,this.outByteCount=0,this.lastByte=!1}_transform(t,e,i){let s=[],a=0,r,o,l=0,c;if(!t||!t.length)return i();for(typeof t=="string"&&(t=Buffer.from(t)),this.inByteCount+=t.length,r=0,o=t.length;r<o;r++)t[r]===46?(r&&t[r-1]===10||!r&&(!this.lastByte||this.lastByte===10))&&(c=t.slice(l,r+1),s.push(c),s.push(Buffer.from(".")),a+=c.length+1,l=r+1):t[r]===10&&(r&&t[r-1]!==13||!r&&this.lastByte!==13)&&(r>l?(c=t.slice(l,r),s.push(c),a+=c.length+2):a+=2,s.push(Buffer.from(`\r
|
|
49
|
-
`)),l=r+1);a?(l<t.length&&(c=t.slice(l),s.push(c),a+=c.length),this.outByteCount+=a,this.push(Buffer.concat(s,a))):(this.outByteCount+=t.length,this.push(t)),this.lastByte=t[t.length-1],i()}_flush(t){let e;this.lastByte===10?e=Buffer.from(`.\r
|
|
50
|
-
`):this.lastByte===13?e=Buffer.from(`
|
|
51
|
-
.\r
|
|
52
|
-
`):e=Buffer.from(`\r
|
|
53
|
-
.\r
|
|
54
|
-
`),this.outByteCount+=e.length,this.push(e),t()}};Sn.exports=ws});var Ft=T((Ku,_n)=>{"use strict";var ah=q(),rh=require("events").EventEmitter,nh=require("net"),kn=require("tls"),oh=require("os"),In=require("crypto"),lh=Cn(),ch=require("stream").PassThrough,se=j(),ph=2*60*1e3,Nn=10*60*1e3,hh=30*1e3,uh=30*1e3,Ps=class extends rh{constructor(t){super(t),this.id=In.randomBytes(8).toString("base64").replace(/\W/g,""),this.stage="init",this.options=t||{},this.secureConnection=!!this.options.secure,this.alreadySecured=!!this.options.secured,this.port=Number(this.options.port)||(this.secureConnection?465:587),this.host=this.options.host||"localhost",this.allowInternalNetworkInterfaces=this.options.allowInternalNetworkInterfaces||!1,typeof this.options.secure>"u"&&this.port===465&&(this.secureConnection=!0),this.name=this.options.name||this._getHostname(),this.logger=se.getLogger(this.options,{component:this.options.component||"smtp-connection",sid:this.id}),this.customAuth=new Map,Object.keys(this.options.customAuth||{}).forEach(e=>{let i=(e||"").toString().trim().toUpperCase();i&&this.customAuth.set(i,this.options.customAuth[e])}),this.version=ah.version,this.authenticated=!1,this.destroyed=!1,this.secure=!!this.secureConnection,this._remainder="",this._responseQueue=[],this.lastServerResponse=!1,this._socket=!1,this._supportedAuth=[],this.allowsAuth=!1,this._envelope=!1,this._supportedExtensions=[],this._maxAllowedSize=0,this._responseActions=[],this._recipientQueue=[],this._greetingTimeout=!1,this._connectionTimeout=!1,this._destroyed=!1,this._closing=!1,this._onSocketData=e=>this._onData(e),this._onSocketError=e=>this._onError(e,"ESOCKET",!1,"CONN"),this._onSocketClose=()=>this._onClose(),this._onSocketEnd=()=>this._onEnd(),this._onSocketTimeout=()=>this._onTimeout()}connect(t){if(typeof t=="function"){this.once("connect",()=>{this.logger.debug({tnx:"smtp"},"SMTP handshake finished"),t()});let s=this._isDestroyedMessage("connect");if(s)return t(this._formatError(s,"ECONNECTION",!1,"CONN"))}let e={port:this.port,host:this.host,allowInternalNetworkInterfaces:this.allowInternalNetworkInterfaces,timeout:this.options.dnsTimeout||uh};this.options.localAddress&&(e.localAddress=this.options.localAddress);let i=()=>{this._connectionTimeout=setTimeout(()=>{this._onError("Connection timeout","ETIMEDOUT",!1,"CONN")},this.options.connectionTimeout||ph),this._socket.on("error",this._onSocketError)};if(this.options.connection){this._socket=this.options.connection,this.secureConnection&&!this.alreadySecured?setImmediate(()=>this._upgradeConnection(s=>{if(s){this._onError(new Error("Error initiating TLS - "+(s.message||s)),"ETLS",!1,"CONN");return}this._onConnect()})):setImmediate(()=>this._onConnect());return}else return this.options.socket?(this._socket=this.options.socket,se.resolveHostname(e,(s,a)=>{if(s)return setImmediate(()=>this._onError(s,"EDNS",!1,"CONN"));this.logger.debug({tnx:"dns",source:e.host,resolved:a.host,cached:!!a.cached},"Resolved %s as %s [cache %s]",e.host,a.host,a.cached?"hit":"miss"),Object.keys(a).forEach(r=>{r.charAt(0)!=="_"&&a[r]&&(e[r]=a[r])});try{this._socket.connect(this.port,this.host,()=>{this._socket.setKeepAlive(!0),this._onConnect()}),i()}catch(r){return setImmediate(()=>this._onError(r,"ECONNECTION",!1,"CONN"))}})):this.secureConnection?(this.options.tls&&Object.keys(this.options.tls).forEach(s=>{e[s]=this.options.tls[s]}),se.resolveHostname(e,(s,a)=>{if(s)return setImmediate(()=>this._onError(s,"EDNS",!1,"CONN"));this.logger.debug({tnx:"dns",source:e.host,resolved:a.host,cached:!!a.cached},"Resolved %s as %s [cache %s]",e.host,a.host,a.cached?"hit":"miss"),Object.keys(a).forEach(r=>{r.charAt(0)!=="_"&&a[r]&&(e[r]=a[r])});try{this._socket=kn.connect(e,()=>{this._socket.setKeepAlive(!0),this._onConnect()}),i()}catch(r){return setImmediate(()=>this._onError(r,"ECONNECTION",!1,"CONN"))}})):se.resolveHostname(e,(s,a)=>{if(s)return setImmediate(()=>this._onError(s,"EDNS",!1,"CONN"));this.logger.debug({tnx:"dns",source:e.host,resolved:a.host,cached:!!a.cached},"Resolved %s as %s [cache %s]",e.host,a.host,a.cached?"hit":"miss"),Object.keys(a).forEach(r=>{r.charAt(0)!=="_"&&a[r]&&(e[r]=a[r])});try{this._socket=nh.connect(e,()=>{this._socket.setKeepAlive(!0),this._onConnect()}),i()}catch(r){return setImmediate(()=>this._onError(r,"ECONNECTION",!1,"CONN"))}})}quit(){this._sendCommand("QUIT"),this._responseActions.push(this.close)}close(){if(clearTimeout(this._connectionTimeout),clearTimeout(this._greetingTimeout),this._responseActions=[],this._closing)return;this._closing=!0;let t="end";this.stage==="init"&&(t="destroy"),this.logger.debug({tnx:"smtp"},'Closing connection to the server using "%s"',t);let e=this._socket&&this._socket.socket||this._socket;if(e&&!e.destroyed)try{this._socket[t]()}catch{}this._destroy()}login(t,e){let i=this._isDestroyedMessage("login");if(i)return e(this._formatError(i,"ECONNECTION",!1,"API"));if(this._auth=t||{},this._authMethod=(this._auth.method||"").toString().trim().toUpperCase()||!1,!this._authMethod&&this._auth.oauth2&&!this._auth.credentials?this._authMethod="XOAUTH2":(!this._authMethod||this._authMethod==="XOAUTH2"&&!this._auth.oauth2)&&(this._authMethod=(this._supportedAuth[0]||"PLAIN").toUpperCase().trim()),this._authMethod!=="XOAUTH2"&&(!this._auth.credentials||!this._auth.credentials.user||!this._auth.credentials.pass))if(this._auth.user&&this._auth.pass)this._auth.credentials={user:this._auth.user,pass:this._auth.pass,options:this._auth.options};else return e(this._formatError('Missing credentials for "'+this._authMethod+'"',"EAUTH",!1,"API"));if(this.customAuth.has(this._authMethod)){let s=this.customAuth.get(this._authMethod),a,r=!1,o=()=>{r||(r=!0,this.logger.info({tnx:"smtp",username:this._auth.user,action:"authenticated",method:this._authMethod},"User %s authenticated",JSON.stringify(this._auth.user)),this.authenticated=!0,e(null,!0))},l=p=>{r||(r=!0,e(this._formatError(p,"EAUTH",a,"AUTH "+this._authMethod)))},c=s({auth:this._auth,method:this._authMethod,extensions:[].concat(this._supportedExtensions),authMethods:[].concat(this._supportedAuth),maxAllowedSize:this._maxAllowedSize||!1,sendCommand:(p,h)=>{let u;return h||(u=new Promise((f,m)=>{h=se.callbackPromise(f,m)})),this._responseActions.push(f=>{a=f;let m=f.match(/^(\d+)(?:\s(\d+\.\d+\.\d+))?\s/),x={command:p,response:f};m?(x.status=Number(m[1])||0,m[2]&&(x.code=m[2]),x.text=f.substr(m[0].length)):(x.text=f,x.status=0),h(null,x)}),setImmediate(()=>this._sendCommand(p)),u},resolve:o,reject:l});c&&typeof c.catch=="function"&&c.then(o).catch(l);return}switch(this._authMethod){case"XOAUTH2":this._handleXOauth2Token(!1,e);return;case"LOGIN":this._responseActions.push(s=>{this._actionAUTH_LOGIN_USER(s,e)}),this._sendCommand("AUTH LOGIN");return;case"PLAIN":this._responseActions.push(s=>{this._actionAUTHComplete(s,e)}),this._sendCommand("AUTH PLAIN "+Buffer.from("\0"+this._auth.credentials.user+"\0"+this._auth.credentials.pass,"utf-8").toString("base64"),"AUTH PLAIN "+Buffer.from("\0"+this._auth.credentials.user+"\0/* secret */","utf-8").toString("base64"));return;case"CRAM-MD5":this._responseActions.push(s=>{this._actionAUTH_CRAM_MD5(s,e)}),this._sendCommand("AUTH CRAM-MD5");return}return e(this._formatError('Unknown authentication method "'+this._authMethod+'"',"EAUTH",!1,"API"))}send(t,e,i){if(!e)return i(this._formatError("Empty message","EMESSAGE",!1,"API"));let s=this._isDestroyedMessage("send message");if(s)return i(this._formatError(s,"ECONNECTION",!1,"API"));if(this._maxAllowedSize&&t.size>this._maxAllowedSize)return setImmediate(()=>{i(this._formatError("Message size larger than allowed "+this._maxAllowedSize,"EMESSAGE",!1,"MAIL FROM"))});let a=!1,r=function(){a||(a=!0,i(...arguments))};typeof e.on=="function"&&e.on("error",l=>r(this._formatError(l,"ESTREAM",!1,"API")));let o=Date.now();this._setEnvelope(t,(l,c)=>{if(l)return r(l);let p=Date.now(),h=this._createSendStream((u,f)=>u?r(u):(c.envelopeTime=p-o,c.messageTime=Date.now()-p,c.messageSize=h.outByteCount,c.response=f,r(null,c)));typeof e.pipe=="function"?e.pipe(h):(h.write(e),h.end())})}reset(t){this._sendCommand("RSET"),this._responseActions.push(e=>e.charAt(0)!=="2"?t(this._formatError("Could not reset session state. response="+e,"EPROTOCOL",e,"RSET")):(this._envelope=!1,t(null,!0)))}_onConnect(){if(clearTimeout(this._connectionTimeout),this.logger.info({tnx:"network",localAddress:this._socket.localAddress,localPort:this._socket.localPort,remoteAddress:this._socket.remoteAddress,remotePort:this._socket.remotePort},"%s established to %s:%s",this.secure?"Secure connection":"Connection",this._socket.remoteAddress,this._socket.remotePort),this._destroyed){this.close();return}this.stage="connected",this._socket.removeListener("data",this._onSocketData),this._socket.removeListener("timeout",this._onSocketTimeout),this._socket.removeListener("close",this._onSocketClose),this._socket.removeListener("end",this._onSocketEnd),this._socket.on("data",this._onSocketData),this._socket.once("close",this._onSocketClose),this._socket.once("end",this._onSocketEnd),this._socket.setTimeout(this.options.socketTimeout||Nn),this._socket.on("timeout",this._onSocketTimeout),this._greetingTimeout=setTimeout(()=>{this._socket&&!this._destroyed&&this._responseActions[0]===this._actionGreeting&&this._onError("Greeting never received","ETIMEDOUT",!1,"CONN")},this.options.greetingTimeout||hh),this._responseActions.push(this._actionGreeting),this._socket.resume()}_onData(t){if(this._destroyed||!t||!t.length)return;let e=(t||"").toString("binary"),i=(this._remainder+e).split(/\r?\n/),s;this._remainder=i.pop();for(let a=0,r=i.length;a<r;a++){if(this._responseQueue.length&&(s=this._responseQueue[this._responseQueue.length-1],/^\d+-/.test(s.split(`
|
|
55
|
-
`).pop()))){this._responseQueue[this._responseQueue.length-1]+=`
|
|
56
|
-
`+i[a];continue}this._responseQueue.push(i[a])}this._responseQueue.length&&(s=this._responseQueue[this._responseQueue.length-1],/^\d+-/.test(s.split(`
|
|
57
|
-
`).pop()))||this._processResponse()}_onError(t,e,i,s){clearTimeout(this._connectionTimeout),clearTimeout(this._greetingTimeout),!this._destroyed&&(t=this._formatError(t,e,i,s),this.logger.error(i,t.message),this.emit("error",t),this.close())}_formatError(t,e,i,s){let a;/Error\]$/i.test(Object.prototype.toString.call(t))?a=t:a=new Error(t),e&&e!=="Error"&&(a.code=e),i&&(a.response=i,a.message+=": "+i);let r=typeof i=="string"&&Number((i.match(/^\d+/)||[])[0])||!1;return r&&(a.responseCode=r),s&&(a.command=s),a}_onClose(){let t=!1;if(this._remainder&&this._remainder.trim()&&((this.options.debug||this.options.transactionLog)&&this.logger.debug({tnx:"server"},this._remainder.replace(/\r?\n$/,"")),this.lastServerResponse=t=this._remainder.trim()),this.logger.info({tnx:"network"},"Connection closed"),this.upgrading&&!this._destroyed)return this._onError(new Error("Connection closed unexpectedly"),"ETLS",t,"CONN");if(![this._actionGreeting,this.close].includes(this._responseActions[0])&&!this._destroyed)return this._onError(new Error("Connection closed unexpectedly"),"ECONNECTION",t,"CONN");if(/^[45]\d{2}\b/.test(t))return this._onError(new Error("Connection closed unexpectedly"),"ECONNECTION",t,"CONN");this._destroy()}_onEnd(){this._socket&&!this._socket.destroyed&&this._socket.destroy()}_onTimeout(){return this._onError(new Error("Timeout"),"ETIMEDOUT",!1,"CONN")}_destroy(){this._destroyed||(this._destroyed=!0,this.emit("end"))}_upgradeConnection(t){this._socket.removeListener("data",this._onSocketData),this._socket.removeListener("timeout",this._onSocketTimeout);let e=this._socket,i={socket:this._socket,host:this.host};Object.keys(this.options.tls||{}).forEach(s=>{i[s]=this.options.tls[s]}),this.upgrading=!0;try{this._socket=kn.connect(i,()=>(this.secure=!0,this.upgrading=!1,this._socket.on("data",this._onSocketData),e.removeListener("close",this._onSocketClose),e.removeListener("end",this._onSocketEnd),t(null,!0)))}catch(s){return t(s)}this._socket.on("error",this._onSocketError),this._socket.once("close",this._onSocketClose),this._socket.once("end",this._onSocketEnd),this._socket.setTimeout(this.options.socketTimeout||Nn),this._socket.on("timeout",this._onSocketTimeout),e.resume()}_processResponse(){if(!this._responseQueue.length)return!1;let t=this.lastServerResponse=(this._responseQueue.shift()||"").toString();if(/^\d+-/.test(t.split(`
|
|
58
|
-
`).pop()))return;(this.options.debug||this.options.transactionLog)&&this.logger.debug({tnx:"server"},t.replace(/\r?\n$/,"")),t.trim()||setImmediate(()=>this._processResponse());let e=this._responseActions.shift();if(typeof e=="function")e.call(this,t),setImmediate(()=>this._processResponse());else return this._onError(new Error("Unexpected Response"),"EPROTOCOL",t,"CONN")}_sendCommand(t,e){if(!this._destroyed){if(this._socket.destroyed)return this.close();(this.options.debug||this.options.transactionLog)&&this.logger.debug({tnx:"client"},(e||t||"").toString().replace(/\r?\n$/,"")),this._socket.write(Buffer.from(t+`\r
|
|
59
|
-
`,"utf-8"))}}_setEnvelope(t,e){let i=[],s=!1;if(this._envelope=t||{},this._envelope.from=(this._envelope.from&&this._envelope.from.address||this._envelope.from||"").toString().trim(),this._envelope.to=[].concat(this._envelope.to||[]).map(a=>(a&&a.address||a||"").toString().trim()),!this._envelope.to.length)return e(this._formatError("No recipients defined","EENVELOPE",!1,"API"));if(this._envelope.from&&/[\r\n<>]/.test(this._envelope.from))return e(this._formatError("Invalid sender "+JSON.stringify(this._envelope.from),"EENVELOPE",!1,"API"));/[\x80-\uFFFF]/.test(this._envelope.from)&&(s=!0);for(let a=0,r=this._envelope.to.length;a<r;a++){if(!this._envelope.to[a]||/[\r\n<>]/.test(this._envelope.to[a]))return e(this._formatError("Invalid recipient "+JSON.stringify(this._envelope.to[a]),"EENVELOPE",!1,"API"));/[\x80-\uFFFF]/.test(this._envelope.to[a])&&(s=!0)}if(this._envelope.rcptQueue=JSON.parse(JSON.stringify(this._envelope.to||[])),this._envelope.rejected=[],this._envelope.rejectedErrors=[],this._envelope.accepted=[],this._envelope.dsn)try{this._envelope.dsn=this._setDsnEnvelope(this._envelope.dsn)}catch(a){return e(this._formatError("Invalid DSN "+a.message,"EENVELOPE",!1,"API"))}this._responseActions.push(a=>{this._actionMAIL(a,e)}),s&&this._supportedExtensions.includes("SMTPUTF8")&&(i.push("SMTPUTF8"),this._usingSmtpUtf8=!0),this._envelope.use8BitMime&&this._supportedExtensions.includes("8BITMIME")&&(i.push("BODY=8BITMIME"),this._using8BitMime=!0),this._envelope.size&&this._supportedExtensions.includes("SIZE")&&i.push("SIZE="+this._envelope.size),this._envelope.dsn&&this._supportedExtensions.includes("DSN")&&(this._envelope.dsn.ret&&i.push("RET="+se.encodeXText(this._envelope.dsn.ret)),this._envelope.dsn.envid&&i.push("ENVID="+se.encodeXText(this._envelope.dsn.envid))),this._sendCommand("MAIL FROM:<"+this._envelope.from+">"+(i.length?" "+i.join(" "):""))}_setDsnEnvelope(t){let e=(t.ret||t.return||"").toString().toUpperCase()||null;if(e)switch(e){case"HDRS":case"HEADERS":e="HDRS";break;case"FULL":case"BODY":e="FULL";break}if(e&&!["FULL","HDRS"].includes(e))throw new Error("ret: "+JSON.stringify(e));let i=(t.envid||t.id||"").toString()||null,s=t.notify||null;if(s){typeof s=="string"&&(s=s.split(",")),s=s.map(l=>l.trim().toUpperCase());let r=["NEVER","SUCCESS","FAILURE","DELAY"];if(s.filter(l=>!r.includes(l)).length||s.length>1&&s.includes("NEVER"))throw new Error("notify: "+JSON.stringify(s.join(",")));s=s.join(",")}let a=(t.recipient||t.orcpt||"").toString()||null;return a&&a.indexOf(";")<0&&(a="rfc822;"+a),{ret:e,envid:i,notify:s,orcpt:a}}_getDsnRcptToArgs(){let t=[];return this._envelope.dsn&&this._supportedExtensions.includes("DSN")&&(this._envelope.dsn.notify&&t.push("NOTIFY="+se.encodeXText(this._envelope.dsn.notify)),this._envelope.dsn.orcpt&&t.push("ORCPT="+se.encodeXText(this._envelope.dsn.orcpt))),t.length?" "+t.join(" "):""}_createSendStream(t){let e=new lh,i;return this.options.lmtp?this._envelope.accepted.forEach((s,a)=>{let r=a===this._envelope.accepted.length-1;this._responseActions.push(o=>{this._actionLMTPStream(s,r,o,t)})}):this._responseActions.push(s=>{this._actionSMTPStream(s,t)}),e.pipe(this._socket,{end:!1}),this.options.debug&&(i=new ch,i.on("readable",()=>{let s;for(;s=i.read();)this.logger.debug({tnx:"message"},s.toString("binary").replace(/\r?\n$/,""))}),e.pipe(i)),e.once("end",()=>{this.logger.info({tnx:"message",inByteCount:e.inByteCount,outByteCount:e.outByteCount},"<%s bytes encoded mime message (source size %s bytes)>",e.outByteCount,e.inByteCount)}),e}_actionGreeting(t){if(clearTimeout(this._greetingTimeout),t.substr(0,3)!=="220"){this._onError(new Error("Invalid greeting. response="+t),"EPROTOCOL",t,"CONN");return}this.options.lmtp?(this._responseActions.push(this._actionLHLO),this._sendCommand("LHLO "+this.name)):(this._responseActions.push(this._actionEHLO),this._sendCommand("EHLO "+this.name))}_actionLHLO(t){if(t.charAt(0)!=="2"){this._onError(new Error("Invalid LHLO. response="+t),"EPROTOCOL",t,"LHLO");return}this._actionEHLO(t)}_actionEHLO(t){let e;if(t.substr(0,3)==="421"){this._onError(new Error("Server terminates connection. response="+t),"ECONNECTION",t,"EHLO");return}if(t.charAt(0)!=="2"){if(this.options.requireTLS){this._onError(new Error("EHLO failed but HELO does not support required STARTTLS. response="+t),"ECONNECTION",t,"EHLO");return}this._responseActions.push(this._actionHELO),this._sendCommand("HELO "+this.name);return}if(this._ehloLines=t.split(/\r?\n/).map(i=>i.replace(/^\d+[ -]/,"").trim()).filter(i=>i).slice(1),!this.secure&&!this.options.ignoreTLS&&(/[ -]STARTTLS\b/im.test(t)||this.options.requireTLS)){this._sendCommand("STARTTLS"),this._responseActions.push(this._actionSTARTTLS);return}/[ -]SMTPUTF8\b/im.test(t)&&this._supportedExtensions.push("SMTPUTF8"),/[ -]DSN\b/im.test(t)&&this._supportedExtensions.push("DSN"),/[ -]8BITMIME\b/im.test(t)&&this._supportedExtensions.push("8BITMIME"),/[ -]PIPELINING\b/im.test(t)&&this._supportedExtensions.push("PIPELINING"),/[ -]AUTH\b/i.test(t)&&(this.allowsAuth=!0),/[ -]AUTH(?:(\s+|=)[^\n]*\s+|\s+|=)PLAIN/i.test(t)&&this._supportedAuth.push("PLAIN"),/[ -]AUTH(?:(\s+|=)[^\n]*\s+|\s+|=)LOGIN/i.test(t)&&this._supportedAuth.push("LOGIN"),/[ -]AUTH(?:(\s+|=)[^\n]*\s+|\s+|=)CRAM-MD5/i.test(t)&&this._supportedAuth.push("CRAM-MD5"),/[ -]AUTH(?:(\s+|=)[^\n]*\s+|\s+|=)XOAUTH2/i.test(t)&&this._supportedAuth.push("XOAUTH2"),(e=t.match(/[ -]SIZE(?:[ \t]+(\d+))?/im))&&(this._supportedExtensions.push("SIZE"),this._maxAllowedSize=Number(e[1])||0),this.emit("connect")}_actionHELO(t){if(t.charAt(0)!=="2"){this._onError(new Error("Invalid HELO. response="+t),"EPROTOCOL",t,"HELO");return}this.allowsAuth=!0,this.emit("connect")}_actionSTARTTLS(t){if(t.charAt(0)!=="2"){if(this.options.opportunisticTLS)return this.logger.info({tnx:"smtp"},"Failed STARTTLS upgrade, continuing unencrypted"),this.emit("connect");this._onError(new Error("Error upgrading connection with STARTTLS"),"ETLS",t,"STARTTLS");return}this._upgradeConnection((e,i)=>{if(e){this._onError(new Error("Error initiating TLS - "+(e.message||e)),"ETLS",!1,"STARTTLS");return}this.logger.info({tnx:"smtp"},"Connection upgraded with STARTTLS"),i?this.options.lmtp?(this._responseActions.push(this._actionLHLO),this._sendCommand("LHLO "+this.name)):(this._responseActions.push(this._actionEHLO),this._sendCommand("EHLO "+this.name)):this.emit("connect")})}_actionAUTH_LOGIN_USER(t,e){if(!/^334[ -]/.test(t)){e(this._formatError('Invalid login sequence while waiting for "334 VXNlcm5hbWU6"',"EAUTH",t,"AUTH LOGIN"));return}this._responseActions.push(i=>{this._actionAUTH_LOGIN_PASS(i,e)}),this._sendCommand(Buffer.from(this._auth.credentials.user+"","utf-8").toString("base64"))}_actionAUTH_CRAM_MD5(t,e){let i=t.match(/^334\s+(.+)$/),s="";if(i)s=i[1];else return e(this._formatError("Invalid login sequence while waiting for server challenge string","EAUTH",t,"AUTH CRAM-MD5"));let a=Buffer.from(s,"base64").toString("ascii"),r=In.createHmac("md5",this._auth.credentials.pass);r.update(a);let o=this._auth.credentials.user+" "+r.digest("hex");this._responseActions.push(l=>{this._actionAUTH_CRAM_MD5_PASS(l,e)}),this._sendCommand(Buffer.from(o).toString("base64"),Buffer.from(this._auth.credentials.user+" /* secret */").toString("base64"))}_actionAUTH_CRAM_MD5_PASS(t,e){if(!t.match(/^235\s+/))return e(this._formatError('Invalid login sequence while waiting for "235"',"EAUTH",t,"AUTH CRAM-MD5"));this.logger.info({tnx:"smtp",username:this._auth.user,action:"authenticated",method:this._authMethod},"User %s authenticated",JSON.stringify(this._auth.user)),this.authenticated=!0,e(null,!0)}_actionAUTH_LOGIN_PASS(t,e){if(!/^334[ -]/.test(t))return e(this._formatError('Invalid login sequence while waiting for "334 UGFzc3dvcmQ6"',"EAUTH",t,"AUTH LOGIN"));this._responseActions.push(i=>{this._actionAUTHComplete(i,e)}),this._sendCommand(Buffer.from((this._auth.credentials.pass||"").toString(),"utf-8").toString("base64"),Buffer.from("/* secret */","utf-8").toString("base64"))}_actionAUTHComplete(t,e,i){if(!i&&typeof e=="function"&&(i=e,e=!1),t.substr(0,3)==="334"){this._responseActions.push(s=>{e||this._authMethod!=="XOAUTH2"?this._actionAUTHComplete(s,!0,i):setImmediate(()=>this._handleXOauth2Token(!0,i))}),this._sendCommand("");return}if(t.charAt(0)!=="2")return this.logger.info({tnx:"smtp",username:this._auth.user,action:"authfail",method:this._authMethod},"User %s failed to authenticate",JSON.stringify(this._auth.user)),i(this._formatError("Invalid login","EAUTH",t,"AUTH "+this._authMethod));this.logger.info({tnx:"smtp",username:this._auth.user,action:"authenticated",method:this._authMethod},"User %s authenticated",JSON.stringify(this._auth.user)),this.authenticated=!0,i(null,!0)}_actionMAIL(t,e){let i,s;if(Number(t.charAt(0))!==2)return this._usingSmtpUtf8&&/^550 /.test(t)&&/[\x80-\uFFFF]/.test(this._envelope.from)?i="Internationalized mailbox name not allowed":i="Mail command failed",e(this._formatError(i,"EENVELOPE",t,"MAIL FROM"));if(this._envelope.rcptQueue.length)if(this._recipientQueue=[],this._supportedExtensions.includes("PIPELINING"))for(;this._envelope.rcptQueue.length;)s=this._envelope.rcptQueue.shift(),this._recipientQueue.push(s),this._responseActions.push(a=>{this._actionRCPT(a,e)}),this._sendCommand("RCPT TO:<"+s+">"+this._getDsnRcptToArgs());else s=this._envelope.rcptQueue.shift(),this._recipientQueue.push(s),this._responseActions.push(a=>{this._actionRCPT(a,e)}),this._sendCommand("RCPT TO:<"+s+">"+this._getDsnRcptToArgs());else return e(this._formatError("Can't send mail - no recipients defined","EENVELOPE",!1,"API"))}_actionRCPT(t,e){let i,s,a=this._recipientQueue.shift();if(Number(t.charAt(0))!==2?(this._usingSmtpUtf8&&/^553 /.test(t)&&/[\x80-\uFFFF]/.test(a)?i="Internationalized mailbox name not allowed":i="Recipient command failed",this._envelope.rejected.push(a),s=this._formatError(i,"EENVELOPE",t,"RCPT TO"),s.recipient=a,this._envelope.rejectedErrors.push(s)):this._envelope.accepted.push(a),!this._envelope.rcptQueue.length&&!this._recipientQueue.length)if(this._envelope.rejected.length<this._envelope.to.length)this._responseActions.push(r=>{this._actionDATA(r,e)}),this._sendCommand("DATA");else return s=this._formatError("Can't send mail - all recipients were rejected","EENVELOPE",t,"RCPT TO"),s.rejected=this._envelope.rejected,s.rejectedErrors=this._envelope.rejectedErrors,e(s);else this._envelope.rcptQueue.length&&(a=this._envelope.rcptQueue.shift(),this._recipientQueue.push(a),this._responseActions.push(r=>{this._actionRCPT(r,e)}),this._sendCommand("RCPT TO:<"+a+">"+this._getDsnRcptToArgs()))}_actionDATA(t,e){if(!/^[23]/.test(t))return e(this._formatError("Data command failed","EENVELOPE",t,"DATA"));let i={accepted:this._envelope.accepted,rejected:this._envelope.rejected};this._ehloLines&&this._ehloLines.length&&(i.ehlo=this._ehloLines),this._envelope.rejectedErrors.length&&(i.rejectedErrors=this._envelope.rejectedErrors),e(null,i)}_actionSMTPStream(t,e){return Number(t.charAt(0))!==2?e(this._formatError("Message failed","EMESSAGE",t,"DATA")):e(null,t)}_actionLMTPStream(t,e,i,s){let a;if(Number(i.charAt(0))!==2){a=this._formatError("Message failed for recipient "+t,"EMESSAGE",i,"DATA"),a.recipient=t,this._envelope.rejected.push(t),this._envelope.rejectedErrors.push(a);for(let r=0,o=this._envelope.accepted.length;r<o;r++)this._envelope.accepted[r]===t&&this._envelope.accepted.splice(r,1)}if(e)return s(null,i)}_handleXOauth2Token(t,e){this._auth.oauth2.getToken(t,(i,s)=>{if(i)return this.logger.info({tnx:"smtp",username:this._auth.user,action:"authfail",method:this._authMethod},"User %s failed to authenticate",JSON.stringify(this._auth.user)),e(this._formatError(i,"EAUTH",!1,"AUTH XOAUTH2"));this._responseActions.push(a=>{this._actionAUTHComplete(a,t,e)}),this._sendCommand("AUTH XOAUTH2 "+this._auth.oauth2.buildXOAuth2Token(s),"AUTH XOAUTH2 "+this._auth.oauth2.buildXOAuth2Token("/* secret */"))})}_isDestroyedMessage(t){if(this._destroyed)return"Cannot "+t+" - smtp connection is already destroyed.";if(this._socket){if(this._socket.destroyed)return"Cannot "+t+" - smtp connection socket is already destroyed.";if(!this._socket.writable)return"Cannot "+t+" - smtp connection socket is already half-closed."}}_getHostname(){let t;try{t=oh.hostname()||""}catch{t="localhost"}return(!t||t.indexOf(".")<0)&&(t="[127.0.0.1]"),t.match(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/)&&(t="["+t+"]"),t}};_n.exports=Ps});var As=T((Vu,Ln)=>{"use strict";var dh=require("stream").Stream,fh=Ze(),mh=require("crypto"),xh=j(),Ts=class extends dh{constructor(t,e){if(super(),this.options=t||{},t&&t.serviceClient){if(!t.privateKey||!t.user){setImmediate(()=>this.emit("error",new Error('Options "privateKey" and "user" are required for service account!')));return}let i=Math.min(Math.max(Number(this.options.serviceRequestTimeout)||0,0),3600);this.options.serviceRequestTimeout=i||5*60}if(this.logger=xh.getLogger({logger:e},{component:this.options.component||"OAuth2"}),this.provisionCallback=typeof this.options.provisionCallback=="function"?this.options.provisionCallback:!1,this.options.accessUrl=this.options.accessUrl||"https://accounts.google.com/o/oauth2/token",this.options.customHeaders=this.options.customHeaders||{},this.options.customParams=this.options.customParams||{},this.accessToken=this.options.accessToken||!1,this.options.expires&&Number(this.options.expires))this.expires=this.options.expires;else{let i=Math.max(Number(this.options.timeout)||0,0);this.expires=i&&Date.now()+i*1e3||0}}getToken(t,e){if(!t&&this.accessToken&&(!this.expires||this.expires>Date.now()))return e(null,this.accessToken);let i=(...s)=>{s[0]?this.logger.error({err:s[0],tnx:"OAUTH2",user:this.options.user,action:"renew"},"Failed generating new Access Token for %s",this.options.user):this.logger.info({tnx:"OAUTH2",user:this.options.user,action:"renew"},"Generated new Access Token for %s",this.options.user),e(...s)};this.provisionCallback?this.provisionCallback(this.options.user,!!t,(s,a,r)=>{!s&&a&&(this.accessToken=a,this.expires=r||0),i(s,a)}):this.generateToken(i)}updateToken(t,e){this.accessToken=t,e=Math.max(Number(e)||0,0),this.expires=e&&Date.now()+e*1e3||0,this.emit("token",{user:this.options.user,accessToken:t||"",expires:this.expires})}generateToken(t){let e,i;if(this.options.serviceClient){let s=Math.floor(Date.now()/1e3),a={iss:this.options.serviceClient,scope:this.options.scope||"https://mail.google.com/",sub:this.options.user,aud:this.options.accessUrl,iat:s,exp:s+this.options.serviceRequestTimeout},r;try{r=this.jwtSignRS256(a)}catch{return t(new Error("Can't generate token. Check your auth options"))}e={grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:r},i={grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:a}}else{if(!this.options.refreshToken)return t(new Error("Can't create new access token for user"));e={client_id:this.options.clientId||"",client_secret:this.options.clientSecret||"",refresh_token:this.options.refreshToken,grant_type:"refresh_token"},i={client_id:this.options.clientId||"",client_secret:(this.options.clientSecret||"").substr(0,6)+"...",refresh_token:(this.options.refreshToken||"").substr(0,6)+"...",grant_type:"refresh_token"}}Object.keys(this.options.customParams).forEach(s=>{e[s]=this.options.customParams[s],i[s]=this.options.customParams[s]}),this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"generate"},"Requesting token using: %s",JSON.stringify(i)),this.postRequest(this.options.accessUrl,e,this.options,(s,a)=>{let r;if(s)return t(s);try{r=JSON.parse(a.toString())}catch(l){return t(l)}if(!r||typeof r!="object")return this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"post"},"Response: %s",(a||"").toString()),t(new Error("Invalid authentication response"));let o={};if(Object.keys(r).forEach(l=>{l!=="access_token"?o[l]=r[l]:o[l]=(r[l]||"").toString().substr(0,6)+"..."}),this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"post"},"Response: %s",JSON.stringify(o)),r.error){let l=r.error;return r.error_description&&(l+=": "+r.error_description),r.error_uri&&(l+=" ("+r.error_uri+")"),t(new Error(l))}return r.access_token?(this.updateToken(r.access_token,r.expires_in),t(null,this.accessToken)):t(new Error("No access token"))})}buildXOAuth2Token(t){let e=["user="+(this.options.user||""),"auth=Bearer "+(t||this.accessToken),"",""];return Buffer.from(e.join(""),"utf-8").toString("base64")}postRequest(t,e,i,s){let a=!1,r=[],o=0,l=fh(t,{method:"post",headers:i.customHeaders,body:e,allowErrorResponse:!0});l.on("readable",()=>{let c;for(;(c=l.read())!==null;)r.push(c),o+=c.length}),l.once("error",c=>{if(!a)return a=!0,s(c)}),l.once("end",()=>{if(!a)return a=!0,s(null,Buffer.concat(r,o))})}toBase64URL(t){return typeof t=="string"&&(t=Buffer.from(t)),t.toString("base64").replace(/[=]+/g,"").replace(/\+/g,"-").replace(/\//g,"_")}jwtSignRS256(t){t=['{"alg":"RS256","typ":"JWT"}',JSON.stringify(t)].map(i=>this.toBase64URL(i)).join(".");let e=mh.createSign("RSA-SHA256").update(t).sign(this.options.privateKey);return t+"."+this.toBase64URL(e)}};Ln.exports=Ts});var On=T((Wu,Mn)=>{"use strict";var gh=Ft(),yh=j().assign,vh=As(),bh=require("events"),Es=class extends bh{constructor(t){if(super(),this.pool=t,this.options=t.options,this.logger=this.pool.logger,this.options.auth)switch((this.options.auth.type||"").toString().toUpperCase()){case"OAUTH2":{let e=new vh(this.options.auth,this.logger);e.provisionCallback=this.pool.mailer&&this.pool.mailer.get("oauth2_provision_cb")||e.provisionCallback,this.auth={type:"OAUTH2",user:this.options.auth.user,oauth2:e,method:"XOAUTH2"},e.on("token",i=>this.pool.mailer.emit("token",i)),e.on("error",i=>this.emit("error",i));break}default:if(!this.options.auth.user&&!this.options.auth.pass)break;this.auth={type:(this.options.auth.type||"").toString().toUpperCase()||"LOGIN",user:this.options.auth.user,credentials:{user:this.options.auth.user||"",pass:this.options.auth.pass,options:this.options.auth.options},method:(this.options.auth.method||"").trim().toUpperCase()||this.options.authMethod||!1}}this._connection=!1,this._connected=!1,this.messages=0,this.available=!0}connect(t){this.pool.getSocket(this.options,(e,i)=>{if(e)return t(e);let s=!1,a=this.options;i&&i.connection&&(this.logger.info({tnx:"proxy",remoteAddress:i.connection.remoteAddress,remotePort:i.connection.remotePort,destHost:a.host||"",destPort:a.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",i.connection.remoteAddress,i.connection.remotePort,a.host||"",a.port||""),a=yh(!1,a),Object.keys(i).forEach(r=>{a[r]=i[r]})),this.connection=new gh(a),this.connection.once("error",r=>{if(this.emit("error",r),!s)return s=!0,t(r)}),this.connection.once("end",()=>{if(this.close(),s)return;s=!0;let r=setTimeout(()=>{if(s)return;let o=new Error("Unexpected socket close");this.connection&&this.connection._socket&&this.connection._socket.upgrading&&(o.code="ETLS"),t(o)},1e3);try{r.unref()}catch{}}),this.connection.connect(()=>{if(!s)if(this.auth&&(this.connection.allowsAuth||a.forceAuth))this.connection.login(this.auth,r=>{if(!s){if(s=!0,r)return this.connection.close(),this.emit("error",r),t(r);this._connected=!0,t(null,!0)}});else return s=!0,this._connected=!0,t(null,!0)})})}send(t,e){if(!this._connected)return this.connect(r=>r?e(r):this.send(t,e));let i=t.message.getEnvelope(),s=t.message.messageId(),a=[].concat(i.to||[]);a.length>3&&a.push("...and "+a.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:s,cid:this.id},"Sending message %s using #%s to <%s>",s,this.id,a.join(", ")),t.data.dsn&&(i.dsn=t.data.dsn),this.connection.send(i,t.message.createReadStream(),(r,o)=>{if(this.messages++,r)return this.connection.close(),this.emit("error",r),e(r);o.envelope={from:i.from,to:i.to},o.messageId=s,setImmediate(()=>{let l;this.messages>=this.options.maxMessages?(l=new Error("Resource exhausted"),l.code="EMAXLIMIT",this.connection.close(),this.emit("error",l)):this.pool._checkRateLimit(()=>{this.available=!0,this.emit("available")})}),e(null,o)})}close(){this._connected=!1,this.auth&&this.auth.oauth2&&this.auth.oauth2.removeAllListeners(),this.connection&&this.connection.close(),this.emit("close")}};Mn.exports=Es});var Dn=T((Gu,wh)=>{wh.exports={"1und1":{host:"smtp.1und1.de",port:465,secure:!0,authMethod:"LOGIN"},AOL:{domains:["aol.com"],host:"smtp.aol.com",port:587},Bluewin:{host:"smtpauths.bluewin.ch",domains:["bluewin.ch"],port:465},DebugMail:{host:"debugmail.io",port:25},DynectEmail:{aliases:["Dynect"],host:"smtp.dynect.net",port:25},Ethereal:{aliases:["ethereal.email"],host:"smtp.ethereal.email",port:587},FastMail:{domains:["fastmail.fm"],host:"smtp.fastmail.com",port:465,secure:!0},"Forward Email":{aliases:["FE","ForwardEmail"],domains:["forwardemail.net"],host:"smtp.forwardemail.net",port:465,secure:!0},GandiMail:{aliases:["Gandi","Gandi Mail"],host:"mail.gandi.net",port:587},Gmail:{aliases:["Google Mail"],domains:["gmail.com","googlemail.com"],host:"smtp.gmail.com",port:465,secure:!0},Godaddy:{host:"smtpout.secureserver.net",port:25},GodaddyAsia:{host:"smtp.asia.secureserver.net",port:25},GodaddyEurope:{host:"smtp.europe.secureserver.net",port:25},"hot.ee":{host:"mail.hot.ee"},Hotmail:{aliases:["Outlook","Outlook.com","Hotmail.com"],domains:["hotmail.com","outlook.com"],host:"smtp-mail.outlook.com",port:587},iCloud:{aliases:["Me","Mac"],domains:["me.com","mac.com"],host:"smtp.mail.me.com",port:587},Infomaniak:{host:"mail.infomaniak.com",domains:["ik.me","ikmail.com","etik.com"],port:587},"mail.ee":{host:"smtp.mail.ee"},"Mail.ru":{host:"smtp.mail.ru",port:465,secure:!0},Maildev:{port:1025,ignoreTLS:!0},Mailgun:{host:"smtp.mailgun.org",port:465,secure:!0},Mailjet:{host:"in.mailjet.com",port:587},Mailosaur:{host:"mailosaur.io",port:25},Mailtrap:{host:"smtp.mailtrap.io",port:2525},Mandrill:{host:"smtp.mandrillapp.com",port:587},Naver:{host:"smtp.naver.com",port:587},One:{host:"send.one.com",port:465,secure:!0},OpenMailBox:{aliases:["OMB","openmailbox.org"],host:"smtp.openmailbox.org",port:465,secure:!0},Outlook365:{host:"smtp.office365.com",port:587,secure:!1},OhMySMTP:{host:"smtp.ohmysmtp.com",port:587,secure:!1},Postmark:{aliases:["PostmarkApp"],host:"smtp.postmarkapp.com",port:2525},"qiye.aliyun":{host:"smtp.mxhichina.com",port:"465",secure:!0},QQ:{domains:["qq.com"],host:"smtp.qq.com",port:465,secure:!0},QQex:{aliases:["QQ Enterprise"],domains:["exmail.qq.com"],host:"smtp.exmail.qq.com",port:465,secure:!0},SendCloud:{host:"smtp.sendcloud.net",port:2525},SendGrid:{host:"smtp.sendgrid.net",port:587},SendinBlue:{host:"smtp-relay.sendinblue.com",port:587},SendPulse:{host:"smtp-pulse.com",port:465,secure:!0},SES:{host:"email-smtp.us-east-1.amazonaws.com",port:465,secure:!0},"SES-US-EAST-1":{host:"email-smtp.us-east-1.amazonaws.com",port:465,secure:!0},"SES-US-WEST-2":{host:"email-smtp.us-west-2.amazonaws.com",port:465,secure:!0},"SES-EU-WEST-1":{host:"email-smtp.eu-west-1.amazonaws.com",port:465,secure:!0},Sparkpost:{aliases:["SparkPost","SparkPost Mail"],domains:["sparkpost.com"],host:"smtp.sparkpostmail.com",port:587,secure:!1},Tipimail:{host:"smtp.tipimail.com",port:587},Yahoo:{domains:["yahoo.com"],host:"smtp.mail.yahoo.com",port:465,secure:!0},Yandex:{domains:["yandex.ru"],host:"smtp.yandex.ru",port:465,secure:!0},Zoho:{host:"smtp.zoho.com",port:465,secure:!0,authMethod:"LOGIN"},"126":{host:"smtp.126.com",port:465,secure:!0},"163":{host:"smtp.163.com",port:465,secure:!0}}});var Cs=T((Xu,Fn)=>{"use strict";var Bn=Dn(),jt={};Object.keys(Bn).forEach(n=>{let t=Bn[n];jt[Rt(n)]=Ss(t),[].concat(t.aliases||[]).forEach(e=>{jt[Rt(e)]=Ss(t)}),[].concat(t.domains||[]).forEach(e=>{jt[Rt(e)]=Ss(t)})});function Rt(n){return n.replace(/[^a-zA-Z0-9.-]/g,"").toLowerCase()}function Ss(n){let t=["domains","aliases"],e={};return Object.keys(n).forEach(i=>{t.indexOf(i)<0&&(e[i]=n[i])}),e}Fn.exports=function(n){return n=Rt(n.split("@").pop()),jt[n]||!1}});var qn=T((Ju,Un)=>{"use strict";var Ph=require("events"),jn=On(),Rn=Ft(),Th=Cs(),nt=j(),Ah=q(),ks=class extends Ph{constructor(t){super(),t=t||{},typeof t=="string"&&(t={url:t});let e,i=t.service;typeof t.getSocket=="function"&&(this.getSocket=t.getSocket),t.url&&(e=nt.parseConnectionUrl(t.url),i=i||e.service),this.options=nt.assign(!1,t,e,i&&Th(i)),this.options.maxConnections=this.options.maxConnections||5,this.options.maxMessages=this.options.maxMessages||100,this.logger=nt.getLogger(this.options,{component:this.options.component||"smtp-pool"});let s=new Rn(this.options);this.name="SMTP (pool)",this.version=Ah.version+"[client:"+s.version+"]",this._rateLimit={counter:0,timeout:null,waiting:[],checkpoint:!1,delta:Number(this.options.rateDelta)||1e3,limit:Number(this.options.rateLimit)||0},this._closed=!1,this._queue=[],this._connections=[],this._connectionCounter=0,this.idling=!0,setImmediate(()=>{this.idling&&this.emit("idle")})}getSocket(t,e){return setImmediate(()=>e(null,!1))}send(t,e){return this._closed?!1:(this._queue.push({mail:t,requeueAttempts:0,callback:e}),this.idling&&this._queue.length>=this.options.maxConnections&&(this.idling=!1),setImmediate(()=>this._processMessages()),!0)}close(){let t,e=this._connections.length;if(this._closed=!0,clearTimeout(this._rateLimit.timeout),!e&&!this._queue.length)return;for(let s=e-1;s>=0;s--)this._connections[s]&&this._connections[s].available&&(t=this._connections[s],t.close(),this.logger.info({tnx:"connection",cid:t.id,action:"removed"},"Connection #%s removed",t.id));if(e&&!this._connections.length&&this.logger.debug({tnx:"connection"},"All connections removed"),!this._queue.length)return;let i=()=>{if(!this._queue.length){this.logger.debug({tnx:"connection"},"Pending queue entries cleared");return}let s=this._queue.shift();if(s&&typeof s.callback=="function")try{s.callback(new Error("Connection pool was closed"))}catch(a){this.logger.error({err:a,tnx:"callback",cid:t.id},"Callback error for #%s: %s",t.id,a.message)}setImmediate(i)};setImmediate(i)}_processMessages(){let t,e,i;if(this._closed)return;if(!this._queue.length){this.idling||(this.idling=!0,this.emit("idle"));return}for(e=0,i=this._connections.length;e<i;e++)if(this._connections[e].available){t=this._connections[e];break}if(!t&&this._connections.length<this.options.maxConnections&&(t=this._createConnection()),!t){this.idling=!1;return}!this.idling&&this._queue.length<this.options.maxConnections&&(this.idling=!0,this.emit("idle"));let s=t.queueEntry=this._queue.shift();s.messageId=(t.queueEntry.mail.message.getHeader("message-id")||"").replace(/[<>\s]/g,""),t.available=!1,this.logger.debug({tnx:"pool",cid:t.id,messageId:s.messageId,action:"assign"},"Assigned message <%s> to #%s (%s)",s.messageId,t.id,t.messages+1),this._rateLimit.limit&&(this._rateLimit.counter++,this._rateLimit.checkpoint||(this._rateLimit.checkpoint=Date.now())),t.send(s.mail,(a,r)=>{if(s===t.queueEntry){try{s.callback(a,r)}catch(o){this.logger.error({err:o,tnx:"callback",cid:t.id},"Callback error for #%s: %s",t.id,o.message)}t.queueEntry=!1}})}_createConnection(){let t=new jn(this);return t.id=++this._connectionCounter,this.logger.info({tnx:"pool",cid:t.id,action:"conection"},"Created new pool resource #%s",t.id),t.on("available",()=>{this.logger.debug({tnx:"connection",cid:t.id,action:"available"},"Connection #%s became available",t.id),this._closed?this.close():this._processMessages()}),t.once("error",e=>{if(e.code!=="EMAXLIMIT"?this.logger.error({err:e,tnx:"pool",cid:t.id},"Pool Error for #%s: %s",t.id,e.message):this.logger.debug({tnx:"pool",cid:t.id,action:"maxlimit"},"Max messages limit exchausted for #%s",t.id),t.queueEntry){try{t.queueEntry.callback(e)}catch(i){this.logger.error({err:i,tnx:"callback",cid:t.id},"Callback error for #%s: %s",t.id,i.message)}t.queueEntry=!1}this._removeConnection(t),this._continueProcessing()}),t.once("close",()=>{this.logger.info({tnx:"connection",cid:t.id,action:"closed"},"Connection #%s was closed",t.id),this._removeConnection(t),t.queueEntry?setTimeout(()=>{t.queueEntry&&(this._shouldRequeuOnConnectionClose(t.queueEntry)?this._requeueEntryOnConnectionClose(t):this._failDeliveryOnConnectionClose(t)),this._continueProcessing()},50):this._continueProcessing()}),this._connections.push(t),t}_shouldRequeuOnConnectionClose(t){return this.options.maxRequeues===void 0||this.options.maxRequeues<0?!0:t.requeueAttempts<this.options.maxRequeues}_failDeliveryOnConnectionClose(t){if(t.queueEntry&&t.queueEntry.callback){try{t.queueEntry.callback(new Error("Reached maximum number of retries after connection was closed"))}catch(e){this.logger.error({err:e,tnx:"callback",messageId:t.queueEntry.messageId,cid:t.id},"Callback error for #%s: %s",t.id,e.message)}t.queueEntry=!1}}_requeueEntryOnConnectionClose(t){t.queueEntry.requeueAttempts=t.queueEntry.requeueAttempts+1,this.logger.debug({tnx:"pool",cid:t.id,messageId:t.queueEntry.messageId,action:"requeue"},"Re-queued message <%s> for #%s. Attempt: #%s",t.queueEntry.messageId,t.id,t.queueEntry.requeueAttempts),this._queue.unshift(t.queueEntry),t.queueEntry=!1}_continueProcessing(){this._closed?this.close():setTimeout(()=>this._processMessages(),100)}_removeConnection(t){let e=this._connections.indexOf(t);e!==-1&&this._connections.splice(e,1)}_checkRateLimit(t){if(!this._rateLimit.limit)return t();let e=Date.now();if(this._rateLimit.counter<this._rateLimit.limit)return t();if(this._rateLimit.waiting.push(t),this._rateLimit.checkpoint<=e-this._rateLimit.delta)return this._clearRateLimit();this._rateLimit.timeout||(this._rateLimit.timeout=setTimeout(()=>this._clearRateLimit(),this._rateLimit.delta-(e-this._rateLimit.checkpoint)),this._rateLimit.checkpoint=e)}_clearRateLimit(){for(clearTimeout(this._rateLimit.timeout),this._rateLimit.timeout=null,this._rateLimit.counter=0,this._rateLimit.checkpoint=!1;this._rateLimit.waiting.length;){let t=this._rateLimit.waiting.shift();setImmediate(t)}}isIdle(){return this.idling}verify(t){let e;t||(e=new Promise((s,a)=>{t=nt.callbackPromise(s,a)}));let i=new jn(this).auth;return this.getSocket(this.options,(s,a)=>{if(s)return t(s);let r=this.options;a&&a.connection&&(this.logger.info({tnx:"proxy",remoteAddress:a.connection.remoteAddress,remotePort:a.connection.remotePort,destHost:r.host||"",destPort:r.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",a.connection.remoteAddress,a.connection.remotePort,r.host||"",r.port||""),r=nt.assign(!1,r),Object.keys(a).forEach(p=>{r[p]=a[p]}));let o=new Rn(r),l=!1;o.once("error",p=>{if(!l)return l=!0,o.close(),t(p)}),o.once("end",()=>{if(!l)return l=!0,t(new Error("Connection closed"))});let c=()=>{if(!l)return l=!0,o.quit(),t(null,!0)};o.connect(()=>{if(!l)if(i&&(o.allowsAuth||r.forceAuth))o.login(i,p=>{if(!l){if(p)return l=!0,o.close(),t(p);c()}});else if(!i&&o.allowsAuth&&r.forceAuth){let p=new Error("Authentication info was not provided");return p.code="NoAuth",l=!0,o.close(),t(p)}else c()})}),e}};Un.exports=ks});var Hn=T((Qu,zn)=>{"use strict";var Eh=require("events"),Is=Ft(),Sh=Cs(),Me=j(),Ch=As(),kh=q(),Ns=class extends Eh{constructor(t){super(),t=t||{},typeof t=="string"&&(t={url:t});let e,i=t.service;typeof t.getSocket=="function"&&(this.getSocket=t.getSocket),t.url&&(e=Me.parseConnectionUrl(t.url),i=i||e.service),this.options=Me.assign(!1,t,e,i&&Sh(i)),this.logger=Me.getLogger(this.options,{component:this.options.component||"smtp-transport"});let s=new Is(this.options);this.name="SMTP",this.version=kh.version+"[client:"+s.version+"]",this.options.auth&&(this.auth=this.getAuth({}))}getSocket(t,e){return setImmediate(()=>e(null,!1))}getAuth(t){if(!t)return this.auth;let e=!1,i={};if(this.options.auth&&typeof this.options.auth=="object"&&Object.keys(this.options.auth).forEach(s=>{e=!0,i[s]=this.options.auth[s]}),t&&typeof t=="object"&&Object.keys(t).forEach(s=>{e=!0,i[s]=t[s]}),!e)return!1;switch((i.type||"").toString().toUpperCase()){case"OAUTH2":{if(!i.service&&!i.user)return!1;let s=new Ch(i,this.logger);return s.provisionCallback=this.mailer&&this.mailer.get("oauth2_provision_cb")||s.provisionCallback,s.on("token",a=>this.mailer.emit("token",a)),s.on("error",a=>this.emit("error",a)),{type:"OAUTH2",user:i.user,oauth2:s,method:"XOAUTH2"}}default:return{type:(i.type||"").toString().toUpperCase()||"LOGIN",user:i.user,credentials:{user:i.user||"",pass:i.pass,options:i.options},method:(i.method||"").trim().toUpperCase()||this.options.authMethod||!1}}}send(t,e){this.getSocket(this.options,(i,s)=>{if(i)return e(i);let a=!1,r=this.options;s&&s.connection&&(this.logger.info({tnx:"proxy",remoteAddress:s.connection.remoteAddress,remotePort:s.connection.remotePort,destHost:r.host||"",destPort:r.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",s.connection.remoteAddress,s.connection.remotePort,r.host||"",r.port||""),r=Me.assign(!1,r),Object.keys(s).forEach(c=>{r[c]=s[c]}));let o=new Is(r);o.once("error",c=>{if(!a)return a=!0,o.close(),e(c)}),o.once("end",()=>{if(a)return;let c=setTimeout(()=>{if(a)return;a=!0;let p=new Error("Unexpected socket close");o&&o._socket&&o._socket.upgrading&&(p.code="ETLS"),e(p)},1e3);try{c.unref()}catch{}});let l=()=>{let c=t.message.getEnvelope(),p=t.message.messageId(),h=[].concat(c.to||[]);h.length>3&&h.push("...and "+h.splice(2).length+" more"),t.data.dsn&&(c.dsn=t.data.dsn),this.logger.info({tnx:"send",messageId:p},"Sending message %s to <%s>",p,h.join(", ")),o.send(c,t.message.createReadStream(),(u,f)=>{if(a=!0,o.close(),u)return this.logger.error({err:u,tnx:"send"},"Send error for %s: %s",p,u.message),e(u);f.envelope={from:c.from,to:c.to},f.messageId=p;try{return e(null,f)}catch(m){this.logger.error({err:m,tnx:"callback"},"Callback error for %s: %s",p,m.message)}})};o.connect(()=>{if(a)return;let c=this.getAuth(t.data.auth);c&&(o.allowsAuth||r.forceAuth)?o.login(c,p=>{if(c&&c!==this.auth&&c.oauth2&&c.oauth2.removeAllListeners(),!a){if(p)return a=!0,o.close(),e(p);l()}}):l()})})}verify(t){let e;return t||(e=new Promise((i,s)=>{t=Me.callbackPromise(i,s)})),this.getSocket(this.options,(i,s)=>{if(i)return t(i);let a=this.options;s&&s.connection&&(this.logger.info({tnx:"proxy",remoteAddress:s.connection.remoteAddress,remotePort:s.connection.remotePort,destHost:a.host||"",destPort:a.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",s.connection.remoteAddress,s.connection.remotePort,a.host||"",a.port||""),a=Me.assign(!1,a),Object.keys(s).forEach(c=>{a[c]=s[c]}));let r=new Is(a),o=!1;r.once("error",c=>{if(!o)return o=!0,r.close(),t(c)}),r.once("end",()=>{if(!o)return o=!0,t(new Error("Connection closed"))});let l=()=>{if(!o)return o=!0,r.quit(),t(null,!0)};r.connect(()=>{if(o)return;let c=this.getAuth({});if(c&&(r.allowsAuth||a.forceAuth))r.login(c,p=>{if(!o){if(p)return o=!0,r.close(),t(p);l()}});else if(!c&&r.allowsAuth&&a.forceAuth){let p=new Error("Authentication info was not provided");return p.code="NoAuth",o=!0,r.close(),t(p)}else l()})}),e}close(){this.auth&&this.auth.oauth2&&this.auth.oauth2.removeAllListeners(),this.emit("close")}};zn.exports=Ns});var Kn=T((Yu,$n)=>{"use strict";var Ih=require("child_process").spawn,Nh=q(),_h=j(),_s=class{constructor(t){t=t||{},this._spawn=Ih,this.options=t||{},this.name="Sendmail",this.version=Nh.version,this.path="sendmail",this.args=!1,this.winbreak=!1,this.logger=_h.getLogger(this.options,{component:this.options.component||"sendmail"}),t&&(typeof t=="string"?this.path=t:typeof t=="object"&&(t.path&&(this.path=t.path),Array.isArray(t.args)&&(this.args=t.args),this.winbreak=["win","windows","dos",`\r
|
|
60
|
-
`].includes((t.newline||"").toString().toLowerCase())))}send(t,e){t.message.keepBcc=!0;let i=t.data.envelope||t.message.getEnvelope(),s=t.message.messageId(),a,r,o;if([].concat(i.from||[]).concat(i.to||[]).some(p=>/^-/.test(p)))return e(new Error("Can not send mail. Invalid envelope addresses."));this.args?a=["-i"].concat(this.args).concat(i.to):a=["-i"].concat(i.from?["-f",i.from]:[]).concat(i.to);let c=p=>{if(!o&&(o=!0,typeof e=="function"))return p?e(p):e(null,{envelope:t.data.envelope||t.message.getEnvelope(),messageId:s,response:"Messages queued for delivery"})};try{r=this._spawn(this.path,a)}catch(p){return this.logger.error({err:p,tnx:"spawn",messageId:s},"Error occurred while spawning sendmail. %s",p.message),c(p)}if(r){r.on("error",u=>{this.logger.error({err:u,tnx:"spawn",messageId:s},"Error occurred when sending message %s. %s",s,u.message),c(u)}),r.once("exit",u=>{if(!u)return c();let f;u===127?f=new Error("Sendmail command not found, process exited with code "+u):f=new Error("Sendmail exited with code "+u),this.logger.error({err:f,tnx:"stdin",messageId:s},"Error sending message %s to sendmail. %s",s,f.message),c(f)}),r.once("close",c),r.stdin.on("error",u=>{this.logger.error({err:u,tnx:"stdin",messageId:s},"Error occurred when piping message %s to sendmail. %s",s,u.message),c(u)});let p=[].concat(i.to||[]);p.length>3&&p.push("...and "+p.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:s},"Sending message %s to <%s>",s,p.join(", "));let h=t.message.createReadStream();h.once("error",u=>{this.logger.error({err:u,tnx:"stdin",messageId:s},"Error occurred when generating message %s. %s",s,u.message),r.kill("SIGINT"),c(u)}),h.pipe(r.stdin)}else return c(new Error("sendmail was not found"))}};$n.exports=_s});var Wn=T((Zu,Vn)=>{"use strict";var Lh=q(),Mh=j(),Ls=class{constructor(t){t=t||{},this.options=t||{},this.name="StreamTransport",this.version=Lh.version,this.logger=Mh.getLogger(this.options,{component:this.options.component||"stream-transport"}),this.winbreak=["win","windows","dos",`\r
|
|
61
|
-
`].includes((t.newline||"").toString().toLowerCase())}send(t,e){t.message.keepBcc=!0;let i=t.data.envelope||t.message.getEnvelope(),s=t.message.messageId(),a=[].concat(i.to||[]);a.length>3&&a.push("...and "+a.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:s},"Sending message %s to <%s> using %s line breaks",s,a.join(", "),this.winbreak?"<CR><LF>":"<LF>"),setImmediate(()=>{let r;try{r=t.message.createReadStream()}catch(c){return this.logger.error({err:c,tnx:"send",messageId:s},"Creating send stream failed for %s. %s",s,c.message),e(c)}if(!this.options.buffer)return r.once("error",c=>{this.logger.error({err:c,tnx:"send",messageId:s},"Failed creating message for %s. %s",s,c.message)}),e(null,{envelope:t.data.envelope||t.message.getEnvelope(),messageId:s,message:r});let o=[],l=0;r.on("readable",()=>{let c;for(;(c=r.read())!==null;)o.push(c),l+=c.length}),r.once("error",c=>(this.logger.error({err:c,tnx:"send",messageId:s},"Failed creating message for %s. %s",s,c.message),e(c))),r.on("end",()=>e(null,{envelope:t.data.envelope||t.message.getEnvelope(),messageId:s,message:Buffer.concat(o,l)}))})}};Vn.exports=Ls});var Xn=T((ed,Gn)=>{"use strict";var Oh=q(),Dh=j(),Ms=class{constructor(t){t=t||{},this.options=t||{},this.name="JSONTransport",this.version=Oh.version,this.logger=Dh.getLogger(this.options,{component:this.options.component||"json-transport"})}send(t,e){t.message.keepBcc=!0;let i=t.data.envelope||t.message.getEnvelope(),s=t.message.messageId(),a=[].concat(i.to||[]);a.length>3&&a.push("...and "+a.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:s},"Composing JSON structure of %s to <%s>",s,a.join(", ")),setImmediate(()=>{t.normalize((r,o)=>r?(this.logger.error({err:r,tnx:"send",messageId:s},"Failed building JSON structure for %s. %s",s,r.message),e(r)):(delete o.envelope,delete o.normalizedHeaders,e(null,{envelope:i,messageId:s,message:this.options.skipEncoding?o:JSON.stringify(o)})))})}};Gn.exports=Ms});var Yn=T((td,Qn)=>{"use strict";var Bh=require("events"),Fh=q(),Jn=j(),jh=rs(),Os=class extends Bh{constructor(t){super(),t=t||{},this.options=t||{},this.ses=this.options.SES,this.name="SESTransport",this.version=Fh.version,this.logger=Jn.getLogger(this.options,{component:this.options.component||"ses-transport"}),this.maxConnections=Number(this.options.maxConnections)||1/0,this.connections=0,this.sendingRate=Number(this.options.sendingRate)||1/0,this.sendingRateTTL=null,this.rateInterval=1e3,this.rateMessages=[],this.pending=[],this.idling=!0,setImmediate(()=>{this.idling&&this.emit("idle")})}send(t,e){if(this.connections>=this.maxConnections)return this.idling=!1,this.pending.push({mail:t,callback:e});if(!this._checkSendingRate())return this.idling=!1,this.pending.push({mail:t,callback:e});this._send(t,(...i)=>{setImmediate(()=>e(...i)),this._sent()})}_checkRatedQueue(){if(this.connections>=this.maxConnections||!this._checkSendingRate())return;if(!this.pending.length){this.idling||(this.idling=!0,this.emit("idle"));return}let t=this.pending.shift();this._send(t.mail,(...e)=>{setImmediate(()=>t.callback(...e)),this._sent()})}_checkSendingRate(){clearTimeout(this.sendingRateTTL);let t=Date.now(),e=!1;for(let s=this.rateMessages.length-1;s>=0;s--)this.rateMessages[s].ts>=t-this.rateInterval&&(!e||this.rateMessages[s].ts<e)&&(e=this.rateMessages[s].ts),this.rateMessages[s].ts<t-this.rateInterval&&!this.rateMessages[s].pending&&this.rateMessages.splice(s,1);if(this.rateMessages.length<this.sendingRate)return!0;let i=Math.max(e+1001,t+20);this.sendingRateTTL=setTimeout(()=>this._checkRatedQueue(),t-i);try{this.sendingRateTTL.unref()}catch{}return!1}_sent(){this.connections--,this._checkRatedQueue()}isIdle(){return this.idling}_send(t,e){let i={ts:Date.now(),pending:!0};this.connections++,this.rateMessages.push(i);let s=t.data.envelope||t.message.getEnvelope(),a=t.message.messageId(),r=[].concat(s.to||[]);r.length>3&&r.push("...and "+r.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:a},"Sending message %s to <%s>",a,r.join(", "));let o=l=>{t.data._dkim||(t.data._dkim={}),t.data._dkim.skipFields&&typeof t.data._dkim.skipFields=="string"?t.data._dkim.skipFields+=":date:message-id":t.data._dkim.skipFields="date:message-id";let c=t.message.createReadStream(),p=c.pipe(new jh),h=[],u=0;p.on("readable",()=>{let f;for(;(f=p.read())!==null;)h.push(f),u+=f.length}),c.once("error",f=>p.emit("error",f)),p.once("error",f=>{l(f)}),p.once("end",()=>l(null,Buffer.concat(h,u)))};setImmediate(()=>o((l,c)=>{if(l)return this.logger.error({err:l,tnx:"send",messageId:a},"Failed creating message for %s. %s",a,l.message),i.pending=!1,e(l);let p={RawMessage:{Data:c},Source:s.from,Destinations:s.to};Object.keys(t.data.ses||{}).forEach(m=>{p[m]=t.data.ses[m]});let h=(this.ses.aws?this.ses.ses:this.ses)||{},u=this.ses.aws||{};(m=>h.config&&typeof h.config.region=="function"?h.config.region().then(x=>m(null,x)).catch(x=>m(x)):m(null,h.config&&h.config.region||"us-east-1"))((m,x)=>{(m||!x)&&(x="us-east-1");let b;typeof h.send=="function"&&u.SendRawEmailCommand?b=h.send(new u.SendRawEmailCommand(p)):b=h.sendRawEmail(p).promise(),b.then(A=>{x==="us-east-1"&&(x="email"),i.pending=!1,e(null,{envelope:{from:s.from,to:s.to},messageId:"<"+A.MessageId+(/@/.test(A.MessageId)?"":"@"+x+".amazonses.com")+">",response:A.MessageId,raw:c})}).catch(A=>{this.logger.error({err:A,tnx:"send"},"Send error for %s: %s",a,A.message),i.pending=!1,e(A)})})}))}verify(t){let e,i=(this.ses.aws?this.ses.ses:this.ses)||{},s=this.ses.aws||{},a={RawMessage:{Data:`From: invalid@invalid\r
|
|
62
|
-
To: invalid@invalid\r
|
|
63
|
-
Subject: Invalid\r
|
|
64
|
-
\r
|
|
65
|
-
Invalid`},Source:"invalid@invalid",Destinations:["invalid@invalid"]};t||(e=new Promise((o,l)=>{t=Jn.callbackPromise(o,l)}));let r=o=>o&&(o.code||o.Code)!=="InvalidParameterValue"?t(o):t(null,!0);return typeof i.send=="function"&&s.SendRawEmailCommand?(a.RawMessage.Data=Buffer.from(a.RawMessage.Data),i.send(new s.SendRawEmailCommand(a),r)):i.sendRawEmail(a,r),e}};Qn.exports=Os});var to=T((id,Ut)=>{"use strict";var Rh=En(),eo=j(),Uh=qn(),qh=Hn(),zh=Kn(),Hh=Wn(),$h=Xn(),Kh=Yn(),Vh=Ze(),Zn=q(),Wh=(process.env.ETHEREAL_API||"https://api.nodemailer.com").replace(/\/+$/,""),Gh=(process.env.ETHEREAL_WEB||"https://ethereal.email").replace(/\/+$/,""),Xh=["true","yes","y","1"].includes((process.env.ETHEREAL_CACHE||"yes").toString().trim().toLowerCase()),ot=!1;Ut.exports.createTransport=function(n,t){let e,i,s;return(typeof n=="object"&&typeof n.send!="function"||typeof n=="string"&&/^(smtps?|direct):/i.test(n))&&((e=typeof n=="string"?n:n.url)?i=eo.parseConnectionUrl(e):i=n,i.pool?n=new Uh(i):i.sendmail?n=new zh(i):i.streamTransport?n=new Hh(i):i.jsonTransport?n=new $h(i):i.SES?n=new Kh(i):n=new qh(i)),s=new Rh(n,i,t),s};Ut.exports.createTestAccount=function(n,t){let e;if(!t&&typeof n=="function"&&(t=n,n=!1),t||(e=new Promise((r,o)=>{t=eo.callbackPromise(r,o)})),Xh&&ot)return setImmediate(()=>t(null,ot)),e;n=n||Wh;let i=[],s=0,a=Vh(n+"/user",{contentType:"application/json",method:"POST",body:Buffer.from(JSON.stringify({requestor:Zn.name,version:Zn.version}))});return a.on("readable",()=>{let r;for(;(r=a.read())!==null;)i.push(r),s+=r.length}),a.once("error",r=>t(r)),a.once("end",()=>{let r=Buffer.concat(i,s),o,l;try{o=JSON.parse(r.toString())}catch(c){l=c}if(l)return t(l);if(o.status!=="success"||o.error)return t(new Error(o.error||"Request failed"));delete o.status,ot=o,t(null,ot)}),e};Ut.exports.getTestMessageUrl=function(n){if(!n||!n.response)return!1;let t=new Map;return n.response.replace(/\[([^\]]+)\]$/,(e,i)=>{i.replace(/\b([A-Z0-9]+)=([^\s]+)/g,(s,a,r)=>{t.set(a,r)})}),t.has("STATUS")&&t.has("MSGID")?(ot.web||Gh)+"/message/"+t.get("MSGID"):!1}});var Jh={};mo(Jh,{StackUtils:()=>io.default,codeFrameColumns:()=>so.codeFrameColumns,nodemailer:()=>ro.default,parse:()=>ao.parse});module.exports=xo(Jh);var io=ct(qs()),so=ct(Ba()),ao=ct(Cr()),ro=ct(to());0&&(module.exports={StackUtils,codeFrameColumns,nodemailer,parse});
|
|
21
|
+
`+e)}function ve(r,t,e,s,i){if(r.listenerCount("wsClientError")){let a=new Error(i);Error.captureStackTrace(a,ve),r.emit("wsClientError",a,e,t)}else At(e,s,i)}});var kl={};Rn(kl,{StackUtils:()=>Nn.default,WebSocket:()=>In,WebSocketServer:()=>_i.default,codeFrameColumns:()=>kn.codeFrameColumns,parse:()=>_n.parse});module.exports=Un(kl);var Nn=oe(Ri()),kn=oe(Or()),_n=oe(wa());var Cl=oe(Ia(),1),Il=oe(Ti(),1),Nl=oe(Ai(),1),Cn=oe(Ni(),1),_i=oe(vn(),1);var In=Cn.default;0&&(module.exports={StackUtils,WebSocket,WebSocketServer,codeFrameColumns,parse});
|