-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.bundle.js
2 lines (2 loc) · 219 KB
/
main.bundle.js
1
2
/*! For license information please see main.bundle.js.LICENSE.txt */
(()=>{var __webpack_modules__={135:function(e,t,n){(function(){"use strict";function e(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var t="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e},r=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof n.g&&n.g];for(var t=0;t<e.length;++t){var r=e[t];if(r&&r.Math==Math)return r}throw Error("Cannot find global object")}(this);function i(e,n){if(n)e:{var i=r;e=e.split(".");for(var o=0;o<e.length-1;o++){var a=e[o];if(!(a in i))break e;i=i[a]}(n=n(o=i[e=e[e.length-1]]))!=o&&null!=n&&t(i,e,{configurable:!0,writable:!0,value:n})}}function o(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function a(t){var n="undefined"!=typeof Symbol&&Symbol.iterator&&t[Symbol.iterator];return n?n.call(t):{next:e(t)}}function s(){this.i=!1,this.g=null,this.o=void 0,this.j=1,this.m=0,this.h=null}function u(e){if(e.i)throw new TypeError("Generator is already running");e.i=!0}function c(e,t){e.h={F:t,G:!0},e.j=e.m}function f(e){this.g=new s,this.h=e}function l(e,t,n,r){try{var i=t.call(e.g.g,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.i=!1,i;var o=i.value}catch(t){return e.g.g=null,c(e.g,t),h(e)}return e.g.g=null,r.call(e.g,o),h(e)}function h(e){for(;e.g.j;)try{var t=e.h(e.g);if(t)return e.g.i=!1,{value:t.value,done:!1}}catch(t){e.g.o=void 0,c(e.g,t)}if(e.g.i=!1,e.g.h){if(t=e.g.h,e.g.h=null,t.G)throw t.F;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function p(e){this.next=function(t){return u(e.g),e.g.g?t=l(e,e.g.g.next,t,e.g.l):(e.g.l(t),t=h(e)),t},this.throw=function(t){return u(e.g),e.g.g?t=l(e,e.g.g.throw,t,e.g.l):(c(e.g,t),t=h(e)),t},this.return=function(t){return function(e,t){u(e.g);var n=e.g.g;return n?l(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),h(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function d(e){function t(t){return e.next(t)}function n(t){return e.throw(t)}return new Promise((function(r,i){!function e(o){o.done?r(o.value):Promise.resolve(o.value).then(t,n).then(e,i)}(e.next())}))}i("Symbol",(function(e){function n(e,n){this.g=e,t(this,"description",{configurable:!0,writable:!0,value:n})}if(e)return e;n.prototype.toString=function(){return this.g};var r="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(t){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new n(r+(t||"")+"_"+i++,t)}})),i("Symbol.iterator",(function(n){if(n)return n;n=Symbol("Symbol.iterator");for(var i="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),a=0;a<i.length;a++){var s=r[i[a]];"function"==typeof s&&"function"!=typeof s.prototype[n]&&t(s.prototype,n,{configurable:!0,writable:!0,value:function(){return o(e(this))}})}return n})),s.prototype.l=function(e){this.o=e},s.prototype.return=function(e){this.h={return:e},this.j=this.m},i("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function i(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var o=r.setTimeout;n.prototype.i=function(e){o(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.A),reject:e(this.l)}},t.prototype.A=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.C(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.v(e):this.m(e)}},t.prototype.v=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.D(t,e):this.m(e)},t.prototype.l=function(e){this.u(2,e)},t.prototype.m=function(e){this.u(1,e)},t.prototype.u=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.B(),this.H()},t.prototype.B=function(){var e=this;o((function(){if(e.I()){var t=r.console;void 0!==t&&t.error(e.i)}}),1)},t.prototype.I=function(){if(this.o)return!1;var e=r.CustomEvent,t=r.Event,n=r.dispatchEvent;return void 0===n||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=r.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.H=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)s.h(this.g[e]);this.g=null}};var s=new n;return t.prototype.C=function(e){var t=this.j();e.s(t.resolve,t.reject)},t.prototype.D=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(e){o(e)}}:t}var i,o,a=new t((function(e,t){i=e,o=t}));return this.s(r(e,i),r(n,o)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.s=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?s.h(n):this.g.push(n),this.o=!0},t.resolve=i,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var r=a(e),o=r.next();!o.done;o=r.next())i(o.value).s(t,n)}))},t.all=function(e){var n=a(e),r=n.next();return r.done?i([]):new t((function(e,t){function o(t){return function(n){a[t]=n,0==--s&&e(a)}}var a=[],s=0;do{a.push(void 0),s++,i(r.value).s(o(a.length-1),t),r=n.next()}while(!r.done)}))},t}));var m="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};i("Object.assign",(function(e){return e||m}));var g=this||self,v={facingMode:"user",width:640,height:480};function y(e,t){this.video=e,this.i=0,this.h=Object.assign(Object.assign({},v),t)}function b(e){window.requestAnimationFrame((function(){!function(e){var t=null;e.video.paused||e.video.currentTime===e.i||(e.i=e.video.currentTime,t=e.h.onFrame()),t?t.then((function(){b(e)})):b(e)}(e)}))}y.prototype.stop=function(){var e,t,n,r=this;return d(new p(new f((function(i){if(r.g){for(e=r.g.getTracks(),t=a(e),n=t.next();!n.done;n=t.next())n.value.stop();r.g=void 0}i.j=0}))))},y.prototype.start=function(){var e,t=this;return d(new p(new f((function(n){return navigator.mediaDevices&&navigator.mediaDevices.getUserMedia||alert("No navigator.mediaDevices.getUserMedia exists."),e=t.h,n.return(navigator.mediaDevices.getUserMedia({video:{facingMode:e.facingMode,width:e.width,height:e.height}}).then((function(e){!function(e,t){e.g=t,e.video.srcObject=t,e.video.onloadedmetadata=function(){e.video.play(),b(e)}}(t,e)})).catch((function(e){var t="Failed to acquire camera feed: "+e;throw console.error(t),alert(t),e})))}))))};var w,x=["Camera"],_=g;x[0]in _||void 0===_.execScript||_.execScript("var "+x[0]);for(;x.length&&(w=x.shift());)x.length||void 0===y?_=_[w]&&_[w]!==Object.prototype[w]?_[w]:_[w]={}:_[w]=y}).call(this)},423:function(e,t,n){(function(){"use strict";function e(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var t="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e},r=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof n.g&&n.g];for(var t=0;t<e.length;++t){var r=e[t];if(r&&r.Math==Math)return r}throw Error("Cannot find global object")}(this);function i(e,n){if(n)e:{var i=r;e=e.split(".");for(var o=0;o<e.length-1;o++){var a=e[o];if(!(a in i))break e;i=i[a]}(n=n(o=i[e=e[e.length-1]]))!=o&&null!=n&&t(i,e,{configurable:!0,writable:!0,value:n})}}function o(t){var n="undefined"!=typeof Symbol&&Symbol.iterator&&t[Symbol.iterator];return n?n.call(t):{next:e(t)}}var a="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};function s(e){return e||Array.prototype.fill}i("Object.assign",(function(e){return e||a})),i("Array.prototype.fill",(function(e){return e||function(e,t,n){var r=this.length||0;for(0>t&&(t=Math.max(0,r+t)),(null==n||n>r)&&(n=r),0>(n=Number(n))&&(n=Math.max(0,r+n)),t=Number(t||0);t<n;t++)this[t]=e;return this}})),i("Int8Array.prototype.fill",s),i("Uint8Array.prototype.fill",s),i("Uint8ClampedArray.prototype.fill",s),i("Int16Array.prototype.fill",s),i("Uint16Array.prototype.fill",s),i("Int32Array.prototype.fill",s),i("Uint32Array.prototype.fill",s),i("Float32Array.prototype.fill",s),i("Float64Array.prototype.fill",s);var u=this||self;function c(e,t){e=e.split(".");var n,r=u;e[0]in r||void 0===r.execScript||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}var f={color:"white",lineWidth:4,radius:6,visibilityMin:.5};function l(e){return e=e||{},Object.assign(Object.assign(Object.assign({},f),{fillColor:e.color}),e)}function h(e,t){return e instanceof Function?e(t):e}function p(e,t,n){return Math.max(Math.min(t,n),Math.min(Math.max(t,n),e))}c("clamp",p),c("drawLandmarks",(function(e,t,n){if(t){n=l(n),e.save();for(var r=e.canvas,i=0,a=(t=o(t)).next();!a.done;a=t.next())if(void 0!==(a=a.value)&&(void 0===a.visibility||a.visibility>n.visibilityMin)){e.fillStyle=h(n.fillColor,{index:i,from:a}),e.strokeStyle=h(n.color,{index:i,from:a}),e.lineWidth=h(n.lineWidth,{index:i,from:a});var s=new Path2D;s.arc(a.x*r.width,a.y*r.height,h(n.radius,{index:i,from:a}),0,2*Math.PI),e.fill(s),e.stroke(s),++i}e.restore()}})),c("drawConnectors",(function(e,t,n,r){if(t&&n){r=l(r),e.save();for(var i=e.canvas,a=0,s=(n=o(n)).next();!s.done;s=n.next()){var u=s.value;e.beginPath(),s=t[u[0]],u=t[u[1]],s&&u&&(void 0===s.visibility||s.visibility>r.visibilityMin)&&(void 0===u.visibility||u.visibility>r.visibilityMin)&&(e.strokeStyle=h(r.color,{index:a,from:s,to:u}),e.lineWidth=h(r.lineWidth,{index:a,from:s,to:u}),e.moveTo(s.x*i.width,s.y*i.height),e.lineTo(u.x*i.width,u.y*i.height)),++a,e.stroke()}e.restore()}})),c("drawRectangle",(function(e,t,n){n=l(n),e.save();var r=e.canvas;e.beginPath(),e.lineWidth=h(n.lineWidth,{}),e.strokeStyle=h(n.color,{}),e.fillStyle=h(n.fillColor,{}),e.translate(t.xCenter*r.width,t.yCenter*r.height),e.rotate(t.rotation*Math.PI/180),e.rect(-t.width/2*r.width,-t.height/2*r.height,t.width*r.width,t.height*r.height),e.translate(-t.xCenter*r.width,-t.yCenter*r.height),e.stroke(),e.fill(),e.restore()})),c("lerp",(function(e,t,n,r,i){return p(r*(1-(e-t)/(n-t))+i*(1-(n-e)/(n-t)),r,i)}))}).call(this)},523:function(e,t,n){(function(){"use strict";var e;function t(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e},i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof n.g&&n.g];for(var t=0;t<e.length;++t){var r=e[t];if(r&&r.Math==Math)return r}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var n=i;e=e.split(".");for(var o=0;o<e.length-1;o++){var a=e[o];if(!(a in n))break e;n=n[a]}(t=t(o=n[e=e[e.length-1]]))!=o&&null!=t&&r(n,e,{configurable:!0,writable:!0,value:t})}}function a(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function s(e){var n="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];return n?n.call(e):{next:t(e)}}function u(e){if(!(e instanceof Array)){e=s(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}o("Symbol",(function(e){function t(e,t){this.g=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),o("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var n="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;o<n.length;o++){var s=i[n[o]];"function"==typeof s&&"function"!=typeof s.prototype[e]&&r(s.prototype,e,{configurable:!0,writable:!0,value:function(){return a(t(this))}})}return e}));var c,f="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)c=Object.setPrototypeOf;else{var l;e:{var h={};try{h.__proto__={a:!0},l=h.a;break e}catch(e){}l=!1}c=l?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var p=c;function d(e,t){if(e.prototype=f(t.prototype),e.prototype.constructor=e,p)p(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.ra=t.prototype}function m(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.u=this.o=0,this.j=null}function g(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function v(e,t){e.j={fa:t,ga:!0},e.g=e.o||e.u}function y(e,t,n){return e.g=n,{value:t}}function b(e){this.g=new m,this.h=e}function w(e,t,n,r){try{var i=t.call(e.g.i,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var o=i.value}catch(t){return e.g.i=null,v(e.g,t),x(e)}return e.g.i=null,r.call(e.g,o),x(e)}function x(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,v(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.ga)throw t.fa;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function _(e){this.next=function(t){return g(e.g),e.g.i?t=w(e,e.g.i.next,t,e.g.s):(e.g.s(t),t=x(e)),t},this.throw=function(t){return g(e.g),e.g.i?t=w(e,e.g.i.throw,t,e.g.s):(v(e.g,t),t=x(e)),t},this.return=function(t){return function(e,t){g(e.g);var n=e.g.i;return n?w(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),x(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function A(e){return function(e){function t(t){return e.next(t)}function n(t){return e.throw(t)}return new Promise((function(r,i){!function e(o){o.done?r(o.value):Promise.resolve(o.value).then(t,n).then(e,i)}(e.next())}))}(new _(new b(e)))}m.prototype.s=function(e){this.h=e},m.prototype.return=function(e){this.j={return:e},this.g=this.u},o("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.s=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function r(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var o=i.setTimeout;n.prototype.i=function(e){o(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.D),reject:e(this.l)}},t.prototype.D=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.H(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.A(e):this.o(e)}},t.prototype.A=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.I(t,e):this.o(e)},t.prototype.l=function(e){this.u(2,e)},t.prototype.o=function(e){this.u(1,e)},t.prototype.u=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.G(),this.B()},t.prototype.G=function(){var e=this;o((function(){if(e.C()){var t=i.console;void 0!==t&&t.error(e.i)}}),1)},t.prototype.C=function(){if(this.s)return!1;var e=i.CustomEvent,t=i.Event,n=i.dispatchEvent;return void 0===n||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.B=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)a.h(this.g[e]);this.g=null}};var a=new n;return t.prototype.H=function(e){var t=this.j();e.M(t.resolve,t.reject)},t.prototype.I=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(e){o(e)}}:t}var i,o,a=new t((function(e,t){i=e,o=t}));return this.M(r(e,i),r(n,o)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.M=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?a.h(n):this.g.push(n),this.s=!0},t.resolve=r,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var i=s(e),o=i.next();!o.done;o=i.next())r(o.value).M(t,n)}))},t.all=function(e){var n=s(e),i=n.next();return i.done?r([]):new t((function(e,t){function o(t){return function(n){a[t]=n,0==--s&&e(a)}}var a=[],s=0;do{a.push(void 0),s++,r(i.value).M(o(a.length-1),t),i=n.next()}while(!i.done)}))},t}));var k="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};o("Object.assign",(function(e){return e||k})),o("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),o("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(0>(t=t||0)&&(t=Math.max(t+r,0));t<r;t++){var i=n[t];if(i===e||Object.is(i,e))return!0}return!1}})),o("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),o("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,i={next:function(){if(!r&&n<e.length){var i=n++;return{value:t(i,e[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(e){return e}))}}));var S=this||self;function E(e,t){e=e.split(".");var n,r=S;e[0]in r||void 0===r.execScript||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}function j(){throw Error("Invalid UTF8")}function T(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var C,O,M="undefined"!=typeof TextDecoder,F="undefined"!=typeof TextEncoder,D={},L=null;function P(e){var t;void 0===t&&(t=0),R(),t=D[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",i=0,o=0;i<e.length-2;i+=3){var a=e[i],s=e[i+1],u=e[i+2],c=t[a>>2];a=t[(3&a)<<4|s>>4],s=t[(15&s)<<2|u>>6],u=t[63&u],n[o++]=c+a+s+u}switch(c=0,u=r,e.length-i){case 2:u=t[(15&(c=e[i+1]))<<2]||r;case 1:e=e[i],n[o]=t[e>>2]+t[(3&e)<<4|c>>4]+u+r}return n.join("")}function B(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),i=L[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}R();for(var r=0;;){var i=n(-1),o=n(0),a=n(64),s=n(64);if(64===s&&-1===i)break;t(i<<2|o>>4),64!=a&&(t(o<<4&240|a>>2),64!=s&&t(a<<6&192|s))}}(e,(function(e){r[i++]=e})),i!==n?r.subarray(0,i):r}function R(){if(!L){L={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));D[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===L[o]&&(L[o]=i)}}}}var I,z="function"==typeof Uint8Array;function U(e){return z&&null!=e&&e instanceof Uint8Array}function q(e){if(this.L=e,null!==e&&0===e.length)throw Error("ByteString should be constructed with non-empty values")}var N="function"==typeof Uint8Array.prototype.slice,H=0;function $(e,t){return Error("Invalid wire type: "+e+" (at position "+t+")")}function W(){return Error("Failed to read varint, encoding is invalid.")}function G(e,t){t=void 0!==(t=void 0===t?{}:t).v&&t.v,this.h=null,this.g=this.i=this.j=0,this.v=t,e&&X(this,e)}function X(e,t){e.h=function(e,t){if(e.constructor===Uint8Array)return e;if(e.constructor===ArrayBuffer)return new Uint8Array(e);if(e.constructor===Array)return new Uint8Array(e);if(e.constructor===String)return B(e);if(e.constructor===q)return!t&&(t=e.L)&&t.constructor===Uint8Array?t:(t=null==(t=e.L)||U(t)?t:"string"==typeof t?B(t):null,(e=e.L=t)?new Uint8Array(e):I||(I=new Uint8Array(0)));if(e instanceof Uint8Array)return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, or Array of numbers")}(t,e.v),e.j=0,e.i=e.h.length,e.g=e.j}function Y(e){if(e.g>e.i)throw Error("Tried to read past the end of the data "+e.g+" > "+e.i)}function V(e){var t=e.h,n=t[e.g],r=127&n;if(128>n)return e.g+=1,Y(e),r;if(r|=(127&(n=t[e.g+1]))<<7,128>n)return e.g+=2,Y(e),r;if(r|=(127&(n=t[e.g+2]))<<14,128>n)return e.g+=3,Y(e),r;if(r|=(127&(n=t[e.g+3]))<<21,128>n)return e.g+=4,Y(e),r;if(n=t[e.g+4],e.g+=5,r|=(15&n)<<28,128>n)return Y(e),r;if(128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++])throw W();return Y(e),r}G.prototype.reset=function(){this.g=this.j};var K=[];function Q(){this.g=[]}function Z(e,t){for(;127<t;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function J(e){var t={},n=void 0!==t.W&&t.W;this.l={v:void 0!==t.v&&t.v},this.W=n,t=this.l,K.length?(n=K.pop(),t&&(n.v=t.v),e&&X(n,e),e=n):e=new G(e,t),this.g=e,this.j=this.g.g,this.h=this.i=-1}function ee(e){var t=e.g;if(t.g==t.i)return!1;e.j=e.g.g;var n=V(e.g)>>>0;if(t=n>>>3,!(0<=(n&=7)&&5>=n))throw $(n,e.j);if(1>t)throw Error("Invalid field number: "+t+" (at position "+e.j+")");return e.i=t,e.h=n,!0}function te(e){switch(e.h){case 0:if(0!=e.h)te(e);else e:{for(var t=(e=e.g).g,n=t+10;t<n;)if(0==(128&e.h[t++])){e.g=t,Y(e);break e}throw W()}break;case 1:(e=e.g).g+=8,Y(e);break;case 2:2!=e.h?te(e):(t=V(e.g)>>>0,(e=e.g).g+=t,Y(e));break;case 5:(e=e.g).g+=4,Y(e);break;case 3:for(t=e.i;;){if(!ee(e))throw Error("Unmatched start-group tag: stream EOF");if(4==e.h){if(e.i!=t)throw Error("Unmatched end-group tag");break}te(e)}break;default:throw $(e.h,e.j)}}Q.prototype.length=function(){return this.g.length},Q.prototype.end=function(){var e=this.g;return this.g=[],e},J.prototype.reset=function(){this.g.reset(),this.j=this.g.g,this.h=this.i=-1};var ne=[];function re(){this.i=[],this.h=0,this.g=new Q}function ie(e,t){0!==t.length&&(e.i.push(t),e.h+=t.length)}var oe="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol(void 0):void 0;function ae(e,t){Object.isFrozen(e)||(oe?e[oe]|=t:void 0!==e.N?e.N|=t:Object.defineProperties(e,{N:{value:t,configurable:!0,writable:!0,enumerable:!1}}))}function se(e){var t;return null==(t=oe?e[oe]:e.N)?0:t}function ue(e){return ae(e,1),e}function ce(e){return!!Array.isArray(e)&&!!(2&se(e))}function fe(e){if(!Array.isArray(e))throw Error("cannot mark non-array as immutable");ae(e,2)}function le(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&e.constructor===Object}var he=Object.freeze(ue([]));function pe(e){if(ce(e.m))throw Error("Cannot mutate an immutable Message")}var de,me="undefined"!=typeof Symbol&&void 0!==Symbol.hasInstance;function ge(e){return{value:e,configurable:!1,writable:!1,enumerable:!1}}function ve(e,t,n){return-1===t?null:t>=e.i?e.g?e.g[t]:void 0:void 0!==n&&n&&e.g&&null!=(n=e.g[t])?n:e.m[t+e.h]}function ye(e,t,n,r){r=void 0!==r&&r,pe(e),t<e.i&&!r?e.m[t+e.h]=n:(e.g||(e.g=e.m[e.i+e.h]={}))[t]=n}function be(e,t,n,r){n=void 0===n||n;var i=ve(e,t,r=void 0!==r&&r);return null==i&&(i=he),ce(e.m)?n&&(fe(i),Object.freeze(i)):(i===he||ce(i))&&ye(e,t,i=ue(i.slice()),r),i}function we(e,t,n){return null==(e=null==(e=ve(e,t))?e:+e)?void 0===n?0:n:e}function xe(e,t,n,r){e.j||(e.j={});var i=ce(e.m),o=e.j[n];if(!o){r=be(e,n,!0,void 0!==r&&r),o=[],i=i||ce(r);for(var a=0;a<r.length;a++)o[a]=new t(r[a]),i&&fe(o[a].m);i&&(fe(o),Object.freeze(o)),e.j[n]=o}return o}function _e(e,t,n,r,i){var o=void 0!==o&&o;return pe(e),o=xe(e,n,t,o),n=r||new n,e=be(e,t),null!=i?(o.splice(i,0,n),e.splice(i,0,n.m)):(o.push(n),e.push(n.m)),n}function Ae(e,t){return null==(e=ve(e,t))?0:e}function ke(e,t){return null==(e=ve(e,t))?"":e}function Se(e){return je(e,void 0===Te?Ce:Te)}function Ee(e,t){if(null!=e){if(Array.isArray(e))e=je(e,t);else if(le(e)){var n,r={};for(n in e)r[n]=Ee(e[n],t);e=r}else e=t(e);return e}}function je(e,t){for(var n=e.slice(),r=0;r<n.length;r++)n[r]=Ee(n[r],t);return Array.isArray(e)&&1&se(e)&&ue(n),n}function Te(e){return e&&"object"==typeof e&&e.toJSON?e.toJSON():(e=function(e){switch(typeof e){case"number":return isFinite(e)?e:String(e);case"object":if(e&&!Array.isArray(e)){if(U(e))return P(e);if(e instanceof q){var t=e.L;return t=null==t||"string"==typeof t?t:z&&t instanceof Uint8Array?P(t):null,(e.L=t)||""}}}return e}(e),Array.isArray(e)?Se(e):e)}function Ce(e){return U(e)?new Uint8Array(e):e}function Oe(e,t,n){e||(e=de),de=null;var r=this.constructor.h;if(e||(e=r?[r]:[]),this.h=(r?0:-1)-(this.constructor.g||0),this.j=void 0,this.m=e,e=(r=this.m.length)-1,r&&le(r=this.m[e])?(this.i=e-this.h,this.g=r):void 0!==t&&-1<t?(this.i=Math.max(t,e+1-this.h),this.g=void 0):this.i=Number.MAX_VALUE,n)for(t=0;t<n.length;t++)if((e=n[t])<this.i)e+=this.h,(r=this.m[e])?Array.isArray(r)&&ue(r):this.m[e]=he;else{var i=(r=this.g||(this.g=this.m[this.i+this.h]={}))[e];i?Array.isArray(i)&&ue(i):r[e]=he}}function Me(){Oe.apply(this,arguments)}if(Oe.prototype.toJSON=function(){return Se(this.m)},Oe.prototype.toString=function(){return this.m.toString()},d(Me,Oe),me){var Fe={};Object.defineProperties(Me,(Fe[Symbol.hasInstance]=ge((function(){throw Error("Cannot perform instanceof checks for MutableMessage")})),Fe))}function De(e,t,n){if(n){var r,i={};for(r in n){var o=n[r],a=o.ja;a||(i.F=o.pa||o.ha.P,o.ba?(i.U=Ue(o.ba),a=function(e){return function(t,n,r){return e.F(t,n,r,e.U)}}(i)):o.da?(i.T=qe(o.X.g,o.da),a=function(e){return function(t,n,r){return e.F(t,n,r,e.T)}}(i)):a=i.F,o.ja=a),a(t,e,o.X),i={F:i.F,U:i.U,T:i.T}}}!function(e,t){if(t=t.ca){ie(e,e.g.end());for(var n=0;n<t.length;n++)ie(e,t[n])}}(t,e)}var Le=Symbol();function Pe(e,t,n){return e[Le]||(e[Le]=function(e,r){return t(e,r,n)})}function Be(e){var t=e[Le];if(!t){var n=Je(e);t=function(e,t){return et(e,t,n)},e[Le]=t}return t}function Re(e){var t=function(e){var t=e.ba;return t?Be(t):(t=e.oa)?Pe(e.X.g,t,e.da):void 0}(e),n=e.X,r=e.ha.O;return t?function(e,i){return r(e,i,n,t)}:function(e,t){return r(e,t,n)}}function Ie(e,t,n,r,i,o){var a=0;for((e=e()).length&&"number"!=typeof e[0]&&(n(t,e[0]),a++);a<e.length;){n=e[a++];for(var s=a+1;s<e.length&&"number"!=typeof e[s];)s++;var u=e[a++];switch(s-=a){case 0:r(t,n,u);break;case 1:r(t,n,u,e[a++]);break;case 2:i(t,n,u,e[a++],e[a++]);break;case 3:s=e[a++];var c=e[a++],f=e[a++];Array.isArray(f)?i(t,n,u,s,c,f):o(t,n,u,s,c,f);break;case 4:o(t,n,u,e[a++],e[a++],e[a++],e[a++]);break;default:throw Error("unexpected number of binary field arguments: "+s)}}return t}var ze=Symbol();function Ue(e){var t=e[ze];if(!t){var n=Xe(e);t=function(e,t){return nt(e,t,n)},e[ze]=t}return t}function qe(e,t){var n=e[ze];return n||(n=function(e,n){return De(e,n,t)},e[ze]=n),n}var Ne=Symbol();function He(e,t){e.push(t)}function $e(e,t,n){e.push(t,n.P)}function We(e,t,n,r,i){var o=Ue(i),a=n.P;e.push(t,(function(e,t,n){return a(e,t,n,r,o)}))}function Ge(e,t,n,r,i,o){var a=qe(r,o),s=n.P;e.push(t,(function(e,t,n){return s(e,t,n,r,a)}))}function Xe(e){return e[Ne]||Ie(e,e[Ne]=[],He,$e,We,Ge)}var Ye=Symbol();function Ve(e,t){e[0]=t}function Ke(e,t,n,r){var i=n.O;e[t]=r?function(e,t,n){return i(e,t,n,r)}:i}function Qe(e,t,n,r,i,o){var a=n.O,s=Be(i);e[t]=function(e,t,n){return a(e,t,n,r,s,o)}}function Ze(e,t,n,r,i,o,a){var s=n.O,u=Pe(r,i,o);e[t]=function(e,t,n){return s(e,t,n,r,u,a)}}function Je(e){return e[Ye]||Ie(e,e[Ye]={},Ve,Ke,Qe,Ze)}function et(e,t,n){for(;ee(t)&&4!=t.h;){var r=t.i,i=n[r];if(!i){var o=n[0];o&&(o=o[r])&&(i=n[r]=Re(o))}if(!(i&&i(t,e,r)||(i=t,r=e,o=i.j,te(i),i.W))){var a=i.g.h;i=o===(i=i.g.g)?I||(I=new Uint8Array(0)):N?a.slice(o,i):new Uint8Array(a.subarray(o,i)),(o=r.ca)?o.push(i):r.ca=[i]}}return e}function tt(e,t,n){if(ne.length){var r=ne.pop();e&&(X(r.g,e),r.i=-1,r.h=-1),e=r}else e=new J(e);try{return et(new t,e,Je(n))}finally{(t=e.g).h=null,t.j=0,t.i=0,t.g=0,t.v=!1,e.i=-1,e.h=-1,100>ne.length&&ne.push(e)}}function nt(e,t,n){for(var r=n.length,i=1==r%2,o=i?1:0;o<r;o+=2)(0,n[o+1])(t,e,n[o]);De(e,t,i?n[0]:void 0)}function rt(e,t){var n=new re;nt(e,n,Xe(t)),ie(n,n.g.end()),e=new Uint8Array(n.h);for(var r=(t=n.i).length,i=0,o=0;o<r;o++){var a=t[o];e.set(a,i),i+=a.length}return n.i=[e],e}function it(e,t){return{O:e,P:t}}var ot=it((function(e,t,n){if(5!==e.h)return!1;var r=(e=e.g).h[e.g],i=e.h[e.g+1],o=e.h[e.g+2],a=e.h[e.g+3];return e.g+=4,Y(e),e=2*((i=(r<<0|i<<8|o<<16|a<<24)>>>0)>>31)+1,r=i>>>23&255,i&=8388607,ye(t,n,255==r?i?NaN:1/0*e:0==r?e*Math.pow(2,-149)*i:e*Math.pow(2,r-150)*(i+Math.pow(2,23))),!0}),(function(e,t,n){if(null!=(t=ve(t,n))){Z(e.g,8*n+5),e=e.g;var r=t;0===(r=(n=0>r?1:0)?-r:r)?H=0<1/r?0:2147483648:isNaN(r)?H=2147483647:34028234663852886e22<r?H=(n<<31|2139095040)>>>0:11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),H=(n<<31|r)>>>0):(t=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-t),16777216<=(r=Math.round(8388608*r))&&++t,H=(n<<31|t+127<<23|8388607&r)>>>0),n=H,e.g.push(n>>>0&255),e.g.push(n>>>8&255),e.g.push(n>>>16&255),e.g.push(n>>>24&255)}})),at=it((function(e,t,n){if(0!==e.h)return!1;for(var r=e.g,i=128,o=0,a=e=0;4>a&&128<=i;a++)i=r.h[r.g++],Y(r),o|=(127&i)<<7*a;if(128<=i&&(i=r.h[r.g++],Y(r),o|=(127&i)<<28,e|=(127&i)>>4),128<=i)for(a=0;5>a&&128<=i;a++)i=r.h[r.g++],Y(r),e|=(127&i)<<7*a+3;if(!(128>i))throw W();return r=o>>>0,(e=2147483648&(i=e>>>0))&&(i=~i>>>0,0==(r=1+~r>>>0)&&(i=i+1>>>0)),r=4294967296*i+(r>>>0),ye(t,n,e?-r:r),!0}),(function(e,t,n){if(null!=(t=ve(t,n))&&null!=t){Z(e.g,8*n),e=e.g;var r=t;for(n=0>r,t=(r=Math.abs(r))>>>0,r=Math.floor((r-t)/4294967296),r>>>=0,n&&(r=~r>>>0,4294967295<(t=1+(~t>>>0))&&(t=0,4294967295<++r&&(r=0))),n=H=t,t=r;0<t||127<n;)e.g.push(127&n|128),n=(n>>>7|t<<25)>>>0,t>>>=7;e.g.push(n)}})),st=it((function(e,t,n){return 0===e.h&&(ye(t,n,V(e.g)),!0)}),(function(e,t,n){if(null!=(t=ve(t,n))&&null!=t)if(Z(e.g,8*n),e=e.g,0<=(n=t))Z(e,n);else{for(t=0;9>t;t++)e.g.push(127&n|128),n>>=7;e.g.push(1)}})),ut=it((function(e,t,n){if(2!==e.h)return!1;var r,i=V(e.g)>>>0,o=(e=e.g).g;if(e.g+=i,Y(e),e=e.h,M)(r=C)||(r=C=new TextDecoder("utf-8",{fatal:!0})),r=r.decode(e.subarray(o,o+i));else{i=o+i;for(var a,s,u,c=[],f=null;o<i;)128>(a=e[o++])?c.push(a):224>a?o>=i?j():(s=e[o++],194>a||128!=(192&s)?(o--,j()):c.push((31&a)<<6|63&s)):240>a?o>=i-1?j():128!=(192&(s=e[o++]))||224===a&&160>s||237===a&&160<=s||128!=(192&(r=e[o++]))?(o--,j()):c.push((15&a)<<12|(63&s)<<6|63&r):244>=a?o>=i-2?j():128!=(192&(s=e[o++]))||0!=s-144+(a<<28)>>30||128!=(192&(r=e[o++]))||128!=(192&(u=e[o++]))?(o--,j()):(a=(7&a)<<18|(63&s)<<12|(63&r)<<6|63&u,a-=65536,c.push(55296+(a>>10&1023),56320+(1023&a))):j(),8192<=c.length&&(f=T(f,c),c.length=0);r=T(f,c)}return ye(t,n,r),!0}),(function(e,t,n){if(null!=(t=ve(t,n))){var r=!1;if(r=void 0!==r&&r,F){if(r&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(t))throw Error("Found an unpaired surrogate");t=(O||(O=new TextEncoder)).encode(t)}else{for(var i=0,o=new Uint8Array(3*t.length),a=0;a<t.length;a++){var s=t.charCodeAt(a);if(128>s)o[i++]=s;else{if(2048>s)o[i++]=s>>6|192;else{if(55296<=s&&57343>=s){if(56319>=s&&a<t.length){var u=t.charCodeAt(++a);if(56320<=u&&57343>=u){s=1024*(s-55296)+u-56320+65536,o[i++]=s>>18|240,o[i++]=s>>12&63|128,o[i++]=s>>6&63|128,o[i++]=63&s|128;continue}a--}if(r)throw Error("Found an unpaired surrogate");s=65533}o[i++]=s>>12|224,o[i++]=s>>6&63|128}o[i++]=63&s|128}}t=o.subarray(0,i)}Z(e.g,8*n+2),Z(e.g,t.length),ie(e,e.g.end()),ie(e,t)}})),ct=it((function(e,t,n,r,i){if(2!==e.h)return!1;t=_e(t,n,r),n=e.g.i,r=V(e.g)>>>0;var o=e.g.g+r,a=o-n;if(0>=a&&(e.g.i=o,i(t,e),a=o-e.g.g),a)throw Error("Message parsing ended unexpectedly. Expected to read "+r+" bytes, instead read "+(r-a)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=o,e.g.i=n,!0}),(function(e,t,n,r,i){if(null!=(t=xe(t,r,n)))for(r=0;r<t.length;r++){var o=e;Z(o.g,8*n+2);var a=o.g.end();ie(o,a),a.push(o.h),o=a,i(t[r],e),a=e;var s=o.pop();for(s=a.h+a.g.length()-s;127<s;)o.push(127&s|128),s>>>=7,a.h++;o.push(s),a.h++}}));function ft(){Me.apply(this,arguments)}if(d(ft,Me),me){var lt={};Object.defineProperties(ft,(lt[Symbol.hasInstance]=ge(Object[Symbol.hasInstance]),lt))}function ht(e){ft.call(this,e)}function pt(){return[1,st,2,ot,3,ut,4,ut]}function dt(e){ft.call(this,e,-1,gt)}function mt(){return[1,ct,ht,pt]}d(ht,ft),d(dt,ft),dt.prototype.addClassification=function(e,t){return _e(this,1,ht,e,t),this};var gt=[1];function vt(e){ft.call(this,e)}function yt(){return[1,ot,2,ot,3,ot,4,ot,5,ot]}function bt(e){ft.call(this,e,-1,xt)}function wt(){return[1,ct,vt,yt]}d(vt,ft),d(bt,ft);var xt=[1];function _t(e){ft.call(this,e)}function At(){return[1,ot,2,ot,3,ot,4,ot,5,ot,6,at]}function kt(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function St(e){return xe(e,ht,1).map((function(e){return{index:Ae(e,1),score:we(e,2),label:null!=ve(e,3)?ke(e,3):void 0,displayName:null!=ve(e,4)?ke(e,4):void 0}}))}function Et(e){return{x:we(e,1),y:we(e,2),z:we(e,3),visibility:null!=ve(e,4)?we(e,4):void 0}}function jt(e){return e.map((function(e){return xe(tt(e,bt,wt),vt,1).map(Et)}))}function Tt(e,t){this.h=e,this.g=t,this.l=0}function Ct(e,t,n){return function(e,t){var n=e.g;if(void 0===e.o){var r=kt(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),i=kt(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=n.createProgram();if(n.attachShader(o,r),n.attachShader(o,i),n.linkProgram(o),!n.getProgramParameter(o,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(o));r=e.o=o,n.useProgram(r),i=n.getUniformLocation(r,"sampler0"),e.j={K:n.getAttribLocation(r,"aVertex"),J:n.getAttribLocation(r,"aTex"),qa:i},e.u=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.enableVertexAttribArray(e.j.K),n.vertexAttribPointer(e.j.K,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.J),n.vertexAttribPointer(e.j.J,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(i,0)}r=e.j,n.useProgram(e.o),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(r.K),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.vertexAttribPointer(r.K,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.J),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(r.J,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.K),n.disableVertexAttribArray(r.J),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(e,t),"function"==typeof e.g.canvas.transferToImageBitmap?Promise.resolve(e.g.canvas.transferToImageBitmap()):n?Promise.resolve(e.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(e.g.canvas):(void 0===e.i&&(e.i=document.createElement("canvas")),new Promise((function(t){e.i.height=e.g.canvas.height,e.i.width=e.g.canvas.width,e.i.getContext("2d",{}).drawImage(e.g.canvas,0,0,e.g.canvas.width,e.g.canvas.height),t(e.i)})))}function Ot(e){this.g=e}d(_t,ft);var Mt=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function Ft(e,t){return t+e}function Dt(e,t){window[e]=t}function Lt(e){if(this.g=e,this.listeners={},this.j={},this.H={},this.o={},this.u={},this.I=this.s=this.$=!0,this.D=Promise.resolve(),this.Z="",this.C={},this.locateFile=e&&e.locateFile||Ft,"object"==typeof window)var t=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if("undefined"==typeof location)throw Error("solutions can only be loaded on a web page or in a web worker");t=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.aa=t,e.options)for(var n=(t=s(Object.keys(e.options))).next();!n.done;n=t.next()){n=n.value;var r=e.options[n].default;void 0!==r&&(this.j[n]="function"==typeof r?r():r)}}function Pt(e,t){var n,r;return A((function(i){return t in e.H?i.return(e.H[t]):(n=e.locateFile(t,""),r=fetch(n).then((function(e){return e.arrayBuffer()})),e.H[t]=r,i.return(r))}))}function Bt(e,t){for(var n=t.name||"$",r=[].concat(u(t.wants)),i=new e.h.StringList,o=s(t.wants),a=o.next();!a.done;a=o.next())i.push_back(a.value);o=e.h.PacketListener.implement({onResults:function(i){for(var o={},a=0;a<t.wants.length;++a)o[r[a]]=i.get(a);var u=e.listeners[n];u&&(e.D=function(e,t,n){var r,i,o,a,u,c,f,l,h,p,d,m,g,v;return A((function(b){switch(b.g){case 1:if(!n)return b.return(t);for(r={},i=0,o=s(Object.keys(n)),a=o.next();!a.done;a=o.next())u=a.value,"string"!=typeof(c=n[u])&&"texture"===c.type&&void 0!==t[c.stream]&&++i;1<i&&(e.I=!1),f=s(Object.keys(n)),a=f.next();case 2:if(a.done){b.g=4;break}if(l=a.value,"string"==typeof(h=n[l]))return g=r,v=l,y(b,function(e,t,n){var r;return A((function(i){return"number"==typeof n||n instanceof Uint8Array||n instanceof e.h.Uint8BlobList?i.return(n):n instanceof e.h.Texture2dDataOut?((r=e.u[t])||(r=new Tt(e.h,e.G),e.u[t]=r),i.return(Ct(r,n,e.I))):i.return(void 0)}))}(e,l,t[h]),14);if(p=t[h.stream],"detection_list"===h.type){if(p){for(var w=p.getRectList(),x=p.getLandmarksList(),_=p.getClassificationsList(),k=[],S=0;S<w.size();++S){var E=tt(w.get(S),_t,At);E={ea:{ka:we(E,1),la:we(E,2),height:we(E,3),width:we(E,4),rotation:we(E,5,0),ia:Ae(E,6)},Y:xe(tt(x.get(S),bt,wt),vt,1).map(Et),V:St(tt(_.get(S),dt,mt))},k.push(E)}w=k}else w=[];r[l]=w,b.g=7;break}if("proto_list"===h.type){if(p){for(w=Array(p.size()),x=0;x<p.size();x++)w[x]=p.get(x);p.delete()}else w=[];r[l]=w,b.g=7;break}if(void 0===p){b.g=3;break}if("float_list"===h.type){r[l]=p,b.g=7;break}if("proto"===h.type){r[l]=p,b.g=7;break}if("texture"!==h.type)throw Error("Unknown output config type: '"+h.type+"'");return(d=e.u[l])||(d=new Tt(e.h,e.G),e.u[l]=d),y(b,Ct(d,p,e.I),13);case 13:m=b.h,r[l]=m;case 7:h.transform&&r[l]&&(r[l]=h.transform(r[l])),b.g=3;break;case 14:g[v]=b.h;case 3:a=f.next(),b.g=2;break;case 4:return b.return(r)}}))}(e,o,t.outs).then((function(n){n=u(n);for(var i=0;i<t.wants.length;++i){var a=o[r[i]];"object"==typeof a&&a.hasOwnProperty&&a.hasOwnProperty("delete")&&a.delete()}n&&(e.D=n)})))}}),e.i.attachMultiListener(i,o),i.delete()}function Rt(e){return void 0===e&&(e=0),1===e?"hand_landmark_full.tflite":"hand_landmark_lite.tflite"}function It(e){var t=this;e=e||{},this.g=new Lt({locateFile:e.locateFile,files:function(e){return[{url:"hands_solution_packed_assets_loader.js"},{simd:!1,url:"hands_solution_wasm_bin.js"},{simd:!0,url:"hands_solution_simd_wasm_bin.js"},{data:!0,url:Rt(e.modelComplexity)}]},graph:{url:"hands.binarypb"},inputs:{image:{type:"video",stream:"input_frames_gpu"}},listeners:[{wants:["multi_hand_landmarks","multi_hand_world_landmarks","image_transformed","multi_handedness"],outs:{image:"image_transformed",multiHandLandmarks:{type:"proto_list",stream:"multi_hand_landmarks",transform:jt},multiHandWorldLandmarks:{type:"proto_list",stream:"multi_hand_world_landmarks",transform:jt},multiHandedness:{type:"proto_list",stream:"multi_handedness",transform:function(e){return e.map((function(e){return St(tt(e,dt,mt))[0]}))}}}}],options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"object"==typeof window&&void 0!==window.navigator&&("iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document)},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},maxNumHands:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculator",fieldName:"int_value"}},modelComplexity:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorModelComplexity",fieldName:"int_value"},onChange:function(e){var n,r,i;return A((function(o){return 1==o.g?(n=Rt(e),r="third_party/mediapipe/modules/hand_landmark/"+n,y(o,Pt(t.g,n),2)):(i=o.h,t.g.overrideFile(r,i),o.return(!0))}))}},minDetectionConfidence:{type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"handlandmarktrackinggpu__palmdetectiongpu__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"handlandmarktrackinggpu__handlandmarkgpu__ThresholdingCalculator",fieldName:"threshold"}}}})}(e=Lt.prototype).close=function(){return this.i&&this.i.delete(),Promise.resolve()},e.reset=function(){var e=this;return A((function(t){e.i&&(e.i.reset(),e.o={},e.u={}),t.g=0}))},e.setOptions=function(e,t){var n=this;if(t=t||this.g.options){for(var r=[],i=[],o={},a=s(Object.keys(e)),u=a.next();!u.done;o={R:o.R,S:o.S},u=a.next()){var c=u.value;c in this.j&&this.j[c]===e[c]||(this.j[c]=e[c],void 0!==(u=t[c])&&(u.onChange&&(o.R=u.onChange,o.S=e[c],r.push(function(e){return function(){return A((function(t){if(1==t.g)return y(t,e.R(e.S),2);!0===t.h&&(n.s=!0),t.g=0}))}}(o))),u.graphOptionXref&&(c={valueNumber:1===u.type?e[c]:0,valueBoolean:0===u.type&&e[c],valueString:2===u.type?e[c]:""},u=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),u.graphOptionXref),c),i.push(u))))}0===r.length&&0===i.length||(this.s=!0,this.B=(void 0===this.B?[]:this.B).concat(i),this.A=(void 0===this.A?[]:this.A).concat(r))}},e.initialize=function(){var e=this;return A((function(t){return 1==t.g?y(t,function(e){var t,n,r,i,o,a,s,c,f,l,h;return A((function(p){switch(p.g){case 1:return e.$?(t=void 0===e.g.files?[]:"function"==typeof e.g.files?e.g.files(e.j):e.g.files,y(p,A((function(e){switch(e.g){case 1:return e.o=2,y(e,WebAssembly.instantiate(Mt),4);case 4:e.g=3,e.o=0;break;case 2:return e.o=0,e.j=null,e.return(!1);case 3:return e.return(!0)}})),2)):p.return();case 2:if(n=p.h,"object"==typeof window)return Dt("createMediapipeSolutionsWasm",{locateFile:e.locateFile}),Dt("createMediapipeSolutionsPackedAssets",{locateFile:e.locateFile}),a=t.filter((function(e){return void 0!==e.data})),s=t.filter((function(e){return void 0===e.data})),c=Promise.all(a.map((function(t){var n=Pt(e,t.url);if(void 0!==t.path){var r=t.path;n=n.then((function(t){return e.overrideFile(r,t),Promise.resolve(t)}))}return n}))),f=Promise.all(s.map((function(t){return void 0===t.simd||t.simd&&n||!t.simd&&!n?function(e){var t=document.createElement("script");return t.setAttribute("src",e),t.setAttribute("crossorigin","anonymous"),new Promise((function(e){t.addEventListener("load",(function(){e()}),!1),t.addEventListener("error",(function(){e()}),!1),document.body.appendChild(t)}))}(e.locateFile(t.url,e.aa)):Promise.resolve()}))).then((function(){var t,n,r;return A((function(i){if(1==i.g)return t=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,r=e,y(i,t(n),2);r.h=i.h,i.g=0}))})),l=A((function(t){return e.g.graph&&e.g.graph.url?t=y(t,Pt(e,e.g.graph.url),0):(t.g=0,t=void 0),t})),y(p,Promise.all([f,c,l]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return r=t.filter((function(e){return void 0===e.simd||e.simd&&n||!e.simd&&!n})).map((function(t){return e.locateFile(t.url,e.aa)})),importScripts.apply(null,u(r)),i=e,y(p,createMediapipeSolutionsWasm(Module),6);case 6:i.h=p.h,e.l=new OffscreenCanvas(1,1),e.h.canvas=e.l,o=e.h.GL.createContext(e.l,{antialias:!1,alpha:!1,na:"undefined"!=typeof WebGL2RenderingContext?2:1}),e.h.GL.makeContextCurrent(o),p.g=4;break;case 7:if(e.l=document.createElement("canvas"),!(h=e.l.getContext("webgl2",{}))&&!(h=e.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),p.return();e.G=h,e.h.canvas=e.l,e.h.createContext(e.l,!0,!0,{});case 4:e.i=new e.h.SolutionWasm,e.$=!1,p.g=0}}))}(e),2):3!=t.g?y(t,function(e){var t,n,r,i,o,a,u,c;return A((function(f){if(1==f.g)return e.g.graph&&e.g.graph.url&&e.Z===e.g.graph.url?f.return():(e.s=!0,e.g.graph&&e.g.graph.url?(e.Z=e.g.graph.url,y(f,Pt(e,e.g.graph.url),3)):void(f.g=2));for(2!=f.g&&(t=f.h,e.i.loadGraph(t)),n=s(Object.keys(e.C)),r=n.next();!r.done;r=n.next())i=r.value,e.i.overrideFile(i,e.C[i]);if(e.C={},e.g.listeners)for(o=s(e.g.listeners),a=o.next();!a.done;a=o.next())u=a.value,Bt(e,u);c=e.j,e.j={},e.setOptions(c),f.g=0}))}(e),3):y(t,function(e){var t,n,r,i,o,a;return A((function(u){switch(u.g){case 1:if(!e.s)return u.return();if(!e.A){u.g=2;break}t=s(e.A),n=t.next();case 3:if(n.done){u.g=5;break}return y(u,(0,n.value)(),4);case 4:n=t.next(),u.g=3;break;case 5:e.A=void 0;case 2:if(e.B){for(r=new e.h.GraphOptionChangeRequestList,i=s(e.B),o=i.next();!o.done;o=i.next())a=o.value,r.push_back(a);e.i.changeOptions(r),r.delete(),e.B=void 0}e.s=!1,u.g=0}}))}(e),0)}))},e.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.C[e]=t},e.clearOverriddenFiles=function(){this.C={},this.i&&this.i.clearOverriddenFiles()},e.send=function(e,t){var n,r,i,o,a,u,c,f,l,h=this;return A((function(p){switch(p.g){case 1:return h.g.inputs?(n=1e3*(null==t?performance.now():t),y(p,h.D,2)):p.return();case 2:return y(p,h.initialize(),3);case 3:for(r=new h.h.PacketDataList,i=s(Object.keys(e)),o=i.next();!o.done;o=i.next())if(a=o.value,u=h.g.inputs[a]){e:{var d=e[a];switch(u.type){case"video":var m=h.o[u.stream];if(m||(m=new Tt(h.h,h.G),h.o[u.stream]=m),0===m.l&&(m.l=m.h.createTexture()),"undefined"!=typeof HTMLVideoElement&&d instanceof HTMLVideoElement)var g=d.videoWidth,v=d.videoHeight;else"undefined"!=typeof HTMLImageElement&&d instanceof HTMLImageElement?(g=d.naturalWidth,v=d.naturalHeight):(g=d.width,v=d.height);v={glName:m.l,width:g,height:v},(g=m.g).canvas.width=v.width,g.canvas.height=v.height,g.activeTexture(g.TEXTURE0),m.h.bindTexture2d(m.l),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,d),m.h.bindTexture2d(0),m=v;break e;case"detections":for((m=h.o[u.stream])||(m=new Ot(h.h),h.o[u.stream]=m),m.data||(m.data=new m.g.DetectionListData),m.data.reset(d.length),v=0;v<d.length;++v){g=d[v];var b=m.data,w=b.setBoundingBox,x=v,_=g.ea,A=new _t;if(ye(A,1,_.ka),ye(A,2,_.la),ye(A,3,_.height),ye(A,4,_.width),ye(A,5,_.rotation),ye(A,6,_.ia),_=rt(A,At),w.call(b,x,_),g.Y)for(b=0;b<g.Y.length;++b){var k=!!(A=g.Y[b]).visibility;x=(w=m.data).addNormalizedLandmark,_=v,A=Object.assign(Object.assign({},A),{visibility:k?A.visibility:0}),ye(k=new vt,1,A.x),ye(k,2,A.y),ye(k,3,A.z),A.visibility&&ye(k,4,A.visibility),A=rt(k,yt),x.call(w,_,A)}if(g.V)for(b=0;b<g.V.length;++b)x=(w=m.data).addClassification,_=v,A=g.V[b],ye(k=new ht,2,A.score),A.index&&ye(k,1,A.index),A.label&&ye(k,3,A.label),A.displayName&&ye(k,4,A.displayName),A=rt(k,pt),x.call(w,_,A)}m=m.data;break e;default:m={}}}switch(c=m,f=u.stream,u.type){case"video":r.pushTexture2d(Object.assign(Object.assign({},c),{stream:f,timestamp:n}));break;case"detections":(l=c).stream=f,l.timestamp=n,r.pushDetectionList(l);break;default:throw Error("Unknown input config type: '"+u.type+"'")}}return h.i.send(r),y(p,h.D,4);case 4:r.delete(),p.g=0}}))},e.onResults=function(e,t){this.listeners[t||"$"]=e},E("Solution",Lt),E("OptionType",{BOOL:0,NUMBER:1,ma:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(e=It.prototype).close=function(){return this.g.close(),Promise.resolve()},e.onResults=function(e){this.g.onResults(e)},e.initialize=function(){var e=this;return A((function(t){return y(t,e.g.initialize(),0)}))},e.reset=function(){this.g.reset()},e.send=function(e){var t=this;return A((function(n){return y(n,t.g.send(e),0)}))},e.setOptions=function(e){this.g.setOptions(e)},E("Hands",It),E("HAND_CONNECTIONS",[[0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]]),E("VERSION","0.4.1646424915")}).call(this)},937:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{c7:()=>calcularHydra,l:()=>guardarDatoHydra});var LIMITE_OPERACIONES=9;function ensamblar(e,t){return t.constructor==Object?e+"("+ensamblar(t.operacion,t.args)+")":e+"("+t.toString()+")"}function crearDatoHydra(e,t){return{operacion:e,args:t}}function guardarDatoHydra(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];e.length>LIMITE_OPERACIONES&&e.splice(1,1),e.push(crearDatoHydra(t,n))}function calcularHydra(listaOperaciones){for(var str="",i=0;i<listaOperaciones.length;i++){var temp=listaOperaciones[i];str+=ensamblar(temp.operacion,temp.args)}return str+=".out()",eval(str),str}},724:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(81),i=n.n(r),o=n(645),a=n.n(o)()(i());a.push([e.id,"\r\n/* The Modal (background) */\r\n.modal {\r\n position: fixed;\r\n top: 0px;;\r\n left: 0px;\r\n width: 100%;\r\n height: 100%;\r\n z-index: 80;\r\n /* display: -webkit-box;\r\n display: -moz-box;\r\n display: -ms-flexbox;\r\n display: -webkit-flex; */\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n /* -webkit-transition: height 1s;\r\n -moz-transition: height 1s;\r\n -o-transition: height 1s;\r\n transition: height 1s; */\r\n color: whitesmoke;\r\n background-color: rgba(0,0,0,0.4);\r\n /* overflow:scroll; */\r\n\r\n /* display: block; \r\n position: absolute;\r\n z-index: 2; \r\n padding-top: 100px; \r\n\r\n width: 70%; \r\n height: 80%; \r\n overflow: auto; \r\n */\r\n}\r\n\r\n/* Modal Content */\r\n.modal-content {\r\n width: 70%;\r\n height: 75%;\r\n min-width: 800px;\r\n min-height: 300px;\r\n background: rgba(0, 0, 0, 1);\r\n border: 1px solid white;\r\n padding: 0px;\r\n margin-left: 15%;\r\n margin-top: 5%;\r\n /* display: -webkit-box;\r\n display: -moz-box;\r\n display: -ms-flexbox;\r\n display: -webkit-flex; */\r\n display: block;\r\n /* flex-flow: column; */\r\n /* -webkit-transition: background 1s;\r\n -moz-transition: background 1s;\r\n -o-transition: background 1s;\r\n transition: background 1s;\r\n -webkit-transition: width 1s;\r\n -moz-transition: width 1s;\r\n -o-transition: width 1s;\r\n transition: width 1s; */\r\n overflow:scroll;\r\n align-items: center;\r\n justify-content: center;\r\n text-align: center;\r\n\r\n \r\n /* top: 10%;;\r\n\r\n width: 80%;\r\n height: 80%;\r\n background-color: #fefefe;\r\n margin: auto;\r\n padding: 20px;\r\n border: 1px solid #888;\r\n width: 80%; */\r\n}\r\n.modal-header{\r\n /* display: flex; */\r\n justify-content: center;\r\n text-align: right;\r\n margin: auto;\r\n padding: .75rem;\r\n\r\n}\r\n.btn-close{\r\n margin-right:2rem;\r\n}\r\n\r\n.modal-content a{\r\n color: coral;\r\n}\r\n.modal-content p {\r\n max-width: 80%;\r\n margin: auto;\r\n text-align: justify;\r\n }\r\n\r\n.modal-header {\r\n\twidth: 100%;\r\n font-size: 1.5grem;\r\n\t/* height: 40px; */\r\n\tborder: 1px solid white;\r\n\tmargin: 0px;\r\n\t/* display: -webkit-box;\r\n\tdisplay: -moz-box;\r\n\tdisplay: -ms-flexbox;\r\n\tdisplay: -webkit-flex;\r\n\tdisplay: flex; */\r\n\t/* justify-content: space-between; */\r\n\tjustify-content: space-between;\r\n}\r\n\r\n.modal-content img{\r\n width: 80%;\r\n}\r\n/* The Close Button */\r\n/* .close {\r\n color: #aaaaaa;\r\n float: right;\r\n font-size: 28px;\r\n font-weight: bold;\r\n}\r\n\r\n.close:hover,\r\n.close:focus {\r\n color: #000;\r\n text-decoration: none;\r\n cursor: pointer;\r\n} */\r\n.visible{\r\n display:block;\r\n}\r\n\r\n.oculto{\r\n display:none;\r\n}",""]);const s=a},890:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(81),i=n.n(r),o=n(645),a=n.n(o)()(i());a.push([e.id,"\n body{\n margin: 0;\n overflow: hidden; \n }\n\n #canvas-hydra {\n /* opacity: 0.8; */\n z-index: 1;\n position: absolute;\n /* width: 150px;\n height: 200px;\n top: 20px;\n left: 170px;\n border: 1px dashed #990000;\n background-color: #ffdddd;\n text-align: center; */\n}",""]);const s=a},645:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var s=0;s<this.length;s++){var u=this[s][0];null!=u&&(a[u]=!0)}for(var c=0;c<e.length;c++){var f=[].concat(e[c]);r&&a[f[0]]||(void 0!==o&&(void 0===f[5]||(f[1]="@layer".concat(f[5].length>0?" ".concat(f[5]):""," {").concat(f[1],"}")),f[5]=o),n&&(f[2]?(f[1]="@media ".concat(f[2]," {").concat(f[1],"}"),f[2]=n):f[2]=n),i&&(f[4]?(f[1]="@supports (".concat(f[4],") {").concat(f[1],"}"),f[4]=i):f[4]="".concat(i)),t.push(f))}},t}},81:e=>{"use strict";e.exports=function(e){return e[1]}},379:e=>{"use strict";var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var o={},a=[],s=0;s<e.length;s++){var u=e[s],c=r.base?u[0]+r.base:u[0],f=o[c]||0,l="".concat(c," ").concat(f);o[c]=f+1;var h=n(l),p={css:u[1],media:u[2],sourceMap:u[3],supports:u[4],layer:u[5]};if(-1!==h)t[h].references++,t[h].updater(p);else{var d=i(p,r);r.byIndex=s,t.splice(s,0,{identifier:l,updater:d,references:1})}a.push(l)}return a}function i(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,i){var o=r(e=e||[],i=i||{});return function(e){e=e||[];for(var a=0;a<o.length;a++){var s=n(o[a]);t[s].references--}for(var u=r(e,i),c=0;c<o.length;c++){var f=n(o[c]);0===t[f].references&&(t[f].updater(),t.splice(f,1))}o=u}}},569:e=>{"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},216:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},565:(e,t,n)=>{"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},795:e=>{"use strict";e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},589:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},578:()=>{"use strict";!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Hydra=e()}((function(){var define,module,exports;return function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[a]={exports:{}};t[a][0].call(f.exports,(function(e){return i(t[a][1][e]||e)}),f,f.exports,e,t,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,t,n){var r,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}v(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&v(e,"error",t,{once:!0})}(e,i)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function f(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var i,o,a,s;if(c(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),a=o[t]),void 0===a)a=o[t]=n,++e._eventsCount;else if("function"==typeof a?a=o[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=f(e))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=h.bind(r);return i.listener=n,r.wrapFn=i,i}function d(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):g(i,i.length)}function m(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function g(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function v(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){r.once&&e.removeEventListener(t,i),n(o)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return f(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)o(u,this,t);else{var c=u.length,f=g(u,c);for(n=0;n<c;++n)o(f[n],this,t)}return!0},s.prototype.addListener=function(e,t){return l(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return l(this,e,t,!0)},s.prototype.once=function(e,t){return c(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,o,a;if(c(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return d(this,e,!0)},s.prototype.rawListeners=function(e){return d(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},{}],2:[function(e,t,n){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},{}],3:[function(e,t,n){var r,i;r=this,i=function(){function e(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var t=Object.freeze({__proto__:null,blackman:function(e){for(var t=new Float32Array(e),n=2*Math.PI/(e-1),r=2*n,i=0;i<e/2;i++)t[i]=.42-.5*Math.cos(i*n)+.08*Math.cos(i*r);for(i=Math.ceil(e/2);i>0;i--)t[e-i]=t[i-1];return t},sine:function(e){for(var t=Math.PI/(e-1),n=new Float32Array(e),r=0;r<e;r++)n[r]=Math.sin(t*r);return n},hanning:function(e){for(var t=new Float32Array(e),n=0;n<e;n++)t[n]=.5-.5*Math.cos(2*Math.PI*n/(e-1));return t},hamming:function(e){for(var t=new Float32Array(e),n=0;n<e;n++)t[n]=.54-.46*Math.cos(2*Math.PI*(n/e-1));return t}}),n={};function r(e){for(;e%2==0&&e>1;)e/=2;return 1===e}function i(e,r){if("rect"!==r){if(""!==r&&r||(r="hanning"),n[r]||(n[r]={}),!n[r][e.length])try{n[r][e.length]=t[r](e.length)}catch(e){throw new Error("Invalid windowing function")}e=function(e,t){for(var n=[],r=0;r<Math.min(e.length,t.length);r++)n[r]=e[r]*t[r];return n}(e,n[r][e.length])}return e}function o(e,t,n){for(var r=new Float32Array(e),i=0;i<r.length;i++)r[i]=i*t/n,r[i]=13*Math.atan(r[i]/1315.8)+3.5*Math.atan(Math.pow(r[i]/7518,2));return r}function a(e){return Float32Array.from(e)}function s(e){return 1125*Math.log(1+e/700)}function u(e,t,n){for(var r,i=new Float32Array(e+2),o=new Float32Array(e+2),a=t/2,u=s(0),c=(s(a)-u)/(e+1),f=new Array(e+2),l=0;l<i.length;l++)i[l]=l*c,o[l]=(r=i[l],700*(Math.exp(r/1125)-1)),f[l]=Math.floor((n+1)*o[l]/t);for(var h=new Array(e),p=0;p<h.length;p++){for(h[p]=new Array(n/2+1).fill(0),l=f[p];l<f[p+1];l++)h[p][l]=(l-f[p])/(f[p+1]-f[p]);for(l=f[p+1];l<f[p+2];l++)h[p][l]=(f[p+2]-l)/(f[p+2]-f[p+1])}return h}function c(t,n,r,i,o,a,s){void 0===i&&(i=5),void 0===o&&(o=2),void 0===a&&(a=!0),void 0===s&&(s=440);var u=Math.floor(r/2)+1,c=new Array(r).fill(0).map((function(e,i){return t*function(e,t){return Math.log2(16*e/t)}(n*i/r,s)}));c[0]=c[1]-1.5*t;var f,l,h,p=c.slice(1).map((function(e,t){return Math.max(e-c[t])}),1).concat([1]),d=Math.round(t/2),m=new Array(t).fill(0).map((function(e,n){return c.map((function(e){return(10*t+d+e-n)%t-d}))})),g=m.map((function(e,t){return e.map((function(e,n){return Math.exp(-.5*Math.pow(2*m[t][n]/p[n],2))}))}));if(l=(f=g)[0].map((function(){return 0})),h=f.reduce((function(e,t){return t.forEach((function(t,n){e[n]+=Math.pow(t,2)})),e}),l).map(Math.sqrt),g=f.map((function(e,t){return e.map((function(e,t){return e/(h[t]||1)}))})),o){var v=c.map((function(e){return Math.exp(-.5*Math.pow((e/t-i)/o,2))}));g=g.map((function(e){return e.map((function(e,t){return e*v[t]}))}))}return a&&(g=e(e([],g.slice(3),!0),g.slice(0,3),!0)),g.map((function(e){return e.slice(0,u)}))}function f(e,t){for(var n=0,r=0,i=0;i<t.length;i++)n+=Math.pow(i,e)*Math.abs(t[i]),r+=t[i];return n/r}function l(e){var t=e.ampSpectrum,n=e.barkScale,r=e.numberOfBarkBands,i=void 0===r?24:r;if("object"!=typeof t||"object"!=typeof n)throw new TypeError;var o=i,a=new Float32Array(o),s=0,u=t,c=new Int32Array(o+1);c[0]=0;for(var f=n[u.length-1]/o,l=1,h=0;h<u.length;h++)for(;n[h]>f;)c[l++]=h,f=l*n[u.length-1]/o;for(c[o]=u.length-1,h=0;h<o;h++){for(var p=0,d=c[h];d<c[h+1];d++)p+=u[d];a[h]=Math.pow(p,.23)}for(h=0;h<a.length;h++)s+=a[h];return{specific:a,total:s}}function h(e){var t=e.ampSpectrum;if("object"!=typeof t)throw new TypeError;for(var n=new Float32Array(t.length),r=0;r<n.length;r++)n[r]=Math.pow(t[r],2);return n}function p(e){var t=e.ampSpectrum,n=e.melFilterBank,r=e.bufferSize;if("object"!=typeof t)throw new TypeError("Valid ampSpectrum is required to generate melBands");if("object"!=typeof n)throw new TypeError("Valid melFilterBank is required to generate melBands");for(var i=h({ampSpectrum:t}),o=n.length,a=Array(o),s=new Float32Array(o),u=0;u<s.length;u++){a[u]=new Float32Array(r/2),s[u]=0;for(var c=0;c<r/2;c++)a[u][c]=n[u][c]*i[c],s[u]+=a[u][c];s[u]=Math.log(s[u]+1)}return Array.prototype.slice.call(s)}var d={exports:{}},m=null,g=function(e,t){var n=e.length;return t=t||2,m&&m[n]||function(e){(m=m||{})[e]=new Array(e*e);for(var t=Math.PI/e,n=0;n<e;n++)for(var r=0;r<e;r++)m[e][r+n*e]=Math.cos(t*(r+.5)*n)}(n),e.map((function(){return 0})).map((function(r,i){return t*e.reduce((function(e,t,r,o){return e+t*m[n][r+i*n]}),0)}))};!function(e){e.exports=g}(d);var v=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(d.exports),y=Object.freeze({__proto__:null,buffer:function(e){return e.signal},rms:function(e){var t=e.signal;if("object"!=typeof t)throw new TypeError;for(var n=0,r=0;r<t.length;r++)n+=Math.pow(t[r],2);return n/=t.length,Math.sqrt(n)},energy:function(e){var t=e.signal;if("object"!=typeof t)throw new TypeError;for(var n=0,r=0;r<t.length;r++)n+=Math.pow(Math.abs(t[r]),2);return n},complexSpectrum:function(e){return e.complexSpectrum},spectralSlope:function(e){var t=e.ampSpectrum,n=e.sampleRate,r=e.bufferSize;if("object"!=typeof t)throw new TypeError;for(var i=0,o=0,a=new Float32Array(t.length),s=0,u=0,c=0;c<t.length;c++){i+=t[c];var f=c*n/r;a[c]=f,s+=f*f,o+=f,u+=f*t[c]}return(t.length*u-o*i)/(i*(s-Math.pow(o,2)))},spectralCentroid:function(e){var t=e.ampSpectrum;if("object"!=typeof t)throw new TypeError;return f(1,t)},spectralRolloff:function(e){var t=e.ampSpectrum,n=e.sampleRate;if("object"!=typeof t)throw new TypeError;for(var r=t,i=n/(2*(r.length-1)),o=0,a=0;a<r.length;a++)o+=r[a];for(var s=.99*o,u=r.length-1;o>s&&u>=0;)o-=r[u],--u;return(u+1)*i},spectralFlatness:function(e){var t=e.ampSpectrum;if("object"!=typeof t)throw new TypeError;for(var n=0,r=0,i=0;i<t.length;i++)n+=Math.log(t[i]),r+=t[i];return Math.exp(n/t.length)*t.length/r},spectralSpread:function(e){var t=e.ampSpectrum;if("object"!=typeof t)throw new TypeError;return Math.sqrt(f(2,t)-Math.pow(f(1,t),2))},spectralSkewness:function(e){var t=e.ampSpectrum;if("object"!=typeof t)throw new TypeError;var n=f(1,t),r=f(2,t),i=f(3,t);return(2*Math.pow(n,3)-3*n*r+i)/Math.pow(Math.sqrt(r-Math.pow(n,2)),3)},spectralKurtosis:function(e){var t=e.ampSpectrum;if("object"!=typeof t)throw new TypeError;var n=t,r=f(1,n),i=f(2,n),o=f(3,n),a=f(4,n);return(-3*Math.pow(r,4)+6*r*i-4*r*o+a)/Math.pow(Math.sqrt(i-Math.pow(r,2)),4)},amplitudeSpectrum:function(e){return e.ampSpectrum},zcr:function(e){var t=e.signal;if("object"!=typeof t)throw new TypeError;for(var n=0,r=1;r<t.length;r++)(t[r-1]>=0&&t[r]<0||t[r-1]<0&&t[r]>=0)&&n++;return n},loudness:l,perceptualSpread:function(e){for(var t=l({ampSpectrum:e.ampSpectrum,barkScale:e.barkScale}),n=0,r=0;r<t.specific.length;r++)t.specific[r]>n&&(n=t.specific[r]);return Math.pow((t.total-n)/t.total,2)},perceptualSharpness:function(e){for(var t=l({ampSpectrum:e.ampSpectrum,barkScale:e.barkScale}),n=t.specific,r=0,i=0;i<n.length;i++)r+=i<15?(i+1)*n[i+1]:.066*Math.exp(.171*(i+1));return r*(.11/t.total)},powerSpectrum:h,mfcc:function(e){var t=e.ampSpectrum,n=e.melFilterBank,r=e.numberOfMFCCCoefficients,i=e.bufferSize,o=Math.min(40,Math.max(1,r||13));if(n.length<o)throw new Error("Insufficient filter bank for requested number of coefficients");var a=p({ampSpectrum:t,melFilterBank:n,bufferSize:i});return v(a).slice(0,o)},chroma:function(e){var t=e.ampSpectrum,n=e.chromaFilterBank;if("object"!=typeof t)throw new TypeError("Valid ampSpectrum is required to generate chroma");if("object"!=typeof n)throw new TypeError("Valid chromaFilterBank is required to generate chroma");var r=n.map((function(e,n){return t.reduce((function(t,n,r){return t+n*e[r]}),0)})),i=Math.max.apply(Math,r);return i?r.map((function(e){return e/i})):r},spectralFlux:function(e){var t=e.signal,n=e.previousSignal,r=e.bufferSize;if("object"!=typeof t||"object"!=typeof n)throw new TypeError;for(var i=0,o=-r/2;o<t.length/2-1;o++)x=Math.abs(t[o])-Math.abs(n[o]),i+=(x+Math.abs(x))/2;return i},spectralCrest:function(e){var t=e.ampSpectrum;if("object"!=typeof t)throw new TypeError;var n=0,r=-1/0;return t.forEach((function(e){n+=Math.pow(e,2),r=e>r?e:r})),n/=t.length,n=Math.sqrt(n),r/n},melBands:p});function b(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var w={},_={},A=function(e,t){return{real:e.real*t.real-e.imag*t.imag,imag:e.real*t.imag+e.imag*t.real}},k=function(e,t){return{real:e.real+t.real,imag:e.imag+t.imag}},S=function(e,t){return{real:e.real-t.real,imag:e.imag-t.imag}},E=function(e,t){var n=-2*Math.PI*e/t;return{real:Math.cos(n),imag:Math.sin(n)}},j=function(e){var t={};void 0===e.real||void 0===e.imag?t=function(e){var t={};t.real=void 0===e.real?e.slice():e.real.slice();var n=t.real.length;return void 0===_[n]&&(_[n]=Array.apply(null,Array(n)).map(Number.prototype.valueOf,0)),t.imag=_[n].slice(),t}(e):(t.real=e.real.slice(),t.imag=e.imag.slice());var n=t.real.length,r=Math.log2(n);if(Math.round(r)!=r)throw new Error("Input size must be a power of 2.");if(t.real.length!=t.imag.length)throw new Error("Real and imaginary components must have the same length.");for(var i=function(e){if(void 0===w[e]){for(var t=(e-1).toString(2).length,n="0".repeat(t),r={},i=0;i<e;i++){var o=i.toString(2);o=n.substr(o.length)+o,o=[].concat(b(o)).reverse().join(""),r[i]=parseInt(o,2)}w[e]=r}return w[e]}(n),o={real:[],imag:[]},a=0;a<n;a++)o.real[i[a]]=t.real[a],o.imag[i[a]]=t.imag[a];for(var s=0;s<n;s++)t.real[s]=o.real[s],t.imag[s]=o.imag[s];for(var u=1;u<=r;u++)for(var c=Math.pow(2,u),f=0;f<c/2;f++)for(var l=E(f,c),h=0;h<n/c;h++){var p=c*h+f,d=c*h+f+c/2,m={real:t.real[p],imag:t.imag[p]},g={real:t.real[d],imag:t.imag[d]},v=A(l,g),y=S(m,v);t.real[d]=y.real,t.imag[d]=y.imag;var x=k(v,m);t.real[p]=x.real,t.imag[p]=x.imag}return t},T=function(){function e(e,t){var n=this;if(this._m=t,!e.audioContext)throw this._m.errors.noAC;if(e.bufferSize&&!r(e.bufferSize))throw this._m._errors.notPow2;if(!e.source)throw this._m._errors.noSource;this._m.audioContext=e.audioContext,this._m.bufferSize=e.bufferSize||this._m.bufferSize||256,this._m.hopSize=e.hopSize||this._m.hopSize||this._m.bufferSize,this._m.sampleRate=e.sampleRate||this._m.audioContext.sampleRate||44100,this._m.callback=e.callback,this._m.windowingFunction=e.windowingFunction||"hanning",this._m.featureExtractors=y,this._m.EXTRACTION_STARTED=e.startImmediately||!1,this._m.channel="number"==typeof e.channel?e.channel:0,this._m.inputs=e.inputs||1,this._m.outputs=e.outputs||1,this._m.numberOfMFCCCoefficients=e.numberOfMFCCCoefficients||this._m.numberOfMFCCCoefficients||13,this._m.numberOfBarkBands=e.numberOfBarkBands||this._m.numberOfBarkBands||24,this._m.spn=this._m.audioContext.createScriptProcessor(this._m.bufferSize,this._m.inputs,this._m.outputs),this._m.spn.connect(this._m.audioContext.destination),this._m._featuresToExtract=e.featureExtractors||[],this._m.barkScale=o(this._m.bufferSize,this._m.sampleRate,this._m.bufferSize),this._m.melFilterBank=u(Math.max(this._m.melBands,this._m.numberOfMFCCCoefficients),this._m.sampleRate,this._m.bufferSize),this._m.inputData=null,this._m.previousInputData=null,this._m.frame=null,this._m.previousFrame=null,this.setSource(e.source),this._m.spn.onaudioprocess=function(e){var t;null!==n._m.inputData&&(n._m.previousInputData=n._m.inputData),n._m.inputData=e.inputBuffer.getChannelData(n._m.channel),n._m.previousInputData?((t=new Float32Array(n._m.previousInputData.length+n._m.inputData.length-n._m.hopSize)).set(n._m.previousInputData.slice(n._m.hopSize)),t.set(n._m.inputData,n._m.previousInputData.length-n._m.hopSize)):t=n._m.inputData,function(e,t,n){if(e.length<t)throw new Error("Buffer is too short for frame length");if(n<1)throw new Error("Hop length cannot be less that 1");if(t<1)throw new Error("Frame length cannot be less that 1");var r=1+Math.floor((e.length-t)/n);return new Array(r).fill(0).map((function(r,i){return e.slice(i*n,i*n+t)}))}(t,n._m.bufferSize,n._m.hopSize).forEach((function(e){n._m.frame=e;var t=n._m.extract(n._m._featuresToExtract,n._m.frame,n._m.previousFrame);"function"==typeof n._m.callback&&n._m.EXTRACTION_STARTED&&n._m.callback(t),n._m.previousFrame=n._m.frame}))}}return e.prototype.start=function(e){this._m._featuresToExtract=e||this._m._featuresToExtract,this._m.EXTRACTION_STARTED=!0},e.prototype.stop=function(){this._m.EXTRACTION_STARTED=!1},e.prototype.setSource=function(e){this._m.source&&this._m.source.disconnect(this._m.spn),this._m.source=e,this._m.source.connect(this._m.spn)},e.prototype.setChannel=function(e){e<=this._m.inputs?this._m.channel=e:console.error("Channel ".concat(e," does not exist. Make sure you've provided a value for 'inputs' that is greater than ").concat(e," when instantiating the MeydaAnalyzer"))},e.prototype.get=function(e){return this._m.inputData?this._m.extract(e||this._m._featuresToExtract,this._m.inputData,this._m.previousInputData):null},e}(),C={audioContext:null,spn:null,bufferSize:512,sampleRate:44100,melBands:26,chromaBands:12,callback:null,windowingFunction:"hanning",featureExtractors:y,EXTRACTION_STARTED:!1,numberOfMFCCCoefficients:13,numberOfBarkBands:24,_featuresToExtract:[],windowing:i,_errors:{notPow2:new Error("Meyda: Buffer size must be a power of 2, e.g. 64 or 512"),featureUndef:new Error("Meyda: No features defined."),invalidFeatureFmt:new Error("Meyda: Invalid feature format"),invalidInput:new Error("Meyda: Invalid input."),noAC:new Error("Meyda: No AudioContext specified."),noSource:new Error("Meyda: No source node specified.")},createMeydaAnalyzer:function(e){return new T(e,Object.assign({},C))},listAvailableFeatureExtractors:function(){return Object.keys(this.featureExtractors)},extract:function(e,t,n){var i=this;if(!t)throw this._errors.invalidInput;if("object"!=typeof t)throw this._errors.invalidInput;if(!e)throw this._errors.featureUndef;if(!r(t.length))throw this._errors.notPow2;void 0!==this.barkScale&&this.barkScale.length==this.bufferSize||(this.barkScale=o(this.bufferSize,this.sampleRate,this.bufferSize)),void 0!==this.melFilterBank&&this.barkScale.length==this.bufferSize&&this.melFilterBank.length==this.melBands||(this.melFilterBank=u(Math.max(this.melBands,this.numberOfMFCCCoefficients),this.sampleRate,this.bufferSize)),void 0!==this.chromaFilterBank&&this.chromaFilterBank.length==this.chromaBands||(this.chromaFilterBank=c(this.chromaBands,this.sampleRate,this.bufferSize)),"buffer"in t&&void 0===t.buffer?this.signal=a(t):this.signal=t;var s=O(t,this.windowingFunction,this.bufferSize);if(this.signal=s.windowedSignal,this.complexSpectrum=s.complexSpectrum,this.ampSpectrum=s.ampSpectrum,n){var f=O(n,this.windowingFunction,this.bufferSize);this.previousSignal=f.windowedSignal,this.previousComplexSpectrum=f.complexSpectrum,this.previousAmpSpectrum=f.ampSpectrum}var l=function(e){return i.featureExtractors[e]({ampSpectrum:i.ampSpectrum,chromaFilterBank:i.chromaFilterBank,complexSpectrum:i.complexSpectrum,signal:i.signal,bufferSize:i.bufferSize,sampleRate:i.sampleRate,barkScale:i.barkScale,melFilterBank:i.melFilterBank,previousSignal:i.previousSignal,previousAmpSpectrum:i.previousAmpSpectrum,previousComplexSpectrum:i.previousComplexSpectrum,numberOfMFCCCoefficients:i.numberOfMFCCCoefficients,numberOfBarkBands:i.numberOfBarkBands})};if("object"==typeof e)return e.reduce((function(e,t){var n;return Object.assign({},e,((n={})[t]=l(t),n))}),{});if("string"==typeof e)return l(e);throw this._errors.invalidFeatureFmt}},O=function(e,t,n){var r={};void 0===e.buffer?r.signal=a(e):r.signal=e,r.windowedSignal=i(r.signal,t),r.complexSpectrum=j(r.windowedSignal),r.ampSpectrum=new Float32Array(n/2);for(var o=0;o<n/2;o++)r.ampSpectrum[o]=Math.sqrt(Math.pow(r.complexSpectrum.real[o],2)+Math.pow(r.complexSpectrum.imag[o],2));return r};return"undefined"!=typeof window&&(window.Meyda=C),C},"object"==typeof n&&void 0!==t?t.exports=i():"function"==typeof define&&define.amd?define(i):(r="undefined"!=typeof globalThis?globalThis:r||self).Meyda=i()},{}],4:[function(e,t,n){(function(e){(function(){(function(){var n,r,i,o,a,s;"undefined"!=typeof performance&&null!==performance&&performance.now?t.exports=function(){return performance.now()}:null!=e&&e.hrtime?(t.exports=function(){return(n()-a)/1e6},r=e.hrtime,o=(n=function(){var e;return 1e9*(e=r())[0]+e[1]})(),s=1e9*e.uptime(),a=o-s):Date.now?(t.exports=function(){return Date.now()-i},i=Date.now()):(t.exports=function(){return(new Date).getTime()-i},i=(new Date).getTime())}).call(this)}).call(this)}).call(this,e("_process"))},{_process:5}],5:[function(e,t,n){var r,i,o=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(e){i=s}}();var c,f=[],l=!1,h=-1;function p(){l&&c&&(l=!1,c.length?f=c.concat(f):h=-1,f.length&&d())}function d(){if(!l){var e=u(p);l=!0;for(var t=f.length;t;){for(c=f,f=[];++h<t;)c&&c[h].run();h=-1,t=f.length}c=null,l=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function g(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];f.push(new m(e,t)),1!==f.length||l||u(d)},m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],6:[function(e,t,n){var r=e("inherits"),i=e("events").EventEmitter,o=e("right-now"),a=e("raf");function s(e){if(!(this instanceof s))return new s(e);this.running=!1,this.last=o(),this._frame=0,this._tick=this.tick.bind(this),e&&this.on("tick",e)}t.exports=s,r(s,i),s.prototype.start=function(){if(!this.running)return this.running=!0,this.last=o(),this._frame=a(this._tick),this},s.prototype.stop=function(){return this.running=!1,0!==this._frame&&a.cancel(this._frame),this._frame=0,this},s.prototype.tick=function(){this._frame=a(this._tick);var e=o(),t=e-this.last;this.emit("tick",t),this.last=e}},{events:1,inherits:2,raf:7,"right-now":9}],7:[function(e,t,n){(function(n){(function(){for(var r=e("performance-now"),i="undefined"==typeof window?n:window,o=["moz","webkit"],a="AnimationFrame",s=i["request"+a],u=i["cancel"+a]||i["cancelRequest"+a],c=0;!s&&c<o.length;c++)s=i[o[c]+"Request"+a],u=i[o[c]+"Cancel"+a]||i[o[c]+"CancelRequest"+a];if(!s||!u){var f=0,l=0,h=[];s=function(e){if(0===h.length){var t=r(),n=Math.max(0,16.666666666666668-(t-f));f=n+t,setTimeout((function(){var e=h.slice(0);h.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(f)}catch(e){setTimeout((function(){throw e}),0)}}),Math.round(n))}return h.push({handle:++l,callback:e,cancelled:!1}),l},u=function(e){for(var t=0;t<h.length;t++)h[t].handle===e&&(h[t].cancelled=!0)}}t.exports=function(e){return s.call(i,e)},t.exports.cancel=function(){u.apply(i,arguments)},t.exports.polyfill=function(e){e||(e=i),e.requestAnimationFrame=s,e.cancelAnimationFrame=u}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"performance-now":4}],8:[function(e,t,n){var r;r=function(){function e(e,t){this.id=N++,this.type=e,this.data=t}function t(e){if(0===e.length)return[];var n=e.charAt(0),r=e.charAt(e.length-1);if(1<e.length&&n===r&&('"'===n||"'"===n))return['"'+e.substr(1,e.length-2).replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'];if(n=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(e))return t(e.substr(0,n.index)).concat(t(n[1])).concat(t(e.substr(n.index+n[0].length)));if(1===(n=e.split(".")).length)return['"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'];for(e=[],r=0;r<n.length;++r)e=e.concat(t(n[r]));return e}function n(e){return"["+t(e).join("][")+"]"}function r(e){return"string"==typeof e?e.split():e}function i(e){return"string"==typeof e?document.querySelector(e):e}function o(e,t){for(var n=Array(e),r=0;r<e;++r)n[r]=t(r);return n}function a(e){var t,n;return t=(65535<e)<<4,t|=n=(255<(e>>>=t))<<3,(t|=n=(15<(e>>>=n))<<2)|(n=(3<(e>>>=n))<<1)|e>>>n>>1}function s(){function e(e){e:{for(var t=16;268435456>=t;t*=16)if(e<=t){e=t;break e}e=0}return 0<(t=n[a(e)>>2]).length?t.pop():new ArrayBuffer(e)}function t(e){n[a(e.byteLength)>>2].push(e)}var n=o(8,(function(){return[]}));return{alloc:e,free:t,allocType:function(t,n){var r=null;switch(t){case 5120:r=new Int8Array(e(n),0,n);break;case 5121:r=new Uint8Array(e(n),0,n);break;case 5122:r=new Int16Array(e(2*n),0,n);break;case 5123:r=new Uint16Array(e(2*n),0,n);break;case 5124:r=new Int32Array(e(4*n),0,n);break;case 5125:r=new Uint32Array(e(4*n),0,n);break;case 5126:r=new Float32Array(e(4*n),0,n);break;default:return null}return r.length!==n?r.subarray(0,n):r},freeType:function(e){t(e.buffer)}}}function u(e){return!!e&&"object"==typeof e&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"==typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||Y(e.data))}function c(e,t,n,r,i,o){for(var a=0;a<t;++a)for(var s=e[a],u=0;u<n;++u)for(var c=s[u],f=0;f<r;++f)i[o++]=c[f]}function f(e,t,n,r,i){for(var o=1,a=n+1;a<t.length;++a)o*=t[a];var s=t[n];if(4==t.length-n){var u=t[n+1],l=t[n+2];for(t=t[n+3],a=0;a<s;++a)c(e[a],u,l,t,r,i),i+=o}else for(a=0;a<s;++a)f(e[a],t,n+1,r,i),i+=o}function l(e){return 0|Q[Object.prototype.toString.call(e)]}function h(e,t){for(var n=0;n<t.length;++n)e[n]=t[n]}function p(e,t,n,r,i,o,a){for(var s=0,u=0;u<n;++u)for(var c=0;c<r;++c)e[s++]=t[i*u+o*c+a]}function d(e,t,n,r){function i(t){this.id=c++,this.buffer=e.createBuffer(),this.type=t,this.usage=35044,this.byteLength=0,this.dimension=1,this.dtype=5121,this.persistentData=null,n.profile&&(this.stats={size:0})}function o(t,n,r){t.byteLength=n.byteLength,e.bufferData(t.type,n,r)}function a(e,t,n,r,i,a){if(e.usage=n,Array.isArray(t)){if(e.dtype=r||5126,0<t.length)if(Array.isArray(t[0])){i=te(t);for(var s=r=1;s<i.length;++s)r*=i[s];e.dimension=r,o(e,t=ee(t,i,e.dtype),n),a?e.persistentData=t:G.freeType(t)}else"number"==typeof t[0]?(e.dimension=i,h(i=G.allocType(e.dtype,t.length),t),o(e,i,n),a?e.persistentData=i:G.freeType(i)):Y(t[0])&&(e.dimension=t[0].length,e.dtype=r||l(t[0])||5126,o(e,t=ee(t,[t.length,t[0].length],e.dtype),n),a?e.persistentData=t:G.freeType(t))}else if(Y(t))e.dtype=r||l(t),e.dimension=i,o(e,t,n),a&&(e.persistentData=new Uint8Array(new Uint8Array(t.buffer)));else if(u(t)){i=t.shape;var c=t.stride,f=(s=t.offset,0),d=0,m=0,g=0;1===i.length?(f=i[0],d=1,m=c[0],g=0):2===i.length&&(f=i[0],d=i[1],m=c[0],g=c[1]),e.dtype=r||l(t.data)||5126,e.dimension=d,p(i=G.allocType(e.dtype,f*d),t.data,f,d,m,g,s),o(e,i,n),a?e.persistentData=i:G.freeType(i)}}function s(n){t.bufferCount--;for(var i=0;i<r.state.length;++i){var o=r.state[i];o.buffer===n&&(e.disableVertexAttribArray(i),o.buffer=null)}e.deleteBuffer(n.buffer),n.buffer=null,delete f[n.id]}var c=0,f={};i.prototype.bind=function(){e.bindBuffer(this.type,this.buffer)},i.prototype.destroy=function(){s(this)};var d=[];return n.profile&&(t.getTotalBufferSize=function(){var e=0;return Object.keys(f).forEach((function(t){e+=f[t].stats.size})),e}),{create:function(r,o,c,d){function m(t){var r=35044,i=null,o=0,s=0,c=1;return Array.isArray(t)||Y(t)||u(t)?i=t:"number"==typeof t?o=0|t:t&&("data"in t&&(i=t.data),"usage"in t&&(r=J[t.usage]),"type"in t&&(s=Z[t.type]),"dimension"in t&&(c=0|t.dimension),"length"in t&&(o=0|t.length)),g.bind(),i?a(g,i,r,s,c,d):(o&&e.bufferData(g.type,o,r),g.dtype=s||5121,g.usage=r,g.dimension=c,g.byteLength=o),n.profile&&(g.stats.size=g.byteLength*ne[g.dtype]),m}t.bufferCount++;var g=new i(o);return f[g.id]=g,c||m(r),m._reglType="buffer",m._buffer=g,m.subdata=function(t,n){var r,i=0|(n||0);if(g.bind(),Y(t))e.bufferSubData(g.type,i,t);else if(Array.isArray(t)){if(0<t.length)if("number"==typeof t[0]){var o=G.allocType(g.dtype,t.length);h(o,t),e.bufferSubData(g.type,i,o),G.freeType(o)}else(Array.isArray(t[0])||Y(t[0]))&&(r=te(t),o=ee(t,r,g.dtype),e.bufferSubData(g.type,i,o),G.freeType(o))}else if(u(t)){r=t.shape;var a=t.stride,s=o=0,c=0,f=0;1===r.length?(o=r[0],s=1,c=a[0],f=0):2===r.length&&(o=r[0],s=r[1],c=a[0],f=a[1]),r=Array.isArray(t.data)?g.dtype:l(t.data),p(r=G.allocType(r,o*s),t.data,o,s,c,f,t.offset),e.bufferSubData(g.type,i,r),G.freeType(r)}return m},n.profile&&(m.stats=g.stats),m.destroy=function(){s(g)},m},createStream:function(e,t){var n=d.pop();return n||(n=new i(e)),n.bind(),a(n,t,35040,0,1,!1),n},destroyStream:function(e){d.push(e)},clear:function(){V(f).forEach(s),d.forEach(s)},getBuffer:function(e){return e&&e._buffer instanceof i?e._buffer:null},restore:function(){V(f).forEach((function(t){t.buffer=e.createBuffer(),e.bindBuffer(t.type,t.buffer),e.bufferData(t.type,t.persistentData||t.byteLength,t.usage)}))},_initBuffer:a}}function m(e,t,n,r){function i(e){this.id=c++,s[this.id]=this,this.buffer=e,this.primType=4,this.type=this.vertCount=0}function o(r,i,o,a,s,c,f){if(r.buffer.bind(),i){var l=f;f||Y(i)&&(!u(i)||Y(i.data))||(l=t.oes_element_index_uint?5125:5123),n._initBuffer(r.buffer,i,o,l,3)}else e.bufferData(34963,c,o),r.buffer.dtype=l||5121,r.buffer.usage=o,r.buffer.dimension=3,r.buffer.byteLength=c;if(l=f,!f){switch(r.buffer.dtype){case 5121:case 5120:l=5121;break;case 5123:case 5122:l=5123;break;case 5125:case 5124:l=5125}r.buffer.dtype=l}r.type=l,0>(i=s)&&(i=r.buffer.byteLength,5123===l?i>>=1:5125===l&&(i>>=2)),r.vertCount=i,i=a,0>a&&(i=4,1===(a=r.buffer.dimension)&&(i=0),2===a&&(i=1),3===a&&(i=4)),r.primType=i}function a(e){r.elementsCount--,delete s[e.id],e.buffer.destroy(),e.buffer=null}var s={},c=0,f={uint8:5121,uint16:5123};t.oes_element_index_uint&&(f.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var l=[];return{create:function(e,t){function s(e){if(e)if("number"==typeof e)c(e),l.primType=4,l.vertCount=0|e,l.type=5121;else{var t=null,n=35044,r=-1,i=-1,a=0,h=0;Array.isArray(e)||Y(e)||u(e)?t=e:("data"in e&&(t=e.data),"usage"in e&&(n=J[e.usage]),"primitive"in e&&(r=re[e.primitive]),"count"in e&&(i=0|e.count),"type"in e&&(h=f[e.type]),"length"in e?a=0|e.length:(a=i,5123===h||5122===h?a*=2:5125!==h&&5124!==h||(a*=4))),o(l,t,n,r,i,a,h)}else c(),l.primType=4,l.vertCount=0,l.type=5121;return s}var c=n.create(null,34963,!0),l=new i(c._buffer);return r.elementsCount++,s(e),s._reglType="elements",s._elements=l,s.subdata=function(e,t){return c.subdata(e,t),s},s.destroy=function(){a(l)},s},createStream:function(e){var t=l.pop();return t||(t=new i(n.create(null,34963,!0,!1)._buffer)),o(t,e,35040,-1,-1,0,0),t},destroyStream:function(e){l.push(e)},getElements:function(e){return"function"==typeof e&&e._elements instanceof i?e._elements:null},clear:function(){V(s).forEach(a)}}}function g(e){for(var t=G.allocType(5123,e.length),n=0;n<e.length;++n)if(isNaN(e[n]))t[n]=65535;else if(1/0===e[n])t[n]=31744;else if(-1/0===e[n])t[n]=64512;else{ie[0]=e[n];var r=(o=oe[0])>>>31<<15,i=(o<<1>>>24)-127,o=o>>13&1023;t[n]=-24>i?r:-14>i?r+(o+1024>>-14-i):15<i?r+31744:r+(i+15<<10)+o}return t}function v(e){return Array.isArray(e)||Y(e)}function y(e){return"[object "+e+"]"}function b(e){return Array.isArray(e)&&(0===e.length||"number"==typeof e[0])}function w(e){return!(!Array.isArray(e)||0===e.length||!v(e[0]))}function x(e){return Object.prototype.toString.call(e)}function _(e){if(!e)return!1;var t=x(e);return 0<=de.indexOf(t)||b(e)||w(e)||u(e)}function A(e,t){36193===e.type?(e.data=g(t),G.freeType(t)):e.data=t}function k(e,t,n,r,i,o){if(e=void 0!==ge[e]?ge[e]:ue[e]*me[t],o&&(e*=6),i){for(r=0;1<=n;)r+=e*n*n,n/=2;return r}return e*n*r}function S(e,t,n,r,i,o,a){function s(){this.format=this.internalformat=6408,this.type=5121,this.flipY=this.premultiplyAlpha=this.compressed=!1,this.unpackAlignment=1,this.colorSpace=37444,this.channels=this.height=this.width=0}function c(e,t){e.internalformat=t.internalformat,e.format=t.format,e.type=t.type,e.compressed=t.compressed,e.premultiplyAlpha=t.premultiplyAlpha,e.flipY=t.flipY,e.unpackAlignment=t.unpackAlignment,e.colorSpace=t.colorSpace,e.width=t.width,e.height=t.height,e.channels=t.channels}function f(e,t){if("object"==typeof t&&t){"premultiplyAlpha"in t&&(e.premultiplyAlpha=t.premultiplyAlpha),"flipY"in t&&(e.flipY=t.flipY),"alignment"in t&&(e.unpackAlignment=t.alignment),"colorSpace"in t&&(e.colorSpace=H[t.colorSpace]),"type"in t&&(e.type=$[t.type]);var n=e.width,r=e.height,i=e.channels,o=!1;"shape"in t?(n=t.shape[0],r=t.shape[1],3===t.shape.length&&(i=t.shape[2],o=!0)):("radius"in t&&(n=r=t.radius),"width"in t&&(n=t.width),"height"in t&&(r=t.height),"channels"in t&&(i=t.channels,o=!0)),e.width=0|n,e.height=0|r,e.channels=0|i,n=!1,"format"in t&&(n=t.format,r=e.internalformat=W[n],e.format=oe[r],n in $&&!("type"in t)&&(e.type=$[n]),n in X&&(e.compressed=!0),n=!0),!o&&n?e.channels=ue[e.format]:o&&!n&&e.channels!==se[e.format]&&(e.format=e.internalformat=se[e.channels])}}function l(t){e.pixelStorei(37440,t.flipY),e.pixelStorei(37441,t.premultiplyAlpha),e.pixelStorei(37443,t.colorSpace),e.pixelStorei(3317,t.unpackAlignment)}function h(){s.call(this),this.yOffset=this.xOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function p(e,t){var n=null;if(_(t)?n=t:t&&(f(e,t),"x"in t&&(e.xOffset=0|t.x),"y"in t&&(e.yOffset=0|t.y),_(t.data)&&(n=t.data)),t.copy){var r=i.viewportWidth,o=i.viewportHeight;e.width=e.width||r-e.xOffset,e.height=e.height||o-e.yOffset,e.needsCopy=!0}else if(n){if(Y(n))e.channels=e.channels||4,e.data=n,"type"in t||5121!==e.type||(e.type=0|Q[Object.prototype.toString.call(n)]);else if(b(n)){switch(e.channels=e.channels||4,o=(r=n).length,e.type){case 5121:case 5123:case 5125:case 5126:(o=G.allocType(e.type,o)).set(r),e.data=o;break;case 36193:e.data=g(r)}e.alignment=1,e.needsFree=!0}else if(u(n)){r=n.data,Array.isArray(r)||5121!==e.type||(e.type=0|Q[Object.prototype.toString.call(r)]),o=n.shape;var a,s,c,l,h=n.stride;3===o.length?(c=o[2],l=h[2]):l=c=1,a=o[0],s=o[1],o=h[0],h=h[1],e.alignment=1,e.width=a,e.height=s,e.channels=c,e.format=e.internalformat=se[c],e.needsFree=!0,a=l,n=n.offset,c=e.width,l=e.height,s=e.channels;for(var p=G.allocType(36193===e.type?5126:e.type,c*l*s),d=0,m=0;m<l;++m)for(var y=0;y<c;++y)for(var k=0;k<s;++k)p[d++]=r[o*y+h*m+a*k+n];A(e,p)}else if(x(n)===ce||x(n)===fe)x(n)===ce?e.element=n:e.element=n.canvas,e.width=e.element.width,e.height=e.element.height,e.channels=4;else if(x(n)===le)e.element=n,e.width=n.width,e.height=n.height,e.channels=4;else if(x(n)===he)e.element=n,e.width=n.naturalWidth,e.height=n.naturalHeight,e.channels=4;else if(x(n)===pe)e.element=n,e.width=n.videoWidth,e.height=n.videoHeight,e.channels=4;else if(w(n)){for(r=e.width||n[0].length,o=e.height||n.length,h=e.channels,h=v(n[0][0])?h||n[0][0].length:h||1,a=K.shape(n),c=1,l=0;l<a.length;++l)c*=a[l];c=G.allocType(36193===e.type?5126:e.type,c),K.flatten(n,a,"",c),A(e,c),e.alignment=1,e.width=r,e.height=o,e.channels=h,e.format=e.internalformat=se[h],e.needsFree=!0}}else e.width=e.width||1,e.height=e.height||1,e.channels=e.channels||4}function d(t,n,i,o,a){var s=t.element,u=t.data,c=t.internalformat,f=t.format,h=t.type,p=t.width,d=t.height;l(t),s?e.texSubImage2D(n,a,i,o,f,h,s):t.compressed?e.compressedTexSubImage2D(n,a,i,o,c,p,d,u):t.needsCopy?(r(),e.copyTexSubImage2D(n,a,i,o,t.xOffset,t.yOffset,p,d)):e.texSubImage2D(n,a,i,o,p,d,f,h,u)}function m(){return de.pop()||new h}function y(e){e.needsFree&&G.freeType(e.data),h.call(e),de.push(e)}function S(){s.call(this),this.genMipmaps=!1,this.mipmapHint=4352,this.mipmask=0,this.images=Array(16)}function E(e,t,n){var r=e.images[0]=m();e.mipmask=1,r.width=e.width=t,r.height=e.height=n,r.channels=e.channels=4}function j(e,t){var n=null;if(_(t))c(n=e.images[0]=m(),e),p(n,t),e.mipmask=1;else if(f(e,t),Array.isArray(t.mipmap))for(var r=t.mipmap,i=0;i<r.length;++i)c(n=e.images[i]=m(),e),n.width>>=i,n.height>>=i,p(n,r[i]),e.mipmask|=1<<i;else c(n=e.images[0]=m(),e),p(n,t),e.mipmask=1;c(e,e.images[0])}function T(t,n){for(var i=t.images,o=0;o<i.length&&i[o];++o){var a=i[o],s=n,u=o,c=a.element,f=a.data,h=a.internalformat,p=a.format,d=a.type,m=a.width,g=a.height,v=a.channels;l(a),c?e.texImage2D(s,u,p,p,d,c):a.compressed?e.compressedTexImage2D(s,u,h,m,g,0,f):a.needsCopy?(r(),e.copyTexImage2D(s,u,p,a.xOffset,a.yOffset,m,g,0)):((a=!f)&&(f=G.zero.allocType(d,m*g*v)),e.texImage2D(s,u,p,m,g,0,p,d,f),a&&f&&G.zero.freeType(f))}}function C(){var e=me.pop()||new S;s.call(e);for(var t=e.mipmask=0;16>t;++t)e.images[t]=null;return e}function O(e){for(var t=e.images,n=0;n<t.length;++n)t[n]&&y(t[n]),t[n]=null;me.push(e)}function M(){this.magFilter=this.minFilter=9728,this.wrapT=this.wrapS=33071,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=4352}function F(e,t){"min"in t&&(e.minFilter=N[t.min],0<=ae.indexOf(e.minFilter)&&!("faces"in t)&&(e.genMipmaps=!0)),"mag"in t&&(e.magFilter=U[t.mag]);var n=e.wrapS,r=e.wrapT;if("wrap"in t){var i=t.wrap;"string"==typeof i?n=r=z[i]:Array.isArray(i)&&(n=z[i[0]],r=z[i[1]])}else"wrapS"in t&&(n=z[t.wrapS]),"wrapT"in t&&(r=z[t.wrapT]);if(e.wrapS=n,e.wrapT=r,"anisotropic"in t&&(e.anisotropic=t.anisotropic),"mipmap"in t){switch(n=!1,typeof t.mipmap){case"string":e.mipmapHint=I[t.mipmap],n=e.genMipmaps=!0;break;case"boolean":n=e.genMipmaps=t.mipmap;break;case"object":e.genMipmaps=!1,n=!0}!n||"min"in t||(e.minFilter=9984)}}function D(n,r){e.texParameteri(r,10241,n.minFilter),e.texParameteri(r,10240,n.magFilter),e.texParameteri(r,10242,n.wrapS),e.texParameteri(r,10243,n.wrapT),t.ext_texture_filter_anisotropic&&e.texParameteri(r,34046,n.anisotropic),n.genMipmaps&&(e.hint(33170,n.mipmapHint),e.generateMipmap(r))}function L(t){s.call(this),this.mipmask=0,this.internalformat=6408,this.id=ge++,this.refCount=1,this.target=t,this.texture=e.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new M,a.profile&&(this.stats={size:0})}function P(t){e.activeTexture(33984),e.bindTexture(t.target,t.texture)}function B(){var t=be[0];t?e.bindTexture(t.target,t.texture):e.bindTexture(3553,null)}function R(t){var n=t.texture,r=t.unit,i=t.target;0<=r&&(e.activeTexture(33984+r),e.bindTexture(i,null),be[r]=null),e.deleteTexture(n),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete ve[t.id],o.textureCount--}var I={"don't care":4352,"dont care":4352,nice:4354,fast:4353},z={repeat:10497,clamp:33071,mirror:33648},U={nearest:9728,linear:9729},N=q({mipmap:9987,"nearest mipmap nearest":9984,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":9987},U),H={none:0,browser:37444},$={uint8:5121,rgba4:32819,rgb565:33635,"rgb5 a1":32820},W={alpha:6406,luminance:6409,"luminance alpha":6410,rgb:6407,rgba:6408,rgba4:32854,"rgb5 a1":32855,rgb565:36194},X={};t.ext_srgb&&(W.srgb=35904,W.srgba=35906),t.oes_texture_float&&($.float32=$.float=5126),t.oes_texture_half_float&&($.float16=$["half float"]=36193),t.webgl_depth_texture&&(q(W,{depth:6402,"depth stencil":34041}),q($,{uint16:5123,uint32:5125,"depth stencil":34042})),t.webgl_compressed_texture_s3tc&&q(X,{"rgb s3tc dxt1":33776,"rgba s3tc dxt1":33777,"rgba s3tc dxt3":33778,"rgba s3tc dxt5":33779}),t.webgl_compressed_texture_atc&&q(X,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),t.webgl_compressed_texture_pvrtc&&q(X,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),t.webgl_compressed_texture_etc1&&(X["rgb etc1"]=36196);var Z=Array.prototype.slice.call(e.getParameter(34467));Object.keys(X).forEach((function(e){var t=X[e];0<=Z.indexOf(t)&&(W[e]=t)}));var J=Object.keys(W);n.textureFormats=J;var ee=[];Object.keys(W).forEach((function(e){ee[W[e]]=e}));var te=[];Object.keys($).forEach((function(e){te[$[e]]=e}));var ne=[];Object.keys(U).forEach((function(e){ne[U[e]]=e}));var re=[];Object.keys(N).forEach((function(e){re[N[e]]=e}));var ie=[];Object.keys(z).forEach((function(e){ie[z[e]]=e}));var oe=J.reduce((function(e,t){var n=W[t];return 6409===n||6406===n||6409===n||6410===n||6402===n||34041===n?e[n]=n:32855===n||0<=t.indexOf("rgba")?e[n]=6408:e[n]=6407,e}),{}),de=[],me=[],ge=0,ve={},ye=n.maxTextureUnits,be=Array(ye).map((function(){return null}));return q(L.prototype,{bind:function(){this.bindCount+=1;var t=this.unit;if(0>t){for(var n=0;n<ye;++n){var r=be[n];if(r){if(0<r.bindCount)continue;r.unit=-1}be[n]=this,t=n;break}a.profile&&o.maxTextureUnits<t+1&&(o.maxTextureUnits=t+1),this.unit=t,e.activeTexture(33984+t),e.bindTexture(this.target,this.texture)}return t},unbind:function(){--this.bindCount},decRef:function(){0>=--this.refCount&&R(this)}}),a.profile&&(o.getTotalTextureSize=function(){var e=0;return Object.keys(ve).forEach((function(t){e+=ve[t].stats.size})),e}),{create2D:function(t,n){function r(e,t){var n=i.texInfo;M.call(n);var o=C();return"number"==typeof e?E(o,0|e,"number"==typeof t?0|t:0|e):e?(F(n,e),j(o,e)):E(o,1,1),n.genMipmaps&&(o.mipmask=(o.width<<1)-1),i.mipmask=o.mipmask,c(i,o),i.internalformat=o.internalformat,r.width=o.width,r.height=o.height,P(i),T(o,3553),D(n,3553),B(),O(o),a.profile&&(i.stats.size=k(i.internalformat,i.type,o.width,o.height,n.genMipmaps,!1)),r.format=ee[i.internalformat],r.type=te[i.type],r.mag=ne[n.magFilter],r.min=re[n.minFilter],r.wrapS=ie[n.wrapS],r.wrapT=ie[n.wrapT],r}var i=new L(3553);return ve[i.id]=i,o.textureCount++,r(t,n),r.subimage=function(e,t,n,o){t|=0,n|=0,o|=0;var a=m();return c(a,i),a.width=0,a.height=0,p(a,e),a.width=a.width||(i.width>>o)-t,a.height=a.height||(i.height>>o)-n,P(i),d(a,3553,t,n,o),B(),y(a),r},r.resize=function(t,n){var o=0|t,s=0|n||o;if(o===i.width&&s===i.height)return r;r.width=i.width=o,r.height=i.height=s,P(i);for(var u,c=i.channels,f=i.type,l=0;i.mipmask>>l;++l){var h=o>>l,p=s>>l;if(!h||!p)break;u=G.zero.allocType(f,h*p*c),e.texImage2D(3553,l,i.format,h,p,0,i.format,i.type,u),u&&G.zero.freeType(u)}return B(),a.profile&&(i.stats.size=k(i.internalformat,i.type,o,s,!1,!1)),r},r._reglType="texture2d",r._texture=i,a.profile&&(r.stats=i.stats),r.destroy=function(){i.decRef()},r},createCube:function(t,n,r,i,s,u){function l(e,t,n,r,i,o){var s,u=h.texInfo;for(M.call(u),s=0;6>s;++s)g[s]=C();if("number"!=typeof e&&e){if("object"==typeof e)if(t)j(g[0],e),j(g[1],t),j(g[2],n),j(g[3],r),j(g[4],i),j(g[5],o);else if(F(u,e),f(h,e),"faces"in e)for(e=e.faces,s=0;6>s;++s)c(g[s],h),j(g[s],e[s]);else for(s=0;6>s;++s)j(g[s],e)}else for(e=0|e||1,s=0;6>s;++s)E(g[s],e,e);for(c(h,g[0]),h.mipmask=u.genMipmaps?(g[0].width<<1)-1:g[0].mipmask,h.internalformat=g[0].internalformat,l.width=g[0].width,l.height=g[0].height,P(h),s=0;6>s;++s)T(g[s],34069+s);for(D(u,34067),B(),a.profile&&(h.stats.size=k(h.internalformat,h.type,l.width,l.height,u.genMipmaps,!0)),l.format=ee[h.internalformat],l.type=te[h.type],l.mag=ne[u.magFilter],l.min=re[u.minFilter],l.wrapS=ie[u.wrapS],l.wrapT=ie[u.wrapT],s=0;6>s;++s)O(g[s]);return l}var h=new L(34067);ve[h.id]=h,o.cubeCount++;var g=Array(6);return l(t,n,r,i,s,u),l.subimage=function(e,t,n,r,i){n|=0,r|=0,i|=0;var o=m();return c(o,h),o.width=0,o.height=0,p(o,t),o.width=o.width||(h.width>>i)-n,o.height=o.height||(h.height>>i)-r,P(h),d(o,34069+e,n,r,i),B(),y(o),l},l.resize=function(t){if((t|=0)!==h.width){l.width=h.width=t,l.height=h.height=t,P(h);for(var n=0;6>n;++n)for(var r=0;h.mipmask>>r;++r)e.texImage2D(34069+n,r,h.format,t>>r,t>>r,0,h.format,h.type,null);return B(),a.profile&&(h.stats.size=k(h.internalformat,h.type,l.width,l.height,!1,!0)),l}},l._reglType="textureCube",l._texture=h,a.profile&&(l.stats=h.stats),l.destroy=function(){h.decRef()},l},clear:function(){for(var t=0;t<ye;++t)e.activeTexture(33984+t),e.bindTexture(3553,null),be[t]=null;V(ve).forEach(R),o.cubeCount=0,o.textureCount=0},getTexture:function(e){return null},restore:function(){for(var t=0;t<ye;++t){var n=be[t];n&&(n.bindCount=0,n.unit=-1,be[t]=null)}V(ve).forEach((function(t){t.texture=e.createTexture(),e.bindTexture(t.target,t.texture);for(var n=0;32>n;++n)if(0!=(t.mipmask&1<<n))if(3553===t.target)e.texImage2D(3553,n,t.internalformat,t.width>>n,t.height>>n,0,t.internalformat,t.type,null);else for(var r=0;6>r;++r)e.texImage2D(34069+r,n,t.internalformat,t.width>>n,t.height>>n,0,t.internalformat,t.type,null);D(t.texInfo,t.target)}))}}}function E(e,t,n,r,i,o){function a(e,t,n){this.target=e,this.texture=t,this.renderbuffer=n;var r=e=0;t?(e=t.width,r=t.height):n&&(e=n.width,r=n.height),this.width=e,this.height=r}function s(e){e&&(e.texture&&e.texture._texture.decRef(),e.renderbuffer&&e.renderbuffer._renderbuffer.decRef())}function u(e,t,n){e&&(e.texture?e.texture._texture.refCount+=1:e.renderbuffer._renderbuffer.refCount+=1)}function c(t,n){n&&(n.texture?e.framebufferTexture2D(36160,t,n.target,n.texture._texture.texture,0):e.framebufferRenderbuffer(36160,t,36161,n.renderbuffer._renderbuffer.renderbuffer))}function f(e){var t=3553,n=null,r=null,i=e;return"object"==typeof e&&(i=e.data,"target"in e&&(t=0|e.target)),"texture2d"===(e=i._reglType)||"textureCube"===e?n=i:"renderbuffer"===e&&(r=i,t=36161),new a(t,n,r)}function l(e,t,n,o,s){return n?((e=r.create2D({width:e,height:t,format:o,type:s}))._texture.refCount=0,new a(3553,e,null)):((e=i.create({width:e,height:t,format:o}))._renderbuffer.refCount=0,new a(36161,null,e))}function h(e){return e&&(e.texture||e.renderbuffer)}function p(e,t,n){e&&(e.texture?e.texture.resize(t,n):e.renderbuffer&&e.renderbuffer.resize(t,n),e.width=t,e.height=n)}function d(){this.id=A++,k[this.id]=this,this.framebuffer=e.createFramebuffer(),this.height=this.width=0,this.colorAttachments=[],this.depthStencilAttachment=this.stencilAttachment=this.depthAttachment=null}function m(e){e.colorAttachments.forEach(s),s(e.depthAttachment),s(e.stencilAttachment),s(e.depthStencilAttachment)}function g(t){e.deleteFramebuffer(t.framebuffer),t.framebuffer=null,o.framebufferCount--,delete k[t.id]}function v(t){var r;e.bindFramebuffer(36160,t.framebuffer);var i=t.colorAttachments;for(r=0;r<i.length;++r)c(36064+r,i[r]);for(r=i.length;r<n.maxColorAttachments;++r)e.framebufferTexture2D(36160,36064+r,3553,null,0);e.framebufferTexture2D(36160,33306,3553,null,0),e.framebufferTexture2D(36160,36096,3553,null,0),e.framebufferTexture2D(36160,36128,3553,null,0),c(36096,t.depthAttachment),c(36128,t.stencilAttachment),c(33306,t.depthStencilAttachment),e.checkFramebufferStatus(36160),e.isContextLost(),e.bindFramebuffer(36160,b.next?b.next.framebuffer:null),b.cur=b.next,e.getError()}function y(e,t){function n(e,t){var i,o=0,a=0,s=!0,c=!0;i=null;var p=!0,d="rgba",g="uint8",y=1,b=null,_=null,A=null,k=!1;"number"==typeof e?(o=0|e,a=0|t||o):e?("shape"in e?(o=(a=e.shape)[0],a=a[1]):("radius"in e&&(o=a=e.radius),"width"in e&&(o=e.width),"height"in e&&(a=e.height)),("color"in e||"colors"in e)&&(i=e.color||e.colors,Array.isArray(i)),i||("colorCount"in e&&(y=0|e.colorCount),"colorTexture"in e&&(p=!!e.colorTexture,d="rgba4"),"colorType"in e&&(g=e.colorType,!p)&&("half float"===g||"float16"===g?d="rgba16f":"float"!==g&&"float32"!==g||(d="rgba32f")),"colorFormat"in e&&(d=e.colorFormat,0<=w.indexOf(d)?p=!0:0<=x.indexOf(d)&&(p=!1))),("depthTexture"in e||"depthStencilTexture"in e)&&(k=!(!e.depthTexture&&!e.depthStencilTexture)),"depth"in e&&("boolean"==typeof e.depth?s=e.depth:(b=e.depth,c=!1)),"stencil"in e&&("boolean"==typeof e.stencil?c=e.stencil:(_=e.stencil,s=!1)),"depthStencil"in e&&("boolean"==typeof e.depthStencil?s=c=e.depthStencil:(A=e.depthStencil,c=s=!1))):o=a=1;var S=null,E=null,j=null,T=null;if(Array.isArray(i))S=i.map(f);else if(i)S=[f(i)];else for(S=Array(y),i=0;i<y;++i)S[i]=l(o,a,p,d,g);for(o=o||S[0].width,a=a||S[0].height,b?E=f(b):s&&!c&&(E=l(o,a,k,"depth","uint32")),_?j=f(_):c&&!s&&(j=l(o,a,!1,"stencil","uint8")),A?T=f(A):!b&&!_&&c&&s&&(T=l(o,a,k,"depth stencil","depth stencil")),s=null,i=0;i<S.length;++i)u(S[i]),S[i]&&S[i].texture&&(c=be[S[i].texture._texture.format]*we[S[i].texture._texture.type],null===s&&(s=c));return u(E),u(j),u(T),m(r),r.width=o,r.height=a,r.colorAttachments=S,r.depthAttachment=E,r.stencilAttachment=j,r.depthStencilAttachment=T,n.color=S.map(h),n.depth=h(E),n.stencil=h(j),n.depthStencil=h(T),n.width=r.width,n.height=r.height,v(r),n}var r=new d;return o.framebufferCount++,n(e,t),q(n,{resize:function(e,t){var i=Math.max(0|e,1),o=Math.max(0|t||i,1);if(i===r.width&&o===r.height)return n;for(var a=r.colorAttachments,s=0;s<a.length;++s)p(a[s],i,o);return p(r.depthAttachment,i,o),p(r.stencilAttachment,i,o),p(r.depthStencilAttachment,i,o),r.width=n.width=i,r.height=n.height=o,v(r),n},_reglType:"framebuffer",_framebuffer:r,destroy:function(){g(r),m(r)},use:function(e){b.setFBO({framebuffer:n},e)}})}var b={cur:null,next:null,dirty:!1,setFBO:null},w=["rgba"],x=["rgba4","rgb565","rgb5 a1"];t.ext_srgb&&x.push("srgba"),t.ext_color_buffer_half_float&&x.push("rgba16f","rgb16f"),t.webgl_color_buffer_float&&x.push("rgba32f");var _=["uint8"];t.oes_texture_half_float&&_.push("half float","float16"),t.oes_texture_float&&_.push("float","float32");var A=0,k={};return q(b,{getFramebuffer:function(e){return"function"==typeof e&&"framebuffer"===e._reglType&&(e=e._framebuffer)instanceof d?e:null},create:y,createCube:function(e){function t(e){var i,o={color:null},a=0,s=null;i="rgba";var u="uint8",c=1;if("number"==typeof e?a=0|e:e?("shape"in e?a=e.shape[0]:("radius"in e&&(a=0|e.radius),"width"in e?a=0|e.width:"height"in e&&(a=0|e.height)),("color"in e||"colors"in e)&&(s=e.color||e.colors,Array.isArray(s)),s||("colorCount"in e&&(c=0|e.colorCount),"colorType"in e&&(u=e.colorType),"colorFormat"in e&&(i=e.colorFormat)),"depth"in e&&(o.depth=e.depth),"stencil"in e&&(o.stencil=e.stencil),"depthStencil"in e&&(o.depthStencil=e.depthStencil)):a=1,s)if(Array.isArray(s))for(e=[],i=0;i<s.length;++i)e[i]=s[i];else e=[s];else for(e=Array(c),s={radius:a,format:i,type:u},i=0;i<c;++i)e[i]=r.createCube(s);for(o.color=Array(e.length),i=0;i<e.length;++i)c=e[i],a=a||c.width,o.color[i]={target:34069,data:e[i]};for(i=0;6>i;++i){for(c=0;c<e.length;++c)o.color[c].target=34069+i;0<i&&(o.depth=n[0].depth,o.stencil=n[0].stencil,o.depthStencil=n[0].depthStencil),n[i]?n[i](o):n[i]=y(o)}return q(t,{width:a,height:a,color:e})}var n=Array(6);return t(e),q(t,{faces:n,resize:function(e){var r=0|e;if(r===t.width)return t;var i=t.color;for(e=0;e<i.length;++e)i[e].resize(r);for(e=0;6>e;++e)n[e].resize(r);return t.width=t.height=r,t},_reglType:"framebufferCube",destroy:function(){n.forEach((function(e){e.destroy()}))}})},clear:function(){V(k).forEach(g)},restore:function(){b.cur=null,b.next=null,b.dirty=!0,V(k).forEach((function(t){t.framebuffer=e.createFramebuffer(),v(t)}))}})}function j(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function T(e,t,n,r){function i(e,t,n,r){this.name=e,this.id=t,this.location=n,this.info=r}function o(e,t){for(var n=0;n<e.length;++n)if(e[n].id===t.id)return void(e[n].location=t.location);e.push(t)}function a(n,r,i){if(!(a=(i=35632===n?c:f)[r])){var o=t.str(r),a=e.createShader(n);e.shaderSource(a,o),e.compileShader(a),i[r]=a}return a}function s(e,t){this.id=p++,this.fragId=e,this.vertId=t,this.program=null,this.uniforms=[],this.attributes=[],r.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function u(n,s){var u,c;u=a(35632,n.fragId),c=a(35633,n.vertId);var f=n.program=e.createProgram();e.attachShader(f,u),e.attachShader(f,c),e.linkProgram(f);var l=e.getProgramParameter(f,35718);r.profile&&(n.stats.uniformsCount=l);var h=n.uniforms;for(u=0;u<l;++u)if(c=e.getActiveUniform(f,u))if(1<c.size)for(var p=0;p<c.size;++p){var d=c.name.replace("[0]","["+p+"]");o(h,new i(d,t.id(d),e.getUniformLocation(f,d),c))}else o(h,new i(c.name,t.id(c.name),e.getUniformLocation(f,c.name),c));for(l=e.getProgramParameter(f,35721),r.profile&&(n.stats.attributesCount=l),h=n.attributes,u=0;u<l;++u)(c=e.getActiveAttrib(f,u))&&o(h,new i(c.name,t.id(c.name),e.getAttribLocation(f,c.name),c))}var c={},f={},l={},h=[],p=0;return r.profile&&(n.getMaxUniformsCount=function(){var e=0;return h.forEach((function(t){t.stats.uniformsCount>e&&(e=t.stats.uniformsCount)})),e},n.getMaxAttributesCount=function(){var e=0;return h.forEach((function(t){t.stats.attributesCount>e&&(e=t.stats.attributesCount)})),e}),{clear:function(){var t=e.deleteShader.bind(e);V(c).forEach(t),c={},V(f).forEach(t),f={},h.forEach((function(t){e.deleteProgram(t.program)})),h.length=0,l={},n.shaderCount=0},program:function(e,t,r){var i=l[t];i||(i=l[t]={});var o=i[e];return o||(o=new s(t,e),n.shaderCount++,u(o),i[e]=o,h.push(o)),o},restore:function(){c={},f={};for(var e=0;e<h.length;++e)u(h[e])},shader:a,frag:-1,vert:-1}}function C(e,t,n,r,i,o,a){function s(i){var o;o=null===t.next?5121:t.next.colorAttachments[0].texture._texture.type;var a=0,s=0,u=r.framebufferWidth,c=r.framebufferHeight,f=null;return Y(i)?f=i:i&&(a=0|i.x,s=0|i.y,u=0|(i.width||r.framebufferWidth-a),c=0|(i.height||r.framebufferHeight-s),f=i.data||null),n(),i=u*c*4,f||(5121===o?f=new Uint8Array(i):5126===o&&(f=f||new Float32Array(i))),e.pixelStorei(3333,4),e.readPixels(a,s,u,c,6408,o,f),f}return function(e){return e&&"framebuffer"in e?function(e){var n;return t.setFBO({framebuffer:e.framebuffer},(function(){n=s(e)})),n}(e):s(e)}}function O(e){return Array.prototype.slice.call(e)}function M(e){return O(e).join("")}function F(){function e(){var e=[],t=[];return q((function(){e.push.apply(e,O(arguments))}),{def:function(){var r="v"+n++;return t.push(r),0<arguments.length&&(e.push(r,"="),e.push.apply(e,O(arguments)),e.push(";")),r},toString:function(){return M([0<t.length?"var "+t+";":"",M(e)])}})}function t(){function t(e,t){r(e,t,"=",n.def(e,t),";")}var n=e(),r=e(),i=n.toString,o=r.toString;return q((function(){n.apply(n,O(arguments))}),{def:n.def,entry:n,exit:r,save:t,set:function(e,r,i){t(e,r),n(e,r,"=",i,";")},toString:function(){return i()+o()}})}var n=0,r=[],i=[],o=e(),a={};return{global:o,link:function(e){for(var t=0;t<i.length;++t)if(i[t]===e)return r[t];return t="g"+n++,r.push(t),i.push(e),t},block:e,proc:function(e,n){function r(){var e="a"+i.length;return i.push(e),e}var i=[];n=n||0;for(var o=0;o<n;++o)r();var s=(o=t()).toString;return a[e]=q(o,{arg:r,toString:function(){return M(["function(",i.join(),"){",s(),"}"])}})},scope:t,cond:function(){var e=M(arguments),n=t(),r=t(),i=n.toString,o=r.toString;return q(n,{then:function(){return n.apply(n,O(arguments)),this},else:function(){return r.apply(r,O(arguments)),this},toString:function(){var t=o();return t&&(t="else{"+t+"}"),M(["if(",e,"){",i(),"}",t])}})},compile:function(){var e=['"use strict";',o,"return {"];Object.keys(a).forEach((function(t){e.push('"',t,'":',a[t].toString(),",")})),e.push("}");var t=M(e).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");return Function.apply(null,r.concat(t)).apply(null,i)}}}function D(e){return Array.isArray(e)||Y(e)||u(e)}function L(e){return e.sort((function(e,t){return"viewport"===e?-1:"viewport"===t?1:e<t?-1:1}))}function P(e,t,n,r){this.thisDep=e,this.contextDep=t,this.propDep=n,this.append=r}function B(e){return e&&!(e.thisDep||e.contextDep||e.propDep)}function R(e){return new P(!1,!1,!1,e)}function I(e,t){var n=e.type;return 0===n?new P(!0,1<=(n=e.data.length),2<=n,t):4===n?new P((n=e.data).thisDep,n.contextDep,n.propDep,t):new P(3===n,2===n,1===n,t)}function z(e,t,n,r,i,a,s,u,c,f,l,h,p,d,m){function g(e){return e.replace(".","_")}function y(e,t,n){var r=g(e);te.push(e),ee[r]=J[r]=!!n,ne[r]=t}function b(e,t,n){var r=g(e);te.push(e),Array.isArray(n)?(J[r]=n.slice(),ee[r]=n.slice()):J[r]=ee[r]=n,ie[r]=t}function w(){var e=F(),n=e.link,r=e.global;e.id=se++,e.batchId="0";var i=n(oe),o=e.shared={props:"a0"};Object.keys(oe).forEach((function(e){o[e]=r.def(i,".",e)}));var a=e.next={},s=e.current={};Object.keys(ie).forEach((function(e){Array.isArray(J[e])&&(a[e]=r.def(o.next,".",e),s[e]=r.def(o.current,".",e))}));var u=e.constants={};Object.keys(ae).forEach((function(e){u[e]=r.def(JSON.stringify(ae[e]))})),e.invoke=function(t,r){switch(r.type){case 0:var i=["this",o.context,o.props,e.batchId];return t.def(n(r.data),".call(",i.slice(0,Math.max(r.data.length+1,4)),")");case 1:return t.def(o.props,r.data);case 2:return t.def(o.context,r.data);case 3:return t.def("this",r.data);case 4:return r.data.append(e,t),r.data.ref}},e.attribCache={};var c={};return e.scopeAttrib=function(e){if((e=t.id(e))in c)return c[e];var r=f.scope[e];return r||(r=f.scope[e]=new Y),c[e]=n(r)},e}function x(e,t){var n=e.static,r=e.dynamic;if("framebuffer"in n){var i=n.framebuffer;return i?(i=u.getFramebuffer(i),R((function(e,t){var n=e.link(i),r=e.shared;return t.set(r.framebuffer,".next",n),r=r.context,t.set(r,".framebufferWidth",n+".width"),t.set(r,".framebufferHeight",n+".height"),n}))):R((function(e,t){var n=e.shared;return t.set(n.framebuffer,".next","null"),n=n.context,t.set(n,".framebufferWidth",n+".drawingBufferWidth"),t.set(n,".framebufferHeight",n+".drawingBufferHeight"),"null"}))}if("framebuffer"in r){var o=r.framebuffer;return I(o,(function(e,t){var n=e.invoke(t,o),r=e.shared,i=r.framebuffer;return n=t.def(i,".getFramebuffer(",n,")"),t.set(i,".next",n),r=r.context,t.set(r,".framebufferWidth",n+"?"+n+".width:"+r+".drawingBufferWidth"),t.set(r,".framebufferHeight",n+"?"+n+".height:"+r+".drawingBufferHeight"),n}))}return null}function _(e){function n(e){if(e in r){var n=t.id(r[e]);return(e=R((function(){return n}))).id=n,e}if(e in i){var o=i[e];return I(o,(function(e,t){var n=e.invoke(t,o);return t.def(e.shared.strings,".id(",n,")")}))}return null}var r=e.static,i=e.dynamic,o=n("frag"),a=n("vert"),s=null;return B(o)&&B(a)?(s=l.program(a.id,o.id),e=R((function(e,t){return e.link(s)}))):e=new P(o&&o.thisDep||a&&a.thisDep,o&&o.contextDep||a&&a.contextDep,o&&o.propDep||a&&a.propDep,(function(e,t){var n,r,i=e.shared.shader;return n=o?o.append(e,t):t.def(i,".","frag"),r=a?a.append(e,t):t.def(i,".","vert"),t.def(i+".program("+r+","+n+")")})),{frag:o,vert:a,progVar:e,program:s}}function A(e,t){function n(e,t){if(e in r){var n=0|r[e];return R((function(e,r){return t&&(e.OFFSET=n),n}))}if(e in i){var a=i[e];return I(a,(function(e,n){var r=e.invoke(n,a);return t&&(e.OFFSET=r),r}))}return t&&o?R((function(e,t){return e.OFFSET="0",0})):null}var r=e.static,i=e.dynamic,o=function(){if("elements"in r){var e=r.elements;D(e)?e=a.getElements(a.create(e,!0)):e&&(e=a.getElements(e));var t=R((function(t,n){if(e){var r=t.link(e);return t.ELEMENTS=r}return t.ELEMENTS=null}));return t.value=e,t}if("elements"in i){var n=i.elements;return I(n,(function(e,t){var r=(i=e.shared).isBufferArgs,i=i.elements,o=e.invoke(t,n),a=t.def("null");return r=t.def(r,"(",o,")"),o=e.cond(r).then(a,"=",i,".createStream(",o,");").else(a,"=",i,".getElements(",o,");"),t.entry(o),t.exit(e.cond(r).then(i,".destroyStream(",a,");")),e.ELEMENTS=a}))}return null}(),s=n("offset",!0);return{elements:o,primitive:function(){if("primitive"in r){var e=r.primitive;return R((function(t,n){return re[e]}))}if("primitive"in i){var t=i.primitive;return I(t,(function(e,n){var r=e.constants.primTypes,i=e.invoke(n,t);return n.def(r,"[",i,"]")}))}return o?B(o)?o.value?R((function(e,t){return t.def(e.ELEMENTS,".primType")})):R((function(){return 4})):new P(o.thisDep,o.contextDep,o.propDep,(function(e,t){var n=e.ELEMENTS;return t.def(n,"?",n,".primType:",4)})):null}(),count:function(){if("count"in r){var e=0|r.count;return R((function(){return e}))}if("count"in i){var t=i.count;return I(t,(function(e,n){return e.invoke(n,t)}))}return o?B(o)?o?s?new P(s.thisDep,s.contextDep,s.propDep,(function(e,t){return t.def(e.ELEMENTS,".vertCount-",e.OFFSET)})):R((function(e,t){return t.def(e.ELEMENTS,".vertCount")})):R((function(){return-1})):new P(o.thisDep||s.thisDep,o.contextDep||s.contextDep,o.propDep||s.propDep,(function(e,t){var n=e.ELEMENTS;return e.OFFSET?t.def(n,"?",n,".vertCount-",e.OFFSET,":-1"):t.def(n,"?",n,".vertCount:-1")})):null}(),instances:n("instances",!1),offset:s}}function k(e,n){var r=e.static,o=e.dynamic,a={};return Object.keys(r).forEach((function(e){var n=r[e],o=t.id(e),s=new Y;if(D(n))s.state=1,s.buffer=i.getBuffer(i.create(n,34962,!1,!0)),s.type=0;else if(c=i.getBuffer(n))s.state=1,s.buffer=c,s.type=0;else if("constant"in n){var u=n.constant;s.buffer="null",s.state=2,"number"==typeof u?s.x=u:xe.forEach((function(e,t){t<u.length&&(s[e]=u[t])}))}else{var c=D(n.buffer)?i.getBuffer(i.create(n.buffer,34962,!1,!0)):i.getBuffer(n.buffer),f=0|n.offset,l=0|n.stride,h=0|n.size,p=!!n.normalized,d=0;"type"in n&&(d=Z[n.type]),n=0|n.divisor,s.buffer=c,s.state=1,s.size=h,s.normalized=p,s.type=d||c.dtype,s.offset=f,s.stride=l,s.divisor=n}a[e]=R((function(e,t){var n=e.attribCache;if(o in n)return n[o];var r={isStream:!1};return Object.keys(s).forEach((function(e){r[e]=s[e]})),s.buffer&&(r.buffer=e.link(s.buffer),r.type=r.type||r.buffer+".dtype"),n[o]=r}))})),Object.keys(o).forEach((function(e){var t=o[e];a[e]=I(t,(function(e,n){function r(e){n(u[e],"=",i,".",e,"|0;")}var i=e.invoke(n,t),o=e.shared,a=o.isBufferArgs,s=o.buffer,u={isStream:n.def(!1)},c=new Y;c.state=1,Object.keys(c).forEach((function(e){u[e]=n.def(""+c[e])}));var f=u.buffer,l=u.type;return n("if(",a,"(",i,")){",u.isStream,"=true;",f,"=",s,".createStream(",34962,",",i,");",l,"=",f,".dtype;","}else{",f,"=",s,".getBuffer(",i,");","if(",f,"){",l,"=",f,".dtype;",'}else if("constant" in ',i,"){",u.state,"=",2,";","if(typeof "+i+'.constant === "number"){',u[xe[0]],"=",i,".constant;",xe.slice(1).map((function(e){return u[e]})).join("="),"=0;","}else{",xe.map((function(e,t){return u[e]+"="+i+".constant.length>"+t+"?"+i+".constant["+t+"]:0;"})).join(""),"}}else{","if(",a,"(",i,".buffer)){",f,"=",s,".createStream(",34962,",",i,".buffer);","}else{",f,"=",s,".getBuffer(",i,".buffer);","}",l,'="type" in ',i,"?",o.glTypes,"[",i,".type]:",f,".dtype;",u.normalized,"=!!",i,".normalized;"),r("size"),r("offset"),r("stride"),r("divisor"),n("}}"),n.exit("if(",u.isStream,"){",s,".destroyStream(",f,");","}"),u}))})),a}function S(e,t,n){var r=e.shared.context,i=e.scope();Object.keys(n).forEach((function(o){t.save(r,"."+o),i(r,".",o,"=",n[o].append(e,t),";")})),t(i)}function E(e,t,n,r){var i,o=(s=e.shared).gl,a=s.framebuffer;Q&&(i=t.def(s.extensions,".webgl_draw_buffers"));var s=(u=e.constants).drawBuffer,u=u.backBuffer;e=n?n.append(e,t):t.def(a,".next"),r||t("if(",e,"!==",a,".cur){"),t("if(",e,"){",o,".bindFramebuffer(",36160,",",e,".framebuffer);"),Q&&t(i,".drawBuffersWEBGL(",s,"[",e,".colorAttachments.length]);"),t("}else{",o,".bindFramebuffer(",36160,",null);"),Q&&t(i,".drawBuffersWEBGL(",u,");"),t("}",a,".cur=",e,";"),r||t("}")}function j(e,t,n){var r=e.shared,i=r.gl,a=e.current,s=e.next,u=r.current,c=r.next,f=e.cond(u,".dirty");te.forEach((function(t){var r,l;if(!((t=g(t))in n.state))if(t in s){r=s[t],l=a[t];var h=o(J[t].length,(function(e){return f.def(r,"[",e,"]")}));f(e.cond(h.map((function(e,t){return e+"!=="+l+"["+t+"]"})).join("||")).then(i,".",ie[t],"(",h,");",h.map((function(e,t){return l+"["+t+"]="+e})).join(";"),";"))}else r=f.def(c,".",t),h=e.cond(r,"!==",u,".",t),f(h),t in ne?h(e.cond(r).then(i,".enable(",ne[t],");").else(i,".disable(",ne[t],");"),u,".",t,"=",r,";"):h(i,".",ie[t],"(",r,");",u,".",t,"=",r,";")})),0===Object.keys(n.state).length&&f(u,".dirty=false;"),t(f)}function T(e,t,n,r){var i=e.shared,o=e.current,a=i.current,s=i.gl;L(Object.keys(n)).forEach((function(i){var u=n[i];if(!r||r(u)){var c=u.append(e,t);if(ne[i]){var f=ne[i];B(u)?t(s,c?".enable(":".disable(",f,");"):t(e.cond(c).then(s,".enable(",f,");").else(s,".disable(",f,");")),t(a,".",i,"=",c,";")}else if(v(c)){var l=o[i];t(s,".",ie[i],"(",c,");",c.map((function(e,t){return l+"["+t+"]="+e})).join(";"),";")}else t(s,".",ie[i],"(",c,");",a,".",i,"=",c,";")}}))}function C(e,t){K&&(e.instancing=t.def(e.shared.extensions,".angle_instanced_arrays"))}function O(e,t,n,r,i){function o(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function a(e){e(c=t.def(),"=",o(),";"),"string"==typeof i?e(h,".count+=",i,";"):e(h,".count++;"),d&&(r?e(f=t.def(),"=",m,".getNumPendingQueries();"):e(m,".beginQuery(",h,");"))}function s(e){e(h,".cpuTime+=",o(),"-",c,";"),d&&(r?e(m,".pushScopeStats(",f,",",m,".getNumPendingQueries(),",h,");"):e(m,".endQuery();"))}function u(e){var n=t.def(p,".profile");t(p,".profile=",e,";"),t.exit(p,".profile=",n,";")}var c,f,l=e.shared,h=e.stats,p=l.current,m=l.timer;if(n=n.profile){if(B(n))return void(n.enable?(a(t),s(t.exit),u("true")):u("false"));u(n=n.append(e,t))}else n=t.def(p,".profile");a(l=e.block()),t("if(",n,"){",l,"}"),s(e=e.block()),t.exit("if(",n,"){",e,"}")}function M(e,t,n,r,i){function o(n,r,i){function o(){t("if(!",f,".buffer){",u,".enableVertexAttribArray(",c,");}");var n,o=i.type;n=i.size?t.def(i.size,"||",r):r,t("if(",f,".type!==",o,"||",f,".size!==",n,"||",p.map((function(e){return f+"."+e+"!=="+i[e]})).join("||"),"){",u,".bindBuffer(",34962,",",l,".buffer);",u,".vertexAttribPointer(",[c,n,o,i.normalized,i.stride,i.offset],");",f,".type=",o,";",f,".size=",n,";",p.map((function(e){return f+"."+e+"="+i[e]+";"})).join(""),"}"),K&&(o=i.divisor,t("if(",f,".divisor!==",o,"){",e.instancing,".vertexAttribDivisorANGLE(",[c,o],");",f,".divisor=",o,";}"))}function s(){t("if(",f,".buffer){",u,".disableVertexAttribArray(",c,");","}if(",xe.map((function(e,t){return f+"."+e+"!=="+h[t]})).join("||"),"){",u,".vertexAttrib4f(",c,",",h,");",xe.map((function(e,t){return f+"."+e+"="+h[t]+";"})).join(""),"}")}var u=a.gl,c=t.def(n,".location"),f=t.def(a.attributes,"[",c,"]");n=i.state;var l=i.buffer,h=[i.x,i.y,i.z,i.w],p=["buffer","normalized","offset","stride"];1===n?o():2===n?s():(t("if(",n,"===",1,"){"),o(),t("}else{"),s(),t("}"))}var a=e.shared;r.forEach((function(r){var a,s=r.name,u=n.attributes[s];if(u){if(!i(u))return;a=u.append(e,t)}else{if(!i(je))return;var c=e.scopeAttrib(s);a={},Object.keys(new Y).forEach((function(e){a[e]=t.def(c,".",e)}))}o(e.link(r),function(e){switch(e){case 35664:case 35667:case 35671:return 2;case 35665:case 35668:case 35672:return 3;case 35666:case 35669:case 35673:return 4;default:return 1}}(r.info.type),a)}))}function z(e,n,r,i,a){for(var s,u=e.shared,c=u.gl,f=0;f<i.length;++f){var l,h=(m=i[f]).name,p=m.info.type,d=r.uniforms[h],m=e.link(m)+".location";if(d){if(!a(d))continue;if(B(d)){if(h=d.value,35678===p||35680===p)n(c,".uniform1i(",m,",",(p=e.link(h._texture||h.color[0]._texture))+".bind());"),n.exit(p,".unbind();");else if(35674===p||35675===p||35676===p)d=2,35675===p?d=3:35676===p&&(d=4),n(c,".uniformMatrix",d,"fv(",m,",false,",h=e.global.def("new Float32Array(["+Array.prototype.slice.call(h)+"])"),");");else{switch(p){case 5126:s="1f";break;case 35664:s="2f";break;case 35665:s="3f";break;case 35666:s="4f";break;case 35670:case 5124:s="1i";break;case 35671:case 35667:s="2i";break;case 35672:case 35668:s="3i";break;case 35673:case 35669:s="4i"}n(c,".uniform",s,"(",m,",",v(h)?Array.prototype.slice.call(h):h,");")}continue}l=d.append(e,n)}else{if(!a(je))continue;l=n.def(u.uniforms,"[",t.id(h),"]")}switch(35678===p?n("if(",l,"&&",l,'._reglType==="framebuffer"){',l,"=",l,".color[0];","}"):35680===p&&n("if(",l,"&&",l,'._reglType==="framebufferCube"){',l,"=",l,".color[0];","}"),h=1,p){case 35678:case 35680:p=n.def(l,"._texture"),n(c,".uniform1i(",m,",",p,".bind());"),n.exit(p,".unbind();");continue;case 5124:case 35670:s="1i";break;case 35667:case 35671:s="2i",h=2;break;case 35668:case 35672:s="3i",h=3;break;case 35669:case 35673:s="4i",h=4;break;case 5126:s="1f";break;case 35664:s="2f",h=2;break;case 35665:s="3f",h=3;break;case 35666:s="4f",h=4;break;case 35674:s="Matrix2fv";break;case 35675:s="Matrix3fv";break;case 35676:s="Matrix4fv"}if(n(c,".uniform",s,"(",m,","),"M"===s.charAt(0)){m=Math.pow(p-35674+2,2);var g=e.global.def("new Float32Array(",m,")");n("false,(Array.isArray(",l,")||",l," instanceof Float32Array)?",l,":(",o(m,(function(e){return g+"["+e+"]="+l+"["+e+"]"})),",",g,")")}else n(1<h?o(h,(function(e){return l+"["+e+"]"})):l);n(");")}}function U(e,t,n,r){function i(i){var o=h[i];return o?o.contextDep&&r.contextDynamic||o.propDep?o.append(e,n):o.append(e,t):t.def(l,".",i)}function o(){function e(){n(u,".drawElementsInstancedANGLE(",[d,g,v,m+"<<(("+v+"-5121)>>1)",s],");")}function t(){n(u,".drawArraysInstancedANGLE(",[d,m,g,s],");")}p?y?e():(n("if(",p,"){"),e(),n("}else{"),t(),n("}")):t()}function a(){function e(){n(f+".drawElements("+[d,g,v,m+"<<(("+v+"-5121)>>1)"]+");")}function t(){n(f+".drawArrays("+[d,m,g]+");")}p?y?e():(n("if(",p,"){"),e(),n("}else{"),t(),n("}")):t()}var s,u,c=e.shared,f=c.gl,l=c.draw,h=r.draw,p=function(){var i=h.elements,o=t;return i?((i.contextDep&&r.contextDynamic||i.propDep)&&(o=n),i=i.append(e,o)):i=o.def(l,".","elements"),i&&o("if("+i+")"+f+".bindBuffer(34963,"+i+".buffer.buffer);"),i}(),d=i("primitive"),m=i("offset"),g=function(){var i=h.count,o=t;return i?((i.contextDep&&r.contextDynamic||i.propDep)&&(o=n),i=i.append(e,o)):i=o.def(l,".","count"),i}();if("number"==typeof g){if(0===g)return}else n("if(",g,"){"),n.exit("}");K&&(s=i("instances"),u=e.instancing);var v=p+".type",y=h.elements&&B(h.elements);K&&("number"!=typeof s||0<=s)?"string"==typeof s?(n("if(",s,">0){"),o(),n("}else if(",s,"<0){"),a(),n("}")):o():a()}function q(e,t,n,r,i){return i=(t=w()).proc("body",i),K&&(t.instancing=i.def(t.shared.extensions,".angle_instanced_arrays")),e(t,i,n,r),t.compile().body}function N(e,t,n,r){C(e,t),M(e,t,n,r.attributes,(function(){return!0})),z(e,t,n,r.uniforms,(function(){return!0})),U(e,t,t,n)}function $(e,t,n,r){function i(){return!0}e.batchId="a1",C(e,t),M(e,t,n,r.attributes,i),z(e,t,n,r.uniforms,i),U(e,t,t,n)}function W(e,t,n,r){function i(e){return e.contextDep&&a||e.propDep}function o(e){return!i(e)}C(e,t);var a=n.contextDep,s=t.def(),u=t.def();e.shared.props=u,e.batchId=s;var c=e.scope(),f=e.scope();t(c.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",u,"=","a0","[",s,"];",f,"}",c.exit),n.needsContext&&S(e,f,n.context),n.needsFramebuffer&&E(e,f,n.framebuffer),T(e,f,n.state,i),n.profile&&i(n.profile)&&O(e,f,n,!1,!0),r?(M(e,c,n,r.attributes,o),M(e,f,n,r.attributes,i),z(e,c,n,r.uniforms,o),z(e,f,n,r.uniforms,i),U(e,c,f,n)):(t=e.global.def("{}"),r=n.shader.progVar.append(e,f),u=f.def(r,".id"),c=f.def(t,"[",u,"]"),f(e.shared.gl,".useProgram(",r,".program);","if(!",c,"){",c,"=",t,"[",u,"]=",e.link((function(t){return q($,e,n,t,2)})),"(",r,");}",c,".call(this,a0[",s,"],",s,");"))}function G(e,n){function r(t){var r=n.shader[t];r&&i.set(o.shader,"."+t,r.append(e,i))}var i=e.proc("scope",3);e.batchId="a2";var o=e.shared,a=o.current;S(e,i,n.context),n.framebuffer&&n.framebuffer.append(e,i),L(Object.keys(n.state)).forEach((function(t){var r=n.state[t].append(e,i);v(r)?r.forEach((function(n,r){i.set(e.next[t],"["+r+"]",n)})):i.set(o.next,"."+t,r)})),O(e,i,n,!0,!0),["elements","offset","count","instances","primitive"].forEach((function(t){var r=n.draw[t];r&&i.set(o.draw,"."+t,""+r.append(e,i))})),Object.keys(n.uniforms).forEach((function(r){i.set(o.uniforms,"["+t.id(r)+"]",n.uniforms[r].append(e,i))})),Object.keys(n.attributes).forEach((function(t){var r=n.attributes[t].append(e,i),o=e.scopeAttrib(t);Object.keys(new Y).forEach((function(e){i.set(o,"."+e,r[e])}))})),r("vert"),r("frag"),0<Object.keys(n.state).length&&(i(a,".dirty=true;"),i.exit(a,".dirty=true;")),i("a1(",e.shared.context,",a0,",e.batchId,");")}function X(e,t,n){var r=t.static[n];if(r&&function(e){if("object"==typeof e&&!v(e)){for(var t=Object.keys(e),n=0;n<t.length;++n)if(H.isDynamic(e[t[n]]))return!0;return!1}}(r)){var i=e.global,o=Object.keys(r),a=!1,s=!1,u=!1,c=e.global.def("{}");o.forEach((function(t){var n=r[t];if(H.isDynamic(n))"function"==typeof n&&(n=r[t]=H.unbox(n)),t=I(n,null),a=a||t.thisDep,u=u||t.propDep,s=s||t.contextDep;else{switch(i(c,".",t,"="),typeof n){case"number":i(n);break;case"string":i('"',n,'"');break;case"object":Array.isArray(n)&&i("[",n.join(),"]");break;default:i(e.link(n))}i(";")}})),t.dynamic[n]=new H.DynamicVariable(4,{thisDep:a,contextDep:s,propDep:u,ref:c,append:function(e,t){o.forEach((function(n){var i=r[n];H.isDynamic(i)&&(i=e.invoke(t,i),t(c,".",n,"=",i,";"))}))}}),delete t.static[n]}}var Y=f.Record,V={add:32774,subtract:32778,"reverse subtract":32779};n.ext_blend_minmax&&(V.min=32775,V.max=32776);var K=n.angle_instanced_arrays,Q=n.webgl_draw_buffers,J={dirty:!0,profile:m.profile},ee={},te=[],ne={},ie={};y("dither",3024),y("blend.enable",3042),b("blend.color","blendColor",[0,0,0,0]),b("blend.equation","blendEquationSeparate",[32774,32774]),b("blend.func","blendFuncSeparate",[1,0,1,0]),y("depth.enable",2929,!0),b("depth.func","depthFunc",513),b("depth.range","depthRange",[0,1]),b("depth.mask","depthMask",!0),b("colorMask","colorMask",[!0,!0,!0,!0]),y("cull.enable",2884),b("cull.face","cullFace",1029),b("frontFace","frontFace",2305),b("lineWidth","lineWidth",1),y("polygonOffset.enable",32823),b("polygonOffset.offset","polygonOffset",[0,0]),y("sample.alpha",32926),y("sample.enable",32928),b("sample.coverage","sampleCoverage",[1,!1]),y("stencil.enable",2960),b("stencil.mask","stencilMask",-1),b("stencil.func","stencilFunc",[519,0,-1]),b("stencil.opFront","stencilOpSeparate",[1028,7680,7680,7680]),b("stencil.opBack","stencilOpSeparate",[1029,7680,7680,7680]),y("scissor.enable",3089),b("scissor.box","scissor",[0,0,e.drawingBufferWidth,e.drawingBufferHeight]),b("viewport","viewport",[0,0,e.drawingBufferWidth,e.drawingBufferHeight]);var oe={gl:e,context:p,strings:t,next:ee,current:J,draw:h,elements:a,buffer:i,shader:l,attributes:f.state,uniforms:c,framebuffer:u,extensions:n,timer:d,isBufferArgs:D},ae={primTypes:re,compareFuncs:ke,blendFuncs:Ae,blendEquations:V,stencilOps:Se,glTypes:Z,orientationType:Ee};Q&&(ae.backBuffer=[1029],ae.drawBuffer=o(r.maxDrawbuffers,(function(e){return 0===e?[0]:o(e,(function(e){return 36064+e}))})));var se=0;return{next:ee,current:J,procs:function(){var e=w(),t=e.proc("poll"),n=e.proc("refresh"),i=e.block();t(i),n(i);var a,s=e.shared,u=s.gl,c=s.next,f=s.current;i(f,".dirty=false;"),E(e,t),E(e,n,null,!0),K&&(a=e.link(K));for(var l=0;l<r.maxAttributes;++l){var h=n.def(s.attributes,"[",l,"]"),p=e.cond(h,".buffer");p.then(u,".enableVertexAttribArray(",l,");",u,".bindBuffer(",34962,",",h,".buffer.buffer);",u,".vertexAttribPointer(",l,",",h,".size,",h,".type,",h,".normalized,",h,".stride,",h,".offset);").else(u,".disableVertexAttribArray(",l,");",u,".vertexAttrib4f(",l,",",h,".x,",h,".y,",h,".z,",h,".w);",h,".buffer=null;"),n(p),K&&n(a,".vertexAttribDivisorANGLE(",l,",",h,".divisor);")}return Object.keys(ne).forEach((function(r){var o=ne[r],a=i.def(c,".",r),s=e.block();s("if(",a,"){",u,".enable(",o,")}else{",u,".disable(",o,")}",f,".",r,"=",a,";"),n(s),t("if(",a,"!==",f,".",r,"){",s,"}")})),Object.keys(ie).forEach((function(r){var a,s,l=ie[r],h=J[r],p=e.block();p(u,".",l,"("),v(h)?(l=h.length,a=e.global.def(c,".",r),s=e.global.def(f,".",r),p(o(l,(function(e){return a+"["+e+"]"})),");",o(l,(function(e){return s+"["+e+"]="+a+"["+e+"];"})).join("")),t("if(",o(l,(function(e){return a+"["+e+"]!=="+s+"["+e+"]"})).join("||"),"){",p,"}")):(a=i.def(c,".",r),s=i.def(f,".",r),p(a,");",f,".",r,"=",a,";"),t("if(",a,"!==",s,"){",p,"}")),n(p)})),e.compile()}(),compile:function(e,t,n,r,i){var a=w();return a.stats=a.link(i),Object.keys(t.static).forEach((function(e){X(a,t,e)})),_e.forEach((function(t){X(a,e,t)})),n=function(e,t,n,r,i){var a=x(e),s=function(e,t,n){function r(e){if(e in i){var n=i[e];e=!0;var r,a,s=0|n.x,u=0|n.y;return"width"in n?r=0|n.width:e=!1,"height"in n?a=0|n.height:e=!1,new P(!e&&t&&t.thisDep,!e&&t&&t.contextDep,!e&&t&&t.propDep,(function(e,t){var i=e.shared.context,o=r;"width"in n||(o=t.def(i,".","framebufferWidth","-",s));var c=a;return"height"in n||(c=t.def(i,".","framebufferHeight","-",u)),[s,u,o,c]}))}if(e in o){var c=o[e];return e=I(c,(function(e,t){var n=e.invoke(t,c),r=e.shared.context,i=t.def(n,".x|0"),o=t.def(n,".y|0");return[i,o,t.def('"width" in ',n,"?",n,".width|0:","(",r,".","framebufferWidth","-",i,")"),n=t.def('"height" in ',n,"?",n,".height|0:","(",r,".","framebufferHeight","-",o,")")]})),t&&(e.thisDep=e.thisDep||t.thisDep,e.contextDep=e.contextDep||t.contextDep,e.propDep=e.propDep||t.propDep),e}return t?new P(t.thisDep,t.contextDep,t.propDep,(function(e,t){var n=e.shared.context;return[0,0,t.def(n,".","framebufferWidth"),t.def(n,".","framebufferHeight")]})):null}var i=e.static,o=e.dynamic;if(e=r("viewport")){var a=e;e=new P(e.thisDep,e.contextDep,e.propDep,(function(e,t){var n=a.append(e,t),r=e.shared.context;return t.set(r,".viewportWidth",n[2]),t.set(r,".viewportHeight",n[3]),n}))}return{viewport:e,scissor_box:r("scissor.box")}}(e,a),u=A(e),c=function(e,t){var n=e.static,r=e.dynamic,i={};return te.forEach((function(e){function t(t,o){if(e in n){var s=t(n[e]);i[a]=R((function(){return s}))}else if(e in r){var u=r[e];i[a]=I(u,(function(e,t){return o(e,t,e.invoke(t,u))}))}}var a=g(e);switch(e){case"cull.enable":case"blend.enable":case"dither":case"stencil.enable":case"depth.enable":case"scissor.enable":case"polygonOffset.enable":case"sample.alpha":case"sample.enable":case"depth.mask":case"lineWidth":return t((function(e){return e}),(function(e,t,n){return n}));case"depth.func":return t((function(e){return ke[e]}),(function(e,t,n){return t.def(e.constants.compareFuncs,"[",n,"]")}));case"depth.range":return t((function(e){return e}),(function(e,t,n){return[t.def("+",n,"[0]"),t=t.def("+",n,"[1]")]}));case"blend.func":return t((function(e){return[Ae["srcRGB"in e?e.srcRGB:e.src],Ae["dstRGB"in e?e.dstRGB:e.dst],Ae["srcAlpha"in e?e.srcAlpha:e.src],Ae["dstAlpha"in e?e.dstAlpha:e.dst]]}),(function(e,t,n){function r(e,r){return t.def('"',e,r,'" in ',n,"?",n,".",e,r,":",n,".",e)}e=e.constants.blendFuncs;var i=r("src","RGB"),o=r("dst","RGB"),a=(i=t.def(e,"[",i,"]"),t.def(e,"[",r("src","Alpha"),"]"));return[i,o=t.def(e,"[",o,"]"),a,e=t.def(e,"[",r("dst","Alpha"),"]")]}));case"blend.equation":return t((function(e){return"string"==typeof e?[V[e],V[e]]:"object"==typeof e?[V[e.rgb],V[e.alpha]]:void 0}),(function(e,t,n){var r=e.constants.blendEquations,i=t.def(),o=t.def();return(e=e.cond("typeof ",n,'==="string"')).then(i,"=",o,"=",r,"[",n,"];"),e.else(i,"=",r,"[",n,".rgb];",o,"=",r,"[",n,".alpha];"),t(e),[i,o]}));case"blend.color":return t((function(e){return o(4,(function(t){return+e[t]}))}),(function(e,t,n){return o(4,(function(e){return t.def("+",n,"[",e,"]")}))}));case"stencil.mask":return t((function(e){return 0|e}),(function(e,t,n){return t.def(n,"|0")}));case"stencil.func":return t((function(e){return[ke[e.cmp||"keep"],e.ref||0,"mask"in e?e.mask:-1]}),(function(e,t,n){return[e=t.def('"cmp" in ',n,"?",e.constants.compareFuncs,"[",n,".cmp]",":",7680),t.def(n,".ref|0"),t=t.def('"mask" in ',n,"?",n,".mask|0:-1")]}));case"stencil.opFront":case"stencil.opBack":return t((function(t){return["stencil.opBack"===e?1029:1028,Se[t.fail||"keep"],Se[t.zfail||"keep"],Se[t.zpass||"keep"]]}),(function(t,n,r){function i(e){return n.def('"',e,'" in ',r,"?",o,"[",r,".",e,"]:",7680)}var o=t.constants.stencilOps;return["stencil.opBack"===e?1029:1028,i("fail"),i("zfail"),i("zpass")]}));case"polygonOffset.offset":return t((function(e){return[0|e.factor,0|e.units]}),(function(e,t,n){return[t.def(n,".factor|0"),t=t.def(n,".units|0")]}));case"cull.face":return t((function(e){var t=0;return"front"===e?t=1028:"back"===e&&(t=1029),t}),(function(e,t,n){return t.def(n,'==="front"?',1028,":",1029)}));case"frontFace":return t((function(e){return Ee[e]}),(function(e,t,n){return t.def(n+'==="cw"?2304:2305')}));case"colorMask":return t((function(e){return e.map((function(e){return!!e}))}),(function(e,t,n){return o(4,(function(e){return"!!"+n+"["+e+"]"}))}));case"sample.coverage":return t((function(e){return["value"in e?e.value:1,!!e.invert]}),(function(e,t,n){return[t.def('"value" in ',n,"?+",n,".value:1"),t=t.def("!!",n,".invert")]}))}})),i}(e),f=_(e),l=s.viewport;return l&&(c.viewport=l),(s=s[l=g("scissor.box")])&&(c[l]=s),(a={framebuffer:a,draw:u,shader:f,state:c,dirty:s=0<Object.keys(c).length}).profile=function(e){var t,n=e.static;if(e=e.dynamic,"profile"in n){var r=!!n.profile;(t=R((function(e,t){return r}))).enable=r}else if("profile"in e){var i=e.profile;t=I(i,(function(e,t){return e.invoke(t,i)}))}return t}(e),a.uniforms=function(e,t){var n=e.static,r=e.dynamic,i={};return Object.keys(n).forEach((function(e){var t,r=n[e];if("number"==typeof r||"boolean"==typeof r)t=R((function(){return r}));else if("function"==typeof r){var a=r._reglType;"texture2d"===a||"textureCube"===a?t=R((function(e){return e.link(r)})):"framebuffer"!==a&&"framebufferCube"!==a||(t=R((function(e){return e.link(r.color[0])})))}else v(r)&&(t=R((function(e){return e.global.def("[",o(r.length,(function(e){return r[e]})),"]")})));t.value=r,i[e]=t})),Object.keys(r).forEach((function(e){var t=r[e];i[e]=I(t,(function(e,n){return e.invoke(n,t)}))})),i}(n),a.attributes=k(t),a.context=function(e){var t=e.static,n=e.dynamic,r={};return Object.keys(t).forEach((function(e){var n=t[e];r[e]=R((function(e,t){return"number"==typeof n||"boolean"==typeof n?""+n:e.link(n)}))})),Object.keys(n).forEach((function(e){var t=n[e];r[e]=I(t,(function(e,n){return e.invoke(n,t)}))})),r}(r),a}(e,t,n,r),function(e,t){var n=e.proc("draw",1);C(e,n),S(e,n,t.context),E(e,n,t.framebuffer),j(e,n,t),T(e,n,t.state),O(e,n,t,!1,!0);var r=t.shader.progVar.append(e,n);if(n(e.shared.gl,".useProgram(",r,".program);"),t.shader.program)N(e,n,t,t.shader.program);else{var i=e.global.def("{}"),o=n.def(r,".id"),a=n.def(i,"[",o,"]");n(e.cond(a).then(a,".call(this,a0);").else(a,"=",i,"[",o,"]=",e.link((function(n){return q(N,e,t,n,1)})),"(",r,");",a,".call(this,a0);"))}0<Object.keys(t.state).length&&n(e.shared.current,".dirty=true;")}(a,n),G(a,n),function(e,t){function n(e){return e.contextDep&&i||e.propDep}var r=e.proc("batch",2);e.batchId="0",C(e,r);var i=!1,o=!0;Object.keys(t.context).forEach((function(e){i=i||t.context[e].propDep})),i||(S(e,r,t.context),o=!1);var a=!1;if((s=t.framebuffer)?(s.propDep?i=a=!0:s.contextDep&&i&&(a=!0),a||E(e,r,s)):E(e,r,null),t.state.viewport&&t.state.viewport.propDep&&(i=!0),j(e,r,t),T(e,r,t.state,(function(e){return!n(e)})),t.profile&&n(t.profile)||O(e,r,t,!1,"a1"),t.contextDep=i,t.needsContext=o,t.needsFramebuffer=a,(o=t.shader.progVar).contextDep&&i||o.propDep)W(e,r,t,null);else if(o=o.append(e,r),r(e.shared.gl,".useProgram(",o,".program);"),t.shader.program)W(e,r,t,t.shader.program);else{var s=e.global.def("{}"),u=(a=r.def(o,".id"),r.def(s,"[",a,"]"));r(e.cond(u).then(u,".call(this,a0,a1);").else(u,"=",s,"[",a,"]=",e.link((function(n){return q(W,e,t,n,2)})),"(",o,");",u,".call(this,a0,a1);"))}0<Object.keys(t.state).length&&r(e.shared.current,".dirty=true;")}(a,n),a.compile()}}}function U(e,t){for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}var q=function(e,t){for(var n=Object.keys(t),r=0;r<n.length;++r)e[n[r]]=t[n[r]];return e},N=0,H={DynamicVariable:e,define:function(t,r){return new e(t,n(r+""))},isDynamic:function(t){return"function"==typeof t&&!t._reglType||t instanceof e},unbox:function(t,n){return"function"==typeof t?new e(0,t):t},accessor:n},$={next:"function"==typeof requestAnimationFrame?function(e){return requestAnimationFrame(e)}:function(e){return setTimeout(e,16)},cancel:"function"==typeof cancelAnimationFrame?function(e){return cancelAnimationFrame(e)}:clearTimeout},W="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date},G=s();G.zero=s();var X=function(e,t){var n=1;t.ext_texture_filter_anisotropic&&(n=e.getParameter(34047));var r=1,i=1;t.webgl_draw_buffers&&(r=e.getParameter(34852),i=e.getParameter(36063));var o=!!t.oes_texture_float;if(o){o=e.createTexture(),e.bindTexture(3553,o),e.texImage2D(3553,0,6408,1,1,0,6408,5126,null);var a=e.createFramebuffer();if(e.bindFramebuffer(36160,a),e.framebufferTexture2D(36160,36064,3553,o,0),e.bindTexture(3553,null),36053!==e.checkFramebufferStatus(36160))o=!1;else{e.viewport(0,0,1,1),e.clearColor(1,0,0,1),e.clear(16384);var s=G.allocType(5126,4);e.readPixels(0,0,1,1,6408,5126,s),e.getError()?o=!1:(e.deleteFramebuffer(a),e.deleteTexture(o),o=1===s[0]),G.freeType(s)}}return s=!0,s=e.createTexture(),a=G.allocType(5121,36),e.activeTexture(33984),e.bindTexture(34067,s),e.texImage2D(34069,0,6408,3,3,0,6408,5121,a),G.freeType(a),e.bindTexture(34067,null),e.deleteTexture(s),s=!e.getError(),{colorBits:[e.getParameter(3410),e.getParameter(3411),e.getParameter(3412),e.getParameter(3413)],depthBits:e.getParameter(3414),stencilBits:e.getParameter(3415),subpixelBits:e.getParameter(3408),extensions:Object.keys(t).filter((function(e){return!!t[e]})),maxAnisotropic:n,maxDrawbuffers:r,maxColorAttachments:i,pointSizeDims:e.getParameter(33901),lineWidthDims:e.getParameter(33902),maxViewportDims:e.getParameter(3386),maxCombinedTextureUnits:e.getParameter(35661),maxCubeMapSize:e.getParameter(34076),maxRenderbufferSize:e.getParameter(34024),maxTextureUnits:e.getParameter(34930),maxTextureSize:e.getParameter(3379),maxAttributes:e.getParameter(34921),maxVertexUniforms:e.getParameter(36347),maxVertexTextureUnits:e.getParameter(35660),maxVaryingVectors:e.getParameter(36348),maxFragmentUniforms:e.getParameter(36349),glsl:e.getParameter(35724),renderer:e.getParameter(7937),vendor:e.getParameter(7936),version:e.getParameter(7938),readFloat:o,npotTextureCube:s}},Y=function(e){return e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Float32Array||e instanceof Float64Array||e instanceof Uint8ClampedArray},V=function(e){return Object.keys(e).map((function(t){return e[t]}))},K={shape:function(e){for(var t=[];e.length;e=e[0])t.push(e.length);return t},flatten:function(e,t,n,r){var i=1;if(t.length)for(var o=0;o<t.length;++o)i*=t[o];else i=0;switch(n=r||G.allocType(n,i),t.length){case 0:break;case 1:for(r=t[0],t=0;t<r;++t)n[t]=e[t];break;case 2:for(r=t[0],t=t[1],o=i=0;o<r;++o)for(var a=e[o],s=0;s<t;++s)n[i++]=a[s];break;case 3:c(e,t[0],t[1],t[2],n,0);break;default:f(e,t,0,n,0)}return n}},Q={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},Z={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},J={dynamic:35048,stream:35040,static:35044},ee=K.flatten,te=K.shape,ne=[];ne[5120]=1,ne[5122]=2,ne[5124]=4,ne[5121]=1,ne[5123]=2,ne[5125]=4,ne[5126]=4;var re={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},ie=new Float32Array(1),oe=new Uint32Array(ie.buffer),ae=[9984,9986,9985,9987],se=[0,6409,6410,6407,6408],ue={};ue[6409]=ue[6406]=ue[6402]=1,ue[34041]=ue[6410]=2,ue[6407]=ue[35904]=3,ue[6408]=ue[35906]=4;var ce=y("HTMLCanvasElement"),fe=y("CanvasRenderingContext2D"),le=y("ImageBitmap"),he=y("HTMLImageElement"),pe=y("HTMLVideoElement"),de=Object.keys(Q).concat([ce,fe,le,he,pe]),me=[];me[5121]=1,me[5126]=4,me[36193]=2,me[5123]=2,me[5125]=4;var ge=[];ge[32854]=2,ge[32855]=2,ge[36194]=2,ge[34041]=4,ge[33776]=.5,ge[33777]=.5,ge[33778]=1,ge[33779]=1,ge[35986]=.5,ge[35987]=1,ge[34798]=1,ge[35840]=.5,ge[35841]=.25,ge[35842]=.5,ge[35843]=.25,ge[36196]=.5;var ve=[];ve[32854]=2,ve[32855]=2,ve[36194]=2,ve[33189]=2,ve[36168]=1,ve[34041]=4,ve[35907]=4,ve[34836]=16,ve[34842]=8,ve[34843]=6;var ye=function(e,t,n,r,i){function o(e){this.id=c++,this.refCount=1,this.renderbuffer=e,this.format=32854,this.height=this.width=0,i.profile&&(this.stats={size:0})}function a(t){var n=t.renderbuffer;e.bindRenderbuffer(36161,null),e.deleteRenderbuffer(n),t.renderbuffer=null,t.refCount=0,delete f[t.id],r.renderbufferCount--}var s={rgba4:32854,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};t.ext_srgb&&(s.srgba=35907),t.ext_color_buffer_half_float&&(s.rgba16f=34842,s.rgb16f=34843),t.webgl_color_buffer_float&&(s.rgba32f=34836);var u=[];Object.keys(s).forEach((function(e){u[s[e]]=e}));var c=0,f={};return o.prototype.decRef=function(){0>=--this.refCount&&a(this)},i.profile&&(r.getTotalRenderbufferSize=function(){var e=0;return Object.keys(f).forEach((function(t){e+=f[t].stats.size})),e}),{create:function(t,n){function a(t,n){var r=0,o=0,f=32854;if("object"==typeof t&&t?("shape"in t?(r=0|(o=t.shape)[0],o=0|o[1]):("radius"in t&&(r=o=0|t.radius),"width"in t&&(r=0|t.width),"height"in t&&(o=0|t.height)),"format"in t&&(f=s[t.format])):"number"==typeof t?(r=0|t,o="number"==typeof n?0|n:r):t||(r=o=1),r!==c.width||o!==c.height||f!==c.format)return a.width=c.width=r,a.height=c.height=o,c.format=f,e.bindRenderbuffer(36161,c.renderbuffer),e.renderbufferStorage(36161,f,r,o),i.profile&&(c.stats.size=ve[c.format]*c.width*c.height),a.format=u[c.format],a}var c=new o(e.createRenderbuffer());return f[c.id]=c,r.renderbufferCount++,a(t,n),a.resize=function(t,n){var r=0|t,o=0|n||r;return r===c.width&&o===c.height||(a.width=c.width=r,a.height=c.height=o,e.bindRenderbuffer(36161,c.renderbuffer),e.renderbufferStorage(36161,c.format,r,o),i.profile&&(c.stats.size=ve[c.format]*c.width*c.height)),a},a._reglType="renderbuffer",a._renderbuffer=c,i.profile&&(a.stats=c.stats),a.destroy=function(){c.decRef()},a},clear:function(){V(f).forEach(a)},restore:function(){V(f).forEach((function(t){t.renderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,t.renderbuffer),e.renderbufferStorage(36161,t.format,t.width,t.height)})),e.bindRenderbuffer(36161,null)}}},be=[];be[6408]=4,be[6407]=3;var we=[];we[5121]=1,we[5126]=4,we[36193]=2;var xe=["x","y","z","w"],_e="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),Ae={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},ke={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Se={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ee={cw:2304,ccw:2305},je=new P(!1,!1,!1,(function(){}));return function(e){function t(){if(0===K.length)A&&A.update(),ee=null;else{ee=$.next(t),h();for(var e=K.length-1;0<=e;--e){var n=K[e];n&&n(F,null,0)}v.flush(),A&&A.update()}}function n(){!ee&&0<K.length&&(ee=$.next(t))}function o(){ee&&($.cancel(t),ee=null)}function a(e){e.preventDefault(),o(),Q.forEach((function(e){e()}))}function s(e){v.getError(),b.restore(),B.restore(),L.restore(),R.restore(),I.restore(),N.restore(),A&&A.restore(),G.procs.refresh(),n(),Z.forEach((function(e){e()}))}function u(e){function t(e){var t={},n={};return Object.keys(e).forEach((function(r){var i=e[r];H.isDynamic(i)?n[r]=H.unbox(i,r):t[r]=i})),{dynamic:n,static:t}}var n=t(e.context||{}),r=t(e.uniforms||{}),i=t(e.attributes||{}),o=t(function(e){function t(e){if(e in n){var t=n[e];delete n[e],Object.keys(t).forEach((function(r){n[e+"."+r]=t[r]}))}}var n=q({},e);return delete n.uniforms,delete n.attributes,delete n.context,"stencil"in n&&n.stencil.op&&(n.stencil.opBack=n.stencil.opFront=n.stencil.op,delete n.stencil.op),t("blend"),t("depth"),t("cull"),t("stencil"),t("polygonOffset"),t("scissor"),t("sample"),n}(e));e={gpuTime:0,cpuTime:0,count:0};var a=(n=G.compile(o,i,r,n,e)).draw,s=n.batch,u=n.scope,c=[];return q((function(e,t){var n;if("function"==typeof e)return u.call(this,null,e,0);if("function"==typeof t)if("number"==typeof e)for(n=0;n<e;++n)u.call(this,null,t,n);else{if(!Array.isArray(e))return u.call(this,e,t,0);for(n=0;n<e.length;++n)u.call(this,e[n],t,n)}else if("number"==typeof e){if(0<e)return s.call(this,function(e){for(;c.length<e;)c.push(null);return c}(0|e),0|e)}else{if(!Array.isArray(e))return a.call(this,e);if(e.length)return s.call(this,e,e.length)}}),{stats:e})}function c(e,t){var n=0;G.procs.poll();var r=t.color;r&&(v.clearColor(+r[0]||0,+r[1]||0,+r[2]||0,+r[3]||0),n|=16384),"depth"in t&&(v.clearDepth(+t.depth),n|=256),"stencil"in t&&(v.clearStencil(0|t.stencil),n|=1024),v.clear(n)}function f(e){return K.push(e),n(),{cancel:function(){var t=U(K,e);K[t]=function e(){var t=U(K,e);K[t]=K[K.length-1],--K.length,0>=K.length&&o()}}}}function l(){var e=Y.viewport,t=Y.scissor_box;e[0]=e[1]=t[0]=t[1]=0,F.viewportWidth=F.framebufferWidth=F.drawingBufferWidth=e[2]=t[2]=v.drawingBufferWidth,F.viewportHeight=F.framebufferHeight=F.drawingBufferHeight=e[3]=t[3]=v.drawingBufferHeight}function h(){F.tick+=1,F.time=g(),l(),G.procs.poll()}function p(){l(),G.procs.refresh(),A&&A.update()}function g(){return(W()-k)/1e3}if(!(e=function(e){var t,n,o,a,s=e||{};e={};var u=[],c=[],f="undefined"==typeof window?1:window.devicePixelRatio,l=!1,h=function(e){},p=function(){};if("string"==typeof s?t=document.querySelector(s):"object"==typeof s&&("string"==typeof s.nodeName&&"function"==typeof s.appendChild&&"function"==typeof s.getBoundingClientRect?t=s:"function"==typeof s.drawArrays||"function"==typeof s.drawElements?o=(a=s).canvas:("gl"in s?a=s.gl:"canvas"in s?o=i(s.canvas):"container"in s&&(n=i(s.container)),"attributes"in s&&(e=s.attributes),"extensions"in s&&(u=r(s.extensions)),"optionalExtensions"in s&&(c=r(s.optionalExtensions)),"onDone"in s&&(h=s.onDone),"profile"in s&&(l=!!s.profile),"pixelRatio"in s&&(f=+s.pixelRatio))),t&&("canvas"===t.nodeName.toLowerCase()?o=t:n=t),!a){if(!o){if(t=function(e,t,n){function r(){var t=window.innerWidth,r=window.innerHeight;e!==document.body&&(t=(r=e.getBoundingClientRect()).right-r.left,r=r.bottom-r.top),i.width=n*t,i.height=n*r,q(i.style,{width:t+"px",height:r+"px"})}var i=document.createElement("canvas");return q(i.style,{border:0,margin:0,padding:0,top:0,left:0}),e.appendChild(i),e===document.body&&(i.style.position="absolute",q(e.style,{margin:0,padding:0})),window.addEventListener("resize",r,!1),r(),{canvas:i,onDestroy:function(){window.removeEventListener("resize",r),e.removeChild(i)}}}(n||document.body,0,f),!t)return null;o=t.canvas,p=t.onDestroy}a=function(e,t){function n(n){try{return e.getContext(n,t)}catch(e){return null}}return n("webgl")||n("experimental-webgl")||n("webgl-experimental")}(o,e)}return a?{gl:a,canvas:o,container:n,extensions:u,optionalExtensions:c,pixelRatio:f,profile:l,onDone:h,onDestroy:p}:(p(),h("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}(e)))return null;var v=e.gl,y=v.getContextAttributes();v.isContextLost();var b=function(e,t){function n(t){var n;t=t.toLowerCase();try{n=r[t]=e.getExtension(t)}catch(e){}return!!n}for(var r={},i=0;i<t.extensions.length;++i){var o=t.extensions[i];if(!n(o))return t.onDestroy(),t.onDone('"'+o+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return t.optionalExtensions.forEach(n),{extensions:r,restore:function(){Object.keys(r).forEach((function(e){if(r[e]&&!n(e))throw Error("(regl): error restoring extension "+e)}))}}}(v,e);if(!b)return null;var w=function(){var e={"":0},t=[""];return{id:function(n){var r=e[n];return r||(r=e[n]=t.length,t.push(n),r)},str:function(e){return t[e]}}}(),x={bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},_=b.extensions,A=function(e,t){function n(){this.endQueryIndex=this.startQueryIndex=-1,this.sum=0,this.stats=null}function r(e,t,r){var i=a.pop()||new n;i.startQueryIndex=e,i.endQueryIndex=t,i.sum=0,i.stats=r,s.push(i)}if(!t.ext_disjoint_timer_query)return null;var i=[],o=[],a=[],s=[],u=[],c=[];return{beginQuery:function(e){var n=i.pop()||t.ext_disjoint_timer_query.createQueryEXT();t.ext_disjoint_timer_query.beginQueryEXT(35007,n),o.push(n),r(o.length-1,o.length,e)},endQuery:function(){t.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:r,update:function(){var e,n;if(0!==(e=o.length)){c.length=Math.max(c.length,e+1),u.length=Math.max(u.length,e+1),u[0]=0;var r=c[0]=0;for(n=e=0;n<o.length;++n){var f=o[n];t.ext_disjoint_timer_query.getQueryObjectEXT(f,34919)?(r+=t.ext_disjoint_timer_query.getQueryObjectEXT(f,34918),i.push(f)):o[e++]=f,u[n+1]=r,c[n+1]=e}for(o.length=e,n=e=0;n<s.length;++n){var l=(r=s[n]).startQueryIndex;f=r.endQueryIndex,r.sum+=u[f]-u[l],l=c[l],(f=c[f])===l?(r.stats.gpuTime+=r.sum/1e6,a.push(r)):(r.startQueryIndex=l,r.endQueryIndex=f,s[e++]=r)}s.length=e}},getNumPendingQueries:function(){return o.length},clear:function(){i.push.apply(i,o);for(var e=0;e<i.length;e++)t.ext_disjoint_timer_query.deleteQueryEXT(i[e]);o.length=0,i.length=0},restore:function(){o.length=0,i.length=0}}}(0,_),k=W(),O=v.drawingBufferWidth,M=v.drawingBufferHeight,F={tick:0,time:0,viewportWidth:O,viewportHeight:M,framebufferWidth:O,framebufferHeight:M,drawingBufferWidth:O,drawingBufferHeight:M,pixelRatio:e.pixelRatio},D=X(v,_),L=(O=function(e,t,n,r){for(e=n.maxAttributes,t=Array(e),n=0;n<e;++n)t[n]=new j;return{Record:j,scope:{},state:t}}(v,_,D),d(v,x,e,O)),P=m(v,_,L,x),B=T(v,w,x,e),R=S(v,_,D,(function(){G.procs.poll()}),F,x,e),I=ye(v,_,0,x,e),N=E(v,_,D,R,I,x),G=z(v,w,_,D,L,P,0,N,{},O,B,{elements:null,primitive:4,count:-1,offset:0,instances:-1},F,A,e),Y=(w=C(v,N,G.procs.poll,F),G.next),V=v.canvas,K=[],Q=[],Z=[],J=[e.onDestroy],ee=null;V&&(V.addEventListener("webglcontextlost",a,!1),V.addEventListener("webglcontextrestored",s,!1));var te=N.setFBO=u({framebuffer:H.define.call(null,1,"framebuffer")});return p(),y=q(u,{clear:function(e){if("framebuffer"in e)if(e.framebuffer&&"framebufferCube"===e.framebuffer_reglType)for(var t=0;6>t;++t)te(q({framebuffer:e.framebuffer.faces[t]},e),c);else te(e,c);else c(0,e)},prop:H.define.bind(null,1),context:H.define.bind(null,2),this:H.define.bind(null,3),draw:u({}),buffer:function(e){return L.create(e,34962,!1,!1)},elements:function(e){return P.create(e,!1)},texture:R.create2D,cube:R.createCube,renderbuffer:I.create,framebuffer:N.create,framebufferCube:N.createCube,attributes:y,frame:f,on:function(e,t){var n;switch(e){case"frame":return f(t);case"lost":n=Q;break;case"restore":n=Z;break;case"destroy":n=J}return n.push(t),{cancel:function(){for(var e=0;e<n.length;++e)if(n[e]===t){n[e]=n[n.length-1],n.pop();break}}}},limits:D,hasExtension:function(e){return 0<=D.extensions.indexOf(e.toLowerCase())},read:w,destroy:function(){K.length=0,o(),V&&(V.removeEventListener("webglcontextlost",a),V.removeEventListener("webglcontextrestored",s)),B.clear(),N.clear(),I.clear(),R.clear(),P.clear(),L.clear(),A&&A.clear(),J.forEach((function(e){e()}))},_gl:v,_refresh:p,poll:function(){h(),A&&A.update()},now:g,stats:x}),e.onDone(null,y),y}},"object"==typeof n&&void 0!==t?t.exports=r():"function"==typeof define&&define.amd?define(r):this.createREGL=r()},{}],9:[function(e,t,n){(function(e){(function(){t.exports=e.performance&&e.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],10:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=i(e("./lib/sandbox.js"));function i(e){return e&&e.__esModule?e:{default:e}}i(e("./lib/array-utils.js"));n.default=class{constructor(e,t,n=[]){this.makeGlobal=t,this.sandbox=(0,r.default)(e),this.parent=e,Object.keys(e).forEach((e=>this.add(e))),this.userProps=n}add(e){this.makeGlobal&&(window[e]=this.parent[e]),this.sandbox.addToContext(e,`parent.${e}`)}set(e,t){this.makeGlobal&&(window[e]=t),this.parent[e]=t}tick(){this.makeGlobal&&this.userProps.forEach((e=>{this.parent[e]=window[e]}))}eval(e){this.sandbox.eval(e)}}},{"./lib/array-utils.js":20,"./lib/sandbox.js":25}],11:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,t,n){const r=e.transform.inputs,s=e.userArgs,{generators:u}=e.synth,{src:c}=u;return r.map(((e,n)=>{const r={value:e.default,type:e.type,isUniform:!1,name:e.name,vecLen:0};if("float"===r.type&&(r.value=a(e.default)),e.type.startsWith("vec"))try{r.vecLen=Number.parseInt(e.type.substr(3))}catch(t){console.log(`Error determining length of vector input type ${e.type} (${e.name})`)}if(s.length>n&&(r.value=s[n],"function"==typeof s[n]?(r.value=(t,r,i)=>{try{const t=s[n](r);return"number"==typeof t?t:(console.warn("function does not return a number",s[n]),e.default)}catch(t){return console.warn("ERROR",t),e.default}},r.isUniform=!0):s[n].constructor===Array&&(r.value=(e,t,r)=>i.default.getValue(s[n])(t),r.isUniform=!0)),t<0);else{if(r.value&&r.value.transforms){const t=r.value.transforms[r.value.transforms.length-1];if(t.transform.glsl_return_type!==e.type){const n=o[e.type];if(void 0!==n){const e=n[t.transform.glsl_return_type];if(void 0!==e){const{name:t,args:n}=e;r.value=r.value[t](...n)}}}r.isUniform=!1}else if("float"===r.type&&"number"==typeof r.value)r.value=a(r.value);else if(r.type.startsWith("vec")&&"object"==typeof r.value&&Array.isArray(r.value))r.isUniform=!1,r.value=`${r.type}(${r.value.map(a).join(", ")})`;else if("sampler2D"===e.type){var u=r.value;r.value=()=>u.getTexture(),r.isUniform=!0}else if(r.value.getTexture&&"vec4"===e.type){var f=r.value;r.value=c(f),r.isUniform=!1}r.isUniform&&(r.name+=t)}return r}))};var r,i=(r=e("./lib/array-utils.js"))&&r.__esModule?r:{default:r};const o={float:{vec4:{name:"sum",args:[[1,1,1,1]]},vec2:{name:"sum",args:[[1,1]]}}},a=e=>((e=e.toString()).indexOf(".")<0&&(e+="."),e)},{"./lib/array-utils.js":20}],12:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e){var t={uniforms:[],glslFunctions:[],fragColor:""},n=o(e,t)("st");t.fragColor=n;let r={};return t.uniforms.forEach((e=>r[e.name]=e)),t.uniforms=Object.values(r),t};var r=i(e("./format-arguments.js"));function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=()=>"";return e.forEach((e=>{var i=(0,r.default)(e,t.uniforms.length);i.forEach((e=>{e.isUniform&&t.uniforms.push(e)})),function(e,t){for(var n=0;n<t.length;n++)if(e.name==t[n].name)return!0;return!1}(e,t.glslFunctions)||t.glslFunctions.push(e);var s=n;if("src"===e.transform.type)n=n=>`${a(n,e.name,i,t)}`;else if("coord"===e.transform.type)n=n=>`${s(`${a(n,e.name,i,t)}`)}`;else if("color"===e.transform.type)n=n=>`${a(`${s(n)}`,e.name,i,t)}`;else if("combine"===e.transform.type){var u=i[0].value&&i[0].value.transforms?e=>`${o(i[0].value.transforms,t)(e)}`:i[0].isUniform?()=>i[0].name:()=>i[0].value;n=n=>`${a(`${s(n)}, ${u(n)}`,e.name,i.slice(1),t)}`}else"combineCoord"===e.transform.type&&(u=i[0].value&&i[0].value.transforms?e=>`${o(i[0].value.transforms,t)(e)}`:i[0].isUniform?()=>i[0].name:()=>i[0].value,n=n=>`${s(`${a(`${n}, ${u(n)}`,e.name,i.slice(1),t)}`)}`)})),n}function a(e,t,n,r){return`${t}(${e}${n.map((e=>e.isUniform?e.name:e.value&&e.value.transforms?`${o(e.value.transforms,r)("st")}`:e.value)).reduce(((e,t)=>`${e}, ${t}`),"")})`}i(e("./lib/array-utils.js"))},{"./format-arguments.js":11,"./lib/array-utils.js":20}],13:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(e("./glsl-source.js")),i=o(e("./glsl/glsl-functions.js"));function o(e){return e&&e.__esModule?e:{default:e}}const a={src:{returnType:"vec4",args:["vec2 _st"]},coord:{returnType:"vec2",args:["vec2 _st"]},color:{returnType:"vec4",args:["vec4 _c0"]},combine:{returnType:"vec4",args:["vec4 _c0","vec4 _c1"]},combineCoord:{returnType:"vec2",args:["vec2 _st","vec4 _c0"]}};n.default=class{constructor({defaultUniforms:e,defaultOutput:t,extendTransforms:n=[],changeListener:r=(()=>{})}={}){this.defaultOutput=t,this.defaultUniforms=e,this.changeListener=r,this.extendTransforms=n,this.generators={},this.init()}init(){const e=(0,i.default)();return this.glslTransforms={},this.generators=Object.entries(this.generators).reduce(((e,[t,n])=>(this.changeListener({type:"remove",synth:this,method:t}),e)),{}),this.sourceClass=class extends r.default{},Array.isArray(this.extendTransforms)?e.concat(this.extendTransforms):"object"==typeof this.extendTransforms&&this.extendTransforms.type&&e.push(this.extendTransforms),e.map((e=>this.setFunction(e)))}_addMethod(e,t){const n=this;if(this.glslTransforms[e]=t,"src"===t.type){const r=(...r)=>new this.sourceClass({name:e,transform:t,userArgs:r,defaultOutput:this.defaultOutput,defaultUniforms:this.defaultUniforms,synth:n});return this.generators[e]=r,this.changeListener({type:"add",synth:this,method:e}),r}this.sourceClass.prototype[e]=function(...r){return this.transforms.push({name:e,transform:t,userArgs:r,synth:n}),this}}setFunction(e){var t=function(e){let t=a[e.type];if(t){let n=t.args.map((e=>e)).join(", "),r=e.inputs.map((e=>`${e.type} ${e.name}`)).join(", "),i=`${n}${r.length>0?", "+r:""}`,o=`\n ${t.returnType} ${e.name}(${i}) {\n ${e.glsl}\n }\n`;return"combine"!==e.type&&"combineCoord"!==e.type||e.inputs.unshift({name:"color",type:"vec4"}),Object.assign({},e,{glsl:o})}console.warn(`type ${e.type} not recognized`,e)}(e);t&&this._addMethod(e.name,t)}}},{"./glsl-source.js":14,"./glsl/glsl-functions.js":15}],14:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(e("./generate-glsl.js")),i=o(e("./glsl/utility-functions.js"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(e){return this.transforms=[],this.transforms.push(e),this.defaultOutput=e.defaultOutput,this.synth=e.synth,this.type="GlslSource",this.defaultUniforms=e.defaultUniforms,this};a.prototype.addTransform=function(e){this.transforms.push(e)},a.prototype.out=function(e){var t=e||this.defaultOutput,n=this.glsl(t);if(this.synth.currentFunctions=[],t)try{t.render(n)}catch(e){console.log("shader could not compile",e)}},a.prototype.glsl=function(){var e=[],t=[];return this.transforms.forEach((e=>{"renderpass"===e.transform.type?console.warn("no support for renderpass"):t.push(e)})),t.length>0&&e.push(this.compile(t)),e},a.prototype.compile=function(e){var t=(0,r.default)(e,this.synth),n={};return t.uniforms.forEach((e=>{n[e.name]=e.value})),{frag:`\n precision ${this.defaultOutput.precision} float;\n ${Object.values(t.uniforms).map((e=>{let t=e.type;return"texture"===e.type&&(t="sampler2D"),`\n uniform ${t} ${e.name};`})).join("")}\n uniform float time;\n uniform vec2 resolution;\n varying vec2 uv;\n uniform sampler2D prevBuffer;\n\n ${Object.values(i.default).map((e=>`\n ${e.glsl}\n `)).join("")}\n\n ${t.glslFunctions.map((e=>`\n ${e.transform.glsl}\n `)).join("")}\n\n void main () {\n vec4 c = vec4(1, 0, 0, 1);\n vec2 st = gl_FragCoord.xy/resolution.xy;\n gl_FragColor = ${t.fragColor};\n }\n `,uniforms:Object.assign({},this.defaultUniforms,n)}};var s=a;n.default=s},{"./generate-glsl.js":12,"./glsl/utility-functions.js":16}],15:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0,n.default=()=>[{name:"noise",type:"src",inputs:[{type:"float",name:"scale",default:10},{type:"float",name:"offset",default:.1}],glsl:" return vec4(vec3(_noise(vec3(_st*scale, offset*time))), 1.0);"},{name:"voronoi",type:"src",inputs:[{type:"float",name:"scale",default:5},{type:"float",name:"speed",default:.3},{type:"float",name:"blending",default:.3}],glsl:" vec3 color = vec3(.0);\n // Scale\n _st *= scale;\n // Tile the space\n vec2 i_st = floor(_st);\n vec2 f_st = fract(_st);\n float m_dist = 10.; // minimun distance\n vec2 m_point; // minimum point\n for (int j=-1; j<=1; j++ ) {\n for (int i=-1; i<=1; i++ ) {\n vec2 neighbor = vec2(float(i),float(j));\n vec2 p = i_st + neighbor;\n vec2 point = fract(sin(vec2(dot(p,vec2(127.1,311.7)),dot(p,vec2(269.5,183.3))))*43758.5453);\n point = 0.5 + 0.5*sin(time*speed + 6.2831*point);\n vec2 diff = neighbor + point - f_st;\n float dist = length(diff);\n if( dist < m_dist ) {\n m_dist = dist;\n m_point = point;\n }\n }\n }\n // Assign a color using the closest point position\n color += dot(m_point,vec2(.3,.6));\n color *= 1.0 - blending*m_dist;\n return vec4(color, 1.0);"},{name:"osc",type:"src",inputs:[{type:"float",name:"frequency",default:60},{type:"float",name:"sync",default:.1},{type:"float",name:"offset",default:0}],glsl:" vec2 st = _st;\n float r = sin((st.x-offset/frequency+time*sync)*frequency)*0.5 + 0.5;\n float g = sin((st.x+time*sync)*frequency)*0.5 + 0.5;\n float b = sin((st.x+offset/frequency+time*sync)*frequency)*0.5 + 0.5;\n return vec4(r, g, b, 1.0);"},{name:"shape",type:"src",inputs:[{type:"float",name:"sides",default:3},{type:"float",name:"radius",default:.3},{type:"float",name:"smoothing",default:.01}],glsl:" vec2 st = _st * 2. - 1.;\n // Angle and radius from the current pixel\n float a = atan(st.x,st.y)+3.1416;\n float r = (2.*3.1416)/sides;\n float d = cos(floor(.5+a/r)*r-a)*length(st);\n return vec4(vec3(1.0-smoothstep(radius,radius + smoothing + 0.0000001,d)), 1.0);"},{name:"gradient",type:"src",inputs:[{type:"float",name:"speed",default:0}],glsl:" return vec4(_st, sin(time*speed), 1.0);"},{name:"src",type:"src",inputs:[{type:"sampler2D",name:"tex",default:NaN}],glsl:" // vec2 uv = gl_FragCoord.xy/vec2(1280., 720.);\n return texture2D(tex, fract(_st));"},{name:"solid",type:"src",inputs:[{type:"float",name:"r",default:0},{type:"float",name:"g",default:0},{type:"float",name:"b",default:0},{type:"float",name:"a",default:1}],glsl:" return vec4(r, g, b, a);"},{name:"rotate",type:"coord",inputs:[{type:"float",name:"angle",default:10},{type:"float",name:"speed",default:0}],glsl:" vec2 xy = _st - vec2(0.5);\n float ang = angle + speed *time;\n xy = mat2(cos(ang),-sin(ang), sin(ang),cos(ang))*xy;\n xy += 0.5;\n return xy;"},{name:"scale",type:"coord",inputs:[{type:"float",name:"amount",default:1.5},{type:"float",name:"xMult",default:1},{type:"float",name:"yMult",default:1},{type:"float",name:"offsetX",default:.5},{type:"float",name:"offsetY",default:.5}],glsl:" vec2 xy = _st - vec2(offsetX, offsetY);\n xy*=(1.0/vec2(amount*xMult, amount*yMult));\n xy+=vec2(offsetX, offsetY);\n return xy;\n "},{name:"pixelate",type:"coord",inputs:[{type:"float",name:"pixelX",default:20},{type:"float",name:"pixelY",default:20}],glsl:" vec2 xy = vec2(pixelX, pixelY);\n return (floor(_st * xy) + 0.5)/xy;"},{name:"posterize",type:"color",inputs:[{type:"float",name:"bins",default:3},{type:"float",name:"gamma",default:.6}],glsl:" vec4 c2 = pow(_c0, vec4(gamma));\n c2 *= vec4(bins);\n c2 = floor(c2);\n c2/= vec4(bins);\n c2 = pow(c2, vec4(1.0/gamma));\n return vec4(c2.xyz, _c0.a);"},{name:"shift",type:"color",inputs:[{type:"float",name:"r",default:.5},{type:"float",name:"g",default:0},{type:"float",name:"b",default:0},{type:"float",name:"a",default:0}],glsl:" vec4 c2 = vec4(_c0);\n c2.r = fract(c2.r + r);\n c2.g = fract(c2.g + g);\n c2.b = fract(c2.b + b);\n c2.a = fract(c2.a + a);\n return vec4(c2.rgba);"},{name:"repeat",type:"coord",inputs:[{type:"float",name:"repeatX",default:3},{type:"float",name:"repeatY",default:3},{type:"float",name:"offsetX",default:0},{type:"float",name:"offsetY",default:0}],glsl:" vec2 st = _st * vec2(repeatX, repeatY);\n st.x += step(1., mod(st.y,2.0)) * offsetX;\n st.y += step(1., mod(st.x,2.0)) * offsetY;\n return fract(st);"},{name:"modulateRepeat",type:"combineCoord",inputs:[{type:"float",name:"repeatX",default:3},{type:"float",name:"repeatY",default:3},{type:"float",name:"offsetX",default:.5},{type:"float",name:"offsetY",default:.5}],glsl:" vec2 st = _st * vec2(repeatX, repeatY);\n st.x += step(1., mod(st.y,2.0)) + _c0.r * offsetX;\n st.y += step(1., mod(st.x,2.0)) + _c0.g * offsetY;\n return fract(st);"},{name:"repeatX",type:"coord",inputs:[{type:"float",name:"reps",default:3},{type:"float",name:"offset",default:0}],glsl:" vec2 st = _st * vec2(reps, 1.0);\n // float f = mod(_st.y,2.0);\n st.y += step(1., mod(st.x,2.0))* offset;\n return fract(st);"},{name:"modulateRepeatX",type:"combineCoord",inputs:[{type:"float",name:"reps",default:3},{type:"float",name:"offset",default:.5}],glsl:" vec2 st = _st * vec2(reps, 1.0);\n // float f = mod(_st.y,2.0);\n st.y += step(1., mod(st.x,2.0)) + _c0.r * offset;\n return fract(st);"},{name:"repeatY",type:"coord",inputs:[{type:"float",name:"reps",default:3},{type:"float",name:"offset",default:0}],glsl:" vec2 st = _st * vec2(1.0, reps);\n // float f = mod(_st.y,2.0);\n st.x += step(1., mod(st.y,2.0))* offset;\n return fract(st);"},{name:"modulateRepeatY",type:"combineCoord",inputs:[{type:"float",name:"reps",default:3},{type:"float",name:"offset",default:.5}],glsl:" vec2 st = _st * vec2(reps, 1.0);\n // float f = mod(_st.y,2.0);\n st.x += step(1., mod(st.y,2.0)) + _c0.r * offset;\n return fract(st);"},{name:"kaleid",type:"coord",inputs:[{type:"float",name:"nSides",default:4}],glsl:" vec2 st = _st;\n st -= 0.5;\n float r = length(st);\n float a = atan(st.y, st.x);\n float pi = 2.*3.1416;\n a = mod(a,pi/nSides);\n a = abs(a-pi/nSides/2.);\n return r*vec2(cos(a), sin(a));"},{name:"modulateKaleid",type:"combineCoord",inputs:[{type:"float",name:"nSides",default:4}],glsl:" vec2 st = _st - 0.5;\n float r = length(st);\n float a = atan(st.y, st.x);\n float pi = 2.*3.1416;\n a = mod(a,pi/nSides);\n a = abs(a-pi/nSides/2.);\n return (_c0.r+r)*vec2(cos(a), sin(a));"},{name:"scroll",type:"coord",inputs:[{type:"float",name:"scrollX",default:.5},{type:"float",name:"scrollY",default:.5},{type:"float",name:"speedX",default:0},{type:"float",name:"speedY",default:0}],glsl:"\n _st.x += scrollX + time*speedX;\n _st.y += scrollY + time*speedY;\n return fract(_st);"},{name:"scrollX",type:"coord",inputs:[{type:"float",name:"scrollX",default:.5},{type:"float",name:"speed",default:0}],glsl:" _st.x += scrollX + time*speed;\n return fract(_st);"},{name:"modulateScrollX",type:"combineCoord",inputs:[{type:"float",name:"scrollX",default:.5},{type:"float",name:"speed",default:0}],glsl:" _st.x += _c0.r*scrollX + time*speed;\n return fract(_st);"},{name:"scrollY",type:"coord",inputs:[{type:"float",name:"scrollY",default:.5},{type:"float",name:"speed",default:0}],glsl:" _st.y += scrollY + time*speed;\n return fract(_st);"},{name:"modulateScrollY",type:"combineCoord",inputs:[{type:"float",name:"scrollY",default:.5},{type:"float",name:"speed",default:0}],glsl:" _st.y += _c0.r*scrollY + time*speed;\n return fract(_st);"},{name:"add",type:"combine",inputs:[{type:"float",name:"amount",default:1}],glsl:" return (_c0+_c1)*amount + _c0*(1.0-amount);"},{name:"sub",type:"combine",inputs:[{type:"float",name:"amount",default:1}],glsl:" return (_c0-_c1)*amount + _c0*(1.0-amount);"},{name:"layer",type:"combine",inputs:[],glsl:" return vec4(mix(_c0.rgb, _c1.rgb, _c1.a), clamp(_c0.a + _c1.a, 0.0, 1.0));"},{name:"blend",type:"combine",inputs:[{type:"float",name:"amount",default:.5}],glsl:" return _c0*(1.0-amount)+_c1*amount;"},{name:"mult",type:"combine",inputs:[{type:"float",name:"amount",default:1}],glsl:" return _c0*(1.0-amount)+(_c0*_c1)*amount;"},{name:"diff",type:"combine",inputs:[],glsl:" return vec4(abs(_c0.rgb-_c1.rgb), max(_c0.a, _c1.a));"},{name:"modulate",type:"combineCoord",inputs:[{type:"float",name:"amount",default:.1}],glsl:" // return fract(st+(_c0.xy-0.5)*amount);\n return _st + _c0.xy*amount;"},{name:"modulateScale",type:"combineCoord",inputs:[{type:"float",name:"multiple",default:1},{type:"float",name:"offset",default:1}],glsl:" vec2 xy = _st - vec2(0.5);\n xy*=(1.0/vec2(offset + multiple*_c0.r, offset + multiple*_c0.g));\n xy+=vec2(0.5);\n return xy;"},{name:"modulatePixelate",type:"combineCoord",inputs:[{type:"float",name:"multiple",default:10},{type:"float",name:"offset",default:3}],glsl:" vec2 xy = vec2(offset + _c0.x*multiple, offset + _c0.y*multiple);\n return (floor(_st * xy) + 0.5)/xy;"},{name:"modulateRotate",type:"combineCoord",inputs:[{type:"float",name:"multiple",default:1},{type:"float",name:"offset",default:0}],glsl:" vec2 xy = _st - vec2(0.5);\n float angle = offset + _c0.x * multiple;\n xy = mat2(cos(angle),-sin(angle), sin(angle),cos(angle))*xy;\n xy += 0.5;\n return xy;"},{name:"modulateHue",type:"combineCoord",inputs:[{type:"float",name:"amount",default:1}],glsl:" return _st + (vec2(_c0.g - _c0.r, _c0.b - _c0.g) * amount * 1.0/resolution);"},{name:"invert",type:"color",inputs:[{type:"float",name:"amount",default:1}],glsl:" return vec4((1.0-_c0.rgb)*amount + _c0.rgb*(1.0-amount), _c0.a);"},{name:"contrast",type:"color",inputs:[{type:"float",name:"amount",default:1.6}],glsl:" vec4 c = (_c0-vec4(0.5))*vec4(amount) + vec4(0.5);\n return vec4(c.rgb, _c0.a);"},{name:"brightness",type:"color",inputs:[{type:"float",name:"amount",default:.4}],glsl:" return vec4(_c0.rgb + vec3(amount), _c0.a);"},{name:"mask",type:"combine",inputs:[],glsl:" float a = _luminance(_c1.rgb);\n return vec4(_c0.rgb*a, a*_c0.a);"},{name:"luma",type:"color",inputs:[{type:"float",name:"threshold",default:.5},{type:"float",name:"tolerance",default:.1}],glsl:" float a = smoothstep(threshold-(tolerance+0.0000001), threshold+(tolerance+0.0000001), _luminance(_c0.rgb));\n return vec4(_c0.rgb*a, a);"},{name:"thresh",type:"color",inputs:[{type:"float",name:"threshold",default:.5},{type:"float",name:"tolerance",default:.04}],glsl:" return vec4(vec3(smoothstep(threshold-(tolerance+0.0000001), threshold+(tolerance+0.0000001), _luminance(_c0.rgb))), _c0.a);"},{name:"color",type:"color",inputs:[{type:"float",name:"r",default:1},{type:"float",name:"g",default:1},{type:"float",name:"b",default:1},{type:"float",name:"a",default:1}],glsl:" vec4 c = vec4(r, g, b, a);\n vec4 pos = step(0.0, c); // detect whether negative\n // if > 0, return r * _c0\n // if < 0 return (1.0-r) * _c0\n return vec4(mix((1.0-_c0)*abs(c), c*_c0, pos));"},{name:"saturate",type:"color",inputs:[{type:"float",name:"amount",default:2}],glsl:" const vec3 W = vec3(0.2125, 0.7154, 0.0721);\n vec3 intensity = vec3(dot(_c0.rgb, W));\n return vec4(mix(intensity, _c0.rgb, amount), _c0.a);"},{name:"hue",type:"color",inputs:[{type:"float",name:"hue",default:.4}],glsl:" vec3 c = _rgbToHsv(_c0.rgb);\n c.r += hue;\n // c.r = fract(c.r);\n return vec4(_hsvToRgb(c), _c0.a);"},{name:"colorama",type:"color",inputs:[{type:"float",name:"amount",default:.005}],glsl:" vec3 c = _rgbToHsv(_c0.rgb);\n c += vec3(amount);\n c = _hsvToRgb(c);\n c = fract(c);\n return vec4(c, _c0.a);"},{name:"prev",type:"src",inputs:[],glsl:" return texture2D(prevBuffer, fract(_st));"},{name:"sum",type:"color",inputs:[{type:"vec4",name:"scale",default:1}],glsl:" vec4 v = _c0 * s;\n return v.r + v.g + v.b + v.a;\n }\n float sum(vec2 _st, vec4 s) { // vec4 is not a typo, because argument type is not overloaded\n vec2 v = _st.xy * s.xy;\n return v.x + v.y;"},{name:"r",type:"color",inputs:[{type:"float",name:"scale",default:1},{type:"float",name:"offset",default:0}],glsl:" return vec4(_c0.r * scale + offset);"},{name:"g",type:"color",inputs:[{type:"float",name:"scale",default:1},{type:"float",name:"offset",default:0}],glsl:" return vec4(_c0.g * scale + offset);"},{name:"b",type:"color",inputs:[{type:"float",name:"scale",default:1},{type:"float",name:"offset",default:0}],glsl:" return vec4(_c0.b * scale + offset);"},{name:"a",type:"color",inputs:[{type:"float",name:"scale",default:1},{type:"float",name:"offset",default:0}],glsl:" return vec4(_c0.a * scale + offset);"}]},{}],16:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default={_luminance:{type:"util",glsl:"float _luminance(vec3 rgb){\n const vec3 W = vec3(0.2125, 0.7154, 0.0721);\n return dot(rgb, W);\n }"},_noise:{type:"util",glsl:"\n //\tSimplex 3D Noise\n //\tby Ian McEwan, Ashima Arts\n vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}\n vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}\n\n float _noise(vec3 v){\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n // First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n // Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0. + 0.0 * C\n vec3 x1 = x0 - i1 + 1.0 * C.xxx;\n vec3 x2 = x0 - i2 + 2.0 * C.xxx;\n vec3 x3 = x0 - 1. + 3.0 * C.xxx;\n\n // Permutations\n i = mod(i, 289.0 );\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n // Gradients\n // ( N*N points uniformly over a square, mapped onto an octahedron.)\n float n_ = 1.0/7.0; // N=7\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z *ns.z); // mod(p,N*N)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n //Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n // Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n }\n "},_rgbToHsv:{type:"util",glsl:"vec3 _rgbToHsv(vec3 c){\n vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));\n vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));\n\n float d = q.x - min(q.w, q.y);\n float e = 1.0e-10;\n return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);\n }"},_hsvToRgb:{type:"util",glsl:"vec3 _hsvToRgb(vec3 c){\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n }"}}},{}],17:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(e("./lib/webcam.js")),i=o(e("./lib/screenmedia.js"));function o(e){return e&&e.__esModule?e:{default:e}}n.default=class{constructor({regl:e,width:t,height:n,pb:r,label:i=""}){this.label=i,this.regl=e,this.src=null,this.dynamic=!0,this.width=t,this.height=n,this.tex=this.regl.texture({shape:[1,1]}),this.pb=r}init(e,t){"src"in e&&(this.src=e.src,this.tex=this.regl.texture({data:this.src,...t})),"dynamic"in e&&(this.dynamic=e.dynamic)}initCam(e,t){const n=this;(0,r.default)(e).then((e=>{n.src=e.video,n.dynamic=!0,n.tex=n.regl.texture({data:n.src,...t})})).catch((e=>console.log("could not get camera",e)))}initVideo(e="",t){const n=document.createElement("video");n.crossOrigin="anonymous",n.autoplay=!0,n.loop=!0,n.muted=!0,n.addEventListener("loadeddata",(()=>{this.src=n,n.play(),this.tex=this.regl.texture({data:this.src,...t}),this.dynamic=!0})),n.src=e}initImage(e="",t){const n=document.createElement("img");n.crossOrigin="anonymous",n.src=e,n.onload=()=>{this.src=n,this.dynamic=!1,this.tex=this.regl.texture({data:this.src,...t})}}initStream(e,t){let n=this;e&&this.pb&&(this.pb.initSource(e),this.pb.on("got video",(function(r,i){r===e&&(n.src=i,n.dynamic=!0,n.tex=n.regl.texture({data:n.src,...t}))})))}initScreen(e=0,t){const n=this;(0,i.default)().then((function(e){n.src=e.video,n.tex=n.regl.texture({data:n.src,...t}),n.dynamic=!0})).catch((e=>console.log("could not get screen",e)))}resize(e,t){this.width=e,this.height=t}clear(){this.src&&this.src.srcObject&&this.src.srcObject.getTracks&&this.src.srcObject.getTracks().forEach((e=>e.stop())),this.src=null,this.tex=this.regl.texture({shape:[1,1]})}tick(e){null!==this.src&&!0===this.dynamic&&(this.src.videoWidth&&this.src.videoWidth!==this.tex.width&&(console.log(this.src.videoWidth,this.src.videoHeight,this.tex.width,this.tex.height),this.tex.resize(this.src.videoWidth,this.src.videoHeight)),this.src.width&&this.src.width!==this.tex.width&&this.tex.resize(this.src.width,this.src.height),this.tex.subimage(this.src))}getTexture(){return this.tex}}},{"./lib/screenmedia.js":26,"./lib/webcam.js":28}],18:[function(e,t,n){(function(t){(function(){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=p(e("./output.js")),i=p(e("raf-loop")),o=p(e("./hydra-source.js")),a=p(e("./lib/mouse.js")),s=p(e("./lib/audio.js")),u=p(e("./lib/video-recorder.js")),c=p(e("./lib/array-utils.js")),f=p(e("./eval-sandbox.js")),l=p(e("./generator-factory.js")),h=p(e("regl"));function p(e){return e&&e.__esModule?e:{default:e}}const d=(0,a.default)();n.default=class{constructor({pb:e=null,width:n=1280,height:r=720,numSources:o=4,numOutputs:a=4,makeGlobal:s=!0,autoLoop:l=!0,detectAudio:h=!0,enableStreamCapture:p=!0,canvas:m,precision:g,extendTransforms:v={}}={}){if(c.default.init(),this.pb=e,this.width=n,this.height=r,this.renderAll=!1,this.detectAudio=h,this._initCanvas(m),t.window.test="hi",this.synth={time:0,bpm:30,width:this.width,height:this.height,fps:void 0,stats:{fps:0},speed:1,mouse:d,render:this._render.bind(this),setResolution:this.setResolution.bind(this),update:e=>{},hush:this.hush.bind(this),tick:this.tick.bind(this)},s&&(window.loadScript=this.loadScript),this.timeSinceLastUpdate=0,this._time=0,g&&["lowp","mediump","highp"].includes(g.toLowerCase()))this.precision=g.toLowerCase();else{let e=(/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&!window.MSStream;this.precision=e?"highp":"mediump"}if(this.extendTransforms=v,this.saveFrame=!1,this.captureStream=null,this.generator=void 0,this._initRegl(),this._initOutputs(a),this._initSources(o),this._generateGlslTransforms(),this.synth.screencap=()=>{this.saveFrame=!0},p)try{this.captureStream=this.canvas.captureStream(25),this.synth.vidRecorder=new u.default(this.captureStream)}catch(e){console.warn("[hydra-synth warning]\nnew MediaSource() is not currently supported on iOS."),console.error(e)}h&&this._initAudio(),l&&(0,i.default)(this.tick.bind(this)).start(),this.sandbox=new f.default(this.synth,s,["speed","update","bpm","fps"])}eval(e){this.sandbox.eval(e)}getScreenImage(e){this.imageCallback=e,this.saveFrame=!0}hush(){this.s.forEach((e=>{e.clear()})),this.o.forEach((e=>{this.synth.solid(0,0,0,0).out(e)})),this.synth.render(this.o[0]),this.sandbox.set("update",(e=>{}))}loadScript(e=""){return new Promise(((t,n)=>{var r=document.createElement("script");r.onload=function(){console.log(`loaded script ${e}`),t()},r.onerror=n=>{console.log(`error loading script ${e}`,"log-error"),t()},r.src=e,document.head.appendChild(r)}))}setResolution(e,t){this.canvas.width=e,this.canvas.height=t,this.width=e,this.height=t,this.sandbox.set("width",e),this.sandbox.set("height",t),console.log(this.width),this.o.forEach((n=>{n.resize(e,t)})),this.s.forEach((n=>{n.resize(e,t)})),this.regl._refresh(),console.log(this.canvas.width)}canvasToImage(e){const t=document.createElement("a");t.style.display="none";let n=new Date;t.download=`hydra-${n.getFullYear()}-${n.getMonth()+1}-${n.getDate()}-${n.getHours()}.${n.getMinutes()}.${n.getSeconds()}.png`,document.body.appendChild(t);var r=this;this.canvas.toBlob((e=>{r.imageCallback?(r.imageCallback(e),delete r.imageCallback):(t.href=URL.createObjectURL(e),console.log(t.href),t.click())}),"image/png"),setTimeout((()=>{document.body.removeChild(t),window.URL.revokeObjectURL(t.href)}),300)}_initAudio(){this.synth.a=new s.default({numBins:4,parentEl:this.canvas.parentNode})}_initCanvas(e){e?(this.canvas=e,this.width=e.width,this.height=e.height):(this.canvas=document.createElement("canvas"),this.canvas.width=this.width,this.canvas.height=this.height,this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.imageRendering="pixelated",document.body.appendChild(this.canvas))}_initRegl(){this.regl=(0,h.default)({canvas:this.canvas,pixelRatio:1}),this.regl.clear({color:[0,0,0,1]}),this.renderAll=this.regl({frag:`\n precision ${this.precision} float;\n varying vec2 uv;\n uniform sampler2D tex0;\n uniform sampler2D tex1;\n uniform sampler2D tex2;\n uniform sampler2D tex3;\n\n void main () {\n vec2 st = vec2(1.0 - uv.x, uv.y);\n st*= vec2(2);\n vec2 q = floor(st).xy*(vec2(2.0, 1.0));\n int quad = int(q.x) + int(q.y);\n st.x += step(1., mod(st.y,2.0));\n st.y += step(1., mod(st.x,2.0));\n st = fract(st);\n if(quad==0){\n gl_FragColor = texture2D(tex0, st);\n } else if(quad==1){\n gl_FragColor = texture2D(tex1, st);\n } else if (quad==2){\n gl_FragColor = texture2D(tex2, st);\n } else {\n gl_FragColor = texture2D(tex3, st);\n }\n\n }\n `,vert:`\n precision ${this.precision} float;\n attribute vec2 position;\n varying vec2 uv;\n\n void main () {\n uv = position;\n gl_Position = vec4(1.0 - 2.0 * position, 0, 1);\n }`,attributes:{position:[[-2,0],[0,-2],[2,2]]},uniforms:{tex0:this.regl.prop("tex0"),tex1:this.regl.prop("tex1"),tex2:this.regl.prop("tex2"),tex3:this.regl.prop("tex3")},count:3,depth:{enable:!1}}),this.renderFbo=this.regl({frag:`\n precision ${this.precision} float;\n varying vec2 uv;\n uniform vec2 resolution;\n uniform sampler2D tex0;\n\n void main () {\n gl_FragColor = texture2D(tex0, vec2(1.0 - uv.x, uv.y));\n }\n `,vert:`\n precision ${this.precision} float;\n attribute vec2 position;\n varying vec2 uv;\n\n void main () {\n uv = position;\n gl_Position = vec4(1.0 - 2.0 * position, 0, 1);\n }`,attributes:{position:[[-2,0],[0,-2],[2,2]]},uniforms:{tex0:this.regl.prop("tex0"),resolution:this.regl.prop("resolution")},count:3,depth:{enable:!1}})}_initOutputs(e){const t=this;this.o=Array(e).fill().map(((e,n)=>{var i=new r.default({regl:this.regl,width:this.width,height:this.height,precision:this.precision,label:`o${n}`});return i.id=n,t.synth["o"+n]=i,i})),this.output=this.o[0]}_initSources(e){this.s=[];for(var t=0;t<e;t++)this.createSource(t)}createSource(e){let t=new o.default({regl:this.regl,pb:this.pb,width:this.width,height:this.height,label:`s${e}`});return this.synth["s"+this.s.length]=t,this.s.push(t),t}_generateGlslTransforms(){var e=this;this.generator=new l.default({defaultOutput:this.o[0],defaultUniforms:this.o[0].uniforms,extendTransforms:this.extendTransforms,changeListener:({type:t,method:n,synth:r})=>{"add"===t&&(e.synth[n]=r.generators[n],e.sandbox&&e.sandbox.add(n))}}),this.synth.setFunction=this.generator.setFunction.bind(this.generator)}_render(e){e?(this.output=e,this.isRenderingAll=!1):this.isRenderingAll=!0}tick(e,t){if(this.sandbox.tick(),!0===this.detectAudio&&this.synth.a.tick(),this.sandbox.set("time",this.synth.time+=.001*e*this.synth.speed),this.timeSinceLastUpdate+=e,!this.synth.fps||this.timeSinceLastUpdate>=1e3/this.synth.fps){if(this.synth.stats.fps=Math.ceil(1e3/this.timeSinceLastUpdate),this.synth.update)try{this.synth.update(this.timeSinceLastUpdate)}catch(e){console.log(e)}for(let e=0;e<this.s.length;e++)this.s[e].tick(this.synth.time);for(let e=0;e<this.o.length;e++)this.o[e].tick({time:this.synth.time,mouse:this.synth.mouse,bpm:this.synth.bpm,resolution:[this.canvas.width,this.canvas.height]});this.isRenderingAll?this.renderAll({tex0:this.o[0].getCurrent(),tex1:this.o[1].getCurrent(),tex2:this.o[2].getCurrent(),tex3:this.o[3].getCurrent(),resolution:[this.canvas.width,this.canvas.height]}):this.renderFbo({tex0:this.output.getCurrent(),resolution:[this.canvas.width,this.canvas.height]}),this.timeSinceLastUpdate=0}!0===this.saveFrame&&(this.canvasToImage(),this.saveFrame=!1)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./eval-sandbox.js":10,"./generator-factory.js":13,"./hydra-source.js":17,"./lib/array-utils.js":20,"./lib/audio.js":21,"./lib/mouse.js":24,"./lib/video-recorder.js":27,"./output.js":29,"raf-loop":6,regl:8}],19:[function(e,t,n){var r,i=(r=e("./hydra-synth.js"))&&r.__esModule?r:{default:r};t.exports=i.default},{"./hydra-synth.js":18}],20:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r,i=(r=e("./easing-functions.js"))&&r.__esModule?r:{default:r},o={init:()=>{Array.prototype.fast=function(e=1){return this._speed=e,this},Array.prototype.smooth=function(e=1){return this._smooth=e,this},Array.prototype.ease=function(e="linear"){return"function"==typeof e?(this._smooth=1,this._ease=e):i.default[e]&&(this._smooth=1,this._ease=i.default[e]),this},Array.prototype.offset=function(e=.5){return this._offset=e%1,this},Array.prototype.fit=function(e=0,t=1){let n=Math.min(...this),r=Math.max(...this);var i=this.map((i=>((e,t,n,r,i)=>(e-t)*(i-r)/(n-t)+r)(i,n,r,e,t)));return i._speed=this._speed,i._smooth=this._smooth,i._ease=this._ease,i}},getValue:(e=[])=>({time:t,bpm:n})=>{let r=e._speed?e._speed:1,o=e._smooth?e._smooth:0,a=t*r*(n/60)+(e._offset||0);if(0!==o){let t=e._ease?e._ease:i.default.linear,n=a-o/2,r=e[Math.floor(n%e.length)],s=e[Math.floor((n+1)%e.length)];return t(Math.min(n%1/o,1))*(s-r)+r}return e[Math.floor(a%e.length)],e[Math.floor(a%e.length)]}};n.default=o},{"./easing-functions.js":22}],21:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r,i=(r=e("meyda"))&&r.__esModule?r:{default:r};n.default=class{constructor({numBins:e=4,cutoff:t=2,smooth:n=.4,max:r=15,scale:o=10,isDrawing:a=!1,parentEl:s=document.body}){this.vol=0,this.scale=o,this.max=r,this.cutoff=t,this.smooth=n,this.setBins(e),this.beat={holdFrames:20,threshold:40,_cutoff:0,decay:.98,_framesSinceBeat:0},this.onBeat=()=>{},this.canvas=document.createElement("canvas"),this.canvas.width=100,this.canvas.height=80,this.canvas.style.width="100px",this.canvas.style.height="80px",this.canvas.style.position="absolute",this.canvas.style.right="0px",this.canvas.style.bottom="0px",s.appendChild(this.canvas),this.isDrawing=a,this.ctx=this.canvas.getContext("2d"),this.ctx.fillStyle="#DFFFFF",this.ctx.strokeStyle="#0ff",this.ctx.lineWidth=.5,window.navigator.mediaDevices&&window.navigator.mediaDevices.getUserMedia({video:!1,audio:!0}).then((e=>{this.stream=e,this.context=new AudioContext;let t=this.context.createMediaStreamSource(e);this.meyda=i.default.createMeydaAnalyzer({audioContext:this.context,source:t,featureExtractors:["loudness"]})})).catch((e=>console.log("ERROR",e)))}detectBeat(e){e>this.beat._cutoff&&e>this.beat.threshold?(this.onBeat(),this.beat._cutoff=1.2*e,this.beat._framesSinceBeat=0):this.beat._framesSinceBeat<=this.beat.holdFrames?this.beat._framesSinceBeat++:(this.beat._cutoff*=this.beat.decay,this.beat._cutoff=Math.max(this.beat._cutoff,this.beat.threshold))}tick(){if(this.meyda){var e=this.meyda.get();if(e&&null!==e){this.vol=e.loudness.total,this.detectBeat(this.vol);const t=(e,t)=>e+t;let n=Math.floor(e.loudness.specific.length/this.bins.length);this.prevBins=this.bins.slice(0),this.bins=this.bins.map(((r,i)=>e.loudness.specific.slice(i*n,(i+1)*n).reduce(t))).map(((e,t)=>e*(1-this.settings[t].smooth)+this.prevBins[t]*this.settings[t].smooth)),this.fft=this.bins.map(((e,t)=>Math.max(0,(e-this.settings[t].cutoff)/this.settings[t].scale))),this.isDrawing&&this.draw()}}}setCutoff(e){this.cutoff=e,this.settings=this.settings.map((t=>(t.cutoff=e,t)))}setSmooth(e){this.smooth=e,this.settings=this.settings.map((t=>(t.smooth=e,t)))}setBins(e){this.bins=Array(e).fill(0),this.prevBins=Array(e).fill(0),this.fft=Array(e).fill(0),this.settings=Array(e).fill(0).map((()=>({cutoff:this.cutoff,scale:this.scale,smooth:this.smooth}))),this.bins.forEach(((e,t)=>{window["a"+t]=(e=1,n=0)=>()=>a.fft[t]*e+n}))}setScale(e){this.scale=e,this.settings=this.settings.map((t=>(t.scale=e,t)))}setMax(e){this.max=e,console.log("set max is deprecated")}hide(){this.isDrawing=!1,this.canvas.style.display="none"}show(){this.isDrawing=!0,this.canvas.style.display="block"}draw(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height);var e=this.canvas.width/this.bins.length,t=this.canvas.height/(2*this.max);this.bins.forEach(((n,r)=>{var i=n*t;this.ctx.fillRect(r*e,this.canvas.height-i,e,i);var o=this.canvas.height-t*this.settings[r].cutoff;this.ctx.beginPath(),this.ctx.moveTo(r*e,o),this.ctx.lineTo((r+1)*e,o),this.ctx.stroke();var a=this.canvas.height-t*(this.settings[r].scale+this.settings[r].cutoff);this.ctx.beginPath(),this.ctx.moveTo(r*e,a),this.ctx.lineTo((r+1)*e,a),this.ctx.stroke()}))}}},{meyda:3}],22:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return e<.5?2*e*e:(4-2*e)*e-1},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e},sin:function(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}};n.default=r},{}],23:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;const r={buttons:function(e){if("object"==typeof e){if("buttons"in e)return e.buttons;if("which"in e){if(2===(t=e.which))return 4;if(3===t)return 2;if(t>0)return 1<<t-1}else if("button"in e){var t;if(1===(t=e.button))return 4;if(2===t)return 2;if(t>=0)return 1<<t}}return 0},element:function(e){return e.target||e.srcElement||window},x:function(e){return"object"==typeof e&&"pageX"in e?e.pageX:0},y:function(e){return"object"==typeof e&&"pageY"in e?e.pageY:0}};var i=r;n.default=i},{}],24:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r,i=(r=e("./mouse-event.js"))&&r.__esModule?r:{default:r};n.default=function(e,t){t||(t=e,e=window);var n=0,r=0,o=0,a={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function u(e){var t=!1;return"altKey"in e&&(t=t||e.altKey!==a.alt,a.alt=!!e.altKey),"shiftKey"in e&&(t=t||e.shiftKey!==a.shift,a.shift=!!e.shiftKey),"ctrlKey"in e&&(t=t||e.ctrlKey!==a.control,a.control=!!e.ctrlKey),"metaKey"in e&&(t=t||e.metaKey!==a.meta,a.meta=!!e.metaKey),t}function c(e,s){var c=i.default.x(s),f=i.default.y(s);"buttons"in s&&(e=0|s.buttons),(e!==n||c!==r||f!==o||u(s))&&(n=0|e,r=c||0,o=f||0,t&&t(n,r,o,a))}function f(e){c(0,e)}function l(){(n||r||o||a.shift||a.alt||a.meta||a.control)&&(r=o=0,n=0,a.shift=a.alt=a.control=a.meta=!1,t&&t(0,0,0,a))}function h(e){u(e)&&t&&t(n,r,o,a)}function p(e){0===i.default.buttons(e)?c(0,e):c(n,e)}function d(e){c(n|i.default.buttons(e),e)}function m(e){c(n&~i.default.buttons(e),e)}function g(){s||(s=!0,e.addEventListener("mousemove",p),e.addEventListener("mousedown",d),e.addEventListener("mouseup",m),e.addEventListener("mouseleave",f),e.addEventListener("mouseenter",f),e.addEventListener("mouseout",f),e.addEventListener("mouseover",f),e.addEventListener("blur",l),e.addEventListener("keyup",h),e.addEventListener("keydown",h),e.addEventListener("keypress",h),e!==window&&(window.addEventListener("blur",l),window.addEventListener("keyup",h),window.addEventListener("keydown",h),window.addEventListener("keypress",h)))}g();var v={element:e};return Object.defineProperties(v,{enabled:{get:function(){return s},set:function(t){t?g():s&&(s=!1,e.removeEventListener("mousemove",p),e.removeEventListener("mousedown",d),e.removeEventListener("mouseup",m),e.removeEventListener("mouseleave",f),e.removeEventListener("mouseenter",f),e.removeEventListener("mouseout",f),e.removeEventListener("mouseover",f),e.removeEventListener("blur",l),e.removeEventListener("keyup",h),e.removeEventListener("keydown",h),e.removeEventListener("keypress",h),e!==window&&(window.removeEventListener("blur",l),window.removeEventListener("keyup",h),window.removeEventListener("keydown",h),window.removeEventListener("keypress",h)))},enumerable:!0},buttons:{get:function(){return n},enumerable:!0},x:{get:function(){return r},enumerable:!0},y:{get:function(){return o},enumerable:!0},mods:{get:function(){return a},enumerable:!0}}),v}},{"./mouse-event.js":23}],25:[function(require,module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default=parent=>{var initialCode="",sandbox=createSandbox(initialCode),addToContext=(e,t)=>{sandbox=createSandbox(initialCode+=`\n var ${e} = ${t}\n `)};return{addToContext,eval:e=>sandbox.eval(e)};function createSandbox(initial){eval(initial);var localEval=function(code){eval(code)};return{eval:localEval}}};exports.default=_default},{}],26:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e){return new Promise((function(t,n){navigator.mediaDevices.getDisplayMedia(e).then((e=>{const n=document.createElement("video");n.srcObject=e,n.addEventListener("loadedmetadata",(()=>{n.play(),t({video:n})}))})).catch((e=>n(e)))}))}},{}],27:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=class{constructor(e){this.mediaSource=new MediaSource,this.stream=e,this.output=document.createElement("video"),this.output.autoplay=!0,this.output.loop=!0;let t=this;this.mediaSource.addEventListener("sourceopen",(()=>{console.log("MediaSource opened"),t.sourceBuffer=t.mediaSource.addSourceBuffer('video/webm; codecs="vp8"'),console.log("Source buffer: ",sourceBuffer)}))}start(){let e={mimeType:"video/webm;codecs=vp9"};this.recordedBlobs=[];try{this.mediaRecorder=new MediaRecorder(this.stream,e)}catch(t){console.log("Unable to create MediaRecorder with options Object: ",t);try{e={mimeType:"video/webm,codecs=vp9"},this.mediaRecorder=new MediaRecorder(this.stream,e)}catch(t){console.log("Unable to create MediaRecorder with options Object: ",t);try{e="video/vp8",this.mediaRecorder=new MediaRecorder(this.stream,e)}catch(e){return alert("MediaRecorder is not supported by this browser.\n\nTry Firefox 29 or later, or Chrome 47 or later, with Enable experimental Web Platform features enabled from chrome://flags."),void console.error("Exception while creating MediaRecorder:",e)}}}console.log("Created MediaRecorder",this.mediaRecorder,"with options",e),this.mediaRecorder.onstop=this._handleStop.bind(this),this.mediaRecorder.ondataavailable=this._handleDataAvailable.bind(this),this.mediaRecorder.start(100),console.log("MediaRecorder started",this.mediaRecorder)}stop(){this.mediaRecorder.stop()}_handleStop(){const e=new Blob(this.recordedBlobs,{type:this.mediaRecorder.mimeType}),t=window.URL.createObjectURL(e);this.output.src=t;const n=document.createElement("a");n.style.display="none",n.href=t;let r=new Date;n.download=`hydra-${r.getFullYear()}-${r.getMonth()+1}-${r.getDate()}-${r.getHours()}.${r.getMinutes()}.${r.getSeconds()}.webm`,document.body.appendChild(n),n.click(),setTimeout((()=>{document.body.removeChild(n),window.URL.revokeObjectURL(t)}),300)}_handleDataAvailable(e){e.data&&e.data.size>0&&this.recordedBlobs.push(e.data)}}},{}],28:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e){return navigator.mediaDevices.enumerateDevices().then((e=>e.filter((e=>"videoinput"===e.kind)))).then((t=>{let n={audio:!1,video:!0};return t[e]&&(n.video={deviceId:{exact:t[e].deviceId}}),window.navigator.mediaDevices.getUserMedia(n)})).then((e=>{const t=document.createElement("video");return t.setAttribute("autoplay",""),t.setAttribute("muted",""),t.setAttribute("playsinline",""),t.srcObject=e,new Promise(((e,n)=>{t.addEventListener("loadedmetadata",(()=>{t.play().then((()=>e({video:t})))}))}))})).catch(console.log.bind(console))}},{}],29:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=function({regl:e,precision:t,label:n="",width:r,height:i}){this.regl=e,this.precision=t,this.label=n,this.positionBuffer=this.regl.buffer([[-2,0],[0,-2],[2,2]]),this.draw=()=>{},this.init(),this.pingPongIndex=0,this.fbos=Array(2).fill().map((()=>this.regl.framebuffer({color:this.regl.texture({mag:"nearest",width:r,height:i,format:"rgba"}),depthStencil:!1})))};r.prototype.resize=function(e,t){this.fbos.forEach((n=>{n.resize(e,t)}))},r.prototype.getCurrent=function(){return this.fbos[this.pingPongIndex]},r.prototype.getTexture=function(){var e=this.pingPongIndex?0:1;return this.fbos[e]},r.prototype.init=function(){return this.transformIndex=0,this.fragHeader=`\n precision ${this.precision} float;\n\n uniform float time;\n varying vec2 uv;\n `,this.fragBody="",this.vert=`\n precision ${this.precision} float;\n attribute vec2 position;\n varying vec2 uv;\n\n void main () {\n uv = position;\n gl_Position = vec4(2.0 * position - 1.0, 0, 1);\n }`,this.attributes={position:this.positionBuffer},this.uniforms={time:this.regl.prop("time"),resolution:this.regl.prop("resolution")},this.frag=`\n ${this.fragHeader}\n\n void main () {\n vec4 c = vec4(0, 0, 0, 0);\n vec2 st = uv;\n ${this.fragBody}\n gl_FragColor = c;\n }\n `,this},r.prototype.render=function(e){let t=e[0];var n=this,r=Object.assign(t.uniforms,{prevBuffer:()=>n.fbos[n.pingPongIndex]});n.draw=n.regl({frag:t.frag,vert:n.vert,attributes:n.attributes,uniforms:r,count:3,framebuffer:()=>(n.pingPongIndex=n.pingPongIndex?0:1,n.fbos[n.pingPongIndex])})},r.prototype.tick=function(e){this.draw(e)};var i=r;n.default=i},{}]},{},[19])(19)}))}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})(),__webpack_require__.nc=void 0;var __webpack_exports__={};(()=>{"use strict";__webpack_require__(578);var e=__webpack_require__(379),t=__webpack_require__.n(e),n=__webpack_require__(795),r=__webpack_require__.n(n),i=__webpack_require__(569),o=__webpack_require__.n(i),a=__webpack_require__(565),s=__webpack_require__.n(a),u=__webpack_require__(216),c=__webpack_require__.n(u),f=__webpack_require__(589),l=__webpack_require__.n(f),h=__webpack_require__(890),p={};p.styleTagTransform=l(),p.setAttributes=s(),p.insert=o().bind(null,"head"),p.domAPI=r(),p.insertStyleElement=c(),t()(h.Z,p),h.Z&&h.Z.locals&&h.Z.locals;var d=__webpack_require__(724),m={};m.styleTagTransform=l(),m.setAttributes=s(),m.insert=o().bind(null,"head"),m.domAPI=r(),m.insertStyleElement=c(),t()(d.Z,m),d.Z&&d.Z.locals&&d.Z.locals;const g=__webpack_require__.p+"a8ab26808292b53c1f37.jpg",v=__webpack_require__.p+"efe58178f13dfb6e526a.jpg",y=__webpack_require__.p+"c35607081c4eaa2f4389.jpg";function b(){var e=document.querySelector(".modal");e.classList.contains("visible")?e.classList.replace("visible","oculto"):e.classList.replace("oculto","visible")}var w=__webpack_require__(135),x=__webpack_require__(523),_=__webpack_require__(937);function A(e,t,n){return 180*function(e,t,n){var r=Math.atan2(n.y-t.y,n.x-t.x)-Math.atan2(e.y-t.y,e.x-t.x);return(r=Math.abs(r))>Math.PI&&(r=2*Math.PI-r),r}(e,t,n)/Math.PI}var k=__webpack_require__(423);function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var E=0,j=0,T=!1,C=!1,O=[{operacion:"osc",args:[4,.5,.75]}],M=!0;function F(e){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F(e)}function D(){D=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function c(e,t,n,i){var o=t&&t.prototype instanceof h?t:h,a=Object.create(o.prototype),s=new S(i||[]);return r(a,"_invoke",{value:x(e,n,s)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var l={};function h(){}function p(){}function d(){}var m={};u(m,o,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(E([])));v&&v!==t&&n.call(v,o)&&(m=v);var y=d.prototype=h.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function i(r,o,a,s){var u=f(e[r],e,o);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==F(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return i("throw",e,a,s)}))}s(u.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function x(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=_(a,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=f(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function _(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,_(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=f(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,l;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function E(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:j}}function j(){return{value:void 0,done:!0}}return p.prototype=d,r(y,"constructor",{value:d,configurable:!0}),r(d,"constructor",{value:p,configurable:!0}),p.displayName=u(d,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,u(e,s,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(w.prototype),u(w.prototype,a,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new w(c(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(y),u(y,s,"Generator"),u(y,o,(function(){return this})),u(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=E,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},e}function L(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}var P=document.createElement("div");P.classList.add("container"),document.body.appendChild(P),function(){var e,t=document.querySelector(".container"),n=document.createElement("CANVAS");n.className="output_canvas",n.width=innerWidth,n.height=innerHeight,n.id="canvas-hydra",t.appendChild(n),t.appendChild(((e=document.createElement("CANVAS")).width=window.innerWidth,e.height=window.innerHeight,new Hydra({canvas:e,autoLoop:!0,makeGlobal:!0,detectAudio:!1,numSources:4,numOutputs:4,extendTransforms:[],precision:null,pb:null}),e))}(),function(){var e=document.createElement("DIV"),t=document.createElement("DIV"),n=document.createElement("DIV");e.classList.add("modal","visible"),t.classList.add("modal-content"),n.classList.add("modal-header");var r=document.createElement("Div"),i=document.createElement("I");i.classList.add("btn-close"),i.addEventListener("click",b),i.innerHTML="X",r.appendChild(i),r.appendChild(i),n.appendChild(r);var o=document.createElement("A");o.href="https://gitlab.com/stfg.prof/hydra-webpack-mp",o.innerText="\n\n Link al repositorio de esta aplicacion",o.setAttribute("target","_blank");var a=document.createElement("P");a.innerText="\n\n Esta aplicacion esta basada en hydra-synth de Olivia Jack integrando el reconocimiento de manos utilizando mediapipe de google \n\n";var s=document.createElement("P");s.innerText="\n\n al entrar en la web se pediran permisos para la camara una vez hecho esto, la camara capturarra la posicion de las manos como se ve a continuacion (Es importante que la camara caputure solamente una mano)\n\n";var u=document.createElement("P");u.innerText=" \n\n para agregar una operacion se utiliza el gesto de cerrar (el tiempo que se mantenga cerrado es importante) \n se sabra que la aplicacion esta leyendo correctamente el gesto por que se vuelven blancas los puntos de trackeo.\n\n";var c=document.createElement("P");c.innerText=" \n\n al entrar en la web se pediran permisos para la camara una vez hecho esto, la camara capturarra la posicion de las manos como se ve a continuacion \n\n";var f=document.createElement("P");f.innerText="\n\n";var l=document.createElement("IMG");l.src=g,l.setAttribute("alt","ejemplo 1 ");var h=document.createElement("img");h.src=v,h.setAttribute("alt","ejemplo 1 ");var p=document.createElement("img");p.src=y,p.setAttribute("alt","ejemplo 1 "),t.appendChild(n),t.appendChild(o),t.appendChild(a),t.appendChild(s),t.appendChild(l),t.appendChild(u),t.appendChild(h),t.appendChild(c),t.appendChild(p),t.appendChild(f),e.appendChild(t),document.body.appendChild(e)}();var B=document.createElement("VIDEO");B.className="input_video",B.style.display="none",document.body.appendChild(B);var R,I,z=new x.Hands({locateFile:function(e){return"public/hands/".concat(e)}});z.setOptions({maxNumHands:2,modelComplexity:1,minDetectionConfidence:.5,minTrackingConfidence:.5}),z.onResults((function(e){var t=document.querySelector("#canvas-hydra"),n=t.getContext("2d"),r=n.canvas.width,i=n.canvas.height;M&&((0,_.c7)(O),M=!1);var o=e.multiHandLandmarks;if(o.length>0){n.save(),n.clearRect(0,0,t.width,t.height),n.scale(-1,1),n.translate(-t.width,0);var a,s=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(o);try{for(s.s();!(a=s.n()).done;){var u=a.value;T?(0,k.drawLandmarks)(n,u,{color:"#FFFFFF",lineWidth:.1}):(0,k.drawLandmarks)(n,u,{color:"#000000",lineWidth:.1})}}catch(e){s.e(e)}finally{s.f()}n.resetTransform(),n.strokeStyle="#FFFFFF";for(var c=0;c<=3;c++)n.beginPath(),n.moveTo(r*(c/3),0),n.lineTo(r*(c/3),i),n.stroke();for(var f=0;f<=3;f++)n.beginPath(),n.moveTo(0,i*(f/3)),n.lineTo(r,i*(f/3)),n.stroke();if(n.restore(),1==o.length){var l=o[0],h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:55,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:145,r=A(e[8],e[5],e[1]),i=A(e[12],e[9],e[1]),o=A(e[16],e[13],e[1]),a=A(e[20],e[17],e[1]);return r<t&&i<t&&o<t&&a<t?1:r>n&&i>n&&o>n&&a>n?0:-1}(l),p=function(e){for(var t=0,n=0,r=0,i=0;i<21;i++){var o=e[i];t+=o.x,n+=o.y,r+=o.z}return{x:t/=21,y:n/=21,z:r/=21}}(l),d=function(e){var t=e.x,n=e.y;return t>1||n>1||t<0||n<0?-1:t<=1&&n<1&&t>=.6666&&n>=.6666?9:t<.6666&&n<1&&t>=.3333&&n>=.6666?8:t<.3333&&n<1&&n>=.6666?7:t<=1&&n<.6666&&t>=.6666&&n>=.3333?6:t<=.6666&&n<.6666&&t>=.3333&&n>=.3333?5:t<.3333&&n<.6666&&n>=.3333?4:t<=1&&n<.3333&&t>=.6666?3:t<.6666&&t>=.3333?2:1}({x:1-p.x,y:p.y});if(-1==h);else if(1==h)j>5&&(T=!0),C&&j++;else if(0==h){if(T){switch(d){case 1:(0,_.l)(O,".rotate",[0,j/100]);break;case 2:(0,_.l)(O,".blend",["src(o0)",j%100/100]);break;case 3:(0,_.l)(O,".scrollX",[0,j/20]);break;case 4:(0,_.l)(O,".kaleid",j/20);break;case 5:(0,_.l)(O,".colorama",[j/20]);break;case 6:(0,_.l)(O,".mult","noise("+(j/20).toString()+")");break;case 7:(0,_.l)(O,".diff","osc("+(j/10).toString()+",0.1,5).rotate(0,.1)");break;case 8:(0,_.l)(O,".modulateHue",["src(o0)",j]);break;case 9:(0,_.l)(O,".saturate","() => Math.sin(time*0.5)*0.5+0.75")}var m=(0,_.c7)(O);console.log(m),T=!1}j=0}C=!0,E=0}else++E>=10&&(C=!1)}else n.clearRect(0,0,t.width,t.height)})),new w.Camera(B,{onFrame:(R=D().mark((function e(){return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z.send({image:B});case 2:case"end":return e.stop()}}),e)})),I=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=R.apply(e,t);function o(e){L(i,n,r,o,a,"next",e)}function a(e){L(i,n,r,o,a,"throw",e)}o(void 0)}))},function(){return I.apply(this,arguments)}),width:1280,height:720}).start()})()})();