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.7 to 0.0.8

dist/index.bundle.js.gz

4

dist/build/parser.js

@@ -76,3 +76,3 @@ /* parser generated by jison 0.4.18 */

var o = function (k, v, o, l) { for (o = o || {}, l = k.length; l--; o[k[l]] = v)
; return o; }, $V0 = [1, 18], $V1 = [1, 7], $V2 = [1, 19], $V3 = [1, 20], $V4 = [1, 14], $V5 = [1, 15], $V6 = [1, 16], $V7 = [1, 33], $V8 = [1, 31], $V9 = [1, 23], $Va = [1, 22], $Vb = [1, 24], $Vc = [1, 25], $Vd = [1, 26], $Ve = [1, 27], $Vf = [1, 28], $Vg = [1, 29], $Vh = [1, 30], $Vi = [5, 8, 15, 18, 20, 28, 29, 32, 33, 34, 35, 36, 37, 38], $Vj = [5, 15, 18], $Vk = [5, 12, 15, 17, 18, 24, 25, 28, 29, 30], $Vl = [1, 57], $Vm = [5, 8, 12, 15, 17, 18, 24, 25, 28, 29, 30], $Vn = [15, 18], $Vo = [5, 8, 15, 18, 28, 29, 38], $Vp = [5, 8, 15, 18, 28, 29, 32, 33, 34, 37, 38], $Vq = [5, 8, 15, 18, 28, 29, 32, 33, 34, 35, 36, 37, 38], $Vr = [5, 8, 15, 18], $Vs = [5, 8, 15, 18, 20, 22, 28, 29, 32, 33, 34, 35, 36, 37, 38];
; return o; }, $V0 = [1, 18], $V1 = [1, 7], $V2 = [1, 19], $V3 = [1, 20], $V4 = [1, 14], $V5 = [1, 15], $V6 = [1, 16], $V7 = [1, 33], $V8 = [1, 31], $V9 = [1, 23], $Va = [1, 22], $Vb = [1, 24], $Vc = [1, 25], $Vd = [1, 26], $Ve = [1, 27], $Vf = [1, 28], $Vg = [1, 29], $Vh = [1, 30], $Vi = [5, 8, 15, 18, 20, 28, 29, 32, 33, 34, 35, 36, 37, 38], $Vj = [5, 15, 18], $Vk = [5, 12, 15, 17, 18, 24, 25, 28, 29, 30], $Vl = [1, 57], $Vm = [5, 8, 12, 15, 17, 18, 24, 25, 28, 29, 30], $Vn = [15, 18], $Vo = [5, 8, 15, 18, 28, 29, 38], $Vp = [5, 8, 15, 18, 28, 29, 32, 33, 38], $Vq = [5, 8, 15, 18, 28, 29, 32, 33, 34, 37, 38], $Vr = [5, 8, 15, 18, 28, 29, 32, 33, 34, 35, 36, 37, 38], $Vs = [5, 8, 15, 18], $Vt = [5, 8, 15, 18, 20, 22, 28, 29, 32, 33, 34, 35, 36, 37, 38];
var parser = { trace: function trace() { },

@@ -173,3 +173,3 @@ yy: {},

},
table: [{ 3: 1, 4: 2, 5: [1, 4], 6: 3, 9: 13, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 1: [3] }, { 5: [1, 21], 7: 32, 8: $V7, 20: $V8, 28: $V9, 29: $Va, 32: $Vb, 33: $Vc, 34: $Vd, 35: $Ve, 36: $Vf, 37: $Vg, 38: $Vh }, { 5: [1, 34] }, { 1: [2, 3] }, o($Vi, [2, 39]), o($Vi, [2, 40]), { 4: 35, 6: 37, 9: 13, 10: 36, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, o($Vi, [2, 42]), o($Vi, [2, 43]), o($Vi, [2, 44], { 22: [1, 38] }), o($Vi, [2, 45], { 17: [1, 40], 22: [1, 39] }), o($Vi, [2, 46]), o($Vj, [2, 8], { 31: 5, 27: 6, 26: 8, 21: 9, 16: 10, 11: 11, 19: 12, 23: 17, 4: 41, 12: $V0, 17: $V1, 24: $V2, 25: $V3, 28: $V4, 29: $V5, 30: $V6 }), { 4: 42, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 4: 43, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 4: 44, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, o($Vi, [2, 26]), o([5, 8, 15, 17, 18, 20, 22, 28, 29, 32, 33, 34, 35, 36, 37, 38], [2, 11]), o($Vi, [2, 21], { 25: [1, 45] }), o($Vi, [2, 25], { 24: [1, 46] }), { 1: [2, 1] }, { 4: 47, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 4: 48, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 4: 49, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 4: 50, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 4: 51, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 4: 52, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 4: 53, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 4: 54, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 4: 55, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 4: 56, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, o($Vk, [2, 6], { 8: $Vl }), o($Vm, [2, 4]), { 1: [2, 2] }, { 7: 32, 8: $V7, 18: [1, 58], 20: $V8, 28: $V9, 29: $Va, 32: $Vb, 33: $Vc, 34: $Vd, 35: $Ve, 36: $Vf, 37: $Vg, 38: $Vh }, { 18: [1, 59] }, o($Vn, [2, 10]), { 4: 60, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 4: 61, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 4: 65, 6: 37, 9: 13, 10: 66, 11: 11, 12: $V0, 13: 64, 14: 63, 16: 10, 17: $V1, 18: [1, 62], 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, o($Vj, [2, 9], { 7: 67, 8: $V7, 20: $V8, 28: $V9, 29: $Va, 32: $Vb, 33: $Vc, 34: $Vd, 35: $Ve, 36: $Vf, 37: $Vg, 38: $Vh }), o($Vo, [2, 27], { 20: $V8, 32: $Vb, 33: $Vc, 34: $Vd, 35: $Ve, 36: $Vf, 37: $Vg }), o($Vo, [2, 28], { 20: $V8, 32: $Vb, 33: $Vc, 34: $Vd, 35: $Ve, 36: $Vf, 37: $Vg }), o($Vo, [2, 29], { 20: $V8, 32: $Vb, 33: $Vc, 34: $Vd, 35: $Ve, 36: $Vf, 37: $Vg }), o($Vi, [2, 22], { 24: [1, 68] }), o($Vi, [2, 24]), o($Vo, [2, 30], { 20: $V8, 32: $Vb, 33: $Vc, 34: $Vd, 35: $Ve, 36: $Vf, 37: $Vg }), o($Vo, [2, 31], { 20: $V8, 32: $Vb, 33: $Vc, 34: $Vd, 35: $Ve, 36: $Vf, 37: $Vg }), o($Vp, [2, 32], { 20: $V8, 35: $Ve, 36: $Vf }), o($Vp, [2, 33], { 20: $V8, 35: $Ve, 36: $Vf }), o($Vp, [2, 34], { 20: $V8, 35: $Ve, 36: $Vf }), o($Vq, [2, 35], { 20: $V8 }), o($Vq, [2, 36], { 20: $V8 }), o($Vp, [2, 37], { 20: $V8, 35: $Ve, 36: $Vf }), o($Vr, [2, 38], { 20: $V8, 28: $V9, 29: $Va, 32: $Vb, 33: $Vc, 34: $Vd, 35: $Ve, 36: $Vf, 37: $Vg, 38: $Vh }), o($Vi, [2, 18]), o($Vm, [2, 5]), o($Vi, [2, 41]), o($Vi, [2, 47]), o($Vr, [2, 20], { 20: $V8, 28: $V9, 29: $Va, 32: $Vb, 33: $Vc, 34: $Vd, 35: $Ve, 36: $Vf, 37: $Vg, 38: $Vh }), o($Vr, [2, 19], { 20: $V8, 28: $V9, 29: $Va, 32: $Vb, 33: $Vc, 34: $Vd, 35: $Ve, 36: $Vf, 37: $Vg, 38: $Vh }), o($Vs, [2, 16]), { 15: [1, 70], 18: [1, 69] }, o($Vn, [2, 14]), o($Vn, [2, 12], { 7: 32, 8: $V7, 20: $V8, 28: $V9, 29: $Va, 32: $Vb, 33: $Vc, 34: $Vd, 35: $Ve, 36: $Vf, 37: $Vg, 38: $Vh }), o($Vn, [2, 13]), o($Vk, [2, 7], { 8: $Vl }), o($Vi, [2, 23]), o($Vs, [2, 17]), { 4: 65, 6: 37, 9: 13, 10: 66, 11: 11, 12: $V0, 13: 71, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, o($Vn, [2, 15])],
table: [{ 3: 1, 4: 2, 5: [1, 4], 6: 3, 9: 13, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 1: [3] }, { 5: [1, 21], 7: 32, 8: $V7, 20: $V8, 28: $V9, 29: $Va, 32: $Vb, 33: $Vc, 34: $Vd, 35: $Ve, 36: $Vf, 37: $Vg, 38: $Vh }, { 5: [1, 34] }, { 1: [2, 3] }, o($Vi, [2, 39]), o($Vi, [2, 40]), { 4: 35, 6: 37, 9: 13, 10: 36, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, o($Vi, [2, 42]), o($Vi, [2, 43]), o($Vi, [2, 44], { 22: [1, 38] }), o($Vi, [2, 45], { 17: [1, 40], 22: [1, 39] }), o($Vi, [2, 46]), o($Vj, [2, 8], { 31: 5, 27: 6, 26: 8, 21: 9, 16: 10, 11: 11, 19: 12, 23: 17, 4: 41, 12: $V0, 17: $V1, 24: $V2, 25: $V3, 28: $V4, 29: $V5, 30: $V6 }), { 4: 42, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 4: 43, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 4: 44, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, o($Vi, [2, 26]), o([5, 8, 15, 17, 18, 20, 22, 28, 29, 32, 33, 34, 35, 36, 37, 38], [2, 11]), o($Vi, [2, 21], { 25: [1, 45] }), o($Vi, [2, 25], { 24: [1, 46] }), { 1: [2, 1] }, { 4: 47, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 4: 48, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 4: 49, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 4: 50, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 4: 51, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 4: 52, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 4: 53, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 4: 54, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 4: 55, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 4: 56, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, o($Vk, [2, 6], { 8: $Vl }), o($Vm, [2, 4]), { 1: [2, 2] }, { 7: 32, 8: $V7, 18: [1, 58], 20: $V8, 28: $V9, 29: $Va, 32: $Vb, 33: $Vc, 34: $Vd, 35: $Ve, 36: $Vf, 37: $Vg, 38: $Vh }, { 18: [1, 59] }, o($Vn, [2, 10]), { 4: 60, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 4: 61, 11: 11, 12: $V0, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, { 4: 65, 6: 37, 9: 13, 10: 66, 11: 11, 12: $V0, 13: 64, 14: 63, 16: 10, 17: $V1, 18: [1, 62], 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, o($Vj, [2, 9], { 7: 67, 8: $V7, 20: $V8, 28: $V9, 29: $Va, 32: $Vb, 33: $Vc, 34: $Vd, 35: $Ve, 36: $Vf, 37: $Vg, 38: $Vh }), o($Vo, [2, 27], { 20: $V8, 32: $Vb, 33: $Vc, 34: $Vd, 35: $Ve, 36: $Vf, 37: $Vg }), o($Vo, [2, 28], { 20: $V8, 32: $Vb, 33: $Vc, 34: $Vd, 35: $Ve, 36: $Vf, 37: $Vg }), o($Vo, [2, 29], { 20: $V8, 32: $Vb, 33: $Vc, 34: $Vd, 35: $Ve, 36: $Vf, 37: $Vg }), o($Vi, [2, 22], { 24: [1, 68] }), o($Vi, [2, 24]), o($Vo, [2, 30], { 20: $V8, 32: $Vb, 33: $Vc, 34: $Vd, 35: $Ve, 36: $Vf, 37: $Vg }), o($Vo, [2, 31], { 20: $V8, 32: $Vb, 33: $Vc, 34: $Vd, 35: $Ve, 36: $Vf, 37: $Vg }), o($Vp, [2, 32], { 20: $V8, 34: $Vd, 35: $Ve, 36: $Vf, 37: $Vg }), o($Vp, [2, 33], { 20: $V8, 34: $Vd, 35: $Ve, 36: $Vf, 37: $Vg }), o($Vq, [2, 34], { 20: $V8, 35: $Ve, 36: $Vf }), o($Vr, [2, 35], { 20: $V8 }), o($Vr, [2, 36], { 20: $V8 }), o($Vq, [2, 37], { 20: $V8, 35: $Ve, 36: $Vf }), o($Vs, [2, 38], { 20: $V8, 28: $V9, 29: $Va, 32: $Vb, 33: $Vc, 34: $Vd, 35: $Ve, 36: $Vf, 37: $Vg, 38: $Vh }), o($Vi, [2, 18]), o($Vm, [2, 5]), o($Vi, [2, 41]), o($Vi, [2, 47]), o($Vs, [2, 20], { 20: $V8, 28: $V9, 29: $Va, 32: $Vb, 33: $Vc, 34: $Vd, 35: $Ve, 36: $Vf, 37: $Vg, 38: $Vh }), o($Vs, [2, 19], { 20: $V8, 28: $V9, 29: $Va, 32: $Vb, 33: $Vc, 34: $Vd, 35: $Ve, 36: $Vf, 37: $Vg, 38: $Vh }), o($Vt, [2, 16]), { 15: [1, 70], 18: [1, 69] }, o($Vn, [2, 14]), o($Vn, [2, 12], { 7: 32, 8: $V7, 20: $V8, 28: $V9, 29: $Va, 32: $Vb, 33: $Vc, 34: $Vd, 35: $Ve, 36: $Vf, 37: $Vg, 38: $Vh }), o($Vn, [2, 13]), o($Vk, [2, 7], { 8: $Vl }), o($Vi, [2, 23]), o($Vt, [2, 17]), { 4: 65, 6: 37, 9: 13, 10: 66, 11: 11, 12: $V0, 13: 71, 16: 10, 17: $V1, 19: 12, 21: 9, 23: 17, 24: $V2, 25: $V3, 26: 8, 27: 6, 28: $V4, 29: $V5, 30: $V6, 31: 5 }, o($Vn, [2, 15])],
defaultActions: { 4: [2, 3], 21: [2, 1], 34: [2, 2] },

@@ -176,0 +176,0 @@ parseError: function parseError(str, hash) {

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

(function () {var ja={};var pa={};function Ma(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 fb(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 ka,la,gb={},H=gb={};function Ba(){throw new Error("setTimeout has not been defined")}function Ca(){throw new Error("clearTimeout has not been defined")}function Na($){if(ka===setTimeout)return setTimeout($,0);if((ka===Ba||!ka)&&setTimeout)return ka=setTimeout,setTimeout($,0);try{return ka($,0)}catch(e){try{return ka.call(null,$,0)}catch(e){return ka.call(this,$,0)}}}function hb($){if(la===clearTimeout)return clearTimeout($);if((la===Ca||!la)&&clearTimeout)return la=clearTimeout,clearTimeout($);try{return la($)}catch(e){try{return la.call(null,$)}catch(e){return la.call(this,$)}}}!function(){try{ka="function"==typeof setTimeout?setTimeout:Ba}catch($){ka=Ba}try{la="function"==typeof clearTimeout?clearTimeout:Ca}catch($){la=Ca}}();var qa,ga=[],Da=!1,Oa=-1;function ib(){Da&&qa&&(Da=!1,qa.length?ga=qa.concat(ga):Oa=-1,ga.length&&Pa())}function Pa(){if(!Da){var $=Na(ib);Da=!0;for(var e=ga.length;e;){for(qa=ga,ga=[];++Oa<e;)qa&&qa[Oa].run();Oa=-1,e=ga.length}qa=null,Da=!1,hb($)}}function Qa($,e){this.fun=$,this.array=e}function U(){}H.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 Qa($,e)),1!==ga.length||Da||Na(Pa)},Qa.prototype.run=function(){this.fun.apply(null,this.array)},H.title="browser",H.env={},H.argv=[],H.version="",H.versions={},H.on=U,H.addListener=U,H.once=U,H.off=U,H.removeListener=U,H.removeAllListeners=U,H.emit=U,H.prependListener=U,H.prependOnceListener=U,H.listeners=function($){return[]},H.binding=function($){throw new Error("process.binding is not supported")},H.cwd=function(){return"/"},H.chdir=function($){throw new Error("process.chdir is not supported")},H.umask=function(){return 0};var jb=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,34,37,38],x=[5,8,15,18,28,29,32,33,34,35,36,37,38],A=[5,8,15,18],R=[5,8,15,18,20,22,28,29,32,33,34,35,36,37,38],v={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,35:f,36:g}),t($,[2,33],{20:c,35:f,36:g}),t($,[2,34],{20:c,35:f,36:g}),t(x,[2,35],{20:c}),t(x,[2,36],{20:c}),t($,[2,37],{20:c,35:f,36:g}),t(A,[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(A,[2,20],{20:c,28:l,29:y,32:u,33:p,34:_,35:f,36:g,37:m,38:E}),t(A,[2,19],{20:c,28:l,29:y,32:u,33:p,34:_,35:f,36:g,37:m,38:E}),t(R,[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(R,[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}},T={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 P(){this.yy={}}return v.lexer=T,P.prototype=v,v.Parser=P,new P}();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(gb.argv.slice(1))),t.exports}.call({});var kb={};kb={parse:jb.parse};function Ra(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 Sa(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?Ra(Object(t),!0).forEach(function(r){Ea(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ra(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function Ea(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var lb={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 Fa(e,r){var t=lb[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],$=Fa(o,r);$!==o&&(n=Sa({},n,Ea({},t.key,$)))}else if("ARRAY"===t.type){var p=e[t.key],y=p.map(function(e){return Fa(e,r)});p.some(function(e,r){return e!==y[r]})&&(n=Sa({},n,Ea({},t.key,y)))}}),r(n)}var ra={};var ba={},mb=ba&&ba.__read||function(r,t){var e="function"==typeof Symbol&&r[Symbol.iterator];if(!e)return r;var $,a,f=e.call(r),n=[];try{for(;(void 0===t||t-->0)&&!($=f.next()).done;)n.push($.value)}catch(o){a={error:o}}finally{try{$&&!$.done&&(e=f.return)&&e.call(f)}finally{if(a)throw a.error}}return n},nb=ba&&ba.__spread||function(){for(var r=[],t=0;t<arguments.length;t++)r=r.concat(mb(arguments[t]));return r};function Ta(r,t){for(var e=[],$=0;$<r.length;$++){e.push(r[$]),$===r.length-1||e.push(t)}return e}function ya(r){var t=[];return r.forEach(function(r){t.push.apply(t,nb(r))}),t}ba.arrayJoin=Ta,ba.flatten=ya;var Ua=function(r){return[].concat.apply([],r)};function Ga(r,t){return new Array(r).fill(t).join("")}ba.flattenTwice=Ua,ba.repeat=Ga;var Va=ra&&ra.__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=Ga(r.first_column," "),p=Ga(r.last_column-r.first_column,"^"),a=r.first_line-o;$.splice(a,0," | "+i+p)}return $.join("\n")}ra.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),ob=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 ob(r,t,e)}function Z(r,t,e){return new Xa(r,t,e)}ra.createUserError=ca,ra.createCompilerError=Z;var Ya=pa&&pa.__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)},pb=pa&&pa.__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 $=Ma(e,r.first_column),t=Ma(e,r.last_column);return{first_column:$.column,last_column:t.column,first_line:$.line,last_line:t.line}}function Ha(r){var e=pb(fb(r),2),$=e[0],t=e[1];try{var o=kb.parse($);return Fa(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)}}pa.parse=Ha;var sa={};var ta={};var F={};function qb(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 rb=F&&F.__read||function($,e){var r="function"==typeof Symbol&&$[Symbol.iterator];if(!r)return $;var x,o,t=r.call($),_=[];try{for(;(void 0===e||e-->0)&&!(x=t.next()).done;)_.push(x.value)}catch(Y){o={error:Y}}finally{try{x&&!x.done&&(r=t.return)&&r.call(t)}finally{if(o)throw o.error}}return _},ua=F&&F.__spread||function(){for(var $=[],e=0;e<arguments.length;e++)$=$.concat(rb(arguments[e]));return $},za=1e-5;F.EPSILON=za;var da={TYPE:1,IMPORT:2,FUNC:3,MEMORY:5,GLOBAL:6,EXPORT:7,CODE:10};F.SECTION=da;var $a={FUNC:0,TABLE:1,MEMORY:2,GLOBAL:3};F.EXPORT_TYPE=$a;var j={block:2,loop:3,br:12,br_if:13,select:27,call:16,drop:26,f64_load:43,f64_store:57,i32_and:113,i32_or:114,i32_const:65,i32_ne:71,i32_add:106,i32_sub:107,i32_eqz:69,i32_lt_s:72,i32_gt_s:74,i32_le_s:76,i32_ge_s:78,i32_ge_u:90,i32_trunc_s_f64:170,i32_trunc_u_f64:171,i64_and:131,i64_or:132,i64_rem_s:129,f64_const:68,f64_ne:98,f64_neg:154,f64_add:160,f64_sub:161,f64_mul:162,f64_div:163,f64_abs:153,f64_sqrt:159,f64_floor:156,f64_min:164,f64_max:165,f64_gt:100,f64_eq:97,f64_lt:99,f64_le:101,f64_ge:102,i64_trunc_s_f64:176,f64_convert_s_i64:185,f64_convert_i32_s:183,if:4,else:5,end:11,local_get:32,local_set:33,local_tee:34,global_get:35,global_set:36};F.op=j;var z={i32:127,i64:126,f32:125,f64:124};F.VAL_TYPE=z;var Ia={const:0,var:1};F.MUTABILITY=Ia;var aa={void:64,i32:127,i64:126,f32:125,f64:124};F.BLOCK=aa;var _a=96;F.FUNCTION_TYPE=_a;var ab=3;F.GLOBAL_TYPE=ab;var bb=0;F.TYPE_IDX=bb;var ma=ua([j.f64_abs,j.f64_const],J(za),[j.f64_lt]);F.IS_ZEROISH=ma;var Q=ua([j.f64_abs,j.f64_const],J(za),[j.f64_gt]);function J($){var e=new Uint8Array(8);return qb(e,$),e}F.IS_NOT_ZEROISH=Q,F.encodef64=J;var na=function($){return ua([$.length],$.split("").map(function($){return $.charCodeAt(0)}))};function q($){var e=[];do{var r=127&$;0!==($>>>=7)&&(r|=128),e.push(r)}while(0!==$);return e}function va($){for(var e=[],r=0,x=Math.ceil(Math.log2(Math.abs($))),o=$<0,t=!0;t;)r=127&$,$>>=7,o&&($|=-(1<<x-7)),0==$&&0==(64&r)||-1==$&&64==(64&r)?t=!1:r|=128,e.push(r);return e}F.encodeString=na,F.unsignedLEB128=q,F.signedLEB128=va;var ha=function($){return ua(q($.length),Ua($))};function ea($,e){return 0===e.length?[]:ua([$],ha(ha(e)))}F.encodeVector=ha,F.encodeSection=ea;var sb=1e-5,oa={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)>sb?1/o:0},floor:Math.floor,ceil:Math.ceil};var wa={};var tb=wa&&wa.__read||function($,n){var e="function"==typeof Symbol&&$[Symbol.iterator];if(!e)return $;var o,r,t=e.call($),i=[];try{for(;(void 0===n||n-->0)&&!(o=t.next()).done;)i.push(o.value)}catch(p){r={error:p}}finally{try{o&&!o.done&&(e=t.return)&&e.call(t)}finally{if(r)throw r.error}}return i},fa=wa&&wa.__spread||function(){for(var $=[],n=0;n<arguments.length;n++)$=$.concat(tb(arguments[n]));return $},xa={sqr:{args:[z.f64],returns:[z.f64],binary:fa([j.local_get],q(0),[j.local_get],q(0),[j.f64_mul])},bor:{args:[z.f64,z.f64],returns:[z.f64],binary:fa([j.local_get],q(0),Q,[j.local_get],q(1),Q,[j.i32_or,j.i32_const],q(0),[j.i32_ne,j.f64_convert_i32_s])},band:{args:[z.f64,z.f64],returns:[z.f64],binary:fa([j.local_get],q(0),Q,[j.local_get],q(1),Q,[j.i32_and,j.i32_const],q(0),[j.i32_ne,j.f64_convert_i32_s])},sign:{args:[z.f64],returns:[z.f64],binary:fa([j.f64_const],J(0),[j.local_get],q(0),[j.f64_lt,j.local_get],q(0),[j.f64_const],J(0),[j.f64_lt,j.i32_sub,j.f64_convert_i32_s])},mod:{args:[z.f64,z.f64],returns:[z.f64],binary:fa([j.local_get],q(0),[j.i64_trunc_s_f64,j.local_get],q(1),[j.i64_trunc_s_f64,j.i64_rem_s,j.f64_convert_s_i64])},bitwiseOr:{args:[z.f64,z.f64],returns:[z.f64],binary:fa([j.local_get],q(0),[j.i64_trunc_s_f64,j.local_get],q(1),[j.i64_trunc_s_f64,j.i64_or,j.f64_convert_s_i64])},bitwiseAnd:{args:[z.f64,z.f64],returns:[z.f64],binary:fa([j.local_get],q(0),[j.i64_trunc_s_f64,j.local_get],q(1),[j.i64_trunc_s_f64,j.i64_and,j.f64_convert_s_i64])},_getBufferIndex:{args:[z.f64],returns:[z.i32],localVariables:[z.f64,z.i32],binary:fa([j.f64_const],J(za),[j.local_get],q(0),[j.f64_add,j.local_tee],q(1),[j.i32_trunc_s_f64,j.local_set],q(2),[j.i32_const],va(-1),[j.local_get],q(2),[j.local_get],q(2),[j.i32_const],q(0),[j.i32_lt_s,j.local_get],q(2),[j.i32_const],q(8388608),[j.i32_gt_s,j.i32_or,j.select])}};wa.localFuncMap=xa;var cb=ta&&ta.__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},C=ta&&ta.__spread||function(){for(var $=[],r=0;r<arguments.length;r++)$=$.concat(cb(arguments[r]));return $};function Ja($,r){var o=$.map(function($,o){return G($,r)});return ya(Ta(o,[j.drop]))}function ub($,r){var o=G($,r);return C([j.loop,aa.void],o,Q,[j.br_if],va(0),[j.end,j.f64_const],J(0))}function vb($,r,o){var e=G(r,o),t=o.resolveLocal(z.f64);return C(G($,o),[j.local_set],q(t),[j.loop,aa.void],e,[j.drop,j.local_get],q(t),[j.f64_const],J(1),[j.f64_sub,j.local_tee],q(t),Q,[j.br_if],q(0),[j.end,j.f64_const],J(0))}function wb($,r,o,e){return C(G($,e),Q,[j.if,aa.f64],G(r,e),[j.else],G(o,e),[j.end])}function db($){switch($){case"gmegabuf":return C([j.i32_const],q(1e6),[j.i32_add]);case"megabuf":return[];}}function xb($,r){var o={"+=":[j.f64_add],"-=":[j.f64_sub],"*=":[j.f64_mul],"/=":[j.f64_div],"%=":r.resolveLocalFunc("mod"),"=":null}[$.operator];if(void 0===o)throw Z("Unknown assignment operator \""+$.operator+"\"",$.loc,r.rawSource);return o}function G($,r){switch($.type){case"SCRIPT":var o=$.body.map(function($,o){return C(G($,r),[j.drop])});return ya(o);case"EXPRESSION_BLOCK":return Ja($.body,r);case"BINARY_EXPRESSION":var e=G($.left,r),t=G($.right,r);if(null==(O={"+":[j.f64_add],"-":[j.f64_sub],"*":[j.f64_mul],"/":[j.f64_div],"%":r.resolveLocalFunc("mod"),"|":r.resolveLocalFunc("bitwiseOr"),"&":r.resolveLocalFunc("bitwiseAnd"),"^":r.resolveLocalFunc("pow"),"==":C([j.f64_sub],ma,[j.f64_convert_i32_s]),"!=":C([j.f64_sub],Q,[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 C(e,t,O);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)},n=ya($.arguments.map(function($){return G($,r)}));switch(p){case"exec2":return a(2),Ja($.arguments,r);case"exec3":return a(3),Ja($.arguments,r);case"if":a(3);var m=cb($.arguments,3);return wb(m[0],m[1],m[2],r);case"while":return a(1),ub($.arguments[0],r);case"loop":return a(2),vb($.arguments[0],$.arguments[1],r);case"megabuf":case"gmegabuf":a(1);var V=r.resolveLocal(z.i32);return C(G($.arguments[0],r),r.resolveLocalFunc("_getBufferIndex"),[j.local_tee],q(V),[j.i32_const],va(-1),[j.i32_ne,j.if,aa.f64,j.local_get],q(V),db(p),[j.f64_load,3,0,j.else,j.f64_const],J(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 s=r.resolveVar(W.value);return C(G($.arguments[1],r),[j.global_set],s,[j.global_get],s);case"abs":return a(1),C(n,[j.f64_abs]);case"sqrt":return a(1),C(n,[j.f64_sqrt]);case"int":return a(1),C(n,[j.f64_floor]);case"min":return a(2),C(n,[j.f64_min]);case"max":return a(2),C(n,[j.f64_max]);case"above":return a(2),C(n,[j.f64_gt,j.f64_convert_i32_s]);case"below":return a(2),C(n,[j.f64_lt,j.f64_convert_i32_s]);case"equal":return a(2),C(n,[j.f64_sub],ma,[j.f64_convert_i32_s]);case"bnot":return a(1),C(n,ma,[j.f64_convert_i32_s]);}var l=r.resolveLocalFunc(p);if(null==l||p.startsWith("_"))throw ca("\""+p+"\" is not defined.",$.callee.loc,r.rawSource);if(null!=oa[p])a(oa[p].length);else{if(null==xa[p])throw Z("Missing arity information for the function `"+p+"()`",$.callee.loc,r.rawSource);a(xa[p].args.length)}return C(n,l);case"ASSIGNMENT_EXPRESSION":e=$.left;var _=G($.right,r),c=xb($,r);if("IDENTIFIER"===e.type){s=r.resolveVar(e.value);var u=C([j.global_get],s),f=C([j.global_set],s);return null===c?C(_,f,u):C(u,_,c,f,u)}if("CALL_EXPRESSION"!==e.type)throw Z("Unexpected left hand side type for assignment: "+e.type,$.loc,r.rawSource);var d=r.resolveLocal(z.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 v=e.callee.value;if("gmegabuf"!==v&&"megabuf"!==v)throw ca("The only function calls which may be assigned to are `gmegabuf()` and `megabuf()`.",e.callee.loc,r.rawSource);var g=db(v);if(null===c){var E=r.resolveLocal(z.i32),L=r.resolveLocal(z.f64);return C(_,[j.local_set],q(L),G(e.arguments[0],r),r.resolveLocalFunc("_getBufferIndex"),[j.local_tee],q(E),[j.i32_const],q(0),[j.i32_lt_s,j.if,aa.f64,j.f64_const],J(0),[j.else,j.local_get],q(E),g,[j.local_tee],q(d),[j.local_get],q(L),[j.f64_store,3,0,j.local_get],q(L),[j.end])}V=r.resolveLocal(z.i32);var S=r.resolveLocal(z.i32),h=r.resolveLocal(z.f64),x=r.resolveLocal(z.f64);return C(_,[j.local_set],q(h),G(e.arguments[0],r),r.resolveLocalFunc("_getBufferIndex"),[j.local_tee],q(V),[j.i32_const],va(-1),[j.i32_ne,j.local_tee],q(S),[j.if,aa.f64,j.local_get],q(V),[j.f64_load,3,0,j.else,j.f64_const],J(0),[j.end,j.local_get],q(h),c,[j.local_tee],q(x),[j.local_get],q(S),[j.if,aa.void,j.local_get],q(V),[j.local_get],q(x),[j.f64_store,3,0,j.end]);case"LOGICAL_EXPRESSION":e=G($.left,r),t=G($.right,r);var I={"&&":{comparison:ma,shortCircutValue:0},"||":{comparison:Q,shortCircutValue:1}}[$.operator];if(null==I)throw Z("Unknown logical expression operator "+$.operator,$.loc,r.rawSource);var w=I.comparison,B=I.shortCircutValue;return C(e,w,[j.if,aa.f64,j.f64_const],J(B),[j.else],t,Q,[j.f64_convert_i32_s,j.end]);case"UNARY_EXPRESSION":var O,b=G($.value,r);if(null==(O={"-":[j.f64_neg],"+":[],"!":C(ma,[j.f64_convert_i32_s])}[$.operator]))throw Z("Unknown logical unary operator "+$.operator,$.loc,r.rawSource);return C(b,O);case"IDENTIFIER":var y=$.value;return C([j.global_get],r.resolveVar(y));case"NUMBER_LITERAL":return C([j.f64_const],J($.value));default:throw Z("Unknown AST node type "+$.type,$.loc,r.rawSource);}}ta.emit=G;var Aa=sa&&sa.__read||function(r,$){var e="function"==typeof Symbol&&r[Symbol.iterator];if(!e)return r;var t,n,o=e.call(r),d=[];try{for(;(void 0===$||$-->0)&&!(t=o.next()).done;)d.push(t.value)}catch(a){n={error:a}}finally{try{t&&!t.done&&(e=o.return)&&e.call(o)}finally{if(n)throw n.error}}return d},K=sa&&sa.__spread||function(){for(var r=[],$=0;$<arguments.length;$++)r=r.concat(Aa(arguments[$]));return r},Ka=function(){function r(r,$){var e=this;void 0===r&&(r=[]),void 0===$&&($=0),this._counter=-1+$,this._map=new Map,r.forEach(function(r){return e.get(r)})}return r.prototype.get=function(r){return this._map.has(r)||(this._counter++,this._map.set(r,this._counter)),this._map.get(r)},r.prototype.map=function(r){return Array.from(this._map.entries()).map(function($){var e=Aa($,2),t=e[0],n=e[1];return r(t,n)})},r}();function La(r){var $=r.globals,e=r.functions,t=r.preParsed,n=void 0!==t&&t,o=Object.entries(oa).map(function(r){var $=Aa(r,2),e=$[0],t=$[1];return{args:new Array(t.length).fill(null).map(function(r){return z.f64}),returns:[z.f64],name:e}}),d=new Ka(Array.from($)),a=new Ka([],$.size),i=new Ka(o.map(function(r){return r.name})),p=Object.entries(e).map(function(r){var e=Aa(r,2),t=e[0],o=e[1],p=n?o:Ha(o);if("string"==typeof p)throw new Error("Got passed unparsed code without setting the preParsed flag");var c=[];return{binary:G(p,{resolveVar:function(r){return $.has(r)?q(d.get(r)):q(a.get(r))},resolveLocal:function(r){return c.push(r),c.length-1},resolveLocalFunc:function(r){if(null==oa[r]&&null==xa[r])return null;var $=i.get(r);return K([j.call],q($))},rawSource:o}),exportName:t,args:[],returns:[],localVariables:c}}),c=i.map(function(r){return r}).slice(o.length).map(function(r){var $=xa[r];if(null==$)throw new Error("Undefined local function \""+r+"\"");return $}),m=K(o,c,p).map(function(r){return K([_a],ha(r.args),ha(r.returns))}),u=K(Array.from($).map(function(r){return K(na("js"),na(r),[ab,z.f64,Ia.var])}),o.map(function(r,$){return K(na("imports"),na(r.name),[bb,$])})),X=K(p,c).map(function(r,$){return[o.length+$]}),D=[K(q(0),q(1e3))],s=a.map(function(){return K([z.f64,Ia.var,j.f64_const],J(0),[j.end])}),l=K(p).map(function(r,$){var e=$+o.length+c.length;return K(na(r.exportName),[$a.FUNC,e])}),_=K(c,p).map(function(r){var $,e=(null!==($=r.localVariables)&&void 0!==$?$:[]).map(function(r){return K(q(1),[r])});return ha(K(ha(e),r.binary,[j.end]))});return new Uint8Array(K([0,97,115,109],[1,0,0,0],ea(da.TYPE,m),ea(da.IMPORT,u),ea(da.FUNC,X),ea(da.MEMORY,D),ea(da.GLOBAL,s),ea(da.EXPORT,l),ea(da.CODE,_)))}sa.compileModule=La;var ia={};var yb=ia&&ia.__assign||function(){return(yb=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i]);return e}).apply(this,arguments)},zb=ia&&ia.__awaiter||function(e,r,t,n){return new(t||(t=Promise))(function(i,o){function a(e){try{s(n.next(e))}catch(r){o(r)}}function c(e){try{s(n.throw(e))}catch(r){o(r)}}function s(e){var r;e.done?i(e.value):(r=e.value,r instanceof t?r:new t(function(e){e(r)})).then(a,c)}s((n=n.apply(e,r||[])).next())})},Ab=ia&&ia.__generator||function(e,r){var t,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(o){return function(c){return function(o){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue;}o=r.call(e,a)}catch(c){o=[6,c],n=0}finally{t=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}};function eb(e){var r=e.globals,t=e.functions;return zb(this,void 0,void 0,function(){var e,n,i;return Ab(this,function(o){switch(o.label){case 0:return e=La({globals:new Set(Object.keys(r)),functions:t}),[4,WebAssembly.compile(e)];case 1:return n=o.sent(),i={js:yb({},r),imports:oa},[4,WebAssembly.instantiate(n,i)];case 2:return[2,o.sent()];}})})}ia.loadModule=eb;ja.loadModule=eb,ja.shims=oa,ja.compileModule=La,ja.parse=Ha;if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=ja}else if(typeof define==="function"&&define.amd){define(function(){return ja})}})();
(function () {var ia={};var oa={};function Ka(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 ib(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,jb={},F=jb={};function ya(){throw new Error("setTimeout has not been defined")}function za(){throw new Error("clearTimeout has not been defined")}function La($){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 kb($){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,fa=[],Aa=!1,Ma=-1;function lb(){Aa&&pa&&(Aa=!1,pa.length?fa=pa.concat(fa):Ma=-1,fa.length&&Na())}function Na(){if(!Aa){var $=La(lb);Aa=!0;for(var e=fa.length;e;){for(pa=fa,fa=[];++Ma<e;)pa&&pa[Ma].run();Ma=-1,e=fa.length}pa=null,Aa=!1,kb($)}}function Oa($,e){this.fun=$,this.array=e}function Q(){}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 Oa($,e)),1!==fa.length||Aa||La(Na)},Oa.prototype.run=function(){this.fun.apply(null,this.array)},F.title="browser",F.env={},F.argv=[],F.version="",F.versions={},F.on=Q,F.addListener=Q,F.once=Q,F.off=Q,F.removeListener=Q,F.removeAllListeners=Q,F.emit=Q,F.prependListener=Q,F.prependOnceListener=Q,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 mb=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(jb.argv.slice(1))),t.exports}.call({});var nb={};nb={parse:mb.parse};function Pa(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 Qa(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?Pa(Object(t),!0).forEach(function(r){Ba(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Pa(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 ob={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=ob[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=Qa({},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=Qa({},n,Ba({},t.key,y)))}}),r(n)}var qa={};var aa={},pb=aa&&aa.__read||function(r,t){var e="function"==typeof Symbol&&r[Symbol.iterator];if(!e)return r;var $,a,f=e.call(r),n=[];try{for(;(void 0===t||t-->0)&&!($=f.next()).done;)n.push($.value)}catch(o){a={error:o}}finally{try{$&&!$.done&&(e=f.return)&&e.call(f)}finally{if(a)throw a.error}}return n},qb=aa&&aa.__spread||function(){for(var r=[],t=0;t<arguments.length;t++)r=r.concat(pb(arguments[t]));return r};function Ra(r,t){for(var e=[],$=0;$<r.length;$++){e.push(r[$]),$===r.length-1||e.push(t)}return e}function va(r){var t=[];return r.forEach(function(r){t.push.apply(t,qb(r))}),t}aa.arrayJoin=Ra,aa.flatten=va;var Sa=function(r){return[].concat.apply([],r)};function Da(r,t){return new Array(r).fill(t).join("")}aa.flattenTwice=Sa,aa.repeat=Da;var Ta=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 Ua(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=Ua;var Va=function(r){function t(t,e,o){var n=r.call(this,t)||this;return n.sourceContext=Ua(e,o),n.loc=e,n}return Ta(t,r),t}(Error),rb=function(r){function t(){return null!==r&&r.apply(this,arguments)||this}return Ta(t,r),t}(Va);function ba(r,t,e){return new rb(r,t,e)}function U(r,t,e){return new Va(r,t,e)}qa.createUserError=ba,qa.createCompilerError=U;var Wa=oa&&oa.__assign||function(){return(Wa=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)},sb=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 Xa(r,e){var $=Ka(e,r.first_column),t=Ka(e,r.last_column);return{first_column:$.column,last_column:t.column,first_line:$.line,last_line:t.line}}function Ea(r){var e=sb(ib(r),2),$=e[0],t=e[1];try{var o=nb.parse($);return Ca(o,function(e){if(1!==e.loc.first_line||1!=e.loc.last_line)throw U("Unexpected multiline",e.loc,r);return Wa(Wa({},e),{loc:Xa(e.loc,t)})})}catch(a){if(null==a.hash)throw a;throw ba("Parse Error: "+a.message.split("\n")[3],Xa(a.hash.loc,t),r)}}oa.parse=Ea;var ra={};var sa={};var B={};function tb(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 ub=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(Y){t={error:Y}}finally{try{x&&!x.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return n},H=B&&B.__spread||function(){for(var $=[],r=0;r<arguments.length;r++)$=$.concat(ub(arguments[r]));return $},Ya=[0,97,115,109];B.MAGIC=Ya;var Za=[1,0,0,0];B.WASM_VERSION=Za;var wa=1e-5;B.EPSILON=wa;var ca={TYPE:1,IMPORT:2,FUNC:3,MEMORY:5,GLOBAL:6,EXPORT:7,CODE:10};B.SECTION=ca;var $a={FUNC:0,TABLE:1,MEMORY:2,GLOBAL:3};B.EXPORT_TYPE=$a;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($,r){return H([43],G($),G(r))},f64_store:function($,r){return H([57],G($),G(r))},i32_const:function($){return H([65],db($))},f64_const:function($){return H([68],cb($))},i32_eqz:69,i32_ne:71,i32_lt_s:72,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_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 Z={void:64,i32:127,i64:126,f32:125,f64:124};B.BLOCK=Z;var _a=96;B.FUNCTION_TYPE=_a;var vb=2;B.MEMORY_IDX=vb;var ab=3;B.GLOBAL_TYPE=ab;var bb=0;B.TYPE_IDX=bb;var la=H([j.f64_abs],j.f64_const(wa),[j.f64_lt]);B.IS_ZEROISH=la;var K=H([j.f64_abs],j.f64_const(wa),[j.f64_gt]);function cb($){var r=new Uint8Array(8);return tb(r,$),r}B.IS_NOT_ZEROISH=K,B.encodef64=cb;var ma=function($){return H([$.length],$.split("").map(function($){return $.charCodeAt(0)}))};function G($){var r=[];do{var e=127&$;0!==($>>>=7)&&(e|=128),r.push(e)}while(0!==$);return r}function db($){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=G,B.signedLEB128=db;var ga=function($){return H(G($.length),Sa($))};function da($,r){return 0===r.length?[]:H([$],ga(ga(r)))}B.encodeVector=ga,B.encodeSection=da;var wb=1e-5,na={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)>wb?1/o:0},floor:Math.floor,ceil:Math.ceil};var ta={};var xb=65536,yb=8,zb=2,Ga=8388608;var eb=Math.ceil(Ga*yb*zb/xb);var Ab=ta&&ta.__read||function($,o){var r="function"==typeof Symbol&&$[Symbol.iterator];if(!r)return $;var e,n,t=r.call($),p=[];try{for(;(void 0===o||o-->0)&&!(e=t.next()).done;)p.push(e.value)}catch(i){n={error:i}}finally{try{e&&!e.done&&(r=t.return)&&r.call(t)}finally{if(n)throw n.error}}return p},ea=ta&&ta.__spread||function(){for(var $=[],o=0;o<arguments.length;o++)$=$.concat(Ab(arguments[o]));return $},ua={sqr:{args:[q.f64],returns:[q.f64],binary:ea(j.local_get(0),j.local_get(0),[j.f64_mul])},bor:{args:[q.f64,q.f64],returns:[q.f64],binary:ea(j.local_get(0),K,j.local_get(1),K,[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:ea(j.local_get(0),K,j.local_get(1),K,[j.i32_and],j.i32_const(0),[j.i32_ne,j.f64_convert_i32_s])},sign:{args:[q.f64],returns:[q.f64],binary:ea(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:ea(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])},bitwiseOr:{args:[q.f64,q.f64],returns:[q.f64],binary:ea(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:ea(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])},_getBufferIndex:{args:[q.f64],returns:[q.i32],localVariables:[q.f64,q.i32],binary:ea(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(Ga-1),[j.i32_gt_s,j.i32_or,j.select])}};ta.localFuncMap=ua;var fb=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(fb(arguments[r]));return $};function Ha($,r){var o=$.map(function($,o){return C($,r)});return va(Ra(o,[j.drop]))}function Bb($,r){var o=C($,r);return z(j.loop(Z.void),o,K,j.br_if(0),[j.end],j.f64_const(0))}function Cb($,r,o){var e=C(r,o),t=o.resolveLocal(q.f64);return z(C($,o),j.local_set(t),j.loop(Z.void),e,[j.drop],j.local_get(t),j.f64_const(1),[j.f64_sub],j.local_tee(t),K,j.br_if(0),[j.end],j.f64_const(0))}function Db($,r,o,e){return z(C($,e),K,j.if(Z.f64),C(r,e),[j.else],C(o,e),[j.end])}function gb($){switch($){case"gmegabuf":return 8*Ga;case"megabuf":return 0;}}function Eb($,r){var o={"+=":[j.f64_add],"-=":[j.f64_sub],"*=":[j.f64_mul],"/=":[j.f64_div],"%=":r.resolveLocalFunc("mod"),"=":null}[$.operator];if(void 0===o)throw U("Unknown assignment operator \""+$.operator+"\"",$.loc,r.rawSource);return o}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 Ha($.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],"/":[j.f64_div],"%":r.resolveLocalFunc("mod"),"|":r.resolveLocalFunc("bitwiseOr"),"&":r.resolveLocalFunc("bitwiseAnd"),"^":r.resolveLocalFunc("pow"),"==":z([j.f64_sub],la,[j.f64_convert_i32_s]),"!=":z([j.f64_sub],K,[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 U("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 ba("Too few arguments passed to `"+p+"()`. Expected "+o+" but only got "+i.length+".",$.loc,r.rawSource);if(i.length>o)throw ba("Too many arguments passed to `"+p+"()`. Expected "+o+" but got "+i.length+".",i[o].loc,r.rawSource)},m=va($.arguments.map(function($){return C($,r)}));switch(p){case"exec2":return a(2),Ha($.arguments,r);case"exec3":return a(3),Ha($.arguments,r);case"if":a(3);var V=fb($.arguments,3);return Db(V[0],V[1],V[2],r);case"while":return a(1),Bb($.arguments[0],r);case"loop":return a(2),Cb($.arguments[0],$.arguments[1],r);case"megabuf":case"gmegabuf":a(1);var n=r.resolveLocal(q.i32);return z(C($.arguments[0],r),r.resolveLocalFunc("_getBufferIndex"),j.local_tee(n),j.i32_const(-1),[j.i32_ne],j.if(Z.f64),j.local_get(n),j.f64_load(3,gb(p)),[j.else],j.f64_const(0),[j.end]);case"assign":a(2);var W=$.arguments[0];if("IDENTIFIER"!=W.type)throw ba("Expected the first argument of `assign()` to be an identifier.",W.loc,r.rawSource);var l=r.resolveVar(W.value);return z(C($.arguments[1],r),j.global_set(l),j.global_get(l));case"abs":return a(1),z(m,[j.f64_abs]);case"sqrt":return a(1),z(m,[j.f64_sqrt]);case"int":return a(1),z(m,[j.f64_floor]);case"min":return a(2),z(m,[j.f64_min]);case"max":return a(2),z(m,[j.f64_max]);case"above":return a(2),z(m,[j.f64_gt,j.f64_convert_i32_s]);case"below":return a(2),z(m,[j.f64_lt,j.f64_convert_i32_s]);case"equal":return a(2),z(m,[j.f64_sub],la,[j.f64_convert_i32_s]);case"bnot":return a(1),z(m,la,[j.f64_convert_i32_s]);}var s=r.resolveLocalFunc(p);if(null==s||p.startsWith("_"))throw ba("\""+p+"\" is not defined.",$.callee.loc,r.rawSource);if(null!=na[p])a(na[p].length);else{if(null==ua[p])throw U("Missing arity information for the function `"+p+"()`",$.callee.loc,r.rawSource);a(ua[p].args.length)}return z(m,s);case"ASSIGNMENT_EXPRESSION":e=$.left;var _=C($.right,r),c=Eb($,r);if("IDENTIFIER"===e.type){l=r.resolveVar(e.value);var u=j.global_get(l),f=j.global_set(l);return null===c?z(_,f,u):z(u,_,c,f,u)}if("CALL_EXPRESSION"!==e.type)throw U("Unexpected left hand side type for assignment: "+e.type,$.loc,r.rawSource);var v=r.resolveLocal(q.i32);if(1!==e.arguments.length)throw ba("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 ba("The only function calls which may be assigned to are `gmegabuf()` and `megabuf()`.",e.callee.loc,r.rawSource);var g=gb(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.resolveLocalFunc("_getBufferIndex"),j.local_tee(E),j.i32_const(0),[j.i32_lt_s],j.if(Z.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])}n=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.resolveLocalFunc("_getBufferIndex"),j.local_tee(n),j.i32_const(-1),[j.i32_ne],j.local_tee(h),j.if(Z.f64),j.local_get(n),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(Z.void),j.local_get(n),j.local_get(x),j.f64_store(3,g),[j.end]);case"LOGICAL_EXPRESSION":e=C($.left,r),t=C($.right,r);var L={"&&":{comparison:la,shortCircutValue:0},"||":{comparison:K,shortCircutValue:1}}[$.operator];if(null==L)throw U("Unknown logical expression operator "+$.operator,$.loc,r.rawSource);var w=L.comparison,O=L.shortCircutValue;return z(e,w,j.if(Z.f64),j.f64_const(O),[j.else],t,K,[j.f64_convert_i32_s,j.end]);case"UNARY_EXPRESSION":var b,y=C($.value,r);if(null==(b={"-":[j.f64_neg],"+":[],"!":z(la,[j.f64_convert_i32_s])}[$.operator]))throw U("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 U("Unknown AST node type "+$.type,$.loc,r.rawSource);}}sa.emit=C;var xa=ra&&ra.__read||function(r,$){var e="function"==typeof Symbol&&r[Symbol.iterator];if(!e)return r;var t,n,o=e.call(r),a=[];try{for(;(void 0===$||$-->0)&&!(t=o.next()).done;)a.push(t.value)}catch(d){n={error:d}}finally{try{t&&!t.done&&(e=o.return)&&e.call(o)}finally{if(n)throw n.error}}return a},J=ra&&ra.__spread||function(){for(var r=[],$=0;$<arguments.length;$++)r=r.concat(xa(arguments[$]));return r},Ia=function(){function r(r,$){var e=this;void 0===r&&(r=[]),void 0===$&&($=0),this._counter=-1+$,this._map=new Map,r.forEach(function(r){return e.get(r)})}return r.prototype.get=function(r){return this._map.has(r)||(this._counter++,this._map.set(r,this._counter)),this._map.get(r)},r.prototype.map=function(r){return Array.from(this._map.entries()).map(function($){var e=xa($,2),t=e[0],n=e[1];return r(t,n)})},r}();function Ja(r){var $=r.globals,e=r.functions,t=r.preParsed,n=void 0!==t&&t,o=Object.entries(na).map(function(r){var $=xa(r,2),e=$[0],t=$[1];return{args:new Array(t.length).fill(null).map(function(r){return q.f64}),returns:[q.f64],name:e}}),a=new Ia(Array.from($)),d=new Ia([],$.size),i=new Ia(o.map(function(r){return r.name})),p=Object.entries(e).map(function(r){var e=xa(r,2),t=e[0],o=e[1],p=n?o:Ea(o);if("string"==typeof p)throw new Error("Got passed unparsed code without setting the preParsed flag");var c=[];return{binary:C(p,{resolveVar:function(r){return $.has(r)?a.get(r):d.get(r)},resolveLocal:function(r){return c.push(r),c.length-1},resolveLocalFunc:function(r){if(null==na[r]&&null==ua[r])return null;var $=i.get(r);return j.call($)},rawSource:o}),exportName:t,args:[],returns:[],localVariables:c}}),c=i.map(function(r){return r}).slice(o.length).map(function(r){var $=ua[r];if(null==$)throw new Error("Undefined local function \""+r+"\"");return $}),u=function(r){return J(r.args,["|"],r.returns).join("-")},m=[],s=new Map;function X(r){var $=u(r),e=s.get($);if(null==e)throw new Error("Failed to get a type index for key "+$);return e}J(o,c,p).forEach(function(r){var $=u(r);s.has($)||(m.push(J([_a],ga(r.args),ga(r.returns))),s.set($,m.length-1))});var D=J(Array.from($).map(function(r){return J(ma("js"),ma(r),[ab,q.f64,Fa.var])}),o.map(function(r,$){var e=X(r);return J(ma("imports"),ma(r.name),J([bb],G(e)))})),l=J(c,p).map(function(r){var $=X(r);return G($)}),_=[J([1],G(eb),G(eb))],v=d.map(function(){return J([q.f64,Fa.var],j.f64_const(0),[j.end])}),f=J(p).map(function(r,$){var e=$+o.length+c.length;return J(ma(r.exportName),[$a.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(Ya,Za,da(ca.TYPE,m),da(ca.IMPORT,D),da(ca.FUNC,l),da(ca.MEMORY,_),da(ca.GLOBAL,v),da(ca.EXPORT,f),da(ca.CODE,E)))}ra.compileModule=Ja;var ha={};var Fb=ha&&ha.__assign||function(){return(Fb=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i]);return e}).apply(this,arguments)},Gb=ha&&ha.__awaiter||function(e,r,t,n){return new(t||(t=Promise))(function(i,o){function a(e){try{s(n.next(e))}catch(r){o(r)}}function c(e){try{s(n.throw(e))}catch(r){o(r)}}function s(e){var r;e.done?i(e.value):(r=e.value,r instanceof t?r:new t(function(e){e(r)})).then(a,c)}s((n=n.apply(e,r||[])).next())})},Hb=ha&&ha.__generator||function(e,r){var t,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(o){return function(c){return function(o){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue;}o=r.call(e,a)}catch(c){o=[6,c],n=0}finally{t=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}};function hb(e){var r=e.globals,t=e.functions;return Gb(this,void 0,void 0,function(){var e,n,i;return Hb(this,function(o){switch(o.label){case 0:return e=Ja({globals:new Set(Object.keys(r)),functions:t}),[4,WebAssembly.compile(e)];case 1:return n=o.sent(),i={js:Fb({},r),imports:na},[4,WebAssembly.instantiate(n,i)];case 2:return[2,o.sent()];}})})}ha.loadModule=hb;ia.loadModule=hb,ia.shims=na,ia.compileModule=Ja,ia.parse=Ea;if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=ia}else if(typeof define==="function"&&define.amd){define(function(){return ia})}})();

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

var wasmFunctions_1 = require("./wasmFunctions");
var constants_1 = require("./constants");
var NamespaceResolver = /** @class */ (function () {

@@ -82,5 +83,5 @@ function NamespaceResolver(initial, offset) {

if (globalVariables.has(name)) {
return encoding_1.unsignedLEB128(externalVarsResolver.get(name));
return externalVarsResolver.get(name);
}
return encoding_1.unsignedLEB128(userVarsResolver.get(name));
return userVarsResolver.get(name);
},

@@ -96,3 +97,3 @@ resolveLocal: function (type) {

var offset = localFuncResolver.get(name);
return __spread([encoding_1.op.call], encoding_1.unsignedLEB128(offset));
return encoding_1.op.call(offset);
},

@@ -121,9 +122,27 @@ rawSource: code

});
// Given a function definition, return a hashable string representation of its signature.
var getSignatureKey = function (func) {
return __spread(func.args, ["|"], func.returns).join("-");
};
// https://webassembly.github.io/spec/core/binary/modules.html#type-section
// TODO: Theoretically we could merge identiacal type definitions
var types = __spread(functionImports, localFuncs, moduleFuncs).map(function (func) {
return __spread([
var types = [];
var typeIndexByKey = new Map();
__spread(functionImports, localFuncs, moduleFuncs).forEach(function (func) {
var key = getSignatureKey(func);
if (typeIndexByKey.has(key)) {
return;
}
types.push(__spread([
encoding_1.FUNCTION_TYPE
], encoding_1.encodeVector(func.args), encoding_1.encodeVector(func.returns));
], encoding_1.encodeVector(func.args), encoding_1.encodeVector(func.returns)));
typeIndexByKey.set(key, types.length - 1);
});
function getTypeIndex(func) {
var key = getSignatureKey(func);
var typeIndex = typeIndexByKey.get(key);
if (typeIndex == null) {
throw new Error("Failed to get a type index for key " + key);
}
return typeIndex;
}
// https://webassembly.github.io/spec/core/binary/modules.html#import-section

@@ -133,3 +152,4 @@ var imports = __spread(Array.from(globalVariables).map(function (name) {

}), functionImports.map(function (func, i) {
return __spread(encoding_1.encodeString("imports"), encoding_1.encodeString(func.name), [encoding_1.TYPE_IDX, i]);
var typeIndex = getTypeIndex(func);
return __spread(encoding_1.encodeString("imports"), encoding_1.encodeString(func.name), __spread([encoding_1.TYPE_IDX], encoding_1.unsignedLEB128(typeIndex)));
}));

@@ -140,8 +160,10 @@ // https://webassembly.github.io/spec/core/binary/modules.html#function-section

// > index not referencing a function import.
var functions = __spread(moduleFuncs, localFuncs).map(function (_, i) {
var funcIndex = functionImports.length + i;
return [funcIndex];
var functions = __spread(localFuncs, moduleFuncs).map(function (func) {
var typeIndex = getTypeIndex(func);
return encoding_1.unsignedLEB128(typeIndex);
});
var memories = [
__spread(encoding_1.unsignedLEB128(0), encoding_1.unsignedLEB128(1000)),
__spread([
0x01
], encoding_1.unsignedLEB128(constants_1.WASM_MEMORY_SIZE), encoding_1.unsignedLEB128(constants_1.WASM_MEMORY_SIZE)),
];

@@ -152,5 +174,4 @@ // https://webassembly.github.io/spec/core/binary/modules.html#global-section

encoding_1.VAL_TYPE.f64,
encoding_1.MUTABILITY["var"],
encoding_1.op.f64_const
], encoding_1.encodef64(0), [
encoding_1.MUTABILITY["var"]
], encoding_1.op.f64_const(0), [
encoding_1.op.end,

@@ -162,4 +183,13 @@ ]);

var funcIndex = i + functionImports.length + localFuncs.length;
return __spread(encoding_1.encodeString(func.exportName), [encoding_1.EXPORT_TYPE.FUNC, funcIndex]);
return __spread(encoding_1.encodeString(func.exportName), [
encoding_1.EXPORT_TYPE.FUNC
], encoding_1.unsignedLEB128(funcIndex));
});
/* Uncomment this to expose memory
xports.push([
...encodeString("memory"),
EXPORT_TYPE.MEMORY,
...unsignedLEB128(0),
]);
*/
// https://webassembly.github.io/spec/core/binary/modules.html#code-section

@@ -178,5 +208,5 @@ var codes = __spread(localFuncs, moduleFuncs).map(function (func) {

});
return new Uint8Array(__spread([0x00, 0x61, 0x73, 0x6d], [0x01, 0x00, 0x00, 0x00], encoding_1.encodeSection(encoding_1.SECTION.TYPE, types), encoding_1.encodeSection(encoding_1.SECTION.IMPORT, imports), encoding_1.encodeSection(encoding_1.SECTION.FUNC, functions), encoding_1.encodeSection(encoding_1.SECTION.MEMORY, memories), encoding_1.encodeSection(encoding_1.SECTION.GLOBAL, globals), encoding_1.encodeSection(encoding_1.SECTION.EXPORT, xports), encoding_1.encodeSection(encoding_1.SECTION.CODE, codes)));
return new Uint8Array(__spread(encoding_1.MAGIC, encoding_1.WASM_VERSION, encoding_1.encodeSection(encoding_1.SECTION.TYPE, types), encoding_1.encodeSection(encoding_1.SECTION.IMPORT, imports), encoding_1.encodeSection(encoding_1.SECTION.FUNC, functions), encoding_1.encodeSection(encoding_1.SECTION.MEMORY, memories), encoding_1.encodeSection(encoding_1.SECTION.GLOBAL, globals), encoding_1.encodeSection(encoding_1.SECTION.EXPORT, xports), encoding_1.encodeSection(encoding_1.SECTION.CODE, codes)));
}
exports.compileModule = compileModule;
//# sourceMappingURL=compiler.js.map

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

var arrayUtils_1 = require("./arrayUtils");
var constants_1 = require("./constants");
function emitExpressionBlock(body, context) {

@@ -40,11 +41,5 @@ var statements = body.map(function (statement, i) {

var body = emit(expression, context);
return __spread([
encoding_1.op.loop,
encoding_1.BLOCK["void"]
], body, encoding_1.IS_NOT_ZEROISH, [
encoding_1.op.br_if
], encoding_1.signedLEB128(0), [
encoding_1.op.end,
encoding_1.op.f64_const
], encoding_1.encodef64(0));
return __spread(encoding_1.op.loop(encoding_1.BLOCK["void"]), body, encoding_1.IS_NOT_ZEROISH, encoding_1.op.br_if(0), [
encoding_1.op.end
], encoding_1.op.f64_const(0));
}

@@ -55,22 +50,9 @@ function emitLoop(count, expression, context) {

// TODO: This could probably be simplified
return __spread(emit(count, context), [
encoding_1.op.local_set
], encoding_1.unsignedLEB128(localIndex), [
encoding_1.op.loop,
encoding_1.BLOCK["void"]
], body, [
encoding_1.op.drop,
// Decrement the count
encoding_1.op.local_get
], encoding_1.unsignedLEB128(localIndex), [
encoding_1.op.f64_const
], encoding_1.encodef64(1), [
encoding_1.op.f64_sub,
encoding_1.op.local_tee
], encoding_1.unsignedLEB128(localIndex), encoding_1.IS_NOT_ZEROISH, [
encoding_1.op.br_if
], encoding_1.unsignedLEB128(0), [
encoding_1.op.end,
encoding_1.op.f64_const
], encoding_1.encodef64(0));
return __spread(emit(count, context), encoding_1.op.local_set(localIndex), 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.end
], encoding_1.op.f64_const(0));
}

@@ -80,6 +62,3 @@ function emitConditional(test, consiquent, alternate, context) {

// Is that an optimization that we might want as well?
return __spread(emit(test, context), encoding_1.IS_NOT_ZEROISH, [
encoding_1.op["if"],
encoding_1.BLOCK.f64
], emit(consiquent, context), [
return __spread(emit(test, context), encoding_1.IS_NOT_ZEROISH, encoding_1.op["if"](encoding_1.BLOCK.f64), emit(consiquent, context), [
encoding_1.op["else"]

@@ -95,9 +74,5 @@ ], emit(alternate, context), [

case "gmegabuf":
return __spread([
encoding_1.op.i32_const
], encoding_1.unsignedLEB128(1000000), [
encoding_1.op.i32_add,
]);
return constants_1.BUFFER_SIZE * 8;
case "megabuf":
return [];
return 0;
}

@@ -192,19 +167,7 @@ }

var index = context.resolveLocal(encoding_1.VAL_TYPE.i32);
return __spread(emit(ast.arguments[0], context), context.resolveLocalFunc("_getBufferIndex"), [
encoding_1.op.local_tee
], encoding_1.unsignedLEB128(index), [
encoding_1.op.i32_const
], encoding_1.signedLEB128(-1), [
encoding_1.op.i32_ne,
// STACK: [in range]
encoding_1.op["if"],
encoding_1.BLOCK.f64,
encoding_1.op.local_get
], encoding_1.unsignedLEB128(index), emitAddMemoryOffset(functionName_1), [
encoding_1.op.f64_load,
0x03,
0x00,
encoding_1.op["else"],
encoding_1.op.f64_const
], encoding_1.encodef64(0), [
return __spread(emit(ast.arguments[0], context), context.resolveLocalFunc("_getBufferIndex"), encoding_1.op.local_tee(index), encoding_1.op.i32_const(-1), [
encoding_1.op.i32_ne
], encoding_1.op["if"](encoding_1.BLOCK.f64), encoding_1.op.local_get(index), encoding_1.op.f64_load(3, emitAddMemoryOffset(functionName_1)), [
encoding_1.op["else"]
], encoding_1.op.f64_const(0), [
encoding_1.op.end,

@@ -219,7 +182,3 @@ ]);

var resolvedName = context.resolveVar(variableIdentifier.value);
return __spread(emit(ast.arguments[1], context), [
encoding_1.op.global_set
], resolvedName, [
encoding_1.op.global_get
], resolvedName);
return __spread(emit(ast.arguments[1], context), encoding_1.op.global_set(resolvedName), encoding_1.op.global_get(resolvedName));
// Function calls which can be linlined

@@ -285,4 +244,4 @@ case "abs":

// https://en.wikipedia.org/wiki/Peephole_optimization
var get = __spread([encoding_1.op.global_get], resolvedName);
var set = __spread([encoding_1.op.global_set], resolvedName);
var get = encoding_1.op.global_get(resolvedName);
var set = encoding_1.op.global_set(resolvedName);
// `=` is a special case in that it does not need the original value.

@@ -314,30 +273,7 @@ if (mutationCode === null) {

var rightValue_1 = context.resolveLocal(encoding_1.VAL_TYPE.f64);
return __spread(rightCode, [
encoding_1.op.local_set
], encoding_1.unsignedLEB128(rightValue_1), emit(left.arguments[0], context), context.resolveLocalFunc("_getBufferIndex"), [
encoding_1.op.local_tee
], encoding_1.unsignedLEB128(unnormalizedIndex), [
encoding_1.op.i32_const
], encoding_1.unsignedLEB128(0), [
encoding_1.op.i32_lt_s,
// STACK: [is the index out of range?]
encoding_1.op["if"],
encoding_1.BLOCK.f64,
encoding_1.op.f64_const
], encoding_1.encodef64(0), [
encoding_1.op["else"],
encoding_1.op.local_get
], encoding_1.unsignedLEB128(unnormalizedIndex), addOffset, [
encoding_1.op.local_tee
], encoding_1.unsignedLEB128(localIndex), [
// STACK: [buffer index]
encoding_1.op.local_get
], encoding_1.unsignedLEB128(rightValue_1), [
// STACK: [buffer index, right]
encoding_1.op.f64_store,
0x03,
0x00,
// STACK: []
encoding_1.op.local_get
], encoding_1.unsignedLEB128(rightValue_1), [
return __spread(rightCode, encoding_1.op.local_set(rightValue_1), emit(left.arguments[0], context), context.resolveLocalFunc("_getBufferIndex"), encoding_1.op.local_tee(unnormalizedIndex), encoding_1.op.i32_const(0), [
encoding_1.op.i32_lt_s
], encoding_1.op["if"](encoding_1.BLOCK.f64), encoding_1.op.f64_const(0), [
encoding_1.op["else"]
], encoding_1.op.local_get(unnormalizedIndex), encoding_1.op.local_tee(localIndex), encoding_1.op.local_get(rightValue_1), encoding_1.op.f64_store(3, addOffset), encoding_1.op.local_get(rightValue_1), [
// STACK: [Right/Buffer value]

@@ -353,43 +289,10 @@ encoding_1.op.end,

var result = context.resolveLocal(encoding_1.VAL_TYPE.f64);
return __spread(rightCode, [
encoding_1.op.local_set
], encoding_1.unsignedLEB128(rightValue), emit(left.arguments[0], context), context.resolveLocalFunc("_getBufferIndex"), [
encoding_1.op.local_tee
], encoding_1.unsignedLEB128(index), [
// STACK: [index]
encoding_1.op.i32_const
], encoding_1.signedLEB128(-1), [
encoding_1.op.i32_ne,
encoding_1.op.local_tee
], encoding_1.unsignedLEB128(inBounds), [
encoding_1.op["if"],
encoding_1.BLOCK.f64,
encoding_1.op.local_get
], encoding_1.unsignedLEB128(index), [
encoding_1.op.f64_load,
0x03,
0x00,
encoding_1.op["else"],
encoding_1.op.f64_const
], encoding_1.encodef64(0), [
return __spread(rightCode, encoding_1.op.local_set(rightValue), emit(left.arguments[0], context), context.resolveLocalFunc("_getBufferIndex"), encoding_1.op.local_tee(index), encoding_1.op.i32_const(-1), [
encoding_1.op.i32_ne
], encoding_1.op.local_tee(inBounds), encoding_1.op["if"](encoding_1.BLOCK.f64), encoding_1.op.local_get(index), encoding_1.op.f64_load(3, addOffset), [
encoding_1.op["else"]
], encoding_1.op.f64_const(0), [
encoding_1.op.end
], encoding_1.op.local_get(rightValue), mutationCode, encoding_1.op.local_tee(result), encoding_1.op.local_get(inBounds), encoding_1.op["if"](encoding_1.BLOCK["void"]), encoding_1.op.local_get(index), encoding_1.op.local_get(result), encoding_1.op.f64_store(3, addOffset), [
encoding_1.op.end,
// STACK: [current value from memory || 0]
// Apply the mutation
encoding_1.op.local_get
], encoding_1.unsignedLEB128(rightValue), mutationCode, [
encoding_1.op.local_tee
], encoding_1.unsignedLEB128(result), [
// STACK: [new value]
encoding_1.op.local_get
], encoding_1.unsignedLEB128(inBounds), [
encoding_1.op["if"],
encoding_1.BLOCK["void"],
encoding_1.op.local_get
], encoding_1.unsignedLEB128(index), [
encoding_1.op.local_get
], encoding_1.unsignedLEB128(result), [
encoding_1.op.f64_store,
0x03,
0x00,
encoding_1.op.end,
]);

@@ -415,7 +318,3 @@ }

var comparison = behavior.comparison, shortCircutValue = behavior.shortCircutValue;
return __spread(left, comparison, [
encoding_1.op["if"],
encoding_1.BLOCK.f64,
encoding_1.op.f64_const
], encoding_1.encodef64(shortCircutValue), [
return __spread(left, comparison, encoding_1.op["if"](encoding_1.BLOCK.f64), encoding_1.op.f64_const(shortCircutValue), [
encoding_1.op["else"]

@@ -445,5 +344,5 @@ ], right, encoding_1.IS_NOT_ZEROISH, [

// it.
return __spread([encoding_1.op.global_get], context.resolveVar(variableName));
return encoding_1.op.global_get(context.resolveVar(variableName));
case "NUMBER_LITERAL":
return __spread([encoding_1.op.f64_const], encoding_1.encodef64(ast.value));
return encoding_1.op.f64_const(ast.value);
default:

@@ -450,0 +349,0 @@ throw errorUtils_1.createCompilerError(

@@ -32,2 +32,4 @@ "use strict";

var arrayUtils_1 = require("./arrayUtils");
exports.MAGIC = [0x00, 0x61, 0x73, 0x6d];
exports.WASM_VERSION = [0x01, 0x00, 0x00, 0x00];
exports.EPSILON = 0.00001;

@@ -65,33 +67,97 @@ // An intial attempt to construct a Wasm binary by hand.

};
// TODO: Make the nameing of these consistent
exports.op = {
block: 0x02,
loop: 0x03,
br: 0x0c,
br_if: 0x0d,
/*
* Control Instructions
* https://webassembly.github.io/spec/core/binary/instructions.html#control-instructions
*/
// unreachable: 0x00,
// nop: 0x01,
// block: 0x02,
loop: function (blockType) { return [0x03, blockType]; },
"if": function (retType) { return [0x04, retType]; },
"else": 0x05,
end: 0x0b,
// br: (i: number) => [0x0c, ...signedLEB128(i)],
br_if: function (i) { return __spread([0x0d], unsignedLEB128(i)); },
// br_table: 0x0d,
// return: 0x0f,
call: function (i) { return __spread([0x10], unsignedLEB128(i)); },
// call_indirect: 0x11,
/*
* Parametric Instructions
* https://webassembly.github.io/spec/core/binary/instructions.html#parametric-instructions
*/
drop: 0x1a,
select: 0x1b,
call: 0x10,
drop: 0x1a,
f64_load: 0x2b,
f64_store: 0x39,
i32_and: 0x71,
i32_or: 0x72,
i32_const: 0x41,
/*
* Variable Instructions
* https://webassembly.github.io/spec/core/binary/instructions.html#variable-instructions
*/
local_get: function (i) { return __spread([0x20], unsignedLEB128(i)); },
local_set: function (i) { return __spread([0x21], unsignedLEB128(i)); },
local_tee: function (i) { return __spread([0x22], unsignedLEB128(i)); },
global_get: function (i) { return __spread([0x23], unsignedLEB128(i)); },
global_set: function (i) { return __spread([0x24], unsignedLEB128(i)); },
/*
* Memory Instructions
* https://webassembly.github.io/spec/core/binary/instructions.html#memory-instructions
*/
f64_load: function (align, offset) { return __spread([
0x2b
], unsignedLEB128(align), unsignedLEB128(offset)); },
f64_store: function (align, offset) { return __spread([
0x39
], unsignedLEB128(align), unsignedLEB128(offset)); },
/*
* Numeric Instructions
* https://webassembly.github.io/spec/core/binary/instructions.html#numeric-instructions
*/
i32_const: function (i) { return __spread([0x41], signedLEB128(i)); },
// i64_const: 0x42,
// f32_const: 0x43,
f64_const: function (i) { return __spread([0x44], encodef64(i)); },
i32_eqz: 0x45,
// i32_eq: 0x46,
i32_ne: 0x47,
i32_add: 0x6a,
i32_sub: 0x6b,
i32_eqz: 0x45,
i32_lt_s: 0x48,
// i32_lt_u: 0x49,
i32_gt_s: 0x4a,
// i32_gt_u: 0x4b,
i32_le_s: 0x4c,
i32_le_u: 0x4d,
i32_ge_s: 0x4e,
i32_ge_u: 0x5a,
i32_trunc_s_f64: 0xaa,
i32_trunc_u_f64: 0xab,
// i32_ge_u: 0x4f,
// [0x50...0x5a] i64
// [0x5b...0x60] f32
f64_eq: 0x61,
f64_ne: 0x62,
f64_lt: 0x63,
f64_gt: 0x64,
f64_le: 0x65,
f64_ge: 0x66,
// i32_clz: 0x67,
// i32_ctz: 0x68,
// i32_popcnt: 0x69,
i32_add: 0x6a,
i32_sub: 0x6b,
i32_mul: 0x6c,
// i32_div_s: 0x6d,
// i32_div_u: 0x6e,
// i32_rem_s: 0x6f,
// i32_rem_u: 0x70,
i32_and: 0x71,
i32_or: 0x72,
// [0x73...0x78] More i32
// [0x79...0x8a] More i64
i64_rem_s: 0x81,
i64_and: 0x83,
i64_or: 0x84,
i64_rem_s: 0x81,
f64_const: 0x44,
f64_ne: 0x62,
// [0x8b...0x98] More f32
f64_abs: 0x99,
f64_neg: 0x9a,
// f64_ceil: 0x9b,
f64_floor: 0x9c,
// f64_trunc: 0x9d,
// f64_nearest: 0x9e,
f64_sqrt: 0x9f,
f64_add: 0xa0,

@@ -101,23 +167,10 @@ f64_sub: 0xa1,

f64_div: 0xa3,
f64_abs: 0x99,
f64_sqrt: 0x9f,
f64_floor: 0x9c,
f64_min: 0xa4,
f64_max: 0xa5,
f64_gt: 0x64,
f64_eq: 0x61,
f64_lt: 0x63,
f64_le: 0x65,
f64_ge: 0x66,
// f64_copysign: 0xa6,
i32_trunc_f64_s: 0xaa,
// i32_trunc_f64_u: 0xab,
i64_trunc_s_f64: 0xb0,
f64_convert_s_i64: 0xb9,
f64_convert_i32_s: 0xb7,
"if": 0x04,
"else": 0x05,
end: 0x0b,
local_get: 0x20,
local_set: 0x21,
local_tee: 0x22,
global_get: 0x23,
global_set: 0x24
f64_convert_i64_s: 0xb9,
f64_convert_i32_s: 0xb7
};

@@ -145,2 +198,3 @@ // https://webassembly.github.io/spec/core/binary/instructions.html#binary-blocktype

// I think these might actually be specific to importdesc
exports.MEMORY_IDX = 0x02;
exports.GLOBAL_TYPE = 0x03;

@@ -151,11 +205,9 @@ exports.TYPE_IDX = 0x00;

exports.IS_ZEROISH = __spread([
exports.op.f64_abs,
exports.op.f64_const
], encodef64(exports.EPSILON), [
exports.op.f64_abs
], exports.op.f64_const(exports.EPSILON), [
exports.op.f64_lt,
]);
exports.IS_NOT_ZEROISH = __spread([
exports.op.f64_abs,
exports.op.f64_const
], encodef64(exports.EPSILON), [
exports.op.f64_abs
], exports.op.f64_const(exports.EPSILON), [
exports.op.f64_gt,

@@ -162,0 +214,0 @@ ]);

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

var shims = {
// TODO: Reimplement these functions natively in Wasm?
// TODO: Reimplement some of these functions natively in Wasm?
sin: Math.sin,

@@ -8,0 +8,0 @@ cos: Math.cos,

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

var encoding_1 = require("./encoding");
var constants_1 = require("./constants");
exports.localFuncMap = {

@@ -29,9 +30,3 @@ sqr: {

returns: [encoding_1.VAL_TYPE.f64],
binary: __spread([
encoding_1.op.local_get
], encoding_1.unsignedLEB128(0), [
encoding_1.op.local_get
], encoding_1.unsignedLEB128(0), [
encoding_1.op.f64_mul,
])
binary: __spread(encoding_1.op.local_get(0), encoding_1.op.local_get(0), [encoding_1.op.f64_mul])
},

@@ -41,10 +36,5 @@ bor: {

returns: [encoding_1.VAL_TYPE.f64],
binary: __spread([
encoding_1.op.local_get
], encoding_1.unsignedLEB128(0), encoding_1.IS_NOT_ZEROISH, [
encoding_1.op.local_get
], encoding_1.unsignedLEB128(1), encoding_1.IS_NOT_ZEROISH, [
encoding_1.op.i32_or,
encoding_1.op.i32_const
], encoding_1.unsignedLEB128(0), [
binary: __spread(encoding_1.op.local_get(0), encoding_1.IS_NOT_ZEROISH, encoding_1.op.local_get(1), encoding_1.IS_NOT_ZEROISH, [
encoding_1.op.i32_or
], encoding_1.op.i32_const(0), [
encoding_1.op.i32_ne,

@@ -57,10 +47,5 @@ encoding_1.op.f64_convert_i32_s,

returns: [encoding_1.VAL_TYPE.f64],
binary: __spread([
encoding_1.op.local_get
], encoding_1.unsignedLEB128(0), encoding_1.IS_NOT_ZEROISH, [
encoding_1.op.local_get
], encoding_1.unsignedLEB128(1), encoding_1.IS_NOT_ZEROISH, [
encoding_1.op.i32_and,
encoding_1.op.i32_const
], encoding_1.unsignedLEB128(0), [
binary: __spread(encoding_1.op.local_get(0), encoding_1.IS_NOT_ZEROISH, encoding_1.op.local_get(1), encoding_1.IS_NOT_ZEROISH, [
encoding_1.op.i32_and
], encoding_1.op.i32_const(0), [
encoding_1.op.i32_ne,

@@ -73,13 +58,6 @@ encoding_1.op.f64_convert_i32_s,

returns: [encoding_1.VAL_TYPE.f64],
binary: __spread([
encoding_1.op.f64_const
], encoding_1.encodef64(0), [
encoding_1.op.local_get
], encoding_1.unsignedLEB128(0), [
binary: __spread(encoding_1.op.f64_const(0), encoding_1.op.local_get(0), [
encoding_1.op.f64_lt
], encoding_1.op.local_get(0), encoding_1.op.f64_const(0), [
encoding_1.op.f64_lt,
encoding_1.op.local_get
], encoding_1.unsignedLEB128(0), [
encoding_1.op.f64_const
], encoding_1.encodef64(0), [
encoding_1.op.f64_lt,
encoding_1.op.i32_sub,

@@ -93,11 +71,8 @@ encoding_1.op.f64_convert_i32_s,

// TODO: Simplify all this type coersion
binary: __spread([
encoding_1.op.local_get
], encoding_1.unsignedLEB128(0), [
binary: __spread(encoding_1.op.local_get(0), [
encoding_1.op.i64_trunc_s_f64
], encoding_1.op.local_get(1), [
encoding_1.op.i64_trunc_s_f64,
encoding_1.op.local_get
], encoding_1.unsignedLEB128(1), [
encoding_1.op.i64_trunc_s_f64,
encoding_1.op.i64_rem_s,
encoding_1.op.f64_convert_s_i64,
encoding_1.op.f64_convert_i64_s,
])

@@ -108,11 +83,8 @@ },

returns: [encoding_1.VAL_TYPE.f64],
binary: __spread([
encoding_1.op.local_get
], encoding_1.unsignedLEB128(0), [
binary: __spread(encoding_1.op.local_get(0), [
encoding_1.op.i64_trunc_s_f64
], encoding_1.op.local_get(1), [
encoding_1.op.i64_trunc_s_f64,
encoding_1.op.local_get
], encoding_1.unsignedLEB128(1), [
encoding_1.op.i64_trunc_s_f64,
encoding_1.op.i64_or,
encoding_1.op.f64_convert_s_i64,
encoding_1.op.f64_convert_i64_s,
])

@@ -123,11 +95,8 @@ },

returns: [encoding_1.VAL_TYPE.f64],
binary: __spread([
encoding_1.op.local_get
], encoding_1.unsignedLEB128(0), [
binary: __spread(encoding_1.op.local_get(0), [
encoding_1.op.i64_trunc_s_f64
], encoding_1.op.local_get(1), [
encoding_1.op.i64_trunc_s_f64,
encoding_1.op.local_get
], encoding_1.unsignedLEB128(1), [
encoding_1.op.i64_trunc_s_f64,
encoding_1.op.i64_and,
encoding_1.op.f64_convert_s_i64,
encoding_1.op.f64_convert_i64_s,
])

@@ -153,36 +122,16 @@ },

],
binary: __spread([
encoding_1.op.f64_const
], encoding_1.encodef64(encoding_1.EPSILON), [
encoding_1.op.local_get
], encoding_1.unsignedLEB128(0), [
encoding_1.op.f64_add,
// STACK: [$i + EPSILON]
encoding_1.op.local_tee
], encoding_1.unsignedLEB128(1), [
encoding_1.op.i32_trunc_s_f64,
// TODO We could probably make this a tee and get rid of the next get if we swap the final condition
encoding_1.op.local_set
], encoding_1.unsignedLEB128(2), [
// STACK: []
encoding_1.op.i32_const
], encoding_1.signedLEB128(-1), [
encoding_1.op.local_get
], encoding_1.unsignedLEB128(2), [
// STACK: [-1, $truncated]
encoding_1.op.local_get
], encoding_1.unsignedLEB128(2), [
encoding_1.op.i32_const
], encoding_1.unsignedLEB128(0), [
// STACK: [-1, $truncated, $truncated, 0]
encoding_1.op.i32_lt_s,
// STACK: [-1, $truncated, <is index less than 0>]
encoding_1.op.local_get
], encoding_1.unsignedLEB128(2), [
encoding_1.op.i32_const
], encoding_1.unsignedLEB128(8388608), [
binary: __spread(encoding_1.op.f64_const(encoding_1.EPSILON), encoding_1.op.local_get(0), [
encoding_1.op.f64_add
], encoding_1.op.local_tee(1), [
encoding_1.op.i32_trunc_f64_s
], encoding_1.op.local_set(2), encoding_1.op.i32_const(-1), encoding_1.op.local_get(2), encoding_1.op.i32_const(8), [
encoding_1.op.i32_mul
], encoding_1.op.local_get(2), encoding_1.op.i32_const(0), [
// STACK: [-1, $truncated * 8, $truncated, 0]
encoding_1.op.i32_lt_s
], encoding_1.op.local_get(2), encoding_1.op.i32_const(constants_1.BUFFER_SIZE - 1), [
encoding_1.op.i32_gt_s,
// STACK: [-1, $truncated, <is index less than 0>, <is index more than MAX>]
// STACK: [-1, $truncated * 8, <is index less than 0>, <is index more than MAX>]
encoding_1.op.i32_or,
// STACK: [-1, $truncated, <is index out of range>]
// STACK: [-1, $truncated * 8, <is index out of range>]
encoding_1.op.select,

@@ -189,0 +138,0 @@ ])

@@ -131,6 +131,8 @@ "use strict";

["Megabuf access", "g = megabuf(1);", 0],
["Megabuf access (max)", "g = megabuf(1000000);", 0],
["Max index megabuf", "megabuf(8388607) = 10; g = megabuf(8388607);", 10],
["Max index + 1 megabuf", "megabuf(8388608) = 10; g = megabuf(8388608);", 0],
["Max index gmegabuf", "gmegabuf(8388607) = 10; g = gmegabuf(8388607);", 10],
["Max index+1 gmegabuf", "gmegabuf(8388608) = 10; g = gmegabuf(8388608);", 0],
["Megabuf assignment", "megabuf(1) = 10; g = megabuf(1);", 10],
["Megabuf assignment (idx 100)", "megabuf(100) = 10; g = megabuf(100);", 10],
["Megabuf (max)", "x = 1000000; megabuf(x) = 10; g = megabuf(x);", 10],
["Megabuf (float)", "megabuf(0) = 1.2; g = megabuf(0);", 1.2],

@@ -170,4 +172,27 @@ ["Gmegabuf", "gmegabuf(0) = 1.2; g = gmegabuf(0);", 1.2],

["Buff += mutates", "megabuf(100) += 10; g = megabuf(100)", 10],
["Buffers don't collide", "megabuf(100) = 10; g = gmegabuf(100)", 0],
[
"gmegabuf does not write megabuf",
"i = 100; loop(10000,gmegabuf(i) = 10; i += 1); g = megabuf(100)",
0,
],
[
"megabuf does not write gmegabuf",
"i = 100; loop(10000,megabuf(i) = 10; i += 1); g = gmegabuf(100)",
0,
],
[
"Adjacent buf indicies don't collide",
"megabuf(99) = 10; megabuf(100) = 1; g = megabuf(99)",
10,
],
["Exponentiation associativity", "g = 2 ^ 2 ^ 4", 256],
["^ has lower precedence than * (left)", "g = 2 ^ 2 * 4", 16],
["^ has lower precedence than * (right)", "g = 2 * 2 ^ 4", 32],
["% has lower precedence than * (right)", "g = 2 * 5 % 2", 2],
["% has lower precedence than * (left)", "g = 2 % 5 * 2", 4],
["% and ^ have the same precedence (% first)", "g = 2 % 5 ^ 2", 4],
["% and ^ have the same precedence (^ first)", "g = 2 ^ 5 % 2", 0],
];
exports["default"] = testCases;
//# sourceMappingURL=testCases.js.map
{
"name": "eel-wasm",
"version": "0.0.7",
"version": "0.0.8",
"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

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