@hpcc-js/observablehq-compiler 3.2.0 → 3.3.0

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/dist/index.js CHANGED
@@ -1,14 +1,4019 @@
1
- var ei=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],nt=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],ti="\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\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",ot="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",Le={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},Fe="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",ii={5:Fe,"5module":Fe+" export import",6:Fe+" const class extends export import super"},ri=/^in(stanceof)?$/,si=new RegExp("["+ot+"]"),ai=new RegExp("["+ot+ti+"]");function De(e,t){for(var i=65536,r=0;r<t.length;r+=2){if(i+=t[r],i>e)return!1;if(i+=t[r+1],i>=e)return!0}return!1}function j(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&si.test(String.fromCharCode(e)):t===!1?!1:De(e,nt)}function ee(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&ai.test(String.fromCharCode(e)):t===!1?!1:De(e,nt)||De(e,ei)}var C=function(t,i){i===void 0&&(i={}),this.label=t,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null};function T(e,t){return new C(e,{beforeExpr:!0,binop:t})}var R={beforeExpr:!0},P={startsExpr:!0},je={};function k(e,t){return t===void 0&&(t={}),t.keyword=e,je[e]=new C(e,t)}var a={num:new C("num",P),regexp:new C("regexp",P),string:new C("string",P),name:new C("name",P),privateId:new C("privateId",P),eof:new C("eof"),bracketL:new C("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new C("]"),braceL:new C("{",{beforeExpr:!0,startsExpr:!0}),braceR:new C("}"),parenL:new C("(",{beforeExpr:!0,startsExpr:!0}),parenR:new C(")"),comma:new C(",",R),semi:new C(";",R),colon:new C(":",R),dot:new C("."),question:new C("?",R),questionDot:new C("?."),arrow:new C("=>",R),template:new C("template"),invalidTemplate:new C("invalidTemplate"),ellipsis:new C("...",R),backQuote:new C("`",P),dollarBraceL:new C("${",{beforeExpr:!0,startsExpr:!0}),eq:new C("=",{beforeExpr:!0,isAssign:!0}),assign:new C("_=",{beforeExpr:!0,isAssign:!0}),incDec:new C("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new C("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:T("||",1),logicalAND:T("&&",2),bitwiseOR:T("|",3),bitwiseXOR:T("^",4),bitwiseAND:T("&",5),equality:T("==/!=/===/!==",6),relational:T("</>/<=/>=",7),bitShift:T("<</>>/>>>",8),plusMin:new C("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:T("%",10),star:T("*",10),slash:T("/",10),starstar:new C("**",{beforeExpr:!0}),coalesce:T("??",1),_break:k("break"),_case:k("case",R),_catch:k("catch"),_continue:k("continue"),_debugger:k("debugger"),_default:k("default",R),_do:k("do",{isLoop:!0,beforeExpr:!0}),_else:k("else",R),_finally:k("finally"),_for:k("for",{isLoop:!0}),_function:k("function",P),_if:k("if"),_return:k("return",R),_switch:k("switch"),_throw:k("throw",R),_try:k("try"),_var:k("var"),_const:k("const"),_while:k("while",{isLoop:!0}),_with:k("with"),_new:k("new",{beforeExpr:!0,startsExpr:!0}),_this:k("this",P),_super:k("super",P),_class:k("class",P),_extends:k("extends",R),_export:k("export"),_import:k("import",P),_null:k("null",P),_true:k("true",P),_false:k("false",P),_in:k("in",{beforeExpr:!0,binop:7}),_instanceof:k("instanceof",{beforeExpr:!0,binop:7}),_typeof:k("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:k("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:k("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},O=/\r\n?|\n|\u2028|\u2029/,ni=new RegExp(O.source,"g");function te(e){return e===10||e===13||e===8232||e===8233}function ut(e,t,i){i===void 0&&(i=e.length);for(var r=t;r<i;r++){var s=e.charCodeAt(r);if(te(s))return r<i-1&&s===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var ht=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,L=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,lt=Object.prototype,oi=lt.hasOwnProperty,ui=lt.toString,ie=Object.hasOwn||function(e,t){return oi.call(e,t)},tt=Array.isArray||function(e){return ui.call(e)==="[object Array]"},it=Object.create(null);function H(e){return it[e]||(it[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function U(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var hi=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,he=function(t,i){this.line=t,this.column=i};he.prototype.offset=function(t){return new he(this.line,this.column+t)};var ke=function(t,i,r){this.start=i,this.end=r,t.sourceFile!==null&&(this.source=t.sourceFile)};function re(e,t){for(var i=1,r=0;;){var s=ut(e,r,t);if(s<0)return new he(i,t-r);++i,r=s}}var Me={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},rt=!1;function li(e){var t={};for(var i in Me)t[i]=e&&ie(e,i)?e[i]:Me[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!rt&&typeof console=="object"&&console.warn&&(rt=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
2
- Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),tt(t.onToken)){var r=t.onToken;t.onToken=function(s){return r.push(s)}}return tt(t.onComment)&&(t.onComment=ci(t,t.onComment)),t}function ci(e,t){return function(i,r,s,n,o,h){var u={type:i?"Block":"Line",value:r,start:s,end:n};e.locations&&(u.loc=new ke(this,o,h)),e.ranges&&(u.range=[s,n]),t.push(u)}}var le=1,se=2,Ue=4,ct=8,pt=16,ft=32,We=64,dt=128,ce=256,Ge=le|se|ce;function ze(e,t){return se|(e?Ue:0)|(t?ct:0)}var be=0,He=1,G=2,mt=3,xt=4,bt=5,_=function(t,i,r){this.options=t=li(t),this.sourceFile=t.sourceFile,this.keywords=H(ii[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var s="";t.allowReserved!==!0&&(s=Le[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(s+=" await")),this.reservedWords=H(s);var n=(s?s+" ":"")+Le.strict;this.reservedWordsStrict=H(n),this.reservedWordsStrictBind=H(n+" "+Le.strictBind),this.input=String(i),this.containsEsc=!1,r?(this.pos=r,this.lineStart=this.input.lastIndexOf(`
3
- `,r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(O).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=a.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=t.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(le),this.regexpState=null,this.privateNameStack=[]},B={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};_.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};B.inFunction.get=function(){return(this.currentVarScope().flags&se)>0};B.inGenerator.get=function(){return(this.currentVarScope().flags&ct)>0&&!this.currentVarScope().inClassFieldInit};B.inAsync.get=function(){return(this.currentVarScope().flags&Ue)>0&&!this.currentVarScope().inClassFieldInit};B.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&ce)return!1;if(t.flags&se)return(t.flags&Ue)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};B.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&We)>0||i||this.options.allowSuperOutsideMethod};B.allowDirectSuper.get=function(){return(this.currentThisScope().flags&dt)>0};B.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};B.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&(se|ce))>0||i};B.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&ce)>0};_.extend=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];for(var r=this,s=0;s<t.length;s++)r=t[s](r);return r};_.parse=function(t,i){return new this(i,t).parse()};_.parseExpressionAt=function(t,i,r){var s=new this(r,t,i);return s.nextToken(),s.parseExpression()};_.tokenizer=function(t,i){return new this(i,t)};Object.defineProperties(_.prototype,B);var I=_.prototype,pi=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;I.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){L.lastIndex=e,e+=L.exec(this.input)[0].length;var t=pi.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){L.lastIndex=e+t[0].length;var i=L.exec(this.input),r=i.index+i[0].length,s=this.input.charAt(r);return s===";"||s==="}"||O.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(s)||s==="!"&&this.input.charAt(r+1)==="=")}e+=t[0].length,L.lastIndex=e,e+=L.exec(this.input)[0].length,this.input[e]===";"&&e++}};I.eat=function(e){return this.type===e?(this.next(),!0):!1};I.isContextual=function(e){return this.type===a.name&&this.value===e&&!this.containsEsc};I.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};I.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};I.canInsertSemicolon=function(){return this.type===a.eof||this.type===a.braceR||O.test(this.input.slice(this.lastTokEnd,this.start))};I.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};I.semicolon=function(){!this.eat(a.semi)&&!this.insertSemicolon()&&this.unexpected()};I.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0};I.expect=function(e){this.eat(e)||this.unexpected()};I.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var Ce=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};I.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,t?"Assigning to rvalue":"Parenthesized pattern")}};I.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,r=e.doubleProto;if(!t)return i>=0||r>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),r>=0&&this.raiseRecoverable(r,"Redefinition of __proto__ property")};I.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")};I.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var m=_.prototype;m.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==a.eof;){var i=this.parseStatement(null,!0,t);e.body.push(i)}if(this.inModule)for(var r=0,s=Object.keys(this.undefinedExports);r<s.length;r+=1){var n=s[r];this.raiseRecoverable(this.undefinedExports[n].start,"Export '"+n+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var $e={kind:"loop"},fi={kind:"switch"};m.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;L.lastIndex=this.pos;var t=L.exec(this.input),i=this.pos+t[0].length,r=this.input.charCodeAt(i);if(r===91||r===92)return!0;if(e)return!1;if(r===123||r>55295&&r<56320)return!0;if(j(r,!0)){for(var s=i+1;ee(r=this.input.charCodeAt(s),!0);)++s;if(r===92||r>55295&&r<56320)return!0;var n=this.input.slice(i,s);if(!ri.test(n))return!0}return!1};m.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;L.lastIndex=this.pos;var e=L.exec(this.input),t=this.pos+e[0].length,i;return!O.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(ee(i=this.input.charCodeAt(t+8))||i>55295&&i<56320))};m.parseStatement=function(e,t,i){var r=this.type,s=this.startNode(),n;switch(this.isLet(e)&&(r=a._var,n="let"),r){case a._break:case a._continue:return this.parseBreakContinueStatement(s,r.keyword);case a._debugger:return this.parseDebuggerStatement(s);case a._do:return this.parseDoStatement(s);case a._for:return this.parseForStatement(s);case a._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case a._class:return e&&this.unexpected(),this.parseClass(s,!0);case a._if:return this.parseIfStatement(s);case a._return:return this.parseReturnStatement(s);case a._switch:return this.parseSwitchStatement(s);case a._throw:return this.parseThrowStatement(s);case a._try:return this.parseTryStatement(s);case a._const:case a._var:return n=n||this.value,e&&n!=="var"&&this.unexpected(),this.parseVarStatement(s,n);case a._while:return this.parseWhileStatement(s);case a._with:return this.parseWithStatement(s);case a.braceL:return this.parseBlock(!0,s);case a.semi:return this.parseEmptyStatement(s);case a._export:case a._import:if(this.options.ecmaVersion>10&&r===a._import){L.lastIndex=this.pos;var o=L.exec(this.input),h=this.pos+o[0].length,u=this.input.charCodeAt(h);if(u===40||u===46)return this.parseExpressionStatement(s,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===a._import?this.parseImport(s):this.parseExport(s,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,!0,!e);var l=this.value,p=this.parseExpression();return r===a.name&&p.type==="Identifier"&&this.eat(a.colon)?this.parseLabeledStatement(s,l,p,e):this.parseExpressionStatement(s,p)}};m.parseBreakContinueStatement=function(e,t){var i=t==="break";this.next(),this.eat(a.semi)||this.insertSemicolon()?e.label=null:this.type!==a.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var r=0;r<this.labels.length;++r){var s=this.labels[r];if((e.label==null||s.name===e.label.name)&&(s.kind!=null&&(i||s.kind==="loop")||e.label&&i))break}return r===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")};m.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};m.parseDoStatement=function(e){return this.next(),this.labels.push($e),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(a._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(a.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};m.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push($e),this.enterScope(0),this.expect(a.parenL),this.type===a.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===a._var||this.type===a._const||i){var r=this.startNode(),s=i?"let":this.value;return this.next(),this.parseVar(r,!0,s),this.finishNode(r,"VariableDeclaration"),(this.type===a._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&r.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===a._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,r)):(t>-1&&this.unexpected(t),this.parseFor(e,r))}var n=this.isContextual("let"),o=!1,h=this.containsEsc,u=new Ce,l=this.start,p=t>-1?this.parseExprSubscripts(u,"await"):this.parseExpression(!0,u);return this.type===a._in||(o=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===a._in&&this.unexpected(t),e.await=!0):o&&this.options.ecmaVersion>=8&&(p.start===l&&!h&&p.type==="Identifier"&&p.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),n&&o&&this.raise(p.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(p,!1,u),this.checkLValPattern(p),this.parseForIn(e,p)):(this.checkExpressionErrors(u,!0),t>-1&&this.unexpected(t),this.parseFor(e,p))};m.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,ue|(i?0:Be),!1,t)};m.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(a._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};m.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(a.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};m.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(a.braceL),this.labels.push(fi),this.enterScope(0);for(var t,i=!1;this.type!==a.braceR;)if(this.type===a._case||this.type===a._default){var r=this.type===a._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,t.test=null),this.expect(a.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};m.parseThrowStatement=function(e){return this.next(),O.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var di=[];m.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?ft:0),this.checkLValPattern(e,t?xt:G),this.expect(a.parenR),e};m.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===a._catch){var t=this.startNode();this.next(),this.eat(a.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(a._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};m.parseVarStatement=function(e,t,i){return this.next(),this.parseVar(e,!1,t,i),this.semicolon(),this.finishNode(e,"VariableDeclaration")};m.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push($e),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};m.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};m.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};m.parseLabeledStatement=function(e,t,i,r){for(var s=0,n=this.labels;s<n.length;s+=1){var o=n[s];o.name===t&&this.raise(i.start,"Label '"+t+"' is already declared")}for(var h=this.type.isLoop?"loop":this.type===a._switch?"switch":null,u=this.labels.length-1;u>=0;u--){var l=this.labels[u];if(l.statementStart===e.start)l.statementStart=this.start,l.kind=h;else break}return this.labels.push({name:t,kind:h,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf("label")===-1?r+"label":r:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")};m.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};m.parseBlock=function(e,t,i){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(a.braceL),e&&this.enterScope(0);this.type!==a.braceR;){var r=this.parseStatement(null);t.body.push(r)}return i&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")};m.parseFor=function(e,t){return e.init=t,this.expect(a.semi),e.test=this.type===a.semi?null:this.parseExpression(),this.expect(a.semi),e.update=this.type===a.parenR?null:this.parseExpression(),this.expect(a.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};m.parseForIn=function(e,t){var i=this.type===a._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(a.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")};m.parseVar=function(e,t,i,r){for(e.declarations=[],e.kind=i;;){var s=this.startNode();if(this.parseVarId(s,i),this.eat(a.eq)?s.init=this.parseMaybeAssign(t):!r&&i==="const"&&!(this.type===a._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!r&&s.id.type!=="Identifier"&&!(t&&(this.type===a._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):s.init=null,e.declarations.push(this.finishNode(s,"VariableDeclarator")),!this.eat(a.comma))break}return e};m.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?He:G,!1)};var ue=1,Be=2,vt=4;m.parseFunction=function(e,t,i,r,s){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===a.star&&t&Be&&this.unexpected(),e.generator=this.eat(a.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&ue&&(e.id=t&vt&&this.type!==a.name?null:this.parseIdent(),e.id&&!(t&Be)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?He:G:mt));var n=this.yieldPos,o=this.awaitPos,h=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ze(e.async,e.generator)),t&ue||(e.id=this.type===a.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,s),this.yieldPos=n,this.awaitPos=o,this.awaitIdentPos=h,this.finishNode(e,t&ue?"FunctionDeclaration":"FunctionExpression")};m.parseFunctionParams=function(e){this.expect(a.parenL),e.params=this.parseBindingList(a.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};m.parseClass=function(e,t){this.next();var i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),s=this.startNode(),n=!1;for(s.body=[],this.expect(a.braceL);this.type!==a.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(s.body.push(o),o.type==="MethodDefinition"&&o.kind==="constructor"?(n&&this.raiseRecoverable(o.start,"Duplicate constructor in the same class"),n=!0):o.key&&o.key.type==="PrivateIdentifier"&&mi(r,o)&&this.raiseRecoverable(o.key.start,"Identifier '#"+o.key.name+"' has already been declared"))}return this.strict=i,this.next(),e.body=this.finishNode(s,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};m.parseClassElement=function(e){if(this.eat(a.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),r="",s=!1,n=!1,o="method",h=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(a.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===a.star?h=!0:r="static"}if(i.static=h,!r&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===a.star)&&!this.canInsertSemicolon()?n=!0:r="async"),!r&&(t>=9||!n)&&this.eat(a.star)&&(s=!0),!r&&!n&&!s){var u=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?o=u:r=u)}if(r?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=r,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===a.parenL||o!=="method"||s||n){var l=!i.static&&ve(i,"constructor"),p=l&&e;l&&o!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=l?"constructor":o,this.parseClassMethod(i,s,n,p)}else this.parseClassField(i);return i};m.isClassElementNameStart=function(){return this.type===a.name||this.type===a.privateId||this.type===a.num||this.type===a.string||this.type===a.bracketL||this.type.keyword};m.parseClassElementName=function(e){this.type===a.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};m.parseClassMethod=function(e,t,i,r){var s=e.key;e.kind==="constructor"?(t&&this.raise(s.start,"Constructor can't be a generator"),i&&this.raise(s.start,"Constructor can't be an async method")):e.static&&ve(e,"prototype")&&this.raise(s.start,"Classes may not have a static property named prototype");var n=e.value=this.parseMethod(t,i,r);return e.kind==="get"&&n.params.length!==0&&this.raiseRecoverable(n.start,"getter should have no params"),e.kind==="set"&&n.params.length!==1&&this.raiseRecoverable(n.start,"setter should have exactly one param"),e.kind==="set"&&n.params[0].type==="RestElement"&&this.raiseRecoverable(n.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};m.parseClassField=function(e){if(ve(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&ve(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(a.eq)){var t=this.currentThisScope(),i=t.inClassFieldInit;t.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),t.inClassFieldInit=i}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};m.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(ce|We);this.type!==a.braceR;){var i=this.parseStatement(null);e.body.push(i)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};m.parseClassId=function(e,t){this.type===a.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,G,!1)):(t===!0&&this.unexpected(),e.id=null)};m.parseClassSuper=function(e){e.superClass=this.eat(a._extends)?this.parseExprSubscripts(null,!1):null};m.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};m.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,i=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,s=r===0?null:this.privateNameStack[r-1],n=0;n<i.length;++n){var o=i[n];ie(t,o.name)||(s?s.used.push(o):this.raiseRecoverable(o.start,"Private field '#"+o.name+"' must be declared in an enclosing class"))}};function mi(e,t){var i=t.key.name,r=e[i],s="true";return t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")&&(s=(t.static?"s":"i")+t.kind),r==="iget"&&s==="iset"||r==="iset"&&s==="iget"||r==="sget"&&s==="sset"||r==="sset"&&s==="sget"?(e[i]="true",!1):r?!0:(e[i]=s,!1)}function ve(e,t){var i=e.computed,r=e.key;return!i&&(r.type==="Identifier"&&r.name===t||r.type==="Literal"&&r.value===t)}m.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==a.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};m.parseExport=function(e,t){if(this.next(),this.eat(a.star))return this.parseExportAllDeclaration(e,t);if(this.eat(a._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==a.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var i=0,r=e.specifiers;i<r.length;i+=1){var s=r[i];this.checkUnreserved(s.local),this.checkLocalExport(s.local),s.local.type==="Literal"&&this.raise(s.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")};m.parseExportDeclaration=function(e){return this.parseStatement(null)};m.parseExportDefaultDeclaration=function(){var e;if(this.type===a._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,ue|vt,!1,e)}else if(this.type===a._class){var i=this.startNode();return this.parseClass(i,"nullableID")}else{var r=this.parseMaybeAssign();return this.semicolon(),r}};m.checkExport=function(e,t,i){e&&(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),ie(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=!0)};m.checkPatternExport=function(e,t){var i=t.type;if(i==="Identifier")this.checkExport(e,t,t.start);else if(i==="ObjectPattern")for(var r=0,s=t.properties;r<s.length;r+=1){var n=s[r];this.checkPatternExport(e,n)}else if(i==="ArrayPattern")for(var o=0,h=t.elements;o<h.length;o+=1){var u=h[o];u&&this.checkPatternExport(e,u)}else i==="Property"?this.checkPatternExport(e,t.value):i==="AssignmentPattern"?this.checkPatternExport(e,t.left):i==="RestElement"&&this.checkPatternExport(e,t.argument)};m.checkVariableExport=function(e,t){if(e)for(var i=0,r=t;i<r.length;i+=1){var s=r[i];this.checkPatternExport(e,s.id)}};m.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};m.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")};m.parseExportSpecifiers=function(e){var t=[],i=!0;for(this.expect(a.braceL);!this.eat(a.braceR);){if(i)i=!1;else if(this.expect(a.comma),this.afterTrailingComma(a.braceR))break;t.push(this.parseExportSpecifier(e))}return t};m.parseImport=function(e){return this.next(),this.type===a.string?(e.specifiers=di,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===a.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")};m.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,G),this.finishNode(e,"ImportSpecifier")};m.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,G),this.finishNode(e,"ImportDefaultSpecifier")};m.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,G),this.finishNode(e,"ImportNamespaceSpecifier")};m.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===a.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(a.comma)))return e;if(this.type===a.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(a.braceL);!this.eat(a.braceR);){if(t)t=!1;else if(this.expect(a.comma),this.afterTrailingComma(a.braceR))break;e.push(this.parseImportSpecifier())}return e};m.parseWithClause=function(){var e=[];if(!this.eat(a._with))return e;this.expect(a.braceL);for(var t={},i=!0;!this.eat(a.braceR);){if(i)i=!1;else if(this.expect(a.comma),this.afterTrailingComma(a.braceR))break;var r=this.parseImportAttribute(),s=r.key.type==="Identifier"?r.key.name:r.key.value;ie(t,s)&&this.raiseRecoverable(r.key.start,"Duplicate attribute key '"+s+"'"),t[s]=!0,e.push(r)}return e};m.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===a.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(a.colon),this.type!==a.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")};m.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===a.string){var e=this.parseLiteral(this.value);return hi.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};m.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)};m.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var D=_.prototype;D.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var r=0,s=e.properties;r<s.length;r+=1){var n=s[r];this.toAssignable(n,t),n.type==="RestElement"&&(n.argument.type==="ArrayPattern"||n.argument.type==="ObjectPattern")&&this.raise(n.argument.start,"Unexpected token")}break;case"Property":e.kind!=="init"&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),e.argument.type==="AssignmentPattern"&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":e.operator!=="="&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,i);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return e};D.toAssignableList=function(e,t){for(var i=e.length,r=0;r<i;r++){var s=e[r];s&&this.toAssignable(s,t)}if(i){var n=e[i-1];this.options.ecmaVersion===6&&t&&n&&n.type==="RestElement"&&n.argument.type!=="Identifier"&&this.unexpected(n.argument.start)}return e};D.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")};D.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==a.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};D.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case a.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(a.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case a.braceL:return this.parseObj(!0)}return this.parseIdent()};D.parseBindingList=function(e,t,i,r){for(var s=[],n=!0;!this.eat(e);)if(n?n=!1:this.expect(a.comma),t&&this.type===a.comma)s.push(null);else{if(i&&this.afterTrailingComma(e))break;if(this.type===a.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),s.push(o),this.type===a.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}else s.push(this.parseAssignableListItem(r))}return s};D.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t};D.parseBindingListItem=function(e){return e};D.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(a.eq))return i;var r=this.startNodeAt(e,t);return r.left=i,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")};D.checkLValSimple=function(e,t,i){t===void 0&&(t=be);var r=t!==be;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?"Binding ":"Assigning to ")+e.name+" in strict mode"),r&&(t===G&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(ie(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=!0),t!==bt&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":r&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return r&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(r?"Binding":"Assigning to")+" rvalue")}};D.checkLValPattern=function(e,t,i){switch(t===void 0&&(t=be),e.type){case"ObjectPattern":for(var r=0,s=e.properties;r<s.length;r+=1){var n=s[r];this.checkLValInnerPattern(n,t,i)}break;case"ArrayPattern":for(var o=0,h=e.elements;o<h.length;o+=1){var u=h[o];u&&this.checkLValInnerPattern(u,t,i)}break;default:this.checkLValSimple(e,t,i)}};D.checkLValInnerPattern=function(e,t,i){switch(t===void 0&&(t=be),e.type){case"Property":this.checkLValInnerPattern(e.value,t,i);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,i);break;case"RestElement":this.checkLValPattern(e.argument,t,i);break;default:this.checkLValPattern(e,t,i)}};var N=function(t,i,r,s,n){this.token=t,this.isExpr=!!i,this.preserveSpace=!!r,this.override=s,this.generator=!!n},S={b_stat:new N("{",!1),b_expr:new N("{",!0),b_tmpl:new N("${",!1),p_stat:new N("(",!1),p_expr:new N("(",!0),q_tmpl:new N("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new N("function",!1),f_expr:new N("function",!0),f_expr_gen:new N("function",!0,!1,null,!0),f_gen:new N("function",!1,!1,null,!0)},ae=_.prototype;ae.initialContext=function(){return[S.b_stat]};ae.curContext=function(){return this.context[this.context.length-1]};ae.braceIsBlock=function(e){var t=this.curContext();return t===S.f_expr||t===S.f_stat?!0:e===a.colon&&(t===S.b_stat||t===S.b_expr)?!t.isExpr:e===a._return||e===a.name&&this.exprAllowed?O.test(this.input.slice(this.lastTokEnd,this.start)):e===a._else||e===a.semi||e===a.eof||e===a.parenR||e===a.arrow?!0:e===a.braceL?t===S.b_stat:e===a._var||e===a._const||e===a.name?!1:!this.exprAllowed};ae.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token==="function")return t.generator}return!1};ae.updateContext=function(e){var t,i=this.type;i.keyword&&e===a.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr};ae.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)};a.parenR.updateContext=a.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===S.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr};a.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?S.b_stat:S.b_expr),this.exprAllowed=!0};a.dollarBraceL.updateContext=function(){this.context.push(S.b_tmpl),this.exprAllowed=!0};a.parenL.updateContext=function(e){var t=e===a._if||e===a._for||e===a._with||e===a._while;this.context.push(t?S.p_stat:S.p_expr),this.exprAllowed=!0};a.incDec.updateContext=function(){};a._function.updateContext=a._class.updateContext=function(e){e.beforeExpr&&e!==a._else&&!(e===a.semi&&this.curContext()!==S.p_stat)&&!(e===a._return&&O.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===a.colon||e===a.braceL)&&this.curContext()===S.b_stat)?this.context.push(S.f_expr):this.context.push(S.f_stat),this.exprAllowed=!1};a.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0};a.backQuote.updateContext=function(){this.curContext()===S.q_tmpl?this.context.pop():this.context.push(S.q_tmpl),this.exprAllowed=!1};a.star.updateContext=function(e){if(e===a._function){var t=this.context.length-1;this.context[t]===S.f_expr?this.context[t]=S.f_expr_gen:this.context[t]=S.f_gen}this.exprAllowed=!0};a.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==a.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var b=_.prototype;b.checkPropClash=function(e,t,i){if(!(this.options.ecmaVersion>=9&&e.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,s;switch(r.type){case"Identifier":s=r.name;break;case"Literal":s=String(r.value);break;default:return}var n=e.kind;if(this.options.ecmaVersion>=6){s==="__proto__"&&n==="init"&&(t.proto&&(i?i.doubleProto<0&&(i.doubleProto=r.start):this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),t.proto=!0);return}s="$"+s;var o=t[s];if(o){var h;n==="init"?h=this.strict&&o.init||o.get||o.set:h=o.init||o[n],h&&this.raiseRecoverable(r.start,"Redefinition of property")}else o=t[s]={init:!1,get:!1,set:!1};o[n]=!0}};b.parseExpression=function(e,t){var i=this.start,r=this.startLoc,s=this.parseMaybeAssign(e,t);if(this.type===a.comma){var n=this.startNodeAt(i,r);for(n.expressions=[s];this.eat(a.comma);)n.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(n,"SequenceExpression")}return s};b.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,s=-1,n=-1,o=-1;t?(s=t.parenthesizedAssign,n=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new Ce,r=!0);var h=this.start,u=this.startLoc;(this.type===a.parenL||this.type===a.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var l=this.parseMaybeConditional(e,t);if(i&&(l=i.call(this,l,h,u)),this.type.isAssign){var p=this.startNodeAt(h,u);return p.operator=this.value,this.type===a.eq&&(l=this.toAssignable(l,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),this.type===a.eq?this.checkLValPattern(l):this.checkLValSimple(l),p.left=l,this.next(),p.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(p,"AssignmentExpression")}else r&&this.checkExpressionErrors(t,!0);return s>-1&&(t.parenthesizedAssign=s),n>-1&&(t.trailingComma=n),l};b.parseMaybeConditional=function(e,t){var i=this.start,r=this.startLoc,s=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return s;if(this.eat(a.question)){var n=this.startNodeAt(i,r);return n.test=s,n.consequent=this.parseMaybeAssign(),this.expect(a.colon),n.alternate=this.parseMaybeAssign(e),this.finishNode(n,"ConditionalExpression")}return s};b.parseExprOps=function(e,t){var i=this.start,r=this.startLoc,s=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||s.start===i&&s.type==="ArrowFunctionExpression"?s:this.parseExprOp(s,i,r,-1,e)};b.parseExprOp=function(e,t,i,r,s){var n=this.type.binop;if(n!=null&&(!s||this.type!==a._in)&&n>r){var o=this.type===a.logicalOR||this.type===a.logicalAND,h=this.type===a.coalesce;h&&(n=a.logicalAND.binop);var u=this.value;this.next();var l=this.start,p=this.startLoc,v=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,s),l,p,n,s),E=this.buildBinary(t,i,e,v,u,o||h);return(o&&this.type===a.coalesce||h&&(this.type===a.logicalOR||this.type===a.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(E,t,i,r,s)}return e};b.buildBinary=function(e,t,i,r,s,n){r.type==="PrivateIdentifier"&&this.raise(r.start,"Private identifier can only be left side of binary expression");var o=this.startNodeAt(e,t);return o.left=i,o.operator=s,o.right=r,this.finishNode(o,n?"LogicalExpression":"BinaryExpression")};b.parseMaybeUnary=function(e,t,i,r){var s=this.start,n=this.startLoc,o;if(this.isContextual("await")&&this.canAwait)o=this.parseAwait(r),t=!0;else if(this.type.prefix){var h=this.startNode(),u=this.type===a.incDec;h.operator=this.value,h.prefix=!0,this.next(),h.argument=this.parseMaybeUnary(null,!0,u,r),this.checkExpressionErrors(e,!0),u?this.checkLValSimple(h.argument):this.strict&&h.operator==="delete"&&gt(h.argument)?this.raiseRecoverable(h.start,"Deleting local variable in strict mode"):h.operator==="delete"&&qe(h.argument)?this.raiseRecoverable(h.start,"Private fields can not be deleted"):t=!0,o=this.finishNode(h,u?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===a.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),o=this.parsePrivateIdent(),this.type!==a._in&&this.unexpected();else{if(o=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return o;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(s,n);l.operator=this.value,l.prefix=!1,l.argument=o,this.checkLValSimple(o),this.next(),o=this.finishNode(l,"UpdateExpression")}}if(!i&&this.eat(a.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(s,n,o,this.parseMaybeUnary(null,!1,!1,r),"**",!1);else return o};function gt(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&gt(e.expression)}function qe(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&qe(e.expression)||e.type==="ParenthesizedExpression"&&qe(e.expression)}b.parseExprSubscripts=function(e,t){var i=this.start,r=this.startLoc,s=this.parseExprAtom(e,t);if(s.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return s;var n=this.parseSubscripts(s,i,r,!1,t);return e&&n.type==="MemberExpression"&&(e.parenthesizedAssign>=n.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=n.start&&(e.parenthesizedBind=-1),e.trailingComma>=n.start&&(e.trailingComma=-1)),n};b.parseSubscripts=function(e,t,i,r,s){for(var n=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,o=!1;;){var h=this.parseSubscript(e,t,i,r,n,o,s);if(h.optional&&(o=!0),h===e||h.type==="ArrowFunctionExpression"){if(o){var u=this.startNodeAt(t,i);u.expression=h,h=this.finishNode(u,"ChainExpression")}return h}e=h}};b.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(a.arrow)};b.parseSubscriptAsyncArrow=function(e,t,i,r){return this.parseArrowExpression(this.startNodeAt(e,t),i,!0,r)};b.parseSubscript=function(e,t,i,r,s,n,o){var h=this.options.ecmaVersion>=11,u=h&&this.eat(a.questionDot);r&&u&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var l=this.eat(a.bracketL);if(l||u&&this.type!==a.parenL&&this.type!==a.backQuote||this.eat(a.dot)){var p=this.startNodeAt(t,i);p.object=e,l?(p.property=this.parseExpression(),this.expect(a.bracketR)):this.type===a.privateId&&e.type!=="Super"?p.property=this.parsePrivateIdent():p.property=this.parseIdent(this.options.allowReserved!=="never"),p.computed=!!l,h&&(p.optional=u),e=this.finishNode(p,"MemberExpression")}else if(!r&&this.eat(a.parenL)){var v=new Ce,E=this.yieldPos,V=this.awaitPos,A=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var Z=this.parseExprList(a.parenR,this.options.ecmaVersion>=8,!1,v);if(s&&!u&&this.shouldParseAsyncArrow())return this.checkPatternErrors(v,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=E,this.awaitPos=V,this.awaitIdentPos=A,this.parseSubscriptAsyncArrow(t,i,Z,o);this.checkExpressionErrors(v,!0),this.yieldPos=E||this.yieldPos,this.awaitPos=V||this.awaitPos,this.awaitIdentPos=A||this.awaitIdentPos;var M=this.startNodeAt(t,i);M.callee=e,M.arguments=Z,h&&(M.optional=u),e=this.finishNode(M,"CallExpression")}else if(this.type===a.backQuote){(u||n)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var f=this.startNodeAt(t,i);f.tag=e,f.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(f,"TaggedTemplateExpression")}return e};b.parseExprAtom=function(e,t,i){this.type===a.slash&&this.readRegexp();var r,s=this.potentialArrowAt===this.start;switch(this.type){case a._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),r=this.startNode(),this.next(),this.type===a.parenL&&!this.allowDirectSuper&&this.raise(r.start,"super() call outside constructor of a subclass"),this.type!==a.dot&&this.type!==a.bracketL&&this.type!==a.parenL&&this.unexpected(),this.finishNode(r,"Super");case a._this:return r=this.startNode(),this.next(),this.finishNode(r,"ThisExpression");case a.name:var n=this.start,o=this.startLoc,h=this.containsEsc,u=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!h&&u.name==="async"&&!this.canInsertSemicolon()&&this.eat(a._function))return this.overrideContext(S.f_expr),this.parseFunction(this.startNodeAt(n,o),0,!1,!0,t);if(s&&!this.canInsertSemicolon()){if(this.eat(a.arrow))return this.parseArrowExpression(this.startNodeAt(n,o),[u],!1,t);if(this.options.ecmaVersion>=8&&u.name==="async"&&this.type===a.name&&!h&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return u=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(a.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,o),[u],!0,t)}return u;case a.regexp:var l=this.value;return r=this.parseLiteral(l.value),r.regex={pattern:l.pattern,flags:l.flags},r;case a.num:case a.string:return this.parseLiteral(this.value);case a._null:case a._true:case a._false:return r=this.startNode(),r.value=this.type===a._null?null:this.type===a._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,"Literal");case a.parenL:var p=this.start,v=this.parseParenAndDistinguishExpression(s,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(v)&&(e.parenthesizedAssign=p),e.parenthesizedBind<0&&(e.parenthesizedBind=p)),v;case a.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(a.bracketR,!0,!0,e),this.finishNode(r,"ArrayExpression");case a.braceL:return this.overrideContext(S.b_expr),this.parseObj(!1,e);case a._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case a._class:return this.parseClass(this.startNode(),!1);case a._new:return this.parseNew();case a.backQuote:return this.parseTemplate();case a._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}};b.parseExprAtomDefault=function(){this.unexpected()};b.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===a.parenL&&!e)return this.parseDynamicImport(t);if(this.type===a.dot){var i=this.startNodeAt(t.start,t.loc&&t.loc.start);return i.name="import",t.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(t)}else this.unexpected()};b.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(a.parenR)?e.options=null:(this.expect(a.comma),this.afterTrailingComma(a.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(a.parenR)||(this.expect(a.comma),this.afterTrailingComma(a.parenR)||this.unexpected())));else if(!this.eat(a.parenR)){var t=this.start;this.eat(a.comma)&&this.eat(a.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")};b.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};b.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")};b.parseParenExpression=function(){this.expect(a.parenL);var e=this.parseExpression();return this.expect(a.parenR),e};b.shouldParseArrow=function(e){return!this.canInsertSemicolon()};b.parseParenAndDistinguishExpression=function(e,t){var i=this.start,r=this.startLoc,s,n=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,h=this.startLoc,u=[],l=!0,p=!1,v=new Ce,E=this.yieldPos,V=this.awaitPos,A;for(this.yieldPos=0,this.awaitPos=0;this.type!==a.parenR;)if(l?l=!1:this.expect(a.comma),n&&this.afterTrailingComma(a.parenR,!0)){p=!0;break}else if(this.type===a.ellipsis){A=this.start,u.push(this.parseParenItem(this.parseRestBinding())),this.type===a.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else u.push(this.parseMaybeAssign(!1,v,this.parseParenItem));var Z=this.lastTokEnd,M=this.lastTokEndLoc;if(this.expect(a.parenR),e&&this.shouldParseArrow(u)&&this.eat(a.arrow))return this.checkPatternErrors(v,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=E,this.awaitPos=V,this.parseParenArrowList(i,r,u,t);(!u.length||p)&&this.unexpected(this.lastTokStart),A&&this.unexpected(A),this.checkExpressionErrors(v,!0),this.yieldPos=E||this.yieldPos,this.awaitPos=V||this.awaitPos,u.length>1?(s=this.startNodeAt(o,h),s.expressions=u,this.finishNodeAt(s,"SequenceExpression",Z,M)):s=u[0]}else s=this.parseParenExpression();if(this.options.preserveParens){var f=this.startNodeAt(i,r);return f.expression=s,this.finishNode(f,"ParenthesizedExpression")}else return s};b.parseParenItem=function(e){return e};b.parseParenArrowList=function(e,t,i,r){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,r)};var xi=[];b.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===a.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var i=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var r=this.start,s=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,s,!0,!1),this.eat(a.parenL)?e.arguments=this.parseExprList(a.parenR,this.options.ecmaVersion>=8,!1):e.arguments=xi,this.finishNode(e,"NewExpression")};b.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===a.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value.replace(/\r\n?/g,`
4
- `),cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
5
- `),cooked:this.value},this.next(),i.tail=this.type===a.backQuote,this.finishNode(i,"TemplateElement")};b.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var i=this.startNode();this.next(),i.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(i.quasis=[r];!r.tail;)this.type===a.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(a.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(a.braceR),i.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")};b.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===a.name||this.type===a.num||this.type===a.string||this.type===a.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===a.star)&&!O.test(this.input.slice(this.lastTokEnd,this.start))};b.parseObj=function(e,t){var i=this.startNode(),r=!0,s={};for(i.properties=[],this.next();!this.eat(a.braceR);){if(r)r=!1;else if(this.expect(a.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(a.braceR))break;var n=this.parseProperty(e,t);e||this.checkPropClash(n,s,t),i.properties.push(n)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")};b.parseProperty=function(e,t){var i=this.startNode(),r,s,n,o;if(this.options.ecmaVersion>=9&&this.eat(a.ellipsis))return e?(i.argument=this.parseIdent(!1),this.type===a.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,t),this.type===a.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(e||t)&&(n=this.start,o=this.startLoc),e||(r=this.eat(a.star)));var h=this.containsEsc;return this.parsePropertyName(i),!e&&!h&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(i)?(s=!0,r=this.options.ecmaVersion>=9&&this.eat(a.star),this.parsePropertyName(i)):s=!1,this.parsePropertyValue(i,e,r,s,n,o,t,h),this.finishNode(i,"Property")};b.parseGetterSetter=function(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var t=e.kind==="get"?0:1;if(e.value.params.length!==t){var i=e.value.start;e.kind==="get"?this.raiseRecoverable(i,"getter should have no params"):this.raiseRecoverable(i,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};b.parsePropertyValue=function(e,t,i,r,s,n,o,h){(i||r)&&this.type===a.colon&&this.unexpected(),this.eat(a.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind="init"):this.options.ecmaVersion>=6&&this.type===a.parenL?(t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(i,r)):!t&&!h&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==a.comma&&this.type!==a.braceR&&this.type!==a.eq?((i||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((i||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=s),e.kind="init",t?e.value=this.parseMaybeDefault(s,n,this.copyNode(e.key)):this.type===a.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(s,n,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()};b.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(a.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(a.bracketR),e.key;e.computed=!1}return e.key=this.type===a.num||this.type===a.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};b.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};b.parseMethod=function(e,t,i){var r=this.startNode(),s=this.yieldPos,n=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ze(t,r.generator)|We|(i?dt:0)),this.expect(a.parenL),r.params=this.parseBindingList(a.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=s,this.awaitPos=n,this.awaitIdentPos=o,this.finishNode(r,"FunctionExpression")};b.parseArrowExpression=function(e,t,i,r){var s=this.yieldPos,n=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(ze(i,!1)|pt),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=s,this.awaitPos=n,this.awaitIdentPos=o,this.finishNode(e,"ArrowFunctionExpression")};b.parseFunctionBody=function(e,t,i,r){var s=t&&this.type!==a.braceL,n=this.strict,o=!1;if(s)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var h=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!n||h)&&(o=this.strictDirective(this.end),o&&h&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var u=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!n&&!o&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,bt),e.body=this.parseBlock(!1,void 0,o&&!n),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=u}this.exitScope()};b.isSimpleParamList=function(e){for(var t=0,i=e;t<i.length;t+=1){var r=i[t];if(r.type!=="Identifier")return!1}return!0};b.checkParams=function(e,t){for(var i=Object.create(null),r=0,s=e.params;r<s.length;r+=1){var n=s[r];this.checkLValInnerPattern(n,He,t?null:i)}};b.parseExprList=function(e,t,i,r){for(var s=[],n=!0;!this.eat(e);){if(n)n=!1;else if(this.expect(a.comma),t&&this.afterTrailingComma(e))break;var o=void 0;i&&this.type===a.comma?o=null:this.type===a.ellipsis?(o=this.parseSpread(r),r&&this.type===a.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(!1,r),s.push(o)}return s};b.checkUnreserved=function(e){var t=e.start,i=e.end,r=e.name;if(this.inGenerator&&r==="yield"&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),this.currentThisScope().inClassFieldInit&&r==="arguments"&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(r==="arguments"||r==="await")&&this.raise(t,"Cannot use "+r+" in class static initialization block"),this.keywords.test(r)&&this.raise(t,"Unexpected keyword '"+r+"'"),!(this.options.ecmaVersion<6&&this.input.slice(t,i).indexOf("\\")!==-1)){var s=this.strict?this.reservedWordsStrict:this.reservedWords;s.test(r)&&(!this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+r+"' is reserved"))}};b.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),t.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t};b.parseIdentNode=function(){var e=this.startNode();return this.type===a.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,(e.name==="class"||e.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=a.name):this.unexpected(),e};b.parsePrivateIdent=function(){var e=this.startNode();return this.type===a.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e};b.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===a.semi||this.canInsertSemicolon()||this.type!==a.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(a.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")};b.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var ge=_.prototype;ge.raise=function(e,t){var i=re(this.input,e);t+=" ("+i.line+":"+i.column+")";var r=new SyntaxError(t);throw r.pos=e,r.loc=i,r.raisedAt=this.pos,r};ge.raiseRecoverable=ge.raise;ge.curPosition=function(){if(this.options.locations)return new he(this.curLine,this.pos-this.lineStart)};var $=_.prototype,bi=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[],this.inClassFieldInit=!1};$.enterScope=function(e){this.scopeStack.push(new bi(e))};$.exitScope=function(){this.scopeStack.pop()};$.treatFunctionsAsVarInScope=function(e){return e.flags&se||!this.inModule&&e.flags&le};$.declareName=function(e,t,i){var r=!1;if(t===G){var s=this.currentScope();r=s.lexical.indexOf(e)>-1||s.functions.indexOf(e)>-1||s.var.indexOf(e)>-1,s.lexical.push(e),this.inModule&&s.flags&le&&delete this.undefinedExports[e]}else if(t===xt){var n=this.currentScope();n.lexical.push(e)}else if(t===mt){var o=this.currentScope();this.treatFunctionsAsVar?r=o.lexical.indexOf(e)>-1:r=o.lexical.indexOf(e)>-1||o.var.indexOf(e)>-1,o.functions.push(e)}else for(var h=this.scopeStack.length-1;h>=0;--h){var u=this.scopeStack[h];if(u.lexical.indexOf(e)>-1&&!(u.flags&ft&&u.lexical[0]===e)||!this.treatFunctionsAsVarInScope(u)&&u.functions.indexOf(e)>-1){r=!0;break}if(u.var.push(e),this.inModule&&u.flags&le&&delete this.undefinedExports[e],u.flags&Ge)break}r&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")};$.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};$.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};$.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Ge)return t}};$.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Ge&&!(t.flags&pt))return t}};var pe=function(t,i,r){this.type="",this.start=i,this.end=0,t.options.locations&&(this.loc=new ke(t,r)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[i,0])},fe=_.prototype;fe.startNode=function(){return new pe(this,this.start,this.startLoc)};fe.startNodeAt=function(e,t){return new pe(this,e,t)};function yt(e,t,i,r){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=i),e}fe.finishNode=function(e,t){return yt.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};fe.finishNodeAt=function(e,t,i,r){return yt.call(this,e,t,i,r)};fe.copyNode=function(e){var t=new pe(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var vi="Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz",kt="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Ct=kt+" Extended_Pictographic",wt=Ct,St=wt+" EBase EComp EMod EPres ExtPict",_t=St,gi=_t,yi={9:kt,10:Ct,11:wt,12:St,13:_t,14:gi},ki="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",Ci={9:"",10:"",11:"",12:"",13:"",14:ki},st="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Et="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",It=Et+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Pt=It+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",At=Pt+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Nt=At+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",wi=Nt+" "+vi,Si={9:Et,10:It,11:Pt,12:At,13:Nt,14:wi},Vt={};function _i(e){var t=Vt[e]={binary:H(yi[e]+" "+st),binaryOfStrings:H(Ci[e]),nonBinary:{General_Category:H(st),Script:H(Si[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(xe=0,Oe=[9,10,11,12,13,14];xe<Oe.length;xe+=1)at=Oe[xe],_i(at);var at,xe,Oe,d=_.prototype,ye=function(t,i){this.parent=t,this.base=i||this};ye.prototype.separatedFrom=function(t){for(var i=this;i;i=i.parent)for(var r=t;r;r=r.parent)if(i.base===r.base&&i!==r)return!0;return!1};ye.prototype.sibling=function(){return new ye(this.parent,this.base)};var q=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"")+(t.options.ecmaVersion>=13?"d":"")+(t.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Vt[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};q.prototype.reset=function(t,i,r){var s=r.indexOf("v")!==-1,n=r.indexOf("u")!==-1;this.start=t|0,this.source=i+"",this.flags=r,s&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=n&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=n&&this.parser.options.ecmaVersion>=9)};q.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)};q.prototype.at=function(t,i){i===void 0&&(i=!1);var r=this.source,s=r.length;if(t>=s)return-1;var n=r.charCodeAt(t);if(!(i||this.switchU)||n<=55295||n>=57344||t+1>=s)return n;var o=r.charCodeAt(t+1);return o>=56320&&o<=57343?(n<<10)+o-56613888:n};q.prototype.nextIndex=function(t,i){i===void 0&&(i=!1);var r=this.source,s=r.length;if(t>=s)return s;var n=r.charCodeAt(t),o;return!(i||this.switchU)||n<=55295||n>=57344||t+1>=s||(o=r.charCodeAt(t+1))<56320||o>57343?t+1:t+2};q.prototype.current=function(t){return t===void 0&&(t=!1),this.at(this.pos,t)};q.prototype.lookahead=function(t){return t===void 0&&(t=!1),this.at(this.nextIndex(this.pos,t),t)};q.prototype.advance=function(t){t===void 0&&(t=!1),this.pos=this.nextIndex(this.pos,t)};q.prototype.eat=function(t,i){return i===void 0&&(i=!1),this.current(i)===t?(this.advance(i),!0):!1};q.prototype.eatChars=function(t,i){i===void 0&&(i=!1);for(var r=this.pos,s=0,n=t;s<n.length;s+=1){var o=n[s],h=this.at(r,i);if(h===-1||h!==o)return!1;r=this.nextIndex(r,i)}return this.pos=r,!0};d.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,r=!1,s=!1,n=0;n<i.length;n++){var o=i.charAt(n);t.indexOf(o)===-1&&this.raise(e.start,"Invalid regular expression flag"),i.indexOf(o,n+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),o==="u"&&(r=!0),o==="v"&&(s=!0)}this.options.ecmaVersion>=15&&r&&s&&this.raise(e.start,"Invalid regular expression flag")};function Ei(e){for(var t in e)return!0;return!1}d.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&Ei(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))};d.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,i=e.backReferenceNames;t<i.length;t+=1){var r=i[t];e.groupNames[r]||e.raise("Invalid named capture referenced")}};d.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new ye(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")};d.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););};d.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1};d.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var i=!1;if(this.options.ecmaVersion>=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,!0}return e.pos=t,!1};d.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1};d.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};d.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var r=0,s=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(s=e.lastIntValue),e.eat(125)))return s!==-1&&s<r&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=i}return!1};d.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)};d.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1};d.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var i=this.regexp_eatModifiers(e),r=e.eat(45);if(i||r){for(var s=0;s<i.length;s++){var n=i.charAt(s);i.indexOf(n,s+1)>-1&&e.raise("Duplicate regular expression modifiers")}if(r){var o=this.regexp_eatModifiers(e);!i&&!o&&e.current()===58&&e.raise("Invalid regular expression modifiers");for(var h=0;h<o.length;h++){var u=o.charAt(h);(o.indexOf(u,h+1)>-1||i.indexOf(u)>-1)&&e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=t}return!1};d.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};d.regexp_eatModifiers=function(e){for(var t="",i=0;(i=e.current())!==-1&&Ii(i);)t+=U(i),e.advance();return t};function Ii(e){return e===105||e===109||e===115}d.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};d.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};d.regexp_eatSyntaxCharacter=function(e){var t=e.current();return Tt(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Tt(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}d.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;(i=e.current())!==-1&&!Tt(i);)e.advance();return e.pos!==t};d.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1};d.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,i=e.groupNames[e.lastStringValue];if(i)if(t)for(var r=0,s=i;r<s.length;r+=1){var n=s[r];n.separatedFrom(e.branchID)||e.raise("Duplicate capture group name")}else e.raise("Duplicate capture group name");t?(i||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}};d.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1};d.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=U(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=U(e.lastIntValue);return!0}return!1};d.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),Pi(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function Pi(e){return j(e,!0)||e===36||e===95}d.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),Ai(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function Ai(e){return ee(e,!0)||e===36||e===95||e===8204||e===8205}d.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};d.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),!0;if(i<=e.numCapturingParens)return!0;e.pos=t}return!1};d.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};d.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};d.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1};d.regexp_eatZero=function(e){return e.current()===48&&!we(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};d.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1};d.regexp_eatControlLetter=function(e){var t=e.current();return Rt(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function Rt(e){return e>=65&&e<=90||e>=97&&e<=122}d.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var i=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(r&&s>=55296&&s<=56319){var n=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(s-55296)*1024+(o-56320)+65536,!0}e.pos=n,e.lastIntValue=s}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Ni(e.lastIntValue))return!0;r&&e.raise("Invalid unicode escape"),e.pos=i}return!1};function Ni(e){return e>=0&&e<=1114111}d.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1};d.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var Lt=0,W=1,F=2;d.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(Vi(t))return e.lastIntValue=-1,e.advance(),W;var i=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((i=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return i&&r===F&&e.raise("Invalid property name"),r;e.raise("Invalid property name")}return Lt};function Vi(e){return e===100||e===68||e===115||e===83||e===119||e===87}d.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,r),W}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var s=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,s)}return Lt};d.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){ie(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")};d.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return W;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return F;e.raise("Invalid property name")};d.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Ft(t=e.current());)e.lastStringValue+=U(t),e.advance();return e.lastStringValue!==""};function Ft(e){return Rt(e)||e===95}d.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Ti(t=e.current());)e.lastStringValue+=U(t),e.advance();return e.lastStringValue!==""};function Ti(e){return Ft(e)||we(e)}d.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};d.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),i=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&i===F&&e.raise("Negated character class may contain strings"),!0}return!1};d.regexp_classContents=function(e){return e.current()===93?W:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),W)};d.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;e.switchU&&(t===-1||i===-1)&&e.raise("Invalid character class"),t!==-1&&i!==-1&&t>i&&e.raise("Range out of order in character class")}}};d.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var i=e.current();(i===99||Mt(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var r=e.current();return r!==93?(e.lastIntValue=r,e.advance(),!0):!1};d.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};d.regexp_classSetExpression=function(e){var t=W,i;if(!this.regexp_eatClassSetRange(e))if(i=this.regexp_eatClassSetOperand(e)){i===F&&(t=F);for(var r=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(i=this.regexp_eatClassSetOperand(e))){i!==F&&(t=W);continue}e.raise("Invalid character in character class")}if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(r!==e.pos)return t}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(i=this.regexp_eatClassSetOperand(e),!i)return t;i===F&&(t=F)}};d.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var i=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return i!==-1&&r!==-1&&i>r&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1};d.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?W:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};d.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var i=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return i&&r===F&&e.raise("Negated character class may contain strings"),r;e.pos=t}if(e.eat(92)){var s=this.regexp_eatCharacterClassEscape(e);if(s)return s;e.pos=t}return null};d.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var i=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return i}else e.raise("Invalid escape");e.pos=t}return null};d.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===F&&(t=F);return t};d.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?W:F};d.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var i=e.current();return i<0||i===e.lookahead()&&Ri(i)||Li(i)?!1:(e.advance(),e.lastIntValue=i,!0)};function Ri(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function Li(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}d.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return Fi(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Fi(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}d.regexp_eatClassControlLetter=function(e){var t=e.current();return we(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1};d.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1};d.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;we(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t};function we(e){return e>=48&&e<=57}d.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Ot(i=e.current());)e.lastIntValue=16*e.lastIntValue+Dt(i),e.advance();return e.pos!==t};function Ot(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Dt(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}d.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+i*8+e.lastIntValue:e.lastIntValue=t*8+i}else e.lastIntValue=t;return!0}return!1};d.regexp_eatOctalDigit=function(e){var t=e.current();return Mt(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function Mt(e){return e>=48&&e<=55}d.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var s=e.current();if(!Ot(s))return e.pos=i,!1;e.lastIntValue=16*e.lastIntValue+Dt(s),e.advance()}return!0};var Ke=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new ke(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])},y=_.prototype;y.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new Ke(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};y.getToken=function(){return this.next(),new Ke(this)};typeof Symbol<"u"&&(y[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===a.eof,value:t}}}});y.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(a.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};y.readToken=function(e){return j(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};y.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888};y.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var r=void 0,s=t;(r=ut(this.input,s,this.pos))>-1;)++this.curLine,s=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,i),t,this.pos,e,this.curPosition())};y.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!te(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition())};y.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(e>8&&e<14||e>=5760&&ht.test(String.fromCharCode(e)))++this.pos;else break e}}};y.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=e,this.value=t,this.updateContext(i)};y.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(a.ellipsis)):(++this.pos,this.finishToken(a.dot))};y.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(a.assign,2):this.finishOp(a.slash,1)};y.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,r=e===42?a.star:a.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++i,r=a.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(a.assign,i+1):this.finishOp(r,i)};y.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(a.assign,3)}return this.finishOp(e===124?a.logicalOR:a.logicalAND,2)}return t===61?this.finishOp(a.assign,2):this.finishOp(e===124?a.bitwiseOR:a.bitwiseAND,1)};y.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(a.assign,2):this.finishOp(a.bitwiseXOR,1)};y.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||O.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(a.incDec,2):t===61?this.finishOp(a.assign,2):this.finishOp(a.plusMin,1)};y.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(a.assign,i+1):this.finishOp(a.bitShift,i)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(i=2),this.finishOp(a.relational,i))};y.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(a.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(a.arrow)):this.finishOp(e===61?a.eq:a.prefix,1)};y.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(a.questionDot,2)}if(t===63){if(e>=12){var r=this.input.charCodeAt(this.pos+2);if(r===61)return this.finishOp(a.assign,3)}return this.finishOp(a.coalesce,2)}}return this.finishOp(a.question,1)};y.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),j(t,!0)||t===92))return this.finishToken(a.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+U(t)+"'")};y.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(a.parenL);case 41:return++this.pos,this.finishToken(a.parenR);case 59:return++this.pos,this.finishToken(a.semi);case 44:return++this.pos,this.finishToken(a.comma);case 91:return++this.pos,this.finishToken(a.bracketL);case 93:return++this.pos,this.finishToken(a.bracketR);case 123:return++this.pos,this.finishToken(a.braceL);case 125:return++this.pos,this.finishToken(a.braceR);case 58:return++this.pos,this.finishToken(a.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(a.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(a.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+U(e)+"'")};y.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)};y.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(O.test(r)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if(r==="[")t=!0;else if(r==="]"&&t)t=!1;else if(r==="/"&&!t)break;e=r==="\\"}++this.pos}var s=this.input.slice(i,this.pos);++this.pos;var n=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(n);var h=this.regexpState||(this.regexpState=new q(this));h.reset(i,s,o),this.validateRegExpFlags(h),this.validateRegExpPattern(h);var u=null;try{u=new RegExp(s,o)}catch{}return this.finishToken(a.regexp,{pattern:s,flags:o,value:u})};y.readInt=function(e,t,i){for(var r=this.options.ecmaVersion>=12&&t===void 0,s=i&&this.input.charCodeAt(this.pos)===48,n=this.pos,o=0,h=0,u=0,l=t??1/0;u<l;++u,++this.pos){var p=this.input.charCodeAt(this.pos),v=void 0;if(r&&p===95){s&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),h===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),u===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),h=p;continue}if(p>=97?v=p-97+10:p>=65?v=p-65+10:p>=48&&p<=57?v=p-48:v=1/0,v>=e)break;h=p,o=o*e+v}return r&&h===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===n||t!=null&&this.pos-n!==t?null:o};function Oi(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function Bt(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}y.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return i==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=Bt(this.input.slice(t,this.pos)),++this.pos):j(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(a.num,i)};y.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,"Invalid number");var i=this.pos-t>=2&&this.input.charCodeAt(t)===48;i&&this.strict&&this.raise(t,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&r===110){var s=Bt(this.input.slice(t,this.pos));return++this.pos,j(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(a.num,s)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=!1),r===46&&!i&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!i&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,"Invalid number")),j(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var n=Oi(this.input.slice(t,this.pos),i);return this.finishToken(a.num,n)};y.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var i=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(i,"Code point out of bounds")}else t=this.readHexChar(4);return t};y.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(!1),i=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(te(r)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(a.string,t)};var qt={};y.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===qt)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};y.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw qt;this.raise(e,t)};y.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===a.template||this.type===a.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(a.dollarBraceL)):(++this.pos,this.finishToken(a.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(a.template,e));if(i===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(te(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
6
- `;break;default:e+=String.fromCharCode(i);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}};y.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(a.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":this.input[this.pos+1]===`
7
- `&&++this.pos;case`
8
- `:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};y.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
9
- `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return U(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var i=this.pos-1;this.invalidStringToken(i,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],s=parseInt(r,8);return s>255&&(r=r.slice(0,-1),s=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(s)}return te(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}};y.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return i===null&&this.invalidStringToken(t,"Bad character escape sequence"),i};y.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var s=this.fullCharCodeAtPos();if(ee(s,r))this.pos+=s<=65535?1:2;else if(s===92){this.containsEsc=!0,e+=this.input.slice(i,this.pos);var n=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var o=this.readCodePoint();(t?j:ee)(o,r)||this.invalidStringToken(n,"Invalid Unicode escape"),e+=U(o),i=this.pos}else break;t=!1}return e+this.input.slice(i,this.pos)};y.readWord=function(){var e=this.readWord1(),t=a.name;return this.keywords.test(e)&&(t=je[e]),this.finishToken(t,e)};var Di="8.14.0";_.acorn={Parser:_,version:Di,defaultOptions:Me,Position:he,SourceLocation:ke,getLineInfo:re,Node:pe,TokenType:C,tokTypes:a,keywordTypes:je,TokContext:N,tokContexts:S,isIdentifierChar:ee,isIdentifierStart:j,Token:Ke,isNewLine:te,lineBreak:O,lineBreakG:ni,nonASCIIwhitespace:ht};function jt(e,t,i,r,s){i||(i=c),function n(o,h,u){var l=u||o.type;i[l](o,h,n),t[l]&&t[l](o,h)}(e,r,s)}function K(e,t,i,r,s){var n=[];i||(i=c),function o(h,u,l){var p=l||h.type,v=h!==n[n.length-1];v&&n.push(h),i[p](h,u,o),t[p]&&t[p](h,u||n,n),v&&n.pop()}(e,r,s)}function Ut(e,t){var i=Object.create(t||c);for(var r in e)i[r]=e[r];return i}function Qe(e,t,i){i(e,t)}function Q(e,t,i){}var c={};c.Program=c.BlockStatement=c.StaticBlock=function(e,t,i){for(var r=0,s=e.body;r<s.length;r+=1){var n=s[r];i(n,t,"Statement")}};c.Statement=Qe;c.EmptyStatement=Q;c.ExpressionStatement=c.ParenthesizedExpression=c.ChainExpression=function(e,t,i){return i(e.expression,t,"Expression")};c.IfStatement=function(e,t,i){i(e.test,t,"Expression"),i(e.consequent,t,"Statement"),e.alternate&&i(e.alternate,t,"Statement")};c.LabeledStatement=function(e,t,i){return i(e.body,t,"Statement")};c.BreakStatement=c.ContinueStatement=Q;c.WithStatement=function(e,t,i){i(e.object,t,"Expression"),i(e.body,t,"Statement")};c.SwitchStatement=function(e,t,i){i(e.discriminant,t,"Expression");for(var r=0,s=e.cases;r<s.length;r+=1){var n=s[r];i(n,t)}};c.SwitchCase=function(e,t,i){e.test&&i(e.test,t,"Expression");for(var r=0,s=e.consequent;r<s.length;r+=1){var n=s[r];i(n,t,"Statement")}};c.ReturnStatement=c.YieldExpression=c.AwaitExpression=function(e,t,i){e.argument&&i(e.argument,t,"Expression")};c.ThrowStatement=c.SpreadElement=function(e,t,i){return i(e.argument,t,"Expression")};c.TryStatement=function(e,t,i){i(e.block,t,"Statement"),e.handler&&i(e.handler,t),e.finalizer&&i(e.finalizer,t,"Statement")};c.CatchClause=function(e,t,i){e.param&&i(e.param,t,"Pattern"),i(e.body,t,"Statement")};c.WhileStatement=c.DoWhileStatement=function(e,t,i){i(e.test,t,"Expression"),i(e.body,t,"Statement")};c.ForStatement=function(e,t,i){e.init&&i(e.init,t,"ForInit"),e.test&&i(e.test,t,"Expression"),e.update&&i(e.update,t,"Expression"),i(e.body,t,"Statement")};c.ForInStatement=c.ForOfStatement=function(e,t,i){i(e.left,t,"ForInit"),i(e.right,t,"Expression"),i(e.body,t,"Statement")};c.ForInit=function(e,t,i){e.type==="VariableDeclaration"?i(e,t):i(e,t,"Expression")};c.DebuggerStatement=Q;c.FunctionDeclaration=function(e,t,i){return i(e,t,"Function")};c.VariableDeclaration=function(e,t,i){for(var r=0,s=e.declarations;r<s.length;r+=1){var n=s[r];i(n,t)}};c.VariableDeclarator=function(e,t,i){i(e.id,t,"Pattern"),e.init&&i(e.init,t,"Expression")};c.Function=function(e,t,i){e.id&&i(e.id,t,"Pattern");for(var r=0,s=e.params;r<s.length;r+=1){var n=s[r];i(n,t,"Pattern")}i(e.body,t,e.expression?"Expression":"Statement")};c.Pattern=function(e,t,i){e.type==="Identifier"?i(e,t,"VariablePattern"):e.type==="MemberExpression"?i(e,t,"MemberPattern"):i(e,t)};c.VariablePattern=Q;c.MemberPattern=Qe;c.RestElement=function(e,t,i){return i(e.argument,t,"Pattern")};c.ArrayPattern=function(e,t,i){for(var r=0,s=e.elements;r<s.length;r+=1){var n=s[r];n&&i(n,t,"Pattern")}};c.ObjectPattern=function(e,t,i){for(var r=0,s=e.properties;r<s.length;r+=1){var n=s[r];n.type==="Property"?(n.computed&&i(n.key,t,"Expression"),i(n.value,t,"Pattern")):n.type==="RestElement"&&i(n.argument,t,"Pattern")}};c.Expression=Qe;c.ThisExpression=c.Super=c.MetaProperty=Q;c.ArrayExpression=function(e,t,i){for(var r=0,s=e.elements;r<s.length;r+=1){var n=s[r];n&&i(n,t,"Expression")}};c.ObjectExpression=function(e,t,i){for(var r=0,s=e.properties;r<s.length;r+=1){var n=s[r];i(n,t)}};c.FunctionExpression=c.ArrowFunctionExpression=c.FunctionDeclaration;c.SequenceExpression=function(e,t,i){for(var r=0,s=e.expressions;r<s.length;r+=1){var n=s[r];i(n,t,"Expression")}};c.TemplateLiteral=function(e,t,i){for(var r=0,s=e.quasis;r<s.length;r+=1){var n=s[r];i(n,t)}for(var o=0,h=e.expressions;o<h.length;o+=1){var u=h[o];i(u,t,"Expression")}};c.TemplateElement=Q;c.UnaryExpression=c.UpdateExpression=function(e,t,i){i(e.argument,t,"Expression")};c.BinaryExpression=c.LogicalExpression=function(e,t,i){i(e.left,t,"Expression"),i(e.right,t,"Expression")};c.AssignmentExpression=c.AssignmentPattern=function(e,t,i){i(e.left,t,"Pattern"),i(e.right,t,"Expression")};c.ConditionalExpression=function(e,t,i){i(e.test,t,"Expression"),i(e.consequent,t,"Expression"),i(e.alternate,t,"Expression")};c.NewExpression=c.CallExpression=function(e,t,i){if(i(e.callee,t,"Expression"),e.arguments)for(var r=0,s=e.arguments;r<s.length;r+=1){var n=s[r];i(n,t,"Expression")}};c.MemberExpression=function(e,t,i){i(e.object,t,"Expression"),e.computed&&i(e.property,t,"Expression")};c.ExportNamedDeclaration=c.ExportDefaultDeclaration=function(e,t,i){e.declaration&&i(e.declaration,t,e.type==="ExportNamedDeclaration"||e.declaration.id?"Statement":"Expression"),e.source&&i(e.source,t,"Expression")};c.ExportAllDeclaration=function(e,t,i){e.exported&&i(e.exported,t),i(e.source,t,"Expression")};c.ImportDeclaration=function(e,t,i){for(var r=0,s=e.specifiers;r<s.length;r+=1){var n=s[r];i(n,t)}i(e.source,t,"Expression")};c.ImportExpression=function(e,t,i){i(e.source,t,"Expression")};c.ImportSpecifier=c.ImportDefaultSpecifier=c.ImportNamespaceSpecifier=c.Identifier=c.PrivateIdentifier=c.Literal=Q;c.TaggedTemplateExpression=function(e,t,i){i(e.tag,t,"Expression"),i(e.quasi,t,"Expression")};c.ClassDeclaration=c.ClassExpression=function(e,t,i){return i(e,t,"Class")};c.Class=function(e,t,i){e.id&&i(e.id,t,"Pattern"),e.superClass&&i(e.superClass,t,"Expression"),i(e.body,t)};c.ClassBody=function(e,t,i){for(var r=0,s=e.body;r<s.length;r+=1){var n=s[r];i(n,t)}};c.MethodDefinition=c.PropertyDefinition=c.Property=function(e,t,i){e.computed&&i(e.key,t,"Expression"),e.value&&i(e.value,t,"Expression")};var Se=new Set(["Array","ArrayBuffer","atob","AudioContext","Blob","Boolean","BigInt","btoa","clearInterval","clearTimeout","console","crypto","CustomEvent","DataView","Date","decodeURI","decodeURIComponent","devicePixelRatio","document","encodeURI","encodeURIComponent","Error","escape","eval","fetch","File","FileList","FileReader","Float32Array","Float64Array","Function","Headers","Image","ImageData","Infinity","Int16Array","Int32Array","Int8Array","Intl","isFinite","isNaN","JSON","Map","Math","NaN","Number","navigator","Object","parseFloat","parseInt","performance","Path2D","Promise","Proxy","RangeError","ReferenceError","Reflect","RegExp","cancelAnimationFrame","requestAnimationFrame","Set","setInterval","setTimeout","String","Symbol","SyntaxError","TextDecoder","TextEncoder","this","TypeError","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray","undefined","unescape","URIError","URL","WeakMap","WeakSet","WebSocket","Worker","window"]);var z=Ut({Import(){},ViewExpression(e,t,i){i(e.id,t,"Identifier")},MutableExpression(e,t,i){i(e.id,t,"Identifier")}});function _e(e){return e.type==="FunctionExpression"||e.type==="FunctionDeclaration"||e.type==="ArrowFunctionExpression"||e.type==="Program"}function Mi(e){return e.type==="BlockStatement"||e.type==="ForInStatement"||e.type==="ForOfStatement"||e.type==="ForStatement"||_e(e)}function Bi(e){return e.type==="FunctionExpression"||e.type==="FunctionDeclaration"}function Ee(e,t){let i={type:"Program",body:[e.body]},r=new Map,s=new Set(t),n=[];function o(f,x){let g=r.get(f);return g?g.has(x):!1}function h(f,x){let g=r.get(f);g?g.add(x.name):r.set(f,new Set([x.name]))}function u(f){f.id&&h(f,f.id)}function l(f){f.params.forEach(x=>v(x,f)),f.id&&h(f,f.id)}function p(f){f.param&&v(f.param,f)}function v(f,x){switch(f.type){case"Identifier":h(x,f);break;case"ObjectPattern":f.properties.forEach(g=>v(g,x));break;case"ArrayPattern":f.elements.forEach(g=>g&&v(g,x));break;case"Property":v(f.value,x);break;case"RestElement":v(f.argument,x);break;case"AssignmentPattern":v(f.left,x);break;default:throw new Error("Unrecognized pattern type: "+f.type)}}function E(f){h(i,f.local)}K(i,{VariableDeclaration:(f,x)=>{let g=null;for(let w=x.length-1;w>=0&&g===null;--w)(f.kind==="var"?_e(x[w]):Mi(x[w]))&&(g=x[w]);f.declarations.forEach(w=>v(w.id,g))},FunctionDeclaration:(f,x)=>{let g=null;for(let w=x.length-2;w>=0&&g===null;--w)_e(x[w])&&(g=x[w]);h(g,f.id),l(f)},Function:l,ClassDeclaration:(f,x)=>{let g=null;for(let w=x.length-2;w>=0&&g===null;w--)_e(x[w])&&(g=x[w]);h(g,f.id)},Class:u,CatchClause:p,ImportDefaultSpecifier:E,ImportSpecifier:E,ImportNamespaceSpecifier:E},z);function V(f,x){let g=f.name;if(g!=="undefined"){for(let w=x.length-2;w>=0;--w){if(g==="arguments"&&Bi(x[w])||o(x[w],g))return;x[w].type==="ViewExpression"&&(f=x[w],g=`viewof ${f.id.name}`),x[w].type==="MutableExpression"&&(f=x[w],g=`mutable ${f.id.name}`)}if(!s.has(g)){if(g==="arguments")throw Object.assign(new SyntaxError("arguments is not allowed"),{node:f});n.push(f)}}}K(i,{VariablePattern:V,Identifier:V},z);function A(f,x){if(f)switch(f.type){case"Identifier":case"VariablePattern":{for(let g of x)if(o(g,f.name))return;if(x[x.length-2].type==="MutableExpression")return;throw Object.assign(new SyntaxError(`Assignment to constant variable ${f.name}`),{node:f})}case"ArrayPattern":{for(let g of f.elements)A(g,x);return}case"ObjectPattern":{for(let g of f.properties)A(g,x);return}case"Property":{A(f.value,x);return}case"RestElement":{A(f.argument,x);return}}}function Z(f,x){A(f.argument,x)}function M(f,x){A(f.left,x)}return K(i,{AssignmentExpression:M,AssignmentPattern:M,UpdateExpression:Z,ForOfStatement:M,ForInStatement:M},z),n}function Y(e,t){let i={type:"Program",body:[e.body]},r=new Map,{references:s}=e;return jt(i,{CallExpression:n=>{let{callee:o,arguments:h}=n;if(o.type!=="Identifier"||o.name!==t||s.indexOf(o)<0)return;if(h.length!==1||!(h[0].type==="Literal"&&/^['"]/.test(h[0].raw)||h[0].type==="TemplateLiteral"&&h[0].expressions.length===0))throw Object.assign(new SyntaxError(`${t} requires a single literal string argument`),{node:n});let[u]=h,l=u.type==="Literal"?u.value:u.quasis[0].value.cooked,p={start:u.start,end:u.end};r.has(l)?r.get(l).push(p):r.set(l,[p])}},z),r}var ne=2,zt=4,Ht=8;function Je(e,{tag:t,raw:i,globals:r,...s}={}){let n;if(t!=null&&e){n=Ie.parse(e,s);let o=Ye.parse(t,s);Wt(o,t,r),Gt(o,t),n.tag=o,n.raw=!!i}else n=J.parse(e,s);return Wt(n,e,r),Gt(n,e),n}var J=class e extends _{constructor(t,...i){super(Object.assign({ecmaVersion:13},t),...i)}enterScope(t){return t&ne&&++this.O_function,super.enterScope(t)}exitScope(){return this.currentScope().flags&ne&&--this.O_function,super.exitScope()}parseForIn(t,i){return this.O_function===1&&t.await&&(this.O_async=!0),super.parseForIn(t,i)}parseAwait(){return this.O_function===1&&(this.O_async=!0),super.parseAwait()}parseYield(t){return this.O_function===1&&(this.O_generator=!0),super.parseYield(t)}parseImport(t){return this.next(),t.specifiers=this.parseImportSpecifiers(),this.type===a._with&&(this.next(),t.injections=this.parseImportSpecifiers()),this.expectContextual("from"),t.source=this.type===a.string?this.parseExprAtom():this.unexpected(),this.finishNode(t,"ImportDeclaration")}parseImportSpecifiers(){let t=[],i=new Set,r=!0;for(this.expect(a.braceL);!this.eat(a.braceR);){if(r)r=!1;else if(this.expect(a.comma),this.afterTrailingComma(a.braceR))break;let s=this.startNode();s.view=this.eatContextual("viewof"),s.mutable=s.view?!1:this.eatContextual("mutable"),s.imported=this.parseIdent(),this.checkUnreserved(s.imported),this.checkLocal(s.imported),this.eatContextual("as")?(s.local=this.parseIdent(),this.checkUnreserved(s.local),this.checkLocal(s.local)):s.local=s.imported,this.checkLValSimple(s.local,"let"),i.has(s.local.name)&&this.raise(s.local.start,`Identifier '${s.local.name}' has already been declared`),i.add(s.local.name),t.push(this.finishNode(s,"ImportSpecifier"))}return t}parseExprAtom(t){return this.parseMaybeKeywordExpression("viewof","ViewExpression")||this.parseMaybeKeywordExpression("mutable","MutableExpression")||super.parseExprAtom(t)}startCell(){this.O_function=0,this.O_async=!1,this.O_generator=!1,this.strict=!0,this.enterScope(ne|zt|Ht)}finishCell(t,i,r){return r&&this.checkLocal(r),t.id=r,t.body=i,t.async=this.O_async,t.generator=this.O_generator,this.exitScope(),this.finishNode(t,"Cell")}parseCell(t,i){let r=new e({},this.input,this.start),s=r.getToken(),n=null,o=null;return this.startCell(),s.type===a._import&&r.getToken().type!==a.parenL?n=this.parseImport(this.startNode()):s.type!==a.eof&&s.type!==a.semi&&(s.type===a.name&&((s.value==="viewof"||s.value==="mutable")&&(s=r.getToken(),s.type!==a.name&&r.unexpected()),s=r.getToken(),s.type===a.eq&&(o=this.parseMaybeKeywordExpression("viewof","ViewExpression")||this.parseMaybeKeywordExpression("mutable","MutableExpression")||this.parseIdent(),s=r.getToken(),this.expect(a.eq))),s.type===a.braceL?n=this.parseBlock():(n=this.parseExpression(),o===null&&(n.type==="FunctionExpression"||n.type==="ClassExpression")&&(o=n.id))),this.semicolon(),i&&this.expect(a.eof),this.finishCell(t,n,o)}parseTopLevel(t){return this.parseCell(t,!0)}toAssignable(t,i,r){return t.type==="MutableExpression"?t:super.toAssignable(t,i,r)}checkLocal(t){let i=t.id||t;(Se.has(i.name)||i.name==="arguments")&&this.raise(i.start,`Identifier '${i.name}' is reserved`)}checkUnreserved(t){return(t.name==="viewof"||t.name==="mutable")&&this.raise(t.start,`Unexpected keyword '${t.name}'`),super.checkUnreserved(t)}checkLValSimple(t,i,r){return super.checkLValSimple(t.type==="MutableExpression"?t.id:t,i,r)}unexpected(t){this.raise(t??this.start,this.type===a.eof?"Unexpected end of input":"Unexpected token")}parseMaybeKeywordExpression(t,i){if(this.isContextual(t)){let r=this.startNode();return this.next(),r.id=this.parseIdent(),this.finishNode(r,i)}}},qi=new N("`",!0,!0,e=>ji.call(e)),Ie=class extends J{constructor(...t){super(...t),this.type=a.backQuote,this.exprAllowed=!1}initialContext(){return[qi]}parseCell(t){this.startCell(),this.type===a.eof&&(this.value="");let i=!0,r=this.startNode();r.expressions=[];let s=this.parseTemplateElement({isTagged:i});for(r.quasis=[s];this.type!==a.eof;)this.expect(a.dollarBraceL),r.expressions.push(this.parseExpression()),this.expect(a.braceR),r.quasis.push(s=this.parseTemplateElement({isTagged:i}));return s.tail=!0,this.next(),this.finishNode(r,"TemplateLiteral"),this.expect(a.eof),this.finishCell(t,r,null)}};function ji(){e:for(;this.pos<this.input.length;this.pos++)switch(this.input.charCodeAt(this.pos)){case 92:{this.pos<this.input.length-1&&++this.pos;break}case 36:{if(this.input.charCodeAt(this.pos+1)===123){if(this.pos===this.start&&this.type===a.invalidTemplate)return this.pos+=2,this.finishToken(a.dollarBraceL);break e}break}}return this.finishToken(a.invalidTemplate,this.input.slice(this.start,this.pos))}var Ye=class extends _{constructor(t,...i){super(Object.assign({ecmaVersion:12},t),...i)}enterScope(t){return t&ne&&++this.O_function,super.enterScope(t)}exitScope(){return this.currentScope().flags&ne&&--this.O_function,super.exitScope()}parseForIn(t,i){return this.O_function===1&&t.await&&(this.O_async=!0),super.parseForIn(t,i)}parseAwait(){return this.O_function===1&&(this.O_async=!0),super.parseAwait()}parseYield(t){return this.O_function===1&&(this.O_generator=!0),super.parseYield(t)}parseTopLevel(t){return this.O_function=0,this.O_async=!1,this.O_generator=!1,this.strict=!0,this.enterScope(ne|zt|Ht),t.body=this.parseExpression(),t.input=this.input,t.async=this.O_async,t.generator=this.O_generator,this.exitScope(),this.finishNode(t,"CellTag")}};function Wt(e,t,i=Se){if(!e.body)e.references=[];else if(e.body.type==="ImportDeclaration")e.references=e.body.injections?e.body.injections.map(r=>r.imported):[];else try{e.references=Ee(e,i)}catch(r){if(r.node){let s=re(t,r.node.start);r.message+=` (${s.line}:${s.column})`,r.pos=r.node.start,r.loc=s,delete r.node}throw r}return e}function Gt(e,t){if(e.body&&e.body.type!=="ImportDeclaration")try{e.fileAttachments=Y(e,"FileAttachment"),e.databaseClients=Y(e,"DatabaseClient"),e.secrets=Y(e,"Secret"),e.notificationClients=Y(e,"NotificationClient")}catch(i){if(i.node){let r=re(t,i.node.start);i.message+=` (${r.line}:${r.column})`,i.pos=i.node.start,i.loc=r,delete i.node}throw i}else e.fileAttachments=new Map,e.databaseClients=new Map,e.secrets=new Map,e.notificationClients=new Map;return e}var yr=Symbol("start"),kr=Symbol("modifier"),Cr=Symbol("function"),wr=Symbol("name");var Xe=class extends J{parseTopLevel(t){for(t.cells||(t.cells=[]);this.type!==a.eof;){let i=this.parseCell(this.startNode());i.input=this.input,t.cells.push(i)}return this.next(),this.finishNode(t,"Program")}};function Pe(e){return Xe.parse(e,{ecmaVersion:"latest"}).cells.map(t=>({type:"Cell",text:e.substring(t.start,t.end),start:t.start,end:t.end}))}function Ae(e){return Je(e)}var $t=z;var de={functionType:Object.getPrototypeOf(function(){}).constructor,asyncFunctionType:Object.getPrototypeOf(async function(){}).constructor,generatorFunctionType:Object.getPrototypeOf(function*(){}).constructor,asyncGeneratorFunctionType:Object.getPrototypeOf(async function*(){}).constructor};function Ui(e=!1,t=!1){return!e&&!t?de.functionType:e&&!t?de.asyncFunctionType:!e&&t?de.generatorFunctionType:de.asyncGeneratorFunctionType}function Ve(e,t=!1,i=!1,r=!1,s){if(s!==void 0)return e.patches.sort((n,o)=>o.start-n.start),e.patches.forEach(n=>{s=s.substring(0,n.start)+n.newText+s.substring(n.end)}),new(Ui(t,i))(...e.args,r?s.substring(1,s.length-1).trim():`return (
10
- ${s}
11
- );`)}function Wi(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}var Ze=e=>e[0]===".",oe=(e,t)=>Ze(e)?Wi(t,e):e;async function Kt(e){return new de.asyncFunctionType("url","return import(url)")(e)}function Qt(e){return e.split("`").join("\\`")}function Ne(e,t,i){let r,s;try{r=Ae(e)}catch(n){s=n}return{ojs:e,offset:t,inlineMD:i,cell:r,error:s}}function Gi(e){let t=[],i=/(```(?:\s|\S)[\s\S]*?```)/g,r=0,s=i.exec(e);for(;s!==null;){s.index>r&&t.push(Ne(e.substring(r,s.index),r,!0));let n=s[0];if(n.indexOf("``` ")===0||n.indexOf("```\n")===0||n.indexOf("```\r\n")===0){let h=n.substring(3,n.length-3);t.push(Ne(h,s.index+3,!1))}else t.push(Ne(n,s.index,!0));r=s.index+s[0].length,s=i.exec(e)}return e.length>r&&t.push(Ne(e.substring(r,e.length),r,!0)),t}function Te(e){let t=Pe(e);return{files:[],nodes:t.map((i,r)=>({id:r,mode:"js",value:i.text,start:i.start,end:i.end}))}}function et(e){let t=Gi(e);return{files:[],nodes:t.map((i,r)=>({id:r,mode:i.inlineMD?"md":"js",value:i.ojs,start:i.offset,end:i.offset+i.ojs.length}))}}function me(e,t="https://api.codetabs.com/v1/proxy/?quest=",i=""){let r=e.match(/^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n?]+)/img);if(!r||r.length===0)throw new Error(`Invalid URL: ${e}`);return fetch(e,{headers:{origin:r[0],referer:e}}).then(s=>{if(s.ok)return s;throw new Error("CORS?")}).catch(s=>(e=`${t}${e}${i}`,fetch(e,{headers:{origin:r[0],referer:e}})))}function zi(e,t,i){let r=e.indexOf("https://observablehq.com/d")===0;return me(e.replace(`https://observablehq.com/${r?"d/":""}`,"https://api.observablehq.com/document/"),t,i).then(s=>s.json())}function Hi(e,t){if(e.references===void 0)return{inputs:[],args:[],patches:[]};let i={};e.references.forEach(n=>i[t.substring(n.start,n.end)]=!0);let r={inputs:Object.keys(i),args:Object.keys(i).map(n=>n.split(" ").join("_")),patches:[]},s=(n,o)=>r.patches.push({start:n.start-(e.body?.start??0),end:n.end-(e.body?.start??0),newText:o});return e.body&&K(e.body,{Identifier(n){let o=t.substring(n.start,n.end);i[o]},MutableExpression(n){let h=t.substring(n.start,n.end).split(" ").join("_")+".value";s(n,h)},ViewExpression(n){let h=t.substring(n.start,n.end).split(" ").join("_");s(n,h)},ThisExpression(n,o){t.substring(n.start,n.end)==="this"&&!o.find(u=>u.type==="FunctionExpression")&&s(n,"((this === globalThis || this === globalThis.window)? undefined : this?.valueOf())")}},$t),r}function $i(e){return{type:"import",src:e.body.source.value,specifiers:e.body.specifiers?.map(t=>({view:t.view,name:t.imported.name,alias:t.local?.name&&t.imported.name!==t.local.name?t.local.name:t.imported.name}))??[],injections:e.body.injections?.map(t=>({name:t.imported.name,alias:t.local?.name??t.imported.name}))??[]}}function Ki(e,t,i,r){let s=t.id&&e.substring(t.id.start,t.id.end);return{type:"viewof",variable:{type:"variable",id:s,inputs:i.inputs,func:Ve(i,t.async,t.generator,t.body.type==="BlockStatement",r)},variableValue:{type:"variable",id:t?.id?.id?.name,inputs:["Generators",s],func:(n,o)=>n.input(o)}}}function Qi(e,t,i,r){let s=t.id&&e.substring(t.id.start,t.id.end),n=t?.id?.id?.name,o=`initial ${n}`;return{type:"mutable",initial:{type:"variable",id:o,inputs:i.inputs,func:Ve(i,t.async,t.generator,t.body.type==="BlockStatement",r)},variable:{type:"variable",id:s,inputs:["Mutable",o],func:(h,u)=>new h(u)},variableValue:{type:"variable",id:n,inputs:[s],func:h=>h.generator}}}function Yi(e,t,i,r){return{type:"variable",id:t.id&&e.substring(t.id?.start,t.id?.end),inputs:i.inputs,func:Ve(i,t.async,t.generator,t.body.type==="BlockStatement",r)}}function Yt(e,t){let i=Ae(e),r=i.body&&e.substring(i.body.start,i.body.end);switch(i.body?.type){case"ImportDeclaration":return $i(i);case"ImportExpression":switch(i.body.source.type){case"Literal":r=`import("${oe(""+i.body.source.value,t)}")`;break;default:console.error("Unexpected import value")}}let s=Hi(i,e);switch(i.id?.type){case"ViewExpression":return Ki(e,i,s,r);case"MutableExpression":return Qi(e,i,s,r);default:return Yi(e,i,s,r)}}var Re=class{_files=[];_imports=[];_functions=[];_defines=[];_defineUid=0;_functionUid=0;constructor(){}toString(){return`${this._imports.join(`
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('@import"https://fonts.googleapis.com/css2?family=Source+Serif+Pro:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap";:root{--syntax-normal: #1b1e23;--syntax-comment: #828282;--syntax-number: #20a5ba;--syntax-keyword: #c30771;--syntax-atom: #10a778;--syntax-string: #008ec4;--syntax-error: #ffbedc;--syntax-unknown-variable: #838383;--syntax-known-variable: #005f87;--syntax-matchbracket: #20bbfc;--syntax-key: #6636b4;--mono-fonts: 82%/1.5 Menlo, Consolas, monospace}.observablehq--expanded,.observablehq--collapsed,.observablehq--function,.observablehq--import,.observablehq--string:before,.observablehq--string:after,.observablehq--gray{color:var(--syntax-normal)}.observablehq--collapsed,.observablehq--expanded.observablehq--inspect a{cursor:pointer}.observablehq--field{text-indent:-1em;margin-left:1em}.observablehq--empty{color:var(--syntax_comment)}a[href],.observablehq--keyword,.observablehq--blue{color:#3182bd}.hljs-deletion,.hljs-variable,.observablehq--forbidden,.observablehq--pink{color:#e377c2}.observablehq--orange{color:#e6550d}.observablehq--null,.observablehq--undefined,.observablehq--boolean,.hljs-literal{color:var(--syntax-atom)}.hljs-number,.hljs-regexp,.hljs-bullet,.hljs-link,.observablehq--bigint,.observablehq--number,.observablehq--date,.observablehq--regexp,.observablehq--symbol,.observablehq--green{color:var(--syntax-number)}.observablehq--index,.observablehq--key{color:var(--syntax-key)}.observablehq--prototype-key{color:#aaa}.observablehq--empty{font-style:oblique}.hljs-string,.hljs-meta,.hljs-symbol,.hljs-template-tag,.hljs-template-variable,.hljs-addition,.observablehq--string,.observablehq--purple{color:var(--syntax-string)}.observablehq--error,.observablehq--red{color:#e7040f}.observablehq:empty:after,.observablehq>link:only-child,.observablehq>style:only-child,.observablehq--inspect{font:var(--monospace-font);overflow-x:auto;display:block;padding:4px 0;white-space:pre}.observablehq--error .observablehq--inspect{word-break:break-all;white-space:pre-wrap}:root{--syntax-diff: #24292e;--syntax-diff-bg: #ffffff;--hr: rgba(0, 0, 0, .05);--monospace: Menlo, Consolas, monospace;--monospace-font: 14px/1.5 var(--monospace);--serif: "Source Serif Pro", "Iowan Old Style", "Apple Garamond", "Palatino Linotype", "Times New Roman", "Droid Serif", Times, serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--sans-serif: -apple-system, BlinkMacSystemFont, "avenir next", avenir, helvetica, "helvetica neue", ubuntu, roboto, noto, "segoe ui", arial, sans-serif}html{font:17px/1.5 var(--serif);-webkit-text-size-adjust:100%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#1b1e23}body{margin:0 14px}body.fullscreen{margin:0}h1,h2,h3,h4,h5,h6{color:#333;font-weight:700;line-height:1.15;margin-top:0;margin-bottom:.25rem}h2~p,h3~p,h4~p,h2~table,h3~table,h4~table{margin-top:0}.observablehq:first-of-type h1+h2{font-size:20px;font-style:italic;font-weight:400;margin-bottom:1rem}a[href]{text-decoration:none}a[href]:hover{text-decoration:underline}h1 code,h2 code,h3 code,h4 code,h5 code,h6 code{font-size:90%}pre,code,tt{font-family:var(--monospace);font-size:14px;line-height:1.5}img{max-width:calc(100vw - 28px)}p,table,figure,figcaption,h1,h2,h3,h4,h5,h6,.katex-display{max-width:640px}blockquote,ol,ul{max-width:600px}blockquote{margin:1rem 1.5rem}ul,ol{padding-left:28px}hr{height:1px;margin:1rem 0;padding:1rem 0;border:none;background:no-repeat center/100% 1px linear-gradient(to right,var(--hr),var(--hr))}pre{padding:2px 0}.observablehq--md-pre{overflow-x:auto}input:not([type]),input[type=email],input[type=number],input[type=password],input[type=range],input[type=search],input[type=tel],input[type=text],input[type=url]{width:240px}input,canvas,button{vertical-align:middle}button,input,textarea{accent-color:#3b5fc0}table{width:100%;border-collapse:collapse;font:13px/1.2 var(--sans-serif)}table pre,table code,table tt{font-size:inherit;line-height:inherit}th>pre:only-child,td>pre:only-child{margin:0;padding:0}th{color:#111;text-align:left;vertical-align:bottom}td{color:#444;vertical-align:top}th,td{padding:3px 6.5px 3px 0}th:last-child,td:last-child{padding-right:0}tr:not(:last-child){border-bottom:solid 1px #eee}thead tr{border-bottom:solid 1px #ccc}figure,table{margin:1rem 0}figure img{max-width:100%}figcaption{font:small var(--sans-serif);color:var(--syntax-unknown-variable)}.observablehq--caret{margin-right:4px;vertical-align:baseline}.observablehq--field{text-indent:-1rem;margin-left:1rem}.observablehq--prototype-key,.observablehq--empty,.hljs-comment{color:var(--syntax-comment)}.hljs-built_in{color:var(--syntax-known-variable)}.observablehq--unknown{color:var(--syntax-unknown-variable)}.hljs-keyword,.hljs-selector-tag,.hljs-section,.hljs-doctag,.hljs-type,.hljs-tag,.hljs-name,.hljs-selector-id,.hljs-selector-class,.hljs-strong{color:var(--syntax-keyword)}.observablehq{position:relative;margin:17px 0;min-height:1.5rem}.observablehq:before{content:"";position:absolute;left:-14px;top:0;bottom:1px;width:4px;transition:background-color .25s linear}.observablehq--running:before,.observablehq--changed:before{background-color:#a9b0bc;transition:none}.observablehq--error:before{background-color:#e7040f}.observablehq:not(.observablehq--running):empty:after{content:"<detached>";color:var(--syntax-comment);font-style:oblique}.observablehq>link:only-child,.observablehq>style:only-child{visibility:hidden;white-space:nowrap;color:var(--syntax-keyword)}.observablehq>link:only-child:before{content:"<link>";visibility:visible;text-decoration:none;pointer-events:none}.observablehq>style:only-child:before{content:"<style>";visibility:visible}.observablehq--inspect.observablehq--import{white-space:normal}.observablehq--inspect::-webkit-scrollbar{display:none}.observablehq--string-expand{margin-left:6px;padding:2px 6px;border-radius:2px;font-size:80%;background:#eee;color:var(--syntax-normal);cursor:pointer;vertical-align:middle;position:sticky;right:0}.observablehq--string-expand:hover,.observablehq--string-expand:active{background:#ddd}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
+ var __defProp = Object.defineProperty;
3
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value;
4
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
5
+ var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239], astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191], nonASCIIidentifierChars = "‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・", nonASCIIidentifierStartChars = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟍꟐꟑꟓꟕ-Ƛꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ", reservedWords = {
6
+ 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
7
+ 5: "class enum extends super const export import",
8
+ 6: "enum",
9
+ strict: "implements interface let package private protected public static yield",
10
+ strictBind: "eval arguments"
11
+ }, ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this", keywords$1 = {
12
+ 5: ecma5AndLessKeywords,
13
+ "5module": ecma5AndLessKeywords + " export import",
14
+ 6: ecma5AndLessKeywords + " const class extends export import super"
15
+ }, keywordRelationalOperator = /^in(stanceof)?$/, nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"), nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
16
+ function isInAstralSet(code, set) {
17
+ for (var pos = 65536, i = 0; i < set.length; i += 2) {
18
+ if (pos += set[i], pos > code)
19
+ return !1;
20
+ if (pos += set[i + 1], pos >= code)
21
+ return !0;
22
+ }
23
+ return !1;
24
+ }
25
+ function isIdentifierStart(code, astral) {
26
+ return code < 65 ? code === 36 : code < 91 ? !0 : code < 97 ? code === 95 : code < 123 ? !0 : code <= 65535 ? code >= 170 && nonASCIIidentifierStart.test(String.fromCharCode(code)) : astral === !1 ? !1 : isInAstralSet(code, astralIdentifierStartCodes);
27
+ }
28
+ function isIdentifierChar(code, astral) {
29
+ return code < 48 ? code === 36 : code < 58 ? !0 : code < 65 ? !1 : code < 91 ? !0 : code < 97 ? code === 95 : code < 123 ? !0 : code <= 65535 ? code >= 170 && nonASCIIidentifier.test(String.fromCharCode(code)) : astral === !1 ? !1 : isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
30
+ }
31
+ var TokenType = function(label, conf) {
32
+ conf === void 0 && (conf = {}), this.label = label, this.keyword = conf.keyword, this.beforeExpr = !!conf.beforeExpr, this.startsExpr = !!conf.startsExpr, this.isLoop = !!conf.isLoop, this.isAssign = !!conf.isAssign, this.prefix = !!conf.prefix, this.postfix = !!conf.postfix, this.binop = conf.binop || null, this.updateContext = null;
33
+ };
34
+ function binop(name, prec) {
35
+ return new TokenType(name, { beforeExpr: !0, binop: prec });
36
+ }
37
+ var beforeExpr = { beforeExpr: !0 }, startsExpr = { startsExpr: !0 }, keywords = {};
38
+ function kw(name, options) {
39
+ return options === void 0 && (options = {}), options.keyword = name, keywords[name] = new TokenType(name, options);
40
+ }
41
+ var types$1 = {
42
+ num: new TokenType("num", startsExpr),
43
+ regexp: new TokenType("regexp", startsExpr),
44
+ string: new TokenType("string", startsExpr),
45
+ name: new TokenType("name", startsExpr),
46
+ privateId: new TokenType("privateId", startsExpr),
47
+ eof: new TokenType("eof"),
48
+ // Punctuation token types.
49
+ bracketL: new TokenType("[", { beforeExpr: !0, startsExpr: !0 }),
50
+ bracketR: new TokenType("]"),
51
+ braceL: new TokenType("{", { beforeExpr: !0, startsExpr: !0 }),
52
+ braceR: new TokenType("}"),
53
+ parenL: new TokenType("(", { beforeExpr: !0, startsExpr: !0 }),
54
+ parenR: new TokenType(")"),
55
+ comma: new TokenType(",", beforeExpr),
56
+ semi: new TokenType(";", beforeExpr),
57
+ colon: new TokenType(":", beforeExpr),
58
+ dot: new TokenType("."),
59
+ question: new TokenType("?", beforeExpr),
60
+ questionDot: new TokenType("?."),
61
+ arrow: new TokenType("=>", beforeExpr),
62
+ template: new TokenType("template"),
63
+ invalidTemplate: new TokenType("invalidTemplate"),
64
+ ellipsis: new TokenType("...", beforeExpr),
65
+ backQuote: new TokenType("`", startsExpr),
66
+ dollarBraceL: new TokenType("${", { beforeExpr: !0, startsExpr: !0 }),
67
+ // Operators. These carry several kinds of properties to help the
68
+ // parser use them properly (the presence of these properties is
69
+ // what categorizes them as operators).
70
+ //
71
+ // `binop`, when present, specifies that this operator is a binary
72
+ // operator, and will refer to its precedence.
73
+ //
74
+ // `prefix` and `postfix` mark the operator as a prefix or postfix
75
+ // unary operator.
76
+ //
77
+ // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as
78
+ // binary operators with a very low precedence, that should result
79
+ // in AssignmentExpression nodes.
80
+ eq: new TokenType("=", { beforeExpr: !0, isAssign: !0 }),
81
+ assign: new TokenType("_=", { beforeExpr: !0, isAssign: !0 }),
82
+ incDec: new TokenType("++/--", { prefix: !0, postfix: !0, startsExpr: !0 }),
83
+ prefix: new TokenType("!/~", { beforeExpr: !0, prefix: !0, startsExpr: !0 }),
84
+ logicalOR: binop("||", 1),
85
+ logicalAND: binop("&&", 2),
86
+ bitwiseOR: binop("|", 3),
87
+ bitwiseXOR: binop("^", 4),
88
+ bitwiseAND: binop("&", 5),
89
+ equality: binop("==/!=/===/!==", 6),
90
+ relational: binop("</>/<=/>=", 7),
91
+ bitShift: binop("<</>>/>>>", 8),
92
+ plusMin: new TokenType("+/-", { beforeExpr: !0, binop: 9, prefix: !0, startsExpr: !0 }),
93
+ modulo: binop("%", 10),
94
+ star: binop("*", 10),
95
+ slash: binop("/", 10),
96
+ starstar: new TokenType("**", { beforeExpr: !0 }),
97
+ coalesce: binop("??", 1),
98
+ // Keyword token types.
99
+ _break: kw("break"),
100
+ _case: kw("case", beforeExpr),
101
+ _catch: kw("catch"),
102
+ _continue: kw("continue"),
103
+ _debugger: kw("debugger"),
104
+ _default: kw("default", beforeExpr),
105
+ _do: kw("do", { isLoop: !0, beforeExpr: !0 }),
106
+ _else: kw("else", beforeExpr),
107
+ _finally: kw("finally"),
108
+ _for: kw("for", { isLoop: !0 }),
109
+ _function: kw("function", startsExpr),
110
+ _if: kw("if"),
111
+ _return: kw("return", beforeExpr),
112
+ _switch: kw("switch"),
113
+ _throw: kw("throw", beforeExpr),
114
+ _try: kw("try"),
115
+ _var: kw("var"),
116
+ _const: kw("const"),
117
+ _while: kw("while", { isLoop: !0 }),
118
+ _with: kw("with"),
119
+ _new: kw("new", { beforeExpr: !0, startsExpr: !0 }),
120
+ _this: kw("this", startsExpr),
121
+ _super: kw("super", startsExpr),
122
+ _class: kw("class", startsExpr),
123
+ _extends: kw("extends", beforeExpr),
124
+ _export: kw("export"),
125
+ _import: kw("import", startsExpr),
126
+ _null: kw("null", startsExpr),
127
+ _true: kw("true", startsExpr),
128
+ _false: kw("false", startsExpr),
129
+ _in: kw("in", { beforeExpr: !0, binop: 7 }),
130
+ _instanceof: kw("instanceof", { beforeExpr: !0, binop: 7 }),
131
+ _typeof: kw("typeof", { beforeExpr: !0, prefix: !0, startsExpr: !0 }),
132
+ _void: kw("void", { beforeExpr: !0, prefix: !0, startsExpr: !0 }),
133
+ _delete: kw("delete", { beforeExpr: !0, prefix: !0, startsExpr: !0 })
134
+ }, lineBreak = /\r\n?|\n|\u2028|\u2029/, lineBreakG = new RegExp(lineBreak.source, "g");
135
+ function isNewLine(code) {
136
+ return code === 10 || code === 13 || code === 8232 || code === 8233;
137
+ }
138
+ function nextLineBreak(code, from, end) {
139
+ end === void 0 && (end = code.length);
140
+ for (var i = from; i < end; i++) {
141
+ var next = code.charCodeAt(i);
142
+ if (isNewLine(next))
143
+ return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1;
144
+ }
145
+ return -1;
146
+ }
147
+ var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, ref = Object.prototype, hasOwnProperty = ref.hasOwnProperty, toString = ref.toString, hasOwn = Object.hasOwn || function(obj, propName) {
148
+ return hasOwnProperty.call(obj, propName);
149
+ }, isArray = Array.isArray || function(obj) {
150
+ return toString.call(obj) === "[object Array]";
151
+ }, regexpCache = /* @__PURE__ */ Object.create(null);
152
+ function wordsRegexp(words) {
153
+ return regexpCache[words] || (regexpCache[words] = new RegExp("^(?:" + words.replace(/ /g, "|") + ")$"));
154
+ }
155
+ function codePointToString(code) {
156
+ return code <= 65535 ? String.fromCharCode(code) : (code -= 65536, String.fromCharCode((code >> 10) + 55296, (code & 1023) + 56320));
157
+ }
158
+ var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/, Position = function(line, col) {
159
+ this.line = line, this.column = col;
160
+ };
161
+ Position.prototype.offset = function(n) {
162
+ return new Position(this.line, this.column + n);
163
+ };
164
+ var SourceLocation = function(p, start, end) {
165
+ this.start = start, this.end = end, p.sourceFile !== null && (this.source = p.sourceFile);
166
+ };
167
+ function getLineInfo(input, offset2) {
168
+ for (var line = 1, cur = 0; ; ) {
169
+ var nextBreak = nextLineBreak(input, cur, offset2);
170
+ if (nextBreak < 0)
171
+ return new Position(line, offset2 - cur);
172
+ ++line, cur = nextBreak;
173
+ }
174
+ }
175
+ var defaultOptions = {
176
+ // `ecmaVersion` indicates the ECMAScript version to parse. Must be
177
+ // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10
178
+ // (2019), 11 (2020), 12 (2021), 13 (2022), 14 (2023), or `"latest"`
179
+ // (the latest version the library supports). This influences
180
+ // support for strict mode, the set of reserved words, and support
181
+ // for new syntax features.
182
+ ecmaVersion: null,
183
+ // `sourceType` indicates the mode the code should be parsed in.
184
+ // Can be either `"script"` or `"module"`. This influences global
185
+ // strict mode and parsing of `import` and `export` declarations.
186
+ sourceType: "script",
187
+ // `onInsertedSemicolon` can be a callback that will be called when
188
+ // a semicolon is automatically inserted. It will be passed the
189
+ // position of the inserted semicolon as an offset, and if
190
+ // `locations` is enabled, it is given the location as a `{line,
191
+ // column}` object as second argument.
192
+ onInsertedSemicolon: null,
193
+ // `onTrailingComma` is similar to `onInsertedSemicolon`, but for
194
+ // trailing commas.
195
+ onTrailingComma: null,
196
+ // By default, reserved words are only enforced if ecmaVersion >= 5.
197
+ // Set `allowReserved` to a boolean value to explicitly turn this on
198
+ // an off. When this option has the value "never", reserved words
199
+ // and keywords can also not be used as property names.
200
+ allowReserved: null,
201
+ // When enabled, a return at the top level is not considered an
202
+ // error.
203
+ allowReturnOutsideFunction: !1,
204
+ // When enabled, import/export statements are not constrained to
205
+ // appearing at the top of the program, and an import.meta expression
206
+ // in a script isn't considered an error.
207
+ allowImportExportEverywhere: !1,
208
+ // By default, await identifiers are allowed to appear at the top-level scope only if ecmaVersion >= 2022.
209
+ // When enabled, await identifiers are allowed to appear at the top-level scope,
210
+ // but they are still not allowed in non-async functions.
211
+ allowAwaitOutsideFunction: null,
212
+ // When enabled, super identifiers are not constrained to
213
+ // appearing in methods and do not raise an error when they appear elsewhere.
214
+ allowSuperOutsideMethod: null,
215
+ // When enabled, hashbang directive in the beginning of file is
216
+ // allowed and treated as a line comment. Enabled by default when
217
+ // `ecmaVersion` >= 2023.
218
+ allowHashBang: !1,
219
+ // By default, the parser will verify that private properties are
220
+ // only used in places where they are valid and have been declared.
221
+ // Set this to false to turn such checks off.
222
+ checkPrivateFields: !0,
223
+ // When `locations` is on, `loc` properties holding objects with
224
+ // `start` and `end` properties in `{line, column}` form (with
225
+ // line being 1-based and column 0-based) will be attached to the
226
+ // nodes.
227
+ locations: !1,
228
+ // A function can be passed as `onToken` option, which will
229
+ // cause Acorn to call that function with object in the same
230
+ // format as tokens returned from `tokenizer().getToken()`. Note
231
+ // that you are not allowed to call the parser from the
232
+ // callback—that will corrupt its internal state.
233
+ onToken: null,
234
+ // A function can be passed as `onComment` option, which will
235
+ // cause Acorn to call that function with `(block, text, start,
236
+ // end)` parameters whenever a comment is skipped. `block` is a
237
+ // boolean indicating whether this is a block (`/* */`) comment,
238
+ // `text` is the content of the comment, and `start` and `end` are
239
+ // character offsets that denote the start and end of the comment.
240
+ // When the `locations` option is on, two more parameters are
241
+ // passed, the full `{line, column}` locations of the start and
242
+ // end of the comments. Note that you are not allowed to call the
243
+ // parser from the callback—that will corrupt its internal state.
244
+ // When this option has an array as value, objects representing the
245
+ // comments are pushed to it.
246
+ onComment: null,
247
+ // Nodes have their start and end characters offsets recorded in
248
+ // `start` and `end` properties (directly on the node, rather than
249
+ // the `loc` object, which holds line/column data. To also add a
250
+ // [semi-standardized][range] `range` property holding a `[start,
251
+ // end]` array with the same numbers, set the `ranges` option to
252
+ // `true`.
253
+ //
254
+ // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678
255
+ ranges: !1,
256
+ // It is possible to parse multiple files into a single AST by
257
+ // passing the tree produced by parsing the first file as
258
+ // `program` option in subsequent parses. This will add the
259
+ // toplevel forms of the parsed file to the `Program` (top) node
260
+ // of an existing parse tree.
261
+ program: null,
262
+ // When `locations` is on, you can pass this to record the source
263
+ // file in every node's `loc` object.
264
+ sourceFile: null,
265
+ // This value, if given, is stored in every node, whether
266
+ // `locations` is on or off.
267
+ directSourceFile: null,
268
+ // When enabled, parenthesized expressions are represented by
269
+ // (non-standard) ParenthesizedExpression nodes
270
+ preserveParens: !1
271
+ }, warnedAboutEcmaVersion = !1;
272
+ function getOptions(opts) {
273
+ var options = {};
274
+ for (var opt in defaultOptions)
275
+ options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt];
276
+ if (options.ecmaVersion === "latest" ? options.ecmaVersion = 1e8 : options.ecmaVersion == null ? (!warnedAboutEcmaVersion && typeof console == "object" && console.warn && (warnedAboutEcmaVersion = !0, console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
277
+ Defaulting to 2020, but this will stop working in the future.`)), options.ecmaVersion = 11) : options.ecmaVersion >= 2015 && (options.ecmaVersion -= 2009), options.allowReserved == null && (options.allowReserved = options.ecmaVersion < 5), (!opts || opts.allowHashBang == null) && (options.allowHashBang = options.ecmaVersion >= 14), isArray(options.onToken)) {
278
+ var tokens = options.onToken;
279
+ options.onToken = function(token) {
280
+ return tokens.push(token);
281
+ };
282
+ }
283
+ return isArray(options.onComment) && (options.onComment = pushComment(options, options.onComment)), options;
284
+ }
285
+ function pushComment(options, array) {
286
+ return function(block, text, start, end, startLoc, endLoc) {
287
+ var comment = {
288
+ type: block ? "Block" : "Line",
289
+ value: text,
290
+ start,
291
+ end
292
+ };
293
+ options.locations && (comment.loc = new SourceLocation(this, startLoc, endLoc)), options.ranges && (comment.range = [start, end]), array.push(comment);
294
+ };
295
+ }
296
+ var SCOPE_TOP = 1, SCOPE_FUNCTION$1 = 2, SCOPE_ASYNC$1 = 4, SCOPE_GENERATOR$1 = 8, SCOPE_ARROW = 16, SCOPE_SIMPLE_CATCH = 32, SCOPE_SUPER = 64, SCOPE_DIRECT_SUPER = 128, SCOPE_CLASS_STATIC_BLOCK = 256, SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION$1 | SCOPE_CLASS_STATIC_BLOCK;
297
+ function functionFlags(async, generator) {
298
+ return SCOPE_FUNCTION$1 | (async ? SCOPE_ASYNC$1 : 0) | (generator ? SCOPE_GENERATOR$1 : 0);
299
+ }
300
+ var BIND_NONE = 0, BIND_VAR = 1, BIND_LEXICAL = 2, BIND_FUNCTION = 3, BIND_SIMPLE_CATCH = 4, BIND_OUTSIDE = 5, Parser = function(options, input, startPos) {
301
+ this.options = options = getOptions(options), this.sourceFile = options.sourceFile, this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]);
302
+ var reserved = "";
303
+ options.allowReserved !== !0 && (reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3], options.sourceType === "module" && (reserved += " await")), this.reservedWords = wordsRegexp(reserved);
304
+ var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict;
305
+ this.reservedWordsStrict = wordsRegexp(reservedStrict), this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind), this.input = String(input), this.containsEsc = !1, startPos ? (this.pos = startPos, this.lineStart = this.input.lastIndexOf(`
306
+ `, startPos - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type = types$1.eof, this.value = null, this.start = this.end = this.pos, this.startLoc = this.endLoc = this.curPosition(), this.lastTokEndLoc = this.lastTokStartLoc = null, this.lastTokStart = this.lastTokEnd = this.pos, this.context = this.initialContext(), this.exprAllowed = !0, this.inModule = options.sourceType === "module", this.strict = this.inModule || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = !1, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = /* @__PURE__ */ Object.create(null), this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!" && this.skipLineComment(2), this.scopeStack = [], this.enterScope(SCOPE_TOP), this.regexpState = null, this.privateNameStack = [];
307
+ }, prototypeAccessors = { inFunction: { configurable: !0 }, inGenerator: { configurable: !0 }, inAsync: { configurable: !0 }, canAwait: { configurable: !0 }, allowSuper: { configurable: !0 }, allowDirectSuper: { configurable: !0 }, treatFunctionsAsVar: { configurable: !0 }, allowNewDotTarget: { configurable: !0 }, inClassStaticBlock: { configurable: !0 } };
308
+ Parser.prototype.parse = function() {
309
+ var node = this.options.program || this.startNode();
310
+ return this.nextToken(), this.parseTopLevel(node);
311
+ };
312
+ prototypeAccessors.inFunction.get = function() {
313
+ return (this.currentVarScope().flags & SCOPE_FUNCTION$1) > 0;
314
+ };
315
+ prototypeAccessors.inGenerator.get = function() {
316
+ return (this.currentVarScope().flags & SCOPE_GENERATOR$1) > 0 && !this.currentVarScope().inClassFieldInit;
317
+ };
318
+ prototypeAccessors.inAsync.get = function() {
319
+ return (this.currentVarScope().flags & SCOPE_ASYNC$1) > 0 && !this.currentVarScope().inClassFieldInit;
320
+ };
321
+ prototypeAccessors.canAwait.get = function() {
322
+ for (var i = this.scopeStack.length - 1; i >= 0; i--) {
323
+ var scope = this.scopeStack[i];
324
+ if (scope.inClassFieldInit || scope.flags & SCOPE_CLASS_STATIC_BLOCK)
325
+ return !1;
326
+ if (scope.flags & SCOPE_FUNCTION$1)
327
+ return (scope.flags & SCOPE_ASYNC$1) > 0;
328
+ }
329
+ return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction;
330
+ };
331
+ prototypeAccessors.allowSuper.get = function() {
332
+ var ref2 = this.currentThisScope(), flags = ref2.flags, inClassFieldInit = ref2.inClassFieldInit;
333
+ return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod;
334
+ };
335
+ prototypeAccessors.allowDirectSuper.get = function() {
336
+ return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0;
337
+ };
338
+ prototypeAccessors.treatFunctionsAsVar.get = function() {
339
+ return this.treatFunctionsAsVarInScope(this.currentScope());
340
+ };
341
+ prototypeAccessors.allowNewDotTarget.get = function() {
342
+ var ref2 = this.currentThisScope(), flags = ref2.flags, inClassFieldInit = ref2.inClassFieldInit;
343
+ return (flags & (SCOPE_FUNCTION$1 | SCOPE_CLASS_STATIC_BLOCK)) > 0 || inClassFieldInit;
344
+ };
345
+ prototypeAccessors.inClassStaticBlock.get = function() {
346
+ return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0;
347
+ };
348
+ Parser.extend = function() {
349
+ for (var plugins = [], len = arguments.length; len--; ) plugins[len] = arguments[len];
350
+ for (var cls = this, i = 0; i < plugins.length; i++)
351
+ cls = plugins[i](cls);
352
+ return cls;
353
+ };
354
+ Parser.parse = function(input, options) {
355
+ return new this(options, input).parse();
356
+ };
357
+ Parser.parseExpressionAt = function(input, pos, options) {
358
+ var parser = new this(options, input, pos);
359
+ return parser.nextToken(), parser.parseExpression();
360
+ };
361
+ Parser.tokenizer = function(input, options) {
362
+ return new this(options, input);
363
+ };
364
+ Object.defineProperties(Parser.prototype, prototypeAccessors);
365
+ var pp$9 = Parser.prototype, literal = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
366
+ pp$9.strictDirective = function(start) {
367
+ if (this.options.ecmaVersion < 5)
368
+ return !1;
369
+ for (; ; ) {
370
+ skipWhiteSpace.lastIndex = start, start += skipWhiteSpace.exec(this.input)[0].length;
371
+ var match = literal.exec(this.input.slice(start));
372
+ if (!match)
373
+ return !1;
374
+ if ((match[1] || match[2]) === "use strict") {
375
+ skipWhiteSpace.lastIndex = start + match[0].length;
376
+ var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length, next = this.input.charAt(end);
377
+ return next === ";" || next === "}" || lineBreak.test(spaceAfter[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "=");
378
+ }
379
+ start += match[0].length, skipWhiteSpace.lastIndex = start, start += skipWhiteSpace.exec(this.input)[0].length, this.input[start] === ";" && start++;
380
+ }
381
+ };
382
+ pp$9.eat = function(type) {
383
+ return this.type === type ? (this.next(), !0) : !1;
384
+ };
385
+ pp$9.isContextual = function(name) {
386
+ return this.type === types$1.name && this.value === name && !this.containsEsc;
387
+ };
388
+ pp$9.eatContextual = function(name) {
389
+ return this.isContextual(name) ? (this.next(), !0) : !1;
390
+ };
391
+ pp$9.expectContextual = function(name) {
392
+ this.eatContextual(name) || this.unexpected();
393
+ };
394
+ pp$9.canInsertSemicolon = function() {
395
+ return this.type === types$1.eof || this.type === types$1.braceR || lineBreak.test(this.input.slice(this.lastTokEnd, this.start));
396
+ };
397
+ pp$9.insertSemicolon = function() {
398
+ if (this.canInsertSemicolon())
399
+ return this.options.onInsertedSemicolon && this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc), !0;
400
+ };
401
+ pp$9.semicolon = function() {
402
+ !this.eat(types$1.semi) && !this.insertSemicolon() && this.unexpected();
403
+ };
404
+ pp$9.afterTrailingComma = function(tokType, notNext) {
405
+ if (this.type === tokType)
406
+ return this.options.onTrailingComma && this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc), notNext || this.next(), !0;
407
+ };
408
+ pp$9.expect = function(type) {
409
+ this.eat(type) || this.unexpected();
410
+ };
411
+ pp$9.unexpected = function(pos) {
412
+ this.raise(pos ?? this.start, "Unexpected token");
413
+ };
414
+ var DestructuringErrors = function() {
415
+ this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1;
416
+ };
417
+ pp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) {
418
+ if (refDestructuringErrors) {
419
+ refDestructuringErrors.trailingComma > -1 && this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element");
420
+ var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind;
421
+ parens > -1 && this.raiseRecoverable(parens, isAssign ? "Assigning to rvalue" : "Parenthesized pattern");
422
+ }
423
+ };
424
+ pp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) {
425
+ if (!refDestructuringErrors)
426
+ return !1;
427
+ var shorthandAssign = refDestructuringErrors.shorthandAssign, doubleProto = refDestructuringErrors.doubleProto;
428
+ if (!andThrow)
429
+ return shorthandAssign >= 0 || doubleProto >= 0;
430
+ shorthandAssign >= 0 && this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"), doubleProto >= 0 && this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property");
431
+ };
432
+ pp$9.checkYieldAwaitInDefaultParams = function() {
433
+ this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos) && this.raise(this.yieldPos, "Yield expression cannot be a default value"), this.awaitPos && this.raise(this.awaitPos, "Await expression cannot be a default value");
434
+ };
435
+ pp$9.isSimpleAssignTarget = function(expr) {
436
+ return expr.type === "ParenthesizedExpression" ? this.isSimpleAssignTarget(expr.expression) : expr.type === "Identifier" || expr.type === "MemberExpression";
437
+ };
438
+ var pp$8 = Parser.prototype;
439
+ pp$8.parseTopLevel = function(node) {
440
+ var exports = /* @__PURE__ */ Object.create(null);
441
+ for (node.body || (node.body = []); this.type !== types$1.eof; ) {
442
+ var stmt = this.parseStatement(null, !0, exports);
443
+ node.body.push(stmt);
444
+ }
445
+ if (this.inModule)
446
+ for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1) {
447
+ var name = list[i];
448
+ this.raiseRecoverable(this.undefinedExports[name].start, "Export '" + name + "' is not defined");
449
+ }
450
+ return this.adaptDirectivePrologue(node.body), this.next(), node.sourceType = this.options.sourceType, this.finishNode(node, "Program");
451
+ };
452
+ var loopLabel = { kind: "loop" }, switchLabel = { kind: "switch" };
453
+ pp$8.isLet = function(context) {
454
+ if (this.options.ecmaVersion < 6 || !this.isContextual("let"))
455
+ return !1;
456
+ skipWhiteSpace.lastIndex = this.pos;
457
+ var skip = skipWhiteSpace.exec(this.input), next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
458
+ if (nextCh === 91 || nextCh === 92)
459
+ return !0;
460
+ if (context)
461
+ return !1;
462
+ if (nextCh === 123 || nextCh > 55295 && nextCh < 56320)
463
+ return !0;
464
+ if (isIdentifierStart(nextCh, !0)) {
465
+ for (var pos = next + 1; isIdentifierChar(nextCh = this.input.charCodeAt(pos), !0); )
466
+ ++pos;
467
+ if (nextCh === 92 || nextCh > 55295 && nextCh < 56320)
468
+ return !0;
469
+ var ident = this.input.slice(next, pos);
470
+ if (!keywordRelationalOperator.test(ident))
471
+ return !0;
472
+ }
473
+ return !1;
474
+ };
475
+ pp$8.isAsyncFunction = function() {
476
+ if (this.options.ecmaVersion < 8 || !this.isContextual("async"))
477
+ return !1;
478
+ skipWhiteSpace.lastIndex = this.pos;
479
+ var skip = skipWhiteSpace.exec(this.input), next = this.pos + skip[0].length, after;
480
+ return !lineBreak.test(this.input.slice(this.pos, next)) && this.input.slice(next, next + 8) === "function" && (next + 8 === this.input.length || !(isIdentifierChar(after = this.input.charCodeAt(next + 8)) || after > 55295 && after < 56320));
481
+ };
482
+ pp$8.parseStatement = function(context, topLevel, exports) {
483
+ var starttype = this.type, node = this.startNode(), kind;
484
+ switch (this.isLet(context) && (starttype = types$1._var, kind = "let"), starttype) {
485
+ case types$1._break:
486
+ case types$1._continue:
487
+ return this.parseBreakContinueStatement(node, starttype.keyword);
488
+ case types$1._debugger:
489
+ return this.parseDebuggerStatement(node);
490
+ case types$1._do:
491
+ return this.parseDoStatement(node);
492
+ case types$1._for:
493
+ return this.parseForStatement(node);
494
+ case types$1._function:
495
+ return context && (this.strict || context !== "if" && context !== "label") && this.options.ecmaVersion >= 6 && this.unexpected(), this.parseFunctionStatement(node, !1, !context);
496
+ case types$1._class:
497
+ return context && this.unexpected(), this.parseClass(node, !0);
498
+ case types$1._if:
499
+ return this.parseIfStatement(node);
500
+ case types$1._return:
501
+ return this.parseReturnStatement(node);
502
+ case types$1._switch:
503
+ return this.parseSwitchStatement(node);
504
+ case types$1._throw:
505
+ return this.parseThrowStatement(node);
506
+ case types$1._try:
507
+ return this.parseTryStatement(node);
508
+ case types$1._const:
509
+ case types$1._var:
510
+ return kind = kind || this.value, context && kind !== "var" && this.unexpected(), this.parseVarStatement(node, kind);
511
+ case types$1._while:
512
+ return this.parseWhileStatement(node);
513
+ case types$1._with:
514
+ return this.parseWithStatement(node);
515
+ case types$1.braceL:
516
+ return this.parseBlock(!0, node);
517
+ case types$1.semi:
518
+ return this.parseEmptyStatement(node);
519
+ case types$1._export:
520
+ case types$1._import:
521
+ if (this.options.ecmaVersion > 10 && starttype === types$1._import) {
522
+ skipWhiteSpace.lastIndex = this.pos;
523
+ var skip = skipWhiteSpace.exec(this.input), next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
524
+ if (nextCh === 40 || nextCh === 46)
525
+ return this.parseExpressionStatement(node, this.parseExpression());
526
+ }
527
+ return this.options.allowImportExportEverywhere || (topLevel || this.raise(this.start, "'import' and 'export' may only appear at the top level"), this.inModule || this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'")), starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports);
528
+ // If the statement does not start with a statement keyword or a
529
+ // brace, it's an ExpressionStatement or LabeledStatement. We
530
+ // simply start parsing an expression, and afterwards, if the
531
+ // next token is a colon and the expression was a simple
532
+ // Identifier node, we switch to interpreting it as a label.
533
+ default:
534
+ if (this.isAsyncFunction())
535
+ return context && this.unexpected(), this.next(), this.parseFunctionStatement(node, !0, !context);
536
+ var maybeName = this.value, expr = this.parseExpression();
537
+ return starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon) ? this.parseLabeledStatement(node, maybeName, expr, context) : this.parseExpressionStatement(node, expr);
538
+ }
539
+ };
540
+ pp$8.parseBreakContinueStatement = function(node, keyword) {
541
+ var isBreak = keyword === "break";
542
+ this.next(), this.eat(types$1.semi) || this.insertSemicolon() ? node.label = null : this.type !== types$1.name ? this.unexpected() : (node.label = this.parseIdent(), this.semicolon());
543
+ for (var i = 0; i < this.labels.length; ++i) {
544
+ var lab = this.labels[i];
545
+ if ((node.label == null || lab.name === node.label.name) && (lab.kind != null && (isBreak || lab.kind === "loop") || node.label && isBreak))
546
+ break;
547
+ }
548
+ return i === this.labels.length && this.raise(node.start, "Unsyntactic " + keyword), this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement");
549
+ };
550
+ pp$8.parseDebuggerStatement = function(node) {
551
+ return this.next(), this.semicolon(), this.finishNode(node, "DebuggerStatement");
552
+ };
553
+ pp$8.parseDoStatement = function(node) {
554
+ return this.next(), this.labels.push(loopLabel), node.body = this.parseStatement("do"), this.labels.pop(), this.expect(types$1._while), node.test = this.parseParenExpression(), this.options.ecmaVersion >= 6 ? this.eat(types$1.semi) : this.semicolon(), this.finishNode(node, "DoWhileStatement");
555
+ };
556
+ pp$8.parseForStatement = function(node) {
557
+ this.next();
558
+ var awaitAt = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1;
559
+ if (this.labels.push(loopLabel), this.enterScope(0), this.expect(types$1.parenL), this.type === types$1.semi)
560
+ return awaitAt > -1 && this.unexpected(awaitAt), this.parseFor(node, null);
561
+ var isLet = this.isLet();
562
+ if (this.type === types$1._var || this.type === types$1._const || isLet) {
563
+ var init$1 = this.startNode(), kind = isLet ? "let" : this.value;
564
+ return this.next(), this.parseVar(init$1, !0, kind), this.finishNode(init$1, "VariableDeclaration"), (this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && init$1.declarations.length === 1 ? (this.options.ecmaVersion >= 9 && (this.type === types$1._in ? awaitAt > -1 && this.unexpected(awaitAt) : node.await = awaitAt > -1), this.parseForIn(node, init$1)) : (awaitAt > -1 && this.unexpected(awaitAt), this.parseFor(node, init$1));
565
+ }
566
+ var startsWithLet = this.isContextual("let"), isForOf = !1, containsEsc = this.containsEsc, refDestructuringErrors = new DestructuringErrors(), initPos = this.start, init = awaitAt > -1 ? this.parseExprSubscripts(refDestructuringErrors, "await") : this.parseExpression(!0, refDestructuringErrors);
567
+ return this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (awaitAt > -1 ? (this.type === types$1._in && this.unexpected(awaitAt), node.await = !0) : isForOf && this.options.ecmaVersion >= 8 && (init.start === initPos && !containsEsc && init.type === "Identifier" && init.name === "async" ? this.unexpected() : this.options.ecmaVersion >= 9 && (node.await = !1)), startsWithLet && isForOf && this.raise(init.start, "The left-hand side of a for-of loop may not start with 'let'."), this.toAssignable(init, !1, refDestructuringErrors), this.checkLValPattern(init), this.parseForIn(node, init)) : (this.checkExpressionErrors(refDestructuringErrors, !0), awaitAt > -1 && this.unexpected(awaitAt), this.parseFor(node, init));
568
+ };
569
+ pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) {
570
+ return this.next(), this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), !1, isAsync);
571
+ };
572
+ pp$8.parseIfStatement = function(node) {
573
+ return this.next(), node.test = this.parseParenExpression(), node.consequent = this.parseStatement("if"), node.alternate = this.eat(types$1._else) ? this.parseStatement("if") : null, this.finishNode(node, "IfStatement");
574
+ };
575
+ pp$8.parseReturnStatement = function(node) {
576
+ return !this.inFunction && !this.options.allowReturnOutsideFunction && this.raise(this.start, "'return' outside of function"), this.next(), this.eat(types$1.semi) || this.insertSemicolon() ? node.argument = null : (node.argument = this.parseExpression(), this.semicolon()), this.finishNode(node, "ReturnStatement");
577
+ };
578
+ pp$8.parseSwitchStatement = function(node) {
579
+ this.next(), node.discriminant = this.parseParenExpression(), node.cases = [], this.expect(types$1.braceL), this.labels.push(switchLabel), this.enterScope(0);
580
+ for (var cur, sawDefault = !1; this.type !== types$1.braceR; )
581
+ if (this.type === types$1._case || this.type === types$1._default) {
582
+ var isCase = this.type === types$1._case;
583
+ cur && this.finishNode(cur, "SwitchCase"), node.cases.push(cur = this.startNode()), cur.consequent = [], this.next(), isCase ? cur.test = this.parseExpression() : (sawDefault && this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"), sawDefault = !0, cur.test = null), this.expect(types$1.colon);
584
+ } else
585
+ cur || this.unexpected(), cur.consequent.push(this.parseStatement(null));
586
+ return this.exitScope(), cur && this.finishNode(cur, "SwitchCase"), this.next(), this.labels.pop(), this.finishNode(node, "SwitchStatement");
587
+ };
588
+ pp$8.parseThrowStatement = function(node) {
589
+ return this.next(), lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) && this.raise(this.lastTokEnd, "Illegal newline after throw"), node.argument = this.parseExpression(), this.semicolon(), this.finishNode(node, "ThrowStatement");
590
+ };
591
+ var empty$1 = [];
592
+ pp$8.parseCatchClauseParam = function() {
593
+ var param = this.parseBindingAtom(), simple2 = param.type === "Identifier";
594
+ return this.enterScope(simple2 ? SCOPE_SIMPLE_CATCH : 0), this.checkLValPattern(param, simple2 ? BIND_SIMPLE_CATCH : BIND_LEXICAL), this.expect(types$1.parenR), param;
595
+ };
596
+ pp$8.parseTryStatement = function(node) {
597
+ if (this.next(), node.block = this.parseBlock(), node.handler = null, this.type === types$1._catch) {
598
+ var clause = this.startNode();
599
+ this.next(), this.eat(types$1.parenL) ? clause.param = this.parseCatchClauseParam() : (this.options.ecmaVersion < 10 && this.unexpected(), clause.param = null, this.enterScope(0)), clause.body = this.parseBlock(!1), this.exitScope(), node.handler = this.finishNode(clause, "CatchClause");
600
+ }
601
+ return node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null, !node.handler && !node.finalizer && this.raise(node.start, "Missing catch or finally clause"), this.finishNode(node, "TryStatement");
602
+ };
603
+ pp$8.parseVarStatement = function(node, kind, allowMissingInitializer) {
604
+ return this.next(), this.parseVar(node, !1, kind, allowMissingInitializer), this.semicolon(), this.finishNode(node, "VariableDeclaration");
605
+ };
606
+ pp$8.parseWhileStatement = function(node) {
607
+ return this.next(), node.test = this.parseParenExpression(), this.labels.push(loopLabel), node.body = this.parseStatement("while"), this.labels.pop(), this.finishNode(node, "WhileStatement");
608
+ };
609
+ pp$8.parseWithStatement = function(node) {
610
+ return this.strict && this.raise(this.start, "'with' in strict mode"), this.next(), node.object = this.parseParenExpression(), node.body = this.parseStatement("with"), this.finishNode(node, "WithStatement");
611
+ };
612
+ pp$8.parseEmptyStatement = function(node) {
613
+ return this.next(), this.finishNode(node, "EmptyStatement");
614
+ };
615
+ pp$8.parseLabeledStatement = function(node, maybeName, expr, context) {
616
+ for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1) {
617
+ var label = list[i$1];
618
+ label.name === maybeName && this.raise(expr.start, "Label '" + maybeName + "' is already declared");
619
+ }
620
+ for (var kind = this.type.isLoop ? "loop" : this.type === types$1._switch ? "switch" : null, i = this.labels.length - 1; i >= 0; i--) {
621
+ var label$1 = this.labels[i];
622
+ if (label$1.statementStart === node.start)
623
+ label$1.statementStart = this.start, label$1.kind = kind;
624
+ else
625
+ break;
626
+ }
627
+ return this.labels.push({ name: maybeName, kind, statementStart: this.start }), node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label"), this.labels.pop(), node.label = expr, this.finishNode(node, "LabeledStatement");
628
+ };
629
+ pp$8.parseExpressionStatement = function(node, expr) {
630
+ return node.expression = expr, this.semicolon(), this.finishNode(node, "ExpressionStatement");
631
+ };
632
+ pp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) {
633
+ for (createNewLexicalScope === void 0 && (createNewLexicalScope = !0), node === void 0 && (node = this.startNode()), node.body = [], this.expect(types$1.braceL), createNewLexicalScope && this.enterScope(0); this.type !== types$1.braceR; ) {
634
+ var stmt = this.parseStatement(null);
635
+ node.body.push(stmt);
636
+ }
637
+ return exitStrict && (this.strict = !1), this.next(), createNewLexicalScope && this.exitScope(), this.finishNode(node, "BlockStatement");
638
+ };
639
+ pp$8.parseFor = function(node, init) {
640
+ return node.init = init, this.expect(types$1.semi), node.test = this.type === types$1.semi ? null : this.parseExpression(), this.expect(types$1.semi), node.update = this.type === types$1.parenR ? null : this.parseExpression(), this.expect(types$1.parenR), node.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(node, "ForStatement");
641
+ };
642
+ pp$8.parseForIn = function(node, init) {
643
+ var isForIn = this.type === types$1._in;
644
+ return this.next(), init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || this.options.ecmaVersion < 8 || this.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier") && this.raise(
645
+ init.start,
646
+ (isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer"
647
+ ), node.left = init, node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(), this.expect(types$1.parenR), node.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement");
648
+ };
649
+ pp$8.parseVar = function(node, isFor, kind, allowMissingInitializer) {
650
+ for (node.declarations = [], node.kind = kind; ; ) {
651
+ var decl = this.startNode();
652
+ if (this.parseVarId(decl, kind), this.eat(types$1.eq) ? decl.init = this.parseMaybeAssign(isFor) : !allowMissingInitializer && kind === "const" && !(this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) ? this.unexpected() : !allowMissingInitializer && decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of"))) ? this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value") : decl.init = null, node.declarations.push(this.finishNode(decl, "VariableDeclarator")), !this.eat(types$1.comma))
653
+ break;
654
+ }
655
+ return node;
656
+ };
657
+ pp$8.parseVarId = function(decl, kind) {
658
+ decl.id = this.parseBindingAtom(), this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, !1);
659
+ };
660
+ var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4;
661
+ pp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) {
662
+ this.initFunction(node), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) && (this.type === types$1.star && statement & FUNC_HANGING_STATEMENT && this.unexpected(), node.generator = this.eat(types$1.star)), this.options.ecmaVersion >= 8 && (node.async = !!isAsync), statement & FUNC_STATEMENT && (node.id = statement & FUNC_NULLABLE_ID && this.type !== types$1.name ? null : this.parseIdent(), node.id && !(statement & FUNC_HANGING_STATEMENT) && this.checkLValSimple(node.id, this.strict || node.generator || node.async ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION));
663
+ var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
664
+ return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(functionFlags(node.async, node.generator)), statement & FUNC_STATEMENT || (node.id = this.type === types$1.name ? this.parseIdent() : null), this.parseFunctionParams(node), this.parseFunctionBody(node, allowExpressionBody, !1, forInit), this.yieldPos = oldYieldPos, this.awaitPos = oldAwaitPos, this.awaitIdentPos = oldAwaitIdentPos, this.finishNode(node, statement & FUNC_STATEMENT ? "FunctionDeclaration" : "FunctionExpression");
665
+ };
666
+ pp$8.parseFunctionParams = function(node) {
667
+ this.expect(types$1.parenL), node.params = this.parseBindingList(types$1.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams();
668
+ };
669
+ pp$8.parseClass = function(node, isStatement) {
670
+ this.next();
671
+ var oldStrict = this.strict;
672
+ this.strict = !0, this.parseClassId(node, isStatement), this.parseClassSuper(node);
673
+ var privateNameMap = this.enterClassBody(), classBody = this.startNode(), hadConstructor = !1;
674
+ for (classBody.body = [], this.expect(types$1.braceL); this.type !== types$1.braceR; ) {
675
+ var element = this.parseClassElement(node.superClass !== null);
676
+ element && (classBody.body.push(element), element.type === "MethodDefinition" && element.kind === "constructor" ? (hadConstructor && this.raiseRecoverable(element.start, "Duplicate constructor in the same class"), hadConstructor = !0) : element.key && element.key.type === "PrivateIdentifier" && isPrivateNameConflicted(privateNameMap, element) && this.raiseRecoverable(element.key.start, "Identifier '#" + element.key.name + "' has already been declared"));
677
+ }
678
+ return this.strict = oldStrict, this.next(), node.body = this.finishNode(classBody, "ClassBody"), this.exitClassBody(), this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression");
679
+ };
680
+ pp$8.parseClassElement = function(constructorAllowsSuper) {
681
+ if (this.eat(types$1.semi))
682
+ return null;
683
+ var ecmaVersion = this.options.ecmaVersion, node = this.startNode(), keyName = "", isGenerator = !1, isAsync = !1, kind = "method", isStatic = !1;
684
+ if (this.eatContextual("static")) {
685
+ if (ecmaVersion >= 13 && this.eat(types$1.braceL))
686
+ return this.parseClassStaticBlock(node), node;
687
+ this.isClassElementNameStart() || this.type === types$1.star ? isStatic = !0 : keyName = "static";
688
+ }
689
+ if (node.static = isStatic, !keyName && ecmaVersion >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon() ? isAsync = !0 : keyName = "async"), !keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star) && (isGenerator = !0), !keyName && !isAsync && !isGenerator) {
690
+ var lastValue = this.value;
691
+ (this.eatContextual("get") || this.eatContextual("set")) && (this.isClassElementNameStart() ? kind = lastValue : keyName = lastValue);
692
+ }
693
+ if (keyName ? (node.computed = !1, node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), node.key.name = keyName, this.finishNode(node.key, "Identifier")) : this.parseClassElementName(node), ecmaVersion < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync) {
694
+ var isConstructor = !node.static && checkKeyName(node, "constructor"), allowsDirectSuper = isConstructor && constructorAllowsSuper;
695
+ isConstructor && kind !== "method" && this.raise(node.key.start, "Constructor can't have get/set modifier"), node.kind = isConstructor ? "constructor" : kind, this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper);
696
+ } else
697
+ this.parseClassField(node);
698
+ return node;
699
+ };
700
+ pp$8.isClassElementNameStart = function() {
701
+ return this.type === types$1.name || this.type === types$1.privateId || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword;
702
+ };
703
+ pp$8.parseClassElementName = function(element) {
704
+ this.type === types$1.privateId ? (this.value === "constructor" && this.raise(this.start, "Classes can't have an element named '#constructor'"), element.computed = !1, element.key = this.parsePrivateIdent()) : this.parsePropertyName(element);
705
+ };
706
+ pp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {
707
+ var key = method.key;
708
+ method.kind === "constructor" ? (isGenerator && this.raise(key.start, "Constructor can't be a generator"), isAsync && this.raise(key.start, "Constructor can't be an async method")) : method.static && checkKeyName(method, "prototype") && this.raise(key.start, "Classes may not have a static property named prototype");
709
+ var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper);
710
+ return method.kind === "get" && value.params.length !== 0 && this.raiseRecoverable(value.start, "getter should have no params"), method.kind === "set" && value.params.length !== 1 && this.raiseRecoverable(value.start, "setter should have exactly one param"), method.kind === "set" && value.params[0].type === "RestElement" && this.raiseRecoverable(value.params[0].start, "Setter cannot use rest params"), this.finishNode(method, "MethodDefinition");
711
+ };
712
+ pp$8.parseClassField = function(field) {
713
+ if (checkKeyName(field, "constructor") ? this.raise(field.key.start, "Classes can't have a field named 'constructor'") : field.static && checkKeyName(field, "prototype") && this.raise(field.key.start, "Classes can't have a static field named 'prototype'"), this.eat(types$1.eq)) {
714
+ var scope = this.currentThisScope(), inClassFieldInit = scope.inClassFieldInit;
715
+ scope.inClassFieldInit = !0, field.value = this.parseMaybeAssign(), scope.inClassFieldInit = inClassFieldInit;
716
+ } else
717
+ field.value = null;
718
+ return this.semicolon(), this.finishNode(field, "PropertyDefinition");
719
+ };
720
+ pp$8.parseClassStaticBlock = function(node) {
721
+ node.body = [];
722
+ var oldLabels = this.labels;
723
+ for (this.labels = [], this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER); this.type !== types$1.braceR; ) {
724
+ var stmt = this.parseStatement(null);
725
+ node.body.push(stmt);
726
+ }
727
+ return this.next(), this.exitScope(), this.labels = oldLabels, this.finishNode(node, "StaticBlock");
728
+ };
729
+ pp$8.parseClassId = function(node, isStatement) {
730
+ this.type === types$1.name ? (node.id = this.parseIdent(), isStatement && this.checkLValSimple(node.id, BIND_LEXICAL, !1)) : (isStatement === !0 && this.unexpected(), node.id = null);
731
+ };
732
+ pp$8.parseClassSuper = function(node) {
733
+ node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(null, !1) : null;
734
+ };
735
+ pp$8.enterClassBody = function() {
736
+ var element = { declared: /* @__PURE__ */ Object.create(null), used: [] };
737
+ return this.privateNameStack.push(element), element.declared;
738
+ };
739
+ pp$8.exitClassBody = function() {
740
+ var ref2 = this.privateNameStack.pop(), declared = ref2.declared, used = ref2.used;
741
+ if (this.options.checkPrivateFields)
742
+ for (var len = this.privateNameStack.length, parent = len === 0 ? null : this.privateNameStack[len - 1], i = 0; i < used.length; ++i) {
743
+ var id = used[i];
744
+ hasOwn(declared, id.name) || (parent ? parent.used.push(id) : this.raiseRecoverable(id.start, "Private field '#" + id.name + "' must be declared in an enclosing class"));
745
+ }
746
+ };
747
+ function isPrivateNameConflicted(privateNameMap, element) {
748
+ var name = element.key.name, curr = privateNameMap[name], next = "true";
749
+ return element.type === "MethodDefinition" && (element.kind === "get" || element.kind === "set") && (next = (element.static ? "s" : "i") + element.kind), curr === "iget" && next === "iset" || curr === "iset" && next === "iget" || curr === "sget" && next === "sset" || curr === "sset" && next === "sget" ? (privateNameMap[name] = "true", !1) : curr ? !0 : (privateNameMap[name] = next, !1);
750
+ }
751
+ function checkKeyName(node, name) {
752
+ var computed = node.computed, key = node.key;
753
+ return !computed && (key.type === "Identifier" && key.name === name || key.type === "Literal" && key.value === name);
754
+ }
755
+ pp$8.parseExportAllDeclaration = function(node, exports) {
756
+ return this.options.ecmaVersion >= 11 && (this.eatContextual("as") ? (node.exported = this.parseModuleExportName(), this.checkExport(exports, node.exported, this.lastTokStart)) : node.exported = null), this.expectContextual("from"), this.type !== types$1.string && this.unexpected(), node.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (node.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(node, "ExportAllDeclaration");
757
+ };
758
+ pp$8.parseExport = function(node, exports) {
759
+ if (this.next(), this.eat(types$1.star))
760
+ return this.parseExportAllDeclaration(node, exports);
761
+ if (this.eat(types$1._default))
762
+ return this.checkExport(exports, "default", this.lastTokStart), node.declaration = this.parseExportDefaultDeclaration(), this.finishNode(node, "ExportDefaultDeclaration");
763
+ if (this.shouldParseExportStatement())
764
+ node.declaration = this.parseExportDeclaration(node), node.declaration.type === "VariableDeclaration" ? this.checkVariableExport(exports, node.declaration.declarations) : this.checkExport(exports, node.declaration.id, node.declaration.id.start), node.specifiers = [], node.source = null;
765
+ else {
766
+ if (node.declaration = null, node.specifiers = this.parseExportSpecifiers(exports), this.eatContextual("from"))
767
+ this.type !== types$1.string && this.unexpected(), node.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (node.attributes = this.parseWithClause());
768
+ else {
769
+ for (var i = 0, list = node.specifiers; i < list.length; i += 1) {
770
+ var spec = list[i];
771
+ this.checkUnreserved(spec.local), this.checkLocalExport(spec.local), spec.local.type === "Literal" && this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`.");
772
+ }
773
+ node.source = null;
774
+ }
775
+ this.semicolon();
776
+ }
777
+ return this.finishNode(node, "ExportNamedDeclaration");
778
+ };
779
+ pp$8.parseExportDeclaration = function(node) {
780
+ return this.parseStatement(null);
781
+ };
782
+ pp$8.parseExportDefaultDeclaration = function() {
783
+ var isAsync;
784
+ if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) {
785
+ var fNode = this.startNode();
786
+ return this.next(), isAsync && this.next(), this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, !1, isAsync);
787
+ } else if (this.type === types$1._class) {
788
+ var cNode = this.startNode();
789
+ return this.parseClass(cNode, "nullableID");
790
+ } else {
791
+ var declaration = this.parseMaybeAssign();
792
+ return this.semicolon(), declaration;
793
+ }
794
+ };
795
+ pp$8.checkExport = function(exports, name, pos) {
796
+ exports && (typeof name != "string" && (name = name.type === "Identifier" ? name.name : name.value), hasOwn(exports, name) && this.raiseRecoverable(pos, "Duplicate export '" + name + "'"), exports[name] = !0);
797
+ };
798
+ pp$8.checkPatternExport = function(exports, pat) {
799
+ var type = pat.type;
800
+ if (type === "Identifier")
801
+ this.checkExport(exports, pat, pat.start);
802
+ else if (type === "ObjectPattern")
803
+ for (var i = 0, list = pat.properties; i < list.length; i += 1) {
804
+ var prop = list[i];
805
+ this.checkPatternExport(exports, prop);
806
+ }
807
+ else if (type === "ArrayPattern")
808
+ for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {
809
+ var elt = list$1[i$1];
810
+ elt && this.checkPatternExport(exports, elt);
811
+ }
812
+ else type === "Property" ? this.checkPatternExport(exports, pat.value) : type === "AssignmentPattern" ? this.checkPatternExport(exports, pat.left) : type === "RestElement" && this.checkPatternExport(exports, pat.argument);
813
+ };
814
+ pp$8.checkVariableExport = function(exports, decls) {
815
+ if (exports)
816
+ for (var i = 0, list = decls; i < list.length; i += 1) {
817
+ var decl = list[i];
818
+ this.checkPatternExport(exports, decl.id);
819
+ }
820
+ };
821
+ pp$8.shouldParseExportStatement = function() {
822
+ return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction();
823
+ };
824
+ pp$8.parseExportSpecifier = function(exports) {
825
+ var node = this.startNode();
826
+ return node.local = this.parseModuleExportName(), node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local, this.checkExport(
827
+ exports,
828
+ node.exported,
829
+ node.exported.start
830
+ ), this.finishNode(node, "ExportSpecifier");
831
+ };
832
+ pp$8.parseExportSpecifiers = function(exports) {
833
+ var nodes = [], first = !0;
834
+ for (this.expect(types$1.braceL); !this.eat(types$1.braceR); ) {
835
+ if (first)
836
+ first = !1;
837
+ else if (this.expect(types$1.comma), this.afterTrailingComma(types$1.braceR))
838
+ break;
839
+ nodes.push(this.parseExportSpecifier(exports));
840
+ }
841
+ return nodes;
842
+ };
843
+ pp$8.parseImport = function(node) {
844
+ return this.next(), this.type === types$1.string ? (node.specifiers = empty$1, node.source = this.parseExprAtom()) : (node.specifiers = this.parseImportSpecifiers(), this.expectContextual("from"), node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected()), this.options.ecmaVersion >= 16 && (node.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(node, "ImportDeclaration");
845
+ };
846
+ pp$8.parseImportSpecifier = function() {
847
+ var node = this.startNode();
848
+ return node.imported = this.parseModuleExportName(), this.eatContextual("as") ? node.local = this.parseIdent() : (this.checkUnreserved(node.imported), node.local = node.imported), this.checkLValSimple(node.local, BIND_LEXICAL), this.finishNode(node, "ImportSpecifier");
849
+ };
850
+ pp$8.parseImportDefaultSpecifier = function() {
851
+ var node = this.startNode();
852
+ return node.local = this.parseIdent(), this.checkLValSimple(node.local, BIND_LEXICAL), this.finishNode(node, "ImportDefaultSpecifier");
853
+ };
854
+ pp$8.parseImportNamespaceSpecifier = function() {
855
+ var node = this.startNode();
856
+ return this.next(), this.expectContextual("as"), node.local = this.parseIdent(), this.checkLValSimple(node.local, BIND_LEXICAL), this.finishNode(node, "ImportNamespaceSpecifier");
857
+ };
858
+ pp$8.parseImportSpecifiers = function() {
859
+ var nodes = [], first = !0;
860
+ if (this.type === types$1.name && (nodes.push(this.parseImportDefaultSpecifier()), !this.eat(types$1.comma)))
861
+ return nodes;
862
+ if (this.type === types$1.star)
863
+ return nodes.push(this.parseImportNamespaceSpecifier()), nodes;
864
+ for (this.expect(types$1.braceL); !this.eat(types$1.braceR); ) {
865
+ if (first)
866
+ first = !1;
867
+ else if (this.expect(types$1.comma), this.afterTrailingComma(types$1.braceR))
868
+ break;
869
+ nodes.push(this.parseImportSpecifier());
870
+ }
871
+ return nodes;
872
+ };
873
+ pp$8.parseWithClause = function() {
874
+ var nodes = [];
875
+ if (!this.eat(types$1._with))
876
+ return nodes;
877
+ this.expect(types$1.braceL);
878
+ for (var attributeKeys = {}, first = !0; !this.eat(types$1.braceR); ) {
879
+ if (first)
880
+ first = !1;
881
+ else if (this.expect(types$1.comma), this.afterTrailingComma(types$1.braceR))
882
+ break;
883
+ var attr = this.parseImportAttribute(), keyName = attr.key.type === "Identifier" ? attr.key.name : attr.key.value;
884
+ hasOwn(attributeKeys, keyName) && this.raiseRecoverable(attr.key.start, "Duplicate attribute key '" + keyName + "'"), attributeKeys[keyName] = !0, nodes.push(attr);
885
+ }
886
+ return nodes;
887
+ };
888
+ pp$8.parseImportAttribute = function() {
889
+ var node = this.startNode();
890
+ return node.key = this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never"), this.expect(types$1.colon), this.type !== types$1.string && this.unexpected(), node.value = this.parseExprAtom(), this.finishNode(node, "ImportAttribute");
891
+ };
892
+ pp$8.parseModuleExportName = function() {
893
+ if (this.options.ecmaVersion >= 13 && this.type === types$1.string) {
894
+ var stringLiteral = this.parseLiteral(this.value);
895
+ return loneSurrogate.test(stringLiteral.value) && this.raise(stringLiteral.start, "An export name cannot include a lone surrogate."), stringLiteral;
896
+ }
897
+ return this.parseIdent(!0);
898
+ };
899
+ pp$8.adaptDirectivePrologue = function(statements) {
900
+ for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i)
901
+ statements[i].directive = statements[i].expression.raw.slice(1, -1);
902
+ };
903
+ pp$8.isDirectiveCandidate = function(statement) {
904
+ return this.options.ecmaVersion >= 5 && statement.type === "ExpressionStatement" && statement.expression.type === "Literal" && typeof statement.expression.value == "string" && // Reject parenthesized strings.
905
+ (this.input[statement.start] === '"' || this.input[statement.start] === "'");
906
+ };
907
+ var pp$7 = Parser.prototype;
908
+ pp$7.toAssignable = function(node, isBinding, refDestructuringErrors) {
909
+ if (this.options.ecmaVersion >= 6 && node)
910
+ switch (node.type) {
911
+ case "Identifier":
912
+ this.inAsync && node.name === "await" && this.raise(node.start, "Cannot use 'await' as identifier inside an async function");
913
+ break;
914
+ case "ObjectPattern":
915
+ case "ArrayPattern":
916
+ case "AssignmentPattern":
917
+ case "RestElement":
918
+ break;
919
+ case "ObjectExpression":
920
+ node.type = "ObjectPattern", refDestructuringErrors && this.checkPatternErrors(refDestructuringErrors, !0);
921
+ for (var i = 0, list = node.properties; i < list.length; i += 1) {
922
+ var prop = list[i];
923
+ this.toAssignable(prop, isBinding), prop.type === "RestElement" && (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern") && this.raise(prop.argument.start, "Unexpected token");
924
+ }
925
+ break;
926
+ case "Property":
927
+ node.kind !== "init" && this.raise(node.key.start, "Object pattern can't contain getter or setter"), this.toAssignable(node.value, isBinding);
928
+ break;
929
+ case "ArrayExpression":
930
+ node.type = "ArrayPattern", refDestructuringErrors && this.checkPatternErrors(refDestructuringErrors, !0), this.toAssignableList(node.elements, isBinding);
931
+ break;
932
+ case "SpreadElement":
933
+ node.type = "RestElement", this.toAssignable(node.argument, isBinding), node.argument.type === "AssignmentPattern" && this.raise(node.argument.start, "Rest elements cannot have a default value");
934
+ break;
935
+ case "AssignmentExpression":
936
+ node.operator !== "=" && this.raise(node.left.end, "Only '=' operator can be used for specifying default value."), node.type = "AssignmentPattern", delete node.operator, this.toAssignable(node.left, isBinding);
937
+ break;
938
+ case "ParenthesizedExpression":
939
+ this.toAssignable(node.expression, isBinding, refDestructuringErrors);
940
+ break;
941
+ case "ChainExpression":
942
+ this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side");
943
+ break;
944
+ case "MemberExpression":
945
+ if (!isBinding)
946
+ break;
947
+ default:
948
+ this.raise(node.start, "Assigning to rvalue");
949
+ }
950
+ else refDestructuringErrors && this.checkPatternErrors(refDestructuringErrors, !0);
951
+ return node;
952
+ };
953
+ pp$7.toAssignableList = function(exprList, isBinding) {
954
+ for (var end = exprList.length, i = 0; i < end; i++) {
955
+ var elt = exprList[i];
956
+ elt && this.toAssignable(elt, isBinding);
957
+ }
958
+ if (end) {
959
+ var last = exprList[end - 1];
960
+ this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier" && this.unexpected(last.argument.start);
961
+ }
962
+ return exprList;
963
+ };
964
+ pp$7.parseSpread = function(refDestructuringErrors) {
965
+ var node = this.startNode();
966
+ return this.next(), node.argument = this.parseMaybeAssign(!1, refDestructuringErrors), this.finishNode(node, "SpreadElement");
967
+ };
968
+ pp$7.parseRestBinding = function() {
969
+ var node = this.startNode();
970
+ return this.next(), this.options.ecmaVersion === 6 && this.type !== types$1.name && this.unexpected(), node.argument = this.parseBindingAtom(), this.finishNode(node, "RestElement");
971
+ };
972
+ pp$7.parseBindingAtom = function() {
973
+ if (this.options.ecmaVersion >= 6)
974
+ switch (this.type) {
975
+ case types$1.bracketL:
976
+ var node = this.startNode();
977
+ return this.next(), node.elements = this.parseBindingList(types$1.bracketR, !0, !0), this.finishNode(node, "ArrayPattern");
978
+ case types$1.braceL:
979
+ return this.parseObj(!0);
980
+ }
981
+ return this.parseIdent();
982
+ };
983
+ pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma, allowModifiers) {
984
+ for (var elts = [], first = !0; !this.eat(close); )
985
+ if (first ? first = !1 : this.expect(types$1.comma), allowEmpty && this.type === types$1.comma)
986
+ elts.push(null);
987
+ else {
988
+ if (allowTrailingComma && this.afterTrailingComma(close))
989
+ break;
990
+ if (this.type === types$1.ellipsis) {
991
+ var rest = this.parseRestBinding();
992
+ this.parseBindingListItem(rest), elts.push(rest), this.type === types$1.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.expect(close);
993
+ break;
994
+ } else
995
+ elts.push(this.parseAssignableListItem(allowModifiers));
996
+ }
997
+ return elts;
998
+ };
999
+ pp$7.parseAssignableListItem = function(allowModifiers) {
1000
+ var elem = this.parseMaybeDefault(this.start, this.startLoc);
1001
+ return this.parseBindingListItem(elem), elem;
1002
+ };
1003
+ pp$7.parseBindingListItem = function(param) {
1004
+ return param;
1005
+ };
1006
+ pp$7.parseMaybeDefault = function(startPos, startLoc, left) {
1007
+ if (left = left || this.parseBindingAtom(), this.options.ecmaVersion < 6 || !this.eat(types$1.eq))
1008
+ return left;
1009
+ var node = this.startNodeAt(startPos, startLoc);
1010
+ return node.left = left, node.right = this.parseMaybeAssign(), this.finishNode(node, "AssignmentPattern");
1011
+ };
1012
+ pp$7.checkLValSimple = function(expr, bindingType, checkClashes) {
1013
+ bindingType === void 0 && (bindingType = BIND_NONE);
1014
+ var isBind = bindingType !== BIND_NONE;
1015
+ switch (expr.type) {
1016
+ case "Identifier":
1017
+ this.strict && this.reservedWordsStrictBind.test(expr.name) && this.raiseRecoverable(expr.start, (isBind ? "Binding " : "Assigning to ") + expr.name + " in strict mode"), isBind && (bindingType === BIND_LEXICAL && expr.name === "let" && this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"), checkClashes && (hasOwn(checkClashes, expr.name) && this.raiseRecoverable(expr.start, "Argument name clash"), checkClashes[expr.name] = !0), bindingType !== BIND_OUTSIDE && this.declareName(expr.name, bindingType, expr.start));
1018
+ break;
1019
+ case "ChainExpression":
1020
+ this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side");
1021
+ break;
1022
+ case "MemberExpression":
1023
+ isBind && this.raiseRecoverable(expr.start, "Binding member expression");
1024
+ break;
1025
+ case "ParenthesizedExpression":
1026
+ return isBind && this.raiseRecoverable(expr.start, "Binding parenthesized expression"), this.checkLValSimple(expr.expression, bindingType, checkClashes);
1027
+ default:
1028
+ this.raise(expr.start, (isBind ? "Binding" : "Assigning to") + " rvalue");
1029
+ }
1030
+ };
1031
+ pp$7.checkLValPattern = function(expr, bindingType, checkClashes) {
1032
+ switch (bindingType === void 0 && (bindingType = BIND_NONE), expr.type) {
1033
+ case "ObjectPattern":
1034
+ for (var i = 0, list = expr.properties; i < list.length; i += 1) {
1035
+ var prop = list[i];
1036
+ this.checkLValInnerPattern(prop, bindingType, checkClashes);
1037
+ }
1038
+ break;
1039
+ case "ArrayPattern":
1040
+ for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) {
1041
+ var elem = list$1[i$1];
1042
+ elem && this.checkLValInnerPattern(elem, bindingType, checkClashes);
1043
+ }
1044
+ break;
1045
+ default:
1046
+ this.checkLValSimple(expr, bindingType, checkClashes);
1047
+ }
1048
+ };
1049
+ pp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) {
1050
+ switch (bindingType === void 0 && (bindingType = BIND_NONE), expr.type) {
1051
+ case "Property":
1052
+ this.checkLValInnerPattern(expr.value, bindingType, checkClashes);
1053
+ break;
1054
+ case "AssignmentPattern":
1055
+ this.checkLValPattern(expr.left, bindingType, checkClashes);
1056
+ break;
1057
+ case "RestElement":
1058
+ this.checkLValPattern(expr.argument, bindingType, checkClashes);
1059
+ break;
1060
+ default:
1061
+ this.checkLValPattern(expr, bindingType, checkClashes);
1062
+ }
1063
+ };
1064
+ var TokContext = function(token, isExpr, preserveSpace, override, generator) {
1065
+ this.token = token, this.isExpr = !!isExpr, this.preserveSpace = !!preserveSpace, this.override = override, this.generator = !!generator;
1066
+ }, types = {
1067
+ b_stat: new TokContext("{", !1),
1068
+ b_expr: new TokContext("{", !0),
1069
+ b_tmpl: new TokContext("${", !1),
1070
+ p_stat: new TokContext("(", !1),
1071
+ p_expr: new TokContext("(", !0),
1072
+ q_tmpl: new TokContext("`", !0, !0, function(p) {
1073
+ return p.tryReadTemplateToken();
1074
+ }),
1075
+ f_stat: new TokContext("function", !1),
1076
+ f_expr: new TokContext("function", !0),
1077
+ f_expr_gen: new TokContext("function", !0, !1, null, !0),
1078
+ f_gen: new TokContext("function", !1, !1, null, !0)
1079
+ }, pp$6 = Parser.prototype;
1080
+ pp$6.initialContext = function() {
1081
+ return [types.b_stat];
1082
+ };
1083
+ pp$6.curContext = function() {
1084
+ return this.context[this.context.length - 1];
1085
+ };
1086
+ pp$6.braceIsBlock = function(prevType) {
1087
+ var parent = this.curContext();
1088
+ return parent === types.f_expr || parent === types.f_stat ? !0 : prevType === types$1.colon && (parent === types.b_stat || parent === types.b_expr) ? !parent.isExpr : prevType === types$1._return || prevType === types$1.name && this.exprAllowed ? lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) : prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow ? !0 : prevType === types$1.braceL ? parent === types.b_stat : prevType === types$1._var || prevType === types$1._const || prevType === types$1.name ? !1 : !this.exprAllowed;
1089
+ };
1090
+ pp$6.inGeneratorContext = function() {
1091
+ for (var i = this.context.length - 1; i >= 1; i--) {
1092
+ var context = this.context[i];
1093
+ if (context.token === "function")
1094
+ return context.generator;
1095
+ }
1096
+ return !1;
1097
+ };
1098
+ pp$6.updateContext = function(prevType) {
1099
+ var update, type = this.type;
1100
+ type.keyword && prevType === types$1.dot ? this.exprAllowed = !1 : (update = type.updateContext) ? update.call(this, prevType) : this.exprAllowed = type.beforeExpr;
1101
+ };
1102
+ pp$6.overrideContext = function(tokenCtx) {
1103
+ this.curContext() !== tokenCtx && (this.context[this.context.length - 1] = tokenCtx);
1104
+ };
1105
+ types$1.parenR.updateContext = types$1.braceR.updateContext = function() {
1106
+ if (this.context.length === 1) {
1107
+ this.exprAllowed = !0;
1108
+ return;
1109
+ }
1110
+ var out = this.context.pop();
1111
+ out === types.b_stat && this.curContext().token === "function" && (out = this.context.pop()), this.exprAllowed = !out.isExpr;
1112
+ };
1113
+ types$1.braceL.updateContext = function(prevType) {
1114
+ this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr), this.exprAllowed = !0;
1115
+ };
1116
+ types$1.dollarBraceL.updateContext = function() {
1117
+ this.context.push(types.b_tmpl), this.exprAllowed = !0;
1118
+ };
1119
+ types$1.parenL.updateContext = function(prevType) {
1120
+ var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while;
1121
+ this.context.push(statementParens ? types.p_stat : types.p_expr), this.exprAllowed = !0;
1122
+ };
1123
+ types$1.incDec.updateContext = function() {
1124
+ };
1125
+ types$1._function.updateContext = types$1._class.updateContext = function(prevType) {
1126
+ prevType.beforeExpr && prevType !== types$1._else && !(prevType === types$1.semi && this.curContext() !== types.p_stat) && !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types.b_stat) ? this.context.push(types.f_expr) : this.context.push(types.f_stat), this.exprAllowed = !1;
1127
+ };
1128
+ types$1.colon.updateContext = function() {
1129
+ this.curContext().token === "function" && this.context.pop(), this.exprAllowed = !0;
1130
+ };
1131
+ types$1.backQuote.updateContext = function() {
1132
+ this.curContext() === types.q_tmpl ? this.context.pop() : this.context.push(types.q_tmpl), this.exprAllowed = !1;
1133
+ };
1134
+ types$1.star.updateContext = function(prevType) {
1135
+ if (prevType === types$1._function) {
1136
+ var index = this.context.length - 1;
1137
+ this.context[index] === types.f_expr ? this.context[index] = types.f_expr_gen : this.context[index] = types.f_gen;
1138
+ }
1139
+ this.exprAllowed = !0;
1140
+ };
1141
+ types$1.name.updateContext = function(prevType) {
1142
+ var allowed = !1;
1143
+ this.options.ecmaVersion >= 6 && prevType !== types$1.dot && (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) && (allowed = !0), this.exprAllowed = allowed;
1144
+ };
1145
+ var pp$5 = Parser.prototype;
1146
+ pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) {
1147
+ if (!(this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") && !(this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand))) {
1148
+ var key = prop.key, name;
1149
+ switch (key.type) {
1150
+ case "Identifier":
1151
+ name = key.name;
1152
+ break;
1153
+ case "Literal":
1154
+ name = String(key.value);
1155
+ break;
1156
+ default:
1157
+ return;
1158
+ }
1159
+ var kind = prop.kind;
1160
+ if (this.options.ecmaVersion >= 6) {
1161
+ name === "__proto__" && kind === "init" && (propHash.proto && (refDestructuringErrors ? refDestructuringErrors.doubleProto < 0 && (refDestructuringErrors.doubleProto = key.start) : this.raiseRecoverable(key.start, "Redefinition of __proto__ property")), propHash.proto = !0);
1162
+ return;
1163
+ }
1164
+ name = "$" + name;
1165
+ var other = propHash[name];
1166
+ if (other) {
1167
+ var redefinition;
1168
+ kind === "init" ? redefinition = this.strict && other.init || other.get || other.set : redefinition = other.init || other[kind], redefinition && this.raiseRecoverable(key.start, "Redefinition of property");
1169
+ } else
1170
+ other = propHash[name] = {
1171
+ init: !1,
1172
+ get: !1,
1173
+ set: !1
1174
+ };
1175
+ other[kind] = !0;
1176
+ }
1177
+ };
1178
+ pp$5.parseExpression = function(forInit, refDestructuringErrors) {
1179
+ var startPos = this.start, startLoc = this.startLoc, expr = this.parseMaybeAssign(forInit, refDestructuringErrors);
1180
+ if (this.type === types$1.comma) {
1181
+ var node = this.startNodeAt(startPos, startLoc);
1182
+ for (node.expressions = [expr]; this.eat(types$1.comma); )
1183
+ node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors));
1184
+ return this.finishNode(node, "SequenceExpression");
1185
+ }
1186
+ return expr;
1187
+ };
1188
+ pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) {
1189
+ if (this.isContextual("yield")) {
1190
+ if (this.inGenerator)
1191
+ return this.parseYield(forInit);
1192
+ this.exprAllowed = !1;
1193
+ }
1194
+ var ownDestructuringErrors = !1, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1;
1195
+ refDestructuringErrors ? (oldParenAssign = refDestructuringErrors.parenthesizedAssign, oldTrailingComma = refDestructuringErrors.trailingComma, oldDoubleProto = refDestructuringErrors.doubleProto, refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1) : (refDestructuringErrors = new DestructuringErrors(), ownDestructuringErrors = !0);
1196
+ var startPos = this.start, startLoc = this.startLoc;
1197
+ (this.type === types$1.parenL || this.type === types$1.name) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = forInit === "await");
1198
+ var left = this.parseMaybeConditional(forInit, refDestructuringErrors);
1199
+ if (afterLeftParse && (left = afterLeftParse.call(this, left, startPos, startLoc)), this.type.isAssign) {
1200
+ var node = this.startNodeAt(startPos, startLoc);
1201
+ return node.operator = this.value, this.type === types$1.eq && (left = this.toAssignable(left, !1, refDestructuringErrors)), ownDestructuringErrors || (refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1), refDestructuringErrors.shorthandAssign >= left.start && (refDestructuringErrors.shorthandAssign = -1), this.type === types$1.eq ? this.checkLValPattern(left) : this.checkLValSimple(left), node.left = left, this.next(), node.right = this.parseMaybeAssign(forInit), oldDoubleProto > -1 && (refDestructuringErrors.doubleProto = oldDoubleProto), this.finishNode(node, "AssignmentExpression");
1202
+ } else
1203
+ ownDestructuringErrors && this.checkExpressionErrors(refDestructuringErrors, !0);
1204
+ return oldParenAssign > -1 && (refDestructuringErrors.parenthesizedAssign = oldParenAssign), oldTrailingComma > -1 && (refDestructuringErrors.trailingComma = oldTrailingComma), left;
1205
+ };
1206
+ pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) {
1207
+ var startPos = this.start, startLoc = this.startLoc, expr = this.parseExprOps(forInit, refDestructuringErrors);
1208
+ if (this.checkExpressionErrors(refDestructuringErrors))
1209
+ return expr;
1210
+ if (this.eat(types$1.question)) {
1211
+ var node = this.startNodeAt(startPos, startLoc);
1212
+ return node.test = expr, node.consequent = this.parseMaybeAssign(), this.expect(types$1.colon), node.alternate = this.parseMaybeAssign(forInit), this.finishNode(node, "ConditionalExpression");
1213
+ }
1214
+ return expr;
1215
+ };
1216
+ pp$5.parseExprOps = function(forInit, refDestructuringErrors) {
1217
+ var startPos = this.start, startLoc = this.startLoc, expr = this.parseMaybeUnary(refDestructuringErrors, !1, !1, forInit);
1218
+ return this.checkExpressionErrors(refDestructuringErrors) || expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, forInit);
1219
+ };
1220
+ pp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) {
1221
+ var prec = this.type.binop;
1222
+ if (prec != null && (!forInit || this.type !== types$1._in) && prec > minPrec) {
1223
+ var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND, coalesce = this.type === types$1.coalesce;
1224
+ coalesce && (prec = types$1.logicalAND.binop);
1225
+ var op = this.value;
1226
+ this.next();
1227
+ var startPos = this.start, startLoc = this.startLoc, right = this.parseExprOp(this.parseMaybeUnary(null, !1, !1, forInit), startPos, startLoc, prec, forInit), node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce);
1228
+ return (logical && this.type === types$1.coalesce || coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND)) && this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"), this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit);
1229
+ }
1230
+ return left;
1231
+ };
1232
+ pp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) {
1233
+ right.type === "PrivateIdentifier" && this.raise(right.start, "Private identifier can only be left side of binary expression");
1234
+ var node = this.startNodeAt(startPos, startLoc);
1235
+ return node.left = left, node.operator = op, node.right = right, this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression");
1236
+ };
1237
+ pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) {
1238
+ var startPos = this.start, startLoc = this.startLoc, expr;
1239
+ if (this.isContextual("await") && this.canAwait)
1240
+ expr = this.parseAwait(forInit), sawUnary = !0;
1241
+ else if (this.type.prefix) {
1242
+ var node = this.startNode(), update = this.type === types$1.incDec;
1243
+ node.operator = this.value, node.prefix = !0, this.next(), node.argument = this.parseMaybeUnary(null, !0, update, forInit), this.checkExpressionErrors(refDestructuringErrors, !0), update ? this.checkLValSimple(node.argument) : this.strict && node.operator === "delete" && isLocalVariableAccess(node.argument) ? this.raiseRecoverable(node.start, "Deleting local variable in strict mode") : node.operator === "delete" && isPrivateFieldAccess(node.argument) ? this.raiseRecoverable(node.start, "Private fields can not be deleted") : sawUnary = !0, expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression");
1244
+ } else if (!sawUnary && this.type === types$1.privateId)
1245
+ (forInit || this.privateNameStack.length === 0) && this.options.checkPrivateFields && this.unexpected(), expr = this.parsePrivateIdent(), this.type !== types$1._in && this.unexpected();
1246
+ else {
1247
+ if (expr = this.parseExprSubscripts(refDestructuringErrors, forInit), this.checkExpressionErrors(refDestructuringErrors))
1248
+ return expr;
1249
+ for (; this.type.postfix && !this.canInsertSemicolon(); ) {
1250
+ var node$1 = this.startNodeAt(startPos, startLoc);
1251
+ node$1.operator = this.value, node$1.prefix = !1, node$1.argument = expr, this.checkLValSimple(expr), this.next(), expr = this.finishNode(node$1, "UpdateExpression");
1252
+ }
1253
+ }
1254
+ if (!incDec && this.eat(types$1.starstar))
1255
+ if (sawUnary)
1256
+ this.unexpected(this.lastTokStart);
1257
+ else
1258
+ return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, !1, !1, forInit), "**", !1);
1259
+ else
1260
+ return expr;
1261
+ };
1262
+ function isLocalVariableAccess(node) {
1263
+ return node.type === "Identifier" || node.type === "ParenthesizedExpression" && isLocalVariableAccess(node.expression);
1264
+ }
1265
+ function isPrivateFieldAccess(node) {
1266
+ return node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" || node.type === "ChainExpression" && isPrivateFieldAccess(node.expression) || node.type === "ParenthesizedExpression" && isPrivateFieldAccess(node.expression);
1267
+ }
1268
+ pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) {
1269
+ var startPos = this.start, startLoc = this.startLoc, expr = this.parseExprAtom(refDestructuringErrors, forInit);
1270
+ if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")")
1271
+ return expr;
1272
+ var result = this.parseSubscripts(expr, startPos, startLoc, !1, forInit);
1273
+ return refDestructuringErrors && result.type === "MemberExpression" && (refDestructuringErrors.parenthesizedAssign >= result.start && (refDestructuringErrors.parenthesizedAssign = -1), refDestructuringErrors.parenthesizedBind >= result.start && (refDestructuringErrors.parenthesizedBind = -1), refDestructuringErrors.trailingComma >= result.start && (refDestructuringErrors.trailingComma = -1)), result;
1274
+ };
1275
+ pp$5.parseSubscripts = function(base2, startPos, startLoc, noCalls, forInit) {
1276
+ for (var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base2.type === "Identifier" && base2.name === "async" && this.lastTokEnd === base2.end && !this.canInsertSemicolon() && base2.end - base2.start === 5 && this.potentialArrowAt === base2.start, optionalChained = !1; ; ) {
1277
+ var element = this.parseSubscript(base2, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit);
1278
+ if (element.optional && (optionalChained = !0), element === base2 || element.type === "ArrowFunctionExpression") {
1279
+ if (optionalChained) {
1280
+ var chainNode = this.startNodeAt(startPos, startLoc);
1281
+ chainNode.expression = element, element = this.finishNode(chainNode, "ChainExpression");
1282
+ }
1283
+ return element;
1284
+ }
1285
+ base2 = element;
1286
+ }
1287
+ };
1288
+ pp$5.shouldParseAsyncArrow = function() {
1289
+ return !this.canInsertSemicolon() && this.eat(types$1.arrow);
1290
+ };
1291
+ pp$5.parseSubscriptAsyncArrow = function(startPos, startLoc, exprList, forInit) {
1292
+ return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, !0, forInit);
1293
+ };
1294
+ pp$5.parseSubscript = function(base2, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) {
1295
+ var optionalSupported = this.options.ecmaVersion >= 11, optional = optionalSupported && this.eat(types$1.questionDot);
1296
+ noCalls && optional && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
1297
+ var computed = this.eat(types$1.bracketL);
1298
+ if (computed || optional && this.type !== types$1.parenL && this.type !== types$1.backQuote || this.eat(types$1.dot)) {
1299
+ var node = this.startNodeAt(startPos, startLoc);
1300
+ node.object = base2, computed ? (node.property = this.parseExpression(), this.expect(types$1.bracketR)) : this.type === types$1.privateId && base2.type !== "Super" ? node.property = this.parsePrivateIdent() : node.property = this.parseIdent(this.options.allowReserved !== "never"), node.computed = !!computed, optionalSupported && (node.optional = optional), base2 = this.finishNode(node, "MemberExpression");
1301
+ } else if (!noCalls && this.eat(types$1.parenL)) {
1302
+ var refDestructuringErrors = new DestructuringErrors(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
1303
+ this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
1304
+ var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, !1, refDestructuringErrors);
1305
+ if (maybeAsyncArrow && !optional && this.shouldParseAsyncArrow())
1306
+ return this.checkPatternErrors(refDestructuringErrors, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = oldYieldPos, this.awaitPos = oldAwaitPos, this.awaitIdentPos = oldAwaitIdentPos, this.parseSubscriptAsyncArrow(startPos, startLoc, exprList, forInit);
1307
+ this.checkExpressionErrors(refDestructuringErrors, !0), this.yieldPos = oldYieldPos || this.yieldPos, this.awaitPos = oldAwaitPos || this.awaitPos, this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos;
1308
+ var node$1 = this.startNodeAt(startPos, startLoc);
1309
+ node$1.callee = base2, node$1.arguments = exprList, optionalSupported && (node$1.optional = optional), base2 = this.finishNode(node$1, "CallExpression");
1310
+ } else if (this.type === types$1.backQuote) {
1311
+ (optional || optionalChained) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
1312
+ var node$2 = this.startNodeAt(startPos, startLoc);
1313
+ node$2.tag = base2, node$2.quasi = this.parseTemplate({ isTagged: !0 }), base2 = this.finishNode(node$2, "TaggedTemplateExpression");
1314
+ }
1315
+ return base2;
1316
+ };
1317
+ pp$5.parseExprAtom = function(refDestructuringErrors, forInit, forNew) {
1318
+ this.type === types$1.slash && this.readRegexp();
1319
+ var node, canBeArrow = this.potentialArrowAt === this.start;
1320
+ switch (this.type) {
1321
+ case types$1._super:
1322
+ return this.allowSuper || this.raise(this.start, "'super' keyword outside a method"), node = this.startNode(), this.next(), this.type === types$1.parenL && !this.allowDirectSuper && this.raise(node.start, "super() call outside constructor of a subclass"), this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL && this.unexpected(), this.finishNode(node, "Super");
1323
+ case types$1._this:
1324
+ return node = this.startNode(), this.next(), this.finishNode(node, "ThisExpression");
1325
+ case types$1.name:
1326
+ var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc, id = this.parseIdent(!1);
1327
+ if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types$1._function))
1328
+ return this.overrideContext(types.f_expr), this.parseFunction(this.startNodeAt(startPos, startLoc), 0, !1, !0, forInit);
1329
+ if (canBeArrow && !this.canInsertSemicolon()) {
1330
+ if (this.eat(types$1.arrow))
1331
+ return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], !1, forInit);
1332
+ if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types$1.name && !containsEsc && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc))
1333
+ return id = this.parseIdent(!1), (this.canInsertSemicolon() || !this.eat(types$1.arrow)) && this.unexpected(), this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], !0, forInit);
1334
+ }
1335
+ return id;
1336
+ case types$1.regexp:
1337
+ var value = this.value;
1338
+ return node = this.parseLiteral(value.value), node.regex = { pattern: value.pattern, flags: value.flags }, node;
1339
+ case types$1.num:
1340
+ case types$1.string:
1341
+ return this.parseLiteral(this.value);
1342
+ case types$1._null:
1343
+ case types$1._true:
1344
+ case types$1._false:
1345
+ return node = this.startNode(), node.value = this.type === types$1._null ? null : this.type === types$1._true, node.raw = this.type.keyword, this.next(), this.finishNode(node, "Literal");
1346
+ case types$1.parenL:
1347
+ var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit);
1348
+ return refDestructuringErrors && (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr) && (refDestructuringErrors.parenthesizedAssign = start), refDestructuringErrors.parenthesizedBind < 0 && (refDestructuringErrors.parenthesizedBind = start)), expr;
1349
+ case types$1.bracketL:
1350
+ return node = this.startNode(), this.next(), node.elements = this.parseExprList(types$1.bracketR, !0, !0, refDestructuringErrors), this.finishNode(node, "ArrayExpression");
1351
+ case types$1.braceL:
1352
+ return this.overrideContext(types.b_expr), this.parseObj(!1, refDestructuringErrors);
1353
+ case types$1._function:
1354
+ return node = this.startNode(), this.next(), this.parseFunction(node, 0);
1355
+ case types$1._class:
1356
+ return this.parseClass(this.startNode(), !1);
1357
+ case types$1._new:
1358
+ return this.parseNew();
1359
+ case types$1.backQuote:
1360
+ return this.parseTemplate();
1361
+ case types$1._import:
1362
+ return this.options.ecmaVersion >= 11 ? this.parseExprImport(forNew) : this.unexpected();
1363
+ default:
1364
+ return this.parseExprAtomDefault();
1365
+ }
1366
+ };
1367
+ pp$5.parseExprAtomDefault = function() {
1368
+ this.unexpected();
1369
+ };
1370
+ pp$5.parseExprImport = function(forNew) {
1371
+ var node = this.startNode();
1372
+ if (this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword import"), this.next(), this.type === types$1.parenL && !forNew)
1373
+ return this.parseDynamicImport(node);
1374
+ if (this.type === types$1.dot) {
1375
+ var meta = this.startNodeAt(node.start, node.loc && node.loc.start);
1376
+ return meta.name = "import", node.meta = this.finishNode(meta, "Identifier"), this.parseImportMeta(node);
1377
+ } else
1378
+ this.unexpected();
1379
+ };
1380
+ pp$5.parseDynamicImport = function(node) {
1381
+ if (this.next(), node.source = this.parseMaybeAssign(), this.options.ecmaVersion >= 16)
1382
+ this.eat(types$1.parenR) ? node.options = null : (this.expect(types$1.comma), this.afterTrailingComma(types$1.parenR) ? node.options = null : (node.options = this.parseMaybeAssign(), this.eat(types$1.parenR) || (this.expect(types$1.comma), this.afterTrailingComma(types$1.parenR) || this.unexpected())));
1383
+ else if (!this.eat(types$1.parenR)) {
1384
+ var errorPos = this.start;
1385
+ this.eat(types$1.comma) && this.eat(types$1.parenR) ? this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()") : this.unexpected(errorPos);
1386
+ }
1387
+ return this.finishNode(node, "ImportExpression");
1388
+ };
1389
+ pp$5.parseImportMeta = function(node) {
1390
+ this.next();
1391
+ var containsEsc = this.containsEsc;
1392
+ return node.property = this.parseIdent(!0), node.property.name !== "meta" && this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"), containsEsc && this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"), this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere && this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"), this.finishNode(node, "MetaProperty");
1393
+ };
1394
+ pp$5.parseLiteral = function(value) {
1395
+ var node = this.startNode();
1396
+ return node.value = value, node.raw = this.input.slice(this.start, this.end), node.raw.charCodeAt(node.raw.length - 1) === 110 && (node.bigint = node.raw.slice(0, -1).replace(/_/g, "")), this.next(), this.finishNode(node, "Literal");
1397
+ };
1398
+ pp$5.parseParenExpression = function() {
1399
+ this.expect(types$1.parenL);
1400
+ var val = this.parseExpression();
1401
+ return this.expect(types$1.parenR), val;
1402
+ };
1403
+ pp$5.shouldParseArrow = function(exprList) {
1404
+ return !this.canInsertSemicolon();
1405
+ };
1406
+ pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) {
1407
+ var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8;
1408
+ if (this.options.ecmaVersion >= 6) {
1409
+ this.next();
1410
+ var innerStartPos = this.start, innerStartLoc = this.startLoc, exprList = [], first = !0, lastIsComma = !1, refDestructuringErrors = new DestructuringErrors(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart;
1411
+ for (this.yieldPos = 0, this.awaitPos = 0; this.type !== types$1.parenR; )
1412
+ if (first ? first = !1 : this.expect(types$1.comma), allowTrailingComma && this.afterTrailingComma(types$1.parenR, !0)) {
1413
+ lastIsComma = !0;
1414
+ break;
1415
+ } else if (this.type === types$1.ellipsis) {
1416
+ spreadStart = this.start, exprList.push(this.parseParenItem(this.parseRestBinding())), this.type === types$1.comma && this.raiseRecoverable(
1417
+ this.start,
1418
+ "Comma is not permitted after the rest element"
1419
+ );
1420
+ break;
1421
+ } else
1422
+ exprList.push(this.parseMaybeAssign(!1, refDestructuringErrors, this.parseParenItem));
1423
+ var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc;
1424
+ if (this.expect(types$1.parenR), canBeArrow && this.shouldParseArrow(exprList) && this.eat(types$1.arrow))
1425
+ return this.checkPatternErrors(refDestructuringErrors, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = oldYieldPos, this.awaitPos = oldAwaitPos, this.parseParenArrowList(startPos, startLoc, exprList, forInit);
1426
+ (!exprList.length || lastIsComma) && this.unexpected(this.lastTokStart), spreadStart && this.unexpected(spreadStart), this.checkExpressionErrors(refDestructuringErrors, !0), this.yieldPos = oldYieldPos || this.yieldPos, this.awaitPos = oldAwaitPos || this.awaitPos, exprList.length > 1 ? (val = this.startNodeAt(innerStartPos, innerStartLoc), val.expressions = exprList, this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc)) : val = exprList[0];
1427
+ } else
1428
+ val = this.parseParenExpression();
1429
+ if (this.options.preserveParens) {
1430
+ var par = this.startNodeAt(startPos, startLoc);
1431
+ return par.expression = val, this.finishNode(par, "ParenthesizedExpression");
1432
+ } else
1433
+ return val;
1434
+ };
1435
+ pp$5.parseParenItem = function(item) {
1436
+ return item;
1437
+ };
1438
+ pp$5.parseParenArrowList = function(startPos, startLoc, exprList, forInit) {
1439
+ return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, !1, forInit);
1440
+ };
1441
+ var empty = [];
1442
+ pp$5.parseNew = function() {
1443
+ this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword new");
1444
+ var node = this.startNode();
1445
+ if (this.next(), this.options.ecmaVersion >= 6 && this.type === types$1.dot) {
1446
+ var meta = this.startNodeAt(node.start, node.loc && node.loc.start);
1447
+ meta.name = "new", node.meta = this.finishNode(meta, "Identifier"), this.next();
1448
+ var containsEsc = this.containsEsc;
1449
+ return node.property = this.parseIdent(!0), node.property.name !== "target" && this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"), containsEsc && this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"), this.allowNewDotTarget || this.raiseRecoverable(node.start, "'new.target' can only be used in functions and class static block"), this.finishNode(node, "MetaProperty");
1450
+ }
1451
+ var startPos = this.start, startLoc = this.startLoc;
1452
+ return node.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), startPos, startLoc, !0, !1), this.eat(types$1.parenL) ? node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, !1) : node.arguments = empty, this.finishNode(node, "NewExpression");
1453
+ };
1454
+ pp$5.parseTemplateElement = function(ref2) {
1455
+ var isTagged = ref2.isTagged, elem = this.startNode();
1456
+ return this.type === types$1.invalidTemplate ? (isTagged || this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"), elem.value = {
1457
+ raw: this.value.replace(/\r\n?/g, `
1458
+ `),
1459
+ cooked: null
1460
+ }) : elem.value = {
1461
+ raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, `
1462
+ `),
1463
+ cooked: this.value
1464
+ }, this.next(), elem.tail = this.type === types$1.backQuote, this.finishNode(elem, "TemplateElement");
1465
+ };
1466
+ pp$5.parseTemplate = function(ref2) {
1467
+ ref2 === void 0 && (ref2 = {});
1468
+ var isTagged = ref2.isTagged;
1469
+ isTagged === void 0 && (isTagged = !1);
1470
+ var node = this.startNode();
1471
+ this.next(), node.expressions = [];
1472
+ var curElt = this.parseTemplateElement({ isTagged });
1473
+ for (node.quasis = [curElt]; !curElt.tail; )
1474
+ this.type === types$1.eof && this.raise(this.pos, "Unterminated template literal"), this.expect(types$1.dollarBraceL), node.expressions.push(this.parseExpression()), this.expect(types$1.braceR), node.quasis.push(curElt = this.parseTemplateElement({ isTagged }));
1475
+ return this.next(), this.finishNode(node, "TemplateLiteral");
1476
+ };
1477
+ pp$5.isAsyncProp = function(prop) {
1478
+ return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === types$1.star) && !lineBreak.test(this.input.slice(this.lastTokEnd, this.start));
1479
+ };
1480
+ pp$5.parseObj = function(isPattern, refDestructuringErrors) {
1481
+ var node = this.startNode(), first = !0, propHash = {};
1482
+ for (node.properties = [], this.next(); !this.eat(types$1.braceR); ) {
1483
+ if (first)
1484
+ first = !1;
1485
+ else if (this.expect(types$1.comma), this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR))
1486
+ break;
1487
+ var prop = this.parseProperty(isPattern, refDestructuringErrors);
1488
+ isPattern || this.checkPropClash(prop, propHash, refDestructuringErrors), node.properties.push(prop);
1489
+ }
1490
+ return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression");
1491
+ };
1492
+ pp$5.parseProperty = function(isPattern, refDestructuringErrors) {
1493
+ var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc;
1494
+ if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis))
1495
+ return isPattern ? (prop.argument = this.parseIdent(!1), this.type === types$1.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.finishNode(prop, "RestElement")) : (prop.argument = this.parseMaybeAssign(!1, refDestructuringErrors), this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0 && (refDestructuringErrors.trailingComma = this.start), this.finishNode(prop, "SpreadElement"));
1496
+ this.options.ecmaVersion >= 6 && (prop.method = !1, prop.shorthand = !1, (isPattern || refDestructuringErrors) && (startPos = this.start, startLoc = this.startLoc), isPattern || (isGenerator = this.eat(types$1.star)));
1497
+ var containsEsc = this.containsEsc;
1498
+ return this.parsePropertyName(prop), !isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop) ? (isAsync = !0, isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star), this.parsePropertyName(prop)) : isAsync = !1, this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc), this.finishNode(prop, "Property");
1499
+ };
1500
+ pp$5.parseGetterSetter = function(prop) {
1501
+ prop.kind = prop.key.name, this.parsePropertyName(prop), prop.value = this.parseMethod(!1);
1502
+ var paramCount = prop.kind === "get" ? 0 : 1;
1503
+ if (prop.value.params.length !== paramCount) {
1504
+ var start = prop.value.start;
1505
+ prop.kind === "get" ? this.raiseRecoverable(start, "getter should have no params") : this.raiseRecoverable(start, "setter should have exactly one param");
1506
+ } else
1507
+ prop.kind === "set" && prop.value.params[0].type === "RestElement" && this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params");
1508
+ };
1509
+ pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {
1510
+ (isGenerator || isAsync) && this.type === types$1.colon && this.unexpected(), this.eat(types$1.colon) ? (prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(!1, refDestructuringErrors), prop.kind = "init") : this.options.ecmaVersion >= 6 && this.type === types$1.parenL ? (isPattern && this.unexpected(), prop.kind = "init", prop.method = !0, prop.value = this.parseMethod(isGenerator, isAsync)) : !isPattern && !containsEsc && this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq ? ((isGenerator || isAsync) && this.unexpected(), this.parseGetterSetter(prop)) : this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier" ? ((isGenerator || isAsync) && this.unexpected(), this.checkUnreserved(prop.key), prop.key.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = startPos), prop.kind = "init", isPattern ? prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)) : this.type === types$1.eq && refDestructuringErrors ? (refDestructuringErrors.shorthandAssign < 0 && (refDestructuringErrors.shorthandAssign = this.start), prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key))) : prop.value = this.copyNode(prop.key), prop.shorthand = !0) : this.unexpected();
1511
+ };
1512
+ pp$5.parsePropertyName = function(prop) {
1513
+ if (this.options.ecmaVersion >= 6) {
1514
+ if (this.eat(types$1.bracketL))
1515
+ return prop.computed = !0, prop.key = this.parseMaybeAssign(), this.expect(types$1.bracketR), prop.key;
1516
+ prop.computed = !1;
1517
+ }
1518
+ return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never");
1519
+ };
1520
+ pp$5.initFunction = function(node) {
1521
+ node.id = null, this.options.ecmaVersion >= 6 && (node.generator = node.expression = !1), this.options.ecmaVersion >= 8 && (node.async = !1);
1522
+ };
1523
+ pp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {
1524
+ var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
1525
+ return this.initFunction(node), this.options.ecmaVersion >= 6 && (node.generator = isGenerator), this.options.ecmaVersion >= 8 && (node.async = !!isAsync), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)), this.expect(types$1.parenL), node.params = this.parseBindingList(types$1.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(node, !1, !0, !1), this.yieldPos = oldYieldPos, this.awaitPos = oldAwaitPos, this.awaitIdentPos = oldAwaitIdentPos, this.finishNode(node, "FunctionExpression");
1526
+ };
1527
+ pp$5.parseArrowExpression = function(node, params, isAsync, forInit) {
1528
+ var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
1529
+ return this.enterScope(functionFlags(isAsync, !1) | SCOPE_ARROW), this.initFunction(node), this.options.ecmaVersion >= 8 && (node.async = !!isAsync), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, node.params = this.toAssignableList(params, !0), this.parseFunctionBody(node, !0, !1, forInit), this.yieldPos = oldYieldPos, this.awaitPos = oldAwaitPos, this.awaitIdentPos = oldAwaitIdentPos, this.finishNode(node, "ArrowFunctionExpression");
1530
+ };
1531
+ pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) {
1532
+ var isExpression = isArrowFunction && this.type !== types$1.braceL, oldStrict = this.strict, useStrict = !1;
1533
+ if (isExpression)
1534
+ node.body = this.parseMaybeAssign(forInit), node.expression = !0, this.checkParams(node, !1);
1535
+ else {
1536
+ var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params);
1537
+ (!oldStrict || nonSimple) && (useStrict = this.strictDirective(this.end), useStrict && nonSimple && this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"));
1538
+ var oldLabels = this.labels;
1539
+ this.labels = [], useStrict && (this.strict = !0), this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params)), this.strict && node.id && this.checkLValSimple(node.id, BIND_OUTSIDE), node.body = this.parseBlock(!1, void 0, useStrict && !oldStrict), node.expression = !1, this.adaptDirectivePrologue(node.body.body), this.labels = oldLabels;
1540
+ }
1541
+ this.exitScope();
1542
+ };
1543
+ pp$5.isSimpleParamList = function(params) {
1544
+ for (var i = 0, list = params; i < list.length; i += 1) {
1545
+ var param = list[i];
1546
+ if (param.type !== "Identifier")
1547
+ return !1;
1548
+ }
1549
+ return !0;
1550
+ };
1551
+ pp$5.checkParams = function(node, allowDuplicates) {
1552
+ for (var nameHash = /* @__PURE__ */ Object.create(null), i = 0, list = node.params; i < list.length; i += 1) {
1553
+ var param = list[i];
1554
+ this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash);
1555
+ }
1556
+ };
1557
+ pp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {
1558
+ for (var elts = [], first = !0; !this.eat(close); ) {
1559
+ if (first)
1560
+ first = !1;
1561
+ else if (this.expect(types$1.comma), allowTrailingComma && this.afterTrailingComma(close))
1562
+ break;
1563
+ var elt = void 0;
1564
+ allowEmpty && this.type === types$1.comma ? elt = null : this.type === types$1.ellipsis ? (elt = this.parseSpread(refDestructuringErrors), refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0 && (refDestructuringErrors.trailingComma = this.start)) : elt = this.parseMaybeAssign(!1, refDestructuringErrors), elts.push(elt);
1565
+ }
1566
+ return elts;
1567
+ };
1568
+ pp$5.checkUnreserved = function(ref2) {
1569
+ var start = ref2.start, end = ref2.end, name = ref2.name;
1570
+ if (this.inGenerator && name === "yield" && this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"), this.inAsync && name === "await" && this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"), this.currentThisScope().inClassFieldInit && name === "arguments" && this.raiseRecoverable(start, "Cannot use 'arguments' in class field initializer"), this.inClassStaticBlock && (name === "arguments" || name === "await") && this.raise(start, "Cannot use " + name + " in class static initialization block"), this.keywords.test(name) && this.raise(start, "Unexpected keyword '" + name + "'"), !(this.options.ecmaVersion < 6 && this.input.slice(start, end).indexOf("\\") !== -1)) {
1571
+ var re = this.strict ? this.reservedWordsStrict : this.reservedWords;
1572
+ re.test(name) && (!this.inAsync && name === "await" && this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function"), this.raiseRecoverable(start, "The keyword '" + name + "' is reserved"));
1573
+ }
1574
+ };
1575
+ pp$5.parseIdent = function(liberal) {
1576
+ var node = this.parseIdentNode();
1577
+ return this.next(!!liberal), this.finishNode(node, "Identifier"), liberal || (this.checkUnreserved(node), node.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = node.start)), node;
1578
+ };
1579
+ pp$5.parseIdentNode = function() {
1580
+ var node = this.startNode();
1581
+ return this.type === types$1.name ? node.name = this.value : this.type.keyword ? (node.name = this.type.keyword, (node.name === "class" || node.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46) && this.context.pop(), this.type = types$1.name) : this.unexpected(), node;
1582
+ };
1583
+ pp$5.parsePrivateIdent = function() {
1584
+ var node = this.startNode();
1585
+ return this.type === types$1.privateId ? node.name = this.value : this.unexpected(), this.next(), this.finishNode(node, "PrivateIdentifier"), this.options.checkPrivateFields && (this.privateNameStack.length === 0 ? this.raise(node.start, "Private field '#" + node.name + "' must be declared in an enclosing class") : this.privateNameStack[this.privateNameStack.length - 1].used.push(node)), node;
1586
+ };
1587
+ pp$5.parseYield = function(forInit) {
1588
+ this.yieldPos || (this.yieldPos = this.start);
1589
+ var node = this.startNode();
1590
+ return this.next(), this.type === types$1.semi || this.canInsertSemicolon() || this.type !== types$1.star && !this.type.startsExpr ? (node.delegate = !1, node.argument = null) : (node.delegate = this.eat(types$1.star), node.argument = this.parseMaybeAssign(forInit)), this.finishNode(node, "YieldExpression");
1591
+ };
1592
+ pp$5.parseAwait = function(forInit) {
1593
+ this.awaitPos || (this.awaitPos = this.start);
1594
+ var node = this.startNode();
1595
+ return this.next(), node.argument = this.parseMaybeUnary(null, !0, !1, forInit), this.finishNode(node, "AwaitExpression");
1596
+ };
1597
+ var pp$4 = Parser.prototype;
1598
+ pp$4.raise = function(pos, message) {
1599
+ var loc = getLineInfo(this.input, pos);
1600
+ message += " (" + loc.line + ":" + loc.column + ")";
1601
+ var err = new SyntaxError(message);
1602
+ throw err.pos = pos, err.loc = loc, err.raisedAt = this.pos, err;
1603
+ };
1604
+ pp$4.raiseRecoverable = pp$4.raise;
1605
+ pp$4.curPosition = function() {
1606
+ if (this.options.locations)
1607
+ return new Position(this.curLine, this.pos - this.lineStart);
1608
+ };
1609
+ var pp$3 = Parser.prototype, Scope = function(flags) {
1610
+ this.flags = flags, this.var = [], this.lexical = [], this.functions = [], this.inClassFieldInit = !1;
1611
+ };
1612
+ pp$3.enterScope = function(flags) {
1613
+ this.scopeStack.push(new Scope(flags));
1614
+ };
1615
+ pp$3.exitScope = function() {
1616
+ this.scopeStack.pop();
1617
+ };
1618
+ pp$3.treatFunctionsAsVarInScope = function(scope) {
1619
+ return scope.flags & SCOPE_FUNCTION$1 || !this.inModule && scope.flags & SCOPE_TOP;
1620
+ };
1621
+ pp$3.declareName = function(name, bindingType, pos) {
1622
+ var redeclared = !1;
1623
+ if (bindingType === BIND_LEXICAL) {
1624
+ var scope = this.currentScope();
1625
+ redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1, scope.lexical.push(name), this.inModule && scope.flags & SCOPE_TOP && delete this.undefinedExports[name];
1626
+ } else if (bindingType === BIND_SIMPLE_CATCH) {
1627
+ var scope$1 = this.currentScope();
1628
+ scope$1.lexical.push(name);
1629
+ } else if (bindingType === BIND_FUNCTION) {
1630
+ var scope$2 = this.currentScope();
1631
+ this.treatFunctionsAsVar ? redeclared = scope$2.lexical.indexOf(name) > -1 : redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1, scope$2.functions.push(name);
1632
+ } else
1633
+ for (var i = this.scopeStack.length - 1; i >= 0; --i) {
1634
+ var scope$3 = this.scopeStack[i];
1635
+ if (scope$3.lexical.indexOf(name) > -1 && !(scope$3.flags & SCOPE_SIMPLE_CATCH && scope$3.lexical[0] === name) || !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) {
1636
+ redeclared = !0;
1637
+ break;
1638
+ }
1639
+ if (scope$3.var.push(name), this.inModule && scope$3.flags & SCOPE_TOP && delete this.undefinedExports[name], scope$3.flags & SCOPE_VAR)
1640
+ break;
1641
+ }
1642
+ redeclared && this.raiseRecoverable(pos, "Identifier '" + name + "' has already been declared");
1643
+ };
1644
+ pp$3.checkLocalExport = function(id) {
1645
+ this.scopeStack[0].lexical.indexOf(id.name) === -1 && this.scopeStack[0].var.indexOf(id.name) === -1 && (this.undefinedExports[id.name] = id);
1646
+ };
1647
+ pp$3.currentScope = function() {
1648
+ return this.scopeStack[this.scopeStack.length - 1];
1649
+ };
1650
+ pp$3.currentVarScope = function() {
1651
+ for (var i = this.scopeStack.length - 1; ; i--) {
1652
+ var scope = this.scopeStack[i];
1653
+ if (scope.flags & SCOPE_VAR)
1654
+ return scope;
1655
+ }
1656
+ };
1657
+ pp$3.currentThisScope = function() {
1658
+ for (var i = this.scopeStack.length - 1; ; i--) {
1659
+ var scope = this.scopeStack[i];
1660
+ if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW))
1661
+ return scope;
1662
+ }
1663
+ };
1664
+ var Node = function(parser, pos, loc) {
1665
+ this.type = "", this.start = pos, this.end = 0, parser.options.locations && (this.loc = new SourceLocation(parser, loc)), parser.options.directSourceFile && (this.sourceFile = parser.options.directSourceFile), parser.options.ranges && (this.range = [pos, 0]);
1666
+ }, pp$2 = Parser.prototype;
1667
+ pp$2.startNode = function() {
1668
+ return new Node(this, this.start, this.startLoc);
1669
+ };
1670
+ pp$2.startNodeAt = function(pos, loc) {
1671
+ return new Node(this, pos, loc);
1672
+ };
1673
+ function finishNodeAt(node, type, pos, loc) {
1674
+ return node.type = type, node.end = pos, this.options.locations && (node.loc.end = loc), this.options.ranges && (node.range[1] = pos), node;
1675
+ }
1676
+ pp$2.finishNode = function(node, type) {
1677
+ return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc);
1678
+ };
1679
+ pp$2.finishNodeAt = function(node, type, pos, loc) {
1680
+ return finishNodeAt.call(this, node, type, pos, loc);
1681
+ };
1682
+ pp$2.copyNode = function(node) {
1683
+ var newNode = new Node(this, node.start, this.startLoc);
1684
+ for (var prop in node)
1685
+ newNode[prop] = node[prop];
1686
+ return newNode;
1687
+ };
1688
+ var scriptValuesAddedInUnicode = "Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz", ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS", ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic", ecma11BinaryProperties = ecma10BinaryProperties, ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict", ecma13BinaryProperties = ecma12BinaryProperties, ecma14BinaryProperties = ecma13BinaryProperties, unicodeBinaryProperties = {
1689
+ 9: ecma9BinaryProperties,
1690
+ 10: ecma10BinaryProperties,
1691
+ 11: ecma11BinaryProperties,
1692
+ 12: ecma12BinaryProperties,
1693
+ 13: ecma13BinaryProperties,
1694
+ 14: ecma14BinaryProperties
1695
+ }, ecma14BinaryPropertiesOfStrings = "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji", unicodeBinaryPropertiesOfStrings = {
1696
+ 9: "",
1697
+ 10: "",
1698
+ 11: "",
1699
+ 12: "",
1700
+ 13: "",
1701
+ 14: ecma14BinaryPropertiesOfStrings
1702
+ }, unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu", ecma9ScriptValues = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb", ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd", ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho", ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi", ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith", ecma14ScriptValues = ecma13ScriptValues + " " + scriptValuesAddedInUnicode, unicodeScriptValues = {
1703
+ 9: ecma9ScriptValues,
1704
+ 10: ecma10ScriptValues,
1705
+ 11: ecma11ScriptValues,
1706
+ 12: ecma12ScriptValues,
1707
+ 13: ecma13ScriptValues,
1708
+ 14: ecma14ScriptValues
1709
+ }, data = {};
1710
+ function buildUnicodeData(ecmaVersion) {
1711
+ var d = data[ecmaVersion] = {
1712
+ binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues),
1713
+ binaryOfStrings: wordsRegexp(unicodeBinaryPropertiesOfStrings[ecmaVersion]),
1714
+ nonBinary: {
1715
+ General_Category: wordsRegexp(unicodeGeneralCategoryValues),
1716
+ Script: wordsRegexp(unicodeScriptValues[ecmaVersion])
1717
+ }
1718
+ };
1719
+ d.nonBinary.Script_Extensions = d.nonBinary.Script, d.nonBinary.gc = d.nonBinary.General_Category, d.nonBinary.sc = d.nonBinary.Script, d.nonBinary.scx = d.nonBinary.Script_Extensions;
1720
+ }
1721
+ for (var i = 0, list = [9, 10, 11, 12, 13, 14]; i < list.length; i += 1) {
1722
+ var ecmaVersion = list[i];
1723
+ buildUnicodeData(ecmaVersion);
1724
+ }
1725
+ var pp$1 = Parser.prototype, BranchID = function(parent, base2) {
1726
+ this.parent = parent, this.base = base2 || this;
1727
+ };
1728
+ BranchID.prototype.separatedFrom = function(alt) {
1729
+ for (var self = this; self; self = self.parent)
1730
+ for (var other = alt; other; other = other.parent)
1731
+ if (self.base === other.base && self !== other)
1732
+ return !0;
1733
+ return !1;
1734
+ };
1735
+ BranchID.prototype.sibling = function() {
1736
+ return new BranchID(this.parent, this.base);
1737
+ };
1738
+ var RegExpValidationState = function(parser) {
1739
+ this.parser = parser, this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "") + (parser.options.ecmaVersion >= 15 ? "v" : ""), this.unicodeProperties = data[parser.options.ecmaVersion >= 14 ? 14 : parser.options.ecmaVersion], this.source = "", this.flags = "", this.start = 0, this.switchU = !1, this.switchV = !1, this.switchN = !1, this.pos = 0, this.lastIntValue = 0, this.lastStringValue = "", this.lastAssertionIsQuantifiable = !1, this.numCapturingParens = 0, this.maxBackReference = 0, this.groupNames = /* @__PURE__ */ Object.create(null), this.backReferenceNames = [], this.branchID = null;
1740
+ };
1741
+ RegExpValidationState.prototype.reset = function(start, pattern, flags) {
1742
+ var unicodeSets = flags.indexOf("v") !== -1, unicode = flags.indexOf("u") !== -1;
1743
+ this.start = start | 0, this.source = pattern + "", this.flags = flags, unicodeSets && this.parser.options.ecmaVersion >= 15 ? (this.switchU = !0, this.switchV = !0, this.switchN = !0) : (this.switchU = unicode && this.parser.options.ecmaVersion >= 6, this.switchV = !1, this.switchN = unicode && this.parser.options.ecmaVersion >= 9);
1744
+ };
1745
+ RegExpValidationState.prototype.raise = function(message) {
1746
+ this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + message);
1747
+ };
1748
+ RegExpValidationState.prototype.at = function(i, forceU) {
1749
+ forceU === void 0 && (forceU = !1);
1750
+ var s = this.source, l = s.length;
1751
+ if (i >= l)
1752
+ return -1;
1753
+ var c = s.charCodeAt(i);
1754
+ if (!(forceU || this.switchU) || c <= 55295 || c >= 57344 || i + 1 >= l)
1755
+ return c;
1756
+ var next = s.charCodeAt(i + 1);
1757
+ return next >= 56320 && next <= 57343 ? (c << 10) + next - 56613888 : c;
1758
+ };
1759
+ RegExpValidationState.prototype.nextIndex = function(i, forceU) {
1760
+ forceU === void 0 && (forceU = !1);
1761
+ var s = this.source, l = s.length;
1762
+ if (i >= l)
1763
+ return l;
1764
+ var c = s.charCodeAt(i), next;
1765
+ return !(forceU || this.switchU) || c <= 55295 || c >= 57344 || i + 1 >= l || (next = s.charCodeAt(i + 1)) < 56320 || next > 57343 ? i + 1 : i + 2;
1766
+ };
1767
+ RegExpValidationState.prototype.current = function(forceU) {
1768
+ return forceU === void 0 && (forceU = !1), this.at(this.pos, forceU);
1769
+ };
1770
+ RegExpValidationState.prototype.lookahead = function(forceU) {
1771
+ return forceU === void 0 && (forceU = !1), this.at(this.nextIndex(this.pos, forceU), forceU);
1772
+ };
1773
+ RegExpValidationState.prototype.advance = function(forceU) {
1774
+ forceU === void 0 && (forceU = !1), this.pos = this.nextIndex(this.pos, forceU);
1775
+ };
1776
+ RegExpValidationState.prototype.eat = function(ch, forceU) {
1777
+ return forceU === void 0 && (forceU = !1), this.current(forceU) === ch ? (this.advance(forceU), !0) : !1;
1778
+ };
1779
+ RegExpValidationState.prototype.eatChars = function(chs, forceU) {
1780
+ forceU === void 0 && (forceU = !1);
1781
+ for (var pos = this.pos, i = 0, list = chs; i < list.length; i += 1) {
1782
+ var ch = list[i], current2 = this.at(pos, forceU);
1783
+ if (current2 === -1 || current2 !== ch)
1784
+ return !1;
1785
+ pos = this.nextIndex(pos, forceU);
1786
+ }
1787
+ return this.pos = pos, !0;
1788
+ };
1789
+ pp$1.validateRegExpFlags = function(state) {
1790
+ for (var validFlags = state.validFlags, flags = state.flags, u = !1, v = !1, i = 0; i < flags.length; i++) {
1791
+ var flag = flags.charAt(i);
1792
+ validFlags.indexOf(flag) === -1 && this.raise(state.start, "Invalid regular expression flag"), flags.indexOf(flag, i + 1) > -1 && this.raise(state.start, "Duplicate regular expression flag"), flag === "u" && (u = !0), flag === "v" && (v = !0);
1793
+ }
1794
+ this.options.ecmaVersion >= 15 && u && v && this.raise(state.start, "Invalid regular expression flag");
1795
+ };
1796
+ function hasProp(obj) {
1797
+ for (var _ in obj)
1798
+ return !0;
1799
+ return !1;
1800
+ }
1801
+ pp$1.validateRegExpPattern = function(state) {
1802
+ this.regexp_pattern(state), !state.switchN && this.options.ecmaVersion >= 9 && hasProp(state.groupNames) && (state.switchN = !0, this.regexp_pattern(state));
1803
+ };
1804
+ pp$1.regexp_pattern = function(state) {
1805
+ state.pos = 0, state.lastIntValue = 0, state.lastStringValue = "", state.lastAssertionIsQuantifiable = !1, state.numCapturingParens = 0, state.maxBackReference = 0, state.groupNames = /* @__PURE__ */ Object.create(null), state.backReferenceNames.length = 0, state.branchID = null, this.regexp_disjunction(state), state.pos !== state.source.length && (state.eat(
1806
+ 41
1807
+ /* ) */
1808
+ ) && state.raise("Unmatched ')'"), (state.eat(
1809
+ 93
1810
+ /* ] */
1811
+ ) || state.eat(
1812
+ 125
1813
+ /* } */
1814
+ )) && state.raise("Lone quantifier brackets")), state.maxBackReference > state.numCapturingParens && state.raise("Invalid escape");
1815
+ for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) {
1816
+ var name = list[i];
1817
+ state.groupNames[name] || state.raise("Invalid named capture referenced");
1818
+ }
1819
+ };
1820
+ pp$1.regexp_disjunction = function(state) {
1821
+ var trackDisjunction = this.options.ecmaVersion >= 16;
1822
+ for (trackDisjunction && (state.branchID = new BranchID(state.branchID, null)), this.regexp_alternative(state); state.eat(
1823
+ 124
1824
+ /* | */
1825
+ ); )
1826
+ trackDisjunction && (state.branchID = state.branchID.sibling()), this.regexp_alternative(state);
1827
+ trackDisjunction && (state.branchID = state.branchID.parent), this.regexp_eatQuantifier(state, !0) && state.raise("Nothing to repeat"), state.eat(
1828
+ 123
1829
+ /* { */
1830
+ ) && state.raise("Lone quantifier brackets");
1831
+ };
1832
+ pp$1.regexp_alternative = function(state) {
1833
+ for (; state.pos < state.source.length && this.regexp_eatTerm(state); )
1834
+ ;
1835
+ };
1836
+ pp$1.regexp_eatTerm = function(state) {
1837
+ return this.regexp_eatAssertion(state) ? (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state) && state.switchU && state.raise("Invalid quantifier"), !0) : (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) ? (this.regexp_eatQuantifier(state), !0) : !1;
1838
+ };
1839
+ pp$1.regexp_eatAssertion = function(state) {
1840
+ var start = state.pos;
1841
+ if (state.lastAssertionIsQuantifiable = !1, state.eat(
1842
+ 94
1843
+ /* ^ */
1844
+ ) || state.eat(
1845
+ 36
1846
+ /* $ */
1847
+ ))
1848
+ return !0;
1849
+ if (state.eat(
1850
+ 92
1851
+ /* \ */
1852
+ )) {
1853
+ if (state.eat(
1854
+ 66
1855
+ /* B */
1856
+ ) || state.eat(
1857
+ 98
1858
+ /* b */
1859
+ ))
1860
+ return !0;
1861
+ state.pos = start;
1862
+ }
1863
+ if (state.eat(
1864
+ 40
1865
+ /* ( */
1866
+ ) && state.eat(
1867
+ 63
1868
+ /* ? */
1869
+ )) {
1870
+ var lookbehind = !1;
1871
+ if (this.options.ecmaVersion >= 9 && (lookbehind = state.eat(
1872
+ 60
1873
+ /* < */
1874
+ )), state.eat(
1875
+ 61
1876
+ /* = */
1877
+ ) || state.eat(
1878
+ 33
1879
+ /* ! */
1880
+ ))
1881
+ return this.regexp_disjunction(state), state.eat(
1882
+ 41
1883
+ /* ) */
1884
+ ) || state.raise("Unterminated group"), state.lastAssertionIsQuantifiable = !lookbehind, !0;
1885
+ }
1886
+ return state.pos = start, !1;
1887
+ };
1888
+ pp$1.regexp_eatQuantifier = function(state, noError) {
1889
+ return noError === void 0 && (noError = !1), this.regexp_eatQuantifierPrefix(state, noError) ? (state.eat(
1890
+ 63
1891
+ /* ? */
1892
+ ), !0) : !1;
1893
+ };
1894
+ pp$1.regexp_eatQuantifierPrefix = function(state, noError) {
1895
+ return state.eat(
1896
+ 42
1897
+ /* * */
1898
+ ) || state.eat(
1899
+ 43
1900
+ /* + */
1901
+ ) || state.eat(
1902
+ 63
1903
+ /* ? */
1904
+ ) || this.regexp_eatBracedQuantifier(state, noError);
1905
+ };
1906
+ pp$1.regexp_eatBracedQuantifier = function(state, noError) {
1907
+ var start = state.pos;
1908
+ if (state.eat(
1909
+ 123
1910
+ /* { */
1911
+ )) {
1912
+ var min = 0, max = -1;
1913
+ if (this.regexp_eatDecimalDigits(state) && (min = state.lastIntValue, state.eat(
1914
+ 44
1915
+ /* , */
1916
+ ) && this.regexp_eatDecimalDigits(state) && (max = state.lastIntValue), state.eat(
1917
+ 125
1918
+ /* } */
1919
+ )))
1920
+ return max !== -1 && max < min && !noError && state.raise("numbers out of order in {} quantifier"), !0;
1921
+ state.switchU && !noError && state.raise("Incomplete quantifier"), state.pos = start;
1922
+ }
1923
+ return !1;
1924
+ };
1925
+ pp$1.regexp_eatAtom = function(state) {
1926
+ return this.regexp_eatPatternCharacters(state) || state.eat(
1927
+ 46
1928
+ /* . */
1929
+ ) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state);
1930
+ };
1931
+ pp$1.regexp_eatReverseSolidusAtomEscape = function(state) {
1932
+ var start = state.pos;
1933
+ if (state.eat(
1934
+ 92
1935
+ /* \ */
1936
+ )) {
1937
+ if (this.regexp_eatAtomEscape(state))
1938
+ return !0;
1939
+ state.pos = start;
1940
+ }
1941
+ return !1;
1942
+ };
1943
+ pp$1.regexp_eatUncapturingGroup = function(state) {
1944
+ var start = state.pos;
1945
+ if (state.eat(
1946
+ 40
1947
+ /* ( */
1948
+ )) {
1949
+ if (state.eat(
1950
+ 63
1951
+ /* ? */
1952
+ )) {
1953
+ if (this.options.ecmaVersion >= 16) {
1954
+ var addModifiers = this.regexp_eatModifiers(state), hasHyphen = state.eat(
1955
+ 45
1956
+ /* - */
1957
+ );
1958
+ if (addModifiers || hasHyphen) {
1959
+ for (var i = 0; i < addModifiers.length; i++) {
1960
+ var modifier = addModifiers.charAt(i);
1961
+ addModifiers.indexOf(modifier, i + 1) > -1 && state.raise("Duplicate regular expression modifiers");
1962
+ }
1963
+ if (hasHyphen) {
1964
+ var removeModifiers = this.regexp_eatModifiers(state);
1965
+ !addModifiers && !removeModifiers && state.current() === 58 && state.raise("Invalid regular expression modifiers");
1966
+ for (var i$1 = 0; i$1 < removeModifiers.length; i$1++) {
1967
+ var modifier$1 = removeModifiers.charAt(i$1);
1968
+ (removeModifiers.indexOf(modifier$1, i$1 + 1) > -1 || addModifiers.indexOf(modifier$1) > -1) && state.raise("Duplicate regular expression modifiers");
1969
+ }
1970
+ }
1971
+ }
1972
+ }
1973
+ if (state.eat(
1974
+ 58
1975
+ /* : */
1976
+ )) {
1977
+ if (this.regexp_disjunction(state), state.eat(
1978
+ 41
1979
+ /* ) */
1980
+ ))
1981
+ return !0;
1982
+ state.raise("Unterminated group");
1983
+ }
1984
+ }
1985
+ state.pos = start;
1986
+ }
1987
+ return !1;
1988
+ };
1989
+ pp$1.regexp_eatCapturingGroup = function(state) {
1990
+ if (state.eat(
1991
+ 40
1992
+ /* ( */
1993
+ )) {
1994
+ if (this.options.ecmaVersion >= 9 ? this.regexp_groupSpecifier(state) : state.current() === 63 && state.raise("Invalid group"), this.regexp_disjunction(state), state.eat(
1995
+ 41
1996
+ /* ) */
1997
+ ))
1998
+ return state.numCapturingParens += 1, !0;
1999
+ state.raise("Unterminated group");
2000
+ }
2001
+ return !1;
2002
+ };
2003
+ pp$1.regexp_eatModifiers = function(state) {
2004
+ for (var modifiers = "", ch = 0; (ch = state.current()) !== -1 && isRegularExpressionModifier(ch); )
2005
+ modifiers += codePointToString(ch), state.advance();
2006
+ return modifiers;
2007
+ };
2008
+ function isRegularExpressionModifier(ch) {
2009
+ return ch === 105 || ch === 109 || ch === 115;
2010
+ }
2011
+ pp$1.regexp_eatExtendedAtom = function(state) {
2012
+ return state.eat(
2013
+ 46
2014
+ /* . */
2015
+ ) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state) || this.regexp_eatInvalidBracedQuantifier(state) || this.regexp_eatExtendedPatternCharacter(state);
2016
+ };
2017
+ pp$1.regexp_eatInvalidBracedQuantifier = function(state) {
2018
+ return this.regexp_eatBracedQuantifier(state, !0) && state.raise("Nothing to repeat"), !1;
2019
+ };
2020
+ pp$1.regexp_eatSyntaxCharacter = function(state) {
2021
+ var ch = state.current();
2022
+ return isSyntaxCharacter(ch) ? (state.lastIntValue = ch, state.advance(), !0) : !1;
2023
+ };
2024
+ function isSyntaxCharacter(ch) {
2025
+ return ch === 36 || ch >= 40 && ch <= 43 || ch === 46 || ch === 63 || ch >= 91 && ch <= 94 || ch >= 123 && ch <= 125;
2026
+ }
2027
+ pp$1.regexp_eatPatternCharacters = function(state) {
2028
+ for (var start = state.pos, ch = 0; (ch = state.current()) !== -1 && !isSyntaxCharacter(ch); )
2029
+ state.advance();
2030
+ return state.pos !== start;
2031
+ };
2032
+ pp$1.regexp_eatExtendedPatternCharacter = function(state) {
2033
+ var ch = state.current();
2034
+ return ch !== -1 && ch !== 36 && !(ch >= 40 && ch <= 43) && ch !== 46 && ch !== 63 && ch !== 91 && ch !== 94 && ch !== 124 ? (state.advance(), !0) : !1;
2035
+ };
2036
+ pp$1.regexp_groupSpecifier = function(state) {
2037
+ if (state.eat(
2038
+ 63
2039
+ /* ? */
2040
+ )) {
2041
+ this.regexp_eatGroupName(state) || state.raise("Invalid group");
2042
+ var trackDisjunction = this.options.ecmaVersion >= 16, known = state.groupNames[state.lastStringValue];
2043
+ if (known)
2044
+ if (trackDisjunction)
2045
+ for (var i = 0, list = known; i < list.length; i += 1) {
2046
+ var altID = list[i];
2047
+ altID.separatedFrom(state.branchID) || state.raise("Duplicate capture group name");
2048
+ }
2049
+ else
2050
+ state.raise("Duplicate capture group name");
2051
+ trackDisjunction ? (known || (state.groupNames[state.lastStringValue] = [])).push(state.branchID) : state.groupNames[state.lastStringValue] = !0;
2052
+ }
2053
+ };
2054
+ pp$1.regexp_eatGroupName = function(state) {
2055
+ if (state.lastStringValue = "", state.eat(
2056
+ 60
2057
+ /* < */
2058
+ )) {
2059
+ if (this.regexp_eatRegExpIdentifierName(state) && state.eat(
2060
+ 62
2061
+ /* > */
2062
+ ))
2063
+ return !0;
2064
+ state.raise("Invalid capture group name");
2065
+ }
2066
+ return !1;
2067
+ };
2068
+ pp$1.regexp_eatRegExpIdentifierName = function(state) {
2069
+ if (state.lastStringValue = "", this.regexp_eatRegExpIdentifierStart(state)) {
2070
+ for (state.lastStringValue += codePointToString(state.lastIntValue); this.regexp_eatRegExpIdentifierPart(state); )
2071
+ state.lastStringValue += codePointToString(state.lastIntValue);
2072
+ return !0;
2073
+ }
2074
+ return !1;
2075
+ };
2076
+ pp$1.regexp_eatRegExpIdentifierStart = function(state) {
2077
+ var start = state.pos, forceU = this.options.ecmaVersion >= 11, ch = state.current(forceU);
2078
+ return state.advance(forceU), ch === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU) && (ch = state.lastIntValue), isRegExpIdentifierStart(ch) ? (state.lastIntValue = ch, !0) : (state.pos = start, !1);
2079
+ };
2080
+ function isRegExpIdentifierStart(ch) {
2081
+ return isIdentifierStart(ch, !0) || ch === 36 || ch === 95;
2082
+ }
2083
+ pp$1.regexp_eatRegExpIdentifierPart = function(state) {
2084
+ var start = state.pos, forceU = this.options.ecmaVersion >= 11, ch = state.current(forceU);
2085
+ return state.advance(forceU), ch === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU) && (ch = state.lastIntValue), isRegExpIdentifierPart(ch) ? (state.lastIntValue = ch, !0) : (state.pos = start, !1);
2086
+ };
2087
+ function isRegExpIdentifierPart(ch) {
2088
+ return isIdentifierChar(ch, !0) || ch === 36 || ch === 95 || ch === 8204 || ch === 8205;
2089
+ }
2090
+ pp$1.regexp_eatAtomEscape = function(state) {
2091
+ return this.regexp_eatBackReference(state) || this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state) || state.switchN && this.regexp_eatKGroupName(state) ? !0 : (state.switchU && (state.current() === 99 && state.raise("Invalid unicode escape"), state.raise("Invalid escape")), !1);
2092
+ };
2093
+ pp$1.regexp_eatBackReference = function(state) {
2094
+ var start = state.pos;
2095
+ if (this.regexp_eatDecimalEscape(state)) {
2096
+ var n = state.lastIntValue;
2097
+ if (state.switchU)
2098
+ return n > state.maxBackReference && (state.maxBackReference = n), !0;
2099
+ if (n <= state.numCapturingParens)
2100
+ return !0;
2101
+ state.pos = start;
2102
+ }
2103
+ return !1;
2104
+ };
2105
+ pp$1.regexp_eatKGroupName = function(state) {
2106
+ if (state.eat(
2107
+ 107
2108
+ /* k */
2109
+ )) {
2110
+ if (this.regexp_eatGroupName(state))
2111
+ return state.backReferenceNames.push(state.lastStringValue), !0;
2112
+ state.raise("Invalid named reference");
2113
+ }
2114
+ return !1;
2115
+ };
2116
+ pp$1.regexp_eatCharacterEscape = function(state) {
2117
+ return this.regexp_eatControlEscape(state) || this.regexp_eatCControlLetter(state) || this.regexp_eatZero(state) || this.regexp_eatHexEscapeSequence(state) || this.regexp_eatRegExpUnicodeEscapeSequence(state, !1) || !state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state) || this.regexp_eatIdentityEscape(state);
2118
+ };
2119
+ pp$1.regexp_eatCControlLetter = function(state) {
2120
+ var start = state.pos;
2121
+ if (state.eat(
2122
+ 99
2123
+ /* c */
2124
+ )) {
2125
+ if (this.regexp_eatControlLetter(state))
2126
+ return !0;
2127
+ state.pos = start;
2128
+ }
2129
+ return !1;
2130
+ };
2131
+ pp$1.regexp_eatZero = function(state) {
2132
+ return state.current() === 48 && !isDecimalDigit(state.lookahead()) ? (state.lastIntValue = 0, state.advance(), !0) : !1;
2133
+ };
2134
+ pp$1.regexp_eatControlEscape = function(state) {
2135
+ var ch = state.current();
2136
+ return ch === 116 ? (state.lastIntValue = 9, state.advance(), !0) : ch === 110 ? (state.lastIntValue = 10, state.advance(), !0) : ch === 118 ? (state.lastIntValue = 11, state.advance(), !0) : ch === 102 ? (state.lastIntValue = 12, state.advance(), !0) : ch === 114 ? (state.lastIntValue = 13, state.advance(), !0) : !1;
2137
+ };
2138
+ pp$1.regexp_eatControlLetter = function(state) {
2139
+ var ch = state.current();
2140
+ return isControlLetter(ch) ? (state.lastIntValue = ch % 32, state.advance(), !0) : !1;
2141
+ };
2142
+ function isControlLetter(ch) {
2143
+ return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122;
2144
+ }
2145
+ pp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) {
2146
+ forceU === void 0 && (forceU = !1);
2147
+ var start = state.pos, switchU = forceU || state.switchU;
2148
+ if (state.eat(
2149
+ 117
2150
+ /* u */
2151
+ )) {
2152
+ if (this.regexp_eatFixedHexDigits(state, 4)) {
2153
+ var lead = state.lastIntValue;
2154
+ if (switchU && lead >= 55296 && lead <= 56319) {
2155
+ var leadSurrogateEnd = state.pos;
2156
+ if (state.eat(
2157
+ 92
2158
+ /* \ */
2159
+ ) && state.eat(
2160
+ 117
2161
+ /* u */
2162
+ ) && this.regexp_eatFixedHexDigits(state, 4)) {
2163
+ var trail = state.lastIntValue;
2164
+ if (trail >= 56320 && trail <= 57343)
2165
+ return state.lastIntValue = (lead - 55296) * 1024 + (trail - 56320) + 65536, !0;
2166
+ }
2167
+ state.pos = leadSurrogateEnd, state.lastIntValue = lead;
2168
+ }
2169
+ return !0;
2170
+ }
2171
+ if (switchU && state.eat(
2172
+ 123
2173
+ /* { */
2174
+ ) && this.regexp_eatHexDigits(state) && state.eat(
2175
+ 125
2176
+ /* } */
2177
+ ) && isValidUnicode(state.lastIntValue))
2178
+ return !0;
2179
+ switchU && state.raise("Invalid unicode escape"), state.pos = start;
2180
+ }
2181
+ return !1;
2182
+ };
2183
+ function isValidUnicode(ch) {
2184
+ return ch >= 0 && ch <= 1114111;
2185
+ }
2186
+ pp$1.regexp_eatIdentityEscape = function(state) {
2187
+ if (state.switchU)
2188
+ return this.regexp_eatSyntaxCharacter(state) ? !0 : state.eat(
2189
+ 47
2190
+ /* / */
2191
+ ) ? (state.lastIntValue = 47, !0) : !1;
2192
+ var ch = state.current();
2193
+ return ch !== 99 && (!state.switchN || ch !== 107) ? (state.lastIntValue = ch, state.advance(), !0) : !1;
2194
+ };
2195
+ pp$1.regexp_eatDecimalEscape = function(state) {
2196
+ state.lastIntValue = 0;
2197
+ var ch = state.current();
2198
+ if (ch >= 49 && ch <= 57) {
2199
+ do
2200
+ state.lastIntValue = 10 * state.lastIntValue + (ch - 48), state.advance();
2201
+ while ((ch = state.current()) >= 48 && ch <= 57);
2202
+ return !0;
2203
+ }
2204
+ return !1;
2205
+ };
2206
+ var CharSetNone = 0, CharSetOk = 1, CharSetString = 2;
2207
+ pp$1.regexp_eatCharacterClassEscape = function(state) {
2208
+ var ch = state.current();
2209
+ if (isCharacterClassEscape(ch))
2210
+ return state.lastIntValue = -1, state.advance(), CharSetOk;
2211
+ var negate = !1;
2212
+ if (state.switchU && this.options.ecmaVersion >= 9 && ((negate = ch === 80) || ch === 112)) {
2213
+ state.lastIntValue = -1, state.advance();
2214
+ var result;
2215
+ if (state.eat(
2216
+ 123
2217
+ /* { */
2218
+ ) && (result = this.regexp_eatUnicodePropertyValueExpression(state)) && state.eat(
2219
+ 125
2220
+ /* } */
2221
+ ))
2222
+ return negate && result === CharSetString && state.raise("Invalid property name"), result;
2223
+ state.raise("Invalid property name");
2224
+ }
2225
+ return CharSetNone;
2226
+ };
2227
+ function isCharacterClassEscape(ch) {
2228
+ return ch === 100 || ch === 68 || ch === 115 || ch === 83 || ch === 119 || ch === 87;
2229
+ }
2230
+ pp$1.regexp_eatUnicodePropertyValueExpression = function(state) {
2231
+ var start = state.pos;
2232
+ if (this.regexp_eatUnicodePropertyName(state) && state.eat(
2233
+ 61
2234
+ /* = */
2235
+ )) {
2236
+ var name = state.lastStringValue;
2237
+ if (this.regexp_eatUnicodePropertyValue(state)) {
2238
+ var value = state.lastStringValue;
2239
+ return this.regexp_validateUnicodePropertyNameAndValue(state, name, value), CharSetOk;
2240
+ }
2241
+ }
2242
+ if (state.pos = start, this.regexp_eatLoneUnicodePropertyNameOrValue(state)) {
2243
+ var nameOrValue = state.lastStringValue;
2244
+ return this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue);
2245
+ }
2246
+ return CharSetNone;
2247
+ };
2248
+ pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {
2249
+ hasOwn(state.unicodeProperties.nonBinary, name) || state.raise("Invalid property name"), state.unicodeProperties.nonBinary[name].test(value) || state.raise("Invalid property value");
2250
+ };
2251
+ pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) {
2252
+ if (state.unicodeProperties.binary.test(nameOrValue))
2253
+ return CharSetOk;
2254
+ if (state.switchV && state.unicodeProperties.binaryOfStrings.test(nameOrValue))
2255
+ return CharSetString;
2256
+ state.raise("Invalid property name");
2257
+ };
2258
+ pp$1.regexp_eatUnicodePropertyName = function(state) {
2259
+ var ch = 0;
2260
+ for (state.lastStringValue = ""; isUnicodePropertyNameCharacter(ch = state.current()); )
2261
+ state.lastStringValue += codePointToString(ch), state.advance();
2262
+ return state.lastStringValue !== "";
2263
+ };
2264
+ function isUnicodePropertyNameCharacter(ch) {
2265
+ return isControlLetter(ch) || ch === 95;
2266
+ }
2267
+ pp$1.regexp_eatUnicodePropertyValue = function(state) {
2268
+ var ch = 0;
2269
+ for (state.lastStringValue = ""; isUnicodePropertyValueCharacter(ch = state.current()); )
2270
+ state.lastStringValue += codePointToString(ch), state.advance();
2271
+ return state.lastStringValue !== "";
2272
+ };
2273
+ function isUnicodePropertyValueCharacter(ch) {
2274
+ return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch);
2275
+ }
2276
+ pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) {
2277
+ return this.regexp_eatUnicodePropertyValue(state);
2278
+ };
2279
+ pp$1.regexp_eatCharacterClass = function(state) {
2280
+ if (state.eat(
2281
+ 91
2282
+ /* [ */
2283
+ )) {
2284
+ var negate = state.eat(
2285
+ 94
2286
+ /* ^ */
2287
+ ), result = this.regexp_classContents(state);
2288
+ return state.eat(
2289
+ 93
2290
+ /* ] */
2291
+ ) || state.raise("Unterminated character class"), negate && result === CharSetString && state.raise("Negated character class may contain strings"), !0;
2292
+ }
2293
+ return !1;
2294
+ };
2295
+ pp$1.regexp_classContents = function(state) {
2296
+ return state.current() === 93 ? CharSetOk : state.switchV ? this.regexp_classSetExpression(state) : (this.regexp_nonEmptyClassRanges(state), CharSetOk);
2297
+ };
2298
+ pp$1.regexp_nonEmptyClassRanges = function(state) {
2299
+ for (; this.regexp_eatClassAtom(state); ) {
2300
+ var left = state.lastIntValue;
2301
+ if (state.eat(
2302
+ 45
2303
+ /* - */
2304
+ ) && this.regexp_eatClassAtom(state)) {
2305
+ var right = state.lastIntValue;
2306
+ state.switchU && (left === -1 || right === -1) && state.raise("Invalid character class"), left !== -1 && right !== -1 && left > right && state.raise("Range out of order in character class");
2307
+ }
2308
+ }
2309
+ };
2310
+ pp$1.regexp_eatClassAtom = function(state) {
2311
+ var start = state.pos;
2312
+ if (state.eat(
2313
+ 92
2314
+ /* \ */
2315
+ )) {
2316
+ if (this.regexp_eatClassEscape(state))
2317
+ return !0;
2318
+ if (state.switchU) {
2319
+ var ch$1 = state.current();
2320
+ (ch$1 === 99 || isOctalDigit(ch$1)) && state.raise("Invalid class escape"), state.raise("Invalid escape");
2321
+ }
2322
+ state.pos = start;
2323
+ }
2324
+ var ch = state.current();
2325
+ return ch !== 93 ? (state.lastIntValue = ch, state.advance(), !0) : !1;
2326
+ };
2327
+ pp$1.regexp_eatClassEscape = function(state) {
2328
+ var start = state.pos;
2329
+ if (state.eat(
2330
+ 98
2331
+ /* b */
2332
+ ))
2333
+ return state.lastIntValue = 8, !0;
2334
+ if (state.switchU && state.eat(
2335
+ 45
2336
+ /* - */
2337
+ ))
2338
+ return state.lastIntValue = 45, !0;
2339
+ if (!state.switchU && state.eat(
2340
+ 99
2341
+ /* c */
2342
+ )) {
2343
+ if (this.regexp_eatClassControlLetter(state))
2344
+ return !0;
2345
+ state.pos = start;
2346
+ }
2347
+ return this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state);
2348
+ };
2349
+ pp$1.regexp_classSetExpression = function(state) {
2350
+ var result = CharSetOk, subResult;
2351
+ if (!this.regexp_eatClassSetRange(state)) if (subResult = this.regexp_eatClassSetOperand(state)) {
2352
+ subResult === CharSetString && (result = CharSetString);
2353
+ for (var start = state.pos; state.eatChars(
2354
+ [38, 38]
2355
+ /* && */
2356
+ ); ) {
2357
+ if (state.current() !== 38 && (subResult = this.regexp_eatClassSetOperand(state))) {
2358
+ subResult !== CharSetString && (result = CharSetOk);
2359
+ continue;
2360
+ }
2361
+ state.raise("Invalid character in character class");
2362
+ }
2363
+ if (start !== state.pos)
2364
+ return result;
2365
+ for (; state.eatChars(
2366
+ [45, 45]
2367
+ /* -- */
2368
+ ); )
2369
+ this.regexp_eatClassSetOperand(state) || state.raise("Invalid character in character class");
2370
+ if (start !== state.pos)
2371
+ return result;
2372
+ } else
2373
+ state.raise("Invalid character in character class");
2374
+ for (; ; )
2375
+ if (!this.regexp_eatClassSetRange(state)) {
2376
+ if (subResult = this.regexp_eatClassSetOperand(state), !subResult)
2377
+ return result;
2378
+ subResult === CharSetString && (result = CharSetString);
2379
+ }
2380
+ };
2381
+ pp$1.regexp_eatClassSetRange = function(state) {
2382
+ var start = state.pos;
2383
+ if (this.regexp_eatClassSetCharacter(state)) {
2384
+ var left = state.lastIntValue;
2385
+ if (state.eat(
2386
+ 45
2387
+ /* - */
2388
+ ) && this.regexp_eatClassSetCharacter(state)) {
2389
+ var right = state.lastIntValue;
2390
+ return left !== -1 && right !== -1 && left > right && state.raise("Range out of order in character class"), !0;
2391
+ }
2392
+ state.pos = start;
2393
+ }
2394
+ return !1;
2395
+ };
2396
+ pp$1.regexp_eatClassSetOperand = function(state) {
2397
+ return this.regexp_eatClassSetCharacter(state) ? CharSetOk : this.regexp_eatClassStringDisjunction(state) || this.regexp_eatNestedClass(state);
2398
+ };
2399
+ pp$1.regexp_eatNestedClass = function(state) {
2400
+ var start = state.pos;
2401
+ if (state.eat(
2402
+ 91
2403
+ /* [ */
2404
+ )) {
2405
+ var negate = state.eat(
2406
+ 94
2407
+ /* ^ */
2408
+ ), result = this.regexp_classContents(state);
2409
+ if (state.eat(
2410
+ 93
2411
+ /* ] */
2412
+ ))
2413
+ return negate && result === CharSetString && state.raise("Negated character class may contain strings"), result;
2414
+ state.pos = start;
2415
+ }
2416
+ if (state.eat(
2417
+ 92
2418
+ /* \ */
2419
+ )) {
2420
+ var result$1 = this.regexp_eatCharacterClassEscape(state);
2421
+ if (result$1)
2422
+ return result$1;
2423
+ state.pos = start;
2424
+ }
2425
+ return null;
2426
+ };
2427
+ pp$1.regexp_eatClassStringDisjunction = function(state) {
2428
+ var start = state.pos;
2429
+ if (state.eatChars(
2430
+ [92, 113]
2431
+ /* \q */
2432
+ )) {
2433
+ if (state.eat(
2434
+ 123
2435
+ /* { */
2436
+ )) {
2437
+ var result = this.regexp_classStringDisjunctionContents(state);
2438
+ if (state.eat(
2439
+ 125
2440
+ /* } */
2441
+ ))
2442
+ return result;
2443
+ } else
2444
+ state.raise("Invalid escape");
2445
+ state.pos = start;
2446
+ }
2447
+ return null;
2448
+ };
2449
+ pp$1.regexp_classStringDisjunctionContents = function(state) {
2450
+ for (var result = this.regexp_classString(state); state.eat(
2451
+ 124
2452
+ /* | */
2453
+ ); )
2454
+ this.regexp_classString(state) === CharSetString && (result = CharSetString);
2455
+ return result;
2456
+ };
2457
+ pp$1.regexp_classString = function(state) {
2458
+ for (var count = 0; this.regexp_eatClassSetCharacter(state); )
2459
+ count++;
2460
+ return count === 1 ? CharSetOk : CharSetString;
2461
+ };
2462
+ pp$1.regexp_eatClassSetCharacter = function(state) {
2463
+ var start = state.pos;
2464
+ if (state.eat(
2465
+ 92
2466
+ /* \ */
2467
+ ))
2468
+ return this.regexp_eatCharacterEscape(state) || this.regexp_eatClassSetReservedPunctuator(state) ? !0 : state.eat(
2469
+ 98
2470
+ /* b */
2471
+ ) ? (state.lastIntValue = 8, !0) : (state.pos = start, !1);
2472
+ var ch = state.current();
2473
+ return ch < 0 || ch === state.lookahead() && isClassSetReservedDoublePunctuatorCharacter(ch) || isClassSetSyntaxCharacter(ch) ? !1 : (state.advance(), state.lastIntValue = ch, !0);
2474
+ };
2475
+ function isClassSetReservedDoublePunctuatorCharacter(ch) {
2476
+ return ch === 33 || ch >= 35 && ch <= 38 || ch >= 42 && ch <= 44 || ch === 46 || ch >= 58 && ch <= 64 || ch === 94 || ch === 96 || ch === 126;
2477
+ }
2478
+ function isClassSetSyntaxCharacter(ch) {
2479
+ return ch === 40 || ch === 41 || ch === 45 || ch === 47 || ch >= 91 && ch <= 93 || ch >= 123 && ch <= 125;
2480
+ }
2481
+ pp$1.regexp_eatClassSetReservedPunctuator = function(state) {
2482
+ var ch = state.current();
2483
+ return isClassSetReservedPunctuator(ch) ? (state.lastIntValue = ch, state.advance(), !0) : !1;
2484
+ };
2485
+ function isClassSetReservedPunctuator(ch) {
2486
+ return ch === 33 || ch === 35 || ch === 37 || ch === 38 || ch === 44 || ch === 45 || ch >= 58 && ch <= 62 || ch === 64 || ch === 96 || ch === 126;
2487
+ }
2488
+ pp$1.regexp_eatClassControlLetter = function(state) {
2489
+ var ch = state.current();
2490
+ return isDecimalDigit(ch) || ch === 95 ? (state.lastIntValue = ch % 32, state.advance(), !0) : !1;
2491
+ };
2492
+ pp$1.regexp_eatHexEscapeSequence = function(state) {
2493
+ var start = state.pos;
2494
+ if (state.eat(
2495
+ 120
2496
+ /* x */
2497
+ )) {
2498
+ if (this.regexp_eatFixedHexDigits(state, 2))
2499
+ return !0;
2500
+ state.switchU && state.raise("Invalid escape"), state.pos = start;
2501
+ }
2502
+ return !1;
2503
+ };
2504
+ pp$1.regexp_eatDecimalDigits = function(state) {
2505
+ var start = state.pos, ch = 0;
2506
+ for (state.lastIntValue = 0; isDecimalDigit(ch = state.current()); )
2507
+ state.lastIntValue = 10 * state.lastIntValue + (ch - 48), state.advance();
2508
+ return state.pos !== start;
2509
+ };
2510
+ function isDecimalDigit(ch) {
2511
+ return ch >= 48 && ch <= 57;
2512
+ }
2513
+ pp$1.regexp_eatHexDigits = function(state) {
2514
+ var start = state.pos, ch = 0;
2515
+ for (state.lastIntValue = 0; isHexDigit(ch = state.current()); )
2516
+ state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch), state.advance();
2517
+ return state.pos !== start;
2518
+ };
2519
+ function isHexDigit(ch) {
2520
+ return ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102;
2521
+ }
2522
+ function hexToInt(ch) {
2523
+ return ch >= 65 && ch <= 70 ? 10 + (ch - 65) : ch >= 97 && ch <= 102 ? 10 + (ch - 97) : ch - 48;
2524
+ }
2525
+ pp$1.regexp_eatLegacyOctalEscapeSequence = function(state) {
2526
+ if (this.regexp_eatOctalDigit(state)) {
2527
+ var n1 = state.lastIntValue;
2528
+ if (this.regexp_eatOctalDigit(state)) {
2529
+ var n2 = state.lastIntValue;
2530
+ n1 <= 3 && this.regexp_eatOctalDigit(state) ? state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue : state.lastIntValue = n1 * 8 + n2;
2531
+ } else
2532
+ state.lastIntValue = n1;
2533
+ return !0;
2534
+ }
2535
+ return !1;
2536
+ };
2537
+ pp$1.regexp_eatOctalDigit = function(state) {
2538
+ var ch = state.current();
2539
+ return isOctalDigit(ch) ? (state.lastIntValue = ch - 48, state.advance(), !0) : (state.lastIntValue = 0, !1);
2540
+ };
2541
+ function isOctalDigit(ch) {
2542
+ return ch >= 48 && ch <= 55;
2543
+ }
2544
+ pp$1.regexp_eatFixedHexDigits = function(state, length) {
2545
+ var start = state.pos;
2546
+ state.lastIntValue = 0;
2547
+ for (var i = 0; i < length; ++i) {
2548
+ var ch = state.current();
2549
+ if (!isHexDigit(ch))
2550
+ return state.pos = start, !1;
2551
+ state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch), state.advance();
2552
+ }
2553
+ return !0;
2554
+ };
2555
+ var Token = function(p) {
2556
+ this.type = p.type, this.value = p.value, this.start = p.start, this.end = p.end, p.options.locations && (this.loc = new SourceLocation(p, p.startLoc, p.endLoc)), p.options.ranges && (this.range = [p.start, p.end]);
2557
+ }, pp = Parser.prototype;
2558
+ pp.next = function(ignoreEscapeSequenceInKeyword) {
2559
+ !ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword), this.options.onToken && this.options.onToken(new Token(this)), this.lastTokEnd = this.end, this.lastTokStart = this.start, this.lastTokEndLoc = this.endLoc, this.lastTokStartLoc = this.startLoc, this.nextToken();
2560
+ };
2561
+ pp.getToken = function() {
2562
+ return this.next(), new Token(this);
2563
+ };
2564
+ typeof Symbol < "u" && (pp[Symbol.iterator] = function() {
2565
+ var this$1$1 = this;
2566
+ return {
2567
+ next: function() {
2568
+ var token = this$1$1.getToken();
2569
+ return {
2570
+ done: token.type === types$1.eof,
2571
+ value: token
2572
+ };
2573
+ }
2574
+ };
2575
+ });
2576
+ pp.nextToken = function() {
2577
+ var curContext = this.curContext();
2578
+ if ((!curContext || !curContext.preserveSpace) && this.skipSpace(), this.start = this.pos, this.options.locations && (this.startLoc = this.curPosition()), this.pos >= this.input.length)
2579
+ return this.finishToken(types$1.eof);
2580
+ if (curContext.override)
2581
+ return curContext.override(this);
2582
+ this.readToken(this.fullCharCodeAtPos());
2583
+ };
2584
+ pp.readToken = function(code) {
2585
+ return isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 ? this.readWord() : this.getTokenFromCode(code);
2586
+ };
2587
+ pp.fullCharCodeAtPos = function() {
2588
+ var code = this.input.charCodeAt(this.pos);
2589
+ if (code <= 55295 || code >= 56320)
2590
+ return code;
2591
+ var next = this.input.charCodeAt(this.pos + 1);
2592
+ return next <= 56319 || next >= 57344 ? code : (code << 10) + next - 56613888;
2593
+ };
2594
+ pp.skipBlockComment = function() {
2595
+ var startLoc = this.options.onComment && this.curPosition(), start = this.pos, end = this.input.indexOf("*/", this.pos += 2);
2596
+ if (end === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = end + 2, this.options.locations)
2597
+ for (var nextBreak = void 0, pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1; )
2598
+ ++this.curLine, pos = this.lineStart = nextBreak;
2599
+ this.options.onComment && this.options.onComment(
2600
+ !0,
2601
+ this.input.slice(start + 2, end),
2602
+ start,
2603
+ this.pos,
2604
+ startLoc,
2605
+ this.curPosition()
2606
+ );
2607
+ };
2608
+ pp.skipLineComment = function(startSkip) {
2609
+ for (var start = this.pos, startLoc = this.options.onComment && this.curPosition(), ch = this.input.charCodeAt(this.pos += startSkip); this.pos < this.input.length && !isNewLine(ch); )
2610
+ ch = this.input.charCodeAt(++this.pos);
2611
+ this.options.onComment && this.options.onComment(
2612
+ !1,
2613
+ this.input.slice(start + startSkip, this.pos),
2614
+ start,
2615
+ this.pos,
2616
+ startLoc,
2617
+ this.curPosition()
2618
+ );
2619
+ };
2620
+ pp.skipSpace = function() {
2621
+ loop: for (; this.pos < this.input.length; ) {
2622
+ var ch = this.input.charCodeAt(this.pos);
2623
+ switch (ch) {
2624
+ case 32:
2625
+ case 160:
2626
+ ++this.pos;
2627
+ break;
2628
+ case 13:
2629
+ this.input.charCodeAt(this.pos + 1) === 10 && ++this.pos;
2630
+ case 10:
2631
+ case 8232:
2632
+ case 8233:
2633
+ ++this.pos, this.options.locations && (++this.curLine, this.lineStart = this.pos);
2634
+ break;
2635
+ case 47:
2636
+ switch (this.input.charCodeAt(this.pos + 1)) {
2637
+ case 42:
2638
+ this.skipBlockComment();
2639
+ break;
2640
+ case 47:
2641
+ this.skipLineComment(2);
2642
+ break;
2643
+ default:
2644
+ break loop;
2645
+ }
2646
+ break;
2647
+ default:
2648
+ if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch)))
2649
+ ++this.pos;
2650
+ else
2651
+ break loop;
2652
+ }
2653
+ }
2654
+ };
2655
+ pp.finishToken = function(type, val) {
2656
+ this.end = this.pos, this.options.locations && (this.endLoc = this.curPosition());
2657
+ var prevType = this.type;
2658
+ this.type = type, this.value = val, this.updateContext(prevType);
2659
+ };
2660
+ pp.readToken_dot = function() {
2661
+ var next = this.input.charCodeAt(this.pos + 1);
2662
+ if (next >= 48 && next <= 57)
2663
+ return this.readNumber(!0);
2664
+ var next2 = this.input.charCodeAt(this.pos + 2);
2665
+ return this.options.ecmaVersion >= 6 && next === 46 && next2 === 46 ? (this.pos += 3, this.finishToken(types$1.ellipsis)) : (++this.pos, this.finishToken(types$1.dot));
2666
+ };
2667
+ pp.readToken_slash = function() {
2668
+ var next = this.input.charCodeAt(this.pos + 1);
2669
+ return this.exprAllowed ? (++this.pos, this.readRegexp()) : next === 61 ? this.finishOp(types$1.assign, 2) : this.finishOp(types$1.slash, 1);
2670
+ };
2671
+ pp.readToken_mult_modulo_exp = function(code) {
2672
+ var next = this.input.charCodeAt(this.pos + 1), size = 1, tokentype = code === 42 ? types$1.star : types$1.modulo;
2673
+ return this.options.ecmaVersion >= 7 && code === 42 && next === 42 && (++size, tokentype = types$1.starstar, next = this.input.charCodeAt(this.pos + 2)), next === 61 ? this.finishOp(types$1.assign, size + 1) : this.finishOp(tokentype, size);
2674
+ };
2675
+ pp.readToken_pipe_amp = function(code) {
2676
+ var next = this.input.charCodeAt(this.pos + 1);
2677
+ if (next === code) {
2678
+ if (this.options.ecmaVersion >= 12) {
2679
+ var next2 = this.input.charCodeAt(this.pos + 2);
2680
+ if (next2 === 61)
2681
+ return this.finishOp(types$1.assign, 3);
2682
+ }
2683
+ return this.finishOp(code === 124 ? types$1.logicalOR : types$1.logicalAND, 2);
2684
+ }
2685
+ return next === 61 ? this.finishOp(types$1.assign, 2) : this.finishOp(code === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1);
2686
+ };
2687
+ pp.readToken_caret = function() {
2688
+ var next = this.input.charCodeAt(this.pos + 1);
2689
+ return next === 61 ? this.finishOp(types$1.assign, 2) : this.finishOp(types$1.bitwiseXOR, 1);
2690
+ };
2691
+ pp.readToken_plus_min = function(code) {
2692
+ var next = this.input.charCodeAt(this.pos + 1);
2693
+ return next === code ? next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos))) ? (this.skipLineComment(3), this.skipSpace(), this.nextToken()) : this.finishOp(types$1.incDec, 2) : next === 61 ? this.finishOp(types$1.assign, 2) : this.finishOp(types$1.plusMin, 1);
2694
+ };
2695
+ pp.readToken_lt_gt = function(code) {
2696
+ var next = this.input.charCodeAt(this.pos + 1), size = 1;
2697
+ return next === code ? (size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2, this.input.charCodeAt(this.pos + size) === 61 ? this.finishOp(types$1.assign, size + 1) : this.finishOp(types$1.bitShift, size)) : next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45 ? (this.skipLineComment(4), this.skipSpace(), this.nextToken()) : (next === 61 && (size = 2), this.finishOp(types$1.relational, size));
2698
+ };
2699
+ pp.readToken_eq_excl = function(code) {
2700
+ var next = this.input.charCodeAt(this.pos + 1);
2701
+ return next === 61 ? this.finishOp(types$1.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) : code === 61 && next === 62 && this.options.ecmaVersion >= 6 ? (this.pos += 2, this.finishToken(types$1.arrow)) : this.finishOp(code === 61 ? types$1.eq : types$1.prefix, 1);
2702
+ };
2703
+ pp.readToken_question = function() {
2704
+ var ecmaVersion = this.options.ecmaVersion;
2705
+ if (ecmaVersion >= 11) {
2706
+ var next = this.input.charCodeAt(this.pos + 1);
2707
+ if (next === 46) {
2708
+ var next2 = this.input.charCodeAt(this.pos + 2);
2709
+ if (next2 < 48 || next2 > 57)
2710
+ return this.finishOp(types$1.questionDot, 2);
2711
+ }
2712
+ if (next === 63) {
2713
+ if (ecmaVersion >= 12) {
2714
+ var next2$1 = this.input.charCodeAt(this.pos + 2);
2715
+ if (next2$1 === 61)
2716
+ return this.finishOp(types$1.assign, 3);
2717
+ }
2718
+ return this.finishOp(types$1.coalesce, 2);
2719
+ }
2720
+ }
2721
+ return this.finishOp(types$1.question, 1);
2722
+ };
2723
+ pp.readToken_numberSign = function() {
2724
+ var ecmaVersion = this.options.ecmaVersion, code = 35;
2725
+ if (ecmaVersion >= 13 && (++this.pos, code = this.fullCharCodeAtPos(), isIdentifierStart(code, !0) || code === 92))
2726
+ return this.finishToken(types$1.privateId, this.readWord1());
2727
+ this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'");
2728
+ };
2729
+ pp.getTokenFromCode = function(code) {
2730
+ switch (code) {
2731
+ // The interpretation of a dot depends on whether it is followed
2732
+ // by a digit or another two dots.
2733
+ case 46:
2734
+ return this.readToken_dot();
2735
+ // Punctuation tokens.
2736
+ case 40:
2737
+ return ++this.pos, this.finishToken(types$1.parenL);
2738
+ case 41:
2739
+ return ++this.pos, this.finishToken(types$1.parenR);
2740
+ case 59:
2741
+ return ++this.pos, this.finishToken(types$1.semi);
2742
+ case 44:
2743
+ return ++this.pos, this.finishToken(types$1.comma);
2744
+ case 91:
2745
+ return ++this.pos, this.finishToken(types$1.bracketL);
2746
+ case 93:
2747
+ return ++this.pos, this.finishToken(types$1.bracketR);
2748
+ case 123:
2749
+ return ++this.pos, this.finishToken(types$1.braceL);
2750
+ case 125:
2751
+ return ++this.pos, this.finishToken(types$1.braceR);
2752
+ case 58:
2753
+ return ++this.pos, this.finishToken(types$1.colon);
2754
+ case 96:
2755
+ if (this.options.ecmaVersion < 6)
2756
+ break;
2757
+ return ++this.pos, this.finishToken(types$1.backQuote);
2758
+ case 48:
2759
+ var next = this.input.charCodeAt(this.pos + 1);
2760
+ if (next === 120 || next === 88)
2761
+ return this.readRadixNumber(16);
2762
+ if (this.options.ecmaVersion >= 6) {
2763
+ if (next === 111 || next === 79)
2764
+ return this.readRadixNumber(8);
2765
+ if (next === 98 || next === 66)
2766
+ return this.readRadixNumber(2);
2767
+ }
2768
+ // Anything else beginning with a digit is an integer, octal
2769
+ // number, or float.
2770
+ case 49:
2771
+ case 50:
2772
+ case 51:
2773
+ case 52:
2774
+ case 53:
2775
+ case 54:
2776
+ case 55:
2777
+ case 56:
2778
+ case 57:
2779
+ return this.readNumber(!1);
2780
+ // Quotes produce strings.
2781
+ case 34:
2782
+ case 39:
2783
+ return this.readString(code);
2784
+ // Operators are parsed inline in tiny state machines. '=' (61) is
2785
+ // often referred to. `finishOp` simply skips the amount of
2786
+ // characters it is given as second argument, and returns a token
2787
+ // of the type given by its first argument.
2788
+ case 47:
2789
+ return this.readToken_slash();
2790
+ case 37:
2791
+ case 42:
2792
+ return this.readToken_mult_modulo_exp(code);
2793
+ case 124:
2794
+ case 38:
2795
+ return this.readToken_pipe_amp(code);
2796
+ case 94:
2797
+ return this.readToken_caret();
2798
+ case 43:
2799
+ case 45:
2800
+ return this.readToken_plus_min(code);
2801
+ case 60:
2802
+ case 62:
2803
+ return this.readToken_lt_gt(code);
2804
+ case 61:
2805
+ case 33:
2806
+ return this.readToken_eq_excl(code);
2807
+ case 63:
2808
+ return this.readToken_question();
2809
+ case 126:
2810
+ return this.finishOp(types$1.prefix, 1);
2811
+ case 35:
2812
+ return this.readToken_numberSign();
2813
+ }
2814
+ this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'");
2815
+ };
2816
+ pp.finishOp = function(type, size) {
2817
+ var str = this.input.slice(this.pos, this.pos + size);
2818
+ return this.pos += size, this.finishToken(type, str);
2819
+ };
2820
+ pp.readRegexp = function() {
2821
+ for (var escaped, inClass, start = this.pos; ; ) {
2822
+ this.pos >= this.input.length && this.raise(start, "Unterminated regular expression");
2823
+ var ch = this.input.charAt(this.pos);
2824
+ if (lineBreak.test(ch) && this.raise(start, "Unterminated regular expression"), escaped)
2825
+ escaped = !1;
2826
+ else {
2827
+ if (ch === "[")
2828
+ inClass = !0;
2829
+ else if (ch === "]" && inClass)
2830
+ inClass = !1;
2831
+ else if (ch === "/" && !inClass)
2832
+ break;
2833
+ escaped = ch === "\\";
2834
+ }
2835
+ ++this.pos;
2836
+ }
2837
+ var pattern = this.input.slice(start, this.pos);
2838
+ ++this.pos;
2839
+ var flagsStart = this.pos, flags = this.readWord1();
2840
+ this.containsEsc && this.unexpected(flagsStart);
2841
+ var state = this.regexpState || (this.regexpState = new RegExpValidationState(this));
2842
+ state.reset(start, pattern, flags), this.validateRegExpFlags(state), this.validateRegExpPattern(state);
2843
+ var value = null;
2844
+ try {
2845
+ value = new RegExp(pattern, flags);
2846
+ } catch {
2847
+ }
2848
+ return this.finishToken(types$1.regexp, { pattern, flags, value });
2849
+ };
2850
+ pp.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) {
2851
+ for (var allowSeparators = this.options.ecmaVersion >= 12 && len === void 0, isLegacyOctalNumericLiteral = maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48, start = this.pos, total = 0, lastCode = 0, i = 0, e = len ?? 1 / 0; i < e; ++i, ++this.pos) {
2852
+ var code = this.input.charCodeAt(this.pos), val = void 0;
2853
+ if (allowSeparators && code === 95) {
2854
+ isLegacyOctalNumericLiteral && this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"), lastCode === 95 && this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"), i === 0 && this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"), lastCode = code;
2855
+ continue;
2856
+ }
2857
+ if (code >= 97 ? val = code - 97 + 10 : code >= 65 ? val = code - 65 + 10 : code >= 48 && code <= 57 ? val = code - 48 : val = 1 / 0, val >= radix)
2858
+ break;
2859
+ lastCode = code, total = total * radix + val;
2860
+ }
2861
+ return allowSeparators && lastCode === 95 && this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"), this.pos === start || len != null && this.pos - start !== len ? null : total;
2862
+ };
2863
+ function stringToNumber(str, isLegacyOctalNumericLiteral) {
2864
+ return isLegacyOctalNumericLiteral ? parseInt(str, 8) : parseFloat(str.replace(/_/g, ""));
2865
+ }
2866
+ function stringToBigInt(str) {
2867
+ return typeof BigInt != "function" ? null : BigInt(str.replace(/_/g, ""));
2868
+ }
2869
+ pp.readRadixNumber = function(radix) {
2870
+ var start = this.pos;
2871
+ this.pos += 2;
2872
+ var val = this.readInt(radix);
2873
+ return val == null && this.raise(this.start + 2, "Expected number in radix " + radix), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (val = stringToBigInt(this.input.slice(start, this.pos)), ++this.pos) : isIdentifierStart(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(types$1.num, val);
2874
+ };
2875
+ pp.readNumber = function(startsWithDot) {
2876
+ var start = this.pos;
2877
+ !startsWithDot && this.readInt(10, void 0, !0) === null && this.raise(start, "Invalid number");
2878
+ var octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48;
2879
+ octal && this.strict && this.raise(start, "Invalid number");
2880
+ var next = this.input.charCodeAt(this.pos);
2881
+ if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) {
2882
+ var val$1 = stringToBigInt(this.input.slice(start, this.pos));
2883
+ return ++this.pos, isIdentifierStart(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(types$1.num, val$1);
2884
+ }
2885
+ octal && /[89]/.test(this.input.slice(start, this.pos)) && (octal = !1), next === 46 && !octal && (++this.pos, this.readInt(10), next = this.input.charCodeAt(this.pos)), (next === 69 || next === 101) && !octal && (next = this.input.charCodeAt(++this.pos), (next === 43 || next === 45) && ++this.pos, this.readInt(10) === null && this.raise(start, "Invalid number")), isIdentifierStart(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number");
2886
+ var val = stringToNumber(this.input.slice(start, this.pos), octal);
2887
+ return this.finishToken(types$1.num, val);
2888
+ };
2889
+ pp.readCodePoint = function() {
2890
+ var ch = this.input.charCodeAt(this.pos), code;
2891
+ if (ch === 123) {
2892
+ this.options.ecmaVersion < 6 && this.unexpected();
2893
+ var codePos = ++this.pos;
2894
+ code = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos), ++this.pos, code > 1114111 && this.invalidStringToken(codePos, "Code point out of bounds");
2895
+ } else
2896
+ code = this.readHexChar(4);
2897
+ return code;
2898
+ };
2899
+ pp.readString = function(quote) {
2900
+ for (var out = "", chunkStart = ++this.pos; ; ) {
2901
+ this.pos >= this.input.length && this.raise(this.start, "Unterminated string constant");
2902
+ var ch = this.input.charCodeAt(this.pos);
2903
+ if (ch === quote)
2904
+ break;
2905
+ ch === 92 ? (out += this.input.slice(chunkStart, this.pos), out += this.readEscapedChar(!1), chunkStart = this.pos) : ch === 8232 || ch === 8233 ? (this.options.ecmaVersion < 10 && this.raise(this.start, "Unterminated string constant"), ++this.pos, this.options.locations && (this.curLine++, this.lineStart = this.pos)) : (isNewLine(ch) && this.raise(this.start, "Unterminated string constant"), ++this.pos);
2906
+ }
2907
+ return out += this.input.slice(chunkStart, this.pos++), this.finishToken(types$1.string, out);
2908
+ };
2909
+ var INVALID_TEMPLATE_ESCAPE_ERROR = {};
2910
+ pp.tryReadTemplateToken = function() {
2911
+ this.inTemplateElement = !0;
2912
+ try {
2913
+ this.readTmplToken();
2914
+ } catch (err) {
2915
+ if (err === INVALID_TEMPLATE_ESCAPE_ERROR)
2916
+ this.readInvalidTemplateToken();
2917
+ else
2918
+ throw err;
2919
+ }
2920
+ this.inTemplateElement = !1;
2921
+ };
2922
+ pp.invalidStringToken = function(position, message) {
2923
+ if (this.inTemplateElement && this.options.ecmaVersion >= 9)
2924
+ throw INVALID_TEMPLATE_ESCAPE_ERROR;
2925
+ this.raise(position, message);
2926
+ };
2927
+ pp.readTmplToken = function() {
2928
+ for (var out = "", chunkStart = this.pos; ; ) {
2929
+ this.pos >= this.input.length && this.raise(this.start, "Unterminated template");
2930
+ var ch = this.input.charCodeAt(this.pos);
2931
+ if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123)
2932
+ return this.pos === this.start && (this.type === types$1.template || this.type === types$1.invalidTemplate) ? ch === 36 ? (this.pos += 2, this.finishToken(types$1.dollarBraceL)) : (++this.pos, this.finishToken(types$1.backQuote)) : (out += this.input.slice(chunkStart, this.pos), this.finishToken(types$1.template, out));
2933
+ if (ch === 92)
2934
+ out += this.input.slice(chunkStart, this.pos), out += this.readEscapedChar(!0), chunkStart = this.pos;
2935
+ else if (isNewLine(ch)) {
2936
+ switch (out += this.input.slice(chunkStart, this.pos), ++this.pos, ch) {
2937
+ case 13:
2938
+ this.input.charCodeAt(this.pos) === 10 && ++this.pos;
2939
+ case 10:
2940
+ out += `
2941
+ `;
2942
+ break;
2943
+ default:
2944
+ out += String.fromCharCode(ch);
2945
+ break;
2946
+ }
2947
+ this.options.locations && (++this.curLine, this.lineStart = this.pos), chunkStart = this.pos;
2948
+ } else
2949
+ ++this.pos;
2950
+ }
2951
+ };
2952
+ pp.readInvalidTemplateToken = function() {
2953
+ for (; this.pos < this.input.length; this.pos++)
2954
+ switch (this.input[this.pos]) {
2955
+ case "\\":
2956
+ ++this.pos;
2957
+ break;
2958
+ case "$":
2959
+ if (this.input[this.pos + 1] !== "{")
2960
+ break;
2961
+ // fall through
2962
+ case "`":
2963
+ return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos));
2964
+ case "\r":
2965
+ this.input[this.pos + 1] === `
2966
+ ` && ++this.pos;
2967
+ // fall through
2968
+ case `
2969
+ `:
2970
+ case "\u2028":
2971
+ case "\u2029":
2972
+ ++this.curLine, this.lineStart = this.pos + 1;
2973
+ break;
2974
+ }
2975
+ this.raise(this.start, "Unterminated template");
2976
+ };
2977
+ pp.readEscapedChar = function(inTemplate) {
2978
+ var ch = this.input.charCodeAt(++this.pos);
2979
+ switch (++this.pos, ch) {
2980
+ case 110:
2981
+ return `
2982
+ `;
2983
+ // 'n' -> '\n'
2984
+ case 114:
2985
+ return "\r";
2986
+ // 'r' -> '\r'
2987
+ case 120:
2988
+ return String.fromCharCode(this.readHexChar(2));
2989
+ // 'x'
2990
+ case 117:
2991
+ return codePointToString(this.readCodePoint());
2992
+ // 'u'
2993
+ case 116:
2994
+ return " ";
2995
+ // 't' -> '\t'
2996
+ case 98:
2997
+ return "\b";
2998
+ // 'b' -> '\b'
2999
+ case 118:
3000
+ return "\v";
3001
+ // 'v' -> '\u000b'
3002
+ case 102:
3003
+ return "\f";
3004
+ // 'f' -> '\f'
3005
+ case 13:
3006
+ this.input.charCodeAt(this.pos) === 10 && ++this.pos;
3007
+ // '\r\n'
3008
+ case 10:
3009
+ return this.options.locations && (this.lineStart = this.pos, ++this.curLine), "";
3010
+ case 56:
3011
+ case 57:
3012
+ if (this.strict && this.invalidStringToken(
3013
+ this.pos - 1,
3014
+ "Invalid escape sequence"
3015
+ ), inTemplate) {
3016
+ var codePos = this.pos - 1;
3017
+ this.invalidStringToken(
3018
+ codePos,
3019
+ "Invalid escape sequence in template string"
3020
+ );
3021
+ }
3022
+ default:
3023
+ if (ch >= 48 && ch <= 55) {
3024
+ var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0], octal = parseInt(octalStr, 8);
3025
+ return octal > 255 && (octalStr = octalStr.slice(0, -1), octal = parseInt(octalStr, 8)), this.pos += octalStr.length - 1, ch = this.input.charCodeAt(this.pos), (octalStr !== "0" || ch === 56 || ch === 57) && (this.strict || inTemplate) && this.invalidStringToken(
3026
+ this.pos - 1 - octalStr.length,
3027
+ inTemplate ? "Octal literal in template string" : "Octal literal in strict mode"
3028
+ ), String.fromCharCode(octal);
3029
+ }
3030
+ return isNewLine(ch) ? (this.options.locations && (this.lineStart = this.pos, ++this.curLine), "") : String.fromCharCode(ch);
3031
+ }
3032
+ };
3033
+ pp.readHexChar = function(len) {
3034
+ var codePos = this.pos, n = this.readInt(16, len);
3035
+ return n === null && this.invalidStringToken(codePos, "Bad character escape sequence"), n;
3036
+ };
3037
+ pp.readWord1 = function() {
3038
+ this.containsEsc = !1;
3039
+ for (var word = "", first = !0, chunkStart = this.pos, astral = this.options.ecmaVersion >= 6; this.pos < this.input.length; ) {
3040
+ var ch = this.fullCharCodeAtPos();
3041
+ if (isIdentifierChar(ch, astral))
3042
+ this.pos += ch <= 65535 ? 1 : 2;
3043
+ else if (ch === 92) {
3044
+ this.containsEsc = !0, word += this.input.slice(chunkStart, this.pos);
3045
+ var escStart = this.pos;
3046
+ this.input.charCodeAt(++this.pos) !== 117 && this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"), ++this.pos;
3047
+ var esc = this.readCodePoint();
3048
+ (first ? isIdentifierStart : isIdentifierChar)(esc, astral) || this.invalidStringToken(escStart, "Invalid Unicode escape"), word += codePointToString(esc), chunkStart = this.pos;
3049
+ } else
3050
+ break;
3051
+ first = !1;
3052
+ }
3053
+ return word + this.input.slice(chunkStart, this.pos);
3054
+ };
3055
+ pp.readWord = function() {
3056
+ var word = this.readWord1(), type = types$1.name;
3057
+ return this.keywords.test(word) && (type = keywords[word]), this.finishToken(type, word);
3058
+ };
3059
+ var version = "8.14.0";
3060
+ Parser.acorn = {
3061
+ Parser,
3062
+ version,
3063
+ defaultOptions,
3064
+ Position,
3065
+ SourceLocation,
3066
+ getLineInfo,
3067
+ Node,
3068
+ TokenType,
3069
+ tokTypes: types$1,
3070
+ keywordTypes: keywords,
3071
+ TokContext,
3072
+ tokContexts: types,
3073
+ isIdentifierChar,
3074
+ isIdentifierStart,
3075
+ Token,
3076
+ isNewLine,
3077
+ lineBreak,
3078
+ lineBreakG,
3079
+ nonASCIIwhitespace
3080
+ };
3081
+ function simple(node, visitors, baseVisitor, state, override) {
3082
+ baseVisitor || (baseVisitor = base), function c(node2, st, override2) {
3083
+ var type = override2 || node2.type;
3084
+ baseVisitor[type](node2, st, c), visitors[type] && visitors[type](node2, st);
3085
+ }(node, state, override);
3086
+ }
3087
+ function ancestor(node, visitors, baseVisitor, state, override) {
3088
+ var ancestors = [];
3089
+ baseVisitor || (baseVisitor = base), function c(node2, st, override2) {
3090
+ var type = override2 || node2.type, isNew = node2 !== ancestors[ancestors.length - 1];
3091
+ isNew && ancestors.push(node2), baseVisitor[type](node2, st, c), visitors[type] && visitors[type](node2, st || ancestors, ancestors), isNew && ancestors.pop();
3092
+ }(node, state, override);
3093
+ }
3094
+ function make(funcs, baseVisitor) {
3095
+ var visitor = Object.create(base);
3096
+ for (var type in funcs)
3097
+ visitor[type] = funcs[type];
3098
+ return visitor;
3099
+ }
3100
+ function skipThrough(node, st, c) {
3101
+ c(node, st);
3102
+ }
3103
+ function ignore(_node, _st, _c) {
3104
+ }
3105
+ var base = {};
3106
+ base.Program = base.BlockStatement = base.StaticBlock = function(node, st, c) {
3107
+ for (var i = 0, list = node.body; i < list.length; i += 1) {
3108
+ var stmt = list[i];
3109
+ c(stmt, st, "Statement");
3110
+ }
3111
+ };
3112
+ base.Statement = skipThrough;
3113
+ base.EmptyStatement = ignore;
3114
+ base.ExpressionStatement = base.ParenthesizedExpression = base.ChainExpression = function(node, st, c) {
3115
+ return c(node.expression, st, "Expression");
3116
+ };
3117
+ base.IfStatement = function(node, st, c) {
3118
+ c(node.test, st, "Expression"), c(node.consequent, st, "Statement"), node.alternate && c(node.alternate, st, "Statement");
3119
+ };
3120
+ base.LabeledStatement = function(node, st, c) {
3121
+ return c(node.body, st, "Statement");
3122
+ };
3123
+ base.BreakStatement = base.ContinueStatement = ignore;
3124
+ base.WithStatement = function(node, st, c) {
3125
+ c(node.object, st, "Expression"), c(node.body, st, "Statement");
3126
+ };
3127
+ base.SwitchStatement = function(node, st, c) {
3128
+ c(node.discriminant, st, "Expression");
3129
+ for (var i = 0, list = node.cases; i < list.length; i += 1) {
3130
+ var cs = list[i];
3131
+ c(cs, st);
3132
+ }
3133
+ };
3134
+ base.SwitchCase = function(node, st, c) {
3135
+ node.test && c(node.test, st, "Expression");
3136
+ for (var i = 0, list = node.consequent; i < list.length; i += 1) {
3137
+ var cons = list[i];
3138
+ c(cons, st, "Statement");
3139
+ }
3140
+ };
3141
+ base.ReturnStatement = base.YieldExpression = base.AwaitExpression = function(node, st, c) {
3142
+ node.argument && c(node.argument, st, "Expression");
3143
+ };
3144
+ base.ThrowStatement = base.SpreadElement = function(node, st, c) {
3145
+ return c(node.argument, st, "Expression");
3146
+ };
3147
+ base.TryStatement = function(node, st, c) {
3148
+ c(node.block, st, "Statement"), node.handler && c(node.handler, st), node.finalizer && c(node.finalizer, st, "Statement");
3149
+ };
3150
+ base.CatchClause = function(node, st, c) {
3151
+ node.param && c(node.param, st, "Pattern"), c(node.body, st, "Statement");
3152
+ };
3153
+ base.WhileStatement = base.DoWhileStatement = function(node, st, c) {
3154
+ c(node.test, st, "Expression"), c(node.body, st, "Statement");
3155
+ };
3156
+ base.ForStatement = function(node, st, c) {
3157
+ node.init && c(node.init, st, "ForInit"), node.test && c(node.test, st, "Expression"), node.update && c(node.update, st, "Expression"), c(node.body, st, "Statement");
3158
+ };
3159
+ base.ForInStatement = base.ForOfStatement = function(node, st, c) {
3160
+ c(node.left, st, "ForInit"), c(node.right, st, "Expression"), c(node.body, st, "Statement");
3161
+ };
3162
+ base.ForInit = function(node, st, c) {
3163
+ node.type === "VariableDeclaration" ? c(node, st) : c(node, st, "Expression");
3164
+ };
3165
+ base.DebuggerStatement = ignore;
3166
+ base.FunctionDeclaration = function(node, st, c) {
3167
+ return c(node, st, "Function");
3168
+ };
3169
+ base.VariableDeclaration = function(node, st, c) {
3170
+ for (var i = 0, list = node.declarations; i < list.length; i += 1) {
3171
+ var decl = list[i];
3172
+ c(decl, st);
3173
+ }
3174
+ };
3175
+ base.VariableDeclarator = function(node, st, c) {
3176
+ c(node.id, st, "Pattern"), node.init && c(node.init, st, "Expression");
3177
+ };
3178
+ base.Function = function(node, st, c) {
3179
+ node.id && c(node.id, st, "Pattern");
3180
+ for (var i = 0, list = node.params; i < list.length; i += 1) {
3181
+ var param = list[i];
3182
+ c(param, st, "Pattern");
3183
+ }
3184
+ c(node.body, st, node.expression ? "Expression" : "Statement");
3185
+ };
3186
+ base.Pattern = function(node, st, c) {
3187
+ node.type === "Identifier" ? c(node, st, "VariablePattern") : node.type === "MemberExpression" ? c(node, st, "MemberPattern") : c(node, st);
3188
+ };
3189
+ base.VariablePattern = ignore;
3190
+ base.MemberPattern = skipThrough;
3191
+ base.RestElement = function(node, st, c) {
3192
+ return c(node.argument, st, "Pattern");
3193
+ };
3194
+ base.ArrayPattern = function(node, st, c) {
3195
+ for (var i = 0, list = node.elements; i < list.length; i += 1) {
3196
+ var elt = list[i];
3197
+ elt && c(elt, st, "Pattern");
3198
+ }
3199
+ };
3200
+ base.ObjectPattern = function(node, st, c) {
3201
+ for (var i = 0, list = node.properties; i < list.length; i += 1) {
3202
+ var prop = list[i];
3203
+ prop.type === "Property" ? (prop.computed && c(prop.key, st, "Expression"), c(prop.value, st, "Pattern")) : prop.type === "RestElement" && c(prop.argument, st, "Pattern");
3204
+ }
3205
+ };
3206
+ base.Expression = skipThrough;
3207
+ base.ThisExpression = base.Super = base.MetaProperty = ignore;
3208
+ base.ArrayExpression = function(node, st, c) {
3209
+ for (var i = 0, list = node.elements; i < list.length; i += 1) {
3210
+ var elt = list[i];
3211
+ elt && c(elt, st, "Expression");
3212
+ }
3213
+ };
3214
+ base.ObjectExpression = function(node, st, c) {
3215
+ for (var i = 0, list = node.properties; i < list.length; i += 1) {
3216
+ var prop = list[i];
3217
+ c(prop, st);
3218
+ }
3219
+ };
3220
+ base.FunctionExpression = base.ArrowFunctionExpression = base.FunctionDeclaration;
3221
+ base.SequenceExpression = function(node, st, c) {
3222
+ for (var i = 0, list = node.expressions; i < list.length; i += 1) {
3223
+ var expr = list[i];
3224
+ c(expr, st, "Expression");
3225
+ }
3226
+ };
3227
+ base.TemplateLiteral = function(node, st, c) {
3228
+ for (var i = 0, list = node.quasis; i < list.length; i += 1) {
3229
+ var quasi = list[i];
3230
+ c(quasi, st);
3231
+ }
3232
+ for (var i$1 = 0, list$1 = node.expressions; i$1 < list$1.length; i$1 += 1) {
3233
+ var expr = list$1[i$1];
3234
+ c(expr, st, "Expression");
3235
+ }
3236
+ };
3237
+ base.TemplateElement = ignore;
3238
+ base.UnaryExpression = base.UpdateExpression = function(node, st, c) {
3239
+ c(node.argument, st, "Expression");
3240
+ };
3241
+ base.BinaryExpression = base.LogicalExpression = function(node, st, c) {
3242
+ c(node.left, st, "Expression"), c(node.right, st, "Expression");
3243
+ };
3244
+ base.AssignmentExpression = base.AssignmentPattern = function(node, st, c) {
3245
+ c(node.left, st, "Pattern"), c(node.right, st, "Expression");
3246
+ };
3247
+ base.ConditionalExpression = function(node, st, c) {
3248
+ c(node.test, st, "Expression"), c(node.consequent, st, "Expression"), c(node.alternate, st, "Expression");
3249
+ };
3250
+ base.NewExpression = base.CallExpression = function(node, st, c) {
3251
+ if (c(node.callee, st, "Expression"), node.arguments)
3252
+ for (var i = 0, list = node.arguments; i < list.length; i += 1) {
3253
+ var arg = list[i];
3254
+ c(arg, st, "Expression");
3255
+ }
3256
+ };
3257
+ base.MemberExpression = function(node, st, c) {
3258
+ c(node.object, st, "Expression"), node.computed && c(node.property, st, "Expression");
3259
+ };
3260
+ base.ExportNamedDeclaration = base.ExportDefaultDeclaration = function(node, st, c) {
3261
+ node.declaration && c(node.declaration, st, node.type === "ExportNamedDeclaration" || node.declaration.id ? "Statement" : "Expression"), node.source && c(node.source, st, "Expression");
3262
+ };
3263
+ base.ExportAllDeclaration = function(node, st, c) {
3264
+ node.exported && c(node.exported, st), c(node.source, st, "Expression");
3265
+ };
3266
+ base.ImportDeclaration = function(node, st, c) {
3267
+ for (var i = 0, list = node.specifiers; i < list.length; i += 1) {
3268
+ var spec = list[i];
3269
+ c(spec, st);
3270
+ }
3271
+ c(node.source, st, "Expression");
3272
+ };
3273
+ base.ImportExpression = function(node, st, c) {
3274
+ c(node.source, st, "Expression");
3275
+ };
3276
+ base.ImportSpecifier = base.ImportDefaultSpecifier = base.ImportNamespaceSpecifier = base.Identifier = base.PrivateIdentifier = base.Literal = ignore;
3277
+ base.TaggedTemplateExpression = function(node, st, c) {
3278
+ c(node.tag, st, "Expression"), c(node.quasi, st, "Expression");
3279
+ };
3280
+ base.ClassDeclaration = base.ClassExpression = function(node, st, c) {
3281
+ return c(node, st, "Class");
3282
+ };
3283
+ base.Class = function(node, st, c) {
3284
+ node.id && c(node.id, st, "Pattern"), node.superClass && c(node.superClass, st, "Expression"), c(node.body, st);
3285
+ };
3286
+ base.ClassBody = function(node, st, c) {
3287
+ for (var i = 0, list = node.body; i < list.length; i += 1) {
3288
+ var elt = list[i];
3289
+ c(elt, st);
3290
+ }
3291
+ };
3292
+ base.MethodDefinition = base.PropertyDefinition = base.Property = function(node, st, c) {
3293
+ node.computed && c(node.key, st, "Expression"), node.value && c(node.value, st, "Expression");
3294
+ };
3295
+ const defaultGlobals = /* @__PURE__ */ new Set([
3296
+ "Array",
3297
+ "ArrayBuffer",
3298
+ "atob",
3299
+ "AudioContext",
3300
+ "Blob",
3301
+ "Boolean",
3302
+ "BigInt",
3303
+ "btoa",
3304
+ "clearInterval",
3305
+ "clearTimeout",
3306
+ "console",
3307
+ "crypto",
3308
+ "CustomEvent",
3309
+ "DataView",
3310
+ "Date",
3311
+ "decodeURI",
3312
+ "decodeURIComponent",
3313
+ "devicePixelRatio",
3314
+ "document",
3315
+ "encodeURI",
3316
+ "encodeURIComponent",
3317
+ "Error",
3318
+ "escape",
3319
+ "eval",
3320
+ "fetch",
3321
+ "File",
3322
+ "FileList",
3323
+ "FileReader",
3324
+ "Float32Array",
3325
+ "Float64Array",
3326
+ "Function",
3327
+ "Headers",
3328
+ "Image",
3329
+ "ImageData",
3330
+ "Infinity",
3331
+ "Int16Array",
3332
+ "Int32Array",
3333
+ "Int8Array",
3334
+ "Intl",
3335
+ "isFinite",
3336
+ "isNaN",
3337
+ "JSON",
3338
+ "Map",
3339
+ "Math",
3340
+ "NaN",
3341
+ "Number",
3342
+ "navigator",
3343
+ "Object",
3344
+ "parseFloat",
3345
+ "parseInt",
3346
+ "performance",
3347
+ "Path2D",
3348
+ "Promise",
3349
+ "Proxy",
3350
+ "RangeError",
3351
+ "ReferenceError",
3352
+ "Reflect",
3353
+ "RegExp",
3354
+ "cancelAnimationFrame",
3355
+ "requestAnimationFrame",
3356
+ "Set",
3357
+ "setInterval",
3358
+ "setTimeout",
3359
+ "String",
3360
+ "Symbol",
3361
+ "SyntaxError",
3362
+ "TextDecoder",
3363
+ "TextEncoder",
3364
+ "this",
3365
+ "TypeError",
3366
+ "Uint16Array",
3367
+ "Uint32Array",
3368
+ "Uint8Array",
3369
+ "Uint8ClampedArray",
3370
+ "undefined",
3371
+ "unescape",
3372
+ "URIError",
3373
+ "URL",
3374
+ "WeakMap",
3375
+ "WeakSet",
3376
+ "WebSocket",
3377
+ "Worker",
3378
+ "window"
3379
+ ]), ohqWalk = make({
3380
+ Import() {
3381
+ },
3382
+ ViewExpression(node, st, c) {
3383
+ c(node.id, st, "Identifier");
3384
+ },
3385
+ MutableExpression(node, st, c) {
3386
+ c(node.id, st, "Identifier");
3387
+ }
3388
+ });
3389
+ function isScope(node) {
3390
+ return node.type === "FunctionExpression" || node.type === "FunctionDeclaration" || node.type === "ArrowFunctionExpression" || node.type === "Program";
3391
+ }
3392
+ function isBlockScope(node) {
3393
+ return node.type === "BlockStatement" || node.type === "ForInStatement" || node.type === "ForOfStatement" || node.type === "ForStatement" || isScope(node);
3394
+ }
3395
+ function declaresArguments(node) {
3396
+ return node.type === "FunctionExpression" || node.type === "FunctionDeclaration";
3397
+ }
3398
+ function findReferences(cell, globals) {
3399
+ const ast = { type: "Program", body: [cell.body] }, locals = /* @__PURE__ */ new Map(), globalSet = new Set(globals), references = [];
3400
+ function hasLocal(node, name) {
3401
+ const l = locals.get(node);
3402
+ return l ? l.has(name) : !1;
3403
+ }
3404
+ function declareLocal(node, id) {
3405
+ const l = locals.get(node);
3406
+ l ? l.add(id.name) : locals.set(node, /* @__PURE__ */ new Set([id.name]));
3407
+ }
3408
+ function declareClass(node) {
3409
+ node.id && declareLocal(node, node.id);
3410
+ }
3411
+ function declareFunction(node) {
3412
+ node.params.forEach((param) => declarePattern(param, node)), node.id && declareLocal(node, node.id);
3413
+ }
3414
+ function declareCatchClause(node) {
3415
+ node.param && declarePattern(node.param, node);
3416
+ }
3417
+ function declarePattern(node, parent) {
3418
+ switch (node.type) {
3419
+ case "Identifier":
3420
+ declareLocal(parent, node);
3421
+ break;
3422
+ case "ObjectPattern":
3423
+ node.properties.forEach((node2) => declarePattern(node2, parent));
3424
+ break;
3425
+ case "ArrayPattern":
3426
+ node.elements.forEach((node2) => node2 && declarePattern(node2, parent));
3427
+ break;
3428
+ case "Property":
3429
+ declarePattern(node.value, parent);
3430
+ break;
3431
+ case "RestElement":
3432
+ declarePattern(node.argument, parent);
3433
+ break;
3434
+ case "AssignmentPattern":
3435
+ declarePattern(node.left, parent);
3436
+ break;
3437
+ default:
3438
+ throw new Error("Unrecognized pattern type: " + node.type);
3439
+ }
3440
+ }
3441
+ function declareModuleSpecifier(node) {
3442
+ declareLocal(ast, node.local);
3443
+ }
3444
+ ancestor(
3445
+ ast,
3446
+ {
3447
+ VariableDeclaration: (node, parents) => {
3448
+ let parent = null;
3449
+ for (let i = parents.length - 1; i >= 0 && parent === null; --i)
3450
+ (node.kind === "var" ? isScope(parents[i]) : isBlockScope(parents[i])) && (parent = parents[i]);
3451
+ node.declarations.forEach((declaration) => declarePattern(declaration.id, parent));
3452
+ },
3453
+ FunctionDeclaration: (node, parents) => {
3454
+ let parent = null;
3455
+ for (let i = parents.length - 2; i >= 0 && parent === null; --i)
3456
+ isScope(parents[i]) && (parent = parents[i]);
3457
+ declareLocal(parent, node.id), declareFunction(node);
3458
+ },
3459
+ Function: declareFunction,
3460
+ ClassDeclaration: (node, parents) => {
3461
+ let parent = null;
3462
+ for (let i = parents.length - 2; i >= 0 && parent === null; i--)
3463
+ isScope(parents[i]) && (parent = parents[i]);
3464
+ declareLocal(parent, node.id);
3465
+ },
3466
+ Class: declareClass,
3467
+ CatchClause: declareCatchClause,
3468
+ ImportDefaultSpecifier: declareModuleSpecifier,
3469
+ ImportSpecifier: declareModuleSpecifier,
3470
+ ImportNamespaceSpecifier: declareModuleSpecifier
3471
+ },
3472
+ ohqWalk
3473
+ );
3474
+ function identifier(node, parents) {
3475
+ let name = node.name;
3476
+ if (name !== "undefined") {
3477
+ for (let i = parents.length - 2; i >= 0; --i) {
3478
+ if (name === "arguments" && declaresArguments(parents[i]) || hasLocal(parents[i], name))
3479
+ return;
3480
+ parents[i].type === "ViewExpression" && (node = parents[i], name = `viewof ${node.id.name}`), parents[i].type === "MutableExpression" && (node = parents[i], name = `mutable ${node.id.name}`);
3481
+ }
3482
+ if (!globalSet.has(name)) {
3483
+ if (name === "arguments")
3484
+ throw Object.assign(new SyntaxError("arguments is not allowed"), { node });
3485
+ references.push(node);
3486
+ }
3487
+ }
3488
+ }
3489
+ ancestor(
3490
+ ast,
3491
+ {
3492
+ VariablePattern: identifier,
3493
+ Identifier: identifier
3494
+ },
3495
+ ohqWalk
3496
+ );
3497
+ function checkConst(node, parents) {
3498
+ if (node)
3499
+ switch (node.type) {
3500
+ case "Identifier":
3501
+ case "VariablePattern": {
3502
+ for (const parent of parents)
3503
+ if (hasLocal(parent, node.name))
3504
+ return;
3505
+ if (parents[parents.length - 2].type === "MutableExpression")
3506
+ return;
3507
+ throw Object.assign(new SyntaxError(`Assignment to constant variable ${node.name}`), { node });
3508
+ }
3509
+ case "ArrayPattern": {
3510
+ for (const element of node.elements)
3511
+ checkConst(element, parents);
3512
+ return;
3513
+ }
3514
+ case "ObjectPattern": {
3515
+ for (const property of node.properties)
3516
+ checkConst(property, parents);
3517
+ return;
3518
+ }
3519
+ case "Property": {
3520
+ checkConst(node.value, parents);
3521
+ return;
3522
+ }
3523
+ case "RestElement": {
3524
+ checkConst(node.argument, parents);
3525
+ return;
3526
+ }
3527
+ }
3528
+ }
3529
+ function checkConstArgument(node, parents) {
3530
+ checkConst(node.argument, parents);
3531
+ }
3532
+ function checkConstLeft(node, parents) {
3533
+ checkConst(node.left, parents);
3534
+ }
3535
+ return ancestor(
3536
+ ast,
3537
+ {
3538
+ AssignmentExpression: checkConstLeft,
3539
+ AssignmentPattern: checkConstLeft,
3540
+ UpdateExpression: checkConstArgument,
3541
+ ForOfStatement: checkConstLeft,
3542
+ ForInStatement: checkConstLeft
3543
+ },
3544
+ ohqWalk
3545
+ ), references;
3546
+ }
3547
+ function findFeatures(cell, featureName) {
3548
+ const ast = { type: "Program", body: [cell.body] }, features = /* @__PURE__ */ new Map(), { references } = cell;
3549
+ return simple(
3550
+ ast,
3551
+ {
3552
+ CallExpression: (node) => {
3553
+ const { callee, arguments: args } = node;
3554
+ if (callee.type !== "Identifier" || callee.name !== featureName || references.indexOf(callee) < 0) return;
3555
+ if (args.length !== 1 || !(args[0].type === "Literal" && /^['"]/.test(args[0].raw) || args[0].type === "TemplateLiteral" && args[0].expressions.length === 0))
3556
+ throw Object.assign(new SyntaxError(`${featureName} requires a single literal string argument`), { node });
3557
+ const [arg] = args, name = arg.type === "Literal" ? arg.value : arg.quasis[0].value.cooked, location = { start: arg.start, end: arg.end };
3558
+ features.has(name) ? features.get(name).push(location) : features.set(name, [location]);
3559
+ }
3560
+ },
3561
+ ohqWalk
3562
+ ), features;
3563
+ }
3564
+ const SCOPE_FUNCTION = 2, SCOPE_ASYNC = 4, SCOPE_GENERATOR = 8;
3565
+ function parseCell$2(input, { tag, raw, globals, ...options } = {}) {
3566
+ let cell;
3567
+ if (tag != null && input) {
3568
+ cell = TemplateCellParser.parse(input, options);
3569
+ const parsedTag = CellTagParser.parse(tag, options);
3570
+ parseReferences(parsedTag, tag, globals), parseFeatures(parsedTag, tag), cell.tag = parsedTag, cell.raw = !!raw;
3571
+ } else
3572
+ cell = CellParser.parse(input, options);
3573
+ return parseReferences(cell, input, globals), parseFeatures(cell, input), cell;
3574
+ }
3575
+ class CellParser extends Parser {
3576
+ constructor(options, ...args) {
3577
+ super(Object.assign({ ecmaVersion: 13 }, options), ...args);
3578
+ }
3579
+ enterScope(flags) {
3580
+ return flags & SCOPE_FUNCTION && ++this.O_function, super.enterScope(flags);
3581
+ }
3582
+ exitScope() {
3583
+ return this.currentScope().flags & SCOPE_FUNCTION && --this.O_function, super.exitScope();
3584
+ }
3585
+ parseForIn(node, init) {
3586
+ return this.O_function === 1 && node.await && (this.O_async = !0), super.parseForIn(node, init);
3587
+ }
3588
+ parseAwait() {
3589
+ return this.O_function === 1 && (this.O_async = !0), super.parseAwait();
3590
+ }
3591
+ parseYield(noIn) {
3592
+ return this.O_function === 1 && (this.O_generator = !0), super.parseYield(noIn);
3593
+ }
3594
+ parseImport(node) {
3595
+ return this.next(), node.specifiers = this.parseImportSpecifiers(), this.type === types$1._with && (this.next(), node.injections = this.parseImportSpecifiers()), this.expectContextual("from"), node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected(), this.finishNode(node, "ImportDeclaration");
3596
+ }
3597
+ parseImportSpecifiers() {
3598
+ const nodes = [], identifiers = /* @__PURE__ */ new Set();
3599
+ let first = !0;
3600
+ for (this.expect(types$1.braceL); !this.eat(types$1.braceR); ) {
3601
+ if (first)
3602
+ first = !1;
3603
+ else if (this.expect(types$1.comma), this.afterTrailingComma(types$1.braceR)) break;
3604
+ const node = this.startNode();
3605
+ node.view = this.eatContextual("viewof"), node.mutable = node.view ? !1 : this.eatContextual("mutable"), node.imported = this.parseIdent(), this.checkUnreserved(node.imported), this.checkLocal(node.imported), this.eatContextual("as") ? (node.local = this.parseIdent(), this.checkUnreserved(node.local), this.checkLocal(node.local)) : node.local = node.imported, this.checkLValSimple(node.local, "let"), identifiers.has(node.local.name) && this.raise(node.local.start, `Identifier '${node.local.name}' has already been declared`), identifiers.add(node.local.name), nodes.push(this.finishNode(node, "ImportSpecifier"));
3606
+ }
3607
+ return nodes;
3608
+ }
3609
+ parseExprAtom(refDestructuringErrors) {
3610
+ return this.parseMaybeKeywordExpression("viewof", "ViewExpression") || this.parseMaybeKeywordExpression("mutable", "MutableExpression") || super.parseExprAtom(refDestructuringErrors);
3611
+ }
3612
+ startCell() {
3613
+ this.O_function = 0, this.O_async = !1, this.O_generator = !1, this.strict = !0, this.enterScope(SCOPE_FUNCTION | SCOPE_ASYNC | SCOPE_GENERATOR);
3614
+ }
3615
+ finishCell(node, body, id) {
3616
+ return id && this.checkLocal(id), node.id = id, node.body = body, node.async = this.O_async, node.generator = this.O_generator, this.exitScope(), this.finishNode(node, "Cell");
3617
+ }
3618
+ parseCell(node, eof) {
3619
+ const lookahead2 = new CellParser({}, this.input, this.start);
3620
+ let token = lookahead2.getToken(), body = null, id = null;
3621
+ return this.startCell(), token.type === types$1._import && lookahead2.getToken().type !== types$1.parenL ? body = this.parseImport(this.startNode()) : token.type !== types$1.eof && token.type !== types$1.semi && (token.type === types$1.name && ((token.value === "viewof" || token.value === "mutable") && (token = lookahead2.getToken(), token.type !== types$1.name && lookahead2.unexpected()), token = lookahead2.getToken(), token.type === types$1.eq && (id = this.parseMaybeKeywordExpression("viewof", "ViewExpression") || this.parseMaybeKeywordExpression("mutable", "MutableExpression") || this.parseIdent(), token = lookahead2.getToken(), this.expect(types$1.eq))), token.type === types$1.braceL ? body = this.parseBlock() : (body = this.parseExpression(), id === null && (body.type === "FunctionExpression" || body.type === "ClassExpression") && (id = body.id))), this.semicolon(), eof && this.expect(types$1.eof), this.finishCell(node, body, id);
3622
+ }
3623
+ parseTopLevel(node) {
3624
+ return this.parseCell(node, !0);
3625
+ }
3626
+ toAssignable(node, isBinding, refDestructuringErrors) {
3627
+ return node.type === "MutableExpression" ? node : super.toAssignable(node, isBinding, refDestructuringErrors);
3628
+ }
3629
+ checkLocal(id) {
3630
+ const node = id.id || id;
3631
+ (defaultGlobals.has(node.name) || node.name === "arguments") && this.raise(node.start, `Identifier '${node.name}' is reserved`);
3632
+ }
3633
+ checkUnreserved(node) {
3634
+ return (node.name === "viewof" || node.name === "mutable") && this.raise(node.start, `Unexpected keyword '${node.name}'`), super.checkUnreserved(node);
3635
+ }
3636
+ checkLValSimple(expr, bindingType, checkClashes) {
3637
+ return super.checkLValSimple(
3638
+ expr.type === "MutableExpression" ? expr.id : expr,
3639
+ bindingType,
3640
+ checkClashes
3641
+ );
3642
+ }
3643
+ unexpected(pos) {
3644
+ this.raise(
3645
+ pos ?? this.start,
3646
+ this.type === types$1.eof ? "Unexpected end of input" : "Unexpected token"
3647
+ );
3648
+ }
3649
+ parseMaybeKeywordExpression(keyword, type) {
3650
+ if (this.isContextual(keyword)) {
3651
+ const node = this.startNode();
3652
+ return this.next(), node.id = this.parseIdent(), this.finishNode(node, type);
3653
+ }
3654
+ }
3655
+ }
3656
+ const o_tmpl = new TokContext(
3657
+ "`",
3658
+ // token
3659
+ !0,
3660
+ // isExpr
3661
+ !0,
3662
+ // preserveSpace
3663
+ (parser) => readTemplateToken.call(parser)
3664
+ // override
3665
+ );
3666
+ class TemplateCellParser extends CellParser {
3667
+ constructor(...args) {
3668
+ super(...args), this.type = types$1.backQuote, this.exprAllowed = !1;
3669
+ }
3670
+ initialContext() {
3671
+ return [o_tmpl];
3672
+ }
3673
+ parseCell(node) {
3674
+ this.startCell(), this.type === types$1.eof && (this.value = "");
3675
+ const isTagged = !0, body = this.startNode();
3676
+ body.expressions = [];
3677
+ let curElt = this.parseTemplateElement({ isTagged });
3678
+ for (body.quasis = [curElt]; this.type !== types$1.eof; )
3679
+ this.expect(types$1.dollarBraceL), body.expressions.push(this.parseExpression()), this.expect(types$1.braceR), body.quasis.push(curElt = this.parseTemplateElement({ isTagged }));
3680
+ return curElt.tail = !0, this.next(), this.finishNode(body, "TemplateLiteral"), this.expect(types$1.eof), this.finishCell(node, body, null);
3681
+ }
3682
+ }
3683
+ function readTemplateToken() {
3684
+ out: for (; this.pos < this.input.length; this.pos++)
3685
+ switch (this.input.charCodeAt(this.pos)) {
3686
+ case 92: {
3687
+ this.pos < this.input.length - 1 && ++this.pos;
3688
+ break;
3689
+ }
3690
+ case 36: {
3691
+ if (this.input.charCodeAt(this.pos + 1) === 123) {
3692
+ if (this.pos === this.start && this.type === types$1.invalidTemplate)
3693
+ return this.pos += 2, this.finishToken(types$1.dollarBraceL);
3694
+ break out;
3695
+ }
3696
+ break;
3697
+ }
3698
+ }
3699
+ return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos));
3700
+ }
3701
+ class CellTagParser extends Parser {
3702
+ constructor(options, ...args) {
3703
+ super(Object.assign({ ecmaVersion: 12 }, options), ...args);
3704
+ }
3705
+ enterScope(flags) {
3706
+ return flags & SCOPE_FUNCTION && ++this.O_function, super.enterScope(flags);
3707
+ }
3708
+ exitScope() {
3709
+ return this.currentScope().flags & SCOPE_FUNCTION && --this.O_function, super.exitScope();
3710
+ }
3711
+ parseForIn(node, init) {
3712
+ return this.O_function === 1 && node.await && (this.O_async = !0), super.parseForIn(node, init);
3713
+ }
3714
+ parseAwait() {
3715
+ return this.O_function === 1 && (this.O_async = !0), super.parseAwait();
3716
+ }
3717
+ parseYield(noIn) {
3718
+ return this.O_function === 1 && (this.O_generator = !0), super.parseYield(noIn);
3719
+ }
3720
+ parseTopLevel(node) {
3721
+ return this.O_function = 0, this.O_async = !1, this.O_generator = !1, this.strict = !0, this.enterScope(SCOPE_FUNCTION | SCOPE_ASYNC | SCOPE_GENERATOR), node.body = this.parseExpression(), node.input = this.input, node.async = this.O_async, node.generator = this.O_generator, this.exitScope(), this.finishNode(node, "CellTag");
3722
+ }
3723
+ }
3724
+ function parseReferences(cell, input, globals = defaultGlobals) {
3725
+ if (!cell.body)
3726
+ cell.references = [];
3727
+ else if (cell.body.type === "ImportDeclaration")
3728
+ cell.references = cell.body.injections ? cell.body.injections.map((i) => i.imported) : [];
3729
+ else
3730
+ try {
3731
+ cell.references = findReferences(cell, globals);
3732
+ } catch (error) {
3733
+ if (error.node) {
3734
+ const loc = getLineInfo(input, error.node.start);
3735
+ error.message += ` (${loc.line}:${loc.column})`, error.pos = error.node.start, error.loc = loc, delete error.node;
3736
+ }
3737
+ throw error;
3738
+ }
3739
+ return cell;
3740
+ }
3741
+ function parseFeatures(cell, input) {
3742
+ if (cell.body && cell.body.type !== "ImportDeclaration")
3743
+ try {
3744
+ cell.fileAttachments = findFeatures(cell, "FileAttachment"), cell.databaseClients = findFeatures(cell, "DatabaseClient"), cell.secrets = findFeatures(cell, "Secret"), cell.notificationClients = findFeatures(cell, "NotificationClient");
3745
+ } catch (error) {
3746
+ if (error.node) {
3747
+ const loc = getLineInfo(input, error.node.start);
3748
+ error.message += ` (${loc.line}:${loc.column})`, error.pos = error.node.start, error.loc = loc, delete error.node;
3749
+ }
3750
+ throw error;
3751
+ }
3752
+ else
3753
+ cell.fileAttachments = /* @__PURE__ */ new Map(), cell.databaseClients = /* @__PURE__ */ new Map(), cell.secrets = /* @__PURE__ */ new Map(), cell.notificationClients = /* @__PURE__ */ new Map();
3754
+ return cell;
3755
+ }
3756
+ class ModuleParser extends CellParser {
3757
+ parseTopLevel(node) {
3758
+ for (node.cells || (node.cells = []); this.type !== types$1.eof; ) {
3759
+ const cell = this.parseCell(this.startNode());
3760
+ cell.input = this.input, node.cells.push(cell);
3761
+ }
3762
+ return this.next(), this.finishNode(node, "Program");
3763
+ }
3764
+ }
3765
+ function splitModule(input) {
3766
+ return ModuleParser.parse(input, { ecmaVersion: "latest" }).cells.map((cell) => ({
3767
+ type: "Cell",
3768
+ text: input.substring(cell.start, cell.end),
3769
+ start: cell.start,
3770
+ end: cell.end
3771
+ }));
3772
+ }
3773
+ function parseCell$1(input) {
3774
+ return parseCell$2(input);
3775
+ }
3776
+ const walk = ohqWalk, FuncTypes = {
3777
+ functionType: Object.getPrototypeOf(function() {
3778
+ }).constructor,
3779
+ asyncFunctionType: Object.getPrototypeOf(async function() {
3780
+ }).constructor,
3781
+ generatorFunctionType: Object.getPrototypeOf(function* () {
3782
+ }).constructor,
3783
+ asyncGeneratorFunctionType: Object.getPrototypeOf(async function* () {
3784
+ }).constructor
3785
+ };
3786
+ function funcType(async = !1, generator = !1) {
3787
+ return !async && !generator ? FuncTypes.functionType : async && !generator ? FuncTypes.asyncFunctionType : !async && generator ? FuncTypes.generatorFunctionType : FuncTypes.asyncGeneratorFunctionType;
3788
+ }
3789
+ function createFunction(refs, async = !1, generator = !1, blockStatement = !1, body) {
3790
+ if (body !== void 0)
3791
+ return refs.patches.sort((l, r) => r.start - l.start), refs.patches.forEach((r) => {
3792
+ body = body.substring(0, r.start) + r.newText + body.substring(r.end);
3793
+ }), new (funcType(async, generator))(...refs.args, blockStatement ? body.substring(1, body.length - 1).trim() : `return (
3794
+ ${body}
3795
+ );`);
3796
+ }
3797
+ function join(baseURL, relativeURL) {
3798
+ return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
3799
+ }
3800
+ const isRelativePath = (path) => path[0] === ".", fixRelativeUrl = (path, basePath) => isRelativePath(path) ? join(basePath, path) : path;
3801
+ async function obfuscatedImport(url) {
3802
+ return new FuncTypes.asyncFunctionType("url", "return import(url)")(url);
3803
+ }
3804
+ function encodeBacktick(str) {
3805
+ return str.split("`").join("\\`");
3806
+ }
3807
+ function createParsedOJS(ojs, offset2, inlineMD) {
3808
+ let cell, error;
3809
+ try {
3810
+ cell = parseCell$1(ojs);
3811
+ } catch (e) {
3812
+ error = e;
3813
+ }
3814
+ return {
3815
+ ojs,
3816
+ offset: offset2,
3817
+ inlineMD,
3818
+ cell,
3819
+ error
3820
+ };
3821
+ }
3822
+ function splitOmd(_) {
3823
+ const retVal = [], re = /(```(?:\s|\S)[\s\S]*?```)/g;
3824
+ let prevOffset = 0, match = re.exec(_);
3825
+ for (; match !== null; ) {
3826
+ match.index > prevOffset && retVal.push(createParsedOJS(_.substring(prevOffset, match.index), prevOffset, !0));
3827
+ const outer = match[0];
3828
+ if (outer.indexOf("``` ") === 0 || outer.indexOf("```\n") === 0 || outer.indexOf("```\r\n") === 0) {
3829
+ const inner = outer.substring(3, outer.length - 3);
3830
+ retVal.push(createParsedOJS(inner, match.index + 3, !1));
3831
+ } else
3832
+ retVal.push(createParsedOJS(outer, match.index, !0));
3833
+ prevOffset = match.index + match[0].length, match = re.exec(_);
3834
+ }
3835
+ return _.length > prevOffset && retVal.push(createParsedOJS(_.substring(prevOffset, _.length), prevOffset, !0)), retVal;
3836
+ }
3837
+ function ojs2notebook(ojs) {
3838
+ const cells = splitModule(ojs);
3839
+ return {
3840
+ files: [],
3841
+ nodes: cells.map((cell, idx) => ({
3842
+ id: idx,
3843
+ mode: "js",
3844
+ value: cell.text,
3845
+ start: cell.start,
3846
+ end: cell.end
3847
+ }))
3848
+ };
3849
+ }
3850
+ function omd2notebook(omd) {
3851
+ const cells = splitOmd(omd);
3852
+ return {
3853
+ files: [],
3854
+ nodes: cells.map((cell, idx) => ({
3855
+ id: idx,
3856
+ mode: cell.inlineMD ? "md" : "js",
3857
+ value: cell.ojs,
3858
+ start: cell.offset,
3859
+ end: cell.offset + cell.ojs.length
3860
+ }))
3861
+ };
3862
+ }
3863
+ function fetchEx(url, proxyPrefix = "https://api.codetabs.com/v1/proxy/?quest=", proxyPostfix = "") {
3864
+ const matches = url.match(/^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n?]+)/img);
3865
+ if (!matches || matches.length === 0)
3866
+ throw new Error(`Invalid URL: ${url}`);
3867
+ return fetch(url, { headers: { origin: matches[0], referer: url } }).then((response) => {
3868
+ if (response.ok) return response;
3869
+ throw new Error("CORS?");
3870
+ }).catch((e) => (url = `${proxyPrefix}${url}${proxyPostfix}`, fetch(url, { headers: { origin: matches[0], referer: url } })));
3871
+ }
3872
+ function download(impUrl, proxyPrefix, proxyPostfix) {
3873
+ const isShared = impUrl.indexOf("https://observablehq.com/d") === 0;
3874
+ return fetchEx(impUrl.replace(`https://observablehq.com/${isShared ? "d/" : ""}`, "https://api.observablehq.com/document/"), proxyPrefix, proxyPostfix).then((r) => r.json());
3875
+ }
3876
+ function calcRefs(cellAst, cellStr) {
3877
+ if (cellAst.references === void 0) return { inputs: [], args: [], patches: [] };
3878
+ const dedup = {};
3879
+ cellAst.references.forEach((r) => dedup[cellStr.substring(r.start, r.end)] = !0);
3880
+ const retVal = {
3881
+ inputs: Object.keys(dedup),
3882
+ args: Object.keys(dedup).map((r) => r.split(" ").join("_")),
3883
+ patches: []
3884
+ }, pushPatch = (node, newText) => {
3885
+ var _a, _b;
3886
+ return retVal.patches.push({ start: node.start - (((_a = cellAst.body) == null ? void 0 : _a.start) ?? 0), end: node.end - (((_b = cellAst.body) == null ? void 0 : _b.start) ?? 0), newText });
3887
+ };
3888
+ return cellAst.body && ancestor(cellAst.body, {
3889
+ Identifier(node) {
3890
+ cellStr.substring(node.start, node.end);
3891
+ },
3892
+ MutableExpression(node) {
3893
+ const newText = cellStr.substring(node.start, node.end).split(" ").join("_") + ".value";
3894
+ pushPatch(node, newText);
3895
+ },
3896
+ ViewExpression(node) {
3897
+ const newText = cellStr.substring(node.start, node.end).split(" ").join("_");
3898
+ pushPatch(node, newText);
3899
+ },
3900
+ ThisExpression(node, ancestors) {
3901
+ cellStr.substring(node.start, node.end) === "this" && !ancestors.find((n) => n.type === "FunctionExpression") && pushPatch(node, "((this === globalThis || this === globalThis.window)? undefined : this?.valueOf())");
3902
+ }
3903
+ }, walk), retVal;
3904
+ }
3905
+ function parseImportDeclaration(cellAst) {
3906
+ var _a, _b;
3907
+ return {
3908
+ type: "import",
3909
+ src: cellAst.body.source.value,
3910
+ specifiers: ((_a = cellAst.body.specifiers) == null ? void 0 : _a.map((spec) => {
3911
+ var _a2;
3912
+ return {
3913
+ view: spec.view,
3914
+ name: spec.imported.name,
3915
+ alias: (_a2 = spec.local) != null && _a2.name && spec.imported.name !== spec.local.name ? spec.local.name : spec.imported.name
3916
+ };
3917
+ })) ?? [],
3918
+ injections: ((_b = cellAst.body.injections) == null ? void 0 : _b.map((inj) => {
3919
+ var _a2;
3920
+ return {
3921
+ name: inj.imported.name,
3922
+ alias: ((_a2 = inj.local) == null ? void 0 : _a2.name) ?? inj.imported.name
3923
+ };
3924
+ })) ?? []
3925
+ };
3926
+ }
3927
+ function parseViewExpression(cellStr, cellAst, refs, bodyStr) {
3928
+ var _a, _b;
3929
+ const id = cellAst.id && cellStr.substring(cellAst.id.start, cellAst.id.end);
3930
+ return {
3931
+ type: "viewof",
3932
+ variable: {
3933
+ type: "variable",
3934
+ id,
3935
+ inputs: refs.inputs,
3936
+ func: createFunction(refs, cellAst.async, cellAst.generator, cellAst.body.type === "BlockStatement", bodyStr)
3937
+ },
3938
+ variableValue: {
3939
+ type: "variable",
3940
+ id: (_b = (_a = cellAst == null ? void 0 : cellAst.id) == null ? void 0 : _a.id) == null ? void 0 : _b.name,
3941
+ inputs: ["Generators", id],
3942
+ func: (G, _) => G.input(_)
3943
+ }
3944
+ };
3945
+ }
3946
+ function parseMutableExpression(cellStr, cellAst, refs, bodyStr) {
3947
+ var _a, _b;
3948
+ const id = cellAst.id && cellStr.substring(cellAst.id.start, cellAst.id.end), initialValueId = (_b = (_a = cellAst == null ? void 0 : cellAst.id) == null ? void 0 : _a.id) == null ? void 0 : _b.name, initialId = `initial ${initialValueId}`;
3949
+ return {
3950
+ type: "mutable",
3951
+ initial: {
3952
+ type: "variable",
3953
+ id: initialId,
3954
+ inputs: refs.inputs,
3955
+ func: createFunction(refs, cellAst.async, cellAst.generator, cellAst.body.type === "BlockStatement", bodyStr)
3956
+ },
3957
+ variable: {
3958
+ type: "variable",
3959
+ id,
3960
+ inputs: ["Mutable", initialId],
3961
+ func: (M, _) => new M(_)
3962
+ },
3963
+ variableValue: {
3964
+ type: "variable",
3965
+ id: initialValueId,
3966
+ inputs: [id],
3967
+ func: (_) => _.generator
3968
+ }
3969
+ };
3970
+ }
3971
+ function parseVariableExpression(cellStr, cellAst, refs, bodyStr) {
3972
+ var _a, _b;
3973
+ return {
3974
+ type: "variable",
3975
+ id: cellAst.id && cellStr.substring((_a = cellAst.id) == null ? void 0 : _a.start, (_b = cellAst.id) == null ? void 0 : _b.end),
3976
+ inputs: refs.inputs,
3977
+ func: createFunction(refs, cellAst.async, cellAst.generator, cellAst.body.type === "BlockStatement", bodyStr)
3978
+ };
3979
+ }
3980
+ function parseCell(cellStr, baseUrl) {
3981
+ var _a, _b;
3982
+ const cellAst = parseCell$1(cellStr);
3983
+ let bodyStr = cellAst.body && cellStr.substring(cellAst.body.start, cellAst.body.end);
3984
+ switch ((_a = cellAst.body) == null ? void 0 : _a.type) {
3985
+ case "ImportDeclaration":
3986
+ return parseImportDeclaration(cellAst);
3987
+ case "ImportExpression":
3988
+ switch (cellAst.body.source.type) {
3989
+ case "Literal":
3990
+ bodyStr = `import("${fixRelativeUrl("" + cellAst.body.source.value, baseUrl)}")`;
3991
+ break;
3992
+ default:
3993
+ console.error("Unexpected import value");
3994
+ }
3995
+ }
3996
+ const refs = calcRefs(cellAst, cellStr);
3997
+ switch ((_b = cellAst.id) == null ? void 0 : _b.type) {
3998
+ case "ViewExpression":
3999
+ return parseViewExpression(cellStr, cellAst, refs, bodyStr);
4000
+ case "MutableExpression":
4001
+ return parseMutableExpression(cellStr, cellAst, refs, bodyStr);
4002
+ default:
4003
+ return parseVariableExpression(cellStr, cellAst, refs, bodyStr);
4004
+ }
4005
+ }
4006
+ class Writer {
4007
+ constructor() {
4008
+ __publicField(this, "_files", []);
4009
+ __publicField(this, "_imports", []);
4010
+ __publicField(this, "_functions", []);
4011
+ __publicField(this, "_defines", []);
4012
+ __publicField(this, "_defineUid", 0);
4013
+ __publicField(this, "_functionUid", 0);
4014
+ }
4015
+ toString() {
4016
+ return `${this._imports.join(`
12
4017
  `)}
13
4018
 
14
4019
  ${this._functions.join(`
@@ -20,7 +4025,7 @@ export default function define(runtime, observer) {
20
4025
 
21
4026
  function toString() { return this.url; }
22
4027
  const fileAttachments = new Map([
23
- ${this._files.map(t=>`["${t.name}", { url: new URL("${t.url}"), mimeType: ${JSON.stringify(t.mime_type)}, toString }]`).join(`,
4028
+ ${this._files.map((f) => `["${f.name}", { url: new URL("${f.url}"), mimeType: ${JSON.stringify(f.mime_type)}, toString }]`).join(`,
24
4029
  `)}
25
4030
  ]);
26
4031
  main.builtin("FileAttachment", runtime.fileAttachments(name => fileAttachments.get(name)));
@@ -30,7 +4035,205 @@ export default function define(runtime, observer) {
30
4035
 
31
4036
  return main;
32
4037
  }
33
- `}files(t){this._files=[...this._files,...t]}import(t){this._imports.push(`import define${++this._defineUid} from "${t}"; `)}importDefine(t){let i=t.injections??[],r=i.map(o=>o.name===o.alias?`"${o.name}"`:`{name: "${o.name}", alias: "${o.alias}"}`),s=i.length?`.derive([${r.join(", ")}], main)`:"";this._defines.push(`const child${this._defineUid} = runtime.module(define${this._defineUid})${s};`),(t.specifiers??[]).forEach(o=>{this._defines.push(`main.import("${o.name}"${o.alias&&o.alias!==o.name?`, "${o.alias}"`:""}, child${this._defineUid}); `)})}function(t){let i=t.id??`${++this._functionUid}`,r=i.split(" ");return i=`_${r[r.length-1]}`,this._functions.push(`${t.func?.toString()?.replace("anonymous",`${i}`)}`),i}define(t,i=!0,r=!1,s){s=s??t.id;let n=i?`.variable(observer(${t.id?JSON.stringify(t.id):""}))`:"",o=t.id?`${JSON.stringify(t.id)}, `:"",h=t.inputs??[],u=h.length?`[${h.map(p=>JSON.stringify(p)).join(", ")}], `:"",l=r?t.func?.toString():s;this._defines.push(`main${n}.define(${o}${u}${l});`)}error(t){}};async function Ji(e,t){let i=oe(e,t),r=await me(i).then(o=>o.text()),s;e.endsWith(".ojsnb")?s=JSON.parse(r):e.endsWith(".ojs")?s=Te(r):e.endsWith(".omd")?s=et(r):(console.warn(`Unknown file type: ${e}, assuming .ojsnb`),s=JSON.parse(r));let n=Zt(s,{baseUrl:t});return n.delete=()=>{},n.write=o=>{o.import(i)},n}async function Xi(e){let t=`https://api.observablehq.com/${e[0]==="@"?e:`d/${e}`}.js?v=3`,i={default:function(s,n){}};try{i=await Kt(t)}catch{}let r=i.default;return r.delete=()=>{},r.write=s=>{s.import(t)},r}async function Zi(e){let t=`https://api.observablehq.com/document/${e}`,i=me(t).then(s=>s.json()).catch(s=>{console.error(t),console.error(s)}),r=Zt(await i);return r.delete=()=>{},r.write=s=>{s.import(t)},r}async function er(e,t,i,{baseUrl:r,importMode:s}){let n=Ze(t.src)?await Ji(t.src,r??""):s==="recursive"?await Zi(t.src):await Xi(t.src),o=[],h=[];t.specifiers.forEach(l=>{let p=l.view?"viewof ":"";o.push(Jt(p+l.name,p+l.alias)),l.view&&o.push(Jt(l.name,l.alias))});let u=(l,p,v)=>{let E=l.module(n);return t.injections.length&&(E=E.derive(t.injections,p)),h.forEach(V=>V(p,v)),o.forEach(V=>V(p,E)),E};return u.importVariables=o,u.variables=h,u.delete=()=>{o.forEach(l=>l.delete()),h.forEach(l=>l.delete()),n.delete()},u.write=l=>{n.write(l),l.importDefine(t)},u}function X(e,t,i,r,s,n=!1){let o,h,u=(l,p)=>{if(t&&p&&(o=p(i,e.id)),h=l.variable(o),arguments.length>1)try{h.define(i,r,s)}catch(v){console.error(v?.message)}if(e.pinned){h=p?l.variable(p(i,e.id)):l.variable();try{h.define(void 0,["md"],v=>v`\`\`\`js
34
- ${e.value}
35
- \`\`\``)}catch(v){console.error(v?.message)}}return h};return u.delete=()=>{try{o?._node?.remove()}catch{}o=void 0;try{h?.delete()}catch{}h=void 0},u.write=l=>{if(n)l.define({id:i,inputs:r,func:s},t,!0);else{let p=l.function({id:i,func:s});l.define({id:i,inputs:r,func:s},t,!1,p)}},u}function Jt(e,t){let i,r=(s,n)=>{i=s.variable(),t===void 0?i.import(e,n):i.import(e,t,n)};return r.delete=()=>{i?.delete()},r}async function Xt(e,t){let i=[],r=[];try{let n=e.mode&&e.mode!=="js"?`${e.mode}\`${Qt(e.value)}\``:e.value,o=Pe(n);for(let h of o){let u=Yt(h.text,t.baseUrl??"");switch(u.type){case"import":i.push(await er(e,u,h.text,t));break;case"viewof":r.push(X(e,!0,u.variable.id,u.variable.inputs,u.variable.func)),r.push(X(e,!1,u.variableValue.id,u.variableValue.inputs,u.variableValue.func,!0));break;case"mutable":r.push(X(e,!1,u.initial.id,u.initial.inputs,u.initial.func)),r.push(X(e,!1,u.variable.id,u.variable.inputs,u.variable.func)),r.push(X(e,!0,u.variableValue.id,u.variableValue.inputs,u.variableValue.func,!0));break;case"variable":r.push(X(e,!0,u.id,u.inputs,u.func));break}}}catch(n){r.push(X(e,!0,void 0,[],n.message??"Unkown error"))}let s=(n,o,h)=>{i.forEach(u=>u(n,o,h)),r.forEach(u=>u(o,h))};return s.id=e.id,s.modules=i,s.variables=r,s.delete=()=>{r.forEach(n=>n.delete()),i.forEach(n=>n.delete())},s.write=n=>{i.forEach(o=>o.write(n)),r.forEach(o=>o.write(n))},s}function tr(e,t){function i(){return globalThis.url??""}return[e.name,{url:new URL(oe(e.url,t.baseUrl??"")),mimeType:e.mime_type,toString:i}]}function ir(e=[],t=[],{baseUrl:i=".",importMode:r="precompiled"}={}){let s=e.map(u=>tr(u,{baseUrl:i,importMode:r})),n=new Map(s),o=new Map(t.map(u=>[u.id,u])),h=(u,l)=>{let p=u.module();return p.builtin("FileAttachment",u.fileAttachments(v=>n.get(v)??{url:new URL(oe(v,i)),mimeType:null})),p.builtin("fetchEx",me),o.forEach(v=>{v(u,p,l)}),p};return h.fileAttachments=n,h.cells=o,h.set=async u=>{let l=await Xt(u,{baseUrl:i,importMode:r});return h.delete(l.id),o.set(l.id,l),l},h.get=u=>o.get(u),h.delete=u=>{let l=o.get(u);return l?(l.delete(),o.delete(u)):!1},h.clear=()=>{o.forEach(u=>u.delete()),o.clear()},h.write=u=>{u.files(e),o.forEach(l=>l.write(u))},h.toString=(u=new Re)=>(h.write(u),u.toString().trim()),h}async function Zt(e,{baseUrl:t=".",importMode:i="precompiled"}={}){let r=typeof e=="string"?Te(e):e,s=await Promise.all(r.nodes.map(n=>Xt(n,{baseUrl:t,importMode:i})));return ir(r.files,s,{baseUrl:t,importMode:i})}export{Re as Writer,Zt as compile,zi as download,ir as notebook,Te as ojs2notebook,et as omd2notebook};
4038
+ `;
4039
+ }
4040
+ files(files) {
4041
+ this._files = [...this._files, ...files];
4042
+ }
4043
+ import(url) {
4044
+ this._imports.push(`import define${++this._defineUid} from "${url}"; `);
4045
+ }
4046
+ importDefine(imp) {
4047
+ const impInjections = imp.injections ?? [], injections = impInjections.map((inj) => inj.name === inj.alias ? `"${inj.name}"` : `{name: "${inj.name}", alias: "${inj.alias}"}`), derive = impInjections.length ? `.derive([${injections.join(", ")}], main)` : "";
4048
+ this._defines.push(`const child${this._defineUid} = runtime.module(define${this._defineUid})${derive};`), (imp.specifiers ?? []).forEach((s) => {
4049
+ this._defines.push(`main.import("${s.name}"${s.alias && s.alias !== s.name ? `, "${s.alias}"` : ""}, child${this._defineUid}); `);
4050
+ });
4051
+ }
4052
+ function(variable) {
4053
+ var _a, _b;
4054
+ let id = variable.id ?? `${++this._functionUid}`;
4055
+ const idParts = id.split(" ");
4056
+ return id = `_${idParts[idParts.length - 1]}`, this._functions.push(`${(_b = (_a = variable.func) == null ? void 0 : _a.toString()) == null ? void 0 : _b.replace("anonymous", `${id}`)}`), id;
4057
+ }
4058
+ define(variable, observable = !0, inlineFunc = !1, funcId) {
4059
+ var _a;
4060
+ funcId = funcId ?? variable.id;
4061
+ const observe = observable ? `.variable(observer(${variable.id ? JSON.stringify(variable.id) : ""}))` : "", id = variable.id ? `${JSON.stringify(variable.id)}, ` : "", variableInputs = variable.inputs ?? [], inputs = variableInputs.length ? `[${variableInputs.map((i) => JSON.stringify(i)).join(", ")}], ` : "", func = inlineFunc ? (_a = variable.func) == null ? void 0 : _a.toString() : funcId;
4062
+ this._defines.push(`main${observe}.define(${id}${inputs}${func});`);
4063
+ }
4064
+ error(msg) {
4065
+ }
4066
+ }
4067
+ async function importFile(relativePath, baseUrl) {
4068
+ const path = fixRelativeUrl(relativePath, baseUrl), content = await fetchEx(path).then((r) => r.text());
4069
+ let notebook2;
4070
+ relativePath.endsWith(".ojsnb") ? notebook2 = JSON.parse(content) : relativePath.endsWith(".ojs") ? notebook2 = ojs2notebook(content) : relativePath.endsWith(".omd") ? notebook2 = omd2notebook(content) : (console.warn(`Unknown file type: ${relativePath}, assuming .ojsnb`), notebook2 = JSON.parse(content));
4071
+ const retVal = compile(notebook2, { baseUrl });
4072
+ return retVal.delete = () => {
4073
+ }, retVal.write = (w) => {
4074
+ w.import(path);
4075
+ }, retVal;
4076
+ }
4077
+ async function importCompiledNotebook(partial) {
4078
+ const url = `https://api.observablehq.com/${partial[0] === "@" ? partial : `d/${partial}`}.js?v=3`;
4079
+ let impMod = {
4080
+ default: function(runtime, inspector) {
4081
+ }
4082
+ };
4083
+ try {
4084
+ impMod = await obfuscatedImport(url);
4085
+ } catch {
4086
+ }
4087
+ const retVal = impMod.default;
4088
+ return retVal.delete = () => {
4089
+ }, retVal.write = (w) => {
4090
+ w.import(url);
4091
+ }, retVal;
4092
+ }
4093
+ async function importNotebook(partial) {
4094
+ const url = `https://api.observablehq.com/document/${partial}`, notebook2 = fetchEx(url).then((r) => r.json()).catch((e) => {
4095
+ console.error(url), console.error(e);
4096
+ }), retVal = compile(await notebook2);
4097
+ return retVal.delete = () => {
4098
+ }, retVal.write = (w) => {
4099
+ w.import(url);
4100
+ }, retVal;
4101
+ }
4102
+ async function createModule(node, parsed, text, { baseUrl, importMode }) {
4103
+ const otherModule = isRelativePath(parsed.src) ? await importFile(parsed.src, baseUrl ?? "") : importMode === "recursive" ? await importNotebook(parsed.src) : await importCompiledNotebook(parsed.src), importVariables = [], variables = [];
4104
+ parsed.specifiers.forEach((spec) => {
4105
+ const viewof = spec.view ? "viewof " : "";
4106
+ importVariables.push(createImportVariable(viewof + spec.name, viewof + spec.alias)), spec.view && importVariables.push(createImportVariable(spec.name, spec.alias));
4107
+ });
4108
+ const retVal = (runtime, main, inspector) => {
4109
+ let mod = runtime.module(otherModule);
4110
+ return parsed.injections.length && (mod = mod.derive(parsed.injections, main)), variables.forEach((v) => v(main, inspector)), importVariables.forEach((v) => v(main, mod)), mod;
4111
+ };
4112
+ return retVal.importVariables = importVariables, retVal.variables = variables, retVal.delete = () => {
4113
+ importVariables.forEach((v) => v.delete()), variables.forEach((v) => v.delete()), otherModule.delete();
4114
+ }, retVal.write = (w) => {
4115
+ otherModule.write(w), w.importDefine(parsed);
4116
+ }, retVal;
4117
+ }
4118
+ function createVariable(node, inspect, name, inputs, definition, inline = !1) {
4119
+ let i, v;
4120
+ const retVal = (module, inspector) => {
4121
+ if (inspect && inspector && (i = inspector(name, node.id)), v = module.variable(i), arguments.length > 1)
4122
+ try {
4123
+ v.define(name, inputs, definition);
4124
+ } catch (e) {
4125
+ console.error(e == null ? void 0 : e.message);
4126
+ }
4127
+ if (node.pinned) {
4128
+ v = inspector ? module.variable(inspector(name, node.id)) : module.variable();
4129
+ try {
4130
+ v.define(void 0, ["md"], (md) => md`\`\`\`js
4131
+ ${node.value}
4132
+ \`\`\``);
4133
+ } catch (e) {
4134
+ console.error(e == null ? void 0 : e.message);
4135
+ }
4136
+ }
4137
+ return v;
4138
+ };
4139
+ return retVal.delete = () => {
4140
+ var _a;
4141
+ try {
4142
+ (_a = i == null ? void 0 : i._node) == null || _a.remove();
4143
+ } catch {
4144
+ }
4145
+ i = void 0;
4146
+ try {
4147
+ v == null || v.delete();
4148
+ } catch {
4149
+ }
4150
+ v = void 0;
4151
+ }, retVal.write = (w) => {
4152
+ if (inline)
4153
+ w.define({ id: name, inputs, func: definition }, inspect, !0);
4154
+ else {
4155
+ const id = w.function({ id: name, func: definition });
4156
+ w.define({ id: name, inputs, func: definition }, inspect, !1, id);
4157
+ }
4158
+ }, retVal;
4159
+ }
4160
+ function createImportVariable(name, alias) {
4161
+ let v;
4162
+ const retVal = (main, otherModule) => {
4163
+ v = main.variable(), alias === void 0 ? v.import(name, otherModule) : v.import(name, alias, otherModule);
4164
+ };
4165
+ return retVal.delete = () => {
4166
+ v == null || v.delete();
4167
+ }, retVal;
4168
+ }
4169
+ async function createCell(node, options) {
4170
+ const modules = [], variables = [];
4171
+ try {
4172
+ const text = node.mode && node.mode !== "js" ? `${node.mode}\`${encodeBacktick(node.value)}\`` : node.value, parsedModule = splitModule(text);
4173
+ for (const cell of parsedModule) {
4174
+ const parsed = parseCell(cell.text, options.baseUrl ?? "");
4175
+ switch (parsed.type) {
4176
+ case "import":
4177
+ modules.push(await createModule(node, parsed, cell.text, options));
4178
+ break;
4179
+ case "viewof":
4180
+ variables.push(createVariable(node, !0, parsed.variable.id, parsed.variable.inputs, parsed.variable.func)), variables.push(createVariable(node, !1, parsed.variableValue.id, parsed.variableValue.inputs, parsed.variableValue.func, !0));
4181
+ break;
4182
+ case "mutable":
4183
+ variables.push(createVariable(node, !1, parsed.initial.id, parsed.initial.inputs, parsed.initial.func)), variables.push(createVariable(node, !1, parsed.variable.id, parsed.variable.inputs, parsed.variable.func)), variables.push(createVariable(node, !0, parsed.variableValue.id, parsed.variableValue.inputs, parsed.variableValue.func, !0));
4184
+ break;
4185
+ case "variable":
4186
+ variables.push(createVariable(node, !0, parsed.id, parsed.inputs, parsed.func));
4187
+ break;
4188
+ }
4189
+ }
4190
+ } catch (e) {
4191
+ variables.push(createVariable(node, !0, void 0, [], e.message ?? "Unkown error"));
4192
+ }
4193
+ const retVal = (runtime, main, inspector) => {
4194
+ modules.forEach((imp) => imp(runtime, main, inspector)), variables.forEach((v) => v(main, inspector));
4195
+ };
4196
+ return retVal.id = node.id, retVal.modules = modules, retVal.variables = variables, retVal.delete = () => {
4197
+ variables.forEach((v) => v.delete()), modules.forEach((mod) => mod.delete());
4198
+ }, retVal.write = (w) => {
4199
+ modules.forEach((imp) => imp.write(w)), variables.forEach((v) => v.write(w));
4200
+ }, retVal;
4201
+ }
4202
+ function createFile(file, options) {
4203
+ function toString2() {
4204
+ return globalThis.url ?? "";
4205
+ }
4206
+ return [file.name, { url: new URL(fixRelativeUrl(file.url, options.baseUrl ?? "")), mimeType: file.mime_type, toString: toString2 }];
4207
+ }
4208
+ function notebook(_files = [], _cells = [], { baseUrl = ".", importMode = "precompiled" } = {}) {
4209
+ const files = _files.map((f) => createFile(f, { baseUrl, importMode })), fileAttachments = new Map(files), cells = new Map(_cells.map((c) => [c.id, c])), retVal = (runtime, inspector) => {
4210
+ const main = runtime.module();
4211
+ return main.builtin("FileAttachment", runtime.fileAttachments((name) => fileAttachments.get(name) ?? { url: new URL(fixRelativeUrl(name, baseUrl)), mimeType: null })), main.builtin("fetchEx", fetchEx), cells.forEach((cell) => {
4212
+ cell(runtime, main, inspector);
4213
+ }), main;
4214
+ };
4215
+ return retVal.fileAttachments = fileAttachments, retVal.cells = cells, retVal.set = async (n) => {
4216
+ const cell = await createCell(n, { baseUrl, importMode });
4217
+ return retVal.delete(cell.id), cells.set(cell.id, cell), cell;
4218
+ }, retVal.get = (id) => cells.get(id), retVal.delete = (id) => {
4219
+ const cell = cells.get(id);
4220
+ return cell ? (cell.delete(), cells.delete(id)) : !1;
4221
+ }, retVal.clear = () => {
4222
+ cells.forEach((cell) => cell.delete()), cells.clear();
4223
+ }, retVal.write = (w) => {
4224
+ w.files(_files), cells.forEach((cell) => cell.write(w));
4225
+ }, retVal.toString = (w = new Writer()) => (retVal.write(w), w.toString().trim()), retVal;
4226
+ }
4227
+ async function compile(notebookOrOjs, { baseUrl = ".", importMode = "precompiled" } = {}) {
4228
+ const ojsNotebook = typeof notebookOrOjs == "string" ? ojs2notebook(notebookOrOjs) : notebookOrOjs, _cells = await Promise.all(ojsNotebook.nodes.map((n) => createCell(n, { baseUrl, importMode })));
4229
+ return notebook(ojsNotebook.files, _cells, { baseUrl, importMode });
4230
+ }
4231
+ export {
4232
+ Writer,
4233
+ compile,
4234
+ download,
4235
+ notebook,
4236
+ ojs2notebook,
4237
+ omd2notebook
4238
+ };
36
4239
  //# sourceMappingURL=index.js.map