Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eel-wasm

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eel-wasm - npm Package Compare versions

Comparing version 0.0.11 to 0.0.12

dist/src/__tests__/eelVersionOne.js

2

dist/index.bundle.js

@@ -1,1 +0,1 @@

(function () {var ha={};var na={};function Ia(r,e){var o={destCol:1,srcCol:1,srcLine:1};r.forEach(function(r){r.destCol>e||(o=r)});var t=e-o.destCol;return{column:o.srcCol+t,line:o.srcLine}}function lb(r){for(var e=[],o=1,t="",s=0,$=!1,c=!1,n=!1,l=0;l<r.length;l++){var p=r[l];if(n){var i=t.length+1,a=l-s+1;e.push({destCol:i,srcCol:a,srcLine:o}),n=!1}"\n"===p?($=!1,o++,s=l+1,n=!0):"\r"===p&&"\n"===r[l+1]?($=!1,o++,s=++l+1,n=!0):c&&"*"===p&&"/"===r[l+1]?(c=!1,l++,n=!0):"\\"===p&&"\\"===r[l+1]||"/"===p&&"/"===r[l+1]?($=!0,l++):"/"===p&&"*"===r[l+1]?(c=!0,l++):$||c||(t+=p)}return[t,e]}var ia,ja,mb={},F=mb={};function xa(){throw new Error("setTimeout has not been defined")}function ya(){throw new Error("clearTimeout has not been defined")}function Ja($){if(ia===setTimeout)return setTimeout($,0);if((ia===xa||!ia)&&setTimeout)return ia=setTimeout,setTimeout($,0);try{return ia($,0)}catch(e){try{return ia.call(null,$,0)}catch(e){return ia.call(this,$,0)}}}function nb($){if(ja===clearTimeout)return clearTimeout($);if((ja===ya||!ja)&&clearTimeout)return ja=clearTimeout,clearTimeout($);try{return ja($)}catch(e){try{return ja.call(null,$)}catch(e){return ja.call(this,$)}}}!function(){try{ia="function"==typeof setTimeout?setTimeout:xa}catch($){ia=xa}try{ja="function"==typeof clearTimeout?clearTimeout:ya}catch($){ja=ya}}();var oa,fa=[],za=!1,Ka=-1;function ob(){za&&oa&&(za=!1,oa.length?fa=oa.concat(fa):Ka=-1,fa.length&&La())}function La(){if(!za){var $=Ja(ob);za=!0;for(var e=fa.length;e;){for(oa=fa,fa=[];++Ka<e;)oa&&oa[Ka].run();Ka=-1,e=fa.length}oa=null,za=!1,nb($)}}function Ma($,e){this.fun=$,this.array=e}function Y(){}F.nextTick=function($){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];fa.push(new Ma($,e)),1!==fa.length||za||Ja(La)},Ma.prototype.run=function(){this.fun.apply(null,this.array)},F.title="browser",F.env={},F.argv=[],F.version="",F.versions={},F.on=Y,F.addListener=Y,F.once=Y,F.off=Y,F.removeListener=Y,F.removeAllListeners=Y,F.emit=Y,F.prependListener=Y,F.prependOnceListener=Y,F.listeners=function($){return[]},F.binding=function($){throw new Error("process.binding is not supported")},F.cwd=function(){return"/"},F.chdir=function($){throw new Error("process.chdir is not supported")},F.umask=function(){return 0};var pb=function(){var t={exports:this},i=function(){var t=function(t,e,i,s){for(i=i||{},s=t.length;s--;i[t[s]]=e);return i},e=[1,18],i=[1,7],s=[1,19],n=[1,20],r=[1,14],h=[1,15],o=[1,16],a=[1,33],c=[1,31],l=[1,23],y=[1,22],u=[1,24],p=[1,25],_=[1,26],f=[1,27],g=[1,28],m=[1,29],E=[1,30],k=[5,8,15,18,20,28,29,32,33,34,35,36,37,38],I=[5,15,18],b=[5,12,15,17,18,24,25,28,29,30],S=[1,57],d=[5,8,12,15,17,18,24,25,28,29,30],N=[15,18],O=[5,8,15,18,28,29,38],$=[5,8,15,18,28,29,32,33,38],x=[5,8,15,18,28,29,32,33,34,37,38],A=[5,8,15,18,28,29,32,33,34,35,36,37,38],R=[5,8,15,18],v=[5,8,15,18,20,22,28,29,32,33,34,35,36,37,38],T={trace:function(){},yy:{},symbols_:{error:2,SCRIPT:3,expression:4,EOF:5,expressionsOptionalTrailingSemi:6,separator:7,";":8,expressions:9,EXPRESSION_BLOCK:10,IDENTIFIER:11,IDENTIFIER_TOKEN:12,argument:13,arguments:14,",":15,FUNCTION_CALL:16,"(":17,")":18,LOGICAL_EXPRESSION:19,LOGICAL_OPERATOR_TOKEN:20,ASSIGNMENT:21,ASSIGNMENT_OPERATOR_TOKEN:22,number:23,DIGITS_TOKEN:24,".":25,NUMBER_LITERAL:26,UNARY_EXPRESSION:27,"-":28,"+":29,"!":30,BINARY_EXPRESSION:31,"*":32,"/":33,"%":34,"&":35,"|":36,"^":37,COMPARISON_TOKEN:38,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",8:";",12:"IDENTIFIER_TOKEN",15:",",17:"(",18:")",20:"LOGICAL_OPERATOR_TOKEN",22:"ASSIGNMENT_OPERATOR_TOKEN",24:"DIGITS_TOKEN",25:".",28:"-",29:"+",30:"!",32:"*",33:"/",34:"%",35:"&",36:"|",37:"^",38:"COMPARISON_TOKEN"},productions_:[0,[3,2],[3,2],[3,1],[7,1],[7,2],[9,2],[9,3],[6,1],[6,2],[10,1],[11,1],[13,1],[13,1],[14,1],[14,3],[16,3],[16,4],[19,3],[21,3],[21,3],[23,1],[23,2],[23,3],[23,2],[23,1],[26,1],[27,2],[27,2],[27,2],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[4,1],[4,1],[4,3],[4,1],[4,1],[4,1],[4,1],[4,1],[4,3]],performAction:function(t,e,i,s,n,r,h){var o=r.length-1;switch(n){case 1:return{type:"SCRIPT",body:[r[o-1]],loc:this._$};case 2:return{type:"SCRIPT",body:r[o-1],loc:this._$};case 3:return{type:"SCRIPT",body:[],loc:this._$};case 6:this.$=[r[o-1]];break;case 7:this.$=r[o-2].concat([r[o-1]]);break;case 8:this.$=r[o];break;case 9:this.$=r[o-1].concat([r[o]]);break;case 10:this.$={type:"EXPRESSION_BLOCK",body:r[o],loc:this._$};break;case 11:this.$={type:"IDENTIFIER",value:r[o].toLowerCase(),loc:this._$};break;case 14:this.$=[r[o]];break;case 15:this.$=r[o-2].concat([r[o]]);break;case 16:this.$={type:"CALL_EXPRESSION",callee:r[o-2],arguments:[],loc:this._$};break;case 17:this.$={type:"CALL_EXPRESSION",callee:r[o-3],arguments:r[o-1],loc:this._$};break;case 18:this.$={type:"LOGICAL_EXPRESSION",left:r[o-2],right:r[o],operator:r[o-1],loc:this._$};break;case 19:case 20:this.$={type:"ASSIGNMENT_EXPRESSION",left:r[o-2],operator:r[o-1],right:r[o],loc:this._$};break;case 21:this.$=Number(r[o]);break;case 22:this.$=Number(r[o-1]);break;case 23:this.$=Number(r[o-2]+r[o-1]+r[o]);break;case 24:this.$=Number("0"+r[o-1]+r[o]);break;case 25:this.$=0;break;case 26:this.$={type:"NUMBER_LITERAL",value:r[o],loc:this._$};break;case 27:case 28:case 29:this.$={type:"UNARY_EXPRESSION",value:r[o],operator:r[o-1],loc:this._$};break;case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:case 38:this.$={type:"BINARY_EXPRESSION",left:r[o-2],right:r[o],operator:r[o-1],loc:this._$};break;case 41:case 47:this.$=r[o-1];}},table:[{3:1,4:2,5:[1,4],6:3,9:13,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{1:[3]},{5:[1,21],7:32,8:a,20:c,28:l,29:y,32:u,33:p,34:_,35:f,36:g,37:m,38:E},{5:[1,34]},{1:[2,3]},t(k,[2,39]),t(k,[2,40]),{4:35,6:37,9:13,10:36,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},t(k,[2,42]),t(k,[2,43]),t(k,[2,44],{22:[1,38]}),t(k,[2,45],{17:[1,40],22:[1,39]}),t(k,[2,46]),t(I,[2,8],{31:5,27:6,26:8,21:9,16:10,11:11,19:12,23:17,4:41,12:e,17:i,24:s,25:n,28:r,29:h,30:o}),{4:42,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:43,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:44,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},t(k,[2,26]),t([5,8,15,17,18,20,22,28,29,32,33,34,35,36,37,38],[2,11]),t(k,[2,21],{25:[1,45]}),t(k,[2,25],{24:[1,46]}),{1:[2,1]},{4:47,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:48,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:49,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:50,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:51,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:52,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:53,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:54,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:55,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:56,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},t(b,[2,6],{8:S}),t(d,[2,4]),{1:[2,2]},{7:32,8:a,18:[1,58],20:c,28:l,29:y,32:u,33:p,34:_,35:f,36:g,37:m,38:E},{18:[1,59]},t(N,[2,10]),{4:60,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:61,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:65,6:37,9:13,10:66,11:11,12:e,13:64,14:63,16:10,17:i,18:[1,62],19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},t(I,[2,9],{7:67,8:a,20:c,28:l,29:y,32:u,33:p,34:_,35:f,36:g,37:m,38:E}),t(O,[2,27],{20:c,32:u,33:p,34:_,35:f,36:g,37:m}),t(O,[2,28],{20:c,32:u,33:p,34:_,35:f,36:g,37:m}),t(O,[2,29],{20:c,32:u,33:p,34:_,35:f,36:g,37:m}),t(k,[2,22],{24:[1,68]}),t(k,[2,24]),t(O,[2,30],{20:c,32:u,33:p,34:_,35:f,36:g,37:m}),t(O,[2,31],{20:c,32:u,33:p,34:_,35:f,36:g,37:m}),t($,[2,32],{20:c,34:_,35:f,36:g,37:m}),t($,[2,33],{20:c,34:_,35:f,36:g,37:m}),t(x,[2,34],{20:c,35:f,36:g}),t(A,[2,35],{20:c}),t(A,[2,36],{20:c}),t(x,[2,37],{20:c,35:f,36:g}),t(R,[2,38],{20:c,28:l,29:y,32:u,33:p,34:_,35:f,36:g,37:m,38:E}),t(k,[2,18]),t(d,[2,5]),t(k,[2,41]),t(k,[2,47]),t(R,[2,20],{20:c,28:l,29:y,32:u,33:p,34:_,35:f,36:g,37:m,38:E}),t(R,[2,19],{20:c,28:l,29:y,32:u,33:p,34:_,35:f,36:g,37:m,38:E}),t(v,[2,16]),{15:[1,70],18:[1,69]},t(N,[2,14]),t(N,[2,12],{7:32,8:a,20:c,28:l,29:y,32:u,33:p,34:_,35:f,36:g,37:m,38:E}),t(N,[2,13]),t(b,[2,7],{8:S}),t(k,[2,23]),t(v,[2,17]),{4:65,6:37,9:13,10:66,11:11,12:e,13:71,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},t(N,[2,15])],defaultActions:{4:[2,3],21:[2,1],34:[2,2]},parseError:function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)},parse:function(t){var e=this,i=[0],s=[null],n=[],r=this.table,h="",o=0,a=0,c=0,l=n.slice.call(arguments,1),y=Object.create(this.lexer),u={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(u.yy[p]=this.yy[p]);y.setInput(t,u.yy),u.yy.lexer=y,u.yy.parser=this,void 0===y.yylloc&&(y.yylloc={});var _=y.yylloc;n.push(_);var f=y.options&&y.options.ranges;"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var g,m,E,k,I,b,S,d,N,O=function(){var t;return"number"!=typeof(t=y.lex()||1)&&(t=e.symbols_[t]||t),t},$={};;){if(E=i[i.length-1],this.defaultActions[E]?k=this.defaultActions[E]:(null==g&&(g=O()),k=r[E]&&r[E][g]),void 0===k||!k.length||!k[0]){var x="";for(b in N=[],r[E])this.terminals_[b]&&b>2&&N.push("'"+this.terminals_[b]+"'");x=y.showPosition?"Parse error on line "+(o+1)+":\n"+y.showPosition()+"\nExpecting "+N.join(", ")+", got '"+(this.terminals_[g]||g)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==g?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(x,{text:y.match,token:this.terminals_[g]||g,line:y.yylineno,loc:_,expected:N})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+E+", token: "+g);switch(k[0]){case 1:i.push(g),s.push(y.yytext),n.push(y.yylloc),i.push(k[1]),g=null,m?(g=m,m=null):(a=y.yyleng,h=y.yytext,o=y.yylineno,_=y.yylloc,c>0&&c--);break;case 2:if(S=this.productions_[k[1]][1],$.$=s[s.length-S],$._$={first_line:n[n.length-(S||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(S||1)].first_column,last_column:n[n.length-1].last_column},f&&($._$.range=[n[n.length-(S||1)].range[0],n[n.length-1].range[1]]),void 0!==(I=this.performAction.apply($,[h,a,o,u.yy,k[1],s,n].concat(l))))return I;S&&(i=i.slice(0,-1*S*2),s=s.slice(0,-1*S),n=n.slice(0,-1*S)),i.push(this.productions_[k[1]][0]),s.push($.$),n.push($._$),d=r[i[i.length-2]][i[i.length-1]],i.push(d);break;case 3:return!0;}}return!0}},P={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===s.length?this.yylloc.first_column:0)+s[s.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var i,s,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var r in n)this[r]=n[r];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,i,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),r=0;r<n.length;r++)if((i=this._input.match(this.rules[n[r]]))&&(!e||i[0].length>e[0].length)){if(e=i,s=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,n[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[s]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,i,s){switch(i){case 0:break;case 1:return 24;case 2:return 38;case 3:return 22;case 4:return 20;case 5:return 12;case 6:return 5;case 7:return e.yytext[0];}},rules:[/^(?:\s+)/,/^(?:[0-9]+)/,/^(?:(==|!=|<=|>=|<|>))/,/^(?:[+\-*/%]?=)/,/^(?:(\&\&)|\|\|)/,/^(?:[a-zA-Z_][a-zA-Z0-9._]*)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};function L(){this.yy={}}return T.lexer=P,L.prototype=T,T.Parser=L,new L}();return"undefined"!=typeof require&&void 0!==this&&(this.parser=i,this.Parser=i.Parser,this.parse=function(){return i.parse.apply(i,arguments)},this.main=function(){},void 0!==t&&require.main===t&&this.main(mb.argv.slice(1))),t.exports}.call({});var qb={};qb={parse:pb.parse};function Na(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function Oa(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?Na(Object(t),!0).forEach(function(r){Aa(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Na(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function Aa(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var rb={ASSIGNMENT_EXPRESSION:[{type:"NODE",key:"right"}],SCRIPT:[{type:"ARRAY",key:"body"}],EXPRESSION_BLOCK:[{type:"ARRAY",key:"body"}],UNARY_EXPRESSION:[{type:"NODE",key:"value"}],NUMBER_LITERAL:[],IDENTIFIER:[],CALL_EXPRESSION:[{type:"ARRAY",key:"arguments"},{type:"NODE",key:"callee"}],BINARY_EXPRESSION:[{type:"NODE",key:"left"},{type:"NODE",key:"right"}],LOGICAL_EXPRESSION:[{type:"NODE",key:"left"},{type:"NODE",key:"right"}]};function Ba(e,r){var t=rb[e.type],n=e;if(null==t)throw new Error("Unknown children definition for ".concat(e.type));return t.forEach(function(t){if("NODE"===t.type){var o=e[t.key],$=Ba(o,r);$!==o&&(n=Oa({},n,Aa({},t.key,$)))}else if("ARRAY"===t.type){var p=e[t.key],y=p.map(function(e){return Ba(e,r)});p.some(function(e,r){return e!==y[r]})&&(n=Oa({},n,Aa({},t.key,y)))}}),r(n)}var pa={};var K={},Pa=K&&K.__read||function(r,t){var n="function"==typeof Symbol&&r[Symbol.iterator];if(!n)return r;var e,$,o=n.call(r),a=[];try{for(;(void 0===t||t-->0)&&!(e=o.next()).done;)a.push(e.value)}catch(p){$={error:p}}finally{try{e&&!e.done&&(n=o.return)&&n.call(o)}finally{if($)throw $.error}}return a},sb=K&&K.__spread||function(){for(var r=[],t=0;t<arguments.length;t++)r=r.concat(Pa(arguments[t]));return r};function Qa(r,t){for(var n=[],e=0;e<r.length;e++){n.push(r[e]),e===r.length-1||n.push(t)}return n}function va(r){var t=[];return r.forEach(function(r){t.push.apply(t,sb(r))}),t}K.arrayJoin=Qa,K.flatten=va;var Ra=function(r){return[].concat.apply([],r)};function Sa(r,t){return new Array(r).fill(null).map(function(r,n){return t(n)})}function Ca(r,t){return new Array(r).fill(t).join("")}K.flattenTwice=Ra,K.times=Sa,K.repeat=Ca;var Ta=function(){function r(){this._list=[]}return r.prototype.get=function(r,t){var n=this._list.findIndex(function(n){var e=Pa(n,2),$=e[0],o=e[1];return $===r&&o===t});return-1===n?(this._list.push([r,t]),this._list.length-1):n},r.prototype.size=function(){return this._list.length},r}();function Ua(r){if(0===r.length)throw new Error("Cannot format an empty list");if(1===r.length)return r[0];var t=r.map(function(r){return"\""+r+"\""}),n=t.pop();return t.join(", ")+" and "+n}K.ScopedIdMap=Ta,K.formatList=Ua;var Va=pa&&pa.__extends||function(){var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var e in t)t.hasOwnProperty(e)&&(r[e]=t[e])})(t,e)};return function(t,e){function o(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}();function Wa(r,t,e){void 0===e&&(e=1);var o=Math.max(r.first_line-1-e,0),n=r.last_line+e,$=t.split("\n").slice(o,n).map(function(t,e){var n=e+o+1;return(n>=r.first_line&&n<=r.last_line?">":" ")+" "+n+" | "+t});if(r.first_line===r.last_line){var i=Ca(r.first_column," "),p=Ca(r.last_column-r.first_column,"^"),a=r.first_line-o;$.splice(a,0," | "+i+p)}return $.join("\n")}pa.printLoc=Wa;var Xa=function(r){function t(t,e,o){var n=r.call(this,t)||this;return n.sourceContext=Wa(e,o),n.loc=e,n}return Va(t,r),t}(Error),tb=function(r){function t(){return null!==r&&r.apply(this,arguments)||this}return Va(t,r),t}(Xa);function ca(r,t,e){return new tb(r,t,e)}function Z(r,t,e){return new Xa(r,t,e)}pa.createUserError=ca,pa.createCompilerError=Z;var Ya=na&&na.__assign||function(){return(Ya=Object.assign||function(r){for(var e,$=1,t=arguments.length;$<t;$++)for(var o in e=arguments[$])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r}).apply(this,arguments)},ub=na&&na.__read||function(r,e){var $="function"==typeof Symbol&&r[Symbol.iterator];if(!$)return r;var t,o,a=$.call(r),n=[];try{for(;(void 0===e||e-->0)&&!(t=a.next()).done;)n.push(t.value)}catch(i){o={error:i}}finally{try{t&&!t.done&&($=a.return)&&$.call(a)}finally{if(o)throw o.error}}return n};function Za(r,e){var $=Ia(e,r.first_column),t=Ia(e,r.last_column);return{first_column:$.column,last_column:t.column,first_line:$.line,last_line:t.line}}function Da(r){var e=ub(lb(r),2),$=e[0],t=e[1];try{var o=qb.parse($);return Ba(o,function(e){if(1!==e.loc.first_line||1!=e.loc.last_line)throw Z("Unexpected multiline",e.loc,r);return Ya(Ya({},e),{loc:Za(e.loc,t)})})}catch(a){if(null==a.hash)throw a;throw ca("Parse Error: "+a.message.split("\n")[3],Za(a.hash.loc,t),r)}}na.parse=Da;var qa={};var ra={};var B={};function vb(a,t){var o,r,h,p=52,M=64-p-1,w=(1<<M)-1,$=w>>1,e=23===p?Math.pow(2,-24)-Math.pow(2,-77):0,i=0,c=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(r=isNaN(t)?1:0,o=w):(o=Math.floor(Math.log(t)/Math.LN2),t*(h=Math.pow(2,-o))<1&&(o--,h*=2),(t+=o+$>=1?e/h:e*Math.pow(2,1-$))*h>=2&&(o++,h/=2),o+$>=w?(r=0,o=w):o+$>=1?(r=(t*h-1)*Math.pow(2,p),o+=$):(r=t*Math.pow(2,$-1)*Math.pow(2,p),o=0));p>=8;a[0+i]=255&r,i+=1,r/=256,p-=8);for(o=o<<p|r,M+=p;M>0;a[0+i]=255&o,i+=1,o/=256,M-=8);a[0+i-1]|=128*c}var wb=B&&B.__read||function($,e){var r="function"==typeof Symbol&&$[Symbol.iterator];if(!r)return $;var x,t,o=r.call($),n=[];try{for(;(void 0===e||e-->0)&&!(x=o.next()).done;)n.push(x.value)}catch(_){t={error:_}}finally{try{x&&!x.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n},H=B&&B.__spread||function(){for(var $=[],e=0;e<arguments.length;e++)$=$.concat(wb(arguments[e]));return $},$a=[0,97,115,109];B.MAGIC=$a;var _a=[1,0,0,0];B.WASM_VERSION=_a;var wa=1e-5;B.EPSILON=wa;var da={TYPE:1,IMPORT:2,FUNC:3,MEMORY:5,GLOBAL:6,EXPORT:7,CODE:10};B.SECTION=da;var ab={FUNC:0,TABLE:1,MEMORY:2,GLOBAL:3};B.EXPORT_TYPE=ab;var j={loop:function($){return[3,$]},if:function($){return[4,$]},else:5,end:11,br_if:function($){return H([13],G($))},call:function($){return H([16],G($))},drop:26,select:27,local_get:function($){return H([32],G($))},local_set:function($){return H([33],G($))},local_tee:function($){return H([34],G($))},global_get:function($){return H([35],G($))},global_set:function($){return H([36],G($))},f64_load:function($,e){return H([43],G($),G(e))},f64_store:function($,e){return H([57],G($),G(e))},i32_const:function($){return H([65],fb($))},f64_const:function($){return H([68],eb($))},i32_eqz:69,i32_ne:71,i32_lt_s:72,i32_lt_u:73,i32_gt_s:74,i32_le_s:76,i32_le_u:77,i32_ge_s:78,f64_eq:97,f64_ne:98,f64_lt:99,f64_gt:100,f64_le:101,f64_ge:102,i32_add:106,i32_sub:107,i32_mul:108,i32_and:113,i32_or:114,i64_rem_s:129,i64_and:131,i64_or:132,f64_abs:153,f64_neg:154,f64_ceil:155,f64_floor:156,f64_sqrt:159,f64_add:160,f64_sub:161,f64_mul:162,f64_div:163,f64_min:164,f64_max:165,i32_trunc_f64_s:170,i64_trunc_s_f64:176,f64_convert_i64_s:185,f64_convert_i32_s:183};B.op=j;var q={i32:127,i64:126,f32:125,f64:124};B.VAL_TYPE=q;var Ea={const:0,var:1};B.MUTABILITY=Ea;var Q={void:64,i32:127,i64:126,f32:125,f64:124};B.BLOCK=Q;var bb=96;B.FUNCTION_TYPE=bb;var xb=2;B.MEMORY_IDX=xb;var cb=3;B.GLOBAL_TYPE=cb;var db=0;B.TYPE_IDX=db;var ka=H([j.f64_abs],j.f64_const(wa),[j.f64_lt]);B.IS_ZEROISH=ka;var U=H([j.f64_abs],j.f64_const(wa),[j.f64_gt]);function eb($){var e=new Uint8Array(8);return vb(e,$),e}B.IS_NOT_ZEROISH=U,B.encodef64=eb;var la=function($){return H([$.length],$.split("").map(function($){return $.charCodeAt(0)}))};function G($){var e=[];do{var r=127&$;0!==($>>>=7)&&(r|=128),e.push(r)}while(0!==$);return e}function fb($){for(var e=[],r=0,x=Math.ceil(Math.log2(Math.abs($))),t=$<0,o=!0;o;)r=127&$,$>>=7,t&&($|=-(1<<x-7)),0==$&&0==(64&r)||-1==$&&64==(64&r)?o=!1:r|=128,e.push(r);return e}B.encodeString=la,B.unsignedLEB128=G,B.signedLEB128=fb;var ga=function($){return H(G($.length),Ra($))};function ea($,e){return 0===e.length?[]:H([$],ga(ga(e)))}B.encodeVector=ga,B.encodeSection=ea;var yb=1e-5,sa={sin:Math.sin,cos:Math.cos,tan:Math.tan,asin:Math.asin,acos:Math.acos,atan:Math.atan,atan2:Math.atan2,rand:function(a){return Math.floor(Math.random()*a)},pow:Math.pow,log:Math.log,log10:Math.log10,exp:Math.exp,sigmoid:function(a,t){var o=1+Math.exp(-a*t);return Math.abs(o)>yb?1/o:0}};var ta={};var zb=65536,Ab=8,Bb=2,Cb=1048576;var Fa=8388608;var gb=Math.ceil(Fa*Ab*Bb/zb);var Db=ta&&ta.__read||function($,o){var r="function"==typeof Symbol&&$[Symbol.iterator];if(!r)return $;var e,n,p=r.call($),t=[];try{for(;(void 0===o||o-->0)&&!(e=p.next()).done;)t.push(e.value)}catch(i){n={error:i}}finally{try{e&&!e.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}return t},aa=ta&&ta.__spread||function(){for(var $=[],o=0;o<arguments.length;o++)$=$.concat(Db(arguments[o]));return $},ua={sqr:{args:[q.f64],returns:[q.f64],binary:aa(j.local_get(0),j.local_get(0),[j.f64_mul])},bor:{args:[q.f64,q.f64],returns:[q.f64],binary:aa(j.local_get(0),U,j.local_get(1),U,[j.i32_or],j.i32_const(0),[j.i32_ne,j.f64_convert_i32_s])},band:{args:[q.f64,q.f64],returns:[q.f64],binary:aa(j.local_get(0),U,j.local_get(1),U,[j.i32_and],j.i32_const(0),[j.i32_ne,j.f64_convert_i32_s])},sign:{args:[q.f64],returns:[q.f64],binary:aa(j.f64_const(0),j.local_get(0),[j.f64_lt],j.local_get(0),j.f64_const(0),[j.f64_lt,j.i32_sub,j.f64_convert_i32_s])},mod:{args:[q.f64,q.f64],returns:[q.f64],binary:aa(j.local_get(1),j.f64_const(0),[j.f64_ne],j.if(Q.f64),j.local_get(0),[j.i64_trunc_s_f64],j.local_get(1),[j.i64_trunc_s_f64,j.i64_rem_s,j.f64_convert_i64_s,j.else],j.f64_const(0),[j.end])},bitwiseOr:{args:[q.f64,q.f64],returns:[q.f64],binary:aa(j.local_get(0),[j.i64_trunc_s_f64],j.local_get(1),[j.i64_trunc_s_f64,j.i64_or,j.f64_convert_i64_s])},bitwiseAnd:{args:[q.f64,q.f64],returns:[q.f64],binary:aa(j.local_get(0),[j.i64_trunc_s_f64],j.local_get(1),[j.i64_trunc_s_f64,j.i64_and,j.f64_convert_i64_s])},div:{args:[q.f64,q.f64],returns:[q.f64],localVariables:[q.i32],binary:aa(j.local_get(1),j.f64_const(0),[j.f64_ne],j.if(Q.f64),j.local_get(0),j.local_get(1),[j.f64_div,j.else],j.f64_const(0),[j.end])},_getBufferIndex:{args:[q.f64],returns:[q.i32],localVariables:[q.f64,q.i32],binary:aa(j.f64_const(wa),j.local_get(0),[j.f64_add],j.local_tee(1),[j.i32_trunc_f64_s],j.local_set(2),j.i32_const(-1),j.local_get(2),j.i32_const(8),[j.i32_mul],j.local_get(2),j.i32_const(0),[j.i32_lt_s],j.local_get(2),j.i32_const(Fa-1),[j.i32_gt_s,j.i32_or,j.select])}};ta.localFuncMap=ua;var hb=ra&&ra.__read||function($,r){var o="function"==typeof Symbol&&$[Symbol.iterator];if(!o)return $;var e,t,p=o.call($),i=[];try{for(;(void 0===r||r-->0)&&!(e=p.next()).done;)i.push(e.value)}catch(a){t={error:a}}finally{try{e&&!e.done&&(o=p.return)&&o.call(p)}finally{if(t)throw t.error}}return i},z=ra&&ra.__spread||function(){for(var $=[],r=0;r<arguments.length;r++)$=$.concat(hb(arguments[r]));return $};function C($,r){switch($.type){case"SCRIPT":var o=$.body.map(function($,o){return z(C($,r),[j.drop])});return va(o);case"EXPRESSION_BLOCK":return Ga($.body,r);case"BINARY_EXPRESSION":var e=C($.left,r),t=C($.right,r);if(null==(b={"+":[j.f64_add],"-":[j.f64_sub],"*":[j.f64_mul],"/":r.resolveFunc("div"),"%":r.resolveFunc("mod"),"|":r.resolveFunc("bitwiseOr"),"&":r.resolveFunc("bitwiseAnd"),"^":r.resolveFunc("pow"),"==":z([j.f64_sub],ka,[j.f64_convert_i32_s]),"!=":z([j.f64_sub],U,[j.f64_convert_i32_s]),"<":[j.f64_lt,j.f64_convert_i32_s],">":[j.f64_gt,j.f64_convert_i32_s],"<=":[j.f64_le,j.f64_convert_i32_s],">=":[j.f64_ge,j.f64_convert_i32_s]}[$.operator]))throw Z("Unknown binary expression operator "+$.operator,$.loc,r.rawSource);return z(e,t,b);case"CALL_EXPRESSION":var p=$.callee.value,i=$.arguments,a=function(o){if(i.length<o)throw ca("Too few arguments passed to `"+p+"()`. Expected "+o+" but only got "+i.length+".",$.loc,r.rawSource);if(i.length>o)throw ca("Too many arguments passed to `"+p+"()`. Expected "+o+" but got "+i.length+".",i[o].loc,r.rawSource)};switch(p){case"exec2":return a(2),Ga($.arguments,r);case"exec3":return a(3),Ga($.arguments,r);case"if":a(3);var m=hb($.arguments,3);return Gb(m[0],m[1],m[2],r);case"while":return a(1),Eb($.arguments[0],r);case"loop":return a(2),Fb($.arguments[0],$.arguments[1],r);case"megabuf":case"gmegabuf":a(1);var V=r.resolveLocal(q.i32);return z(C($.arguments[0],r),r.resolveFunc("_getBufferIndex"),j.local_tee(V),j.i32_const(-1),[j.i32_ne],j.if(Q.f64),j.local_get(V),j.f64_load(3,ib(p)),[j.else],j.f64_const(0),[j.end]);case"assign":a(2);var W=$.arguments[0];if("IDENTIFIER"!=W.type)throw ca("Expected the first argument of `assign()` to be an identifier.",W.loc,r.rawSource);var n=r.resolveVar(W.value);return z(C($.arguments[1],r),j.global_set(n),j.global_get(n));}var s=va($.arguments.map(function($){return C($,r)}));switch(p){case"abs":return a(1),z(s,[j.f64_abs]);case"sqrt":return a(1),z(s,[j.f64_sqrt]);case"int":return a(1),z(s,[j.f64_floor]);case"min":return a(2),z(s,[j.f64_min]);case"max":return a(2),z(s,[j.f64_max]);case"above":return a(2),z(s,[j.f64_gt,j.f64_convert_i32_s]);case"below":return a(2),z(s,[j.f64_lt,j.f64_convert_i32_s]);case"equal":return a(2),z(s,[j.f64_sub],ka,[j.f64_convert_i32_s]);case"bnot":return a(1),z(s,ka,[j.f64_convert_i32_s]);case"floor":return a(1),z(s,[j.f64_floor]);case"ceil":return a(1),z(s,[j.f64_ceil]);}var l=r.resolveFunc(p);if(null==l||p.startsWith("_"))throw ca("\""+p+"\" is not defined.",$.callee.loc,r.rawSource);if(null!=sa[p])a(sa[p].length);else{if(null==ua[p])throw Z("Missing arity information for the function `"+p+"()`",$.callee.loc,r.rawSource);a(ua[p].args.length)}return z(s,l);case"ASSIGNMENT_EXPRESSION":e=$.left;var _=C($.right,r),c=Hb($,r);if("IDENTIFIER"===e.type){n=r.resolveVar(e.value);var u=j.global_get(n),f=j.global_set(n);return null===c?z(_,f,u):z(u,_,c,f,u)}if("CALL_EXPRESSION"!==e.type)throw Z("Unexpected left hand side type for assignment: "+e.type,$.loc,r.rawSource);var v=r.resolveLocal(q.i32);if(1!==e.arguments.length)throw ca("Expected 1 argument when assinging to a buffer but got "+e.arguments.length+".",0===e.arguments.length?e.loc:e.arguments[1].loc,r.rawSource);var d=e.callee.value;if("gmegabuf"!==d&&"megabuf"!==d)throw ca("The only function calls which may be assigned to are `gmegabuf()` and `megabuf()`.",e.callee.loc,r.rawSource);var g=ib(d);if(null===c){var E=r.resolveLocal(q.i32),S=r.resolveLocal(q.f64);return z(_,j.local_set(S),C(e.arguments[0],r),r.resolveFunc("_getBufferIndex"),j.local_tee(E),j.i32_const(0),[j.i32_lt_s],j.if(Q.f64),j.f64_const(0),[j.else],j.local_get(E),j.local_tee(v),j.local_get(S),j.f64_store(3,g),j.local_get(S),[j.end])}V=r.resolveLocal(q.i32);var h=r.resolveLocal(q.i32),I=r.resolveLocal(q.f64),x=r.resolveLocal(q.f64);return z(_,j.local_set(I),C(e.arguments[0],r),r.resolveFunc("_getBufferIndex"),j.local_tee(V),j.i32_const(-1),[j.i32_ne],j.local_tee(h),j.if(Q.f64),j.local_get(V),j.f64_load(3,g),[j.else],j.f64_const(0),[j.end],j.local_get(I),c,j.local_tee(x),j.local_get(h),j.if(Q.void),j.local_get(V),j.local_get(x),j.f64_store(3,g),[j.end]);case"LOGICAL_EXPRESSION":e=C($.left,r),t=C($.right,r);var w={"&&":{comparison:ka,shortCircutValue:0},"||":{comparison:U,shortCircutValue:1}}[$.operator];if(null==w)throw Z("Unknown logical expression operator "+$.operator,$.loc,r.rawSource);var O=w.comparison,L=w.shortCircutValue;return z(e,O,j.if(Q.f64),j.f64_const(L),[j.else],t,U,[j.f64_convert_i32_s,j.end]);case"UNARY_EXPRESSION":var b,y=C($.value,r);if(null==(b={"-":[j.f64_neg],"+":[],"!":z(ka,[j.f64_convert_i32_s])}[$.operator]))throw Z("Unknown logical unary operator "+$.operator,$.loc,r.rawSource);return z(y,b);case"IDENTIFIER":var R=$.value;return j.global_get(r.resolveVar(R));case"NUMBER_LITERAL":return j.f64_const($.value);default:throw Z("Unknown AST node type "+$.type,$.loc,r.rawSource);}}function Ga($,r){var o=$.map(function($,o){return C($,r)});return va(Qa(o,[j.drop]))}function Eb($,r){var o=C($,r),e=r.resolveLocal(q.i32);return z(j.i32_const(0),j.local_set(e),j.loop(Q.void),j.local_get(e),j.i32_const(1),[j.i32_add],j.local_tee(e),j.i32_const(Cb),[j.i32_lt_u],o,U,[j.i32_and],j.br_if(0),[j.end],j.f64_const(0))}function Fb($,r,o){var e=C(r,o),t=o.resolveLocal(q.f64);return z(C($,o),j.local_set(t),j.loop(Q.void),e,[j.drop],j.local_get(t),j.f64_const(1),[j.f64_sub],j.local_tee(t),U,j.br_if(0),[j.end],j.f64_const(0))}function Gb($,r,o,e){return z(C($,e),U,j.if(Q.f64),C(r,e),[j.else],C(o,e),[j.end])}function ib($){switch($){case"gmegabuf":return 8*Fa;case"megabuf":return 0;}}function Hb($,r){var o={"+=":[j.f64_add],"-=":[j.f64_sub],"*=":[j.f64_mul],"/=":[j.f64_div],"%=":r.resolveFunc("mod"),"=":null}[$.operator];if(void 0===o)throw Z("Unknown assignment operator \""+$.operator+"\"",$.loc,r.rawSource);return o}ra.emit=C;var ma=qa&&qa.__read||function(r,$){var e="function"==typeof Symbol&&r[Symbol.iterator];if(!e)return r;var o,t,n=e.call(r),d=[];try{for(;(void 0===$||$-->0)&&!(o=n.next()).done;)d.push(o.value)}catch(i){t={error:i}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return d},J=qa&&qa.__spread||function(){for(var r=[],$=0;$<arguments.length;$++)r=r.concat(ma(arguments[$]));return r};function Ha(r){var $=r.pools,e=r.functions,o=r.preParsed,t=void 0!==o&&o;if(Object.keys($).includes("shims"))throw new Error("You may not name a pool \"shims\". \"shims\" is reserved for injected JavaScript functions.");var n=[];Object.entries($).forEach(function(r){var $=ma(r,2),e=$[0];$[1].forEach(function(r){n.push([e,r])})});var d=new Ta;n.forEach(function(r){var $=ma(r,2),e=$[0],o=$[1];d.get(e,o)});var i=Object.entries(sa).map(function(r){var $=ma(r,2),e=$[0],o=$[1];return{args:new Array(o.length).fill(null).map(function(r){return q.f64}),returns:[q.f64],name:e}}),a=[],p=[];Object.entries(e).forEach(function(r){var e=ma(r,2),o=e[0],n=e[1],c=n.pool,s=n.code;if(null==$[c]){var u=Object.keys($);if(0===u.length)throw new Error("The function \""+o+"\" was declared as using a variable pool named \""+c+"\" but no pools were defined.");throw new Error("The function \""+o+"\" was declared as using a variable pool named \""+c+"\" which is not among the variable pools defined. The defined variable pools are: "+Ua(u)+".")}var X=t?s:Da(s);if("string"==typeof X)throw new Error("Got passed unparsed code without setting the preParsed flag");var D=[],l=C(X,{resolveVar:function(r){return /reg\d\d/.test(r)?d.get(null,r):d.get(c,r)},resolveLocal:function(r){return D.push(r),D.length-1},resolveFunc:function(r){var $=i.findIndex(function($){return $.name===r});if(-1!==$)return j.call($);if(null==ua[r])return null;var e=a.indexOf(r);return-1===e&&(a.push(r),e=a.length-1),j.call(e+i.length)},rawSource:s});p.push({binary:l,exportName:o,args:[],returns:[],localVariables:D})});var c=a.map(function(r){var $=ua[r];if(null==$)throw new Error("Undefined local function \""+r+"\"");return $}),s=function(r){return J(r.args,["|"],r.returns).join("-")},u=[],X=new Map;function D(r){var $=s(r),e=X.get($);if(null==e)throw new Error("Failed to get a type index for key "+$);return e}J(i,c,p).forEach(function(r){var $=s(r);X.has($)||(u.push(J([bb],ga(r.args),ga(r.returns))),X.set($,u.length-1))});var l=J(n.map(function(r){var $=ma(r,2),e=$[0],o=$[1];return J(la(e),la(o),[cb,q.f64,Ea.var])}),i.map(function(r,$){var e=D(r);return J(la("shims"),la(r.name),J([db],G(e)))})),m=J(c,p).map(function(r){var $=D(r);return G($)}),f=[J([1],G(gb),G(gb))],v=d.size()-n.length,_=Sa(v,function(){return J([q.f64,Ea.var],j.f64_const(0),[j.end])}),h=J(p).map(function(r,$){var e=$+i.length+c.length;return J(la(r.exportName),[ab.FUNC],G(e))}),E=J(c,p).map(function(r){var $,e=(null!==($=r.localVariables)&&void 0!==$?$:[]).map(function(r){return J(G(1),[r])});return ga(J(ga(e),r.binary,[j.end]))});return new Uint8Array(J($a,_a,ea(da.TYPE,u),ea(da.IMPORT,l),ea(da.FUNC,m),ea(da.MEMORY,f),ea(da.GLOBAL,_),ea(da.EXPORT,h),ea(da.CODE,E)))}qa.compileModule=Ha;var ba={};var jb=ba&&ba.__assign||function(){return(jb=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r}).apply(this,arguments)},Ib=ba&&ba.__awaiter||function(r,e,t,n){return new(t||(t=Promise))(function(o,a){function l(r){try{i(n.next(r))}catch(e){a(e)}}function u(r){try{i(n.throw(r))}catch(e){a(e)}}function i(r){var e;r.done?o(r.value):(e=r.value,e instanceof t?e:new t(function(r){r(e)})).then(l,u)}i((n=n.apply(r,e||[])).next())})},Jb=ba&&ba.__generator||function(r,e){var t,n,o,a,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;l;)try{if(t=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return l.label++,{value:a[1],done:!1};case 5:l.label++,n=a[1],a=[0];continue;case 7:a=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){l=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){l.label=a[1];break}if(6===a[0]&&l.label<o[1]){l.label=o[1],o=a;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(a);break}o[2]&&l.ops.pop(),l.trys.pop();continue;}a=e.call(r,l)}catch(u){a=[6,u],n=0}finally{t=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},Kb=ba&&ba.__read||function(r,e){var t="function"==typeof Symbol&&r[Symbol.iterator];if(!t)return r;var n,o,a=t.call(r),l=[];try{for(;(void 0===e||e-->0)&&!(n=a.next()).done;)l.push(n.value)}catch(u){o={error:u}}finally{try{n&&!n.done&&(t=a.return)&&t.call(a)}finally{if(o)throw o.error}}return l};function kb(r){var e=r.pools,t=r.functions;return Ib(this,void 0,void 0,function(){var r,n,o,a;return Jb(this,function(l){switch(l.label){case 0:return r={},Object.entries(e).forEach(function(e){var t=Kb(e,2),n=t[0],o=t[1];r[n]=new Set(Object.keys(o))}),n=Ha({pools:r,functions:t}),[4,WebAssembly.compile(n)];case 1:return o=l.sent(),a=jb(jb({},e),{shims:sa}),[4,WebAssembly.instantiate(o,a)];case 2:return[2,l.sent()];}})})}ba.loadModule=kb;ha.loadModule=kb,ha.shims=sa,ha.compileModule=Ha,ha.parse=Da;if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=ha}else if(typeof define==="function"&&define.amd){define(function(){return ha})}})();
(function () {var ia={};var oa={};function Ja(r,e){var o={destCol:1,srcCol:1,srcLine:1};r.forEach(function(r){r.destCol>e||(o=r)});var t=e-o.destCol;return{column:o.srcCol+t,line:o.srcLine}}function mb(r){for(var e=[],o=1,t="",s=0,$=!1,c=!1,n=!1,l=0;l<r.length;l++){var p=r[l];if(n){var i=t.length+1,a=l-s+1;e.push({destCol:i,srcCol:a,srcLine:o}),n=!1}"\n"===p?($=!1,o++,s=l+1,n=!0):"\r"===p&&"\n"===r[l+1]?($=!1,o++,s=++l+1,n=!0):c&&"*"===p&&"/"===r[l+1]?(c=!1,l++,n=!0):"\\"===p&&"\\"===r[l+1]||"/"===p&&"/"===r[l+1]?($=!0,l++):"/"===p&&"*"===r[l+1]?(c=!0,l++):$||c||(t+=p)}return[t,e]}var ja,ka,nb={},G=nb={};function ya(){throw new Error("setTimeout has not been defined")}function za(){throw new Error("clearTimeout has not been defined")}function Ka($){if(ja===setTimeout)return setTimeout($,0);if((ja===ya||!ja)&&setTimeout)return ja=setTimeout,setTimeout($,0);try{return ja($,0)}catch(e){try{return ja.call(null,$,0)}catch(e){return ja.call(this,$,0)}}}function ob($){if(ka===clearTimeout)return clearTimeout($);if((ka===za||!ka)&&clearTimeout)return ka=clearTimeout,clearTimeout($);try{return ka($)}catch(e){try{return ka.call(null,$)}catch(e){return ka.call(this,$)}}}!function(){try{ja="function"==typeof setTimeout?setTimeout:ya}catch($){ja=ya}try{ka="function"==typeof clearTimeout?clearTimeout:za}catch($){ka=za}}();var pa,ga=[],Aa=!1,La=-1;function pb(){Aa&&pa&&(Aa=!1,pa.length?ga=pa.concat(ga):La=-1,ga.length&&Ma())}function Ma(){if(!Aa){var $=Ka(pb);Aa=!0;for(var e=ga.length;e;){for(pa=ga,ga=[];++La<e;)pa&&pa[La].run();La=-1,e=ga.length}pa=null,Aa=!1,ob($)}}function Na($,e){this.fun=$,this.array=e}function Z(){}G.nextTick=function($){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];ga.push(new Na($,e)),1!==ga.length||Aa||Ka(Ma)},Na.prototype.run=function(){this.fun.apply(null,this.array)},G.title="browser",G.env={},G.argv=[],G.version="",G.versions={},G.on=Z,G.addListener=Z,G.once=Z,G.off=Z,G.removeListener=Z,G.removeAllListeners=Z,G.emit=Z,G.prependListener=Z,G.prependOnceListener=Z,G.listeners=function($){return[]},G.binding=function($){throw new Error("process.binding is not supported")},G.cwd=function(){return"/"},G.chdir=function($){throw new Error("process.chdir is not supported")},G.umask=function(){return 0};var qb=function(){var t={exports:this},i=function(){var t=function(t,e,i,s){for(i=i||{},s=t.length;s--;i[t[s]]=e);return i},e=[1,18],i=[1,7],s=[1,19],n=[1,20],r=[1,14],h=[1,15],o=[1,16],a=[1,33],c=[1,31],l=[1,23],y=[1,22],u=[1,24],p=[1,25],_=[1,26],f=[1,27],g=[1,28],m=[1,29],E=[1,30],k=[5,8,15,18,20,28,29,32,33,34,35,36,37,38],I=[5,15,18],b=[5,12,15,17,18,24,25,28,29,30],S=[1,57],d=[5,8,12,15,17,18,24,25,28,29,30],N=[15,18],O=[5,8,15,18,28,29,38],$=[5,8,15,18,28,29,32,33,38],x=[5,8,15,18,28,29,32,33,34,37,38],A=[5,8,15,18,28,29,32,33,34,35,36,37,38],R=[5,8,15,18],v=[5,8,15,18,20,22,28,29,32,33,34,35,36,37,38],T={trace:function(){},yy:{},symbols_:{error:2,SCRIPT:3,expression:4,EOF:5,expressionsOptionalTrailingSemi:6,separator:7,";":8,expressions:9,EXPRESSION_BLOCK:10,IDENTIFIER:11,IDENTIFIER_TOKEN:12,argument:13,arguments:14,",":15,FUNCTION_CALL:16,"(":17,")":18,LOGICAL_EXPRESSION:19,LOGICAL_OPERATOR_TOKEN:20,ASSIGNMENT:21,ASSIGNMENT_OPERATOR_TOKEN:22,number:23,DIGITS_TOKEN:24,".":25,NUMBER_LITERAL:26,UNARY_EXPRESSION:27,"-":28,"+":29,"!":30,BINARY_EXPRESSION:31,"*":32,"/":33,"%":34,"&":35,"|":36,"^":37,COMPARISON_TOKEN:38,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",8:";",12:"IDENTIFIER_TOKEN",15:",",17:"(",18:")",20:"LOGICAL_OPERATOR_TOKEN",22:"ASSIGNMENT_OPERATOR_TOKEN",24:"DIGITS_TOKEN",25:".",28:"-",29:"+",30:"!",32:"*",33:"/",34:"%",35:"&",36:"|",37:"^",38:"COMPARISON_TOKEN"},productions_:[0,[3,2],[3,2],[3,1],[7,1],[7,2],[9,2],[9,3],[6,1],[6,2],[10,1],[11,1],[13,1],[13,1],[14,1],[14,3],[16,3],[16,4],[19,3],[21,3],[21,3],[23,1],[23,2],[23,3],[23,2],[23,1],[26,1],[27,2],[27,2],[27,2],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[4,1],[4,1],[4,3],[4,1],[4,1],[4,1],[4,1],[4,1],[4,3]],performAction:function(t,e,i,s,n,r,h){var o=r.length-1;switch(n){case 1:return{type:"SCRIPT",body:[r[o-1]],loc:this._$};case 2:return{type:"SCRIPT",body:r[o-1],loc:this._$};case 3:return{type:"SCRIPT",body:[],loc:this._$};case 6:this.$=[r[o-1]];break;case 7:this.$=r[o-2].concat([r[o-1]]);break;case 8:this.$=r[o];break;case 9:this.$=r[o-1].concat([r[o]]);break;case 10:this.$={type:"EXPRESSION_BLOCK",body:r[o],loc:this._$};break;case 11:this.$={type:"IDENTIFIER",value:r[o].toLowerCase(),loc:this._$};break;case 14:this.$=[r[o]];break;case 15:this.$=r[o-2].concat([r[o]]);break;case 16:this.$={type:"CALL_EXPRESSION",callee:r[o-2],arguments:[],loc:this._$};break;case 17:this.$={type:"CALL_EXPRESSION",callee:r[o-3],arguments:r[o-1],loc:this._$};break;case 18:this.$={type:"LOGICAL_EXPRESSION",left:r[o-2],right:r[o],operator:r[o-1],loc:this._$};break;case 19:case 20:this.$={type:"ASSIGNMENT_EXPRESSION",left:r[o-2],operator:r[o-1],right:r[o],loc:this._$};break;case 21:this.$=Number(r[o]);break;case 22:this.$=Number(r[o-1]);break;case 23:this.$=Number(r[o-2]+r[o-1]+r[o]);break;case 24:this.$=Number("0"+r[o-1]+r[o]);break;case 25:this.$=0;break;case 26:this.$={type:"NUMBER_LITERAL",value:r[o],loc:this._$};break;case 27:case 28:case 29:this.$={type:"UNARY_EXPRESSION",value:r[o],operator:r[o-1],loc:this._$};break;case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:case 38:this.$={type:"BINARY_EXPRESSION",left:r[o-2],right:r[o],operator:r[o-1],loc:this._$};break;case 41:case 47:this.$=r[o-1];}},table:[{3:1,4:2,5:[1,4],6:3,9:13,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{1:[3]},{5:[1,21],7:32,8:a,20:c,28:l,29:y,32:u,33:p,34:_,35:f,36:g,37:m,38:E},{5:[1,34]},{1:[2,3]},t(k,[2,39]),t(k,[2,40]),{4:35,6:37,9:13,10:36,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},t(k,[2,42]),t(k,[2,43]),t(k,[2,44],{22:[1,38]}),t(k,[2,45],{17:[1,40],22:[1,39]}),t(k,[2,46]),t(I,[2,8],{31:5,27:6,26:8,21:9,16:10,11:11,19:12,23:17,4:41,12:e,17:i,24:s,25:n,28:r,29:h,30:o}),{4:42,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:43,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:44,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},t(k,[2,26]),t([5,8,15,17,18,20,22,28,29,32,33,34,35,36,37,38],[2,11]),t(k,[2,21],{25:[1,45]}),t(k,[2,25],{24:[1,46]}),{1:[2,1]},{4:47,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:48,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:49,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:50,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:51,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:52,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:53,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:54,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:55,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:56,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},t(b,[2,6],{8:S}),t(d,[2,4]),{1:[2,2]},{7:32,8:a,18:[1,58],20:c,28:l,29:y,32:u,33:p,34:_,35:f,36:g,37:m,38:E},{18:[1,59]},t(N,[2,10]),{4:60,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:61,11:11,12:e,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},{4:65,6:37,9:13,10:66,11:11,12:e,13:64,14:63,16:10,17:i,18:[1,62],19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},t(I,[2,9],{7:67,8:a,20:c,28:l,29:y,32:u,33:p,34:_,35:f,36:g,37:m,38:E}),t(O,[2,27],{20:c,32:u,33:p,34:_,35:f,36:g,37:m}),t(O,[2,28],{20:c,32:u,33:p,34:_,35:f,36:g,37:m}),t(O,[2,29],{20:c,32:u,33:p,34:_,35:f,36:g,37:m}),t(k,[2,22],{24:[1,68]}),t(k,[2,24]),t(O,[2,30],{20:c,32:u,33:p,34:_,35:f,36:g,37:m}),t(O,[2,31],{20:c,32:u,33:p,34:_,35:f,36:g,37:m}),t($,[2,32],{20:c,34:_,35:f,36:g,37:m}),t($,[2,33],{20:c,34:_,35:f,36:g,37:m}),t(x,[2,34],{20:c,35:f,36:g}),t(A,[2,35],{20:c}),t(A,[2,36],{20:c}),t(x,[2,37],{20:c,35:f,36:g}),t(R,[2,38],{20:c,28:l,29:y,32:u,33:p,34:_,35:f,36:g,37:m,38:E}),t(k,[2,18]),t(d,[2,5]),t(k,[2,41]),t(k,[2,47]),t(R,[2,20],{20:c,28:l,29:y,32:u,33:p,34:_,35:f,36:g,37:m,38:E}),t(R,[2,19],{20:c,28:l,29:y,32:u,33:p,34:_,35:f,36:g,37:m,38:E}),t(v,[2,16]),{15:[1,70],18:[1,69]},t(N,[2,14]),t(N,[2,12],{7:32,8:a,20:c,28:l,29:y,32:u,33:p,34:_,35:f,36:g,37:m,38:E}),t(N,[2,13]),t(b,[2,7],{8:S}),t(k,[2,23]),t(v,[2,17]),{4:65,6:37,9:13,10:66,11:11,12:e,13:71,16:10,17:i,19:12,21:9,23:17,24:s,25:n,26:8,27:6,28:r,29:h,30:o,31:5},t(N,[2,15])],defaultActions:{4:[2,3],21:[2,1],34:[2,2]},parseError:function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)},parse:function(t){var e=this,i=[0],s=[null],n=[],r=this.table,h="",o=0,a=0,c=0,l=n.slice.call(arguments,1),y=Object.create(this.lexer),u={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(u.yy[p]=this.yy[p]);y.setInput(t,u.yy),u.yy.lexer=y,u.yy.parser=this,void 0===y.yylloc&&(y.yylloc={});var _=y.yylloc;n.push(_);var f=y.options&&y.options.ranges;"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var g,m,E,k,I,b,S,d,N,O=function(){var t;return"number"!=typeof(t=y.lex()||1)&&(t=e.symbols_[t]||t),t},$={};;){if(E=i[i.length-1],this.defaultActions[E]?k=this.defaultActions[E]:(null==g&&(g=O()),k=r[E]&&r[E][g]),void 0===k||!k.length||!k[0]){var x="";for(b in N=[],r[E])this.terminals_[b]&&b>2&&N.push("'"+this.terminals_[b]+"'");x=y.showPosition?"Parse error on line "+(o+1)+":\n"+y.showPosition()+"\nExpecting "+N.join(", ")+", got '"+(this.terminals_[g]||g)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==g?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(x,{text:y.match,token:this.terminals_[g]||g,line:y.yylineno,loc:_,expected:N})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+E+", token: "+g);switch(k[0]){case 1:i.push(g),s.push(y.yytext),n.push(y.yylloc),i.push(k[1]),g=null,m?(g=m,m=null):(a=y.yyleng,h=y.yytext,o=y.yylineno,_=y.yylloc,c>0&&c--);break;case 2:if(S=this.productions_[k[1]][1],$.$=s[s.length-S],$._$={first_line:n[n.length-(S||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(S||1)].first_column,last_column:n[n.length-1].last_column},f&&($._$.range=[n[n.length-(S||1)].range[0],n[n.length-1].range[1]]),void 0!==(I=this.performAction.apply($,[h,a,o,u.yy,k[1],s,n].concat(l))))return I;S&&(i=i.slice(0,-1*S*2),s=s.slice(0,-1*S),n=n.slice(0,-1*S)),i.push(this.productions_[k[1]][0]),s.push($.$),n.push($._$),d=r[i[i.length-2]][i[i.length-1]],i.push(d);break;case 3:return!0;}}return!0}},P={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===s.length?this.yylloc.first_column:0)+s[s.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var i,s,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var r in n)this[r]=n[r];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,i,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),r=0;r<n.length;r++)if((i=this._input.match(this.rules[n[r]]))&&(!e||i[0].length>e[0].length)){if(e=i,s=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,n[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[s]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,i,s){switch(i){case 0:break;case 1:return 24;case 2:return 38;case 3:return 22;case 4:return 20;case 5:return 12;case 6:return 5;case 7:return e.yytext[0];}},rules:[/^(?:\s+)/,/^(?:[0-9]+)/,/^(?:(==|!=|<=|>=|<|>))/,/^(?:[+\-*/%]?=)/,/^(?:(\&\&)|\|\|)/,/^(?:[a-zA-Z_][a-zA-Z0-9._]*)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};function L(){this.yy={}}return T.lexer=P,L.prototype=T,T.Parser=L,new L}();return"undefined"!=typeof require&&void 0!==this&&(this.parser=i,this.Parser=i.Parser,this.parse=function(){return i.parse.apply(i,arguments)},this.main=function(){},void 0!==t&&require.main===t&&this.main(nb.argv.slice(1))),t.exports}.call({});var rb={};rb={parse:qb.parse};function Oa(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function Pa(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?Oa(Object(t),!0).forEach(function(r){Ba(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Oa(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function Ba(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var sb={ASSIGNMENT_EXPRESSION:[{type:"NODE",key:"right"}],SCRIPT:[{type:"ARRAY",key:"body"}],EXPRESSION_BLOCK:[{type:"ARRAY",key:"body"}],UNARY_EXPRESSION:[{type:"NODE",key:"value"}],NUMBER_LITERAL:[],IDENTIFIER:[],CALL_EXPRESSION:[{type:"ARRAY",key:"arguments"},{type:"NODE",key:"callee"}],BINARY_EXPRESSION:[{type:"NODE",key:"left"},{type:"NODE",key:"right"}],LOGICAL_EXPRESSION:[{type:"NODE",key:"left"},{type:"NODE",key:"right"}]};function Ca(e,r){var t=sb[e.type],n=e;if(null==t)throw new Error("Unknown children definition for ".concat(e.type));return t.forEach(function(t){if("NODE"===t.type){var o=e[t.key],$=Ca(o,r);$!==o&&(n=Pa({},n,Ba({},t.key,$)))}else if("ARRAY"===t.type){var p=e[t.key],y=p.map(function(e){return Ca(e,r)});p.some(function(e,r){return e!==y[r]})&&(n=Pa({},n,Ba({},t.key,y)))}}),r(n)}var qa={};var U={},Qa=U&&U.__read||function(r,t){var n="function"==typeof Symbol&&r[Symbol.iterator];if(!n)return r;var e,$,o=n.call(r),a=[];try{for(;(void 0===t||t-->0)&&!(e=o.next()).done;)a.push(e.value)}catch(p){$={error:p}}finally{try{e&&!e.done&&(n=o.return)&&n.call(o)}finally{if($)throw $.error}}return a},tb=U&&U.__spread||function(){for(var r=[],t=0;t<arguments.length;t++)r=r.concat(Qa(arguments[t]));return r};function Ra(r,t){for(var n=[],e=0;e<r.length;e++){n.push(r[e]),e===r.length-1||n.push(t)}return n}function wa(r){var t=[];return r.forEach(function(r){t.push.apply(t,tb(r))}),t}U.arrayJoin=Ra,U.flatten=wa;var Sa=function(r){return[].concat.apply([],r)};function Ta(r,t){return new Array(r).fill(null).map(function(r,n){return t(n)})}function Da(r,t){return new Array(r).fill(t).join("")}U.flattenTwice=Sa,U.times=Ta,U.repeat=Da;var Ua=function(){function r(){this._list=[]}return r.prototype.get=function(r,t){var n=this._list.findIndex(function(n){var e=Qa(n,2),$=e[0],o=e[1];return $===r&&o===t});return-1===n?(this._list.push([r,t]),this._list.length-1):n},r.prototype.size=function(){return this._list.length},r}();function Va(r){if(0===r.length)throw new Error("Cannot format an empty list");if(1===r.length)return r[0];var t=r.map(function(r){return"\""+r+"\""}),n=t.pop();return t.join(", ")+" and "+n}U.ScopedIdMap=Ua,U.formatList=Va;var Wa=qa&&qa.__extends||function(){var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var e in t)t.hasOwnProperty(e)&&(r[e]=t[e])})(t,e)};return function(t,e){function o(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}();function Xa(r,t,e){void 0===e&&(e=1);var o=Math.max(r.first_line-1-e,0),n=r.last_line+e,$=t.split("\n").slice(o,n).map(function(t,e){var n=e+o+1;return(n>=r.first_line&&n<=r.last_line?">":" ")+" "+n+" | "+t});if(r.first_line===r.last_line){var i=Da(r.first_column," "),p=Da(r.last_column-r.first_column,"^"),a=r.first_line-o;$.splice(a,0," | "+i+p)}return $.join("\n")}qa.printLoc=Xa;var Ya=function(r){function t(t,e,o){var n=r.call(this,t)||this;return n.sourceContext=Xa(e,o),n.loc=e,n}return Wa(t,r),t}(Error),ub=function(r){function t(){return null!==r&&r.apply(this,arguments)||this}return Wa(t,r),t}(Ya);function da(r,t,e){return new ub(r,t,e)}function aa(r,t,e){return new Ya(r,t,e)}qa.createUserError=da,qa.createCompilerError=aa;var Za=oa&&oa.__assign||function(){return(Za=Object.assign||function(r){for(var e,$=1,t=arguments.length;$<t;$++)for(var o in e=arguments[$])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r}).apply(this,arguments)},vb=oa&&oa.__read||function(r,e){var $="function"==typeof Symbol&&r[Symbol.iterator];if(!$)return r;var t,o,a=$.call(r),n=[];try{for(;(void 0===e||e-->0)&&!(t=a.next()).done;)n.push(t.value)}catch(i){o={error:i}}finally{try{t&&!t.done&&($=a.return)&&$.call(a)}finally{if(o)throw o.error}}return n};function $a(r,e){var $=Ja(e,r.first_column),t=Ja(e,r.last_column);return{first_column:$.column,last_column:t.column,first_line:$.line,last_line:t.line}}function Ea(r){var e=vb(mb(r),2),$=e[0],t=e[1];try{var o=rb.parse($);return Ca(o,function(e){if(1!==e.loc.first_line||1!=e.loc.last_line)throw aa("Unexpected multiline",e.loc,r);return Za(Za({},e),{loc:$a(e.loc,t)})})}catch(a){if(null==a.hash)throw a;throw da("Parse Error: "+a.message.split("\n")[3],$a(a.hash.loc,t),r)}}oa.parse=Ea;var ra={};var sa={};var B={};function wb(a,t){var o,r,h,p=52,M=64-p-1,w=(1<<M)-1,$=w>>1,e=23===p?Math.pow(2,-24)-Math.pow(2,-77):0,i=0,c=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(r=isNaN(t)?1:0,o=w):(o=Math.floor(Math.log(t)/Math.LN2),t*(h=Math.pow(2,-o))<1&&(o--,h*=2),(t+=o+$>=1?e/h:e*Math.pow(2,1-$))*h>=2&&(o++,h/=2),o+$>=w?(r=0,o=w):o+$>=1?(r=(t*h-1)*Math.pow(2,p),o+=$):(r=t*Math.pow(2,$-1)*Math.pow(2,p),o=0));p>=8;a[0+i]=255&r,i+=1,r/=256,p-=8);for(o=o<<p|r,M+=p;M>0;a[0+i]=255&o,i+=1,o/=256,M-=8);a[0+i-1]|=128*c}var xb=B&&B.__read||function($,r){var e="function"==typeof Symbol&&$[Symbol.iterator];if(!e)return $;var x,t,o=e.call($),n=[];try{for(;(void 0===r||r-->0)&&!(x=o.next()).done;)n.push(x.value)}catch(_){t={error:_}}finally{try{x&&!x.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return n},K=B&&B.__spread||function(){for(var $=[],r=0;r<arguments.length;r++)$=$.concat(xb(arguments[r]));return $},_a=[0,97,115,109];B.MAGIC=_a;var ab=[1,0,0,0];B.WASM_VERSION=ab;var xa=1e-5;B.EPSILON=xa;var ea={TYPE:1,IMPORT:2,FUNC:3,MEMORY:5,GLOBAL:6,EXPORT:7,CODE:10};B.SECTION=ea;var bb={FUNC:0,TABLE:1,MEMORY:2,GLOBAL:3};B.EXPORT_TYPE=bb;var j={block:function($){return[2,$]},loop:function($){return[3,$]},if:function($){return[4,$]},else:5,end:11,br_if:function($){return K([13],H($))},call:function($){return K([16],H($))},drop:26,select:27,local_get:function($){return K([32],H($))},local_set:function($){return K([33],H($))},local_tee:function($){return K([34],H($))},global_get:function($){return K([35],H($))},global_set:function($){return K([36],H($))},f64_load:function($,r){return K([43],H($),H(r))},f64_store:function($,r){return K([57],H($),H(r))},i32_const:function($){return K([65],gb($))},f64_const:function($){return K([68],fb($))},i32_eqz:69,i32_ne:71,i32_lt_s:72,i32_lt_u:73,i32_gt_s:74,i32_le_s:76,i32_le_u:77,i32_ge_s:78,f64_eq:97,f64_ne:98,f64_lt:99,f64_gt:100,f64_le:101,f64_ge:102,i32_add:106,i32_sub:107,i32_mul:108,i32_and:113,i32_or:114,i64_rem_s:129,i64_and:131,i64_or:132,f64_abs:153,f64_neg:154,f64_ceil:155,f64_floor:156,f64_sqrt:159,f64_add:160,f64_sub:161,f64_mul:162,f64_div:163,f64_min:164,f64_max:165,i32_trunc_f64_s:170,i64_trunc_s_f64:176,f64_convert_i64_s:185,f64_convert_i32_s:183};B.op=j;var q={i32:127,i64:126,f32:125,f64:124};B.VAL_TYPE=q;var Fa={const:0,var:1};B.MUTABILITY=Fa;var Q={void:64,i32:127,i64:126,f32:125,f64:124};B.BLOCK=Q;var cb=96;B.FUNCTION_TYPE=cb;var yb=2;B.MEMORY_IDX=yb;var db=3;B.GLOBAL_TYPE=db;var eb=0;B.TYPE_IDX=eb;var la=K([j.f64_abs],j.f64_const(xa),[j.f64_lt]);B.IS_ZEROISH=la;var Y=K([j.f64_abs],j.f64_const(xa),[j.f64_gt]);function fb($){var r=new Uint8Array(8);return wb(r,$),r}B.IS_NOT_ZEROISH=Y,B.encodef64=fb;var ma=function($){return K([$.length],$.split("").map(function($){return $.charCodeAt(0)}))};function H($){var r=[];do{var e=127&$;0!==($>>>=7)&&(e|=128),r.push(e)}while(0!==$);return r}function gb($){for(var r=[],e=0,x=Math.ceil(Math.log2(Math.abs($))),t=$<0,o=!0;o;)e=127&$,$>>=7,t&&($|=-(1<<x-7)),0==$&&0==(64&e)||-1==$&&64==(64&e)?o=!1:e|=128,r.push(e);return r}B.encodeString=ma,B.unsignedLEB128=H,B.signedLEB128=gb;var ha=function($){return K(H($.length),Sa($))};function fa($,r){return 0===r.length?[]:K([$],ha(ha(r)))}B.encodeVector=ha,B.encodeSection=fa;var zb=1e-5,ta={sin:Math.sin,cos:Math.cos,tan:Math.tan,asin:Math.asin,acos:Math.acos,atan:Math.atan,atan2:Math.atan2,rand:function(a){return Math.random()*a},pow:Math.pow,log:Math.log,log10:Math.log10,exp:Math.exp,sigmoid:function(a,t){var n=1+Math.exp(-a*t);return Math.abs(n)>zb?1/n:0}};var ua={};var Ab=65536,Bb=8,Cb=2,Db=1048576;var Ga=8388608;var hb=Math.ceil(Ga*Bb*Cb/Ab);var Eb=ua&&ua.__read||function($,o){var r="function"==typeof Symbol&&$[Symbol.iterator];if(!r)return $;var e,n,p=r.call($),t=[];try{for(;(void 0===o||o-->0)&&!(e=p.next()).done;)t.push(e.value)}catch(i){n={error:i}}finally{try{e&&!e.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}return t},ba=ua&&ua.__spread||function(){for(var $=[],o=0;o<arguments.length;o++)$=$.concat(Eb(arguments[o]));return $},va={sqr:{args:[q.f64],returns:[q.f64],binary:ba(j.local_get(0),j.local_get(0),[j.f64_mul])},bor:{args:[q.f64,q.f64],returns:[q.f64],binary:ba(j.local_get(0),Y,j.local_get(1),Y,[j.i32_or],j.i32_const(0),[j.i32_ne,j.f64_convert_i32_s])},band:{args:[q.f64,q.f64],returns:[q.f64],binary:ba(j.local_get(0),Y,j.local_get(1),Y,[j.i32_and],j.i32_const(0),[j.i32_ne,j.f64_convert_i32_s])},sign:{args:[q.f64],returns:[q.f64],binary:ba(j.f64_const(0),j.local_get(0),[j.f64_lt],j.local_get(0),j.f64_const(0),[j.f64_lt,j.i32_sub,j.f64_convert_i32_s])},mod:{args:[q.f64,q.f64],returns:[q.f64],binary:ba(j.local_get(1),j.f64_const(0),[j.f64_ne],j.if(Q.f64),j.local_get(0),[j.i64_trunc_s_f64],j.local_get(1),[j.i64_trunc_s_f64,j.i64_rem_s,j.f64_convert_i64_s,j.else],j.f64_const(0),[j.end])},bitwiseOr:{args:[q.f64,q.f64],returns:[q.f64],binary:ba(j.local_get(0),[j.i64_trunc_s_f64],j.local_get(1),[j.i64_trunc_s_f64,j.i64_or,j.f64_convert_i64_s])},bitwiseAnd:{args:[q.f64,q.f64],returns:[q.f64],binary:ba(j.local_get(0),[j.i64_trunc_s_f64],j.local_get(1),[j.i64_trunc_s_f64,j.i64_and,j.f64_convert_i64_s])},div:{args:[q.f64,q.f64],returns:[q.f64],localVariables:[q.i32],binary:ba(j.local_get(1),j.f64_const(0),[j.f64_ne],j.if(Q.f64),j.local_get(0),j.local_get(1),[j.f64_div,j.else],j.f64_const(0),[j.end])},_getBufferIndex:{args:[q.f64],returns:[q.i32],localVariables:[q.f64,q.i32],binary:ba(j.f64_const(xa),j.local_get(0),[j.f64_add],j.local_tee(1),[j.i32_trunc_f64_s],j.local_set(2),j.i32_const(-1),j.local_get(2),j.i32_const(8),[j.i32_mul],j.local_get(2),j.i32_const(0),[j.i32_lt_s],j.local_get(2),j.i32_const(Ga-1),[j.i32_gt_s,j.i32_or,j.select])}};ua.localFuncMap=va;var ib=sa&&sa.__read||function($,r){var o="function"==typeof Symbol&&$[Symbol.iterator];if(!o)return $;var e,t,p=o.call($),i=[];try{for(;(void 0===r||r-->0)&&!(e=p.next()).done;)i.push(e.value)}catch(a){t={error:a}}finally{try{e&&!e.done&&(o=p.return)&&o.call(p)}finally{if(t)throw t.error}}return i},z=sa&&sa.__spread||function(){for(var $=[],r=0;r<arguments.length;r++)$=$.concat(ib(arguments[r]));return $};function F($,r){switch($.type){case"SCRIPT":var o=$.body.map(function($,o){return z(F($,r),[j.drop])});return wa(o);case"EXPRESSION_BLOCK":return Ha($.body,r);case"BINARY_EXPRESSION":var e=F($.left,r),t=F($.right,r);if(null==(L={"+":[j.f64_add],"-":[j.f64_sub],"*":[j.f64_mul],"/":r.resolveFunc("div"),"%":r.resolveFunc("mod"),"|":r.resolveFunc("bitwiseOr"),"&":r.resolveFunc("bitwiseAnd"),"^":r.resolveFunc("pow"),"==":z([j.f64_sub],la,[j.f64_convert_i32_s]),"!=":z([j.f64_sub],Y,[j.f64_convert_i32_s]),"<":[j.f64_lt,j.f64_convert_i32_s],">":[j.f64_gt,j.f64_convert_i32_s],"<=":[j.f64_le,j.f64_convert_i32_s],">=":[j.f64_ge,j.f64_convert_i32_s]}[$.operator]))throw aa("Unknown binary expression operator "+$.operator,$.loc,r.rawSource);return z(e,t,L);case"CALL_EXPRESSION":var p=$.callee.value,i=$.arguments,a=function(o){if(i.length<o)throw da("Too few arguments passed to `"+p+"()`. Expected "+o+" but only got "+i.length+".",$.loc,r.rawSource);if(i.length>o)throw da("Too many arguments passed to `"+p+"()`. Expected "+o+" but got "+i.length+".",i[o].loc,r.rawSource)};switch(p){case"exec2":return a(2),Ha($.arguments,r);case"exec3":return a(3),Ha($.arguments,r);case"if":a(3);var m=ib($.arguments,3);return Hb(m[0],m[1],m[2],r);case"while":return a(1),Fb($.arguments[0],r);case"loop":return a(2),Gb($.arguments[0],$.arguments[1],r);case"megabuf":case"gmegabuf":a(1);var V=r.resolveLocal(q.i32);return z(F($.arguments[0],r),r.resolveFunc("_getBufferIndex"),j.local_tee(V),j.i32_const(-1),[j.i32_ne],j.if(Q.f64),j.local_get(V),j.f64_load(3,jb(p)),[j.else],j.f64_const(0),[j.end]);case"assign":a(2);var W=$.arguments[0];if("IDENTIFIER"!=W.type)throw da("Expected the first argument of `assign()` to be an identifier.",W.loc,r.rawSource);var n=r.resolveVar(W.value);return z(F($.arguments[1],r),j.global_set(n),j.global_get(n));}var s=wa($.arguments.map(function($){return F($,r)}));switch(p){case"abs":return a(1),z(s,[j.f64_abs]);case"sqrt":return a(1),z(s,[j.f64_abs,j.f64_sqrt]);case"int":return a(1),z(s,[j.f64_floor]);case"min":return a(2),z(s,[j.f64_min]);case"max":return a(2),z(s,[j.f64_max]);case"above":return a(2),z(s,[j.f64_gt,j.f64_convert_i32_s]);case"below":return a(2),z(s,[j.f64_lt,j.f64_convert_i32_s]);case"equal":return a(2),z(s,[j.f64_sub],la,[j.f64_convert_i32_s]);case"bnot":return a(1),z(s,la,[j.f64_convert_i32_s]);case"floor":return a(1),z(s,[j.f64_floor]);case"ceil":return a(1),z(s,[j.f64_ceil]);}var _=r.resolveFunc(p);if(null==_||p.startsWith("_"))throw da("\""+p+"\" is not defined.",$.callee.loc,r.rawSource);if(null!=ta[p])a(ta[p].length);else{if(null==va[p])throw aa("Missing arity information for the function `"+p+"()`",$.callee.loc,r.rawSource);a(va[p].args.length)}return z(s,_);case"ASSIGNMENT_EXPRESSION":e=$.left;var l=F($.right,r),c=Ib($,r);if("IDENTIFIER"===e.type){n=r.resolveVar(e.value);var u=j.global_get(n),f=j.global_set(n);return null===c?z(l,f,u):z(u,l,c,f,u)}if("CALL_EXPRESSION"!==e.type)throw aa("Unexpected left hand side type for assignment: "+e.type,$.loc,r.rawSource);var v=r.resolveLocal(q.i32);if(1!==e.arguments.length)throw da("Expected 1 argument when assinging to a buffer but got "+e.arguments.length+".",0===e.arguments.length?e.loc:e.arguments[1].loc,r.rawSource);var d=e.callee.value;if("gmegabuf"!==d&&"megabuf"!==d)throw da("The only function calls which may be assigned to are `gmegabuf()` and `megabuf()`.",e.callee.loc,r.rawSource);var g=jb(d);if(null===c){var E=r.resolveLocal(q.i32),S=r.resolveLocal(q.f64);return z(l,j.local_set(S),F(e.arguments[0],r),r.resolveFunc("_getBufferIndex"),j.local_tee(E),j.i32_const(0),[j.i32_lt_s],j.if(Q.f64),j.f64_const(0),[j.else],j.local_get(E),j.local_tee(v),j.local_get(S),j.f64_store(3,g),j.local_get(S),[j.end])}V=r.resolveLocal(q.i32);var h=r.resolveLocal(q.i32),x=r.resolveLocal(q.f64),w=r.resolveLocal(q.f64);return z(l,j.local_set(x),F(e.arguments[0],r),r.resolveFunc("_getBufferIndex"),j.local_tee(V),j.i32_const(-1),[j.i32_ne],j.local_tee(h),j.if(Q.f64),j.local_get(V),j.f64_load(3,g),[j.else],j.f64_const(0),[j.end],j.local_get(x),c,j.local_tee(w),j.local_get(h),j.if(Q.void),j.local_get(V),j.local_get(w),j.f64_store(3,g),[j.end]);case"LOGICAL_EXPRESSION":e=F($.left,r),t=F($.right,r);var I={"&&":{comparison:la,shortCircutValue:0},"||":{comparison:Y,shortCircutValue:1}}[$.operator];if(null==I)throw aa("Unknown logical expression operator "+$.operator,$.loc,r.rawSource);var b=I.comparison,O=I.shortCircutValue;return z(e,b,j.if(Q.f64),j.f64_const(O),[j.else],t,Y,[j.f64_convert_i32_s,j.end]);case"UNARY_EXPRESSION":var L,y=F($.value,r);if(null==(L={"-":[j.f64_neg],"+":[],"!":z(la,[j.f64_convert_i32_s])}[$.operator]))throw aa("Unknown logical unary operator "+$.operator,$.loc,r.rawSource);return z(y,L);case"IDENTIFIER":var C=$.value;return j.global_get(r.resolveVar(C));case"NUMBER_LITERAL":return j.f64_const($.value);default:throw aa("Unknown AST node type "+$.type,$.loc,r.rawSource);}}function Ha($,r){var o=$.map(function($,o){return F($,r)});return wa(Ra(o,[j.drop]))}function Fb($,r){var o=F($,r),e=r.resolveLocal(q.i32);return z(j.i32_const(0),j.local_set(e),j.loop(Q.void),j.local_get(e),j.i32_const(1),[j.i32_add],j.local_tee(e),j.i32_const(Db),[j.i32_lt_u],o,Y,[j.i32_and],j.br_if(0),[j.end],j.f64_const(0))}function Gb($,r,o){var e=F(r,o),t=o.resolveLocal(q.i32);return z(j.block(Q.void),F($,o),[j.i32_trunc_f64_s],j.local_tee(t),j.i32_const(0),[j.i32_le_s],j.br_if(1),j.loop(Q.void),e,[j.drop],j.local_get(t),j.i32_const(1),[j.i32_sub],j.local_tee(t),j.i32_const(0),[j.i32_ne],j.br_if(0),[j.end,j.end],j.f64_const(0))}function Hb($,r,o,e){return z(F($,e),Y,j.if(Q.f64),F(r,e),[j.else],F(o,e),[j.end])}function jb($){switch($){case"gmegabuf":return 8*Ga;case"megabuf":return 0;}}function Ib($,r){var o={"+=":[j.f64_add],"-=":[j.f64_sub],"*=":[j.f64_mul],"/=":[j.f64_div],"%=":r.resolveFunc("mod"),"=":null}[$.operator];if(void 0===o)throw aa("Unknown assignment operator \""+$.operator+"\"",$.loc,r.rawSource);return o}sa.emit=F;var na=ra&&ra.__read||function(r,$){var e="function"==typeof Symbol&&r[Symbol.iterator];if(!e)return r;var o,t,n=e.call(r),d=[];try{for(;(void 0===$||$-->0)&&!(o=n.next()).done;)d.push(o.value)}catch(i){t={error:i}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return d},J=ra&&ra.__spread||function(){for(var r=[],$=0;$<arguments.length;$++)r=r.concat(na(arguments[$]));return r};function Ia(r){var $=r.pools,e=r.functions,o=r.eelVersion,t=void 0===o?2:o,n=r.preParsed,d=void 0!==n&&n;if(Object.keys($).includes("shims"))throw new Error("You may not name a pool \"shims\". \"shims\" is reserved for injected JavaScript functions.");var i=[];Object.entries($).forEach(function(r){var $=na(r,2),e=$[0];$[1].forEach(function(r){i.push([e,r])})});var a=new Ua;i.forEach(function(r){var $=na(r,2),e=$[0],o=$[1];a.get(e,o)});var p=Object.entries(ta).map(function(r){var $=na(r,2),e=$[0],o=$[1];return{args:new Array(o.length).fill(null).map(function(r){return q.f64}),returns:[q.f64],name:e}}),c=[],s=[];Object.entries(e).forEach(function(r){var e=na(r,2),o=e[0],n=e[1],i=n.pool,u=n.code;if(null==$[i]){var X=Object.keys($);if(0===X.length)throw new Error("The function \""+o+"\" was declared as using a variable pool named \""+i+"\" but no pools were defined.");throw new Error("The function \""+o+"\" was declared as using a variable pool named \""+i+"\" which is not among the variable pools defined. The defined variable pools are: "+Va(X)+".")}var D=d?u:Ea(u);if("string"==typeof D)throw new Error("Got passed unparsed code without setting the preParsed flag");var l=[],m=F(D,{resolveVar:function(r){return /reg\d\d/.test(r)?a.get(null,r):a.get(i,r)},resolveLocal:function(r){return l.push(r),l.length-1},resolveFunc:function(r){var $=p.findIndex(function($){return $.name===r});if(-1!==$){var e=j.call($);return"rand"===r&&1===t?J(e,[j.f64_floor]):e}if(null==va[r])return null;var o=c.indexOf(r);return-1===o&&(c.push(r),o=c.length-1),j.call(o+p.length)},rawSource:u});s.push({binary:m,exportName:o,args:[],returns:[],localVariables:l})});var u=c.map(function(r){var $=va[r];if(null==$)throw new Error("Undefined local function \""+r+"\"");return $}),X=function(r){return J(r.args,["|"],r.returns).join("-")},D=[],l=new Map;function m(r){var $=X(r),e=l.get($);if(null==e)throw new Error("Failed to get a type index for key "+$);return e}J(p,u,s).forEach(function(r){var $=X(r);l.has($)||(D.push(J([cb],ha(r.args),ha(r.returns))),l.set($,D.length-1))});var v=J(i.map(function(r){var $=na(r,2),e=$[0],o=$[1];return J(ma(e),ma(o),[db,q.f64,Fa.var])}),p.map(function(r,$){var e=m(r);return J(ma("shims"),ma(r.name),J([eb],H(e)))})),f=J(u,s).map(function(r){var $=m(r);return H($)}),_=[J([1],H(hb),H(hb))],h=a.size()-i.length,E=Ta(h,function(){return J([q.f64,Fa.var],j.f64_const(0),[j.end])}),g=J(s).map(function(r,$){var e=$+p.length+u.length;return J(ma(r.exportName),[bb.FUNC],H(e))}),S=J(u,s).map(function(r){var $,e=(null!==($=r.localVariables)&&void 0!==$?$:[]).map(function(r){return J(H(1),[r])});return ha(J(ha(e),r.binary,[j.end]))});return new Uint8Array(J(_a,ab,fa(ea.TYPE,D),fa(ea.IMPORT,v),fa(ea.FUNC,f),fa(ea.MEMORY,_),fa(ea.GLOBAL,E),fa(ea.EXPORT,g),fa(ea.CODE,S)))}ra.compileModule=Ia;var ca={};var kb=ca&&ca.__assign||function(){return(kb=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e}).apply(this,arguments)},Jb=ca&&ca.__awaiter||function(e,r,t,n){return new(t||(t=Promise))(function(o,a){function l(e){try{i(n.next(e))}catch(r){a(r)}}function u(e){try{i(n.throw(e))}catch(r){a(r)}}function i(e){var r;e.done?o(e.value):(r=e.value,r instanceof t?r:new t(function(e){e(r)})).then(l,u)}i((n=n.apply(e,r||[])).next())})},Kb=ca&&ca.__generator||function(e,r){var t,n,o,a,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;l;)try{if(t=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return l.label++,{value:a[1],done:!1};case 5:l.label++,n=a[1],a=[0];continue;case 7:a=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){l=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){l.label=a[1];break}if(6===a[0]&&l.label<o[1]){l.label=o[1],o=a;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(a);break}o[2]&&l.ops.pop(),l.trys.pop();continue;}a=r.call(e,l)}catch(u){a=[6,u],n=0}finally{t=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},Lb=ca&&ca.__read||function(e,r){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var n,o,a=t.call(e),l=[];try{for(;(void 0===r||r-->0)&&!(n=a.next()).done;)l.push(n.value)}catch(u){o={error:u}}finally{try{n&&!n.done&&(t=a.return)&&t.call(a)}finally{if(o)throw o.error}}return l};function lb(e){var r=e.pools,t=e.functions,n=e.eelVersion,o=void 0===n?2:n;return Jb(this,void 0,void 0,function(){var e,n,a,l;return Kb(this,function(u){switch(u.label){case 0:return e={},Object.entries(r).forEach(function(r){var t=Lb(r,2),n=t[0],o=t[1];e[n]=new Set(Object.keys(o))}),n=Ia({pools:e,functions:t,eelVersion:o}),[4,WebAssembly.compile(n)];case 1:return a=u.sent(),l=kb(kb({},r),{shims:ta}),[4,WebAssembly.instantiate(a,l)];case 2:return[2,u.sent()];}})})}ca.loadModule=lb;ia.loadModule=lb,ia.shims=ta,ia.compileModule=Ia,ia.parse=Ea;if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=ia}else if(typeof define==="function"&&define.amd){define(function(){return ia})}})();

@@ -41,3 +41,3 @@ "use strict";

function compileModule(_a) {
var pools = _a.pools, funcs = _a.functions, _b = _a.preParsed, preParsed = _b === void 0 ? false : _b;
var pools = _a.pools, funcs = _a.functions, _b = _a.eelVersion, eelVersion = _b === void 0 ? 2 : _b, _c = _a.preParsed, preParsed = _c === void 0 ? false : _c;
if (Object.keys(pools).includes("shims")) {

@@ -109,3 +109,7 @@ throw new Error('You may not name a pool "shims". "shims" is reserved for injected JavaScript functions.');

if (shimdex !== -1) {
return encoding_1.op.call(shimdex);
var call = encoding_1.op.call(shimdex);
if (name === "rand" && eelVersion === 1) {
return __spread(call, [encoding_1.op.f64_floor]);
}
return call;
}

@@ -112,0 +116,0 @@ // If it's not a shim and it's not a defined function, return null.

@@ -128,3 +128,3 @@ "use strict";

assertArity(1);
return __spread(args, [encoding_1.op.f64_sqrt]);
return __spread(args, [encoding_1.op.f64_abs, encoding_1.op.f64_sqrt]);
case "int":

@@ -319,9 +319,15 @@ assertArity(1);

var body = emit(expression, context);
var localIndex = context.resolveLocal(encoding_1.VAL_TYPE.f64);
// TODO: This could probably be simplified
return __spread(emit(count, context), encoding_1.op.local_set(localIndex), encoding_1.op.loop(encoding_1.BLOCK["void"]), body, [
var localIndex = context.resolveLocal(encoding_1.VAL_TYPE.i32);
return __spread(encoding_1.op.block(encoding_1.BLOCK["void"]), emit(count, context), [
encoding_1.op.i32_trunc_f64_s
], encoding_1.op.local_tee(localIndex), encoding_1.op.i32_const(0), [
encoding_1.op.i32_le_s
], encoding_1.op.br_if(1), encoding_1.op.loop(encoding_1.BLOCK["void"]), body, [
encoding_1.op.drop
], encoding_1.op.local_get(localIndex), encoding_1.op.f64_const(1), [
encoding_1.op.f64_sub
], encoding_1.op.local_tee(localIndex), encoding_1.IS_NOT_ZEROISH, encoding_1.op.br_if(0), [
], encoding_1.op.local_get(localIndex), encoding_1.op.i32_const(1), [
encoding_1.op.i32_sub
], encoding_1.op.local_tee(localIndex), encoding_1.op.i32_const(0), [
encoding_1.op.i32_ne
], encoding_1.op.br_if(0), [
encoding_1.op.end,
encoding_1.op.end

@@ -328,0 +334,0 @@ ], encoding_1.op.f64_const(0));

@@ -73,3 +73,3 @@ "use strict";

// nop: 0x01,
// block: 0x02,
block: function (blockType) { return [0x02, blockType]; },
loop: function (blockType) { return [0x03, blockType]; },

@@ -76,0 +76,0 @@ "if": function (retType) { return [0x04, retType]; },

@@ -72,7 +72,7 @@ "use strict";

function loadModule(_a) {
var pools = _a.pools, functions = _a.functions;
var pools = _a.pools, functions = _a.functions, _b = _a.eelVersion, eelVersion = _b === void 0 ? 2 : _b;
return __awaiter(this, void 0, void 0, function () {
var compilerPools, buffer, mod, importObject;
return __generator(this, function (_b) {
switch (_b.label) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:

@@ -86,10 +86,11 @@ compilerPools = {};

pools: compilerPools,
functions: functions
functions: functions,
eelVersion: eelVersion
});
return [4 /*yield*/, WebAssembly.compile(buffer)];
case 1:
mod = _b.sent();
mod = _c.sent();
importObject = __assign(__assign({}, pools), { shims: shims_1["default"] });
return [4 /*yield*/, WebAssembly.instantiate(mod, importObject)];
case 2: return [2 /*return*/, _b.sent()];
case 2: return [2 /*return*/, _c.sent()];
}

@@ -96,0 +97,0 @@ });

@@ -13,3 +13,3 @@ "use strict";

atan2: Math.atan2,
rand: function (a) { return Math.floor(Math.random() * a); },
rand: function (a) { return Math.random() * a; },
pow: Math.pow,

@@ -16,0 +16,0 @@ log: Math.log,

@@ -37,2 +37,3 @@ "use strict";

["Sqrt", "g = sqrt(4);", 2],
["Sqrt (negative)", "g = sqrt(-4);", 2],
["Sqr", "g = sqr(10);", 100],

@@ -117,2 +118,6 @@ ["Int", "g = int(4.5);", 4],

["Loop", "loop(10, g = g + 1);", 10],
["Loop fractional times", "loop(1.5, g = g + 1);", 1],
["Loop zero times", "loop(0, g = g + 1);", 0],
["Loop negative times", "loop(-2, g = g + 1);", 0],
["Loop negative fractional times", "loop(-0.2, g = g + 1);", 0],
["Equality (true)", "g = 1 == 1;", 1],

@@ -119,0 +124,0 @@ ["Equality epsilon", "g = 0 == 0.000009;", 1],

{
"name": "eel-wasm",
"version": "0.0.11",
"version": "0.0.12",
"main": "dist/src/index.js",

@@ -5,0 +5,0 @@ "license": "MIT",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc