diff --git a/dist/gibberish.js b/dist/gibberish.js index b2a8842..7bce5c3 100644 --- a/dist/gibberish.js +++ b/dist/gibberish.js @@ -627,7 +627,8 @@ module.exports = ( _props ) => { if( usingWorklet === true && ugen.node !== null ) { ugen.node.port.postMessage({ key:'set', idx:ugen.memory.value.idx, value:ugen.max }) }else{ - gen.memory.heap[ ugen.memory.value.idx ] = ugen.max + if( gen.memory && gen.memory.heap ) + gen.memory.heap[ ugen.memory.value.idx ] = ugen.max } } @@ -5461,21 +5462,5834 @@ var AWPF = function (self = window, bufferSize = 4096) { module.exports = AWPF; },{"./realm.js":93}],91:[function(require,module,exports){ -"use strict";function _classCallCheck3(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;ikey in obj?__defProp(obj,key,{enumerable:true,configurable:true,writable:true,value}):obj[key]=value;var __publicField=(obj,key,value)=>{__defNormalProp(obj,typeof key!=="symbol"?key+"":key,value);return value;};Object.defineProperties(exports,_defineProperty({__esModule:{value:true}},Symbol.toStringTag,{value:"Module"}));function _mergeNamespaces(n,m){for(var i2=0;i2e[k]});}}}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}));}function peg$subclass(child,parent){function C(){this.constructor=child;}C.prototype=parent.prototype;child.prototype=new C();}function peg$SyntaxError(message,expected,found,location){var self=Error.call(this,message);if(Object.setPrototypeOf){Object.setPrototypeOf(self,peg$SyntaxError.prototype);}self.expected=expected;self.found=found;self.location=location;self.name="SyntaxError";return self;}peg$subclass(peg$SyntaxError,Error);function peg$padEnd(str,targetLength,padString){padString=padString||" ";if(str.length>targetLength){return str;}targetLength-=str.length;padString+=padString.repeat(targetLength);return str+padString.slice(0,targetLength);}peg$SyntaxError.prototype.format=function(sources){var str="Error: "+this.message;if(this.location){var src=null;var k;for(k=0;k "+loc+"\n"+filler+" |\n"+s.line+" | "+line+"\n"+filler+" | "+peg$padEnd("",s.column-1," ")+peg$padEnd("",hatLen,"^");}else{str+="\n at "+loc;}}return str;};peg$SyntaxError.buildMessage=function(expected,found){var DESCRIBE_EXPECTATION_FNS={literal:function(expectation){return'"'+literalEscape(expectation.text)+'"';},class:function(expectation){var escapedParts=expectation.parts.map(function(part){return Array.isArray(part)?classEscape(part[0])+"-"+classEscape(part[1]):classEscape(part);});return"["+(expectation.inverted?"^":"")+escapedParts.join("")+"]";},any:function(){return"any character";},end:function(){return"end of input";},other:function(expectation){return expectation.description;}};function hex(ch){return ch.charCodeAt(0).toString(16).toUpperCase();}function literalEscape(s){return s.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(ch){return"\\x0"+hex(ch);}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(ch){return"\\x"+hex(ch);});}function classEscape(s){return s.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(ch){return"\\x0"+hex(ch);}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(ch){return"\\x"+hex(ch);});}function describeExpectation(expectation){return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);}function describeExpected(expected2){var descriptions=expected2.map(describeExpectation);var i2,j;descriptions.sort();if(descriptions.length>0){for(i2=1,j=1;i2",false);var peg$e23=peg$literalExpectation("@",false);var peg$e24=peg$literalExpectation("!",false);var peg$e25=peg$literalExpectation("(",false);var peg$e26=peg$literalExpectation(")",false);var peg$e27=peg$literalExpectation("/",false);var peg$e28=peg$literalExpectation("*",false);var peg$e29=peg$literalExpectation("%",false);var peg$e30=peg$literalExpectation("?",false);var peg$e31=peg$literalExpectation("struct",false);var peg$e32=peg$literalExpectation("target",false);var peg$e33=peg$literalExpectation("euclid",false);var peg$e34=peg$literalExpectation("slow",false);var peg$e35=peg$literalExpectation("rotL",false);var peg$e36=peg$literalExpectation("rotR",false);var peg$e37=peg$literalExpectation("fast",false);var peg$e38=peg$literalExpectation("scale",false);var peg$e39=peg$literalExpectation("//",false);var peg$e40=peg$classExpectation(["\n"],true,false);var peg$e41=peg$literalExpectation("cat",false);var peg$e42=peg$literalExpectation("$",false);var peg$e43=peg$literalExpectation("setcps",false);var peg$e44=peg$literalExpectation("setbpm",false);var peg$e45=peg$literalExpectation("hush",false);var peg$f0=function(){return parseFloat(text());};var peg$f1=function(chars){return chars.join("");};var peg$f2=function(s){return s;};var peg$f3=function(sc){sc.arguments_.alignment="t";return sc;};var peg$f4=function(a){return{weight:a};};var peg$f5=function(a){return{replicate:a};};var peg$f6=function(p2,s,r){return{operator:{type_:"bjorklund",arguments_:{pulse:p2,step:s,rotation:r||0}}};};var peg$f7=function(a){return{operator:{type_:"stretch",arguments_:{amount:a}}};};var peg$f8=function(a){return{operator:{type_:"stretch",arguments_:{amount:"1/"+a}}};};var peg$f9=function(a){return{operator:{type_:"fixed-step",arguments_:{amount:a}}};};var peg$f10=function(a){return{operator:{type_:"degradeBy",arguments_:{amount:a?a:0.5}}};};var peg$f11=function(s,o){return new ElementStub(s,o);};var peg$f12=function(s){return new PatternStub(s,"h");};var peg$f13=function(tail){return{alignment:"v",list:tail};};var peg$f14=function(tail){return{alignment:"r",list:tail};};var peg$f15=function(head,tail){if(tail&&tail.list.length>0){return new PatternStub([head,...tail.list],tail.alignment);}else{return head;}};var peg$f16=function(sc){return sc;};var peg$f17=function(s){return{name:"struct",args:{sequence:s}};};var peg$f18=function(s){return{name:"target",args:{name:s}};};var peg$f19=function(p2,s,r){return{name:"bjorklund",args:{pulse:parseInt(p2),step:parseInt(s)}};};var peg$f20=function(a){return{name:"stretch",args:{amount:a}};};var peg$f21=function(a){return{name:"shift",args:{amount:"-"+a}};};var peg$f22=function(a){return{name:"shift",args:{amount:a}};};var peg$f23=function(a){return{name:"stretch",args:{amount:"1/"+a}};};var peg$f24=function(s){return{name:"scale",args:{scale:s.join("")}};};var peg$f25=function(s,v){return v;};var peg$f26=function(s,ss){ss.unshift(s);return new PatternStub(ss,"t");};var peg$f27=function(sg){return sg;};var peg$f28=function(o,soc){return new OperatorStub(o.name,o.args,soc);};var peg$f29=function(sc){return sc;};var peg$f30=function(c){return c;};var peg$f31=function(v){return new CommandStub("setcps",{value:v});};var peg$f32=function(v){return new CommandStub("setcps",{value:v/120/2});};var peg$f33=function(){return new CommandStub("hush");};var peg$currPos=0;var peg$savedPos=0;var peg$posDetailsCache=[{line:1,column:1}];var peg$maxFailPos=0;var peg$maxFailExpected=[];var peg$silentFails=0;var peg$result;if("startRule"in options){if(!(options.startRule in peg$startRuleFunctions)){throw new Error(`Can't start parsing from rule "`+options.startRule+'".');}peg$startRuleFunction=peg$startRuleFunctions[options.startRule];}function text(){return input.substring(peg$savedPos,peg$currPos);}function location(){return peg$computeLocation(peg$savedPos,peg$currPos);}function peg$literalExpectation(text2,ignoreCase){return{type:"literal",text:text2,ignoreCase};}function peg$classExpectation(parts,inverted,ignoreCase){return{type:"class",parts,inverted,ignoreCase};}function peg$endExpectation(){return{type:"end"};}function peg$otherExpectation(description){return{type:"other",description};}function peg$computePosDetails(pos){var details=peg$posDetailsCache[pos];var p2;if(details){return details;}else{p2=pos-1;while(!peg$posDetailsCache[p2]){p2--;}details=peg$posDetailsCache[p2];details={line:details.line,column:details.column};while(p2peg$maxFailPos){peg$maxFailPos=peg$currPos;peg$maxFailExpected=[];}peg$maxFailExpected.push(expected);}function peg$buildStructuredError(expected,found,location2){return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected,found),expected,found,location2);}function peg$parsestart(){var s0;s0=peg$parsestatement();return s0;}function peg$parsenumber(){var s0,s2;peg$silentFails++;s0=peg$currPos;peg$parseminus();s2=peg$parseint();if(s2!==peg$FAILED){peg$parsefrac();peg$parseexp();peg$savedPos=s0;s0=peg$f0();}else{peg$currPos=s0;s0=peg$FAILED;}peg$silentFails--;if(s0===peg$FAILED){if(peg$silentFails===0){peg$fail(peg$e0);}}return s0;}function peg$parsedecimal_point(){var s0;if(input.charCodeAt(peg$currPos)===46){s0=peg$c0;peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e1);}}return s0;}function peg$parsedigit1_9(){var s0;if(peg$r0.test(input.charAt(peg$currPos))){s0=input.charAt(peg$currPos);peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e2);}}return s0;}function peg$parsee(){var s0;if(peg$r1.test(input.charAt(peg$currPos))){s0=input.charAt(peg$currPos);peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e3);}}return s0;}function peg$parseexp(){var s0,s1,s2,s3,s4;s0=peg$currPos;s1=peg$parsee();if(s1!==peg$FAILED){s2=peg$parseminus();if(s2===peg$FAILED){s2=peg$parseplus();}if(s2===peg$FAILED){s2=null;}s3=[];s4=peg$parseDIGIT();if(s4!==peg$FAILED){while(s4!==peg$FAILED){s3.push(s4);s4=peg$parseDIGIT();}}else{s3=peg$FAILED;}if(s3!==peg$FAILED){s1=[s1,s2,s3];s0=s1;}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsefrac(){var s0,s1,s2,s3;s0=peg$currPos;s1=peg$parsedecimal_point();if(s1!==peg$FAILED){s2=[];s3=peg$parseDIGIT();if(s3!==peg$FAILED){while(s3!==peg$FAILED){s2.push(s3);s3=peg$parseDIGIT();}}else{s2=peg$FAILED;}if(s2!==peg$FAILED){s1=[s1,s2];s0=s1;}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parseint(){var s0,s1,s2,s3;s0=peg$parsezero();if(s0===peg$FAILED){s0=peg$currPos;s1=peg$parsedigit1_9();if(s1!==peg$FAILED){s2=[];s3=peg$parseDIGIT();while(s3!==peg$FAILED){s2.push(s3);s3=peg$parseDIGIT();}s1=[s1,s2];s0=s1;}else{peg$currPos=s0;s0=peg$FAILED;}}return s0;}function peg$parseminus(){var s0;if(input.charCodeAt(peg$currPos)===45){s0=peg$c1;peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e4);}}return s0;}function peg$parseplus(){var s0;if(input.charCodeAt(peg$currPos)===43){s0=peg$c2;peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e5);}}return s0;}function peg$parsezero(){var s0;if(input.charCodeAt(peg$currPos)===48){s0=peg$c3;peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e6);}}return s0;}function peg$parseDIGIT(){var s0;if(peg$r2.test(input.charAt(peg$currPos))){s0=input.charAt(peg$currPos);peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e7);}}return s0;}function peg$parsews(){var s0,s1;peg$silentFails++;s0=[];if(peg$r3.test(input.charAt(peg$currPos))){s1=input.charAt(peg$currPos);peg$currPos++;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e9);}}while(s1!==peg$FAILED){s0.push(s1);if(peg$r3.test(input.charAt(peg$currPos))){s1=input.charAt(peg$currPos);peg$currPos++;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e9);}}}peg$silentFails--;s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e8);}return s0;}function peg$parsecomma(){var s0,s1,s2,s3;s0=peg$currPos;s1=peg$parsews();if(input.charCodeAt(peg$currPos)===44){s2=peg$c4;peg$currPos++;}else{s2=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e10);}}if(s2!==peg$FAILED){s3=peg$parsews();s1=[s1,s2,s3];s0=s1;}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsepipe(){var s0,s1,s2,s3;s0=peg$currPos;s1=peg$parsews();if(input.charCodeAt(peg$currPos)===124){s2=peg$c5;peg$currPos++;}else{s2=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e11);}}if(s2!==peg$FAILED){s3=peg$parsews();s1=[s1,s2,s3];s0=s1;}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsequote(){var s0;if(input.charCodeAt(peg$currPos)===34){s0=peg$c6;peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e12);}}if(s0===peg$FAILED){if(input.charCodeAt(peg$currPos)===39){s0=peg$c7;peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e13);}}}return s0;}function peg$parsestep_char(){var s0;if(peg$r4.test(input.charAt(peg$currPos))){s0=input.charAt(peg$currPos);peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e14);}}if(s0===peg$FAILED){if(input.charCodeAt(peg$currPos)===45){s0=peg$c1;peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e4);}}if(s0===peg$FAILED){if(input.charCodeAt(peg$currPos)===35){s0=peg$c8;peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e15);}}if(s0===peg$FAILED){if(input.charCodeAt(peg$currPos)===46){s0=peg$c0;peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e1);}}if(s0===peg$FAILED){if(input.charCodeAt(peg$currPos)===94){s0=peg$c9;peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e16);}}if(s0===peg$FAILED){if(input.charCodeAt(peg$currPos)===95){s0=peg$c10;peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e17);}}if(s0===peg$FAILED){if(input.charCodeAt(peg$currPos)===58){s0=peg$c11;peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e18);}}}}}}}}return s0;}function peg$parsestep(){var s0,s2,s3;s0=peg$currPos;peg$parsews();s2=[];s3=peg$parsestep_char();if(s3!==peg$FAILED){while(s3!==peg$FAILED){s2.push(s3);s3=peg$parsestep_char();}}else{s2=peg$FAILED;}if(s2!==peg$FAILED){s3=peg$parsews();peg$savedPos=s0;s0=peg$f1(s2);}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsesub_cycle(){var s0,s2,s4,s6;s0=peg$currPos;peg$parsews();if(input.charCodeAt(peg$currPos)===91){s2=peg$c12;peg$currPos++;}else{s2=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e19);}}if(s2!==peg$FAILED){peg$parsews();s4=peg$parsestack_or_choose();if(s4!==peg$FAILED){peg$parsews();if(input.charCodeAt(peg$currPos)===93){s6=peg$c13;peg$currPos++;}else{s6=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e20);}}if(s6!==peg$FAILED){peg$parsews();peg$savedPos=s0;s0=peg$f2(s4);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsetimeline(){var s0,s2,s4,s6;s0=peg$currPos;peg$parsews();if(input.charCodeAt(peg$currPos)===60){s2=peg$c14;peg$currPos++;}else{s2=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e21);}}if(s2!==peg$FAILED){peg$parsews();s4=peg$parsesingle_cycle();if(s4!==peg$FAILED){peg$parsews();if(input.charCodeAt(peg$currPos)===62){s6=peg$c15;peg$currPos++;}else{s6=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e22);}}if(s6!==peg$FAILED){peg$parsews();peg$savedPos=s0;s0=peg$f3(s4);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parseslice(){var s0;s0=peg$parsestep();if(s0===peg$FAILED){s0=peg$parsesub_cycle();if(s0===peg$FAILED){s0=peg$parsetimeline();}}return s0;}function peg$parseslice_modifier(){var s0;s0=peg$parseslice_weight();if(s0===peg$FAILED){s0=peg$parseslice_bjorklund();if(s0===peg$FAILED){s0=peg$parseslice_slow();if(s0===peg$FAILED){s0=peg$parseslice_fast();if(s0===peg$FAILED){s0=peg$parseslice_fixed_step();if(s0===peg$FAILED){s0=peg$parseslice_replicate();if(s0===peg$FAILED){s0=peg$parseslice_degrade();}}}}}}return s0;}function peg$parseslice_weight(){var s0,s1,s2;s0=peg$currPos;if(input.charCodeAt(peg$currPos)===64){s1=peg$c16;peg$currPos++;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e23);}}if(s1!==peg$FAILED){s2=peg$parsenumber();if(s2!==peg$FAILED){peg$savedPos=s0;s0=peg$f4(s2);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parseslice_replicate(){var s0,s1,s2;s0=peg$currPos;if(input.charCodeAt(peg$currPos)===33){s1=peg$c17;peg$currPos++;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e24);}}if(s1!==peg$FAILED){s2=peg$parsenumber();if(s2!==peg$FAILED){peg$savedPos=s0;s0=peg$f5(s2);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parseslice_bjorklund(){var s0,s1,s3,s5,s7,s11,s13;s0=peg$currPos;if(input.charCodeAt(peg$currPos)===40){s1=peg$c18;peg$currPos++;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e25);}}if(s1!==peg$FAILED){peg$parsews();s3=peg$parsenumber();if(s3!==peg$FAILED){peg$parsews();s5=peg$parsecomma();if(s5!==peg$FAILED){peg$parsews();s7=peg$parsenumber();if(s7!==peg$FAILED){peg$parsews();peg$parsecomma();peg$parsews();s11=peg$parsenumber();if(s11===peg$FAILED){s11=null;}peg$parsews();if(input.charCodeAt(peg$currPos)===41){s13=peg$c19;peg$currPos++;}else{s13=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e26);}}if(s13!==peg$FAILED){peg$savedPos=s0;s0=peg$f6(s3,s7,s11);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parseslice_slow(){var s0,s1,s2;s0=peg$currPos;if(input.charCodeAt(peg$currPos)===47){s1=peg$c20;peg$currPos++;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e27);}}if(s1!==peg$FAILED){s2=peg$parsenumber();if(s2!==peg$FAILED){peg$savedPos=s0;s0=peg$f7(s2);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parseslice_fast(){var s0,s1,s2;s0=peg$currPos;if(input.charCodeAt(peg$currPos)===42){s1=peg$c21;peg$currPos++;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e28);}}if(s1!==peg$FAILED){s2=peg$parsenumber();if(s2!==peg$FAILED){peg$savedPos=s0;s0=peg$f8(s2);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parseslice_fixed_step(){var s0,s1,s2;s0=peg$currPos;if(input.charCodeAt(peg$currPos)===37){s1=peg$c22;peg$currPos++;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e29);}}if(s1!==peg$FAILED){s2=peg$parsenumber();if(s2!==peg$FAILED){peg$savedPos=s0;s0=peg$f9(s2);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parseslice_degrade(){var s0,s1,s2;s0=peg$currPos;if(input.charCodeAt(peg$currPos)===63){s1=peg$c23;peg$currPos++;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e30);}}if(s1!==peg$FAILED){s2=peg$parsenumber();if(s2===peg$FAILED){s2=null;}peg$savedPos=s0;s0=peg$f10(s2);}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parseslice_with_modifier(){var s0,s1,s2;s0=peg$currPos;s1=peg$parseslice();if(s1!==peg$FAILED){s2=peg$parseslice_modifier();if(s2===peg$FAILED){s2=null;}peg$savedPos=s0;s0=peg$f11(s1,s2);}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsesingle_cycle(){var s0,s1,s2;s0=peg$currPos;s1=[];s2=peg$parseslice_with_modifier();if(s2!==peg$FAILED){while(s2!==peg$FAILED){s1.push(s2);s2=peg$parseslice_with_modifier();}}else{s1=peg$FAILED;}if(s1!==peg$FAILED){peg$savedPos=s0;s1=peg$f12(s1);}s0=s1;return s0;}function peg$parsestack_tail(){var s0,s1,s2,s3,s4;s0=peg$currPos;s1=[];s2=peg$currPos;s3=peg$parsecomma();if(s3!==peg$FAILED){s4=peg$parsesingle_cycle();if(s4!==peg$FAILED){s2=s4;}else{peg$currPos=s2;s2=peg$FAILED;}}else{peg$currPos=s2;s2=peg$FAILED;}if(s2!==peg$FAILED){while(s2!==peg$FAILED){s1.push(s2);s2=peg$currPos;s3=peg$parsecomma();if(s3!==peg$FAILED){s4=peg$parsesingle_cycle();if(s4!==peg$FAILED){s2=s4;}else{peg$currPos=s2;s2=peg$FAILED;}}else{peg$currPos=s2;s2=peg$FAILED;}}}else{s1=peg$FAILED;}if(s1!==peg$FAILED){peg$savedPos=s0;s1=peg$f13(s1);}s0=s1;return s0;}function peg$parsechoose_tail(){var s0,s1,s2,s3,s4;s0=peg$currPos;s1=[];s2=peg$currPos;s3=peg$parsepipe();if(s3!==peg$FAILED){s4=peg$parsesingle_cycle();if(s4!==peg$FAILED){s2=s4;}else{peg$currPos=s2;s2=peg$FAILED;}}else{peg$currPos=s2;s2=peg$FAILED;}if(s2!==peg$FAILED){while(s2!==peg$FAILED){s1.push(s2);s2=peg$currPos;s3=peg$parsepipe();if(s3!==peg$FAILED){s4=peg$parsesingle_cycle();if(s4!==peg$FAILED){s2=s4;}else{peg$currPos=s2;s2=peg$FAILED;}}else{peg$currPos=s2;s2=peg$FAILED;}}}else{s1=peg$FAILED;}if(s1!==peg$FAILED){peg$savedPos=s0;s1=peg$f14(s1);}s0=s1;return s0;}function peg$parsestack_or_choose(){var s0,s1,s2;s0=peg$currPos;s1=peg$parsesingle_cycle();if(s1!==peg$FAILED){s2=peg$parsestack_tail();if(s2===peg$FAILED){s2=peg$parsechoose_tail();}if(s2===peg$FAILED){s2=null;}peg$savedPos=s0;s0=peg$f15(s1,s2);}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsesequence(){var s0,s2,s3,s4;s0=peg$currPos;peg$parsews();s2=peg$parsequote();if(s2!==peg$FAILED){s3=peg$parsestack_or_choose();if(s3!==peg$FAILED){s4=peg$parsequote();if(s4!==peg$FAILED){peg$savedPos=s0;s0=peg$f16(s3);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parseoperator(){var s0;s0=peg$parsescale();if(s0===peg$FAILED){s0=peg$parseslow();if(s0===peg$FAILED){s0=peg$parsefast();if(s0===peg$FAILED){s0=peg$parsetarget();if(s0===peg$FAILED){s0=peg$parsebjorklund();if(s0===peg$FAILED){s0=peg$parsestruct();if(s0===peg$FAILED){s0=peg$parserotR();if(s0===peg$FAILED){s0=peg$parserotL();}}}}}}}return s0;}function peg$parsestruct(){var s0,s1,s3;s0=peg$currPos;if(input.substr(peg$currPos,6)===peg$c24){s1=peg$c24;peg$currPos+=6;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e31);}}if(s1!==peg$FAILED){peg$parsews();s3=peg$parsesequence_or_operator();if(s3!==peg$FAILED){peg$savedPos=s0;s0=peg$f17(s3);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsetarget(){var s0,s1,s3,s4,s5;s0=peg$currPos;if(input.substr(peg$currPos,6)===peg$c25){s1=peg$c25;peg$currPos+=6;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e32);}}if(s1!==peg$FAILED){peg$parsews();s3=peg$parsequote();if(s3!==peg$FAILED){s4=peg$parsestep();if(s4!==peg$FAILED){s5=peg$parsequote();if(s5!==peg$FAILED){peg$savedPos=s0;s0=peg$f18(s4);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsebjorklund(){var s0,s1,s3,s5;s0=peg$currPos;if(input.substr(peg$currPos,6)===peg$c26){s1=peg$c26;peg$currPos+=6;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e33);}}if(s1!==peg$FAILED){peg$parsews();s3=peg$parseint();if(s3!==peg$FAILED){peg$parsews();s5=peg$parseint();if(s5!==peg$FAILED){peg$parsews();peg$parseint();peg$savedPos=s0;s0=peg$f19(s3,s5);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parseslow(){var s0,s1,s3;s0=peg$currPos;if(input.substr(peg$currPos,4)===peg$c27){s1=peg$c27;peg$currPos+=4;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e34);}}if(s1!==peg$FAILED){peg$parsews();s3=peg$parsenumber();if(s3!==peg$FAILED){peg$savedPos=s0;s0=peg$f20(s3);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parserotL(){var s0,s1,s3;s0=peg$currPos;if(input.substr(peg$currPos,4)===peg$c28){s1=peg$c28;peg$currPos+=4;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e35);}}if(s1!==peg$FAILED){peg$parsews();s3=peg$parsenumber();if(s3!==peg$FAILED){peg$savedPos=s0;s0=peg$f21(s3);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parserotR(){var s0,s1,s3;s0=peg$currPos;if(input.substr(peg$currPos,4)===peg$c29){s1=peg$c29;peg$currPos+=4;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e36);}}if(s1!==peg$FAILED){peg$parsews();s3=peg$parsenumber();if(s3!==peg$FAILED){peg$savedPos=s0;s0=peg$f22(s3);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsefast(){var s0,s1,s3;s0=peg$currPos;if(input.substr(peg$currPos,4)===peg$c30){s1=peg$c30;peg$currPos+=4;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e37);}}if(s1!==peg$FAILED){peg$parsews();s3=peg$parsenumber();if(s3!==peg$FAILED){peg$savedPos=s0;s0=peg$f23(s3);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsescale(){var s0,s1,s3,s4,s5;s0=peg$currPos;if(input.substr(peg$currPos,5)===peg$c31){s1=peg$c31;peg$currPos+=5;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e38);}}if(s1!==peg$FAILED){peg$parsews();s3=peg$parsequote();if(s3!==peg$FAILED){s4=[];s5=peg$parsestep_char();if(s5!==peg$FAILED){while(s5!==peg$FAILED){s4.push(s5);s5=peg$parsestep_char();}}else{s4=peg$FAILED;}if(s4!==peg$FAILED){s5=peg$parsequote();if(s5!==peg$FAILED){peg$savedPos=s0;s0=peg$f24(s4);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsecomment(){var s0,s1,s2,s3;s0=peg$currPos;if(input.substr(peg$currPos,2)===peg$c32){s1=peg$c32;peg$currPos+=2;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e39);}}if(s1!==peg$FAILED){s2=[];if(peg$r5.test(input.charAt(peg$currPos))){s3=input.charAt(peg$currPos);peg$currPos++;}else{s3=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e40);}}while(s3!==peg$FAILED){s2.push(s3);if(peg$r5.test(input.charAt(peg$currPos))){s3=input.charAt(peg$currPos);peg$currPos++;}else{s3=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e40);}}}s1=[s1,s2];s0=s1;}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsecat(){var s0,s1,s3,s5,s6,s7,s8,s9;s0=peg$currPos;if(input.substr(peg$currPos,3)===peg$c33){s1=peg$c33;peg$currPos+=3;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e41);}}if(s1!==peg$FAILED){peg$parsews();if(input.charCodeAt(peg$currPos)===91){s3=peg$c12;peg$currPos++;}else{s3=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e19);}}if(s3!==peg$FAILED){peg$parsews();s5=peg$parsesequence_or_operator();if(s5!==peg$FAILED){s6=[];s7=peg$currPos;s8=peg$parsecomma();if(s8!==peg$FAILED){s9=peg$parsesequence_or_operator();if(s9!==peg$FAILED){peg$savedPos=s7;s7=peg$f25(s5,s9);}else{peg$currPos=s7;s7=peg$FAILED;}}else{peg$currPos=s7;s7=peg$FAILED;}while(s7!==peg$FAILED){s6.push(s7);s7=peg$currPos;s8=peg$parsecomma();if(s8!==peg$FAILED){s9=peg$parsesequence_or_operator();if(s9!==peg$FAILED){peg$savedPos=s7;s7=peg$f25(s5,s9);}else{peg$currPos=s7;s7=peg$FAILED;}}else{peg$currPos=s7;s7=peg$FAILED;}}s7=peg$parsews();if(input.charCodeAt(peg$currPos)===93){s8=peg$c13;peg$currPos++;}else{s8=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e20);}}if(s8!==peg$FAILED){peg$savedPos=s0;s0=peg$f26(s5,s6);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsesequence_or_group(){var s0;s0=peg$parsecat();if(s0===peg$FAILED){s0=peg$parsesequence();}return s0;}function peg$parsesequence_or_operator(){var s0,s1,s3,s4,s5;s0=peg$currPos;s1=peg$parsesequence_or_group();if(s1!==peg$FAILED){peg$parsews();s3=[];s4=peg$parsecomment();while(s4!==peg$FAILED){s3.push(s4);s4=peg$parsecomment();}peg$savedPos=s0;s0=peg$f27(s1);}else{peg$currPos=s0;s0=peg$FAILED;}if(s0===peg$FAILED){s0=peg$currPos;s1=peg$parseoperator();if(s1!==peg$FAILED){peg$parsews();if(input.charCodeAt(peg$currPos)===36){s3=peg$c34;peg$currPos++;}else{s3=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e42);}}if(s3!==peg$FAILED){s4=peg$parsews();s5=peg$parsesequence_or_operator();if(s5!==peg$FAILED){peg$savedPos=s0;s0=peg$f28(s1,s5);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}return s0;}function peg$parsesequ_or_operator_or_comment(){var s0,s1;s0=peg$currPos;s1=peg$parsesequence_or_operator();if(s1!==peg$FAILED){peg$savedPos=s0;s1=peg$f29(s1);}s0=s1;if(s0===peg$FAILED){s0=peg$parsecomment();}return s0;}function peg$parsesequence_definition(){var s0;s0=peg$parsesequ_or_operator_or_comment();return s0;}function peg$parsecommand(){var s0,s2;s0=peg$currPos;peg$parsews();s2=peg$parsesetcps();if(s2===peg$FAILED){s2=peg$parsesetbpm();if(s2===peg$FAILED){s2=peg$parsehush();}}if(s2!==peg$FAILED){peg$parsews();peg$savedPos=s0;s0=peg$f30(s2);}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsesetcps(){var s0,s1,s3;s0=peg$currPos;if(input.substr(peg$currPos,6)===peg$c35){s1=peg$c35;peg$currPos+=6;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e43);}}if(s1!==peg$FAILED){peg$parsews();s3=peg$parsenumber();if(s3!==peg$FAILED){peg$savedPos=s0;s0=peg$f31(s3);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsesetbpm(){var s0,s1,s3;s0=peg$currPos;if(input.substr(peg$currPos,6)===peg$c36){s1=peg$c36;peg$currPos+=6;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e44);}}if(s1!==peg$FAILED){peg$parsews();s3=peg$parsenumber();if(s3!==peg$FAILED){peg$savedPos=s0;s0=peg$f32(s3);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsehush(){var s0,s1;s0=peg$currPos;if(input.substr(peg$currPos,4)===peg$c37){s1=peg$c37;peg$currPos+=4;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e45);}}if(s1!==peg$FAILED){peg$savedPos=s0;s1=peg$f33();}s0=s1;return s0;}function peg$parsestatement(){var s0;s0=peg$parsesequence_definition();if(s0===peg$FAILED){s0=peg$parsecommand();}return s0;}var PatternStub=function(source,alignment){this.type_="pattern";this.arguments_={alignment};this.source_=source;};var OperatorStub=function(name,args,source){this.type_=name;this.arguments_=args;this.source_=source;};var ElementStub=function(source,options2){this.type_="element";this.source_=source;this.options_=options2;this.location_=location();};var CommandStub=function(name,options2){this.type_="command";this.name_=name;this.options_=options2;};peg$result=peg$startRuleFunction();if(peg$result!==peg$FAILED&&peg$currPos===input.length){return peg$result;}else{if(peg$result!==peg$FAILED&&peg$currPos key in obj ? __defProp(obj, key, { + enumerable: true, + configurable: true, + writable: true, + value +}) : obj[key] = value; + +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + + return value; +}; + +Object.defineProperties(exports, _defineProperty({ + __esModule: { + value: true + } +}, Symbol.toStringTag, { + value: "Module" +})); + +function getDefaultExportFromCjs(x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x; +} + +function peg$subclass(child, parent) { + function C() { + this.constructor = child; + } + + C.prototype = parent.prototype; + child.prototype = new C(); +} + +function peg$SyntaxError(message, expected, found, location) { + var self = Error.call(this, message); + + if (Object.setPrototypeOf) { + Object.setPrototypeOf(self, peg$SyntaxError.prototype); + } + + self.expected = expected; + self.found = found; + self.location = location; + self.name = "SyntaxError"; + return self; +} + +peg$subclass(peg$SyntaxError, Error); + +function peg$padEnd(str, targetLength, padString) { + padString = padString || " "; + + if (str.length > targetLength) { + return str; + } + + targetLength -= str.length; + padString += padString.repeat(targetLength); + return str + padString.slice(0, targetLength); +} + +peg$SyntaxError.prototype.format = function (sources) { + var str = "Error: " + this.message; + + if (this.location) { + var src = null; + var k; + + for (k = 0; k < sources.length; k++) { + if (sources[k].source === this.location.source) { + src = sources[k].text.split(/\r\n|\n|\r/g); + break; + } + } + + var s = this.location.start; + var loc = this.location.source + ":" + s.line + ":" + s.column; + + if (src) { + var e = this.location.end; + var filler = peg$padEnd("", s.line.toString().length, " "); + var line = src[s.line - 1]; + var last = s.line === e.line ? e.column : line.length + 1; + var hatLen = last - s.column || 1; + str += "\n --> " + loc + "\n" + filler + " |\n" + s.line + " | " + line + "\n" + filler + " | " + peg$padEnd("", s.column - 1, " ") + peg$padEnd("", hatLen, "^"); + } else { + str += "\n at " + loc; + } + } + + return str; +}; + +peg$SyntaxError.buildMessage = function (expected, found) { + var DESCRIBE_EXPECTATION_FNS = { + literal: function (expectation) { + return '"' + literalEscape(expectation.text) + '"'; + }, + class: function (expectation) { + var escapedParts = expectation.parts.map(function (part) { + return Array.isArray(part) ? classEscape(part[0]) + "-" + classEscape(part[1]) : classEscape(part); + }); + return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]"; + }, + any: function () { + return "any character"; + }, + end: function () { + return "end of input"; + }, + other: function (expectation) { + return expectation.description; + } + }; + + function hex(ch) { + return ch.charCodeAt(0).toString(16).toUpperCase(); + } + + function literalEscape(s) { + return s.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function (ch) { + return "\\x0" + hex(ch); + }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { + return "\\x" + hex(ch); + }); + } + + function classEscape(s) { + return s.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function (ch) { + return "\\x0" + hex(ch); + }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { + return "\\x" + hex(ch); + }); + } + + function describeExpectation(expectation) { + return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation); + } + + function describeExpected(expected2) { + var descriptions = expected2.map(describeExpectation); + var i, j; + descriptions.sort(); + + if (descriptions.length > 0) { + for (i = 1, j = 1; i < descriptions.length; i++) { + if (descriptions[i - 1] !== descriptions[i]) { + descriptions[j] = descriptions[i]; + j++; + } + } + + descriptions.length = j; + } + + switch (descriptions.length) { + case 1: + return descriptions[0]; + + case 2: + return descriptions[0] + " or " + descriptions[1]; + + default: + return descriptions.slice(0, -1).join(", ") + ", or " + descriptions[descriptions.length - 1]; + } + } + + function describeFound(found2) { + return found2 ? '"' + literalEscape(found2) + '"' : "end of input"; + } + + return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found."; +}; + +function peg$parse(input, options) { + options = options !== void 0 ? options : {}; + var peg$FAILED = {}; + var peg$source = options.grammarSource; + var peg$startRuleFunctions = { + start: peg$parsestart + }; + var peg$startRuleFunction = peg$parsestart; + var peg$c0 = "."; + var peg$c1 = "-"; + var peg$c2 = "+"; + var peg$c3 = "0"; + var peg$c4 = ","; + var peg$c5 = "|"; + var peg$c6 = '"'; + var peg$c7 = "'"; + var peg$c8 = "#"; + var peg$c9 = "^"; + var peg$c10 = "_"; + var peg$c11 = ":"; + var peg$c12 = "["; + var peg$c13 = "]"; + var peg$c14 = "<"; + var peg$c15 = ">"; + var peg$c16 = "@"; + var peg$c17 = "!"; + var peg$c18 = "("; + var peg$c19 = ")"; + var peg$c20 = "/"; + var peg$c21 = "*"; + var peg$c22 = "%"; + var peg$c23 = "?"; + var peg$c24 = "<~"; + var peg$c25 = "~>"; + var peg$c26 = "struct"; + var peg$c27 = "target"; + var peg$c28 = "euclid"; + var peg$c29 = "slow"; + var peg$c30 = "rotL"; + var peg$c31 = "rotR"; + var peg$c32 = "fast"; + var peg$c33 = "scale"; + var peg$c34 = "//"; + var peg$c35 = "cat"; + var peg$c36 = "$"; + var peg$c37 = "setcps"; + var peg$c38 = "setbpm"; + var peg$c39 = "hush"; + var peg$r0 = /^[1-9]/; + var peg$r1 = /^[eE]/; + var peg$r2 = /^[0-9]/; + var peg$r3 = /^[ \n\r\t]/; + var peg$r4 = /^[0-9a-zA-Z~]/; + var peg$r5 = /^[^\n]/; + var peg$e0 = peg$otherExpectation("number"); + var peg$e1 = peg$literalExpectation(".", false); + var peg$e2 = peg$classExpectation([["1", "9"]], false, false); + var peg$e3 = peg$classExpectation(["e", "E"], false, false); + var peg$e4 = peg$literalExpectation("-", false); + var peg$e5 = peg$literalExpectation("+", false); + var peg$e6 = peg$literalExpectation("0", false); + var peg$e7 = peg$classExpectation([["0", "9"]], false, false); + var peg$e8 = peg$otherExpectation("whitespace"); + var peg$e9 = peg$classExpectation([" ", "\n", "\r", " "], false, false); + var peg$e10 = peg$literalExpectation(",", false); + var peg$e11 = peg$literalExpectation("|", false); + var peg$e12 = peg$literalExpectation('"', false); + var peg$e13 = peg$literalExpectation("'", false); + var peg$e14 = peg$classExpectation([["0", "9"], ["a", "z"], ["A", "Z"], "~"], false, false); + var peg$e15 = peg$literalExpectation("#", false); + var peg$e16 = peg$literalExpectation("^", false); + var peg$e17 = peg$literalExpectation("_", false); + var peg$e18 = peg$literalExpectation(":", false); + var peg$e19 = peg$literalExpectation("[", false); + var peg$e20 = peg$literalExpectation("]", false); + var peg$e21 = peg$literalExpectation("<", false); + var peg$e22 = peg$literalExpectation(">", false); + var peg$e23 = peg$literalExpectation("@", false); + var peg$e24 = peg$literalExpectation("!", false); + var peg$e25 = peg$literalExpectation("(", false); + var peg$e26 = peg$literalExpectation(")", false); + var peg$e27 = peg$literalExpectation("/", false); + var peg$e28 = peg$literalExpectation("*", false); + var peg$e29 = peg$literalExpectation("%", false); + var peg$e30 = peg$literalExpectation("?", false); + var peg$e31 = peg$literalExpectation("<~", false); + var peg$e32 = peg$literalExpectation("~>", false); + var peg$e33 = peg$literalExpectation("struct", false); + var peg$e34 = peg$literalExpectation("target", false); + var peg$e35 = peg$literalExpectation("euclid", false); + var peg$e36 = peg$literalExpectation("slow", false); + var peg$e37 = peg$literalExpectation("rotL", false); + var peg$e38 = peg$literalExpectation("rotR", false); + var peg$e39 = peg$literalExpectation("fast", false); + var peg$e40 = peg$literalExpectation("scale", false); + var peg$e41 = peg$literalExpectation("//", false); + var peg$e42 = peg$classExpectation(["\n"], true, false); + var peg$e43 = peg$literalExpectation("cat", false); + var peg$e44 = peg$literalExpectation("$", false); + var peg$e45 = peg$literalExpectation("setcps", false); + var peg$e46 = peg$literalExpectation("setbpm", false); + var peg$e47 = peg$literalExpectation("hush", false); + + var peg$f0 = function () { + return parseFloat(text()); + }; + + var peg$f1 = function (chars) { + return chars.join(""); + }; + + var peg$f2 = function (s) { + return s; + }; + + var peg$f3 = function (sc) { + sc.arguments_.alignment = "t"; + return sc; + }; + + var peg$f4 = function (a) { + return { + weight: a + }; + }; + + var peg$f5 = function (a) { + return { + replicate: a + }; + }; + + var peg$f6 = function (p, s, r) { + return { + operator: { + type_: "bjorklund", + arguments_: { + pulse: p, + step: s, + rotation: r || 0 + } + } + }; + }; + + var peg$f7 = function (a) { + return { + operator: { + type_: "stretch", + arguments_: { + amount: a + } + } + }; + }; + + var peg$f8 = function (a) { + return { + operator: { + type_: "stretch", + arguments_: { + amount: "1/" + a + } + } + }; + }; + + var peg$f9 = function (a) { + return { + operator: { + type_: "fixed-step", + arguments_: { + amount: a + } + } + }; + }; + + var peg$f10 = function (a) { + return { + operator: { + type_: "degradeBy", + arguments_: { + amount: a ? a : 0.5 + } + } + }; + }; + + var peg$f11 = function (a) { + return { + operator: { + type_: "early", + arguments_: { + amount: a + } + } + }; + }; + + var peg$f12 = function (a) { + return { + operator: { + type_: "late", + arguments_: { + amount: a + } + } + }; + }; + + var peg$f13 = function (s, o) { + return new ElementStub(s, o); + }; + + var peg$f14 = function (s) { + return new PatternStub(s, "h"); + }; + + var peg$f15 = function (tail) { + return { + alignment: "v", + list: tail + }; + }; + + var peg$f16 = function (tail) { + return { + alignment: "r", + list: tail + }; + }; + + var peg$f17 = function (head, tail) { + if (tail && tail.list.length > 0) { + return new PatternStub([head, ...tail.list], tail.alignment); + } else { + return head; + } + }; + + var peg$f18 = function (sc) { + return sc; + }; + + var peg$f19 = function (s) { + return { + name: "struct", + args: { + sequence: s + } + }; + }; + + var peg$f20 = function (s) { + return { + name: "target", + args: { + name: s + } + }; + }; + + var peg$f21 = function (p, s, r) { + return { + name: "bjorklund", + args: { + pulse: parseInt(p), + step: parseInt(s) + } + }; + }; + + var peg$f22 = function (a) { + return { + name: "stretch", + args: { + amount: a + } + }; + }; + + var peg$f23 = function (a) { + return { + name: "shift", + args: { + amount: "-" + a + } + }; + }; + + var peg$f24 = function (a) { + return { + name: "shift", + args: { + amount: a + } + }; + }; + + var peg$f25 = function (a) { + return { + name: "stretch", + args: { + amount: "1/" + a + } + }; + }; + + var peg$f26 = function (s) { + return { + name: "scale", + args: { + scale: s.join("") + } + }; + }; + + var peg$f27 = function (s, v) { + return v; + }; + + var peg$f28 = function (s, ss) { + ss.unshift(s); + return new PatternStub(ss, "t"); + }; + + var peg$f29 = function (sg) { + return sg; + }; + + var peg$f30 = function (o, soc) { + return new OperatorStub(o.name, o.args, soc); + }; + + var peg$f31 = function (sc) { + return sc; + }; + + var peg$f32 = function (c) { + return c; + }; + + var peg$f33 = function (v) { + return new CommandStub("setcps", { + value: v + }); + }; + + var peg$f34 = function (v) { + return new CommandStub("setcps", { + value: v / 120 / 2 + }); + }; + + var peg$f35 = function () { + return new CommandStub("hush"); + }; + + var peg$currPos = 0; + var peg$savedPos = 0; + var peg$posDetailsCache = [{ + line: 1, + column: 1 + }]; + var peg$maxFailPos = 0; + var peg$maxFailExpected = []; + var peg$silentFails = 0; + var peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error(`Can't start parsing from rule "` + options.startRule + '".'); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$savedPos, peg$currPos); + } + + function location() { + return peg$computeLocation(peg$savedPos, peg$currPos); + } + + function peg$literalExpectation(text2, ignoreCase) { + return { + type: "literal", + text: text2, + ignoreCase + }; + } + + function peg$classExpectation(parts, inverted, ignoreCase) { + return { + type: "class", + parts, + inverted, + ignoreCase + }; + } + + function peg$endExpectation() { + return { + type: "end" + }; + } + + function peg$otherExpectation(description) { + return { + type: "other", + description + }; + } + + function peg$computePosDetails(pos) { + var details = peg$posDetailsCache[pos]; + var p; + + if (details) { + return details; + } else { + p = pos - 1; + + while (!peg$posDetailsCache[p]) { + p--; + } + + details = peg$posDetailsCache[p]; + details = { + line: details.line, + column: details.column + }; + + while (p < pos) { + if (input.charCodeAt(p) === 10) { + details.line++; + details.column = 1; + } else { + details.column++; + } + + p++; + } + + peg$posDetailsCache[pos] = details; + return details; + } + } + + function peg$computeLocation(startPos, endPos) { + var startPosDetails = peg$computePosDetails(startPos); + var endPosDetails = peg$computePosDetails(endPos); + return { + source: peg$source, + start: { + offset: startPos, + line: startPosDetails.line, + column: startPosDetails.column + }, + end: { + offset: endPos, + line: endPosDetails.line, + column: endPosDetails.column + } + }; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { + return; + } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$buildStructuredError(expected, found, location2) { + return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected, found), expected, found, location2); + } + + function peg$parsestart() { + var s0; + s0 = peg$parsestatement(); + return s0; + } + + function peg$parsenumber() { + var s0, s2; + peg$silentFails++; + s0 = peg$currPos; + peg$parseminus(); + s2 = peg$parseint(); + + if (s2 !== peg$FAILED) { + peg$parsefrac(); + peg$parseexp(); + peg$savedPos = s0; + s0 = peg$f0(); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$silentFails--; + + if (s0 === peg$FAILED) { + if (peg$silentFails === 0) { + peg$fail(peg$e0); + } + } + + return s0; + } + + function peg$parsedecimal_point() { + var s0; + + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c0; + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e1); + } + } + + return s0; + } + + function peg$parsedigit1_9() { + var s0; + + if (peg$r0.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e2); + } + } + + return s0; + } + + function peg$parsee() { + var s0; + + if (peg$r1.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e3); + } + } + + return s0; + } + + function peg$parseexp() { + var s0, s1, s2, s3, s4; + s0 = peg$currPos; + s1 = peg$parsee(); + + if (s1 !== peg$FAILED) { + s2 = peg$parseminus(); + + if (s2 === peg$FAILED) { + s2 = peg$parseplus(); + } + + if (s2 === peg$FAILED) { + s2 = null; + } + + s3 = []; + s4 = peg$parseDIGIT(); + + if (s4 !== peg$FAILED) { + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseDIGIT(); + } + } else { + s3 = peg$FAILED; + } + + if (s3 !== peg$FAILED) { + s1 = [s1, s2, s3]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsefrac() { + var s0, s1, s2, s3; + s0 = peg$currPos; + s1 = peg$parsedecimal_point(); + + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseDIGIT(); + + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parseDIGIT(); + } + } else { + s2 = peg$FAILED; + } + + if (s2 !== peg$FAILED) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseint() { + var s0, s1, s2, s3; + s0 = peg$parsezero(); + + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parsedigit1_9(); + + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseDIGIT(); + + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parseDIGIT(); + } + + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } + + return s0; + } + + function peg$parseminus() { + var s0; + + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c1; + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e4); + } + } + + return s0; + } + + function peg$parseplus() { + var s0; + + if (input.charCodeAt(peg$currPos) === 43) { + s0 = peg$c2; + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e5); + } + } + + return s0; + } + + function peg$parsezero() { + var s0; + + if (input.charCodeAt(peg$currPos) === 48) { + s0 = peg$c3; + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e6); + } + } + + return s0; + } + + function peg$parseDIGIT() { + var s0; + + if (peg$r2.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e7); + } + } + + return s0; + } + + function peg$parsews() { + var s0, s1; + peg$silentFails++; + s0 = []; + + if (peg$r3.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e9); + } + } + + while (s1 !== peg$FAILED) { + s0.push(s1); + + if (peg$r3.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e9); + } + } + } + + peg$silentFails--; + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e8); + } + + return s0; + } + + function peg$parsecomma() { + var s0, s1, s2, s3; + s0 = peg$currPos; + s1 = peg$parsews(); + + if (input.charCodeAt(peg$currPos) === 44) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e10); + } + } + + if (s2 !== peg$FAILED) { + s3 = peg$parsews(); + s1 = [s1, s2, s3]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsepipe() { + var s0, s1, s2, s3; + s0 = peg$currPos; + s1 = peg$parsews(); + + if (input.charCodeAt(peg$currPos) === 124) { + s2 = peg$c5; + peg$currPos++; + } else { + s2 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e11); + } + } + + if (s2 !== peg$FAILED) { + s3 = peg$parsews(); + s1 = [s1, s2, s3]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsequote() { + var s0; + + if (input.charCodeAt(peg$currPos) === 34) { + s0 = peg$c6; + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e12); + } + } + + if (s0 === peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 39) { + s0 = peg$c7; + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e13); + } + } + } + + return s0; + } + + function peg$parsestep_char() { + var s0; + + if (peg$r4.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e14); + } + } + + if (s0 === peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c1; + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e4); + } + } + + if (s0 === peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 35) { + s0 = peg$c8; + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e15); + } + } + + if (s0 === peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c0; + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e1); + } + } + + if (s0 === peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 94) { + s0 = peg$c9; + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e16); + } + } + + if (s0 === peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c10; + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e17); + } + } + + if (s0 === peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 58) { + s0 = peg$c11; + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e18); + } + } + } + } + } + } + } + } + + return s0; + } + + function peg$parsestep() { + var s0, s2, s3; + s0 = peg$currPos; + peg$parsews(); + s2 = []; + s3 = peg$parsestep_char(); + + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parsestep_char(); + } + } else { + s2 = peg$FAILED; + } + + if (s2 !== peg$FAILED) { + s3 = peg$parsews(); + peg$savedPos = s0; + s0 = peg$f1(s2); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsesub_cycle() { + var s0, s2, s4, s6; + s0 = peg$currPos; + peg$parsews(); + + if (input.charCodeAt(peg$currPos) === 91) { + s2 = peg$c12; + peg$currPos++; + } else { + s2 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e19); + } + } + + if (s2 !== peg$FAILED) { + peg$parsews(); + s4 = peg$parsestack_or_choose(); + + if (s4 !== peg$FAILED) { + peg$parsews(); + + if (input.charCodeAt(peg$currPos) === 93) { + s6 = peg$c13; + peg$currPos++; + } else { + s6 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e20); + } + } + + if (s6 !== peg$FAILED) { + peg$parsews(); + peg$savedPos = s0; + s0 = peg$f2(s4); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsetimeline() { + var s0, s2, s4, s6; + s0 = peg$currPos; + peg$parsews(); + + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c14; + peg$currPos++; + } else { + s2 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e21); + } + } + + if (s2 !== peg$FAILED) { + peg$parsews(); + s4 = peg$parsesingle_cycle(); + + if (s4 !== peg$FAILED) { + peg$parsews(); + + if (input.charCodeAt(peg$currPos) === 62) { + s6 = peg$c15; + peg$currPos++; + } else { + s6 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e22); + } + } + + if (s6 !== peg$FAILED) { + peg$parsews(); + peg$savedPos = s0; + s0 = peg$f3(s4); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseslice() { + var s0; + s0 = peg$parsestep(); + + if (s0 === peg$FAILED) { + s0 = peg$parsesub_cycle(); + + if (s0 === peg$FAILED) { + s0 = peg$parsetimeline(); + } + } + + return s0; + } + + function peg$parseslice_modifier() { + var s0; + s0 = peg$parseslice_weight(); + + if (s0 === peg$FAILED) { + s0 = peg$parseslice_bjorklund(); + + if (s0 === peg$FAILED) { + s0 = peg$parseslice_slow(); + + if (s0 === peg$FAILED) { + s0 = peg$parseslice_fast(); + + if (s0 === peg$FAILED) { + s0 = peg$parseslice_fixed_step(); + + if (s0 === peg$FAILED) { + s0 = peg$parseslice_replicate(); + + if (s0 === peg$FAILED) { + s0 = peg$parseslice_degrade(); + + if (s0 === peg$FAILED) { + s0 = peg$parseslice_early(); + + if (s0 === peg$FAILED) { + s0 = peg$parseslice_late(); + } + } + } + } + } + } + } + } + + return s0; + } + + function peg$parseslice_weight() { + var s0, s1, s2; + s0 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 64) { + s1 = peg$c16; + peg$currPos++; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e23); + } + } + + if (s1 !== peg$FAILED) { + s2 = peg$parsenumber(); + + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f4(s2); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseslice_replicate() { + var s0, s1, s2; + s0 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 33) { + s1 = peg$c17; + peg$currPos++; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e24); + } + } + + if (s1 !== peg$FAILED) { + s2 = peg$parsenumber(); + + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f5(s2); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseslice_bjorklund() { + var s0, s1, s3, s5, s7, s11, s13; + s0 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 40) { + s1 = peg$c18; + peg$currPos++; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e25); + } + } + + if (s1 !== peg$FAILED) { + peg$parsews(); + s3 = peg$parsenumber(); + + if (s3 !== peg$FAILED) { + peg$parsews(); + s5 = peg$parsecomma(); + + if (s5 !== peg$FAILED) { + peg$parsews(); + s7 = peg$parsenumber(); + + if (s7 !== peg$FAILED) { + peg$parsews(); + peg$parsecomma(); + peg$parsews(); + s11 = peg$parsenumber(); + + if (s11 === peg$FAILED) { + s11 = null; + } + + peg$parsews(); + + if (input.charCodeAt(peg$currPos) === 41) { + s13 = peg$c19; + peg$currPos++; + } else { + s13 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e26); + } + } + + if (s13 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f6(s3, s7, s11); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseslice_slow() { + var s0, s1, s2; + s0 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e27); + } + } + + if (s1 !== peg$FAILED) { + s2 = peg$parsenumber(); + + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f7(s2); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseslice_fast() { + var s0, s1, s2; + s0 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 42) { + s1 = peg$c21; + peg$currPos++; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e28); + } + } + + if (s1 !== peg$FAILED) { + s2 = peg$parsenumber(); + + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f8(s2); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseslice_fixed_step() { + var s0, s1, s2; + s0 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c22; + peg$currPos++; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e29); + } + } + + if (s1 !== peg$FAILED) { + s2 = peg$parsenumber(); + + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f9(s2); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseslice_degrade() { + var s0, s1, s2; + s0 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 63) { + s1 = peg$c23; + peg$currPos++; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e30); + } + } + + if (s1 !== peg$FAILED) { + s2 = peg$parsenumber(); + + if (s2 === peg$FAILED) { + s2 = null; + } + + peg$savedPos = s0; + s0 = peg$f10(s2); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseslice_early() { + var s0, s1, s2; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 2) === peg$c24) { + s1 = peg$c24; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e31); + } + } + + if (s1 !== peg$FAILED) { + s2 = peg$parsenumber(); + + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f11(s2); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseslice_late() { + var s0, s1, s2; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 2) === peg$c25) { + s1 = peg$c25; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e32); + } + } + + if (s1 !== peg$FAILED) { + s2 = peg$parsenumber(); + + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f12(s2); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseslice_with_modifier() { + var s0, s1, s2; + s0 = peg$currPos; + s1 = peg$parseslice(); + + if (s1 !== peg$FAILED) { + s2 = peg$parseslice_modifier(); + + if (s2 === peg$FAILED) { + s2 = null; + } + + peg$savedPos = s0; + s0 = peg$f13(s1, s2); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsesingle_cycle() { + var s0, s1, s2; + s0 = peg$currPos; + s1 = []; + s2 = peg$parseslice_with_modifier(); + + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parseslice_with_modifier(); + } + } else { + s1 = peg$FAILED; + } + + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f14(s1); + } + + s0 = s1; + return s0; + } + + function peg$parsestack_tail() { + var s0, s1, s2, s3, s4; + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parsecomma(); + + if (s3 !== peg$FAILED) { + s4 = peg$parsesingle_cycle(); + + if (s4 !== peg$FAILED) { + s2 = s4; + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parsecomma(); + + if (s3 !== peg$FAILED) { + s4 = peg$parsesingle_cycle(); + + if (s4 !== peg$FAILED) { + s2 = s4; + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + } + } else { + s1 = peg$FAILED; + } + + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f15(s1); + } + + s0 = s1; + return s0; + } + + function peg$parsechoose_tail() { + var s0, s1, s2, s3, s4; + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parsepipe(); + + if (s3 !== peg$FAILED) { + s4 = peg$parsesingle_cycle(); + + if (s4 !== peg$FAILED) { + s2 = s4; + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parsepipe(); + + if (s3 !== peg$FAILED) { + s4 = peg$parsesingle_cycle(); + + if (s4 !== peg$FAILED) { + s2 = s4; + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + } + } else { + s1 = peg$FAILED; + } + + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f16(s1); + } + + s0 = s1; + return s0; + } + + function peg$parsestack_or_choose() { + var s0, s1, s2; + s0 = peg$currPos; + s1 = peg$parsesingle_cycle(); + + if (s1 !== peg$FAILED) { + s2 = peg$parsestack_tail(); + + if (s2 === peg$FAILED) { + s2 = peg$parsechoose_tail(); + } + + if (s2 === peg$FAILED) { + s2 = null; + } + + peg$savedPos = s0; + s0 = peg$f17(s1, s2); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsesequence() { + var s0, s2, s3, s4; + s0 = peg$currPos; + peg$parsews(); + s2 = peg$parsequote(); + + if (s2 !== peg$FAILED) { + s3 = peg$parsestack_or_choose(); + + if (s3 !== peg$FAILED) { + s4 = peg$parsequote(); + + if (s4 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f18(s3); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseoperator() { + var s0; + s0 = peg$parsescale(); + + if (s0 === peg$FAILED) { + s0 = peg$parseslow(); + + if (s0 === peg$FAILED) { + s0 = peg$parsefast(); + + if (s0 === peg$FAILED) { + s0 = peg$parsetarget(); + + if (s0 === peg$FAILED) { + s0 = peg$parsebjorklund(); + + if (s0 === peg$FAILED) { + s0 = peg$parsestruct(); + + if (s0 === peg$FAILED) { + s0 = peg$parserotR(); + + if (s0 === peg$FAILED) { + s0 = peg$parserotL(); + } + } + } + } + } + } + } + + return s0; + } + + function peg$parsestruct() { + var s0, s1, s3; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 6) === peg$c26) { + s1 = peg$c26; + peg$currPos += 6; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e33); + } + } + + if (s1 !== peg$FAILED) { + peg$parsews(); + s3 = peg$parsesequence_or_operator(); + + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f19(s3); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsetarget() { + var s0, s1, s3, s4, s5; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 6) === peg$c27) { + s1 = peg$c27; + peg$currPos += 6; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e34); + } + } + + if (s1 !== peg$FAILED) { + peg$parsews(); + s3 = peg$parsequote(); + + if (s3 !== peg$FAILED) { + s4 = peg$parsestep(); + + if (s4 !== peg$FAILED) { + s5 = peg$parsequote(); + + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f20(s4); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsebjorklund() { + var s0, s1, s3, s5; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 6) === peg$c28) { + s1 = peg$c28; + peg$currPos += 6; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e35); + } + } + + if (s1 !== peg$FAILED) { + peg$parsews(); + s3 = peg$parseint(); + + if (s3 !== peg$FAILED) { + peg$parsews(); + s5 = peg$parseint(); + + if (s5 !== peg$FAILED) { + peg$parsews(); + peg$parseint(); + peg$savedPos = s0; + s0 = peg$f21(s3, s5); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseslow() { + var s0, s1, s3; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 4) === peg$c29) { + s1 = peg$c29; + peg$currPos += 4; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e36); + } + } + + if (s1 !== peg$FAILED) { + peg$parsews(); + s3 = peg$parsenumber(); + + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f22(s3); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parserotL() { + var s0, s1, s3; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 4) === peg$c30) { + s1 = peg$c30; + peg$currPos += 4; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e37); + } + } + + if (s1 !== peg$FAILED) { + peg$parsews(); + s3 = peg$parsenumber(); + + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f23(s3); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parserotR() { + var s0, s1, s3; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 4) === peg$c31) { + s1 = peg$c31; + peg$currPos += 4; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e38); + } + } + + if (s1 !== peg$FAILED) { + peg$parsews(); + s3 = peg$parsenumber(); + + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f24(s3); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsefast() { + var s0, s1, s3; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 4) === peg$c32) { + s1 = peg$c32; + peg$currPos += 4; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e39); + } + } + + if (s1 !== peg$FAILED) { + peg$parsews(); + s3 = peg$parsenumber(); + + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f25(s3); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsescale() { + var s0, s1, s3, s4, s5; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 5) === peg$c33) { + s1 = peg$c33; + peg$currPos += 5; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e40); + } + } + + if (s1 !== peg$FAILED) { + peg$parsews(); + s3 = peg$parsequote(); + + if (s3 !== peg$FAILED) { + s4 = []; + s5 = peg$parsestep_char(); + + if (s5 !== peg$FAILED) { + while (s5 !== peg$FAILED) { + s4.push(s5); + s5 = peg$parsestep_char(); + } + } else { + s4 = peg$FAILED; + } + + if (s4 !== peg$FAILED) { + s5 = peg$parsequote(); + + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f26(s4); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2, s3; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 2) === peg$c34) { + s1 = peg$c34; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e41); + } + } + + if (s1 !== peg$FAILED) { + s2 = []; + + if (peg$r5.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e42); + } + } + + while (s3 !== peg$FAILED) { + s2.push(s3); + + if (peg$r5.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e42); + } + } + } + + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsecat() { + var s0, s1, s3, s5, s6, s7, s8, s9; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 3) === peg$c35) { + s1 = peg$c35; + peg$currPos += 3; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e43); + } + } + + if (s1 !== peg$FAILED) { + peg$parsews(); + + if (input.charCodeAt(peg$currPos) === 91) { + s3 = peg$c12; + peg$currPos++; + } else { + s3 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e19); + } + } + + if (s3 !== peg$FAILED) { + peg$parsews(); + s5 = peg$parsesequence_or_operator(); + + if (s5 !== peg$FAILED) { + s6 = []; + s7 = peg$currPos; + s8 = peg$parsecomma(); + + if (s8 !== peg$FAILED) { + s9 = peg$parsesequence_or_operator(); + + if (s9 !== peg$FAILED) { + peg$savedPos = s7; + s7 = peg$f27(s5, s9); + } else { + peg$currPos = s7; + s7 = peg$FAILED; + } + } else { + peg$currPos = s7; + s7 = peg$FAILED; + } + + while (s7 !== peg$FAILED) { + s6.push(s7); + s7 = peg$currPos; + s8 = peg$parsecomma(); + + if (s8 !== peg$FAILED) { + s9 = peg$parsesequence_or_operator(); + + if (s9 !== peg$FAILED) { + peg$savedPos = s7; + s7 = peg$f27(s5, s9); + } else { + peg$currPos = s7; + s7 = peg$FAILED; + } + } else { + peg$currPos = s7; + s7 = peg$FAILED; + } + } + + s7 = peg$parsews(); + + if (input.charCodeAt(peg$currPos) === 93) { + s8 = peg$c13; + peg$currPos++; + } else { + s8 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e20); + } + } + + if (s8 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f28(s5, s6); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsesequence_or_group() { + var s0; + s0 = peg$parsecat(); + + if (s0 === peg$FAILED) { + s0 = peg$parsesequence(); + } + + return s0; + } + + function peg$parsesequence_or_operator() { + var s0, s1, s3, s4, s5; + s0 = peg$currPos; + s1 = peg$parsesequence_or_group(); + + if (s1 !== peg$FAILED) { + peg$parsews(); + s3 = []; + s4 = peg$parsecomment(); + + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parsecomment(); + } + + peg$savedPos = s0; + s0 = peg$f29(s1); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parseoperator(); + + if (s1 !== peg$FAILED) { + peg$parsews(); + + if (input.charCodeAt(peg$currPos) === 36) { + s3 = peg$c36; + peg$currPos++; + } else { + s3 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e44); + } + } + + if (s3 !== peg$FAILED) { + s4 = peg$parsews(); + s5 = peg$parsesequence_or_operator(); + + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f30(s1, s5); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } + + return s0; + } + + function peg$parsesequ_or_operator_or_comment() { + var s0, s1; + s0 = peg$currPos; + s1 = peg$parsesequence_or_operator(); + + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f31(s1); + } + + s0 = s1; + + if (s0 === peg$FAILED) { + s0 = peg$parsecomment(); + } + + return s0; + } + + function peg$parsesequence_definition() { + var s0; + s0 = peg$parsesequ_or_operator_or_comment(); + return s0; + } + + function peg$parsecommand() { + var s0, s2; + s0 = peg$currPos; + peg$parsews(); + s2 = peg$parsesetcps(); + + if (s2 === peg$FAILED) { + s2 = peg$parsesetbpm(); + + if (s2 === peg$FAILED) { + s2 = peg$parsehush(); + } + } + + if (s2 !== peg$FAILED) { + peg$parsews(); + peg$savedPos = s0; + s0 = peg$f32(s2); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsesetcps() { + var s0, s1, s3; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 6) === peg$c37) { + s1 = peg$c37; + peg$currPos += 6; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e45); + } + } + + if (s1 !== peg$FAILED) { + peg$parsews(); + s3 = peg$parsenumber(); + + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f33(s3); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsesetbpm() { + var s0, s1, s3; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 6) === peg$c38) { + s1 = peg$c38; + peg$currPos += 6; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e46); + } + } + + if (s1 !== peg$FAILED) { + peg$parsews(); + s3 = peg$parsenumber(); + + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f34(s3); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsehush() { + var s0, s1; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 4) === peg$c39) { + s1 = peg$c39; + peg$currPos += 4; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e47); + } + } + + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f35(); + } + + s0 = s1; + return s0; + } + + function peg$parsestatement() { + var s0; + s0 = peg$parsesequence_definition(); + + if (s0 === peg$FAILED) { + s0 = peg$parsecommand(); + } + + return s0; + } + + var PatternStub = function (source, alignment) { + this.type_ = "pattern"; + this.arguments_ = { + alignment + }; + this.source_ = source; + }; + + var OperatorStub = function (name, args, source) { + this.type_ = name; + this.arguments_ = args; + this.source_ = source; + }; + + var ElementStub = function (source, options2) { + this.type_ = "element"; + this.source_ = source; + this.options_ = options2; + this.location_ = location(); + }; + + var CommandStub = function (name, options2) { + this.type_ = "command"; + this.name_ = name; + this.options_ = options2; + }; + + peg$result = peg$startRuleFunction(); + + if (peg$result !== peg$FAILED && peg$currPos === input.length) { + return peg$result; + } else { + if (peg$result !== peg$FAILED && peg$currPos < input.length) { + peg$fail(peg$endExpectation()); + } + + throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)); + } +} + +var krillParser = { + SyntaxError: peg$SyntaxError, + parse: peg$parse +}; +var fraction$1 = { + exports: {} +}; +/** * @license Fraction.js v4.2.0 05/03/2022 * https://www.xarg.org/2014/03/rational-numbers-in-javascript/ * * Copyright (c) 2021, Robert Eisele (robert@xarg.org) * Dual licensed under the MIT or GPL Version 2 licenses. - **/(function(module2,exports2){(function(root){var MAX_CYCLE_LEN=2e3;var P={"s":1,"n":0,"d":1};function assign(n,s){if(isNaN(n=parseInt(n,10))){throw Fraction2["InvalidParameter"];}return n*s;}function newFraction(n,d){if(d===0){throw Fraction2["DivisionByZero"];}var f=Object.create(Fraction2.prototype);f["s"]=n<0?-1:1;n=n<0?-n:n;var a=gcd2(n,d);f["n"]=n/a;f["d"]=d/a;return f;}function factorize(num){var factors={};var n=num;var i2=2;var s=4;while(s<=n){while(n%i2===0){n/=i2;factors[i2]=(factors[i2]||0)+1;}s+=1+2*i2++;}if(n!==num){if(n>1)factors[n]=(factors[n]||0)+1;}else{factors[num]=(factors[num]||0)+1;}return factors;}var parse=function(p1,p2){var n=0,d=1,s=1;var v=0,w=0,x=0,y=1,z=1;var A=0,B=1;var C=1,D=1;var N=1e7;var M;if(p1===void 0||p1===null);else if(p2!==void 0){n=p1;d=p2;s=n*d;if(n%1!==0||d%1!==0){throw Fraction2["NonIntegerParameter"];}}else switch(typeof p1){case"object":{if("d"in p1&&"n"in p1){n=p1["n"];d=p1["d"];if("s"in p1)n*=p1["s"];}else if(0 in p1){n=p1[0];if(1 in p1)d=p1[1];}else{throw Fraction2["InvalidParameter"];}s=n*d;break;}case"number":{if(p1<0){s=p1;p1=-p1;}if(p1%1===0){n=p1;}else if(p1>0){if(p1>=1){z=Math.pow(10,Math.floor(1+Math.log(p1)/Math.LN10));p1/=z;}while(B<=N&&D<=N){M=(A+C)/(B+D);if(p1===M){if(B+D<=N){n=A+C;d=B+D;}else if(D>B){n=C;d=D;}else{n=A;d=B;}break;}else{if(p1>M){A+=C;B+=D;}else{C+=A;D+=B;}if(B>N){n=C;d=D;}else{n=A;d=B;}}}n*=z;}else if(isNaN(p1)||isNaN(p2)){d=n=NaN;}break;}case"string":{B=p1.match(/\d+|./g);if(B===null)throw Fraction2["InvalidParameter"];if(B[A]==="-"){s=-1;A++;}else if(B[A]==="+"){A++;}if(B.length===A+1){w=assign(B[A++],s);}else if(B[A+1]==="."||B[A]==="."){if(B[A]!=="."){v=assign(B[A++],s);}A++;if(A+1===B.length||B[A+1]==="("&&B[A+3]===")"||B[A+1]==="'"&&B[A+3]==="'"){w=assign(B[A],s);y=Math.pow(10,B[A].length);A++;}if(B[A]==="("&&B[A+2]===")"||B[A]==="'"&&B[A+2]==="'"){x=assign(B[A+1],s);z=Math.pow(10,B[A+1].length)-1;A+=3;}}else if(B[A+1]==="/"||B[A+1]===":"){w=assign(B[A],s);y=assign(B[A+2],1);A+=3;}else if(B[A+3]==="/"&&B[A+1]===" "){v=assign(B[A],s);w=assign(B[A+2],s);y=assign(B[A+4],1);A+=5;}if(B.length<=A){d=y*z;s=n=x+d*v+z*w;break;}}default:throw Fraction2["InvalidParameter"];}if(d===0){throw Fraction2["DivisionByZero"];}P["s"]=s<0?-1:1;P["n"]=Math.abs(n);P["d"]=Math.abs(d);};function modpow(b,e,m){var r=1;for(;e>0;b=b*b%m,e>>=1){if(e&1){r=r*b%m;}}return r;}function cycleLen(n,d){for(;d%2===0;d/=2){}for(;d%5===0;d/=5){}if(d===1)return 0;var rem=10%d;var t2=1;for(;rem!==1;t2++){rem=rem*10%d;if(t2>MAX_CYCLE_LEN)return 0;}return t2;}function cycleStart(n,d,len){var rem1=1;var rem2=modpow(10,len,d);for(var t2=0;t2<300;t2++){if(rem1===rem2)return t2;rem1=rem1*10%d;rem2=rem2*10%d;}return 0;}function gcd2(a,b){if(!a)return b;if(!b)return a;while(1){a%=b;if(!a)return b;b%=a;if(!b)return a;}}function Fraction2(a,b){parse(a,b);if(this instanceof Fraction2){a=gcd2(P["d"],P["n"]);this["s"]=P["s"];this["n"]=P["n"]/a;this["d"]=P["d"]/a;}else{return newFraction(P["s"]*P["n"],P["d"]);}}Fraction2["DivisionByZero"]=new Error("Division by Zero");Fraction2["InvalidParameter"]=new Error("Invalid argument");Fraction2["NonIntegerParameter"]=new Error("Parameters must be integer");Fraction2.prototype={"s":1,"n":0,"d":1,"abs":function(){return newFraction(this["n"],this["d"]);},"neg":function(){return newFraction(-this["s"]*this["n"],this["d"]);},"add":function(a,b){parse(a,b);return newFraction(this["s"]*this["n"]*P["d"]+P["s"]*this["d"]*P["n"],this["d"]*P["d"]);},"sub":function(a,b){parse(a,b);return newFraction(this["s"]*this["n"]*P["d"]-P["s"]*this["d"]*P["n"],this["d"]*P["d"]);},"mul":function(a,b){parse(a,b);return newFraction(this["s"]*P["s"]*this["n"]*P["n"],this["d"]*P["d"]);},"div":function(a,b){parse(a,b);return newFraction(this["s"]*P["s"]*this["n"]*P["d"],this["d"]*P["n"]);},"clone":function(){return newFraction(this["s"]*this["n"],this["d"]);},"mod":function(a,b){if(isNaN(this["n"])||isNaN(this["d"])){return new Fraction2(NaN);}if(a===void 0){return newFraction(this["s"]*this["n"]%this["d"],1);}parse(a,b);if(0===P["n"]&&0===this["d"]){throw Fraction2["DivisionByZero"];}return newFraction(this["s"]*(P["d"]*this["n"])%(P["n"]*this["d"]),P["d"]*this["d"]);},"gcd":function(a,b){parse(a,b);return newFraction(gcd2(P["n"],this["n"])*gcd2(P["d"],this["d"]),P["d"]*this["d"]);},"lcm":function(a,b){parse(a,b);if(P["n"]===0&&this["n"]===0){return newFraction(0,1);}return newFraction(P["n"]*this["n"],gcd2(P["n"],this["n"])*gcd2(P["d"],this["d"]));},"ceil":function(places){places=Math.pow(10,places||0);if(isNaN(this["n"])||isNaN(this["d"])){return new Fraction2(NaN);}return newFraction(Math.ceil(places*this["s"]*this["n"]/this["d"]),places);},"floor":function(places){places=Math.pow(10,places||0);if(isNaN(this["n"])||isNaN(this["d"])){return new Fraction2(NaN);}return newFraction(Math.floor(places*this["s"]*this["n"]/this["d"]),places);},"round":function(places){places=Math.pow(10,places||0);if(isNaN(this["n"])||isNaN(this["d"])){return new Fraction2(NaN);}return newFraction(Math.round(places*this["s"]*this["n"]/this["d"]),places);},"inverse":function(){return newFraction(this["s"]*this["d"],this["n"]);},"pow":function(a,b){parse(a,b);if(P["d"]===1){if(P["s"]<0){return newFraction(Math.pow(this["s"]*this["d"],P["n"]),Math.pow(this["n"],P["n"]));}else{return newFraction(Math.pow(this["s"]*this["n"],P["n"]),Math.pow(this["d"],P["n"]));}}if(this["s"]<0)return null;var N=factorize(this["n"]);var D=factorize(this["d"]);var n=1;var d=1;for(var k in N){if(k==="1")continue;if(k==="0"){n=0;break;}N[k]*=P["n"];if(N[k]%P["d"]===0){N[k]/=P["d"];}else return null;n*=Math.pow(k,N[k]);}for(var k in D){if(k==="1")continue;D[k]*=P["n"];if(D[k]%P["d"]===0){D[k]/=P["d"];}else return null;d*=Math.pow(k,D[k]);}if(P["s"]<0){return newFraction(d,n);}return newFraction(n,d);},"equals":function(a,b){parse(a,b);return this["s"]*this["n"]*P["d"]===P["s"]*P["n"]*this["d"];},"compare":function(a,b){parse(a,b);var t2=this["s"]*this["n"]*P["d"]-P["s"]*P["n"]*this["d"];return(0=0;k--){s=s["inverse"]()["add"](cont[k]);}if(s["sub"](thisABS)["abs"]().valueOf()0){str+=whole;str+=" ";n%=d;}str+=n;str+="/";str+=d;}return str;},"toLatex":function(excludeWhole){var whole,str="";var n=this["n"];var d=this["d"];if(this["s"]<0){str+="-";}if(d===1){str+=n;}else{if(excludeWhole&&(whole=Math.floor(n/d))>0){str+=whole;n%=d;}str+="\\frac{";str+=n;str+="}{";str+=d;str+="}";}return str;},"toContinued":function(){var t2;var a=this["n"];var b=this["d"];var res=[];if(isNaN(a)||isNaN(b)){return res;}do{res.push(Math.floor(a/b));t2=a%b;a=b;b=t2;}while(a!==1);return res;},"toString":function(dec){var N=this["n"];var D=this["d"];if(isNaN(N)||isNaN(D)){return"NaN";}dec=dec||15;var cycLen=cycleLen(N,D);var cycOff=cycleStart(N,D,cycLen);var str=this["s"]<0?"-":"";str+=N/D|0;N%=D;N*=10;if(N)str+=".";if(cycLen){for(var i2=cycOff;i2--;){str+=N/D|0;N%=D;N*=10;}str+="(";for(var i2=cycLen;i2--;){str+=N/D|0;N%=D;N*=10;}str+=")";}else{for(var i2=dec;N&&i2--;){str+=N/D|0;N%=D;N*=10;}}return str;}};{Object.defineProperty(Fraction2,"__esModule",{"value":true});Fraction2["default"]=Fraction2;Fraction2["Fraction"]=Fraction2;module2["exports"]=Fraction2;}})();})(fraction$1);var Fraction$1=/* @__PURE__ */getDefaultExportFromCjs(fraction$1.exports);Fraction$1.prototype.sam=function(){return this.floor();};Fraction$1.prototype.nextSam=function(){return this.sam().add(1);};Fraction$1.prototype.wholeCycle=function(){return new TimeSpan(this.sam(),this.nextSam());};Fraction$1.prototype.cyclePos=function(){return this.sub(this.sam());};Fraction$1.prototype.lt=function(other){return this.compare(other)<0;};Fraction$1.prototype.gt=function(other){return this.compare(other)>0;};Fraction$1.prototype.lte=function(other){return this.compare(other)<=0;};Fraction$1.prototype.gte=function(other){return this.compare(other)>=0;};Fraction$1.prototype.eq=function(other){return this.compare(other)==0;};Fraction$1.prototype.max=function(other){return this.gt(other)?this:other;};Fraction$1.prototype.min=function(other){return this.lt(other)?this:other;};Fraction$1.prototype.show=function(){return this.s*this.n+"/"+this.d;};Fraction$1.prototype.or=function(other){return this.eq(0)?other:this;};var fraction=n=>{if(typeof n==="number"){n=String(n);}return Fraction$1(n);};var gcd=(...fractions)=>{return fractions.reduce((gcd2,fraction2)=>gcd2.gcd(fraction2),fraction(1));};fraction._original=Fraction$1;var TimeSpan=/*#__PURE__*/function(){function TimeSpan(begin,end){_classCallCheck3(this,TimeSpan);this.begin=fraction(begin);this.end=fraction(end);}_createClass3(TimeSpan,[{key:"spanCycles",get:function(){const spans=[];var begin=this.begin;const end=this.end;const end_sam=end.sam();while(end.gt(begin)){if(begin.sam().equals(end_sam)){spans.push(new TimeSpan(begin,this.end));break;}const next_begin=begin.nextSam();spans.push(new TimeSpan(begin,next_begin));begin=next_begin;}return spans;}},{key:"duration",get:function(){return this.end.sub(this.begin);}},{key:"cycleArc",value:function cycleArc(){const b=this.begin.cyclePos();const e=b.add(this.duration);return new TimeSpan(b,e);}},{key:"withTime",value:function withTime(func_time){return new TimeSpan(func_time(this.begin),func_time(this.end));}},{key:"withEnd",value:function withEnd(func_time){return new TimeSpan(this.begin,func_time(this.end));}},{key:"withCycle",value:function withCycle(func_time){const sam=this.begin.sam();const b=sam.add(func_time(this.begin.sub(sam)));const e=sam.add(func_time(this.end.sub(sam)));return new TimeSpan(b,e);}},{key:"intersection",value:function intersection(other){const intersect_begin=this.begin.max(other.begin);const intersect_end=this.end.min(other.end);if(intersect_begin.gt(intersect_end)){return void 0;}if(intersect_begin.equals(intersect_end)){if(intersect_begin.equals(this.end)&&this.begin.lt(this.end)){return void 0;}if(intersect_begin.equals(other.end)&&other.begin.lt(other.end)){return void 0;}}return new TimeSpan(intersect_begin,intersect_end);}},{key:"intersection_e",value:function intersection_e(other){const result=this.intersection(other);if(result==void 0){throw"TimeSpans do not intersect";}return result;}},{key:"midpoint",value:function midpoint(){return this.begin.add(this.duration.div(fraction(2)));}},{key:"equals",value:function equals(other){return this.begin.equals(other.begin)&&this.end.equals(other.end);}},{key:"show",value:function show(){return this.begin.show()+" -> "+this.end.show();}}]);return TimeSpan;}();var Hap=/*#__PURE__*/function(){function Hap(whole,part,value,context={},stateful=false){_classCallCheck3(this,Hap);this.whole=whole;this.part=part;this.value=value;this.context=context;this.stateful=stateful;if(stateful){console.assert(typeof this.value==="function","Stateful values must be functions");}}_createClass3(Hap,[{key:"duration",get:function(){return this.whole.end.sub(this.whole.begin);}},{key:"wholeOrPart",value:function wholeOrPart(){return this.whole?this.whole:this.part;}},{key:"withSpan",value:function withSpan(func){const whole=this.whole?func(this.whole):void 0;return new Hap(whole,func(this.part),this.value,this.context);}},{key:"withValue",value:function withValue(func){return new Hap(this.whole,this.part,func(this.value),this.context);}},{key:"hasOnset",value:function hasOnset(){return this.whole!=void 0&&this.whole.begin.equals(this.part.begin);}},{key:"resolveState",value:function resolveState(state){if(this.stateful&&this.hasOnset()){console.log("stateful");const func=this.value;const[newState,newValue]=func(state);return[newState,new Hap(this.whole,this.part,newValue,this.context,false)];}return[state,this];}},{key:"spanEquals",value:function spanEquals(other){return this.whole==void 0&&other.whole==void 0||this.whole.equals(other.whole);}},{key:"equals",value:function equals(other){return this.spanEquals(other)&&this.part.equals(other.part)&&this.value===other.value;}},{key:"show",value:function show(){return"("+(this.whole==void 0?"~":this.whole.show())+", "+this.part.show()+", "+this.value+")";}},{key:"showWhole",value:function showWhole(){return`${this.whole==void 0?"~":this.whole.show()}: ${typeof this.value==="object"?JSON.stringify(this.value):this.value}`;}},{key:"combineContext",value:function combineContext(b){const a=this;return{...a.context,...b.context,locations:(a.context.locations||[]).concat(b.context.locations||[])};}},{key:"setContext",value:function setContext(context){return new Hap(this.whole,this.part,this.value,context);}}]);return Hap;}();var State=/*#__PURE__*/function(){function State(span,controls2={}){_classCallCheck3(this,State);this.span=span;this.controls=controls2;}_createClass3(State,[{key:"setSpan",value:function setSpan(span){return new State(span,this.controls);}},{key:"withSpan",value:function withSpan(func){return this.setSpan(func(this.span));}},{key:"setControls",value:function setControls(controls2){return new State(this.span,controls2);}}]);return State;}();var isNote=name=>/^[a-gA-G][#b]*[0-9]$/.test(name);var tokenizeNote=note=>{var _a;if(typeof note!=="string"){return[];}const[pc,acc="",oct]=((_a=note.match(/^([a-gA-G])([#bs]*)([0-9])?$/))==null?void 0:_a.slice(1))||[];if(!pc){return[];}return[pc,acc,oct?Number(oct):void 0];};var toMidi=note=>{const[pc,acc,oct]=tokenizeNote(note);if(!pc){throw new Error('not a note: "'+note+'"');}const chroma={c:0,d:2,e:4,f:5,g:7,a:9,b:11}[pc.toLowerCase()];const offset=(acc==null?void 0:acc.split("").reduce((o,char)=>o+{"#":1,b:-1,s:1}[char],0))||0;return(Number(oct)+1)*12+chroma+offset;};var fromMidi=n=>{return Math.pow(2,(n-69)/12)*440;};var getFreq=noteOrMidi=>{if(typeof noteOrMidi==="number"){return fromMidi(noteOrMidi);}return fromMidi(toMidi(noteOrMidi));};var midi2note=n=>{const oct=Math.floor(n/12)-1;const pc=["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"][n%12];return pc+oct;};var mod=(n,m)=>(n%m+m)%m;var getPlayableNoteValue=hap=>{let{value:note,context}=hap;if(typeof note==="object"&&!Array.isArray(note)){note=note.note||note.n||note.value;}if(typeof note==="number"&&context.type!=="frequency"){note=fromMidi(hap.value);}else if(typeof note==="number"&&context.type==="frequency"){note=hap.value;}else if(typeof note!=="string"||!isNote(note)){throw new Error("not a note: "+JSON.stringify(note));}return note;};var getFrequency=hap=>{let{value,context}=hap;if(typeof value==="object"&&value.freq){return value.freq;}if(typeof value==="number"&&context.type!=="frequency"){value=fromMidi(hap.value);}else if(typeof value==="string"&&isNote(value)){value=fromMidi(toMidi(hap.value));}else if(typeof value!=="number"){throw new Error("not a note or frequency:"+value);}return value;};var rotate=(arr,n)=>arr.slice(n).concat(arr.slice(0,n));var pipe=(...funcs)=>{return funcs.reduce((f,g)=>(...args)=>f(g(...args)),x=>x);};var compose=(...funcs)=>pipe(...funcs.reverse());var removeUndefineds=xs=>xs.filter(x=>x!=void 0);var flatten=arr=>[].concat(...arr);var id=a=>a;var constant=(a,b)=>a;var listRange=(min,max)=>Array.from({length:max-min+1},(_,i2)=>i2+min);function curry(func,overload){const fn=function curried(...args){if(args.length>=func.length){return func.apply(this,args);}else{const partial=function(...args2){return curried.apply(this,args.concat(args2));};if(overload){overload(partial,args);}return partial;}};if(overload){overload(fn,[]);}return fn;}function unionWithObj(a,b,func){const common=Object.keys(a).filter(k=>Object.keys(b).includes(k));return Object.assign({},a,b,Object.fromEntries(common.map(k=>[k,func(a[k],b[k])])));}curry((a,b)=>a*b);curry((f,anyFunctor)=>anyFunctor.map(f));function _drawLine(pat,chars=60){let cycle=0;let pos=fraction(0);let lines=[""];let emptyLine="";while(lines[0].lengthhap.hasOnset()).map(hap=>hap.duration);const charFraction=gcd(...durations);const totalSlots=charFraction.inverse();lines=lines.map(line=>line+"|");emptyLine+="|";for(let i2=0;i2hap.whole.begin.lte(begin)&&hap.whole.end.gte(end));const missingLines=matches.length-lines.length;if(missingLines>0){lines=lines.concat(Array(missingLines).fill(emptyLine));}lines=lines.map((line,i3)=>{const hap=matches[i3];if(hap){const isOnset=hap.whole.begin.eq(begin);const char=isOnset?""+hap.value:"-";return line+char;}return line+".";});emptyLine+=".";pos=pos.add(charFraction);}cycle++;}return lines.join("\n");}var Pattern$2=/*#__PURE__*/function(){function Pattern$2(query){_classCallCheck3(this,Pattern$2);__publicField(this,"_Pattern",true);this.query=query;}_createClass3(Pattern$2,[{key:"queryArc",value:function queryArc(begin,end){return this.query(new State(new TimeSpan(begin,end)));}},{key:"_splitQueries",value:function _splitQueries(){const pat=this;const q=state=>{return flatten(state.span.spanCycles.map(subspan=>pat.query(state.setSpan(subspan))));};return new Pattern$2(q);}},{key:"withQuerySpan",value:function withQuerySpan(func){return new Pattern$2(state=>this.query(state.withSpan(func)));}},{key:"withQueryTime",value:function withQueryTime(func){return new Pattern$2(state=>this.query(state.withSpan(span=>span.withTime(func))));}},{key:"withHapSpan",value:function withHapSpan(func){return new Pattern$2(state=>this.query(state).map(hap=>hap.withSpan(func)));}},{key:"withHapTime",value:function withHapTime(func){return this.withHapSpan(span=>span.withTime(func));}},{key:"_withHaps",value:function _withHaps(func){return new Pattern$2(state=>func(this.query(state)));}},{key:"_withHap",value:function _withHap(func){return this._withHaps(haps=>haps.map(func));}},{key:"_setContext",value:function _setContext(context){return this._withHap(hap=>hap.setContext(context));}},{key:"_withContext",value:function _withContext(func){return this._withHap(hap=>hap.setContext(func(hap.context)));}},{key:"_stripContext",value:function _stripContext(){return this._withHap(hap=>hap.setContext({}));}},{key:"withLocation",value:function withLocation(start,end){const location={start:{line:start[0],column:start[1],offset:start[2]},end:{line:end[0],column:end[1],offset:end[2]}};return this._withContext(context=>{const locations=(context.locations||[]).concat([location]);return{...context,locations};});}},{key:"withMiniLocation",value:function withMiniLocation(start,end){const offset={start:{line:start[0],column:start[1],offset:start[2]},end:{line:end[0],column:end[1],offset:end[2]}};return this._withContext(context=>{let locations=context.locations||[];locations=locations.map(({start:start2,end:end2})=>{const colOffset=start2.line===1?offset.start.column:0;return{start:{...start2,line:start2.line-1+(offset.start.line-1)+1,column:start2.column-1+colOffset},end:{...end2,line:end2.line-1+(offset.start.line-1)+1,column:end2.column-1+colOffset}};});return{...context,locations};});}},{key:"withValue",value:function withValue(func){return new Pattern$2(state=>this.query(state).map(hap=>hap.withValue(func)));}},{key:"fmap",value:function fmap(func){return this.withValue(func);}},{key:"_filterHaps",value:function _filterHaps(hap_test){return new Pattern$2(state=>this.query(state).filter(hap_test));}},{key:"_filterValues",value:function _filterValues(value_test){return new Pattern$2(state=>this.query(state).filter(hap=>value_test(hap.value)));}},{key:"_removeUndefineds",value:function _removeUndefineds(){return this._filterValues(val=>val!=void 0);}},{key:"onsetsOnly",value:function onsetsOnly(){return this._filterHaps(hap=>hap.hasOnset());}},{key:"discreteOnly",value:function discreteOnly(){return this._filterHaps(hap=>hap.whole);}},{key:"_appWhole",value:function _appWhole(whole_func,pat_val){const pat_func=this;const query=function(state){const hap_funcs=pat_func.query(state);const hap_vals=pat_val.query(state);const apply=function(hap_func,hap_val){const s=hap_func.part.intersection(hap_val.part);if(s==void 0){return void 0;}return new Hap(whole_func(hap_func.whole,hap_val.whole),s,hap_func.value(hap_val.value),hap_val.combineContext(hap_func));};return flatten(hap_funcs.map(hap_func=>removeUndefineds(hap_vals.map(hap_val=>apply(hap_func,hap_val)))));};return new Pattern$2(query);}},{key:"appBoth",value:function appBoth(pat_val){const whole_func=function(span_a,span_b){if(span_a==void 0||span_b==void 0){return void 0;}return span_a.intersection_e(span_b);};return this._appWhole(whole_func,pat_val);}},{key:"appLeft",value:function appLeft(pat_val){const pat_func=this;const query=function(state){const haps=[];for(const hap_func of pat_func.query(state)){const hap_vals=pat_val.query(state.setSpan(hap_func.wholeOrPart()));for(const hap_val of hap_vals){const new_whole=hap_func.whole;const new_part=hap_func.part.intersection(hap_val.part);if(new_part){const new_value=hap_func.value(hap_val.value);const new_context=hap_val.combineContext(hap_func);const hap=new Hap(new_whole,new_part,new_value,new_context);haps.push(hap);}}}return haps;};return new Pattern$2(query);}},{key:"appRight",value:function appRight(pat_val){const pat_func=this;const query=function(state){const haps=[];for(const hap_val of pat_val.query(state)){const hap_funcs=pat_func.query(state.setSpan(hap_val.wholeOrPart()));for(const hap_func of hap_funcs){const new_whole=hap_val.whole;const new_part=hap_func.part.intersection(hap_val.part);if(new_part){const new_value=hap_func.value(hap_val.value);const new_context=hap_val.combineContext(hap_func);const hap=new Hap(new_whole,new_part,new_value,new_context);haps.push(hap);}}}return haps;};return new Pattern$2(query);}},{key:"firstCycle",value:function firstCycle(with_context=false){var self=this;if(!with_context){self=self._stripContext();}return self.query(new State(new TimeSpan(fraction(0),fraction(1))));}},{key:"_firstCycleValues",get:function(){return this.firstCycle().map(hap=>hap.value);}},{key:"_showFirstCycle",get:function(){return this.firstCycle().map(hap=>`${hap.value}: ${hap.whole.begin.toFraction()} - ${hap.whole.end.toFraction()}`);}},{key:"_sortHapsByPart",value:function _sortHapsByPart(){return this._withHaps(haps=>haps.sort((a,b)=>a.part.begin.sub(b.part.begin).or(a.part.end.sub(b.part.end)).or(a.whole.begin.sub(b.whole.begin).or(a.whole.end.sub(b.whole.end)))));}},{key:"_opIn",value:function _opIn(other,func){return this.fmap(func).appLeft(reify$2(other));}},{key:"_opOut",value:function _opOut(other,func){return this.fmap(func).appRight(reify$2(other));}},{key:"_opMix",value:function _opMix(other,func){return this.fmap(func).appBoth(reify$2(other));}},{key:"_opSqueeze",value:function _opSqueeze(other,func){const otherPat=reify$2(other);return this.fmap(a=>otherPat.fmap(b=>func(a)(b)))._squeezeJoin();}},{key:"_opSqueezeOut",value:function _opSqueezeOut(other,func){const thisPat=this;const otherPat=reify$2(other);return otherPat.fmap(a=>thisPat.fmap(b=>func(b)(a)))._squeezeJoin();}},{key:"_opTrig",value:function _opTrig(other,func){const otherPat=reify$2(other);return otherPat.fmap(b=>this.fmap(a=>func(a)(b)))._trigJoin();}},{key:"_opTrigzero",value:function _opTrigzero(other,func){const otherPat=reify$2(other);return otherPat.fmap(b=>this.fmap(a=>func(a)(b)))._TrigzeroJoin();}},{key:"_asNumber",value:function _asNumber(dropfails=false,softfail=false){return this._withHap(hap=>{const asNumber=Number(hap.value);if(!isNaN(asNumber)){return hap.withValue(()=>asNumber);}const specialValue={e:Math.E,pi:Math.PI}[hap.value];if(typeof specialValue!=="undefined"){return hap.withValue(()=>specialValue);}if(isNote(hap.value)){return new Hap(hap.whole,hap.part,toMidi(hap.value),{...hap.context,type:"midi"});}if(dropfails){return void 0;}if(softfail){return hap;}throw new Error('cannot parse as number: "'+hap.value+'"');});}},{key:"round",value:function round(){return this._asNumber().fmap(v=>Math.round(v));}},{key:"floor",value:function floor(){return this._asNumber().fmap(v=>Math.floor(v));}},{key:"ceil",value:function ceil(){return this._asNumber().fmap(v=>Math.ceil(v));}},{key:"_toBipolar",value:function _toBipolar(){return this.fmap(x=>x*2-1);}},{key:"_fromBipolar",value:function _fromBipolar(){return this.fmap(x=>(x+1)/2);}},{key:"range",value:function range(min,max){return this.mul(max-min).add(min);}},{key:"rangex",value:function rangex(min,max){return this.range(Math.log(min),Math.log(max)).fmap(Math.exp);}},{key:"range2",value:function range2(min,max){return this._fromBipolar().range(min,max);}},{key:"_bindWhole",value:function _bindWhole(choose_whole,func){const pat_val=this;const query=function(state){const withWhole=function(a,b){return new Hap(choose_whole(a.whole,b.whole),b.part,b.value,Object.assign({},a.context,b.context,{locations:(a.context.locations||[]).concat(b.context.locations||[])}));};const match=function(a){return func(a.value).query(state.setSpan(a.part)).map(b=>withWhole(a,b));};return flatten(pat_val.query(state).map(a=>match(a)));};return new Pattern$2(query);}},{key:"bind",value:function bind(func){const whole_func=function(a,b){if(a==void 0||b==void 0){return void 0;}return a.intersection_e(b);};return this._bindWhole(whole_func,func);}},{key:"join",value:function join(){return this.bind(id);}},{key:"outerBind",value:function outerBind(func){return this._bindWhole((a,_)=>a,func);}},{key:"outerJoin",value:function outerJoin(){return this.outerBind(id);}},{key:"innerBind",value:function innerBind(func){return this._bindWhole((_,b)=>b,func);}},{key:"innerJoin",value:function innerJoin(){return this.innerBind(id);}},{key:"_trigJoin",value:function _trigJoin(cycleZero=false){const pat_of_pats=this;return new Pattern$2(state=>{return pat_of_pats.discreteOnly().query(state).map(outer_hap=>{return outer_hap.value.late(cycleZero?outer_hap.whole.begin:outer_hap.whole.begin.cyclePos()).query(state).map(inner_hap=>new Hap(inner_hap.whole?inner_hap.whole.intersection(outer_hap.whole):void 0,inner_hap.part.intersection(outer_hap.part),inner_hap.value).setContext(outer_hap.combineContext(inner_hap))).filter(hap=>hap.part);}).flat();});}},{key:"_TrigzeroJoin",value:function _TrigzeroJoin(){return this._trigJoin(true);}},{key:"_squeezeJoin",value:function _squeezeJoin(){const pat_of_pats=this;function query(state){const haps=pat_of_pats.discreteOnly().query(state);function flatHap(outerHap){const pat=outerHap.value._compressSpan(outerHap.wholeOrPart().cycleArc());const innerHaps=pat.query(state.setSpan(outerHap.part));function munge(outer,inner){let whole=void 0;if(inner.whole&&outer.whole){whole=inner.whole.intersection(outer.whole);if(!whole){return void 0;}}const part=inner.part.intersection(outer.part);if(!part){return void 0;}const context=inner.combineContext(outer);return new Hap(whole,part,inner.value,context);}return innerHaps.map(innerHap=>munge(outerHap,innerHap));}const result=flatten(haps.map(flatHap));return result.filter(x=>x);}return new Pattern$2(query);}},{key:"_squeezeBind",value:function _squeezeBind(func){return this.fmap(func)._squeezeJoin();}},{key:"_apply",value:function _apply(func){return func(this);}},{key:"layer",value:function layer(...funcs){return stack$1(...funcs.map(func=>func(this)));}},{key:"_patternify",value:function _patternify(func){const pat=this;const patterned=function(...args){args=args.map(arg=>isPattern(arg)?arg.fmap(value=>value.value||value):arg);const pat_arg=sequence$1(...args);return pat_arg.fmap(arg=>func.call(pat,arg)).innerJoin();};return patterned;}},{key:"_fastGap",value:function _fastGap(factor){const qf=function(span){const cycle=span.begin.sam();const begin=cycle.add(span.begin.sub(cycle).mul(factor).min(1));const end=cycle.add(span.end.sub(cycle).mul(factor).min(1));return new TimeSpan(begin,end);};const ef=function(span){const cycle=span.begin.sam();const begin=cycle.add(span.begin.sub(cycle).div(factor).min(1));const end=cycle.add(span.end.sub(cycle).div(factor).min(1));return new TimeSpan(begin,end);};return this.withQuerySpan(qf).withHapSpan(ef)._splitQueries();}},{key:"_compress",value:function _compress(b,e){if(b.gt(e)||b.gt(1)||e.gt(1)||b.lt(0)||e.lt(0)){return silence$1;}return this._fastGap(fraction(1).div(e.sub(b)))._late(b);}},{key:"_compressSpan",value:function _compressSpan(span){return this._compress(span.begin,span.end);}},{key:"_fast",value:function _fast(factor){const fastQuery=this.withQueryTime(t2=>t2.mul(factor));return fastQuery.withHapTime(t2=>t2.div(factor));}},{key:"_slow",value:function _slow(factor){return this._fast(fraction(1).div(factor));}},{key:"_inside",value:function _inside(factor,f){return f(this._slow(factor))._fast(factor);}},{key:"_outside",value:function _outside(factor,f){return f(this._fast(factor))._slow(factor);}},{key:"_ply",value:function _ply(factor){return this.fmap(x=>pure$1(x)._fast(factor))._squeezeJoin();}},{key:"_chop",value:function _chop(n){const slices=Array.from({length:n},(x,i2)=>i2);const slice_objects=slices.map(i2=>({begin:i2/n,end:(i2+1)/n}));const func=function(o){return sequence$1(slice_objects.map(slice_o=>Object.assign({},o,slice_o)));};return this._squeezeBind(func);}},{key:"_striate",value:function _striate(n){const slices=Array.from({length:n},(x,i2)=>i2);const slice_objects=slices.map(i2=>({begin:i2/n,end:(i2+1)/n}));const slicePat=slowcat$1(...slice_objects);return this.set(slicePat)._fast(n);}},{key:"_cpm",value:function _cpm(cpm){return this._fast(cpm/60);}},{key:"_early",value:function _early(offset){offset=fraction(offset);return this.withQueryTime(t2=>t2.add(offset)).withHapTime(t2=>t2.sub(offset));}},{key:"_late",value:function _late(offset){offset=fraction(offset);return this._early(fraction(0).sub(offset));}},{key:"_zoom",value:function _zoom(s,e){e=fraction(e);s=fraction(s);const d=e.sub(s);return this.withQuerySpan(span=>span.withCycle(t2=>t2.mul(d).add(s))).withHapSpan(span=>span.withCycle(t2=>t2.sub(s).div(d)))._splitQueries();}},{key:"_zoomArc",value:function _zoomArc(a){return this.zoom(a.begin,a.end);}},{key:"_linger",value:function _linger(t2){if(t2==0){return silence$1;}else if(t2<0){return this._zoom(t2.add(1),1)._slow(t2);}return this._zoom(0,t2)._slow(t2);}},{key:"_color",value:function _color(color){return this._withContext(context=>({...context,color}));}},{key:"log",value:function log(func=id){return this._withHap(hap=>hap.setContext({...hap.context,onTrigger:(...args)=>{if(hap.context.onTrigger){hap.context.onTrigger(...args);}console.log(func(...args));}}));}},{key:"drawLine",value:function drawLine(){console.log(_drawLine(this));return this;}},{key:"_segment",value:function _segment(rate){return this.struct(pure$1(true)._fast(rate));}},{key:"invert",value:function invert(){return this.fmap(x=>!x);}},{key:"inv",value:function inv(){return this.invert();}},{key:"when",value:function when(binary_pat,func){const true_pat=binary_pat._filterValues(id);const false_pat=binary_pat._filterValues(val=>!val);const with_pat=true_pat.fmap(_=>y=>y).appRight(func(this));const without_pat=false_pat.fmap(_=>y=>y).appRight(this);return stack$1(with_pat,without_pat);}},{key:"off",value:function off(time_pat,func){return stack$1(this,func(this.late(time_pat)));}},{key:"every",value:function every(n,func){const pat=this;const pats=Array(n-1).fill(pat);pats.unshift(func(pat));return slowcatPrime(...pats);}},{key:"brak",value:function brak(){return this.when(slowcat$1(false,true),x=>_fastcat(x,silence$1)._late(0.25));}},{key:"rev",value:function rev(){const pat=this;const query=function(state){const span=state.span;const cycle=span.begin.sam();const next_cycle=span.begin.nextSam();const reflect=function(to_reflect){const reflected=to_reflect.withTime(time2=>cycle.add(next_cycle.sub(time2)));const tmp=reflected.begin;reflected.begin=reflected.end;reflected.end=tmp;return reflected;};const haps=pat.query(state.setSpan(reflect(span)));return haps.map(hap=>hap.withSpan(reflect));};return new Pattern$2(query)._splitQueries();}},{key:"palindrome",value:function palindrome(){return this.every(2,rev);}},{key:"juxBy",value:function juxBy(by,func){by/=2;const elem_or=function(dict,key,dflt){if(key in dict){return dict[key];}return dflt;};const left=this.withValue(val=>Object.assign({},val,{pan:elem_or(val,"pan",0.5)-by}));const right=this.withValue(val=>Object.assign({},val,{pan:elem_or(val,"pan",0.5)+by}));return stack$1(left,func(right));}},{key:"_jux",value:function _jux(func){return this.juxBy(1,func);}},{key:"stack",value:function stack(...pats){return stack$1(this,...pats);}},{key:"sequence",value:function sequence(...pats){return sequence$1(this,...pats);}},{key:"seq",value:function seq(...pats){return sequence$1(this,...pats);}},{key:"cat",value:function cat(...pats){return _cat(this,...pats);}},{key:"fastcat",value:function fastcat(...pats){return _fastcat(this,...pats);}},{key:"slowcat",value:function slowcat(...pats){return slowcat$1(this,...pats);}},{key:"superimpose",value:function superimpose(...funcs){return this.stack(...funcs.map(func=>func(this)));}},{key:"stutWith",value:function stutWith(times,time2,func){return stack$1(...listRange(0,times-1).map(i2=>func(this.late(fraction(time2).mul(i2)),i2)));}},{key:"stut",value:function stut(times,feedback,time2){return this.stutWith(times,time2,(pat,i2)=>pat.velocity(Math.pow(feedback,i2)));}},{key:"_echoWith",value:function _echoWith(times,time2,func){return stack$1(...listRange(0,times-1).map(i2=>func(this.late(fraction(time2).mul(i2)),i2)));}},{key:"_echo",value:function _echo(times,time2,feedback){return this._echoWith(times,time2,(pat,i2)=>pat.velocity(Math.pow(feedback,i2)));}},{key:"iter",value:function iter(times,back=false){return slowcat$1(...listRange(0,times-1).map(i2=>back?this.late(i2/times):this.early(i2/times)));}},{key:"iterBack",value:function iterBack(times){return this.iter(times,true);}},{key:"_chunk",value:function _chunk(n,func,back=false){const binary=Array(n-1).fill(false);binary.unshift(true);const binary_pat=sequence$1(...binary).iter(n,back);return this.when(binary_pat,func);}},{key:"_chunkBack",value:function _chunkBack(n,func){return this._chunk(n,func,true);}},{key:"_bypass",value:function _bypass(on2){on2=Boolean(parseInt(on2));return on2?silence$1:this;}},{key:"hush",value:function hush(){return silence$1;}},{key:"_duration",value:function _duration(value){return this.withHapSpan(span=>new TimeSpan(span.begin,span.begin.add(value)));}},{key:"_legato",value:function _legato(value){return this.withHapSpan(span=>new TimeSpan(span.begin,span.begin.add(span.end.sub(span.begin).mul(value))));}},{key:"_velocity",value:function _velocity(velocity){return this._withContext(context=>({...context,velocity:(context.velocity||1)*velocity}));}},{key:"_loopAt",value:function _loopAt(factor,cps=1){return this.speed(1/factor*cps).unit("c").slow(factor);}},{key:"onTrigger",value:function onTrigger(_onTrigger){return this._withHap(hap=>hap.setContext({...hap.context,onTrigger:_onTrigger}));}},{key:"logValues",value:function logValues(func=id){return this.log((_,hap)=>func(hap.value));}}]);return Pattern$2;}();function _composeOp(a,b,func){function _nonFunctionObject(x){return x instanceof Object&&!(x instanceof Function);}if(_nonFunctionObject(a)||_nonFunctionObject(b)){if(!_nonFunctionObject(a)){a={value:a};}if(!_nonFunctionObject(b)){b={value:b};}return unionWithObj(a,b,func);}return func(a,b);}(function(){const num=pat=>pat._asNumber();const numOrString=pat=>pat._asNumber(false,true);const composers={set:[(a,b)=>b],keep:[(a,b)=>a],keepif:[(a,b)=>b?a:void 0],add:[(a,b)=>a+b,numOrString],sub:[(a,b)=>a-b,num],mul:[(a,b)=>a*b,num],div:[(a,b)=>a/b,num],mod:[mod,num],pow:[Math.pow,num],_and:[(a,b)=>a&b,num],_or:[(a,b)=>a|b,num],_xor:[(a,b)=>a^b,num],_lshift:[(a,b)=>a<a>>b,num],lt:[(a,b)=>aa>b],lte:[(a,b)=>a<=b],gte:[(a,b)=>a>=b],eq:[(a,b)=>a==b],eqt:[(a,b)=>a===b],ne:[(a,b)=>a!=b],net:[(a,b)=>a!==b],and:[(a,b)=>a&&b],or:[(a,b)=>a||b],func:[(a,b)=>b(a)]};for(const[what,[op,preprocess]]of Object.entries(composers)){for(const how of["In","Out","Mix","Squeeze","SqueezeOut","Trig","Trigzero"]){Pattern$2.prototype[what+how]=function(...other){var pat=this;other=sequence$1(other);if(preprocess){pat=preprocess(pat);other=preprocess(other);}var result=pat["_op"+how](other,a=>b=>_composeOp(a,b,op));if(what==="keepif"){result=result._removeUndefineds();}return result;};if(how==="Squeeze"){Pattern$2.prototype[what+"SqueezeIn"]=Pattern$2.prototype[what+how];}if(how==="In"){Pattern$2.prototype[what]=Pattern$2.prototype[what+how];}else{if(what==="set"){Pattern$2.prototype[how.toLowerCase()]=Pattern$2.prototype[what+how];}}}}Pattern$2.prototype.struct=Pattern$2.prototype.keepifOut;Pattern$2.prototype.structAll=Pattern$2.prototype.keepOut;Pattern$2.prototype.mask=Pattern$2.prototype.keepifIn;Pattern$2.prototype.maskAll=Pattern$2.prototype.keepIn;Pattern$2.prototype.reset=Pattern$2.prototype.keepifTrig;Pattern$2.prototype.resetAll=Pattern$2.prototype.keepTrig;Pattern$2.prototype.restart=Pattern$2.prototype.keepifTrigzero;Pattern$2.prototype.restartAll=Pattern$2.prototype.keepTrigzero;})();Pattern$2.prototype.patternified=["apply","chop","color","cpm","duration","early","fast","jux","late","legato","linger","ply","segment","striate","slow","velocity"];Pattern$2.prototype.factories={pure:pure$1,stack:stack$1,slowcat:slowcat$1,fastcat:_fastcat,cat:_cat,timeCat:timeCat$1,sequence:sequence$1,seq:seq$2,polymeter:polymeter,pm:pm,polyrhythm:polyrhythm,pr:pr};var silence$1=new Pattern$2(_=>[]);function pure$1(value){function query(state){return state.span.spanCycles.map(subspan=>new Hap(fraction(subspan.begin).wholeCycle(),subspan,value));}return new Pattern$2(query);}function isPattern(thing){const is=thing instanceof Pattern$2||thing._Pattern;if(!thing instanceof Pattern$2){console.warn(`Found Pattern that fails "instanceof Pattern" check. + **/ + +(function (module2, exports2) { + (function (root) { + var MAX_CYCLE_LEN = 2e3; + var P = { + "s": 1, + "n": 0, + "d": 1 + }; + + function assign(n, s) { + if (isNaN(n = parseInt(n, 10))) { + throw Fraction2["InvalidParameter"]; + } + + return n * s; + } + + function newFraction(n, d) { + if (d === 0) { + throw Fraction2["DivisionByZero"]; + } + + var f = Object.create(Fraction2.prototype); + f["s"] = n < 0 ? -1 : 1; + n = n < 0 ? -n : n; + var a = gcd2(n, d); + f["n"] = n / a; + f["d"] = d / a; + return f; + } + + function factorize(num) { + var factors = {}; + var n = num; + var i = 2; + var s = 4; + + while (s <= n) { + while (n % i === 0) { + n /= i; + factors[i] = (factors[i] || 0) + 1; + } + + s += 1 + 2 * i++; + } + + if (n !== num) { + if (n > 1) factors[n] = (factors[n] || 0) + 1; + } else { + factors[num] = (factors[num] || 0) + 1; + } + + return factors; + } + + var parse = function (p1, p2) { + var n = 0, + d = 1, + s = 1; + var v = 0, + w = 0, + x = 0, + y = 1, + z = 1; + var A = 0, + B = 1; + var C = 1, + D = 1; + var N = 1e7; + var M; + if (p1 === void 0 || p1 === null) ;else if (p2 !== void 0) { + n = p1; + d = p2; + s = n * d; + + if (n % 1 !== 0 || d % 1 !== 0) { + throw Fraction2["NonIntegerParameter"]; + } + } else switch (typeof p1) { + case "object": + { + if ("d" in p1 && "n" in p1) { + n = p1["n"]; + d = p1["d"]; + if ("s" in p1) n *= p1["s"]; + } else if (0 in p1) { + n = p1[0]; + if (1 in p1) d = p1[1]; + } else { + throw Fraction2["InvalidParameter"]; + } + + s = n * d; + break; + } + + case "number": + { + if (p1 < 0) { + s = p1; + p1 = -p1; + } + + if (p1 % 1 === 0) { + n = p1; + } else if (p1 > 0) { + if (p1 >= 1) { + z = Math.pow(10, Math.floor(1 + Math.log(p1) / Math.LN10)); + p1 /= z; + } + + while (B <= N && D <= N) { + M = (A + C) / (B + D); + + if (p1 === M) { + if (B + D <= N) { + n = A + C; + d = B + D; + } else if (D > B) { + n = C; + d = D; + } else { + n = A; + d = B; + } + + break; + } else { + if (p1 > M) { + A += C; + B += D; + } else { + C += A; + D += B; + } + + if (B > N) { + n = C; + d = D; + } else { + n = A; + d = B; + } + } + } + + n *= z; + } else if (isNaN(p1) || isNaN(p2)) { + d = n = NaN; + } + + break; + } + + case "string": + { + B = p1.match(/\d+|./g); + if (B === null) throw Fraction2["InvalidParameter"]; + + if (B[A] === "-") { + s = -1; + A++; + } else if (B[A] === "+") { + A++; + } + + if (B.length === A + 1) { + w = assign(B[A++], s); + } else if (B[A + 1] === "." || B[A] === ".") { + if (B[A] !== ".") { + v = assign(B[A++], s); + } + + A++; + + if (A + 1 === B.length || B[A + 1] === "(" && B[A + 3] === ")" || B[A + 1] === "'" && B[A + 3] === "'") { + w = assign(B[A], s); + y = Math.pow(10, B[A].length); + A++; + } + + if (B[A] === "(" && B[A + 2] === ")" || B[A] === "'" && B[A + 2] === "'") { + x = assign(B[A + 1], s); + z = Math.pow(10, B[A + 1].length) - 1; + A += 3; + } + } else if (B[A + 1] === "/" || B[A + 1] === ":") { + w = assign(B[A], s); + y = assign(B[A + 2], 1); + A += 3; + } else if (B[A + 3] === "/" && B[A + 1] === " ") { + v = assign(B[A], s); + w = assign(B[A + 2], s); + y = assign(B[A + 4], 1); + A += 5; + } + + if (B.length <= A) { + d = y * z; + s = n = x + d * v + z * w; + break; + } + } + + default: + throw Fraction2["InvalidParameter"]; + } + + if (d === 0) { + throw Fraction2["DivisionByZero"]; + } + + P["s"] = s < 0 ? -1 : 1; + P["n"] = Math.abs(n); + P["d"] = Math.abs(d); + }; + + function modpow(b, e, m) { + var r = 1; + + for (; e > 0; b = b * b % m, e >>= 1) { + if (e & 1) { + r = r * b % m; + } + } + + return r; + } + + function cycleLen(n, d) { + for (; d % 2 === 0; d /= 2) {} + + for (; d % 5 === 0; d /= 5) {} + + if (d === 1) return 0; + var rem = 10 % d; + var t = 1; + + for (; rem !== 1; t++) { + rem = rem * 10 % d; + if (t > MAX_CYCLE_LEN) return 0; + } + + return t; + } + + function cycleStart(n, d, len) { + var rem1 = 1; + var rem2 = modpow(10, len, d); + + for (var t = 0; t < 300; t++) { + if (rem1 === rem2) return t; + rem1 = rem1 * 10 % d; + rem2 = rem2 * 10 % d; + } + + return 0; + } + + function gcd2(a, b) { + if (!a) return b; + if (!b) return a; + + while (1) { + a %= b; + if (!a) return b; + b %= a; + if (!b) return a; + } + } + + function Fraction2(a, b) { + parse(a, b); + + if (this instanceof Fraction2) { + a = gcd2(P["d"], P["n"]); + this["s"] = P["s"]; + this["n"] = P["n"] / a; + this["d"] = P["d"] / a; + } else { + return newFraction(P["s"] * P["n"], P["d"]); + } + } + + Fraction2["DivisionByZero"] = new Error("Division by Zero"); + Fraction2["InvalidParameter"] = new Error("Invalid argument"); + Fraction2["NonIntegerParameter"] = new Error("Parameters must be integer"); + Fraction2.prototype = { + "s": 1, + "n": 0, + "d": 1, + "abs": function () { + return newFraction(this["n"], this["d"]); + }, + "neg": function () { + return newFraction(-this["s"] * this["n"], this["d"]); + }, + "add": function (a, b) { + parse(a, b); + return newFraction(this["s"] * this["n"] * P["d"] + P["s"] * this["d"] * P["n"], this["d"] * P["d"]); + }, + "sub": function (a, b) { + parse(a, b); + return newFraction(this["s"] * this["n"] * P["d"] - P["s"] * this["d"] * P["n"], this["d"] * P["d"]); + }, + "mul": function (a, b) { + parse(a, b); + return newFraction(this["s"] * P["s"] * this["n"] * P["n"], this["d"] * P["d"]); + }, + "div": function (a, b) { + parse(a, b); + return newFraction(this["s"] * P["s"] * this["n"] * P["d"], this["d"] * P["n"]); + }, + "clone": function () { + return newFraction(this["s"] * this["n"], this["d"]); + }, + "mod": function (a, b) { + if (isNaN(this["n"]) || isNaN(this["d"])) { + return new Fraction2(NaN); + } + + if (a === void 0) { + return newFraction(this["s"] * this["n"] % this["d"], 1); + } + + parse(a, b); + + if (0 === P["n"] && 0 === this["d"]) { + throw Fraction2["DivisionByZero"]; + } + + return newFraction(this["s"] * (P["d"] * this["n"]) % (P["n"] * this["d"]), P["d"] * this["d"]); + }, + "gcd": function (a, b) { + parse(a, b); + return newFraction(gcd2(P["n"], this["n"]) * gcd2(P["d"], this["d"]), P["d"] * this["d"]); + }, + "lcm": function (a, b) { + parse(a, b); + + if (P["n"] === 0 && this["n"] === 0) { + return newFraction(0, 1); + } + + return newFraction(P["n"] * this["n"], gcd2(P["n"], this["n"]) * gcd2(P["d"], this["d"])); + }, + "ceil": function (places) { + places = Math.pow(10, places || 0); + + if (isNaN(this["n"]) || isNaN(this["d"])) { + return new Fraction2(NaN); + } + + return newFraction(Math.ceil(places * this["s"] * this["n"] / this["d"]), places); + }, + "floor": function (places) { + places = Math.pow(10, places || 0); + + if (isNaN(this["n"]) || isNaN(this["d"])) { + return new Fraction2(NaN); + } + + return newFraction(Math.floor(places * this["s"] * this["n"] / this["d"]), places); + }, + "round": function (places) { + places = Math.pow(10, places || 0); + + if (isNaN(this["n"]) || isNaN(this["d"])) { + return new Fraction2(NaN); + } + + return newFraction(Math.round(places * this["s"] * this["n"] / this["d"]), places); + }, + "inverse": function () { + return newFraction(this["s"] * this["d"], this["n"]); + }, + "pow": function (a, b) { + parse(a, b); + + if (P["d"] === 1) { + if (P["s"] < 0) { + return newFraction(Math.pow(this["s"] * this["d"], P["n"]), Math.pow(this["n"], P["n"])); + } else { + return newFraction(Math.pow(this["s"] * this["n"], P["n"]), Math.pow(this["d"], P["n"])); + } + } + + if (this["s"] < 0) return null; + var N = factorize(this["n"]); + var D = factorize(this["d"]); + var n = 1; + var d = 1; + + for (var k in N) { + if (k === "1") continue; + + if (k === "0") { + n = 0; + break; + } + + N[k] *= P["n"]; + + if (N[k] % P["d"] === 0) { + N[k] /= P["d"]; + } else return null; + + n *= Math.pow(k, N[k]); + } + + for (var k in D) { + if (k === "1") continue; + D[k] *= P["n"]; + + if (D[k] % P["d"] === 0) { + D[k] /= P["d"]; + } else return null; + + d *= Math.pow(k, D[k]); + } + + if (P["s"] < 0) { + return newFraction(d, n); + } + + return newFraction(n, d); + }, + "equals": function (a, b) { + parse(a, b); + return this["s"] * this["n"] * P["d"] === P["s"] * P["n"] * this["d"]; + }, + "compare": function (a, b) { + parse(a, b); + var t = this["s"] * this["n"] * P["d"] - P["s"] * P["n"] * this["d"]; + return (0 < t) - (t < 0); + }, + "simplify": function (eps) { + if (isNaN(this["n"]) || isNaN(this["d"])) { + return this; + } + + eps = eps || 1e-3; + var thisABS = this["abs"](); + var cont = thisABS["toContinued"](); + + for (var i = 1; i < cont.length; i++) { + var s = newFraction(cont[i - 1], 1); + + for (var k = i - 2; k >= 0; k--) { + s = s["inverse"]()["add"](cont[k]); + } + + if (s["sub"](thisABS)["abs"]().valueOf() < eps) { + return s["mul"](this["s"]); + } + } + + return this; + }, + "divisible": function (a, b) { + parse(a, b); + return !(!(P["n"] * this["d"]) || this["n"] * P["d"] % (P["n"] * this["d"])); + }, + "valueOf": function () { + return this["s"] * this["n"] / this["d"]; + }, + "toFraction": function (excludeWhole) { + var whole, + str = ""; + var n = this["n"]; + var d = this["d"]; + + if (this["s"] < 0) { + str += "-"; + } + + if (d === 1) { + str += n; + } else { + if (excludeWhole && (whole = Math.floor(n / d)) > 0) { + str += whole; + str += " "; + n %= d; + } + + str += n; + str += "/"; + str += d; + } + + return str; + }, + "toLatex": function (excludeWhole) { + var whole, + str = ""; + var n = this["n"]; + var d = this["d"]; + + if (this["s"] < 0) { + str += "-"; + } + + if (d === 1) { + str += n; + } else { + if (excludeWhole && (whole = Math.floor(n / d)) > 0) { + str += whole; + n %= d; + } + + str += "\\frac{"; + str += n; + str += "}{"; + str += d; + str += "}"; + } + + return str; + }, + "toContinued": function () { + var t; + var a = this["n"]; + var b = this["d"]; + var res = []; + + if (isNaN(a) || isNaN(b)) { + return res; + } + + do { + res.push(Math.floor(a / b)); + t = a % b; + a = b; + b = t; + } while (a !== 1); + + return res; + }, + "toString": function (dec) { + var N = this["n"]; + var D = this["d"]; + + if (isNaN(N) || isNaN(D)) { + return "NaN"; + } + + dec = dec || 15; + var cycLen = cycleLen(N, D); + var cycOff = cycleStart(N, D, cycLen); + var str = this["s"] < 0 ? "-" : ""; + str += N / D | 0; + N %= D; + N *= 10; + if (N) str += "."; + + if (cycLen) { + for (var i = cycOff; i--;) { + str += N / D | 0; + N %= D; + N *= 10; + } + + str += "("; + + for (var i = cycLen; i--;) { + str += N / D | 0; + N %= D; + N *= 10; + } + + str += ")"; + } else { + for (var i = dec; N && i--;) { + str += N / D | 0; + N %= D; + N *= 10; + } + } + + return str; + } + }; + { + Object.defineProperty(Fraction2, "__esModule", { + "value": true + }); + Fraction2["default"] = Fraction2; + Fraction2["Fraction"] = Fraction2; + module2["exports"] = Fraction2; + } + })(); +})(fraction$1); + +var Fraction$1 = /* @__PURE__ */getDefaultExportFromCjs(fraction$1.exports); + +Fraction$1.prototype.sam = function () { + return this.floor(); +}; + +Fraction$1.prototype.nextSam = function () { + return this.sam().add(1); +}; + +Fraction$1.prototype.wholeCycle = function () { + return new TimeSpan(this.sam(), this.nextSam()); +}; + +Fraction$1.prototype.cyclePos = function () { + return this.sub(this.sam()); +}; + +Fraction$1.prototype.lt = function (other) { + return this.compare(other) < 0; +}; + +Fraction$1.prototype.gt = function (other) { + return this.compare(other) > 0; +}; + +Fraction$1.prototype.lte = function (other) { + return this.compare(other) <= 0; +}; + +Fraction$1.prototype.gte = function (other) { + return this.compare(other) >= 0; +}; + +Fraction$1.prototype.eq = function (other) { + return this.compare(other) == 0; +}; + +Fraction$1.prototype.max = function (other) { + return this.gt(other) ? this : other; +}; + +Fraction$1.prototype.min = function (other) { + return this.lt(other) ? this : other; +}; + +Fraction$1.prototype.show = function () { + return this.s * this.n + "/" + this.d; +}; + +Fraction$1.prototype.or = function (other) { + return this.eq(0) ? other : this; +}; + +var fraction = n => { + if (typeof n === "number") { + n = String(n); + } + + return Fraction$1(n); +}; + +var gcd = (...fractions) => { + return fractions.reduce((gcd2, fraction2) => gcd2.gcd(fraction2), fraction(1)); +}; + +fraction._original = Fraction$1; + +var TimeSpan = /*#__PURE__*/function () { + function TimeSpan(begin, end) { + _classCallCheck(this, TimeSpan); + + this.begin = fraction(begin); + this.end = fraction(end); + } + + _createClass(TimeSpan, [{ + key: "spanCycles", + get: function () { + const spans = []; + var begin = this.begin; + const end = this.end; + const end_sam = end.sam(); + + while (end.gt(begin)) { + if (begin.sam().equals(end_sam)) { + spans.push(new TimeSpan(begin, this.end)); + break; + } + + const next_begin = begin.nextSam(); + spans.push(new TimeSpan(begin, next_begin)); + begin = next_begin; + } + + return spans; + } + }, { + key: "duration", + get: function () { + return this.end.sub(this.begin); + } + }, { + key: "cycleArc", + value: function cycleArc() { + const b = this.begin.cyclePos(); + const e = b.add(this.duration); + return new TimeSpan(b, e); + } + }, { + key: "withTime", + value: function withTime(func_time) { + return new TimeSpan(func_time(this.begin), func_time(this.end)); + } + }, { + key: "withEnd", + value: function withEnd(func_time) { + return new TimeSpan(this.begin, func_time(this.end)); + } + }, { + key: "withCycle", + value: function withCycle(func_time) { + const sam = this.begin.sam(); + const b = sam.add(func_time(this.begin.sub(sam))); + const e = sam.add(func_time(this.end.sub(sam))); + return new TimeSpan(b, e); + } + }, { + key: "intersection", + value: function intersection(other) { + const intersect_begin = this.begin.max(other.begin); + const intersect_end = this.end.min(other.end); + + if (intersect_begin.gt(intersect_end)) { + return void 0; + } + + if (intersect_begin.equals(intersect_end)) { + if (intersect_begin.equals(this.end) && this.begin.lt(this.end)) { + return void 0; + } + + if (intersect_begin.equals(other.end) && other.begin.lt(other.end)) { + return void 0; + } + } + + return new TimeSpan(intersect_begin, intersect_end); + } + }, { + key: "intersection_e", + value: function intersection_e(other) { + const result = this.intersection(other); + + if (result == void 0) { + throw "TimeSpans do not intersect"; + } + + return result; + } + }, { + key: "midpoint", + value: function midpoint() { + return this.begin.add(this.duration.div(fraction(2))); + } + }, { + key: "equals", + value: function equals(other) { + return this.begin.equals(other.begin) && this.end.equals(other.end); + } + }, { + key: "show", + value: function show() { + return this.begin.show() + " -> " + this.end.show(); + } + }]); + + return TimeSpan; +}(); + +var Hap = /*#__PURE__*/function () { + function Hap(whole, part, value, context = {}, stateful = false) { + _classCallCheck(this, Hap); + + this.whole = whole; + this.part = part; + this.value = value; + this.context = context; + this.stateful = stateful; + + if (stateful) { + console.assert(typeof this.value === "function", "Stateful values must be functions"); + } + } + + _createClass(Hap, [{ + key: "duration", + get: function () { + return this.whole.end.sub(this.whole.begin); + } + }, { + key: "wholeOrPart", + value: function wholeOrPart() { + return this.whole ? this.whole : this.part; + } + }, { + key: "withSpan", + value: function withSpan(func) { + const whole = this.whole ? func(this.whole) : void 0; + return new Hap(whole, func(this.part), this.value, this.context); + } + }, { + key: "withValue", + value: function withValue(func) { + return new Hap(this.whole, this.part, func(this.value), this.context); + } + }, { + key: "hasOnset", + value: function hasOnset() { + return this.whole != void 0 && this.whole.begin.equals(this.part.begin); + } + }, { + key: "resolveState", + value: function resolveState(state) { + if (this.stateful && this.hasOnset()) { + console.log("stateful"); + const func = this.value; + const [newState, newValue] = func(state); + return [newState, new Hap(this.whole, this.part, newValue, this.context, false)]; + } + + return [state, this]; + } + }, { + key: "spanEquals", + value: function spanEquals(other) { + return this.whole == void 0 && other.whole == void 0 || this.whole.equals(other.whole); + } + }, { + key: "equals", + value: function equals(other) { + return this.spanEquals(other) && this.part.equals(other.part) && this.value === other.value; + } + }, { + key: "show", + value: function show() { + return "(" + (this.whole == void 0 ? "~" : this.whole.show()) + ", " + this.part.show() + ", " + this.value + ")"; + } + }, { + key: "showWhole", + value: function showWhole() { + return `${this.whole == void 0 ? "~" : this.whole.show()}: ${typeof this.value === "object" ? JSON.stringify(this.value) : this.value}`; + } + }, { + key: "combineContext", + value: function combineContext(b) { + const a = this; + return { ...a.context, + ...b.context, + locations: (a.context.locations || []).concat(b.context.locations || []) + }; + } + }, { + key: "setContext", + value: function setContext(context) { + return new Hap(this.whole, this.part, this.value, context); + } + }]); + + return Hap; +}(); + +var State = /*#__PURE__*/function () { + function State(span, controls2 = {}) { + _classCallCheck(this, State); + + this.span = span; + this.controls = controls2; + } + + _createClass(State, [{ + key: "setSpan", + value: function setSpan(span) { + return new State(span, this.controls); + } + }, { + key: "withSpan", + value: function withSpan(func) { + return this.setSpan(func(this.span)); + } + }, { + key: "setControls", + value: function setControls(controls2) { + return new State(this.span, controls2); + } + }]); + + return State; +}(); + +var isNote = name => /^[a-gA-G][#b]*[0-9]$/.test(name); + +var tokenizeNote = note => { + var _a; + + if (typeof note !== "string") { + return []; + } + + const [pc, acc = "", oct] = ((_a = note.match(/^([a-gA-G])([#bs]*)([0-9])?$/)) == null ? void 0 : _a.slice(1)) || []; + + if (!pc) { + return []; + } + + return [pc, acc, oct ? Number(oct) : void 0]; +}; + +var toMidi = note => { + const [pc, acc, oct] = tokenizeNote(note); + + if (!pc) { + throw new Error('not a note: "' + note + '"'); + } + + const chroma = { + c: 0, + d: 2, + e: 4, + f: 5, + g: 7, + a: 9, + b: 11 + }[pc.toLowerCase()]; + const offset = (acc == null ? void 0 : acc.split("").reduce((o, char) => o + { + "#": 1, + b: -1, + s: 1 + }[char], 0)) || 0; + return (Number(oct) + 1) * 12 + chroma + offset; +}; + +var fromMidi = n => { + return Math.pow(2, (n - 69) / 12) * 440; +}; + +var getFreq = noteOrMidi => { + if (typeof noteOrMidi === "number") { + return fromMidi(noteOrMidi); + } + + return fromMidi(toMidi(noteOrMidi)); +}; + +var midi2note = n => { + const oct = Math.floor(n / 12) - 1; + const pc = ["C", "Db", "D", "Eb", "E", "F", "Gb", "G", "Ab", "A", "Bb", "B"][n % 12]; + return pc + oct; +}; + +var mod = (n, m) => (n % m + m) % m; + +var getPlayableNoteValue = hap => { + let { + value: note, + context + } = hap; + + if (typeof note === "object" && !Array.isArray(note)) { + note = note.note || note.n || note.value; + } + + if (typeof note === "number" && context.type !== "frequency") { + note = fromMidi(hap.value); + } else if (typeof note === "number" && context.type === "frequency") { + note = hap.value; + } else if (typeof note !== "string" || !isNote(note)) { + throw new Error("not a note: " + JSON.stringify(note)); + } + + return note; +}; + +var getFrequency = hap => { + let { + value, + context + } = hap; + + if (typeof value === "object" && value.freq) { + return value.freq; + } + + if (typeof value === "number" && context.type !== "frequency") { + value = fromMidi(hap.value); + } else if (typeof value === "string" && isNote(value)) { + value = fromMidi(toMidi(hap.value)); + } else if (typeof value !== "number") { + throw new Error("not a note or frequency:" + value); + } + + return value; +}; + +var rotate = (arr, n) => arr.slice(n).concat(arr.slice(0, n)); + +var pipe = (...funcs) => { + return funcs.reduce((f, g) => (...args) => f(g(...args)), x => x); +}; + +var compose = (...funcs) => pipe(...funcs.reverse()); + +var removeUndefineds = xs => xs.filter(x => x != void 0); + +var flatten = arr => [].concat(...arr); + +var id = a => a; + +var constant = (a, b) => a; + +var listRange = (min, max) => Array.from({ + length: max - min + 1 +}, (_, i) => i + min); + +function curry(func, overload) { + const fn = function curried(...args) { + if (args.length >= func.length) { + return func.apply(this, args); + } else { + const partial = function (...args2) { + return curried.apply(this, args.concat(args2)); + }; + + if (overload) { + overload(partial, args); + } + + return partial; + } + }; + + if (overload) { + overload(fn, []); + } + + return fn; +} + +function unionWithObj(a, b, func) { + const common = Object.keys(a).filter(k => Object.keys(b).includes(k)); + return Object.assign({}, a, b, Object.fromEntries(common.map(k => [k, func(a[k], b[k])]))); +} + +curry((a, b) => a * b); +curry((f, anyFunctor) => anyFunctor.map(f)); + +function _drawLine(pat, chars = 60) { + let cycle = 0; + let pos = fraction(0); + let lines = [""]; + let emptyLine = ""; + + while (lines[0].length < chars) { + const haps = pat.queryArc(cycle, cycle + 1); + const durations = haps.filter(hap => hap.hasOnset()).map(hap => hap.duration); + const charFraction = gcd(...durations); + const totalSlots = charFraction.inverse(); + lines = lines.map(line => line + "|"); + emptyLine += "|"; + + for (let i = 0; i < totalSlots; i++) { + const [begin, end] = [pos, pos.add(charFraction)]; + const matches = haps.filter(hap => hap.whole.begin.lte(begin) && hap.whole.end.gte(end)); + const missingLines = matches.length - lines.length; + + if (missingLines > 0) { + lines = lines.concat(Array(missingLines).fill(emptyLine)); + } + + lines = lines.map((line, i2) => { + const hap = matches[i2]; + + if (hap) { + const isOnset = hap.whole.begin.eq(begin); + const char = isOnset ? "" + hap.value : "-"; + return line + char; + } + + return line + "."; + }); + emptyLine += "."; + pos = pos.add(charFraction); + } + + cycle++; + } + + return lines.join("\n"); +} + +var Pattern$1 = /*#__PURE__*/function () { + function Pattern$1(query) { + _classCallCheck(this, Pattern$1); + + __publicField(this, "_Pattern", true); + + this.query = query; + } + + _createClass(Pattern$1, [{ + key: "queryArc", + value: function queryArc(begin, end) { + return this.query(new State(new TimeSpan(begin, end))); + } + }, { + key: "_splitQueries", + value: function _splitQueries() { + const pat = this; + + const q = state => { + return flatten(state.span.spanCycles.map(subspan => pat.query(state.setSpan(subspan)))); + }; + + return new Pattern$1(q); + } + }, { + key: "withQuerySpan", + value: function withQuerySpan(func) { + return new Pattern$1(state => this.query(state.withSpan(func))); + } + }, { + key: "withQueryTime", + value: function withQueryTime(func) { + return new Pattern$1(state => this.query(state.withSpan(span => span.withTime(func)))); + } + }, { + key: "withHapSpan", + value: function withHapSpan(func) { + return new Pattern$1(state => this.query(state).map(hap => hap.withSpan(func))); + } + }, { + key: "withHapTime", + value: function withHapTime(func) { + return this.withHapSpan(span => span.withTime(func)); + } + }, { + key: "_withHaps", + value: function _withHaps(func) { + return new Pattern$1(state => func(this.query(state))); + } + }, { + key: "_withHap", + value: function _withHap(func) { + return this._withHaps(haps => haps.map(func)); + } + }, { + key: "_setContext", + value: function _setContext(context) { + return this._withHap(hap => hap.setContext(context)); + } + }, { + key: "_withContext", + value: function _withContext(func) { + return this._withHap(hap => hap.setContext(func(hap.context))); + } + }, { + key: "_stripContext", + value: function _stripContext() { + return this._withHap(hap => hap.setContext({})); + } + }, { + key: "withLocation", + value: function withLocation(start, end) { + const location = { + start: { + line: start[0], + column: start[1], + offset: start[2] + }, + end: { + line: end[0], + column: end[1], + offset: end[2] + } + }; + return this._withContext(context => { + const locations = (context.locations || []).concat([location]); + return { ...context, + locations + }; + }); + } + }, { + key: "withMiniLocation", + value: function withMiniLocation(start, end) { + const offset = { + start: { + line: start[0], + column: start[1], + offset: start[2] + }, + end: { + line: end[0], + column: end[1], + offset: end[2] + } + }; + return this._withContext(context => { + let locations = context.locations || []; + locations = locations.map(({ + start: start2, + end: end2 + }) => { + const colOffset = start2.line === 1 ? offset.start.column : 0; + return { + start: { ...start2, + line: start2.line - 1 + (offset.start.line - 1) + 1, + column: start2.column - 1 + colOffset + }, + end: { ...end2, + line: end2.line - 1 + (offset.start.line - 1) + 1, + column: end2.column - 1 + colOffset + } + }; + }); + return { ...context, + locations + }; + }); + } + }, { + key: "withValue", + value: function withValue(func) { + return new Pattern$1(state => this.query(state).map(hap => hap.withValue(func))); + } + }, { + key: "fmap", + value: function fmap(func) { + return this.withValue(func); + } + }, { + key: "_filterHaps", + value: function _filterHaps(hap_test) { + return new Pattern$1(state => this.query(state).filter(hap_test)); + } + }, { + key: "_filterValues", + value: function _filterValues(value_test) { + return new Pattern$1(state => this.query(state).filter(hap => value_test(hap.value))); + } + }, { + key: "_removeUndefineds", + value: function _removeUndefineds() { + return this._filterValues(val => val != void 0); + } + }, { + key: "onsetsOnly", + value: function onsetsOnly() { + return this._filterHaps(hap => hap.hasOnset()); + } + }, { + key: "discreteOnly", + value: function discreteOnly() { + return this._filterHaps(hap => hap.whole); + } + }, { + key: "_appWhole", + value: function _appWhole(whole_func, pat_val) { + const pat_func = this; + + const query = function (state) { + const hap_funcs = pat_func.query(state); + const hap_vals = pat_val.query(state); + + const apply = function (hap_func, hap_val) { + const s = hap_func.part.intersection(hap_val.part); + + if (s == void 0) { + return void 0; + } + + return new Hap(whole_func(hap_func.whole, hap_val.whole), s, hap_func.value(hap_val.value), hap_val.combineContext(hap_func)); + }; + + return flatten(hap_funcs.map(hap_func => removeUndefineds(hap_vals.map(hap_val => apply(hap_func, hap_val))))); + }; + + return new Pattern$1(query); + } + }, { + key: "appBoth", + value: function appBoth(pat_val) { + const whole_func = function (span_a, span_b) { + if (span_a == void 0 || span_b == void 0) { + return void 0; + } + + return span_a.intersection_e(span_b); + }; + + return this._appWhole(whole_func, pat_val); + } + }, { + key: "appLeft", + value: function appLeft(pat_val) { + const pat_func = this; + + const query = function (state) { + const haps = []; + + for (const hap_func of pat_func.query(state)) { + const hap_vals = pat_val.query(state.setSpan(hap_func.wholeOrPart())); + + for (const hap_val of hap_vals) { + const new_whole = hap_func.whole; + const new_part = hap_func.part.intersection(hap_val.part); + + if (new_part) { + const new_value = hap_func.value(hap_val.value); + const new_context = hap_val.combineContext(hap_func); + const hap = new Hap(new_whole, new_part, new_value, new_context); + haps.push(hap); + } + } + } + + return haps; + }; + + return new Pattern$1(query); + } + }, { + key: "appRight", + value: function appRight(pat_val) { + const pat_func = this; + + const query = function (state) { + const haps = []; + + for (const hap_val of pat_val.query(state)) { + const hap_funcs = pat_func.query(state.setSpan(hap_val.wholeOrPart())); + + for (const hap_func of hap_funcs) { + const new_whole = hap_val.whole; + const new_part = hap_func.part.intersection(hap_val.part); + + if (new_part) { + const new_value = hap_func.value(hap_val.value); + const new_context = hap_val.combineContext(hap_func); + const hap = new Hap(new_whole, new_part, new_value, new_context); + haps.push(hap); + } + } + } + + return haps; + }; + + return new Pattern$1(query); + } + }, { + key: "firstCycle", + value: function firstCycle(with_context = false) { + var self = this; + + if (!with_context) { + self = self._stripContext(); + } + + return self.query(new State(new TimeSpan(fraction(0), fraction(1)))); + } + }, { + key: "_firstCycleValues", + get: function () { + return this.firstCycle().map(hap => hap.value); + } + }, { + key: "_showFirstCycle", + get: function () { + return this.firstCycle().map(hap => `${hap.value}: ${hap.whole.begin.toFraction()} - ${hap.whole.end.toFraction()}`); + } + }, { + key: "_sortHapsByPart", + value: function _sortHapsByPart() { + return this._withHaps(haps => haps.sort((a, b) => a.part.begin.sub(b.part.begin).or(a.part.end.sub(b.part.end)).or(a.whole.begin.sub(b.whole.begin).or(a.whole.end.sub(b.whole.end))))); + } + }, { + key: "_opIn", + value: function _opIn(other, func) { + return this.fmap(func).appLeft(reify$2(other)); + } + }, { + key: "_opOut", + value: function _opOut(other, func) { + return this.fmap(func).appRight(reify$2(other)); + } + }, { + key: "_opMix", + value: function _opMix(other, func) { + return this.fmap(func).appBoth(reify$2(other)); + } + }, { + key: "_opSqueeze", + value: function _opSqueeze(other, func) { + const otherPat = reify$2(other); + return this.fmap(a => otherPat.fmap(b => func(a)(b)))._squeezeJoin(); + } + }, { + key: "_opSqueezeOut", + value: function _opSqueezeOut(other, func) { + const thisPat = this; + const otherPat = reify$2(other); + return otherPat.fmap(a => thisPat.fmap(b => func(b)(a)))._squeezeJoin(); + } + }, { + key: "_opTrig", + value: function _opTrig(other, func) { + const otherPat = reify$2(other); + return otherPat.fmap(b => this.fmap(a => func(a)(b)))._trigJoin(); + } + }, { + key: "_opTrigzero", + value: function _opTrigzero(other, func) { + const otherPat = reify$2(other); + return otherPat.fmap(b => this.fmap(a => func(a)(b)))._TrigzeroJoin(); + } + }, { + key: "_asNumber", + value: function _asNumber(dropfails = false, softfail = false) { + return this._withHap(hap => { + const asNumber = Number(hap.value); + + if (!isNaN(asNumber)) { + return hap.withValue(() => asNumber); + } + + const specialValue = { + e: Math.E, + pi: Math.PI + }[hap.value]; + + if (typeof specialValue !== "undefined") { + return hap.withValue(() => specialValue); + } + + if (isNote(hap.value)) { + return new Hap(hap.whole, hap.part, toMidi(hap.value), { ...hap.context, + type: "midi" + }); + } + + if (dropfails) { + return void 0; + } + + if (softfail) { + return hap; + } + + throw new Error('cannot parse as number: "' + hap.value + '"'); + }); + } + }, { + key: "round", + value: function round() { + return this._asNumber().fmap(v => Math.round(v)); + } + }, { + key: "floor", + value: function floor() { + return this._asNumber().fmap(v => Math.floor(v)); + } + }, { + key: "ceil", + value: function ceil() { + return this._asNumber().fmap(v => Math.ceil(v)); + } + }, { + key: "_toBipolar", + value: function _toBipolar() { + return this.fmap(x => x * 2 - 1); + } + }, { + key: "_fromBipolar", + value: function _fromBipolar() { + return this.fmap(x => (x + 1) / 2); + } + }, { + key: "range", + value: function range(min, max) { + return this.mul(max - min).add(min); + } + }, { + key: "rangex", + value: function rangex(min, max) { + return this.range(Math.log(min), Math.log(max)).fmap(Math.exp); + } + }, { + key: "range2", + value: function range2(min, max) { + return this._fromBipolar().range(min, max); + } + }, { + key: "_bindWhole", + value: function _bindWhole(choose_whole, func) { + const pat_val = this; + + const query = function (state) { + const withWhole = function (a, b) { + return new Hap(choose_whole(a.whole, b.whole), b.part, b.value, Object.assign({}, a.context, b.context, { + locations: (a.context.locations || []).concat(b.context.locations || []) + })); + }; + + const match = function (a) { + return func(a.value).query(state.setSpan(a.part)).map(b => withWhole(a, b)); + }; + + return flatten(pat_val.query(state).map(a => match(a))); + }; + + return new Pattern$1(query); + } + }, { + key: "bind", + value: function bind(func) { + const whole_func = function (a, b) { + if (a == void 0 || b == void 0) { + return void 0; + } + + return a.intersection_e(b); + }; + + return this._bindWhole(whole_func, func); + } + }, { + key: "join", + value: function join() { + return this.bind(id); + } + }, { + key: "outerBind", + value: function outerBind(func) { + return this._bindWhole((a, _) => a, func); + } + }, { + key: "outerJoin", + value: function outerJoin() { + return this.outerBind(id); + } + }, { + key: "innerBind", + value: function innerBind(func) { + return this._bindWhole((_, b) => b, func); + } + }, { + key: "innerJoin", + value: function innerJoin() { + return this.innerBind(id); + } + }, { + key: "_trigJoin", + value: function _trigJoin(cycleZero = false) { + const pat_of_pats = this; + return new Pattern$1(state => { + return pat_of_pats.discreteOnly().query(state).map(outer_hap => { + return outer_hap.value.late(cycleZero ? outer_hap.whole.begin : outer_hap.whole.begin.cyclePos()).query(state).map(inner_hap => new Hap(inner_hap.whole ? inner_hap.whole.intersection(outer_hap.whole) : void 0, inner_hap.part.intersection(outer_hap.part), inner_hap.value).setContext(outer_hap.combineContext(inner_hap))).filter(hap => hap.part); + }).flat(); + }); + } + }, { + key: "_TrigzeroJoin", + value: function _TrigzeroJoin() { + return this._trigJoin(true); + } + }, { + key: "_squeezeJoin", + value: function _squeezeJoin() { + const pat_of_pats = this; + + function query(state) { + const haps = pat_of_pats.discreteOnly().query(state); + + function flatHap(outerHap) { + const pat = outerHap.value._compressSpan(outerHap.wholeOrPart().cycleArc()); + + const innerHaps = pat.query(state.setSpan(outerHap.part)); + + function munge(outer, inner) { + let whole = void 0; + + if (inner.whole && outer.whole) { + whole = inner.whole.intersection(outer.whole); + + if (!whole) { + return void 0; + } + } + + const part = inner.part.intersection(outer.part); + + if (!part) { + return void 0; + } + + const context = inner.combineContext(outer); + return new Hap(whole, part, inner.value, context); + } + + return innerHaps.map(innerHap => munge(outerHap, innerHap)); + } + + const result = flatten(haps.map(flatHap)); + return result.filter(x => x); + } + + return new Pattern$1(query); + } + }, { + key: "_squeezeBind", + value: function _squeezeBind(func) { + return this.fmap(func)._squeezeJoin(); + } + }, { + key: "_apply", + value: function _apply(func) { + return func(this); + } + }, { + key: "layer", + value: function layer(...funcs) { + return stack$1(...funcs.map(func => func(this))); + } + }, { + key: "_patternify", + value: function _patternify(func) { + const pat = this; + + const patterned = function (...args) { + args = args.map(arg => isPattern(arg) ? arg.fmap(value => value.value || value) : arg); + const pat_arg = sequence$1(...args); + return pat_arg.fmap(arg => func.call(pat, arg)).innerJoin(); + }; + + return patterned; + } + }, { + key: "_fastGap", + value: function _fastGap(factor) { + const qf = function (span) { + const cycle = span.begin.sam(); + const begin = cycle.add(span.begin.sub(cycle).mul(factor).min(1)); + const end = cycle.add(span.end.sub(cycle).mul(factor).min(1)); + return new TimeSpan(begin, end); + }; + + const ef = function (span) { + const cycle = span.begin.sam(); + const begin = cycle.add(span.begin.sub(cycle).div(factor).min(1)); + const end = cycle.add(span.end.sub(cycle).div(factor).min(1)); + return new TimeSpan(begin, end); + }; + + return this.withQuerySpan(qf).withHapSpan(ef)._splitQueries(); + } + }, { + key: "_compress", + value: function _compress(b, e) { + if (b.gt(e) || b.gt(1) || e.gt(1) || b.lt(0) || e.lt(0)) { + return silence$1; + } + + return this._fastGap(fraction(1).div(e.sub(b)))._late(b); + } + }, { + key: "_compressSpan", + value: function _compressSpan(span) { + return this._compress(span.begin, span.end); + } + }, { + key: "_fast", + value: function _fast(factor) { + const fastQuery = this.withQueryTime(t => t.mul(factor)); + return fastQuery.withHapTime(t => t.div(factor)); + } + }, { + key: "_slow", + value: function _slow(factor) { + return this._fast(fraction(1).div(factor)); + } + }, { + key: "_inside", + value: function _inside(factor, f) { + return f(this._slow(factor))._fast(factor); + } + }, { + key: "_outside", + value: function _outside(factor, f) { + return f(this._fast(factor))._slow(factor); + } + }, { + key: "_ply", + value: function _ply(factor) { + return this.fmap(x => pure$1(x)._fast(factor))._squeezeJoin(); + } + }, { + key: "_chop", + value: function _chop(n) { + const slices = Array.from({ + length: n + }, (x, i) => i); + const slice_objects = slices.map(i => ({ + begin: i / n, + end: (i + 1) / n + })); + + const func = function (o) { + return sequence$1(slice_objects.map(slice_o => Object.assign({}, o, slice_o))); + }; + + return this._squeezeBind(func); + } + }, { + key: "_striate", + value: function _striate(n) { + const slices = Array.from({ + length: n + }, (x, i) => i); + const slice_objects = slices.map(i => ({ + begin: i / n, + end: (i + 1) / n + })); + const slicePat = slowcat$1(...slice_objects); + return this.set(slicePat)._fast(n); + } + }, { + key: "_cpm", + value: function _cpm(cpm) { + return this._fast(cpm / 60); + } + }, { + key: "_early", + value: function _early(offset) { + offset = fraction(offset); + return this.withQueryTime(t => t.add(offset)).withHapTime(t => t.sub(offset)); + } + }, { + key: "_late", + value: function _late(offset) { + offset = fraction(offset); + return this._early(fraction(0).sub(offset)); + } + }, { + key: "_zoom", + value: function _zoom(s, e) { + e = fraction(e); + s = fraction(s); + const d = e.sub(s); + return this.withQuerySpan(span => span.withCycle(t => t.mul(d).add(s))).withHapSpan(span => span.withCycle(t => t.sub(s).div(d)))._splitQueries(); + } + }, { + key: "_zoomArc", + value: function _zoomArc(a) { + return this.zoom(a.begin, a.end); + } + }, { + key: "_linger", + value: function _linger(t) { + if (t == 0) { + return silence$1; + } else if (t < 0) { + return this._zoom(t.add(1), 1)._slow(t); + } + + return this._zoom(0, t)._slow(t); + } + }, { + key: "_color", + value: function _color(color) { + return this._withContext(context => ({ ...context, + color + })); + } + }, { + key: "log", + value: function log(func = id) { + return this._withHap(hap => hap.setContext({ ...hap.context, + onTrigger: (...args) => { + if (hap.context.onTrigger) { + hap.context.onTrigger(...args); + } + + console.log(func(...args)); + } + })); + } + }, { + key: "drawLine", + value: function drawLine() { + console.log(_drawLine(this)); + return this; + } + }, { + key: "_segment", + value: function _segment(rate) { + return this.struct(pure$1(true)._fast(rate)); + } + }, { + key: "invert", + value: function invert() { + return this.fmap(x => !x); + } + }, { + key: "inv", + value: function inv() { + return this.invert(); + } + }, { + key: "when", + value: function when(binary_pat, func) { + const true_pat = binary_pat._filterValues(id); + + const false_pat = binary_pat._filterValues(val => !val); + + const with_pat = true_pat.fmap(_ => y => y).appRight(func(this)); + const without_pat = false_pat.fmap(_ => y => y).appRight(this); + return stack$1(with_pat, without_pat); + } + }, { + key: "off", + value: function off(time_pat, func) { + return stack$1(this, func(this.late(time_pat))); + } + }, { + key: "every", + value: function every(n, func) { + const pat = this; + const pats = Array(n - 1).fill(pat); + pats.unshift(func(pat)); + return slowcatPrime(...pats); + } + }, { + key: "brak", + value: function brak() { + return this.when(slowcat$1(false, true), x => _fastcat(x, silence$1)._late(0.25)); + } + }, { + key: "rev", + value: function rev() { + const pat = this; + + const query = function (state) { + const span = state.span; + const cycle = span.begin.sam(); + const next_cycle = span.begin.nextSam(); + + const reflect = function (to_reflect) { + const reflected = to_reflect.withTime(time2 => cycle.add(next_cycle.sub(time2))); + const tmp = reflected.begin; + reflected.begin = reflected.end; + reflected.end = tmp; + return reflected; + }; + + const haps = pat.query(state.setSpan(reflect(span))); + return haps.map(hap => hap.withSpan(reflect)); + }; + + return new Pattern$1(query)._splitQueries(); + } + }, { + key: "palindrome", + value: function palindrome() { + return this.every(2, rev); + } + }, { + key: "juxBy", + value: function juxBy(by, func) { + by /= 2; + + const elem_or = function (dict, key, dflt) { + if (key in dict) { + return dict[key]; + } + + return dflt; + }; + + const left = this.withValue(val => Object.assign({}, val, { + pan: elem_or(val, "pan", 0.5) - by + })); + const right = this.withValue(val => Object.assign({}, val, { + pan: elem_or(val, "pan", 0.5) + by + })); + return stack$1(left, func(right)); + } + }, { + key: "_jux", + value: function _jux(func) { + return this.juxBy(1, func); + } + }, { + key: "stack", + value: function stack(...pats) { + return stack$1(this, ...pats); + } + }, { + key: "sequence", + value: function sequence(...pats) { + return sequence$1(this, ...pats); + } + }, { + key: "seq", + value: function seq(...pats) { + return sequence$1(this, ...pats); + } + }, { + key: "cat", + value: function cat(...pats) { + return _cat(this, ...pats); + } + }, { + key: "fastcat", + value: function fastcat(...pats) { + return _fastcat(this, ...pats); + } + }, { + key: "slowcat", + value: function slowcat(...pats) { + return slowcat$1(this, ...pats); + } + }, { + key: "superimpose", + value: function superimpose(...funcs) { + return this.stack(...funcs.map(func => func(this))); + } + }, { + key: "stutWith", + value: function stutWith(times, time2, func) { + return stack$1(...listRange(0, times - 1).map(i => func(this.late(fraction(time2).mul(i)), i))); + } + }, { + key: "stut", + value: function stut(times, feedback, time2) { + return this.stutWith(times, time2, (pat, i) => pat.velocity(Math.pow(feedback, i))); + } + }, { + key: "_echoWith", + value: function _echoWith(times, time2, func) { + return stack$1(...listRange(0, times - 1).map(i => func(this.late(fraction(time2).mul(i)), i))); + } + }, { + key: "_echo", + value: function _echo(times, time2, feedback) { + return this._echoWith(times, time2, (pat, i) => pat.velocity(Math.pow(feedback, i))); + } + }, { + key: "iter", + value: function iter(times, back = false) { + return slowcat$1(...listRange(0, times - 1).map(i => back ? this.late(i / times) : this.early(i / times))); + } + }, { + key: "iterBack", + value: function iterBack(times) { + return this.iter(times, true); + } + }, { + key: "_chunk", + value: function _chunk(n, func, back = false) { + const binary = Array(n - 1).fill(false); + binary.unshift(true); + const binary_pat = sequence$1(...binary).iter(n, back); + return this.when(binary_pat, func); + } + }, { + key: "_chunkBack", + value: function _chunkBack(n, func) { + return this._chunk(n, func, true); + } + }, { + key: "_bypass", + value: function _bypass(on2) { + on2 = Boolean(parseInt(on2)); + return on2 ? silence$1 : this; + } + }, { + key: "hush", + value: function hush() { + return silence$1; + } + }, { + key: "_duration", + value: function _duration(value) { + return this.withHapSpan(span => new TimeSpan(span.begin, span.begin.add(value))); + } + }, { + key: "_legato", + value: function _legato(value) { + return this.withHapSpan(span => new TimeSpan(span.begin, span.begin.add(span.end.sub(span.begin).mul(value)))); + } + }, { + key: "_velocity", + value: function _velocity(velocity) { + return this._withContext(context => ({ ...context, + velocity: (context.velocity || 1) * velocity + })); + } + }, { + key: "_loopAt", + value: function _loopAt(factor, cps = 1) { + return this.speed(1 / factor * cps).unit("c").slow(factor); + } + }, { + key: "onTrigger", + value: function onTrigger(_onTrigger) { + return this._withHap(hap => hap.setContext({ ...hap.context, + onTrigger: _onTrigger + })); + } + }, { + key: "logValues", + value: function logValues(func = id) { + return this.log((_, hap) => func(hap.value)); + } + }]); + + return Pattern$1; +}(); + +function _composeOp(a, b, func) { + function _nonFunctionObject(x) { + return x instanceof Object && !(x instanceof Function); + } + + if (_nonFunctionObject(a) || _nonFunctionObject(b)) { + if (!_nonFunctionObject(a)) { + a = { + value: a + }; + } + + if (!_nonFunctionObject(b)) { + b = { + value: b + }; + } + + return unionWithObj(a, b, func); + } + + return func(a, b); +} + +(function () { + const num = pat => pat._asNumber(); + + const numOrString = pat => pat._asNumber(false, true); + + const composers = { + set: [(a, b) => b], + keep: [(a, b) => a], + keepif: [(a, b) => b ? a : void 0], + add: [(a, b) => a + b, numOrString], + sub: [(a, b) => a - b, num], + mul: [(a, b) => a * b, num], + div: [(a, b) => a / b, num], + mod: [mod, num], + pow: [Math.pow, num], + _and: [(a, b) => a & b, num], + _or: [(a, b) => a | b, num], + _xor: [(a, b) => a ^ b, num], + _lshift: [(a, b) => a << b, num], + _rshift: [(a, b) => a >> b, num], + lt: [(a, b) => a < b], + gt: [(a, b) => a > b], + lte: [(a, b) => a <= b], + gte: [(a, b) => a >= b], + eq: [(a, b) => a == b], + eqt: [(a, b) => a === b], + ne: [(a, b) => a != b], + net: [(a, b) => a !== b], + and: [(a, b) => a && b], + or: [(a, b) => a || b], + func: [(a, b) => b(a)] + }; + + for (const [what, [op, preprocess]] of Object.entries(composers)) { + for (const how of ["In", "Out", "Mix", "Squeeze", "SqueezeOut", "Trig", "Trigzero"]) { + Pattern$1.prototype[what + how] = function (...other) { + var pat = this; + other = sequence$1(other); + + if (preprocess) { + pat = preprocess(pat); + other = preprocess(other); + } + + var result = pat["_op" + how](other, a => b => _composeOp(a, b, op)); + + if (what === "keepif") { + result = result._removeUndefineds(); + } + + return result; + }; + + if (how === "Squeeze") { + Pattern$1.prototype[what + "SqueezeIn"] = Pattern$1.prototype[what + how]; + } + + if (how === "In") { + Pattern$1.prototype[what] = Pattern$1.prototype[what + how]; + } else { + if (what === "set") { + Pattern$1.prototype[how.toLowerCase()] = Pattern$1.prototype[what + how]; + } + } + } + } + + Pattern$1.prototype.struct = Pattern$1.prototype.keepifOut; + Pattern$1.prototype.structAll = Pattern$1.prototype.keepOut; + Pattern$1.prototype.mask = Pattern$1.prototype.keepifIn; + Pattern$1.prototype.maskAll = Pattern$1.prototype.keepIn; + Pattern$1.prototype.reset = Pattern$1.prototype.keepifTrig; + Pattern$1.prototype.resetAll = Pattern$1.prototype.keepTrig; + Pattern$1.prototype.restart = Pattern$1.prototype.keepifTrigzero; + Pattern$1.prototype.restartAll = Pattern$1.prototype.keepTrigzero; +})(); + +Pattern$1.prototype.patternified = ["apply", "chop", "color", "cpm", "duration", "early", "fast", "jux", "late", "legato", "linger", "ply", "segment", "striate", "slow", "velocity"]; +Pattern$1.prototype.factories = { + pure: pure$1, + stack: stack$1, + slowcat: slowcat$1, + fastcat: _fastcat, + cat: _cat, + timeCat: timeCat$1, + sequence: sequence$1, + seq: seq, + polymeter: polymeter, + pm: pm, + polyrhythm: polyrhythm, + pr: pr +}; +var silence$1 = new Pattern$1(_ => []); + +function pure$1(value) { + function query(state) { + return state.span.spanCycles.map(subspan => new Hap(fraction(subspan.begin).wholeCycle(), subspan, value)); + } + + return new Pattern$1(query); +} + +function isPattern(thing) { + const is = thing instanceof Pattern$1 || thing._Pattern; + + if (!thing instanceof Pattern$1) { + console.warn(`Found Pattern that fails "instanceof Pattern" check. This may happen if you are using multiple versions of @strudel.cycles/core. - Please check by running "npm ls @strudel.cycles/core".`);}return is;}function reify$2(thing){if(isPattern(thing)){return thing;}return pure$1(thing);}function stack$1(...pats){pats=pats.map(pat=>Array.isArray(pat)?sequence$1(...pat):reify$2(pat));const query=state=>flatten(pats.map(pat=>pat.query(state)));return new Pattern$2(query);}function slowcat$1(...pats){pats=pats.map(pat=>Array.isArray(pat)?sequence$1(...pat):reify$2(pat));const query=function(state){const span=state.span;const pat_n=mod(span.begin.sam(),pats.length);const pat=pats[pat_n];if(!pat){return[];}const offset=span.begin.floor().sub(span.begin.div(pats.length).floor());return pat.withHapTime(t2=>t2.add(offset)).query(state.setSpan(span.withTime(t2=>t2.sub(offset))));};return new Pattern$2(query)._splitQueries();}function slowcatPrime(...pats){pats=pats.map(reify$2);const query=function(state){const pat_n=Math.floor(state.span.begin)%pats.length;const pat=pats[pat_n];return(pat==null?void 0:pat.query(state))||[];};return new Pattern$2(query)._splitQueries();}function _fastcat(...pats){return slowcat$1(...pats)._fast(pats.length);}function _cat(...pats){return slowcat$1(...pats);}function timeCat$1(...timepats){const total=timepats.map(a=>a[0]).reduce((a,b)=>a.add(b),fraction(0));let begin=fraction(0);const pats=[];for(const[time2,pat]of timepats){const end=begin.add(time2);pats.push(reify$2(pat)._compress(begin.div(total),end.div(total)));begin=end;}return stack$1(...pats);}function sequence$1(...pats){return _fastcat(...pats);}function seq$2(...pats){return _fastcat(...pats);}function _sequenceCount(x){if(Array.isArray(x)){if(x.length==0){return[silence$1,0];}if(x.length==1){return _sequenceCount(x[0]);}return[_fastcat(...x.map(a=>_sequenceCount(a)[0])),x.length];}return[reify$2(x),1];}function polymeterSteps(steps,...args){const seqs=args.map(a=>_sequenceCount(a));if(seqs.length==0){return silence$1;}if(steps==0){steps=seqs[0][1];}const pats=[];for(const seq2 of seqs){if(seq2[1]==0){next;}if(steps==seq2[1]){pats.push(seq2[0]);}else{pats.push(seq2[0]._fast(fraction(steps).div(fraction(seq2[1]))));}}return stack$1(...pats);}function polymeter(...args){return polymeterSteps(0,...args);}function pm(...args){polymeter(...args);}function polyrhythm(...xs){const seqs=xs.map(a=>sequence$1(a));if(seqs.length==0){return silence$1;}return stack$1(...seqs);}function pr(args){polyrhythm(args);}var add=curry((a,pat)=>pat.add(a));var chop=curry((a,pat)=>pat.chop(a));var chunk=curry((a,pat)=>pat.chunk(a));var chunkBack=curry((a,pat)=>pat.chunkBack(a));var div=curry((a,pat)=>pat.div(a));var early=curry((a,pat)=>pat.early(a));var echo=curry((a,b,c,pat)=>pat.echo(a,b,c));var every=curry((i2,f,pat)=>pat.every(i2,f));var fast=curry((a,pat)=>pat.fast(a));var inv=pat=>pat.inv();var invert=pat=>pat.invert();var iter=curry((a,pat)=>pat.iter(a));var iterBack=curry((a,pat)=>pat.iter(a));var jux=curry((f,pat)=>pat.jux(f));var juxBy=curry((by,f,pat)=>pat.juxBy(by,f));var late=curry((a,pat)=>pat.late(a));var linger=curry((a,pat)=>pat.linger(a));var mask=curry((a,pat)=>pat.mask(a));var mul=curry((a,pat)=>pat.mul(a));var off=curry((t2,f,pat)=>pat.off(t2,f));var ply=curry((a,pat)=>pat.ply(a));var range=curry((a,b,pat)=>pat.range(a,b));var range2=curry((a,b,pat)=>pat.range2(a,b));var rev=pat=>pat.rev();var slow=curry((a,pat)=>pat.slow(a));var struct=curry((a,pat)=>pat.struct(a));var sub=curry((a,pat)=>pat.sub(a));var superimpose=curry((array,pat)=>pat.superimpose(...array));var set=curry((a,pat)=>pat.set(a));var when=curry((binary,f,pat)=>pat.when(binary,f));Pattern$2.prototype.composable={fast:fast,slow:slow,early:early,late:late,superimpose:superimpose};function makeComposable(func){Object.entries(Pattern$2.prototype.composable).forEach(([functionName,composable])=>{func[functionName]=(...args)=>{const composition=compose(func,composable(...args));return makeComposable(composition);};});return func;}var patternify2=f=>(pata,patb,pat)=>pata.fmap(a=>b=>f.call(pat,a,b)).appLeft(patb).innerJoin();var patternify3=f=>(pata,patb,patc,pat)=>pata.fmap(a=>b=>c=>f.call(pat,a,b,c)).appLeft(patb).appLeft(patc).innerJoin();var patternify4=f=>(pata,patb,patc,patd,pat)=>pata.fmap(a=>b=>c=>d=>f.call(pat,a,b,c,d)).appLeft(patb).appLeft(patc).appLeft(patd).innerJoin();Pattern$2.prototype.echo=function(...args){args=args.map(reify$2);return patternify3(Pattern$2.prototype._echo)(...args,this);};Pattern$2.prototype.echoWith=function(...args){args=args.map(reify$2);return patternify3(Pattern$2.prototype._echoWith)(...args,this);};Pattern$2.prototype.chunk=function(...args){args=args.map(reify$2);return patternify2(Pattern$2.prototype._chunk)(...args,this);};Pattern$2.prototype.chunkBack=function(...args){args=args.map(reify$2);return patternify2(Pattern$2.prototype._chunkBack)(...args,this);};Pattern$2.prototype.loopAt=function(...args){args=args.map(reify$2);return patternify2(Pattern$2.prototype._loopAt)(...args,this);};Pattern$2.prototype.zoom=function(...args){args=args.map(reify$2);return patternify2(Pattern$2.prototype._zoom)(...args,this);};Pattern$2.prototype.compress=function(...args){args=args.map(reify$2);return patternify2(Pattern$2.prototype._compress)(...args,this);};Pattern$2.prototype.outside=function(...args){args=args.map(reify$2);return patternify2(Pattern$2.prototype._outside)(...args,this);};Pattern$2.prototype.inside=function(...args){args=args.map(reify$2);return patternify2(Pattern$2.prototype._inside)(...args,this);};Pattern$2.prototype.bootstrap=function(){const bootstrapped=Object.fromEntries(Object.entries(Pattern$2.prototype.composable).map(([functionName,composable])=>{if(Pattern$2.prototype[functionName]){Pattern$2.prototype[functionName]=makeComposable(Pattern$2.prototype[functionName]);}return[functionName,curry(composable,makeComposable)];}));this.patternified.forEach(prop=>{Pattern$2.prototype[prop]=function(...args){return this._patternify(Pattern$2.prototype["_"+prop])(...args);};});return bootstrapped;};Pattern$2.prototype.define=(name,func,options={})=>{if(options.composable){Pattern$2.prototype.composable[name]=func;}if(options.patternified){Pattern$2.prototype.patternified=Pattern$2.prototype.patternified.concat([name]);}Pattern$2.prototype.bootstrap();};Pattern$2.prototype.define("hush",pat=>pat.hush(),{patternified:false,composable:true});Pattern$2.prototype.define("bypass",pat=>pat.bypass(on),{patternified:true,composable:true});var controls={};var generic_params=[["s","s","sound"],["f","n","The note or sample number to choose for a synth or sampleset"],["f","note","The note or pitch to play a sound or synth with"],["f","accelerate","a pattern of numbers that speed up (or slow down) samples while they play."],["f","gain","a pattern of numbers that specify volume. Values less than 1 make the sound quieter. Values greater than 1 make the sound louder. For the linear equivalent, see @amp@."],["f","amp","like @gain@, but linear."],["f","attack","a pattern of numbers to specify the attack time (in seconds) of an envelope applied to each sample."],["f","decay",""],["f","sustain",""],["f","release","a pattern of numbers to specify the release time (in seconds) of an envelope applied to each sample."],["f","hold","a pattern of numbers to specify the hold time (in seconds) of an envelope applied to each sample. Only takes effect if `attack` and `release` are also specified."],["f","bandf","A pattern of numbers from 0 to 1. Sets the center frequency of the band-pass filter."],["f","bandq","a pattern of anumbers from 0 to 1. Sets the q-factor of the band-pass filter."],["f","begin","a pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. `0.25` to cut off the first quarter from each sample."],["f","end","the same as `begin`, but cuts the end off samples, shortening them; e.g. `0.75` to cut off the last quarter of each sample."],["f","loop","loops the sample (from `begin` to `end`) the specified number of times."],["f","legato","controls the amount of overlap between two adjacent sounds"],["f","crush","bit crushing, a pattern of numbers from 1 (for drastic reduction in bit-depth) to 16 (for barely no reduction)."],["f","coarse","fake-resampling, a pattern of numbers for lowering the sample rate, i.e. 1 for original 2 for half, 3 for a third and so on."],["i","channel","choose the channel the pattern is sent to in superdirt"],["i","cut","In the style of classic drum-machines, `cut` will stop a playing sample as soon as another samples with in same cutgroup is to be played. An example would be an open hi-hat followed by a closed one, essentially muting the open."],["f","cutoff","a pattern of numbers from 0 to 1. Applies the cutoff frequency of the low-pass filter."],["f","hcutoff","a pattern of numbers from 0 to 1. Applies the cutoff frequency of the high-pass filter. Also has alias @hpf@"],["f","hresonance","a pattern of numbers from 0 to 1. Applies the resonance of the high-pass filter. Has alias @hpq@"],["f","resonance","a pattern of numbers from 0 to 1. Specifies the resonance of the low-pass filter."],["f","djf","DJ filter, below 0.5 is low pass filter, above is high pass filter."],["f","delay","a pattern of numbers from 0 to 1. Sets the level of the delay signal."],["f","delayfeedback","a pattern of numbers from 0 to 1. Sets the amount of delay feedback."],["f","delaytime","a pattern of numbers from 0 to 1. Sets the length of the delay."],["f","lock","A pattern of numbers. Specifies whether delaytime is calculated relative to cps. When set to 1, delaytime is a direct multiple of a cycle."],["f","detune",""],["f","dry","when set to `1` will disable all reverb for this pattern. See `room` and `size` for more information about reverb."],["f","fadeTime","Used when using begin/end or chop/striate and friends, to change the fade out time of the 'grain' envelope."],["f","fadeInTime","As with fadeTime, but controls the fade in time of the grain envelope. Not used if the grain begins at position 0 in the sample."],["f","freq",""],["f","gate",""],["f","leslie",""],["f","lrate",""],["f","lsize",""],["f","degree",""],["f","mtranspose",""],["f","ctranspose",""],["f","harmonic",""],["f","stepsPerOctave",""],["f","octaveR",""],["f","nudge","Nudges events into the future by the specified number of seconds. Negative numbers work up to a point as well (due to internal latency)"],["i","octave",""],["f","offset",""],["i","orbit","a pattern of numbers. An `orbit` is a global parameter context for patterns. Patterns with the same orbit will share hardware output bus offset and global effects, e.g. reverb and delay. The maximum number of orbits is specified in the superdirt startup, numbers higher than maximum will wrap around."],["f","overgain",""],["f","overshape",""],["f","pan","a pattern of numbers between 0 and 1, from left to right (assuming stereo), once round a circle (assuming multichannel)"],["f","panspan","a pattern of numbers between -inf and inf, which controls how much multichannel output is fanned out (negative is backwards ordering)"],["f","pansplay","a pattern of numbers between 0.0 and 1.0, which controls the multichannel spread range (multichannel only)"],["f","panwidth","a pattern of numbers between 0.0 and inf, which controls how much each channel is distributed over neighbours (multichannel only)"],["f","panorient","a pattern of numbers between -1.0 and 1.0, which controls the relative position of the centre pan in a pair of adjacent speakers (multichannel only)"],["f","rate","used in SuperDirt softsynths as a control rate or 'speed'"],["f","slide",""],["f","semitone",""],["f","velocity",""],["f","voice",""],["f","room","a pattern of numbers from 0 to 1. Sets the level of reverb."],["f","size","a pattern of numbers from 0 to 1. Sets the perceptual size (reverb time) of the `room` to be used in reverb."],["f","shape","wave shaping distortion, a pattern of numbers from 0 for no distortion up to 1 for loads of distortion."],["f","speed","a pattern of numbers which changes the speed of sample playback, i.e. a cheap way of changing pitch. Negative values will play the sample backwards!"],["s","unit",'used in conjunction with `speed`, accepts values of "r" (rate, default behavior), "c" (cycles), or "s" (seconds). Using `unit "c"` means `speed` will be interpreted in units of cycles, e.g. `speed "1"` means samples will be stretched to fill a cycle. Using `unit "s"` means the playback speed will be adjusted so that the duration is the number of seconds specified by `speed`.'],["f","squiz",""],["f","stutterdepth",""],["f","stuttertime",""],["f","timescale",""],["f","timescalewin",""],["s","vowel","formant filter to make things sound like vowels, a pattern of either `a`, `e`, `i`, `o` or `u`. Use a rest (`~`) for no effect."],["f","waveloss",""],["f","dur",""],["f","expression",""],["f","sustainpedal",""],["f","tremolodepth","Tremolo Audio DSP effect | params are 'tremolorate' and 'tremolodepth'"],["f","tremolorate","Tremolo Audio DSP effect | params are 'tremolorate' and 'tremolodepth'"],["f","phaserdepth","Phaser Audio DSP effect | params are 'phaserrate' and 'phaserdepth'"],["f","phaserrate","Phaser Audio DSP effect | params are 'phaserrate' and 'phaserdepth'"],["f","fshift","frequency shifter"],["f","fshiftnote","frequency shifter"],["f","fshiftphase","frequency shifter"],["f","triode","tube distortion"],["f","krush","shape/bass enhancer"],["f","kcutoff",""],["f","octer","octaver effect"],["f","octersub","octaver effect"],["f","octersubsub","octaver effect"],["f","ring","ring modulation"],["f","ringf","ring modulation"],["f","ringdf","ring modulation"],["f","distort","noisy fuzzy distortion"],["f","freeze","Spectral freeze"],["f","xsdelay",""],["f","tsdelay",""],["f","real","Spectral conform"],["f","imag",""],["f","enhance","Spectral enhance"],["f","partials",""],["f","comb","Spectral comb"],["f","smear","Spectral smear"],["f","scram","Spectral scramble"],["f","binshift","Spectral binshift"],["f","hbrick","High pass sort of spectral filter"],["f","lbrick","Low pass sort of spectral filter"],["f","midichan",""],["f","control",""],["f","ccn",""],["f","ccv",""],["f","polyTouch",""],["f","midibend",""],["f","miditouch",""],["f","ctlNum",""],["f","frameRate",""],["f","frames",""],["f","hours",""],["s","midicmd",""],["f","minutes",""],["f","progNum",""],["f","seconds",""],["f","songPtr",""],["f","uid",""],["f","val",""],["f","cps",""],["f","clip",""]];var _name=(name,...pats)=>sequence$1(...pats).withValue(x=>({[name]:x}));var _setter=(func,name)=>function(...pats){if(!pats.length){return this.fmap(value=>({[name]:value}));}return this.set(func(...pats));};generic_params.forEach(([type,name,description])=>{controls[name]=(...pats)=>_name(name,...pats);Pattern$2.prototype[name]=_setter(controls[name],name);});controls.createParam=name=>{const func=(...pats)=>_name(name,...pats);Pattern$2.prototype[name]=_setter(func,name);return(...pats)=>_name(name,...pats);};controls.createParams=(...names)=>names.reduce((acc,name)=>Object.assign(acc,{[name]:createParam(name)}),{});function bjorklund(slots,pulses){var pattern=[],count=[],remainder=[pulses],divisor=slots-pulses,level=0,build_pattern=function(lv){if(lv==-1){pattern.push(0);}else if(lv==-2){pattern.push(1);}else{for(var x=0;x1){count.push(Math.floor(divisor/remainder[level]));remainder.push(divisor%remainder[level]);divisor=remainder[level];level++;}count.push(divisor);build_pattern(level);return pattern.reverse();}var bjork=function(m,k){if(m>k)return bjorklund(m,k);else return bjorklund(k,m);};var euclid=(pulses,steps,rotation=0)=>{const b=bjork(steps,pulses);if(rotation){return rotate(b,-rotation);}return b;};Pattern$2.prototype.euclid=function(pulses,steps,rotation=0){return this.struct(euclid(pulses,steps,rotation));};Pattern$2.prototype.euclidLegato=function(pulses,steps,rotation=0){const bin_pat=euclid(pulses,steps,rotation);const firstOne=bin_pat.indexOf(1);const gapless=rotate(bin_pat,firstOne).join("").split("1").slice(1).map(s=>[s.length+1,true]);return this.struct(timeCat$1(...gapless)).late(fraction(firstOne).div(steps));};function steady(value){return new Pattern$2(state=>[new Hap(void 0,state.span,value)]);}var signal=func=>{const query=state=>[new Hap(void 0,state.span,func(state.span.midpoint()))];return new Pattern$2(query);};var isaw=signal(t2=>1-t2%1);var isaw2=isaw._toBipolar();var saw=signal(t2=>t2%1);var saw2=saw._toBipolar();var sine2=signal(t2=>Math.sin(Math.PI*2*t2));var sine=sine2._fromBipolar();var cosine=sine._early(fraction(1).div(4));var cosine2=sine2._early(fraction(1).div(4));var square=signal(t2=>Math.floor(t2*2%2));var square2=square._toBipolar();var tri=_fastcat(isaw,saw);var tri2=_fastcat(isaw2,saw2);var time=signal(id);var xorwise=x=>{const a=x<<13^x;const b=a>>17^a;return b<<5^b;};var _frac=x=>x-Math.trunc(x);var timeToIntSeed=x=>xorwise(Math.trunc(_frac(x/300)*536870912));var intSeedToRand=x=>x%536870912/536870912;var timeToRand=x=>Math.abs(intSeedToRand(timeToIntSeed(x)));var rand=signal(timeToRand);var rand2=rand._toBipolar();var _brandBy=p2=>rand.fmap(x=>xreify$2(pPat).fmap(_brandBy).innerJoin();var brand=_brandBy(0.5);var _irand=i2=>rand.fmap(x=>Math.trunc(x*i2));var irand=ipat=>reify$2(ipat).fmap(_irand).innerJoin();var __chooseWith=(pat,xs)=>{xs=xs.map(reify$2);if(xs.length==0){return silence$1;}return pat.range(0,xs.length).fmap(i2=>xs[Math.floor(i2)]);};var chooseWith=(pat,xs)=>{return __chooseWith(pat,xs).outerJoin();};var chooseInWith=(pat,xs)=>{return __chooseWith(pat,xs).innerJoin();};var choose=(...xs)=>chooseWith(rand,xs);Pattern$2.prototype.choose=function(...xs){return chooseWith(this,xs);};Pattern$2.prototype.choose2=function(...xs){return chooseWith(this._fromBipolar(),xs);};var chooseCycles=(...xs)=>chooseInWith(rand.segment(1),xs);var randcat=chooseCycles;var _wchooseWith=function(pat,...pairs){const values=pairs.map(pair=>reify$2(pair[0]));const weights=[];let accum=0;for(const pair of pairs){accum+=pair[1];weights.push(accum);}const total=accum;const match=function(r){const find=r*total;return values[weights.findIndex(x=>x>find,weights)];};return pat.fmap(match);};var wchooseWith=(...args)=>_wchooseWith(...args).outerJoin();var wchoose=(...pairs)=>wchooseWith(rand,...pairs);var wchooseCycles=(...pairs)=>_wchooseWith(rand,...pairs).innerJoin();var perlinWith=pat=>{const pata=pat.fmap(Math.floor);const patb=pat.fmap(t2=>Math.floor(t2)+1);const smootherStep=x=>6*x**5-15*x**4+10*x**3;const interp=x=>a=>b=>a+smootherStep(x)*(b-a);return pat.sub(pata).fmap(interp).appBoth(pata.fmap(timeToRand)).appBoth(patb.fmap(timeToRand));};var perlin=perlinWith(time);Pattern$2.prototype._degradeByWith=function(withPat,x){return this.fmap(a=>_=>a).appLeft(withPat._filterValues(v=>v>x));};Pattern$2.prototype._degradeBy=function(x){return this._degradeByWith(rand,x);};Pattern$2.prototype.degrade=function(){return this._degradeBy(0.5);};Pattern$2.prototype._undegradeBy=function(x){return this._degradeByWith(rand.fmap(r=>1-r),x);};Pattern$2.prototype.undegrade=function(){return this._undegradeBy(0.5);};Pattern$2.prototype._sometimesBy=function(x,func){return stack$1(this._degradeBy(x),func(this._undegradeBy(1-x)));};Pattern$2.prototype.sometimesBy=function(patx,func){const pat=this;return reify$2(patx).fmap(x=>pat._sometimesBy(x,func)).innerJoin();};Pattern$2.prototype._sometimesByPre=function(x,func){return stack$1(this._degradeBy(x),func(this).undegradeBy(1-x));};Pattern$2.prototype.sometimesByPre=function(patx,func){const pat=this;return reify$2(patx).fmap(x=>pat._sometimesByPre(x,func)).innerJoin();};Pattern$2.prototype.sometimes=function(func){return this._sometimesBy(0.5,func);};Pattern$2.prototype.sometimesPre=function(func){return this._sometimesByPre(0.5,func);};Pattern$2.prototype._someCyclesBy=function(x,func){return stack$1(this._degradeByWith(rand._segment(1),x),func(this._degradeByWith(rand.fmap(r=>1-r)._segment(1),1-x)));};Pattern$2.prototype.someCyclesBy=function(patx,func){const pat=this;return reify$2(patx).fmap(x=>pat._someCyclesBy(x,func)).innerJoin();};Pattern$2.prototype.someCycles=function(func){return this._someCyclesBy(0.5,func);};Pattern$2.prototype.often=function(func){return this.sometimesBy(0.75,func);};Pattern$2.prototype.rarely=function(func){return this.sometimesBy(0.25,func);};Pattern$2.prototype.almostNever=function(func){return this.sometimesBy(0.1,func);};Pattern$2.prototype.almostAlways=function(func){return this.sometimesBy(0.9,func);};Pattern$2.prototype.never=function(func){return this;};Pattern$2.prototype.always=function(func){return func(this);};Pattern$2.prototype.patternified.push("degradeBy","undegradeBy");var synth;try{synth=window==null?void 0:window.speechSynthesis;}catch(err){console.warn("cannot use window: not in browser?");}var allVoices=synth==null?void 0:synth.getVoices();function speak(words,lang,voice){synth.cancel();const utterance=new SpeechSynthesisUtterance(words);utterance.lang=lang;allVoices=synth.getVoices();const voices=allVoices.filter(v=>v.lang.includes(lang));if(typeof voice==="number"){utterance.voice=voices[voice%voices.length];}else if(typeof voice==="string"){utterance.voice=voices.find(voice2=>voice2.name===voice2);}speechSynthesis.speak(utterance);}Pattern$2.prototype._speak=function(lang,voice){return this._withHap(hap=>{const onTrigger=(time2,hap2)=>{speak(hap2.value,lang,voice);};return hap.setContext({...hap.context,onTrigger});});};Pattern$2.prototype.speak=function(lang,voice){return patternify2(Pattern$2.prototype._speak)(reify(lang),reify(voice),this);};var gist=(route,cache=true)=>fetch(`https://gist.githubusercontent.com/${route}?cachebust=${cache?"":Date.now()}`).then(res=>res.text()).then(code=>eval(code));console.log("%c // \uD83C\uDF00 @strudel.cycles/core loaded \uD83C\uDF00","background-color: black;color:white;padding:4px;border-radius:15px");if(globalThis._strudelLoaded){console.warn(`@strudel.cycles/core was loaded more than once... + Please check by running "npm ls @strudel.cycles/core".`); + } + + return is; +} + +function reify$2(thing) { + if (isPattern(thing)) { + return thing; + } + + return pure$1(thing); +} + +function stack$1(...pats) { + pats = pats.map(pat => Array.isArray(pat) ? sequence$1(...pat) : reify$2(pat)); + + const query = state => flatten(pats.map(pat => pat.query(state))); + + return new Pattern$1(query); +} + +function slowcat$1(...pats) { + pats = pats.map(pat => Array.isArray(pat) ? sequence$1(...pat) : reify$2(pat)); + + const query = function (state) { + const span = state.span; + const pat_n = mod(span.begin.sam(), pats.length); + const pat = pats[pat_n]; + + if (!pat) { + return []; + } + + const offset = span.begin.floor().sub(span.begin.div(pats.length).floor()); + return pat.withHapTime(t => t.add(offset)).query(state.setSpan(span.withTime(t => t.sub(offset)))); + }; + + return new Pattern$1(query)._splitQueries(); +} + +function slowcatPrime(...pats) { + pats = pats.map(reify$2); + + const query = function (state) { + const pat_n = Math.floor(state.span.begin) % pats.length; + const pat = pats[pat_n]; + return (pat == null ? void 0 : pat.query(state)) || []; + }; + + return new Pattern$1(query)._splitQueries(); +} + +function _fastcat(...pats) { + return slowcat$1(...pats)._fast(pats.length); +} + +function _cat(...pats) { + return slowcat$1(...pats); +} + +function timeCat$1(...timepats) { + const total = timepats.map(a => a[0]).reduce((a, b) => a.add(b), fraction(0)); + let begin = fraction(0); + const pats = []; + + for (const [time2, pat] of timepats) { + const end = begin.add(time2); + pats.push(reify$2(pat)._compress(begin.div(total), end.div(total))); + begin = end; + } + + return stack$1(...pats); +} + +function sequence$1(...pats) { + return _fastcat(...pats); +} + +function seq(...pats) { + return _fastcat(...pats); +} + +function _sequenceCount(x) { + if (Array.isArray(x)) { + if (x.length == 0) { + return [silence$1, 0]; + } + + if (x.length == 1) { + return _sequenceCount(x[0]); + } + + return [_fastcat(...x.map(a => _sequenceCount(a)[0])), x.length]; + } + + return [reify$2(x), 1]; +} + +function polymeterSteps(steps, ...args) { + const seqs = args.map(a => _sequenceCount(a)); + + if (seqs.length == 0) { + return silence$1; + } + + if (steps == 0) { + steps = seqs[0][1]; + } + + const pats = []; + + for (const seq2 of seqs) { + if (seq2[1] == 0) { + next; + } + + if (steps == seq2[1]) { + pats.push(seq2[0]); + } else { + pats.push(seq2[0]._fast(fraction(steps).div(fraction(seq2[1])))); + } + } + + return stack$1(...pats); +} + +function polymeter(...args) { + return polymeterSteps(0, ...args); +} + +function pm(...args) { + polymeter(...args); +} + +function polyrhythm(...xs) { + const seqs = xs.map(a => sequence$1(a)); + + if (seqs.length == 0) { + return silence$1; + } + + return stack$1(...seqs); +} + +function pr(args) { + polyrhythm(args); +} + +var add = curry((a, pat) => pat.add(a)); +var chop = curry((a, pat) => pat.chop(a)); +var chunk = curry((a, pat) => pat.chunk(a)); +var chunkBack = curry((a, pat) => pat.chunkBack(a)); +var div = curry((a, pat) => pat.div(a)); +var early = curry((a, pat) => pat.early(a)); +var echo = curry((a, b, c, pat) => pat.echo(a, b, c)); +var every = curry((i, f, pat) => pat.every(i, f)); +var fast = curry((a, pat) => pat.fast(a)); + +var inv = pat => pat.inv(); + +var invert = pat => pat.invert(); + +var iter = curry((a, pat) => pat.iter(a)); +var iterBack = curry((a, pat) => pat.iter(a)); +var jux = curry((f, pat) => pat.jux(f)); +var juxBy = curry((by, f, pat) => pat.juxBy(by, f)); +var late = curry((a, pat) => pat.late(a)); +var linger = curry((a, pat) => pat.linger(a)); +var mask = curry((a, pat) => pat.mask(a)); +var mul = curry((a, pat) => pat.mul(a)); +var off = curry((t, f, pat) => pat.off(t, f)); +var ply = curry((a, pat) => pat.ply(a)); +var range = curry((a, b, pat) => pat.range(a, b)); +var range2 = curry((a, b, pat) => pat.range2(a, b)); + +var rev = pat => pat.rev(); + +var slow = curry((a, pat) => pat.slow(a)); +var struct = curry((a, pat) => pat.struct(a)); +var sub = curry((a, pat) => pat.sub(a)); +var superimpose = curry((array, pat) => pat.superimpose(...array)); +var set = curry((a, pat) => pat.set(a)); +var when = curry((binary, f, pat) => pat.when(binary, f)); +Pattern$1.prototype.composable = { + fast: fast, + slow: slow, + early: early, + late: late, + superimpose: superimpose +}; + +function makeComposable(func) { + Object.entries(Pattern$1.prototype.composable).forEach(([functionName, composable]) => { + func[functionName] = (...args) => { + const composition = compose(func, composable(...args)); + return makeComposable(composition); + }; + }); + return func; +} + +var patternify2 = f => (pata, patb, pat) => pata.fmap(a => b => f.call(pat, a, b)).appLeft(patb).innerJoin(); + +var patternify3 = f => (pata, patb, patc, pat) => pata.fmap(a => b => c => f.call(pat, a, b, c)).appLeft(patb).appLeft(patc).innerJoin(); + +var patternify4 = f => (pata, patb, patc, patd, pat) => pata.fmap(a => b => c => d => f.call(pat, a, b, c, d)).appLeft(patb).appLeft(patc).appLeft(patd).innerJoin(); + +Pattern$1.prototype.echo = function (...args) { + args = args.map(reify$2); + return patternify3(Pattern$1.prototype._echo)(...args, this); +}; + +Pattern$1.prototype.echoWith = function (...args) { + args = args.map(reify$2); + return patternify3(Pattern$1.prototype._echoWith)(...args, this); +}; + +Pattern$1.prototype.chunk = function (...args) { + args = args.map(reify$2); + return patternify2(Pattern$1.prototype._chunk)(...args, this); +}; + +Pattern$1.prototype.chunkBack = function (...args) { + args = args.map(reify$2); + return patternify2(Pattern$1.prototype._chunkBack)(...args, this); +}; + +Pattern$1.prototype.loopAt = function (...args) { + args = args.map(reify$2); + return patternify2(Pattern$1.prototype._loopAt)(...args, this); +}; + +Pattern$1.prototype.zoom = function (...args) { + args = args.map(reify$2); + return patternify2(Pattern$1.prototype._zoom)(...args, this); +}; + +Pattern$1.prototype.compress = function (...args) { + args = args.map(reify$2); + return patternify2(Pattern$1.prototype._compress)(...args, this); +}; + +Pattern$1.prototype.outside = function (...args) { + args = args.map(reify$2); + return patternify2(Pattern$1.prototype._outside)(...args, this); +}; + +Pattern$1.prototype.inside = function (...args) { + args = args.map(reify$2); + return patternify2(Pattern$1.prototype._inside)(...args, this); +}; + +Pattern$1.prototype.bootstrap = function () { + const bootstrapped = Object.fromEntries(Object.entries(Pattern$1.prototype.composable).map(([functionName, composable]) => { + if (Pattern$1.prototype[functionName]) { + Pattern$1.prototype[functionName] = makeComposable(Pattern$1.prototype[functionName]); + } + + return [functionName, curry(composable, makeComposable)]; + })); + this.patternified.forEach(prop => { + Pattern$1.prototype[prop] = function (...args) { + return this._patternify(Pattern$1.prototype["_" + prop])(...args); + }; + }); + return bootstrapped; +}; + +Pattern$1.prototype.define = (name, func, options = {}) => { + if (options.composable) { + Pattern$1.prototype.composable[name] = func; + } + + if (options.patternified) { + Pattern$1.prototype.patternified = Pattern$1.prototype.patternified.concat([name]); + } + + Pattern$1.prototype.bootstrap(); +}; + +Pattern$1.prototype.define("hush", pat => pat.hush(), { + patternified: false, + composable: true +}); +Pattern$1.prototype.define("bypass", pat => pat.bypass(on), { + patternified: true, + composable: true +}); +var controls = {}; +var generic_params = [["s", "s", "sound"], ["f", "n", "The note or sample number to choose for a synth or sampleset"], ["f", "note", "The note or pitch to play a sound or synth with"], ["f", "accelerate", "a pattern of numbers that speed up (or slow down) samples while they play."], ["f", "gain", "a pattern of numbers that specify volume. Values less than 1 make the sound quieter. Values greater than 1 make the sound louder. For the linear equivalent, see @amp@."], ["f", "amp", "like @gain@, but linear."], ["f", "attack", "a pattern of numbers to specify the attack time (in seconds) of an envelope applied to each sample."], ["f", "decay", ""], ["f", "sustain", ""], ["f", "release", "a pattern of numbers to specify the release time (in seconds) of an envelope applied to each sample."], ["f", "hold", "a pattern of numbers to specify the hold time (in seconds) of an envelope applied to each sample. Only takes effect if `attack` and `release` are also specified."], ["f", "bandf", "A pattern of numbers from 0 to 1. Sets the center frequency of the band-pass filter."], ["f", "bandq", "a pattern of anumbers from 0 to 1. Sets the q-factor of the band-pass filter."], ["f", "begin", "a pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. `0.25` to cut off the first quarter from each sample."], ["f", "end", "the same as `begin`, but cuts the end off samples, shortening them; e.g. `0.75` to cut off the last quarter of each sample."], ["f", "loop", "loops the sample (from `begin` to `end`) the specified number of times."], ["f", "legato", "controls the amount of overlap between two adjacent sounds"], ["f", "crush", "bit crushing, a pattern of numbers from 1 (for drastic reduction in bit-depth) to 16 (for barely no reduction)."], ["f", "coarse", "fake-resampling, a pattern of numbers for lowering the sample rate, i.e. 1 for original 2 for half, 3 for a third and so on."], ["i", "channel", "choose the channel the pattern is sent to in superdirt"], ["i", "cut", "In the style of classic drum-machines, `cut` will stop a playing sample as soon as another samples with in same cutgroup is to be played. An example would be an open hi-hat followed by a closed one, essentially muting the open."], ["f", "cutoff", "a pattern of numbers from 0 to 1. Applies the cutoff frequency of the low-pass filter."], ["f", "hcutoff", "a pattern of numbers from 0 to 1. Applies the cutoff frequency of the high-pass filter. Also has alias @hpf@"], ["f", "hresonance", "a pattern of numbers from 0 to 1. Applies the resonance of the high-pass filter. Has alias @hpq@"], ["f", "resonance", "a pattern of numbers from 0 to 1. Specifies the resonance of the low-pass filter."], ["f", "djf", "DJ filter, below 0.5 is low pass filter, above is high pass filter."], ["f", "delay", "a pattern of numbers from 0 to 1. Sets the level of the delay signal."], ["f", "delayfeedback", "a pattern of numbers from 0 to 1. Sets the amount of delay feedback."], ["f", "delaytime", "a pattern of numbers from 0 to 1. Sets the length of the delay."], ["f", "lock", "A pattern of numbers. Specifies whether delaytime is calculated relative to cps. When set to 1, delaytime is a direct multiple of a cycle."], ["f", "detune", ""], ["f", "dry", "when set to `1` will disable all reverb for this pattern. See `room` and `size` for more information about reverb."], ["f", "fadeTime", "Used when using begin/end or chop/striate and friends, to change the fade out time of the 'grain' envelope."], ["f", "fadeInTime", "As with fadeTime, but controls the fade in time of the grain envelope. Not used if the grain begins at position 0 in the sample."], ["f", "freq", ""], ["f", "gate", ""], ["f", "leslie", ""], ["f", "lrate", ""], ["f", "lsize", ""], ["f", "degree", ""], ["f", "mtranspose", ""], ["f", "ctranspose", ""], ["f", "harmonic", ""], ["f", "stepsPerOctave", ""], ["f", "octaveR", ""], ["f", "nudge", "Nudges events into the future by the specified number of seconds. Negative numbers work up to a point as well (due to internal latency)"], ["i", "octave", ""], ["f", "offset", ""], ["i", "orbit", "a pattern of numbers. An `orbit` is a global parameter context for patterns. Patterns with the same orbit will share hardware output bus offset and global effects, e.g. reverb and delay. The maximum number of orbits is specified in the superdirt startup, numbers higher than maximum will wrap around."], ["f", "overgain", ""], ["f", "overshape", ""], ["f", "pan", "a pattern of numbers between 0 and 1, from left to right (assuming stereo), once round a circle (assuming multichannel)"], ["f", "panspan", "a pattern of numbers between -inf and inf, which controls how much multichannel output is fanned out (negative is backwards ordering)"], ["f", "pansplay", "a pattern of numbers between 0.0 and 1.0, which controls the multichannel spread range (multichannel only)"], ["f", "panwidth", "a pattern of numbers between 0.0 and inf, which controls how much each channel is distributed over neighbours (multichannel only)"], ["f", "panorient", "a pattern of numbers between -1.0 and 1.0, which controls the relative position of the centre pan in a pair of adjacent speakers (multichannel only)"], ["f", "rate", "used in SuperDirt softsynths as a control rate or 'speed'"], ["f", "slide", ""], ["f", "semitone", ""], ["f", "velocity", ""], ["f", "voice", ""], ["f", "room", "a pattern of numbers from 0 to 1. Sets the level of reverb."], ["f", "size", "a pattern of numbers from 0 to 1. Sets the perceptual size (reverb time) of the `room` to be used in reverb."], ["f", "shape", "wave shaping distortion, a pattern of numbers from 0 for no distortion up to 1 for loads of distortion."], ["f", "speed", "a pattern of numbers which changes the speed of sample playback, i.e. a cheap way of changing pitch. Negative values will play the sample backwards!"], ["s", "unit", 'used in conjunction with `speed`, accepts values of "r" (rate, default behavior), "c" (cycles), or "s" (seconds). Using `unit "c"` means `speed` will be interpreted in units of cycles, e.g. `speed "1"` means samples will be stretched to fill a cycle. Using `unit "s"` means the playback speed will be adjusted so that the duration is the number of seconds specified by `speed`.'], ["f", "squiz", ""], ["f", "stutterdepth", ""], ["f", "stuttertime", ""], ["f", "timescale", ""], ["f", "timescalewin", ""], ["s", "vowel", "formant filter to make things sound like vowels, a pattern of either `a`, `e`, `i`, `o` or `u`. Use a rest (`~`) for no effect."], ["f", "waveloss", ""], ["f", "dur", ""], ["f", "expression", ""], ["f", "sustainpedal", ""], ["f", "tremolodepth", "Tremolo Audio DSP effect | params are 'tremolorate' and 'tremolodepth'"], ["f", "tremolorate", "Tremolo Audio DSP effect | params are 'tremolorate' and 'tremolodepth'"], ["f", "phaserdepth", "Phaser Audio DSP effect | params are 'phaserrate' and 'phaserdepth'"], ["f", "phaserrate", "Phaser Audio DSP effect | params are 'phaserrate' and 'phaserdepth'"], ["f", "fshift", "frequency shifter"], ["f", "fshiftnote", "frequency shifter"], ["f", "fshiftphase", "frequency shifter"], ["f", "triode", "tube distortion"], ["f", "krush", "shape/bass enhancer"], ["f", "kcutoff", ""], ["f", "octer", "octaver effect"], ["f", "octersub", "octaver effect"], ["f", "octersubsub", "octaver effect"], ["f", "ring", "ring modulation"], ["f", "ringf", "ring modulation"], ["f", "ringdf", "ring modulation"], ["f", "distort", "noisy fuzzy distortion"], ["f", "freeze", "Spectral freeze"], ["f", "xsdelay", ""], ["f", "tsdelay", ""], ["f", "real", "Spectral conform"], ["f", "imag", ""], ["f", "enhance", "Spectral enhance"], ["f", "partials", ""], ["f", "comb", "Spectral comb"], ["f", "smear", "Spectral smear"], ["f", "scram", "Spectral scramble"], ["f", "binshift", "Spectral binshift"], ["f", "hbrick", "High pass sort of spectral filter"], ["f", "lbrick", "Low pass sort of spectral filter"], ["f", "midichan", ""], ["f", "control", ""], ["f", "ccn", ""], ["f", "ccv", ""], ["f", "polyTouch", ""], ["f", "midibend", ""], ["f", "miditouch", ""], ["f", "ctlNum", ""], ["f", "frameRate", ""], ["f", "frames", ""], ["f", "hours", ""], ["s", "midicmd", ""], ["f", "minutes", ""], ["f", "progNum", ""], ["f", "seconds", ""], ["f", "songPtr", ""], ["f", "uid", ""], ["f", "val", ""], ["f", "cps", ""], ["f", "clip", ""]]; + +var _name = (name, ...pats) => sequence$1(...pats).withValue(x => ({ + [name]: x +})); + +var _setter = (func, name) => function (...pats) { + if (!pats.length) { + return this.fmap(value => ({ + [name]: value + })); + } + + return this.set(func(...pats)); +}; + +generic_params.forEach(([type, name, description]) => { + controls[name] = (...pats) => _name(name, ...pats); + + Pattern$1.prototype[name] = _setter(controls[name], name); +}); + +controls.createParam = name => { + const func = (...pats) => _name(name, ...pats); + + Pattern$1.prototype[name] = _setter(func, name); + return (...pats) => _name(name, ...pats); +}; + +controls.createParams = (...names) => names.reduce((acc, name) => Object.assign(acc, { + [name]: createParam(name) +}), {}); + +function bjorklund(slots, pulses) { + var pattern = [], + count = [], + remainder = [pulses], + divisor = slots - pulses, + level = 0, + build_pattern = function (lv) { + if (lv == -1) { + pattern.push(0); + } else if (lv == -2) { + pattern.push(1); + } else { + for (var x = 0; x < count[lv]; x++) { + build_pattern(lv - 1); + } + + if (remainder[lv]) { + build_pattern(lv - 2); + } + } + }; + + while (remainder[level] > 1) { + count.push(Math.floor(divisor / remainder[level])); + remainder.push(divisor % remainder[level]); + divisor = remainder[level]; + level++; + } + + count.push(divisor); + build_pattern(level); + return pattern.reverse(); +} + +var bjork = function (m, k) { + if (m > k) return bjorklund(m, k);else return bjorklund(k, m); +}; + +var euclid = (pulses, steps, rotation = 0) => { + const b = bjork(steps, pulses); + + if (rotation) { + return rotate(b, -rotation); + } + + return b; +}; + +Pattern$1.prototype.euclid = function (pulses, steps, rotation = 0) { + return this.struct(euclid(pulses, steps, rotation)); +}; + +Pattern$1.prototype.euclidLegato = function (pulses, steps, rotation = 0) { + const bin_pat = euclid(pulses, steps, rotation); + const firstOne = bin_pat.indexOf(1); + const gapless = rotate(bin_pat, firstOne).join("").split("1").slice(1).map(s => [s.length + 1, true]); + return this.struct(timeCat$1(...gapless)).late(fraction(firstOne).div(steps)); +}; + +function steady(value) { + return new Pattern$1(state => [new Hap(void 0, state.span, value)]); +} + +var signal = func => { + const query = state => [new Hap(void 0, state.span, func(state.span.midpoint()))]; + + return new Pattern$1(query); +}; + +var isaw = signal(t => 1 - t % 1); + +var isaw2 = isaw._toBipolar(); + +var saw = signal(t => t % 1); + +var saw2 = saw._toBipolar(); + +var sine2 = signal(t => Math.sin(Math.PI * 2 * t)); + +var sine = sine2._fromBipolar(); + +var cosine = sine._early(fraction(1).div(4)); + +var cosine2 = sine2._early(fraction(1).div(4)); + +var square = signal(t => Math.floor(t * 2 % 2)); + +var square2 = square._toBipolar(); + +var tri = _fastcat(isaw, saw); + +var tri2 = _fastcat(isaw2, saw2); + +var time = signal(id); + +var xorwise = x => { + const a = x << 13 ^ x; + const b = a >> 17 ^ a; + return b << 5 ^ b; +}; + +var _frac = x => x - Math.trunc(x); + +var timeToIntSeed = x => xorwise(Math.trunc(_frac(x / 300) * 536870912)); + +var intSeedToRand = x => x % 536870912 / 536870912; + +var timeToRand = x => Math.abs(intSeedToRand(timeToIntSeed(x))); + +var rand = signal(timeToRand); + +var rand2 = rand._toBipolar(); + +var _brandBy = p => rand.fmap(x => x < p); + +var brandBy = pPat => reify$2(pPat).fmap(_brandBy).innerJoin(); + +var brand = _brandBy(0.5); + +var _irand = i => rand.fmap(x => Math.trunc(x * i)); + +var irand = ipat => reify$2(ipat).fmap(_irand).innerJoin(); + +var __chooseWith = (pat, xs) => { + xs = xs.map(reify$2); + + if (xs.length == 0) { + return silence$1; + } + + return pat.range(0, xs.length).fmap(i => xs[Math.floor(i)]); +}; + +var chooseWith = (pat, xs) => { + return __chooseWith(pat, xs).outerJoin(); +}; + +var chooseInWith = (pat, xs) => { + return __chooseWith(pat, xs).innerJoin(); +}; + +var choose = (...xs) => chooseWith(rand, xs); + +Pattern$1.prototype.choose = function (...xs) { + return chooseWith(this, xs); +}; + +Pattern$1.prototype.choose2 = function (...xs) { + return chooseWith(this._fromBipolar(), xs); +}; + +var chooseCycles = (...xs) => chooseInWith(rand.segment(1), xs); + +var randcat = chooseCycles; + +var _wchooseWith = function (pat, ...pairs) { + const values = pairs.map(pair => reify$2(pair[0])); + const weights = []; + let accum = 0; + + for (const pair of pairs) { + accum += pair[1]; + weights.push(accum); + } + + const total = accum; + + const match = function (r) { + const find = r * total; + return values[weights.findIndex(x => x > find, weights)]; + }; + + return pat.fmap(match); +}; + +var wchooseWith = (...args) => _wchooseWith(...args).outerJoin(); + +var wchoose = (...pairs) => wchooseWith(rand, ...pairs); + +var wchooseCycles = (...pairs) => _wchooseWith(rand, ...pairs).innerJoin(); + +var perlinWith = pat => { + const pata = pat.fmap(Math.floor); + const patb = pat.fmap(t => Math.floor(t) + 1); + + const smootherStep = x => 6 * x ** 5 - 15 * x ** 4 + 10 * x ** 3; + + const interp = x => a => b => a + smootherStep(x) * (b - a); + + return pat.sub(pata).fmap(interp).appBoth(pata.fmap(timeToRand)).appBoth(patb.fmap(timeToRand)); +}; + +var perlin = perlinWith(time); + +Pattern$1.prototype._degradeByWith = function (withPat, x) { + return this.fmap(a => _ => a).appLeft(withPat._filterValues(v => v > x)); +}; + +Pattern$1.prototype._degradeBy = function (x) { + return this._degradeByWith(rand, x); +}; + +Pattern$1.prototype.degrade = function () { + return this._degradeBy(0.5); +}; + +Pattern$1.prototype._undegradeBy = function (x) { + return this._degradeByWith(rand.fmap(r => 1 - r), x); +}; + +Pattern$1.prototype.undegrade = function () { + return this._undegradeBy(0.5); +}; + +Pattern$1.prototype._sometimesBy = function (x, func) { + return stack$1(this._degradeBy(x), func(this._undegradeBy(1 - x))); +}; + +Pattern$1.prototype.sometimesBy = function (patx, func) { + const pat = this; + return reify$2(patx).fmap(x => pat._sometimesBy(x, func)).innerJoin(); +}; + +Pattern$1.prototype._sometimesByPre = function (x, func) { + return stack$1(this._degradeBy(x), func(this).undegradeBy(1 - x)); +}; + +Pattern$1.prototype.sometimesByPre = function (patx, func) { + const pat = this; + return reify$2(patx).fmap(x => pat._sometimesByPre(x, func)).innerJoin(); +}; + +Pattern$1.prototype.sometimes = function (func) { + return this._sometimesBy(0.5, func); +}; + +Pattern$1.prototype.sometimesPre = function (func) { + return this._sometimesByPre(0.5, func); +}; + +Pattern$1.prototype._someCyclesBy = function (x, func) { + return stack$1(this._degradeByWith(rand._segment(1), x), func(this._degradeByWith(rand.fmap(r => 1 - r)._segment(1), 1 - x))); +}; + +Pattern$1.prototype.someCyclesBy = function (patx, func) { + const pat = this; + return reify$2(patx).fmap(x => pat._someCyclesBy(x, func)).innerJoin(); +}; + +Pattern$1.prototype.someCycles = function (func) { + return this._someCyclesBy(0.5, func); +}; + +Pattern$1.prototype.often = function (func) { + return this.sometimesBy(0.75, func); +}; + +Pattern$1.prototype.rarely = function (func) { + return this.sometimesBy(0.25, func); +}; + +Pattern$1.prototype.almostNever = function (func) { + return this.sometimesBy(0.1, func); +}; + +Pattern$1.prototype.almostAlways = function (func) { + return this.sometimesBy(0.9, func); +}; + +Pattern$1.prototype.never = function (func) { + return this; +}; + +Pattern$1.prototype.always = function (func) { + return func(this); +}; + +Pattern$1.prototype.patternified.push("degradeBy", "undegradeBy"); +var synth; + +try { + synth = window == null ? void 0 : window.speechSynthesis; +} catch (err) { + console.warn("cannot use window: not in browser?"); +} + +var allVoices = synth == null ? void 0 : synth.getVoices(); + +function speak(words, lang, voice) { + synth.cancel(); + const utterance = new SpeechSynthesisUtterance(words); + utterance.lang = lang; + allVoices = synth.getVoices(); + const voices = allVoices.filter(v => v.lang.includes(lang)); + + if (typeof voice === "number") { + utterance.voice = voices[voice % voices.length]; + } else if (typeof voice === "string") { + utterance.voice = voices.find(voice2 => voice2.name === voice2); + } + + speechSynthesis.speak(utterance); +} + +Pattern$1.prototype._speak = function (lang, voice) { + return this._withHap(hap => { + const onTrigger = (time2, hap2) => { + speak(hap2.value, lang, voice); + }; + + return hap.setContext({ ...hap.context, + onTrigger + }); + }); +}; + +Pattern$1.prototype.speak = function (lang, voice) { + return patternify2(Pattern$1.prototype._speak)(reify(lang), reify(voice), this); +}; + +var gist = (route, cache = true) => fetch(`https://gist.githubusercontent.com/${route}?cachebust=${cache ? "" : Date.now()}`).then(res => res.text()).then(code => eval(code)); + +console.log("%c // \uD83C\uDF00 @strudel.cycles/core loaded \uD83C\uDF00", "background-color: black;color:white;padding:4px;border-radius:15px"); + +if (globalThis._strudelLoaded) { + console.warn(`@strudel.cycles/core was loaded more than once... This might happen when you have multiple versions of strudel installed. -Please check with "npm ls @strudel.cycles/core".`);}globalThis._strudelLoaded=true;var strudel=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,Fraction:fraction,gist:gist,Hap:Hap,Pattern:Pattern$2,silence:silence$1,pure:pure$1,isPattern:isPattern,reify:reify$2,stack:stack$1,slowcat:slowcat$1,slowcatPrime:slowcatPrime,fastcat:_fastcat,cat:_cat,timeCat:timeCat$1,sequence:sequence$1,seq:seq$2,polymeterSteps:polymeterSteps,polymeter:polymeter,pm:pm,polyrhythm:polyrhythm,pr:pr,add:add,chop:chop,chunk:chunk,chunkBack:chunkBack,div:div,early:early,echo:echo,every:every,fast:fast,inv:inv,invert:invert,iter:iter,iterBack:iterBack,jux:jux,juxBy:juxBy,late:late,linger:linger,mask:mask,mul:mul,off:off,ply:ply,range:range,range2:range2,rev:rev,slow:slow,struct:struct,sub:sub,superimpose:superimpose,set:set,when:when,makeComposable:makeComposable,patternify2:patternify2,patternify3:patternify3,patternify4:patternify4,steady:steady,signal:signal,isaw:isaw,isaw2:isaw2,saw:saw,saw2:saw2,sine2:sine2,sine:sine,cosine:cosine,cosine2:cosine2,square:square,square2:square2,tri:tri,tri2:tri2,time:time,rand:rand,rand2:rand2,_brandBy:_brandBy,brandBy:brandBy,brand:brand,_irand:_irand,irand:irand,__chooseWith:__chooseWith,chooseWith:chooseWith,chooseInWith:chooseInWith,choose:choose,chooseCycles:chooseCycles,randcat:randcat,wchoose:wchoose,wchooseCycles:wchooseCycles,perlinWith:perlinWith,perlin:perlin,State:State,TimeSpan:TimeSpan,isNote:isNote,tokenizeNote:tokenizeNote,toMidi:toMidi,fromMidi:fromMidi,getFreq:getFreq,midi2note:midi2note,mod:mod,getPlayableNoteValue:getPlayableNoteValue,getFrequency:getFrequency,rotate:rotate,pipe:pipe,compose:compose,removeUndefineds:removeUndefineds,flatten:flatten,id:id,constant:constant,listRange:listRange,curry:curry},Symbol.toStringTag,{value:"Module"}));var dist$b={};var tokenizer$1={};var utils$3={};var unicode$5={};var idContinueBool_1$2;var idContinueLargeRegex_1$2;var idStartBool_1$2;var idStartLargeRegex_1$2;var whitespaceBool_1$2;var whitespaceArray_1$2;Object.defineProperty(unicode$5,"__esModule",{value:true});whitespaceArray_1$2=unicode$5.whitespaceArray=[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];whitespaceBool_1$2=unicode$5.whitespaceBool=[false,false,false,false,false,false,false,false,false,true,false,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false];idStartLargeRegex_1$2=unicode$5.idStartLargeRegex=/^[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\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\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\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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-\u2C2E\u2C30-\u2C5E\u2C60-\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-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]$/;idStartBool_1$2=unicode$5.idStartBool=[false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,true,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false];idContinueLargeRegex_1$2=unicode$5.idContinueLargeRegex=/^[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]$/;idContinueBool_1$2=unicode$5.idContinueBool=[false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,true,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false];var unicode$4=/* @__PURE__ */_mergeNamespaces({__proto__:null,get whitespaceArray(){return whitespaceArray_1$2;},get whitespaceBool(){return whitespaceBool_1$2;},get idStartLargeRegex(){return idStartLargeRegex_1$2;},get idStartBool(){return idStartBool_1$2;},get idContinueLargeRegex(){return idContinueLargeRegex_1$2;},get idContinueBool(){return idContinueBool_1$2;},"default":unicode$5},[unicode$5]);var require$$0$a=/* @__PURE__ */getAugmentedNamespace(unicode$4);Object.defineProperty(utils$3,"__esModule",{value:true});var isStrictModeReservedWord_1=utils$3.isStrictModeReservedWord=isStrictModeReservedWord;var isWhiteSpace_1=utils$3.isWhiteSpace=isWhiteSpace;var isLineTerminator_1=utils$3.isLineTerminator=isLineTerminator;var isIdentifierStart_1=utils$3.isIdentifierStart=isIdentifierStart$1;var isIdentifierPart_1=utils$3.isIdentifierPart=isIdentifierPart$1;var isDecimalDigit_1=utils$3.isDecimalDigit=isDecimalDigit;var getHexValue_1=utils$3.getHexValue=getHexValue;var _unicode$2=require$$0$a;var strictReservedWords=["null","true","false","implements","interface","package","private","protected","public","static","let","if","in","do","var","for","new","try","this","else","case","void","with","enum","while","break","catch","throw","const","yield","class","super","return","typeof","delete","switch","export","import","default","finally","extends","function","continue","debugger","instanceof"];function isStrictModeReservedWord(id2){return strictReservedWords.indexOf(id2)!==-1;}function isWhiteSpace(ch){return ch<128?_unicode$2.whitespaceBool[ch]:ch===160||ch>5759&&_unicode$2.whitespaceArray.indexOf(ch)!==-1;}function isLineTerminator(ch){return ch===10||ch===13||ch===8232||ch===8233;}function isIdentifierStart$1(ch){return ch<128?_unicode$2.idStartBool[ch]:_unicode$2.idStartLargeRegex.test(String.fromCodePoint(ch));}function isIdentifierPart$1(ch){return ch<128?_unicode$2.idContinueBool[ch]:_unicode$2.idContinueLargeRegex.test(String.fromCodePoint(ch));}function isDecimalDigit(ch){return ch>=48&&ch<=57;}function getHexValue(rune){if(rune>="0"&&rune<="9"){return rune.charCodeAt(0)-48;}if(rune>="a"&&rune<="f"){return rune.charCodeAt(0)-87;}if(rune>="A"&&rune<="F"){return rune.charCodeAt(0)-55;}return-1;}var utils$2=/* @__PURE__ */_mergeNamespaces({__proto__:null,isStrictModeReservedWord:isStrictModeReservedWord_1,isWhiteSpace:isWhiteSpace_1,isLineTerminator:isLineTerminator_1,isIdentifierStart:isIdentifierStart_1,isIdentifierPart:isIdentifierPart_1,isDecimalDigit:isDecimalDigit_1,getHexValue:getHexValue_1,"default":utils$3},[utils$3]);var require$$3$5=/* @__PURE__ */getAugmentedNamespace(utils$2);var errors$1={};var ErrorMessages_1;Object.defineProperty(errors$1,"__esModule",{value:true});ErrorMessages_1=errors$1.ErrorMessages={UNEXPECTED_TOKEN:function UNEXPECTED_TOKEN(id2){return"Unexpected token "+JSON.stringify(id2);},UNEXPECTED_ILLEGAL_TOKEN:function UNEXPECTED_ILLEGAL_TOKEN(id2){return"Unexpected "+JSON.stringify(id2);},UNEXPECTED_ESCAPED_KEYWORD:"Unexpected escaped keyword",UNEXPECTED_NUMBER:"Unexpected number",UNEXPECTED_STRING:"Unexpected string",UNEXPECTED_IDENTIFIER:"Unexpected identifier",UNEXPECTED_RESERVED_WORD:"Unexpected reserved word",UNEXPECTED_TEMPLATE:"Unexpected template",UNEXPECTED_EOS:"Unexpected end of input",UNEXPECTED_LINE_TERMINATOR:"Unexpected line terminator",UNEXPECTED_COMMA_AFTER_REST:"Unexpected comma after rest",UNEXPECTED_REST_PARAMETERS_INITIALIZATION:"Rest parameter may not have a default initializer",NEWLINE_AFTER_THROW:"Illegal newline after throw",UNTERMINATED_REGEXP:"Invalid regular expression: missing /",INVALID_LAST_REST_PARAMETER:"Rest parameter must be last formal parameter",INVALID_REST_PARAMETERS_INITIALIZATION:"Rest parameter may not have a default initializer",INVALID_REGEXP_FLAGS:"Invalid regular expression flags",INVALID_REGEX:"Invalid regular expression",INVALID_LHS_IN_ASSIGNMENT:"Invalid left-hand side in assignment",INVALID_LHS_IN_BINDING:"Invalid left-hand side in binding",INVALID_LHS_IN_FOR_IN:"Invalid left-hand side in for-in",INVALID_LHS_IN_FOR_OF:"Invalid left-hand side in for-of",INVALID_LHS_IN_FOR_AWAIT:"Invalid left-hand side in for-await",INVALID_UPDATE_OPERAND:"Increment/decrement target must be an identifier or member expression",INVALID_EXPONENTIATION_LHS:"Unary expressions as the left operand of an exponentation expression must be disambiguated with parentheses",MULTIPLE_DEFAULTS_IN_SWITCH:"More than one default clause in switch statement",NO_CATCH_OR_FINALLY:"Missing catch or finally after try",ILLEGAL_RETURN:"Illegal return statement",ILLEGAL_ARROW_FUNCTION_PARAMS:"Illegal arrow function parameter list",INVALID_ASYNC_PARAMS:"Async function parameters must not contain await expressions",INVALID_VAR_INIT_FOR_IN:"Invalid variable declaration in for-in statement",INVALID_VAR_INIT_FOR_OF:"Invalid variable declaration in for-of statement",INVALID_VAR_INIT_FOR_AWAIT:"Invalid variable declaration in for-await statement",UNINITIALIZED_BINDINGPATTERN_IN_FOR_INIT:"Binding pattern appears without initializer in for statement init",ILLEGAL_PROPERTY:"Illegal property initializer",INVALID_ID_BINDING_STRICT_MODE:function INVALID_ID_BINDING_STRICT_MODE(id2){return"The identifier "+JSON.stringify(id2)+" must not be in binding position in strict mode";},INVALID_ID_IN_LABEL_STRICT_MODE:function INVALID_ID_IN_LABEL_STRICT_MODE(id2){return"The identifier "+JSON.stringify(id2)+" must not be in label position in strict mode";},INVALID_ID_IN_EXPRESSION_STRICT_MODE:function INVALID_ID_IN_EXPRESSION_STRICT_MODE(id2){return"The identifier "+JSON.stringify(id2)+" must not be in expression position in strict mode";},INVALID_CALL_TO_SUPER:'Calls to super must be in the "constructor" method of a class expression or class declaration that has a superclass',INVALID_DELETE_STRICT_MODE:"Identifier expressions must not be deleted in strict mode",DUPLICATE_BINDING:function DUPLICATE_BINDING2(id2){return"Duplicate binding "+JSON.stringify(id2);},ILLEGAL_ID_IN_LEXICAL_DECLARATION:function ILLEGAL_ID_IN_LEXICAL_DECLARATION(id2){return"Lexical declarations must not have a binding named "+JSON.stringify(id2);},UNITIALIZED_CONST:"Constant lexical declarations must have an initialiser",ILLEGAL_LABEL_IN_BODY:function ILLEGAL_LABEL_IN_BODY(stmt){return"The body of a "+stmt+" statement must not be a labeled function declaration";},ILLEGEAL_LABEL_IN_IF:"The consequent of an if statement must not be a labeled function declaration",ILLEGAL_LABEL_IN_ELSE:"The alternate of an if statement must not be a labeled function declaration",ILLEGAL_CONTINUE_WITHOUT_ITERATION_WITH_ID:function ILLEGAL_CONTINUE_WITHOUT_ITERATION_WITH_ID(id2){return"Continue statement must be nested within an iteration statement with label "+JSON.stringify(id2);},ILLEGAL_CONTINUE_WITHOUT_ITERATION:"Continue statement must be nested within an iteration statement",ILLEGAL_BREAK_WITHOUT_ITERATION_OR_SWITCH:"Break statement must be nested within an iteration statement or a switch statement",ILLEGAL_WITH_STRICT_MODE:"Strict mode code must not include a with statement",ILLEGAL_ACCESS_SUPER_MEMBER:"Member access on super must be in a method",ILLEGAL_SUPER_CALL:'Calls to super must be in the "constructor" method of a class expression or class declaration that has a superclass',DUPLICATE_LABEL_DECLARATION:function DUPLICATE_LABEL_DECLARATION(label){return"Label "+JSON.stringify(label)+" has already been declared";},ILLEGAL_BREAK_WITHIN_LABEL:function ILLEGAL_BREAK_WITHIN_LABEL(label){return"Break statement must be nested within a statement with label "+JSON.stringify(label);},ILLEGAL_YIELD_EXPRESSIONS:function ILLEGAL_YIELD_EXPRESSIONS(paramType){return paramType+" parameters must not contain yield expressions";},ILLEGAL_YIELD_IDENTIFIER:'"yield" may not be used as an identifier in this context',ILLEGAL_AWAIT_IDENTIFIER:'"await" may not be used as an identifier in this context',DUPLICATE_CONSTRUCTOR:"Duplicate constructor method in class",ILLEGAL_CONSTRUCTORS:"Constructors cannot be async, generators, getters or setters",ILLEGAL_STATIC_CLASS_NAME:'Static class methods cannot be named "prototype"',NEW_TARGET_ERROR:"new.target must be within function (but not arrow expression) code",DUPLICATE_EXPORT:function DUPLICATE_EXPORT(id2){return"Duplicate export "+JSON.stringify(id2);},UNDECLARED_BINDING:function UNDECLARED_BINDING(id2){return"Exported binding "+JSON.stringify(id2)+" is not declared";},DUPLICATE_PROPTO_PROP:"Duplicate __proto__ property in object literal not allowed",ILLEGAL_LABEL_FUNC_DECLARATION:"Labeled FunctionDeclarations are disallowed in strict mode",ILLEGAL_FUNC_DECL_IF:"FunctionDeclarations in IfStatements are disallowed in strict mode",ILLEGAL_USE_STRICT:'Functions with non-simple parameter lists may not contain a "use strict" directive',ILLEGAL_EXPORTED_NAME:"Names of variables used in an export specifier from the current module must be identifiers",NO_OCTALS_IN_TEMPLATES:"Template literals may not contain octal escape sequences",NO_AWAIT_IN_ASYNC_PARAMS:'Async arrow parameters may not contain "await"'};var errors=/* @__PURE__ */_mergeNamespaces({__proto__:null,get ErrorMessages(){return ErrorMessages_1;},"default":errors$1},[errors$1]);var require$$2$5=/* @__PURE__ */getAugmentedNamespace(errors);var TokenClass_1;var TokenType_1;Object.defineProperty(tokenizer$1,"__esModule",{value:true});var JsError_1=tokenizer$1.JsError=TokenType_1=tokenizer$1.TokenType=TokenClass_1=tokenizer$1.TokenClass=void 0;var _slicedToArray=function(){function sliceIterator(arr,i2){var _arr=[];var _n=true;var _d=false;var _e=void 0;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i2&&_arr.length===i2)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"])_i["return"]();}finally{if(_d)throw _e;}}return _arr;}return function(arr,i2){if(Array.isArray(arr)){return arr;}else if(Symbol.iterator in Object(arr)){return sliceIterator(arr,i2);}else{throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();var _createClass$e=function(){function defineProperties(target,props){for(var i2=0;i2"},Ident:{name:"Identifier",isIdentifierName:true},Keyword:{name:"Keyword",isIdentifierName:true},NumericLiteral:{name:"Numeric"},TemplateElement:{name:"Template"},Punctuator:{name:"Punctuator"},StringLiteral:{name:"String"},RegularExpression:{name:"RegularExpression"},Illegal:{name:"Illegal"}};var TokenType=TokenType_1=tokenizer$1.TokenType={EOS:{klass:TokenClass.Eof,name:"EOS"},LPAREN:{klass:TokenClass.Punctuator,name:"("},RPAREN:{klass:TokenClass.Punctuator,name:")"},LBRACK:{klass:TokenClass.Punctuator,name:"["},RBRACK:{klass:TokenClass.Punctuator,name:"]"},LBRACE:{klass:TokenClass.Punctuator,name:"{"},RBRACE:{klass:TokenClass.Punctuator,name:"}"},COLON:{klass:TokenClass.Punctuator,name:":"},SEMICOLON:{klass:TokenClass.Punctuator,name:";"},PERIOD:{klass:TokenClass.Punctuator,name:"."},ELLIPSIS:{klass:TokenClass.Punctuator,name:"..."},ARROW:{klass:TokenClass.Punctuator,name:"=>"},CONDITIONAL:{klass:TokenClass.Punctuator,name:"?"},INC:{klass:TokenClass.Punctuator,name:"++"},DEC:{klass:TokenClass.Punctuator,name:"--"},ASSIGN:{klass:TokenClass.Punctuator,name:"="},ASSIGN_BIT_OR:{klass:TokenClass.Punctuator,name:"|="},ASSIGN_BIT_XOR:{klass:TokenClass.Punctuator,name:"^="},ASSIGN_BIT_AND:{klass:TokenClass.Punctuator,name:"&="},ASSIGN_SHL:{klass:TokenClass.Punctuator,name:"<<="},ASSIGN_SHR:{klass:TokenClass.Punctuator,name:">>="},ASSIGN_SHR_UNSIGNED:{klass:TokenClass.Punctuator,name:">>>="},ASSIGN_ADD:{klass:TokenClass.Punctuator,name:"+="},ASSIGN_SUB:{klass:TokenClass.Punctuator,name:"-="},ASSIGN_MUL:{klass:TokenClass.Punctuator,name:"*="},ASSIGN_DIV:{klass:TokenClass.Punctuator,name:"/="},ASSIGN_MOD:{klass:TokenClass.Punctuator,name:"%="},ASSIGN_EXP:{klass:TokenClass.Punctuator,name:"**="},COMMA:{klass:TokenClass.Punctuator,name:","},OR:{klass:TokenClass.Punctuator,name:"||"},AND:{klass:TokenClass.Punctuator,name:"&&"},BIT_OR:{klass:TokenClass.Punctuator,name:"|"},BIT_XOR:{klass:TokenClass.Punctuator,name:"^"},BIT_AND:{klass:TokenClass.Punctuator,name:"&"},SHL:{klass:TokenClass.Punctuator,name:"<<"},SHR:{klass:TokenClass.Punctuator,name:">>"},SHR_UNSIGNED:{klass:TokenClass.Punctuator,name:">>>"},ADD:{klass:TokenClass.Punctuator,name:"+"},SUB:{klass:TokenClass.Punctuator,name:"-"},MUL:{klass:TokenClass.Punctuator,name:"*"},DIV:{klass:TokenClass.Punctuator,name:"/"},MOD:{klass:TokenClass.Punctuator,name:"%"},EXP:{klass:TokenClass.Punctuator,name:"**"},EQ:{klass:TokenClass.Punctuator,name:"=="},NE:{klass:TokenClass.Punctuator,name:"!="},EQ_STRICT:{klass:TokenClass.Punctuator,name:"==="},NE_STRICT:{klass:TokenClass.Punctuator,name:"!=="},LT:{klass:TokenClass.Punctuator,name:"<"},GT:{klass:TokenClass.Punctuator,name:">"},LTE:{klass:TokenClass.Punctuator,name:"<="},GTE:{klass:TokenClass.Punctuator,name:">="},INSTANCEOF:{klass:TokenClass.Keyword,name:"instanceof"},IN:{klass:TokenClass.Keyword,name:"in"},NOT:{klass:TokenClass.Punctuator,name:"!"},BIT_NOT:{klass:TokenClass.Punctuator,name:"~"},ASYNC:{klass:TokenClass.Keyword,name:"async"},AWAIT:{klass:TokenClass.Keyword,name:"await"},ENUM:{klass:TokenClass.Keyword,name:"enum"},DELETE:{klass:TokenClass.Keyword,name:"delete"},TYPEOF:{klass:TokenClass.Keyword,name:"typeof"},VOID:{klass:TokenClass.Keyword,name:"void"},BREAK:{klass:TokenClass.Keyword,name:"break"},CASE:{klass:TokenClass.Keyword,name:"case"},CATCH:{klass:TokenClass.Keyword,name:"catch"},CLASS:{klass:TokenClass.Keyword,name:"class"},CONTINUE:{klass:TokenClass.Keyword,name:"continue"},DEBUGGER:{klass:TokenClass.Keyword,name:"debugger"},DEFAULT:{klass:TokenClass.Keyword,name:"default"},DO:{klass:TokenClass.Keyword,name:"do"},ELSE:{klass:TokenClass.Keyword,name:"else"},EXPORT:{klass:TokenClass.Keyword,name:"export"},EXTENDS:{klass:TokenClass.Keyword,name:"extends"},FINALLY:{klass:TokenClass.Keyword,name:"finally"},FOR:{klass:TokenClass.Keyword,name:"for"},FUNCTION:{klass:TokenClass.Keyword,name:"function"},IF:{klass:TokenClass.Keyword,name:"if"},IMPORT:{klass:TokenClass.Keyword,name:"import"},LET:{klass:TokenClass.Keyword,name:"let"},NEW:{klass:TokenClass.Keyword,name:"new"},RETURN:{klass:TokenClass.Keyword,name:"return"},SUPER:{klass:TokenClass.Keyword,name:"super"},SWITCH:{klass:TokenClass.Keyword,name:"switch"},THIS:{klass:TokenClass.Keyword,name:"this"},THROW:{klass:TokenClass.Keyword,name:"throw"},TRY:{klass:TokenClass.Keyword,name:"try"},VAR:{klass:TokenClass.Keyword,name:"var"},WHILE:{klass:TokenClass.Keyword,name:"while"},WITH:{klass:TokenClass.Keyword,name:"with"},NULL:{klass:TokenClass.Keyword,name:"null"},TRUE:{klass:TokenClass.Keyword,name:"true"},FALSE:{klass:TokenClass.Keyword,name:"false"},YIELD:{klass:TokenClass.Keyword,name:"yield"},NUMBER:{klass:TokenClass.NumericLiteral,name:""},STRING:{klass:TokenClass.StringLiteral,name:""},REGEXP:{klass:TokenClass.RegularExpression,name:""},IDENTIFIER:{klass:TokenClass.Ident,name:""},CONST:{klass:TokenClass.Keyword,name:"const"},TEMPLATE:{klass:TokenClass.TemplateElement,name:""},ESCAPED_KEYWORD:{klass:TokenClass.Keyword,name:""},ILLEGAL:{klass:TokenClass.Illegal,name:""}};var TT=TokenType;var I=TT.ILLEGAL;var F=false;var T=true;var ONE_CHAR_PUNCTUATOR=[I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,TT.NOT,I,I,I,TT.MOD,TT.BIT_AND,I,TT.LPAREN,TT.RPAREN,TT.MUL,TT.ADD,TT.COMMA,TT.SUB,TT.PERIOD,TT.DIV,I,I,I,I,I,I,I,I,I,I,TT.COLON,TT.SEMICOLON,TT.LT,TT.ASSIGN,TT.GT,TT.CONDITIONAL,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,TT.LBRACK,I,TT.RBRACK,TT.BIT_XOR,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,TT.LBRACE,TT.BIT_OR,TT.RBRACE,TT.BIT_NOT];var PUNCTUATOR_START=[F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,T,F,F,F,T,T,F,T,T,T,T,T,T,F,T,F,F,F,F,F,F,F,F,F,F,T,T,T,T,T,T,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,T,F,T,T,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,T,T,T,T,F];var JsError=JsError_1=tokenizer$1.JsError=function(_Error){_inherits$8(JsError2,_Error);function JsError2(index2,line,column,msg){_classCallCheck$i(this,JsError2);var _this=_possibleConstructorReturn$8(this,(JsError2.__proto__||Object.getPrototypeOf(JsError2)).call(this,msg));_this.index=index2;try{_this.line=line;_this.column=column;}catch(e){}_this.parseErrorLine=line;_this.parseErrorColumn=column;_this.description=msg;_this.message="["+line+":"+column+"]: "+msg;return _this;}return JsError2;}(Error);function fromCodePoint(cp){if(cp<=65535)return String.fromCharCode(cp);var cu1=String.fromCharCode(Math.floor((cp-65536)/1024)+55296);var cu2=String.fromCharCode((cp-65536)%1024+56320);return cu1+cu2;}function decodeUtf16(lead,trail){return(lead-55296)*1024+(trail-56320)+65536;}var Tokenizer=function(){function Tokenizer2(source){_classCallCheck$i(this,Tokenizer2);this.source=source;this.index=0;this.line=0;this.lineStart=0;this.startIndex=0;this.startLine=0;this.startLineStart=0;this.lastIndex=0;this.lastLine=0;this.lastLineStart=0;this.hasLineTerminatorBeforeNext=false;this.tokenIndex=0;}_createClass$e(Tokenizer2,[{key:"saveLexerState",value:function saveLexerState(){return{source:this.source,index:this.index,line:this.line,lineStart:this.lineStart,startIndex:this.startIndex,startLine:this.startLine,startLineStart:this.startLineStart,lastIndex:this.lastIndex,lastLine:this.lastLine,lastLineStart:this.lastLineStart,lookahead:this.lookahead,hasLineTerminatorBeforeNext:this.hasLineTerminatorBeforeNext,tokenIndex:this.tokenIndex};}},{key:"restoreLexerState",value:function restoreLexerState(state){this.source=state.source;this.index=state.index;this.line=state.line;this.lineStart=state.lineStart;this.startIndex=state.startIndex;this.startLine=state.startLine;this.startLineStart=state.startLineStart;this.lastIndex=state.lastIndex;this.lastLine=state.lastLine;this.lastLineStart=state.lastLineStart;this.lookahead=state.lookahead;this.hasLineTerminatorBeforeNext=state.hasLineTerminatorBeforeNext;this.tokenIndex=state.tokenIndex;}},{key:"createILLEGAL",value:function createILLEGAL(){this.startIndex=this.index;this.startLine=this.line;this.startLineStart=this.lineStart;return this.index1?_len-1:0),_key=1;_key<_len;_key++){params[_key-1]=arguments[_key];}msg=message.apply(void 0,params);}else{msg=message;}return new JsError(this.startIndex,this.startLine+1,this.startIndex-this.startLineStart+1,msg);}},{key:"createErrorWithLocation",value:function createErrorWithLocation(location,message){var _arguments=arguments;var msg=message.replace(/\{(\d+)\}/g,function(_,n){return JSON.stringify(_arguments[+n+2]);});if(location.slice&&location.slice.startLocation){location=location.slice.startLocation;}return new JsError(location.offset,location.line,location.column+1,msg);}},{key:"getKeyword",value:function getKeyword(id2){if(id2.length===1||id2.length>10){return TokenType.IDENTIFIER;}switch(id2.length){case 2:switch(id2.charAt(0)){case"i":switch(id2.charAt(1)){case"f":return TokenType.IF;case"n":return TokenType.IN;}break;case"d":if(id2.charAt(1)==="o"){return TokenType.DO;}break;}break;case 3:switch(id2.charAt(0)){case"v":if(Tokenizer2.cse2(id2,"a","r")){return TokenType.VAR;}break;case"f":if(Tokenizer2.cse2(id2,"o","r")){return TokenType.FOR;}break;case"n":if(Tokenizer2.cse2(id2,"e","w")){return TokenType.NEW;}break;case"t":if(Tokenizer2.cse2(id2,"r","y")){return TokenType.TRY;}break;case"l":if(Tokenizer2.cse2(id2,"e","t")){return TokenType.LET;}break;}break;case 4:switch(id2.charAt(0)){case"t":if(Tokenizer2.cse3(id2,"h","i","s")){return TokenType.THIS;}else if(Tokenizer2.cse3(id2,"r","u","e")){return TokenType.TRUE;}break;case"n":if(Tokenizer2.cse3(id2,"u","l","l")){return TokenType.NULL;}break;case"e":if(Tokenizer2.cse3(id2,"l","s","e")){return TokenType.ELSE;}else if(Tokenizer2.cse3(id2,"n","u","m")){return TokenType.ENUM;}break;case"c":if(Tokenizer2.cse3(id2,"a","s","e")){return TokenType.CASE;}break;case"v":if(Tokenizer2.cse3(id2,"o","i","d")){return TokenType.VOID;}break;case"w":if(Tokenizer2.cse3(id2,"i","t","h")){return TokenType.WITH;}break;}break;case 5:switch(id2.charAt(0)){case"a":if(Tokenizer2.cse4(id2,"s","y","n","c")){return TokenType.ASYNC;}if(Tokenizer2.cse4(id2,"w","a","i","t")){return TokenType.AWAIT;}break;case"w":if(Tokenizer2.cse4(id2,"h","i","l","e")){return TokenType.WHILE;}break;case"b":if(Tokenizer2.cse4(id2,"r","e","a","k")){return TokenType.BREAK;}break;case"f":if(Tokenizer2.cse4(id2,"a","l","s","e")){return TokenType.FALSE;}break;case"c":if(Tokenizer2.cse4(id2,"a","t","c","h")){return TokenType.CATCH;}else if(Tokenizer2.cse4(id2,"o","n","s","t")){return TokenType.CONST;}else if(Tokenizer2.cse4(id2,"l","a","s","s")){return TokenType.CLASS;}break;case"t":if(Tokenizer2.cse4(id2,"h","r","o","w")){return TokenType.THROW;}break;case"y":if(Tokenizer2.cse4(id2,"i","e","l","d")){return TokenType.YIELD;}break;case"s":if(Tokenizer2.cse4(id2,"u","p","e","r")){return TokenType.SUPER;}break;}break;case 6:switch(id2.charAt(0)){case"r":if(Tokenizer2.cse5(id2,"e","t","u","r","n")){return TokenType.RETURN;}break;case"t":if(Tokenizer2.cse5(id2,"y","p","e","o","f")){return TokenType.TYPEOF;}break;case"d":if(Tokenizer2.cse5(id2,"e","l","e","t","e")){return TokenType.DELETE;}break;case"s":if(Tokenizer2.cse5(id2,"w","i","t","c","h")){return TokenType.SWITCH;}break;case"e":if(Tokenizer2.cse5(id2,"x","p","o","r","t")){return TokenType.EXPORT;}break;case"i":if(Tokenizer2.cse5(id2,"m","p","o","r","t")){return TokenType.IMPORT;}break;}break;case 7:switch(id2.charAt(0)){case"d":if(Tokenizer2.cse6(id2,"e","f","a","u","l","t")){return TokenType.DEFAULT;}break;case"f":if(Tokenizer2.cse6(id2,"i","n","a","l","l","y")){return TokenType.FINALLY;}break;case"e":if(Tokenizer2.cse6(id2,"x","t","e","n","d","s")){return TokenType.EXTENDS;}break;}break;case 8:switch(id2.charAt(0)){case"f":if(Tokenizer2.cse7(id2,"u","n","c","t","i","o","n")){return TokenType.FUNCTION;}break;case"c":if(Tokenizer2.cse7(id2,"o","n","t","i","n","u","e")){return TokenType.CONTINUE;}break;case"d":if(Tokenizer2.cse7(id2,"e","b","u","g","g","e","r")){return TokenType.DEBUGGER;}break;}break;case 10:if(id2==="instanceof"){return TokenType.INSTANCEOF;}break;}return TokenType.IDENTIFIER;}},{key:"skipSingleLineComment",value:function skipSingleLineComment(offset){this.index+=offset;while(this.index=length){break;}chCode=this.source.charCodeAt(this.index+1);if(chCode===47){this.skipSingleLineComment(2);isLineStart=true;}else if(chCode===42){isLineStart=this.skipMultiLineComment()||isLineStart;}else{break;}}else if(!this.moduleIsTheGoalSymbol&&isLineStart&&chCode===45){if(this.index+2>=length){break;}if(this.source.charAt(this.index+1)==="-"&&this.source.charAt(this.index+2)===">"){this.skipSingleLineComment(3);}else{break;}}else if(!this.moduleIsTheGoalSymbol&&chCode===60){if(this.source.slice(this.index+1,this.index+4)==="!--"){this.skipSingleLineComment(4);isLineStart=true;}else{break;}}else{break;}}}},{key:"scanHexEscape2",value:function scanHexEscape2(){if(this.index+2>this.source.length){return-1;}var r1=(0,_utils$1.getHexValue)(this.source.charAt(this.index));if(r1===-1){return-1;}var r2=(0,_utils$1.getHexValue)(this.source.charAt(this.index+1));if(r2===-1){return-1;}this.index+=2;return r1<<4|r2;}},{key:"scanUnicode",value:function scanUnicode(){if(this.source.charAt(this.index)==="{"){var i2=this.index+1;var hexDigits2=0,ch=void 0;while(i21114111){throw this.createILLEGAL();}i2++;}if(ch!=="}"){throw this.createILLEGAL();}if(i2===this.index+1){++this.index;throw this.createILLEGAL();}this.index=i2+1;return hexDigits2;}if(this.index+4>this.source.length){return-1;}var r1=(0,_utils$1.getHexValue)(this.source.charAt(this.index));if(r1===-1){return-1;}var r2=(0,_utils$1.getHexValue)(this.source.charAt(this.index+1));if(r2===-1){return-1;}var r3=(0,_utils$1.getHexValue)(this.source.charAt(this.index+2));if(r3===-1){return-1;}var r4=(0,_utils$1.getHexValue)(this.source.charAt(this.index+3));if(r4===-1){return-1;}this.index+=4;return r1<<12|r2<<8|r3<<4|r4;}},{key:"getEscapedIdentifier",value:function getEscapedIdentifier(){var id2="";var check=_utils$1.isIdentifierStart;while(this.index=this.source.length){throw this.createILLEGAL();}if(this.source.charAt(this.index)!=="u"){throw this.createILLEGAL();}++this.index;code2=this.scanUnicode();if(code2<0){throw this.createILLEGAL();}ch=fromCodePoint(code2);}else if(code2>=55296&&code2<=56319){if(this.index>=this.source.length){throw this.createILLEGAL();}var lowSurrogateCode=this.source.charCodeAt(this.index);++this.index;if(!(lowSurrogateCode>=56320&&lowSurrogateCode<=57343)){throw this.createILLEGAL();}code2=decodeUtf16(code2,lowSurrogateCode);ch=fromCodePoint(code2);}if(!check(code2)){if(id2.length<1){throw this.createILLEGAL();}this.index=start;return id2;}check=_utils$1.isIdentifierPart;id2+=ch;}return id2;}},{key:"getIdentifier",value:function getIdentifier(){var start=this.index;var l=this.source.length;var i2=this.index;var check=_utils$1.isIdentifierStart;while(i2=55296&&code2<=56319){this.index=start;return this.getEscapedIdentifier();}if(!check(code2)){this.index=i2;return this.source.slice(start,i2);}++i2;check=_utils$1.isIdentifierPart;}this.index=i2;return this.source.slice(start,i2);}},{key:"scanIdentifier",value:function scanIdentifier(){var startLocation=this.getLocation();var start=this.index;var id2=this.source.charAt(this.index)==="\\"?this.getEscapedIdentifier():this.getIdentifier();var slice=this.getSlice(start,startLocation);slice.text=id2;var hasEscape=this.index-start!==id2.length;var type=this.getKeyword(id2);if(hasEscape&&type!==TokenType.IDENTIFIER){type=TokenType.ESCAPED_KEYWORD;}return{type,value:id2,slice,escaped:hasEscape};}},{key:"getLocation",value:function getLocation(){return{line:this.startLine+1,column:this.startIndex-this.startLineStart,offset:this.startIndex};}},{key:"getLastTokenEndLocation",value:function getLastTokenEndLocation(){return{line:this.lastLine+1,column:this.lastIndex-this.lastLineStart,offset:this.lastIndex};}},{key:"getSlice",value:function getSlice(start,startLocation){return{text:this.source.slice(start,this.index),start,startLocation,end:this.index};}},{key:"scanPunctuatorHelper",value:function scanPunctuatorHelper(){var ch1=this.source.charAt(this.index);switch(ch1){case".":{var ch2=this.source.charAt(this.index+1);if(ch2!==".")return TokenType.PERIOD;var ch3=this.source.charAt(this.index+2);if(ch3!==".")return TokenType.PERIOD;return TokenType.ELLIPSIS;}case"(":return TokenType.LPAREN;case")":case";":case",":return ONE_CHAR_PUNCTUATOR[ch1.charCodeAt(0)];case"{":return TokenType.LBRACE;case"}":case"[":case"]":case":":case"?":case"~":return ONE_CHAR_PUNCTUATOR[ch1.charCodeAt(0)];default:if(this.index+1":return TokenType.GTE;case"/":return TokenType.ASSIGN_DIV;case"%":return TokenType.ASSIGN_MOD;case"^":return TokenType.ASSIGN_BIT_XOR;case"&":return TokenType.ASSIGN_BIT_AND;}}}if(this.index+1"&&_ch2===">"){if(this.index+3"&&_ch2==="="){return TokenType.ASSIGN_SHR;}if(ch1==="*"&&_ch2==="="){return TokenType.ASSIGN_EXP;}}switch(ch1){case"*":return TokenType.EXP;case"+":return TokenType.INC;case"-":return TokenType.DEC;case"<":return TokenType.SHL;case">":return TokenType.SHR;case"&":return TokenType.AND;case"|":return TokenType.OR;}}else if(ch1==="="&&_ch===">"){return TokenType.ARROW;}}return ONE_CHAR_PUNCTUATOR[ch1.charCodeAt(0)];}},{key:"scanPunctuator",value:function scanPunctuator(){var startLocation=this.getLocation();var start=this.index;var subType=this.scanPunctuatorHelper();this.index+=subType.name.length;return{type:subType,value:subType.name,slice:this.getSlice(start,startLocation)};}},{key:"scanHexLiteral",value:function scanHexLiteral(start,startLocation){var i2=this.index;while(i2="0"&&ch<="7"){this.index++;}else if((0,_utils$1.isIdentifierPart)(ch.charCodeAt(0))){throw this.createILLEGAL();}else{break;}}if(this.index-start===2){throw this.createILLEGAL();}return{type:TokenType.NUMBER,value:parseInt(this.getSlice(start,startLocation).text.substr(2),8),slice:this.getSlice(start,startLocation),octal:false,noctal:false};}},{key:"scanLegacyOctalLiteral",value:function scanLegacyOctalLiteral(start,startLocation){var isOctal=true;while(this.index="0"&&ch<="7"){this.index++;}else if(ch==="8"||ch==="9"){isOctal=false;this.index++;}else if((0,_utils$1.isIdentifierPart)(ch.charCodeAt(0))){throw this.createILLEGAL();}else{break;}}var slice=this.getSlice(start,startLocation);if(!isOctal){this.eatDecimalLiteralSuffix();return{type:TokenType.NUMBER,slice,value:+slice.text,octal:true,noctal:!isOctal};}return{type:TokenType.NUMBER,slice,value:parseInt(slice.text.substr(1),8),octal:true,noctal:!isOctal};}},{key:"scanNumericLiteral",value:function scanNumericLiteral(){var ch=this.source.charAt(this.index);var startLocation=this.getLocation();var start=this.index;if(ch==="0"){this.index++;if(this.index="0"&&ch<="9"){return this.scanLegacyOctalLiteral(start,startLocation);}}else{var _slice=this.getSlice(start,startLocation);return{type:TokenType.NUMBER,value:+_slice.text,slice:_slice,octal:false,noctal:false};}}else if(ch!=="."){ch=this.source.charAt(this.index);while(ch>="0"&&ch<="9"){this.index++;if(this.index===this.source.length){var _slice2=this.getSlice(start,startLocation);return{type:TokenType.NUMBER,value:+_slice2.text,slice:_slice2,octal:false,noctal:false};}ch=this.source.charAt(this.index);}}this.eatDecimalLiteralSuffix();if(this.index!==this.source.length&&(0,_utils$1.isIdentifierStart)(this.source.charCodeAt(this.index))){throw this.createILLEGAL();}var slice=this.getSlice(start,startLocation);return{type:TokenType.NUMBER,value:+slice.text,slice,octal:false,noctal:false};}},{key:"eatDecimalLiteralSuffix",value:function eatDecimalLiteralSuffix(){var ch=this.source.charAt(this.index);if(ch==="."){this.index++;if(this.index===this.source.length){return;}ch=this.source.charAt(this.index);while(ch>="0"&&ch<="9"){this.index++;if(this.index===this.source.length){return;}ch=this.source.charAt(this.index);}}if(ch==="e"||ch==="E"){this.index++;if(this.index===this.source.length){throw this.createILLEGAL();}ch=this.source.charAt(this.index);if(ch==="+"||ch==="-"){this.index++;if(this.index===this.source.length){throw this.createILLEGAL();}ch=this.source.charAt(this.index);}if(ch>="0"&&ch<="9"){while(ch>="0"&&ch<="9"){this.index++;if(this.index===this.source.length){break;}ch=this.source.charAt(this.index);}}else{throw this.createILLEGAL();}}}},{key:"scanStringEscape",value:function scanStringEscape(str,octal){this.index++;if(this.index===this.source.length){throw this.createILLEGAL();}var ch=this.source.charAt(this.index);if((0,_utils$1.isLineTerminator)(ch.charCodeAt(0))){this.index++;if(ch==="\r"&&this.source.charAt(this.index)==="\n"){this.index++;}this.lineStart=this.index;this.line++;}else{switch(ch){case"n":str+="\n";this.index++;break;case"r":str+="\r";this.index++;break;case"t":str+=" ";this.index++;break;case"u":case"x":{var unescaped=void 0;this.index++;if(this.index>=this.source.length){throw this.createILLEGAL();}unescaped=ch==="u"?this.scanUnicode():this.scanHexEscape2();if(unescaped<0){throw this.createILLEGAL();}str+=fromCodePoint(unescaped);break;}case"b":str+="\b";this.index++;break;case"f":str+="\f";this.index++;break;case"v":str+="\v";this.index++;break;default:if(ch>="0"&&ch<="7"){var octalStart=this.index;var octLen=1;if(ch>="0"&&ch<="3"){octLen=0;}var code2=0;while(octLen<3&&ch>="0"&&ch<="7"){this.index++;if(octLen>0||ch!=="0"){octal=this.source.slice(octalStart,this.index);}code2*=8;code2+=ch-"0";octLen++;if(this.index===this.source.length){throw this.createILLEGAL();}ch=this.source.charAt(this.index);}if(code2===0&&octLen===1&&(ch==="8"||ch==="9")){octal=this.source.slice(octalStart,this.index+1);}str+=String.fromCharCode(code2);}else if(ch==="8"||ch==="9"){throw this.createILLEGAL();}else{str+=ch;this.index++;}}}return[str,octal];}},{key:"scanStringLiteral",value:function scanStringLiteral(){var str="";var quote=this.source.charAt(this.index);var startLocation=this.getLocation();var start=this.index;this.index++;var octal=null;while(this.index=this.source.length){return{type:TokenType.EOS,slice:this.getSlice(this.index,startLocation)};}var charCode=this.source.charCodeAt(this.index);if(charCode<128){if(PUNCTUATOR_START[charCode]){return this.scanPunctuator();}if((0,_utils$1.isIdentifierStart)(charCode)||charCode===92){return this.scanIdentifier();}if(charCode===46){if(this.index+1=48&&charCode<=57){return this.scanNumericLiteral();}throw this.createILLEGAL();}else{if((0,_utils$1.isIdentifierStart)(charCode)||charCode>=55296&&charCode<=56319){return this.scanIdentifier();}throw this.createILLEGAL();}}},{key:"eof",value:function eof(){return this.lookahead.type===TokenType.EOS;}},{key:"lex",value:function lex(){var prevToken=this.lookahead;this.lookahead=this.advance();this.tokenIndex++;return prevToken;}}],[{key:"cse2",value:function cse2(id2,ch1,ch2){return id2.charAt(1)===ch1&&id2.charAt(2)===ch2;}},{key:"cse3",value:function cse3(id2,ch1,ch2,ch3){return id2.charAt(1)===ch1&&id2.charAt(2)===ch2&&id2.charAt(3)===ch3;}},{key:"cse4",value:function cse4(id2,ch1,ch2,ch3,ch4){return id2.charAt(1)===ch1&&id2.charAt(2)===ch2&&id2.charAt(3)===ch3&&id2.charAt(4)===ch4;}},{key:"cse5",value:function cse5(id2,ch1,ch2,ch3,ch4,ch5){return id2.charAt(1)===ch1&&id2.charAt(2)===ch2&&id2.charAt(3)===ch3&&id2.charAt(4)===ch4&&id2.charAt(5)===ch5;}},{key:"cse6",value:function cse6(id2,ch1,ch2,ch3,ch4,ch5,ch6){return id2.charAt(1)===ch1&&id2.charAt(2)===ch2&&id2.charAt(3)===ch3&&id2.charAt(4)===ch4&&id2.charAt(5)===ch5&&id2.charAt(6)===ch6;}},{key:"cse7",value:function cse7(id2,ch1,ch2,ch3,ch4,ch5,ch6,ch7){return id2.charAt(1)===ch1&&id2.charAt(2)===ch2&&id2.charAt(3)===ch3&&id2.charAt(4)===ch4&&id2.charAt(5)===ch5&&id2.charAt(6)===ch6&&id2.charAt(7)===ch7;}}]);return Tokenizer2;}();var _default$c=tokenizer$1["default"]=Tokenizer;var tokenizer=/* @__PURE__ */_mergeNamespaces({__proto__:null,get JsError(){return JsError_1;},get TokenType(){return TokenType_1;},get TokenClass(){return TokenClass_1;},"default":_default$c},[tokenizer$1]);var require$$0$9=/* @__PURE__ */getAugmentedNamespace(tokenizer);var parser$1={};var dist$a={};var mappings=/* @__PURE__ */new Map([["General_Category",/* @__PURE__ */new Map([["C","Other"],["Cc","Control"],["cntrl","Control"],["Cf","Format"],["Cn","Unassigned"],["Co","Private_Use"],["Cs","Surrogate"],["L","Letter"],["LC","Cased_Letter"],["Ll","Lowercase_Letter"],["Lm","Modifier_Letter"],["Lo","Other_Letter"],["Lt","Titlecase_Letter"],["Lu","Uppercase_Letter"],["M","Mark"],["Combining_Mark","Mark"],["Mc","Spacing_Mark"],["Me","Enclosing_Mark"],["Mn","Nonspacing_Mark"],["N","Number"],["Nd","Decimal_Number"],["digit","Decimal_Number"],["Nl","Letter_Number"],["No","Other_Number"],["P","Punctuation"],["punct","Punctuation"],["Pc","Connector_Punctuation"],["Pd","Dash_Punctuation"],["Pe","Close_Punctuation"],["Pf","Final_Punctuation"],["Pi","Initial_Punctuation"],["Po","Other_Punctuation"],["Ps","Open_Punctuation"],["S","Symbol"],["Sc","Currency_Symbol"],["Sk","Modifier_Symbol"],["Sm","Math_Symbol"],["So","Other_Symbol"],["Z","Separator"],["Zl","Line_Separator"],["Zp","Paragraph_Separator"],["Zs","Space_Separator"],["Other","Other"],["Control","Control"],["Format","Format"],["Unassigned","Unassigned"],["Private_Use","Private_Use"],["Surrogate","Surrogate"],["Letter","Letter"],["Cased_Letter","Cased_Letter"],["Lowercase_Letter","Lowercase_Letter"],["Modifier_Letter","Modifier_Letter"],["Other_Letter","Other_Letter"],["Titlecase_Letter","Titlecase_Letter"],["Uppercase_Letter","Uppercase_Letter"],["Mark","Mark"],["Spacing_Mark","Spacing_Mark"],["Enclosing_Mark","Enclosing_Mark"],["Nonspacing_Mark","Nonspacing_Mark"],["Number","Number"],["Decimal_Number","Decimal_Number"],["Letter_Number","Letter_Number"],["Other_Number","Other_Number"],["Punctuation","Punctuation"],["Connector_Punctuation","Connector_Punctuation"],["Dash_Punctuation","Dash_Punctuation"],["Close_Punctuation","Close_Punctuation"],["Final_Punctuation","Final_Punctuation"],["Initial_Punctuation","Initial_Punctuation"],["Other_Punctuation","Other_Punctuation"],["Open_Punctuation","Open_Punctuation"],["Symbol","Symbol"],["Currency_Symbol","Currency_Symbol"],["Modifier_Symbol","Modifier_Symbol"],["Math_Symbol","Math_Symbol"],["Other_Symbol","Other_Symbol"],["Separator","Separator"],["Line_Separator","Line_Separator"],["Paragraph_Separator","Paragraph_Separator"],["Space_Separator","Space_Separator"]])],["Script",/* @__PURE__ */new Map([["Adlm","Adlam"],["Aghb","Caucasian_Albanian"],["Ahom","Ahom"],["Arab","Arabic"],["Armi","Imperial_Aramaic"],["Armn","Armenian"],["Avst","Avestan"],["Bali","Balinese"],["Bamu","Bamum"],["Bass","Bassa_Vah"],["Batk","Batak"],["Beng","Bengali"],["Bhks","Bhaiksuki"],["Bopo","Bopomofo"],["Brah","Brahmi"],["Brai","Braille"],["Bugi","Buginese"],["Buhd","Buhid"],["Cakm","Chakma"],["Cans","Canadian_Aboriginal"],["Cari","Carian"],["Cham","Cham"],["Cher","Cherokee"],["Copt","Coptic"],["Qaac","Coptic"],["Cprt","Cypriot"],["Cyrl","Cyrillic"],["Deva","Devanagari"],["Dogr","Dogra"],["Dsrt","Deseret"],["Dupl","Duployan"],["Egyp","Egyptian_Hieroglyphs"],["Elba","Elbasan"],["Ethi","Ethiopic"],["Geor","Georgian"],["Glag","Glagolitic"],["Gong","Gunjala_Gondi"],["Gonm","Masaram_Gondi"],["Goth","Gothic"],["Gran","Grantha"],["Grek","Greek"],["Gujr","Gujarati"],["Guru","Gurmukhi"],["Hang","Hangul"],["Hani","Han"],["Hano","Hanunoo"],["Hatr","Hatran"],["Hebr","Hebrew"],["Hira","Hiragana"],["Hluw","Anatolian_Hieroglyphs"],["Hmng","Pahawh_Hmong"],["Hrkt","Katakana_Or_Hiragana"],["Hung","Old_Hungarian"],["Ital","Old_Italic"],["Java","Javanese"],["Kali","Kayah_Li"],["Kana","Katakana"],["Khar","Kharoshthi"],["Khmr","Khmer"],["Khoj","Khojki"],["Knda","Kannada"],["Kthi","Kaithi"],["Lana","Tai_Tham"],["Laoo","Lao"],["Latn","Latin"],["Lepc","Lepcha"],["Limb","Limbu"],["Lina","Linear_A"],["Linb","Linear_B"],["Lisu","Lisu"],["Lyci","Lycian"],["Lydi","Lydian"],["Mahj","Mahajani"],["Maka","Makasar"],["Mand","Mandaic"],["Mani","Manichaean"],["Marc","Marchen"],["Medf","Medefaidrin"],["Mend","Mende_Kikakui"],["Merc","Meroitic_Cursive"],["Mero","Meroitic_Hieroglyphs"],["Mlym","Malayalam"],["Modi","Modi"],["Mong","Mongolian"],["Mroo","Mro"],["Mtei","Meetei_Mayek"],["Mult","Multani"],["Mymr","Myanmar"],["Narb","Old_North_Arabian"],["Nbat","Nabataean"],["Newa","Newa"],["Nkoo","Nko"],["Nshu","Nushu"],["Ogam","Ogham"],["Olck","Ol_Chiki"],["Orkh","Old_Turkic"],["Orya","Oriya"],["Osge","Osage"],["Osma","Osmanya"],["Palm","Palmyrene"],["Pauc","Pau_Cin_Hau"],["Perm","Old_Permic"],["Phag","Phags_Pa"],["Phli","Inscriptional_Pahlavi"],["Phlp","Psalter_Pahlavi"],["Phnx","Phoenician"],["Plrd","Miao"],["Prti","Inscriptional_Parthian"],["Rjng","Rejang"],["Rohg","Hanifi_Rohingya"],["Runr","Runic"],["Samr","Samaritan"],["Sarb","Old_South_Arabian"],["Saur","Saurashtra"],["Sgnw","SignWriting"],["Shaw","Shavian"],["Shrd","Sharada"],["Sidd","Siddham"],["Sind","Khudawadi"],["Sinh","Sinhala"],["Sogd","Sogdian"],["Sogo","Old_Sogdian"],["Sora","Sora_Sompeng"],["Soyo","Soyombo"],["Sund","Sundanese"],["Sylo","Syloti_Nagri"],["Syrc","Syriac"],["Tagb","Tagbanwa"],["Takr","Takri"],["Tale","Tai_Le"],["Talu","New_Tai_Lue"],["Taml","Tamil"],["Tang","Tangut"],["Tavt","Tai_Viet"],["Telu","Telugu"],["Tfng","Tifinagh"],["Tglg","Tagalog"],["Thaa","Thaana"],["Thai","Thai"],["Tibt","Tibetan"],["Tirh","Tirhuta"],["Ugar","Ugaritic"],["Vaii","Vai"],["Wara","Warang_Citi"],["Xpeo","Old_Persian"],["Xsux","Cuneiform"],["Yiii","Yi"],["Zanb","Zanabazar_Square"],["Zinh","Inherited"],["Qaai","Inherited"],["Zyyy","Common"],["Zzzz","Unknown"],["Adlam","Adlam"],["Caucasian_Albanian","Caucasian_Albanian"],["Arabic","Arabic"],["Imperial_Aramaic","Imperial_Aramaic"],["Armenian","Armenian"],["Avestan","Avestan"],["Balinese","Balinese"],["Bamum","Bamum"],["Bassa_Vah","Bassa_Vah"],["Batak","Batak"],["Bengali","Bengali"],["Bhaiksuki","Bhaiksuki"],["Bopomofo","Bopomofo"],["Brahmi","Brahmi"],["Braille","Braille"],["Buginese","Buginese"],["Buhid","Buhid"],["Chakma","Chakma"],["Canadian_Aboriginal","Canadian_Aboriginal"],["Carian","Carian"],["Cherokee","Cherokee"],["Coptic","Coptic"],["Cypriot","Cypriot"],["Cyrillic","Cyrillic"],["Devanagari","Devanagari"],["Dogra","Dogra"],["Deseret","Deseret"],["Duployan","Duployan"],["Egyptian_Hieroglyphs","Egyptian_Hieroglyphs"],["Elbasan","Elbasan"],["Ethiopic","Ethiopic"],["Georgian","Georgian"],["Glagolitic","Glagolitic"],["Gunjala_Gondi","Gunjala_Gondi"],["Masaram_Gondi","Masaram_Gondi"],["Gothic","Gothic"],["Grantha","Grantha"],["Greek","Greek"],["Gujarati","Gujarati"],["Gurmukhi","Gurmukhi"],["Hangul","Hangul"],["Han","Han"],["Hanunoo","Hanunoo"],["Hatran","Hatran"],["Hebrew","Hebrew"],["Hiragana","Hiragana"],["Anatolian_Hieroglyphs","Anatolian_Hieroglyphs"],["Pahawh_Hmong","Pahawh_Hmong"],["Katakana_Or_Hiragana","Katakana_Or_Hiragana"],["Old_Hungarian","Old_Hungarian"],["Old_Italic","Old_Italic"],["Javanese","Javanese"],["Kayah_Li","Kayah_Li"],["Katakana","Katakana"],["Kharoshthi","Kharoshthi"],["Khmer","Khmer"],["Khojki","Khojki"],["Kannada","Kannada"],["Kaithi","Kaithi"],["Tai_Tham","Tai_Tham"],["Lao","Lao"],["Latin","Latin"],["Lepcha","Lepcha"],["Limbu","Limbu"],["Linear_A","Linear_A"],["Linear_B","Linear_B"],["Lycian","Lycian"],["Lydian","Lydian"],["Mahajani","Mahajani"],["Makasar","Makasar"],["Mandaic","Mandaic"],["Manichaean","Manichaean"],["Marchen","Marchen"],["Medefaidrin","Medefaidrin"],["Mende_Kikakui","Mende_Kikakui"],["Meroitic_Cursive","Meroitic_Cursive"],["Meroitic_Hieroglyphs","Meroitic_Hieroglyphs"],["Malayalam","Malayalam"],["Mongolian","Mongolian"],["Mro","Mro"],["Meetei_Mayek","Meetei_Mayek"],["Multani","Multani"],["Myanmar","Myanmar"],["Old_North_Arabian","Old_North_Arabian"],["Nabataean","Nabataean"],["Nko","Nko"],["Nushu","Nushu"],["Ogham","Ogham"],["Ol_Chiki","Ol_Chiki"],["Old_Turkic","Old_Turkic"],["Oriya","Oriya"],["Osage","Osage"],["Osmanya","Osmanya"],["Palmyrene","Palmyrene"],["Pau_Cin_Hau","Pau_Cin_Hau"],["Old_Permic","Old_Permic"],["Phags_Pa","Phags_Pa"],["Inscriptional_Pahlavi","Inscriptional_Pahlavi"],["Psalter_Pahlavi","Psalter_Pahlavi"],["Phoenician","Phoenician"],["Miao","Miao"],["Inscriptional_Parthian","Inscriptional_Parthian"],["Rejang","Rejang"],["Hanifi_Rohingya","Hanifi_Rohingya"],["Runic","Runic"],["Samaritan","Samaritan"],["Old_South_Arabian","Old_South_Arabian"],["Saurashtra","Saurashtra"],["SignWriting","SignWriting"],["Shavian","Shavian"],["Sharada","Sharada"],["Siddham","Siddham"],["Khudawadi","Khudawadi"],["Sinhala","Sinhala"],["Sogdian","Sogdian"],["Old_Sogdian","Old_Sogdian"],["Sora_Sompeng","Sora_Sompeng"],["Soyombo","Soyombo"],["Sundanese","Sundanese"],["Syloti_Nagri","Syloti_Nagri"],["Syriac","Syriac"],["Tagbanwa","Tagbanwa"],["Takri","Takri"],["Tai_Le","Tai_Le"],["New_Tai_Lue","New_Tai_Lue"],["Tamil","Tamil"],["Tangut","Tangut"],["Tai_Viet","Tai_Viet"],["Telugu","Telugu"],["Tifinagh","Tifinagh"],["Tagalog","Tagalog"],["Thaana","Thaana"],["Tibetan","Tibetan"],["Tirhuta","Tirhuta"],["Ugaritic","Ugaritic"],["Vai","Vai"],["Warang_Citi","Warang_Citi"],["Old_Persian","Old_Persian"],["Cuneiform","Cuneiform"],["Yi","Yi"],["Zanabazar_Square","Zanabazar_Square"],["Inherited","Inherited"],["Common","Common"],["Unknown","Unknown"]])],["Script_Extensions",/* @__PURE__ */new Map([["Adlm","Adlam"],["Aghb","Caucasian_Albanian"],["Ahom","Ahom"],["Arab","Arabic"],["Armi","Imperial_Aramaic"],["Armn","Armenian"],["Avst","Avestan"],["Bali","Balinese"],["Bamu","Bamum"],["Bass","Bassa_Vah"],["Batk","Batak"],["Beng","Bengali"],["Bhks","Bhaiksuki"],["Bopo","Bopomofo"],["Brah","Brahmi"],["Brai","Braille"],["Bugi","Buginese"],["Buhd","Buhid"],["Cakm","Chakma"],["Cans","Canadian_Aboriginal"],["Cari","Carian"],["Cham","Cham"],["Cher","Cherokee"],["Copt","Coptic"],["Qaac","Coptic"],["Cprt","Cypriot"],["Cyrl","Cyrillic"],["Deva","Devanagari"],["Dogr","Dogra"],["Dsrt","Deseret"],["Dupl","Duployan"],["Egyp","Egyptian_Hieroglyphs"],["Elba","Elbasan"],["Ethi","Ethiopic"],["Geor","Georgian"],["Glag","Glagolitic"],["Gong","Gunjala_Gondi"],["Gonm","Masaram_Gondi"],["Goth","Gothic"],["Gran","Grantha"],["Grek","Greek"],["Gujr","Gujarati"],["Guru","Gurmukhi"],["Hang","Hangul"],["Hani","Han"],["Hano","Hanunoo"],["Hatr","Hatran"],["Hebr","Hebrew"],["Hira","Hiragana"],["Hluw","Anatolian_Hieroglyphs"],["Hmng","Pahawh_Hmong"],["Hrkt","Katakana_Or_Hiragana"],["Hung","Old_Hungarian"],["Ital","Old_Italic"],["Java","Javanese"],["Kali","Kayah_Li"],["Kana","Katakana"],["Khar","Kharoshthi"],["Khmr","Khmer"],["Khoj","Khojki"],["Knda","Kannada"],["Kthi","Kaithi"],["Lana","Tai_Tham"],["Laoo","Lao"],["Latn","Latin"],["Lepc","Lepcha"],["Limb","Limbu"],["Lina","Linear_A"],["Linb","Linear_B"],["Lisu","Lisu"],["Lyci","Lycian"],["Lydi","Lydian"],["Mahj","Mahajani"],["Maka","Makasar"],["Mand","Mandaic"],["Mani","Manichaean"],["Marc","Marchen"],["Medf","Medefaidrin"],["Mend","Mende_Kikakui"],["Merc","Meroitic_Cursive"],["Mero","Meroitic_Hieroglyphs"],["Mlym","Malayalam"],["Modi","Modi"],["Mong","Mongolian"],["Mroo","Mro"],["Mtei","Meetei_Mayek"],["Mult","Multani"],["Mymr","Myanmar"],["Narb","Old_North_Arabian"],["Nbat","Nabataean"],["Newa","Newa"],["Nkoo","Nko"],["Nshu","Nushu"],["Ogam","Ogham"],["Olck","Ol_Chiki"],["Orkh","Old_Turkic"],["Orya","Oriya"],["Osge","Osage"],["Osma","Osmanya"],["Palm","Palmyrene"],["Pauc","Pau_Cin_Hau"],["Perm","Old_Permic"],["Phag","Phags_Pa"],["Phli","Inscriptional_Pahlavi"],["Phlp","Psalter_Pahlavi"],["Phnx","Phoenician"],["Plrd","Miao"],["Prti","Inscriptional_Parthian"],["Rjng","Rejang"],["Rohg","Hanifi_Rohingya"],["Runr","Runic"],["Samr","Samaritan"],["Sarb","Old_South_Arabian"],["Saur","Saurashtra"],["Sgnw","SignWriting"],["Shaw","Shavian"],["Shrd","Sharada"],["Sidd","Siddham"],["Sind","Khudawadi"],["Sinh","Sinhala"],["Sogd","Sogdian"],["Sogo","Old_Sogdian"],["Sora","Sora_Sompeng"],["Soyo","Soyombo"],["Sund","Sundanese"],["Sylo","Syloti_Nagri"],["Syrc","Syriac"],["Tagb","Tagbanwa"],["Takr","Takri"],["Tale","Tai_Le"],["Talu","New_Tai_Lue"],["Taml","Tamil"],["Tang","Tangut"],["Tavt","Tai_Viet"],["Telu","Telugu"],["Tfng","Tifinagh"],["Tglg","Tagalog"],["Thaa","Thaana"],["Thai","Thai"],["Tibt","Tibetan"],["Tirh","Tirhuta"],["Ugar","Ugaritic"],["Vaii","Vai"],["Wara","Warang_Citi"],["Xpeo","Old_Persian"],["Xsux","Cuneiform"],["Yiii","Yi"],["Zanb","Zanabazar_Square"],["Zinh","Inherited"],["Qaai","Inherited"],["Zyyy","Common"],["Zzzz","Unknown"],["Adlam","Adlam"],["Caucasian_Albanian","Caucasian_Albanian"],["Arabic","Arabic"],["Imperial_Aramaic","Imperial_Aramaic"],["Armenian","Armenian"],["Avestan","Avestan"],["Balinese","Balinese"],["Bamum","Bamum"],["Bassa_Vah","Bassa_Vah"],["Batak","Batak"],["Bengali","Bengali"],["Bhaiksuki","Bhaiksuki"],["Bopomofo","Bopomofo"],["Brahmi","Brahmi"],["Braille","Braille"],["Buginese","Buginese"],["Buhid","Buhid"],["Chakma","Chakma"],["Canadian_Aboriginal","Canadian_Aboriginal"],["Carian","Carian"],["Cherokee","Cherokee"],["Coptic","Coptic"],["Cypriot","Cypriot"],["Cyrillic","Cyrillic"],["Devanagari","Devanagari"],["Dogra","Dogra"],["Deseret","Deseret"],["Duployan","Duployan"],["Egyptian_Hieroglyphs","Egyptian_Hieroglyphs"],["Elbasan","Elbasan"],["Ethiopic","Ethiopic"],["Georgian","Georgian"],["Glagolitic","Glagolitic"],["Gunjala_Gondi","Gunjala_Gondi"],["Masaram_Gondi","Masaram_Gondi"],["Gothic","Gothic"],["Grantha","Grantha"],["Greek","Greek"],["Gujarati","Gujarati"],["Gurmukhi","Gurmukhi"],["Hangul","Hangul"],["Han","Han"],["Hanunoo","Hanunoo"],["Hatran","Hatran"],["Hebrew","Hebrew"],["Hiragana","Hiragana"],["Anatolian_Hieroglyphs","Anatolian_Hieroglyphs"],["Pahawh_Hmong","Pahawh_Hmong"],["Katakana_Or_Hiragana","Katakana_Or_Hiragana"],["Old_Hungarian","Old_Hungarian"],["Old_Italic","Old_Italic"],["Javanese","Javanese"],["Kayah_Li","Kayah_Li"],["Katakana","Katakana"],["Kharoshthi","Kharoshthi"],["Khmer","Khmer"],["Khojki","Khojki"],["Kannada","Kannada"],["Kaithi","Kaithi"],["Tai_Tham","Tai_Tham"],["Lao","Lao"],["Latin","Latin"],["Lepcha","Lepcha"],["Limbu","Limbu"],["Linear_A","Linear_A"],["Linear_B","Linear_B"],["Lycian","Lycian"],["Lydian","Lydian"],["Mahajani","Mahajani"],["Makasar","Makasar"],["Mandaic","Mandaic"],["Manichaean","Manichaean"],["Marchen","Marchen"],["Medefaidrin","Medefaidrin"],["Mende_Kikakui","Mende_Kikakui"],["Meroitic_Cursive","Meroitic_Cursive"],["Meroitic_Hieroglyphs","Meroitic_Hieroglyphs"],["Malayalam","Malayalam"],["Mongolian","Mongolian"],["Mro","Mro"],["Meetei_Mayek","Meetei_Mayek"],["Multani","Multani"],["Myanmar","Myanmar"],["Old_North_Arabian","Old_North_Arabian"],["Nabataean","Nabataean"],["Nko","Nko"],["Nushu","Nushu"],["Ogham","Ogham"],["Ol_Chiki","Ol_Chiki"],["Old_Turkic","Old_Turkic"],["Oriya","Oriya"],["Osage","Osage"],["Osmanya","Osmanya"],["Palmyrene","Palmyrene"],["Pau_Cin_Hau","Pau_Cin_Hau"],["Old_Permic","Old_Permic"],["Phags_Pa","Phags_Pa"],["Inscriptional_Pahlavi","Inscriptional_Pahlavi"],["Psalter_Pahlavi","Psalter_Pahlavi"],["Phoenician","Phoenician"],["Miao","Miao"],["Inscriptional_Parthian","Inscriptional_Parthian"],["Rejang","Rejang"],["Hanifi_Rohingya","Hanifi_Rohingya"],["Runic","Runic"],["Samaritan","Samaritan"],["Old_South_Arabian","Old_South_Arabian"],["Saurashtra","Saurashtra"],["SignWriting","SignWriting"],["Shavian","Shavian"],["Sharada","Sharada"],["Siddham","Siddham"],["Khudawadi","Khudawadi"],["Sinhala","Sinhala"],["Sogdian","Sogdian"],["Old_Sogdian","Old_Sogdian"],["Sora_Sompeng","Sora_Sompeng"],["Soyombo","Soyombo"],["Sundanese","Sundanese"],["Syloti_Nagri","Syloti_Nagri"],["Syriac","Syriac"],["Tagbanwa","Tagbanwa"],["Takri","Takri"],["Tai_Le","Tai_Le"],["New_Tai_Lue","New_Tai_Lue"],["Tamil","Tamil"],["Tangut","Tangut"],["Tai_Viet","Tai_Viet"],["Telugu","Telugu"],["Tifinagh","Tifinagh"],["Tagalog","Tagalog"],["Thaana","Thaana"],["Tibetan","Tibetan"],["Tirhuta","Tirhuta"],["Ugaritic","Ugaritic"],["Vai","Vai"],["Warang_Citi","Warang_Citi"],["Old_Persian","Old_Persian"],["Cuneiform","Cuneiform"],["Yi","Yi"],["Zanabazar_Square","Zanabazar_Square"],["Inherited","Inherited"],["Common","Common"],["Unknown","Unknown"]])]]);var mappings$1=/* @__PURE__ */_mergeNamespaces({__proto__:null,"default":mappings},[mappings]);var require$$1$6=/* @__PURE__ */getAugmentedNamespace(mappings$1);var propertyToValueAliases=require$$1$6;var matchPropertyValue=function(property,value){const aliasToValue=propertyToValueAliases.get(property);if(!aliasToValue){throw new Error(`Unknown property \`${property}\`.`);}const canonicalValue=aliasToValue.get(value);if(canonicalValue){return canonicalValue;}throw new Error(`Unknown value \`${value}\` for property \`${property}\`.`);};var unicodeMatchPropertyValueEcmascript=matchPropertyValue;var unicodeMatchPropertyValueEcmascript$1=/* @__PURE__ */_mergeNamespaces({__proto__:null,"default":unicodeMatchPropertyValueEcmascript},[unicodeMatchPropertyValueEcmascript]);var require$$0$8=/* @__PURE__ */getAugmentedNamespace(unicodeMatchPropertyValueEcmascript$1);var unicodeCanonicalPropertyNamesEcmascript=/* @__PURE__ */new Set(["General_Category","Script","Script_Extensions","Alphabetic","Any","ASCII","ASCII_Hex_Digit","Assigned","Bidi_Control","Bidi_Mirrored","Case_Ignorable","Cased","Changes_When_Casefolded","Changes_When_Casemapped","Changes_When_Lowercased","Changes_When_NFKC_Casefolded","Changes_When_Titlecased","Changes_When_Uppercased","Dash","Default_Ignorable_Code_Point","Deprecated","Diacritic","Emoji","Emoji_Component","Emoji_Modifier","Emoji_Modifier_Base","Emoji_Presentation","Extended_Pictographic","Extender","Grapheme_Base","Grapheme_Extend","Hex_Digit","ID_Continue","ID_Start","Ideographic","IDS_Binary_Operator","IDS_Trinary_Operator","Join_Control","Logical_Order_Exception","Lowercase","Math","Noncharacter_Code_Point","Pattern_Syntax","Pattern_White_Space","Quotation_Mark","Radical","Regional_Indicator","Sentence_Terminal","Soft_Dotted","Terminal_Punctuation","Unified_Ideograph","Uppercase","Variation_Selector","White_Space","XID_Continue","XID_Start"]);var unicodeCanonicalPropertyNamesEcmascript$1=/* @__PURE__ */_mergeNamespaces({__proto__:null,"default":unicodeCanonicalPropertyNamesEcmascript},[unicodeCanonicalPropertyNamesEcmascript]);var require$$0$7=/* @__PURE__ */getAugmentedNamespace(unicodeCanonicalPropertyNamesEcmascript$1);var unicodePropertyAliasesEcmascript=/* @__PURE__ */new Map([["scx","Script_Extensions"],["sc","Script"],["gc","General_Category"],["AHex","ASCII_Hex_Digit"],["Alpha","Alphabetic"],["Bidi_C","Bidi_Control"],["Bidi_M","Bidi_Mirrored"],["Cased","Cased"],["CI","Case_Ignorable"],["CWCF","Changes_When_Casefolded"],["CWCM","Changes_When_Casemapped"],["CWKCF","Changes_When_NFKC_Casefolded"],["CWL","Changes_When_Lowercased"],["CWT","Changes_When_Titlecased"],["CWU","Changes_When_Uppercased"],["Dash","Dash"],["Dep","Deprecated"],["DI","Default_Ignorable_Code_Point"],["Dia","Diacritic"],["Ext","Extender"],["Gr_Base","Grapheme_Base"],["Gr_Ext","Grapheme_Extend"],["Hex","Hex_Digit"],["IDC","ID_Continue"],["Ideo","Ideographic"],["IDS","ID_Start"],["IDSB","IDS_Binary_Operator"],["IDST","IDS_Trinary_Operator"],["Join_C","Join_Control"],["LOE","Logical_Order_Exception"],["Lower","Lowercase"],["Math","Math"],["NChar","Noncharacter_Code_Point"],["Pat_Syn","Pattern_Syntax"],["Pat_WS","Pattern_White_Space"],["QMark","Quotation_Mark"],["Radical","Radical"],["RI","Regional_Indicator"],["SD","Soft_Dotted"],["STerm","Sentence_Terminal"],["Term","Terminal_Punctuation"],["UIdeo","Unified_Ideograph"],["Upper","Uppercase"],["VS","Variation_Selector"],["WSpace","White_Space"],["space","White_Space"],["XIDC","XID_Continue"],["XIDS","XID_Start"]]);var unicodePropertyAliasesEcmascript$1=/* @__PURE__ */_mergeNamespaces({__proto__:null,"default":unicodePropertyAliasesEcmascript},[unicodePropertyAliasesEcmascript]);var require$$3$4=/* @__PURE__ */getAugmentedNamespace(unicodePropertyAliasesEcmascript$1);var canonicalProperties=require$$0$7;var propertyAliases=require$$3$4;var matchProperty=function(property){if(canonicalProperties.has(property)){return property;}if(propertyAliases.has(property)){return propertyAliases.get(property);}throw new Error(`Unknown property: ${property}`);};var unicodeMatchPropertyEcmascript=matchProperty;var unicodeMatchPropertyEcmascript$1=/* @__PURE__ */_mergeNamespaces({__proto__:null,"default":unicodeMatchPropertyEcmascript},[unicodeMatchPropertyEcmascript]);var require$$2$4=/* @__PURE__ */getAugmentedNamespace(unicodeMatchPropertyEcmascript$1);var unicode$3={};var idContinueBool_1$1;var idContinueLargeRegex_1$1;var idStartBool_1$1;var idStartLargeRegex_1$1;var whitespaceBool_1$1;var whitespaceArray_1$1;Object.defineProperty(unicode$3,"__esModule",{value:true});whitespaceArray_1$1=unicode$3.whitespaceArray=[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];whitespaceBool_1$1=unicode$3.whitespaceBool=[false,false,false,false,false,false,false,false,false,true,false,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false];idStartLargeRegex_1$1=unicode$3.idStartLargeRegex=/^[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\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\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\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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-\u2C2E\u2C30-\u2C5E\u2C60-\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-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]$/;idStartBool_1$1=unicode$3.idStartBool=[false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,true,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false];idContinueLargeRegex_1$1=unicode$3.idContinueLargeRegex=/^[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]$/;idContinueBool_1$1=unicode$3.idContinueBool=[false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,true,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false];var unicode$2=/* @__PURE__ */_mergeNamespaces({__proto__:null,get whitespaceArray(){return whitespaceArray_1$1;},get whitespaceBool(){return whitespaceBool_1$1;},get idStartLargeRegex(){return idStartLargeRegex_1$1;},get idStartBool(){return idStartBool_1$1;},get idContinueLargeRegex(){return idContinueLargeRegex_1$1;},get idContinueBool(){return idContinueBool_1$1;},"default":unicode$3},[unicode$3]);var require$$4$2=/* @__PURE__ */getAugmentedNamespace(unicode$2);Object.defineProperty(dist$a,"__esModule",{value:true});var _createClass$d=function(){function defineProperties(target,props){for(var i2=0;i2=this.pattern.length;}},{key:"backreference",value:function backreference(ref){if(ref>this.largestBackreference){this.largestBackreference=ref;}}},{key:"nextCodePoint",value:function nextCodePoint(){if(this.empty()){return null;}if(this.unicode){return String.fromCodePoint(this.pattern.codePointAt(this.index));}return this.pattern.charAt(this.index);}},{key:"skipCodePoint",value:function skipCodePoint(){this.index+=this.nextCodePoint().length;}},{key:"eat",value:function eat(str){if(this.index+str.length>this.pattern.length||this.pattern.slice(this.index,this.index+str.length)!==str){return false;}this.index+=str.length;return true;}},{key:"eatIdentifierCodePoint",value:function eatIdentifierCodePoint(){var characterValue=void 0;var originalIndex=this.index;var character=void 0;if(this.match("\\u")){this.skipCodePoint();characterValue=acceptUnicodeEscape(this);if(!characterValue.matched){this.index=originalIndex;return null;}characterValue=characterValue.value;character=String.fromCodePoint(characterValue);}else{character=this.nextCodePoint();if(character==null){this.index=originalIndex;return null;}this.index+=character.length;characterValue=character.codePointAt(0);}return{character,characterValue};}},{key:"eatIdentifierStart",value:function eatIdentifierStart(){var originalIndex=this.index;var codePoint=this.eatIdentifierCodePoint();if(codePoint===null){this.index=originalIndex;return null;}if(codePoint.character==="_"||codePoint.character==="$"||isIdentifierStart(codePoint.characterValue)){return codePoint.character;}this.index=originalIndex;return null;}},{key:"eatIdentifierPart",value:function eatIdentifierPart(){var originalIndex=this.index;var codePoint=this.eatIdentifierCodePoint();if(codePoint===null){this.index=originalIndex;return null;}if(codePoint.character==="\u200C"||codePoint.character==="\u200D"||codePoint.character==="$"||isIdentifierPart(codePoint.characterValue)){return codePoint.character;}this.index=originalIndex;return null;}},{key:"eatAny",value:function eatAny(){for(var _len=arguments.length,strs=Array(_len),_key=0;_key<_len;_key++){strs[_key]=arguments[_key];}var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=void 0;try{for(var _iterator=strs[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var str=_step.value;if(this.eat(str)){return str;}}}catch(err){_didIteratorError=true;_iteratorError=err;}finally{try{if(!_iteratorNormalCompletion&&_iterator.return){_iterator.return();}}finally{if(_didIteratorError){throw _iteratorError;}}}return null;}},{key:"match",value:function match(str){return this.index+str.length<=this.pattern.length&&this.pattern.slice(this.index,this.index+str.length)===str;}},{key:"matchAny",value:function matchAny(){for(var _len2=arguments.length,strs=Array(_len2),_key2=0;_key2<_len2;_key2++){strs[_key2]=arguments[_key2];}var _iteratorNormalCompletion2=true;var _didIteratorError2=false;var _iteratorError2=void 0;try{for(var _iterator2=strs[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var str=_step2.value;if(this.match(str)){return true;}}}catch(err){_didIteratorError2=true;_iteratorError2=err;}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return){_iterator2.return();}}finally{if(_didIteratorError2){throw _iteratorError2;}}}return false;}},{key:"eatNaturalNumber",value:function eatNaturalNumber(){var _this=this;var characters=[];var eatNumber=function eatNumber2(){var _iteratorNormalCompletion3=true;var _didIteratorError3=false;var _iteratorError3=void 0;try{for(var _iterator3=decimalDigits[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var str=_step3.value;if(_this.eat(str)){characters.push(str);return true;}}}catch(err){_didIteratorError3=true;_iteratorError3=err;}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return){_iterator3.return();}}finally{if(_didIteratorError3){throw _iteratorError3;}}}return false;};while(eatNumber()){}return characters.length===0?null:characters.join("");}}]);return PatternAcceptorState2;}();var _default$b=dist$a["default"]=function(pattern){var _ref=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_ref$unicode=_ref.unicode,unicode2=_ref$unicode===void 0?false:_ref$unicode;var state=new PatternAcceptorState(pattern,unicode2);var accepted=acceptDisjunction(state);if(accepted.matched){if(state.unicode){if(state.largestBackreference>state.capturingGroups){return false;}}if(state.groupingNames.length>0||state.unicode){var _iteratorNormalCompletion4=true;var _didIteratorError4=false;var _iteratorError4=void 0;try{for(var _iterator4=state.backreferenceNames[Symbol.iterator](),_step4;!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=true){var backreferenceName=_step4.value;if(state.groupingNames.indexOf(backreferenceName)===-1){return false;}}}catch(err){_didIteratorError4=true;_iteratorError4=err;}finally{try{if(!_iteratorNormalCompletion4&&_iterator4.return){_iterator4.return();}}finally{if(_didIteratorError4){throw _iteratorError4;}}}}}return accepted.matched;};var backtrackOnFailure=function backtrackOnFailure2(func){return function(state){var savedIndex=state.index;var oldBackreference=state.largestBackreference;var oldCapturingGroups=state.capturingGroups;var val=func(state);if(!val.matched){state.index=savedIndex;state.largestBackreference=oldBackreference;state.capturingGroups=oldCapturingGroups;}return val;};};var acceptUnicodeEscape=backtrackOnFailure(function(state){if(!state.eat("u")){return{matched:false};}if(state.unicode&&state.eat("{")){var _digits=[];while(!state.eat("}")){var digit=state.eatAny.apply(state,_toConsumableArray$6(hexDigits));if(digit===null){return{matched:false};}_digits.push(digit);}var _value=parseInt(_digits.join(""),16);return _value>1114111?{matched:false}:{matched:true,value:_value};}var digits=[0,0,0,0].map(function(){return state.eatAny.apply(state,_toConsumableArray$6(hexDigits));});if(digits.some(function(digit2){return digit2===null;})){return{matched:false};}var value=parseInt(digits.join(""),16);if(state.unicode&&value>=55296&&value<=56319){var surrogatePairValue=backtrackOnFailure(function(subState){if(!subState.eat("\\u")){return{matched:false};}var digits2=[0,0,0,0].map(function(){return subState.eatAny.apply(subState,_toConsumableArray$6(hexDigits));});if(digits2.some(function(digit2){return digit2===null;})){return{matched:false};}var value2=parseInt(digits2.join(""),16);if(value2<56320||value2>=57344){return{matched:false};}return{matched:true,value:65536+((value&1023)<<10)+(value2&1023)};})(state);if(surrogatePairValue.matched){return surrogatePairValue;}}return{matched:true,value};});var acceptDisjunction=function acceptDisjunction2(state,terminator){do{if(terminator!==void 0&&state.eat(terminator)){return{matched:true};}else if(state.match("|")){continue;}if(!acceptAlternative(state,terminator).matched){return{matched:false};}}while(state.eat("|"));return{matched:terminator===void 0||!!state.eat(terminator)};};var acceptAlternative=function acceptAlternative2(state,terminator){while(!state.match("|")&&!state.empty()&&(terminator===void 0||!state.match(terminator))){if(!acceptTerm(state).matched){return{matched:false};}}return{matched:true};};var anyOf=function anyOf2(){for(var _len3=arguments.length,acceptors=Array(_len3),_key3=0;_key3<_len3;_key3++){acceptors[_key3]=arguments[_key3];}return function(state){var _iteratorNormalCompletion5=true;var _didIteratorError5=false;var _iteratorError5=void 0;try{for(var _iterator5=acceptors[Symbol.iterator](),_step5;!(_iteratorNormalCompletion5=(_step5=_iterator5.next()).done);_iteratorNormalCompletion5=true){var predicate=_step5.value;var value=predicate(state);if(value.matched){return value;}}}catch(err){_didIteratorError5=true;_iteratorError5=err;}finally{try{if(!_iteratorNormalCompletion5&&_iterator5.return){_iterator5.return();}}finally{if(_didIteratorError5){throw _iteratorError5;}}}return{matched:false};};};var acceptTerm=function acceptTerm2(state){if(state.unicode){return anyOf(acceptAssertion,acceptQuantified(acceptAtom))(state);}return anyOf(acceptQuantified(acceptQuantifiableAssertion),acceptAssertion,acceptQuantified(acceptAtom))(state);};var acceptLabeledGroup=function acceptLabeledGroup2(predicate){return backtrackOnFailure(function(state){if(!state.eat("(")){return{matched:false};}if(predicate(state)){return acceptDisjunction(state,")");}return{matched:false};});};var acceptQuantifiableAssertion=acceptLabeledGroup(function(state){return!!state.eatAny("?=","?!");});var acceptAssertion=function acceptAssertion2(state){if(state.eatAny("^","$","\\b","\\B")){return{matched:true};}return acceptLabeledGroup(function(subState){return subState.unicode?!!subState.eatAny("?=","?!","?<=","?parseInt(num2)){return{matched:false};}}if(!subState.eat("}")){return{matched:false};}subState.eat("?");return{matched:true};})(state);if(!value.matched){return{matched:!state.unicode};}return value;}else if(state.eatAny("*","+","?")){state.eat("?");}return{matched:true};});};var acceptCharacterExcept=function acceptCharacterExcept2(characters){return function(state){var nextCodePoint=state.nextCodePoint();if(nextCodePoint===null||characters.indexOf(nextCodePoint)!==-1){return{matched:false};}state.skipCodePoint();return{matched:true};};};var acceptPatternCharacter=acceptCharacterExcept(syntaxCharacters);var acceptExtendedPatternCharacter=acceptCharacterExcept(extendedSyntaxCharacters);var acceptInvalidBracedQuantifier=function acceptInvalidBracedQuantifier2(state){return backtrackOnFailure(function(subState){return{matched:!!(subState.eat("{")&&acceptDecimal(subState).matched&&(!subState.eat(",")||subState.match("}")||acceptDecimal(subState).matched)&&subState.eat("}"))};})(state);};var acceptAtom=function acceptAtom2(state){if(state.unicode){return anyOf(acceptPatternCharacter,function(subState){return{matched:!!subState.eat(".")};},backtrackOnFailure(function(subState){return subState.eat("\\")?acceptAtomEscape(subState):{matched:false};}),acceptCharacterClass,acceptLabeledGroup(function(subState){return subState.eat("?:");}),acceptGrouping)(state);}var matched=anyOf(function(subState){return{matched:!!subState.eat(".")};},backtrackOnFailure(function(subState){return subState.eat("\\")?acceptAtomEscape(subState):{matched:false};}),backtrackOnFailure(function(subState){return{matched:subState.eat("\\")&&subState.match("c")};}),acceptCharacterClass,acceptLabeledGroup(function(subState){return subState.eat("?:");}),acceptGrouping)(state);if(!matched.matched&&acceptInvalidBracedQuantifier(state).matched){return{matched:false};}return matched.matched?matched:acceptExtendedPatternCharacter(state);};var acceptGrouping=backtrackOnFailure(function(state){if(!state.eat("(")){return{matched:false};}var groupName=backtrackOnFailure(function(subState){if(!state.eat("?")){return{matched:false};}return acceptGroupName(subState);})(state);if(!acceptDisjunction(state,")").matched){return{matched:false};}if(groupName.matched){if(state.groupingNames.indexOf(groupName.data)!==-1){return{matched:false};}state.groupingNames.push(groupName.data);}state.capturingGroups++;return{matched:true};});var acceptDecimalEscape=backtrackOnFailure(function(state){var firstDecimal=state.eatAny.apply(state,_toConsumableArray$6(decimalDigits));if(firstDecimal===null){return{matched:false};}if(firstDecimal==="0"){return{matched:true};}state.backreference(parseInt(firstDecimal+(state.eatNaturalNumber()||"")));return{matched:true};});var acceptCharacterClassEscape=function acceptCharacterClassEscape2(state){if(state.eatAny("d","D","s","S","w","W")){return{matched:true};}if(state.unicode){return backtrackOnFailure(function(subState){if(!subState.eat("p{")&&!subState.eat("P{")){return{matched:false};}if(!acceptUnicodePropertyValueExpression(subState).matched){return{matched:false};}return{matched:!!subState.eat("}")};})(state);}return{matched:false};};var acceptUnicodePropertyName=function acceptUnicodePropertyName2(state){var characters=[];var character=void 0;while(character=state.eatAny.apply(state,_toConsumableArray$6(controlCharacters).concat(["_"]))){characters.push(character);}return{matched:characters.length>0,data:characters.join("")};};var acceptUnicodePropertyValue=function acceptUnicodePropertyValue2(state){var characters=[];var character=void 0;while(character=state.eatAny.apply(state,_toConsumableArray$6(controlCharacters).concat(_toConsumableArray$6(decimalDigits),["_"]))){characters.push(character);}return{matched:characters.length>0,data:characters.join("")};};var illegalLoneUnicodePropertyNames=["General_Category","Script","Script_Extensions","scx","sc","gc"];var generalCategoryValues=_mappings2["default"].get("General_Category");var acceptLoneUnicodePropertyNameOrValue=function acceptLoneUnicodePropertyNameOrValue2(state){var loneValue=acceptUnicodePropertyValue(state);if(!loneValue.matched||illegalLoneUnicodePropertyNames.includes(loneValue.data)){return{matched:false};}return{matched:catchIsFalse(function(){return(0,_unicodeMatchPropertyEcmascript2.default)(loneValue.data);})||generalCategoryValues.get(loneValue.data)!=null};};var acceptUnicodePropertyValueExpression=function acceptUnicodePropertyValueExpression2(state){return anyOf(backtrackOnFailure(function(subState){var name=acceptUnicodePropertyName(subState);if(!name.matched||!subState.eat("=")){return{matched:false};}var value=acceptUnicodePropertyValue(subState);if(!value.matched){return{matched:false};}return{matched:catchIsFalse(function(){return(0,_unicodeMatchPropertyValueEcmascript2.default)(_unicodePropertyAliasesEcmascript2.default.get(name.data)||name.data,value.data);})};}),backtrackOnFailure(acceptLoneUnicodePropertyNameOrValue))(state);};var acceptCharacterEscape=anyOf(function(state){var eaten=state.eatAny.apply(state,_toConsumableArray$6(controlEscapeCharacters));if(eaten===null){return{matched:false};}return{matched:true,value:controlEscapeCharacterValues[eaten]};},backtrackOnFailure(function(state){if(!state.eat("c")){return{matched:false};}var character=state.eatAny.apply(state,_toConsumableArray$6(controlCharacters));if(character===null){return{matched:false};}return{matched:true,value:character.charCodeAt(0)%32};}),backtrackOnFailure(function(state){if(!state.eat("0")||state.eatAny.apply(state,_toConsumableArray$6(decimalDigits))){return{matched:false};}return{matched:true,value:0};}),backtrackOnFailure(function(state){if(!state.eat("x")){return{matched:false};}var digits=[0,0].map(function(){return state.eatAny.apply(state,_toConsumableArray$6(hexDigits));});if(digits.some(function(value){return value===null;})){return{matched:false};}return{matched:true,value:parseInt(digits.join(""),16)};}),acceptUnicodeEscape,backtrackOnFailure(function(state){if(state.unicode){return{matched:false};}var octal1=state.eatAny.apply(state,_toConsumableArray$6(octalDigits));if(octal1===null){return{matched:false};}var octal1Value=parseInt(octal1,8);if(octalDigits.indexOf(state.nextCodePoint())===-1){return{matched:true,value:octal1Value};}var octal2=state.eatAny.apply(state,_toConsumableArray$6(octalDigits));var octal2Value=parseInt(octal2,8);if(octal1Value<4){if(octalDigits.indexOf(state.nextCodePoint())===-1){return{matched:true,value:octal1Value<<3|octal2Value};}var octal3=state.eatAny.apply(state,_toConsumableArray$6(octalDigits));var octal3Value=parseInt(octal3,8);return{matched:true,value:octal1Value<<6|octal2Value<<3|octal3Value};}return{matched:true,value:octal1Value<<3|octal2Value};}),backtrackOnFailure(function(state){if(!state.unicode){return{matched:false};}var value=state.eatAny.apply(state,_toConsumableArray$6(syntaxCharacters));if(value===null){return{matched:false};}return{matched:true,value:value.charCodeAt(0)};}),function(state){if(!state.unicode||!state.eat("/")){return{matched:false};}return{matched:true,value:"/".charCodeAt(0)};},backtrackOnFailure(function(state){if(state.unicode){return{matched:false};}var next2=state.nextCodePoint();if(next2!==null&&next2!=="c"&&next2!=="k"){state.skipCodePoint();return{matched:true,value:next2.codePointAt(0)};}return{matched:false};}));var acceptGroupNameBackreference=backtrackOnFailure(function(state){if(!state.eat("k")){return{matched:false};}var name=acceptGroupName(state);if(!name.matched){state.backreferenceNames.push(INVALID_NAMED_BACKREFERENCE_SENTINEL);return{matched:true};}state.backreferenceNames.push(name.data);return{matched:true};});var acceptGroupName=backtrackOnFailure(function(state){if(!state.eat("<")){return{matched:false};}var characters=[];var start=state.eatIdentifierStart();if(!start){return{matched:false};}characters.push(start);var part=void 0;while(part=state.eatIdentifierPart()){characters.push(part);}if(!state.eat(">")){return{matched:false};}return{matched:characters.length>0,data:characters.join("")};});var acceptAtomEscape=anyOf(acceptDecimalEscape,acceptCharacterClassEscape,acceptCharacterEscape,acceptGroupNameBackreference);var acceptCharacterClass=backtrackOnFailure(function(state){if(!state.eat("[")){return{matched:false};}state.eat("^");var acceptClassEscape=anyOf(function(subState){return{matched:!!subState.eat("b"),value:8};},function(subState){return{matched:subState.unicode&&!!subState.eat("-"),value:"-".charCodeAt(0)};},backtrackOnFailure(function(subState){if(subState.unicode||!subState.eat("c")){return{matched:false};}var character=subState.eatAny.apply(subState,_toConsumableArray$6(decimalDigits).concat(["_"]));if(character===null){return{matched:false};}return{matched:true,value:character.charCodeAt(0)%32};}),acceptCharacterClassEscape,acceptCharacterEscape,function(subState){return{matched:!subState.unicode&&!!subState.eat("k"),value:107};});var acceptClassAtomNoDash=function acceptClassAtomNoDash2(localState){var nextCodePoint=localState.nextCodePoint();if(nextCodePoint==="]"||nextCodePoint==="-"||nextCodePoint===null){return{matched:false};}if(nextCodePoint!=="\\"){localState.skipCodePoint();return{matched:true,value:nextCodePoint.codePointAt(0)};}localState.eat("\\");var classEscape=acceptClassEscape(localState);if(!classEscape.matched&&localState.nextCodePoint()==="c"&&!localState.unicode){return{matched:true,value:"\\".charCodeAt(0)};}return classEscape;};var acceptClassAtom=function acceptClassAtom2(localState){if(localState.eat("-")){return{matched:true,value:"-".charCodeAt(0)};}return acceptClassAtomNoDash(localState);};var finishClassRange=function finishClassRange2(localState,atom){var isUnvaluedPassedAtom=function isUnvaluedPassedAtom2(subAtom){return subAtom.value===void 0&&subAtom.matched;};if(localState.eat("-")){if(localState.match("]")){return{matched:true};}var otherAtom=acceptClassAtom(localState);if(!otherAtom.matched){return{matched:false};}if(localState.unicode&&(isUnvaluedPassedAtom(atom)||isUnvaluedPassedAtom(otherAtom))){return{matched:false};}else if(!(!localState.unicode&&(isUnvaluedPassedAtom(atom)||isUnvaluedPassedAtom(otherAtom)))&&atom.value>otherAtom.value){return{matched:false};}else if(localState.match("]")){return{matched:true};}return acceptNonEmptyClassRanges(localState);}if(localState.match("]")){return{matched:true};}return acceptNonEmptyClassRangesNoDash(localState);};var acceptNonEmptyClassRanges=function acceptNonEmptyClassRanges2(localState){var atom=acceptClassAtom(localState);return atom.matched?finishClassRange(localState,atom):{matched:false};};var acceptNonEmptyClassRangesNoDash=function acceptNonEmptyClassRangesNoDash2(localState){var atom=acceptClassAtomNoDash(localState);return atom.matched?finishClassRange(localState,atom):{matched:false};};if(state.eat("]")){return{matched:true};}var value=acceptNonEmptyClassRanges(state);if(value.matched){state.eat("]");}return value;});var dist$9=/* @__PURE__ */_mergeNamespaces({__proto__:null,"default":_default$b},[dist$a]);var require$$1$5=/* @__PURE__ */getAugmentedNamespace(dist$9);var dist$8={};var YieldGeneratorExpression_1$1;var YieldExpression_1$1;var WithStatement_1$1;var WhileStatement_1$1;var VariableDeclarator_1$1;var VariableDeclarationStatement_1$1;var VariableDeclaration_1$1;var UpdateExpression_1$1;var UnaryExpression_1$1;var TryFinallyStatement_1$1;var TryCatchStatement_1$1;var ThrowStatement_1$1;var ThisExpression_1$1;var TemplateExpression_1$1;var TemplateElement_1$1;var SwitchStatementWithDefault_1$1;var SwitchStatement_1$1;var SwitchDefault_1$1;var SwitchCase_1$1;var Super_1$1;var StaticPropertyName_1$1;var StaticMemberExpression_1$1;var StaticMemberAssignmentTarget_1$1;var SpreadProperty_1$1;var SpreadElement_1$1;var ShorthandProperty_1$1;var Setter_1$1;var Script_1$1;var ReturnStatement_1$1;var ObjectExpression_1$1;var ObjectBinding_1$1;var ObjectAssignmentTarget_1$1;var NewTargetExpression_1$1;var NewExpression_1$1;var Module_1$1;var Method_1$1;var LiteralStringExpression_1$1;var LiteralRegExpExpression_1$1;var LiteralNumericExpression_1$1;var LiteralNullExpression_1$1;var LiteralInfinityExpression_1$1;var LiteralBooleanExpression_1$1;var LabeledStatement_1$1;var ImportSpecifier_1$1;var ImportNamespace_1$1;var Import_1$1;var IfStatement_1$1;var IdentifierExpression_1$1;var Getter_1$1;var FunctionExpression_1$1;var FunctionDeclaration_1$1;var FunctionBody_1$1;var FormalParameters_1$1;var ForStatement_1$1;var ForOfStatement_1$1;var ForInStatement_1$1;var ForAwaitStatement_1$1;var ExpressionStatement_1$1;var ExportLocals_1$1;var ExportLocalSpecifier_1$1;var ExportFromSpecifier_1$1;var ExportFrom_1$1;var ExportDefault_1$1;var ExportAllFrom_1$1;var Export_1$1;var EmptyStatement_1$1;var DoWhileStatement_1$1;var Directive_1$1;var DebuggerStatement_1$1;var DataProperty_1$1;var ContinueStatement_1$1;var ConditionalExpression_1$1;var ComputedPropertyName_1$1;var ComputedMemberExpression_1$1;var ComputedMemberAssignmentTarget_1$1;var CompoundAssignmentExpression_1$1;var ClassExpression_1$1;var ClassElement_1$1;var ClassDeclaration_1$1;var CatchClause_1$1;var CallExpression_1$1;var BreakStatement_1$1;var BlockStatement_1$1;var Block_1$1;var BindingWithDefault_1$1;var BindingPropertyProperty_1$1;var BindingPropertyIdentifier_1$1;var BindingIdentifier_1$1;var BinaryExpression_1$1;var AwaitExpression_1$1;var AssignmentTargetWithDefault_1$1;var AssignmentTargetPropertyProperty_1$1;var AssignmentTargetPropertyIdentifier_1$1;var AssignmentTargetIdentifier_1$1;var AssignmentExpression_1$1;var ArrowExpression_1$1;var ArrayExpression_1$1;var ArrayBinding_1$1;var ArrayAssignmentTarget_1$1;Object.defineProperty(dist$8,"__esModule",{value:true});function _classCallCheck$g(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}ArrayAssignmentTarget_1$1=dist$8.ArrayAssignmentTarget=function ArrayAssignmentTarget(_ref){var elements=_ref.elements,rest=_ref.rest;_classCallCheck$g(this,ArrayAssignmentTarget);this.type="ArrayAssignmentTarget";this.elements=elements;this.rest=rest;};ArrayBinding_1$1=dist$8.ArrayBinding=function ArrayBinding(_ref2){var elements=_ref2.elements,rest=_ref2.rest;_classCallCheck$g(this,ArrayBinding);this.type="ArrayBinding";this.elements=elements;this.rest=rest;};ArrayExpression_1$1=dist$8.ArrayExpression=function ArrayExpression(_ref3){var elements=_ref3.elements;_classCallCheck$g(this,ArrayExpression);this.type="ArrayExpression";this.elements=elements;};ArrowExpression_1$1=dist$8.ArrowExpression=function ArrowExpression(_ref4){var isAsync=_ref4.isAsync,params=_ref4.params,body=_ref4.body;_classCallCheck$g(this,ArrowExpression);this.type="ArrowExpression";this.isAsync=isAsync;this.params=params;this.body=body;};AssignmentExpression_1$1=dist$8.AssignmentExpression=function AssignmentExpression(_ref5){var binding=_ref5.binding,expression=_ref5.expression;_classCallCheck$g(this,AssignmentExpression);this.type="AssignmentExpression";this.binding=binding;this.expression=expression;};AssignmentTargetIdentifier_1$1=dist$8.AssignmentTargetIdentifier=function AssignmentTargetIdentifier(_ref6){var name=_ref6.name;_classCallCheck$g(this,AssignmentTargetIdentifier);this.type="AssignmentTargetIdentifier";this.name=name;};AssignmentTargetPropertyIdentifier_1$1=dist$8.AssignmentTargetPropertyIdentifier=function AssignmentTargetPropertyIdentifier(_ref7){var binding=_ref7.binding,init=_ref7.init;_classCallCheck$g(this,AssignmentTargetPropertyIdentifier);this.type="AssignmentTargetPropertyIdentifier";this.binding=binding;this.init=init;};AssignmentTargetPropertyProperty_1$1=dist$8.AssignmentTargetPropertyProperty=function AssignmentTargetPropertyProperty(_ref8){var name=_ref8.name,binding=_ref8.binding;_classCallCheck$g(this,AssignmentTargetPropertyProperty);this.type="AssignmentTargetPropertyProperty";this.name=name;this.binding=binding;};AssignmentTargetWithDefault_1$1=dist$8.AssignmentTargetWithDefault=function AssignmentTargetWithDefault(_ref9){var binding=_ref9.binding,init=_ref9.init;_classCallCheck$g(this,AssignmentTargetWithDefault);this.type="AssignmentTargetWithDefault";this.binding=binding;this.init=init;};AwaitExpression_1$1=dist$8.AwaitExpression=function AwaitExpression(_ref10){var expression=_ref10.expression;_classCallCheck$g(this,AwaitExpression);this.type="AwaitExpression";this.expression=expression;};BinaryExpression_1$1=dist$8.BinaryExpression=function BinaryExpression(_ref11){var left=_ref11.left,operator=_ref11.operator,right=_ref11.right;_classCallCheck$g(this,BinaryExpression);this.type="BinaryExpression";this.left=left;this.operator=operator;this.right=right;};BindingIdentifier_1$1=dist$8.BindingIdentifier=function BindingIdentifier(_ref12){var name=_ref12.name;_classCallCheck$g(this,BindingIdentifier);this.type="BindingIdentifier";this.name=name;};BindingPropertyIdentifier_1$1=dist$8.BindingPropertyIdentifier=function BindingPropertyIdentifier(_ref13){var binding=_ref13.binding,init=_ref13.init;_classCallCheck$g(this,BindingPropertyIdentifier);this.type="BindingPropertyIdentifier";this.binding=binding;this.init=init;};BindingPropertyProperty_1$1=dist$8.BindingPropertyProperty=function BindingPropertyProperty(_ref14){var name=_ref14.name,binding=_ref14.binding;_classCallCheck$g(this,BindingPropertyProperty);this.type="BindingPropertyProperty";this.name=name;this.binding=binding;};BindingWithDefault_1$1=dist$8.BindingWithDefault=function BindingWithDefault(_ref15){var binding=_ref15.binding,init=_ref15.init;_classCallCheck$g(this,BindingWithDefault);this.type="BindingWithDefault";this.binding=binding;this.init=init;};Block_1$1=dist$8.Block=function Block(_ref16){var statements=_ref16.statements;_classCallCheck$g(this,Block);this.type="Block";this.statements=statements;};BlockStatement_1$1=dist$8.BlockStatement=function BlockStatement(_ref17){var block=_ref17.block;_classCallCheck$g(this,BlockStatement);this.type="BlockStatement";this.block=block;};BreakStatement_1$1=dist$8.BreakStatement=function BreakStatement(_ref18){var label=_ref18.label;_classCallCheck$g(this,BreakStatement);this.type="BreakStatement";this.label=label;};CallExpression_1$1=dist$8.CallExpression=function CallExpression(_ref19){var callee=_ref19.callee,_arguments=_ref19.arguments;_classCallCheck$g(this,CallExpression);this.type="CallExpression";this.callee=callee;this.arguments=_arguments;};CatchClause_1$1=dist$8.CatchClause=function CatchClause(_ref20){var binding=_ref20.binding,body=_ref20.body;_classCallCheck$g(this,CatchClause);this.type="CatchClause";this.binding=binding;this.body=body;};ClassDeclaration_1$1=dist$8.ClassDeclaration=function ClassDeclaration(_ref21){var name=_ref21.name,_super=_ref21.super,elements=_ref21.elements;_classCallCheck$g(this,ClassDeclaration);this.type="ClassDeclaration";this.name=name;this.super=_super;this.elements=elements;};ClassElement_1$1=dist$8.ClassElement=function ClassElement(_ref22){var isStatic=_ref22.isStatic,method=_ref22.method;_classCallCheck$g(this,ClassElement);this.type="ClassElement";this.isStatic=isStatic;this.method=method;};ClassExpression_1$1=dist$8.ClassExpression=function ClassExpression(_ref23){var name=_ref23.name,_super=_ref23.super,elements=_ref23.elements;_classCallCheck$g(this,ClassExpression);this.type="ClassExpression";this.name=name;this.super=_super;this.elements=elements;};CompoundAssignmentExpression_1$1=dist$8.CompoundAssignmentExpression=function CompoundAssignmentExpression(_ref24){var binding=_ref24.binding,operator=_ref24.operator,expression=_ref24.expression;_classCallCheck$g(this,CompoundAssignmentExpression);this.type="CompoundAssignmentExpression";this.binding=binding;this.operator=operator;this.expression=expression;};ComputedMemberAssignmentTarget_1$1=dist$8.ComputedMemberAssignmentTarget=function ComputedMemberAssignmentTarget(_ref25){var object=_ref25.object,expression=_ref25.expression;_classCallCheck$g(this,ComputedMemberAssignmentTarget);this.type="ComputedMemberAssignmentTarget";this.object=object;this.expression=expression;};ComputedMemberExpression_1$1=dist$8.ComputedMemberExpression=function ComputedMemberExpression(_ref26){var object=_ref26.object,expression=_ref26.expression;_classCallCheck$g(this,ComputedMemberExpression);this.type="ComputedMemberExpression";this.object=object;this.expression=expression;};ComputedPropertyName_1$1=dist$8.ComputedPropertyName=function ComputedPropertyName(_ref27){var expression=_ref27.expression;_classCallCheck$g(this,ComputedPropertyName);this.type="ComputedPropertyName";this.expression=expression;};ConditionalExpression_1$1=dist$8.ConditionalExpression=function ConditionalExpression(_ref28){var test=_ref28.test,consequent=_ref28.consequent,alternate=_ref28.alternate;_classCallCheck$g(this,ConditionalExpression);this.type="ConditionalExpression";this.test=test;this.consequent=consequent;this.alternate=alternate;};ContinueStatement_1$1=dist$8.ContinueStatement=function ContinueStatement(_ref29){var label=_ref29.label;_classCallCheck$g(this,ContinueStatement);this.type="ContinueStatement";this.label=label;};DataProperty_1$1=dist$8.DataProperty=function DataProperty(_ref30){var name=_ref30.name,expression=_ref30.expression;_classCallCheck$g(this,DataProperty);this.type="DataProperty";this.name=name;this.expression=expression;};DebuggerStatement_1$1=dist$8.DebuggerStatement=function DebuggerStatement(){_classCallCheck$g(this,DebuggerStatement);this.type="DebuggerStatement";};Directive_1$1=dist$8.Directive=function Directive(_ref31){var rawValue=_ref31.rawValue;_classCallCheck$g(this,Directive);this.type="Directive";this.rawValue=rawValue;};DoWhileStatement_1$1=dist$8.DoWhileStatement=function DoWhileStatement(_ref32){var body=_ref32.body,test=_ref32.test;_classCallCheck$g(this,DoWhileStatement);this.type="DoWhileStatement";this.body=body;this.test=test;};EmptyStatement_1$1=dist$8.EmptyStatement=function EmptyStatement(){_classCallCheck$g(this,EmptyStatement);this.type="EmptyStatement";};Export_1$1=dist$8.Export=function Export(_ref33){var declaration=_ref33.declaration;_classCallCheck$g(this,Export);this.type="Export";this.declaration=declaration;};ExportAllFrom_1$1=dist$8.ExportAllFrom=function ExportAllFrom(_ref34){var moduleSpecifier=_ref34.moduleSpecifier;_classCallCheck$g(this,ExportAllFrom);this.type="ExportAllFrom";this.moduleSpecifier=moduleSpecifier;};ExportDefault_1$1=dist$8.ExportDefault=function ExportDefault(_ref35){var body=_ref35.body;_classCallCheck$g(this,ExportDefault);this.type="ExportDefault";this.body=body;};ExportFrom_1$1=dist$8.ExportFrom=function ExportFrom(_ref36){var namedExports=_ref36.namedExports,moduleSpecifier=_ref36.moduleSpecifier;_classCallCheck$g(this,ExportFrom);this.type="ExportFrom";this.namedExports=namedExports;this.moduleSpecifier=moduleSpecifier;};ExportFromSpecifier_1$1=dist$8.ExportFromSpecifier=function ExportFromSpecifier(_ref37){var name=_ref37.name,exportedName=_ref37.exportedName;_classCallCheck$g(this,ExportFromSpecifier);this.type="ExportFromSpecifier";this.name=name;this.exportedName=exportedName;};ExportLocalSpecifier_1$1=dist$8.ExportLocalSpecifier=function ExportLocalSpecifier(_ref38){var name=_ref38.name,exportedName=_ref38.exportedName;_classCallCheck$g(this,ExportLocalSpecifier);this.type="ExportLocalSpecifier";this.name=name;this.exportedName=exportedName;};ExportLocals_1$1=dist$8.ExportLocals=function ExportLocals(_ref39){var namedExports=_ref39.namedExports;_classCallCheck$g(this,ExportLocals);this.type="ExportLocals";this.namedExports=namedExports;};ExpressionStatement_1$1=dist$8.ExpressionStatement=function ExpressionStatement(_ref40){var expression=_ref40.expression;_classCallCheck$g(this,ExpressionStatement);this.type="ExpressionStatement";this.expression=expression;};ForAwaitStatement_1$1=dist$8.ForAwaitStatement=function ForAwaitStatement(_ref41){var left=_ref41.left,right=_ref41.right,body=_ref41.body;_classCallCheck$g(this,ForAwaitStatement);this.type="ForAwaitStatement";this.left=left;this.right=right;this.body=body;};ForInStatement_1$1=dist$8.ForInStatement=function ForInStatement(_ref42){var left=_ref42.left,right=_ref42.right,body=_ref42.body;_classCallCheck$g(this,ForInStatement);this.type="ForInStatement";this.left=left;this.right=right;this.body=body;};ForOfStatement_1$1=dist$8.ForOfStatement=function ForOfStatement(_ref43){var left=_ref43.left,right=_ref43.right,body=_ref43.body;_classCallCheck$g(this,ForOfStatement);this.type="ForOfStatement";this.left=left;this.right=right;this.body=body;};ForStatement_1$1=dist$8.ForStatement=function ForStatement(_ref44){var init=_ref44.init,test=_ref44.test,update=_ref44.update,body=_ref44.body;_classCallCheck$g(this,ForStatement);this.type="ForStatement";this.init=init;this.test=test;this.update=update;this.body=body;};FormalParameters_1$1=dist$8.FormalParameters=function FormalParameters(_ref45){var items=_ref45.items,rest=_ref45.rest;_classCallCheck$g(this,FormalParameters);this.type="FormalParameters";this.items=items;this.rest=rest;};FunctionBody_1$1=dist$8.FunctionBody=function FunctionBody(_ref46){var directives=_ref46.directives,statements=_ref46.statements;_classCallCheck$g(this,FunctionBody);this.type="FunctionBody";this.directives=directives;this.statements=statements;};FunctionDeclaration_1$1=dist$8.FunctionDeclaration=function FunctionDeclaration(_ref47){var isAsync=_ref47.isAsync,isGenerator=_ref47.isGenerator,name=_ref47.name,params=_ref47.params,body=_ref47.body;_classCallCheck$g(this,FunctionDeclaration);this.type="FunctionDeclaration";this.isAsync=isAsync;this.isGenerator=isGenerator;this.name=name;this.params=params;this.body=body;};FunctionExpression_1$1=dist$8.FunctionExpression=function FunctionExpression(_ref48){var isAsync=_ref48.isAsync,isGenerator=_ref48.isGenerator,name=_ref48.name,params=_ref48.params,body=_ref48.body;_classCallCheck$g(this,FunctionExpression);this.type="FunctionExpression";this.isAsync=isAsync;this.isGenerator=isGenerator;this.name=name;this.params=params;this.body=body;};Getter_1$1=dist$8.Getter=function Getter(_ref49){var name=_ref49.name,body=_ref49.body;_classCallCheck$g(this,Getter);this.type="Getter";this.name=name;this.body=body;};IdentifierExpression_1$1=dist$8.IdentifierExpression=function IdentifierExpression(_ref50){var name=_ref50.name;_classCallCheck$g(this,IdentifierExpression);this.type="IdentifierExpression";this.name=name;};IfStatement_1$1=dist$8.IfStatement=function IfStatement(_ref51){var test=_ref51.test,consequent=_ref51.consequent,alternate=_ref51.alternate;_classCallCheck$g(this,IfStatement);this.type="IfStatement";this.test=test;this.consequent=consequent;this.alternate=alternate;};Import_1$1=dist$8.Import=function Import(_ref52){var defaultBinding=_ref52.defaultBinding,namedImports=_ref52.namedImports,moduleSpecifier=_ref52.moduleSpecifier;_classCallCheck$g(this,Import);this.type="Import";this.defaultBinding=defaultBinding;this.namedImports=namedImports;this.moduleSpecifier=moduleSpecifier;};ImportNamespace_1$1=dist$8.ImportNamespace=function ImportNamespace(_ref53){var defaultBinding=_ref53.defaultBinding,namespaceBinding=_ref53.namespaceBinding,moduleSpecifier=_ref53.moduleSpecifier;_classCallCheck$g(this,ImportNamespace);this.type="ImportNamespace";this.defaultBinding=defaultBinding;this.namespaceBinding=namespaceBinding;this.moduleSpecifier=moduleSpecifier;};ImportSpecifier_1$1=dist$8.ImportSpecifier=function ImportSpecifier(_ref54){var name=_ref54.name,binding=_ref54.binding;_classCallCheck$g(this,ImportSpecifier);this.type="ImportSpecifier";this.name=name;this.binding=binding;};LabeledStatement_1$1=dist$8.LabeledStatement=function LabeledStatement(_ref55){var label=_ref55.label,body=_ref55.body;_classCallCheck$g(this,LabeledStatement);this.type="LabeledStatement";this.label=label;this.body=body;};LiteralBooleanExpression_1$1=dist$8.LiteralBooleanExpression=function LiteralBooleanExpression(_ref56){var value=_ref56.value;_classCallCheck$g(this,LiteralBooleanExpression);this.type="LiteralBooleanExpression";this.value=value;};LiteralInfinityExpression_1$1=dist$8.LiteralInfinityExpression=function LiteralInfinityExpression(){_classCallCheck$g(this,LiteralInfinityExpression);this.type="LiteralInfinityExpression";};LiteralNullExpression_1$1=dist$8.LiteralNullExpression=function LiteralNullExpression(){_classCallCheck$g(this,LiteralNullExpression);this.type="LiteralNullExpression";};LiteralNumericExpression_1$1=dist$8.LiteralNumericExpression=function LiteralNumericExpression(_ref57){var value=_ref57.value;_classCallCheck$g(this,LiteralNumericExpression);this.type="LiteralNumericExpression";this.value=value;};LiteralRegExpExpression_1$1=dist$8.LiteralRegExpExpression=function LiteralRegExpExpression(_ref58){var pattern=_ref58.pattern,global=_ref58.global,ignoreCase=_ref58.ignoreCase,multiLine=_ref58.multiLine,dotAll=_ref58.dotAll,unicode2=_ref58.unicode,sticky=_ref58.sticky;_classCallCheck$g(this,LiteralRegExpExpression);this.type="LiteralRegExpExpression";this.pattern=pattern;this.global=global;this.ignoreCase=ignoreCase;this.multiLine=multiLine;this.dotAll=dotAll;this.unicode=unicode2;this.sticky=sticky;};LiteralStringExpression_1$1=dist$8.LiteralStringExpression=function LiteralStringExpression(_ref59){var value=_ref59.value;_classCallCheck$g(this,LiteralStringExpression);this.type="LiteralStringExpression";this.value=value;};Method_1$1=dist$8.Method=function Method(_ref60){var isAsync=_ref60.isAsync,isGenerator=_ref60.isGenerator,name=_ref60.name,params=_ref60.params,body=_ref60.body;_classCallCheck$g(this,Method);this.type="Method";this.isAsync=isAsync;this.isGenerator=isGenerator;this.name=name;this.params=params;this.body=body;};Module_1$1=dist$8.Module=function Module(_ref61){var directives=_ref61.directives,items=_ref61.items;_classCallCheck$g(this,Module);this.type="Module";this.directives=directives;this.items=items;};NewExpression_1$1=dist$8.NewExpression=function NewExpression(_ref62){var callee=_ref62.callee,_arguments=_ref62.arguments;_classCallCheck$g(this,NewExpression);this.type="NewExpression";this.callee=callee;this.arguments=_arguments;};NewTargetExpression_1$1=dist$8.NewTargetExpression=function NewTargetExpression(){_classCallCheck$g(this,NewTargetExpression);this.type="NewTargetExpression";};ObjectAssignmentTarget_1$1=dist$8.ObjectAssignmentTarget=function ObjectAssignmentTarget(_ref63){var properties=_ref63.properties,rest=_ref63.rest;_classCallCheck$g(this,ObjectAssignmentTarget);this.type="ObjectAssignmentTarget";this.properties=properties;this.rest=rest;};ObjectBinding_1$1=dist$8.ObjectBinding=function ObjectBinding(_ref64){var properties=_ref64.properties,rest=_ref64.rest;_classCallCheck$g(this,ObjectBinding);this.type="ObjectBinding";this.properties=properties;this.rest=rest;};ObjectExpression_1$1=dist$8.ObjectExpression=function ObjectExpression(_ref65){var properties=_ref65.properties;_classCallCheck$g(this,ObjectExpression);this.type="ObjectExpression";this.properties=properties;};ReturnStatement_1$1=dist$8.ReturnStatement=function ReturnStatement(_ref66){var expression=_ref66.expression;_classCallCheck$g(this,ReturnStatement);this.type="ReturnStatement";this.expression=expression;};Script_1$1=dist$8.Script=function Script(_ref67){var directives=_ref67.directives,statements=_ref67.statements;_classCallCheck$g(this,Script);this.type="Script";this.directives=directives;this.statements=statements;};Setter_1$1=dist$8.Setter=function Setter(_ref68){var name=_ref68.name,param=_ref68.param,body=_ref68.body;_classCallCheck$g(this,Setter);this.type="Setter";this.name=name;this.param=param;this.body=body;};ShorthandProperty_1$1=dist$8.ShorthandProperty=function ShorthandProperty(_ref69){var name=_ref69.name;_classCallCheck$g(this,ShorthandProperty);this.type="ShorthandProperty";this.name=name;};SpreadElement_1$1=dist$8.SpreadElement=function SpreadElement(_ref70){var expression=_ref70.expression;_classCallCheck$g(this,SpreadElement);this.type="SpreadElement";this.expression=expression;};SpreadProperty_1$1=dist$8.SpreadProperty=function SpreadProperty(_ref71){var expression=_ref71.expression;_classCallCheck$g(this,SpreadProperty);this.type="SpreadProperty";this.expression=expression;};StaticMemberAssignmentTarget_1$1=dist$8.StaticMemberAssignmentTarget=function StaticMemberAssignmentTarget(_ref72){var object=_ref72.object,property=_ref72.property;_classCallCheck$g(this,StaticMemberAssignmentTarget);this.type="StaticMemberAssignmentTarget";this.object=object;this.property=property;};StaticMemberExpression_1$1=dist$8.StaticMemberExpression=function StaticMemberExpression(_ref73){var object=_ref73.object,property=_ref73.property;_classCallCheck$g(this,StaticMemberExpression);this.type="StaticMemberExpression";this.object=object;this.property=property;};StaticPropertyName_1$1=dist$8.StaticPropertyName=function StaticPropertyName(_ref74){var value=_ref74.value;_classCallCheck$g(this,StaticPropertyName);this.type="StaticPropertyName";this.value=value;};Super_1$1=dist$8.Super=function Super(){_classCallCheck$g(this,Super);this.type="Super";};SwitchCase_1$1=dist$8.SwitchCase=function SwitchCase(_ref75){var test=_ref75.test,consequent=_ref75.consequent;_classCallCheck$g(this,SwitchCase);this.type="SwitchCase";this.test=test;this.consequent=consequent;};SwitchDefault_1$1=dist$8.SwitchDefault=function SwitchDefault(_ref76){var consequent=_ref76.consequent;_classCallCheck$g(this,SwitchDefault);this.type="SwitchDefault";this.consequent=consequent;};SwitchStatement_1$1=dist$8.SwitchStatement=function SwitchStatement(_ref77){var discriminant=_ref77.discriminant,cases=_ref77.cases;_classCallCheck$g(this,SwitchStatement);this.type="SwitchStatement";this.discriminant=discriminant;this.cases=cases;};SwitchStatementWithDefault_1$1=dist$8.SwitchStatementWithDefault=function SwitchStatementWithDefault(_ref78){var discriminant=_ref78.discriminant,preDefaultCases=_ref78.preDefaultCases,defaultCase=_ref78.defaultCase,postDefaultCases=_ref78.postDefaultCases;_classCallCheck$g(this,SwitchStatementWithDefault);this.type="SwitchStatementWithDefault";this.discriminant=discriminant;this.preDefaultCases=preDefaultCases;this.defaultCase=defaultCase;this.postDefaultCases=postDefaultCases;};TemplateElement_1$1=dist$8.TemplateElement=function TemplateElement(_ref79){var rawValue=_ref79.rawValue;_classCallCheck$g(this,TemplateElement);this.type="TemplateElement";this.rawValue=rawValue;};TemplateExpression_1$1=dist$8.TemplateExpression=function TemplateExpression(_ref80){var tag=_ref80.tag,elements=_ref80.elements;_classCallCheck$g(this,TemplateExpression);this.type="TemplateExpression";this.tag=tag;this.elements=elements;};ThisExpression_1$1=dist$8.ThisExpression=function ThisExpression(){_classCallCheck$g(this,ThisExpression);this.type="ThisExpression";};ThrowStatement_1$1=dist$8.ThrowStatement=function ThrowStatement(_ref81){var expression=_ref81.expression;_classCallCheck$g(this,ThrowStatement);this.type="ThrowStatement";this.expression=expression;};TryCatchStatement_1$1=dist$8.TryCatchStatement=function TryCatchStatement(_ref82){var body=_ref82.body,catchClause=_ref82.catchClause;_classCallCheck$g(this,TryCatchStatement);this.type="TryCatchStatement";this.body=body;this.catchClause=catchClause;};TryFinallyStatement_1$1=dist$8.TryFinallyStatement=function TryFinallyStatement(_ref83){var body=_ref83.body,catchClause=_ref83.catchClause,finalizer=_ref83.finalizer;_classCallCheck$g(this,TryFinallyStatement);this.type="TryFinallyStatement";this.body=body;this.catchClause=catchClause;this.finalizer=finalizer;};UnaryExpression_1$1=dist$8.UnaryExpression=function UnaryExpression(_ref84){var operator=_ref84.operator,operand=_ref84.operand;_classCallCheck$g(this,UnaryExpression);this.type="UnaryExpression";this.operator=operator;this.operand=operand;};UpdateExpression_1$1=dist$8.UpdateExpression=function UpdateExpression(_ref85){var isPrefix=_ref85.isPrefix,operator=_ref85.operator,operand=_ref85.operand;_classCallCheck$g(this,UpdateExpression);this.type="UpdateExpression";this.isPrefix=isPrefix;this.operator=operator;this.operand=operand;};VariableDeclaration_1$1=dist$8.VariableDeclaration=function VariableDeclaration(_ref86){var kind=_ref86.kind,declarators=_ref86.declarators;_classCallCheck$g(this,VariableDeclaration);this.type="VariableDeclaration";this.kind=kind;this.declarators=declarators;};VariableDeclarationStatement_1$1=dist$8.VariableDeclarationStatement=function VariableDeclarationStatement(_ref87){var declaration=_ref87.declaration;_classCallCheck$g(this,VariableDeclarationStatement);this.type="VariableDeclarationStatement";this.declaration=declaration;};VariableDeclarator_1$1=dist$8.VariableDeclarator=function VariableDeclarator(_ref88){var binding=_ref88.binding,init=_ref88.init;_classCallCheck$g(this,VariableDeclarator);this.type="VariableDeclarator";this.binding=binding;this.init=init;};WhileStatement_1$1=dist$8.WhileStatement=function WhileStatement(_ref89){var test=_ref89.test,body=_ref89.body;_classCallCheck$g(this,WhileStatement);this.type="WhileStatement";this.test=test;this.body=body;};WithStatement_1$1=dist$8.WithStatement=function WithStatement(_ref90){var object=_ref90.object,body=_ref90.body;_classCallCheck$g(this,WithStatement);this.type="WithStatement";this.object=object;this.body=body;};YieldExpression_1$1=dist$8.YieldExpression=function YieldExpression(_ref91){var expression=_ref91.expression;_classCallCheck$g(this,YieldExpression);this.type="YieldExpression";this.expression=expression;};YieldGeneratorExpression_1$1=dist$8.YieldGeneratorExpression=function YieldGeneratorExpression(_ref92){var expression=_ref92.expression;_classCallCheck$g(this,YieldGeneratorExpression);this.type="YieldGeneratorExpression";this.expression=expression;};var dist$7=/* @__PURE__ */_mergeNamespaces({__proto__:null,get ArrayAssignmentTarget(){return ArrayAssignmentTarget_1$1;},get ArrayBinding(){return ArrayBinding_1$1;},get ArrayExpression(){return ArrayExpression_1$1;},get ArrowExpression(){return ArrowExpression_1$1;},get AssignmentExpression(){return AssignmentExpression_1$1;},get AssignmentTargetIdentifier(){return AssignmentTargetIdentifier_1$1;},get AssignmentTargetPropertyIdentifier(){return AssignmentTargetPropertyIdentifier_1$1;},get AssignmentTargetPropertyProperty(){return AssignmentTargetPropertyProperty_1$1;},get AssignmentTargetWithDefault(){return AssignmentTargetWithDefault_1$1;},get AwaitExpression(){return AwaitExpression_1$1;},get BinaryExpression(){return BinaryExpression_1$1;},get BindingIdentifier(){return BindingIdentifier_1$1;},get BindingPropertyIdentifier(){return BindingPropertyIdentifier_1$1;},get BindingPropertyProperty(){return BindingPropertyProperty_1$1;},get BindingWithDefault(){return BindingWithDefault_1$1;},get Block(){return Block_1$1;},get BlockStatement(){return BlockStatement_1$1;},get BreakStatement(){return BreakStatement_1$1;},get CallExpression(){return CallExpression_1$1;},get CatchClause(){return CatchClause_1$1;},get ClassDeclaration(){return ClassDeclaration_1$1;},get ClassElement(){return ClassElement_1$1;},get ClassExpression(){return ClassExpression_1$1;},get CompoundAssignmentExpression(){return CompoundAssignmentExpression_1$1;},get ComputedMemberAssignmentTarget(){return ComputedMemberAssignmentTarget_1$1;},get ComputedMemberExpression(){return ComputedMemberExpression_1$1;},get ComputedPropertyName(){return ComputedPropertyName_1$1;},get ConditionalExpression(){return ConditionalExpression_1$1;},get ContinueStatement(){return ContinueStatement_1$1;},get DataProperty(){return DataProperty_1$1;},get DebuggerStatement(){return DebuggerStatement_1$1;},get Directive(){return Directive_1$1;},get DoWhileStatement(){return DoWhileStatement_1$1;},get EmptyStatement(){return EmptyStatement_1$1;},get Export(){return Export_1$1;},get ExportAllFrom(){return ExportAllFrom_1$1;},get ExportDefault(){return ExportDefault_1$1;},get ExportFrom(){return ExportFrom_1$1;},get ExportFromSpecifier(){return ExportFromSpecifier_1$1;},get ExportLocalSpecifier(){return ExportLocalSpecifier_1$1;},get ExportLocals(){return ExportLocals_1$1;},get ExpressionStatement(){return ExpressionStatement_1$1;},get ForAwaitStatement(){return ForAwaitStatement_1$1;},get ForInStatement(){return ForInStatement_1$1;},get ForOfStatement(){return ForOfStatement_1$1;},get ForStatement(){return ForStatement_1$1;},get FormalParameters(){return FormalParameters_1$1;},get FunctionBody(){return FunctionBody_1$1;},get FunctionDeclaration(){return FunctionDeclaration_1$1;},get FunctionExpression(){return FunctionExpression_1$1;},get Getter(){return Getter_1$1;},get IdentifierExpression(){return IdentifierExpression_1$1;},get IfStatement(){return IfStatement_1$1;},get Import(){return Import_1$1;},get ImportNamespace(){return ImportNamespace_1$1;},get ImportSpecifier(){return ImportSpecifier_1$1;},get LabeledStatement(){return LabeledStatement_1$1;},get LiteralBooleanExpression(){return LiteralBooleanExpression_1$1;},get LiteralInfinityExpression(){return LiteralInfinityExpression_1$1;},get LiteralNullExpression(){return LiteralNullExpression_1$1;},get LiteralNumericExpression(){return LiteralNumericExpression_1$1;},get LiteralRegExpExpression(){return LiteralRegExpExpression_1$1;},get LiteralStringExpression(){return LiteralStringExpression_1$1;},get Method(){return Method_1$1;},get Module(){return Module_1$1;},get NewExpression(){return NewExpression_1$1;},get NewTargetExpression(){return NewTargetExpression_1$1;},get ObjectAssignmentTarget(){return ObjectAssignmentTarget_1$1;},get ObjectBinding(){return ObjectBinding_1$1;},get ObjectExpression(){return ObjectExpression_1$1;},get ReturnStatement(){return ReturnStatement_1$1;},get Script(){return Script_1$1;},get Setter(){return Setter_1$1;},get ShorthandProperty(){return ShorthandProperty_1$1;},get SpreadElement(){return SpreadElement_1$1;},get SpreadProperty(){return SpreadProperty_1$1;},get StaticMemberAssignmentTarget(){return StaticMemberAssignmentTarget_1$1;},get StaticMemberExpression(){return StaticMemberExpression_1$1;},get StaticPropertyName(){return StaticPropertyName_1$1;},get Super(){return Super_1$1;},get SwitchCase(){return SwitchCase_1$1;},get SwitchDefault(){return SwitchDefault_1$1;},get SwitchStatement(){return SwitchStatement_1$1;},get SwitchStatementWithDefault(){return SwitchStatementWithDefault_1$1;},get TemplateElement(){return TemplateElement_1$1;},get TemplateExpression(){return TemplateExpression_1$1;},get ThisExpression(){return ThisExpression_1$1;},get ThrowStatement(){return ThrowStatement_1$1;},get TryCatchStatement(){return TryCatchStatement_1$1;},get TryFinallyStatement(){return TryFinallyStatement_1$1;},get UnaryExpression(){return UnaryExpression_1$1;},get UpdateExpression(){return UpdateExpression_1$1;},get VariableDeclaration(){return VariableDeclaration_1$1;},get VariableDeclarationStatement(){return VariableDeclarationStatement_1$1;},get VariableDeclarator(){return VariableDeclarator_1$1;},get WhileStatement(){return WhileStatement_1$1;},get WithStatement(){return WithStatement_1$1;},get YieldExpression(){return YieldExpression_1$1;},get YieldGeneratorExpression(){return YieldGeneratorExpression_1$1;},"default":dist$8},[dist$8]);var require$$3$3=/* @__PURE__ */getAugmentedNamespace(dist$7);Object.defineProperty(parser$1,"__esModule",{value:true});var GenericParser_1=parser$1.GenericParser=void 0;var _createClass$c=function(){function defineProperties(target,props){for(var i2=0;i2":Precedence$1.Relational,"<=":Precedence$1.Relational,">=":Precedence$1.Relational,"in":Precedence$1.Relational,"instanceof":Precedence$1.Relational,"<<":Precedence$1.BitwiseSHIFT,">>":Precedence$1.BitwiseSHIFT,">>>":Precedence$1.BitwiseSHIFT,"+":Precedence$1.Additive,"-":Precedence$1.Additive,"*":Precedence$1.Multiplicative,"%":Precedence$1.Multiplicative,"/":Precedence$1.Multiplicative};function isValidSimpleAssignmentTarget(node){if(node==null)return false;switch(node.type){case"IdentifierExpression":case"ComputedMemberExpression":case"StaticMemberExpression":return true;}return false;}function isPrefixOperator(token){switch(token.type){case _tokenizer.TokenType.INC:case _tokenizer.TokenType.DEC:case _tokenizer.TokenType.ADD:case _tokenizer.TokenType.SUB:case _tokenizer.TokenType.BIT_NOT:case _tokenizer.TokenType.NOT:case _tokenizer.TokenType.DELETE:case _tokenizer.TokenType.VOID:case _tokenizer.TokenType.TYPEOF:return true;}return false;}function isUpdateOperator(token){return token.type===_tokenizer.TokenType.INC||token.type===_tokenizer.TokenType.DEC;}GenericParser_1=parser$1.GenericParser=function(_Tokenizer){_inherits$7(GenericParser,_Tokenizer);function GenericParser(source){_classCallCheck$f(this,GenericParser);var _this=_possibleConstructorReturn$7(this,(GenericParser.__proto__||Object.getPrototypeOf(GenericParser)).call(this,source));_this.allowIn=true;_this.inFunctionBody=false;_this.inParameter=false;_this.allowYieldExpression=false;_this.allowAwaitExpression=false;_this.firstAwaitLocation=null;_this.module=false;_this.moduleIsTheGoalSymbol=false;_this.strict=false;_this.isBindingElement=true;_this.isAssignmentTarget=true;_this.firstExprError=null;return _this;}_createClass$c(GenericParser,[{key:"match",value:function match(subType){return this.lookahead.type===subType;}},{key:"matchIdentifier",value:function matchIdentifier(){switch(this.lookahead.type){case _tokenizer.TokenType.IDENTIFIER:case _tokenizer.TokenType.LET:case _tokenizer.TokenType.YIELD:case _tokenizer.TokenType.ASYNC:return true;case _tokenizer.TokenType.AWAIT:if(!this.moduleIsTheGoalSymbol){if(this.firstAwaitLocation===null){this.firstAwaitLocation=this.getLocation();}return true;}return false;case _tokenizer.TokenType.ESCAPED_KEYWORD:if(this.lookahead.value==="await"&&!this.moduleIsTheGoalSymbol){if(this.firstAwaitLocation===null){this.firstAwaitLocation=this.getLocation();}return true;}return this.lookahead.value==="let"||this.lookahead.value==="yield"||this.lookahead.value==="async";}return false;}},{key:"eat",value:function eat(tokenType){if(this.lookahead.type===tokenType){return this.lex();}return null;}},{key:"expect",value:function expect(tokenType){if(this.lookahead.type===tokenType){return this.lex();}throw this.createUnexpected(this.lookahead);}},{key:"matchContextualKeyword",value:function matchContextualKeyword(keyword2){return this.lookahead.type===_tokenizer.TokenType.IDENTIFIER&&!this.lookahead.escaped&&this.lookahead.value===keyword2;}},{key:"expectContextualKeyword",value:function expectContextualKeyword(keyword2){if(this.lookahead.type===_tokenizer.TokenType.IDENTIFIER&&!this.lookahead.escaped&&this.lookahead.value===keyword2){return this.lex();}throw this.createUnexpected(this.lookahead);}},{key:"eatContextualKeyword",value:function eatContextualKeyword(keyword2){if(this.lookahead.type===_tokenizer.TokenType.IDENTIFIER&&!this.lookahead.escaped&&this.lookahead.value===keyword2){return this.lex();}return null;}},{key:"consumeSemicolon",value:function consumeSemicolon(){if(this.eat(_tokenizer.TokenType.SEMICOLON))return;if(this.hasLineTerminatorBeforeNext)return;if(!this.eof()&&!this.match(_tokenizer.TokenType.RBRACE)){throw this.createUnexpected(this.lookahead);}}},{key:"startNode",value:function startNode(node){return node;}},{key:"copyNode",value:function copyNode(src,dest){return dest;}},{key:"finishNode",value:function finishNode(node){return node;}},{key:"parseModule",value:function parseModule(){this.moduleIsTheGoalSymbol=this.module=this.strict=true;this.lookahead=this.advance();var startState=this.startNode();var _parseBody=this.parseBody(),directives=_parseBody.directives,statements=_parseBody.statements;if(!this.match(_tokenizer.TokenType.EOS)){throw this.createUnexpected(this.lookahead);}return this.finishNode(new AST.Module({directives,items:statements}),startState);}},{key:"parseScript",value:function parseScript(){this.lookahead=this.advance();var startState=this.startNode();var _parseBody2=this.parseBody(),directives=_parseBody2.directives,statements=_parseBody2.statements;if(!this.match(_tokenizer.TokenType.EOS)){throw this.createUnexpected(this.lookahead);}return this.finishNode(new AST.Script({directives,statements}),startState);}},{key:"parseFunctionBody",value:function parseFunctionBody(){var oldInFunctionBody=this.inFunctionBody;var oldModule=this.module;var oldStrict=this.strict;this.inFunctionBody=true;this.module=false;var startState=this.startNode();this.expect(_tokenizer.TokenType.LBRACE);var body=new AST.FunctionBody(this.parseBody());this.expect(_tokenizer.TokenType.RBRACE);body=this.finishNode(body,startState);this.inFunctionBody=oldInFunctionBody;this.module=oldModule;this.strict=oldStrict;return body;}},{key:"parseBody",value:function parseBody(){var directives=[],statements=[],parsingDirectives=true,directiveOctal=null;while(true){if(this.eof()||this.match(_tokenizer.TokenType.RBRACE))break;var token=this.lookahead;var text=token.slice.text;var isStringLiteral=token.type===_tokenizer.TokenType.STRING;var isModule=this.module;var directiveLocation=this.getLocation();var directiveStartState=this.startNode();var stmt=isModule?this.parseModuleItem():this.parseStatementListItem();if(parsingDirectives){if(isStringLiteral&&stmt.type==="ExpressionStatement"&&stmt.expression.type==="LiteralStringExpression"){if(!directiveOctal&&token.octal){directiveOctal=this.createErrorWithLocation(directiveLocation,"Unexpected legacy octal escape sequence: \\"+token.octal);}var rawValue=text.slice(1,-1);if(rawValue==="use strict"){this.strict=true;}directives.push(this.finishNode(new AST.Directive({rawValue}),directiveStartState));}else{parsingDirectives=false;if(directiveOctal&&this.strict){throw directiveOctal;}statements.push(stmt);}}else{statements.push(stmt);}}if(directiveOctal&&this.strict){throw directiveOctal;}return{directives,statements};}},{key:"parseImportSpecifier",value:function parseImportSpecifier(){var startState=this.startNode(),name=void 0;if(this.matchIdentifier()){name=this.parseIdentifier();if(!this.eatContextualKeyword("as")){return this.finishNode(new AST.ImportSpecifier({name:null,binding:this.finishNode(new AST.BindingIdentifier({name}),startState)}),startState);}}else if(this.lookahead.type.klass.isIdentifierName){name=this.parseIdentifierName();this.expectContextualKeyword("as");}return this.finishNode(new AST.ImportSpecifier({name,binding:this.parseBindingIdentifier()}),startState);}},{key:"parseNameSpaceBinding",value:function parseNameSpaceBinding(){this.expect(_tokenizer.TokenType.MUL);this.expectContextualKeyword("as");return this.parseBindingIdentifier();}},{key:"parseNamedImports",value:function parseNamedImports(){var result=[];this.expect(_tokenizer.TokenType.LBRACE);while(!this.eat(_tokenizer.TokenType.RBRACE)){result.push(this.parseImportSpecifier());if(!this.eat(_tokenizer.TokenType.COMMA)){this.expect(_tokenizer.TokenType.RBRACE);break;}}return result;}},{key:"parseFromClause",value:function parseFromClause(){this.expectContextualKeyword("from");var value=this.expect(_tokenizer.TokenType.STRING).str;return value;}},{key:"parseImportDeclaration",value:function parseImportDeclaration(){var startState=this.startNode(),defaultBinding=null,moduleSpecifier=void 0;this.expect(_tokenizer.TokenType.IMPORT);if(this.match(_tokenizer.TokenType.STRING)){moduleSpecifier=this.lex().str;this.consumeSemicolon();return this.finishNode(new AST.Import({defaultBinding:null,namedImports:[],moduleSpecifier}),startState);}if(this.matchIdentifier()){defaultBinding=this.parseBindingIdentifier();if(!this.eat(_tokenizer.TokenType.COMMA)){var decl=new AST.Import({defaultBinding,namedImports:[],moduleSpecifier:this.parseFromClause()});this.consumeSemicolon();return this.finishNode(decl,startState);}}if(this.match(_tokenizer.TokenType.MUL)){var _decl=new AST.ImportNamespace({defaultBinding,namespaceBinding:this.parseNameSpaceBinding(),moduleSpecifier:this.parseFromClause()});this.consumeSemicolon();return this.finishNode(_decl,startState);}else if(this.match(_tokenizer.TokenType.LBRACE)){var _decl2=new AST.Import({defaultBinding,namedImports:this.parseNamedImports(),moduleSpecifier:this.parseFromClause()});this.consumeSemicolon();return this.finishNode(_decl2,startState);}throw this.createUnexpected(this.lookahead);}},{key:"parseExportSpecifier",value:function parseExportSpecifier(){var startState=this.startNode();var name=this.finishNode({type:EXPORT_UNKNOWN_SPECIFIER,isIdentifier:this.matchIdentifier(),value:this.parseIdentifierName()},startState);if(this.eatContextualKeyword("as")){var exportedName=this.parseIdentifierName();return this.finishNode({name,exportedName},startState);}return this.finishNode({name,exportedName:null},startState);}},{key:"parseExportClause",value:function parseExportClause(){this.expect(_tokenizer.TokenType.LBRACE);var result=[];while(!this.eat(_tokenizer.TokenType.RBRACE)){result.push(this.parseExportSpecifier());if(!this.eat(_tokenizer.TokenType.COMMA)){this.expect(_tokenizer.TokenType.RBRACE);break;}}return result;}},{key:"parseExportDeclaration",value:function parseExportDeclaration(){var _this2=this;var startState=this.startNode(),decl=void 0;this.expect(_tokenizer.TokenType.EXPORT);switch(this.lookahead.type){case _tokenizer.TokenType.MUL:this.lex();decl=new AST.ExportAllFrom({moduleSpecifier:this.parseFromClause()});this.consumeSemicolon();break;case _tokenizer.TokenType.LBRACE:{var namedExports=this.parseExportClause();var moduleSpecifier=null;if(this.matchContextualKeyword("from")){moduleSpecifier=this.parseFromClause();decl=new AST.ExportFrom({namedExports:namedExports.map(function(e){return _this2.copyNode(e,new AST.ExportFromSpecifier({name:e.name.value,exportedName:e.exportedName}));}),moduleSpecifier});}else{namedExports.forEach(function(_ref){var name=_ref.name;if(!name.isIdentifier){throw _this2.createError(_errors$1.ErrorMessages.ILLEGAL_EXPORTED_NAME);}});decl=new AST.ExportLocals({namedExports:namedExports.map(function(e){return _this2.copyNode(e,new AST.ExportLocalSpecifier({name:_this2.copyNode(e.name,new AST.IdentifierExpression({name:e.name.value})),exportedName:e.exportedName}));})});}this.consumeSemicolon();break;}case _tokenizer.TokenType.CLASS:decl=new AST.Export({declaration:this.parseClass({isExpr:false,inDefault:false})});break;case _tokenizer.TokenType.FUNCTION:decl=new AST.Export({declaration:this.parseFunction({isExpr:false,inDefault:false,allowGenerator:true,isAsync:false})});break;case _tokenizer.TokenType.ASYNC:{var preAsyncStartState=this.startNode();this.lex();decl=new AST.Export({declaration:this.parseFunction({isExpr:false,inDefault:false,allowGenerator:true,isAsync:true,startState:preAsyncStartState})});break;}case _tokenizer.TokenType.DEFAULT:this.lex();switch(this.lookahead.type){case _tokenizer.TokenType.FUNCTION:decl=new AST.ExportDefault({body:this.parseFunction({isExpr:false,inDefault:true,allowGenerator:true,isAsync:false})});break;case _tokenizer.TokenType.CLASS:decl=new AST.ExportDefault({body:this.parseClass({isExpr:false,inDefault:true})});break;case _tokenizer.TokenType.ASYNC:{var _preAsyncStartState=this.startNode();var lexerState=this.saveLexerState();this.lex();if(!this.hasLineTerminatorBeforeNext&&this.match(_tokenizer.TokenType.FUNCTION)){decl=new AST.ExportDefault({body:this.parseFunction({isExpr:false,inDefault:true,allowGenerator:false,isAsync:true,startState:_preAsyncStartState})});break;}this.restoreLexerState(lexerState);}default:decl=new AST.ExportDefault({body:this.parseAssignmentExpression()});this.consumeSemicolon();break;}break;case _tokenizer.TokenType.VAR:case _tokenizer.TokenType.LET:case _tokenizer.TokenType.CONST:decl=new AST.Export({declaration:this.parseVariableDeclaration(true)});this.consumeSemicolon();break;default:throw this.createUnexpected(this.lookahead);}return this.finishNode(decl,startState);}},{key:"parseModuleItem",value:function parseModuleItem(){switch(this.lookahead.type){case _tokenizer.TokenType.IMPORT:return this.parseImportDeclaration();case _tokenizer.TokenType.EXPORT:return this.parseExportDeclaration();default:return this.parseStatementListItem();}}},{key:"lookaheadLexicalDeclaration",value:function lookaheadLexicalDeclaration(){if(this.match(_tokenizer.TokenType.LET)||this.match(_tokenizer.TokenType.CONST)){var lexerState=this.saveLexerState();this.lex();if(this.matchIdentifier()||this.match(_tokenizer.TokenType.LBRACE)||this.match(_tokenizer.TokenType.LBRACK)){this.restoreLexerState(lexerState);return true;}this.restoreLexerState(lexerState);}return false;}},{key:"parseStatementListItem",value:function parseStatementListItem(){if(this.eof())throw this.createUnexpected(this.lookahead);switch(this.lookahead.type){case _tokenizer.TokenType.FUNCTION:return this.parseFunction({isExpr:false,inDefault:false,allowGenerator:true,isAsync:false});case _tokenizer.TokenType.CLASS:return this.parseClass({isExpr:false,inDefault:false});case _tokenizer.TokenType.ASYNC:{var preAsyncStartState=this.getLocation();var lexerState=this.saveLexerState();this.lex();if(!this.hasLineTerminatorBeforeNext&&this.match(_tokenizer.TokenType.FUNCTION)){return this.parseFunction({isExpr:false,inDefault:false,allowGenerator:true,isAsync:true,startState:preAsyncStartState});}this.restoreLexerState(lexerState);return this.parseStatement();}default:if(this.lookaheadLexicalDeclaration()){var startState=this.startNode();return this.finishNode(this.parseVariableDeclarationStatement(),startState);}return this.parseStatement();}}},{key:"parseStatement",value:function parseStatement(){var startState=this.startNode();var stmt=this.isolateCoverGrammar(this.parseStatementHelper);return this.finishNode(stmt,startState);}},{key:"parseStatementHelper",value:function parseStatementHelper(){if(this.eof()){throw this.createUnexpected(this.lookahead);}switch(this.lookahead.type){case _tokenizer.TokenType.SEMICOLON:return this.parseEmptyStatement();case _tokenizer.TokenType.LBRACE:return this.parseBlockStatement();case _tokenizer.TokenType.LPAREN:return this.parseExpressionStatement();case _tokenizer.TokenType.BREAK:return this.parseBreakStatement();case _tokenizer.TokenType.CONTINUE:return this.parseContinueStatement();case _tokenizer.TokenType.DEBUGGER:return this.parseDebuggerStatement();case _tokenizer.TokenType.DO:return this.parseDoWhileStatement();case _tokenizer.TokenType.FOR:return this.parseForStatement();case _tokenizer.TokenType.IF:return this.parseIfStatement();case _tokenizer.TokenType.RETURN:return this.parseReturnStatement();case _tokenizer.TokenType.SWITCH:return this.parseSwitchStatement();case _tokenizer.TokenType.THROW:return this.parseThrowStatement();case _tokenizer.TokenType.TRY:return this.parseTryStatement();case _tokenizer.TokenType.VAR:return this.parseVariableDeclarationStatement();case _tokenizer.TokenType.WHILE:return this.parseWhileStatement();case _tokenizer.TokenType.WITH:return this.parseWithStatement();case _tokenizer.TokenType.FUNCTION:case _tokenizer.TokenType.CLASS:throw this.createUnexpected(this.lookahead);default:{var lexerState=this.saveLexerState();if(this.eat(_tokenizer.TokenType.LET)){if(this.match(_tokenizer.TokenType.LBRACK)){this.restoreLexerState(lexerState);throw this.createUnexpected(this.lookahead);}this.restoreLexerState(lexerState);}else if(this.eat(_tokenizer.TokenType.ASYNC)){if(!this.hasLineTerminatorBeforeNext&&this.match(_tokenizer.TokenType.FUNCTION)){throw this.createUnexpected(this.lookahead);}this.restoreLexerState(lexerState);}var expr=this.parseExpression();if(expr.type==="IdentifierExpression"&&this.eat(_tokenizer.TokenType.COLON)){var labeledBody=this.match(_tokenizer.TokenType.FUNCTION)?this.parseFunction({isExpr:false,inDefault:false,allowGenerator:false,isAsync:false}):this.parseStatement();return new AST.LabeledStatement({label:expr.name,body:labeledBody});}this.consumeSemicolon();return new AST.ExpressionStatement({expression:expr});}}}},{key:"parseEmptyStatement",value:function parseEmptyStatement(){this.lex();return new AST.EmptyStatement();}},{key:"parseBlockStatement",value:function parseBlockStatement(){return new AST.BlockStatement({block:this.parseBlock()});}},{key:"parseExpressionStatement",value:function parseExpressionStatement(){var expr=this.parseExpression();this.consumeSemicolon();return new AST.ExpressionStatement({expression:expr});}},{key:"parseBreakStatement",value:function parseBreakStatement(){this.lex();if(this.eat(_tokenizer.TokenType.SEMICOLON)||this.hasLineTerminatorBeforeNext){return new AST.BreakStatement({label:null});}var label=null;if(this.matchIdentifier()){label=this.parseIdentifier();}this.consumeSemicolon();return new AST.BreakStatement({label});}},{key:"parseContinueStatement",value:function parseContinueStatement(){this.lex();if(this.eat(_tokenizer.TokenType.SEMICOLON)||this.hasLineTerminatorBeforeNext){return new AST.ContinueStatement({label:null});}var label=null;if(this.matchIdentifier()){label=this.parseIdentifier();}this.consumeSemicolon();return new AST.ContinueStatement({label});}},{key:"parseDebuggerStatement",value:function parseDebuggerStatement(){this.lex();this.consumeSemicolon();return new AST.DebuggerStatement();}},{key:"parseDoWhileStatement",value:function parseDoWhileStatement(){this.lex();var body=this.parseStatement();this.expect(_tokenizer.TokenType.WHILE);this.expect(_tokenizer.TokenType.LPAREN);var test=this.parseExpression();this.expect(_tokenizer.TokenType.RPAREN);this.eat(_tokenizer.TokenType.SEMICOLON);return new AST.DoWhileStatement({body,test});}},{key:"parseForStatement",value:function parseForStatement(){this.lex();var isAwait=this.allowAwaitExpression&&this.eat(_tokenizer.TokenType.AWAIT);this.expect(_tokenizer.TokenType.LPAREN);var test=null;var right=null;if(isAwait&&this.match(_tokenizer.TokenType.SEMICOLON)){throw this.createUnexpected(this.lookahead);}if(this.eat(_tokenizer.TokenType.SEMICOLON)){if(!this.match(_tokenizer.TokenType.SEMICOLON)){test=this.parseExpression();}this.expect(_tokenizer.TokenType.SEMICOLON);if(!this.match(_tokenizer.TokenType.RPAREN)){right=this.parseExpression();}return new AST.ForStatement({init:null,test,update:right,body:this.getIteratorStatementEpilogue()});}var startsWithLet=this.match(_tokenizer.TokenType.LET);var isForDecl=this.lookaheadLexicalDeclaration();var leftStartState=this.startNode();if(this.match(_tokenizer.TokenType.VAR)||isForDecl){var _previousAllowIn=this.allowIn;this.allowIn=false;var init=this.parseVariableDeclaration(false);this.allowIn=_previousAllowIn;if(init.declarators.length===1&&(this.match(_tokenizer.TokenType.IN)||this.matchContextualKeyword("of"))){var ctor=void 0;var decl=init.declarators[0];if(this.match(_tokenizer.TokenType.IN)){if(isAwait){throw this.createUnexpected(this.lookahead);}if(decl.init!==null&&(this.strict||init.kind!=="var"||decl.binding.type!=="BindingIdentifier")){throw this.createError(_errors$1.ErrorMessages.INVALID_VAR_INIT_FOR_IN);}ctor=AST.ForInStatement;this.lex();right=this.parseExpression();}else{if(decl.init!==null){throw this.createError(isAwait?_errors$1.ErrorMessages.INVALID_VAR_INIT_FOR_AWAIT:_errors$1.ErrorMessages.INVALID_VAR_INIT_FOR_OF);}if(isAwait){ctor=AST.ForAwaitStatement;}else{ctor=AST.ForOfStatement;}this.lex();right=this.parseAssignmentExpression();}var body=this.getIteratorStatementEpilogue();return new ctor({left:init,right,body});}else if(isAwait){throw this.createUnexpected(this.lookahead);}this.expect(_tokenizer.TokenType.SEMICOLON);if(init.declarators.some(function(decl2){return decl2.binding.type!=="BindingIdentifier"&&decl2.init===null;})){throw this.createError(_errors$1.ErrorMessages.UNINITIALIZED_BINDINGPATTERN_IN_FOR_INIT);}if(!this.match(_tokenizer.TokenType.SEMICOLON)){test=this.parseExpression();}this.expect(_tokenizer.TokenType.SEMICOLON);if(!this.match(_tokenizer.TokenType.RPAREN)){right=this.parseExpression();}return new AST.ForStatement({init,test,update:right,body:this.getIteratorStatementEpilogue()});}var previousAllowIn=this.allowIn;this.allowIn=false;var expr=this.inheritCoverGrammar(this.parseAssignmentExpressionOrTarget);this.allowIn=previousAllowIn;if(this.isAssignmentTarget&&expr.type!=="AssignmentExpression"&&(this.match(_tokenizer.TokenType.IN)||this.matchContextualKeyword("of"))){if(expr.type==="ObjectAssignmentTarget"||expr.type==="ArrayAssignmentTarget"){this.firstExprError=null;}if(startsWithLet&&this.matchContextualKeyword("of")){throw this.createError(isAwait?_errors$1.ErrorMessages.INVALID_LHS_IN_FOR_AWAIT:_errors$1.ErrorMessages.INVALID_LHS_IN_FOR_OF);}var _ctor=void 0;if(this.match(_tokenizer.TokenType.IN)){if(isAwait){throw this.createUnexpected(this.lookahead);}_ctor=AST.ForInStatement;this.lex();right=this.parseExpression();}else{if(isAwait){_ctor=AST.ForAwaitStatement;}else{_ctor=AST.ForOfStatement;}this.lex();right=this.parseAssignmentExpression();}return new _ctor({left:this.transformDestructuring(expr),right,body:this.getIteratorStatementEpilogue()});}else if(isAwait){throw this.createError(_errors$1.ErrorMessages.INVALID_LHS_IN_FOR_AWAIT);}if(this.firstExprError){throw this.firstExprError;}while(this.eat(_tokenizer.TokenType.COMMA)){var rhs=this.parseAssignmentExpression();expr=this.finishNode(new AST.BinaryExpression({left:expr,operator:",",right:rhs}),leftStartState);}if(this.match(_tokenizer.TokenType.IN)){throw this.createError(_errors$1.ErrorMessages.INVALID_LHS_IN_FOR_IN);}if(this.matchContextualKeyword("of")){throw this.createError(_errors$1.ErrorMessages.INVALID_LHS_IN_FOR_OF);}this.expect(_tokenizer.TokenType.SEMICOLON);if(!this.match(_tokenizer.TokenType.SEMICOLON)){test=this.parseExpression();}this.expect(_tokenizer.TokenType.SEMICOLON);if(!this.match(_tokenizer.TokenType.RPAREN)){right=this.parseExpression();}return new AST.ForStatement({init:expr,test,update:right,body:this.getIteratorStatementEpilogue()});}},{key:"getIteratorStatementEpilogue",value:function getIteratorStatementEpilogue(){this.expect(_tokenizer.TokenType.RPAREN);var body=this.parseStatement();return body;}},{key:"parseIfStatementChild",value:function parseIfStatementChild(){return this.match(_tokenizer.TokenType.FUNCTION)?this.parseFunction({isExpr:false,inDefault:false,allowGenerator:false,isAsync:false}):this.parseStatement();}},{key:"parseIfStatement",value:function parseIfStatement(){this.lex();this.expect(_tokenizer.TokenType.LPAREN);var test=this.parseExpression();this.expect(_tokenizer.TokenType.RPAREN);var consequent=this.parseIfStatementChild();var alternate=null;if(this.eat(_tokenizer.TokenType.ELSE)){alternate=this.parseIfStatementChild();}return new AST.IfStatement({test,consequent,alternate});}},{key:"parseReturnStatement",value:function parseReturnStatement(){if(!this.inFunctionBody){throw this.createError(_errors$1.ErrorMessages.ILLEGAL_RETURN);}this.lex();if(this.eat(_tokenizer.TokenType.SEMICOLON)||this.hasLineTerminatorBeforeNext){return new AST.ReturnStatement({expression:null});}var expression=null;if(!this.match(_tokenizer.TokenType.RBRACE)&&!this.eof()){expression=this.parseExpression();}this.consumeSemicolon();return new AST.ReturnStatement({expression});}},{key:"parseSwitchStatement",value:function parseSwitchStatement(){this.lex();this.expect(_tokenizer.TokenType.LPAREN);var discriminant=this.parseExpression();this.expect(_tokenizer.TokenType.RPAREN);this.expect(_tokenizer.TokenType.LBRACE);if(this.eat(_tokenizer.TokenType.RBRACE)){return new AST.SwitchStatement({discriminant,cases:[]});}var cases=this.parseSwitchCases();if(this.match(_tokenizer.TokenType.DEFAULT)){var defaultCase=this.parseSwitchDefault();var postDefaultCases=this.parseSwitchCases();if(this.match(_tokenizer.TokenType.DEFAULT)){throw this.createError(_errors$1.ErrorMessages.MULTIPLE_DEFAULTS_IN_SWITCH);}this.expect(_tokenizer.TokenType.RBRACE);return new AST.SwitchStatementWithDefault({discriminant,preDefaultCases:cases,defaultCase,postDefaultCases});}this.expect(_tokenizer.TokenType.RBRACE);return new AST.SwitchStatement({discriminant,cases});}},{key:"parseSwitchCases",value:function parseSwitchCases(){var result=[];while(!(this.eof()||this.match(_tokenizer.TokenType.RBRACE)||this.match(_tokenizer.TokenType.DEFAULT))){result.push(this.parseSwitchCase());}return result;}},{key:"parseSwitchCase",value:function parseSwitchCase(){var startState=this.startNode();this.expect(_tokenizer.TokenType.CASE);return this.finishNode(new AST.SwitchCase({test:this.parseExpression(),consequent:this.parseSwitchCaseBody()}),startState);}},{key:"parseSwitchDefault",value:function parseSwitchDefault(){var startState=this.startNode();this.expect(_tokenizer.TokenType.DEFAULT);return this.finishNode(new AST.SwitchDefault({consequent:this.parseSwitchCaseBody()}),startState);}},{key:"parseSwitchCaseBody",value:function parseSwitchCaseBody(){this.expect(_tokenizer.TokenType.COLON);return this.parseStatementListInSwitchCaseBody();}},{key:"parseStatementListInSwitchCaseBody",value:function parseStatementListInSwitchCaseBody(){var result=[];while(!(this.eof()||this.match(_tokenizer.TokenType.RBRACE)||this.match(_tokenizer.TokenType.DEFAULT)||this.match(_tokenizer.TokenType.CASE))){result.push(this.parseStatementListItem());}return result;}},{key:"parseThrowStatement",value:function parseThrowStatement(){var token=this.lex();if(this.hasLineTerminatorBeforeNext){throw this.createErrorWithLocation(token,_errors$1.ErrorMessages.NEWLINE_AFTER_THROW);}var expression=this.parseExpression();this.consumeSemicolon();return new AST.ThrowStatement({expression});}},{key:"parseTryStatement",value:function parseTryStatement(){this.lex();var body=this.parseBlock();if(this.match(_tokenizer.TokenType.CATCH)){var catchClause=this.parseCatchClause();if(this.eat(_tokenizer.TokenType.FINALLY)){var finalizer=this.parseBlock();return new AST.TryFinallyStatement({body,catchClause,finalizer});}return new AST.TryCatchStatement({body,catchClause});}if(this.eat(_tokenizer.TokenType.FINALLY)){var _finalizer=this.parseBlock();return new AST.TryFinallyStatement({body,catchClause:null,finalizer:_finalizer});}throw this.createError(_errors$1.ErrorMessages.NO_CATCH_OR_FINALLY);}},{key:"parseVariableDeclarationStatement",value:function parseVariableDeclarationStatement(){var declaration=this.parseVariableDeclaration(true);this.consumeSemicolon();return new AST.VariableDeclarationStatement({declaration});}},{key:"parseWhileStatement",value:function parseWhileStatement(){this.lex();this.expect(_tokenizer.TokenType.LPAREN);var test=this.parseExpression();var body=this.getIteratorStatementEpilogue();return new AST.WhileStatement({test,body});}},{key:"parseWithStatement",value:function parseWithStatement(){this.lex();this.expect(_tokenizer.TokenType.LPAREN);var object=this.parseExpression();this.expect(_tokenizer.TokenType.RPAREN);var body=this.parseStatement();return new AST.WithStatement({object,body});}},{key:"parseCatchClause",value:function parseCatchClause(){var startState=this.startNode();this.lex();this.expect(_tokenizer.TokenType.LPAREN);if(this.match(_tokenizer.TokenType.RPAREN)||this.match(_tokenizer.TokenType.LPAREN)){throw this.createUnexpected(this.lookahead);}var binding=this.parseBindingTarget();this.expect(_tokenizer.TokenType.RPAREN);var body=this.parseBlock();return this.finishNode(new AST.CatchClause({binding,body}),startState);}},{key:"parseBlock",value:function parseBlock(){var startState=this.startNode();this.expect(_tokenizer.TokenType.LBRACE);var body=[];while(!this.match(_tokenizer.TokenType.RBRACE)){body.push(this.parseStatementListItem());}this.expect(_tokenizer.TokenType.RBRACE);return this.finishNode(new AST.Block({statements:body}),startState);}},{key:"parseVariableDeclaration",value:function parseVariableDeclaration(bindingPatternsMustHaveInit){var startState=this.startNode();var token=this.lex();var kind=token.type===_tokenizer.TokenType.VAR?"var":token.type===_tokenizer.TokenType.CONST?"const":"let";var declarators=this.parseVariableDeclaratorList(bindingPatternsMustHaveInit);return this.finishNode(new AST.VariableDeclaration({kind,declarators}),startState);}},{key:"parseVariableDeclaratorList",value:function parseVariableDeclaratorList(bindingPatternsMustHaveInit){var result=[];do{result.push(this.parseVariableDeclarator(bindingPatternsMustHaveInit));}while(this.eat(_tokenizer.TokenType.COMMA));return result;}},{key:"parseVariableDeclarator",value:function parseVariableDeclarator(bindingPatternsMustHaveInit){var startState=this.startNode();if(this.match(_tokenizer.TokenType.LPAREN)){throw this.createUnexpected(this.lookahead);}var previousAllowIn=this.allowIn;this.allowIn=true;var binding=this.parseBindingTarget();this.allowIn=previousAllowIn;if(bindingPatternsMustHaveInit&&binding.type!=="BindingIdentifier"&&!this.match(_tokenizer.TokenType.ASSIGN)){this.expect(_tokenizer.TokenType.ASSIGN);}var init=null;if(this.eat(_tokenizer.TokenType.ASSIGN)){init=this.parseAssignmentExpression();}return this.finishNode(new AST.VariableDeclarator({binding,init}),startState);}},{key:"isolateCoverGrammar",value:function isolateCoverGrammar(parser2){var oldIsBindingElement=this.isBindingElement,oldIsAssignmentTarget=this.isAssignmentTarget,oldFirstExprError=this.firstExprError,result=void 0;this.isBindingElement=this.isAssignmentTarget=true;this.firstExprError=null;result=parser2.call(this);if(this.firstExprError!==null){throw this.firstExprError;}this.isBindingElement=oldIsBindingElement;this.isAssignmentTarget=oldIsAssignmentTarget;this.firstExprError=oldFirstExprError;return result;}},{key:"inheritCoverGrammar",value:function inheritCoverGrammar(parser2){var oldIsBindingElement=this.isBindingElement,oldIsAssignmentTarget=this.isAssignmentTarget,oldFirstExprError=this.firstExprError,result=void 0;this.isBindingElement=this.isAssignmentTarget=true;this.firstExprError=null;result=parser2.call(this);this.isBindingElement=this.isBindingElement&&oldIsBindingElement;this.isAssignmentTarget=this.isAssignmentTarget&&oldIsAssignmentTarget;this.firstExprError=oldFirstExprError||this.firstExprError;return result;}},{key:"parseExpression",value:function parseExpression(){var startState=this.startNode();var left=this.parseAssignmentExpression();if(this.match(_tokenizer.TokenType.COMMA)){while(!this.eof()){if(!this.match(_tokenizer.TokenType.COMMA))break;this.lex();var right=this.parseAssignmentExpression();left=this.finishNode(new AST.BinaryExpression({left,operator:",",right}),startState);}}return left;}},{key:"finishArrowParams",value:function finishArrowParams(head){var _head$params=head.params,params=_head$params===void 0?null:_head$params,_head$rest=head.rest,rest=_head$rest===void 0?null:_head$rest;if(head.type!==ARROW_EXPRESSION_PARAMS){if(head.type==="IdentifierExpression"){params=[this.targetToBinding(this.transformDestructuring(head))];}else{throw this.createUnexpected(this.lookahead);}}return this.copyNode(head,new AST.FormalParameters({items:params,rest}));}},{key:"parseArrowExpressionTail",value:function parseArrowExpressionTail(params,isAsync,startState){this.expect(_tokenizer.TokenType.ARROW);var previousYield=this.allowYieldExpression;var previousAwait=this.allowAwaitExpression;var previousAwaitLocation=this.firstAwaitLocation;this.allowYieldExpression=false;this.allowAwaitExpression=isAsync;this.firstAwaitLocation=null;var body=void 0;if(this.match(_tokenizer.TokenType.LBRACE)){var previousAllowIn=this.allowIn;this.allowIn=true;body=this.parseFunctionBody();this.allowIn=previousAllowIn;}else{body=this.parseAssignmentExpression();}this.allowYieldExpression=previousYield;this.allowAwaitExpression=previousAwait;this.firstAwaitLocation=previousAwaitLocation;return this.finishNode(new AST.ArrowExpression({isAsync,params,body}),startState);}},{key:"parseAssignmentExpression",value:function parseAssignmentExpression(){return this.isolateCoverGrammar(this.parseAssignmentExpressionOrTarget);}},{key:"parseAssignmentExpressionOrTarget",value:function parseAssignmentExpressionOrTarget(){var startState=this.startNode();if(this.allowYieldExpression&&this.match(_tokenizer.TokenType.YIELD)){this.isBindingElement=this.isAssignmentTarget=false;return this.parseYieldExpression();}var expr=this.parseConditionalExpression();if(!this.hasLineTerminatorBeforeNext&&this.match(_tokenizer.TokenType.ARROW)){this.isBindingElement=this.isAssignmentTarget=false;this.firstExprError=null;var isAsync=expr.type===ARROW_EXPRESSION_PARAMS&&expr.isAsync;return this.parseArrowExpressionTail(this.finishArrowParams(expr),isAsync,startState);}var isAssignmentOperator=false;var operator=this.lookahead;switch(operator.type){case _tokenizer.TokenType.ASSIGN_BIT_OR:case _tokenizer.TokenType.ASSIGN_BIT_XOR:case _tokenizer.TokenType.ASSIGN_BIT_AND:case _tokenizer.TokenType.ASSIGN_SHL:case _tokenizer.TokenType.ASSIGN_SHR:case _tokenizer.TokenType.ASSIGN_SHR_UNSIGNED:case _tokenizer.TokenType.ASSIGN_ADD:case _tokenizer.TokenType.ASSIGN_SUB:case _tokenizer.TokenType.ASSIGN_MUL:case _tokenizer.TokenType.ASSIGN_DIV:case _tokenizer.TokenType.ASSIGN_MOD:case _tokenizer.TokenType.ASSIGN_EXP:isAssignmentOperator=true;break;}if(isAssignmentOperator){if(!this.isAssignmentTarget||!isValidSimpleAssignmentTarget(expr)){throw this.createError(_errors$1.ErrorMessages.INVALID_LHS_IN_ASSIGNMENT);}expr=this.transformDestructuring(expr);}else if(operator.type===_tokenizer.TokenType.ASSIGN){if(!this.isAssignmentTarget){throw this.createError(_errors$1.ErrorMessages.INVALID_LHS_IN_ASSIGNMENT);}expr=this.transformDestructuring(expr);}else{return expr;}this.lex();var rhs=this.parseAssignmentExpression();this.firstExprError=null;var node=void 0;if(operator.type===_tokenizer.TokenType.ASSIGN){node=new AST.AssignmentExpression({binding:expr,expression:rhs});}else{node=new AST.CompoundAssignmentExpression({binding:expr,operator:operator.type.name,expression:rhs});this.isBindingElement=this.isAssignmentTarget=false;}return this.finishNode(node,startState);}},{key:"targetToBinding",value:function targetToBinding(node){var _this3=this;if(node===null){return null;}switch(node.type){case"AssignmentTargetIdentifier":return this.copyNode(node,new AST.BindingIdentifier({name:node.name}));case"ArrayAssignmentTarget":return this.copyNode(node,new AST.ArrayBinding({elements:node.elements.map(function(e){return _this3.targetToBinding(e);}),rest:this.targetToBinding(node.rest)}));case"ObjectAssignmentTarget":return this.copyNode(node,new AST.ObjectBinding({properties:node.properties.map(function(p2){return _this3.targetToBinding(p2);}),rest:this.targetToBinding(node.rest)}));case"AssignmentTargetPropertyIdentifier":return this.copyNode(node,new AST.BindingPropertyIdentifier({binding:this.targetToBinding(node.binding),init:node.init}));case"AssignmentTargetPropertyProperty":return this.copyNode(node,new AST.BindingPropertyProperty({name:node.name,binding:this.targetToBinding(node.binding)}));case"AssignmentTargetWithDefault":return this.copyNode(node,new AST.BindingWithDefault({binding:this.targetToBinding(node.binding),init:node.init}));}throw new Error("Not reached");}},{key:"transformDestructuring",value:function transformDestructuring(node){var _this4=this;switch(node.type){case"DataProperty":return this.copyNode(node,new AST.AssignmentTargetPropertyProperty({name:node.name,binding:this.transformDestructuringWithDefault(node.expression)}));case"ShorthandProperty":return this.copyNode(node,new AST.AssignmentTargetPropertyIdentifier({binding:this.copyNode(node,new AST.AssignmentTargetIdentifier({name:node.name.name})),init:null}));case"ObjectExpression":{var last=node.properties.length>0?node.properties[node.properties.length-1]:void 0;if(last!=null&&last.type==="SpreadProperty"){return this.copyNode(node,new AST.ObjectAssignmentTarget({properties:node.properties.slice(0,-1).map(function(e){return e&&_this4.transformDestructuringWithDefault(e);}),rest:this.transformDestructuring(last.expression)}));}return this.copyNode(node,new AST.ObjectAssignmentTarget({properties:node.properties.map(function(e){return e&&_this4.transformDestructuringWithDefault(e);}),rest:null}));}case"ArrayExpression":{var _last=node.elements[node.elements.length-1];if(_last!=null&&_last.type==="SpreadElement"){return this.copyNode(node,new AST.ArrayAssignmentTarget({elements:node.elements.slice(0,-1).map(function(e){return e&&_this4.transformDestructuringWithDefault(e);}),rest:this.copyNode(_last.expression,this.transformDestructuring(_last.expression))}));}return this.copyNode(node,new AST.ArrayAssignmentTarget({elements:node.elements.map(function(e){return e&&_this4.transformDestructuringWithDefault(e);}),rest:null}));}case"IdentifierExpression":return this.copyNode(node,new AST.AssignmentTargetIdentifier({name:node.name}));case"StaticPropertyName":return this.copyNode(node,new AST.AssignmentTargetIdentifier({name:node.value}));case"ComputedMemberExpression":return this.copyNode(node,new AST.ComputedMemberAssignmentTarget({object:node.object,expression:node.expression}));case"StaticMemberExpression":return this.copyNode(node,new AST.StaticMemberAssignmentTarget({object:node.object,property:node.property}));case"ArrayAssignmentTarget":case"ObjectAssignmentTarget":case"ComputedMemberAssignmentTarget":case"StaticMemberAssignmentTarget":case"AssignmentTargetIdentifier":case"AssignmentTargetPropertyIdentifier":case"AssignmentTargetPropertyProperty":case"AssignmentTargetWithDefault":return node;}throw new Error("Not reached");}},{key:"transformDestructuringWithDefault",value:function transformDestructuringWithDefault(node){switch(node.type){case"AssignmentExpression":return this.copyNode(node,new AST.AssignmentTargetWithDefault({binding:this.transformDestructuring(node.binding),init:node.expression}));}return this.transformDestructuring(node);}},{key:"lookaheadAssignmentExpression",value:function lookaheadAssignmentExpression(){if(this.matchIdentifier()){return true;}switch(this.lookahead.type){case _tokenizer.TokenType.ADD:case _tokenizer.TokenType.ASSIGN_DIV:case _tokenizer.TokenType.BIT_NOT:case _tokenizer.TokenType.CLASS:case _tokenizer.TokenType.DEC:case _tokenizer.TokenType.DELETE:case _tokenizer.TokenType.DIV:case _tokenizer.TokenType.FALSE:case _tokenizer.TokenType.FUNCTION:case _tokenizer.TokenType.INC:case _tokenizer.TokenType.LBRACE:case _tokenizer.TokenType.LBRACK:case _tokenizer.TokenType.LPAREN:case _tokenizer.TokenType.NEW:case _tokenizer.TokenType.NOT:case _tokenizer.TokenType.NULL:case _tokenizer.TokenType.NUMBER:case _tokenizer.TokenType.STRING:case _tokenizer.TokenType.SUB:case _tokenizer.TokenType.SUPER:case _tokenizer.TokenType.THIS:case _tokenizer.TokenType.TRUE:case _tokenizer.TokenType.TYPEOF:case _tokenizer.TokenType.VOID:case _tokenizer.TokenType.TEMPLATE:return true;}return false;}},{key:"parseYieldExpression",value:function parseYieldExpression(){var startState=this.startNode();this.lex();if(this.hasLineTerminatorBeforeNext){return this.finishNode(new AST.YieldExpression({expression:null}),startState);}var isGenerator=!!this.eat(_tokenizer.TokenType.MUL);var expr=null;if(isGenerator||this.lookaheadAssignmentExpression()){expr=this.parseAssignmentExpression();}var ctor=isGenerator?AST.YieldGeneratorExpression:AST.YieldExpression;return this.finishNode(new ctor({expression:expr}),startState);}},{key:"parseConditionalExpression",value:function parseConditionalExpression(){var startState=this.startNode();var test=this.parseBinaryExpression();if(this.firstExprError)return test;if(this.eat(_tokenizer.TokenType.CONDITIONAL)){this.isBindingElement=this.isAssignmentTarget=false;var previousAllowIn=this.allowIn;this.allowIn=true;var consequent=this.isolateCoverGrammar(this.parseAssignmentExpression);this.allowIn=previousAllowIn;this.expect(_tokenizer.TokenType.COLON);var alternate=this.isolateCoverGrammar(this.parseAssignmentExpression);return this.finishNode(new AST.ConditionalExpression({test,consequent,alternate}),startState);}return test;}},{key:"isBinaryOperator",value:function isBinaryOperator(type){switch(type){case _tokenizer.TokenType.OR:case _tokenizer.TokenType.AND:case _tokenizer.TokenType.BIT_OR:case _tokenizer.TokenType.BIT_XOR:case _tokenizer.TokenType.BIT_AND:case _tokenizer.TokenType.EQ:case _tokenizer.TokenType.NE:case _tokenizer.TokenType.EQ_STRICT:case _tokenizer.TokenType.NE_STRICT:case _tokenizer.TokenType.LT:case _tokenizer.TokenType.GT:case _tokenizer.TokenType.LTE:case _tokenizer.TokenType.GTE:case _tokenizer.TokenType.INSTANCEOF:case _tokenizer.TokenType.SHL:case _tokenizer.TokenType.SHR:case _tokenizer.TokenType.SHR_UNSIGNED:case _tokenizer.TokenType.ADD:case _tokenizer.TokenType.SUB:case _tokenizer.TokenType.MUL:case _tokenizer.TokenType.DIV:case _tokenizer.TokenType.MOD:return true;case _tokenizer.TokenType.IN:return this.allowIn;default:return false;}}},{key:"parseBinaryExpression",value:function parseBinaryExpression(){var _this5=this;var startState=this.startNode();var left=this.parseExponentiationExpression();if(this.firstExprError){return left;}var operator=this.lookahead.type;if(!this.isBinaryOperator(operator))return left;this.isBindingElement=this.isAssignmentTarget=false;this.lex();var stack2=[];stack2.push({startState,left,operator,precedence:BinaryPrecedence$1[operator.name]});startState=this.startNode();var right=this.isolateCoverGrammar(this.parseExponentiationExpression);operator=this.lookahead.type;while(this.isBinaryOperator(operator)){var precedence=BinaryPrecedence$1[operator.name];while(stack2.length&&precedence<=stack2[stack2.length-1].precedence){var stackItem=stack2[stack2.length-1];var stackOperator=stackItem.operator;left=stackItem.left;stack2.pop();startState=stackItem.startState;right=this.finishNode(new AST.BinaryExpression({left,operator:stackOperator.name,right}),startState);}this.lex();stack2.push({startState,left:right,operator,precedence});startState=this.startNode();right=this.isolateCoverGrammar(this.parseExponentiationExpression);operator=this.lookahead.type;}return stack2.reduceRight(function(expr,stackItem2){return _this5.finishNode(new AST.BinaryExpression({left:stackItem2.left,operator:stackItem2.operator.name,right:expr}),stackItem2.startState);},right);}},{key:"parseExponentiationExpression",value:function parseExponentiationExpression(){var startState=this.startNode();var leftIsParenthesized=this.lookahead.type===_tokenizer.TokenType.LPAREN;var left=this.parseUnaryExpression();if(this.lookahead.type!==_tokenizer.TokenType.EXP){return left;}if(left.type==="UnaryExpression"&&!leftIsParenthesized){throw this.createError(_errors$1.ErrorMessages.INVALID_EXPONENTIATION_LHS);}this.lex();this.isBindingElement=this.isAssignmentTarget=false;var right=this.isolateCoverGrammar(this.parseExponentiationExpression);return this.finishNode(new AST.BinaryExpression({left,operator:"**",right}),startState);}},{key:"parseUnaryExpression",value:function parseUnaryExpression(){if(this.lookahead.type.klass!==_tokenizer.TokenClass.Punctuator&&this.lookahead.type.klass!==_tokenizer.TokenClass.Keyword){return this.parseUpdateExpression();}var startState=this.startNode();if(this.allowAwaitExpression&&this.eat(_tokenizer.TokenType.AWAIT)){this.isBindingElement=this.isAssignmentTarget=false;var expression=this.isolateCoverGrammar(this.parseUnaryExpression);return this.finishNode(new AST.AwaitExpression({expression}),startState);}var operator=this.lookahead;if(!isPrefixOperator(operator)){return this.parseUpdateExpression();}this.lex();this.isBindingElement=this.isAssignmentTarget=false;var node=void 0;if(isUpdateOperator(operator)){var operandStartLocation=this.getLocation();var operand=this.isolateCoverGrammar(this.parseUnaryExpression);if(!isValidSimpleAssignmentTarget(operand)){throw this.createErrorWithLocation(operandStartLocation,_errors$1.ErrorMessages.INVALID_UPDATE_OPERAND);}operand=this.transformDestructuring(operand);node=new AST.UpdateExpression({isPrefix:true,operator:operator.value,operand});}else{var _operand=this.isolateCoverGrammar(this.parseUnaryExpression);node=new AST.UnaryExpression({operator:operator.value,operand:_operand});}return this.finishNode(node,startState);}},{key:"parseUpdateExpression",value:function parseUpdateExpression(){var startLocation=this.getLocation();var startState=this.startNode();var operand=this.parseLeftHandSideExpression({allowCall:true});if(this.firstExprError||this.hasLineTerminatorBeforeNext)return operand;var operator=this.lookahead;if(!isUpdateOperator(operator))return operand;this.lex();this.isBindingElement=this.isAssignmentTarget=false;if(!isValidSimpleAssignmentTarget(operand)){throw this.createErrorWithLocation(startLocation,_errors$1.ErrorMessages.INVALID_UPDATE_OPERAND);}operand=this.transformDestructuring(operand);return this.finishNode(new AST.UpdateExpression({isPrefix:false,operator:operator.value,operand}),startState);}},{key:"parseLeftHandSideExpression",value:function parseLeftHandSideExpression(_ref2){var _this6=this;var allowCall=_ref2.allowCall;var startState=this.startNode();var previousAllowIn=this.allowIn;this.allowIn=true;var expr=void 0,token=this.lookahead;if(this.eat(_tokenizer.TokenType.SUPER)){this.isBindingElement=false;this.isAssignmentTarget=false;expr=this.finishNode(new AST.Super(),startState);if(this.match(_tokenizer.TokenType.LPAREN)){if(allowCall){expr=this.finishNode(new AST.CallExpression({callee:expr,arguments:this.parseArgumentList().args}),startState);}else{throw this.createUnexpected(token);}}else if(this.match(_tokenizer.TokenType.LBRACK)){expr=this.finishNode(new AST.ComputedMemberExpression({object:expr,expression:this.parseComputedMember()}),startState);this.isAssignmentTarget=true;}else if(this.match(_tokenizer.TokenType.PERIOD)){expr=this.finishNode(new AST.StaticMemberExpression({object:expr,property:this.parseStaticMember()}),startState);this.isAssignmentTarget=true;}else{throw this.createUnexpected(token);}}else if(this.match(_tokenizer.TokenType.NEW)){this.isBindingElement=this.isAssignmentTarget=false;expr=this.parseNewExpression();}else if(this.match(_tokenizer.TokenType.ASYNC)){expr=this.parsePrimaryExpression();if(expr.type==="IdentifierExpression"&&allowCall&&!this.hasLineTerminatorBeforeNext){if(this.matchIdentifier()){var afterAsyncStartState=this.startNode();var previousAwait=this.allowAwaitExpression;this.allowAwaitExpression=true;var param=this.parseBindingIdentifier();this.allowAwaitExpression=previousAwait;this.ensureArrow();return this.finishNode({type:ARROW_EXPRESSION_PARAMS,params:[param],rest:null,isAsync:true},afterAsyncStartState);}if(this.match(_tokenizer.TokenType.LPAREN)){var _afterAsyncStartState=this.startNode();var previousAwaitLocation=this.firstAwaitLocation;this.firstAwaitLocation=null;var _parseArgumentList=this.parseArgumentList(),args=_parseArgumentList.args,locationFollowingFirstSpread=_parseArgumentList.locationFollowingFirstSpread;if(this.isBindingElement&&!this.hasLineTerminatorBeforeNext&&this.match(_tokenizer.TokenType.ARROW)){if(locationFollowingFirstSpread!==null){throw this.createErrorWithLocation(locationFollowingFirstSpread,_errors$1.ErrorMessages.UNEXPECTED_TOKEN(","));}if(this.firstAwaitLocation!==null){throw this.createErrorWithLocation(this.firstAwaitLocation,_errors$1.ErrorMessages.NO_AWAIT_IN_ASYNC_PARAMS);}var rest=null;if(args.length>0&&args[args.length-1].type==="SpreadElement"){rest=this.targetToBinding(this.transformDestructuringWithDefault(args[args.length-1].expression));if(rest.init!=null){throw this.createError(_errors$1.ErrorMessages.UNEXPECTED_REST_PARAMETERS_INITIALIZATION);}args=args.slice(0,-1);}var params=args.map(function(arg){return _this6.targetToBinding(_this6.transformDestructuringWithDefault(arg));});return this.finishNode({type:ARROW_EXPRESSION_PARAMS,params,rest,isAsync:true},_afterAsyncStartState);}this.firstAwaitLocation=previousAwaitLocation||this.firstAwaitLocation;this.isBindingElement=this.isAssignmentTarget=false;expr=this.finishNode(new AST.CallExpression({callee:expr,arguments:args}),startState);}}}else{expr=this.parsePrimaryExpression();if(this.firstExprError){return expr;}}while(true){if(allowCall&&this.match(_tokenizer.TokenType.LPAREN)){this.isBindingElement=this.isAssignmentTarget=false;expr=this.finishNode(new AST.CallExpression({callee:expr,arguments:this.parseArgumentList().args}),startState);}else if(this.match(_tokenizer.TokenType.LBRACK)){this.isBindingElement=false;this.isAssignmentTarget=true;expr=this.finishNode(new AST.ComputedMemberExpression({object:expr,expression:this.parseComputedMember()}),startState);}else if(this.match(_tokenizer.TokenType.PERIOD)){this.isBindingElement=false;this.isAssignmentTarget=true;expr=this.finishNode(new AST.StaticMemberExpression({object:expr,property:this.parseStaticMember()}),startState);}else if(this.match(_tokenizer.TokenType.TEMPLATE)){this.isBindingElement=this.isAssignmentTarget=false;expr=this.finishNode(new AST.TemplateExpression({tag:expr,elements:this.parseTemplateElements()}),startState);}else{break;}}this.allowIn=previousAllowIn;return expr;}},{key:"parseTemplateElements",value:function parseTemplateElements(){var startState=this.startNode();var token=this.lookahead;if(token.tail){this.lex();return[this.finishNode(new AST.TemplateElement({rawValue:token.slice.text.slice(1,-1)}),startState)];}var result=[this.finishNode(new AST.TemplateElement({rawValue:this.lex().slice.text.slice(1,-2)}),startState)];while(true){result.push(this.parseExpression());if(!this.match(_tokenizer.TokenType.RBRACE)){throw this.createILLEGAL();}this.index=this.startIndex;this.line=this.startLine;this.lineStart=this.startLineStart;this.lookahead=this.scanTemplateElement();startState=this.startNode();token=this.lex();if(token.tail){result.push(this.finishNode(new AST.TemplateElement({rawValue:token.slice.text.slice(1,-1)}),startState));return result;}result.push(this.finishNode(new AST.TemplateElement({rawValue:token.slice.text.slice(1,-2)}),startState));}}},{key:"parseStaticMember",value:function parseStaticMember(){this.lex();if(this.lookahead.type.klass.isIdentifierName){return this.lex().value;}throw this.createUnexpected(this.lookahead);}},{key:"parseComputedMember",value:function parseComputedMember(){this.lex();var expr=this.parseExpression();this.expect(_tokenizer.TokenType.RBRACK);return expr;}},{key:"parseNewExpression",value:function parseNewExpression(){var _this7=this;var startState=this.startNode();this.lex();if(this.eat(_tokenizer.TokenType.PERIOD)){this.expectContextualKeyword("target");return this.finishNode(new AST.NewTargetExpression(),startState);}var callee=this.isolateCoverGrammar(function(){return _this7.parseLeftHandSideExpression({allowCall:false});});return this.finishNode(new AST.NewExpression({callee,arguments:this.match(_tokenizer.TokenType.LPAREN)?this.parseArgumentList().args:[]}),startState);}},{key:"parseRegexFlags",value:function parseRegexFlags(flags){var global=false,ignoreCase=false,multiLine=false,unicode2=false,sticky=false,dotAll=false;for(var i2=0;i21?_len-1:0),_key=1;_key<_len;_key++){otherMaps[_key-1]=arguments[_key];}otherMaps.forEach(function(otherMap){otherMap.forEachEntry(function(v,k){thisMap.set.apply(thisMap,[k].concat(v));});});return thisMap;}var identity=void 0;var EarlyErrorState=EarlyErrorState_1=earlyErrorState$1.EarlyErrorState=function(){function EarlyErrorState2(){_classCallCheck$7(this,EarlyErrorState2);this.errors=[];this.strictErrors=[];this.usedLabelNames=[];this.freeBreakStatements=[];this.freeContinueStatements=[];this.freeLabeledBreakStatements=[];this.freeLabeledContinueStatements=[];this.newTargetExpressions=[];this.boundNames=new _multimap2.default();this.lexicallyDeclaredNames=new _multimap2.default();this.functionDeclarationNames=new _multimap2.default();this.varDeclaredNames=new _multimap2.default();this.forOfVarDeclaredNames=[];this.exportedNames=new _multimap2.default();this.exportedBindings=new _multimap2.default();this.superCallExpressions=[];this.superCallExpressionsInConstructorMethod=[];this.superPropertyExpressions=[];this.yieldExpressions=[];this.awaitExpressions=[];}_createClass$6(EarlyErrorState2,[{key:"addFreeBreakStatement",value:function addFreeBreakStatement(s){this.freeBreakStatements.push(s);return this;}},{key:"addFreeLabeledBreakStatement",value:function addFreeLabeledBreakStatement(s){this.freeLabeledBreakStatements.push(s);return this;}},{key:"clearFreeBreakStatements",value:function clearFreeBreakStatements(){this.freeBreakStatements=[];return this;}},{key:"addFreeContinueStatement",value:function addFreeContinueStatement(s){this.freeContinueStatements.push(s);return this;}},{key:"addFreeLabeledContinueStatement",value:function addFreeLabeledContinueStatement(s){this.freeLabeledContinueStatements.push(s);return this;}},{key:"clearFreeContinueStatements",value:function clearFreeContinueStatements(){this.freeContinueStatements=[];return this;}},{key:"enforceFreeBreakStatementErrors",value:function enforceFreeBreakStatementErrors(createError){[].push.apply(this.errors,this.freeBreakStatements.map(createError));this.freeBreakStatements=[];return this;}},{key:"enforceFreeLabeledBreakStatementErrors",value:function enforceFreeLabeledBreakStatementErrors(createError){[].push.apply(this.errors,this.freeLabeledBreakStatements.map(createError));this.freeLabeledBreakStatements=[];return this;}},{key:"enforceFreeContinueStatementErrors",value:function enforceFreeContinueStatementErrors(createError){[].push.apply(this.errors,this.freeContinueStatements.map(createError));this.freeContinueStatements=[];return this;}},{key:"enforceFreeLabeledContinueStatementErrors",value:function enforceFreeLabeledContinueStatementErrors(createError){[].push.apply(this.errors,this.freeLabeledContinueStatements.map(createError));this.freeLabeledContinueStatements=[];return this;}},{key:"observeIterationLabel",value:function observeIterationLabel(label){this.usedLabelNames.push(label);this.freeLabeledBreakStatements=this.freeLabeledBreakStatements.filter(function(s){return s.label!==label;});this.freeLabeledContinueStatements=this.freeLabeledContinueStatements.filter(function(s){return s.label!==label;});return this;}},{key:"observeNonIterationLabel",value:function observeNonIterationLabel(label){this.usedLabelNames.push(label);this.freeLabeledBreakStatements=this.freeLabeledBreakStatements.filter(function(s){return s.label!==label;});return this;}},{key:"clearUsedLabelNames",value:function clearUsedLabelNames(){this.usedLabelNames=[];return this;}},{key:"observeSuperCallExpression",value:function observeSuperCallExpression(node){this.superCallExpressions.push(node);return this;}},{key:"observeConstructorMethod",value:function observeConstructorMethod(){this.superCallExpressionsInConstructorMethod=this.superCallExpressions;this.superCallExpressions=[];return this;}},{key:"clearSuperCallExpressionsInConstructorMethod",value:function clearSuperCallExpressionsInConstructorMethod(){this.superCallExpressionsInConstructorMethod=[];return this;}},{key:"enforceSuperCallExpressions",value:function enforceSuperCallExpressions(createError){[].push.apply(this.errors,this.superCallExpressions.map(createError));[].push.apply(this.errors,this.superCallExpressionsInConstructorMethod.map(createError));this.superCallExpressions=[];this.superCallExpressionsInConstructorMethod=[];return this;}},{key:"enforceSuperCallExpressionsInConstructorMethod",value:function enforceSuperCallExpressionsInConstructorMethod(createError){[].push.apply(this.errors,this.superCallExpressionsInConstructorMethod.map(createError));this.superCallExpressionsInConstructorMethod=[];return this;}},{key:"observeSuperPropertyExpression",value:function observeSuperPropertyExpression(node){this.superPropertyExpressions.push(node);return this;}},{key:"clearSuperPropertyExpressions",value:function clearSuperPropertyExpressions(){this.superPropertyExpressions=[];return this;}},{key:"enforceSuperPropertyExpressions",value:function enforceSuperPropertyExpressions(createError){[].push.apply(this.errors,this.superPropertyExpressions.map(createError));this.superPropertyExpressions=[];return this;}},{key:"observeNewTargetExpression",value:function observeNewTargetExpression(node){this.newTargetExpressions.push(node);return this;}},{key:"clearNewTargetExpressions",value:function clearNewTargetExpressions(){this.newTargetExpressions=[];return this;}},{key:"bindName",value:function bindName(name,node){this.boundNames.set(name,node);return this;}},{key:"clearBoundNames",value:function clearBoundNames(){this.boundNames=new _multimap2.default();return this;}},{key:"observeLexicalDeclaration",value:function observeLexicalDeclaration(){addEach(this.lexicallyDeclaredNames,this.boundNames);this.boundNames=new _multimap2.default();return this;}},{key:"observeLexicalBoundary",value:function observeLexicalBoundary(){this.previousLexicallyDeclaredNames=this.lexicallyDeclaredNames;this.lexicallyDeclaredNames=new _multimap2.default();this.functionDeclarationNames=new _multimap2.default();return this;}},{key:"enforceDuplicateLexicallyDeclaredNames",value:function enforceDuplicateLexicallyDeclaredNames(createError){var _this=this;this.lexicallyDeclaredNames.forEachEntry(function(nodes){if(nodes.length>1){nodes.slice(1).forEach(function(dupeNode){_this.addError(createError(dupeNode));});}});return this;}},{key:"enforceConflictingLexicallyDeclaredNames",value:function enforceConflictingLexicallyDeclaredNames(otherNames,createError){var _this2=this;this.lexicallyDeclaredNames.forEachEntry(function(nodes,bindingName){if(otherNames.has(bindingName)){nodes.forEach(function(conflictingNode){_this2.addError(createError(conflictingNode));});}});return this;}},{key:"observeFunctionDeclaration",value:function observeFunctionDeclaration(){this.observeVarBoundary();addEach(this.functionDeclarationNames,this.boundNames);this.boundNames=new _multimap2.default();return this;}},{key:"functionDeclarationNamesAreLexical",value:function functionDeclarationNamesAreLexical(){addEach(this.lexicallyDeclaredNames,this.functionDeclarationNames);this.functionDeclarationNames=new _multimap2.default();return this;}},{key:"observeVarDeclaration",value:function observeVarDeclaration(){addEach(this.varDeclaredNames,this.boundNames);this.boundNames=new _multimap2.default();return this;}},{key:"recordForOfVars",value:function recordForOfVars(){var _this3=this;this.varDeclaredNames.forEach(function(bindingIdentifier){_this3.forOfVarDeclaredNames.push(bindingIdentifier);});return this;}},{key:"observeVarBoundary",value:function observeVarBoundary(){this.lexicallyDeclaredNames=new _multimap2.default();this.functionDeclarationNames=new _multimap2.default();this.varDeclaredNames=new _multimap2.default();this.forOfVarDeclaredNames=[];return this;}},{key:"exportName",value:function exportName(name,node){this.exportedNames.set(name,node);return this;}},{key:"exportDeclaredNames",value:function exportDeclaredNames(){addEach(this.exportedNames,this.lexicallyDeclaredNames,this.varDeclaredNames);addEach(this.exportedBindings,this.lexicallyDeclaredNames,this.varDeclaredNames);return this;}},{key:"exportBinding",value:function exportBinding(name,node){this.exportedBindings.set(name,node);return this;}},{key:"clearExportedBindings",value:function clearExportedBindings(){this.exportedBindings=new _multimap2.default();return this;}},{key:"observeYieldExpression",value:function observeYieldExpression(node){this.yieldExpressions.push(node);return this;}},{key:"clearYieldExpressions",value:function clearYieldExpressions(){this.yieldExpressions=[];return this;}},{key:"observeAwaitExpression",value:function observeAwaitExpression(node){this.awaitExpressions.push(node);return this;}},{key:"clearAwaitExpressions",value:function clearAwaitExpressions(){this.awaitExpressions=[];return this;}},{key:"addError",value:function addError(e){this.errors.push(e);return this;}},{key:"addStrictError",value:function addStrictError(e){this.strictErrors.push(e);return this;}},{key:"enforceStrictErrors",value:function enforceStrictErrors(){[].push.apply(this.errors,this.strictErrors);this.strictErrors=[];return this;}},{key:"concat",value:function concat5(s){if(this===identity)return s;if(s===identity)return this;[].push.apply(this.errors,s.errors);[].push.apply(this.strictErrors,s.strictErrors);[].push.apply(this.usedLabelNames,s.usedLabelNames);[].push.apply(this.freeBreakStatements,s.freeBreakStatements);[].push.apply(this.freeContinueStatements,s.freeContinueStatements);[].push.apply(this.freeLabeledBreakStatements,s.freeLabeledBreakStatements);[].push.apply(this.freeLabeledContinueStatements,s.freeLabeledContinueStatements);[].push.apply(this.newTargetExpressions,s.newTargetExpressions);addEach(this.boundNames,s.boundNames);addEach(this.lexicallyDeclaredNames,s.lexicallyDeclaredNames);addEach(this.functionDeclarationNames,s.functionDeclarationNames);addEach(this.varDeclaredNames,s.varDeclaredNames);[].push.apply(this.forOfVarDeclaredNames,s.forOfVarDeclaredNames);addEach(this.exportedNames,s.exportedNames);addEach(this.exportedBindings,s.exportedBindings);[].push.apply(this.superCallExpressions,s.superCallExpressions);[].push.apply(this.superCallExpressionsInConstructorMethod,s.superCallExpressionsInConstructorMethod);[].push.apply(this.superPropertyExpressions,s.superPropertyExpressions);[].push.apply(this.yieldExpressions,s.yieldExpressions);[].push.apply(this.awaitExpressions,s.awaitExpressions);return this;}}],[{key:"empty",value:function empty6(){return identity;}}]);return EarlyErrorState2;}();identity=new EarlyErrorState();Object.getOwnPropertyNames(EarlyErrorState.prototype).forEach(function(methodName){if(methodName==="constructor")return;Object.defineProperty(identity,methodName,{value:function value(){return EarlyErrorState.prototype[methodName].apply(new EarlyErrorState(),arguments);},enumerable:false,writable:true,configurable:true});});EarlyError_1=earlyErrorState$1.EarlyError=function(_Error){_inherits$4(EarlyError,_Error);function EarlyError(node,message){_classCallCheck$7(this,EarlyError);var _this4=_possibleConstructorReturn$4(this,(EarlyError.__proto__||Object.getPrototypeOf(EarlyError)).call(this,message));_this4.node=node;_this4.message=message;return _this4;}return EarlyError;}(Error);var earlyErrorState=/* @__PURE__ */_mergeNamespaces({__proto__:null,get EarlyError(){return EarlyError_1;},get EarlyErrorState(){return EarlyErrorState_1;},"default":earlyErrorState$1},[earlyErrorState$1]);var require$$3$1=/* @__PURE__ */getAugmentedNamespace(earlyErrorState);Object.defineProperty(earlyErrors$1,"__esModule",{value:true});var EarlyErrorChecker_1=earlyErrors$1.EarlyErrorChecker=void 0;var _createClass$5=function(){function defineProperties(target,props){for(var i2=0;i21){ctors.slice(1).forEach(function(ctor){s=s.addError(new _earlyErrorState.EarlyError(ctor,"Duplicate constructor method in class"));});}return s;}var SUPERCALL_ERROR=function SUPERCALL_ERROR2(node){return new _earlyErrorState.EarlyError(node,_errors.ErrorMessages.ILLEGAL_SUPER_CALL);};var SUPERPROPERTY_ERROR=function SUPERPROPERTY_ERROR2(node){return new _earlyErrorState.EarlyError(node,"Member access on super must be in a method");};var DUPLICATE_BINDING=function DUPLICATE_BINDING3(node){return new _earlyErrorState.EarlyError(node,"Duplicate binding "+JSON.stringify(node.name));};var FREE_CONTINUE=function FREE_CONTINUE2(node){return new _earlyErrorState.EarlyError(node,"Continue statement must be nested within an iteration statement");};var UNBOUND_CONTINUE=function UNBOUND_CONTINUE2(node){return new _earlyErrorState.EarlyError(node,"Continue statement must be nested within an iteration statement with label "+JSON.stringify(node.label));};var FREE_BREAK=function FREE_BREAK2(node){return new _earlyErrorState.EarlyError(node,"Break statement must be nested within an iteration statement or a switch statement");};var UNBOUND_BREAK=function UNBOUND_BREAK2(node){return new _earlyErrorState.EarlyError(node,"Break statement must be nested within a statement with label "+JSON.stringify(node.label));};EarlyErrorChecker_1=earlyErrors$1.EarlyErrorChecker=function(_MonoidalReducer){_inherits$3(EarlyErrorChecker,_MonoidalReducer);function EarlyErrorChecker(){_classCallCheck$6(this,EarlyErrorChecker);return _possibleConstructorReturn$3(this,(EarlyErrorChecker.__proto__||Object.getPrototypeOf(EarlyErrorChecker)).call(this,_earlyErrorState.EarlyErrorState));}_createClass$5(EarlyErrorChecker,[{key:"reduceAssignmentExpression",value:function reduceAssignmentExpression(){return _get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceAssignmentExpression",this).apply(this,arguments).clearBoundNames();}},{key:"reduceAssignmentTargetIdentifier",value:function reduceAssignmentTargetIdentifier(node){var s=this.identity;if(node.name==="eval"||node.name==="arguments"||(0,_utils.isStrictModeReservedWord)(node.name)){s=s.addStrictError(new _earlyErrorState.EarlyError(node,"The identifier "+JSON.stringify(node.name)+" must not be in binding position in strict mode"));}return s;}},{key:"reduceArrowExpression",value:function reduceArrowExpression(node,_ref2){var params=_ref2.params,body=_ref2.body;var isSimpleParameterList=node.params.rest==null&&node.params.items.every(function(i2){return i2.type==="BindingIdentifier";});params=params.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);if(node.body.type==="FunctionBody"){body=body.enforceConflictingLexicallyDeclaredNames(params.lexicallyDeclaredNames,DUPLICATE_BINDING);if(isStrictFunctionBody(node.body)){params=params.enforceStrictErrors();body=body.enforceStrictErrors();}}params.yieldExpressions.forEach(function(n){params=params.addError(new _earlyErrorState.EarlyError(n,"Arrow parameters must not contain yield expressions"));});params.awaitExpressions.forEach(function(n){params=params.addError(new _earlyErrorState.EarlyError(n,"Arrow parameters must not contain await expressions"));});var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceArrowExpression",this).call(this,node,{params,body});if(!isSimpleParameterList&&node.body.type==="FunctionBody"&&isStrictFunctionBody(node.body)){s=s.addError(new _earlyErrorState.EarlyError(node,'Functions with non-simple parameter lists may not contain a "use strict" directive'));}s=s.clearYieldExpressions();s=s.clearAwaitExpressions();s=s.observeVarBoundary();return s;}},{key:"reduceAwaitExpression",value:function reduceAwaitExpression(node,_ref3){var expression=_ref3.expression;return expression.observeAwaitExpression(node);}},{key:"reduceBindingIdentifier",value:function reduceBindingIdentifier(node){var s=this.identity;if(node.name==="eval"||node.name==="arguments"||(0,_utils.isStrictModeReservedWord)(node.name)){s=s.addStrictError(new _earlyErrorState.EarlyError(node,"The identifier "+JSON.stringify(node.name)+" must not be in binding position in strict mode"));}s=s.bindName(node.name,node);return s;}},{key:"reduceBlock",value:function reduceBlock(){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceBlock",this).apply(this,arguments);s=s.functionDeclarationNamesAreLexical();s=s.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);s=s.enforceConflictingLexicallyDeclaredNames(s.varDeclaredNames,DUPLICATE_BINDING);s=s.observeLexicalBoundary();return s;}},{key:"reduceBreakStatement",value:function reduceBreakStatement(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceBreakStatement",this).apply(this,arguments);s=node.label==null?s.addFreeBreakStatement(node):s.addFreeLabeledBreakStatement(node);return s;}},{key:"reduceCallExpression",value:function reduceCallExpression(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceCallExpression",this).apply(this,arguments);if(node.callee.type==="Super"){s=s.observeSuperCallExpression(node);}return s;}},{key:"reduceCatchClause",value:function reduceCatchClause(node,_ref4){var binding=_ref4.binding,body=_ref4.body;binding=binding.observeLexicalDeclaration();binding=binding.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);binding=binding.enforceConflictingLexicallyDeclaredNames(body.previousLexicallyDeclaredNames,DUPLICATE_BINDING);binding.lexicallyDeclaredNames.forEachEntry(function(nodes,bindingName){if(body.varDeclaredNames.has(bindingName)){body.varDeclaredNames.get(bindingName).forEach(function(conflictingNode){if(body.forOfVarDeclaredNames.indexOf(conflictingNode)>=0){binding=binding.addError(DUPLICATE_BINDING(conflictingNode));}});}});var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceCatchClause",this).call(this,node,{binding,body});s=s.observeLexicalBoundary();return s;}},{key:"reduceClassDeclaration",value:function reduceClassDeclaration(node,_ref5){var name=_ref5.name,_super=_ref5.super,elements=_ref5.elements;var s=name.enforceStrictErrors();var sElements=this.append.apply(this,_toConsumableArray$3(elements));sElements=sElements.enforceStrictErrors();if(node.super!=null){_super=_super.enforceStrictErrors();s=this.append(s,_super);sElements=sElements.clearSuperCallExpressionsInConstructorMethod();}s=this.append(s,sElements);s=enforceDuplicateConstructorMethods(node,s);s=s.observeLexicalDeclaration();return s;}},{key:"reduceClassElement",value:function reduceClassElement(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceClassElement",this).apply(this,arguments);if(!node.isStatic&&isSpecialMethod(node.method)){s=s.addError(new _earlyErrorState.EarlyError(node,_errors.ErrorMessages.ILLEGAL_CONSTRUCTORS));}if(node.isStatic&&node.method.name.type==="StaticPropertyName"&&node.method.name.value==="prototype"){s=s.addError(new _earlyErrorState.EarlyError(node,'Static class methods cannot be named "prototype"'));}return s;}},{key:"reduceClassExpression",value:function reduceClassExpression(node,_ref6){var name=_ref6.name,_super=_ref6.super,elements=_ref6.elements;var s=node.name==null?this.identity:name.enforceStrictErrors();var sElements=this.append.apply(this,_toConsumableArray$3(elements));sElements=sElements.enforceStrictErrors();if(node.super!=null){_super=_super.enforceStrictErrors();s=this.append(s,_super);sElements=sElements.clearSuperCallExpressionsInConstructorMethod();}s=this.append(s,sElements);s=enforceDuplicateConstructorMethods(node,s);s=s.clearBoundNames();return s;}},{key:"reduceCompoundAssignmentExpression",value:function reduceCompoundAssignmentExpression(){return _get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceCompoundAssignmentExpression",this).apply(this,arguments).clearBoundNames();}},{key:"reduceComputedMemberExpression",value:function reduceComputedMemberExpression(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceComputedMemberExpression",this).apply(this,arguments);if(node.object.type==="Super"){s=s.observeSuperPropertyExpression(node);}return s;}},{key:"reduceContinueStatement",value:function reduceContinueStatement(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceContinueStatement",this).apply(this,arguments);s=node.label==null?s.addFreeContinueStatement(node):s.addFreeLabeledContinueStatement(node);return s;}},{key:"reduceDoWhileStatement",value:function reduceDoWhileStatement(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceDoWhileStatement",this).apply(this,arguments);if(isLabelledFunction(node.body)){s=s.addError(new _earlyErrorState.EarlyError(node.body,"The body of a do-while statement must not be a labeled function declaration"));}s=s.clearFreeContinueStatements();s=s.clearFreeBreakStatements();return s;}},{key:"reduceExport",value:function reduceExport(){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceExport",this).apply(this,arguments);s=s.functionDeclarationNamesAreLexical();s=s.exportDeclaredNames();return s;}},{key:"reduceExportFrom",value:function reduceExportFrom(){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceExportFrom",this).apply(this,arguments);s=s.clearExportedBindings();return s;}},{key:"reduceExportFromSpecifier",value:function reduceExportFromSpecifier(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceExportFromSpecifier",this).apply(this,arguments);s=s.exportName(node.exportedName||node.name,node);s=s.exportBinding(node.name,node);return s;}},{key:"reduceExportLocalSpecifier",value:function reduceExportLocalSpecifier(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceExportLocalSpecifier",this).apply(this,arguments);s=s.exportName(node.exportedName||node.name.name,node);s=s.exportBinding(node.name.name,node);return s;}},{key:"reduceExportDefault",value:function reduceExportDefault(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceExportDefault",this).apply(this,arguments);s=s.functionDeclarationNamesAreLexical();s=s.exportName("default",node);return s;}},{key:"reduceFormalParameters",value:function reduceFormalParameters(){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceFormalParameters",this).apply(this,arguments);s=s.observeLexicalDeclaration();return s;}},{key:"reduceForStatement",value:function reduceForStatement(node,_ref7){var init=_ref7.init,test=_ref7.test,update=_ref7.update,body=_ref7.body;if(init!=null){init=init.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);init=init.enforceConflictingLexicallyDeclaredNames(body.varDeclaredNames,DUPLICATE_BINDING);}var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceForStatement",this).call(this,node,{init,test,update,body});if(node.init!=null&&node.init.type==="VariableDeclaration"&&node.init.kind==="const"){node.init.declarators.forEach(function(declarator){if(declarator.init==null){s=s.addError(new _earlyErrorState.EarlyError(declarator,"Constant lexical declarations must have an initialiser"));}});}if(isLabelledFunction(node.body)){s=s.addError(new _earlyErrorState.EarlyError(node.body,"The body of a for statement must not be a labeled function declaration"));}s=s.clearFreeContinueStatements();s=s.clearFreeBreakStatements();s=s.observeLexicalBoundary();return s;}},{key:"reduceForInStatement",value:function reduceForInStatement(node,_ref8){var left=_ref8.left,right=_ref8.right,body=_ref8.body;left=left.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);left=left.enforceConflictingLexicallyDeclaredNames(body.varDeclaredNames,DUPLICATE_BINDING);var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceForInStatement",this).call(this,node,{left,right,body});if(isLabelledFunction(node.body)){s=s.addError(new _earlyErrorState.EarlyError(node.body,"The body of a for-in statement must not be a labeled function declaration"));}s=s.clearFreeContinueStatements();s=s.clearFreeBreakStatements();s=s.observeLexicalBoundary();return s;}},{key:"reduceForOfStatement",value:function reduceForOfStatement(node,_ref9){var left=_ref9.left,right=_ref9.right,body=_ref9.body;left=left.recordForOfVars();left=left.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);left=left.enforceConflictingLexicallyDeclaredNames(body.varDeclaredNames,DUPLICATE_BINDING);var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceForOfStatement",this).call(this,node,{left,right,body});if(isLabelledFunction(node.body)){s=s.addError(new _earlyErrorState.EarlyError(node.body,"The body of a for-of statement must not be a labeled function declaration"));}s=s.clearFreeContinueStatements();s=s.clearFreeBreakStatements();s=s.observeLexicalBoundary();return s;}},{key:"reduceForAwaitStatement",value:function reduceForAwaitStatement(node,_ref10){var left=_ref10.left,right=_ref10.right,body=_ref10.body;left=left.recordForOfVars();left=left.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);left=left.enforceConflictingLexicallyDeclaredNames(body.varDeclaredNames,DUPLICATE_BINDING);var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceForOfStatement",this).call(this,node,{left,right,body});if(isLabelledFunction(node.body)){s=s.addError(new _earlyErrorState.EarlyError(node.body,"The body of a for-await statement must not be a labeled function declaration"));}s=s.clearFreeContinueStatements();s=s.clearFreeBreakStatements();s=s.observeLexicalBoundary();return s;}},{key:"reduceFunctionBody",value:function reduceFunctionBody(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceFunctionBody",this).apply(this,arguments);s=s.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);s=s.enforceConflictingLexicallyDeclaredNames(s.varDeclaredNames,DUPLICATE_BINDING);s=s.enforceFreeContinueStatementErrors(FREE_CONTINUE);s=s.enforceFreeLabeledContinueStatementErrors(UNBOUND_CONTINUE);s=s.enforceFreeBreakStatementErrors(FREE_BREAK);s=s.enforceFreeLabeledBreakStatementErrors(UNBOUND_BREAK);s=s.clearUsedLabelNames();s=s.clearYieldExpressions();s=s.clearAwaitExpressions();if(isStrictFunctionBody(node)){s=s.enforceStrictErrors();}return s;}},{key:"reduceFunctionDeclaration",value:function reduceFunctionDeclaration(node,_ref11){var name=_ref11.name,params=_ref11.params,body=_ref11.body;var isSimpleParameterList=node.params.rest==null&&node.params.items.every(function(i2){return i2.type==="BindingIdentifier";});var addError=!isSimpleParameterList||node.isGenerator?"addError":"addStrictError";params.lexicallyDeclaredNames.forEachEntry(function(nodes){if(nodes.length>1){nodes.slice(1).forEach(function(dupeNode){params=params[addError](DUPLICATE_BINDING(dupeNode));});}});body=body.enforceConflictingLexicallyDeclaredNames(params.lexicallyDeclaredNames,DUPLICATE_BINDING);body=body.enforceSuperCallExpressions(SUPERCALL_ERROR);body=body.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR);params=params.enforceSuperCallExpressions(SUPERCALL_ERROR);params=params.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR);if(node.isGenerator){params.yieldExpressions.forEach(function(n){params=params.addError(new _earlyErrorState.EarlyError(n,"Generator parameters must not contain yield expressions"));});}if(node.isAsync){params.awaitExpressions.forEach(function(n){params=params.addError(new _earlyErrorState.EarlyError(n,"Async function parameters must not contain await expressions"));});}params=params.clearNewTargetExpressions();body=body.clearNewTargetExpressions();if(isStrictFunctionBody(node.body)){params=params.enforceStrictErrors();body=body.enforceStrictErrors();}var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceFunctionDeclaration",this).call(this,node,{name,params,body});if(!isSimpleParameterList&&isStrictFunctionBody(node.body)){s=s.addError(new _earlyErrorState.EarlyError(node,'Functions with non-simple parameter lists may not contain a "use strict" directive'));}s=s.clearYieldExpressions();s=s.clearAwaitExpressions();s=s.observeFunctionDeclaration();return s;}},{key:"reduceFunctionExpression",value:function reduceFunctionExpression(node,_ref12){var name=_ref12.name,params=_ref12.params,body=_ref12.body;var isSimpleParameterList=node.params.rest==null&&node.params.items.every(function(i2){return i2.type==="BindingIdentifier";});var addError=!isSimpleParameterList||node.isGenerator?"addError":"addStrictError";params.lexicallyDeclaredNames.forEachEntry(function(nodes,bindingName){if(nodes.length>1){nodes.slice(1).forEach(function(dupeNode){params=params[addError](new _earlyErrorState.EarlyError(dupeNode,"Duplicate binding "+JSON.stringify(bindingName)));});}});body=body.enforceConflictingLexicallyDeclaredNames(params.lexicallyDeclaredNames,DUPLICATE_BINDING);body=body.enforceSuperCallExpressions(SUPERCALL_ERROR);body=body.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR);params=params.enforceSuperCallExpressions(SUPERCALL_ERROR);params=params.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR);if(node.isGenerator){params.yieldExpressions.forEach(function(n){params=params.addError(new _earlyErrorState.EarlyError(n,"Generator parameters must not contain yield expressions"));});}if(node.isAsync){params.awaitExpressions.forEach(function(n){params=params.addError(new _earlyErrorState.EarlyError(n,"Async function parameters must not contain await expressions"));});}params=params.clearNewTargetExpressions();body=body.clearNewTargetExpressions();if(isStrictFunctionBody(node.body)){params=params.enforceStrictErrors();body=body.enforceStrictErrors();}var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceFunctionExpression",this).call(this,node,{name,params,body});if(!isSimpleParameterList&&isStrictFunctionBody(node.body)){s=s.addError(new _earlyErrorState.EarlyError(node,'Functions with non-simple parameter lists may not contain a "use strict" directive'));}s=s.clearBoundNames();s=s.clearYieldExpressions();s=s.clearAwaitExpressions();s=s.observeVarBoundary();return s;}},{key:"reduceGetter",value:function reduceGetter(node,_ref13){var name=_ref13.name,body=_ref13.body;body=body.enforceSuperCallExpressions(SUPERCALL_ERROR);body=body.clearSuperPropertyExpressions();body=body.clearNewTargetExpressions();if(isStrictFunctionBody(node.body)){body=body.enforceStrictErrors();}var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceGetter",this).call(this,node,{name,body});s=s.observeVarBoundary();return s;}},{key:"reduceIdentifierExpression",value:function reduceIdentifierExpression(node){var s=this.identity;if((0,_utils.isStrictModeReservedWord)(node.name)){s=s.addStrictError(new _earlyErrorState.EarlyError(node,"The identifier "+JSON.stringify(node.name)+" must not be in expression position in strict mode"));}return s;}},{key:"reduceIfStatement",value:function reduceIfStatement(node,_ref14){var test=_ref14.test,consequent=_ref14.consequent,alternate=_ref14.alternate;if(isLabelledFunction(node.consequent)){consequent=consequent.addError(new _earlyErrorState.EarlyError(node.consequent,"The consequent of an if statement must not be a labeled function declaration"));}if(node.alternate!=null&&isLabelledFunction(node.alternate)){alternate=alternate.addError(new _earlyErrorState.EarlyError(node.alternate,"The alternate of an if statement must not be a labeled function declaration"));}if(node.consequent.type==="FunctionDeclaration"){consequent=consequent.addStrictError(new _earlyErrorState.EarlyError(node.consequent,"FunctionDeclarations in IfStatements are disallowed in strict mode"));consequent=consequent.observeLexicalBoundary();}if(node.alternate!=null&&node.alternate.type==="FunctionDeclaration"){alternate=alternate.addStrictError(new _earlyErrorState.EarlyError(node.alternate,"FunctionDeclarations in IfStatements are disallowed in strict mode"));alternate=alternate.observeLexicalBoundary();}return _get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceIfStatement",this).call(this,node,{test,consequent,alternate});}},{key:"reduceImport",value:function reduceImport(){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceImport",this).apply(this,arguments);s=s.observeLexicalDeclaration();return s;}},{key:"reduceImportNamespace",value:function reduceImportNamespace(){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceImportNamespace",this).apply(this,arguments);s=s.observeLexicalDeclaration();return s;}},{key:"reduceLabeledStatement",value:function reduceLabeledStatement(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceLabeledStatement",this).apply(this,arguments);if(node.label==="yield"||(0,_utils.isStrictModeReservedWord)(node.label)){s=s.addStrictError(new _earlyErrorState.EarlyError(node,"The identifier "+JSON.stringify(node.label)+" must not be in label position in strict mode"));}if(s.usedLabelNames.indexOf(node.label)>=0){s=s.addError(new _earlyErrorState.EarlyError(node,"Label "+JSON.stringify(node.label)+" has already been declared"));}if(node.body.type==="FunctionDeclaration"){s=s.addStrictError(new _earlyErrorState.EarlyError(node,"Labeled FunctionDeclarations are disallowed in strict mode"));}s=isIterationStatement(node.body)?s.observeIterationLabel(node.label):s.observeNonIterationLabel(node.label);return s;}},{key:"reduceLiteralRegExpExpression",value:function reduceLiteralRegExpExpression(){var s=this.identity;return s;}},{key:"reduceMethod",value:function reduceMethod(node,_ref15){var name=_ref15.name,params=_ref15.params,body=_ref15.body;var isSimpleParameterList=node.params.rest==null&&node.params.items.every(function(i2){return i2.type==="BindingIdentifier";});params=params.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);body=body.enforceConflictingLexicallyDeclaredNames(params.lexicallyDeclaredNames,DUPLICATE_BINDING);if(node.name.type==="StaticPropertyName"&&node.name.value==="constructor"){body=body.observeConstructorMethod();params=params.observeConstructorMethod();}else{body=body.enforceSuperCallExpressions(SUPERCALL_ERROR);params=params.enforceSuperCallExpressions(SUPERCALL_ERROR);}if(node.isGenerator){params.yieldExpressions.forEach(function(n){params=params.addError(new _earlyErrorState.EarlyError(n,"Generator parameters must not contain yield expressions"));});}if(node.isAsync){params.awaitExpressions.forEach(function(n){params=params.addError(new _earlyErrorState.EarlyError(n,"Async function parameters must not contain await expressions"));});}body=body.clearSuperPropertyExpressions();params=params.clearSuperPropertyExpressions();params=params.clearNewTargetExpressions();body=body.clearNewTargetExpressions();if(isStrictFunctionBody(node.body)){params=params.enforceStrictErrors();body=body.enforceStrictErrors();}var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceMethod",this).call(this,node,{name,params,body});if(!isSimpleParameterList&&isStrictFunctionBody(node.body)){s=s.addError(new _earlyErrorState.EarlyError(node,'Functions with non-simple parameter lists may not contain a "use strict" directive'));}s=s.clearYieldExpressions();s=s.clearAwaitExpressions();s=s.observeVarBoundary();return s;}},{key:"reduceModule",value:function reduceModule(){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceModule",this).apply(this,arguments);s=s.functionDeclarationNamesAreLexical();s=s.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);s=s.enforceConflictingLexicallyDeclaredNames(s.varDeclaredNames,DUPLICATE_BINDING);s.exportedNames.forEachEntry(function(nodes,bindingName){if(nodes.length>1){nodes.slice(1).forEach(function(dupeNode){s=s.addError(new _earlyErrorState.EarlyError(dupeNode,"Duplicate export "+JSON.stringify(bindingName)));});}});s.exportedBindings.forEachEntry(function(nodes,bindingName){if(!s.lexicallyDeclaredNames.has(bindingName)&&!s.varDeclaredNames.has(bindingName)){nodes.forEach(function(undeclaredNode){s=s.addError(new _earlyErrorState.EarlyError(undeclaredNode,"Exported binding "+JSON.stringify(bindingName)+" is not declared"));});}});s.newTargetExpressions.forEach(function(node){s=s.addError(new _earlyErrorState.EarlyError(node,"new.target must be within function (but not arrow expression) code"));});s=s.enforceFreeContinueStatementErrors(FREE_CONTINUE);s=s.enforceFreeLabeledContinueStatementErrors(UNBOUND_CONTINUE);s=s.enforceFreeBreakStatementErrors(FREE_BREAK);s=s.enforceFreeLabeledBreakStatementErrors(UNBOUND_BREAK);s=s.enforceSuperCallExpressions(SUPERCALL_ERROR);s=s.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR);s=s.enforceStrictErrors();return s;}},{key:"reduceNewTargetExpression",value:function reduceNewTargetExpression(node){return this.identity.observeNewTargetExpression(node);}},{key:"reduceObjectExpression",value:function reduceObjectExpression(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceObjectExpression",this).apply(this,arguments);s=s.enforceSuperCallExpressionsInConstructorMethod(SUPERCALL_ERROR);var protos=node.properties.filter(function(p2){return p2.type==="DataProperty"&&p2.name.type==="StaticPropertyName"&&p2.name.value==="__proto__";});protos.slice(1).forEach(function(n){s=s.addError(new _earlyErrorState.EarlyError(n,"Duplicate __proto__ property in object literal not allowed"));});return s;}},{key:"reduceUpdateExpression",value:function reduceUpdateExpression(){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceUpdateExpression",this).apply(this,arguments);s=s.clearBoundNames();return s;}},{key:"reduceUnaryExpression",value:function reduceUnaryExpression(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceUnaryExpression",this).apply(this,arguments);if(node.operator==="delete"&&node.operand.type==="IdentifierExpression"){s=s.addStrictError(new _earlyErrorState.EarlyError(node,"Identifier expressions must not be deleted in strict mode"));}return s;}},{key:"reduceScript",value:function reduceScript(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceScript",this).apply(this,arguments);s=s.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);s=s.enforceConflictingLexicallyDeclaredNames(s.varDeclaredNames,DUPLICATE_BINDING);s.newTargetExpressions.forEach(function(n){s=s.addError(new _earlyErrorState.EarlyError(n,"new.target must be within function (but not arrow expression) code"));});s=s.enforceFreeContinueStatementErrors(FREE_CONTINUE);s=s.enforceFreeLabeledContinueStatementErrors(UNBOUND_CONTINUE);s=s.enforceFreeBreakStatementErrors(FREE_BREAK);s=s.enforceFreeLabeledBreakStatementErrors(UNBOUND_BREAK);s=s.enforceSuperCallExpressions(SUPERCALL_ERROR);s=s.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR);if(isStrictFunctionBody(node)){s=s.enforceStrictErrors();}return s;}},{key:"reduceSetter",value:function reduceSetter(node,_ref16){var name=_ref16.name,param=_ref16.param,body=_ref16.body;var isSimpleParameterList=node.param.type==="BindingIdentifier";param=param.observeLexicalDeclaration();param=param.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);body=body.enforceConflictingLexicallyDeclaredNames(param.lexicallyDeclaredNames,DUPLICATE_BINDING);param=param.enforceSuperCallExpressions(SUPERCALL_ERROR);body=body.enforceSuperCallExpressions(SUPERCALL_ERROR);param=param.clearSuperPropertyExpressions();body=body.clearSuperPropertyExpressions();param=param.clearNewTargetExpressions();body=body.clearNewTargetExpressions();if(isStrictFunctionBody(node.body)){param=param.enforceStrictErrors();body=body.enforceStrictErrors();}var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceSetter",this).call(this,node,{name,param,body});if(!isSimpleParameterList&&isStrictFunctionBody(node.body)){s=s.addError(new _earlyErrorState.EarlyError(node,'Functions with non-simple parameter lists may not contain a "use strict" directive'));}s=s.observeVarBoundary();return s;}},{key:"reduceStaticMemberExpression",value:function reduceStaticMemberExpression(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceStaticMemberExpression",this).apply(this,arguments);if(node.object.type==="Super"){s=s.observeSuperPropertyExpression(node);}return s;}},{key:"reduceSwitchStatement",value:function reduceSwitchStatement(node,_ref17){var discriminant=_ref17.discriminant,cases=_ref17.cases;var sCases=this.append.apply(this,_toConsumableArray$3(cases));sCases=sCases.functionDeclarationNamesAreLexical();sCases=sCases.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);sCases=sCases.enforceConflictingLexicallyDeclaredNames(sCases.varDeclaredNames,DUPLICATE_BINDING);sCases=sCases.observeLexicalBoundary();var s=this.append(discriminant,sCases);s=s.clearFreeBreakStatements();return s;}},{key:"reduceSwitchStatementWithDefault",value:function reduceSwitchStatementWithDefault(node,_ref18){var discriminant=_ref18.discriminant,preDefaultCases=_ref18.preDefaultCases,defaultCase=_ref18.defaultCase,postDefaultCases=_ref18.postDefaultCases;var sCases=this.append.apply(this,[defaultCase].concat(_toConsumableArray$3(preDefaultCases),_toConsumableArray$3(postDefaultCases)));sCases=sCases.functionDeclarationNamesAreLexical();sCases=sCases.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);sCases=sCases.enforceConflictingLexicallyDeclaredNames(sCases.varDeclaredNames,DUPLICATE_BINDING);sCases=sCases.observeLexicalBoundary();var s=this.append(discriminant,sCases);s=s.clearFreeBreakStatements();return s;}},{key:"reduceVariableDeclaration",value:function reduceVariableDeclaration(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceVariableDeclaration",this).apply(this,arguments);switch(node.kind){case"const":case"let":{s=s.observeLexicalDeclaration();if(s.lexicallyDeclaredNames.has("let")){s.lexicallyDeclaredNames.get("let").forEach(function(n){s=s.addError(new _earlyErrorState.EarlyError(n,'Lexical declarations must not have a binding named "let"'));});}break;}case"var":s=s.observeVarDeclaration();break;}return s;}},{key:"reduceVariableDeclarationStatement",value:function reduceVariableDeclarationStatement(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceVariableDeclarationStatement",this).apply(this,arguments);if(node.declaration.kind==="const"){node.declaration.declarators.forEach(function(declarator){if(declarator.init==null){s=s.addError(new _earlyErrorState.EarlyError(declarator,"Constant lexical declarations must have an initialiser"));}});}return s;}},{key:"reduceWhileStatement",value:function reduceWhileStatement(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceWhileStatement",this).apply(this,arguments);if(isLabelledFunction(node.body)){s=s.addError(new _earlyErrorState.EarlyError(node.body,"The body of a while statement must not be a labeled function declaration"));}s=s.clearFreeContinueStatements().clearFreeBreakStatements();return s;}},{key:"reduceWithStatement",value:function reduceWithStatement(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceWithStatement",this).apply(this,arguments);if(isLabelledFunction(node.body)){s=s.addError(new _earlyErrorState.EarlyError(node.body,"The body of a with statement must not be a labeled function declaration"));}s=s.addStrictError(new _earlyErrorState.EarlyError(node,"Strict mode code must not include a with statement"));return s;}},{key:"reduceYieldExpression",value:function reduceYieldExpression(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceYieldExpression",this).apply(this,arguments);s=s.observeYieldExpression(node);return s;}},{key:"reduceYieldGeneratorExpression",value:function reduceYieldGeneratorExpression(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceYieldGeneratorExpression",this).apply(this,arguments);s=s.observeYieldExpression(node);return s;}}],[{key:"check",value:function check(node){return(0,_shiftReducer2.default)(new EarlyErrorChecker(),node).errors;}}]);return EarlyErrorChecker;}(_shiftReducer$1.MonoidalReducer);var earlyErrors=/* @__PURE__ */_mergeNamespaces({__proto__:null,get EarlyErrorChecker(){return EarlyErrorChecker_1;},"default":earlyErrors$1},[earlyErrors$1]);var require$$2$2=/* @__PURE__ */getAugmentedNamespace(earlyErrors);(function(exports2){Object.defineProperty(exports2,"__esModule",{value:true});exports2.TokenType=exports2.TokenClass=exports2.Tokenizer=exports2.ParserWithLocation=exports2.GenericParser=exports2.EarlyErrorChecker=exports2.parseScriptWithLocation=exports2.parseModuleWithLocation=exports2.parseScript=exports2.parseModule=void 0;var _createClass2=function(){function defineProperties(target,props){for(var i2=0;i21&&arguments[1]!==void 0?arguments[1]:{},_ref$earlyErrors=_ref.earlyErrors,earlyErrors2=_ref$earlyErrors===void 0?true:_ref$earlyErrors;var parser2=new _parser.GenericParser(code2);var tree=parser2[parsingFunctionName]();if(earlyErrors2){var errors2=_earlyErrors.EarlyErrorChecker.check(tree);if(errors2.length>0){throw new _tokenizer3.JsError(0,1,0,errors2[0].message);}}return tree;};}function generateInterfaceWithLocation(parsingFunctionName){return function parse(code2){var _ref2=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_ref2$earlyErrors=_ref2.earlyErrors,earlyErrors2=_ref2$earlyErrors===void 0?true:_ref2$earlyErrors;var parser2=new ParserWithLocation(code2);var tree=parser2[parsingFunctionName]();if(earlyErrors2){var errors2=_earlyErrors.EarlyErrorChecker.check(tree);if(errors2.length>0){var _errors$=errors2[0],node=_errors$.node,message=_errors$.message;var _parser$locations$get=parser2.locations.get(node).start,offset=_parser$locations$get.offset,line=_parser$locations$get.line,column=_parser$locations$get.column;throw new _tokenizer3.JsError(offset,line,column,message);}}return{tree,locations:parser2.locations,comments:parser2.comments};};}exports2.parseModule=generateInterface("parseModule");var parseScript=exports2.parseScript=generateInterface("parseScript");exports2.parseModuleWithLocation=generateInterfaceWithLocation("parseModule");exports2.parseScriptWithLocation=generateInterfaceWithLocation("parseScript");exports2.default=parseScript;exports2.EarlyErrorChecker=_earlyErrors.EarlyErrorChecker;exports2.GenericParser=_parser.GenericParser;exports2.ParserWithLocation=ParserWithLocation;})(dist$b);var dist$2={};Object.defineProperty(dist$2,"__esModule",{value:true});var _default$2=dist$2["default"]=function(){var SPEC={};var BOOLEAN={typeName:"Boolean"};var DOUBLE={typeName:"Number"};var STRING={typeName:"String"};function Maybe(arg){return{typeName:"Maybe",argument:arg};}function List(arg){return{typeName:"List",argument:arg};}function Const(arg){return{typeName:"Const",argument:arg};}function Union(){return{typeName:"Union",arguments:[].slice.call(arguments,0)};}var TYPE_INDICATOR={typeName:"Enum",values:["ArrayAssignmentTarget","ArrayBinding","ArrayExpression","ArrowExpression","AssignmentExpression","AssignmentTargetIdentifier","AssignmentTargetPropertyIdentifier","AssignmentTargetPropertyProperty","AssignmentTargetWithDefault","AwaitExpression","BinaryExpression","BindingIdentifier","BindingPropertyIdentifier","BindingPropertyProperty","BindingWithDefault","Block","BlockStatement","BreakStatement","CallExpression","CatchClause","ClassDeclaration","ClassElement","ClassExpression","CompoundAssignmentExpression","ComputedMemberAssignmentTarget","ComputedMemberExpression","ComputedPropertyName","ConditionalExpression","ContinueStatement","DataProperty","DebuggerStatement","Directive","DoWhileStatement","EmptyStatement","Export","ExportAllFrom","ExportDefault","ExportFrom","ExportFromSpecifier","ExportLocalSpecifier","ExportLocals","ExpressionStatement","ForAwaitStatement","ForInStatement","ForOfStatement","ForStatement","FormalParameters","FunctionBody","FunctionDeclaration","FunctionExpression","Getter","IdentifierExpression","IfStatement","Import","ImportNamespace","ImportSpecifier","LabeledStatement","LiteralBooleanExpression","LiteralInfinityExpression","LiteralNullExpression","LiteralNumericExpression","LiteralRegExpExpression","LiteralStringExpression","Method","Module","NewExpression","NewTargetExpression","ObjectAssignmentTarget","ObjectBinding","ObjectExpression","ReturnStatement","Script","Setter","ShorthandProperty","SpreadElement","SpreadProperty","StaticMemberAssignmentTarget","StaticMemberExpression","StaticPropertyName","Super","SwitchCase","SwitchDefault","SwitchStatement","SwitchStatementWithDefault","TemplateElement","TemplateExpression","ThisExpression","ThrowStatement","TryCatchStatement","TryFinallyStatement","UnaryExpression","UpdateExpression","VariableDeclaration","VariableDeclarationStatement","VariableDeclarator","WhileStatement","WithStatement","YieldExpression","YieldGeneratorExpression"]};var BinaryOperator={typeName:"Enum",values:["==","!=","===","!==","<","<=",">",">=","in","instanceof","<<",">>",">>>","+","-","*","/","%","**",",","||","&&","|","^","&"]};var CompoundAssignmentOperator={typeName:"Enum",values:["+=","-=","*=","/=","%=","**=","<<=",">>=",">>>=","|=","^=","&="]};var UnaryOperator={typeName:"Enum",values:["+","-","!","~","typeof","void","delete"]};var UpdateOperator={typeName:"Enum",values:["++","--"]};var VariableDeclarationKind={typeName:"Enum",values:["var","let","const"]};var ArrayAssignmentTarget6=SPEC.ArrayAssignmentTarget={};var ArrayBinding6=SPEC.ArrayBinding={};var ArrayExpression6=SPEC.ArrayExpression={};var ArrowExpression6=SPEC.ArrowExpression={};var AssignmentExpression6=SPEC.AssignmentExpression={};var AssignmentTargetIdentifier6=SPEC.AssignmentTargetIdentifier={};var AssignmentTargetPropertyIdentifier6=SPEC.AssignmentTargetPropertyIdentifier={};var AssignmentTargetPropertyProperty6=SPEC.AssignmentTargetPropertyProperty={};var AssignmentTargetWithDefault6=SPEC.AssignmentTargetWithDefault={};var AwaitExpression6=SPEC.AwaitExpression={};var BinaryExpression6=SPEC.BinaryExpression={};var BindingIdentifier6=SPEC.BindingIdentifier={};var BindingPropertyIdentifier6=SPEC.BindingPropertyIdentifier={};var BindingPropertyProperty6=SPEC.BindingPropertyProperty={};var BindingWithDefault6=SPEC.BindingWithDefault={};var Block6=SPEC.Block={};var BlockStatement6=SPEC.BlockStatement={};var BreakStatement6=SPEC.BreakStatement={};var CallExpression6=SPEC.CallExpression={};var CatchClause6=SPEC.CatchClause={};var ClassDeclaration6=SPEC.ClassDeclaration={};var ClassElement6=SPEC.ClassElement={};var ClassExpression6=SPEC.ClassExpression={};var CompoundAssignmentExpression6=SPEC.CompoundAssignmentExpression={};var ComputedMemberAssignmentTarget6=SPEC.ComputedMemberAssignmentTarget={};var ComputedMemberExpression6=SPEC.ComputedMemberExpression={};var ComputedPropertyName6=SPEC.ComputedPropertyName={};var ConditionalExpression6=SPEC.ConditionalExpression={};var ContinueStatement6=SPEC.ContinueStatement={};var DataProperty6=SPEC.DataProperty={};var DebuggerStatement6=SPEC.DebuggerStatement={};var Directive6=SPEC.Directive={};var DoWhileStatement6=SPEC.DoWhileStatement={};var EmptyStatement6=SPEC.EmptyStatement={};var Export6=SPEC.Export={};var ExportAllFrom6=SPEC.ExportAllFrom={};var ExportDefault6=SPEC.ExportDefault={};var ExportFrom6=SPEC.ExportFrom={};var ExportFromSpecifier6=SPEC.ExportFromSpecifier={};var ExportLocalSpecifier6=SPEC.ExportLocalSpecifier={};var ExportLocals6=SPEC.ExportLocals={};var ExpressionStatement6=SPEC.ExpressionStatement={};var ForAwaitStatement6=SPEC.ForAwaitStatement={};var ForInStatement6=SPEC.ForInStatement={};var ForOfStatement6=SPEC.ForOfStatement={};var ForStatement6=SPEC.ForStatement={};var FormalParameters6=SPEC.FormalParameters={};var FunctionBody6=SPEC.FunctionBody={};var FunctionDeclaration6=SPEC.FunctionDeclaration={};var FunctionExpression6=SPEC.FunctionExpression={};var Getter6=SPEC.Getter={};var IdentifierExpression6=SPEC.IdentifierExpression={};var IfStatement6=SPEC.IfStatement={};var Import6=SPEC.Import={};var ImportNamespace6=SPEC.ImportNamespace={};var ImportSpecifier6=SPEC.ImportSpecifier={};var LabeledStatement6=SPEC.LabeledStatement={};var LiteralBooleanExpression6=SPEC.LiteralBooleanExpression={};var LiteralInfinityExpression6=SPEC.LiteralInfinityExpression={};var LiteralNullExpression6=SPEC.LiteralNullExpression={};var LiteralNumericExpression6=SPEC.LiteralNumericExpression={};var LiteralRegExpExpression6=SPEC.LiteralRegExpExpression={};var LiteralStringExpression6=SPEC.LiteralStringExpression={};var Method6=SPEC.Method={};var Module6=SPEC.Module={};var NewExpression6=SPEC.NewExpression={};var NewTargetExpression6=SPEC.NewTargetExpression={};var ObjectAssignmentTarget6=SPEC.ObjectAssignmentTarget={};var ObjectBinding6=SPEC.ObjectBinding={};var ObjectExpression6=SPEC.ObjectExpression={};var ReturnStatement6=SPEC.ReturnStatement={};var Script6=SPEC.Script={};var Setter6=SPEC.Setter={};var ShorthandProperty6=SPEC.ShorthandProperty={};var SpreadElement6=SPEC.SpreadElement={};var SpreadProperty6=SPEC.SpreadProperty={};var StaticMemberAssignmentTarget6=SPEC.StaticMemberAssignmentTarget={};var StaticMemberExpression6=SPEC.StaticMemberExpression={};var StaticPropertyName6=SPEC.StaticPropertyName={};var Super6=SPEC.Super={};var SwitchCase6=SPEC.SwitchCase={};var SwitchDefault6=SPEC.SwitchDefault={};var SwitchStatement6=SPEC.SwitchStatement={};var SwitchStatementWithDefault6=SPEC.SwitchStatementWithDefault={};var TemplateElement6=SPEC.TemplateElement={};var TemplateExpression6=SPEC.TemplateExpression={};var ThisExpression6=SPEC.ThisExpression={};var ThrowStatement6=SPEC.ThrowStatement={};var TryCatchStatement6=SPEC.TryCatchStatement={};var TryFinallyStatement6=SPEC.TryFinallyStatement={};var UnaryExpression6=SPEC.UnaryExpression={};var UpdateExpression6=SPEC.UpdateExpression={};var VariableDeclaration6=SPEC.VariableDeclaration={};var VariableDeclarationStatement6=SPEC.VariableDeclarationStatement={};var VariableDeclarator6=SPEC.VariableDeclarator={};var WhileStatement6=SPEC.WhileStatement={};var WithStatement6=SPEC.WithStatement={};var YieldExpression6=SPEC.YieldExpression={};var YieldGeneratorExpression6=SPEC.YieldGeneratorExpression={};var MemberExpression=Union(ComputedMemberExpression6,StaticMemberExpression6);var AssignmentTargetProperty=Union(AssignmentTargetPropertyIdentifier6,AssignmentTargetPropertyProperty6);Union(ClassDeclaration6,ClassExpression6);var ExportDeclaration=Union(Export6,ExportAllFrom6,ExportDefault6,ExportFrom6,ExportLocals6);var PropertyName=Union(ComputedPropertyName6,StaticPropertyName6);Union(FunctionDeclaration6,FunctionExpression6);var ImportDeclaration=Union(Import6,ImportNamespace6);var IterationStatement=Union(DoWhileStatement6,ForAwaitStatement6,ForInStatement6,ForOfStatement6,ForStatement6,WhileStatement6);var MemberAssignmentTarget=Union(ComputedMemberAssignmentTarget6,StaticMemberAssignmentTarget6);var BindingProperty=Union(BindingPropertyIdentifier6,BindingPropertyProperty6);var MethodDefinition=Union(Getter6,Method6,Setter6);var Program=Union(Module6,Script6);var VariableReference=Union(AssignmentTargetIdentifier6,BindingIdentifier6,IdentifierExpression6);var NamedObjectProperty=Union(DataProperty6,MethodDefinition);var Expression=Union(ArrayExpression6,ArrowExpression6,AssignmentExpression6,AwaitExpression6,BinaryExpression6,CallExpression6,ClassExpression6,CompoundAssignmentExpression6,ConditionalExpression6,FunctionExpression6,IdentifierExpression6,LiteralBooleanExpression6,LiteralInfinityExpression6,LiteralNullExpression6,LiteralNumericExpression6,LiteralRegExpExpression6,LiteralStringExpression6,MemberExpression,NewExpression6,NewTargetExpression6,ObjectExpression6,TemplateExpression6,ThisExpression6,UnaryExpression6,UpdateExpression6,YieldExpression6,YieldGeneratorExpression6);var Statement=Union(BlockStatement6,BreakStatement6,ClassDeclaration6,ContinueStatement6,DebuggerStatement6,EmptyStatement6,ExpressionStatement6,FunctionDeclaration6,IfStatement6,IterationStatement,LabeledStatement6,ReturnStatement6,SwitchStatement6,SwitchStatementWithDefault6,ThrowStatement6,TryCatchStatement6,TryFinallyStatement6,VariableDeclarationStatement6,WithStatement6);var ObjectProperty=Union(NamedObjectProperty,ShorthandProperty6,SpreadProperty6);Union(ArrayAssignmentTarget6,ArrayBinding6,AssignmentTargetProperty,AssignmentTargetWithDefault6,BindingProperty,BindingWithDefault6,Block6,CatchClause6,ClassElement6,Directive6,ExportDeclaration,ExportFromSpecifier6,ExportLocalSpecifier6,Expression,FormalParameters6,FunctionBody6,ImportDeclaration,ImportSpecifier6,MemberAssignmentTarget,ObjectAssignmentTarget6,ObjectBinding6,ObjectProperty,Program,PropertyName,SpreadElement6,Statement,Super6,SwitchCase6,SwitchDefault6,TemplateElement6,VariableDeclaration6,VariableDeclarator6,VariableReference);ArrayAssignmentTarget6.typeName="ArrayAssignmentTarget";ArrayAssignmentTarget6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ArrayAssignmentTarget"},{name:"elements",type:List(Maybe(Union(AssignmentTargetWithDefault6,Union(Union(ArrayAssignmentTarget6,ObjectAssignmentTarget6),Union(AssignmentTargetIdentifier6,MemberAssignmentTarget)))))},{name:"rest",type:Maybe(Union(Union(ArrayAssignmentTarget6,ObjectAssignmentTarget6),Union(AssignmentTargetIdentifier6,MemberAssignmentTarget)))}];ArrayBinding6.typeName="ArrayBinding";ArrayBinding6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ArrayBinding"},{name:"elements",type:List(Maybe(Union(BindingWithDefault6,Union(BindingIdentifier6,Union(ArrayBinding6,ObjectBinding6)))))},{name:"rest",type:Maybe(Union(BindingIdentifier6,Union(ArrayBinding6,ObjectBinding6)))}];ArrayExpression6.typeName="ArrayExpression";ArrayExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ArrayExpression"},{name:"elements",type:List(Maybe(Union(Expression,SpreadElement6)))}];ArrowExpression6.typeName="ArrowExpression";ArrowExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ArrowExpression"},{name:"isAsync",type:BOOLEAN},{name:"params",type:FormalParameters6},{name:"body",type:Union(Expression,FunctionBody6)}];AssignmentExpression6.typeName="AssignmentExpression";AssignmentExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"AssignmentExpression"},{name:"binding",type:Union(Union(ArrayAssignmentTarget6,ObjectAssignmentTarget6),Union(AssignmentTargetIdentifier6,MemberAssignmentTarget))},{name:"expression",type:Expression}];AssignmentTargetIdentifier6.typeName="AssignmentTargetIdentifier";AssignmentTargetIdentifier6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"AssignmentTargetIdentifier"},{name:"name",type:STRING}];AssignmentTargetPropertyIdentifier6.typeName="AssignmentTargetPropertyIdentifier";AssignmentTargetPropertyIdentifier6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"AssignmentTargetPropertyIdentifier"},{name:"binding",type:AssignmentTargetIdentifier6},{name:"init",type:Maybe(Expression)}];AssignmentTargetPropertyProperty6.typeName="AssignmentTargetPropertyProperty";AssignmentTargetPropertyProperty6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"AssignmentTargetPropertyProperty"},{name:"name",type:PropertyName},{name:"binding",type:Union(AssignmentTargetWithDefault6,Union(Union(ArrayAssignmentTarget6,ObjectAssignmentTarget6),Union(AssignmentTargetIdentifier6,MemberAssignmentTarget)))}];AssignmentTargetWithDefault6.typeName="AssignmentTargetWithDefault";AssignmentTargetWithDefault6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"AssignmentTargetWithDefault"},{name:"binding",type:Union(Union(ArrayAssignmentTarget6,ObjectAssignmentTarget6),Union(AssignmentTargetIdentifier6,MemberAssignmentTarget))},{name:"init",type:Expression}];AwaitExpression6.typeName="AwaitExpression";AwaitExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"AwaitExpression"},{name:"expression",type:Expression}];BinaryExpression6.typeName="BinaryExpression";BinaryExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"BinaryExpression"},{name:"left",type:Expression},{name:"operator",type:BinaryOperator},{name:"right",type:Expression}];BindingIdentifier6.typeName="BindingIdentifier";BindingIdentifier6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"BindingIdentifier"},{name:"name",type:STRING}];BindingPropertyIdentifier6.typeName="BindingPropertyIdentifier";BindingPropertyIdentifier6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"BindingPropertyIdentifier"},{name:"binding",type:BindingIdentifier6},{name:"init",type:Maybe(Expression)}];BindingPropertyProperty6.typeName="BindingPropertyProperty";BindingPropertyProperty6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"BindingPropertyProperty"},{name:"name",type:PropertyName},{name:"binding",type:Union(BindingWithDefault6,Union(BindingIdentifier6,Union(ArrayBinding6,ObjectBinding6)))}];BindingWithDefault6.typeName="BindingWithDefault";BindingWithDefault6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"BindingWithDefault"},{name:"binding",type:Union(BindingIdentifier6,Union(ArrayBinding6,ObjectBinding6))},{name:"init",type:Expression}];Block6.typeName="Block";Block6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"Block"},{name:"statements",type:List(Statement)}];BlockStatement6.typeName="BlockStatement";BlockStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"BlockStatement"},{name:"block",type:Block6}];BreakStatement6.typeName="BreakStatement";BreakStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"BreakStatement"},{name:"label",type:Maybe(STRING)}];CallExpression6.typeName="CallExpression";CallExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"CallExpression"},{name:"callee",type:Union(Expression,Super6)},{name:"arguments",type:List(Union(Expression,SpreadElement6))}];CatchClause6.typeName="CatchClause";CatchClause6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"CatchClause"},{name:"binding",type:Union(BindingIdentifier6,Union(ArrayBinding6,ObjectBinding6))},{name:"body",type:Block6}];ClassDeclaration6.typeName="ClassDeclaration";ClassDeclaration6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ClassDeclaration"},{name:"name",type:BindingIdentifier6},{name:"super",type:Maybe(Expression)},{name:"elements",type:List(ClassElement6)}];ClassElement6.typeName="ClassElement";ClassElement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ClassElement"},{name:"isStatic",type:BOOLEAN},{name:"method",type:MethodDefinition}];ClassExpression6.typeName="ClassExpression";ClassExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ClassExpression"},{name:"name",type:Maybe(BindingIdentifier6)},{name:"super",type:Maybe(Expression)},{name:"elements",type:List(ClassElement6)}];CompoundAssignmentExpression6.typeName="CompoundAssignmentExpression";CompoundAssignmentExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"CompoundAssignmentExpression"},{name:"binding",type:Union(AssignmentTargetIdentifier6,MemberAssignmentTarget)},{name:"operator",type:CompoundAssignmentOperator},{name:"expression",type:Expression}];ComputedMemberAssignmentTarget6.typeName="ComputedMemberAssignmentTarget";ComputedMemberAssignmentTarget6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ComputedMemberAssignmentTarget"},{name:"object",type:Union(Expression,Super6)},{name:"expression",type:Expression}];ComputedMemberExpression6.typeName="ComputedMemberExpression";ComputedMemberExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ComputedMemberExpression"},{name:"object",type:Union(Expression,Super6)},{name:"expression",type:Expression}];ComputedPropertyName6.typeName="ComputedPropertyName";ComputedPropertyName6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ComputedPropertyName"},{name:"expression",type:Expression}];ConditionalExpression6.typeName="ConditionalExpression";ConditionalExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ConditionalExpression"},{name:"test",type:Expression},{name:"consequent",type:Expression},{name:"alternate",type:Expression}];ContinueStatement6.typeName="ContinueStatement";ContinueStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ContinueStatement"},{name:"label",type:Maybe(STRING)}];DataProperty6.typeName="DataProperty";DataProperty6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"DataProperty"},{name:"name",type:PropertyName},{name:"expression",type:Expression}];DebuggerStatement6.typeName="DebuggerStatement";DebuggerStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"DebuggerStatement"}];Directive6.typeName="Directive";Directive6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"Directive"},{name:"rawValue",type:STRING}];DoWhileStatement6.typeName="DoWhileStatement";DoWhileStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"DoWhileStatement"},{name:"body",type:Statement},{name:"test",type:Expression}];EmptyStatement6.typeName="EmptyStatement";EmptyStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"EmptyStatement"}];Export6.typeName="Export";Export6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"Export"},{name:"declaration",type:Union(ClassDeclaration6,FunctionDeclaration6,VariableDeclaration6)}];ExportAllFrom6.typeName="ExportAllFrom";ExportAllFrom6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ExportAllFrom"},{name:"moduleSpecifier",type:STRING}];ExportDefault6.typeName="ExportDefault";ExportDefault6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ExportDefault"},{name:"body",type:Union(ClassDeclaration6,Expression,FunctionDeclaration6)}];ExportFrom6.typeName="ExportFrom";ExportFrom6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ExportFrom"},{name:"namedExports",type:List(ExportFromSpecifier6)},{name:"moduleSpecifier",type:STRING}];ExportFromSpecifier6.typeName="ExportFromSpecifier";ExportFromSpecifier6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ExportFromSpecifier"},{name:"name",type:STRING},{name:"exportedName",type:Maybe(STRING)}];ExportLocalSpecifier6.typeName="ExportLocalSpecifier";ExportLocalSpecifier6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ExportLocalSpecifier"},{name:"name",type:IdentifierExpression6},{name:"exportedName",type:Maybe(STRING)}];ExportLocals6.typeName="ExportLocals";ExportLocals6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ExportLocals"},{name:"namedExports",type:List(ExportLocalSpecifier6)}];ExpressionStatement6.typeName="ExpressionStatement";ExpressionStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ExpressionStatement"},{name:"expression",type:Expression}];ForAwaitStatement6.typeName="ForAwaitStatement";ForAwaitStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ForAwaitStatement"},{name:"left",type:Union(Union(Union(ArrayAssignmentTarget6,ObjectAssignmentTarget6),Union(AssignmentTargetIdentifier6,MemberAssignmentTarget)),VariableDeclaration6)},{name:"right",type:Expression},{name:"body",type:Statement}];ForInStatement6.typeName="ForInStatement";ForInStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ForInStatement"},{name:"left",type:Union(Union(Union(ArrayAssignmentTarget6,ObjectAssignmentTarget6),Union(AssignmentTargetIdentifier6,MemberAssignmentTarget)),VariableDeclaration6)},{name:"right",type:Expression},{name:"body",type:Statement}];ForOfStatement6.typeName="ForOfStatement";ForOfStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ForOfStatement"},{name:"left",type:Union(Union(Union(ArrayAssignmentTarget6,ObjectAssignmentTarget6),Union(AssignmentTargetIdentifier6,MemberAssignmentTarget)),VariableDeclaration6)},{name:"right",type:Expression},{name:"body",type:Statement}];ForStatement6.typeName="ForStatement";ForStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ForStatement"},{name:"init",type:Maybe(Union(Expression,VariableDeclaration6))},{name:"test",type:Maybe(Expression)},{name:"update",type:Maybe(Expression)},{name:"body",type:Statement}];FormalParameters6.typeName="FormalParameters";FormalParameters6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"FormalParameters"},{name:"items",type:List(Union(BindingWithDefault6,Union(BindingIdentifier6,Union(ArrayBinding6,ObjectBinding6))))},{name:"rest",type:Maybe(Union(BindingIdentifier6,Union(ArrayBinding6,ObjectBinding6)))}];FunctionBody6.typeName="FunctionBody";FunctionBody6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"FunctionBody"},{name:"directives",type:List(Directive6)},{name:"statements",type:List(Statement)}];FunctionDeclaration6.typeName="FunctionDeclaration";FunctionDeclaration6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"FunctionDeclaration"},{name:"isAsync",type:BOOLEAN},{name:"isGenerator",type:BOOLEAN},{name:"name",type:BindingIdentifier6},{name:"params",type:FormalParameters6},{name:"body",type:FunctionBody6}];FunctionExpression6.typeName="FunctionExpression";FunctionExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"FunctionExpression"},{name:"isAsync",type:BOOLEAN},{name:"isGenerator",type:BOOLEAN},{name:"name",type:Maybe(BindingIdentifier6)},{name:"params",type:FormalParameters6},{name:"body",type:FunctionBody6}];Getter6.typeName="Getter";Getter6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"Getter"},{name:"name",type:PropertyName},{name:"body",type:FunctionBody6}];IdentifierExpression6.typeName="IdentifierExpression";IdentifierExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"IdentifierExpression"},{name:"name",type:STRING}];IfStatement6.typeName="IfStatement";IfStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"IfStatement"},{name:"test",type:Expression},{name:"consequent",type:Statement},{name:"alternate",type:Maybe(Statement)}];Import6.typeName="Import";Import6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"Import"},{name:"defaultBinding",type:Maybe(BindingIdentifier6)},{name:"namedImports",type:List(ImportSpecifier6)},{name:"moduleSpecifier",type:STRING}];ImportNamespace6.typeName="ImportNamespace";ImportNamespace6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ImportNamespace"},{name:"defaultBinding",type:Maybe(BindingIdentifier6)},{name:"namespaceBinding",type:BindingIdentifier6},{name:"moduleSpecifier",type:STRING}];ImportSpecifier6.typeName="ImportSpecifier";ImportSpecifier6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ImportSpecifier"},{name:"name",type:Maybe(STRING)},{name:"binding",type:BindingIdentifier6}];LabeledStatement6.typeName="LabeledStatement";LabeledStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"LabeledStatement"},{name:"label",type:STRING},{name:"body",type:Statement}];LiteralBooleanExpression6.typeName="LiteralBooleanExpression";LiteralBooleanExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"LiteralBooleanExpression"},{name:"value",type:BOOLEAN}];LiteralInfinityExpression6.typeName="LiteralInfinityExpression";LiteralInfinityExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"LiteralInfinityExpression"}];LiteralNullExpression6.typeName="LiteralNullExpression";LiteralNullExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"LiteralNullExpression"}];LiteralNumericExpression6.typeName="LiteralNumericExpression";LiteralNumericExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"LiteralNumericExpression"},{name:"value",type:DOUBLE}];LiteralRegExpExpression6.typeName="LiteralRegExpExpression";LiteralRegExpExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"LiteralRegExpExpression"},{name:"pattern",type:STRING},{name:"global",type:BOOLEAN},{name:"ignoreCase",type:BOOLEAN},{name:"multiLine",type:BOOLEAN},{name:"dotAll",type:BOOLEAN},{name:"unicode",type:BOOLEAN},{name:"sticky",type:BOOLEAN}];LiteralStringExpression6.typeName="LiteralStringExpression";LiteralStringExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"LiteralStringExpression"},{name:"value",type:STRING}];Method6.typeName="Method";Method6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"Method"},{name:"isAsync",type:BOOLEAN},{name:"isGenerator",type:BOOLEAN},{name:"name",type:PropertyName},{name:"params",type:FormalParameters6},{name:"body",type:FunctionBody6}];Module6.typeName="Module";Module6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"Module"},{name:"directives",type:List(Directive6)},{name:"items",type:List(Union(ExportDeclaration,ImportDeclaration,Statement))}];NewExpression6.typeName="NewExpression";NewExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"NewExpression"},{name:"callee",type:Expression},{name:"arguments",type:List(Union(Expression,SpreadElement6))}];NewTargetExpression6.typeName="NewTargetExpression";NewTargetExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"NewTargetExpression"}];ObjectAssignmentTarget6.typeName="ObjectAssignmentTarget";ObjectAssignmentTarget6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ObjectAssignmentTarget"},{name:"properties",type:List(AssignmentTargetProperty)},{name:"rest",type:Maybe(Union(Union(ArrayAssignmentTarget6,ObjectAssignmentTarget6),Union(AssignmentTargetIdentifier6,MemberAssignmentTarget)))}];ObjectBinding6.typeName="ObjectBinding";ObjectBinding6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ObjectBinding"},{name:"properties",type:List(BindingProperty)},{name:"rest",type:Maybe(Union(BindingIdentifier6,Union(ArrayBinding6,ObjectBinding6)))}];ObjectExpression6.typeName="ObjectExpression";ObjectExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ObjectExpression"},{name:"properties",type:List(ObjectProperty)}];ReturnStatement6.typeName="ReturnStatement";ReturnStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ReturnStatement"},{name:"expression",type:Maybe(Expression)}];Script6.typeName="Script";Script6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"Script"},{name:"directives",type:List(Directive6)},{name:"statements",type:List(Statement)}];Setter6.typeName="Setter";Setter6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"Setter"},{name:"name",type:PropertyName},{name:"param",type:Union(BindingWithDefault6,Union(BindingIdentifier6,Union(ArrayBinding6,ObjectBinding6)))},{name:"body",type:FunctionBody6}];ShorthandProperty6.typeName="ShorthandProperty";ShorthandProperty6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ShorthandProperty"},{name:"name",type:IdentifierExpression6}];SpreadElement6.typeName="SpreadElement";SpreadElement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"SpreadElement"},{name:"expression",type:Expression}];SpreadProperty6.typeName="SpreadProperty";SpreadProperty6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"SpreadProperty"},{name:"expression",type:Expression}];StaticMemberAssignmentTarget6.typeName="StaticMemberAssignmentTarget";StaticMemberAssignmentTarget6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"StaticMemberAssignmentTarget"},{name:"object",type:Union(Expression,Super6)},{name:"property",type:STRING}];StaticMemberExpression6.typeName="StaticMemberExpression";StaticMemberExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"StaticMemberExpression"},{name:"object",type:Union(Expression,Super6)},{name:"property",type:STRING}];StaticPropertyName6.typeName="StaticPropertyName";StaticPropertyName6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"StaticPropertyName"},{name:"value",type:STRING}];Super6.typeName="Super";Super6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"Super"}];SwitchCase6.typeName="SwitchCase";SwitchCase6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"SwitchCase"},{name:"test",type:Expression},{name:"consequent",type:List(Statement)}];SwitchDefault6.typeName="SwitchDefault";SwitchDefault6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"SwitchDefault"},{name:"consequent",type:List(Statement)}];SwitchStatement6.typeName="SwitchStatement";SwitchStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"SwitchStatement"},{name:"discriminant",type:Expression},{name:"cases",type:List(SwitchCase6)}];SwitchStatementWithDefault6.typeName="SwitchStatementWithDefault";SwitchStatementWithDefault6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"SwitchStatementWithDefault"},{name:"discriminant",type:Expression},{name:"preDefaultCases",type:List(SwitchCase6)},{name:"defaultCase",type:SwitchDefault6},{name:"postDefaultCases",type:List(SwitchCase6)}];TemplateElement6.typeName="TemplateElement";TemplateElement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"TemplateElement"},{name:"rawValue",type:STRING}];TemplateExpression6.typeName="TemplateExpression";TemplateExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"TemplateExpression"},{name:"tag",type:Maybe(Expression)},{name:"elements",type:List(Union(Expression,TemplateElement6))}];ThisExpression6.typeName="ThisExpression";ThisExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ThisExpression"}];ThrowStatement6.typeName="ThrowStatement";ThrowStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ThrowStatement"},{name:"expression",type:Expression}];TryCatchStatement6.typeName="TryCatchStatement";TryCatchStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"TryCatchStatement"},{name:"body",type:Block6},{name:"catchClause",type:CatchClause6}];TryFinallyStatement6.typeName="TryFinallyStatement";TryFinallyStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"TryFinallyStatement"},{name:"body",type:Block6},{name:"catchClause",type:Maybe(CatchClause6)},{name:"finalizer",type:Block6}];UnaryExpression6.typeName="UnaryExpression";UnaryExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"UnaryExpression"},{name:"operator",type:UnaryOperator},{name:"operand",type:Expression}];UpdateExpression6.typeName="UpdateExpression";UpdateExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"UpdateExpression"},{name:"isPrefix",type:BOOLEAN},{name:"operator",type:UpdateOperator},{name:"operand",type:Union(AssignmentTargetIdentifier6,MemberAssignmentTarget)}];VariableDeclaration6.typeName="VariableDeclaration";VariableDeclaration6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"VariableDeclaration"},{name:"kind",type:VariableDeclarationKind},{name:"declarators",type:List(VariableDeclarator6)}];VariableDeclarationStatement6.typeName="VariableDeclarationStatement";VariableDeclarationStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"VariableDeclarationStatement"},{name:"declaration",type:VariableDeclaration6}];VariableDeclarator6.typeName="VariableDeclarator";VariableDeclarator6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"VariableDeclarator"},{name:"binding",type:Union(BindingIdentifier6,Union(ArrayBinding6,ObjectBinding6))},{name:"init",type:Maybe(Expression)}];WhileStatement6.typeName="WhileStatement";WhileStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"WhileStatement"},{name:"test",type:Expression},{name:"body",type:Statement}];WithStatement6.typeName="WithStatement";WithStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"WithStatement"},{name:"object",type:Expression},{name:"body",type:Statement}];YieldExpression6.typeName="YieldExpression";YieldExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"YieldExpression"},{name:"expression",type:Maybe(Expression)}];YieldGeneratorExpression6.typeName="YieldGeneratorExpression";YieldGeneratorExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"YieldGeneratorExpression"},{name:"expression",type:Expression}];return SPEC;}();var estraverse$1={};(function(exports2){(function clone(exports3){var Syntax,VisitorOption,VisitorKeys,BREAK,SKIP,REMOVE;function deepCopy(obj){var ret={},key,val;for(key in obj){if(obj.hasOwnProperty(key)){val=obj[key];if(typeof val==="object"&&val!==null){ret[key]=deepCopy(val);}else{ret[key]=val;}}}return ret;}function upperBound(array,func){var diff,len,i2,current;len=array.length;i2=0;while(len){diff=len>>>1;current=i2+diff;if(func(array[current])){len=diff;}else{i2=current+1;len-=diff+1;}}return i2;}Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ChainExpression:"ChainExpression",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",PrivateIdentifier:"PrivateIdentifier",Program:"Program",Property:"Property",PropertyDefinition:"PropertyDefinition",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"};VisitorKeys={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]};BREAK={};SKIP={};REMOVE={};VisitorOption={Break:BREAK,Skip:SKIP,Remove:REMOVE};function Reference(parent,key){this.parent=parent;this.key=key;}Reference.prototype.replace=function replace2(node){this.parent[this.key]=node;};Reference.prototype.remove=function remove(){if(Array.isArray(this.parent)){this.parent.splice(this.key,1);return true;}else{this.replace(null);return false;}};function Element(node,path,wrap,ref){this.node=node;this.path=path;this.wrap=wrap;this.ref=ref;}function Controller(){}Controller.prototype.path=function path(){var i2,iz,j,jz,result,element;function addToPath(result2,path2){if(Array.isArray(path2)){for(j=0,jz=path2.length;j=0;--i2){if(leavelist[i2].node===candidate){return true;}}return false;}Controller.prototype.traverse=function traverse2(root,visitor){var worklist,leavelist,element,node,nodeType,ret,key,current,current2,candidates,candidate,sentinel;this.__initialize(root,visitor);sentinel={};worklist=this.__worklist;leavelist=this.__leavelist;worklist.push(new Element(root,null,null,null));leavelist.push(new Element(null,null,null,null));while(worklist.length){element=worklist.pop();if(element===sentinel){element=leavelist.pop();ret=this.__execute(visitor.leave,element);if(this.__state===BREAK||ret===BREAK){return;}continue;}if(element.node){ret=this.__execute(visitor.enter,element);if(this.__state===BREAK||ret===BREAK){return;}worklist.push(sentinel);leavelist.push(element);if(this.__state===SKIP||ret===SKIP){continue;}node=element.node;nodeType=node.type||element.wrap;candidates=this.__keys[nodeType];if(!candidates){if(this.__fallback){candidates=this.__fallback(node);}else{throw new Error("Unknown node type "+nodeType+".");}}current=candidates.length;while((current-=1)>=0){key=candidates[current];candidate=node[key];if(!candidate){continue;}if(Array.isArray(candidate)){current2=candidate.length;while((current2-=1)>=0){if(!candidate[current2]){continue;}if(candidateExistsInLeaveList(leavelist,candidate[current2])){continue;}if(isProperty(nodeType,candidates[current])){element=new Element(candidate[current2],[key,current2],"Property",null);}else if(isNode(candidate[current2])){element=new Element(candidate[current2],[key,current2],null,null);}else{continue;}worklist.push(element);}}else if(isNode(candidate)){if(candidateExistsInLeaveList(leavelist,candidate)){continue;}worklist.push(new Element(candidate,key,null,null));}}}}};Controller.prototype.replace=function replace2(root,visitor){var worklist,leavelist,node,nodeType,target,element,current,current2,candidates,candidate,sentinel,outer,key;function removeElem(element2){var i2,key2,nextElem,parent;if(element2.ref.remove()){key2=element2.ref.key;parent=element2.ref.parent;i2=worklist.length;while(i2--){nextElem=worklist[i2];if(nextElem.ref&&nextElem.ref.parent===parent){if(nextElem.ref.key=0){key=candidates[current];candidate=node[key];if(!candidate){continue;}if(Array.isArray(candidate)){current2=candidate.length;while((current2-=1)>=0){if(!candidate[current2]){continue;}if(isProperty(nodeType,candidates[current])){element=new Element(candidate[current2],[key,current2],"Property",new Reference(candidate,current2));}else if(isNode(candidate[current2])){element=new Element(candidate[current2],[key,current2],null,new Reference(candidate,current2));}else{continue;}worklist.push(element);}}else if(isNode(candidate)){worklist.push(new Element(candidate,key,null,new Reference(node,key)));}}}return outer.root;};function traverse(root,visitor){var controller=new Controller();return controller.traverse(root,visitor);}function replace(root,visitor){var controller=new Controller();return controller.replace(root,visitor);}function extendCommentRange(comment,tokens){var target;target=upperBound(tokens,function search(token){return token.range[0]>comment.range[0];});comment.extendedRange=[comment.range[0],comment.range[1]];if(target!==tokens.length){comment.extendedRange[1]=tokens[target].range[0];}target-=1;if(target>=0){comment.extendedRange[0]=tokens[target].range[1];}return comment;}function attachComments(tree,providedComments,tokens){var comments=[],comment,len,i2,cursor;if(!tree.range){throw new Error("attachComments needs range information");}if(!tokens.length){if(providedComments.length){for(i2=0,len=providedComments.length;i2node.range[0]){break;}if(comment2.extendedRange[1]===node.range[0]){if(!node.leadingComments){node.leadingComments=[];}node.leadingComments.push(comment2);comments.splice(cursor,1);}else{cursor+=1;}}if(cursor===comments.length){return VisitorOption.Break;}if(comments[cursor].extendedRange[0]>node.range[1]){return VisitorOption.Skip;}}});cursor=0;traverse(tree,{leave:function(node){var comment2;while(cursornode.range[1]){return VisitorOption.Skip;}}});return tree;}exports3.Syntax=Syntax;exports3.traverse=traverse;exports3.replace=replace;exports3.attachComments=attachComments;exports3.VisitorKeys=VisitorKeys;exports3.VisitorOption=VisitorOption;exports3.Controller=Controller;exports3.cloneEnvironment=function(){return clone({});};return exports3;})(exports2);})(estraverse$1);var Spec=_default$2["default"]||_default$2;var estraverse=estraverse$1.cloneEnvironment();Object.keys(estraverse.Syntax).filter(key=>key!=="Property").forEach(key=>{delete estraverse.Syntax[key];delete estraverse.VisitorKeys[key];});Object.assign(estraverse.Syntax,Object.keys(Spec).reduce((result,key)=>{result[key]=key;return result;},{}));Object.assign(estraverse.VisitorKeys,Object.keys(Spec).reduce((result,key)=>{result[key]=Spec[key].fields.map(field=>field.name);return result;},{}));var dist$1={};Object.defineProperty(dist$1,"__esModule",{value:true});function _classCallCheck$5(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}dist$1.ArrayAssignmentTarget=function ArrayAssignmentTarget5(_ref){var elements=_ref.elements,rest=_ref.rest;_classCallCheck$5(this,ArrayAssignmentTarget5);this.type="ArrayAssignmentTarget";this.elements=elements;this.rest=rest;};dist$1.ArrayBinding=function ArrayBinding5(_ref2){var elements=_ref2.elements,rest=_ref2.rest;_classCallCheck$5(this,ArrayBinding5);this.type="ArrayBinding";this.elements=elements;this.rest=rest;};dist$1.ArrayExpression=function ArrayExpression5(_ref3){var elements=_ref3.elements;_classCallCheck$5(this,ArrayExpression5);this.type="ArrayExpression";this.elements=elements;};dist$1.ArrowExpression=function ArrowExpression5(_ref4){var isAsync=_ref4.isAsync,params=_ref4.params,body=_ref4.body;_classCallCheck$5(this,ArrowExpression5);this.type="ArrowExpression";this.isAsync=isAsync;this.params=params;this.body=body;};dist$1.AssignmentExpression=function AssignmentExpression5(_ref5){var binding=_ref5.binding,expression=_ref5.expression;_classCallCheck$5(this,AssignmentExpression5);this.type="AssignmentExpression";this.binding=binding;this.expression=expression;};dist$1.AssignmentTargetIdentifier=function AssignmentTargetIdentifier5(_ref6){var name=_ref6.name;_classCallCheck$5(this,AssignmentTargetIdentifier5);this.type="AssignmentTargetIdentifier";this.name=name;};dist$1.AssignmentTargetPropertyIdentifier=function AssignmentTargetPropertyIdentifier5(_ref7){var binding=_ref7.binding,init=_ref7.init;_classCallCheck$5(this,AssignmentTargetPropertyIdentifier5);this.type="AssignmentTargetPropertyIdentifier";this.binding=binding;this.init=init;};dist$1.AssignmentTargetPropertyProperty=function AssignmentTargetPropertyProperty5(_ref8){var name=_ref8.name,binding=_ref8.binding;_classCallCheck$5(this,AssignmentTargetPropertyProperty5);this.type="AssignmentTargetPropertyProperty";this.name=name;this.binding=binding;};dist$1.AssignmentTargetWithDefault=function AssignmentTargetWithDefault5(_ref9){var binding=_ref9.binding,init=_ref9.init;_classCallCheck$5(this,AssignmentTargetWithDefault5);this.type="AssignmentTargetWithDefault";this.binding=binding;this.init=init;};dist$1.AwaitExpression=function AwaitExpression5(_ref10){var expression=_ref10.expression;_classCallCheck$5(this,AwaitExpression5);this.type="AwaitExpression";this.expression=expression;};dist$1.BinaryExpression=function BinaryExpression5(_ref11){var left=_ref11.left,operator=_ref11.operator,right=_ref11.right;_classCallCheck$5(this,BinaryExpression5);this.type="BinaryExpression";this.left=left;this.operator=operator;this.right=right;};dist$1.BindingIdentifier=function BindingIdentifier5(_ref12){var name=_ref12.name;_classCallCheck$5(this,BindingIdentifier5);this.type="BindingIdentifier";this.name=name;};dist$1.BindingPropertyIdentifier=function BindingPropertyIdentifier5(_ref13){var binding=_ref13.binding,init=_ref13.init;_classCallCheck$5(this,BindingPropertyIdentifier5);this.type="BindingPropertyIdentifier";this.binding=binding;this.init=init;};dist$1.BindingPropertyProperty=function BindingPropertyProperty5(_ref14){var name=_ref14.name,binding=_ref14.binding;_classCallCheck$5(this,BindingPropertyProperty5);this.type="BindingPropertyProperty";this.name=name;this.binding=binding;};dist$1.BindingWithDefault=function BindingWithDefault5(_ref15){var binding=_ref15.binding,init=_ref15.init;_classCallCheck$5(this,BindingWithDefault5);this.type="BindingWithDefault";this.binding=binding;this.init=init;};dist$1.Block=function Block5(_ref16){var statements=_ref16.statements;_classCallCheck$5(this,Block5);this.type="Block";this.statements=statements;};dist$1.BlockStatement=function BlockStatement5(_ref17){var block=_ref17.block;_classCallCheck$5(this,BlockStatement5);this.type="BlockStatement";this.block=block;};dist$1.BreakStatement=function BreakStatement5(_ref18){var label=_ref18.label;_classCallCheck$5(this,BreakStatement5);this.type="BreakStatement";this.label=label;};dist$1.CallExpression=function CallExpression5(_ref19){var callee=_ref19.callee,_arguments=_ref19.arguments;_classCallCheck$5(this,CallExpression5);this.type="CallExpression";this.callee=callee;this.arguments=_arguments;};dist$1.CatchClause=function CatchClause5(_ref20){var binding=_ref20.binding,body=_ref20.body;_classCallCheck$5(this,CatchClause5);this.type="CatchClause";this.binding=binding;this.body=body;};dist$1.ClassDeclaration=function ClassDeclaration5(_ref21){var name=_ref21.name,_super=_ref21.super,elements=_ref21.elements;_classCallCheck$5(this,ClassDeclaration5);this.type="ClassDeclaration";this.name=name;this.super=_super;this.elements=elements;};dist$1.ClassElement=function ClassElement5(_ref22){var isStatic=_ref22.isStatic,method=_ref22.method;_classCallCheck$5(this,ClassElement5);this.type="ClassElement";this.isStatic=isStatic;this.method=method;};dist$1.ClassExpression=function ClassExpression5(_ref23){var name=_ref23.name,_super=_ref23.super,elements=_ref23.elements;_classCallCheck$5(this,ClassExpression5);this.type="ClassExpression";this.name=name;this.super=_super;this.elements=elements;};dist$1.CompoundAssignmentExpression=function CompoundAssignmentExpression5(_ref24){var binding=_ref24.binding,operator=_ref24.operator,expression=_ref24.expression;_classCallCheck$5(this,CompoundAssignmentExpression5);this.type="CompoundAssignmentExpression";this.binding=binding;this.operator=operator;this.expression=expression;};dist$1.ComputedMemberAssignmentTarget=function ComputedMemberAssignmentTarget5(_ref25){var object=_ref25.object,expression=_ref25.expression;_classCallCheck$5(this,ComputedMemberAssignmentTarget5);this.type="ComputedMemberAssignmentTarget";this.object=object;this.expression=expression;};dist$1.ComputedMemberExpression=function ComputedMemberExpression5(_ref26){var object=_ref26.object,expression=_ref26.expression;_classCallCheck$5(this,ComputedMemberExpression5);this.type="ComputedMemberExpression";this.object=object;this.expression=expression;};dist$1.ComputedPropertyName=function ComputedPropertyName5(_ref27){var expression=_ref27.expression;_classCallCheck$5(this,ComputedPropertyName5);this.type="ComputedPropertyName";this.expression=expression;};dist$1.ConditionalExpression=function ConditionalExpression5(_ref28){var test=_ref28.test,consequent=_ref28.consequent,alternate=_ref28.alternate;_classCallCheck$5(this,ConditionalExpression5);this.type="ConditionalExpression";this.test=test;this.consequent=consequent;this.alternate=alternate;};dist$1.ContinueStatement=function ContinueStatement5(_ref29){var label=_ref29.label;_classCallCheck$5(this,ContinueStatement5);this.type="ContinueStatement";this.label=label;};dist$1.DataProperty=function DataProperty5(_ref30){var name=_ref30.name,expression=_ref30.expression;_classCallCheck$5(this,DataProperty5);this.type="DataProperty";this.name=name;this.expression=expression;};dist$1.DebuggerStatement=function DebuggerStatement5(){_classCallCheck$5(this,DebuggerStatement5);this.type="DebuggerStatement";};dist$1.Directive=function Directive5(_ref31){var rawValue=_ref31.rawValue;_classCallCheck$5(this,Directive5);this.type="Directive";this.rawValue=rawValue;};dist$1.DoWhileStatement=function DoWhileStatement5(_ref32){var body=_ref32.body,test=_ref32.test;_classCallCheck$5(this,DoWhileStatement5);this.type="DoWhileStatement";this.body=body;this.test=test;};dist$1.EmptyStatement=function EmptyStatement5(){_classCallCheck$5(this,EmptyStatement5);this.type="EmptyStatement";};dist$1.Export=function Export5(_ref33){var declaration=_ref33.declaration;_classCallCheck$5(this,Export5);this.type="Export";this.declaration=declaration;};dist$1.ExportAllFrom=function ExportAllFrom5(_ref34){var moduleSpecifier=_ref34.moduleSpecifier;_classCallCheck$5(this,ExportAllFrom5);this.type="ExportAllFrom";this.moduleSpecifier=moduleSpecifier;};dist$1.ExportDefault=function ExportDefault5(_ref35){var body=_ref35.body;_classCallCheck$5(this,ExportDefault5);this.type="ExportDefault";this.body=body;};dist$1.ExportFrom=function ExportFrom5(_ref36){var namedExports=_ref36.namedExports,moduleSpecifier=_ref36.moduleSpecifier;_classCallCheck$5(this,ExportFrom5);this.type="ExportFrom";this.namedExports=namedExports;this.moduleSpecifier=moduleSpecifier;};dist$1.ExportFromSpecifier=function ExportFromSpecifier5(_ref37){var name=_ref37.name,exportedName=_ref37.exportedName;_classCallCheck$5(this,ExportFromSpecifier5);this.type="ExportFromSpecifier";this.name=name;this.exportedName=exportedName;};dist$1.ExportLocalSpecifier=function ExportLocalSpecifier5(_ref38){var name=_ref38.name,exportedName=_ref38.exportedName;_classCallCheck$5(this,ExportLocalSpecifier5);this.type="ExportLocalSpecifier";this.name=name;this.exportedName=exportedName;};dist$1.ExportLocals=function ExportLocals5(_ref39){var namedExports=_ref39.namedExports;_classCallCheck$5(this,ExportLocals5);this.type="ExportLocals";this.namedExports=namedExports;};dist$1.ExpressionStatement=function ExpressionStatement5(_ref40){var expression=_ref40.expression;_classCallCheck$5(this,ExpressionStatement5);this.type="ExpressionStatement";this.expression=expression;};dist$1.ForAwaitStatement=function ForAwaitStatement5(_ref41){var left=_ref41.left,right=_ref41.right,body=_ref41.body;_classCallCheck$5(this,ForAwaitStatement5);this.type="ForAwaitStatement";this.left=left;this.right=right;this.body=body;};dist$1.ForInStatement=function ForInStatement5(_ref42){var left=_ref42.left,right=_ref42.right,body=_ref42.body;_classCallCheck$5(this,ForInStatement5);this.type="ForInStatement";this.left=left;this.right=right;this.body=body;};dist$1.ForOfStatement=function ForOfStatement5(_ref43){var left=_ref43.left,right=_ref43.right,body=_ref43.body;_classCallCheck$5(this,ForOfStatement5);this.type="ForOfStatement";this.left=left;this.right=right;this.body=body;};dist$1.ForStatement=function ForStatement5(_ref44){var init=_ref44.init,test=_ref44.test,update=_ref44.update,body=_ref44.body;_classCallCheck$5(this,ForStatement5);this.type="ForStatement";this.init=init;this.test=test;this.update=update;this.body=body;};dist$1.FormalParameters=function FormalParameters5(_ref45){var items=_ref45.items,rest=_ref45.rest;_classCallCheck$5(this,FormalParameters5);this.type="FormalParameters";this.items=items;this.rest=rest;};dist$1.FunctionBody=function FunctionBody5(_ref46){var directives=_ref46.directives,statements=_ref46.statements;_classCallCheck$5(this,FunctionBody5);this.type="FunctionBody";this.directives=directives;this.statements=statements;};dist$1.FunctionDeclaration=function FunctionDeclaration5(_ref47){var isAsync=_ref47.isAsync,isGenerator=_ref47.isGenerator,name=_ref47.name,params=_ref47.params,body=_ref47.body;_classCallCheck$5(this,FunctionDeclaration5);this.type="FunctionDeclaration";this.isAsync=isAsync;this.isGenerator=isGenerator;this.name=name;this.params=params;this.body=body;};dist$1.FunctionExpression=function FunctionExpression5(_ref48){var isAsync=_ref48.isAsync,isGenerator=_ref48.isGenerator,name=_ref48.name,params=_ref48.params,body=_ref48.body;_classCallCheck$5(this,FunctionExpression5);this.type="FunctionExpression";this.isAsync=isAsync;this.isGenerator=isGenerator;this.name=name;this.params=params;this.body=body;};dist$1.Getter=function Getter5(_ref49){var name=_ref49.name,body=_ref49.body;_classCallCheck$5(this,Getter5);this.type="Getter";this.name=name;this.body=body;};dist$1.IdentifierExpression=function IdentifierExpression5(_ref50){var name=_ref50.name;_classCallCheck$5(this,IdentifierExpression5);this.type="IdentifierExpression";this.name=name;};dist$1.IfStatement=function IfStatement5(_ref51){var test=_ref51.test,consequent=_ref51.consequent,alternate=_ref51.alternate;_classCallCheck$5(this,IfStatement5);this.type="IfStatement";this.test=test;this.consequent=consequent;this.alternate=alternate;};dist$1.Import=function Import5(_ref52){var defaultBinding=_ref52.defaultBinding,namedImports=_ref52.namedImports,moduleSpecifier=_ref52.moduleSpecifier;_classCallCheck$5(this,Import5);this.type="Import";this.defaultBinding=defaultBinding;this.namedImports=namedImports;this.moduleSpecifier=moduleSpecifier;};dist$1.ImportNamespace=function ImportNamespace5(_ref53){var defaultBinding=_ref53.defaultBinding,namespaceBinding=_ref53.namespaceBinding,moduleSpecifier=_ref53.moduleSpecifier;_classCallCheck$5(this,ImportNamespace5);this.type="ImportNamespace";this.defaultBinding=defaultBinding;this.namespaceBinding=namespaceBinding;this.moduleSpecifier=moduleSpecifier;};dist$1.ImportSpecifier=function ImportSpecifier5(_ref54){var name=_ref54.name,binding=_ref54.binding;_classCallCheck$5(this,ImportSpecifier5);this.type="ImportSpecifier";this.name=name;this.binding=binding;};dist$1.LabeledStatement=function LabeledStatement5(_ref55){var label=_ref55.label,body=_ref55.body;_classCallCheck$5(this,LabeledStatement5);this.type="LabeledStatement";this.label=label;this.body=body;};dist$1.LiteralBooleanExpression=function LiteralBooleanExpression5(_ref56){var value=_ref56.value;_classCallCheck$5(this,LiteralBooleanExpression5);this.type="LiteralBooleanExpression";this.value=value;};dist$1.LiteralInfinityExpression=function LiteralInfinityExpression5(){_classCallCheck$5(this,LiteralInfinityExpression5);this.type="LiteralInfinityExpression";};dist$1.LiteralNullExpression=function LiteralNullExpression5(){_classCallCheck$5(this,LiteralNullExpression5);this.type="LiteralNullExpression";};dist$1.LiteralNumericExpression=function LiteralNumericExpression5(_ref57){var value=_ref57.value;_classCallCheck$5(this,LiteralNumericExpression5);this.type="LiteralNumericExpression";this.value=value;};dist$1.LiteralRegExpExpression=function LiteralRegExpExpression5(_ref58){var pattern=_ref58.pattern,global=_ref58.global,ignoreCase=_ref58.ignoreCase,multiLine=_ref58.multiLine,dotAll=_ref58.dotAll,unicode2=_ref58.unicode,sticky=_ref58.sticky;_classCallCheck$5(this,LiteralRegExpExpression5);this.type="LiteralRegExpExpression";this.pattern=pattern;this.global=global;this.ignoreCase=ignoreCase;this.multiLine=multiLine;this.dotAll=dotAll;this.unicode=unicode2;this.sticky=sticky;};dist$1.LiteralStringExpression=function LiteralStringExpression5(_ref59){var value=_ref59.value;_classCallCheck$5(this,LiteralStringExpression5);this.type="LiteralStringExpression";this.value=value;};dist$1.Method=function Method5(_ref60){var isAsync=_ref60.isAsync,isGenerator=_ref60.isGenerator,name=_ref60.name,params=_ref60.params,body=_ref60.body;_classCallCheck$5(this,Method5);this.type="Method";this.isAsync=isAsync;this.isGenerator=isGenerator;this.name=name;this.params=params;this.body=body;};dist$1.Module=function Module5(_ref61){var directives=_ref61.directives,items=_ref61.items;_classCallCheck$5(this,Module5);this.type="Module";this.directives=directives;this.items=items;};dist$1.NewExpression=function NewExpression5(_ref62){var callee=_ref62.callee,_arguments=_ref62.arguments;_classCallCheck$5(this,NewExpression5);this.type="NewExpression";this.callee=callee;this.arguments=_arguments;};dist$1.NewTargetExpression=function NewTargetExpression5(){_classCallCheck$5(this,NewTargetExpression5);this.type="NewTargetExpression";};dist$1.ObjectAssignmentTarget=function ObjectAssignmentTarget5(_ref63){var properties=_ref63.properties,rest=_ref63.rest;_classCallCheck$5(this,ObjectAssignmentTarget5);this.type="ObjectAssignmentTarget";this.properties=properties;this.rest=rest;};dist$1.ObjectBinding=function ObjectBinding5(_ref64){var properties=_ref64.properties,rest=_ref64.rest;_classCallCheck$5(this,ObjectBinding5);this.type="ObjectBinding";this.properties=properties;this.rest=rest;};dist$1.ObjectExpression=function ObjectExpression5(_ref65){var properties=_ref65.properties;_classCallCheck$5(this,ObjectExpression5);this.type="ObjectExpression";this.properties=properties;};dist$1.ReturnStatement=function ReturnStatement5(_ref66){var expression=_ref66.expression;_classCallCheck$5(this,ReturnStatement5);this.type="ReturnStatement";this.expression=expression;};dist$1.Script=function Script5(_ref67){var directives=_ref67.directives,statements=_ref67.statements;_classCallCheck$5(this,Script5);this.type="Script";this.directives=directives;this.statements=statements;};dist$1.Setter=function Setter5(_ref68){var name=_ref68.name,param=_ref68.param,body=_ref68.body;_classCallCheck$5(this,Setter5);this.type="Setter";this.name=name;this.param=param;this.body=body;};dist$1.ShorthandProperty=function ShorthandProperty5(_ref69){var name=_ref69.name;_classCallCheck$5(this,ShorthandProperty5);this.type="ShorthandProperty";this.name=name;};dist$1.SpreadElement=function SpreadElement5(_ref70){var expression=_ref70.expression;_classCallCheck$5(this,SpreadElement5);this.type="SpreadElement";this.expression=expression;};dist$1.SpreadProperty=function SpreadProperty5(_ref71){var expression=_ref71.expression;_classCallCheck$5(this,SpreadProperty5);this.type="SpreadProperty";this.expression=expression;};dist$1.StaticMemberAssignmentTarget=function StaticMemberAssignmentTarget5(_ref72){var object=_ref72.object,property=_ref72.property;_classCallCheck$5(this,StaticMemberAssignmentTarget5);this.type="StaticMemberAssignmentTarget";this.object=object;this.property=property;};dist$1.StaticMemberExpression=function StaticMemberExpression5(_ref73){var object=_ref73.object,property=_ref73.property;_classCallCheck$5(this,StaticMemberExpression5);this.type="StaticMemberExpression";this.object=object;this.property=property;};dist$1.StaticPropertyName=function StaticPropertyName5(_ref74){var value=_ref74.value;_classCallCheck$5(this,StaticPropertyName5);this.type="StaticPropertyName";this.value=value;};dist$1.Super=function Super5(){_classCallCheck$5(this,Super5);this.type="Super";};dist$1.SwitchCase=function SwitchCase5(_ref75){var test=_ref75.test,consequent=_ref75.consequent;_classCallCheck$5(this,SwitchCase5);this.type="SwitchCase";this.test=test;this.consequent=consequent;};dist$1.SwitchDefault=function SwitchDefault5(_ref76){var consequent=_ref76.consequent;_classCallCheck$5(this,SwitchDefault5);this.type="SwitchDefault";this.consequent=consequent;};dist$1.SwitchStatement=function SwitchStatement5(_ref77){var discriminant=_ref77.discriminant,cases=_ref77.cases;_classCallCheck$5(this,SwitchStatement5);this.type="SwitchStatement";this.discriminant=discriminant;this.cases=cases;};dist$1.SwitchStatementWithDefault=function SwitchStatementWithDefault5(_ref78){var discriminant=_ref78.discriminant,preDefaultCases=_ref78.preDefaultCases,defaultCase=_ref78.defaultCase,postDefaultCases=_ref78.postDefaultCases;_classCallCheck$5(this,SwitchStatementWithDefault5);this.type="SwitchStatementWithDefault";this.discriminant=discriminant;this.preDefaultCases=preDefaultCases;this.defaultCase=defaultCase;this.postDefaultCases=postDefaultCases;};dist$1.TemplateElement=function TemplateElement5(_ref79){var rawValue=_ref79.rawValue;_classCallCheck$5(this,TemplateElement5);this.type="TemplateElement";this.rawValue=rawValue;};dist$1.TemplateExpression=function TemplateExpression5(_ref80){var tag=_ref80.tag,elements=_ref80.elements;_classCallCheck$5(this,TemplateExpression5);this.type="TemplateExpression";this.tag=tag;this.elements=elements;};dist$1.ThisExpression=function ThisExpression5(){_classCallCheck$5(this,ThisExpression5);this.type="ThisExpression";};dist$1.ThrowStatement=function ThrowStatement5(_ref81){var expression=_ref81.expression;_classCallCheck$5(this,ThrowStatement5);this.type="ThrowStatement";this.expression=expression;};dist$1.TryCatchStatement=function TryCatchStatement5(_ref82){var body=_ref82.body,catchClause=_ref82.catchClause;_classCallCheck$5(this,TryCatchStatement5);this.type="TryCatchStatement";this.body=body;this.catchClause=catchClause;};dist$1.TryFinallyStatement=function TryFinallyStatement5(_ref83){var body=_ref83.body,catchClause=_ref83.catchClause,finalizer=_ref83.finalizer;_classCallCheck$5(this,TryFinallyStatement5);this.type="TryFinallyStatement";this.body=body;this.catchClause=catchClause;this.finalizer=finalizer;};dist$1.UnaryExpression=function UnaryExpression5(_ref84){var operator=_ref84.operator,operand=_ref84.operand;_classCallCheck$5(this,UnaryExpression5);this.type="UnaryExpression";this.operator=operator;this.operand=operand;};dist$1.UpdateExpression=function UpdateExpression5(_ref85){var isPrefix=_ref85.isPrefix,operator=_ref85.operator,operand=_ref85.operand;_classCallCheck$5(this,UpdateExpression5);this.type="UpdateExpression";this.isPrefix=isPrefix;this.operator=operator;this.operand=operand;};dist$1.VariableDeclaration=function VariableDeclaration5(_ref86){var kind=_ref86.kind,declarators=_ref86.declarators;_classCallCheck$5(this,VariableDeclaration5);this.type="VariableDeclaration";this.kind=kind;this.declarators=declarators;};dist$1.VariableDeclarationStatement=function VariableDeclarationStatement5(_ref87){var declaration=_ref87.declaration;_classCallCheck$5(this,VariableDeclarationStatement5);this.type="VariableDeclarationStatement";this.declaration=declaration;};dist$1.VariableDeclarator=function VariableDeclarator5(_ref88){var binding=_ref88.binding,init=_ref88.init;_classCallCheck$5(this,VariableDeclarator5);this.type="VariableDeclarator";this.binding=binding;this.init=init;};dist$1.WhileStatement=function WhileStatement5(_ref89){var test=_ref89.test,body=_ref89.body;_classCallCheck$5(this,WhileStatement5);this.type="WhileStatement";this.test=test;this.body=body;};dist$1.WithStatement=function WithStatement5(_ref90){var object=_ref90.object,body=_ref90.body;_classCallCheck$5(this,WithStatement5);this.type="WithStatement";this.object=object;this.body=body;};dist$1.YieldExpression=function YieldExpression5(_ref91){var expression=_ref91.expression;_classCallCheck$5(this,YieldExpression5);this.type="YieldExpression";this.expression=expression;};dist$1.YieldGeneratorExpression=function YieldGeneratorExpression5(_ref92){var expression=_ref92.expression;_classCallCheck$5(this,YieldGeneratorExpression5);this.type="YieldGeneratorExpression";this.expression=expression;};var dist={};var minimalCodegen$1={};/* -object-assign -(c) Sindre Sorhus -@license MIT -*/var getOwnPropertySymbols=Object.getOwnPropertySymbols;var hasOwnProperty=Object.prototype.hasOwnProperty;var propIsEnumerable=Object.prototype.propertyIsEnumerable;function toObject(val){if(val===null||val===void 0){throw new TypeError("Object.assign cannot be called with null or undefined");}return Object(val);}function shouldUseNative(){try{if(!Object.assign){return false;}var test1=new String("abc");test1[5]="de";if(Object.getOwnPropertyNames(test1)[0]==="5"){return false;}var test2={};for(var i2=0;i2<10;i2++){test2["_"+String.fromCharCode(i2)]=i2;}var order2=Object.getOwnPropertyNames(test2).map(function(n){return test2[n];});if(order2.join("")!=="0123456789"){return false;}var test3={};"abcdefghijklmnopqrst".split("").forEach(function(letter){test3[letter]=letter;});if(Object.keys(Object.assign({},test3)).join("")!=="abcdefghijklmnopqrst"){return false;}return true;}catch(err){return false;}}var objectAssign=shouldUseNative()?Object.assign:function(target,source){var from;var to=toObject(target);var symbols;for(var s=1;s=48&&ch2<=55;}NON_ASCII_WHITESPACES=[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function isWhiteSpace2(ch2){return ch2===32||ch2===9||ch2===11||ch2===12||ch2===160||ch2>=5760&&NON_ASCII_WHITESPACES.indexOf(ch2)>=0;}function isLineTerminator2(ch2){return ch2===10||ch2===13||ch2===8232||ch2===8233;}function fromCodePoint2(cp){if(cp<=65535){return String.fromCharCode(cp);}var cu1=String.fromCharCode(Math.floor((cp-65536)/1024)+55296);var cu2=String.fromCharCode((cp-65536)%1024+56320);return cu1+cu2;}IDENTIFIER_START=new Array(128);for(ch=0;ch<128;++ch){IDENTIFIER_START[ch]=ch>=97&&ch<=122||ch>=65&&ch<=90||ch===36||ch===95;}IDENTIFIER_PART=new Array(128);for(ch=0;ch<128;++ch){IDENTIFIER_PART[ch]=ch>=97&&ch<=122||ch>=65&&ch<=90||ch>=48&&ch<=57||ch===36||ch===95;}function isIdentifierStartES5(ch2){return ch2<128?IDENTIFIER_START[ch2]:ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint2(ch2));}function isIdentifierPartES5(ch2){return ch2<128?IDENTIFIER_PART[ch2]:ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint2(ch2));}function isIdentifierStartES6(ch2){return ch2<128?IDENTIFIER_START[ch2]:ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint2(ch2));}function isIdentifierPartES62(ch2){return ch2<128?IDENTIFIER_PART[ch2]:ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint2(ch2));}code$2.exports={isDecimalDigit:isDecimalDigit2,isHexDigit,isOctalDigit,isWhiteSpace:isWhiteSpace2,isLineTerminator:isLineTerminator2,isIdentifierStartES5,isIdentifierPartES5,isIdentifierStartES6,isIdentifierPartES6:isIdentifierPartES62};})();var code$1=/* @__PURE__ */_mergeNamespaces({__proto__:null,"default":code$2.exports},[code$2.exports]);var require$$1$2=/* @__PURE__ */getAugmentedNamespace(code$1);var keyword$2={exports:{}};(function(){var code2=require$$1$2;function isStrictModeReservedWordES6(id2){switch(id2){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"let":return true;default:return false;}}function isKeywordES5(id2,strict){if(!strict&&id2==="yield"){return false;}return isKeywordES6(id2,strict);}function isKeywordES6(id2,strict){if(strict&&isStrictModeReservedWordES6(id2)){return true;}switch(id2.length){case 2:return id2==="if"||id2==="in"||id2==="do";case 3:return id2==="var"||id2==="for"||id2==="new"||id2==="try";case 4:return id2==="this"||id2==="else"||id2==="case"||id2==="void"||id2==="with"||id2==="enum";case 5:return id2==="while"||id2==="break"||id2==="catch"||id2==="throw"||id2==="const"||id2==="yield"||id2==="class"||id2==="super";case 6:return id2==="return"||id2==="typeof"||id2==="delete"||id2==="switch"||id2==="export"||id2==="import";case 7:return id2==="default"||id2==="finally"||id2==="extends";case 8:return id2==="function"||id2==="continue"||id2==="debugger";case 10:return id2==="instanceof";default:return false;}}function isReservedWordES5(id2,strict){return id2==="null"||id2==="true"||id2==="false"||isKeywordES5(id2,strict);}function isReservedWordES6(id2,strict){return id2==="null"||id2==="true"||id2==="false"||isKeywordES6(id2,strict);}function isRestrictedWord(id2){return id2==="eval"||id2==="arguments";}function isIdentifierNameES5(id2){var i2,iz,ch;if(id2.length===0){return false;}ch=id2.charCodeAt(0);if(!code2.isIdentifierStartES5(ch)){return false;}for(i2=1,iz=id2.length;i2=iz){return false;}lowCh=id2.charCodeAt(i2);if(!(56320<=lowCh&&lowCh<=57343)){return false;}ch=decodeUtf162(ch,lowCh);}if(!check(ch)){return false;}check=code2.isIdentifierPartES6;}return true;}function isIdentifierES5(id2,strict){return isIdentifierNameES5(id2)&&!isReservedWordES5(id2,strict);}function isIdentifierES6(id2,strict){return isIdentifierNameES6(id2)&&!isReservedWordES6(id2,strict);}keyword$2.exports={isKeywordES5,isKeywordES6,isReservedWordES5,isReservedWordES6,isRestrictedWord,isIdentifierNameES5,isIdentifierNameES6,isIdentifierES5,isIdentifierES6};})();var keyword$1=/* @__PURE__ */_mergeNamespaces({__proto__:null,"default":keyword$2.exports},[keyword$2.exports]);var require$$2$1=/* @__PURE__ */getAugmentedNamespace(keyword$1);var keyword;var code;var ast;(function(){ast=utils$1.ast=require$$0$2;code=utils$1.code=require$$1$2;keyword=utils$1.keyword=require$$2$1;})();var utils=/* @__PURE__ */_mergeNamespaces({__proto__:null,get ast(){return ast;},get code(){return code;},get keyword(){return keyword;},"default":utils$1},[utils$1]);var require$$1$1=/* @__PURE__ */getAugmentedNamespace(utils);var coderep$1={};var SemiOp_1;var CommaSep_1;var Semi_1;var Seq_1;var ContainsIn_1;var NoIn_1;var Brace_1;var Bracket_1;var Paren_1;var NumberCodeRep_1;var RawToken_1;var Token_1;var Empty_1;var CodeRep_1;Object.defineProperty(coderep$1,"__esModule",{value:true});var _createClass$4=function(){function defineProperties(target,props){for(var i2=0;i2":Precedence.Relational,"<=":Precedence.Relational,">=":Precedence.Relational,"in":Precedence.Relational,"instanceof":Precedence.Relational,"<<":Precedence.BitwiseSHIFT,">>":Precedence.BitwiseSHIFT,">>>":Precedence.BitwiseSHIFT,"+":Precedence.Additive,"-":Precedence.Additive,"*":Precedence.Multiplicative,"%":Precedence.Multiplicative,"/":Precedence.Multiplicative,"**":Precedence.Exponential};function getPrecedence(node){switch(node.type){case"ArrayExpression":case"FunctionExpression":case"ClassExpression":case"IdentifierExpression":case"AssignmentTargetIdentifier":case"NewTargetExpression":case"Super":case"LiteralBooleanExpression":case"LiteralNullExpression":case"LiteralNumericExpression":case"LiteralInfinityExpression":case"LiteralRegExpExpression":case"LiteralStringExpression":case"ObjectExpression":case"ThisExpression":case"SpreadElement":case"FunctionBody":return Precedence.Primary;case"ArrowExpression":case"AssignmentExpression":case"CompoundAssignmentExpression":case"YieldExpression":case"YieldGeneratorExpression":return Precedence.Assignment;case"ConditionalExpression":return Precedence.Conditional;case"ComputedMemberExpression":case"StaticMemberExpression":case"ComputedMemberAssignmentTarget":case"StaticMemberAssignmentTarget":switch(node.object.type){case"CallExpression":case"ComputedMemberExpression":case"StaticMemberExpression":case"TemplateExpression":return getPrecedence(node.object);default:return Precedence.Member;}case"TemplateExpression":if(node.tag==null)return Precedence.Member;switch(node.tag.type){case"CallExpression":case"ComputedMemberExpression":case"StaticMemberExpression":case"TemplateExpression":return getPrecedence(node.tag);default:return Precedence.Member;}case"BinaryExpression":return BinaryPrecedence[node.operator];case"CallExpression":return Precedence.Call;case"NewExpression":return node.arguments.length===0?Precedence.New:Precedence.Member;case"UpdateExpression":return node.isPrefix?Precedence.Prefix:Precedence.Postfix;case"AwaitExpression":case"UnaryExpression":return Precedence.Prefix;default:throw new Error("unreachable: "+node.type);}}function escapeStringLiteral(stringValue){var result="";var nSingle=0,nDouble=0;for(var i2=0,l=stringValue.length;i2nSingle?"'":'"';result+=delim;for(var _i=0;_i1&&arguments[1]!==void 0?arguments[1]:false;_classCallCheck$4(this,Token2);var _this2=_possibleConstructorReturn$2(this,(Token2.__proto__||Object.getPrototypeOf(Token2)).call(this));_this2.token=token;_this2.isRegExp=isRegExp;return _this2;}_createClass$4(Token2,[{key:"emit",value:function emit(ts){ts.put(this.token,this.isRegExp);}}]);return Token2;}(CodeRep);RawToken_1=coderep$1.RawToken=function(_CodeRep3){_inherits$2(RawToken,_CodeRep3);function RawToken(token){_classCallCheck$4(this,RawToken);var _this3=_possibleConstructorReturn$2(this,(RawToken.__proto__||Object.getPrototypeOf(RawToken)).call(this));_this3.token=token;return _this3;}_createClass$4(RawToken,[{key:"emit",value:function emit(ts){ts.putRaw(this.token);}}]);return RawToken;}(CodeRep);NumberCodeRep_1=coderep$1.NumberCodeRep=function(_CodeRep4){_inherits$2(NumberCodeRep,_CodeRep4);function NumberCodeRep(number){_classCallCheck$4(this,NumberCodeRep);var _this4=_possibleConstructorReturn$2(this,(NumberCodeRep.__proto__||Object.getPrototypeOf(NumberCodeRep)).call(this));_this4.number=number;return _this4;}_createClass$4(NumberCodeRep,[{key:"emit",value:function emit(ts){ts.putNumber(this.number);}}]);return NumberCodeRep;}(CodeRep);Paren_1=coderep$1.Paren=function(_CodeRep5){_inherits$2(Paren,_CodeRep5);function Paren(expr){_classCallCheck$4(this,Paren);var _this5=_possibleConstructorReturn$2(this,(Paren.__proto__||Object.getPrototypeOf(Paren)).call(this));_this5.expr=expr;return _this5;}_createClass$4(Paren,[{key:"emit",value:function emit(ts){ts.put("(");this.expr.emit(ts,false);ts.put(")");}},{key:"forEach",value:function forEach(f){f(this);this.expr.forEach(f);}}]);return Paren;}(CodeRep);Bracket_1=coderep$1.Bracket=function(_CodeRep6){_inherits$2(Bracket,_CodeRep6);function Bracket(expr){_classCallCheck$4(this,Bracket);var _this6=_possibleConstructorReturn$2(this,(Bracket.__proto__||Object.getPrototypeOf(Bracket)).call(this));_this6.expr=expr;return _this6;}_createClass$4(Bracket,[{key:"emit",value:function emit(ts){ts.put("[");this.expr.emit(ts,false);ts.put("]");}},{key:"forEach",value:function forEach(f){f(this);this.expr.forEach(f);}}]);return Bracket;}(CodeRep);Brace_1=coderep$1.Brace=function(_CodeRep7){_inherits$2(Brace,_CodeRep7);function Brace(expr){_classCallCheck$4(this,Brace);var _this7=_possibleConstructorReturn$2(this,(Brace.__proto__||Object.getPrototypeOf(Brace)).call(this));_this7.expr=expr;return _this7;}_createClass$4(Brace,[{key:"emit",value:function emit(ts){ts.put("{");this.expr.emit(ts,false);ts.put("}");}},{key:"forEach",value:function forEach(f){f(this);this.expr.forEach(f);}}]);return Brace;}(CodeRep);NoIn_1=coderep$1.NoIn=function(_CodeRep8){_inherits$2(NoIn,_CodeRep8);function NoIn(expr){_classCallCheck$4(this,NoIn);var _this8=_possibleConstructorReturn$2(this,(NoIn.__proto__||Object.getPrototypeOf(NoIn)).call(this));_this8.expr=expr;return _this8;}_createClass$4(NoIn,[{key:"emit",value:function emit(ts){this.expr.emit(ts,true);}},{key:"forEach",value:function forEach(f){f(this);this.expr.forEach(f);}}]);return NoIn;}(CodeRep);ContainsIn_1=coderep$1.ContainsIn=function(_CodeRep9){_inherits$2(ContainsIn,_CodeRep9);function ContainsIn(expr){_classCallCheck$4(this,ContainsIn);var _this9=_possibleConstructorReturn$2(this,(ContainsIn.__proto__||Object.getPrototypeOf(ContainsIn)).call(this));_this9.expr=expr;return _this9;}_createClass$4(ContainsIn,[{key:"emit",value:function emit(ts,noIn2){if(noIn2){ts.put("(");this.expr.emit(ts,false);ts.put(")");}else{this.expr.emit(ts,false);}}},{key:"forEach",value:function forEach(f){f(this);this.expr.forEach(f);}}]);return ContainsIn;}(CodeRep);Seq_1=coderep$1.Seq=function(_CodeRep10){_inherits$2(Seq,_CodeRep10);function Seq(children){_classCallCheck$4(this,Seq);var _this10=_possibleConstructorReturn$2(this,(Seq.__proto__||Object.getPrototypeOf(Seq)).call(this));_this10.children=children;return _this10;}_createClass$4(Seq,[{key:"emit",value:function emit(ts,noIn2){this.children.forEach(function(cr){return cr.emit(ts,noIn2);});}},{key:"forEach",value:function forEach(f){f(this);this.children.forEach(function(x){return x.forEach(f);});}}]);return Seq;}(CodeRep);Semi_1=coderep$1.Semi=function(_Token){_inherits$2(Semi,_Token);function Semi(){_classCallCheck$4(this,Semi);return _possibleConstructorReturn$2(this,(Semi.__proto__||Object.getPrototypeOf(Semi)).call(this,";"));}return Semi;}(Token);CommaSep_1=coderep$1.CommaSep=function(_CodeRep11){_inherits$2(CommaSep,_CodeRep11);function CommaSep(children){_classCallCheck$4(this,CommaSep);var _this12=_possibleConstructorReturn$2(this,(CommaSep.__proto__||Object.getPrototypeOf(CommaSep)).call(this));_this12.children=children;return _this12;}_createClass$4(CommaSep,[{key:"emit",value:function emit(ts,noIn2){var first=true;this.children.forEach(function(cr){if(first){first=false;}else{ts.put(",");}cr.emit(ts,noIn2);});}},{key:"forEach",value:function forEach(f){f(this);this.children.forEach(function(x){return x.forEach(f);});}}]);return CommaSep;}(CodeRep);SemiOp_1=coderep$1.SemiOp=function(_CodeRep12){_inherits$2(SemiOp,_CodeRep12);function SemiOp(){_classCallCheck$4(this,SemiOp);return _possibleConstructorReturn$2(this,(SemiOp.__proto__||Object.getPrototypeOf(SemiOp)).call(this));}_createClass$4(SemiOp,[{key:"emit",value:function emit(ts){ts.putOptionalSemi();}}]);return SemiOp;}(CodeRep);var coderep=/* @__PURE__ */_mergeNamespaces({__proto__:null,getPrecedence:getPrecedence_1,escapeStringLiteral:escapeStringLiteral_1,Precedence:Precedence_1,get CodeRep(){return CodeRep_1;},get Empty(){return Empty_1;},get Token(){return Token_1;},get RawToken(){return RawToken_1;},get NumberCodeRep(){return NumberCodeRep_1;},get Paren(){return Paren_1;},get Bracket(){return Bracket_1;},get Brace(){return Brace_1;},get NoIn(){return NoIn_1;},get ContainsIn(){return ContainsIn_1;},get Seq(){return Seq_1;},get Semi(){return Semi_1;},get CommaSep(){return CommaSep_1;},get SemiOp(){return SemiOp_1;},"default":coderep$1},[coderep$1]);var require$$2=/* @__PURE__ */getAugmentedNamespace(coderep);Object.defineProperty(minimalCodegen$1,"__esModule",{value:true});var _createClass$3=function(){function defineProperties(target,props){for(var i2=0;i21&&arguments[1]!==void 0?arguments[1]:false;return new _coderep$1.Token(token,isRegExp);}function paren(rep){return new _coderep$1.Paren(rep);}function brace(rep){return new _coderep$1.Brace(rep);}function bracket(rep){return new _coderep$1.Bracket(rep);}function noIn$1(rep){return new _coderep$1.NoIn(rep);}function markContainsIn$1(state){return state.containsIn?new _coderep$1.ContainsIn(state):state;}function seq$1(){for(var _len=arguments.length,reps=Array(_len),_key=0;_key<_len;_key++){reps[_key]=arguments[_key];}return new _coderep$1.Seq(reps);}function semi(){return new _coderep$1.Semi();}function semiOp(){return new _coderep$1.SemiOp();}function empty$1(){return new _coderep$1.Empty();}function commaSep(pieces){return new _coderep$1.CommaSep(pieces);}function getAssignmentExpr(state){return state?state.containsGroup?paren(state):state:empty$1();}var MinimalCodeGen=function(){function MinimalCodeGen2(){_classCallCheck$3(this,MinimalCodeGen2);}_createClass$3(MinimalCodeGen2,[{key:"parenToAvoidBeingDirective",value:function parenToAvoidBeingDirective(element,original){if(element&&element.type==="ExpressionStatement"&&element.expression.type==="LiteralStringExpression"){return seq$1(paren(original.children[0]),semiOp());}return original;}},{key:"regenerateArrowParams",value:function regenerateArrowParams(element,original){if(element.rest==null&&element.items.length===1&&element.items[0].type==="BindingIdentifier"){return this.reduceBindingIdentifier(element.items[0]);}return original;}},{key:"reduceArrayExpression",value:function reduceArrayExpression(node,_ref){var elements=_ref.elements;if(elements.length===0){return bracket(empty$1());}var content=commaSep(elements.map(getAssignmentExpr));if(elements.length>0&&elements[elements.length-1]==null){content=seq$1(content,t(","));}return bracket(content);}},{key:"reduceAwaitExpression",value:function reduceAwaitExpression(node,_ref2){var expression=_ref2.expression;return seq$1(t("await"),p(node.expression,(0,_coderep$1.getPrecedence)(node),expression));}},{key:"reduceSpreadElement",value:function reduceSpreadElement(node,_ref3){var expression=_ref3.expression;return seq$1(t("..."),p(node.expression,_coderep$1.Precedence.Assignment,expression));}},{key:"reduceSpreadProperty",value:function reduceSpreadProperty(node,_ref4){var expression=_ref4.expression;return seq$1(t("..."),getAssignmentExpr(expression));}},{key:"reduceAssignmentExpression",value:function reduceAssignmentExpression(node,_ref5){var binding=_ref5.binding,expression=_ref5.expression;var leftCode=binding;var rightCode=expression;var containsIn=expression.containsIn;var startsWithCurly=binding.startsWithCurly;var startsWithLetSquareBracket=binding.startsWithLetSquareBracket;var startsWithFunctionOrClass=binding.startsWithFunctionOrClass;if((0,_coderep$1.getPrecedence)(node.expression)<(0,_coderep$1.getPrecedence)(node)){rightCode=paren(rightCode);containsIn=false;}return(0,_objectAssign2$1.default)(seq$1(leftCode,t("="),rightCode),{containsIn,startsWithCurly,startsWithLetSquareBracket,startsWithFunctionOrClass});}},{key:"reduceAssignmentTargetIdentifier",value:function reduceAssignmentTargetIdentifier(node){var a=t(node.name);if(node.name==="let"){a.startsWithLet=true;}return a;}},{key:"reduceAssignmentTargetWithDefault",value:function reduceAssignmentTargetWithDefault(node,_ref6){var binding=_ref6.binding,init=_ref6.init;return seq$1(binding,t("="),p(node.init,_coderep$1.Precedence.Assignment,init));}},{key:"reduceCompoundAssignmentExpression",value:function reduceCompoundAssignmentExpression(node,_ref7){var binding=_ref7.binding,expression=_ref7.expression;var leftCode=binding;var rightCode=expression;var containsIn=expression.containsIn;var startsWithCurly=binding.startsWithCurly;var startsWithLetSquareBracket=binding.startsWithLetSquareBracket;var startsWithFunctionOrClass=binding.startsWithFunctionOrClass;if((0,_coderep$1.getPrecedence)(node.expression)<(0,_coderep$1.getPrecedence)(node)){rightCode=paren(rightCode);containsIn=false;}return(0,_objectAssign2$1.default)(seq$1(leftCode,t(node.operator),rightCode),{containsIn,startsWithCurly,startsWithLetSquareBracket,startsWithFunctionOrClass});}},{key:"reduceBinaryExpression",value:function reduceBinaryExpression(node,_ref8){var left=_ref8.left,right=_ref8.right;var leftCode=left;var startsWithCurly=left.startsWithCurly;var startsWithLetSquareBracket=left.startsWithLetSquareBracket;var startsWithFunctionOrClass=left.startsWithFunctionOrClass;var leftContainsIn=left.containsIn;var isRightAssociative=node.operator==="**";if((0,_coderep$1.getPrecedence)(node.left)<(0,_coderep$1.getPrecedence)(node)||isRightAssociative&&((0,_coderep$1.getPrecedence)(node.left)===(0,_coderep$1.getPrecedence)(node)||node.left.type==="UnaryExpression")){leftCode=paren(leftCode);startsWithCurly=false;startsWithLetSquareBracket=false;startsWithFunctionOrClass=false;leftContainsIn=false;}var rightCode=right;var rightContainsIn=right.containsIn;if((0,_coderep$1.getPrecedence)(node.right)<(0,_coderep$1.getPrecedence)(node)||!isRightAssociative&&(0,_coderep$1.getPrecedence)(node.right)===(0,_coderep$1.getPrecedence)(node)){rightCode=paren(rightCode);rightContainsIn=false;}return(0,_objectAssign2$1.default)(seq$1(leftCode,t(node.operator),rightCode),{containsIn:leftContainsIn||rightContainsIn||node.operator==="in",containsGroup:node.operator===",",startsWithCurly,startsWithLetSquareBracket,startsWithFunctionOrClass});}},{key:"reduceBindingWithDefault",value:function reduceBindingWithDefault(node,_ref9){var binding=_ref9.binding,init=_ref9.init;return seq$1(binding,t("="),p(node.init,_coderep$1.Precedence.Assignment,init));}},{key:"reduceBindingIdentifier",value:function reduceBindingIdentifier(node){var a=t(node.name);if(node.name==="let"){a.startsWithLet=true;}return a;}},{key:"reduceArrayAssignmentTarget",value:function reduceArrayAssignmentTarget(node,_ref10){var elements=_ref10.elements,rest=_ref10.rest;var content=void 0;if(elements.length===0){content=rest==null?empty$1():seq$1(t("..."),rest);}else{elements=elements.concat(rest==null?[]:[seq$1(t("..."),rest)]);content=commaSep(elements.map(getAssignmentExpr));if(elements.length>0&&elements[elements.length-1]==null){content=seq$1(content,t(","));}}return bracket(content);}},{key:"reduceArrayBinding",value:function reduceArrayBinding(node,_ref11){var elements=_ref11.elements,rest=_ref11.rest;var content=void 0;if(elements.length===0){content=rest==null?empty$1():seq$1(t("..."),rest);}else{elements=elements.concat(rest==null?[]:[seq$1(t("..."),rest)]);content=commaSep(elements.map(getAssignmentExpr));if(elements.length>0&&elements[elements.length-1]==null){content=seq$1(content,t(","));}}return bracket(content);}},{key:"reduceObjectAssignmentTarget",value:function reduceObjectAssignmentTarget(node,_ref12){var properties=_ref12.properties,rest=_ref12.rest;var content=commaSep(properties);if(properties.length===0){content=rest==null?empty$1():seq$1(t("..."),rest);}else{content=rest==null?content:seq$1(content,t(","),t("..."),rest);}var state=brace(content);state.startsWithCurly=true;return state;}},{key:"reduceObjectBinding",value:function reduceObjectBinding(node,_ref13){var properties=_ref13.properties,rest=_ref13.rest;var content=commaSep(properties);if(properties.length===0){content=rest==null?empty$1():seq$1(t("..."),rest);}else{content=rest==null?content:seq$1(content,t(","),t("..."),rest);}var state=brace(content);state.startsWithCurly=true;return state;}},{key:"reduceAssignmentTargetPropertyIdentifier",value:function reduceAssignmentTargetPropertyIdentifier(node,_ref14){var binding=_ref14.binding,init=_ref14.init;if(node.init==null)return binding;return seq$1(binding,t("="),p(node.init,_coderep$1.Precedence.Assignment,init));}},{key:"reduceAssignmentTargetPropertyProperty",value:function reduceAssignmentTargetPropertyProperty(node,_ref15){var name=_ref15.name,binding=_ref15.binding;return seq$1(name,t(":"),binding);}},{key:"reduceBindingPropertyIdentifier",value:function reduceBindingPropertyIdentifier(node,_ref16){var binding=_ref16.binding,init=_ref16.init;if(node.init==null)return binding;return seq$1(binding,t("="),p(node.init,_coderep$1.Precedence.Assignment,init));}},{key:"reduceBindingPropertyProperty",value:function reduceBindingPropertyProperty(node,_ref17){var name=_ref17.name,binding=_ref17.binding;return seq$1(name,t(":"),binding);}},{key:"reduceBlock",value:function reduceBlock(node,_ref18){var statements=_ref18.statements;return brace(seq$1.apply(void 0,_toConsumableArray$2(statements)));}},{key:"reduceBlockStatement",value:function reduceBlockStatement(node,_ref19){var block=_ref19.block;return block;}},{key:"reduceBreakStatement",value:function reduceBreakStatement(node){return seq$1(t("break"),node.label?t(node.label):empty$1(),semiOp());}},{key:"reduceCallExpression",value:function reduceCallExpression(node,_ref20){var callee=_ref20.callee,args=_ref20.arguments;var parenthizedArgs=args.map(function(a,i2){return p(node.arguments[i2],_coderep$1.Precedence.Assignment,a);});return(0,_objectAssign2$1.default)(seq$1(p(node.callee,(0,_coderep$1.getPrecedence)(node),callee),paren(commaSep(parenthizedArgs))),{startsWithCurly:callee.startsWithCurly,startsWithLet:callee.startsWithLet,startsWithLetSquareBracket:callee.startsWithLetSquareBracket,startsWithFunctionOrClass:callee.startsWithFunctionOrClass});}},{key:"reduceCatchClause",value:function reduceCatchClause(node,_ref21){var binding=_ref21.binding,body=_ref21.body;return seq$1(t("catch"),paren(binding),body);}},{key:"reduceClassDeclaration",value:function reduceClassDeclaration(node,_ref22){var name=_ref22.name,_super=_ref22.super,elements=_ref22.elements;var state=seq$1(t("class"),node.name.name==="*default*"?empty$1():name);if(_super!=null){state=seq$1(state,t("extends"),p(node.super,_coderep$1.Precedence.New,_super));}state=seq$1.apply(void 0,[state,t("{")].concat(_toConsumableArray$2(elements),[t("}")]));return state;}},{key:"reduceClassExpression",value:function reduceClassExpression(node,_ref23){var name=_ref23.name,_super=_ref23.super,elements=_ref23.elements;var state=t("class");if(name!=null){state=seq$1(state,name);}if(_super!=null){state=seq$1(state,t("extends"),p(node.super,_coderep$1.Precedence.New,_super));}state=seq$1.apply(void 0,[state,t("{")].concat(_toConsumableArray$2(elements),[t("}")]));state.startsWithFunctionOrClass=true;return state;}},{key:"reduceClassElement",value:function reduceClassElement(node,_ref24){var method=_ref24.method;if(!node.isStatic)return method;return seq$1(t("static"),method);}},{key:"reduceComputedMemberAssignmentTarget",value:function reduceComputedMemberAssignmentTarget(node,_ref25){var object=_ref25.object,expression=_ref25.expression;var startsWithLetSquareBracket=object.startsWithLetSquareBracket||node.object.type==="IdentifierExpression"&&node.object.name==="let";return(0,_objectAssign2$1.default)(seq$1(p(node.object,(0,_coderep$1.getPrecedence)(node),object),bracket(expression)),{startsWithLet:object.startsWithLet,startsWithLetSquareBracket,startsWithCurly:object.startsWithCurly,startsWithFunctionOrClass:object.startsWithFunctionOrClass});}},{key:"reduceComputedMemberExpression",value:function reduceComputedMemberExpression(node,_ref26){var object=_ref26.object,expression=_ref26.expression;var startsWithLetSquareBracket=object.startsWithLetSquareBracket||node.object.type==="IdentifierExpression"&&node.object.name==="let";return(0,_objectAssign2$1.default)(seq$1(p(node.object,(0,_coderep$1.getPrecedence)(node),object),bracket(expression)),{startsWithLet:object.startsWithLet,startsWithLetSquareBracket,startsWithCurly:object.startsWithCurly,startsWithFunctionOrClass:object.startsWithFunctionOrClass});}},{key:"reduceComputedPropertyName",value:function reduceComputedPropertyName(node,_ref27){var expression=_ref27.expression;return bracket(p(node.expression,_coderep$1.Precedence.Assignment,expression));}},{key:"reduceConditionalExpression",value:function reduceConditionalExpression(node,_ref28){var test=_ref28.test,consequent=_ref28.consequent,alternate=_ref28.alternate;var containsIn=test.containsIn||alternate.containsIn;var startsWithCurly=test.startsWithCurly;var startsWithLetSquareBracket=test.startsWithLetSquareBracket;var startsWithFunctionOrClass=test.startsWithFunctionOrClass;return(0,_objectAssign2$1.default)(seq$1(p(node.test,_coderep$1.Precedence.LogicalOR,test),t("?"),p(node.consequent,_coderep$1.Precedence.Assignment,consequent),t(":"),p(node.alternate,_coderep$1.Precedence.Assignment,alternate)),{containsIn,startsWithCurly,startsWithLetSquareBracket,startsWithFunctionOrClass});}},{key:"reduceContinueStatement",value:function reduceContinueStatement(node){return seq$1(t("continue"),node.label?t(node.label):empty$1(),semiOp());}},{key:"reduceDataProperty",value:function reduceDataProperty(node,_ref29){var name=_ref29.name,expression=_ref29.expression;return seq$1(name,t(":"),getAssignmentExpr(expression));}},{key:"reduceDebuggerStatement",value:function reduceDebuggerStatement(){return seq$1(t("debugger"),semiOp());}},{key:"reduceDoWhileStatement",value:function reduceDoWhileStatement(node,_ref30){var body=_ref30.body,test=_ref30.test;return seq$1(t("do"),body,t("while"),paren(test),semiOp());}},{key:"reduceEmptyStatement",value:function reduceEmptyStatement(){return semi();}},{key:"reduceExpressionStatement",value:function reduceExpressionStatement(node,_ref31){var expression=_ref31.expression;var needsParens=expression.startsWithCurly||expression.startsWithLetSquareBracket||expression.startsWithFunctionOrClass;return seq$1(needsParens?paren(expression):expression,semiOp());}},{key:"reduceForInStatement",value:function reduceForInStatement(node,_ref32){var left=_ref32.left,right=_ref32.right,body=_ref32.body;left=node.left.type==="VariableDeclaration"?noIn$1(markContainsIn$1(left)):left;return(0,_objectAssign2$1.default)(seq$1(t("for"),paren(seq$1(left.startsWithLet?paren(left):left,t("in"),right)),body),{endsWithMissingElse:body.endsWithMissingElse});}},{key:"reduceForOfStatement",value:function reduceForOfStatement(node,_ref33){var left=_ref33.left,right=_ref33.right,body=_ref33.body;left=node.left.type==="VariableDeclaration"?noIn$1(markContainsIn$1(left)):left;return(0,_objectAssign2$1.default)(seq$1(t("for"),paren(seq$1(left.startsWithLet?paren(left):left,t("of"),p(node.right,_coderep$1.Precedence.Assignment,right))),body),{endsWithMissingElse:body.endsWithMissingElse});}},{key:"reduceForStatement",value:function reduceForStatement(node,_ref34){var init=_ref34.init,test=_ref34.test,update=_ref34.update,body=_ref34.body;if(init){if(init.startsWithLetSquareBracket){init=paren(init);}init=noIn$1(markContainsIn$1(init));}return(0,_objectAssign2$1.default)(seq$1(t("for"),paren(seq$1(init?init:empty$1(),semi(),test||empty$1(),semi(),update||empty$1())),body),{endsWithMissingElse:body.endsWithMissingElse});}},{key:"reduceForAwaitStatement",value:function reduceForAwaitStatement(node,_ref35){var left=_ref35.left,right=_ref35.right,body=_ref35.body;left=node.left.type==="VariableDeclaration"?noIn$1(markContainsIn$1(left)):left;return(0,_objectAssign2$1.default)(seq$1(t("for"),t("await"),paren(seq$1(left.startsWithLet?paren(left):left,t("of"),p(node.right,_coderep$1.Precedence.Assignment,right))),body),{endsWithMissingElse:body.endsWithMissingElse});}},{key:"reduceFunctionBody",value:function reduceFunctionBody(node,_ref36){var directives=_ref36.directives,statements=_ref36.statements;if(statements.length){statements[0]=this.parenToAvoidBeingDirective(node.statements[0],statements[0]);}return brace(seq$1.apply(void 0,_toConsumableArray$2(directives).concat(_toConsumableArray$2(statements))));}},{key:"reduceFunctionDeclaration",value:function reduceFunctionDeclaration(node,_ref37){var name=_ref37.name,params=_ref37.params,body=_ref37.body;return seq$1(node.isAsync?t("async"):empty$1(),t("function"),node.isGenerator?t("*"):empty$1(),node.name.name==="*default*"?empty$1():name,params,body);}},{key:"reduceFunctionExpression",value:function reduceFunctionExpression(node,_ref38){var name=_ref38.name,params=_ref38.params,body=_ref38.body;var state=seq$1(node.isAsync?t("async"):empty$1(),t("function"),node.isGenerator?t("*"):empty$1(),name?name:empty$1(),params,body);state.startsWithFunctionOrClass=true;return state;}},{key:"reduceFormalParameters",value:function reduceFormalParameters(node,_ref39){var items=_ref39.items,rest=_ref39.rest;return paren(commaSep(items.concat(rest==null?[]:[seq$1(t("..."),rest)])));}},{key:"reduceArrowExpression",value:function reduceArrowExpression(node,_ref40){var params=_ref40.params,body=_ref40.body;params=this.regenerateArrowParams(node.params,params);var containsIn=false;if(node.body.type!=="FunctionBody"){if(body.startsWithCurly){body=paren(body);}else if(body.containsIn){containsIn=true;}}return(0,_objectAssign2$1.default)(seq$1(node.isAsync?t("async"):empty$1(),params,t("=>"),p(node.body,_coderep$1.Precedence.Assignment,body)),{containsIn});}},{key:"reduceGetter",value:function reduceGetter(node,_ref41){var name=_ref41.name,body=_ref41.body;return seq$1(t("get"),name,paren(empty$1()),body);}},{key:"reduceIdentifierExpression",value:function reduceIdentifierExpression(node){var a=t(node.name);if(node.name==="let"){a.startsWithLet=true;}return a;}},{key:"reduceIfStatement",value:function reduceIfStatement(node,_ref42){var test=_ref42.test,consequent=_ref42.consequent,alternate=_ref42.alternate;if(alternate&&consequent.endsWithMissingElse){consequent=brace(consequent);}return(0,_objectAssign2$1.default)(seq$1(t("if"),paren(test),consequent,alternate?seq$1(t("else"),alternate):empty$1()),{endsWithMissingElse:alternate?alternate.endsWithMissingElse:true});}},{key:"reduceImport",value:function reduceImport(node,_ref43){var defaultBinding=_ref43.defaultBinding,namedImports=_ref43.namedImports;var bindings=[];if(defaultBinding!=null){bindings.push(defaultBinding);}if(namedImports.length>0){bindings.push(brace(commaSep(namedImports)));}if(bindings.length===0){return seq$1(t("import"),t((0,_coderep$1.escapeStringLiteral)(node.moduleSpecifier)),semiOp());}return seq$1(t("import"),commaSep(bindings),t("from"),t((0,_coderep$1.escapeStringLiteral)(node.moduleSpecifier)),semiOp());}},{key:"reduceImportNamespace",value:function reduceImportNamespace(node,_ref44){var defaultBinding=_ref44.defaultBinding,namespaceBinding=_ref44.namespaceBinding;return seq$1(t("import"),defaultBinding==null?empty$1():seq$1(defaultBinding,t(",")),t("*"),t("as"),namespaceBinding,t("from"),t((0,_coderep$1.escapeStringLiteral)(node.moduleSpecifier)),semiOp());}},{key:"reduceImportSpecifier",value:function reduceImportSpecifier(node,_ref45){var binding=_ref45.binding;if(node.name==null)return binding;return seq$1(t(node.name),t("as"),binding);}},{key:"reduceExportAllFrom",value:function reduceExportAllFrom(node){return seq$1(t("export"),t("*"),t("from"),t((0,_coderep$1.escapeStringLiteral)(node.moduleSpecifier)),semiOp());}},{key:"reduceExportFrom",value:function reduceExportFrom(node,_ref46){var namedExports=_ref46.namedExports;return seq$1(t("export"),brace(commaSep(namedExports)),t("from"),t((0,_coderep$1.escapeStringLiteral)(node.moduleSpecifier)),semiOp());}},{key:"reduceExportLocals",value:function reduceExportLocals(node,_ref47){var namedExports=_ref47.namedExports;return seq$1(t("export"),brace(commaSep(namedExports)),semiOp());}},{key:"reduceExport",value:function reduceExport(node,_ref48){var declaration=_ref48.declaration;switch(node.declaration.type){case"FunctionDeclaration":case"ClassDeclaration":break;default:declaration=seq$1(declaration,semiOp());}return seq$1(t("export"),declaration);}},{key:"reduceExportDefault",value:function reduceExportDefault(node,_ref49){var body=_ref49.body;body=body.startsWithFunctionOrClass?paren(body):body;switch(node.body.type){case"FunctionDeclaration":case"ClassDeclaration":return seq$1(t("export default"),body);default:return seq$1(t("export default"),p(node.body,_coderep$1.Precedence.Assignment,body),semiOp());}}},{key:"reduceExportFromSpecifier",value:function reduceExportFromSpecifier(node){if(node.exportedName==null)return t(node.name);return seq$1(t(node.name),t("as"),t(node.exportedName));}},{key:"reduceExportLocalSpecifier",value:function reduceExportLocalSpecifier(node,_ref50){var name=_ref50.name;if(node.exportedName==null)return name;return seq$1(name,t("as"),t(node.exportedName));}},{key:"reduceLabeledStatement",value:function reduceLabeledStatement(node,_ref51){var body=_ref51.body;return(0,_objectAssign2$1.default)(seq$1(t(node.label+":"),body),{endsWithMissingElse:body.endsWithMissingElse});}},{key:"reduceLiteralBooleanExpression",value:function reduceLiteralBooleanExpression(node){return t(node.value.toString());}},{key:"reduceLiteralNullExpression",value:function reduceLiteralNullExpression(){return t("null");}},{key:"reduceLiteralInfinityExpression",value:function reduceLiteralInfinityExpression(){return t("2e308");}},{key:"reduceLiteralNumericExpression",value:function reduceLiteralNumericExpression(node){return new _coderep$1.NumberCodeRep(node.value);}},{key:"reduceLiteralRegExpExpression",value:function reduceLiteralRegExpExpression(node){return t("/"+node.pattern+"/"+(node.global?"g":"")+(node.ignoreCase?"i":"")+(node.multiLine?"m":"")+(node.dotAll?"s":"")+(node.unicode?"u":"")+(node.sticky?"y":""),true);}},{key:"reduceLiteralStringExpression",value:function reduceLiteralStringExpression(node){return t((0,_coderep$1.escapeStringLiteral)(node.value));}},{key:"reduceMethod",value:function reduceMethod(node,_ref52){var name=_ref52.name,params=_ref52.params,body=_ref52.body;return seq$1(node.isAsync?t("async"):empty$1(),node.isGenerator?t("*"):empty$1(),name,params,body);}},{key:"reduceModule",value:function reduceModule(node,_ref53){var directives=_ref53.directives,items=_ref53.items;if(items.length){items[0]=this.parenToAvoidBeingDirective(node.items[0],items[0]);}return seq$1.apply(void 0,_toConsumableArray$2(directives).concat(_toConsumableArray$2(items)));}},{key:"reduceNewExpression",value:function reduceNewExpression(node,_ref54){var callee=_ref54.callee,args=_ref54.arguments;var parenthizedArgs=args.map(function(a,i2){return p(node.arguments[i2],_coderep$1.Precedence.Assignment,a);});var calleeRep=(0,_coderep$1.getPrecedence)(node.callee)===_coderep$1.Precedence.Call?paren(callee):p(node.callee,(0,_coderep$1.getPrecedence)(node),callee);return seq$1(t("new"),calleeRep,args.length===0?empty$1():paren(commaSep(parenthizedArgs)));}},{key:"reduceNewTargetExpression",value:function reduceNewTargetExpression(){return t("new.target");}},{key:"reduceObjectExpression",value:function reduceObjectExpression(node,_ref55){var properties=_ref55.properties;var state=brace(commaSep(properties));state.startsWithCurly=true;return state;}},{key:"reduceUpdateExpression",value:function reduceUpdateExpression(node,_ref56){var operand=_ref56.operand;if(node.isPrefix){return this.reduceUnaryExpression.apply(this,arguments);}return(0,_objectAssign2$1.default)(seq$1(p(node.operand,_coderep$1.Precedence.New,operand),t(node.operator)),{startsWithCurly:operand.startsWithCurly,startsWithLetSquareBracket:operand.startsWithLetSquareBracket,startsWithFunctionOrClass:operand.startsWithFunctionOrClass});}},{key:"reduceUnaryExpression",value:function reduceUnaryExpression(node,_ref57){var operand=_ref57.operand;return seq$1(t(node.operator),p(node.operand,(0,_coderep$1.getPrecedence)(node),operand));}},{key:"reduceReturnStatement",value:function reduceReturnStatement(node,_ref58){var expression=_ref58.expression;return seq$1(t("return"),expression||empty$1(),semiOp());}},{key:"reduceScript",value:function reduceScript(node,_ref59){var directives=_ref59.directives,statements=_ref59.statements;if(statements.length){statements[0]=this.parenToAvoidBeingDirective(node.statements[0],statements[0]);}return seq$1.apply(void 0,_toConsumableArray$2(directives).concat(_toConsumableArray$2(statements)));}},{key:"reduceSetter",value:function reduceSetter(node,_ref60){var name=_ref60.name,param=_ref60.param,body=_ref60.body;return seq$1(t("set"),name,paren(param),body);}},{key:"reduceShorthandProperty",value:function reduceShorthandProperty(node,_ref61){var name=_ref61.name;return name;}},{key:"reduceStaticMemberAssignmentTarget",value:function reduceStaticMemberAssignmentTarget(node,_ref62){var object=_ref62.object;var state=seq$1(p(node.object,(0,_coderep$1.getPrecedence)(node),object),t("."),t(node.property));state.startsWithLet=object.startsWithLet;state.startsWithCurly=object.startsWithCurly;state.startsWithLetSquareBracket=object.startsWithLetSquareBracket;state.startsWithFunctionOrClass=object.startsWithFunctionOrClass;return state;}},{key:"reduceStaticMemberExpression",value:function reduceStaticMemberExpression(node,_ref63){var object=_ref63.object;var state=seq$1(p(node.object,(0,_coderep$1.getPrecedence)(node),object),t("."),t(node.property));state.startsWithLet=object.startsWithLet;state.startsWithCurly=object.startsWithCurly;state.startsWithLetSquareBracket=object.startsWithLetSquareBracket;state.startsWithFunctionOrClass=object.startsWithFunctionOrClass;return state;}},{key:"reduceStaticPropertyName",value:function reduceStaticPropertyName(node){if(_esutils$1.keyword.isIdentifierNameES6(node.value)){return t(node.value);}var n=parseFloat(node.value);if(n>=0&&n.toString()===node.value){return new _coderep$1.NumberCodeRep(n);}return t((0,_coderep$1.escapeStringLiteral)(node.value));}},{key:"reduceSuper",value:function reduceSuper(){return t("super");}},{key:"reduceSwitchCase",value:function reduceSwitchCase(node,_ref64){var test=_ref64.test,consequent=_ref64.consequent;return seq$1(t("case"),test,t(":"),seq$1.apply(void 0,_toConsumableArray$2(consequent)));}},{key:"reduceSwitchDefault",value:function reduceSwitchDefault(node,_ref65){var consequent=_ref65.consequent;return seq$1(t("default:"),seq$1.apply(void 0,_toConsumableArray$2(consequent)));}},{key:"reduceSwitchStatement",value:function reduceSwitchStatement(node,_ref66){var discriminant=_ref66.discriminant,cases=_ref66.cases;return seq$1(t("switch"),paren(discriminant),brace(seq$1.apply(void 0,_toConsumableArray$2(cases))));}},{key:"reduceSwitchStatementWithDefault",value:function reduceSwitchStatementWithDefault(node,_ref67){var discriminant=_ref67.discriminant,preDefaultCases=_ref67.preDefaultCases,defaultCase=_ref67.defaultCase,postDefaultCases=_ref67.postDefaultCases;return seq$1(t("switch"),paren(discriminant),brace(seq$1.apply(void 0,_toConsumableArray$2(preDefaultCases).concat([defaultCase],_toConsumableArray$2(postDefaultCases)))));}},{key:"reduceTemplateExpression",value:function reduceTemplateExpression(node,_ref68){var tag=_ref68.tag,elements=_ref68.elements;var state=node.tag==null?empty$1():p(node.tag,(0,_coderep$1.getPrecedence)(node),tag);state=seq$1(state,t("`"));for(var i2=0,l=node.elements.length;i20?t("}"):empty$1(),elements[i2],i21&&arguments[1]!==void 0?arguments[1]:false;return new _coderep.Token(token,isRegExp);}},{key:"p",value:function p2(node,precedence,a){return(0,_coderep.getPrecedence)(node)0&&elements[elements.length-1]==null){content=seq(content,this.sep(Sep.ARRAY_BEFORE_COMMA),this.t(","),this.sep(Sep.ARRAY_AFTER_COMMA));}return this.bracket(content,Sep.ARRAY_INITIAL,Sep.ARRAY_FINAL);}},{key:"reduceAwaitExpression",value:function reduceAwaitExpression(node,_ref2){var expression=_ref2.expression;return seq(this.t("await"),this.sep(Sep.AWAIT),this.p(node.expression,(0,_coderep.getPrecedence)(node),expression));}},{key:"reduceSpreadElement",value:function reduceSpreadElement(node,_ref3){var expression=_ref3.expression;return seq(this.t("..."),this.sep(Sep.SPREAD),this.p(node.expression,_coderep.Precedence.Assignment,expression));}},{key:"reduceSpreadProperty",value:function reduceSpreadProperty(node,_ref4){var expression=_ref4.expression;return seq(this.t("..."),this.sep(Sep.SPREAD),this.getAssignmentExpr(expression));}},{key:"reduceAssignmentExpression",value:function reduceAssignmentExpression(node,_ref5){var binding=_ref5.binding,expression=_ref5.expression;var leftCode=binding;var rightCode=expression;var containsIn=expression.containsIn;var startsWithCurly=binding.startsWithCurly;var startsWithLetSquareBracket=binding.startsWithLetSquareBracket;var startsWithFunctionOrClass=binding.startsWithFunctionOrClass;if((0,_coderep.getPrecedence)(node.expression)<(0,_coderep.getPrecedence)(node)){rightCode=this.paren(rightCode,Sep.EXPRESSION_PAREN_BEFORE,Sep.EXPRESSION_PAREN_AFTER);containsIn=false;}return(0,_objectAssign2.default)(seq(leftCode,this.sep(Sep.BEFORE_ASSIGN_OP("=")),this.t("="),this.sep(Sep.AFTER_ASSIGN_OP("=")),rightCode),{containsIn,startsWithCurly,startsWithLetSquareBracket,startsWithFunctionOrClass});}},{key:"reduceAssignmentTargetIdentifier",value:function reduceAssignmentTargetIdentifier(node){var a=this.t(node.name);if(node.name==="let"){a.startsWithLet=true;}return a;}},{key:"reduceAssignmentTargetWithDefault",value:function reduceAssignmentTargetWithDefault(node,_ref6){var binding=_ref6.binding,init=_ref6.init;return seq(binding,this.sep(Sep.BEFORE_DEFAULT_EQUALS),this.t("="),this.sep(Sep.AFTER_DEFAULT_EQUALS),this.p(node.init,_coderep.Precedence.Assignment,init));}},{key:"reduceCompoundAssignmentExpression",value:function reduceCompoundAssignmentExpression(node,_ref7){var binding=_ref7.binding,expression=_ref7.expression;var leftCode=binding;var rightCode=expression;var containsIn=expression.containsIn;var startsWithCurly=binding.startsWithCurly;var startsWithLetSquareBracket=binding.startsWithLetSquareBracket;var startsWithFunctionOrClass=binding.startsWithFunctionOrClass;if((0,_coderep.getPrecedence)(node.expression)<(0,_coderep.getPrecedence)(node)){rightCode=this.paren(rightCode,Sep.EXPRESSION_PAREN_BEFORE,Sep.EXPRESSION_PAREN_AFTER);containsIn=false;}return(0,_objectAssign2.default)(seq(leftCode,this.sep(Sep.BEFORE_ASSIGN_OP(node.operator)),this.t(node.operator),this.sep(Sep.AFTER_ASSIGN_OP(node.operator)),rightCode),{containsIn,startsWithCurly,startsWithLetSquareBracket,startsWithFunctionOrClass});}},{key:"reduceBinaryExpression",value:function reduceBinaryExpression(node,_ref8){var left=_ref8.left,right=_ref8.right;var leftCode=left;var startsWithCurly=left.startsWithCurly;var startsWithLetSquareBracket=left.startsWithLetSquareBracket;var startsWithFunctionOrClass=left.startsWithFunctionOrClass;var leftContainsIn=left.containsIn;var isRightAssociative=node.operator==="**";if((0,_coderep.getPrecedence)(node.left)<(0,_coderep.getPrecedence)(node)||isRightAssociative&&((0,_coderep.getPrecedence)(node.left)===(0,_coderep.getPrecedence)(node)||node.left.type==="UnaryExpression")){leftCode=this.paren(leftCode,Sep.EXPRESSION_PAREN_BEFORE,Sep.EXPRESSION_PAREN_AFTER);startsWithCurly=false;startsWithLetSquareBracket=false;startsWithFunctionOrClass=false;leftContainsIn=false;}var rightCode=right;var rightContainsIn=right.containsIn;if((0,_coderep.getPrecedence)(node.right)<(0,_coderep.getPrecedence)(node)||!isRightAssociative&&(0,_coderep.getPrecedence)(node.right)===(0,_coderep.getPrecedence)(node)){rightCode=this.paren(rightCode,Sep.EXPRESSION_PAREN_BEFORE,Sep.EXPRESSION_PAREN_AFTER);rightContainsIn=false;}return(0,_objectAssign2.default)(seq(leftCode,this.sep(Sep.BEFORE_BINOP(node.operator)),this.t(node.operator),this.sep(Sep.AFTER_BINOP(node.operator)),rightCode),{containsIn:leftContainsIn||rightContainsIn||node.operator==="in",containsGroup:node.operator===",",startsWithCurly,startsWithLetSquareBracket,startsWithFunctionOrClass});}},{key:"reduceBindingWithDefault",value:function reduceBindingWithDefault(node,_ref9){var binding=_ref9.binding,init=_ref9.init;return seq(binding,this.sep(Sep.BEFORE_DEFAULT_EQUALS),this.t("="),this.sep(Sep.AFTER_DEFAULT_EQUALS),this.p(node.init,_coderep.Precedence.Assignment,init));}},{key:"reduceBindingIdentifier",value:function reduceBindingIdentifier(node){var a=this.t(node.name);if(node.name==="let"){a.startsWithLet=true;}return a;}},{key:"reduceArrayAssignmentTarget",value:function reduceArrayAssignmentTarget(node,_ref10){var _this4=this;var elements=_ref10.elements,rest=_ref10.rest;var content=void 0;if(elements.length===0){content=rest==null?empty():seq(this.t("..."),this.sep(Sep.REST),rest);}else{elements=elements.concat(rest==null?[]:[seq(this.t("..."),this.sep(Sep.REST),rest)]);content=this.commaSep(elements.map(function(e){return _this4.getAssignmentExpr(e);}),Sep.ARRAY_BEFORE_COMMA,Sep.ARRAY_AFTER_COMMA);if(elements.length>0&&elements[elements.length-1]==null){content=seq(content,this.sep(Sep.ARRAY_BEFORE_COMMA),this.t(","),this.sep(Sep.ARRAY_AFTER_COMMA));}}return this.bracket(content,Sep.ARRAY_INITIAL,Sep.ARRAY_FINAL,Sep.ARRAY_EMPTY);}},{key:"reduceArrayBinding",value:function reduceArrayBinding(node,_ref11){var _this5=this;var elements=_ref11.elements,rest=_ref11.rest;var content=void 0;if(elements.length===0){content=rest==null?empty():seq(this.t("..."),this.sep(Sep.REST),rest);}else{elements=elements.concat(rest==null?[]:[seq(this.t("..."),this.sep(Sep.REST),rest)]);content=this.commaSep(elements.map(function(e){return _this5.getAssignmentExpr(e);}),Sep.ARRAY_BEFORE_COMMA,Sep.ARRAY_AFTER_COMMA);if(elements.length>0&&elements[elements.length-1]==null){content=seq(content,this.sep(Sep.ARRAY_BEFORE_COMMA),this.t(","),this.sep(Sep.ARRAY_AFTER_COMMA));}}return this.bracket(content,Sep.ARRAY_INITIAL,Sep.ARRAY_FINAL,Sep.ARRAY_EMPTY);}},{key:"reduceObjectAssignmentTarget",value:function reduceObjectAssignmentTarget(node,_ref12){var properties=_ref12.properties,rest=_ref12.rest;var content=void 0;if(properties.length===0){content=rest==null?empty():seq(this.t("..."),this.sep(Sep.REST),rest);}else{content=this.commaSep(properties,Sep.OBJECT_BEFORE_COMMA,Sep.OBJECT_AFTER_COMMA);content=rest==null?content:this.commaSep([content,seq(this.t("..."),this.sep(Sep.REST),rest)],Sep.OBJECT_BEFORE_COMMA,Sep.OBJECT_AFTER_COMMA);}var state=this.brace(content,node,Sep.OBJECT_BRACE_INITIAL,Sep.OBJECT_BRACE_FINAL,Sep.OBJECT_EMPTY);state.startsWithCurly=true;return state;}},{key:"reduceObjectBinding",value:function reduceObjectBinding(node,_ref13){var properties=_ref13.properties,rest=_ref13.rest;var content=void 0;if(properties.length===0){content=rest==null?empty():seq(this.t("..."),this.sep(Sep.REST),rest);}else{content=this.commaSep(properties,Sep.OBJECT_BEFORE_COMMA,Sep.OBJECT_AFTER_COMMA);content=rest==null?content:this.commaSep([content,seq(this.t("..."),this.sep(Sep.REST),rest)],Sep.OBJECT_BEFORE_COMMA,Sep.OBJECT_AFTER_COMMA);}var state=this.brace(content,node,Sep.OBJECT_BRACE_INITIAL,Sep.OBJECT_BRACE_FINAL,Sep.OBJECT_EMPTY);state.startsWithCurly=true;return state;}},{key:"reduceAssignmentTargetPropertyIdentifier",value:function reduceAssignmentTargetPropertyIdentifier(node,_ref14){var binding=_ref14.binding,init=_ref14.init;if(node.init==null)return binding;return seq(binding,this.sep(Sep.BEFORE_DEFAULT_EQUALS),this.t("="),this.sep(Sep.AFTER_DEFAULT_EQUALS),this.p(node.init,_coderep.Precedence.Assignment,init));}},{key:"reduceAssignmentTargetPropertyProperty",value:function reduceAssignmentTargetPropertyProperty(node,_ref15){var name=_ref15.name,binding=_ref15.binding;return seq(name,this.sep(Sep.BEFORE_PROP),this.t(":"),this.sep(Sep.AFTER_PROP),binding);}},{key:"reduceBindingPropertyIdentifier",value:function reduceBindingPropertyIdentifier(node,_ref16){var binding=_ref16.binding,init=_ref16.init;if(node.init==null)return binding;return seq(binding,this.sep(Sep.BEFORE_DEFAULT_EQUALS),this.t("="),this.sep(Sep.AFTER_DEFAULT_EQUALS),this.p(node.init,_coderep.Precedence.Assignment,init));}},{key:"reduceBindingPropertyProperty",value:function reduceBindingPropertyProperty(node,_ref17){var name=_ref17.name,binding=_ref17.binding;return seq(name,this.sep(Sep.BEFORE_PROP),this.t(":"),this.sep(Sep.AFTER_PROP),binding);}},{key:"reduceBlock",value:function reduceBlock(node,_ref18){var statements=_ref18.statements;return this.brace(seq.apply(void 0,_toConsumableArray$1(statements)),node,Sep.BLOCK_BRACE_INITIAL,Sep.BLOCK_BRACE_FINAL,Sep.BLOCK_EMPTY);}},{key:"reduceBlockStatement",value:function reduceBlockStatement(node,_ref19){var block=_ref19.block;return seq(block,this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceBreakStatement",value:function reduceBreakStatement(node){return seq(this.t("break"),node.label?seq(this.sep(Sep.BEFORE_JUMP_LABEL),this.t(node.label)):empty(),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceCallExpression",value:function reduceCallExpression(node,_ref20){var _this6=this;var callee=_ref20.callee,args=_ref20.arguments;var parenthizedArgs=args.map(function(a,i2){return _this6.p(node.arguments[i2],_coderep.Precedence.Assignment,a);});return(0,_objectAssign2.default)(seq(this.p(node.callee,(0,_coderep.getPrecedence)(node),callee),this.sep(Sep.CALL),this.paren(this.commaSep(parenthizedArgs,Sep.ARGS_BEFORE_COMMA,Sep.ARGS_AFTER_COMMA),Sep.CALL_PAREN_BEFORE,Sep.CALL_PAREN_AFTER,Sep.CALL_PAREN_EMPTY)),{startsWithCurly:callee.startsWithCurly,startsWithLet:callee.startsWithLet,startsWithLetSquareBracket:callee.startsWithLetSquareBracket,startsWithFunctionOrClass:callee.startsWithFunctionOrClass});}},{key:"reduceCatchClause",value:function reduceCatchClause(node,_ref21){var binding=_ref21.binding,body=_ref21.body;return seq(this.t("catch"),this.sep(Sep.BEFORE_CATCH_BINDING),this.paren(binding,Sep.CATCH_PAREN_BEFORE,Sep.CATCH_PAREN_AFTER),this.sep(Sep.AFTER_CATCH_BINDING),body);}},{key:"reduceClassDeclaration",value:function reduceClassDeclaration(node,_ref22){var name=_ref22.name,_super=_ref22.super,elements=_ref22.elements;var state=seq(this.t("class"),node.name.name==="*default*"?empty():seq(this.sep(Sep.BEFORE_CLASS_NAME),name));if(_super!=null){state=seq(state,this.sep(Sep.BEFORE_EXTENDS),this.t("extends"),this.sep(Sep.AFTER_EXTENDS),this.p(node.super,_coderep.Precedence.New,_super));}state=seq(state,this.sep(Sep.BEFORE_CLASS_DECLARATION_ELEMENTS),this.brace(seq.apply(void 0,_toConsumableArray$1(elements)),node,Sep.CLASS_BRACE_INITIAL,Sep.CLASS_BRACE_FINAL,Sep.CLASS_EMPTY),this.sep(Sep.AFTER_STATEMENT(node)));return state;}},{key:"reduceClassExpression",value:function reduceClassExpression(node,_ref23){var name=_ref23.name,_super=_ref23.super,elements=_ref23.elements;var state=this.t("class");if(name!=null){state=seq(state,this.sep(Sep.BEFORE_CLASS_NAME),name);}if(_super!=null){state=seq(state,this.sep(Sep.BEFORE_EXTENDS),this.t("extends"),this.sep(Sep.AFTER_EXTENDS),this.p(node.super,_coderep.Precedence.New,_super));}state=seq(state,this.sep(Sep.BEFORE_CLASS_EXPRESSION_ELEMENTS),this.brace(seq.apply(void 0,_toConsumableArray$1(elements)),node,Sep.CLASS_EXPRESSION_BRACE_INITIAL,Sep.CLASS_EXPRESSION_BRACE_FINAL,Sep.CLASS_EXPRESSION_BRACE_EMPTY));state.startsWithFunctionOrClass=true;return state;}},{key:"reduceClassElement",value:function reduceClassElement(node,_ref24){var method=_ref24.method;method=seq(this.sep(Sep.BEFORE_CLASS_ELEMENT),method,this.sep(Sep.AFTER_CLASS_ELEMENT));if(!node.isStatic)return method;return seq(this.t("static"),this.sep(Sep.AFTER_STATIC),method);}},{key:"reduceComputedMemberAssignmentTarget",value:function reduceComputedMemberAssignmentTarget(node,_ref25){var object=_ref25.object,expression=_ref25.expression;var startsWithLetSquareBracket=object.startsWithLetSquareBracket||node.object.type==="IdentifierExpression"&&node.object.name==="let";return(0,_objectAssign2.default)(seq(this.p(node.object,(0,_coderep.getPrecedence)(node),object),this.sep(Sep.COMPUTED_MEMBER_ASSIGNMENT_TARGET),this.bracket(expression,Sep.COMPUTED_MEMBER_ASSIGNMENT_TARGET_BRACKET_INTIAL,Sep.COMPUTED_MEMBER_ASSIGNMENT_TARGET_BRACKET_FINAL)),{startsWithLet:object.startsWithLet,startsWithLetSquareBracket,startsWithCurly:object.startsWithCurly,startsWithFunctionOrClass:object.startsWithFunctionOrClass});}},{key:"reduceComputedMemberExpression",value:function reduceComputedMemberExpression(node,_ref26){var object=_ref26.object,expression=_ref26.expression;var startsWithLetSquareBracket=object.startsWithLetSquareBracket||node.object.type==="IdentifierExpression"&&node.object.name==="let";return(0,_objectAssign2.default)(seq(this.p(node.object,(0,_coderep.getPrecedence)(node),object),this.sep(Sep.COMPUTED_MEMBER_EXPRESSION),this.bracket(expression,Sep.COMPUTED_MEMBER_BRACKET_INTIAL,Sep.COMPUTED_MEMBER_BRACKET_FINAL)),{startsWithLet:object.startsWithLet,startsWithLetSquareBracket,startsWithCurly:object.startsWithCurly,startsWithFunctionOrClass:object.startsWithFunctionOrClass});}},{key:"reduceComputedPropertyName",value:function reduceComputedPropertyName(node,_ref27){var expression=_ref27.expression;return this.bracket(this.p(node.expression,_coderep.Precedence.Assignment,expression),Sep.COMPUTED_PROPERTY_BRACKET_INTIAL,Sep.COMPUTED_PROPERTY_BRACKET_FINAL);}},{key:"reduceConditionalExpression",value:function reduceConditionalExpression(node,_ref28){var test=_ref28.test,consequent=_ref28.consequent,alternate=_ref28.alternate;var containsIn=test.containsIn||alternate.containsIn;var startsWithCurly=test.startsWithCurly;var startsWithLetSquareBracket=test.startsWithLetSquareBracket;var startsWithFunctionOrClass=test.startsWithFunctionOrClass;return(0,_objectAssign2.default)(seq(this.p(node.test,_coderep.Precedence.LogicalOR,test),this.sep(Sep.BEFORE_TERNARY_QUESTION),this.t("?"),this.sep(Sep.AFTER_TERNARY_QUESTION),this.p(node.consequent,_coderep.Precedence.Assignment,consequent),this.sep(Sep.BEFORE_TERNARY_COLON),this.t(":"),this.sep(Sep.AFTER_TERNARY_COLON),this.p(node.alternate,_coderep.Precedence.Assignment,alternate)),{containsIn,startsWithCurly,startsWithLetSquareBracket,startsWithFunctionOrClass});}},{key:"reduceContinueStatement",value:function reduceContinueStatement(node){return seq(this.t("continue"),node.label?seq(this.sep(Sep.BEFORE_JUMP_LABEL),this.t(node.label)):empty(),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceDataProperty",value:function reduceDataProperty(node,_ref29){var name=_ref29.name,expression=_ref29.expression;return seq(name,this.sep(Sep.BEFORE_PROP),this.t(":"),this.sep(Sep.AFTER_PROP),this.getAssignmentExpr(expression));}},{key:"reduceDebuggerStatement",value:function reduceDebuggerStatement(node){return seq(this.t("debugger"),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceDoWhileStatement",value:function reduceDoWhileStatement(node,_ref30){var body=_ref30.body,test=_ref30.test;return seq(this.t("do"),this.sep(Sep.AFTER_DO),body,this.sep(Sep.BEFORE_DOWHILE_WHILE),this.t("while"),this.sep(Sep.AFTER_DOWHILE_WHILE),this.paren(test,Sep.DO_WHILE_TEST_PAREN_BEFORE,Sep.DO_WHILE_TEST_PAREN_AFTER),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceEmptyStatement",value:function reduceEmptyStatement(node){return seq(this.t(";"),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceExpressionStatement",value:function reduceExpressionStatement(node,_ref31){var expression=_ref31.expression;var needsParens=expression.startsWithCurly||expression.startsWithLetSquareBracket||expression.startsWithFunctionOrClass;return seq(needsParens?this.paren(expression,Sep.EXPRESSION_STATEMENT_PAREN_BEFORE,Sep.EXPRESSION_STATEMENT_PAREN_AFTER):expression,this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceForInStatement",value:function reduceForInStatement(node,_ref32){var left=_ref32.left,right=_ref32.right,body=_ref32.body;left=node.left.type==="VariableDeclaration"?noIn(markContainsIn(left)):left;return(0,_objectAssign2.default)(seq(this.t("for"),this.sep(Sep.AFTER_FORIN_FOR),this.paren(seq(left.startsWithLet?this.paren(left,Sep.FOR_IN_LET_PAREN_BEFORE,Sep.FOR_IN_LET_PAREN_AFTER):left,this.sep(Sep.BEFORE_FORIN_IN),this.t("in"),this.sep(Sep.AFTER_FORIN_FOR),right),Sep.FOR_IN_PAREN_BEFORE,Sep.FOR_IN_PAREN_AFTER),this.sep(Sep.BEFORE_FORIN_BODY),body,this.sep(Sep.AFTER_STATEMENT(node))),{endsWithMissingElse:body.endsWithMissingElse});}},{key:"reduceForOfStatement",value:function reduceForOfStatement(node,_ref33){var left=_ref33.left,right=_ref33.right,body=_ref33.body;left=node.left.type==="VariableDeclaration"?noIn(markContainsIn(left)):left;return(0,_objectAssign2.default)(seq(this.t("for"),this.sep(Sep.AFTER_FOROF_FOR),this.paren(seq(left.startsWithLet?this.paren(left,Sep.FOR_OF_LET_PAREN_BEFORE,Sep.FOR_OF_LET_PAREN_AFTER):left,this.sep(Sep.BEFORE_FOROF_OF),this.t("of"),this.sep(Sep.AFTER_FOROF_FOR),this.p(node.right,_coderep.Precedence.Assignment,right)),Sep.FOR_OF_PAREN_BEFORE,Sep.FOR_OF_PAREN_AFTER),this.sep(Sep.BEFORE_FOROF_BODY),body,this.sep(Sep.AFTER_STATEMENT(node))),{endsWithMissingElse:body.endsWithMissingElse});}},{key:"reduceForStatement",value:function reduceForStatement(node,_ref34){var init=_ref34.init,test=_ref34.test,update=_ref34.update,body=_ref34.body;if(init){if(init.startsWithLetSquareBracket){init=this.paren(init,Sep.FOR_LET_PAREN_BEFORE,Sep.FOR_LET_PAREN_AFTER);}init=noIn(markContainsIn(init));}return(0,_objectAssign2.default)(seq(this.t("for"),this.sep(Sep.AFTER_FOR_FOR),this.paren(seq(init?seq(this.sep(Sep.BEFORE_FOR_INIT),init,this.sep(Sep.AFTER_FOR_INIT)):this.sep(Sep.EMPTY_FOR_INIT),this.t(";"),test?seq(this.sep(Sep.BEFORE_FOR_TEST),test,this.sep(Sep.AFTER_FOR_TEST)):this.sep(Sep.EMPTY_FOR_TEST),this.t(";"),update?seq(this.sep(Sep.BEFORE_FOR_UPDATE),update,this.sep(Sep.AFTER_FOR_UPDATE)):this.sep(Sep.EMPTY_FOR_UPDATE))),this.sep(Sep.BEFORE_FOR_BODY),body,this.sep(Sep.AFTER_STATEMENT(node))),{endsWithMissingElse:body.endsWithMissingElse});}},{key:"reduceForAwaitStatement",value:function reduceForAwaitStatement(node,_ref35){var left=_ref35.left,right=_ref35.right,body=_ref35.body;left=node.left.type==="VariableDeclaration"?noIn(markContainsIn(left)):left;return(0,_objectAssign2.default)(seq(this.t("for"),this.sep(Sep.AFTER_FOROF_FOR),this.t("await"),this.sep(Sep.AFTER_FORAWAIT_AWAIT),this.paren(seq(left.startsWithLet?this.paren(left,Sep.FOR_OF_LET_PAREN_BEFORE,Sep.FOR_OF_LET_PAREN_AFTER):left,this.sep(Sep.BEFORE_FOROF_OF),this.t("of"),this.sep(Sep.AFTER_FOROF_FOR),this.p(node.right,_coderep.Precedence.Assignment,right)),Sep.FOR_OF_PAREN_BEFORE,Sep.FOR_OF_PAREN_AFTER),this.sep(Sep.BEFORE_FOROF_BODY),body,this.sep(Sep.AFTER_STATEMENT(node))),{endsWithMissingElse:body.endsWithMissingElse});}},{key:"reduceFunctionBody",value:function reduceFunctionBody(node,_ref36){var directives=_ref36.directives,statements=_ref36.statements;if(statements.length){statements[0]=this.parenToAvoidBeingDirective(node.statements[0],statements[0]);}return seq.apply(void 0,_toConsumableArray$1(directives).concat([directives.length?this.sep(Sep.AFTER_FUNCTION_DIRECTIVES):empty()],_toConsumableArray$1(statements)));}},{key:"reduceFunctionDeclaration",value:function reduceFunctionDeclaration(node,_ref37){var name=_ref37.name,params=_ref37.params,body=_ref37.body;return seq(node.isAsync?this.t("async"):empty(),this.t("function"),node.isGenerator?seq(this.sep(Sep.BEFORE_GENERATOR_STAR),this.t("*"),this.sep(Sep.AFTER_GENERATOR_STAR)):empty(),this.sep(Sep.BEFORE_FUNCTION_NAME(node)),node.name.name==="*default*"?empty():name,this.sep(Sep.BEFORE_FUNCTION_PARAMS),this.paren(params,Sep.PARAMETERS_PAREN_BEFORE,Sep.PARAMETERS_PAREN_AFTER,Sep.PARAMETERS_PAREN_EMPTY),this.sep(Sep.BEFORE_FUNCTION_DECLARATION_BODY),this.brace(body,node,Sep.FUNCTION_BRACE_INITIAL,Sep.FUNCTION_BRACE_FINAL,Sep.FUNCTION_EMPTY),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceFunctionExpression",value:function reduceFunctionExpression(node,_ref38){var name=_ref38.name,params=_ref38.params,body=_ref38.body;var state=seq(node.isAsync?this.t("async"):empty(),this.t("function"),node.isGenerator?seq(this.sep(Sep.BEFORE_GENERATOR_STAR),this.t("*"),this.sep(Sep.AFTER_GENERATOR_STAR)):empty(),this.sep(Sep.BEFORE_FUNCTION_NAME(node)),name?name:empty(),this.sep(Sep.BEFORE_FUNCTION_PARAMS),this.paren(params,Sep.PARAMETERS_PAREN_BEFORE,Sep.PARAMETERS_PAREN_AFTER,Sep.PARAMETERS_PAREN_EMPTY),this.sep(Sep.BEFORE_FUNCTION_EXPRESSION_BODY),this.brace(body,node,Sep.FUNCTION_EXPRESSION_BRACE_INITIAL,Sep.FUNCTION_EXPRESSION_BRACE_FINAL,Sep.FUNCTION_EXPRESSION_EMPTY));state.startsWithFunctionOrClass=true;return state;}},{key:"reduceFormalParameters",value:function reduceFormalParameters(node,_ref39){var items=_ref39.items,rest=_ref39.rest;return this.commaSep(items.concat(rest==null?[]:[seq(this.t("..."),this.sep(Sep.REST),rest)]),Sep.PARAMETER_BEFORE_COMMA,Sep.PARAMETER_AFTER_COMMA);}},{key:"reduceArrowExpression",value:function reduceArrowExpression(node,_ref40){var params=_ref40.params,body=_ref40.body;if(node.params.rest!=null||node.params.items.length!==1||node.params.items[0].type!=="BindingIdentifier"){params=this.paren(params,Sep.ARROW_PARAMETERS_PAREN_BEFORE,Sep.ARROW_PARAMETERS_PAREN_AFTER,Sep.ARROW_PARAMETERS_PAREN_EMPTY);}var containsIn=false;if(node.body.type==="FunctionBody"){body=this.brace(body,node,Sep.ARROW_BRACE_INITIAL,Sep.ARROW_BRACE_FINAL,Sep.ARROW_BRACE_EMPTY);}else if(body.startsWithCurly){body=this.paren(body,Sep.ARROW_BODY_PAREN_BEFORE,Sep.ARROW_BODY_PAREN_AFTER);}else if(body.containsIn){containsIn=true;}return(0,_objectAssign2.default)(seq(node.isAsync?seq(this.t("async"),this.sep(Sep.BEFORE_ARROW_ASYNC_PARAMS)):empty(),params,this.sep(Sep.BEFORE_ARROW),this.t("=>"),this.sep(Sep.AFTER_ARROW),this.p(node.body,_coderep.Precedence.Assignment,body)),{containsIn});}},{key:"reduceGetter",value:function reduceGetter(node,_ref41){var name=_ref41.name,body=_ref41.body;return seq(this.t("get"),this.sep(Sep.AFTER_GET),name,this.sep(Sep.BEFORE_GET_PARAMS),this.paren(empty(),null,null,Sep.GETTER_PARAMS),this.sep(Sep.BEFORE_GET_BODY),this.brace(body,node,Sep.GET_BRACE_INTIAL,Sep.GET_BRACE_FINAL,Sep.GET_BRACE_EMPTY));}},{key:"reduceIdentifierExpression",value:function reduceIdentifierExpression(node){var a=this.t(node.name);if(node.name==="let"){a.startsWithLet=true;}return a;}},{key:"reduceIfStatement",value:function reduceIfStatement(node,_ref42){var test=_ref42.test,consequent=_ref42.consequent,alternate=_ref42.alternate;if(alternate&&consequent.endsWithMissingElse){consequent=this.brace(consequent,node,Sep.MISSING_ELSE_INTIIAL,Sep.MISSING_ELSE_FINAL,Sep.MISSING_ELSE_EMPTY);}return(0,_objectAssign2.default)(seq(this.t("if"),this.sep(Sep.AFTER_IF),this.paren(test,Sep.IF_PAREN_BEFORE,Sep.IF_PAREN_AFTER),this.sep(Sep.AFTER_IF_TEST),consequent,alternate?seq(this.sep(Sep.BEFORE_ELSE),this.t("else"),this.sep(Sep.AFTER_ELSE),alternate):empty(),this.sep(Sep.AFTER_STATEMENT(node))),{endsWithMissingElse:alternate?alternate.endsWithMissingElse:true});}},{key:"reduceImport",value:function reduceImport(node,_ref43){var defaultBinding=_ref43.defaultBinding,namedImports=_ref43.namedImports;var bindings=[];if(defaultBinding!=null){bindings.push(defaultBinding);}if(namedImports.length>0){bindings.push(this.brace(this.commaSep(namedImports,Sep.NAMED_IMPORT_BEFORE_COMMA,Sep.NAMED_IMPORT_AFTER_COMMA),node,Sep.IMPORT_BRACE_INTIAL,Sep.IMPORT_BRACE_FINAL,Sep.IMPORT_BRACE_EMPTY));}if(bindings.length===0){return seq(this.t("import"),this.sep(Sep.BEFORE_IMPORT_MODULE),this.t((0,_coderep.escapeStringLiteral)(node.moduleSpecifier)),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}return seq(this.t("import"),this.sep(Sep.BEFORE_IMPORT_BINDINGS),this.commaSep(bindings,Sep.IMPORT_BEFORE_COMMA,Sep.IMPORT_AFTER_COMMA),this.sep(Sep.AFTER_IMPORT_BINDINGS),this.t("from"),this.sep(Sep.AFTER_FROM),this.t((0,_coderep.escapeStringLiteral)(node.moduleSpecifier)),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceImportNamespace",value:function reduceImportNamespace(node,_ref44){var defaultBinding=_ref44.defaultBinding,namespaceBinding=_ref44.namespaceBinding;return seq(this.t("import"),this.sep(Sep.BEFORE_IMPORT_NAMESPACE),defaultBinding==null?empty():seq(defaultBinding,this.sep(Sep.IMPORT_BEFORE_COMMA),this.t(","),this.sep(Sep.IMPORT_AFTER_COMMA)),this.sep(Sep.BEFORE_IMPORT_STAR),this.t("*"),this.sep(Sep.AFTER_IMPORT_STAR),this.t("as"),this.sep(Sep.AFTER_IMPORT_AS),namespaceBinding,this.sep(Sep.AFTER_NAMESPACE_BINDING),this.t("from"),this.sep(Sep.AFTER_FROM),this.t((0,_coderep.escapeStringLiteral)(node.moduleSpecifier)),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceImportSpecifier",value:function reduceImportSpecifier(node,_ref45){var binding=_ref45.binding;if(node.name==null)return binding;return seq(this.t(node.name),this.sep(Sep.BEFORE_IMPORT_AS),this.t("as"),this.sep(Sep.AFTER_IMPORT_AS),binding);}},{key:"reduceExportAllFrom",value:function reduceExportAllFrom(node){return seq(this.t("export"),this.sep(Sep.BEFORE_EXPORT_STAR),this.t("*"),this.sep(Sep.AFTER_EXPORT_STAR),this.t("from"),this.sep(Sep.AFTER_FROM),this.t((0,_coderep.escapeStringLiteral)(node.moduleSpecifier)),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceExportFrom",value:function reduceExportFrom(node,_ref46){var namedExports=_ref46.namedExports;return seq(this.t("export"),this.sep(Sep.BEFORE_EXPORT_BINDINGS),this.brace(this.commaSep(namedExports,Sep.EXPORTS_BEFORE_COMMA,Sep.EXPORTS_AFTER_COMMA),node,Sep.EXPORT_BRACE_INITIAL,Sep.EXPORT_BRACE_FINAL,Sep.EXPORT_BRACE_EMPTY),this.sep(Sep.AFTER_EXPORT_FROM_BINDINGS),this.t("from"),this.sep(Sep.AFTER_FROM),this.t((0,_coderep.escapeStringLiteral)(node.moduleSpecifier)),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceExportLocals",value:function reduceExportLocals(node,_ref47){var namedExports=_ref47.namedExports;return seq(this.t("export"),this.sep(Sep.BEFORE_EXPORT_BINDINGS),this.brace(this.commaSep(namedExports,Sep.EXPORTS_BEFORE_COMMA,Sep.EXPORTS_AFTER_COMMA),node,Sep.EXPORT_BRACE_INITIAL,Sep.EXPORT_BRACE_FINAL,Sep.EXPORT_BRACE_EMPTY),this.sep(Sep.AFTER_EXPORT_LOCAL_BINDINGS),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceExport",value:function reduceExport(node,_ref48){var declaration=_ref48.declaration;switch(node.declaration.type){case"FunctionDeclaration":case"ClassDeclaration":break;default:declaration=seq(declaration,this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}return seq(this.t("export"),this.sep(Sep.AFTER_EXPORT),declaration);}},{key:"reduceExportDefault",value:function reduceExportDefault(node,_ref49){var body=_ref49.body;body=body.startsWithFunctionOrClass?this.paren(body,Sep.EXPORT_PAREN_BEFORE,Sep.EXPORT_PAREN_AFTER):body;switch(node.body.type){case"FunctionDeclaration":case"ClassDeclaration":return seq(this.t("export"),this.sep(Sep.EXPORT_DEFAULT),this.t("default"),this.sep(Sep.AFTER_EXPORT_DEFAULT),body);default:return seq(this.t("export"),this.sep(Sep.EXPORT_DEFAULT),this.t("default"),this.sep(Sep.AFTER_EXPORT_DEFAULT),this.p(node.body,_coderep.Precedence.Assignment,body),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}}},{key:"reduceExportFromSpecifier",value:function reduceExportFromSpecifier(node){if(node.exportedName==null)return this.t(node.name);return seq(this.t(node.name),this.sep(Sep.BEFORE_EXPORT_AS),this.t("as"),this.sep(Sep.AFTER_EXPORT_AS),this.t(node.exportedName));}},{key:"reduceExportLocalSpecifier",value:function reduceExportLocalSpecifier(node,_ref50){var name=_ref50.name;if(node.exportedName==null)return name;return seq(name,this.sep(Sep.BEFORE_EXPORT_AS),this.t("as"),this.sep(Sep.AFTER_EXPORT_AS),this.t(node.exportedName));}},{key:"reduceLabeledStatement",value:function reduceLabeledStatement(node,_ref51){var body=_ref51.body;return(0,_objectAssign2.default)(seq(this.t(node.label),this.sep(Sep.BEFORE_LABEL_COLON),this.t(":"),this.sep(Sep.AFTER_LABEL_COLON),body),{endsWithMissingElse:body.endsWithMissingElse});}},{key:"reduceLiteralBooleanExpression",value:function reduceLiteralBooleanExpression(node){return this.t(node.value.toString());}},{key:"reduceLiteralNullExpression",value:function reduceLiteralNullExpression(){return this.t("null");}},{key:"reduceLiteralInfinityExpression",value:function reduceLiteralInfinityExpression(){return this.t("2e308");}},{key:"reduceLiteralNumericExpression",value:function reduceLiteralNumericExpression(node){return new _coderep.NumberCodeRep(node.value);}},{key:"reduceLiteralRegExpExpression",value:function reduceLiteralRegExpExpression(node){return this.t("/"+node.pattern+"/"+(node.global?"g":"")+(node.ignoreCase?"i":"")+(node.multiLine?"m":"")+(node.dotAll?"s":"")+(node.unicode?"u":"")+(node.sticky?"y":""),true);}},{key:"reduceLiteralStringExpression",value:function reduceLiteralStringExpression(node){return this.t((0,_coderep.escapeStringLiteral)(node.value));}},{key:"reduceMethod",value:function reduceMethod(node,_ref52){var name=_ref52.name,params=_ref52.params,body=_ref52.body;return seq(node.isAsync?seq(this.t("async"),this.sep(Sep.AFTER_METHOD_ASYNC)):empty(),node.isGenerator?seq(this.t("*"),this.sep(Sep.AFTER_METHOD_GENERATOR_STAR)):empty(),name,this.sep(Sep.AFTER_METHOD_NAME),this.paren(params,Sep.PARAMETERS_PAREN_BEFORE,Sep.PARAMETERS_PAREN_AFTER,Sep.PARAMETERS_PAREN_EMPTY),this.sep(Sep.BEFORE_METHOD_BODY),this.brace(body,node,Sep.METHOD_BRACE_INTIAL,Sep.METHOD_BRACE_FINAL,Sep.METHOD_BRACE_EMPTY));}},{key:"reduceModule",value:function reduceModule(node,_ref53){var directives=_ref53.directives,items=_ref53.items;if(items.length){items[0]=this.parenToAvoidBeingDirective(node.items[0],items[0]);}return seq.apply(void 0,_toConsumableArray$1(directives).concat([directives.length?this.sep(Sep.AFTER_MODULE_DIRECTIVES):empty()],_toConsumableArray$1(items)));}},{key:"reduceNewExpression",value:function reduceNewExpression(node,_ref54){var _this7=this;var callee=_ref54.callee,args=_ref54.arguments;var parenthizedArgs=args.map(function(a,i2){return _this7.p(node.arguments[i2],_coderep.Precedence.Assignment,a);});var calleeRep=(0,_coderep.getPrecedence)(node.callee)===_coderep.Precedence.Call?this.paren(callee,Sep.NEW_CALLEE_PAREN_BEFORE,Sep.NEW_CALLEE_PAREN_AFTER):this.p(node.callee,(0,_coderep.getPrecedence)(node),callee);return seq(this.t("new"),this.sep(Sep.AFTER_NEW),calleeRep,args.length===0?this.sep(Sep.EMPTY_NEW_CALL):seq(this.sep(Sep.BEFORE_NEW_ARGS),this.paren(this.commaSep(parenthizedArgs,Sep.ARGS_BEFORE_COMMA,Sep.ARGS_AFTER_COMMA),Sep.NEW_PAREN_BEFORE,Sep.NEW_PAREN_AFTER,Sep.NEW_PAREN_EMPTY)));}},{key:"reduceNewTargetExpression",value:function reduceNewTargetExpression(){return seq(this.t("new"),this.sep(Sep.NEW_TARGET_BEFORE_DOT),this.t("."),this.sep(Sep.NEW_TARGET_AFTER_DOT),this.t("target"));}},{key:"reduceObjectExpression",value:function reduceObjectExpression(node,_ref55){var properties=_ref55.properties;var state=this.brace(this.commaSep(properties,Sep.OBJECT_BEFORE_COMMA,Sep.OBJECT_AFTER_COMMA),node,Sep.OBJECT_BRACE_INITIAL,Sep.OBJECT_BRACE_FINAL,Sep.OBJECT_EMPTY);state.startsWithCurly=true;return state;}},{key:"reduceUpdateExpression",value:function reduceUpdateExpression(node,_ref56){var operand=_ref56.operand;if(node.isPrefix){return this.reduceUnaryExpression.apply(this,arguments);}return(0,_objectAssign2.default)(seq(this.p(node.operand,_coderep.Precedence.New,operand),this.sep(Sep.BEFORE_POSTFIX(node.operator)),this.t(node.operator)),{startsWithCurly:operand.startsWithCurly,startsWithLetSquareBracket:operand.startsWithLetSquareBracket,startsWithFunctionOrClass:operand.startsWithFunctionOrClass});}},{key:"reduceUnaryExpression",value:function reduceUnaryExpression(node,_ref57){var operand=_ref57.operand;return seq(this.t(node.operator),this.sep(Sep.UNARY(node.operator)),this.p(node.operand,(0,_coderep.getPrecedence)(node),operand));}},{key:"reduceReturnStatement",value:function reduceReturnStatement(node,_ref58){var expression=_ref58.expression;return seq(this.t("return"),expression?seq(this.sep(Sep.RETURN),expression):empty(),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceScript",value:function reduceScript(node,_ref59){var directives=_ref59.directives,statements=_ref59.statements;if(statements.length){statements[0]=this.parenToAvoidBeingDirective(node.statements[0],statements[0]);}return seq.apply(void 0,_toConsumableArray$1(directives).concat([directives.length?this.sep(Sep.AFTER_SCRIPT_DIRECTIVES):empty()],_toConsumableArray$1(statements)));}},{key:"reduceSetter",value:function reduceSetter(node,_ref60){var name=_ref60.name,param=_ref60.param,body=_ref60.body;return seq(this.t("set"),this.sep(Sep.AFTER_SET),name,this.sep(Sep.BEFORE_SET_PARAMS),this.paren(param,Sep.SETTER_PARAM_BEFORE,Sep.SETTER_PARAM_AFTER),this.sep(Sep.BEFORE_SET_BODY),this.brace(body,node,Sep.SET_BRACE_INTIIAL,Sep.SET_BRACE_FINAL,Sep.SET_BRACE_EMPTY));}},{key:"reduceShorthandProperty",value:function reduceShorthandProperty(node,_ref61){var name=_ref61.name;return name;}},{key:"reduceStaticMemberAssignmentTarget",value:function reduceStaticMemberAssignmentTarget(node,_ref62){var object=_ref62.object;var state=seq(this.p(node.object,(0,_coderep.getPrecedence)(node),object),this.sep(Sep.BEFORE_STATIC_MEMBER_ASSIGNMENT_TARGET_DOT),this.t("."),this.sep(Sep.AFTER_STATIC_MEMBER_ASSIGNMENT_TARGET_DOT),this.t(node.property));state.startsWithLet=object.startsWithLet;state.startsWithCurly=object.startsWithCurly;state.startsWithLetSquareBracket=object.startsWithLetSquareBracket;state.startsWithFunctionOrClass=object.startsWithFunctionOrClass;return state;}},{key:"reduceStaticMemberExpression",value:function reduceStaticMemberExpression(node,_ref63){var object=_ref63.object;var state=seq(this.p(node.object,(0,_coderep.getPrecedence)(node),object),this.sep(Sep.BEFORE_STATIC_MEMBER_DOT),this.t("."),this.sep(Sep.AFTER_STATIC_MEMBER_DOT),this.t(node.property));state.startsWithLet=object.startsWithLet;state.startsWithCurly=object.startsWithCurly;state.startsWithLetSquareBracket=object.startsWithLetSquareBracket;state.startsWithFunctionOrClass=object.startsWithFunctionOrClass;return state;}},{key:"reduceStaticPropertyName",value:function reduceStaticPropertyName(node){if(_esutils.keyword.isIdentifierNameES6(node.value)){return this.t(node.value);}var n=parseFloat(node.value);if(n>=0&&n.toString()===node.value){return new _coderep.NumberCodeRep(n);}return this.t((0,_coderep.escapeStringLiteral)(node.value));}},{key:"reduceSuper",value:function reduceSuper(){return this.t("super");}},{key:"reduceSwitchCase",value:function reduceSwitchCase(node,_ref64){var test=_ref64.test,consequent=_ref64.consequent;return seq(this.t("case"),this.sep(Sep.BEFORE_CASE_TEST),test,this.sep(Sep.AFTER_CASE_TEST),this.t(":"),this.sep(Sep.BEFORE_CASE_BODY),seq.apply(void 0,_toConsumableArray$1(consequent)),this.sep(Sep.AFTER_CASE_BODY));}},{key:"reduceSwitchDefault",value:function reduceSwitchDefault(node,_ref65){var consequent=_ref65.consequent;return seq(this.t("default"),this.sep(Sep.DEFAULT),this.t(":"),this.sep(Sep.BEFORE_CASE_BODY),seq.apply(void 0,_toConsumableArray$1(consequent)),this.sep(Sep.AFTER_DEFAULT_BODY));}},{key:"reduceSwitchStatement",value:function reduceSwitchStatement(node,_ref66){var discriminant=_ref66.discriminant,cases=_ref66.cases;return seq(this.t("switch"),this.sep(Sep.BEFORE_SWITCH_DISCRIM),this.paren(discriminant,Sep.SWITCH_DISCRIM_PAREN_BEFORE,Sep.SWITCH_DISCRIM_PAREN_AFTER),this.sep(Sep.BEFORE_SWITCH_BODY),this.brace(seq.apply(void 0,_toConsumableArray$1(cases)),node,Sep.SWITCH_BRACE_INTIAL,Sep.SWITCH_BRACE_FINAL,Sep.SWITCH_BRACE_EMPTY),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceSwitchStatementWithDefault",value:function reduceSwitchStatementWithDefault(node,_ref67){var discriminant=_ref67.discriminant,preDefaultCases=_ref67.preDefaultCases,defaultCase=_ref67.defaultCase,postDefaultCases=_ref67.postDefaultCases;return seq(this.t("switch"),this.sep(Sep.BEFORE_SWITCH_DISCRIM),this.paren(discriminant,Sep.SWITCH_DISCRIM_PAREN_BEFORE,Sep.SWITCH_DISCRIM_PAREN_AFTER),this.sep(Sep.BEFORE_SWITCH_BODY),this.brace(seq.apply(void 0,_toConsumableArray$1(preDefaultCases).concat([defaultCase],_toConsumableArray$1(postDefaultCases))),node,Sep.SWITCH_BRACE_INTIAL,Sep.SWITCH_BRACE_FINAL,Sep.SWITCH_BRACE_EMPTY),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceTemplateExpression",value:function reduceTemplateExpression(node,_ref68){var tag=_ref68.tag,elements=_ref68.elements;var state=node.tag==null?empty():seq(this.p(node.tag,(0,_coderep.getPrecedence)(node),tag),this.sep(Sep.TEMPLATE_TAG));state=seq(state,this.t("`"));for(var _i=0,l=node.elements.length;_i0)d+="}";d+=node.elements[_i].rawValue;if(_i=1e3&&n%10===0){s=n.toString(10);if(/[eE]/.test(s)){return s.replace(/[eE]\+/,"e");}return n.toString(10).replace(/0{3,}$/,function(match){return"e"+match.length;});}else if(n%1===0){if(n>1e15&&n<1e20){return"0x"+n.toString(16).toUpperCase();}return n.toString(10).replace(/[eE]\+/,"e");}return n.toString(10).replace(/^0\./,".").replace(/[eE]\+/,"e");}TokenStream_1=tokenStream$1.TokenStream=function(){function TokenStream(){_classCallCheck$1(this,TokenStream);this.result="";this.lastNumber=null;this.lastCodePoint=null;this.lastTokenStr="";this.optionalSemi=false;this.previousWasRegExp=false;this.partialHtmlComment=false;}_createClass$1(TokenStream,[{key:"putNumber",value:function putNumber(number){var tokenStr=renderNumber(number);this.put(tokenStr);this.lastNumber=tokenStr;}},{key:"putOptionalSemi",value:function putOptionalSemi(){this.optionalSemi=true;}},{key:"putRaw",value:function putRaw(tokenStr){this.result+=tokenStr;this.lastTokenStr=tokenStr;}},{key:"put",value:function put(tokenStr,isRegExp){if(this.optionalSemi){this.optionalSemi=false;if(tokenStr!=="}"){this.result+=";";this.lastCodePoint=";";this.previousWasRegExp=false;}}if(this.lastNumber!==null&&tokenStr.length===1){if(tokenStr==="."){this.result+=needsDoubleDot(this.lastNumber)?"..":".";this.lastNumber=null;this.lastCodePoint=".";return;}}var tokenStrCodePointCount=[].concat(_toConsumableArray(tokenStr)).length;if(tokenStrCodePointCount>0){this.lastNumber=null;var rightCodePoint=String.fromCodePoint(tokenStr.codePointAt(0));var lastCodePoint=this.lastCodePoint;this.lastCodePoint=String.fromCodePoint(tokenStr.codePointAt(tokenStrCodePointCount-1));var previousWasRegExp=this.previousWasRegExp;this.previousWasRegExp=isRegExp;if(lastCodePoint&&((lastCodePoint==="+"||lastCodePoint==="-")&&lastCodePoint===rightCodePoint||isIdentifierPartES6(lastCodePoint)&&isIdentifierPartES6(rightCodePoint)||lastCodePoint==="/"&&rightCodePoint==="/"||previousWasRegExp&&rightCodePoint==="i"||this.partialHtmlComment&&tokenStr.startsWith("--"))){this.result+=" ";}}this.partialHtmlComment=this.lastTokenStr.endsWith("<")&&tokenStr==="!";this.result+=tokenStr;this.lastTokenStr=tokenStr;}}]);return TokenStream;}();var tokenStream=/* @__PURE__ */_mergeNamespaces({__proto__:null,get TokenStream(){return TokenStream_1;},needsDoubleDot:needsDoubleDot_1,"default":tokenStream$1},[tokenStream$1]);var require$$5=/* @__PURE__ */getAugmentedNamespace(tokenStream);Object.defineProperty(withLocation$1,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i2=0;i21?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key];}ts.locations.set(node,{start:{line:1,column:0,offset:0},end:null});originalEmit.apply(void 0,[ts].concat(args));ts.locations.get(node).end={line:ts.line,column:ts.column,offset:ts.result.length};};}else if(node.type==="LiteralNumericExpression"){rep.emit=function(ts){for(var _len2=arguments.length,args=Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){args[_key2-1]=arguments[_key2];}ts.startEmit(node);originalEmit.apply(void 0,[ts].concat(args));ts.finishEmit(node);ts.lastNumberNode=node;};}else{rep.emit=function(ts){for(var _len3=arguments.length,args=Array(_len3>1?_len3-1:0),_key3=1;_key3<_len3;_key3++){args[_key3-1]=arguments[_key3];}ts.startEmit(node);originalEmit.apply(void 0,[ts].concat(args));ts.finishEmit(node);};}return rep;}function addLocationToReducer(reducer){var wrapped=(0,_shiftReducer.adapt)(addLocation,reducer);var originalRegenerate=wrapped.regenerateArrowParams.bind(wrapped);wrapped.regenerateArrowParams=function(element,original){var out=originalRegenerate(element,original);if(out!==original){addLocation(out,element);}return out;};var originalDirective=wrapped.parenToAvoidBeingDirective.bind(wrapped);wrapped.parenToAvoidBeingDirective=function(element,original){var out=originalDirective(element,original);if(out!==original){addLocation(out,element);}return out;};return wrapped;}function codeGenWithLocation(program){var generator=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new _minimalCodegen2.default();var ts=new TokenStreamWithLocation();var rep=(0,_shiftReducer.reduce)(addLocationToReducer(generator),program);rep.emit(ts);return{source:ts.result,locations:ts.locations};}var withLocation=/* @__PURE__ */_mergeNamespaces({__proto__:null,"default":_default},[withLocation$1]);var require$$3=/* @__PURE__ */getAugmentedNamespace(withLocation);(function(exports2){Object.defineProperty(exports2,"__esModule",{value:true});exports2.codeGenWithLocation=exports2.SemiOp=exports2.CommaSep=exports2.Semi=exports2.Seq=exports2.ContainsIn=exports2.NoIn=exports2.Brace=exports2.Bracket=exports2.Paren=exports2.NumberCodeRep=exports2.Token=exports2.Empty=exports2.CodeRep=exports2.escapeStringLiteral=exports2.getPrecedence=exports2.Precedence=exports2.Sep=exports2.FormattedCodeGen=exports2.ExtensibleCodeGen=exports2.MinimalCodeGen=void 0;exports2.default=codeGen;var _minimalCodegen3=require$$0$1;Object.defineProperty(exports2,"MinimalCodeGen",{enumerable:true,get:function get5(){return _interopRequireDefault2(_minimalCodegen3).default;}});var _formattedCodegen=require$$1;Object.defineProperty(exports2,"ExtensibleCodeGen",{enumerable:true,get:function get5(){return _formattedCodegen.ExtensibleCodeGen;}});Object.defineProperty(exports2,"FormattedCodeGen",{enumerable:true,get:function get5(){return _formattedCodegen.FormattedCodeGen;}});Object.defineProperty(exports2,"Sep",{enumerable:true,get:function get5(){return _formattedCodegen.Sep;}});var _coderep2=require$$2;Object.defineProperty(exports2,"Precedence",{enumerable:true,get:function get5(){return _coderep2.Precedence;}});Object.defineProperty(exports2,"getPrecedence",{enumerable:true,get:function get5(){return _coderep2.getPrecedence;}});Object.defineProperty(exports2,"escapeStringLiteral",{enumerable:true,get:function get5(){return _coderep2.escapeStringLiteral;}});Object.defineProperty(exports2,"CodeRep",{enumerable:true,get:function get5(){return _coderep2.CodeRep;}});Object.defineProperty(exports2,"Empty",{enumerable:true,get:function get5(){return _coderep2.Empty;}});Object.defineProperty(exports2,"Token",{enumerable:true,get:function get5(){return _coderep2.Token;}});Object.defineProperty(exports2,"NumberCodeRep",{enumerable:true,get:function get5(){return _coderep2.NumberCodeRep;}});Object.defineProperty(exports2,"Paren",{enumerable:true,get:function get5(){return _coderep2.Paren;}});Object.defineProperty(exports2,"Bracket",{enumerable:true,get:function get5(){return _coderep2.Bracket;}});Object.defineProperty(exports2,"Brace",{enumerable:true,get:function get5(){return _coderep2.Brace;}});Object.defineProperty(exports2,"NoIn",{enumerable:true,get:function get5(){return _coderep2.NoIn;}});Object.defineProperty(exports2,"ContainsIn",{enumerable:true,get:function get5(){return _coderep2.ContainsIn;}});Object.defineProperty(exports2,"Seq",{enumerable:true,get:function get5(){return _coderep2.Seq;}});Object.defineProperty(exports2,"Semi",{enumerable:true,get:function get5(){return _coderep2.Semi;}});Object.defineProperty(exports2,"CommaSep",{enumerable:true,get:function get5(){return _coderep2.CommaSep;}});Object.defineProperty(exports2,"SemiOp",{enumerable:true,get:function get5(){return _coderep2.SemiOp;}});var _withLocation=require$$3;Object.defineProperty(exports2,"codeGenWithLocation",{enumerable:true,get:function get5(){return _interopRequireDefault2(_withLocation).default;}});var _shiftReducer3=require$$4;var _shiftReducer22=_interopRequireDefault2(_shiftReducer3);var _tokenStream2=require$$5;var _minimalCodegen22=_interopRequireDefault2(_minimalCodegen3);function _interopRequireDefault2(obj){return obj&&obj.__esModule?obj:{default:obj};}function codeGen(script){var generator=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new _minimalCodegen22.default();var ts=new _tokenStream2.TokenStream();var rep=(0,_shiftReducer22.default)(generator,script);rep.emit(ts);return ts.result;}})(dist);var shiftCodegen=/* @__PURE__ */getDefaultExportFromCjs(dist);shiftCodegen["default"]||shiftCodegen;var Pattern$1=strudel.Pattern;Object.keys(Pattern$1.prototype.factories).concat(["mini"]);var pure=strudel.pure,Pattern=strudel.Pattern,Fraction=strudel.Fraction,stack=strudel.stack,slowcat=strudel.slowcat,sequence=strudel.sequence,timeCat=strudel.timeCat,silence=strudel.silence,reify$1=strudel.reify;var _seedState=0;var randOffset=2e-4;function _nextSeed(){return _seedState++;}var applyOptions=parent=>(pat,i2)=>{const ast2=parent.source_[i2];const options=ast2.options_;const operator=options==null?void 0:options.operator;if(operator){switch(operator.type_){case"stretch":const speed=Fraction(operator.arguments_.amount).inverse();return reify$1(pat).fast(speed);case"bjorklund":return pat.euclid(operator.arguments_.pulse,operator.arguments_.step,operator.arguments_.rotation);case"degradeBy":return reify$1(pat)._degradeByWith(rand.early(randOffset*_nextSeed()).segment(1),operator.arguments_.amount);}console.warn(`operator "${operator.type_}" not implemented`);}if(options==null?void 0:options.weight){return pat;}const unimplemented=Object.keys(options||{}).filter(key=>key!=="operator");if(unimplemented.length){console.warn(`option${unimplemented.length>1?"s":""} ${unimplemented.map(o=>`"${o}"`).join(", ")} not implemented`);}return pat;};function resolveReplications(ast2){ast2.source_=ast2.source_.map(child=>{const{replicate,...options}=child.options_||{};if(replicate){return{...child,options_:{...options,weight:replicate},source_:{type_:"pattern",arguments_:{alignment:"h"},source_:[{type_:"element",source_:child.source_,location_:child.location_,options_:{operator:{type_:"stretch",arguments_:{amount:Fraction(replicate).inverse().toString()}}}}]}};}return child;});}function patternifyAST(ast2){switch(ast2.type_){case"pattern":resolveReplications(ast2);const children=ast2.source_.map(patternifyAST).map(applyOptions(ast2));const alignment=ast2.arguments_.alignment;if(alignment==="v"){return stack(...children);}if(alignment==="r"){return chooseInWith(rand.early(randOffset*_nextSeed()).segment(1),children);}const weightedChildren=ast2.source_.some(child=>{var _a;return!!((_a=child.options_)==null?void 0:_a.weight);});if(!weightedChildren&&alignment==="t"){return slowcat(...children);}if(weightedChildren){const pat=timeCat(...ast2.source_.map((child,i2)=>{var _a;return[((_a=child.options_)==null?void 0:_a.weight)||1,children[i2]];}));if(alignment==="t"){const weightSum=ast2.source_.reduce((sum,child)=>{var _a;return sum+(((_a=child.options_)==null?void 0:_a.weight)||1);},0);return pat._slow(weightSum);}return pat;}return sequence(...children);case"element":if(ast2.source_==="~"){return silence;}if(typeof ast2.source_!=="object"){if(!ast2.location_){console.warn("no location for",ast2);return ast2.source_;}const{start,end}=ast2.location_;const value=!isNaN(Number(ast2.source_))?Number(ast2.source_):ast2.source_;return pure(value).withLocation([start.line,start.column,start.offset],[end.line,end.column,end.offset]);}return patternifyAST(ast2.source_);case"stretch":return patternifyAST(ast2.source_).slow(ast2.arguments_.amount);default:console.warn(`node type "${ast2.type_}" not implemented -> returning silence`);return silence;}}var mini=(...strings)=>{const pats=strings.map(str=>{const ast2=peg$parse(`"${str}"`);return patternifyAST(ast2);});return sequence(...pats);};var h=string=>{const ast2=peg$parse(string);return patternifyAST(ast2);};Pattern.prototype.define("mini",mini,{composable:true});Pattern.prototype.define("m",mini,{composable:true});Pattern.prototype.define("h",h,{composable:true});function minify(thing){if(typeof thing==="string"){return mini(thing);}return reify$1(thing);}exports.SyntaxError=peg$SyntaxError;exports.h=h;exports.mini=mini;exports.minify=minify;exports.parse=peg$parse;exports.patternifyAST=patternifyAST; +Please check with "npm ls @strudel.cycles/core".`); +} + +globalThis._strudelLoaded = true; +var strudel = /* @__PURE__ */Object.freeze( /* @__PURE__ */Object.defineProperty({ + __proto__: null, + Fraction: fraction, + gist: gist, + Hap: Hap, + Pattern: Pattern$1, + silence: silence$1, + pure: pure$1, + isPattern: isPattern, + reify: reify$2, + stack: stack$1, + slowcat: slowcat$1, + slowcatPrime: slowcatPrime, + fastcat: _fastcat, + cat: _cat, + timeCat: timeCat$1, + sequence: sequence$1, + seq: seq, + polymeterSteps: polymeterSteps, + polymeter: polymeter, + pm: pm, + polyrhythm: polyrhythm, + pr: pr, + add: add, + chop: chop, + chunk: chunk, + chunkBack: chunkBack, + div: div, + early: early, + echo: echo, + every: every, + fast: fast, + inv: inv, + invert: invert, + iter: iter, + iterBack: iterBack, + jux: jux, + juxBy: juxBy, + late: late, + linger: linger, + mask: mask, + mul: mul, + off: off, + ply: ply, + range: range, + range2: range2, + rev: rev, + slow: slow, + struct: struct, + sub: sub, + superimpose: superimpose, + set: set, + when: when, + makeComposable: makeComposable, + patternify2: patternify2, + patternify3: patternify3, + patternify4: patternify4, + steady: steady, + signal: signal, + isaw: isaw, + isaw2: isaw2, + saw: saw, + saw2: saw2, + sine2: sine2, + sine: sine, + cosine: cosine, + cosine2: cosine2, + square: square, + square2: square2, + tri: tri, + tri2: tri2, + time: time, + rand: rand, + rand2: rand2, + _brandBy: _brandBy, + brandBy: brandBy, + brand: brand, + _irand: _irand, + irand: irand, + __chooseWith: __chooseWith, + chooseWith: chooseWith, + chooseInWith: chooseInWith, + choose: choose, + chooseCycles: chooseCycles, + randcat: randcat, + wchoose: wchoose, + wchooseCycles: wchooseCycles, + perlinWith: perlinWith, + perlin: perlin, + State: State, + TimeSpan: TimeSpan, + isNote: isNote, + tokenizeNote: tokenizeNote, + toMidi: toMidi, + fromMidi: fromMidi, + getFreq: getFreq, + midi2note: midi2note, + mod: mod, + getPlayableNoteValue: getPlayableNoteValue, + getFrequency: getFrequency, + rotate: rotate, + pipe: pipe, + compose: compose, + removeUndefineds: removeUndefineds, + flatten: flatten, + id: id, + constant: constant, + listRange: listRange, + curry: curry +}, Symbol.toStringTag, { + value: "Module" +})); +var pure = strudel.pure, + Pattern = strudel.Pattern, + Fraction = strudel.Fraction, + stack = strudel.stack, + slowcat = strudel.slowcat, + sequence = strudel.sequence, + timeCat = strudel.timeCat, + silence = strudel.silence, + reify$1 = strudel.reify; +var _seedState = 0; +var randOffset = 2e-4; + +function _nextSeed() { + return _seedState++; +} + +var applyOptions = parent => (pat, i) => { + const ast = parent.source_[i]; + const options = ast.options_; + const operator = options == null ? void 0 : options.operator; + + if (operator) { + switch (operator.type_) { + case "stretch": + const speed = Fraction(operator.arguments_.amount).inverse(); + return reify$1(pat).fast(speed); + + case "bjorklund": + return pat.euclid(operator.arguments_.pulse, operator.arguments_.step, operator.arguments_.rotation); + + case "degradeBy": + return reify$1(pat)._degradeByWith(rand.early(randOffset * _nextSeed()).segment(1), operator.arguments_.amount); + } + + console.warn(`operator "${operator.type_}" not implemented`); + } + + if (options == null ? void 0 : options.weight) { + return pat; + } + + const unimplemented = Object.keys(options || {}).filter(key => key !== "operator"); + + if (unimplemented.length) { + console.warn(`option${unimplemented.length > 1 ? "s" : ""} ${unimplemented.map(o => `"${o}"`).join(", ")} not implemented`); + } + + return pat; +}; + +function resolveReplications(ast) { + ast.source_ = ast.source_.map(child => { + const { + replicate, + ...options + } = child.options_ || {}; + + if (replicate) { + return { ...child, + options_: { ...options, + weight: replicate + }, + source_: { + type_: "pattern", + arguments_: { + alignment: "h" + }, + source_: [{ + type_: "element", + source_: child.source_, + location_: child.location_, + options_: { + operator: { + type_: "stretch", + arguments_: { + amount: Fraction(replicate).inverse().toString() + } + } + } + }] + } + }; + } + + return child; + }); +} + +function patternifyAST(ast) { + let p; + + switch (ast.type_) { + case "pattern": + resolveReplications(ast); + const children = ast.source_.map(patternifyAST).map(applyOptions(ast)); + const alignment = ast.arguments_.alignment; + + if (alignment === "v") { + return stack(...children); + } + + if (alignment === "r") { + return chooseInWith(rand.early(randOffset * _nextSeed()).segment(1), children); + } + + const weightedChildren = ast.source_.some(child => { + var _a; + + return !!((_a = child.options_) == null ? void 0 : _a.weight); + }); + + if (!weightedChildren && alignment === "t") { + return slowcat(...children); + } + + if (weightedChildren) { + const pat = timeCat(...ast.source_.map((child, i) => { + var _a; + + return [((_a = child.options_) == null ? void 0 : _a.weight) || 1, children[i]]; + })); + + if (alignment === "t") { + const weightSum = ast.source_.reduce((sum, child) => { + var _a; + + return sum + (((_a = child.options_) == null ? void 0 : _a.weight) || 1); + }, 0); + return pat._slow(weightSum); + } + + return pat; + } + + return sequence(...children); + + case "element": + if (ast.source_ === "~") { + return silence; + } + + if (typeof ast.source_ !== "object") { + if (!ast.location_) { + console.warn("no location for", ast); + return ast.source_; + } + + const { + start, + end + } = ast.location_; + const value = !isNaN(Number(ast.source_)) ? Number(ast.source_) : ast.source_; + return pure(value).withLocation([start.line, start.column, start.offset], [end.line, end.column, end.offset]); + } + + p = patternifyAST(ast.source_); + p.ast = ast; + return p; + + case "stretch": + p = patternifyAST(ast.source_).slow(ast.arguments_.amount); + p.ast = ast; + return p; + + default: + console.warn(`node type "${ast.type_}" not implemented -> returning silence`); + return silence; + } +} + +var mini = (...strings) => { + const pats = strings.map(str => { + const ast = krillParser.parse(`"${str}"`); + const p = patternifyAST(ast); + p.ast = ast; + return p; + }); + const s = sequence(...pats); + s.ast = pats.map(_pat => _pat.ast); + return s; +}; + +var h = string => { + const ast = krillParser.parse(string); + const p = patternifyAST(ast); + p.ast = ast; + return p; +}; + +Pattern.prototype.define("mini", mini, { + composable: true +}); +Pattern.prototype.define("m", mini, { + composable: true +}); +Pattern.prototype.define("h", h, { + composable: true +}); + +function minify(thing) { + if (typeof thing === "string") { + return mini(thing); + } + + return reify$1(thing); +} + +exports.h = h; +exports.mini = mini; +exports.minify = minify; +exports.patternifyAST = patternifyAST; },{}],92:[function(require,module,exports){ "use strict"; @@ -8758,29 +14572,27 @@ module.exports = function (Gibberish) { g.gen.memory.heap[voice.bufferLength.memory.values.idx] = sampler.dataLength; // set voice data index - g.gen.memory.heap[voice.bufferLoc.memory.values.idx] = sampler.dataIdx; //if( rate !== null ) g.gen.memory.heap[ voice.rate.memory.values.idx ] = rate + g.gen.memory.heap[voice.bufferLoc.memory.values.idx] = sampler.dataIdx; // assume voice plays forward if no rate is provided + // global rate for sampler can still be used to reverse - if (rate !== null) voice.rate = rate; + voice.rate = rate !== null ? rate : 1; // determine direction voice will play at by checking sign + // of voice.rate and sampler.rate. If both are the same, + // then the direction will be forward, as they are multiplied + // ... two positives or two negatives will both create a + // positive value - if (rate > 0) { + const samplerRate = typeof this.rate === 'object' ? 1 : this.rate; + const dir = Math.sign(voice.rate) === Math.sign(samplerRate) ? 1 : 0; + + if (dir === 1) { + // trigger the bang assigned to the reset property of the + // counter object representing phase for the voice voice.trigger(); } else { - //console.log( 'reverse?', rate ) - voice.bang.trigger(); //voice.phase.value = 0 - - voice.phase.value = sampler.dataLength - 1; //console.log( 'phase', voice.phase.value ) - } //if( rate < 0 ) { - // const phase = sampler.dataIdx + Math.round((sampler.dataLength/2)) - 1 - // console.log( 'phase:', phase, 'length:', sampler.dataLength, 'start:', sampler.dataIdx ) - // //voice.phase.value = phase - // //g.gen.memory.heap[ voice.phase.memory.value.idx ] = phase - //}else{ - // // will reset phase to 0 - // voice.trigger() - //} - //voice.trigger() - //g.gen.memory.heap[ voice.rate.memory.values.idx ] = rate - + // reset the value of the phase counter to the + // end of the sample for reverse playback + voice.phase.value = sampler.dataLength - 1; + } } return voice; @@ -8864,6 +14676,10 @@ module.exports = function (Gibberish) { set rate(v) { g.gen.memory.heap[this.__rate.memory.values.idx] = v; + }, + + get rate() { + return g.gen.memory.heap[this.__rate.memory.values.idx]; } }; @@ -11563,16 +17379,15 @@ module.exports = function (Gibberish) { },{"../workletProxy.js":155}],152:[function(require,module,exports){ "use strict"; -var __proxy = require('../workletProxy.js'); - -var mini = require('../external/mini.js'); //const Pattern = require( 'tidal.pegjs' ) - +var __proxy = require('../workletProxy.js'), + mini = require('../external/mini.js'); module.exports = function (Gibberish) { const proxy = __proxy(Gibberish); const Sequencer = props => { - let __seq; + let __seq, + i = 0; const seq = { __isRunning: false, @@ -11583,12 +17398,16 @@ module.exports = function (Gibberish) { __events: null, tick(priority) { - // running for first time, perform a query + let startTime; // running for first time, perform a query + if (seq.__events === null || seq.__events.length === 0) { - //seq.__events = seq.__pattern.query( seq.__phase++, 1 ) + startTime = seq.__phase; seq.__events = seq.__pattern.queryArc(seq.__phase++, 1); - } // used when scheduling events that are very far apart + seq.__events.sort((a, b) => a.whole.begin.valueOf() > b.whole.begin.valueOf()); + } else { + startTime = seq.__events[0].whole.begin; + } if (seq.__events.length <= 0) { if (Gibberish.mode === 'processor') { @@ -11600,15 +17419,15 @@ module.exports = function (Gibberish) { return; } - const startTime = seq.__events[0].whole.begin; - if (seq.key !== 'chord') { - while (seq.__events.length > 0 && startTime.valueOf() === seq.__events[0].whole.begin.valueOf()) { - let event = seq.__events.shift(), - value = event.value, - uid = event.uid; // for bjorklund etc. + while (seq.__events.length > 0 && startTime.valueOf() >= seq.__events[0].whole.begin.valueOf()) { + let event = seq.__events.shift(); // make sure we should trigger sound + if (!event.hasOnset()) continue; + let value = event.value, + uid = event.context.locations[0].start.column; //console.log( 'evt', uid, event.context.locations ) + if (typeof value === 'object') value = value.value; if (seq.filters !== null) value = seq.filters.reduce((currentValue, filter) => filter(currentValue, seq, uid), value); @@ -11617,7 +17436,7 @@ module.exports = function (Gibberish) { value = value(); } - +Gibberish.processor.messages.push(seq.mainthreadonly, seq.key, value); + Gibberish.processor.messages.push(seq.mainthreadonly, seq.key, value); } else if (typeof seq.target[seq.key] === 'function') { seq.target[seq.key](value); } else { @@ -11627,7 +17446,7 @@ module.exports = function (Gibberish) { } else { let value = seq.__events.filter(evt => startTime.valueOf() === evt.whole.begin.valueOf()).map(evt => evt.value); - let uid = seq.__events[0].uid; + let uid = seq.__events[0].context.locations[0].start.column; const events = seq.__events.splice(0, value.length); @@ -11635,7 +17454,9 @@ module.exports = function (Gibberish) { if (value.length === 1) { value = seq.filters.reduce((currentValue, filter) => filter(currentValue, seq, uid), value); } else { - value.forEach((v, i) => seq.filters.reduce((currentValue, filter) => filter(currentValue, seq, events[i].uid), v)); + value.forEach((v, i) => { + return seq.filters.reduce((currentValue, filter) => filter(currentValue, seq, events[i].uid), v); + }); } } @@ -11655,13 +17476,18 @@ module.exports = function (Gibberish) { while (seq.__events.length <= 0) { seq.__events = seq.__pattern.queryArc(seq.__phase, ++seq.__phase); } + + seq.__events.sort((a, b) => a.whole.begin.valueOf() > b.whole.begin.valueOf()); } - timing = seq.__events[0].whole.begin.sub(startTime).valueOf(); //console.log( 'timings:', timing, startTime.valueOf(), seq.__events[0].whole.begin.valueOf() ) + timing = seq.__events[0].whole.begin.sub(startTime).valueOf(); + if (timing.valueOf() < 0) timing += 1; //if( timing <= 0 ) timing = Math.abs( timing ) + //console.log( seq.__events[0].whole.begin.toString(), startTime.toString(), timing ) + //console.log( 'timings:', timing, startTime.valueOf(), seq.__events[0].whole.begin.valueOf() ) - timing *= Math.ceil(Gibberish.ctx.sampleRate / Sequencer.clock.cps) + 1; //console.log( 'timing:', timing, startTime.valueOf(), seq.__events[0].whole.begin.valueOf() ) + timing *= Math.ceil(Gibberish.ctx.sampleRate / Sequencer.clock.cps); //console.log( 'timing:', timing, startTime.valueOf(), seq.__events[0].whole.begin.valueOf() ) - if (seq.__isRunning === true && !isNaN(timing) && timing > 0) { + if (seq.__isRunning === true && !isNaN(timing)) { Gibberish.scheduler.add(timing, seq.tick, seq.priority); } } @@ -11729,6 +17555,7 @@ module.exports = function (Gibberish) { cps: 1 }; Sequencer.id = Gibberish.utilities.getUID(); + Sequencer.mini = mini.mini; if (Gibberish.mode === 'worklet') { Gibberish.worklet.port.postMessage({ @@ -12078,6 +17905,7 @@ module.exports = function (Gibberish) { if (obj[propSplit[0]] !== undefined) { if (propSplit[1] !== undefined) { + //console.log( obj, propSplit[0], propSplit[1], value ) if (typeof obj[propSplit[0]][propSplit[1]] !== 'function') { obj[propSplit[0]][propSplit[1]] = value; } else { diff --git a/dist/gibberish_worklet.js b/dist/gibberish_worklet.js index 7ed5b26..f29f5ba 100644 --- a/dist/gibberish_worklet.js +++ b/dist/gibberish_worklet.js @@ -647,7 +647,8 @@ module.exports = ( _props ) => { if( usingWorklet === true && ugen.node !== null ) { ugen.node.port.postMessage({ key:'set', idx:ugen.memory.value.idx, value:ugen.max }) }else{ - gen.memory.heap[ ugen.memory.value.idx ] = ugen.max + if( gen.memory && gen.memory.heap ) + gen.memory.heap[ ugen.memory.value.idx ] = ugen.max } } @@ -5481,21 +5482,5834 @@ var AWPF = function (self = window, bufferSize = 4096) { module.exports = AWPF; },{"./realm.js":93}],91:[function(require,module,exports){ -"use strict";function _classCallCheck3(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;ikey in obj?__defProp(obj,key,{enumerable:true,configurable:true,writable:true,value}):obj[key]=value;var __publicField=(obj,key,value)=>{__defNormalProp(obj,typeof key!=="symbol"?key+"":key,value);return value;};Object.defineProperties(exports,_defineProperty({__esModule:{value:true}},Symbol.toStringTag,{value:"Module"}));function _mergeNamespaces(n,m){for(var i2=0;i2e[k]});}}}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}));}function peg$subclass(child,parent){function C(){this.constructor=child;}C.prototype=parent.prototype;child.prototype=new C();}function peg$SyntaxError(message,expected,found,location){var self=Error.call(this,message);if(Object.setPrototypeOf){Object.setPrototypeOf(self,peg$SyntaxError.prototype);}self.expected=expected;self.found=found;self.location=location;self.name="SyntaxError";return self;}peg$subclass(peg$SyntaxError,Error);function peg$padEnd(str,targetLength,padString){padString=padString||" ";if(str.length>targetLength){return str;}targetLength-=str.length;padString+=padString.repeat(targetLength);return str+padString.slice(0,targetLength);}peg$SyntaxError.prototype.format=function(sources){var str="Error: "+this.message;if(this.location){var src=null;var k;for(k=0;k "+loc+"\n"+filler+" |\n"+s.line+" | "+line+"\n"+filler+" | "+peg$padEnd("",s.column-1," ")+peg$padEnd("",hatLen,"^");}else{str+="\n at "+loc;}}return str;};peg$SyntaxError.buildMessage=function(expected,found){var DESCRIBE_EXPECTATION_FNS={literal:function(expectation){return'"'+literalEscape(expectation.text)+'"';},class:function(expectation){var escapedParts=expectation.parts.map(function(part){return Array.isArray(part)?classEscape(part[0])+"-"+classEscape(part[1]):classEscape(part);});return"["+(expectation.inverted?"^":"")+escapedParts.join("")+"]";},any:function(){return"any character";},end:function(){return"end of input";},other:function(expectation){return expectation.description;}};function hex(ch){return ch.charCodeAt(0).toString(16).toUpperCase();}function literalEscape(s){return s.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(ch){return"\\x0"+hex(ch);}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(ch){return"\\x"+hex(ch);});}function classEscape(s){return s.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(ch){return"\\x0"+hex(ch);}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(ch){return"\\x"+hex(ch);});}function describeExpectation(expectation){return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);}function describeExpected(expected2){var descriptions=expected2.map(describeExpectation);var i2,j;descriptions.sort();if(descriptions.length>0){for(i2=1,j=1;i2",false);var peg$e23=peg$literalExpectation("@",false);var peg$e24=peg$literalExpectation("!",false);var peg$e25=peg$literalExpectation("(",false);var peg$e26=peg$literalExpectation(")",false);var peg$e27=peg$literalExpectation("/",false);var peg$e28=peg$literalExpectation("*",false);var peg$e29=peg$literalExpectation("%",false);var peg$e30=peg$literalExpectation("?",false);var peg$e31=peg$literalExpectation("struct",false);var peg$e32=peg$literalExpectation("target",false);var peg$e33=peg$literalExpectation("euclid",false);var peg$e34=peg$literalExpectation("slow",false);var peg$e35=peg$literalExpectation("rotL",false);var peg$e36=peg$literalExpectation("rotR",false);var peg$e37=peg$literalExpectation("fast",false);var peg$e38=peg$literalExpectation("scale",false);var peg$e39=peg$literalExpectation("//",false);var peg$e40=peg$classExpectation(["\n"],true,false);var peg$e41=peg$literalExpectation("cat",false);var peg$e42=peg$literalExpectation("$",false);var peg$e43=peg$literalExpectation("setcps",false);var peg$e44=peg$literalExpectation("setbpm",false);var peg$e45=peg$literalExpectation("hush",false);var peg$f0=function(){return parseFloat(text());};var peg$f1=function(chars){return chars.join("");};var peg$f2=function(s){return s;};var peg$f3=function(sc){sc.arguments_.alignment="t";return sc;};var peg$f4=function(a){return{weight:a};};var peg$f5=function(a){return{replicate:a};};var peg$f6=function(p2,s,r){return{operator:{type_:"bjorklund",arguments_:{pulse:p2,step:s,rotation:r||0}}};};var peg$f7=function(a){return{operator:{type_:"stretch",arguments_:{amount:a}}};};var peg$f8=function(a){return{operator:{type_:"stretch",arguments_:{amount:"1/"+a}}};};var peg$f9=function(a){return{operator:{type_:"fixed-step",arguments_:{amount:a}}};};var peg$f10=function(a){return{operator:{type_:"degradeBy",arguments_:{amount:a?a:0.5}}};};var peg$f11=function(s,o){return new ElementStub(s,o);};var peg$f12=function(s){return new PatternStub(s,"h");};var peg$f13=function(tail){return{alignment:"v",list:tail};};var peg$f14=function(tail){return{alignment:"r",list:tail};};var peg$f15=function(head,tail){if(tail&&tail.list.length>0){return new PatternStub([head,...tail.list],tail.alignment);}else{return head;}};var peg$f16=function(sc){return sc;};var peg$f17=function(s){return{name:"struct",args:{sequence:s}};};var peg$f18=function(s){return{name:"target",args:{name:s}};};var peg$f19=function(p2,s,r){return{name:"bjorklund",args:{pulse:parseInt(p2),step:parseInt(s)}};};var peg$f20=function(a){return{name:"stretch",args:{amount:a}};};var peg$f21=function(a){return{name:"shift",args:{amount:"-"+a}};};var peg$f22=function(a){return{name:"shift",args:{amount:a}};};var peg$f23=function(a){return{name:"stretch",args:{amount:"1/"+a}};};var peg$f24=function(s){return{name:"scale",args:{scale:s.join("")}};};var peg$f25=function(s,v){return v;};var peg$f26=function(s,ss){ss.unshift(s);return new PatternStub(ss,"t");};var peg$f27=function(sg){return sg;};var peg$f28=function(o,soc){return new OperatorStub(o.name,o.args,soc);};var peg$f29=function(sc){return sc;};var peg$f30=function(c){return c;};var peg$f31=function(v){return new CommandStub("setcps",{value:v});};var peg$f32=function(v){return new CommandStub("setcps",{value:v/120/2});};var peg$f33=function(){return new CommandStub("hush");};var peg$currPos=0;var peg$savedPos=0;var peg$posDetailsCache=[{line:1,column:1}];var peg$maxFailPos=0;var peg$maxFailExpected=[];var peg$silentFails=0;var peg$result;if("startRule"in options){if(!(options.startRule in peg$startRuleFunctions)){throw new Error(`Can't start parsing from rule "`+options.startRule+'".');}peg$startRuleFunction=peg$startRuleFunctions[options.startRule];}function text(){return input.substring(peg$savedPos,peg$currPos);}function location(){return peg$computeLocation(peg$savedPos,peg$currPos);}function peg$literalExpectation(text2,ignoreCase){return{type:"literal",text:text2,ignoreCase};}function peg$classExpectation(parts,inverted,ignoreCase){return{type:"class",parts,inverted,ignoreCase};}function peg$endExpectation(){return{type:"end"};}function peg$otherExpectation(description){return{type:"other",description};}function peg$computePosDetails(pos){var details=peg$posDetailsCache[pos];var p2;if(details){return details;}else{p2=pos-1;while(!peg$posDetailsCache[p2]){p2--;}details=peg$posDetailsCache[p2];details={line:details.line,column:details.column};while(p2peg$maxFailPos){peg$maxFailPos=peg$currPos;peg$maxFailExpected=[];}peg$maxFailExpected.push(expected);}function peg$buildStructuredError(expected,found,location2){return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected,found),expected,found,location2);}function peg$parsestart(){var s0;s0=peg$parsestatement();return s0;}function peg$parsenumber(){var s0,s2;peg$silentFails++;s0=peg$currPos;peg$parseminus();s2=peg$parseint();if(s2!==peg$FAILED){peg$parsefrac();peg$parseexp();peg$savedPos=s0;s0=peg$f0();}else{peg$currPos=s0;s0=peg$FAILED;}peg$silentFails--;if(s0===peg$FAILED){if(peg$silentFails===0){peg$fail(peg$e0);}}return s0;}function peg$parsedecimal_point(){var s0;if(input.charCodeAt(peg$currPos)===46){s0=peg$c0;peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e1);}}return s0;}function peg$parsedigit1_9(){var s0;if(peg$r0.test(input.charAt(peg$currPos))){s0=input.charAt(peg$currPos);peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e2);}}return s0;}function peg$parsee(){var s0;if(peg$r1.test(input.charAt(peg$currPos))){s0=input.charAt(peg$currPos);peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e3);}}return s0;}function peg$parseexp(){var s0,s1,s2,s3,s4;s0=peg$currPos;s1=peg$parsee();if(s1!==peg$FAILED){s2=peg$parseminus();if(s2===peg$FAILED){s2=peg$parseplus();}if(s2===peg$FAILED){s2=null;}s3=[];s4=peg$parseDIGIT();if(s4!==peg$FAILED){while(s4!==peg$FAILED){s3.push(s4);s4=peg$parseDIGIT();}}else{s3=peg$FAILED;}if(s3!==peg$FAILED){s1=[s1,s2,s3];s0=s1;}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsefrac(){var s0,s1,s2,s3;s0=peg$currPos;s1=peg$parsedecimal_point();if(s1!==peg$FAILED){s2=[];s3=peg$parseDIGIT();if(s3!==peg$FAILED){while(s3!==peg$FAILED){s2.push(s3);s3=peg$parseDIGIT();}}else{s2=peg$FAILED;}if(s2!==peg$FAILED){s1=[s1,s2];s0=s1;}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parseint(){var s0,s1,s2,s3;s0=peg$parsezero();if(s0===peg$FAILED){s0=peg$currPos;s1=peg$parsedigit1_9();if(s1!==peg$FAILED){s2=[];s3=peg$parseDIGIT();while(s3!==peg$FAILED){s2.push(s3);s3=peg$parseDIGIT();}s1=[s1,s2];s0=s1;}else{peg$currPos=s0;s0=peg$FAILED;}}return s0;}function peg$parseminus(){var s0;if(input.charCodeAt(peg$currPos)===45){s0=peg$c1;peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e4);}}return s0;}function peg$parseplus(){var s0;if(input.charCodeAt(peg$currPos)===43){s0=peg$c2;peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e5);}}return s0;}function peg$parsezero(){var s0;if(input.charCodeAt(peg$currPos)===48){s0=peg$c3;peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e6);}}return s0;}function peg$parseDIGIT(){var s0;if(peg$r2.test(input.charAt(peg$currPos))){s0=input.charAt(peg$currPos);peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e7);}}return s0;}function peg$parsews(){var s0,s1;peg$silentFails++;s0=[];if(peg$r3.test(input.charAt(peg$currPos))){s1=input.charAt(peg$currPos);peg$currPos++;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e9);}}while(s1!==peg$FAILED){s0.push(s1);if(peg$r3.test(input.charAt(peg$currPos))){s1=input.charAt(peg$currPos);peg$currPos++;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e9);}}}peg$silentFails--;s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e8);}return s0;}function peg$parsecomma(){var s0,s1,s2,s3;s0=peg$currPos;s1=peg$parsews();if(input.charCodeAt(peg$currPos)===44){s2=peg$c4;peg$currPos++;}else{s2=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e10);}}if(s2!==peg$FAILED){s3=peg$parsews();s1=[s1,s2,s3];s0=s1;}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsepipe(){var s0,s1,s2,s3;s0=peg$currPos;s1=peg$parsews();if(input.charCodeAt(peg$currPos)===124){s2=peg$c5;peg$currPos++;}else{s2=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e11);}}if(s2!==peg$FAILED){s3=peg$parsews();s1=[s1,s2,s3];s0=s1;}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsequote(){var s0;if(input.charCodeAt(peg$currPos)===34){s0=peg$c6;peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e12);}}if(s0===peg$FAILED){if(input.charCodeAt(peg$currPos)===39){s0=peg$c7;peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e13);}}}return s0;}function peg$parsestep_char(){var s0;if(peg$r4.test(input.charAt(peg$currPos))){s0=input.charAt(peg$currPos);peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e14);}}if(s0===peg$FAILED){if(input.charCodeAt(peg$currPos)===45){s0=peg$c1;peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e4);}}if(s0===peg$FAILED){if(input.charCodeAt(peg$currPos)===35){s0=peg$c8;peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e15);}}if(s0===peg$FAILED){if(input.charCodeAt(peg$currPos)===46){s0=peg$c0;peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e1);}}if(s0===peg$FAILED){if(input.charCodeAt(peg$currPos)===94){s0=peg$c9;peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e16);}}if(s0===peg$FAILED){if(input.charCodeAt(peg$currPos)===95){s0=peg$c10;peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e17);}}if(s0===peg$FAILED){if(input.charCodeAt(peg$currPos)===58){s0=peg$c11;peg$currPos++;}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e18);}}}}}}}}return s0;}function peg$parsestep(){var s0,s2,s3;s0=peg$currPos;peg$parsews();s2=[];s3=peg$parsestep_char();if(s3!==peg$FAILED){while(s3!==peg$FAILED){s2.push(s3);s3=peg$parsestep_char();}}else{s2=peg$FAILED;}if(s2!==peg$FAILED){s3=peg$parsews();peg$savedPos=s0;s0=peg$f1(s2);}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsesub_cycle(){var s0,s2,s4,s6;s0=peg$currPos;peg$parsews();if(input.charCodeAt(peg$currPos)===91){s2=peg$c12;peg$currPos++;}else{s2=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e19);}}if(s2!==peg$FAILED){peg$parsews();s4=peg$parsestack_or_choose();if(s4!==peg$FAILED){peg$parsews();if(input.charCodeAt(peg$currPos)===93){s6=peg$c13;peg$currPos++;}else{s6=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e20);}}if(s6!==peg$FAILED){peg$parsews();peg$savedPos=s0;s0=peg$f2(s4);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsetimeline(){var s0,s2,s4,s6;s0=peg$currPos;peg$parsews();if(input.charCodeAt(peg$currPos)===60){s2=peg$c14;peg$currPos++;}else{s2=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e21);}}if(s2!==peg$FAILED){peg$parsews();s4=peg$parsesingle_cycle();if(s4!==peg$FAILED){peg$parsews();if(input.charCodeAt(peg$currPos)===62){s6=peg$c15;peg$currPos++;}else{s6=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e22);}}if(s6!==peg$FAILED){peg$parsews();peg$savedPos=s0;s0=peg$f3(s4);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parseslice(){var s0;s0=peg$parsestep();if(s0===peg$FAILED){s0=peg$parsesub_cycle();if(s0===peg$FAILED){s0=peg$parsetimeline();}}return s0;}function peg$parseslice_modifier(){var s0;s0=peg$parseslice_weight();if(s0===peg$FAILED){s0=peg$parseslice_bjorklund();if(s0===peg$FAILED){s0=peg$parseslice_slow();if(s0===peg$FAILED){s0=peg$parseslice_fast();if(s0===peg$FAILED){s0=peg$parseslice_fixed_step();if(s0===peg$FAILED){s0=peg$parseslice_replicate();if(s0===peg$FAILED){s0=peg$parseslice_degrade();}}}}}}return s0;}function peg$parseslice_weight(){var s0,s1,s2;s0=peg$currPos;if(input.charCodeAt(peg$currPos)===64){s1=peg$c16;peg$currPos++;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e23);}}if(s1!==peg$FAILED){s2=peg$parsenumber();if(s2!==peg$FAILED){peg$savedPos=s0;s0=peg$f4(s2);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parseslice_replicate(){var s0,s1,s2;s0=peg$currPos;if(input.charCodeAt(peg$currPos)===33){s1=peg$c17;peg$currPos++;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e24);}}if(s1!==peg$FAILED){s2=peg$parsenumber();if(s2!==peg$FAILED){peg$savedPos=s0;s0=peg$f5(s2);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parseslice_bjorklund(){var s0,s1,s3,s5,s7,s11,s13;s0=peg$currPos;if(input.charCodeAt(peg$currPos)===40){s1=peg$c18;peg$currPos++;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e25);}}if(s1!==peg$FAILED){peg$parsews();s3=peg$parsenumber();if(s3!==peg$FAILED){peg$parsews();s5=peg$parsecomma();if(s5!==peg$FAILED){peg$parsews();s7=peg$parsenumber();if(s7!==peg$FAILED){peg$parsews();peg$parsecomma();peg$parsews();s11=peg$parsenumber();if(s11===peg$FAILED){s11=null;}peg$parsews();if(input.charCodeAt(peg$currPos)===41){s13=peg$c19;peg$currPos++;}else{s13=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e26);}}if(s13!==peg$FAILED){peg$savedPos=s0;s0=peg$f6(s3,s7,s11);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parseslice_slow(){var s0,s1,s2;s0=peg$currPos;if(input.charCodeAt(peg$currPos)===47){s1=peg$c20;peg$currPos++;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e27);}}if(s1!==peg$FAILED){s2=peg$parsenumber();if(s2!==peg$FAILED){peg$savedPos=s0;s0=peg$f7(s2);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parseslice_fast(){var s0,s1,s2;s0=peg$currPos;if(input.charCodeAt(peg$currPos)===42){s1=peg$c21;peg$currPos++;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e28);}}if(s1!==peg$FAILED){s2=peg$parsenumber();if(s2!==peg$FAILED){peg$savedPos=s0;s0=peg$f8(s2);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parseslice_fixed_step(){var s0,s1,s2;s0=peg$currPos;if(input.charCodeAt(peg$currPos)===37){s1=peg$c22;peg$currPos++;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e29);}}if(s1!==peg$FAILED){s2=peg$parsenumber();if(s2!==peg$FAILED){peg$savedPos=s0;s0=peg$f9(s2);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parseslice_degrade(){var s0,s1,s2;s0=peg$currPos;if(input.charCodeAt(peg$currPos)===63){s1=peg$c23;peg$currPos++;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e30);}}if(s1!==peg$FAILED){s2=peg$parsenumber();if(s2===peg$FAILED){s2=null;}peg$savedPos=s0;s0=peg$f10(s2);}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parseslice_with_modifier(){var s0,s1,s2;s0=peg$currPos;s1=peg$parseslice();if(s1!==peg$FAILED){s2=peg$parseslice_modifier();if(s2===peg$FAILED){s2=null;}peg$savedPos=s0;s0=peg$f11(s1,s2);}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsesingle_cycle(){var s0,s1,s2;s0=peg$currPos;s1=[];s2=peg$parseslice_with_modifier();if(s2!==peg$FAILED){while(s2!==peg$FAILED){s1.push(s2);s2=peg$parseslice_with_modifier();}}else{s1=peg$FAILED;}if(s1!==peg$FAILED){peg$savedPos=s0;s1=peg$f12(s1);}s0=s1;return s0;}function peg$parsestack_tail(){var s0,s1,s2,s3,s4;s0=peg$currPos;s1=[];s2=peg$currPos;s3=peg$parsecomma();if(s3!==peg$FAILED){s4=peg$parsesingle_cycle();if(s4!==peg$FAILED){s2=s4;}else{peg$currPos=s2;s2=peg$FAILED;}}else{peg$currPos=s2;s2=peg$FAILED;}if(s2!==peg$FAILED){while(s2!==peg$FAILED){s1.push(s2);s2=peg$currPos;s3=peg$parsecomma();if(s3!==peg$FAILED){s4=peg$parsesingle_cycle();if(s4!==peg$FAILED){s2=s4;}else{peg$currPos=s2;s2=peg$FAILED;}}else{peg$currPos=s2;s2=peg$FAILED;}}}else{s1=peg$FAILED;}if(s1!==peg$FAILED){peg$savedPos=s0;s1=peg$f13(s1);}s0=s1;return s0;}function peg$parsechoose_tail(){var s0,s1,s2,s3,s4;s0=peg$currPos;s1=[];s2=peg$currPos;s3=peg$parsepipe();if(s3!==peg$FAILED){s4=peg$parsesingle_cycle();if(s4!==peg$FAILED){s2=s4;}else{peg$currPos=s2;s2=peg$FAILED;}}else{peg$currPos=s2;s2=peg$FAILED;}if(s2!==peg$FAILED){while(s2!==peg$FAILED){s1.push(s2);s2=peg$currPos;s3=peg$parsepipe();if(s3!==peg$FAILED){s4=peg$parsesingle_cycle();if(s4!==peg$FAILED){s2=s4;}else{peg$currPos=s2;s2=peg$FAILED;}}else{peg$currPos=s2;s2=peg$FAILED;}}}else{s1=peg$FAILED;}if(s1!==peg$FAILED){peg$savedPos=s0;s1=peg$f14(s1);}s0=s1;return s0;}function peg$parsestack_or_choose(){var s0,s1,s2;s0=peg$currPos;s1=peg$parsesingle_cycle();if(s1!==peg$FAILED){s2=peg$parsestack_tail();if(s2===peg$FAILED){s2=peg$parsechoose_tail();}if(s2===peg$FAILED){s2=null;}peg$savedPos=s0;s0=peg$f15(s1,s2);}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsesequence(){var s0,s2,s3,s4;s0=peg$currPos;peg$parsews();s2=peg$parsequote();if(s2!==peg$FAILED){s3=peg$parsestack_or_choose();if(s3!==peg$FAILED){s4=peg$parsequote();if(s4!==peg$FAILED){peg$savedPos=s0;s0=peg$f16(s3);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parseoperator(){var s0;s0=peg$parsescale();if(s0===peg$FAILED){s0=peg$parseslow();if(s0===peg$FAILED){s0=peg$parsefast();if(s0===peg$FAILED){s0=peg$parsetarget();if(s0===peg$FAILED){s0=peg$parsebjorklund();if(s0===peg$FAILED){s0=peg$parsestruct();if(s0===peg$FAILED){s0=peg$parserotR();if(s0===peg$FAILED){s0=peg$parserotL();}}}}}}}return s0;}function peg$parsestruct(){var s0,s1,s3;s0=peg$currPos;if(input.substr(peg$currPos,6)===peg$c24){s1=peg$c24;peg$currPos+=6;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e31);}}if(s1!==peg$FAILED){peg$parsews();s3=peg$parsesequence_or_operator();if(s3!==peg$FAILED){peg$savedPos=s0;s0=peg$f17(s3);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsetarget(){var s0,s1,s3,s4,s5;s0=peg$currPos;if(input.substr(peg$currPos,6)===peg$c25){s1=peg$c25;peg$currPos+=6;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e32);}}if(s1!==peg$FAILED){peg$parsews();s3=peg$parsequote();if(s3!==peg$FAILED){s4=peg$parsestep();if(s4!==peg$FAILED){s5=peg$parsequote();if(s5!==peg$FAILED){peg$savedPos=s0;s0=peg$f18(s4);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsebjorklund(){var s0,s1,s3,s5;s0=peg$currPos;if(input.substr(peg$currPos,6)===peg$c26){s1=peg$c26;peg$currPos+=6;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e33);}}if(s1!==peg$FAILED){peg$parsews();s3=peg$parseint();if(s3!==peg$FAILED){peg$parsews();s5=peg$parseint();if(s5!==peg$FAILED){peg$parsews();peg$parseint();peg$savedPos=s0;s0=peg$f19(s3,s5);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parseslow(){var s0,s1,s3;s0=peg$currPos;if(input.substr(peg$currPos,4)===peg$c27){s1=peg$c27;peg$currPos+=4;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e34);}}if(s1!==peg$FAILED){peg$parsews();s3=peg$parsenumber();if(s3!==peg$FAILED){peg$savedPos=s0;s0=peg$f20(s3);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parserotL(){var s0,s1,s3;s0=peg$currPos;if(input.substr(peg$currPos,4)===peg$c28){s1=peg$c28;peg$currPos+=4;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e35);}}if(s1!==peg$FAILED){peg$parsews();s3=peg$parsenumber();if(s3!==peg$FAILED){peg$savedPos=s0;s0=peg$f21(s3);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parserotR(){var s0,s1,s3;s0=peg$currPos;if(input.substr(peg$currPos,4)===peg$c29){s1=peg$c29;peg$currPos+=4;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e36);}}if(s1!==peg$FAILED){peg$parsews();s3=peg$parsenumber();if(s3!==peg$FAILED){peg$savedPos=s0;s0=peg$f22(s3);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsefast(){var s0,s1,s3;s0=peg$currPos;if(input.substr(peg$currPos,4)===peg$c30){s1=peg$c30;peg$currPos+=4;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e37);}}if(s1!==peg$FAILED){peg$parsews();s3=peg$parsenumber();if(s3!==peg$FAILED){peg$savedPos=s0;s0=peg$f23(s3);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsescale(){var s0,s1,s3,s4,s5;s0=peg$currPos;if(input.substr(peg$currPos,5)===peg$c31){s1=peg$c31;peg$currPos+=5;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e38);}}if(s1!==peg$FAILED){peg$parsews();s3=peg$parsequote();if(s3!==peg$FAILED){s4=[];s5=peg$parsestep_char();if(s5!==peg$FAILED){while(s5!==peg$FAILED){s4.push(s5);s5=peg$parsestep_char();}}else{s4=peg$FAILED;}if(s4!==peg$FAILED){s5=peg$parsequote();if(s5!==peg$FAILED){peg$savedPos=s0;s0=peg$f24(s4);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsecomment(){var s0,s1,s2,s3;s0=peg$currPos;if(input.substr(peg$currPos,2)===peg$c32){s1=peg$c32;peg$currPos+=2;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e39);}}if(s1!==peg$FAILED){s2=[];if(peg$r5.test(input.charAt(peg$currPos))){s3=input.charAt(peg$currPos);peg$currPos++;}else{s3=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e40);}}while(s3!==peg$FAILED){s2.push(s3);if(peg$r5.test(input.charAt(peg$currPos))){s3=input.charAt(peg$currPos);peg$currPos++;}else{s3=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e40);}}}s1=[s1,s2];s0=s1;}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsecat(){var s0,s1,s3,s5,s6,s7,s8,s9;s0=peg$currPos;if(input.substr(peg$currPos,3)===peg$c33){s1=peg$c33;peg$currPos+=3;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e41);}}if(s1!==peg$FAILED){peg$parsews();if(input.charCodeAt(peg$currPos)===91){s3=peg$c12;peg$currPos++;}else{s3=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e19);}}if(s3!==peg$FAILED){peg$parsews();s5=peg$parsesequence_or_operator();if(s5!==peg$FAILED){s6=[];s7=peg$currPos;s8=peg$parsecomma();if(s8!==peg$FAILED){s9=peg$parsesequence_or_operator();if(s9!==peg$FAILED){peg$savedPos=s7;s7=peg$f25(s5,s9);}else{peg$currPos=s7;s7=peg$FAILED;}}else{peg$currPos=s7;s7=peg$FAILED;}while(s7!==peg$FAILED){s6.push(s7);s7=peg$currPos;s8=peg$parsecomma();if(s8!==peg$FAILED){s9=peg$parsesequence_or_operator();if(s9!==peg$FAILED){peg$savedPos=s7;s7=peg$f25(s5,s9);}else{peg$currPos=s7;s7=peg$FAILED;}}else{peg$currPos=s7;s7=peg$FAILED;}}s7=peg$parsews();if(input.charCodeAt(peg$currPos)===93){s8=peg$c13;peg$currPos++;}else{s8=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e20);}}if(s8!==peg$FAILED){peg$savedPos=s0;s0=peg$f26(s5,s6);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsesequence_or_group(){var s0;s0=peg$parsecat();if(s0===peg$FAILED){s0=peg$parsesequence();}return s0;}function peg$parsesequence_or_operator(){var s0,s1,s3,s4,s5;s0=peg$currPos;s1=peg$parsesequence_or_group();if(s1!==peg$FAILED){peg$parsews();s3=[];s4=peg$parsecomment();while(s4!==peg$FAILED){s3.push(s4);s4=peg$parsecomment();}peg$savedPos=s0;s0=peg$f27(s1);}else{peg$currPos=s0;s0=peg$FAILED;}if(s0===peg$FAILED){s0=peg$currPos;s1=peg$parseoperator();if(s1!==peg$FAILED){peg$parsews();if(input.charCodeAt(peg$currPos)===36){s3=peg$c34;peg$currPos++;}else{s3=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e42);}}if(s3!==peg$FAILED){s4=peg$parsews();s5=peg$parsesequence_or_operator();if(s5!==peg$FAILED){peg$savedPos=s0;s0=peg$f28(s1,s5);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}}return s0;}function peg$parsesequ_or_operator_or_comment(){var s0,s1;s0=peg$currPos;s1=peg$parsesequence_or_operator();if(s1!==peg$FAILED){peg$savedPos=s0;s1=peg$f29(s1);}s0=s1;if(s0===peg$FAILED){s0=peg$parsecomment();}return s0;}function peg$parsesequence_definition(){var s0;s0=peg$parsesequ_or_operator_or_comment();return s0;}function peg$parsecommand(){var s0,s2;s0=peg$currPos;peg$parsews();s2=peg$parsesetcps();if(s2===peg$FAILED){s2=peg$parsesetbpm();if(s2===peg$FAILED){s2=peg$parsehush();}}if(s2!==peg$FAILED){peg$parsews();peg$savedPos=s0;s0=peg$f30(s2);}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsesetcps(){var s0,s1,s3;s0=peg$currPos;if(input.substr(peg$currPos,6)===peg$c35){s1=peg$c35;peg$currPos+=6;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e43);}}if(s1!==peg$FAILED){peg$parsews();s3=peg$parsenumber();if(s3!==peg$FAILED){peg$savedPos=s0;s0=peg$f31(s3);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsesetbpm(){var s0,s1,s3;s0=peg$currPos;if(input.substr(peg$currPos,6)===peg$c36){s1=peg$c36;peg$currPos+=6;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e44);}}if(s1!==peg$FAILED){peg$parsews();s3=peg$parsenumber();if(s3!==peg$FAILED){peg$savedPos=s0;s0=peg$f32(s3);}else{peg$currPos=s0;s0=peg$FAILED;}}else{peg$currPos=s0;s0=peg$FAILED;}return s0;}function peg$parsehush(){var s0,s1;s0=peg$currPos;if(input.substr(peg$currPos,4)===peg$c37){s1=peg$c37;peg$currPos+=4;}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$e45);}}if(s1!==peg$FAILED){peg$savedPos=s0;s1=peg$f33();}s0=s1;return s0;}function peg$parsestatement(){var s0;s0=peg$parsesequence_definition();if(s0===peg$FAILED){s0=peg$parsecommand();}return s0;}var PatternStub=function(source,alignment){this.type_="pattern";this.arguments_={alignment};this.source_=source;};var OperatorStub=function(name,args,source){this.type_=name;this.arguments_=args;this.source_=source;};var ElementStub=function(source,options2){this.type_="element";this.source_=source;this.options_=options2;this.location_=location();};var CommandStub=function(name,options2){this.type_="command";this.name_=name;this.options_=options2;};peg$result=peg$startRuleFunction();if(peg$result!==peg$FAILED&&peg$currPos===input.length){return peg$result;}else{if(peg$result!==peg$FAILED&&peg$currPos key in obj ? __defProp(obj, key, { + enumerable: true, + configurable: true, + writable: true, + value +}) : obj[key] = value; + +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + + return value; +}; + +Object.defineProperties(exports, _defineProperty({ + __esModule: { + value: true + } +}, Symbol.toStringTag, { + value: "Module" +})); + +function getDefaultExportFromCjs(x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x; +} + +function peg$subclass(child, parent) { + function C() { + this.constructor = child; + } + + C.prototype = parent.prototype; + child.prototype = new C(); +} + +function peg$SyntaxError(message, expected, found, location) { + var self = Error.call(this, message); + + if (Object.setPrototypeOf) { + Object.setPrototypeOf(self, peg$SyntaxError.prototype); + } + + self.expected = expected; + self.found = found; + self.location = location; + self.name = "SyntaxError"; + return self; +} + +peg$subclass(peg$SyntaxError, Error); + +function peg$padEnd(str, targetLength, padString) { + padString = padString || " "; + + if (str.length > targetLength) { + return str; + } + + targetLength -= str.length; + padString += padString.repeat(targetLength); + return str + padString.slice(0, targetLength); +} + +peg$SyntaxError.prototype.format = function (sources) { + var str = "Error: " + this.message; + + if (this.location) { + var src = null; + var k; + + for (k = 0; k < sources.length; k++) { + if (sources[k].source === this.location.source) { + src = sources[k].text.split(/\r\n|\n|\r/g); + break; + } + } + + var s = this.location.start; + var loc = this.location.source + ":" + s.line + ":" + s.column; + + if (src) { + var e = this.location.end; + var filler = peg$padEnd("", s.line.toString().length, " "); + var line = src[s.line - 1]; + var last = s.line === e.line ? e.column : line.length + 1; + var hatLen = last - s.column || 1; + str += "\n --> " + loc + "\n" + filler + " |\n" + s.line + " | " + line + "\n" + filler + " | " + peg$padEnd("", s.column - 1, " ") + peg$padEnd("", hatLen, "^"); + } else { + str += "\n at " + loc; + } + } + + return str; +}; + +peg$SyntaxError.buildMessage = function (expected, found) { + var DESCRIBE_EXPECTATION_FNS = { + literal: function (expectation) { + return '"' + literalEscape(expectation.text) + '"'; + }, + class: function (expectation) { + var escapedParts = expectation.parts.map(function (part) { + return Array.isArray(part) ? classEscape(part[0]) + "-" + classEscape(part[1]) : classEscape(part); + }); + return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]"; + }, + any: function () { + return "any character"; + }, + end: function () { + return "end of input"; + }, + other: function (expectation) { + return expectation.description; + } + }; + + function hex(ch) { + return ch.charCodeAt(0).toString(16).toUpperCase(); + } + + function literalEscape(s) { + return s.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function (ch) { + return "\\x0" + hex(ch); + }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { + return "\\x" + hex(ch); + }); + } + + function classEscape(s) { + return s.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function (ch) { + return "\\x0" + hex(ch); + }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { + return "\\x" + hex(ch); + }); + } + + function describeExpectation(expectation) { + return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation); + } + + function describeExpected(expected2) { + var descriptions = expected2.map(describeExpectation); + var i, j; + descriptions.sort(); + + if (descriptions.length > 0) { + for (i = 1, j = 1; i < descriptions.length; i++) { + if (descriptions[i - 1] !== descriptions[i]) { + descriptions[j] = descriptions[i]; + j++; + } + } + + descriptions.length = j; + } + + switch (descriptions.length) { + case 1: + return descriptions[0]; + + case 2: + return descriptions[0] + " or " + descriptions[1]; + + default: + return descriptions.slice(0, -1).join(", ") + ", or " + descriptions[descriptions.length - 1]; + } + } + + function describeFound(found2) { + return found2 ? '"' + literalEscape(found2) + '"' : "end of input"; + } + + return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found."; +}; + +function peg$parse(input, options) { + options = options !== void 0 ? options : {}; + var peg$FAILED = {}; + var peg$source = options.grammarSource; + var peg$startRuleFunctions = { + start: peg$parsestart + }; + var peg$startRuleFunction = peg$parsestart; + var peg$c0 = "."; + var peg$c1 = "-"; + var peg$c2 = "+"; + var peg$c3 = "0"; + var peg$c4 = ","; + var peg$c5 = "|"; + var peg$c6 = '"'; + var peg$c7 = "'"; + var peg$c8 = "#"; + var peg$c9 = "^"; + var peg$c10 = "_"; + var peg$c11 = ":"; + var peg$c12 = "["; + var peg$c13 = "]"; + var peg$c14 = "<"; + var peg$c15 = ">"; + var peg$c16 = "@"; + var peg$c17 = "!"; + var peg$c18 = "("; + var peg$c19 = ")"; + var peg$c20 = "/"; + var peg$c21 = "*"; + var peg$c22 = "%"; + var peg$c23 = "?"; + var peg$c24 = "<~"; + var peg$c25 = "~>"; + var peg$c26 = "struct"; + var peg$c27 = "target"; + var peg$c28 = "euclid"; + var peg$c29 = "slow"; + var peg$c30 = "rotL"; + var peg$c31 = "rotR"; + var peg$c32 = "fast"; + var peg$c33 = "scale"; + var peg$c34 = "//"; + var peg$c35 = "cat"; + var peg$c36 = "$"; + var peg$c37 = "setcps"; + var peg$c38 = "setbpm"; + var peg$c39 = "hush"; + var peg$r0 = /^[1-9]/; + var peg$r1 = /^[eE]/; + var peg$r2 = /^[0-9]/; + var peg$r3 = /^[ \n\r\t]/; + var peg$r4 = /^[0-9a-zA-Z~]/; + var peg$r5 = /^[^\n]/; + var peg$e0 = peg$otherExpectation("number"); + var peg$e1 = peg$literalExpectation(".", false); + var peg$e2 = peg$classExpectation([["1", "9"]], false, false); + var peg$e3 = peg$classExpectation(["e", "E"], false, false); + var peg$e4 = peg$literalExpectation("-", false); + var peg$e5 = peg$literalExpectation("+", false); + var peg$e6 = peg$literalExpectation("0", false); + var peg$e7 = peg$classExpectation([["0", "9"]], false, false); + var peg$e8 = peg$otherExpectation("whitespace"); + var peg$e9 = peg$classExpectation([" ", "\n", "\r", " "], false, false); + var peg$e10 = peg$literalExpectation(",", false); + var peg$e11 = peg$literalExpectation("|", false); + var peg$e12 = peg$literalExpectation('"', false); + var peg$e13 = peg$literalExpectation("'", false); + var peg$e14 = peg$classExpectation([["0", "9"], ["a", "z"], ["A", "Z"], "~"], false, false); + var peg$e15 = peg$literalExpectation("#", false); + var peg$e16 = peg$literalExpectation("^", false); + var peg$e17 = peg$literalExpectation("_", false); + var peg$e18 = peg$literalExpectation(":", false); + var peg$e19 = peg$literalExpectation("[", false); + var peg$e20 = peg$literalExpectation("]", false); + var peg$e21 = peg$literalExpectation("<", false); + var peg$e22 = peg$literalExpectation(">", false); + var peg$e23 = peg$literalExpectation("@", false); + var peg$e24 = peg$literalExpectation("!", false); + var peg$e25 = peg$literalExpectation("(", false); + var peg$e26 = peg$literalExpectation(")", false); + var peg$e27 = peg$literalExpectation("/", false); + var peg$e28 = peg$literalExpectation("*", false); + var peg$e29 = peg$literalExpectation("%", false); + var peg$e30 = peg$literalExpectation("?", false); + var peg$e31 = peg$literalExpectation("<~", false); + var peg$e32 = peg$literalExpectation("~>", false); + var peg$e33 = peg$literalExpectation("struct", false); + var peg$e34 = peg$literalExpectation("target", false); + var peg$e35 = peg$literalExpectation("euclid", false); + var peg$e36 = peg$literalExpectation("slow", false); + var peg$e37 = peg$literalExpectation("rotL", false); + var peg$e38 = peg$literalExpectation("rotR", false); + var peg$e39 = peg$literalExpectation("fast", false); + var peg$e40 = peg$literalExpectation("scale", false); + var peg$e41 = peg$literalExpectation("//", false); + var peg$e42 = peg$classExpectation(["\n"], true, false); + var peg$e43 = peg$literalExpectation("cat", false); + var peg$e44 = peg$literalExpectation("$", false); + var peg$e45 = peg$literalExpectation("setcps", false); + var peg$e46 = peg$literalExpectation("setbpm", false); + var peg$e47 = peg$literalExpectation("hush", false); + + var peg$f0 = function () { + return parseFloat(text()); + }; + + var peg$f1 = function (chars) { + return chars.join(""); + }; + + var peg$f2 = function (s) { + return s; + }; + + var peg$f3 = function (sc) { + sc.arguments_.alignment = "t"; + return sc; + }; + + var peg$f4 = function (a) { + return { + weight: a + }; + }; + + var peg$f5 = function (a) { + return { + replicate: a + }; + }; + + var peg$f6 = function (p, s, r) { + return { + operator: { + type_: "bjorklund", + arguments_: { + pulse: p, + step: s, + rotation: r || 0 + } + } + }; + }; + + var peg$f7 = function (a) { + return { + operator: { + type_: "stretch", + arguments_: { + amount: a + } + } + }; + }; + + var peg$f8 = function (a) { + return { + operator: { + type_: "stretch", + arguments_: { + amount: "1/" + a + } + } + }; + }; + + var peg$f9 = function (a) { + return { + operator: { + type_: "fixed-step", + arguments_: { + amount: a + } + } + }; + }; + + var peg$f10 = function (a) { + return { + operator: { + type_: "degradeBy", + arguments_: { + amount: a ? a : 0.5 + } + } + }; + }; + + var peg$f11 = function (a) { + return { + operator: { + type_: "early", + arguments_: { + amount: a + } + } + }; + }; + + var peg$f12 = function (a) { + return { + operator: { + type_: "late", + arguments_: { + amount: a + } + } + }; + }; + + var peg$f13 = function (s, o) { + return new ElementStub(s, o); + }; + + var peg$f14 = function (s) { + return new PatternStub(s, "h"); + }; + + var peg$f15 = function (tail) { + return { + alignment: "v", + list: tail + }; + }; + + var peg$f16 = function (tail) { + return { + alignment: "r", + list: tail + }; + }; + + var peg$f17 = function (head, tail) { + if (tail && tail.list.length > 0) { + return new PatternStub([head, ...tail.list], tail.alignment); + } else { + return head; + } + }; + + var peg$f18 = function (sc) { + return sc; + }; + + var peg$f19 = function (s) { + return { + name: "struct", + args: { + sequence: s + } + }; + }; + + var peg$f20 = function (s) { + return { + name: "target", + args: { + name: s + } + }; + }; + + var peg$f21 = function (p, s, r) { + return { + name: "bjorklund", + args: { + pulse: parseInt(p), + step: parseInt(s) + } + }; + }; + + var peg$f22 = function (a) { + return { + name: "stretch", + args: { + amount: a + } + }; + }; + + var peg$f23 = function (a) { + return { + name: "shift", + args: { + amount: "-" + a + } + }; + }; + + var peg$f24 = function (a) { + return { + name: "shift", + args: { + amount: a + } + }; + }; + + var peg$f25 = function (a) { + return { + name: "stretch", + args: { + amount: "1/" + a + } + }; + }; + + var peg$f26 = function (s) { + return { + name: "scale", + args: { + scale: s.join("") + } + }; + }; + + var peg$f27 = function (s, v) { + return v; + }; + + var peg$f28 = function (s, ss) { + ss.unshift(s); + return new PatternStub(ss, "t"); + }; + + var peg$f29 = function (sg) { + return sg; + }; + + var peg$f30 = function (o, soc) { + return new OperatorStub(o.name, o.args, soc); + }; + + var peg$f31 = function (sc) { + return sc; + }; + + var peg$f32 = function (c) { + return c; + }; + + var peg$f33 = function (v) { + return new CommandStub("setcps", { + value: v + }); + }; + + var peg$f34 = function (v) { + return new CommandStub("setcps", { + value: v / 120 / 2 + }); + }; + + var peg$f35 = function () { + return new CommandStub("hush"); + }; + + var peg$currPos = 0; + var peg$savedPos = 0; + var peg$posDetailsCache = [{ + line: 1, + column: 1 + }]; + var peg$maxFailPos = 0; + var peg$maxFailExpected = []; + var peg$silentFails = 0; + var peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error(`Can't start parsing from rule "` + options.startRule + '".'); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$savedPos, peg$currPos); + } + + function location() { + return peg$computeLocation(peg$savedPos, peg$currPos); + } + + function peg$literalExpectation(text2, ignoreCase) { + return { + type: "literal", + text: text2, + ignoreCase + }; + } + + function peg$classExpectation(parts, inverted, ignoreCase) { + return { + type: "class", + parts, + inverted, + ignoreCase + }; + } + + function peg$endExpectation() { + return { + type: "end" + }; + } + + function peg$otherExpectation(description) { + return { + type: "other", + description + }; + } + + function peg$computePosDetails(pos) { + var details = peg$posDetailsCache[pos]; + var p; + + if (details) { + return details; + } else { + p = pos - 1; + + while (!peg$posDetailsCache[p]) { + p--; + } + + details = peg$posDetailsCache[p]; + details = { + line: details.line, + column: details.column + }; + + while (p < pos) { + if (input.charCodeAt(p) === 10) { + details.line++; + details.column = 1; + } else { + details.column++; + } + + p++; + } + + peg$posDetailsCache[pos] = details; + return details; + } + } + + function peg$computeLocation(startPos, endPos) { + var startPosDetails = peg$computePosDetails(startPos); + var endPosDetails = peg$computePosDetails(endPos); + return { + source: peg$source, + start: { + offset: startPos, + line: startPosDetails.line, + column: startPosDetails.column + }, + end: { + offset: endPos, + line: endPosDetails.line, + column: endPosDetails.column + } + }; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { + return; + } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$buildStructuredError(expected, found, location2) { + return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected, found), expected, found, location2); + } + + function peg$parsestart() { + var s0; + s0 = peg$parsestatement(); + return s0; + } + + function peg$parsenumber() { + var s0, s2; + peg$silentFails++; + s0 = peg$currPos; + peg$parseminus(); + s2 = peg$parseint(); + + if (s2 !== peg$FAILED) { + peg$parsefrac(); + peg$parseexp(); + peg$savedPos = s0; + s0 = peg$f0(); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + peg$silentFails--; + + if (s0 === peg$FAILED) { + if (peg$silentFails === 0) { + peg$fail(peg$e0); + } + } + + return s0; + } + + function peg$parsedecimal_point() { + var s0; + + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c0; + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e1); + } + } + + return s0; + } + + function peg$parsedigit1_9() { + var s0; + + if (peg$r0.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e2); + } + } + + return s0; + } + + function peg$parsee() { + var s0; + + if (peg$r1.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e3); + } + } + + return s0; + } + + function peg$parseexp() { + var s0, s1, s2, s3, s4; + s0 = peg$currPos; + s1 = peg$parsee(); + + if (s1 !== peg$FAILED) { + s2 = peg$parseminus(); + + if (s2 === peg$FAILED) { + s2 = peg$parseplus(); + } + + if (s2 === peg$FAILED) { + s2 = null; + } + + s3 = []; + s4 = peg$parseDIGIT(); + + if (s4 !== peg$FAILED) { + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseDIGIT(); + } + } else { + s3 = peg$FAILED; + } + + if (s3 !== peg$FAILED) { + s1 = [s1, s2, s3]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsefrac() { + var s0, s1, s2, s3; + s0 = peg$currPos; + s1 = peg$parsedecimal_point(); + + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseDIGIT(); + + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parseDIGIT(); + } + } else { + s2 = peg$FAILED; + } + + if (s2 !== peg$FAILED) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseint() { + var s0, s1, s2, s3; + s0 = peg$parsezero(); + + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parsedigit1_9(); + + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseDIGIT(); + + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parseDIGIT(); + } + + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } + + return s0; + } + + function peg$parseminus() { + var s0; + + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c1; + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e4); + } + } + + return s0; + } + + function peg$parseplus() { + var s0; + + if (input.charCodeAt(peg$currPos) === 43) { + s0 = peg$c2; + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e5); + } + } + + return s0; + } + + function peg$parsezero() { + var s0; + + if (input.charCodeAt(peg$currPos) === 48) { + s0 = peg$c3; + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e6); + } + } + + return s0; + } + + function peg$parseDIGIT() { + var s0; + + if (peg$r2.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e7); + } + } + + return s0; + } + + function peg$parsews() { + var s0, s1; + peg$silentFails++; + s0 = []; + + if (peg$r3.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e9); + } + } + + while (s1 !== peg$FAILED) { + s0.push(s1); + + if (peg$r3.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e9); + } + } + } + + peg$silentFails--; + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e8); + } + + return s0; + } + + function peg$parsecomma() { + var s0, s1, s2, s3; + s0 = peg$currPos; + s1 = peg$parsews(); + + if (input.charCodeAt(peg$currPos) === 44) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e10); + } + } + + if (s2 !== peg$FAILED) { + s3 = peg$parsews(); + s1 = [s1, s2, s3]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsepipe() { + var s0, s1, s2, s3; + s0 = peg$currPos; + s1 = peg$parsews(); + + if (input.charCodeAt(peg$currPos) === 124) { + s2 = peg$c5; + peg$currPos++; + } else { + s2 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e11); + } + } + + if (s2 !== peg$FAILED) { + s3 = peg$parsews(); + s1 = [s1, s2, s3]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsequote() { + var s0; + + if (input.charCodeAt(peg$currPos) === 34) { + s0 = peg$c6; + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e12); + } + } + + if (s0 === peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 39) { + s0 = peg$c7; + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e13); + } + } + } + + return s0; + } + + function peg$parsestep_char() { + var s0; + + if (peg$r4.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e14); + } + } + + if (s0 === peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c1; + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e4); + } + } + + if (s0 === peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 35) { + s0 = peg$c8; + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e15); + } + } + + if (s0 === peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c0; + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e1); + } + } + + if (s0 === peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 94) { + s0 = peg$c9; + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e16); + } + } + + if (s0 === peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c10; + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e17); + } + } + + if (s0 === peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 58) { + s0 = peg$c11; + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e18); + } + } + } + } + } + } + } + } + + return s0; + } + + function peg$parsestep() { + var s0, s2, s3; + s0 = peg$currPos; + peg$parsews(); + s2 = []; + s3 = peg$parsestep_char(); + + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parsestep_char(); + } + } else { + s2 = peg$FAILED; + } + + if (s2 !== peg$FAILED) { + s3 = peg$parsews(); + peg$savedPos = s0; + s0 = peg$f1(s2); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsesub_cycle() { + var s0, s2, s4, s6; + s0 = peg$currPos; + peg$parsews(); + + if (input.charCodeAt(peg$currPos) === 91) { + s2 = peg$c12; + peg$currPos++; + } else { + s2 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e19); + } + } + + if (s2 !== peg$FAILED) { + peg$parsews(); + s4 = peg$parsestack_or_choose(); + + if (s4 !== peg$FAILED) { + peg$parsews(); + + if (input.charCodeAt(peg$currPos) === 93) { + s6 = peg$c13; + peg$currPos++; + } else { + s6 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e20); + } + } + + if (s6 !== peg$FAILED) { + peg$parsews(); + peg$savedPos = s0; + s0 = peg$f2(s4); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsetimeline() { + var s0, s2, s4, s6; + s0 = peg$currPos; + peg$parsews(); + + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c14; + peg$currPos++; + } else { + s2 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e21); + } + } + + if (s2 !== peg$FAILED) { + peg$parsews(); + s4 = peg$parsesingle_cycle(); + + if (s4 !== peg$FAILED) { + peg$parsews(); + + if (input.charCodeAt(peg$currPos) === 62) { + s6 = peg$c15; + peg$currPos++; + } else { + s6 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e22); + } + } + + if (s6 !== peg$FAILED) { + peg$parsews(); + peg$savedPos = s0; + s0 = peg$f3(s4); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseslice() { + var s0; + s0 = peg$parsestep(); + + if (s0 === peg$FAILED) { + s0 = peg$parsesub_cycle(); + + if (s0 === peg$FAILED) { + s0 = peg$parsetimeline(); + } + } + + return s0; + } + + function peg$parseslice_modifier() { + var s0; + s0 = peg$parseslice_weight(); + + if (s0 === peg$FAILED) { + s0 = peg$parseslice_bjorklund(); + + if (s0 === peg$FAILED) { + s0 = peg$parseslice_slow(); + + if (s0 === peg$FAILED) { + s0 = peg$parseslice_fast(); + + if (s0 === peg$FAILED) { + s0 = peg$parseslice_fixed_step(); + + if (s0 === peg$FAILED) { + s0 = peg$parseslice_replicate(); + + if (s0 === peg$FAILED) { + s0 = peg$parseslice_degrade(); + + if (s0 === peg$FAILED) { + s0 = peg$parseslice_early(); + + if (s0 === peg$FAILED) { + s0 = peg$parseslice_late(); + } + } + } + } + } + } + } + } + + return s0; + } + + function peg$parseslice_weight() { + var s0, s1, s2; + s0 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 64) { + s1 = peg$c16; + peg$currPos++; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e23); + } + } + + if (s1 !== peg$FAILED) { + s2 = peg$parsenumber(); + + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f4(s2); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseslice_replicate() { + var s0, s1, s2; + s0 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 33) { + s1 = peg$c17; + peg$currPos++; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e24); + } + } + + if (s1 !== peg$FAILED) { + s2 = peg$parsenumber(); + + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f5(s2); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseslice_bjorklund() { + var s0, s1, s3, s5, s7, s11, s13; + s0 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 40) { + s1 = peg$c18; + peg$currPos++; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e25); + } + } + + if (s1 !== peg$FAILED) { + peg$parsews(); + s3 = peg$parsenumber(); + + if (s3 !== peg$FAILED) { + peg$parsews(); + s5 = peg$parsecomma(); + + if (s5 !== peg$FAILED) { + peg$parsews(); + s7 = peg$parsenumber(); + + if (s7 !== peg$FAILED) { + peg$parsews(); + peg$parsecomma(); + peg$parsews(); + s11 = peg$parsenumber(); + + if (s11 === peg$FAILED) { + s11 = null; + } + + peg$parsews(); + + if (input.charCodeAt(peg$currPos) === 41) { + s13 = peg$c19; + peg$currPos++; + } else { + s13 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e26); + } + } + + if (s13 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f6(s3, s7, s11); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseslice_slow() { + var s0, s1, s2; + s0 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e27); + } + } + + if (s1 !== peg$FAILED) { + s2 = peg$parsenumber(); + + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f7(s2); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseslice_fast() { + var s0, s1, s2; + s0 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 42) { + s1 = peg$c21; + peg$currPos++; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e28); + } + } + + if (s1 !== peg$FAILED) { + s2 = peg$parsenumber(); + + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f8(s2); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseslice_fixed_step() { + var s0, s1, s2; + s0 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c22; + peg$currPos++; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e29); + } + } + + if (s1 !== peg$FAILED) { + s2 = peg$parsenumber(); + + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f9(s2); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseslice_degrade() { + var s0, s1, s2; + s0 = peg$currPos; + + if (input.charCodeAt(peg$currPos) === 63) { + s1 = peg$c23; + peg$currPos++; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e30); + } + } + + if (s1 !== peg$FAILED) { + s2 = peg$parsenumber(); + + if (s2 === peg$FAILED) { + s2 = null; + } + + peg$savedPos = s0; + s0 = peg$f10(s2); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseslice_early() { + var s0, s1, s2; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 2) === peg$c24) { + s1 = peg$c24; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e31); + } + } + + if (s1 !== peg$FAILED) { + s2 = peg$parsenumber(); + + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f11(s2); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseslice_late() { + var s0, s1, s2; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 2) === peg$c25) { + s1 = peg$c25; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e32); + } + } + + if (s1 !== peg$FAILED) { + s2 = peg$parsenumber(); + + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f12(s2); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseslice_with_modifier() { + var s0, s1, s2; + s0 = peg$currPos; + s1 = peg$parseslice(); + + if (s1 !== peg$FAILED) { + s2 = peg$parseslice_modifier(); + + if (s2 === peg$FAILED) { + s2 = null; + } + + peg$savedPos = s0; + s0 = peg$f13(s1, s2); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsesingle_cycle() { + var s0, s1, s2; + s0 = peg$currPos; + s1 = []; + s2 = peg$parseslice_with_modifier(); + + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parseslice_with_modifier(); + } + } else { + s1 = peg$FAILED; + } + + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f14(s1); + } + + s0 = s1; + return s0; + } + + function peg$parsestack_tail() { + var s0, s1, s2, s3, s4; + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parsecomma(); + + if (s3 !== peg$FAILED) { + s4 = peg$parsesingle_cycle(); + + if (s4 !== peg$FAILED) { + s2 = s4; + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parsecomma(); + + if (s3 !== peg$FAILED) { + s4 = peg$parsesingle_cycle(); + + if (s4 !== peg$FAILED) { + s2 = s4; + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + } + } else { + s1 = peg$FAILED; + } + + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f15(s1); + } + + s0 = s1; + return s0; + } + + function peg$parsechoose_tail() { + var s0, s1, s2, s3, s4; + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parsepipe(); + + if (s3 !== peg$FAILED) { + s4 = peg$parsesingle_cycle(); + + if (s4 !== peg$FAILED) { + s2 = s4; + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parsepipe(); + + if (s3 !== peg$FAILED) { + s4 = peg$parsesingle_cycle(); + + if (s4 !== peg$FAILED) { + s2 = s4; + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + } + } else { + s1 = peg$FAILED; + } + + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f16(s1); + } + + s0 = s1; + return s0; + } + + function peg$parsestack_or_choose() { + var s0, s1, s2; + s0 = peg$currPos; + s1 = peg$parsesingle_cycle(); + + if (s1 !== peg$FAILED) { + s2 = peg$parsestack_tail(); + + if (s2 === peg$FAILED) { + s2 = peg$parsechoose_tail(); + } + + if (s2 === peg$FAILED) { + s2 = null; + } + + peg$savedPos = s0; + s0 = peg$f17(s1, s2); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsesequence() { + var s0, s2, s3, s4; + s0 = peg$currPos; + peg$parsews(); + s2 = peg$parsequote(); + + if (s2 !== peg$FAILED) { + s3 = peg$parsestack_or_choose(); + + if (s3 !== peg$FAILED) { + s4 = peg$parsequote(); + + if (s4 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f18(s3); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseoperator() { + var s0; + s0 = peg$parsescale(); + + if (s0 === peg$FAILED) { + s0 = peg$parseslow(); + + if (s0 === peg$FAILED) { + s0 = peg$parsefast(); + + if (s0 === peg$FAILED) { + s0 = peg$parsetarget(); + + if (s0 === peg$FAILED) { + s0 = peg$parsebjorklund(); + + if (s0 === peg$FAILED) { + s0 = peg$parsestruct(); + + if (s0 === peg$FAILED) { + s0 = peg$parserotR(); + + if (s0 === peg$FAILED) { + s0 = peg$parserotL(); + } + } + } + } + } + } + } + + return s0; + } + + function peg$parsestruct() { + var s0, s1, s3; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 6) === peg$c26) { + s1 = peg$c26; + peg$currPos += 6; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e33); + } + } + + if (s1 !== peg$FAILED) { + peg$parsews(); + s3 = peg$parsesequence_or_operator(); + + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f19(s3); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsetarget() { + var s0, s1, s3, s4, s5; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 6) === peg$c27) { + s1 = peg$c27; + peg$currPos += 6; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e34); + } + } + + if (s1 !== peg$FAILED) { + peg$parsews(); + s3 = peg$parsequote(); + + if (s3 !== peg$FAILED) { + s4 = peg$parsestep(); + + if (s4 !== peg$FAILED) { + s5 = peg$parsequote(); + + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f20(s4); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsebjorklund() { + var s0, s1, s3, s5; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 6) === peg$c28) { + s1 = peg$c28; + peg$currPos += 6; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e35); + } + } + + if (s1 !== peg$FAILED) { + peg$parsews(); + s3 = peg$parseint(); + + if (s3 !== peg$FAILED) { + peg$parsews(); + s5 = peg$parseint(); + + if (s5 !== peg$FAILED) { + peg$parsews(); + peg$parseint(); + peg$savedPos = s0; + s0 = peg$f21(s3, s5); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseslow() { + var s0, s1, s3; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 4) === peg$c29) { + s1 = peg$c29; + peg$currPos += 4; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e36); + } + } + + if (s1 !== peg$FAILED) { + peg$parsews(); + s3 = peg$parsenumber(); + + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f22(s3); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parserotL() { + var s0, s1, s3; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 4) === peg$c30) { + s1 = peg$c30; + peg$currPos += 4; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e37); + } + } + + if (s1 !== peg$FAILED) { + peg$parsews(); + s3 = peg$parsenumber(); + + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f23(s3); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parserotR() { + var s0, s1, s3; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 4) === peg$c31) { + s1 = peg$c31; + peg$currPos += 4; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e38); + } + } + + if (s1 !== peg$FAILED) { + peg$parsews(); + s3 = peg$parsenumber(); + + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f24(s3); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsefast() { + var s0, s1, s3; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 4) === peg$c32) { + s1 = peg$c32; + peg$currPos += 4; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e39); + } + } + + if (s1 !== peg$FAILED) { + peg$parsews(); + s3 = peg$parsenumber(); + + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f25(s3); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsescale() { + var s0, s1, s3, s4, s5; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 5) === peg$c33) { + s1 = peg$c33; + peg$currPos += 5; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e40); + } + } + + if (s1 !== peg$FAILED) { + peg$parsews(); + s3 = peg$parsequote(); + + if (s3 !== peg$FAILED) { + s4 = []; + s5 = peg$parsestep_char(); + + if (s5 !== peg$FAILED) { + while (s5 !== peg$FAILED) { + s4.push(s5); + s5 = peg$parsestep_char(); + } + } else { + s4 = peg$FAILED; + } + + if (s4 !== peg$FAILED) { + s5 = peg$parsequote(); + + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f26(s4); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2, s3; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 2) === peg$c34) { + s1 = peg$c34; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e41); + } + } + + if (s1 !== peg$FAILED) { + s2 = []; + + if (peg$r5.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e42); + } + } + + while (s3 !== peg$FAILED) { + s2.push(s3); + + if (peg$r5.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e42); + } + } + } + + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsecat() { + var s0, s1, s3, s5, s6, s7, s8, s9; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 3) === peg$c35) { + s1 = peg$c35; + peg$currPos += 3; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e43); + } + } + + if (s1 !== peg$FAILED) { + peg$parsews(); + + if (input.charCodeAt(peg$currPos) === 91) { + s3 = peg$c12; + peg$currPos++; + } else { + s3 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e19); + } + } + + if (s3 !== peg$FAILED) { + peg$parsews(); + s5 = peg$parsesequence_or_operator(); + + if (s5 !== peg$FAILED) { + s6 = []; + s7 = peg$currPos; + s8 = peg$parsecomma(); + + if (s8 !== peg$FAILED) { + s9 = peg$parsesequence_or_operator(); + + if (s9 !== peg$FAILED) { + peg$savedPos = s7; + s7 = peg$f27(s5, s9); + } else { + peg$currPos = s7; + s7 = peg$FAILED; + } + } else { + peg$currPos = s7; + s7 = peg$FAILED; + } + + while (s7 !== peg$FAILED) { + s6.push(s7); + s7 = peg$currPos; + s8 = peg$parsecomma(); + + if (s8 !== peg$FAILED) { + s9 = peg$parsesequence_or_operator(); + + if (s9 !== peg$FAILED) { + peg$savedPos = s7; + s7 = peg$f27(s5, s9); + } else { + peg$currPos = s7; + s7 = peg$FAILED; + } + } else { + peg$currPos = s7; + s7 = peg$FAILED; + } + } + + s7 = peg$parsews(); + + if (input.charCodeAt(peg$currPos) === 93) { + s8 = peg$c13; + peg$currPos++; + } else { + s8 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e20); + } + } + + if (s8 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f28(s5, s6); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsesequence_or_group() { + var s0; + s0 = peg$parsecat(); + + if (s0 === peg$FAILED) { + s0 = peg$parsesequence(); + } + + return s0; + } + + function peg$parsesequence_or_operator() { + var s0, s1, s3, s4, s5; + s0 = peg$currPos; + s1 = peg$parsesequence_or_group(); + + if (s1 !== peg$FAILED) { + peg$parsews(); + s3 = []; + s4 = peg$parsecomment(); + + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parsecomment(); + } + + peg$savedPos = s0; + s0 = peg$f29(s1); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parseoperator(); + + if (s1 !== peg$FAILED) { + peg$parsews(); + + if (input.charCodeAt(peg$currPos) === 36) { + s3 = peg$c36; + peg$currPos++; + } else { + s3 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e44); + } + } + + if (s3 !== peg$FAILED) { + s4 = peg$parsews(); + s5 = peg$parsesequence_or_operator(); + + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f30(s1, s5); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } + + return s0; + } + + function peg$parsesequ_or_operator_or_comment() { + var s0, s1; + s0 = peg$currPos; + s1 = peg$parsesequence_or_operator(); + + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f31(s1); + } + + s0 = s1; + + if (s0 === peg$FAILED) { + s0 = peg$parsecomment(); + } + + return s0; + } + + function peg$parsesequence_definition() { + var s0; + s0 = peg$parsesequ_or_operator_or_comment(); + return s0; + } + + function peg$parsecommand() { + var s0, s2; + s0 = peg$currPos; + peg$parsews(); + s2 = peg$parsesetcps(); + + if (s2 === peg$FAILED) { + s2 = peg$parsesetbpm(); + + if (s2 === peg$FAILED) { + s2 = peg$parsehush(); + } + } + + if (s2 !== peg$FAILED) { + peg$parsews(); + peg$savedPos = s0; + s0 = peg$f32(s2); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsesetcps() { + var s0, s1, s3; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 6) === peg$c37) { + s1 = peg$c37; + peg$currPos += 6; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e45); + } + } + + if (s1 !== peg$FAILED) { + peg$parsews(); + s3 = peg$parsenumber(); + + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f33(s3); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsesetbpm() { + var s0, s1, s3; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 6) === peg$c38) { + s1 = peg$c38; + peg$currPos += 6; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e46); + } + } + + if (s1 !== peg$FAILED) { + peg$parsews(); + s3 = peg$parsenumber(); + + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f34(s3); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsehush() { + var s0, s1; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 4) === peg$c39) { + s1 = peg$c39; + peg$currPos += 4; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$e47); + } + } + + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f35(); + } + + s0 = s1; + return s0; + } + + function peg$parsestatement() { + var s0; + s0 = peg$parsesequence_definition(); + + if (s0 === peg$FAILED) { + s0 = peg$parsecommand(); + } + + return s0; + } + + var PatternStub = function (source, alignment) { + this.type_ = "pattern"; + this.arguments_ = { + alignment + }; + this.source_ = source; + }; + + var OperatorStub = function (name, args, source) { + this.type_ = name; + this.arguments_ = args; + this.source_ = source; + }; + + var ElementStub = function (source, options2) { + this.type_ = "element"; + this.source_ = source; + this.options_ = options2; + this.location_ = location(); + }; + + var CommandStub = function (name, options2) { + this.type_ = "command"; + this.name_ = name; + this.options_ = options2; + }; + + peg$result = peg$startRuleFunction(); + + if (peg$result !== peg$FAILED && peg$currPos === input.length) { + return peg$result; + } else { + if (peg$result !== peg$FAILED && peg$currPos < input.length) { + peg$fail(peg$endExpectation()); + } + + throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)); + } +} + +var krillParser = { + SyntaxError: peg$SyntaxError, + parse: peg$parse +}; +var fraction$1 = { + exports: {} +}; +/** * @license Fraction.js v4.2.0 05/03/2022 * https://www.xarg.org/2014/03/rational-numbers-in-javascript/ * * Copyright (c) 2021, Robert Eisele (robert@xarg.org) * Dual licensed under the MIT or GPL Version 2 licenses. - **/(function(module2,exports2){(function(root){var MAX_CYCLE_LEN=2e3;var P={"s":1,"n":0,"d":1};function assign(n,s){if(isNaN(n=parseInt(n,10))){throw Fraction2["InvalidParameter"];}return n*s;}function newFraction(n,d){if(d===0){throw Fraction2["DivisionByZero"];}var f=Object.create(Fraction2.prototype);f["s"]=n<0?-1:1;n=n<0?-n:n;var a=gcd2(n,d);f["n"]=n/a;f["d"]=d/a;return f;}function factorize(num){var factors={};var n=num;var i2=2;var s=4;while(s<=n){while(n%i2===0){n/=i2;factors[i2]=(factors[i2]||0)+1;}s+=1+2*i2++;}if(n!==num){if(n>1)factors[n]=(factors[n]||0)+1;}else{factors[num]=(factors[num]||0)+1;}return factors;}var parse=function(p1,p2){var n=0,d=1,s=1;var v=0,w=0,x=0,y=1,z=1;var A=0,B=1;var C=1,D=1;var N=1e7;var M;if(p1===void 0||p1===null);else if(p2!==void 0){n=p1;d=p2;s=n*d;if(n%1!==0||d%1!==0){throw Fraction2["NonIntegerParameter"];}}else switch(typeof p1){case"object":{if("d"in p1&&"n"in p1){n=p1["n"];d=p1["d"];if("s"in p1)n*=p1["s"];}else if(0 in p1){n=p1[0];if(1 in p1)d=p1[1];}else{throw Fraction2["InvalidParameter"];}s=n*d;break;}case"number":{if(p1<0){s=p1;p1=-p1;}if(p1%1===0){n=p1;}else if(p1>0){if(p1>=1){z=Math.pow(10,Math.floor(1+Math.log(p1)/Math.LN10));p1/=z;}while(B<=N&&D<=N){M=(A+C)/(B+D);if(p1===M){if(B+D<=N){n=A+C;d=B+D;}else if(D>B){n=C;d=D;}else{n=A;d=B;}break;}else{if(p1>M){A+=C;B+=D;}else{C+=A;D+=B;}if(B>N){n=C;d=D;}else{n=A;d=B;}}}n*=z;}else if(isNaN(p1)||isNaN(p2)){d=n=NaN;}break;}case"string":{B=p1.match(/\d+|./g);if(B===null)throw Fraction2["InvalidParameter"];if(B[A]==="-"){s=-1;A++;}else if(B[A]==="+"){A++;}if(B.length===A+1){w=assign(B[A++],s);}else if(B[A+1]==="."||B[A]==="."){if(B[A]!=="."){v=assign(B[A++],s);}A++;if(A+1===B.length||B[A+1]==="("&&B[A+3]===")"||B[A+1]==="'"&&B[A+3]==="'"){w=assign(B[A],s);y=Math.pow(10,B[A].length);A++;}if(B[A]==="("&&B[A+2]===")"||B[A]==="'"&&B[A+2]==="'"){x=assign(B[A+1],s);z=Math.pow(10,B[A+1].length)-1;A+=3;}}else if(B[A+1]==="/"||B[A+1]===":"){w=assign(B[A],s);y=assign(B[A+2],1);A+=3;}else if(B[A+3]==="/"&&B[A+1]===" "){v=assign(B[A],s);w=assign(B[A+2],s);y=assign(B[A+4],1);A+=5;}if(B.length<=A){d=y*z;s=n=x+d*v+z*w;break;}}default:throw Fraction2["InvalidParameter"];}if(d===0){throw Fraction2["DivisionByZero"];}P["s"]=s<0?-1:1;P["n"]=Math.abs(n);P["d"]=Math.abs(d);};function modpow(b,e,m){var r=1;for(;e>0;b=b*b%m,e>>=1){if(e&1){r=r*b%m;}}return r;}function cycleLen(n,d){for(;d%2===0;d/=2){}for(;d%5===0;d/=5){}if(d===1)return 0;var rem=10%d;var t2=1;for(;rem!==1;t2++){rem=rem*10%d;if(t2>MAX_CYCLE_LEN)return 0;}return t2;}function cycleStart(n,d,len){var rem1=1;var rem2=modpow(10,len,d);for(var t2=0;t2<300;t2++){if(rem1===rem2)return t2;rem1=rem1*10%d;rem2=rem2*10%d;}return 0;}function gcd2(a,b){if(!a)return b;if(!b)return a;while(1){a%=b;if(!a)return b;b%=a;if(!b)return a;}}function Fraction2(a,b){parse(a,b);if(this instanceof Fraction2){a=gcd2(P["d"],P["n"]);this["s"]=P["s"];this["n"]=P["n"]/a;this["d"]=P["d"]/a;}else{return newFraction(P["s"]*P["n"],P["d"]);}}Fraction2["DivisionByZero"]=new Error("Division by Zero");Fraction2["InvalidParameter"]=new Error("Invalid argument");Fraction2["NonIntegerParameter"]=new Error("Parameters must be integer");Fraction2.prototype={"s":1,"n":0,"d":1,"abs":function(){return newFraction(this["n"],this["d"]);},"neg":function(){return newFraction(-this["s"]*this["n"],this["d"]);},"add":function(a,b){parse(a,b);return newFraction(this["s"]*this["n"]*P["d"]+P["s"]*this["d"]*P["n"],this["d"]*P["d"]);},"sub":function(a,b){parse(a,b);return newFraction(this["s"]*this["n"]*P["d"]-P["s"]*this["d"]*P["n"],this["d"]*P["d"]);},"mul":function(a,b){parse(a,b);return newFraction(this["s"]*P["s"]*this["n"]*P["n"],this["d"]*P["d"]);},"div":function(a,b){parse(a,b);return newFraction(this["s"]*P["s"]*this["n"]*P["d"],this["d"]*P["n"]);},"clone":function(){return newFraction(this["s"]*this["n"],this["d"]);},"mod":function(a,b){if(isNaN(this["n"])||isNaN(this["d"])){return new Fraction2(NaN);}if(a===void 0){return newFraction(this["s"]*this["n"]%this["d"],1);}parse(a,b);if(0===P["n"]&&0===this["d"]){throw Fraction2["DivisionByZero"];}return newFraction(this["s"]*(P["d"]*this["n"])%(P["n"]*this["d"]),P["d"]*this["d"]);},"gcd":function(a,b){parse(a,b);return newFraction(gcd2(P["n"],this["n"])*gcd2(P["d"],this["d"]),P["d"]*this["d"]);},"lcm":function(a,b){parse(a,b);if(P["n"]===0&&this["n"]===0){return newFraction(0,1);}return newFraction(P["n"]*this["n"],gcd2(P["n"],this["n"])*gcd2(P["d"],this["d"]));},"ceil":function(places){places=Math.pow(10,places||0);if(isNaN(this["n"])||isNaN(this["d"])){return new Fraction2(NaN);}return newFraction(Math.ceil(places*this["s"]*this["n"]/this["d"]),places);},"floor":function(places){places=Math.pow(10,places||0);if(isNaN(this["n"])||isNaN(this["d"])){return new Fraction2(NaN);}return newFraction(Math.floor(places*this["s"]*this["n"]/this["d"]),places);},"round":function(places){places=Math.pow(10,places||0);if(isNaN(this["n"])||isNaN(this["d"])){return new Fraction2(NaN);}return newFraction(Math.round(places*this["s"]*this["n"]/this["d"]),places);},"inverse":function(){return newFraction(this["s"]*this["d"],this["n"]);},"pow":function(a,b){parse(a,b);if(P["d"]===1){if(P["s"]<0){return newFraction(Math.pow(this["s"]*this["d"],P["n"]),Math.pow(this["n"],P["n"]));}else{return newFraction(Math.pow(this["s"]*this["n"],P["n"]),Math.pow(this["d"],P["n"]));}}if(this["s"]<0)return null;var N=factorize(this["n"]);var D=factorize(this["d"]);var n=1;var d=1;for(var k in N){if(k==="1")continue;if(k==="0"){n=0;break;}N[k]*=P["n"];if(N[k]%P["d"]===0){N[k]/=P["d"];}else return null;n*=Math.pow(k,N[k]);}for(var k in D){if(k==="1")continue;D[k]*=P["n"];if(D[k]%P["d"]===0){D[k]/=P["d"];}else return null;d*=Math.pow(k,D[k]);}if(P["s"]<0){return newFraction(d,n);}return newFraction(n,d);},"equals":function(a,b){parse(a,b);return this["s"]*this["n"]*P["d"]===P["s"]*P["n"]*this["d"];},"compare":function(a,b){parse(a,b);var t2=this["s"]*this["n"]*P["d"]-P["s"]*P["n"]*this["d"];return(0=0;k--){s=s["inverse"]()["add"](cont[k]);}if(s["sub"](thisABS)["abs"]().valueOf()0){str+=whole;str+=" ";n%=d;}str+=n;str+="/";str+=d;}return str;},"toLatex":function(excludeWhole){var whole,str="";var n=this["n"];var d=this["d"];if(this["s"]<0){str+="-";}if(d===1){str+=n;}else{if(excludeWhole&&(whole=Math.floor(n/d))>0){str+=whole;n%=d;}str+="\\frac{";str+=n;str+="}{";str+=d;str+="}";}return str;},"toContinued":function(){var t2;var a=this["n"];var b=this["d"];var res=[];if(isNaN(a)||isNaN(b)){return res;}do{res.push(Math.floor(a/b));t2=a%b;a=b;b=t2;}while(a!==1);return res;},"toString":function(dec){var N=this["n"];var D=this["d"];if(isNaN(N)||isNaN(D)){return"NaN";}dec=dec||15;var cycLen=cycleLen(N,D);var cycOff=cycleStart(N,D,cycLen);var str=this["s"]<0?"-":"";str+=N/D|0;N%=D;N*=10;if(N)str+=".";if(cycLen){for(var i2=cycOff;i2--;){str+=N/D|0;N%=D;N*=10;}str+="(";for(var i2=cycLen;i2--;){str+=N/D|0;N%=D;N*=10;}str+=")";}else{for(var i2=dec;N&&i2--;){str+=N/D|0;N%=D;N*=10;}}return str;}};{Object.defineProperty(Fraction2,"__esModule",{"value":true});Fraction2["default"]=Fraction2;Fraction2["Fraction"]=Fraction2;module2["exports"]=Fraction2;}})();})(fraction$1);var Fraction$1=/* @__PURE__ */getDefaultExportFromCjs(fraction$1.exports);Fraction$1.prototype.sam=function(){return this.floor();};Fraction$1.prototype.nextSam=function(){return this.sam().add(1);};Fraction$1.prototype.wholeCycle=function(){return new TimeSpan(this.sam(),this.nextSam());};Fraction$1.prototype.cyclePos=function(){return this.sub(this.sam());};Fraction$1.prototype.lt=function(other){return this.compare(other)<0;};Fraction$1.prototype.gt=function(other){return this.compare(other)>0;};Fraction$1.prototype.lte=function(other){return this.compare(other)<=0;};Fraction$1.prototype.gte=function(other){return this.compare(other)>=0;};Fraction$1.prototype.eq=function(other){return this.compare(other)==0;};Fraction$1.prototype.max=function(other){return this.gt(other)?this:other;};Fraction$1.prototype.min=function(other){return this.lt(other)?this:other;};Fraction$1.prototype.show=function(){return this.s*this.n+"/"+this.d;};Fraction$1.prototype.or=function(other){return this.eq(0)?other:this;};var fraction=n=>{if(typeof n==="number"){n=String(n);}return Fraction$1(n);};var gcd=(...fractions)=>{return fractions.reduce((gcd2,fraction2)=>gcd2.gcd(fraction2),fraction(1));};fraction._original=Fraction$1;var TimeSpan=/*#__PURE__*/function(){function TimeSpan(begin,end){_classCallCheck3(this,TimeSpan);this.begin=fraction(begin);this.end=fraction(end);}_createClass3(TimeSpan,[{key:"spanCycles",get:function(){const spans=[];var begin=this.begin;const end=this.end;const end_sam=end.sam();while(end.gt(begin)){if(begin.sam().equals(end_sam)){spans.push(new TimeSpan(begin,this.end));break;}const next_begin=begin.nextSam();spans.push(new TimeSpan(begin,next_begin));begin=next_begin;}return spans;}},{key:"duration",get:function(){return this.end.sub(this.begin);}},{key:"cycleArc",value:function cycleArc(){const b=this.begin.cyclePos();const e=b.add(this.duration);return new TimeSpan(b,e);}},{key:"withTime",value:function withTime(func_time){return new TimeSpan(func_time(this.begin),func_time(this.end));}},{key:"withEnd",value:function withEnd(func_time){return new TimeSpan(this.begin,func_time(this.end));}},{key:"withCycle",value:function withCycle(func_time){const sam=this.begin.sam();const b=sam.add(func_time(this.begin.sub(sam)));const e=sam.add(func_time(this.end.sub(sam)));return new TimeSpan(b,e);}},{key:"intersection",value:function intersection(other){const intersect_begin=this.begin.max(other.begin);const intersect_end=this.end.min(other.end);if(intersect_begin.gt(intersect_end)){return void 0;}if(intersect_begin.equals(intersect_end)){if(intersect_begin.equals(this.end)&&this.begin.lt(this.end)){return void 0;}if(intersect_begin.equals(other.end)&&other.begin.lt(other.end)){return void 0;}}return new TimeSpan(intersect_begin,intersect_end);}},{key:"intersection_e",value:function intersection_e(other){const result=this.intersection(other);if(result==void 0){throw"TimeSpans do not intersect";}return result;}},{key:"midpoint",value:function midpoint(){return this.begin.add(this.duration.div(fraction(2)));}},{key:"equals",value:function equals(other){return this.begin.equals(other.begin)&&this.end.equals(other.end);}},{key:"show",value:function show(){return this.begin.show()+" -> "+this.end.show();}}]);return TimeSpan;}();var Hap=/*#__PURE__*/function(){function Hap(whole,part,value,context={},stateful=false){_classCallCheck3(this,Hap);this.whole=whole;this.part=part;this.value=value;this.context=context;this.stateful=stateful;if(stateful){console.assert(typeof this.value==="function","Stateful values must be functions");}}_createClass3(Hap,[{key:"duration",get:function(){return this.whole.end.sub(this.whole.begin);}},{key:"wholeOrPart",value:function wholeOrPart(){return this.whole?this.whole:this.part;}},{key:"withSpan",value:function withSpan(func){const whole=this.whole?func(this.whole):void 0;return new Hap(whole,func(this.part),this.value,this.context);}},{key:"withValue",value:function withValue(func){return new Hap(this.whole,this.part,func(this.value),this.context);}},{key:"hasOnset",value:function hasOnset(){return this.whole!=void 0&&this.whole.begin.equals(this.part.begin);}},{key:"resolveState",value:function resolveState(state){if(this.stateful&&this.hasOnset()){console.log("stateful");const func=this.value;const[newState,newValue]=func(state);return[newState,new Hap(this.whole,this.part,newValue,this.context,false)];}return[state,this];}},{key:"spanEquals",value:function spanEquals(other){return this.whole==void 0&&other.whole==void 0||this.whole.equals(other.whole);}},{key:"equals",value:function equals(other){return this.spanEquals(other)&&this.part.equals(other.part)&&this.value===other.value;}},{key:"show",value:function show(){return"("+(this.whole==void 0?"~":this.whole.show())+", "+this.part.show()+", "+this.value+")";}},{key:"showWhole",value:function showWhole(){return`${this.whole==void 0?"~":this.whole.show()}: ${typeof this.value==="object"?JSON.stringify(this.value):this.value}`;}},{key:"combineContext",value:function combineContext(b){const a=this;return{...a.context,...b.context,locations:(a.context.locations||[]).concat(b.context.locations||[])};}},{key:"setContext",value:function setContext(context){return new Hap(this.whole,this.part,this.value,context);}}]);return Hap;}();var State=/*#__PURE__*/function(){function State(span,controls2={}){_classCallCheck3(this,State);this.span=span;this.controls=controls2;}_createClass3(State,[{key:"setSpan",value:function setSpan(span){return new State(span,this.controls);}},{key:"withSpan",value:function withSpan(func){return this.setSpan(func(this.span));}},{key:"setControls",value:function setControls(controls2){return new State(this.span,controls2);}}]);return State;}();var isNote=name=>/^[a-gA-G][#b]*[0-9]$/.test(name);var tokenizeNote=note=>{var _a;if(typeof note!=="string"){return[];}const[pc,acc="",oct]=((_a=note.match(/^([a-gA-G])([#bs]*)([0-9])?$/))==null?void 0:_a.slice(1))||[];if(!pc){return[];}return[pc,acc,oct?Number(oct):void 0];};var toMidi=note=>{const[pc,acc,oct]=tokenizeNote(note);if(!pc){throw new Error('not a note: "'+note+'"');}const chroma={c:0,d:2,e:4,f:5,g:7,a:9,b:11}[pc.toLowerCase()];const offset=(acc==null?void 0:acc.split("").reduce((o,char)=>o+{"#":1,b:-1,s:1}[char],0))||0;return(Number(oct)+1)*12+chroma+offset;};var fromMidi=n=>{return Math.pow(2,(n-69)/12)*440;};var getFreq=noteOrMidi=>{if(typeof noteOrMidi==="number"){return fromMidi(noteOrMidi);}return fromMidi(toMidi(noteOrMidi));};var midi2note=n=>{const oct=Math.floor(n/12)-1;const pc=["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"][n%12];return pc+oct;};var mod=(n,m)=>(n%m+m)%m;var getPlayableNoteValue=hap=>{let{value:note,context}=hap;if(typeof note==="object"&&!Array.isArray(note)){note=note.note||note.n||note.value;}if(typeof note==="number"&&context.type!=="frequency"){note=fromMidi(hap.value);}else if(typeof note==="number"&&context.type==="frequency"){note=hap.value;}else if(typeof note!=="string"||!isNote(note)){throw new Error("not a note: "+JSON.stringify(note));}return note;};var getFrequency=hap=>{let{value,context}=hap;if(typeof value==="object"&&value.freq){return value.freq;}if(typeof value==="number"&&context.type!=="frequency"){value=fromMidi(hap.value);}else if(typeof value==="string"&&isNote(value)){value=fromMidi(toMidi(hap.value));}else if(typeof value!=="number"){throw new Error("not a note or frequency:"+value);}return value;};var rotate=(arr,n)=>arr.slice(n).concat(arr.slice(0,n));var pipe=(...funcs)=>{return funcs.reduce((f,g)=>(...args)=>f(g(...args)),x=>x);};var compose=(...funcs)=>pipe(...funcs.reverse());var removeUndefineds=xs=>xs.filter(x=>x!=void 0);var flatten=arr=>[].concat(...arr);var id=a=>a;var constant=(a,b)=>a;var listRange=(min,max)=>Array.from({length:max-min+1},(_,i2)=>i2+min);function curry(func,overload){const fn=function curried(...args){if(args.length>=func.length){return func.apply(this,args);}else{const partial=function(...args2){return curried.apply(this,args.concat(args2));};if(overload){overload(partial,args);}return partial;}};if(overload){overload(fn,[]);}return fn;}function unionWithObj(a,b,func){const common=Object.keys(a).filter(k=>Object.keys(b).includes(k));return Object.assign({},a,b,Object.fromEntries(common.map(k=>[k,func(a[k],b[k])])));}curry((a,b)=>a*b);curry((f,anyFunctor)=>anyFunctor.map(f));function _drawLine(pat,chars=60){let cycle=0;let pos=fraction(0);let lines=[""];let emptyLine="";while(lines[0].lengthhap.hasOnset()).map(hap=>hap.duration);const charFraction=gcd(...durations);const totalSlots=charFraction.inverse();lines=lines.map(line=>line+"|");emptyLine+="|";for(let i2=0;i2hap.whole.begin.lte(begin)&&hap.whole.end.gte(end));const missingLines=matches.length-lines.length;if(missingLines>0){lines=lines.concat(Array(missingLines).fill(emptyLine));}lines=lines.map((line,i3)=>{const hap=matches[i3];if(hap){const isOnset=hap.whole.begin.eq(begin);const char=isOnset?""+hap.value:"-";return line+char;}return line+".";});emptyLine+=".";pos=pos.add(charFraction);}cycle++;}return lines.join("\n");}var Pattern$2=/*#__PURE__*/function(){function Pattern$2(query){_classCallCheck3(this,Pattern$2);__publicField(this,"_Pattern",true);this.query=query;}_createClass3(Pattern$2,[{key:"queryArc",value:function queryArc(begin,end){return this.query(new State(new TimeSpan(begin,end)));}},{key:"_splitQueries",value:function _splitQueries(){const pat=this;const q=state=>{return flatten(state.span.spanCycles.map(subspan=>pat.query(state.setSpan(subspan))));};return new Pattern$2(q);}},{key:"withQuerySpan",value:function withQuerySpan(func){return new Pattern$2(state=>this.query(state.withSpan(func)));}},{key:"withQueryTime",value:function withQueryTime(func){return new Pattern$2(state=>this.query(state.withSpan(span=>span.withTime(func))));}},{key:"withHapSpan",value:function withHapSpan(func){return new Pattern$2(state=>this.query(state).map(hap=>hap.withSpan(func)));}},{key:"withHapTime",value:function withHapTime(func){return this.withHapSpan(span=>span.withTime(func));}},{key:"_withHaps",value:function _withHaps(func){return new Pattern$2(state=>func(this.query(state)));}},{key:"_withHap",value:function _withHap(func){return this._withHaps(haps=>haps.map(func));}},{key:"_setContext",value:function _setContext(context){return this._withHap(hap=>hap.setContext(context));}},{key:"_withContext",value:function _withContext(func){return this._withHap(hap=>hap.setContext(func(hap.context)));}},{key:"_stripContext",value:function _stripContext(){return this._withHap(hap=>hap.setContext({}));}},{key:"withLocation",value:function withLocation(start,end){const location={start:{line:start[0],column:start[1],offset:start[2]},end:{line:end[0],column:end[1],offset:end[2]}};return this._withContext(context=>{const locations=(context.locations||[]).concat([location]);return{...context,locations};});}},{key:"withMiniLocation",value:function withMiniLocation(start,end){const offset={start:{line:start[0],column:start[1],offset:start[2]},end:{line:end[0],column:end[1],offset:end[2]}};return this._withContext(context=>{let locations=context.locations||[];locations=locations.map(({start:start2,end:end2})=>{const colOffset=start2.line===1?offset.start.column:0;return{start:{...start2,line:start2.line-1+(offset.start.line-1)+1,column:start2.column-1+colOffset},end:{...end2,line:end2.line-1+(offset.start.line-1)+1,column:end2.column-1+colOffset}};});return{...context,locations};});}},{key:"withValue",value:function withValue(func){return new Pattern$2(state=>this.query(state).map(hap=>hap.withValue(func)));}},{key:"fmap",value:function fmap(func){return this.withValue(func);}},{key:"_filterHaps",value:function _filterHaps(hap_test){return new Pattern$2(state=>this.query(state).filter(hap_test));}},{key:"_filterValues",value:function _filterValues(value_test){return new Pattern$2(state=>this.query(state).filter(hap=>value_test(hap.value)));}},{key:"_removeUndefineds",value:function _removeUndefineds(){return this._filterValues(val=>val!=void 0);}},{key:"onsetsOnly",value:function onsetsOnly(){return this._filterHaps(hap=>hap.hasOnset());}},{key:"discreteOnly",value:function discreteOnly(){return this._filterHaps(hap=>hap.whole);}},{key:"_appWhole",value:function _appWhole(whole_func,pat_val){const pat_func=this;const query=function(state){const hap_funcs=pat_func.query(state);const hap_vals=pat_val.query(state);const apply=function(hap_func,hap_val){const s=hap_func.part.intersection(hap_val.part);if(s==void 0){return void 0;}return new Hap(whole_func(hap_func.whole,hap_val.whole),s,hap_func.value(hap_val.value),hap_val.combineContext(hap_func));};return flatten(hap_funcs.map(hap_func=>removeUndefineds(hap_vals.map(hap_val=>apply(hap_func,hap_val)))));};return new Pattern$2(query);}},{key:"appBoth",value:function appBoth(pat_val){const whole_func=function(span_a,span_b){if(span_a==void 0||span_b==void 0){return void 0;}return span_a.intersection_e(span_b);};return this._appWhole(whole_func,pat_val);}},{key:"appLeft",value:function appLeft(pat_val){const pat_func=this;const query=function(state){const haps=[];for(const hap_func of pat_func.query(state)){const hap_vals=pat_val.query(state.setSpan(hap_func.wholeOrPart()));for(const hap_val of hap_vals){const new_whole=hap_func.whole;const new_part=hap_func.part.intersection(hap_val.part);if(new_part){const new_value=hap_func.value(hap_val.value);const new_context=hap_val.combineContext(hap_func);const hap=new Hap(new_whole,new_part,new_value,new_context);haps.push(hap);}}}return haps;};return new Pattern$2(query);}},{key:"appRight",value:function appRight(pat_val){const pat_func=this;const query=function(state){const haps=[];for(const hap_val of pat_val.query(state)){const hap_funcs=pat_func.query(state.setSpan(hap_val.wholeOrPart()));for(const hap_func of hap_funcs){const new_whole=hap_val.whole;const new_part=hap_func.part.intersection(hap_val.part);if(new_part){const new_value=hap_func.value(hap_val.value);const new_context=hap_val.combineContext(hap_func);const hap=new Hap(new_whole,new_part,new_value,new_context);haps.push(hap);}}}return haps;};return new Pattern$2(query);}},{key:"firstCycle",value:function firstCycle(with_context=false){var self=this;if(!with_context){self=self._stripContext();}return self.query(new State(new TimeSpan(fraction(0),fraction(1))));}},{key:"_firstCycleValues",get:function(){return this.firstCycle().map(hap=>hap.value);}},{key:"_showFirstCycle",get:function(){return this.firstCycle().map(hap=>`${hap.value}: ${hap.whole.begin.toFraction()} - ${hap.whole.end.toFraction()}`);}},{key:"_sortHapsByPart",value:function _sortHapsByPart(){return this._withHaps(haps=>haps.sort((a,b)=>a.part.begin.sub(b.part.begin).or(a.part.end.sub(b.part.end)).or(a.whole.begin.sub(b.whole.begin).or(a.whole.end.sub(b.whole.end)))));}},{key:"_opIn",value:function _opIn(other,func){return this.fmap(func).appLeft(reify$2(other));}},{key:"_opOut",value:function _opOut(other,func){return this.fmap(func).appRight(reify$2(other));}},{key:"_opMix",value:function _opMix(other,func){return this.fmap(func).appBoth(reify$2(other));}},{key:"_opSqueeze",value:function _opSqueeze(other,func){const otherPat=reify$2(other);return this.fmap(a=>otherPat.fmap(b=>func(a)(b)))._squeezeJoin();}},{key:"_opSqueezeOut",value:function _opSqueezeOut(other,func){const thisPat=this;const otherPat=reify$2(other);return otherPat.fmap(a=>thisPat.fmap(b=>func(b)(a)))._squeezeJoin();}},{key:"_opTrig",value:function _opTrig(other,func){const otherPat=reify$2(other);return otherPat.fmap(b=>this.fmap(a=>func(a)(b)))._trigJoin();}},{key:"_opTrigzero",value:function _opTrigzero(other,func){const otherPat=reify$2(other);return otherPat.fmap(b=>this.fmap(a=>func(a)(b)))._TrigzeroJoin();}},{key:"_asNumber",value:function _asNumber(dropfails=false,softfail=false){return this._withHap(hap=>{const asNumber=Number(hap.value);if(!isNaN(asNumber)){return hap.withValue(()=>asNumber);}const specialValue={e:Math.E,pi:Math.PI}[hap.value];if(typeof specialValue!=="undefined"){return hap.withValue(()=>specialValue);}if(isNote(hap.value)){return new Hap(hap.whole,hap.part,toMidi(hap.value),{...hap.context,type:"midi"});}if(dropfails){return void 0;}if(softfail){return hap;}throw new Error('cannot parse as number: "'+hap.value+'"');});}},{key:"round",value:function round(){return this._asNumber().fmap(v=>Math.round(v));}},{key:"floor",value:function floor(){return this._asNumber().fmap(v=>Math.floor(v));}},{key:"ceil",value:function ceil(){return this._asNumber().fmap(v=>Math.ceil(v));}},{key:"_toBipolar",value:function _toBipolar(){return this.fmap(x=>x*2-1);}},{key:"_fromBipolar",value:function _fromBipolar(){return this.fmap(x=>(x+1)/2);}},{key:"range",value:function range(min,max){return this.mul(max-min).add(min);}},{key:"rangex",value:function rangex(min,max){return this.range(Math.log(min),Math.log(max)).fmap(Math.exp);}},{key:"range2",value:function range2(min,max){return this._fromBipolar().range(min,max);}},{key:"_bindWhole",value:function _bindWhole(choose_whole,func){const pat_val=this;const query=function(state){const withWhole=function(a,b){return new Hap(choose_whole(a.whole,b.whole),b.part,b.value,Object.assign({},a.context,b.context,{locations:(a.context.locations||[]).concat(b.context.locations||[])}));};const match=function(a){return func(a.value).query(state.setSpan(a.part)).map(b=>withWhole(a,b));};return flatten(pat_val.query(state).map(a=>match(a)));};return new Pattern$2(query);}},{key:"bind",value:function bind(func){const whole_func=function(a,b){if(a==void 0||b==void 0){return void 0;}return a.intersection_e(b);};return this._bindWhole(whole_func,func);}},{key:"join",value:function join(){return this.bind(id);}},{key:"outerBind",value:function outerBind(func){return this._bindWhole((a,_)=>a,func);}},{key:"outerJoin",value:function outerJoin(){return this.outerBind(id);}},{key:"innerBind",value:function innerBind(func){return this._bindWhole((_,b)=>b,func);}},{key:"innerJoin",value:function innerJoin(){return this.innerBind(id);}},{key:"_trigJoin",value:function _trigJoin(cycleZero=false){const pat_of_pats=this;return new Pattern$2(state=>{return pat_of_pats.discreteOnly().query(state).map(outer_hap=>{return outer_hap.value.late(cycleZero?outer_hap.whole.begin:outer_hap.whole.begin.cyclePos()).query(state).map(inner_hap=>new Hap(inner_hap.whole?inner_hap.whole.intersection(outer_hap.whole):void 0,inner_hap.part.intersection(outer_hap.part),inner_hap.value).setContext(outer_hap.combineContext(inner_hap))).filter(hap=>hap.part);}).flat();});}},{key:"_TrigzeroJoin",value:function _TrigzeroJoin(){return this._trigJoin(true);}},{key:"_squeezeJoin",value:function _squeezeJoin(){const pat_of_pats=this;function query(state){const haps=pat_of_pats.discreteOnly().query(state);function flatHap(outerHap){const pat=outerHap.value._compressSpan(outerHap.wholeOrPart().cycleArc());const innerHaps=pat.query(state.setSpan(outerHap.part));function munge(outer,inner){let whole=void 0;if(inner.whole&&outer.whole){whole=inner.whole.intersection(outer.whole);if(!whole){return void 0;}}const part=inner.part.intersection(outer.part);if(!part){return void 0;}const context=inner.combineContext(outer);return new Hap(whole,part,inner.value,context);}return innerHaps.map(innerHap=>munge(outerHap,innerHap));}const result=flatten(haps.map(flatHap));return result.filter(x=>x);}return new Pattern$2(query);}},{key:"_squeezeBind",value:function _squeezeBind(func){return this.fmap(func)._squeezeJoin();}},{key:"_apply",value:function _apply(func){return func(this);}},{key:"layer",value:function layer(...funcs){return stack$1(...funcs.map(func=>func(this)));}},{key:"_patternify",value:function _patternify(func){const pat=this;const patterned=function(...args){args=args.map(arg=>isPattern(arg)?arg.fmap(value=>value.value||value):arg);const pat_arg=sequence$1(...args);return pat_arg.fmap(arg=>func.call(pat,arg)).innerJoin();};return patterned;}},{key:"_fastGap",value:function _fastGap(factor){const qf=function(span){const cycle=span.begin.sam();const begin=cycle.add(span.begin.sub(cycle).mul(factor).min(1));const end=cycle.add(span.end.sub(cycle).mul(factor).min(1));return new TimeSpan(begin,end);};const ef=function(span){const cycle=span.begin.sam();const begin=cycle.add(span.begin.sub(cycle).div(factor).min(1));const end=cycle.add(span.end.sub(cycle).div(factor).min(1));return new TimeSpan(begin,end);};return this.withQuerySpan(qf).withHapSpan(ef)._splitQueries();}},{key:"_compress",value:function _compress(b,e){if(b.gt(e)||b.gt(1)||e.gt(1)||b.lt(0)||e.lt(0)){return silence$1;}return this._fastGap(fraction(1).div(e.sub(b)))._late(b);}},{key:"_compressSpan",value:function _compressSpan(span){return this._compress(span.begin,span.end);}},{key:"_fast",value:function _fast(factor){const fastQuery=this.withQueryTime(t2=>t2.mul(factor));return fastQuery.withHapTime(t2=>t2.div(factor));}},{key:"_slow",value:function _slow(factor){return this._fast(fraction(1).div(factor));}},{key:"_inside",value:function _inside(factor,f){return f(this._slow(factor))._fast(factor);}},{key:"_outside",value:function _outside(factor,f){return f(this._fast(factor))._slow(factor);}},{key:"_ply",value:function _ply(factor){return this.fmap(x=>pure$1(x)._fast(factor))._squeezeJoin();}},{key:"_chop",value:function _chop(n){const slices=Array.from({length:n},(x,i2)=>i2);const slice_objects=slices.map(i2=>({begin:i2/n,end:(i2+1)/n}));const func=function(o){return sequence$1(slice_objects.map(slice_o=>Object.assign({},o,slice_o)));};return this._squeezeBind(func);}},{key:"_striate",value:function _striate(n){const slices=Array.from({length:n},(x,i2)=>i2);const slice_objects=slices.map(i2=>({begin:i2/n,end:(i2+1)/n}));const slicePat=slowcat$1(...slice_objects);return this.set(slicePat)._fast(n);}},{key:"_cpm",value:function _cpm(cpm){return this._fast(cpm/60);}},{key:"_early",value:function _early(offset){offset=fraction(offset);return this.withQueryTime(t2=>t2.add(offset)).withHapTime(t2=>t2.sub(offset));}},{key:"_late",value:function _late(offset){offset=fraction(offset);return this._early(fraction(0).sub(offset));}},{key:"_zoom",value:function _zoom(s,e){e=fraction(e);s=fraction(s);const d=e.sub(s);return this.withQuerySpan(span=>span.withCycle(t2=>t2.mul(d).add(s))).withHapSpan(span=>span.withCycle(t2=>t2.sub(s).div(d)))._splitQueries();}},{key:"_zoomArc",value:function _zoomArc(a){return this.zoom(a.begin,a.end);}},{key:"_linger",value:function _linger(t2){if(t2==0){return silence$1;}else if(t2<0){return this._zoom(t2.add(1),1)._slow(t2);}return this._zoom(0,t2)._slow(t2);}},{key:"_color",value:function _color(color){return this._withContext(context=>({...context,color}));}},{key:"log",value:function log(func=id){return this._withHap(hap=>hap.setContext({...hap.context,onTrigger:(...args)=>{if(hap.context.onTrigger){hap.context.onTrigger(...args);}console.log(func(...args));}}));}},{key:"drawLine",value:function drawLine(){console.log(_drawLine(this));return this;}},{key:"_segment",value:function _segment(rate){return this.struct(pure$1(true)._fast(rate));}},{key:"invert",value:function invert(){return this.fmap(x=>!x);}},{key:"inv",value:function inv(){return this.invert();}},{key:"when",value:function when(binary_pat,func){const true_pat=binary_pat._filterValues(id);const false_pat=binary_pat._filterValues(val=>!val);const with_pat=true_pat.fmap(_=>y=>y).appRight(func(this));const without_pat=false_pat.fmap(_=>y=>y).appRight(this);return stack$1(with_pat,without_pat);}},{key:"off",value:function off(time_pat,func){return stack$1(this,func(this.late(time_pat)));}},{key:"every",value:function every(n,func){const pat=this;const pats=Array(n-1).fill(pat);pats.unshift(func(pat));return slowcatPrime(...pats);}},{key:"brak",value:function brak(){return this.when(slowcat$1(false,true),x=>_fastcat(x,silence$1)._late(0.25));}},{key:"rev",value:function rev(){const pat=this;const query=function(state){const span=state.span;const cycle=span.begin.sam();const next_cycle=span.begin.nextSam();const reflect=function(to_reflect){const reflected=to_reflect.withTime(time2=>cycle.add(next_cycle.sub(time2)));const tmp=reflected.begin;reflected.begin=reflected.end;reflected.end=tmp;return reflected;};const haps=pat.query(state.setSpan(reflect(span)));return haps.map(hap=>hap.withSpan(reflect));};return new Pattern$2(query)._splitQueries();}},{key:"palindrome",value:function palindrome(){return this.every(2,rev);}},{key:"juxBy",value:function juxBy(by,func){by/=2;const elem_or=function(dict,key,dflt){if(key in dict){return dict[key];}return dflt;};const left=this.withValue(val=>Object.assign({},val,{pan:elem_or(val,"pan",0.5)-by}));const right=this.withValue(val=>Object.assign({},val,{pan:elem_or(val,"pan",0.5)+by}));return stack$1(left,func(right));}},{key:"_jux",value:function _jux(func){return this.juxBy(1,func);}},{key:"stack",value:function stack(...pats){return stack$1(this,...pats);}},{key:"sequence",value:function sequence(...pats){return sequence$1(this,...pats);}},{key:"seq",value:function seq(...pats){return sequence$1(this,...pats);}},{key:"cat",value:function cat(...pats){return _cat(this,...pats);}},{key:"fastcat",value:function fastcat(...pats){return _fastcat(this,...pats);}},{key:"slowcat",value:function slowcat(...pats){return slowcat$1(this,...pats);}},{key:"superimpose",value:function superimpose(...funcs){return this.stack(...funcs.map(func=>func(this)));}},{key:"stutWith",value:function stutWith(times,time2,func){return stack$1(...listRange(0,times-1).map(i2=>func(this.late(fraction(time2).mul(i2)),i2)));}},{key:"stut",value:function stut(times,feedback,time2){return this.stutWith(times,time2,(pat,i2)=>pat.velocity(Math.pow(feedback,i2)));}},{key:"_echoWith",value:function _echoWith(times,time2,func){return stack$1(...listRange(0,times-1).map(i2=>func(this.late(fraction(time2).mul(i2)),i2)));}},{key:"_echo",value:function _echo(times,time2,feedback){return this._echoWith(times,time2,(pat,i2)=>pat.velocity(Math.pow(feedback,i2)));}},{key:"iter",value:function iter(times,back=false){return slowcat$1(...listRange(0,times-1).map(i2=>back?this.late(i2/times):this.early(i2/times)));}},{key:"iterBack",value:function iterBack(times){return this.iter(times,true);}},{key:"_chunk",value:function _chunk(n,func,back=false){const binary=Array(n-1).fill(false);binary.unshift(true);const binary_pat=sequence$1(...binary).iter(n,back);return this.when(binary_pat,func);}},{key:"_chunkBack",value:function _chunkBack(n,func){return this._chunk(n,func,true);}},{key:"_bypass",value:function _bypass(on2){on2=Boolean(parseInt(on2));return on2?silence$1:this;}},{key:"hush",value:function hush(){return silence$1;}},{key:"_duration",value:function _duration(value){return this.withHapSpan(span=>new TimeSpan(span.begin,span.begin.add(value)));}},{key:"_legato",value:function _legato(value){return this.withHapSpan(span=>new TimeSpan(span.begin,span.begin.add(span.end.sub(span.begin).mul(value))));}},{key:"_velocity",value:function _velocity(velocity){return this._withContext(context=>({...context,velocity:(context.velocity||1)*velocity}));}},{key:"_loopAt",value:function _loopAt(factor,cps=1){return this.speed(1/factor*cps).unit("c").slow(factor);}},{key:"onTrigger",value:function onTrigger(_onTrigger){return this._withHap(hap=>hap.setContext({...hap.context,onTrigger:_onTrigger}));}},{key:"logValues",value:function logValues(func=id){return this.log((_,hap)=>func(hap.value));}}]);return Pattern$2;}();function _composeOp(a,b,func){function _nonFunctionObject(x){return x instanceof Object&&!(x instanceof Function);}if(_nonFunctionObject(a)||_nonFunctionObject(b)){if(!_nonFunctionObject(a)){a={value:a};}if(!_nonFunctionObject(b)){b={value:b};}return unionWithObj(a,b,func);}return func(a,b);}(function(){const num=pat=>pat._asNumber();const numOrString=pat=>pat._asNumber(false,true);const composers={set:[(a,b)=>b],keep:[(a,b)=>a],keepif:[(a,b)=>b?a:void 0],add:[(a,b)=>a+b,numOrString],sub:[(a,b)=>a-b,num],mul:[(a,b)=>a*b,num],div:[(a,b)=>a/b,num],mod:[mod,num],pow:[Math.pow,num],_and:[(a,b)=>a&b,num],_or:[(a,b)=>a|b,num],_xor:[(a,b)=>a^b,num],_lshift:[(a,b)=>a<a>>b,num],lt:[(a,b)=>aa>b],lte:[(a,b)=>a<=b],gte:[(a,b)=>a>=b],eq:[(a,b)=>a==b],eqt:[(a,b)=>a===b],ne:[(a,b)=>a!=b],net:[(a,b)=>a!==b],and:[(a,b)=>a&&b],or:[(a,b)=>a||b],func:[(a,b)=>b(a)]};for(const[what,[op,preprocess]]of Object.entries(composers)){for(const how of["In","Out","Mix","Squeeze","SqueezeOut","Trig","Trigzero"]){Pattern$2.prototype[what+how]=function(...other){var pat=this;other=sequence$1(other);if(preprocess){pat=preprocess(pat);other=preprocess(other);}var result=pat["_op"+how](other,a=>b=>_composeOp(a,b,op));if(what==="keepif"){result=result._removeUndefineds();}return result;};if(how==="Squeeze"){Pattern$2.prototype[what+"SqueezeIn"]=Pattern$2.prototype[what+how];}if(how==="In"){Pattern$2.prototype[what]=Pattern$2.prototype[what+how];}else{if(what==="set"){Pattern$2.prototype[how.toLowerCase()]=Pattern$2.prototype[what+how];}}}}Pattern$2.prototype.struct=Pattern$2.prototype.keepifOut;Pattern$2.prototype.structAll=Pattern$2.prototype.keepOut;Pattern$2.prototype.mask=Pattern$2.prototype.keepifIn;Pattern$2.prototype.maskAll=Pattern$2.prototype.keepIn;Pattern$2.prototype.reset=Pattern$2.prototype.keepifTrig;Pattern$2.prototype.resetAll=Pattern$2.prototype.keepTrig;Pattern$2.prototype.restart=Pattern$2.prototype.keepifTrigzero;Pattern$2.prototype.restartAll=Pattern$2.prototype.keepTrigzero;})();Pattern$2.prototype.patternified=["apply","chop","color","cpm","duration","early","fast","jux","late","legato","linger","ply","segment","striate","slow","velocity"];Pattern$2.prototype.factories={pure:pure$1,stack:stack$1,slowcat:slowcat$1,fastcat:_fastcat,cat:_cat,timeCat:timeCat$1,sequence:sequence$1,seq:seq$2,polymeter:polymeter,pm:pm,polyrhythm:polyrhythm,pr:pr};var silence$1=new Pattern$2(_=>[]);function pure$1(value){function query(state){return state.span.spanCycles.map(subspan=>new Hap(fraction(subspan.begin).wholeCycle(),subspan,value));}return new Pattern$2(query);}function isPattern(thing){const is=thing instanceof Pattern$2||thing._Pattern;if(!thing instanceof Pattern$2){console.warn(`Found Pattern that fails "instanceof Pattern" check. + **/ + +(function (module2, exports2) { + (function (root) { + var MAX_CYCLE_LEN = 2e3; + var P = { + "s": 1, + "n": 0, + "d": 1 + }; + + function assign(n, s) { + if (isNaN(n = parseInt(n, 10))) { + throw Fraction2["InvalidParameter"]; + } + + return n * s; + } + + function newFraction(n, d) { + if (d === 0) { + throw Fraction2["DivisionByZero"]; + } + + var f = Object.create(Fraction2.prototype); + f["s"] = n < 0 ? -1 : 1; + n = n < 0 ? -n : n; + var a = gcd2(n, d); + f["n"] = n / a; + f["d"] = d / a; + return f; + } + + function factorize(num) { + var factors = {}; + var n = num; + var i = 2; + var s = 4; + + while (s <= n) { + while (n % i === 0) { + n /= i; + factors[i] = (factors[i] || 0) + 1; + } + + s += 1 + 2 * i++; + } + + if (n !== num) { + if (n > 1) factors[n] = (factors[n] || 0) + 1; + } else { + factors[num] = (factors[num] || 0) + 1; + } + + return factors; + } + + var parse = function (p1, p2) { + var n = 0, + d = 1, + s = 1; + var v = 0, + w = 0, + x = 0, + y = 1, + z = 1; + var A = 0, + B = 1; + var C = 1, + D = 1; + var N = 1e7; + var M; + if (p1 === void 0 || p1 === null) ;else if (p2 !== void 0) { + n = p1; + d = p2; + s = n * d; + + if (n % 1 !== 0 || d % 1 !== 0) { + throw Fraction2["NonIntegerParameter"]; + } + } else switch (typeof p1) { + case "object": + { + if ("d" in p1 && "n" in p1) { + n = p1["n"]; + d = p1["d"]; + if ("s" in p1) n *= p1["s"]; + } else if (0 in p1) { + n = p1[0]; + if (1 in p1) d = p1[1]; + } else { + throw Fraction2["InvalidParameter"]; + } + + s = n * d; + break; + } + + case "number": + { + if (p1 < 0) { + s = p1; + p1 = -p1; + } + + if (p1 % 1 === 0) { + n = p1; + } else if (p1 > 0) { + if (p1 >= 1) { + z = Math.pow(10, Math.floor(1 + Math.log(p1) / Math.LN10)); + p1 /= z; + } + + while (B <= N && D <= N) { + M = (A + C) / (B + D); + + if (p1 === M) { + if (B + D <= N) { + n = A + C; + d = B + D; + } else if (D > B) { + n = C; + d = D; + } else { + n = A; + d = B; + } + + break; + } else { + if (p1 > M) { + A += C; + B += D; + } else { + C += A; + D += B; + } + + if (B > N) { + n = C; + d = D; + } else { + n = A; + d = B; + } + } + } + + n *= z; + } else if (isNaN(p1) || isNaN(p2)) { + d = n = NaN; + } + + break; + } + + case "string": + { + B = p1.match(/\d+|./g); + if (B === null) throw Fraction2["InvalidParameter"]; + + if (B[A] === "-") { + s = -1; + A++; + } else if (B[A] === "+") { + A++; + } + + if (B.length === A + 1) { + w = assign(B[A++], s); + } else if (B[A + 1] === "." || B[A] === ".") { + if (B[A] !== ".") { + v = assign(B[A++], s); + } + + A++; + + if (A + 1 === B.length || B[A + 1] === "(" && B[A + 3] === ")" || B[A + 1] === "'" && B[A + 3] === "'") { + w = assign(B[A], s); + y = Math.pow(10, B[A].length); + A++; + } + + if (B[A] === "(" && B[A + 2] === ")" || B[A] === "'" && B[A + 2] === "'") { + x = assign(B[A + 1], s); + z = Math.pow(10, B[A + 1].length) - 1; + A += 3; + } + } else if (B[A + 1] === "/" || B[A + 1] === ":") { + w = assign(B[A], s); + y = assign(B[A + 2], 1); + A += 3; + } else if (B[A + 3] === "/" && B[A + 1] === " ") { + v = assign(B[A], s); + w = assign(B[A + 2], s); + y = assign(B[A + 4], 1); + A += 5; + } + + if (B.length <= A) { + d = y * z; + s = n = x + d * v + z * w; + break; + } + } + + default: + throw Fraction2["InvalidParameter"]; + } + + if (d === 0) { + throw Fraction2["DivisionByZero"]; + } + + P["s"] = s < 0 ? -1 : 1; + P["n"] = Math.abs(n); + P["d"] = Math.abs(d); + }; + + function modpow(b, e, m) { + var r = 1; + + for (; e > 0; b = b * b % m, e >>= 1) { + if (e & 1) { + r = r * b % m; + } + } + + return r; + } + + function cycleLen(n, d) { + for (; d % 2 === 0; d /= 2) {} + + for (; d % 5 === 0; d /= 5) {} + + if (d === 1) return 0; + var rem = 10 % d; + var t = 1; + + for (; rem !== 1; t++) { + rem = rem * 10 % d; + if (t > MAX_CYCLE_LEN) return 0; + } + + return t; + } + + function cycleStart(n, d, len) { + var rem1 = 1; + var rem2 = modpow(10, len, d); + + for (var t = 0; t < 300; t++) { + if (rem1 === rem2) return t; + rem1 = rem1 * 10 % d; + rem2 = rem2 * 10 % d; + } + + return 0; + } + + function gcd2(a, b) { + if (!a) return b; + if (!b) return a; + + while (1) { + a %= b; + if (!a) return b; + b %= a; + if (!b) return a; + } + } + + function Fraction2(a, b) { + parse(a, b); + + if (this instanceof Fraction2) { + a = gcd2(P["d"], P["n"]); + this["s"] = P["s"]; + this["n"] = P["n"] / a; + this["d"] = P["d"] / a; + } else { + return newFraction(P["s"] * P["n"], P["d"]); + } + } + + Fraction2["DivisionByZero"] = new Error("Division by Zero"); + Fraction2["InvalidParameter"] = new Error("Invalid argument"); + Fraction2["NonIntegerParameter"] = new Error("Parameters must be integer"); + Fraction2.prototype = { + "s": 1, + "n": 0, + "d": 1, + "abs": function () { + return newFraction(this["n"], this["d"]); + }, + "neg": function () { + return newFraction(-this["s"] * this["n"], this["d"]); + }, + "add": function (a, b) { + parse(a, b); + return newFraction(this["s"] * this["n"] * P["d"] + P["s"] * this["d"] * P["n"], this["d"] * P["d"]); + }, + "sub": function (a, b) { + parse(a, b); + return newFraction(this["s"] * this["n"] * P["d"] - P["s"] * this["d"] * P["n"], this["d"] * P["d"]); + }, + "mul": function (a, b) { + parse(a, b); + return newFraction(this["s"] * P["s"] * this["n"] * P["n"], this["d"] * P["d"]); + }, + "div": function (a, b) { + parse(a, b); + return newFraction(this["s"] * P["s"] * this["n"] * P["d"], this["d"] * P["n"]); + }, + "clone": function () { + return newFraction(this["s"] * this["n"], this["d"]); + }, + "mod": function (a, b) { + if (isNaN(this["n"]) || isNaN(this["d"])) { + return new Fraction2(NaN); + } + + if (a === void 0) { + return newFraction(this["s"] * this["n"] % this["d"], 1); + } + + parse(a, b); + + if (0 === P["n"] && 0 === this["d"]) { + throw Fraction2["DivisionByZero"]; + } + + return newFraction(this["s"] * (P["d"] * this["n"]) % (P["n"] * this["d"]), P["d"] * this["d"]); + }, + "gcd": function (a, b) { + parse(a, b); + return newFraction(gcd2(P["n"], this["n"]) * gcd2(P["d"], this["d"]), P["d"] * this["d"]); + }, + "lcm": function (a, b) { + parse(a, b); + + if (P["n"] === 0 && this["n"] === 0) { + return newFraction(0, 1); + } + + return newFraction(P["n"] * this["n"], gcd2(P["n"], this["n"]) * gcd2(P["d"], this["d"])); + }, + "ceil": function (places) { + places = Math.pow(10, places || 0); + + if (isNaN(this["n"]) || isNaN(this["d"])) { + return new Fraction2(NaN); + } + + return newFraction(Math.ceil(places * this["s"] * this["n"] / this["d"]), places); + }, + "floor": function (places) { + places = Math.pow(10, places || 0); + + if (isNaN(this["n"]) || isNaN(this["d"])) { + return new Fraction2(NaN); + } + + return newFraction(Math.floor(places * this["s"] * this["n"] / this["d"]), places); + }, + "round": function (places) { + places = Math.pow(10, places || 0); + + if (isNaN(this["n"]) || isNaN(this["d"])) { + return new Fraction2(NaN); + } + + return newFraction(Math.round(places * this["s"] * this["n"] / this["d"]), places); + }, + "inverse": function () { + return newFraction(this["s"] * this["d"], this["n"]); + }, + "pow": function (a, b) { + parse(a, b); + + if (P["d"] === 1) { + if (P["s"] < 0) { + return newFraction(Math.pow(this["s"] * this["d"], P["n"]), Math.pow(this["n"], P["n"])); + } else { + return newFraction(Math.pow(this["s"] * this["n"], P["n"]), Math.pow(this["d"], P["n"])); + } + } + + if (this["s"] < 0) return null; + var N = factorize(this["n"]); + var D = factorize(this["d"]); + var n = 1; + var d = 1; + + for (var k in N) { + if (k === "1") continue; + + if (k === "0") { + n = 0; + break; + } + + N[k] *= P["n"]; + + if (N[k] % P["d"] === 0) { + N[k] /= P["d"]; + } else return null; + + n *= Math.pow(k, N[k]); + } + + for (var k in D) { + if (k === "1") continue; + D[k] *= P["n"]; + + if (D[k] % P["d"] === 0) { + D[k] /= P["d"]; + } else return null; + + d *= Math.pow(k, D[k]); + } + + if (P["s"] < 0) { + return newFraction(d, n); + } + + return newFraction(n, d); + }, + "equals": function (a, b) { + parse(a, b); + return this["s"] * this["n"] * P["d"] === P["s"] * P["n"] * this["d"]; + }, + "compare": function (a, b) { + parse(a, b); + var t = this["s"] * this["n"] * P["d"] - P["s"] * P["n"] * this["d"]; + return (0 < t) - (t < 0); + }, + "simplify": function (eps) { + if (isNaN(this["n"]) || isNaN(this["d"])) { + return this; + } + + eps = eps || 1e-3; + var thisABS = this["abs"](); + var cont = thisABS["toContinued"](); + + for (var i = 1; i < cont.length; i++) { + var s = newFraction(cont[i - 1], 1); + + for (var k = i - 2; k >= 0; k--) { + s = s["inverse"]()["add"](cont[k]); + } + + if (s["sub"](thisABS)["abs"]().valueOf() < eps) { + return s["mul"](this["s"]); + } + } + + return this; + }, + "divisible": function (a, b) { + parse(a, b); + return !(!(P["n"] * this["d"]) || this["n"] * P["d"] % (P["n"] * this["d"])); + }, + "valueOf": function () { + return this["s"] * this["n"] / this["d"]; + }, + "toFraction": function (excludeWhole) { + var whole, + str = ""; + var n = this["n"]; + var d = this["d"]; + + if (this["s"] < 0) { + str += "-"; + } + + if (d === 1) { + str += n; + } else { + if (excludeWhole && (whole = Math.floor(n / d)) > 0) { + str += whole; + str += " "; + n %= d; + } + + str += n; + str += "/"; + str += d; + } + + return str; + }, + "toLatex": function (excludeWhole) { + var whole, + str = ""; + var n = this["n"]; + var d = this["d"]; + + if (this["s"] < 0) { + str += "-"; + } + + if (d === 1) { + str += n; + } else { + if (excludeWhole && (whole = Math.floor(n / d)) > 0) { + str += whole; + n %= d; + } + + str += "\\frac{"; + str += n; + str += "}{"; + str += d; + str += "}"; + } + + return str; + }, + "toContinued": function () { + var t; + var a = this["n"]; + var b = this["d"]; + var res = []; + + if (isNaN(a) || isNaN(b)) { + return res; + } + + do { + res.push(Math.floor(a / b)); + t = a % b; + a = b; + b = t; + } while (a !== 1); + + return res; + }, + "toString": function (dec) { + var N = this["n"]; + var D = this["d"]; + + if (isNaN(N) || isNaN(D)) { + return "NaN"; + } + + dec = dec || 15; + var cycLen = cycleLen(N, D); + var cycOff = cycleStart(N, D, cycLen); + var str = this["s"] < 0 ? "-" : ""; + str += N / D | 0; + N %= D; + N *= 10; + if (N) str += "."; + + if (cycLen) { + for (var i = cycOff; i--;) { + str += N / D | 0; + N %= D; + N *= 10; + } + + str += "("; + + for (var i = cycLen; i--;) { + str += N / D | 0; + N %= D; + N *= 10; + } + + str += ")"; + } else { + for (var i = dec; N && i--;) { + str += N / D | 0; + N %= D; + N *= 10; + } + } + + return str; + } + }; + { + Object.defineProperty(Fraction2, "__esModule", { + "value": true + }); + Fraction2["default"] = Fraction2; + Fraction2["Fraction"] = Fraction2; + module2["exports"] = Fraction2; + } + })(); +})(fraction$1); + +var Fraction$1 = /* @__PURE__ */getDefaultExportFromCjs(fraction$1.exports); + +Fraction$1.prototype.sam = function () { + return this.floor(); +}; + +Fraction$1.prototype.nextSam = function () { + return this.sam().add(1); +}; + +Fraction$1.prototype.wholeCycle = function () { + return new TimeSpan(this.sam(), this.nextSam()); +}; + +Fraction$1.prototype.cyclePos = function () { + return this.sub(this.sam()); +}; + +Fraction$1.prototype.lt = function (other) { + return this.compare(other) < 0; +}; + +Fraction$1.prototype.gt = function (other) { + return this.compare(other) > 0; +}; + +Fraction$1.prototype.lte = function (other) { + return this.compare(other) <= 0; +}; + +Fraction$1.prototype.gte = function (other) { + return this.compare(other) >= 0; +}; + +Fraction$1.prototype.eq = function (other) { + return this.compare(other) == 0; +}; + +Fraction$1.prototype.max = function (other) { + return this.gt(other) ? this : other; +}; + +Fraction$1.prototype.min = function (other) { + return this.lt(other) ? this : other; +}; + +Fraction$1.prototype.show = function () { + return this.s * this.n + "/" + this.d; +}; + +Fraction$1.prototype.or = function (other) { + return this.eq(0) ? other : this; +}; + +var fraction = n => { + if (typeof n === "number") { + n = String(n); + } + + return Fraction$1(n); +}; + +var gcd = (...fractions) => { + return fractions.reduce((gcd2, fraction2) => gcd2.gcd(fraction2), fraction(1)); +}; + +fraction._original = Fraction$1; + +var TimeSpan = /*#__PURE__*/function () { + function TimeSpan(begin, end) { + _classCallCheck(this, TimeSpan); + + this.begin = fraction(begin); + this.end = fraction(end); + } + + _createClass(TimeSpan, [{ + key: "spanCycles", + get: function () { + const spans = []; + var begin = this.begin; + const end = this.end; + const end_sam = end.sam(); + + while (end.gt(begin)) { + if (begin.sam().equals(end_sam)) { + spans.push(new TimeSpan(begin, this.end)); + break; + } + + const next_begin = begin.nextSam(); + spans.push(new TimeSpan(begin, next_begin)); + begin = next_begin; + } + + return spans; + } + }, { + key: "duration", + get: function () { + return this.end.sub(this.begin); + } + }, { + key: "cycleArc", + value: function cycleArc() { + const b = this.begin.cyclePos(); + const e = b.add(this.duration); + return new TimeSpan(b, e); + } + }, { + key: "withTime", + value: function withTime(func_time) { + return new TimeSpan(func_time(this.begin), func_time(this.end)); + } + }, { + key: "withEnd", + value: function withEnd(func_time) { + return new TimeSpan(this.begin, func_time(this.end)); + } + }, { + key: "withCycle", + value: function withCycle(func_time) { + const sam = this.begin.sam(); + const b = sam.add(func_time(this.begin.sub(sam))); + const e = sam.add(func_time(this.end.sub(sam))); + return new TimeSpan(b, e); + } + }, { + key: "intersection", + value: function intersection(other) { + const intersect_begin = this.begin.max(other.begin); + const intersect_end = this.end.min(other.end); + + if (intersect_begin.gt(intersect_end)) { + return void 0; + } + + if (intersect_begin.equals(intersect_end)) { + if (intersect_begin.equals(this.end) && this.begin.lt(this.end)) { + return void 0; + } + + if (intersect_begin.equals(other.end) && other.begin.lt(other.end)) { + return void 0; + } + } + + return new TimeSpan(intersect_begin, intersect_end); + } + }, { + key: "intersection_e", + value: function intersection_e(other) { + const result = this.intersection(other); + + if (result == void 0) { + throw "TimeSpans do not intersect"; + } + + return result; + } + }, { + key: "midpoint", + value: function midpoint() { + return this.begin.add(this.duration.div(fraction(2))); + } + }, { + key: "equals", + value: function equals(other) { + return this.begin.equals(other.begin) && this.end.equals(other.end); + } + }, { + key: "show", + value: function show() { + return this.begin.show() + " -> " + this.end.show(); + } + }]); + + return TimeSpan; +}(); + +var Hap = /*#__PURE__*/function () { + function Hap(whole, part, value, context = {}, stateful = false) { + _classCallCheck(this, Hap); + + this.whole = whole; + this.part = part; + this.value = value; + this.context = context; + this.stateful = stateful; + + if (stateful) { + console.assert(typeof this.value === "function", "Stateful values must be functions"); + } + } + + _createClass(Hap, [{ + key: "duration", + get: function () { + return this.whole.end.sub(this.whole.begin); + } + }, { + key: "wholeOrPart", + value: function wholeOrPart() { + return this.whole ? this.whole : this.part; + } + }, { + key: "withSpan", + value: function withSpan(func) { + const whole = this.whole ? func(this.whole) : void 0; + return new Hap(whole, func(this.part), this.value, this.context); + } + }, { + key: "withValue", + value: function withValue(func) { + return new Hap(this.whole, this.part, func(this.value), this.context); + } + }, { + key: "hasOnset", + value: function hasOnset() { + return this.whole != void 0 && this.whole.begin.equals(this.part.begin); + } + }, { + key: "resolveState", + value: function resolveState(state) { + if (this.stateful && this.hasOnset()) { + console.log("stateful"); + const func = this.value; + const [newState, newValue] = func(state); + return [newState, new Hap(this.whole, this.part, newValue, this.context, false)]; + } + + return [state, this]; + } + }, { + key: "spanEquals", + value: function spanEquals(other) { + return this.whole == void 0 && other.whole == void 0 || this.whole.equals(other.whole); + } + }, { + key: "equals", + value: function equals(other) { + return this.spanEquals(other) && this.part.equals(other.part) && this.value === other.value; + } + }, { + key: "show", + value: function show() { + return "(" + (this.whole == void 0 ? "~" : this.whole.show()) + ", " + this.part.show() + ", " + this.value + ")"; + } + }, { + key: "showWhole", + value: function showWhole() { + return `${this.whole == void 0 ? "~" : this.whole.show()}: ${typeof this.value === "object" ? JSON.stringify(this.value) : this.value}`; + } + }, { + key: "combineContext", + value: function combineContext(b) { + const a = this; + return { ...a.context, + ...b.context, + locations: (a.context.locations || []).concat(b.context.locations || []) + }; + } + }, { + key: "setContext", + value: function setContext(context) { + return new Hap(this.whole, this.part, this.value, context); + } + }]); + + return Hap; +}(); + +var State = /*#__PURE__*/function () { + function State(span, controls2 = {}) { + _classCallCheck(this, State); + + this.span = span; + this.controls = controls2; + } + + _createClass(State, [{ + key: "setSpan", + value: function setSpan(span) { + return new State(span, this.controls); + } + }, { + key: "withSpan", + value: function withSpan(func) { + return this.setSpan(func(this.span)); + } + }, { + key: "setControls", + value: function setControls(controls2) { + return new State(this.span, controls2); + } + }]); + + return State; +}(); + +var isNote = name => /^[a-gA-G][#b]*[0-9]$/.test(name); + +var tokenizeNote = note => { + var _a; + + if (typeof note !== "string") { + return []; + } + + const [pc, acc = "", oct] = ((_a = note.match(/^([a-gA-G])([#bs]*)([0-9])?$/)) == null ? void 0 : _a.slice(1)) || []; + + if (!pc) { + return []; + } + + return [pc, acc, oct ? Number(oct) : void 0]; +}; + +var toMidi = note => { + const [pc, acc, oct] = tokenizeNote(note); + + if (!pc) { + throw new Error('not a note: "' + note + '"'); + } + + const chroma = { + c: 0, + d: 2, + e: 4, + f: 5, + g: 7, + a: 9, + b: 11 + }[pc.toLowerCase()]; + const offset = (acc == null ? void 0 : acc.split("").reduce((o, char) => o + { + "#": 1, + b: -1, + s: 1 + }[char], 0)) || 0; + return (Number(oct) + 1) * 12 + chroma + offset; +}; + +var fromMidi = n => { + return Math.pow(2, (n - 69) / 12) * 440; +}; + +var getFreq = noteOrMidi => { + if (typeof noteOrMidi === "number") { + return fromMidi(noteOrMidi); + } + + return fromMidi(toMidi(noteOrMidi)); +}; + +var midi2note = n => { + const oct = Math.floor(n / 12) - 1; + const pc = ["C", "Db", "D", "Eb", "E", "F", "Gb", "G", "Ab", "A", "Bb", "B"][n % 12]; + return pc + oct; +}; + +var mod = (n, m) => (n % m + m) % m; + +var getPlayableNoteValue = hap => { + let { + value: note, + context + } = hap; + + if (typeof note === "object" && !Array.isArray(note)) { + note = note.note || note.n || note.value; + } + + if (typeof note === "number" && context.type !== "frequency") { + note = fromMidi(hap.value); + } else if (typeof note === "number" && context.type === "frequency") { + note = hap.value; + } else if (typeof note !== "string" || !isNote(note)) { + throw new Error("not a note: " + JSON.stringify(note)); + } + + return note; +}; + +var getFrequency = hap => { + let { + value, + context + } = hap; + + if (typeof value === "object" && value.freq) { + return value.freq; + } + + if (typeof value === "number" && context.type !== "frequency") { + value = fromMidi(hap.value); + } else if (typeof value === "string" && isNote(value)) { + value = fromMidi(toMidi(hap.value)); + } else if (typeof value !== "number") { + throw new Error("not a note or frequency:" + value); + } + + return value; +}; + +var rotate = (arr, n) => arr.slice(n).concat(arr.slice(0, n)); + +var pipe = (...funcs) => { + return funcs.reduce((f, g) => (...args) => f(g(...args)), x => x); +}; + +var compose = (...funcs) => pipe(...funcs.reverse()); + +var removeUndefineds = xs => xs.filter(x => x != void 0); + +var flatten = arr => [].concat(...arr); + +var id = a => a; + +var constant = (a, b) => a; + +var listRange = (min, max) => Array.from({ + length: max - min + 1 +}, (_, i) => i + min); + +function curry(func, overload) { + const fn = function curried(...args) { + if (args.length >= func.length) { + return func.apply(this, args); + } else { + const partial = function (...args2) { + return curried.apply(this, args.concat(args2)); + }; + + if (overload) { + overload(partial, args); + } + + return partial; + } + }; + + if (overload) { + overload(fn, []); + } + + return fn; +} + +function unionWithObj(a, b, func) { + const common = Object.keys(a).filter(k => Object.keys(b).includes(k)); + return Object.assign({}, a, b, Object.fromEntries(common.map(k => [k, func(a[k], b[k])]))); +} + +curry((a, b) => a * b); +curry((f, anyFunctor) => anyFunctor.map(f)); + +function _drawLine(pat, chars = 60) { + let cycle = 0; + let pos = fraction(0); + let lines = [""]; + let emptyLine = ""; + + while (lines[0].length < chars) { + const haps = pat.queryArc(cycle, cycle + 1); + const durations = haps.filter(hap => hap.hasOnset()).map(hap => hap.duration); + const charFraction = gcd(...durations); + const totalSlots = charFraction.inverse(); + lines = lines.map(line => line + "|"); + emptyLine += "|"; + + for (let i = 0; i < totalSlots; i++) { + const [begin, end] = [pos, pos.add(charFraction)]; + const matches = haps.filter(hap => hap.whole.begin.lte(begin) && hap.whole.end.gte(end)); + const missingLines = matches.length - lines.length; + + if (missingLines > 0) { + lines = lines.concat(Array(missingLines).fill(emptyLine)); + } + + lines = lines.map((line, i2) => { + const hap = matches[i2]; + + if (hap) { + const isOnset = hap.whole.begin.eq(begin); + const char = isOnset ? "" + hap.value : "-"; + return line + char; + } + + return line + "."; + }); + emptyLine += "."; + pos = pos.add(charFraction); + } + + cycle++; + } + + return lines.join("\n"); +} + +var Pattern$1 = /*#__PURE__*/function () { + function Pattern$1(query) { + _classCallCheck(this, Pattern$1); + + __publicField(this, "_Pattern", true); + + this.query = query; + } + + _createClass(Pattern$1, [{ + key: "queryArc", + value: function queryArc(begin, end) { + return this.query(new State(new TimeSpan(begin, end))); + } + }, { + key: "_splitQueries", + value: function _splitQueries() { + const pat = this; + + const q = state => { + return flatten(state.span.spanCycles.map(subspan => pat.query(state.setSpan(subspan)))); + }; + + return new Pattern$1(q); + } + }, { + key: "withQuerySpan", + value: function withQuerySpan(func) { + return new Pattern$1(state => this.query(state.withSpan(func))); + } + }, { + key: "withQueryTime", + value: function withQueryTime(func) { + return new Pattern$1(state => this.query(state.withSpan(span => span.withTime(func)))); + } + }, { + key: "withHapSpan", + value: function withHapSpan(func) { + return new Pattern$1(state => this.query(state).map(hap => hap.withSpan(func))); + } + }, { + key: "withHapTime", + value: function withHapTime(func) { + return this.withHapSpan(span => span.withTime(func)); + } + }, { + key: "_withHaps", + value: function _withHaps(func) { + return new Pattern$1(state => func(this.query(state))); + } + }, { + key: "_withHap", + value: function _withHap(func) { + return this._withHaps(haps => haps.map(func)); + } + }, { + key: "_setContext", + value: function _setContext(context) { + return this._withHap(hap => hap.setContext(context)); + } + }, { + key: "_withContext", + value: function _withContext(func) { + return this._withHap(hap => hap.setContext(func(hap.context))); + } + }, { + key: "_stripContext", + value: function _stripContext() { + return this._withHap(hap => hap.setContext({})); + } + }, { + key: "withLocation", + value: function withLocation(start, end) { + const location = { + start: { + line: start[0], + column: start[1], + offset: start[2] + }, + end: { + line: end[0], + column: end[1], + offset: end[2] + } + }; + return this._withContext(context => { + const locations = (context.locations || []).concat([location]); + return { ...context, + locations + }; + }); + } + }, { + key: "withMiniLocation", + value: function withMiniLocation(start, end) { + const offset = { + start: { + line: start[0], + column: start[1], + offset: start[2] + }, + end: { + line: end[0], + column: end[1], + offset: end[2] + } + }; + return this._withContext(context => { + let locations = context.locations || []; + locations = locations.map(({ + start: start2, + end: end2 + }) => { + const colOffset = start2.line === 1 ? offset.start.column : 0; + return { + start: { ...start2, + line: start2.line - 1 + (offset.start.line - 1) + 1, + column: start2.column - 1 + colOffset + }, + end: { ...end2, + line: end2.line - 1 + (offset.start.line - 1) + 1, + column: end2.column - 1 + colOffset + } + }; + }); + return { ...context, + locations + }; + }); + } + }, { + key: "withValue", + value: function withValue(func) { + return new Pattern$1(state => this.query(state).map(hap => hap.withValue(func))); + } + }, { + key: "fmap", + value: function fmap(func) { + return this.withValue(func); + } + }, { + key: "_filterHaps", + value: function _filterHaps(hap_test) { + return new Pattern$1(state => this.query(state).filter(hap_test)); + } + }, { + key: "_filterValues", + value: function _filterValues(value_test) { + return new Pattern$1(state => this.query(state).filter(hap => value_test(hap.value))); + } + }, { + key: "_removeUndefineds", + value: function _removeUndefineds() { + return this._filterValues(val => val != void 0); + } + }, { + key: "onsetsOnly", + value: function onsetsOnly() { + return this._filterHaps(hap => hap.hasOnset()); + } + }, { + key: "discreteOnly", + value: function discreteOnly() { + return this._filterHaps(hap => hap.whole); + } + }, { + key: "_appWhole", + value: function _appWhole(whole_func, pat_val) { + const pat_func = this; + + const query = function (state) { + const hap_funcs = pat_func.query(state); + const hap_vals = pat_val.query(state); + + const apply = function (hap_func, hap_val) { + const s = hap_func.part.intersection(hap_val.part); + + if (s == void 0) { + return void 0; + } + + return new Hap(whole_func(hap_func.whole, hap_val.whole), s, hap_func.value(hap_val.value), hap_val.combineContext(hap_func)); + }; + + return flatten(hap_funcs.map(hap_func => removeUndefineds(hap_vals.map(hap_val => apply(hap_func, hap_val))))); + }; + + return new Pattern$1(query); + } + }, { + key: "appBoth", + value: function appBoth(pat_val) { + const whole_func = function (span_a, span_b) { + if (span_a == void 0 || span_b == void 0) { + return void 0; + } + + return span_a.intersection_e(span_b); + }; + + return this._appWhole(whole_func, pat_val); + } + }, { + key: "appLeft", + value: function appLeft(pat_val) { + const pat_func = this; + + const query = function (state) { + const haps = []; + + for (const hap_func of pat_func.query(state)) { + const hap_vals = pat_val.query(state.setSpan(hap_func.wholeOrPart())); + + for (const hap_val of hap_vals) { + const new_whole = hap_func.whole; + const new_part = hap_func.part.intersection(hap_val.part); + + if (new_part) { + const new_value = hap_func.value(hap_val.value); + const new_context = hap_val.combineContext(hap_func); + const hap = new Hap(new_whole, new_part, new_value, new_context); + haps.push(hap); + } + } + } + + return haps; + }; + + return new Pattern$1(query); + } + }, { + key: "appRight", + value: function appRight(pat_val) { + const pat_func = this; + + const query = function (state) { + const haps = []; + + for (const hap_val of pat_val.query(state)) { + const hap_funcs = pat_func.query(state.setSpan(hap_val.wholeOrPart())); + + for (const hap_func of hap_funcs) { + const new_whole = hap_val.whole; + const new_part = hap_func.part.intersection(hap_val.part); + + if (new_part) { + const new_value = hap_func.value(hap_val.value); + const new_context = hap_val.combineContext(hap_func); + const hap = new Hap(new_whole, new_part, new_value, new_context); + haps.push(hap); + } + } + } + + return haps; + }; + + return new Pattern$1(query); + } + }, { + key: "firstCycle", + value: function firstCycle(with_context = false) { + var self = this; + + if (!with_context) { + self = self._stripContext(); + } + + return self.query(new State(new TimeSpan(fraction(0), fraction(1)))); + } + }, { + key: "_firstCycleValues", + get: function () { + return this.firstCycle().map(hap => hap.value); + } + }, { + key: "_showFirstCycle", + get: function () { + return this.firstCycle().map(hap => `${hap.value}: ${hap.whole.begin.toFraction()} - ${hap.whole.end.toFraction()}`); + } + }, { + key: "_sortHapsByPart", + value: function _sortHapsByPart() { + return this._withHaps(haps => haps.sort((a, b) => a.part.begin.sub(b.part.begin).or(a.part.end.sub(b.part.end)).or(a.whole.begin.sub(b.whole.begin).or(a.whole.end.sub(b.whole.end))))); + } + }, { + key: "_opIn", + value: function _opIn(other, func) { + return this.fmap(func).appLeft(reify$2(other)); + } + }, { + key: "_opOut", + value: function _opOut(other, func) { + return this.fmap(func).appRight(reify$2(other)); + } + }, { + key: "_opMix", + value: function _opMix(other, func) { + return this.fmap(func).appBoth(reify$2(other)); + } + }, { + key: "_opSqueeze", + value: function _opSqueeze(other, func) { + const otherPat = reify$2(other); + return this.fmap(a => otherPat.fmap(b => func(a)(b)))._squeezeJoin(); + } + }, { + key: "_opSqueezeOut", + value: function _opSqueezeOut(other, func) { + const thisPat = this; + const otherPat = reify$2(other); + return otherPat.fmap(a => thisPat.fmap(b => func(b)(a)))._squeezeJoin(); + } + }, { + key: "_opTrig", + value: function _opTrig(other, func) { + const otherPat = reify$2(other); + return otherPat.fmap(b => this.fmap(a => func(a)(b)))._trigJoin(); + } + }, { + key: "_opTrigzero", + value: function _opTrigzero(other, func) { + const otherPat = reify$2(other); + return otherPat.fmap(b => this.fmap(a => func(a)(b)))._TrigzeroJoin(); + } + }, { + key: "_asNumber", + value: function _asNumber(dropfails = false, softfail = false) { + return this._withHap(hap => { + const asNumber = Number(hap.value); + + if (!isNaN(asNumber)) { + return hap.withValue(() => asNumber); + } + + const specialValue = { + e: Math.E, + pi: Math.PI + }[hap.value]; + + if (typeof specialValue !== "undefined") { + return hap.withValue(() => specialValue); + } + + if (isNote(hap.value)) { + return new Hap(hap.whole, hap.part, toMidi(hap.value), { ...hap.context, + type: "midi" + }); + } + + if (dropfails) { + return void 0; + } + + if (softfail) { + return hap; + } + + throw new Error('cannot parse as number: "' + hap.value + '"'); + }); + } + }, { + key: "round", + value: function round() { + return this._asNumber().fmap(v => Math.round(v)); + } + }, { + key: "floor", + value: function floor() { + return this._asNumber().fmap(v => Math.floor(v)); + } + }, { + key: "ceil", + value: function ceil() { + return this._asNumber().fmap(v => Math.ceil(v)); + } + }, { + key: "_toBipolar", + value: function _toBipolar() { + return this.fmap(x => x * 2 - 1); + } + }, { + key: "_fromBipolar", + value: function _fromBipolar() { + return this.fmap(x => (x + 1) / 2); + } + }, { + key: "range", + value: function range(min, max) { + return this.mul(max - min).add(min); + } + }, { + key: "rangex", + value: function rangex(min, max) { + return this.range(Math.log(min), Math.log(max)).fmap(Math.exp); + } + }, { + key: "range2", + value: function range2(min, max) { + return this._fromBipolar().range(min, max); + } + }, { + key: "_bindWhole", + value: function _bindWhole(choose_whole, func) { + const pat_val = this; + + const query = function (state) { + const withWhole = function (a, b) { + return new Hap(choose_whole(a.whole, b.whole), b.part, b.value, Object.assign({}, a.context, b.context, { + locations: (a.context.locations || []).concat(b.context.locations || []) + })); + }; + + const match = function (a) { + return func(a.value).query(state.setSpan(a.part)).map(b => withWhole(a, b)); + }; + + return flatten(pat_val.query(state).map(a => match(a))); + }; + + return new Pattern$1(query); + } + }, { + key: "bind", + value: function bind(func) { + const whole_func = function (a, b) { + if (a == void 0 || b == void 0) { + return void 0; + } + + return a.intersection_e(b); + }; + + return this._bindWhole(whole_func, func); + } + }, { + key: "join", + value: function join() { + return this.bind(id); + } + }, { + key: "outerBind", + value: function outerBind(func) { + return this._bindWhole((a, _) => a, func); + } + }, { + key: "outerJoin", + value: function outerJoin() { + return this.outerBind(id); + } + }, { + key: "innerBind", + value: function innerBind(func) { + return this._bindWhole((_, b) => b, func); + } + }, { + key: "innerJoin", + value: function innerJoin() { + return this.innerBind(id); + } + }, { + key: "_trigJoin", + value: function _trigJoin(cycleZero = false) { + const pat_of_pats = this; + return new Pattern$1(state => { + return pat_of_pats.discreteOnly().query(state).map(outer_hap => { + return outer_hap.value.late(cycleZero ? outer_hap.whole.begin : outer_hap.whole.begin.cyclePos()).query(state).map(inner_hap => new Hap(inner_hap.whole ? inner_hap.whole.intersection(outer_hap.whole) : void 0, inner_hap.part.intersection(outer_hap.part), inner_hap.value).setContext(outer_hap.combineContext(inner_hap))).filter(hap => hap.part); + }).flat(); + }); + } + }, { + key: "_TrigzeroJoin", + value: function _TrigzeroJoin() { + return this._trigJoin(true); + } + }, { + key: "_squeezeJoin", + value: function _squeezeJoin() { + const pat_of_pats = this; + + function query(state) { + const haps = pat_of_pats.discreteOnly().query(state); + + function flatHap(outerHap) { + const pat = outerHap.value._compressSpan(outerHap.wholeOrPart().cycleArc()); + + const innerHaps = pat.query(state.setSpan(outerHap.part)); + + function munge(outer, inner) { + let whole = void 0; + + if (inner.whole && outer.whole) { + whole = inner.whole.intersection(outer.whole); + + if (!whole) { + return void 0; + } + } + + const part = inner.part.intersection(outer.part); + + if (!part) { + return void 0; + } + + const context = inner.combineContext(outer); + return new Hap(whole, part, inner.value, context); + } + + return innerHaps.map(innerHap => munge(outerHap, innerHap)); + } + + const result = flatten(haps.map(flatHap)); + return result.filter(x => x); + } + + return new Pattern$1(query); + } + }, { + key: "_squeezeBind", + value: function _squeezeBind(func) { + return this.fmap(func)._squeezeJoin(); + } + }, { + key: "_apply", + value: function _apply(func) { + return func(this); + } + }, { + key: "layer", + value: function layer(...funcs) { + return stack$1(...funcs.map(func => func(this))); + } + }, { + key: "_patternify", + value: function _patternify(func) { + const pat = this; + + const patterned = function (...args) { + args = args.map(arg => isPattern(arg) ? arg.fmap(value => value.value || value) : arg); + const pat_arg = sequence$1(...args); + return pat_arg.fmap(arg => func.call(pat, arg)).innerJoin(); + }; + + return patterned; + } + }, { + key: "_fastGap", + value: function _fastGap(factor) { + const qf = function (span) { + const cycle = span.begin.sam(); + const begin = cycle.add(span.begin.sub(cycle).mul(factor).min(1)); + const end = cycle.add(span.end.sub(cycle).mul(factor).min(1)); + return new TimeSpan(begin, end); + }; + + const ef = function (span) { + const cycle = span.begin.sam(); + const begin = cycle.add(span.begin.sub(cycle).div(factor).min(1)); + const end = cycle.add(span.end.sub(cycle).div(factor).min(1)); + return new TimeSpan(begin, end); + }; + + return this.withQuerySpan(qf).withHapSpan(ef)._splitQueries(); + } + }, { + key: "_compress", + value: function _compress(b, e) { + if (b.gt(e) || b.gt(1) || e.gt(1) || b.lt(0) || e.lt(0)) { + return silence$1; + } + + return this._fastGap(fraction(1).div(e.sub(b)))._late(b); + } + }, { + key: "_compressSpan", + value: function _compressSpan(span) { + return this._compress(span.begin, span.end); + } + }, { + key: "_fast", + value: function _fast(factor) { + const fastQuery = this.withQueryTime(t => t.mul(factor)); + return fastQuery.withHapTime(t => t.div(factor)); + } + }, { + key: "_slow", + value: function _slow(factor) { + return this._fast(fraction(1).div(factor)); + } + }, { + key: "_inside", + value: function _inside(factor, f) { + return f(this._slow(factor))._fast(factor); + } + }, { + key: "_outside", + value: function _outside(factor, f) { + return f(this._fast(factor))._slow(factor); + } + }, { + key: "_ply", + value: function _ply(factor) { + return this.fmap(x => pure$1(x)._fast(factor))._squeezeJoin(); + } + }, { + key: "_chop", + value: function _chop(n) { + const slices = Array.from({ + length: n + }, (x, i) => i); + const slice_objects = slices.map(i => ({ + begin: i / n, + end: (i + 1) / n + })); + + const func = function (o) { + return sequence$1(slice_objects.map(slice_o => Object.assign({}, o, slice_o))); + }; + + return this._squeezeBind(func); + } + }, { + key: "_striate", + value: function _striate(n) { + const slices = Array.from({ + length: n + }, (x, i) => i); + const slice_objects = slices.map(i => ({ + begin: i / n, + end: (i + 1) / n + })); + const slicePat = slowcat$1(...slice_objects); + return this.set(slicePat)._fast(n); + } + }, { + key: "_cpm", + value: function _cpm(cpm) { + return this._fast(cpm / 60); + } + }, { + key: "_early", + value: function _early(offset) { + offset = fraction(offset); + return this.withQueryTime(t => t.add(offset)).withHapTime(t => t.sub(offset)); + } + }, { + key: "_late", + value: function _late(offset) { + offset = fraction(offset); + return this._early(fraction(0).sub(offset)); + } + }, { + key: "_zoom", + value: function _zoom(s, e) { + e = fraction(e); + s = fraction(s); + const d = e.sub(s); + return this.withQuerySpan(span => span.withCycle(t => t.mul(d).add(s))).withHapSpan(span => span.withCycle(t => t.sub(s).div(d)))._splitQueries(); + } + }, { + key: "_zoomArc", + value: function _zoomArc(a) { + return this.zoom(a.begin, a.end); + } + }, { + key: "_linger", + value: function _linger(t) { + if (t == 0) { + return silence$1; + } else if (t < 0) { + return this._zoom(t.add(1), 1)._slow(t); + } + + return this._zoom(0, t)._slow(t); + } + }, { + key: "_color", + value: function _color(color) { + return this._withContext(context => ({ ...context, + color + })); + } + }, { + key: "log", + value: function log(func = id) { + return this._withHap(hap => hap.setContext({ ...hap.context, + onTrigger: (...args) => { + if (hap.context.onTrigger) { + hap.context.onTrigger(...args); + } + + console.log(func(...args)); + } + })); + } + }, { + key: "drawLine", + value: function drawLine() { + console.log(_drawLine(this)); + return this; + } + }, { + key: "_segment", + value: function _segment(rate) { + return this.struct(pure$1(true)._fast(rate)); + } + }, { + key: "invert", + value: function invert() { + return this.fmap(x => !x); + } + }, { + key: "inv", + value: function inv() { + return this.invert(); + } + }, { + key: "when", + value: function when(binary_pat, func) { + const true_pat = binary_pat._filterValues(id); + + const false_pat = binary_pat._filterValues(val => !val); + + const with_pat = true_pat.fmap(_ => y => y).appRight(func(this)); + const without_pat = false_pat.fmap(_ => y => y).appRight(this); + return stack$1(with_pat, without_pat); + } + }, { + key: "off", + value: function off(time_pat, func) { + return stack$1(this, func(this.late(time_pat))); + } + }, { + key: "every", + value: function every(n, func) { + const pat = this; + const pats = Array(n - 1).fill(pat); + pats.unshift(func(pat)); + return slowcatPrime(...pats); + } + }, { + key: "brak", + value: function brak() { + return this.when(slowcat$1(false, true), x => _fastcat(x, silence$1)._late(0.25)); + } + }, { + key: "rev", + value: function rev() { + const pat = this; + + const query = function (state) { + const span = state.span; + const cycle = span.begin.sam(); + const next_cycle = span.begin.nextSam(); + + const reflect = function (to_reflect) { + const reflected = to_reflect.withTime(time2 => cycle.add(next_cycle.sub(time2))); + const tmp = reflected.begin; + reflected.begin = reflected.end; + reflected.end = tmp; + return reflected; + }; + + const haps = pat.query(state.setSpan(reflect(span))); + return haps.map(hap => hap.withSpan(reflect)); + }; + + return new Pattern$1(query)._splitQueries(); + } + }, { + key: "palindrome", + value: function palindrome() { + return this.every(2, rev); + } + }, { + key: "juxBy", + value: function juxBy(by, func) { + by /= 2; + + const elem_or = function (dict, key, dflt) { + if (key in dict) { + return dict[key]; + } + + return dflt; + }; + + const left = this.withValue(val => Object.assign({}, val, { + pan: elem_or(val, "pan", 0.5) - by + })); + const right = this.withValue(val => Object.assign({}, val, { + pan: elem_or(val, "pan", 0.5) + by + })); + return stack$1(left, func(right)); + } + }, { + key: "_jux", + value: function _jux(func) { + return this.juxBy(1, func); + } + }, { + key: "stack", + value: function stack(...pats) { + return stack$1(this, ...pats); + } + }, { + key: "sequence", + value: function sequence(...pats) { + return sequence$1(this, ...pats); + } + }, { + key: "seq", + value: function seq(...pats) { + return sequence$1(this, ...pats); + } + }, { + key: "cat", + value: function cat(...pats) { + return _cat(this, ...pats); + } + }, { + key: "fastcat", + value: function fastcat(...pats) { + return _fastcat(this, ...pats); + } + }, { + key: "slowcat", + value: function slowcat(...pats) { + return slowcat$1(this, ...pats); + } + }, { + key: "superimpose", + value: function superimpose(...funcs) { + return this.stack(...funcs.map(func => func(this))); + } + }, { + key: "stutWith", + value: function stutWith(times, time2, func) { + return stack$1(...listRange(0, times - 1).map(i => func(this.late(fraction(time2).mul(i)), i))); + } + }, { + key: "stut", + value: function stut(times, feedback, time2) { + return this.stutWith(times, time2, (pat, i) => pat.velocity(Math.pow(feedback, i))); + } + }, { + key: "_echoWith", + value: function _echoWith(times, time2, func) { + return stack$1(...listRange(0, times - 1).map(i => func(this.late(fraction(time2).mul(i)), i))); + } + }, { + key: "_echo", + value: function _echo(times, time2, feedback) { + return this._echoWith(times, time2, (pat, i) => pat.velocity(Math.pow(feedback, i))); + } + }, { + key: "iter", + value: function iter(times, back = false) { + return slowcat$1(...listRange(0, times - 1).map(i => back ? this.late(i / times) : this.early(i / times))); + } + }, { + key: "iterBack", + value: function iterBack(times) { + return this.iter(times, true); + } + }, { + key: "_chunk", + value: function _chunk(n, func, back = false) { + const binary = Array(n - 1).fill(false); + binary.unshift(true); + const binary_pat = sequence$1(...binary).iter(n, back); + return this.when(binary_pat, func); + } + }, { + key: "_chunkBack", + value: function _chunkBack(n, func) { + return this._chunk(n, func, true); + } + }, { + key: "_bypass", + value: function _bypass(on2) { + on2 = Boolean(parseInt(on2)); + return on2 ? silence$1 : this; + } + }, { + key: "hush", + value: function hush() { + return silence$1; + } + }, { + key: "_duration", + value: function _duration(value) { + return this.withHapSpan(span => new TimeSpan(span.begin, span.begin.add(value))); + } + }, { + key: "_legato", + value: function _legato(value) { + return this.withHapSpan(span => new TimeSpan(span.begin, span.begin.add(span.end.sub(span.begin).mul(value)))); + } + }, { + key: "_velocity", + value: function _velocity(velocity) { + return this._withContext(context => ({ ...context, + velocity: (context.velocity || 1) * velocity + })); + } + }, { + key: "_loopAt", + value: function _loopAt(factor, cps = 1) { + return this.speed(1 / factor * cps).unit("c").slow(factor); + } + }, { + key: "onTrigger", + value: function onTrigger(_onTrigger) { + return this._withHap(hap => hap.setContext({ ...hap.context, + onTrigger: _onTrigger + })); + } + }, { + key: "logValues", + value: function logValues(func = id) { + return this.log((_, hap) => func(hap.value)); + } + }]); + + return Pattern$1; +}(); + +function _composeOp(a, b, func) { + function _nonFunctionObject(x) { + return x instanceof Object && !(x instanceof Function); + } + + if (_nonFunctionObject(a) || _nonFunctionObject(b)) { + if (!_nonFunctionObject(a)) { + a = { + value: a + }; + } + + if (!_nonFunctionObject(b)) { + b = { + value: b + }; + } + + return unionWithObj(a, b, func); + } + + return func(a, b); +} + +(function () { + const num = pat => pat._asNumber(); + + const numOrString = pat => pat._asNumber(false, true); + + const composers = { + set: [(a, b) => b], + keep: [(a, b) => a], + keepif: [(a, b) => b ? a : void 0], + add: [(a, b) => a + b, numOrString], + sub: [(a, b) => a - b, num], + mul: [(a, b) => a * b, num], + div: [(a, b) => a / b, num], + mod: [mod, num], + pow: [Math.pow, num], + _and: [(a, b) => a & b, num], + _or: [(a, b) => a | b, num], + _xor: [(a, b) => a ^ b, num], + _lshift: [(a, b) => a << b, num], + _rshift: [(a, b) => a >> b, num], + lt: [(a, b) => a < b], + gt: [(a, b) => a > b], + lte: [(a, b) => a <= b], + gte: [(a, b) => a >= b], + eq: [(a, b) => a == b], + eqt: [(a, b) => a === b], + ne: [(a, b) => a != b], + net: [(a, b) => a !== b], + and: [(a, b) => a && b], + or: [(a, b) => a || b], + func: [(a, b) => b(a)] + }; + + for (const [what, [op, preprocess]] of Object.entries(composers)) { + for (const how of ["In", "Out", "Mix", "Squeeze", "SqueezeOut", "Trig", "Trigzero"]) { + Pattern$1.prototype[what + how] = function (...other) { + var pat = this; + other = sequence$1(other); + + if (preprocess) { + pat = preprocess(pat); + other = preprocess(other); + } + + var result = pat["_op" + how](other, a => b => _composeOp(a, b, op)); + + if (what === "keepif") { + result = result._removeUndefineds(); + } + + return result; + }; + + if (how === "Squeeze") { + Pattern$1.prototype[what + "SqueezeIn"] = Pattern$1.prototype[what + how]; + } + + if (how === "In") { + Pattern$1.prototype[what] = Pattern$1.prototype[what + how]; + } else { + if (what === "set") { + Pattern$1.prototype[how.toLowerCase()] = Pattern$1.prototype[what + how]; + } + } + } + } + + Pattern$1.prototype.struct = Pattern$1.prototype.keepifOut; + Pattern$1.prototype.structAll = Pattern$1.prototype.keepOut; + Pattern$1.prototype.mask = Pattern$1.prototype.keepifIn; + Pattern$1.prototype.maskAll = Pattern$1.prototype.keepIn; + Pattern$1.prototype.reset = Pattern$1.prototype.keepifTrig; + Pattern$1.prototype.resetAll = Pattern$1.prototype.keepTrig; + Pattern$1.prototype.restart = Pattern$1.prototype.keepifTrigzero; + Pattern$1.prototype.restartAll = Pattern$1.prototype.keepTrigzero; +})(); + +Pattern$1.prototype.patternified = ["apply", "chop", "color", "cpm", "duration", "early", "fast", "jux", "late", "legato", "linger", "ply", "segment", "striate", "slow", "velocity"]; +Pattern$1.prototype.factories = { + pure: pure$1, + stack: stack$1, + slowcat: slowcat$1, + fastcat: _fastcat, + cat: _cat, + timeCat: timeCat$1, + sequence: sequence$1, + seq: seq, + polymeter: polymeter, + pm: pm, + polyrhythm: polyrhythm, + pr: pr +}; +var silence$1 = new Pattern$1(_ => []); + +function pure$1(value) { + function query(state) { + return state.span.spanCycles.map(subspan => new Hap(fraction(subspan.begin).wholeCycle(), subspan, value)); + } + + return new Pattern$1(query); +} + +function isPattern(thing) { + const is = thing instanceof Pattern$1 || thing._Pattern; + + if (!thing instanceof Pattern$1) { + console.warn(`Found Pattern that fails "instanceof Pattern" check. This may happen if you are using multiple versions of @strudel.cycles/core. - Please check by running "npm ls @strudel.cycles/core".`);}return is;}function reify$2(thing){if(isPattern(thing)){return thing;}return pure$1(thing);}function stack$1(...pats){pats=pats.map(pat=>Array.isArray(pat)?sequence$1(...pat):reify$2(pat));const query=state=>flatten(pats.map(pat=>pat.query(state)));return new Pattern$2(query);}function slowcat$1(...pats){pats=pats.map(pat=>Array.isArray(pat)?sequence$1(...pat):reify$2(pat));const query=function(state){const span=state.span;const pat_n=mod(span.begin.sam(),pats.length);const pat=pats[pat_n];if(!pat){return[];}const offset=span.begin.floor().sub(span.begin.div(pats.length).floor());return pat.withHapTime(t2=>t2.add(offset)).query(state.setSpan(span.withTime(t2=>t2.sub(offset))));};return new Pattern$2(query)._splitQueries();}function slowcatPrime(...pats){pats=pats.map(reify$2);const query=function(state){const pat_n=Math.floor(state.span.begin)%pats.length;const pat=pats[pat_n];return(pat==null?void 0:pat.query(state))||[];};return new Pattern$2(query)._splitQueries();}function _fastcat(...pats){return slowcat$1(...pats)._fast(pats.length);}function _cat(...pats){return slowcat$1(...pats);}function timeCat$1(...timepats){const total=timepats.map(a=>a[0]).reduce((a,b)=>a.add(b),fraction(0));let begin=fraction(0);const pats=[];for(const[time2,pat]of timepats){const end=begin.add(time2);pats.push(reify$2(pat)._compress(begin.div(total),end.div(total)));begin=end;}return stack$1(...pats);}function sequence$1(...pats){return _fastcat(...pats);}function seq$2(...pats){return _fastcat(...pats);}function _sequenceCount(x){if(Array.isArray(x)){if(x.length==0){return[silence$1,0];}if(x.length==1){return _sequenceCount(x[0]);}return[_fastcat(...x.map(a=>_sequenceCount(a)[0])),x.length];}return[reify$2(x),1];}function polymeterSteps(steps,...args){const seqs=args.map(a=>_sequenceCount(a));if(seqs.length==0){return silence$1;}if(steps==0){steps=seqs[0][1];}const pats=[];for(const seq2 of seqs){if(seq2[1]==0){next;}if(steps==seq2[1]){pats.push(seq2[0]);}else{pats.push(seq2[0]._fast(fraction(steps).div(fraction(seq2[1]))));}}return stack$1(...pats);}function polymeter(...args){return polymeterSteps(0,...args);}function pm(...args){polymeter(...args);}function polyrhythm(...xs){const seqs=xs.map(a=>sequence$1(a));if(seqs.length==0){return silence$1;}return stack$1(...seqs);}function pr(args){polyrhythm(args);}var add=curry((a,pat)=>pat.add(a));var chop=curry((a,pat)=>pat.chop(a));var chunk=curry((a,pat)=>pat.chunk(a));var chunkBack=curry((a,pat)=>pat.chunkBack(a));var div=curry((a,pat)=>pat.div(a));var early=curry((a,pat)=>pat.early(a));var echo=curry((a,b,c,pat)=>pat.echo(a,b,c));var every=curry((i2,f,pat)=>pat.every(i2,f));var fast=curry((a,pat)=>pat.fast(a));var inv=pat=>pat.inv();var invert=pat=>pat.invert();var iter=curry((a,pat)=>pat.iter(a));var iterBack=curry((a,pat)=>pat.iter(a));var jux=curry((f,pat)=>pat.jux(f));var juxBy=curry((by,f,pat)=>pat.juxBy(by,f));var late=curry((a,pat)=>pat.late(a));var linger=curry((a,pat)=>pat.linger(a));var mask=curry((a,pat)=>pat.mask(a));var mul=curry((a,pat)=>pat.mul(a));var off=curry((t2,f,pat)=>pat.off(t2,f));var ply=curry((a,pat)=>pat.ply(a));var range=curry((a,b,pat)=>pat.range(a,b));var range2=curry((a,b,pat)=>pat.range2(a,b));var rev=pat=>pat.rev();var slow=curry((a,pat)=>pat.slow(a));var struct=curry((a,pat)=>pat.struct(a));var sub=curry((a,pat)=>pat.sub(a));var superimpose=curry((array,pat)=>pat.superimpose(...array));var set=curry((a,pat)=>pat.set(a));var when=curry((binary,f,pat)=>pat.when(binary,f));Pattern$2.prototype.composable={fast:fast,slow:slow,early:early,late:late,superimpose:superimpose};function makeComposable(func){Object.entries(Pattern$2.prototype.composable).forEach(([functionName,composable])=>{func[functionName]=(...args)=>{const composition=compose(func,composable(...args));return makeComposable(composition);};});return func;}var patternify2=f=>(pata,patb,pat)=>pata.fmap(a=>b=>f.call(pat,a,b)).appLeft(patb).innerJoin();var patternify3=f=>(pata,patb,patc,pat)=>pata.fmap(a=>b=>c=>f.call(pat,a,b,c)).appLeft(patb).appLeft(patc).innerJoin();var patternify4=f=>(pata,patb,patc,patd,pat)=>pata.fmap(a=>b=>c=>d=>f.call(pat,a,b,c,d)).appLeft(patb).appLeft(patc).appLeft(patd).innerJoin();Pattern$2.prototype.echo=function(...args){args=args.map(reify$2);return patternify3(Pattern$2.prototype._echo)(...args,this);};Pattern$2.prototype.echoWith=function(...args){args=args.map(reify$2);return patternify3(Pattern$2.prototype._echoWith)(...args,this);};Pattern$2.prototype.chunk=function(...args){args=args.map(reify$2);return patternify2(Pattern$2.prototype._chunk)(...args,this);};Pattern$2.prototype.chunkBack=function(...args){args=args.map(reify$2);return patternify2(Pattern$2.prototype._chunkBack)(...args,this);};Pattern$2.prototype.loopAt=function(...args){args=args.map(reify$2);return patternify2(Pattern$2.prototype._loopAt)(...args,this);};Pattern$2.prototype.zoom=function(...args){args=args.map(reify$2);return patternify2(Pattern$2.prototype._zoom)(...args,this);};Pattern$2.prototype.compress=function(...args){args=args.map(reify$2);return patternify2(Pattern$2.prototype._compress)(...args,this);};Pattern$2.prototype.outside=function(...args){args=args.map(reify$2);return patternify2(Pattern$2.prototype._outside)(...args,this);};Pattern$2.prototype.inside=function(...args){args=args.map(reify$2);return patternify2(Pattern$2.prototype._inside)(...args,this);};Pattern$2.prototype.bootstrap=function(){const bootstrapped=Object.fromEntries(Object.entries(Pattern$2.prototype.composable).map(([functionName,composable])=>{if(Pattern$2.prototype[functionName]){Pattern$2.prototype[functionName]=makeComposable(Pattern$2.prototype[functionName]);}return[functionName,curry(composable,makeComposable)];}));this.patternified.forEach(prop=>{Pattern$2.prototype[prop]=function(...args){return this._patternify(Pattern$2.prototype["_"+prop])(...args);};});return bootstrapped;};Pattern$2.prototype.define=(name,func,options={})=>{if(options.composable){Pattern$2.prototype.composable[name]=func;}if(options.patternified){Pattern$2.prototype.patternified=Pattern$2.prototype.patternified.concat([name]);}Pattern$2.prototype.bootstrap();};Pattern$2.prototype.define("hush",pat=>pat.hush(),{patternified:false,composable:true});Pattern$2.prototype.define("bypass",pat=>pat.bypass(on),{patternified:true,composable:true});var controls={};var generic_params=[["s","s","sound"],["f","n","The note or sample number to choose for a synth or sampleset"],["f","note","The note or pitch to play a sound or synth with"],["f","accelerate","a pattern of numbers that speed up (or slow down) samples while they play."],["f","gain","a pattern of numbers that specify volume. Values less than 1 make the sound quieter. Values greater than 1 make the sound louder. For the linear equivalent, see @amp@."],["f","amp","like @gain@, but linear."],["f","attack","a pattern of numbers to specify the attack time (in seconds) of an envelope applied to each sample."],["f","decay",""],["f","sustain",""],["f","release","a pattern of numbers to specify the release time (in seconds) of an envelope applied to each sample."],["f","hold","a pattern of numbers to specify the hold time (in seconds) of an envelope applied to each sample. Only takes effect if `attack` and `release` are also specified."],["f","bandf","A pattern of numbers from 0 to 1. Sets the center frequency of the band-pass filter."],["f","bandq","a pattern of anumbers from 0 to 1. Sets the q-factor of the band-pass filter."],["f","begin","a pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. `0.25` to cut off the first quarter from each sample."],["f","end","the same as `begin`, but cuts the end off samples, shortening them; e.g. `0.75` to cut off the last quarter of each sample."],["f","loop","loops the sample (from `begin` to `end`) the specified number of times."],["f","legato","controls the amount of overlap between two adjacent sounds"],["f","crush","bit crushing, a pattern of numbers from 1 (for drastic reduction in bit-depth) to 16 (for barely no reduction)."],["f","coarse","fake-resampling, a pattern of numbers for lowering the sample rate, i.e. 1 for original 2 for half, 3 for a third and so on."],["i","channel","choose the channel the pattern is sent to in superdirt"],["i","cut","In the style of classic drum-machines, `cut` will stop a playing sample as soon as another samples with in same cutgroup is to be played. An example would be an open hi-hat followed by a closed one, essentially muting the open."],["f","cutoff","a pattern of numbers from 0 to 1. Applies the cutoff frequency of the low-pass filter."],["f","hcutoff","a pattern of numbers from 0 to 1. Applies the cutoff frequency of the high-pass filter. Also has alias @hpf@"],["f","hresonance","a pattern of numbers from 0 to 1. Applies the resonance of the high-pass filter. Has alias @hpq@"],["f","resonance","a pattern of numbers from 0 to 1. Specifies the resonance of the low-pass filter."],["f","djf","DJ filter, below 0.5 is low pass filter, above is high pass filter."],["f","delay","a pattern of numbers from 0 to 1. Sets the level of the delay signal."],["f","delayfeedback","a pattern of numbers from 0 to 1. Sets the amount of delay feedback."],["f","delaytime","a pattern of numbers from 0 to 1. Sets the length of the delay."],["f","lock","A pattern of numbers. Specifies whether delaytime is calculated relative to cps. When set to 1, delaytime is a direct multiple of a cycle."],["f","detune",""],["f","dry","when set to `1` will disable all reverb for this pattern. See `room` and `size` for more information about reverb."],["f","fadeTime","Used when using begin/end or chop/striate and friends, to change the fade out time of the 'grain' envelope."],["f","fadeInTime","As with fadeTime, but controls the fade in time of the grain envelope. Not used if the grain begins at position 0 in the sample."],["f","freq",""],["f","gate",""],["f","leslie",""],["f","lrate",""],["f","lsize",""],["f","degree",""],["f","mtranspose",""],["f","ctranspose",""],["f","harmonic",""],["f","stepsPerOctave",""],["f","octaveR",""],["f","nudge","Nudges events into the future by the specified number of seconds. Negative numbers work up to a point as well (due to internal latency)"],["i","octave",""],["f","offset",""],["i","orbit","a pattern of numbers. An `orbit` is a global parameter context for patterns. Patterns with the same orbit will share hardware output bus offset and global effects, e.g. reverb and delay. The maximum number of orbits is specified in the superdirt startup, numbers higher than maximum will wrap around."],["f","overgain",""],["f","overshape",""],["f","pan","a pattern of numbers between 0 and 1, from left to right (assuming stereo), once round a circle (assuming multichannel)"],["f","panspan","a pattern of numbers between -inf and inf, which controls how much multichannel output is fanned out (negative is backwards ordering)"],["f","pansplay","a pattern of numbers between 0.0 and 1.0, which controls the multichannel spread range (multichannel only)"],["f","panwidth","a pattern of numbers between 0.0 and inf, which controls how much each channel is distributed over neighbours (multichannel only)"],["f","panorient","a pattern of numbers between -1.0 and 1.0, which controls the relative position of the centre pan in a pair of adjacent speakers (multichannel only)"],["f","rate","used in SuperDirt softsynths as a control rate or 'speed'"],["f","slide",""],["f","semitone",""],["f","velocity",""],["f","voice",""],["f","room","a pattern of numbers from 0 to 1. Sets the level of reverb."],["f","size","a pattern of numbers from 0 to 1. Sets the perceptual size (reverb time) of the `room` to be used in reverb."],["f","shape","wave shaping distortion, a pattern of numbers from 0 for no distortion up to 1 for loads of distortion."],["f","speed","a pattern of numbers which changes the speed of sample playback, i.e. a cheap way of changing pitch. Negative values will play the sample backwards!"],["s","unit",'used in conjunction with `speed`, accepts values of "r" (rate, default behavior), "c" (cycles), or "s" (seconds). Using `unit "c"` means `speed` will be interpreted in units of cycles, e.g. `speed "1"` means samples will be stretched to fill a cycle. Using `unit "s"` means the playback speed will be adjusted so that the duration is the number of seconds specified by `speed`.'],["f","squiz",""],["f","stutterdepth",""],["f","stuttertime",""],["f","timescale",""],["f","timescalewin",""],["s","vowel","formant filter to make things sound like vowels, a pattern of either `a`, `e`, `i`, `o` or `u`. Use a rest (`~`) for no effect."],["f","waveloss",""],["f","dur",""],["f","expression",""],["f","sustainpedal",""],["f","tremolodepth","Tremolo Audio DSP effect | params are 'tremolorate' and 'tremolodepth'"],["f","tremolorate","Tremolo Audio DSP effect | params are 'tremolorate' and 'tremolodepth'"],["f","phaserdepth","Phaser Audio DSP effect | params are 'phaserrate' and 'phaserdepth'"],["f","phaserrate","Phaser Audio DSP effect | params are 'phaserrate' and 'phaserdepth'"],["f","fshift","frequency shifter"],["f","fshiftnote","frequency shifter"],["f","fshiftphase","frequency shifter"],["f","triode","tube distortion"],["f","krush","shape/bass enhancer"],["f","kcutoff",""],["f","octer","octaver effect"],["f","octersub","octaver effect"],["f","octersubsub","octaver effect"],["f","ring","ring modulation"],["f","ringf","ring modulation"],["f","ringdf","ring modulation"],["f","distort","noisy fuzzy distortion"],["f","freeze","Spectral freeze"],["f","xsdelay",""],["f","tsdelay",""],["f","real","Spectral conform"],["f","imag",""],["f","enhance","Spectral enhance"],["f","partials",""],["f","comb","Spectral comb"],["f","smear","Spectral smear"],["f","scram","Spectral scramble"],["f","binshift","Spectral binshift"],["f","hbrick","High pass sort of spectral filter"],["f","lbrick","Low pass sort of spectral filter"],["f","midichan",""],["f","control",""],["f","ccn",""],["f","ccv",""],["f","polyTouch",""],["f","midibend",""],["f","miditouch",""],["f","ctlNum",""],["f","frameRate",""],["f","frames",""],["f","hours",""],["s","midicmd",""],["f","minutes",""],["f","progNum",""],["f","seconds",""],["f","songPtr",""],["f","uid",""],["f","val",""],["f","cps",""],["f","clip",""]];var _name=(name,...pats)=>sequence$1(...pats).withValue(x=>({[name]:x}));var _setter=(func,name)=>function(...pats){if(!pats.length){return this.fmap(value=>({[name]:value}));}return this.set(func(...pats));};generic_params.forEach(([type,name,description])=>{controls[name]=(...pats)=>_name(name,...pats);Pattern$2.prototype[name]=_setter(controls[name],name);});controls.createParam=name=>{const func=(...pats)=>_name(name,...pats);Pattern$2.prototype[name]=_setter(func,name);return(...pats)=>_name(name,...pats);};controls.createParams=(...names)=>names.reduce((acc,name)=>Object.assign(acc,{[name]:createParam(name)}),{});function bjorklund(slots,pulses){var pattern=[],count=[],remainder=[pulses],divisor=slots-pulses,level=0,build_pattern=function(lv){if(lv==-1){pattern.push(0);}else if(lv==-2){pattern.push(1);}else{for(var x=0;x1){count.push(Math.floor(divisor/remainder[level]));remainder.push(divisor%remainder[level]);divisor=remainder[level];level++;}count.push(divisor);build_pattern(level);return pattern.reverse();}var bjork=function(m,k){if(m>k)return bjorklund(m,k);else return bjorklund(k,m);};var euclid=(pulses,steps,rotation=0)=>{const b=bjork(steps,pulses);if(rotation){return rotate(b,-rotation);}return b;};Pattern$2.prototype.euclid=function(pulses,steps,rotation=0){return this.struct(euclid(pulses,steps,rotation));};Pattern$2.prototype.euclidLegato=function(pulses,steps,rotation=0){const bin_pat=euclid(pulses,steps,rotation);const firstOne=bin_pat.indexOf(1);const gapless=rotate(bin_pat,firstOne).join("").split("1").slice(1).map(s=>[s.length+1,true]);return this.struct(timeCat$1(...gapless)).late(fraction(firstOne).div(steps));};function steady(value){return new Pattern$2(state=>[new Hap(void 0,state.span,value)]);}var signal=func=>{const query=state=>[new Hap(void 0,state.span,func(state.span.midpoint()))];return new Pattern$2(query);};var isaw=signal(t2=>1-t2%1);var isaw2=isaw._toBipolar();var saw=signal(t2=>t2%1);var saw2=saw._toBipolar();var sine2=signal(t2=>Math.sin(Math.PI*2*t2));var sine=sine2._fromBipolar();var cosine=sine._early(fraction(1).div(4));var cosine2=sine2._early(fraction(1).div(4));var square=signal(t2=>Math.floor(t2*2%2));var square2=square._toBipolar();var tri=_fastcat(isaw,saw);var tri2=_fastcat(isaw2,saw2);var time=signal(id);var xorwise=x=>{const a=x<<13^x;const b=a>>17^a;return b<<5^b;};var _frac=x=>x-Math.trunc(x);var timeToIntSeed=x=>xorwise(Math.trunc(_frac(x/300)*536870912));var intSeedToRand=x=>x%536870912/536870912;var timeToRand=x=>Math.abs(intSeedToRand(timeToIntSeed(x)));var rand=signal(timeToRand);var rand2=rand._toBipolar();var _brandBy=p2=>rand.fmap(x=>xreify$2(pPat).fmap(_brandBy).innerJoin();var brand=_brandBy(0.5);var _irand=i2=>rand.fmap(x=>Math.trunc(x*i2));var irand=ipat=>reify$2(ipat).fmap(_irand).innerJoin();var __chooseWith=(pat,xs)=>{xs=xs.map(reify$2);if(xs.length==0){return silence$1;}return pat.range(0,xs.length).fmap(i2=>xs[Math.floor(i2)]);};var chooseWith=(pat,xs)=>{return __chooseWith(pat,xs).outerJoin();};var chooseInWith=(pat,xs)=>{return __chooseWith(pat,xs).innerJoin();};var choose=(...xs)=>chooseWith(rand,xs);Pattern$2.prototype.choose=function(...xs){return chooseWith(this,xs);};Pattern$2.prototype.choose2=function(...xs){return chooseWith(this._fromBipolar(),xs);};var chooseCycles=(...xs)=>chooseInWith(rand.segment(1),xs);var randcat=chooseCycles;var _wchooseWith=function(pat,...pairs){const values=pairs.map(pair=>reify$2(pair[0]));const weights=[];let accum=0;for(const pair of pairs){accum+=pair[1];weights.push(accum);}const total=accum;const match=function(r){const find=r*total;return values[weights.findIndex(x=>x>find,weights)];};return pat.fmap(match);};var wchooseWith=(...args)=>_wchooseWith(...args).outerJoin();var wchoose=(...pairs)=>wchooseWith(rand,...pairs);var wchooseCycles=(...pairs)=>_wchooseWith(rand,...pairs).innerJoin();var perlinWith=pat=>{const pata=pat.fmap(Math.floor);const patb=pat.fmap(t2=>Math.floor(t2)+1);const smootherStep=x=>6*x**5-15*x**4+10*x**3;const interp=x=>a=>b=>a+smootherStep(x)*(b-a);return pat.sub(pata).fmap(interp).appBoth(pata.fmap(timeToRand)).appBoth(patb.fmap(timeToRand));};var perlin=perlinWith(time);Pattern$2.prototype._degradeByWith=function(withPat,x){return this.fmap(a=>_=>a).appLeft(withPat._filterValues(v=>v>x));};Pattern$2.prototype._degradeBy=function(x){return this._degradeByWith(rand,x);};Pattern$2.prototype.degrade=function(){return this._degradeBy(0.5);};Pattern$2.prototype._undegradeBy=function(x){return this._degradeByWith(rand.fmap(r=>1-r),x);};Pattern$2.prototype.undegrade=function(){return this._undegradeBy(0.5);};Pattern$2.prototype._sometimesBy=function(x,func){return stack$1(this._degradeBy(x),func(this._undegradeBy(1-x)));};Pattern$2.prototype.sometimesBy=function(patx,func){const pat=this;return reify$2(patx).fmap(x=>pat._sometimesBy(x,func)).innerJoin();};Pattern$2.prototype._sometimesByPre=function(x,func){return stack$1(this._degradeBy(x),func(this).undegradeBy(1-x));};Pattern$2.prototype.sometimesByPre=function(patx,func){const pat=this;return reify$2(patx).fmap(x=>pat._sometimesByPre(x,func)).innerJoin();};Pattern$2.prototype.sometimes=function(func){return this._sometimesBy(0.5,func);};Pattern$2.prototype.sometimesPre=function(func){return this._sometimesByPre(0.5,func);};Pattern$2.prototype._someCyclesBy=function(x,func){return stack$1(this._degradeByWith(rand._segment(1),x),func(this._degradeByWith(rand.fmap(r=>1-r)._segment(1),1-x)));};Pattern$2.prototype.someCyclesBy=function(patx,func){const pat=this;return reify$2(patx).fmap(x=>pat._someCyclesBy(x,func)).innerJoin();};Pattern$2.prototype.someCycles=function(func){return this._someCyclesBy(0.5,func);};Pattern$2.prototype.often=function(func){return this.sometimesBy(0.75,func);};Pattern$2.prototype.rarely=function(func){return this.sometimesBy(0.25,func);};Pattern$2.prototype.almostNever=function(func){return this.sometimesBy(0.1,func);};Pattern$2.prototype.almostAlways=function(func){return this.sometimesBy(0.9,func);};Pattern$2.prototype.never=function(func){return this;};Pattern$2.prototype.always=function(func){return func(this);};Pattern$2.prototype.patternified.push("degradeBy","undegradeBy");var synth;try{synth=window==null?void 0:window.speechSynthesis;}catch(err){console.warn("cannot use window: not in browser?");}var allVoices=synth==null?void 0:synth.getVoices();function speak(words,lang,voice){synth.cancel();const utterance=new SpeechSynthesisUtterance(words);utterance.lang=lang;allVoices=synth.getVoices();const voices=allVoices.filter(v=>v.lang.includes(lang));if(typeof voice==="number"){utterance.voice=voices[voice%voices.length];}else if(typeof voice==="string"){utterance.voice=voices.find(voice2=>voice2.name===voice2);}speechSynthesis.speak(utterance);}Pattern$2.prototype._speak=function(lang,voice){return this._withHap(hap=>{const onTrigger=(time2,hap2)=>{speak(hap2.value,lang,voice);};return hap.setContext({...hap.context,onTrigger});});};Pattern$2.prototype.speak=function(lang,voice){return patternify2(Pattern$2.prototype._speak)(reify(lang),reify(voice),this);};var gist=(route,cache=true)=>fetch(`https://gist.githubusercontent.com/${route}?cachebust=${cache?"":Date.now()}`).then(res=>res.text()).then(code=>eval(code));console.log("%c // \uD83C\uDF00 @strudel.cycles/core loaded \uD83C\uDF00","background-color: black;color:white;padding:4px;border-radius:15px");if(globalThis._strudelLoaded){console.warn(`@strudel.cycles/core was loaded more than once... + Please check by running "npm ls @strudel.cycles/core".`); + } + + return is; +} + +function reify$2(thing) { + if (isPattern(thing)) { + return thing; + } + + return pure$1(thing); +} + +function stack$1(...pats) { + pats = pats.map(pat => Array.isArray(pat) ? sequence$1(...pat) : reify$2(pat)); + + const query = state => flatten(pats.map(pat => pat.query(state))); + + return new Pattern$1(query); +} + +function slowcat$1(...pats) { + pats = pats.map(pat => Array.isArray(pat) ? sequence$1(...pat) : reify$2(pat)); + + const query = function (state) { + const span = state.span; + const pat_n = mod(span.begin.sam(), pats.length); + const pat = pats[pat_n]; + + if (!pat) { + return []; + } + + const offset = span.begin.floor().sub(span.begin.div(pats.length).floor()); + return pat.withHapTime(t => t.add(offset)).query(state.setSpan(span.withTime(t => t.sub(offset)))); + }; + + return new Pattern$1(query)._splitQueries(); +} + +function slowcatPrime(...pats) { + pats = pats.map(reify$2); + + const query = function (state) { + const pat_n = Math.floor(state.span.begin) % pats.length; + const pat = pats[pat_n]; + return (pat == null ? void 0 : pat.query(state)) || []; + }; + + return new Pattern$1(query)._splitQueries(); +} + +function _fastcat(...pats) { + return slowcat$1(...pats)._fast(pats.length); +} + +function _cat(...pats) { + return slowcat$1(...pats); +} + +function timeCat$1(...timepats) { + const total = timepats.map(a => a[0]).reduce((a, b) => a.add(b), fraction(0)); + let begin = fraction(0); + const pats = []; + + for (const [time2, pat] of timepats) { + const end = begin.add(time2); + pats.push(reify$2(pat)._compress(begin.div(total), end.div(total))); + begin = end; + } + + return stack$1(...pats); +} + +function sequence$1(...pats) { + return _fastcat(...pats); +} + +function seq(...pats) { + return _fastcat(...pats); +} + +function _sequenceCount(x) { + if (Array.isArray(x)) { + if (x.length == 0) { + return [silence$1, 0]; + } + + if (x.length == 1) { + return _sequenceCount(x[0]); + } + + return [_fastcat(...x.map(a => _sequenceCount(a)[0])), x.length]; + } + + return [reify$2(x), 1]; +} + +function polymeterSteps(steps, ...args) { + const seqs = args.map(a => _sequenceCount(a)); + + if (seqs.length == 0) { + return silence$1; + } + + if (steps == 0) { + steps = seqs[0][1]; + } + + const pats = []; + + for (const seq2 of seqs) { + if (seq2[1] == 0) { + next; + } + + if (steps == seq2[1]) { + pats.push(seq2[0]); + } else { + pats.push(seq2[0]._fast(fraction(steps).div(fraction(seq2[1])))); + } + } + + return stack$1(...pats); +} + +function polymeter(...args) { + return polymeterSteps(0, ...args); +} + +function pm(...args) { + polymeter(...args); +} + +function polyrhythm(...xs) { + const seqs = xs.map(a => sequence$1(a)); + + if (seqs.length == 0) { + return silence$1; + } + + return stack$1(...seqs); +} + +function pr(args) { + polyrhythm(args); +} + +var add = curry((a, pat) => pat.add(a)); +var chop = curry((a, pat) => pat.chop(a)); +var chunk = curry((a, pat) => pat.chunk(a)); +var chunkBack = curry((a, pat) => pat.chunkBack(a)); +var div = curry((a, pat) => pat.div(a)); +var early = curry((a, pat) => pat.early(a)); +var echo = curry((a, b, c, pat) => pat.echo(a, b, c)); +var every = curry((i, f, pat) => pat.every(i, f)); +var fast = curry((a, pat) => pat.fast(a)); + +var inv = pat => pat.inv(); + +var invert = pat => pat.invert(); + +var iter = curry((a, pat) => pat.iter(a)); +var iterBack = curry((a, pat) => pat.iter(a)); +var jux = curry((f, pat) => pat.jux(f)); +var juxBy = curry((by, f, pat) => pat.juxBy(by, f)); +var late = curry((a, pat) => pat.late(a)); +var linger = curry((a, pat) => pat.linger(a)); +var mask = curry((a, pat) => pat.mask(a)); +var mul = curry((a, pat) => pat.mul(a)); +var off = curry((t, f, pat) => pat.off(t, f)); +var ply = curry((a, pat) => pat.ply(a)); +var range = curry((a, b, pat) => pat.range(a, b)); +var range2 = curry((a, b, pat) => pat.range2(a, b)); + +var rev = pat => pat.rev(); + +var slow = curry((a, pat) => pat.slow(a)); +var struct = curry((a, pat) => pat.struct(a)); +var sub = curry((a, pat) => pat.sub(a)); +var superimpose = curry((array, pat) => pat.superimpose(...array)); +var set = curry((a, pat) => pat.set(a)); +var when = curry((binary, f, pat) => pat.when(binary, f)); +Pattern$1.prototype.composable = { + fast: fast, + slow: slow, + early: early, + late: late, + superimpose: superimpose +}; + +function makeComposable(func) { + Object.entries(Pattern$1.prototype.composable).forEach(([functionName, composable]) => { + func[functionName] = (...args) => { + const composition = compose(func, composable(...args)); + return makeComposable(composition); + }; + }); + return func; +} + +var patternify2 = f => (pata, patb, pat) => pata.fmap(a => b => f.call(pat, a, b)).appLeft(patb).innerJoin(); + +var patternify3 = f => (pata, patb, patc, pat) => pata.fmap(a => b => c => f.call(pat, a, b, c)).appLeft(patb).appLeft(patc).innerJoin(); + +var patternify4 = f => (pata, patb, patc, patd, pat) => pata.fmap(a => b => c => d => f.call(pat, a, b, c, d)).appLeft(patb).appLeft(patc).appLeft(patd).innerJoin(); + +Pattern$1.prototype.echo = function (...args) { + args = args.map(reify$2); + return patternify3(Pattern$1.prototype._echo)(...args, this); +}; + +Pattern$1.prototype.echoWith = function (...args) { + args = args.map(reify$2); + return patternify3(Pattern$1.prototype._echoWith)(...args, this); +}; + +Pattern$1.prototype.chunk = function (...args) { + args = args.map(reify$2); + return patternify2(Pattern$1.prototype._chunk)(...args, this); +}; + +Pattern$1.prototype.chunkBack = function (...args) { + args = args.map(reify$2); + return patternify2(Pattern$1.prototype._chunkBack)(...args, this); +}; + +Pattern$1.prototype.loopAt = function (...args) { + args = args.map(reify$2); + return patternify2(Pattern$1.prototype._loopAt)(...args, this); +}; + +Pattern$1.prototype.zoom = function (...args) { + args = args.map(reify$2); + return patternify2(Pattern$1.prototype._zoom)(...args, this); +}; + +Pattern$1.prototype.compress = function (...args) { + args = args.map(reify$2); + return patternify2(Pattern$1.prototype._compress)(...args, this); +}; + +Pattern$1.prototype.outside = function (...args) { + args = args.map(reify$2); + return patternify2(Pattern$1.prototype._outside)(...args, this); +}; + +Pattern$1.prototype.inside = function (...args) { + args = args.map(reify$2); + return patternify2(Pattern$1.prototype._inside)(...args, this); +}; + +Pattern$1.prototype.bootstrap = function () { + const bootstrapped = Object.fromEntries(Object.entries(Pattern$1.prototype.composable).map(([functionName, composable]) => { + if (Pattern$1.prototype[functionName]) { + Pattern$1.prototype[functionName] = makeComposable(Pattern$1.prototype[functionName]); + } + + return [functionName, curry(composable, makeComposable)]; + })); + this.patternified.forEach(prop => { + Pattern$1.prototype[prop] = function (...args) { + return this._patternify(Pattern$1.prototype["_" + prop])(...args); + }; + }); + return bootstrapped; +}; + +Pattern$1.prototype.define = (name, func, options = {}) => { + if (options.composable) { + Pattern$1.prototype.composable[name] = func; + } + + if (options.patternified) { + Pattern$1.prototype.patternified = Pattern$1.prototype.patternified.concat([name]); + } + + Pattern$1.prototype.bootstrap(); +}; + +Pattern$1.prototype.define("hush", pat => pat.hush(), { + patternified: false, + composable: true +}); +Pattern$1.prototype.define("bypass", pat => pat.bypass(on), { + patternified: true, + composable: true +}); +var controls = {}; +var generic_params = [["s", "s", "sound"], ["f", "n", "The note or sample number to choose for a synth or sampleset"], ["f", "note", "The note or pitch to play a sound or synth with"], ["f", "accelerate", "a pattern of numbers that speed up (or slow down) samples while they play."], ["f", "gain", "a pattern of numbers that specify volume. Values less than 1 make the sound quieter. Values greater than 1 make the sound louder. For the linear equivalent, see @amp@."], ["f", "amp", "like @gain@, but linear."], ["f", "attack", "a pattern of numbers to specify the attack time (in seconds) of an envelope applied to each sample."], ["f", "decay", ""], ["f", "sustain", ""], ["f", "release", "a pattern of numbers to specify the release time (in seconds) of an envelope applied to each sample."], ["f", "hold", "a pattern of numbers to specify the hold time (in seconds) of an envelope applied to each sample. Only takes effect if `attack` and `release` are also specified."], ["f", "bandf", "A pattern of numbers from 0 to 1. Sets the center frequency of the band-pass filter."], ["f", "bandq", "a pattern of anumbers from 0 to 1. Sets the q-factor of the band-pass filter."], ["f", "begin", "a pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. `0.25` to cut off the first quarter from each sample."], ["f", "end", "the same as `begin`, but cuts the end off samples, shortening them; e.g. `0.75` to cut off the last quarter of each sample."], ["f", "loop", "loops the sample (from `begin` to `end`) the specified number of times."], ["f", "legato", "controls the amount of overlap between two adjacent sounds"], ["f", "crush", "bit crushing, a pattern of numbers from 1 (for drastic reduction in bit-depth) to 16 (for barely no reduction)."], ["f", "coarse", "fake-resampling, a pattern of numbers for lowering the sample rate, i.e. 1 for original 2 for half, 3 for a third and so on."], ["i", "channel", "choose the channel the pattern is sent to in superdirt"], ["i", "cut", "In the style of classic drum-machines, `cut` will stop a playing sample as soon as another samples with in same cutgroup is to be played. An example would be an open hi-hat followed by a closed one, essentially muting the open."], ["f", "cutoff", "a pattern of numbers from 0 to 1. Applies the cutoff frequency of the low-pass filter."], ["f", "hcutoff", "a pattern of numbers from 0 to 1. Applies the cutoff frequency of the high-pass filter. Also has alias @hpf@"], ["f", "hresonance", "a pattern of numbers from 0 to 1. Applies the resonance of the high-pass filter. Has alias @hpq@"], ["f", "resonance", "a pattern of numbers from 0 to 1. Specifies the resonance of the low-pass filter."], ["f", "djf", "DJ filter, below 0.5 is low pass filter, above is high pass filter."], ["f", "delay", "a pattern of numbers from 0 to 1. Sets the level of the delay signal."], ["f", "delayfeedback", "a pattern of numbers from 0 to 1. Sets the amount of delay feedback."], ["f", "delaytime", "a pattern of numbers from 0 to 1. Sets the length of the delay."], ["f", "lock", "A pattern of numbers. Specifies whether delaytime is calculated relative to cps. When set to 1, delaytime is a direct multiple of a cycle."], ["f", "detune", ""], ["f", "dry", "when set to `1` will disable all reverb for this pattern. See `room` and `size` for more information about reverb."], ["f", "fadeTime", "Used when using begin/end or chop/striate and friends, to change the fade out time of the 'grain' envelope."], ["f", "fadeInTime", "As with fadeTime, but controls the fade in time of the grain envelope. Not used if the grain begins at position 0 in the sample."], ["f", "freq", ""], ["f", "gate", ""], ["f", "leslie", ""], ["f", "lrate", ""], ["f", "lsize", ""], ["f", "degree", ""], ["f", "mtranspose", ""], ["f", "ctranspose", ""], ["f", "harmonic", ""], ["f", "stepsPerOctave", ""], ["f", "octaveR", ""], ["f", "nudge", "Nudges events into the future by the specified number of seconds. Negative numbers work up to a point as well (due to internal latency)"], ["i", "octave", ""], ["f", "offset", ""], ["i", "orbit", "a pattern of numbers. An `orbit` is a global parameter context for patterns. Patterns with the same orbit will share hardware output bus offset and global effects, e.g. reverb and delay. The maximum number of orbits is specified in the superdirt startup, numbers higher than maximum will wrap around."], ["f", "overgain", ""], ["f", "overshape", ""], ["f", "pan", "a pattern of numbers between 0 and 1, from left to right (assuming stereo), once round a circle (assuming multichannel)"], ["f", "panspan", "a pattern of numbers between -inf and inf, which controls how much multichannel output is fanned out (negative is backwards ordering)"], ["f", "pansplay", "a pattern of numbers between 0.0 and 1.0, which controls the multichannel spread range (multichannel only)"], ["f", "panwidth", "a pattern of numbers between 0.0 and inf, which controls how much each channel is distributed over neighbours (multichannel only)"], ["f", "panorient", "a pattern of numbers between -1.0 and 1.0, which controls the relative position of the centre pan in a pair of adjacent speakers (multichannel only)"], ["f", "rate", "used in SuperDirt softsynths as a control rate or 'speed'"], ["f", "slide", ""], ["f", "semitone", ""], ["f", "velocity", ""], ["f", "voice", ""], ["f", "room", "a pattern of numbers from 0 to 1. Sets the level of reverb."], ["f", "size", "a pattern of numbers from 0 to 1. Sets the perceptual size (reverb time) of the `room` to be used in reverb."], ["f", "shape", "wave shaping distortion, a pattern of numbers from 0 for no distortion up to 1 for loads of distortion."], ["f", "speed", "a pattern of numbers which changes the speed of sample playback, i.e. a cheap way of changing pitch. Negative values will play the sample backwards!"], ["s", "unit", 'used in conjunction with `speed`, accepts values of "r" (rate, default behavior), "c" (cycles), or "s" (seconds). Using `unit "c"` means `speed` will be interpreted in units of cycles, e.g. `speed "1"` means samples will be stretched to fill a cycle. Using `unit "s"` means the playback speed will be adjusted so that the duration is the number of seconds specified by `speed`.'], ["f", "squiz", ""], ["f", "stutterdepth", ""], ["f", "stuttertime", ""], ["f", "timescale", ""], ["f", "timescalewin", ""], ["s", "vowel", "formant filter to make things sound like vowels, a pattern of either `a`, `e`, `i`, `o` or `u`. Use a rest (`~`) for no effect."], ["f", "waveloss", ""], ["f", "dur", ""], ["f", "expression", ""], ["f", "sustainpedal", ""], ["f", "tremolodepth", "Tremolo Audio DSP effect | params are 'tremolorate' and 'tremolodepth'"], ["f", "tremolorate", "Tremolo Audio DSP effect | params are 'tremolorate' and 'tremolodepth'"], ["f", "phaserdepth", "Phaser Audio DSP effect | params are 'phaserrate' and 'phaserdepth'"], ["f", "phaserrate", "Phaser Audio DSP effect | params are 'phaserrate' and 'phaserdepth'"], ["f", "fshift", "frequency shifter"], ["f", "fshiftnote", "frequency shifter"], ["f", "fshiftphase", "frequency shifter"], ["f", "triode", "tube distortion"], ["f", "krush", "shape/bass enhancer"], ["f", "kcutoff", ""], ["f", "octer", "octaver effect"], ["f", "octersub", "octaver effect"], ["f", "octersubsub", "octaver effect"], ["f", "ring", "ring modulation"], ["f", "ringf", "ring modulation"], ["f", "ringdf", "ring modulation"], ["f", "distort", "noisy fuzzy distortion"], ["f", "freeze", "Spectral freeze"], ["f", "xsdelay", ""], ["f", "tsdelay", ""], ["f", "real", "Spectral conform"], ["f", "imag", ""], ["f", "enhance", "Spectral enhance"], ["f", "partials", ""], ["f", "comb", "Spectral comb"], ["f", "smear", "Spectral smear"], ["f", "scram", "Spectral scramble"], ["f", "binshift", "Spectral binshift"], ["f", "hbrick", "High pass sort of spectral filter"], ["f", "lbrick", "Low pass sort of spectral filter"], ["f", "midichan", ""], ["f", "control", ""], ["f", "ccn", ""], ["f", "ccv", ""], ["f", "polyTouch", ""], ["f", "midibend", ""], ["f", "miditouch", ""], ["f", "ctlNum", ""], ["f", "frameRate", ""], ["f", "frames", ""], ["f", "hours", ""], ["s", "midicmd", ""], ["f", "minutes", ""], ["f", "progNum", ""], ["f", "seconds", ""], ["f", "songPtr", ""], ["f", "uid", ""], ["f", "val", ""], ["f", "cps", ""], ["f", "clip", ""]]; + +var _name = (name, ...pats) => sequence$1(...pats).withValue(x => ({ + [name]: x +})); + +var _setter = (func, name) => function (...pats) { + if (!pats.length) { + return this.fmap(value => ({ + [name]: value + })); + } + + return this.set(func(...pats)); +}; + +generic_params.forEach(([type, name, description]) => { + controls[name] = (...pats) => _name(name, ...pats); + + Pattern$1.prototype[name] = _setter(controls[name], name); +}); + +controls.createParam = name => { + const func = (...pats) => _name(name, ...pats); + + Pattern$1.prototype[name] = _setter(func, name); + return (...pats) => _name(name, ...pats); +}; + +controls.createParams = (...names) => names.reduce((acc, name) => Object.assign(acc, { + [name]: createParam(name) +}), {}); + +function bjorklund(slots, pulses) { + var pattern = [], + count = [], + remainder = [pulses], + divisor = slots - pulses, + level = 0, + build_pattern = function (lv) { + if (lv == -1) { + pattern.push(0); + } else if (lv == -2) { + pattern.push(1); + } else { + for (var x = 0; x < count[lv]; x++) { + build_pattern(lv - 1); + } + + if (remainder[lv]) { + build_pattern(lv - 2); + } + } + }; + + while (remainder[level] > 1) { + count.push(Math.floor(divisor / remainder[level])); + remainder.push(divisor % remainder[level]); + divisor = remainder[level]; + level++; + } + + count.push(divisor); + build_pattern(level); + return pattern.reverse(); +} + +var bjork = function (m, k) { + if (m > k) return bjorklund(m, k);else return bjorklund(k, m); +}; + +var euclid = (pulses, steps, rotation = 0) => { + const b = bjork(steps, pulses); + + if (rotation) { + return rotate(b, -rotation); + } + + return b; +}; + +Pattern$1.prototype.euclid = function (pulses, steps, rotation = 0) { + return this.struct(euclid(pulses, steps, rotation)); +}; + +Pattern$1.prototype.euclidLegato = function (pulses, steps, rotation = 0) { + const bin_pat = euclid(pulses, steps, rotation); + const firstOne = bin_pat.indexOf(1); + const gapless = rotate(bin_pat, firstOne).join("").split("1").slice(1).map(s => [s.length + 1, true]); + return this.struct(timeCat$1(...gapless)).late(fraction(firstOne).div(steps)); +}; + +function steady(value) { + return new Pattern$1(state => [new Hap(void 0, state.span, value)]); +} + +var signal = func => { + const query = state => [new Hap(void 0, state.span, func(state.span.midpoint()))]; + + return new Pattern$1(query); +}; + +var isaw = signal(t => 1 - t % 1); + +var isaw2 = isaw._toBipolar(); + +var saw = signal(t => t % 1); + +var saw2 = saw._toBipolar(); + +var sine2 = signal(t => Math.sin(Math.PI * 2 * t)); + +var sine = sine2._fromBipolar(); + +var cosine = sine._early(fraction(1).div(4)); + +var cosine2 = sine2._early(fraction(1).div(4)); + +var square = signal(t => Math.floor(t * 2 % 2)); + +var square2 = square._toBipolar(); + +var tri = _fastcat(isaw, saw); + +var tri2 = _fastcat(isaw2, saw2); + +var time = signal(id); + +var xorwise = x => { + const a = x << 13 ^ x; + const b = a >> 17 ^ a; + return b << 5 ^ b; +}; + +var _frac = x => x - Math.trunc(x); + +var timeToIntSeed = x => xorwise(Math.trunc(_frac(x / 300) * 536870912)); + +var intSeedToRand = x => x % 536870912 / 536870912; + +var timeToRand = x => Math.abs(intSeedToRand(timeToIntSeed(x))); + +var rand = signal(timeToRand); + +var rand2 = rand._toBipolar(); + +var _brandBy = p => rand.fmap(x => x < p); + +var brandBy = pPat => reify$2(pPat).fmap(_brandBy).innerJoin(); + +var brand = _brandBy(0.5); + +var _irand = i => rand.fmap(x => Math.trunc(x * i)); + +var irand = ipat => reify$2(ipat).fmap(_irand).innerJoin(); + +var __chooseWith = (pat, xs) => { + xs = xs.map(reify$2); + + if (xs.length == 0) { + return silence$1; + } + + return pat.range(0, xs.length).fmap(i => xs[Math.floor(i)]); +}; + +var chooseWith = (pat, xs) => { + return __chooseWith(pat, xs).outerJoin(); +}; + +var chooseInWith = (pat, xs) => { + return __chooseWith(pat, xs).innerJoin(); +}; + +var choose = (...xs) => chooseWith(rand, xs); + +Pattern$1.prototype.choose = function (...xs) { + return chooseWith(this, xs); +}; + +Pattern$1.prototype.choose2 = function (...xs) { + return chooseWith(this._fromBipolar(), xs); +}; + +var chooseCycles = (...xs) => chooseInWith(rand.segment(1), xs); + +var randcat = chooseCycles; + +var _wchooseWith = function (pat, ...pairs) { + const values = pairs.map(pair => reify$2(pair[0])); + const weights = []; + let accum = 0; + + for (const pair of pairs) { + accum += pair[1]; + weights.push(accum); + } + + const total = accum; + + const match = function (r) { + const find = r * total; + return values[weights.findIndex(x => x > find, weights)]; + }; + + return pat.fmap(match); +}; + +var wchooseWith = (...args) => _wchooseWith(...args).outerJoin(); + +var wchoose = (...pairs) => wchooseWith(rand, ...pairs); + +var wchooseCycles = (...pairs) => _wchooseWith(rand, ...pairs).innerJoin(); + +var perlinWith = pat => { + const pata = pat.fmap(Math.floor); + const patb = pat.fmap(t => Math.floor(t) + 1); + + const smootherStep = x => 6 * x ** 5 - 15 * x ** 4 + 10 * x ** 3; + + const interp = x => a => b => a + smootherStep(x) * (b - a); + + return pat.sub(pata).fmap(interp).appBoth(pata.fmap(timeToRand)).appBoth(patb.fmap(timeToRand)); +}; + +var perlin = perlinWith(time); + +Pattern$1.prototype._degradeByWith = function (withPat, x) { + return this.fmap(a => _ => a).appLeft(withPat._filterValues(v => v > x)); +}; + +Pattern$1.prototype._degradeBy = function (x) { + return this._degradeByWith(rand, x); +}; + +Pattern$1.prototype.degrade = function () { + return this._degradeBy(0.5); +}; + +Pattern$1.prototype._undegradeBy = function (x) { + return this._degradeByWith(rand.fmap(r => 1 - r), x); +}; + +Pattern$1.prototype.undegrade = function () { + return this._undegradeBy(0.5); +}; + +Pattern$1.prototype._sometimesBy = function (x, func) { + return stack$1(this._degradeBy(x), func(this._undegradeBy(1 - x))); +}; + +Pattern$1.prototype.sometimesBy = function (patx, func) { + const pat = this; + return reify$2(patx).fmap(x => pat._sometimesBy(x, func)).innerJoin(); +}; + +Pattern$1.prototype._sometimesByPre = function (x, func) { + return stack$1(this._degradeBy(x), func(this).undegradeBy(1 - x)); +}; + +Pattern$1.prototype.sometimesByPre = function (patx, func) { + const pat = this; + return reify$2(patx).fmap(x => pat._sometimesByPre(x, func)).innerJoin(); +}; + +Pattern$1.prototype.sometimes = function (func) { + return this._sometimesBy(0.5, func); +}; + +Pattern$1.prototype.sometimesPre = function (func) { + return this._sometimesByPre(0.5, func); +}; + +Pattern$1.prototype._someCyclesBy = function (x, func) { + return stack$1(this._degradeByWith(rand._segment(1), x), func(this._degradeByWith(rand.fmap(r => 1 - r)._segment(1), 1 - x))); +}; + +Pattern$1.prototype.someCyclesBy = function (patx, func) { + const pat = this; + return reify$2(patx).fmap(x => pat._someCyclesBy(x, func)).innerJoin(); +}; + +Pattern$1.prototype.someCycles = function (func) { + return this._someCyclesBy(0.5, func); +}; + +Pattern$1.prototype.often = function (func) { + return this.sometimesBy(0.75, func); +}; + +Pattern$1.prototype.rarely = function (func) { + return this.sometimesBy(0.25, func); +}; + +Pattern$1.prototype.almostNever = function (func) { + return this.sometimesBy(0.1, func); +}; + +Pattern$1.prototype.almostAlways = function (func) { + return this.sometimesBy(0.9, func); +}; + +Pattern$1.prototype.never = function (func) { + return this; +}; + +Pattern$1.prototype.always = function (func) { + return func(this); +}; + +Pattern$1.prototype.patternified.push("degradeBy", "undegradeBy"); +var synth; + +try { + synth = window == null ? void 0 : window.speechSynthesis; +} catch (err) { + console.warn("cannot use window: not in browser?"); +} + +var allVoices = synth == null ? void 0 : synth.getVoices(); + +function speak(words, lang, voice) { + synth.cancel(); + const utterance = new SpeechSynthesisUtterance(words); + utterance.lang = lang; + allVoices = synth.getVoices(); + const voices = allVoices.filter(v => v.lang.includes(lang)); + + if (typeof voice === "number") { + utterance.voice = voices[voice % voices.length]; + } else if (typeof voice === "string") { + utterance.voice = voices.find(voice2 => voice2.name === voice2); + } + + speechSynthesis.speak(utterance); +} + +Pattern$1.prototype._speak = function (lang, voice) { + return this._withHap(hap => { + const onTrigger = (time2, hap2) => { + speak(hap2.value, lang, voice); + }; + + return hap.setContext({ ...hap.context, + onTrigger + }); + }); +}; + +Pattern$1.prototype.speak = function (lang, voice) { + return patternify2(Pattern$1.prototype._speak)(reify(lang), reify(voice), this); +}; + +var gist = (route, cache = true) => fetch(`https://gist.githubusercontent.com/${route}?cachebust=${cache ? "" : Date.now()}`).then(res => res.text()).then(code => eval(code)); + +console.log("%c // \uD83C\uDF00 @strudel.cycles/core loaded \uD83C\uDF00", "background-color: black;color:white;padding:4px;border-radius:15px"); + +if (globalThis._strudelLoaded) { + console.warn(`@strudel.cycles/core was loaded more than once... This might happen when you have multiple versions of strudel installed. -Please check with "npm ls @strudel.cycles/core".`);}globalThis._strudelLoaded=true;var strudel=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,Fraction:fraction,gist:gist,Hap:Hap,Pattern:Pattern$2,silence:silence$1,pure:pure$1,isPattern:isPattern,reify:reify$2,stack:stack$1,slowcat:slowcat$1,slowcatPrime:slowcatPrime,fastcat:_fastcat,cat:_cat,timeCat:timeCat$1,sequence:sequence$1,seq:seq$2,polymeterSteps:polymeterSteps,polymeter:polymeter,pm:pm,polyrhythm:polyrhythm,pr:pr,add:add,chop:chop,chunk:chunk,chunkBack:chunkBack,div:div,early:early,echo:echo,every:every,fast:fast,inv:inv,invert:invert,iter:iter,iterBack:iterBack,jux:jux,juxBy:juxBy,late:late,linger:linger,mask:mask,mul:mul,off:off,ply:ply,range:range,range2:range2,rev:rev,slow:slow,struct:struct,sub:sub,superimpose:superimpose,set:set,when:when,makeComposable:makeComposable,patternify2:patternify2,patternify3:patternify3,patternify4:patternify4,steady:steady,signal:signal,isaw:isaw,isaw2:isaw2,saw:saw,saw2:saw2,sine2:sine2,sine:sine,cosine:cosine,cosine2:cosine2,square:square,square2:square2,tri:tri,tri2:tri2,time:time,rand:rand,rand2:rand2,_brandBy:_brandBy,brandBy:brandBy,brand:brand,_irand:_irand,irand:irand,__chooseWith:__chooseWith,chooseWith:chooseWith,chooseInWith:chooseInWith,choose:choose,chooseCycles:chooseCycles,randcat:randcat,wchoose:wchoose,wchooseCycles:wchooseCycles,perlinWith:perlinWith,perlin:perlin,State:State,TimeSpan:TimeSpan,isNote:isNote,tokenizeNote:tokenizeNote,toMidi:toMidi,fromMidi:fromMidi,getFreq:getFreq,midi2note:midi2note,mod:mod,getPlayableNoteValue:getPlayableNoteValue,getFrequency:getFrequency,rotate:rotate,pipe:pipe,compose:compose,removeUndefineds:removeUndefineds,flatten:flatten,id:id,constant:constant,listRange:listRange,curry:curry},Symbol.toStringTag,{value:"Module"}));var dist$b={};var tokenizer$1={};var utils$3={};var unicode$5={};var idContinueBool_1$2;var idContinueLargeRegex_1$2;var idStartBool_1$2;var idStartLargeRegex_1$2;var whitespaceBool_1$2;var whitespaceArray_1$2;Object.defineProperty(unicode$5,"__esModule",{value:true});whitespaceArray_1$2=unicode$5.whitespaceArray=[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];whitespaceBool_1$2=unicode$5.whitespaceBool=[false,false,false,false,false,false,false,false,false,true,false,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false];idStartLargeRegex_1$2=unicode$5.idStartLargeRegex=/^[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\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\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\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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-\u2C2E\u2C30-\u2C5E\u2C60-\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-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]$/;idStartBool_1$2=unicode$5.idStartBool=[false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,true,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false];idContinueLargeRegex_1$2=unicode$5.idContinueLargeRegex=/^[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]$/;idContinueBool_1$2=unicode$5.idContinueBool=[false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,true,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false];var unicode$4=/* @__PURE__ */_mergeNamespaces({__proto__:null,get whitespaceArray(){return whitespaceArray_1$2;},get whitespaceBool(){return whitespaceBool_1$2;},get idStartLargeRegex(){return idStartLargeRegex_1$2;},get idStartBool(){return idStartBool_1$2;},get idContinueLargeRegex(){return idContinueLargeRegex_1$2;},get idContinueBool(){return idContinueBool_1$2;},"default":unicode$5},[unicode$5]);var require$$0$a=/* @__PURE__ */getAugmentedNamespace(unicode$4);Object.defineProperty(utils$3,"__esModule",{value:true});var isStrictModeReservedWord_1=utils$3.isStrictModeReservedWord=isStrictModeReservedWord;var isWhiteSpace_1=utils$3.isWhiteSpace=isWhiteSpace;var isLineTerminator_1=utils$3.isLineTerminator=isLineTerminator;var isIdentifierStart_1=utils$3.isIdentifierStart=isIdentifierStart$1;var isIdentifierPart_1=utils$3.isIdentifierPart=isIdentifierPart$1;var isDecimalDigit_1=utils$3.isDecimalDigit=isDecimalDigit;var getHexValue_1=utils$3.getHexValue=getHexValue;var _unicode$2=require$$0$a;var strictReservedWords=["null","true","false","implements","interface","package","private","protected","public","static","let","if","in","do","var","for","new","try","this","else","case","void","with","enum","while","break","catch","throw","const","yield","class","super","return","typeof","delete","switch","export","import","default","finally","extends","function","continue","debugger","instanceof"];function isStrictModeReservedWord(id2){return strictReservedWords.indexOf(id2)!==-1;}function isWhiteSpace(ch){return ch<128?_unicode$2.whitespaceBool[ch]:ch===160||ch>5759&&_unicode$2.whitespaceArray.indexOf(ch)!==-1;}function isLineTerminator(ch){return ch===10||ch===13||ch===8232||ch===8233;}function isIdentifierStart$1(ch){return ch<128?_unicode$2.idStartBool[ch]:_unicode$2.idStartLargeRegex.test(String.fromCodePoint(ch));}function isIdentifierPart$1(ch){return ch<128?_unicode$2.idContinueBool[ch]:_unicode$2.idContinueLargeRegex.test(String.fromCodePoint(ch));}function isDecimalDigit(ch){return ch>=48&&ch<=57;}function getHexValue(rune){if(rune>="0"&&rune<="9"){return rune.charCodeAt(0)-48;}if(rune>="a"&&rune<="f"){return rune.charCodeAt(0)-87;}if(rune>="A"&&rune<="F"){return rune.charCodeAt(0)-55;}return-1;}var utils$2=/* @__PURE__ */_mergeNamespaces({__proto__:null,isStrictModeReservedWord:isStrictModeReservedWord_1,isWhiteSpace:isWhiteSpace_1,isLineTerminator:isLineTerminator_1,isIdentifierStart:isIdentifierStart_1,isIdentifierPart:isIdentifierPart_1,isDecimalDigit:isDecimalDigit_1,getHexValue:getHexValue_1,"default":utils$3},[utils$3]);var require$$3$5=/* @__PURE__ */getAugmentedNamespace(utils$2);var errors$1={};var ErrorMessages_1;Object.defineProperty(errors$1,"__esModule",{value:true});ErrorMessages_1=errors$1.ErrorMessages={UNEXPECTED_TOKEN:function UNEXPECTED_TOKEN(id2){return"Unexpected token "+JSON.stringify(id2);},UNEXPECTED_ILLEGAL_TOKEN:function UNEXPECTED_ILLEGAL_TOKEN(id2){return"Unexpected "+JSON.stringify(id2);},UNEXPECTED_ESCAPED_KEYWORD:"Unexpected escaped keyword",UNEXPECTED_NUMBER:"Unexpected number",UNEXPECTED_STRING:"Unexpected string",UNEXPECTED_IDENTIFIER:"Unexpected identifier",UNEXPECTED_RESERVED_WORD:"Unexpected reserved word",UNEXPECTED_TEMPLATE:"Unexpected template",UNEXPECTED_EOS:"Unexpected end of input",UNEXPECTED_LINE_TERMINATOR:"Unexpected line terminator",UNEXPECTED_COMMA_AFTER_REST:"Unexpected comma after rest",UNEXPECTED_REST_PARAMETERS_INITIALIZATION:"Rest parameter may not have a default initializer",NEWLINE_AFTER_THROW:"Illegal newline after throw",UNTERMINATED_REGEXP:"Invalid regular expression: missing /",INVALID_LAST_REST_PARAMETER:"Rest parameter must be last formal parameter",INVALID_REST_PARAMETERS_INITIALIZATION:"Rest parameter may not have a default initializer",INVALID_REGEXP_FLAGS:"Invalid regular expression flags",INVALID_REGEX:"Invalid regular expression",INVALID_LHS_IN_ASSIGNMENT:"Invalid left-hand side in assignment",INVALID_LHS_IN_BINDING:"Invalid left-hand side in binding",INVALID_LHS_IN_FOR_IN:"Invalid left-hand side in for-in",INVALID_LHS_IN_FOR_OF:"Invalid left-hand side in for-of",INVALID_LHS_IN_FOR_AWAIT:"Invalid left-hand side in for-await",INVALID_UPDATE_OPERAND:"Increment/decrement target must be an identifier or member expression",INVALID_EXPONENTIATION_LHS:"Unary expressions as the left operand of an exponentation expression must be disambiguated with parentheses",MULTIPLE_DEFAULTS_IN_SWITCH:"More than one default clause in switch statement",NO_CATCH_OR_FINALLY:"Missing catch or finally after try",ILLEGAL_RETURN:"Illegal return statement",ILLEGAL_ARROW_FUNCTION_PARAMS:"Illegal arrow function parameter list",INVALID_ASYNC_PARAMS:"Async function parameters must not contain await expressions",INVALID_VAR_INIT_FOR_IN:"Invalid variable declaration in for-in statement",INVALID_VAR_INIT_FOR_OF:"Invalid variable declaration in for-of statement",INVALID_VAR_INIT_FOR_AWAIT:"Invalid variable declaration in for-await statement",UNINITIALIZED_BINDINGPATTERN_IN_FOR_INIT:"Binding pattern appears without initializer in for statement init",ILLEGAL_PROPERTY:"Illegal property initializer",INVALID_ID_BINDING_STRICT_MODE:function INVALID_ID_BINDING_STRICT_MODE(id2){return"The identifier "+JSON.stringify(id2)+" must not be in binding position in strict mode";},INVALID_ID_IN_LABEL_STRICT_MODE:function INVALID_ID_IN_LABEL_STRICT_MODE(id2){return"The identifier "+JSON.stringify(id2)+" must not be in label position in strict mode";},INVALID_ID_IN_EXPRESSION_STRICT_MODE:function INVALID_ID_IN_EXPRESSION_STRICT_MODE(id2){return"The identifier "+JSON.stringify(id2)+" must not be in expression position in strict mode";},INVALID_CALL_TO_SUPER:'Calls to super must be in the "constructor" method of a class expression or class declaration that has a superclass',INVALID_DELETE_STRICT_MODE:"Identifier expressions must not be deleted in strict mode",DUPLICATE_BINDING:function DUPLICATE_BINDING2(id2){return"Duplicate binding "+JSON.stringify(id2);},ILLEGAL_ID_IN_LEXICAL_DECLARATION:function ILLEGAL_ID_IN_LEXICAL_DECLARATION(id2){return"Lexical declarations must not have a binding named "+JSON.stringify(id2);},UNITIALIZED_CONST:"Constant lexical declarations must have an initialiser",ILLEGAL_LABEL_IN_BODY:function ILLEGAL_LABEL_IN_BODY(stmt){return"The body of a "+stmt+" statement must not be a labeled function declaration";},ILLEGEAL_LABEL_IN_IF:"The consequent of an if statement must not be a labeled function declaration",ILLEGAL_LABEL_IN_ELSE:"The alternate of an if statement must not be a labeled function declaration",ILLEGAL_CONTINUE_WITHOUT_ITERATION_WITH_ID:function ILLEGAL_CONTINUE_WITHOUT_ITERATION_WITH_ID(id2){return"Continue statement must be nested within an iteration statement with label "+JSON.stringify(id2);},ILLEGAL_CONTINUE_WITHOUT_ITERATION:"Continue statement must be nested within an iteration statement",ILLEGAL_BREAK_WITHOUT_ITERATION_OR_SWITCH:"Break statement must be nested within an iteration statement or a switch statement",ILLEGAL_WITH_STRICT_MODE:"Strict mode code must not include a with statement",ILLEGAL_ACCESS_SUPER_MEMBER:"Member access on super must be in a method",ILLEGAL_SUPER_CALL:'Calls to super must be in the "constructor" method of a class expression or class declaration that has a superclass',DUPLICATE_LABEL_DECLARATION:function DUPLICATE_LABEL_DECLARATION(label){return"Label "+JSON.stringify(label)+" has already been declared";},ILLEGAL_BREAK_WITHIN_LABEL:function ILLEGAL_BREAK_WITHIN_LABEL(label){return"Break statement must be nested within a statement with label "+JSON.stringify(label);},ILLEGAL_YIELD_EXPRESSIONS:function ILLEGAL_YIELD_EXPRESSIONS(paramType){return paramType+" parameters must not contain yield expressions";},ILLEGAL_YIELD_IDENTIFIER:'"yield" may not be used as an identifier in this context',ILLEGAL_AWAIT_IDENTIFIER:'"await" may not be used as an identifier in this context',DUPLICATE_CONSTRUCTOR:"Duplicate constructor method in class",ILLEGAL_CONSTRUCTORS:"Constructors cannot be async, generators, getters or setters",ILLEGAL_STATIC_CLASS_NAME:'Static class methods cannot be named "prototype"',NEW_TARGET_ERROR:"new.target must be within function (but not arrow expression) code",DUPLICATE_EXPORT:function DUPLICATE_EXPORT(id2){return"Duplicate export "+JSON.stringify(id2);},UNDECLARED_BINDING:function UNDECLARED_BINDING(id2){return"Exported binding "+JSON.stringify(id2)+" is not declared";},DUPLICATE_PROPTO_PROP:"Duplicate __proto__ property in object literal not allowed",ILLEGAL_LABEL_FUNC_DECLARATION:"Labeled FunctionDeclarations are disallowed in strict mode",ILLEGAL_FUNC_DECL_IF:"FunctionDeclarations in IfStatements are disallowed in strict mode",ILLEGAL_USE_STRICT:'Functions with non-simple parameter lists may not contain a "use strict" directive',ILLEGAL_EXPORTED_NAME:"Names of variables used in an export specifier from the current module must be identifiers",NO_OCTALS_IN_TEMPLATES:"Template literals may not contain octal escape sequences",NO_AWAIT_IN_ASYNC_PARAMS:'Async arrow parameters may not contain "await"'};var errors=/* @__PURE__ */_mergeNamespaces({__proto__:null,get ErrorMessages(){return ErrorMessages_1;},"default":errors$1},[errors$1]);var require$$2$5=/* @__PURE__ */getAugmentedNamespace(errors);var TokenClass_1;var TokenType_1;Object.defineProperty(tokenizer$1,"__esModule",{value:true});var JsError_1=tokenizer$1.JsError=TokenType_1=tokenizer$1.TokenType=TokenClass_1=tokenizer$1.TokenClass=void 0;var _slicedToArray=function(){function sliceIterator(arr,i2){var _arr=[];var _n=true;var _d=false;var _e=void 0;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i2&&_arr.length===i2)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"])_i["return"]();}finally{if(_d)throw _e;}}return _arr;}return function(arr,i2){if(Array.isArray(arr)){return arr;}else if(Symbol.iterator in Object(arr)){return sliceIterator(arr,i2);}else{throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();var _createClass$e=function(){function defineProperties(target,props){for(var i2=0;i2"},Ident:{name:"Identifier",isIdentifierName:true},Keyword:{name:"Keyword",isIdentifierName:true},NumericLiteral:{name:"Numeric"},TemplateElement:{name:"Template"},Punctuator:{name:"Punctuator"},StringLiteral:{name:"String"},RegularExpression:{name:"RegularExpression"},Illegal:{name:"Illegal"}};var TokenType=TokenType_1=tokenizer$1.TokenType={EOS:{klass:TokenClass.Eof,name:"EOS"},LPAREN:{klass:TokenClass.Punctuator,name:"("},RPAREN:{klass:TokenClass.Punctuator,name:")"},LBRACK:{klass:TokenClass.Punctuator,name:"["},RBRACK:{klass:TokenClass.Punctuator,name:"]"},LBRACE:{klass:TokenClass.Punctuator,name:"{"},RBRACE:{klass:TokenClass.Punctuator,name:"}"},COLON:{klass:TokenClass.Punctuator,name:":"},SEMICOLON:{klass:TokenClass.Punctuator,name:";"},PERIOD:{klass:TokenClass.Punctuator,name:"."},ELLIPSIS:{klass:TokenClass.Punctuator,name:"..."},ARROW:{klass:TokenClass.Punctuator,name:"=>"},CONDITIONAL:{klass:TokenClass.Punctuator,name:"?"},INC:{klass:TokenClass.Punctuator,name:"++"},DEC:{klass:TokenClass.Punctuator,name:"--"},ASSIGN:{klass:TokenClass.Punctuator,name:"="},ASSIGN_BIT_OR:{klass:TokenClass.Punctuator,name:"|="},ASSIGN_BIT_XOR:{klass:TokenClass.Punctuator,name:"^="},ASSIGN_BIT_AND:{klass:TokenClass.Punctuator,name:"&="},ASSIGN_SHL:{klass:TokenClass.Punctuator,name:"<<="},ASSIGN_SHR:{klass:TokenClass.Punctuator,name:">>="},ASSIGN_SHR_UNSIGNED:{klass:TokenClass.Punctuator,name:">>>="},ASSIGN_ADD:{klass:TokenClass.Punctuator,name:"+="},ASSIGN_SUB:{klass:TokenClass.Punctuator,name:"-="},ASSIGN_MUL:{klass:TokenClass.Punctuator,name:"*="},ASSIGN_DIV:{klass:TokenClass.Punctuator,name:"/="},ASSIGN_MOD:{klass:TokenClass.Punctuator,name:"%="},ASSIGN_EXP:{klass:TokenClass.Punctuator,name:"**="},COMMA:{klass:TokenClass.Punctuator,name:","},OR:{klass:TokenClass.Punctuator,name:"||"},AND:{klass:TokenClass.Punctuator,name:"&&"},BIT_OR:{klass:TokenClass.Punctuator,name:"|"},BIT_XOR:{klass:TokenClass.Punctuator,name:"^"},BIT_AND:{klass:TokenClass.Punctuator,name:"&"},SHL:{klass:TokenClass.Punctuator,name:"<<"},SHR:{klass:TokenClass.Punctuator,name:">>"},SHR_UNSIGNED:{klass:TokenClass.Punctuator,name:">>>"},ADD:{klass:TokenClass.Punctuator,name:"+"},SUB:{klass:TokenClass.Punctuator,name:"-"},MUL:{klass:TokenClass.Punctuator,name:"*"},DIV:{klass:TokenClass.Punctuator,name:"/"},MOD:{klass:TokenClass.Punctuator,name:"%"},EXP:{klass:TokenClass.Punctuator,name:"**"},EQ:{klass:TokenClass.Punctuator,name:"=="},NE:{klass:TokenClass.Punctuator,name:"!="},EQ_STRICT:{klass:TokenClass.Punctuator,name:"==="},NE_STRICT:{klass:TokenClass.Punctuator,name:"!=="},LT:{klass:TokenClass.Punctuator,name:"<"},GT:{klass:TokenClass.Punctuator,name:">"},LTE:{klass:TokenClass.Punctuator,name:"<="},GTE:{klass:TokenClass.Punctuator,name:">="},INSTANCEOF:{klass:TokenClass.Keyword,name:"instanceof"},IN:{klass:TokenClass.Keyword,name:"in"},NOT:{klass:TokenClass.Punctuator,name:"!"},BIT_NOT:{klass:TokenClass.Punctuator,name:"~"},ASYNC:{klass:TokenClass.Keyword,name:"async"},AWAIT:{klass:TokenClass.Keyword,name:"await"},ENUM:{klass:TokenClass.Keyword,name:"enum"},DELETE:{klass:TokenClass.Keyword,name:"delete"},TYPEOF:{klass:TokenClass.Keyword,name:"typeof"},VOID:{klass:TokenClass.Keyword,name:"void"},BREAK:{klass:TokenClass.Keyword,name:"break"},CASE:{klass:TokenClass.Keyword,name:"case"},CATCH:{klass:TokenClass.Keyword,name:"catch"},CLASS:{klass:TokenClass.Keyword,name:"class"},CONTINUE:{klass:TokenClass.Keyword,name:"continue"},DEBUGGER:{klass:TokenClass.Keyword,name:"debugger"},DEFAULT:{klass:TokenClass.Keyword,name:"default"},DO:{klass:TokenClass.Keyword,name:"do"},ELSE:{klass:TokenClass.Keyword,name:"else"},EXPORT:{klass:TokenClass.Keyword,name:"export"},EXTENDS:{klass:TokenClass.Keyword,name:"extends"},FINALLY:{klass:TokenClass.Keyword,name:"finally"},FOR:{klass:TokenClass.Keyword,name:"for"},FUNCTION:{klass:TokenClass.Keyword,name:"function"},IF:{klass:TokenClass.Keyword,name:"if"},IMPORT:{klass:TokenClass.Keyword,name:"import"},LET:{klass:TokenClass.Keyword,name:"let"},NEW:{klass:TokenClass.Keyword,name:"new"},RETURN:{klass:TokenClass.Keyword,name:"return"},SUPER:{klass:TokenClass.Keyword,name:"super"},SWITCH:{klass:TokenClass.Keyword,name:"switch"},THIS:{klass:TokenClass.Keyword,name:"this"},THROW:{klass:TokenClass.Keyword,name:"throw"},TRY:{klass:TokenClass.Keyword,name:"try"},VAR:{klass:TokenClass.Keyword,name:"var"},WHILE:{klass:TokenClass.Keyword,name:"while"},WITH:{klass:TokenClass.Keyword,name:"with"},NULL:{klass:TokenClass.Keyword,name:"null"},TRUE:{klass:TokenClass.Keyword,name:"true"},FALSE:{klass:TokenClass.Keyword,name:"false"},YIELD:{klass:TokenClass.Keyword,name:"yield"},NUMBER:{klass:TokenClass.NumericLiteral,name:""},STRING:{klass:TokenClass.StringLiteral,name:""},REGEXP:{klass:TokenClass.RegularExpression,name:""},IDENTIFIER:{klass:TokenClass.Ident,name:""},CONST:{klass:TokenClass.Keyword,name:"const"},TEMPLATE:{klass:TokenClass.TemplateElement,name:""},ESCAPED_KEYWORD:{klass:TokenClass.Keyword,name:""},ILLEGAL:{klass:TokenClass.Illegal,name:""}};var TT=TokenType;var I=TT.ILLEGAL;var F=false;var T=true;var ONE_CHAR_PUNCTUATOR=[I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,TT.NOT,I,I,I,TT.MOD,TT.BIT_AND,I,TT.LPAREN,TT.RPAREN,TT.MUL,TT.ADD,TT.COMMA,TT.SUB,TT.PERIOD,TT.DIV,I,I,I,I,I,I,I,I,I,I,TT.COLON,TT.SEMICOLON,TT.LT,TT.ASSIGN,TT.GT,TT.CONDITIONAL,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,TT.LBRACK,I,TT.RBRACK,TT.BIT_XOR,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,TT.LBRACE,TT.BIT_OR,TT.RBRACE,TT.BIT_NOT];var PUNCTUATOR_START=[F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,T,F,F,F,T,T,F,T,T,T,T,T,T,F,T,F,F,F,F,F,F,F,F,F,F,T,T,T,T,T,T,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,T,F,T,T,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,T,T,T,T,F];var JsError=JsError_1=tokenizer$1.JsError=function(_Error){_inherits$8(JsError2,_Error);function JsError2(index2,line,column,msg){_classCallCheck$i(this,JsError2);var _this=_possibleConstructorReturn$8(this,(JsError2.__proto__||Object.getPrototypeOf(JsError2)).call(this,msg));_this.index=index2;try{_this.line=line;_this.column=column;}catch(e){}_this.parseErrorLine=line;_this.parseErrorColumn=column;_this.description=msg;_this.message="["+line+":"+column+"]: "+msg;return _this;}return JsError2;}(Error);function fromCodePoint(cp){if(cp<=65535)return String.fromCharCode(cp);var cu1=String.fromCharCode(Math.floor((cp-65536)/1024)+55296);var cu2=String.fromCharCode((cp-65536)%1024+56320);return cu1+cu2;}function decodeUtf16(lead,trail){return(lead-55296)*1024+(trail-56320)+65536;}var Tokenizer=function(){function Tokenizer2(source){_classCallCheck$i(this,Tokenizer2);this.source=source;this.index=0;this.line=0;this.lineStart=0;this.startIndex=0;this.startLine=0;this.startLineStart=0;this.lastIndex=0;this.lastLine=0;this.lastLineStart=0;this.hasLineTerminatorBeforeNext=false;this.tokenIndex=0;}_createClass$e(Tokenizer2,[{key:"saveLexerState",value:function saveLexerState(){return{source:this.source,index:this.index,line:this.line,lineStart:this.lineStart,startIndex:this.startIndex,startLine:this.startLine,startLineStart:this.startLineStart,lastIndex:this.lastIndex,lastLine:this.lastLine,lastLineStart:this.lastLineStart,lookahead:this.lookahead,hasLineTerminatorBeforeNext:this.hasLineTerminatorBeforeNext,tokenIndex:this.tokenIndex};}},{key:"restoreLexerState",value:function restoreLexerState(state){this.source=state.source;this.index=state.index;this.line=state.line;this.lineStart=state.lineStart;this.startIndex=state.startIndex;this.startLine=state.startLine;this.startLineStart=state.startLineStart;this.lastIndex=state.lastIndex;this.lastLine=state.lastLine;this.lastLineStart=state.lastLineStart;this.lookahead=state.lookahead;this.hasLineTerminatorBeforeNext=state.hasLineTerminatorBeforeNext;this.tokenIndex=state.tokenIndex;}},{key:"createILLEGAL",value:function createILLEGAL(){this.startIndex=this.index;this.startLine=this.line;this.startLineStart=this.lineStart;return this.index1?_len-1:0),_key=1;_key<_len;_key++){params[_key-1]=arguments[_key];}msg=message.apply(void 0,params);}else{msg=message;}return new JsError(this.startIndex,this.startLine+1,this.startIndex-this.startLineStart+1,msg);}},{key:"createErrorWithLocation",value:function createErrorWithLocation(location,message){var _arguments=arguments;var msg=message.replace(/\{(\d+)\}/g,function(_,n){return JSON.stringify(_arguments[+n+2]);});if(location.slice&&location.slice.startLocation){location=location.slice.startLocation;}return new JsError(location.offset,location.line,location.column+1,msg);}},{key:"getKeyword",value:function getKeyword(id2){if(id2.length===1||id2.length>10){return TokenType.IDENTIFIER;}switch(id2.length){case 2:switch(id2.charAt(0)){case"i":switch(id2.charAt(1)){case"f":return TokenType.IF;case"n":return TokenType.IN;}break;case"d":if(id2.charAt(1)==="o"){return TokenType.DO;}break;}break;case 3:switch(id2.charAt(0)){case"v":if(Tokenizer2.cse2(id2,"a","r")){return TokenType.VAR;}break;case"f":if(Tokenizer2.cse2(id2,"o","r")){return TokenType.FOR;}break;case"n":if(Tokenizer2.cse2(id2,"e","w")){return TokenType.NEW;}break;case"t":if(Tokenizer2.cse2(id2,"r","y")){return TokenType.TRY;}break;case"l":if(Tokenizer2.cse2(id2,"e","t")){return TokenType.LET;}break;}break;case 4:switch(id2.charAt(0)){case"t":if(Tokenizer2.cse3(id2,"h","i","s")){return TokenType.THIS;}else if(Tokenizer2.cse3(id2,"r","u","e")){return TokenType.TRUE;}break;case"n":if(Tokenizer2.cse3(id2,"u","l","l")){return TokenType.NULL;}break;case"e":if(Tokenizer2.cse3(id2,"l","s","e")){return TokenType.ELSE;}else if(Tokenizer2.cse3(id2,"n","u","m")){return TokenType.ENUM;}break;case"c":if(Tokenizer2.cse3(id2,"a","s","e")){return TokenType.CASE;}break;case"v":if(Tokenizer2.cse3(id2,"o","i","d")){return TokenType.VOID;}break;case"w":if(Tokenizer2.cse3(id2,"i","t","h")){return TokenType.WITH;}break;}break;case 5:switch(id2.charAt(0)){case"a":if(Tokenizer2.cse4(id2,"s","y","n","c")){return TokenType.ASYNC;}if(Tokenizer2.cse4(id2,"w","a","i","t")){return TokenType.AWAIT;}break;case"w":if(Tokenizer2.cse4(id2,"h","i","l","e")){return TokenType.WHILE;}break;case"b":if(Tokenizer2.cse4(id2,"r","e","a","k")){return TokenType.BREAK;}break;case"f":if(Tokenizer2.cse4(id2,"a","l","s","e")){return TokenType.FALSE;}break;case"c":if(Tokenizer2.cse4(id2,"a","t","c","h")){return TokenType.CATCH;}else if(Tokenizer2.cse4(id2,"o","n","s","t")){return TokenType.CONST;}else if(Tokenizer2.cse4(id2,"l","a","s","s")){return TokenType.CLASS;}break;case"t":if(Tokenizer2.cse4(id2,"h","r","o","w")){return TokenType.THROW;}break;case"y":if(Tokenizer2.cse4(id2,"i","e","l","d")){return TokenType.YIELD;}break;case"s":if(Tokenizer2.cse4(id2,"u","p","e","r")){return TokenType.SUPER;}break;}break;case 6:switch(id2.charAt(0)){case"r":if(Tokenizer2.cse5(id2,"e","t","u","r","n")){return TokenType.RETURN;}break;case"t":if(Tokenizer2.cse5(id2,"y","p","e","o","f")){return TokenType.TYPEOF;}break;case"d":if(Tokenizer2.cse5(id2,"e","l","e","t","e")){return TokenType.DELETE;}break;case"s":if(Tokenizer2.cse5(id2,"w","i","t","c","h")){return TokenType.SWITCH;}break;case"e":if(Tokenizer2.cse5(id2,"x","p","o","r","t")){return TokenType.EXPORT;}break;case"i":if(Tokenizer2.cse5(id2,"m","p","o","r","t")){return TokenType.IMPORT;}break;}break;case 7:switch(id2.charAt(0)){case"d":if(Tokenizer2.cse6(id2,"e","f","a","u","l","t")){return TokenType.DEFAULT;}break;case"f":if(Tokenizer2.cse6(id2,"i","n","a","l","l","y")){return TokenType.FINALLY;}break;case"e":if(Tokenizer2.cse6(id2,"x","t","e","n","d","s")){return TokenType.EXTENDS;}break;}break;case 8:switch(id2.charAt(0)){case"f":if(Tokenizer2.cse7(id2,"u","n","c","t","i","o","n")){return TokenType.FUNCTION;}break;case"c":if(Tokenizer2.cse7(id2,"o","n","t","i","n","u","e")){return TokenType.CONTINUE;}break;case"d":if(Tokenizer2.cse7(id2,"e","b","u","g","g","e","r")){return TokenType.DEBUGGER;}break;}break;case 10:if(id2==="instanceof"){return TokenType.INSTANCEOF;}break;}return TokenType.IDENTIFIER;}},{key:"skipSingleLineComment",value:function skipSingleLineComment(offset){this.index+=offset;while(this.index=length){break;}chCode=this.source.charCodeAt(this.index+1);if(chCode===47){this.skipSingleLineComment(2);isLineStart=true;}else if(chCode===42){isLineStart=this.skipMultiLineComment()||isLineStart;}else{break;}}else if(!this.moduleIsTheGoalSymbol&&isLineStart&&chCode===45){if(this.index+2>=length){break;}if(this.source.charAt(this.index+1)==="-"&&this.source.charAt(this.index+2)===">"){this.skipSingleLineComment(3);}else{break;}}else if(!this.moduleIsTheGoalSymbol&&chCode===60){if(this.source.slice(this.index+1,this.index+4)==="!--"){this.skipSingleLineComment(4);isLineStart=true;}else{break;}}else{break;}}}},{key:"scanHexEscape2",value:function scanHexEscape2(){if(this.index+2>this.source.length){return-1;}var r1=(0,_utils$1.getHexValue)(this.source.charAt(this.index));if(r1===-1){return-1;}var r2=(0,_utils$1.getHexValue)(this.source.charAt(this.index+1));if(r2===-1){return-1;}this.index+=2;return r1<<4|r2;}},{key:"scanUnicode",value:function scanUnicode(){if(this.source.charAt(this.index)==="{"){var i2=this.index+1;var hexDigits2=0,ch=void 0;while(i21114111){throw this.createILLEGAL();}i2++;}if(ch!=="}"){throw this.createILLEGAL();}if(i2===this.index+1){++this.index;throw this.createILLEGAL();}this.index=i2+1;return hexDigits2;}if(this.index+4>this.source.length){return-1;}var r1=(0,_utils$1.getHexValue)(this.source.charAt(this.index));if(r1===-1){return-1;}var r2=(0,_utils$1.getHexValue)(this.source.charAt(this.index+1));if(r2===-1){return-1;}var r3=(0,_utils$1.getHexValue)(this.source.charAt(this.index+2));if(r3===-1){return-1;}var r4=(0,_utils$1.getHexValue)(this.source.charAt(this.index+3));if(r4===-1){return-1;}this.index+=4;return r1<<12|r2<<8|r3<<4|r4;}},{key:"getEscapedIdentifier",value:function getEscapedIdentifier(){var id2="";var check=_utils$1.isIdentifierStart;while(this.index=this.source.length){throw this.createILLEGAL();}if(this.source.charAt(this.index)!=="u"){throw this.createILLEGAL();}++this.index;code2=this.scanUnicode();if(code2<0){throw this.createILLEGAL();}ch=fromCodePoint(code2);}else if(code2>=55296&&code2<=56319){if(this.index>=this.source.length){throw this.createILLEGAL();}var lowSurrogateCode=this.source.charCodeAt(this.index);++this.index;if(!(lowSurrogateCode>=56320&&lowSurrogateCode<=57343)){throw this.createILLEGAL();}code2=decodeUtf16(code2,lowSurrogateCode);ch=fromCodePoint(code2);}if(!check(code2)){if(id2.length<1){throw this.createILLEGAL();}this.index=start;return id2;}check=_utils$1.isIdentifierPart;id2+=ch;}return id2;}},{key:"getIdentifier",value:function getIdentifier(){var start=this.index;var l=this.source.length;var i2=this.index;var check=_utils$1.isIdentifierStart;while(i2=55296&&code2<=56319){this.index=start;return this.getEscapedIdentifier();}if(!check(code2)){this.index=i2;return this.source.slice(start,i2);}++i2;check=_utils$1.isIdentifierPart;}this.index=i2;return this.source.slice(start,i2);}},{key:"scanIdentifier",value:function scanIdentifier(){var startLocation=this.getLocation();var start=this.index;var id2=this.source.charAt(this.index)==="\\"?this.getEscapedIdentifier():this.getIdentifier();var slice=this.getSlice(start,startLocation);slice.text=id2;var hasEscape=this.index-start!==id2.length;var type=this.getKeyword(id2);if(hasEscape&&type!==TokenType.IDENTIFIER){type=TokenType.ESCAPED_KEYWORD;}return{type,value:id2,slice,escaped:hasEscape};}},{key:"getLocation",value:function getLocation(){return{line:this.startLine+1,column:this.startIndex-this.startLineStart,offset:this.startIndex};}},{key:"getLastTokenEndLocation",value:function getLastTokenEndLocation(){return{line:this.lastLine+1,column:this.lastIndex-this.lastLineStart,offset:this.lastIndex};}},{key:"getSlice",value:function getSlice(start,startLocation){return{text:this.source.slice(start,this.index),start,startLocation,end:this.index};}},{key:"scanPunctuatorHelper",value:function scanPunctuatorHelper(){var ch1=this.source.charAt(this.index);switch(ch1){case".":{var ch2=this.source.charAt(this.index+1);if(ch2!==".")return TokenType.PERIOD;var ch3=this.source.charAt(this.index+2);if(ch3!==".")return TokenType.PERIOD;return TokenType.ELLIPSIS;}case"(":return TokenType.LPAREN;case")":case";":case",":return ONE_CHAR_PUNCTUATOR[ch1.charCodeAt(0)];case"{":return TokenType.LBRACE;case"}":case"[":case"]":case":":case"?":case"~":return ONE_CHAR_PUNCTUATOR[ch1.charCodeAt(0)];default:if(this.index+1":return TokenType.GTE;case"/":return TokenType.ASSIGN_DIV;case"%":return TokenType.ASSIGN_MOD;case"^":return TokenType.ASSIGN_BIT_XOR;case"&":return TokenType.ASSIGN_BIT_AND;}}}if(this.index+1"&&_ch2===">"){if(this.index+3"&&_ch2==="="){return TokenType.ASSIGN_SHR;}if(ch1==="*"&&_ch2==="="){return TokenType.ASSIGN_EXP;}}switch(ch1){case"*":return TokenType.EXP;case"+":return TokenType.INC;case"-":return TokenType.DEC;case"<":return TokenType.SHL;case">":return TokenType.SHR;case"&":return TokenType.AND;case"|":return TokenType.OR;}}else if(ch1==="="&&_ch===">"){return TokenType.ARROW;}}return ONE_CHAR_PUNCTUATOR[ch1.charCodeAt(0)];}},{key:"scanPunctuator",value:function scanPunctuator(){var startLocation=this.getLocation();var start=this.index;var subType=this.scanPunctuatorHelper();this.index+=subType.name.length;return{type:subType,value:subType.name,slice:this.getSlice(start,startLocation)};}},{key:"scanHexLiteral",value:function scanHexLiteral(start,startLocation){var i2=this.index;while(i2="0"&&ch<="7"){this.index++;}else if((0,_utils$1.isIdentifierPart)(ch.charCodeAt(0))){throw this.createILLEGAL();}else{break;}}if(this.index-start===2){throw this.createILLEGAL();}return{type:TokenType.NUMBER,value:parseInt(this.getSlice(start,startLocation).text.substr(2),8),slice:this.getSlice(start,startLocation),octal:false,noctal:false};}},{key:"scanLegacyOctalLiteral",value:function scanLegacyOctalLiteral(start,startLocation){var isOctal=true;while(this.index="0"&&ch<="7"){this.index++;}else if(ch==="8"||ch==="9"){isOctal=false;this.index++;}else if((0,_utils$1.isIdentifierPart)(ch.charCodeAt(0))){throw this.createILLEGAL();}else{break;}}var slice=this.getSlice(start,startLocation);if(!isOctal){this.eatDecimalLiteralSuffix();return{type:TokenType.NUMBER,slice,value:+slice.text,octal:true,noctal:!isOctal};}return{type:TokenType.NUMBER,slice,value:parseInt(slice.text.substr(1),8),octal:true,noctal:!isOctal};}},{key:"scanNumericLiteral",value:function scanNumericLiteral(){var ch=this.source.charAt(this.index);var startLocation=this.getLocation();var start=this.index;if(ch==="0"){this.index++;if(this.index="0"&&ch<="9"){return this.scanLegacyOctalLiteral(start,startLocation);}}else{var _slice=this.getSlice(start,startLocation);return{type:TokenType.NUMBER,value:+_slice.text,slice:_slice,octal:false,noctal:false};}}else if(ch!=="."){ch=this.source.charAt(this.index);while(ch>="0"&&ch<="9"){this.index++;if(this.index===this.source.length){var _slice2=this.getSlice(start,startLocation);return{type:TokenType.NUMBER,value:+_slice2.text,slice:_slice2,octal:false,noctal:false};}ch=this.source.charAt(this.index);}}this.eatDecimalLiteralSuffix();if(this.index!==this.source.length&&(0,_utils$1.isIdentifierStart)(this.source.charCodeAt(this.index))){throw this.createILLEGAL();}var slice=this.getSlice(start,startLocation);return{type:TokenType.NUMBER,value:+slice.text,slice,octal:false,noctal:false};}},{key:"eatDecimalLiteralSuffix",value:function eatDecimalLiteralSuffix(){var ch=this.source.charAt(this.index);if(ch==="."){this.index++;if(this.index===this.source.length){return;}ch=this.source.charAt(this.index);while(ch>="0"&&ch<="9"){this.index++;if(this.index===this.source.length){return;}ch=this.source.charAt(this.index);}}if(ch==="e"||ch==="E"){this.index++;if(this.index===this.source.length){throw this.createILLEGAL();}ch=this.source.charAt(this.index);if(ch==="+"||ch==="-"){this.index++;if(this.index===this.source.length){throw this.createILLEGAL();}ch=this.source.charAt(this.index);}if(ch>="0"&&ch<="9"){while(ch>="0"&&ch<="9"){this.index++;if(this.index===this.source.length){break;}ch=this.source.charAt(this.index);}}else{throw this.createILLEGAL();}}}},{key:"scanStringEscape",value:function scanStringEscape(str,octal){this.index++;if(this.index===this.source.length){throw this.createILLEGAL();}var ch=this.source.charAt(this.index);if((0,_utils$1.isLineTerminator)(ch.charCodeAt(0))){this.index++;if(ch==="\r"&&this.source.charAt(this.index)==="\n"){this.index++;}this.lineStart=this.index;this.line++;}else{switch(ch){case"n":str+="\n";this.index++;break;case"r":str+="\r";this.index++;break;case"t":str+=" ";this.index++;break;case"u":case"x":{var unescaped=void 0;this.index++;if(this.index>=this.source.length){throw this.createILLEGAL();}unescaped=ch==="u"?this.scanUnicode():this.scanHexEscape2();if(unescaped<0){throw this.createILLEGAL();}str+=fromCodePoint(unescaped);break;}case"b":str+="\b";this.index++;break;case"f":str+="\f";this.index++;break;case"v":str+="\v";this.index++;break;default:if(ch>="0"&&ch<="7"){var octalStart=this.index;var octLen=1;if(ch>="0"&&ch<="3"){octLen=0;}var code2=0;while(octLen<3&&ch>="0"&&ch<="7"){this.index++;if(octLen>0||ch!=="0"){octal=this.source.slice(octalStart,this.index);}code2*=8;code2+=ch-"0";octLen++;if(this.index===this.source.length){throw this.createILLEGAL();}ch=this.source.charAt(this.index);}if(code2===0&&octLen===1&&(ch==="8"||ch==="9")){octal=this.source.slice(octalStart,this.index+1);}str+=String.fromCharCode(code2);}else if(ch==="8"||ch==="9"){throw this.createILLEGAL();}else{str+=ch;this.index++;}}}return[str,octal];}},{key:"scanStringLiteral",value:function scanStringLiteral(){var str="";var quote=this.source.charAt(this.index);var startLocation=this.getLocation();var start=this.index;this.index++;var octal=null;while(this.index=this.source.length){return{type:TokenType.EOS,slice:this.getSlice(this.index,startLocation)};}var charCode=this.source.charCodeAt(this.index);if(charCode<128){if(PUNCTUATOR_START[charCode]){return this.scanPunctuator();}if((0,_utils$1.isIdentifierStart)(charCode)||charCode===92){return this.scanIdentifier();}if(charCode===46){if(this.index+1=48&&charCode<=57){return this.scanNumericLiteral();}throw this.createILLEGAL();}else{if((0,_utils$1.isIdentifierStart)(charCode)||charCode>=55296&&charCode<=56319){return this.scanIdentifier();}throw this.createILLEGAL();}}},{key:"eof",value:function eof(){return this.lookahead.type===TokenType.EOS;}},{key:"lex",value:function lex(){var prevToken=this.lookahead;this.lookahead=this.advance();this.tokenIndex++;return prevToken;}}],[{key:"cse2",value:function cse2(id2,ch1,ch2){return id2.charAt(1)===ch1&&id2.charAt(2)===ch2;}},{key:"cse3",value:function cse3(id2,ch1,ch2,ch3){return id2.charAt(1)===ch1&&id2.charAt(2)===ch2&&id2.charAt(3)===ch3;}},{key:"cse4",value:function cse4(id2,ch1,ch2,ch3,ch4){return id2.charAt(1)===ch1&&id2.charAt(2)===ch2&&id2.charAt(3)===ch3&&id2.charAt(4)===ch4;}},{key:"cse5",value:function cse5(id2,ch1,ch2,ch3,ch4,ch5){return id2.charAt(1)===ch1&&id2.charAt(2)===ch2&&id2.charAt(3)===ch3&&id2.charAt(4)===ch4&&id2.charAt(5)===ch5;}},{key:"cse6",value:function cse6(id2,ch1,ch2,ch3,ch4,ch5,ch6){return id2.charAt(1)===ch1&&id2.charAt(2)===ch2&&id2.charAt(3)===ch3&&id2.charAt(4)===ch4&&id2.charAt(5)===ch5&&id2.charAt(6)===ch6;}},{key:"cse7",value:function cse7(id2,ch1,ch2,ch3,ch4,ch5,ch6,ch7){return id2.charAt(1)===ch1&&id2.charAt(2)===ch2&&id2.charAt(3)===ch3&&id2.charAt(4)===ch4&&id2.charAt(5)===ch5&&id2.charAt(6)===ch6&&id2.charAt(7)===ch7;}}]);return Tokenizer2;}();var _default$c=tokenizer$1["default"]=Tokenizer;var tokenizer=/* @__PURE__ */_mergeNamespaces({__proto__:null,get JsError(){return JsError_1;},get TokenType(){return TokenType_1;},get TokenClass(){return TokenClass_1;},"default":_default$c},[tokenizer$1]);var require$$0$9=/* @__PURE__ */getAugmentedNamespace(tokenizer);var parser$1={};var dist$a={};var mappings=/* @__PURE__ */new Map([["General_Category",/* @__PURE__ */new Map([["C","Other"],["Cc","Control"],["cntrl","Control"],["Cf","Format"],["Cn","Unassigned"],["Co","Private_Use"],["Cs","Surrogate"],["L","Letter"],["LC","Cased_Letter"],["Ll","Lowercase_Letter"],["Lm","Modifier_Letter"],["Lo","Other_Letter"],["Lt","Titlecase_Letter"],["Lu","Uppercase_Letter"],["M","Mark"],["Combining_Mark","Mark"],["Mc","Spacing_Mark"],["Me","Enclosing_Mark"],["Mn","Nonspacing_Mark"],["N","Number"],["Nd","Decimal_Number"],["digit","Decimal_Number"],["Nl","Letter_Number"],["No","Other_Number"],["P","Punctuation"],["punct","Punctuation"],["Pc","Connector_Punctuation"],["Pd","Dash_Punctuation"],["Pe","Close_Punctuation"],["Pf","Final_Punctuation"],["Pi","Initial_Punctuation"],["Po","Other_Punctuation"],["Ps","Open_Punctuation"],["S","Symbol"],["Sc","Currency_Symbol"],["Sk","Modifier_Symbol"],["Sm","Math_Symbol"],["So","Other_Symbol"],["Z","Separator"],["Zl","Line_Separator"],["Zp","Paragraph_Separator"],["Zs","Space_Separator"],["Other","Other"],["Control","Control"],["Format","Format"],["Unassigned","Unassigned"],["Private_Use","Private_Use"],["Surrogate","Surrogate"],["Letter","Letter"],["Cased_Letter","Cased_Letter"],["Lowercase_Letter","Lowercase_Letter"],["Modifier_Letter","Modifier_Letter"],["Other_Letter","Other_Letter"],["Titlecase_Letter","Titlecase_Letter"],["Uppercase_Letter","Uppercase_Letter"],["Mark","Mark"],["Spacing_Mark","Spacing_Mark"],["Enclosing_Mark","Enclosing_Mark"],["Nonspacing_Mark","Nonspacing_Mark"],["Number","Number"],["Decimal_Number","Decimal_Number"],["Letter_Number","Letter_Number"],["Other_Number","Other_Number"],["Punctuation","Punctuation"],["Connector_Punctuation","Connector_Punctuation"],["Dash_Punctuation","Dash_Punctuation"],["Close_Punctuation","Close_Punctuation"],["Final_Punctuation","Final_Punctuation"],["Initial_Punctuation","Initial_Punctuation"],["Other_Punctuation","Other_Punctuation"],["Open_Punctuation","Open_Punctuation"],["Symbol","Symbol"],["Currency_Symbol","Currency_Symbol"],["Modifier_Symbol","Modifier_Symbol"],["Math_Symbol","Math_Symbol"],["Other_Symbol","Other_Symbol"],["Separator","Separator"],["Line_Separator","Line_Separator"],["Paragraph_Separator","Paragraph_Separator"],["Space_Separator","Space_Separator"]])],["Script",/* @__PURE__ */new Map([["Adlm","Adlam"],["Aghb","Caucasian_Albanian"],["Ahom","Ahom"],["Arab","Arabic"],["Armi","Imperial_Aramaic"],["Armn","Armenian"],["Avst","Avestan"],["Bali","Balinese"],["Bamu","Bamum"],["Bass","Bassa_Vah"],["Batk","Batak"],["Beng","Bengali"],["Bhks","Bhaiksuki"],["Bopo","Bopomofo"],["Brah","Brahmi"],["Brai","Braille"],["Bugi","Buginese"],["Buhd","Buhid"],["Cakm","Chakma"],["Cans","Canadian_Aboriginal"],["Cari","Carian"],["Cham","Cham"],["Cher","Cherokee"],["Copt","Coptic"],["Qaac","Coptic"],["Cprt","Cypriot"],["Cyrl","Cyrillic"],["Deva","Devanagari"],["Dogr","Dogra"],["Dsrt","Deseret"],["Dupl","Duployan"],["Egyp","Egyptian_Hieroglyphs"],["Elba","Elbasan"],["Ethi","Ethiopic"],["Geor","Georgian"],["Glag","Glagolitic"],["Gong","Gunjala_Gondi"],["Gonm","Masaram_Gondi"],["Goth","Gothic"],["Gran","Grantha"],["Grek","Greek"],["Gujr","Gujarati"],["Guru","Gurmukhi"],["Hang","Hangul"],["Hani","Han"],["Hano","Hanunoo"],["Hatr","Hatran"],["Hebr","Hebrew"],["Hira","Hiragana"],["Hluw","Anatolian_Hieroglyphs"],["Hmng","Pahawh_Hmong"],["Hrkt","Katakana_Or_Hiragana"],["Hung","Old_Hungarian"],["Ital","Old_Italic"],["Java","Javanese"],["Kali","Kayah_Li"],["Kana","Katakana"],["Khar","Kharoshthi"],["Khmr","Khmer"],["Khoj","Khojki"],["Knda","Kannada"],["Kthi","Kaithi"],["Lana","Tai_Tham"],["Laoo","Lao"],["Latn","Latin"],["Lepc","Lepcha"],["Limb","Limbu"],["Lina","Linear_A"],["Linb","Linear_B"],["Lisu","Lisu"],["Lyci","Lycian"],["Lydi","Lydian"],["Mahj","Mahajani"],["Maka","Makasar"],["Mand","Mandaic"],["Mani","Manichaean"],["Marc","Marchen"],["Medf","Medefaidrin"],["Mend","Mende_Kikakui"],["Merc","Meroitic_Cursive"],["Mero","Meroitic_Hieroglyphs"],["Mlym","Malayalam"],["Modi","Modi"],["Mong","Mongolian"],["Mroo","Mro"],["Mtei","Meetei_Mayek"],["Mult","Multani"],["Mymr","Myanmar"],["Narb","Old_North_Arabian"],["Nbat","Nabataean"],["Newa","Newa"],["Nkoo","Nko"],["Nshu","Nushu"],["Ogam","Ogham"],["Olck","Ol_Chiki"],["Orkh","Old_Turkic"],["Orya","Oriya"],["Osge","Osage"],["Osma","Osmanya"],["Palm","Palmyrene"],["Pauc","Pau_Cin_Hau"],["Perm","Old_Permic"],["Phag","Phags_Pa"],["Phli","Inscriptional_Pahlavi"],["Phlp","Psalter_Pahlavi"],["Phnx","Phoenician"],["Plrd","Miao"],["Prti","Inscriptional_Parthian"],["Rjng","Rejang"],["Rohg","Hanifi_Rohingya"],["Runr","Runic"],["Samr","Samaritan"],["Sarb","Old_South_Arabian"],["Saur","Saurashtra"],["Sgnw","SignWriting"],["Shaw","Shavian"],["Shrd","Sharada"],["Sidd","Siddham"],["Sind","Khudawadi"],["Sinh","Sinhala"],["Sogd","Sogdian"],["Sogo","Old_Sogdian"],["Sora","Sora_Sompeng"],["Soyo","Soyombo"],["Sund","Sundanese"],["Sylo","Syloti_Nagri"],["Syrc","Syriac"],["Tagb","Tagbanwa"],["Takr","Takri"],["Tale","Tai_Le"],["Talu","New_Tai_Lue"],["Taml","Tamil"],["Tang","Tangut"],["Tavt","Tai_Viet"],["Telu","Telugu"],["Tfng","Tifinagh"],["Tglg","Tagalog"],["Thaa","Thaana"],["Thai","Thai"],["Tibt","Tibetan"],["Tirh","Tirhuta"],["Ugar","Ugaritic"],["Vaii","Vai"],["Wara","Warang_Citi"],["Xpeo","Old_Persian"],["Xsux","Cuneiform"],["Yiii","Yi"],["Zanb","Zanabazar_Square"],["Zinh","Inherited"],["Qaai","Inherited"],["Zyyy","Common"],["Zzzz","Unknown"],["Adlam","Adlam"],["Caucasian_Albanian","Caucasian_Albanian"],["Arabic","Arabic"],["Imperial_Aramaic","Imperial_Aramaic"],["Armenian","Armenian"],["Avestan","Avestan"],["Balinese","Balinese"],["Bamum","Bamum"],["Bassa_Vah","Bassa_Vah"],["Batak","Batak"],["Bengali","Bengali"],["Bhaiksuki","Bhaiksuki"],["Bopomofo","Bopomofo"],["Brahmi","Brahmi"],["Braille","Braille"],["Buginese","Buginese"],["Buhid","Buhid"],["Chakma","Chakma"],["Canadian_Aboriginal","Canadian_Aboriginal"],["Carian","Carian"],["Cherokee","Cherokee"],["Coptic","Coptic"],["Cypriot","Cypriot"],["Cyrillic","Cyrillic"],["Devanagari","Devanagari"],["Dogra","Dogra"],["Deseret","Deseret"],["Duployan","Duployan"],["Egyptian_Hieroglyphs","Egyptian_Hieroglyphs"],["Elbasan","Elbasan"],["Ethiopic","Ethiopic"],["Georgian","Georgian"],["Glagolitic","Glagolitic"],["Gunjala_Gondi","Gunjala_Gondi"],["Masaram_Gondi","Masaram_Gondi"],["Gothic","Gothic"],["Grantha","Grantha"],["Greek","Greek"],["Gujarati","Gujarati"],["Gurmukhi","Gurmukhi"],["Hangul","Hangul"],["Han","Han"],["Hanunoo","Hanunoo"],["Hatran","Hatran"],["Hebrew","Hebrew"],["Hiragana","Hiragana"],["Anatolian_Hieroglyphs","Anatolian_Hieroglyphs"],["Pahawh_Hmong","Pahawh_Hmong"],["Katakana_Or_Hiragana","Katakana_Or_Hiragana"],["Old_Hungarian","Old_Hungarian"],["Old_Italic","Old_Italic"],["Javanese","Javanese"],["Kayah_Li","Kayah_Li"],["Katakana","Katakana"],["Kharoshthi","Kharoshthi"],["Khmer","Khmer"],["Khojki","Khojki"],["Kannada","Kannada"],["Kaithi","Kaithi"],["Tai_Tham","Tai_Tham"],["Lao","Lao"],["Latin","Latin"],["Lepcha","Lepcha"],["Limbu","Limbu"],["Linear_A","Linear_A"],["Linear_B","Linear_B"],["Lycian","Lycian"],["Lydian","Lydian"],["Mahajani","Mahajani"],["Makasar","Makasar"],["Mandaic","Mandaic"],["Manichaean","Manichaean"],["Marchen","Marchen"],["Medefaidrin","Medefaidrin"],["Mende_Kikakui","Mende_Kikakui"],["Meroitic_Cursive","Meroitic_Cursive"],["Meroitic_Hieroglyphs","Meroitic_Hieroglyphs"],["Malayalam","Malayalam"],["Mongolian","Mongolian"],["Mro","Mro"],["Meetei_Mayek","Meetei_Mayek"],["Multani","Multani"],["Myanmar","Myanmar"],["Old_North_Arabian","Old_North_Arabian"],["Nabataean","Nabataean"],["Nko","Nko"],["Nushu","Nushu"],["Ogham","Ogham"],["Ol_Chiki","Ol_Chiki"],["Old_Turkic","Old_Turkic"],["Oriya","Oriya"],["Osage","Osage"],["Osmanya","Osmanya"],["Palmyrene","Palmyrene"],["Pau_Cin_Hau","Pau_Cin_Hau"],["Old_Permic","Old_Permic"],["Phags_Pa","Phags_Pa"],["Inscriptional_Pahlavi","Inscriptional_Pahlavi"],["Psalter_Pahlavi","Psalter_Pahlavi"],["Phoenician","Phoenician"],["Miao","Miao"],["Inscriptional_Parthian","Inscriptional_Parthian"],["Rejang","Rejang"],["Hanifi_Rohingya","Hanifi_Rohingya"],["Runic","Runic"],["Samaritan","Samaritan"],["Old_South_Arabian","Old_South_Arabian"],["Saurashtra","Saurashtra"],["SignWriting","SignWriting"],["Shavian","Shavian"],["Sharada","Sharada"],["Siddham","Siddham"],["Khudawadi","Khudawadi"],["Sinhala","Sinhala"],["Sogdian","Sogdian"],["Old_Sogdian","Old_Sogdian"],["Sora_Sompeng","Sora_Sompeng"],["Soyombo","Soyombo"],["Sundanese","Sundanese"],["Syloti_Nagri","Syloti_Nagri"],["Syriac","Syriac"],["Tagbanwa","Tagbanwa"],["Takri","Takri"],["Tai_Le","Tai_Le"],["New_Tai_Lue","New_Tai_Lue"],["Tamil","Tamil"],["Tangut","Tangut"],["Tai_Viet","Tai_Viet"],["Telugu","Telugu"],["Tifinagh","Tifinagh"],["Tagalog","Tagalog"],["Thaana","Thaana"],["Tibetan","Tibetan"],["Tirhuta","Tirhuta"],["Ugaritic","Ugaritic"],["Vai","Vai"],["Warang_Citi","Warang_Citi"],["Old_Persian","Old_Persian"],["Cuneiform","Cuneiform"],["Yi","Yi"],["Zanabazar_Square","Zanabazar_Square"],["Inherited","Inherited"],["Common","Common"],["Unknown","Unknown"]])],["Script_Extensions",/* @__PURE__ */new Map([["Adlm","Adlam"],["Aghb","Caucasian_Albanian"],["Ahom","Ahom"],["Arab","Arabic"],["Armi","Imperial_Aramaic"],["Armn","Armenian"],["Avst","Avestan"],["Bali","Balinese"],["Bamu","Bamum"],["Bass","Bassa_Vah"],["Batk","Batak"],["Beng","Bengali"],["Bhks","Bhaiksuki"],["Bopo","Bopomofo"],["Brah","Brahmi"],["Brai","Braille"],["Bugi","Buginese"],["Buhd","Buhid"],["Cakm","Chakma"],["Cans","Canadian_Aboriginal"],["Cari","Carian"],["Cham","Cham"],["Cher","Cherokee"],["Copt","Coptic"],["Qaac","Coptic"],["Cprt","Cypriot"],["Cyrl","Cyrillic"],["Deva","Devanagari"],["Dogr","Dogra"],["Dsrt","Deseret"],["Dupl","Duployan"],["Egyp","Egyptian_Hieroglyphs"],["Elba","Elbasan"],["Ethi","Ethiopic"],["Geor","Georgian"],["Glag","Glagolitic"],["Gong","Gunjala_Gondi"],["Gonm","Masaram_Gondi"],["Goth","Gothic"],["Gran","Grantha"],["Grek","Greek"],["Gujr","Gujarati"],["Guru","Gurmukhi"],["Hang","Hangul"],["Hani","Han"],["Hano","Hanunoo"],["Hatr","Hatran"],["Hebr","Hebrew"],["Hira","Hiragana"],["Hluw","Anatolian_Hieroglyphs"],["Hmng","Pahawh_Hmong"],["Hrkt","Katakana_Or_Hiragana"],["Hung","Old_Hungarian"],["Ital","Old_Italic"],["Java","Javanese"],["Kali","Kayah_Li"],["Kana","Katakana"],["Khar","Kharoshthi"],["Khmr","Khmer"],["Khoj","Khojki"],["Knda","Kannada"],["Kthi","Kaithi"],["Lana","Tai_Tham"],["Laoo","Lao"],["Latn","Latin"],["Lepc","Lepcha"],["Limb","Limbu"],["Lina","Linear_A"],["Linb","Linear_B"],["Lisu","Lisu"],["Lyci","Lycian"],["Lydi","Lydian"],["Mahj","Mahajani"],["Maka","Makasar"],["Mand","Mandaic"],["Mani","Manichaean"],["Marc","Marchen"],["Medf","Medefaidrin"],["Mend","Mende_Kikakui"],["Merc","Meroitic_Cursive"],["Mero","Meroitic_Hieroglyphs"],["Mlym","Malayalam"],["Modi","Modi"],["Mong","Mongolian"],["Mroo","Mro"],["Mtei","Meetei_Mayek"],["Mult","Multani"],["Mymr","Myanmar"],["Narb","Old_North_Arabian"],["Nbat","Nabataean"],["Newa","Newa"],["Nkoo","Nko"],["Nshu","Nushu"],["Ogam","Ogham"],["Olck","Ol_Chiki"],["Orkh","Old_Turkic"],["Orya","Oriya"],["Osge","Osage"],["Osma","Osmanya"],["Palm","Palmyrene"],["Pauc","Pau_Cin_Hau"],["Perm","Old_Permic"],["Phag","Phags_Pa"],["Phli","Inscriptional_Pahlavi"],["Phlp","Psalter_Pahlavi"],["Phnx","Phoenician"],["Plrd","Miao"],["Prti","Inscriptional_Parthian"],["Rjng","Rejang"],["Rohg","Hanifi_Rohingya"],["Runr","Runic"],["Samr","Samaritan"],["Sarb","Old_South_Arabian"],["Saur","Saurashtra"],["Sgnw","SignWriting"],["Shaw","Shavian"],["Shrd","Sharada"],["Sidd","Siddham"],["Sind","Khudawadi"],["Sinh","Sinhala"],["Sogd","Sogdian"],["Sogo","Old_Sogdian"],["Sora","Sora_Sompeng"],["Soyo","Soyombo"],["Sund","Sundanese"],["Sylo","Syloti_Nagri"],["Syrc","Syriac"],["Tagb","Tagbanwa"],["Takr","Takri"],["Tale","Tai_Le"],["Talu","New_Tai_Lue"],["Taml","Tamil"],["Tang","Tangut"],["Tavt","Tai_Viet"],["Telu","Telugu"],["Tfng","Tifinagh"],["Tglg","Tagalog"],["Thaa","Thaana"],["Thai","Thai"],["Tibt","Tibetan"],["Tirh","Tirhuta"],["Ugar","Ugaritic"],["Vaii","Vai"],["Wara","Warang_Citi"],["Xpeo","Old_Persian"],["Xsux","Cuneiform"],["Yiii","Yi"],["Zanb","Zanabazar_Square"],["Zinh","Inherited"],["Qaai","Inherited"],["Zyyy","Common"],["Zzzz","Unknown"],["Adlam","Adlam"],["Caucasian_Albanian","Caucasian_Albanian"],["Arabic","Arabic"],["Imperial_Aramaic","Imperial_Aramaic"],["Armenian","Armenian"],["Avestan","Avestan"],["Balinese","Balinese"],["Bamum","Bamum"],["Bassa_Vah","Bassa_Vah"],["Batak","Batak"],["Bengali","Bengali"],["Bhaiksuki","Bhaiksuki"],["Bopomofo","Bopomofo"],["Brahmi","Brahmi"],["Braille","Braille"],["Buginese","Buginese"],["Buhid","Buhid"],["Chakma","Chakma"],["Canadian_Aboriginal","Canadian_Aboriginal"],["Carian","Carian"],["Cherokee","Cherokee"],["Coptic","Coptic"],["Cypriot","Cypriot"],["Cyrillic","Cyrillic"],["Devanagari","Devanagari"],["Dogra","Dogra"],["Deseret","Deseret"],["Duployan","Duployan"],["Egyptian_Hieroglyphs","Egyptian_Hieroglyphs"],["Elbasan","Elbasan"],["Ethiopic","Ethiopic"],["Georgian","Georgian"],["Glagolitic","Glagolitic"],["Gunjala_Gondi","Gunjala_Gondi"],["Masaram_Gondi","Masaram_Gondi"],["Gothic","Gothic"],["Grantha","Grantha"],["Greek","Greek"],["Gujarati","Gujarati"],["Gurmukhi","Gurmukhi"],["Hangul","Hangul"],["Han","Han"],["Hanunoo","Hanunoo"],["Hatran","Hatran"],["Hebrew","Hebrew"],["Hiragana","Hiragana"],["Anatolian_Hieroglyphs","Anatolian_Hieroglyphs"],["Pahawh_Hmong","Pahawh_Hmong"],["Katakana_Or_Hiragana","Katakana_Or_Hiragana"],["Old_Hungarian","Old_Hungarian"],["Old_Italic","Old_Italic"],["Javanese","Javanese"],["Kayah_Li","Kayah_Li"],["Katakana","Katakana"],["Kharoshthi","Kharoshthi"],["Khmer","Khmer"],["Khojki","Khojki"],["Kannada","Kannada"],["Kaithi","Kaithi"],["Tai_Tham","Tai_Tham"],["Lao","Lao"],["Latin","Latin"],["Lepcha","Lepcha"],["Limbu","Limbu"],["Linear_A","Linear_A"],["Linear_B","Linear_B"],["Lycian","Lycian"],["Lydian","Lydian"],["Mahajani","Mahajani"],["Makasar","Makasar"],["Mandaic","Mandaic"],["Manichaean","Manichaean"],["Marchen","Marchen"],["Medefaidrin","Medefaidrin"],["Mende_Kikakui","Mende_Kikakui"],["Meroitic_Cursive","Meroitic_Cursive"],["Meroitic_Hieroglyphs","Meroitic_Hieroglyphs"],["Malayalam","Malayalam"],["Mongolian","Mongolian"],["Mro","Mro"],["Meetei_Mayek","Meetei_Mayek"],["Multani","Multani"],["Myanmar","Myanmar"],["Old_North_Arabian","Old_North_Arabian"],["Nabataean","Nabataean"],["Nko","Nko"],["Nushu","Nushu"],["Ogham","Ogham"],["Ol_Chiki","Ol_Chiki"],["Old_Turkic","Old_Turkic"],["Oriya","Oriya"],["Osage","Osage"],["Osmanya","Osmanya"],["Palmyrene","Palmyrene"],["Pau_Cin_Hau","Pau_Cin_Hau"],["Old_Permic","Old_Permic"],["Phags_Pa","Phags_Pa"],["Inscriptional_Pahlavi","Inscriptional_Pahlavi"],["Psalter_Pahlavi","Psalter_Pahlavi"],["Phoenician","Phoenician"],["Miao","Miao"],["Inscriptional_Parthian","Inscriptional_Parthian"],["Rejang","Rejang"],["Hanifi_Rohingya","Hanifi_Rohingya"],["Runic","Runic"],["Samaritan","Samaritan"],["Old_South_Arabian","Old_South_Arabian"],["Saurashtra","Saurashtra"],["SignWriting","SignWriting"],["Shavian","Shavian"],["Sharada","Sharada"],["Siddham","Siddham"],["Khudawadi","Khudawadi"],["Sinhala","Sinhala"],["Sogdian","Sogdian"],["Old_Sogdian","Old_Sogdian"],["Sora_Sompeng","Sora_Sompeng"],["Soyombo","Soyombo"],["Sundanese","Sundanese"],["Syloti_Nagri","Syloti_Nagri"],["Syriac","Syriac"],["Tagbanwa","Tagbanwa"],["Takri","Takri"],["Tai_Le","Tai_Le"],["New_Tai_Lue","New_Tai_Lue"],["Tamil","Tamil"],["Tangut","Tangut"],["Tai_Viet","Tai_Viet"],["Telugu","Telugu"],["Tifinagh","Tifinagh"],["Tagalog","Tagalog"],["Thaana","Thaana"],["Tibetan","Tibetan"],["Tirhuta","Tirhuta"],["Ugaritic","Ugaritic"],["Vai","Vai"],["Warang_Citi","Warang_Citi"],["Old_Persian","Old_Persian"],["Cuneiform","Cuneiform"],["Yi","Yi"],["Zanabazar_Square","Zanabazar_Square"],["Inherited","Inherited"],["Common","Common"],["Unknown","Unknown"]])]]);var mappings$1=/* @__PURE__ */_mergeNamespaces({__proto__:null,"default":mappings},[mappings]);var require$$1$6=/* @__PURE__ */getAugmentedNamespace(mappings$1);var propertyToValueAliases=require$$1$6;var matchPropertyValue=function(property,value){const aliasToValue=propertyToValueAliases.get(property);if(!aliasToValue){throw new Error(`Unknown property \`${property}\`.`);}const canonicalValue=aliasToValue.get(value);if(canonicalValue){return canonicalValue;}throw new Error(`Unknown value \`${value}\` for property \`${property}\`.`);};var unicodeMatchPropertyValueEcmascript=matchPropertyValue;var unicodeMatchPropertyValueEcmascript$1=/* @__PURE__ */_mergeNamespaces({__proto__:null,"default":unicodeMatchPropertyValueEcmascript},[unicodeMatchPropertyValueEcmascript]);var require$$0$8=/* @__PURE__ */getAugmentedNamespace(unicodeMatchPropertyValueEcmascript$1);var unicodeCanonicalPropertyNamesEcmascript=/* @__PURE__ */new Set(["General_Category","Script","Script_Extensions","Alphabetic","Any","ASCII","ASCII_Hex_Digit","Assigned","Bidi_Control","Bidi_Mirrored","Case_Ignorable","Cased","Changes_When_Casefolded","Changes_When_Casemapped","Changes_When_Lowercased","Changes_When_NFKC_Casefolded","Changes_When_Titlecased","Changes_When_Uppercased","Dash","Default_Ignorable_Code_Point","Deprecated","Diacritic","Emoji","Emoji_Component","Emoji_Modifier","Emoji_Modifier_Base","Emoji_Presentation","Extended_Pictographic","Extender","Grapheme_Base","Grapheme_Extend","Hex_Digit","ID_Continue","ID_Start","Ideographic","IDS_Binary_Operator","IDS_Trinary_Operator","Join_Control","Logical_Order_Exception","Lowercase","Math","Noncharacter_Code_Point","Pattern_Syntax","Pattern_White_Space","Quotation_Mark","Radical","Regional_Indicator","Sentence_Terminal","Soft_Dotted","Terminal_Punctuation","Unified_Ideograph","Uppercase","Variation_Selector","White_Space","XID_Continue","XID_Start"]);var unicodeCanonicalPropertyNamesEcmascript$1=/* @__PURE__ */_mergeNamespaces({__proto__:null,"default":unicodeCanonicalPropertyNamesEcmascript},[unicodeCanonicalPropertyNamesEcmascript]);var require$$0$7=/* @__PURE__ */getAugmentedNamespace(unicodeCanonicalPropertyNamesEcmascript$1);var unicodePropertyAliasesEcmascript=/* @__PURE__ */new Map([["scx","Script_Extensions"],["sc","Script"],["gc","General_Category"],["AHex","ASCII_Hex_Digit"],["Alpha","Alphabetic"],["Bidi_C","Bidi_Control"],["Bidi_M","Bidi_Mirrored"],["Cased","Cased"],["CI","Case_Ignorable"],["CWCF","Changes_When_Casefolded"],["CWCM","Changes_When_Casemapped"],["CWKCF","Changes_When_NFKC_Casefolded"],["CWL","Changes_When_Lowercased"],["CWT","Changes_When_Titlecased"],["CWU","Changes_When_Uppercased"],["Dash","Dash"],["Dep","Deprecated"],["DI","Default_Ignorable_Code_Point"],["Dia","Diacritic"],["Ext","Extender"],["Gr_Base","Grapheme_Base"],["Gr_Ext","Grapheme_Extend"],["Hex","Hex_Digit"],["IDC","ID_Continue"],["Ideo","Ideographic"],["IDS","ID_Start"],["IDSB","IDS_Binary_Operator"],["IDST","IDS_Trinary_Operator"],["Join_C","Join_Control"],["LOE","Logical_Order_Exception"],["Lower","Lowercase"],["Math","Math"],["NChar","Noncharacter_Code_Point"],["Pat_Syn","Pattern_Syntax"],["Pat_WS","Pattern_White_Space"],["QMark","Quotation_Mark"],["Radical","Radical"],["RI","Regional_Indicator"],["SD","Soft_Dotted"],["STerm","Sentence_Terminal"],["Term","Terminal_Punctuation"],["UIdeo","Unified_Ideograph"],["Upper","Uppercase"],["VS","Variation_Selector"],["WSpace","White_Space"],["space","White_Space"],["XIDC","XID_Continue"],["XIDS","XID_Start"]]);var unicodePropertyAliasesEcmascript$1=/* @__PURE__ */_mergeNamespaces({__proto__:null,"default":unicodePropertyAliasesEcmascript},[unicodePropertyAliasesEcmascript]);var require$$3$4=/* @__PURE__ */getAugmentedNamespace(unicodePropertyAliasesEcmascript$1);var canonicalProperties=require$$0$7;var propertyAliases=require$$3$4;var matchProperty=function(property){if(canonicalProperties.has(property)){return property;}if(propertyAliases.has(property)){return propertyAliases.get(property);}throw new Error(`Unknown property: ${property}`);};var unicodeMatchPropertyEcmascript=matchProperty;var unicodeMatchPropertyEcmascript$1=/* @__PURE__ */_mergeNamespaces({__proto__:null,"default":unicodeMatchPropertyEcmascript},[unicodeMatchPropertyEcmascript]);var require$$2$4=/* @__PURE__ */getAugmentedNamespace(unicodeMatchPropertyEcmascript$1);var unicode$3={};var idContinueBool_1$1;var idContinueLargeRegex_1$1;var idStartBool_1$1;var idStartLargeRegex_1$1;var whitespaceBool_1$1;var whitespaceArray_1$1;Object.defineProperty(unicode$3,"__esModule",{value:true});whitespaceArray_1$1=unicode$3.whitespaceArray=[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];whitespaceBool_1$1=unicode$3.whitespaceBool=[false,false,false,false,false,false,false,false,false,true,false,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false];idStartLargeRegex_1$1=unicode$3.idStartLargeRegex=/^[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\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\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\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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-\u2C2E\u2C30-\u2C5E\u2C60-\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-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]$/;idStartBool_1$1=unicode$3.idStartBool=[false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,true,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false];idContinueLargeRegex_1$1=unicode$3.idContinueLargeRegex=/^[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]$/;idContinueBool_1$1=unicode$3.idContinueBool=[false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,true,false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false,false,false,false];var unicode$2=/* @__PURE__ */_mergeNamespaces({__proto__:null,get whitespaceArray(){return whitespaceArray_1$1;},get whitespaceBool(){return whitespaceBool_1$1;},get idStartLargeRegex(){return idStartLargeRegex_1$1;},get idStartBool(){return idStartBool_1$1;},get idContinueLargeRegex(){return idContinueLargeRegex_1$1;},get idContinueBool(){return idContinueBool_1$1;},"default":unicode$3},[unicode$3]);var require$$4$2=/* @__PURE__ */getAugmentedNamespace(unicode$2);Object.defineProperty(dist$a,"__esModule",{value:true});var _createClass$d=function(){function defineProperties(target,props){for(var i2=0;i2=this.pattern.length;}},{key:"backreference",value:function backreference(ref){if(ref>this.largestBackreference){this.largestBackreference=ref;}}},{key:"nextCodePoint",value:function nextCodePoint(){if(this.empty()){return null;}if(this.unicode){return String.fromCodePoint(this.pattern.codePointAt(this.index));}return this.pattern.charAt(this.index);}},{key:"skipCodePoint",value:function skipCodePoint(){this.index+=this.nextCodePoint().length;}},{key:"eat",value:function eat(str){if(this.index+str.length>this.pattern.length||this.pattern.slice(this.index,this.index+str.length)!==str){return false;}this.index+=str.length;return true;}},{key:"eatIdentifierCodePoint",value:function eatIdentifierCodePoint(){var characterValue=void 0;var originalIndex=this.index;var character=void 0;if(this.match("\\u")){this.skipCodePoint();characterValue=acceptUnicodeEscape(this);if(!characterValue.matched){this.index=originalIndex;return null;}characterValue=characterValue.value;character=String.fromCodePoint(characterValue);}else{character=this.nextCodePoint();if(character==null){this.index=originalIndex;return null;}this.index+=character.length;characterValue=character.codePointAt(0);}return{character,characterValue};}},{key:"eatIdentifierStart",value:function eatIdentifierStart(){var originalIndex=this.index;var codePoint=this.eatIdentifierCodePoint();if(codePoint===null){this.index=originalIndex;return null;}if(codePoint.character==="_"||codePoint.character==="$"||isIdentifierStart(codePoint.characterValue)){return codePoint.character;}this.index=originalIndex;return null;}},{key:"eatIdentifierPart",value:function eatIdentifierPart(){var originalIndex=this.index;var codePoint=this.eatIdentifierCodePoint();if(codePoint===null){this.index=originalIndex;return null;}if(codePoint.character==="\u200C"||codePoint.character==="\u200D"||codePoint.character==="$"||isIdentifierPart(codePoint.characterValue)){return codePoint.character;}this.index=originalIndex;return null;}},{key:"eatAny",value:function eatAny(){for(var _len=arguments.length,strs=Array(_len),_key=0;_key<_len;_key++){strs[_key]=arguments[_key];}var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=void 0;try{for(var _iterator=strs[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var str=_step.value;if(this.eat(str)){return str;}}}catch(err){_didIteratorError=true;_iteratorError=err;}finally{try{if(!_iteratorNormalCompletion&&_iterator.return){_iterator.return();}}finally{if(_didIteratorError){throw _iteratorError;}}}return null;}},{key:"match",value:function match(str){return this.index+str.length<=this.pattern.length&&this.pattern.slice(this.index,this.index+str.length)===str;}},{key:"matchAny",value:function matchAny(){for(var _len2=arguments.length,strs=Array(_len2),_key2=0;_key2<_len2;_key2++){strs[_key2]=arguments[_key2];}var _iteratorNormalCompletion2=true;var _didIteratorError2=false;var _iteratorError2=void 0;try{for(var _iterator2=strs[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var str=_step2.value;if(this.match(str)){return true;}}}catch(err){_didIteratorError2=true;_iteratorError2=err;}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return){_iterator2.return();}}finally{if(_didIteratorError2){throw _iteratorError2;}}}return false;}},{key:"eatNaturalNumber",value:function eatNaturalNumber(){var _this=this;var characters=[];var eatNumber=function eatNumber2(){var _iteratorNormalCompletion3=true;var _didIteratorError3=false;var _iteratorError3=void 0;try{for(var _iterator3=decimalDigits[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var str=_step3.value;if(_this.eat(str)){characters.push(str);return true;}}}catch(err){_didIteratorError3=true;_iteratorError3=err;}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return){_iterator3.return();}}finally{if(_didIteratorError3){throw _iteratorError3;}}}return false;};while(eatNumber()){}return characters.length===0?null:characters.join("");}}]);return PatternAcceptorState2;}();var _default$b=dist$a["default"]=function(pattern){var _ref=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_ref$unicode=_ref.unicode,unicode2=_ref$unicode===void 0?false:_ref$unicode;var state=new PatternAcceptorState(pattern,unicode2);var accepted=acceptDisjunction(state);if(accepted.matched){if(state.unicode){if(state.largestBackreference>state.capturingGroups){return false;}}if(state.groupingNames.length>0||state.unicode){var _iteratorNormalCompletion4=true;var _didIteratorError4=false;var _iteratorError4=void 0;try{for(var _iterator4=state.backreferenceNames[Symbol.iterator](),_step4;!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=true){var backreferenceName=_step4.value;if(state.groupingNames.indexOf(backreferenceName)===-1){return false;}}}catch(err){_didIteratorError4=true;_iteratorError4=err;}finally{try{if(!_iteratorNormalCompletion4&&_iterator4.return){_iterator4.return();}}finally{if(_didIteratorError4){throw _iteratorError4;}}}}}return accepted.matched;};var backtrackOnFailure=function backtrackOnFailure2(func){return function(state){var savedIndex=state.index;var oldBackreference=state.largestBackreference;var oldCapturingGroups=state.capturingGroups;var val=func(state);if(!val.matched){state.index=savedIndex;state.largestBackreference=oldBackreference;state.capturingGroups=oldCapturingGroups;}return val;};};var acceptUnicodeEscape=backtrackOnFailure(function(state){if(!state.eat("u")){return{matched:false};}if(state.unicode&&state.eat("{")){var _digits=[];while(!state.eat("}")){var digit=state.eatAny.apply(state,_toConsumableArray$6(hexDigits));if(digit===null){return{matched:false};}_digits.push(digit);}var _value=parseInt(_digits.join(""),16);return _value>1114111?{matched:false}:{matched:true,value:_value};}var digits=[0,0,0,0].map(function(){return state.eatAny.apply(state,_toConsumableArray$6(hexDigits));});if(digits.some(function(digit2){return digit2===null;})){return{matched:false};}var value=parseInt(digits.join(""),16);if(state.unicode&&value>=55296&&value<=56319){var surrogatePairValue=backtrackOnFailure(function(subState){if(!subState.eat("\\u")){return{matched:false};}var digits2=[0,0,0,0].map(function(){return subState.eatAny.apply(subState,_toConsumableArray$6(hexDigits));});if(digits2.some(function(digit2){return digit2===null;})){return{matched:false};}var value2=parseInt(digits2.join(""),16);if(value2<56320||value2>=57344){return{matched:false};}return{matched:true,value:65536+((value&1023)<<10)+(value2&1023)};})(state);if(surrogatePairValue.matched){return surrogatePairValue;}}return{matched:true,value};});var acceptDisjunction=function acceptDisjunction2(state,terminator){do{if(terminator!==void 0&&state.eat(terminator)){return{matched:true};}else if(state.match("|")){continue;}if(!acceptAlternative(state,terminator).matched){return{matched:false};}}while(state.eat("|"));return{matched:terminator===void 0||!!state.eat(terminator)};};var acceptAlternative=function acceptAlternative2(state,terminator){while(!state.match("|")&&!state.empty()&&(terminator===void 0||!state.match(terminator))){if(!acceptTerm(state).matched){return{matched:false};}}return{matched:true};};var anyOf=function anyOf2(){for(var _len3=arguments.length,acceptors=Array(_len3),_key3=0;_key3<_len3;_key3++){acceptors[_key3]=arguments[_key3];}return function(state){var _iteratorNormalCompletion5=true;var _didIteratorError5=false;var _iteratorError5=void 0;try{for(var _iterator5=acceptors[Symbol.iterator](),_step5;!(_iteratorNormalCompletion5=(_step5=_iterator5.next()).done);_iteratorNormalCompletion5=true){var predicate=_step5.value;var value=predicate(state);if(value.matched){return value;}}}catch(err){_didIteratorError5=true;_iteratorError5=err;}finally{try{if(!_iteratorNormalCompletion5&&_iterator5.return){_iterator5.return();}}finally{if(_didIteratorError5){throw _iteratorError5;}}}return{matched:false};};};var acceptTerm=function acceptTerm2(state){if(state.unicode){return anyOf(acceptAssertion,acceptQuantified(acceptAtom))(state);}return anyOf(acceptQuantified(acceptQuantifiableAssertion),acceptAssertion,acceptQuantified(acceptAtom))(state);};var acceptLabeledGroup=function acceptLabeledGroup2(predicate){return backtrackOnFailure(function(state){if(!state.eat("(")){return{matched:false};}if(predicate(state)){return acceptDisjunction(state,")");}return{matched:false};});};var acceptQuantifiableAssertion=acceptLabeledGroup(function(state){return!!state.eatAny("?=","?!");});var acceptAssertion=function acceptAssertion2(state){if(state.eatAny("^","$","\\b","\\B")){return{matched:true};}return acceptLabeledGroup(function(subState){return subState.unicode?!!subState.eatAny("?=","?!","?<=","?parseInt(num2)){return{matched:false};}}if(!subState.eat("}")){return{matched:false};}subState.eat("?");return{matched:true};})(state);if(!value.matched){return{matched:!state.unicode};}return value;}else if(state.eatAny("*","+","?")){state.eat("?");}return{matched:true};});};var acceptCharacterExcept=function acceptCharacterExcept2(characters){return function(state){var nextCodePoint=state.nextCodePoint();if(nextCodePoint===null||characters.indexOf(nextCodePoint)!==-1){return{matched:false};}state.skipCodePoint();return{matched:true};};};var acceptPatternCharacter=acceptCharacterExcept(syntaxCharacters);var acceptExtendedPatternCharacter=acceptCharacterExcept(extendedSyntaxCharacters);var acceptInvalidBracedQuantifier=function acceptInvalidBracedQuantifier2(state){return backtrackOnFailure(function(subState){return{matched:!!(subState.eat("{")&&acceptDecimal(subState).matched&&(!subState.eat(",")||subState.match("}")||acceptDecimal(subState).matched)&&subState.eat("}"))};})(state);};var acceptAtom=function acceptAtom2(state){if(state.unicode){return anyOf(acceptPatternCharacter,function(subState){return{matched:!!subState.eat(".")};},backtrackOnFailure(function(subState){return subState.eat("\\")?acceptAtomEscape(subState):{matched:false};}),acceptCharacterClass,acceptLabeledGroup(function(subState){return subState.eat("?:");}),acceptGrouping)(state);}var matched=anyOf(function(subState){return{matched:!!subState.eat(".")};},backtrackOnFailure(function(subState){return subState.eat("\\")?acceptAtomEscape(subState):{matched:false};}),backtrackOnFailure(function(subState){return{matched:subState.eat("\\")&&subState.match("c")};}),acceptCharacterClass,acceptLabeledGroup(function(subState){return subState.eat("?:");}),acceptGrouping)(state);if(!matched.matched&&acceptInvalidBracedQuantifier(state).matched){return{matched:false};}return matched.matched?matched:acceptExtendedPatternCharacter(state);};var acceptGrouping=backtrackOnFailure(function(state){if(!state.eat("(")){return{matched:false};}var groupName=backtrackOnFailure(function(subState){if(!state.eat("?")){return{matched:false};}return acceptGroupName(subState);})(state);if(!acceptDisjunction(state,")").matched){return{matched:false};}if(groupName.matched){if(state.groupingNames.indexOf(groupName.data)!==-1){return{matched:false};}state.groupingNames.push(groupName.data);}state.capturingGroups++;return{matched:true};});var acceptDecimalEscape=backtrackOnFailure(function(state){var firstDecimal=state.eatAny.apply(state,_toConsumableArray$6(decimalDigits));if(firstDecimal===null){return{matched:false};}if(firstDecimal==="0"){return{matched:true};}state.backreference(parseInt(firstDecimal+(state.eatNaturalNumber()||"")));return{matched:true};});var acceptCharacterClassEscape=function acceptCharacterClassEscape2(state){if(state.eatAny("d","D","s","S","w","W")){return{matched:true};}if(state.unicode){return backtrackOnFailure(function(subState){if(!subState.eat("p{")&&!subState.eat("P{")){return{matched:false};}if(!acceptUnicodePropertyValueExpression(subState).matched){return{matched:false};}return{matched:!!subState.eat("}")};})(state);}return{matched:false};};var acceptUnicodePropertyName=function acceptUnicodePropertyName2(state){var characters=[];var character=void 0;while(character=state.eatAny.apply(state,_toConsumableArray$6(controlCharacters).concat(["_"]))){characters.push(character);}return{matched:characters.length>0,data:characters.join("")};};var acceptUnicodePropertyValue=function acceptUnicodePropertyValue2(state){var characters=[];var character=void 0;while(character=state.eatAny.apply(state,_toConsumableArray$6(controlCharacters).concat(_toConsumableArray$6(decimalDigits),["_"]))){characters.push(character);}return{matched:characters.length>0,data:characters.join("")};};var illegalLoneUnicodePropertyNames=["General_Category","Script","Script_Extensions","scx","sc","gc"];var generalCategoryValues=_mappings2["default"].get("General_Category");var acceptLoneUnicodePropertyNameOrValue=function acceptLoneUnicodePropertyNameOrValue2(state){var loneValue=acceptUnicodePropertyValue(state);if(!loneValue.matched||illegalLoneUnicodePropertyNames.includes(loneValue.data)){return{matched:false};}return{matched:catchIsFalse(function(){return(0,_unicodeMatchPropertyEcmascript2.default)(loneValue.data);})||generalCategoryValues.get(loneValue.data)!=null};};var acceptUnicodePropertyValueExpression=function acceptUnicodePropertyValueExpression2(state){return anyOf(backtrackOnFailure(function(subState){var name=acceptUnicodePropertyName(subState);if(!name.matched||!subState.eat("=")){return{matched:false};}var value=acceptUnicodePropertyValue(subState);if(!value.matched){return{matched:false};}return{matched:catchIsFalse(function(){return(0,_unicodeMatchPropertyValueEcmascript2.default)(_unicodePropertyAliasesEcmascript2.default.get(name.data)||name.data,value.data);})};}),backtrackOnFailure(acceptLoneUnicodePropertyNameOrValue))(state);};var acceptCharacterEscape=anyOf(function(state){var eaten=state.eatAny.apply(state,_toConsumableArray$6(controlEscapeCharacters));if(eaten===null){return{matched:false};}return{matched:true,value:controlEscapeCharacterValues[eaten]};},backtrackOnFailure(function(state){if(!state.eat("c")){return{matched:false};}var character=state.eatAny.apply(state,_toConsumableArray$6(controlCharacters));if(character===null){return{matched:false};}return{matched:true,value:character.charCodeAt(0)%32};}),backtrackOnFailure(function(state){if(!state.eat("0")||state.eatAny.apply(state,_toConsumableArray$6(decimalDigits))){return{matched:false};}return{matched:true,value:0};}),backtrackOnFailure(function(state){if(!state.eat("x")){return{matched:false};}var digits=[0,0].map(function(){return state.eatAny.apply(state,_toConsumableArray$6(hexDigits));});if(digits.some(function(value){return value===null;})){return{matched:false};}return{matched:true,value:parseInt(digits.join(""),16)};}),acceptUnicodeEscape,backtrackOnFailure(function(state){if(state.unicode){return{matched:false};}var octal1=state.eatAny.apply(state,_toConsumableArray$6(octalDigits));if(octal1===null){return{matched:false};}var octal1Value=parseInt(octal1,8);if(octalDigits.indexOf(state.nextCodePoint())===-1){return{matched:true,value:octal1Value};}var octal2=state.eatAny.apply(state,_toConsumableArray$6(octalDigits));var octal2Value=parseInt(octal2,8);if(octal1Value<4){if(octalDigits.indexOf(state.nextCodePoint())===-1){return{matched:true,value:octal1Value<<3|octal2Value};}var octal3=state.eatAny.apply(state,_toConsumableArray$6(octalDigits));var octal3Value=parseInt(octal3,8);return{matched:true,value:octal1Value<<6|octal2Value<<3|octal3Value};}return{matched:true,value:octal1Value<<3|octal2Value};}),backtrackOnFailure(function(state){if(!state.unicode){return{matched:false};}var value=state.eatAny.apply(state,_toConsumableArray$6(syntaxCharacters));if(value===null){return{matched:false};}return{matched:true,value:value.charCodeAt(0)};}),function(state){if(!state.unicode||!state.eat("/")){return{matched:false};}return{matched:true,value:"/".charCodeAt(0)};},backtrackOnFailure(function(state){if(state.unicode){return{matched:false};}var next2=state.nextCodePoint();if(next2!==null&&next2!=="c"&&next2!=="k"){state.skipCodePoint();return{matched:true,value:next2.codePointAt(0)};}return{matched:false};}));var acceptGroupNameBackreference=backtrackOnFailure(function(state){if(!state.eat("k")){return{matched:false};}var name=acceptGroupName(state);if(!name.matched){state.backreferenceNames.push(INVALID_NAMED_BACKREFERENCE_SENTINEL);return{matched:true};}state.backreferenceNames.push(name.data);return{matched:true};});var acceptGroupName=backtrackOnFailure(function(state){if(!state.eat("<")){return{matched:false};}var characters=[];var start=state.eatIdentifierStart();if(!start){return{matched:false};}characters.push(start);var part=void 0;while(part=state.eatIdentifierPart()){characters.push(part);}if(!state.eat(">")){return{matched:false};}return{matched:characters.length>0,data:characters.join("")};});var acceptAtomEscape=anyOf(acceptDecimalEscape,acceptCharacterClassEscape,acceptCharacterEscape,acceptGroupNameBackreference);var acceptCharacterClass=backtrackOnFailure(function(state){if(!state.eat("[")){return{matched:false};}state.eat("^");var acceptClassEscape=anyOf(function(subState){return{matched:!!subState.eat("b"),value:8};},function(subState){return{matched:subState.unicode&&!!subState.eat("-"),value:"-".charCodeAt(0)};},backtrackOnFailure(function(subState){if(subState.unicode||!subState.eat("c")){return{matched:false};}var character=subState.eatAny.apply(subState,_toConsumableArray$6(decimalDigits).concat(["_"]));if(character===null){return{matched:false};}return{matched:true,value:character.charCodeAt(0)%32};}),acceptCharacterClassEscape,acceptCharacterEscape,function(subState){return{matched:!subState.unicode&&!!subState.eat("k"),value:107};});var acceptClassAtomNoDash=function acceptClassAtomNoDash2(localState){var nextCodePoint=localState.nextCodePoint();if(nextCodePoint==="]"||nextCodePoint==="-"||nextCodePoint===null){return{matched:false};}if(nextCodePoint!=="\\"){localState.skipCodePoint();return{matched:true,value:nextCodePoint.codePointAt(0)};}localState.eat("\\");var classEscape=acceptClassEscape(localState);if(!classEscape.matched&&localState.nextCodePoint()==="c"&&!localState.unicode){return{matched:true,value:"\\".charCodeAt(0)};}return classEscape;};var acceptClassAtom=function acceptClassAtom2(localState){if(localState.eat("-")){return{matched:true,value:"-".charCodeAt(0)};}return acceptClassAtomNoDash(localState);};var finishClassRange=function finishClassRange2(localState,atom){var isUnvaluedPassedAtom=function isUnvaluedPassedAtom2(subAtom){return subAtom.value===void 0&&subAtom.matched;};if(localState.eat("-")){if(localState.match("]")){return{matched:true};}var otherAtom=acceptClassAtom(localState);if(!otherAtom.matched){return{matched:false};}if(localState.unicode&&(isUnvaluedPassedAtom(atom)||isUnvaluedPassedAtom(otherAtom))){return{matched:false};}else if(!(!localState.unicode&&(isUnvaluedPassedAtom(atom)||isUnvaluedPassedAtom(otherAtom)))&&atom.value>otherAtom.value){return{matched:false};}else if(localState.match("]")){return{matched:true};}return acceptNonEmptyClassRanges(localState);}if(localState.match("]")){return{matched:true};}return acceptNonEmptyClassRangesNoDash(localState);};var acceptNonEmptyClassRanges=function acceptNonEmptyClassRanges2(localState){var atom=acceptClassAtom(localState);return atom.matched?finishClassRange(localState,atom):{matched:false};};var acceptNonEmptyClassRangesNoDash=function acceptNonEmptyClassRangesNoDash2(localState){var atom=acceptClassAtomNoDash(localState);return atom.matched?finishClassRange(localState,atom):{matched:false};};if(state.eat("]")){return{matched:true};}var value=acceptNonEmptyClassRanges(state);if(value.matched){state.eat("]");}return value;});var dist$9=/* @__PURE__ */_mergeNamespaces({__proto__:null,"default":_default$b},[dist$a]);var require$$1$5=/* @__PURE__ */getAugmentedNamespace(dist$9);var dist$8={};var YieldGeneratorExpression_1$1;var YieldExpression_1$1;var WithStatement_1$1;var WhileStatement_1$1;var VariableDeclarator_1$1;var VariableDeclarationStatement_1$1;var VariableDeclaration_1$1;var UpdateExpression_1$1;var UnaryExpression_1$1;var TryFinallyStatement_1$1;var TryCatchStatement_1$1;var ThrowStatement_1$1;var ThisExpression_1$1;var TemplateExpression_1$1;var TemplateElement_1$1;var SwitchStatementWithDefault_1$1;var SwitchStatement_1$1;var SwitchDefault_1$1;var SwitchCase_1$1;var Super_1$1;var StaticPropertyName_1$1;var StaticMemberExpression_1$1;var StaticMemberAssignmentTarget_1$1;var SpreadProperty_1$1;var SpreadElement_1$1;var ShorthandProperty_1$1;var Setter_1$1;var Script_1$1;var ReturnStatement_1$1;var ObjectExpression_1$1;var ObjectBinding_1$1;var ObjectAssignmentTarget_1$1;var NewTargetExpression_1$1;var NewExpression_1$1;var Module_1$1;var Method_1$1;var LiteralStringExpression_1$1;var LiteralRegExpExpression_1$1;var LiteralNumericExpression_1$1;var LiteralNullExpression_1$1;var LiteralInfinityExpression_1$1;var LiteralBooleanExpression_1$1;var LabeledStatement_1$1;var ImportSpecifier_1$1;var ImportNamespace_1$1;var Import_1$1;var IfStatement_1$1;var IdentifierExpression_1$1;var Getter_1$1;var FunctionExpression_1$1;var FunctionDeclaration_1$1;var FunctionBody_1$1;var FormalParameters_1$1;var ForStatement_1$1;var ForOfStatement_1$1;var ForInStatement_1$1;var ForAwaitStatement_1$1;var ExpressionStatement_1$1;var ExportLocals_1$1;var ExportLocalSpecifier_1$1;var ExportFromSpecifier_1$1;var ExportFrom_1$1;var ExportDefault_1$1;var ExportAllFrom_1$1;var Export_1$1;var EmptyStatement_1$1;var DoWhileStatement_1$1;var Directive_1$1;var DebuggerStatement_1$1;var DataProperty_1$1;var ContinueStatement_1$1;var ConditionalExpression_1$1;var ComputedPropertyName_1$1;var ComputedMemberExpression_1$1;var ComputedMemberAssignmentTarget_1$1;var CompoundAssignmentExpression_1$1;var ClassExpression_1$1;var ClassElement_1$1;var ClassDeclaration_1$1;var CatchClause_1$1;var CallExpression_1$1;var BreakStatement_1$1;var BlockStatement_1$1;var Block_1$1;var BindingWithDefault_1$1;var BindingPropertyProperty_1$1;var BindingPropertyIdentifier_1$1;var BindingIdentifier_1$1;var BinaryExpression_1$1;var AwaitExpression_1$1;var AssignmentTargetWithDefault_1$1;var AssignmentTargetPropertyProperty_1$1;var AssignmentTargetPropertyIdentifier_1$1;var AssignmentTargetIdentifier_1$1;var AssignmentExpression_1$1;var ArrowExpression_1$1;var ArrayExpression_1$1;var ArrayBinding_1$1;var ArrayAssignmentTarget_1$1;Object.defineProperty(dist$8,"__esModule",{value:true});function _classCallCheck$g(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}ArrayAssignmentTarget_1$1=dist$8.ArrayAssignmentTarget=function ArrayAssignmentTarget(_ref){var elements=_ref.elements,rest=_ref.rest;_classCallCheck$g(this,ArrayAssignmentTarget);this.type="ArrayAssignmentTarget";this.elements=elements;this.rest=rest;};ArrayBinding_1$1=dist$8.ArrayBinding=function ArrayBinding(_ref2){var elements=_ref2.elements,rest=_ref2.rest;_classCallCheck$g(this,ArrayBinding);this.type="ArrayBinding";this.elements=elements;this.rest=rest;};ArrayExpression_1$1=dist$8.ArrayExpression=function ArrayExpression(_ref3){var elements=_ref3.elements;_classCallCheck$g(this,ArrayExpression);this.type="ArrayExpression";this.elements=elements;};ArrowExpression_1$1=dist$8.ArrowExpression=function ArrowExpression(_ref4){var isAsync=_ref4.isAsync,params=_ref4.params,body=_ref4.body;_classCallCheck$g(this,ArrowExpression);this.type="ArrowExpression";this.isAsync=isAsync;this.params=params;this.body=body;};AssignmentExpression_1$1=dist$8.AssignmentExpression=function AssignmentExpression(_ref5){var binding=_ref5.binding,expression=_ref5.expression;_classCallCheck$g(this,AssignmentExpression);this.type="AssignmentExpression";this.binding=binding;this.expression=expression;};AssignmentTargetIdentifier_1$1=dist$8.AssignmentTargetIdentifier=function AssignmentTargetIdentifier(_ref6){var name=_ref6.name;_classCallCheck$g(this,AssignmentTargetIdentifier);this.type="AssignmentTargetIdentifier";this.name=name;};AssignmentTargetPropertyIdentifier_1$1=dist$8.AssignmentTargetPropertyIdentifier=function AssignmentTargetPropertyIdentifier(_ref7){var binding=_ref7.binding,init=_ref7.init;_classCallCheck$g(this,AssignmentTargetPropertyIdentifier);this.type="AssignmentTargetPropertyIdentifier";this.binding=binding;this.init=init;};AssignmentTargetPropertyProperty_1$1=dist$8.AssignmentTargetPropertyProperty=function AssignmentTargetPropertyProperty(_ref8){var name=_ref8.name,binding=_ref8.binding;_classCallCheck$g(this,AssignmentTargetPropertyProperty);this.type="AssignmentTargetPropertyProperty";this.name=name;this.binding=binding;};AssignmentTargetWithDefault_1$1=dist$8.AssignmentTargetWithDefault=function AssignmentTargetWithDefault(_ref9){var binding=_ref9.binding,init=_ref9.init;_classCallCheck$g(this,AssignmentTargetWithDefault);this.type="AssignmentTargetWithDefault";this.binding=binding;this.init=init;};AwaitExpression_1$1=dist$8.AwaitExpression=function AwaitExpression(_ref10){var expression=_ref10.expression;_classCallCheck$g(this,AwaitExpression);this.type="AwaitExpression";this.expression=expression;};BinaryExpression_1$1=dist$8.BinaryExpression=function BinaryExpression(_ref11){var left=_ref11.left,operator=_ref11.operator,right=_ref11.right;_classCallCheck$g(this,BinaryExpression);this.type="BinaryExpression";this.left=left;this.operator=operator;this.right=right;};BindingIdentifier_1$1=dist$8.BindingIdentifier=function BindingIdentifier(_ref12){var name=_ref12.name;_classCallCheck$g(this,BindingIdentifier);this.type="BindingIdentifier";this.name=name;};BindingPropertyIdentifier_1$1=dist$8.BindingPropertyIdentifier=function BindingPropertyIdentifier(_ref13){var binding=_ref13.binding,init=_ref13.init;_classCallCheck$g(this,BindingPropertyIdentifier);this.type="BindingPropertyIdentifier";this.binding=binding;this.init=init;};BindingPropertyProperty_1$1=dist$8.BindingPropertyProperty=function BindingPropertyProperty(_ref14){var name=_ref14.name,binding=_ref14.binding;_classCallCheck$g(this,BindingPropertyProperty);this.type="BindingPropertyProperty";this.name=name;this.binding=binding;};BindingWithDefault_1$1=dist$8.BindingWithDefault=function BindingWithDefault(_ref15){var binding=_ref15.binding,init=_ref15.init;_classCallCheck$g(this,BindingWithDefault);this.type="BindingWithDefault";this.binding=binding;this.init=init;};Block_1$1=dist$8.Block=function Block(_ref16){var statements=_ref16.statements;_classCallCheck$g(this,Block);this.type="Block";this.statements=statements;};BlockStatement_1$1=dist$8.BlockStatement=function BlockStatement(_ref17){var block=_ref17.block;_classCallCheck$g(this,BlockStatement);this.type="BlockStatement";this.block=block;};BreakStatement_1$1=dist$8.BreakStatement=function BreakStatement(_ref18){var label=_ref18.label;_classCallCheck$g(this,BreakStatement);this.type="BreakStatement";this.label=label;};CallExpression_1$1=dist$8.CallExpression=function CallExpression(_ref19){var callee=_ref19.callee,_arguments=_ref19.arguments;_classCallCheck$g(this,CallExpression);this.type="CallExpression";this.callee=callee;this.arguments=_arguments;};CatchClause_1$1=dist$8.CatchClause=function CatchClause(_ref20){var binding=_ref20.binding,body=_ref20.body;_classCallCheck$g(this,CatchClause);this.type="CatchClause";this.binding=binding;this.body=body;};ClassDeclaration_1$1=dist$8.ClassDeclaration=function ClassDeclaration(_ref21){var name=_ref21.name,_super=_ref21.super,elements=_ref21.elements;_classCallCheck$g(this,ClassDeclaration);this.type="ClassDeclaration";this.name=name;this.super=_super;this.elements=elements;};ClassElement_1$1=dist$8.ClassElement=function ClassElement(_ref22){var isStatic=_ref22.isStatic,method=_ref22.method;_classCallCheck$g(this,ClassElement);this.type="ClassElement";this.isStatic=isStatic;this.method=method;};ClassExpression_1$1=dist$8.ClassExpression=function ClassExpression(_ref23){var name=_ref23.name,_super=_ref23.super,elements=_ref23.elements;_classCallCheck$g(this,ClassExpression);this.type="ClassExpression";this.name=name;this.super=_super;this.elements=elements;};CompoundAssignmentExpression_1$1=dist$8.CompoundAssignmentExpression=function CompoundAssignmentExpression(_ref24){var binding=_ref24.binding,operator=_ref24.operator,expression=_ref24.expression;_classCallCheck$g(this,CompoundAssignmentExpression);this.type="CompoundAssignmentExpression";this.binding=binding;this.operator=operator;this.expression=expression;};ComputedMemberAssignmentTarget_1$1=dist$8.ComputedMemberAssignmentTarget=function ComputedMemberAssignmentTarget(_ref25){var object=_ref25.object,expression=_ref25.expression;_classCallCheck$g(this,ComputedMemberAssignmentTarget);this.type="ComputedMemberAssignmentTarget";this.object=object;this.expression=expression;};ComputedMemberExpression_1$1=dist$8.ComputedMemberExpression=function ComputedMemberExpression(_ref26){var object=_ref26.object,expression=_ref26.expression;_classCallCheck$g(this,ComputedMemberExpression);this.type="ComputedMemberExpression";this.object=object;this.expression=expression;};ComputedPropertyName_1$1=dist$8.ComputedPropertyName=function ComputedPropertyName(_ref27){var expression=_ref27.expression;_classCallCheck$g(this,ComputedPropertyName);this.type="ComputedPropertyName";this.expression=expression;};ConditionalExpression_1$1=dist$8.ConditionalExpression=function ConditionalExpression(_ref28){var test=_ref28.test,consequent=_ref28.consequent,alternate=_ref28.alternate;_classCallCheck$g(this,ConditionalExpression);this.type="ConditionalExpression";this.test=test;this.consequent=consequent;this.alternate=alternate;};ContinueStatement_1$1=dist$8.ContinueStatement=function ContinueStatement(_ref29){var label=_ref29.label;_classCallCheck$g(this,ContinueStatement);this.type="ContinueStatement";this.label=label;};DataProperty_1$1=dist$8.DataProperty=function DataProperty(_ref30){var name=_ref30.name,expression=_ref30.expression;_classCallCheck$g(this,DataProperty);this.type="DataProperty";this.name=name;this.expression=expression;};DebuggerStatement_1$1=dist$8.DebuggerStatement=function DebuggerStatement(){_classCallCheck$g(this,DebuggerStatement);this.type="DebuggerStatement";};Directive_1$1=dist$8.Directive=function Directive(_ref31){var rawValue=_ref31.rawValue;_classCallCheck$g(this,Directive);this.type="Directive";this.rawValue=rawValue;};DoWhileStatement_1$1=dist$8.DoWhileStatement=function DoWhileStatement(_ref32){var body=_ref32.body,test=_ref32.test;_classCallCheck$g(this,DoWhileStatement);this.type="DoWhileStatement";this.body=body;this.test=test;};EmptyStatement_1$1=dist$8.EmptyStatement=function EmptyStatement(){_classCallCheck$g(this,EmptyStatement);this.type="EmptyStatement";};Export_1$1=dist$8.Export=function Export(_ref33){var declaration=_ref33.declaration;_classCallCheck$g(this,Export);this.type="Export";this.declaration=declaration;};ExportAllFrom_1$1=dist$8.ExportAllFrom=function ExportAllFrom(_ref34){var moduleSpecifier=_ref34.moduleSpecifier;_classCallCheck$g(this,ExportAllFrom);this.type="ExportAllFrom";this.moduleSpecifier=moduleSpecifier;};ExportDefault_1$1=dist$8.ExportDefault=function ExportDefault(_ref35){var body=_ref35.body;_classCallCheck$g(this,ExportDefault);this.type="ExportDefault";this.body=body;};ExportFrom_1$1=dist$8.ExportFrom=function ExportFrom(_ref36){var namedExports=_ref36.namedExports,moduleSpecifier=_ref36.moduleSpecifier;_classCallCheck$g(this,ExportFrom);this.type="ExportFrom";this.namedExports=namedExports;this.moduleSpecifier=moduleSpecifier;};ExportFromSpecifier_1$1=dist$8.ExportFromSpecifier=function ExportFromSpecifier(_ref37){var name=_ref37.name,exportedName=_ref37.exportedName;_classCallCheck$g(this,ExportFromSpecifier);this.type="ExportFromSpecifier";this.name=name;this.exportedName=exportedName;};ExportLocalSpecifier_1$1=dist$8.ExportLocalSpecifier=function ExportLocalSpecifier(_ref38){var name=_ref38.name,exportedName=_ref38.exportedName;_classCallCheck$g(this,ExportLocalSpecifier);this.type="ExportLocalSpecifier";this.name=name;this.exportedName=exportedName;};ExportLocals_1$1=dist$8.ExportLocals=function ExportLocals(_ref39){var namedExports=_ref39.namedExports;_classCallCheck$g(this,ExportLocals);this.type="ExportLocals";this.namedExports=namedExports;};ExpressionStatement_1$1=dist$8.ExpressionStatement=function ExpressionStatement(_ref40){var expression=_ref40.expression;_classCallCheck$g(this,ExpressionStatement);this.type="ExpressionStatement";this.expression=expression;};ForAwaitStatement_1$1=dist$8.ForAwaitStatement=function ForAwaitStatement(_ref41){var left=_ref41.left,right=_ref41.right,body=_ref41.body;_classCallCheck$g(this,ForAwaitStatement);this.type="ForAwaitStatement";this.left=left;this.right=right;this.body=body;};ForInStatement_1$1=dist$8.ForInStatement=function ForInStatement(_ref42){var left=_ref42.left,right=_ref42.right,body=_ref42.body;_classCallCheck$g(this,ForInStatement);this.type="ForInStatement";this.left=left;this.right=right;this.body=body;};ForOfStatement_1$1=dist$8.ForOfStatement=function ForOfStatement(_ref43){var left=_ref43.left,right=_ref43.right,body=_ref43.body;_classCallCheck$g(this,ForOfStatement);this.type="ForOfStatement";this.left=left;this.right=right;this.body=body;};ForStatement_1$1=dist$8.ForStatement=function ForStatement(_ref44){var init=_ref44.init,test=_ref44.test,update=_ref44.update,body=_ref44.body;_classCallCheck$g(this,ForStatement);this.type="ForStatement";this.init=init;this.test=test;this.update=update;this.body=body;};FormalParameters_1$1=dist$8.FormalParameters=function FormalParameters(_ref45){var items=_ref45.items,rest=_ref45.rest;_classCallCheck$g(this,FormalParameters);this.type="FormalParameters";this.items=items;this.rest=rest;};FunctionBody_1$1=dist$8.FunctionBody=function FunctionBody(_ref46){var directives=_ref46.directives,statements=_ref46.statements;_classCallCheck$g(this,FunctionBody);this.type="FunctionBody";this.directives=directives;this.statements=statements;};FunctionDeclaration_1$1=dist$8.FunctionDeclaration=function FunctionDeclaration(_ref47){var isAsync=_ref47.isAsync,isGenerator=_ref47.isGenerator,name=_ref47.name,params=_ref47.params,body=_ref47.body;_classCallCheck$g(this,FunctionDeclaration);this.type="FunctionDeclaration";this.isAsync=isAsync;this.isGenerator=isGenerator;this.name=name;this.params=params;this.body=body;};FunctionExpression_1$1=dist$8.FunctionExpression=function FunctionExpression(_ref48){var isAsync=_ref48.isAsync,isGenerator=_ref48.isGenerator,name=_ref48.name,params=_ref48.params,body=_ref48.body;_classCallCheck$g(this,FunctionExpression);this.type="FunctionExpression";this.isAsync=isAsync;this.isGenerator=isGenerator;this.name=name;this.params=params;this.body=body;};Getter_1$1=dist$8.Getter=function Getter(_ref49){var name=_ref49.name,body=_ref49.body;_classCallCheck$g(this,Getter);this.type="Getter";this.name=name;this.body=body;};IdentifierExpression_1$1=dist$8.IdentifierExpression=function IdentifierExpression(_ref50){var name=_ref50.name;_classCallCheck$g(this,IdentifierExpression);this.type="IdentifierExpression";this.name=name;};IfStatement_1$1=dist$8.IfStatement=function IfStatement(_ref51){var test=_ref51.test,consequent=_ref51.consequent,alternate=_ref51.alternate;_classCallCheck$g(this,IfStatement);this.type="IfStatement";this.test=test;this.consequent=consequent;this.alternate=alternate;};Import_1$1=dist$8.Import=function Import(_ref52){var defaultBinding=_ref52.defaultBinding,namedImports=_ref52.namedImports,moduleSpecifier=_ref52.moduleSpecifier;_classCallCheck$g(this,Import);this.type="Import";this.defaultBinding=defaultBinding;this.namedImports=namedImports;this.moduleSpecifier=moduleSpecifier;};ImportNamespace_1$1=dist$8.ImportNamespace=function ImportNamespace(_ref53){var defaultBinding=_ref53.defaultBinding,namespaceBinding=_ref53.namespaceBinding,moduleSpecifier=_ref53.moduleSpecifier;_classCallCheck$g(this,ImportNamespace);this.type="ImportNamespace";this.defaultBinding=defaultBinding;this.namespaceBinding=namespaceBinding;this.moduleSpecifier=moduleSpecifier;};ImportSpecifier_1$1=dist$8.ImportSpecifier=function ImportSpecifier(_ref54){var name=_ref54.name,binding=_ref54.binding;_classCallCheck$g(this,ImportSpecifier);this.type="ImportSpecifier";this.name=name;this.binding=binding;};LabeledStatement_1$1=dist$8.LabeledStatement=function LabeledStatement(_ref55){var label=_ref55.label,body=_ref55.body;_classCallCheck$g(this,LabeledStatement);this.type="LabeledStatement";this.label=label;this.body=body;};LiteralBooleanExpression_1$1=dist$8.LiteralBooleanExpression=function LiteralBooleanExpression(_ref56){var value=_ref56.value;_classCallCheck$g(this,LiteralBooleanExpression);this.type="LiteralBooleanExpression";this.value=value;};LiteralInfinityExpression_1$1=dist$8.LiteralInfinityExpression=function LiteralInfinityExpression(){_classCallCheck$g(this,LiteralInfinityExpression);this.type="LiteralInfinityExpression";};LiteralNullExpression_1$1=dist$8.LiteralNullExpression=function LiteralNullExpression(){_classCallCheck$g(this,LiteralNullExpression);this.type="LiteralNullExpression";};LiteralNumericExpression_1$1=dist$8.LiteralNumericExpression=function LiteralNumericExpression(_ref57){var value=_ref57.value;_classCallCheck$g(this,LiteralNumericExpression);this.type="LiteralNumericExpression";this.value=value;};LiteralRegExpExpression_1$1=dist$8.LiteralRegExpExpression=function LiteralRegExpExpression(_ref58){var pattern=_ref58.pattern,global=_ref58.global,ignoreCase=_ref58.ignoreCase,multiLine=_ref58.multiLine,dotAll=_ref58.dotAll,unicode2=_ref58.unicode,sticky=_ref58.sticky;_classCallCheck$g(this,LiteralRegExpExpression);this.type="LiteralRegExpExpression";this.pattern=pattern;this.global=global;this.ignoreCase=ignoreCase;this.multiLine=multiLine;this.dotAll=dotAll;this.unicode=unicode2;this.sticky=sticky;};LiteralStringExpression_1$1=dist$8.LiteralStringExpression=function LiteralStringExpression(_ref59){var value=_ref59.value;_classCallCheck$g(this,LiteralStringExpression);this.type="LiteralStringExpression";this.value=value;};Method_1$1=dist$8.Method=function Method(_ref60){var isAsync=_ref60.isAsync,isGenerator=_ref60.isGenerator,name=_ref60.name,params=_ref60.params,body=_ref60.body;_classCallCheck$g(this,Method);this.type="Method";this.isAsync=isAsync;this.isGenerator=isGenerator;this.name=name;this.params=params;this.body=body;};Module_1$1=dist$8.Module=function Module(_ref61){var directives=_ref61.directives,items=_ref61.items;_classCallCheck$g(this,Module);this.type="Module";this.directives=directives;this.items=items;};NewExpression_1$1=dist$8.NewExpression=function NewExpression(_ref62){var callee=_ref62.callee,_arguments=_ref62.arguments;_classCallCheck$g(this,NewExpression);this.type="NewExpression";this.callee=callee;this.arguments=_arguments;};NewTargetExpression_1$1=dist$8.NewTargetExpression=function NewTargetExpression(){_classCallCheck$g(this,NewTargetExpression);this.type="NewTargetExpression";};ObjectAssignmentTarget_1$1=dist$8.ObjectAssignmentTarget=function ObjectAssignmentTarget(_ref63){var properties=_ref63.properties,rest=_ref63.rest;_classCallCheck$g(this,ObjectAssignmentTarget);this.type="ObjectAssignmentTarget";this.properties=properties;this.rest=rest;};ObjectBinding_1$1=dist$8.ObjectBinding=function ObjectBinding(_ref64){var properties=_ref64.properties,rest=_ref64.rest;_classCallCheck$g(this,ObjectBinding);this.type="ObjectBinding";this.properties=properties;this.rest=rest;};ObjectExpression_1$1=dist$8.ObjectExpression=function ObjectExpression(_ref65){var properties=_ref65.properties;_classCallCheck$g(this,ObjectExpression);this.type="ObjectExpression";this.properties=properties;};ReturnStatement_1$1=dist$8.ReturnStatement=function ReturnStatement(_ref66){var expression=_ref66.expression;_classCallCheck$g(this,ReturnStatement);this.type="ReturnStatement";this.expression=expression;};Script_1$1=dist$8.Script=function Script(_ref67){var directives=_ref67.directives,statements=_ref67.statements;_classCallCheck$g(this,Script);this.type="Script";this.directives=directives;this.statements=statements;};Setter_1$1=dist$8.Setter=function Setter(_ref68){var name=_ref68.name,param=_ref68.param,body=_ref68.body;_classCallCheck$g(this,Setter);this.type="Setter";this.name=name;this.param=param;this.body=body;};ShorthandProperty_1$1=dist$8.ShorthandProperty=function ShorthandProperty(_ref69){var name=_ref69.name;_classCallCheck$g(this,ShorthandProperty);this.type="ShorthandProperty";this.name=name;};SpreadElement_1$1=dist$8.SpreadElement=function SpreadElement(_ref70){var expression=_ref70.expression;_classCallCheck$g(this,SpreadElement);this.type="SpreadElement";this.expression=expression;};SpreadProperty_1$1=dist$8.SpreadProperty=function SpreadProperty(_ref71){var expression=_ref71.expression;_classCallCheck$g(this,SpreadProperty);this.type="SpreadProperty";this.expression=expression;};StaticMemberAssignmentTarget_1$1=dist$8.StaticMemberAssignmentTarget=function StaticMemberAssignmentTarget(_ref72){var object=_ref72.object,property=_ref72.property;_classCallCheck$g(this,StaticMemberAssignmentTarget);this.type="StaticMemberAssignmentTarget";this.object=object;this.property=property;};StaticMemberExpression_1$1=dist$8.StaticMemberExpression=function StaticMemberExpression(_ref73){var object=_ref73.object,property=_ref73.property;_classCallCheck$g(this,StaticMemberExpression);this.type="StaticMemberExpression";this.object=object;this.property=property;};StaticPropertyName_1$1=dist$8.StaticPropertyName=function StaticPropertyName(_ref74){var value=_ref74.value;_classCallCheck$g(this,StaticPropertyName);this.type="StaticPropertyName";this.value=value;};Super_1$1=dist$8.Super=function Super(){_classCallCheck$g(this,Super);this.type="Super";};SwitchCase_1$1=dist$8.SwitchCase=function SwitchCase(_ref75){var test=_ref75.test,consequent=_ref75.consequent;_classCallCheck$g(this,SwitchCase);this.type="SwitchCase";this.test=test;this.consequent=consequent;};SwitchDefault_1$1=dist$8.SwitchDefault=function SwitchDefault(_ref76){var consequent=_ref76.consequent;_classCallCheck$g(this,SwitchDefault);this.type="SwitchDefault";this.consequent=consequent;};SwitchStatement_1$1=dist$8.SwitchStatement=function SwitchStatement(_ref77){var discriminant=_ref77.discriminant,cases=_ref77.cases;_classCallCheck$g(this,SwitchStatement);this.type="SwitchStatement";this.discriminant=discriminant;this.cases=cases;};SwitchStatementWithDefault_1$1=dist$8.SwitchStatementWithDefault=function SwitchStatementWithDefault(_ref78){var discriminant=_ref78.discriminant,preDefaultCases=_ref78.preDefaultCases,defaultCase=_ref78.defaultCase,postDefaultCases=_ref78.postDefaultCases;_classCallCheck$g(this,SwitchStatementWithDefault);this.type="SwitchStatementWithDefault";this.discriminant=discriminant;this.preDefaultCases=preDefaultCases;this.defaultCase=defaultCase;this.postDefaultCases=postDefaultCases;};TemplateElement_1$1=dist$8.TemplateElement=function TemplateElement(_ref79){var rawValue=_ref79.rawValue;_classCallCheck$g(this,TemplateElement);this.type="TemplateElement";this.rawValue=rawValue;};TemplateExpression_1$1=dist$8.TemplateExpression=function TemplateExpression(_ref80){var tag=_ref80.tag,elements=_ref80.elements;_classCallCheck$g(this,TemplateExpression);this.type="TemplateExpression";this.tag=tag;this.elements=elements;};ThisExpression_1$1=dist$8.ThisExpression=function ThisExpression(){_classCallCheck$g(this,ThisExpression);this.type="ThisExpression";};ThrowStatement_1$1=dist$8.ThrowStatement=function ThrowStatement(_ref81){var expression=_ref81.expression;_classCallCheck$g(this,ThrowStatement);this.type="ThrowStatement";this.expression=expression;};TryCatchStatement_1$1=dist$8.TryCatchStatement=function TryCatchStatement(_ref82){var body=_ref82.body,catchClause=_ref82.catchClause;_classCallCheck$g(this,TryCatchStatement);this.type="TryCatchStatement";this.body=body;this.catchClause=catchClause;};TryFinallyStatement_1$1=dist$8.TryFinallyStatement=function TryFinallyStatement(_ref83){var body=_ref83.body,catchClause=_ref83.catchClause,finalizer=_ref83.finalizer;_classCallCheck$g(this,TryFinallyStatement);this.type="TryFinallyStatement";this.body=body;this.catchClause=catchClause;this.finalizer=finalizer;};UnaryExpression_1$1=dist$8.UnaryExpression=function UnaryExpression(_ref84){var operator=_ref84.operator,operand=_ref84.operand;_classCallCheck$g(this,UnaryExpression);this.type="UnaryExpression";this.operator=operator;this.operand=operand;};UpdateExpression_1$1=dist$8.UpdateExpression=function UpdateExpression(_ref85){var isPrefix=_ref85.isPrefix,operator=_ref85.operator,operand=_ref85.operand;_classCallCheck$g(this,UpdateExpression);this.type="UpdateExpression";this.isPrefix=isPrefix;this.operator=operator;this.operand=operand;};VariableDeclaration_1$1=dist$8.VariableDeclaration=function VariableDeclaration(_ref86){var kind=_ref86.kind,declarators=_ref86.declarators;_classCallCheck$g(this,VariableDeclaration);this.type="VariableDeclaration";this.kind=kind;this.declarators=declarators;};VariableDeclarationStatement_1$1=dist$8.VariableDeclarationStatement=function VariableDeclarationStatement(_ref87){var declaration=_ref87.declaration;_classCallCheck$g(this,VariableDeclarationStatement);this.type="VariableDeclarationStatement";this.declaration=declaration;};VariableDeclarator_1$1=dist$8.VariableDeclarator=function VariableDeclarator(_ref88){var binding=_ref88.binding,init=_ref88.init;_classCallCheck$g(this,VariableDeclarator);this.type="VariableDeclarator";this.binding=binding;this.init=init;};WhileStatement_1$1=dist$8.WhileStatement=function WhileStatement(_ref89){var test=_ref89.test,body=_ref89.body;_classCallCheck$g(this,WhileStatement);this.type="WhileStatement";this.test=test;this.body=body;};WithStatement_1$1=dist$8.WithStatement=function WithStatement(_ref90){var object=_ref90.object,body=_ref90.body;_classCallCheck$g(this,WithStatement);this.type="WithStatement";this.object=object;this.body=body;};YieldExpression_1$1=dist$8.YieldExpression=function YieldExpression(_ref91){var expression=_ref91.expression;_classCallCheck$g(this,YieldExpression);this.type="YieldExpression";this.expression=expression;};YieldGeneratorExpression_1$1=dist$8.YieldGeneratorExpression=function YieldGeneratorExpression(_ref92){var expression=_ref92.expression;_classCallCheck$g(this,YieldGeneratorExpression);this.type="YieldGeneratorExpression";this.expression=expression;};var dist$7=/* @__PURE__ */_mergeNamespaces({__proto__:null,get ArrayAssignmentTarget(){return ArrayAssignmentTarget_1$1;},get ArrayBinding(){return ArrayBinding_1$1;},get ArrayExpression(){return ArrayExpression_1$1;},get ArrowExpression(){return ArrowExpression_1$1;},get AssignmentExpression(){return AssignmentExpression_1$1;},get AssignmentTargetIdentifier(){return AssignmentTargetIdentifier_1$1;},get AssignmentTargetPropertyIdentifier(){return AssignmentTargetPropertyIdentifier_1$1;},get AssignmentTargetPropertyProperty(){return AssignmentTargetPropertyProperty_1$1;},get AssignmentTargetWithDefault(){return AssignmentTargetWithDefault_1$1;},get AwaitExpression(){return AwaitExpression_1$1;},get BinaryExpression(){return BinaryExpression_1$1;},get BindingIdentifier(){return BindingIdentifier_1$1;},get BindingPropertyIdentifier(){return BindingPropertyIdentifier_1$1;},get BindingPropertyProperty(){return BindingPropertyProperty_1$1;},get BindingWithDefault(){return BindingWithDefault_1$1;},get Block(){return Block_1$1;},get BlockStatement(){return BlockStatement_1$1;},get BreakStatement(){return BreakStatement_1$1;},get CallExpression(){return CallExpression_1$1;},get CatchClause(){return CatchClause_1$1;},get ClassDeclaration(){return ClassDeclaration_1$1;},get ClassElement(){return ClassElement_1$1;},get ClassExpression(){return ClassExpression_1$1;},get CompoundAssignmentExpression(){return CompoundAssignmentExpression_1$1;},get ComputedMemberAssignmentTarget(){return ComputedMemberAssignmentTarget_1$1;},get ComputedMemberExpression(){return ComputedMemberExpression_1$1;},get ComputedPropertyName(){return ComputedPropertyName_1$1;},get ConditionalExpression(){return ConditionalExpression_1$1;},get ContinueStatement(){return ContinueStatement_1$1;},get DataProperty(){return DataProperty_1$1;},get DebuggerStatement(){return DebuggerStatement_1$1;},get Directive(){return Directive_1$1;},get DoWhileStatement(){return DoWhileStatement_1$1;},get EmptyStatement(){return EmptyStatement_1$1;},get Export(){return Export_1$1;},get ExportAllFrom(){return ExportAllFrom_1$1;},get ExportDefault(){return ExportDefault_1$1;},get ExportFrom(){return ExportFrom_1$1;},get ExportFromSpecifier(){return ExportFromSpecifier_1$1;},get ExportLocalSpecifier(){return ExportLocalSpecifier_1$1;},get ExportLocals(){return ExportLocals_1$1;},get ExpressionStatement(){return ExpressionStatement_1$1;},get ForAwaitStatement(){return ForAwaitStatement_1$1;},get ForInStatement(){return ForInStatement_1$1;},get ForOfStatement(){return ForOfStatement_1$1;},get ForStatement(){return ForStatement_1$1;},get FormalParameters(){return FormalParameters_1$1;},get FunctionBody(){return FunctionBody_1$1;},get FunctionDeclaration(){return FunctionDeclaration_1$1;},get FunctionExpression(){return FunctionExpression_1$1;},get Getter(){return Getter_1$1;},get IdentifierExpression(){return IdentifierExpression_1$1;},get IfStatement(){return IfStatement_1$1;},get Import(){return Import_1$1;},get ImportNamespace(){return ImportNamespace_1$1;},get ImportSpecifier(){return ImportSpecifier_1$1;},get LabeledStatement(){return LabeledStatement_1$1;},get LiteralBooleanExpression(){return LiteralBooleanExpression_1$1;},get LiteralInfinityExpression(){return LiteralInfinityExpression_1$1;},get LiteralNullExpression(){return LiteralNullExpression_1$1;},get LiteralNumericExpression(){return LiteralNumericExpression_1$1;},get LiteralRegExpExpression(){return LiteralRegExpExpression_1$1;},get LiteralStringExpression(){return LiteralStringExpression_1$1;},get Method(){return Method_1$1;},get Module(){return Module_1$1;},get NewExpression(){return NewExpression_1$1;},get NewTargetExpression(){return NewTargetExpression_1$1;},get ObjectAssignmentTarget(){return ObjectAssignmentTarget_1$1;},get ObjectBinding(){return ObjectBinding_1$1;},get ObjectExpression(){return ObjectExpression_1$1;},get ReturnStatement(){return ReturnStatement_1$1;},get Script(){return Script_1$1;},get Setter(){return Setter_1$1;},get ShorthandProperty(){return ShorthandProperty_1$1;},get SpreadElement(){return SpreadElement_1$1;},get SpreadProperty(){return SpreadProperty_1$1;},get StaticMemberAssignmentTarget(){return StaticMemberAssignmentTarget_1$1;},get StaticMemberExpression(){return StaticMemberExpression_1$1;},get StaticPropertyName(){return StaticPropertyName_1$1;},get Super(){return Super_1$1;},get SwitchCase(){return SwitchCase_1$1;},get SwitchDefault(){return SwitchDefault_1$1;},get SwitchStatement(){return SwitchStatement_1$1;},get SwitchStatementWithDefault(){return SwitchStatementWithDefault_1$1;},get TemplateElement(){return TemplateElement_1$1;},get TemplateExpression(){return TemplateExpression_1$1;},get ThisExpression(){return ThisExpression_1$1;},get ThrowStatement(){return ThrowStatement_1$1;},get TryCatchStatement(){return TryCatchStatement_1$1;},get TryFinallyStatement(){return TryFinallyStatement_1$1;},get UnaryExpression(){return UnaryExpression_1$1;},get UpdateExpression(){return UpdateExpression_1$1;},get VariableDeclaration(){return VariableDeclaration_1$1;},get VariableDeclarationStatement(){return VariableDeclarationStatement_1$1;},get VariableDeclarator(){return VariableDeclarator_1$1;},get WhileStatement(){return WhileStatement_1$1;},get WithStatement(){return WithStatement_1$1;},get YieldExpression(){return YieldExpression_1$1;},get YieldGeneratorExpression(){return YieldGeneratorExpression_1$1;},"default":dist$8},[dist$8]);var require$$3$3=/* @__PURE__ */getAugmentedNamespace(dist$7);Object.defineProperty(parser$1,"__esModule",{value:true});var GenericParser_1=parser$1.GenericParser=void 0;var _createClass$c=function(){function defineProperties(target,props){for(var i2=0;i2":Precedence$1.Relational,"<=":Precedence$1.Relational,">=":Precedence$1.Relational,"in":Precedence$1.Relational,"instanceof":Precedence$1.Relational,"<<":Precedence$1.BitwiseSHIFT,">>":Precedence$1.BitwiseSHIFT,">>>":Precedence$1.BitwiseSHIFT,"+":Precedence$1.Additive,"-":Precedence$1.Additive,"*":Precedence$1.Multiplicative,"%":Precedence$1.Multiplicative,"/":Precedence$1.Multiplicative};function isValidSimpleAssignmentTarget(node){if(node==null)return false;switch(node.type){case"IdentifierExpression":case"ComputedMemberExpression":case"StaticMemberExpression":return true;}return false;}function isPrefixOperator(token){switch(token.type){case _tokenizer.TokenType.INC:case _tokenizer.TokenType.DEC:case _tokenizer.TokenType.ADD:case _tokenizer.TokenType.SUB:case _tokenizer.TokenType.BIT_NOT:case _tokenizer.TokenType.NOT:case _tokenizer.TokenType.DELETE:case _tokenizer.TokenType.VOID:case _tokenizer.TokenType.TYPEOF:return true;}return false;}function isUpdateOperator(token){return token.type===_tokenizer.TokenType.INC||token.type===_tokenizer.TokenType.DEC;}GenericParser_1=parser$1.GenericParser=function(_Tokenizer){_inherits$7(GenericParser,_Tokenizer);function GenericParser(source){_classCallCheck$f(this,GenericParser);var _this=_possibleConstructorReturn$7(this,(GenericParser.__proto__||Object.getPrototypeOf(GenericParser)).call(this,source));_this.allowIn=true;_this.inFunctionBody=false;_this.inParameter=false;_this.allowYieldExpression=false;_this.allowAwaitExpression=false;_this.firstAwaitLocation=null;_this.module=false;_this.moduleIsTheGoalSymbol=false;_this.strict=false;_this.isBindingElement=true;_this.isAssignmentTarget=true;_this.firstExprError=null;return _this;}_createClass$c(GenericParser,[{key:"match",value:function match(subType){return this.lookahead.type===subType;}},{key:"matchIdentifier",value:function matchIdentifier(){switch(this.lookahead.type){case _tokenizer.TokenType.IDENTIFIER:case _tokenizer.TokenType.LET:case _tokenizer.TokenType.YIELD:case _tokenizer.TokenType.ASYNC:return true;case _tokenizer.TokenType.AWAIT:if(!this.moduleIsTheGoalSymbol){if(this.firstAwaitLocation===null){this.firstAwaitLocation=this.getLocation();}return true;}return false;case _tokenizer.TokenType.ESCAPED_KEYWORD:if(this.lookahead.value==="await"&&!this.moduleIsTheGoalSymbol){if(this.firstAwaitLocation===null){this.firstAwaitLocation=this.getLocation();}return true;}return this.lookahead.value==="let"||this.lookahead.value==="yield"||this.lookahead.value==="async";}return false;}},{key:"eat",value:function eat(tokenType){if(this.lookahead.type===tokenType){return this.lex();}return null;}},{key:"expect",value:function expect(tokenType){if(this.lookahead.type===tokenType){return this.lex();}throw this.createUnexpected(this.lookahead);}},{key:"matchContextualKeyword",value:function matchContextualKeyword(keyword2){return this.lookahead.type===_tokenizer.TokenType.IDENTIFIER&&!this.lookahead.escaped&&this.lookahead.value===keyword2;}},{key:"expectContextualKeyword",value:function expectContextualKeyword(keyword2){if(this.lookahead.type===_tokenizer.TokenType.IDENTIFIER&&!this.lookahead.escaped&&this.lookahead.value===keyword2){return this.lex();}throw this.createUnexpected(this.lookahead);}},{key:"eatContextualKeyword",value:function eatContextualKeyword(keyword2){if(this.lookahead.type===_tokenizer.TokenType.IDENTIFIER&&!this.lookahead.escaped&&this.lookahead.value===keyword2){return this.lex();}return null;}},{key:"consumeSemicolon",value:function consumeSemicolon(){if(this.eat(_tokenizer.TokenType.SEMICOLON))return;if(this.hasLineTerminatorBeforeNext)return;if(!this.eof()&&!this.match(_tokenizer.TokenType.RBRACE)){throw this.createUnexpected(this.lookahead);}}},{key:"startNode",value:function startNode(node){return node;}},{key:"copyNode",value:function copyNode(src,dest){return dest;}},{key:"finishNode",value:function finishNode(node){return node;}},{key:"parseModule",value:function parseModule(){this.moduleIsTheGoalSymbol=this.module=this.strict=true;this.lookahead=this.advance();var startState=this.startNode();var _parseBody=this.parseBody(),directives=_parseBody.directives,statements=_parseBody.statements;if(!this.match(_tokenizer.TokenType.EOS)){throw this.createUnexpected(this.lookahead);}return this.finishNode(new AST.Module({directives,items:statements}),startState);}},{key:"parseScript",value:function parseScript(){this.lookahead=this.advance();var startState=this.startNode();var _parseBody2=this.parseBody(),directives=_parseBody2.directives,statements=_parseBody2.statements;if(!this.match(_tokenizer.TokenType.EOS)){throw this.createUnexpected(this.lookahead);}return this.finishNode(new AST.Script({directives,statements}),startState);}},{key:"parseFunctionBody",value:function parseFunctionBody(){var oldInFunctionBody=this.inFunctionBody;var oldModule=this.module;var oldStrict=this.strict;this.inFunctionBody=true;this.module=false;var startState=this.startNode();this.expect(_tokenizer.TokenType.LBRACE);var body=new AST.FunctionBody(this.parseBody());this.expect(_tokenizer.TokenType.RBRACE);body=this.finishNode(body,startState);this.inFunctionBody=oldInFunctionBody;this.module=oldModule;this.strict=oldStrict;return body;}},{key:"parseBody",value:function parseBody(){var directives=[],statements=[],parsingDirectives=true,directiveOctal=null;while(true){if(this.eof()||this.match(_tokenizer.TokenType.RBRACE))break;var token=this.lookahead;var text=token.slice.text;var isStringLiteral=token.type===_tokenizer.TokenType.STRING;var isModule=this.module;var directiveLocation=this.getLocation();var directiveStartState=this.startNode();var stmt=isModule?this.parseModuleItem():this.parseStatementListItem();if(parsingDirectives){if(isStringLiteral&&stmt.type==="ExpressionStatement"&&stmt.expression.type==="LiteralStringExpression"){if(!directiveOctal&&token.octal){directiveOctal=this.createErrorWithLocation(directiveLocation,"Unexpected legacy octal escape sequence: \\"+token.octal);}var rawValue=text.slice(1,-1);if(rawValue==="use strict"){this.strict=true;}directives.push(this.finishNode(new AST.Directive({rawValue}),directiveStartState));}else{parsingDirectives=false;if(directiveOctal&&this.strict){throw directiveOctal;}statements.push(stmt);}}else{statements.push(stmt);}}if(directiveOctal&&this.strict){throw directiveOctal;}return{directives,statements};}},{key:"parseImportSpecifier",value:function parseImportSpecifier(){var startState=this.startNode(),name=void 0;if(this.matchIdentifier()){name=this.parseIdentifier();if(!this.eatContextualKeyword("as")){return this.finishNode(new AST.ImportSpecifier({name:null,binding:this.finishNode(new AST.BindingIdentifier({name}),startState)}),startState);}}else if(this.lookahead.type.klass.isIdentifierName){name=this.parseIdentifierName();this.expectContextualKeyword("as");}return this.finishNode(new AST.ImportSpecifier({name,binding:this.parseBindingIdentifier()}),startState);}},{key:"parseNameSpaceBinding",value:function parseNameSpaceBinding(){this.expect(_tokenizer.TokenType.MUL);this.expectContextualKeyword("as");return this.parseBindingIdentifier();}},{key:"parseNamedImports",value:function parseNamedImports(){var result=[];this.expect(_tokenizer.TokenType.LBRACE);while(!this.eat(_tokenizer.TokenType.RBRACE)){result.push(this.parseImportSpecifier());if(!this.eat(_tokenizer.TokenType.COMMA)){this.expect(_tokenizer.TokenType.RBRACE);break;}}return result;}},{key:"parseFromClause",value:function parseFromClause(){this.expectContextualKeyword("from");var value=this.expect(_tokenizer.TokenType.STRING).str;return value;}},{key:"parseImportDeclaration",value:function parseImportDeclaration(){var startState=this.startNode(),defaultBinding=null,moduleSpecifier=void 0;this.expect(_tokenizer.TokenType.IMPORT);if(this.match(_tokenizer.TokenType.STRING)){moduleSpecifier=this.lex().str;this.consumeSemicolon();return this.finishNode(new AST.Import({defaultBinding:null,namedImports:[],moduleSpecifier}),startState);}if(this.matchIdentifier()){defaultBinding=this.parseBindingIdentifier();if(!this.eat(_tokenizer.TokenType.COMMA)){var decl=new AST.Import({defaultBinding,namedImports:[],moduleSpecifier:this.parseFromClause()});this.consumeSemicolon();return this.finishNode(decl,startState);}}if(this.match(_tokenizer.TokenType.MUL)){var _decl=new AST.ImportNamespace({defaultBinding,namespaceBinding:this.parseNameSpaceBinding(),moduleSpecifier:this.parseFromClause()});this.consumeSemicolon();return this.finishNode(_decl,startState);}else if(this.match(_tokenizer.TokenType.LBRACE)){var _decl2=new AST.Import({defaultBinding,namedImports:this.parseNamedImports(),moduleSpecifier:this.parseFromClause()});this.consumeSemicolon();return this.finishNode(_decl2,startState);}throw this.createUnexpected(this.lookahead);}},{key:"parseExportSpecifier",value:function parseExportSpecifier(){var startState=this.startNode();var name=this.finishNode({type:EXPORT_UNKNOWN_SPECIFIER,isIdentifier:this.matchIdentifier(),value:this.parseIdentifierName()},startState);if(this.eatContextualKeyword("as")){var exportedName=this.parseIdentifierName();return this.finishNode({name,exportedName},startState);}return this.finishNode({name,exportedName:null},startState);}},{key:"parseExportClause",value:function parseExportClause(){this.expect(_tokenizer.TokenType.LBRACE);var result=[];while(!this.eat(_tokenizer.TokenType.RBRACE)){result.push(this.parseExportSpecifier());if(!this.eat(_tokenizer.TokenType.COMMA)){this.expect(_tokenizer.TokenType.RBRACE);break;}}return result;}},{key:"parseExportDeclaration",value:function parseExportDeclaration(){var _this2=this;var startState=this.startNode(),decl=void 0;this.expect(_tokenizer.TokenType.EXPORT);switch(this.lookahead.type){case _tokenizer.TokenType.MUL:this.lex();decl=new AST.ExportAllFrom({moduleSpecifier:this.parseFromClause()});this.consumeSemicolon();break;case _tokenizer.TokenType.LBRACE:{var namedExports=this.parseExportClause();var moduleSpecifier=null;if(this.matchContextualKeyword("from")){moduleSpecifier=this.parseFromClause();decl=new AST.ExportFrom({namedExports:namedExports.map(function(e){return _this2.copyNode(e,new AST.ExportFromSpecifier({name:e.name.value,exportedName:e.exportedName}));}),moduleSpecifier});}else{namedExports.forEach(function(_ref){var name=_ref.name;if(!name.isIdentifier){throw _this2.createError(_errors$1.ErrorMessages.ILLEGAL_EXPORTED_NAME);}});decl=new AST.ExportLocals({namedExports:namedExports.map(function(e){return _this2.copyNode(e,new AST.ExportLocalSpecifier({name:_this2.copyNode(e.name,new AST.IdentifierExpression({name:e.name.value})),exportedName:e.exportedName}));})});}this.consumeSemicolon();break;}case _tokenizer.TokenType.CLASS:decl=new AST.Export({declaration:this.parseClass({isExpr:false,inDefault:false})});break;case _tokenizer.TokenType.FUNCTION:decl=new AST.Export({declaration:this.parseFunction({isExpr:false,inDefault:false,allowGenerator:true,isAsync:false})});break;case _tokenizer.TokenType.ASYNC:{var preAsyncStartState=this.startNode();this.lex();decl=new AST.Export({declaration:this.parseFunction({isExpr:false,inDefault:false,allowGenerator:true,isAsync:true,startState:preAsyncStartState})});break;}case _tokenizer.TokenType.DEFAULT:this.lex();switch(this.lookahead.type){case _tokenizer.TokenType.FUNCTION:decl=new AST.ExportDefault({body:this.parseFunction({isExpr:false,inDefault:true,allowGenerator:true,isAsync:false})});break;case _tokenizer.TokenType.CLASS:decl=new AST.ExportDefault({body:this.parseClass({isExpr:false,inDefault:true})});break;case _tokenizer.TokenType.ASYNC:{var _preAsyncStartState=this.startNode();var lexerState=this.saveLexerState();this.lex();if(!this.hasLineTerminatorBeforeNext&&this.match(_tokenizer.TokenType.FUNCTION)){decl=new AST.ExportDefault({body:this.parseFunction({isExpr:false,inDefault:true,allowGenerator:false,isAsync:true,startState:_preAsyncStartState})});break;}this.restoreLexerState(lexerState);}default:decl=new AST.ExportDefault({body:this.parseAssignmentExpression()});this.consumeSemicolon();break;}break;case _tokenizer.TokenType.VAR:case _tokenizer.TokenType.LET:case _tokenizer.TokenType.CONST:decl=new AST.Export({declaration:this.parseVariableDeclaration(true)});this.consumeSemicolon();break;default:throw this.createUnexpected(this.lookahead);}return this.finishNode(decl,startState);}},{key:"parseModuleItem",value:function parseModuleItem(){switch(this.lookahead.type){case _tokenizer.TokenType.IMPORT:return this.parseImportDeclaration();case _tokenizer.TokenType.EXPORT:return this.parseExportDeclaration();default:return this.parseStatementListItem();}}},{key:"lookaheadLexicalDeclaration",value:function lookaheadLexicalDeclaration(){if(this.match(_tokenizer.TokenType.LET)||this.match(_tokenizer.TokenType.CONST)){var lexerState=this.saveLexerState();this.lex();if(this.matchIdentifier()||this.match(_tokenizer.TokenType.LBRACE)||this.match(_tokenizer.TokenType.LBRACK)){this.restoreLexerState(lexerState);return true;}this.restoreLexerState(lexerState);}return false;}},{key:"parseStatementListItem",value:function parseStatementListItem(){if(this.eof())throw this.createUnexpected(this.lookahead);switch(this.lookahead.type){case _tokenizer.TokenType.FUNCTION:return this.parseFunction({isExpr:false,inDefault:false,allowGenerator:true,isAsync:false});case _tokenizer.TokenType.CLASS:return this.parseClass({isExpr:false,inDefault:false});case _tokenizer.TokenType.ASYNC:{var preAsyncStartState=this.getLocation();var lexerState=this.saveLexerState();this.lex();if(!this.hasLineTerminatorBeforeNext&&this.match(_tokenizer.TokenType.FUNCTION)){return this.parseFunction({isExpr:false,inDefault:false,allowGenerator:true,isAsync:true,startState:preAsyncStartState});}this.restoreLexerState(lexerState);return this.parseStatement();}default:if(this.lookaheadLexicalDeclaration()){var startState=this.startNode();return this.finishNode(this.parseVariableDeclarationStatement(),startState);}return this.parseStatement();}}},{key:"parseStatement",value:function parseStatement(){var startState=this.startNode();var stmt=this.isolateCoverGrammar(this.parseStatementHelper);return this.finishNode(stmt,startState);}},{key:"parseStatementHelper",value:function parseStatementHelper(){if(this.eof()){throw this.createUnexpected(this.lookahead);}switch(this.lookahead.type){case _tokenizer.TokenType.SEMICOLON:return this.parseEmptyStatement();case _tokenizer.TokenType.LBRACE:return this.parseBlockStatement();case _tokenizer.TokenType.LPAREN:return this.parseExpressionStatement();case _tokenizer.TokenType.BREAK:return this.parseBreakStatement();case _tokenizer.TokenType.CONTINUE:return this.parseContinueStatement();case _tokenizer.TokenType.DEBUGGER:return this.parseDebuggerStatement();case _tokenizer.TokenType.DO:return this.parseDoWhileStatement();case _tokenizer.TokenType.FOR:return this.parseForStatement();case _tokenizer.TokenType.IF:return this.parseIfStatement();case _tokenizer.TokenType.RETURN:return this.parseReturnStatement();case _tokenizer.TokenType.SWITCH:return this.parseSwitchStatement();case _tokenizer.TokenType.THROW:return this.parseThrowStatement();case _tokenizer.TokenType.TRY:return this.parseTryStatement();case _tokenizer.TokenType.VAR:return this.parseVariableDeclarationStatement();case _tokenizer.TokenType.WHILE:return this.parseWhileStatement();case _tokenizer.TokenType.WITH:return this.parseWithStatement();case _tokenizer.TokenType.FUNCTION:case _tokenizer.TokenType.CLASS:throw this.createUnexpected(this.lookahead);default:{var lexerState=this.saveLexerState();if(this.eat(_tokenizer.TokenType.LET)){if(this.match(_tokenizer.TokenType.LBRACK)){this.restoreLexerState(lexerState);throw this.createUnexpected(this.lookahead);}this.restoreLexerState(lexerState);}else if(this.eat(_tokenizer.TokenType.ASYNC)){if(!this.hasLineTerminatorBeforeNext&&this.match(_tokenizer.TokenType.FUNCTION)){throw this.createUnexpected(this.lookahead);}this.restoreLexerState(lexerState);}var expr=this.parseExpression();if(expr.type==="IdentifierExpression"&&this.eat(_tokenizer.TokenType.COLON)){var labeledBody=this.match(_tokenizer.TokenType.FUNCTION)?this.parseFunction({isExpr:false,inDefault:false,allowGenerator:false,isAsync:false}):this.parseStatement();return new AST.LabeledStatement({label:expr.name,body:labeledBody});}this.consumeSemicolon();return new AST.ExpressionStatement({expression:expr});}}}},{key:"parseEmptyStatement",value:function parseEmptyStatement(){this.lex();return new AST.EmptyStatement();}},{key:"parseBlockStatement",value:function parseBlockStatement(){return new AST.BlockStatement({block:this.parseBlock()});}},{key:"parseExpressionStatement",value:function parseExpressionStatement(){var expr=this.parseExpression();this.consumeSemicolon();return new AST.ExpressionStatement({expression:expr});}},{key:"parseBreakStatement",value:function parseBreakStatement(){this.lex();if(this.eat(_tokenizer.TokenType.SEMICOLON)||this.hasLineTerminatorBeforeNext){return new AST.BreakStatement({label:null});}var label=null;if(this.matchIdentifier()){label=this.parseIdentifier();}this.consumeSemicolon();return new AST.BreakStatement({label});}},{key:"parseContinueStatement",value:function parseContinueStatement(){this.lex();if(this.eat(_tokenizer.TokenType.SEMICOLON)||this.hasLineTerminatorBeforeNext){return new AST.ContinueStatement({label:null});}var label=null;if(this.matchIdentifier()){label=this.parseIdentifier();}this.consumeSemicolon();return new AST.ContinueStatement({label});}},{key:"parseDebuggerStatement",value:function parseDebuggerStatement(){this.lex();this.consumeSemicolon();return new AST.DebuggerStatement();}},{key:"parseDoWhileStatement",value:function parseDoWhileStatement(){this.lex();var body=this.parseStatement();this.expect(_tokenizer.TokenType.WHILE);this.expect(_tokenizer.TokenType.LPAREN);var test=this.parseExpression();this.expect(_tokenizer.TokenType.RPAREN);this.eat(_tokenizer.TokenType.SEMICOLON);return new AST.DoWhileStatement({body,test});}},{key:"parseForStatement",value:function parseForStatement(){this.lex();var isAwait=this.allowAwaitExpression&&this.eat(_tokenizer.TokenType.AWAIT);this.expect(_tokenizer.TokenType.LPAREN);var test=null;var right=null;if(isAwait&&this.match(_tokenizer.TokenType.SEMICOLON)){throw this.createUnexpected(this.lookahead);}if(this.eat(_tokenizer.TokenType.SEMICOLON)){if(!this.match(_tokenizer.TokenType.SEMICOLON)){test=this.parseExpression();}this.expect(_tokenizer.TokenType.SEMICOLON);if(!this.match(_tokenizer.TokenType.RPAREN)){right=this.parseExpression();}return new AST.ForStatement({init:null,test,update:right,body:this.getIteratorStatementEpilogue()});}var startsWithLet=this.match(_tokenizer.TokenType.LET);var isForDecl=this.lookaheadLexicalDeclaration();var leftStartState=this.startNode();if(this.match(_tokenizer.TokenType.VAR)||isForDecl){var _previousAllowIn=this.allowIn;this.allowIn=false;var init=this.parseVariableDeclaration(false);this.allowIn=_previousAllowIn;if(init.declarators.length===1&&(this.match(_tokenizer.TokenType.IN)||this.matchContextualKeyword("of"))){var ctor=void 0;var decl=init.declarators[0];if(this.match(_tokenizer.TokenType.IN)){if(isAwait){throw this.createUnexpected(this.lookahead);}if(decl.init!==null&&(this.strict||init.kind!=="var"||decl.binding.type!=="BindingIdentifier")){throw this.createError(_errors$1.ErrorMessages.INVALID_VAR_INIT_FOR_IN);}ctor=AST.ForInStatement;this.lex();right=this.parseExpression();}else{if(decl.init!==null){throw this.createError(isAwait?_errors$1.ErrorMessages.INVALID_VAR_INIT_FOR_AWAIT:_errors$1.ErrorMessages.INVALID_VAR_INIT_FOR_OF);}if(isAwait){ctor=AST.ForAwaitStatement;}else{ctor=AST.ForOfStatement;}this.lex();right=this.parseAssignmentExpression();}var body=this.getIteratorStatementEpilogue();return new ctor({left:init,right,body});}else if(isAwait){throw this.createUnexpected(this.lookahead);}this.expect(_tokenizer.TokenType.SEMICOLON);if(init.declarators.some(function(decl2){return decl2.binding.type!=="BindingIdentifier"&&decl2.init===null;})){throw this.createError(_errors$1.ErrorMessages.UNINITIALIZED_BINDINGPATTERN_IN_FOR_INIT);}if(!this.match(_tokenizer.TokenType.SEMICOLON)){test=this.parseExpression();}this.expect(_tokenizer.TokenType.SEMICOLON);if(!this.match(_tokenizer.TokenType.RPAREN)){right=this.parseExpression();}return new AST.ForStatement({init,test,update:right,body:this.getIteratorStatementEpilogue()});}var previousAllowIn=this.allowIn;this.allowIn=false;var expr=this.inheritCoverGrammar(this.parseAssignmentExpressionOrTarget);this.allowIn=previousAllowIn;if(this.isAssignmentTarget&&expr.type!=="AssignmentExpression"&&(this.match(_tokenizer.TokenType.IN)||this.matchContextualKeyword("of"))){if(expr.type==="ObjectAssignmentTarget"||expr.type==="ArrayAssignmentTarget"){this.firstExprError=null;}if(startsWithLet&&this.matchContextualKeyword("of")){throw this.createError(isAwait?_errors$1.ErrorMessages.INVALID_LHS_IN_FOR_AWAIT:_errors$1.ErrorMessages.INVALID_LHS_IN_FOR_OF);}var _ctor=void 0;if(this.match(_tokenizer.TokenType.IN)){if(isAwait){throw this.createUnexpected(this.lookahead);}_ctor=AST.ForInStatement;this.lex();right=this.parseExpression();}else{if(isAwait){_ctor=AST.ForAwaitStatement;}else{_ctor=AST.ForOfStatement;}this.lex();right=this.parseAssignmentExpression();}return new _ctor({left:this.transformDestructuring(expr),right,body:this.getIteratorStatementEpilogue()});}else if(isAwait){throw this.createError(_errors$1.ErrorMessages.INVALID_LHS_IN_FOR_AWAIT);}if(this.firstExprError){throw this.firstExprError;}while(this.eat(_tokenizer.TokenType.COMMA)){var rhs=this.parseAssignmentExpression();expr=this.finishNode(new AST.BinaryExpression({left:expr,operator:",",right:rhs}),leftStartState);}if(this.match(_tokenizer.TokenType.IN)){throw this.createError(_errors$1.ErrorMessages.INVALID_LHS_IN_FOR_IN);}if(this.matchContextualKeyword("of")){throw this.createError(_errors$1.ErrorMessages.INVALID_LHS_IN_FOR_OF);}this.expect(_tokenizer.TokenType.SEMICOLON);if(!this.match(_tokenizer.TokenType.SEMICOLON)){test=this.parseExpression();}this.expect(_tokenizer.TokenType.SEMICOLON);if(!this.match(_tokenizer.TokenType.RPAREN)){right=this.parseExpression();}return new AST.ForStatement({init:expr,test,update:right,body:this.getIteratorStatementEpilogue()});}},{key:"getIteratorStatementEpilogue",value:function getIteratorStatementEpilogue(){this.expect(_tokenizer.TokenType.RPAREN);var body=this.parseStatement();return body;}},{key:"parseIfStatementChild",value:function parseIfStatementChild(){return this.match(_tokenizer.TokenType.FUNCTION)?this.parseFunction({isExpr:false,inDefault:false,allowGenerator:false,isAsync:false}):this.parseStatement();}},{key:"parseIfStatement",value:function parseIfStatement(){this.lex();this.expect(_tokenizer.TokenType.LPAREN);var test=this.parseExpression();this.expect(_tokenizer.TokenType.RPAREN);var consequent=this.parseIfStatementChild();var alternate=null;if(this.eat(_tokenizer.TokenType.ELSE)){alternate=this.parseIfStatementChild();}return new AST.IfStatement({test,consequent,alternate});}},{key:"parseReturnStatement",value:function parseReturnStatement(){if(!this.inFunctionBody){throw this.createError(_errors$1.ErrorMessages.ILLEGAL_RETURN);}this.lex();if(this.eat(_tokenizer.TokenType.SEMICOLON)||this.hasLineTerminatorBeforeNext){return new AST.ReturnStatement({expression:null});}var expression=null;if(!this.match(_tokenizer.TokenType.RBRACE)&&!this.eof()){expression=this.parseExpression();}this.consumeSemicolon();return new AST.ReturnStatement({expression});}},{key:"parseSwitchStatement",value:function parseSwitchStatement(){this.lex();this.expect(_tokenizer.TokenType.LPAREN);var discriminant=this.parseExpression();this.expect(_tokenizer.TokenType.RPAREN);this.expect(_tokenizer.TokenType.LBRACE);if(this.eat(_tokenizer.TokenType.RBRACE)){return new AST.SwitchStatement({discriminant,cases:[]});}var cases=this.parseSwitchCases();if(this.match(_tokenizer.TokenType.DEFAULT)){var defaultCase=this.parseSwitchDefault();var postDefaultCases=this.parseSwitchCases();if(this.match(_tokenizer.TokenType.DEFAULT)){throw this.createError(_errors$1.ErrorMessages.MULTIPLE_DEFAULTS_IN_SWITCH);}this.expect(_tokenizer.TokenType.RBRACE);return new AST.SwitchStatementWithDefault({discriminant,preDefaultCases:cases,defaultCase,postDefaultCases});}this.expect(_tokenizer.TokenType.RBRACE);return new AST.SwitchStatement({discriminant,cases});}},{key:"parseSwitchCases",value:function parseSwitchCases(){var result=[];while(!(this.eof()||this.match(_tokenizer.TokenType.RBRACE)||this.match(_tokenizer.TokenType.DEFAULT))){result.push(this.parseSwitchCase());}return result;}},{key:"parseSwitchCase",value:function parseSwitchCase(){var startState=this.startNode();this.expect(_tokenizer.TokenType.CASE);return this.finishNode(new AST.SwitchCase({test:this.parseExpression(),consequent:this.parseSwitchCaseBody()}),startState);}},{key:"parseSwitchDefault",value:function parseSwitchDefault(){var startState=this.startNode();this.expect(_tokenizer.TokenType.DEFAULT);return this.finishNode(new AST.SwitchDefault({consequent:this.parseSwitchCaseBody()}),startState);}},{key:"parseSwitchCaseBody",value:function parseSwitchCaseBody(){this.expect(_tokenizer.TokenType.COLON);return this.parseStatementListInSwitchCaseBody();}},{key:"parseStatementListInSwitchCaseBody",value:function parseStatementListInSwitchCaseBody(){var result=[];while(!(this.eof()||this.match(_tokenizer.TokenType.RBRACE)||this.match(_tokenizer.TokenType.DEFAULT)||this.match(_tokenizer.TokenType.CASE))){result.push(this.parseStatementListItem());}return result;}},{key:"parseThrowStatement",value:function parseThrowStatement(){var token=this.lex();if(this.hasLineTerminatorBeforeNext){throw this.createErrorWithLocation(token,_errors$1.ErrorMessages.NEWLINE_AFTER_THROW);}var expression=this.parseExpression();this.consumeSemicolon();return new AST.ThrowStatement({expression});}},{key:"parseTryStatement",value:function parseTryStatement(){this.lex();var body=this.parseBlock();if(this.match(_tokenizer.TokenType.CATCH)){var catchClause=this.parseCatchClause();if(this.eat(_tokenizer.TokenType.FINALLY)){var finalizer=this.parseBlock();return new AST.TryFinallyStatement({body,catchClause,finalizer});}return new AST.TryCatchStatement({body,catchClause});}if(this.eat(_tokenizer.TokenType.FINALLY)){var _finalizer=this.parseBlock();return new AST.TryFinallyStatement({body,catchClause:null,finalizer:_finalizer});}throw this.createError(_errors$1.ErrorMessages.NO_CATCH_OR_FINALLY);}},{key:"parseVariableDeclarationStatement",value:function parseVariableDeclarationStatement(){var declaration=this.parseVariableDeclaration(true);this.consumeSemicolon();return new AST.VariableDeclarationStatement({declaration});}},{key:"parseWhileStatement",value:function parseWhileStatement(){this.lex();this.expect(_tokenizer.TokenType.LPAREN);var test=this.parseExpression();var body=this.getIteratorStatementEpilogue();return new AST.WhileStatement({test,body});}},{key:"parseWithStatement",value:function parseWithStatement(){this.lex();this.expect(_tokenizer.TokenType.LPAREN);var object=this.parseExpression();this.expect(_tokenizer.TokenType.RPAREN);var body=this.parseStatement();return new AST.WithStatement({object,body});}},{key:"parseCatchClause",value:function parseCatchClause(){var startState=this.startNode();this.lex();this.expect(_tokenizer.TokenType.LPAREN);if(this.match(_tokenizer.TokenType.RPAREN)||this.match(_tokenizer.TokenType.LPAREN)){throw this.createUnexpected(this.lookahead);}var binding=this.parseBindingTarget();this.expect(_tokenizer.TokenType.RPAREN);var body=this.parseBlock();return this.finishNode(new AST.CatchClause({binding,body}),startState);}},{key:"parseBlock",value:function parseBlock(){var startState=this.startNode();this.expect(_tokenizer.TokenType.LBRACE);var body=[];while(!this.match(_tokenizer.TokenType.RBRACE)){body.push(this.parseStatementListItem());}this.expect(_tokenizer.TokenType.RBRACE);return this.finishNode(new AST.Block({statements:body}),startState);}},{key:"parseVariableDeclaration",value:function parseVariableDeclaration(bindingPatternsMustHaveInit){var startState=this.startNode();var token=this.lex();var kind=token.type===_tokenizer.TokenType.VAR?"var":token.type===_tokenizer.TokenType.CONST?"const":"let";var declarators=this.parseVariableDeclaratorList(bindingPatternsMustHaveInit);return this.finishNode(new AST.VariableDeclaration({kind,declarators}),startState);}},{key:"parseVariableDeclaratorList",value:function parseVariableDeclaratorList(bindingPatternsMustHaveInit){var result=[];do{result.push(this.parseVariableDeclarator(bindingPatternsMustHaveInit));}while(this.eat(_tokenizer.TokenType.COMMA));return result;}},{key:"parseVariableDeclarator",value:function parseVariableDeclarator(bindingPatternsMustHaveInit){var startState=this.startNode();if(this.match(_tokenizer.TokenType.LPAREN)){throw this.createUnexpected(this.lookahead);}var previousAllowIn=this.allowIn;this.allowIn=true;var binding=this.parseBindingTarget();this.allowIn=previousAllowIn;if(bindingPatternsMustHaveInit&&binding.type!=="BindingIdentifier"&&!this.match(_tokenizer.TokenType.ASSIGN)){this.expect(_tokenizer.TokenType.ASSIGN);}var init=null;if(this.eat(_tokenizer.TokenType.ASSIGN)){init=this.parseAssignmentExpression();}return this.finishNode(new AST.VariableDeclarator({binding,init}),startState);}},{key:"isolateCoverGrammar",value:function isolateCoverGrammar(parser2){var oldIsBindingElement=this.isBindingElement,oldIsAssignmentTarget=this.isAssignmentTarget,oldFirstExprError=this.firstExprError,result=void 0;this.isBindingElement=this.isAssignmentTarget=true;this.firstExprError=null;result=parser2.call(this);if(this.firstExprError!==null){throw this.firstExprError;}this.isBindingElement=oldIsBindingElement;this.isAssignmentTarget=oldIsAssignmentTarget;this.firstExprError=oldFirstExprError;return result;}},{key:"inheritCoverGrammar",value:function inheritCoverGrammar(parser2){var oldIsBindingElement=this.isBindingElement,oldIsAssignmentTarget=this.isAssignmentTarget,oldFirstExprError=this.firstExprError,result=void 0;this.isBindingElement=this.isAssignmentTarget=true;this.firstExprError=null;result=parser2.call(this);this.isBindingElement=this.isBindingElement&&oldIsBindingElement;this.isAssignmentTarget=this.isAssignmentTarget&&oldIsAssignmentTarget;this.firstExprError=oldFirstExprError||this.firstExprError;return result;}},{key:"parseExpression",value:function parseExpression(){var startState=this.startNode();var left=this.parseAssignmentExpression();if(this.match(_tokenizer.TokenType.COMMA)){while(!this.eof()){if(!this.match(_tokenizer.TokenType.COMMA))break;this.lex();var right=this.parseAssignmentExpression();left=this.finishNode(new AST.BinaryExpression({left,operator:",",right}),startState);}}return left;}},{key:"finishArrowParams",value:function finishArrowParams(head){var _head$params=head.params,params=_head$params===void 0?null:_head$params,_head$rest=head.rest,rest=_head$rest===void 0?null:_head$rest;if(head.type!==ARROW_EXPRESSION_PARAMS){if(head.type==="IdentifierExpression"){params=[this.targetToBinding(this.transformDestructuring(head))];}else{throw this.createUnexpected(this.lookahead);}}return this.copyNode(head,new AST.FormalParameters({items:params,rest}));}},{key:"parseArrowExpressionTail",value:function parseArrowExpressionTail(params,isAsync,startState){this.expect(_tokenizer.TokenType.ARROW);var previousYield=this.allowYieldExpression;var previousAwait=this.allowAwaitExpression;var previousAwaitLocation=this.firstAwaitLocation;this.allowYieldExpression=false;this.allowAwaitExpression=isAsync;this.firstAwaitLocation=null;var body=void 0;if(this.match(_tokenizer.TokenType.LBRACE)){var previousAllowIn=this.allowIn;this.allowIn=true;body=this.parseFunctionBody();this.allowIn=previousAllowIn;}else{body=this.parseAssignmentExpression();}this.allowYieldExpression=previousYield;this.allowAwaitExpression=previousAwait;this.firstAwaitLocation=previousAwaitLocation;return this.finishNode(new AST.ArrowExpression({isAsync,params,body}),startState);}},{key:"parseAssignmentExpression",value:function parseAssignmentExpression(){return this.isolateCoverGrammar(this.parseAssignmentExpressionOrTarget);}},{key:"parseAssignmentExpressionOrTarget",value:function parseAssignmentExpressionOrTarget(){var startState=this.startNode();if(this.allowYieldExpression&&this.match(_tokenizer.TokenType.YIELD)){this.isBindingElement=this.isAssignmentTarget=false;return this.parseYieldExpression();}var expr=this.parseConditionalExpression();if(!this.hasLineTerminatorBeforeNext&&this.match(_tokenizer.TokenType.ARROW)){this.isBindingElement=this.isAssignmentTarget=false;this.firstExprError=null;var isAsync=expr.type===ARROW_EXPRESSION_PARAMS&&expr.isAsync;return this.parseArrowExpressionTail(this.finishArrowParams(expr),isAsync,startState);}var isAssignmentOperator=false;var operator=this.lookahead;switch(operator.type){case _tokenizer.TokenType.ASSIGN_BIT_OR:case _tokenizer.TokenType.ASSIGN_BIT_XOR:case _tokenizer.TokenType.ASSIGN_BIT_AND:case _tokenizer.TokenType.ASSIGN_SHL:case _tokenizer.TokenType.ASSIGN_SHR:case _tokenizer.TokenType.ASSIGN_SHR_UNSIGNED:case _tokenizer.TokenType.ASSIGN_ADD:case _tokenizer.TokenType.ASSIGN_SUB:case _tokenizer.TokenType.ASSIGN_MUL:case _tokenizer.TokenType.ASSIGN_DIV:case _tokenizer.TokenType.ASSIGN_MOD:case _tokenizer.TokenType.ASSIGN_EXP:isAssignmentOperator=true;break;}if(isAssignmentOperator){if(!this.isAssignmentTarget||!isValidSimpleAssignmentTarget(expr)){throw this.createError(_errors$1.ErrorMessages.INVALID_LHS_IN_ASSIGNMENT);}expr=this.transformDestructuring(expr);}else if(operator.type===_tokenizer.TokenType.ASSIGN){if(!this.isAssignmentTarget){throw this.createError(_errors$1.ErrorMessages.INVALID_LHS_IN_ASSIGNMENT);}expr=this.transformDestructuring(expr);}else{return expr;}this.lex();var rhs=this.parseAssignmentExpression();this.firstExprError=null;var node=void 0;if(operator.type===_tokenizer.TokenType.ASSIGN){node=new AST.AssignmentExpression({binding:expr,expression:rhs});}else{node=new AST.CompoundAssignmentExpression({binding:expr,operator:operator.type.name,expression:rhs});this.isBindingElement=this.isAssignmentTarget=false;}return this.finishNode(node,startState);}},{key:"targetToBinding",value:function targetToBinding(node){var _this3=this;if(node===null){return null;}switch(node.type){case"AssignmentTargetIdentifier":return this.copyNode(node,new AST.BindingIdentifier({name:node.name}));case"ArrayAssignmentTarget":return this.copyNode(node,new AST.ArrayBinding({elements:node.elements.map(function(e){return _this3.targetToBinding(e);}),rest:this.targetToBinding(node.rest)}));case"ObjectAssignmentTarget":return this.copyNode(node,new AST.ObjectBinding({properties:node.properties.map(function(p2){return _this3.targetToBinding(p2);}),rest:this.targetToBinding(node.rest)}));case"AssignmentTargetPropertyIdentifier":return this.copyNode(node,new AST.BindingPropertyIdentifier({binding:this.targetToBinding(node.binding),init:node.init}));case"AssignmentTargetPropertyProperty":return this.copyNode(node,new AST.BindingPropertyProperty({name:node.name,binding:this.targetToBinding(node.binding)}));case"AssignmentTargetWithDefault":return this.copyNode(node,new AST.BindingWithDefault({binding:this.targetToBinding(node.binding),init:node.init}));}throw new Error("Not reached");}},{key:"transformDestructuring",value:function transformDestructuring(node){var _this4=this;switch(node.type){case"DataProperty":return this.copyNode(node,new AST.AssignmentTargetPropertyProperty({name:node.name,binding:this.transformDestructuringWithDefault(node.expression)}));case"ShorthandProperty":return this.copyNode(node,new AST.AssignmentTargetPropertyIdentifier({binding:this.copyNode(node,new AST.AssignmentTargetIdentifier({name:node.name.name})),init:null}));case"ObjectExpression":{var last=node.properties.length>0?node.properties[node.properties.length-1]:void 0;if(last!=null&&last.type==="SpreadProperty"){return this.copyNode(node,new AST.ObjectAssignmentTarget({properties:node.properties.slice(0,-1).map(function(e){return e&&_this4.transformDestructuringWithDefault(e);}),rest:this.transformDestructuring(last.expression)}));}return this.copyNode(node,new AST.ObjectAssignmentTarget({properties:node.properties.map(function(e){return e&&_this4.transformDestructuringWithDefault(e);}),rest:null}));}case"ArrayExpression":{var _last=node.elements[node.elements.length-1];if(_last!=null&&_last.type==="SpreadElement"){return this.copyNode(node,new AST.ArrayAssignmentTarget({elements:node.elements.slice(0,-1).map(function(e){return e&&_this4.transformDestructuringWithDefault(e);}),rest:this.copyNode(_last.expression,this.transformDestructuring(_last.expression))}));}return this.copyNode(node,new AST.ArrayAssignmentTarget({elements:node.elements.map(function(e){return e&&_this4.transformDestructuringWithDefault(e);}),rest:null}));}case"IdentifierExpression":return this.copyNode(node,new AST.AssignmentTargetIdentifier({name:node.name}));case"StaticPropertyName":return this.copyNode(node,new AST.AssignmentTargetIdentifier({name:node.value}));case"ComputedMemberExpression":return this.copyNode(node,new AST.ComputedMemberAssignmentTarget({object:node.object,expression:node.expression}));case"StaticMemberExpression":return this.copyNode(node,new AST.StaticMemberAssignmentTarget({object:node.object,property:node.property}));case"ArrayAssignmentTarget":case"ObjectAssignmentTarget":case"ComputedMemberAssignmentTarget":case"StaticMemberAssignmentTarget":case"AssignmentTargetIdentifier":case"AssignmentTargetPropertyIdentifier":case"AssignmentTargetPropertyProperty":case"AssignmentTargetWithDefault":return node;}throw new Error("Not reached");}},{key:"transformDestructuringWithDefault",value:function transformDestructuringWithDefault(node){switch(node.type){case"AssignmentExpression":return this.copyNode(node,new AST.AssignmentTargetWithDefault({binding:this.transformDestructuring(node.binding),init:node.expression}));}return this.transformDestructuring(node);}},{key:"lookaheadAssignmentExpression",value:function lookaheadAssignmentExpression(){if(this.matchIdentifier()){return true;}switch(this.lookahead.type){case _tokenizer.TokenType.ADD:case _tokenizer.TokenType.ASSIGN_DIV:case _tokenizer.TokenType.BIT_NOT:case _tokenizer.TokenType.CLASS:case _tokenizer.TokenType.DEC:case _tokenizer.TokenType.DELETE:case _tokenizer.TokenType.DIV:case _tokenizer.TokenType.FALSE:case _tokenizer.TokenType.FUNCTION:case _tokenizer.TokenType.INC:case _tokenizer.TokenType.LBRACE:case _tokenizer.TokenType.LBRACK:case _tokenizer.TokenType.LPAREN:case _tokenizer.TokenType.NEW:case _tokenizer.TokenType.NOT:case _tokenizer.TokenType.NULL:case _tokenizer.TokenType.NUMBER:case _tokenizer.TokenType.STRING:case _tokenizer.TokenType.SUB:case _tokenizer.TokenType.SUPER:case _tokenizer.TokenType.THIS:case _tokenizer.TokenType.TRUE:case _tokenizer.TokenType.TYPEOF:case _tokenizer.TokenType.VOID:case _tokenizer.TokenType.TEMPLATE:return true;}return false;}},{key:"parseYieldExpression",value:function parseYieldExpression(){var startState=this.startNode();this.lex();if(this.hasLineTerminatorBeforeNext){return this.finishNode(new AST.YieldExpression({expression:null}),startState);}var isGenerator=!!this.eat(_tokenizer.TokenType.MUL);var expr=null;if(isGenerator||this.lookaheadAssignmentExpression()){expr=this.parseAssignmentExpression();}var ctor=isGenerator?AST.YieldGeneratorExpression:AST.YieldExpression;return this.finishNode(new ctor({expression:expr}),startState);}},{key:"parseConditionalExpression",value:function parseConditionalExpression(){var startState=this.startNode();var test=this.parseBinaryExpression();if(this.firstExprError)return test;if(this.eat(_tokenizer.TokenType.CONDITIONAL)){this.isBindingElement=this.isAssignmentTarget=false;var previousAllowIn=this.allowIn;this.allowIn=true;var consequent=this.isolateCoverGrammar(this.parseAssignmentExpression);this.allowIn=previousAllowIn;this.expect(_tokenizer.TokenType.COLON);var alternate=this.isolateCoverGrammar(this.parseAssignmentExpression);return this.finishNode(new AST.ConditionalExpression({test,consequent,alternate}),startState);}return test;}},{key:"isBinaryOperator",value:function isBinaryOperator(type){switch(type){case _tokenizer.TokenType.OR:case _tokenizer.TokenType.AND:case _tokenizer.TokenType.BIT_OR:case _tokenizer.TokenType.BIT_XOR:case _tokenizer.TokenType.BIT_AND:case _tokenizer.TokenType.EQ:case _tokenizer.TokenType.NE:case _tokenizer.TokenType.EQ_STRICT:case _tokenizer.TokenType.NE_STRICT:case _tokenizer.TokenType.LT:case _tokenizer.TokenType.GT:case _tokenizer.TokenType.LTE:case _tokenizer.TokenType.GTE:case _tokenizer.TokenType.INSTANCEOF:case _tokenizer.TokenType.SHL:case _tokenizer.TokenType.SHR:case _tokenizer.TokenType.SHR_UNSIGNED:case _tokenizer.TokenType.ADD:case _tokenizer.TokenType.SUB:case _tokenizer.TokenType.MUL:case _tokenizer.TokenType.DIV:case _tokenizer.TokenType.MOD:return true;case _tokenizer.TokenType.IN:return this.allowIn;default:return false;}}},{key:"parseBinaryExpression",value:function parseBinaryExpression(){var _this5=this;var startState=this.startNode();var left=this.parseExponentiationExpression();if(this.firstExprError){return left;}var operator=this.lookahead.type;if(!this.isBinaryOperator(operator))return left;this.isBindingElement=this.isAssignmentTarget=false;this.lex();var stack2=[];stack2.push({startState,left,operator,precedence:BinaryPrecedence$1[operator.name]});startState=this.startNode();var right=this.isolateCoverGrammar(this.parseExponentiationExpression);operator=this.lookahead.type;while(this.isBinaryOperator(operator)){var precedence=BinaryPrecedence$1[operator.name];while(stack2.length&&precedence<=stack2[stack2.length-1].precedence){var stackItem=stack2[stack2.length-1];var stackOperator=stackItem.operator;left=stackItem.left;stack2.pop();startState=stackItem.startState;right=this.finishNode(new AST.BinaryExpression({left,operator:stackOperator.name,right}),startState);}this.lex();stack2.push({startState,left:right,operator,precedence});startState=this.startNode();right=this.isolateCoverGrammar(this.parseExponentiationExpression);operator=this.lookahead.type;}return stack2.reduceRight(function(expr,stackItem2){return _this5.finishNode(new AST.BinaryExpression({left:stackItem2.left,operator:stackItem2.operator.name,right:expr}),stackItem2.startState);},right);}},{key:"parseExponentiationExpression",value:function parseExponentiationExpression(){var startState=this.startNode();var leftIsParenthesized=this.lookahead.type===_tokenizer.TokenType.LPAREN;var left=this.parseUnaryExpression();if(this.lookahead.type!==_tokenizer.TokenType.EXP){return left;}if(left.type==="UnaryExpression"&&!leftIsParenthesized){throw this.createError(_errors$1.ErrorMessages.INVALID_EXPONENTIATION_LHS);}this.lex();this.isBindingElement=this.isAssignmentTarget=false;var right=this.isolateCoverGrammar(this.parseExponentiationExpression);return this.finishNode(new AST.BinaryExpression({left,operator:"**",right}),startState);}},{key:"parseUnaryExpression",value:function parseUnaryExpression(){if(this.lookahead.type.klass!==_tokenizer.TokenClass.Punctuator&&this.lookahead.type.klass!==_tokenizer.TokenClass.Keyword){return this.parseUpdateExpression();}var startState=this.startNode();if(this.allowAwaitExpression&&this.eat(_tokenizer.TokenType.AWAIT)){this.isBindingElement=this.isAssignmentTarget=false;var expression=this.isolateCoverGrammar(this.parseUnaryExpression);return this.finishNode(new AST.AwaitExpression({expression}),startState);}var operator=this.lookahead;if(!isPrefixOperator(operator)){return this.parseUpdateExpression();}this.lex();this.isBindingElement=this.isAssignmentTarget=false;var node=void 0;if(isUpdateOperator(operator)){var operandStartLocation=this.getLocation();var operand=this.isolateCoverGrammar(this.parseUnaryExpression);if(!isValidSimpleAssignmentTarget(operand)){throw this.createErrorWithLocation(operandStartLocation,_errors$1.ErrorMessages.INVALID_UPDATE_OPERAND);}operand=this.transformDestructuring(operand);node=new AST.UpdateExpression({isPrefix:true,operator:operator.value,operand});}else{var _operand=this.isolateCoverGrammar(this.parseUnaryExpression);node=new AST.UnaryExpression({operator:operator.value,operand:_operand});}return this.finishNode(node,startState);}},{key:"parseUpdateExpression",value:function parseUpdateExpression(){var startLocation=this.getLocation();var startState=this.startNode();var operand=this.parseLeftHandSideExpression({allowCall:true});if(this.firstExprError||this.hasLineTerminatorBeforeNext)return operand;var operator=this.lookahead;if(!isUpdateOperator(operator))return operand;this.lex();this.isBindingElement=this.isAssignmentTarget=false;if(!isValidSimpleAssignmentTarget(operand)){throw this.createErrorWithLocation(startLocation,_errors$1.ErrorMessages.INVALID_UPDATE_OPERAND);}operand=this.transformDestructuring(operand);return this.finishNode(new AST.UpdateExpression({isPrefix:false,operator:operator.value,operand}),startState);}},{key:"parseLeftHandSideExpression",value:function parseLeftHandSideExpression(_ref2){var _this6=this;var allowCall=_ref2.allowCall;var startState=this.startNode();var previousAllowIn=this.allowIn;this.allowIn=true;var expr=void 0,token=this.lookahead;if(this.eat(_tokenizer.TokenType.SUPER)){this.isBindingElement=false;this.isAssignmentTarget=false;expr=this.finishNode(new AST.Super(),startState);if(this.match(_tokenizer.TokenType.LPAREN)){if(allowCall){expr=this.finishNode(new AST.CallExpression({callee:expr,arguments:this.parseArgumentList().args}),startState);}else{throw this.createUnexpected(token);}}else if(this.match(_tokenizer.TokenType.LBRACK)){expr=this.finishNode(new AST.ComputedMemberExpression({object:expr,expression:this.parseComputedMember()}),startState);this.isAssignmentTarget=true;}else if(this.match(_tokenizer.TokenType.PERIOD)){expr=this.finishNode(new AST.StaticMemberExpression({object:expr,property:this.parseStaticMember()}),startState);this.isAssignmentTarget=true;}else{throw this.createUnexpected(token);}}else if(this.match(_tokenizer.TokenType.NEW)){this.isBindingElement=this.isAssignmentTarget=false;expr=this.parseNewExpression();}else if(this.match(_tokenizer.TokenType.ASYNC)){expr=this.parsePrimaryExpression();if(expr.type==="IdentifierExpression"&&allowCall&&!this.hasLineTerminatorBeforeNext){if(this.matchIdentifier()){var afterAsyncStartState=this.startNode();var previousAwait=this.allowAwaitExpression;this.allowAwaitExpression=true;var param=this.parseBindingIdentifier();this.allowAwaitExpression=previousAwait;this.ensureArrow();return this.finishNode({type:ARROW_EXPRESSION_PARAMS,params:[param],rest:null,isAsync:true},afterAsyncStartState);}if(this.match(_tokenizer.TokenType.LPAREN)){var _afterAsyncStartState=this.startNode();var previousAwaitLocation=this.firstAwaitLocation;this.firstAwaitLocation=null;var _parseArgumentList=this.parseArgumentList(),args=_parseArgumentList.args,locationFollowingFirstSpread=_parseArgumentList.locationFollowingFirstSpread;if(this.isBindingElement&&!this.hasLineTerminatorBeforeNext&&this.match(_tokenizer.TokenType.ARROW)){if(locationFollowingFirstSpread!==null){throw this.createErrorWithLocation(locationFollowingFirstSpread,_errors$1.ErrorMessages.UNEXPECTED_TOKEN(","));}if(this.firstAwaitLocation!==null){throw this.createErrorWithLocation(this.firstAwaitLocation,_errors$1.ErrorMessages.NO_AWAIT_IN_ASYNC_PARAMS);}var rest=null;if(args.length>0&&args[args.length-1].type==="SpreadElement"){rest=this.targetToBinding(this.transformDestructuringWithDefault(args[args.length-1].expression));if(rest.init!=null){throw this.createError(_errors$1.ErrorMessages.UNEXPECTED_REST_PARAMETERS_INITIALIZATION);}args=args.slice(0,-1);}var params=args.map(function(arg){return _this6.targetToBinding(_this6.transformDestructuringWithDefault(arg));});return this.finishNode({type:ARROW_EXPRESSION_PARAMS,params,rest,isAsync:true},_afterAsyncStartState);}this.firstAwaitLocation=previousAwaitLocation||this.firstAwaitLocation;this.isBindingElement=this.isAssignmentTarget=false;expr=this.finishNode(new AST.CallExpression({callee:expr,arguments:args}),startState);}}}else{expr=this.parsePrimaryExpression();if(this.firstExprError){return expr;}}while(true){if(allowCall&&this.match(_tokenizer.TokenType.LPAREN)){this.isBindingElement=this.isAssignmentTarget=false;expr=this.finishNode(new AST.CallExpression({callee:expr,arguments:this.parseArgumentList().args}),startState);}else if(this.match(_tokenizer.TokenType.LBRACK)){this.isBindingElement=false;this.isAssignmentTarget=true;expr=this.finishNode(new AST.ComputedMemberExpression({object:expr,expression:this.parseComputedMember()}),startState);}else if(this.match(_tokenizer.TokenType.PERIOD)){this.isBindingElement=false;this.isAssignmentTarget=true;expr=this.finishNode(new AST.StaticMemberExpression({object:expr,property:this.parseStaticMember()}),startState);}else if(this.match(_tokenizer.TokenType.TEMPLATE)){this.isBindingElement=this.isAssignmentTarget=false;expr=this.finishNode(new AST.TemplateExpression({tag:expr,elements:this.parseTemplateElements()}),startState);}else{break;}}this.allowIn=previousAllowIn;return expr;}},{key:"parseTemplateElements",value:function parseTemplateElements(){var startState=this.startNode();var token=this.lookahead;if(token.tail){this.lex();return[this.finishNode(new AST.TemplateElement({rawValue:token.slice.text.slice(1,-1)}),startState)];}var result=[this.finishNode(new AST.TemplateElement({rawValue:this.lex().slice.text.slice(1,-2)}),startState)];while(true){result.push(this.parseExpression());if(!this.match(_tokenizer.TokenType.RBRACE)){throw this.createILLEGAL();}this.index=this.startIndex;this.line=this.startLine;this.lineStart=this.startLineStart;this.lookahead=this.scanTemplateElement();startState=this.startNode();token=this.lex();if(token.tail){result.push(this.finishNode(new AST.TemplateElement({rawValue:token.slice.text.slice(1,-1)}),startState));return result;}result.push(this.finishNode(new AST.TemplateElement({rawValue:token.slice.text.slice(1,-2)}),startState));}}},{key:"parseStaticMember",value:function parseStaticMember(){this.lex();if(this.lookahead.type.klass.isIdentifierName){return this.lex().value;}throw this.createUnexpected(this.lookahead);}},{key:"parseComputedMember",value:function parseComputedMember(){this.lex();var expr=this.parseExpression();this.expect(_tokenizer.TokenType.RBRACK);return expr;}},{key:"parseNewExpression",value:function parseNewExpression(){var _this7=this;var startState=this.startNode();this.lex();if(this.eat(_tokenizer.TokenType.PERIOD)){this.expectContextualKeyword("target");return this.finishNode(new AST.NewTargetExpression(),startState);}var callee=this.isolateCoverGrammar(function(){return _this7.parseLeftHandSideExpression({allowCall:false});});return this.finishNode(new AST.NewExpression({callee,arguments:this.match(_tokenizer.TokenType.LPAREN)?this.parseArgumentList().args:[]}),startState);}},{key:"parseRegexFlags",value:function parseRegexFlags(flags){var global=false,ignoreCase=false,multiLine=false,unicode2=false,sticky=false,dotAll=false;for(var i2=0;i21?_len-1:0),_key=1;_key<_len;_key++){otherMaps[_key-1]=arguments[_key];}otherMaps.forEach(function(otherMap){otherMap.forEachEntry(function(v,k){thisMap.set.apply(thisMap,[k].concat(v));});});return thisMap;}var identity=void 0;var EarlyErrorState=EarlyErrorState_1=earlyErrorState$1.EarlyErrorState=function(){function EarlyErrorState2(){_classCallCheck$7(this,EarlyErrorState2);this.errors=[];this.strictErrors=[];this.usedLabelNames=[];this.freeBreakStatements=[];this.freeContinueStatements=[];this.freeLabeledBreakStatements=[];this.freeLabeledContinueStatements=[];this.newTargetExpressions=[];this.boundNames=new _multimap2.default();this.lexicallyDeclaredNames=new _multimap2.default();this.functionDeclarationNames=new _multimap2.default();this.varDeclaredNames=new _multimap2.default();this.forOfVarDeclaredNames=[];this.exportedNames=new _multimap2.default();this.exportedBindings=new _multimap2.default();this.superCallExpressions=[];this.superCallExpressionsInConstructorMethod=[];this.superPropertyExpressions=[];this.yieldExpressions=[];this.awaitExpressions=[];}_createClass$6(EarlyErrorState2,[{key:"addFreeBreakStatement",value:function addFreeBreakStatement(s){this.freeBreakStatements.push(s);return this;}},{key:"addFreeLabeledBreakStatement",value:function addFreeLabeledBreakStatement(s){this.freeLabeledBreakStatements.push(s);return this;}},{key:"clearFreeBreakStatements",value:function clearFreeBreakStatements(){this.freeBreakStatements=[];return this;}},{key:"addFreeContinueStatement",value:function addFreeContinueStatement(s){this.freeContinueStatements.push(s);return this;}},{key:"addFreeLabeledContinueStatement",value:function addFreeLabeledContinueStatement(s){this.freeLabeledContinueStatements.push(s);return this;}},{key:"clearFreeContinueStatements",value:function clearFreeContinueStatements(){this.freeContinueStatements=[];return this;}},{key:"enforceFreeBreakStatementErrors",value:function enforceFreeBreakStatementErrors(createError){[].push.apply(this.errors,this.freeBreakStatements.map(createError));this.freeBreakStatements=[];return this;}},{key:"enforceFreeLabeledBreakStatementErrors",value:function enforceFreeLabeledBreakStatementErrors(createError){[].push.apply(this.errors,this.freeLabeledBreakStatements.map(createError));this.freeLabeledBreakStatements=[];return this;}},{key:"enforceFreeContinueStatementErrors",value:function enforceFreeContinueStatementErrors(createError){[].push.apply(this.errors,this.freeContinueStatements.map(createError));this.freeContinueStatements=[];return this;}},{key:"enforceFreeLabeledContinueStatementErrors",value:function enforceFreeLabeledContinueStatementErrors(createError){[].push.apply(this.errors,this.freeLabeledContinueStatements.map(createError));this.freeLabeledContinueStatements=[];return this;}},{key:"observeIterationLabel",value:function observeIterationLabel(label){this.usedLabelNames.push(label);this.freeLabeledBreakStatements=this.freeLabeledBreakStatements.filter(function(s){return s.label!==label;});this.freeLabeledContinueStatements=this.freeLabeledContinueStatements.filter(function(s){return s.label!==label;});return this;}},{key:"observeNonIterationLabel",value:function observeNonIterationLabel(label){this.usedLabelNames.push(label);this.freeLabeledBreakStatements=this.freeLabeledBreakStatements.filter(function(s){return s.label!==label;});return this;}},{key:"clearUsedLabelNames",value:function clearUsedLabelNames(){this.usedLabelNames=[];return this;}},{key:"observeSuperCallExpression",value:function observeSuperCallExpression(node){this.superCallExpressions.push(node);return this;}},{key:"observeConstructorMethod",value:function observeConstructorMethod(){this.superCallExpressionsInConstructorMethod=this.superCallExpressions;this.superCallExpressions=[];return this;}},{key:"clearSuperCallExpressionsInConstructorMethod",value:function clearSuperCallExpressionsInConstructorMethod(){this.superCallExpressionsInConstructorMethod=[];return this;}},{key:"enforceSuperCallExpressions",value:function enforceSuperCallExpressions(createError){[].push.apply(this.errors,this.superCallExpressions.map(createError));[].push.apply(this.errors,this.superCallExpressionsInConstructorMethod.map(createError));this.superCallExpressions=[];this.superCallExpressionsInConstructorMethod=[];return this;}},{key:"enforceSuperCallExpressionsInConstructorMethod",value:function enforceSuperCallExpressionsInConstructorMethod(createError){[].push.apply(this.errors,this.superCallExpressionsInConstructorMethod.map(createError));this.superCallExpressionsInConstructorMethod=[];return this;}},{key:"observeSuperPropertyExpression",value:function observeSuperPropertyExpression(node){this.superPropertyExpressions.push(node);return this;}},{key:"clearSuperPropertyExpressions",value:function clearSuperPropertyExpressions(){this.superPropertyExpressions=[];return this;}},{key:"enforceSuperPropertyExpressions",value:function enforceSuperPropertyExpressions(createError){[].push.apply(this.errors,this.superPropertyExpressions.map(createError));this.superPropertyExpressions=[];return this;}},{key:"observeNewTargetExpression",value:function observeNewTargetExpression(node){this.newTargetExpressions.push(node);return this;}},{key:"clearNewTargetExpressions",value:function clearNewTargetExpressions(){this.newTargetExpressions=[];return this;}},{key:"bindName",value:function bindName(name,node){this.boundNames.set(name,node);return this;}},{key:"clearBoundNames",value:function clearBoundNames(){this.boundNames=new _multimap2.default();return this;}},{key:"observeLexicalDeclaration",value:function observeLexicalDeclaration(){addEach(this.lexicallyDeclaredNames,this.boundNames);this.boundNames=new _multimap2.default();return this;}},{key:"observeLexicalBoundary",value:function observeLexicalBoundary(){this.previousLexicallyDeclaredNames=this.lexicallyDeclaredNames;this.lexicallyDeclaredNames=new _multimap2.default();this.functionDeclarationNames=new _multimap2.default();return this;}},{key:"enforceDuplicateLexicallyDeclaredNames",value:function enforceDuplicateLexicallyDeclaredNames(createError){var _this=this;this.lexicallyDeclaredNames.forEachEntry(function(nodes){if(nodes.length>1){nodes.slice(1).forEach(function(dupeNode){_this.addError(createError(dupeNode));});}});return this;}},{key:"enforceConflictingLexicallyDeclaredNames",value:function enforceConflictingLexicallyDeclaredNames(otherNames,createError){var _this2=this;this.lexicallyDeclaredNames.forEachEntry(function(nodes,bindingName){if(otherNames.has(bindingName)){nodes.forEach(function(conflictingNode){_this2.addError(createError(conflictingNode));});}});return this;}},{key:"observeFunctionDeclaration",value:function observeFunctionDeclaration(){this.observeVarBoundary();addEach(this.functionDeclarationNames,this.boundNames);this.boundNames=new _multimap2.default();return this;}},{key:"functionDeclarationNamesAreLexical",value:function functionDeclarationNamesAreLexical(){addEach(this.lexicallyDeclaredNames,this.functionDeclarationNames);this.functionDeclarationNames=new _multimap2.default();return this;}},{key:"observeVarDeclaration",value:function observeVarDeclaration(){addEach(this.varDeclaredNames,this.boundNames);this.boundNames=new _multimap2.default();return this;}},{key:"recordForOfVars",value:function recordForOfVars(){var _this3=this;this.varDeclaredNames.forEach(function(bindingIdentifier){_this3.forOfVarDeclaredNames.push(bindingIdentifier);});return this;}},{key:"observeVarBoundary",value:function observeVarBoundary(){this.lexicallyDeclaredNames=new _multimap2.default();this.functionDeclarationNames=new _multimap2.default();this.varDeclaredNames=new _multimap2.default();this.forOfVarDeclaredNames=[];return this;}},{key:"exportName",value:function exportName(name,node){this.exportedNames.set(name,node);return this;}},{key:"exportDeclaredNames",value:function exportDeclaredNames(){addEach(this.exportedNames,this.lexicallyDeclaredNames,this.varDeclaredNames);addEach(this.exportedBindings,this.lexicallyDeclaredNames,this.varDeclaredNames);return this;}},{key:"exportBinding",value:function exportBinding(name,node){this.exportedBindings.set(name,node);return this;}},{key:"clearExportedBindings",value:function clearExportedBindings(){this.exportedBindings=new _multimap2.default();return this;}},{key:"observeYieldExpression",value:function observeYieldExpression(node){this.yieldExpressions.push(node);return this;}},{key:"clearYieldExpressions",value:function clearYieldExpressions(){this.yieldExpressions=[];return this;}},{key:"observeAwaitExpression",value:function observeAwaitExpression(node){this.awaitExpressions.push(node);return this;}},{key:"clearAwaitExpressions",value:function clearAwaitExpressions(){this.awaitExpressions=[];return this;}},{key:"addError",value:function addError(e){this.errors.push(e);return this;}},{key:"addStrictError",value:function addStrictError(e){this.strictErrors.push(e);return this;}},{key:"enforceStrictErrors",value:function enforceStrictErrors(){[].push.apply(this.errors,this.strictErrors);this.strictErrors=[];return this;}},{key:"concat",value:function concat5(s){if(this===identity)return s;if(s===identity)return this;[].push.apply(this.errors,s.errors);[].push.apply(this.strictErrors,s.strictErrors);[].push.apply(this.usedLabelNames,s.usedLabelNames);[].push.apply(this.freeBreakStatements,s.freeBreakStatements);[].push.apply(this.freeContinueStatements,s.freeContinueStatements);[].push.apply(this.freeLabeledBreakStatements,s.freeLabeledBreakStatements);[].push.apply(this.freeLabeledContinueStatements,s.freeLabeledContinueStatements);[].push.apply(this.newTargetExpressions,s.newTargetExpressions);addEach(this.boundNames,s.boundNames);addEach(this.lexicallyDeclaredNames,s.lexicallyDeclaredNames);addEach(this.functionDeclarationNames,s.functionDeclarationNames);addEach(this.varDeclaredNames,s.varDeclaredNames);[].push.apply(this.forOfVarDeclaredNames,s.forOfVarDeclaredNames);addEach(this.exportedNames,s.exportedNames);addEach(this.exportedBindings,s.exportedBindings);[].push.apply(this.superCallExpressions,s.superCallExpressions);[].push.apply(this.superCallExpressionsInConstructorMethod,s.superCallExpressionsInConstructorMethod);[].push.apply(this.superPropertyExpressions,s.superPropertyExpressions);[].push.apply(this.yieldExpressions,s.yieldExpressions);[].push.apply(this.awaitExpressions,s.awaitExpressions);return this;}}],[{key:"empty",value:function empty6(){return identity;}}]);return EarlyErrorState2;}();identity=new EarlyErrorState();Object.getOwnPropertyNames(EarlyErrorState.prototype).forEach(function(methodName){if(methodName==="constructor")return;Object.defineProperty(identity,methodName,{value:function value(){return EarlyErrorState.prototype[methodName].apply(new EarlyErrorState(),arguments);},enumerable:false,writable:true,configurable:true});});EarlyError_1=earlyErrorState$1.EarlyError=function(_Error){_inherits$4(EarlyError,_Error);function EarlyError(node,message){_classCallCheck$7(this,EarlyError);var _this4=_possibleConstructorReturn$4(this,(EarlyError.__proto__||Object.getPrototypeOf(EarlyError)).call(this,message));_this4.node=node;_this4.message=message;return _this4;}return EarlyError;}(Error);var earlyErrorState=/* @__PURE__ */_mergeNamespaces({__proto__:null,get EarlyError(){return EarlyError_1;},get EarlyErrorState(){return EarlyErrorState_1;},"default":earlyErrorState$1},[earlyErrorState$1]);var require$$3$1=/* @__PURE__ */getAugmentedNamespace(earlyErrorState);Object.defineProperty(earlyErrors$1,"__esModule",{value:true});var EarlyErrorChecker_1=earlyErrors$1.EarlyErrorChecker=void 0;var _createClass$5=function(){function defineProperties(target,props){for(var i2=0;i21){ctors.slice(1).forEach(function(ctor){s=s.addError(new _earlyErrorState.EarlyError(ctor,"Duplicate constructor method in class"));});}return s;}var SUPERCALL_ERROR=function SUPERCALL_ERROR2(node){return new _earlyErrorState.EarlyError(node,_errors.ErrorMessages.ILLEGAL_SUPER_CALL);};var SUPERPROPERTY_ERROR=function SUPERPROPERTY_ERROR2(node){return new _earlyErrorState.EarlyError(node,"Member access on super must be in a method");};var DUPLICATE_BINDING=function DUPLICATE_BINDING3(node){return new _earlyErrorState.EarlyError(node,"Duplicate binding "+JSON.stringify(node.name));};var FREE_CONTINUE=function FREE_CONTINUE2(node){return new _earlyErrorState.EarlyError(node,"Continue statement must be nested within an iteration statement");};var UNBOUND_CONTINUE=function UNBOUND_CONTINUE2(node){return new _earlyErrorState.EarlyError(node,"Continue statement must be nested within an iteration statement with label "+JSON.stringify(node.label));};var FREE_BREAK=function FREE_BREAK2(node){return new _earlyErrorState.EarlyError(node,"Break statement must be nested within an iteration statement or a switch statement");};var UNBOUND_BREAK=function UNBOUND_BREAK2(node){return new _earlyErrorState.EarlyError(node,"Break statement must be nested within a statement with label "+JSON.stringify(node.label));};EarlyErrorChecker_1=earlyErrors$1.EarlyErrorChecker=function(_MonoidalReducer){_inherits$3(EarlyErrorChecker,_MonoidalReducer);function EarlyErrorChecker(){_classCallCheck$6(this,EarlyErrorChecker);return _possibleConstructorReturn$3(this,(EarlyErrorChecker.__proto__||Object.getPrototypeOf(EarlyErrorChecker)).call(this,_earlyErrorState.EarlyErrorState));}_createClass$5(EarlyErrorChecker,[{key:"reduceAssignmentExpression",value:function reduceAssignmentExpression(){return _get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceAssignmentExpression",this).apply(this,arguments).clearBoundNames();}},{key:"reduceAssignmentTargetIdentifier",value:function reduceAssignmentTargetIdentifier(node){var s=this.identity;if(node.name==="eval"||node.name==="arguments"||(0,_utils.isStrictModeReservedWord)(node.name)){s=s.addStrictError(new _earlyErrorState.EarlyError(node,"The identifier "+JSON.stringify(node.name)+" must not be in binding position in strict mode"));}return s;}},{key:"reduceArrowExpression",value:function reduceArrowExpression(node,_ref2){var params=_ref2.params,body=_ref2.body;var isSimpleParameterList=node.params.rest==null&&node.params.items.every(function(i2){return i2.type==="BindingIdentifier";});params=params.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);if(node.body.type==="FunctionBody"){body=body.enforceConflictingLexicallyDeclaredNames(params.lexicallyDeclaredNames,DUPLICATE_BINDING);if(isStrictFunctionBody(node.body)){params=params.enforceStrictErrors();body=body.enforceStrictErrors();}}params.yieldExpressions.forEach(function(n){params=params.addError(new _earlyErrorState.EarlyError(n,"Arrow parameters must not contain yield expressions"));});params.awaitExpressions.forEach(function(n){params=params.addError(new _earlyErrorState.EarlyError(n,"Arrow parameters must not contain await expressions"));});var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceArrowExpression",this).call(this,node,{params,body});if(!isSimpleParameterList&&node.body.type==="FunctionBody"&&isStrictFunctionBody(node.body)){s=s.addError(new _earlyErrorState.EarlyError(node,'Functions with non-simple parameter lists may not contain a "use strict" directive'));}s=s.clearYieldExpressions();s=s.clearAwaitExpressions();s=s.observeVarBoundary();return s;}},{key:"reduceAwaitExpression",value:function reduceAwaitExpression(node,_ref3){var expression=_ref3.expression;return expression.observeAwaitExpression(node);}},{key:"reduceBindingIdentifier",value:function reduceBindingIdentifier(node){var s=this.identity;if(node.name==="eval"||node.name==="arguments"||(0,_utils.isStrictModeReservedWord)(node.name)){s=s.addStrictError(new _earlyErrorState.EarlyError(node,"The identifier "+JSON.stringify(node.name)+" must not be in binding position in strict mode"));}s=s.bindName(node.name,node);return s;}},{key:"reduceBlock",value:function reduceBlock(){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceBlock",this).apply(this,arguments);s=s.functionDeclarationNamesAreLexical();s=s.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);s=s.enforceConflictingLexicallyDeclaredNames(s.varDeclaredNames,DUPLICATE_BINDING);s=s.observeLexicalBoundary();return s;}},{key:"reduceBreakStatement",value:function reduceBreakStatement(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceBreakStatement",this).apply(this,arguments);s=node.label==null?s.addFreeBreakStatement(node):s.addFreeLabeledBreakStatement(node);return s;}},{key:"reduceCallExpression",value:function reduceCallExpression(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceCallExpression",this).apply(this,arguments);if(node.callee.type==="Super"){s=s.observeSuperCallExpression(node);}return s;}},{key:"reduceCatchClause",value:function reduceCatchClause(node,_ref4){var binding=_ref4.binding,body=_ref4.body;binding=binding.observeLexicalDeclaration();binding=binding.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);binding=binding.enforceConflictingLexicallyDeclaredNames(body.previousLexicallyDeclaredNames,DUPLICATE_BINDING);binding.lexicallyDeclaredNames.forEachEntry(function(nodes,bindingName){if(body.varDeclaredNames.has(bindingName)){body.varDeclaredNames.get(bindingName).forEach(function(conflictingNode){if(body.forOfVarDeclaredNames.indexOf(conflictingNode)>=0){binding=binding.addError(DUPLICATE_BINDING(conflictingNode));}});}});var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceCatchClause",this).call(this,node,{binding,body});s=s.observeLexicalBoundary();return s;}},{key:"reduceClassDeclaration",value:function reduceClassDeclaration(node,_ref5){var name=_ref5.name,_super=_ref5.super,elements=_ref5.elements;var s=name.enforceStrictErrors();var sElements=this.append.apply(this,_toConsumableArray$3(elements));sElements=sElements.enforceStrictErrors();if(node.super!=null){_super=_super.enforceStrictErrors();s=this.append(s,_super);sElements=sElements.clearSuperCallExpressionsInConstructorMethod();}s=this.append(s,sElements);s=enforceDuplicateConstructorMethods(node,s);s=s.observeLexicalDeclaration();return s;}},{key:"reduceClassElement",value:function reduceClassElement(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceClassElement",this).apply(this,arguments);if(!node.isStatic&&isSpecialMethod(node.method)){s=s.addError(new _earlyErrorState.EarlyError(node,_errors.ErrorMessages.ILLEGAL_CONSTRUCTORS));}if(node.isStatic&&node.method.name.type==="StaticPropertyName"&&node.method.name.value==="prototype"){s=s.addError(new _earlyErrorState.EarlyError(node,'Static class methods cannot be named "prototype"'));}return s;}},{key:"reduceClassExpression",value:function reduceClassExpression(node,_ref6){var name=_ref6.name,_super=_ref6.super,elements=_ref6.elements;var s=node.name==null?this.identity:name.enforceStrictErrors();var sElements=this.append.apply(this,_toConsumableArray$3(elements));sElements=sElements.enforceStrictErrors();if(node.super!=null){_super=_super.enforceStrictErrors();s=this.append(s,_super);sElements=sElements.clearSuperCallExpressionsInConstructorMethod();}s=this.append(s,sElements);s=enforceDuplicateConstructorMethods(node,s);s=s.clearBoundNames();return s;}},{key:"reduceCompoundAssignmentExpression",value:function reduceCompoundAssignmentExpression(){return _get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceCompoundAssignmentExpression",this).apply(this,arguments).clearBoundNames();}},{key:"reduceComputedMemberExpression",value:function reduceComputedMemberExpression(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceComputedMemberExpression",this).apply(this,arguments);if(node.object.type==="Super"){s=s.observeSuperPropertyExpression(node);}return s;}},{key:"reduceContinueStatement",value:function reduceContinueStatement(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceContinueStatement",this).apply(this,arguments);s=node.label==null?s.addFreeContinueStatement(node):s.addFreeLabeledContinueStatement(node);return s;}},{key:"reduceDoWhileStatement",value:function reduceDoWhileStatement(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceDoWhileStatement",this).apply(this,arguments);if(isLabelledFunction(node.body)){s=s.addError(new _earlyErrorState.EarlyError(node.body,"The body of a do-while statement must not be a labeled function declaration"));}s=s.clearFreeContinueStatements();s=s.clearFreeBreakStatements();return s;}},{key:"reduceExport",value:function reduceExport(){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceExport",this).apply(this,arguments);s=s.functionDeclarationNamesAreLexical();s=s.exportDeclaredNames();return s;}},{key:"reduceExportFrom",value:function reduceExportFrom(){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceExportFrom",this).apply(this,arguments);s=s.clearExportedBindings();return s;}},{key:"reduceExportFromSpecifier",value:function reduceExportFromSpecifier(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceExportFromSpecifier",this).apply(this,arguments);s=s.exportName(node.exportedName||node.name,node);s=s.exportBinding(node.name,node);return s;}},{key:"reduceExportLocalSpecifier",value:function reduceExportLocalSpecifier(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceExportLocalSpecifier",this).apply(this,arguments);s=s.exportName(node.exportedName||node.name.name,node);s=s.exportBinding(node.name.name,node);return s;}},{key:"reduceExportDefault",value:function reduceExportDefault(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceExportDefault",this).apply(this,arguments);s=s.functionDeclarationNamesAreLexical();s=s.exportName("default",node);return s;}},{key:"reduceFormalParameters",value:function reduceFormalParameters(){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceFormalParameters",this).apply(this,arguments);s=s.observeLexicalDeclaration();return s;}},{key:"reduceForStatement",value:function reduceForStatement(node,_ref7){var init=_ref7.init,test=_ref7.test,update=_ref7.update,body=_ref7.body;if(init!=null){init=init.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);init=init.enforceConflictingLexicallyDeclaredNames(body.varDeclaredNames,DUPLICATE_BINDING);}var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceForStatement",this).call(this,node,{init,test,update,body});if(node.init!=null&&node.init.type==="VariableDeclaration"&&node.init.kind==="const"){node.init.declarators.forEach(function(declarator){if(declarator.init==null){s=s.addError(new _earlyErrorState.EarlyError(declarator,"Constant lexical declarations must have an initialiser"));}});}if(isLabelledFunction(node.body)){s=s.addError(new _earlyErrorState.EarlyError(node.body,"The body of a for statement must not be a labeled function declaration"));}s=s.clearFreeContinueStatements();s=s.clearFreeBreakStatements();s=s.observeLexicalBoundary();return s;}},{key:"reduceForInStatement",value:function reduceForInStatement(node,_ref8){var left=_ref8.left,right=_ref8.right,body=_ref8.body;left=left.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);left=left.enforceConflictingLexicallyDeclaredNames(body.varDeclaredNames,DUPLICATE_BINDING);var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceForInStatement",this).call(this,node,{left,right,body});if(isLabelledFunction(node.body)){s=s.addError(new _earlyErrorState.EarlyError(node.body,"The body of a for-in statement must not be a labeled function declaration"));}s=s.clearFreeContinueStatements();s=s.clearFreeBreakStatements();s=s.observeLexicalBoundary();return s;}},{key:"reduceForOfStatement",value:function reduceForOfStatement(node,_ref9){var left=_ref9.left,right=_ref9.right,body=_ref9.body;left=left.recordForOfVars();left=left.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);left=left.enforceConflictingLexicallyDeclaredNames(body.varDeclaredNames,DUPLICATE_BINDING);var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceForOfStatement",this).call(this,node,{left,right,body});if(isLabelledFunction(node.body)){s=s.addError(new _earlyErrorState.EarlyError(node.body,"The body of a for-of statement must not be a labeled function declaration"));}s=s.clearFreeContinueStatements();s=s.clearFreeBreakStatements();s=s.observeLexicalBoundary();return s;}},{key:"reduceForAwaitStatement",value:function reduceForAwaitStatement(node,_ref10){var left=_ref10.left,right=_ref10.right,body=_ref10.body;left=left.recordForOfVars();left=left.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);left=left.enforceConflictingLexicallyDeclaredNames(body.varDeclaredNames,DUPLICATE_BINDING);var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceForOfStatement",this).call(this,node,{left,right,body});if(isLabelledFunction(node.body)){s=s.addError(new _earlyErrorState.EarlyError(node.body,"The body of a for-await statement must not be a labeled function declaration"));}s=s.clearFreeContinueStatements();s=s.clearFreeBreakStatements();s=s.observeLexicalBoundary();return s;}},{key:"reduceFunctionBody",value:function reduceFunctionBody(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceFunctionBody",this).apply(this,arguments);s=s.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);s=s.enforceConflictingLexicallyDeclaredNames(s.varDeclaredNames,DUPLICATE_BINDING);s=s.enforceFreeContinueStatementErrors(FREE_CONTINUE);s=s.enforceFreeLabeledContinueStatementErrors(UNBOUND_CONTINUE);s=s.enforceFreeBreakStatementErrors(FREE_BREAK);s=s.enforceFreeLabeledBreakStatementErrors(UNBOUND_BREAK);s=s.clearUsedLabelNames();s=s.clearYieldExpressions();s=s.clearAwaitExpressions();if(isStrictFunctionBody(node)){s=s.enforceStrictErrors();}return s;}},{key:"reduceFunctionDeclaration",value:function reduceFunctionDeclaration(node,_ref11){var name=_ref11.name,params=_ref11.params,body=_ref11.body;var isSimpleParameterList=node.params.rest==null&&node.params.items.every(function(i2){return i2.type==="BindingIdentifier";});var addError=!isSimpleParameterList||node.isGenerator?"addError":"addStrictError";params.lexicallyDeclaredNames.forEachEntry(function(nodes){if(nodes.length>1){nodes.slice(1).forEach(function(dupeNode){params=params[addError](DUPLICATE_BINDING(dupeNode));});}});body=body.enforceConflictingLexicallyDeclaredNames(params.lexicallyDeclaredNames,DUPLICATE_BINDING);body=body.enforceSuperCallExpressions(SUPERCALL_ERROR);body=body.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR);params=params.enforceSuperCallExpressions(SUPERCALL_ERROR);params=params.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR);if(node.isGenerator){params.yieldExpressions.forEach(function(n){params=params.addError(new _earlyErrorState.EarlyError(n,"Generator parameters must not contain yield expressions"));});}if(node.isAsync){params.awaitExpressions.forEach(function(n){params=params.addError(new _earlyErrorState.EarlyError(n,"Async function parameters must not contain await expressions"));});}params=params.clearNewTargetExpressions();body=body.clearNewTargetExpressions();if(isStrictFunctionBody(node.body)){params=params.enforceStrictErrors();body=body.enforceStrictErrors();}var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceFunctionDeclaration",this).call(this,node,{name,params,body});if(!isSimpleParameterList&&isStrictFunctionBody(node.body)){s=s.addError(new _earlyErrorState.EarlyError(node,'Functions with non-simple parameter lists may not contain a "use strict" directive'));}s=s.clearYieldExpressions();s=s.clearAwaitExpressions();s=s.observeFunctionDeclaration();return s;}},{key:"reduceFunctionExpression",value:function reduceFunctionExpression(node,_ref12){var name=_ref12.name,params=_ref12.params,body=_ref12.body;var isSimpleParameterList=node.params.rest==null&&node.params.items.every(function(i2){return i2.type==="BindingIdentifier";});var addError=!isSimpleParameterList||node.isGenerator?"addError":"addStrictError";params.lexicallyDeclaredNames.forEachEntry(function(nodes,bindingName){if(nodes.length>1){nodes.slice(1).forEach(function(dupeNode){params=params[addError](new _earlyErrorState.EarlyError(dupeNode,"Duplicate binding "+JSON.stringify(bindingName)));});}});body=body.enforceConflictingLexicallyDeclaredNames(params.lexicallyDeclaredNames,DUPLICATE_BINDING);body=body.enforceSuperCallExpressions(SUPERCALL_ERROR);body=body.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR);params=params.enforceSuperCallExpressions(SUPERCALL_ERROR);params=params.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR);if(node.isGenerator){params.yieldExpressions.forEach(function(n){params=params.addError(new _earlyErrorState.EarlyError(n,"Generator parameters must not contain yield expressions"));});}if(node.isAsync){params.awaitExpressions.forEach(function(n){params=params.addError(new _earlyErrorState.EarlyError(n,"Async function parameters must not contain await expressions"));});}params=params.clearNewTargetExpressions();body=body.clearNewTargetExpressions();if(isStrictFunctionBody(node.body)){params=params.enforceStrictErrors();body=body.enforceStrictErrors();}var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceFunctionExpression",this).call(this,node,{name,params,body});if(!isSimpleParameterList&&isStrictFunctionBody(node.body)){s=s.addError(new _earlyErrorState.EarlyError(node,'Functions with non-simple parameter lists may not contain a "use strict" directive'));}s=s.clearBoundNames();s=s.clearYieldExpressions();s=s.clearAwaitExpressions();s=s.observeVarBoundary();return s;}},{key:"reduceGetter",value:function reduceGetter(node,_ref13){var name=_ref13.name,body=_ref13.body;body=body.enforceSuperCallExpressions(SUPERCALL_ERROR);body=body.clearSuperPropertyExpressions();body=body.clearNewTargetExpressions();if(isStrictFunctionBody(node.body)){body=body.enforceStrictErrors();}var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceGetter",this).call(this,node,{name,body});s=s.observeVarBoundary();return s;}},{key:"reduceIdentifierExpression",value:function reduceIdentifierExpression(node){var s=this.identity;if((0,_utils.isStrictModeReservedWord)(node.name)){s=s.addStrictError(new _earlyErrorState.EarlyError(node,"The identifier "+JSON.stringify(node.name)+" must not be in expression position in strict mode"));}return s;}},{key:"reduceIfStatement",value:function reduceIfStatement(node,_ref14){var test=_ref14.test,consequent=_ref14.consequent,alternate=_ref14.alternate;if(isLabelledFunction(node.consequent)){consequent=consequent.addError(new _earlyErrorState.EarlyError(node.consequent,"The consequent of an if statement must not be a labeled function declaration"));}if(node.alternate!=null&&isLabelledFunction(node.alternate)){alternate=alternate.addError(new _earlyErrorState.EarlyError(node.alternate,"The alternate of an if statement must not be a labeled function declaration"));}if(node.consequent.type==="FunctionDeclaration"){consequent=consequent.addStrictError(new _earlyErrorState.EarlyError(node.consequent,"FunctionDeclarations in IfStatements are disallowed in strict mode"));consequent=consequent.observeLexicalBoundary();}if(node.alternate!=null&&node.alternate.type==="FunctionDeclaration"){alternate=alternate.addStrictError(new _earlyErrorState.EarlyError(node.alternate,"FunctionDeclarations in IfStatements are disallowed in strict mode"));alternate=alternate.observeLexicalBoundary();}return _get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceIfStatement",this).call(this,node,{test,consequent,alternate});}},{key:"reduceImport",value:function reduceImport(){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceImport",this).apply(this,arguments);s=s.observeLexicalDeclaration();return s;}},{key:"reduceImportNamespace",value:function reduceImportNamespace(){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceImportNamespace",this).apply(this,arguments);s=s.observeLexicalDeclaration();return s;}},{key:"reduceLabeledStatement",value:function reduceLabeledStatement(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceLabeledStatement",this).apply(this,arguments);if(node.label==="yield"||(0,_utils.isStrictModeReservedWord)(node.label)){s=s.addStrictError(new _earlyErrorState.EarlyError(node,"The identifier "+JSON.stringify(node.label)+" must not be in label position in strict mode"));}if(s.usedLabelNames.indexOf(node.label)>=0){s=s.addError(new _earlyErrorState.EarlyError(node,"Label "+JSON.stringify(node.label)+" has already been declared"));}if(node.body.type==="FunctionDeclaration"){s=s.addStrictError(new _earlyErrorState.EarlyError(node,"Labeled FunctionDeclarations are disallowed in strict mode"));}s=isIterationStatement(node.body)?s.observeIterationLabel(node.label):s.observeNonIterationLabel(node.label);return s;}},{key:"reduceLiteralRegExpExpression",value:function reduceLiteralRegExpExpression(){var s=this.identity;return s;}},{key:"reduceMethod",value:function reduceMethod(node,_ref15){var name=_ref15.name,params=_ref15.params,body=_ref15.body;var isSimpleParameterList=node.params.rest==null&&node.params.items.every(function(i2){return i2.type==="BindingIdentifier";});params=params.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);body=body.enforceConflictingLexicallyDeclaredNames(params.lexicallyDeclaredNames,DUPLICATE_BINDING);if(node.name.type==="StaticPropertyName"&&node.name.value==="constructor"){body=body.observeConstructorMethod();params=params.observeConstructorMethod();}else{body=body.enforceSuperCallExpressions(SUPERCALL_ERROR);params=params.enforceSuperCallExpressions(SUPERCALL_ERROR);}if(node.isGenerator){params.yieldExpressions.forEach(function(n){params=params.addError(new _earlyErrorState.EarlyError(n,"Generator parameters must not contain yield expressions"));});}if(node.isAsync){params.awaitExpressions.forEach(function(n){params=params.addError(new _earlyErrorState.EarlyError(n,"Async function parameters must not contain await expressions"));});}body=body.clearSuperPropertyExpressions();params=params.clearSuperPropertyExpressions();params=params.clearNewTargetExpressions();body=body.clearNewTargetExpressions();if(isStrictFunctionBody(node.body)){params=params.enforceStrictErrors();body=body.enforceStrictErrors();}var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceMethod",this).call(this,node,{name,params,body});if(!isSimpleParameterList&&isStrictFunctionBody(node.body)){s=s.addError(new _earlyErrorState.EarlyError(node,'Functions with non-simple parameter lists may not contain a "use strict" directive'));}s=s.clearYieldExpressions();s=s.clearAwaitExpressions();s=s.observeVarBoundary();return s;}},{key:"reduceModule",value:function reduceModule(){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceModule",this).apply(this,arguments);s=s.functionDeclarationNamesAreLexical();s=s.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);s=s.enforceConflictingLexicallyDeclaredNames(s.varDeclaredNames,DUPLICATE_BINDING);s.exportedNames.forEachEntry(function(nodes,bindingName){if(nodes.length>1){nodes.slice(1).forEach(function(dupeNode){s=s.addError(new _earlyErrorState.EarlyError(dupeNode,"Duplicate export "+JSON.stringify(bindingName)));});}});s.exportedBindings.forEachEntry(function(nodes,bindingName){if(!s.lexicallyDeclaredNames.has(bindingName)&&!s.varDeclaredNames.has(bindingName)){nodes.forEach(function(undeclaredNode){s=s.addError(new _earlyErrorState.EarlyError(undeclaredNode,"Exported binding "+JSON.stringify(bindingName)+" is not declared"));});}});s.newTargetExpressions.forEach(function(node){s=s.addError(new _earlyErrorState.EarlyError(node,"new.target must be within function (but not arrow expression) code"));});s=s.enforceFreeContinueStatementErrors(FREE_CONTINUE);s=s.enforceFreeLabeledContinueStatementErrors(UNBOUND_CONTINUE);s=s.enforceFreeBreakStatementErrors(FREE_BREAK);s=s.enforceFreeLabeledBreakStatementErrors(UNBOUND_BREAK);s=s.enforceSuperCallExpressions(SUPERCALL_ERROR);s=s.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR);s=s.enforceStrictErrors();return s;}},{key:"reduceNewTargetExpression",value:function reduceNewTargetExpression(node){return this.identity.observeNewTargetExpression(node);}},{key:"reduceObjectExpression",value:function reduceObjectExpression(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceObjectExpression",this).apply(this,arguments);s=s.enforceSuperCallExpressionsInConstructorMethod(SUPERCALL_ERROR);var protos=node.properties.filter(function(p2){return p2.type==="DataProperty"&&p2.name.type==="StaticPropertyName"&&p2.name.value==="__proto__";});protos.slice(1).forEach(function(n){s=s.addError(new _earlyErrorState.EarlyError(n,"Duplicate __proto__ property in object literal not allowed"));});return s;}},{key:"reduceUpdateExpression",value:function reduceUpdateExpression(){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceUpdateExpression",this).apply(this,arguments);s=s.clearBoundNames();return s;}},{key:"reduceUnaryExpression",value:function reduceUnaryExpression(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceUnaryExpression",this).apply(this,arguments);if(node.operator==="delete"&&node.operand.type==="IdentifierExpression"){s=s.addStrictError(new _earlyErrorState.EarlyError(node,"Identifier expressions must not be deleted in strict mode"));}return s;}},{key:"reduceScript",value:function reduceScript(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceScript",this).apply(this,arguments);s=s.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);s=s.enforceConflictingLexicallyDeclaredNames(s.varDeclaredNames,DUPLICATE_BINDING);s.newTargetExpressions.forEach(function(n){s=s.addError(new _earlyErrorState.EarlyError(n,"new.target must be within function (but not arrow expression) code"));});s=s.enforceFreeContinueStatementErrors(FREE_CONTINUE);s=s.enforceFreeLabeledContinueStatementErrors(UNBOUND_CONTINUE);s=s.enforceFreeBreakStatementErrors(FREE_BREAK);s=s.enforceFreeLabeledBreakStatementErrors(UNBOUND_BREAK);s=s.enforceSuperCallExpressions(SUPERCALL_ERROR);s=s.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR);if(isStrictFunctionBody(node)){s=s.enforceStrictErrors();}return s;}},{key:"reduceSetter",value:function reduceSetter(node,_ref16){var name=_ref16.name,param=_ref16.param,body=_ref16.body;var isSimpleParameterList=node.param.type==="BindingIdentifier";param=param.observeLexicalDeclaration();param=param.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);body=body.enforceConflictingLexicallyDeclaredNames(param.lexicallyDeclaredNames,DUPLICATE_BINDING);param=param.enforceSuperCallExpressions(SUPERCALL_ERROR);body=body.enforceSuperCallExpressions(SUPERCALL_ERROR);param=param.clearSuperPropertyExpressions();body=body.clearSuperPropertyExpressions();param=param.clearNewTargetExpressions();body=body.clearNewTargetExpressions();if(isStrictFunctionBody(node.body)){param=param.enforceStrictErrors();body=body.enforceStrictErrors();}var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceSetter",this).call(this,node,{name,param,body});if(!isSimpleParameterList&&isStrictFunctionBody(node.body)){s=s.addError(new _earlyErrorState.EarlyError(node,'Functions with non-simple parameter lists may not contain a "use strict" directive'));}s=s.observeVarBoundary();return s;}},{key:"reduceStaticMemberExpression",value:function reduceStaticMemberExpression(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceStaticMemberExpression",this).apply(this,arguments);if(node.object.type==="Super"){s=s.observeSuperPropertyExpression(node);}return s;}},{key:"reduceSwitchStatement",value:function reduceSwitchStatement(node,_ref17){var discriminant=_ref17.discriminant,cases=_ref17.cases;var sCases=this.append.apply(this,_toConsumableArray$3(cases));sCases=sCases.functionDeclarationNamesAreLexical();sCases=sCases.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);sCases=sCases.enforceConflictingLexicallyDeclaredNames(sCases.varDeclaredNames,DUPLICATE_BINDING);sCases=sCases.observeLexicalBoundary();var s=this.append(discriminant,sCases);s=s.clearFreeBreakStatements();return s;}},{key:"reduceSwitchStatementWithDefault",value:function reduceSwitchStatementWithDefault(node,_ref18){var discriminant=_ref18.discriminant,preDefaultCases=_ref18.preDefaultCases,defaultCase=_ref18.defaultCase,postDefaultCases=_ref18.postDefaultCases;var sCases=this.append.apply(this,[defaultCase].concat(_toConsumableArray$3(preDefaultCases),_toConsumableArray$3(postDefaultCases)));sCases=sCases.functionDeclarationNamesAreLexical();sCases=sCases.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);sCases=sCases.enforceConflictingLexicallyDeclaredNames(sCases.varDeclaredNames,DUPLICATE_BINDING);sCases=sCases.observeLexicalBoundary();var s=this.append(discriminant,sCases);s=s.clearFreeBreakStatements();return s;}},{key:"reduceVariableDeclaration",value:function reduceVariableDeclaration(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceVariableDeclaration",this).apply(this,arguments);switch(node.kind){case"const":case"let":{s=s.observeLexicalDeclaration();if(s.lexicallyDeclaredNames.has("let")){s.lexicallyDeclaredNames.get("let").forEach(function(n){s=s.addError(new _earlyErrorState.EarlyError(n,'Lexical declarations must not have a binding named "let"'));});}break;}case"var":s=s.observeVarDeclaration();break;}return s;}},{key:"reduceVariableDeclarationStatement",value:function reduceVariableDeclarationStatement(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceVariableDeclarationStatement",this).apply(this,arguments);if(node.declaration.kind==="const"){node.declaration.declarators.forEach(function(declarator){if(declarator.init==null){s=s.addError(new _earlyErrorState.EarlyError(declarator,"Constant lexical declarations must have an initialiser"));}});}return s;}},{key:"reduceWhileStatement",value:function reduceWhileStatement(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceWhileStatement",this).apply(this,arguments);if(isLabelledFunction(node.body)){s=s.addError(new _earlyErrorState.EarlyError(node.body,"The body of a while statement must not be a labeled function declaration"));}s=s.clearFreeContinueStatements().clearFreeBreakStatements();return s;}},{key:"reduceWithStatement",value:function reduceWithStatement(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceWithStatement",this).apply(this,arguments);if(isLabelledFunction(node.body)){s=s.addError(new _earlyErrorState.EarlyError(node.body,"The body of a with statement must not be a labeled function declaration"));}s=s.addStrictError(new _earlyErrorState.EarlyError(node,"Strict mode code must not include a with statement"));return s;}},{key:"reduceYieldExpression",value:function reduceYieldExpression(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceYieldExpression",this).apply(this,arguments);s=s.observeYieldExpression(node);return s;}},{key:"reduceYieldGeneratorExpression",value:function reduceYieldGeneratorExpression(node){var s=_get$1(EarlyErrorChecker.prototype.__proto__||Object.getPrototypeOf(EarlyErrorChecker.prototype),"reduceYieldGeneratorExpression",this).apply(this,arguments);s=s.observeYieldExpression(node);return s;}}],[{key:"check",value:function check(node){return(0,_shiftReducer2.default)(new EarlyErrorChecker(),node).errors;}}]);return EarlyErrorChecker;}(_shiftReducer$1.MonoidalReducer);var earlyErrors=/* @__PURE__ */_mergeNamespaces({__proto__:null,get EarlyErrorChecker(){return EarlyErrorChecker_1;},"default":earlyErrors$1},[earlyErrors$1]);var require$$2$2=/* @__PURE__ */getAugmentedNamespace(earlyErrors);(function(exports2){Object.defineProperty(exports2,"__esModule",{value:true});exports2.TokenType=exports2.TokenClass=exports2.Tokenizer=exports2.ParserWithLocation=exports2.GenericParser=exports2.EarlyErrorChecker=exports2.parseScriptWithLocation=exports2.parseModuleWithLocation=exports2.parseScript=exports2.parseModule=void 0;var _createClass2=function(){function defineProperties(target,props){for(var i2=0;i21&&arguments[1]!==void 0?arguments[1]:{},_ref$earlyErrors=_ref.earlyErrors,earlyErrors2=_ref$earlyErrors===void 0?true:_ref$earlyErrors;var parser2=new _parser.GenericParser(code2);var tree=parser2[parsingFunctionName]();if(earlyErrors2){var errors2=_earlyErrors.EarlyErrorChecker.check(tree);if(errors2.length>0){throw new _tokenizer3.JsError(0,1,0,errors2[0].message);}}return tree;};}function generateInterfaceWithLocation(parsingFunctionName){return function parse(code2){var _ref2=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_ref2$earlyErrors=_ref2.earlyErrors,earlyErrors2=_ref2$earlyErrors===void 0?true:_ref2$earlyErrors;var parser2=new ParserWithLocation(code2);var tree=parser2[parsingFunctionName]();if(earlyErrors2){var errors2=_earlyErrors.EarlyErrorChecker.check(tree);if(errors2.length>0){var _errors$=errors2[0],node=_errors$.node,message=_errors$.message;var _parser$locations$get=parser2.locations.get(node).start,offset=_parser$locations$get.offset,line=_parser$locations$get.line,column=_parser$locations$get.column;throw new _tokenizer3.JsError(offset,line,column,message);}}return{tree,locations:parser2.locations,comments:parser2.comments};};}exports2.parseModule=generateInterface("parseModule");var parseScript=exports2.parseScript=generateInterface("parseScript");exports2.parseModuleWithLocation=generateInterfaceWithLocation("parseModule");exports2.parseScriptWithLocation=generateInterfaceWithLocation("parseScript");exports2.default=parseScript;exports2.EarlyErrorChecker=_earlyErrors.EarlyErrorChecker;exports2.GenericParser=_parser.GenericParser;exports2.ParserWithLocation=ParserWithLocation;})(dist$b);var dist$2={};Object.defineProperty(dist$2,"__esModule",{value:true});var _default$2=dist$2["default"]=function(){var SPEC={};var BOOLEAN={typeName:"Boolean"};var DOUBLE={typeName:"Number"};var STRING={typeName:"String"};function Maybe(arg){return{typeName:"Maybe",argument:arg};}function List(arg){return{typeName:"List",argument:arg};}function Const(arg){return{typeName:"Const",argument:arg};}function Union(){return{typeName:"Union",arguments:[].slice.call(arguments,0)};}var TYPE_INDICATOR={typeName:"Enum",values:["ArrayAssignmentTarget","ArrayBinding","ArrayExpression","ArrowExpression","AssignmentExpression","AssignmentTargetIdentifier","AssignmentTargetPropertyIdentifier","AssignmentTargetPropertyProperty","AssignmentTargetWithDefault","AwaitExpression","BinaryExpression","BindingIdentifier","BindingPropertyIdentifier","BindingPropertyProperty","BindingWithDefault","Block","BlockStatement","BreakStatement","CallExpression","CatchClause","ClassDeclaration","ClassElement","ClassExpression","CompoundAssignmentExpression","ComputedMemberAssignmentTarget","ComputedMemberExpression","ComputedPropertyName","ConditionalExpression","ContinueStatement","DataProperty","DebuggerStatement","Directive","DoWhileStatement","EmptyStatement","Export","ExportAllFrom","ExportDefault","ExportFrom","ExportFromSpecifier","ExportLocalSpecifier","ExportLocals","ExpressionStatement","ForAwaitStatement","ForInStatement","ForOfStatement","ForStatement","FormalParameters","FunctionBody","FunctionDeclaration","FunctionExpression","Getter","IdentifierExpression","IfStatement","Import","ImportNamespace","ImportSpecifier","LabeledStatement","LiteralBooleanExpression","LiteralInfinityExpression","LiteralNullExpression","LiteralNumericExpression","LiteralRegExpExpression","LiteralStringExpression","Method","Module","NewExpression","NewTargetExpression","ObjectAssignmentTarget","ObjectBinding","ObjectExpression","ReturnStatement","Script","Setter","ShorthandProperty","SpreadElement","SpreadProperty","StaticMemberAssignmentTarget","StaticMemberExpression","StaticPropertyName","Super","SwitchCase","SwitchDefault","SwitchStatement","SwitchStatementWithDefault","TemplateElement","TemplateExpression","ThisExpression","ThrowStatement","TryCatchStatement","TryFinallyStatement","UnaryExpression","UpdateExpression","VariableDeclaration","VariableDeclarationStatement","VariableDeclarator","WhileStatement","WithStatement","YieldExpression","YieldGeneratorExpression"]};var BinaryOperator={typeName:"Enum",values:["==","!=","===","!==","<","<=",">",">=","in","instanceof","<<",">>",">>>","+","-","*","/","%","**",",","||","&&","|","^","&"]};var CompoundAssignmentOperator={typeName:"Enum",values:["+=","-=","*=","/=","%=","**=","<<=",">>=",">>>=","|=","^=","&="]};var UnaryOperator={typeName:"Enum",values:["+","-","!","~","typeof","void","delete"]};var UpdateOperator={typeName:"Enum",values:["++","--"]};var VariableDeclarationKind={typeName:"Enum",values:["var","let","const"]};var ArrayAssignmentTarget6=SPEC.ArrayAssignmentTarget={};var ArrayBinding6=SPEC.ArrayBinding={};var ArrayExpression6=SPEC.ArrayExpression={};var ArrowExpression6=SPEC.ArrowExpression={};var AssignmentExpression6=SPEC.AssignmentExpression={};var AssignmentTargetIdentifier6=SPEC.AssignmentTargetIdentifier={};var AssignmentTargetPropertyIdentifier6=SPEC.AssignmentTargetPropertyIdentifier={};var AssignmentTargetPropertyProperty6=SPEC.AssignmentTargetPropertyProperty={};var AssignmentTargetWithDefault6=SPEC.AssignmentTargetWithDefault={};var AwaitExpression6=SPEC.AwaitExpression={};var BinaryExpression6=SPEC.BinaryExpression={};var BindingIdentifier6=SPEC.BindingIdentifier={};var BindingPropertyIdentifier6=SPEC.BindingPropertyIdentifier={};var BindingPropertyProperty6=SPEC.BindingPropertyProperty={};var BindingWithDefault6=SPEC.BindingWithDefault={};var Block6=SPEC.Block={};var BlockStatement6=SPEC.BlockStatement={};var BreakStatement6=SPEC.BreakStatement={};var CallExpression6=SPEC.CallExpression={};var CatchClause6=SPEC.CatchClause={};var ClassDeclaration6=SPEC.ClassDeclaration={};var ClassElement6=SPEC.ClassElement={};var ClassExpression6=SPEC.ClassExpression={};var CompoundAssignmentExpression6=SPEC.CompoundAssignmentExpression={};var ComputedMemberAssignmentTarget6=SPEC.ComputedMemberAssignmentTarget={};var ComputedMemberExpression6=SPEC.ComputedMemberExpression={};var ComputedPropertyName6=SPEC.ComputedPropertyName={};var ConditionalExpression6=SPEC.ConditionalExpression={};var ContinueStatement6=SPEC.ContinueStatement={};var DataProperty6=SPEC.DataProperty={};var DebuggerStatement6=SPEC.DebuggerStatement={};var Directive6=SPEC.Directive={};var DoWhileStatement6=SPEC.DoWhileStatement={};var EmptyStatement6=SPEC.EmptyStatement={};var Export6=SPEC.Export={};var ExportAllFrom6=SPEC.ExportAllFrom={};var ExportDefault6=SPEC.ExportDefault={};var ExportFrom6=SPEC.ExportFrom={};var ExportFromSpecifier6=SPEC.ExportFromSpecifier={};var ExportLocalSpecifier6=SPEC.ExportLocalSpecifier={};var ExportLocals6=SPEC.ExportLocals={};var ExpressionStatement6=SPEC.ExpressionStatement={};var ForAwaitStatement6=SPEC.ForAwaitStatement={};var ForInStatement6=SPEC.ForInStatement={};var ForOfStatement6=SPEC.ForOfStatement={};var ForStatement6=SPEC.ForStatement={};var FormalParameters6=SPEC.FormalParameters={};var FunctionBody6=SPEC.FunctionBody={};var FunctionDeclaration6=SPEC.FunctionDeclaration={};var FunctionExpression6=SPEC.FunctionExpression={};var Getter6=SPEC.Getter={};var IdentifierExpression6=SPEC.IdentifierExpression={};var IfStatement6=SPEC.IfStatement={};var Import6=SPEC.Import={};var ImportNamespace6=SPEC.ImportNamespace={};var ImportSpecifier6=SPEC.ImportSpecifier={};var LabeledStatement6=SPEC.LabeledStatement={};var LiteralBooleanExpression6=SPEC.LiteralBooleanExpression={};var LiteralInfinityExpression6=SPEC.LiteralInfinityExpression={};var LiteralNullExpression6=SPEC.LiteralNullExpression={};var LiteralNumericExpression6=SPEC.LiteralNumericExpression={};var LiteralRegExpExpression6=SPEC.LiteralRegExpExpression={};var LiteralStringExpression6=SPEC.LiteralStringExpression={};var Method6=SPEC.Method={};var Module6=SPEC.Module={};var NewExpression6=SPEC.NewExpression={};var NewTargetExpression6=SPEC.NewTargetExpression={};var ObjectAssignmentTarget6=SPEC.ObjectAssignmentTarget={};var ObjectBinding6=SPEC.ObjectBinding={};var ObjectExpression6=SPEC.ObjectExpression={};var ReturnStatement6=SPEC.ReturnStatement={};var Script6=SPEC.Script={};var Setter6=SPEC.Setter={};var ShorthandProperty6=SPEC.ShorthandProperty={};var SpreadElement6=SPEC.SpreadElement={};var SpreadProperty6=SPEC.SpreadProperty={};var StaticMemberAssignmentTarget6=SPEC.StaticMemberAssignmentTarget={};var StaticMemberExpression6=SPEC.StaticMemberExpression={};var StaticPropertyName6=SPEC.StaticPropertyName={};var Super6=SPEC.Super={};var SwitchCase6=SPEC.SwitchCase={};var SwitchDefault6=SPEC.SwitchDefault={};var SwitchStatement6=SPEC.SwitchStatement={};var SwitchStatementWithDefault6=SPEC.SwitchStatementWithDefault={};var TemplateElement6=SPEC.TemplateElement={};var TemplateExpression6=SPEC.TemplateExpression={};var ThisExpression6=SPEC.ThisExpression={};var ThrowStatement6=SPEC.ThrowStatement={};var TryCatchStatement6=SPEC.TryCatchStatement={};var TryFinallyStatement6=SPEC.TryFinallyStatement={};var UnaryExpression6=SPEC.UnaryExpression={};var UpdateExpression6=SPEC.UpdateExpression={};var VariableDeclaration6=SPEC.VariableDeclaration={};var VariableDeclarationStatement6=SPEC.VariableDeclarationStatement={};var VariableDeclarator6=SPEC.VariableDeclarator={};var WhileStatement6=SPEC.WhileStatement={};var WithStatement6=SPEC.WithStatement={};var YieldExpression6=SPEC.YieldExpression={};var YieldGeneratorExpression6=SPEC.YieldGeneratorExpression={};var MemberExpression=Union(ComputedMemberExpression6,StaticMemberExpression6);var AssignmentTargetProperty=Union(AssignmentTargetPropertyIdentifier6,AssignmentTargetPropertyProperty6);Union(ClassDeclaration6,ClassExpression6);var ExportDeclaration=Union(Export6,ExportAllFrom6,ExportDefault6,ExportFrom6,ExportLocals6);var PropertyName=Union(ComputedPropertyName6,StaticPropertyName6);Union(FunctionDeclaration6,FunctionExpression6);var ImportDeclaration=Union(Import6,ImportNamespace6);var IterationStatement=Union(DoWhileStatement6,ForAwaitStatement6,ForInStatement6,ForOfStatement6,ForStatement6,WhileStatement6);var MemberAssignmentTarget=Union(ComputedMemberAssignmentTarget6,StaticMemberAssignmentTarget6);var BindingProperty=Union(BindingPropertyIdentifier6,BindingPropertyProperty6);var MethodDefinition=Union(Getter6,Method6,Setter6);var Program=Union(Module6,Script6);var VariableReference=Union(AssignmentTargetIdentifier6,BindingIdentifier6,IdentifierExpression6);var NamedObjectProperty=Union(DataProperty6,MethodDefinition);var Expression=Union(ArrayExpression6,ArrowExpression6,AssignmentExpression6,AwaitExpression6,BinaryExpression6,CallExpression6,ClassExpression6,CompoundAssignmentExpression6,ConditionalExpression6,FunctionExpression6,IdentifierExpression6,LiteralBooleanExpression6,LiteralInfinityExpression6,LiteralNullExpression6,LiteralNumericExpression6,LiteralRegExpExpression6,LiteralStringExpression6,MemberExpression,NewExpression6,NewTargetExpression6,ObjectExpression6,TemplateExpression6,ThisExpression6,UnaryExpression6,UpdateExpression6,YieldExpression6,YieldGeneratorExpression6);var Statement=Union(BlockStatement6,BreakStatement6,ClassDeclaration6,ContinueStatement6,DebuggerStatement6,EmptyStatement6,ExpressionStatement6,FunctionDeclaration6,IfStatement6,IterationStatement,LabeledStatement6,ReturnStatement6,SwitchStatement6,SwitchStatementWithDefault6,ThrowStatement6,TryCatchStatement6,TryFinallyStatement6,VariableDeclarationStatement6,WithStatement6);var ObjectProperty=Union(NamedObjectProperty,ShorthandProperty6,SpreadProperty6);Union(ArrayAssignmentTarget6,ArrayBinding6,AssignmentTargetProperty,AssignmentTargetWithDefault6,BindingProperty,BindingWithDefault6,Block6,CatchClause6,ClassElement6,Directive6,ExportDeclaration,ExportFromSpecifier6,ExportLocalSpecifier6,Expression,FormalParameters6,FunctionBody6,ImportDeclaration,ImportSpecifier6,MemberAssignmentTarget,ObjectAssignmentTarget6,ObjectBinding6,ObjectProperty,Program,PropertyName,SpreadElement6,Statement,Super6,SwitchCase6,SwitchDefault6,TemplateElement6,VariableDeclaration6,VariableDeclarator6,VariableReference);ArrayAssignmentTarget6.typeName="ArrayAssignmentTarget";ArrayAssignmentTarget6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ArrayAssignmentTarget"},{name:"elements",type:List(Maybe(Union(AssignmentTargetWithDefault6,Union(Union(ArrayAssignmentTarget6,ObjectAssignmentTarget6),Union(AssignmentTargetIdentifier6,MemberAssignmentTarget)))))},{name:"rest",type:Maybe(Union(Union(ArrayAssignmentTarget6,ObjectAssignmentTarget6),Union(AssignmentTargetIdentifier6,MemberAssignmentTarget)))}];ArrayBinding6.typeName="ArrayBinding";ArrayBinding6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ArrayBinding"},{name:"elements",type:List(Maybe(Union(BindingWithDefault6,Union(BindingIdentifier6,Union(ArrayBinding6,ObjectBinding6)))))},{name:"rest",type:Maybe(Union(BindingIdentifier6,Union(ArrayBinding6,ObjectBinding6)))}];ArrayExpression6.typeName="ArrayExpression";ArrayExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ArrayExpression"},{name:"elements",type:List(Maybe(Union(Expression,SpreadElement6)))}];ArrowExpression6.typeName="ArrowExpression";ArrowExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ArrowExpression"},{name:"isAsync",type:BOOLEAN},{name:"params",type:FormalParameters6},{name:"body",type:Union(Expression,FunctionBody6)}];AssignmentExpression6.typeName="AssignmentExpression";AssignmentExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"AssignmentExpression"},{name:"binding",type:Union(Union(ArrayAssignmentTarget6,ObjectAssignmentTarget6),Union(AssignmentTargetIdentifier6,MemberAssignmentTarget))},{name:"expression",type:Expression}];AssignmentTargetIdentifier6.typeName="AssignmentTargetIdentifier";AssignmentTargetIdentifier6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"AssignmentTargetIdentifier"},{name:"name",type:STRING}];AssignmentTargetPropertyIdentifier6.typeName="AssignmentTargetPropertyIdentifier";AssignmentTargetPropertyIdentifier6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"AssignmentTargetPropertyIdentifier"},{name:"binding",type:AssignmentTargetIdentifier6},{name:"init",type:Maybe(Expression)}];AssignmentTargetPropertyProperty6.typeName="AssignmentTargetPropertyProperty";AssignmentTargetPropertyProperty6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"AssignmentTargetPropertyProperty"},{name:"name",type:PropertyName},{name:"binding",type:Union(AssignmentTargetWithDefault6,Union(Union(ArrayAssignmentTarget6,ObjectAssignmentTarget6),Union(AssignmentTargetIdentifier6,MemberAssignmentTarget)))}];AssignmentTargetWithDefault6.typeName="AssignmentTargetWithDefault";AssignmentTargetWithDefault6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"AssignmentTargetWithDefault"},{name:"binding",type:Union(Union(ArrayAssignmentTarget6,ObjectAssignmentTarget6),Union(AssignmentTargetIdentifier6,MemberAssignmentTarget))},{name:"init",type:Expression}];AwaitExpression6.typeName="AwaitExpression";AwaitExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"AwaitExpression"},{name:"expression",type:Expression}];BinaryExpression6.typeName="BinaryExpression";BinaryExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"BinaryExpression"},{name:"left",type:Expression},{name:"operator",type:BinaryOperator},{name:"right",type:Expression}];BindingIdentifier6.typeName="BindingIdentifier";BindingIdentifier6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"BindingIdentifier"},{name:"name",type:STRING}];BindingPropertyIdentifier6.typeName="BindingPropertyIdentifier";BindingPropertyIdentifier6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"BindingPropertyIdentifier"},{name:"binding",type:BindingIdentifier6},{name:"init",type:Maybe(Expression)}];BindingPropertyProperty6.typeName="BindingPropertyProperty";BindingPropertyProperty6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"BindingPropertyProperty"},{name:"name",type:PropertyName},{name:"binding",type:Union(BindingWithDefault6,Union(BindingIdentifier6,Union(ArrayBinding6,ObjectBinding6)))}];BindingWithDefault6.typeName="BindingWithDefault";BindingWithDefault6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"BindingWithDefault"},{name:"binding",type:Union(BindingIdentifier6,Union(ArrayBinding6,ObjectBinding6))},{name:"init",type:Expression}];Block6.typeName="Block";Block6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"Block"},{name:"statements",type:List(Statement)}];BlockStatement6.typeName="BlockStatement";BlockStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"BlockStatement"},{name:"block",type:Block6}];BreakStatement6.typeName="BreakStatement";BreakStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"BreakStatement"},{name:"label",type:Maybe(STRING)}];CallExpression6.typeName="CallExpression";CallExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"CallExpression"},{name:"callee",type:Union(Expression,Super6)},{name:"arguments",type:List(Union(Expression,SpreadElement6))}];CatchClause6.typeName="CatchClause";CatchClause6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"CatchClause"},{name:"binding",type:Union(BindingIdentifier6,Union(ArrayBinding6,ObjectBinding6))},{name:"body",type:Block6}];ClassDeclaration6.typeName="ClassDeclaration";ClassDeclaration6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ClassDeclaration"},{name:"name",type:BindingIdentifier6},{name:"super",type:Maybe(Expression)},{name:"elements",type:List(ClassElement6)}];ClassElement6.typeName="ClassElement";ClassElement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ClassElement"},{name:"isStatic",type:BOOLEAN},{name:"method",type:MethodDefinition}];ClassExpression6.typeName="ClassExpression";ClassExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ClassExpression"},{name:"name",type:Maybe(BindingIdentifier6)},{name:"super",type:Maybe(Expression)},{name:"elements",type:List(ClassElement6)}];CompoundAssignmentExpression6.typeName="CompoundAssignmentExpression";CompoundAssignmentExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"CompoundAssignmentExpression"},{name:"binding",type:Union(AssignmentTargetIdentifier6,MemberAssignmentTarget)},{name:"operator",type:CompoundAssignmentOperator},{name:"expression",type:Expression}];ComputedMemberAssignmentTarget6.typeName="ComputedMemberAssignmentTarget";ComputedMemberAssignmentTarget6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ComputedMemberAssignmentTarget"},{name:"object",type:Union(Expression,Super6)},{name:"expression",type:Expression}];ComputedMemberExpression6.typeName="ComputedMemberExpression";ComputedMemberExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ComputedMemberExpression"},{name:"object",type:Union(Expression,Super6)},{name:"expression",type:Expression}];ComputedPropertyName6.typeName="ComputedPropertyName";ComputedPropertyName6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ComputedPropertyName"},{name:"expression",type:Expression}];ConditionalExpression6.typeName="ConditionalExpression";ConditionalExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ConditionalExpression"},{name:"test",type:Expression},{name:"consequent",type:Expression},{name:"alternate",type:Expression}];ContinueStatement6.typeName="ContinueStatement";ContinueStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ContinueStatement"},{name:"label",type:Maybe(STRING)}];DataProperty6.typeName="DataProperty";DataProperty6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"DataProperty"},{name:"name",type:PropertyName},{name:"expression",type:Expression}];DebuggerStatement6.typeName="DebuggerStatement";DebuggerStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"DebuggerStatement"}];Directive6.typeName="Directive";Directive6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"Directive"},{name:"rawValue",type:STRING}];DoWhileStatement6.typeName="DoWhileStatement";DoWhileStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"DoWhileStatement"},{name:"body",type:Statement},{name:"test",type:Expression}];EmptyStatement6.typeName="EmptyStatement";EmptyStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"EmptyStatement"}];Export6.typeName="Export";Export6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"Export"},{name:"declaration",type:Union(ClassDeclaration6,FunctionDeclaration6,VariableDeclaration6)}];ExportAllFrom6.typeName="ExportAllFrom";ExportAllFrom6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ExportAllFrom"},{name:"moduleSpecifier",type:STRING}];ExportDefault6.typeName="ExportDefault";ExportDefault6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ExportDefault"},{name:"body",type:Union(ClassDeclaration6,Expression,FunctionDeclaration6)}];ExportFrom6.typeName="ExportFrom";ExportFrom6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ExportFrom"},{name:"namedExports",type:List(ExportFromSpecifier6)},{name:"moduleSpecifier",type:STRING}];ExportFromSpecifier6.typeName="ExportFromSpecifier";ExportFromSpecifier6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ExportFromSpecifier"},{name:"name",type:STRING},{name:"exportedName",type:Maybe(STRING)}];ExportLocalSpecifier6.typeName="ExportLocalSpecifier";ExportLocalSpecifier6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ExportLocalSpecifier"},{name:"name",type:IdentifierExpression6},{name:"exportedName",type:Maybe(STRING)}];ExportLocals6.typeName="ExportLocals";ExportLocals6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ExportLocals"},{name:"namedExports",type:List(ExportLocalSpecifier6)}];ExpressionStatement6.typeName="ExpressionStatement";ExpressionStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ExpressionStatement"},{name:"expression",type:Expression}];ForAwaitStatement6.typeName="ForAwaitStatement";ForAwaitStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ForAwaitStatement"},{name:"left",type:Union(Union(Union(ArrayAssignmentTarget6,ObjectAssignmentTarget6),Union(AssignmentTargetIdentifier6,MemberAssignmentTarget)),VariableDeclaration6)},{name:"right",type:Expression},{name:"body",type:Statement}];ForInStatement6.typeName="ForInStatement";ForInStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ForInStatement"},{name:"left",type:Union(Union(Union(ArrayAssignmentTarget6,ObjectAssignmentTarget6),Union(AssignmentTargetIdentifier6,MemberAssignmentTarget)),VariableDeclaration6)},{name:"right",type:Expression},{name:"body",type:Statement}];ForOfStatement6.typeName="ForOfStatement";ForOfStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ForOfStatement"},{name:"left",type:Union(Union(Union(ArrayAssignmentTarget6,ObjectAssignmentTarget6),Union(AssignmentTargetIdentifier6,MemberAssignmentTarget)),VariableDeclaration6)},{name:"right",type:Expression},{name:"body",type:Statement}];ForStatement6.typeName="ForStatement";ForStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ForStatement"},{name:"init",type:Maybe(Union(Expression,VariableDeclaration6))},{name:"test",type:Maybe(Expression)},{name:"update",type:Maybe(Expression)},{name:"body",type:Statement}];FormalParameters6.typeName="FormalParameters";FormalParameters6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"FormalParameters"},{name:"items",type:List(Union(BindingWithDefault6,Union(BindingIdentifier6,Union(ArrayBinding6,ObjectBinding6))))},{name:"rest",type:Maybe(Union(BindingIdentifier6,Union(ArrayBinding6,ObjectBinding6)))}];FunctionBody6.typeName="FunctionBody";FunctionBody6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"FunctionBody"},{name:"directives",type:List(Directive6)},{name:"statements",type:List(Statement)}];FunctionDeclaration6.typeName="FunctionDeclaration";FunctionDeclaration6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"FunctionDeclaration"},{name:"isAsync",type:BOOLEAN},{name:"isGenerator",type:BOOLEAN},{name:"name",type:BindingIdentifier6},{name:"params",type:FormalParameters6},{name:"body",type:FunctionBody6}];FunctionExpression6.typeName="FunctionExpression";FunctionExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"FunctionExpression"},{name:"isAsync",type:BOOLEAN},{name:"isGenerator",type:BOOLEAN},{name:"name",type:Maybe(BindingIdentifier6)},{name:"params",type:FormalParameters6},{name:"body",type:FunctionBody6}];Getter6.typeName="Getter";Getter6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"Getter"},{name:"name",type:PropertyName},{name:"body",type:FunctionBody6}];IdentifierExpression6.typeName="IdentifierExpression";IdentifierExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"IdentifierExpression"},{name:"name",type:STRING}];IfStatement6.typeName="IfStatement";IfStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"IfStatement"},{name:"test",type:Expression},{name:"consequent",type:Statement},{name:"alternate",type:Maybe(Statement)}];Import6.typeName="Import";Import6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"Import"},{name:"defaultBinding",type:Maybe(BindingIdentifier6)},{name:"namedImports",type:List(ImportSpecifier6)},{name:"moduleSpecifier",type:STRING}];ImportNamespace6.typeName="ImportNamespace";ImportNamespace6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ImportNamespace"},{name:"defaultBinding",type:Maybe(BindingIdentifier6)},{name:"namespaceBinding",type:BindingIdentifier6},{name:"moduleSpecifier",type:STRING}];ImportSpecifier6.typeName="ImportSpecifier";ImportSpecifier6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ImportSpecifier"},{name:"name",type:Maybe(STRING)},{name:"binding",type:BindingIdentifier6}];LabeledStatement6.typeName="LabeledStatement";LabeledStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"LabeledStatement"},{name:"label",type:STRING},{name:"body",type:Statement}];LiteralBooleanExpression6.typeName="LiteralBooleanExpression";LiteralBooleanExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"LiteralBooleanExpression"},{name:"value",type:BOOLEAN}];LiteralInfinityExpression6.typeName="LiteralInfinityExpression";LiteralInfinityExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"LiteralInfinityExpression"}];LiteralNullExpression6.typeName="LiteralNullExpression";LiteralNullExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"LiteralNullExpression"}];LiteralNumericExpression6.typeName="LiteralNumericExpression";LiteralNumericExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"LiteralNumericExpression"},{name:"value",type:DOUBLE}];LiteralRegExpExpression6.typeName="LiteralRegExpExpression";LiteralRegExpExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"LiteralRegExpExpression"},{name:"pattern",type:STRING},{name:"global",type:BOOLEAN},{name:"ignoreCase",type:BOOLEAN},{name:"multiLine",type:BOOLEAN},{name:"dotAll",type:BOOLEAN},{name:"unicode",type:BOOLEAN},{name:"sticky",type:BOOLEAN}];LiteralStringExpression6.typeName="LiteralStringExpression";LiteralStringExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"LiteralStringExpression"},{name:"value",type:STRING}];Method6.typeName="Method";Method6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"Method"},{name:"isAsync",type:BOOLEAN},{name:"isGenerator",type:BOOLEAN},{name:"name",type:PropertyName},{name:"params",type:FormalParameters6},{name:"body",type:FunctionBody6}];Module6.typeName="Module";Module6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"Module"},{name:"directives",type:List(Directive6)},{name:"items",type:List(Union(ExportDeclaration,ImportDeclaration,Statement))}];NewExpression6.typeName="NewExpression";NewExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"NewExpression"},{name:"callee",type:Expression},{name:"arguments",type:List(Union(Expression,SpreadElement6))}];NewTargetExpression6.typeName="NewTargetExpression";NewTargetExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"NewTargetExpression"}];ObjectAssignmentTarget6.typeName="ObjectAssignmentTarget";ObjectAssignmentTarget6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ObjectAssignmentTarget"},{name:"properties",type:List(AssignmentTargetProperty)},{name:"rest",type:Maybe(Union(Union(ArrayAssignmentTarget6,ObjectAssignmentTarget6),Union(AssignmentTargetIdentifier6,MemberAssignmentTarget)))}];ObjectBinding6.typeName="ObjectBinding";ObjectBinding6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ObjectBinding"},{name:"properties",type:List(BindingProperty)},{name:"rest",type:Maybe(Union(BindingIdentifier6,Union(ArrayBinding6,ObjectBinding6)))}];ObjectExpression6.typeName="ObjectExpression";ObjectExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ObjectExpression"},{name:"properties",type:List(ObjectProperty)}];ReturnStatement6.typeName="ReturnStatement";ReturnStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ReturnStatement"},{name:"expression",type:Maybe(Expression)}];Script6.typeName="Script";Script6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"Script"},{name:"directives",type:List(Directive6)},{name:"statements",type:List(Statement)}];Setter6.typeName="Setter";Setter6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"Setter"},{name:"name",type:PropertyName},{name:"param",type:Union(BindingWithDefault6,Union(BindingIdentifier6,Union(ArrayBinding6,ObjectBinding6)))},{name:"body",type:FunctionBody6}];ShorthandProperty6.typeName="ShorthandProperty";ShorthandProperty6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ShorthandProperty"},{name:"name",type:IdentifierExpression6}];SpreadElement6.typeName="SpreadElement";SpreadElement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"SpreadElement"},{name:"expression",type:Expression}];SpreadProperty6.typeName="SpreadProperty";SpreadProperty6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"SpreadProperty"},{name:"expression",type:Expression}];StaticMemberAssignmentTarget6.typeName="StaticMemberAssignmentTarget";StaticMemberAssignmentTarget6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"StaticMemberAssignmentTarget"},{name:"object",type:Union(Expression,Super6)},{name:"property",type:STRING}];StaticMemberExpression6.typeName="StaticMemberExpression";StaticMemberExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"StaticMemberExpression"},{name:"object",type:Union(Expression,Super6)},{name:"property",type:STRING}];StaticPropertyName6.typeName="StaticPropertyName";StaticPropertyName6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"StaticPropertyName"},{name:"value",type:STRING}];Super6.typeName="Super";Super6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"Super"}];SwitchCase6.typeName="SwitchCase";SwitchCase6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"SwitchCase"},{name:"test",type:Expression},{name:"consequent",type:List(Statement)}];SwitchDefault6.typeName="SwitchDefault";SwitchDefault6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"SwitchDefault"},{name:"consequent",type:List(Statement)}];SwitchStatement6.typeName="SwitchStatement";SwitchStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"SwitchStatement"},{name:"discriminant",type:Expression},{name:"cases",type:List(SwitchCase6)}];SwitchStatementWithDefault6.typeName="SwitchStatementWithDefault";SwitchStatementWithDefault6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"SwitchStatementWithDefault"},{name:"discriminant",type:Expression},{name:"preDefaultCases",type:List(SwitchCase6)},{name:"defaultCase",type:SwitchDefault6},{name:"postDefaultCases",type:List(SwitchCase6)}];TemplateElement6.typeName="TemplateElement";TemplateElement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"TemplateElement"},{name:"rawValue",type:STRING}];TemplateExpression6.typeName="TemplateExpression";TemplateExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"TemplateExpression"},{name:"tag",type:Maybe(Expression)},{name:"elements",type:List(Union(Expression,TemplateElement6))}];ThisExpression6.typeName="ThisExpression";ThisExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ThisExpression"}];ThrowStatement6.typeName="ThrowStatement";ThrowStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"ThrowStatement"},{name:"expression",type:Expression}];TryCatchStatement6.typeName="TryCatchStatement";TryCatchStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"TryCatchStatement"},{name:"body",type:Block6},{name:"catchClause",type:CatchClause6}];TryFinallyStatement6.typeName="TryFinallyStatement";TryFinallyStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"TryFinallyStatement"},{name:"body",type:Block6},{name:"catchClause",type:Maybe(CatchClause6)},{name:"finalizer",type:Block6}];UnaryExpression6.typeName="UnaryExpression";UnaryExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"UnaryExpression"},{name:"operator",type:UnaryOperator},{name:"operand",type:Expression}];UpdateExpression6.typeName="UpdateExpression";UpdateExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"UpdateExpression"},{name:"isPrefix",type:BOOLEAN},{name:"operator",type:UpdateOperator},{name:"operand",type:Union(AssignmentTargetIdentifier6,MemberAssignmentTarget)}];VariableDeclaration6.typeName="VariableDeclaration";VariableDeclaration6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"VariableDeclaration"},{name:"kind",type:VariableDeclarationKind},{name:"declarators",type:List(VariableDeclarator6)}];VariableDeclarationStatement6.typeName="VariableDeclarationStatement";VariableDeclarationStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"VariableDeclarationStatement"},{name:"declaration",type:VariableDeclaration6}];VariableDeclarator6.typeName="VariableDeclarator";VariableDeclarator6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"VariableDeclarator"},{name:"binding",type:Union(BindingIdentifier6,Union(ArrayBinding6,ObjectBinding6))},{name:"init",type:Maybe(Expression)}];WhileStatement6.typeName="WhileStatement";WhileStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"WhileStatement"},{name:"test",type:Expression},{name:"body",type:Statement}];WithStatement6.typeName="WithStatement";WithStatement6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"WithStatement"},{name:"object",type:Expression},{name:"body",type:Statement}];YieldExpression6.typeName="YieldExpression";YieldExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"YieldExpression"},{name:"expression",type:Maybe(Expression)}];YieldGeneratorExpression6.typeName="YieldGeneratorExpression";YieldGeneratorExpression6.fields=[{name:"type",type:Const(TYPE_INDICATOR),value:"YieldGeneratorExpression"},{name:"expression",type:Expression}];return SPEC;}();var estraverse$1={};(function(exports2){(function clone(exports3){var Syntax,VisitorOption,VisitorKeys,BREAK,SKIP,REMOVE;function deepCopy(obj){var ret={},key,val;for(key in obj){if(obj.hasOwnProperty(key)){val=obj[key];if(typeof val==="object"&&val!==null){ret[key]=deepCopy(val);}else{ret[key]=val;}}}return ret;}function upperBound(array,func){var diff,len,i2,current;len=array.length;i2=0;while(len){diff=len>>>1;current=i2+diff;if(func(array[current])){len=diff;}else{i2=current+1;len-=diff+1;}}return i2;}Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ChainExpression:"ChainExpression",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",PrivateIdentifier:"PrivateIdentifier",Program:"Program",Property:"Property",PropertyDefinition:"PropertyDefinition",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"};VisitorKeys={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]};BREAK={};SKIP={};REMOVE={};VisitorOption={Break:BREAK,Skip:SKIP,Remove:REMOVE};function Reference(parent,key){this.parent=parent;this.key=key;}Reference.prototype.replace=function replace2(node){this.parent[this.key]=node;};Reference.prototype.remove=function remove(){if(Array.isArray(this.parent)){this.parent.splice(this.key,1);return true;}else{this.replace(null);return false;}};function Element(node,path,wrap,ref){this.node=node;this.path=path;this.wrap=wrap;this.ref=ref;}function Controller(){}Controller.prototype.path=function path(){var i2,iz,j,jz,result,element;function addToPath(result2,path2){if(Array.isArray(path2)){for(j=0,jz=path2.length;j=0;--i2){if(leavelist[i2].node===candidate){return true;}}return false;}Controller.prototype.traverse=function traverse2(root,visitor){var worklist,leavelist,element,node,nodeType,ret,key,current,current2,candidates,candidate,sentinel;this.__initialize(root,visitor);sentinel={};worklist=this.__worklist;leavelist=this.__leavelist;worklist.push(new Element(root,null,null,null));leavelist.push(new Element(null,null,null,null));while(worklist.length){element=worklist.pop();if(element===sentinel){element=leavelist.pop();ret=this.__execute(visitor.leave,element);if(this.__state===BREAK||ret===BREAK){return;}continue;}if(element.node){ret=this.__execute(visitor.enter,element);if(this.__state===BREAK||ret===BREAK){return;}worklist.push(sentinel);leavelist.push(element);if(this.__state===SKIP||ret===SKIP){continue;}node=element.node;nodeType=node.type||element.wrap;candidates=this.__keys[nodeType];if(!candidates){if(this.__fallback){candidates=this.__fallback(node);}else{throw new Error("Unknown node type "+nodeType+".");}}current=candidates.length;while((current-=1)>=0){key=candidates[current];candidate=node[key];if(!candidate){continue;}if(Array.isArray(candidate)){current2=candidate.length;while((current2-=1)>=0){if(!candidate[current2]){continue;}if(candidateExistsInLeaveList(leavelist,candidate[current2])){continue;}if(isProperty(nodeType,candidates[current])){element=new Element(candidate[current2],[key,current2],"Property",null);}else if(isNode(candidate[current2])){element=new Element(candidate[current2],[key,current2],null,null);}else{continue;}worklist.push(element);}}else if(isNode(candidate)){if(candidateExistsInLeaveList(leavelist,candidate)){continue;}worklist.push(new Element(candidate,key,null,null));}}}}};Controller.prototype.replace=function replace2(root,visitor){var worklist,leavelist,node,nodeType,target,element,current,current2,candidates,candidate,sentinel,outer,key;function removeElem(element2){var i2,key2,nextElem,parent;if(element2.ref.remove()){key2=element2.ref.key;parent=element2.ref.parent;i2=worklist.length;while(i2--){nextElem=worklist[i2];if(nextElem.ref&&nextElem.ref.parent===parent){if(nextElem.ref.key=0){key=candidates[current];candidate=node[key];if(!candidate){continue;}if(Array.isArray(candidate)){current2=candidate.length;while((current2-=1)>=0){if(!candidate[current2]){continue;}if(isProperty(nodeType,candidates[current])){element=new Element(candidate[current2],[key,current2],"Property",new Reference(candidate,current2));}else if(isNode(candidate[current2])){element=new Element(candidate[current2],[key,current2],null,new Reference(candidate,current2));}else{continue;}worklist.push(element);}}else if(isNode(candidate)){worklist.push(new Element(candidate,key,null,new Reference(node,key)));}}}return outer.root;};function traverse(root,visitor){var controller=new Controller();return controller.traverse(root,visitor);}function replace(root,visitor){var controller=new Controller();return controller.replace(root,visitor);}function extendCommentRange(comment,tokens){var target;target=upperBound(tokens,function search(token){return token.range[0]>comment.range[0];});comment.extendedRange=[comment.range[0],comment.range[1]];if(target!==tokens.length){comment.extendedRange[1]=tokens[target].range[0];}target-=1;if(target>=0){comment.extendedRange[0]=tokens[target].range[1];}return comment;}function attachComments(tree,providedComments,tokens){var comments=[],comment,len,i2,cursor;if(!tree.range){throw new Error("attachComments needs range information");}if(!tokens.length){if(providedComments.length){for(i2=0,len=providedComments.length;i2node.range[0]){break;}if(comment2.extendedRange[1]===node.range[0]){if(!node.leadingComments){node.leadingComments=[];}node.leadingComments.push(comment2);comments.splice(cursor,1);}else{cursor+=1;}}if(cursor===comments.length){return VisitorOption.Break;}if(comments[cursor].extendedRange[0]>node.range[1]){return VisitorOption.Skip;}}});cursor=0;traverse(tree,{leave:function(node){var comment2;while(cursornode.range[1]){return VisitorOption.Skip;}}});return tree;}exports3.Syntax=Syntax;exports3.traverse=traverse;exports3.replace=replace;exports3.attachComments=attachComments;exports3.VisitorKeys=VisitorKeys;exports3.VisitorOption=VisitorOption;exports3.Controller=Controller;exports3.cloneEnvironment=function(){return clone({});};return exports3;})(exports2);})(estraverse$1);var Spec=_default$2["default"]||_default$2;var estraverse=estraverse$1.cloneEnvironment();Object.keys(estraverse.Syntax).filter(key=>key!=="Property").forEach(key=>{delete estraverse.Syntax[key];delete estraverse.VisitorKeys[key];});Object.assign(estraverse.Syntax,Object.keys(Spec).reduce((result,key)=>{result[key]=key;return result;},{}));Object.assign(estraverse.VisitorKeys,Object.keys(Spec).reduce((result,key)=>{result[key]=Spec[key].fields.map(field=>field.name);return result;},{}));var dist$1={};Object.defineProperty(dist$1,"__esModule",{value:true});function _classCallCheck$5(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}dist$1.ArrayAssignmentTarget=function ArrayAssignmentTarget5(_ref){var elements=_ref.elements,rest=_ref.rest;_classCallCheck$5(this,ArrayAssignmentTarget5);this.type="ArrayAssignmentTarget";this.elements=elements;this.rest=rest;};dist$1.ArrayBinding=function ArrayBinding5(_ref2){var elements=_ref2.elements,rest=_ref2.rest;_classCallCheck$5(this,ArrayBinding5);this.type="ArrayBinding";this.elements=elements;this.rest=rest;};dist$1.ArrayExpression=function ArrayExpression5(_ref3){var elements=_ref3.elements;_classCallCheck$5(this,ArrayExpression5);this.type="ArrayExpression";this.elements=elements;};dist$1.ArrowExpression=function ArrowExpression5(_ref4){var isAsync=_ref4.isAsync,params=_ref4.params,body=_ref4.body;_classCallCheck$5(this,ArrowExpression5);this.type="ArrowExpression";this.isAsync=isAsync;this.params=params;this.body=body;};dist$1.AssignmentExpression=function AssignmentExpression5(_ref5){var binding=_ref5.binding,expression=_ref5.expression;_classCallCheck$5(this,AssignmentExpression5);this.type="AssignmentExpression";this.binding=binding;this.expression=expression;};dist$1.AssignmentTargetIdentifier=function AssignmentTargetIdentifier5(_ref6){var name=_ref6.name;_classCallCheck$5(this,AssignmentTargetIdentifier5);this.type="AssignmentTargetIdentifier";this.name=name;};dist$1.AssignmentTargetPropertyIdentifier=function AssignmentTargetPropertyIdentifier5(_ref7){var binding=_ref7.binding,init=_ref7.init;_classCallCheck$5(this,AssignmentTargetPropertyIdentifier5);this.type="AssignmentTargetPropertyIdentifier";this.binding=binding;this.init=init;};dist$1.AssignmentTargetPropertyProperty=function AssignmentTargetPropertyProperty5(_ref8){var name=_ref8.name,binding=_ref8.binding;_classCallCheck$5(this,AssignmentTargetPropertyProperty5);this.type="AssignmentTargetPropertyProperty";this.name=name;this.binding=binding;};dist$1.AssignmentTargetWithDefault=function AssignmentTargetWithDefault5(_ref9){var binding=_ref9.binding,init=_ref9.init;_classCallCheck$5(this,AssignmentTargetWithDefault5);this.type="AssignmentTargetWithDefault";this.binding=binding;this.init=init;};dist$1.AwaitExpression=function AwaitExpression5(_ref10){var expression=_ref10.expression;_classCallCheck$5(this,AwaitExpression5);this.type="AwaitExpression";this.expression=expression;};dist$1.BinaryExpression=function BinaryExpression5(_ref11){var left=_ref11.left,operator=_ref11.operator,right=_ref11.right;_classCallCheck$5(this,BinaryExpression5);this.type="BinaryExpression";this.left=left;this.operator=operator;this.right=right;};dist$1.BindingIdentifier=function BindingIdentifier5(_ref12){var name=_ref12.name;_classCallCheck$5(this,BindingIdentifier5);this.type="BindingIdentifier";this.name=name;};dist$1.BindingPropertyIdentifier=function BindingPropertyIdentifier5(_ref13){var binding=_ref13.binding,init=_ref13.init;_classCallCheck$5(this,BindingPropertyIdentifier5);this.type="BindingPropertyIdentifier";this.binding=binding;this.init=init;};dist$1.BindingPropertyProperty=function BindingPropertyProperty5(_ref14){var name=_ref14.name,binding=_ref14.binding;_classCallCheck$5(this,BindingPropertyProperty5);this.type="BindingPropertyProperty";this.name=name;this.binding=binding;};dist$1.BindingWithDefault=function BindingWithDefault5(_ref15){var binding=_ref15.binding,init=_ref15.init;_classCallCheck$5(this,BindingWithDefault5);this.type="BindingWithDefault";this.binding=binding;this.init=init;};dist$1.Block=function Block5(_ref16){var statements=_ref16.statements;_classCallCheck$5(this,Block5);this.type="Block";this.statements=statements;};dist$1.BlockStatement=function BlockStatement5(_ref17){var block=_ref17.block;_classCallCheck$5(this,BlockStatement5);this.type="BlockStatement";this.block=block;};dist$1.BreakStatement=function BreakStatement5(_ref18){var label=_ref18.label;_classCallCheck$5(this,BreakStatement5);this.type="BreakStatement";this.label=label;};dist$1.CallExpression=function CallExpression5(_ref19){var callee=_ref19.callee,_arguments=_ref19.arguments;_classCallCheck$5(this,CallExpression5);this.type="CallExpression";this.callee=callee;this.arguments=_arguments;};dist$1.CatchClause=function CatchClause5(_ref20){var binding=_ref20.binding,body=_ref20.body;_classCallCheck$5(this,CatchClause5);this.type="CatchClause";this.binding=binding;this.body=body;};dist$1.ClassDeclaration=function ClassDeclaration5(_ref21){var name=_ref21.name,_super=_ref21.super,elements=_ref21.elements;_classCallCheck$5(this,ClassDeclaration5);this.type="ClassDeclaration";this.name=name;this.super=_super;this.elements=elements;};dist$1.ClassElement=function ClassElement5(_ref22){var isStatic=_ref22.isStatic,method=_ref22.method;_classCallCheck$5(this,ClassElement5);this.type="ClassElement";this.isStatic=isStatic;this.method=method;};dist$1.ClassExpression=function ClassExpression5(_ref23){var name=_ref23.name,_super=_ref23.super,elements=_ref23.elements;_classCallCheck$5(this,ClassExpression5);this.type="ClassExpression";this.name=name;this.super=_super;this.elements=elements;};dist$1.CompoundAssignmentExpression=function CompoundAssignmentExpression5(_ref24){var binding=_ref24.binding,operator=_ref24.operator,expression=_ref24.expression;_classCallCheck$5(this,CompoundAssignmentExpression5);this.type="CompoundAssignmentExpression";this.binding=binding;this.operator=operator;this.expression=expression;};dist$1.ComputedMemberAssignmentTarget=function ComputedMemberAssignmentTarget5(_ref25){var object=_ref25.object,expression=_ref25.expression;_classCallCheck$5(this,ComputedMemberAssignmentTarget5);this.type="ComputedMemberAssignmentTarget";this.object=object;this.expression=expression;};dist$1.ComputedMemberExpression=function ComputedMemberExpression5(_ref26){var object=_ref26.object,expression=_ref26.expression;_classCallCheck$5(this,ComputedMemberExpression5);this.type="ComputedMemberExpression";this.object=object;this.expression=expression;};dist$1.ComputedPropertyName=function ComputedPropertyName5(_ref27){var expression=_ref27.expression;_classCallCheck$5(this,ComputedPropertyName5);this.type="ComputedPropertyName";this.expression=expression;};dist$1.ConditionalExpression=function ConditionalExpression5(_ref28){var test=_ref28.test,consequent=_ref28.consequent,alternate=_ref28.alternate;_classCallCheck$5(this,ConditionalExpression5);this.type="ConditionalExpression";this.test=test;this.consequent=consequent;this.alternate=alternate;};dist$1.ContinueStatement=function ContinueStatement5(_ref29){var label=_ref29.label;_classCallCheck$5(this,ContinueStatement5);this.type="ContinueStatement";this.label=label;};dist$1.DataProperty=function DataProperty5(_ref30){var name=_ref30.name,expression=_ref30.expression;_classCallCheck$5(this,DataProperty5);this.type="DataProperty";this.name=name;this.expression=expression;};dist$1.DebuggerStatement=function DebuggerStatement5(){_classCallCheck$5(this,DebuggerStatement5);this.type="DebuggerStatement";};dist$1.Directive=function Directive5(_ref31){var rawValue=_ref31.rawValue;_classCallCheck$5(this,Directive5);this.type="Directive";this.rawValue=rawValue;};dist$1.DoWhileStatement=function DoWhileStatement5(_ref32){var body=_ref32.body,test=_ref32.test;_classCallCheck$5(this,DoWhileStatement5);this.type="DoWhileStatement";this.body=body;this.test=test;};dist$1.EmptyStatement=function EmptyStatement5(){_classCallCheck$5(this,EmptyStatement5);this.type="EmptyStatement";};dist$1.Export=function Export5(_ref33){var declaration=_ref33.declaration;_classCallCheck$5(this,Export5);this.type="Export";this.declaration=declaration;};dist$1.ExportAllFrom=function ExportAllFrom5(_ref34){var moduleSpecifier=_ref34.moduleSpecifier;_classCallCheck$5(this,ExportAllFrom5);this.type="ExportAllFrom";this.moduleSpecifier=moduleSpecifier;};dist$1.ExportDefault=function ExportDefault5(_ref35){var body=_ref35.body;_classCallCheck$5(this,ExportDefault5);this.type="ExportDefault";this.body=body;};dist$1.ExportFrom=function ExportFrom5(_ref36){var namedExports=_ref36.namedExports,moduleSpecifier=_ref36.moduleSpecifier;_classCallCheck$5(this,ExportFrom5);this.type="ExportFrom";this.namedExports=namedExports;this.moduleSpecifier=moduleSpecifier;};dist$1.ExportFromSpecifier=function ExportFromSpecifier5(_ref37){var name=_ref37.name,exportedName=_ref37.exportedName;_classCallCheck$5(this,ExportFromSpecifier5);this.type="ExportFromSpecifier";this.name=name;this.exportedName=exportedName;};dist$1.ExportLocalSpecifier=function ExportLocalSpecifier5(_ref38){var name=_ref38.name,exportedName=_ref38.exportedName;_classCallCheck$5(this,ExportLocalSpecifier5);this.type="ExportLocalSpecifier";this.name=name;this.exportedName=exportedName;};dist$1.ExportLocals=function ExportLocals5(_ref39){var namedExports=_ref39.namedExports;_classCallCheck$5(this,ExportLocals5);this.type="ExportLocals";this.namedExports=namedExports;};dist$1.ExpressionStatement=function ExpressionStatement5(_ref40){var expression=_ref40.expression;_classCallCheck$5(this,ExpressionStatement5);this.type="ExpressionStatement";this.expression=expression;};dist$1.ForAwaitStatement=function ForAwaitStatement5(_ref41){var left=_ref41.left,right=_ref41.right,body=_ref41.body;_classCallCheck$5(this,ForAwaitStatement5);this.type="ForAwaitStatement";this.left=left;this.right=right;this.body=body;};dist$1.ForInStatement=function ForInStatement5(_ref42){var left=_ref42.left,right=_ref42.right,body=_ref42.body;_classCallCheck$5(this,ForInStatement5);this.type="ForInStatement";this.left=left;this.right=right;this.body=body;};dist$1.ForOfStatement=function ForOfStatement5(_ref43){var left=_ref43.left,right=_ref43.right,body=_ref43.body;_classCallCheck$5(this,ForOfStatement5);this.type="ForOfStatement";this.left=left;this.right=right;this.body=body;};dist$1.ForStatement=function ForStatement5(_ref44){var init=_ref44.init,test=_ref44.test,update=_ref44.update,body=_ref44.body;_classCallCheck$5(this,ForStatement5);this.type="ForStatement";this.init=init;this.test=test;this.update=update;this.body=body;};dist$1.FormalParameters=function FormalParameters5(_ref45){var items=_ref45.items,rest=_ref45.rest;_classCallCheck$5(this,FormalParameters5);this.type="FormalParameters";this.items=items;this.rest=rest;};dist$1.FunctionBody=function FunctionBody5(_ref46){var directives=_ref46.directives,statements=_ref46.statements;_classCallCheck$5(this,FunctionBody5);this.type="FunctionBody";this.directives=directives;this.statements=statements;};dist$1.FunctionDeclaration=function FunctionDeclaration5(_ref47){var isAsync=_ref47.isAsync,isGenerator=_ref47.isGenerator,name=_ref47.name,params=_ref47.params,body=_ref47.body;_classCallCheck$5(this,FunctionDeclaration5);this.type="FunctionDeclaration";this.isAsync=isAsync;this.isGenerator=isGenerator;this.name=name;this.params=params;this.body=body;};dist$1.FunctionExpression=function FunctionExpression5(_ref48){var isAsync=_ref48.isAsync,isGenerator=_ref48.isGenerator,name=_ref48.name,params=_ref48.params,body=_ref48.body;_classCallCheck$5(this,FunctionExpression5);this.type="FunctionExpression";this.isAsync=isAsync;this.isGenerator=isGenerator;this.name=name;this.params=params;this.body=body;};dist$1.Getter=function Getter5(_ref49){var name=_ref49.name,body=_ref49.body;_classCallCheck$5(this,Getter5);this.type="Getter";this.name=name;this.body=body;};dist$1.IdentifierExpression=function IdentifierExpression5(_ref50){var name=_ref50.name;_classCallCheck$5(this,IdentifierExpression5);this.type="IdentifierExpression";this.name=name;};dist$1.IfStatement=function IfStatement5(_ref51){var test=_ref51.test,consequent=_ref51.consequent,alternate=_ref51.alternate;_classCallCheck$5(this,IfStatement5);this.type="IfStatement";this.test=test;this.consequent=consequent;this.alternate=alternate;};dist$1.Import=function Import5(_ref52){var defaultBinding=_ref52.defaultBinding,namedImports=_ref52.namedImports,moduleSpecifier=_ref52.moduleSpecifier;_classCallCheck$5(this,Import5);this.type="Import";this.defaultBinding=defaultBinding;this.namedImports=namedImports;this.moduleSpecifier=moduleSpecifier;};dist$1.ImportNamespace=function ImportNamespace5(_ref53){var defaultBinding=_ref53.defaultBinding,namespaceBinding=_ref53.namespaceBinding,moduleSpecifier=_ref53.moduleSpecifier;_classCallCheck$5(this,ImportNamespace5);this.type="ImportNamespace";this.defaultBinding=defaultBinding;this.namespaceBinding=namespaceBinding;this.moduleSpecifier=moduleSpecifier;};dist$1.ImportSpecifier=function ImportSpecifier5(_ref54){var name=_ref54.name,binding=_ref54.binding;_classCallCheck$5(this,ImportSpecifier5);this.type="ImportSpecifier";this.name=name;this.binding=binding;};dist$1.LabeledStatement=function LabeledStatement5(_ref55){var label=_ref55.label,body=_ref55.body;_classCallCheck$5(this,LabeledStatement5);this.type="LabeledStatement";this.label=label;this.body=body;};dist$1.LiteralBooleanExpression=function LiteralBooleanExpression5(_ref56){var value=_ref56.value;_classCallCheck$5(this,LiteralBooleanExpression5);this.type="LiteralBooleanExpression";this.value=value;};dist$1.LiteralInfinityExpression=function LiteralInfinityExpression5(){_classCallCheck$5(this,LiteralInfinityExpression5);this.type="LiteralInfinityExpression";};dist$1.LiteralNullExpression=function LiteralNullExpression5(){_classCallCheck$5(this,LiteralNullExpression5);this.type="LiteralNullExpression";};dist$1.LiteralNumericExpression=function LiteralNumericExpression5(_ref57){var value=_ref57.value;_classCallCheck$5(this,LiteralNumericExpression5);this.type="LiteralNumericExpression";this.value=value;};dist$1.LiteralRegExpExpression=function LiteralRegExpExpression5(_ref58){var pattern=_ref58.pattern,global=_ref58.global,ignoreCase=_ref58.ignoreCase,multiLine=_ref58.multiLine,dotAll=_ref58.dotAll,unicode2=_ref58.unicode,sticky=_ref58.sticky;_classCallCheck$5(this,LiteralRegExpExpression5);this.type="LiteralRegExpExpression";this.pattern=pattern;this.global=global;this.ignoreCase=ignoreCase;this.multiLine=multiLine;this.dotAll=dotAll;this.unicode=unicode2;this.sticky=sticky;};dist$1.LiteralStringExpression=function LiteralStringExpression5(_ref59){var value=_ref59.value;_classCallCheck$5(this,LiteralStringExpression5);this.type="LiteralStringExpression";this.value=value;};dist$1.Method=function Method5(_ref60){var isAsync=_ref60.isAsync,isGenerator=_ref60.isGenerator,name=_ref60.name,params=_ref60.params,body=_ref60.body;_classCallCheck$5(this,Method5);this.type="Method";this.isAsync=isAsync;this.isGenerator=isGenerator;this.name=name;this.params=params;this.body=body;};dist$1.Module=function Module5(_ref61){var directives=_ref61.directives,items=_ref61.items;_classCallCheck$5(this,Module5);this.type="Module";this.directives=directives;this.items=items;};dist$1.NewExpression=function NewExpression5(_ref62){var callee=_ref62.callee,_arguments=_ref62.arguments;_classCallCheck$5(this,NewExpression5);this.type="NewExpression";this.callee=callee;this.arguments=_arguments;};dist$1.NewTargetExpression=function NewTargetExpression5(){_classCallCheck$5(this,NewTargetExpression5);this.type="NewTargetExpression";};dist$1.ObjectAssignmentTarget=function ObjectAssignmentTarget5(_ref63){var properties=_ref63.properties,rest=_ref63.rest;_classCallCheck$5(this,ObjectAssignmentTarget5);this.type="ObjectAssignmentTarget";this.properties=properties;this.rest=rest;};dist$1.ObjectBinding=function ObjectBinding5(_ref64){var properties=_ref64.properties,rest=_ref64.rest;_classCallCheck$5(this,ObjectBinding5);this.type="ObjectBinding";this.properties=properties;this.rest=rest;};dist$1.ObjectExpression=function ObjectExpression5(_ref65){var properties=_ref65.properties;_classCallCheck$5(this,ObjectExpression5);this.type="ObjectExpression";this.properties=properties;};dist$1.ReturnStatement=function ReturnStatement5(_ref66){var expression=_ref66.expression;_classCallCheck$5(this,ReturnStatement5);this.type="ReturnStatement";this.expression=expression;};dist$1.Script=function Script5(_ref67){var directives=_ref67.directives,statements=_ref67.statements;_classCallCheck$5(this,Script5);this.type="Script";this.directives=directives;this.statements=statements;};dist$1.Setter=function Setter5(_ref68){var name=_ref68.name,param=_ref68.param,body=_ref68.body;_classCallCheck$5(this,Setter5);this.type="Setter";this.name=name;this.param=param;this.body=body;};dist$1.ShorthandProperty=function ShorthandProperty5(_ref69){var name=_ref69.name;_classCallCheck$5(this,ShorthandProperty5);this.type="ShorthandProperty";this.name=name;};dist$1.SpreadElement=function SpreadElement5(_ref70){var expression=_ref70.expression;_classCallCheck$5(this,SpreadElement5);this.type="SpreadElement";this.expression=expression;};dist$1.SpreadProperty=function SpreadProperty5(_ref71){var expression=_ref71.expression;_classCallCheck$5(this,SpreadProperty5);this.type="SpreadProperty";this.expression=expression;};dist$1.StaticMemberAssignmentTarget=function StaticMemberAssignmentTarget5(_ref72){var object=_ref72.object,property=_ref72.property;_classCallCheck$5(this,StaticMemberAssignmentTarget5);this.type="StaticMemberAssignmentTarget";this.object=object;this.property=property;};dist$1.StaticMemberExpression=function StaticMemberExpression5(_ref73){var object=_ref73.object,property=_ref73.property;_classCallCheck$5(this,StaticMemberExpression5);this.type="StaticMemberExpression";this.object=object;this.property=property;};dist$1.StaticPropertyName=function StaticPropertyName5(_ref74){var value=_ref74.value;_classCallCheck$5(this,StaticPropertyName5);this.type="StaticPropertyName";this.value=value;};dist$1.Super=function Super5(){_classCallCheck$5(this,Super5);this.type="Super";};dist$1.SwitchCase=function SwitchCase5(_ref75){var test=_ref75.test,consequent=_ref75.consequent;_classCallCheck$5(this,SwitchCase5);this.type="SwitchCase";this.test=test;this.consequent=consequent;};dist$1.SwitchDefault=function SwitchDefault5(_ref76){var consequent=_ref76.consequent;_classCallCheck$5(this,SwitchDefault5);this.type="SwitchDefault";this.consequent=consequent;};dist$1.SwitchStatement=function SwitchStatement5(_ref77){var discriminant=_ref77.discriminant,cases=_ref77.cases;_classCallCheck$5(this,SwitchStatement5);this.type="SwitchStatement";this.discriminant=discriminant;this.cases=cases;};dist$1.SwitchStatementWithDefault=function SwitchStatementWithDefault5(_ref78){var discriminant=_ref78.discriminant,preDefaultCases=_ref78.preDefaultCases,defaultCase=_ref78.defaultCase,postDefaultCases=_ref78.postDefaultCases;_classCallCheck$5(this,SwitchStatementWithDefault5);this.type="SwitchStatementWithDefault";this.discriminant=discriminant;this.preDefaultCases=preDefaultCases;this.defaultCase=defaultCase;this.postDefaultCases=postDefaultCases;};dist$1.TemplateElement=function TemplateElement5(_ref79){var rawValue=_ref79.rawValue;_classCallCheck$5(this,TemplateElement5);this.type="TemplateElement";this.rawValue=rawValue;};dist$1.TemplateExpression=function TemplateExpression5(_ref80){var tag=_ref80.tag,elements=_ref80.elements;_classCallCheck$5(this,TemplateExpression5);this.type="TemplateExpression";this.tag=tag;this.elements=elements;};dist$1.ThisExpression=function ThisExpression5(){_classCallCheck$5(this,ThisExpression5);this.type="ThisExpression";};dist$1.ThrowStatement=function ThrowStatement5(_ref81){var expression=_ref81.expression;_classCallCheck$5(this,ThrowStatement5);this.type="ThrowStatement";this.expression=expression;};dist$1.TryCatchStatement=function TryCatchStatement5(_ref82){var body=_ref82.body,catchClause=_ref82.catchClause;_classCallCheck$5(this,TryCatchStatement5);this.type="TryCatchStatement";this.body=body;this.catchClause=catchClause;};dist$1.TryFinallyStatement=function TryFinallyStatement5(_ref83){var body=_ref83.body,catchClause=_ref83.catchClause,finalizer=_ref83.finalizer;_classCallCheck$5(this,TryFinallyStatement5);this.type="TryFinallyStatement";this.body=body;this.catchClause=catchClause;this.finalizer=finalizer;};dist$1.UnaryExpression=function UnaryExpression5(_ref84){var operator=_ref84.operator,operand=_ref84.operand;_classCallCheck$5(this,UnaryExpression5);this.type="UnaryExpression";this.operator=operator;this.operand=operand;};dist$1.UpdateExpression=function UpdateExpression5(_ref85){var isPrefix=_ref85.isPrefix,operator=_ref85.operator,operand=_ref85.operand;_classCallCheck$5(this,UpdateExpression5);this.type="UpdateExpression";this.isPrefix=isPrefix;this.operator=operator;this.operand=operand;};dist$1.VariableDeclaration=function VariableDeclaration5(_ref86){var kind=_ref86.kind,declarators=_ref86.declarators;_classCallCheck$5(this,VariableDeclaration5);this.type="VariableDeclaration";this.kind=kind;this.declarators=declarators;};dist$1.VariableDeclarationStatement=function VariableDeclarationStatement5(_ref87){var declaration=_ref87.declaration;_classCallCheck$5(this,VariableDeclarationStatement5);this.type="VariableDeclarationStatement";this.declaration=declaration;};dist$1.VariableDeclarator=function VariableDeclarator5(_ref88){var binding=_ref88.binding,init=_ref88.init;_classCallCheck$5(this,VariableDeclarator5);this.type="VariableDeclarator";this.binding=binding;this.init=init;};dist$1.WhileStatement=function WhileStatement5(_ref89){var test=_ref89.test,body=_ref89.body;_classCallCheck$5(this,WhileStatement5);this.type="WhileStatement";this.test=test;this.body=body;};dist$1.WithStatement=function WithStatement5(_ref90){var object=_ref90.object,body=_ref90.body;_classCallCheck$5(this,WithStatement5);this.type="WithStatement";this.object=object;this.body=body;};dist$1.YieldExpression=function YieldExpression5(_ref91){var expression=_ref91.expression;_classCallCheck$5(this,YieldExpression5);this.type="YieldExpression";this.expression=expression;};dist$1.YieldGeneratorExpression=function YieldGeneratorExpression5(_ref92){var expression=_ref92.expression;_classCallCheck$5(this,YieldGeneratorExpression5);this.type="YieldGeneratorExpression";this.expression=expression;};var dist={};var minimalCodegen$1={};/* -object-assign -(c) Sindre Sorhus -@license MIT -*/var getOwnPropertySymbols=Object.getOwnPropertySymbols;var hasOwnProperty=Object.prototype.hasOwnProperty;var propIsEnumerable=Object.prototype.propertyIsEnumerable;function toObject(val){if(val===null||val===void 0){throw new TypeError("Object.assign cannot be called with null or undefined");}return Object(val);}function shouldUseNative(){try{if(!Object.assign){return false;}var test1=new String("abc");test1[5]="de";if(Object.getOwnPropertyNames(test1)[0]==="5"){return false;}var test2={};for(var i2=0;i2<10;i2++){test2["_"+String.fromCharCode(i2)]=i2;}var order2=Object.getOwnPropertyNames(test2).map(function(n){return test2[n];});if(order2.join("")!=="0123456789"){return false;}var test3={};"abcdefghijklmnopqrst".split("").forEach(function(letter){test3[letter]=letter;});if(Object.keys(Object.assign({},test3)).join("")!=="abcdefghijklmnopqrst"){return false;}return true;}catch(err){return false;}}var objectAssign=shouldUseNative()?Object.assign:function(target,source){var from;var to=toObject(target);var symbols;for(var s=1;s=48&&ch2<=55;}NON_ASCII_WHITESPACES=[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function isWhiteSpace2(ch2){return ch2===32||ch2===9||ch2===11||ch2===12||ch2===160||ch2>=5760&&NON_ASCII_WHITESPACES.indexOf(ch2)>=0;}function isLineTerminator2(ch2){return ch2===10||ch2===13||ch2===8232||ch2===8233;}function fromCodePoint2(cp){if(cp<=65535){return String.fromCharCode(cp);}var cu1=String.fromCharCode(Math.floor((cp-65536)/1024)+55296);var cu2=String.fromCharCode((cp-65536)%1024+56320);return cu1+cu2;}IDENTIFIER_START=new Array(128);for(ch=0;ch<128;++ch){IDENTIFIER_START[ch]=ch>=97&&ch<=122||ch>=65&&ch<=90||ch===36||ch===95;}IDENTIFIER_PART=new Array(128);for(ch=0;ch<128;++ch){IDENTIFIER_PART[ch]=ch>=97&&ch<=122||ch>=65&&ch<=90||ch>=48&&ch<=57||ch===36||ch===95;}function isIdentifierStartES5(ch2){return ch2<128?IDENTIFIER_START[ch2]:ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint2(ch2));}function isIdentifierPartES5(ch2){return ch2<128?IDENTIFIER_PART[ch2]:ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint2(ch2));}function isIdentifierStartES6(ch2){return ch2<128?IDENTIFIER_START[ch2]:ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint2(ch2));}function isIdentifierPartES62(ch2){return ch2<128?IDENTIFIER_PART[ch2]:ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint2(ch2));}code$2.exports={isDecimalDigit:isDecimalDigit2,isHexDigit,isOctalDigit,isWhiteSpace:isWhiteSpace2,isLineTerminator:isLineTerminator2,isIdentifierStartES5,isIdentifierPartES5,isIdentifierStartES6,isIdentifierPartES6:isIdentifierPartES62};})();var code$1=/* @__PURE__ */_mergeNamespaces({__proto__:null,"default":code$2.exports},[code$2.exports]);var require$$1$2=/* @__PURE__ */getAugmentedNamespace(code$1);var keyword$2={exports:{}};(function(){var code2=require$$1$2;function isStrictModeReservedWordES6(id2){switch(id2){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"let":return true;default:return false;}}function isKeywordES5(id2,strict){if(!strict&&id2==="yield"){return false;}return isKeywordES6(id2,strict);}function isKeywordES6(id2,strict){if(strict&&isStrictModeReservedWordES6(id2)){return true;}switch(id2.length){case 2:return id2==="if"||id2==="in"||id2==="do";case 3:return id2==="var"||id2==="for"||id2==="new"||id2==="try";case 4:return id2==="this"||id2==="else"||id2==="case"||id2==="void"||id2==="with"||id2==="enum";case 5:return id2==="while"||id2==="break"||id2==="catch"||id2==="throw"||id2==="const"||id2==="yield"||id2==="class"||id2==="super";case 6:return id2==="return"||id2==="typeof"||id2==="delete"||id2==="switch"||id2==="export"||id2==="import";case 7:return id2==="default"||id2==="finally"||id2==="extends";case 8:return id2==="function"||id2==="continue"||id2==="debugger";case 10:return id2==="instanceof";default:return false;}}function isReservedWordES5(id2,strict){return id2==="null"||id2==="true"||id2==="false"||isKeywordES5(id2,strict);}function isReservedWordES6(id2,strict){return id2==="null"||id2==="true"||id2==="false"||isKeywordES6(id2,strict);}function isRestrictedWord(id2){return id2==="eval"||id2==="arguments";}function isIdentifierNameES5(id2){var i2,iz,ch;if(id2.length===0){return false;}ch=id2.charCodeAt(0);if(!code2.isIdentifierStartES5(ch)){return false;}for(i2=1,iz=id2.length;i2=iz){return false;}lowCh=id2.charCodeAt(i2);if(!(56320<=lowCh&&lowCh<=57343)){return false;}ch=decodeUtf162(ch,lowCh);}if(!check(ch)){return false;}check=code2.isIdentifierPartES6;}return true;}function isIdentifierES5(id2,strict){return isIdentifierNameES5(id2)&&!isReservedWordES5(id2,strict);}function isIdentifierES6(id2,strict){return isIdentifierNameES6(id2)&&!isReservedWordES6(id2,strict);}keyword$2.exports={isKeywordES5,isKeywordES6,isReservedWordES5,isReservedWordES6,isRestrictedWord,isIdentifierNameES5,isIdentifierNameES6,isIdentifierES5,isIdentifierES6};})();var keyword$1=/* @__PURE__ */_mergeNamespaces({__proto__:null,"default":keyword$2.exports},[keyword$2.exports]);var require$$2$1=/* @__PURE__ */getAugmentedNamespace(keyword$1);var keyword;var code;var ast;(function(){ast=utils$1.ast=require$$0$2;code=utils$1.code=require$$1$2;keyword=utils$1.keyword=require$$2$1;})();var utils=/* @__PURE__ */_mergeNamespaces({__proto__:null,get ast(){return ast;},get code(){return code;},get keyword(){return keyword;},"default":utils$1},[utils$1]);var require$$1$1=/* @__PURE__ */getAugmentedNamespace(utils);var coderep$1={};var SemiOp_1;var CommaSep_1;var Semi_1;var Seq_1;var ContainsIn_1;var NoIn_1;var Brace_1;var Bracket_1;var Paren_1;var NumberCodeRep_1;var RawToken_1;var Token_1;var Empty_1;var CodeRep_1;Object.defineProperty(coderep$1,"__esModule",{value:true});var _createClass$4=function(){function defineProperties(target,props){for(var i2=0;i2":Precedence.Relational,"<=":Precedence.Relational,">=":Precedence.Relational,"in":Precedence.Relational,"instanceof":Precedence.Relational,"<<":Precedence.BitwiseSHIFT,">>":Precedence.BitwiseSHIFT,">>>":Precedence.BitwiseSHIFT,"+":Precedence.Additive,"-":Precedence.Additive,"*":Precedence.Multiplicative,"%":Precedence.Multiplicative,"/":Precedence.Multiplicative,"**":Precedence.Exponential};function getPrecedence(node){switch(node.type){case"ArrayExpression":case"FunctionExpression":case"ClassExpression":case"IdentifierExpression":case"AssignmentTargetIdentifier":case"NewTargetExpression":case"Super":case"LiteralBooleanExpression":case"LiteralNullExpression":case"LiteralNumericExpression":case"LiteralInfinityExpression":case"LiteralRegExpExpression":case"LiteralStringExpression":case"ObjectExpression":case"ThisExpression":case"SpreadElement":case"FunctionBody":return Precedence.Primary;case"ArrowExpression":case"AssignmentExpression":case"CompoundAssignmentExpression":case"YieldExpression":case"YieldGeneratorExpression":return Precedence.Assignment;case"ConditionalExpression":return Precedence.Conditional;case"ComputedMemberExpression":case"StaticMemberExpression":case"ComputedMemberAssignmentTarget":case"StaticMemberAssignmentTarget":switch(node.object.type){case"CallExpression":case"ComputedMemberExpression":case"StaticMemberExpression":case"TemplateExpression":return getPrecedence(node.object);default:return Precedence.Member;}case"TemplateExpression":if(node.tag==null)return Precedence.Member;switch(node.tag.type){case"CallExpression":case"ComputedMemberExpression":case"StaticMemberExpression":case"TemplateExpression":return getPrecedence(node.tag);default:return Precedence.Member;}case"BinaryExpression":return BinaryPrecedence[node.operator];case"CallExpression":return Precedence.Call;case"NewExpression":return node.arguments.length===0?Precedence.New:Precedence.Member;case"UpdateExpression":return node.isPrefix?Precedence.Prefix:Precedence.Postfix;case"AwaitExpression":case"UnaryExpression":return Precedence.Prefix;default:throw new Error("unreachable: "+node.type);}}function escapeStringLiteral(stringValue){var result="";var nSingle=0,nDouble=0;for(var i2=0,l=stringValue.length;i2nSingle?"'":'"';result+=delim;for(var _i=0;_i1&&arguments[1]!==void 0?arguments[1]:false;_classCallCheck$4(this,Token2);var _this2=_possibleConstructorReturn$2(this,(Token2.__proto__||Object.getPrototypeOf(Token2)).call(this));_this2.token=token;_this2.isRegExp=isRegExp;return _this2;}_createClass$4(Token2,[{key:"emit",value:function emit(ts){ts.put(this.token,this.isRegExp);}}]);return Token2;}(CodeRep);RawToken_1=coderep$1.RawToken=function(_CodeRep3){_inherits$2(RawToken,_CodeRep3);function RawToken(token){_classCallCheck$4(this,RawToken);var _this3=_possibleConstructorReturn$2(this,(RawToken.__proto__||Object.getPrototypeOf(RawToken)).call(this));_this3.token=token;return _this3;}_createClass$4(RawToken,[{key:"emit",value:function emit(ts){ts.putRaw(this.token);}}]);return RawToken;}(CodeRep);NumberCodeRep_1=coderep$1.NumberCodeRep=function(_CodeRep4){_inherits$2(NumberCodeRep,_CodeRep4);function NumberCodeRep(number){_classCallCheck$4(this,NumberCodeRep);var _this4=_possibleConstructorReturn$2(this,(NumberCodeRep.__proto__||Object.getPrototypeOf(NumberCodeRep)).call(this));_this4.number=number;return _this4;}_createClass$4(NumberCodeRep,[{key:"emit",value:function emit(ts){ts.putNumber(this.number);}}]);return NumberCodeRep;}(CodeRep);Paren_1=coderep$1.Paren=function(_CodeRep5){_inherits$2(Paren,_CodeRep5);function Paren(expr){_classCallCheck$4(this,Paren);var _this5=_possibleConstructorReturn$2(this,(Paren.__proto__||Object.getPrototypeOf(Paren)).call(this));_this5.expr=expr;return _this5;}_createClass$4(Paren,[{key:"emit",value:function emit(ts){ts.put("(");this.expr.emit(ts,false);ts.put(")");}},{key:"forEach",value:function forEach(f){f(this);this.expr.forEach(f);}}]);return Paren;}(CodeRep);Bracket_1=coderep$1.Bracket=function(_CodeRep6){_inherits$2(Bracket,_CodeRep6);function Bracket(expr){_classCallCheck$4(this,Bracket);var _this6=_possibleConstructorReturn$2(this,(Bracket.__proto__||Object.getPrototypeOf(Bracket)).call(this));_this6.expr=expr;return _this6;}_createClass$4(Bracket,[{key:"emit",value:function emit(ts){ts.put("[");this.expr.emit(ts,false);ts.put("]");}},{key:"forEach",value:function forEach(f){f(this);this.expr.forEach(f);}}]);return Bracket;}(CodeRep);Brace_1=coderep$1.Brace=function(_CodeRep7){_inherits$2(Brace,_CodeRep7);function Brace(expr){_classCallCheck$4(this,Brace);var _this7=_possibleConstructorReturn$2(this,(Brace.__proto__||Object.getPrototypeOf(Brace)).call(this));_this7.expr=expr;return _this7;}_createClass$4(Brace,[{key:"emit",value:function emit(ts){ts.put("{");this.expr.emit(ts,false);ts.put("}");}},{key:"forEach",value:function forEach(f){f(this);this.expr.forEach(f);}}]);return Brace;}(CodeRep);NoIn_1=coderep$1.NoIn=function(_CodeRep8){_inherits$2(NoIn,_CodeRep8);function NoIn(expr){_classCallCheck$4(this,NoIn);var _this8=_possibleConstructorReturn$2(this,(NoIn.__proto__||Object.getPrototypeOf(NoIn)).call(this));_this8.expr=expr;return _this8;}_createClass$4(NoIn,[{key:"emit",value:function emit(ts){this.expr.emit(ts,true);}},{key:"forEach",value:function forEach(f){f(this);this.expr.forEach(f);}}]);return NoIn;}(CodeRep);ContainsIn_1=coderep$1.ContainsIn=function(_CodeRep9){_inherits$2(ContainsIn,_CodeRep9);function ContainsIn(expr){_classCallCheck$4(this,ContainsIn);var _this9=_possibleConstructorReturn$2(this,(ContainsIn.__proto__||Object.getPrototypeOf(ContainsIn)).call(this));_this9.expr=expr;return _this9;}_createClass$4(ContainsIn,[{key:"emit",value:function emit(ts,noIn2){if(noIn2){ts.put("(");this.expr.emit(ts,false);ts.put(")");}else{this.expr.emit(ts,false);}}},{key:"forEach",value:function forEach(f){f(this);this.expr.forEach(f);}}]);return ContainsIn;}(CodeRep);Seq_1=coderep$1.Seq=function(_CodeRep10){_inherits$2(Seq,_CodeRep10);function Seq(children){_classCallCheck$4(this,Seq);var _this10=_possibleConstructorReturn$2(this,(Seq.__proto__||Object.getPrototypeOf(Seq)).call(this));_this10.children=children;return _this10;}_createClass$4(Seq,[{key:"emit",value:function emit(ts,noIn2){this.children.forEach(function(cr){return cr.emit(ts,noIn2);});}},{key:"forEach",value:function forEach(f){f(this);this.children.forEach(function(x){return x.forEach(f);});}}]);return Seq;}(CodeRep);Semi_1=coderep$1.Semi=function(_Token){_inherits$2(Semi,_Token);function Semi(){_classCallCheck$4(this,Semi);return _possibleConstructorReturn$2(this,(Semi.__proto__||Object.getPrototypeOf(Semi)).call(this,";"));}return Semi;}(Token);CommaSep_1=coderep$1.CommaSep=function(_CodeRep11){_inherits$2(CommaSep,_CodeRep11);function CommaSep(children){_classCallCheck$4(this,CommaSep);var _this12=_possibleConstructorReturn$2(this,(CommaSep.__proto__||Object.getPrototypeOf(CommaSep)).call(this));_this12.children=children;return _this12;}_createClass$4(CommaSep,[{key:"emit",value:function emit(ts,noIn2){var first=true;this.children.forEach(function(cr){if(first){first=false;}else{ts.put(",");}cr.emit(ts,noIn2);});}},{key:"forEach",value:function forEach(f){f(this);this.children.forEach(function(x){return x.forEach(f);});}}]);return CommaSep;}(CodeRep);SemiOp_1=coderep$1.SemiOp=function(_CodeRep12){_inherits$2(SemiOp,_CodeRep12);function SemiOp(){_classCallCheck$4(this,SemiOp);return _possibleConstructorReturn$2(this,(SemiOp.__proto__||Object.getPrototypeOf(SemiOp)).call(this));}_createClass$4(SemiOp,[{key:"emit",value:function emit(ts){ts.putOptionalSemi();}}]);return SemiOp;}(CodeRep);var coderep=/* @__PURE__ */_mergeNamespaces({__proto__:null,getPrecedence:getPrecedence_1,escapeStringLiteral:escapeStringLiteral_1,Precedence:Precedence_1,get CodeRep(){return CodeRep_1;},get Empty(){return Empty_1;},get Token(){return Token_1;},get RawToken(){return RawToken_1;},get NumberCodeRep(){return NumberCodeRep_1;},get Paren(){return Paren_1;},get Bracket(){return Bracket_1;},get Brace(){return Brace_1;},get NoIn(){return NoIn_1;},get ContainsIn(){return ContainsIn_1;},get Seq(){return Seq_1;},get Semi(){return Semi_1;},get CommaSep(){return CommaSep_1;},get SemiOp(){return SemiOp_1;},"default":coderep$1},[coderep$1]);var require$$2=/* @__PURE__ */getAugmentedNamespace(coderep);Object.defineProperty(minimalCodegen$1,"__esModule",{value:true});var _createClass$3=function(){function defineProperties(target,props){for(var i2=0;i21&&arguments[1]!==void 0?arguments[1]:false;return new _coderep$1.Token(token,isRegExp);}function paren(rep){return new _coderep$1.Paren(rep);}function brace(rep){return new _coderep$1.Brace(rep);}function bracket(rep){return new _coderep$1.Bracket(rep);}function noIn$1(rep){return new _coderep$1.NoIn(rep);}function markContainsIn$1(state){return state.containsIn?new _coderep$1.ContainsIn(state):state;}function seq$1(){for(var _len=arguments.length,reps=Array(_len),_key=0;_key<_len;_key++){reps[_key]=arguments[_key];}return new _coderep$1.Seq(reps);}function semi(){return new _coderep$1.Semi();}function semiOp(){return new _coderep$1.SemiOp();}function empty$1(){return new _coderep$1.Empty();}function commaSep(pieces){return new _coderep$1.CommaSep(pieces);}function getAssignmentExpr(state){return state?state.containsGroup?paren(state):state:empty$1();}var MinimalCodeGen=function(){function MinimalCodeGen2(){_classCallCheck$3(this,MinimalCodeGen2);}_createClass$3(MinimalCodeGen2,[{key:"parenToAvoidBeingDirective",value:function parenToAvoidBeingDirective(element,original){if(element&&element.type==="ExpressionStatement"&&element.expression.type==="LiteralStringExpression"){return seq$1(paren(original.children[0]),semiOp());}return original;}},{key:"regenerateArrowParams",value:function regenerateArrowParams(element,original){if(element.rest==null&&element.items.length===1&&element.items[0].type==="BindingIdentifier"){return this.reduceBindingIdentifier(element.items[0]);}return original;}},{key:"reduceArrayExpression",value:function reduceArrayExpression(node,_ref){var elements=_ref.elements;if(elements.length===0){return bracket(empty$1());}var content=commaSep(elements.map(getAssignmentExpr));if(elements.length>0&&elements[elements.length-1]==null){content=seq$1(content,t(","));}return bracket(content);}},{key:"reduceAwaitExpression",value:function reduceAwaitExpression(node,_ref2){var expression=_ref2.expression;return seq$1(t("await"),p(node.expression,(0,_coderep$1.getPrecedence)(node),expression));}},{key:"reduceSpreadElement",value:function reduceSpreadElement(node,_ref3){var expression=_ref3.expression;return seq$1(t("..."),p(node.expression,_coderep$1.Precedence.Assignment,expression));}},{key:"reduceSpreadProperty",value:function reduceSpreadProperty(node,_ref4){var expression=_ref4.expression;return seq$1(t("..."),getAssignmentExpr(expression));}},{key:"reduceAssignmentExpression",value:function reduceAssignmentExpression(node,_ref5){var binding=_ref5.binding,expression=_ref5.expression;var leftCode=binding;var rightCode=expression;var containsIn=expression.containsIn;var startsWithCurly=binding.startsWithCurly;var startsWithLetSquareBracket=binding.startsWithLetSquareBracket;var startsWithFunctionOrClass=binding.startsWithFunctionOrClass;if((0,_coderep$1.getPrecedence)(node.expression)<(0,_coderep$1.getPrecedence)(node)){rightCode=paren(rightCode);containsIn=false;}return(0,_objectAssign2$1.default)(seq$1(leftCode,t("="),rightCode),{containsIn,startsWithCurly,startsWithLetSquareBracket,startsWithFunctionOrClass});}},{key:"reduceAssignmentTargetIdentifier",value:function reduceAssignmentTargetIdentifier(node){var a=t(node.name);if(node.name==="let"){a.startsWithLet=true;}return a;}},{key:"reduceAssignmentTargetWithDefault",value:function reduceAssignmentTargetWithDefault(node,_ref6){var binding=_ref6.binding,init=_ref6.init;return seq$1(binding,t("="),p(node.init,_coderep$1.Precedence.Assignment,init));}},{key:"reduceCompoundAssignmentExpression",value:function reduceCompoundAssignmentExpression(node,_ref7){var binding=_ref7.binding,expression=_ref7.expression;var leftCode=binding;var rightCode=expression;var containsIn=expression.containsIn;var startsWithCurly=binding.startsWithCurly;var startsWithLetSquareBracket=binding.startsWithLetSquareBracket;var startsWithFunctionOrClass=binding.startsWithFunctionOrClass;if((0,_coderep$1.getPrecedence)(node.expression)<(0,_coderep$1.getPrecedence)(node)){rightCode=paren(rightCode);containsIn=false;}return(0,_objectAssign2$1.default)(seq$1(leftCode,t(node.operator),rightCode),{containsIn,startsWithCurly,startsWithLetSquareBracket,startsWithFunctionOrClass});}},{key:"reduceBinaryExpression",value:function reduceBinaryExpression(node,_ref8){var left=_ref8.left,right=_ref8.right;var leftCode=left;var startsWithCurly=left.startsWithCurly;var startsWithLetSquareBracket=left.startsWithLetSquareBracket;var startsWithFunctionOrClass=left.startsWithFunctionOrClass;var leftContainsIn=left.containsIn;var isRightAssociative=node.operator==="**";if((0,_coderep$1.getPrecedence)(node.left)<(0,_coderep$1.getPrecedence)(node)||isRightAssociative&&((0,_coderep$1.getPrecedence)(node.left)===(0,_coderep$1.getPrecedence)(node)||node.left.type==="UnaryExpression")){leftCode=paren(leftCode);startsWithCurly=false;startsWithLetSquareBracket=false;startsWithFunctionOrClass=false;leftContainsIn=false;}var rightCode=right;var rightContainsIn=right.containsIn;if((0,_coderep$1.getPrecedence)(node.right)<(0,_coderep$1.getPrecedence)(node)||!isRightAssociative&&(0,_coderep$1.getPrecedence)(node.right)===(0,_coderep$1.getPrecedence)(node)){rightCode=paren(rightCode);rightContainsIn=false;}return(0,_objectAssign2$1.default)(seq$1(leftCode,t(node.operator),rightCode),{containsIn:leftContainsIn||rightContainsIn||node.operator==="in",containsGroup:node.operator===",",startsWithCurly,startsWithLetSquareBracket,startsWithFunctionOrClass});}},{key:"reduceBindingWithDefault",value:function reduceBindingWithDefault(node,_ref9){var binding=_ref9.binding,init=_ref9.init;return seq$1(binding,t("="),p(node.init,_coderep$1.Precedence.Assignment,init));}},{key:"reduceBindingIdentifier",value:function reduceBindingIdentifier(node){var a=t(node.name);if(node.name==="let"){a.startsWithLet=true;}return a;}},{key:"reduceArrayAssignmentTarget",value:function reduceArrayAssignmentTarget(node,_ref10){var elements=_ref10.elements,rest=_ref10.rest;var content=void 0;if(elements.length===0){content=rest==null?empty$1():seq$1(t("..."),rest);}else{elements=elements.concat(rest==null?[]:[seq$1(t("..."),rest)]);content=commaSep(elements.map(getAssignmentExpr));if(elements.length>0&&elements[elements.length-1]==null){content=seq$1(content,t(","));}}return bracket(content);}},{key:"reduceArrayBinding",value:function reduceArrayBinding(node,_ref11){var elements=_ref11.elements,rest=_ref11.rest;var content=void 0;if(elements.length===0){content=rest==null?empty$1():seq$1(t("..."),rest);}else{elements=elements.concat(rest==null?[]:[seq$1(t("..."),rest)]);content=commaSep(elements.map(getAssignmentExpr));if(elements.length>0&&elements[elements.length-1]==null){content=seq$1(content,t(","));}}return bracket(content);}},{key:"reduceObjectAssignmentTarget",value:function reduceObjectAssignmentTarget(node,_ref12){var properties=_ref12.properties,rest=_ref12.rest;var content=commaSep(properties);if(properties.length===0){content=rest==null?empty$1():seq$1(t("..."),rest);}else{content=rest==null?content:seq$1(content,t(","),t("..."),rest);}var state=brace(content);state.startsWithCurly=true;return state;}},{key:"reduceObjectBinding",value:function reduceObjectBinding(node,_ref13){var properties=_ref13.properties,rest=_ref13.rest;var content=commaSep(properties);if(properties.length===0){content=rest==null?empty$1():seq$1(t("..."),rest);}else{content=rest==null?content:seq$1(content,t(","),t("..."),rest);}var state=brace(content);state.startsWithCurly=true;return state;}},{key:"reduceAssignmentTargetPropertyIdentifier",value:function reduceAssignmentTargetPropertyIdentifier(node,_ref14){var binding=_ref14.binding,init=_ref14.init;if(node.init==null)return binding;return seq$1(binding,t("="),p(node.init,_coderep$1.Precedence.Assignment,init));}},{key:"reduceAssignmentTargetPropertyProperty",value:function reduceAssignmentTargetPropertyProperty(node,_ref15){var name=_ref15.name,binding=_ref15.binding;return seq$1(name,t(":"),binding);}},{key:"reduceBindingPropertyIdentifier",value:function reduceBindingPropertyIdentifier(node,_ref16){var binding=_ref16.binding,init=_ref16.init;if(node.init==null)return binding;return seq$1(binding,t("="),p(node.init,_coderep$1.Precedence.Assignment,init));}},{key:"reduceBindingPropertyProperty",value:function reduceBindingPropertyProperty(node,_ref17){var name=_ref17.name,binding=_ref17.binding;return seq$1(name,t(":"),binding);}},{key:"reduceBlock",value:function reduceBlock(node,_ref18){var statements=_ref18.statements;return brace(seq$1.apply(void 0,_toConsumableArray$2(statements)));}},{key:"reduceBlockStatement",value:function reduceBlockStatement(node,_ref19){var block=_ref19.block;return block;}},{key:"reduceBreakStatement",value:function reduceBreakStatement(node){return seq$1(t("break"),node.label?t(node.label):empty$1(),semiOp());}},{key:"reduceCallExpression",value:function reduceCallExpression(node,_ref20){var callee=_ref20.callee,args=_ref20.arguments;var parenthizedArgs=args.map(function(a,i2){return p(node.arguments[i2],_coderep$1.Precedence.Assignment,a);});return(0,_objectAssign2$1.default)(seq$1(p(node.callee,(0,_coderep$1.getPrecedence)(node),callee),paren(commaSep(parenthizedArgs))),{startsWithCurly:callee.startsWithCurly,startsWithLet:callee.startsWithLet,startsWithLetSquareBracket:callee.startsWithLetSquareBracket,startsWithFunctionOrClass:callee.startsWithFunctionOrClass});}},{key:"reduceCatchClause",value:function reduceCatchClause(node,_ref21){var binding=_ref21.binding,body=_ref21.body;return seq$1(t("catch"),paren(binding),body);}},{key:"reduceClassDeclaration",value:function reduceClassDeclaration(node,_ref22){var name=_ref22.name,_super=_ref22.super,elements=_ref22.elements;var state=seq$1(t("class"),node.name.name==="*default*"?empty$1():name);if(_super!=null){state=seq$1(state,t("extends"),p(node.super,_coderep$1.Precedence.New,_super));}state=seq$1.apply(void 0,[state,t("{")].concat(_toConsumableArray$2(elements),[t("}")]));return state;}},{key:"reduceClassExpression",value:function reduceClassExpression(node,_ref23){var name=_ref23.name,_super=_ref23.super,elements=_ref23.elements;var state=t("class");if(name!=null){state=seq$1(state,name);}if(_super!=null){state=seq$1(state,t("extends"),p(node.super,_coderep$1.Precedence.New,_super));}state=seq$1.apply(void 0,[state,t("{")].concat(_toConsumableArray$2(elements),[t("}")]));state.startsWithFunctionOrClass=true;return state;}},{key:"reduceClassElement",value:function reduceClassElement(node,_ref24){var method=_ref24.method;if(!node.isStatic)return method;return seq$1(t("static"),method);}},{key:"reduceComputedMemberAssignmentTarget",value:function reduceComputedMemberAssignmentTarget(node,_ref25){var object=_ref25.object,expression=_ref25.expression;var startsWithLetSquareBracket=object.startsWithLetSquareBracket||node.object.type==="IdentifierExpression"&&node.object.name==="let";return(0,_objectAssign2$1.default)(seq$1(p(node.object,(0,_coderep$1.getPrecedence)(node),object),bracket(expression)),{startsWithLet:object.startsWithLet,startsWithLetSquareBracket,startsWithCurly:object.startsWithCurly,startsWithFunctionOrClass:object.startsWithFunctionOrClass});}},{key:"reduceComputedMemberExpression",value:function reduceComputedMemberExpression(node,_ref26){var object=_ref26.object,expression=_ref26.expression;var startsWithLetSquareBracket=object.startsWithLetSquareBracket||node.object.type==="IdentifierExpression"&&node.object.name==="let";return(0,_objectAssign2$1.default)(seq$1(p(node.object,(0,_coderep$1.getPrecedence)(node),object),bracket(expression)),{startsWithLet:object.startsWithLet,startsWithLetSquareBracket,startsWithCurly:object.startsWithCurly,startsWithFunctionOrClass:object.startsWithFunctionOrClass});}},{key:"reduceComputedPropertyName",value:function reduceComputedPropertyName(node,_ref27){var expression=_ref27.expression;return bracket(p(node.expression,_coderep$1.Precedence.Assignment,expression));}},{key:"reduceConditionalExpression",value:function reduceConditionalExpression(node,_ref28){var test=_ref28.test,consequent=_ref28.consequent,alternate=_ref28.alternate;var containsIn=test.containsIn||alternate.containsIn;var startsWithCurly=test.startsWithCurly;var startsWithLetSquareBracket=test.startsWithLetSquareBracket;var startsWithFunctionOrClass=test.startsWithFunctionOrClass;return(0,_objectAssign2$1.default)(seq$1(p(node.test,_coderep$1.Precedence.LogicalOR,test),t("?"),p(node.consequent,_coderep$1.Precedence.Assignment,consequent),t(":"),p(node.alternate,_coderep$1.Precedence.Assignment,alternate)),{containsIn,startsWithCurly,startsWithLetSquareBracket,startsWithFunctionOrClass});}},{key:"reduceContinueStatement",value:function reduceContinueStatement(node){return seq$1(t("continue"),node.label?t(node.label):empty$1(),semiOp());}},{key:"reduceDataProperty",value:function reduceDataProperty(node,_ref29){var name=_ref29.name,expression=_ref29.expression;return seq$1(name,t(":"),getAssignmentExpr(expression));}},{key:"reduceDebuggerStatement",value:function reduceDebuggerStatement(){return seq$1(t("debugger"),semiOp());}},{key:"reduceDoWhileStatement",value:function reduceDoWhileStatement(node,_ref30){var body=_ref30.body,test=_ref30.test;return seq$1(t("do"),body,t("while"),paren(test),semiOp());}},{key:"reduceEmptyStatement",value:function reduceEmptyStatement(){return semi();}},{key:"reduceExpressionStatement",value:function reduceExpressionStatement(node,_ref31){var expression=_ref31.expression;var needsParens=expression.startsWithCurly||expression.startsWithLetSquareBracket||expression.startsWithFunctionOrClass;return seq$1(needsParens?paren(expression):expression,semiOp());}},{key:"reduceForInStatement",value:function reduceForInStatement(node,_ref32){var left=_ref32.left,right=_ref32.right,body=_ref32.body;left=node.left.type==="VariableDeclaration"?noIn$1(markContainsIn$1(left)):left;return(0,_objectAssign2$1.default)(seq$1(t("for"),paren(seq$1(left.startsWithLet?paren(left):left,t("in"),right)),body),{endsWithMissingElse:body.endsWithMissingElse});}},{key:"reduceForOfStatement",value:function reduceForOfStatement(node,_ref33){var left=_ref33.left,right=_ref33.right,body=_ref33.body;left=node.left.type==="VariableDeclaration"?noIn$1(markContainsIn$1(left)):left;return(0,_objectAssign2$1.default)(seq$1(t("for"),paren(seq$1(left.startsWithLet?paren(left):left,t("of"),p(node.right,_coderep$1.Precedence.Assignment,right))),body),{endsWithMissingElse:body.endsWithMissingElse});}},{key:"reduceForStatement",value:function reduceForStatement(node,_ref34){var init=_ref34.init,test=_ref34.test,update=_ref34.update,body=_ref34.body;if(init){if(init.startsWithLetSquareBracket){init=paren(init);}init=noIn$1(markContainsIn$1(init));}return(0,_objectAssign2$1.default)(seq$1(t("for"),paren(seq$1(init?init:empty$1(),semi(),test||empty$1(),semi(),update||empty$1())),body),{endsWithMissingElse:body.endsWithMissingElse});}},{key:"reduceForAwaitStatement",value:function reduceForAwaitStatement(node,_ref35){var left=_ref35.left,right=_ref35.right,body=_ref35.body;left=node.left.type==="VariableDeclaration"?noIn$1(markContainsIn$1(left)):left;return(0,_objectAssign2$1.default)(seq$1(t("for"),t("await"),paren(seq$1(left.startsWithLet?paren(left):left,t("of"),p(node.right,_coderep$1.Precedence.Assignment,right))),body),{endsWithMissingElse:body.endsWithMissingElse});}},{key:"reduceFunctionBody",value:function reduceFunctionBody(node,_ref36){var directives=_ref36.directives,statements=_ref36.statements;if(statements.length){statements[0]=this.parenToAvoidBeingDirective(node.statements[0],statements[0]);}return brace(seq$1.apply(void 0,_toConsumableArray$2(directives).concat(_toConsumableArray$2(statements))));}},{key:"reduceFunctionDeclaration",value:function reduceFunctionDeclaration(node,_ref37){var name=_ref37.name,params=_ref37.params,body=_ref37.body;return seq$1(node.isAsync?t("async"):empty$1(),t("function"),node.isGenerator?t("*"):empty$1(),node.name.name==="*default*"?empty$1():name,params,body);}},{key:"reduceFunctionExpression",value:function reduceFunctionExpression(node,_ref38){var name=_ref38.name,params=_ref38.params,body=_ref38.body;var state=seq$1(node.isAsync?t("async"):empty$1(),t("function"),node.isGenerator?t("*"):empty$1(),name?name:empty$1(),params,body);state.startsWithFunctionOrClass=true;return state;}},{key:"reduceFormalParameters",value:function reduceFormalParameters(node,_ref39){var items=_ref39.items,rest=_ref39.rest;return paren(commaSep(items.concat(rest==null?[]:[seq$1(t("..."),rest)])));}},{key:"reduceArrowExpression",value:function reduceArrowExpression(node,_ref40){var params=_ref40.params,body=_ref40.body;params=this.regenerateArrowParams(node.params,params);var containsIn=false;if(node.body.type!=="FunctionBody"){if(body.startsWithCurly){body=paren(body);}else if(body.containsIn){containsIn=true;}}return(0,_objectAssign2$1.default)(seq$1(node.isAsync?t("async"):empty$1(),params,t("=>"),p(node.body,_coderep$1.Precedence.Assignment,body)),{containsIn});}},{key:"reduceGetter",value:function reduceGetter(node,_ref41){var name=_ref41.name,body=_ref41.body;return seq$1(t("get"),name,paren(empty$1()),body);}},{key:"reduceIdentifierExpression",value:function reduceIdentifierExpression(node){var a=t(node.name);if(node.name==="let"){a.startsWithLet=true;}return a;}},{key:"reduceIfStatement",value:function reduceIfStatement(node,_ref42){var test=_ref42.test,consequent=_ref42.consequent,alternate=_ref42.alternate;if(alternate&&consequent.endsWithMissingElse){consequent=brace(consequent);}return(0,_objectAssign2$1.default)(seq$1(t("if"),paren(test),consequent,alternate?seq$1(t("else"),alternate):empty$1()),{endsWithMissingElse:alternate?alternate.endsWithMissingElse:true});}},{key:"reduceImport",value:function reduceImport(node,_ref43){var defaultBinding=_ref43.defaultBinding,namedImports=_ref43.namedImports;var bindings=[];if(defaultBinding!=null){bindings.push(defaultBinding);}if(namedImports.length>0){bindings.push(brace(commaSep(namedImports)));}if(bindings.length===0){return seq$1(t("import"),t((0,_coderep$1.escapeStringLiteral)(node.moduleSpecifier)),semiOp());}return seq$1(t("import"),commaSep(bindings),t("from"),t((0,_coderep$1.escapeStringLiteral)(node.moduleSpecifier)),semiOp());}},{key:"reduceImportNamespace",value:function reduceImportNamespace(node,_ref44){var defaultBinding=_ref44.defaultBinding,namespaceBinding=_ref44.namespaceBinding;return seq$1(t("import"),defaultBinding==null?empty$1():seq$1(defaultBinding,t(",")),t("*"),t("as"),namespaceBinding,t("from"),t((0,_coderep$1.escapeStringLiteral)(node.moduleSpecifier)),semiOp());}},{key:"reduceImportSpecifier",value:function reduceImportSpecifier(node,_ref45){var binding=_ref45.binding;if(node.name==null)return binding;return seq$1(t(node.name),t("as"),binding);}},{key:"reduceExportAllFrom",value:function reduceExportAllFrom(node){return seq$1(t("export"),t("*"),t("from"),t((0,_coderep$1.escapeStringLiteral)(node.moduleSpecifier)),semiOp());}},{key:"reduceExportFrom",value:function reduceExportFrom(node,_ref46){var namedExports=_ref46.namedExports;return seq$1(t("export"),brace(commaSep(namedExports)),t("from"),t((0,_coderep$1.escapeStringLiteral)(node.moduleSpecifier)),semiOp());}},{key:"reduceExportLocals",value:function reduceExportLocals(node,_ref47){var namedExports=_ref47.namedExports;return seq$1(t("export"),brace(commaSep(namedExports)),semiOp());}},{key:"reduceExport",value:function reduceExport(node,_ref48){var declaration=_ref48.declaration;switch(node.declaration.type){case"FunctionDeclaration":case"ClassDeclaration":break;default:declaration=seq$1(declaration,semiOp());}return seq$1(t("export"),declaration);}},{key:"reduceExportDefault",value:function reduceExportDefault(node,_ref49){var body=_ref49.body;body=body.startsWithFunctionOrClass?paren(body):body;switch(node.body.type){case"FunctionDeclaration":case"ClassDeclaration":return seq$1(t("export default"),body);default:return seq$1(t("export default"),p(node.body,_coderep$1.Precedence.Assignment,body),semiOp());}}},{key:"reduceExportFromSpecifier",value:function reduceExportFromSpecifier(node){if(node.exportedName==null)return t(node.name);return seq$1(t(node.name),t("as"),t(node.exportedName));}},{key:"reduceExportLocalSpecifier",value:function reduceExportLocalSpecifier(node,_ref50){var name=_ref50.name;if(node.exportedName==null)return name;return seq$1(name,t("as"),t(node.exportedName));}},{key:"reduceLabeledStatement",value:function reduceLabeledStatement(node,_ref51){var body=_ref51.body;return(0,_objectAssign2$1.default)(seq$1(t(node.label+":"),body),{endsWithMissingElse:body.endsWithMissingElse});}},{key:"reduceLiteralBooleanExpression",value:function reduceLiteralBooleanExpression(node){return t(node.value.toString());}},{key:"reduceLiteralNullExpression",value:function reduceLiteralNullExpression(){return t("null");}},{key:"reduceLiteralInfinityExpression",value:function reduceLiteralInfinityExpression(){return t("2e308");}},{key:"reduceLiteralNumericExpression",value:function reduceLiteralNumericExpression(node){return new _coderep$1.NumberCodeRep(node.value);}},{key:"reduceLiteralRegExpExpression",value:function reduceLiteralRegExpExpression(node){return t("/"+node.pattern+"/"+(node.global?"g":"")+(node.ignoreCase?"i":"")+(node.multiLine?"m":"")+(node.dotAll?"s":"")+(node.unicode?"u":"")+(node.sticky?"y":""),true);}},{key:"reduceLiteralStringExpression",value:function reduceLiteralStringExpression(node){return t((0,_coderep$1.escapeStringLiteral)(node.value));}},{key:"reduceMethod",value:function reduceMethod(node,_ref52){var name=_ref52.name,params=_ref52.params,body=_ref52.body;return seq$1(node.isAsync?t("async"):empty$1(),node.isGenerator?t("*"):empty$1(),name,params,body);}},{key:"reduceModule",value:function reduceModule(node,_ref53){var directives=_ref53.directives,items=_ref53.items;if(items.length){items[0]=this.parenToAvoidBeingDirective(node.items[0],items[0]);}return seq$1.apply(void 0,_toConsumableArray$2(directives).concat(_toConsumableArray$2(items)));}},{key:"reduceNewExpression",value:function reduceNewExpression(node,_ref54){var callee=_ref54.callee,args=_ref54.arguments;var parenthizedArgs=args.map(function(a,i2){return p(node.arguments[i2],_coderep$1.Precedence.Assignment,a);});var calleeRep=(0,_coderep$1.getPrecedence)(node.callee)===_coderep$1.Precedence.Call?paren(callee):p(node.callee,(0,_coderep$1.getPrecedence)(node),callee);return seq$1(t("new"),calleeRep,args.length===0?empty$1():paren(commaSep(parenthizedArgs)));}},{key:"reduceNewTargetExpression",value:function reduceNewTargetExpression(){return t("new.target");}},{key:"reduceObjectExpression",value:function reduceObjectExpression(node,_ref55){var properties=_ref55.properties;var state=brace(commaSep(properties));state.startsWithCurly=true;return state;}},{key:"reduceUpdateExpression",value:function reduceUpdateExpression(node,_ref56){var operand=_ref56.operand;if(node.isPrefix){return this.reduceUnaryExpression.apply(this,arguments);}return(0,_objectAssign2$1.default)(seq$1(p(node.operand,_coderep$1.Precedence.New,operand),t(node.operator)),{startsWithCurly:operand.startsWithCurly,startsWithLetSquareBracket:operand.startsWithLetSquareBracket,startsWithFunctionOrClass:operand.startsWithFunctionOrClass});}},{key:"reduceUnaryExpression",value:function reduceUnaryExpression(node,_ref57){var operand=_ref57.operand;return seq$1(t(node.operator),p(node.operand,(0,_coderep$1.getPrecedence)(node),operand));}},{key:"reduceReturnStatement",value:function reduceReturnStatement(node,_ref58){var expression=_ref58.expression;return seq$1(t("return"),expression||empty$1(),semiOp());}},{key:"reduceScript",value:function reduceScript(node,_ref59){var directives=_ref59.directives,statements=_ref59.statements;if(statements.length){statements[0]=this.parenToAvoidBeingDirective(node.statements[0],statements[0]);}return seq$1.apply(void 0,_toConsumableArray$2(directives).concat(_toConsumableArray$2(statements)));}},{key:"reduceSetter",value:function reduceSetter(node,_ref60){var name=_ref60.name,param=_ref60.param,body=_ref60.body;return seq$1(t("set"),name,paren(param),body);}},{key:"reduceShorthandProperty",value:function reduceShorthandProperty(node,_ref61){var name=_ref61.name;return name;}},{key:"reduceStaticMemberAssignmentTarget",value:function reduceStaticMemberAssignmentTarget(node,_ref62){var object=_ref62.object;var state=seq$1(p(node.object,(0,_coderep$1.getPrecedence)(node),object),t("."),t(node.property));state.startsWithLet=object.startsWithLet;state.startsWithCurly=object.startsWithCurly;state.startsWithLetSquareBracket=object.startsWithLetSquareBracket;state.startsWithFunctionOrClass=object.startsWithFunctionOrClass;return state;}},{key:"reduceStaticMemberExpression",value:function reduceStaticMemberExpression(node,_ref63){var object=_ref63.object;var state=seq$1(p(node.object,(0,_coderep$1.getPrecedence)(node),object),t("."),t(node.property));state.startsWithLet=object.startsWithLet;state.startsWithCurly=object.startsWithCurly;state.startsWithLetSquareBracket=object.startsWithLetSquareBracket;state.startsWithFunctionOrClass=object.startsWithFunctionOrClass;return state;}},{key:"reduceStaticPropertyName",value:function reduceStaticPropertyName(node){if(_esutils$1.keyword.isIdentifierNameES6(node.value)){return t(node.value);}var n=parseFloat(node.value);if(n>=0&&n.toString()===node.value){return new _coderep$1.NumberCodeRep(n);}return t((0,_coderep$1.escapeStringLiteral)(node.value));}},{key:"reduceSuper",value:function reduceSuper(){return t("super");}},{key:"reduceSwitchCase",value:function reduceSwitchCase(node,_ref64){var test=_ref64.test,consequent=_ref64.consequent;return seq$1(t("case"),test,t(":"),seq$1.apply(void 0,_toConsumableArray$2(consequent)));}},{key:"reduceSwitchDefault",value:function reduceSwitchDefault(node,_ref65){var consequent=_ref65.consequent;return seq$1(t("default:"),seq$1.apply(void 0,_toConsumableArray$2(consequent)));}},{key:"reduceSwitchStatement",value:function reduceSwitchStatement(node,_ref66){var discriminant=_ref66.discriminant,cases=_ref66.cases;return seq$1(t("switch"),paren(discriminant),brace(seq$1.apply(void 0,_toConsumableArray$2(cases))));}},{key:"reduceSwitchStatementWithDefault",value:function reduceSwitchStatementWithDefault(node,_ref67){var discriminant=_ref67.discriminant,preDefaultCases=_ref67.preDefaultCases,defaultCase=_ref67.defaultCase,postDefaultCases=_ref67.postDefaultCases;return seq$1(t("switch"),paren(discriminant),brace(seq$1.apply(void 0,_toConsumableArray$2(preDefaultCases).concat([defaultCase],_toConsumableArray$2(postDefaultCases)))));}},{key:"reduceTemplateExpression",value:function reduceTemplateExpression(node,_ref68){var tag=_ref68.tag,elements=_ref68.elements;var state=node.tag==null?empty$1():p(node.tag,(0,_coderep$1.getPrecedence)(node),tag);state=seq$1(state,t("`"));for(var i2=0,l=node.elements.length;i20?t("}"):empty$1(),elements[i2],i21&&arguments[1]!==void 0?arguments[1]:false;return new _coderep.Token(token,isRegExp);}},{key:"p",value:function p2(node,precedence,a){return(0,_coderep.getPrecedence)(node)0&&elements[elements.length-1]==null){content=seq(content,this.sep(Sep.ARRAY_BEFORE_COMMA),this.t(","),this.sep(Sep.ARRAY_AFTER_COMMA));}return this.bracket(content,Sep.ARRAY_INITIAL,Sep.ARRAY_FINAL);}},{key:"reduceAwaitExpression",value:function reduceAwaitExpression(node,_ref2){var expression=_ref2.expression;return seq(this.t("await"),this.sep(Sep.AWAIT),this.p(node.expression,(0,_coderep.getPrecedence)(node),expression));}},{key:"reduceSpreadElement",value:function reduceSpreadElement(node,_ref3){var expression=_ref3.expression;return seq(this.t("..."),this.sep(Sep.SPREAD),this.p(node.expression,_coderep.Precedence.Assignment,expression));}},{key:"reduceSpreadProperty",value:function reduceSpreadProperty(node,_ref4){var expression=_ref4.expression;return seq(this.t("..."),this.sep(Sep.SPREAD),this.getAssignmentExpr(expression));}},{key:"reduceAssignmentExpression",value:function reduceAssignmentExpression(node,_ref5){var binding=_ref5.binding,expression=_ref5.expression;var leftCode=binding;var rightCode=expression;var containsIn=expression.containsIn;var startsWithCurly=binding.startsWithCurly;var startsWithLetSquareBracket=binding.startsWithLetSquareBracket;var startsWithFunctionOrClass=binding.startsWithFunctionOrClass;if((0,_coderep.getPrecedence)(node.expression)<(0,_coderep.getPrecedence)(node)){rightCode=this.paren(rightCode,Sep.EXPRESSION_PAREN_BEFORE,Sep.EXPRESSION_PAREN_AFTER);containsIn=false;}return(0,_objectAssign2.default)(seq(leftCode,this.sep(Sep.BEFORE_ASSIGN_OP("=")),this.t("="),this.sep(Sep.AFTER_ASSIGN_OP("=")),rightCode),{containsIn,startsWithCurly,startsWithLetSquareBracket,startsWithFunctionOrClass});}},{key:"reduceAssignmentTargetIdentifier",value:function reduceAssignmentTargetIdentifier(node){var a=this.t(node.name);if(node.name==="let"){a.startsWithLet=true;}return a;}},{key:"reduceAssignmentTargetWithDefault",value:function reduceAssignmentTargetWithDefault(node,_ref6){var binding=_ref6.binding,init=_ref6.init;return seq(binding,this.sep(Sep.BEFORE_DEFAULT_EQUALS),this.t("="),this.sep(Sep.AFTER_DEFAULT_EQUALS),this.p(node.init,_coderep.Precedence.Assignment,init));}},{key:"reduceCompoundAssignmentExpression",value:function reduceCompoundAssignmentExpression(node,_ref7){var binding=_ref7.binding,expression=_ref7.expression;var leftCode=binding;var rightCode=expression;var containsIn=expression.containsIn;var startsWithCurly=binding.startsWithCurly;var startsWithLetSquareBracket=binding.startsWithLetSquareBracket;var startsWithFunctionOrClass=binding.startsWithFunctionOrClass;if((0,_coderep.getPrecedence)(node.expression)<(0,_coderep.getPrecedence)(node)){rightCode=this.paren(rightCode,Sep.EXPRESSION_PAREN_BEFORE,Sep.EXPRESSION_PAREN_AFTER);containsIn=false;}return(0,_objectAssign2.default)(seq(leftCode,this.sep(Sep.BEFORE_ASSIGN_OP(node.operator)),this.t(node.operator),this.sep(Sep.AFTER_ASSIGN_OP(node.operator)),rightCode),{containsIn,startsWithCurly,startsWithLetSquareBracket,startsWithFunctionOrClass});}},{key:"reduceBinaryExpression",value:function reduceBinaryExpression(node,_ref8){var left=_ref8.left,right=_ref8.right;var leftCode=left;var startsWithCurly=left.startsWithCurly;var startsWithLetSquareBracket=left.startsWithLetSquareBracket;var startsWithFunctionOrClass=left.startsWithFunctionOrClass;var leftContainsIn=left.containsIn;var isRightAssociative=node.operator==="**";if((0,_coderep.getPrecedence)(node.left)<(0,_coderep.getPrecedence)(node)||isRightAssociative&&((0,_coderep.getPrecedence)(node.left)===(0,_coderep.getPrecedence)(node)||node.left.type==="UnaryExpression")){leftCode=this.paren(leftCode,Sep.EXPRESSION_PAREN_BEFORE,Sep.EXPRESSION_PAREN_AFTER);startsWithCurly=false;startsWithLetSquareBracket=false;startsWithFunctionOrClass=false;leftContainsIn=false;}var rightCode=right;var rightContainsIn=right.containsIn;if((0,_coderep.getPrecedence)(node.right)<(0,_coderep.getPrecedence)(node)||!isRightAssociative&&(0,_coderep.getPrecedence)(node.right)===(0,_coderep.getPrecedence)(node)){rightCode=this.paren(rightCode,Sep.EXPRESSION_PAREN_BEFORE,Sep.EXPRESSION_PAREN_AFTER);rightContainsIn=false;}return(0,_objectAssign2.default)(seq(leftCode,this.sep(Sep.BEFORE_BINOP(node.operator)),this.t(node.operator),this.sep(Sep.AFTER_BINOP(node.operator)),rightCode),{containsIn:leftContainsIn||rightContainsIn||node.operator==="in",containsGroup:node.operator===",",startsWithCurly,startsWithLetSquareBracket,startsWithFunctionOrClass});}},{key:"reduceBindingWithDefault",value:function reduceBindingWithDefault(node,_ref9){var binding=_ref9.binding,init=_ref9.init;return seq(binding,this.sep(Sep.BEFORE_DEFAULT_EQUALS),this.t("="),this.sep(Sep.AFTER_DEFAULT_EQUALS),this.p(node.init,_coderep.Precedence.Assignment,init));}},{key:"reduceBindingIdentifier",value:function reduceBindingIdentifier(node){var a=this.t(node.name);if(node.name==="let"){a.startsWithLet=true;}return a;}},{key:"reduceArrayAssignmentTarget",value:function reduceArrayAssignmentTarget(node,_ref10){var _this4=this;var elements=_ref10.elements,rest=_ref10.rest;var content=void 0;if(elements.length===0){content=rest==null?empty():seq(this.t("..."),this.sep(Sep.REST),rest);}else{elements=elements.concat(rest==null?[]:[seq(this.t("..."),this.sep(Sep.REST),rest)]);content=this.commaSep(elements.map(function(e){return _this4.getAssignmentExpr(e);}),Sep.ARRAY_BEFORE_COMMA,Sep.ARRAY_AFTER_COMMA);if(elements.length>0&&elements[elements.length-1]==null){content=seq(content,this.sep(Sep.ARRAY_BEFORE_COMMA),this.t(","),this.sep(Sep.ARRAY_AFTER_COMMA));}}return this.bracket(content,Sep.ARRAY_INITIAL,Sep.ARRAY_FINAL,Sep.ARRAY_EMPTY);}},{key:"reduceArrayBinding",value:function reduceArrayBinding(node,_ref11){var _this5=this;var elements=_ref11.elements,rest=_ref11.rest;var content=void 0;if(elements.length===0){content=rest==null?empty():seq(this.t("..."),this.sep(Sep.REST),rest);}else{elements=elements.concat(rest==null?[]:[seq(this.t("..."),this.sep(Sep.REST),rest)]);content=this.commaSep(elements.map(function(e){return _this5.getAssignmentExpr(e);}),Sep.ARRAY_BEFORE_COMMA,Sep.ARRAY_AFTER_COMMA);if(elements.length>0&&elements[elements.length-1]==null){content=seq(content,this.sep(Sep.ARRAY_BEFORE_COMMA),this.t(","),this.sep(Sep.ARRAY_AFTER_COMMA));}}return this.bracket(content,Sep.ARRAY_INITIAL,Sep.ARRAY_FINAL,Sep.ARRAY_EMPTY);}},{key:"reduceObjectAssignmentTarget",value:function reduceObjectAssignmentTarget(node,_ref12){var properties=_ref12.properties,rest=_ref12.rest;var content=void 0;if(properties.length===0){content=rest==null?empty():seq(this.t("..."),this.sep(Sep.REST),rest);}else{content=this.commaSep(properties,Sep.OBJECT_BEFORE_COMMA,Sep.OBJECT_AFTER_COMMA);content=rest==null?content:this.commaSep([content,seq(this.t("..."),this.sep(Sep.REST),rest)],Sep.OBJECT_BEFORE_COMMA,Sep.OBJECT_AFTER_COMMA);}var state=this.brace(content,node,Sep.OBJECT_BRACE_INITIAL,Sep.OBJECT_BRACE_FINAL,Sep.OBJECT_EMPTY);state.startsWithCurly=true;return state;}},{key:"reduceObjectBinding",value:function reduceObjectBinding(node,_ref13){var properties=_ref13.properties,rest=_ref13.rest;var content=void 0;if(properties.length===0){content=rest==null?empty():seq(this.t("..."),this.sep(Sep.REST),rest);}else{content=this.commaSep(properties,Sep.OBJECT_BEFORE_COMMA,Sep.OBJECT_AFTER_COMMA);content=rest==null?content:this.commaSep([content,seq(this.t("..."),this.sep(Sep.REST),rest)],Sep.OBJECT_BEFORE_COMMA,Sep.OBJECT_AFTER_COMMA);}var state=this.brace(content,node,Sep.OBJECT_BRACE_INITIAL,Sep.OBJECT_BRACE_FINAL,Sep.OBJECT_EMPTY);state.startsWithCurly=true;return state;}},{key:"reduceAssignmentTargetPropertyIdentifier",value:function reduceAssignmentTargetPropertyIdentifier(node,_ref14){var binding=_ref14.binding,init=_ref14.init;if(node.init==null)return binding;return seq(binding,this.sep(Sep.BEFORE_DEFAULT_EQUALS),this.t("="),this.sep(Sep.AFTER_DEFAULT_EQUALS),this.p(node.init,_coderep.Precedence.Assignment,init));}},{key:"reduceAssignmentTargetPropertyProperty",value:function reduceAssignmentTargetPropertyProperty(node,_ref15){var name=_ref15.name,binding=_ref15.binding;return seq(name,this.sep(Sep.BEFORE_PROP),this.t(":"),this.sep(Sep.AFTER_PROP),binding);}},{key:"reduceBindingPropertyIdentifier",value:function reduceBindingPropertyIdentifier(node,_ref16){var binding=_ref16.binding,init=_ref16.init;if(node.init==null)return binding;return seq(binding,this.sep(Sep.BEFORE_DEFAULT_EQUALS),this.t("="),this.sep(Sep.AFTER_DEFAULT_EQUALS),this.p(node.init,_coderep.Precedence.Assignment,init));}},{key:"reduceBindingPropertyProperty",value:function reduceBindingPropertyProperty(node,_ref17){var name=_ref17.name,binding=_ref17.binding;return seq(name,this.sep(Sep.BEFORE_PROP),this.t(":"),this.sep(Sep.AFTER_PROP),binding);}},{key:"reduceBlock",value:function reduceBlock(node,_ref18){var statements=_ref18.statements;return this.brace(seq.apply(void 0,_toConsumableArray$1(statements)),node,Sep.BLOCK_BRACE_INITIAL,Sep.BLOCK_BRACE_FINAL,Sep.BLOCK_EMPTY);}},{key:"reduceBlockStatement",value:function reduceBlockStatement(node,_ref19){var block=_ref19.block;return seq(block,this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceBreakStatement",value:function reduceBreakStatement(node){return seq(this.t("break"),node.label?seq(this.sep(Sep.BEFORE_JUMP_LABEL),this.t(node.label)):empty(),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceCallExpression",value:function reduceCallExpression(node,_ref20){var _this6=this;var callee=_ref20.callee,args=_ref20.arguments;var parenthizedArgs=args.map(function(a,i2){return _this6.p(node.arguments[i2],_coderep.Precedence.Assignment,a);});return(0,_objectAssign2.default)(seq(this.p(node.callee,(0,_coderep.getPrecedence)(node),callee),this.sep(Sep.CALL),this.paren(this.commaSep(parenthizedArgs,Sep.ARGS_BEFORE_COMMA,Sep.ARGS_AFTER_COMMA),Sep.CALL_PAREN_BEFORE,Sep.CALL_PAREN_AFTER,Sep.CALL_PAREN_EMPTY)),{startsWithCurly:callee.startsWithCurly,startsWithLet:callee.startsWithLet,startsWithLetSquareBracket:callee.startsWithLetSquareBracket,startsWithFunctionOrClass:callee.startsWithFunctionOrClass});}},{key:"reduceCatchClause",value:function reduceCatchClause(node,_ref21){var binding=_ref21.binding,body=_ref21.body;return seq(this.t("catch"),this.sep(Sep.BEFORE_CATCH_BINDING),this.paren(binding,Sep.CATCH_PAREN_BEFORE,Sep.CATCH_PAREN_AFTER),this.sep(Sep.AFTER_CATCH_BINDING),body);}},{key:"reduceClassDeclaration",value:function reduceClassDeclaration(node,_ref22){var name=_ref22.name,_super=_ref22.super,elements=_ref22.elements;var state=seq(this.t("class"),node.name.name==="*default*"?empty():seq(this.sep(Sep.BEFORE_CLASS_NAME),name));if(_super!=null){state=seq(state,this.sep(Sep.BEFORE_EXTENDS),this.t("extends"),this.sep(Sep.AFTER_EXTENDS),this.p(node.super,_coderep.Precedence.New,_super));}state=seq(state,this.sep(Sep.BEFORE_CLASS_DECLARATION_ELEMENTS),this.brace(seq.apply(void 0,_toConsumableArray$1(elements)),node,Sep.CLASS_BRACE_INITIAL,Sep.CLASS_BRACE_FINAL,Sep.CLASS_EMPTY),this.sep(Sep.AFTER_STATEMENT(node)));return state;}},{key:"reduceClassExpression",value:function reduceClassExpression(node,_ref23){var name=_ref23.name,_super=_ref23.super,elements=_ref23.elements;var state=this.t("class");if(name!=null){state=seq(state,this.sep(Sep.BEFORE_CLASS_NAME),name);}if(_super!=null){state=seq(state,this.sep(Sep.BEFORE_EXTENDS),this.t("extends"),this.sep(Sep.AFTER_EXTENDS),this.p(node.super,_coderep.Precedence.New,_super));}state=seq(state,this.sep(Sep.BEFORE_CLASS_EXPRESSION_ELEMENTS),this.brace(seq.apply(void 0,_toConsumableArray$1(elements)),node,Sep.CLASS_EXPRESSION_BRACE_INITIAL,Sep.CLASS_EXPRESSION_BRACE_FINAL,Sep.CLASS_EXPRESSION_BRACE_EMPTY));state.startsWithFunctionOrClass=true;return state;}},{key:"reduceClassElement",value:function reduceClassElement(node,_ref24){var method=_ref24.method;method=seq(this.sep(Sep.BEFORE_CLASS_ELEMENT),method,this.sep(Sep.AFTER_CLASS_ELEMENT));if(!node.isStatic)return method;return seq(this.t("static"),this.sep(Sep.AFTER_STATIC),method);}},{key:"reduceComputedMemberAssignmentTarget",value:function reduceComputedMemberAssignmentTarget(node,_ref25){var object=_ref25.object,expression=_ref25.expression;var startsWithLetSquareBracket=object.startsWithLetSquareBracket||node.object.type==="IdentifierExpression"&&node.object.name==="let";return(0,_objectAssign2.default)(seq(this.p(node.object,(0,_coderep.getPrecedence)(node),object),this.sep(Sep.COMPUTED_MEMBER_ASSIGNMENT_TARGET),this.bracket(expression,Sep.COMPUTED_MEMBER_ASSIGNMENT_TARGET_BRACKET_INTIAL,Sep.COMPUTED_MEMBER_ASSIGNMENT_TARGET_BRACKET_FINAL)),{startsWithLet:object.startsWithLet,startsWithLetSquareBracket,startsWithCurly:object.startsWithCurly,startsWithFunctionOrClass:object.startsWithFunctionOrClass});}},{key:"reduceComputedMemberExpression",value:function reduceComputedMemberExpression(node,_ref26){var object=_ref26.object,expression=_ref26.expression;var startsWithLetSquareBracket=object.startsWithLetSquareBracket||node.object.type==="IdentifierExpression"&&node.object.name==="let";return(0,_objectAssign2.default)(seq(this.p(node.object,(0,_coderep.getPrecedence)(node),object),this.sep(Sep.COMPUTED_MEMBER_EXPRESSION),this.bracket(expression,Sep.COMPUTED_MEMBER_BRACKET_INTIAL,Sep.COMPUTED_MEMBER_BRACKET_FINAL)),{startsWithLet:object.startsWithLet,startsWithLetSquareBracket,startsWithCurly:object.startsWithCurly,startsWithFunctionOrClass:object.startsWithFunctionOrClass});}},{key:"reduceComputedPropertyName",value:function reduceComputedPropertyName(node,_ref27){var expression=_ref27.expression;return this.bracket(this.p(node.expression,_coderep.Precedence.Assignment,expression),Sep.COMPUTED_PROPERTY_BRACKET_INTIAL,Sep.COMPUTED_PROPERTY_BRACKET_FINAL);}},{key:"reduceConditionalExpression",value:function reduceConditionalExpression(node,_ref28){var test=_ref28.test,consequent=_ref28.consequent,alternate=_ref28.alternate;var containsIn=test.containsIn||alternate.containsIn;var startsWithCurly=test.startsWithCurly;var startsWithLetSquareBracket=test.startsWithLetSquareBracket;var startsWithFunctionOrClass=test.startsWithFunctionOrClass;return(0,_objectAssign2.default)(seq(this.p(node.test,_coderep.Precedence.LogicalOR,test),this.sep(Sep.BEFORE_TERNARY_QUESTION),this.t("?"),this.sep(Sep.AFTER_TERNARY_QUESTION),this.p(node.consequent,_coderep.Precedence.Assignment,consequent),this.sep(Sep.BEFORE_TERNARY_COLON),this.t(":"),this.sep(Sep.AFTER_TERNARY_COLON),this.p(node.alternate,_coderep.Precedence.Assignment,alternate)),{containsIn,startsWithCurly,startsWithLetSquareBracket,startsWithFunctionOrClass});}},{key:"reduceContinueStatement",value:function reduceContinueStatement(node){return seq(this.t("continue"),node.label?seq(this.sep(Sep.BEFORE_JUMP_LABEL),this.t(node.label)):empty(),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceDataProperty",value:function reduceDataProperty(node,_ref29){var name=_ref29.name,expression=_ref29.expression;return seq(name,this.sep(Sep.BEFORE_PROP),this.t(":"),this.sep(Sep.AFTER_PROP),this.getAssignmentExpr(expression));}},{key:"reduceDebuggerStatement",value:function reduceDebuggerStatement(node){return seq(this.t("debugger"),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceDoWhileStatement",value:function reduceDoWhileStatement(node,_ref30){var body=_ref30.body,test=_ref30.test;return seq(this.t("do"),this.sep(Sep.AFTER_DO),body,this.sep(Sep.BEFORE_DOWHILE_WHILE),this.t("while"),this.sep(Sep.AFTER_DOWHILE_WHILE),this.paren(test,Sep.DO_WHILE_TEST_PAREN_BEFORE,Sep.DO_WHILE_TEST_PAREN_AFTER),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceEmptyStatement",value:function reduceEmptyStatement(node){return seq(this.t(";"),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceExpressionStatement",value:function reduceExpressionStatement(node,_ref31){var expression=_ref31.expression;var needsParens=expression.startsWithCurly||expression.startsWithLetSquareBracket||expression.startsWithFunctionOrClass;return seq(needsParens?this.paren(expression,Sep.EXPRESSION_STATEMENT_PAREN_BEFORE,Sep.EXPRESSION_STATEMENT_PAREN_AFTER):expression,this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceForInStatement",value:function reduceForInStatement(node,_ref32){var left=_ref32.left,right=_ref32.right,body=_ref32.body;left=node.left.type==="VariableDeclaration"?noIn(markContainsIn(left)):left;return(0,_objectAssign2.default)(seq(this.t("for"),this.sep(Sep.AFTER_FORIN_FOR),this.paren(seq(left.startsWithLet?this.paren(left,Sep.FOR_IN_LET_PAREN_BEFORE,Sep.FOR_IN_LET_PAREN_AFTER):left,this.sep(Sep.BEFORE_FORIN_IN),this.t("in"),this.sep(Sep.AFTER_FORIN_FOR),right),Sep.FOR_IN_PAREN_BEFORE,Sep.FOR_IN_PAREN_AFTER),this.sep(Sep.BEFORE_FORIN_BODY),body,this.sep(Sep.AFTER_STATEMENT(node))),{endsWithMissingElse:body.endsWithMissingElse});}},{key:"reduceForOfStatement",value:function reduceForOfStatement(node,_ref33){var left=_ref33.left,right=_ref33.right,body=_ref33.body;left=node.left.type==="VariableDeclaration"?noIn(markContainsIn(left)):left;return(0,_objectAssign2.default)(seq(this.t("for"),this.sep(Sep.AFTER_FOROF_FOR),this.paren(seq(left.startsWithLet?this.paren(left,Sep.FOR_OF_LET_PAREN_BEFORE,Sep.FOR_OF_LET_PAREN_AFTER):left,this.sep(Sep.BEFORE_FOROF_OF),this.t("of"),this.sep(Sep.AFTER_FOROF_FOR),this.p(node.right,_coderep.Precedence.Assignment,right)),Sep.FOR_OF_PAREN_BEFORE,Sep.FOR_OF_PAREN_AFTER),this.sep(Sep.BEFORE_FOROF_BODY),body,this.sep(Sep.AFTER_STATEMENT(node))),{endsWithMissingElse:body.endsWithMissingElse});}},{key:"reduceForStatement",value:function reduceForStatement(node,_ref34){var init=_ref34.init,test=_ref34.test,update=_ref34.update,body=_ref34.body;if(init){if(init.startsWithLetSquareBracket){init=this.paren(init,Sep.FOR_LET_PAREN_BEFORE,Sep.FOR_LET_PAREN_AFTER);}init=noIn(markContainsIn(init));}return(0,_objectAssign2.default)(seq(this.t("for"),this.sep(Sep.AFTER_FOR_FOR),this.paren(seq(init?seq(this.sep(Sep.BEFORE_FOR_INIT),init,this.sep(Sep.AFTER_FOR_INIT)):this.sep(Sep.EMPTY_FOR_INIT),this.t(";"),test?seq(this.sep(Sep.BEFORE_FOR_TEST),test,this.sep(Sep.AFTER_FOR_TEST)):this.sep(Sep.EMPTY_FOR_TEST),this.t(";"),update?seq(this.sep(Sep.BEFORE_FOR_UPDATE),update,this.sep(Sep.AFTER_FOR_UPDATE)):this.sep(Sep.EMPTY_FOR_UPDATE))),this.sep(Sep.BEFORE_FOR_BODY),body,this.sep(Sep.AFTER_STATEMENT(node))),{endsWithMissingElse:body.endsWithMissingElse});}},{key:"reduceForAwaitStatement",value:function reduceForAwaitStatement(node,_ref35){var left=_ref35.left,right=_ref35.right,body=_ref35.body;left=node.left.type==="VariableDeclaration"?noIn(markContainsIn(left)):left;return(0,_objectAssign2.default)(seq(this.t("for"),this.sep(Sep.AFTER_FOROF_FOR),this.t("await"),this.sep(Sep.AFTER_FORAWAIT_AWAIT),this.paren(seq(left.startsWithLet?this.paren(left,Sep.FOR_OF_LET_PAREN_BEFORE,Sep.FOR_OF_LET_PAREN_AFTER):left,this.sep(Sep.BEFORE_FOROF_OF),this.t("of"),this.sep(Sep.AFTER_FOROF_FOR),this.p(node.right,_coderep.Precedence.Assignment,right)),Sep.FOR_OF_PAREN_BEFORE,Sep.FOR_OF_PAREN_AFTER),this.sep(Sep.BEFORE_FOROF_BODY),body,this.sep(Sep.AFTER_STATEMENT(node))),{endsWithMissingElse:body.endsWithMissingElse});}},{key:"reduceFunctionBody",value:function reduceFunctionBody(node,_ref36){var directives=_ref36.directives,statements=_ref36.statements;if(statements.length){statements[0]=this.parenToAvoidBeingDirective(node.statements[0],statements[0]);}return seq.apply(void 0,_toConsumableArray$1(directives).concat([directives.length?this.sep(Sep.AFTER_FUNCTION_DIRECTIVES):empty()],_toConsumableArray$1(statements)));}},{key:"reduceFunctionDeclaration",value:function reduceFunctionDeclaration(node,_ref37){var name=_ref37.name,params=_ref37.params,body=_ref37.body;return seq(node.isAsync?this.t("async"):empty(),this.t("function"),node.isGenerator?seq(this.sep(Sep.BEFORE_GENERATOR_STAR),this.t("*"),this.sep(Sep.AFTER_GENERATOR_STAR)):empty(),this.sep(Sep.BEFORE_FUNCTION_NAME(node)),node.name.name==="*default*"?empty():name,this.sep(Sep.BEFORE_FUNCTION_PARAMS),this.paren(params,Sep.PARAMETERS_PAREN_BEFORE,Sep.PARAMETERS_PAREN_AFTER,Sep.PARAMETERS_PAREN_EMPTY),this.sep(Sep.BEFORE_FUNCTION_DECLARATION_BODY),this.brace(body,node,Sep.FUNCTION_BRACE_INITIAL,Sep.FUNCTION_BRACE_FINAL,Sep.FUNCTION_EMPTY),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceFunctionExpression",value:function reduceFunctionExpression(node,_ref38){var name=_ref38.name,params=_ref38.params,body=_ref38.body;var state=seq(node.isAsync?this.t("async"):empty(),this.t("function"),node.isGenerator?seq(this.sep(Sep.BEFORE_GENERATOR_STAR),this.t("*"),this.sep(Sep.AFTER_GENERATOR_STAR)):empty(),this.sep(Sep.BEFORE_FUNCTION_NAME(node)),name?name:empty(),this.sep(Sep.BEFORE_FUNCTION_PARAMS),this.paren(params,Sep.PARAMETERS_PAREN_BEFORE,Sep.PARAMETERS_PAREN_AFTER,Sep.PARAMETERS_PAREN_EMPTY),this.sep(Sep.BEFORE_FUNCTION_EXPRESSION_BODY),this.brace(body,node,Sep.FUNCTION_EXPRESSION_BRACE_INITIAL,Sep.FUNCTION_EXPRESSION_BRACE_FINAL,Sep.FUNCTION_EXPRESSION_EMPTY));state.startsWithFunctionOrClass=true;return state;}},{key:"reduceFormalParameters",value:function reduceFormalParameters(node,_ref39){var items=_ref39.items,rest=_ref39.rest;return this.commaSep(items.concat(rest==null?[]:[seq(this.t("..."),this.sep(Sep.REST),rest)]),Sep.PARAMETER_BEFORE_COMMA,Sep.PARAMETER_AFTER_COMMA);}},{key:"reduceArrowExpression",value:function reduceArrowExpression(node,_ref40){var params=_ref40.params,body=_ref40.body;if(node.params.rest!=null||node.params.items.length!==1||node.params.items[0].type!=="BindingIdentifier"){params=this.paren(params,Sep.ARROW_PARAMETERS_PAREN_BEFORE,Sep.ARROW_PARAMETERS_PAREN_AFTER,Sep.ARROW_PARAMETERS_PAREN_EMPTY);}var containsIn=false;if(node.body.type==="FunctionBody"){body=this.brace(body,node,Sep.ARROW_BRACE_INITIAL,Sep.ARROW_BRACE_FINAL,Sep.ARROW_BRACE_EMPTY);}else if(body.startsWithCurly){body=this.paren(body,Sep.ARROW_BODY_PAREN_BEFORE,Sep.ARROW_BODY_PAREN_AFTER);}else if(body.containsIn){containsIn=true;}return(0,_objectAssign2.default)(seq(node.isAsync?seq(this.t("async"),this.sep(Sep.BEFORE_ARROW_ASYNC_PARAMS)):empty(),params,this.sep(Sep.BEFORE_ARROW),this.t("=>"),this.sep(Sep.AFTER_ARROW),this.p(node.body,_coderep.Precedence.Assignment,body)),{containsIn});}},{key:"reduceGetter",value:function reduceGetter(node,_ref41){var name=_ref41.name,body=_ref41.body;return seq(this.t("get"),this.sep(Sep.AFTER_GET),name,this.sep(Sep.BEFORE_GET_PARAMS),this.paren(empty(),null,null,Sep.GETTER_PARAMS),this.sep(Sep.BEFORE_GET_BODY),this.brace(body,node,Sep.GET_BRACE_INTIAL,Sep.GET_BRACE_FINAL,Sep.GET_BRACE_EMPTY));}},{key:"reduceIdentifierExpression",value:function reduceIdentifierExpression(node){var a=this.t(node.name);if(node.name==="let"){a.startsWithLet=true;}return a;}},{key:"reduceIfStatement",value:function reduceIfStatement(node,_ref42){var test=_ref42.test,consequent=_ref42.consequent,alternate=_ref42.alternate;if(alternate&&consequent.endsWithMissingElse){consequent=this.brace(consequent,node,Sep.MISSING_ELSE_INTIIAL,Sep.MISSING_ELSE_FINAL,Sep.MISSING_ELSE_EMPTY);}return(0,_objectAssign2.default)(seq(this.t("if"),this.sep(Sep.AFTER_IF),this.paren(test,Sep.IF_PAREN_BEFORE,Sep.IF_PAREN_AFTER),this.sep(Sep.AFTER_IF_TEST),consequent,alternate?seq(this.sep(Sep.BEFORE_ELSE),this.t("else"),this.sep(Sep.AFTER_ELSE),alternate):empty(),this.sep(Sep.AFTER_STATEMENT(node))),{endsWithMissingElse:alternate?alternate.endsWithMissingElse:true});}},{key:"reduceImport",value:function reduceImport(node,_ref43){var defaultBinding=_ref43.defaultBinding,namedImports=_ref43.namedImports;var bindings=[];if(defaultBinding!=null){bindings.push(defaultBinding);}if(namedImports.length>0){bindings.push(this.brace(this.commaSep(namedImports,Sep.NAMED_IMPORT_BEFORE_COMMA,Sep.NAMED_IMPORT_AFTER_COMMA),node,Sep.IMPORT_BRACE_INTIAL,Sep.IMPORT_BRACE_FINAL,Sep.IMPORT_BRACE_EMPTY));}if(bindings.length===0){return seq(this.t("import"),this.sep(Sep.BEFORE_IMPORT_MODULE),this.t((0,_coderep.escapeStringLiteral)(node.moduleSpecifier)),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}return seq(this.t("import"),this.sep(Sep.BEFORE_IMPORT_BINDINGS),this.commaSep(bindings,Sep.IMPORT_BEFORE_COMMA,Sep.IMPORT_AFTER_COMMA),this.sep(Sep.AFTER_IMPORT_BINDINGS),this.t("from"),this.sep(Sep.AFTER_FROM),this.t((0,_coderep.escapeStringLiteral)(node.moduleSpecifier)),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceImportNamespace",value:function reduceImportNamespace(node,_ref44){var defaultBinding=_ref44.defaultBinding,namespaceBinding=_ref44.namespaceBinding;return seq(this.t("import"),this.sep(Sep.BEFORE_IMPORT_NAMESPACE),defaultBinding==null?empty():seq(defaultBinding,this.sep(Sep.IMPORT_BEFORE_COMMA),this.t(","),this.sep(Sep.IMPORT_AFTER_COMMA)),this.sep(Sep.BEFORE_IMPORT_STAR),this.t("*"),this.sep(Sep.AFTER_IMPORT_STAR),this.t("as"),this.sep(Sep.AFTER_IMPORT_AS),namespaceBinding,this.sep(Sep.AFTER_NAMESPACE_BINDING),this.t("from"),this.sep(Sep.AFTER_FROM),this.t((0,_coderep.escapeStringLiteral)(node.moduleSpecifier)),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceImportSpecifier",value:function reduceImportSpecifier(node,_ref45){var binding=_ref45.binding;if(node.name==null)return binding;return seq(this.t(node.name),this.sep(Sep.BEFORE_IMPORT_AS),this.t("as"),this.sep(Sep.AFTER_IMPORT_AS),binding);}},{key:"reduceExportAllFrom",value:function reduceExportAllFrom(node){return seq(this.t("export"),this.sep(Sep.BEFORE_EXPORT_STAR),this.t("*"),this.sep(Sep.AFTER_EXPORT_STAR),this.t("from"),this.sep(Sep.AFTER_FROM),this.t((0,_coderep.escapeStringLiteral)(node.moduleSpecifier)),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceExportFrom",value:function reduceExportFrom(node,_ref46){var namedExports=_ref46.namedExports;return seq(this.t("export"),this.sep(Sep.BEFORE_EXPORT_BINDINGS),this.brace(this.commaSep(namedExports,Sep.EXPORTS_BEFORE_COMMA,Sep.EXPORTS_AFTER_COMMA),node,Sep.EXPORT_BRACE_INITIAL,Sep.EXPORT_BRACE_FINAL,Sep.EXPORT_BRACE_EMPTY),this.sep(Sep.AFTER_EXPORT_FROM_BINDINGS),this.t("from"),this.sep(Sep.AFTER_FROM),this.t((0,_coderep.escapeStringLiteral)(node.moduleSpecifier)),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceExportLocals",value:function reduceExportLocals(node,_ref47){var namedExports=_ref47.namedExports;return seq(this.t("export"),this.sep(Sep.BEFORE_EXPORT_BINDINGS),this.brace(this.commaSep(namedExports,Sep.EXPORTS_BEFORE_COMMA,Sep.EXPORTS_AFTER_COMMA),node,Sep.EXPORT_BRACE_INITIAL,Sep.EXPORT_BRACE_FINAL,Sep.EXPORT_BRACE_EMPTY),this.sep(Sep.AFTER_EXPORT_LOCAL_BINDINGS),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceExport",value:function reduceExport(node,_ref48){var declaration=_ref48.declaration;switch(node.declaration.type){case"FunctionDeclaration":case"ClassDeclaration":break;default:declaration=seq(declaration,this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}return seq(this.t("export"),this.sep(Sep.AFTER_EXPORT),declaration);}},{key:"reduceExportDefault",value:function reduceExportDefault(node,_ref49){var body=_ref49.body;body=body.startsWithFunctionOrClass?this.paren(body,Sep.EXPORT_PAREN_BEFORE,Sep.EXPORT_PAREN_AFTER):body;switch(node.body.type){case"FunctionDeclaration":case"ClassDeclaration":return seq(this.t("export"),this.sep(Sep.EXPORT_DEFAULT),this.t("default"),this.sep(Sep.AFTER_EXPORT_DEFAULT),body);default:return seq(this.t("export"),this.sep(Sep.EXPORT_DEFAULT),this.t("default"),this.sep(Sep.AFTER_EXPORT_DEFAULT),this.p(node.body,_coderep.Precedence.Assignment,body),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}}},{key:"reduceExportFromSpecifier",value:function reduceExportFromSpecifier(node){if(node.exportedName==null)return this.t(node.name);return seq(this.t(node.name),this.sep(Sep.BEFORE_EXPORT_AS),this.t("as"),this.sep(Sep.AFTER_EXPORT_AS),this.t(node.exportedName));}},{key:"reduceExportLocalSpecifier",value:function reduceExportLocalSpecifier(node,_ref50){var name=_ref50.name;if(node.exportedName==null)return name;return seq(name,this.sep(Sep.BEFORE_EXPORT_AS),this.t("as"),this.sep(Sep.AFTER_EXPORT_AS),this.t(node.exportedName));}},{key:"reduceLabeledStatement",value:function reduceLabeledStatement(node,_ref51){var body=_ref51.body;return(0,_objectAssign2.default)(seq(this.t(node.label),this.sep(Sep.BEFORE_LABEL_COLON),this.t(":"),this.sep(Sep.AFTER_LABEL_COLON),body),{endsWithMissingElse:body.endsWithMissingElse});}},{key:"reduceLiteralBooleanExpression",value:function reduceLiteralBooleanExpression(node){return this.t(node.value.toString());}},{key:"reduceLiteralNullExpression",value:function reduceLiteralNullExpression(){return this.t("null");}},{key:"reduceLiteralInfinityExpression",value:function reduceLiteralInfinityExpression(){return this.t("2e308");}},{key:"reduceLiteralNumericExpression",value:function reduceLiteralNumericExpression(node){return new _coderep.NumberCodeRep(node.value);}},{key:"reduceLiteralRegExpExpression",value:function reduceLiteralRegExpExpression(node){return this.t("/"+node.pattern+"/"+(node.global?"g":"")+(node.ignoreCase?"i":"")+(node.multiLine?"m":"")+(node.dotAll?"s":"")+(node.unicode?"u":"")+(node.sticky?"y":""),true);}},{key:"reduceLiteralStringExpression",value:function reduceLiteralStringExpression(node){return this.t((0,_coderep.escapeStringLiteral)(node.value));}},{key:"reduceMethod",value:function reduceMethod(node,_ref52){var name=_ref52.name,params=_ref52.params,body=_ref52.body;return seq(node.isAsync?seq(this.t("async"),this.sep(Sep.AFTER_METHOD_ASYNC)):empty(),node.isGenerator?seq(this.t("*"),this.sep(Sep.AFTER_METHOD_GENERATOR_STAR)):empty(),name,this.sep(Sep.AFTER_METHOD_NAME),this.paren(params,Sep.PARAMETERS_PAREN_BEFORE,Sep.PARAMETERS_PAREN_AFTER,Sep.PARAMETERS_PAREN_EMPTY),this.sep(Sep.BEFORE_METHOD_BODY),this.brace(body,node,Sep.METHOD_BRACE_INTIAL,Sep.METHOD_BRACE_FINAL,Sep.METHOD_BRACE_EMPTY));}},{key:"reduceModule",value:function reduceModule(node,_ref53){var directives=_ref53.directives,items=_ref53.items;if(items.length){items[0]=this.parenToAvoidBeingDirective(node.items[0],items[0]);}return seq.apply(void 0,_toConsumableArray$1(directives).concat([directives.length?this.sep(Sep.AFTER_MODULE_DIRECTIVES):empty()],_toConsumableArray$1(items)));}},{key:"reduceNewExpression",value:function reduceNewExpression(node,_ref54){var _this7=this;var callee=_ref54.callee,args=_ref54.arguments;var parenthizedArgs=args.map(function(a,i2){return _this7.p(node.arguments[i2],_coderep.Precedence.Assignment,a);});var calleeRep=(0,_coderep.getPrecedence)(node.callee)===_coderep.Precedence.Call?this.paren(callee,Sep.NEW_CALLEE_PAREN_BEFORE,Sep.NEW_CALLEE_PAREN_AFTER):this.p(node.callee,(0,_coderep.getPrecedence)(node),callee);return seq(this.t("new"),this.sep(Sep.AFTER_NEW),calleeRep,args.length===0?this.sep(Sep.EMPTY_NEW_CALL):seq(this.sep(Sep.BEFORE_NEW_ARGS),this.paren(this.commaSep(parenthizedArgs,Sep.ARGS_BEFORE_COMMA,Sep.ARGS_AFTER_COMMA),Sep.NEW_PAREN_BEFORE,Sep.NEW_PAREN_AFTER,Sep.NEW_PAREN_EMPTY)));}},{key:"reduceNewTargetExpression",value:function reduceNewTargetExpression(){return seq(this.t("new"),this.sep(Sep.NEW_TARGET_BEFORE_DOT),this.t("."),this.sep(Sep.NEW_TARGET_AFTER_DOT),this.t("target"));}},{key:"reduceObjectExpression",value:function reduceObjectExpression(node,_ref55){var properties=_ref55.properties;var state=this.brace(this.commaSep(properties,Sep.OBJECT_BEFORE_COMMA,Sep.OBJECT_AFTER_COMMA),node,Sep.OBJECT_BRACE_INITIAL,Sep.OBJECT_BRACE_FINAL,Sep.OBJECT_EMPTY);state.startsWithCurly=true;return state;}},{key:"reduceUpdateExpression",value:function reduceUpdateExpression(node,_ref56){var operand=_ref56.operand;if(node.isPrefix){return this.reduceUnaryExpression.apply(this,arguments);}return(0,_objectAssign2.default)(seq(this.p(node.operand,_coderep.Precedence.New,operand),this.sep(Sep.BEFORE_POSTFIX(node.operator)),this.t(node.operator)),{startsWithCurly:operand.startsWithCurly,startsWithLetSquareBracket:operand.startsWithLetSquareBracket,startsWithFunctionOrClass:operand.startsWithFunctionOrClass});}},{key:"reduceUnaryExpression",value:function reduceUnaryExpression(node,_ref57){var operand=_ref57.operand;return seq(this.t(node.operator),this.sep(Sep.UNARY(node.operator)),this.p(node.operand,(0,_coderep.getPrecedence)(node),operand));}},{key:"reduceReturnStatement",value:function reduceReturnStatement(node,_ref58){var expression=_ref58.expression;return seq(this.t("return"),expression?seq(this.sep(Sep.RETURN),expression):empty(),this.semiOp(),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceScript",value:function reduceScript(node,_ref59){var directives=_ref59.directives,statements=_ref59.statements;if(statements.length){statements[0]=this.parenToAvoidBeingDirective(node.statements[0],statements[0]);}return seq.apply(void 0,_toConsumableArray$1(directives).concat([directives.length?this.sep(Sep.AFTER_SCRIPT_DIRECTIVES):empty()],_toConsumableArray$1(statements)));}},{key:"reduceSetter",value:function reduceSetter(node,_ref60){var name=_ref60.name,param=_ref60.param,body=_ref60.body;return seq(this.t("set"),this.sep(Sep.AFTER_SET),name,this.sep(Sep.BEFORE_SET_PARAMS),this.paren(param,Sep.SETTER_PARAM_BEFORE,Sep.SETTER_PARAM_AFTER),this.sep(Sep.BEFORE_SET_BODY),this.brace(body,node,Sep.SET_BRACE_INTIIAL,Sep.SET_BRACE_FINAL,Sep.SET_BRACE_EMPTY));}},{key:"reduceShorthandProperty",value:function reduceShorthandProperty(node,_ref61){var name=_ref61.name;return name;}},{key:"reduceStaticMemberAssignmentTarget",value:function reduceStaticMemberAssignmentTarget(node,_ref62){var object=_ref62.object;var state=seq(this.p(node.object,(0,_coderep.getPrecedence)(node),object),this.sep(Sep.BEFORE_STATIC_MEMBER_ASSIGNMENT_TARGET_DOT),this.t("."),this.sep(Sep.AFTER_STATIC_MEMBER_ASSIGNMENT_TARGET_DOT),this.t(node.property));state.startsWithLet=object.startsWithLet;state.startsWithCurly=object.startsWithCurly;state.startsWithLetSquareBracket=object.startsWithLetSquareBracket;state.startsWithFunctionOrClass=object.startsWithFunctionOrClass;return state;}},{key:"reduceStaticMemberExpression",value:function reduceStaticMemberExpression(node,_ref63){var object=_ref63.object;var state=seq(this.p(node.object,(0,_coderep.getPrecedence)(node),object),this.sep(Sep.BEFORE_STATIC_MEMBER_DOT),this.t("."),this.sep(Sep.AFTER_STATIC_MEMBER_DOT),this.t(node.property));state.startsWithLet=object.startsWithLet;state.startsWithCurly=object.startsWithCurly;state.startsWithLetSquareBracket=object.startsWithLetSquareBracket;state.startsWithFunctionOrClass=object.startsWithFunctionOrClass;return state;}},{key:"reduceStaticPropertyName",value:function reduceStaticPropertyName(node){if(_esutils.keyword.isIdentifierNameES6(node.value)){return this.t(node.value);}var n=parseFloat(node.value);if(n>=0&&n.toString()===node.value){return new _coderep.NumberCodeRep(n);}return this.t((0,_coderep.escapeStringLiteral)(node.value));}},{key:"reduceSuper",value:function reduceSuper(){return this.t("super");}},{key:"reduceSwitchCase",value:function reduceSwitchCase(node,_ref64){var test=_ref64.test,consequent=_ref64.consequent;return seq(this.t("case"),this.sep(Sep.BEFORE_CASE_TEST),test,this.sep(Sep.AFTER_CASE_TEST),this.t(":"),this.sep(Sep.BEFORE_CASE_BODY),seq.apply(void 0,_toConsumableArray$1(consequent)),this.sep(Sep.AFTER_CASE_BODY));}},{key:"reduceSwitchDefault",value:function reduceSwitchDefault(node,_ref65){var consequent=_ref65.consequent;return seq(this.t("default"),this.sep(Sep.DEFAULT),this.t(":"),this.sep(Sep.BEFORE_CASE_BODY),seq.apply(void 0,_toConsumableArray$1(consequent)),this.sep(Sep.AFTER_DEFAULT_BODY));}},{key:"reduceSwitchStatement",value:function reduceSwitchStatement(node,_ref66){var discriminant=_ref66.discriminant,cases=_ref66.cases;return seq(this.t("switch"),this.sep(Sep.BEFORE_SWITCH_DISCRIM),this.paren(discriminant,Sep.SWITCH_DISCRIM_PAREN_BEFORE,Sep.SWITCH_DISCRIM_PAREN_AFTER),this.sep(Sep.BEFORE_SWITCH_BODY),this.brace(seq.apply(void 0,_toConsumableArray$1(cases)),node,Sep.SWITCH_BRACE_INTIAL,Sep.SWITCH_BRACE_FINAL,Sep.SWITCH_BRACE_EMPTY),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceSwitchStatementWithDefault",value:function reduceSwitchStatementWithDefault(node,_ref67){var discriminant=_ref67.discriminant,preDefaultCases=_ref67.preDefaultCases,defaultCase=_ref67.defaultCase,postDefaultCases=_ref67.postDefaultCases;return seq(this.t("switch"),this.sep(Sep.BEFORE_SWITCH_DISCRIM),this.paren(discriminant,Sep.SWITCH_DISCRIM_PAREN_BEFORE,Sep.SWITCH_DISCRIM_PAREN_AFTER),this.sep(Sep.BEFORE_SWITCH_BODY),this.brace(seq.apply(void 0,_toConsumableArray$1(preDefaultCases).concat([defaultCase],_toConsumableArray$1(postDefaultCases))),node,Sep.SWITCH_BRACE_INTIAL,Sep.SWITCH_BRACE_FINAL,Sep.SWITCH_BRACE_EMPTY),this.sep(Sep.AFTER_STATEMENT(node)));}},{key:"reduceTemplateExpression",value:function reduceTemplateExpression(node,_ref68){var tag=_ref68.tag,elements=_ref68.elements;var state=node.tag==null?empty():seq(this.p(node.tag,(0,_coderep.getPrecedence)(node),tag),this.sep(Sep.TEMPLATE_TAG));state=seq(state,this.t("`"));for(var _i=0,l=node.elements.length;_i0)d+="}";d+=node.elements[_i].rawValue;if(_i=1e3&&n%10===0){s=n.toString(10);if(/[eE]/.test(s)){return s.replace(/[eE]\+/,"e");}return n.toString(10).replace(/0{3,}$/,function(match){return"e"+match.length;});}else if(n%1===0){if(n>1e15&&n<1e20){return"0x"+n.toString(16).toUpperCase();}return n.toString(10).replace(/[eE]\+/,"e");}return n.toString(10).replace(/^0\./,".").replace(/[eE]\+/,"e");}TokenStream_1=tokenStream$1.TokenStream=function(){function TokenStream(){_classCallCheck$1(this,TokenStream);this.result="";this.lastNumber=null;this.lastCodePoint=null;this.lastTokenStr="";this.optionalSemi=false;this.previousWasRegExp=false;this.partialHtmlComment=false;}_createClass$1(TokenStream,[{key:"putNumber",value:function putNumber(number){var tokenStr=renderNumber(number);this.put(tokenStr);this.lastNumber=tokenStr;}},{key:"putOptionalSemi",value:function putOptionalSemi(){this.optionalSemi=true;}},{key:"putRaw",value:function putRaw(tokenStr){this.result+=tokenStr;this.lastTokenStr=tokenStr;}},{key:"put",value:function put(tokenStr,isRegExp){if(this.optionalSemi){this.optionalSemi=false;if(tokenStr!=="}"){this.result+=";";this.lastCodePoint=";";this.previousWasRegExp=false;}}if(this.lastNumber!==null&&tokenStr.length===1){if(tokenStr==="."){this.result+=needsDoubleDot(this.lastNumber)?"..":".";this.lastNumber=null;this.lastCodePoint=".";return;}}var tokenStrCodePointCount=[].concat(_toConsumableArray(tokenStr)).length;if(tokenStrCodePointCount>0){this.lastNumber=null;var rightCodePoint=String.fromCodePoint(tokenStr.codePointAt(0));var lastCodePoint=this.lastCodePoint;this.lastCodePoint=String.fromCodePoint(tokenStr.codePointAt(tokenStrCodePointCount-1));var previousWasRegExp=this.previousWasRegExp;this.previousWasRegExp=isRegExp;if(lastCodePoint&&((lastCodePoint==="+"||lastCodePoint==="-")&&lastCodePoint===rightCodePoint||isIdentifierPartES6(lastCodePoint)&&isIdentifierPartES6(rightCodePoint)||lastCodePoint==="/"&&rightCodePoint==="/"||previousWasRegExp&&rightCodePoint==="i"||this.partialHtmlComment&&tokenStr.startsWith("--"))){this.result+=" ";}}this.partialHtmlComment=this.lastTokenStr.endsWith("<")&&tokenStr==="!";this.result+=tokenStr;this.lastTokenStr=tokenStr;}}]);return TokenStream;}();var tokenStream=/* @__PURE__ */_mergeNamespaces({__proto__:null,get TokenStream(){return TokenStream_1;},needsDoubleDot:needsDoubleDot_1,"default":tokenStream$1},[tokenStream$1]);var require$$5=/* @__PURE__ */getAugmentedNamespace(tokenStream);Object.defineProperty(withLocation$1,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i2=0;i21?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key];}ts.locations.set(node,{start:{line:1,column:0,offset:0},end:null});originalEmit.apply(void 0,[ts].concat(args));ts.locations.get(node).end={line:ts.line,column:ts.column,offset:ts.result.length};};}else if(node.type==="LiteralNumericExpression"){rep.emit=function(ts){for(var _len2=arguments.length,args=Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){args[_key2-1]=arguments[_key2];}ts.startEmit(node);originalEmit.apply(void 0,[ts].concat(args));ts.finishEmit(node);ts.lastNumberNode=node;};}else{rep.emit=function(ts){for(var _len3=arguments.length,args=Array(_len3>1?_len3-1:0),_key3=1;_key3<_len3;_key3++){args[_key3-1]=arguments[_key3];}ts.startEmit(node);originalEmit.apply(void 0,[ts].concat(args));ts.finishEmit(node);};}return rep;}function addLocationToReducer(reducer){var wrapped=(0,_shiftReducer.adapt)(addLocation,reducer);var originalRegenerate=wrapped.regenerateArrowParams.bind(wrapped);wrapped.regenerateArrowParams=function(element,original){var out=originalRegenerate(element,original);if(out!==original){addLocation(out,element);}return out;};var originalDirective=wrapped.parenToAvoidBeingDirective.bind(wrapped);wrapped.parenToAvoidBeingDirective=function(element,original){var out=originalDirective(element,original);if(out!==original){addLocation(out,element);}return out;};return wrapped;}function codeGenWithLocation(program){var generator=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new _minimalCodegen2.default();var ts=new TokenStreamWithLocation();var rep=(0,_shiftReducer.reduce)(addLocationToReducer(generator),program);rep.emit(ts);return{source:ts.result,locations:ts.locations};}var withLocation=/* @__PURE__ */_mergeNamespaces({__proto__:null,"default":_default},[withLocation$1]);var require$$3=/* @__PURE__ */getAugmentedNamespace(withLocation);(function(exports2){Object.defineProperty(exports2,"__esModule",{value:true});exports2.codeGenWithLocation=exports2.SemiOp=exports2.CommaSep=exports2.Semi=exports2.Seq=exports2.ContainsIn=exports2.NoIn=exports2.Brace=exports2.Bracket=exports2.Paren=exports2.NumberCodeRep=exports2.Token=exports2.Empty=exports2.CodeRep=exports2.escapeStringLiteral=exports2.getPrecedence=exports2.Precedence=exports2.Sep=exports2.FormattedCodeGen=exports2.ExtensibleCodeGen=exports2.MinimalCodeGen=void 0;exports2.default=codeGen;var _minimalCodegen3=require$$0$1;Object.defineProperty(exports2,"MinimalCodeGen",{enumerable:true,get:function get5(){return _interopRequireDefault2(_minimalCodegen3).default;}});var _formattedCodegen=require$$1;Object.defineProperty(exports2,"ExtensibleCodeGen",{enumerable:true,get:function get5(){return _formattedCodegen.ExtensibleCodeGen;}});Object.defineProperty(exports2,"FormattedCodeGen",{enumerable:true,get:function get5(){return _formattedCodegen.FormattedCodeGen;}});Object.defineProperty(exports2,"Sep",{enumerable:true,get:function get5(){return _formattedCodegen.Sep;}});var _coderep2=require$$2;Object.defineProperty(exports2,"Precedence",{enumerable:true,get:function get5(){return _coderep2.Precedence;}});Object.defineProperty(exports2,"getPrecedence",{enumerable:true,get:function get5(){return _coderep2.getPrecedence;}});Object.defineProperty(exports2,"escapeStringLiteral",{enumerable:true,get:function get5(){return _coderep2.escapeStringLiteral;}});Object.defineProperty(exports2,"CodeRep",{enumerable:true,get:function get5(){return _coderep2.CodeRep;}});Object.defineProperty(exports2,"Empty",{enumerable:true,get:function get5(){return _coderep2.Empty;}});Object.defineProperty(exports2,"Token",{enumerable:true,get:function get5(){return _coderep2.Token;}});Object.defineProperty(exports2,"NumberCodeRep",{enumerable:true,get:function get5(){return _coderep2.NumberCodeRep;}});Object.defineProperty(exports2,"Paren",{enumerable:true,get:function get5(){return _coderep2.Paren;}});Object.defineProperty(exports2,"Bracket",{enumerable:true,get:function get5(){return _coderep2.Bracket;}});Object.defineProperty(exports2,"Brace",{enumerable:true,get:function get5(){return _coderep2.Brace;}});Object.defineProperty(exports2,"NoIn",{enumerable:true,get:function get5(){return _coderep2.NoIn;}});Object.defineProperty(exports2,"ContainsIn",{enumerable:true,get:function get5(){return _coderep2.ContainsIn;}});Object.defineProperty(exports2,"Seq",{enumerable:true,get:function get5(){return _coderep2.Seq;}});Object.defineProperty(exports2,"Semi",{enumerable:true,get:function get5(){return _coderep2.Semi;}});Object.defineProperty(exports2,"CommaSep",{enumerable:true,get:function get5(){return _coderep2.CommaSep;}});Object.defineProperty(exports2,"SemiOp",{enumerable:true,get:function get5(){return _coderep2.SemiOp;}});var _withLocation=require$$3;Object.defineProperty(exports2,"codeGenWithLocation",{enumerable:true,get:function get5(){return _interopRequireDefault2(_withLocation).default;}});var _shiftReducer3=require$$4;var _shiftReducer22=_interopRequireDefault2(_shiftReducer3);var _tokenStream2=require$$5;var _minimalCodegen22=_interopRequireDefault2(_minimalCodegen3);function _interopRequireDefault2(obj){return obj&&obj.__esModule?obj:{default:obj};}function codeGen(script){var generator=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new _minimalCodegen22.default();var ts=new _tokenStream2.TokenStream();var rep=(0,_shiftReducer22.default)(generator,script);rep.emit(ts);return ts.result;}})(dist);var shiftCodegen=/* @__PURE__ */getDefaultExportFromCjs(dist);shiftCodegen["default"]||shiftCodegen;var Pattern$1=strudel.Pattern;Object.keys(Pattern$1.prototype.factories).concat(["mini"]);var pure=strudel.pure,Pattern=strudel.Pattern,Fraction=strudel.Fraction,stack=strudel.stack,slowcat=strudel.slowcat,sequence=strudel.sequence,timeCat=strudel.timeCat,silence=strudel.silence,reify$1=strudel.reify;var _seedState=0;var randOffset=2e-4;function _nextSeed(){return _seedState++;}var applyOptions=parent=>(pat,i2)=>{const ast2=parent.source_[i2];const options=ast2.options_;const operator=options==null?void 0:options.operator;if(operator){switch(operator.type_){case"stretch":const speed=Fraction(operator.arguments_.amount).inverse();return reify$1(pat).fast(speed);case"bjorklund":return pat.euclid(operator.arguments_.pulse,operator.arguments_.step,operator.arguments_.rotation);case"degradeBy":return reify$1(pat)._degradeByWith(rand.early(randOffset*_nextSeed()).segment(1),operator.arguments_.amount);}console.warn(`operator "${operator.type_}" not implemented`);}if(options==null?void 0:options.weight){return pat;}const unimplemented=Object.keys(options||{}).filter(key=>key!=="operator");if(unimplemented.length){console.warn(`option${unimplemented.length>1?"s":""} ${unimplemented.map(o=>`"${o}"`).join(", ")} not implemented`);}return pat;};function resolveReplications(ast2){ast2.source_=ast2.source_.map(child=>{const{replicate,...options}=child.options_||{};if(replicate){return{...child,options_:{...options,weight:replicate},source_:{type_:"pattern",arguments_:{alignment:"h"},source_:[{type_:"element",source_:child.source_,location_:child.location_,options_:{operator:{type_:"stretch",arguments_:{amount:Fraction(replicate).inverse().toString()}}}}]}};}return child;});}function patternifyAST(ast2){switch(ast2.type_){case"pattern":resolveReplications(ast2);const children=ast2.source_.map(patternifyAST).map(applyOptions(ast2));const alignment=ast2.arguments_.alignment;if(alignment==="v"){return stack(...children);}if(alignment==="r"){return chooseInWith(rand.early(randOffset*_nextSeed()).segment(1),children);}const weightedChildren=ast2.source_.some(child=>{var _a;return!!((_a=child.options_)==null?void 0:_a.weight);});if(!weightedChildren&&alignment==="t"){return slowcat(...children);}if(weightedChildren){const pat=timeCat(...ast2.source_.map((child,i2)=>{var _a;return[((_a=child.options_)==null?void 0:_a.weight)||1,children[i2]];}));if(alignment==="t"){const weightSum=ast2.source_.reduce((sum,child)=>{var _a;return sum+(((_a=child.options_)==null?void 0:_a.weight)||1);},0);return pat._slow(weightSum);}return pat;}return sequence(...children);case"element":if(ast2.source_==="~"){return silence;}if(typeof ast2.source_!=="object"){if(!ast2.location_){console.warn("no location for",ast2);return ast2.source_;}const{start,end}=ast2.location_;const value=!isNaN(Number(ast2.source_))?Number(ast2.source_):ast2.source_;return pure(value).withLocation([start.line,start.column,start.offset],[end.line,end.column,end.offset]);}return patternifyAST(ast2.source_);case"stretch":return patternifyAST(ast2.source_).slow(ast2.arguments_.amount);default:console.warn(`node type "${ast2.type_}" not implemented -> returning silence`);return silence;}}var mini=(...strings)=>{const pats=strings.map(str=>{const ast2=peg$parse(`"${str}"`);return patternifyAST(ast2);});return sequence(...pats);};var h=string=>{const ast2=peg$parse(string);return patternifyAST(ast2);};Pattern.prototype.define("mini",mini,{composable:true});Pattern.prototype.define("m",mini,{composable:true});Pattern.prototype.define("h",h,{composable:true});function minify(thing){if(typeof thing==="string"){return mini(thing);}return reify$1(thing);}exports.SyntaxError=peg$SyntaxError;exports.h=h;exports.mini=mini;exports.minify=minify;exports.parse=peg$parse;exports.patternifyAST=patternifyAST; +Please check with "npm ls @strudel.cycles/core".`); +} + +globalThis._strudelLoaded = true; +var strudel = /* @__PURE__ */Object.freeze( /* @__PURE__ */Object.defineProperty({ + __proto__: null, + Fraction: fraction, + gist: gist, + Hap: Hap, + Pattern: Pattern$1, + silence: silence$1, + pure: pure$1, + isPattern: isPattern, + reify: reify$2, + stack: stack$1, + slowcat: slowcat$1, + slowcatPrime: slowcatPrime, + fastcat: _fastcat, + cat: _cat, + timeCat: timeCat$1, + sequence: sequence$1, + seq: seq, + polymeterSteps: polymeterSteps, + polymeter: polymeter, + pm: pm, + polyrhythm: polyrhythm, + pr: pr, + add: add, + chop: chop, + chunk: chunk, + chunkBack: chunkBack, + div: div, + early: early, + echo: echo, + every: every, + fast: fast, + inv: inv, + invert: invert, + iter: iter, + iterBack: iterBack, + jux: jux, + juxBy: juxBy, + late: late, + linger: linger, + mask: mask, + mul: mul, + off: off, + ply: ply, + range: range, + range2: range2, + rev: rev, + slow: slow, + struct: struct, + sub: sub, + superimpose: superimpose, + set: set, + when: when, + makeComposable: makeComposable, + patternify2: patternify2, + patternify3: patternify3, + patternify4: patternify4, + steady: steady, + signal: signal, + isaw: isaw, + isaw2: isaw2, + saw: saw, + saw2: saw2, + sine2: sine2, + sine: sine, + cosine: cosine, + cosine2: cosine2, + square: square, + square2: square2, + tri: tri, + tri2: tri2, + time: time, + rand: rand, + rand2: rand2, + _brandBy: _brandBy, + brandBy: brandBy, + brand: brand, + _irand: _irand, + irand: irand, + __chooseWith: __chooseWith, + chooseWith: chooseWith, + chooseInWith: chooseInWith, + choose: choose, + chooseCycles: chooseCycles, + randcat: randcat, + wchoose: wchoose, + wchooseCycles: wchooseCycles, + perlinWith: perlinWith, + perlin: perlin, + State: State, + TimeSpan: TimeSpan, + isNote: isNote, + tokenizeNote: tokenizeNote, + toMidi: toMidi, + fromMidi: fromMidi, + getFreq: getFreq, + midi2note: midi2note, + mod: mod, + getPlayableNoteValue: getPlayableNoteValue, + getFrequency: getFrequency, + rotate: rotate, + pipe: pipe, + compose: compose, + removeUndefineds: removeUndefineds, + flatten: flatten, + id: id, + constant: constant, + listRange: listRange, + curry: curry +}, Symbol.toStringTag, { + value: "Module" +})); +var pure = strudel.pure, + Pattern = strudel.Pattern, + Fraction = strudel.Fraction, + stack = strudel.stack, + slowcat = strudel.slowcat, + sequence = strudel.sequence, + timeCat = strudel.timeCat, + silence = strudel.silence, + reify$1 = strudel.reify; +var _seedState = 0; +var randOffset = 2e-4; + +function _nextSeed() { + return _seedState++; +} + +var applyOptions = parent => (pat, i) => { + const ast = parent.source_[i]; + const options = ast.options_; + const operator = options == null ? void 0 : options.operator; + + if (operator) { + switch (operator.type_) { + case "stretch": + const speed = Fraction(operator.arguments_.amount).inverse(); + return reify$1(pat).fast(speed); + + case "bjorklund": + return pat.euclid(operator.arguments_.pulse, operator.arguments_.step, operator.arguments_.rotation); + + case "degradeBy": + return reify$1(pat)._degradeByWith(rand.early(randOffset * _nextSeed()).segment(1), operator.arguments_.amount); + } + + console.warn(`operator "${operator.type_}" not implemented`); + } + + if (options == null ? void 0 : options.weight) { + return pat; + } + + const unimplemented = Object.keys(options || {}).filter(key => key !== "operator"); + + if (unimplemented.length) { + console.warn(`option${unimplemented.length > 1 ? "s" : ""} ${unimplemented.map(o => `"${o}"`).join(", ")} not implemented`); + } + + return pat; +}; + +function resolveReplications(ast) { + ast.source_ = ast.source_.map(child => { + const { + replicate, + ...options + } = child.options_ || {}; + + if (replicate) { + return { ...child, + options_: { ...options, + weight: replicate + }, + source_: { + type_: "pattern", + arguments_: { + alignment: "h" + }, + source_: [{ + type_: "element", + source_: child.source_, + location_: child.location_, + options_: { + operator: { + type_: "stretch", + arguments_: { + amount: Fraction(replicate).inverse().toString() + } + } + } + }] + } + }; + } + + return child; + }); +} + +function patternifyAST(ast) { + let p; + + switch (ast.type_) { + case "pattern": + resolveReplications(ast); + const children = ast.source_.map(patternifyAST).map(applyOptions(ast)); + const alignment = ast.arguments_.alignment; + + if (alignment === "v") { + return stack(...children); + } + + if (alignment === "r") { + return chooseInWith(rand.early(randOffset * _nextSeed()).segment(1), children); + } + + const weightedChildren = ast.source_.some(child => { + var _a; + + return !!((_a = child.options_) == null ? void 0 : _a.weight); + }); + + if (!weightedChildren && alignment === "t") { + return slowcat(...children); + } + + if (weightedChildren) { + const pat = timeCat(...ast.source_.map((child, i) => { + var _a; + + return [((_a = child.options_) == null ? void 0 : _a.weight) || 1, children[i]]; + })); + + if (alignment === "t") { + const weightSum = ast.source_.reduce((sum, child) => { + var _a; + + return sum + (((_a = child.options_) == null ? void 0 : _a.weight) || 1); + }, 0); + return pat._slow(weightSum); + } + + return pat; + } + + return sequence(...children); + + case "element": + if (ast.source_ === "~") { + return silence; + } + + if (typeof ast.source_ !== "object") { + if (!ast.location_) { + console.warn("no location for", ast); + return ast.source_; + } + + const { + start, + end + } = ast.location_; + const value = !isNaN(Number(ast.source_)) ? Number(ast.source_) : ast.source_; + return pure(value).withLocation([start.line, start.column, start.offset], [end.line, end.column, end.offset]); + } + + p = patternifyAST(ast.source_); + p.ast = ast; + return p; + + case "stretch": + p = patternifyAST(ast.source_).slow(ast.arguments_.amount); + p.ast = ast; + return p; + + default: + console.warn(`node type "${ast.type_}" not implemented -> returning silence`); + return silence; + } +} + +var mini = (...strings) => { + const pats = strings.map(str => { + const ast = krillParser.parse(`"${str}"`); + const p = patternifyAST(ast); + p.ast = ast; + return p; + }); + const s = sequence(...pats); + s.ast = pats.map(_pat => _pat.ast); + return s; +}; + +var h = string => { + const ast = krillParser.parse(string); + const p = patternifyAST(ast); + p.ast = ast; + return p; +}; + +Pattern.prototype.define("mini", mini, { + composable: true +}); +Pattern.prototype.define("m", mini, { + composable: true +}); +Pattern.prototype.define("h", h, { + composable: true +}); + +function minify(thing) { + if (typeof thing === "string") { + return mini(thing); + } + + return reify$1(thing); +} + +exports.h = h; +exports.mini = mini; +exports.minify = minify; +exports.patternifyAST = patternifyAST; },{}],92:[function(require,module,exports){ "use strict"; @@ -8778,29 +14592,27 @@ module.exports = function (Gibberish) { g.gen.memory.heap[voice.bufferLength.memory.values.idx] = sampler.dataLength; // set voice data index - g.gen.memory.heap[voice.bufferLoc.memory.values.idx] = sampler.dataIdx; //if( rate !== null ) g.gen.memory.heap[ voice.rate.memory.values.idx ] = rate + g.gen.memory.heap[voice.bufferLoc.memory.values.idx] = sampler.dataIdx; // assume voice plays forward if no rate is provided + // global rate for sampler can still be used to reverse - if (rate !== null) voice.rate = rate; + voice.rate = rate !== null ? rate : 1; // determine direction voice will play at by checking sign + // of voice.rate and sampler.rate. If both are the same, + // then the direction will be forward, as they are multiplied + // ... two positives or two negatives will both create a + // positive value - if (rate > 0) { + const samplerRate = typeof this.rate === 'object' ? 1 : this.rate; + const dir = Math.sign(voice.rate) === Math.sign(samplerRate) ? 1 : 0; + + if (dir === 1) { + // trigger the bang assigned to the reset property of the + // counter object representing phase for the voice voice.trigger(); } else { - //console.log( 'reverse?', rate ) - voice.bang.trigger(); //voice.phase.value = 0 - - voice.phase.value = sampler.dataLength - 1; //console.log( 'phase', voice.phase.value ) - } //if( rate < 0 ) { - // const phase = sampler.dataIdx + Math.round((sampler.dataLength/2)) - 1 - // console.log( 'phase:', phase, 'length:', sampler.dataLength, 'start:', sampler.dataIdx ) - // //voice.phase.value = phase - // //g.gen.memory.heap[ voice.phase.memory.value.idx ] = phase - //}else{ - // // will reset phase to 0 - // voice.trigger() - //} - //voice.trigger() - //g.gen.memory.heap[ voice.rate.memory.values.idx ] = rate - + // reset the value of the phase counter to the + // end of the sample for reverse playback + voice.phase.value = sampler.dataLength - 1; + } } return voice; @@ -8884,6 +14696,10 @@ module.exports = function (Gibberish) { set rate(v) { g.gen.memory.heap[this.__rate.memory.values.idx] = v; + }, + + get rate() { + return g.gen.memory.heap[this.__rate.memory.values.idx]; } }; @@ -11583,16 +17399,15 @@ module.exports = function (Gibberish) { },{"../workletProxy.js":155}],152:[function(require,module,exports){ "use strict"; -var __proxy = require('../workletProxy.js'); - -var mini = require('../external/mini.js'); //const Pattern = require( 'tidal.pegjs' ) - +var __proxy = require('../workletProxy.js'), + mini = require('../external/mini.js'); module.exports = function (Gibberish) { const proxy = __proxy(Gibberish); const Sequencer = props => { - let __seq; + let __seq, + i = 0; const seq = { __isRunning: false, @@ -11603,12 +17418,16 @@ module.exports = function (Gibberish) { __events: null, tick(priority) { - // running for first time, perform a query + let startTime; // running for first time, perform a query + if (seq.__events === null || seq.__events.length === 0) { - //seq.__events = seq.__pattern.query( seq.__phase++, 1 ) + startTime = seq.__phase; seq.__events = seq.__pattern.queryArc(seq.__phase++, 1); - } // used when scheduling events that are very far apart + seq.__events.sort((a, b) => a.whole.begin.valueOf() > b.whole.begin.valueOf()); + } else { + startTime = seq.__events[0].whole.begin; + } if (seq.__events.length <= 0) { if (Gibberish.mode === 'processor') { @@ -11620,15 +17439,15 @@ module.exports = function (Gibberish) { return; } - const startTime = seq.__events[0].whole.begin; - if (seq.key !== 'chord') { - while (seq.__events.length > 0 && startTime.valueOf() === seq.__events[0].whole.begin.valueOf()) { - let event = seq.__events.shift(), - value = event.value, - uid = event.uid; // for bjorklund etc. + while (seq.__events.length > 0 && startTime.valueOf() >= seq.__events[0].whole.begin.valueOf()) { + let event = seq.__events.shift(); // make sure we should trigger sound + if (!event.hasOnset()) continue; + let value = event.value, + uid = event.context.locations[0].start.column; //console.log( 'evt', uid, event.context.locations ) + if (typeof value === 'object') value = value.value; if (seq.filters !== null) value = seq.filters.reduce((currentValue, filter) => filter(currentValue, seq, uid), value); @@ -11637,7 +17456,7 @@ module.exports = function (Gibberish) { value = value(); } - +Gibberish.processor.messages.push(seq.mainthreadonly, seq.key, value); + Gibberish.processor.messages.push(seq.mainthreadonly, seq.key, value); } else if (typeof seq.target[seq.key] === 'function') { seq.target[seq.key](value); } else { @@ -11647,7 +17466,7 @@ module.exports = function (Gibberish) { } else { let value = seq.__events.filter(evt => startTime.valueOf() === evt.whole.begin.valueOf()).map(evt => evt.value); - let uid = seq.__events[0].uid; + let uid = seq.__events[0].context.locations[0].start.column; const events = seq.__events.splice(0, value.length); @@ -11655,7 +17474,9 @@ module.exports = function (Gibberish) { if (value.length === 1) { value = seq.filters.reduce((currentValue, filter) => filter(currentValue, seq, uid), value); } else { - value.forEach((v, i) => seq.filters.reduce((currentValue, filter) => filter(currentValue, seq, events[i].uid), v)); + value.forEach((v, i) => { + return seq.filters.reduce((currentValue, filter) => filter(currentValue, seq, events[i].uid), v); + }); } } @@ -11673,15 +17494,20 @@ module.exports = function (Gibberish) { let time = 0; while (seq.__events.length <= 0) { - seq.__events = seq.__pattern.queryArc(seq.__phase++, seq.__phase); + seq.__events = seq.__pattern.queryArc(seq.__phase, ++seq.__phase); } + + seq.__events.sort((a, b) => a.whole.begin.valueOf() > b.whole.begin.valueOf()); } - timing = seq.__events[0].whole.begin.sub(startTime).valueOf(); //console.log( 'timings:', timing, startTime.valueOf(), seq.__events[0].whole.begin.valueOf() ) + timing = seq.__events[0].whole.begin.sub(startTime).valueOf(); + if (timing.valueOf() < 0) timing += 1; //if( timing <= 0 ) timing = Math.abs( timing ) + //console.log( seq.__events[0].whole.begin.toString(), startTime.toString(), timing ) + //console.log( 'timings:', timing, startTime.valueOf(), seq.__events[0].whole.begin.valueOf() ) - timing *= Math.ceil(Gibberish.ctx.sampleRate / Sequencer.clock.cps) + 1; //console.log( 'timing:', timing, startTime.valueOf(), seq.__events[0].whole.begin.valueOf() ) + timing *= Math.ceil(Gibberish.ctx.sampleRate / Sequencer.clock.cps); //console.log( 'timing:', timing, startTime.valueOf(), seq.__events[0].whole.begin.valueOf() ) - if (seq.__isRunning === true && !isNaN(timing) && timing > 0) { + if (seq.__isRunning === true && !isNaN(timing)) { Gibberish.scheduler.add(timing, seq.tick, seq.priority); } } @@ -11749,6 +17575,7 @@ module.exports = function (Gibberish) { cps: 1 }; Sequencer.id = Gibberish.utilities.getUID(); + Sequencer.mini = mini.mini; if (Gibberish.mode === 'worklet') { Gibberish.worklet.port.postMessage({ @@ -12098,6 +17925,7 @@ module.exports = function (Gibberish) { if (obj[propSplit[0]] !== undefined) { if (propSplit[1] !== undefined) { + //console.log( obj, propSplit[0], propSplit[1], value ) if (typeof obj[propSplit[0]][propSplit[1]] !== 'function') { obj[propSplit[0]][propSplit[1]] = value; } else { diff --git a/js/external/mini.js b/js/external/mini.js index ca5ce0d..f9a4211 100644 --- a/js/external/mini.js +++ b/js/external/mini.js @@ -6,24 +6,8 @@ var __publicField = (obj, key, value) => { return value; }; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); -function _mergeNamespaces(n, m) { - for (var i2 = 0; i2 < m.length; i2++) { - const e = m[i2]; - if (typeof e !== "string" && !Array.isArray(e)) { - for (const k in e) { - if (k !== "default" && !(k in n)) { - const d = Object.getOwnPropertyDescriptor(e, k); - if (d) { - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: () => e[k] - }); - } - } - } - } - } - return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { value: "Module" })); +function getDefaultExportFromCjs(x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x; } function peg$subclass(child, parent) { function C() { @@ -122,12 +106,12 @@ peg$SyntaxError.buildMessage = function(expected, found) { } function describeExpected(expected2) { var descriptions = expected2.map(describeExpectation); - var i2, j; + var i, j; descriptions.sort(); if (descriptions.length > 0) { - for (i2 = 1, j = 1; i2 < descriptions.length; i2++) { - if (descriptions[i2 - 1] !== descriptions[i2]) { - descriptions[j] = descriptions[i2]; + for (i = 1, j = 1; i < descriptions.length; i++) { + if (descriptions[i - 1] !== descriptions[i]) { + descriptions[j] = descriptions[i]; j++; } } @@ -177,20 +161,22 @@ function peg$parse(input, options) { var peg$c21 = "*"; var peg$c22 = "%"; var peg$c23 = "?"; - var peg$c24 = "struct"; - var peg$c25 = "target"; - var peg$c26 = "euclid"; - var peg$c27 = "slow"; - var peg$c28 = "rotL"; - var peg$c29 = "rotR"; - var peg$c30 = "fast"; - var peg$c31 = "scale"; - var peg$c32 = "//"; - var peg$c33 = "cat"; - var peg$c34 = "$"; - var peg$c35 = "setcps"; - var peg$c36 = "setbpm"; - var peg$c37 = "hush"; + var peg$c24 = "<~"; + var peg$c25 = "~>"; + var peg$c26 = "struct"; + var peg$c27 = "target"; + var peg$c28 = "euclid"; + var peg$c29 = "slow"; + var peg$c30 = "rotL"; + var peg$c31 = "rotR"; + var peg$c32 = "fast"; + var peg$c33 = "scale"; + var peg$c34 = "//"; + var peg$c35 = "cat"; + var peg$c36 = "$"; + var peg$c37 = "setcps"; + var peg$c38 = "setbpm"; + var peg$c39 = "hush"; var peg$r0 = /^[1-9]/; var peg$r1 = /^[eE]/; var peg$r2 = /^[0-9]/; @@ -228,21 +214,23 @@ function peg$parse(input, options) { var peg$e28 = peg$literalExpectation("*", false); var peg$e29 = peg$literalExpectation("%", false); var peg$e30 = peg$literalExpectation("?", false); - var peg$e31 = peg$literalExpectation("struct", false); - var peg$e32 = peg$literalExpectation("target", false); - var peg$e33 = peg$literalExpectation("euclid", false); - var peg$e34 = peg$literalExpectation("slow", false); - var peg$e35 = peg$literalExpectation("rotL", false); - var peg$e36 = peg$literalExpectation("rotR", false); - var peg$e37 = peg$literalExpectation("fast", false); - var peg$e38 = peg$literalExpectation("scale", false); - var peg$e39 = peg$literalExpectation("//", false); - var peg$e40 = peg$classExpectation(["\n"], true, false); - var peg$e41 = peg$literalExpectation("cat", false); - var peg$e42 = peg$literalExpectation("$", false); - var peg$e43 = peg$literalExpectation("setcps", false); - var peg$e44 = peg$literalExpectation("setbpm", false); - var peg$e45 = peg$literalExpectation("hush", false); + var peg$e31 = peg$literalExpectation("<~", false); + var peg$e32 = peg$literalExpectation("~>", false); + var peg$e33 = peg$literalExpectation("struct", false); + var peg$e34 = peg$literalExpectation("target", false); + var peg$e35 = peg$literalExpectation("euclid", false); + var peg$e36 = peg$literalExpectation("slow", false); + var peg$e37 = peg$literalExpectation("rotL", false); + var peg$e38 = peg$literalExpectation("rotR", false); + var peg$e39 = peg$literalExpectation("fast", false); + var peg$e40 = peg$literalExpectation("scale", false); + var peg$e41 = peg$literalExpectation("//", false); + var peg$e42 = peg$classExpectation(["\n"], true, false); + var peg$e43 = peg$literalExpectation("cat", false); + var peg$e44 = peg$literalExpectation("$", false); + var peg$e45 = peg$literalExpectation("setcps", false); + var peg$e46 = peg$literalExpectation("setbpm", false); + var peg$e47 = peg$literalExpectation("hush", false); var peg$f0 = function() { return parseFloat(text()); }; @@ -262,8 +250,8 @@ function peg$parse(input, options) { var peg$f5 = function(a) { return { replicate: a }; }; - var peg$f6 = function(p2, s, r) { - return { operator: { type_: "bjorklund", arguments_: { pulse: p2, step: s, rotation: r || 0 } } }; + var peg$f6 = function(p, s, r) { + return { operator: { type_: "bjorklund", arguments_: { pulse: p, step: s, rotation: r || 0 } } }; }; var peg$f7 = function(a) { return { operator: { type_: "stretch", arguments_: { amount: a } } }; @@ -277,78 +265,84 @@ function peg$parse(input, options) { var peg$f10 = function(a) { return { operator: { type_: "degradeBy", arguments_: { amount: a ? a : 0.5 } } }; }; - var peg$f11 = function(s, o) { + var peg$f11 = function(a) { + return { operator: { type_: "early", arguments_: { amount: a } } }; + }; + var peg$f12 = function(a) { + return { operator: { type_: "late", arguments_: { amount: a } } }; + }; + var peg$f13 = function(s, o) { return new ElementStub(s, o); }; - var peg$f12 = function(s) { + var peg$f14 = function(s) { return new PatternStub(s, "h"); }; - var peg$f13 = function(tail) { + var peg$f15 = function(tail) { return { alignment: "v", list: tail }; }; - var peg$f14 = function(tail) { + var peg$f16 = function(tail) { return { alignment: "r", list: tail }; }; - var peg$f15 = function(head, tail) { + var peg$f17 = function(head, tail) { if (tail && tail.list.length > 0) { return new PatternStub([head, ...tail.list], tail.alignment); } else { return head; } }; - var peg$f16 = function(sc) { + var peg$f18 = function(sc) { return sc; }; - var peg$f17 = function(s) { + var peg$f19 = function(s) { return { name: "struct", args: { sequence: s } }; }; - var peg$f18 = function(s) { + var peg$f20 = function(s) { return { name: "target", args: { name: s } }; }; - var peg$f19 = function(p2, s, r) { - return { name: "bjorklund", args: { pulse: parseInt(p2), step: parseInt(s) } }; + var peg$f21 = function(p, s, r) { + return { name: "bjorklund", args: { pulse: parseInt(p), step: parseInt(s) } }; }; - var peg$f20 = function(a) { + var peg$f22 = function(a) { return { name: "stretch", args: { amount: a } }; }; - var peg$f21 = function(a) { + var peg$f23 = function(a) { return { name: "shift", args: { amount: "-" + a } }; }; - var peg$f22 = function(a) { + var peg$f24 = function(a) { return { name: "shift", args: { amount: a } }; }; - var peg$f23 = function(a) { + var peg$f25 = function(a) { return { name: "stretch", args: { amount: "1/" + a } }; }; - var peg$f24 = function(s) { + var peg$f26 = function(s) { return { name: "scale", args: { scale: s.join("") } }; }; - var peg$f25 = function(s, v) { + var peg$f27 = function(s, v) { return v; }; - var peg$f26 = function(s, ss) { + var peg$f28 = function(s, ss) { ss.unshift(s); return new PatternStub(ss, "t"); }; - var peg$f27 = function(sg) { + var peg$f29 = function(sg) { return sg; }; - var peg$f28 = function(o, soc) { + var peg$f30 = function(o, soc) { return new OperatorStub(o.name, o.args, soc); }; - var peg$f29 = function(sc) { + var peg$f31 = function(sc) { return sc; }; - var peg$f30 = function(c) { + var peg$f32 = function(c) { return c; }; - var peg$f31 = function(v) { + var peg$f33 = function(v) { return new CommandStub("setcps", { value: v }); }; - var peg$f32 = function(v) { + var peg$f34 = function(v) { return new CommandStub("setcps", { value: v / 120 / 2 }); }; - var peg$f33 = function() { + var peg$f35 = function() { return new CommandStub("hush"); }; var peg$currPos = 0; @@ -384,27 +378,27 @@ function peg$parse(input, options) { } function peg$computePosDetails(pos) { var details = peg$posDetailsCache[pos]; - var p2; + var p; if (details) { return details; } else { - p2 = pos - 1; - while (!peg$posDetailsCache[p2]) { - p2--; + p = pos - 1; + while (!peg$posDetailsCache[p]) { + p--; } - details = peg$posDetailsCache[p2]; + details = peg$posDetailsCache[p]; details = { line: details.line, column: details.column }; - while (p2 < pos) { - if (input.charCodeAt(p2) === 10) { + while (p < pos) { + if (input.charCodeAt(p) === 10) { details.line++; details.column = 1; } else { details.column++; } - p2++; + p++; } peg$posDetailsCache[pos] = details; return details; @@ -970,6 +964,12 @@ function peg$parse(input, options) { s0 = peg$parseslice_replicate(); if (s0 === peg$FAILED) { s0 = peg$parseslice_degrade(); + if (s0 === peg$FAILED) { + s0 = peg$parseslice_early(); + if (s0 === peg$FAILED) { + s0 = peg$parseslice_late(); + } + } } } } @@ -1202,6 +1202,60 @@ function peg$parse(input, options) { } return s0; } + function peg$parseslice_early() { + var s0, s1, s2; + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c24) { + s1 = peg$c24; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e31); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parsenumber(); + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f11(s2); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + return s0; + } + function peg$parseslice_late() { + var s0, s1, s2; + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c25) { + s1 = peg$c25; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e32); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parsenumber(); + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f12(s2); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + return s0; + } function peg$parseslice_with_modifier() { var s0, s1, s2; s0 = peg$currPos; @@ -1212,7 +1266,7 @@ function peg$parse(input, options) { s2 = null; } peg$savedPos = s0; - s0 = peg$f11(s1, s2); + s0 = peg$f13(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1234,7 +1288,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f12(s1); + s1 = peg$f14(s1); } s0 = s1; return s0; @@ -1280,7 +1334,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f13(s1); + s1 = peg$f15(s1); } s0 = s1; return s0; @@ -1326,7 +1380,7 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f14(s1); + s1 = peg$f16(s1); } s0 = s1; return s0; @@ -1344,7 +1398,7 @@ function peg$parse(input, options) { s2 = null; } peg$savedPos = s0; - s0 = peg$f15(s1, s2); + s0 = peg$f17(s1, s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1362,7 +1416,7 @@ function peg$parse(input, options) { s4 = peg$parsequote(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f16(s3); + s0 = peg$f18(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1406,13 +1460,13 @@ function peg$parse(input, options) { function peg$parsestruct() { var s0, s1, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 6) === peg$c24) { - s1 = peg$c24; + if (input.substr(peg$currPos, 6) === peg$c26) { + s1 = peg$c26; peg$currPos += 6; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { - peg$fail(peg$e31); + peg$fail(peg$e33); } } if (s1 !== peg$FAILED) { @@ -1420,7 +1474,7 @@ function peg$parse(input, options) { s3 = peg$parsesequence_or_operator(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f17(s3); + s0 = peg$f19(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1434,13 +1488,13 @@ function peg$parse(input, options) { function peg$parsetarget() { var s0, s1, s3, s4, s5; s0 = peg$currPos; - if (input.substr(peg$currPos, 6) === peg$c25) { - s1 = peg$c25; + if (input.substr(peg$currPos, 6) === peg$c27) { + s1 = peg$c27; peg$currPos += 6; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { - peg$fail(peg$e32); + peg$fail(peg$e34); } } if (s1 !== peg$FAILED) { @@ -1452,7 +1506,7 @@ function peg$parse(input, options) { s5 = peg$parsequote(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f18(s4); + s0 = peg$f20(s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1474,13 +1528,13 @@ function peg$parse(input, options) { function peg$parsebjorklund() { var s0, s1, s3, s5; s0 = peg$currPos; - if (input.substr(peg$currPos, 6) === peg$c26) { - s1 = peg$c26; + if (input.substr(peg$currPos, 6) === peg$c28) { + s1 = peg$c28; peg$currPos += 6; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { - peg$fail(peg$e33); + peg$fail(peg$e35); } } if (s1 !== peg$FAILED) { @@ -1493,7 +1547,7 @@ function peg$parse(input, options) { peg$parsews(); peg$parseint(); peg$savedPos = s0; - s0 = peg$f19(s3, s5); + s0 = peg$f21(s3, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1511,13 +1565,13 @@ function peg$parse(input, options) { function peg$parseslow() { var s0, s1, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4) === peg$c27) { - s1 = peg$c27; + if (input.substr(peg$currPos, 4) === peg$c29) { + s1 = peg$c29; peg$currPos += 4; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { - peg$fail(peg$e34); + peg$fail(peg$e36); } } if (s1 !== peg$FAILED) { @@ -1525,7 +1579,7 @@ function peg$parse(input, options) { s3 = peg$parsenumber(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f20(s3); + s0 = peg$f22(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1539,13 +1593,13 @@ function peg$parse(input, options) { function peg$parserotL() { var s0, s1, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4) === peg$c28) { - s1 = peg$c28; + if (input.substr(peg$currPos, 4) === peg$c30) { + s1 = peg$c30; peg$currPos += 4; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { - peg$fail(peg$e35); + peg$fail(peg$e37); } } if (s1 !== peg$FAILED) { @@ -1553,7 +1607,7 @@ function peg$parse(input, options) { s3 = peg$parsenumber(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f21(s3); + s0 = peg$f23(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1567,13 +1621,13 @@ function peg$parse(input, options) { function peg$parserotR() { var s0, s1, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4) === peg$c29) { - s1 = peg$c29; + if (input.substr(peg$currPos, 4) === peg$c31) { + s1 = peg$c31; peg$currPos += 4; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { - peg$fail(peg$e36); + peg$fail(peg$e38); } } if (s1 !== peg$FAILED) { @@ -1581,7 +1635,7 @@ function peg$parse(input, options) { s3 = peg$parsenumber(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f22(s3); + s0 = peg$f24(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1595,13 +1649,13 @@ function peg$parse(input, options) { function peg$parsefast() { var s0, s1, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 4) === peg$c30) { - s1 = peg$c30; + if (input.substr(peg$currPos, 4) === peg$c32) { + s1 = peg$c32; peg$currPos += 4; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { - peg$fail(peg$e37); + peg$fail(peg$e39); } } if (s1 !== peg$FAILED) { @@ -1609,7 +1663,7 @@ function peg$parse(input, options) { s3 = peg$parsenumber(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f23(s3); + s0 = peg$f25(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1623,13 +1677,13 @@ function peg$parse(input, options) { function peg$parsescale() { var s0, s1, s3, s4, s5; s0 = peg$currPos; - if (input.substr(peg$currPos, 5) === peg$c31) { - s1 = peg$c31; + if (input.substr(peg$currPos, 5) === peg$c33) { + s1 = peg$c33; peg$currPos += 5; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { - peg$fail(peg$e38); + peg$fail(peg$e40); } } if (s1 !== peg$FAILED) { @@ -1650,7 +1704,7 @@ function peg$parse(input, options) { s5 = peg$parsequote(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f24(s4); + s0 = peg$f26(s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1672,13 +1726,13 @@ function peg$parse(input, options) { function peg$parsecomment() { var s0, s1, s2, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c32) { - s1 = peg$c32; + if (input.substr(peg$currPos, 2) === peg$c34) { + s1 = peg$c34; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { - peg$fail(peg$e39); + peg$fail(peg$e41); } } if (s1 !== peg$FAILED) { @@ -1689,7 +1743,7 @@ function peg$parse(input, options) { } else { s3 = peg$FAILED; if (peg$silentFails === 0) { - peg$fail(peg$e40); + peg$fail(peg$e42); } } while (s3 !== peg$FAILED) { @@ -1700,7 +1754,7 @@ function peg$parse(input, options) { } else { s3 = peg$FAILED; if (peg$silentFails === 0) { - peg$fail(peg$e40); + peg$fail(peg$e42); } } } @@ -1715,13 +1769,13 @@ function peg$parse(input, options) { function peg$parsecat() { var s0, s1, s3, s5, s6, s7, s8, s9; s0 = peg$currPos; - if (input.substr(peg$currPos, 3) === peg$c33) { - s1 = peg$c33; + if (input.substr(peg$currPos, 3) === peg$c35) { + s1 = peg$c35; peg$currPos += 3; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { - peg$fail(peg$e41); + peg$fail(peg$e43); } } if (s1 !== peg$FAILED) { @@ -1746,7 +1800,7 @@ function peg$parse(input, options) { s9 = peg$parsesequence_or_operator(); if (s9 !== peg$FAILED) { peg$savedPos = s7; - s7 = peg$f25(s5, s9); + s7 = peg$f27(s5, s9); } else { peg$currPos = s7; s7 = peg$FAILED; @@ -1763,7 +1817,7 @@ function peg$parse(input, options) { s9 = peg$parsesequence_or_operator(); if (s9 !== peg$FAILED) { peg$savedPos = s7; - s7 = peg$f25(s5, s9); + s7 = peg$f27(s5, s9); } else { peg$currPos = s7; s7 = peg$FAILED; @@ -1785,7 +1839,7 @@ function peg$parse(input, options) { } if (s8 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f26(s5, s6); + s0 = peg$f28(s5, s6); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1825,7 +1879,7 @@ function peg$parse(input, options) { s4 = peg$parsecomment(); } peg$savedPos = s0; - s0 = peg$f27(s1); + s0 = peg$f29(s1); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1836,12 +1890,12 @@ function peg$parse(input, options) { if (s1 !== peg$FAILED) { peg$parsews(); if (input.charCodeAt(peg$currPos) === 36) { - s3 = peg$c34; + s3 = peg$c36; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { - peg$fail(peg$e42); + peg$fail(peg$e44); } } if (s3 !== peg$FAILED) { @@ -1849,7 +1903,7 @@ function peg$parse(input, options) { s5 = peg$parsesequence_or_operator(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f28(s1, s5); + s0 = peg$f30(s1, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1871,7 +1925,7 @@ function peg$parse(input, options) { s1 = peg$parsesequence_or_operator(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f29(s1); + s1 = peg$f31(s1); } s0 = s1; if (s0 === peg$FAILED) { @@ -1898,7 +1952,7 @@ function peg$parse(input, options) { if (s2 !== peg$FAILED) { peg$parsews(); peg$savedPos = s0; - s0 = peg$f30(s2); + s0 = peg$f32(s2); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1908,13 +1962,13 @@ function peg$parse(input, options) { function peg$parsesetcps() { var s0, s1, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 6) === peg$c35) { - s1 = peg$c35; + if (input.substr(peg$currPos, 6) === peg$c37) { + s1 = peg$c37; peg$currPos += 6; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { - peg$fail(peg$e43); + peg$fail(peg$e45); } } if (s1 !== peg$FAILED) { @@ -1922,7 +1976,7 @@ function peg$parse(input, options) { s3 = peg$parsenumber(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f31(s3); + s0 = peg$f33(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1936,13 +1990,13 @@ function peg$parse(input, options) { function peg$parsesetbpm() { var s0, s1, s3; s0 = peg$currPos; - if (input.substr(peg$currPos, 6) === peg$c36) { - s1 = peg$c36; + if (input.substr(peg$currPos, 6) === peg$c38) { + s1 = peg$c38; peg$currPos += 6; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { - peg$fail(peg$e44); + peg$fail(peg$e46); } } if (s1 !== peg$FAILED) { @@ -1950,7 +2004,7 @@ function peg$parse(input, options) { s3 = peg$parsenumber(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f32(s3); + s0 = peg$f34(s3); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1964,18 +2018,18 @@ function peg$parse(input, options) { function peg$parsehush() { var s0, s1; s0 = peg$currPos; - if (input.substr(peg$currPos, 4) === peg$c37) { - s1 = peg$c37; + if (input.substr(peg$currPos, 4) === peg$c39) { + s1 = peg$c39; peg$currPos += 4; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { - peg$fail(peg$e45); + peg$fail(peg$e47); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f33(); + s1 = peg$f35(); } s0 = s1; return s0; @@ -2023,30 +2077,10 @@ function peg$parse(input, options) { ); } } -function getDefaultExportFromCjs(x) { - return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x; -} -function getAugmentedNamespace(n) { - var f = n.default; - if (typeof f == "function") { - var a = function() { - return f.apply(this, arguments); - }; - a.prototype = f.prototype; - } else - a = {}; - Object.defineProperty(a, "__esModule", { value: true }); - Object.keys(n).forEach(function(k) { - var d = Object.getOwnPropertyDescriptor(n, k); - Object.defineProperty(a, k, d.get ? d : { - enumerable: true, - get: function() { - return n[k]; - } - }); - }); - return a; -} +var krillParser = { + SyntaxError: peg$SyntaxError, + parse: peg$parse +}; var fraction$1 = { exports: {} }; /** * @license Fraction.js v4.2.0 05/03/2022 @@ -2084,14 +2118,14 @@ var fraction$1 = { exports: {} }; function factorize(num) { var factors = {}; var n = num; - var i2 = 2; + var i = 2; var s = 4; while (s <= n) { - while (n % i2 === 0) { - n /= i2; - factors[i2] = (factors[i2] || 0) + 1; + while (n % i === 0) { + n /= i; + factors[i] = (factors[i] || 0) + 1; } - s += 1 + 2 * i2++; + s += 1 + 2 * i++; } if (n !== num) { if (n > 1) @@ -2254,20 +2288,20 @@ var fraction$1 = { exports: {} }; if (d === 1) return 0; var rem = 10 % d; - var t2 = 1; - for (; rem !== 1; t2++) { + var t = 1; + for (; rem !== 1; t++) { rem = rem * 10 % d; - if (t2 > MAX_CYCLE_LEN) + if (t > MAX_CYCLE_LEN) return 0; } - return t2; + return t; } function cycleStart(n, d, len) { var rem1 = 1; var rem2 = modpow(10, len, d); - for (var t2 = 0; t2 < 300; t2++) { + for (var t = 0; t < 300; t++) { if (rem1 === rem2) - return t2; + return t; rem1 = rem1 * 10 % d; rem2 = rem2 * 10 % d; } @@ -2443,8 +2477,8 @@ var fraction$1 = { exports: {} }; }, "compare": function(a, b) { parse(a, b); - var t2 = this["s"] * this["n"] * P["d"] - P["s"] * P["n"] * this["d"]; - return (0 < t2) - (t2 < 0); + var t = this["s"] * this["n"] * P["d"] - P["s"] * P["n"] * this["d"]; + return (0 < t) - (t < 0); }, "simplify": function(eps) { if (isNaN(this["n"]) || isNaN(this["d"])) { @@ -2453,9 +2487,9 @@ var fraction$1 = { exports: {} }; eps = eps || 1e-3; var thisABS = this["abs"](); var cont = thisABS["toContinued"](); - for (var i2 = 1; i2 < cont.length; i2++) { - var s = newFraction(cont[i2 - 1], 1); - for (var k = i2 - 2; k >= 0; k--) { + for (var i = 1; i < cont.length; i++) { + var s = newFraction(cont[i - 1], 1); + for (var k = i - 2; k >= 0; k--) { s = s["inverse"]()["add"](cont[k]); } if (s["sub"](thisABS)["abs"]().valueOf() < eps) { @@ -2515,7 +2549,7 @@ var fraction$1 = { exports: {} }; return str; }, "toContinued": function() { - var t2; + var t; var a = this["n"]; var b = this["d"]; var res = []; @@ -2524,9 +2558,9 @@ var fraction$1 = { exports: {} }; } do { res.push(Math.floor(a / b)); - t2 = a % b; + t = a % b; a = b; - b = t2; + b = t; } while (a !== 1); return res; }, @@ -2546,20 +2580,20 @@ var fraction$1 = { exports: {} }; if (N) str += "."; if (cycLen) { - for (var i2 = cycOff; i2--; ) { + for (var i = cycOff; i--; ) { str += N / D | 0; N %= D; N *= 10; } str += "("; - for (var i2 = cycLen; i2--; ) { + for (var i = cycLen; i--; ) { str += N / D | 0; N %= D; N *= 10; } str += ")"; } else { - for (var i2 = dec; N && i2--; ) { + for (var i = dec; N && i--; ) { str += N / D | 0; N %= D; N *= 10; @@ -2847,7 +2881,7 @@ const removeUndefineds = (xs) => xs.filter((x) => x != void 0); const flatten = (arr) => [].concat(...arr); const id = (a) => a; const constant = (a, b) => a; -const listRange = (min, max) => Array.from({ length: max - min + 1 }, (_, i2) => i2 + min); +const listRange = (min, max) => Array.from({ length: max - min + 1 }, (_, i) => i + min); function curry(func, overload) { const fn = function curried(...args) { if (args.length >= func.length) { @@ -2885,15 +2919,15 @@ function drawLine(pat, chars = 60) { const totalSlots = charFraction.inverse(); lines = lines.map((line) => line + "|"); emptyLine += "|"; - for (let i2 = 0; i2 < totalSlots; i2++) { + for (let i = 0; i < totalSlots; i++) { const [begin, end] = [pos, pos.add(charFraction)]; const matches = haps.filter((hap) => hap.whole.begin.lte(begin) && hap.whole.end.gte(end)); const missingLines = matches.length - lines.length; if (missingLines > 0) { lines = lines.concat(Array(missingLines).fill(emptyLine)); } - lines = lines.map((line, i3) => { - const hap = matches[i3]; + lines = lines.map((line, i2) => { + const hap = matches[i2]; if (hap) { const isOnset = hap.whole.begin.eq(begin); const char = isOnset ? "" + hap.value : "-"; @@ -2908,7 +2942,7 @@ function drawLine(pat, chars = 60) { } return lines.join("\n"); } -class Pattern$2 { +class Pattern$1 { constructor(query) { __publicField(this, "_Pattern", true); this.query = query; @@ -2921,22 +2955,22 @@ class Pattern$2 { const q = (state) => { return flatten(state.span.spanCycles.map((subspan) => pat.query(state.setSpan(subspan)))); }; - return new Pattern$2(q); + return new Pattern$1(q); } withQuerySpan(func) { - return new Pattern$2((state) => this.query(state.withSpan(func))); + return new Pattern$1((state) => this.query(state.withSpan(func))); } withQueryTime(func) { - return new Pattern$2((state) => this.query(state.withSpan((span) => span.withTime(func)))); + return new Pattern$1((state) => this.query(state.withSpan((span) => span.withTime(func)))); } withHapSpan(func) { - return new Pattern$2((state) => this.query(state).map((hap) => hap.withSpan(func))); + return new Pattern$1((state) => this.query(state).map((hap) => hap.withSpan(func))); } withHapTime(func) { return this.withHapSpan((span) => span.withTime(func)); } _withHaps(func) { - return new Pattern$2((state) => func(this.query(state))); + return new Pattern$1((state) => func(this.query(state))); } _withHap(func) { return this._withHaps((haps) => haps.map(func)); @@ -2986,16 +3020,16 @@ class Pattern$2 { }); } withValue(func) { - return new Pattern$2((state) => this.query(state).map((hap) => hap.withValue(func))); + return new Pattern$1((state) => this.query(state).map((hap) => hap.withValue(func))); } fmap(func) { return this.withValue(func); } _filterHaps(hap_test) { - return new Pattern$2((state) => this.query(state).filter(hap_test)); + return new Pattern$1((state) => this.query(state).filter(hap_test)); } _filterValues(value_test) { - return new Pattern$2((state) => this.query(state).filter((hap) => value_test(hap.value))); + return new Pattern$1((state) => this.query(state).filter((hap) => value_test(hap.value))); } _removeUndefineds() { return this._filterValues((val) => val != void 0); @@ -3027,7 +3061,7 @@ class Pattern$2 { hap_funcs.map((hap_func) => removeUndefineds(hap_vals.map((hap_val) => apply(hap_func, hap_val)))) ); }; - return new Pattern$2(query); + return new Pattern$1(query); } appBoth(pat_val) { const whole_func = function(span_a, span_b) { @@ -3057,7 +3091,7 @@ class Pattern$2 { } return haps; }; - return new Pattern$2(query); + return new Pattern$1(query); } appRight(pat_val) { const pat_func = this; @@ -3078,7 +3112,7 @@ class Pattern$2 { } return haps; }; - return new Pattern$2(query); + return new Pattern$1(query); } firstCycle(with_context = false) { var self = this; @@ -3195,7 +3229,7 @@ class Pattern$2 { }; return flatten(pat_val.query(state).map((a) => match(a))); }; - return new Pattern$2(query); + return new Pattern$1(query); } bind(func) { const whole_func = function(a, b) { @@ -3223,7 +3257,7 @@ class Pattern$2 { } _trigJoin(cycleZero = false) { const pat_of_pats = this; - return new Pattern$2((state) => { + return new Pattern$1((state) => { return pat_of_pats.discreteOnly().query(state).map((outer_hap) => { return outer_hap.value.late(cycleZero ? outer_hap.whole.begin : outer_hap.whole.begin.cyclePos()).query(state).map( (inner_hap) => new Hap( @@ -3265,7 +3299,7 @@ class Pattern$2 { const result = flatten(haps.map(flatHap)); return result.filter((x) => x); } - return new Pattern$2(query); + return new Pattern$1(query); } _squeezeBind(func) { return this.fmap(func)._squeezeJoin(); @@ -3310,8 +3344,8 @@ class Pattern$2 { return this._compress(span.begin, span.end); } _fast(factor) { - const fastQuery = this.withQueryTime((t2) => t2.mul(factor)); - return fastQuery.withHapTime((t2) => t2.div(factor)); + const fastQuery = this.withQueryTime((t) => t.mul(factor)); + return fastQuery.withHapTime((t) => t.div(factor)); } _slow(factor) { return this._fast(fraction(1).div(factor)); @@ -3326,16 +3360,16 @@ class Pattern$2 { return this.fmap((x) => pure$1(x)._fast(factor))._squeezeJoin(); } _chop(n) { - const slices = Array.from({ length: n }, (x, i2) => i2); - const slice_objects = slices.map((i2) => ({ begin: i2 / n, end: (i2 + 1) / n })); + const slices = Array.from({ length: n }, (x, i) => i); + const slice_objects = slices.map((i) => ({ begin: i / n, end: (i + 1) / n })); const func = function(o) { return sequence$1(slice_objects.map((slice_o) => Object.assign({}, o, slice_o))); }; return this._squeezeBind(func); } _striate(n) { - const slices = Array.from({ length: n }, (x, i2) => i2); - const slice_objects = slices.map((i2) => ({ begin: i2 / n, end: (i2 + 1) / n })); + const slices = Array.from({ length: n }, (x, i) => i); + const slice_objects = slices.map((i) => ({ begin: i / n, end: (i + 1) / n })); const slicePat = slowcat$1(...slice_objects); return this.set(slicePat)._fast(n); } @@ -3344,7 +3378,7 @@ class Pattern$2 { } _early(offset) { offset = fraction(offset); - return this.withQueryTime((t2) => t2.add(offset)).withHapTime((t2) => t2.sub(offset)); + return this.withQueryTime((t) => t.add(offset)).withHapTime((t) => t.sub(offset)); } _late(offset) { offset = fraction(offset); @@ -3354,18 +3388,18 @@ class Pattern$2 { e = fraction(e); s = fraction(s); const d = e.sub(s); - return this.withQuerySpan((span) => span.withCycle((t2) => t2.mul(d).add(s))).withHapSpan((span) => span.withCycle((t2) => t2.sub(s).div(d)))._splitQueries(); + return this.withQuerySpan((span) => span.withCycle((t) => t.mul(d).add(s))).withHapSpan((span) => span.withCycle((t) => t.sub(s).div(d)))._splitQueries(); } _zoomArc(a) { return this.zoom(a.begin, a.end); } - _linger(t2) { - if (t2 == 0) { + _linger(t) { + if (t == 0) { return silence$1; - } else if (t2 < 0) { - return this._zoom(t2.add(1), 1)._slow(t2); + } else if (t < 0) { + return this._zoom(t.add(1), 1)._slow(t); } - return this._zoom(0, t2)._slow(t2); + return this._zoom(0, t)._slow(t); } _color(color) { return this._withContext((context) => ({ ...context, color })); @@ -3424,7 +3458,7 @@ class Pattern$2 { const haps = pat.query(state.setSpan(reflect(span))); return haps.map((hap) => hap.withSpan(reflect)); }; - return new Pattern$2(query)._splitQueries(); + return new Pattern$1(query)._splitQueries(); } palindrome() { return this.every(2, rev); @@ -3466,19 +3500,19 @@ class Pattern$2 { return this.stack(...funcs.map((func) => func(this))); } stutWith(times, time2, func) { - return stack$1(...listRange(0, times - 1).map((i2) => func(this.late(fraction(time2).mul(i2)), i2))); + return stack$1(...listRange(0, times - 1).map((i) => func(this.late(fraction(time2).mul(i)), i))); } stut(times, feedback, time2) { - return this.stutWith(times, time2, (pat, i2) => pat.velocity(Math.pow(feedback, i2))); + return this.stutWith(times, time2, (pat, i) => pat.velocity(Math.pow(feedback, i))); } _echoWith(times, time2, func) { - return stack$1(...listRange(0, times - 1).map((i2) => func(this.late(fraction(time2).mul(i2)), i2))); + return stack$1(...listRange(0, times - 1).map((i) => func(this.late(fraction(time2).mul(i)), i))); } _echo(times, time2, feedback) { - return this._echoWith(times, time2, (pat, i2) => pat.velocity(Math.pow(feedback, i2))); + return this._echoWith(times, time2, (pat, i) => pat.velocity(Math.pow(feedback, i))); } iter(times, back = false) { - return slowcat$1(...listRange(0, times - 1).map((i2) => back ? this.late(i2 / times) : this.early(i2 / times))); + return slowcat$1(...listRange(0, times - 1).map((i) => back ? this.late(i / times) : this.early(i / times))); } iterBack(times) { return this.iter(times, true); @@ -3578,7 +3612,7 @@ function _composeOp(a, b, func) { }; for (const [what, [op, preprocess]] of Object.entries(composers)) { for (const how of ["In", "Out", "Mix", "Squeeze", "SqueezeOut", "Trig", "Trigzero"]) { - Pattern$2.prototype[what + how] = function(...other) { + Pattern$1.prototype[what + how] = function(...other) { var pat = this; other = sequence$1(other); if (preprocess) { @@ -3592,27 +3626,27 @@ function _composeOp(a, b, func) { return result; }; if (how === "Squeeze") { - Pattern$2.prototype[what + "SqueezeIn"] = Pattern$2.prototype[what + how]; + Pattern$1.prototype[what + "SqueezeIn"] = Pattern$1.prototype[what + how]; } if (how === "In") { - Pattern$2.prototype[what] = Pattern$2.prototype[what + how]; + Pattern$1.prototype[what] = Pattern$1.prototype[what + how]; } else { if (what === "set") { - Pattern$2.prototype[how.toLowerCase()] = Pattern$2.prototype[what + how]; + Pattern$1.prototype[how.toLowerCase()] = Pattern$1.prototype[what + how]; } } } } - Pattern$2.prototype.struct = Pattern$2.prototype.keepifOut; - Pattern$2.prototype.structAll = Pattern$2.prototype.keepOut; - Pattern$2.prototype.mask = Pattern$2.prototype.keepifIn; - Pattern$2.prototype.maskAll = Pattern$2.prototype.keepIn; - Pattern$2.prototype.reset = Pattern$2.prototype.keepifTrig; - Pattern$2.prototype.resetAll = Pattern$2.prototype.keepTrig; - Pattern$2.prototype.restart = Pattern$2.prototype.keepifTrigzero; - Pattern$2.prototype.restartAll = Pattern$2.prototype.keepTrigzero; + Pattern$1.prototype.struct = Pattern$1.prototype.keepifOut; + Pattern$1.prototype.structAll = Pattern$1.prototype.keepOut; + Pattern$1.prototype.mask = Pattern$1.prototype.keepifIn; + Pattern$1.prototype.maskAll = Pattern$1.prototype.keepIn; + Pattern$1.prototype.reset = Pattern$1.prototype.keepifTrig; + Pattern$1.prototype.resetAll = Pattern$1.prototype.keepTrig; + Pattern$1.prototype.restart = Pattern$1.prototype.keepifTrigzero; + Pattern$1.prototype.restartAll = Pattern$1.prototype.keepTrigzero; })(); -Pattern$2.prototype.patternified = [ +Pattern$1.prototype.patternified = [ "apply", "chop", "color", @@ -3630,7 +3664,7 @@ Pattern$2.prototype.patternified = [ "slow", "velocity" ]; -Pattern$2.prototype.factories = { +Pattern$1.prototype.factories = { pure: pure$1, stack: stack$1, slowcat: slowcat$1, @@ -3638,22 +3672,22 @@ Pattern$2.prototype.factories = { cat, timeCat: timeCat$1, sequence: sequence$1, - seq: seq$2, + seq, polymeter, pm, polyrhythm, pr }; -const silence$1 = new Pattern$2((_) => []); +const silence$1 = new Pattern$1((_) => []); function pure$1(value) { function query(state) { return state.span.spanCycles.map((subspan) => new Hap(fraction(subspan.begin).wholeCycle(), subspan, value)); } - return new Pattern$2(query); + return new Pattern$1(query); } function isPattern(thing) { - const is = thing instanceof Pattern$2 || thing._Pattern; - if (!thing instanceof Pattern$2) { + const is = thing instanceof Pattern$1 || thing._Pattern; + if (!thing instanceof Pattern$1) { console.warn( `Found Pattern that fails "instanceof Pattern" check. This may happen if you are using multiple versions of @strudel.cycles/core. @@ -3671,7 +3705,7 @@ function reify$2(thing) { function stack$1(...pats) { pats = pats.map((pat) => Array.isArray(pat) ? sequence$1(...pat) : reify$2(pat)); const query = (state) => flatten(pats.map((pat) => pat.query(state))); - return new Pattern$2(query); + return new Pattern$1(query); } function slowcat$1(...pats) { pats = pats.map((pat) => Array.isArray(pat) ? sequence$1(...pat) : reify$2(pat)); @@ -3683,9 +3717,9 @@ function slowcat$1(...pats) { return []; } const offset = span.begin.floor().sub(span.begin.div(pats.length).floor()); - return pat.withHapTime((t2) => t2.add(offset)).query(state.setSpan(span.withTime((t2) => t2.sub(offset)))); + return pat.withHapTime((t) => t.add(offset)).query(state.setSpan(span.withTime((t) => t.sub(offset)))); }; - return new Pattern$2(query)._splitQueries(); + return new Pattern$1(query)._splitQueries(); } function slowcatPrime(...pats) { pats = pats.map(reify$2); @@ -3694,7 +3728,7 @@ function slowcatPrime(...pats) { const pat = pats[pat_n]; return (pat == null ? void 0 : pat.query(state)) || []; }; - return new Pattern$2(query)._splitQueries(); + return new Pattern$1(query)._splitQueries(); } function fastcat(...pats) { return slowcat$1(...pats)._fast(pats.length); @@ -3716,7 +3750,7 @@ function timeCat$1(...timepats) { function sequence$1(...pats) { return fastcat(...pats); } -function seq$2(...pats) { +function seq(...pats) { return fastcat(...pats); } function _sequenceCount(x) { @@ -3775,7 +3809,7 @@ const chunkBack = curry((a, pat) => pat.chunkBack(a)); const div = curry((a, pat) => pat.div(a)); const early = curry((a, pat) => pat.early(a)); const echo = curry((a, b, c, pat) => pat.echo(a, b, c)); -const every = curry((i2, f, pat) => pat.every(i2, f)); +const every = curry((i, f, pat) => pat.every(i, f)); const fast = curry((a, pat) => pat.fast(a)); const inv = (pat) => pat.inv(); const invert = (pat) => pat.invert(); @@ -3787,7 +3821,7 @@ const late = curry((a, pat) => pat.late(a)); const linger = curry((a, pat) => pat.linger(a)); const mask = curry((a, pat) => pat.mask(a)); const mul = curry((a, pat) => pat.mul(a)); -const off = curry((t2, f, pat) => pat.off(t2, f)); +const off = curry((t, f, pat) => pat.off(t, f)); const ply = curry((a, pat) => pat.ply(a)); const range = curry((a, b, pat) => pat.range(a, b)); const range2 = curry((a, b, pat) => pat.range2(a, b)); @@ -3798,9 +3832,9 @@ const sub = curry((a, pat) => pat.sub(a)); const superimpose = curry((array, pat) => pat.superimpose(...array)); const set = curry((a, pat) => pat.set(a)); const when = curry((binary, f, pat) => pat.when(binary, f)); -Pattern$2.prototype.composable = { fast, slow, early, late, superimpose }; +Pattern$1.prototype.composable = { fast, slow, early, late, superimpose }; function makeComposable(func) { - Object.entries(Pattern$2.prototype.composable).forEach(([functionName, composable]) => { + Object.entries(Pattern$1.prototype.composable).forEach(([functionName, composable]) => { func[functionName] = (...args) => { const composition = compose(func, composable(...args)); return makeComposable(composition); @@ -3811,69 +3845,69 @@ function makeComposable(func) { const patternify2 = (f) => (pata, patb, pat) => pata.fmap((a) => (b) => f.call(pat, a, b)).appLeft(patb).innerJoin(); const patternify3 = (f) => (pata, patb, patc, pat) => pata.fmap((a) => (b) => (c) => f.call(pat, a, b, c)).appLeft(patb).appLeft(patc).innerJoin(); const patternify4 = (f) => (pata, patb, patc, patd, pat) => pata.fmap((a) => (b) => (c) => (d) => f.call(pat, a, b, c, d)).appLeft(patb).appLeft(patc).appLeft(patd).innerJoin(); -Pattern$2.prototype.echo = function(...args) { +Pattern$1.prototype.echo = function(...args) { args = args.map(reify$2); - return patternify3(Pattern$2.prototype._echo)(...args, this); + return patternify3(Pattern$1.prototype._echo)(...args, this); }; -Pattern$2.prototype.echoWith = function(...args) { +Pattern$1.prototype.echoWith = function(...args) { args = args.map(reify$2); - return patternify3(Pattern$2.prototype._echoWith)(...args, this); + return patternify3(Pattern$1.prototype._echoWith)(...args, this); }; -Pattern$2.prototype.chunk = function(...args) { +Pattern$1.prototype.chunk = function(...args) { args = args.map(reify$2); - return patternify2(Pattern$2.prototype._chunk)(...args, this); + return patternify2(Pattern$1.prototype._chunk)(...args, this); }; -Pattern$2.prototype.chunkBack = function(...args) { +Pattern$1.prototype.chunkBack = function(...args) { args = args.map(reify$2); - return patternify2(Pattern$2.prototype._chunkBack)(...args, this); + return patternify2(Pattern$1.prototype._chunkBack)(...args, this); }; -Pattern$2.prototype.loopAt = function(...args) { +Pattern$1.prototype.loopAt = function(...args) { args = args.map(reify$2); - return patternify2(Pattern$2.prototype._loopAt)(...args, this); + return patternify2(Pattern$1.prototype._loopAt)(...args, this); }; -Pattern$2.prototype.zoom = function(...args) { +Pattern$1.prototype.zoom = function(...args) { args = args.map(reify$2); - return patternify2(Pattern$2.prototype._zoom)(...args, this); + return patternify2(Pattern$1.prototype._zoom)(...args, this); }; -Pattern$2.prototype.compress = function(...args) { +Pattern$1.prototype.compress = function(...args) { args = args.map(reify$2); - return patternify2(Pattern$2.prototype._compress)(...args, this); + return patternify2(Pattern$1.prototype._compress)(...args, this); }; -Pattern$2.prototype.outside = function(...args) { +Pattern$1.prototype.outside = function(...args) { args = args.map(reify$2); - return patternify2(Pattern$2.prototype._outside)(...args, this); + return patternify2(Pattern$1.prototype._outside)(...args, this); }; -Pattern$2.prototype.inside = function(...args) { +Pattern$1.prototype.inside = function(...args) { args = args.map(reify$2); - return patternify2(Pattern$2.prototype._inside)(...args, this); + return patternify2(Pattern$1.prototype._inside)(...args, this); }; -Pattern$2.prototype.bootstrap = function() { +Pattern$1.prototype.bootstrap = function() { const bootstrapped = Object.fromEntries( - Object.entries(Pattern$2.prototype.composable).map(([functionName, composable]) => { - if (Pattern$2.prototype[functionName]) { - Pattern$2.prototype[functionName] = makeComposable(Pattern$2.prototype[functionName]); + Object.entries(Pattern$1.prototype.composable).map(([functionName, composable]) => { + if (Pattern$1.prototype[functionName]) { + Pattern$1.prototype[functionName] = makeComposable(Pattern$1.prototype[functionName]); } return [functionName, curry(composable, makeComposable)]; }) ); this.patternified.forEach((prop) => { - Pattern$2.prototype[prop] = function(...args) { - return this._patternify(Pattern$2.prototype["_" + prop])(...args); + Pattern$1.prototype[prop] = function(...args) { + return this._patternify(Pattern$1.prototype["_" + prop])(...args); }; }); return bootstrapped; }; -Pattern$2.prototype.define = (name, func, options = {}) => { +Pattern$1.prototype.define = (name, func, options = {}) => { if (options.composable) { - Pattern$2.prototype.composable[name] = func; + Pattern$1.prototype.composable[name] = func; } if (options.patternified) { - Pattern$2.prototype.patternified = Pattern$2.prototype.patternified.concat([name]); + Pattern$1.prototype.patternified = Pattern$1.prototype.patternified.concat([name]); } - Pattern$2.prototype.bootstrap(); + Pattern$1.prototype.bootstrap(); }; -Pattern$2.prototype.define("hush", (pat) => pat.hush(), { patternified: false, composable: true }); -Pattern$2.prototype.define("bypass", (pat) => pat.bypass(on), { patternified: true, composable: true }); +Pattern$1.prototype.define("hush", (pat) => pat.hush(), { patternified: false, composable: true }); +Pattern$1.prototype.define("bypass", (pat) => pat.bypass(on), { patternified: true, composable: true }); const controls = {}; const generic_params = [ ["s", "s", "sound"], @@ -4120,11 +4154,11 @@ const _setter = (func, name) => function(...pats) { }; generic_params.forEach(([type, name, description]) => { controls[name] = (...pats) => _name(name, ...pats); - Pattern$2.prototype[name] = _setter(controls[name], name); + Pattern$1.prototype[name] = _setter(controls[name], name); }); controls.createParam = (name) => { const func = (...pats) => _name(name, ...pats); - Pattern$2.prototype[name] = _setter(func, name); + Pattern$1.prototype[name] = _setter(func, name); return (...pats) => _name(name, ...pats); }; controls.createParams = (...names) => names.reduce((acc, name) => Object.assign(acc, { [name]: createParam(name) }), {}); @@ -4166,31 +4200,31 @@ const euclid = (pulses, steps, rotation = 0) => { } return b; }; -Pattern$2.prototype.euclid = function(pulses, steps, rotation = 0) { +Pattern$1.prototype.euclid = function(pulses, steps, rotation = 0) { return this.struct(euclid(pulses, steps, rotation)); }; -Pattern$2.prototype.euclidLegato = function(pulses, steps, rotation = 0) { +Pattern$1.prototype.euclidLegato = function(pulses, steps, rotation = 0) { const bin_pat = euclid(pulses, steps, rotation); const firstOne = bin_pat.indexOf(1); const gapless = rotate(bin_pat, firstOne).join("").split("1").slice(1).map((s) => [s.length + 1, true]); return this.struct(timeCat$1(...gapless)).late(fraction(firstOne).div(steps)); }; function steady(value) { - return new Pattern$2((state) => [new Hap(void 0, state.span, value)]); + return new Pattern$1((state) => [new Hap(void 0, state.span, value)]); } const signal = (func) => { const query = (state) => [new Hap(void 0, state.span, func(state.span.midpoint()))]; - return new Pattern$2(query); + return new Pattern$1(query); }; -const isaw = signal((t2) => 1 - t2 % 1); +const isaw = signal((t) => 1 - t % 1); const isaw2 = isaw._toBipolar(); -const saw = signal((t2) => t2 % 1); +const saw = signal((t) => t % 1); const saw2 = saw._toBipolar(); -const sine2 = signal((t2) => Math.sin(Math.PI * 2 * t2)); +const sine2 = signal((t) => Math.sin(Math.PI * 2 * t)); const sine = sine2._fromBipolar(); const cosine = sine._early(fraction(1).div(4)); const cosine2 = sine2._early(fraction(1).div(4)); -const square = signal((t2) => Math.floor(t2 * 2 % 2)); +const square = signal((t) => Math.floor(t * 2 % 2)); const square2 = square._toBipolar(); const tri = fastcat(isaw, saw); const tri2 = fastcat(isaw2, saw2); @@ -4206,17 +4240,17 @@ const intSeedToRand = (x) => x % 536870912 / 536870912; const timeToRand = (x) => Math.abs(intSeedToRand(timeToIntSeed(x))); const rand = signal(timeToRand); const rand2 = rand._toBipolar(); -const _brandBy = (p2) => rand.fmap((x) => x < p2); +const _brandBy = (p) => rand.fmap((x) => x < p); const brandBy = (pPat) => reify$2(pPat).fmap(_brandBy).innerJoin(); const brand = _brandBy(0.5); -const _irand = (i2) => rand.fmap((x) => Math.trunc(x * i2)); +const _irand = (i) => rand.fmap((x) => Math.trunc(x * i)); const irand = (ipat) => reify$2(ipat).fmap(_irand).innerJoin(); const __chooseWith = (pat, xs) => { xs = xs.map(reify$2); if (xs.length == 0) { return silence$1; } - return pat.range(0, xs.length).fmap((i2) => xs[Math.floor(i2)]); + return pat.range(0, xs.length).fmap((i) => xs[Math.floor(i)]); }; const chooseWith = (pat, xs) => { return __chooseWith(pat, xs).outerJoin(); @@ -4225,10 +4259,10 @@ const chooseInWith = (pat, xs) => { return __chooseWith(pat, xs).innerJoin(); }; const choose = (...xs) => chooseWith(rand, xs); -Pattern$2.prototype.choose = function(...xs) { +Pattern$1.prototype.choose = function(...xs) { return chooseWith(this, xs); }; -Pattern$2.prototype.choose2 = function(...xs) { +Pattern$1.prototype.choose2 = function(...xs) { return chooseWith(this._fromBipolar(), xs); }; const chooseCycles = (...xs) => chooseInWith(rand.segment(1), xs); @@ -4253,82 +4287,82 @@ const wchoose = (...pairs) => wchooseWith(rand, ...pairs); const wchooseCycles = (...pairs) => _wchooseWith(rand, ...pairs).innerJoin(); const perlinWith = (pat) => { const pata = pat.fmap(Math.floor); - const patb = pat.fmap((t2) => Math.floor(t2) + 1); + const patb = pat.fmap((t) => Math.floor(t) + 1); const smootherStep = (x) => 6 * x ** 5 - 15 * x ** 4 + 10 * x ** 3; const interp = (x) => (a) => (b) => a + smootherStep(x) * (b - a); return pat.sub(pata).fmap(interp).appBoth(pata.fmap(timeToRand)).appBoth(patb.fmap(timeToRand)); }; const perlin = perlinWith(time); -Pattern$2.prototype._degradeByWith = function(withPat, x) { +Pattern$1.prototype._degradeByWith = function(withPat, x) { return this.fmap((a) => (_) => a).appLeft(withPat._filterValues((v) => v > x)); }; -Pattern$2.prototype._degradeBy = function(x) { +Pattern$1.prototype._degradeBy = function(x) { return this._degradeByWith(rand, x); }; -Pattern$2.prototype.degrade = function() { +Pattern$1.prototype.degrade = function() { return this._degradeBy(0.5); }; -Pattern$2.prototype._undegradeBy = function(x) { +Pattern$1.prototype._undegradeBy = function(x) { return this._degradeByWith( rand.fmap((r) => 1 - r), x ); }; -Pattern$2.prototype.undegrade = function() { +Pattern$1.prototype.undegrade = function() { return this._undegradeBy(0.5); }; -Pattern$2.prototype._sometimesBy = function(x, func) { +Pattern$1.prototype._sometimesBy = function(x, func) { return stack$1(this._degradeBy(x), func(this._undegradeBy(1 - x))); }; -Pattern$2.prototype.sometimesBy = function(patx, func) { +Pattern$1.prototype.sometimesBy = function(patx, func) { const pat = this; return reify$2(patx).fmap((x) => pat._sometimesBy(x, func)).innerJoin(); }; -Pattern$2.prototype._sometimesByPre = function(x, func) { +Pattern$1.prototype._sometimesByPre = function(x, func) { return stack$1(this._degradeBy(x), func(this).undegradeBy(1 - x)); }; -Pattern$2.prototype.sometimesByPre = function(patx, func) { +Pattern$1.prototype.sometimesByPre = function(patx, func) { const pat = this; return reify$2(patx).fmap((x) => pat._sometimesByPre(x, func)).innerJoin(); }; -Pattern$2.prototype.sometimes = function(func) { +Pattern$1.prototype.sometimes = function(func) { return this._sometimesBy(0.5, func); }; -Pattern$2.prototype.sometimesPre = function(func) { +Pattern$1.prototype.sometimesPre = function(func) { return this._sometimesByPre(0.5, func); }; -Pattern$2.prototype._someCyclesBy = function(x, func) { +Pattern$1.prototype._someCyclesBy = function(x, func) { return stack$1( this._degradeByWith(rand._segment(1), x), func(this._degradeByWith(rand.fmap((r) => 1 - r)._segment(1), 1 - x)) ); }; -Pattern$2.prototype.someCyclesBy = function(patx, func) { +Pattern$1.prototype.someCyclesBy = function(patx, func) { const pat = this; return reify$2(patx).fmap((x) => pat._someCyclesBy(x, func)).innerJoin(); }; -Pattern$2.prototype.someCycles = function(func) { +Pattern$1.prototype.someCycles = function(func) { return this._someCyclesBy(0.5, func); }; -Pattern$2.prototype.often = function(func) { +Pattern$1.prototype.often = function(func) { return this.sometimesBy(0.75, func); }; -Pattern$2.prototype.rarely = function(func) { +Pattern$1.prototype.rarely = function(func) { return this.sometimesBy(0.25, func); }; -Pattern$2.prototype.almostNever = function(func) { +Pattern$1.prototype.almostNever = function(func) { return this.sometimesBy(0.1, func); }; -Pattern$2.prototype.almostAlways = function(func) { +Pattern$1.prototype.almostAlways = function(func) { return this.sometimesBy(0.9, func); }; -Pattern$2.prototype.never = function(func) { +Pattern$1.prototype.never = function(func) { return this; }; -Pattern$2.prototype.always = function(func) { +Pattern$1.prototype.always = function(func) { return func(this); }; -Pattern$2.prototype.patternified.push("degradeBy", "undegradeBy"); +Pattern$1.prototype.patternified.push("degradeBy", "undegradeBy"); let synth; try { synth = window == null ? void 0 : window.speechSynthesis; @@ -4349,7 +4383,7 @@ function speak(words, lang, voice) { } speechSynthesis.speak(utterance); } -Pattern$2.prototype._speak = function(lang, voice) { +Pattern$1.prototype._speak = function(lang, voice) { return this._withHap((hap) => { const onTrigger = (time2, hap2) => { speak(hap2.value, lang, voice); @@ -4357,8 +4391,8 @@ Pattern$2.prototype._speak = function(lang, voice) { return hap.setContext({ ...hap.context, onTrigger }); }); }; -Pattern$2.prototype.speak = function(lang, voice) { - return patternify2(Pattern$2.prototype._speak)(reify(lang), reify(voice), this); +Pattern$1.prototype.speak = function(lang, voice) { + return patternify2(Pattern$1.prototype._speak)(reify(lang), reify(voice), this); }; const gist = (route, cache = true) => fetch(`https://gist.githubusercontent.com/${route}?cachebust=${cache ? "" : Date.now()}`).then((res) => res.text()).then((code) => eval(code)); console.log( @@ -4378,7 +4412,7 @@ const strudel = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope Fraction: fraction, gist, Hap, - Pattern: Pattern$2, + Pattern: Pattern$1, silence: silence$1, pure: pure$1, isPattern, @@ -4390,7 +4424,7 @@ const strudel = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope cat, timeCat: timeCat$1, sequence: sequence$1, - seq: seq$2, + seq, polymeterSteps, polymeter, pm, @@ -4483,22824 +4517,146 @@ const strudel = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope listRange, curry }, Symbol.toStringTag, { value: "Module" })); -var dist$b = {}; -var tokenizer$1 = {}; -var utils$3 = {}; -var unicode$5 = {}; -var idContinueBool_1$2; -var idContinueLargeRegex_1$2; -var idStartBool_1$2; -var idStartLargeRegex_1$2; -var whitespaceBool_1$2; -var whitespaceArray_1$2; -Object.defineProperty(unicode$5, "__esModule", { - value: true -}); -whitespaceArray_1$2 = unicode$5.whitespaceArray = [5760, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8239, 8287, 12288, 65279]; -whitespaceBool_1$2 = unicode$5.whitespaceBool = [false, false, false, false, false, false, false, false, false, true, false, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false]; -idStartLargeRegex_1$2 = unicode$5.idStartLargeRegex = /^[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\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\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\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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-\u2C2E\u2C30-\u2C5E\u2C60-\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-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]$/; -idStartBool_1$2 = unicode$5.idStartBool = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, false]; -idContinueLargeRegex_1$2 = unicode$5.idContinueLargeRegex = /^[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]$/; -idContinueBool_1$2 = unicode$5.idContinueBool = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, true, true, true, true, true, true, true, true, true, true, false, false, false, false, false, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, false]; -const unicode$4 = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - get whitespaceArray() { - return whitespaceArray_1$2; - }, - get whitespaceBool() { - return whitespaceBool_1$2; - }, - get idStartLargeRegex() { - return idStartLargeRegex_1$2; - }, - get idStartBool() { - return idStartBool_1$2; - }, - get idContinueLargeRegex() { - return idContinueLargeRegex_1$2; - }, - get idContinueBool() { - return idContinueBool_1$2; - }, - default: unicode$5 -}, [unicode$5]); -const require$$0$a = /* @__PURE__ */ getAugmentedNamespace(unicode$4); -Object.defineProperty(utils$3, "__esModule", { - value: true -}); -var isStrictModeReservedWord_1 = utils$3.isStrictModeReservedWord = isStrictModeReservedWord; -var isWhiteSpace_1 = utils$3.isWhiteSpace = isWhiteSpace; -var isLineTerminator_1 = utils$3.isLineTerminator = isLineTerminator; -var isIdentifierStart_1 = utils$3.isIdentifierStart = isIdentifierStart$1; -var isIdentifierPart_1 = utils$3.isIdentifierPart = isIdentifierPart$1; -var isDecimalDigit_1 = utils$3.isDecimalDigit = isDecimalDigit; -var getHexValue_1 = utils$3.getHexValue = getHexValue; -var _unicode$2 = require$$0$a; -var strictReservedWords = ["null", "true", "false", "implements", "interface", "package", "private", "protected", "public", "static", "let", "if", "in", "do", "var", "for", "new", "try", "this", "else", "case", "void", "with", "enum", "while", "break", "catch", "throw", "const", "yield", "class", "super", "return", "typeof", "delete", "switch", "export", "import", "default", "finally", "extends", "function", "continue", "debugger", "instanceof"]; -function isStrictModeReservedWord(id2) { - return strictReservedWords.indexOf(id2) !== -1; -} -function isWhiteSpace(ch) { - return ch < 128 ? _unicode$2.whitespaceBool[ch] : ch === 160 || ch > 5759 && _unicode$2.whitespaceArray.indexOf(ch) !== -1; -} -function isLineTerminator(ch) { - return ch === 10 || ch === 13 || ch === 8232 || ch === 8233; -} -function isIdentifierStart$1(ch) { - return ch < 128 ? _unicode$2.idStartBool[ch] : _unicode$2.idStartLargeRegex.test(String.fromCodePoint(ch)); -} -function isIdentifierPart$1(ch) { - return ch < 128 ? _unicode$2.idContinueBool[ch] : _unicode$2.idContinueLargeRegex.test(String.fromCodePoint(ch)); -} -function isDecimalDigit(ch) { - return ch >= 48 && ch <= 57; -} -function getHexValue(rune) { - if (rune >= "0" && rune <= "9") { - return rune.charCodeAt(0) - 48; - } - if (rune >= "a" && rune <= "f") { - return rune.charCodeAt(0) - 87; - } - if (rune >= "A" && rune <= "F") { - return rune.charCodeAt(0) - 55; - } - return -1; +const { pure, Pattern, Fraction, stack, slowcat, sequence, timeCat, silence, reify: reify$1 } = strudel; +var _seedState = 0; +const randOffset = 2e-4; +function _nextSeed() { + return _seedState++; } -const utils$2 = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - isStrictModeReservedWord: isStrictModeReservedWord_1, - isWhiteSpace: isWhiteSpace_1, - isLineTerminator: isLineTerminator_1, - isIdentifierStart: isIdentifierStart_1, - isIdentifierPart: isIdentifierPart_1, - isDecimalDigit: isDecimalDigit_1, - getHexValue: getHexValue_1, - default: utils$3 -}, [utils$3]); -const require$$3$5 = /* @__PURE__ */ getAugmentedNamespace(utils$2); -var errors$1 = {}; -var ErrorMessages_1; -Object.defineProperty(errors$1, "__esModule", { - value: true -}); -ErrorMessages_1 = errors$1.ErrorMessages = { - UNEXPECTED_TOKEN: function UNEXPECTED_TOKEN(id2) { - return "Unexpected token " + JSON.stringify(id2); - }, - UNEXPECTED_ILLEGAL_TOKEN: function UNEXPECTED_ILLEGAL_TOKEN(id2) { - return "Unexpected " + JSON.stringify(id2); - }, - UNEXPECTED_ESCAPED_KEYWORD: "Unexpected escaped keyword", - UNEXPECTED_NUMBER: "Unexpected number", - UNEXPECTED_STRING: "Unexpected string", - UNEXPECTED_IDENTIFIER: "Unexpected identifier", - UNEXPECTED_RESERVED_WORD: "Unexpected reserved word", - UNEXPECTED_TEMPLATE: "Unexpected template", - UNEXPECTED_EOS: "Unexpected end of input", - UNEXPECTED_LINE_TERMINATOR: "Unexpected line terminator", - UNEXPECTED_COMMA_AFTER_REST: "Unexpected comma after rest", - UNEXPECTED_REST_PARAMETERS_INITIALIZATION: "Rest parameter may not have a default initializer", - NEWLINE_AFTER_THROW: "Illegal newline after throw", - UNTERMINATED_REGEXP: "Invalid regular expression: missing /", - INVALID_LAST_REST_PARAMETER: "Rest parameter must be last formal parameter", - INVALID_REST_PARAMETERS_INITIALIZATION: "Rest parameter may not have a default initializer", - INVALID_REGEXP_FLAGS: "Invalid regular expression flags", - INVALID_REGEX: "Invalid regular expression", - INVALID_LHS_IN_ASSIGNMENT: "Invalid left-hand side in assignment", - INVALID_LHS_IN_BINDING: "Invalid left-hand side in binding", - INVALID_LHS_IN_FOR_IN: "Invalid left-hand side in for-in", - INVALID_LHS_IN_FOR_OF: "Invalid left-hand side in for-of", - INVALID_LHS_IN_FOR_AWAIT: "Invalid left-hand side in for-await", - INVALID_UPDATE_OPERAND: "Increment/decrement target must be an identifier or member expression", - INVALID_EXPONENTIATION_LHS: "Unary expressions as the left operand of an exponentation expression must be disambiguated with parentheses", - MULTIPLE_DEFAULTS_IN_SWITCH: "More than one default clause in switch statement", - NO_CATCH_OR_FINALLY: "Missing catch or finally after try", - ILLEGAL_RETURN: "Illegal return statement", - ILLEGAL_ARROW_FUNCTION_PARAMS: "Illegal arrow function parameter list", - INVALID_ASYNC_PARAMS: "Async function parameters must not contain await expressions", - INVALID_VAR_INIT_FOR_IN: "Invalid variable declaration in for-in statement", - INVALID_VAR_INIT_FOR_OF: "Invalid variable declaration in for-of statement", - INVALID_VAR_INIT_FOR_AWAIT: "Invalid variable declaration in for-await statement", - UNINITIALIZED_BINDINGPATTERN_IN_FOR_INIT: "Binding pattern appears without initializer in for statement init", - ILLEGAL_PROPERTY: "Illegal property initializer", - INVALID_ID_BINDING_STRICT_MODE: function INVALID_ID_BINDING_STRICT_MODE(id2) { - return "The identifier " + JSON.stringify(id2) + " must not be in binding position in strict mode"; - }, - INVALID_ID_IN_LABEL_STRICT_MODE: function INVALID_ID_IN_LABEL_STRICT_MODE(id2) { - return "The identifier " + JSON.stringify(id2) + " must not be in label position in strict mode"; - }, - INVALID_ID_IN_EXPRESSION_STRICT_MODE: function INVALID_ID_IN_EXPRESSION_STRICT_MODE(id2) { - return "The identifier " + JSON.stringify(id2) + " must not be in expression position in strict mode"; - }, - INVALID_CALL_TO_SUPER: 'Calls to super must be in the "constructor" method of a class expression or class declaration that has a superclass', - INVALID_DELETE_STRICT_MODE: "Identifier expressions must not be deleted in strict mode", - DUPLICATE_BINDING: function DUPLICATE_BINDING2(id2) { - return "Duplicate binding " + JSON.stringify(id2); - }, - ILLEGAL_ID_IN_LEXICAL_DECLARATION: function ILLEGAL_ID_IN_LEXICAL_DECLARATION(id2) { - return "Lexical declarations must not have a binding named " + JSON.stringify(id2); - }, - UNITIALIZED_CONST: "Constant lexical declarations must have an initialiser", - ILLEGAL_LABEL_IN_BODY: function ILLEGAL_LABEL_IN_BODY(stmt) { - return "The body of a " + stmt + " statement must not be a labeled function declaration"; - }, - ILLEGEAL_LABEL_IN_IF: "The consequent of an if statement must not be a labeled function declaration", - ILLEGAL_LABEL_IN_ELSE: "The alternate of an if statement must not be a labeled function declaration", - ILLEGAL_CONTINUE_WITHOUT_ITERATION_WITH_ID: function ILLEGAL_CONTINUE_WITHOUT_ITERATION_WITH_ID(id2) { - return "Continue statement must be nested within an iteration statement with label " + JSON.stringify(id2); - }, - ILLEGAL_CONTINUE_WITHOUT_ITERATION: "Continue statement must be nested within an iteration statement", - ILLEGAL_BREAK_WITHOUT_ITERATION_OR_SWITCH: "Break statement must be nested within an iteration statement or a switch statement", - ILLEGAL_WITH_STRICT_MODE: "Strict mode code must not include a with statement", - ILLEGAL_ACCESS_SUPER_MEMBER: "Member access on super must be in a method", - ILLEGAL_SUPER_CALL: 'Calls to super must be in the "constructor" method of a class expression or class declaration that has a superclass', - DUPLICATE_LABEL_DECLARATION: function DUPLICATE_LABEL_DECLARATION(label) { - return "Label " + JSON.stringify(label) + " has already been declared"; - }, - ILLEGAL_BREAK_WITHIN_LABEL: function ILLEGAL_BREAK_WITHIN_LABEL(label) { - return "Break statement must be nested within a statement with label " + JSON.stringify(label); - }, - ILLEGAL_YIELD_EXPRESSIONS: function ILLEGAL_YIELD_EXPRESSIONS(paramType) { - return paramType + " parameters must not contain yield expressions"; - }, - ILLEGAL_YIELD_IDENTIFIER: '"yield" may not be used as an identifier in this context', - ILLEGAL_AWAIT_IDENTIFIER: '"await" may not be used as an identifier in this context', - DUPLICATE_CONSTRUCTOR: "Duplicate constructor method in class", - ILLEGAL_CONSTRUCTORS: "Constructors cannot be async, generators, getters or setters", - ILLEGAL_STATIC_CLASS_NAME: 'Static class methods cannot be named "prototype"', - NEW_TARGET_ERROR: "new.target must be within function (but not arrow expression) code", - DUPLICATE_EXPORT: function DUPLICATE_EXPORT(id2) { - return "Duplicate export " + JSON.stringify(id2); - }, - UNDECLARED_BINDING: function UNDECLARED_BINDING(id2) { - return "Exported binding " + JSON.stringify(id2) + " is not declared"; - }, - DUPLICATE_PROPTO_PROP: "Duplicate __proto__ property in object literal not allowed", - ILLEGAL_LABEL_FUNC_DECLARATION: "Labeled FunctionDeclarations are disallowed in strict mode", - ILLEGAL_FUNC_DECL_IF: "FunctionDeclarations in IfStatements are disallowed in strict mode", - ILLEGAL_USE_STRICT: 'Functions with non-simple parameter lists may not contain a "use strict" directive', - ILLEGAL_EXPORTED_NAME: "Names of variables used in an export specifier from the current module must be identifiers", - NO_OCTALS_IN_TEMPLATES: "Template literals may not contain octal escape sequences", - NO_AWAIT_IN_ASYNC_PARAMS: 'Async arrow parameters may not contain "await"' -}; -const errors = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - get ErrorMessages() { - return ErrorMessages_1; - }, - default: errors$1 -}, [errors$1]); -const require$$2$5 = /* @__PURE__ */ getAugmentedNamespace(errors); -var TokenClass_1; -var TokenType_1; -Object.defineProperty(tokenizer$1, "__esModule", { - value: true -}); -var JsError_1 = tokenizer$1.JsError = TokenType_1 = tokenizer$1.TokenType = TokenClass_1 = tokenizer$1.TokenClass = void 0; -var _slicedToArray = function() { - function sliceIterator(arr, i2) { - var _arr = []; - var _n = true; - var _d = false; - var _e = void 0; - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - if (i2 && _arr.length === i2) - break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"]) - _i["return"](); - } finally { - if (_d) - throw _e; - } - } - return _arr; - } - return function(arr, i2) { - if (Array.isArray(arr)) { - return arr; - } else if (Symbol.iterator in Object(arr)) { - return sliceIterator(arr, i2); - } else { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); - } - }; -}(); -var _createClass$e = function() { - function defineProperties(target, props) { - for (var i2 = 0; i2 < props.length; i2++) { - var descriptor = props[i2]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); +const applyOptions = (parent) => (pat, i) => { + const ast = parent.source_[i]; + const options = ast.options_; + const operator = options == null ? void 0 : options.operator; + if (operator) { + switch (operator.type_) { + case "stretch": + const speed = Fraction(operator.arguments_.amount).inverse(); + return reify$1(pat).fast(speed); + case "bjorklund": + return pat.euclid(operator.arguments_.pulse, operator.arguments_.step, operator.arguments_.rotation); + case "degradeBy": + return reify$1(pat)._degradeByWith(rand.early(randOffset * _nextSeed()).segment(1), operator.arguments_.amount); } + console.warn(`operator "${operator.type_}" not implemented`); } - return function(Constructor, protoProps, staticProps) { - if (protoProps) - defineProperties(Constructor.prototype, protoProps); - if (staticProps) - defineProperties(Constructor, staticProps); - return Constructor; - }; -}(); -var _utils$1 = require$$3$5; -var _errors$2 = require$$2$5; -function _classCallCheck$i(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} -function _possibleConstructorReturn$8(self, call) { - if (!self) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + if (options == null ? void 0 : options.weight) { + return pat; } - return call && (typeof call === "object" || typeof call === "function") ? call : self; -} -function _inherits$8(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + const unimplemented = Object.keys(options || {}).filter((key) => key !== "operator"); + if (unimplemented.length) { + console.warn( + `option${unimplemented.length > 1 ? "s" : ""} ${unimplemented.map((o) => `"${o}"`).join(", ")} not implemented` + ); } - subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); - if (superClass) - Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; -} -var TokenClass = TokenClass_1 = tokenizer$1.TokenClass = { - Eof: { name: "" }, - Ident: { name: "Identifier", isIdentifierName: true }, - Keyword: { name: "Keyword", isIdentifierName: true }, - NumericLiteral: { name: "Numeric" }, - TemplateElement: { name: "Template" }, - Punctuator: { name: "Punctuator" }, - StringLiteral: { name: "String" }, - RegularExpression: { name: "RegularExpression" }, - Illegal: { name: "Illegal" } -}; -var TokenType = TokenType_1 = tokenizer$1.TokenType = { - EOS: { klass: TokenClass.Eof, name: "EOS" }, - LPAREN: { klass: TokenClass.Punctuator, name: "(" }, - RPAREN: { klass: TokenClass.Punctuator, name: ")" }, - LBRACK: { klass: TokenClass.Punctuator, name: "[" }, - RBRACK: { klass: TokenClass.Punctuator, name: "]" }, - LBRACE: { klass: TokenClass.Punctuator, name: "{" }, - RBRACE: { klass: TokenClass.Punctuator, name: "}" }, - COLON: { klass: TokenClass.Punctuator, name: ":" }, - SEMICOLON: { klass: TokenClass.Punctuator, name: ";" }, - PERIOD: { klass: TokenClass.Punctuator, name: "." }, - ELLIPSIS: { klass: TokenClass.Punctuator, name: "..." }, - ARROW: { klass: TokenClass.Punctuator, name: "=>" }, - CONDITIONAL: { klass: TokenClass.Punctuator, name: "?" }, - INC: { klass: TokenClass.Punctuator, name: "++" }, - DEC: { klass: TokenClass.Punctuator, name: "--" }, - ASSIGN: { klass: TokenClass.Punctuator, name: "=" }, - ASSIGN_BIT_OR: { klass: TokenClass.Punctuator, name: "|=" }, - ASSIGN_BIT_XOR: { klass: TokenClass.Punctuator, name: "^=" }, - ASSIGN_BIT_AND: { klass: TokenClass.Punctuator, name: "&=" }, - ASSIGN_SHL: { klass: TokenClass.Punctuator, name: "<<=" }, - ASSIGN_SHR: { klass: TokenClass.Punctuator, name: ">>=" }, - ASSIGN_SHR_UNSIGNED: { klass: TokenClass.Punctuator, name: ">>>=" }, - ASSIGN_ADD: { klass: TokenClass.Punctuator, name: "+=" }, - ASSIGN_SUB: { klass: TokenClass.Punctuator, name: "-=" }, - ASSIGN_MUL: { klass: TokenClass.Punctuator, name: "*=" }, - ASSIGN_DIV: { klass: TokenClass.Punctuator, name: "/=" }, - ASSIGN_MOD: { klass: TokenClass.Punctuator, name: "%=" }, - ASSIGN_EXP: { klass: TokenClass.Punctuator, name: "**=" }, - COMMA: { klass: TokenClass.Punctuator, name: "," }, - OR: { klass: TokenClass.Punctuator, name: "||" }, - AND: { klass: TokenClass.Punctuator, name: "&&" }, - BIT_OR: { klass: TokenClass.Punctuator, name: "|" }, - BIT_XOR: { klass: TokenClass.Punctuator, name: "^" }, - BIT_AND: { klass: TokenClass.Punctuator, name: "&" }, - SHL: { klass: TokenClass.Punctuator, name: "<<" }, - SHR: { klass: TokenClass.Punctuator, name: ">>" }, - SHR_UNSIGNED: { klass: TokenClass.Punctuator, name: ">>>" }, - ADD: { klass: TokenClass.Punctuator, name: "+" }, - SUB: { klass: TokenClass.Punctuator, name: "-" }, - MUL: { klass: TokenClass.Punctuator, name: "*" }, - DIV: { klass: TokenClass.Punctuator, name: "/" }, - MOD: { klass: TokenClass.Punctuator, name: "%" }, - EXP: { klass: TokenClass.Punctuator, name: "**" }, - EQ: { klass: TokenClass.Punctuator, name: "==" }, - NE: { klass: TokenClass.Punctuator, name: "!=" }, - EQ_STRICT: { klass: TokenClass.Punctuator, name: "===" }, - NE_STRICT: { klass: TokenClass.Punctuator, name: "!==" }, - LT: { klass: TokenClass.Punctuator, name: "<" }, - GT: { klass: TokenClass.Punctuator, name: ">" }, - LTE: { klass: TokenClass.Punctuator, name: "<=" }, - GTE: { klass: TokenClass.Punctuator, name: ">=" }, - INSTANCEOF: { klass: TokenClass.Keyword, name: "instanceof" }, - IN: { klass: TokenClass.Keyword, name: "in" }, - NOT: { klass: TokenClass.Punctuator, name: "!" }, - BIT_NOT: { klass: TokenClass.Punctuator, name: "~" }, - ASYNC: { klass: TokenClass.Keyword, name: "async" }, - AWAIT: { klass: TokenClass.Keyword, name: "await" }, - ENUM: { klass: TokenClass.Keyword, name: "enum" }, - DELETE: { klass: TokenClass.Keyword, name: "delete" }, - TYPEOF: { klass: TokenClass.Keyword, name: "typeof" }, - VOID: { klass: TokenClass.Keyword, name: "void" }, - BREAK: { klass: TokenClass.Keyword, name: "break" }, - CASE: { klass: TokenClass.Keyword, name: "case" }, - CATCH: { klass: TokenClass.Keyword, name: "catch" }, - CLASS: { klass: TokenClass.Keyword, name: "class" }, - CONTINUE: { klass: TokenClass.Keyword, name: "continue" }, - DEBUGGER: { klass: TokenClass.Keyword, name: "debugger" }, - DEFAULT: { klass: TokenClass.Keyword, name: "default" }, - DO: { klass: TokenClass.Keyword, name: "do" }, - ELSE: { klass: TokenClass.Keyword, name: "else" }, - EXPORT: { klass: TokenClass.Keyword, name: "export" }, - EXTENDS: { klass: TokenClass.Keyword, name: "extends" }, - FINALLY: { klass: TokenClass.Keyword, name: "finally" }, - FOR: { klass: TokenClass.Keyword, name: "for" }, - FUNCTION: { klass: TokenClass.Keyword, name: "function" }, - IF: { klass: TokenClass.Keyword, name: "if" }, - IMPORT: { klass: TokenClass.Keyword, name: "import" }, - LET: { klass: TokenClass.Keyword, name: "let" }, - NEW: { klass: TokenClass.Keyword, name: "new" }, - RETURN: { klass: TokenClass.Keyword, name: "return" }, - SUPER: { klass: TokenClass.Keyword, name: "super" }, - SWITCH: { klass: TokenClass.Keyword, name: "switch" }, - THIS: { klass: TokenClass.Keyword, name: "this" }, - THROW: { klass: TokenClass.Keyword, name: "throw" }, - TRY: { klass: TokenClass.Keyword, name: "try" }, - VAR: { klass: TokenClass.Keyword, name: "var" }, - WHILE: { klass: TokenClass.Keyword, name: "while" }, - WITH: { klass: TokenClass.Keyword, name: "with" }, - NULL: { klass: TokenClass.Keyword, name: "null" }, - TRUE: { klass: TokenClass.Keyword, name: "true" }, - FALSE: { klass: TokenClass.Keyword, name: "false" }, - YIELD: { klass: TokenClass.Keyword, name: "yield" }, - NUMBER: { klass: TokenClass.NumericLiteral, name: "" }, - STRING: { klass: TokenClass.StringLiteral, name: "" }, - REGEXP: { klass: TokenClass.RegularExpression, name: "" }, - IDENTIFIER: { klass: TokenClass.Ident, name: "" }, - CONST: { klass: TokenClass.Keyword, name: "const" }, - TEMPLATE: { klass: TokenClass.TemplateElement, name: "" }, - ESCAPED_KEYWORD: { klass: TokenClass.Keyword, name: "" }, - ILLEGAL: { klass: TokenClass.Illegal, name: "" } + return pat; }; -var TT = TokenType; -var I = TT.ILLEGAL; -var F = false; -var T = true; -var ONE_CHAR_PUNCTUATOR = [I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, TT.NOT, I, I, I, TT.MOD, TT.BIT_AND, I, TT.LPAREN, TT.RPAREN, TT.MUL, TT.ADD, TT.COMMA, TT.SUB, TT.PERIOD, TT.DIV, I, I, I, I, I, I, I, I, I, I, TT.COLON, TT.SEMICOLON, TT.LT, TT.ASSIGN, TT.GT, TT.CONDITIONAL, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, TT.LBRACK, I, TT.RBRACK, TT.BIT_XOR, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, TT.LBRACE, TT.BIT_OR, TT.RBRACE, TT.BIT_NOT]; -var PUNCTUATOR_START = [F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, T, F, F, F, T, T, F, T, T, T, T, T, T, F, T, F, F, F, F, F, F, F, F, F, F, T, T, T, T, T, T, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, T, F, T, T, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, T, T, T, T, F]; -var JsError = JsError_1 = tokenizer$1.JsError = function(_Error) { - _inherits$8(JsError2, _Error); - function JsError2(index2, line, column, msg) { - _classCallCheck$i(this, JsError2); - var _this = _possibleConstructorReturn$8(this, (JsError2.__proto__ || Object.getPrototypeOf(JsError2)).call(this, msg)); - _this.index = index2; - try { - _this.line = line; - _this.column = column; - } catch (e) { - } - _this.parseErrorLine = line; - _this.parseErrorColumn = column; - _this.description = msg; - _this.message = "[" + line + ":" + column + "]: " + msg; - return _this; - } - return JsError2; -}(Error); -function fromCodePoint(cp) { - if (cp <= 65535) - return String.fromCharCode(cp); - var cu1 = String.fromCharCode(Math.floor((cp - 65536) / 1024) + 55296); - var cu2 = String.fromCharCode((cp - 65536) % 1024 + 56320); - return cu1 + cu2; -} -function decodeUtf16(lead, trail) { - return (lead - 55296) * 1024 + (trail - 56320) + 65536; -} -var Tokenizer = function() { - function Tokenizer2(source) { - _classCallCheck$i(this, Tokenizer2); - this.source = source; - this.index = 0; - this.line = 0; - this.lineStart = 0; - this.startIndex = 0; - this.startLine = 0; - this.startLineStart = 0; - this.lastIndex = 0; - this.lastLine = 0; - this.lastLineStart = 0; - this.hasLineTerminatorBeforeNext = false; - this.tokenIndex = 0; - } - _createClass$e(Tokenizer2, [{ - key: "saveLexerState", - value: function saveLexerState() { +function resolveReplications(ast) { + ast.source_ = ast.source_.map((child) => { + const { replicate, ...options } = child.options_ || {}; + if (replicate) { return { - source: this.source, - index: this.index, - line: this.line, - lineStart: this.lineStart, - startIndex: this.startIndex, - startLine: this.startLine, - startLineStart: this.startLineStart, - lastIndex: this.lastIndex, - lastLine: this.lastLine, - lastLineStart: this.lastLineStart, - lookahead: this.lookahead, - hasLineTerminatorBeforeNext: this.hasLineTerminatorBeforeNext, - tokenIndex: this.tokenIndex + ...child, + options_: { ...options, weight: replicate }, + source_: { + type_: "pattern", + arguments_: { + alignment: "h" + }, + source_: [ + { + type_: "element", + source_: child.source_, + location_: child.location_, + options_: { + operator: { + type_: "stretch", + arguments_: { amount: Fraction(replicate).inverse().toString() } + } + } + } + ] + } }; } - }, { - key: "restoreLexerState", - value: function restoreLexerState(state) { - this.source = state.source; - this.index = state.index; - this.line = state.line; - this.lineStart = state.lineStart; - this.startIndex = state.startIndex; - this.startLine = state.startLine; - this.startLineStart = state.startLineStart; - this.lastIndex = state.lastIndex; - this.lastLine = state.lastLine; - this.lastLineStart = state.lastLineStart; - this.lookahead = state.lookahead; - this.hasLineTerminatorBeforeNext = state.hasLineTerminatorBeforeNext; - this.tokenIndex = state.tokenIndex; - } - }, { - key: "createILLEGAL", - value: function createILLEGAL() { - this.startIndex = this.index; - this.startLine = this.line; - this.startLineStart = this.lineStart; - return this.index < this.source.length ? this.createError(_errors$2.ErrorMessages.UNEXPECTED_ILLEGAL_TOKEN, this.source.charAt(this.index)) : this.createError(_errors$2.ErrorMessages.UNEXPECTED_EOS); - } - }, { - key: "createUnexpected", - value: function createUnexpected(token) { - switch (token.type.klass) { - case TokenClass.Eof: - return this.createError(_errors$2.ErrorMessages.UNEXPECTED_EOS); - case TokenClass.Ident: - return this.createError(_errors$2.ErrorMessages.UNEXPECTED_IDENTIFIER); - case TokenClass.Keyword: - if (token.type === TokenType.ESCAPED_KEYWORD) { - return this.createError(_errors$2.ErrorMessages.UNEXPECTED_ESCAPED_KEYWORD); - } - return this.createError(_errors$2.ErrorMessages.UNEXPECTED_TOKEN, token.slice.text); - case TokenClass.NumericLiteral: - return this.createError(_errors$2.ErrorMessages.UNEXPECTED_NUMBER); - case TokenClass.TemplateElement: - return this.createError(_errors$2.ErrorMessages.UNEXPECTED_TEMPLATE); - case TokenClass.Punctuator: - return this.createError(_errors$2.ErrorMessages.UNEXPECTED_TOKEN, token.type.name); - case TokenClass.StringLiteral: - return this.createError(_errors$2.ErrorMessages.UNEXPECTED_STRING); + return child; + }); +} +function patternifyAST(ast) { + let p; + switch (ast.type_) { + case "pattern": + resolveReplications(ast); + const children = ast.source_.map(patternifyAST).map(applyOptions(ast)); + const alignment = ast.arguments_.alignment; + if (alignment === "v") { + return stack(...children); } - throw new Error("Unreachable: unexpected token of class " + token.type.klass); - } - }, { - key: "createError", - value: function createError(message) { - var msg = void 0; - if (typeof message === "function") { - for (var _len = arguments.length, params = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - params[_key - 1] = arguments[_key]; - } - msg = message.apply(void 0, params); - } else { - msg = message; + if (alignment === "r") { + return chooseInWith(rand.early(randOffset * _nextSeed()).segment(1), children); } - return new JsError(this.startIndex, this.startLine + 1, this.startIndex - this.startLineStart + 1, msg); - } - }, { - key: "createErrorWithLocation", - value: function createErrorWithLocation(location, message) { - var _arguments = arguments; - var msg = message.replace(/\{(\d+)\}/g, function(_, n) { - return JSON.stringify(_arguments[+n + 2]); + const weightedChildren = ast.source_.some((child) => { + var _a; + return !!((_a = child.options_) == null ? void 0 : _a.weight); }); - if (location.slice && location.slice.startLocation) { - location = location.slice.startLocation; + if (!weightedChildren && alignment === "t") { + return slowcat(...children); } - return new JsError(location.offset, location.line, location.column + 1, msg); - } - }, { - key: "getKeyword", - value: function getKeyword(id2) { - if (id2.length === 1 || id2.length > 10) { - return TokenType.IDENTIFIER; - } - switch (id2.length) { - case 2: - switch (id2.charAt(0)) { - case "i": - switch (id2.charAt(1)) { - case "f": - return TokenType.IF; - case "n": - return TokenType.IN; - } - break; - case "d": - if (id2.charAt(1) === "o") { - return TokenType.DO; - } - break; - } - break; - case 3: - switch (id2.charAt(0)) { - case "v": - if (Tokenizer2.cse2(id2, "a", "r")) { - return TokenType.VAR; - } - break; - case "f": - if (Tokenizer2.cse2(id2, "o", "r")) { - return TokenType.FOR; - } - break; - case "n": - if (Tokenizer2.cse2(id2, "e", "w")) { - return TokenType.NEW; - } - break; - case "t": - if (Tokenizer2.cse2(id2, "r", "y")) { - return TokenType.TRY; - } - break; - case "l": - if (Tokenizer2.cse2(id2, "e", "t")) { - return TokenType.LET; - } - break; - } - break; - case 4: - switch (id2.charAt(0)) { - case "t": - if (Tokenizer2.cse3(id2, "h", "i", "s")) { - return TokenType.THIS; - } else if (Tokenizer2.cse3(id2, "r", "u", "e")) { - return TokenType.TRUE; - } - break; - case "n": - if (Tokenizer2.cse3(id2, "u", "l", "l")) { - return TokenType.NULL; - } - break; - case "e": - if (Tokenizer2.cse3(id2, "l", "s", "e")) { - return TokenType.ELSE; - } else if (Tokenizer2.cse3(id2, "n", "u", "m")) { - return TokenType.ENUM; - } - break; - case "c": - if (Tokenizer2.cse3(id2, "a", "s", "e")) { - return TokenType.CASE; - } - break; - case "v": - if (Tokenizer2.cse3(id2, "o", "i", "d")) { - return TokenType.VOID; - } - break; - case "w": - if (Tokenizer2.cse3(id2, "i", "t", "h")) { - return TokenType.WITH; - } - break; - } - break; - case 5: - switch (id2.charAt(0)) { - case "a": - if (Tokenizer2.cse4(id2, "s", "y", "n", "c")) { - return TokenType.ASYNC; - } - if (Tokenizer2.cse4(id2, "w", "a", "i", "t")) { - return TokenType.AWAIT; - } - break; - case "w": - if (Tokenizer2.cse4(id2, "h", "i", "l", "e")) { - return TokenType.WHILE; - } - break; - case "b": - if (Tokenizer2.cse4(id2, "r", "e", "a", "k")) { - return TokenType.BREAK; - } - break; - case "f": - if (Tokenizer2.cse4(id2, "a", "l", "s", "e")) { - return TokenType.FALSE; - } - break; - case "c": - if (Tokenizer2.cse4(id2, "a", "t", "c", "h")) { - return TokenType.CATCH; - } else if (Tokenizer2.cse4(id2, "o", "n", "s", "t")) { - return TokenType.CONST; - } else if (Tokenizer2.cse4(id2, "l", "a", "s", "s")) { - return TokenType.CLASS; - } - break; - case "t": - if (Tokenizer2.cse4(id2, "h", "r", "o", "w")) { - return TokenType.THROW; - } - break; - case "y": - if (Tokenizer2.cse4(id2, "i", "e", "l", "d")) { - return TokenType.YIELD; - } - break; - case "s": - if (Tokenizer2.cse4(id2, "u", "p", "e", "r")) { - return TokenType.SUPER; - } - break; - } - break; - case 6: - switch (id2.charAt(0)) { - case "r": - if (Tokenizer2.cse5(id2, "e", "t", "u", "r", "n")) { - return TokenType.RETURN; - } - break; - case "t": - if (Tokenizer2.cse5(id2, "y", "p", "e", "o", "f")) { - return TokenType.TYPEOF; - } - break; - case "d": - if (Tokenizer2.cse5(id2, "e", "l", "e", "t", "e")) { - return TokenType.DELETE; - } - break; - case "s": - if (Tokenizer2.cse5(id2, "w", "i", "t", "c", "h")) { - return TokenType.SWITCH; - } - break; - case "e": - if (Tokenizer2.cse5(id2, "x", "p", "o", "r", "t")) { - return TokenType.EXPORT; - } - break; - case "i": - if (Tokenizer2.cse5(id2, "m", "p", "o", "r", "t")) { - return TokenType.IMPORT; - } - break; - } - break; - case 7: - switch (id2.charAt(0)) { - case "d": - if (Tokenizer2.cse6(id2, "e", "f", "a", "u", "l", "t")) { - return TokenType.DEFAULT; - } - break; - case "f": - if (Tokenizer2.cse6(id2, "i", "n", "a", "l", "l", "y")) { - return TokenType.FINALLY; - } - break; - case "e": - if (Tokenizer2.cse6(id2, "x", "t", "e", "n", "d", "s")) { - return TokenType.EXTENDS; - } - break; - } - break; - case 8: - switch (id2.charAt(0)) { - case "f": - if (Tokenizer2.cse7(id2, "u", "n", "c", "t", "i", "o", "n")) { - return TokenType.FUNCTION; - } - break; - case "c": - if (Tokenizer2.cse7(id2, "o", "n", "t", "i", "n", "u", "e")) { - return TokenType.CONTINUE; - } - break; - case "d": - if (Tokenizer2.cse7(id2, "e", "b", "u", "g", "g", "e", "r")) { - return TokenType.DEBUGGER; - } - break; - } - break; - case 10: - if (id2 === "instanceof") { - return TokenType.INSTANCEOF; - } - break; - } - return TokenType.IDENTIFIER; - } - }, { - key: "skipSingleLineComment", - value: function skipSingleLineComment(offset) { - this.index += offset; - while (this.index < this.source.length) { - var chCode = this.source.charCodeAt(this.index); - this.index++; - if ((0, _utils$1.isLineTerminator)(chCode)) { - this.hasLineTerminatorBeforeNext = true; - if (chCode === 13 && this.source.charCodeAt(this.index) === 10) { - this.index++; - } - this.lineStart = this.index; - this.line++; - return; - } - } - } - }, { - key: "skipMultiLineComment", - value: function skipMultiLineComment() { - this.index += 2; - var length = this.source.length; - var isLineStart = false; - while (this.index < length) { - var chCode = this.source.charCodeAt(this.index); - if (chCode < 128) { - switch (chCode) { - case 42: - if (this.source.charAt(this.index + 1) === "/") { - this.index = this.index + 2; - return isLineStart; - } - this.index++; - break; - case 10: - isLineStart = true; - this.hasLineTerminatorBeforeNext = true; - this.index++; - this.lineStart = this.index; - this.line++; - break; - case 13: - isLineStart = true; - this.hasLineTerminatorBeforeNext = true; - if (this.source.charAt(this.index + 1) === "\n") { - this.index++; - } - this.index++; - this.lineStart = this.index; - this.line++; - break; - default: - this.index++; - } - } else if (chCode === 8232 || chCode === 8233) { - isLineStart = true; - this.hasLineTerminatorBeforeNext = true; - this.index++; - this.lineStart = this.index; - this.line++; - } else { - this.index++; - } - } - throw this.createILLEGAL(); - } - }, { - key: "skipComment", - value: function skipComment() { - this.hasLineTerminatorBeforeNext = false; - var isLineStart = this.index === 0; - var length = this.source.length; - while (this.index < length) { - var chCode = this.source.charCodeAt(this.index); - if ((0, _utils$1.isWhiteSpace)(chCode)) { - this.index++; - } else if ((0, _utils$1.isLineTerminator)(chCode)) { - this.hasLineTerminatorBeforeNext = true; - this.index++; - if (chCode === 13 && this.source.charAt(this.index) === "\n") { - this.index++; - } - this.lineStart = this.index; - this.line++; - isLineStart = true; - } else if (chCode === 47) { - if (this.index + 1 >= length) { - break; - } - chCode = this.source.charCodeAt(this.index + 1); - if (chCode === 47) { - this.skipSingleLineComment(2); - isLineStart = true; - } else if (chCode === 42) { - isLineStart = this.skipMultiLineComment() || isLineStart; - } else { - break; - } - } else if (!this.moduleIsTheGoalSymbol && isLineStart && chCode === 45) { - if (this.index + 2 >= length) { - break; - } - if (this.source.charAt(this.index + 1) === "-" && this.source.charAt(this.index + 2) === ">") { - this.skipSingleLineComment(3); - } else { - break; - } - } else if (!this.moduleIsTheGoalSymbol && chCode === 60) { - if (this.source.slice(this.index + 1, this.index + 4) === "!--") { - this.skipSingleLineComment(4); - isLineStart = true; - } else { - break; - } - } else { - break; - } - } - } - }, { - key: "scanHexEscape2", - value: function scanHexEscape2() { - if (this.index + 2 > this.source.length) { - return -1; - } - var r1 = (0, _utils$1.getHexValue)(this.source.charAt(this.index)); - if (r1 === -1) { - return -1; - } - var r2 = (0, _utils$1.getHexValue)(this.source.charAt(this.index + 1)); - if (r2 === -1) { - return -1; - } - this.index += 2; - return r1 << 4 | r2; - } - }, { - key: "scanUnicode", - value: function scanUnicode() { - if (this.source.charAt(this.index) === "{") { - var i2 = this.index + 1; - var hexDigits2 = 0, ch = void 0; - while (i2 < this.source.length) { - ch = this.source.charAt(i2); - var hex = (0, _utils$1.getHexValue)(ch); - if (hex === -1) { - break; - } - hexDigits2 = hexDigits2 << 4 | hex; - if (hexDigits2 > 1114111) { - throw this.createILLEGAL(); - } - i2++; - } - if (ch !== "}") { - throw this.createILLEGAL(); - } - if (i2 === this.index + 1) { - ++this.index; - throw this.createILLEGAL(); - } - this.index = i2 + 1; - return hexDigits2; - } - if (this.index + 4 > this.source.length) { - return -1; - } - var r1 = (0, _utils$1.getHexValue)(this.source.charAt(this.index)); - if (r1 === -1) { - return -1; - } - var r2 = (0, _utils$1.getHexValue)(this.source.charAt(this.index + 1)); - if (r2 === -1) { - return -1; - } - var r3 = (0, _utils$1.getHexValue)(this.source.charAt(this.index + 2)); - if (r3 === -1) { - return -1; - } - var r4 = (0, _utils$1.getHexValue)(this.source.charAt(this.index + 3)); - if (r4 === -1) { - return -1; - } - this.index += 4; - return r1 << 12 | r2 << 8 | r3 << 4 | r4; - } - }, { - key: "getEscapedIdentifier", - value: function getEscapedIdentifier() { - var id2 = ""; - var check = _utils$1.isIdentifierStart; - while (this.index < this.source.length) { - var ch = this.source.charAt(this.index); - var code2 = ch.charCodeAt(0); - var start = this.index; - ++this.index; - if (ch === "\\") { - if (this.index >= this.source.length) { - throw this.createILLEGAL(); - } - if (this.source.charAt(this.index) !== "u") { - throw this.createILLEGAL(); - } - ++this.index; - code2 = this.scanUnicode(); - if (code2 < 0) { - throw this.createILLEGAL(); - } - ch = fromCodePoint(code2); - } else if (code2 >= 55296 && code2 <= 56319) { - if (this.index >= this.source.length) { - throw this.createILLEGAL(); - } - var lowSurrogateCode = this.source.charCodeAt(this.index); - ++this.index; - if (!(lowSurrogateCode >= 56320 && lowSurrogateCode <= 57343)) { - throw this.createILLEGAL(); - } - code2 = decodeUtf16(code2, lowSurrogateCode); - ch = fromCodePoint(code2); - } - if (!check(code2)) { - if (id2.length < 1) { - throw this.createILLEGAL(); - } - this.index = start; - return id2; - } - check = _utils$1.isIdentifierPart; - id2 += ch; - } - return id2; - } - }, { - key: "getIdentifier", - value: function getIdentifier() { - var start = this.index; - var l = this.source.length; - var i2 = this.index; - var check = _utils$1.isIdentifierStart; - while (i2 < l) { - var ch = this.source.charAt(i2); - var code2 = ch.charCodeAt(0); - if (ch === "\\" || code2 >= 55296 && code2 <= 56319) { - this.index = start; - return this.getEscapedIdentifier(); - } - if (!check(code2)) { - this.index = i2; - return this.source.slice(start, i2); - } - ++i2; - check = _utils$1.isIdentifierPart; - } - this.index = i2; - return this.source.slice(start, i2); - } - }, { - key: "scanIdentifier", - value: function scanIdentifier() { - var startLocation = this.getLocation(); - var start = this.index; - var id2 = this.source.charAt(this.index) === "\\" ? this.getEscapedIdentifier() : this.getIdentifier(); - var slice = this.getSlice(start, startLocation); - slice.text = id2; - var hasEscape = this.index - start !== id2.length; - var type = this.getKeyword(id2); - if (hasEscape && type !== TokenType.IDENTIFIER) { - type = TokenType.ESCAPED_KEYWORD; - } - return { type, value: id2, slice, escaped: hasEscape }; - } - }, { - key: "getLocation", - value: function getLocation() { - return { - line: this.startLine + 1, - column: this.startIndex - this.startLineStart, - offset: this.startIndex - }; - } - }, { - key: "getLastTokenEndLocation", - value: function getLastTokenEndLocation() { - return { - line: this.lastLine + 1, - column: this.lastIndex - this.lastLineStart, - offset: this.lastIndex - }; - } - }, { - key: "getSlice", - value: function getSlice(start, startLocation) { - return { text: this.source.slice(start, this.index), start, startLocation, end: this.index }; - } - }, { - key: "scanPunctuatorHelper", - value: function scanPunctuatorHelper() { - var ch1 = this.source.charAt(this.index); - switch (ch1) { - case ".": { - var ch2 = this.source.charAt(this.index + 1); - if (ch2 !== ".") - return TokenType.PERIOD; - var ch3 = this.source.charAt(this.index + 2); - if (ch3 !== ".") - return TokenType.PERIOD; - return TokenType.ELLIPSIS; - } - case "(": - return TokenType.LPAREN; - case ")": - case ";": - case ",": - return ONE_CHAR_PUNCTUATOR[ch1.charCodeAt(0)]; - case "{": - return TokenType.LBRACE; - case "}": - case "[": - case "]": - case ":": - case "?": - case "~": - return ONE_CHAR_PUNCTUATOR[ch1.charCodeAt(0)]; - default: - if (this.index + 1 < this.source.length && this.source.charAt(this.index + 1) === "=") { - switch (ch1) { - case "=": - if (this.index + 2 < this.source.length && this.source.charAt(this.index + 2) === "=") { - return TokenType.EQ_STRICT; - } - return TokenType.EQ; - case "!": - if (this.index + 2 < this.source.length && this.source.charAt(this.index + 2) === "=") { - return TokenType.NE_STRICT; - } - return TokenType.NE; - case "|": - return TokenType.ASSIGN_BIT_OR; - case "+": - return TokenType.ASSIGN_ADD; - case "-": - return TokenType.ASSIGN_SUB; - case "*": - return TokenType.ASSIGN_MUL; - case "<": - return TokenType.LTE; - case ">": - return TokenType.GTE; - case "/": - return TokenType.ASSIGN_DIV; - case "%": - return TokenType.ASSIGN_MOD; - case "^": - return TokenType.ASSIGN_BIT_XOR; - case "&": - return TokenType.ASSIGN_BIT_AND; - } - } - } - if (this.index + 1 < this.source.length) { - var _ch = this.source.charAt(this.index + 1); - if (ch1 === _ch) { - if (this.index + 2 < this.source.length) { - var _ch2 = this.source.charAt(this.index + 2); - if (ch1 === ">" && _ch2 === ">") { - if (this.index + 3 < this.source.length && this.source.charAt(this.index + 3) === "=") { - return TokenType.ASSIGN_SHR_UNSIGNED; - } - return TokenType.SHR_UNSIGNED; - } - if (ch1 === "<" && _ch2 === "=") { - return TokenType.ASSIGN_SHL; - } - if (ch1 === ">" && _ch2 === "=") { - return TokenType.ASSIGN_SHR; - } - if (ch1 === "*" && _ch2 === "=") { - return TokenType.ASSIGN_EXP; - } - } - switch (ch1) { - case "*": - return TokenType.EXP; - case "+": - return TokenType.INC; - case "-": - return TokenType.DEC; - case "<": - return TokenType.SHL; - case ">": - return TokenType.SHR; - case "&": - return TokenType.AND; - case "|": - return TokenType.OR; - } - } else if (ch1 === "=" && _ch === ">") { - return TokenType.ARROW; - } - } - return ONE_CHAR_PUNCTUATOR[ch1.charCodeAt(0)]; - } - }, { - key: "scanPunctuator", - value: function scanPunctuator() { - var startLocation = this.getLocation(); - var start = this.index; - var subType = this.scanPunctuatorHelper(); - this.index += subType.name.length; - return { type: subType, value: subType.name, slice: this.getSlice(start, startLocation) }; - } - }, { - key: "scanHexLiteral", - value: function scanHexLiteral(start, startLocation) { - var i2 = this.index; - while (i2 < this.source.length) { - var ch = this.source.charAt(i2); - var hex = (0, _utils$1.getHexValue)(ch); - if (hex === -1) { - break; - } - i2++; - } - if (this.index === i2) { - throw this.createILLEGAL(); - } - if (i2 < this.source.length && (0, _utils$1.isIdentifierStart)(this.source.charCodeAt(i2))) { - throw this.createILLEGAL(); - } - this.index = i2; - var slice = this.getSlice(start, startLocation); - return { type: TokenType.NUMBER, value: parseInt(slice.text.substr(2), 16), slice }; - } - }, { - key: "scanBinaryLiteral", - value: function scanBinaryLiteral(start, startLocation) { - var offset = this.index - start; - while (this.index < this.source.length) { - var ch = this.source.charAt(this.index); - if (ch !== "0" && ch !== "1") { - break; - } - this.index++; - } - if (this.index - start <= offset) { - throw this.createILLEGAL(); - } - if (this.index < this.source.length && ((0, _utils$1.isIdentifierStart)(this.source.charCodeAt(this.index)) || (0, _utils$1.isDecimalDigit)(this.source.charCodeAt(this.index)))) { - throw this.createILLEGAL(); - } - return { - type: TokenType.NUMBER, - value: parseInt(this.getSlice(start, startLocation).text.substr(offset), 2), - slice: this.getSlice(start, startLocation), - octal: false, - noctal: false - }; - } - }, { - key: "scanOctalLiteral", - value: function scanOctalLiteral(start, startLocation) { - while (this.index < this.source.length) { - var ch = this.source.charAt(this.index); - if (ch >= "0" && ch <= "7") { - this.index++; - } else if ((0, _utils$1.isIdentifierPart)(ch.charCodeAt(0))) { - throw this.createILLEGAL(); - } else { - break; - } - } - if (this.index - start === 2) { - throw this.createILLEGAL(); - } - return { - type: TokenType.NUMBER, - value: parseInt(this.getSlice(start, startLocation).text.substr(2), 8), - slice: this.getSlice(start, startLocation), - octal: false, - noctal: false - }; - } - }, { - key: "scanLegacyOctalLiteral", - value: function scanLegacyOctalLiteral(start, startLocation) { - var isOctal = true; - while (this.index < this.source.length) { - var ch = this.source.charAt(this.index); - if (ch >= "0" && ch <= "7") { - this.index++; - } else if (ch === "8" || ch === "9") { - isOctal = false; - this.index++; - } else if ((0, _utils$1.isIdentifierPart)(ch.charCodeAt(0))) { - throw this.createILLEGAL(); - } else { - break; - } - } - var slice = this.getSlice(start, startLocation); - if (!isOctal) { - this.eatDecimalLiteralSuffix(); - return { - type: TokenType.NUMBER, - slice, - value: +slice.text, - octal: true, - noctal: !isOctal - }; - } - return { - type: TokenType.NUMBER, - slice, - value: parseInt(slice.text.substr(1), 8), - octal: true, - noctal: !isOctal - }; - } - }, { - key: "scanNumericLiteral", - value: function scanNumericLiteral() { - var ch = this.source.charAt(this.index); - var startLocation = this.getLocation(); - var start = this.index; - if (ch === "0") { - this.index++; - if (this.index < this.source.length) { - ch = this.source.charAt(this.index); - if (ch === "x" || ch === "X") { - this.index++; - return this.scanHexLiteral(start, startLocation); - } else if (ch === "b" || ch === "B") { - this.index++; - return this.scanBinaryLiteral(start, startLocation); - } else if (ch === "o" || ch === "O") { - this.index++; - return this.scanOctalLiteral(start, startLocation); - } else if (ch >= "0" && ch <= "9") { - return this.scanLegacyOctalLiteral(start, startLocation); - } - } else { - var _slice = this.getSlice(start, startLocation); - return { - type: TokenType.NUMBER, - value: +_slice.text, - slice: _slice, - octal: false, - noctal: false - }; - } - } else if (ch !== ".") { - ch = this.source.charAt(this.index); - while (ch >= "0" && ch <= "9") { - this.index++; - if (this.index === this.source.length) { - var _slice2 = this.getSlice(start, startLocation); - return { - type: TokenType.NUMBER, - value: +_slice2.text, - slice: _slice2, - octal: false, - noctal: false - }; - } - ch = this.source.charAt(this.index); - } - } - this.eatDecimalLiteralSuffix(); - if (this.index !== this.source.length && (0, _utils$1.isIdentifierStart)(this.source.charCodeAt(this.index))) { - throw this.createILLEGAL(); - } - var slice = this.getSlice(start, startLocation); - return { - type: TokenType.NUMBER, - value: +slice.text, - slice, - octal: false, - noctal: false - }; - } - }, { - key: "eatDecimalLiteralSuffix", - value: function eatDecimalLiteralSuffix() { - var ch = this.source.charAt(this.index); - if (ch === ".") { - this.index++; - if (this.index === this.source.length) { - return; - } - ch = this.source.charAt(this.index); - while (ch >= "0" && ch <= "9") { - this.index++; - if (this.index === this.source.length) { - return; - } - ch = this.source.charAt(this.index); - } - } - if (ch === "e" || ch === "E") { - this.index++; - if (this.index === this.source.length) { - throw this.createILLEGAL(); - } - ch = this.source.charAt(this.index); - if (ch === "+" || ch === "-") { - this.index++; - if (this.index === this.source.length) { - throw this.createILLEGAL(); - } - ch = this.source.charAt(this.index); - } - if (ch >= "0" && ch <= "9") { - while (ch >= "0" && ch <= "9") { - this.index++; - if (this.index === this.source.length) { - break; - } - ch = this.source.charAt(this.index); - } - } else { - throw this.createILLEGAL(); - } - } - } - }, { - key: "scanStringEscape", - value: function scanStringEscape(str, octal) { - this.index++; - if (this.index === this.source.length) { - throw this.createILLEGAL(); - } - var ch = this.source.charAt(this.index); - if ((0, _utils$1.isLineTerminator)(ch.charCodeAt(0))) { - this.index++; - if (ch === "\r" && this.source.charAt(this.index) === "\n") { - this.index++; - } - this.lineStart = this.index; - this.line++; - } else { - switch (ch) { - case "n": - str += "\n"; - this.index++; - break; - case "r": - str += "\r"; - this.index++; - break; - case "t": - str += " "; - this.index++; - break; - case "u": - case "x": { - var unescaped = void 0; - this.index++; - if (this.index >= this.source.length) { - throw this.createILLEGAL(); - } - unescaped = ch === "u" ? this.scanUnicode() : this.scanHexEscape2(); - if (unescaped < 0) { - throw this.createILLEGAL(); - } - str += fromCodePoint(unescaped); - break; - } - case "b": - str += "\b"; - this.index++; - break; - case "f": - str += "\f"; - this.index++; - break; - case "v": - str += "\v"; - this.index++; - break; - default: - if (ch >= "0" && ch <= "7") { - var octalStart = this.index; - var octLen = 1; - if (ch >= "0" && ch <= "3") { - octLen = 0; - } - var code2 = 0; - while (octLen < 3 && ch >= "0" && ch <= "7") { - this.index++; - if (octLen > 0 || ch !== "0") { - octal = this.source.slice(octalStart, this.index); - } - code2 *= 8; - code2 += ch - "0"; - octLen++; - if (this.index === this.source.length) { - throw this.createILLEGAL(); - } - ch = this.source.charAt(this.index); - } - if (code2 === 0 && octLen === 1 && (ch === "8" || ch === "9")) { - octal = this.source.slice(octalStart, this.index + 1); - } - str += String.fromCharCode(code2); - } else if (ch === "8" || ch === "9") { - throw this.createILLEGAL(); - } else { - str += ch; - this.index++; - } - } - } - return [str, octal]; - } - }, { - key: "scanStringLiteral", - value: function scanStringLiteral() { - var str = ""; - var quote = this.source.charAt(this.index); - var startLocation = this.getLocation(); - var start = this.index; - this.index++; - var octal = null; - while (this.index < this.source.length) { - var ch = this.source.charAt(this.index); - if (ch === quote) { - this.index++; - return { type: TokenType.STRING, slice: this.getSlice(start, startLocation), str, octal }; - } else if (ch === "\\") { - var _scanStringEscape = this.scanStringEscape(str, octal); - var _scanStringEscape2 = _slicedToArray(_scanStringEscape, 2); - str = _scanStringEscape2[0]; - octal = _scanStringEscape2[1]; - } else if ((0, _utils$1.isLineTerminator)(ch.charCodeAt(0))) { - throw this.createILLEGAL(); - } else { - str += ch; - this.index++; - } - } - throw this.createILLEGAL(); - } - }, { - key: "scanTemplateElement", - value: function scanTemplateElement() { - var startLocation = this.getLocation(); - var start = this.index; - this.index++; - while (this.index < this.source.length) { - var ch = this.source.charCodeAt(this.index); - switch (ch) { - case 96: { - this.index++; - return { type: TokenType.TEMPLATE, tail: true, slice: this.getSlice(start, startLocation) }; - } - case 36: { - if (this.source.charCodeAt(this.index + 1) === 123) { - this.index += 2; - return { type: TokenType.TEMPLATE, tail: false, slice: this.getSlice(start, startLocation) }; - } - this.index++; - break; - } - case 92: { - var octal = this.scanStringEscape("", null)[1]; - if (octal != null) { - throw this.createError(_errors$2.ErrorMessages.NO_OCTALS_IN_TEMPLATES); - } - break; - } - case 13: { - this.line++; - this.index++; - if (this.index < this.source.length && this.source.charAt(this.index) === "\n") { - this.index++; - } - this.lineStart = this.index; - break; - } - case 10: - case 8232: - case 8233: { - this.line++; - this.index++; - this.lineStart = this.index; - break; - } - default: - this.index++; - } - } - throw this.createILLEGAL(); - } - }, { - key: "scanRegExp", - value: function scanRegExp(str) { - var startLocation = this.getLocation(); - var start = this.index; - var terminated = false; - var classMarker = false; - while (this.index < this.source.length) { - var ch = this.source.charAt(this.index); - if (ch === "\\") { - str += ch; - this.index++; - ch = this.source.charAt(this.index); - if ((0, _utils$1.isLineTerminator)(ch.charCodeAt(0))) { - throw this.createError(_errors$2.ErrorMessages.UNTERMINATED_REGEXP); - } - str += ch; - this.index++; - } else if ((0, _utils$1.isLineTerminator)(ch.charCodeAt(0))) { - throw this.createError(_errors$2.ErrorMessages.UNTERMINATED_REGEXP); - } else { - if (classMarker) { - if (ch === "]") { - classMarker = false; - } - } else if (ch === "/") { - terminated = true; - str += ch; - this.index++; - break; - } else if (ch === "[") { - classMarker = true; - } - str += ch; - this.index++; - } - } - if (!terminated) { - throw this.createError(_errors$2.ErrorMessages.UNTERMINATED_REGEXP); - } - while (this.index < this.source.length) { - var _ch3 = this.source.charAt(this.index); - if (_ch3 === "\\") { - throw this.createError(_errors$2.ErrorMessages.INVALID_REGEXP_FLAGS); - } - if (!(0, _utils$1.isIdentifierPart)(_ch3.charCodeAt(0))) { - break; - } - this.index++; - str += _ch3; - } - return { type: TokenType.REGEXP, value: str, slice: this.getSlice(start, startLocation) }; - } - }, { - key: "advance", - value: function advance() { - var startLocation = this.getLocation(); - this.lastIndex = this.index; - this.lastLine = this.line; - this.lastLineStart = this.lineStart; - this.skipComment(); - this.startIndex = this.index; - this.startLine = this.line; - this.startLineStart = this.lineStart; - if (this.lastIndex === 0) { - this.lastIndex = this.index; - this.lastLine = this.line; - this.lastLineStart = this.lineStart; - } - if (this.index >= this.source.length) { - return { type: TokenType.EOS, slice: this.getSlice(this.index, startLocation) }; - } - var charCode = this.source.charCodeAt(this.index); - if (charCode < 128) { - if (PUNCTUATOR_START[charCode]) { - return this.scanPunctuator(); - } - if ((0, _utils$1.isIdentifierStart)(charCode) || charCode === 92) { - return this.scanIdentifier(); - } - if (charCode === 46) { - if (this.index + 1 < this.source.length && (0, _utils$1.isDecimalDigit)(this.source.charCodeAt(this.index + 1))) { - return this.scanNumericLiteral(); - } - return this.scanPunctuator(); - } - if (charCode === 39 || charCode === 34) { - return this.scanStringLiteral(); - } - if (charCode === 96) { - return this.scanTemplateElement(); - } - if (charCode >= 48 && charCode <= 57) { - return this.scanNumericLiteral(); - } - throw this.createILLEGAL(); - } else { - if ((0, _utils$1.isIdentifierStart)(charCode) || charCode >= 55296 && charCode <= 56319) { - return this.scanIdentifier(); - } - throw this.createILLEGAL(); - } - } - }, { - key: "eof", - value: function eof() { - return this.lookahead.type === TokenType.EOS; - } - }, { - key: "lex", - value: function lex() { - var prevToken = this.lookahead; - this.lookahead = this.advance(); - this.tokenIndex++; - return prevToken; - } - }], [{ - key: "cse2", - value: function cse2(id2, ch1, ch2) { - return id2.charAt(1) === ch1 && id2.charAt(2) === ch2; - } - }, { - key: "cse3", - value: function cse3(id2, ch1, ch2, ch3) { - return id2.charAt(1) === ch1 && id2.charAt(2) === ch2 && id2.charAt(3) === ch3; - } - }, { - key: "cse4", - value: function cse4(id2, ch1, ch2, ch3, ch4) { - return id2.charAt(1) === ch1 && id2.charAt(2) === ch2 && id2.charAt(3) === ch3 && id2.charAt(4) === ch4; - } - }, { - key: "cse5", - value: function cse5(id2, ch1, ch2, ch3, ch4, ch5) { - return id2.charAt(1) === ch1 && id2.charAt(2) === ch2 && id2.charAt(3) === ch3 && id2.charAt(4) === ch4 && id2.charAt(5) === ch5; - } - }, { - key: "cse6", - value: function cse6(id2, ch1, ch2, ch3, ch4, ch5, ch6) { - return id2.charAt(1) === ch1 && id2.charAt(2) === ch2 && id2.charAt(3) === ch3 && id2.charAt(4) === ch4 && id2.charAt(5) === ch5 && id2.charAt(6) === ch6; - } - }, { - key: "cse7", - value: function cse7(id2, ch1, ch2, ch3, ch4, ch5, ch6, ch7) { - return id2.charAt(1) === ch1 && id2.charAt(2) === ch2 && id2.charAt(3) === ch3 && id2.charAt(4) === ch4 && id2.charAt(5) === ch5 && id2.charAt(6) === ch6 && id2.charAt(7) === ch7; - } - }]); - return Tokenizer2; -}(); -var _default$c = tokenizer$1.default = Tokenizer; -const tokenizer = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - get JsError() { - return JsError_1; - }, - get TokenType() { - return TokenType_1; - }, - get TokenClass() { - return TokenClass_1; - }, - default: _default$c -}, [tokenizer$1]); -const require$$0$9 = /* @__PURE__ */ getAugmentedNamespace(tokenizer); -var parser$1 = {}; -var dist$a = {}; -var mappings = /* @__PURE__ */ new Map([ - ["General_Category", /* @__PURE__ */ new Map([ - ["C", "Other"], - ["Cc", "Control"], - ["cntrl", "Control"], - ["Cf", "Format"], - ["Cn", "Unassigned"], - ["Co", "Private_Use"], - ["Cs", "Surrogate"], - ["L", "Letter"], - ["LC", "Cased_Letter"], - ["Ll", "Lowercase_Letter"], - ["Lm", "Modifier_Letter"], - ["Lo", "Other_Letter"], - ["Lt", "Titlecase_Letter"], - ["Lu", "Uppercase_Letter"], - ["M", "Mark"], - ["Combining_Mark", "Mark"], - ["Mc", "Spacing_Mark"], - ["Me", "Enclosing_Mark"], - ["Mn", "Nonspacing_Mark"], - ["N", "Number"], - ["Nd", "Decimal_Number"], - ["digit", "Decimal_Number"], - ["Nl", "Letter_Number"], - ["No", "Other_Number"], - ["P", "Punctuation"], - ["punct", "Punctuation"], - ["Pc", "Connector_Punctuation"], - ["Pd", "Dash_Punctuation"], - ["Pe", "Close_Punctuation"], - ["Pf", "Final_Punctuation"], - ["Pi", "Initial_Punctuation"], - ["Po", "Other_Punctuation"], - ["Ps", "Open_Punctuation"], - ["S", "Symbol"], - ["Sc", "Currency_Symbol"], - ["Sk", "Modifier_Symbol"], - ["Sm", "Math_Symbol"], - ["So", "Other_Symbol"], - ["Z", "Separator"], - ["Zl", "Line_Separator"], - ["Zp", "Paragraph_Separator"], - ["Zs", "Space_Separator"], - ["Other", "Other"], - ["Control", "Control"], - ["Format", "Format"], - ["Unassigned", "Unassigned"], - ["Private_Use", "Private_Use"], - ["Surrogate", "Surrogate"], - ["Letter", "Letter"], - ["Cased_Letter", "Cased_Letter"], - ["Lowercase_Letter", "Lowercase_Letter"], - ["Modifier_Letter", "Modifier_Letter"], - ["Other_Letter", "Other_Letter"], - ["Titlecase_Letter", "Titlecase_Letter"], - ["Uppercase_Letter", "Uppercase_Letter"], - ["Mark", "Mark"], - ["Spacing_Mark", "Spacing_Mark"], - ["Enclosing_Mark", "Enclosing_Mark"], - ["Nonspacing_Mark", "Nonspacing_Mark"], - ["Number", "Number"], - ["Decimal_Number", "Decimal_Number"], - ["Letter_Number", "Letter_Number"], - ["Other_Number", "Other_Number"], - ["Punctuation", "Punctuation"], - ["Connector_Punctuation", "Connector_Punctuation"], - ["Dash_Punctuation", "Dash_Punctuation"], - ["Close_Punctuation", "Close_Punctuation"], - ["Final_Punctuation", "Final_Punctuation"], - ["Initial_Punctuation", "Initial_Punctuation"], - ["Other_Punctuation", "Other_Punctuation"], - ["Open_Punctuation", "Open_Punctuation"], - ["Symbol", "Symbol"], - ["Currency_Symbol", "Currency_Symbol"], - ["Modifier_Symbol", "Modifier_Symbol"], - ["Math_Symbol", "Math_Symbol"], - ["Other_Symbol", "Other_Symbol"], - ["Separator", "Separator"], - ["Line_Separator", "Line_Separator"], - ["Paragraph_Separator", "Paragraph_Separator"], - ["Space_Separator", "Space_Separator"] - ])], - ["Script", /* @__PURE__ */ new Map([ - ["Adlm", "Adlam"], - ["Aghb", "Caucasian_Albanian"], - ["Ahom", "Ahom"], - ["Arab", "Arabic"], - ["Armi", "Imperial_Aramaic"], - ["Armn", "Armenian"], - ["Avst", "Avestan"], - ["Bali", "Balinese"], - ["Bamu", "Bamum"], - ["Bass", "Bassa_Vah"], - ["Batk", "Batak"], - ["Beng", "Bengali"], - ["Bhks", "Bhaiksuki"], - ["Bopo", "Bopomofo"], - ["Brah", "Brahmi"], - ["Brai", "Braille"], - ["Bugi", "Buginese"], - ["Buhd", "Buhid"], - ["Cakm", "Chakma"], - ["Cans", "Canadian_Aboriginal"], - ["Cari", "Carian"], - ["Cham", "Cham"], - ["Cher", "Cherokee"], - ["Copt", "Coptic"], - ["Qaac", "Coptic"], - ["Cprt", "Cypriot"], - ["Cyrl", "Cyrillic"], - ["Deva", "Devanagari"], - ["Dogr", "Dogra"], - ["Dsrt", "Deseret"], - ["Dupl", "Duployan"], - ["Egyp", "Egyptian_Hieroglyphs"], - ["Elba", "Elbasan"], - ["Ethi", "Ethiopic"], - ["Geor", "Georgian"], - ["Glag", "Glagolitic"], - ["Gong", "Gunjala_Gondi"], - ["Gonm", "Masaram_Gondi"], - ["Goth", "Gothic"], - ["Gran", "Grantha"], - ["Grek", "Greek"], - ["Gujr", "Gujarati"], - ["Guru", "Gurmukhi"], - ["Hang", "Hangul"], - ["Hani", "Han"], - ["Hano", "Hanunoo"], - ["Hatr", "Hatran"], - ["Hebr", "Hebrew"], - ["Hira", "Hiragana"], - ["Hluw", "Anatolian_Hieroglyphs"], - ["Hmng", "Pahawh_Hmong"], - ["Hrkt", "Katakana_Or_Hiragana"], - ["Hung", "Old_Hungarian"], - ["Ital", "Old_Italic"], - ["Java", "Javanese"], - ["Kali", "Kayah_Li"], - ["Kana", "Katakana"], - ["Khar", "Kharoshthi"], - ["Khmr", "Khmer"], - ["Khoj", "Khojki"], - ["Knda", "Kannada"], - ["Kthi", "Kaithi"], - ["Lana", "Tai_Tham"], - ["Laoo", "Lao"], - ["Latn", "Latin"], - ["Lepc", "Lepcha"], - ["Limb", "Limbu"], - ["Lina", "Linear_A"], - ["Linb", "Linear_B"], - ["Lisu", "Lisu"], - ["Lyci", "Lycian"], - ["Lydi", "Lydian"], - ["Mahj", "Mahajani"], - ["Maka", "Makasar"], - ["Mand", "Mandaic"], - ["Mani", "Manichaean"], - ["Marc", "Marchen"], - ["Medf", "Medefaidrin"], - ["Mend", "Mende_Kikakui"], - ["Merc", "Meroitic_Cursive"], - ["Mero", "Meroitic_Hieroglyphs"], - ["Mlym", "Malayalam"], - ["Modi", "Modi"], - ["Mong", "Mongolian"], - ["Mroo", "Mro"], - ["Mtei", "Meetei_Mayek"], - ["Mult", "Multani"], - ["Mymr", "Myanmar"], - ["Narb", "Old_North_Arabian"], - ["Nbat", "Nabataean"], - ["Newa", "Newa"], - ["Nkoo", "Nko"], - ["Nshu", "Nushu"], - ["Ogam", "Ogham"], - ["Olck", "Ol_Chiki"], - ["Orkh", "Old_Turkic"], - ["Orya", "Oriya"], - ["Osge", "Osage"], - ["Osma", "Osmanya"], - ["Palm", "Palmyrene"], - ["Pauc", "Pau_Cin_Hau"], - ["Perm", "Old_Permic"], - ["Phag", "Phags_Pa"], - ["Phli", "Inscriptional_Pahlavi"], - ["Phlp", "Psalter_Pahlavi"], - ["Phnx", "Phoenician"], - ["Plrd", "Miao"], - ["Prti", "Inscriptional_Parthian"], - ["Rjng", "Rejang"], - ["Rohg", "Hanifi_Rohingya"], - ["Runr", "Runic"], - ["Samr", "Samaritan"], - ["Sarb", "Old_South_Arabian"], - ["Saur", "Saurashtra"], - ["Sgnw", "SignWriting"], - ["Shaw", "Shavian"], - ["Shrd", "Sharada"], - ["Sidd", "Siddham"], - ["Sind", "Khudawadi"], - ["Sinh", "Sinhala"], - ["Sogd", "Sogdian"], - ["Sogo", "Old_Sogdian"], - ["Sora", "Sora_Sompeng"], - ["Soyo", "Soyombo"], - ["Sund", "Sundanese"], - ["Sylo", "Syloti_Nagri"], - ["Syrc", "Syriac"], - ["Tagb", "Tagbanwa"], - ["Takr", "Takri"], - ["Tale", "Tai_Le"], - ["Talu", "New_Tai_Lue"], - ["Taml", "Tamil"], - ["Tang", "Tangut"], - ["Tavt", "Tai_Viet"], - ["Telu", "Telugu"], - ["Tfng", "Tifinagh"], - ["Tglg", "Tagalog"], - ["Thaa", "Thaana"], - ["Thai", "Thai"], - ["Tibt", "Tibetan"], - ["Tirh", "Tirhuta"], - ["Ugar", "Ugaritic"], - ["Vaii", "Vai"], - ["Wara", "Warang_Citi"], - ["Xpeo", "Old_Persian"], - ["Xsux", "Cuneiform"], - ["Yiii", "Yi"], - ["Zanb", "Zanabazar_Square"], - ["Zinh", "Inherited"], - ["Qaai", "Inherited"], - ["Zyyy", "Common"], - ["Zzzz", "Unknown"], - ["Adlam", "Adlam"], - ["Caucasian_Albanian", "Caucasian_Albanian"], - ["Arabic", "Arabic"], - ["Imperial_Aramaic", "Imperial_Aramaic"], - ["Armenian", "Armenian"], - ["Avestan", "Avestan"], - ["Balinese", "Balinese"], - ["Bamum", "Bamum"], - ["Bassa_Vah", "Bassa_Vah"], - ["Batak", "Batak"], - ["Bengali", "Bengali"], - ["Bhaiksuki", "Bhaiksuki"], - ["Bopomofo", "Bopomofo"], - ["Brahmi", "Brahmi"], - ["Braille", "Braille"], - ["Buginese", "Buginese"], - ["Buhid", "Buhid"], - ["Chakma", "Chakma"], - ["Canadian_Aboriginal", "Canadian_Aboriginal"], - ["Carian", "Carian"], - ["Cherokee", "Cherokee"], - ["Coptic", "Coptic"], - ["Cypriot", "Cypriot"], - ["Cyrillic", "Cyrillic"], - ["Devanagari", "Devanagari"], - ["Dogra", "Dogra"], - ["Deseret", "Deseret"], - ["Duployan", "Duployan"], - ["Egyptian_Hieroglyphs", "Egyptian_Hieroglyphs"], - ["Elbasan", "Elbasan"], - ["Ethiopic", "Ethiopic"], - ["Georgian", "Georgian"], - ["Glagolitic", "Glagolitic"], - ["Gunjala_Gondi", "Gunjala_Gondi"], - ["Masaram_Gondi", "Masaram_Gondi"], - ["Gothic", "Gothic"], - ["Grantha", "Grantha"], - ["Greek", "Greek"], - ["Gujarati", "Gujarati"], - ["Gurmukhi", "Gurmukhi"], - ["Hangul", "Hangul"], - ["Han", "Han"], - ["Hanunoo", "Hanunoo"], - ["Hatran", "Hatran"], - ["Hebrew", "Hebrew"], - ["Hiragana", "Hiragana"], - ["Anatolian_Hieroglyphs", "Anatolian_Hieroglyphs"], - ["Pahawh_Hmong", "Pahawh_Hmong"], - ["Katakana_Or_Hiragana", "Katakana_Or_Hiragana"], - ["Old_Hungarian", "Old_Hungarian"], - ["Old_Italic", "Old_Italic"], - ["Javanese", "Javanese"], - ["Kayah_Li", "Kayah_Li"], - ["Katakana", "Katakana"], - ["Kharoshthi", "Kharoshthi"], - ["Khmer", "Khmer"], - ["Khojki", "Khojki"], - ["Kannada", "Kannada"], - ["Kaithi", "Kaithi"], - ["Tai_Tham", "Tai_Tham"], - ["Lao", "Lao"], - ["Latin", "Latin"], - ["Lepcha", "Lepcha"], - ["Limbu", "Limbu"], - ["Linear_A", "Linear_A"], - ["Linear_B", "Linear_B"], - ["Lycian", "Lycian"], - ["Lydian", "Lydian"], - ["Mahajani", "Mahajani"], - ["Makasar", "Makasar"], - ["Mandaic", "Mandaic"], - ["Manichaean", "Manichaean"], - ["Marchen", "Marchen"], - ["Medefaidrin", "Medefaidrin"], - ["Mende_Kikakui", "Mende_Kikakui"], - ["Meroitic_Cursive", "Meroitic_Cursive"], - ["Meroitic_Hieroglyphs", "Meroitic_Hieroglyphs"], - ["Malayalam", "Malayalam"], - ["Mongolian", "Mongolian"], - ["Mro", "Mro"], - ["Meetei_Mayek", "Meetei_Mayek"], - ["Multani", "Multani"], - ["Myanmar", "Myanmar"], - ["Old_North_Arabian", "Old_North_Arabian"], - ["Nabataean", "Nabataean"], - ["Nko", "Nko"], - ["Nushu", "Nushu"], - ["Ogham", "Ogham"], - ["Ol_Chiki", "Ol_Chiki"], - ["Old_Turkic", "Old_Turkic"], - ["Oriya", "Oriya"], - ["Osage", "Osage"], - ["Osmanya", "Osmanya"], - ["Palmyrene", "Palmyrene"], - ["Pau_Cin_Hau", "Pau_Cin_Hau"], - ["Old_Permic", "Old_Permic"], - ["Phags_Pa", "Phags_Pa"], - ["Inscriptional_Pahlavi", "Inscriptional_Pahlavi"], - ["Psalter_Pahlavi", "Psalter_Pahlavi"], - ["Phoenician", "Phoenician"], - ["Miao", "Miao"], - ["Inscriptional_Parthian", "Inscriptional_Parthian"], - ["Rejang", "Rejang"], - ["Hanifi_Rohingya", "Hanifi_Rohingya"], - ["Runic", "Runic"], - ["Samaritan", "Samaritan"], - ["Old_South_Arabian", "Old_South_Arabian"], - ["Saurashtra", "Saurashtra"], - ["SignWriting", "SignWriting"], - ["Shavian", "Shavian"], - ["Sharada", "Sharada"], - ["Siddham", "Siddham"], - ["Khudawadi", "Khudawadi"], - ["Sinhala", "Sinhala"], - ["Sogdian", "Sogdian"], - ["Old_Sogdian", "Old_Sogdian"], - ["Sora_Sompeng", "Sora_Sompeng"], - ["Soyombo", "Soyombo"], - ["Sundanese", "Sundanese"], - ["Syloti_Nagri", "Syloti_Nagri"], - ["Syriac", "Syriac"], - ["Tagbanwa", "Tagbanwa"], - ["Takri", "Takri"], - ["Tai_Le", "Tai_Le"], - ["New_Tai_Lue", "New_Tai_Lue"], - ["Tamil", "Tamil"], - ["Tangut", "Tangut"], - ["Tai_Viet", "Tai_Viet"], - ["Telugu", "Telugu"], - ["Tifinagh", "Tifinagh"], - ["Tagalog", "Tagalog"], - ["Thaana", "Thaana"], - ["Tibetan", "Tibetan"], - ["Tirhuta", "Tirhuta"], - ["Ugaritic", "Ugaritic"], - ["Vai", "Vai"], - ["Warang_Citi", "Warang_Citi"], - ["Old_Persian", "Old_Persian"], - ["Cuneiform", "Cuneiform"], - ["Yi", "Yi"], - ["Zanabazar_Square", "Zanabazar_Square"], - ["Inherited", "Inherited"], - ["Common", "Common"], - ["Unknown", "Unknown"] - ])], - ["Script_Extensions", /* @__PURE__ */ new Map([ - ["Adlm", "Adlam"], - ["Aghb", "Caucasian_Albanian"], - ["Ahom", "Ahom"], - ["Arab", "Arabic"], - ["Armi", "Imperial_Aramaic"], - ["Armn", "Armenian"], - ["Avst", "Avestan"], - ["Bali", "Balinese"], - ["Bamu", "Bamum"], - ["Bass", "Bassa_Vah"], - ["Batk", "Batak"], - ["Beng", "Bengali"], - ["Bhks", "Bhaiksuki"], - ["Bopo", "Bopomofo"], - ["Brah", "Brahmi"], - ["Brai", "Braille"], - ["Bugi", "Buginese"], - ["Buhd", "Buhid"], - ["Cakm", "Chakma"], - ["Cans", "Canadian_Aboriginal"], - ["Cari", "Carian"], - ["Cham", "Cham"], - ["Cher", "Cherokee"], - ["Copt", "Coptic"], - ["Qaac", "Coptic"], - ["Cprt", "Cypriot"], - ["Cyrl", "Cyrillic"], - ["Deva", "Devanagari"], - ["Dogr", "Dogra"], - ["Dsrt", "Deseret"], - ["Dupl", "Duployan"], - ["Egyp", "Egyptian_Hieroglyphs"], - ["Elba", "Elbasan"], - ["Ethi", "Ethiopic"], - ["Geor", "Georgian"], - ["Glag", "Glagolitic"], - ["Gong", "Gunjala_Gondi"], - ["Gonm", "Masaram_Gondi"], - ["Goth", "Gothic"], - ["Gran", "Grantha"], - ["Grek", "Greek"], - ["Gujr", "Gujarati"], - ["Guru", "Gurmukhi"], - ["Hang", "Hangul"], - ["Hani", "Han"], - ["Hano", "Hanunoo"], - ["Hatr", "Hatran"], - ["Hebr", "Hebrew"], - ["Hira", "Hiragana"], - ["Hluw", "Anatolian_Hieroglyphs"], - ["Hmng", "Pahawh_Hmong"], - ["Hrkt", "Katakana_Or_Hiragana"], - ["Hung", "Old_Hungarian"], - ["Ital", "Old_Italic"], - ["Java", "Javanese"], - ["Kali", "Kayah_Li"], - ["Kana", "Katakana"], - ["Khar", "Kharoshthi"], - ["Khmr", "Khmer"], - ["Khoj", "Khojki"], - ["Knda", "Kannada"], - ["Kthi", "Kaithi"], - ["Lana", "Tai_Tham"], - ["Laoo", "Lao"], - ["Latn", "Latin"], - ["Lepc", "Lepcha"], - ["Limb", "Limbu"], - ["Lina", "Linear_A"], - ["Linb", "Linear_B"], - ["Lisu", "Lisu"], - ["Lyci", "Lycian"], - ["Lydi", "Lydian"], - ["Mahj", "Mahajani"], - ["Maka", "Makasar"], - ["Mand", "Mandaic"], - ["Mani", "Manichaean"], - ["Marc", "Marchen"], - ["Medf", "Medefaidrin"], - ["Mend", "Mende_Kikakui"], - ["Merc", "Meroitic_Cursive"], - ["Mero", "Meroitic_Hieroglyphs"], - ["Mlym", "Malayalam"], - ["Modi", "Modi"], - ["Mong", "Mongolian"], - ["Mroo", "Mro"], - ["Mtei", "Meetei_Mayek"], - ["Mult", "Multani"], - ["Mymr", "Myanmar"], - ["Narb", "Old_North_Arabian"], - ["Nbat", "Nabataean"], - ["Newa", "Newa"], - ["Nkoo", "Nko"], - ["Nshu", "Nushu"], - ["Ogam", "Ogham"], - ["Olck", "Ol_Chiki"], - ["Orkh", "Old_Turkic"], - ["Orya", "Oriya"], - ["Osge", "Osage"], - ["Osma", "Osmanya"], - ["Palm", "Palmyrene"], - ["Pauc", "Pau_Cin_Hau"], - ["Perm", "Old_Permic"], - ["Phag", "Phags_Pa"], - ["Phli", "Inscriptional_Pahlavi"], - ["Phlp", "Psalter_Pahlavi"], - ["Phnx", "Phoenician"], - ["Plrd", "Miao"], - ["Prti", "Inscriptional_Parthian"], - ["Rjng", "Rejang"], - ["Rohg", "Hanifi_Rohingya"], - ["Runr", "Runic"], - ["Samr", "Samaritan"], - ["Sarb", "Old_South_Arabian"], - ["Saur", "Saurashtra"], - ["Sgnw", "SignWriting"], - ["Shaw", "Shavian"], - ["Shrd", "Sharada"], - ["Sidd", "Siddham"], - ["Sind", "Khudawadi"], - ["Sinh", "Sinhala"], - ["Sogd", "Sogdian"], - ["Sogo", "Old_Sogdian"], - ["Sora", "Sora_Sompeng"], - ["Soyo", "Soyombo"], - ["Sund", "Sundanese"], - ["Sylo", "Syloti_Nagri"], - ["Syrc", "Syriac"], - ["Tagb", "Tagbanwa"], - ["Takr", "Takri"], - ["Tale", "Tai_Le"], - ["Talu", "New_Tai_Lue"], - ["Taml", "Tamil"], - ["Tang", "Tangut"], - ["Tavt", "Tai_Viet"], - ["Telu", "Telugu"], - ["Tfng", "Tifinagh"], - ["Tglg", "Tagalog"], - ["Thaa", "Thaana"], - ["Thai", "Thai"], - ["Tibt", "Tibetan"], - ["Tirh", "Tirhuta"], - ["Ugar", "Ugaritic"], - ["Vaii", "Vai"], - ["Wara", "Warang_Citi"], - ["Xpeo", "Old_Persian"], - ["Xsux", "Cuneiform"], - ["Yiii", "Yi"], - ["Zanb", "Zanabazar_Square"], - ["Zinh", "Inherited"], - ["Qaai", "Inherited"], - ["Zyyy", "Common"], - ["Zzzz", "Unknown"], - ["Adlam", "Adlam"], - ["Caucasian_Albanian", "Caucasian_Albanian"], - ["Arabic", "Arabic"], - ["Imperial_Aramaic", "Imperial_Aramaic"], - ["Armenian", "Armenian"], - ["Avestan", "Avestan"], - ["Balinese", "Balinese"], - ["Bamum", "Bamum"], - ["Bassa_Vah", "Bassa_Vah"], - ["Batak", "Batak"], - ["Bengali", "Bengali"], - ["Bhaiksuki", "Bhaiksuki"], - ["Bopomofo", "Bopomofo"], - ["Brahmi", "Brahmi"], - ["Braille", "Braille"], - ["Buginese", "Buginese"], - ["Buhid", "Buhid"], - ["Chakma", "Chakma"], - ["Canadian_Aboriginal", "Canadian_Aboriginal"], - ["Carian", "Carian"], - ["Cherokee", "Cherokee"], - ["Coptic", "Coptic"], - ["Cypriot", "Cypriot"], - ["Cyrillic", "Cyrillic"], - ["Devanagari", "Devanagari"], - ["Dogra", "Dogra"], - ["Deseret", "Deseret"], - ["Duployan", "Duployan"], - ["Egyptian_Hieroglyphs", "Egyptian_Hieroglyphs"], - ["Elbasan", "Elbasan"], - ["Ethiopic", "Ethiopic"], - ["Georgian", "Georgian"], - ["Glagolitic", "Glagolitic"], - ["Gunjala_Gondi", "Gunjala_Gondi"], - ["Masaram_Gondi", "Masaram_Gondi"], - ["Gothic", "Gothic"], - ["Grantha", "Grantha"], - ["Greek", "Greek"], - ["Gujarati", "Gujarati"], - ["Gurmukhi", "Gurmukhi"], - ["Hangul", "Hangul"], - ["Han", "Han"], - ["Hanunoo", "Hanunoo"], - ["Hatran", "Hatran"], - ["Hebrew", "Hebrew"], - ["Hiragana", "Hiragana"], - ["Anatolian_Hieroglyphs", "Anatolian_Hieroglyphs"], - ["Pahawh_Hmong", "Pahawh_Hmong"], - ["Katakana_Or_Hiragana", "Katakana_Or_Hiragana"], - ["Old_Hungarian", "Old_Hungarian"], - ["Old_Italic", "Old_Italic"], - ["Javanese", "Javanese"], - ["Kayah_Li", "Kayah_Li"], - ["Katakana", "Katakana"], - ["Kharoshthi", "Kharoshthi"], - ["Khmer", "Khmer"], - ["Khojki", "Khojki"], - ["Kannada", "Kannada"], - ["Kaithi", "Kaithi"], - ["Tai_Tham", "Tai_Tham"], - ["Lao", "Lao"], - ["Latin", "Latin"], - ["Lepcha", "Lepcha"], - ["Limbu", "Limbu"], - ["Linear_A", "Linear_A"], - ["Linear_B", "Linear_B"], - ["Lycian", "Lycian"], - ["Lydian", "Lydian"], - ["Mahajani", "Mahajani"], - ["Makasar", "Makasar"], - ["Mandaic", "Mandaic"], - ["Manichaean", "Manichaean"], - ["Marchen", "Marchen"], - ["Medefaidrin", "Medefaidrin"], - ["Mende_Kikakui", "Mende_Kikakui"], - ["Meroitic_Cursive", "Meroitic_Cursive"], - ["Meroitic_Hieroglyphs", "Meroitic_Hieroglyphs"], - ["Malayalam", "Malayalam"], - ["Mongolian", "Mongolian"], - ["Mro", "Mro"], - ["Meetei_Mayek", "Meetei_Mayek"], - ["Multani", "Multani"], - ["Myanmar", "Myanmar"], - ["Old_North_Arabian", "Old_North_Arabian"], - ["Nabataean", "Nabataean"], - ["Nko", "Nko"], - ["Nushu", "Nushu"], - ["Ogham", "Ogham"], - ["Ol_Chiki", "Ol_Chiki"], - ["Old_Turkic", "Old_Turkic"], - ["Oriya", "Oriya"], - ["Osage", "Osage"], - ["Osmanya", "Osmanya"], - ["Palmyrene", "Palmyrene"], - ["Pau_Cin_Hau", "Pau_Cin_Hau"], - ["Old_Permic", "Old_Permic"], - ["Phags_Pa", "Phags_Pa"], - ["Inscriptional_Pahlavi", "Inscriptional_Pahlavi"], - ["Psalter_Pahlavi", "Psalter_Pahlavi"], - ["Phoenician", "Phoenician"], - ["Miao", "Miao"], - ["Inscriptional_Parthian", "Inscriptional_Parthian"], - ["Rejang", "Rejang"], - ["Hanifi_Rohingya", "Hanifi_Rohingya"], - ["Runic", "Runic"], - ["Samaritan", "Samaritan"], - ["Old_South_Arabian", "Old_South_Arabian"], - ["Saurashtra", "Saurashtra"], - ["SignWriting", "SignWriting"], - ["Shavian", "Shavian"], - ["Sharada", "Sharada"], - ["Siddham", "Siddham"], - ["Khudawadi", "Khudawadi"], - ["Sinhala", "Sinhala"], - ["Sogdian", "Sogdian"], - ["Old_Sogdian", "Old_Sogdian"], - ["Sora_Sompeng", "Sora_Sompeng"], - ["Soyombo", "Soyombo"], - ["Sundanese", "Sundanese"], - ["Syloti_Nagri", "Syloti_Nagri"], - ["Syriac", "Syriac"], - ["Tagbanwa", "Tagbanwa"], - ["Takri", "Takri"], - ["Tai_Le", "Tai_Le"], - ["New_Tai_Lue", "New_Tai_Lue"], - ["Tamil", "Tamil"], - ["Tangut", "Tangut"], - ["Tai_Viet", "Tai_Viet"], - ["Telugu", "Telugu"], - ["Tifinagh", "Tifinagh"], - ["Tagalog", "Tagalog"], - ["Thaana", "Thaana"], - ["Tibetan", "Tibetan"], - ["Tirhuta", "Tirhuta"], - ["Ugaritic", "Ugaritic"], - ["Vai", "Vai"], - ["Warang_Citi", "Warang_Citi"], - ["Old_Persian", "Old_Persian"], - ["Cuneiform", "Cuneiform"], - ["Yi", "Yi"], - ["Zanabazar_Square", "Zanabazar_Square"], - ["Inherited", "Inherited"], - ["Common", "Common"], - ["Unknown", "Unknown"] - ])] -]); -const mappings$1 = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - default: mappings -}, [mappings]); -const require$$1$6 = /* @__PURE__ */ getAugmentedNamespace(mappings$1); -const propertyToValueAliases = require$$1$6; -const matchPropertyValue = function(property, value) { - const aliasToValue = propertyToValueAliases.get(property); - if (!aliasToValue) { - throw new Error(`Unknown property \`${property}\`.`); - } - const canonicalValue = aliasToValue.get(value); - if (canonicalValue) { - return canonicalValue; - } - throw new Error( - `Unknown value \`${value}\` for property \`${property}\`.` - ); -}; -var unicodeMatchPropertyValueEcmascript = matchPropertyValue; -const unicodeMatchPropertyValueEcmascript$1 = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - default: unicodeMatchPropertyValueEcmascript -}, [unicodeMatchPropertyValueEcmascript]); -const require$$0$8 = /* @__PURE__ */ getAugmentedNamespace(unicodeMatchPropertyValueEcmascript$1); -var unicodeCanonicalPropertyNamesEcmascript = /* @__PURE__ */ new Set([ - "General_Category", - "Script", - "Script_Extensions", - "Alphabetic", - "Any", - "ASCII", - "ASCII_Hex_Digit", - "Assigned", - "Bidi_Control", - "Bidi_Mirrored", - "Case_Ignorable", - "Cased", - "Changes_When_Casefolded", - "Changes_When_Casemapped", - "Changes_When_Lowercased", - "Changes_When_NFKC_Casefolded", - "Changes_When_Titlecased", - "Changes_When_Uppercased", - "Dash", - "Default_Ignorable_Code_Point", - "Deprecated", - "Diacritic", - "Emoji", - "Emoji_Component", - "Emoji_Modifier", - "Emoji_Modifier_Base", - "Emoji_Presentation", - "Extended_Pictographic", - "Extender", - "Grapheme_Base", - "Grapheme_Extend", - "Hex_Digit", - "ID_Continue", - "ID_Start", - "Ideographic", - "IDS_Binary_Operator", - "IDS_Trinary_Operator", - "Join_Control", - "Logical_Order_Exception", - "Lowercase", - "Math", - "Noncharacter_Code_Point", - "Pattern_Syntax", - "Pattern_White_Space", - "Quotation_Mark", - "Radical", - "Regional_Indicator", - "Sentence_Terminal", - "Soft_Dotted", - "Terminal_Punctuation", - "Unified_Ideograph", - "Uppercase", - "Variation_Selector", - "White_Space", - "XID_Continue", - "XID_Start" -]); -const unicodeCanonicalPropertyNamesEcmascript$1 = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - default: unicodeCanonicalPropertyNamesEcmascript -}, [unicodeCanonicalPropertyNamesEcmascript]); -const require$$0$7 = /* @__PURE__ */ getAugmentedNamespace(unicodeCanonicalPropertyNamesEcmascript$1); -var unicodePropertyAliasesEcmascript = /* @__PURE__ */ new Map([ - ["scx", "Script_Extensions"], - ["sc", "Script"], - ["gc", "General_Category"], - ["AHex", "ASCII_Hex_Digit"], - ["Alpha", "Alphabetic"], - ["Bidi_C", "Bidi_Control"], - ["Bidi_M", "Bidi_Mirrored"], - ["Cased", "Cased"], - ["CI", "Case_Ignorable"], - ["CWCF", "Changes_When_Casefolded"], - ["CWCM", "Changes_When_Casemapped"], - ["CWKCF", "Changes_When_NFKC_Casefolded"], - ["CWL", "Changes_When_Lowercased"], - ["CWT", "Changes_When_Titlecased"], - ["CWU", "Changes_When_Uppercased"], - ["Dash", "Dash"], - ["Dep", "Deprecated"], - ["DI", "Default_Ignorable_Code_Point"], - ["Dia", "Diacritic"], - ["Ext", "Extender"], - ["Gr_Base", "Grapheme_Base"], - ["Gr_Ext", "Grapheme_Extend"], - ["Hex", "Hex_Digit"], - ["IDC", "ID_Continue"], - ["Ideo", "Ideographic"], - ["IDS", "ID_Start"], - ["IDSB", "IDS_Binary_Operator"], - ["IDST", "IDS_Trinary_Operator"], - ["Join_C", "Join_Control"], - ["LOE", "Logical_Order_Exception"], - ["Lower", "Lowercase"], - ["Math", "Math"], - ["NChar", "Noncharacter_Code_Point"], - ["Pat_Syn", "Pattern_Syntax"], - ["Pat_WS", "Pattern_White_Space"], - ["QMark", "Quotation_Mark"], - ["Radical", "Radical"], - ["RI", "Regional_Indicator"], - ["SD", "Soft_Dotted"], - ["STerm", "Sentence_Terminal"], - ["Term", "Terminal_Punctuation"], - ["UIdeo", "Unified_Ideograph"], - ["Upper", "Uppercase"], - ["VS", "Variation_Selector"], - ["WSpace", "White_Space"], - ["space", "White_Space"], - ["XIDC", "XID_Continue"], - ["XIDS", "XID_Start"] -]); -const unicodePropertyAliasesEcmascript$1 = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - default: unicodePropertyAliasesEcmascript -}, [unicodePropertyAliasesEcmascript]); -const require$$3$4 = /* @__PURE__ */ getAugmentedNamespace(unicodePropertyAliasesEcmascript$1); -const canonicalProperties = require$$0$7; -const propertyAliases = require$$3$4; -const matchProperty = function(property) { - if (canonicalProperties.has(property)) { - return property; - } - if (propertyAliases.has(property)) { - return propertyAliases.get(property); - } - throw new Error(`Unknown property: ${property}`); -}; -var unicodeMatchPropertyEcmascript = matchProperty; -const unicodeMatchPropertyEcmascript$1 = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - default: unicodeMatchPropertyEcmascript -}, [unicodeMatchPropertyEcmascript]); -const require$$2$4 = /* @__PURE__ */ getAugmentedNamespace(unicodeMatchPropertyEcmascript$1); -var unicode$3 = {}; -var idContinueBool_1$1; -var idContinueLargeRegex_1$1; -var idStartBool_1$1; -var idStartLargeRegex_1$1; -var whitespaceBool_1$1; -var whitespaceArray_1$1; -Object.defineProperty(unicode$3, "__esModule", { - value: true -}); -whitespaceArray_1$1 = unicode$3.whitespaceArray = [5760, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8239, 8287, 12288, 65279]; -whitespaceBool_1$1 = unicode$3.whitespaceBool = [false, false, false, false, false, false, false, false, false, true, false, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false]; -idStartLargeRegex_1$1 = unicode$3.idStartLargeRegex = /^[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\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\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\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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-\u2C2E\u2C30-\u2C5E\u2C60-\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-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]$/; -idStartBool_1$1 = unicode$3.idStartBool = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, false]; -idContinueLargeRegex_1$1 = unicode$3.idContinueLargeRegex = /^[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]$/; -idContinueBool_1$1 = unicode$3.idContinueBool = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, true, true, true, true, true, true, true, true, true, true, false, false, false, false, false, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, false]; -const unicode$2 = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - get whitespaceArray() { - return whitespaceArray_1$1; - }, - get whitespaceBool() { - return whitespaceBool_1$1; - }, - get idStartLargeRegex() { - return idStartLargeRegex_1$1; - }, - get idStartBool() { - return idStartBool_1$1; - }, - get idContinueLargeRegex() { - return idContinueLargeRegex_1$1; - }, - get idContinueBool() { - return idContinueBool_1$1; - }, - default: unicode$3 -}, [unicode$3]); -const require$$4$2 = /* @__PURE__ */ getAugmentedNamespace(unicode$2); -Object.defineProperty(dist$a, "__esModule", { - value: true -}); -var _createClass$d = function() { - function defineProperties(target, props) { - for (var i2 = 0; i2 < props.length; i2++) { - var descriptor = props[i2]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - return function(Constructor, protoProps, staticProps) { - if (protoProps) - defineProperties(Constructor.prototype, protoProps); - if (staticProps) - defineProperties(Constructor, staticProps); - return Constructor; - }; -}(); -var _unicodeMatchPropertyValueEcmascript = require$$0$8; -var _unicodeMatchPropertyValueEcmascript2 = _interopRequireDefault$9(_unicodeMatchPropertyValueEcmascript); -var _mappings = require$$1$6; -var _mappings2 = _interopRequireDefault$9(_mappings); -var _unicodeMatchPropertyEcmascript = require$$2$4; -var _unicodeMatchPropertyEcmascript2 = _interopRequireDefault$9(_unicodeMatchPropertyEcmascript); -var _unicodePropertyAliasesEcmascript = require$$3$4; -var _unicodePropertyAliasesEcmascript2 = _interopRequireDefault$9(_unicodePropertyAliasesEcmascript); -var _unicode$1 = require$$4$2; -function _interopRequireDefault$9(obj) { - return obj && obj.__esModule ? obj : { default: obj }; -} -function _toConsumableArray$6(arr) { - if (Array.isArray(arr)) { - for (var i2 = 0, arr2 = Array(arr.length); i2 < arr.length; i2++) { - arr2[i2] = arr[i2]; - } - return arr2; - } else { - return Array.from(arr); - } -} -function _classCallCheck$h(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} -var catchIsFalse = function catchIsFalse2(predicate) { - try { - return !!predicate(); - } catch (e) { - return false; - } -}; -var syntaxCharacters = "^$\\.*+?()[]{}|".split(""); -var extendedSyntaxCharacters = "^$\\.*+?()[|".split(""); -var controlEscapeCharacters = "fnrtv".split(""); -var controlEscapeCharacterValues = { "f": "\f".charCodeAt(0), "n": "\n".charCodeAt(0), "r": "\r".charCodeAt(0), "t": " ".charCodeAt(0), "v": "\v".charCodeAt(0) }; -var controlCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""); -var hexDigits = "0123456789abcdefABCDEF".split(""); -var decimalDigits = "0123456789".split(""); -var octalDigits = "01234567".split(""); -var INVALID_NAMED_BACKREFERENCE_SENTINEL = {}; -function isIdentifierStart(ch) { - return ch < 128 ? _unicode$1.idStartBool[ch] : _unicode$1.idStartLargeRegex.test(String.fromCodePoint(ch)); -} -function isIdentifierPart(ch) { - return ch < 128 ? _unicode$1.idContinueBool[ch] : _unicode$1.idContinueLargeRegex.test(String.fromCodePoint(ch)); -} -var PatternAcceptorState = function() { - function PatternAcceptorState2(pattern, unicode2) { - _classCallCheck$h(this, PatternAcceptorState2); - this.pattern = pattern; - this.unicode = unicode2; - this.index = 0; - this.largestBackreference = 0; - this.backreferenceNames = []; - this.groupingNames = []; - this.capturingGroups = 0; - } - _createClass$d(PatternAcceptorState2, [{ - key: "empty", - value: function empty6() { - return this.index >= this.pattern.length; - } - }, { - key: "backreference", - value: function backreference(ref) { - if (ref > this.largestBackreference) { - this.largestBackreference = ref; - } - } - }, { - key: "nextCodePoint", - value: function nextCodePoint() { - if (this.empty()) { - return null; - } - if (this.unicode) { - return String.fromCodePoint(this.pattern.codePointAt(this.index)); - } - return this.pattern.charAt(this.index); - } - }, { - key: "skipCodePoint", - value: function skipCodePoint() { - this.index += this.nextCodePoint().length; - } - }, { - key: "eat", - value: function eat(str) { - if (this.index + str.length > this.pattern.length || this.pattern.slice(this.index, this.index + str.length) !== str) { - return false; - } - this.index += str.length; - return true; - } - }, { - key: "eatIdentifierCodePoint", - value: function eatIdentifierCodePoint() { - var characterValue = void 0; - var originalIndex = this.index; - var character = void 0; - if (this.match("\\u")) { - this.skipCodePoint(); - characterValue = acceptUnicodeEscape(this); - if (!characterValue.matched) { - this.index = originalIndex; - return null; - } - characterValue = characterValue.value; - character = String.fromCodePoint(characterValue); - } else { - character = this.nextCodePoint(); - if (character == null) { - this.index = originalIndex; - return null; - } - this.index += character.length; - characterValue = character.codePointAt(0); - } - return { character, characterValue }; - } - }, { - key: "eatIdentifierStart", - value: function eatIdentifierStart() { - var originalIndex = this.index; - var codePoint = this.eatIdentifierCodePoint(); - if (codePoint === null) { - this.index = originalIndex; - return null; - } - if (codePoint.character === "_" || codePoint.character === "$" || isIdentifierStart(codePoint.characterValue)) { - return codePoint.character; - } - this.index = originalIndex; - return null; - } - }, { - key: "eatIdentifierPart", - value: function eatIdentifierPart() { - var originalIndex = this.index; - var codePoint = this.eatIdentifierCodePoint(); - if (codePoint === null) { - this.index = originalIndex; - return null; - } - if (codePoint.character === "\u200C" || codePoint.character === "\u200D" || codePoint.character === "$" || isIdentifierPart(codePoint.characterValue)) { - return codePoint.character; - } - this.index = originalIndex; - return null; - } - }, { - key: "eatAny", - value: function eatAny() { - for (var _len = arguments.length, strs = Array(_len), _key = 0; _key < _len; _key++) { - strs[_key] = arguments[_key]; - } - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = void 0; - try { - for (var _iterator = strs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var str = _step.value; - if (this.eat(str)) { - return str; - } - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - return null; - } - }, { - key: "match", - value: function match(str) { - return this.index + str.length <= this.pattern.length && this.pattern.slice(this.index, this.index + str.length) === str; - } - }, { - key: "matchAny", - value: function matchAny() { - for (var _len2 = arguments.length, strs = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - strs[_key2] = arguments[_key2]; - } - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = void 0; - try { - for (var _iterator2 = strs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var str = _step2.value; - if (this.match(str)) { - return true; - } - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - return false; - } - }, { - key: "eatNaturalNumber", - value: function eatNaturalNumber() { - var _this = this; - var characters = []; - var eatNumber = function eatNumber2() { - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = void 0; - try { - for (var _iterator3 = decimalDigits[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { - var str = _step3.value; - if (_this.eat(str)) { - characters.push(str); - return true; - } - } - } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; - } finally { - try { - if (!_iteratorNormalCompletion3 && _iterator3.return) { - _iterator3.return(); - } - } finally { - if (_didIteratorError3) { - throw _iteratorError3; - } - } - } - return false; - }; - while (eatNumber()) { - } - return characters.length === 0 ? null : characters.join(""); - } - }]); - return PatternAcceptorState2; -}(); -var _default$b = dist$a.default = function(pattern) { - var _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _ref$unicode = _ref.unicode, unicode2 = _ref$unicode === void 0 ? false : _ref$unicode; - var state = new PatternAcceptorState(pattern, unicode2); - var accepted = acceptDisjunction(state); - if (accepted.matched) { - if (state.unicode) { - if (state.largestBackreference > state.capturingGroups) { - return false; - } - } - if (state.groupingNames.length > 0 || state.unicode) { - var _iteratorNormalCompletion4 = true; - var _didIteratorError4 = false; - var _iteratorError4 = void 0; - try { - for (var _iterator4 = state.backreferenceNames[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { - var backreferenceName = _step4.value; - if (state.groupingNames.indexOf(backreferenceName) === -1) { - return false; - } - } - } catch (err) { - _didIteratorError4 = true; - _iteratorError4 = err; - } finally { - try { - if (!_iteratorNormalCompletion4 && _iterator4.return) { - _iterator4.return(); - } - } finally { - if (_didIteratorError4) { - throw _iteratorError4; - } - } - } - } - } - return accepted.matched; -}; -var backtrackOnFailure = function backtrackOnFailure2(func) { - return function(state) { - var savedIndex = state.index; - var oldBackreference = state.largestBackreference; - var oldCapturingGroups = state.capturingGroups; - var val = func(state); - if (!val.matched) { - state.index = savedIndex; - state.largestBackreference = oldBackreference; - state.capturingGroups = oldCapturingGroups; - } - return val; - }; -}; -var acceptUnicodeEscape = backtrackOnFailure(function(state) { - if (!state.eat("u")) { - return { matched: false }; - } - if (state.unicode && state.eat("{")) { - var _digits = []; - while (!state.eat("}")) { - var digit = state.eatAny.apply(state, _toConsumableArray$6(hexDigits)); - if (digit === null) { - return { matched: false }; - } - _digits.push(digit); - } - var _value = parseInt(_digits.join(""), 16); - return _value > 1114111 ? { matched: false } : { matched: true, value: _value }; - } - var digits = [0, 0, 0, 0].map(function() { - return state.eatAny.apply(state, _toConsumableArray$6(hexDigits)); - }); - if (digits.some(function(digit2) { - return digit2 === null; - })) { - return { matched: false }; - } - var value = parseInt(digits.join(""), 16); - if (state.unicode && value >= 55296 && value <= 56319) { - var surrogatePairValue = backtrackOnFailure(function(subState) { - if (!subState.eat("\\u")) { - return { matched: false }; - } - var digits2 = [0, 0, 0, 0].map(function() { - return subState.eatAny.apply(subState, _toConsumableArray$6(hexDigits)); - }); - if (digits2.some(function(digit2) { - return digit2 === null; - })) { - return { matched: false }; - } - var value2 = parseInt(digits2.join(""), 16); - if (value2 < 56320 || value2 >= 57344) { - return { matched: false }; - } - return { matched: true, value: 65536 + ((value & 1023) << 10) + (value2 & 1023) }; - })(state); - if (surrogatePairValue.matched) { - return surrogatePairValue; - } - } - return { matched: true, value }; -}); -var acceptDisjunction = function acceptDisjunction2(state, terminator) { - do { - if (terminator !== void 0 && state.eat(terminator)) { - return { matched: true }; - } else if (state.match("|")) { - continue; - } - if (!acceptAlternative(state, terminator).matched) { - return { matched: false }; - } - } while (state.eat("|")); - return { matched: terminator === void 0 || !!state.eat(terminator) }; -}; -var acceptAlternative = function acceptAlternative2(state, terminator) { - while (!state.match("|") && !state.empty() && (terminator === void 0 || !state.match(terminator))) { - if (!acceptTerm(state).matched) { - return { matched: false }; - } - } - return { matched: true }; -}; -var anyOf = function anyOf2() { - for (var _len3 = arguments.length, acceptors = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - acceptors[_key3] = arguments[_key3]; - } - return function(state) { - var _iteratorNormalCompletion5 = true; - var _didIteratorError5 = false; - var _iteratorError5 = void 0; - try { - for (var _iterator5 = acceptors[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { - var predicate = _step5.value; - var value = predicate(state); - if (value.matched) { - return value; - } - } - } catch (err) { - _didIteratorError5 = true; - _iteratorError5 = err; - } finally { - try { - if (!_iteratorNormalCompletion5 && _iterator5.return) { - _iterator5.return(); - } - } finally { - if (_didIteratorError5) { - throw _iteratorError5; - } - } - } - return { matched: false }; - }; -}; -var acceptTerm = function acceptTerm2(state) { - if (state.unicode) { - return anyOf(acceptAssertion, acceptQuantified(acceptAtom))(state); - } - return anyOf(acceptQuantified(acceptQuantifiableAssertion), acceptAssertion, acceptQuantified(acceptAtom))(state); -}; -var acceptLabeledGroup = function acceptLabeledGroup2(predicate) { - return backtrackOnFailure(function(state) { - if (!state.eat("(")) { - return { matched: false }; - } - if (predicate(state)) { - return acceptDisjunction(state, ")"); - } - return { matched: false }; - }); -}; -var acceptQuantifiableAssertion = acceptLabeledGroup(function(state) { - return !!state.eatAny("?=", "?!"); -}); -var acceptAssertion = function acceptAssertion2(state) { - if (state.eatAny("^", "$", "\\b", "\\B")) { - return { matched: true }; - } - return acceptLabeledGroup(function(subState) { - return subState.unicode ? !!subState.eatAny("?=", "?!", "?<=", "? parseInt(num2)) { - return { matched: false }; - } - } - if (!subState.eat("}")) { - return { matched: false }; - } - subState.eat("?"); - return { matched: true }; - })(state); - if (!value.matched) { - return { matched: !state.unicode }; - } - return value; - } else if (state.eatAny("*", "+", "?")) { - state.eat("?"); - } - return { matched: true }; - }); -}; -var acceptCharacterExcept = function acceptCharacterExcept2(characters) { - return function(state) { - var nextCodePoint = state.nextCodePoint(); - if (nextCodePoint === null || characters.indexOf(nextCodePoint) !== -1) { - return { matched: false }; - } - state.skipCodePoint(); - return { matched: true }; - }; -}; -var acceptPatternCharacter = acceptCharacterExcept(syntaxCharacters); -var acceptExtendedPatternCharacter = acceptCharacterExcept(extendedSyntaxCharacters); -var acceptInvalidBracedQuantifier = function acceptInvalidBracedQuantifier2(state) { - return backtrackOnFailure(function(subState) { - return { matched: !!(subState.eat("{") && acceptDecimal(subState).matched && (!subState.eat(",") || subState.match("}") || acceptDecimal(subState).matched) && subState.eat("}")) }; - })(state); -}; -var acceptAtom = function acceptAtom2(state) { - if (state.unicode) { - return anyOf(acceptPatternCharacter, function(subState) { - return { matched: !!subState.eat(".") }; - }, backtrackOnFailure(function(subState) { - return subState.eat("\\") ? acceptAtomEscape(subState) : { matched: false }; - }), acceptCharacterClass, acceptLabeledGroup(function(subState) { - return subState.eat("?:"); - }), acceptGrouping)(state); - } - var matched = anyOf(function(subState) { - return { matched: !!subState.eat(".") }; - }, backtrackOnFailure(function(subState) { - return subState.eat("\\") ? acceptAtomEscape(subState) : { matched: false }; - }), backtrackOnFailure(function(subState) { - return { matched: subState.eat("\\") && subState.match("c") }; - }), acceptCharacterClass, acceptLabeledGroup(function(subState) { - return subState.eat("?:"); - }), acceptGrouping)(state); - if (!matched.matched && acceptInvalidBracedQuantifier(state).matched) { - return { matched: false }; - } - return matched.matched ? matched : acceptExtendedPatternCharacter(state); -}; -var acceptGrouping = backtrackOnFailure(function(state) { - if (!state.eat("(")) { - return { matched: false }; - } - var groupName = backtrackOnFailure(function(subState) { - if (!state.eat("?")) { - return { matched: false }; - } - return acceptGroupName(subState); - })(state); - if (!acceptDisjunction(state, ")").matched) { - return { matched: false }; - } - if (groupName.matched) { - if (state.groupingNames.indexOf(groupName.data) !== -1) { - return { matched: false }; - } - state.groupingNames.push(groupName.data); - } - state.capturingGroups++; - return { matched: true }; -}); -var acceptDecimalEscape = backtrackOnFailure(function(state) { - var firstDecimal = state.eatAny.apply(state, _toConsumableArray$6(decimalDigits)); - if (firstDecimal === null) { - return { matched: false }; - } - if (firstDecimal === "0") { - return { matched: true }; - } - state.backreference(parseInt(firstDecimal + (state.eatNaturalNumber() || ""))); - return { matched: true }; -}); -var acceptCharacterClassEscape = function acceptCharacterClassEscape2(state) { - if (state.eatAny("d", "D", "s", "S", "w", "W")) { - return { matched: true }; - } - if (state.unicode) { - return backtrackOnFailure(function(subState) { - if (!subState.eat("p{") && !subState.eat("P{")) { - return { matched: false }; - } - if (!acceptUnicodePropertyValueExpression(subState).matched) { - return { matched: false }; - } - return { matched: !!subState.eat("}") }; - })(state); - } - return { matched: false }; -}; -var acceptUnicodePropertyName = function acceptUnicodePropertyName2(state) { - var characters = []; - var character = void 0; - while (character = state.eatAny.apply(state, _toConsumableArray$6(controlCharacters).concat(["_"]))) { - characters.push(character); - } - return { matched: characters.length > 0, data: characters.join("") }; -}; -var acceptUnicodePropertyValue = function acceptUnicodePropertyValue2(state) { - var characters = []; - var character = void 0; - while (character = state.eatAny.apply(state, _toConsumableArray$6(controlCharacters).concat(_toConsumableArray$6(decimalDigits), ["_"]))) { - characters.push(character); - } - return { matched: characters.length > 0, data: characters.join("") }; -}; -var illegalLoneUnicodePropertyNames = ["General_Category", "Script", "Script_Extensions", "scx", "sc", "gc"]; -var generalCategoryValues = _mappings2.default.get("General_Category"); -var acceptLoneUnicodePropertyNameOrValue = function acceptLoneUnicodePropertyNameOrValue2(state) { - var loneValue = acceptUnicodePropertyValue(state); - if (!loneValue.matched || illegalLoneUnicodePropertyNames.includes(loneValue.data)) { - return { matched: false }; - } - return { matched: catchIsFalse(function() { - return (0, _unicodeMatchPropertyEcmascript2.default)(loneValue.data); - }) || generalCategoryValues.get(loneValue.data) != null }; -}; -var acceptUnicodePropertyValueExpression = function acceptUnicodePropertyValueExpression2(state) { - return anyOf(backtrackOnFailure(function(subState) { - var name = acceptUnicodePropertyName(subState); - if (!name.matched || !subState.eat("=")) { - return { matched: false }; - } - var value = acceptUnicodePropertyValue(subState); - if (!value.matched) { - return { matched: false }; - } - return { matched: catchIsFalse(function() { - return (0, _unicodeMatchPropertyValueEcmascript2.default)(_unicodePropertyAliasesEcmascript2.default.get(name.data) || name.data, value.data); - }) }; - }), backtrackOnFailure(acceptLoneUnicodePropertyNameOrValue))(state); -}; -var acceptCharacterEscape = anyOf(function(state) { - var eaten = state.eatAny.apply(state, _toConsumableArray$6(controlEscapeCharacters)); - if (eaten === null) { - return { matched: false }; - } - return { matched: true, value: controlEscapeCharacterValues[eaten] }; -}, backtrackOnFailure(function(state) { - if (!state.eat("c")) { - return { matched: false }; - } - var character = state.eatAny.apply(state, _toConsumableArray$6(controlCharacters)); - if (character === null) { - return { matched: false }; - } - return { matched: true, value: character.charCodeAt(0) % 32 }; -}), backtrackOnFailure(function(state) { - if (!state.eat("0") || state.eatAny.apply(state, _toConsumableArray$6(decimalDigits))) { - return { matched: false }; - } - return { matched: true, value: 0 }; -}), backtrackOnFailure(function(state) { - if (!state.eat("x")) { - return { matched: false }; - } - var digits = [0, 0].map(function() { - return state.eatAny.apply(state, _toConsumableArray$6(hexDigits)); - }); - if (digits.some(function(value) { - return value === null; - })) { - return { matched: false }; - } - return { matched: true, value: parseInt(digits.join(""), 16) }; -}), acceptUnicodeEscape, backtrackOnFailure(function(state) { - if (state.unicode) { - return { matched: false }; - } - var octal1 = state.eatAny.apply(state, _toConsumableArray$6(octalDigits)); - if (octal1 === null) { - return { matched: false }; - } - var octal1Value = parseInt(octal1, 8); - if (octalDigits.indexOf(state.nextCodePoint()) === -1) { - return { matched: true, value: octal1Value }; - } - var octal2 = state.eatAny.apply(state, _toConsumableArray$6(octalDigits)); - var octal2Value = parseInt(octal2, 8); - if (octal1Value < 4) { - if (octalDigits.indexOf(state.nextCodePoint()) === -1) { - return { matched: true, value: octal1Value << 3 | octal2Value }; - } - var octal3 = state.eatAny.apply(state, _toConsumableArray$6(octalDigits)); - var octal3Value = parseInt(octal3, 8); - return { matched: true, value: octal1Value << 6 | octal2Value << 3 | octal3Value }; - } - return { matched: true, value: octal1Value << 3 | octal2Value }; -}), backtrackOnFailure(function(state) { - if (!state.unicode) { - return { matched: false }; - } - var value = state.eatAny.apply(state, _toConsumableArray$6(syntaxCharacters)); - if (value === null) { - return { matched: false }; - } - return { matched: true, value: value.charCodeAt(0) }; -}), function(state) { - if (!state.unicode || !state.eat("/")) { - return { matched: false }; - } - return { matched: true, value: "/".charCodeAt(0) }; -}, backtrackOnFailure(function(state) { - if (state.unicode) { - return { matched: false }; - } - var next2 = state.nextCodePoint(); - if (next2 !== null && next2 !== "c" && next2 !== "k") { - state.skipCodePoint(); - return { matched: true, value: next2.codePointAt(0) }; - } - return { matched: false }; -})); -var acceptGroupNameBackreference = backtrackOnFailure(function(state) { - if (!state.eat("k")) { - return { matched: false }; - } - var name = acceptGroupName(state); - if (!name.matched) { - state.backreferenceNames.push(INVALID_NAMED_BACKREFERENCE_SENTINEL); - return { matched: true }; - } - state.backreferenceNames.push(name.data); - return { matched: true }; -}); -var acceptGroupName = backtrackOnFailure(function(state) { - if (!state.eat("<")) { - return { matched: false }; - } - var characters = []; - var start = state.eatIdentifierStart(); - if (!start) { - return { matched: false }; - } - characters.push(start); - var part = void 0; - while (part = state.eatIdentifierPart()) { - characters.push(part); - } - if (!state.eat(">")) { - return { matched: false }; - } - return { matched: characters.length > 0, data: characters.join("") }; -}); -var acceptAtomEscape = anyOf(acceptDecimalEscape, acceptCharacterClassEscape, acceptCharacterEscape, acceptGroupNameBackreference); -var acceptCharacterClass = backtrackOnFailure(function(state) { - if (!state.eat("[")) { - return { matched: false }; - } - state.eat("^"); - var acceptClassEscape = anyOf( - function(subState) { - return { matched: !!subState.eat("b"), value: 8 }; - }, - function(subState) { - return { matched: subState.unicode && !!subState.eat("-"), value: "-".charCodeAt(0) }; - }, - backtrackOnFailure(function(subState) { - if (subState.unicode || !subState.eat("c")) { - return { matched: false }; - } - var character = subState.eatAny.apply(subState, _toConsumableArray$6(decimalDigits).concat(["_"])); - if (character === null) { - return { matched: false }; - } - return { matched: true, value: character.charCodeAt(0) % 32 }; - }), - acceptCharacterClassEscape, - acceptCharacterEscape, - function(subState) { - return { matched: !subState.unicode && !!subState.eat("k"), value: 107 }; - } - ); - var acceptClassAtomNoDash = function acceptClassAtomNoDash2(localState) { - var nextCodePoint = localState.nextCodePoint(); - if (nextCodePoint === "]" || nextCodePoint === "-" || nextCodePoint === null) { - return { matched: false }; - } - if (nextCodePoint !== "\\") { - localState.skipCodePoint(); - return { matched: true, value: nextCodePoint.codePointAt(0) }; - } - localState.eat("\\"); - var classEscape = acceptClassEscape(localState); - if (!classEscape.matched && localState.nextCodePoint() === "c" && !localState.unicode) { - return { matched: true, value: "\\".charCodeAt(0) }; - } - return classEscape; - }; - var acceptClassAtom = function acceptClassAtom2(localState) { - if (localState.eat("-")) { - return { matched: true, value: "-".charCodeAt(0) }; - } - return acceptClassAtomNoDash(localState); - }; - var finishClassRange = function finishClassRange2(localState, atom) { - var isUnvaluedPassedAtom = function isUnvaluedPassedAtom2(subAtom) { - return subAtom.value === void 0 && subAtom.matched; - }; - if (localState.eat("-")) { - if (localState.match("]")) { - return { matched: true }; - } - var otherAtom = acceptClassAtom(localState); - if (!otherAtom.matched) { - return { matched: false }; - } - if (localState.unicode && (isUnvaluedPassedAtom(atom) || isUnvaluedPassedAtom(otherAtom))) { - return { matched: false }; - } else if (!(!localState.unicode && (isUnvaluedPassedAtom(atom) || isUnvaluedPassedAtom(otherAtom))) && atom.value > otherAtom.value) { - return { matched: false }; - } else if (localState.match("]")) { - return { matched: true }; - } - return acceptNonEmptyClassRanges(localState); - } - if (localState.match("]")) { - return { matched: true }; - } - return acceptNonEmptyClassRangesNoDash(localState); - }; - var acceptNonEmptyClassRanges = function acceptNonEmptyClassRanges2(localState) { - var atom = acceptClassAtom(localState); - return atom.matched ? finishClassRange(localState, atom) : { matched: false }; - }; - var acceptNonEmptyClassRangesNoDash = function acceptNonEmptyClassRangesNoDash2(localState) { - var atom = acceptClassAtomNoDash(localState); - return atom.matched ? finishClassRange(localState, atom) : { matched: false }; - }; - if (state.eat("]")) { - return { matched: true }; - } - var value = acceptNonEmptyClassRanges(state); - if (value.matched) { - state.eat("]"); - } - return value; -}); -const dist$9 = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - default: _default$b -}, [dist$a]); -const require$$1$5 = /* @__PURE__ */ getAugmentedNamespace(dist$9); -var dist$8 = {}; -var YieldGeneratorExpression_1$1; -var YieldExpression_1$1; -var WithStatement_1$1; -var WhileStatement_1$1; -var VariableDeclarator_1$1; -var VariableDeclarationStatement_1$1; -var VariableDeclaration_1$1; -var UpdateExpression_1$1; -var UnaryExpression_1$1; -var TryFinallyStatement_1$1; -var TryCatchStatement_1$1; -var ThrowStatement_1$1; -var ThisExpression_1$1; -var TemplateExpression_1$1; -var TemplateElement_1$1; -var SwitchStatementWithDefault_1$1; -var SwitchStatement_1$1; -var SwitchDefault_1$1; -var SwitchCase_1$1; -var Super_1$1; -var StaticPropertyName_1$1; -var StaticMemberExpression_1$1; -var StaticMemberAssignmentTarget_1$1; -var SpreadProperty_1$1; -var SpreadElement_1$1; -var ShorthandProperty_1$1; -var Setter_1$1; -var Script_1$1; -var ReturnStatement_1$1; -var ObjectExpression_1$1; -var ObjectBinding_1$1; -var ObjectAssignmentTarget_1$1; -var NewTargetExpression_1$1; -var NewExpression_1$1; -var Module_1$1; -var Method_1$1; -var LiteralStringExpression_1$1; -var LiteralRegExpExpression_1$1; -var LiteralNumericExpression_1$1; -var LiteralNullExpression_1$1; -var LiteralInfinityExpression_1$1; -var LiteralBooleanExpression_1$1; -var LabeledStatement_1$1; -var ImportSpecifier_1$1; -var ImportNamespace_1$1; -var Import_1$1; -var IfStatement_1$1; -var IdentifierExpression_1$1; -var Getter_1$1; -var FunctionExpression_1$1; -var FunctionDeclaration_1$1; -var FunctionBody_1$1; -var FormalParameters_1$1; -var ForStatement_1$1; -var ForOfStatement_1$1; -var ForInStatement_1$1; -var ForAwaitStatement_1$1; -var ExpressionStatement_1$1; -var ExportLocals_1$1; -var ExportLocalSpecifier_1$1; -var ExportFromSpecifier_1$1; -var ExportFrom_1$1; -var ExportDefault_1$1; -var ExportAllFrom_1$1; -var Export_1$1; -var EmptyStatement_1$1; -var DoWhileStatement_1$1; -var Directive_1$1; -var DebuggerStatement_1$1; -var DataProperty_1$1; -var ContinueStatement_1$1; -var ConditionalExpression_1$1; -var ComputedPropertyName_1$1; -var ComputedMemberExpression_1$1; -var ComputedMemberAssignmentTarget_1$1; -var CompoundAssignmentExpression_1$1; -var ClassExpression_1$1; -var ClassElement_1$1; -var ClassDeclaration_1$1; -var CatchClause_1$1; -var CallExpression_1$1; -var BreakStatement_1$1; -var BlockStatement_1$1; -var Block_1$1; -var BindingWithDefault_1$1; -var BindingPropertyProperty_1$1; -var BindingPropertyIdentifier_1$1; -var BindingIdentifier_1$1; -var BinaryExpression_1$1; -var AwaitExpression_1$1; -var AssignmentTargetWithDefault_1$1; -var AssignmentTargetPropertyProperty_1$1; -var AssignmentTargetPropertyIdentifier_1$1; -var AssignmentTargetIdentifier_1$1; -var AssignmentExpression_1$1; -var ArrowExpression_1$1; -var ArrayExpression_1$1; -var ArrayBinding_1$1; -var ArrayAssignmentTarget_1$1; -Object.defineProperty(dist$8, "__esModule", { - value: true -}); -function _classCallCheck$g(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} -ArrayAssignmentTarget_1$1 = dist$8.ArrayAssignmentTarget = function ArrayAssignmentTarget(_ref) { - var elements = _ref.elements, rest = _ref.rest; - _classCallCheck$g(this, ArrayAssignmentTarget); - this.type = "ArrayAssignmentTarget"; - this.elements = elements; - this.rest = rest; -}; -ArrayBinding_1$1 = dist$8.ArrayBinding = function ArrayBinding(_ref2) { - var elements = _ref2.elements, rest = _ref2.rest; - _classCallCheck$g(this, ArrayBinding); - this.type = "ArrayBinding"; - this.elements = elements; - this.rest = rest; -}; -ArrayExpression_1$1 = dist$8.ArrayExpression = function ArrayExpression(_ref3) { - var elements = _ref3.elements; - _classCallCheck$g(this, ArrayExpression); - this.type = "ArrayExpression"; - this.elements = elements; -}; -ArrowExpression_1$1 = dist$8.ArrowExpression = function ArrowExpression(_ref4) { - var isAsync = _ref4.isAsync, params = _ref4.params, body = _ref4.body; - _classCallCheck$g(this, ArrowExpression); - this.type = "ArrowExpression"; - this.isAsync = isAsync; - this.params = params; - this.body = body; -}; -AssignmentExpression_1$1 = dist$8.AssignmentExpression = function AssignmentExpression(_ref5) { - var binding = _ref5.binding, expression = _ref5.expression; - _classCallCheck$g(this, AssignmentExpression); - this.type = "AssignmentExpression"; - this.binding = binding; - this.expression = expression; -}; -AssignmentTargetIdentifier_1$1 = dist$8.AssignmentTargetIdentifier = function AssignmentTargetIdentifier(_ref6) { - var name = _ref6.name; - _classCallCheck$g(this, AssignmentTargetIdentifier); - this.type = "AssignmentTargetIdentifier"; - this.name = name; -}; -AssignmentTargetPropertyIdentifier_1$1 = dist$8.AssignmentTargetPropertyIdentifier = function AssignmentTargetPropertyIdentifier(_ref7) { - var binding = _ref7.binding, init = _ref7.init; - _classCallCheck$g(this, AssignmentTargetPropertyIdentifier); - this.type = "AssignmentTargetPropertyIdentifier"; - this.binding = binding; - this.init = init; -}; -AssignmentTargetPropertyProperty_1$1 = dist$8.AssignmentTargetPropertyProperty = function AssignmentTargetPropertyProperty(_ref8) { - var name = _ref8.name, binding = _ref8.binding; - _classCallCheck$g(this, AssignmentTargetPropertyProperty); - this.type = "AssignmentTargetPropertyProperty"; - this.name = name; - this.binding = binding; -}; -AssignmentTargetWithDefault_1$1 = dist$8.AssignmentTargetWithDefault = function AssignmentTargetWithDefault(_ref9) { - var binding = _ref9.binding, init = _ref9.init; - _classCallCheck$g(this, AssignmentTargetWithDefault); - this.type = "AssignmentTargetWithDefault"; - this.binding = binding; - this.init = init; -}; -AwaitExpression_1$1 = dist$8.AwaitExpression = function AwaitExpression(_ref10) { - var expression = _ref10.expression; - _classCallCheck$g(this, AwaitExpression); - this.type = "AwaitExpression"; - this.expression = expression; -}; -BinaryExpression_1$1 = dist$8.BinaryExpression = function BinaryExpression(_ref11) { - var left = _ref11.left, operator = _ref11.operator, right = _ref11.right; - _classCallCheck$g(this, BinaryExpression); - this.type = "BinaryExpression"; - this.left = left; - this.operator = operator; - this.right = right; -}; -BindingIdentifier_1$1 = dist$8.BindingIdentifier = function BindingIdentifier(_ref12) { - var name = _ref12.name; - _classCallCheck$g(this, BindingIdentifier); - this.type = "BindingIdentifier"; - this.name = name; -}; -BindingPropertyIdentifier_1$1 = dist$8.BindingPropertyIdentifier = function BindingPropertyIdentifier(_ref13) { - var binding = _ref13.binding, init = _ref13.init; - _classCallCheck$g(this, BindingPropertyIdentifier); - this.type = "BindingPropertyIdentifier"; - this.binding = binding; - this.init = init; -}; -BindingPropertyProperty_1$1 = dist$8.BindingPropertyProperty = function BindingPropertyProperty(_ref14) { - var name = _ref14.name, binding = _ref14.binding; - _classCallCheck$g(this, BindingPropertyProperty); - this.type = "BindingPropertyProperty"; - this.name = name; - this.binding = binding; -}; -BindingWithDefault_1$1 = dist$8.BindingWithDefault = function BindingWithDefault(_ref15) { - var binding = _ref15.binding, init = _ref15.init; - _classCallCheck$g(this, BindingWithDefault); - this.type = "BindingWithDefault"; - this.binding = binding; - this.init = init; -}; -Block_1$1 = dist$8.Block = function Block(_ref16) { - var statements = _ref16.statements; - _classCallCheck$g(this, Block); - this.type = "Block"; - this.statements = statements; -}; -BlockStatement_1$1 = dist$8.BlockStatement = function BlockStatement(_ref17) { - var block = _ref17.block; - _classCallCheck$g(this, BlockStatement); - this.type = "BlockStatement"; - this.block = block; -}; -BreakStatement_1$1 = dist$8.BreakStatement = function BreakStatement(_ref18) { - var label = _ref18.label; - _classCallCheck$g(this, BreakStatement); - this.type = "BreakStatement"; - this.label = label; -}; -CallExpression_1$1 = dist$8.CallExpression = function CallExpression(_ref19) { - var callee = _ref19.callee, _arguments = _ref19.arguments; - _classCallCheck$g(this, CallExpression); - this.type = "CallExpression"; - this.callee = callee; - this.arguments = _arguments; -}; -CatchClause_1$1 = dist$8.CatchClause = function CatchClause(_ref20) { - var binding = _ref20.binding, body = _ref20.body; - _classCallCheck$g(this, CatchClause); - this.type = "CatchClause"; - this.binding = binding; - this.body = body; -}; -ClassDeclaration_1$1 = dist$8.ClassDeclaration = function ClassDeclaration(_ref21) { - var name = _ref21.name, _super = _ref21.super, elements = _ref21.elements; - _classCallCheck$g(this, ClassDeclaration); - this.type = "ClassDeclaration"; - this.name = name; - this.super = _super; - this.elements = elements; -}; -ClassElement_1$1 = dist$8.ClassElement = function ClassElement(_ref22) { - var isStatic = _ref22.isStatic, method = _ref22.method; - _classCallCheck$g(this, ClassElement); - this.type = "ClassElement"; - this.isStatic = isStatic; - this.method = method; -}; -ClassExpression_1$1 = dist$8.ClassExpression = function ClassExpression(_ref23) { - var name = _ref23.name, _super = _ref23.super, elements = _ref23.elements; - _classCallCheck$g(this, ClassExpression); - this.type = "ClassExpression"; - this.name = name; - this.super = _super; - this.elements = elements; -}; -CompoundAssignmentExpression_1$1 = dist$8.CompoundAssignmentExpression = function CompoundAssignmentExpression(_ref24) { - var binding = _ref24.binding, operator = _ref24.operator, expression = _ref24.expression; - _classCallCheck$g(this, CompoundAssignmentExpression); - this.type = "CompoundAssignmentExpression"; - this.binding = binding; - this.operator = operator; - this.expression = expression; -}; -ComputedMemberAssignmentTarget_1$1 = dist$8.ComputedMemberAssignmentTarget = function ComputedMemberAssignmentTarget(_ref25) { - var object = _ref25.object, expression = _ref25.expression; - _classCallCheck$g(this, ComputedMemberAssignmentTarget); - this.type = "ComputedMemberAssignmentTarget"; - this.object = object; - this.expression = expression; -}; -ComputedMemberExpression_1$1 = dist$8.ComputedMemberExpression = function ComputedMemberExpression(_ref26) { - var object = _ref26.object, expression = _ref26.expression; - _classCallCheck$g(this, ComputedMemberExpression); - this.type = "ComputedMemberExpression"; - this.object = object; - this.expression = expression; -}; -ComputedPropertyName_1$1 = dist$8.ComputedPropertyName = function ComputedPropertyName(_ref27) { - var expression = _ref27.expression; - _classCallCheck$g(this, ComputedPropertyName); - this.type = "ComputedPropertyName"; - this.expression = expression; -}; -ConditionalExpression_1$1 = dist$8.ConditionalExpression = function ConditionalExpression(_ref28) { - var test = _ref28.test, consequent = _ref28.consequent, alternate = _ref28.alternate; - _classCallCheck$g(this, ConditionalExpression); - this.type = "ConditionalExpression"; - this.test = test; - this.consequent = consequent; - this.alternate = alternate; -}; -ContinueStatement_1$1 = dist$8.ContinueStatement = function ContinueStatement(_ref29) { - var label = _ref29.label; - _classCallCheck$g(this, ContinueStatement); - this.type = "ContinueStatement"; - this.label = label; -}; -DataProperty_1$1 = dist$8.DataProperty = function DataProperty(_ref30) { - var name = _ref30.name, expression = _ref30.expression; - _classCallCheck$g(this, DataProperty); - this.type = "DataProperty"; - this.name = name; - this.expression = expression; -}; -DebuggerStatement_1$1 = dist$8.DebuggerStatement = function DebuggerStatement() { - _classCallCheck$g(this, DebuggerStatement); - this.type = "DebuggerStatement"; -}; -Directive_1$1 = dist$8.Directive = function Directive(_ref31) { - var rawValue = _ref31.rawValue; - _classCallCheck$g(this, Directive); - this.type = "Directive"; - this.rawValue = rawValue; -}; -DoWhileStatement_1$1 = dist$8.DoWhileStatement = function DoWhileStatement(_ref32) { - var body = _ref32.body, test = _ref32.test; - _classCallCheck$g(this, DoWhileStatement); - this.type = "DoWhileStatement"; - this.body = body; - this.test = test; -}; -EmptyStatement_1$1 = dist$8.EmptyStatement = function EmptyStatement() { - _classCallCheck$g(this, EmptyStatement); - this.type = "EmptyStatement"; -}; -Export_1$1 = dist$8.Export = function Export(_ref33) { - var declaration = _ref33.declaration; - _classCallCheck$g(this, Export); - this.type = "Export"; - this.declaration = declaration; -}; -ExportAllFrom_1$1 = dist$8.ExportAllFrom = function ExportAllFrom(_ref34) { - var moduleSpecifier = _ref34.moduleSpecifier; - _classCallCheck$g(this, ExportAllFrom); - this.type = "ExportAllFrom"; - this.moduleSpecifier = moduleSpecifier; -}; -ExportDefault_1$1 = dist$8.ExportDefault = function ExportDefault(_ref35) { - var body = _ref35.body; - _classCallCheck$g(this, ExportDefault); - this.type = "ExportDefault"; - this.body = body; -}; -ExportFrom_1$1 = dist$8.ExportFrom = function ExportFrom(_ref36) { - var namedExports = _ref36.namedExports, moduleSpecifier = _ref36.moduleSpecifier; - _classCallCheck$g(this, ExportFrom); - this.type = "ExportFrom"; - this.namedExports = namedExports; - this.moduleSpecifier = moduleSpecifier; -}; -ExportFromSpecifier_1$1 = dist$8.ExportFromSpecifier = function ExportFromSpecifier(_ref37) { - var name = _ref37.name, exportedName = _ref37.exportedName; - _classCallCheck$g(this, ExportFromSpecifier); - this.type = "ExportFromSpecifier"; - this.name = name; - this.exportedName = exportedName; -}; -ExportLocalSpecifier_1$1 = dist$8.ExportLocalSpecifier = function ExportLocalSpecifier(_ref38) { - var name = _ref38.name, exportedName = _ref38.exportedName; - _classCallCheck$g(this, ExportLocalSpecifier); - this.type = "ExportLocalSpecifier"; - this.name = name; - this.exportedName = exportedName; -}; -ExportLocals_1$1 = dist$8.ExportLocals = function ExportLocals(_ref39) { - var namedExports = _ref39.namedExports; - _classCallCheck$g(this, ExportLocals); - this.type = "ExportLocals"; - this.namedExports = namedExports; -}; -ExpressionStatement_1$1 = dist$8.ExpressionStatement = function ExpressionStatement(_ref40) { - var expression = _ref40.expression; - _classCallCheck$g(this, ExpressionStatement); - this.type = "ExpressionStatement"; - this.expression = expression; -}; -ForAwaitStatement_1$1 = dist$8.ForAwaitStatement = function ForAwaitStatement(_ref41) { - var left = _ref41.left, right = _ref41.right, body = _ref41.body; - _classCallCheck$g(this, ForAwaitStatement); - this.type = "ForAwaitStatement"; - this.left = left; - this.right = right; - this.body = body; -}; -ForInStatement_1$1 = dist$8.ForInStatement = function ForInStatement(_ref42) { - var left = _ref42.left, right = _ref42.right, body = _ref42.body; - _classCallCheck$g(this, ForInStatement); - this.type = "ForInStatement"; - this.left = left; - this.right = right; - this.body = body; -}; -ForOfStatement_1$1 = dist$8.ForOfStatement = function ForOfStatement(_ref43) { - var left = _ref43.left, right = _ref43.right, body = _ref43.body; - _classCallCheck$g(this, ForOfStatement); - this.type = "ForOfStatement"; - this.left = left; - this.right = right; - this.body = body; -}; -ForStatement_1$1 = dist$8.ForStatement = function ForStatement(_ref44) { - var init = _ref44.init, test = _ref44.test, update = _ref44.update, body = _ref44.body; - _classCallCheck$g(this, ForStatement); - this.type = "ForStatement"; - this.init = init; - this.test = test; - this.update = update; - this.body = body; -}; -FormalParameters_1$1 = dist$8.FormalParameters = function FormalParameters(_ref45) { - var items = _ref45.items, rest = _ref45.rest; - _classCallCheck$g(this, FormalParameters); - this.type = "FormalParameters"; - this.items = items; - this.rest = rest; -}; -FunctionBody_1$1 = dist$8.FunctionBody = function FunctionBody(_ref46) { - var directives = _ref46.directives, statements = _ref46.statements; - _classCallCheck$g(this, FunctionBody); - this.type = "FunctionBody"; - this.directives = directives; - this.statements = statements; -}; -FunctionDeclaration_1$1 = dist$8.FunctionDeclaration = function FunctionDeclaration(_ref47) { - var isAsync = _ref47.isAsync, isGenerator = _ref47.isGenerator, name = _ref47.name, params = _ref47.params, body = _ref47.body; - _classCallCheck$g(this, FunctionDeclaration); - this.type = "FunctionDeclaration"; - this.isAsync = isAsync; - this.isGenerator = isGenerator; - this.name = name; - this.params = params; - this.body = body; -}; -FunctionExpression_1$1 = dist$8.FunctionExpression = function FunctionExpression(_ref48) { - var isAsync = _ref48.isAsync, isGenerator = _ref48.isGenerator, name = _ref48.name, params = _ref48.params, body = _ref48.body; - _classCallCheck$g(this, FunctionExpression); - this.type = "FunctionExpression"; - this.isAsync = isAsync; - this.isGenerator = isGenerator; - this.name = name; - this.params = params; - this.body = body; -}; -Getter_1$1 = dist$8.Getter = function Getter(_ref49) { - var name = _ref49.name, body = _ref49.body; - _classCallCheck$g(this, Getter); - this.type = "Getter"; - this.name = name; - this.body = body; -}; -IdentifierExpression_1$1 = dist$8.IdentifierExpression = function IdentifierExpression(_ref50) { - var name = _ref50.name; - _classCallCheck$g(this, IdentifierExpression); - this.type = "IdentifierExpression"; - this.name = name; -}; -IfStatement_1$1 = dist$8.IfStatement = function IfStatement(_ref51) { - var test = _ref51.test, consequent = _ref51.consequent, alternate = _ref51.alternate; - _classCallCheck$g(this, IfStatement); - this.type = "IfStatement"; - this.test = test; - this.consequent = consequent; - this.alternate = alternate; -}; -Import_1$1 = dist$8.Import = function Import(_ref52) { - var defaultBinding = _ref52.defaultBinding, namedImports = _ref52.namedImports, moduleSpecifier = _ref52.moduleSpecifier; - _classCallCheck$g(this, Import); - this.type = "Import"; - this.defaultBinding = defaultBinding; - this.namedImports = namedImports; - this.moduleSpecifier = moduleSpecifier; -}; -ImportNamespace_1$1 = dist$8.ImportNamespace = function ImportNamespace(_ref53) { - var defaultBinding = _ref53.defaultBinding, namespaceBinding = _ref53.namespaceBinding, moduleSpecifier = _ref53.moduleSpecifier; - _classCallCheck$g(this, ImportNamespace); - this.type = "ImportNamespace"; - this.defaultBinding = defaultBinding; - this.namespaceBinding = namespaceBinding; - this.moduleSpecifier = moduleSpecifier; -}; -ImportSpecifier_1$1 = dist$8.ImportSpecifier = function ImportSpecifier(_ref54) { - var name = _ref54.name, binding = _ref54.binding; - _classCallCheck$g(this, ImportSpecifier); - this.type = "ImportSpecifier"; - this.name = name; - this.binding = binding; -}; -LabeledStatement_1$1 = dist$8.LabeledStatement = function LabeledStatement(_ref55) { - var label = _ref55.label, body = _ref55.body; - _classCallCheck$g(this, LabeledStatement); - this.type = "LabeledStatement"; - this.label = label; - this.body = body; -}; -LiteralBooleanExpression_1$1 = dist$8.LiteralBooleanExpression = function LiteralBooleanExpression(_ref56) { - var value = _ref56.value; - _classCallCheck$g(this, LiteralBooleanExpression); - this.type = "LiteralBooleanExpression"; - this.value = value; -}; -LiteralInfinityExpression_1$1 = dist$8.LiteralInfinityExpression = function LiteralInfinityExpression() { - _classCallCheck$g(this, LiteralInfinityExpression); - this.type = "LiteralInfinityExpression"; -}; -LiteralNullExpression_1$1 = dist$8.LiteralNullExpression = function LiteralNullExpression() { - _classCallCheck$g(this, LiteralNullExpression); - this.type = "LiteralNullExpression"; -}; -LiteralNumericExpression_1$1 = dist$8.LiteralNumericExpression = function LiteralNumericExpression(_ref57) { - var value = _ref57.value; - _classCallCheck$g(this, LiteralNumericExpression); - this.type = "LiteralNumericExpression"; - this.value = value; -}; -LiteralRegExpExpression_1$1 = dist$8.LiteralRegExpExpression = function LiteralRegExpExpression(_ref58) { - var pattern = _ref58.pattern, global = _ref58.global, ignoreCase = _ref58.ignoreCase, multiLine = _ref58.multiLine, dotAll = _ref58.dotAll, unicode2 = _ref58.unicode, sticky = _ref58.sticky; - _classCallCheck$g(this, LiteralRegExpExpression); - this.type = "LiteralRegExpExpression"; - this.pattern = pattern; - this.global = global; - this.ignoreCase = ignoreCase; - this.multiLine = multiLine; - this.dotAll = dotAll; - this.unicode = unicode2; - this.sticky = sticky; -}; -LiteralStringExpression_1$1 = dist$8.LiteralStringExpression = function LiteralStringExpression(_ref59) { - var value = _ref59.value; - _classCallCheck$g(this, LiteralStringExpression); - this.type = "LiteralStringExpression"; - this.value = value; -}; -Method_1$1 = dist$8.Method = function Method(_ref60) { - var isAsync = _ref60.isAsync, isGenerator = _ref60.isGenerator, name = _ref60.name, params = _ref60.params, body = _ref60.body; - _classCallCheck$g(this, Method); - this.type = "Method"; - this.isAsync = isAsync; - this.isGenerator = isGenerator; - this.name = name; - this.params = params; - this.body = body; -}; -Module_1$1 = dist$8.Module = function Module(_ref61) { - var directives = _ref61.directives, items = _ref61.items; - _classCallCheck$g(this, Module); - this.type = "Module"; - this.directives = directives; - this.items = items; -}; -NewExpression_1$1 = dist$8.NewExpression = function NewExpression(_ref62) { - var callee = _ref62.callee, _arguments = _ref62.arguments; - _classCallCheck$g(this, NewExpression); - this.type = "NewExpression"; - this.callee = callee; - this.arguments = _arguments; -}; -NewTargetExpression_1$1 = dist$8.NewTargetExpression = function NewTargetExpression() { - _classCallCheck$g(this, NewTargetExpression); - this.type = "NewTargetExpression"; -}; -ObjectAssignmentTarget_1$1 = dist$8.ObjectAssignmentTarget = function ObjectAssignmentTarget(_ref63) { - var properties = _ref63.properties, rest = _ref63.rest; - _classCallCheck$g(this, ObjectAssignmentTarget); - this.type = "ObjectAssignmentTarget"; - this.properties = properties; - this.rest = rest; -}; -ObjectBinding_1$1 = dist$8.ObjectBinding = function ObjectBinding(_ref64) { - var properties = _ref64.properties, rest = _ref64.rest; - _classCallCheck$g(this, ObjectBinding); - this.type = "ObjectBinding"; - this.properties = properties; - this.rest = rest; -}; -ObjectExpression_1$1 = dist$8.ObjectExpression = function ObjectExpression(_ref65) { - var properties = _ref65.properties; - _classCallCheck$g(this, ObjectExpression); - this.type = "ObjectExpression"; - this.properties = properties; -}; -ReturnStatement_1$1 = dist$8.ReturnStatement = function ReturnStatement(_ref66) { - var expression = _ref66.expression; - _classCallCheck$g(this, ReturnStatement); - this.type = "ReturnStatement"; - this.expression = expression; -}; -Script_1$1 = dist$8.Script = function Script(_ref67) { - var directives = _ref67.directives, statements = _ref67.statements; - _classCallCheck$g(this, Script); - this.type = "Script"; - this.directives = directives; - this.statements = statements; -}; -Setter_1$1 = dist$8.Setter = function Setter(_ref68) { - var name = _ref68.name, param = _ref68.param, body = _ref68.body; - _classCallCheck$g(this, Setter); - this.type = "Setter"; - this.name = name; - this.param = param; - this.body = body; -}; -ShorthandProperty_1$1 = dist$8.ShorthandProperty = function ShorthandProperty(_ref69) { - var name = _ref69.name; - _classCallCheck$g(this, ShorthandProperty); - this.type = "ShorthandProperty"; - this.name = name; -}; -SpreadElement_1$1 = dist$8.SpreadElement = function SpreadElement(_ref70) { - var expression = _ref70.expression; - _classCallCheck$g(this, SpreadElement); - this.type = "SpreadElement"; - this.expression = expression; -}; -SpreadProperty_1$1 = dist$8.SpreadProperty = function SpreadProperty(_ref71) { - var expression = _ref71.expression; - _classCallCheck$g(this, SpreadProperty); - this.type = "SpreadProperty"; - this.expression = expression; -}; -StaticMemberAssignmentTarget_1$1 = dist$8.StaticMemberAssignmentTarget = function StaticMemberAssignmentTarget(_ref72) { - var object = _ref72.object, property = _ref72.property; - _classCallCheck$g(this, StaticMemberAssignmentTarget); - this.type = "StaticMemberAssignmentTarget"; - this.object = object; - this.property = property; -}; -StaticMemberExpression_1$1 = dist$8.StaticMemberExpression = function StaticMemberExpression(_ref73) { - var object = _ref73.object, property = _ref73.property; - _classCallCheck$g(this, StaticMemberExpression); - this.type = "StaticMemberExpression"; - this.object = object; - this.property = property; -}; -StaticPropertyName_1$1 = dist$8.StaticPropertyName = function StaticPropertyName(_ref74) { - var value = _ref74.value; - _classCallCheck$g(this, StaticPropertyName); - this.type = "StaticPropertyName"; - this.value = value; -}; -Super_1$1 = dist$8.Super = function Super() { - _classCallCheck$g(this, Super); - this.type = "Super"; -}; -SwitchCase_1$1 = dist$8.SwitchCase = function SwitchCase(_ref75) { - var test = _ref75.test, consequent = _ref75.consequent; - _classCallCheck$g(this, SwitchCase); - this.type = "SwitchCase"; - this.test = test; - this.consequent = consequent; -}; -SwitchDefault_1$1 = dist$8.SwitchDefault = function SwitchDefault(_ref76) { - var consequent = _ref76.consequent; - _classCallCheck$g(this, SwitchDefault); - this.type = "SwitchDefault"; - this.consequent = consequent; -}; -SwitchStatement_1$1 = dist$8.SwitchStatement = function SwitchStatement(_ref77) { - var discriminant = _ref77.discriminant, cases = _ref77.cases; - _classCallCheck$g(this, SwitchStatement); - this.type = "SwitchStatement"; - this.discriminant = discriminant; - this.cases = cases; -}; -SwitchStatementWithDefault_1$1 = dist$8.SwitchStatementWithDefault = function SwitchStatementWithDefault(_ref78) { - var discriminant = _ref78.discriminant, preDefaultCases = _ref78.preDefaultCases, defaultCase = _ref78.defaultCase, postDefaultCases = _ref78.postDefaultCases; - _classCallCheck$g(this, SwitchStatementWithDefault); - this.type = "SwitchStatementWithDefault"; - this.discriminant = discriminant; - this.preDefaultCases = preDefaultCases; - this.defaultCase = defaultCase; - this.postDefaultCases = postDefaultCases; -}; -TemplateElement_1$1 = dist$8.TemplateElement = function TemplateElement(_ref79) { - var rawValue = _ref79.rawValue; - _classCallCheck$g(this, TemplateElement); - this.type = "TemplateElement"; - this.rawValue = rawValue; -}; -TemplateExpression_1$1 = dist$8.TemplateExpression = function TemplateExpression(_ref80) { - var tag = _ref80.tag, elements = _ref80.elements; - _classCallCheck$g(this, TemplateExpression); - this.type = "TemplateExpression"; - this.tag = tag; - this.elements = elements; -}; -ThisExpression_1$1 = dist$8.ThisExpression = function ThisExpression() { - _classCallCheck$g(this, ThisExpression); - this.type = "ThisExpression"; -}; -ThrowStatement_1$1 = dist$8.ThrowStatement = function ThrowStatement(_ref81) { - var expression = _ref81.expression; - _classCallCheck$g(this, ThrowStatement); - this.type = "ThrowStatement"; - this.expression = expression; -}; -TryCatchStatement_1$1 = dist$8.TryCatchStatement = function TryCatchStatement(_ref82) { - var body = _ref82.body, catchClause = _ref82.catchClause; - _classCallCheck$g(this, TryCatchStatement); - this.type = "TryCatchStatement"; - this.body = body; - this.catchClause = catchClause; -}; -TryFinallyStatement_1$1 = dist$8.TryFinallyStatement = function TryFinallyStatement(_ref83) { - var body = _ref83.body, catchClause = _ref83.catchClause, finalizer = _ref83.finalizer; - _classCallCheck$g(this, TryFinallyStatement); - this.type = "TryFinallyStatement"; - this.body = body; - this.catchClause = catchClause; - this.finalizer = finalizer; -}; -UnaryExpression_1$1 = dist$8.UnaryExpression = function UnaryExpression(_ref84) { - var operator = _ref84.operator, operand = _ref84.operand; - _classCallCheck$g(this, UnaryExpression); - this.type = "UnaryExpression"; - this.operator = operator; - this.operand = operand; -}; -UpdateExpression_1$1 = dist$8.UpdateExpression = function UpdateExpression(_ref85) { - var isPrefix = _ref85.isPrefix, operator = _ref85.operator, operand = _ref85.operand; - _classCallCheck$g(this, UpdateExpression); - this.type = "UpdateExpression"; - this.isPrefix = isPrefix; - this.operator = operator; - this.operand = operand; -}; -VariableDeclaration_1$1 = dist$8.VariableDeclaration = function VariableDeclaration(_ref86) { - var kind = _ref86.kind, declarators = _ref86.declarators; - _classCallCheck$g(this, VariableDeclaration); - this.type = "VariableDeclaration"; - this.kind = kind; - this.declarators = declarators; -}; -VariableDeclarationStatement_1$1 = dist$8.VariableDeclarationStatement = function VariableDeclarationStatement(_ref87) { - var declaration = _ref87.declaration; - _classCallCheck$g(this, VariableDeclarationStatement); - this.type = "VariableDeclarationStatement"; - this.declaration = declaration; -}; -VariableDeclarator_1$1 = dist$8.VariableDeclarator = function VariableDeclarator(_ref88) { - var binding = _ref88.binding, init = _ref88.init; - _classCallCheck$g(this, VariableDeclarator); - this.type = "VariableDeclarator"; - this.binding = binding; - this.init = init; -}; -WhileStatement_1$1 = dist$8.WhileStatement = function WhileStatement(_ref89) { - var test = _ref89.test, body = _ref89.body; - _classCallCheck$g(this, WhileStatement); - this.type = "WhileStatement"; - this.test = test; - this.body = body; -}; -WithStatement_1$1 = dist$8.WithStatement = function WithStatement(_ref90) { - var object = _ref90.object, body = _ref90.body; - _classCallCheck$g(this, WithStatement); - this.type = "WithStatement"; - this.object = object; - this.body = body; -}; -YieldExpression_1$1 = dist$8.YieldExpression = function YieldExpression(_ref91) { - var expression = _ref91.expression; - _classCallCheck$g(this, YieldExpression); - this.type = "YieldExpression"; - this.expression = expression; -}; -YieldGeneratorExpression_1$1 = dist$8.YieldGeneratorExpression = function YieldGeneratorExpression(_ref92) { - var expression = _ref92.expression; - _classCallCheck$g(this, YieldGeneratorExpression); - this.type = "YieldGeneratorExpression"; - this.expression = expression; -}; -const dist$7 = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - get ArrayAssignmentTarget() { - return ArrayAssignmentTarget_1$1; - }, - get ArrayBinding() { - return ArrayBinding_1$1; - }, - get ArrayExpression() { - return ArrayExpression_1$1; - }, - get ArrowExpression() { - return ArrowExpression_1$1; - }, - get AssignmentExpression() { - return AssignmentExpression_1$1; - }, - get AssignmentTargetIdentifier() { - return AssignmentTargetIdentifier_1$1; - }, - get AssignmentTargetPropertyIdentifier() { - return AssignmentTargetPropertyIdentifier_1$1; - }, - get AssignmentTargetPropertyProperty() { - return AssignmentTargetPropertyProperty_1$1; - }, - get AssignmentTargetWithDefault() { - return AssignmentTargetWithDefault_1$1; - }, - get AwaitExpression() { - return AwaitExpression_1$1; - }, - get BinaryExpression() { - return BinaryExpression_1$1; - }, - get BindingIdentifier() { - return BindingIdentifier_1$1; - }, - get BindingPropertyIdentifier() { - return BindingPropertyIdentifier_1$1; - }, - get BindingPropertyProperty() { - return BindingPropertyProperty_1$1; - }, - get BindingWithDefault() { - return BindingWithDefault_1$1; - }, - get Block() { - return Block_1$1; - }, - get BlockStatement() { - return BlockStatement_1$1; - }, - get BreakStatement() { - return BreakStatement_1$1; - }, - get CallExpression() { - return CallExpression_1$1; - }, - get CatchClause() { - return CatchClause_1$1; - }, - get ClassDeclaration() { - return ClassDeclaration_1$1; - }, - get ClassElement() { - return ClassElement_1$1; - }, - get ClassExpression() { - return ClassExpression_1$1; - }, - get CompoundAssignmentExpression() { - return CompoundAssignmentExpression_1$1; - }, - get ComputedMemberAssignmentTarget() { - return ComputedMemberAssignmentTarget_1$1; - }, - get ComputedMemberExpression() { - return ComputedMemberExpression_1$1; - }, - get ComputedPropertyName() { - return ComputedPropertyName_1$1; - }, - get ConditionalExpression() { - return ConditionalExpression_1$1; - }, - get ContinueStatement() { - return ContinueStatement_1$1; - }, - get DataProperty() { - return DataProperty_1$1; - }, - get DebuggerStatement() { - return DebuggerStatement_1$1; - }, - get Directive() { - return Directive_1$1; - }, - get DoWhileStatement() { - return DoWhileStatement_1$1; - }, - get EmptyStatement() { - return EmptyStatement_1$1; - }, - get Export() { - return Export_1$1; - }, - get ExportAllFrom() { - return ExportAllFrom_1$1; - }, - get ExportDefault() { - return ExportDefault_1$1; - }, - get ExportFrom() { - return ExportFrom_1$1; - }, - get ExportFromSpecifier() { - return ExportFromSpecifier_1$1; - }, - get ExportLocalSpecifier() { - return ExportLocalSpecifier_1$1; - }, - get ExportLocals() { - return ExportLocals_1$1; - }, - get ExpressionStatement() { - return ExpressionStatement_1$1; - }, - get ForAwaitStatement() { - return ForAwaitStatement_1$1; - }, - get ForInStatement() { - return ForInStatement_1$1; - }, - get ForOfStatement() { - return ForOfStatement_1$1; - }, - get ForStatement() { - return ForStatement_1$1; - }, - get FormalParameters() { - return FormalParameters_1$1; - }, - get FunctionBody() { - return FunctionBody_1$1; - }, - get FunctionDeclaration() { - return FunctionDeclaration_1$1; - }, - get FunctionExpression() { - return FunctionExpression_1$1; - }, - get Getter() { - return Getter_1$1; - }, - get IdentifierExpression() { - return IdentifierExpression_1$1; - }, - get IfStatement() { - return IfStatement_1$1; - }, - get Import() { - return Import_1$1; - }, - get ImportNamespace() { - return ImportNamespace_1$1; - }, - get ImportSpecifier() { - return ImportSpecifier_1$1; - }, - get LabeledStatement() { - return LabeledStatement_1$1; - }, - get LiteralBooleanExpression() { - return LiteralBooleanExpression_1$1; - }, - get LiteralInfinityExpression() { - return LiteralInfinityExpression_1$1; - }, - get LiteralNullExpression() { - return LiteralNullExpression_1$1; - }, - get LiteralNumericExpression() { - return LiteralNumericExpression_1$1; - }, - get LiteralRegExpExpression() { - return LiteralRegExpExpression_1$1; - }, - get LiteralStringExpression() { - return LiteralStringExpression_1$1; - }, - get Method() { - return Method_1$1; - }, - get Module() { - return Module_1$1; - }, - get NewExpression() { - return NewExpression_1$1; - }, - get NewTargetExpression() { - return NewTargetExpression_1$1; - }, - get ObjectAssignmentTarget() { - return ObjectAssignmentTarget_1$1; - }, - get ObjectBinding() { - return ObjectBinding_1$1; - }, - get ObjectExpression() { - return ObjectExpression_1$1; - }, - get ReturnStatement() { - return ReturnStatement_1$1; - }, - get Script() { - return Script_1$1; - }, - get Setter() { - return Setter_1$1; - }, - get ShorthandProperty() { - return ShorthandProperty_1$1; - }, - get SpreadElement() { - return SpreadElement_1$1; - }, - get SpreadProperty() { - return SpreadProperty_1$1; - }, - get StaticMemberAssignmentTarget() { - return StaticMemberAssignmentTarget_1$1; - }, - get StaticMemberExpression() { - return StaticMemberExpression_1$1; - }, - get StaticPropertyName() { - return StaticPropertyName_1$1; - }, - get Super() { - return Super_1$1; - }, - get SwitchCase() { - return SwitchCase_1$1; - }, - get SwitchDefault() { - return SwitchDefault_1$1; - }, - get SwitchStatement() { - return SwitchStatement_1$1; - }, - get SwitchStatementWithDefault() { - return SwitchStatementWithDefault_1$1; - }, - get TemplateElement() { - return TemplateElement_1$1; - }, - get TemplateExpression() { - return TemplateExpression_1$1; - }, - get ThisExpression() { - return ThisExpression_1$1; - }, - get ThrowStatement() { - return ThrowStatement_1$1; - }, - get TryCatchStatement() { - return TryCatchStatement_1$1; - }, - get TryFinallyStatement() { - return TryFinallyStatement_1$1; - }, - get UnaryExpression() { - return UnaryExpression_1$1; - }, - get UpdateExpression() { - return UpdateExpression_1$1; - }, - get VariableDeclaration() { - return VariableDeclaration_1$1; - }, - get VariableDeclarationStatement() { - return VariableDeclarationStatement_1$1; - }, - get VariableDeclarator() { - return VariableDeclarator_1$1; - }, - get WhileStatement() { - return WhileStatement_1$1; - }, - get WithStatement() { - return WithStatement_1$1; - }, - get YieldExpression() { - return YieldExpression_1$1; - }, - get YieldGeneratorExpression() { - return YieldGeneratorExpression_1$1; - }, - default: dist$8 -}, [dist$8]); -const require$$3$3 = /* @__PURE__ */ getAugmentedNamespace(dist$7); -Object.defineProperty(parser$1, "__esModule", { - value: true -}); -var GenericParser_1 = parser$1.GenericParser = void 0; -var _createClass$c = function() { - function defineProperties(target, props) { - for (var i2 = 0; i2 < props.length; i2++) { - var descriptor = props[i2]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - return function(Constructor, protoProps, staticProps) { - if (protoProps) - defineProperties(Constructor.prototype, protoProps); - if (staticProps) - defineProperties(Constructor, staticProps); - return Constructor; - }; -}(); -var _errors$1 = require$$2$5; -var _shiftRegexpAcceptor = require$$1$5; -var _shiftRegexpAcceptor2 = _interopRequireDefault$8(_shiftRegexpAcceptor); -var _tokenizer = require$$0$9; -var _tokenizer2 = _interopRequireDefault$8(_tokenizer); -var _shiftAst$6 = require$$3$3; -var AST = _interopRequireWildcard$4(_shiftAst$6); -function _interopRequireWildcard$4(obj) { - if (obj && obj.__esModule) { - return obj; - } else { - var newObj = {}; - if (obj != null) { - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) - newObj[key] = obj[key]; - } - } - newObj.default = obj; - return newObj; - } -} -function _interopRequireDefault$8(obj) { - return obj && obj.__esModule ? obj : { default: obj }; -} -function _classCallCheck$f(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} -function _possibleConstructorReturn$7(self, call) { - if (!self) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return call && (typeof call === "object" || typeof call === "function") ? call : self; -} -function _inherits$7(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); - if (superClass) - Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; -} -var ARROW_EXPRESSION_PARAMS = "CoverParenthesizedExpressionAndArrowParameterList"; -var EXPORT_UNKNOWN_SPECIFIER = "ExportNameOfUnknownType"; -var Precedence$1 = { - Sequence: 0, - Yield: 1, - Assignment: 1, - Conditional: 2, - ArrowFunction: 2, - LogicalOR: 3, - LogicalAND: 4, - BitwiseOR: 5, - BitwiseXOR: 6, - BitwiseAND: 7, - Equality: 8, - Relational: 9, - BitwiseSHIFT: 10, - Additive: 11, - Multiplicative: 12, - Unary: 13, - Postfix: 14, - Call: 15, - New: 16, - TaggedTemplate: 17, - Member: 18, - Primary: 19 -}; -var BinaryPrecedence$1 = { - "||": Precedence$1.LogicalOR, - "&&": Precedence$1.LogicalAND, - "|": Precedence$1.BitwiseOR, - "^": Precedence$1.BitwiseXOR, - "&": Precedence$1.BitwiseAND, - "==": Precedence$1.Equality, - "!=": Precedence$1.Equality, - "===": Precedence$1.Equality, - "!==": Precedence$1.Equality, - "<": Precedence$1.Relational, - ">": Precedence$1.Relational, - "<=": Precedence$1.Relational, - ">=": Precedence$1.Relational, - "in": Precedence$1.Relational, - "instanceof": Precedence$1.Relational, - "<<": Precedence$1.BitwiseSHIFT, - ">>": Precedence$1.BitwiseSHIFT, - ">>>": Precedence$1.BitwiseSHIFT, - "+": Precedence$1.Additive, - "-": Precedence$1.Additive, - "*": Precedence$1.Multiplicative, - "%": Precedence$1.Multiplicative, - "/": Precedence$1.Multiplicative -}; -function isValidSimpleAssignmentTarget(node) { - if (node == null) - return false; - switch (node.type) { - case "IdentifierExpression": - case "ComputedMemberExpression": - case "StaticMemberExpression": - return true; - } - return false; -} -function isPrefixOperator(token) { - switch (token.type) { - case _tokenizer.TokenType.INC: - case _tokenizer.TokenType.DEC: - case _tokenizer.TokenType.ADD: - case _tokenizer.TokenType.SUB: - case _tokenizer.TokenType.BIT_NOT: - case _tokenizer.TokenType.NOT: - case _tokenizer.TokenType.DELETE: - case _tokenizer.TokenType.VOID: - case _tokenizer.TokenType.TYPEOF: - return true; - } - return false; -} -function isUpdateOperator(token) { - return token.type === _tokenizer.TokenType.INC || token.type === _tokenizer.TokenType.DEC; -} -GenericParser_1 = parser$1.GenericParser = function(_Tokenizer) { - _inherits$7(GenericParser, _Tokenizer); - function GenericParser(source) { - _classCallCheck$f(this, GenericParser); - var _this = _possibleConstructorReturn$7(this, (GenericParser.__proto__ || Object.getPrototypeOf(GenericParser)).call(this, source)); - _this.allowIn = true; - _this.inFunctionBody = false; - _this.inParameter = false; - _this.allowYieldExpression = false; - _this.allowAwaitExpression = false; - _this.firstAwaitLocation = null; - _this.module = false; - _this.moduleIsTheGoalSymbol = false; - _this.strict = false; - _this.isBindingElement = true; - _this.isAssignmentTarget = true; - _this.firstExprError = null; - return _this; - } - _createClass$c(GenericParser, [{ - key: "match", - value: function match(subType) { - return this.lookahead.type === subType; - } - }, { - key: "matchIdentifier", - value: function matchIdentifier() { - switch (this.lookahead.type) { - case _tokenizer.TokenType.IDENTIFIER: - case _tokenizer.TokenType.LET: - case _tokenizer.TokenType.YIELD: - case _tokenizer.TokenType.ASYNC: - return true; - case _tokenizer.TokenType.AWAIT: - if (!this.moduleIsTheGoalSymbol) { - if (this.firstAwaitLocation === null) { - this.firstAwaitLocation = this.getLocation(); - } - return true; - } - return false; - case _tokenizer.TokenType.ESCAPED_KEYWORD: - if (this.lookahead.value === "await" && !this.moduleIsTheGoalSymbol) { - if (this.firstAwaitLocation === null) { - this.firstAwaitLocation = this.getLocation(); - } - return true; - } - return this.lookahead.value === "let" || this.lookahead.value === "yield" || this.lookahead.value === "async"; - } - return false; - } - }, { - key: "eat", - value: function eat(tokenType) { - if (this.lookahead.type === tokenType) { - return this.lex(); - } - return null; - } - }, { - key: "expect", - value: function expect(tokenType) { - if (this.lookahead.type === tokenType) { - return this.lex(); - } - throw this.createUnexpected(this.lookahead); - } - }, { - key: "matchContextualKeyword", - value: function matchContextualKeyword(keyword2) { - return this.lookahead.type === _tokenizer.TokenType.IDENTIFIER && !this.lookahead.escaped && this.lookahead.value === keyword2; - } - }, { - key: "expectContextualKeyword", - value: function expectContextualKeyword(keyword2) { - if (this.lookahead.type === _tokenizer.TokenType.IDENTIFIER && !this.lookahead.escaped && this.lookahead.value === keyword2) { - return this.lex(); - } - throw this.createUnexpected(this.lookahead); - } - }, { - key: "eatContextualKeyword", - value: function eatContextualKeyword(keyword2) { - if (this.lookahead.type === _tokenizer.TokenType.IDENTIFIER && !this.lookahead.escaped && this.lookahead.value === keyword2) { - return this.lex(); - } - return null; - } - }, { - key: "consumeSemicolon", - value: function consumeSemicolon() { - if (this.eat(_tokenizer.TokenType.SEMICOLON)) - return; - if (this.hasLineTerminatorBeforeNext) - return; - if (!this.eof() && !this.match(_tokenizer.TokenType.RBRACE)) { - throw this.createUnexpected(this.lookahead); - } - } - }, { - key: "startNode", - value: function startNode(node) { - return node; - } - }, { - key: "copyNode", - value: function copyNode(src, dest) { - return dest; - } - }, { - key: "finishNode", - value: function finishNode(node) { - return node; - } - }, { - key: "parseModule", - value: function parseModule() { - this.moduleIsTheGoalSymbol = this.module = this.strict = true; - this.lookahead = this.advance(); - var startState = this.startNode(); - var _parseBody = this.parseBody(), directives = _parseBody.directives, statements = _parseBody.statements; - if (!this.match(_tokenizer.TokenType.EOS)) { - throw this.createUnexpected(this.lookahead); - } - return this.finishNode(new AST.Module({ directives, items: statements }), startState); - } - }, { - key: "parseScript", - value: function parseScript() { - this.lookahead = this.advance(); - var startState = this.startNode(); - var _parseBody2 = this.parseBody(), directives = _parseBody2.directives, statements = _parseBody2.statements; - if (!this.match(_tokenizer.TokenType.EOS)) { - throw this.createUnexpected(this.lookahead); - } - return this.finishNode(new AST.Script({ directives, statements }), startState); - } - }, { - key: "parseFunctionBody", - value: function parseFunctionBody() { - var oldInFunctionBody = this.inFunctionBody; - var oldModule = this.module; - var oldStrict = this.strict; - this.inFunctionBody = true; - this.module = false; - var startState = this.startNode(); - this.expect(_tokenizer.TokenType.LBRACE); - var body = new AST.FunctionBody(this.parseBody()); - this.expect(_tokenizer.TokenType.RBRACE); - body = this.finishNode(body, startState); - this.inFunctionBody = oldInFunctionBody; - this.module = oldModule; - this.strict = oldStrict; - return body; - } - }, { - key: "parseBody", - value: function parseBody() { - var directives = [], statements = [], parsingDirectives = true, directiveOctal = null; - while (true) { - if (this.eof() || this.match(_tokenizer.TokenType.RBRACE)) - break; - var token = this.lookahead; - var text = token.slice.text; - var isStringLiteral = token.type === _tokenizer.TokenType.STRING; - var isModule = this.module; - var directiveLocation = this.getLocation(); - var directiveStartState = this.startNode(); - var stmt = isModule ? this.parseModuleItem() : this.parseStatementListItem(); - if (parsingDirectives) { - if (isStringLiteral && stmt.type === "ExpressionStatement" && stmt.expression.type === "LiteralStringExpression") { - if (!directiveOctal && token.octal) { - directiveOctal = this.createErrorWithLocation(directiveLocation, "Unexpected legacy octal escape sequence: \\" + token.octal); - } - var rawValue = text.slice(1, -1); - if (rawValue === "use strict") { - this.strict = true; - } - directives.push(this.finishNode(new AST.Directive({ rawValue }), directiveStartState)); - } else { - parsingDirectives = false; - if (directiveOctal && this.strict) { - throw directiveOctal; - } - statements.push(stmt); - } - } else { - statements.push(stmt); - } - } - if (directiveOctal && this.strict) { - throw directiveOctal; - } - return { directives, statements }; - } - }, { - key: "parseImportSpecifier", - value: function parseImportSpecifier() { - var startState = this.startNode(), name = void 0; - if (this.matchIdentifier()) { - name = this.parseIdentifier(); - if (!this.eatContextualKeyword("as")) { - return this.finishNode(new AST.ImportSpecifier({ - name: null, - binding: this.finishNode(new AST.BindingIdentifier({ name }), startState) - }), startState); - } - } else if (this.lookahead.type.klass.isIdentifierName) { - name = this.parseIdentifierName(); - this.expectContextualKeyword("as"); - } - return this.finishNode(new AST.ImportSpecifier({ name, binding: this.parseBindingIdentifier() }), startState); - } - }, { - key: "parseNameSpaceBinding", - value: function parseNameSpaceBinding() { - this.expect(_tokenizer.TokenType.MUL); - this.expectContextualKeyword("as"); - return this.parseBindingIdentifier(); - } - }, { - key: "parseNamedImports", - value: function parseNamedImports() { - var result = []; - this.expect(_tokenizer.TokenType.LBRACE); - while (!this.eat(_tokenizer.TokenType.RBRACE)) { - result.push(this.parseImportSpecifier()); - if (!this.eat(_tokenizer.TokenType.COMMA)) { - this.expect(_tokenizer.TokenType.RBRACE); - break; - } - } - return result; - } - }, { - key: "parseFromClause", - value: function parseFromClause() { - this.expectContextualKeyword("from"); - var value = this.expect(_tokenizer.TokenType.STRING).str; - return value; - } - }, { - key: "parseImportDeclaration", - value: function parseImportDeclaration() { - var startState = this.startNode(), defaultBinding = null, moduleSpecifier = void 0; - this.expect(_tokenizer.TokenType.IMPORT); - if (this.match(_tokenizer.TokenType.STRING)) { - moduleSpecifier = this.lex().str; - this.consumeSemicolon(); - return this.finishNode(new AST.Import({ defaultBinding: null, namedImports: [], moduleSpecifier }), startState); - } - if (this.matchIdentifier()) { - defaultBinding = this.parseBindingIdentifier(); - if (!this.eat(_tokenizer.TokenType.COMMA)) { - var decl = new AST.Import({ defaultBinding, namedImports: [], moduleSpecifier: this.parseFromClause() }); - this.consumeSemicolon(); - return this.finishNode(decl, startState); - } - } - if (this.match(_tokenizer.TokenType.MUL)) { - var _decl = new AST.ImportNamespace({ - defaultBinding, - namespaceBinding: this.parseNameSpaceBinding(), - moduleSpecifier: this.parseFromClause() - }); - this.consumeSemicolon(); - return this.finishNode(_decl, startState); - } else if (this.match(_tokenizer.TokenType.LBRACE)) { - var _decl2 = new AST.Import({ - defaultBinding, - namedImports: this.parseNamedImports(), - moduleSpecifier: this.parseFromClause() - }); - this.consumeSemicolon(); - return this.finishNode(_decl2, startState); - } - throw this.createUnexpected(this.lookahead); - } - }, { - key: "parseExportSpecifier", - value: function parseExportSpecifier() { - var startState = this.startNode(); - var name = this.finishNode({ type: EXPORT_UNKNOWN_SPECIFIER, isIdentifier: this.matchIdentifier(), value: this.parseIdentifierName() }, startState); - if (this.eatContextualKeyword("as")) { - var exportedName = this.parseIdentifierName(); - return this.finishNode({ name, exportedName }, startState); - } - return this.finishNode({ name, exportedName: null }, startState); - } - }, { - key: "parseExportClause", - value: function parseExportClause() { - this.expect(_tokenizer.TokenType.LBRACE); - var result = []; - while (!this.eat(_tokenizer.TokenType.RBRACE)) { - result.push(this.parseExportSpecifier()); - if (!this.eat(_tokenizer.TokenType.COMMA)) { - this.expect(_tokenizer.TokenType.RBRACE); - break; - } - } - return result; - } - }, { - key: "parseExportDeclaration", - value: function parseExportDeclaration() { - var _this2 = this; - var startState = this.startNode(), decl = void 0; - this.expect(_tokenizer.TokenType.EXPORT); - switch (this.lookahead.type) { - case _tokenizer.TokenType.MUL: - this.lex(); - decl = new AST.ExportAllFrom({ moduleSpecifier: this.parseFromClause() }); - this.consumeSemicolon(); - break; - case _tokenizer.TokenType.LBRACE: { - var namedExports = this.parseExportClause(); - var moduleSpecifier = null; - if (this.matchContextualKeyword("from")) { - moduleSpecifier = this.parseFromClause(); - decl = new AST.ExportFrom({ namedExports: namedExports.map(function(e) { - return _this2.copyNode(e, new AST.ExportFromSpecifier({ name: e.name.value, exportedName: e.exportedName })); - }), moduleSpecifier }); - } else { - namedExports.forEach(function(_ref) { - var name = _ref.name; - if (!name.isIdentifier) { - throw _this2.createError(_errors$1.ErrorMessages.ILLEGAL_EXPORTED_NAME); - } - }); - decl = new AST.ExportLocals({ namedExports: namedExports.map(function(e) { - return _this2.copyNode(e, new AST.ExportLocalSpecifier({ name: _this2.copyNode(e.name, new AST.IdentifierExpression({ name: e.name.value })), exportedName: e.exportedName })); - }) }); - } - this.consumeSemicolon(); - break; - } - case _tokenizer.TokenType.CLASS: - decl = new AST.Export({ declaration: this.parseClass({ isExpr: false, inDefault: false }) }); - break; - case _tokenizer.TokenType.FUNCTION: - decl = new AST.Export({ declaration: this.parseFunction({ isExpr: false, inDefault: false, allowGenerator: true, isAsync: false }) }); - break; - case _tokenizer.TokenType.ASYNC: { - var preAsyncStartState = this.startNode(); - this.lex(); - decl = new AST.Export({ declaration: this.parseFunction({ isExpr: false, inDefault: false, allowGenerator: true, isAsync: true, startState: preAsyncStartState }) }); - break; - } - case _tokenizer.TokenType.DEFAULT: - this.lex(); - switch (this.lookahead.type) { - case _tokenizer.TokenType.FUNCTION: - decl = new AST.ExportDefault({ - body: this.parseFunction({ isExpr: false, inDefault: true, allowGenerator: true, isAsync: false }) - }); - break; - case _tokenizer.TokenType.CLASS: - decl = new AST.ExportDefault({ body: this.parseClass({ isExpr: false, inDefault: true }) }); - break; - case _tokenizer.TokenType.ASYNC: { - var _preAsyncStartState = this.startNode(); - var lexerState = this.saveLexerState(); - this.lex(); - if (!this.hasLineTerminatorBeforeNext && this.match(_tokenizer.TokenType.FUNCTION)) { - decl = new AST.ExportDefault({ - body: this.parseFunction({ isExpr: false, inDefault: true, allowGenerator: false, isAsync: true, startState: _preAsyncStartState }) - }); - break; - } - this.restoreLexerState(lexerState); - } - default: - decl = new AST.ExportDefault({ body: this.parseAssignmentExpression() }); - this.consumeSemicolon(); - break; - } - break; - case _tokenizer.TokenType.VAR: - case _tokenizer.TokenType.LET: - case _tokenizer.TokenType.CONST: - decl = new AST.Export({ declaration: this.parseVariableDeclaration(true) }); - this.consumeSemicolon(); - break; - default: - throw this.createUnexpected(this.lookahead); - } - return this.finishNode(decl, startState); - } - }, { - key: "parseModuleItem", - value: function parseModuleItem() { - switch (this.lookahead.type) { - case _tokenizer.TokenType.IMPORT: - return this.parseImportDeclaration(); - case _tokenizer.TokenType.EXPORT: - return this.parseExportDeclaration(); - default: - return this.parseStatementListItem(); - } - } - }, { - key: "lookaheadLexicalDeclaration", - value: function lookaheadLexicalDeclaration() { - if (this.match(_tokenizer.TokenType.LET) || this.match(_tokenizer.TokenType.CONST)) { - var lexerState = this.saveLexerState(); - this.lex(); - if (this.matchIdentifier() || this.match(_tokenizer.TokenType.LBRACE) || this.match(_tokenizer.TokenType.LBRACK)) { - this.restoreLexerState(lexerState); - return true; - } - this.restoreLexerState(lexerState); - } - return false; - } - }, { - key: "parseStatementListItem", - value: function parseStatementListItem() { - if (this.eof()) - throw this.createUnexpected(this.lookahead); - switch (this.lookahead.type) { - case _tokenizer.TokenType.FUNCTION: - return this.parseFunction({ isExpr: false, inDefault: false, allowGenerator: true, isAsync: false }); - case _tokenizer.TokenType.CLASS: - return this.parseClass({ isExpr: false, inDefault: false }); - case _tokenizer.TokenType.ASYNC: { - var preAsyncStartState = this.getLocation(); - var lexerState = this.saveLexerState(); - this.lex(); - if (!this.hasLineTerminatorBeforeNext && this.match(_tokenizer.TokenType.FUNCTION)) { - return this.parseFunction({ isExpr: false, inDefault: false, allowGenerator: true, isAsync: true, startState: preAsyncStartState }); - } - this.restoreLexerState(lexerState); - return this.parseStatement(); - } - default: - if (this.lookaheadLexicalDeclaration()) { - var startState = this.startNode(); - return this.finishNode(this.parseVariableDeclarationStatement(), startState); - } - return this.parseStatement(); - } - } - }, { - key: "parseStatement", - value: function parseStatement() { - var startState = this.startNode(); - var stmt = this.isolateCoverGrammar(this.parseStatementHelper); - return this.finishNode(stmt, startState); - } - }, { - key: "parseStatementHelper", - value: function parseStatementHelper() { - if (this.eof()) { - throw this.createUnexpected(this.lookahead); - } - switch (this.lookahead.type) { - case _tokenizer.TokenType.SEMICOLON: - return this.parseEmptyStatement(); - case _tokenizer.TokenType.LBRACE: - return this.parseBlockStatement(); - case _tokenizer.TokenType.LPAREN: - return this.parseExpressionStatement(); - case _tokenizer.TokenType.BREAK: - return this.parseBreakStatement(); - case _tokenizer.TokenType.CONTINUE: - return this.parseContinueStatement(); - case _tokenizer.TokenType.DEBUGGER: - return this.parseDebuggerStatement(); - case _tokenizer.TokenType.DO: - return this.parseDoWhileStatement(); - case _tokenizer.TokenType.FOR: - return this.parseForStatement(); - case _tokenizer.TokenType.IF: - return this.parseIfStatement(); - case _tokenizer.TokenType.RETURN: - return this.parseReturnStatement(); - case _tokenizer.TokenType.SWITCH: - return this.parseSwitchStatement(); - case _tokenizer.TokenType.THROW: - return this.parseThrowStatement(); - case _tokenizer.TokenType.TRY: - return this.parseTryStatement(); - case _tokenizer.TokenType.VAR: - return this.parseVariableDeclarationStatement(); - case _tokenizer.TokenType.WHILE: - return this.parseWhileStatement(); - case _tokenizer.TokenType.WITH: - return this.parseWithStatement(); - case _tokenizer.TokenType.FUNCTION: - case _tokenizer.TokenType.CLASS: - throw this.createUnexpected(this.lookahead); - default: { - var lexerState = this.saveLexerState(); - if (this.eat(_tokenizer.TokenType.LET)) { - if (this.match(_tokenizer.TokenType.LBRACK)) { - this.restoreLexerState(lexerState); - throw this.createUnexpected(this.lookahead); - } - this.restoreLexerState(lexerState); - } else if (this.eat(_tokenizer.TokenType.ASYNC)) { - if (!this.hasLineTerminatorBeforeNext && this.match(_tokenizer.TokenType.FUNCTION)) { - throw this.createUnexpected(this.lookahead); - } - this.restoreLexerState(lexerState); - } - var expr = this.parseExpression(); - if (expr.type === "IdentifierExpression" && this.eat(_tokenizer.TokenType.COLON)) { - var labeledBody = this.match(_tokenizer.TokenType.FUNCTION) ? this.parseFunction({ isExpr: false, inDefault: false, allowGenerator: false, isAsync: false }) : this.parseStatement(); - return new AST.LabeledStatement({ label: expr.name, body: labeledBody }); - } - this.consumeSemicolon(); - return new AST.ExpressionStatement({ expression: expr }); - } - } - } - }, { - key: "parseEmptyStatement", - value: function parseEmptyStatement() { - this.lex(); - return new AST.EmptyStatement(); - } - }, { - key: "parseBlockStatement", - value: function parseBlockStatement() { - return new AST.BlockStatement({ block: this.parseBlock() }); - } - }, { - key: "parseExpressionStatement", - value: function parseExpressionStatement() { - var expr = this.parseExpression(); - this.consumeSemicolon(); - return new AST.ExpressionStatement({ expression: expr }); - } - }, { - key: "parseBreakStatement", - value: function parseBreakStatement() { - this.lex(); - if (this.eat(_tokenizer.TokenType.SEMICOLON) || this.hasLineTerminatorBeforeNext) { - return new AST.BreakStatement({ label: null }); - } - var label = null; - if (this.matchIdentifier()) { - label = this.parseIdentifier(); - } - this.consumeSemicolon(); - return new AST.BreakStatement({ label }); - } - }, { - key: "parseContinueStatement", - value: function parseContinueStatement() { - this.lex(); - if (this.eat(_tokenizer.TokenType.SEMICOLON) || this.hasLineTerminatorBeforeNext) { - return new AST.ContinueStatement({ label: null }); - } - var label = null; - if (this.matchIdentifier()) { - label = this.parseIdentifier(); - } - this.consumeSemicolon(); - return new AST.ContinueStatement({ label }); - } - }, { - key: "parseDebuggerStatement", - value: function parseDebuggerStatement() { - this.lex(); - this.consumeSemicolon(); - return new AST.DebuggerStatement(); - } - }, { - key: "parseDoWhileStatement", - value: function parseDoWhileStatement() { - this.lex(); - var body = this.parseStatement(); - this.expect(_tokenizer.TokenType.WHILE); - this.expect(_tokenizer.TokenType.LPAREN); - var test = this.parseExpression(); - this.expect(_tokenizer.TokenType.RPAREN); - this.eat(_tokenizer.TokenType.SEMICOLON); - return new AST.DoWhileStatement({ body, test }); - } - }, { - key: "parseForStatement", - value: function parseForStatement() { - this.lex(); - var isAwait = this.allowAwaitExpression && this.eat(_tokenizer.TokenType.AWAIT); - this.expect(_tokenizer.TokenType.LPAREN); - var test = null; - var right = null; - if (isAwait && this.match(_tokenizer.TokenType.SEMICOLON)) { - throw this.createUnexpected(this.lookahead); - } - if (this.eat(_tokenizer.TokenType.SEMICOLON)) { - if (!this.match(_tokenizer.TokenType.SEMICOLON)) { - test = this.parseExpression(); - } - this.expect(_tokenizer.TokenType.SEMICOLON); - if (!this.match(_tokenizer.TokenType.RPAREN)) { - right = this.parseExpression(); - } - return new AST.ForStatement({ init: null, test, update: right, body: this.getIteratorStatementEpilogue() }); - } - var startsWithLet = this.match(_tokenizer.TokenType.LET); - var isForDecl = this.lookaheadLexicalDeclaration(); - var leftStartState = this.startNode(); - if (this.match(_tokenizer.TokenType.VAR) || isForDecl) { - var _previousAllowIn = this.allowIn; - this.allowIn = false; - var init = this.parseVariableDeclaration(false); - this.allowIn = _previousAllowIn; - if (init.declarators.length === 1 && (this.match(_tokenizer.TokenType.IN) || this.matchContextualKeyword("of"))) { - var ctor = void 0; - var decl = init.declarators[0]; - if (this.match(_tokenizer.TokenType.IN)) { - if (isAwait) { - throw this.createUnexpected(this.lookahead); - } - if (decl.init !== null && (this.strict || init.kind !== "var" || decl.binding.type !== "BindingIdentifier")) { - throw this.createError(_errors$1.ErrorMessages.INVALID_VAR_INIT_FOR_IN); - } - ctor = AST.ForInStatement; - this.lex(); - right = this.parseExpression(); - } else { - if (decl.init !== null) { - throw this.createError(isAwait ? _errors$1.ErrorMessages.INVALID_VAR_INIT_FOR_AWAIT : _errors$1.ErrorMessages.INVALID_VAR_INIT_FOR_OF); - } - if (isAwait) { - ctor = AST.ForAwaitStatement; - } else { - ctor = AST.ForOfStatement; - } - this.lex(); - right = this.parseAssignmentExpression(); - } - var body = this.getIteratorStatementEpilogue(); - return new ctor({ left: init, right, body }); - } else if (isAwait) { - throw this.createUnexpected(this.lookahead); - } - this.expect(_tokenizer.TokenType.SEMICOLON); - if (init.declarators.some(function(decl2) { - return decl2.binding.type !== "BindingIdentifier" && decl2.init === null; - })) { - throw this.createError(_errors$1.ErrorMessages.UNINITIALIZED_BINDINGPATTERN_IN_FOR_INIT); - } - if (!this.match(_tokenizer.TokenType.SEMICOLON)) { - test = this.parseExpression(); - } - this.expect(_tokenizer.TokenType.SEMICOLON); - if (!this.match(_tokenizer.TokenType.RPAREN)) { - right = this.parseExpression(); - } - return new AST.ForStatement({ init, test, update: right, body: this.getIteratorStatementEpilogue() }); - } - var previousAllowIn = this.allowIn; - this.allowIn = false; - var expr = this.inheritCoverGrammar(this.parseAssignmentExpressionOrTarget); - this.allowIn = previousAllowIn; - if (this.isAssignmentTarget && expr.type !== "AssignmentExpression" && (this.match(_tokenizer.TokenType.IN) || this.matchContextualKeyword("of"))) { - if (expr.type === "ObjectAssignmentTarget" || expr.type === "ArrayAssignmentTarget") { - this.firstExprError = null; - } - if (startsWithLet && this.matchContextualKeyword("of")) { - throw this.createError(isAwait ? _errors$1.ErrorMessages.INVALID_LHS_IN_FOR_AWAIT : _errors$1.ErrorMessages.INVALID_LHS_IN_FOR_OF); - } - var _ctor = void 0; - if (this.match(_tokenizer.TokenType.IN)) { - if (isAwait) { - throw this.createUnexpected(this.lookahead); - } - _ctor = AST.ForInStatement; - this.lex(); - right = this.parseExpression(); - } else { - if (isAwait) { - _ctor = AST.ForAwaitStatement; - } else { - _ctor = AST.ForOfStatement; - } - this.lex(); - right = this.parseAssignmentExpression(); - } - return new _ctor({ left: this.transformDestructuring(expr), right, body: this.getIteratorStatementEpilogue() }); - } else if (isAwait) { - throw this.createError(_errors$1.ErrorMessages.INVALID_LHS_IN_FOR_AWAIT); - } - if (this.firstExprError) { - throw this.firstExprError; - } - while (this.eat(_tokenizer.TokenType.COMMA)) { - var rhs = this.parseAssignmentExpression(); - expr = this.finishNode(new AST.BinaryExpression({ left: expr, operator: ",", right: rhs }), leftStartState); - } - if (this.match(_tokenizer.TokenType.IN)) { - throw this.createError(_errors$1.ErrorMessages.INVALID_LHS_IN_FOR_IN); - } - if (this.matchContextualKeyword("of")) { - throw this.createError(_errors$1.ErrorMessages.INVALID_LHS_IN_FOR_OF); - } - this.expect(_tokenizer.TokenType.SEMICOLON); - if (!this.match(_tokenizer.TokenType.SEMICOLON)) { - test = this.parseExpression(); - } - this.expect(_tokenizer.TokenType.SEMICOLON); - if (!this.match(_tokenizer.TokenType.RPAREN)) { - right = this.parseExpression(); - } - return new AST.ForStatement({ init: expr, test, update: right, body: this.getIteratorStatementEpilogue() }); - } - }, { - key: "getIteratorStatementEpilogue", - value: function getIteratorStatementEpilogue() { - this.expect(_tokenizer.TokenType.RPAREN); - var body = this.parseStatement(); - return body; - } - }, { - key: "parseIfStatementChild", - value: function parseIfStatementChild() { - return this.match(_tokenizer.TokenType.FUNCTION) ? this.parseFunction({ isExpr: false, inDefault: false, allowGenerator: false, isAsync: false }) : this.parseStatement(); - } - }, { - key: "parseIfStatement", - value: function parseIfStatement() { - this.lex(); - this.expect(_tokenizer.TokenType.LPAREN); - var test = this.parseExpression(); - this.expect(_tokenizer.TokenType.RPAREN); - var consequent = this.parseIfStatementChild(); - var alternate = null; - if (this.eat(_tokenizer.TokenType.ELSE)) { - alternate = this.parseIfStatementChild(); - } - return new AST.IfStatement({ test, consequent, alternate }); - } - }, { - key: "parseReturnStatement", - value: function parseReturnStatement() { - if (!this.inFunctionBody) { - throw this.createError(_errors$1.ErrorMessages.ILLEGAL_RETURN); - } - this.lex(); - if (this.eat(_tokenizer.TokenType.SEMICOLON) || this.hasLineTerminatorBeforeNext) { - return new AST.ReturnStatement({ expression: null }); - } - var expression = null; - if (!this.match(_tokenizer.TokenType.RBRACE) && !this.eof()) { - expression = this.parseExpression(); - } - this.consumeSemicolon(); - return new AST.ReturnStatement({ expression }); - } - }, { - key: "parseSwitchStatement", - value: function parseSwitchStatement() { - this.lex(); - this.expect(_tokenizer.TokenType.LPAREN); - var discriminant = this.parseExpression(); - this.expect(_tokenizer.TokenType.RPAREN); - this.expect(_tokenizer.TokenType.LBRACE); - if (this.eat(_tokenizer.TokenType.RBRACE)) { - return new AST.SwitchStatement({ discriminant, cases: [] }); - } - var cases = this.parseSwitchCases(); - if (this.match(_tokenizer.TokenType.DEFAULT)) { - var defaultCase = this.parseSwitchDefault(); - var postDefaultCases = this.parseSwitchCases(); - if (this.match(_tokenizer.TokenType.DEFAULT)) { - throw this.createError(_errors$1.ErrorMessages.MULTIPLE_DEFAULTS_IN_SWITCH); - } - this.expect(_tokenizer.TokenType.RBRACE); - return new AST.SwitchStatementWithDefault({ - discriminant, - preDefaultCases: cases, - defaultCase, - postDefaultCases - }); - } - this.expect(_tokenizer.TokenType.RBRACE); - return new AST.SwitchStatement({ discriminant, cases }); - } - }, { - key: "parseSwitchCases", - value: function parseSwitchCases() { - var result = []; - while (!(this.eof() || this.match(_tokenizer.TokenType.RBRACE) || this.match(_tokenizer.TokenType.DEFAULT))) { - result.push(this.parseSwitchCase()); - } - return result; - } - }, { - key: "parseSwitchCase", - value: function parseSwitchCase() { - var startState = this.startNode(); - this.expect(_tokenizer.TokenType.CASE); - return this.finishNode(new AST.SwitchCase({ - test: this.parseExpression(), - consequent: this.parseSwitchCaseBody() - }), startState); - } - }, { - key: "parseSwitchDefault", - value: function parseSwitchDefault() { - var startState = this.startNode(); - this.expect(_tokenizer.TokenType.DEFAULT); - return this.finishNode(new AST.SwitchDefault({ consequent: this.parseSwitchCaseBody() }), startState); - } - }, { - key: "parseSwitchCaseBody", - value: function parseSwitchCaseBody() { - this.expect(_tokenizer.TokenType.COLON); - return this.parseStatementListInSwitchCaseBody(); - } - }, { - key: "parseStatementListInSwitchCaseBody", - value: function parseStatementListInSwitchCaseBody() { - var result = []; - while (!(this.eof() || this.match(_tokenizer.TokenType.RBRACE) || this.match(_tokenizer.TokenType.DEFAULT) || this.match(_tokenizer.TokenType.CASE))) { - result.push(this.parseStatementListItem()); - } - return result; - } - }, { - key: "parseThrowStatement", - value: function parseThrowStatement() { - var token = this.lex(); - if (this.hasLineTerminatorBeforeNext) { - throw this.createErrorWithLocation(token, _errors$1.ErrorMessages.NEWLINE_AFTER_THROW); - } - var expression = this.parseExpression(); - this.consumeSemicolon(); - return new AST.ThrowStatement({ expression }); - } - }, { - key: "parseTryStatement", - value: function parseTryStatement() { - this.lex(); - var body = this.parseBlock(); - if (this.match(_tokenizer.TokenType.CATCH)) { - var catchClause = this.parseCatchClause(); - if (this.eat(_tokenizer.TokenType.FINALLY)) { - var finalizer = this.parseBlock(); - return new AST.TryFinallyStatement({ body, catchClause, finalizer }); - } - return new AST.TryCatchStatement({ body, catchClause }); - } - if (this.eat(_tokenizer.TokenType.FINALLY)) { - var _finalizer = this.parseBlock(); - return new AST.TryFinallyStatement({ body, catchClause: null, finalizer: _finalizer }); - } - throw this.createError(_errors$1.ErrorMessages.NO_CATCH_OR_FINALLY); - } - }, { - key: "parseVariableDeclarationStatement", - value: function parseVariableDeclarationStatement() { - var declaration = this.parseVariableDeclaration(true); - this.consumeSemicolon(); - return new AST.VariableDeclarationStatement({ declaration }); - } - }, { - key: "parseWhileStatement", - value: function parseWhileStatement() { - this.lex(); - this.expect(_tokenizer.TokenType.LPAREN); - var test = this.parseExpression(); - var body = this.getIteratorStatementEpilogue(); - return new AST.WhileStatement({ test, body }); - } - }, { - key: "parseWithStatement", - value: function parseWithStatement() { - this.lex(); - this.expect(_tokenizer.TokenType.LPAREN); - var object = this.parseExpression(); - this.expect(_tokenizer.TokenType.RPAREN); - var body = this.parseStatement(); - return new AST.WithStatement({ object, body }); - } - }, { - key: "parseCatchClause", - value: function parseCatchClause() { - var startState = this.startNode(); - this.lex(); - this.expect(_tokenizer.TokenType.LPAREN); - if (this.match(_tokenizer.TokenType.RPAREN) || this.match(_tokenizer.TokenType.LPAREN)) { - throw this.createUnexpected(this.lookahead); - } - var binding = this.parseBindingTarget(); - this.expect(_tokenizer.TokenType.RPAREN); - var body = this.parseBlock(); - return this.finishNode(new AST.CatchClause({ binding, body }), startState); - } - }, { - key: "parseBlock", - value: function parseBlock() { - var startState = this.startNode(); - this.expect(_tokenizer.TokenType.LBRACE); - var body = []; - while (!this.match(_tokenizer.TokenType.RBRACE)) { - body.push(this.parseStatementListItem()); - } - this.expect(_tokenizer.TokenType.RBRACE); - return this.finishNode(new AST.Block({ statements: body }), startState); - } - }, { - key: "parseVariableDeclaration", - value: function parseVariableDeclaration(bindingPatternsMustHaveInit) { - var startState = this.startNode(); - var token = this.lex(); - var kind = token.type === _tokenizer.TokenType.VAR ? "var" : token.type === _tokenizer.TokenType.CONST ? "const" : "let"; - var declarators = this.parseVariableDeclaratorList(bindingPatternsMustHaveInit); - return this.finishNode(new AST.VariableDeclaration({ kind, declarators }), startState); - } - }, { - key: "parseVariableDeclaratorList", - value: function parseVariableDeclaratorList(bindingPatternsMustHaveInit) { - var result = []; - do { - result.push(this.parseVariableDeclarator(bindingPatternsMustHaveInit)); - } while (this.eat(_tokenizer.TokenType.COMMA)); - return result; - } - }, { - key: "parseVariableDeclarator", - value: function parseVariableDeclarator(bindingPatternsMustHaveInit) { - var startState = this.startNode(); - if (this.match(_tokenizer.TokenType.LPAREN)) { - throw this.createUnexpected(this.lookahead); - } - var previousAllowIn = this.allowIn; - this.allowIn = true; - var binding = this.parseBindingTarget(); - this.allowIn = previousAllowIn; - if (bindingPatternsMustHaveInit && binding.type !== "BindingIdentifier" && !this.match(_tokenizer.TokenType.ASSIGN)) { - this.expect(_tokenizer.TokenType.ASSIGN); - } - var init = null; - if (this.eat(_tokenizer.TokenType.ASSIGN)) { - init = this.parseAssignmentExpression(); - } - return this.finishNode(new AST.VariableDeclarator({ binding, init }), startState); - } - }, { - key: "isolateCoverGrammar", - value: function isolateCoverGrammar(parser2) { - var oldIsBindingElement = this.isBindingElement, oldIsAssignmentTarget = this.isAssignmentTarget, oldFirstExprError = this.firstExprError, result = void 0; - this.isBindingElement = this.isAssignmentTarget = true; - this.firstExprError = null; - result = parser2.call(this); - if (this.firstExprError !== null) { - throw this.firstExprError; - } - this.isBindingElement = oldIsBindingElement; - this.isAssignmentTarget = oldIsAssignmentTarget; - this.firstExprError = oldFirstExprError; - return result; - } - }, { - key: "inheritCoverGrammar", - value: function inheritCoverGrammar(parser2) { - var oldIsBindingElement = this.isBindingElement, oldIsAssignmentTarget = this.isAssignmentTarget, oldFirstExprError = this.firstExprError, result = void 0; - this.isBindingElement = this.isAssignmentTarget = true; - this.firstExprError = null; - result = parser2.call(this); - this.isBindingElement = this.isBindingElement && oldIsBindingElement; - this.isAssignmentTarget = this.isAssignmentTarget && oldIsAssignmentTarget; - this.firstExprError = oldFirstExprError || this.firstExprError; - return result; - } - }, { - key: "parseExpression", - value: function parseExpression() { - var startState = this.startNode(); - var left = this.parseAssignmentExpression(); - if (this.match(_tokenizer.TokenType.COMMA)) { - while (!this.eof()) { - if (!this.match(_tokenizer.TokenType.COMMA)) - break; - this.lex(); - var right = this.parseAssignmentExpression(); - left = this.finishNode(new AST.BinaryExpression({ left, operator: ",", right }), startState); - } - } - return left; - } - }, { - key: "finishArrowParams", - value: function finishArrowParams(head) { - var _head$params = head.params, params = _head$params === void 0 ? null : _head$params, _head$rest = head.rest, rest = _head$rest === void 0 ? null : _head$rest; - if (head.type !== ARROW_EXPRESSION_PARAMS) { - if (head.type === "IdentifierExpression") { - params = [this.targetToBinding(this.transformDestructuring(head))]; - } else { - throw this.createUnexpected(this.lookahead); - } - } - return this.copyNode(head, new AST.FormalParameters({ items: params, rest })); - } - }, { - key: "parseArrowExpressionTail", - value: function parseArrowExpressionTail(params, isAsync, startState) { - this.expect(_tokenizer.TokenType.ARROW); - var previousYield = this.allowYieldExpression; - var previousAwait = this.allowAwaitExpression; - var previousAwaitLocation = this.firstAwaitLocation; - this.allowYieldExpression = false; - this.allowAwaitExpression = isAsync; - this.firstAwaitLocation = null; - var body = void 0; - if (this.match(_tokenizer.TokenType.LBRACE)) { - var previousAllowIn = this.allowIn; - this.allowIn = true; - body = this.parseFunctionBody(); - this.allowIn = previousAllowIn; - } else { - body = this.parseAssignmentExpression(); - } - this.allowYieldExpression = previousYield; - this.allowAwaitExpression = previousAwait; - this.firstAwaitLocation = previousAwaitLocation; - return this.finishNode(new AST.ArrowExpression({ isAsync, params, body }), startState); - } - }, { - key: "parseAssignmentExpression", - value: function parseAssignmentExpression() { - return this.isolateCoverGrammar(this.parseAssignmentExpressionOrTarget); - } - }, { - key: "parseAssignmentExpressionOrTarget", - value: function parseAssignmentExpressionOrTarget() { - var startState = this.startNode(); - if (this.allowYieldExpression && this.match(_tokenizer.TokenType.YIELD)) { - this.isBindingElement = this.isAssignmentTarget = false; - return this.parseYieldExpression(); - } - var expr = this.parseConditionalExpression(); - if (!this.hasLineTerminatorBeforeNext && this.match(_tokenizer.TokenType.ARROW)) { - this.isBindingElement = this.isAssignmentTarget = false; - this.firstExprError = null; - var isAsync = expr.type === ARROW_EXPRESSION_PARAMS && expr.isAsync; - return this.parseArrowExpressionTail(this.finishArrowParams(expr), isAsync, startState); - } - var isAssignmentOperator = false; - var operator = this.lookahead; - switch (operator.type) { - case _tokenizer.TokenType.ASSIGN_BIT_OR: - case _tokenizer.TokenType.ASSIGN_BIT_XOR: - case _tokenizer.TokenType.ASSIGN_BIT_AND: - case _tokenizer.TokenType.ASSIGN_SHL: - case _tokenizer.TokenType.ASSIGN_SHR: - case _tokenizer.TokenType.ASSIGN_SHR_UNSIGNED: - case _tokenizer.TokenType.ASSIGN_ADD: - case _tokenizer.TokenType.ASSIGN_SUB: - case _tokenizer.TokenType.ASSIGN_MUL: - case _tokenizer.TokenType.ASSIGN_DIV: - case _tokenizer.TokenType.ASSIGN_MOD: - case _tokenizer.TokenType.ASSIGN_EXP: - isAssignmentOperator = true; - break; - } - if (isAssignmentOperator) { - if (!this.isAssignmentTarget || !isValidSimpleAssignmentTarget(expr)) { - throw this.createError(_errors$1.ErrorMessages.INVALID_LHS_IN_ASSIGNMENT); - } - expr = this.transformDestructuring(expr); - } else if (operator.type === _tokenizer.TokenType.ASSIGN) { - if (!this.isAssignmentTarget) { - throw this.createError(_errors$1.ErrorMessages.INVALID_LHS_IN_ASSIGNMENT); - } - expr = this.transformDestructuring(expr); - } else { - return expr; - } - this.lex(); - var rhs = this.parseAssignmentExpression(); - this.firstExprError = null; - var node = void 0; - if (operator.type === _tokenizer.TokenType.ASSIGN) { - node = new AST.AssignmentExpression({ binding: expr, expression: rhs }); - } else { - node = new AST.CompoundAssignmentExpression({ binding: expr, operator: operator.type.name, expression: rhs }); - this.isBindingElement = this.isAssignmentTarget = false; - } - return this.finishNode(node, startState); - } - }, { - key: "targetToBinding", - value: function targetToBinding(node) { - var _this3 = this; - if (node === null) { - return null; - } - switch (node.type) { - case "AssignmentTargetIdentifier": - return this.copyNode(node, new AST.BindingIdentifier({ name: node.name })); - case "ArrayAssignmentTarget": - return this.copyNode(node, new AST.ArrayBinding({ elements: node.elements.map(function(e) { - return _this3.targetToBinding(e); - }), rest: this.targetToBinding(node.rest) })); - case "ObjectAssignmentTarget": - return this.copyNode(node, new AST.ObjectBinding({ properties: node.properties.map(function(p2) { - return _this3.targetToBinding(p2); - }), rest: this.targetToBinding(node.rest) })); - case "AssignmentTargetPropertyIdentifier": - return this.copyNode(node, new AST.BindingPropertyIdentifier({ binding: this.targetToBinding(node.binding), init: node.init })); - case "AssignmentTargetPropertyProperty": - return this.copyNode(node, new AST.BindingPropertyProperty({ name: node.name, binding: this.targetToBinding(node.binding) })); - case "AssignmentTargetWithDefault": - return this.copyNode(node, new AST.BindingWithDefault({ binding: this.targetToBinding(node.binding), init: node.init })); - } - throw new Error("Not reached"); - } - }, { - key: "transformDestructuring", - value: function transformDestructuring(node) { - var _this4 = this; - switch (node.type) { - case "DataProperty": - return this.copyNode(node, new AST.AssignmentTargetPropertyProperty({ - name: node.name, - binding: this.transformDestructuringWithDefault(node.expression) - })); - case "ShorthandProperty": - return this.copyNode(node, new AST.AssignmentTargetPropertyIdentifier({ - binding: this.copyNode(node, new AST.AssignmentTargetIdentifier({ name: node.name.name })), - init: null - })); - case "ObjectExpression": { - var last = node.properties.length > 0 ? node.properties[node.properties.length - 1] : void 0; - if (last != null && last.type === "SpreadProperty") { - return this.copyNode(node, new AST.ObjectAssignmentTarget({ - properties: node.properties.slice(0, -1).map(function(e) { - return e && _this4.transformDestructuringWithDefault(e); - }), - rest: this.transformDestructuring(last.expression) - })); - } - return this.copyNode(node, new AST.ObjectAssignmentTarget({ - properties: node.properties.map(function(e) { - return e && _this4.transformDestructuringWithDefault(e); - }), - rest: null - })); - } - case "ArrayExpression": { - var _last = node.elements[node.elements.length - 1]; - if (_last != null && _last.type === "SpreadElement") { - return this.copyNode(node, new AST.ArrayAssignmentTarget({ - elements: node.elements.slice(0, -1).map(function(e) { - return e && _this4.transformDestructuringWithDefault(e); - }), - rest: this.copyNode(_last.expression, this.transformDestructuring(_last.expression)) - })); - } - return this.copyNode(node, new AST.ArrayAssignmentTarget({ - elements: node.elements.map(function(e) { - return e && _this4.transformDestructuringWithDefault(e); - }), - rest: null - })); - } - case "IdentifierExpression": - return this.copyNode(node, new AST.AssignmentTargetIdentifier({ name: node.name })); - case "StaticPropertyName": - return this.copyNode(node, new AST.AssignmentTargetIdentifier({ name: node.value })); - case "ComputedMemberExpression": - return this.copyNode(node, new AST.ComputedMemberAssignmentTarget({ object: node.object, expression: node.expression })); - case "StaticMemberExpression": - return this.copyNode(node, new AST.StaticMemberAssignmentTarget({ object: node.object, property: node.property })); - case "ArrayAssignmentTarget": - case "ObjectAssignmentTarget": - case "ComputedMemberAssignmentTarget": - case "StaticMemberAssignmentTarget": - case "AssignmentTargetIdentifier": - case "AssignmentTargetPropertyIdentifier": - case "AssignmentTargetPropertyProperty": - case "AssignmentTargetWithDefault": - return node; - } - throw new Error("Not reached"); - } - }, { - key: "transformDestructuringWithDefault", - value: function transformDestructuringWithDefault(node) { - switch (node.type) { - case "AssignmentExpression": - return this.copyNode(node, new AST.AssignmentTargetWithDefault({ - binding: this.transformDestructuring(node.binding), - init: node.expression - })); - } - return this.transformDestructuring(node); - } - }, { - key: "lookaheadAssignmentExpression", - value: function lookaheadAssignmentExpression() { - if (this.matchIdentifier()) { - return true; - } - switch (this.lookahead.type) { - case _tokenizer.TokenType.ADD: - case _tokenizer.TokenType.ASSIGN_DIV: - case _tokenizer.TokenType.BIT_NOT: - case _tokenizer.TokenType.CLASS: - case _tokenizer.TokenType.DEC: - case _tokenizer.TokenType.DELETE: - case _tokenizer.TokenType.DIV: - case _tokenizer.TokenType.FALSE: - case _tokenizer.TokenType.FUNCTION: - case _tokenizer.TokenType.INC: - case _tokenizer.TokenType.LBRACE: - case _tokenizer.TokenType.LBRACK: - case _tokenizer.TokenType.LPAREN: - case _tokenizer.TokenType.NEW: - case _tokenizer.TokenType.NOT: - case _tokenizer.TokenType.NULL: - case _tokenizer.TokenType.NUMBER: - case _tokenizer.TokenType.STRING: - case _tokenizer.TokenType.SUB: - case _tokenizer.TokenType.SUPER: - case _tokenizer.TokenType.THIS: - case _tokenizer.TokenType.TRUE: - case _tokenizer.TokenType.TYPEOF: - case _tokenizer.TokenType.VOID: - case _tokenizer.TokenType.TEMPLATE: - return true; - } - return false; - } - }, { - key: "parseYieldExpression", - value: function parseYieldExpression() { - var startState = this.startNode(); - this.lex(); - if (this.hasLineTerminatorBeforeNext) { - return this.finishNode(new AST.YieldExpression({ expression: null }), startState); - } - var isGenerator = !!this.eat(_tokenizer.TokenType.MUL); - var expr = null; - if (isGenerator || this.lookaheadAssignmentExpression()) { - expr = this.parseAssignmentExpression(); - } - var ctor = isGenerator ? AST.YieldGeneratorExpression : AST.YieldExpression; - return this.finishNode(new ctor({ expression: expr }), startState); - } - }, { - key: "parseConditionalExpression", - value: function parseConditionalExpression() { - var startState = this.startNode(); - var test = this.parseBinaryExpression(); - if (this.firstExprError) - return test; - if (this.eat(_tokenizer.TokenType.CONDITIONAL)) { - this.isBindingElement = this.isAssignmentTarget = false; - var previousAllowIn = this.allowIn; - this.allowIn = true; - var consequent = this.isolateCoverGrammar(this.parseAssignmentExpression); - this.allowIn = previousAllowIn; - this.expect(_tokenizer.TokenType.COLON); - var alternate = this.isolateCoverGrammar(this.parseAssignmentExpression); - return this.finishNode(new AST.ConditionalExpression({ test, consequent, alternate }), startState); - } - return test; - } - }, { - key: "isBinaryOperator", - value: function isBinaryOperator(type) { - switch (type) { - case _tokenizer.TokenType.OR: - case _tokenizer.TokenType.AND: - case _tokenizer.TokenType.BIT_OR: - case _tokenizer.TokenType.BIT_XOR: - case _tokenizer.TokenType.BIT_AND: - case _tokenizer.TokenType.EQ: - case _tokenizer.TokenType.NE: - case _tokenizer.TokenType.EQ_STRICT: - case _tokenizer.TokenType.NE_STRICT: - case _tokenizer.TokenType.LT: - case _tokenizer.TokenType.GT: - case _tokenizer.TokenType.LTE: - case _tokenizer.TokenType.GTE: - case _tokenizer.TokenType.INSTANCEOF: - case _tokenizer.TokenType.SHL: - case _tokenizer.TokenType.SHR: - case _tokenizer.TokenType.SHR_UNSIGNED: - case _tokenizer.TokenType.ADD: - case _tokenizer.TokenType.SUB: - case _tokenizer.TokenType.MUL: - case _tokenizer.TokenType.DIV: - case _tokenizer.TokenType.MOD: - return true; - case _tokenizer.TokenType.IN: - return this.allowIn; - default: - return false; - } - } - }, { - key: "parseBinaryExpression", - value: function parseBinaryExpression() { - var _this5 = this; - var startState = this.startNode(); - var left = this.parseExponentiationExpression(); - if (this.firstExprError) { - return left; - } - var operator = this.lookahead.type; - if (!this.isBinaryOperator(operator)) - return left; - this.isBindingElement = this.isAssignmentTarget = false; - this.lex(); - var stack2 = []; - stack2.push({ startState, left, operator, precedence: BinaryPrecedence$1[operator.name] }); - startState = this.startNode(); - var right = this.isolateCoverGrammar(this.parseExponentiationExpression); - operator = this.lookahead.type; - while (this.isBinaryOperator(operator)) { - var precedence = BinaryPrecedence$1[operator.name]; - while (stack2.length && precedence <= stack2[stack2.length - 1].precedence) { - var stackItem = stack2[stack2.length - 1]; - var stackOperator = stackItem.operator; - left = stackItem.left; - stack2.pop(); - startState = stackItem.startState; - right = this.finishNode(new AST.BinaryExpression({ left, operator: stackOperator.name, right }), startState); - } - this.lex(); - stack2.push({ startState, left: right, operator, precedence }); - startState = this.startNode(); - right = this.isolateCoverGrammar(this.parseExponentiationExpression); - operator = this.lookahead.type; - } - return stack2.reduceRight(function(expr, stackItem2) { - return _this5.finishNode(new AST.BinaryExpression({ - left: stackItem2.left, - operator: stackItem2.operator.name, - right: expr - }), stackItem2.startState); - }, right); - } - }, { - key: "parseExponentiationExpression", - value: function parseExponentiationExpression() { - var startState = this.startNode(); - var leftIsParenthesized = this.lookahead.type === _tokenizer.TokenType.LPAREN; - var left = this.parseUnaryExpression(); - if (this.lookahead.type !== _tokenizer.TokenType.EXP) { - return left; - } - if (left.type === "UnaryExpression" && !leftIsParenthesized) { - throw this.createError(_errors$1.ErrorMessages.INVALID_EXPONENTIATION_LHS); - } - this.lex(); - this.isBindingElement = this.isAssignmentTarget = false; - var right = this.isolateCoverGrammar(this.parseExponentiationExpression); - return this.finishNode(new AST.BinaryExpression({ left, operator: "**", right }), startState); - } - }, { - key: "parseUnaryExpression", - value: function parseUnaryExpression() { - if (this.lookahead.type.klass !== _tokenizer.TokenClass.Punctuator && this.lookahead.type.klass !== _tokenizer.TokenClass.Keyword) { - return this.parseUpdateExpression(); - } - var startState = this.startNode(); - if (this.allowAwaitExpression && this.eat(_tokenizer.TokenType.AWAIT)) { - this.isBindingElement = this.isAssignmentTarget = false; - var expression = this.isolateCoverGrammar(this.parseUnaryExpression); - return this.finishNode(new AST.AwaitExpression({ expression }), startState); - } - var operator = this.lookahead; - if (!isPrefixOperator(operator)) { - return this.parseUpdateExpression(); - } - this.lex(); - this.isBindingElement = this.isAssignmentTarget = false; - var node = void 0; - if (isUpdateOperator(operator)) { - var operandStartLocation = this.getLocation(); - var operand = this.isolateCoverGrammar(this.parseUnaryExpression); - if (!isValidSimpleAssignmentTarget(operand)) { - throw this.createErrorWithLocation(operandStartLocation, _errors$1.ErrorMessages.INVALID_UPDATE_OPERAND); - } - operand = this.transformDestructuring(operand); - node = new AST.UpdateExpression({ isPrefix: true, operator: operator.value, operand }); - } else { - var _operand = this.isolateCoverGrammar(this.parseUnaryExpression); - node = new AST.UnaryExpression({ operator: operator.value, operand: _operand }); - } - return this.finishNode(node, startState); - } - }, { - key: "parseUpdateExpression", - value: function parseUpdateExpression() { - var startLocation = this.getLocation(); - var startState = this.startNode(); - var operand = this.parseLeftHandSideExpression({ allowCall: true }); - if (this.firstExprError || this.hasLineTerminatorBeforeNext) - return operand; - var operator = this.lookahead; - if (!isUpdateOperator(operator)) - return operand; - this.lex(); - this.isBindingElement = this.isAssignmentTarget = false; - if (!isValidSimpleAssignmentTarget(operand)) { - throw this.createErrorWithLocation(startLocation, _errors$1.ErrorMessages.INVALID_UPDATE_OPERAND); - } - operand = this.transformDestructuring(operand); - return this.finishNode(new AST.UpdateExpression({ isPrefix: false, operator: operator.value, operand }), startState); - } - }, { - key: "parseLeftHandSideExpression", - value: function parseLeftHandSideExpression(_ref2) { - var _this6 = this; - var allowCall = _ref2.allowCall; - var startState = this.startNode(); - var previousAllowIn = this.allowIn; - this.allowIn = true; - var expr = void 0, token = this.lookahead; - if (this.eat(_tokenizer.TokenType.SUPER)) { - this.isBindingElement = false; - this.isAssignmentTarget = false; - expr = this.finishNode(new AST.Super(), startState); - if (this.match(_tokenizer.TokenType.LPAREN)) { - if (allowCall) { - expr = this.finishNode(new AST.CallExpression({ - callee: expr, - arguments: this.parseArgumentList().args - }), startState); - } else { - throw this.createUnexpected(token); - } - } else if (this.match(_tokenizer.TokenType.LBRACK)) { - expr = this.finishNode(new AST.ComputedMemberExpression({ - object: expr, - expression: this.parseComputedMember() - }), startState); - this.isAssignmentTarget = true; - } else if (this.match(_tokenizer.TokenType.PERIOD)) { - expr = this.finishNode(new AST.StaticMemberExpression({ - object: expr, - property: this.parseStaticMember() - }), startState); - this.isAssignmentTarget = true; - } else { - throw this.createUnexpected(token); - } - } else if (this.match(_tokenizer.TokenType.NEW)) { - this.isBindingElement = this.isAssignmentTarget = false; - expr = this.parseNewExpression(); - } else if (this.match(_tokenizer.TokenType.ASYNC)) { - expr = this.parsePrimaryExpression(); - if (expr.type === "IdentifierExpression" && allowCall && !this.hasLineTerminatorBeforeNext) { - if (this.matchIdentifier()) { - var afterAsyncStartState = this.startNode(); - var previousAwait = this.allowAwaitExpression; - this.allowAwaitExpression = true; - var param = this.parseBindingIdentifier(); - this.allowAwaitExpression = previousAwait; - this.ensureArrow(); - return this.finishNode({ - type: ARROW_EXPRESSION_PARAMS, - params: [param], - rest: null, - isAsync: true - }, afterAsyncStartState); - } - if (this.match(_tokenizer.TokenType.LPAREN)) { - var _afterAsyncStartState = this.startNode(); - var previousAwaitLocation = this.firstAwaitLocation; - this.firstAwaitLocation = null; - var _parseArgumentList = this.parseArgumentList(), args = _parseArgumentList.args, locationFollowingFirstSpread = _parseArgumentList.locationFollowingFirstSpread; - if (this.isBindingElement && !this.hasLineTerminatorBeforeNext && this.match(_tokenizer.TokenType.ARROW)) { - if (locationFollowingFirstSpread !== null) { - throw this.createErrorWithLocation(locationFollowingFirstSpread, _errors$1.ErrorMessages.UNEXPECTED_TOKEN(",")); - } - if (this.firstAwaitLocation !== null) { - throw this.createErrorWithLocation(this.firstAwaitLocation, _errors$1.ErrorMessages.NO_AWAIT_IN_ASYNC_PARAMS); - } - var rest = null; - if (args.length > 0 && args[args.length - 1].type === "SpreadElement") { - rest = this.targetToBinding(this.transformDestructuringWithDefault(args[args.length - 1].expression)); - if (rest.init != null) { - throw this.createError(_errors$1.ErrorMessages.UNEXPECTED_REST_PARAMETERS_INITIALIZATION); - } - args = args.slice(0, -1); - } - var params = args.map(function(arg) { - return _this6.targetToBinding(_this6.transformDestructuringWithDefault(arg)); - }); - return this.finishNode({ - type: ARROW_EXPRESSION_PARAMS, - params, - rest, - isAsync: true - }, _afterAsyncStartState); - } - this.firstAwaitLocation = previousAwaitLocation || this.firstAwaitLocation; - this.isBindingElement = this.isAssignmentTarget = false; - expr = this.finishNode(new AST.CallExpression({ - callee: expr, - arguments: args - }), startState); - } - } - } else { - expr = this.parsePrimaryExpression(); - if (this.firstExprError) { - return expr; - } - } - while (true) { - if (allowCall && this.match(_tokenizer.TokenType.LPAREN)) { - this.isBindingElement = this.isAssignmentTarget = false; - expr = this.finishNode(new AST.CallExpression({ - callee: expr, - arguments: this.parseArgumentList().args - }), startState); - } else if (this.match(_tokenizer.TokenType.LBRACK)) { - this.isBindingElement = false; - this.isAssignmentTarget = true; - expr = this.finishNode(new AST.ComputedMemberExpression({ - object: expr, - expression: this.parseComputedMember() - }), startState); - } else if (this.match(_tokenizer.TokenType.PERIOD)) { - this.isBindingElement = false; - this.isAssignmentTarget = true; - expr = this.finishNode(new AST.StaticMemberExpression({ - object: expr, - property: this.parseStaticMember() - }), startState); - } else if (this.match(_tokenizer.TokenType.TEMPLATE)) { - this.isBindingElement = this.isAssignmentTarget = false; - expr = this.finishNode(new AST.TemplateExpression({ - tag: expr, - elements: this.parseTemplateElements() - }), startState); - } else { - break; - } - } - this.allowIn = previousAllowIn; - return expr; - } - }, { - key: "parseTemplateElements", - value: function parseTemplateElements() { - var startState = this.startNode(); - var token = this.lookahead; - if (token.tail) { - this.lex(); - return [this.finishNode(new AST.TemplateElement({ rawValue: token.slice.text.slice(1, -1) }), startState)]; - } - var result = [this.finishNode(new AST.TemplateElement({ rawValue: this.lex().slice.text.slice(1, -2) }), startState)]; - while (true) { - result.push(this.parseExpression()); - if (!this.match(_tokenizer.TokenType.RBRACE)) { - throw this.createILLEGAL(); - } - this.index = this.startIndex; - this.line = this.startLine; - this.lineStart = this.startLineStart; - this.lookahead = this.scanTemplateElement(); - startState = this.startNode(); - token = this.lex(); - if (token.tail) { - result.push(this.finishNode(new AST.TemplateElement({ rawValue: token.slice.text.slice(1, -1) }), startState)); - return result; - } - result.push(this.finishNode(new AST.TemplateElement({ rawValue: token.slice.text.slice(1, -2) }), startState)); - } - } - }, { - key: "parseStaticMember", - value: function parseStaticMember() { - this.lex(); - if (this.lookahead.type.klass.isIdentifierName) { - return this.lex().value; - } - throw this.createUnexpected(this.lookahead); - } - }, { - key: "parseComputedMember", - value: function parseComputedMember() { - this.lex(); - var expr = this.parseExpression(); - this.expect(_tokenizer.TokenType.RBRACK); - return expr; - } - }, { - key: "parseNewExpression", - value: function parseNewExpression() { - var _this7 = this; - var startState = this.startNode(); - this.lex(); - if (this.eat(_tokenizer.TokenType.PERIOD)) { - this.expectContextualKeyword("target"); - return this.finishNode(new AST.NewTargetExpression(), startState); - } - var callee = this.isolateCoverGrammar(function() { - return _this7.parseLeftHandSideExpression({ allowCall: false }); - }); - return this.finishNode(new AST.NewExpression({ - callee, - arguments: this.match(_tokenizer.TokenType.LPAREN) ? this.parseArgumentList().args : [] - }), startState); - } - }, { - key: "parseRegexFlags", - value: function parseRegexFlags(flags) { - var global = false, ignoreCase = false, multiLine = false, unicode2 = false, sticky = false, dotAll = false; - for (var i2 = 0; i2 < flags.length; ++i2) { - var f = flags[i2]; - switch (f) { - case "g": - if (global) { - throw this.createError("Duplicate regular expression flag 'g'"); - } - global = true; - break; - case "i": - if (ignoreCase) { - throw this.createError("Duplicate regular expression flag 'i'"); - } - ignoreCase = true; - break; - case "m": - if (multiLine) { - throw this.createError("Duplicate regular expression flag 'm'"); - } - multiLine = true; - break; - case "u": - if (unicode2) { - throw this.createError("Duplicate regular expression flag 'u'"); - } - unicode2 = true; - break; - case "y": - if (sticky) { - throw this.createError("Duplicate regular expression flag 'y'"); - } - sticky = true; - break; - case "s": - if (dotAll) { - throw this.createError("Duplicate regular expression flag 's'"); - } - dotAll = true; - break; - default: - throw this.createError("Invalid regular expression flag '" + f + "'"); - } - } - return { global, ignoreCase, multiLine, unicode: unicode2, sticky, dotAll }; - } - }, { - key: "parsePrimaryExpression", - value: function parsePrimaryExpression() { - if (this.match(_tokenizer.TokenType.LPAREN)) { - return this.parseGroupExpression(); - } - var startState = this.startNode(); - if (this.eat(_tokenizer.TokenType.ASYNC)) { - if (!this.hasLineTerminatorBeforeNext && this.match(_tokenizer.TokenType.FUNCTION)) { - this.isBindingElement = this.isAssignmentTarget = false; - return this.finishNode(this.parseFunction({ isExpr: true, inDefault: false, allowGenerator: true, isAsync: true }), startState); - } - return this.finishNode(new AST.IdentifierExpression({ name: "async" }), startState); - } - if (this.matchIdentifier()) { - return this.finishNode(new AST.IdentifierExpression({ name: this.parseIdentifier() }), startState); - } - switch (this.lookahead.type) { - case _tokenizer.TokenType.STRING: - this.isBindingElement = this.isAssignmentTarget = false; - return this.parseStringLiteral(); - case _tokenizer.TokenType.NUMBER: - this.isBindingElement = this.isAssignmentTarget = false; - return this.parseNumericLiteral(); - case _tokenizer.TokenType.THIS: - this.lex(); - this.isBindingElement = this.isAssignmentTarget = false; - return this.finishNode(new AST.ThisExpression(), startState); - case _tokenizer.TokenType.FUNCTION: - this.isBindingElement = this.isAssignmentTarget = false; - return this.finishNode(this.parseFunction({ isExpr: true, inDefault: false, allowGenerator: true, isAsync: false }), startState); - case _tokenizer.TokenType.TRUE: - this.lex(); - this.isBindingElement = this.isAssignmentTarget = false; - return this.finishNode(new AST.LiteralBooleanExpression({ value: true }), startState); - case _tokenizer.TokenType.FALSE: - this.lex(); - this.isBindingElement = this.isAssignmentTarget = false; - return this.finishNode(new AST.LiteralBooleanExpression({ value: false }), startState); - case _tokenizer.TokenType.NULL: - this.lex(); - this.isBindingElement = this.isAssignmentTarget = false; - return this.finishNode(new AST.LiteralNullExpression(), startState); - case _tokenizer.TokenType.LBRACK: - return this.parseArrayExpression(); - case _tokenizer.TokenType.LBRACE: - return this.parseObjectExpression(); - case _tokenizer.TokenType.TEMPLATE: - this.isBindingElement = this.isAssignmentTarget = false; - return this.finishNode(new AST.TemplateExpression({ tag: null, elements: this.parseTemplateElements() }), startState); - case _tokenizer.TokenType.DIV: - case _tokenizer.TokenType.ASSIGN_DIV: { - this.isBindingElement = this.isAssignmentTarget = false; - this.lookahead = this.scanRegExp(this.match(_tokenizer.TokenType.DIV) ? "/" : "/="); - var token = this.lex(); - var lastSlash = token.value.lastIndexOf("/"); - var pattern = token.value.slice(1, lastSlash); - var flags = token.value.slice(lastSlash + 1); - var ctorArgs = this.parseRegexFlags(flags); - if (!(0, _shiftRegexpAcceptor2.default)(pattern, ctorArgs)) { - throw this.createError(_errors$1.ErrorMessages.INVALID_REGEX); - } - ctorArgs.pattern = pattern; - return this.finishNode(new AST.LiteralRegExpExpression(ctorArgs), startState); - } - case _tokenizer.TokenType.CLASS: - this.isBindingElement = this.isAssignmentTarget = false; - return this.parseClass({ isExpr: true, inDefault: false }); - default: - throw this.createUnexpected(this.lookahead); - } - } - }, { - key: "parseNumericLiteral", - value: function parseNumericLiteral() { - var startLocation = this.getLocation(); - var startState = this.startNode(); - var token = this.lex(); - if (token.octal && this.strict) { - if (token.noctal) { - throw this.createErrorWithLocation(startLocation, "Unexpected noctal integer literal"); - } else { - throw this.createErrorWithLocation(startLocation, "Unexpected legacy octal integer literal"); - } - } - var node = token.value === 1 / 0 ? new AST.LiteralInfinityExpression() : new AST.LiteralNumericExpression({ value: token.value }); - return this.finishNode(node, startState); - } - }, { - key: "parseStringLiteral", - value: function parseStringLiteral() { - var startLocation = this.getLocation(); - var startState = this.startNode(); - var token = this.lex(); - if (token.octal != null && this.strict) { - throw this.createErrorWithLocation(startLocation, "Unexpected legacy octal escape sequence: \\" + token.octal); - } - return this.finishNode(new AST.LiteralStringExpression({ value: token.str }), startState); - } - }, { - key: "parseIdentifierName", - value: function parseIdentifierName() { - if (this.lookahead.type.klass.isIdentifierName) { - return this.lex().value; - } - throw this.createUnexpected(this.lookahead); - } - }, { - key: "parseBindingIdentifier", - value: function parseBindingIdentifier() { - var startState = this.startNode(); - return this.finishNode(new AST.BindingIdentifier({ name: this.parseIdentifier() }), startState); - } - }, { - key: "parseIdentifier", - value: function parseIdentifier() { - if (this.lookahead.value === "yield" && this.allowYieldExpression) { - throw this.createError(_errors$1.ErrorMessages.ILLEGAL_YIELD_IDENTIFIER); - } - if (this.lookahead.value === "await" && this.allowAwaitExpression) { - throw this.createError(_errors$1.ErrorMessages.ILLEGAL_AWAIT_IDENTIFIER); - } - if (this.matchIdentifier()) { - return this.lex().value; - } - throw this.createUnexpected(this.lookahead); - } - }, { - key: "parseArgumentList", - value: function parseArgumentList() { - this.lex(); - var args = this.parseArguments(); - this.expect(_tokenizer.TokenType.RPAREN); - return args; - } - }, { - key: "parseArguments", - value: function parseArguments() { - var args = []; - var locationFollowingFirstSpread = null; - while (!this.match(_tokenizer.TokenType.RPAREN)) { - var arg = void 0; - var startState = this.startNode(); - if (this.eat(_tokenizer.TokenType.ELLIPSIS)) { - arg = this.finishNode(new AST.SpreadElement({ expression: this.inheritCoverGrammar(this.parseAssignmentExpressionOrTarget) }), startState); - if (locationFollowingFirstSpread === null) { - args.push(arg); - if (this.match(_tokenizer.TokenType.RPAREN)) { - break; - } - locationFollowingFirstSpread = this.getLocation(); - this.expect(_tokenizer.TokenType.COMMA); - continue; - } - } else { - arg = this.inheritCoverGrammar(this.parseAssignmentExpressionOrTarget); - } - args.push(arg); - if (this.match(_tokenizer.TokenType.RPAREN)) { - break; - } - this.expect(_tokenizer.TokenType.COMMA); - } - return { args, locationFollowingFirstSpread }; - } - }, { - key: "ensureArrow", - value: function ensureArrow() { - if (this.hasLineTerminatorBeforeNext) { - throw this.createError(_errors$1.ErrorMessages.UNEXPECTED_LINE_TERMINATOR); - } - if (!this.match(_tokenizer.TokenType.ARROW)) { - this.expect(_tokenizer.TokenType.ARROW); - } - } - }, { - key: "parseGroupExpression", - value: function parseGroupExpression() { - var rest = null; - var preParenStartState = this.startNode(); - var start = this.expect(_tokenizer.TokenType.LPAREN); - var postParenStartState = this.startNode(); - if (this.match(_tokenizer.TokenType.RPAREN)) { - this.lex(); - var paramsNode = this.finishNode({ - type: ARROW_EXPRESSION_PARAMS, - params: [], - rest: null, - isAsync: false - }, preParenStartState); - this.ensureArrow(); - this.isBindingElement = this.isAssignmentTarget = false; - return paramsNode; - } else if (this.eat(_tokenizer.TokenType.ELLIPSIS)) { - rest = this.parseBindingTarget(); - if (this.match(_tokenizer.TokenType.ASSIGN)) { - throw this.createError(_errors$1.ErrorMessages.INVALID_REST_PARAMETERS_INITIALIZATION); - } - if (this.match(_tokenizer.TokenType.COMMA)) { - throw this.createError(_errors$1.ErrorMessages.INVALID_LAST_REST_PARAMETER); - } - this.expect(_tokenizer.TokenType.RPAREN); - var _paramsNode = this.finishNode({ - type: ARROW_EXPRESSION_PARAMS, - params: [], - rest, - isAsync: false - }, preParenStartState); - this.ensureArrow(); - this.isBindingElement = this.isAssignmentTarget = false; - return _paramsNode; - } - var group = this.inheritCoverGrammar(this.parseAssignmentExpressionOrTarget); - var params = this.isBindingElement ? [this.targetToBinding(this.transformDestructuringWithDefault(group))] : null; - while (this.eat(_tokenizer.TokenType.COMMA)) { - if (this.match(_tokenizer.TokenType.RPAREN)) { - if (!this.isBindingElement) { - throw this.createUnexpected(this.lookahead); - } - this.firstExprError = this.firstExprError || this.createUnexpected(this.lookahead); - group = null; - break; - } - this.isAssignmentTarget = false; - if (this.match(_tokenizer.TokenType.ELLIPSIS)) { - if (!this.isBindingElement) { - throw this.createUnexpected(this.lookahead); - } - this.lex(); - rest = this.parseBindingTarget(); - if (this.match(_tokenizer.TokenType.ASSIGN)) { - throw this.createError(_errors$1.ErrorMessages.INVALID_REST_PARAMETERS_INITIALIZATION); - } - if (this.match(_tokenizer.TokenType.COMMA)) { - throw this.createError(_errors$1.ErrorMessages.INVALID_LAST_REST_PARAMETER); - } - break; - } - if (group) { - var expr = this.inheritCoverGrammar(this.parseAssignmentExpressionOrTarget); - if (this.isBindingElement) { - params.push(this.targetToBinding(this.transformDestructuringWithDefault(expr))); - } else { - params = null; - } - if (this.firstExprError) { - group = null; - } else { - group = this.finishNode(new AST.BinaryExpression({ - left: group, - operator: ",", - right: expr - }), postParenStartState); - } - } else { - var binding = this.parseBindingElement(); - params.push(binding); - } - } - this.expect(_tokenizer.TokenType.RPAREN); - if (!this.hasLineTerminatorBeforeNext && this.match(_tokenizer.TokenType.ARROW)) { - if (!this.isBindingElement) { - throw this.createErrorWithLocation(start, _errors$1.ErrorMessages.ILLEGAL_ARROW_FUNCTION_PARAMS); - } - this.isBindingElement = false; - return this.finishNode({ - type: ARROW_EXPRESSION_PARAMS, - params, - rest, - isAsync: false - }, preParenStartState); - } - if (rest) { - this.ensureArrow(); - } - this.isBindingElement = false; - if (!isValidSimpleAssignmentTarget(group)) { - this.isAssignmentTarget = false; - } - return group; - } - }, { - key: "parseArrayExpression", - value: function parseArrayExpression() { - var _this8 = this; - var startLocation = this.getLocation(); - var startState = this.startNode(); - this.lex(); - var exprs = []; - var rest = null; - while (true) { - if (this.match(_tokenizer.TokenType.RBRACK)) { - break; - } - if (this.eat(_tokenizer.TokenType.COMMA)) { - exprs.push(null); - } else { - var elementStartState = this.startNode(); - var expr = void 0; - if (this.eat(_tokenizer.TokenType.ELLIPSIS)) { - expr = this.inheritCoverGrammar(this.parseAssignmentExpressionOrTarget); - if (!this.isAssignmentTarget && this.firstExprError) { - throw this.firstExprError; - } - if (expr.type === "ArrayAssignmentTarget" || expr.type === "ObjectAssignmentTarget") { - rest = expr; - break; - } - if (expr.type !== "ArrayExpression" && expr.type !== "ObjectExpression" && !isValidSimpleAssignmentTarget(expr)) { - this.isBindingElement = this.isAssignmentTarget = false; - } - expr = this.finishNode(new AST.SpreadElement({ expression: expr }), elementStartState); - if (!this.match(_tokenizer.TokenType.RBRACK)) { - this.isBindingElement = this.isAssignmentTarget = false; - } - } else { - expr = this.inheritCoverGrammar(this.parseAssignmentExpressionOrTarget); - if (!this.isAssignmentTarget && this.firstExprError) { - throw this.firstExprError; - } - } - exprs.push(expr); - if (!this.match(_tokenizer.TokenType.RBRACK)) { - this.expect(_tokenizer.TokenType.COMMA); - } - } - } - if (rest && this.match(_tokenizer.TokenType.COMMA)) { - throw this.createErrorWithLocation(startLocation, _errors$1.ErrorMessages.UNEXPECTED_COMMA_AFTER_REST); - } - this.expect(_tokenizer.TokenType.RBRACK); - if (rest) { - return this.finishNode(new AST.ArrayAssignmentTarget({ - elements: exprs.map(function(e) { - return e && _this8.transformDestructuringWithDefault(e); - }), - rest - }), startState); - } else if (this.firstExprError) { - var last = exprs[exprs.length - 1]; - if (last != null && last.type === "SpreadElement") { - return this.finishNode(new AST.ArrayAssignmentTarget({ - elements: exprs.slice(0, -1).map(function(e) { - return e && _this8.transformDestructuringWithDefault(e); - }), - rest: this.transformDestructuring(last.expression) - }), startState); - } - return this.finishNode(new AST.ArrayAssignmentTarget({ - elements: exprs.map(function(e) { - return e && _this8.transformDestructuringWithDefault(e); - }), - rest: null - }), startState); - } - return this.finishNode(new AST.ArrayExpression({ elements: exprs }), startState); - } - }, { - key: "parseObjectExpression", - value: function parseObjectExpression() { - var _this9 = this; - var startState = this.startNode(); - this.lex(); - var properties = []; - while (!this.match(_tokenizer.TokenType.RBRACE)) { - var isSpreadProperty = false; - if (this.match(_tokenizer.TokenType.ELLIPSIS)) { - isSpreadProperty = true; - var spreadPropertyOrAssignmentTarget = this.parseSpreadPropertyDefinition(); - properties.push(spreadPropertyOrAssignmentTarget); - } else { - var property = this.inheritCoverGrammar(this.parsePropertyDefinition); - properties.push(property); - } - if (!this.match(_tokenizer.TokenType.RBRACE)) { - this.expect(_tokenizer.TokenType.COMMA); - if (isSpreadProperty) { - this.isBindingElement = this.isAssignmentTarget = false; - } - } - } - this.expect(_tokenizer.TokenType.RBRACE); - if (this.firstExprError) { - if (!this.isAssignmentTarget) { - throw this.createError(_errors$1.ErrorMessages.INVALID_LHS_IN_BINDING); - } - var last = properties[properties.length - 1]; - if (last != null && last.type === "SpreadProperty") { - return this.finishNode(new AST.ObjectAssignmentTarget({ - properties: properties.slice(0, -1).map(function(p2) { - return _this9.transformDestructuringWithDefault(p2); - }), - rest: this.transformDestructuring(last.expression) - }), startState); - } - return this.finishNode(new AST.ObjectAssignmentTarget({ properties: properties.map(function(p2) { - return _this9.transformDestructuringWithDefault(p2); - }), rest: null }), startState); - } - return this.finishNode(new AST.ObjectExpression({ properties }), startState); - } - }, { - key: "parseSpreadPropertyDefinition", - value: function parseSpreadPropertyDefinition() { - var startState = this.startNode(); - this.expect(_tokenizer.TokenType.ELLIPSIS); - var expression = this.parseAssignmentExpression(); - if (!isValidSimpleAssignmentTarget(expression)) { - this.isBindingElement = this.isAssignmentTarget = false; - } else if (expression.type !== "IdentifierExpression") { - this.isBindingElement = false; - } - return this.finishNode(new AST.SpreadProperty({ expression }), startState); - } - }, { - key: "parsePropertyDefinition", - value: function parsePropertyDefinition() { - var startLocation = this.getLocation(); - var startState = this.startNode(); - var token = this.lookahead; - var _parseMethodDefinitio = this.parseMethodDefinition(), methodOrKey = _parseMethodDefinitio.methodOrKey, kind = _parseMethodDefinitio.kind; - switch (kind) { - case "method": - this.isBindingElement = this.isAssignmentTarget = false; - return methodOrKey; - case "identifier": - if (token.value === "await" && this.firstAwaitLocation == null) { - this.firstAwaitLocation = this.getLocation(); - } - if (this.eat(_tokenizer.TokenType.ASSIGN)) { - if (this.allowYieldExpression && token.value === "yield") { - throw this.createError(_errors$1.ErrorMessages.ILLEGAL_YIELD_IDENTIFIER); - } - if (this.allowAwaitExpression && token.value === "await") { - throw this.createError(_errors$1.ErrorMessages.ILLEGAL_AWAIT_IDENTIFIER); - } - var init = this.isolateCoverGrammar(this.parseAssignmentExpression); - this.firstExprError = this.createErrorWithLocation(startLocation, _errors$1.ErrorMessages.ILLEGAL_PROPERTY); - return this.finishNode(new AST.AssignmentTargetPropertyIdentifier({ - binding: this.transformDestructuring(methodOrKey), - init - }), startState); - } else if (!this.match(_tokenizer.TokenType.COLON)) { - if (this.allowYieldExpression && token.value === "yield") { - throw this.createError(_errors$1.ErrorMessages.ILLEGAL_YIELD_IDENTIFIER); - } - if (this.allowAwaitExpression && token.value === "await") { - throw this.createError(_errors$1.ErrorMessages.ILLEGAL_AWAIT_IDENTIFIER); - } - if (token.type === _tokenizer.TokenType.IDENTIFIER || token.value === "let" || token.value === "yield" || token.value === "async" || token.value === "await") { - return this.finishNode(new AST.ShorthandProperty({ name: this.finishNode(new AST.IdentifierExpression({ name: methodOrKey.value }), startState) }), startState); - } - throw this.createUnexpected(token); - } - } - this.expect(_tokenizer.TokenType.COLON); - var expr = this.inheritCoverGrammar(this.parseAssignmentExpressionOrTarget); - if (this.firstExprError) { - return this.finishNode(new AST.AssignmentTargetPropertyProperty({ name: methodOrKey, binding: expr }), startState); - } - return this.finishNode(new AST.DataProperty({ name: methodOrKey, expression: expr }), startState); - } - }, { - key: "parsePropertyName", - value: function parsePropertyName() { - var token = this.lookahead; - var startState = this.startNode(); - if (this.eof()) { - throw this.createUnexpected(token); - } - switch (token.type) { - case _tokenizer.TokenType.STRING: - return { - name: this.finishNode(new AST.StaticPropertyName({ - value: this.parseStringLiteral().value - }), startState), - binding: null - }; - case _tokenizer.TokenType.NUMBER: { - var numLiteral = this.parseNumericLiteral(); - return { - name: this.finishNode(new AST.StaticPropertyName({ - value: "" + (numLiteral.type === "LiteralInfinityExpression" ? 1 / 0 : numLiteral.value) - }), startState), - binding: null - }; - } - case _tokenizer.TokenType.LBRACK: { - this.lex(); - var expr = this.parseAssignmentExpression(); - this.expect(_tokenizer.TokenType.RBRACK); - return { name: this.finishNode(new AST.ComputedPropertyName({ expression: expr }), startState), binding: null }; - } - } - var name = this.parseIdentifierName(); - return { - name: this.finishNode(new AST.StaticPropertyName({ value: name }), startState), - binding: this.finishNode(new AST.BindingIdentifier({ name }), startState) - }; - } - }, { - key: "lookaheadPropertyName", - value: function lookaheadPropertyName() { - switch (this.lookahead.type) { - case _tokenizer.TokenType.NUMBER: - case _tokenizer.TokenType.STRING: - case _tokenizer.TokenType.LBRACK: - return true; - default: - return this.lookahead.type.klass.isIdentifierName; - } - } - }, { - key: "parseMethodDefinition", - value: function parseMethodDefinition() { - var token = this.lookahead; - var startState = this.startNode(); - var preAsyncTokenState = this.saveLexerState(); - var isAsync = !!this.eat(_tokenizer.TokenType.ASYNC); - if (isAsync && this.hasLineTerminatorBeforeNext) { - isAsync = false; - this.restoreLexerState(preAsyncTokenState); - } - var isGenerator = !!this.eat(_tokenizer.TokenType.MUL); - if (isAsync && !this.lookaheadPropertyName()) { - isAsync = false; - isGenerator = false; - this.restoreLexerState(preAsyncTokenState); - } - var _parsePropertyName = this.parsePropertyName(), name = _parsePropertyName.name; - if (!isGenerator && !isAsync) { - if (token.type === _tokenizer.TokenType.IDENTIFIER && token.value.length === 3) { - if (token.value === "get" && this.lookaheadPropertyName() && !token.escaped) { - var _parsePropertyName2 = this.parsePropertyName(); - name = _parsePropertyName2.name; - this.expect(_tokenizer.TokenType.LPAREN); - this.expect(_tokenizer.TokenType.RPAREN); - var previousYield = this.allowYieldExpression; - var previousAwait = this.allowAwaitExpression; - var previousAwaitLocation = this.firstAwaitLocation; - this.allowYieldExpression = false; - this.allowAwaitExpression = false; - this.firstAwaitLocation = null; - var body = this.parseFunctionBody(); - this.allowYieldExpression = previousYield; - this.allowAwaitExpression = previousAwait; - this.firstAwaitLocation = previousAwaitLocation; - return { - methodOrKey: this.finishNode(new AST.Getter({ name, body }), startState), - kind: "method" - }; - } else if (token.value === "set" && this.lookaheadPropertyName() && !token.escaped) { - var _parsePropertyName3 = this.parsePropertyName(); - name = _parsePropertyName3.name; - this.expect(_tokenizer.TokenType.LPAREN); - var _previousYield = this.allowYieldExpression; - var _previousAwait = this.allowAwaitExpression; - var _previousAwaitLocation = this.firstAwaitLocation; - this.allowYieldExpression = false; - this.allowAwaitExpression = false; - this.firstAwaitLocation = null; - var param = this.parseBindingElement(); - this.expect(_tokenizer.TokenType.RPAREN); - var _body = this.parseFunctionBody(); - this.allowYieldExpression = _previousYield; - this.allowAwaitExpression = _previousAwait; - this.firstAwaitLocation = _previousAwaitLocation; - return { - methodOrKey: this.finishNode(new AST.Setter({ name, param, body: _body }), startState), - kind: "method" - }; - } - } - } - if (isAsync) { - var _previousYield2 = this.allowYieldExpression; - var _previousAwait2 = this.allowAwaitExpression; - this.allowYieldExpression = isGenerator; - this.allowAwaitExpression = true; - var params = this.parseParams(); - this.allowYieldExpression = isGenerator; - this.allowAwaitExpression = true; - var _body2 = this.parseFunctionBody(); - this.allowYieldExpression = _previousYield2; - this.allowAwaitExpression = _previousAwait2; - return { - methodOrKey: this.finishNode(new AST.Method({ isAsync, isGenerator, name, params, body: _body2 }), startState), - kind: "method" - }; - } - if (this.match(_tokenizer.TokenType.LPAREN)) { - var _previousYield3 = this.allowYieldExpression; - var _previousAwait3 = this.allowAwaitExpression; - var _previousAwaitLocation2 = this.firstAwaitLocation; - this.allowYieldExpression = isGenerator; - this.allowAwaitExpression = false; - this.firstAwaitLocation = null; - var _params = this.parseParams(); - var _body3 = this.parseFunctionBody(); - this.allowYieldExpression = _previousYield3; - this.allowAwaitExpression = _previousAwait3; - this.firstAwaitLocation = _previousAwaitLocation2; - return { - methodOrKey: this.finishNode(new AST.Method({ isAsync, isGenerator, name, params: _params, body: _body3 }), startState), - kind: "method" - }; - } - if (isGenerator && this.match(_tokenizer.TokenType.COLON)) { - throw this.createUnexpected(this.lookahead); - } - return { - methodOrKey: name, - kind: token.type.klass.isIdentifierName ? "identifier" : "property", - escaped: token.escaped - }; - } - }, { - key: "parseClass", - value: function parseClass(_ref3) { - var _this10 = this; - var isExpr = _ref3.isExpr, inDefault = _ref3.inDefault; - var startState = this.startNode(); - this.lex(); - var name = null; - var heritage = null; - if (this.matchIdentifier()) { - name = this.parseBindingIdentifier(); - } else if (!isExpr) { - if (inDefault) { - name = new AST.BindingIdentifier({ name: "*default*" }); - } else { - throw this.createUnexpected(this.lookahead); - } - } - if (this.eat(_tokenizer.TokenType.EXTENDS)) { - heritage = this.isolateCoverGrammar(function() { - return _this10.parseLeftHandSideExpression({ allowCall: true }); - }); - } - this.expect(_tokenizer.TokenType.LBRACE); - var elements = []; - while (!this.eat(_tokenizer.TokenType.RBRACE)) { - if (this.eat(_tokenizer.TokenType.SEMICOLON)) { - continue; - } - var isStatic = false; - var classElementStart = this.startNode(); - var _parseMethodDefinitio2 = this.parseMethodDefinition(), methodOrKey = _parseMethodDefinitio2.methodOrKey, kind = _parseMethodDefinitio2.kind, escaped = _parseMethodDefinitio2.escaped; - if (kind === "identifier" && methodOrKey.value === "static" && !escaped) { - isStatic = true; - var _parseMethodDefinitio3 = this.parseMethodDefinition(); - methodOrKey = _parseMethodDefinitio3.methodOrKey; - kind = _parseMethodDefinitio3.kind; - } - if (kind === "method") { - elements.push(this.finishNode(new AST.ClassElement({ isStatic, method: methodOrKey }), classElementStart)); - } else { - throw this.createError("Only methods are allowed in classes"); - } - } - return this.finishNode(new (isExpr ? AST.ClassExpression : AST.ClassDeclaration)({ name, super: heritage, elements }), startState); - } - }, { - key: "parseFunction", - value: function parseFunction(_ref4) { - var isExpr = _ref4.isExpr, inDefault = _ref4.inDefault, allowGenerator = _ref4.allowGenerator, isAsync = _ref4.isAsync, _ref4$startState = _ref4.startState, startState = _ref4$startState === void 0 ? this.startNode() : _ref4$startState; - this.lex(); - var name = null; - var isGenerator = allowGenerator && !!this.eat(_tokenizer.TokenType.MUL); - var previousYield = this.allowYieldExpression; - var previousAwait = this.allowAwaitExpression; - var previousAwaitLocation = this.firstAwaitLocation; - if (isExpr) { - this.allowYieldExpression = isGenerator; - this.allowAwaitExpression = isAsync; - } - if (!this.match(_tokenizer.TokenType.LPAREN)) { - name = this.parseBindingIdentifier(); - } else if (!isExpr) { - if (inDefault) { - name = new AST.BindingIdentifier({ name: "*default*" }); - } else { - throw this.createUnexpected(this.lookahead); - } - } - this.allowYieldExpression = isGenerator; - this.allowAwaitExpression = isAsync; - this.firstAwaitLocation = null; - var params = this.parseParams(); - var body = this.parseFunctionBody(); - this.allowYieldExpression = previousYield; - this.allowAwaitExpression = previousAwait; - this.firstAwaitLocation = previousAwaitLocation; - return this.finishNode(new (isExpr ? AST.FunctionExpression : AST.FunctionDeclaration)({ isAsync, isGenerator, name, params, body }), startState); - } - }, { - key: "parseArrayBinding", - value: function parseArrayBinding() { - var startState = this.startNode(); - this.expect(_tokenizer.TokenType.LBRACK); - var elements = [], rest = null; - while (true) { - if (this.match(_tokenizer.TokenType.RBRACK)) { - break; - } - var el = void 0; - if (this.eat(_tokenizer.TokenType.COMMA)) { - el = null; - } else { - if (this.eat(_tokenizer.TokenType.ELLIPSIS)) { - rest = this.parseBindingTarget(); - break; - } else { - el = this.parseBindingElement(); - } - if (!this.match(_tokenizer.TokenType.RBRACK)) { - this.expect(_tokenizer.TokenType.COMMA); - } - } - elements.push(el); - } - this.expect(_tokenizer.TokenType.RBRACK); - return this.finishNode(new AST.ArrayBinding({ elements, rest }), startState); - } - }, { - key: "parseBindingProperty", - value: function parseBindingProperty() { - var startState = this.startNode(); - var isIdentifier = this.matchIdentifier(); - var token = this.lookahead; - var _parsePropertyName4 = this.parsePropertyName(), name = _parsePropertyName4.name, binding = _parsePropertyName4.binding; - if (isIdentifier && name.type === "StaticPropertyName") { - if (!this.match(_tokenizer.TokenType.COLON)) { - if (this.allowYieldExpression && token.value === "yield") { - throw this.createError(_errors$1.ErrorMessages.ILLEGAL_YIELD_IDENTIFIER); - } - if (this.allowAwaitExpression && token.value === "await") { - throw this.createError(_errors$1.ErrorMessages.ILLEGAL_AWAIT_IDENTIFIER); - } - var defaultValue = null; - if (this.eat(_tokenizer.TokenType.ASSIGN)) { - defaultValue = this.parseAssignmentExpression(); - } - return this.finishNode(new AST.BindingPropertyIdentifier({ - binding, - init: defaultValue - }), startState); - } - } - this.expect(_tokenizer.TokenType.COLON); - binding = this.parseBindingElement(); - return this.finishNode(new AST.BindingPropertyProperty({ name, binding }), startState); - } - }, { - key: "parseObjectBinding", - value: function parseObjectBinding() { - var startState = this.startNode(); - this.expect(_tokenizer.TokenType.LBRACE); - var properties = []; - var rest = null; - while (!this.match(_tokenizer.TokenType.RBRACE)) { - if (this.eat(_tokenizer.TokenType.ELLIPSIS)) { - rest = this.parseBindingIdentifier(); - break; - } - properties.push(this.parseBindingProperty()); - if (!this.match(_tokenizer.TokenType.RBRACE)) { - this.expect(_tokenizer.TokenType.COMMA); - } - } - this.expect(_tokenizer.TokenType.RBRACE); - return this.finishNode(new AST.ObjectBinding({ properties, rest }), startState); - } - }, { - key: "parseBindingTarget", - value: function parseBindingTarget() { - if (this.matchIdentifier()) { - return this.parseBindingIdentifier(); - } - switch (this.lookahead.type) { - case _tokenizer.TokenType.LBRACK: - return this.parseArrayBinding(); - case _tokenizer.TokenType.LBRACE: - return this.parseObjectBinding(); - } - throw this.createUnexpected(this.lookahead); - } - }, { - key: "parseBindingElement", - value: function parseBindingElement() { - var startState = this.startNode(); - var binding = this.parseBindingTarget(); - if (this.eat(_tokenizer.TokenType.ASSIGN)) { - var init = this.parseAssignmentExpression(); - binding = this.finishNode(new AST.BindingWithDefault({ binding, init }), startState); - } - return binding; - } - }, { - key: "parseParam", - value: function parseParam() { - var previousInParameter = this.inParameter; - this.inParameter = true; - var param = this.parseBindingElement(); - this.inParameter = previousInParameter; - return param; - } - }, { - key: "parseParams", - value: function parseParams() { - var startState = this.startNode(); - this.expect(_tokenizer.TokenType.LPAREN); - var items = [], rest = null; - while (!this.match(_tokenizer.TokenType.RPAREN)) { - if (this.eat(_tokenizer.TokenType.ELLIPSIS)) { - rest = this.parseBindingTarget(); - if (this.lookahead.type === _tokenizer.TokenType.ASSIGN) { - throw this.createError(_errors$1.ErrorMessages.UNEXPECTED_REST_PARAMETERS_INITIALIZATION); - } - if (this.match(_tokenizer.TokenType.COMMA)) { - throw this.createError(_errors$1.ErrorMessages.UNEXPECTED_COMMA_AFTER_REST); - } - break; - } - items.push(this.parseParam()); - if (this.match(_tokenizer.TokenType.RPAREN)) - break; - this.expect(_tokenizer.TokenType.COMMA); - } - this.expect(_tokenizer.TokenType.RPAREN); - return this.finishNode(new AST.FormalParameters({ items, rest }), startState); - } - }]); - return GenericParser; -}(_tokenizer2.default); -const parser = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - get GenericParser() { - return GenericParser_1; - }, - default: parser$1 -}, [parser$1]); -const require$$1$4 = /* @__PURE__ */ getAugmentedNamespace(parser); -var earlyErrors$1 = {}; -var dist$6 = {}; -var director$3 = {}; -Object.defineProperty(director$3, "__esModule", { - value: true -}); -var reduce_1 = director$3.reduce = reduce; -var director$1 = { - ArrayAssignmentTarget: function ArrayAssignmentTarget2(reducer, node) { - var _this = this; - return reducer.reduceArrayAssignmentTarget(node, { elements: node.elements.map(function(v) { - return v && _this[v.type](reducer, v); - }), rest: node.rest && this[node.rest.type](reducer, node.rest) }); - }, - ArrayBinding: function ArrayBinding2(reducer, node) { - var _this2 = this; - return reducer.reduceArrayBinding(node, { elements: node.elements.map(function(v) { - return v && _this2[v.type](reducer, v); - }), rest: node.rest && this[node.rest.type](reducer, node.rest) }); - }, - ArrayExpression: function ArrayExpression2(reducer, node) { - var _this3 = this; - return reducer.reduceArrayExpression(node, { elements: node.elements.map(function(v) { - return v && _this3[v.type](reducer, v); - }) }); - }, - ArrowExpression: function ArrowExpression2(reducer, node) { - return reducer.reduceArrowExpression(node, { params: this.FormalParameters(reducer, node.params), body: this[node.body.type](reducer, node.body) }); - }, - AssignmentExpression: function AssignmentExpression2(reducer, node) { - return reducer.reduceAssignmentExpression(node, { binding: this[node.binding.type](reducer, node.binding), expression: this[node.expression.type](reducer, node.expression) }); - }, - AssignmentTargetIdentifier: function AssignmentTargetIdentifier2(reducer, node) { - return reducer.reduceAssignmentTargetIdentifier(node); - }, - AssignmentTargetPropertyIdentifier: function AssignmentTargetPropertyIdentifier2(reducer, node) { - return reducer.reduceAssignmentTargetPropertyIdentifier(node, { binding: this.AssignmentTargetIdentifier(reducer, node.binding), init: node.init && this[node.init.type](reducer, node.init) }); - }, - AssignmentTargetPropertyProperty: function AssignmentTargetPropertyProperty2(reducer, node) { - return reducer.reduceAssignmentTargetPropertyProperty(node, { name: this[node.name.type](reducer, node.name), binding: this[node.binding.type](reducer, node.binding) }); - }, - AssignmentTargetWithDefault: function AssignmentTargetWithDefault2(reducer, node) { - return reducer.reduceAssignmentTargetWithDefault(node, { binding: this[node.binding.type](reducer, node.binding), init: this[node.init.type](reducer, node.init) }); - }, - AwaitExpression: function AwaitExpression2(reducer, node) { - return reducer.reduceAwaitExpression(node, { expression: this[node.expression.type](reducer, node.expression) }); - }, - BinaryExpression: function BinaryExpression2(reducer, node) { - return reducer.reduceBinaryExpression(node, { left: this[node.left.type](reducer, node.left), right: this[node.right.type](reducer, node.right) }); - }, - BindingIdentifier: function BindingIdentifier2(reducer, node) { - return reducer.reduceBindingIdentifier(node); - }, - BindingPropertyIdentifier: function BindingPropertyIdentifier2(reducer, node) { - return reducer.reduceBindingPropertyIdentifier(node, { binding: this.BindingIdentifier(reducer, node.binding), init: node.init && this[node.init.type](reducer, node.init) }); - }, - BindingPropertyProperty: function BindingPropertyProperty2(reducer, node) { - return reducer.reduceBindingPropertyProperty(node, { name: this[node.name.type](reducer, node.name), binding: this[node.binding.type](reducer, node.binding) }); - }, - BindingWithDefault: function BindingWithDefault2(reducer, node) { - return reducer.reduceBindingWithDefault(node, { binding: this[node.binding.type](reducer, node.binding), init: this[node.init.type](reducer, node.init) }); - }, - Block: function Block2(reducer, node) { - var _this4 = this; - return reducer.reduceBlock(node, { statements: node.statements.map(function(v) { - return _this4[v.type](reducer, v); - }) }); - }, - BlockStatement: function BlockStatement2(reducer, node) { - return reducer.reduceBlockStatement(node, { block: this.Block(reducer, node.block) }); - }, - BreakStatement: function BreakStatement2(reducer, node) { - return reducer.reduceBreakStatement(node); - }, - CallExpression: function CallExpression2(reducer, node) { - var _this5 = this; - return reducer.reduceCallExpression(node, { callee: this[node.callee.type](reducer, node.callee), arguments: node.arguments.map(function(v) { - return _this5[v.type](reducer, v); - }) }); - }, - CatchClause: function CatchClause2(reducer, node) { - return reducer.reduceCatchClause(node, { binding: this[node.binding.type](reducer, node.binding), body: this.Block(reducer, node.body) }); - }, - ClassDeclaration: function ClassDeclaration2(reducer, node) { - var _this6 = this; - return reducer.reduceClassDeclaration(node, { name: this.BindingIdentifier(reducer, node.name), super: node.super && this[node.super.type](reducer, node.super), elements: node.elements.map(function(v) { - return _this6.ClassElement(reducer, v); - }) }); - }, - ClassElement: function ClassElement2(reducer, node) { - return reducer.reduceClassElement(node, { method: this[node.method.type](reducer, node.method) }); - }, - ClassExpression: function ClassExpression2(reducer, node) { - var _this7 = this; - return reducer.reduceClassExpression(node, { name: node.name && this.BindingIdentifier(reducer, node.name), super: node.super && this[node.super.type](reducer, node.super), elements: node.elements.map(function(v) { - return _this7.ClassElement(reducer, v); - }) }); - }, - CompoundAssignmentExpression: function CompoundAssignmentExpression2(reducer, node) { - return reducer.reduceCompoundAssignmentExpression(node, { binding: this[node.binding.type](reducer, node.binding), expression: this[node.expression.type](reducer, node.expression) }); - }, - ComputedMemberAssignmentTarget: function ComputedMemberAssignmentTarget2(reducer, node) { - return reducer.reduceComputedMemberAssignmentTarget(node, { object: this[node.object.type](reducer, node.object), expression: this[node.expression.type](reducer, node.expression) }); - }, - ComputedMemberExpression: function ComputedMemberExpression2(reducer, node) { - return reducer.reduceComputedMemberExpression(node, { object: this[node.object.type](reducer, node.object), expression: this[node.expression.type](reducer, node.expression) }); - }, - ComputedPropertyName: function ComputedPropertyName2(reducer, node) { - return reducer.reduceComputedPropertyName(node, { expression: this[node.expression.type](reducer, node.expression) }); - }, - ConditionalExpression: function ConditionalExpression2(reducer, node) { - return reducer.reduceConditionalExpression(node, { test: this[node.test.type](reducer, node.test), consequent: this[node.consequent.type](reducer, node.consequent), alternate: this[node.alternate.type](reducer, node.alternate) }); - }, - ContinueStatement: function ContinueStatement2(reducer, node) { - return reducer.reduceContinueStatement(node); - }, - DataProperty: function DataProperty2(reducer, node) { - return reducer.reduceDataProperty(node, { name: this[node.name.type](reducer, node.name), expression: this[node.expression.type](reducer, node.expression) }); - }, - DebuggerStatement: function DebuggerStatement2(reducer, node) { - return reducer.reduceDebuggerStatement(node); - }, - Directive: function Directive2(reducer, node) { - return reducer.reduceDirective(node); - }, - DoWhileStatement: function DoWhileStatement2(reducer, node) { - return reducer.reduceDoWhileStatement(node, { body: this[node.body.type](reducer, node.body), test: this[node.test.type](reducer, node.test) }); - }, - EmptyStatement: function EmptyStatement2(reducer, node) { - return reducer.reduceEmptyStatement(node); - }, - Export: function Export2(reducer, node) { - return reducer.reduceExport(node, { declaration: this[node.declaration.type](reducer, node.declaration) }); - }, - ExportAllFrom: function ExportAllFrom2(reducer, node) { - return reducer.reduceExportAllFrom(node); - }, - ExportDefault: function ExportDefault2(reducer, node) { - return reducer.reduceExportDefault(node, { body: this[node.body.type](reducer, node.body) }); - }, - ExportFrom: function ExportFrom2(reducer, node) { - var _this8 = this; - return reducer.reduceExportFrom(node, { namedExports: node.namedExports.map(function(v) { - return _this8.ExportFromSpecifier(reducer, v); - }) }); - }, - ExportFromSpecifier: function ExportFromSpecifier2(reducer, node) { - return reducer.reduceExportFromSpecifier(node); - }, - ExportLocalSpecifier: function ExportLocalSpecifier2(reducer, node) { - return reducer.reduceExportLocalSpecifier(node, { name: this.IdentifierExpression(reducer, node.name) }); - }, - ExportLocals: function ExportLocals2(reducer, node) { - var _this9 = this; - return reducer.reduceExportLocals(node, { namedExports: node.namedExports.map(function(v) { - return _this9.ExportLocalSpecifier(reducer, v); - }) }); - }, - ExpressionStatement: function ExpressionStatement2(reducer, node) { - return reducer.reduceExpressionStatement(node, { expression: this[node.expression.type](reducer, node.expression) }); - }, - ForAwaitStatement: function ForAwaitStatement2(reducer, node) { - return reducer.reduceForAwaitStatement(node, { left: this[node.left.type](reducer, node.left), right: this[node.right.type](reducer, node.right), body: this[node.body.type](reducer, node.body) }); - }, - ForInStatement: function ForInStatement2(reducer, node) { - return reducer.reduceForInStatement(node, { left: this[node.left.type](reducer, node.left), right: this[node.right.type](reducer, node.right), body: this[node.body.type](reducer, node.body) }); - }, - ForOfStatement: function ForOfStatement2(reducer, node) { - return reducer.reduceForOfStatement(node, { left: this[node.left.type](reducer, node.left), right: this[node.right.type](reducer, node.right), body: this[node.body.type](reducer, node.body) }); - }, - ForStatement: function ForStatement2(reducer, node) { - return reducer.reduceForStatement(node, { init: node.init && this[node.init.type](reducer, node.init), test: node.test && this[node.test.type](reducer, node.test), update: node.update && this[node.update.type](reducer, node.update), body: this[node.body.type](reducer, node.body) }); - }, - FormalParameters: function FormalParameters2(reducer, node) { - var _this10 = this; - return reducer.reduceFormalParameters(node, { items: node.items.map(function(v) { - return _this10[v.type](reducer, v); - }), rest: node.rest && this[node.rest.type](reducer, node.rest) }); - }, - FunctionBody: function FunctionBody2(reducer, node) { - var _this11 = this; - return reducer.reduceFunctionBody(node, { directives: node.directives.map(function(v) { - return _this11.Directive(reducer, v); - }), statements: node.statements.map(function(v) { - return _this11[v.type](reducer, v); - }) }); - }, - FunctionDeclaration: function FunctionDeclaration2(reducer, node) { - return reducer.reduceFunctionDeclaration(node, { name: this.BindingIdentifier(reducer, node.name), params: this.FormalParameters(reducer, node.params), body: this.FunctionBody(reducer, node.body) }); - }, - FunctionExpression: function FunctionExpression2(reducer, node) { - return reducer.reduceFunctionExpression(node, { name: node.name && this.BindingIdentifier(reducer, node.name), params: this.FormalParameters(reducer, node.params), body: this.FunctionBody(reducer, node.body) }); - }, - Getter: function Getter2(reducer, node) { - return reducer.reduceGetter(node, { name: this[node.name.type](reducer, node.name), body: this.FunctionBody(reducer, node.body) }); - }, - IdentifierExpression: function IdentifierExpression2(reducer, node) { - return reducer.reduceIdentifierExpression(node); - }, - IfStatement: function IfStatement2(reducer, node) { - return reducer.reduceIfStatement(node, { test: this[node.test.type](reducer, node.test), consequent: this[node.consequent.type](reducer, node.consequent), alternate: node.alternate && this[node.alternate.type](reducer, node.alternate) }); - }, - Import: function Import2(reducer, node) { - var _this12 = this; - return reducer.reduceImport(node, { defaultBinding: node.defaultBinding && this.BindingIdentifier(reducer, node.defaultBinding), namedImports: node.namedImports.map(function(v) { - return _this12.ImportSpecifier(reducer, v); - }) }); - }, - ImportNamespace: function ImportNamespace2(reducer, node) { - return reducer.reduceImportNamespace(node, { defaultBinding: node.defaultBinding && this.BindingIdentifier(reducer, node.defaultBinding), namespaceBinding: this.BindingIdentifier(reducer, node.namespaceBinding) }); - }, - ImportSpecifier: function ImportSpecifier2(reducer, node) { - return reducer.reduceImportSpecifier(node, { binding: this.BindingIdentifier(reducer, node.binding) }); - }, - LabeledStatement: function LabeledStatement2(reducer, node) { - return reducer.reduceLabeledStatement(node, { body: this[node.body.type](reducer, node.body) }); - }, - LiteralBooleanExpression: function LiteralBooleanExpression2(reducer, node) { - return reducer.reduceLiteralBooleanExpression(node); - }, - LiteralInfinityExpression: function LiteralInfinityExpression2(reducer, node) { - return reducer.reduceLiteralInfinityExpression(node); - }, - LiteralNullExpression: function LiteralNullExpression2(reducer, node) { - return reducer.reduceLiteralNullExpression(node); - }, - LiteralNumericExpression: function LiteralNumericExpression2(reducer, node) { - return reducer.reduceLiteralNumericExpression(node); - }, - LiteralRegExpExpression: function LiteralRegExpExpression2(reducer, node) { - return reducer.reduceLiteralRegExpExpression(node); - }, - LiteralStringExpression: function LiteralStringExpression2(reducer, node) { - return reducer.reduceLiteralStringExpression(node); - }, - Method: function Method2(reducer, node) { - return reducer.reduceMethod(node, { name: this[node.name.type](reducer, node.name), params: this.FormalParameters(reducer, node.params), body: this.FunctionBody(reducer, node.body) }); - }, - Module: function Module2(reducer, node) { - var _this13 = this; - return reducer.reduceModule(node, { directives: node.directives.map(function(v) { - return _this13.Directive(reducer, v); - }), items: node.items.map(function(v) { - return _this13[v.type](reducer, v); - }) }); - }, - NewExpression: function NewExpression2(reducer, node) { - var _this14 = this; - return reducer.reduceNewExpression(node, { callee: this[node.callee.type](reducer, node.callee), arguments: node.arguments.map(function(v) { - return _this14[v.type](reducer, v); - }) }); - }, - NewTargetExpression: function NewTargetExpression2(reducer, node) { - return reducer.reduceNewTargetExpression(node); - }, - ObjectAssignmentTarget: function ObjectAssignmentTarget2(reducer, node) { - var _this15 = this; - return reducer.reduceObjectAssignmentTarget(node, { properties: node.properties.map(function(v) { - return _this15[v.type](reducer, v); - }), rest: node.rest && this[node.rest.type](reducer, node.rest) }); - }, - ObjectBinding: function ObjectBinding2(reducer, node) { - var _this16 = this; - return reducer.reduceObjectBinding(node, { properties: node.properties.map(function(v) { - return _this16[v.type](reducer, v); - }), rest: node.rest && this[node.rest.type](reducer, node.rest) }); - }, - ObjectExpression: function ObjectExpression2(reducer, node) { - var _this17 = this; - return reducer.reduceObjectExpression(node, { properties: node.properties.map(function(v) { - return _this17[v.type](reducer, v); - }) }); - }, - ReturnStatement: function ReturnStatement2(reducer, node) { - return reducer.reduceReturnStatement(node, { expression: node.expression && this[node.expression.type](reducer, node.expression) }); - }, - Script: function Script2(reducer, node) { - var _this18 = this; - return reducer.reduceScript(node, { directives: node.directives.map(function(v) { - return _this18.Directive(reducer, v); - }), statements: node.statements.map(function(v) { - return _this18[v.type](reducer, v); - }) }); - }, - Setter: function Setter2(reducer, node) { - return reducer.reduceSetter(node, { name: this[node.name.type](reducer, node.name), param: this[node.param.type](reducer, node.param), body: this.FunctionBody(reducer, node.body) }); - }, - ShorthandProperty: function ShorthandProperty2(reducer, node) { - return reducer.reduceShorthandProperty(node, { name: this.IdentifierExpression(reducer, node.name) }); - }, - SpreadElement: function SpreadElement2(reducer, node) { - return reducer.reduceSpreadElement(node, { expression: this[node.expression.type](reducer, node.expression) }); - }, - SpreadProperty: function SpreadProperty2(reducer, node) { - return reducer.reduceSpreadProperty(node, { expression: this[node.expression.type](reducer, node.expression) }); - }, - StaticMemberAssignmentTarget: function StaticMemberAssignmentTarget2(reducer, node) { - return reducer.reduceStaticMemberAssignmentTarget(node, { object: this[node.object.type](reducer, node.object) }); - }, - StaticMemberExpression: function StaticMemberExpression2(reducer, node) { - return reducer.reduceStaticMemberExpression(node, { object: this[node.object.type](reducer, node.object) }); - }, - StaticPropertyName: function StaticPropertyName2(reducer, node) { - return reducer.reduceStaticPropertyName(node); - }, - Super: function Super2(reducer, node) { - return reducer.reduceSuper(node); - }, - SwitchCase: function SwitchCase2(reducer, node) { - var _this19 = this; - return reducer.reduceSwitchCase(node, { test: this[node.test.type](reducer, node.test), consequent: node.consequent.map(function(v) { - return _this19[v.type](reducer, v); - }) }); - }, - SwitchDefault: function SwitchDefault2(reducer, node) { - var _this20 = this; - return reducer.reduceSwitchDefault(node, { consequent: node.consequent.map(function(v) { - return _this20[v.type](reducer, v); - }) }); - }, - SwitchStatement: function SwitchStatement2(reducer, node) { - var _this21 = this; - return reducer.reduceSwitchStatement(node, { discriminant: this[node.discriminant.type](reducer, node.discriminant), cases: node.cases.map(function(v) { - return _this21.SwitchCase(reducer, v); - }) }); - }, - SwitchStatementWithDefault: function SwitchStatementWithDefault2(reducer, node) { - var _this22 = this; - return reducer.reduceSwitchStatementWithDefault(node, { discriminant: this[node.discriminant.type](reducer, node.discriminant), preDefaultCases: node.preDefaultCases.map(function(v) { - return _this22.SwitchCase(reducer, v); - }), defaultCase: this.SwitchDefault(reducer, node.defaultCase), postDefaultCases: node.postDefaultCases.map(function(v) { - return _this22.SwitchCase(reducer, v); - }) }); - }, - TemplateElement: function TemplateElement2(reducer, node) { - return reducer.reduceTemplateElement(node); - }, - TemplateExpression: function TemplateExpression2(reducer, node) { - var _this23 = this; - return reducer.reduceTemplateExpression(node, { tag: node.tag && this[node.tag.type](reducer, node.tag), elements: node.elements.map(function(v) { - return _this23[v.type](reducer, v); - }) }); - }, - ThisExpression: function ThisExpression2(reducer, node) { - return reducer.reduceThisExpression(node); - }, - ThrowStatement: function ThrowStatement2(reducer, node) { - return reducer.reduceThrowStatement(node, { expression: this[node.expression.type](reducer, node.expression) }); - }, - TryCatchStatement: function TryCatchStatement2(reducer, node) { - return reducer.reduceTryCatchStatement(node, { body: this.Block(reducer, node.body), catchClause: this.CatchClause(reducer, node.catchClause) }); - }, - TryFinallyStatement: function TryFinallyStatement2(reducer, node) { - return reducer.reduceTryFinallyStatement(node, { body: this.Block(reducer, node.body), catchClause: node.catchClause && this.CatchClause(reducer, node.catchClause), finalizer: this.Block(reducer, node.finalizer) }); - }, - UnaryExpression: function UnaryExpression2(reducer, node) { - return reducer.reduceUnaryExpression(node, { operand: this[node.operand.type](reducer, node.operand) }); - }, - UpdateExpression: function UpdateExpression2(reducer, node) { - return reducer.reduceUpdateExpression(node, { operand: this[node.operand.type](reducer, node.operand) }); - }, - VariableDeclaration: function VariableDeclaration2(reducer, node) { - var _this24 = this; - return reducer.reduceVariableDeclaration(node, { declarators: node.declarators.map(function(v) { - return _this24.VariableDeclarator(reducer, v); - }) }); - }, - VariableDeclarationStatement: function VariableDeclarationStatement2(reducer, node) { - return reducer.reduceVariableDeclarationStatement(node, { declaration: this.VariableDeclaration(reducer, node.declaration) }); - }, - VariableDeclarator: function VariableDeclarator2(reducer, node) { - return reducer.reduceVariableDeclarator(node, { binding: this[node.binding.type](reducer, node.binding), init: node.init && this[node.init.type](reducer, node.init) }); - }, - WhileStatement: function WhileStatement2(reducer, node) { - return reducer.reduceWhileStatement(node, { test: this[node.test.type](reducer, node.test), body: this[node.body.type](reducer, node.body) }); - }, - WithStatement: function WithStatement2(reducer, node) { - return reducer.reduceWithStatement(node, { object: this[node.object.type](reducer, node.object), body: this[node.body.type](reducer, node.body) }); - }, - YieldExpression: function YieldExpression2(reducer, node) { - return reducer.reduceYieldExpression(node, { expression: node.expression && this[node.expression.type](reducer, node.expression) }); - }, - YieldGeneratorExpression: function YieldGeneratorExpression2(reducer, node) { - return reducer.reduceYieldGeneratorExpression(node, { expression: this[node.expression.type](reducer, node.expression) }); - } -}; -function reduce(reducer, node) { - return director$1[node.type](reducer, node); -} -const director$2 = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - reduce: reduce_1, - default: director$3 -}, [director$3]); -const require$$0$6 = /* @__PURE__ */ getAugmentedNamespace(director$2); -var thunkedDirector$1 = {}; -Object.defineProperty(thunkedDirector$1, "__esModule", { - value: true -}); -var thunkedReduce_1 = thunkedDirector$1.thunkedReduce = thunkedReduce; -var director = { - ArrayAssignmentTarget: function ArrayAssignmentTarget3(reducer, node) { - var _this = this; - return reducer.reduceArrayAssignmentTarget(node, { elements: node.elements.map(function(v) { - return v && function() { - return _this[v.type](reducer, v); - }; - }), rest: node.rest && function() { - return _this[node.rest.type](reducer, node.rest); - } }); - }, - ArrayBinding: function ArrayBinding3(reducer, node) { - var _this2 = this; - return reducer.reduceArrayBinding(node, { elements: node.elements.map(function(v) { - return v && function() { - return _this2[v.type](reducer, v); - }; - }), rest: node.rest && function() { - return _this2[node.rest.type](reducer, node.rest); - } }); - }, - ArrayExpression: function ArrayExpression3(reducer, node) { - var _this3 = this; - return reducer.reduceArrayExpression(node, { elements: node.elements.map(function(v) { - return v && function() { - return _this3[v.type](reducer, v); - }; - }) }); - }, - ArrowExpression: function ArrowExpression3(reducer, node) { - var _this4 = this; - return reducer.reduceArrowExpression(node, { params: function params() { - return _this4.FormalParameters(reducer, node.params); - }, body: function body() { - return _this4[node.body.type](reducer, node.body); - } }); - }, - AssignmentExpression: function AssignmentExpression3(reducer, node) { - var _this5 = this; - return reducer.reduceAssignmentExpression(node, { binding: function binding() { - return _this5[node.binding.type](reducer, node.binding); - }, expression: function expression() { - return _this5[node.expression.type](reducer, node.expression); - } }); - }, - AssignmentTargetIdentifier: function AssignmentTargetIdentifier3(reducer, node) { - return reducer.reduceAssignmentTargetIdentifier(node); - }, - AssignmentTargetPropertyIdentifier: function AssignmentTargetPropertyIdentifier3(reducer, node) { - var _this6 = this; - return reducer.reduceAssignmentTargetPropertyIdentifier(node, { binding: function binding() { - return _this6.AssignmentTargetIdentifier(reducer, node.binding); - }, init: node.init && function() { - return _this6[node.init.type](reducer, node.init); - } }); - }, - AssignmentTargetPropertyProperty: function AssignmentTargetPropertyProperty3(reducer, node) { - var _this7 = this; - return reducer.reduceAssignmentTargetPropertyProperty(node, { name: function name() { - return _this7[node.name.type](reducer, node.name); - }, binding: function binding() { - return _this7[node.binding.type](reducer, node.binding); - } }); - }, - AssignmentTargetWithDefault: function AssignmentTargetWithDefault3(reducer, node) { - var _this8 = this; - return reducer.reduceAssignmentTargetWithDefault(node, { binding: function binding() { - return _this8[node.binding.type](reducer, node.binding); - }, init: function init() { - return _this8[node.init.type](reducer, node.init); - } }); - }, - AwaitExpression: function AwaitExpression3(reducer, node) { - var _this9 = this; - return reducer.reduceAwaitExpression(node, { expression: function expression() { - return _this9[node.expression.type](reducer, node.expression); - } }); - }, - BinaryExpression: function BinaryExpression3(reducer, node) { - var _this10 = this; - return reducer.reduceBinaryExpression(node, { left: function left() { - return _this10[node.left.type](reducer, node.left); - }, right: function right() { - return _this10[node.right.type](reducer, node.right); - } }); - }, - BindingIdentifier: function BindingIdentifier3(reducer, node) { - return reducer.reduceBindingIdentifier(node); - }, - BindingPropertyIdentifier: function BindingPropertyIdentifier3(reducer, node) { - var _this11 = this; - return reducer.reduceBindingPropertyIdentifier(node, { binding: function binding() { - return _this11.BindingIdentifier(reducer, node.binding); - }, init: node.init && function() { - return _this11[node.init.type](reducer, node.init); - } }); - }, - BindingPropertyProperty: function BindingPropertyProperty3(reducer, node) { - var _this12 = this; - return reducer.reduceBindingPropertyProperty(node, { name: function name() { - return _this12[node.name.type](reducer, node.name); - }, binding: function binding() { - return _this12[node.binding.type](reducer, node.binding); - } }); - }, - BindingWithDefault: function BindingWithDefault3(reducer, node) { - var _this13 = this; - return reducer.reduceBindingWithDefault(node, { binding: function binding() { - return _this13[node.binding.type](reducer, node.binding); - }, init: function init() { - return _this13[node.init.type](reducer, node.init); - } }); - }, - Block: function Block3(reducer, node) { - var _this14 = this; - return reducer.reduceBlock(node, { statements: node.statements.map(function(v) { - return function() { - return _this14[v.type](reducer, v); - }; - }) }); - }, - BlockStatement: function BlockStatement3(reducer, node) { - var _this15 = this; - return reducer.reduceBlockStatement(node, { block: function block() { - return _this15.Block(reducer, node.block); - } }); - }, - BreakStatement: function BreakStatement3(reducer, node) { - return reducer.reduceBreakStatement(node); - }, - CallExpression: function CallExpression3(reducer, node) { - var _this16 = this; - return reducer.reduceCallExpression(node, { callee: function callee() { - return _this16[node.callee.type](reducer, node.callee); - }, arguments: node.arguments.map(function(v) { - return function() { - return _this16[v.type](reducer, v); - }; - }) }); - }, - CatchClause: function CatchClause3(reducer, node) { - var _this17 = this; - return reducer.reduceCatchClause(node, { binding: function binding() { - return _this17[node.binding.type](reducer, node.binding); - }, body: function body() { - return _this17.Block(reducer, node.body); - } }); - }, - ClassDeclaration: function ClassDeclaration3(reducer, node) { - var _this18 = this; - return reducer.reduceClassDeclaration(node, { name: function name() { - return _this18.BindingIdentifier(reducer, node.name); - }, super: node.super && function() { - return _this18[node.super.type](reducer, node.super); - }, elements: node.elements.map(function(v) { - return function() { - return _this18.ClassElement(reducer, v); - }; - }) }); - }, - ClassElement: function ClassElement3(reducer, node) { - var _this19 = this; - return reducer.reduceClassElement(node, { method: function method() { - return _this19[node.method.type](reducer, node.method); - } }); - }, - ClassExpression: function ClassExpression3(reducer, node) { - var _this20 = this; - return reducer.reduceClassExpression(node, { name: node.name && function() { - return _this20.BindingIdentifier(reducer, node.name); - }, super: node.super && function() { - return _this20[node.super.type](reducer, node.super); - }, elements: node.elements.map(function(v) { - return function() { - return _this20.ClassElement(reducer, v); - }; - }) }); - }, - CompoundAssignmentExpression: function CompoundAssignmentExpression3(reducer, node) { - var _this21 = this; - return reducer.reduceCompoundAssignmentExpression(node, { binding: function binding() { - return _this21[node.binding.type](reducer, node.binding); - }, expression: function expression() { - return _this21[node.expression.type](reducer, node.expression); - } }); - }, - ComputedMemberAssignmentTarget: function ComputedMemberAssignmentTarget3(reducer, node) { - var _this22 = this; - return reducer.reduceComputedMemberAssignmentTarget(node, { object: function object() { - return _this22[node.object.type](reducer, node.object); - }, expression: function expression() { - return _this22[node.expression.type](reducer, node.expression); - } }); - }, - ComputedMemberExpression: function ComputedMemberExpression3(reducer, node) { - var _this23 = this; - return reducer.reduceComputedMemberExpression(node, { object: function object() { - return _this23[node.object.type](reducer, node.object); - }, expression: function expression() { - return _this23[node.expression.type](reducer, node.expression); - } }); - }, - ComputedPropertyName: function ComputedPropertyName3(reducer, node) { - var _this24 = this; - return reducer.reduceComputedPropertyName(node, { expression: function expression() { - return _this24[node.expression.type](reducer, node.expression); - } }); - }, - ConditionalExpression: function ConditionalExpression3(reducer, node) { - var _this25 = this; - return reducer.reduceConditionalExpression(node, { test: function test() { - return _this25[node.test.type](reducer, node.test); - }, consequent: function consequent() { - return _this25[node.consequent.type](reducer, node.consequent); - }, alternate: function alternate() { - return _this25[node.alternate.type](reducer, node.alternate); - } }); - }, - ContinueStatement: function ContinueStatement3(reducer, node) { - return reducer.reduceContinueStatement(node); - }, - DataProperty: function DataProperty3(reducer, node) { - var _this26 = this; - return reducer.reduceDataProperty(node, { name: function name() { - return _this26[node.name.type](reducer, node.name); - }, expression: function expression() { - return _this26[node.expression.type](reducer, node.expression); - } }); - }, - DebuggerStatement: function DebuggerStatement3(reducer, node) { - return reducer.reduceDebuggerStatement(node); - }, - Directive: function Directive3(reducer, node) { - return reducer.reduceDirective(node); - }, - DoWhileStatement: function DoWhileStatement3(reducer, node) { - var _this27 = this; - return reducer.reduceDoWhileStatement(node, { body: function body() { - return _this27[node.body.type](reducer, node.body); - }, test: function test() { - return _this27[node.test.type](reducer, node.test); - } }); - }, - EmptyStatement: function EmptyStatement3(reducer, node) { - return reducer.reduceEmptyStatement(node); - }, - Export: function Export3(reducer, node) { - var _this28 = this; - return reducer.reduceExport(node, { declaration: function declaration() { - return _this28[node.declaration.type](reducer, node.declaration); - } }); - }, - ExportAllFrom: function ExportAllFrom3(reducer, node) { - return reducer.reduceExportAllFrom(node); - }, - ExportDefault: function ExportDefault3(reducer, node) { - var _this29 = this; - return reducer.reduceExportDefault(node, { body: function body() { - return _this29[node.body.type](reducer, node.body); - } }); - }, - ExportFrom: function ExportFrom3(reducer, node) { - var _this30 = this; - return reducer.reduceExportFrom(node, { namedExports: node.namedExports.map(function(v) { - return function() { - return _this30.ExportFromSpecifier(reducer, v); - }; - }) }); - }, - ExportFromSpecifier: function ExportFromSpecifier3(reducer, node) { - return reducer.reduceExportFromSpecifier(node); - }, - ExportLocalSpecifier: function ExportLocalSpecifier3(reducer, node) { - var _this31 = this; - return reducer.reduceExportLocalSpecifier(node, { name: function name() { - return _this31.IdentifierExpression(reducer, node.name); - } }); - }, - ExportLocals: function ExportLocals3(reducer, node) { - var _this32 = this; - return reducer.reduceExportLocals(node, { namedExports: node.namedExports.map(function(v) { - return function() { - return _this32.ExportLocalSpecifier(reducer, v); - }; - }) }); - }, - ExpressionStatement: function ExpressionStatement3(reducer, node) { - var _this33 = this; - return reducer.reduceExpressionStatement(node, { expression: function expression() { - return _this33[node.expression.type](reducer, node.expression); - } }); - }, - ForAwaitStatement: function ForAwaitStatement3(reducer, node) { - var _this34 = this; - return reducer.reduceForAwaitStatement(node, { left: function left() { - return _this34[node.left.type](reducer, node.left); - }, right: function right() { - return _this34[node.right.type](reducer, node.right); - }, body: function body() { - return _this34[node.body.type](reducer, node.body); - } }); - }, - ForInStatement: function ForInStatement3(reducer, node) { - var _this35 = this; - return reducer.reduceForInStatement(node, { left: function left() { - return _this35[node.left.type](reducer, node.left); - }, right: function right() { - return _this35[node.right.type](reducer, node.right); - }, body: function body() { - return _this35[node.body.type](reducer, node.body); - } }); - }, - ForOfStatement: function ForOfStatement3(reducer, node) { - var _this36 = this; - return reducer.reduceForOfStatement(node, { left: function left() { - return _this36[node.left.type](reducer, node.left); - }, right: function right() { - return _this36[node.right.type](reducer, node.right); - }, body: function body() { - return _this36[node.body.type](reducer, node.body); - } }); - }, - ForStatement: function ForStatement3(reducer, node) { - var _this37 = this; - return reducer.reduceForStatement(node, { init: node.init && function() { - return _this37[node.init.type](reducer, node.init); - }, test: node.test && function() { - return _this37[node.test.type](reducer, node.test); - }, update: node.update && function() { - return _this37[node.update.type](reducer, node.update); - }, body: function body() { - return _this37[node.body.type](reducer, node.body); - } }); - }, - FormalParameters: function FormalParameters3(reducer, node) { - var _this38 = this; - return reducer.reduceFormalParameters(node, { items: node.items.map(function(v) { - return function() { - return _this38[v.type](reducer, v); - }; - }), rest: node.rest && function() { - return _this38[node.rest.type](reducer, node.rest); - } }); - }, - FunctionBody: function FunctionBody3(reducer, node) { - var _this39 = this; - return reducer.reduceFunctionBody(node, { directives: node.directives.map(function(v) { - return function() { - return _this39.Directive(reducer, v); - }; - }), statements: node.statements.map(function(v) { - return function() { - return _this39[v.type](reducer, v); - }; - }) }); - }, - FunctionDeclaration: function FunctionDeclaration3(reducer, node) { - var _this40 = this; - return reducer.reduceFunctionDeclaration(node, { name: function name() { - return _this40.BindingIdentifier(reducer, node.name); - }, params: function params() { - return _this40.FormalParameters(reducer, node.params); - }, body: function body() { - return _this40.FunctionBody(reducer, node.body); - } }); - }, - FunctionExpression: function FunctionExpression3(reducer, node) { - var _this41 = this; - return reducer.reduceFunctionExpression(node, { name: node.name && function() { - return _this41.BindingIdentifier(reducer, node.name); - }, params: function params() { - return _this41.FormalParameters(reducer, node.params); - }, body: function body() { - return _this41.FunctionBody(reducer, node.body); - } }); - }, - Getter: function Getter3(reducer, node) { - var _this42 = this; - return reducer.reduceGetter(node, { name: function name() { - return _this42[node.name.type](reducer, node.name); - }, body: function body() { - return _this42.FunctionBody(reducer, node.body); - } }); - }, - IdentifierExpression: function IdentifierExpression3(reducer, node) { - return reducer.reduceIdentifierExpression(node); - }, - IfStatement: function IfStatement3(reducer, node) { - var _this43 = this; - return reducer.reduceIfStatement(node, { test: function test() { - return _this43[node.test.type](reducer, node.test); - }, consequent: function consequent() { - return _this43[node.consequent.type](reducer, node.consequent); - }, alternate: node.alternate && function() { - return _this43[node.alternate.type](reducer, node.alternate); - } }); - }, - Import: function Import3(reducer, node) { - var _this44 = this; - return reducer.reduceImport(node, { defaultBinding: node.defaultBinding && function() { - return _this44.BindingIdentifier(reducer, node.defaultBinding); - }, namedImports: node.namedImports.map(function(v) { - return function() { - return _this44.ImportSpecifier(reducer, v); - }; - }) }); - }, - ImportNamespace: function ImportNamespace3(reducer, node) { - var _this45 = this; - return reducer.reduceImportNamespace(node, { defaultBinding: node.defaultBinding && function() { - return _this45.BindingIdentifier(reducer, node.defaultBinding); - }, namespaceBinding: function namespaceBinding() { - return _this45.BindingIdentifier(reducer, node.namespaceBinding); - } }); - }, - ImportSpecifier: function ImportSpecifier3(reducer, node) { - var _this46 = this; - return reducer.reduceImportSpecifier(node, { binding: function binding() { - return _this46.BindingIdentifier(reducer, node.binding); - } }); - }, - LabeledStatement: function LabeledStatement3(reducer, node) { - var _this47 = this; - return reducer.reduceLabeledStatement(node, { body: function body() { - return _this47[node.body.type](reducer, node.body); - } }); - }, - LiteralBooleanExpression: function LiteralBooleanExpression3(reducer, node) { - return reducer.reduceLiteralBooleanExpression(node); - }, - LiteralInfinityExpression: function LiteralInfinityExpression3(reducer, node) { - return reducer.reduceLiteralInfinityExpression(node); - }, - LiteralNullExpression: function LiteralNullExpression3(reducer, node) { - return reducer.reduceLiteralNullExpression(node); - }, - LiteralNumericExpression: function LiteralNumericExpression3(reducer, node) { - return reducer.reduceLiteralNumericExpression(node); - }, - LiteralRegExpExpression: function LiteralRegExpExpression3(reducer, node) { - return reducer.reduceLiteralRegExpExpression(node); - }, - LiteralStringExpression: function LiteralStringExpression3(reducer, node) { - return reducer.reduceLiteralStringExpression(node); - }, - Method: function Method3(reducer, node) { - var _this48 = this; - return reducer.reduceMethod(node, { name: function name() { - return _this48[node.name.type](reducer, node.name); - }, params: function params() { - return _this48.FormalParameters(reducer, node.params); - }, body: function body() { - return _this48.FunctionBody(reducer, node.body); - } }); - }, - Module: function Module3(reducer, node) { - var _this49 = this; - return reducer.reduceModule(node, { directives: node.directives.map(function(v) { - return function() { - return _this49.Directive(reducer, v); - }; - }), items: node.items.map(function(v) { - return function() { - return _this49[v.type](reducer, v); - }; - }) }); - }, - NewExpression: function NewExpression3(reducer, node) { - var _this50 = this; - return reducer.reduceNewExpression(node, { callee: function callee() { - return _this50[node.callee.type](reducer, node.callee); - }, arguments: node.arguments.map(function(v) { - return function() { - return _this50[v.type](reducer, v); - }; - }) }); - }, - NewTargetExpression: function NewTargetExpression3(reducer, node) { - return reducer.reduceNewTargetExpression(node); - }, - ObjectAssignmentTarget: function ObjectAssignmentTarget3(reducer, node) { - var _this51 = this; - return reducer.reduceObjectAssignmentTarget(node, { properties: node.properties.map(function(v) { - return function() { - return _this51[v.type](reducer, v); - }; - }), rest: node.rest && function() { - return _this51[node.rest.type](reducer, node.rest); - } }); - }, - ObjectBinding: function ObjectBinding3(reducer, node) { - var _this52 = this; - return reducer.reduceObjectBinding(node, { properties: node.properties.map(function(v) { - return function() { - return _this52[v.type](reducer, v); - }; - }), rest: node.rest && function() { - return _this52[node.rest.type](reducer, node.rest); - } }); - }, - ObjectExpression: function ObjectExpression3(reducer, node) { - var _this53 = this; - return reducer.reduceObjectExpression(node, { properties: node.properties.map(function(v) { - return function() { - return _this53[v.type](reducer, v); - }; - }) }); - }, - ReturnStatement: function ReturnStatement3(reducer, node) { - var _this54 = this; - return reducer.reduceReturnStatement(node, { expression: node.expression && function() { - return _this54[node.expression.type](reducer, node.expression); - } }); - }, - Script: function Script3(reducer, node) { - var _this55 = this; - return reducer.reduceScript(node, { directives: node.directives.map(function(v) { - return function() { - return _this55.Directive(reducer, v); - }; - }), statements: node.statements.map(function(v) { - return function() { - return _this55[v.type](reducer, v); - }; - }) }); - }, - Setter: function Setter3(reducer, node) { - var _this56 = this; - return reducer.reduceSetter(node, { name: function name() { - return _this56[node.name.type](reducer, node.name); - }, param: function param() { - return _this56[node.param.type](reducer, node.param); - }, body: function body() { - return _this56.FunctionBody(reducer, node.body); - } }); - }, - ShorthandProperty: function ShorthandProperty3(reducer, node) { - var _this57 = this; - return reducer.reduceShorthandProperty(node, { name: function name() { - return _this57.IdentifierExpression(reducer, node.name); - } }); - }, - SpreadElement: function SpreadElement3(reducer, node) { - var _this58 = this; - return reducer.reduceSpreadElement(node, { expression: function expression() { - return _this58[node.expression.type](reducer, node.expression); - } }); - }, - SpreadProperty: function SpreadProperty3(reducer, node) { - var _this59 = this; - return reducer.reduceSpreadProperty(node, { expression: function expression() { - return _this59[node.expression.type](reducer, node.expression); - } }); - }, - StaticMemberAssignmentTarget: function StaticMemberAssignmentTarget3(reducer, node) { - var _this60 = this; - return reducer.reduceStaticMemberAssignmentTarget(node, { object: function object() { - return _this60[node.object.type](reducer, node.object); - } }); - }, - StaticMemberExpression: function StaticMemberExpression3(reducer, node) { - var _this61 = this; - return reducer.reduceStaticMemberExpression(node, { object: function object() { - return _this61[node.object.type](reducer, node.object); - } }); - }, - StaticPropertyName: function StaticPropertyName3(reducer, node) { - return reducer.reduceStaticPropertyName(node); - }, - Super: function Super3(reducer, node) { - return reducer.reduceSuper(node); - }, - SwitchCase: function SwitchCase3(reducer, node) { - var _this62 = this; - return reducer.reduceSwitchCase(node, { test: function test() { - return _this62[node.test.type](reducer, node.test); - }, consequent: node.consequent.map(function(v) { - return function() { - return _this62[v.type](reducer, v); - }; - }) }); - }, - SwitchDefault: function SwitchDefault3(reducer, node) { - var _this63 = this; - return reducer.reduceSwitchDefault(node, { consequent: node.consequent.map(function(v) { - return function() { - return _this63[v.type](reducer, v); - }; - }) }); - }, - SwitchStatement: function SwitchStatement3(reducer, node) { - var _this64 = this; - return reducer.reduceSwitchStatement(node, { discriminant: function discriminant() { - return _this64[node.discriminant.type](reducer, node.discriminant); - }, cases: node.cases.map(function(v) { - return function() { - return _this64.SwitchCase(reducer, v); - }; - }) }); - }, - SwitchStatementWithDefault: function SwitchStatementWithDefault3(reducer, node) { - var _this65 = this; - return reducer.reduceSwitchStatementWithDefault(node, { discriminant: function discriminant() { - return _this65[node.discriminant.type](reducer, node.discriminant); - }, preDefaultCases: node.preDefaultCases.map(function(v) { - return function() { - return _this65.SwitchCase(reducer, v); - }; - }), defaultCase: function defaultCase() { - return _this65.SwitchDefault(reducer, node.defaultCase); - }, postDefaultCases: node.postDefaultCases.map(function(v) { - return function() { - return _this65.SwitchCase(reducer, v); - }; - }) }); - }, - TemplateElement: function TemplateElement3(reducer, node) { - return reducer.reduceTemplateElement(node); - }, - TemplateExpression: function TemplateExpression3(reducer, node) { - var _this66 = this; - return reducer.reduceTemplateExpression(node, { tag: node.tag && function() { - return _this66[node.tag.type](reducer, node.tag); - }, elements: node.elements.map(function(v) { - return function() { - return _this66[v.type](reducer, v); - }; - }) }); - }, - ThisExpression: function ThisExpression3(reducer, node) { - return reducer.reduceThisExpression(node); - }, - ThrowStatement: function ThrowStatement3(reducer, node) { - var _this67 = this; - return reducer.reduceThrowStatement(node, { expression: function expression() { - return _this67[node.expression.type](reducer, node.expression); - } }); - }, - TryCatchStatement: function TryCatchStatement3(reducer, node) { - var _this68 = this; - return reducer.reduceTryCatchStatement(node, { body: function body() { - return _this68.Block(reducer, node.body); - }, catchClause: function catchClause() { - return _this68.CatchClause(reducer, node.catchClause); - } }); - }, - TryFinallyStatement: function TryFinallyStatement3(reducer, node) { - var _this69 = this; - return reducer.reduceTryFinallyStatement(node, { body: function body() { - return _this69.Block(reducer, node.body); - }, catchClause: node.catchClause && function() { - return _this69.CatchClause(reducer, node.catchClause); - }, finalizer: function finalizer() { - return _this69.Block(reducer, node.finalizer); - } }); - }, - UnaryExpression: function UnaryExpression3(reducer, node) { - var _this70 = this; - return reducer.reduceUnaryExpression(node, { operand: function operand() { - return _this70[node.operand.type](reducer, node.operand); - } }); - }, - UpdateExpression: function UpdateExpression3(reducer, node) { - var _this71 = this; - return reducer.reduceUpdateExpression(node, { operand: function operand() { - return _this71[node.operand.type](reducer, node.operand); - } }); - }, - VariableDeclaration: function VariableDeclaration3(reducer, node) { - var _this72 = this; - return reducer.reduceVariableDeclaration(node, { declarators: node.declarators.map(function(v) { - return function() { - return _this72.VariableDeclarator(reducer, v); - }; - }) }); - }, - VariableDeclarationStatement: function VariableDeclarationStatement3(reducer, node) { - var _this73 = this; - return reducer.reduceVariableDeclarationStatement(node, { declaration: function declaration() { - return _this73.VariableDeclaration(reducer, node.declaration); - } }); - }, - VariableDeclarator: function VariableDeclarator3(reducer, node) { - var _this74 = this; - return reducer.reduceVariableDeclarator(node, { binding: function binding() { - return _this74[node.binding.type](reducer, node.binding); - }, init: node.init && function() { - return _this74[node.init.type](reducer, node.init); - } }); - }, - WhileStatement: function WhileStatement3(reducer, node) { - var _this75 = this; - return reducer.reduceWhileStatement(node, { test: function test() { - return _this75[node.test.type](reducer, node.test); - }, body: function body() { - return _this75[node.body.type](reducer, node.body); - } }); - }, - WithStatement: function WithStatement3(reducer, node) { - var _this76 = this; - return reducer.reduceWithStatement(node, { object: function object() { - return _this76[node.object.type](reducer, node.object); - }, body: function body() { - return _this76[node.body.type](reducer, node.body); - } }); - }, - YieldExpression: function YieldExpression3(reducer, node) { - var _this77 = this; - return reducer.reduceYieldExpression(node, { expression: node.expression && function() { - return _this77[node.expression.type](reducer, node.expression); - } }); - }, - YieldGeneratorExpression: function YieldGeneratorExpression3(reducer, node) { - var _this78 = this; - return reducer.reduceYieldGeneratorExpression(node, { expression: function expression() { - return _this78[node.expression.type](reducer, node.expression); - } }); - } -}; -function thunkedReduce(reducer, node) { - return director[node.type](reducer, node); -} -const thunkedDirector = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - thunkedReduce: thunkedReduce_1, - default: thunkedDirector$1 -}, [thunkedDirector$1]); -const require$$1$3 = /* @__PURE__ */ getAugmentedNamespace(thunkedDirector); -var thunkify$2 = {}; -Object.defineProperty(thunkify$2, "__esModule", { - value: true -}); -var _default$a = thunkify$2.default = thunkify; -function thunkify(reducer) { - return { - reduceArrayAssignmentTarget: function reduceArrayAssignmentTarget(node, _ref) { - var elements = _ref.elements, rest = _ref.rest; - return reducer.reduceArrayAssignmentTarget(node, { elements: elements.map(function(n) { - return n == null ? null : n(); - }), rest: rest == null ? null : rest() }); - }, - reduceArrayBinding: function reduceArrayBinding(node, _ref2) { - var elements = _ref2.elements, rest = _ref2.rest; - return reducer.reduceArrayBinding(node, { elements: elements.map(function(n) { - return n == null ? null : n(); - }), rest: rest == null ? null : rest() }); - }, - reduceArrayExpression: function reduceArrayExpression(node, _ref3) { - var elements = _ref3.elements; - return reducer.reduceArrayExpression(node, { elements: elements.map(function(n) { - return n == null ? null : n(); - }) }); - }, - reduceArrowExpression: function reduceArrowExpression(node, _ref4) { - var params = _ref4.params, body = _ref4.body; - return reducer.reduceArrowExpression(node, { params: params(), body: body() }); - }, - reduceAssignmentExpression: function reduceAssignmentExpression(node, _ref5) { - var binding = _ref5.binding, expression = _ref5.expression; - return reducer.reduceAssignmentExpression(node, { binding: binding(), expression: expression() }); - }, - reduceAssignmentTargetIdentifier: function reduceAssignmentTargetIdentifier(node) { - return reducer.reduceAssignmentTargetIdentifier(node); - }, - reduceAssignmentTargetPropertyIdentifier: function reduceAssignmentTargetPropertyIdentifier(node, _ref6) { - var binding = _ref6.binding, init = _ref6.init; - return reducer.reduceAssignmentTargetPropertyIdentifier(node, { binding: binding(), init: init == null ? null : init() }); - }, - reduceAssignmentTargetPropertyProperty: function reduceAssignmentTargetPropertyProperty(node, _ref7) { - var name = _ref7.name, binding = _ref7.binding; - return reducer.reduceAssignmentTargetPropertyProperty(node, { name: name(), binding: binding() }); - }, - reduceAssignmentTargetWithDefault: function reduceAssignmentTargetWithDefault(node, _ref8) { - var binding = _ref8.binding, init = _ref8.init; - return reducer.reduceAssignmentTargetWithDefault(node, { binding: binding(), init: init() }); - }, - reduceAwaitExpression: function reduceAwaitExpression(node, _ref9) { - var expression = _ref9.expression; - return reducer.reduceAwaitExpression(node, { expression: expression() }); - }, - reduceBinaryExpression: function reduceBinaryExpression(node, _ref10) { - var left = _ref10.left, right = _ref10.right; - return reducer.reduceBinaryExpression(node, { left: left(), right: right() }); - }, - reduceBindingIdentifier: function reduceBindingIdentifier(node) { - return reducer.reduceBindingIdentifier(node); - }, - reduceBindingPropertyIdentifier: function reduceBindingPropertyIdentifier(node, _ref11) { - var binding = _ref11.binding, init = _ref11.init; - return reducer.reduceBindingPropertyIdentifier(node, { binding: binding(), init: init == null ? null : init() }); - }, - reduceBindingPropertyProperty: function reduceBindingPropertyProperty(node, _ref12) { - var name = _ref12.name, binding = _ref12.binding; - return reducer.reduceBindingPropertyProperty(node, { name: name(), binding: binding() }); - }, - reduceBindingWithDefault: function reduceBindingWithDefault(node, _ref13) { - var binding = _ref13.binding, init = _ref13.init; - return reducer.reduceBindingWithDefault(node, { binding: binding(), init: init() }); - }, - reduceBlock: function reduceBlock(node, _ref14) { - var statements = _ref14.statements; - return reducer.reduceBlock(node, { statements: statements.map(function(n) { - return n(); - }) }); - }, - reduceBlockStatement: function reduceBlockStatement(node, _ref15) { - var block = _ref15.block; - return reducer.reduceBlockStatement(node, { block: block() }); - }, - reduceBreakStatement: function reduceBreakStatement(node) { - return reducer.reduceBreakStatement(node); - }, - reduceCallExpression: function reduceCallExpression(node, _ref16) { - var callee = _ref16.callee, _arguments = _ref16.arguments; - return reducer.reduceCallExpression(node, { callee: callee(), arguments: _arguments.map(function(n) { - return n(); - }) }); - }, - reduceCatchClause: function reduceCatchClause(node, _ref17) { - var binding = _ref17.binding, body = _ref17.body; - return reducer.reduceCatchClause(node, { binding: binding(), body: body() }); - }, - reduceClassDeclaration: function reduceClassDeclaration(node, _ref18) { - var name = _ref18.name, _super = _ref18.super, elements = _ref18.elements; - return reducer.reduceClassDeclaration(node, { name: name(), super: _super == null ? null : _super(), elements: elements.map(function(n) { - return n(); - }) }); - }, - reduceClassElement: function reduceClassElement(node, _ref19) { - var method = _ref19.method; - return reducer.reduceClassElement(node, { method: method() }); - }, - reduceClassExpression: function reduceClassExpression(node, _ref20) { - var name = _ref20.name, _super = _ref20.super, elements = _ref20.elements; - return reducer.reduceClassExpression(node, { name: name == null ? null : name(), super: _super == null ? null : _super(), elements: elements.map(function(n) { - return n(); - }) }); - }, - reduceCompoundAssignmentExpression: function reduceCompoundAssignmentExpression(node, _ref21) { - var binding = _ref21.binding, expression = _ref21.expression; - return reducer.reduceCompoundAssignmentExpression(node, { binding: binding(), expression: expression() }); - }, - reduceComputedMemberAssignmentTarget: function reduceComputedMemberAssignmentTarget(node, _ref22) { - var object = _ref22.object, expression = _ref22.expression; - return reducer.reduceComputedMemberAssignmentTarget(node, { object: object(), expression: expression() }); - }, - reduceComputedMemberExpression: function reduceComputedMemberExpression(node, _ref23) { - var object = _ref23.object, expression = _ref23.expression; - return reducer.reduceComputedMemberExpression(node, { object: object(), expression: expression() }); - }, - reduceComputedPropertyName: function reduceComputedPropertyName(node, _ref24) { - var expression = _ref24.expression; - return reducer.reduceComputedPropertyName(node, { expression: expression() }); - }, - reduceConditionalExpression: function reduceConditionalExpression(node, _ref25) { - var test = _ref25.test, consequent = _ref25.consequent, alternate = _ref25.alternate; - return reducer.reduceConditionalExpression(node, { test: test(), consequent: consequent(), alternate: alternate() }); - }, - reduceContinueStatement: function reduceContinueStatement(node) { - return reducer.reduceContinueStatement(node); - }, - reduceDataProperty: function reduceDataProperty(node, _ref26) { - var name = _ref26.name, expression = _ref26.expression; - return reducer.reduceDataProperty(node, { name: name(), expression: expression() }); - }, - reduceDebuggerStatement: function reduceDebuggerStatement(node) { - return reducer.reduceDebuggerStatement(node); - }, - reduceDirective: function reduceDirective(node) { - return reducer.reduceDirective(node); - }, - reduceDoWhileStatement: function reduceDoWhileStatement(node, _ref27) { - var body = _ref27.body, test = _ref27.test; - return reducer.reduceDoWhileStatement(node, { body: body(), test: test() }); - }, - reduceEmptyStatement: function reduceEmptyStatement(node) { - return reducer.reduceEmptyStatement(node); - }, - reduceExport: function reduceExport(node, _ref28) { - var declaration = _ref28.declaration; - return reducer.reduceExport(node, { declaration: declaration() }); - }, - reduceExportAllFrom: function reduceExportAllFrom(node) { - return reducer.reduceExportAllFrom(node); - }, - reduceExportDefault: function reduceExportDefault(node, _ref29) { - var body = _ref29.body; - return reducer.reduceExportDefault(node, { body: body() }); - }, - reduceExportFrom: function reduceExportFrom(node, _ref30) { - var namedExports = _ref30.namedExports; - return reducer.reduceExportFrom(node, { namedExports: namedExports.map(function(n) { - return n(); - }) }); - }, - reduceExportFromSpecifier: function reduceExportFromSpecifier(node) { - return reducer.reduceExportFromSpecifier(node); - }, - reduceExportLocalSpecifier: function reduceExportLocalSpecifier(node, _ref31) { - var name = _ref31.name; - return reducer.reduceExportLocalSpecifier(node, { name: name() }); - }, - reduceExportLocals: function reduceExportLocals(node, _ref32) { - var namedExports = _ref32.namedExports; - return reducer.reduceExportLocals(node, { namedExports: namedExports.map(function(n) { - return n(); - }) }); - }, - reduceExpressionStatement: function reduceExpressionStatement(node, _ref33) { - var expression = _ref33.expression; - return reducer.reduceExpressionStatement(node, { expression: expression() }); - }, - reduceForAwaitStatement: function reduceForAwaitStatement(node, _ref34) { - var left = _ref34.left, right = _ref34.right, body = _ref34.body; - return reducer.reduceForAwaitStatement(node, { left: left(), right: right(), body: body() }); - }, - reduceForInStatement: function reduceForInStatement(node, _ref35) { - var left = _ref35.left, right = _ref35.right, body = _ref35.body; - return reducer.reduceForInStatement(node, { left: left(), right: right(), body: body() }); - }, - reduceForOfStatement: function reduceForOfStatement(node, _ref36) { - var left = _ref36.left, right = _ref36.right, body = _ref36.body; - return reducer.reduceForOfStatement(node, { left: left(), right: right(), body: body() }); - }, - reduceForStatement: function reduceForStatement(node, _ref37) { - var init = _ref37.init, test = _ref37.test, update = _ref37.update, body = _ref37.body; - return reducer.reduceForStatement(node, { init: init == null ? null : init(), test: test == null ? null : test(), update: update == null ? null : update(), body: body() }); - }, - reduceFormalParameters: function reduceFormalParameters(node, _ref38) { - var items = _ref38.items, rest = _ref38.rest; - return reducer.reduceFormalParameters(node, { items: items.map(function(n) { - return n(); - }), rest: rest == null ? null : rest() }); - }, - reduceFunctionBody: function reduceFunctionBody(node, _ref39) { - var directives = _ref39.directives, statements = _ref39.statements; - return reducer.reduceFunctionBody(node, { directives: directives.map(function(n) { - return n(); - }), statements: statements.map(function(n) { - return n(); - }) }); - }, - reduceFunctionDeclaration: function reduceFunctionDeclaration(node, _ref40) { - var name = _ref40.name, params = _ref40.params, body = _ref40.body; - return reducer.reduceFunctionDeclaration(node, { name: name(), params: params(), body: body() }); - }, - reduceFunctionExpression: function reduceFunctionExpression(node, _ref41) { - var name = _ref41.name, params = _ref41.params, body = _ref41.body; - return reducer.reduceFunctionExpression(node, { name: name == null ? null : name(), params: params(), body: body() }); - }, - reduceGetter: function reduceGetter(node, _ref42) { - var name = _ref42.name, body = _ref42.body; - return reducer.reduceGetter(node, { name: name(), body: body() }); - }, - reduceIdentifierExpression: function reduceIdentifierExpression(node) { - return reducer.reduceIdentifierExpression(node); - }, - reduceIfStatement: function reduceIfStatement(node, _ref43) { - var test = _ref43.test, consequent = _ref43.consequent, alternate = _ref43.alternate; - return reducer.reduceIfStatement(node, { test: test(), consequent: consequent(), alternate: alternate == null ? null : alternate() }); - }, - reduceImport: function reduceImport(node, _ref44) { - var defaultBinding = _ref44.defaultBinding, namedImports = _ref44.namedImports; - return reducer.reduceImport(node, { defaultBinding: defaultBinding == null ? null : defaultBinding(), namedImports: namedImports.map(function(n) { - return n(); - }) }); - }, - reduceImportNamespace: function reduceImportNamespace(node, _ref45) { - var defaultBinding = _ref45.defaultBinding, namespaceBinding = _ref45.namespaceBinding; - return reducer.reduceImportNamespace(node, { defaultBinding: defaultBinding == null ? null : defaultBinding(), namespaceBinding: namespaceBinding() }); - }, - reduceImportSpecifier: function reduceImportSpecifier(node, _ref46) { - var binding = _ref46.binding; - return reducer.reduceImportSpecifier(node, { binding: binding() }); - }, - reduceLabeledStatement: function reduceLabeledStatement(node, _ref47) { - var body = _ref47.body; - return reducer.reduceLabeledStatement(node, { body: body() }); - }, - reduceLiteralBooleanExpression: function reduceLiteralBooleanExpression(node) { - return reducer.reduceLiteralBooleanExpression(node); - }, - reduceLiteralInfinityExpression: function reduceLiteralInfinityExpression(node) { - return reducer.reduceLiteralInfinityExpression(node); - }, - reduceLiteralNullExpression: function reduceLiteralNullExpression(node) { - return reducer.reduceLiteralNullExpression(node); - }, - reduceLiteralNumericExpression: function reduceLiteralNumericExpression(node) { - return reducer.reduceLiteralNumericExpression(node); - }, - reduceLiteralRegExpExpression: function reduceLiteralRegExpExpression(node) { - return reducer.reduceLiteralRegExpExpression(node); - }, - reduceLiteralStringExpression: function reduceLiteralStringExpression(node) { - return reducer.reduceLiteralStringExpression(node); - }, - reduceMethod: function reduceMethod(node, _ref48) { - var name = _ref48.name, params = _ref48.params, body = _ref48.body; - return reducer.reduceMethod(node, { name: name(), params: params(), body: body() }); - }, - reduceModule: function reduceModule(node, _ref49) { - var directives = _ref49.directives, items = _ref49.items; - return reducer.reduceModule(node, { directives: directives.map(function(n) { - return n(); - }), items: items.map(function(n) { - return n(); - }) }); - }, - reduceNewExpression: function reduceNewExpression(node, _ref50) { - var callee = _ref50.callee, _arguments = _ref50.arguments; - return reducer.reduceNewExpression(node, { callee: callee(), arguments: _arguments.map(function(n) { - return n(); - }) }); - }, - reduceNewTargetExpression: function reduceNewTargetExpression(node) { - return reducer.reduceNewTargetExpression(node); - }, - reduceObjectAssignmentTarget: function reduceObjectAssignmentTarget(node, _ref51) { - var properties = _ref51.properties, rest = _ref51.rest; - return reducer.reduceObjectAssignmentTarget(node, { properties: properties.map(function(n) { - return n(); - }), rest: rest == null ? null : rest() }); - }, - reduceObjectBinding: function reduceObjectBinding(node, _ref52) { - var properties = _ref52.properties, rest = _ref52.rest; - return reducer.reduceObjectBinding(node, { properties: properties.map(function(n) { - return n(); - }), rest: rest == null ? null : rest() }); - }, - reduceObjectExpression: function reduceObjectExpression(node, _ref53) { - var properties = _ref53.properties; - return reducer.reduceObjectExpression(node, { properties: properties.map(function(n) { - return n(); - }) }); - }, - reduceReturnStatement: function reduceReturnStatement(node, _ref54) { - var expression = _ref54.expression; - return reducer.reduceReturnStatement(node, { expression: expression == null ? null : expression() }); - }, - reduceScript: function reduceScript(node, _ref55) { - var directives = _ref55.directives, statements = _ref55.statements; - return reducer.reduceScript(node, { directives: directives.map(function(n) { - return n(); - }), statements: statements.map(function(n) { - return n(); - }) }); - }, - reduceSetter: function reduceSetter(node, _ref56) { - var name = _ref56.name, param = _ref56.param, body = _ref56.body; - return reducer.reduceSetter(node, { name: name(), param: param(), body: body() }); - }, - reduceShorthandProperty: function reduceShorthandProperty(node, _ref57) { - var name = _ref57.name; - return reducer.reduceShorthandProperty(node, { name: name() }); - }, - reduceSpreadElement: function reduceSpreadElement(node, _ref58) { - var expression = _ref58.expression; - return reducer.reduceSpreadElement(node, { expression: expression() }); - }, - reduceSpreadProperty: function reduceSpreadProperty(node, _ref59) { - var expression = _ref59.expression; - return reducer.reduceSpreadProperty(node, { expression: expression() }); - }, - reduceStaticMemberAssignmentTarget: function reduceStaticMemberAssignmentTarget(node, _ref60) { - var object = _ref60.object; - return reducer.reduceStaticMemberAssignmentTarget(node, { object: object() }); - }, - reduceStaticMemberExpression: function reduceStaticMemberExpression(node, _ref61) { - var object = _ref61.object; - return reducer.reduceStaticMemberExpression(node, { object: object() }); - }, - reduceStaticPropertyName: function reduceStaticPropertyName(node) { - return reducer.reduceStaticPropertyName(node); - }, - reduceSuper: function reduceSuper(node) { - return reducer.reduceSuper(node); - }, - reduceSwitchCase: function reduceSwitchCase(node, _ref62) { - var test = _ref62.test, consequent = _ref62.consequent; - return reducer.reduceSwitchCase(node, { test: test(), consequent: consequent.map(function(n) { - return n(); - }) }); - }, - reduceSwitchDefault: function reduceSwitchDefault(node, _ref63) { - var consequent = _ref63.consequent; - return reducer.reduceSwitchDefault(node, { consequent: consequent.map(function(n) { - return n(); - }) }); - }, - reduceSwitchStatement: function reduceSwitchStatement(node, _ref64) { - var discriminant = _ref64.discriminant, cases = _ref64.cases; - return reducer.reduceSwitchStatement(node, { discriminant: discriminant(), cases: cases.map(function(n) { - return n(); - }) }); - }, - reduceSwitchStatementWithDefault: function reduceSwitchStatementWithDefault(node, _ref65) { - var discriminant = _ref65.discriminant, preDefaultCases = _ref65.preDefaultCases, defaultCase = _ref65.defaultCase, postDefaultCases = _ref65.postDefaultCases; - return reducer.reduceSwitchStatementWithDefault(node, { discriminant: discriminant(), preDefaultCases: preDefaultCases.map(function(n) { - return n(); - }), defaultCase: defaultCase(), postDefaultCases: postDefaultCases.map(function(n) { - return n(); - }) }); - }, - reduceTemplateElement: function reduceTemplateElement(node) { - return reducer.reduceTemplateElement(node); - }, - reduceTemplateExpression: function reduceTemplateExpression(node, _ref66) { - var tag = _ref66.tag, elements = _ref66.elements; - return reducer.reduceTemplateExpression(node, { tag: tag == null ? null : tag(), elements: elements.map(function(n) { - return n(); - }) }); - }, - reduceThisExpression: function reduceThisExpression(node) { - return reducer.reduceThisExpression(node); - }, - reduceThrowStatement: function reduceThrowStatement(node, _ref67) { - var expression = _ref67.expression; - return reducer.reduceThrowStatement(node, { expression: expression() }); - }, - reduceTryCatchStatement: function reduceTryCatchStatement(node, _ref68) { - var body = _ref68.body, catchClause = _ref68.catchClause; - return reducer.reduceTryCatchStatement(node, { body: body(), catchClause: catchClause() }); - }, - reduceTryFinallyStatement: function reduceTryFinallyStatement(node, _ref69) { - var body = _ref69.body, catchClause = _ref69.catchClause, finalizer = _ref69.finalizer; - return reducer.reduceTryFinallyStatement(node, { body: body(), catchClause: catchClause == null ? null : catchClause(), finalizer: finalizer() }); - }, - reduceUnaryExpression: function reduceUnaryExpression(node, _ref70) { - var operand = _ref70.operand; - return reducer.reduceUnaryExpression(node, { operand: operand() }); - }, - reduceUpdateExpression: function reduceUpdateExpression(node, _ref71) { - var operand = _ref71.operand; - return reducer.reduceUpdateExpression(node, { operand: operand() }); - }, - reduceVariableDeclaration: function reduceVariableDeclaration(node, _ref72) { - var declarators = _ref72.declarators; - return reducer.reduceVariableDeclaration(node, { declarators: declarators.map(function(n) { - return n(); - }) }); - }, - reduceVariableDeclarationStatement: function reduceVariableDeclarationStatement(node, _ref73) { - var declaration = _ref73.declaration; - return reducer.reduceVariableDeclarationStatement(node, { declaration: declaration() }); - }, - reduceVariableDeclarator: function reduceVariableDeclarator(node, _ref74) { - var binding = _ref74.binding, init = _ref74.init; - return reducer.reduceVariableDeclarator(node, { binding: binding(), init: init == null ? null : init() }); - }, - reduceWhileStatement: function reduceWhileStatement(node, _ref75) { - var test = _ref75.test, body = _ref75.body; - return reducer.reduceWhileStatement(node, { test: test(), body: body() }); - }, - reduceWithStatement: function reduceWithStatement(node, _ref76) { - var object = _ref76.object, body = _ref76.body; - return reducer.reduceWithStatement(node, { object: object(), body: body() }); - }, - reduceYieldExpression: function reduceYieldExpression(node, _ref77) { - var expression = _ref77.expression; - return reducer.reduceYieldExpression(node, { expression: expression == null ? null : expression() }); - }, - reduceYieldGeneratorExpression: function reduceYieldGeneratorExpression(node, _ref78) { - var expression = _ref78.expression; - return reducer.reduceYieldGeneratorExpression(node, { expression: expression() }); - } - }; -} -const thunkify$1 = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - default: _default$a -}, [thunkify$2]); -const require$$2$3 = /* @__PURE__ */ getAugmentedNamespace(thunkify$1); -var thunkifyClass$2 = {}; -Object.defineProperty(thunkifyClass$2, "__esModule", { - value: true -}); -var _createClass$b = function() { - function defineProperties(target, props) { - for (var i2 = 0; i2 < props.length; i2++) { - var descriptor = props[i2]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - return function(Constructor, protoProps, staticProps) { - if (protoProps) - defineProperties(Constructor.prototype, protoProps); - if (staticProps) - defineProperties(Constructor, staticProps); - return Constructor; - }; -}(); -var _get$3 = function get(object, property, receiver) { - if (object === null) - object = Function.prototype; - var desc = Object.getOwnPropertyDescriptor(object, property); - if (desc === void 0) { - var parent = Object.getPrototypeOf(object); - if (parent === null) { - return void 0; - } else { - return get(parent, property, receiver); - } - } else if ("value" in desc) { - return desc.value; - } else { - var getter = desc.get; - if (getter === void 0) { - return void 0; - } - return getter.call(receiver); - } -}; -var _default$9 = thunkifyClass$2.default = thunkifyClass; -function _classCallCheck$e(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} -function _possibleConstructorReturn$6(self, call) { - if (!self) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return call && (typeof call === "object" || typeof call === "function") ? call : self; -} -function _inherits$6(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); - if (superClass) - Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; -} -function thunkifyClass(reducerClass) { - return function(_reducerClass) { - _inherits$6(_class, _reducerClass); - function _class() { - _classCallCheck$e(this, _class); - return _possibleConstructorReturn$6(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments)); - } - _createClass$b(_class, [{ - key: "reduceArrayAssignmentTarget", - value: function reduceArrayAssignmentTarget(node, _ref) { - var elements = _ref.elements, rest = _ref.rest; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceArrayAssignmentTarget", this).call(this, node, { elements: elements.map(function(n) { - return n == null ? null : n(); - }), rest: rest == null ? null : rest() }); - } - }, { - key: "reduceArrayBinding", - value: function reduceArrayBinding(node, _ref2) { - var elements = _ref2.elements, rest = _ref2.rest; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceArrayBinding", this).call(this, node, { elements: elements.map(function(n) { - return n == null ? null : n(); - }), rest: rest == null ? null : rest() }); - } - }, { - key: "reduceArrayExpression", - value: function reduceArrayExpression(node, _ref3) { - var elements = _ref3.elements; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceArrayExpression", this).call(this, node, { elements: elements.map(function(n) { - return n == null ? null : n(); - }) }); - } - }, { - key: "reduceArrowExpression", - value: function reduceArrowExpression(node, _ref4) { - var params = _ref4.params, body = _ref4.body; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceArrowExpression", this).call(this, node, { params: params(), body: body() }); - } - }, { - key: "reduceAssignmentExpression", - value: function reduceAssignmentExpression(node, _ref5) { - var binding = _ref5.binding, expression = _ref5.expression; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceAssignmentExpression", this).call(this, node, { binding: binding(), expression: expression() }); - } - }, { - key: "reduceAssignmentTargetIdentifier", - value: function reduceAssignmentTargetIdentifier(node) { - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceAssignmentTargetIdentifier", this).call(this, node); - } - }, { - key: "reduceAssignmentTargetPropertyIdentifier", - value: function reduceAssignmentTargetPropertyIdentifier(node, _ref6) { - var binding = _ref6.binding, init = _ref6.init; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceAssignmentTargetPropertyIdentifier", this).call(this, node, { binding: binding(), init: init == null ? null : init() }); - } - }, { - key: "reduceAssignmentTargetPropertyProperty", - value: function reduceAssignmentTargetPropertyProperty(node, _ref7) { - var name = _ref7.name, binding = _ref7.binding; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceAssignmentTargetPropertyProperty", this).call(this, node, { name: name(), binding: binding() }); - } - }, { - key: "reduceAssignmentTargetWithDefault", - value: function reduceAssignmentTargetWithDefault(node, _ref8) { - var binding = _ref8.binding, init = _ref8.init; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceAssignmentTargetWithDefault", this).call(this, node, { binding: binding(), init: init() }); - } - }, { - key: "reduceAwaitExpression", - value: function reduceAwaitExpression(node, _ref9) { - var expression = _ref9.expression; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceAwaitExpression", this).call(this, node, { expression: expression() }); - } - }, { - key: "reduceBinaryExpression", - value: function reduceBinaryExpression(node, _ref10) { - var left = _ref10.left, right = _ref10.right; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceBinaryExpression", this).call(this, node, { left: left(), right: right() }); - } - }, { - key: "reduceBindingIdentifier", - value: function reduceBindingIdentifier(node) { - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceBindingIdentifier", this).call(this, node); - } - }, { - key: "reduceBindingPropertyIdentifier", - value: function reduceBindingPropertyIdentifier(node, _ref11) { - var binding = _ref11.binding, init = _ref11.init; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceBindingPropertyIdentifier", this).call(this, node, { binding: binding(), init: init == null ? null : init() }); - } - }, { - key: "reduceBindingPropertyProperty", - value: function reduceBindingPropertyProperty(node, _ref12) { - var name = _ref12.name, binding = _ref12.binding; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceBindingPropertyProperty", this).call(this, node, { name: name(), binding: binding() }); - } - }, { - key: "reduceBindingWithDefault", - value: function reduceBindingWithDefault(node, _ref13) { - var binding = _ref13.binding, init = _ref13.init; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceBindingWithDefault", this).call(this, node, { binding: binding(), init: init() }); - } - }, { - key: "reduceBlock", - value: function reduceBlock(node, _ref14) { - var statements = _ref14.statements; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceBlock", this).call(this, node, { statements: statements.map(function(n) { - return n(); - }) }); - } - }, { - key: "reduceBlockStatement", - value: function reduceBlockStatement(node, _ref15) { - var block = _ref15.block; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceBlockStatement", this).call(this, node, { block: block() }); - } - }, { - key: "reduceBreakStatement", - value: function reduceBreakStatement(node) { - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceBreakStatement", this).call(this, node); - } - }, { - key: "reduceCallExpression", - value: function reduceCallExpression(node, _ref16) { - var callee = _ref16.callee, _arguments = _ref16.arguments; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceCallExpression", this).call(this, node, { callee: callee(), arguments: _arguments.map(function(n) { - return n(); - }) }); - } - }, { - key: "reduceCatchClause", - value: function reduceCatchClause(node, _ref17) { - var binding = _ref17.binding, body = _ref17.body; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceCatchClause", this).call(this, node, { binding: binding(), body: body() }); - } - }, { - key: "reduceClassDeclaration", - value: function reduceClassDeclaration(node, _ref18) { - var name = _ref18.name, _super = _ref18.super, elements = _ref18.elements; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceClassDeclaration", this).call(this, node, { name: name(), super: _super == null ? null : _super(), elements: elements.map(function(n) { - return n(); - }) }); - } - }, { - key: "reduceClassElement", - value: function reduceClassElement(node, _ref19) { - var method = _ref19.method; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceClassElement", this).call(this, node, { method: method() }); - } - }, { - key: "reduceClassExpression", - value: function reduceClassExpression(node, _ref20) { - var name = _ref20.name, _super = _ref20.super, elements = _ref20.elements; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceClassExpression", this).call(this, node, { name: name == null ? null : name(), super: _super == null ? null : _super(), elements: elements.map(function(n) { - return n(); - }) }); - } - }, { - key: "reduceCompoundAssignmentExpression", - value: function reduceCompoundAssignmentExpression(node, _ref21) { - var binding = _ref21.binding, expression = _ref21.expression; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceCompoundAssignmentExpression", this).call(this, node, { binding: binding(), expression: expression() }); - } - }, { - key: "reduceComputedMemberAssignmentTarget", - value: function reduceComputedMemberAssignmentTarget(node, _ref22) { - var object = _ref22.object, expression = _ref22.expression; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceComputedMemberAssignmentTarget", this).call(this, node, { object: object(), expression: expression() }); - } - }, { - key: "reduceComputedMemberExpression", - value: function reduceComputedMemberExpression(node, _ref23) { - var object = _ref23.object, expression = _ref23.expression; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceComputedMemberExpression", this).call(this, node, { object: object(), expression: expression() }); - } - }, { - key: "reduceComputedPropertyName", - value: function reduceComputedPropertyName(node, _ref24) { - var expression = _ref24.expression; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceComputedPropertyName", this).call(this, node, { expression: expression() }); - } - }, { - key: "reduceConditionalExpression", - value: function reduceConditionalExpression(node, _ref25) { - var test = _ref25.test, consequent = _ref25.consequent, alternate = _ref25.alternate; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceConditionalExpression", this).call(this, node, { test: test(), consequent: consequent(), alternate: alternate() }); - } - }, { - key: "reduceContinueStatement", - value: function reduceContinueStatement(node) { - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceContinueStatement", this).call(this, node); - } - }, { - key: "reduceDataProperty", - value: function reduceDataProperty(node, _ref26) { - var name = _ref26.name, expression = _ref26.expression; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceDataProperty", this).call(this, node, { name: name(), expression: expression() }); - } - }, { - key: "reduceDebuggerStatement", - value: function reduceDebuggerStatement(node) { - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceDebuggerStatement", this).call(this, node); - } - }, { - key: "reduceDirective", - value: function reduceDirective(node) { - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceDirective", this).call(this, node); - } - }, { - key: "reduceDoWhileStatement", - value: function reduceDoWhileStatement(node, _ref27) { - var body = _ref27.body, test = _ref27.test; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceDoWhileStatement", this).call(this, node, { body: body(), test: test() }); - } - }, { - key: "reduceEmptyStatement", - value: function reduceEmptyStatement(node) { - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceEmptyStatement", this).call(this, node); - } - }, { - key: "reduceExport", - value: function reduceExport(node, _ref28) { - var declaration = _ref28.declaration; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceExport", this).call(this, node, { declaration: declaration() }); - } - }, { - key: "reduceExportAllFrom", - value: function reduceExportAllFrom(node) { - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceExportAllFrom", this).call(this, node); - } - }, { - key: "reduceExportDefault", - value: function reduceExportDefault(node, _ref29) { - var body = _ref29.body; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceExportDefault", this).call(this, node, { body: body() }); - } - }, { - key: "reduceExportFrom", - value: function reduceExportFrom(node, _ref30) { - var namedExports = _ref30.namedExports; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceExportFrom", this).call(this, node, { namedExports: namedExports.map(function(n) { - return n(); - }) }); - } - }, { - key: "reduceExportFromSpecifier", - value: function reduceExportFromSpecifier(node) { - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceExportFromSpecifier", this).call(this, node); - } - }, { - key: "reduceExportLocalSpecifier", - value: function reduceExportLocalSpecifier(node, _ref31) { - var name = _ref31.name; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceExportLocalSpecifier", this).call(this, node, { name: name() }); - } - }, { - key: "reduceExportLocals", - value: function reduceExportLocals(node, _ref32) { - var namedExports = _ref32.namedExports; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceExportLocals", this).call(this, node, { namedExports: namedExports.map(function(n) { - return n(); - }) }); - } - }, { - key: "reduceExpressionStatement", - value: function reduceExpressionStatement(node, _ref33) { - var expression = _ref33.expression; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceExpressionStatement", this).call(this, node, { expression: expression() }); - } - }, { - key: "reduceForAwaitStatement", - value: function reduceForAwaitStatement(node, _ref34) { - var left = _ref34.left, right = _ref34.right, body = _ref34.body; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceForAwaitStatement", this).call(this, node, { left: left(), right: right(), body: body() }); - } - }, { - key: "reduceForInStatement", - value: function reduceForInStatement(node, _ref35) { - var left = _ref35.left, right = _ref35.right, body = _ref35.body; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceForInStatement", this).call(this, node, { left: left(), right: right(), body: body() }); - } - }, { - key: "reduceForOfStatement", - value: function reduceForOfStatement(node, _ref36) { - var left = _ref36.left, right = _ref36.right, body = _ref36.body; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceForOfStatement", this).call(this, node, { left: left(), right: right(), body: body() }); - } - }, { - key: "reduceForStatement", - value: function reduceForStatement(node, _ref37) { - var init = _ref37.init, test = _ref37.test, update = _ref37.update, body = _ref37.body; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceForStatement", this).call(this, node, { init: init == null ? null : init(), test: test == null ? null : test(), update: update == null ? null : update(), body: body() }); - } - }, { - key: "reduceFormalParameters", - value: function reduceFormalParameters(node, _ref38) { - var items = _ref38.items, rest = _ref38.rest; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceFormalParameters", this).call(this, node, { items: items.map(function(n) { - return n(); - }), rest: rest == null ? null : rest() }); - } - }, { - key: "reduceFunctionBody", - value: function reduceFunctionBody(node, _ref39) { - var directives = _ref39.directives, statements = _ref39.statements; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceFunctionBody", this).call(this, node, { directives: directives.map(function(n) { - return n(); - }), statements: statements.map(function(n) { - return n(); - }) }); - } - }, { - key: "reduceFunctionDeclaration", - value: function reduceFunctionDeclaration(node, _ref40) { - var name = _ref40.name, params = _ref40.params, body = _ref40.body; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceFunctionDeclaration", this).call(this, node, { name: name(), params: params(), body: body() }); - } - }, { - key: "reduceFunctionExpression", - value: function reduceFunctionExpression(node, _ref41) { - var name = _ref41.name, params = _ref41.params, body = _ref41.body; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceFunctionExpression", this).call(this, node, { name: name == null ? null : name(), params: params(), body: body() }); - } - }, { - key: "reduceGetter", - value: function reduceGetter(node, _ref42) { - var name = _ref42.name, body = _ref42.body; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceGetter", this).call(this, node, { name: name(), body: body() }); - } - }, { - key: "reduceIdentifierExpression", - value: function reduceIdentifierExpression(node) { - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceIdentifierExpression", this).call(this, node); - } - }, { - key: "reduceIfStatement", - value: function reduceIfStatement(node, _ref43) { - var test = _ref43.test, consequent = _ref43.consequent, alternate = _ref43.alternate; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceIfStatement", this).call(this, node, { test: test(), consequent: consequent(), alternate: alternate == null ? null : alternate() }); - } - }, { - key: "reduceImport", - value: function reduceImport(node, _ref44) { - var defaultBinding = _ref44.defaultBinding, namedImports = _ref44.namedImports; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceImport", this).call(this, node, { defaultBinding: defaultBinding == null ? null : defaultBinding(), namedImports: namedImports.map(function(n) { - return n(); - }) }); - } - }, { - key: "reduceImportNamespace", - value: function reduceImportNamespace(node, _ref45) { - var defaultBinding = _ref45.defaultBinding, namespaceBinding = _ref45.namespaceBinding; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceImportNamespace", this).call(this, node, { defaultBinding: defaultBinding == null ? null : defaultBinding(), namespaceBinding: namespaceBinding() }); - } - }, { - key: "reduceImportSpecifier", - value: function reduceImportSpecifier(node, _ref46) { - var binding = _ref46.binding; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceImportSpecifier", this).call(this, node, { binding: binding() }); - } - }, { - key: "reduceLabeledStatement", - value: function reduceLabeledStatement(node, _ref47) { - var body = _ref47.body; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceLabeledStatement", this).call(this, node, { body: body() }); - } - }, { - key: "reduceLiteralBooleanExpression", - value: function reduceLiteralBooleanExpression(node) { - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceLiteralBooleanExpression", this).call(this, node); - } - }, { - key: "reduceLiteralInfinityExpression", - value: function reduceLiteralInfinityExpression(node) { - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceLiteralInfinityExpression", this).call(this, node); - } - }, { - key: "reduceLiteralNullExpression", - value: function reduceLiteralNullExpression(node) { - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceLiteralNullExpression", this).call(this, node); - } - }, { - key: "reduceLiteralNumericExpression", - value: function reduceLiteralNumericExpression(node) { - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceLiteralNumericExpression", this).call(this, node); - } - }, { - key: "reduceLiteralRegExpExpression", - value: function reduceLiteralRegExpExpression(node) { - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceLiteralRegExpExpression", this).call(this, node); - } - }, { - key: "reduceLiteralStringExpression", - value: function reduceLiteralStringExpression(node) { - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceLiteralStringExpression", this).call(this, node); - } - }, { - key: "reduceMethod", - value: function reduceMethod(node, _ref48) { - var name = _ref48.name, params = _ref48.params, body = _ref48.body; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceMethod", this).call(this, node, { name: name(), params: params(), body: body() }); - } - }, { - key: "reduceModule", - value: function reduceModule(node, _ref49) { - var directives = _ref49.directives, items = _ref49.items; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceModule", this).call(this, node, { directives: directives.map(function(n) { - return n(); - }), items: items.map(function(n) { - return n(); - }) }); - } - }, { - key: "reduceNewExpression", - value: function reduceNewExpression(node, _ref50) { - var callee = _ref50.callee, _arguments = _ref50.arguments; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceNewExpression", this).call(this, node, { callee: callee(), arguments: _arguments.map(function(n) { - return n(); - }) }); - } - }, { - key: "reduceNewTargetExpression", - value: function reduceNewTargetExpression(node) { - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceNewTargetExpression", this).call(this, node); - } - }, { - key: "reduceObjectAssignmentTarget", - value: function reduceObjectAssignmentTarget(node, _ref51) { - var properties = _ref51.properties, rest = _ref51.rest; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceObjectAssignmentTarget", this).call(this, node, { properties: properties.map(function(n) { - return n(); - }), rest: rest == null ? null : rest() }); - } - }, { - key: "reduceObjectBinding", - value: function reduceObjectBinding(node, _ref52) { - var properties = _ref52.properties, rest = _ref52.rest; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceObjectBinding", this).call(this, node, { properties: properties.map(function(n) { - return n(); - }), rest: rest == null ? null : rest() }); - } - }, { - key: "reduceObjectExpression", - value: function reduceObjectExpression(node, _ref53) { - var properties = _ref53.properties; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceObjectExpression", this).call(this, node, { properties: properties.map(function(n) { - return n(); - }) }); - } - }, { - key: "reduceReturnStatement", - value: function reduceReturnStatement(node, _ref54) { - var expression = _ref54.expression; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceReturnStatement", this).call(this, node, { expression: expression == null ? null : expression() }); - } - }, { - key: "reduceScript", - value: function reduceScript(node, _ref55) { - var directives = _ref55.directives, statements = _ref55.statements; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceScript", this).call(this, node, { directives: directives.map(function(n) { - return n(); - }), statements: statements.map(function(n) { - return n(); - }) }); - } - }, { - key: "reduceSetter", - value: function reduceSetter(node, _ref56) { - var name = _ref56.name, param = _ref56.param, body = _ref56.body; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceSetter", this).call(this, node, { name: name(), param: param(), body: body() }); - } - }, { - key: "reduceShorthandProperty", - value: function reduceShorthandProperty(node, _ref57) { - var name = _ref57.name; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceShorthandProperty", this).call(this, node, { name: name() }); - } - }, { - key: "reduceSpreadElement", - value: function reduceSpreadElement(node, _ref58) { - var expression = _ref58.expression; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceSpreadElement", this).call(this, node, { expression: expression() }); - } - }, { - key: "reduceSpreadProperty", - value: function reduceSpreadProperty(node, _ref59) { - var expression = _ref59.expression; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceSpreadProperty", this).call(this, node, { expression: expression() }); - } - }, { - key: "reduceStaticMemberAssignmentTarget", - value: function reduceStaticMemberAssignmentTarget(node, _ref60) { - var object = _ref60.object; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceStaticMemberAssignmentTarget", this).call(this, node, { object: object() }); - } - }, { - key: "reduceStaticMemberExpression", - value: function reduceStaticMemberExpression(node, _ref61) { - var object = _ref61.object; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceStaticMemberExpression", this).call(this, node, { object: object() }); - } - }, { - key: "reduceStaticPropertyName", - value: function reduceStaticPropertyName(node) { - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceStaticPropertyName", this).call(this, node); - } - }, { - key: "reduceSuper", - value: function reduceSuper(node) { - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceSuper", this).call(this, node); - } - }, { - key: "reduceSwitchCase", - value: function reduceSwitchCase(node, _ref62) { - var test = _ref62.test, consequent = _ref62.consequent; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceSwitchCase", this).call(this, node, { test: test(), consequent: consequent.map(function(n) { - return n(); - }) }); - } - }, { - key: "reduceSwitchDefault", - value: function reduceSwitchDefault(node, _ref63) { - var consequent = _ref63.consequent; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceSwitchDefault", this).call(this, node, { consequent: consequent.map(function(n) { - return n(); - }) }); - } - }, { - key: "reduceSwitchStatement", - value: function reduceSwitchStatement(node, _ref64) { - var discriminant = _ref64.discriminant, cases = _ref64.cases; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceSwitchStatement", this).call(this, node, { discriminant: discriminant(), cases: cases.map(function(n) { - return n(); - }) }); - } - }, { - key: "reduceSwitchStatementWithDefault", - value: function reduceSwitchStatementWithDefault(node, _ref65) { - var discriminant = _ref65.discriminant, preDefaultCases = _ref65.preDefaultCases, defaultCase = _ref65.defaultCase, postDefaultCases = _ref65.postDefaultCases; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceSwitchStatementWithDefault", this).call(this, node, { discriminant: discriminant(), preDefaultCases: preDefaultCases.map(function(n) { - return n(); - }), defaultCase: defaultCase(), postDefaultCases: postDefaultCases.map(function(n) { - return n(); - }) }); - } - }, { - key: "reduceTemplateElement", - value: function reduceTemplateElement(node) { - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceTemplateElement", this).call(this, node); - } - }, { - key: "reduceTemplateExpression", - value: function reduceTemplateExpression(node, _ref66) { - var tag = _ref66.tag, elements = _ref66.elements; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceTemplateExpression", this).call(this, node, { tag: tag == null ? null : tag(), elements: elements.map(function(n) { - return n(); - }) }); - } - }, { - key: "reduceThisExpression", - value: function reduceThisExpression(node) { - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceThisExpression", this).call(this, node); - } - }, { - key: "reduceThrowStatement", - value: function reduceThrowStatement(node, _ref67) { - var expression = _ref67.expression; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceThrowStatement", this).call(this, node, { expression: expression() }); - } - }, { - key: "reduceTryCatchStatement", - value: function reduceTryCatchStatement(node, _ref68) { - var body = _ref68.body, catchClause = _ref68.catchClause; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceTryCatchStatement", this).call(this, node, { body: body(), catchClause: catchClause() }); - } - }, { - key: "reduceTryFinallyStatement", - value: function reduceTryFinallyStatement(node, _ref69) { - var body = _ref69.body, catchClause = _ref69.catchClause, finalizer = _ref69.finalizer; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceTryFinallyStatement", this).call(this, node, { body: body(), catchClause: catchClause == null ? null : catchClause(), finalizer: finalizer() }); - } - }, { - key: "reduceUnaryExpression", - value: function reduceUnaryExpression(node, _ref70) { - var operand = _ref70.operand; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceUnaryExpression", this).call(this, node, { operand: operand() }); - } - }, { - key: "reduceUpdateExpression", - value: function reduceUpdateExpression(node, _ref71) { - var operand = _ref71.operand; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceUpdateExpression", this).call(this, node, { operand: operand() }); - } - }, { - key: "reduceVariableDeclaration", - value: function reduceVariableDeclaration(node, _ref72) { - var declarators = _ref72.declarators; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceVariableDeclaration", this).call(this, node, { declarators: declarators.map(function(n) { - return n(); - }) }); - } - }, { - key: "reduceVariableDeclarationStatement", - value: function reduceVariableDeclarationStatement(node, _ref73) { - var declaration = _ref73.declaration; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceVariableDeclarationStatement", this).call(this, node, { declaration: declaration() }); - } - }, { - key: "reduceVariableDeclarator", - value: function reduceVariableDeclarator(node, _ref74) { - var binding = _ref74.binding, init = _ref74.init; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceVariableDeclarator", this).call(this, node, { binding: binding(), init: init == null ? null : init() }); - } - }, { - key: "reduceWhileStatement", - value: function reduceWhileStatement(node, _ref75) { - var test = _ref75.test, body = _ref75.body; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceWhileStatement", this).call(this, node, { test: test(), body: body() }); - } - }, { - key: "reduceWithStatement", - value: function reduceWithStatement(node, _ref76) { - var object = _ref76.object, body = _ref76.body; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceWithStatement", this).call(this, node, { object: object(), body: body() }); - } - }, { - key: "reduceYieldExpression", - value: function reduceYieldExpression(node, _ref77) { - var expression = _ref77.expression; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceYieldExpression", this).call(this, node, { expression: expression == null ? null : expression() }); - } - }, { - key: "reduceYieldGeneratorExpression", - value: function reduceYieldGeneratorExpression(node, _ref78) { - var expression = _ref78.expression; - return _get$3(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), "reduceYieldGeneratorExpression", this).call(this, node, { expression: expression() }); - } - }]); - return _class; - }(reducerClass); -} -const thunkifyClass$1 = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - default: _default$9 -}, [thunkifyClass$2]); -const require$$3$2 = /* @__PURE__ */ getAugmentedNamespace(thunkifyClass$1); -var memoize$2 = {}; -var dist$5 = {}; -var YieldGeneratorExpression_1; -var YieldExpression_1; -var WithStatement_1; -var WhileStatement_1; -var VariableDeclarator_1; -var VariableDeclarationStatement_1; -var VariableDeclaration_1; -var UpdateExpression_1; -var UnaryExpression_1; -var TryFinallyStatement_1; -var TryCatchStatement_1; -var ThrowStatement_1; -var ThisExpression_1; -var TemplateExpression_1; -var TemplateElement_1; -var SwitchStatementWithDefault_1; -var SwitchStatement_1; -var SwitchDefault_1; -var SwitchCase_1; -var Super_1; -var StaticPropertyName_1; -var StaticMemberExpression_1; -var StaticMemberAssignmentTarget_1; -var SpreadProperty_1; -var SpreadElement_1; -var ShorthandProperty_1; -var Setter_1; -var Script_1; -var ReturnStatement_1; -var ObjectExpression_1; -var ObjectBinding_1; -var ObjectAssignmentTarget_1; -var NewTargetExpression_1; -var NewExpression_1; -var Module_1; -var Method_1; -var LiteralStringExpression_1; -var LiteralRegExpExpression_1; -var LiteralNumericExpression_1; -var LiteralNullExpression_1; -var LiteralInfinityExpression_1; -var LiteralBooleanExpression_1; -var LabeledStatement_1; -var ImportSpecifier_1; -var ImportNamespace_1; -var Import_1; -var IfStatement_1; -var IdentifierExpression_1; -var Getter_1; -var FunctionExpression_1; -var FunctionDeclaration_1; -var FunctionBody_1; -var FormalParameters_1; -var ForStatement_1; -var ForOfStatement_1; -var ForInStatement_1; -var ForAwaitStatement_1; -var ExpressionStatement_1; -var ExportLocals_1; -var ExportLocalSpecifier_1; -var ExportFromSpecifier_1; -var ExportFrom_1; -var ExportDefault_1; -var ExportAllFrom_1; -var Export_1; -var EmptyStatement_1; -var DoWhileStatement_1; -var Directive_1; -var DebuggerStatement_1; -var DataProperty_1; -var ContinueStatement_1; -var ConditionalExpression_1; -var ComputedPropertyName_1; -var ComputedMemberExpression_1; -var ComputedMemberAssignmentTarget_1; -var CompoundAssignmentExpression_1; -var ClassExpression_1; -var ClassElement_1; -var ClassDeclaration_1; -var CatchClause_1; -var CallExpression_1; -var BreakStatement_1; -var BlockStatement_1; -var Block_1; -var BindingWithDefault_1; -var BindingPropertyProperty_1; -var BindingPropertyIdentifier_1; -var BindingIdentifier_1; -var BinaryExpression_1; -var AwaitExpression_1; -var AssignmentTargetWithDefault_1; -var AssignmentTargetPropertyProperty_1; -var AssignmentTargetPropertyIdentifier_1; -var AssignmentTargetIdentifier_1; -var AssignmentExpression_1; -var ArrowExpression_1; -var ArrayExpression_1; -var ArrayBinding_1; -var ArrayAssignmentTarget_1; -Object.defineProperty(dist$5, "__esModule", { - value: true -}); -function _classCallCheck$d(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} -ArrayAssignmentTarget_1 = dist$5.ArrayAssignmentTarget = function ArrayAssignmentTarget4(_ref) { - var elements = _ref.elements, rest = _ref.rest; - _classCallCheck$d(this, ArrayAssignmentTarget4); - this.type = "ArrayAssignmentTarget"; - this.elements = elements; - this.rest = rest; -}; -ArrayBinding_1 = dist$5.ArrayBinding = function ArrayBinding4(_ref2) { - var elements = _ref2.elements, rest = _ref2.rest; - _classCallCheck$d(this, ArrayBinding4); - this.type = "ArrayBinding"; - this.elements = elements; - this.rest = rest; -}; -ArrayExpression_1 = dist$5.ArrayExpression = function ArrayExpression4(_ref3) { - var elements = _ref3.elements; - _classCallCheck$d(this, ArrayExpression4); - this.type = "ArrayExpression"; - this.elements = elements; -}; -ArrowExpression_1 = dist$5.ArrowExpression = function ArrowExpression4(_ref4) { - var isAsync = _ref4.isAsync, params = _ref4.params, body = _ref4.body; - _classCallCheck$d(this, ArrowExpression4); - this.type = "ArrowExpression"; - this.isAsync = isAsync; - this.params = params; - this.body = body; -}; -AssignmentExpression_1 = dist$5.AssignmentExpression = function AssignmentExpression4(_ref5) { - var binding = _ref5.binding, expression = _ref5.expression; - _classCallCheck$d(this, AssignmentExpression4); - this.type = "AssignmentExpression"; - this.binding = binding; - this.expression = expression; -}; -AssignmentTargetIdentifier_1 = dist$5.AssignmentTargetIdentifier = function AssignmentTargetIdentifier4(_ref6) { - var name = _ref6.name; - _classCallCheck$d(this, AssignmentTargetIdentifier4); - this.type = "AssignmentTargetIdentifier"; - this.name = name; -}; -AssignmentTargetPropertyIdentifier_1 = dist$5.AssignmentTargetPropertyIdentifier = function AssignmentTargetPropertyIdentifier4(_ref7) { - var binding = _ref7.binding, init = _ref7.init; - _classCallCheck$d(this, AssignmentTargetPropertyIdentifier4); - this.type = "AssignmentTargetPropertyIdentifier"; - this.binding = binding; - this.init = init; -}; -AssignmentTargetPropertyProperty_1 = dist$5.AssignmentTargetPropertyProperty = function AssignmentTargetPropertyProperty4(_ref8) { - var name = _ref8.name, binding = _ref8.binding; - _classCallCheck$d(this, AssignmentTargetPropertyProperty4); - this.type = "AssignmentTargetPropertyProperty"; - this.name = name; - this.binding = binding; -}; -AssignmentTargetWithDefault_1 = dist$5.AssignmentTargetWithDefault = function AssignmentTargetWithDefault4(_ref9) { - var binding = _ref9.binding, init = _ref9.init; - _classCallCheck$d(this, AssignmentTargetWithDefault4); - this.type = "AssignmentTargetWithDefault"; - this.binding = binding; - this.init = init; -}; -AwaitExpression_1 = dist$5.AwaitExpression = function AwaitExpression4(_ref10) { - var expression = _ref10.expression; - _classCallCheck$d(this, AwaitExpression4); - this.type = "AwaitExpression"; - this.expression = expression; -}; -BinaryExpression_1 = dist$5.BinaryExpression = function BinaryExpression4(_ref11) { - var left = _ref11.left, operator = _ref11.operator, right = _ref11.right; - _classCallCheck$d(this, BinaryExpression4); - this.type = "BinaryExpression"; - this.left = left; - this.operator = operator; - this.right = right; -}; -BindingIdentifier_1 = dist$5.BindingIdentifier = function BindingIdentifier4(_ref12) { - var name = _ref12.name; - _classCallCheck$d(this, BindingIdentifier4); - this.type = "BindingIdentifier"; - this.name = name; -}; -BindingPropertyIdentifier_1 = dist$5.BindingPropertyIdentifier = function BindingPropertyIdentifier4(_ref13) { - var binding = _ref13.binding, init = _ref13.init; - _classCallCheck$d(this, BindingPropertyIdentifier4); - this.type = "BindingPropertyIdentifier"; - this.binding = binding; - this.init = init; -}; -BindingPropertyProperty_1 = dist$5.BindingPropertyProperty = function BindingPropertyProperty4(_ref14) { - var name = _ref14.name, binding = _ref14.binding; - _classCallCheck$d(this, BindingPropertyProperty4); - this.type = "BindingPropertyProperty"; - this.name = name; - this.binding = binding; -}; -BindingWithDefault_1 = dist$5.BindingWithDefault = function BindingWithDefault4(_ref15) { - var binding = _ref15.binding, init = _ref15.init; - _classCallCheck$d(this, BindingWithDefault4); - this.type = "BindingWithDefault"; - this.binding = binding; - this.init = init; -}; -Block_1 = dist$5.Block = function Block4(_ref16) { - var statements = _ref16.statements; - _classCallCheck$d(this, Block4); - this.type = "Block"; - this.statements = statements; -}; -BlockStatement_1 = dist$5.BlockStatement = function BlockStatement4(_ref17) { - var block = _ref17.block; - _classCallCheck$d(this, BlockStatement4); - this.type = "BlockStatement"; - this.block = block; -}; -BreakStatement_1 = dist$5.BreakStatement = function BreakStatement4(_ref18) { - var label = _ref18.label; - _classCallCheck$d(this, BreakStatement4); - this.type = "BreakStatement"; - this.label = label; -}; -CallExpression_1 = dist$5.CallExpression = function CallExpression4(_ref19) { - var callee = _ref19.callee, _arguments = _ref19.arguments; - _classCallCheck$d(this, CallExpression4); - this.type = "CallExpression"; - this.callee = callee; - this.arguments = _arguments; -}; -CatchClause_1 = dist$5.CatchClause = function CatchClause4(_ref20) { - var binding = _ref20.binding, body = _ref20.body; - _classCallCheck$d(this, CatchClause4); - this.type = "CatchClause"; - this.binding = binding; - this.body = body; -}; -ClassDeclaration_1 = dist$5.ClassDeclaration = function ClassDeclaration4(_ref21) { - var name = _ref21.name, _super = _ref21.super, elements = _ref21.elements; - _classCallCheck$d(this, ClassDeclaration4); - this.type = "ClassDeclaration"; - this.name = name; - this.super = _super; - this.elements = elements; -}; -ClassElement_1 = dist$5.ClassElement = function ClassElement4(_ref22) { - var isStatic = _ref22.isStatic, method = _ref22.method; - _classCallCheck$d(this, ClassElement4); - this.type = "ClassElement"; - this.isStatic = isStatic; - this.method = method; -}; -ClassExpression_1 = dist$5.ClassExpression = function ClassExpression4(_ref23) { - var name = _ref23.name, _super = _ref23.super, elements = _ref23.elements; - _classCallCheck$d(this, ClassExpression4); - this.type = "ClassExpression"; - this.name = name; - this.super = _super; - this.elements = elements; -}; -CompoundAssignmentExpression_1 = dist$5.CompoundAssignmentExpression = function CompoundAssignmentExpression4(_ref24) { - var binding = _ref24.binding, operator = _ref24.operator, expression = _ref24.expression; - _classCallCheck$d(this, CompoundAssignmentExpression4); - this.type = "CompoundAssignmentExpression"; - this.binding = binding; - this.operator = operator; - this.expression = expression; -}; -ComputedMemberAssignmentTarget_1 = dist$5.ComputedMemberAssignmentTarget = function ComputedMemberAssignmentTarget4(_ref25) { - var object = _ref25.object, expression = _ref25.expression; - _classCallCheck$d(this, ComputedMemberAssignmentTarget4); - this.type = "ComputedMemberAssignmentTarget"; - this.object = object; - this.expression = expression; -}; -ComputedMemberExpression_1 = dist$5.ComputedMemberExpression = function ComputedMemberExpression4(_ref26) { - var object = _ref26.object, expression = _ref26.expression; - _classCallCheck$d(this, ComputedMemberExpression4); - this.type = "ComputedMemberExpression"; - this.object = object; - this.expression = expression; -}; -ComputedPropertyName_1 = dist$5.ComputedPropertyName = function ComputedPropertyName4(_ref27) { - var expression = _ref27.expression; - _classCallCheck$d(this, ComputedPropertyName4); - this.type = "ComputedPropertyName"; - this.expression = expression; -}; -ConditionalExpression_1 = dist$5.ConditionalExpression = function ConditionalExpression4(_ref28) { - var test = _ref28.test, consequent = _ref28.consequent, alternate = _ref28.alternate; - _classCallCheck$d(this, ConditionalExpression4); - this.type = "ConditionalExpression"; - this.test = test; - this.consequent = consequent; - this.alternate = alternate; -}; -ContinueStatement_1 = dist$5.ContinueStatement = function ContinueStatement4(_ref29) { - var label = _ref29.label; - _classCallCheck$d(this, ContinueStatement4); - this.type = "ContinueStatement"; - this.label = label; -}; -DataProperty_1 = dist$5.DataProperty = function DataProperty4(_ref30) { - var name = _ref30.name, expression = _ref30.expression; - _classCallCheck$d(this, DataProperty4); - this.type = "DataProperty"; - this.name = name; - this.expression = expression; -}; -DebuggerStatement_1 = dist$5.DebuggerStatement = function DebuggerStatement4() { - _classCallCheck$d(this, DebuggerStatement4); - this.type = "DebuggerStatement"; -}; -Directive_1 = dist$5.Directive = function Directive4(_ref31) { - var rawValue = _ref31.rawValue; - _classCallCheck$d(this, Directive4); - this.type = "Directive"; - this.rawValue = rawValue; -}; -DoWhileStatement_1 = dist$5.DoWhileStatement = function DoWhileStatement4(_ref32) { - var body = _ref32.body, test = _ref32.test; - _classCallCheck$d(this, DoWhileStatement4); - this.type = "DoWhileStatement"; - this.body = body; - this.test = test; -}; -EmptyStatement_1 = dist$5.EmptyStatement = function EmptyStatement4() { - _classCallCheck$d(this, EmptyStatement4); - this.type = "EmptyStatement"; -}; -Export_1 = dist$5.Export = function Export4(_ref33) { - var declaration = _ref33.declaration; - _classCallCheck$d(this, Export4); - this.type = "Export"; - this.declaration = declaration; -}; -ExportAllFrom_1 = dist$5.ExportAllFrom = function ExportAllFrom4(_ref34) { - var moduleSpecifier = _ref34.moduleSpecifier; - _classCallCheck$d(this, ExportAllFrom4); - this.type = "ExportAllFrom"; - this.moduleSpecifier = moduleSpecifier; -}; -ExportDefault_1 = dist$5.ExportDefault = function ExportDefault4(_ref35) { - var body = _ref35.body; - _classCallCheck$d(this, ExportDefault4); - this.type = "ExportDefault"; - this.body = body; -}; -ExportFrom_1 = dist$5.ExportFrom = function ExportFrom4(_ref36) { - var namedExports = _ref36.namedExports, moduleSpecifier = _ref36.moduleSpecifier; - _classCallCheck$d(this, ExportFrom4); - this.type = "ExportFrom"; - this.namedExports = namedExports; - this.moduleSpecifier = moduleSpecifier; -}; -ExportFromSpecifier_1 = dist$5.ExportFromSpecifier = function ExportFromSpecifier4(_ref37) { - var name = _ref37.name, exportedName = _ref37.exportedName; - _classCallCheck$d(this, ExportFromSpecifier4); - this.type = "ExportFromSpecifier"; - this.name = name; - this.exportedName = exportedName; -}; -ExportLocalSpecifier_1 = dist$5.ExportLocalSpecifier = function ExportLocalSpecifier4(_ref38) { - var name = _ref38.name, exportedName = _ref38.exportedName; - _classCallCheck$d(this, ExportLocalSpecifier4); - this.type = "ExportLocalSpecifier"; - this.name = name; - this.exportedName = exportedName; -}; -ExportLocals_1 = dist$5.ExportLocals = function ExportLocals4(_ref39) { - var namedExports = _ref39.namedExports; - _classCallCheck$d(this, ExportLocals4); - this.type = "ExportLocals"; - this.namedExports = namedExports; -}; -ExpressionStatement_1 = dist$5.ExpressionStatement = function ExpressionStatement4(_ref40) { - var expression = _ref40.expression; - _classCallCheck$d(this, ExpressionStatement4); - this.type = "ExpressionStatement"; - this.expression = expression; -}; -ForAwaitStatement_1 = dist$5.ForAwaitStatement = function ForAwaitStatement4(_ref41) { - var left = _ref41.left, right = _ref41.right, body = _ref41.body; - _classCallCheck$d(this, ForAwaitStatement4); - this.type = "ForAwaitStatement"; - this.left = left; - this.right = right; - this.body = body; -}; -ForInStatement_1 = dist$5.ForInStatement = function ForInStatement4(_ref42) { - var left = _ref42.left, right = _ref42.right, body = _ref42.body; - _classCallCheck$d(this, ForInStatement4); - this.type = "ForInStatement"; - this.left = left; - this.right = right; - this.body = body; -}; -ForOfStatement_1 = dist$5.ForOfStatement = function ForOfStatement4(_ref43) { - var left = _ref43.left, right = _ref43.right, body = _ref43.body; - _classCallCheck$d(this, ForOfStatement4); - this.type = "ForOfStatement"; - this.left = left; - this.right = right; - this.body = body; -}; -ForStatement_1 = dist$5.ForStatement = function ForStatement4(_ref44) { - var init = _ref44.init, test = _ref44.test, update = _ref44.update, body = _ref44.body; - _classCallCheck$d(this, ForStatement4); - this.type = "ForStatement"; - this.init = init; - this.test = test; - this.update = update; - this.body = body; -}; -FormalParameters_1 = dist$5.FormalParameters = function FormalParameters4(_ref45) { - var items = _ref45.items, rest = _ref45.rest; - _classCallCheck$d(this, FormalParameters4); - this.type = "FormalParameters"; - this.items = items; - this.rest = rest; -}; -FunctionBody_1 = dist$5.FunctionBody = function FunctionBody4(_ref46) { - var directives = _ref46.directives, statements = _ref46.statements; - _classCallCheck$d(this, FunctionBody4); - this.type = "FunctionBody"; - this.directives = directives; - this.statements = statements; -}; -FunctionDeclaration_1 = dist$5.FunctionDeclaration = function FunctionDeclaration4(_ref47) { - var isAsync = _ref47.isAsync, isGenerator = _ref47.isGenerator, name = _ref47.name, params = _ref47.params, body = _ref47.body; - _classCallCheck$d(this, FunctionDeclaration4); - this.type = "FunctionDeclaration"; - this.isAsync = isAsync; - this.isGenerator = isGenerator; - this.name = name; - this.params = params; - this.body = body; -}; -FunctionExpression_1 = dist$5.FunctionExpression = function FunctionExpression4(_ref48) { - var isAsync = _ref48.isAsync, isGenerator = _ref48.isGenerator, name = _ref48.name, params = _ref48.params, body = _ref48.body; - _classCallCheck$d(this, FunctionExpression4); - this.type = "FunctionExpression"; - this.isAsync = isAsync; - this.isGenerator = isGenerator; - this.name = name; - this.params = params; - this.body = body; -}; -Getter_1 = dist$5.Getter = function Getter4(_ref49) { - var name = _ref49.name, body = _ref49.body; - _classCallCheck$d(this, Getter4); - this.type = "Getter"; - this.name = name; - this.body = body; -}; -IdentifierExpression_1 = dist$5.IdentifierExpression = function IdentifierExpression4(_ref50) { - var name = _ref50.name; - _classCallCheck$d(this, IdentifierExpression4); - this.type = "IdentifierExpression"; - this.name = name; -}; -IfStatement_1 = dist$5.IfStatement = function IfStatement4(_ref51) { - var test = _ref51.test, consequent = _ref51.consequent, alternate = _ref51.alternate; - _classCallCheck$d(this, IfStatement4); - this.type = "IfStatement"; - this.test = test; - this.consequent = consequent; - this.alternate = alternate; -}; -Import_1 = dist$5.Import = function Import4(_ref52) { - var defaultBinding = _ref52.defaultBinding, namedImports = _ref52.namedImports, moduleSpecifier = _ref52.moduleSpecifier; - _classCallCheck$d(this, Import4); - this.type = "Import"; - this.defaultBinding = defaultBinding; - this.namedImports = namedImports; - this.moduleSpecifier = moduleSpecifier; -}; -ImportNamespace_1 = dist$5.ImportNamespace = function ImportNamespace4(_ref53) { - var defaultBinding = _ref53.defaultBinding, namespaceBinding = _ref53.namespaceBinding, moduleSpecifier = _ref53.moduleSpecifier; - _classCallCheck$d(this, ImportNamespace4); - this.type = "ImportNamespace"; - this.defaultBinding = defaultBinding; - this.namespaceBinding = namespaceBinding; - this.moduleSpecifier = moduleSpecifier; -}; -ImportSpecifier_1 = dist$5.ImportSpecifier = function ImportSpecifier4(_ref54) { - var name = _ref54.name, binding = _ref54.binding; - _classCallCheck$d(this, ImportSpecifier4); - this.type = "ImportSpecifier"; - this.name = name; - this.binding = binding; -}; -LabeledStatement_1 = dist$5.LabeledStatement = function LabeledStatement4(_ref55) { - var label = _ref55.label, body = _ref55.body; - _classCallCheck$d(this, LabeledStatement4); - this.type = "LabeledStatement"; - this.label = label; - this.body = body; -}; -LiteralBooleanExpression_1 = dist$5.LiteralBooleanExpression = function LiteralBooleanExpression4(_ref56) { - var value = _ref56.value; - _classCallCheck$d(this, LiteralBooleanExpression4); - this.type = "LiteralBooleanExpression"; - this.value = value; -}; -LiteralInfinityExpression_1 = dist$5.LiteralInfinityExpression = function LiteralInfinityExpression4() { - _classCallCheck$d(this, LiteralInfinityExpression4); - this.type = "LiteralInfinityExpression"; -}; -LiteralNullExpression_1 = dist$5.LiteralNullExpression = function LiteralNullExpression4() { - _classCallCheck$d(this, LiteralNullExpression4); - this.type = "LiteralNullExpression"; -}; -LiteralNumericExpression_1 = dist$5.LiteralNumericExpression = function LiteralNumericExpression4(_ref57) { - var value = _ref57.value; - _classCallCheck$d(this, LiteralNumericExpression4); - this.type = "LiteralNumericExpression"; - this.value = value; -}; -LiteralRegExpExpression_1 = dist$5.LiteralRegExpExpression = function LiteralRegExpExpression4(_ref58) { - var pattern = _ref58.pattern, global = _ref58.global, ignoreCase = _ref58.ignoreCase, multiLine = _ref58.multiLine, dotAll = _ref58.dotAll, unicode2 = _ref58.unicode, sticky = _ref58.sticky; - _classCallCheck$d(this, LiteralRegExpExpression4); - this.type = "LiteralRegExpExpression"; - this.pattern = pattern; - this.global = global; - this.ignoreCase = ignoreCase; - this.multiLine = multiLine; - this.dotAll = dotAll; - this.unicode = unicode2; - this.sticky = sticky; -}; -LiteralStringExpression_1 = dist$5.LiteralStringExpression = function LiteralStringExpression4(_ref59) { - var value = _ref59.value; - _classCallCheck$d(this, LiteralStringExpression4); - this.type = "LiteralStringExpression"; - this.value = value; -}; -Method_1 = dist$5.Method = function Method4(_ref60) { - var isAsync = _ref60.isAsync, isGenerator = _ref60.isGenerator, name = _ref60.name, params = _ref60.params, body = _ref60.body; - _classCallCheck$d(this, Method4); - this.type = "Method"; - this.isAsync = isAsync; - this.isGenerator = isGenerator; - this.name = name; - this.params = params; - this.body = body; -}; -Module_1 = dist$5.Module = function Module4(_ref61) { - var directives = _ref61.directives, items = _ref61.items; - _classCallCheck$d(this, Module4); - this.type = "Module"; - this.directives = directives; - this.items = items; -}; -NewExpression_1 = dist$5.NewExpression = function NewExpression4(_ref62) { - var callee = _ref62.callee, _arguments = _ref62.arguments; - _classCallCheck$d(this, NewExpression4); - this.type = "NewExpression"; - this.callee = callee; - this.arguments = _arguments; -}; -NewTargetExpression_1 = dist$5.NewTargetExpression = function NewTargetExpression4() { - _classCallCheck$d(this, NewTargetExpression4); - this.type = "NewTargetExpression"; -}; -ObjectAssignmentTarget_1 = dist$5.ObjectAssignmentTarget = function ObjectAssignmentTarget4(_ref63) { - var properties = _ref63.properties, rest = _ref63.rest; - _classCallCheck$d(this, ObjectAssignmentTarget4); - this.type = "ObjectAssignmentTarget"; - this.properties = properties; - this.rest = rest; -}; -ObjectBinding_1 = dist$5.ObjectBinding = function ObjectBinding4(_ref64) { - var properties = _ref64.properties, rest = _ref64.rest; - _classCallCheck$d(this, ObjectBinding4); - this.type = "ObjectBinding"; - this.properties = properties; - this.rest = rest; -}; -ObjectExpression_1 = dist$5.ObjectExpression = function ObjectExpression4(_ref65) { - var properties = _ref65.properties; - _classCallCheck$d(this, ObjectExpression4); - this.type = "ObjectExpression"; - this.properties = properties; -}; -ReturnStatement_1 = dist$5.ReturnStatement = function ReturnStatement4(_ref66) { - var expression = _ref66.expression; - _classCallCheck$d(this, ReturnStatement4); - this.type = "ReturnStatement"; - this.expression = expression; -}; -Script_1 = dist$5.Script = function Script4(_ref67) { - var directives = _ref67.directives, statements = _ref67.statements; - _classCallCheck$d(this, Script4); - this.type = "Script"; - this.directives = directives; - this.statements = statements; -}; -Setter_1 = dist$5.Setter = function Setter4(_ref68) { - var name = _ref68.name, param = _ref68.param, body = _ref68.body; - _classCallCheck$d(this, Setter4); - this.type = "Setter"; - this.name = name; - this.param = param; - this.body = body; -}; -ShorthandProperty_1 = dist$5.ShorthandProperty = function ShorthandProperty4(_ref69) { - var name = _ref69.name; - _classCallCheck$d(this, ShorthandProperty4); - this.type = "ShorthandProperty"; - this.name = name; -}; -SpreadElement_1 = dist$5.SpreadElement = function SpreadElement4(_ref70) { - var expression = _ref70.expression; - _classCallCheck$d(this, SpreadElement4); - this.type = "SpreadElement"; - this.expression = expression; -}; -SpreadProperty_1 = dist$5.SpreadProperty = function SpreadProperty4(_ref71) { - var expression = _ref71.expression; - _classCallCheck$d(this, SpreadProperty4); - this.type = "SpreadProperty"; - this.expression = expression; -}; -StaticMemberAssignmentTarget_1 = dist$5.StaticMemberAssignmentTarget = function StaticMemberAssignmentTarget4(_ref72) { - var object = _ref72.object, property = _ref72.property; - _classCallCheck$d(this, StaticMemberAssignmentTarget4); - this.type = "StaticMemberAssignmentTarget"; - this.object = object; - this.property = property; -}; -StaticMemberExpression_1 = dist$5.StaticMemberExpression = function StaticMemberExpression4(_ref73) { - var object = _ref73.object, property = _ref73.property; - _classCallCheck$d(this, StaticMemberExpression4); - this.type = "StaticMemberExpression"; - this.object = object; - this.property = property; -}; -StaticPropertyName_1 = dist$5.StaticPropertyName = function StaticPropertyName4(_ref74) { - var value = _ref74.value; - _classCallCheck$d(this, StaticPropertyName4); - this.type = "StaticPropertyName"; - this.value = value; -}; -Super_1 = dist$5.Super = function Super4() { - _classCallCheck$d(this, Super4); - this.type = "Super"; -}; -SwitchCase_1 = dist$5.SwitchCase = function SwitchCase4(_ref75) { - var test = _ref75.test, consequent = _ref75.consequent; - _classCallCheck$d(this, SwitchCase4); - this.type = "SwitchCase"; - this.test = test; - this.consequent = consequent; -}; -SwitchDefault_1 = dist$5.SwitchDefault = function SwitchDefault4(_ref76) { - var consequent = _ref76.consequent; - _classCallCheck$d(this, SwitchDefault4); - this.type = "SwitchDefault"; - this.consequent = consequent; -}; -SwitchStatement_1 = dist$5.SwitchStatement = function SwitchStatement4(_ref77) { - var discriminant = _ref77.discriminant, cases = _ref77.cases; - _classCallCheck$d(this, SwitchStatement4); - this.type = "SwitchStatement"; - this.discriminant = discriminant; - this.cases = cases; -}; -SwitchStatementWithDefault_1 = dist$5.SwitchStatementWithDefault = function SwitchStatementWithDefault4(_ref78) { - var discriminant = _ref78.discriminant, preDefaultCases = _ref78.preDefaultCases, defaultCase = _ref78.defaultCase, postDefaultCases = _ref78.postDefaultCases; - _classCallCheck$d(this, SwitchStatementWithDefault4); - this.type = "SwitchStatementWithDefault"; - this.discriminant = discriminant; - this.preDefaultCases = preDefaultCases; - this.defaultCase = defaultCase; - this.postDefaultCases = postDefaultCases; -}; -TemplateElement_1 = dist$5.TemplateElement = function TemplateElement4(_ref79) { - var rawValue = _ref79.rawValue; - _classCallCheck$d(this, TemplateElement4); - this.type = "TemplateElement"; - this.rawValue = rawValue; -}; -TemplateExpression_1 = dist$5.TemplateExpression = function TemplateExpression4(_ref80) { - var tag = _ref80.tag, elements = _ref80.elements; - _classCallCheck$d(this, TemplateExpression4); - this.type = "TemplateExpression"; - this.tag = tag; - this.elements = elements; -}; -ThisExpression_1 = dist$5.ThisExpression = function ThisExpression4() { - _classCallCheck$d(this, ThisExpression4); - this.type = "ThisExpression"; -}; -ThrowStatement_1 = dist$5.ThrowStatement = function ThrowStatement4(_ref81) { - var expression = _ref81.expression; - _classCallCheck$d(this, ThrowStatement4); - this.type = "ThrowStatement"; - this.expression = expression; -}; -TryCatchStatement_1 = dist$5.TryCatchStatement = function TryCatchStatement4(_ref82) { - var body = _ref82.body, catchClause = _ref82.catchClause; - _classCallCheck$d(this, TryCatchStatement4); - this.type = "TryCatchStatement"; - this.body = body; - this.catchClause = catchClause; -}; -TryFinallyStatement_1 = dist$5.TryFinallyStatement = function TryFinallyStatement4(_ref83) { - var body = _ref83.body, catchClause = _ref83.catchClause, finalizer = _ref83.finalizer; - _classCallCheck$d(this, TryFinallyStatement4); - this.type = "TryFinallyStatement"; - this.body = body; - this.catchClause = catchClause; - this.finalizer = finalizer; -}; -UnaryExpression_1 = dist$5.UnaryExpression = function UnaryExpression4(_ref84) { - var operator = _ref84.operator, operand = _ref84.operand; - _classCallCheck$d(this, UnaryExpression4); - this.type = "UnaryExpression"; - this.operator = operator; - this.operand = operand; -}; -UpdateExpression_1 = dist$5.UpdateExpression = function UpdateExpression4(_ref85) { - var isPrefix = _ref85.isPrefix, operator = _ref85.operator, operand = _ref85.operand; - _classCallCheck$d(this, UpdateExpression4); - this.type = "UpdateExpression"; - this.isPrefix = isPrefix; - this.operator = operator; - this.operand = operand; -}; -VariableDeclaration_1 = dist$5.VariableDeclaration = function VariableDeclaration4(_ref86) { - var kind = _ref86.kind, declarators = _ref86.declarators; - _classCallCheck$d(this, VariableDeclaration4); - this.type = "VariableDeclaration"; - this.kind = kind; - this.declarators = declarators; -}; -VariableDeclarationStatement_1 = dist$5.VariableDeclarationStatement = function VariableDeclarationStatement4(_ref87) { - var declaration = _ref87.declaration; - _classCallCheck$d(this, VariableDeclarationStatement4); - this.type = "VariableDeclarationStatement"; - this.declaration = declaration; -}; -VariableDeclarator_1 = dist$5.VariableDeclarator = function VariableDeclarator4(_ref88) { - var binding = _ref88.binding, init = _ref88.init; - _classCallCheck$d(this, VariableDeclarator4); - this.type = "VariableDeclarator"; - this.binding = binding; - this.init = init; -}; -WhileStatement_1 = dist$5.WhileStatement = function WhileStatement4(_ref89) { - var test = _ref89.test, body = _ref89.body; - _classCallCheck$d(this, WhileStatement4); - this.type = "WhileStatement"; - this.test = test; - this.body = body; -}; -WithStatement_1 = dist$5.WithStatement = function WithStatement4(_ref90) { - var object = _ref90.object, body = _ref90.body; - _classCallCheck$d(this, WithStatement4); - this.type = "WithStatement"; - this.object = object; - this.body = body; -}; -YieldExpression_1 = dist$5.YieldExpression = function YieldExpression4(_ref91) { - var expression = _ref91.expression; - _classCallCheck$d(this, YieldExpression4); - this.type = "YieldExpression"; - this.expression = expression; -}; -YieldGeneratorExpression_1 = dist$5.YieldGeneratorExpression = function YieldGeneratorExpression4(_ref92) { - var expression = _ref92.expression; - _classCallCheck$d(this, YieldGeneratorExpression4); - this.type = "YieldGeneratorExpression"; - this.expression = expression; -}; -const dist$4 = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - get ArrayAssignmentTarget() { - return ArrayAssignmentTarget_1; - }, - get ArrayBinding() { - return ArrayBinding_1; - }, - get ArrayExpression() { - return ArrayExpression_1; - }, - get ArrowExpression() { - return ArrowExpression_1; - }, - get AssignmentExpression() { - return AssignmentExpression_1; - }, - get AssignmentTargetIdentifier() { - return AssignmentTargetIdentifier_1; - }, - get AssignmentTargetPropertyIdentifier() { - return AssignmentTargetPropertyIdentifier_1; - }, - get AssignmentTargetPropertyProperty() { - return AssignmentTargetPropertyProperty_1; - }, - get AssignmentTargetWithDefault() { - return AssignmentTargetWithDefault_1; - }, - get AwaitExpression() { - return AwaitExpression_1; - }, - get BinaryExpression() { - return BinaryExpression_1; - }, - get BindingIdentifier() { - return BindingIdentifier_1; - }, - get BindingPropertyIdentifier() { - return BindingPropertyIdentifier_1; - }, - get BindingPropertyProperty() { - return BindingPropertyProperty_1; - }, - get BindingWithDefault() { - return BindingWithDefault_1; - }, - get Block() { - return Block_1; - }, - get BlockStatement() { - return BlockStatement_1; - }, - get BreakStatement() { - return BreakStatement_1; - }, - get CallExpression() { - return CallExpression_1; - }, - get CatchClause() { - return CatchClause_1; - }, - get ClassDeclaration() { - return ClassDeclaration_1; - }, - get ClassElement() { - return ClassElement_1; - }, - get ClassExpression() { - return ClassExpression_1; - }, - get CompoundAssignmentExpression() { - return CompoundAssignmentExpression_1; - }, - get ComputedMemberAssignmentTarget() { - return ComputedMemberAssignmentTarget_1; - }, - get ComputedMemberExpression() { - return ComputedMemberExpression_1; - }, - get ComputedPropertyName() { - return ComputedPropertyName_1; - }, - get ConditionalExpression() { - return ConditionalExpression_1; - }, - get ContinueStatement() { - return ContinueStatement_1; - }, - get DataProperty() { - return DataProperty_1; - }, - get DebuggerStatement() { - return DebuggerStatement_1; - }, - get Directive() { - return Directive_1; - }, - get DoWhileStatement() { - return DoWhileStatement_1; - }, - get EmptyStatement() { - return EmptyStatement_1; - }, - get Export() { - return Export_1; - }, - get ExportAllFrom() { - return ExportAllFrom_1; - }, - get ExportDefault() { - return ExportDefault_1; - }, - get ExportFrom() { - return ExportFrom_1; - }, - get ExportFromSpecifier() { - return ExportFromSpecifier_1; - }, - get ExportLocalSpecifier() { - return ExportLocalSpecifier_1; - }, - get ExportLocals() { - return ExportLocals_1; - }, - get ExpressionStatement() { - return ExpressionStatement_1; - }, - get ForAwaitStatement() { - return ForAwaitStatement_1; - }, - get ForInStatement() { - return ForInStatement_1; - }, - get ForOfStatement() { - return ForOfStatement_1; - }, - get ForStatement() { - return ForStatement_1; - }, - get FormalParameters() { - return FormalParameters_1; - }, - get FunctionBody() { - return FunctionBody_1; - }, - get FunctionDeclaration() { - return FunctionDeclaration_1; - }, - get FunctionExpression() { - return FunctionExpression_1; - }, - get Getter() { - return Getter_1; - }, - get IdentifierExpression() { - return IdentifierExpression_1; - }, - get IfStatement() { - return IfStatement_1; - }, - get Import() { - return Import_1; - }, - get ImportNamespace() { - return ImportNamespace_1; - }, - get ImportSpecifier() { - return ImportSpecifier_1; - }, - get LabeledStatement() { - return LabeledStatement_1; - }, - get LiteralBooleanExpression() { - return LiteralBooleanExpression_1; - }, - get LiteralInfinityExpression() { - return LiteralInfinityExpression_1; - }, - get LiteralNullExpression() { - return LiteralNullExpression_1; - }, - get LiteralNumericExpression() { - return LiteralNumericExpression_1; - }, - get LiteralRegExpExpression() { - return LiteralRegExpExpression_1; - }, - get LiteralStringExpression() { - return LiteralStringExpression_1; - }, - get Method() { - return Method_1; - }, - get Module() { - return Module_1; - }, - get NewExpression() { - return NewExpression_1; - }, - get NewTargetExpression() { - return NewTargetExpression_1; - }, - get ObjectAssignmentTarget() { - return ObjectAssignmentTarget_1; - }, - get ObjectBinding() { - return ObjectBinding_1; - }, - get ObjectExpression() { - return ObjectExpression_1; - }, - get ReturnStatement() { - return ReturnStatement_1; - }, - get Script() { - return Script_1; - }, - get Setter() { - return Setter_1; - }, - get ShorthandProperty() { - return ShorthandProperty_1; - }, - get SpreadElement() { - return SpreadElement_1; - }, - get SpreadProperty() { - return SpreadProperty_1; - }, - get StaticMemberAssignmentTarget() { - return StaticMemberAssignmentTarget_1; - }, - get StaticMemberExpression() { - return StaticMemberExpression_1; - }, - get StaticPropertyName() { - return StaticPropertyName_1; - }, - get Super() { - return Super_1; - }, - get SwitchCase() { - return SwitchCase_1; - }, - get SwitchDefault() { - return SwitchDefault_1; - }, - get SwitchStatement() { - return SwitchStatement_1; - }, - get SwitchStatementWithDefault() { - return SwitchStatementWithDefault_1; - }, - get TemplateElement() { - return TemplateElement_1; - }, - get TemplateExpression() { - return TemplateExpression_1; - }, - get ThisExpression() { - return ThisExpression_1; - }, - get ThrowStatement() { - return ThrowStatement_1; - }, - get TryCatchStatement() { - return TryCatchStatement_1; - }, - get TryFinallyStatement() { - return TryFinallyStatement_1; - }, - get UnaryExpression() { - return UnaryExpression_1; - }, - get UpdateExpression() { - return UpdateExpression_1; - }, - get VariableDeclaration() { - return VariableDeclaration_1; - }, - get VariableDeclarationStatement() { - return VariableDeclarationStatement_1; - }, - get VariableDeclarator() { - return VariableDeclarator_1; - }, - get WhileStatement() { - return WhileStatement_1; - }, - get WithStatement() { - return WithStatement_1; - }, - get YieldExpression() { - return YieldExpression_1; - }, - get YieldGeneratorExpression() { - return YieldGeneratorExpression_1; - }, - default: dist$5 -}, [dist$5]); -const require$$0$5 = /* @__PURE__ */ getAugmentedNamespace(dist$4); -Object.defineProperty(memoize$2, "__esModule", { - value: true -}); -var _default$8 = memoize$2.default = memoize; -var _shiftAst$5 = require$$0$5; -_interopRequireWildcard$3(_shiftAst$5); -function _interopRequireWildcard$3(obj) { - if (obj && obj.__esModule) { - return obj; - } else { - var newObj = {}; - if (obj != null) { - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) - newObj[key] = obj[key]; - } - } - newObj.default = obj; - return newObj; - } -} -function memoize(reducer) { - var cache2 = /* @__PURE__ */ new WeakMap(); - return { - reduceArrayAssignmentTarget: function reduceArrayAssignmentTarget(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceArrayAssignmentTarget(node, arg); - cache2.set(node, res); - return res; - }, - reduceArrayBinding: function reduceArrayBinding(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceArrayBinding(node, arg); - cache2.set(node, res); - return res; - }, - reduceArrayExpression: function reduceArrayExpression(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceArrayExpression(node, arg); - cache2.set(node, res); - return res; - }, - reduceArrowExpression: function reduceArrowExpression(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceArrowExpression(node, arg); - cache2.set(node, res); - return res; - }, - reduceAssignmentExpression: function reduceAssignmentExpression(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceAssignmentExpression(node, arg); - cache2.set(node, res); - return res; - }, - reduceAssignmentTargetIdentifier: function reduceAssignmentTargetIdentifier(node) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceAssignmentTargetIdentifier(node); - cache2.set(node, res); - return res; - }, - reduceAssignmentTargetPropertyIdentifier: function reduceAssignmentTargetPropertyIdentifier(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceAssignmentTargetPropertyIdentifier(node, arg); - cache2.set(node, res); - return res; - }, - reduceAssignmentTargetPropertyProperty: function reduceAssignmentTargetPropertyProperty(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceAssignmentTargetPropertyProperty(node, arg); - cache2.set(node, res); - return res; - }, - reduceAssignmentTargetWithDefault: function reduceAssignmentTargetWithDefault(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceAssignmentTargetWithDefault(node, arg); - cache2.set(node, res); - return res; - }, - reduceAwaitExpression: function reduceAwaitExpression(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceAwaitExpression(node, arg); - cache2.set(node, res); - return res; - }, - reduceBinaryExpression: function reduceBinaryExpression(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceBinaryExpression(node, arg); - cache2.set(node, res); - return res; - }, - reduceBindingIdentifier: function reduceBindingIdentifier(node) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceBindingIdentifier(node); - cache2.set(node, res); - return res; - }, - reduceBindingPropertyIdentifier: function reduceBindingPropertyIdentifier(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceBindingPropertyIdentifier(node, arg); - cache2.set(node, res); - return res; - }, - reduceBindingPropertyProperty: function reduceBindingPropertyProperty(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceBindingPropertyProperty(node, arg); - cache2.set(node, res); - return res; - }, - reduceBindingWithDefault: function reduceBindingWithDefault(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceBindingWithDefault(node, arg); - cache2.set(node, res); - return res; - }, - reduceBlock: function reduceBlock(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceBlock(node, arg); - cache2.set(node, res); - return res; - }, - reduceBlockStatement: function reduceBlockStatement(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceBlockStatement(node, arg); - cache2.set(node, res); - return res; - }, - reduceBreakStatement: function reduceBreakStatement(node) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceBreakStatement(node); - cache2.set(node, res); - return res; - }, - reduceCallExpression: function reduceCallExpression(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceCallExpression(node, arg); - cache2.set(node, res); - return res; - }, - reduceCatchClause: function reduceCatchClause(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceCatchClause(node, arg); - cache2.set(node, res); - return res; - }, - reduceClassDeclaration: function reduceClassDeclaration(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceClassDeclaration(node, arg); - cache2.set(node, res); - return res; - }, - reduceClassElement: function reduceClassElement(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceClassElement(node, arg); - cache2.set(node, res); - return res; - }, - reduceClassExpression: function reduceClassExpression(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceClassExpression(node, arg); - cache2.set(node, res); - return res; - }, - reduceCompoundAssignmentExpression: function reduceCompoundAssignmentExpression(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceCompoundAssignmentExpression(node, arg); - cache2.set(node, res); - return res; - }, - reduceComputedMemberAssignmentTarget: function reduceComputedMemberAssignmentTarget(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceComputedMemberAssignmentTarget(node, arg); - cache2.set(node, res); - return res; - }, - reduceComputedMemberExpression: function reduceComputedMemberExpression(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceComputedMemberExpression(node, arg); - cache2.set(node, res); - return res; - }, - reduceComputedPropertyName: function reduceComputedPropertyName(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceComputedPropertyName(node, arg); - cache2.set(node, res); - return res; - }, - reduceConditionalExpression: function reduceConditionalExpression(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceConditionalExpression(node, arg); - cache2.set(node, res); - return res; - }, - reduceContinueStatement: function reduceContinueStatement(node) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceContinueStatement(node); - cache2.set(node, res); - return res; - }, - reduceDataProperty: function reduceDataProperty(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceDataProperty(node, arg); - cache2.set(node, res); - return res; - }, - reduceDebuggerStatement: function reduceDebuggerStatement(node) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceDebuggerStatement(node); - cache2.set(node, res); - return res; - }, - reduceDirective: function reduceDirective(node) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceDirective(node); - cache2.set(node, res); - return res; - }, - reduceDoWhileStatement: function reduceDoWhileStatement(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceDoWhileStatement(node, arg); - cache2.set(node, res); - return res; - }, - reduceEmptyStatement: function reduceEmptyStatement(node) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceEmptyStatement(node); - cache2.set(node, res); - return res; - }, - reduceExport: function reduceExport(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceExport(node, arg); - cache2.set(node, res); - return res; - }, - reduceExportAllFrom: function reduceExportAllFrom(node) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceExportAllFrom(node); - cache2.set(node, res); - return res; - }, - reduceExportDefault: function reduceExportDefault(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceExportDefault(node, arg); - cache2.set(node, res); - return res; - }, - reduceExportFrom: function reduceExportFrom(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceExportFrom(node, arg); - cache2.set(node, res); - return res; - }, - reduceExportFromSpecifier: function reduceExportFromSpecifier(node) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceExportFromSpecifier(node); - cache2.set(node, res); - return res; - }, - reduceExportLocalSpecifier: function reduceExportLocalSpecifier(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceExportLocalSpecifier(node, arg); - cache2.set(node, res); - return res; - }, - reduceExportLocals: function reduceExportLocals(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceExportLocals(node, arg); - cache2.set(node, res); - return res; - }, - reduceExpressionStatement: function reduceExpressionStatement(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceExpressionStatement(node, arg); - cache2.set(node, res); - return res; - }, - reduceForAwaitStatement: function reduceForAwaitStatement(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceForAwaitStatement(node, arg); - cache2.set(node, res); - return res; - }, - reduceForInStatement: function reduceForInStatement(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceForInStatement(node, arg); - cache2.set(node, res); - return res; - }, - reduceForOfStatement: function reduceForOfStatement(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceForOfStatement(node, arg); - cache2.set(node, res); - return res; - }, - reduceForStatement: function reduceForStatement(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceForStatement(node, arg); - cache2.set(node, res); - return res; - }, - reduceFormalParameters: function reduceFormalParameters(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceFormalParameters(node, arg); - cache2.set(node, res); - return res; - }, - reduceFunctionBody: function reduceFunctionBody(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceFunctionBody(node, arg); - cache2.set(node, res); - return res; - }, - reduceFunctionDeclaration: function reduceFunctionDeclaration(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceFunctionDeclaration(node, arg); - cache2.set(node, res); - return res; - }, - reduceFunctionExpression: function reduceFunctionExpression(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceFunctionExpression(node, arg); - cache2.set(node, res); - return res; - }, - reduceGetter: function reduceGetter(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceGetter(node, arg); - cache2.set(node, res); - return res; - }, - reduceIdentifierExpression: function reduceIdentifierExpression(node) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceIdentifierExpression(node); - cache2.set(node, res); - return res; - }, - reduceIfStatement: function reduceIfStatement(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceIfStatement(node, arg); - cache2.set(node, res); - return res; - }, - reduceImport: function reduceImport(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceImport(node, arg); - cache2.set(node, res); - return res; - }, - reduceImportNamespace: function reduceImportNamespace(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceImportNamespace(node, arg); - cache2.set(node, res); - return res; - }, - reduceImportSpecifier: function reduceImportSpecifier(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceImportSpecifier(node, arg); - cache2.set(node, res); - return res; - }, - reduceLabeledStatement: function reduceLabeledStatement(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceLabeledStatement(node, arg); - cache2.set(node, res); - return res; - }, - reduceLiteralBooleanExpression: function reduceLiteralBooleanExpression(node) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceLiteralBooleanExpression(node); - cache2.set(node, res); - return res; - }, - reduceLiteralInfinityExpression: function reduceLiteralInfinityExpression(node) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceLiteralInfinityExpression(node); - cache2.set(node, res); - return res; - }, - reduceLiteralNullExpression: function reduceLiteralNullExpression(node) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceLiteralNullExpression(node); - cache2.set(node, res); - return res; - }, - reduceLiteralNumericExpression: function reduceLiteralNumericExpression(node) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceLiteralNumericExpression(node); - cache2.set(node, res); - return res; - }, - reduceLiteralRegExpExpression: function reduceLiteralRegExpExpression(node) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceLiteralRegExpExpression(node); - cache2.set(node, res); - return res; - }, - reduceLiteralStringExpression: function reduceLiteralStringExpression(node) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceLiteralStringExpression(node); - cache2.set(node, res); - return res; - }, - reduceMethod: function reduceMethod(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceMethod(node, arg); - cache2.set(node, res); - return res; - }, - reduceModule: function reduceModule(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceModule(node, arg); - cache2.set(node, res); - return res; - }, - reduceNewExpression: function reduceNewExpression(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceNewExpression(node, arg); - cache2.set(node, res); - return res; - }, - reduceNewTargetExpression: function reduceNewTargetExpression(node) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceNewTargetExpression(node); - cache2.set(node, res); - return res; - }, - reduceObjectAssignmentTarget: function reduceObjectAssignmentTarget(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceObjectAssignmentTarget(node, arg); - cache2.set(node, res); - return res; - }, - reduceObjectBinding: function reduceObjectBinding(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceObjectBinding(node, arg); - cache2.set(node, res); - return res; - }, - reduceObjectExpression: function reduceObjectExpression(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceObjectExpression(node, arg); - cache2.set(node, res); - return res; - }, - reduceReturnStatement: function reduceReturnStatement(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceReturnStatement(node, arg); - cache2.set(node, res); - return res; - }, - reduceScript: function reduceScript(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceScript(node, arg); - cache2.set(node, res); - return res; - }, - reduceSetter: function reduceSetter(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceSetter(node, arg); - cache2.set(node, res); - return res; - }, - reduceShorthandProperty: function reduceShorthandProperty(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceShorthandProperty(node, arg); - cache2.set(node, res); - return res; - }, - reduceSpreadElement: function reduceSpreadElement(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceSpreadElement(node, arg); - cache2.set(node, res); - return res; - }, - reduceSpreadProperty: function reduceSpreadProperty(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceSpreadProperty(node, arg); - cache2.set(node, res); - return res; - }, - reduceStaticMemberAssignmentTarget: function reduceStaticMemberAssignmentTarget(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceStaticMemberAssignmentTarget(node, arg); - cache2.set(node, res); - return res; - }, - reduceStaticMemberExpression: function reduceStaticMemberExpression(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceStaticMemberExpression(node, arg); - cache2.set(node, res); - return res; - }, - reduceStaticPropertyName: function reduceStaticPropertyName(node) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceStaticPropertyName(node); - cache2.set(node, res); - return res; - }, - reduceSuper: function reduceSuper(node) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceSuper(node); - cache2.set(node, res); - return res; - }, - reduceSwitchCase: function reduceSwitchCase(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceSwitchCase(node, arg); - cache2.set(node, res); - return res; - }, - reduceSwitchDefault: function reduceSwitchDefault(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceSwitchDefault(node, arg); - cache2.set(node, res); - return res; - }, - reduceSwitchStatement: function reduceSwitchStatement(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceSwitchStatement(node, arg); - cache2.set(node, res); - return res; - }, - reduceSwitchStatementWithDefault: function reduceSwitchStatementWithDefault(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceSwitchStatementWithDefault(node, arg); - cache2.set(node, res); - return res; - }, - reduceTemplateElement: function reduceTemplateElement(node) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceTemplateElement(node); - cache2.set(node, res); - return res; - }, - reduceTemplateExpression: function reduceTemplateExpression(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceTemplateExpression(node, arg); - cache2.set(node, res); - return res; - }, - reduceThisExpression: function reduceThisExpression(node) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceThisExpression(node); - cache2.set(node, res); - return res; - }, - reduceThrowStatement: function reduceThrowStatement(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceThrowStatement(node, arg); - cache2.set(node, res); - return res; - }, - reduceTryCatchStatement: function reduceTryCatchStatement(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceTryCatchStatement(node, arg); - cache2.set(node, res); - return res; - }, - reduceTryFinallyStatement: function reduceTryFinallyStatement(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceTryFinallyStatement(node, arg); - cache2.set(node, res); - return res; - }, - reduceUnaryExpression: function reduceUnaryExpression(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceUnaryExpression(node, arg); - cache2.set(node, res); - return res; - }, - reduceUpdateExpression: function reduceUpdateExpression(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceUpdateExpression(node, arg); - cache2.set(node, res); - return res; - }, - reduceVariableDeclaration: function reduceVariableDeclaration(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceVariableDeclaration(node, arg); - cache2.set(node, res); - return res; - }, - reduceVariableDeclarationStatement: function reduceVariableDeclarationStatement(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceVariableDeclarationStatement(node, arg); - cache2.set(node, res); - return res; - }, - reduceVariableDeclarator: function reduceVariableDeclarator(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceVariableDeclarator(node, arg); - cache2.set(node, res); - return res; - }, - reduceWhileStatement: function reduceWhileStatement(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceWhileStatement(node, arg); - cache2.set(node, res); - return res; - }, - reduceWithStatement: function reduceWithStatement(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceWithStatement(node, arg); - cache2.set(node, res); - return res; - }, - reduceYieldExpression: function reduceYieldExpression(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceYieldExpression(node, arg); - cache2.set(node, res); - return res; - }, - reduceYieldGeneratorExpression: function reduceYieldGeneratorExpression(node, arg) { - if (cache2.has(node)) { - return cache2.get(node); - } - var res = reducer.reduceYieldGeneratorExpression(node, arg); - cache2.set(node, res); - return res; - } - }; -} -const memoize$1 = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - default: _default$8 -}, [memoize$2]); -const require$$4$1 = /* @__PURE__ */ getAugmentedNamespace(memoize$1); -var cloneReducer$1 = {}; -Object.defineProperty(cloneReducer$1, "__esModule", { - value: true -}); -var _createClass$a = function() { - function defineProperties(target, props) { - for (var i2 = 0; i2 < props.length; i2++) { - var descriptor = props[i2]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - return function(Constructor, protoProps, staticProps) { - if (protoProps) - defineProperties(Constructor.prototype, protoProps); - if (staticProps) - defineProperties(Constructor, staticProps); - return Constructor; - }; -}(); -var _shiftAst$4 = require$$0$5; -var Shift$1 = _interopRequireWildcard$2(_shiftAst$4); -function _interopRequireWildcard$2(obj) { - if (obj && obj.__esModule) { - return obj; - } else { - var newObj = {}; - if (obj != null) { - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) - newObj[key] = obj[key]; - } - } - newObj.default = obj; - return newObj; - } -} -function _classCallCheck$c(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} -var CloneReducer = function() { - function CloneReducer2() { - _classCallCheck$c(this, CloneReducer2); - } - _createClass$a(CloneReducer2, [{ - key: "reduceArrayAssignmentTarget", - value: function reduceArrayAssignmentTarget(node, _ref) { - var elements = _ref.elements, rest = _ref.rest; - return new Shift$1.ArrayAssignmentTarget({ elements, rest }); - } - }, { - key: "reduceArrayBinding", - value: function reduceArrayBinding(node, _ref2) { - var elements = _ref2.elements, rest = _ref2.rest; - return new Shift$1.ArrayBinding({ elements, rest }); - } - }, { - key: "reduceArrayExpression", - value: function reduceArrayExpression(node, _ref3) { - var elements = _ref3.elements; - return new Shift$1.ArrayExpression({ elements }); - } - }, { - key: "reduceArrowExpression", - value: function reduceArrowExpression(node, _ref4) { - var params = _ref4.params, body = _ref4.body; - return new Shift$1.ArrowExpression({ isAsync: node.isAsync, params, body }); - } - }, { - key: "reduceAssignmentExpression", - value: function reduceAssignmentExpression(node, _ref5) { - var binding = _ref5.binding, expression = _ref5.expression; - return new Shift$1.AssignmentExpression({ binding, expression }); - } - }, { - key: "reduceAssignmentTargetIdentifier", - value: function reduceAssignmentTargetIdentifier(node) { - return new Shift$1.AssignmentTargetIdentifier({ name: node.name }); - } - }, { - key: "reduceAssignmentTargetPropertyIdentifier", - value: function reduceAssignmentTargetPropertyIdentifier(node, _ref6) { - var binding = _ref6.binding, init = _ref6.init; - return new Shift$1.AssignmentTargetPropertyIdentifier({ binding, init }); - } - }, { - key: "reduceAssignmentTargetPropertyProperty", - value: function reduceAssignmentTargetPropertyProperty(node, _ref7) { - var name = _ref7.name, binding = _ref7.binding; - return new Shift$1.AssignmentTargetPropertyProperty({ name, binding }); - } - }, { - key: "reduceAssignmentTargetWithDefault", - value: function reduceAssignmentTargetWithDefault(node, _ref8) { - var binding = _ref8.binding, init = _ref8.init; - return new Shift$1.AssignmentTargetWithDefault({ binding, init }); - } - }, { - key: "reduceAwaitExpression", - value: function reduceAwaitExpression(node, _ref9) { - var expression = _ref9.expression; - return new Shift$1.AwaitExpression({ expression }); - } - }, { - key: "reduceBinaryExpression", - value: function reduceBinaryExpression(node, _ref10) { - var left = _ref10.left, right = _ref10.right; - return new Shift$1.BinaryExpression({ left, operator: node.operator, right }); - } - }, { - key: "reduceBindingIdentifier", - value: function reduceBindingIdentifier(node) { - return new Shift$1.BindingIdentifier({ name: node.name }); - } - }, { - key: "reduceBindingPropertyIdentifier", - value: function reduceBindingPropertyIdentifier(node, _ref11) { - var binding = _ref11.binding, init = _ref11.init; - return new Shift$1.BindingPropertyIdentifier({ binding, init }); - } - }, { - key: "reduceBindingPropertyProperty", - value: function reduceBindingPropertyProperty(node, _ref12) { - var name = _ref12.name, binding = _ref12.binding; - return new Shift$1.BindingPropertyProperty({ name, binding }); - } - }, { - key: "reduceBindingWithDefault", - value: function reduceBindingWithDefault(node, _ref13) { - var binding = _ref13.binding, init = _ref13.init; - return new Shift$1.BindingWithDefault({ binding, init }); - } - }, { - key: "reduceBlock", - value: function reduceBlock(node, _ref14) { - var statements = _ref14.statements; - return new Shift$1.Block({ statements }); - } - }, { - key: "reduceBlockStatement", - value: function reduceBlockStatement(node, _ref15) { - var block = _ref15.block; - return new Shift$1.BlockStatement({ block }); - } - }, { - key: "reduceBreakStatement", - value: function reduceBreakStatement(node) { - return new Shift$1.BreakStatement({ label: node.label }); - } - }, { - key: "reduceCallExpression", - value: function reduceCallExpression(node, _ref16) { - var callee = _ref16.callee, _arguments = _ref16.arguments; - return new Shift$1.CallExpression({ callee, arguments: _arguments }); - } - }, { - key: "reduceCatchClause", - value: function reduceCatchClause(node, _ref17) { - var binding = _ref17.binding, body = _ref17.body; - return new Shift$1.CatchClause({ binding, body }); - } - }, { - key: "reduceClassDeclaration", - value: function reduceClassDeclaration(node, _ref18) { - var name = _ref18.name, _super = _ref18.super, elements = _ref18.elements; - return new Shift$1.ClassDeclaration({ name, super: _super, elements }); - } - }, { - key: "reduceClassElement", - value: function reduceClassElement(node, _ref19) { - var method = _ref19.method; - return new Shift$1.ClassElement({ isStatic: node.isStatic, method }); - } - }, { - key: "reduceClassExpression", - value: function reduceClassExpression(node, _ref20) { - var name = _ref20.name, _super = _ref20.super, elements = _ref20.elements; - return new Shift$1.ClassExpression({ name, super: _super, elements }); - } - }, { - key: "reduceCompoundAssignmentExpression", - value: function reduceCompoundAssignmentExpression(node, _ref21) { - var binding = _ref21.binding, expression = _ref21.expression; - return new Shift$1.CompoundAssignmentExpression({ binding, operator: node.operator, expression }); - } - }, { - key: "reduceComputedMemberAssignmentTarget", - value: function reduceComputedMemberAssignmentTarget(node, _ref22) { - var object = _ref22.object, expression = _ref22.expression; - return new Shift$1.ComputedMemberAssignmentTarget({ object, expression }); - } - }, { - key: "reduceComputedMemberExpression", - value: function reduceComputedMemberExpression(node, _ref23) { - var object = _ref23.object, expression = _ref23.expression; - return new Shift$1.ComputedMemberExpression({ object, expression }); - } - }, { - key: "reduceComputedPropertyName", - value: function reduceComputedPropertyName(node, _ref24) { - var expression = _ref24.expression; - return new Shift$1.ComputedPropertyName({ expression }); - } - }, { - key: "reduceConditionalExpression", - value: function reduceConditionalExpression(node, _ref25) { - var test = _ref25.test, consequent = _ref25.consequent, alternate = _ref25.alternate; - return new Shift$1.ConditionalExpression({ test, consequent, alternate }); - } - }, { - key: "reduceContinueStatement", - value: function reduceContinueStatement(node) { - return new Shift$1.ContinueStatement({ label: node.label }); - } - }, { - key: "reduceDataProperty", - value: function reduceDataProperty(node, _ref26) { - var name = _ref26.name, expression = _ref26.expression; - return new Shift$1.DataProperty({ name, expression }); - } - }, { - key: "reduceDebuggerStatement", - value: function reduceDebuggerStatement(node) { - return new Shift$1.DebuggerStatement(); - } - }, { - key: "reduceDirective", - value: function reduceDirective(node) { - return new Shift$1.Directive({ rawValue: node.rawValue }); - } - }, { - key: "reduceDoWhileStatement", - value: function reduceDoWhileStatement(node, _ref27) { - var body = _ref27.body, test = _ref27.test; - return new Shift$1.DoWhileStatement({ body, test }); - } - }, { - key: "reduceEmptyStatement", - value: function reduceEmptyStatement(node) { - return new Shift$1.EmptyStatement(); - } - }, { - key: "reduceExport", - value: function reduceExport(node, _ref28) { - var declaration = _ref28.declaration; - return new Shift$1.Export({ declaration }); - } - }, { - key: "reduceExportAllFrom", - value: function reduceExportAllFrom(node) { - return new Shift$1.ExportAllFrom({ moduleSpecifier: node.moduleSpecifier }); - } - }, { - key: "reduceExportDefault", - value: function reduceExportDefault(node, _ref29) { - var body = _ref29.body; - return new Shift$1.ExportDefault({ body }); - } - }, { - key: "reduceExportFrom", - value: function reduceExportFrom(node, _ref30) { - var namedExports = _ref30.namedExports; - return new Shift$1.ExportFrom({ namedExports, moduleSpecifier: node.moduleSpecifier }); - } - }, { - key: "reduceExportFromSpecifier", - value: function reduceExportFromSpecifier(node) { - return new Shift$1.ExportFromSpecifier({ name: node.name, exportedName: node.exportedName }); - } - }, { - key: "reduceExportLocalSpecifier", - value: function reduceExportLocalSpecifier(node, _ref31) { - var name = _ref31.name; - return new Shift$1.ExportLocalSpecifier({ name, exportedName: node.exportedName }); - } - }, { - key: "reduceExportLocals", - value: function reduceExportLocals(node, _ref32) { - var namedExports = _ref32.namedExports; - return new Shift$1.ExportLocals({ namedExports }); - } - }, { - key: "reduceExpressionStatement", - value: function reduceExpressionStatement(node, _ref33) { - var expression = _ref33.expression; - return new Shift$1.ExpressionStatement({ expression }); - } - }, { - key: "reduceForAwaitStatement", - value: function reduceForAwaitStatement(node, _ref34) { - var left = _ref34.left, right = _ref34.right, body = _ref34.body; - return new Shift$1.ForAwaitStatement({ left, right, body }); - } - }, { - key: "reduceForInStatement", - value: function reduceForInStatement(node, _ref35) { - var left = _ref35.left, right = _ref35.right, body = _ref35.body; - return new Shift$1.ForInStatement({ left, right, body }); - } - }, { - key: "reduceForOfStatement", - value: function reduceForOfStatement(node, _ref36) { - var left = _ref36.left, right = _ref36.right, body = _ref36.body; - return new Shift$1.ForOfStatement({ left, right, body }); - } - }, { - key: "reduceForStatement", - value: function reduceForStatement(node, _ref37) { - var init = _ref37.init, test = _ref37.test, update = _ref37.update, body = _ref37.body; - return new Shift$1.ForStatement({ init, test, update, body }); - } - }, { - key: "reduceFormalParameters", - value: function reduceFormalParameters(node, _ref38) { - var items = _ref38.items, rest = _ref38.rest; - return new Shift$1.FormalParameters({ items, rest }); - } - }, { - key: "reduceFunctionBody", - value: function reduceFunctionBody(node, _ref39) { - var directives = _ref39.directives, statements = _ref39.statements; - return new Shift$1.FunctionBody({ directives, statements }); - } - }, { - key: "reduceFunctionDeclaration", - value: function reduceFunctionDeclaration(node, _ref40) { - var name = _ref40.name, params = _ref40.params, body = _ref40.body; - return new Shift$1.FunctionDeclaration({ isAsync: node.isAsync, isGenerator: node.isGenerator, name, params, body }); - } - }, { - key: "reduceFunctionExpression", - value: function reduceFunctionExpression(node, _ref41) { - var name = _ref41.name, params = _ref41.params, body = _ref41.body; - return new Shift$1.FunctionExpression({ isAsync: node.isAsync, isGenerator: node.isGenerator, name, params, body }); - } - }, { - key: "reduceGetter", - value: function reduceGetter(node, _ref42) { - var name = _ref42.name, body = _ref42.body; - return new Shift$1.Getter({ name, body }); - } - }, { - key: "reduceIdentifierExpression", - value: function reduceIdentifierExpression(node) { - return new Shift$1.IdentifierExpression({ name: node.name }); - } - }, { - key: "reduceIfStatement", - value: function reduceIfStatement(node, _ref43) { - var test = _ref43.test, consequent = _ref43.consequent, alternate = _ref43.alternate; - return new Shift$1.IfStatement({ test, consequent, alternate }); - } - }, { - key: "reduceImport", - value: function reduceImport(node, _ref44) { - var defaultBinding = _ref44.defaultBinding, namedImports = _ref44.namedImports; - return new Shift$1.Import({ defaultBinding, namedImports, moduleSpecifier: node.moduleSpecifier }); - } - }, { - key: "reduceImportNamespace", - value: function reduceImportNamespace(node, _ref45) { - var defaultBinding = _ref45.defaultBinding, namespaceBinding = _ref45.namespaceBinding; - return new Shift$1.ImportNamespace({ defaultBinding, namespaceBinding, moduleSpecifier: node.moduleSpecifier }); - } - }, { - key: "reduceImportSpecifier", - value: function reduceImportSpecifier(node, _ref46) { - var binding = _ref46.binding; - return new Shift$1.ImportSpecifier({ name: node.name, binding }); - } - }, { - key: "reduceLabeledStatement", - value: function reduceLabeledStatement(node, _ref47) { - var body = _ref47.body; - return new Shift$1.LabeledStatement({ label: node.label, body }); - } - }, { - key: "reduceLiteralBooleanExpression", - value: function reduceLiteralBooleanExpression(node) { - return new Shift$1.LiteralBooleanExpression({ value: node.value }); - } - }, { - key: "reduceLiteralInfinityExpression", - value: function reduceLiteralInfinityExpression(node) { - return new Shift$1.LiteralInfinityExpression(); - } - }, { - key: "reduceLiteralNullExpression", - value: function reduceLiteralNullExpression(node) { - return new Shift$1.LiteralNullExpression(); - } - }, { - key: "reduceLiteralNumericExpression", - value: function reduceLiteralNumericExpression(node) { - return new Shift$1.LiteralNumericExpression({ value: node.value }); - } - }, { - key: "reduceLiteralRegExpExpression", - value: function reduceLiteralRegExpExpression(node) { - return new Shift$1.LiteralRegExpExpression({ pattern: node.pattern, global: node.global, ignoreCase: node.ignoreCase, multiLine: node.multiLine, dotAll: node.dotAll, unicode: node.unicode, sticky: node.sticky }); - } - }, { - key: "reduceLiteralStringExpression", - value: function reduceLiteralStringExpression(node) { - return new Shift$1.LiteralStringExpression({ value: node.value }); - } - }, { - key: "reduceMethod", - value: function reduceMethod(node, _ref48) { - var name = _ref48.name, params = _ref48.params, body = _ref48.body; - return new Shift$1.Method({ isAsync: node.isAsync, isGenerator: node.isGenerator, name, params, body }); - } - }, { - key: "reduceModule", - value: function reduceModule(node, _ref49) { - var directives = _ref49.directives, items = _ref49.items; - return new Shift$1.Module({ directives, items }); - } - }, { - key: "reduceNewExpression", - value: function reduceNewExpression(node, _ref50) { - var callee = _ref50.callee, _arguments = _ref50.arguments; - return new Shift$1.NewExpression({ callee, arguments: _arguments }); - } - }, { - key: "reduceNewTargetExpression", - value: function reduceNewTargetExpression(node) { - return new Shift$1.NewTargetExpression(); - } - }, { - key: "reduceObjectAssignmentTarget", - value: function reduceObjectAssignmentTarget(node, _ref51) { - var properties = _ref51.properties, rest = _ref51.rest; - return new Shift$1.ObjectAssignmentTarget({ properties, rest }); - } - }, { - key: "reduceObjectBinding", - value: function reduceObjectBinding(node, _ref52) { - var properties = _ref52.properties, rest = _ref52.rest; - return new Shift$1.ObjectBinding({ properties, rest }); - } - }, { - key: "reduceObjectExpression", - value: function reduceObjectExpression(node, _ref53) { - var properties = _ref53.properties; - return new Shift$1.ObjectExpression({ properties }); - } - }, { - key: "reduceReturnStatement", - value: function reduceReturnStatement(node, _ref54) { - var expression = _ref54.expression; - return new Shift$1.ReturnStatement({ expression }); - } - }, { - key: "reduceScript", - value: function reduceScript(node, _ref55) { - var directives = _ref55.directives, statements = _ref55.statements; - return new Shift$1.Script({ directives, statements }); - } - }, { - key: "reduceSetter", - value: function reduceSetter(node, _ref56) { - var name = _ref56.name, param = _ref56.param, body = _ref56.body; - return new Shift$1.Setter({ name, param, body }); - } - }, { - key: "reduceShorthandProperty", - value: function reduceShorthandProperty(node, _ref57) { - var name = _ref57.name; - return new Shift$1.ShorthandProperty({ name }); - } - }, { - key: "reduceSpreadElement", - value: function reduceSpreadElement(node, _ref58) { - var expression = _ref58.expression; - return new Shift$1.SpreadElement({ expression }); - } - }, { - key: "reduceSpreadProperty", - value: function reduceSpreadProperty(node, _ref59) { - var expression = _ref59.expression; - return new Shift$1.SpreadProperty({ expression }); - } - }, { - key: "reduceStaticMemberAssignmentTarget", - value: function reduceStaticMemberAssignmentTarget(node, _ref60) { - var object = _ref60.object; - return new Shift$1.StaticMemberAssignmentTarget({ object, property: node.property }); - } - }, { - key: "reduceStaticMemberExpression", - value: function reduceStaticMemberExpression(node, _ref61) { - var object = _ref61.object; - return new Shift$1.StaticMemberExpression({ object, property: node.property }); - } - }, { - key: "reduceStaticPropertyName", - value: function reduceStaticPropertyName(node) { - return new Shift$1.StaticPropertyName({ value: node.value }); - } - }, { - key: "reduceSuper", - value: function reduceSuper(node) { - return new Shift$1.Super(); - } - }, { - key: "reduceSwitchCase", - value: function reduceSwitchCase(node, _ref62) { - var test = _ref62.test, consequent = _ref62.consequent; - return new Shift$1.SwitchCase({ test, consequent }); - } - }, { - key: "reduceSwitchDefault", - value: function reduceSwitchDefault(node, _ref63) { - var consequent = _ref63.consequent; - return new Shift$1.SwitchDefault({ consequent }); - } - }, { - key: "reduceSwitchStatement", - value: function reduceSwitchStatement(node, _ref64) { - var discriminant = _ref64.discriminant, cases = _ref64.cases; - return new Shift$1.SwitchStatement({ discriminant, cases }); - } - }, { - key: "reduceSwitchStatementWithDefault", - value: function reduceSwitchStatementWithDefault(node, _ref65) { - var discriminant = _ref65.discriminant, preDefaultCases = _ref65.preDefaultCases, defaultCase = _ref65.defaultCase, postDefaultCases = _ref65.postDefaultCases; - return new Shift$1.SwitchStatementWithDefault({ discriminant, preDefaultCases, defaultCase, postDefaultCases }); - } - }, { - key: "reduceTemplateElement", - value: function reduceTemplateElement(node) { - return new Shift$1.TemplateElement({ rawValue: node.rawValue }); - } - }, { - key: "reduceTemplateExpression", - value: function reduceTemplateExpression(node, _ref66) { - var tag = _ref66.tag, elements = _ref66.elements; - return new Shift$1.TemplateExpression({ tag, elements }); - } - }, { - key: "reduceThisExpression", - value: function reduceThisExpression(node) { - return new Shift$1.ThisExpression(); - } - }, { - key: "reduceThrowStatement", - value: function reduceThrowStatement(node, _ref67) { - var expression = _ref67.expression; - return new Shift$1.ThrowStatement({ expression }); - } - }, { - key: "reduceTryCatchStatement", - value: function reduceTryCatchStatement(node, _ref68) { - var body = _ref68.body, catchClause = _ref68.catchClause; - return new Shift$1.TryCatchStatement({ body, catchClause }); - } - }, { - key: "reduceTryFinallyStatement", - value: function reduceTryFinallyStatement(node, _ref69) { - var body = _ref69.body, catchClause = _ref69.catchClause, finalizer = _ref69.finalizer; - return new Shift$1.TryFinallyStatement({ body, catchClause, finalizer }); - } - }, { - key: "reduceUnaryExpression", - value: function reduceUnaryExpression(node, _ref70) { - var operand = _ref70.operand; - return new Shift$1.UnaryExpression({ operator: node.operator, operand }); - } - }, { - key: "reduceUpdateExpression", - value: function reduceUpdateExpression(node, _ref71) { - var operand = _ref71.operand; - return new Shift$1.UpdateExpression({ isPrefix: node.isPrefix, operator: node.operator, operand }); - } - }, { - key: "reduceVariableDeclaration", - value: function reduceVariableDeclaration(node, _ref72) { - var declarators = _ref72.declarators; - return new Shift$1.VariableDeclaration({ kind: node.kind, declarators }); - } - }, { - key: "reduceVariableDeclarationStatement", - value: function reduceVariableDeclarationStatement(node, _ref73) { - var declaration = _ref73.declaration; - return new Shift$1.VariableDeclarationStatement({ declaration }); - } - }, { - key: "reduceVariableDeclarator", - value: function reduceVariableDeclarator(node, _ref74) { - var binding = _ref74.binding, init = _ref74.init; - return new Shift$1.VariableDeclarator({ binding, init }); - } - }, { - key: "reduceWhileStatement", - value: function reduceWhileStatement(node, _ref75) { - var test = _ref75.test, body = _ref75.body; - return new Shift$1.WhileStatement({ test, body }); - } - }, { - key: "reduceWithStatement", - value: function reduceWithStatement(node, _ref76) { - var object = _ref76.object, body = _ref76.body; - return new Shift$1.WithStatement({ object, body }); - } - }, { - key: "reduceYieldExpression", - value: function reduceYieldExpression(node, _ref77) { - var expression = _ref77.expression; - return new Shift$1.YieldExpression({ expression }); - } - }, { - key: "reduceYieldGeneratorExpression", - value: function reduceYieldGeneratorExpression(node, _ref78) { - var expression = _ref78.expression; - return new Shift$1.YieldGeneratorExpression({ expression }); - } - }]); - return CloneReducer2; -}(); -var _default$7 = cloneReducer$1.default = CloneReducer; -const cloneReducer = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - default: _default$7 -}, [cloneReducer$1]); -const require$$5$1 = /* @__PURE__ */ getAugmentedNamespace(cloneReducer); -var lazyCloneReducer$1 = {}; -Object.defineProperty(lazyCloneReducer$1, "__esModule", { - value: true -}); -var _createClass$9 = function() { - function defineProperties(target, props) { - for (var i2 = 0; i2 < props.length; i2++) { - var descriptor = props[i2]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - return function(Constructor, protoProps, staticProps) { - if (protoProps) - defineProperties(Constructor.prototype, protoProps); - if (staticProps) - defineProperties(Constructor, staticProps); - return Constructor; - }; -}(); -var _shiftAst$3 = require$$0$5; -var Shift = _interopRequireWildcard$1(_shiftAst$3); -function _interopRequireWildcard$1(obj) { - if (obj && obj.__esModule) { - return obj; - } else { - var newObj = {}; - if (obj != null) { - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) - newObj[key] = obj[key]; - } - } - newObj.default = obj; - return newObj; - } -} -function _classCallCheck$b(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} -var LazyCloneReducer = function() { - function LazyCloneReducer2() { - _classCallCheck$b(this, LazyCloneReducer2); - } - _createClass$9(LazyCloneReducer2, [{ - key: "reduceArrayAssignmentTarget", - value: function reduceArrayAssignmentTarget(node, _ref) { - var elements = _ref.elements, rest = _ref.rest; - if (node.elements.length === elements.length && node.elements.every(function(v, i2) { - return v === elements[i2]; - }) && node.rest === rest) { - return node; - } - return new Shift.ArrayAssignmentTarget({ elements, rest }); - } - }, { - key: "reduceArrayBinding", - value: function reduceArrayBinding(node, _ref2) { - var elements = _ref2.elements, rest = _ref2.rest; - if (node.elements.length === elements.length && node.elements.every(function(v, i2) { - return v === elements[i2]; - }) && node.rest === rest) { - return node; - } - return new Shift.ArrayBinding({ elements, rest }); - } - }, { - key: "reduceArrayExpression", - value: function reduceArrayExpression(node, _ref3) { - var elements = _ref3.elements; - if (node.elements.length === elements.length && node.elements.every(function(v, i2) { - return v === elements[i2]; - })) { - return node; - } - return new Shift.ArrayExpression({ elements }); - } - }, { - key: "reduceArrowExpression", - value: function reduceArrowExpression(node, _ref4) { - var params = _ref4.params, body = _ref4.body; - if (node.params === params && node.body === body) { - return node; - } - return new Shift.ArrowExpression({ isAsync: node.isAsync, params, body }); - } - }, { - key: "reduceAssignmentExpression", - value: function reduceAssignmentExpression(node, _ref5) { - var binding = _ref5.binding, expression = _ref5.expression; - if (node.binding === binding && node.expression === expression) { - return node; - } - return new Shift.AssignmentExpression({ binding, expression }); - } - }, { - key: "reduceAssignmentTargetIdentifier", - value: function reduceAssignmentTargetIdentifier(node) { - return node; - } - }, { - key: "reduceAssignmentTargetPropertyIdentifier", - value: function reduceAssignmentTargetPropertyIdentifier(node, _ref6) { - var binding = _ref6.binding, init = _ref6.init; - if (node.binding === binding && node.init === init) { - return node; - } - return new Shift.AssignmentTargetPropertyIdentifier({ binding, init }); - } - }, { - key: "reduceAssignmentTargetPropertyProperty", - value: function reduceAssignmentTargetPropertyProperty(node, _ref7) { - var name = _ref7.name, binding = _ref7.binding; - if (node.name === name && node.binding === binding) { - return node; - } - return new Shift.AssignmentTargetPropertyProperty({ name, binding }); - } - }, { - key: "reduceAssignmentTargetWithDefault", - value: function reduceAssignmentTargetWithDefault(node, _ref8) { - var binding = _ref8.binding, init = _ref8.init; - if (node.binding === binding && node.init === init) { - return node; - } - return new Shift.AssignmentTargetWithDefault({ binding, init }); - } - }, { - key: "reduceAwaitExpression", - value: function reduceAwaitExpression(node, _ref9) { - var expression = _ref9.expression; - if (node.expression === expression) { - return node; - } - return new Shift.AwaitExpression({ expression }); - } - }, { - key: "reduceBinaryExpression", - value: function reduceBinaryExpression(node, _ref10) { - var left = _ref10.left, right = _ref10.right; - if (node.left === left && node.right === right) { - return node; - } - return new Shift.BinaryExpression({ left, operator: node.operator, right }); - } - }, { - key: "reduceBindingIdentifier", - value: function reduceBindingIdentifier(node) { - return node; - } - }, { - key: "reduceBindingPropertyIdentifier", - value: function reduceBindingPropertyIdentifier(node, _ref11) { - var binding = _ref11.binding, init = _ref11.init; - if (node.binding === binding && node.init === init) { - return node; - } - return new Shift.BindingPropertyIdentifier({ binding, init }); - } - }, { - key: "reduceBindingPropertyProperty", - value: function reduceBindingPropertyProperty(node, _ref12) { - var name = _ref12.name, binding = _ref12.binding; - if (node.name === name && node.binding === binding) { - return node; - } - return new Shift.BindingPropertyProperty({ name, binding }); - } - }, { - key: "reduceBindingWithDefault", - value: function reduceBindingWithDefault(node, _ref13) { - var binding = _ref13.binding, init = _ref13.init; - if (node.binding === binding && node.init === init) { - return node; - } - return new Shift.BindingWithDefault({ binding, init }); - } - }, { - key: "reduceBlock", - value: function reduceBlock(node, _ref14) { - var statements = _ref14.statements; - if (node.statements.length === statements.length && node.statements.every(function(v, i2) { - return v === statements[i2]; - })) { - return node; - } - return new Shift.Block({ statements }); - } - }, { - key: "reduceBlockStatement", - value: function reduceBlockStatement(node, _ref15) { - var block = _ref15.block; - if (node.block === block) { - return node; - } - return new Shift.BlockStatement({ block }); - } - }, { - key: "reduceBreakStatement", - value: function reduceBreakStatement(node) { - return node; - } - }, { - key: "reduceCallExpression", - value: function reduceCallExpression(node, _ref16) { - var callee = _ref16.callee, _arguments = _ref16.arguments; - if (node.callee === callee && node.arguments.length === _arguments.length && node.arguments.every(function(v, i2) { - return v === _arguments[i2]; - })) { - return node; - } - return new Shift.CallExpression({ callee, arguments: _arguments }); - } - }, { - key: "reduceCatchClause", - value: function reduceCatchClause(node, _ref17) { - var binding = _ref17.binding, body = _ref17.body; - if (node.binding === binding && node.body === body) { - return node; - } - return new Shift.CatchClause({ binding, body }); - } - }, { - key: "reduceClassDeclaration", - value: function reduceClassDeclaration(node, _ref18) { - var name = _ref18.name, _super = _ref18.super, elements = _ref18.elements; - if (node.name === name && node.super === _super && node.elements.length === elements.length && node.elements.every(function(v, i2) { - return v === elements[i2]; - })) { - return node; - } - return new Shift.ClassDeclaration({ name, super: _super, elements }); - } - }, { - key: "reduceClassElement", - value: function reduceClassElement(node, _ref19) { - var method = _ref19.method; - if (node.method === method) { - return node; - } - return new Shift.ClassElement({ isStatic: node.isStatic, method }); - } - }, { - key: "reduceClassExpression", - value: function reduceClassExpression(node, _ref20) { - var name = _ref20.name, _super = _ref20.super, elements = _ref20.elements; - if (node.name === name && node.super === _super && node.elements.length === elements.length && node.elements.every(function(v, i2) { - return v === elements[i2]; - })) { - return node; - } - return new Shift.ClassExpression({ name, super: _super, elements }); - } - }, { - key: "reduceCompoundAssignmentExpression", - value: function reduceCompoundAssignmentExpression(node, _ref21) { - var binding = _ref21.binding, expression = _ref21.expression; - if (node.binding === binding && node.expression === expression) { - return node; - } - return new Shift.CompoundAssignmentExpression({ binding, operator: node.operator, expression }); - } - }, { - key: "reduceComputedMemberAssignmentTarget", - value: function reduceComputedMemberAssignmentTarget(node, _ref22) { - var object = _ref22.object, expression = _ref22.expression; - if (node.object === object && node.expression === expression) { - return node; - } - return new Shift.ComputedMemberAssignmentTarget({ object, expression }); - } - }, { - key: "reduceComputedMemberExpression", - value: function reduceComputedMemberExpression(node, _ref23) { - var object = _ref23.object, expression = _ref23.expression; - if (node.object === object && node.expression === expression) { - return node; - } - return new Shift.ComputedMemberExpression({ object, expression }); - } - }, { - key: "reduceComputedPropertyName", - value: function reduceComputedPropertyName(node, _ref24) { - var expression = _ref24.expression; - if (node.expression === expression) { - return node; - } - return new Shift.ComputedPropertyName({ expression }); - } - }, { - key: "reduceConditionalExpression", - value: function reduceConditionalExpression(node, _ref25) { - var test = _ref25.test, consequent = _ref25.consequent, alternate = _ref25.alternate; - if (node.test === test && node.consequent === consequent && node.alternate === alternate) { - return node; - } - return new Shift.ConditionalExpression({ test, consequent, alternate }); - } - }, { - key: "reduceContinueStatement", - value: function reduceContinueStatement(node) { - return node; - } - }, { - key: "reduceDataProperty", - value: function reduceDataProperty(node, _ref26) { - var name = _ref26.name, expression = _ref26.expression; - if (node.name === name && node.expression === expression) { - return node; - } - return new Shift.DataProperty({ name, expression }); - } - }, { - key: "reduceDebuggerStatement", - value: function reduceDebuggerStatement(node) { - return node; - } - }, { - key: "reduceDirective", - value: function reduceDirective(node) { - return node; - } - }, { - key: "reduceDoWhileStatement", - value: function reduceDoWhileStatement(node, _ref27) { - var body = _ref27.body, test = _ref27.test; - if (node.body === body && node.test === test) { - return node; - } - return new Shift.DoWhileStatement({ body, test }); - } - }, { - key: "reduceEmptyStatement", - value: function reduceEmptyStatement(node) { - return node; - } - }, { - key: "reduceExport", - value: function reduceExport(node, _ref28) { - var declaration = _ref28.declaration; - if (node.declaration === declaration) { - return node; - } - return new Shift.Export({ declaration }); - } - }, { - key: "reduceExportAllFrom", - value: function reduceExportAllFrom(node) { - return node; - } - }, { - key: "reduceExportDefault", - value: function reduceExportDefault(node, _ref29) { - var body = _ref29.body; - if (node.body === body) { - return node; - } - return new Shift.ExportDefault({ body }); - } - }, { - key: "reduceExportFrom", - value: function reduceExportFrom(node, _ref30) { - var namedExports = _ref30.namedExports; - if (node.namedExports.length === namedExports.length && node.namedExports.every(function(v, i2) { - return v === namedExports[i2]; - })) { - return node; - } - return new Shift.ExportFrom({ namedExports, moduleSpecifier: node.moduleSpecifier }); - } - }, { - key: "reduceExportFromSpecifier", - value: function reduceExportFromSpecifier(node) { - return node; - } - }, { - key: "reduceExportLocalSpecifier", - value: function reduceExportLocalSpecifier(node, _ref31) { - var name = _ref31.name; - if (node.name === name) { - return node; - } - return new Shift.ExportLocalSpecifier({ name, exportedName: node.exportedName }); - } - }, { - key: "reduceExportLocals", - value: function reduceExportLocals(node, _ref32) { - var namedExports = _ref32.namedExports; - if (node.namedExports.length === namedExports.length && node.namedExports.every(function(v, i2) { - return v === namedExports[i2]; - })) { - return node; - } - return new Shift.ExportLocals({ namedExports }); - } - }, { - key: "reduceExpressionStatement", - value: function reduceExpressionStatement(node, _ref33) { - var expression = _ref33.expression; - if (node.expression === expression) { - return node; - } - return new Shift.ExpressionStatement({ expression }); - } - }, { - key: "reduceForAwaitStatement", - value: function reduceForAwaitStatement(node, _ref34) { - var left = _ref34.left, right = _ref34.right, body = _ref34.body; - if (node.left === left && node.right === right && node.body === body) { - return node; - } - return new Shift.ForAwaitStatement({ left, right, body }); - } - }, { - key: "reduceForInStatement", - value: function reduceForInStatement(node, _ref35) { - var left = _ref35.left, right = _ref35.right, body = _ref35.body; - if (node.left === left && node.right === right && node.body === body) { - return node; - } - return new Shift.ForInStatement({ left, right, body }); - } - }, { - key: "reduceForOfStatement", - value: function reduceForOfStatement(node, _ref36) { - var left = _ref36.left, right = _ref36.right, body = _ref36.body; - if (node.left === left && node.right === right && node.body === body) { - return node; - } - return new Shift.ForOfStatement({ left, right, body }); - } - }, { - key: "reduceForStatement", - value: function reduceForStatement(node, _ref37) { - var init = _ref37.init, test = _ref37.test, update = _ref37.update, body = _ref37.body; - if (node.init === init && node.test === test && node.update === update && node.body === body) { - return node; - } - return new Shift.ForStatement({ init, test, update, body }); - } - }, { - key: "reduceFormalParameters", - value: function reduceFormalParameters(node, _ref38) { - var items = _ref38.items, rest = _ref38.rest; - if (node.items.length === items.length && node.items.every(function(v, i2) { - return v === items[i2]; - }) && node.rest === rest) { - return node; - } - return new Shift.FormalParameters({ items, rest }); - } - }, { - key: "reduceFunctionBody", - value: function reduceFunctionBody(node, _ref39) { - var directives = _ref39.directives, statements = _ref39.statements; - if (node.directives.length === directives.length && node.directives.every(function(v, i2) { - return v === directives[i2]; - }) && node.statements.length === statements.length && node.statements.every(function(v, i2) { - return v === statements[i2]; - })) { - return node; - } - return new Shift.FunctionBody({ directives, statements }); - } - }, { - key: "reduceFunctionDeclaration", - value: function reduceFunctionDeclaration(node, _ref40) { - var name = _ref40.name, params = _ref40.params, body = _ref40.body; - if (node.name === name && node.params === params && node.body === body) { - return node; - } - return new Shift.FunctionDeclaration({ isAsync: node.isAsync, isGenerator: node.isGenerator, name, params, body }); - } - }, { - key: "reduceFunctionExpression", - value: function reduceFunctionExpression(node, _ref41) { - var name = _ref41.name, params = _ref41.params, body = _ref41.body; - if (node.name === name && node.params === params && node.body === body) { - return node; - } - return new Shift.FunctionExpression({ isAsync: node.isAsync, isGenerator: node.isGenerator, name, params, body }); - } - }, { - key: "reduceGetter", - value: function reduceGetter(node, _ref42) { - var name = _ref42.name, body = _ref42.body; - if (node.name === name && node.body === body) { - return node; - } - return new Shift.Getter({ name, body }); - } - }, { - key: "reduceIdentifierExpression", - value: function reduceIdentifierExpression(node) { - return node; - } - }, { - key: "reduceIfStatement", - value: function reduceIfStatement(node, _ref43) { - var test = _ref43.test, consequent = _ref43.consequent, alternate = _ref43.alternate; - if (node.test === test && node.consequent === consequent && node.alternate === alternate) { - return node; - } - return new Shift.IfStatement({ test, consequent, alternate }); - } - }, { - key: "reduceImport", - value: function reduceImport(node, _ref44) { - var defaultBinding = _ref44.defaultBinding, namedImports = _ref44.namedImports; - if (node.defaultBinding === defaultBinding && node.namedImports.length === namedImports.length && node.namedImports.every(function(v, i2) { - return v === namedImports[i2]; - })) { - return node; - } - return new Shift.Import({ defaultBinding, namedImports, moduleSpecifier: node.moduleSpecifier }); - } - }, { - key: "reduceImportNamespace", - value: function reduceImportNamespace(node, _ref45) { - var defaultBinding = _ref45.defaultBinding, namespaceBinding = _ref45.namespaceBinding; - if (node.defaultBinding === defaultBinding && node.namespaceBinding === namespaceBinding) { - return node; - } - return new Shift.ImportNamespace({ defaultBinding, namespaceBinding, moduleSpecifier: node.moduleSpecifier }); - } - }, { - key: "reduceImportSpecifier", - value: function reduceImportSpecifier(node, _ref46) { - var binding = _ref46.binding; - if (node.binding === binding) { - return node; - } - return new Shift.ImportSpecifier({ name: node.name, binding }); - } - }, { - key: "reduceLabeledStatement", - value: function reduceLabeledStatement(node, _ref47) { - var body = _ref47.body; - if (node.body === body) { - return node; - } - return new Shift.LabeledStatement({ label: node.label, body }); - } - }, { - key: "reduceLiteralBooleanExpression", - value: function reduceLiteralBooleanExpression(node) { - return node; - } - }, { - key: "reduceLiteralInfinityExpression", - value: function reduceLiteralInfinityExpression(node) { - return node; - } - }, { - key: "reduceLiteralNullExpression", - value: function reduceLiteralNullExpression(node) { - return node; - } - }, { - key: "reduceLiteralNumericExpression", - value: function reduceLiteralNumericExpression(node) { - return node; - } - }, { - key: "reduceLiteralRegExpExpression", - value: function reduceLiteralRegExpExpression(node) { - return node; - } - }, { - key: "reduceLiteralStringExpression", - value: function reduceLiteralStringExpression(node) { - return node; - } - }, { - key: "reduceMethod", - value: function reduceMethod(node, _ref48) { - var name = _ref48.name, params = _ref48.params, body = _ref48.body; - if (node.name === name && node.params === params && node.body === body) { - return node; - } - return new Shift.Method({ isAsync: node.isAsync, isGenerator: node.isGenerator, name, params, body }); - } - }, { - key: "reduceModule", - value: function reduceModule(node, _ref49) { - var directives = _ref49.directives, items = _ref49.items; - if (node.directives.length === directives.length && node.directives.every(function(v, i2) { - return v === directives[i2]; - }) && node.items.length === items.length && node.items.every(function(v, i2) { - return v === items[i2]; - })) { - return node; - } - return new Shift.Module({ directives, items }); - } - }, { - key: "reduceNewExpression", - value: function reduceNewExpression(node, _ref50) { - var callee = _ref50.callee, _arguments = _ref50.arguments; - if (node.callee === callee && node.arguments.length === _arguments.length && node.arguments.every(function(v, i2) { - return v === _arguments[i2]; - })) { - return node; - } - return new Shift.NewExpression({ callee, arguments: _arguments }); - } - }, { - key: "reduceNewTargetExpression", - value: function reduceNewTargetExpression(node) { - return node; - } - }, { - key: "reduceObjectAssignmentTarget", - value: function reduceObjectAssignmentTarget(node, _ref51) { - var properties = _ref51.properties, rest = _ref51.rest; - if (node.properties.length === properties.length && node.properties.every(function(v, i2) { - return v === properties[i2]; - }) && node.rest === rest) { - return node; - } - return new Shift.ObjectAssignmentTarget({ properties, rest }); - } - }, { - key: "reduceObjectBinding", - value: function reduceObjectBinding(node, _ref52) { - var properties = _ref52.properties, rest = _ref52.rest; - if (node.properties.length === properties.length && node.properties.every(function(v, i2) { - return v === properties[i2]; - }) && node.rest === rest) { - return node; - } - return new Shift.ObjectBinding({ properties, rest }); - } - }, { - key: "reduceObjectExpression", - value: function reduceObjectExpression(node, _ref53) { - var properties = _ref53.properties; - if (node.properties.length === properties.length && node.properties.every(function(v, i2) { - return v === properties[i2]; - })) { - return node; - } - return new Shift.ObjectExpression({ properties }); - } - }, { - key: "reduceReturnStatement", - value: function reduceReturnStatement(node, _ref54) { - var expression = _ref54.expression; - if (node.expression === expression) { - return node; - } - return new Shift.ReturnStatement({ expression }); - } - }, { - key: "reduceScript", - value: function reduceScript(node, _ref55) { - var directives = _ref55.directives, statements = _ref55.statements; - if (node.directives.length === directives.length && node.directives.every(function(v, i2) { - return v === directives[i2]; - }) && node.statements.length === statements.length && node.statements.every(function(v, i2) { - return v === statements[i2]; - })) { - return node; - } - return new Shift.Script({ directives, statements }); - } - }, { - key: "reduceSetter", - value: function reduceSetter(node, _ref56) { - var name = _ref56.name, param = _ref56.param, body = _ref56.body; - if (node.name === name && node.param === param && node.body === body) { - return node; - } - return new Shift.Setter({ name, param, body }); - } - }, { - key: "reduceShorthandProperty", - value: function reduceShorthandProperty(node, _ref57) { - var name = _ref57.name; - if (node.name === name) { - return node; - } - return new Shift.ShorthandProperty({ name }); - } - }, { - key: "reduceSpreadElement", - value: function reduceSpreadElement(node, _ref58) { - var expression = _ref58.expression; - if (node.expression === expression) { - return node; - } - return new Shift.SpreadElement({ expression }); - } - }, { - key: "reduceSpreadProperty", - value: function reduceSpreadProperty(node, _ref59) { - var expression = _ref59.expression; - if (node.expression === expression) { - return node; - } - return new Shift.SpreadProperty({ expression }); - } - }, { - key: "reduceStaticMemberAssignmentTarget", - value: function reduceStaticMemberAssignmentTarget(node, _ref60) { - var object = _ref60.object; - if (node.object === object) { - return node; - } - return new Shift.StaticMemberAssignmentTarget({ object, property: node.property }); - } - }, { - key: "reduceStaticMemberExpression", - value: function reduceStaticMemberExpression(node, _ref61) { - var object = _ref61.object; - if (node.object === object) { - return node; - } - return new Shift.StaticMemberExpression({ object, property: node.property }); - } - }, { - key: "reduceStaticPropertyName", - value: function reduceStaticPropertyName(node) { - return node; - } - }, { - key: "reduceSuper", - value: function reduceSuper(node) { - return node; - } - }, { - key: "reduceSwitchCase", - value: function reduceSwitchCase(node, _ref62) { - var test = _ref62.test, consequent = _ref62.consequent; - if (node.test === test && node.consequent.length === consequent.length && node.consequent.every(function(v, i2) { - return v === consequent[i2]; - })) { - return node; - } - return new Shift.SwitchCase({ test, consequent }); - } - }, { - key: "reduceSwitchDefault", - value: function reduceSwitchDefault(node, _ref63) { - var consequent = _ref63.consequent; - if (node.consequent.length === consequent.length && node.consequent.every(function(v, i2) { - return v === consequent[i2]; - })) { - return node; - } - return new Shift.SwitchDefault({ consequent }); - } - }, { - key: "reduceSwitchStatement", - value: function reduceSwitchStatement(node, _ref64) { - var discriminant = _ref64.discriminant, cases = _ref64.cases; - if (node.discriminant === discriminant && node.cases.length === cases.length && node.cases.every(function(v, i2) { - return v === cases[i2]; - })) { - return node; - } - return new Shift.SwitchStatement({ discriminant, cases }); - } - }, { - key: "reduceSwitchStatementWithDefault", - value: function reduceSwitchStatementWithDefault(node, _ref65) { - var discriminant = _ref65.discriminant, preDefaultCases = _ref65.preDefaultCases, defaultCase = _ref65.defaultCase, postDefaultCases = _ref65.postDefaultCases; - if (node.discriminant === discriminant && node.preDefaultCases.length === preDefaultCases.length && node.preDefaultCases.every(function(v, i2) { - return v === preDefaultCases[i2]; - }) && node.defaultCase === defaultCase && node.postDefaultCases.length === postDefaultCases.length && node.postDefaultCases.every(function(v, i2) { - return v === postDefaultCases[i2]; - })) { - return node; - } - return new Shift.SwitchStatementWithDefault({ discriminant, preDefaultCases, defaultCase, postDefaultCases }); - } - }, { - key: "reduceTemplateElement", - value: function reduceTemplateElement(node) { - return node; - } - }, { - key: "reduceTemplateExpression", - value: function reduceTemplateExpression(node, _ref66) { - var tag = _ref66.tag, elements = _ref66.elements; - if (node.tag === tag && node.elements.length === elements.length && node.elements.every(function(v, i2) { - return v === elements[i2]; - })) { - return node; - } - return new Shift.TemplateExpression({ tag, elements }); - } - }, { - key: "reduceThisExpression", - value: function reduceThisExpression(node) { - return node; - } - }, { - key: "reduceThrowStatement", - value: function reduceThrowStatement(node, _ref67) { - var expression = _ref67.expression; - if (node.expression === expression) { - return node; - } - return new Shift.ThrowStatement({ expression }); - } - }, { - key: "reduceTryCatchStatement", - value: function reduceTryCatchStatement(node, _ref68) { - var body = _ref68.body, catchClause = _ref68.catchClause; - if (node.body === body && node.catchClause === catchClause) { - return node; - } - return new Shift.TryCatchStatement({ body, catchClause }); - } - }, { - key: "reduceTryFinallyStatement", - value: function reduceTryFinallyStatement(node, _ref69) { - var body = _ref69.body, catchClause = _ref69.catchClause, finalizer = _ref69.finalizer; - if (node.body === body && node.catchClause === catchClause && node.finalizer === finalizer) { - return node; - } - return new Shift.TryFinallyStatement({ body, catchClause, finalizer }); - } - }, { - key: "reduceUnaryExpression", - value: function reduceUnaryExpression(node, _ref70) { - var operand = _ref70.operand; - if (node.operand === operand) { - return node; - } - return new Shift.UnaryExpression({ operator: node.operator, operand }); - } - }, { - key: "reduceUpdateExpression", - value: function reduceUpdateExpression(node, _ref71) { - var operand = _ref71.operand; - if (node.operand === operand) { - return node; - } - return new Shift.UpdateExpression({ isPrefix: node.isPrefix, operator: node.operator, operand }); - } - }, { - key: "reduceVariableDeclaration", - value: function reduceVariableDeclaration(node, _ref72) { - var declarators = _ref72.declarators; - if (node.declarators.length === declarators.length && node.declarators.every(function(v, i2) { - return v === declarators[i2]; - })) { - return node; - } - return new Shift.VariableDeclaration({ kind: node.kind, declarators }); - } - }, { - key: "reduceVariableDeclarationStatement", - value: function reduceVariableDeclarationStatement(node, _ref73) { - var declaration = _ref73.declaration; - if (node.declaration === declaration) { - return node; - } - return new Shift.VariableDeclarationStatement({ declaration }); - } - }, { - key: "reduceVariableDeclarator", - value: function reduceVariableDeclarator(node, _ref74) { - var binding = _ref74.binding, init = _ref74.init; - if (node.binding === binding && node.init === init) { - return node; - } - return new Shift.VariableDeclarator({ binding, init }); - } - }, { - key: "reduceWhileStatement", - value: function reduceWhileStatement(node, _ref75) { - var test = _ref75.test, body = _ref75.body; - if (node.test === test && node.body === body) { - return node; - } - return new Shift.WhileStatement({ test, body }); - } - }, { - key: "reduceWithStatement", - value: function reduceWithStatement(node, _ref76) { - var object = _ref76.object, body = _ref76.body; - if (node.object === object && node.body === body) { - return node; - } - return new Shift.WithStatement({ object, body }); - } - }, { - key: "reduceYieldExpression", - value: function reduceYieldExpression(node, _ref77) { - var expression = _ref77.expression; - if (node.expression === expression) { - return node; - } - return new Shift.YieldExpression({ expression }); - } - }, { - key: "reduceYieldGeneratorExpression", - value: function reduceYieldGeneratorExpression(node, _ref78) { - var expression = _ref78.expression; - if (node.expression === expression) { - return node; - } - return new Shift.YieldGeneratorExpression({ expression }); - } - }]); - return LazyCloneReducer2; -}(); -var _default$6 = lazyCloneReducer$1.default = LazyCloneReducer; -const lazyCloneReducer = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - default: _default$6 -}, [lazyCloneReducer$1]); -const require$$6 = /* @__PURE__ */ getAugmentedNamespace(lazyCloneReducer); -var monoidalReducer$1 = {}; -Object.defineProperty(monoidalReducer$1, "__esModule", { - value: true -}); -var _createClass$8 = function() { - function defineProperties(target, props) { - for (var i2 = 0; i2 < props.length; i2++) { - var descriptor = props[i2]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - return function(Constructor, protoProps, staticProps) { - if (protoProps) - defineProperties(Constructor.prototype, protoProps); - if (staticProps) - defineProperties(Constructor, staticProps); - return Constructor; - }; -}(); -var _shiftAst$2 = require$$0$5; -_interopRequireDefault$7(_shiftAst$2); -function _interopRequireDefault$7(obj) { - return obj && obj.__esModule ? obj : { default: obj }; -} -function _toConsumableArray$5(arr) { - if (Array.isArray(arr)) { - for (var i2 = 0, arr2 = Array(arr.length); i2 < arr.length; i2++) { - arr2[i2] = arr[i2]; - } - return arr2; - } else { - return Array.from(arr); - } -} -function _classCallCheck$a(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} -var MonoidalReducer$1 = function() { - function MonoidalReducer2(monoid) { - _classCallCheck$a(this, MonoidalReducer2); - var identity2 = monoid.empty(); - this.identity = identity2; - var concat5 = void 0; - if (monoid.prototype && typeof monoid.prototype.concat === "function") { - concat5 = Function.prototype.call.bind(monoid.prototype.concat); - } else if (typeof monoid.concat === "function") { - concat5 = monoid.concat; - } else { - throw new TypeError("Monoid must provide a `concat` method"); - } - this.append = function() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - return args.reduce(concat5, identity2); - }; - } - _createClass$8(MonoidalReducer2, [{ - key: "reduceArrayAssignmentTarget", - value: function reduceArrayAssignmentTarget(node, _ref) { - var elements = _ref.elements, rest = _ref.rest; - return this.append.apply(this, _toConsumableArray$5(elements.filter(function(n) { - return n != null; - })).concat([rest == null ? this.identity : rest])); - } - }, { - key: "reduceArrayBinding", - value: function reduceArrayBinding(node, _ref2) { - var elements = _ref2.elements, rest = _ref2.rest; - return this.append.apply(this, _toConsumableArray$5(elements.filter(function(n) { - return n != null; - })).concat([rest == null ? this.identity : rest])); - } - }, { - key: "reduceArrayExpression", - value: function reduceArrayExpression(node, _ref3) { - var elements = _ref3.elements; - return this.append.apply(this, _toConsumableArray$5(elements.filter(function(n) { - return n != null; - }))); - } - }, { - key: "reduceArrowExpression", - value: function reduceArrowExpression(node, _ref4) { - var params = _ref4.params, body = _ref4.body; - return this.append(params, body); - } - }, { - key: "reduceAssignmentExpression", - value: function reduceAssignmentExpression(node, _ref5) { - var binding = _ref5.binding, expression = _ref5.expression; - return this.append(binding, expression); - } - }, { - key: "reduceAssignmentTargetIdentifier", - value: function reduceAssignmentTargetIdentifier(node) { - return this.identity; - } - }, { - key: "reduceAssignmentTargetPropertyIdentifier", - value: function reduceAssignmentTargetPropertyIdentifier(node, _ref6) { - var binding = _ref6.binding, init = _ref6.init; - return this.append(binding, init == null ? this.identity : init); - } - }, { - key: "reduceAssignmentTargetPropertyProperty", - value: function reduceAssignmentTargetPropertyProperty(node, _ref7) { - var name = _ref7.name, binding = _ref7.binding; - return this.append(name, binding); - } - }, { - key: "reduceAssignmentTargetWithDefault", - value: function reduceAssignmentTargetWithDefault(node, _ref8) { - var binding = _ref8.binding, init = _ref8.init; - return this.append(binding, init); - } - }, { - key: "reduceAwaitExpression", - value: function reduceAwaitExpression(node, _ref9) { - var expression = _ref9.expression; - return expression; - } - }, { - key: "reduceBinaryExpression", - value: function reduceBinaryExpression(node, _ref10) { - var left = _ref10.left, right = _ref10.right; - return this.append(left, right); - } - }, { - key: "reduceBindingIdentifier", - value: function reduceBindingIdentifier(node) { - return this.identity; - } - }, { - key: "reduceBindingPropertyIdentifier", - value: function reduceBindingPropertyIdentifier(node, _ref11) { - var binding = _ref11.binding, init = _ref11.init; - return this.append(binding, init == null ? this.identity : init); - } - }, { - key: "reduceBindingPropertyProperty", - value: function reduceBindingPropertyProperty(node, _ref12) { - var name = _ref12.name, binding = _ref12.binding; - return this.append(name, binding); - } - }, { - key: "reduceBindingWithDefault", - value: function reduceBindingWithDefault(node, _ref13) { - var binding = _ref13.binding, init = _ref13.init; - return this.append(binding, init); - } - }, { - key: "reduceBlock", - value: function reduceBlock(node, _ref14) { - var statements = _ref14.statements; - return this.append.apply(this, _toConsumableArray$5(statements)); - } - }, { - key: "reduceBlockStatement", - value: function reduceBlockStatement(node, _ref15) { - var block = _ref15.block; - return block; - } - }, { - key: "reduceBreakStatement", - value: function reduceBreakStatement(node) { - return this.identity; - } - }, { - key: "reduceCallExpression", - value: function reduceCallExpression(node, _ref16) { - var callee = _ref16.callee, _arguments = _ref16.arguments; - return this.append.apply(this, [callee].concat(_toConsumableArray$5(_arguments))); - } - }, { - key: "reduceCatchClause", - value: function reduceCatchClause(node, _ref17) { - var binding = _ref17.binding, body = _ref17.body; - return this.append(binding, body); - } - }, { - key: "reduceClassDeclaration", - value: function reduceClassDeclaration(node, _ref18) { - var name = _ref18.name, _super = _ref18.super, elements = _ref18.elements; - return this.append.apply(this, [name, _super == null ? this.identity : _super].concat(_toConsumableArray$5(elements))); - } - }, { - key: "reduceClassElement", - value: function reduceClassElement(node, _ref19) { - var method = _ref19.method; - return method; - } - }, { - key: "reduceClassExpression", - value: function reduceClassExpression(node, _ref20) { - var name = _ref20.name, _super = _ref20.super, elements = _ref20.elements; - return this.append.apply(this, [name == null ? this.identity : name, _super == null ? this.identity : _super].concat(_toConsumableArray$5(elements))); - } - }, { - key: "reduceCompoundAssignmentExpression", - value: function reduceCompoundAssignmentExpression(node, _ref21) { - var binding = _ref21.binding, expression = _ref21.expression; - return this.append(binding, expression); - } - }, { - key: "reduceComputedMemberAssignmentTarget", - value: function reduceComputedMemberAssignmentTarget(node, _ref22) { - var object = _ref22.object, expression = _ref22.expression; - return this.append(object, expression); - } - }, { - key: "reduceComputedMemberExpression", - value: function reduceComputedMemberExpression(node, _ref23) { - var object = _ref23.object, expression = _ref23.expression; - return this.append(object, expression); - } - }, { - key: "reduceComputedPropertyName", - value: function reduceComputedPropertyName(node, _ref24) { - var expression = _ref24.expression; - return expression; - } - }, { - key: "reduceConditionalExpression", - value: function reduceConditionalExpression(node, _ref25) { - var test = _ref25.test, consequent = _ref25.consequent, alternate = _ref25.alternate; - return this.append(test, consequent, alternate); - } - }, { - key: "reduceContinueStatement", - value: function reduceContinueStatement(node) { - return this.identity; - } - }, { - key: "reduceDataProperty", - value: function reduceDataProperty(node, _ref26) { - var name = _ref26.name, expression = _ref26.expression; - return this.append(name, expression); - } - }, { - key: "reduceDebuggerStatement", - value: function reduceDebuggerStatement(node) { - return this.identity; - } - }, { - key: "reduceDirective", - value: function reduceDirective(node) { - return this.identity; - } - }, { - key: "reduceDoWhileStatement", - value: function reduceDoWhileStatement(node, _ref27) { - var body = _ref27.body, test = _ref27.test; - return this.append(body, test); - } - }, { - key: "reduceEmptyStatement", - value: function reduceEmptyStatement(node) { - return this.identity; - } - }, { - key: "reduceExport", - value: function reduceExport(node, _ref28) { - var declaration = _ref28.declaration; - return declaration; - } - }, { - key: "reduceExportAllFrom", - value: function reduceExportAllFrom(node) { - return this.identity; - } - }, { - key: "reduceExportDefault", - value: function reduceExportDefault(node, _ref29) { - var body = _ref29.body; - return body; - } - }, { - key: "reduceExportFrom", - value: function reduceExportFrom(node, _ref30) { - var namedExports = _ref30.namedExports; - return this.append.apply(this, _toConsumableArray$5(namedExports)); - } - }, { - key: "reduceExportFromSpecifier", - value: function reduceExportFromSpecifier(node) { - return this.identity; - } - }, { - key: "reduceExportLocalSpecifier", - value: function reduceExportLocalSpecifier(node, _ref31) { - var name = _ref31.name; - return name; - } - }, { - key: "reduceExportLocals", - value: function reduceExportLocals(node, _ref32) { - var namedExports = _ref32.namedExports; - return this.append.apply(this, _toConsumableArray$5(namedExports)); - } - }, { - key: "reduceExpressionStatement", - value: function reduceExpressionStatement(node, _ref33) { - var expression = _ref33.expression; - return expression; - } - }, { - key: "reduceForAwaitStatement", - value: function reduceForAwaitStatement(node, _ref34) { - var left = _ref34.left, right = _ref34.right, body = _ref34.body; - return this.append(left, right, body); - } - }, { - key: "reduceForInStatement", - value: function reduceForInStatement(node, _ref35) { - var left = _ref35.left, right = _ref35.right, body = _ref35.body; - return this.append(left, right, body); - } - }, { - key: "reduceForOfStatement", - value: function reduceForOfStatement(node, _ref36) { - var left = _ref36.left, right = _ref36.right, body = _ref36.body; - return this.append(left, right, body); - } - }, { - key: "reduceForStatement", - value: function reduceForStatement(node, _ref37) { - var init = _ref37.init, test = _ref37.test, update = _ref37.update, body = _ref37.body; - return this.append(init == null ? this.identity : init, test == null ? this.identity : test, update == null ? this.identity : update, body); - } - }, { - key: "reduceFormalParameters", - value: function reduceFormalParameters(node, _ref38) { - var items = _ref38.items, rest = _ref38.rest; - return this.append.apply(this, _toConsumableArray$5(items).concat([rest == null ? this.identity : rest])); - } - }, { - key: "reduceFunctionBody", - value: function reduceFunctionBody(node, _ref39) { - var directives = _ref39.directives, statements = _ref39.statements; - return this.append.apply(this, _toConsumableArray$5(directives).concat(_toConsumableArray$5(statements))); - } - }, { - key: "reduceFunctionDeclaration", - value: function reduceFunctionDeclaration(node, _ref40) { - var name = _ref40.name, params = _ref40.params, body = _ref40.body; - return this.append(name, params, body); - } - }, { - key: "reduceFunctionExpression", - value: function reduceFunctionExpression(node, _ref41) { - var name = _ref41.name, params = _ref41.params, body = _ref41.body; - return this.append(name == null ? this.identity : name, params, body); - } - }, { - key: "reduceGetter", - value: function reduceGetter(node, _ref42) { - var name = _ref42.name, body = _ref42.body; - return this.append(name, body); - } - }, { - key: "reduceIdentifierExpression", - value: function reduceIdentifierExpression(node) { - return this.identity; - } - }, { - key: "reduceIfStatement", - value: function reduceIfStatement(node, _ref43) { - var test = _ref43.test, consequent = _ref43.consequent, alternate = _ref43.alternate; - return this.append(test, consequent, alternate == null ? this.identity : alternate); - } - }, { - key: "reduceImport", - value: function reduceImport(node, _ref44) { - var defaultBinding = _ref44.defaultBinding, namedImports = _ref44.namedImports; - return this.append.apply(this, [defaultBinding == null ? this.identity : defaultBinding].concat(_toConsumableArray$5(namedImports))); - } - }, { - key: "reduceImportNamespace", - value: function reduceImportNamespace(node, _ref45) { - var defaultBinding = _ref45.defaultBinding, namespaceBinding = _ref45.namespaceBinding; - return this.append(defaultBinding == null ? this.identity : defaultBinding, namespaceBinding); - } - }, { - key: "reduceImportSpecifier", - value: function reduceImportSpecifier(node, _ref46) { - var binding = _ref46.binding; - return binding; - } - }, { - key: "reduceLabeledStatement", - value: function reduceLabeledStatement(node, _ref47) { - var body = _ref47.body; - return body; - } - }, { - key: "reduceLiteralBooleanExpression", - value: function reduceLiteralBooleanExpression(node) { - return this.identity; - } - }, { - key: "reduceLiteralInfinityExpression", - value: function reduceLiteralInfinityExpression(node) { - return this.identity; - } - }, { - key: "reduceLiteralNullExpression", - value: function reduceLiteralNullExpression(node) { - return this.identity; - } - }, { - key: "reduceLiteralNumericExpression", - value: function reduceLiteralNumericExpression(node) { - return this.identity; - } - }, { - key: "reduceLiteralRegExpExpression", - value: function reduceLiteralRegExpExpression(node) { - return this.identity; - } - }, { - key: "reduceLiteralStringExpression", - value: function reduceLiteralStringExpression(node) { - return this.identity; - } - }, { - key: "reduceMethod", - value: function reduceMethod(node, _ref48) { - var name = _ref48.name, params = _ref48.params, body = _ref48.body; - return this.append(name, params, body); - } - }, { - key: "reduceModule", - value: function reduceModule(node, _ref49) { - var directives = _ref49.directives, items = _ref49.items; - return this.append.apply(this, _toConsumableArray$5(directives).concat(_toConsumableArray$5(items))); - } - }, { - key: "reduceNewExpression", - value: function reduceNewExpression(node, _ref50) { - var callee = _ref50.callee, _arguments = _ref50.arguments; - return this.append.apply(this, [callee].concat(_toConsumableArray$5(_arguments))); - } - }, { - key: "reduceNewTargetExpression", - value: function reduceNewTargetExpression(node) { - return this.identity; - } - }, { - key: "reduceObjectAssignmentTarget", - value: function reduceObjectAssignmentTarget(node, _ref51) { - var properties = _ref51.properties, rest = _ref51.rest; - return this.append.apply(this, _toConsumableArray$5(properties).concat([rest == null ? this.identity : rest])); - } - }, { - key: "reduceObjectBinding", - value: function reduceObjectBinding(node, _ref52) { - var properties = _ref52.properties, rest = _ref52.rest; - return this.append.apply(this, _toConsumableArray$5(properties).concat([rest == null ? this.identity : rest])); - } - }, { - key: "reduceObjectExpression", - value: function reduceObjectExpression(node, _ref53) { - var properties = _ref53.properties; - return this.append.apply(this, _toConsumableArray$5(properties)); - } - }, { - key: "reduceReturnStatement", - value: function reduceReturnStatement(node, _ref54) { - var expression = _ref54.expression; - return expression == null ? this.identity : expression; - } - }, { - key: "reduceScript", - value: function reduceScript(node, _ref55) { - var directives = _ref55.directives, statements = _ref55.statements; - return this.append.apply(this, _toConsumableArray$5(directives).concat(_toConsumableArray$5(statements))); - } - }, { - key: "reduceSetter", - value: function reduceSetter(node, _ref56) { - var name = _ref56.name, param = _ref56.param, body = _ref56.body; - return this.append(name, param, body); - } - }, { - key: "reduceShorthandProperty", - value: function reduceShorthandProperty(node, _ref57) { - var name = _ref57.name; - return name; - } - }, { - key: "reduceSpreadElement", - value: function reduceSpreadElement(node, _ref58) { - var expression = _ref58.expression; - return expression; - } - }, { - key: "reduceSpreadProperty", - value: function reduceSpreadProperty(node, _ref59) { - var expression = _ref59.expression; - return expression; - } - }, { - key: "reduceStaticMemberAssignmentTarget", - value: function reduceStaticMemberAssignmentTarget(node, _ref60) { - var object = _ref60.object; - return object; - } - }, { - key: "reduceStaticMemberExpression", - value: function reduceStaticMemberExpression(node, _ref61) { - var object = _ref61.object; - return object; - } - }, { - key: "reduceStaticPropertyName", - value: function reduceStaticPropertyName(node) { - return this.identity; - } - }, { - key: "reduceSuper", - value: function reduceSuper(node) { - return this.identity; - } - }, { - key: "reduceSwitchCase", - value: function reduceSwitchCase(node, _ref62) { - var test = _ref62.test, consequent = _ref62.consequent; - return this.append.apply(this, [test].concat(_toConsumableArray$5(consequent))); - } - }, { - key: "reduceSwitchDefault", - value: function reduceSwitchDefault(node, _ref63) { - var consequent = _ref63.consequent; - return this.append.apply(this, _toConsumableArray$5(consequent)); - } - }, { - key: "reduceSwitchStatement", - value: function reduceSwitchStatement(node, _ref64) { - var discriminant = _ref64.discriminant, cases = _ref64.cases; - return this.append.apply(this, [discriminant].concat(_toConsumableArray$5(cases))); - } - }, { - key: "reduceSwitchStatementWithDefault", - value: function reduceSwitchStatementWithDefault(node, _ref65) { - var discriminant = _ref65.discriminant, preDefaultCases = _ref65.preDefaultCases, defaultCase = _ref65.defaultCase, postDefaultCases = _ref65.postDefaultCases; - return this.append.apply(this, [discriminant].concat(_toConsumableArray$5(preDefaultCases), [defaultCase], _toConsumableArray$5(postDefaultCases))); - } - }, { - key: "reduceTemplateElement", - value: function reduceTemplateElement(node) { - return this.identity; - } - }, { - key: "reduceTemplateExpression", - value: function reduceTemplateExpression(node, _ref66) { - var tag = _ref66.tag, elements = _ref66.elements; - return this.append.apply(this, [tag == null ? this.identity : tag].concat(_toConsumableArray$5(elements))); - } - }, { - key: "reduceThisExpression", - value: function reduceThisExpression(node) { - return this.identity; - } - }, { - key: "reduceThrowStatement", - value: function reduceThrowStatement(node, _ref67) { - var expression = _ref67.expression; - return expression; - } - }, { - key: "reduceTryCatchStatement", - value: function reduceTryCatchStatement(node, _ref68) { - var body = _ref68.body, catchClause = _ref68.catchClause; - return this.append(body, catchClause); - } - }, { - key: "reduceTryFinallyStatement", - value: function reduceTryFinallyStatement(node, _ref69) { - var body = _ref69.body, catchClause = _ref69.catchClause, finalizer = _ref69.finalizer; - return this.append(body, catchClause == null ? this.identity : catchClause, finalizer); - } - }, { - key: "reduceUnaryExpression", - value: function reduceUnaryExpression(node, _ref70) { - var operand = _ref70.operand; - return operand; - } - }, { - key: "reduceUpdateExpression", - value: function reduceUpdateExpression(node, _ref71) { - var operand = _ref71.operand; - return operand; - } - }, { - key: "reduceVariableDeclaration", - value: function reduceVariableDeclaration(node, _ref72) { - var declarators = _ref72.declarators; - return this.append.apply(this, _toConsumableArray$5(declarators)); - } - }, { - key: "reduceVariableDeclarationStatement", - value: function reduceVariableDeclarationStatement(node, _ref73) { - var declaration = _ref73.declaration; - return declaration; - } - }, { - key: "reduceVariableDeclarator", - value: function reduceVariableDeclarator(node, _ref74) { - var binding = _ref74.binding, init = _ref74.init; - return this.append(binding, init == null ? this.identity : init); - } - }, { - key: "reduceWhileStatement", - value: function reduceWhileStatement(node, _ref75) { - var test = _ref75.test, body = _ref75.body; - return this.append(test, body); - } - }, { - key: "reduceWithStatement", - value: function reduceWithStatement(node, _ref76) { - var object = _ref76.object, body = _ref76.body; - return this.append(object, body); - } - }, { - key: "reduceYieldExpression", - value: function reduceYieldExpression(node, _ref77) { - var expression = _ref77.expression; - return expression == null ? this.identity : expression; - } - }, { - key: "reduceYieldGeneratorExpression", - value: function reduceYieldGeneratorExpression(node, _ref78) { - var expression = _ref78.expression; - return expression; - } - }]); - return MonoidalReducer2; -}(); -var _default$5 = monoidalReducer$1.default = MonoidalReducer$1; -const monoidalReducer = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - default: _default$5 -}, [monoidalReducer$1]); -const require$$7 = /* @__PURE__ */ getAugmentedNamespace(monoidalReducer); -var thunkedMonoidalReducer$1 = {}; -Object.defineProperty(thunkedMonoidalReducer$1, "__esModule", { - value: true -}); -var _createClass$7 = function() { - function defineProperties(target, props) { - for (var i2 = 0; i2 < props.length; i2++) { - var descriptor = props[i2]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - return function(Constructor, protoProps, staticProps) { - if (protoProps) - defineProperties(Constructor.prototype, protoProps); - if (staticProps) - defineProperties(Constructor, staticProps); - return Constructor; - }; -}(); -var _shiftAst$1 = require$$0$5; -_interopRequireDefault$6(_shiftAst$1); -function _interopRequireDefault$6(obj) { - return obj && obj.__esModule ? obj : { default: obj }; -} -function _toConsumableArray$4(arr) { - if (Array.isArray(arr)) { - for (var i2 = 0, arr2 = Array(arr.length); i2 < arr.length; i2++) { - arr2[i2] = arr[i2]; - } - return arr2; - } else { - return Array.from(arr); - } -} -function _classCallCheck$9(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} -var MonoidalReducer = function() { - function MonoidalReducer2(monoid) { - _classCallCheck$9(this, MonoidalReducer2); - var identity2 = monoid.empty(); - this.identity = identity2; - var concatThunk3 = void 0; - if (monoid.prototype && typeof monoid.prototype.concatThunk === "function") { - concatThunk3 = Function.prototype.call.bind(monoid.prototype.concatThunk); - } else if (typeof monoid.concatThunk === "function") { - concatThunk3 = monoid.concatThunk; - } else { - var concat5 = void 0; - if (monoid.prototype && typeof monoid.prototype.concat === "function") { - concat5 = Function.prototype.call.bind(monoid.prototype.concat); - } else if (typeof monoid.concat === "function") { - concat5 = monoid.concat; - } else { - throw new TypeError("Monoid must provide a `concatThunk` or `concat` method"); - } - if (typeof monoid.isAbsorbing === "function") { - var isAbsorbing = monoid.isAbsorbing; - concatThunk3 = function concatThunk4(a, b) { - return isAbsorbing(a) ? a : concat5(a, b()); - }; - } else { - concatThunk3 = function concatThunk4(a, b) { - return concat5(a, b()); - }; - } - } - this.append = function() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - return args.reduce(concatThunk3, identity2); - }; - } - _createClass$7(MonoidalReducer2, [{ - key: "reduceArrayAssignmentTarget", - value: function reduceArrayAssignmentTarget(node, _ref) { - var _this = this; - var elements = _ref.elements, rest = _ref.rest; - return this.append.apply(this, _toConsumableArray$4(elements.filter(function(n) { - return n != null; - })).concat([rest == null ? function() { - return _this.identity; - } : rest])); - } - }, { - key: "reduceArrayBinding", - value: function reduceArrayBinding(node, _ref2) { - var _this2 = this; - var elements = _ref2.elements, rest = _ref2.rest; - return this.append.apply(this, _toConsumableArray$4(elements.filter(function(n) { - return n != null; - })).concat([rest == null ? function() { - return _this2.identity; - } : rest])); - } - }, { - key: "reduceArrayExpression", - value: function reduceArrayExpression(node, _ref3) { - var elements = _ref3.elements; - return this.append.apply(this, _toConsumableArray$4(elements.filter(function(n) { - return n != null; - }))); - } - }, { - key: "reduceArrowExpression", - value: function reduceArrowExpression(node, _ref4) { - var params = _ref4.params, body = _ref4.body; - return this.append(params, body); - } - }, { - key: "reduceAssignmentExpression", - value: function reduceAssignmentExpression(node, _ref5) { - var binding = _ref5.binding, expression = _ref5.expression; - return this.append(binding, expression); - } - }, { - key: "reduceAssignmentTargetIdentifier", - value: function reduceAssignmentTargetIdentifier(node) { - return this.identity; - } - }, { - key: "reduceAssignmentTargetPropertyIdentifier", - value: function reduceAssignmentTargetPropertyIdentifier(node, _ref6) { - var _this3 = this; - var binding = _ref6.binding, init = _ref6.init; - return this.append(binding, init == null ? function() { - return _this3.identity; - } : init); - } - }, { - key: "reduceAssignmentTargetPropertyProperty", - value: function reduceAssignmentTargetPropertyProperty(node, _ref7) { - var name = _ref7.name, binding = _ref7.binding; - return this.append(name, binding); - } - }, { - key: "reduceAssignmentTargetWithDefault", - value: function reduceAssignmentTargetWithDefault(node, _ref8) { - var binding = _ref8.binding, init = _ref8.init; - return this.append(binding, init); - } - }, { - key: "reduceAwaitExpression", - value: function reduceAwaitExpression(node, _ref9) { - var expression = _ref9.expression; - return expression(); - } - }, { - key: "reduceBinaryExpression", - value: function reduceBinaryExpression(node, _ref10) { - var left = _ref10.left, right = _ref10.right; - return this.append(left, right); - } - }, { - key: "reduceBindingIdentifier", - value: function reduceBindingIdentifier(node) { - return this.identity; - } - }, { - key: "reduceBindingPropertyIdentifier", - value: function reduceBindingPropertyIdentifier(node, _ref11) { - var _this4 = this; - var binding = _ref11.binding, init = _ref11.init; - return this.append(binding, init == null ? function() { - return _this4.identity; - } : init); - } - }, { - key: "reduceBindingPropertyProperty", - value: function reduceBindingPropertyProperty(node, _ref12) { - var name = _ref12.name, binding = _ref12.binding; - return this.append(name, binding); - } - }, { - key: "reduceBindingWithDefault", - value: function reduceBindingWithDefault(node, _ref13) { - var binding = _ref13.binding, init = _ref13.init; - return this.append(binding, init); - } - }, { - key: "reduceBlock", - value: function reduceBlock(node, _ref14) { - var statements = _ref14.statements; - return this.append.apply(this, _toConsumableArray$4(statements)); - } - }, { - key: "reduceBlockStatement", - value: function reduceBlockStatement(node, _ref15) { - var block = _ref15.block; - return block(); - } - }, { - key: "reduceBreakStatement", - value: function reduceBreakStatement(node) { - return this.identity; - } - }, { - key: "reduceCallExpression", - value: function reduceCallExpression(node, _ref16) { - var callee = _ref16.callee, _arguments = _ref16.arguments; - return this.append.apply(this, [callee].concat(_toConsumableArray$4(_arguments))); - } - }, { - key: "reduceCatchClause", - value: function reduceCatchClause(node, _ref17) { - var binding = _ref17.binding, body = _ref17.body; - return this.append(binding, body); - } - }, { - key: "reduceClassDeclaration", - value: function reduceClassDeclaration(node, _ref18) { - var _this5 = this; - var name = _ref18.name, _super = _ref18.super, elements = _ref18.elements; - return this.append.apply(this, [name, _super == null ? function() { - return _this5.identity; - } : _super].concat(_toConsumableArray$4(elements))); - } - }, { - key: "reduceClassElement", - value: function reduceClassElement(node, _ref19) { - var method = _ref19.method; - return method(); - } - }, { - key: "reduceClassExpression", - value: function reduceClassExpression(node, _ref20) { - var _this6 = this; - var name = _ref20.name, _super = _ref20.super, elements = _ref20.elements; - return this.append.apply(this, [name == null ? function() { - return _this6.identity; - } : name, _super == null ? function() { - return _this6.identity; - } : _super].concat(_toConsumableArray$4(elements))); - } - }, { - key: "reduceCompoundAssignmentExpression", - value: function reduceCompoundAssignmentExpression(node, _ref21) { - var binding = _ref21.binding, expression = _ref21.expression; - return this.append(binding, expression); - } - }, { - key: "reduceComputedMemberAssignmentTarget", - value: function reduceComputedMemberAssignmentTarget(node, _ref22) { - var object = _ref22.object, expression = _ref22.expression; - return this.append(object, expression); - } - }, { - key: "reduceComputedMemberExpression", - value: function reduceComputedMemberExpression(node, _ref23) { - var object = _ref23.object, expression = _ref23.expression; - return this.append(object, expression); - } - }, { - key: "reduceComputedPropertyName", - value: function reduceComputedPropertyName(node, _ref24) { - var expression = _ref24.expression; - return expression(); - } - }, { - key: "reduceConditionalExpression", - value: function reduceConditionalExpression(node, _ref25) { - var test = _ref25.test, consequent = _ref25.consequent, alternate = _ref25.alternate; - return this.append(test, consequent, alternate); - } - }, { - key: "reduceContinueStatement", - value: function reduceContinueStatement(node) { - return this.identity; - } - }, { - key: "reduceDataProperty", - value: function reduceDataProperty(node, _ref26) { - var name = _ref26.name, expression = _ref26.expression; - return this.append(name, expression); - } - }, { - key: "reduceDebuggerStatement", - value: function reduceDebuggerStatement(node) { - return this.identity; - } - }, { - key: "reduceDirective", - value: function reduceDirective(node) { - return this.identity; - } - }, { - key: "reduceDoWhileStatement", - value: function reduceDoWhileStatement(node, _ref27) { - var body = _ref27.body, test = _ref27.test; - return this.append(body, test); - } - }, { - key: "reduceEmptyStatement", - value: function reduceEmptyStatement(node) { - return this.identity; - } - }, { - key: "reduceExport", - value: function reduceExport(node, _ref28) { - var declaration = _ref28.declaration; - return declaration(); - } - }, { - key: "reduceExportAllFrom", - value: function reduceExportAllFrom(node) { - return this.identity; - } - }, { - key: "reduceExportDefault", - value: function reduceExportDefault(node, _ref29) { - var body = _ref29.body; - return body(); - } - }, { - key: "reduceExportFrom", - value: function reduceExportFrom(node, _ref30) { - var namedExports = _ref30.namedExports; - return this.append.apply(this, _toConsumableArray$4(namedExports)); - } - }, { - key: "reduceExportFromSpecifier", - value: function reduceExportFromSpecifier(node) { - return this.identity; - } - }, { - key: "reduceExportLocalSpecifier", - value: function reduceExportLocalSpecifier(node, _ref31) { - var name = _ref31.name; - return name(); - } - }, { - key: "reduceExportLocals", - value: function reduceExportLocals(node, _ref32) { - var namedExports = _ref32.namedExports; - return this.append.apply(this, _toConsumableArray$4(namedExports)); - } - }, { - key: "reduceExpressionStatement", - value: function reduceExpressionStatement(node, _ref33) { - var expression = _ref33.expression; - return expression(); - } - }, { - key: "reduceForAwaitStatement", - value: function reduceForAwaitStatement(node, _ref34) { - var left = _ref34.left, right = _ref34.right, body = _ref34.body; - return this.append(left, right, body); - } - }, { - key: "reduceForInStatement", - value: function reduceForInStatement(node, _ref35) { - var left = _ref35.left, right = _ref35.right, body = _ref35.body; - return this.append(left, right, body); - } - }, { - key: "reduceForOfStatement", - value: function reduceForOfStatement(node, _ref36) { - var left = _ref36.left, right = _ref36.right, body = _ref36.body; - return this.append(left, right, body); - } - }, { - key: "reduceForStatement", - value: function reduceForStatement(node, _ref37) { - var _this7 = this; - var init = _ref37.init, test = _ref37.test, update = _ref37.update, body = _ref37.body; - return this.append(init == null ? function() { - return _this7.identity; - } : init, test == null ? function() { - return _this7.identity; - } : test, update == null ? function() { - return _this7.identity; - } : update, body); - } - }, { - key: "reduceFormalParameters", - value: function reduceFormalParameters(node, _ref38) { - var _this8 = this; - var items = _ref38.items, rest = _ref38.rest; - return this.append.apply(this, _toConsumableArray$4(items).concat([rest == null ? function() { - return _this8.identity; - } : rest])); - } - }, { - key: "reduceFunctionBody", - value: function reduceFunctionBody(node, _ref39) { - var directives = _ref39.directives, statements = _ref39.statements; - return this.append.apply(this, _toConsumableArray$4(directives).concat(_toConsumableArray$4(statements))); - } - }, { - key: "reduceFunctionDeclaration", - value: function reduceFunctionDeclaration(node, _ref40) { - var name = _ref40.name, params = _ref40.params, body = _ref40.body; - return this.append(name, params, body); - } - }, { - key: "reduceFunctionExpression", - value: function reduceFunctionExpression(node, _ref41) { - var _this9 = this; - var name = _ref41.name, params = _ref41.params, body = _ref41.body; - return this.append(name == null ? function() { - return _this9.identity; - } : name, params, body); - } - }, { - key: "reduceGetter", - value: function reduceGetter(node, _ref42) { - var name = _ref42.name, body = _ref42.body; - return this.append(name, body); - } - }, { - key: "reduceIdentifierExpression", - value: function reduceIdentifierExpression(node) { - return this.identity; - } - }, { - key: "reduceIfStatement", - value: function reduceIfStatement(node, _ref43) { - var _this10 = this; - var test = _ref43.test, consequent = _ref43.consequent, alternate = _ref43.alternate; - return this.append(test, consequent, alternate == null ? function() { - return _this10.identity; - } : alternate); - } - }, { - key: "reduceImport", - value: function reduceImport(node, _ref44) { - var _this11 = this; - var defaultBinding = _ref44.defaultBinding, namedImports = _ref44.namedImports; - return this.append.apply(this, [defaultBinding == null ? function() { - return _this11.identity; - } : defaultBinding].concat(_toConsumableArray$4(namedImports))); - } - }, { - key: "reduceImportNamespace", - value: function reduceImportNamespace(node, _ref45) { - var _this12 = this; - var defaultBinding = _ref45.defaultBinding, namespaceBinding = _ref45.namespaceBinding; - return this.append(defaultBinding == null ? function() { - return _this12.identity; - } : defaultBinding, namespaceBinding); - } - }, { - key: "reduceImportSpecifier", - value: function reduceImportSpecifier(node, _ref46) { - var binding = _ref46.binding; - return binding(); - } - }, { - key: "reduceLabeledStatement", - value: function reduceLabeledStatement(node, _ref47) { - var body = _ref47.body; - return body(); - } - }, { - key: "reduceLiteralBooleanExpression", - value: function reduceLiteralBooleanExpression(node) { - return this.identity; - } - }, { - key: "reduceLiteralInfinityExpression", - value: function reduceLiteralInfinityExpression(node) { - return this.identity; - } - }, { - key: "reduceLiteralNullExpression", - value: function reduceLiteralNullExpression(node) { - return this.identity; - } - }, { - key: "reduceLiteralNumericExpression", - value: function reduceLiteralNumericExpression(node) { - return this.identity; - } - }, { - key: "reduceLiteralRegExpExpression", - value: function reduceLiteralRegExpExpression(node) { - return this.identity; - } - }, { - key: "reduceLiteralStringExpression", - value: function reduceLiteralStringExpression(node) { - return this.identity; - } - }, { - key: "reduceMethod", - value: function reduceMethod(node, _ref48) { - var name = _ref48.name, params = _ref48.params, body = _ref48.body; - return this.append(name, params, body); - } - }, { - key: "reduceModule", - value: function reduceModule(node, _ref49) { - var directives = _ref49.directives, items = _ref49.items; - return this.append.apply(this, _toConsumableArray$4(directives).concat(_toConsumableArray$4(items))); - } - }, { - key: "reduceNewExpression", - value: function reduceNewExpression(node, _ref50) { - var callee = _ref50.callee, _arguments = _ref50.arguments; - return this.append.apply(this, [callee].concat(_toConsumableArray$4(_arguments))); - } - }, { - key: "reduceNewTargetExpression", - value: function reduceNewTargetExpression(node) { - return this.identity; - } - }, { - key: "reduceObjectAssignmentTarget", - value: function reduceObjectAssignmentTarget(node, _ref51) { - var _this13 = this; - var properties = _ref51.properties, rest = _ref51.rest; - return this.append.apply(this, _toConsumableArray$4(properties).concat([rest == null ? function() { - return _this13.identity; - } : rest])); - } - }, { - key: "reduceObjectBinding", - value: function reduceObjectBinding(node, _ref52) { - var _this14 = this; - var properties = _ref52.properties, rest = _ref52.rest; - return this.append.apply(this, _toConsumableArray$4(properties).concat([rest == null ? function() { - return _this14.identity; - } : rest])); - } - }, { - key: "reduceObjectExpression", - value: function reduceObjectExpression(node, _ref53) { - var properties = _ref53.properties; - return this.append.apply(this, _toConsumableArray$4(properties)); - } - }, { - key: "reduceReturnStatement", - value: function reduceReturnStatement(node, _ref54) { - var expression = _ref54.expression; - return expression == null ? this.identity : expression(); - } - }, { - key: "reduceScript", - value: function reduceScript(node, _ref55) { - var directives = _ref55.directives, statements = _ref55.statements; - return this.append.apply(this, _toConsumableArray$4(directives).concat(_toConsumableArray$4(statements))); - } - }, { - key: "reduceSetter", - value: function reduceSetter(node, _ref56) { - var name = _ref56.name, param = _ref56.param, body = _ref56.body; - return this.append(name, param, body); - } - }, { - key: "reduceShorthandProperty", - value: function reduceShorthandProperty(node, _ref57) { - var name = _ref57.name; - return name(); - } - }, { - key: "reduceSpreadElement", - value: function reduceSpreadElement(node, _ref58) { - var expression = _ref58.expression; - return expression(); - } - }, { - key: "reduceSpreadProperty", - value: function reduceSpreadProperty(node, _ref59) { - var expression = _ref59.expression; - return expression(); - } - }, { - key: "reduceStaticMemberAssignmentTarget", - value: function reduceStaticMemberAssignmentTarget(node, _ref60) { - var object = _ref60.object; - return object(); - } - }, { - key: "reduceStaticMemberExpression", - value: function reduceStaticMemberExpression(node, _ref61) { - var object = _ref61.object; - return object(); - } - }, { - key: "reduceStaticPropertyName", - value: function reduceStaticPropertyName(node) { - return this.identity; - } - }, { - key: "reduceSuper", - value: function reduceSuper(node) { - return this.identity; - } - }, { - key: "reduceSwitchCase", - value: function reduceSwitchCase(node, _ref62) { - var test = _ref62.test, consequent = _ref62.consequent; - return this.append.apply(this, [test].concat(_toConsumableArray$4(consequent))); - } - }, { - key: "reduceSwitchDefault", - value: function reduceSwitchDefault(node, _ref63) { - var consequent = _ref63.consequent; - return this.append.apply(this, _toConsumableArray$4(consequent)); - } - }, { - key: "reduceSwitchStatement", - value: function reduceSwitchStatement(node, _ref64) { - var discriminant = _ref64.discriminant, cases = _ref64.cases; - return this.append.apply(this, [discriminant].concat(_toConsumableArray$4(cases))); - } - }, { - key: "reduceSwitchStatementWithDefault", - value: function reduceSwitchStatementWithDefault(node, _ref65) { - var discriminant = _ref65.discriminant, preDefaultCases = _ref65.preDefaultCases, defaultCase = _ref65.defaultCase, postDefaultCases = _ref65.postDefaultCases; - return this.append.apply(this, [discriminant].concat(_toConsumableArray$4(preDefaultCases), [defaultCase], _toConsumableArray$4(postDefaultCases))); - } - }, { - key: "reduceTemplateElement", - value: function reduceTemplateElement(node) { - return this.identity; - } - }, { - key: "reduceTemplateExpression", - value: function reduceTemplateExpression(node, _ref66) { - var _this15 = this; - var tag = _ref66.tag, elements = _ref66.elements; - return this.append.apply(this, [tag == null ? function() { - return _this15.identity; - } : tag].concat(_toConsumableArray$4(elements))); - } - }, { - key: "reduceThisExpression", - value: function reduceThisExpression(node) { - return this.identity; - } - }, { - key: "reduceThrowStatement", - value: function reduceThrowStatement(node, _ref67) { - var expression = _ref67.expression; - return expression(); - } - }, { - key: "reduceTryCatchStatement", - value: function reduceTryCatchStatement(node, _ref68) { - var body = _ref68.body, catchClause = _ref68.catchClause; - return this.append(body, catchClause); - } - }, { - key: "reduceTryFinallyStatement", - value: function reduceTryFinallyStatement(node, _ref69) { - var _this16 = this; - var body = _ref69.body, catchClause = _ref69.catchClause, finalizer = _ref69.finalizer; - return this.append(body, catchClause == null ? function() { - return _this16.identity; - } : catchClause, finalizer); - } - }, { - key: "reduceUnaryExpression", - value: function reduceUnaryExpression(node, _ref70) { - var operand = _ref70.operand; - return operand(); - } - }, { - key: "reduceUpdateExpression", - value: function reduceUpdateExpression(node, _ref71) { - var operand = _ref71.operand; - return operand(); - } - }, { - key: "reduceVariableDeclaration", - value: function reduceVariableDeclaration(node, _ref72) { - var declarators = _ref72.declarators; - return this.append.apply(this, _toConsumableArray$4(declarators)); - } - }, { - key: "reduceVariableDeclarationStatement", - value: function reduceVariableDeclarationStatement(node, _ref73) { - var declaration = _ref73.declaration; - return declaration(); - } - }, { - key: "reduceVariableDeclarator", - value: function reduceVariableDeclarator(node, _ref74) { - var _this17 = this; - var binding = _ref74.binding, init = _ref74.init; - return this.append(binding, init == null ? function() { - return _this17.identity; - } : init); - } - }, { - key: "reduceWhileStatement", - value: function reduceWhileStatement(node, _ref75) { - var test = _ref75.test, body = _ref75.body; - return this.append(test, body); - } - }, { - key: "reduceWithStatement", - value: function reduceWithStatement(node, _ref76) { - var object = _ref76.object, body = _ref76.body; - return this.append(object, body); - } - }, { - key: "reduceYieldExpression", - value: function reduceYieldExpression(node, _ref77) { - var expression = _ref77.expression; - return expression == null ? this.identity : expression(); - } - }, { - key: "reduceYieldGeneratorExpression", - value: function reduceYieldGeneratorExpression(node, _ref78) { - var expression = _ref78.expression; - return expression(); - } - }]); - return MonoidalReducer2; -}(); -var _default$4 = thunkedMonoidalReducer$1.default = MonoidalReducer; -const thunkedMonoidalReducer = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - default: _default$4 -}, [thunkedMonoidalReducer$1]); -const require$$8 = /* @__PURE__ */ getAugmentedNamespace(thunkedMonoidalReducer); -var adapt$1 = {}; -Object.defineProperty(adapt$1, "__esModule", { - value: true -}); -var _get$2 = function get2(object, property, receiver) { - if (object === null) - object = Function.prototype; - var desc = Object.getOwnPropertyDescriptor(object, property); - if (desc === void 0) { - var parent = Object.getPrototypeOf(object); - if (parent === null) { - return void 0; - } else { - return get2(parent, property, receiver); - } - } else if ("value" in desc) { - return desc.value; - } else { - var getter = desc.get; - if (getter === void 0) { - return void 0; - } - return getter.call(receiver); - } -}; -var _shiftAst = require$$0$5; -_interopRequireWildcard(_shiftAst); -function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } else { - var newObj = {}; - if (obj != null) { - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) - newObj[key] = obj[key]; - } - } - newObj.default = obj; - return newObj; - } -} -var _default$3 = adapt$1.default = function(fn, reducer) { - var _obj; - return _obj = { - __proto__: reducer, - reduceArrayAssignmentTarget: function reduceArrayAssignmentTarget(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceArrayAssignmentTarget", this).call(this, node, data), node); - }, - reduceArrayBinding: function reduceArrayBinding(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceArrayBinding", this).call(this, node, data), node); - }, - reduceArrayExpression: function reduceArrayExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceArrayExpression", this).call(this, node, data), node); - }, - reduceArrowExpression: function reduceArrowExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceArrowExpression", this).call(this, node, data), node); - }, - reduceAssignmentExpression: function reduceAssignmentExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceAssignmentExpression", this).call(this, node, data), node); - }, - reduceAssignmentTargetIdentifier: function reduceAssignmentTargetIdentifier(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceAssignmentTargetIdentifier", this).call(this, node, data), node); - }, - reduceAssignmentTargetPropertyIdentifier: function reduceAssignmentTargetPropertyIdentifier(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceAssignmentTargetPropertyIdentifier", this).call(this, node, data), node); - }, - reduceAssignmentTargetPropertyProperty: function reduceAssignmentTargetPropertyProperty(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceAssignmentTargetPropertyProperty", this).call(this, node, data), node); - }, - reduceAssignmentTargetWithDefault: function reduceAssignmentTargetWithDefault(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceAssignmentTargetWithDefault", this).call(this, node, data), node); - }, - reduceAwaitExpression: function reduceAwaitExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceAwaitExpression", this).call(this, node, data), node); - }, - reduceBinaryExpression: function reduceBinaryExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceBinaryExpression", this).call(this, node, data), node); - }, - reduceBindingIdentifier: function reduceBindingIdentifier(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceBindingIdentifier", this).call(this, node, data), node); - }, - reduceBindingPropertyIdentifier: function reduceBindingPropertyIdentifier(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceBindingPropertyIdentifier", this).call(this, node, data), node); - }, - reduceBindingPropertyProperty: function reduceBindingPropertyProperty(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceBindingPropertyProperty", this).call(this, node, data), node); - }, - reduceBindingWithDefault: function reduceBindingWithDefault(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceBindingWithDefault", this).call(this, node, data), node); - }, - reduceBlock: function reduceBlock(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceBlock", this).call(this, node, data), node); - }, - reduceBlockStatement: function reduceBlockStatement(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceBlockStatement", this).call(this, node, data), node); - }, - reduceBreakStatement: function reduceBreakStatement(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceBreakStatement", this).call(this, node, data), node); - }, - reduceCallExpression: function reduceCallExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceCallExpression", this).call(this, node, data), node); - }, - reduceCatchClause: function reduceCatchClause(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceCatchClause", this).call(this, node, data), node); - }, - reduceClassDeclaration: function reduceClassDeclaration(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceClassDeclaration", this).call(this, node, data), node); - }, - reduceClassElement: function reduceClassElement(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceClassElement", this).call(this, node, data), node); - }, - reduceClassExpression: function reduceClassExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceClassExpression", this).call(this, node, data), node); - }, - reduceCompoundAssignmentExpression: function reduceCompoundAssignmentExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceCompoundAssignmentExpression", this).call(this, node, data), node); - }, - reduceComputedMemberAssignmentTarget: function reduceComputedMemberAssignmentTarget(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceComputedMemberAssignmentTarget", this).call(this, node, data), node); - }, - reduceComputedMemberExpression: function reduceComputedMemberExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceComputedMemberExpression", this).call(this, node, data), node); - }, - reduceComputedPropertyName: function reduceComputedPropertyName(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceComputedPropertyName", this).call(this, node, data), node); - }, - reduceConditionalExpression: function reduceConditionalExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceConditionalExpression", this).call(this, node, data), node); - }, - reduceContinueStatement: function reduceContinueStatement(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceContinueStatement", this).call(this, node, data), node); - }, - reduceDataProperty: function reduceDataProperty(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceDataProperty", this).call(this, node, data), node); - }, - reduceDebuggerStatement: function reduceDebuggerStatement(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceDebuggerStatement", this).call(this, node, data), node); - }, - reduceDirective: function reduceDirective(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceDirective", this).call(this, node, data), node); - }, - reduceDoWhileStatement: function reduceDoWhileStatement(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceDoWhileStatement", this).call(this, node, data), node); - }, - reduceEmptyStatement: function reduceEmptyStatement(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceEmptyStatement", this).call(this, node, data), node); - }, - reduceExport: function reduceExport(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceExport", this).call(this, node, data), node); - }, - reduceExportAllFrom: function reduceExportAllFrom(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceExportAllFrom", this).call(this, node, data), node); - }, - reduceExportDefault: function reduceExportDefault(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceExportDefault", this).call(this, node, data), node); - }, - reduceExportFrom: function reduceExportFrom(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceExportFrom", this).call(this, node, data), node); - }, - reduceExportFromSpecifier: function reduceExportFromSpecifier(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceExportFromSpecifier", this).call(this, node, data), node); - }, - reduceExportLocalSpecifier: function reduceExportLocalSpecifier(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceExportLocalSpecifier", this).call(this, node, data), node); - }, - reduceExportLocals: function reduceExportLocals(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceExportLocals", this).call(this, node, data), node); - }, - reduceExpressionStatement: function reduceExpressionStatement(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceExpressionStatement", this).call(this, node, data), node); - }, - reduceForAwaitStatement: function reduceForAwaitStatement(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceForAwaitStatement", this).call(this, node, data), node); - }, - reduceForInStatement: function reduceForInStatement(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceForInStatement", this).call(this, node, data), node); - }, - reduceForOfStatement: function reduceForOfStatement(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceForOfStatement", this).call(this, node, data), node); - }, - reduceForStatement: function reduceForStatement(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceForStatement", this).call(this, node, data), node); - }, - reduceFormalParameters: function reduceFormalParameters(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceFormalParameters", this).call(this, node, data), node); - }, - reduceFunctionBody: function reduceFunctionBody(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceFunctionBody", this).call(this, node, data), node); - }, - reduceFunctionDeclaration: function reduceFunctionDeclaration(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceFunctionDeclaration", this).call(this, node, data), node); - }, - reduceFunctionExpression: function reduceFunctionExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceFunctionExpression", this).call(this, node, data), node); - }, - reduceGetter: function reduceGetter(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceGetter", this).call(this, node, data), node); - }, - reduceIdentifierExpression: function reduceIdentifierExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceIdentifierExpression", this).call(this, node, data), node); - }, - reduceIfStatement: function reduceIfStatement(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceIfStatement", this).call(this, node, data), node); - }, - reduceImport: function reduceImport(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceImport", this).call(this, node, data), node); - }, - reduceImportNamespace: function reduceImportNamespace(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceImportNamespace", this).call(this, node, data), node); - }, - reduceImportSpecifier: function reduceImportSpecifier(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceImportSpecifier", this).call(this, node, data), node); - }, - reduceLabeledStatement: function reduceLabeledStatement(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceLabeledStatement", this).call(this, node, data), node); - }, - reduceLiteralBooleanExpression: function reduceLiteralBooleanExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceLiteralBooleanExpression", this).call(this, node, data), node); - }, - reduceLiteralInfinityExpression: function reduceLiteralInfinityExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceLiteralInfinityExpression", this).call(this, node, data), node); - }, - reduceLiteralNullExpression: function reduceLiteralNullExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceLiteralNullExpression", this).call(this, node, data), node); - }, - reduceLiteralNumericExpression: function reduceLiteralNumericExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceLiteralNumericExpression", this).call(this, node, data), node); - }, - reduceLiteralRegExpExpression: function reduceLiteralRegExpExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceLiteralRegExpExpression", this).call(this, node, data), node); - }, - reduceLiteralStringExpression: function reduceLiteralStringExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceLiteralStringExpression", this).call(this, node, data), node); - }, - reduceMethod: function reduceMethod(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceMethod", this).call(this, node, data), node); - }, - reduceModule: function reduceModule(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceModule", this).call(this, node, data), node); - }, - reduceNewExpression: function reduceNewExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceNewExpression", this).call(this, node, data), node); - }, - reduceNewTargetExpression: function reduceNewTargetExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceNewTargetExpression", this).call(this, node, data), node); - }, - reduceObjectAssignmentTarget: function reduceObjectAssignmentTarget(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceObjectAssignmentTarget", this).call(this, node, data), node); - }, - reduceObjectBinding: function reduceObjectBinding(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceObjectBinding", this).call(this, node, data), node); - }, - reduceObjectExpression: function reduceObjectExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceObjectExpression", this).call(this, node, data), node); - }, - reduceReturnStatement: function reduceReturnStatement(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceReturnStatement", this).call(this, node, data), node); - }, - reduceScript: function reduceScript(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceScript", this).call(this, node, data), node); - }, - reduceSetter: function reduceSetter(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceSetter", this).call(this, node, data), node); - }, - reduceShorthandProperty: function reduceShorthandProperty(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceShorthandProperty", this).call(this, node, data), node); - }, - reduceSpreadElement: function reduceSpreadElement(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceSpreadElement", this).call(this, node, data), node); - }, - reduceSpreadProperty: function reduceSpreadProperty(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceSpreadProperty", this).call(this, node, data), node); - }, - reduceStaticMemberAssignmentTarget: function reduceStaticMemberAssignmentTarget(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceStaticMemberAssignmentTarget", this).call(this, node, data), node); - }, - reduceStaticMemberExpression: function reduceStaticMemberExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceStaticMemberExpression", this).call(this, node, data), node); - }, - reduceStaticPropertyName: function reduceStaticPropertyName(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceStaticPropertyName", this).call(this, node, data), node); - }, - reduceSuper: function reduceSuper(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceSuper", this).call(this, node, data), node); - }, - reduceSwitchCase: function reduceSwitchCase(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceSwitchCase", this).call(this, node, data), node); - }, - reduceSwitchDefault: function reduceSwitchDefault(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceSwitchDefault", this).call(this, node, data), node); - }, - reduceSwitchStatement: function reduceSwitchStatement(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceSwitchStatement", this).call(this, node, data), node); - }, - reduceSwitchStatementWithDefault: function reduceSwitchStatementWithDefault(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceSwitchStatementWithDefault", this).call(this, node, data), node); - }, - reduceTemplateElement: function reduceTemplateElement(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceTemplateElement", this).call(this, node, data), node); - }, - reduceTemplateExpression: function reduceTemplateExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceTemplateExpression", this).call(this, node, data), node); - }, - reduceThisExpression: function reduceThisExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceThisExpression", this).call(this, node, data), node); - }, - reduceThrowStatement: function reduceThrowStatement(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceThrowStatement", this).call(this, node, data), node); - }, - reduceTryCatchStatement: function reduceTryCatchStatement(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceTryCatchStatement", this).call(this, node, data), node); - }, - reduceTryFinallyStatement: function reduceTryFinallyStatement(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceTryFinallyStatement", this).call(this, node, data), node); - }, - reduceUnaryExpression: function reduceUnaryExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceUnaryExpression", this).call(this, node, data), node); - }, - reduceUpdateExpression: function reduceUpdateExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceUpdateExpression", this).call(this, node, data), node); - }, - reduceVariableDeclaration: function reduceVariableDeclaration(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceVariableDeclaration", this).call(this, node, data), node); - }, - reduceVariableDeclarationStatement: function reduceVariableDeclarationStatement(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceVariableDeclarationStatement", this).call(this, node, data), node); - }, - reduceVariableDeclarator: function reduceVariableDeclarator(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceVariableDeclarator", this).call(this, node, data), node); - }, - reduceWhileStatement: function reduceWhileStatement(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceWhileStatement", this).call(this, node, data), node); - }, - reduceWithStatement: function reduceWithStatement(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceWithStatement", this).call(this, node, data), node); - }, - reduceYieldExpression: function reduceYieldExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceYieldExpression", this).call(this, node, data), node); - }, - reduceYieldGeneratorExpression: function reduceYieldGeneratorExpression(node, data) { - return fn(_get$2(_obj.__proto__ || Object.getPrototypeOf(_obj), "reduceYieldGeneratorExpression", this).call(this, node, data), node); - } - }; -}; -const adapt = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - default: _default$3 -}, [adapt$1]); -const require$$9 = /* @__PURE__ */ getAugmentedNamespace(adapt); -var reducers$1 = {}; -var PlusReducer_1; -var ThunkedPlusReducer_1; -var ConcatReducer_1; -var ThunkedConcatReducer_1; -var AndReducer_1; -var ThunkedAndReducer_1; -var OrReducer_1; -Object.defineProperty(reducers$1, "__esModule", { - value: true -}); -var ThunkedOrReducer_1 = reducers$1.ThunkedOrReducer = OrReducer_1 = reducers$1.OrReducer = ThunkedAndReducer_1 = reducers$1.ThunkedAndReducer = AndReducer_1 = reducers$1.AndReducer = ThunkedConcatReducer_1 = reducers$1.ThunkedConcatReducer = ConcatReducer_1 = reducers$1.ConcatReducer = ThunkedPlusReducer_1 = reducers$1.ThunkedPlusReducer = PlusReducer_1 = reducers$1.PlusReducer = void 0; -var _monoidalReducer = require$$7; -var _monoidalReducer2 = _interopRequireDefault$5(_monoidalReducer); -var _thunkedMonoidalReducer = require$$8; -var _thunkedMonoidalReducer2 = _interopRequireDefault$5(_thunkedMonoidalReducer); -function _interopRequireDefault$5(obj) { - return obj && obj.__esModule ? obj : { default: obj }; -} -function _classCallCheck$8(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} -function _possibleConstructorReturn$5(self, call) { - if (!self) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return call && (typeof call === "object" || typeof call === "function") ? call : self; -} -function _inherits$5(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); - if (superClass) - Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; -} -var PlusMonoid = { - empty: function empty2() { - return 0; - }, - concat: function concat(a, b) { - return a + b; - } -}; -var ConcatMonoid = { - empty: function empty3() { - return []; - }, - concat: function concat2(a, b) { - return a.concat(b); - } -}; -var AndMonoid = { - empty: function empty4() { - return true; - }, - concat: function concat3(a, b) { - return a && b; - }, - concatThunk: function concatThunk(a, b) { - return a && b(); - } -}; -var OrMonoid = { - empty: function empty5() { - return false; - }, - concat: function concat4(a, b) { - return a || b; - }, - concatThunk: function concatThunk2(a, b) { - return a || b(); - } -}; -PlusReducer_1 = reducers$1.PlusReducer = function(_MonoidalReducer) { - _inherits$5(PlusReducer, _MonoidalReducer); - function PlusReducer() { - _classCallCheck$8(this, PlusReducer); - return _possibleConstructorReturn$5(this, (PlusReducer.__proto__ || Object.getPrototypeOf(PlusReducer)).call(this, PlusMonoid)); - } - return PlusReducer; -}(_monoidalReducer2.default); -ThunkedPlusReducer_1 = reducers$1.ThunkedPlusReducer = function(_ThunkedMonoidalReduc) { - _inherits$5(ThunkedPlusReducer, _ThunkedMonoidalReduc); - function ThunkedPlusReducer() { - _classCallCheck$8(this, ThunkedPlusReducer); - return _possibleConstructorReturn$5(this, (ThunkedPlusReducer.__proto__ || Object.getPrototypeOf(ThunkedPlusReducer)).call(this, PlusMonoid)); - } - return ThunkedPlusReducer; -}(_thunkedMonoidalReducer2.default); -ConcatReducer_1 = reducers$1.ConcatReducer = function(_MonoidalReducer2) { - _inherits$5(ConcatReducer, _MonoidalReducer2); - function ConcatReducer() { - _classCallCheck$8(this, ConcatReducer); - return _possibleConstructorReturn$5(this, (ConcatReducer.__proto__ || Object.getPrototypeOf(ConcatReducer)).call(this, ConcatMonoid)); - } - return ConcatReducer; -}(_monoidalReducer2.default); -ThunkedConcatReducer_1 = reducers$1.ThunkedConcatReducer = function(_ThunkedMonoidalReduc2) { - _inherits$5(ThunkedConcatReducer, _ThunkedMonoidalReduc2); - function ThunkedConcatReducer() { - _classCallCheck$8(this, ThunkedConcatReducer); - return _possibleConstructorReturn$5(this, (ThunkedConcatReducer.__proto__ || Object.getPrototypeOf(ThunkedConcatReducer)).call(this, ConcatMonoid)); - } - return ThunkedConcatReducer; -}(_thunkedMonoidalReducer2.default); -AndReducer_1 = reducers$1.AndReducer = function(_MonoidalReducer3) { - _inherits$5(AndReducer, _MonoidalReducer3); - function AndReducer() { - _classCallCheck$8(this, AndReducer); - return _possibleConstructorReturn$5(this, (AndReducer.__proto__ || Object.getPrototypeOf(AndReducer)).call(this, AndMonoid)); - } - return AndReducer; -}(_monoidalReducer2.default); -ThunkedAndReducer_1 = reducers$1.ThunkedAndReducer = function(_ThunkedMonoidalReduc3) { - _inherits$5(ThunkedAndReducer, _ThunkedMonoidalReduc3); - function ThunkedAndReducer() { - _classCallCheck$8(this, ThunkedAndReducer); - return _possibleConstructorReturn$5(this, (ThunkedAndReducer.__proto__ || Object.getPrototypeOf(ThunkedAndReducer)).call(this, AndMonoid)); - } - return ThunkedAndReducer; -}(_thunkedMonoidalReducer2.default); -OrReducer_1 = reducers$1.OrReducer = function(_MonoidalReducer4) { - _inherits$5(OrReducer, _MonoidalReducer4); - function OrReducer() { - _classCallCheck$8(this, OrReducer); - return _possibleConstructorReturn$5(this, (OrReducer.__proto__ || Object.getPrototypeOf(OrReducer)).call(this, OrMonoid)); - } - return OrReducer; -}(_monoidalReducer2.default); -ThunkedOrReducer_1 = reducers$1.ThunkedOrReducer = function(_ThunkedMonoidalReduc4) { - _inherits$5(ThunkedOrReducer, _ThunkedMonoidalReduc4); - function ThunkedOrReducer() { - _classCallCheck$8(this, ThunkedOrReducer); - return _possibleConstructorReturn$5(this, (ThunkedOrReducer.__proto__ || Object.getPrototypeOf(ThunkedOrReducer)).call(this, OrMonoid)); - } - return ThunkedOrReducer; -}(_thunkedMonoidalReducer2.default); -const reducers = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - get ThunkedOrReducer() { - return ThunkedOrReducer_1; - }, - get OrReducer() { - return OrReducer_1; - }, - get ThunkedAndReducer() { - return ThunkedAndReducer_1; - }, - get AndReducer() { - return AndReducer_1; - }, - get ThunkedConcatReducer() { - return ThunkedConcatReducer_1; - }, - get ConcatReducer() { - return ConcatReducer_1; - }, - get ThunkedPlusReducer() { - return ThunkedPlusReducer_1; - }, - get PlusReducer() { - return PlusReducer_1; - }, - default: reducers$1 -}, [reducers$1]); -const require$$10 = /* @__PURE__ */ getAugmentedNamespace(reducers); -(function(exports2) { - Object.defineProperty(exports2, "__esModule", { - value: true - }); - var _director = require$$0$6; - Object.defineProperty(exports2, "reduce", { - enumerable: true, - get: function get5() { - return _director.reduce; - } - }); - Object.defineProperty(exports2, "default", { - enumerable: true, - get: function get5() { - return _director.reduce; - } - }); - var _thunkedDirector = require$$1$3; - Object.defineProperty(exports2, "thunkedReduce", { - enumerable: true, - get: function get5() { - return _thunkedDirector.thunkedReduce; - } - }); - var _thunkify = require$$2$3; - Object.defineProperty(exports2, "thunkify", { - enumerable: true, - get: function get5() { - return _interopRequireDefault2(_thunkify).default; - } - }); - var _thunkifyClass = require$$3$2; - Object.defineProperty(exports2, "thunkifyClass", { - enumerable: true, - get: function get5() { - return _interopRequireDefault2(_thunkifyClass).default; - } - }); - var _memoize = require$$4$1; - Object.defineProperty(exports2, "memoize", { - enumerable: true, - get: function get5() { - return _interopRequireDefault2(_memoize).default; - } - }); - var _cloneReducer = require$$5$1; - Object.defineProperty(exports2, "CloneReducer", { - enumerable: true, - get: function get5() { - return _interopRequireDefault2(_cloneReducer).default; - } - }); - var _lazyCloneReducer = require$$6; - Object.defineProperty(exports2, "LazyCloneReducer", { - enumerable: true, - get: function get5() { - return _interopRequireDefault2(_lazyCloneReducer).default; - } - }); - var _monoidalReducer3 = require$$7; - Object.defineProperty(exports2, "MonoidalReducer", { - enumerable: true, - get: function get5() { - return _interopRequireDefault2(_monoidalReducer3).default; - } - }); - var _thunkedMonoidalReducer3 = require$$8; - Object.defineProperty(exports2, "ThunkedMonoidalReducer", { - enumerable: true, - get: function get5() { - return _interopRequireDefault2(_thunkedMonoidalReducer3).default; - } - }); - var _adapt = require$$9; - Object.defineProperty(exports2, "adapt", { - enumerable: true, - get: function get5() { - return _interopRequireDefault2(_adapt).default; - } - }); - var _reducers = require$$10; - Object.defineProperty(exports2, "PlusReducer", { - enumerable: true, - get: function get5() { - return _reducers.PlusReducer; - } - }); - Object.defineProperty(exports2, "ThunkedPlusReducer", { - enumerable: true, - get: function get5() { - return _reducers.ThunkedPlusReducer; - } - }); - Object.defineProperty(exports2, "ConcatReducer", { - enumerable: true, - get: function get5() { - return _reducers.ConcatReducer; - } - }); - Object.defineProperty(exports2, "ThunkedConcatReducer", { - enumerable: true, - get: function get5() { - return _reducers.ThunkedConcatReducer; - } - }); - Object.defineProperty(exports2, "AndReducer", { - enumerable: true, - get: function get5() { - return _reducers.AndReducer; - } - }); - Object.defineProperty(exports2, "ThunkedAndReducer", { - enumerable: true, - get: function get5() { - return _reducers.ThunkedAndReducer; - } - }); - Object.defineProperty(exports2, "OrReducer", { - enumerable: true, - get: function get5() { - return _reducers.OrReducer; - } - }); - Object.defineProperty(exports2, "ThunkedOrReducer", { - enumerable: true, - get: function get5() { - return _reducers.ThunkedOrReducer; - } - }); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } -})(dist$6); -const index = /* @__PURE__ */ getDefaultExportFromCjs(dist$6); -const dist$3 = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - default: index -}, [dist$6]); -const require$$4 = /* @__PURE__ */ getAugmentedNamespace(dist$3); -var earlyErrorState$1 = {}; -var multimap$2 = { exports: {} }; -(function(module2, exports2) { - function mapEach(map, operation) { - var keys = map.keys(); - var next2; - while (!(next2 = keys.next()).done) { - operation(map.get(next2.value), next2.value, map); - } - } - var Multimap = function() { - var mapCtor; - if (typeof Map !== "undefined") { - mapCtor = Map; - if (!Map.prototype.keys) { - Map.prototype.keys = function() { - var keys = []; - this.forEach(function(item, key) { - keys.push(key); - }); - return keys; - }; - } - } - function Multimap2(iterable) { - var self = this; - self._map = mapCtor; - if (Multimap2.Map) { - self._map = Multimap2.Map; - } - self._ = self._map ? new self._map() : {}; - if (iterable) { - iterable.forEach(function(i2) { - self.set(i2[0], i2[1]); - }); - } - } - Multimap2.prototype.get = function(key) { - return this._map ? this._.get(key) : this._[key]; - }; - Multimap2.prototype.set = function(key, val) { - var args = Array.prototype.slice.call(arguments); - key = args.shift(); - var entry = this.get(key); - if (!entry) { - entry = []; - if (this._map) - this._.set(key, entry); - else - this._[key] = entry; - } - Array.prototype.push.apply(entry, args); - return this; - }; - Multimap2.prototype.delete = function(key, val) { - if (!this.has(key)) - return false; - if (arguments.length == 1) { - this._map ? this._.delete(key) : delete this._[key]; - return true; - } else { - var entry = this.get(key); - var idx = entry.indexOf(val); - if (idx != -1) { - entry.splice(idx, 1); - return true; - } - } - return false; - }; - Multimap2.prototype.has = function(key, val) { - var hasKey = this._map ? this._.has(key) : this._.hasOwnProperty(key); - if (arguments.length == 1 || !hasKey) - return hasKey; - var entry = this.get(key) || []; - return entry.indexOf(val) != -1; - }; - Multimap2.prototype.keys = function() { - if (this._map) - return makeIterator(this._.keys()); - return makeIterator(Object.keys(this._)); - }; - Multimap2.prototype.values = function() { - var vals = []; - this.forEachEntry(function(entry) { - Array.prototype.push.apply(vals, entry); - }); - return makeIterator(vals); - }; - Multimap2.prototype.forEachEntry = function(iter2) { - mapEach(this, iter2); - }; - Multimap2.prototype.forEach = function(iter2) { - var self = this; - self.forEachEntry(function(entry, key) { - entry.forEach(function(item) { - iter2(item, key, self); - }); - }); - }; - Multimap2.prototype.clear = function() { - if (this._map) { - this._.clear(); - } else { - this._ = {}; - } - }; - Object.defineProperty( - Multimap2.prototype, - "size", - { - configurable: false, - enumerable: true, - get: function() { - var total = 0; - mapEach(this, function(value) { - total += value.length; - }); - return total; - } - } - ); - Object.defineProperty( - Multimap2.prototype, - "count", - { - configurable: false, - enumerable: true, - get: function() { - return this._.size; - } - } - ); - var safariNext; - try { - safariNext = new Function("iterator", "makeIterator", "var keysArray = []; for(var key of iterator){keysArray.push(key);} return makeIterator(keysArray).next;"); - } catch (error) { - } - function makeIterator(iterator) { - if (Array.isArray(iterator)) { - var nextIndex = 0; - return { - next: function() { - return nextIndex < iterator.length ? { value: iterator[nextIndex++], done: false } : { done: true }; - } - }; - } - if (!iterator.next && safariNext) { - iterator.next = safariNext(iterator, makeIterator); - } - return iterator; - } - return Multimap2; - }(); - if (module2 && module2.exports) - module2.exports = Multimap; -})(multimap$2); -const multimap = multimap$2.exports; -const multimap$1 = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - default: multimap -}, [multimap$2.exports]); -const require$$0$4 = /* @__PURE__ */ getAugmentedNamespace(multimap$1); -var EarlyErrorState_1; -Object.defineProperty(earlyErrorState$1, "__esModule", { - value: true -}); -var EarlyError_1 = earlyErrorState$1.EarlyError = EarlyErrorState_1 = earlyErrorState$1.EarlyErrorState = void 0; -var _createClass$6 = function() { - function defineProperties(target, props) { - for (var i2 = 0; i2 < props.length; i2++) { - var descriptor = props[i2]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - return function(Constructor, protoProps, staticProps) { - if (protoProps) - defineProperties(Constructor.prototype, protoProps); - if (staticProps) - defineProperties(Constructor, staticProps); - return Constructor; - }; -}(); -var _multimap = require$$0$4; -var _multimap2 = _interopRequireDefault$4(_multimap); -function _interopRequireDefault$4(obj) { - return obj && obj.__esModule ? obj : { default: obj }; -} -function _possibleConstructorReturn$4(self, call) { - if (!self) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return call && (typeof call === "object" || typeof call === "function") ? call : self; -} -function _inherits$4(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); - if (superClass) - Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; -} -function _classCallCheck$7(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} -function addEach(thisMap) { - for (var _len = arguments.length, otherMaps = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - otherMaps[_key - 1] = arguments[_key]; - } - otherMaps.forEach(function(otherMap) { - otherMap.forEachEntry(function(v, k) { - thisMap.set.apply(thisMap, [k].concat(v)); - }); - }); - return thisMap; -} -var identity = void 0; -var EarlyErrorState = EarlyErrorState_1 = earlyErrorState$1.EarlyErrorState = function() { - function EarlyErrorState2() { - _classCallCheck$7(this, EarlyErrorState2); - this.errors = []; - this.strictErrors = []; - this.usedLabelNames = []; - this.freeBreakStatements = []; - this.freeContinueStatements = []; - this.freeLabeledBreakStatements = []; - this.freeLabeledContinueStatements = []; - this.newTargetExpressions = []; - this.boundNames = new _multimap2.default(); - this.lexicallyDeclaredNames = new _multimap2.default(); - this.functionDeclarationNames = new _multimap2.default(); - this.varDeclaredNames = new _multimap2.default(); - this.forOfVarDeclaredNames = []; - this.exportedNames = new _multimap2.default(); - this.exportedBindings = new _multimap2.default(); - this.superCallExpressions = []; - this.superCallExpressionsInConstructorMethod = []; - this.superPropertyExpressions = []; - this.yieldExpressions = []; - this.awaitExpressions = []; - } - _createClass$6(EarlyErrorState2, [{ - key: "addFreeBreakStatement", - value: function addFreeBreakStatement(s) { - this.freeBreakStatements.push(s); - return this; - } - }, { - key: "addFreeLabeledBreakStatement", - value: function addFreeLabeledBreakStatement(s) { - this.freeLabeledBreakStatements.push(s); - return this; - } - }, { - key: "clearFreeBreakStatements", - value: function clearFreeBreakStatements() { - this.freeBreakStatements = []; - return this; - } - }, { - key: "addFreeContinueStatement", - value: function addFreeContinueStatement(s) { - this.freeContinueStatements.push(s); - return this; - } - }, { - key: "addFreeLabeledContinueStatement", - value: function addFreeLabeledContinueStatement(s) { - this.freeLabeledContinueStatements.push(s); - return this; - } - }, { - key: "clearFreeContinueStatements", - value: function clearFreeContinueStatements() { - this.freeContinueStatements = []; - return this; - } - }, { - key: "enforceFreeBreakStatementErrors", - value: function enforceFreeBreakStatementErrors(createError) { - [].push.apply(this.errors, this.freeBreakStatements.map(createError)); - this.freeBreakStatements = []; - return this; - } - }, { - key: "enforceFreeLabeledBreakStatementErrors", - value: function enforceFreeLabeledBreakStatementErrors(createError) { - [].push.apply(this.errors, this.freeLabeledBreakStatements.map(createError)); - this.freeLabeledBreakStatements = []; - return this; - } - }, { - key: "enforceFreeContinueStatementErrors", - value: function enforceFreeContinueStatementErrors(createError) { - [].push.apply(this.errors, this.freeContinueStatements.map(createError)); - this.freeContinueStatements = []; - return this; - } - }, { - key: "enforceFreeLabeledContinueStatementErrors", - value: function enforceFreeLabeledContinueStatementErrors(createError) { - [].push.apply(this.errors, this.freeLabeledContinueStatements.map(createError)); - this.freeLabeledContinueStatements = []; - return this; - } - }, { - key: "observeIterationLabel", - value: function observeIterationLabel(label) { - this.usedLabelNames.push(label); - this.freeLabeledBreakStatements = this.freeLabeledBreakStatements.filter(function(s) { - return s.label !== label; - }); - this.freeLabeledContinueStatements = this.freeLabeledContinueStatements.filter(function(s) { - return s.label !== label; - }); - return this; - } - }, { - key: "observeNonIterationLabel", - value: function observeNonIterationLabel(label) { - this.usedLabelNames.push(label); - this.freeLabeledBreakStatements = this.freeLabeledBreakStatements.filter(function(s) { - return s.label !== label; - }); - return this; - } - }, { - key: "clearUsedLabelNames", - value: function clearUsedLabelNames() { - this.usedLabelNames = []; - return this; - } - }, { - key: "observeSuperCallExpression", - value: function observeSuperCallExpression(node) { - this.superCallExpressions.push(node); - return this; - } - }, { - key: "observeConstructorMethod", - value: function observeConstructorMethod() { - this.superCallExpressionsInConstructorMethod = this.superCallExpressions; - this.superCallExpressions = []; - return this; - } - }, { - key: "clearSuperCallExpressionsInConstructorMethod", - value: function clearSuperCallExpressionsInConstructorMethod() { - this.superCallExpressionsInConstructorMethod = []; - return this; - } - }, { - key: "enforceSuperCallExpressions", - value: function enforceSuperCallExpressions(createError) { - [].push.apply(this.errors, this.superCallExpressions.map(createError)); - [].push.apply(this.errors, this.superCallExpressionsInConstructorMethod.map(createError)); - this.superCallExpressions = []; - this.superCallExpressionsInConstructorMethod = []; - return this; - } - }, { - key: "enforceSuperCallExpressionsInConstructorMethod", - value: function enforceSuperCallExpressionsInConstructorMethod(createError) { - [].push.apply(this.errors, this.superCallExpressionsInConstructorMethod.map(createError)); - this.superCallExpressionsInConstructorMethod = []; - return this; - } - }, { - key: "observeSuperPropertyExpression", - value: function observeSuperPropertyExpression(node) { - this.superPropertyExpressions.push(node); - return this; - } - }, { - key: "clearSuperPropertyExpressions", - value: function clearSuperPropertyExpressions() { - this.superPropertyExpressions = []; - return this; - } - }, { - key: "enforceSuperPropertyExpressions", - value: function enforceSuperPropertyExpressions(createError) { - [].push.apply(this.errors, this.superPropertyExpressions.map(createError)); - this.superPropertyExpressions = []; - return this; - } - }, { - key: "observeNewTargetExpression", - value: function observeNewTargetExpression(node) { - this.newTargetExpressions.push(node); - return this; - } - }, { - key: "clearNewTargetExpressions", - value: function clearNewTargetExpressions() { - this.newTargetExpressions = []; - return this; - } - }, { - key: "bindName", - value: function bindName(name, node) { - this.boundNames.set(name, node); - return this; - } - }, { - key: "clearBoundNames", - value: function clearBoundNames() { - this.boundNames = new _multimap2.default(); - return this; - } - }, { - key: "observeLexicalDeclaration", - value: function observeLexicalDeclaration() { - addEach(this.lexicallyDeclaredNames, this.boundNames); - this.boundNames = new _multimap2.default(); - return this; - } - }, { - key: "observeLexicalBoundary", - value: function observeLexicalBoundary() { - this.previousLexicallyDeclaredNames = this.lexicallyDeclaredNames; - this.lexicallyDeclaredNames = new _multimap2.default(); - this.functionDeclarationNames = new _multimap2.default(); - return this; - } - }, { - key: "enforceDuplicateLexicallyDeclaredNames", - value: function enforceDuplicateLexicallyDeclaredNames(createError) { - var _this = this; - this.lexicallyDeclaredNames.forEachEntry(function(nodes) { - if (nodes.length > 1) { - nodes.slice(1).forEach(function(dupeNode) { - _this.addError(createError(dupeNode)); - }); - } - }); - return this; - } - }, { - key: "enforceConflictingLexicallyDeclaredNames", - value: function enforceConflictingLexicallyDeclaredNames(otherNames, createError) { - var _this2 = this; - this.lexicallyDeclaredNames.forEachEntry(function(nodes, bindingName) { - if (otherNames.has(bindingName)) { - nodes.forEach(function(conflictingNode) { - _this2.addError(createError(conflictingNode)); - }); - } - }); - return this; - } - }, { - key: "observeFunctionDeclaration", - value: function observeFunctionDeclaration() { - this.observeVarBoundary(); - addEach(this.functionDeclarationNames, this.boundNames); - this.boundNames = new _multimap2.default(); - return this; - } - }, { - key: "functionDeclarationNamesAreLexical", - value: function functionDeclarationNamesAreLexical() { - addEach(this.lexicallyDeclaredNames, this.functionDeclarationNames); - this.functionDeclarationNames = new _multimap2.default(); - return this; - } - }, { - key: "observeVarDeclaration", - value: function observeVarDeclaration() { - addEach(this.varDeclaredNames, this.boundNames); - this.boundNames = new _multimap2.default(); - return this; - } - }, { - key: "recordForOfVars", - value: function recordForOfVars() { - var _this3 = this; - this.varDeclaredNames.forEach(function(bindingIdentifier) { - _this3.forOfVarDeclaredNames.push(bindingIdentifier); - }); - return this; - } - }, { - key: "observeVarBoundary", - value: function observeVarBoundary() { - this.lexicallyDeclaredNames = new _multimap2.default(); - this.functionDeclarationNames = new _multimap2.default(); - this.varDeclaredNames = new _multimap2.default(); - this.forOfVarDeclaredNames = []; - return this; - } - }, { - key: "exportName", - value: function exportName(name, node) { - this.exportedNames.set(name, node); - return this; - } - }, { - key: "exportDeclaredNames", - value: function exportDeclaredNames() { - addEach(this.exportedNames, this.lexicallyDeclaredNames, this.varDeclaredNames); - addEach(this.exportedBindings, this.lexicallyDeclaredNames, this.varDeclaredNames); - return this; - } - }, { - key: "exportBinding", - value: function exportBinding(name, node) { - this.exportedBindings.set(name, node); - return this; - } - }, { - key: "clearExportedBindings", - value: function clearExportedBindings() { - this.exportedBindings = new _multimap2.default(); - return this; - } - }, { - key: "observeYieldExpression", - value: function observeYieldExpression(node) { - this.yieldExpressions.push(node); - return this; - } - }, { - key: "clearYieldExpressions", - value: function clearYieldExpressions() { - this.yieldExpressions = []; - return this; - } - }, { - key: "observeAwaitExpression", - value: function observeAwaitExpression(node) { - this.awaitExpressions.push(node); - return this; - } - }, { - key: "clearAwaitExpressions", - value: function clearAwaitExpressions() { - this.awaitExpressions = []; - return this; - } - }, { - key: "addError", - value: function addError(e) { - this.errors.push(e); - return this; - } - }, { - key: "addStrictError", - value: function addStrictError(e) { - this.strictErrors.push(e); - return this; - } - }, { - key: "enforceStrictErrors", - value: function enforceStrictErrors() { - [].push.apply(this.errors, this.strictErrors); - this.strictErrors = []; - return this; - } - }, { - key: "concat", - value: function concat5(s) { - if (this === identity) - return s; - if (s === identity) - return this; - [].push.apply(this.errors, s.errors); - [].push.apply(this.strictErrors, s.strictErrors); - [].push.apply(this.usedLabelNames, s.usedLabelNames); - [].push.apply(this.freeBreakStatements, s.freeBreakStatements); - [].push.apply(this.freeContinueStatements, s.freeContinueStatements); - [].push.apply(this.freeLabeledBreakStatements, s.freeLabeledBreakStatements); - [].push.apply(this.freeLabeledContinueStatements, s.freeLabeledContinueStatements); - [].push.apply(this.newTargetExpressions, s.newTargetExpressions); - addEach(this.boundNames, s.boundNames); - addEach(this.lexicallyDeclaredNames, s.lexicallyDeclaredNames); - addEach(this.functionDeclarationNames, s.functionDeclarationNames); - addEach(this.varDeclaredNames, s.varDeclaredNames); - [].push.apply(this.forOfVarDeclaredNames, s.forOfVarDeclaredNames); - addEach(this.exportedNames, s.exportedNames); - addEach(this.exportedBindings, s.exportedBindings); - [].push.apply(this.superCallExpressions, s.superCallExpressions); - [].push.apply(this.superCallExpressionsInConstructorMethod, s.superCallExpressionsInConstructorMethod); - [].push.apply(this.superPropertyExpressions, s.superPropertyExpressions); - [].push.apply(this.yieldExpressions, s.yieldExpressions); - [].push.apply(this.awaitExpressions, s.awaitExpressions); - return this; - } - }], [{ - key: "empty", - value: function empty6() { - return identity; - } - }]); - return EarlyErrorState2; -}(); -identity = new EarlyErrorState(); -Object.getOwnPropertyNames(EarlyErrorState.prototype).forEach(function(methodName) { - if (methodName === "constructor") - return; - Object.defineProperty(identity, methodName, { - value: function value() { - return EarlyErrorState.prototype[methodName].apply(new EarlyErrorState(), arguments); - }, - enumerable: false, - writable: true, - configurable: true - }); -}); -EarlyError_1 = earlyErrorState$1.EarlyError = function(_Error) { - _inherits$4(EarlyError, _Error); - function EarlyError(node, message) { - _classCallCheck$7(this, EarlyError); - var _this4 = _possibleConstructorReturn$4(this, (EarlyError.__proto__ || Object.getPrototypeOf(EarlyError)).call(this, message)); - _this4.node = node; - _this4.message = message; - return _this4; - } - return EarlyError; -}(Error); -const earlyErrorState = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - get EarlyError() { - return EarlyError_1; - }, - get EarlyErrorState() { - return EarlyErrorState_1; - }, - default: earlyErrorState$1 -}, [earlyErrorState$1]); -const require$$3$1 = /* @__PURE__ */ getAugmentedNamespace(earlyErrorState); -Object.defineProperty(earlyErrors$1, "__esModule", { - value: true -}); -var EarlyErrorChecker_1 = earlyErrors$1.EarlyErrorChecker = void 0; -var _createClass$5 = function() { - function defineProperties(target, props) { - for (var i2 = 0; i2 < props.length; i2++) { - var descriptor = props[i2]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - return function(Constructor, protoProps, staticProps) { - if (protoProps) - defineProperties(Constructor.prototype, protoProps); - if (staticProps) - defineProperties(Constructor, staticProps); - return Constructor; - }; -}(); -var _get$1 = function get3(object, property, receiver) { - if (object === null) - object = Function.prototype; - var desc = Object.getOwnPropertyDescriptor(object, property); - if (desc === void 0) { - var parent = Object.getPrototypeOf(object); - if (parent === null) { - return void 0; - } else { - return get3(parent, property, receiver); - } - } else if ("value" in desc) { - return desc.value; - } else { - var getter = desc.get; - if (getter === void 0) { - return void 0; - } - return getter.call(receiver); - } -}; -var _shiftReducer$1 = require$$4; -var _shiftReducer2 = _interopRequireDefault$3(_shiftReducer$1); -var _utils = require$$3$5; -var _errors = require$$2$5; -var _earlyErrorState = require$$3$1; -function _interopRequireDefault$3(obj) { - return obj && obj.__esModule ? obj : { default: obj }; -} -function _toConsumableArray$3(arr) { - if (Array.isArray(arr)) { - for (var i2 = 0, arr2 = Array(arr.length); i2 < arr.length; i2++) { - arr2[i2] = arr[i2]; - } - return arr2; - } else { - return Array.from(arr); - } -} -function _classCallCheck$6(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} -function _possibleConstructorReturn$3(self, call) { - if (!self) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return call && (typeof call === "object" || typeof call === "function") ? call : self; -} -function _inherits$3(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); - if (superClass) - Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; -} -function isStrictFunctionBody(_ref) { - var directives = _ref.directives; - return directives.some(function(directive) { - return directive.rawValue === "use strict"; - }); -} -function isLabelledFunction(node) { - return node.type === "LabeledStatement" && (node.body.type === "FunctionDeclaration" || isLabelledFunction(node.body)); -} -function isIterationStatement(node) { - switch (node.type) { - case "LabeledStatement": - return isIterationStatement(node.body); - case "DoWhileStatement": - case "ForInStatement": - case "ForOfStatement": - case "ForStatement": - case "WhileStatement": - return true; - } - return false; -} -function isSpecialMethod(methodDefinition) { - if (methodDefinition.name.type !== "StaticPropertyName" || methodDefinition.name.value !== "constructor") { - return false; - } - switch (methodDefinition.type) { - case "Getter": - case "Setter": - return true; - case "Method": - return methodDefinition.isGenerator || methodDefinition.isAsync; - } - throw new Error("not reached"); -} -function enforceDuplicateConstructorMethods(node, s) { - var ctors = node.elements.filter(function(e) { - return !e.isStatic && e.method.type === "Method" && !e.method.isGenerator && e.method.name.type === "StaticPropertyName" && e.method.name.value === "constructor"; - }); - if (ctors.length > 1) { - ctors.slice(1).forEach(function(ctor) { - s = s.addError(new _earlyErrorState.EarlyError(ctor, "Duplicate constructor method in class")); - }); - } - return s; -} -var SUPERCALL_ERROR = function SUPERCALL_ERROR2(node) { - return new _earlyErrorState.EarlyError(node, _errors.ErrorMessages.ILLEGAL_SUPER_CALL); -}; -var SUPERPROPERTY_ERROR = function SUPERPROPERTY_ERROR2(node) { - return new _earlyErrorState.EarlyError(node, "Member access on super must be in a method"); -}; -var DUPLICATE_BINDING = function DUPLICATE_BINDING3(node) { - return new _earlyErrorState.EarlyError(node, "Duplicate binding " + JSON.stringify(node.name)); -}; -var FREE_CONTINUE = function FREE_CONTINUE2(node) { - return new _earlyErrorState.EarlyError(node, "Continue statement must be nested within an iteration statement"); -}; -var UNBOUND_CONTINUE = function UNBOUND_CONTINUE2(node) { - return new _earlyErrorState.EarlyError(node, "Continue statement must be nested within an iteration statement with label " + JSON.stringify(node.label)); -}; -var FREE_BREAK = function FREE_BREAK2(node) { - return new _earlyErrorState.EarlyError(node, "Break statement must be nested within an iteration statement or a switch statement"); -}; -var UNBOUND_BREAK = function UNBOUND_BREAK2(node) { - return new _earlyErrorState.EarlyError(node, "Break statement must be nested within a statement with label " + JSON.stringify(node.label)); -}; -EarlyErrorChecker_1 = earlyErrors$1.EarlyErrorChecker = function(_MonoidalReducer) { - _inherits$3(EarlyErrorChecker, _MonoidalReducer); - function EarlyErrorChecker() { - _classCallCheck$6(this, EarlyErrorChecker); - return _possibleConstructorReturn$3(this, (EarlyErrorChecker.__proto__ || Object.getPrototypeOf(EarlyErrorChecker)).call(this, _earlyErrorState.EarlyErrorState)); - } - _createClass$5(EarlyErrorChecker, [{ - key: "reduceAssignmentExpression", - value: function reduceAssignmentExpression() { - return _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceAssignmentExpression", this).apply(this, arguments).clearBoundNames(); - } - }, { - key: "reduceAssignmentTargetIdentifier", - value: function reduceAssignmentTargetIdentifier(node) { - var s = this.identity; - if (node.name === "eval" || node.name === "arguments" || (0, _utils.isStrictModeReservedWord)(node.name)) { - s = s.addStrictError(new _earlyErrorState.EarlyError(node, "The identifier " + JSON.stringify(node.name) + " must not be in binding position in strict mode")); - } - return s; - } - }, { - key: "reduceArrowExpression", - value: function reduceArrowExpression(node, _ref2) { - var params = _ref2.params, body = _ref2.body; - var isSimpleParameterList = node.params.rest == null && node.params.items.every(function(i2) { - return i2.type === "BindingIdentifier"; - }); - params = params.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - if (node.body.type === "FunctionBody") { - body = body.enforceConflictingLexicallyDeclaredNames(params.lexicallyDeclaredNames, DUPLICATE_BINDING); - if (isStrictFunctionBody(node.body)) { - params = params.enforceStrictErrors(); - body = body.enforceStrictErrors(); - } - } - params.yieldExpressions.forEach(function(n) { - params = params.addError(new _earlyErrorState.EarlyError(n, "Arrow parameters must not contain yield expressions")); - }); - params.awaitExpressions.forEach(function(n) { - params = params.addError(new _earlyErrorState.EarlyError(n, "Arrow parameters must not contain await expressions")); - }); - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceArrowExpression", this).call(this, node, { params, body }); - if (!isSimpleParameterList && node.body.type === "FunctionBody" && isStrictFunctionBody(node.body)) { - s = s.addError(new _earlyErrorState.EarlyError(node, 'Functions with non-simple parameter lists may not contain a "use strict" directive')); - } - s = s.clearYieldExpressions(); - s = s.clearAwaitExpressions(); - s = s.observeVarBoundary(); - return s; - } - }, { - key: "reduceAwaitExpression", - value: function reduceAwaitExpression(node, _ref3) { - var expression = _ref3.expression; - return expression.observeAwaitExpression(node); - } - }, { - key: "reduceBindingIdentifier", - value: function reduceBindingIdentifier(node) { - var s = this.identity; - if (node.name === "eval" || node.name === "arguments" || (0, _utils.isStrictModeReservedWord)(node.name)) { - s = s.addStrictError(new _earlyErrorState.EarlyError(node, "The identifier " + JSON.stringify(node.name) + " must not be in binding position in strict mode")); - } - s = s.bindName(node.name, node); - return s; - } - }, { - key: "reduceBlock", - value: function reduceBlock() { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceBlock", this).apply(this, arguments); - s = s.functionDeclarationNamesAreLexical(); - s = s.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - s = s.enforceConflictingLexicallyDeclaredNames(s.varDeclaredNames, DUPLICATE_BINDING); - s = s.observeLexicalBoundary(); - return s; - } - }, { - key: "reduceBreakStatement", - value: function reduceBreakStatement(node) { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceBreakStatement", this).apply(this, arguments); - s = node.label == null ? s.addFreeBreakStatement(node) : s.addFreeLabeledBreakStatement(node); - return s; - } - }, { - key: "reduceCallExpression", - value: function reduceCallExpression(node) { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceCallExpression", this).apply(this, arguments); - if (node.callee.type === "Super") { - s = s.observeSuperCallExpression(node); - } - return s; - } - }, { - key: "reduceCatchClause", - value: function reduceCatchClause(node, _ref4) { - var binding = _ref4.binding, body = _ref4.body; - binding = binding.observeLexicalDeclaration(); - binding = binding.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - binding = binding.enforceConflictingLexicallyDeclaredNames(body.previousLexicallyDeclaredNames, DUPLICATE_BINDING); - binding.lexicallyDeclaredNames.forEachEntry(function(nodes, bindingName) { - if (body.varDeclaredNames.has(bindingName)) { - body.varDeclaredNames.get(bindingName).forEach(function(conflictingNode) { - if (body.forOfVarDeclaredNames.indexOf(conflictingNode) >= 0) { - binding = binding.addError(DUPLICATE_BINDING(conflictingNode)); - } - }); - } - }); - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceCatchClause", this).call(this, node, { binding, body }); - s = s.observeLexicalBoundary(); - return s; - } - }, { - key: "reduceClassDeclaration", - value: function reduceClassDeclaration(node, _ref5) { - var name = _ref5.name, _super = _ref5.super, elements = _ref5.elements; - var s = name.enforceStrictErrors(); - var sElements = this.append.apply(this, _toConsumableArray$3(elements)); - sElements = sElements.enforceStrictErrors(); - if (node.super != null) { - _super = _super.enforceStrictErrors(); - s = this.append(s, _super); - sElements = sElements.clearSuperCallExpressionsInConstructorMethod(); - } - s = this.append(s, sElements); - s = enforceDuplicateConstructorMethods(node, s); - s = s.observeLexicalDeclaration(); - return s; - } - }, { - key: "reduceClassElement", - value: function reduceClassElement(node) { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceClassElement", this).apply(this, arguments); - if (!node.isStatic && isSpecialMethod(node.method)) { - s = s.addError(new _earlyErrorState.EarlyError(node, _errors.ErrorMessages.ILLEGAL_CONSTRUCTORS)); - } - if (node.isStatic && node.method.name.type === "StaticPropertyName" && node.method.name.value === "prototype") { - s = s.addError(new _earlyErrorState.EarlyError(node, 'Static class methods cannot be named "prototype"')); - } - return s; - } - }, { - key: "reduceClassExpression", - value: function reduceClassExpression(node, _ref6) { - var name = _ref6.name, _super = _ref6.super, elements = _ref6.elements; - var s = node.name == null ? this.identity : name.enforceStrictErrors(); - var sElements = this.append.apply(this, _toConsumableArray$3(elements)); - sElements = sElements.enforceStrictErrors(); - if (node.super != null) { - _super = _super.enforceStrictErrors(); - s = this.append(s, _super); - sElements = sElements.clearSuperCallExpressionsInConstructorMethod(); - } - s = this.append(s, sElements); - s = enforceDuplicateConstructorMethods(node, s); - s = s.clearBoundNames(); - return s; - } - }, { - key: "reduceCompoundAssignmentExpression", - value: function reduceCompoundAssignmentExpression() { - return _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceCompoundAssignmentExpression", this).apply(this, arguments).clearBoundNames(); - } - }, { - key: "reduceComputedMemberExpression", - value: function reduceComputedMemberExpression(node) { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceComputedMemberExpression", this).apply(this, arguments); - if (node.object.type === "Super") { - s = s.observeSuperPropertyExpression(node); - } - return s; - } - }, { - key: "reduceContinueStatement", - value: function reduceContinueStatement(node) { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceContinueStatement", this).apply(this, arguments); - s = node.label == null ? s.addFreeContinueStatement(node) : s.addFreeLabeledContinueStatement(node); - return s; - } - }, { - key: "reduceDoWhileStatement", - value: function reduceDoWhileStatement(node) { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceDoWhileStatement", this).apply(this, arguments); - if (isLabelledFunction(node.body)) { - s = s.addError(new _earlyErrorState.EarlyError(node.body, "The body of a do-while statement must not be a labeled function declaration")); - } - s = s.clearFreeContinueStatements(); - s = s.clearFreeBreakStatements(); - return s; - } - }, { - key: "reduceExport", - value: function reduceExport() { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceExport", this).apply(this, arguments); - s = s.functionDeclarationNamesAreLexical(); - s = s.exportDeclaredNames(); - return s; - } - }, { - key: "reduceExportFrom", - value: function reduceExportFrom() { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceExportFrom", this).apply(this, arguments); - s = s.clearExportedBindings(); - return s; - } - }, { - key: "reduceExportFromSpecifier", - value: function reduceExportFromSpecifier(node) { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceExportFromSpecifier", this).apply(this, arguments); - s = s.exportName(node.exportedName || node.name, node); - s = s.exportBinding(node.name, node); - return s; - } - }, { - key: "reduceExportLocalSpecifier", - value: function reduceExportLocalSpecifier(node) { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceExportLocalSpecifier", this).apply(this, arguments); - s = s.exportName(node.exportedName || node.name.name, node); - s = s.exportBinding(node.name.name, node); - return s; - } - }, { - key: "reduceExportDefault", - value: function reduceExportDefault(node) { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceExportDefault", this).apply(this, arguments); - s = s.functionDeclarationNamesAreLexical(); - s = s.exportName("default", node); - return s; - } - }, { - key: "reduceFormalParameters", - value: function reduceFormalParameters() { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceFormalParameters", this).apply(this, arguments); - s = s.observeLexicalDeclaration(); - return s; - } - }, { - key: "reduceForStatement", - value: function reduceForStatement(node, _ref7) { - var init = _ref7.init, test = _ref7.test, update = _ref7.update, body = _ref7.body; - if (init != null) { - init = init.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - init = init.enforceConflictingLexicallyDeclaredNames(body.varDeclaredNames, DUPLICATE_BINDING); - } - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceForStatement", this).call(this, node, { init, test, update, body }); - if (node.init != null && node.init.type === "VariableDeclaration" && node.init.kind === "const") { - node.init.declarators.forEach(function(declarator) { - if (declarator.init == null) { - s = s.addError(new _earlyErrorState.EarlyError(declarator, "Constant lexical declarations must have an initialiser")); - } - }); - } - if (isLabelledFunction(node.body)) { - s = s.addError(new _earlyErrorState.EarlyError(node.body, "The body of a for statement must not be a labeled function declaration")); - } - s = s.clearFreeContinueStatements(); - s = s.clearFreeBreakStatements(); - s = s.observeLexicalBoundary(); - return s; - } - }, { - key: "reduceForInStatement", - value: function reduceForInStatement(node, _ref8) { - var left = _ref8.left, right = _ref8.right, body = _ref8.body; - left = left.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - left = left.enforceConflictingLexicallyDeclaredNames(body.varDeclaredNames, DUPLICATE_BINDING); - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceForInStatement", this).call(this, node, { left, right, body }); - if (isLabelledFunction(node.body)) { - s = s.addError(new _earlyErrorState.EarlyError(node.body, "The body of a for-in statement must not be a labeled function declaration")); - } - s = s.clearFreeContinueStatements(); - s = s.clearFreeBreakStatements(); - s = s.observeLexicalBoundary(); - return s; - } - }, { - key: "reduceForOfStatement", - value: function reduceForOfStatement(node, _ref9) { - var left = _ref9.left, right = _ref9.right, body = _ref9.body; - left = left.recordForOfVars(); - left = left.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - left = left.enforceConflictingLexicallyDeclaredNames(body.varDeclaredNames, DUPLICATE_BINDING); - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceForOfStatement", this).call(this, node, { left, right, body }); - if (isLabelledFunction(node.body)) { - s = s.addError(new _earlyErrorState.EarlyError(node.body, "The body of a for-of statement must not be a labeled function declaration")); - } - s = s.clearFreeContinueStatements(); - s = s.clearFreeBreakStatements(); - s = s.observeLexicalBoundary(); - return s; - } - }, { - key: "reduceForAwaitStatement", - value: function reduceForAwaitStatement(node, _ref10) { - var left = _ref10.left, right = _ref10.right, body = _ref10.body; - left = left.recordForOfVars(); - left = left.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - left = left.enforceConflictingLexicallyDeclaredNames(body.varDeclaredNames, DUPLICATE_BINDING); - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceForOfStatement", this).call(this, node, { left, right, body }); - if (isLabelledFunction(node.body)) { - s = s.addError(new _earlyErrorState.EarlyError(node.body, "The body of a for-await statement must not be a labeled function declaration")); - } - s = s.clearFreeContinueStatements(); - s = s.clearFreeBreakStatements(); - s = s.observeLexicalBoundary(); - return s; - } - }, { - key: "reduceFunctionBody", - value: function reduceFunctionBody(node) { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceFunctionBody", this).apply(this, arguments); - s = s.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - s = s.enforceConflictingLexicallyDeclaredNames(s.varDeclaredNames, DUPLICATE_BINDING); - s = s.enforceFreeContinueStatementErrors(FREE_CONTINUE); - s = s.enforceFreeLabeledContinueStatementErrors(UNBOUND_CONTINUE); - s = s.enforceFreeBreakStatementErrors(FREE_BREAK); - s = s.enforceFreeLabeledBreakStatementErrors(UNBOUND_BREAK); - s = s.clearUsedLabelNames(); - s = s.clearYieldExpressions(); - s = s.clearAwaitExpressions(); - if (isStrictFunctionBody(node)) { - s = s.enforceStrictErrors(); - } - return s; - } - }, { - key: "reduceFunctionDeclaration", - value: function reduceFunctionDeclaration(node, _ref11) { - var name = _ref11.name, params = _ref11.params, body = _ref11.body; - var isSimpleParameterList = node.params.rest == null && node.params.items.every(function(i2) { - return i2.type === "BindingIdentifier"; - }); - var addError = !isSimpleParameterList || node.isGenerator ? "addError" : "addStrictError"; - params.lexicallyDeclaredNames.forEachEntry(function(nodes) { - if (nodes.length > 1) { - nodes.slice(1).forEach(function(dupeNode) { - params = params[addError](DUPLICATE_BINDING(dupeNode)); - }); - } - }); - body = body.enforceConflictingLexicallyDeclaredNames(params.lexicallyDeclaredNames, DUPLICATE_BINDING); - body = body.enforceSuperCallExpressions(SUPERCALL_ERROR); - body = body.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR); - params = params.enforceSuperCallExpressions(SUPERCALL_ERROR); - params = params.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR); - if (node.isGenerator) { - params.yieldExpressions.forEach(function(n) { - params = params.addError(new _earlyErrorState.EarlyError(n, "Generator parameters must not contain yield expressions")); - }); - } - if (node.isAsync) { - params.awaitExpressions.forEach(function(n) { - params = params.addError(new _earlyErrorState.EarlyError(n, "Async function parameters must not contain await expressions")); - }); - } - params = params.clearNewTargetExpressions(); - body = body.clearNewTargetExpressions(); - if (isStrictFunctionBody(node.body)) { - params = params.enforceStrictErrors(); - body = body.enforceStrictErrors(); - } - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceFunctionDeclaration", this).call(this, node, { name, params, body }); - if (!isSimpleParameterList && isStrictFunctionBody(node.body)) { - s = s.addError(new _earlyErrorState.EarlyError(node, 'Functions with non-simple parameter lists may not contain a "use strict" directive')); - } - s = s.clearYieldExpressions(); - s = s.clearAwaitExpressions(); - s = s.observeFunctionDeclaration(); - return s; - } - }, { - key: "reduceFunctionExpression", - value: function reduceFunctionExpression(node, _ref12) { - var name = _ref12.name, params = _ref12.params, body = _ref12.body; - var isSimpleParameterList = node.params.rest == null && node.params.items.every(function(i2) { - return i2.type === "BindingIdentifier"; - }); - var addError = !isSimpleParameterList || node.isGenerator ? "addError" : "addStrictError"; - params.lexicallyDeclaredNames.forEachEntry(function(nodes, bindingName) { - if (nodes.length > 1) { - nodes.slice(1).forEach(function(dupeNode) { - params = params[addError](new _earlyErrorState.EarlyError(dupeNode, "Duplicate binding " + JSON.stringify(bindingName))); - }); - } - }); - body = body.enforceConflictingLexicallyDeclaredNames(params.lexicallyDeclaredNames, DUPLICATE_BINDING); - body = body.enforceSuperCallExpressions(SUPERCALL_ERROR); - body = body.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR); - params = params.enforceSuperCallExpressions(SUPERCALL_ERROR); - params = params.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR); - if (node.isGenerator) { - params.yieldExpressions.forEach(function(n) { - params = params.addError(new _earlyErrorState.EarlyError(n, "Generator parameters must not contain yield expressions")); - }); - } - if (node.isAsync) { - params.awaitExpressions.forEach(function(n) { - params = params.addError(new _earlyErrorState.EarlyError(n, "Async function parameters must not contain await expressions")); - }); - } - params = params.clearNewTargetExpressions(); - body = body.clearNewTargetExpressions(); - if (isStrictFunctionBody(node.body)) { - params = params.enforceStrictErrors(); - body = body.enforceStrictErrors(); - } - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceFunctionExpression", this).call(this, node, { name, params, body }); - if (!isSimpleParameterList && isStrictFunctionBody(node.body)) { - s = s.addError(new _earlyErrorState.EarlyError(node, 'Functions with non-simple parameter lists may not contain a "use strict" directive')); - } - s = s.clearBoundNames(); - s = s.clearYieldExpressions(); - s = s.clearAwaitExpressions(); - s = s.observeVarBoundary(); - return s; - } - }, { - key: "reduceGetter", - value: function reduceGetter(node, _ref13) { - var name = _ref13.name, body = _ref13.body; - body = body.enforceSuperCallExpressions(SUPERCALL_ERROR); - body = body.clearSuperPropertyExpressions(); - body = body.clearNewTargetExpressions(); - if (isStrictFunctionBody(node.body)) { - body = body.enforceStrictErrors(); - } - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceGetter", this).call(this, node, { name, body }); - s = s.observeVarBoundary(); - return s; - } - }, { - key: "reduceIdentifierExpression", - value: function reduceIdentifierExpression(node) { - var s = this.identity; - if ((0, _utils.isStrictModeReservedWord)(node.name)) { - s = s.addStrictError(new _earlyErrorState.EarlyError(node, "The identifier " + JSON.stringify(node.name) + " must not be in expression position in strict mode")); - } - return s; - } - }, { - key: "reduceIfStatement", - value: function reduceIfStatement(node, _ref14) { - var test = _ref14.test, consequent = _ref14.consequent, alternate = _ref14.alternate; - if (isLabelledFunction(node.consequent)) { - consequent = consequent.addError(new _earlyErrorState.EarlyError(node.consequent, "The consequent of an if statement must not be a labeled function declaration")); - } - if (node.alternate != null && isLabelledFunction(node.alternate)) { - alternate = alternate.addError(new _earlyErrorState.EarlyError(node.alternate, "The alternate of an if statement must not be a labeled function declaration")); - } - if (node.consequent.type === "FunctionDeclaration") { - consequent = consequent.addStrictError(new _earlyErrorState.EarlyError(node.consequent, "FunctionDeclarations in IfStatements are disallowed in strict mode")); - consequent = consequent.observeLexicalBoundary(); - } - if (node.alternate != null && node.alternate.type === "FunctionDeclaration") { - alternate = alternate.addStrictError(new _earlyErrorState.EarlyError(node.alternate, "FunctionDeclarations in IfStatements are disallowed in strict mode")); - alternate = alternate.observeLexicalBoundary(); - } - return _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceIfStatement", this).call(this, node, { test, consequent, alternate }); - } - }, { - key: "reduceImport", - value: function reduceImport() { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceImport", this).apply(this, arguments); - s = s.observeLexicalDeclaration(); - return s; - } - }, { - key: "reduceImportNamespace", - value: function reduceImportNamespace() { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceImportNamespace", this).apply(this, arguments); - s = s.observeLexicalDeclaration(); - return s; - } - }, { - key: "reduceLabeledStatement", - value: function reduceLabeledStatement(node) { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceLabeledStatement", this).apply(this, arguments); - if (node.label === "yield" || (0, _utils.isStrictModeReservedWord)(node.label)) { - s = s.addStrictError(new _earlyErrorState.EarlyError(node, "The identifier " + JSON.stringify(node.label) + " must not be in label position in strict mode")); - } - if (s.usedLabelNames.indexOf(node.label) >= 0) { - s = s.addError(new _earlyErrorState.EarlyError(node, "Label " + JSON.stringify(node.label) + " has already been declared")); - } - if (node.body.type === "FunctionDeclaration") { - s = s.addStrictError(new _earlyErrorState.EarlyError(node, "Labeled FunctionDeclarations are disallowed in strict mode")); - } - s = isIterationStatement(node.body) ? s.observeIterationLabel(node.label) : s.observeNonIterationLabel(node.label); - return s; - } - }, { - key: "reduceLiteralRegExpExpression", - value: function reduceLiteralRegExpExpression() { - var s = this.identity; - return s; - } - }, { - key: "reduceMethod", - value: function reduceMethod(node, _ref15) { - var name = _ref15.name, params = _ref15.params, body = _ref15.body; - var isSimpleParameterList = node.params.rest == null && node.params.items.every(function(i2) { - return i2.type === "BindingIdentifier"; - }); - params = params.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - body = body.enforceConflictingLexicallyDeclaredNames(params.lexicallyDeclaredNames, DUPLICATE_BINDING); - if (node.name.type === "StaticPropertyName" && node.name.value === "constructor") { - body = body.observeConstructorMethod(); - params = params.observeConstructorMethod(); - } else { - body = body.enforceSuperCallExpressions(SUPERCALL_ERROR); - params = params.enforceSuperCallExpressions(SUPERCALL_ERROR); - } - if (node.isGenerator) { - params.yieldExpressions.forEach(function(n) { - params = params.addError(new _earlyErrorState.EarlyError(n, "Generator parameters must not contain yield expressions")); - }); - } - if (node.isAsync) { - params.awaitExpressions.forEach(function(n) { - params = params.addError(new _earlyErrorState.EarlyError(n, "Async function parameters must not contain await expressions")); - }); - } - body = body.clearSuperPropertyExpressions(); - params = params.clearSuperPropertyExpressions(); - params = params.clearNewTargetExpressions(); - body = body.clearNewTargetExpressions(); - if (isStrictFunctionBody(node.body)) { - params = params.enforceStrictErrors(); - body = body.enforceStrictErrors(); - } - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceMethod", this).call(this, node, { name, params, body }); - if (!isSimpleParameterList && isStrictFunctionBody(node.body)) { - s = s.addError(new _earlyErrorState.EarlyError(node, 'Functions with non-simple parameter lists may not contain a "use strict" directive')); - } - s = s.clearYieldExpressions(); - s = s.clearAwaitExpressions(); - s = s.observeVarBoundary(); - return s; - } - }, { - key: "reduceModule", - value: function reduceModule() { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceModule", this).apply(this, arguments); - s = s.functionDeclarationNamesAreLexical(); - s = s.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - s = s.enforceConflictingLexicallyDeclaredNames(s.varDeclaredNames, DUPLICATE_BINDING); - s.exportedNames.forEachEntry(function(nodes, bindingName) { - if (nodes.length > 1) { - nodes.slice(1).forEach(function(dupeNode) { - s = s.addError(new _earlyErrorState.EarlyError(dupeNode, "Duplicate export " + JSON.stringify(bindingName))); - }); - } - }); - s.exportedBindings.forEachEntry(function(nodes, bindingName) { - if (!s.lexicallyDeclaredNames.has(bindingName) && !s.varDeclaredNames.has(bindingName)) { - nodes.forEach(function(undeclaredNode) { - s = s.addError(new _earlyErrorState.EarlyError(undeclaredNode, "Exported binding " + JSON.stringify(bindingName) + " is not declared")); - }); - } - }); - s.newTargetExpressions.forEach(function(node) { - s = s.addError(new _earlyErrorState.EarlyError(node, "new.target must be within function (but not arrow expression) code")); - }); - s = s.enforceFreeContinueStatementErrors(FREE_CONTINUE); - s = s.enforceFreeLabeledContinueStatementErrors(UNBOUND_CONTINUE); - s = s.enforceFreeBreakStatementErrors(FREE_BREAK); - s = s.enforceFreeLabeledBreakStatementErrors(UNBOUND_BREAK); - s = s.enforceSuperCallExpressions(SUPERCALL_ERROR); - s = s.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR); - s = s.enforceStrictErrors(); - return s; - } - }, { - key: "reduceNewTargetExpression", - value: function reduceNewTargetExpression(node) { - return this.identity.observeNewTargetExpression(node); - } - }, { - key: "reduceObjectExpression", - value: function reduceObjectExpression(node) { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceObjectExpression", this).apply(this, arguments); - s = s.enforceSuperCallExpressionsInConstructorMethod(SUPERCALL_ERROR); - var protos = node.properties.filter(function(p2) { - return p2.type === "DataProperty" && p2.name.type === "StaticPropertyName" && p2.name.value === "__proto__"; - }); - protos.slice(1).forEach(function(n) { - s = s.addError(new _earlyErrorState.EarlyError(n, "Duplicate __proto__ property in object literal not allowed")); - }); - return s; - } - }, { - key: "reduceUpdateExpression", - value: function reduceUpdateExpression() { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceUpdateExpression", this).apply(this, arguments); - s = s.clearBoundNames(); - return s; - } - }, { - key: "reduceUnaryExpression", - value: function reduceUnaryExpression(node) { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceUnaryExpression", this).apply(this, arguments); - if (node.operator === "delete" && node.operand.type === "IdentifierExpression") { - s = s.addStrictError(new _earlyErrorState.EarlyError(node, "Identifier expressions must not be deleted in strict mode")); - } - return s; - } - }, { - key: "reduceScript", - value: function reduceScript(node) { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceScript", this).apply(this, arguments); - s = s.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - s = s.enforceConflictingLexicallyDeclaredNames(s.varDeclaredNames, DUPLICATE_BINDING); - s.newTargetExpressions.forEach(function(n) { - s = s.addError(new _earlyErrorState.EarlyError(n, "new.target must be within function (but not arrow expression) code")); - }); - s = s.enforceFreeContinueStatementErrors(FREE_CONTINUE); - s = s.enforceFreeLabeledContinueStatementErrors(UNBOUND_CONTINUE); - s = s.enforceFreeBreakStatementErrors(FREE_BREAK); - s = s.enforceFreeLabeledBreakStatementErrors(UNBOUND_BREAK); - s = s.enforceSuperCallExpressions(SUPERCALL_ERROR); - s = s.enforceSuperPropertyExpressions(SUPERPROPERTY_ERROR); - if (isStrictFunctionBody(node)) { - s = s.enforceStrictErrors(); - } - return s; - } - }, { - key: "reduceSetter", - value: function reduceSetter(node, _ref16) { - var name = _ref16.name, param = _ref16.param, body = _ref16.body; - var isSimpleParameterList = node.param.type === "BindingIdentifier"; - param = param.observeLexicalDeclaration(); - param = param.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - body = body.enforceConflictingLexicallyDeclaredNames(param.lexicallyDeclaredNames, DUPLICATE_BINDING); - param = param.enforceSuperCallExpressions(SUPERCALL_ERROR); - body = body.enforceSuperCallExpressions(SUPERCALL_ERROR); - param = param.clearSuperPropertyExpressions(); - body = body.clearSuperPropertyExpressions(); - param = param.clearNewTargetExpressions(); - body = body.clearNewTargetExpressions(); - if (isStrictFunctionBody(node.body)) { - param = param.enforceStrictErrors(); - body = body.enforceStrictErrors(); - } - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceSetter", this).call(this, node, { name, param, body }); - if (!isSimpleParameterList && isStrictFunctionBody(node.body)) { - s = s.addError(new _earlyErrorState.EarlyError(node, 'Functions with non-simple parameter lists may not contain a "use strict" directive')); - } - s = s.observeVarBoundary(); - return s; - } - }, { - key: "reduceStaticMemberExpression", - value: function reduceStaticMemberExpression(node) { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceStaticMemberExpression", this).apply(this, arguments); - if (node.object.type === "Super") { - s = s.observeSuperPropertyExpression(node); - } - return s; - } - }, { - key: "reduceSwitchStatement", - value: function reduceSwitchStatement(node, _ref17) { - var discriminant = _ref17.discriminant, cases = _ref17.cases; - var sCases = this.append.apply(this, _toConsumableArray$3(cases)); - sCases = sCases.functionDeclarationNamesAreLexical(); - sCases = sCases.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - sCases = sCases.enforceConflictingLexicallyDeclaredNames(sCases.varDeclaredNames, DUPLICATE_BINDING); - sCases = sCases.observeLexicalBoundary(); - var s = this.append(discriminant, sCases); - s = s.clearFreeBreakStatements(); - return s; - } - }, { - key: "reduceSwitchStatementWithDefault", - value: function reduceSwitchStatementWithDefault(node, _ref18) { - var discriminant = _ref18.discriminant, preDefaultCases = _ref18.preDefaultCases, defaultCase = _ref18.defaultCase, postDefaultCases = _ref18.postDefaultCases; - var sCases = this.append.apply(this, [defaultCase].concat(_toConsumableArray$3(preDefaultCases), _toConsumableArray$3(postDefaultCases))); - sCases = sCases.functionDeclarationNamesAreLexical(); - sCases = sCases.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING); - sCases = sCases.enforceConflictingLexicallyDeclaredNames(sCases.varDeclaredNames, DUPLICATE_BINDING); - sCases = sCases.observeLexicalBoundary(); - var s = this.append(discriminant, sCases); - s = s.clearFreeBreakStatements(); - return s; - } - }, { - key: "reduceVariableDeclaration", - value: function reduceVariableDeclaration(node) { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceVariableDeclaration", this).apply(this, arguments); - switch (node.kind) { - case "const": - case "let": { - s = s.observeLexicalDeclaration(); - if (s.lexicallyDeclaredNames.has("let")) { - s.lexicallyDeclaredNames.get("let").forEach(function(n) { - s = s.addError(new _earlyErrorState.EarlyError(n, 'Lexical declarations must not have a binding named "let"')); - }); - } - break; - } - case "var": - s = s.observeVarDeclaration(); - break; - } - return s; - } - }, { - key: "reduceVariableDeclarationStatement", - value: function reduceVariableDeclarationStatement(node) { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceVariableDeclarationStatement", this).apply(this, arguments); - if (node.declaration.kind === "const") { - node.declaration.declarators.forEach(function(declarator) { - if (declarator.init == null) { - s = s.addError(new _earlyErrorState.EarlyError(declarator, "Constant lexical declarations must have an initialiser")); - } - }); - } - return s; - } - }, { - key: "reduceWhileStatement", - value: function reduceWhileStatement(node) { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceWhileStatement", this).apply(this, arguments); - if (isLabelledFunction(node.body)) { - s = s.addError(new _earlyErrorState.EarlyError(node.body, "The body of a while statement must not be a labeled function declaration")); - } - s = s.clearFreeContinueStatements().clearFreeBreakStatements(); - return s; - } - }, { - key: "reduceWithStatement", - value: function reduceWithStatement(node) { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceWithStatement", this).apply(this, arguments); - if (isLabelledFunction(node.body)) { - s = s.addError(new _earlyErrorState.EarlyError(node.body, "The body of a with statement must not be a labeled function declaration")); - } - s = s.addStrictError(new _earlyErrorState.EarlyError(node, "Strict mode code must not include a with statement")); - return s; - } - }, { - key: "reduceYieldExpression", - value: function reduceYieldExpression(node) { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceYieldExpression", this).apply(this, arguments); - s = s.observeYieldExpression(node); - return s; - } - }, { - key: "reduceYieldGeneratorExpression", - value: function reduceYieldGeneratorExpression(node) { - var s = _get$1(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), "reduceYieldGeneratorExpression", this).apply(this, arguments); - s = s.observeYieldExpression(node); - return s; - } - }], [{ - key: "check", - value: function check(node) { - return (0, _shiftReducer2.default)(new EarlyErrorChecker(), node).errors; - } - }]); - return EarlyErrorChecker; -}(_shiftReducer$1.MonoidalReducer); -const earlyErrors = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - get EarlyErrorChecker() { - return EarlyErrorChecker_1; - }, - default: earlyErrors$1 -}, [earlyErrors$1]); -const require$$2$2 = /* @__PURE__ */ getAugmentedNamespace(earlyErrors); -(function(exports2) { - Object.defineProperty(exports2, "__esModule", { - value: true - }); - exports2.TokenType = exports2.TokenClass = exports2.Tokenizer = exports2.ParserWithLocation = exports2.GenericParser = exports2.EarlyErrorChecker = exports2.parseScriptWithLocation = exports2.parseModuleWithLocation = exports2.parseScript = exports2.parseModule = void 0; - var _createClass2 = function() { - function defineProperties(target, props) { - for (var i2 = 0; i2 < props.length; i2++) { - var descriptor = props[i2]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - return function(Constructor, protoProps, staticProps) { - if (protoProps) - defineProperties(Constructor.prototype, protoProps); - if (staticProps) - defineProperties(Constructor, staticProps); - return Constructor; - }; - }(); - var _get2 = function get5(object, property, receiver) { - if (object === null) - object = Function.prototype; - var desc = Object.getOwnPropertyDescriptor(object, property); - if (desc === void 0) { - var parent = Object.getPrototypeOf(object); - if (parent === null) { - return void 0; - } else { - return get5(parent, property, receiver); - } - } else if ("value" in desc) { - return desc.value; - } else { - var getter = desc.get; - if (getter === void 0) { - return void 0; - } - return getter.call(receiver); - } - }; - var _tokenizer3 = require$$0$9; - Object.defineProperty(exports2, "Tokenizer", { - enumerable: true, - get: function get5() { - return _interopRequireDefault2(_tokenizer3).default; - } - }); - Object.defineProperty(exports2, "TokenClass", { - enumerable: true, - get: function get5() { - return _tokenizer3.TokenClass; - } - }); - Object.defineProperty(exports2, "TokenType", { - enumerable: true, - get: function get5() { - return _tokenizer3.TokenType; - } - }); - var _parser = require$$1$4; - var _earlyErrors = require$$2$2; - var _utils2 = require$$3$5; - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function _classCallCheck2(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _possibleConstructorReturn2(self, call) { - if (!self) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return call && (typeof call === "object" || typeof call === "function") ? call : self; - } - function _inherits2(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); - if (superClass) - Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; - } - var ParserWithLocation = function(_GenericParser) { - _inherits2(ParserWithLocation2, _GenericParser); - function ParserWithLocation2(source) { - _classCallCheck2(this, ParserWithLocation2); - var _this = _possibleConstructorReturn2(this, (ParserWithLocation2.__proto__ || Object.getPrototypeOf(ParserWithLocation2)).call(this, source)); - _this.locations = /* @__PURE__ */ new WeakMap(); - _this.comments = []; - return _this; - } - _createClass2(ParserWithLocation2, [{ - key: "startNode", - value: function startNode() { - return this.getLocation(); - } - }, { - key: "finishNode", - value: function finishNode(node, start) { - if (node.type === "Script" || node.type === "Module") { - this.locations.set(node, { - start: { line: 1, column: 0, offset: 0 }, - end: this.getLocation() - }); - return node; - } - if (node.type === "TemplateExpression") { - for (var i2 = 0; i2 < node.elements.length; i2 += 2) { - var endAdjustment = i2 < node.elements.length - 1 ? 2 : 1; - var element = node.elements[i2]; - var location = this.locations.get(element); - this.locations.set(element, { - start: { line: location.start.line, column: location.start.column + 1, offset: location.start.offset + 1 }, - end: { line: location.end.line, column: location.end.column - endAdjustment, offset: location.end.offset - endAdjustment } - }); - } - } - this.locations.set(node, { - start, - end: this.getLastTokenEndLocation() - }); - return node; - } - }, { - key: "copyNode", - value: function copyNode(src, dest) { - this.locations.set(dest, this.locations.get(src)); - return dest; - } - }, { - key: "skipSingleLineComment", - value: function skipSingleLineComment(offset) { - var start = { - line: this.line + 1, - column: this.index - this.lineStart, - offset: this.index - }; - var c = this.source[this.index]; - var type = c === "/" ? "SingleLine" : c === "<" ? "HTMLOpen" : "HTMLClose"; - _get2(ParserWithLocation2.prototype.__proto__ || Object.getPrototypeOf(ParserWithLocation2.prototype), "skipSingleLineComment", this).call(this, offset); - var end = { - line: this.line + 1, - column: this.index - this.lineStart, - offset: this.index - }; - var trailingLineTerminatorCharacters = this.source[this.index - 2] === "\r" ? 2 : (0, _utils2.isLineTerminator)(this.source.charCodeAt(this.index - 1)) ? 1 : 0; - var text = this.source.substring(start.offset + offset, end.offset - trailingLineTerminatorCharacters); - this.comments.push({ text, type, start, end }); - } - }, { - key: "skipMultiLineComment", - value: function skipMultiLineComment() { - var start = { - line: this.line + 1, - column: this.index - this.lineStart, - offset: this.index - }; - var type = "MultiLine"; - var retval = _get2(ParserWithLocation2.prototype.__proto__ || Object.getPrototypeOf(ParserWithLocation2.prototype), "skipMultiLineComment", this).call(this); - var end = { - line: this.line + 1, - column: this.index - this.lineStart, - offset: this.index - }; - var text = this.source.substring(start.offset + 2, end.offset - 2); - this.comments.push({ text, type, start, end }); - return retval; - } - }]); - return ParserWithLocation2; - }(_parser.GenericParser); - function generateInterface(parsingFunctionName) { - return function parse(code2) { - var _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _ref$earlyErrors = _ref.earlyErrors, earlyErrors2 = _ref$earlyErrors === void 0 ? true : _ref$earlyErrors; - var parser2 = new _parser.GenericParser(code2); - var tree = parser2[parsingFunctionName](); - if (earlyErrors2) { - var errors2 = _earlyErrors.EarlyErrorChecker.check(tree); - if (errors2.length > 0) { - throw new _tokenizer3.JsError(0, 1, 0, errors2[0].message); - } - } - return tree; - }; - } - function generateInterfaceWithLocation(parsingFunctionName) { - return function parse(code2) { - var _ref2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _ref2$earlyErrors = _ref2.earlyErrors, earlyErrors2 = _ref2$earlyErrors === void 0 ? true : _ref2$earlyErrors; - var parser2 = new ParserWithLocation(code2); - var tree = parser2[parsingFunctionName](); - if (earlyErrors2) { - var errors2 = _earlyErrors.EarlyErrorChecker.check(tree); - if (errors2.length > 0) { - var _errors$ = errors2[0], node = _errors$.node, message = _errors$.message; - var _parser$locations$get = parser2.locations.get(node).start, offset = _parser$locations$get.offset, line = _parser$locations$get.line, column = _parser$locations$get.column; - throw new _tokenizer3.JsError(offset, line, column, message); - } - } - return { tree, locations: parser2.locations, comments: parser2.comments }; - }; - } - exports2.parseModule = generateInterface("parseModule"); - var parseScript = exports2.parseScript = generateInterface("parseScript"); - exports2.parseModuleWithLocation = generateInterfaceWithLocation("parseModule"); - exports2.parseScriptWithLocation = generateInterfaceWithLocation("parseScript"); - exports2.default = parseScript; - exports2.EarlyErrorChecker = _earlyErrors.EarlyErrorChecker; - exports2.GenericParser = _parser.GenericParser; - exports2.ParserWithLocation = ParserWithLocation; -})(dist$b); -var dist$2 = {}; -Object.defineProperty(dist$2, "__esModule", { - value: true -}); -var _default$2 = dist$2.default = function() { - var SPEC = {}; - var BOOLEAN = { typeName: "Boolean" }; - var DOUBLE = { typeName: "Number" }; - var STRING = { typeName: "String" }; - function Maybe(arg) { - return { typeName: "Maybe", argument: arg }; - } - function List(arg) { - return { typeName: "List", argument: arg }; - } - function Const(arg) { - return { typeName: "Const", argument: arg }; - } - function Union() { - return { typeName: "Union", arguments: [].slice.call(arguments, 0) }; - } - var TYPE_INDICATOR = { - typeName: "Enum", - values: ["ArrayAssignmentTarget", "ArrayBinding", "ArrayExpression", "ArrowExpression", "AssignmentExpression", "AssignmentTargetIdentifier", "AssignmentTargetPropertyIdentifier", "AssignmentTargetPropertyProperty", "AssignmentTargetWithDefault", "AwaitExpression", "BinaryExpression", "BindingIdentifier", "BindingPropertyIdentifier", "BindingPropertyProperty", "BindingWithDefault", "Block", "BlockStatement", "BreakStatement", "CallExpression", "CatchClause", "ClassDeclaration", "ClassElement", "ClassExpression", "CompoundAssignmentExpression", "ComputedMemberAssignmentTarget", "ComputedMemberExpression", "ComputedPropertyName", "ConditionalExpression", "ContinueStatement", "DataProperty", "DebuggerStatement", "Directive", "DoWhileStatement", "EmptyStatement", "Export", "ExportAllFrom", "ExportDefault", "ExportFrom", "ExportFromSpecifier", "ExportLocalSpecifier", "ExportLocals", "ExpressionStatement", "ForAwaitStatement", "ForInStatement", "ForOfStatement", "ForStatement", "FormalParameters", "FunctionBody", "FunctionDeclaration", "FunctionExpression", "Getter", "IdentifierExpression", "IfStatement", "Import", "ImportNamespace", "ImportSpecifier", "LabeledStatement", "LiteralBooleanExpression", "LiteralInfinityExpression", "LiteralNullExpression", "LiteralNumericExpression", "LiteralRegExpExpression", "LiteralStringExpression", "Method", "Module", "NewExpression", "NewTargetExpression", "ObjectAssignmentTarget", "ObjectBinding", "ObjectExpression", "ReturnStatement", "Script", "Setter", "ShorthandProperty", "SpreadElement", "SpreadProperty", "StaticMemberAssignmentTarget", "StaticMemberExpression", "StaticPropertyName", "Super", "SwitchCase", "SwitchDefault", "SwitchStatement", "SwitchStatementWithDefault", "TemplateElement", "TemplateExpression", "ThisExpression", "ThrowStatement", "TryCatchStatement", "TryFinallyStatement", "UnaryExpression", "UpdateExpression", "VariableDeclaration", "VariableDeclarationStatement", "VariableDeclarator", "WhileStatement", "WithStatement", "YieldExpression", "YieldGeneratorExpression"] - }; - var BinaryOperator = { - typeName: "Enum", - values: ["==", "!=", "===", "!==", "<", "<=", ">", ">=", "in", "instanceof", "<<", ">>", ">>>", "+", "-", "*", "/", "%", "**", ",", "||", "&&", "|", "^", "&"] - }; - var CompoundAssignmentOperator = { - typeName: "Enum", - values: ["+=", "-=", "*=", "/=", "%=", "**=", "<<=", ">>=", ">>>=", "|=", "^=", "&="] - }; - var UnaryOperator = { - typeName: "Enum", - values: ["+", "-", "!", "~", "typeof", "void", "delete"] - }; - var UpdateOperator = { - typeName: "Enum", - values: ["++", "--"] - }; - var VariableDeclarationKind = { - typeName: "Enum", - values: ["var", "let", "const"] - }; - var ArrayAssignmentTarget6 = SPEC.ArrayAssignmentTarget = {}; - var ArrayBinding6 = SPEC.ArrayBinding = {}; - var ArrayExpression6 = SPEC.ArrayExpression = {}; - var ArrowExpression6 = SPEC.ArrowExpression = {}; - var AssignmentExpression6 = SPEC.AssignmentExpression = {}; - var AssignmentTargetIdentifier6 = SPEC.AssignmentTargetIdentifier = {}; - var AssignmentTargetPropertyIdentifier6 = SPEC.AssignmentTargetPropertyIdentifier = {}; - var AssignmentTargetPropertyProperty6 = SPEC.AssignmentTargetPropertyProperty = {}; - var AssignmentTargetWithDefault6 = SPEC.AssignmentTargetWithDefault = {}; - var AwaitExpression6 = SPEC.AwaitExpression = {}; - var BinaryExpression6 = SPEC.BinaryExpression = {}; - var BindingIdentifier6 = SPEC.BindingIdentifier = {}; - var BindingPropertyIdentifier6 = SPEC.BindingPropertyIdentifier = {}; - var BindingPropertyProperty6 = SPEC.BindingPropertyProperty = {}; - var BindingWithDefault6 = SPEC.BindingWithDefault = {}; - var Block6 = SPEC.Block = {}; - var BlockStatement6 = SPEC.BlockStatement = {}; - var BreakStatement6 = SPEC.BreakStatement = {}; - var CallExpression6 = SPEC.CallExpression = {}; - var CatchClause6 = SPEC.CatchClause = {}; - var ClassDeclaration6 = SPEC.ClassDeclaration = {}; - var ClassElement6 = SPEC.ClassElement = {}; - var ClassExpression6 = SPEC.ClassExpression = {}; - var CompoundAssignmentExpression6 = SPEC.CompoundAssignmentExpression = {}; - var ComputedMemberAssignmentTarget6 = SPEC.ComputedMemberAssignmentTarget = {}; - var ComputedMemberExpression6 = SPEC.ComputedMemberExpression = {}; - var ComputedPropertyName6 = SPEC.ComputedPropertyName = {}; - var ConditionalExpression6 = SPEC.ConditionalExpression = {}; - var ContinueStatement6 = SPEC.ContinueStatement = {}; - var DataProperty6 = SPEC.DataProperty = {}; - var DebuggerStatement6 = SPEC.DebuggerStatement = {}; - var Directive6 = SPEC.Directive = {}; - var DoWhileStatement6 = SPEC.DoWhileStatement = {}; - var EmptyStatement6 = SPEC.EmptyStatement = {}; - var Export6 = SPEC.Export = {}; - var ExportAllFrom6 = SPEC.ExportAllFrom = {}; - var ExportDefault6 = SPEC.ExportDefault = {}; - var ExportFrom6 = SPEC.ExportFrom = {}; - var ExportFromSpecifier6 = SPEC.ExportFromSpecifier = {}; - var ExportLocalSpecifier6 = SPEC.ExportLocalSpecifier = {}; - var ExportLocals6 = SPEC.ExportLocals = {}; - var ExpressionStatement6 = SPEC.ExpressionStatement = {}; - var ForAwaitStatement6 = SPEC.ForAwaitStatement = {}; - var ForInStatement6 = SPEC.ForInStatement = {}; - var ForOfStatement6 = SPEC.ForOfStatement = {}; - var ForStatement6 = SPEC.ForStatement = {}; - var FormalParameters6 = SPEC.FormalParameters = {}; - var FunctionBody6 = SPEC.FunctionBody = {}; - var FunctionDeclaration6 = SPEC.FunctionDeclaration = {}; - var FunctionExpression6 = SPEC.FunctionExpression = {}; - var Getter6 = SPEC.Getter = {}; - var IdentifierExpression6 = SPEC.IdentifierExpression = {}; - var IfStatement6 = SPEC.IfStatement = {}; - var Import6 = SPEC.Import = {}; - var ImportNamespace6 = SPEC.ImportNamespace = {}; - var ImportSpecifier6 = SPEC.ImportSpecifier = {}; - var LabeledStatement6 = SPEC.LabeledStatement = {}; - var LiteralBooleanExpression6 = SPEC.LiteralBooleanExpression = {}; - var LiteralInfinityExpression6 = SPEC.LiteralInfinityExpression = {}; - var LiteralNullExpression6 = SPEC.LiteralNullExpression = {}; - var LiteralNumericExpression6 = SPEC.LiteralNumericExpression = {}; - var LiteralRegExpExpression6 = SPEC.LiteralRegExpExpression = {}; - var LiteralStringExpression6 = SPEC.LiteralStringExpression = {}; - var Method6 = SPEC.Method = {}; - var Module6 = SPEC.Module = {}; - var NewExpression6 = SPEC.NewExpression = {}; - var NewTargetExpression6 = SPEC.NewTargetExpression = {}; - var ObjectAssignmentTarget6 = SPEC.ObjectAssignmentTarget = {}; - var ObjectBinding6 = SPEC.ObjectBinding = {}; - var ObjectExpression6 = SPEC.ObjectExpression = {}; - var ReturnStatement6 = SPEC.ReturnStatement = {}; - var Script6 = SPEC.Script = {}; - var Setter6 = SPEC.Setter = {}; - var ShorthandProperty6 = SPEC.ShorthandProperty = {}; - var SpreadElement6 = SPEC.SpreadElement = {}; - var SpreadProperty6 = SPEC.SpreadProperty = {}; - var StaticMemberAssignmentTarget6 = SPEC.StaticMemberAssignmentTarget = {}; - var StaticMemberExpression6 = SPEC.StaticMemberExpression = {}; - var StaticPropertyName6 = SPEC.StaticPropertyName = {}; - var Super6 = SPEC.Super = {}; - var SwitchCase6 = SPEC.SwitchCase = {}; - var SwitchDefault6 = SPEC.SwitchDefault = {}; - var SwitchStatement6 = SPEC.SwitchStatement = {}; - var SwitchStatementWithDefault6 = SPEC.SwitchStatementWithDefault = {}; - var TemplateElement6 = SPEC.TemplateElement = {}; - var TemplateExpression6 = SPEC.TemplateExpression = {}; - var ThisExpression6 = SPEC.ThisExpression = {}; - var ThrowStatement6 = SPEC.ThrowStatement = {}; - var TryCatchStatement6 = SPEC.TryCatchStatement = {}; - var TryFinallyStatement6 = SPEC.TryFinallyStatement = {}; - var UnaryExpression6 = SPEC.UnaryExpression = {}; - var UpdateExpression6 = SPEC.UpdateExpression = {}; - var VariableDeclaration6 = SPEC.VariableDeclaration = {}; - var VariableDeclarationStatement6 = SPEC.VariableDeclarationStatement = {}; - var VariableDeclarator6 = SPEC.VariableDeclarator = {}; - var WhileStatement6 = SPEC.WhileStatement = {}; - var WithStatement6 = SPEC.WithStatement = {}; - var YieldExpression6 = SPEC.YieldExpression = {}; - var YieldGeneratorExpression6 = SPEC.YieldGeneratorExpression = {}; - var MemberExpression = Union(ComputedMemberExpression6, StaticMemberExpression6); - var AssignmentTargetProperty = Union(AssignmentTargetPropertyIdentifier6, AssignmentTargetPropertyProperty6); - Union(ClassDeclaration6, ClassExpression6); - var ExportDeclaration = Union(Export6, ExportAllFrom6, ExportDefault6, ExportFrom6, ExportLocals6); - var PropertyName = Union(ComputedPropertyName6, StaticPropertyName6); - Union(FunctionDeclaration6, FunctionExpression6); - var ImportDeclaration = Union(Import6, ImportNamespace6); - var IterationStatement = Union(DoWhileStatement6, ForAwaitStatement6, ForInStatement6, ForOfStatement6, ForStatement6, WhileStatement6); - var MemberAssignmentTarget = Union(ComputedMemberAssignmentTarget6, StaticMemberAssignmentTarget6); - var BindingProperty = Union(BindingPropertyIdentifier6, BindingPropertyProperty6); - var MethodDefinition = Union(Getter6, Method6, Setter6); - var Program = Union(Module6, Script6); - var VariableReference = Union(AssignmentTargetIdentifier6, BindingIdentifier6, IdentifierExpression6); - var NamedObjectProperty = Union(DataProperty6, MethodDefinition); - var Expression = Union(ArrayExpression6, ArrowExpression6, AssignmentExpression6, AwaitExpression6, BinaryExpression6, CallExpression6, ClassExpression6, CompoundAssignmentExpression6, ConditionalExpression6, FunctionExpression6, IdentifierExpression6, LiteralBooleanExpression6, LiteralInfinityExpression6, LiteralNullExpression6, LiteralNumericExpression6, LiteralRegExpExpression6, LiteralStringExpression6, MemberExpression, NewExpression6, NewTargetExpression6, ObjectExpression6, TemplateExpression6, ThisExpression6, UnaryExpression6, UpdateExpression6, YieldExpression6, YieldGeneratorExpression6); - var Statement = Union(BlockStatement6, BreakStatement6, ClassDeclaration6, ContinueStatement6, DebuggerStatement6, EmptyStatement6, ExpressionStatement6, FunctionDeclaration6, IfStatement6, IterationStatement, LabeledStatement6, ReturnStatement6, SwitchStatement6, SwitchStatementWithDefault6, ThrowStatement6, TryCatchStatement6, TryFinallyStatement6, VariableDeclarationStatement6, WithStatement6); - var ObjectProperty = Union(NamedObjectProperty, ShorthandProperty6, SpreadProperty6); - Union(ArrayAssignmentTarget6, ArrayBinding6, AssignmentTargetProperty, AssignmentTargetWithDefault6, BindingProperty, BindingWithDefault6, Block6, CatchClause6, ClassElement6, Directive6, ExportDeclaration, ExportFromSpecifier6, ExportLocalSpecifier6, Expression, FormalParameters6, FunctionBody6, ImportDeclaration, ImportSpecifier6, MemberAssignmentTarget, ObjectAssignmentTarget6, ObjectBinding6, ObjectProperty, Program, PropertyName, SpreadElement6, Statement, Super6, SwitchCase6, SwitchDefault6, TemplateElement6, VariableDeclaration6, VariableDeclarator6, VariableReference); - ArrayAssignmentTarget6.typeName = "ArrayAssignmentTarget"; - ArrayAssignmentTarget6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ArrayAssignmentTarget" }, - { name: "elements", type: List(Maybe(Union(AssignmentTargetWithDefault6, Union(Union(ArrayAssignmentTarget6, ObjectAssignmentTarget6), Union(AssignmentTargetIdentifier6, MemberAssignmentTarget))))) }, - { name: "rest", type: Maybe(Union(Union(ArrayAssignmentTarget6, ObjectAssignmentTarget6), Union(AssignmentTargetIdentifier6, MemberAssignmentTarget))) } - ]; - ArrayBinding6.typeName = "ArrayBinding"; - ArrayBinding6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ArrayBinding" }, - { name: "elements", type: List(Maybe(Union(BindingWithDefault6, Union(BindingIdentifier6, Union(ArrayBinding6, ObjectBinding6))))) }, - { name: "rest", type: Maybe(Union(BindingIdentifier6, Union(ArrayBinding6, ObjectBinding6))) } - ]; - ArrayExpression6.typeName = "ArrayExpression"; - ArrayExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ArrayExpression" }, - { name: "elements", type: List(Maybe(Union(Expression, SpreadElement6))) } - ]; - ArrowExpression6.typeName = "ArrowExpression"; - ArrowExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ArrowExpression" }, - { name: "isAsync", type: BOOLEAN }, - { name: "params", type: FormalParameters6 }, - { name: "body", type: Union(Expression, FunctionBody6) } - ]; - AssignmentExpression6.typeName = "AssignmentExpression"; - AssignmentExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "AssignmentExpression" }, - { name: "binding", type: Union(Union(ArrayAssignmentTarget6, ObjectAssignmentTarget6), Union(AssignmentTargetIdentifier6, MemberAssignmentTarget)) }, - { name: "expression", type: Expression } - ]; - AssignmentTargetIdentifier6.typeName = "AssignmentTargetIdentifier"; - AssignmentTargetIdentifier6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "AssignmentTargetIdentifier" }, - { name: "name", type: STRING } - ]; - AssignmentTargetPropertyIdentifier6.typeName = "AssignmentTargetPropertyIdentifier"; - AssignmentTargetPropertyIdentifier6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "AssignmentTargetPropertyIdentifier" }, - { name: "binding", type: AssignmentTargetIdentifier6 }, - { name: "init", type: Maybe(Expression) } - ]; - AssignmentTargetPropertyProperty6.typeName = "AssignmentTargetPropertyProperty"; - AssignmentTargetPropertyProperty6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "AssignmentTargetPropertyProperty" }, - { name: "name", type: PropertyName }, - { name: "binding", type: Union(AssignmentTargetWithDefault6, Union(Union(ArrayAssignmentTarget6, ObjectAssignmentTarget6), Union(AssignmentTargetIdentifier6, MemberAssignmentTarget))) } - ]; - AssignmentTargetWithDefault6.typeName = "AssignmentTargetWithDefault"; - AssignmentTargetWithDefault6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "AssignmentTargetWithDefault" }, - { name: "binding", type: Union(Union(ArrayAssignmentTarget6, ObjectAssignmentTarget6), Union(AssignmentTargetIdentifier6, MemberAssignmentTarget)) }, - { name: "init", type: Expression } - ]; - AwaitExpression6.typeName = "AwaitExpression"; - AwaitExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "AwaitExpression" }, - { name: "expression", type: Expression } - ]; - BinaryExpression6.typeName = "BinaryExpression"; - BinaryExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "BinaryExpression" }, - { name: "left", type: Expression }, - { name: "operator", type: BinaryOperator }, - { name: "right", type: Expression } - ]; - BindingIdentifier6.typeName = "BindingIdentifier"; - BindingIdentifier6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "BindingIdentifier" }, - { name: "name", type: STRING } - ]; - BindingPropertyIdentifier6.typeName = "BindingPropertyIdentifier"; - BindingPropertyIdentifier6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "BindingPropertyIdentifier" }, - { name: "binding", type: BindingIdentifier6 }, - { name: "init", type: Maybe(Expression) } - ]; - BindingPropertyProperty6.typeName = "BindingPropertyProperty"; - BindingPropertyProperty6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "BindingPropertyProperty" }, - { name: "name", type: PropertyName }, - { name: "binding", type: Union(BindingWithDefault6, Union(BindingIdentifier6, Union(ArrayBinding6, ObjectBinding6))) } - ]; - BindingWithDefault6.typeName = "BindingWithDefault"; - BindingWithDefault6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "BindingWithDefault" }, - { name: "binding", type: Union(BindingIdentifier6, Union(ArrayBinding6, ObjectBinding6)) }, - { name: "init", type: Expression } - ]; - Block6.typeName = "Block"; - Block6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "Block" }, - { name: "statements", type: List(Statement) } - ]; - BlockStatement6.typeName = "BlockStatement"; - BlockStatement6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "BlockStatement" }, - { name: "block", type: Block6 } - ]; - BreakStatement6.typeName = "BreakStatement"; - BreakStatement6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "BreakStatement" }, - { name: "label", type: Maybe(STRING) } - ]; - CallExpression6.typeName = "CallExpression"; - CallExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "CallExpression" }, - { name: "callee", type: Union(Expression, Super6) }, - { name: "arguments", type: List(Union(Expression, SpreadElement6)) } - ]; - CatchClause6.typeName = "CatchClause"; - CatchClause6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "CatchClause" }, - { name: "binding", type: Union(BindingIdentifier6, Union(ArrayBinding6, ObjectBinding6)) }, - { name: "body", type: Block6 } - ]; - ClassDeclaration6.typeName = "ClassDeclaration"; - ClassDeclaration6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ClassDeclaration" }, - { name: "name", type: BindingIdentifier6 }, - { name: "super", type: Maybe(Expression) }, - { name: "elements", type: List(ClassElement6) } - ]; - ClassElement6.typeName = "ClassElement"; - ClassElement6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ClassElement" }, - { name: "isStatic", type: BOOLEAN }, - { name: "method", type: MethodDefinition } - ]; - ClassExpression6.typeName = "ClassExpression"; - ClassExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ClassExpression" }, - { name: "name", type: Maybe(BindingIdentifier6) }, - { name: "super", type: Maybe(Expression) }, - { name: "elements", type: List(ClassElement6) } - ]; - CompoundAssignmentExpression6.typeName = "CompoundAssignmentExpression"; - CompoundAssignmentExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "CompoundAssignmentExpression" }, - { name: "binding", type: Union(AssignmentTargetIdentifier6, MemberAssignmentTarget) }, - { name: "operator", type: CompoundAssignmentOperator }, - { name: "expression", type: Expression } - ]; - ComputedMemberAssignmentTarget6.typeName = "ComputedMemberAssignmentTarget"; - ComputedMemberAssignmentTarget6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ComputedMemberAssignmentTarget" }, - { name: "object", type: Union(Expression, Super6) }, - { name: "expression", type: Expression } - ]; - ComputedMemberExpression6.typeName = "ComputedMemberExpression"; - ComputedMemberExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ComputedMemberExpression" }, - { name: "object", type: Union(Expression, Super6) }, - { name: "expression", type: Expression } - ]; - ComputedPropertyName6.typeName = "ComputedPropertyName"; - ComputedPropertyName6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ComputedPropertyName" }, - { name: "expression", type: Expression } - ]; - ConditionalExpression6.typeName = "ConditionalExpression"; - ConditionalExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ConditionalExpression" }, - { name: "test", type: Expression }, - { name: "consequent", type: Expression }, - { name: "alternate", type: Expression } - ]; - ContinueStatement6.typeName = "ContinueStatement"; - ContinueStatement6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ContinueStatement" }, - { name: "label", type: Maybe(STRING) } - ]; - DataProperty6.typeName = "DataProperty"; - DataProperty6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "DataProperty" }, - { name: "name", type: PropertyName }, - { name: "expression", type: Expression } - ]; - DebuggerStatement6.typeName = "DebuggerStatement"; - DebuggerStatement6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "DebuggerStatement" } - ]; - Directive6.typeName = "Directive"; - Directive6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "Directive" }, - { name: "rawValue", type: STRING } - ]; - DoWhileStatement6.typeName = "DoWhileStatement"; - DoWhileStatement6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "DoWhileStatement" }, - { name: "body", type: Statement }, - { name: "test", type: Expression } - ]; - EmptyStatement6.typeName = "EmptyStatement"; - EmptyStatement6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "EmptyStatement" } - ]; - Export6.typeName = "Export"; - Export6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "Export" }, - { name: "declaration", type: Union(ClassDeclaration6, FunctionDeclaration6, VariableDeclaration6) } - ]; - ExportAllFrom6.typeName = "ExportAllFrom"; - ExportAllFrom6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ExportAllFrom" }, - { name: "moduleSpecifier", type: STRING } - ]; - ExportDefault6.typeName = "ExportDefault"; - ExportDefault6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ExportDefault" }, - { name: "body", type: Union(ClassDeclaration6, Expression, FunctionDeclaration6) } - ]; - ExportFrom6.typeName = "ExportFrom"; - ExportFrom6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ExportFrom" }, - { name: "namedExports", type: List(ExportFromSpecifier6) }, - { name: "moduleSpecifier", type: STRING } - ]; - ExportFromSpecifier6.typeName = "ExportFromSpecifier"; - ExportFromSpecifier6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ExportFromSpecifier" }, - { name: "name", type: STRING }, - { name: "exportedName", type: Maybe(STRING) } - ]; - ExportLocalSpecifier6.typeName = "ExportLocalSpecifier"; - ExportLocalSpecifier6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ExportLocalSpecifier" }, - { name: "name", type: IdentifierExpression6 }, - { name: "exportedName", type: Maybe(STRING) } - ]; - ExportLocals6.typeName = "ExportLocals"; - ExportLocals6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ExportLocals" }, - { name: "namedExports", type: List(ExportLocalSpecifier6) } - ]; - ExpressionStatement6.typeName = "ExpressionStatement"; - ExpressionStatement6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ExpressionStatement" }, - { name: "expression", type: Expression } - ]; - ForAwaitStatement6.typeName = "ForAwaitStatement"; - ForAwaitStatement6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ForAwaitStatement" }, - { name: "left", type: Union(Union(Union(ArrayAssignmentTarget6, ObjectAssignmentTarget6), Union(AssignmentTargetIdentifier6, MemberAssignmentTarget)), VariableDeclaration6) }, - { name: "right", type: Expression }, - { name: "body", type: Statement } - ]; - ForInStatement6.typeName = "ForInStatement"; - ForInStatement6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ForInStatement" }, - { name: "left", type: Union(Union(Union(ArrayAssignmentTarget6, ObjectAssignmentTarget6), Union(AssignmentTargetIdentifier6, MemberAssignmentTarget)), VariableDeclaration6) }, - { name: "right", type: Expression }, - { name: "body", type: Statement } - ]; - ForOfStatement6.typeName = "ForOfStatement"; - ForOfStatement6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ForOfStatement" }, - { name: "left", type: Union(Union(Union(ArrayAssignmentTarget6, ObjectAssignmentTarget6), Union(AssignmentTargetIdentifier6, MemberAssignmentTarget)), VariableDeclaration6) }, - { name: "right", type: Expression }, - { name: "body", type: Statement } - ]; - ForStatement6.typeName = "ForStatement"; - ForStatement6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ForStatement" }, - { name: "init", type: Maybe(Union(Expression, VariableDeclaration6)) }, - { name: "test", type: Maybe(Expression) }, - { name: "update", type: Maybe(Expression) }, - { name: "body", type: Statement } - ]; - FormalParameters6.typeName = "FormalParameters"; - FormalParameters6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "FormalParameters" }, - { name: "items", type: List(Union(BindingWithDefault6, Union(BindingIdentifier6, Union(ArrayBinding6, ObjectBinding6)))) }, - { name: "rest", type: Maybe(Union(BindingIdentifier6, Union(ArrayBinding6, ObjectBinding6))) } - ]; - FunctionBody6.typeName = "FunctionBody"; - FunctionBody6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "FunctionBody" }, - { name: "directives", type: List(Directive6) }, - { name: "statements", type: List(Statement) } - ]; - FunctionDeclaration6.typeName = "FunctionDeclaration"; - FunctionDeclaration6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "FunctionDeclaration" }, - { name: "isAsync", type: BOOLEAN }, - { name: "isGenerator", type: BOOLEAN }, - { name: "name", type: BindingIdentifier6 }, - { name: "params", type: FormalParameters6 }, - { name: "body", type: FunctionBody6 } - ]; - FunctionExpression6.typeName = "FunctionExpression"; - FunctionExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "FunctionExpression" }, - { name: "isAsync", type: BOOLEAN }, - { name: "isGenerator", type: BOOLEAN }, - { name: "name", type: Maybe(BindingIdentifier6) }, - { name: "params", type: FormalParameters6 }, - { name: "body", type: FunctionBody6 } - ]; - Getter6.typeName = "Getter"; - Getter6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "Getter" }, - { name: "name", type: PropertyName }, - { name: "body", type: FunctionBody6 } - ]; - IdentifierExpression6.typeName = "IdentifierExpression"; - IdentifierExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "IdentifierExpression" }, - { name: "name", type: STRING } - ]; - IfStatement6.typeName = "IfStatement"; - IfStatement6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "IfStatement" }, - { name: "test", type: Expression }, - { name: "consequent", type: Statement }, - { name: "alternate", type: Maybe(Statement) } - ]; - Import6.typeName = "Import"; - Import6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "Import" }, - { name: "defaultBinding", type: Maybe(BindingIdentifier6) }, - { name: "namedImports", type: List(ImportSpecifier6) }, - { name: "moduleSpecifier", type: STRING } - ]; - ImportNamespace6.typeName = "ImportNamespace"; - ImportNamespace6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ImportNamespace" }, - { name: "defaultBinding", type: Maybe(BindingIdentifier6) }, - { name: "namespaceBinding", type: BindingIdentifier6 }, - { name: "moduleSpecifier", type: STRING } - ]; - ImportSpecifier6.typeName = "ImportSpecifier"; - ImportSpecifier6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ImportSpecifier" }, - { name: "name", type: Maybe(STRING) }, - { name: "binding", type: BindingIdentifier6 } - ]; - LabeledStatement6.typeName = "LabeledStatement"; - LabeledStatement6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "LabeledStatement" }, - { name: "label", type: STRING }, - { name: "body", type: Statement } - ]; - LiteralBooleanExpression6.typeName = "LiteralBooleanExpression"; - LiteralBooleanExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "LiteralBooleanExpression" }, - { name: "value", type: BOOLEAN } - ]; - LiteralInfinityExpression6.typeName = "LiteralInfinityExpression"; - LiteralInfinityExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "LiteralInfinityExpression" } - ]; - LiteralNullExpression6.typeName = "LiteralNullExpression"; - LiteralNullExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "LiteralNullExpression" } - ]; - LiteralNumericExpression6.typeName = "LiteralNumericExpression"; - LiteralNumericExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "LiteralNumericExpression" }, - { name: "value", type: DOUBLE } - ]; - LiteralRegExpExpression6.typeName = "LiteralRegExpExpression"; - LiteralRegExpExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "LiteralRegExpExpression" }, - { name: "pattern", type: STRING }, - { name: "global", type: BOOLEAN }, - { name: "ignoreCase", type: BOOLEAN }, - { name: "multiLine", type: BOOLEAN }, - { name: "dotAll", type: BOOLEAN }, - { name: "unicode", type: BOOLEAN }, - { name: "sticky", type: BOOLEAN } - ]; - LiteralStringExpression6.typeName = "LiteralStringExpression"; - LiteralStringExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "LiteralStringExpression" }, - { name: "value", type: STRING } - ]; - Method6.typeName = "Method"; - Method6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "Method" }, - { name: "isAsync", type: BOOLEAN }, - { name: "isGenerator", type: BOOLEAN }, - { name: "name", type: PropertyName }, - { name: "params", type: FormalParameters6 }, - { name: "body", type: FunctionBody6 } - ]; - Module6.typeName = "Module"; - Module6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "Module" }, - { name: "directives", type: List(Directive6) }, - { name: "items", type: List(Union(ExportDeclaration, ImportDeclaration, Statement)) } - ]; - NewExpression6.typeName = "NewExpression"; - NewExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "NewExpression" }, - { name: "callee", type: Expression }, - { name: "arguments", type: List(Union(Expression, SpreadElement6)) } - ]; - NewTargetExpression6.typeName = "NewTargetExpression"; - NewTargetExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "NewTargetExpression" } - ]; - ObjectAssignmentTarget6.typeName = "ObjectAssignmentTarget"; - ObjectAssignmentTarget6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ObjectAssignmentTarget" }, - { name: "properties", type: List(AssignmentTargetProperty) }, - { name: "rest", type: Maybe(Union(Union(ArrayAssignmentTarget6, ObjectAssignmentTarget6), Union(AssignmentTargetIdentifier6, MemberAssignmentTarget))) } - ]; - ObjectBinding6.typeName = "ObjectBinding"; - ObjectBinding6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ObjectBinding" }, - { name: "properties", type: List(BindingProperty) }, - { name: "rest", type: Maybe(Union(BindingIdentifier6, Union(ArrayBinding6, ObjectBinding6))) } - ]; - ObjectExpression6.typeName = "ObjectExpression"; - ObjectExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ObjectExpression" }, - { name: "properties", type: List(ObjectProperty) } - ]; - ReturnStatement6.typeName = "ReturnStatement"; - ReturnStatement6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ReturnStatement" }, - { name: "expression", type: Maybe(Expression) } - ]; - Script6.typeName = "Script"; - Script6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "Script" }, - { name: "directives", type: List(Directive6) }, - { name: "statements", type: List(Statement) } - ]; - Setter6.typeName = "Setter"; - Setter6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "Setter" }, - { name: "name", type: PropertyName }, - { name: "param", type: Union(BindingWithDefault6, Union(BindingIdentifier6, Union(ArrayBinding6, ObjectBinding6))) }, - { name: "body", type: FunctionBody6 } - ]; - ShorthandProperty6.typeName = "ShorthandProperty"; - ShorthandProperty6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ShorthandProperty" }, - { name: "name", type: IdentifierExpression6 } - ]; - SpreadElement6.typeName = "SpreadElement"; - SpreadElement6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "SpreadElement" }, - { name: "expression", type: Expression } - ]; - SpreadProperty6.typeName = "SpreadProperty"; - SpreadProperty6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "SpreadProperty" }, - { name: "expression", type: Expression } - ]; - StaticMemberAssignmentTarget6.typeName = "StaticMemberAssignmentTarget"; - StaticMemberAssignmentTarget6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "StaticMemberAssignmentTarget" }, - { name: "object", type: Union(Expression, Super6) }, - { name: "property", type: STRING } - ]; - StaticMemberExpression6.typeName = "StaticMemberExpression"; - StaticMemberExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "StaticMemberExpression" }, - { name: "object", type: Union(Expression, Super6) }, - { name: "property", type: STRING } - ]; - StaticPropertyName6.typeName = "StaticPropertyName"; - StaticPropertyName6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "StaticPropertyName" }, - { name: "value", type: STRING } - ]; - Super6.typeName = "Super"; - Super6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "Super" } - ]; - SwitchCase6.typeName = "SwitchCase"; - SwitchCase6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "SwitchCase" }, - { name: "test", type: Expression }, - { name: "consequent", type: List(Statement) } - ]; - SwitchDefault6.typeName = "SwitchDefault"; - SwitchDefault6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "SwitchDefault" }, - { name: "consequent", type: List(Statement) } - ]; - SwitchStatement6.typeName = "SwitchStatement"; - SwitchStatement6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "SwitchStatement" }, - { name: "discriminant", type: Expression }, - { name: "cases", type: List(SwitchCase6) } - ]; - SwitchStatementWithDefault6.typeName = "SwitchStatementWithDefault"; - SwitchStatementWithDefault6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "SwitchStatementWithDefault" }, - { name: "discriminant", type: Expression }, - { name: "preDefaultCases", type: List(SwitchCase6) }, - { name: "defaultCase", type: SwitchDefault6 }, - { name: "postDefaultCases", type: List(SwitchCase6) } - ]; - TemplateElement6.typeName = "TemplateElement"; - TemplateElement6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "TemplateElement" }, - { name: "rawValue", type: STRING } - ]; - TemplateExpression6.typeName = "TemplateExpression"; - TemplateExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "TemplateExpression" }, - { name: "tag", type: Maybe(Expression) }, - { name: "elements", type: List(Union(Expression, TemplateElement6)) } - ]; - ThisExpression6.typeName = "ThisExpression"; - ThisExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ThisExpression" } - ]; - ThrowStatement6.typeName = "ThrowStatement"; - ThrowStatement6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "ThrowStatement" }, - { name: "expression", type: Expression } - ]; - TryCatchStatement6.typeName = "TryCatchStatement"; - TryCatchStatement6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "TryCatchStatement" }, - { name: "body", type: Block6 }, - { name: "catchClause", type: CatchClause6 } - ]; - TryFinallyStatement6.typeName = "TryFinallyStatement"; - TryFinallyStatement6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "TryFinallyStatement" }, - { name: "body", type: Block6 }, - { name: "catchClause", type: Maybe(CatchClause6) }, - { name: "finalizer", type: Block6 } - ]; - UnaryExpression6.typeName = "UnaryExpression"; - UnaryExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "UnaryExpression" }, - { name: "operator", type: UnaryOperator }, - { name: "operand", type: Expression } - ]; - UpdateExpression6.typeName = "UpdateExpression"; - UpdateExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "UpdateExpression" }, - { name: "isPrefix", type: BOOLEAN }, - { name: "operator", type: UpdateOperator }, - { name: "operand", type: Union(AssignmentTargetIdentifier6, MemberAssignmentTarget) } - ]; - VariableDeclaration6.typeName = "VariableDeclaration"; - VariableDeclaration6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "VariableDeclaration" }, - { name: "kind", type: VariableDeclarationKind }, - { name: "declarators", type: List(VariableDeclarator6) } - ]; - VariableDeclarationStatement6.typeName = "VariableDeclarationStatement"; - VariableDeclarationStatement6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "VariableDeclarationStatement" }, - { name: "declaration", type: VariableDeclaration6 } - ]; - VariableDeclarator6.typeName = "VariableDeclarator"; - VariableDeclarator6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "VariableDeclarator" }, - { name: "binding", type: Union(BindingIdentifier6, Union(ArrayBinding6, ObjectBinding6)) }, - { name: "init", type: Maybe(Expression) } - ]; - WhileStatement6.typeName = "WhileStatement"; - WhileStatement6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "WhileStatement" }, - { name: "test", type: Expression }, - { name: "body", type: Statement } - ]; - WithStatement6.typeName = "WithStatement"; - WithStatement6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "WithStatement" }, - { name: "object", type: Expression }, - { name: "body", type: Statement } - ]; - YieldExpression6.typeName = "YieldExpression"; - YieldExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "YieldExpression" }, - { name: "expression", type: Maybe(Expression) } - ]; - YieldGeneratorExpression6.typeName = "YieldGeneratorExpression"; - YieldGeneratorExpression6.fields = [ - { name: "type", type: Const(TYPE_INDICATOR), value: "YieldGeneratorExpression" }, - { name: "expression", type: Expression } - ]; - return SPEC; -}(); -var estraverse$1 = {}; -(function(exports2) { - (function clone(exports3) { - var Syntax, VisitorOption, VisitorKeys, BREAK, SKIP, REMOVE; - function deepCopy(obj) { - var ret = {}, key, val; - for (key in obj) { - if (obj.hasOwnProperty(key)) { - val = obj[key]; - if (typeof val === "object" && val !== null) { - ret[key] = deepCopy(val); - } else { - ret[key] = val; - } - } - } - return ret; - } - function upperBound(array, func) { - var diff, len, i2, current; - len = array.length; - i2 = 0; - while (len) { - diff = len >>> 1; - current = i2 + diff; - if (func(array[current])) { - len = diff; - } else { - i2 = current + 1; - len -= diff + 1; - } - } - return i2; - } - Syntax = { - AssignmentExpression: "AssignmentExpression", - AssignmentPattern: "AssignmentPattern", - ArrayExpression: "ArrayExpression", - ArrayPattern: "ArrayPattern", - ArrowFunctionExpression: "ArrowFunctionExpression", - AwaitExpression: "AwaitExpression", - BlockStatement: "BlockStatement", - BinaryExpression: "BinaryExpression", - BreakStatement: "BreakStatement", - CallExpression: "CallExpression", - CatchClause: "CatchClause", - ChainExpression: "ChainExpression", - ClassBody: "ClassBody", - ClassDeclaration: "ClassDeclaration", - ClassExpression: "ClassExpression", - ComprehensionBlock: "ComprehensionBlock", - ComprehensionExpression: "ComprehensionExpression", - ConditionalExpression: "ConditionalExpression", - ContinueStatement: "ContinueStatement", - DebuggerStatement: "DebuggerStatement", - DirectiveStatement: "DirectiveStatement", - DoWhileStatement: "DoWhileStatement", - EmptyStatement: "EmptyStatement", - ExportAllDeclaration: "ExportAllDeclaration", - ExportDefaultDeclaration: "ExportDefaultDeclaration", - ExportNamedDeclaration: "ExportNamedDeclaration", - ExportSpecifier: "ExportSpecifier", - ExpressionStatement: "ExpressionStatement", - ForStatement: "ForStatement", - ForInStatement: "ForInStatement", - ForOfStatement: "ForOfStatement", - FunctionDeclaration: "FunctionDeclaration", - FunctionExpression: "FunctionExpression", - GeneratorExpression: "GeneratorExpression", - Identifier: "Identifier", - IfStatement: "IfStatement", - ImportExpression: "ImportExpression", - ImportDeclaration: "ImportDeclaration", - ImportDefaultSpecifier: "ImportDefaultSpecifier", - ImportNamespaceSpecifier: "ImportNamespaceSpecifier", - ImportSpecifier: "ImportSpecifier", - Literal: "Literal", - LabeledStatement: "LabeledStatement", - LogicalExpression: "LogicalExpression", - MemberExpression: "MemberExpression", - MetaProperty: "MetaProperty", - MethodDefinition: "MethodDefinition", - ModuleSpecifier: "ModuleSpecifier", - NewExpression: "NewExpression", - ObjectExpression: "ObjectExpression", - ObjectPattern: "ObjectPattern", - PrivateIdentifier: "PrivateIdentifier", - Program: "Program", - Property: "Property", - PropertyDefinition: "PropertyDefinition", - RestElement: "RestElement", - ReturnStatement: "ReturnStatement", - SequenceExpression: "SequenceExpression", - SpreadElement: "SpreadElement", - Super: "Super", - SwitchStatement: "SwitchStatement", - SwitchCase: "SwitchCase", - TaggedTemplateExpression: "TaggedTemplateExpression", - TemplateElement: "TemplateElement", - TemplateLiteral: "TemplateLiteral", - ThisExpression: "ThisExpression", - ThrowStatement: "ThrowStatement", - TryStatement: "TryStatement", - UnaryExpression: "UnaryExpression", - UpdateExpression: "UpdateExpression", - VariableDeclaration: "VariableDeclaration", - VariableDeclarator: "VariableDeclarator", - WhileStatement: "WhileStatement", - WithStatement: "WithStatement", - YieldExpression: "YieldExpression" - }; - VisitorKeys = { - AssignmentExpression: ["left", "right"], - AssignmentPattern: ["left", "right"], - ArrayExpression: ["elements"], - ArrayPattern: ["elements"], - ArrowFunctionExpression: ["params", "body"], - AwaitExpression: ["argument"], - BlockStatement: ["body"], - BinaryExpression: ["left", "right"], - BreakStatement: ["label"], - CallExpression: ["callee", "arguments"], - CatchClause: ["param", "body"], - ChainExpression: ["expression"], - ClassBody: ["body"], - ClassDeclaration: ["id", "superClass", "body"], - ClassExpression: ["id", "superClass", "body"], - ComprehensionBlock: ["left", "right"], - ComprehensionExpression: ["blocks", "filter", "body"], - ConditionalExpression: ["test", "consequent", "alternate"], - ContinueStatement: ["label"], - DebuggerStatement: [], - DirectiveStatement: [], - DoWhileStatement: ["body", "test"], - EmptyStatement: [], - ExportAllDeclaration: ["source"], - ExportDefaultDeclaration: ["declaration"], - ExportNamedDeclaration: ["declaration", "specifiers", "source"], - ExportSpecifier: ["exported", "local"], - ExpressionStatement: ["expression"], - ForStatement: ["init", "test", "update", "body"], - ForInStatement: ["left", "right", "body"], - ForOfStatement: ["left", "right", "body"], - FunctionDeclaration: ["id", "params", "body"], - FunctionExpression: ["id", "params", "body"], - GeneratorExpression: ["blocks", "filter", "body"], - Identifier: [], - IfStatement: ["test", "consequent", "alternate"], - ImportExpression: ["source"], - ImportDeclaration: ["specifiers", "source"], - ImportDefaultSpecifier: ["local"], - ImportNamespaceSpecifier: ["local"], - ImportSpecifier: ["imported", "local"], - Literal: [], - LabeledStatement: ["label", "body"], - LogicalExpression: ["left", "right"], - MemberExpression: ["object", "property"], - MetaProperty: ["meta", "property"], - MethodDefinition: ["key", "value"], - ModuleSpecifier: [], - NewExpression: ["callee", "arguments"], - ObjectExpression: ["properties"], - ObjectPattern: ["properties"], - PrivateIdentifier: [], - Program: ["body"], - Property: ["key", "value"], - PropertyDefinition: ["key", "value"], - RestElement: ["argument"], - ReturnStatement: ["argument"], - SequenceExpression: ["expressions"], - SpreadElement: ["argument"], - Super: [], - SwitchStatement: ["discriminant", "cases"], - SwitchCase: ["test", "consequent"], - TaggedTemplateExpression: ["tag", "quasi"], - TemplateElement: [], - TemplateLiteral: ["quasis", "expressions"], - ThisExpression: [], - ThrowStatement: ["argument"], - TryStatement: ["block", "handler", "finalizer"], - UnaryExpression: ["argument"], - UpdateExpression: ["argument"], - VariableDeclaration: ["declarations"], - VariableDeclarator: ["id", "init"], - WhileStatement: ["test", "body"], - WithStatement: ["object", "body"], - YieldExpression: ["argument"] - }; - BREAK = {}; - SKIP = {}; - REMOVE = {}; - VisitorOption = { - Break: BREAK, - Skip: SKIP, - Remove: REMOVE - }; - function Reference(parent, key) { - this.parent = parent; - this.key = key; - } - Reference.prototype.replace = function replace2(node) { - this.parent[this.key] = node; - }; - Reference.prototype.remove = function remove() { - if (Array.isArray(this.parent)) { - this.parent.splice(this.key, 1); - return true; - } else { - this.replace(null); - return false; - } - }; - function Element(node, path, wrap, ref) { - this.node = node; - this.path = path; - this.wrap = wrap; - this.ref = ref; - } - function Controller() { - } - Controller.prototype.path = function path() { - var i2, iz, j, jz, result, element; - function addToPath(result2, path2) { - if (Array.isArray(path2)) { - for (j = 0, jz = path2.length; j < jz; ++j) { - result2.push(path2[j]); - } - } else { - result2.push(path2); - } - } - if (!this.__current.path) { - return null; - } - result = []; - for (i2 = 2, iz = this.__leavelist.length; i2 < iz; ++i2) { - element = this.__leavelist[i2]; - addToPath(result, element.path); - } - addToPath(result, this.__current.path); - return result; - }; - Controller.prototype.type = function() { - var node = this.current(); - return node.type || this.__current.wrap; - }; - Controller.prototype.parents = function parents() { - var i2, iz, result; - result = []; - for (i2 = 1, iz = this.__leavelist.length; i2 < iz; ++i2) { - result.push(this.__leavelist[i2].node); - } - return result; - }; - Controller.prototype.current = function current() { - return this.__current.node; - }; - Controller.prototype.__execute = function __execute(callback, element) { - var previous, result; - result = void 0; - previous = this.__current; - this.__current = element; - this.__state = null; - if (callback) { - result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node); - } - this.__current = previous; - return result; - }; - Controller.prototype.notify = function notify(flag) { - this.__state = flag; - }; - Controller.prototype.skip = function() { - this.notify(SKIP); - }; - Controller.prototype["break"] = function() { - this.notify(BREAK); - }; - Controller.prototype.remove = function() { - this.notify(REMOVE); - }; - Controller.prototype.__initialize = function(root, visitor) { - this.visitor = visitor; - this.root = root; - this.__worklist = []; - this.__leavelist = []; - this.__current = null; - this.__state = null; - this.__fallback = null; - if (visitor.fallback === "iteration") { - this.__fallback = Object.keys; - } else if (typeof visitor.fallback === "function") { - this.__fallback = visitor.fallback; - } - this.__keys = VisitorKeys; - if (visitor.keys) { - this.__keys = Object.assign(Object.create(this.__keys), visitor.keys); - } - }; - function isNode(node) { - if (node == null) { - return false; - } - return typeof node === "object" && typeof node.type === "string"; - } - function isProperty(nodeType, key) { - return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && "properties" === key; - } - function candidateExistsInLeaveList(leavelist, candidate) { - for (var i2 = leavelist.length - 1; i2 >= 0; --i2) { - if (leavelist[i2].node === candidate) { - return true; - } - } - return false; - } - Controller.prototype.traverse = function traverse2(root, visitor) { - var worklist, leavelist, element, node, nodeType, ret, key, current, current2, candidates, candidate, sentinel; - this.__initialize(root, visitor); - sentinel = {}; - worklist = this.__worklist; - leavelist = this.__leavelist; - worklist.push(new Element(root, null, null, null)); - leavelist.push(new Element(null, null, null, null)); - while (worklist.length) { - element = worklist.pop(); - if (element === sentinel) { - element = leavelist.pop(); - ret = this.__execute(visitor.leave, element); - if (this.__state === BREAK || ret === BREAK) { - return; - } - continue; - } - if (element.node) { - ret = this.__execute(visitor.enter, element); - if (this.__state === BREAK || ret === BREAK) { - return; - } - worklist.push(sentinel); - leavelist.push(element); - if (this.__state === SKIP || ret === SKIP) { - continue; - } - node = element.node; - nodeType = node.type || element.wrap; - candidates = this.__keys[nodeType]; - if (!candidates) { - if (this.__fallback) { - candidates = this.__fallback(node); - } else { - throw new Error("Unknown node type " + nodeType + "."); - } - } - current = candidates.length; - while ((current -= 1) >= 0) { - key = candidates[current]; - candidate = node[key]; - if (!candidate) { - continue; - } - if (Array.isArray(candidate)) { - current2 = candidate.length; - while ((current2 -= 1) >= 0) { - if (!candidate[current2]) { - continue; - } - if (candidateExistsInLeaveList(leavelist, candidate[current2])) { - continue; - } - if (isProperty(nodeType, candidates[current])) { - element = new Element(candidate[current2], [key, current2], "Property", null); - } else if (isNode(candidate[current2])) { - element = new Element(candidate[current2], [key, current2], null, null); - } else { - continue; - } - worklist.push(element); - } - } else if (isNode(candidate)) { - if (candidateExistsInLeaveList(leavelist, candidate)) { - continue; - } - worklist.push(new Element(candidate, key, null, null)); - } - } - } - } - }; - Controller.prototype.replace = function replace2(root, visitor) { - var worklist, leavelist, node, nodeType, target, element, current, current2, candidates, candidate, sentinel, outer, key; - function removeElem(element2) { - var i2, key2, nextElem, parent; - if (element2.ref.remove()) { - key2 = element2.ref.key; - parent = element2.ref.parent; - i2 = worklist.length; - while (i2--) { - nextElem = worklist[i2]; - if (nextElem.ref && nextElem.ref.parent === parent) { - if (nextElem.ref.key < key2) { - break; - } - --nextElem.ref.key; - } - } - } - } - this.__initialize(root, visitor); - sentinel = {}; - worklist = this.__worklist; - leavelist = this.__leavelist; - outer = { - root - }; - element = new Element(root, null, null, new Reference(outer, "root")); - worklist.push(element); - leavelist.push(element); - while (worklist.length) { - element = worklist.pop(); - if (element === sentinel) { - element = leavelist.pop(); - target = this.__execute(visitor.leave, element); - if (target !== void 0 && target !== BREAK && target !== SKIP && target !== REMOVE) { - element.ref.replace(target); - } - if (this.__state === REMOVE || target === REMOVE) { - removeElem(element); - } - if (this.__state === BREAK || target === BREAK) { - return outer.root; - } - continue; - } - target = this.__execute(visitor.enter, element); - if (target !== void 0 && target !== BREAK && target !== SKIP && target !== REMOVE) { - element.ref.replace(target); - element.node = target; - } - if (this.__state === REMOVE || target === REMOVE) { - removeElem(element); - element.node = null; - } - if (this.__state === BREAK || target === BREAK) { - return outer.root; - } - node = element.node; - if (!node) { - continue; - } - worklist.push(sentinel); - leavelist.push(element); - if (this.__state === SKIP || target === SKIP) { - continue; - } - nodeType = node.type || element.wrap; - candidates = this.__keys[nodeType]; - if (!candidates) { - if (this.__fallback) { - candidates = this.__fallback(node); - } else { - throw new Error("Unknown node type " + nodeType + "."); - } - } - current = candidates.length; - while ((current -= 1) >= 0) { - key = candidates[current]; - candidate = node[key]; - if (!candidate) { - continue; - } - if (Array.isArray(candidate)) { - current2 = candidate.length; - while ((current2 -= 1) >= 0) { - if (!candidate[current2]) { - continue; - } - if (isProperty(nodeType, candidates[current])) { - element = new Element(candidate[current2], [key, current2], "Property", new Reference(candidate, current2)); - } else if (isNode(candidate[current2])) { - element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2)); - } else { - continue; - } - worklist.push(element); - } - } else if (isNode(candidate)) { - worklist.push(new Element(candidate, key, null, new Reference(node, key))); - } - } - } - return outer.root; - }; - function traverse(root, visitor) { - var controller = new Controller(); - return controller.traverse(root, visitor); - } - function replace(root, visitor) { - var controller = new Controller(); - return controller.replace(root, visitor); - } - function extendCommentRange(comment, tokens) { - var target; - target = upperBound(tokens, function search(token) { - return token.range[0] > comment.range[0]; - }); - comment.extendedRange = [comment.range[0], comment.range[1]]; - if (target !== tokens.length) { - comment.extendedRange[1] = tokens[target].range[0]; - } - target -= 1; - if (target >= 0) { - comment.extendedRange[0] = tokens[target].range[1]; - } - return comment; - } - function attachComments(tree, providedComments, tokens) { - var comments = [], comment, len, i2, cursor; - if (!tree.range) { - throw new Error("attachComments needs range information"); - } - if (!tokens.length) { - if (providedComments.length) { - for (i2 = 0, len = providedComments.length; i2 < len; i2 += 1) { - comment = deepCopy(providedComments[i2]); - comment.extendedRange = [0, tree.range[0]]; - comments.push(comment); - } - tree.leadingComments = comments; - } - return tree; - } - for (i2 = 0, len = providedComments.length; i2 < len; i2 += 1) { - comments.push(extendCommentRange(deepCopy(providedComments[i2]), tokens)); - } - cursor = 0; - traverse(tree, { - enter: function(node) { - var comment2; - while (cursor < comments.length) { - comment2 = comments[cursor]; - if (comment2.extendedRange[1] > node.range[0]) { - break; - } - if (comment2.extendedRange[1] === node.range[0]) { - if (!node.leadingComments) { - node.leadingComments = []; - } - node.leadingComments.push(comment2); - comments.splice(cursor, 1); - } else { - cursor += 1; - } - } - if (cursor === comments.length) { - return VisitorOption.Break; - } - if (comments[cursor].extendedRange[0] > node.range[1]) { - return VisitorOption.Skip; - } - } - }); - cursor = 0; - traverse(tree, { - leave: function(node) { - var comment2; - while (cursor < comments.length) { - comment2 = comments[cursor]; - if (node.range[1] < comment2.extendedRange[0]) { - break; - } - if (node.range[1] === comment2.extendedRange[0]) { - if (!node.trailingComments) { - node.trailingComments = []; - } - node.trailingComments.push(comment2); - comments.splice(cursor, 1); - } else { - cursor += 1; - } - } - if (cursor === comments.length) { - return VisitorOption.Break; - } - if (comments[cursor].extendedRange[0] > node.range[1]) { - return VisitorOption.Skip; - } - } - }); - return tree; - } - exports3.Syntax = Syntax; - exports3.traverse = traverse; - exports3.replace = replace; - exports3.attachComments = attachComments; - exports3.VisitorKeys = VisitorKeys; - exports3.VisitorOption = VisitorOption; - exports3.Controller = Controller; - exports3.cloneEnvironment = function() { - return clone({}); - }; - return exports3; - })(exports2); -})(estraverse$1); -const Spec = _default$2.default || _default$2; -const estraverse = estraverse$1.cloneEnvironment(); -Object.keys(estraverse.Syntax).filter((key) => key !== "Property").forEach((key) => { - delete estraverse.Syntax[key]; - delete estraverse.VisitorKeys[key]; -}); -Object.assign( - estraverse.Syntax, - Object.keys(Spec).reduce((result, key) => { - result[key] = key; - return result; - }, {}) -); -Object.assign( - estraverse.VisitorKeys, - Object.keys(Spec).reduce((result, key) => { - result[key] = Spec[key].fields.map((field) => field.name); - return result; - }, {}) -); -var dist$1 = {}; -Object.defineProperty(dist$1, "__esModule", { - value: true -}); -function _classCallCheck$5(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} -dist$1.ArrayAssignmentTarget = function ArrayAssignmentTarget5(_ref) { - var elements = _ref.elements, rest = _ref.rest; - _classCallCheck$5(this, ArrayAssignmentTarget5); - this.type = "ArrayAssignmentTarget"; - this.elements = elements; - this.rest = rest; -}; -dist$1.ArrayBinding = function ArrayBinding5(_ref2) { - var elements = _ref2.elements, rest = _ref2.rest; - _classCallCheck$5(this, ArrayBinding5); - this.type = "ArrayBinding"; - this.elements = elements; - this.rest = rest; -}; -dist$1.ArrayExpression = function ArrayExpression5(_ref3) { - var elements = _ref3.elements; - _classCallCheck$5(this, ArrayExpression5); - this.type = "ArrayExpression"; - this.elements = elements; -}; -dist$1.ArrowExpression = function ArrowExpression5(_ref4) { - var isAsync = _ref4.isAsync, params = _ref4.params, body = _ref4.body; - _classCallCheck$5(this, ArrowExpression5); - this.type = "ArrowExpression"; - this.isAsync = isAsync; - this.params = params; - this.body = body; -}; -dist$1.AssignmentExpression = function AssignmentExpression5(_ref5) { - var binding = _ref5.binding, expression = _ref5.expression; - _classCallCheck$5(this, AssignmentExpression5); - this.type = "AssignmentExpression"; - this.binding = binding; - this.expression = expression; -}; -dist$1.AssignmentTargetIdentifier = function AssignmentTargetIdentifier5(_ref6) { - var name = _ref6.name; - _classCallCheck$5(this, AssignmentTargetIdentifier5); - this.type = "AssignmentTargetIdentifier"; - this.name = name; -}; -dist$1.AssignmentTargetPropertyIdentifier = function AssignmentTargetPropertyIdentifier5(_ref7) { - var binding = _ref7.binding, init = _ref7.init; - _classCallCheck$5(this, AssignmentTargetPropertyIdentifier5); - this.type = "AssignmentTargetPropertyIdentifier"; - this.binding = binding; - this.init = init; -}; -dist$1.AssignmentTargetPropertyProperty = function AssignmentTargetPropertyProperty5(_ref8) { - var name = _ref8.name, binding = _ref8.binding; - _classCallCheck$5(this, AssignmentTargetPropertyProperty5); - this.type = "AssignmentTargetPropertyProperty"; - this.name = name; - this.binding = binding; -}; -dist$1.AssignmentTargetWithDefault = function AssignmentTargetWithDefault5(_ref9) { - var binding = _ref9.binding, init = _ref9.init; - _classCallCheck$5(this, AssignmentTargetWithDefault5); - this.type = "AssignmentTargetWithDefault"; - this.binding = binding; - this.init = init; -}; -dist$1.AwaitExpression = function AwaitExpression5(_ref10) { - var expression = _ref10.expression; - _classCallCheck$5(this, AwaitExpression5); - this.type = "AwaitExpression"; - this.expression = expression; -}; -dist$1.BinaryExpression = function BinaryExpression5(_ref11) { - var left = _ref11.left, operator = _ref11.operator, right = _ref11.right; - _classCallCheck$5(this, BinaryExpression5); - this.type = "BinaryExpression"; - this.left = left; - this.operator = operator; - this.right = right; -}; -dist$1.BindingIdentifier = function BindingIdentifier5(_ref12) { - var name = _ref12.name; - _classCallCheck$5(this, BindingIdentifier5); - this.type = "BindingIdentifier"; - this.name = name; -}; -dist$1.BindingPropertyIdentifier = function BindingPropertyIdentifier5(_ref13) { - var binding = _ref13.binding, init = _ref13.init; - _classCallCheck$5(this, BindingPropertyIdentifier5); - this.type = "BindingPropertyIdentifier"; - this.binding = binding; - this.init = init; -}; -dist$1.BindingPropertyProperty = function BindingPropertyProperty5(_ref14) { - var name = _ref14.name, binding = _ref14.binding; - _classCallCheck$5(this, BindingPropertyProperty5); - this.type = "BindingPropertyProperty"; - this.name = name; - this.binding = binding; -}; -dist$1.BindingWithDefault = function BindingWithDefault5(_ref15) { - var binding = _ref15.binding, init = _ref15.init; - _classCallCheck$5(this, BindingWithDefault5); - this.type = "BindingWithDefault"; - this.binding = binding; - this.init = init; -}; -dist$1.Block = function Block5(_ref16) { - var statements = _ref16.statements; - _classCallCheck$5(this, Block5); - this.type = "Block"; - this.statements = statements; -}; -dist$1.BlockStatement = function BlockStatement5(_ref17) { - var block = _ref17.block; - _classCallCheck$5(this, BlockStatement5); - this.type = "BlockStatement"; - this.block = block; -}; -dist$1.BreakStatement = function BreakStatement5(_ref18) { - var label = _ref18.label; - _classCallCheck$5(this, BreakStatement5); - this.type = "BreakStatement"; - this.label = label; -}; -dist$1.CallExpression = function CallExpression5(_ref19) { - var callee = _ref19.callee, _arguments = _ref19.arguments; - _classCallCheck$5(this, CallExpression5); - this.type = "CallExpression"; - this.callee = callee; - this.arguments = _arguments; -}; -dist$1.CatchClause = function CatchClause5(_ref20) { - var binding = _ref20.binding, body = _ref20.body; - _classCallCheck$5(this, CatchClause5); - this.type = "CatchClause"; - this.binding = binding; - this.body = body; -}; -dist$1.ClassDeclaration = function ClassDeclaration5(_ref21) { - var name = _ref21.name, _super = _ref21.super, elements = _ref21.elements; - _classCallCheck$5(this, ClassDeclaration5); - this.type = "ClassDeclaration"; - this.name = name; - this.super = _super; - this.elements = elements; -}; -dist$1.ClassElement = function ClassElement5(_ref22) { - var isStatic = _ref22.isStatic, method = _ref22.method; - _classCallCheck$5(this, ClassElement5); - this.type = "ClassElement"; - this.isStatic = isStatic; - this.method = method; -}; -dist$1.ClassExpression = function ClassExpression5(_ref23) { - var name = _ref23.name, _super = _ref23.super, elements = _ref23.elements; - _classCallCheck$5(this, ClassExpression5); - this.type = "ClassExpression"; - this.name = name; - this.super = _super; - this.elements = elements; -}; -dist$1.CompoundAssignmentExpression = function CompoundAssignmentExpression5(_ref24) { - var binding = _ref24.binding, operator = _ref24.operator, expression = _ref24.expression; - _classCallCheck$5(this, CompoundAssignmentExpression5); - this.type = "CompoundAssignmentExpression"; - this.binding = binding; - this.operator = operator; - this.expression = expression; -}; -dist$1.ComputedMemberAssignmentTarget = function ComputedMemberAssignmentTarget5(_ref25) { - var object = _ref25.object, expression = _ref25.expression; - _classCallCheck$5(this, ComputedMemberAssignmentTarget5); - this.type = "ComputedMemberAssignmentTarget"; - this.object = object; - this.expression = expression; -}; -dist$1.ComputedMemberExpression = function ComputedMemberExpression5(_ref26) { - var object = _ref26.object, expression = _ref26.expression; - _classCallCheck$5(this, ComputedMemberExpression5); - this.type = "ComputedMemberExpression"; - this.object = object; - this.expression = expression; -}; -dist$1.ComputedPropertyName = function ComputedPropertyName5(_ref27) { - var expression = _ref27.expression; - _classCallCheck$5(this, ComputedPropertyName5); - this.type = "ComputedPropertyName"; - this.expression = expression; -}; -dist$1.ConditionalExpression = function ConditionalExpression5(_ref28) { - var test = _ref28.test, consequent = _ref28.consequent, alternate = _ref28.alternate; - _classCallCheck$5(this, ConditionalExpression5); - this.type = "ConditionalExpression"; - this.test = test; - this.consequent = consequent; - this.alternate = alternate; -}; -dist$1.ContinueStatement = function ContinueStatement5(_ref29) { - var label = _ref29.label; - _classCallCheck$5(this, ContinueStatement5); - this.type = "ContinueStatement"; - this.label = label; -}; -dist$1.DataProperty = function DataProperty5(_ref30) { - var name = _ref30.name, expression = _ref30.expression; - _classCallCheck$5(this, DataProperty5); - this.type = "DataProperty"; - this.name = name; - this.expression = expression; -}; -dist$1.DebuggerStatement = function DebuggerStatement5() { - _classCallCheck$5(this, DebuggerStatement5); - this.type = "DebuggerStatement"; -}; -dist$1.Directive = function Directive5(_ref31) { - var rawValue = _ref31.rawValue; - _classCallCheck$5(this, Directive5); - this.type = "Directive"; - this.rawValue = rawValue; -}; -dist$1.DoWhileStatement = function DoWhileStatement5(_ref32) { - var body = _ref32.body, test = _ref32.test; - _classCallCheck$5(this, DoWhileStatement5); - this.type = "DoWhileStatement"; - this.body = body; - this.test = test; -}; -dist$1.EmptyStatement = function EmptyStatement5() { - _classCallCheck$5(this, EmptyStatement5); - this.type = "EmptyStatement"; -}; -dist$1.Export = function Export5(_ref33) { - var declaration = _ref33.declaration; - _classCallCheck$5(this, Export5); - this.type = "Export"; - this.declaration = declaration; -}; -dist$1.ExportAllFrom = function ExportAllFrom5(_ref34) { - var moduleSpecifier = _ref34.moduleSpecifier; - _classCallCheck$5(this, ExportAllFrom5); - this.type = "ExportAllFrom"; - this.moduleSpecifier = moduleSpecifier; -}; -dist$1.ExportDefault = function ExportDefault5(_ref35) { - var body = _ref35.body; - _classCallCheck$5(this, ExportDefault5); - this.type = "ExportDefault"; - this.body = body; -}; -dist$1.ExportFrom = function ExportFrom5(_ref36) { - var namedExports = _ref36.namedExports, moduleSpecifier = _ref36.moduleSpecifier; - _classCallCheck$5(this, ExportFrom5); - this.type = "ExportFrom"; - this.namedExports = namedExports; - this.moduleSpecifier = moduleSpecifier; -}; -dist$1.ExportFromSpecifier = function ExportFromSpecifier5(_ref37) { - var name = _ref37.name, exportedName = _ref37.exportedName; - _classCallCheck$5(this, ExportFromSpecifier5); - this.type = "ExportFromSpecifier"; - this.name = name; - this.exportedName = exportedName; -}; -dist$1.ExportLocalSpecifier = function ExportLocalSpecifier5(_ref38) { - var name = _ref38.name, exportedName = _ref38.exportedName; - _classCallCheck$5(this, ExportLocalSpecifier5); - this.type = "ExportLocalSpecifier"; - this.name = name; - this.exportedName = exportedName; -}; -dist$1.ExportLocals = function ExportLocals5(_ref39) { - var namedExports = _ref39.namedExports; - _classCallCheck$5(this, ExportLocals5); - this.type = "ExportLocals"; - this.namedExports = namedExports; -}; -dist$1.ExpressionStatement = function ExpressionStatement5(_ref40) { - var expression = _ref40.expression; - _classCallCheck$5(this, ExpressionStatement5); - this.type = "ExpressionStatement"; - this.expression = expression; -}; -dist$1.ForAwaitStatement = function ForAwaitStatement5(_ref41) { - var left = _ref41.left, right = _ref41.right, body = _ref41.body; - _classCallCheck$5(this, ForAwaitStatement5); - this.type = "ForAwaitStatement"; - this.left = left; - this.right = right; - this.body = body; -}; -dist$1.ForInStatement = function ForInStatement5(_ref42) { - var left = _ref42.left, right = _ref42.right, body = _ref42.body; - _classCallCheck$5(this, ForInStatement5); - this.type = "ForInStatement"; - this.left = left; - this.right = right; - this.body = body; -}; -dist$1.ForOfStatement = function ForOfStatement5(_ref43) { - var left = _ref43.left, right = _ref43.right, body = _ref43.body; - _classCallCheck$5(this, ForOfStatement5); - this.type = "ForOfStatement"; - this.left = left; - this.right = right; - this.body = body; -}; -dist$1.ForStatement = function ForStatement5(_ref44) { - var init = _ref44.init, test = _ref44.test, update = _ref44.update, body = _ref44.body; - _classCallCheck$5(this, ForStatement5); - this.type = "ForStatement"; - this.init = init; - this.test = test; - this.update = update; - this.body = body; -}; -dist$1.FormalParameters = function FormalParameters5(_ref45) { - var items = _ref45.items, rest = _ref45.rest; - _classCallCheck$5(this, FormalParameters5); - this.type = "FormalParameters"; - this.items = items; - this.rest = rest; -}; -dist$1.FunctionBody = function FunctionBody5(_ref46) { - var directives = _ref46.directives, statements = _ref46.statements; - _classCallCheck$5(this, FunctionBody5); - this.type = "FunctionBody"; - this.directives = directives; - this.statements = statements; -}; -dist$1.FunctionDeclaration = function FunctionDeclaration5(_ref47) { - var isAsync = _ref47.isAsync, isGenerator = _ref47.isGenerator, name = _ref47.name, params = _ref47.params, body = _ref47.body; - _classCallCheck$5(this, FunctionDeclaration5); - this.type = "FunctionDeclaration"; - this.isAsync = isAsync; - this.isGenerator = isGenerator; - this.name = name; - this.params = params; - this.body = body; -}; -dist$1.FunctionExpression = function FunctionExpression5(_ref48) { - var isAsync = _ref48.isAsync, isGenerator = _ref48.isGenerator, name = _ref48.name, params = _ref48.params, body = _ref48.body; - _classCallCheck$5(this, FunctionExpression5); - this.type = "FunctionExpression"; - this.isAsync = isAsync; - this.isGenerator = isGenerator; - this.name = name; - this.params = params; - this.body = body; -}; -dist$1.Getter = function Getter5(_ref49) { - var name = _ref49.name, body = _ref49.body; - _classCallCheck$5(this, Getter5); - this.type = "Getter"; - this.name = name; - this.body = body; -}; -dist$1.IdentifierExpression = function IdentifierExpression5(_ref50) { - var name = _ref50.name; - _classCallCheck$5(this, IdentifierExpression5); - this.type = "IdentifierExpression"; - this.name = name; -}; -dist$1.IfStatement = function IfStatement5(_ref51) { - var test = _ref51.test, consequent = _ref51.consequent, alternate = _ref51.alternate; - _classCallCheck$5(this, IfStatement5); - this.type = "IfStatement"; - this.test = test; - this.consequent = consequent; - this.alternate = alternate; -}; -dist$1.Import = function Import5(_ref52) { - var defaultBinding = _ref52.defaultBinding, namedImports = _ref52.namedImports, moduleSpecifier = _ref52.moduleSpecifier; - _classCallCheck$5(this, Import5); - this.type = "Import"; - this.defaultBinding = defaultBinding; - this.namedImports = namedImports; - this.moduleSpecifier = moduleSpecifier; -}; -dist$1.ImportNamespace = function ImportNamespace5(_ref53) { - var defaultBinding = _ref53.defaultBinding, namespaceBinding = _ref53.namespaceBinding, moduleSpecifier = _ref53.moduleSpecifier; - _classCallCheck$5(this, ImportNamespace5); - this.type = "ImportNamespace"; - this.defaultBinding = defaultBinding; - this.namespaceBinding = namespaceBinding; - this.moduleSpecifier = moduleSpecifier; -}; -dist$1.ImportSpecifier = function ImportSpecifier5(_ref54) { - var name = _ref54.name, binding = _ref54.binding; - _classCallCheck$5(this, ImportSpecifier5); - this.type = "ImportSpecifier"; - this.name = name; - this.binding = binding; -}; -dist$1.LabeledStatement = function LabeledStatement5(_ref55) { - var label = _ref55.label, body = _ref55.body; - _classCallCheck$5(this, LabeledStatement5); - this.type = "LabeledStatement"; - this.label = label; - this.body = body; -}; -dist$1.LiteralBooleanExpression = function LiteralBooleanExpression5(_ref56) { - var value = _ref56.value; - _classCallCheck$5(this, LiteralBooleanExpression5); - this.type = "LiteralBooleanExpression"; - this.value = value; -}; -dist$1.LiteralInfinityExpression = function LiteralInfinityExpression5() { - _classCallCheck$5(this, LiteralInfinityExpression5); - this.type = "LiteralInfinityExpression"; -}; -dist$1.LiteralNullExpression = function LiteralNullExpression5() { - _classCallCheck$5(this, LiteralNullExpression5); - this.type = "LiteralNullExpression"; -}; -dist$1.LiteralNumericExpression = function LiteralNumericExpression5(_ref57) { - var value = _ref57.value; - _classCallCheck$5(this, LiteralNumericExpression5); - this.type = "LiteralNumericExpression"; - this.value = value; -}; -dist$1.LiteralRegExpExpression = function LiteralRegExpExpression5(_ref58) { - var pattern = _ref58.pattern, global = _ref58.global, ignoreCase = _ref58.ignoreCase, multiLine = _ref58.multiLine, dotAll = _ref58.dotAll, unicode2 = _ref58.unicode, sticky = _ref58.sticky; - _classCallCheck$5(this, LiteralRegExpExpression5); - this.type = "LiteralRegExpExpression"; - this.pattern = pattern; - this.global = global; - this.ignoreCase = ignoreCase; - this.multiLine = multiLine; - this.dotAll = dotAll; - this.unicode = unicode2; - this.sticky = sticky; -}; -dist$1.LiteralStringExpression = function LiteralStringExpression5(_ref59) { - var value = _ref59.value; - _classCallCheck$5(this, LiteralStringExpression5); - this.type = "LiteralStringExpression"; - this.value = value; -}; -dist$1.Method = function Method5(_ref60) { - var isAsync = _ref60.isAsync, isGenerator = _ref60.isGenerator, name = _ref60.name, params = _ref60.params, body = _ref60.body; - _classCallCheck$5(this, Method5); - this.type = "Method"; - this.isAsync = isAsync; - this.isGenerator = isGenerator; - this.name = name; - this.params = params; - this.body = body; -}; -dist$1.Module = function Module5(_ref61) { - var directives = _ref61.directives, items = _ref61.items; - _classCallCheck$5(this, Module5); - this.type = "Module"; - this.directives = directives; - this.items = items; -}; -dist$1.NewExpression = function NewExpression5(_ref62) { - var callee = _ref62.callee, _arguments = _ref62.arguments; - _classCallCheck$5(this, NewExpression5); - this.type = "NewExpression"; - this.callee = callee; - this.arguments = _arguments; -}; -dist$1.NewTargetExpression = function NewTargetExpression5() { - _classCallCheck$5(this, NewTargetExpression5); - this.type = "NewTargetExpression"; -}; -dist$1.ObjectAssignmentTarget = function ObjectAssignmentTarget5(_ref63) { - var properties = _ref63.properties, rest = _ref63.rest; - _classCallCheck$5(this, ObjectAssignmentTarget5); - this.type = "ObjectAssignmentTarget"; - this.properties = properties; - this.rest = rest; -}; -dist$1.ObjectBinding = function ObjectBinding5(_ref64) { - var properties = _ref64.properties, rest = _ref64.rest; - _classCallCheck$5(this, ObjectBinding5); - this.type = "ObjectBinding"; - this.properties = properties; - this.rest = rest; -}; -dist$1.ObjectExpression = function ObjectExpression5(_ref65) { - var properties = _ref65.properties; - _classCallCheck$5(this, ObjectExpression5); - this.type = "ObjectExpression"; - this.properties = properties; -}; -dist$1.ReturnStatement = function ReturnStatement5(_ref66) { - var expression = _ref66.expression; - _classCallCheck$5(this, ReturnStatement5); - this.type = "ReturnStatement"; - this.expression = expression; -}; -dist$1.Script = function Script5(_ref67) { - var directives = _ref67.directives, statements = _ref67.statements; - _classCallCheck$5(this, Script5); - this.type = "Script"; - this.directives = directives; - this.statements = statements; -}; -dist$1.Setter = function Setter5(_ref68) { - var name = _ref68.name, param = _ref68.param, body = _ref68.body; - _classCallCheck$5(this, Setter5); - this.type = "Setter"; - this.name = name; - this.param = param; - this.body = body; -}; -dist$1.ShorthandProperty = function ShorthandProperty5(_ref69) { - var name = _ref69.name; - _classCallCheck$5(this, ShorthandProperty5); - this.type = "ShorthandProperty"; - this.name = name; -}; -dist$1.SpreadElement = function SpreadElement5(_ref70) { - var expression = _ref70.expression; - _classCallCheck$5(this, SpreadElement5); - this.type = "SpreadElement"; - this.expression = expression; -}; -dist$1.SpreadProperty = function SpreadProperty5(_ref71) { - var expression = _ref71.expression; - _classCallCheck$5(this, SpreadProperty5); - this.type = "SpreadProperty"; - this.expression = expression; -}; -dist$1.StaticMemberAssignmentTarget = function StaticMemberAssignmentTarget5(_ref72) { - var object = _ref72.object, property = _ref72.property; - _classCallCheck$5(this, StaticMemberAssignmentTarget5); - this.type = "StaticMemberAssignmentTarget"; - this.object = object; - this.property = property; -}; -dist$1.StaticMemberExpression = function StaticMemberExpression5(_ref73) { - var object = _ref73.object, property = _ref73.property; - _classCallCheck$5(this, StaticMemberExpression5); - this.type = "StaticMemberExpression"; - this.object = object; - this.property = property; -}; -dist$1.StaticPropertyName = function StaticPropertyName5(_ref74) { - var value = _ref74.value; - _classCallCheck$5(this, StaticPropertyName5); - this.type = "StaticPropertyName"; - this.value = value; -}; -dist$1.Super = function Super5() { - _classCallCheck$5(this, Super5); - this.type = "Super"; -}; -dist$1.SwitchCase = function SwitchCase5(_ref75) { - var test = _ref75.test, consequent = _ref75.consequent; - _classCallCheck$5(this, SwitchCase5); - this.type = "SwitchCase"; - this.test = test; - this.consequent = consequent; -}; -dist$1.SwitchDefault = function SwitchDefault5(_ref76) { - var consequent = _ref76.consequent; - _classCallCheck$5(this, SwitchDefault5); - this.type = "SwitchDefault"; - this.consequent = consequent; -}; -dist$1.SwitchStatement = function SwitchStatement5(_ref77) { - var discriminant = _ref77.discriminant, cases = _ref77.cases; - _classCallCheck$5(this, SwitchStatement5); - this.type = "SwitchStatement"; - this.discriminant = discriminant; - this.cases = cases; -}; -dist$1.SwitchStatementWithDefault = function SwitchStatementWithDefault5(_ref78) { - var discriminant = _ref78.discriminant, preDefaultCases = _ref78.preDefaultCases, defaultCase = _ref78.defaultCase, postDefaultCases = _ref78.postDefaultCases; - _classCallCheck$5(this, SwitchStatementWithDefault5); - this.type = "SwitchStatementWithDefault"; - this.discriminant = discriminant; - this.preDefaultCases = preDefaultCases; - this.defaultCase = defaultCase; - this.postDefaultCases = postDefaultCases; -}; -dist$1.TemplateElement = function TemplateElement5(_ref79) { - var rawValue = _ref79.rawValue; - _classCallCheck$5(this, TemplateElement5); - this.type = "TemplateElement"; - this.rawValue = rawValue; -}; -dist$1.TemplateExpression = function TemplateExpression5(_ref80) { - var tag = _ref80.tag, elements = _ref80.elements; - _classCallCheck$5(this, TemplateExpression5); - this.type = "TemplateExpression"; - this.tag = tag; - this.elements = elements; -}; -dist$1.ThisExpression = function ThisExpression5() { - _classCallCheck$5(this, ThisExpression5); - this.type = "ThisExpression"; -}; -dist$1.ThrowStatement = function ThrowStatement5(_ref81) { - var expression = _ref81.expression; - _classCallCheck$5(this, ThrowStatement5); - this.type = "ThrowStatement"; - this.expression = expression; -}; -dist$1.TryCatchStatement = function TryCatchStatement5(_ref82) { - var body = _ref82.body, catchClause = _ref82.catchClause; - _classCallCheck$5(this, TryCatchStatement5); - this.type = "TryCatchStatement"; - this.body = body; - this.catchClause = catchClause; -}; -dist$1.TryFinallyStatement = function TryFinallyStatement5(_ref83) { - var body = _ref83.body, catchClause = _ref83.catchClause, finalizer = _ref83.finalizer; - _classCallCheck$5(this, TryFinallyStatement5); - this.type = "TryFinallyStatement"; - this.body = body; - this.catchClause = catchClause; - this.finalizer = finalizer; -}; -dist$1.UnaryExpression = function UnaryExpression5(_ref84) { - var operator = _ref84.operator, operand = _ref84.operand; - _classCallCheck$5(this, UnaryExpression5); - this.type = "UnaryExpression"; - this.operator = operator; - this.operand = operand; -}; -dist$1.UpdateExpression = function UpdateExpression5(_ref85) { - var isPrefix = _ref85.isPrefix, operator = _ref85.operator, operand = _ref85.operand; - _classCallCheck$5(this, UpdateExpression5); - this.type = "UpdateExpression"; - this.isPrefix = isPrefix; - this.operator = operator; - this.operand = operand; -}; -dist$1.VariableDeclaration = function VariableDeclaration5(_ref86) { - var kind = _ref86.kind, declarators = _ref86.declarators; - _classCallCheck$5(this, VariableDeclaration5); - this.type = "VariableDeclaration"; - this.kind = kind; - this.declarators = declarators; -}; -dist$1.VariableDeclarationStatement = function VariableDeclarationStatement5(_ref87) { - var declaration = _ref87.declaration; - _classCallCheck$5(this, VariableDeclarationStatement5); - this.type = "VariableDeclarationStatement"; - this.declaration = declaration; -}; -dist$1.VariableDeclarator = function VariableDeclarator5(_ref88) { - var binding = _ref88.binding, init = _ref88.init; - _classCallCheck$5(this, VariableDeclarator5); - this.type = "VariableDeclarator"; - this.binding = binding; - this.init = init; -}; -dist$1.WhileStatement = function WhileStatement5(_ref89) { - var test = _ref89.test, body = _ref89.body; - _classCallCheck$5(this, WhileStatement5); - this.type = "WhileStatement"; - this.test = test; - this.body = body; -}; -dist$1.WithStatement = function WithStatement5(_ref90) { - var object = _ref90.object, body = _ref90.body; - _classCallCheck$5(this, WithStatement5); - this.type = "WithStatement"; - this.object = object; - this.body = body; -}; -dist$1.YieldExpression = function YieldExpression5(_ref91) { - var expression = _ref91.expression; - _classCallCheck$5(this, YieldExpression5); - this.type = "YieldExpression"; - this.expression = expression; -}; -dist$1.YieldGeneratorExpression = function YieldGeneratorExpression5(_ref92) { - var expression = _ref92.expression; - _classCallCheck$5(this, YieldGeneratorExpression5); - this.type = "YieldGeneratorExpression"; - this.expression = expression; -}; -var dist = {}; -var minimalCodegen$1 = {}; -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ -var getOwnPropertySymbols = Object.getOwnPropertySymbols; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; -function toObject(val) { - if (val === null || val === void 0) { - throw new TypeError("Object.assign cannot be called with null or undefined"); - } - return Object(val); -} -function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } - var test1 = new String("abc"); - test1[5] = "de"; - if (Object.getOwnPropertyNames(test1)[0] === "5") { - return false; - } - var test2 = {}; - for (var i2 = 0; i2 < 10; i2++) { - test2["_" + String.fromCharCode(i2)] = i2; - } - var order2 = Object.getOwnPropertyNames(test2).map(function(n) { - return test2[n]; - }); - if (order2.join("") !== "0123456789") { - return false; - } - var test3 = {}; - "abcdefghijklmnopqrst".split("").forEach(function(letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") { - return false; - } - return true; - } catch (err) { - return false; - } -} -var objectAssign = shouldUseNative() ? Object.assign : function(target, source) { - var from; - var to = toObject(target); - var symbols; - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } - if (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i2 = 0; i2 < symbols.length; i2++) { - if (propIsEnumerable.call(from, symbols[i2])) { - to[symbols[i2]] = from[symbols[i2]]; - } - } - } - } - return to; -}; -const objectAssign$1 = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - default: objectAssign -}, [objectAssign]); -const require$$0$3 = /* @__PURE__ */ getAugmentedNamespace(objectAssign$1); -var utils$1 = {}; -var ast$2 = { exports: {} }; -(function() { - function isExpression(node) { - if (node == null) { - return false; - } - switch (node.type) { - case "ArrayExpression": - case "AssignmentExpression": - case "BinaryExpression": - case "CallExpression": - case "ConditionalExpression": - case "FunctionExpression": - case "Identifier": - case "Literal": - case "LogicalExpression": - case "MemberExpression": - case "NewExpression": - case "ObjectExpression": - case "SequenceExpression": - case "ThisExpression": - case "UnaryExpression": - case "UpdateExpression": - return true; - } - return false; - } - function isIterationStatement2(node) { - if (node == null) { - return false; - } - switch (node.type) { - case "DoWhileStatement": - case "ForInStatement": - case "ForStatement": - case "WhileStatement": - return true; - } - return false; - } - function isStatement(node) { - if (node == null) { - return false; - } - switch (node.type) { - case "BlockStatement": - case "BreakStatement": - case "ContinueStatement": - case "DebuggerStatement": - case "DoWhileStatement": - case "EmptyStatement": - case "ExpressionStatement": - case "ForInStatement": - case "ForStatement": - case "IfStatement": - case "LabeledStatement": - case "ReturnStatement": - case "SwitchStatement": - case "ThrowStatement": - case "TryStatement": - case "VariableDeclaration": - case "WhileStatement": - case "WithStatement": - return true; - } - return false; - } - function isSourceElement(node) { - return isStatement(node) || node != null && node.type === "FunctionDeclaration"; - } - function trailingStatement(node) { - switch (node.type) { - case "IfStatement": - if (node.alternate != null) { - return node.alternate; - } - return node.consequent; - case "LabeledStatement": - case "ForStatement": - case "ForInStatement": - case "WhileStatement": - case "WithStatement": - return node.body; - } - return null; - } - function isProblematicIfStatement(node) { - var current; - if (node.type !== "IfStatement") { - return false; - } - if (node.alternate == null) { - return false; - } - current = node.consequent; - do { - if (current.type === "IfStatement") { - if (current.alternate == null) { - return true; - } - } - current = trailingStatement(current); - } while (current); - return false; - } - ast$2.exports = { - isExpression, - isStatement, - isIterationStatement: isIterationStatement2, - isSourceElement, - isProblematicIfStatement, - trailingStatement - }; -})(); -const ast$1 = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - default: ast$2.exports -}, [ast$2.exports]); -const require$$0$2 = /* @__PURE__ */ getAugmentedNamespace(ast$1); -var code$2 = { exports: {} }; -(function() { - var ES6Regex, ES5Regex, NON_ASCII_WHITESPACES, IDENTIFIER_START, IDENTIFIER_PART, ch; - ES5Regex = { - NonAsciiIdentifierStart: /[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\u08B6-\u08BD\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\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\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\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\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]/, - NonAsciiIdentifierPart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/ - }; - ES6Regex = { - NonAsciiIdentifierStart: /[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\u08B6-\u08BD\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\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\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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-\u2C2E\u2C30-\u2C5E\u2C60-\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-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/, - NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ - }; - function isDecimalDigit2(ch2) { - return 48 <= ch2 && ch2 <= 57; - } - function isHexDigit(ch2) { - return 48 <= ch2 && ch2 <= 57 || 97 <= ch2 && ch2 <= 102 || 65 <= ch2 && ch2 <= 70; - } - function isOctalDigit(ch2) { - return ch2 >= 48 && ch2 <= 55; - } - NON_ASCII_WHITESPACES = [ - 5760, - 8192, - 8193, - 8194, - 8195, - 8196, - 8197, - 8198, - 8199, - 8200, - 8201, - 8202, - 8239, - 8287, - 12288, - 65279 - ]; - function isWhiteSpace2(ch2) { - return ch2 === 32 || ch2 === 9 || ch2 === 11 || ch2 === 12 || ch2 === 160 || ch2 >= 5760 && NON_ASCII_WHITESPACES.indexOf(ch2) >= 0; - } - function isLineTerminator2(ch2) { - return ch2 === 10 || ch2 === 13 || ch2 === 8232 || ch2 === 8233; - } - function fromCodePoint2(cp) { - if (cp <= 65535) { - return String.fromCharCode(cp); - } - var cu1 = String.fromCharCode(Math.floor((cp - 65536) / 1024) + 55296); - var cu2 = String.fromCharCode((cp - 65536) % 1024 + 56320); - return cu1 + cu2; - } - IDENTIFIER_START = new Array(128); - for (ch = 0; ch < 128; ++ch) { - IDENTIFIER_START[ch] = ch >= 97 && ch <= 122 || ch >= 65 && ch <= 90 || ch === 36 || ch === 95; - } - IDENTIFIER_PART = new Array(128); - for (ch = 0; ch < 128; ++ch) { - IDENTIFIER_PART[ch] = ch >= 97 && ch <= 122 || ch >= 65 && ch <= 90 || ch >= 48 && ch <= 57 || ch === 36 || ch === 95; - } - function isIdentifierStartES5(ch2) { - return ch2 < 128 ? IDENTIFIER_START[ch2] : ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint2(ch2)); - } - function isIdentifierPartES5(ch2) { - return ch2 < 128 ? IDENTIFIER_PART[ch2] : ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint2(ch2)); - } - function isIdentifierStartES6(ch2) { - return ch2 < 128 ? IDENTIFIER_START[ch2] : ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint2(ch2)); - } - function isIdentifierPartES62(ch2) { - return ch2 < 128 ? IDENTIFIER_PART[ch2] : ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint2(ch2)); - } - code$2.exports = { - isDecimalDigit: isDecimalDigit2, - isHexDigit, - isOctalDigit, - isWhiteSpace: isWhiteSpace2, - isLineTerminator: isLineTerminator2, - isIdentifierStartES5, - isIdentifierPartES5, - isIdentifierStartES6, - isIdentifierPartES6: isIdentifierPartES62 - }; -})(); -const code$1 = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - default: code$2.exports -}, [code$2.exports]); -const require$$1$2 = /* @__PURE__ */ getAugmentedNamespace(code$1); -var keyword$2 = { exports: {} }; -(function() { - var code2 = require$$1$2; - function isStrictModeReservedWordES6(id2) { - switch (id2) { - case "implements": - case "interface": - case "package": - case "private": - case "protected": - case "public": - case "static": - case "let": - return true; - default: - return false; - } - } - function isKeywordES5(id2, strict) { - if (!strict && id2 === "yield") { - return false; - } - return isKeywordES6(id2, strict); - } - function isKeywordES6(id2, strict) { - if (strict && isStrictModeReservedWordES6(id2)) { - return true; - } - switch (id2.length) { - case 2: - return id2 === "if" || id2 === "in" || id2 === "do"; - case 3: - return id2 === "var" || id2 === "for" || id2 === "new" || id2 === "try"; - case 4: - return id2 === "this" || id2 === "else" || id2 === "case" || id2 === "void" || id2 === "with" || id2 === "enum"; - case 5: - return id2 === "while" || id2 === "break" || id2 === "catch" || id2 === "throw" || id2 === "const" || id2 === "yield" || id2 === "class" || id2 === "super"; - case 6: - return id2 === "return" || id2 === "typeof" || id2 === "delete" || id2 === "switch" || id2 === "export" || id2 === "import"; - case 7: - return id2 === "default" || id2 === "finally" || id2 === "extends"; - case 8: - return id2 === "function" || id2 === "continue" || id2 === "debugger"; - case 10: - return id2 === "instanceof"; - default: - return false; - } - } - function isReservedWordES5(id2, strict) { - return id2 === "null" || id2 === "true" || id2 === "false" || isKeywordES5(id2, strict); - } - function isReservedWordES6(id2, strict) { - return id2 === "null" || id2 === "true" || id2 === "false" || isKeywordES6(id2, strict); - } - function isRestrictedWord(id2) { - return id2 === "eval" || id2 === "arguments"; - } - function isIdentifierNameES5(id2) { - var i2, iz, ch; - if (id2.length === 0) { - return false; - } - ch = id2.charCodeAt(0); - if (!code2.isIdentifierStartES5(ch)) { - return false; - } - for (i2 = 1, iz = id2.length; i2 < iz; ++i2) { - ch = id2.charCodeAt(i2); - if (!code2.isIdentifierPartES5(ch)) { - return false; - } - } - return true; - } - function decodeUtf162(lead, trail) { - return (lead - 55296) * 1024 + (trail - 56320) + 65536; - } - function isIdentifierNameES6(id2) { - var i2, iz, ch, lowCh, check; - if (id2.length === 0) { - return false; - } - check = code2.isIdentifierStartES6; - for (i2 = 0, iz = id2.length; i2 < iz; ++i2) { - ch = id2.charCodeAt(i2); - if (55296 <= ch && ch <= 56319) { - ++i2; - if (i2 >= iz) { - return false; - } - lowCh = id2.charCodeAt(i2); - if (!(56320 <= lowCh && lowCh <= 57343)) { - return false; - } - ch = decodeUtf162(ch, lowCh); - } - if (!check(ch)) { - return false; - } - check = code2.isIdentifierPartES6; - } - return true; - } - function isIdentifierES5(id2, strict) { - return isIdentifierNameES5(id2) && !isReservedWordES5(id2, strict); - } - function isIdentifierES6(id2, strict) { - return isIdentifierNameES6(id2) && !isReservedWordES6(id2, strict); - } - keyword$2.exports = { - isKeywordES5, - isKeywordES6, - isReservedWordES5, - isReservedWordES6, - isRestrictedWord, - isIdentifierNameES5, - isIdentifierNameES6, - isIdentifierES5, - isIdentifierES6 - }; -})(); -const keyword$1 = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - default: keyword$2.exports -}, [keyword$2.exports]); -const require$$2$1 = /* @__PURE__ */ getAugmentedNamespace(keyword$1); -var keyword; -var code; -var ast; -(function() { - ast = utils$1.ast = require$$0$2; - code = utils$1.code = require$$1$2; - keyword = utils$1.keyword = require$$2$1; -})(); -const utils = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - get ast() { - return ast; - }, - get code() { - return code; - }, - get keyword() { - return keyword; - }, - default: utils$1 -}, [utils$1]); -const require$$1$1 = /* @__PURE__ */ getAugmentedNamespace(utils); -var coderep$1 = {}; -var SemiOp_1; -var CommaSep_1; -var Semi_1; -var Seq_1; -var ContainsIn_1; -var NoIn_1; -var Brace_1; -var Bracket_1; -var Paren_1; -var NumberCodeRep_1; -var RawToken_1; -var Token_1; -var Empty_1; -var CodeRep_1; -Object.defineProperty(coderep$1, "__esModule", { - value: true -}); -var _createClass$4 = function() { - function defineProperties(target, props) { - for (var i2 = 0; i2 < props.length; i2++) { - var descriptor = props[i2]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - return function(Constructor, protoProps, staticProps) { - if (protoProps) - defineProperties(Constructor.prototype, protoProps); - if (staticProps) - defineProperties(Constructor, staticProps); - return Constructor; - }; -}(); -var getPrecedence_1 = coderep$1.getPrecedence = getPrecedence; -var escapeStringLiteral_1 = coderep$1.escapeStringLiteral = escapeStringLiteral; -function _possibleConstructorReturn$2(self, call) { - if (!self) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return call && (typeof call === "object" || typeof call === "function") ? call : self; -} -function _inherits$2(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); - if (superClass) - Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; -} -function _classCallCheck$4(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} -var Precedence = { - Sequence: 0, - Yield: 1, - Assignment: 1, - Conditional: 2, - ArrowFunction: 2, - LogicalOR: 3, - LogicalAND: 4, - BitwiseOR: 5, - BitwiseXOR: 6, - BitwiseAND: 7, - Equality: 8, - Relational: 9, - BitwiseSHIFT: 10, - Additive: 11, - Multiplicative: 12, - Exponential: 13, - Prefix: 14, - Postfix: 15, - New: 16, - Call: 17, - TaggedTemplate: 18, - Member: 19, - Primary: 20 -}; -var Precedence_1 = coderep$1.Precedence = Precedence; -var BinaryPrecedence = { - ",": Precedence.Sequence, - "||": Precedence.LogicalOR, - "&&": Precedence.LogicalAND, - "|": Precedence.BitwiseOR, - "^": Precedence.BitwiseXOR, - "&": Precedence.BitwiseAND, - "==": Precedence.Equality, - "!=": Precedence.Equality, - "===": Precedence.Equality, - "!==": Precedence.Equality, - "<": Precedence.Relational, - ">": Precedence.Relational, - "<=": Precedence.Relational, - ">=": Precedence.Relational, - "in": Precedence.Relational, - "instanceof": Precedence.Relational, - "<<": Precedence.BitwiseSHIFT, - ">>": Precedence.BitwiseSHIFT, - ">>>": Precedence.BitwiseSHIFT, - "+": Precedence.Additive, - "-": Precedence.Additive, - "*": Precedence.Multiplicative, - "%": Precedence.Multiplicative, - "/": Precedence.Multiplicative, - "**": Precedence.Exponential -}; -function getPrecedence(node) { - switch (node.type) { - case "ArrayExpression": - case "FunctionExpression": - case "ClassExpression": - case "IdentifierExpression": - case "AssignmentTargetIdentifier": - case "NewTargetExpression": - case "Super": - case "LiteralBooleanExpression": - case "LiteralNullExpression": - case "LiteralNumericExpression": - case "LiteralInfinityExpression": - case "LiteralRegExpExpression": - case "LiteralStringExpression": - case "ObjectExpression": - case "ThisExpression": - case "SpreadElement": - case "FunctionBody": - return Precedence.Primary; - case "ArrowExpression": - case "AssignmentExpression": - case "CompoundAssignmentExpression": - case "YieldExpression": - case "YieldGeneratorExpression": - return Precedence.Assignment; - case "ConditionalExpression": - return Precedence.Conditional; - case "ComputedMemberExpression": - case "StaticMemberExpression": - case "ComputedMemberAssignmentTarget": - case "StaticMemberAssignmentTarget": - switch (node.object.type) { - case "CallExpression": - case "ComputedMemberExpression": - case "StaticMemberExpression": - case "TemplateExpression": - return getPrecedence(node.object); - default: - return Precedence.Member; - } - case "TemplateExpression": - if (node.tag == null) - return Precedence.Member; - switch (node.tag.type) { - case "CallExpression": - case "ComputedMemberExpression": - case "StaticMemberExpression": - case "TemplateExpression": - return getPrecedence(node.tag); - default: - return Precedence.Member; - } - case "BinaryExpression": - return BinaryPrecedence[node.operator]; - case "CallExpression": - return Precedence.Call; - case "NewExpression": - return node.arguments.length === 0 ? Precedence.New : Precedence.Member; - case "UpdateExpression": - return node.isPrefix ? Precedence.Prefix : Precedence.Postfix; - case "AwaitExpression": - case "UnaryExpression": - return Precedence.Prefix; - default: - throw new Error("unreachable: " + node.type); - } -} -function escapeStringLiteral(stringValue) { - var result = ""; - var nSingle = 0, nDouble = 0; - for (var i2 = 0, l = stringValue.length; i2 < l; ++i2) { - var ch = stringValue[i2]; - if (ch === '"') { - ++nDouble; - } else if (ch === "'") { - ++nSingle; - } - } - var delim = nDouble > nSingle ? "'" : '"'; - result += delim; - for (var _i = 0; _i < stringValue.length; _i++) { - var _ch = stringValue.charAt(_i); - switch (_ch) { - case delim: - result += "\\" + delim; - break; - case "\n": - result += "\\n"; - break; - case "\r": - result += "\\r"; - break; - case "\\": - result += "\\\\"; - break; - case "\u2028": - result += "\\u2028"; - break; - case "\u2029": - result += "\\u2029"; - break; - default: - result += _ch; - break; - } - } - result += delim; - return result; -} -var CodeRep = CodeRep_1 = coderep$1.CodeRep = function() { - function CodeRep2() { - _classCallCheck$4(this, CodeRep2); - this.containsIn = false; - this.containsGroup = false; - this.startsWithCurly = false; - this.startsWithFunctionOrClass = false; - this.startsWithLet = false; - this.startsWithLetSquareBracket = false; - this.endsWithMissingElse = false; - } - _createClass$4(CodeRep2, [{ - key: "forEach", - value: function forEach(f) { - f(this); - } - }]); - return CodeRep2; -}(); -Empty_1 = coderep$1.Empty = function(_CodeRep) { - _inherits$2(Empty, _CodeRep); - function Empty() { - _classCallCheck$4(this, Empty); - return _possibleConstructorReturn$2(this, (Empty.__proto__ || Object.getPrototypeOf(Empty)).call(this)); - } - _createClass$4(Empty, [{ - key: "emit", - value: function emit() { - } - }]); - return Empty; -}(CodeRep); -var Token = Token_1 = coderep$1.Token = function(_CodeRep2) { - _inherits$2(Token2, _CodeRep2); - function Token2(token) { - var isRegExp = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; - _classCallCheck$4(this, Token2); - var _this2 = _possibleConstructorReturn$2(this, (Token2.__proto__ || Object.getPrototypeOf(Token2)).call(this)); - _this2.token = token; - _this2.isRegExp = isRegExp; - return _this2; - } - _createClass$4(Token2, [{ - key: "emit", - value: function emit(ts) { - ts.put(this.token, this.isRegExp); - } - }]); - return Token2; -}(CodeRep); -RawToken_1 = coderep$1.RawToken = function(_CodeRep3) { - _inherits$2(RawToken, _CodeRep3); - function RawToken(token) { - _classCallCheck$4(this, RawToken); - var _this3 = _possibleConstructorReturn$2(this, (RawToken.__proto__ || Object.getPrototypeOf(RawToken)).call(this)); - _this3.token = token; - return _this3; - } - _createClass$4(RawToken, [{ - key: "emit", - value: function emit(ts) { - ts.putRaw(this.token); - } - }]); - return RawToken; -}(CodeRep); -NumberCodeRep_1 = coderep$1.NumberCodeRep = function(_CodeRep4) { - _inherits$2(NumberCodeRep, _CodeRep4); - function NumberCodeRep(number) { - _classCallCheck$4(this, NumberCodeRep); - var _this4 = _possibleConstructorReturn$2(this, (NumberCodeRep.__proto__ || Object.getPrototypeOf(NumberCodeRep)).call(this)); - _this4.number = number; - return _this4; - } - _createClass$4(NumberCodeRep, [{ - key: "emit", - value: function emit(ts) { - ts.putNumber(this.number); - } - }]); - return NumberCodeRep; -}(CodeRep); -Paren_1 = coderep$1.Paren = function(_CodeRep5) { - _inherits$2(Paren, _CodeRep5); - function Paren(expr) { - _classCallCheck$4(this, Paren); - var _this5 = _possibleConstructorReturn$2(this, (Paren.__proto__ || Object.getPrototypeOf(Paren)).call(this)); - _this5.expr = expr; - return _this5; - } - _createClass$4(Paren, [{ - key: "emit", - value: function emit(ts) { - ts.put("("); - this.expr.emit(ts, false); - ts.put(")"); - } - }, { - key: "forEach", - value: function forEach(f) { - f(this); - this.expr.forEach(f); - } - }]); - return Paren; -}(CodeRep); -Bracket_1 = coderep$1.Bracket = function(_CodeRep6) { - _inherits$2(Bracket, _CodeRep6); - function Bracket(expr) { - _classCallCheck$4(this, Bracket); - var _this6 = _possibleConstructorReturn$2(this, (Bracket.__proto__ || Object.getPrototypeOf(Bracket)).call(this)); - _this6.expr = expr; - return _this6; - } - _createClass$4(Bracket, [{ - key: "emit", - value: function emit(ts) { - ts.put("["); - this.expr.emit(ts, false); - ts.put("]"); - } - }, { - key: "forEach", - value: function forEach(f) { - f(this); - this.expr.forEach(f); - } - }]); - return Bracket; -}(CodeRep); -Brace_1 = coderep$1.Brace = function(_CodeRep7) { - _inherits$2(Brace, _CodeRep7); - function Brace(expr) { - _classCallCheck$4(this, Brace); - var _this7 = _possibleConstructorReturn$2(this, (Brace.__proto__ || Object.getPrototypeOf(Brace)).call(this)); - _this7.expr = expr; - return _this7; - } - _createClass$4(Brace, [{ - key: "emit", - value: function emit(ts) { - ts.put("{"); - this.expr.emit(ts, false); - ts.put("}"); - } - }, { - key: "forEach", - value: function forEach(f) { - f(this); - this.expr.forEach(f); - } - }]); - return Brace; -}(CodeRep); -NoIn_1 = coderep$1.NoIn = function(_CodeRep8) { - _inherits$2(NoIn, _CodeRep8); - function NoIn(expr) { - _classCallCheck$4(this, NoIn); - var _this8 = _possibleConstructorReturn$2(this, (NoIn.__proto__ || Object.getPrototypeOf(NoIn)).call(this)); - _this8.expr = expr; - return _this8; - } - _createClass$4(NoIn, [{ - key: "emit", - value: function emit(ts) { - this.expr.emit(ts, true); - } - }, { - key: "forEach", - value: function forEach(f) { - f(this); - this.expr.forEach(f); - } - }]); - return NoIn; -}(CodeRep); -ContainsIn_1 = coderep$1.ContainsIn = function(_CodeRep9) { - _inherits$2(ContainsIn, _CodeRep9); - function ContainsIn(expr) { - _classCallCheck$4(this, ContainsIn); - var _this9 = _possibleConstructorReturn$2(this, (ContainsIn.__proto__ || Object.getPrototypeOf(ContainsIn)).call(this)); - _this9.expr = expr; - return _this9; - } - _createClass$4(ContainsIn, [{ - key: "emit", - value: function emit(ts, noIn2) { - if (noIn2) { - ts.put("("); - this.expr.emit(ts, false); - ts.put(")"); - } else { - this.expr.emit(ts, false); - } - } - }, { - key: "forEach", - value: function forEach(f) { - f(this); - this.expr.forEach(f); - } - }]); - return ContainsIn; -}(CodeRep); -Seq_1 = coderep$1.Seq = function(_CodeRep10) { - _inherits$2(Seq, _CodeRep10); - function Seq(children) { - _classCallCheck$4(this, Seq); - var _this10 = _possibleConstructorReturn$2(this, (Seq.__proto__ || Object.getPrototypeOf(Seq)).call(this)); - _this10.children = children; - return _this10; - } - _createClass$4(Seq, [{ - key: "emit", - value: function emit(ts, noIn2) { - this.children.forEach(function(cr) { - return cr.emit(ts, noIn2); - }); - } - }, { - key: "forEach", - value: function forEach(f) { - f(this); - this.children.forEach(function(x) { - return x.forEach(f); - }); - } - }]); - return Seq; -}(CodeRep); -Semi_1 = coderep$1.Semi = function(_Token) { - _inherits$2(Semi, _Token); - function Semi() { - _classCallCheck$4(this, Semi); - return _possibleConstructorReturn$2(this, (Semi.__proto__ || Object.getPrototypeOf(Semi)).call(this, ";")); - } - return Semi; -}(Token); -CommaSep_1 = coderep$1.CommaSep = function(_CodeRep11) { - _inherits$2(CommaSep, _CodeRep11); - function CommaSep(children) { - _classCallCheck$4(this, CommaSep); - var _this12 = _possibleConstructorReturn$2(this, (CommaSep.__proto__ || Object.getPrototypeOf(CommaSep)).call(this)); - _this12.children = children; - return _this12; - } - _createClass$4(CommaSep, [{ - key: "emit", - value: function emit(ts, noIn2) { - var first = true; - this.children.forEach(function(cr) { - if (first) { - first = false; - } else { - ts.put(","); - } - cr.emit(ts, noIn2); - }); - } - }, { - key: "forEach", - value: function forEach(f) { - f(this); - this.children.forEach(function(x) { - return x.forEach(f); - }); - } - }]); - return CommaSep; -}(CodeRep); -SemiOp_1 = coderep$1.SemiOp = function(_CodeRep12) { - _inherits$2(SemiOp, _CodeRep12); - function SemiOp() { - _classCallCheck$4(this, SemiOp); - return _possibleConstructorReturn$2(this, (SemiOp.__proto__ || Object.getPrototypeOf(SemiOp)).call(this)); - } - _createClass$4(SemiOp, [{ - key: "emit", - value: function emit(ts) { - ts.putOptionalSemi(); - } - }]); - return SemiOp; -}(CodeRep); -const coderep = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - getPrecedence: getPrecedence_1, - escapeStringLiteral: escapeStringLiteral_1, - Precedence: Precedence_1, - get CodeRep() { - return CodeRep_1; - }, - get Empty() { - return Empty_1; - }, - get Token() { - return Token_1; - }, - get RawToken() { - return RawToken_1; - }, - get NumberCodeRep() { - return NumberCodeRep_1; - }, - get Paren() { - return Paren_1; - }, - get Bracket() { - return Bracket_1; - }, - get Brace() { - return Brace_1; - }, - get NoIn() { - return NoIn_1; - }, - get ContainsIn() { - return ContainsIn_1; - }, - get Seq() { - return Seq_1; - }, - get Semi() { - return Semi_1; - }, - get CommaSep() { - return CommaSep_1; - }, - get SemiOp() { - return SemiOp_1; - }, - default: coderep$1 -}, [coderep$1]); -const require$$2 = /* @__PURE__ */ getAugmentedNamespace(coderep); -Object.defineProperty(minimalCodegen$1, "__esModule", { - value: true -}); -var _createClass$3 = function() { - function defineProperties(target, props) { - for (var i2 = 0; i2 < props.length; i2++) { - var descriptor = props[i2]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - return function(Constructor, protoProps, staticProps) { - if (protoProps) - defineProperties(Constructor.prototype, protoProps); - if (staticProps) - defineProperties(Constructor, staticProps); - return Constructor; - }; -}(); -var _objectAssign$1 = require$$0$3; -var _objectAssign2$1 = _interopRequireDefault$2(_objectAssign$1); -var _esutils$1 = require$$1$1; -var _coderep$1 = require$$2; -function _interopRequireDefault$2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; -} -function _toConsumableArray$2(arr) { - if (Array.isArray(arr)) { - for (var i2 = 0, arr2 = Array(arr.length); i2 < arr.length; i2++) { - arr2[i2] = arr[i2]; - } - return arr2; - } else { - return Array.from(arr); - } -} -function _classCallCheck$3(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} -function p(node, precedence, a) { - return (0, _coderep$1.getPrecedence)(node) < precedence ? paren(a) : a; -} -function t(token) { - var isRegExp = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; - return new _coderep$1.Token(token, isRegExp); -} -function paren(rep) { - return new _coderep$1.Paren(rep); -} -function brace(rep) { - return new _coderep$1.Brace(rep); -} -function bracket(rep) { - return new _coderep$1.Bracket(rep); -} -function noIn$1(rep) { - return new _coderep$1.NoIn(rep); -} -function markContainsIn$1(state) { - return state.containsIn ? new _coderep$1.ContainsIn(state) : state; -} -function seq$1() { - for (var _len = arguments.length, reps = Array(_len), _key = 0; _key < _len; _key++) { - reps[_key] = arguments[_key]; - } - return new _coderep$1.Seq(reps); -} -function semi() { - return new _coderep$1.Semi(); -} -function semiOp() { - return new _coderep$1.SemiOp(); -} -function empty$1() { - return new _coderep$1.Empty(); -} -function commaSep(pieces) { - return new _coderep$1.CommaSep(pieces); -} -function getAssignmentExpr(state) { - return state ? state.containsGroup ? paren(state) : state : empty$1(); -} -var MinimalCodeGen = function() { - function MinimalCodeGen2() { - _classCallCheck$3(this, MinimalCodeGen2); - } - _createClass$3(MinimalCodeGen2, [{ - key: "parenToAvoidBeingDirective", - value: function parenToAvoidBeingDirective(element, original) { - if (element && element.type === "ExpressionStatement" && element.expression.type === "LiteralStringExpression") { - return seq$1(paren(original.children[0]), semiOp()); - } - return original; - } - }, { - key: "regenerateArrowParams", - value: function regenerateArrowParams(element, original) { - if (element.rest == null && element.items.length === 1 && element.items[0].type === "BindingIdentifier") { - return this.reduceBindingIdentifier(element.items[0]); - } - return original; - } - }, { - key: "reduceArrayExpression", - value: function reduceArrayExpression(node, _ref) { - var elements = _ref.elements; - if (elements.length === 0) { - return bracket(empty$1()); - } - var content = commaSep(elements.map(getAssignmentExpr)); - if (elements.length > 0 && elements[elements.length - 1] == null) { - content = seq$1(content, t(",")); - } - return bracket(content); - } - }, { - key: "reduceAwaitExpression", - value: function reduceAwaitExpression(node, _ref2) { - var expression = _ref2.expression; - return seq$1(t("await"), p(node.expression, (0, _coderep$1.getPrecedence)(node), expression)); - } - }, { - key: "reduceSpreadElement", - value: function reduceSpreadElement(node, _ref3) { - var expression = _ref3.expression; - return seq$1(t("..."), p(node.expression, _coderep$1.Precedence.Assignment, expression)); - } - }, { - key: "reduceSpreadProperty", - value: function reduceSpreadProperty(node, _ref4) { - var expression = _ref4.expression; - return seq$1(t("..."), getAssignmentExpr(expression)); - } - }, { - key: "reduceAssignmentExpression", - value: function reduceAssignmentExpression(node, _ref5) { - var binding = _ref5.binding, expression = _ref5.expression; - var leftCode = binding; - var rightCode = expression; - var containsIn = expression.containsIn; - var startsWithCurly = binding.startsWithCurly; - var startsWithLetSquareBracket = binding.startsWithLetSquareBracket; - var startsWithFunctionOrClass = binding.startsWithFunctionOrClass; - if ((0, _coderep$1.getPrecedence)(node.expression) < (0, _coderep$1.getPrecedence)(node)) { - rightCode = paren(rightCode); - containsIn = false; - } - return (0, _objectAssign2$1.default)(seq$1(leftCode, t("="), rightCode), { containsIn, startsWithCurly, startsWithLetSquareBracket, startsWithFunctionOrClass }); - } - }, { - key: "reduceAssignmentTargetIdentifier", - value: function reduceAssignmentTargetIdentifier(node) { - var a = t(node.name); - if (node.name === "let") { - a.startsWithLet = true; - } - return a; - } - }, { - key: "reduceAssignmentTargetWithDefault", - value: function reduceAssignmentTargetWithDefault(node, _ref6) { - var binding = _ref6.binding, init = _ref6.init; - return seq$1(binding, t("="), p(node.init, _coderep$1.Precedence.Assignment, init)); - } - }, { - key: "reduceCompoundAssignmentExpression", - value: function reduceCompoundAssignmentExpression(node, _ref7) { - var binding = _ref7.binding, expression = _ref7.expression; - var leftCode = binding; - var rightCode = expression; - var containsIn = expression.containsIn; - var startsWithCurly = binding.startsWithCurly; - var startsWithLetSquareBracket = binding.startsWithLetSquareBracket; - var startsWithFunctionOrClass = binding.startsWithFunctionOrClass; - if ((0, _coderep$1.getPrecedence)(node.expression) < (0, _coderep$1.getPrecedence)(node)) { - rightCode = paren(rightCode); - containsIn = false; - } - return (0, _objectAssign2$1.default)(seq$1(leftCode, t(node.operator), rightCode), { containsIn, startsWithCurly, startsWithLetSquareBracket, startsWithFunctionOrClass }); - } - }, { - key: "reduceBinaryExpression", - value: function reduceBinaryExpression(node, _ref8) { - var left = _ref8.left, right = _ref8.right; - var leftCode = left; - var startsWithCurly = left.startsWithCurly; - var startsWithLetSquareBracket = left.startsWithLetSquareBracket; - var startsWithFunctionOrClass = left.startsWithFunctionOrClass; - var leftContainsIn = left.containsIn; - var isRightAssociative = node.operator === "**"; - if ((0, _coderep$1.getPrecedence)(node.left) < (0, _coderep$1.getPrecedence)(node) || isRightAssociative && ((0, _coderep$1.getPrecedence)(node.left) === (0, _coderep$1.getPrecedence)(node) || node.left.type === "UnaryExpression")) { - leftCode = paren(leftCode); - startsWithCurly = false; - startsWithLetSquareBracket = false; - startsWithFunctionOrClass = false; - leftContainsIn = false; - } - var rightCode = right; - var rightContainsIn = right.containsIn; - if ((0, _coderep$1.getPrecedence)(node.right) < (0, _coderep$1.getPrecedence)(node) || !isRightAssociative && (0, _coderep$1.getPrecedence)(node.right) === (0, _coderep$1.getPrecedence)(node)) { - rightCode = paren(rightCode); - rightContainsIn = false; - } - return (0, _objectAssign2$1.default)(seq$1(leftCode, t(node.operator), rightCode), { - containsIn: leftContainsIn || rightContainsIn || node.operator === "in", - containsGroup: node.operator === ",", - startsWithCurly, - startsWithLetSquareBracket, - startsWithFunctionOrClass - }); - } - }, { - key: "reduceBindingWithDefault", - value: function reduceBindingWithDefault(node, _ref9) { - var binding = _ref9.binding, init = _ref9.init; - return seq$1(binding, t("="), p(node.init, _coderep$1.Precedence.Assignment, init)); - } - }, { - key: "reduceBindingIdentifier", - value: function reduceBindingIdentifier(node) { - var a = t(node.name); - if (node.name === "let") { - a.startsWithLet = true; - } - return a; - } - }, { - key: "reduceArrayAssignmentTarget", - value: function reduceArrayAssignmentTarget(node, _ref10) { - var elements = _ref10.elements, rest = _ref10.rest; - var content = void 0; - if (elements.length === 0) { - content = rest == null ? empty$1() : seq$1(t("..."), rest); - } else { - elements = elements.concat(rest == null ? [] : [seq$1(t("..."), rest)]); - content = commaSep(elements.map(getAssignmentExpr)); - if (elements.length > 0 && elements[elements.length - 1] == null) { - content = seq$1(content, t(",")); - } - } - return bracket(content); - } - }, { - key: "reduceArrayBinding", - value: function reduceArrayBinding(node, _ref11) { - var elements = _ref11.elements, rest = _ref11.rest; - var content = void 0; - if (elements.length === 0) { - content = rest == null ? empty$1() : seq$1(t("..."), rest); - } else { - elements = elements.concat(rest == null ? [] : [seq$1(t("..."), rest)]); - content = commaSep(elements.map(getAssignmentExpr)); - if (elements.length > 0 && elements[elements.length - 1] == null) { - content = seq$1(content, t(",")); - } - } - return bracket(content); - } - }, { - key: "reduceObjectAssignmentTarget", - value: function reduceObjectAssignmentTarget(node, _ref12) { - var properties = _ref12.properties, rest = _ref12.rest; - var content = commaSep(properties); - if (properties.length === 0) { - content = rest == null ? empty$1() : seq$1(t("..."), rest); - } else { - content = rest == null ? content : seq$1(content, t(","), t("..."), rest); - } - var state = brace(content); - state.startsWithCurly = true; - return state; - } - }, { - key: "reduceObjectBinding", - value: function reduceObjectBinding(node, _ref13) { - var properties = _ref13.properties, rest = _ref13.rest; - var content = commaSep(properties); - if (properties.length === 0) { - content = rest == null ? empty$1() : seq$1(t("..."), rest); - } else { - content = rest == null ? content : seq$1(content, t(","), t("..."), rest); - } - var state = brace(content); - state.startsWithCurly = true; - return state; - } - }, { - key: "reduceAssignmentTargetPropertyIdentifier", - value: function reduceAssignmentTargetPropertyIdentifier(node, _ref14) { - var binding = _ref14.binding, init = _ref14.init; - if (node.init == null) - return binding; - return seq$1(binding, t("="), p(node.init, _coderep$1.Precedence.Assignment, init)); - } - }, { - key: "reduceAssignmentTargetPropertyProperty", - value: function reduceAssignmentTargetPropertyProperty(node, _ref15) { - var name = _ref15.name, binding = _ref15.binding; - return seq$1(name, t(":"), binding); - } - }, { - key: "reduceBindingPropertyIdentifier", - value: function reduceBindingPropertyIdentifier(node, _ref16) { - var binding = _ref16.binding, init = _ref16.init; - if (node.init == null) - return binding; - return seq$1(binding, t("="), p(node.init, _coderep$1.Precedence.Assignment, init)); - } - }, { - key: "reduceBindingPropertyProperty", - value: function reduceBindingPropertyProperty(node, _ref17) { - var name = _ref17.name, binding = _ref17.binding; - return seq$1(name, t(":"), binding); - } - }, { - key: "reduceBlock", - value: function reduceBlock(node, _ref18) { - var statements = _ref18.statements; - return brace(seq$1.apply(void 0, _toConsumableArray$2(statements))); - } - }, { - key: "reduceBlockStatement", - value: function reduceBlockStatement(node, _ref19) { - var block = _ref19.block; - return block; - } - }, { - key: "reduceBreakStatement", - value: function reduceBreakStatement(node) { - return seq$1(t("break"), node.label ? t(node.label) : empty$1(), semiOp()); - } - }, { - key: "reduceCallExpression", - value: function reduceCallExpression(node, _ref20) { - var callee = _ref20.callee, args = _ref20.arguments; - var parenthizedArgs = args.map(function(a, i2) { - return p(node.arguments[i2], _coderep$1.Precedence.Assignment, a); - }); - return (0, _objectAssign2$1.default)(seq$1(p(node.callee, (0, _coderep$1.getPrecedence)(node), callee), paren(commaSep(parenthizedArgs))), { - startsWithCurly: callee.startsWithCurly, - startsWithLet: callee.startsWithLet, - startsWithLetSquareBracket: callee.startsWithLetSquareBracket, - startsWithFunctionOrClass: callee.startsWithFunctionOrClass - }); - } - }, { - key: "reduceCatchClause", - value: function reduceCatchClause(node, _ref21) { - var binding = _ref21.binding, body = _ref21.body; - return seq$1(t("catch"), paren(binding), body); - } - }, { - key: "reduceClassDeclaration", - value: function reduceClassDeclaration(node, _ref22) { - var name = _ref22.name, _super = _ref22.super, elements = _ref22.elements; - var state = seq$1(t("class"), node.name.name === "*default*" ? empty$1() : name); - if (_super != null) { - state = seq$1(state, t("extends"), p(node.super, _coderep$1.Precedence.New, _super)); - } - state = seq$1.apply(void 0, [state, t("{")].concat(_toConsumableArray$2(elements), [t("}")])); - return state; - } - }, { - key: "reduceClassExpression", - value: function reduceClassExpression(node, _ref23) { - var name = _ref23.name, _super = _ref23.super, elements = _ref23.elements; - var state = t("class"); - if (name != null) { - state = seq$1(state, name); - } - if (_super != null) { - state = seq$1(state, t("extends"), p(node.super, _coderep$1.Precedence.New, _super)); - } - state = seq$1.apply(void 0, [state, t("{")].concat(_toConsumableArray$2(elements), [t("}")])); - state.startsWithFunctionOrClass = true; - return state; - } - }, { - key: "reduceClassElement", - value: function reduceClassElement(node, _ref24) { - var method = _ref24.method; - if (!node.isStatic) - return method; - return seq$1(t("static"), method); - } - }, { - key: "reduceComputedMemberAssignmentTarget", - value: function reduceComputedMemberAssignmentTarget(node, _ref25) { - var object = _ref25.object, expression = _ref25.expression; - var startsWithLetSquareBracket = object.startsWithLetSquareBracket || node.object.type === "IdentifierExpression" && node.object.name === "let"; - return (0, _objectAssign2$1.default)(seq$1(p(node.object, (0, _coderep$1.getPrecedence)(node), object), bracket(expression)), { - startsWithLet: object.startsWithLet, - startsWithLetSquareBracket, - startsWithCurly: object.startsWithCurly, - startsWithFunctionOrClass: object.startsWithFunctionOrClass - }); - } - }, { - key: "reduceComputedMemberExpression", - value: function reduceComputedMemberExpression(node, _ref26) { - var object = _ref26.object, expression = _ref26.expression; - var startsWithLetSquareBracket = object.startsWithLetSquareBracket || node.object.type === "IdentifierExpression" && node.object.name === "let"; - return (0, _objectAssign2$1.default)(seq$1(p(node.object, (0, _coderep$1.getPrecedence)(node), object), bracket(expression)), { - startsWithLet: object.startsWithLet, - startsWithLetSquareBracket, - startsWithCurly: object.startsWithCurly, - startsWithFunctionOrClass: object.startsWithFunctionOrClass - }); - } - }, { - key: "reduceComputedPropertyName", - value: function reduceComputedPropertyName(node, _ref27) { - var expression = _ref27.expression; - return bracket(p(node.expression, _coderep$1.Precedence.Assignment, expression)); - } - }, { - key: "reduceConditionalExpression", - value: function reduceConditionalExpression(node, _ref28) { - var test = _ref28.test, consequent = _ref28.consequent, alternate = _ref28.alternate; - var containsIn = test.containsIn || alternate.containsIn; - var startsWithCurly = test.startsWithCurly; - var startsWithLetSquareBracket = test.startsWithLetSquareBracket; - var startsWithFunctionOrClass = test.startsWithFunctionOrClass; - return (0, _objectAssign2$1.default)(seq$1(p(node.test, _coderep$1.Precedence.LogicalOR, test), t("?"), p(node.consequent, _coderep$1.Precedence.Assignment, consequent), t(":"), p(node.alternate, _coderep$1.Precedence.Assignment, alternate)), { - containsIn, - startsWithCurly, - startsWithLetSquareBracket, - startsWithFunctionOrClass - }); - } - }, { - key: "reduceContinueStatement", - value: function reduceContinueStatement(node) { - return seq$1(t("continue"), node.label ? t(node.label) : empty$1(), semiOp()); - } - }, { - key: "reduceDataProperty", - value: function reduceDataProperty(node, _ref29) { - var name = _ref29.name, expression = _ref29.expression; - return seq$1(name, t(":"), getAssignmentExpr(expression)); - } - }, { - key: "reduceDebuggerStatement", - value: function reduceDebuggerStatement() { - return seq$1(t("debugger"), semiOp()); - } - }, { - key: "reduceDoWhileStatement", - value: function reduceDoWhileStatement(node, _ref30) { - var body = _ref30.body, test = _ref30.test; - return seq$1(t("do"), body, t("while"), paren(test), semiOp()); - } - }, { - key: "reduceEmptyStatement", - value: function reduceEmptyStatement() { - return semi(); - } - }, { - key: "reduceExpressionStatement", - value: function reduceExpressionStatement(node, _ref31) { - var expression = _ref31.expression; - var needsParens = expression.startsWithCurly || expression.startsWithLetSquareBracket || expression.startsWithFunctionOrClass; - return seq$1(needsParens ? paren(expression) : expression, semiOp()); - } - }, { - key: "reduceForInStatement", - value: function reduceForInStatement(node, _ref32) { - var left = _ref32.left, right = _ref32.right, body = _ref32.body; - left = node.left.type === "VariableDeclaration" ? noIn$1(markContainsIn$1(left)) : left; - return (0, _objectAssign2$1.default)(seq$1(t("for"), paren(seq$1(left.startsWithLet ? paren(left) : left, t("in"), right)), body), { endsWithMissingElse: body.endsWithMissingElse }); - } - }, { - key: "reduceForOfStatement", - value: function reduceForOfStatement(node, _ref33) { - var left = _ref33.left, right = _ref33.right, body = _ref33.body; - left = node.left.type === "VariableDeclaration" ? noIn$1(markContainsIn$1(left)) : left; - return (0, _objectAssign2$1.default)(seq$1(t("for"), paren(seq$1(left.startsWithLet ? paren(left) : left, t("of"), p(node.right, _coderep$1.Precedence.Assignment, right))), body), { endsWithMissingElse: body.endsWithMissingElse }); - } - }, { - key: "reduceForStatement", - value: function reduceForStatement(node, _ref34) { - var init = _ref34.init, test = _ref34.test, update = _ref34.update, body = _ref34.body; - if (init) { - if (init.startsWithLetSquareBracket) { - init = paren(init); - } - init = noIn$1(markContainsIn$1(init)); - } - return (0, _objectAssign2$1.default)(seq$1(t("for"), paren(seq$1(init ? init : empty$1(), semi(), test || empty$1(), semi(), update || empty$1())), body), { - endsWithMissingElse: body.endsWithMissingElse - }); - } - }, { - key: "reduceForAwaitStatement", - value: function reduceForAwaitStatement(node, _ref35) { - var left = _ref35.left, right = _ref35.right, body = _ref35.body; - left = node.left.type === "VariableDeclaration" ? noIn$1(markContainsIn$1(left)) : left; - return (0, _objectAssign2$1.default)(seq$1(t("for"), t("await"), paren(seq$1(left.startsWithLet ? paren(left) : left, t("of"), p(node.right, _coderep$1.Precedence.Assignment, right))), body), { endsWithMissingElse: body.endsWithMissingElse }); - } - }, { - key: "reduceFunctionBody", - value: function reduceFunctionBody(node, _ref36) { - var directives = _ref36.directives, statements = _ref36.statements; - if (statements.length) { - statements[0] = this.parenToAvoidBeingDirective(node.statements[0], statements[0]); - } - return brace(seq$1.apply(void 0, _toConsumableArray$2(directives).concat(_toConsumableArray$2(statements)))); - } - }, { - key: "reduceFunctionDeclaration", - value: function reduceFunctionDeclaration(node, _ref37) { - var name = _ref37.name, params = _ref37.params, body = _ref37.body; - return seq$1(node.isAsync ? t("async") : empty$1(), t("function"), node.isGenerator ? t("*") : empty$1(), node.name.name === "*default*" ? empty$1() : name, params, body); - } - }, { - key: "reduceFunctionExpression", - value: function reduceFunctionExpression(node, _ref38) { - var name = _ref38.name, params = _ref38.params, body = _ref38.body; - var state = seq$1(node.isAsync ? t("async") : empty$1(), t("function"), node.isGenerator ? t("*") : empty$1(), name ? name : empty$1(), params, body); - state.startsWithFunctionOrClass = true; - return state; - } - }, { - key: "reduceFormalParameters", - value: function reduceFormalParameters(node, _ref39) { - var items = _ref39.items, rest = _ref39.rest; - return paren(commaSep(items.concat(rest == null ? [] : [seq$1(t("..."), rest)]))); - } - }, { - key: "reduceArrowExpression", - value: function reduceArrowExpression(node, _ref40) { - var params = _ref40.params, body = _ref40.body; - params = this.regenerateArrowParams(node.params, params); - var containsIn = false; - if (node.body.type !== "FunctionBody") { - if (body.startsWithCurly) { - body = paren(body); - } else if (body.containsIn) { - containsIn = true; - } - } - return (0, _objectAssign2$1.default)(seq$1(node.isAsync ? t("async") : empty$1(), params, t("=>"), p(node.body, _coderep$1.Precedence.Assignment, body)), { containsIn }); - } - }, { - key: "reduceGetter", - value: function reduceGetter(node, _ref41) { - var name = _ref41.name, body = _ref41.body; - return seq$1(t("get"), name, paren(empty$1()), body); - } - }, { - key: "reduceIdentifierExpression", - value: function reduceIdentifierExpression(node) { - var a = t(node.name); - if (node.name === "let") { - a.startsWithLet = true; - } - return a; - } - }, { - key: "reduceIfStatement", - value: function reduceIfStatement(node, _ref42) { - var test = _ref42.test, consequent = _ref42.consequent, alternate = _ref42.alternate; - if (alternate && consequent.endsWithMissingElse) { - consequent = brace(consequent); - } - return (0, _objectAssign2$1.default)(seq$1(t("if"), paren(test), consequent, alternate ? seq$1(t("else"), alternate) : empty$1()), { endsWithMissingElse: alternate ? alternate.endsWithMissingElse : true }); - } - }, { - key: "reduceImport", - value: function reduceImport(node, _ref43) { - var defaultBinding = _ref43.defaultBinding, namedImports = _ref43.namedImports; - var bindings = []; - if (defaultBinding != null) { - bindings.push(defaultBinding); - } - if (namedImports.length > 0) { - bindings.push(brace(commaSep(namedImports))); - } - if (bindings.length === 0) { - return seq$1(t("import"), t((0, _coderep$1.escapeStringLiteral)(node.moduleSpecifier)), semiOp()); - } - return seq$1(t("import"), commaSep(bindings), t("from"), t((0, _coderep$1.escapeStringLiteral)(node.moduleSpecifier)), semiOp()); - } - }, { - key: "reduceImportNamespace", - value: function reduceImportNamespace(node, _ref44) { - var defaultBinding = _ref44.defaultBinding, namespaceBinding = _ref44.namespaceBinding; - return seq$1(t("import"), defaultBinding == null ? empty$1() : seq$1(defaultBinding, t(",")), t("*"), t("as"), namespaceBinding, t("from"), t((0, _coderep$1.escapeStringLiteral)(node.moduleSpecifier)), semiOp()); - } - }, { - key: "reduceImportSpecifier", - value: function reduceImportSpecifier(node, _ref45) { - var binding = _ref45.binding; - if (node.name == null) - return binding; - return seq$1(t(node.name), t("as"), binding); - } - }, { - key: "reduceExportAllFrom", - value: function reduceExportAllFrom(node) { - return seq$1(t("export"), t("*"), t("from"), t((0, _coderep$1.escapeStringLiteral)(node.moduleSpecifier)), semiOp()); - } - }, { - key: "reduceExportFrom", - value: function reduceExportFrom(node, _ref46) { - var namedExports = _ref46.namedExports; - return seq$1(t("export"), brace(commaSep(namedExports)), t("from"), t((0, _coderep$1.escapeStringLiteral)(node.moduleSpecifier)), semiOp()); - } - }, { - key: "reduceExportLocals", - value: function reduceExportLocals(node, _ref47) { - var namedExports = _ref47.namedExports; - return seq$1(t("export"), brace(commaSep(namedExports)), semiOp()); - } - }, { - key: "reduceExport", - value: function reduceExport(node, _ref48) { - var declaration = _ref48.declaration; - switch (node.declaration.type) { - case "FunctionDeclaration": - case "ClassDeclaration": - break; - default: - declaration = seq$1(declaration, semiOp()); - } - return seq$1(t("export"), declaration); - } - }, { - key: "reduceExportDefault", - value: function reduceExportDefault(node, _ref49) { - var body = _ref49.body; - body = body.startsWithFunctionOrClass ? paren(body) : body; - switch (node.body.type) { - case "FunctionDeclaration": - case "ClassDeclaration": - return seq$1(t("export default"), body); - default: - return seq$1(t("export default"), p(node.body, _coderep$1.Precedence.Assignment, body), semiOp()); - } - } - }, { - key: "reduceExportFromSpecifier", - value: function reduceExportFromSpecifier(node) { - if (node.exportedName == null) - return t(node.name); - return seq$1(t(node.name), t("as"), t(node.exportedName)); - } - }, { - key: "reduceExportLocalSpecifier", - value: function reduceExportLocalSpecifier(node, _ref50) { - var name = _ref50.name; - if (node.exportedName == null) - return name; - return seq$1(name, t("as"), t(node.exportedName)); - } - }, { - key: "reduceLabeledStatement", - value: function reduceLabeledStatement(node, _ref51) { - var body = _ref51.body; - return (0, _objectAssign2$1.default)(seq$1(t(node.label + ":"), body), { endsWithMissingElse: body.endsWithMissingElse }); - } - }, { - key: "reduceLiteralBooleanExpression", - value: function reduceLiteralBooleanExpression(node) { - return t(node.value.toString()); - } - }, { - key: "reduceLiteralNullExpression", - value: function reduceLiteralNullExpression() { - return t("null"); - } - }, { - key: "reduceLiteralInfinityExpression", - value: function reduceLiteralInfinityExpression() { - return t("2e308"); - } - }, { - key: "reduceLiteralNumericExpression", - value: function reduceLiteralNumericExpression(node) { - return new _coderep$1.NumberCodeRep(node.value); - } - }, { - key: "reduceLiteralRegExpExpression", - value: function reduceLiteralRegExpExpression(node) { - return t("/" + node.pattern + "/" + (node.global ? "g" : "") + (node.ignoreCase ? "i" : "") + (node.multiLine ? "m" : "") + (node.dotAll ? "s" : "") + (node.unicode ? "u" : "") + (node.sticky ? "y" : ""), true); - } - }, { - key: "reduceLiteralStringExpression", - value: function reduceLiteralStringExpression(node) { - return t((0, _coderep$1.escapeStringLiteral)(node.value)); - } - }, { - key: "reduceMethod", - value: function reduceMethod(node, _ref52) { - var name = _ref52.name, params = _ref52.params, body = _ref52.body; - return seq$1(node.isAsync ? t("async") : empty$1(), node.isGenerator ? t("*") : empty$1(), name, params, body); - } - }, { - key: "reduceModule", - value: function reduceModule(node, _ref53) { - var directives = _ref53.directives, items = _ref53.items; - if (items.length) { - items[0] = this.parenToAvoidBeingDirective(node.items[0], items[0]); - } - return seq$1.apply(void 0, _toConsumableArray$2(directives).concat(_toConsumableArray$2(items))); - } - }, { - key: "reduceNewExpression", - value: function reduceNewExpression(node, _ref54) { - var callee = _ref54.callee, args = _ref54.arguments; - var parenthizedArgs = args.map(function(a, i2) { - return p(node.arguments[i2], _coderep$1.Precedence.Assignment, a); - }); - var calleeRep = (0, _coderep$1.getPrecedence)(node.callee) === _coderep$1.Precedence.Call ? paren(callee) : p(node.callee, (0, _coderep$1.getPrecedence)(node), callee); - return seq$1(t("new"), calleeRep, args.length === 0 ? empty$1() : paren(commaSep(parenthizedArgs))); - } - }, { - key: "reduceNewTargetExpression", - value: function reduceNewTargetExpression() { - return t("new.target"); - } - }, { - key: "reduceObjectExpression", - value: function reduceObjectExpression(node, _ref55) { - var properties = _ref55.properties; - var state = brace(commaSep(properties)); - state.startsWithCurly = true; - return state; - } - }, { - key: "reduceUpdateExpression", - value: function reduceUpdateExpression(node, _ref56) { - var operand = _ref56.operand; - if (node.isPrefix) { - return this.reduceUnaryExpression.apply(this, arguments); - } - return (0, _objectAssign2$1.default)(seq$1(p(node.operand, _coderep$1.Precedence.New, operand), t(node.operator)), { - startsWithCurly: operand.startsWithCurly, - startsWithLetSquareBracket: operand.startsWithLetSquareBracket, - startsWithFunctionOrClass: operand.startsWithFunctionOrClass - }); - } - }, { - key: "reduceUnaryExpression", - value: function reduceUnaryExpression(node, _ref57) { - var operand = _ref57.operand; - return seq$1(t(node.operator), p(node.operand, (0, _coderep$1.getPrecedence)(node), operand)); - } - }, { - key: "reduceReturnStatement", - value: function reduceReturnStatement(node, _ref58) { - var expression = _ref58.expression; - return seq$1(t("return"), expression || empty$1(), semiOp()); - } - }, { - key: "reduceScript", - value: function reduceScript(node, _ref59) { - var directives = _ref59.directives, statements = _ref59.statements; - if (statements.length) { - statements[0] = this.parenToAvoidBeingDirective(node.statements[0], statements[0]); - } - return seq$1.apply(void 0, _toConsumableArray$2(directives).concat(_toConsumableArray$2(statements))); - } - }, { - key: "reduceSetter", - value: function reduceSetter(node, _ref60) { - var name = _ref60.name, param = _ref60.param, body = _ref60.body; - return seq$1(t("set"), name, paren(param), body); - } - }, { - key: "reduceShorthandProperty", - value: function reduceShorthandProperty(node, _ref61) { - var name = _ref61.name; - return name; - } - }, { - key: "reduceStaticMemberAssignmentTarget", - value: function reduceStaticMemberAssignmentTarget(node, _ref62) { - var object = _ref62.object; - var state = seq$1(p(node.object, (0, _coderep$1.getPrecedence)(node), object), t("."), t(node.property)); - state.startsWithLet = object.startsWithLet; - state.startsWithCurly = object.startsWithCurly; - state.startsWithLetSquareBracket = object.startsWithLetSquareBracket; - state.startsWithFunctionOrClass = object.startsWithFunctionOrClass; - return state; - } - }, { - key: "reduceStaticMemberExpression", - value: function reduceStaticMemberExpression(node, _ref63) { - var object = _ref63.object; - var state = seq$1(p(node.object, (0, _coderep$1.getPrecedence)(node), object), t("."), t(node.property)); - state.startsWithLet = object.startsWithLet; - state.startsWithCurly = object.startsWithCurly; - state.startsWithLetSquareBracket = object.startsWithLetSquareBracket; - state.startsWithFunctionOrClass = object.startsWithFunctionOrClass; - return state; - } - }, { - key: "reduceStaticPropertyName", - value: function reduceStaticPropertyName(node) { - if (_esutils$1.keyword.isIdentifierNameES6(node.value)) { - return t(node.value); - } - var n = parseFloat(node.value); - if (n >= 0 && n.toString() === node.value) { - return new _coderep$1.NumberCodeRep(n); - } - return t((0, _coderep$1.escapeStringLiteral)(node.value)); - } - }, { - key: "reduceSuper", - value: function reduceSuper() { - return t("super"); - } - }, { - key: "reduceSwitchCase", - value: function reduceSwitchCase(node, _ref64) { - var test = _ref64.test, consequent = _ref64.consequent; - return seq$1(t("case"), test, t(":"), seq$1.apply(void 0, _toConsumableArray$2(consequent))); - } - }, { - key: "reduceSwitchDefault", - value: function reduceSwitchDefault(node, _ref65) { - var consequent = _ref65.consequent; - return seq$1(t("default:"), seq$1.apply(void 0, _toConsumableArray$2(consequent))); - } - }, { - key: "reduceSwitchStatement", - value: function reduceSwitchStatement(node, _ref66) { - var discriminant = _ref66.discriminant, cases = _ref66.cases; - return seq$1(t("switch"), paren(discriminant), brace(seq$1.apply(void 0, _toConsumableArray$2(cases)))); - } - }, { - key: "reduceSwitchStatementWithDefault", - value: function reduceSwitchStatementWithDefault(node, _ref67) { - var discriminant = _ref67.discriminant, preDefaultCases = _ref67.preDefaultCases, defaultCase = _ref67.defaultCase, postDefaultCases = _ref67.postDefaultCases; - return seq$1(t("switch"), paren(discriminant), brace(seq$1.apply(void 0, _toConsumableArray$2(preDefaultCases).concat([defaultCase], _toConsumableArray$2(postDefaultCases))))); - } - }, { - key: "reduceTemplateExpression", - value: function reduceTemplateExpression(node, _ref68) { - var tag = _ref68.tag, elements = _ref68.elements; - var state = node.tag == null ? empty$1() : p(node.tag, (0, _coderep$1.getPrecedence)(node), tag); - state = seq$1(state, t("`")); - for (var i2 = 0, l = node.elements.length; i2 < l; ++i2) { - if (node.elements[i2].type === "TemplateElement") { - state = seq$1(state, i2 > 0 ? t("}") : empty$1(), elements[i2], i2 < l - 1 ? t("${") : empty$1()); - } else { - state = seq$1(state, elements[i2]); - } - } - state = seq$1(state, t("`")); - if (node.tag != null) { - state.startsWithCurly = tag.startsWithCurly; - state.startsWithLet = tag.startsWithLet; - state.startsWithLetSquareBracket = tag.startsWithLetSquareBracket; - state.startsWithFunctionOrClass = tag.startsWithFunctionOrClass; - } - return state; - } - }, { - key: "reduceTemplateElement", - value: function reduceTemplateElement(node) { - return new _coderep$1.RawToken(node.rawValue); - } - }, { - key: "reduceThisExpression", - value: function reduceThisExpression() { - return t("this"); - } - }, { - key: "reduceThrowStatement", - value: function reduceThrowStatement(node, _ref69) { - var expression = _ref69.expression; - return seq$1(t("throw"), expression, semiOp()); - } - }, { - key: "reduceTryCatchStatement", - value: function reduceTryCatchStatement(node, _ref70) { - var body = _ref70.body, catchClause = _ref70.catchClause; - return seq$1(t("try"), body, catchClause); - } - }, { - key: "reduceTryFinallyStatement", - value: function reduceTryFinallyStatement(node, _ref71) { - var body = _ref71.body, catchClause = _ref71.catchClause, finalizer = _ref71.finalizer; - return seq$1(t("try"), body, catchClause || empty$1(), t("finally"), finalizer); - } - }, { - key: "reduceYieldExpression", - value: function reduceYieldExpression(node, _ref72) { - var expression = _ref72.expression; - if (node.expression == null) - return t("yield"); - return (0, _objectAssign2$1.default)(seq$1(t("yield"), p(node.expression, (0, _coderep$1.getPrecedence)(node), expression)), { containsIn: expression.containsIn }); - } - }, { - key: "reduceYieldGeneratorExpression", - value: function reduceYieldGeneratorExpression(node, _ref73) { - var expression = _ref73.expression; - return (0, _objectAssign2$1.default)(seq$1(t("yield"), t("*"), p(node.expression, (0, _coderep$1.getPrecedence)(node), expression)), { containsIn: expression.containsIn }); - } - }, { - key: "reduceDirective", - value: function reduceDirective(node) { - var delim = node.rawValue.match(/(^|[^\\])(\\\\)*"/) ? "'" : '"'; - return seq$1(t(delim + node.rawValue + delim), semiOp()); - } - }, { - key: "reduceVariableDeclaration", - value: function reduceVariableDeclaration(node, _ref74) { - var declarators = _ref74.declarators; - return seq$1(t(node.kind), commaSep(declarators)); - } - }, { - key: "reduceVariableDeclarationStatement", - value: function reduceVariableDeclarationStatement(node, _ref75) { - var declaration = _ref75.declaration; - return seq$1(declaration, semiOp()); - } - }, { - key: "reduceVariableDeclarator", - value: function reduceVariableDeclarator(node, _ref76) { - var binding = _ref76.binding, init = _ref76.init; - var containsIn = init && init.containsIn && !init.containsGroup; - if (init) { - if (init.containsGroup) { - init = paren(init); - } else { - init = markContainsIn$1(init); - } - } - return (0, _objectAssign2$1.default)(init == null ? binding : seq$1(binding, t("="), init), { containsIn }); - } - }, { - key: "reduceWhileStatement", - value: function reduceWhileStatement(node, _ref77) { - var test = _ref77.test, body = _ref77.body; - return (0, _objectAssign2$1.default)(seq$1(t("while"), paren(test), body), { endsWithMissingElse: body.endsWithMissingElse }); - } - }, { - key: "reduceWithStatement", - value: function reduceWithStatement(node, _ref78) { - var object = _ref78.object, body = _ref78.body; - return (0, _objectAssign2$1.default)(seq$1(t("with"), paren(object), body), { endsWithMissingElse: body.endsWithMissingElse }); - } - }]); - return MinimalCodeGen2; -}(); -var _default$1 = minimalCodegen$1.default = MinimalCodeGen; -const minimalCodegen = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - default: _default$1 -}, [minimalCodegen$1]); -const require$$0$1 = /* @__PURE__ */ getAugmentedNamespace(minimalCodegen); -var formattedCodegen$1 = {}; -var ExtensibleCodeGen_1; -Object.defineProperty(formattedCodegen$1, "__esModule", { - value: true -}); -var FormattedCodeGen_1 = formattedCodegen$1.FormattedCodeGen = ExtensibleCodeGen_1 = formattedCodegen$1.ExtensibleCodeGen = Sep_1 = formattedCodegen$1.Sep = void 0; -var _createClass$2 = function() { - function defineProperties(target, props) { - for (var i2 = 0; i2 < props.length; i2++) { - var descriptor = props[i2]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - return function(Constructor, protoProps, staticProps) { - if (protoProps) - defineProperties(Constructor.prototype, protoProps); - if (staticProps) - defineProperties(Constructor, staticProps); - return Constructor; - }; -}(); -var _objectAssign = require$$0$3; -var _objectAssign2 = _interopRequireDefault$1(_objectAssign); -var _esutils = require$$1$1; -var _coderep = require$$2; -function _interopRequireDefault$1(obj) { - return obj && obj.__esModule ? obj : { default: obj }; -} -function _toConsumableArray$1(arr) { - if (Array.isArray(arr)) { - for (var i2 = 0, arr2 = Array(arr.length); i2 < arr.length; i2++) { - arr2[i2] = arr[i2]; - } - return arr2; - } else { - return Array.from(arr); - } -} -function _classCallCheck$2(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} -function _possibleConstructorReturn$1(self, call) { - if (!self) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return call && (typeof call === "object" || typeof call === "function") ? call : self; -} -function _inherits$1(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); - if (superClass) - Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; -} -var INDENT = " "; -var Linebreak = function(_CodeRep) { - _inherits$1(Linebreak2, _CodeRep); - function Linebreak2() { - _classCallCheck$2(this, Linebreak2); - var _this = _possibleConstructorReturn$1(this, (Linebreak2.__proto__ || Object.getPrototypeOf(Linebreak2)).call(this)); - _this.indentation = 0; - return _this; - } - _createClass$2(Linebreak2, [{ - key: "emit", - value: function emit(ts) { - ts.put("\n"); - for (var i2 = 0; i2 < this.indentation; ++i2) { - ts.put(INDENT); - } - } - }]); - return Linebreak2; -}(_coderep.CodeRep); -function empty() { - return new _coderep.Empty(); -} -function noIn(rep) { - return new _coderep.NoIn(rep); -} -function markContainsIn(state) { - return state.containsIn ? new _coderep.ContainsIn(state) : state; -} -function seq() { - for (var _len = arguments.length, reps = Array(_len), _key = 0; _key < _len; _key++) { - reps[_key] = arguments[_key]; - } - return new _coderep.Seq(reps); -} -function isEmpty(codeRep) { - return codeRep instanceof _coderep.Empty || codeRep instanceof Linebreak || codeRep instanceof _coderep.Seq && codeRep.children.every(isEmpty); -} -var Sep = {}; -var separatorNames = ["ARRAY_EMPTY", "ARRAY_BEFORE_COMMA", "ARRAY_AFTER_COMMA", "SPREAD", "AWAIT", "AFTER_FORAWAIT_AWAIT", "BEFORE_DEFAULT_EQUALS", "AFTER_DEFAULT_EQUALS", "REST", "OBJECT_BEFORE_COMMA", "OBJECT_AFTER_COMMA", "BEFORE_PROP", "AFTER_PROP", "BEFORE_JUMP_LABEL", "ARGS_BEFORE_COMMA", "ARGS_AFTER_COMMA", "CALL", "BEFORE_CATCH_BINDING", "AFTER_CATCH_BINDING", "BEFORE_CLASS_NAME", "BEFORE_EXTENDS", "AFTER_EXTENDS", "BEFORE_CLASS_DECLARATION_ELEMENTS", "BEFORE_CLASS_EXPRESSION_ELEMENTS", "AFTER_STATIC", "BEFORE_CLASS_ELEMENT", "AFTER_CLASS_ELEMENT", "BEFORE_TERNARY_QUESTION", "AFTER_TERNARY_QUESTION", "BEFORE_TERNARY_COLON", "AFTER_TERNARY_COLON", "COMPUTED_MEMBER_EXPRESSION", "COMPUTED_MEMBER_ASSIGNMENT_TARGET", "AFTER_DO", "BEFORE_DOWHILE_WHILE", "AFTER_DOWHILE_WHILE", "AFTER_FORIN_FOR", "BEFORE_FORIN_IN", "AFTER_FORIN_FOR", "BEFORE_FORIN_BODY", "AFTER_FOROF_FOR", "BEFORE_FOROF_OF", "AFTER_FOROF_FOR", "BEFORE_FOROF_BODY", "AFTER_FOR_FOR", "BEFORE_FOR_INIT", "AFTER_FOR_INIT", "EMPTY_FOR_INIT", "BEFORE_FOR_TEST", "AFTER_FOR_TEST", "EMPTY_FOR_TEST", "BEFORE_FOR_UPDATE", "AFTER_FOR_UPDATE", "EMPTY_FOR_UPDATE", "BEFORE_FOR_BODY", "BEFORE_GENERATOR_STAR", "AFTER_GENERATOR_STAR", "BEFORE_FUNCTION_PARAMS", "BEFORE_FUNCTION_DECLARATION_BODY", "BEFORE_FUNCTION_EXPRESSION_BODY", "AFTER_FUNCTION_DIRECTIVES", "BEFORE_ARROW", "AFTER_ARROW", "AFTER_GET", "BEFORE_GET_PARAMS", "BEFORE_GET_BODY", "AFTER_IF", "AFTER_IF_TEST", "BEFORE_ELSE", "AFTER_ELSE", "PARAMETER_BEFORE_COMMA", "PARAMETER_AFTER_COMMA", "NAMED_IMPORT_BEFORE_COMMA", "NAMED_IMPORT_AFTER_COMMA", "IMPORT_BEFORE_COMMA", "IMPORT_AFTER_COMMA", "BEFORE_IMPORT_BINDINGS", "BEFORE_IMPORT_MODULE", "AFTER_IMPORT_BINDINGS", "AFTER_FROM", "BEFORE_IMPORT_NAMESPACE", "BEFORE_IMPORT_STAR", "AFTER_IMPORT_STAR", "AFTER_IMPORT_AS", "AFTER_NAMESPACE_BINDING", "BEFORE_IMPORT_AS", "AFTER_IMPORT_AS", "EXPORTS_BEFORE_COMMA", "EXPORTS_AFTER_COMMA", "BEFORE_EXPORT_STAR", "AFTER_EXPORT_STAR", "BEFORE_EXPORT_BINDINGS", "AFTER_EXPORT_FROM_BINDINGS", "AFTER_EXPORT_LOCAL_BINDINGS", "AFTER_EXPORT", "EXPORT_DEFAULT", "AFTER_EXPORT_DEFAULT", "BEFORE_EXPORT_AS", "AFTER_EXPORT_AS", "BEFORE_LABEL_COLON", "AFTER_LABEL_COLON", "AFTER_METHOD_GENERATOR_STAR", "AFTER_METHOD_ASYNC", "AFTER_METHOD_NAME", "BEFORE_METHOD_BODY", "AFTER_MODULE_DIRECTIVES", "AFTER_NEW", "BEFORE_NEW_ARGS", "EMPTY_NEW_CALL", "NEW_TARGET_BEFORE_DOT", "NEW_TARGET_AFTER_DOT", "RETURN", "AFTER_SET", "BEFORE_SET_PARAMS", "BEFORE_SET_BODY", "AFTER_SCRIPT_DIRECTIVES", "BEFORE_STATIC_MEMBER_DOT", "AFTER_STATIC_MEMBER_DOT", "BEFORE_STATIC_MEMBER_ASSIGNMENT_TARGET_DOT", "AFTER_STATIC_MEMBER_ASSIGNMENT_TARGET_DOT", "BEFORE_CASE_TEST", "AFTER_CASE_TEST", "BEFORE_CASE_BODY", "AFTER_CASE_BODY", "DEFAULT", "AFTER_DEFAULT_BODY", "BEFORE_SWITCH_DISCRIM", "BEFORE_SWITCH_BODY", "TEMPLATE_TAG", "BEFORE_TEMPLATE_EXPRESSION", "AFTER_TEMPLATE_EXPRESSION", "THROW", "AFTER_TRY", "BEFORE_CATCH", "BEFORE_FINALLY", "AFTER_FINALLY", "VARIABLE_DECLARATION", "YIELD", "BEFORE_YIELD_STAR", "AFTER_YIELD_STAR", "DECLARATORS_BEFORE_COMMA", "DECLARATORS_AFTER_COMMA", "BEFORE_INIT_EQUALS", "AFTER_INIT_EQUALS", "AFTER_WHILE", "BEFORE_WHILE_BODY", "AFTER_WITH", "BEFORE_WITH_BODY", "PAREN_AVOIDING_DIRECTIVE_BEFORE", "PAREN_AVOIDING_DIRECTIVE_AFTER", "PRECEDENCE_BEFORE", "PRECEDENCE_AFTER", "EXPRESSION_PAREN_BEFORE", "EXPRESSION_PAREN_AFTER", "CALL_PAREN_BEFORE", "CALL_PAREN_AFTER", "CALL_PAREN_EMPTY", "CATCH_PAREN_BEFORE", "CATCH_PAREN_AFTER", "DO_WHILE_TEST_PAREN_BEFORE", "DO_WHILE_TEST_PAREN_AFTER", "EXPRESSION_STATEMENT_PAREN_BEFORE", "EXPRESSION_STATEMENT_PAREN_AFTER", "FOR_LET_PAREN_BEFORE", "FOR_LET_PAREN_AFTER", "FOR_IN_LET_PAREN_BEFORE", "FOR_IN_LET_PAREN_AFTER", "FOR_IN_PAREN_BEFORE", "FOR_IN_PAREN_AFTER", "FOR_OF_LET_PAREN_BEFORE", "FOR_OF_LET_PAREN_AFTER", "FOR_OF_PAREN_BEFORE", "FOR_OF_PAREN_AFTER", "PARAMETERS_PAREN_BEFORE", "PARAMETERS_PAREN_AFTER", "PARAMETERS_PAREN_EMPTY", "ARROW_PARAMETERS_PAREN_BEFORE", "ARROW_PARAMETERS_PAREN_AFTER", "ARROW_PARAMETERS_PAREN_EMPTY", "ARROW_BODY_PAREN_BEFORE", "ARROW_BODY_PAREN_AFTER", "BEFORE_ARROW_ASYNC_PARAMS", "GETTER_PARAMS", "IF_PAREN_BEFORE", "IF_PAREN_AFTER", "EXPORT_PAREN_BEFORE", "EXPORT_PAREN_AFTER", "NEW_CALLEE_PAREN_BEFORE", "NEW_CALLEE_PAREN_AFTER", "NEW_PAREN_BEFORE", "NEW_PAREN_AFTER", "NEW_PAREN_EMPTY", "SETTER_PARAM_BEFORE", "SETTER_PARAM_AFTER", "SWITCH_DISCRIM_PAREN_BEFORE", "SWITCH_DISCRIM_PAREN_AFTER", "WHILE_TEST_PAREN_BEFORE", "WHILE_TEST_PAREN_AFTER", "WITH_PAREN_BEFORE", "WITH_PAREN_AFTER", "OBJECT_BRACE_INITIAL", "OBJECT_BRACE_FINAL", "OBJECT_EMPTY", "BLOCK_BRACE_INITIAL", "BLOCK_BRACE_FINAL", "BLOCK_EMPTY", "CLASS_BRACE_INITIAL", "CLASS_BRACE_FINAL", "CLASS_EMPTY", "CLASS_EXPRESSION_BRACE_INITIAL", "CLASS_EXPRESSION_BRACE_FINAL", "CLASS_EXPRESSION_BRACE_EMPTY", "FUNCTION_BRACE_INITIAL", "FUNCTION_BRACE_FINAL", "FUNCTION_EMPTY", "FUNCTION_EXPRESSION_BRACE_INITIAL", "FUNCTION_EXPRESSION_BRACE_FINAL", "FUNCTION_EXPRESSION_EMPTY", "ARROW_BRACE_INITIAL", "ARROW_BRACE_FINAL", "ARROW_BRACE_EMPTY", "GET_BRACE_INTIAL", "GET_BRACE_FINAL", "GET_BRACE_EMPTY", "MISSING_ELSE_INTIIAL", "MISSING_ELSE_FINAL", "MISSING_ELSE_EMPTY", "IMPORT_BRACE_INTIAL", "IMPORT_BRACE_FINAL", "IMPORT_BRACE_EMPTY", "EXPORT_BRACE_INITIAL", "EXPORT_BRACE_FINAL", "EXPORT_BRACE_EMPTY", "METHOD_BRACE_INTIAL", "METHOD_BRACE_FINAL", "METHOD_BRACE_EMPTY", "SET_BRACE_INTIIAL", "SET_BRACE_FINAL", "SET_BRACE_EMPTY", "SWITCH_BRACE_INTIAL", "SWITCH_BRACE_FINAL", "SWITCH_BRACE_EMPTY", "ARRAY_INITIAL", "ARRAY_FINAL", "COMPUTED_MEMBER_BRACKET_INTIAL", "COMPUTED_MEMBER_BRACKET_FINAL", "COMPUTED_MEMBER_ASSIGNMENT_TARGET_BRACKET_INTIAL", "COMPUTED_MEMBER_ASSIGNMENT_TARGET_BRACKET_FINAL", "COMPUTED_PROPERTY_BRACKET_INTIAL", "COMPUTED_PROPERTY_BRACKET_FINAL"]; -for (var i = 0; i < separatorNames.length; ++i) { - Sep[separatorNames[i]] = { type: separatorNames[i] }; -} -Sep.BEFORE_ASSIGN_OP = function(op) { - return { - type: "BEFORE_ASSIGN_OP", - op - }; -}; -Sep.AFTER_ASSIGN_OP = function(op) { - return { - type: "AFTER_ASSIGN_OP", - op - }; -}; -Sep.BEFORE_BINOP = function(op) { - return { - type: "BEFORE_BINOP", - op - }; -}; -Sep.AFTER_BINOP = function(op) { - return { - type: "AFTER_BINOP", - op - }; -}; -Sep.BEFORE_POSTFIX = function(op) { - return { - type: "BEFORE_POSTFIX", - op - }; -}; -Sep.UNARY = function(op) { - return { - type: "UNARY", - op - }; -}; -Sep.AFTER_STATEMENT = function(node) { - return { - type: "AFTER_STATEMENT", - node - }; -}; -Sep.BEFORE_FUNCTION_NAME = function(node) { - return { - type: "BEFORE_FUNCTION_NAME", - node - }; -}; -var Sep_1 = formattedCodegen$1.Sep = Sep; -var ExtensibleCodeGen = ExtensibleCodeGen_1 = formattedCodegen$1.ExtensibleCodeGen = function() { - function ExtensibleCodeGen2() { - _classCallCheck$2(this, ExtensibleCodeGen2); - } - _createClass$2(ExtensibleCodeGen2, [{ - key: "parenToAvoidBeingDirective", - value: function parenToAvoidBeingDirective(element, original) { - if (element && element.type === "ExpressionStatement" && element.expression.type === "LiteralStringExpression") { - return seq(this.paren(original.children[0], Sep.PAREN_AVOIDING_DIRECTIVE_BEFORE, Sep.PAREN_AVOIDING_DIRECTIVE_AFTER), this.semiOp()); - } - return original; - } - }, { - key: "t", - value: function t2(token) { - var isRegExp = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; - return new _coderep.Token(token, isRegExp); - } - }, { - key: "p", - value: function p2(node, precedence, a) { - return (0, _coderep.getPrecedence)(node) < precedence ? this.paren(a, Sep.PRECEDENCE_BEFORE, Sep.PRECEDENCE_AFTER) : a; - } - }, { - key: "getAssignmentExpr", - value: function getAssignmentExpr2(state) { - return state ? state.containsGroup ? this.paren(state, Sep.EXPRESSION_PAREN_BEFORE, Sep.EXPRESSION_PAREN_AFTER) : state : empty(); - } - }, { - key: "paren", - value: function paren2(rep, first, last, emptySep) { - if (isEmpty(rep)) { - return new _coderep.Paren(this.sep(emptySep)); - } - return new _coderep.Paren(seq(first ? this.sep(first) : empty(), rep, last ? this.sep(last) : empty())); - } - }, { - key: "brace", - value: function brace2(rep, node, first, last, emptySep) { - if (isEmpty(rep)) { - return new _coderep.Brace(this.sep(emptySep)); - } - return new _coderep.Brace(seq(this.sep(first), rep, this.sep(last))); - } - }, { - key: "bracket", - value: function bracket2(rep, first, last, emptySep) { - if (isEmpty(rep)) { - return new _coderep.Bracket(this.sep(emptySep)); - } - return new _coderep.Bracket(seq(this.sep(first), rep, this.sep(last))); - } - }, { - key: "commaSep", - value: function commaSep2(pieces, before, after) { - var _this2 = this; - var first = true; - pieces = pieces.map(function(p2) { - if (first) { - first = false; - return p2; - } - return seq(_this2.sep(before), _this2.t(","), _this2.sep(after), p2); - }); - return seq.apply(void 0, _toConsumableArray$1(pieces)); - } - }, { - key: "semiOp", - value: function semiOp2() { - return new _coderep.SemiOp(); - } - }, { - key: "sep", - value: function sep() { - return empty(); - } - }, { - key: "reduceArrayExpression", - value: function reduceArrayExpression(node, _ref) { - var _this3 = this; - var elements = _ref.elements; - if (elements.length === 0) { - return this.bracket(empty(), null, null, Sep.ARRAY_EMPTY); - } - var content = this.commaSep(elements.map(function(e) { - return _this3.getAssignmentExpr(e); - }), Sep.ARRAY_BEFORE_COMMA, Sep.ARRAY_AFTER_COMMA); - if (elements.length > 0 && elements[elements.length - 1] == null) { - content = seq(content, this.sep(Sep.ARRAY_BEFORE_COMMA), this.t(","), this.sep(Sep.ARRAY_AFTER_COMMA)); - } - return this.bracket(content, Sep.ARRAY_INITIAL, Sep.ARRAY_FINAL); - } - }, { - key: "reduceAwaitExpression", - value: function reduceAwaitExpression(node, _ref2) { - var expression = _ref2.expression; - return seq(this.t("await"), this.sep(Sep.AWAIT), this.p(node.expression, (0, _coderep.getPrecedence)(node), expression)); - } - }, { - key: "reduceSpreadElement", - value: function reduceSpreadElement(node, _ref3) { - var expression = _ref3.expression; - return seq(this.t("..."), this.sep(Sep.SPREAD), this.p(node.expression, _coderep.Precedence.Assignment, expression)); - } - }, { - key: "reduceSpreadProperty", - value: function reduceSpreadProperty(node, _ref4) { - var expression = _ref4.expression; - return seq(this.t("..."), this.sep(Sep.SPREAD), this.getAssignmentExpr(expression)); - } - }, { - key: "reduceAssignmentExpression", - value: function reduceAssignmentExpression(node, _ref5) { - var binding = _ref5.binding, expression = _ref5.expression; - var leftCode = binding; - var rightCode = expression; - var containsIn = expression.containsIn; - var startsWithCurly = binding.startsWithCurly; - var startsWithLetSquareBracket = binding.startsWithLetSquareBracket; - var startsWithFunctionOrClass = binding.startsWithFunctionOrClass; - if ((0, _coderep.getPrecedence)(node.expression) < (0, _coderep.getPrecedence)(node)) { - rightCode = this.paren(rightCode, Sep.EXPRESSION_PAREN_BEFORE, Sep.EXPRESSION_PAREN_AFTER); - containsIn = false; - } - return (0, _objectAssign2.default)(seq(leftCode, this.sep(Sep.BEFORE_ASSIGN_OP("=")), this.t("="), this.sep(Sep.AFTER_ASSIGN_OP("=")), rightCode), { containsIn, startsWithCurly, startsWithLetSquareBracket, startsWithFunctionOrClass }); - } - }, { - key: "reduceAssignmentTargetIdentifier", - value: function reduceAssignmentTargetIdentifier(node) { - var a = this.t(node.name); - if (node.name === "let") { - a.startsWithLet = true; - } - return a; - } - }, { - key: "reduceAssignmentTargetWithDefault", - value: function reduceAssignmentTargetWithDefault(node, _ref6) { - var binding = _ref6.binding, init = _ref6.init; - return seq(binding, this.sep(Sep.BEFORE_DEFAULT_EQUALS), this.t("="), this.sep(Sep.AFTER_DEFAULT_EQUALS), this.p(node.init, _coderep.Precedence.Assignment, init)); - } - }, { - key: "reduceCompoundAssignmentExpression", - value: function reduceCompoundAssignmentExpression(node, _ref7) { - var binding = _ref7.binding, expression = _ref7.expression; - var leftCode = binding; - var rightCode = expression; - var containsIn = expression.containsIn; - var startsWithCurly = binding.startsWithCurly; - var startsWithLetSquareBracket = binding.startsWithLetSquareBracket; - var startsWithFunctionOrClass = binding.startsWithFunctionOrClass; - if ((0, _coderep.getPrecedence)(node.expression) < (0, _coderep.getPrecedence)(node)) { - rightCode = this.paren(rightCode, Sep.EXPRESSION_PAREN_BEFORE, Sep.EXPRESSION_PAREN_AFTER); - containsIn = false; - } - return (0, _objectAssign2.default)(seq(leftCode, this.sep(Sep.BEFORE_ASSIGN_OP(node.operator)), this.t(node.operator), this.sep(Sep.AFTER_ASSIGN_OP(node.operator)), rightCode), { containsIn, startsWithCurly, startsWithLetSquareBracket, startsWithFunctionOrClass }); - } - }, { - key: "reduceBinaryExpression", - value: function reduceBinaryExpression(node, _ref8) { - var left = _ref8.left, right = _ref8.right; - var leftCode = left; - var startsWithCurly = left.startsWithCurly; - var startsWithLetSquareBracket = left.startsWithLetSquareBracket; - var startsWithFunctionOrClass = left.startsWithFunctionOrClass; - var leftContainsIn = left.containsIn; - var isRightAssociative = node.operator === "**"; - if ((0, _coderep.getPrecedence)(node.left) < (0, _coderep.getPrecedence)(node) || isRightAssociative && ((0, _coderep.getPrecedence)(node.left) === (0, _coderep.getPrecedence)(node) || node.left.type === "UnaryExpression")) { - leftCode = this.paren(leftCode, Sep.EXPRESSION_PAREN_BEFORE, Sep.EXPRESSION_PAREN_AFTER); - startsWithCurly = false; - startsWithLetSquareBracket = false; - startsWithFunctionOrClass = false; - leftContainsIn = false; - } - var rightCode = right; - var rightContainsIn = right.containsIn; - if ((0, _coderep.getPrecedence)(node.right) < (0, _coderep.getPrecedence)(node) || !isRightAssociative && (0, _coderep.getPrecedence)(node.right) === (0, _coderep.getPrecedence)(node)) { - rightCode = this.paren(rightCode, Sep.EXPRESSION_PAREN_BEFORE, Sep.EXPRESSION_PAREN_AFTER); - rightContainsIn = false; - } - return (0, _objectAssign2.default)(seq(leftCode, this.sep(Sep.BEFORE_BINOP(node.operator)), this.t(node.operator), this.sep(Sep.AFTER_BINOP(node.operator)), rightCode), { - containsIn: leftContainsIn || rightContainsIn || node.operator === "in", - containsGroup: node.operator === ",", - startsWithCurly, - startsWithLetSquareBracket, - startsWithFunctionOrClass - }); - } - }, { - key: "reduceBindingWithDefault", - value: function reduceBindingWithDefault(node, _ref9) { - var binding = _ref9.binding, init = _ref9.init; - return seq(binding, this.sep(Sep.BEFORE_DEFAULT_EQUALS), this.t("="), this.sep(Sep.AFTER_DEFAULT_EQUALS), this.p(node.init, _coderep.Precedence.Assignment, init)); - } - }, { - key: "reduceBindingIdentifier", - value: function reduceBindingIdentifier(node) { - var a = this.t(node.name); - if (node.name === "let") { - a.startsWithLet = true; - } - return a; - } - }, { - key: "reduceArrayAssignmentTarget", - value: function reduceArrayAssignmentTarget(node, _ref10) { - var _this4 = this; - var elements = _ref10.elements, rest = _ref10.rest; - var content = void 0; - if (elements.length === 0) { - content = rest == null ? empty() : seq(this.t("..."), this.sep(Sep.REST), rest); - } else { - elements = elements.concat(rest == null ? [] : [seq(this.t("..."), this.sep(Sep.REST), rest)]); - content = this.commaSep(elements.map(function(e) { - return _this4.getAssignmentExpr(e); - }), Sep.ARRAY_BEFORE_COMMA, Sep.ARRAY_AFTER_COMMA); - if (elements.length > 0 && elements[elements.length - 1] == null) { - content = seq(content, this.sep(Sep.ARRAY_BEFORE_COMMA), this.t(","), this.sep(Sep.ARRAY_AFTER_COMMA)); - } - } - return this.bracket(content, Sep.ARRAY_INITIAL, Sep.ARRAY_FINAL, Sep.ARRAY_EMPTY); - } - }, { - key: "reduceArrayBinding", - value: function reduceArrayBinding(node, _ref11) { - var _this5 = this; - var elements = _ref11.elements, rest = _ref11.rest; - var content = void 0; - if (elements.length === 0) { - content = rest == null ? empty() : seq(this.t("..."), this.sep(Sep.REST), rest); - } else { - elements = elements.concat(rest == null ? [] : [seq(this.t("..."), this.sep(Sep.REST), rest)]); - content = this.commaSep(elements.map(function(e) { - return _this5.getAssignmentExpr(e); - }), Sep.ARRAY_BEFORE_COMMA, Sep.ARRAY_AFTER_COMMA); - if (elements.length > 0 && elements[elements.length - 1] == null) { - content = seq(content, this.sep(Sep.ARRAY_BEFORE_COMMA), this.t(","), this.sep(Sep.ARRAY_AFTER_COMMA)); - } - } - return this.bracket(content, Sep.ARRAY_INITIAL, Sep.ARRAY_FINAL, Sep.ARRAY_EMPTY); - } - }, { - key: "reduceObjectAssignmentTarget", - value: function reduceObjectAssignmentTarget(node, _ref12) { - var properties = _ref12.properties, rest = _ref12.rest; - var content = void 0; - if (properties.length === 0) { - content = rest == null ? empty() : seq(this.t("..."), this.sep(Sep.REST), rest); - } else { - content = this.commaSep(properties, Sep.OBJECT_BEFORE_COMMA, Sep.OBJECT_AFTER_COMMA); - content = rest == null ? content : this.commaSep([content, seq(this.t("..."), this.sep(Sep.REST), rest)], Sep.OBJECT_BEFORE_COMMA, Sep.OBJECT_AFTER_COMMA); - } - var state = this.brace(content, node, Sep.OBJECT_BRACE_INITIAL, Sep.OBJECT_BRACE_FINAL, Sep.OBJECT_EMPTY); - state.startsWithCurly = true; - return state; - } - }, { - key: "reduceObjectBinding", - value: function reduceObjectBinding(node, _ref13) { - var properties = _ref13.properties, rest = _ref13.rest; - var content = void 0; - if (properties.length === 0) { - content = rest == null ? empty() : seq(this.t("..."), this.sep(Sep.REST), rest); - } else { - content = this.commaSep(properties, Sep.OBJECT_BEFORE_COMMA, Sep.OBJECT_AFTER_COMMA); - content = rest == null ? content : this.commaSep([content, seq(this.t("..."), this.sep(Sep.REST), rest)], Sep.OBJECT_BEFORE_COMMA, Sep.OBJECT_AFTER_COMMA); - } - var state = this.brace(content, node, Sep.OBJECT_BRACE_INITIAL, Sep.OBJECT_BRACE_FINAL, Sep.OBJECT_EMPTY); - state.startsWithCurly = true; - return state; - } - }, { - key: "reduceAssignmentTargetPropertyIdentifier", - value: function reduceAssignmentTargetPropertyIdentifier(node, _ref14) { - var binding = _ref14.binding, init = _ref14.init; - if (node.init == null) - return binding; - return seq(binding, this.sep(Sep.BEFORE_DEFAULT_EQUALS), this.t("="), this.sep(Sep.AFTER_DEFAULT_EQUALS), this.p(node.init, _coderep.Precedence.Assignment, init)); - } - }, { - key: "reduceAssignmentTargetPropertyProperty", - value: function reduceAssignmentTargetPropertyProperty(node, _ref15) { - var name = _ref15.name, binding = _ref15.binding; - return seq(name, this.sep(Sep.BEFORE_PROP), this.t(":"), this.sep(Sep.AFTER_PROP), binding); - } - }, { - key: "reduceBindingPropertyIdentifier", - value: function reduceBindingPropertyIdentifier(node, _ref16) { - var binding = _ref16.binding, init = _ref16.init; - if (node.init == null) - return binding; - return seq(binding, this.sep(Sep.BEFORE_DEFAULT_EQUALS), this.t("="), this.sep(Sep.AFTER_DEFAULT_EQUALS), this.p(node.init, _coderep.Precedence.Assignment, init)); - } - }, { - key: "reduceBindingPropertyProperty", - value: function reduceBindingPropertyProperty(node, _ref17) { - var name = _ref17.name, binding = _ref17.binding; - return seq(name, this.sep(Sep.BEFORE_PROP), this.t(":"), this.sep(Sep.AFTER_PROP), binding); - } - }, { - key: "reduceBlock", - value: function reduceBlock(node, _ref18) { - var statements = _ref18.statements; - return this.brace(seq.apply(void 0, _toConsumableArray$1(statements)), node, Sep.BLOCK_BRACE_INITIAL, Sep.BLOCK_BRACE_FINAL, Sep.BLOCK_EMPTY); - } - }, { - key: "reduceBlockStatement", - value: function reduceBlockStatement(node, _ref19) { - var block = _ref19.block; - return seq(block, this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: "reduceBreakStatement", - value: function reduceBreakStatement(node) { - return seq(this.t("break"), node.label ? seq(this.sep(Sep.BEFORE_JUMP_LABEL), this.t(node.label)) : empty(), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: "reduceCallExpression", - value: function reduceCallExpression(node, _ref20) { - var _this6 = this; - var callee = _ref20.callee, args = _ref20.arguments; - var parenthizedArgs = args.map(function(a, i2) { - return _this6.p(node.arguments[i2], _coderep.Precedence.Assignment, a); - }); - return (0, _objectAssign2.default)(seq(this.p(node.callee, (0, _coderep.getPrecedence)(node), callee), this.sep(Sep.CALL), this.paren(this.commaSep(parenthizedArgs, Sep.ARGS_BEFORE_COMMA, Sep.ARGS_AFTER_COMMA), Sep.CALL_PAREN_BEFORE, Sep.CALL_PAREN_AFTER, Sep.CALL_PAREN_EMPTY)), { - startsWithCurly: callee.startsWithCurly, - startsWithLet: callee.startsWithLet, - startsWithLetSquareBracket: callee.startsWithLetSquareBracket, - startsWithFunctionOrClass: callee.startsWithFunctionOrClass - }); - } - }, { - key: "reduceCatchClause", - value: function reduceCatchClause(node, _ref21) { - var binding = _ref21.binding, body = _ref21.body; - return seq(this.t("catch"), this.sep(Sep.BEFORE_CATCH_BINDING), this.paren(binding, Sep.CATCH_PAREN_BEFORE, Sep.CATCH_PAREN_AFTER), this.sep(Sep.AFTER_CATCH_BINDING), body); - } - }, { - key: "reduceClassDeclaration", - value: function reduceClassDeclaration(node, _ref22) { - var name = _ref22.name, _super = _ref22.super, elements = _ref22.elements; - var state = seq(this.t("class"), node.name.name === "*default*" ? empty() : seq(this.sep(Sep.BEFORE_CLASS_NAME), name)); - if (_super != null) { - state = seq(state, this.sep(Sep.BEFORE_EXTENDS), this.t("extends"), this.sep(Sep.AFTER_EXTENDS), this.p(node.super, _coderep.Precedence.New, _super)); - } - state = seq(state, this.sep(Sep.BEFORE_CLASS_DECLARATION_ELEMENTS), this.brace(seq.apply(void 0, _toConsumableArray$1(elements)), node, Sep.CLASS_BRACE_INITIAL, Sep.CLASS_BRACE_FINAL, Sep.CLASS_EMPTY), this.sep(Sep.AFTER_STATEMENT(node))); - return state; - } - }, { - key: "reduceClassExpression", - value: function reduceClassExpression(node, _ref23) { - var name = _ref23.name, _super = _ref23.super, elements = _ref23.elements; - var state = this.t("class"); - if (name != null) { - state = seq(state, this.sep(Sep.BEFORE_CLASS_NAME), name); - } - if (_super != null) { - state = seq(state, this.sep(Sep.BEFORE_EXTENDS), this.t("extends"), this.sep(Sep.AFTER_EXTENDS), this.p(node.super, _coderep.Precedence.New, _super)); - } - state = seq(state, this.sep(Sep.BEFORE_CLASS_EXPRESSION_ELEMENTS), this.brace(seq.apply(void 0, _toConsumableArray$1(elements)), node, Sep.CLASS_EXPRESSION_BRACE_INITIAL, Sep.CLASS_EXPRESSION_BRACE_FINAL, Sep.CLASS_EXPRESSION_BRACE_EMPTY)); - state.startsWithFunctionOrClass = true; - return state; - } - }, { - key: "reduceClassElement", - value: function reduceClassElement(node, _ref24) { - var method = _ref24.method; - method = seq(this.sep(Sep.BEFORE_CLASS_ELEMENT), method, this.sep(Sep.AFTER_CLASS_ELEMENT)); - if (!node.isStatic) - return method; - return seq(this.t("static"), this.sep(Sep.AFTER_STATIC), method); - } - }, { - key: "reduceComputedMemberAssignmentTarget", - value: function reduceComputedMemberAssignmentTarget(node, _ref25) { - var object = _ref25.object, expression = _ref25.expression; - var startsWithLetSquareBracket = object.startsWithLetSquareBracket || node.object.type === "IdentifierExpression" && node.object.name === "let"; - return (0, _objectAssign2.default)(seq(this.p(node.object, (0, _coderep.getPrecedence)(node), object), this.sep(Sep.COMPUTED_MEMBER_ASSIGNMENT_TARGET), this.bracket(expression, Sep.COMPUTED_MEMBER_ASSIGNMENT_TARGET_BRACKET_INTIAL, Sep.COMPUTED_MEMBER_ASSIGNMENT_TARGET_BRACKET_FINAL)), { - startsWithLet: object.startsWithLet, - startsWithLetSquareBracket, - startsWithCurly: object.startsWithCurly, - startsWithFunctionOrClass: object.startsWithFunctionOrClass - }); - } - }, { - key: "reduceComputedMemberExpression", - value: function reduceComputedMemberExpression(node, _ref26) { - var object = _ref26.object, expression = _ref26.expression; - var startsWithLetSquareBracket = object.startsWithLetSquareBracket || node.object.type === "IdentifierExpression" && node.object.name === "let"; - return (0, _objectAssign2.default)(seq(this.p(node.object, (0, _coderep.getPrecedence)(node), object), this.sep(Sep.COMPUTED_MEMBER_EXPRESSION), this.bracket(expression, Sep.COMPUTED_MEMBER_BRACKET_INTIAL, Sep.COMPUTED_MEMBER_BRACKET_FINAL)), { - startsWithLet: object.startsWithLet, - startsWithLetSquareBracket, - startsWithCurly: object.startsWithCurly, - startsWithFunctionOrClass: object.startsWithFunctionOrClass - }); - } - }, { - key: "reduceComputedPropertyName", - value: function reduceComputedPropertyName(node, _ref27) { - var expression = _ref27.expression; - return this.bracket(this.p(node.expression, _coderep.Precedence.Assignment, expression), Sep.COMPUTED_PROPERTY_BRACKET_INTIAL, Sep.COMPUTED_PROPERTY_BRACKET_FINAL); - } - }, { - key: "reduceConditionalExpression", - value: function reduceConditionalExpression(node, _ref28) { - var test = _ref28.test, consequent = _ref28.consequent, alternate = _ref28.alternate; - var containsIn = test.containsIn || alternate.containsIn; - var startsWithCurly = test.startsWithCurly; - var startsWithLetSquareBracket = test.startsWithLetSquareBracket; - var startsWithFunctionOrClass = test.startsWithFunctionOrClass; - return (0, _objectAssign2.default)(seq(this.p(node.test, _coderep.Precedence.LogicalOR, test), this.sep(Sep.BEFORE_TERNARY_QUESTION), this.t("?"), this.sep(Sep.AFTER_TERNARY_QUESTION), this.p(node.consequent, _coderep.Precedence.Assignment, consequent), this.sep(Sep.BEFORE_TERNARY_COLON), this.t(":"), this.sep(Sep.AFTER_TERNARY_COLON), this.p(node.alternate, _coderep.Precedence.Assignment, alternate)), { - containsIn, - startsWithCurly, - startsWithLetSquareBracket, - startsWithFunctionOrClass - }); - } - }, { - key: "reduceContinueStatement", - value: function reduceContinueStatement(node) { - return seq(this.t("continue"), node.label ? seq(this.sep(Sep.BEFORE_JUMP_LABEL), this.t(node.label)) : empty(), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: "reduceDataProperty", - value: function reduceDataProperty(node, _ref29) { - var name = _ref29.name, expression = _ref29.expression; - return seq(name, this.sep(Sep.BEFORE_PROP), this.t(":"), this.sep(Sep.AFTER_PROP), this.getAssignmentExpr(expression)); - } - }, { - key: "reduceDebuggerStatement", - value: function reduceDebuggerStatement(node) { - return seq(this.t("debugger"), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: "reduceDoWhileStatement", - value: function reduceDoWhileStatement(node, _ref30) { - var body = _ref30.body, test = _ref30.test; - return seq(this.t("do"), this.sep(Sep.AFTER_DO), body, this.sep(Sep.BEFORE_DOWHILE_WHILE), this.t("while"), this.sep(Sep.AFTER_DOWHILE_WHILE), this.paren(test, Sep.DO_WHILE_TEST_PAREN_BEFORE, Sep.DO_WHILE_TEST_PAREN_AFTER), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: "reduceEmptyStatement", - value: function reduceEmptyStatement(node) { - return seq(this.t(";"), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: "reduceExpressionStatement", - value: function reduceExpressionStatement(node, _ref31) { - var expression = _ref31.expression; - var needsParens = expression.startsWithCurly || expression.startsWithLetSquareBracket || expression.startsWithFunctionOrClass; - return seq(needsParens ? this.paren(expression, Sep.EXPRESSION_STATEMENT_PAREN_BEFORE, Sep.EXPRESSION_STATEMENT_PAREN_AFTER) : expression, this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: "reduceForInStatement", - value: function reduceForInStatement(node, _ref32) { - var left = _ref32.left, right = _ref32.right, body = _ref32.body; - left = node.left.type === "VariableDeclaration" ? noIn(markContainsIn(left)) : left; - return (0, _objectAssign2.default)(seq(this.t("for"), this.sep(Sep.AFTER_FORIN_FOR), this.paren(seq(left.startsWithLet ? this.paren(left, Sep.FOR_IN_LET_PAREN_BEFORE, Sep.FOR_IN_LET_PAREN_AFTER) : left, this.sep(Sep.BEFORE_FORIN_IN), this.t("in"), this.sep(Sep.AFTER_FORIN_FOR), right), Sep.FOR_IN_PAREN_BEFORE, Sep.FOR_IN_PAREN_AFTER), this.sep(Sep.BEFORE_FORIN_BODY), body, this.sep(Sep.AFTER_STATEMENT(node))), { endsWithMissingElse: body.endsWithMissingElse }); - } - }, { - key: "reduceForOfStatement", - value: function reduceForOfStatement(node, _ref33) { - var left = _ref33.left, right = _ref33.right, body = _ref33.body; - left = node.left.type === "VariableDeclaration" ? noIn(markContainsIn(left)) : left; - return (0, _objectAssign2.default)(seq(this.t("for"), this.sep(Sep.AFTER_FOROF_FOR), this.paren(seq(left.startsWithLet ? this.paren(left, Sep.FOR_OF_LET_PAREN_BEFORE, Sep.FOR_OF_LET_PAREN_AFTER) : left, this.sep(Sep.BEFORE_FOROF_OF), this.t("of"), this.sep(Sep.AFTER_FOROF_FOR), this.p(node.right, _coderep.Precedence.Assignment, right)), Sep.FOR_OF_PAREN_BEFORE, Sep.FOR_OF_PAREN_AFTER), this.sep(Sep.BEFORE_FOROF_BODY), body, this.sep(Sep.AFTER_STATEMENT(node))), { endsWithMissingElse: body.endsWithMissingElse }); - } - }, { - key: "reduceForStatement", - value: function reduceForStatement(node, _ref34) { - var init = _ref34.init, test = _ref34.test, update = _ref34.update, body = _ref34.body; - if (init) { - if (init.startsWithLetSquareBracket) { - init = this.paren(init, Sep.FOR_LET_PAREN_BEFORE, Sep.FOR_LET_PAREN_AFTER); - } - init = noIn(markContainsIn(init)); - } - return (0, _objectAssign2.default)(seq(this.t("for"), this.sep(Sep.AFTER_FOR_FOR), this.paren(seq(init ? seq(this.sep(Sep.BEFORE_FOR_INIT), init, this.sep(Sep.AFTER_FOR_INIT)) : this.sep(Sep.EMPTY_FOR_INIT), this.t(";"), test ? seq(this.sep(Sep.BEFORE_FOR_TEST), test, this.sep(Sep.AFTER_FOR_TEST)) : this.sep(Sep.EMPTY_FOR_TEST), this.t(";"), update ? seq(this.sep(Sep.BEFORE_FOR_UPDATE), update, this.sep(Sep.AFTER_FOR_UPDATE)) : this.sep(Sep.EMPTY_FOR_UPDATE))), this.sep(Sep.BEFORE_FOR_BODY), body, this.sep(Sep.AFTER_STATEMENT(node))), { - endsWithMissingElse: body.endsWithMissingElse - }); - } - }, { - key: "reduceForAwaitStatement", - value: function reduceForAwaitStatement(node, _ref35) { - var left = _ref35.left, right = _ref35.right, body = _ref35.body; - left = node.left.type === "VariableDeclaration" ? noIn(markContainsIn(left)) : left; - return (0, _objectAssign2.default)(seq(this.t("for"), this.sep(Sep.AFTER_FOROF_FOR), this.t("await"), this.sep(Sep.AFTER_FORAWAIT_AWAIT), this.paren(seq(left.startsWithLet ? this.paren(left, Sep.FOR_OF_LET_PAREN_BEFORE, Sep.FOR_OF_LET_PAREN_AFTER) : left, this.sep(Sep.BEFORE_FOROF_OF), this.t("of"), this.sep(Sep.AFTER_FOROF_FOR), this.p(node.right, _coderep.Precedence.Assignment, right)), Sep.FOR_OF_PAREN_BEFORE, Sep.FOR_OF_PAREN_AFTER), this.sep(Sep.BEFORE_FOROF_BODY), body, this.sep(Sep.AFTER_STATEMENT(node))), { endsWithMissingElse: body.endsWithMissingElse }); - } - }, { - key: "reduceFunctionBody", - value: function reduceFunctionBody(node, _ref36) { - var directives = _ref36.directives, statements = _ref36.statements; - if (statements.length) { - statements[0] = this.parenToAvoidBeingDirective(node.statements[0], statements[0]); - } - return seq.apply(void 0, _toConsumableArray$1(directives).concat([directives.length ? this.sep(Sep.AFTER_FUNCTION_DIRECTIVES) : empty()], _toConsumableArray$1(statements))); - } - }, { - key: "reduceFunctionDeclaration", - value: function reduceFunctionDeclaration(node, _ref37) { - var name = _ref37.name, params = _ref37.params, body = _ref37.body; - return seq(node.isAsync ? this.t("async") : empty(), this.t("function"), node.isGenerator ? seq(this.sep(Sep.BEFORE_GENERATOR_STAR), this.t("*"), this.sep(Sep.AFTER_GENERATOR_STAR)) : empty(), this.sep(Sep.BEFORE_FUNCTION_NAME(node)), node.name.name === "*default*" ? empty() : name, this.sep(Sep.BEFORE_FUNCTION_PARAMS), this.paren(params, Sep.PARAMETERS_PAREN_BEFORE, Sep.PARAMETERS_PAREN_AFTER, Sep.PARAMETERS_PAREN_EMPTY), this.sep(Sep.BEFORE_FUNCTION_DECLARATION_BODY), this.brace(body, node, Sep.FUNCTION_BRACE_INITIAL, Sep.FUNCTION_BRACE_FINAL, Sep.FUNCTION_EMPTY), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: "reduceFunctionExpression", - value: function reduceFunctionExpression(node, _ref38) { - var name = _ref38.name, params = _ref38.params, body = _ref38.body; - var state = seq(node.isAsync ? this.t("async") : empty(), this.t("function"), node.isGenerator ? seq(this.sep(Sep.BEFORE_GENERATOR_STAR), this.t("*"), this.sep(Sep.AFTER_GENERATOR_STAR)) : empty(), this.sep(Sep.BEFORE_FUNCTION_NAME(node)), name ? name : empty(), this.sep(Sep.BEFORE_FUNCTION_PARAMS), this.paren(params, Sep.PARAMETERS_PAREN_BEFORE, Sep.PARAMETERS_PAREN_AFTER, Sep.PARAMETERS_PAREN_EMPTY), this.sep(Sep.BEFORE_FUNCTION_EXPRESSION_BODY), this.brace(body, node, Sep.FUNCTION_EXPRESSION_BRACE_INITIAL, Sep.FUNCTION_EXPRESSION_BRACE_FINAL, Sep.FUNCTION_EXPRESSION_EMPTY)); - state.startsWithFunctionOrClass = true; - return state; - } - }, { - key: "reduceFormalParameters", - value: function reduceFormalParameters(node, _ref39) { - var items = _ref39.items, rest = _ref39.rest; - return this.commaSep(items.concat(rest == null ? [] : [seq(this.t("..."), this.sep(Sep.REST), rest)]), Sep.PARAMETER_BEFORE_COMMA, Sep.PARAMETER_AFTER_COMMA); - } - }, { - key: "reduceArrowExpression", - value: function reduceArrowExpression(node, _ref40) { - var params = _ref40.params, body = _ref40.body; - if (node.params.rest != null || node.params.items.length !== 1 || node.params.items[0].type !== "BindingIdentifier") { - params = this.paren(params, Sep.ARROW_PARAMETERS_PAREN_BEFORE, Sep.ARROW_PARAMETERS_PAREN_AFTER, Sep.ARROW_PARAMETERS_PAREN_EMPTY); - } - var containsIn = false; - if (node.body.type === "FunctionBody") { - body = this.brace(body, node, Sep.ARROW_BRACE_INITIAL, Sep.ARROW_BRACE_FINAL, Sep.ARROW_BRACE_EMPTY); - } else if (body.startsWithCurly) { - body = this.paren(body, Sep.ARROW_BODY_PAREN_BEFORE, Sep.ARROW_BODY_PAREN_AFTER); - } else if (body.containsIn) { - containsIn = true; - } - return (0, _objectAssign2.default)(seq(node.isAsync ? seq(this.t("async"), this.sep(Sep.BEFORE_ARROW_ASYNC_PARAMS)) : empty(), params, this.sep(Sep.BEFORE_ARROW), this.t("=>"), this.sep(Sep.AFTER_ARROW), this.p(node.body, _coderep.Precedence.Assignment, body)), { containsIn }); - } - }, { - key: "reduceGetter", - value: function reduceGetter(node, _ref41) { - var name = _ref41.name, body = _ref41.body; - return seq(this.t("get"), this.sep(Sep.AFTER_GET), name, this.sep(Sep.BEFORE_GET_PARAMS), this.paren(empty(), null, null, Sep.GETTER_PARAMS), this.sep(Sep.BEFORE_GET_BODY), this.brace(body, node, Sep.GET_BRACE_INTIAL, Sep.GET_BRACE_FINAL, Sep.GET_BRACE_EMPTY)); - } - }, { - key: "reduceIdentifierExpression", - value: function reduceIdentifierExpression(node) { - var a = this.t(node.name); - if (node.name === "let") { - a.startsWithLet = true; - } - return a; - } - }, { - key: "reduceIfStatement", - value: function reduceIfStatement(node, _ref42) { - var test = _ref42.test, consequent = _ref42.consequent, alternate = _ref42.alternate; - if (alternate && consequent.endsWithMissingElse) { - consequent = this.brace(consequent, node, Sep.MISSING_ELSE_INTIIAL, Sep.MISSING_ELSE_FINAL, Sep.MISSING_ELSE_EMPTY); - } - return (0, _objectAssign2.default)(seq(this.t("if"), this.sep(Sep.AFTER_IF), this.paren(test, Sep.IF_PAREN_BEFORE, Sep.IF_PAREN_AFTER), this.sep(Sep.AFTER_IF_TEST), consequent, alternate ? seq(this.sep(Sep.BEFORE_ELSE), this.t("else"), this.sep(Sep.AFTER_ELSE), alternate) : empty(), this.sep(Sep.AFTER_STATEMENT(node))), { endsWithMissingElse: alternate ? alternate.endsWithMissingElse : true }); - } - }, { - key: "reduceImport", - value: function reduceImport(node, _ref43) { - var defaultBinding = _ref43.defaultBinding, namedImports = _ref43.namedImports; - var bindings = []; - if (defaultBinding != null) { - bindings.push(defaultBinding); - } - if (namedImports.length > 0) { - bindings.push(this.brace(this.commaSep(namedImports, Sep.NAMED_IMPORT_BEFORE_COMMA, Sep.NAMED_IMPORT_AFTER_COMMA), node, Sep.IMPORT_BRACE_INTIAL, Sep.IMPORT_BRACE_FINAL, Sep.IMPORT_BRACE_EMPTY)); - } - if (bindings.length === 0) { - return seq(this.t("import"), this.sep(Sep.BEFORE_IMPORT_MODULE), this.t((0, _coderep.escapeStringLiteral)(node.moduleSpecifier)), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - return seq(this.t("import"), this.sep(Sep.BEFORE_IMPORT_BINDINGS), this.commaSep(bindings, Sep.IMPORT_BEFORE_COMMA, Sep.IMPORT_AFTER_COMMA), this.sep(Sep.AFTER_IMPORT_BINDINGS), this.t("from"), this.sep(Sep.AFTER_FROM), this.t((0, _coderep.escapeStringLiteral)(node.moduleSpecifier)), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: "reduceImportNamespace", - value: function reduceImportNamespace(node, _ref44) { - var defaultBinding = _ref44.defaultBinding, namespaceBinding = _ref44.namespaceBinding; - return seq(this.t("import"), this.sep(Sep.BEFORE_IMPORT_NAMESPACE), defaultBinding == null ? empty() : seq(defaultBinding, this.sep(Sep.IMPORT_BEFORE_COMMA), this.t(","), this.sep(Sep.IMPORT_AFTER_COMMA)), this.sep(Sep.BEFORE_IMPORT_STAR), this.t("*"), this.sep(Sep.AFTER_IMPORT_STAR), this.t("as"), this.sep(Sep.AFTER_IMPORT_AS), namespaceBinding, this.sep(Sep.AFTER_NAMESPACE_BINDING), this.t("from"), this.sep(Sep.AFTER_FROM), this.t((0, _coderep.escapeStringLiteral)(node.moduleSpecifier)), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: "reduceImportSpecifier", - value: function reduceImportSpecifier(node, _ref45) { - var binding = _ref45.binding; - if (node.name == null) - return binding; - return seq(this.t(node.name), this.sep(Sep.BEFORE_IMPORT_AS), this.t("as"), this.sep(Sep.AFTER_IMPORT_AS), binding); - } - }, { - key: "reduceExportAllFrom", - value: function reduceExportAllFrom(node) { - return seq(this.t("export"), this.sep(Sep.BEFORE_EXPORT_STAR), this.t("*"), this.sep(Sep.AFTER_EXPORT_STAR), this.t("from"), this.sep(Sep.AFTER_FROM), this.t((0, _coderep.escapeStringLiteral)(node.moduleSpecifier)), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: "reduceExportFrom", - value: function reduceExportFrom(node, _ref46) { - var namedExports = _ref46.namedExports; - return seq(this.t("export"), this.sep(Sep.BEFORE_EXPORT_BINDINGS), this.brace(this.commaSep(namedExports, Sep.EXPORTS_BEFORE_COMMA, Sep.EXPORTS_AFTER_COMMA), node, Sep.EXPORT_BRACE_INITIAL, Sep.EXPORT_BRACE_FINAL, Sep.EXPORT_BRACE_EMPTY), this.sep(Sep.AFTER_EXPORT_FROM_BINDINGS), this.t("from"), this.sep(Sep.AFTER_FROM), this.t((0, _coderep.escapeStringLiteral)(node.moduleSpecifier)), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: "reduceExportLocals", - value: function reduceExportLocals(node, _ref47) { - var namedExports = _ref47.namedExports; - return seq(this.t("export"), this.sep(Sep.BEFORE_EXPORT_BINDINGS), this.brace(this.commaSep(namedExports, Sep.EXPORTS_BEFORE_COMMA, Sep.EXPORTS_AFTER_COMMA), node, Sep.EXPORT_BRACE_INITIAL, Sep.EXPORT_BRACE_FINAL, Sep.EXPORT_BRACE_EMPTY), this.sep(Sep.AFTER_EXPORT_LOCAL_BINDINGS), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: "reduceExport", - value: function reduceExport(node, _ref48) { - var declaration = _ref48.declaration; - switch (node.declaration.type) { - case "FunctionDeclaration": - case "ClassDeclaration": - break; - default: - declaration = seq(declaration, this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - return seq(this.t("export"), this.sep(Sep.AFTER_EXPORT), declaration); - } - }, { - key: "reduceExportDefault", - value: function reduceExportDefault(node, _ref49) { - var body = _ref49.body; - body = body.startsWithFunctionOrClass ? this.paren(body, Sep.EXPORT_PAREN_BEFORE, Sep.EXPORT_PAREN_AFTER) : body; - switch (node.body.type) { - case "FunctionDeclaration": - case "ClassDeclaration": - return seq(this.t("export"), this.sep(Sep.EXPORT_DEFAULT), this.t("default"), this.sep(Sep.AFTER_EXPORT_DEFAULT), body); - default: - return seq(this.t("export"), this.sep(Sep.EXPORT_DEFAULT), this.t("default"), this.sep(Sep.AFTER_EXPORT_DEFAULT), this.p(node.body, _coderep.Precedence.Assignment, body), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - } - }, { - key: "reduceExportFromSpecifier", - value: function reduceExportFromSpecifier(node) { - if (node.exportedName == null) - return this.t(node.name); - return seq(this.t(node.name), this.sep(Sep.BEFORE_EXPORT_AS), this.t("as"), this.sep(Sep.AFTER_EXPORT_AS), this.t(node.exportedName)); - } - }, { - key: "reduceExportLocalSpecifier", - value: function reduceExportLocalSpecifier(node, _ref50) { - var name = _ref50.name; - if (node.exportedName == null) - return name; - return seq(name, this.sep(Sep.BEFORE_EXPORT_AS), this.t("as"), this.sep(Sep.AFTER_EXPORT_AS), this.t(node.exportedName)); - } - }, { - key: "reduceLabeledStatement", - value: function reduceLabeledStatement(node, _ref51) { - var body = _ref51.body; - return (0, _objectAssign2.default)(seq(this.t(node.label), this.sep(Sep.BEFORE_LABEL_COLON), this.t(":"), this.sep(Sep.AFTER_LABEL_COLON), body), { endsWithMissingElse: body.endsWithMissingElse }); - } - }, { - key: "reduceLiteralBooleanExpression", - value: function reduceLiteralBooleanExpression(node) { - return this.t(node.value.toString()); - } - }, { - key: "reduceLiteralNullExpression", - value: function reduceLiteralNullExpression() { - return this.t("null"); - } - }, { - key: "reduceLiteralInfinityExpression", - value: function reduceLiteralInfinityExpression() { - return this.t("2e308"); - } - }, { - key: "reduceLiteralNumericExpression", - value: function reduceLiteralNumericExpression(node) { - return new _coderep.NumberCodeRep(node.value); - } - }, { - key: "reduceLiteralRegExpExpression", - value: function reduceLiteralRegExpExpression(node) { - return this.t("/" + node.pattern + "/" + (node.global ? "g" : "") + (node.ignoreCase ? "i" : "") + (node.multiLine ? "m" : "") + (node.dotAll ? "s" : "") + (node.unicode ? "u" : "") + (node.sticky ? "y" : ""), true); - } - }, { - key: "reduceLiteralStringExpression", - value: function reduceLiteralStringExpression(node) { - return this.t((0, _coderep.escapeStringLiteral)(node.value)); - } - }, { - key: "reduceMethod", - value: function reduceMethod(node, _ref52) { - var name = _ref52.name, params = _ref52.params, body = _ref52.body; - return seq(node.isAsync ? seq(this.t("async"), this.sep(Sep.AFTER_METHOD_ASYNC)) : empty(), node.isGenerator ? seq(this.t("*"), this.sep(Sep.AFTER_METHOD_GENERATOR_STAR)) : empty(), name, this.sep(Sep.AFTER_METHOD_NAME), this.paren(params, Sep.PARAMETERS_PAREN_BEFORE, Sep.PARAMETERS_PAREN_AFTER, Sep.PARAMETERS_PAREN_EMPTY), this.sep(Sep.BEFORE_METHOD_BODY), this.brace(body, node, Sep.METHOD_BRACE_INTIAL, Sep.METHOD_BRACE_FINAL, Sep.METHOD_BRACE_EMPTY)); - } - }, { - key: "reduceModule", - value: function reduceModule(node, _ref53) { - var directives = _ref53.directives, items = _ref53.items; - if (items.length) { - items[0] = this.parenToAvoidBeingDirective(node.items[0], items[0]); - } - return seq.apply(void 0, _toConsumableArray$1(directives).concat([directives.length ? this.sep(Sep.AFTER_MODULE_DIRECTIVES) : empty()], _toConsumableArray$1(items))); - } - }, { - key: "reduceNewExpression", - value: function reduceNewExpression(node, _ref54) { - var _this7 = this; - var callee = _ref54.callee, args = _ref54.arguments; - var parenthizedArgs = args.map(function(a, i2) { - return _this7.p(node.arguments[i2], _coderep.Precedence.Assignment, a); - }); - var calleeRep = (0, _coderep.getPrecedence)(node.callee) === _coderep.Precedence.Call ? this.paren(callee, Sep.NEW_CALLEE_PAREN_BEFORE, Sep.NEW_CALLEE_PAREN_AFTER) : this.p(node.callee, (0, _coderep.getPrecedence)(node), callee); - return seq(this.t("new"), this.sep(Sep.AFTER_NEW), calleeRep, args.length === 0 ? this.sep(Sep.EMPTY_NEW_CALL) : seq(this.sep(Sep.BEFORE_NEW_ARGS), this.paren(this.commaSep(parenthizedArgs, Sep.ARGS_BEFORE_COMMA, Sep.ARGS_AFTER_COMMA), Sep.NEW_PAREN_BEFORE, Sep.NEW_PAREN_AFTER, Sep.NEW_PAREN_EMPTY))); - } - }, { - key: "reduceNewTargetExpression", - value: function reduceNewTargetExpression() { - return seq(this.t("new"), this.sep(Sep.NEW_TARGET_BEFORE_DOT), this.t("."), this.sep(Sep.NEW_TARGET_AFTER_DOT), this.t("target")); - } - }, { - key: "reduceObjectExpression", - value: function reduceObjectExpression(node, _ref55) { - var properties = _ref55.properties; - var state = this.brace(this.commaSep(properties, Sep.OBJECT_BEFORE_COMMA, Sep.OBJECT_AFTER_COMMA), node, Sep.OBJECT_BRACE_INITIAL, Sep.OBJECT_BRACE_FINAL, Sep.OBJECT_EMPTY); - state.startsWithCurly = true; - return state; - } - }, { - key: "reduceUpdateExpression", - value: function reduceUpdateExpression(node, _ref56) { - var operand = _ref56.operand; - if (node.isPrefix) { - return this.reduceUnaryExpression.apply(this, arguments); - } - return (0, _objectAssign2.default)(seq(this.p(node.operand, _coderep.Precedence.New, operand), this.sep(Sep.BEFORE_POSTFIX(node.operator)), this.t(node.operator)), { - startsWithCurly: operand.startsWithCurly, - startsWithLetSquareBracket: operand.startsWithLetSquareBracket, - startsWithFunctionOrClass: operand.startsWithFunctionOrClass - }); - } - }, { - key: "reduceUnaryExpression", - value: function reduceUnaryExpression(node, _ref57) { - var operand = _ref57.operand; - return seq(this.t(node.operator), this.sep(Sep.UNARY(node.operator)), this.p(node.operand, (0, _coderep.getPrecedence)(node), operand)); - } - }, { - key: "reduceReturnStatement", - value: function reduceReturnStatement(node, _ref58) { - var expression = _ref58.expression; - return seq(this.t("return"), expression ? seq(this.sep(Sep.RETURN), expression) : empty(), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: "reduceScript", - value: function reduceScript(node, _ref59) { - var directives = _ref59.directives, statements = _ref59.statements; - if (statements.length) { - statements[0] = this.parenToAvoidBeingDirective(node.statements[0], statements[0]); - } - return seq.apply(void 0, _toConsumableArray$1(directives).concat([directives.length ? this.sep(Sep.AFTER_SCRIPT_DIRECTIVES) : empty()], _toConsumableArray$1(statements))); - } - }, { - key: "reduceSetter", - value: function reduceSetter(node, _ref60) { - var name = _ref60.name, param = _ref60.param, body = _ref60.body; - return seq(this.t("set"), this.sep(Sep.AFTER_SET), name, this.sep(Sep.BEFORE_SET_PARAMS), this.paren(param, Sep.SETTER_PARAM_BEFORE, Sep.SETTER_PARAM_AFTER), this.sep(Sep.BEFORE_SET_BODY), this.brace(body, node, Sep.SET_BRACE_INTIIAL, Sep.SET_BRACE_FINAL, Sep.SET_BRACE_EMPTY)); - } - }, { - key: "reduceShorthandProperty", - value: function reduceShorthandProperty(node, _ref61) { - var name = _ref61.name; - return name; - } - }, { - key: "reduceStaticMemberAssignmentTarget", - value: function reduceStaticMemberAssignmentTarget(node, _ref62) { - var object = _ref62.object; - var state = seq(this.p(node.object, (0, _coderep.getPrecedence)(node), object), this.sep(Sep.BEFORE_STATIC_MEMBER_ASSIGNMENT_TARGET_DOT), this.t("."), this.sep(Sep.AFTER_STATIC_MEMBER_ASSIGNMENT_TARGET_DOT), this.t(node.property)); - state.startsWithLet = object.startsWithLet; - state.startsWithCurly = object.startsWithCurly; - state.startsWithLetSquareBracket = object.startsWithLetSquareBracket; - state.startsWithFunctionOrClass = object.startsWithFunctionOrClass; - return state; - } - }, { - key: "reduceStaticMemberExpression", - value: function reduceStaticMemberExpression(node, _ref63) { - var object = _ref63.object; - var state = seq(this.p(node.object, (0, _coderep.getPrecedence)(node), object), this.sep(Sep.BEFORE_STATIC_MEMBER_DOT), this.t("."), this.sep(Sep.AFTER_STATIC_MEMBER_DOT), this.t(node.property)); - state.startsWithLet = object.startsWithLet; - state.startsWithCurly = object.startsWithCurly; - state.startsWithLetSquareBracket = object.startsWithLetSquareBracket; - state.startsWithFunctionOrClass = object.startsWithFunctionOrClass; - return state; - } - }, { - key: "reduceStaticPropertyName", - value: function reduceStaticPropertyName(node) { - if (_esutils.keyword.isIdentifierNameES6(node.value)) { - return this.t(node.value); - } - var n = parseFloat(node.value); - if (n >= 0 && n.toString() === node.value) { - return new _coderep.NumberCodeRep(n); - } - return this.t((0, _coderep.escapeStringLiteral)(node.value)); - } - }, { - key: "reduceSuper", - value: function reduceSuper() { - return this.t("super"); - } - }, { - key: "reduceSwitchCase", - value: function reduceSwitchCase(node, _ref64) { - var test = _ref64.test, consequent = _ref64.consequent; - return seq(this.t("case"), this.sep(Sep.BEFORE_CASE_TEST), test, this.sep(Sep.AFTER_CASE_TEST), this.t(":"), this.sep(Sep.BEFORE_CASE_BODY), seq.apply(void 0, _toConsumableArray$1(consequent)), this.sep(Sep.AFTER_CASE_BODY)); - } - }, { - key: "reduceSwitchDefault", - value: function reduceSwitchDefault(node, _ref65) { - var consequent = _ref65.consequent; - return seq(this.t("default"), this.sep(Sep.DEFAULT), this.t(":"), this.sep(Sep.BEFORE_CASE_BODY), seq.apply(void 0, _toConsumableArray$1(consequent)), this.sep(Sep.AFTER_DEFAULT_BODY)); - } - }, { - key: "reduceSwitchStatement", - value: function reduceSwitchStatement(node, _ref66) { - var discriminant = _ref66.discriminant, cases = _ref66.cases; - return seq(this.t("switch"), this.sep(Sep.BEFORE_SWITCH_DISCRIM), this.paren(discriminant, Sep.SWITCH_DISCRIM_PAREN_BEFORE, Sep.SWITCH_DISCRIM_PAREN_AFTER), this.sep(Sep.BEFORE_SWITCH_BODY), this.brace(seq.apply(void 0, _toConsumableArray$1(cases)), node, Sep.SWITCH_BRACE_INTIAL, Sep.SWITCH_BRACE_FINAL, Sep.SWITCH_BRACE_EMPTY), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: "reduceSwitchStatementWithDefault", - value: function reduceSwitchStatementWithDefault(node, _ref67) { - var discriminant = _ref67.discriminant, preDefaultCases = _ref67.preDefaultCases, defaultCase = _ref67.defaultCase, postDefaultCases = _ref67.postDefaultCases; - return seq(this.t("switch"), this.sep(Sep.BEFORE_SWITCH_DISCRIM), this.paren(discriminant, Sep.SWITCH_DISCRIM_PAREN_BEFORE, Sep.SWITCH_DISCRIM_PAREN_AFTER), this.sep(Sep.BEFORE_SWITCH_BODY), this.brace(seq.apply(void 0, _toConsumableArray$1(preDefaultCases).concat([defaultCase], _toConsumableArray$1(postDefaultCases))), node, Sep.SWITCH_BRACE_INTIAL, Sep.SWITCH_BRACE_FINAL, Sep.SWITCH_BRACE_EMPTY), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: "reduceTemplateExpression", - value: function reduceTemplateExpression(node, _ref68) { - var tag = _ref68.tag, elements = _ref68.elements; - var state = node.tag == null ? empty() : seq(this.p(node.tag, (0, _coderep.getPrecedence)(node), tag), this.sep(Sep.TEMPLATE_TAG)); - state = seq(state, this.t("`")); - for (var _i = 0, l = node.elements.length; _i < l; ++_i) { - if (node.elements[_i].type === "TemplateElement") { - var d = ""; - if (_i > 0) - d += "}"; - d += node.elements[_i].rawValue; - if (_i < l - 1) - d += "${"; - state = seq(state, this.t(d)); - } else { - state = seq(state, this.sep(Sep.BEFORE_TEMPLATE_EXPRESSION), elements[_i], this.sep(Sep.AFTER_TEMPLATE_EXPRESSION)); - } - } - state = seq(state, this.t("`")); - if (node.tag != null) { - state.startsWithCurly = tag.startsWithCurly; - state.startsWithLet = tag.startsWithLet; - state.startsWithLetSquareBracket = tag.startsWithLetSquareBracket; - state.startsWithFunctionOrClass = tag.startsWithFunctionOrClass; - } - return state; - } - }, { - key: "reduceTemplateElement", - value: function reduceTemplateElement(node) { - return this.t(node.rawValue); - } - }, { - key: "reduceThisExpression", - value: function reduceThisExpression() { - return this.t("this"); - } - }, { - key: "reduceThrowStatement", - value: function reduceThrowStatement(node, _ref69) { - var expression = _ref69.expression; - return seq(this.t("throw"), this.sep(Sep.THROW), expression, this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: "reduceTryCatchStatement", - value: function reduceTryCatchStatement(node, _ref70) { - var body = _ref70.body, catchClause = _ref70.catchClause; - return seq(this.t("try"), this.sep(Sep.AFTER_TRY), body, this.sep(Sep.BEFORE_CATCH), catchClause, this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: "reduceTryFinallyStatement", - value: function reduceTryFinallyStatement(node, _ref71) { - var body = _ref71.body, catchClause = _ref71.catchClause, finalizer = _ref71.finalizer; - return seq(this.t("try"), this.sep(Sep.AFTER_TRY), body, catchClause ? seq(this.sep(Sep.BEFORE_CATCH), catchClause) : empty(), this.sep(Sep.BEFORE_FINALLY), this.t("finally"), this.sep(Sep.AFTER_FINALLY), finalizer, this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: "reduceYieldExpression", - value: function reduceYieldExpression(node, _ref72) { - var expression = _ref72.expression; - if (node.expression == null) - return this.t("yield"); - return (0, _objectAssign2.default)(seq(this.t("yield"), this.sep(Sep.YIELD), this.p(node.expression, (0, _coderep.getPrecedence)(node), expression)), { containsIn: expression.containsIn }); - } - }, { - key: "reduceYieldGeneratorExpression", - value: function reduceYieldGeneratorExpression(node, _ref73) { - var expression = _ref73.expression; - return (0, _objectAssign2.default)(seq(this.t("yield"), this.sep(Sep.BEFORE_YIELD_STAR), this.t("*"), this.sep(Sep.AFTER_YIELD_STAR), this.p(node.expression, (0, _coderep.getPrecedence)(node), expression)), { containsIn: expression.containsIn }); - } - }, { - key: "reduceDirective", - value: function reduceDirective(node) { - var delim = node.rawValue.match(/(^|[^\\])(\\\\)*"/) ? "'" : '"'; - return seq(this.t(delim + node.rawValue + delim), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: "reduceVariableDeclaration", - value: function reduceVariableDeclaration(node, _ref74) { - var declarators = _ref74.declarators; - return seq(this.t(node.kind), this.sep(Sep.VARIABLE_DECLARATION), this.commaSep(declarators, Sep.DECLARATORS_BEFORE_COMMA, Sep.DECLARATORS_AFTER_COMMA)); - } - }, { - key: "reduceVariableDeclarationStatement", - value: function reduceVariableDeclarationStatement(node, _ref75) { - var declaration = _ref75.declaration; - return seq(declaration, this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: "reduceVariableDeclarator", - value: function reduceVariableDeclarator(node, _ref76) { - var binding = _ref76.binding, init = _ref76.init; - var containsIn = init && init.containsIn && !init.containsGroup; - if (init) { - if (init.containsGroup) { - init = this.paren(init, Sep.EXPRESSION_PAREN_BEFORE, Sep.EXPRESSION_PAREN_AFTER); - } else { - init = markContainsIn(init); - } - } - return (0, _objectAssign2.default)(init == null ? binding : seq(binding, this.sep(Sep.BEFORE_INIT_EQUALS), this.t("="), this.sep(Sep.AFTER_INIT_EQUALS), init), { containsIn }); - } - }, { - key: "reduceWhileStatement", - value: function reduceWhileStatement(node, _ref77) { - var test = _ref77.test, body = _ref77.body; - return (0, _objectAssign2.default)(seq(this.t("while"), this.sep(Sep.AFTER_WHILE), this.paren(test, Sep.WHILE_TEST_PAREN_BEFORE, Sep.WHILE_TEST_PAREN_AFTER), this.sep(Sep.BEFORE_WHILE_BODY), body, this.sep(Sep.AFTER_STATEMENT(node))), { endsWithMissingElse: body.endsWithMissingElse }); - } - }, { - key: "reduceWithStatement", - value: function reduceWithStatement(node, _ref78) { - var object = _ref78.object, body = _ref78.body; - return (0, _objectAssign2.default)(seq(this.t("with"), this.sep(Sep.AFTER_WITH), this.paren(object, Sep.WITH_PAREN_BEFORE, Sep.WITH_PAREN_AFTER), this.sep(Sep.BEFORE_WITH_BODY), body, this.sep(Sep.AFTER_STATEMENT(node))), { endsWithMissingElse: body.endsWithMissingElse }); - } - }]); - return ExtensibleCodeGen2; -}(); -function withoutTrailingLinebreak(state) { - if (state && state instanceof _coderep.Seq) { - var lastChild = state.children[state.children.length - 1]; - while (lastChild instanceof _coderep.Empty) { - state.children.pop(); - lastChild = state.children[state.children.length - 1]; - } - if (lastChild instanceof _coderep.Seq) { - withoutTrailingLinebreak(lastChild); - } else if (lastChild instanceof Linebreak) { - state.children.pop(); - } - } - return state; -} -function indent(rep, includingFinal) { - var finalLinebreak = void 0; - function indentNode(node) { - if (node instanceof Linebreak) { - finalLinebreak = node; - ++node.indentation; - } - } - rep.forEach(indentNode); - if (!includingFinal) { - --finalLinebreak.indentation; - } - return rep; -} -FormattedCodeGen_1 = formattedCodegen$1.FormattedCodeGen = function(_ExtensibleCodeGen) { - _inherits$1(FormattedCodeGen, _ExtensibleCodeGen); - function FormattedCodeGen() { - _classCallCheck$2(this, FormattedCodeGen); - return _possibleConstructorReturn$1(this, (FormattedCodeGen.__proto__ || Object.getPrototypeOf(FormattedCodeGen)).apply(this, arguments)); - } - _createClass$2(FormattedCodeGen, [{ - key: "parenToAvoidBeingDirective", - value: function parenToAvoidBeingDirective(element, original) { - if (element && element.type === "ExpressionStatement" && element.expression.type === "LiteralStringExpression") { - return seq(this.paren(original.children[0], Sep.PAREN_AVOIDING_DIRECTIVE_BEFORE, Sep.PAREN_AVOIDING_DIRECTIVE_AFTER), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(element))); - } - return original; - } - }, { - key: "brace", - value: function brace2(rep, node) { - if (isEmpty(rep)) { - return this.t("{}"); - } - switch (node.type) { - case "ObjectAssignmentTarget": - case "ObjectBinding": - case "Import": - case "ExportFrom": - case "ExportLocals": - case "ObjectExpression": - return new _coderep.Brace(rep); - } - rep = seq(new Linebreak(), rep); - indent(rep, false); - return new _coderep.Brace(rep); - } - }, { - key: "reduceDoWhileStatement", - value: function reduceDoWhileStatement(node, _ref79) { - var body = _ref79.body, test = _ref79.test; - return seq(this.t("do"), this.sep(Sep.AFTER_DO), withoutTrailingLinebreak(body), this.sep(Sep.BEFORE_DOWHILE_WHILE), this.t("while"), this.sep(Sep.AFTER_DOWHILE_WHILE), this.paren(test, Sep.DO_WHILE_TEST_PAREN_BEFORE, Sep.DO_WHILE_TEST_PAREN_AFTER), this.semiOp(), this.sep(Sep.AFTER_STATEMENT(node))); - } - }, { - key: "reduceIfStatement", - value: function reduceIfStatement(node, _ref80) { - var test = _ref80.test, consequent = _ref80.consequent, alternate = _ref80.alternate; - if (alternate && consequent.endsWithMissingElse) { - consequent = this.brace(consequent, node); - } - return (0, _objectAssign2.default)(seq(this.t("if"), this.sep(Sep.AFTER_IF), this.paren(test, Sep.IF_PAREN_BEFORE, Sep.IF_PAREN_AFTER), this.sep(Sep.AFTER_IF_TEST), withoutTrailingLinebreak(consequent), alternate ? seq(this.sep(Sep.BEFORE_ELSE), this.t("else"), this.sep(Sep.AFTER_ELSE), withoutTrailingLinebreak(alternate)) : empty(), this.sep(Sep.AFTER_STATEMENT(node))), { endsWithMissingElse: alternate ? alternate.endsWithMissingElse : true }); - } - }, { - key: "reduceSwitchCase", - value: function reduceSwitchCase(node, _ref81) { - var test = _ref81.test, consequent = _ref81.consequent; - consequent = indent(withoutTrailingLinebreak(seq.apply(void 0, [this.sep(Sep.BEFORE_CASE_BODY)].concat(_toConsumableArray$1(consequent)))), true); - return seq(this.t("case"), this.sep(Sep.BEFORE_CASE_TEST), test, this.sep(Sep.AFTER_CASE_TEST), this.t(":"), consequent, this.sep(Sep.AFTER_CASE_BODY)); - } - }, { - key: "reduceSwitchDefault", - value: function reduceSwitchDefault(node, _ref82) { - var consequent = _ref82.consequent; - consequent = indent(withoutTrailingLinebreak(seq.apply(void 0, [this.sep(Sep.BEFORE_CASE_BODY)].concat(_toConsumableArray$1(consequent)))), true); - return seq(this.t("default"), this.sep(Sep.DEFAULT), this.t(":"), consequent, this.sep(Sep.AFTER_DEFAULT_BODY)); - } - }, { - key: "sep", - value: function sep(separator) { - switch (separator.type) { - case "AWAIT": - case "AFTER_FORAWAIT_AWAIT": - case "ARRAY_AFTER_COMMA": - case "OBJECT_AFTER_COMMA": - case "ARGS_AFTER_COMMA": - case "PARAMETER_AFTER_COMMA": - case "DECLARATORS_AFTER_COMMA": - case "NAMED_IMPORT_AFTER_COMMA": - case "IMPORT_AFTER_COMMA": - case "BEFORE_DEFAULT_EQUALS": - case "AFTER_DEFAULT_EQUALS": - case "AFTER_PROP": - case "BEFORE_JUMP_LABEL": - case "BEFORE_CATCH_BINDING": - case "AFTER_CATCH_BINDING": - case "BEFORE_CLASS_NAME": - case "BEFORE_EXTENDS": - case "AFTER_EXTENDS": - case "BEFORE_CLASS_DECLARATION_ELEMENTS": - case "BEFORE_CLASS_EXPRESSION_ELEMENTS": - case "AFTER_STATIC": - case "BEFORE_TERNARY_QUESTION": - case "AFTER_TERNARY_QUESTION": - case "BEFORE_TERNARY_COLON": - case "AFTER_TERNARY_COLON": - case "AFTER_DO": - case "BEFORE_DOWHILE_WHILE": - case "AFTER_DOWHILE_WHILE": - case "AFTER_FORIN_FOR": - case "BEFORE_FORIN_IN": - case "BEFORE_FORIN_BODY": - case "BEFORE_FOROF_OF": - case "AFTER_FOROF_FOR": - case "BEFORE_FOROF_BODY": - case "AFTER_FOR_FOR": - case "BEFORE_FOR_TEST": - case "BEFORE_FOR_UPDATE": - case "BEFORE_FOR_BODY": - case "BEFORE_FUNCTION_DECLARATION_BODY": - case "BEFORE_FUNCTION_EXPRESSION_BODY": - case "BEFORE_ARROW": - case "AFTER_ARROW": - case "BEFORE_ARROW_ASYNC_PARAMS": - case "AFTER_GET": - case "BEFORE_GET_BODY": - case "AFTER_IF": - case "AFTER_IF_TEST": - case "BEFORE_ELSE": - case "AFTER_ELSE": - case "BEFORE_IMPORT_BINDINGS": - case "BEFORE_IMPORT_MODULE": - case "AFTER_IMPORT_BINDINGS": - case "AFTER_FROM": - case "BEFORE_IMPORT_NAMESPACE": - case "BEFORE_IMPORT_STAR": - case "AFTER_IMPORT_STAR": - case "AFTER_NAMESPACE_BINDING": - case "BEFORE_IMPORT_AS": - case "AFTER_IMPORT_AS": - case "EXPORTS_AFTER_COMMA": - case "BEFORE_EXPORT_STAR": - case "AFTER_EXPORT_STAR": - case "BEFORE_EXPORT_BINDINGS": - case "AFTER_EXPORT_FROM_BINDINGS": - case "AFTER_EXPORT": - case "AFTER_EXPORT_DEFAULT": - case "BEFORE_EXPORT_AS": - case "AFTER_EXPORT_AS": - case "AFTER_LABEL_COLON": - case "AFTER_METHOD_ASYNC": - case "BEFORE_METHOD_BODY": - case "AFTER_NEW": - case "RETURN": - case "AFTER_SET": - case "BEFORE_SET_BODY": - case "BEFORE_SET_PARAMS": - case "BEFORE_CASE_TEST": - case "BEFORE_SWITCH_DISCRIM": - case "BEFORE_SWITCH_BODY": - case "THROW": - case "AFTER_TRY": - case "BEFORE_CATCH": - case "BEFORE_FINALLY": - case "AFTER_FINALLY": - case "VARIABLE_DECLARATION": - case "YIELD": - case "AFTER_YIELD_STAR": - case "BEFORE_INIT_EQUALS": - case "AFTER_INIT_EQUALS": - case "AFTER_WHILE": - case "BEFORE_WHILE_BODY": - case "AFTER_WITH": - case "BEFORE_WITH_BODY": - case "BEFORE_FUNCTION_NAME": - case "AFTER_BINOP": - case "BEFORE_ASSIGN_OP": - case "AFTER_ASSIGN_OP": - return this.t(" "); - case "AFTER_STATEMENT": - switch (separator.node.type) { - case "ForInStatement": - case "ForOfStatement": - case "ForStatement": - case "WhileStatement": - case "WithStatement": - return empty(); - default: - return new Linebreak(); - } - case "AFTER_CLASS_ELEMENT": - case "BEFORE_CASE_BODY": - case "AFTER_CASE_BODY": - case "AFTER_DEFAULT_BODY": - return new Linebreak(); - case "BEFORE_BINOP": - return separator.op === "," ? empty() : this.t(" "); - case "UNARY": - return separator.op === "delete" || separator.op === "void" || separator.op === "typeof" ? this.t(" ") : empty(); - default: - return empty(); - } - } - }]); - return FormattedCodeGen; -}(ExtensibleCodeGen); -const formattedCodegen = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - get FormattedCodeGen() { - return FormattedCodeGen_1; - }, - get ExtensibleCodeGen() { - return ExtensibleCodeGen_1; - }, - get Sep() { - return Sep_1; - }, - default: formattedCodegen$1 -}, [formattedCodegen$1]); -const require$$1 = /* @__PURE__ */ getAugmentedNamespace(formattedCodegen); -var withLocation$1 = {}; -var tokenStream$1 = {}; -var unicode$1 = {}; -var idContinueBool_1; -var idContinueLargeRegex_1; -var idStartBool_1; -var idStartLargeRegex_1; -var whitespaceBool_1; -var whitespaceArray_1; -Object.defineProperty(unicode$1, "__esModule", { - value: true -}); -whitespaceArray_1 = unicode$1.whitespaceArray = [5760, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8239, 8287, 12288, 65279]; -whitespaceBool_1 = unicode$1.whitespaceBool = [false, false, false, false, false, false, false, false, false, true, false, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false]; -idStartLargeRegex_1 = unicode$1.idStartLargeRegex = /^[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\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\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\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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-\u2C2E\u2C30-\u2C5E\u2C60-\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-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]$/; -idStartBool_1 = unicode$1.idStartBool = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, false]; -idContinueLargeRegex_1 = unicode$1.idContinueLargeRegex = /^[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]$/; -idContinueBool_1 = unicode$1.idContinueBool = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, true, true, true, true, true, true, true, true, true, true, false, false, false, false, false, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, false]; -const unicode = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - get whitespaceArray() { - return whitespaceArray_1; - }, - get whitespaceBool() { - return whitespaceBool_1; - }, - get idStartLargeRegex() { - return idStartLargeRegex_1; - }, - get idStartBool() { - return idStartBool_1; - }, - get idContinueLargeRegex() { - return idContinueLargeRegex_1; - }, - get idContinueBool() { - return idContinueBool_1; - }, - default: unicode$1 -}, [unicode$1]); -const require$$0 = /* @__PURE__ */ getAugmentedNamespace(unicode); -Object.defineProperty(tokenStream$1, "__esModule", { - value: true -}); -var TokenStream_1 = tokenStream$1.TokenStream = void 0; -var _createClass$1 = function() { - function defineProperties(target, props) { - for (var i2 = 0; i2 < props.length; i2++) { - var descriptor = props[i2]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - return function(Constructor, protoProps, staticProps) { - if (protoProps) - defineProperties(Constructor.prototype, protoProps); - if (staticProps) - defineProperties(Constructor, staticProps); - return Constructor; - }; -}(); -var needsDoubleDot_1 = tokenStream$1.needsDoubleDot = needsDoubleDot; -var _unicode = require$$0; -function _toConsumableArray(arr) { - if (Array.isArray(arr)) { - for (var i2 = 0, arr2 = Array(arr.length); i2 < arr.length; i2++) { - arr2[i2] = arr[i2]; - } - return arr2; - } else { - return Array.from(arr); - } -} -function _classCallCheck$1(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} -function isIdentifierPartES6(char) { - var charCode = char.charCodeAt(0); - if (charCode < 128) { - return _unicode.idContinueBool[charCode]; - } - return _unicode.idContinueLargeRegex.test(char); -} -function needsDoubleDot(fragment) { - return fragment.indexOf(".") < 0 && fragment.indexOf("e") < 0 && fragment.indexOf("x") < 0; -} -function renderNumber(n) { - var s = void 0; - if (n >= 1e3 && n % 10 === 0) { - s = n.toString(10); - if (/[eE]/.test(s)) { - return s.replace(/[eE]\+/, "e"); - } - return n.toString(10).replace(/0{3,}$/, function(match) { - return "e" + match.length; - }); - } else if (n % 1 === 0) { - if (n > 1e15 && n < 1e20) { - return "0x" + n.toString(16).toUpperCase(); - } - return n.toString(10).replace(/[eE]\+/, "e"); - } - return n.toString(10).replace(/^0\./, ".").replace(/[eE]\+/, "e"); -} -TokenStream_1 = tokenStream$1.TokenStream = function() { - function TokenStream() { - _classCallCheck$1(this, TokenStream); - this.result = ""; - this.lastNumber = null; - this.lastCodePoint = null; - this.lastTokenStr = ""; - this.optionalSemi = false; - this.previousWasRegExp = false; - this.partialHtmlComment = false; - } - _createClass$1(TokenStream, [{ - key: "putNumber", - value: function putNumber(number) { - var tokenStr = renderNumber(number); - this.put(tokenStr); - this.lastNumber = tokenStr; - } - }, { - key: "putOptionalSemi", - value: function putOptionalSemi() { - this.optionalSemi = true; - } - }, { - key: "putRaw", - value: function putRaw(tokenStr) { - this.result += tokenStr; - this.lastTokenStr = tokenStr; - } - }, { - key: "put", - value: function put(tokenStr, isRegExp) { - if (this.optionalSemi) { - this.optionalSemi = false; - if (tokenStr !== "}") { - this.result += ";"; - this.lastCodePoint = ";"; - this.previousWasRegExp = false; - } - } - if (this.lastNumber !== null && tokenStr.length === 1) { - if (tokenStr === ".") { - this.result += needsDoubleDot(this.lastNumber) ? ".." : "."; - this.lastNumber = null; - this.lastCodePoint = "."; - return; - } - } - var tokenStrCodePointCount = [].concat(_toConsumableArray(tokenStr)).length; - if (tokenStrCodePointCount > 0) { - this.lastNumber = null; - var rightCodePoint = String.fromCodePoint(tokenStr.codePointAt(0)); - var lastCodePoint = this.lastCodePoint; - this.lastCodePoint = String.fromCodePoint(tokenStr.codePointAt(tokenStrCodePointCount - 1)); - var previousWasRegExp = this.previousWasRegExp; - this.previousWasRegExp = isRegExp; - if (lastCodePoint && ((lastCodePoint === "+" || lastCodePoint === "-") && lastCodePoint === rightCodePoint || isIdentifierPartES6(lastCodePoint) && isIdentifierPartES6(rightCodePoint) || lastCodePoint === "/" && rightCodePoint === "/" || previousWasRegExp && rightCodePoint === "i" || this.partialHtmlComment && tokenStr.startsWith("--"))) { - this.result += " "; - } - } - this.partialHtmlComment = this.lastTokenStr.endsWith("<") && tokenStr === "!"; - this.result += tokenStr; - this.lastTokenStr = tokenStr; - } - }]); - return TokenStream; -}(); -const tokenStream = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - get TokenStream() { - return TokenStream_1; - }, - needsDoubleDot: needsDoubleDot_1, - default: tokenStream$1 -}, [tokenStream$1]); -const require$$5 = /* @__PURE__ */ getAugmentedNamespace(tokenStream); -Object.defineProperty(withLocation$1, "__esModule", { - value: true -}); -var _createClass = function() { - function defineProperties(target, props) { - for (var i2 = 0; i2 < props.length; i2++) { - var descriptor = props[i2]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - return function(Constructor, protoProps, staticProps) { - if (protoProps) - defineProperties(Constructor.prototype, protoProps); - if (staticProps) - defineProperties(Constructor, staticProps); - return Constructor; - }; -}(); -var _get = function get4(object, property, receiver) { - if (object === null) - object = Function.prototype; - var desc = Object.getOwnPropertyDescriptor(object, property); - if (desc === void 0) { - var parent = Object.getPrototypeOf(object); - if (parent === null) { - return void 0; - } else { - return get4(parent, property, receiver); - } - } else if ("value" in desc) { - return desc.value; - } else { - var getter = desc.get; - if (getter === void 0) { - return void 0; - } - return getter.call(receiver); - } -}; -var _default = withLocation$1.default = codeGenWithLocation; -var _shiftReducer = require$$4; -var _tokenStream = require$$5; -var _minimalCodegen = require$$0$1; -var _minimalCodegen2 = _interopRequireDefault(_minimalCodegen); -function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; -} -function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} -function _possibleConstructorReturn(self, call) { - if (!self) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return call && (typeof call === "object" || typeof call === "function") ? call : self; -} -function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); - if (superClass) - Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; -} -function mightHaveSemi(type) { - return /(Import)|(Export)|(Statement)|(Directive)|(SwitchCase)|(SwitchDefault)/.test(type); -} -var TokenStreamWithLocation = function(_TokenStream) { - _inherits(TokenStreamWithLocation2, _TokenStream); - function TokenStreamWithLocation2() { - _classCallCheck(this, TokenStreamWithLocation2); - var _this = _possibleConstructorReturn(this, (TokenStreamWithLocation2.__proto__ || Object.getPrototypeOf(TokenStreamWithLocation2)).call(this)); - _this.line = 1; - _this.column = 0; - _this.startingNodes = []; - _this.finishingStatements = []; - _this.lastNumberNode = null; - _this.locations = /* @__PURE__ */ new WeakMap(); - return _this; - } - _createClass(TokenStreamWithLocation2, [{ - key: "putRaw", - value: function putRaw(tokenStr) { - var previousLength = this.result.length; - _get(TokenStreamWithLocation2.prototype.__proto__ || Object.getPrototypeOf(TokenStreamWithLocation2.prototype), "putRaw", this).call(this, tokenStr); - this.startNodes(tokenStr, previousLength); - } - }, { - key: "put", - value: function put(tokenStr, isRegExp) { - if (this.optionalSemi && tokenStr !== "}") { - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = void 0; - try { - for (var _iterator = this.finishingStatements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var obj = _step.value; - ++obj.end.column; - ++obj.end.offset; - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - } - this.finishingStatements = []; - if (this.lastNumber !== null && tokenStr === "." && (0, _tokenStream.needsDoubleDot)(this.lastNumber)) { - var loc = this.locations.get(this.lastNumberNode).end; - ++loc.column; - ++loc.offset; - } - this.lastNumberNode = null; - var previousLength = this.result.length; - _get(TokenStreamWithLocation2.prototype.__proto__ || Object.getPrototypeOf(TokenStreamWithLocation2.prototype), "put", this).call(this, tokenStr, isRegExp); - this.startNodes(tokenStr, previousLength); - } - }, { - key: "startNodes", - value: function startNodes(tokenStr, previousLength) { - var linebreakRegex = /\r\n?|[\n\u2028\u2029]/g; - var matched = false; - var match = void 0; - var startLine = this.line; - var startColumn = this.column; - while (match = linebreakRegex.exec(tokenStr)) { - ++this.line; - this.column = tokenStr.length - match.index - match[0].length; - matched = true; - } - if (!matched) { - this.column += this.result.length - previousLength; - startColumn = this.column - tokenStr.length; - } - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = void 0; - try { - for (var _iterator2 = this.startingNodes[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var node = _step2.value; - this.locations.set(node, { - start: { - line: startLine, - column: startColumn, - offset: this.result.length - tokenStr.length - }, - end: null - }); - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - this.startingNodes = []; - } - }, { - key: "startEmit", - value: function startEmit(node) { - this.startingNodes.push(node); - } - }, { - key: "finishEmit", - value: function finishEmit(node) { - this.locations.get(node).end = { - line: this.line, - column: this.column, - offset: this.result.length - }; - if (mightHaveSemi(node.type)) { - this.finishingStatements.push(this.locations.get(node)); - } - } - }]); - return TokenStreamWithLocation2; -}(_tokenStream.TokenStream); -function addLocation(rep, node) { - var originalEmit = rep.emit.bind(rep); - if (node.type === "Script" || node.type === "Module") { - rep.emit = function(ts) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - ts.locations.set(node, { - start: { - line: 1, - column: 0, - offset: 0 - }, - end: null - }); - originalEmit.apply(void 0, [ts].concat(args)); - ts.locations.get(node).end = { - line: ts.line, - column: ts.column, - offset: ts.result.length - }; - }; - } else if (node.type === "LiteralNumericExpression") { - rep.emit = function(ts) { - for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } - ts.startEmit(node); - originalEmit.apply(void 0, [ts].concat(args)); - ts.finishEmit(node); - ts.lastNumberNode = node; - }; - } else { - rep.emit = function(ts) { - for (var _len3 = arguments.length, args = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { - args[_key3 - 1] = arguments[_key3]; - } - ts.startEmit(node); - originalEmit.apply(void 0, [ts].concat(args)); - ts.finishEmit(node); - }; - } - return rep; -} -function addLocationToReducer(reducer) { - var wrapped = (0, _shiftReducer.adapt)(addLocation, reducer); - var originalRegenerate = wrapped.regenerateArrowParams.bind(wrapped); - wrapped.regenerateArrowParams = function(element, original) { - var out = originalRegenerate(element, original); - if (out !== original) { - addLocation(out, element); - } - return out; - }; - var originalDirective = wrapped.parenToAvoidBeingDirective.bind(wrapped); - wrapped.parenToAvoidBeingDirective = function(element, original) { - var out = originalDirective(element, original); - if (out !== original) { - addLocation(out, element); - } - return out; - }; - return wrapped; -} -function codeGenWithLocation(program) { - var generator = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : new _minimalCodegen2.default(); - var ts = new TokenStreamWithLocation(); - var rep = (0, _shiftReducer.reduce)(addLocationToReducer(generator), program); - rep.emit(ts); - return { source: ts.result, locations: ts.locations }; -} -const withLocation = /* @__PURE__ */ _mergeNamespaces({ - __proto__: null, - default: _default -}, [withLocation$1]); -const require$$3 = /* @__PURE__ */ getAugmentedNamespace(withLocation); -(function(exports2) { - Object.defineProperty(exports2, "__esModule", { - value: true - }); - exports2.codeGenWithLocation = exports2.SemiOp = exports2.CommaSep = exports2.Semi = exports2.Seq = exports2.ContainsIn = exports2.NoIn = exports2.Brace = exports2.Bracket = exports2.Paren = exports2.NumberCodeRep = exports2.Token = exports2.Empty = exports2.CodeRep = exports2.escapeStringLiteral = exports2.getPrecedence = exports2.Precedence = exports2.Sep = exports2.FormattedCodeGen = exports2.ExtensibleCodeGen = exports2.MinimalCodeGen = void 0; - exports2.default = codeGen; - var _minimalCodegen3 = require$$0$1; - Object.defineProperty(exports2, "MinimalCodeGen", { - enumerable: true, - get: function get5() { - return _interopRequireDefault2(_minimalCodegen3).default; - } - }); - var _formattedCodegen = require$$1; - Object.defineProperty(exports2, "ExtensibleCodeGen", { - enumerable: true, - get: function get5() { - return _formattedCodegen.ExtensibleCodeGen; - } - }); - Object.defineProperty(exports2, "FormattedCodeGen", { - enumerable: true, - get: function get5() { - return _formattedCodegen.FormattedCodeGen; - } - }); - Object.defineProperty(exports2, "Sep", { - enumerable: true, - get: function get5() { - return _formattedCodegen.Sep; - } - }); - var _coderep2 = require$$2; - Object.defineProperty(exports2, "Precedence", { - enumerable: true, - get: function get5() { - return _coderep2.Precedence; - } - }); - Object.defineProperty(exports2, "getPrecedence", { - enumerable: true, - get: function get5() { - return _coderep2.getPrecedence; - } - }); - Object.defineProperty(exports2, "escapeStringLiteral", { - enumerable: true, - get: function get5() { - return _coderep2.escapeStringLiteral; - } - }); - Object.defineProperty(exports2, "CodeRep", { - enumerable: true, - get: function get5() { - return _coderep2.CodeRep; - } - }); - Object.defineProperty(exports2, "Empty", { - enumerable: true, - get: function get5() { - return _coderep2.Empty; - } - }); - Object.defineProperty(exports2, "Token", { - enumerable: true, - get: function get5() { - return _coderep2.Token; - } - }); - Object.defineProperty(exports2, "NumberCodeRep", { - enumerable: true, - get: function get5() { - return _coderep2.NumberCodeRep; - } - }); - Object.defineProperty(exports2, "Paren", { - enumerable: true, - get: function get5() { - return _coderep2.Paren; - } - }); - Object.defineProperty(exports2, "Bracket", { - enumerable: true, - get: function get5() { - return _coderep2.Bracket; - } - }); - Object.defineProperty(exports2, "Brace", { - enumerable: true, - get: function get5() { - return _coderep2.Brace; - } - }); - Object.defineProperty(exports2, "NoIn", { - enumerable: true, - get: function get5() { - return _coderep2.NoIn; - } - }); - Object.defineProperty(exports2, "ContainsIn", { - enumerable: true, - get: function get5() { - return _coderep2.ContainsIn; - } - }); - Object.defineProperty(exports2, "Seq", { - enumerable: true, - get: function get5() { - return _coderep2.Seq; - } - }); - Object.defineProperty(exports2, "Semi", { - enumerable: true, - get: function get5() { - return _coderep2.Semi; - } - }); - Object.defineProperty(exports2, "CommaSep", { - enumerable: true, - get: function get5() { - return _coderep2.CommaSep; - } - }); - Object.defineProperty(exports2, "SemiOp", { - enumerable: true, - get: function get5() { - return _coderep2.SemiOp; - } - }); - var _withLocation = require$$3; - Object.defineProperty(exports2, "codeGenWithLocation", { - enumerable: true, - get: function get5() { - return _interopRequireDefault2(_withLocation).default; - } - }); - var _shiftReducer3 = require$$4; - var _shiftReducer22 = _interopRequireDefault2(_shiftReducer3); - var _tokenStream2 = require$$5; - var _minimalCodegen22 = _interopRequireDefault2(_minimalCodegen3); - function _interopRequireDefault2(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function codeGen(script) { - var generator = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : new _minimalCodegen22.default(); - var ts = new _tokenStream2.TokenStream(); - var rep = (0, _shiftReducer22.default)(generator, script); - rep.emit(ts); - return ts.result; - } -})(dist); -const shiftCodegen = /* @__PURE__ */ getDefaultExportFromCjs(dist); -shiftCodegen.default || shiftCodegen; -const { Pattern: Pattern$1 } = strudel; -Object.keys(Pattern$1.prototype.factories).concat(["mini"]); -const { pure, Pattern, Fraction, stack, slowcat, sequence, timeCat, silence, reify: reify$1 } = strudel; -var _seedState = 0; -const randOffset = 2e-4; -function _nextSeed() { - return _seedState++; -} -const applyOptions = (parent) => (pat, i2) => { - const ast2 = parent.source_[i2]; - const options = ast2.options_; - const operator = options == null ? void 0 : options.operator; - if (operator) { - switch (operator.type_) { - case "stretch": - const speed = Fraction(operator.arguments_.amount).inverse(); - return reify$1(pat).fast(speed); - case "bjorklund": - return pat.euclid(operator.arguments_.pulse, operator.arguments_.step, operator.arguments_.rotation); - case "degradeBy": - return reify$1(pat)._degradeByWith(rand.early(randOffset * _nextSeed()).segment(1), operator.arguments_.amount); - } - console.warn(`operator "${operator.type_}" not implemented`); - } - if (options == null ? void 0 : options.weight) { - return pat; - } - const unimplemented = Object.keys(options || {}).filter((key) => key !== "operator"); - if (unimplemented.length) { - console.warn( - `option${unimplemented.length > 1 ? "s" : ""} ${unimplemented.map((o) => `"${o}"`).join(", ")} not implemented` - ); - } - return pat; -}; -function resolveReplications(ast2) { - ast2.source_ = ast2.source_.map((child) => { - const { replicate, ...options } = child.options_ || {}; - if (replicate) { - return { - ...child, - options_: { ...options, weight: replicate }, - source_: { - type_: "pattern", - arguments_: { - alignment: "h" - }, - source_: [ - { - type_: "element", - source_: child.source_, - location_: child.location_, - options_: { - operator: { - type_: "stretch", - arguments_: { amount: Fraction(replicate).inverse().toString() } - } - } - } - ] - } - }; - } - return child; - }); -} -function patternifyAST(ast2) { - switch (ast2.type_) { - case "pattern": - resolveReplications(ast2); - const children = ast2.source_.map(patternifyAST).map(applyOptions(ast2)); - const alignment = ast2.arguments_.alignment; - if (alignment === "v") { - return stack(...children); - } - if (alignment === "r") { - return chooseInWith(rand.early(randOffset * _nextSeed()).segment(1), children); - } - const weightedChildren = ast2.source_.some((child) => { - var _a; - return !!((_a = child.options_) == null ? void 0 : _a.weight); - }); - if (!weightedChildren && alignment === "t") { - return slowcat(...children); - } - if (weightedChildren) { - const pat = timeCat(...ast2.source_.map((child, i2) => { - var _a; - return [((_a = child.options_) == null ? void 0 : _a.weight) || 1, children[i2]]; - })); - if (alignment === "t") { - const weightSum = ast2.source_.reduce((sum, child) => { - var _a; - return sum + (((_a = child.options_) == null ? void 0 : _a.weight) || 1); - }, 0); - return pat._slow(weightSum); - } - return pat; + if (weightedChildren) { + const pat = timeCat(...ast.source_.map((child, i) => { + var _a; + return [((_a = child.options_) == null ? void 0 : _a.weight) || 1, children[i]]; + })); + if (alignment === "t") { + const weightSum = ast.source_.reduce((sum, child) => { + var _a; + return sum + (((_a = child.options_) == null ? void 0 : _a.weight) || 1); + }, 0); + return pat._slow(weightSum); + } + return pat; } return sequence(...children); case "element": - if (ast2.source_ === "~") { + if (ast.source_ === "~") { return silence; } - if (typeof ast2.source_ !== "object") { - if (!ast2.location_) { - console.warn("no location for", ast2); - return ast2.source_; + if (typeof ast.source_ !== "object") { + if (!ast.location_) { + console.warn("no location for", ast); + return ast.source_; } - const { start, end } = ast2.location_; - const value = !isNaN(Number(ast2.source_)) ? Number(ast2.source_) : ast2.source_; + const { start, end } = ast.location_; + const value = !isNaN(Number(ast.source_)) ? Number(ast.source_) : ast.source_; return pure(value).withLocation([start.line, start.column, start.offset], [end.line, end.column, end.offset]); } - return patternifyAST(ast2.source_); + p = patternifyAST(ast.source_); + p.ast = ast; + return p; case "stretch": - return patternifyAST(ast2.source_).slow(ast2.arguments_.amount); + p = patternifyAST(ast.source_).slow(ast.arguments_.amount); + p.ast = ast; + return p; default: - console.warn(`node type "${ast2.type_}" not implemented -> returning silence`); + console.warn(`node type "${ast.type_}" not implemented -> returning silence`); return silence; } } const mini = (...strings) => { const pats = strings.map((str) => { - const ast2 = peg$parse(`"${str}"`); - return patternifyAST(ast2); + const ast = krillParser.parse(`"${str}"`); + const p = patternifyAST(ast); + p.ast = ast; + return p; }); - return sequence(...pats); + const s = sequence(...pats); + s.ast = pats.map((_pat) => _pat.ast); + return s; }; const h = (string) => { - const ast2 = peg$parse(string); - return patternifyAST(ast2); + const ast = krillParser.parse(string); + const p = patternifyAST(ast); + p.ast = ast; + return p; }; Pattern.prototype.define("mini", mini, { composable: true }); Pattern.prototype.define("m", mini, { composable: true }); @@ -27311,9 +4667,7 @@ function minify(thing) { } return reify$1(thing); } -exports.SyntaxError = peg$SyntaxError; exports.h = h; exports.mini = mini; exports.minify = minify; -exports.parse = peg$parse; exports.patternifyAST = patternifyAST;