text: // modules are defined as an array
  // [ module function, map of requires ]
  //
  // map of requires is short require name -> numeric require
  //
  // anything defined in a previous bundle is accessed via the
  // orig method which is the require for previous bundles
  
  require = (function (modules, cache, entry) {
    // Save the require from previous bundle to this closure if any
    var previousRequire = typeof require === "function" && require;
  
    function newRequire(name, jumped) {
      if (!cache[name]) {
        if (!modules[name]) {
          // if we cannot find the module within our internal map or
          // cache jump to the current global require ie. the last bundle
          // that was added to the page.
          var currentRequire = typeof require === "function" && require;
          if (!jumped && currentRequire) {
            return currentRequire(name, true);
          }
  
          // If there are other bundles on this page the require from the
          // previous one is saved to 'previousRequire'. Repeat this as
          // many times as there are bundles until the module is found or
          // we exhaust the require chain.
          if (previousRequire) {
            return previousRequire(name, true);
          }
  
          var err = new Error('Cannot find module \'' + name + '\'');
          err.code = 'MODULE_NOT_FOUND';
          throw err;
        }
        
        localRequire.resolve = resolve;
  
        var module = cache[name] = new newRequire.Module;
  
        modules[name][0].call(module.exports, localRequire, module, module.exports);
      }
  
      return cache[name].exports;
  
      function localRequire(x){
        return newRequire(localRequire.resolve(x));
      }
  
      function resolve(x){
        return modules[name][1][x] || x;
      }
    }
  
    function Module() {
      this.bundle = newRequire;
      this.exports = {};
    }
  
    newRequire.Module = Module;
    newRequire.modules = modules;
    newRequire.cache = cache;
    newRequire.parent = previousRequire;
  
    for (var i = 0; i < entry.length; i++) {
      newRequire(entry[i]);
    }
  
    // Override the current require with this new one
    return newRequire;
  })({45:[function(require,module,exports) {
  !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.dat=t():e.dat=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";t.__esModule=!0;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(1));t.default=o.default,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=o(n(2)),r=o(n(6)),a=o(n(3)),l=o(n(7)),s=o(n(8)),u=o(n(10)),d=o(n(11)),c=o(n(12)),f=o(n(13)),_=o(n(14)),p=o(n(15)),h=o(n(16)),m=o(n(9)),b=o(n(17));t.default={color:{Color:i.default,math:r.default,interpret:a.default},controllers:{Controller:l.default,BooleanController:s.default,OptionController:u.default,StringController:d.default,NumberController:c.default,NumberControllerBox:f.default,NumberControllerSlider:_.default,FunctionController:p.default,ColorController:h.default},dom:{dom:m.default},gui:{GUI:b.default},GUI:b.default},e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){Object.defineProperty(e,t,{get:function(){return"RGB"===this.__state.space?this.__state[t]:(d.recalculateRGB(this,t,n),this.__state[t])},set:function(e){"RGB"!==this.__state.space&&(d.recalculateRGB(this,t,n),this.__state.space="RGB"),this.__state[t]=e}})}function r(e,t){Object.defineProperty(e,t,{get:function(){return"HSV"===this.__state.space?this.__state[t]:(d.recalculateHSV(this),this.__state[t])},set:function(e){"HSV"!==this.__state.space&&(d.recalculateHSV(this),this.__state.space="HSV"),this.__state[t]=e}})}t.__esModule=!0;var a=o(n(3)),l=o(n(6)),s=o(n(4)),u=o(n(5)),d=function(){function e(){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.__state=a.default.apply(this,arguments),!1===this.__state)throw new Error("Failed to interpret color arguments");this.__state.a=this.__state.a||1}return e.prototype.toString=function(){return(0,s.default)(this)},e.prototype.toHexString=function(){return(0,s.default)(this,!0)},e.prototype.toOriginal=function(){return this.__state.conversion.write(this)},e}();d.recalculateRGB=function(e,t,n){if("HEX"===e.__state.space)e.__state[t]=l.default.component_from_hex(e.__state.hex,n);else{if("HSV"!==e.__state.space)throw new Error("Corrupted color state");u.default.extend(e.__state,l.default.hsv_to_rgb(e.__state.h,e.__state.s,e.__state.v))}},d.recalculateHSV=function(e){var t=l.default.rgb_to_hsv(e.r,e.g,e.b);u.default.extend(e.__state,{s:t.s,v:t.v}),u.default.isNaN(t.h)?u.default.isUndefined(e.__state.h)&&(e.__state.h=0):e.__state.h=t.h},d.COMPONENTS=["r","g","b","h","s","v","hex","a"],i(d.prototype,"r",2),i(d.prototype,"g",1),i(d.prototype,"b",0),r(d.prototype,"h"),r(d.prototype,"s"),r(d.prototype,"v"),Object.defineProperty(d.prototype,"a",{get:function(){return this.__state.a},set:function(e){this.__state.a=e}}),Object.defineProperty(d.prototype,"hex",{get:function(){return"HEX"!==!this.__state.space&&(this.__state.hex=l.default.rgb_to_hex(this.r,this.g,this.b)),this.__state.hex},set:function(e){this.__state.space="HEX",this.__state.hex=e}}),t.default=d,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=o(n(4)),r=o(n(5)),a=[{litmus:r.default.isString,conversions:{THREE_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return null!==t&&{space:"HEX",hex:parseInt("0x"+t[1].toString()+t[1].toString()+t[2].toString()+t[2].toString()+t[3].toString()+t[3].toString(),0)}},write:i.default},SIX_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9]{6})$/i);return null!==t&&{space:"HEX",hex:parseInt("0x"+t[1].toString(),0)}},write:i.default},CSS_RGB:{read:function(e){var t=e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null!==t&&{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3])}},write:i.default},CSS_RGBA:{read:function(e){var t=e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null!==t&&{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3]),a:parseFloat(t[4])}},write:i.default}}},{litmus:r.default.isNumber,conversions:{HEX:{read:function(e){return{space:"HEX",hex:e,conversionName:"HEX"}},write:function(e){return e.hex}}}},{litmus:r.default.isArray,conversions:{RGB_ARRAY:{read:function(e){return 3===e.length&&{space:"RGB",r:e[0],g:e[1],b:e[2]}},write:function(e){return[e.r,e.g,e.b]}},RGBA_ARRAY:{read:function(e){return 4===e.length&&{space:"RGB",r:e[0],g:e[1],b:e[2],a:e[3]}},write:function(e){return[e.r,e.g,e.b,e.a]}}}},{litmus:r.default.isObject,conversions:{RGBA_OBJ:{read:function(e){return!!(r.default.isNumber(e.r)&&r.default.isNumber(e.g)&&r.default.isNumber(e.b)&&r.default.isNumber(e.a))&&{space:"RGB",r:e.r,g:e.g,b:e.b,a:e.a}},write:function(e){return{r:e.r,g:e.g,b:e.b,a:e.a}}},RGB_OBJ:{read:function(e){return!!(r.default.isNumber(e.r)&&r.default.isNumber(e.g)&&r.default.isNumber(e.b))&&{space:"RGB",r:e.r,g:e.g,b:e.b}},write:function(e){return{r:e.r,g:e.g,b:e.b}}},HSVA_OBJ:{read:function(e){return!!(r.default.isNumber(e.h)&&r.default.isNumber(e.s)&&r.default.isNumber(e.v)&&r.default.isNumber(e.a))&&{space:"HSV",h:e.h,s:e.s,v:e.v,a:e.a}},write:function(e){return{h:e.h,s:e.s,v:e.v,a:e.a}}},HSV_OBJ:{read:function(e){return!!(r.default.isNumber(e.h)&&r.default.isNumber(e.s)&&r.default.isNumber(e.v))&&{space:"HSV",h:e.h,s:e.s,v:e.v}},write:function(e){return{h:e.h,s:e.s,v:e.v}}}}}],l=void 0,s=void 0;t.default=function(){s=!1;var e=arguments.length>1?r.default.toArray(arguments):arguments[0];return r.default.each(a,function(t){if(t.litmus(e))return r.default.each(t.conversions,function(t,n){if(l=t.read(e),!1===s&&!1!==l)return s=l,l.conversionName=n,l.conversion=t,r.default.BREAK}),r.default.BREAK}),s},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(e,t){var n=e.__state.conversionName.toString(),o=Math.round(e.r),i=Math.round(e.g),r=Math.round(e.b),a=e.a,l=Math.round(e.h),s=e.s.toFixed(1),u=e.v.toFixed(1);if(t||"THREE_CHAR_HEX"===n||"SIX_CHAR_HEX"===n){for(var d=e.hex.toString(16);d.length<6;)d="0"+d;return"#"+d}return"CSS_RGB"===n?"rgb("+o+","+i+","+r+")":"CSS_RGBA"===n?"rgba("+o+","+i+","+r+","+a+")":"HEX"===n?"0x"+e.hex.toString(16):"RGB_ARRAY"===n?"["+o+","+i+","+r+"]":"RGBA_ARRAY"===n?"["+o+","+i+","+r+","+a+"]":"RGB_OBJ"===n?"{r:"+o+",g:"+i+",b:"+r+"}":"RGBA_OBJ"===n?"{r:"+o+",g:"+i+",b:"+r+",a:"+a+"}":"HSV_OBJ"===n?"{h:"+l+",s:"+s+",v:"+u+"}":"HSVA_OBJ"===n?"{h:"+l+",s:"+s+",v:"+u+",a:"+a+"}":"unknown format"},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0;var n=Array.prototype.forEach,o=Array.prototype.slice,i={BREAK:{},extend:function(e){return this.each(o.call(arguments,1),function(t){(this.isObject(t)?Object.keys(t):[]).forEach(function(n){this.isUndefined(t[n])||(e[n]=t[n])}.bind(this))},this),e},defaults:function(e){return this.each(o.call(arguments,1),function(t){(this.isObject(t)?Object.keys(t):[]).forEach(function(n){this.isUndefined(e[n])&&(e[n]=t[n])}.bind(this))},this),e},compose:function(){var e=o.call(arguments);return function(){for(var t=o.call(arguments),n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},each:function(e,t,o){if(e)if(n&&e.forEach&&e.forEach===n)e.forEach(t,o);else if(e.length===e.length+0){var i=void 0,r=void 0;for(i=0,r=e.length;i<r;i++)if(i in e&&t.call(o,e[i],i)===this.BREAK)return}else for(var a in e)if(t.call(o,e[a],a)===this.BREAK)return},defer:function(e){setTimeout(e,0)},debounce:function(e,t,n){var o=void 0;return function(){var i=this,r=arguments,a=n||!o;clearTimeout(o),o=setTimeout(function(){o=null,n||e.apply(i,r)},t),a&&e.apply(i,r)}},toArray:function(e){return e.toArray?e.toArray():o.call(e)},isUndefined:function(e){return void 0===e},isNull:function(e){return null===e},isNaN:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e){return isNaN(e)}),isArray:Array.isArray||function(e){return e.constructor===Array},isObject:function(e){return e===Object(e)},isNumber:function(e){return e===e+0},isString:function(e){return e===e+""},isBoolean:function(e){return!1===e||!0===e},isFunction:function(e){return"[object Function]"===Object.prototype.toString.call(e)}};t.default=i,e.exports=t.default},function(e,t){"use strict";t.__esModule=!0;var n=void 0,o={hsv_to_rgb:function(e,t,n){var o=Math.floor(e/60)%6,i=e/60-Math.floor(e/60),r=n*(1-t),a=n*(1-i*t),l=n*(1-(1-i)*t),s=[[n,l,r],[a,n,r],[r,n,l],[r,a,n],[l,r,n],[n,r,a]][o];return{r:255*s[0],g:255*s[1],b:255*s[2]}},rgb_to_hsv:function(e,t,n){var o=Math.min(e,t,n),i=Math.max(e,t,n),r=i-o,a=void 0,l=void 0;return 0===i?{h:NaN,s:0,v:0}:(l=r/i,a=e===i?(t-n)/r:t===i?2+(n-e)/r:4+(e-t)/r,(a/=6)<0&&(a+=1),{h:360*a,s:l,v:i/255})},rgb_to_hex:function(e,t,n){var o=this.hex_with_component(0,2,e);return o=this.hex_with_component(o,1,t),o=this.hex_with_component(o,0,n)},component_from_hex:function(e,t){return e>>8*t&255},hex_with_component:function(e,t,o){return o<<(n=8*t)|e&~(255<<n)}};t.default=o,e.exports=t.default},function(e,t){"use strict";t.__esModule=!0;var n=function(){function e(t,n){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.initialValue=t[n],this.domElement=document.createElement("div"),this.object=t,this.property=n,this.__onChange=void 0,this.__onFinishChange=void 0}return e.prototype.onChange=function(e){return this.__onChange=e,this},e.prototype.onFinishChange=function(e){return this.__onFinishChange=e,this},e.prototype.setValue=function(e){return this.object[this.property]=e,this.__onChange&&this.__onChange.call(this,e),this.updateDisplay(),this},e.prototype.getValue=function(){return this.object[this.property]},e.prototype.updateDisplay=function(){return this},e.prototype.isModified=function(){return this.initialValue!==this.getValue()},e}();t.default=n,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=o(n(7)),r=o(n(9)),a=function(e){function t(n,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,o)),a=i;return i.__prev=i.getValue(),i.__checkbox=document.createElement("input"),i.__checkbox.setAttribute("type","checkbox"),r.default.bind(i.__checkbox,"change",function(){a.setValue(!a.__prev)},!1),i.domElement.appendChild(i.__checkbox),i.updateDisplay(),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.setValue=function(t){var n=e.prototype.setValue.call(this,t);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),this.__prev=this.getValue(),n},t.prototype.updateDisplay=function(){return!0===this.getValue()?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=!0,this.__prev=!0):(this.__checkbox.checked=!1,this.__prev=!1),e.prototype.updateDisplay.call(this)},t}(i.default);t.default=a,e.exports=t.default},function(e,t,n){"use strict";function o(e){if("0"===e||i.default.isUndefined(e))return 0;var t=e.match(a);return i.default.isNull(t)?0:parseFloat(t[1])}t.__esModule=!0;var i=function(e){return e&&e.__esModule?e:{default:e}}(n(5)),r={};i.default.each({HTMLEvents:["change"],MouseEvents:["click","mousemove","mousedown","mouseup","mouseover"],KeyboardEvents:["keydown"]},function(e,t){i.default.each(e,function(e){r[e]=t})});var a=/(\d+(\.\d+)?)px/,l={makeSelectable:function(e,t){void 0!==e&&void 0!==e.style&&(e.onselectstart=t?function(){return!1}:function(){},e.style.MozUserSelect=t?"auto":"none",e.style.KhtmlUserSelect=t?"auto":"none",e.unselectable=t?"on":"off")},makeFullscreen:function(e,t,n){var o=n,r=t;i.default.isUndefined(r)&&(r=!0),i.default.isUndefined(o)&&(o=!0),e.style.position="absolute",r&&(e.style.left=0,e.style.right=0),o&&(e.style.top=0,e.style.bottom=0)},fakeEvent:function(e,t,n,o){var a=n||{},l=r[t];if(!l)throw new Error("Event type "+t+" not supported.");var s=document.createEvent(l);switch(l){case"MouseEvents":var u=a.x||a.clientX||0,d=a.y||a.clientY||0;s.initMouseEvent(t,a.bubbles||!1,a.cancelable||!0,window,a.clickCount||1,0,0,u,d,!1,!1,!1,!1,0,null);break;case"KeyboardEvents":var c=s.initKeyboardEvent||s.initKeyEvent;i.default.defaults(a,{cancelable:!0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:void 0,charCode:void 0}),c(t,a.bubbles||!1,a.cancelable,window,a.ctrlKey,a.altKey,a.shiftKey,a.metaKey,a.keyCode,a.charCode);break;default:s.initEvent(t,a.bubbles||!1,a.cancelable||!0)}i.default.defaults(s,o),e.dispatchEvent(s)},bind:function(e,t,n,o){var i=o||!1;return e.addEventListener?e.addEventListener(t,n,i):e.attachEvent&&e.attachEvent("on"+t,n),l},unbind:function(e,t,n,o){var i=o||!1;return e.removeEventListener?e.removeEventListener(t,n,i):e.detachEvent&&e.detachEvent("on"+t,n),l},addClass:function(e,t){if(void 0===e.className)e.className=t;else if(e.className!==t){var n=e.className.split(/ +/);-1===n.indexOf(t)&&(n.push(t),e.className=n.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}return l},removeClass:function(e,t){if(t)if(e.className===t)e.removeAttribute("class");else{var n=e.className.split(/ +/),o=n.indexOf(t);-1!==o&&(n.splice(o,1),e.className=n.join(" "))}else e.className=void 0;return l},hasClass:function(e,t){return new RegExp("(?:^|\\s+)"+t+"(?:\\s+|$)").test(e.className)||!1},getWidth:function(e){var t=getComputedStyle(e);return o(t["border-left-width"])+o(t["border-right-width"])+o(t["padding-left"])+o(t["padding-right"])+o(t.width)},getHeight:function(e){var t=getComputedStyle(e);return o(t["border-top-width"])+o(t["border-bottom-width"])+o(t["padding-top"])+o(t["padding-bottom"])+o(t.height)},getOffset:function(e){var t=e,n={left:0,top:0};if(t.offsetParent)do{n.left+=t.offsetLeft,n.top+=t.offsetTop,t=t.offsetParent}while(t);return n},isActive:function(e){return e===document.activeElement&&(e.type||e.href)}};t.default=l,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=o(n(7)),r=o(n(9)),a=o(n(5)),l=function(e){function t(n,o,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var l=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,o)),s=i,u=l;if(l.__select=document.createElement("select"),a.default.isArray(s)){var d={};a.default.each(s,function(e){d[e]=e}),s=d}return a.default.each(s,function(e,t){var n=document.createElement("option");n.innerHTML=t,n.setAttribute("value",e),u.__select.appendChild(n)}),l.updateDisplay(),r.default.bind(l.__select,"change",function(){var e=this.options[this.selectedIndex].value;u.setValue(e)}),l.domElement.appendChild(l.__select),l}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.setValue=function(t){var n=e.prototype.setValue.call(this,t);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),n},t.prototype.updateDisplay=function(){return r.default.isActive(this.__select)?this:(this.__select.value=this.getValue(),e.prototype.updateDisplay.call(this))},t}(i.default);t.default=l,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=o(n(7)),r=o(n(9)),a=function(e){function t(n,o){function i(){l.setValue(l.__input.value)}!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,o)),l=a;return a.__input=document.createElement("input"),a.__input.setAttribute("type","text"),r.default.bind(a.__input,"keyup",i),r.default.bind(a.__input,"change",i),r.default.bind(a.__input,"blur",function(){l.__onFinishChange&&l.__onFinishChange.call(l,l.getValue())}),r.default.bind(a.__input,"keydown",function(e){13===e.keyCode&&this.blur()}),a.updateDisplay(),a.domElement.appendChild(a.__input),a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.updateDisplay=function(){return r.default.isActive(this.__input)||(this.__input.value=this.getValue()),e.prototype.updateDisplay.call(this)},t}(i.default);t.default=a,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=e.toString();return t.indexOf(".")>-1?t.length-t.indexOf(".")-1:0}t.__esModule=!0;var r=o(n(7)),a=o(n(5)),l=function(e){function t(n,o,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var l=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,o)),s=r||{};return l.__min=s.min,l.__max=s.max,l.__step=s.step,a.default.isUndefined(l.__step)?0===l.initialValue?l.__impliedStep=1:l.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(l.initialValue))/Math.LN10))/10:l.__impliedStep=l.__step,l.__precision=i(l.__impliedStep),l}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.setValue=function(t){var n=t;return void 0!==this.__min&&n<this.__min?n=this.__min:void 0!==this.__max&&n>this.__max&&(n=this.__max),void 0!==this.__step&&n%this.__step!=0&&(n=Math.round(n/this.__step)*this.__step),e.prototype.setValue.call(this,n)},t.prototype.min=function(e){return this.__min=e,this},t.prototype.max=function(e){return this.__max=e,this},t.prototype.step=function(e){return this.__step=e,this.__impliedStep=e,this.__precision=i(e),this},t}(r.default);t.default=l,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=o(n(12)),r=o(n(9)),a=o(n(5)),l=function(e){function t(n,o,i){function l(){c.__onFinishChange&&c.__onFinishChange.call(c,c.getValue())}function s(e){var t=f-e.clientY;c.setValue(c.getValue()+t*c.__impliedStep),f=e.clientY}function u(){r.default.unbind(window,"mousemove",s),r.default.unbind(window,"mouseup",u),l()}!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var d=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,o,i));d.__truncationSuspended=!1;var c=d,f=void 0;return d.__input=document.createElement("input"),d.__input.setAttribute("type","text"),r.default.bind(d.__input,"change",function(){var e=parseFloat(c.__input.value);a.default.isNaN(e)||c.setValue(e)}),r.default.bind(d.__input,"blur",function(){l()}),r.default.bind(d.__input,"mousedown",function(e){r.default.bind(window,"mousemove",s),r.default.bind(window,"mouseup",u),f=e.clientY}),r.default.bind(d.__input,"keydown",function(e){13===e.keyCode&&(c.__truncationSuspended=!0,this.blur(),c.__truncationSuspended=!1,l())}),d.updateDisplay(),d.domElement.appendChild(d.__input),d}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.updateDisplay=function(){return this.__input.value=this.__truncationSuspended?this.getValue():function(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}(this.getValue(),this.__precision),e.prototype.updateDisplay.call(this)},t}(i.default);t.default=l,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=o(n(12)),r=o(n(9)),a=function(e){function t(n,o,i,a,l){function s(e){e.preventDefault();var t=c.__background.getBoundingClientRect();return c.setValue(function(e,t,n,o,i){return o+(e-t)/(n-t)*(i-o)}(e.clientX,t.left,t.right,c.__min,c.__max)),!1}function u(){r.default.unbind(window,"mousemove",s),r.default.unbind(window,"mouseup",u),c.__onFinishChange&&c.__onFinishChange.call(c,c.getValue())}!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var d=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,o,{min:i,max:a,step:l})),c=d;return d.__background=document.createElement("div"),d.__foreground=document.createElement("div"),r.default.bind(d.__background,"mousedown",function(e){document.activeElement.blur(),r.default.bind(window,"mousemove",s),r.default.bind(window,"mouseup",u),s(e)}),r.default.addClass(d.__background,"slider"),r.default.addClass(d.__foreground,"slider-fg"),d.updateDisplay(),d.__background.appendChild(d.__foreground),d.domElement.appendChild(d.__background),d}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.updateDisplay=function(){var t=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*t+"%",e.prototype.updateDisplay.call(this)},t}(i.default);t.default=a,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=o(n(7)),r=o(n(9)),a=function(e){function t(n,o,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,o)),l=a;return a.__button=document.createElement("div"),a.__button.innerHTML=void 0===i?"Fire":i,r.default.bind(a.__button,"click",function(e){return e.preventDefault(),l.fire(),!1}),r.default.addClass(a.__button,"button"),a.domElement.appendChild(a.__button),a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.fire=function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())},t}(i.default);t.default=a,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n,o){e.style.background="",u.default.each(c,function(i){e.style.cssText+="background: "+i+"linear-gradient("+t+", "+n+" 0%, "+o+" 100%); "})}t.__esModule=!0;var r=o(n(7)),a=o(n(9)),l=o(n(2)),s=o(n(3)),u=o(n(5)),d=function(e){function t(n,o){function r(e){p(e),a.default.bind(window,"mousemove",p),a.default.bind(window,"mouseup",d)}function d(){a.default.unbind(window,"mousemove",p),a.default.unbind(window,"mouseup",d),_()}function c(){var e=(0,s.default)(this.value);!1!==e?(b.__color.__state=e,b.setValue(b.__color.toOriginal())):this.value=b.__color.toString()}function f(){a.default.unbind(window,"mousemove",h),a.default.unbind(window,"mouseup",f),_()}function _(){b.__onFinishChange&&b.__onFinishChange.call(b,b.__color.toOriginal())}function p(e){e.preventDefault();var t=b.__saturation_field.getBoundingClientRect(),n=(e.clientX-t.left)/(t.right-t.left),o=1-(e.clientY-t.top)/(t.bottom-t.top);return o>1?o=1:o<0&&(o=0),n>1?n=1:n<0&&(n=0),b.__color.v=o,b.__color.s=n,b.setValue(b.__color.toOriginal()),!1}function h(e){e.preventDefault();var t=b.__hue_field.getBoundingClientRect(),n=1-(e.clientY-t.top)/(t.bottom-t.top);return n>1?n=1:n<0&&(n=0),b.__color.h=360*n,b.setValue(b.__color.toOriginal()),!1}!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var m=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,o));m.__color=new l.default(m.getValue()),m.__temp=new l.default(0);var b=m;m.domElement=document.createElement("div"),a.default.makeSelectable(m.domElement,!1),m.__selector=document.createElement("div"),m.__selector.className="selector",m.__saturation_field=document.createElement("div"),m.__saturation_field.className="saturation-field",m.__field_knob=document.createElement("div"),m.__field_knob.className="field-knob",m.__field_knob_border="2px solid ",m.__hue_knob=document.createElement("div"),m.__hue_knob.className="hue-knob",m.__hue_field=document.createElement("div"),m.__hue_field.className="hue-field",m.__input=document.createElement("input"),m.__input.type="text",m.__input_textShadow="0 1px 1px ",a.default.bind(m.__input,"keydown",function(e){13===e.keyCode&&c.call(this)}),a.default.bind(m.__input,"blur",c),a.default.bind(m.__selector,"mousedown",function(){a.default.addClass(this,"drag").bind(window,"mouseup",function(){a.default.removeClass(b.__selector,"drag")})});var g=document.createElement("div");return u.default.extend(m.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),u.default.extend(m.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:m.__field_knob_border+(m.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),u.default.extend(m.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),u.default.extend(m.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),u.default.extend(g.style,{width:"100%",height:"100%",background:"none"}),i(g,"top","rgba(0,0,0,0)","#000"),u.default.extend(m.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),function(e){e.style.background="",e.style.cssText+="background: -moz-linear-gradient(top,  #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",e.style.cssText+="background: -webkit-linear-gradient(top,  #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: -o-linear-gradient(top,  #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: -ms-linear-gradient(top,  #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: linear-gradient(top,  #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"}(m.__hue_field),u.default.extend(m.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:m.__input_textShadow+"rgba(0,0,0,0.7)"}),a.default.bind(m.__saturation_field,"mousedown",r),a.default.bind(m.__field_knob,"mousedown",r),a.default.bind(m.__hue_field,"mousedown",function(e){h(e),a.default.bind(window,"mousemove",h),a.default.bind(window,"mouseup",f)}),m.__saturation_field.appendChild(g),m.__selector.appendChild(m.__field_knob),m.__selector.appendChild(m.__saturation_field),m.__selector.appendChild(m.__hue_field),m.__hue_field.appendChild(m.__hue_knob),m.domElement.appendChild(m.__input),m.domElement.appendChild(m.__selector),m.updateDisplay(),m}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.updateDisplay=function(){var e=(0,s.default)(this.getValue());if(!1!==e){var t=!1;u.default.each(l.default.COMPONENTS,function(n){if(!u.default.isUndefined(e[n])&&!u.default.isUndefined(this.__color.__state[n])&&e[n]!==this.__color.__state[n])return t=!0,{}},this),t&&u.default.extend(this.__color.__state,e)}u.default.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var n=this.__color.v<.5||this.__color.s>.5?255:0,o=255-n;u.default.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+n+","+n+","+n+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,i(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),u.default.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+n+","+n+","+n+")",textShadow:this.__input_textShadow+"rgba("+o+","+o+","+o+",.7)"})},t}(r.default),c=["-moz-","-o-","-webkit-","-ms-",""];t.default=d,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){var o=document.createElement("li");return t&&o.appendChild(t),n?e.__ul.insertBefore(o,n):e.__ul.appendChild(o),e.onResize(),o}function r(e,t){var n=e.__preset_select[e.__preset_select.selectedIndex];n.innerHTML=t?n.value+"*":n.value}function a(e,t){var n=e.getRoot(),o=n.__rememberedObjects.indexOf(t.object);if(-1!==o){var i=n.__rememberedObjectIndecesToControllers[o];if(void 0===i&&(i={},n.__rememberedObjectIndecesToControllers[o]=i),i[t.property]=t,n.load&&n.load.remembered){var r=n.load.remembered,a=void 0;if(r[e.preset])a=r[e.preset];else{if(!r[T])return;a=r[T]}if(a[o]&&void 0!==a[o][t.property]){var l=a[o][t.property];t.initialValue=l,t.setValue(l)}}}}function l(e,t,n,o){if(void 0===t[n])throw new Error('Object "'+t+'" has no property "'+n+'"');var s=void 0;if(o.color)s=new E.default(t,n);else{var u=[t,n].concat(o.factoryArgs);s=b.default.apply(e,u)}o.before instanceof g.default&&(o.before=o.before.__li),a(e,s),S.default.addClass(s.domElement,"c");var d=document.createElement("span");S.default.addClass(d,"property-name"),d.innerHTML=s.property;var c=document.createElement("div");c.appendChild(d),c.appendChild(s.domElement);var f=i(e,c,o.before);return S.default.addClass(f,H.CLASS_CONTROLLER_ROW),s instanceof E.default?S.default.addClass(f,"color"):S.default.addClass(f,p(s.getValue())),function(e,t,n){if(n.__li=t,n.__gui=e,k.default.extend(n,{options:function(t){if(arguments.length>1){var o=n.__li.nextElementSibling;return n.remove(),l(e,n.object,n.property,{before:o,factoryArgs:[k.default.toArray(arguments)]})}if(k.default.isArray(t)||k.default.isObject(t)){var i=n.__li.nextElementSibling;return n.remove(),l(e,n.object,n.property,{before:i,factoryArgs:[t]})}},name:function(e){return n.__li.firstElementChild.firstElementChild.innerHTML=e,n},listen:function(){return n.__gui.listen(n),n},remove:function(){return n.__gui.remove(n),n}}),n instanceof x.default){var o=new w.default(n.object,n.property,{min:n.__min,max:n.__max,step:n.__step});k.default.each(["updateDisplay","onChange","onFinishChange","step"],function(e){var t=n[e],i=o[e];n[e]=o[e]=function(){var e=Array.prototype.slice.call(arguments);return i.apply(o,e),t.apply(n,e)}}),S.default.addClass(t,"has-slider"),n.domElement.insertBefore(o.domElement,n.domElement.firstElementChild)}else if(n instanceof w.default){var i=function(t){if(k.default.isNumber(n.__min)&&k.default.isNumber(n.__max)){var o=n.__li.firstElementChild.firstElementChild.innerHTML,i=n.__gui.__listening.indexOf(n)>-1;n.remove();var r=l(e,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[n.__min,n.__max,n.__step]});return r.name(o),i&&r.listen(),r}return t};n.min=k.default.compose(i,n.min),n.max=k.default.compose(i,n.max)}else n instanceof v.default?(S.default.bind(t,"click",function(){S.default.fakeEvent(n.__checkbox,"click")}),S.default.bind(n.__checkbox,"click",function(e){e.stopPropagation()})):n instanceof y.default?(S.default.bind(t,"click",function(){S.default.fakeEvent(n.__button,"click")}),S.default.bind(t,"mouseover",function(){S.default.addClass(n.__button,"hover")}),S.default.bind(t,"mouseout",function(){S.default.removeClass(n.__button,"hover")})):n instanceof E.default&&(S.default.addClass(t,"color"),n.updateDisplay=k.default.compose(function(e){return t.style.borderLeftColor=n.__color.toString(),e},n.updateDisplay),n.updateDisplay());n.setValue=k.default.compose(function(t){return e.getRoot().__preset_select&&n.isModified()&&r(e.getRoot(),!0),t},n.setValue)}(e,f,s),e.__controllers.push(s),s}function s(e,t){return document.location.href+"."+t}function u(e,t,n){var o=document.createElement("option");o.innerHTML=t,o.value=t,e.__preset_select.appendChild(o),n&&(e.__preset_select.selectedIndex=e.__preset_select.length-1)}function d(e,t){t.style.display=e.useLocalStorage?"block":"none"}function c(e,t){e.domElement.style.width=t+"px",e.__save_row&&e.autoPlace&&(e.__save_row.style.width=t+"px"),e.__closeButton&&(e.__closeButton.style.width=t+"px")}function f(e,t){var n={};return k.default.each(e.__rememberedObjects,function(o,i){var r={},a=e.__rememberedObjectIndecesToControllers[i];k.default.each(a,function(e,n){r[n]=t?e.initialValue:e.getValue()}),n[i]=r}),n}function _(e){0!==e.length&&C.default.call(window,function(){_(e)}),k.default.each(e,function(e){e.updateDisplay()})}t.__esModule=!0;var p="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},h=o(n(18)),m=o(n(19)),b=o(n(20)),g=o(n(7)),v=o(n(8)),y=o(n(15)),w=o(n(13)),x=o(n(14)),E=o(n(16)),C=o(n(21)),A=o(n(22)),S=o(n(9)),k=o(n(5)),O=o(n(23));h.default.inject(O.default);var T="Default",R=function(){try{return"localStorage"in window&&null!==window.localStorage}catch(e){return!1}}(),L=void 0,B=!0,M=void 0,N=!1,j=[],H=function e(t){var n=this,o=t||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),S.default.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],o=k.default.defaults(o,{closeOnTop:!1,autoPlace:!0,width:e.DEFAULT_WIDTH}),o=k.default.defaults(o,{resizable:o.autoPlace,hideable:o.autoPlace}),k.default.isUndefined(o.load)?o.load={preset:T}:o.preset&&(o.load.preset=o.preset),k.default.isUndefined(o.parent)&&o.hideable&&j.push(this),o.resizable=k.default.isUndefined(o.parent)&&o.resizable,o.autoPlace&&k.default.isUndefined(o.scrollable)&&(o.scrollable=!0);var r=R&&"true"===localStorage.getItem(s(0,"isLocal")),a=void 0;if(Object.defineProperties(this,{parent:{get:function(){return o.parent}},scrollable:{get:function(){return o.scrollable}},autoPlace:{get:function(){return o.autoPlace}},closeOnTop:{get:function(){return o.closeOnTop}},preset:{get:function(){return n.parent?n.getRoot().preset:o.load.preset},set:function(e){n.parent?n.getRoot().preset=e:o.load.preset=e,function(e){for(var t=0;t<e.__preset_select.length;t++)e.__preset_select[t].value===e.preset&&(e.__preset_select.selectedIndex=t)}(this),n.revert()}},width:{get:function(){return o.width},set:function(e){o.width=e,c(n,e)}},name:{get:function(){return o.name},set:function(e){o.name=e,titleRowName&&(titleRowName.innerHTML=o.name)}},closed:{get:function(){return o.closed},set:function(t){o.closed=t,o.closed?S.default.addClass(n.__ul,e.CLASS_CLOSED):S.default.removeClass(n.__ul,e.CLASS_CLOSED),this.onResize(),n.__closeButton&&(n.__closeButton.innerHTML=t?e.TEXT_OPEN:e.TEXT_CLOSED)}},load:{get:function(){return o.load}},useLocalStorage:{get:function(){return r},set:function(e){R&&(r=e,e?S.default.bind(window,"unload",a):S.default.unbind(window,"unload",a),localStorage.setItem(s(0,"isLocal"),e))}}}),k.default.isUndefined(o.parent)){if(o.closed=!1,S.default.addClass(this.domElement,e.CLASS_MAIN),S.default.makeSelectable(this.domElement,!1),R&&r){n.useLocalStorage=!0;var l=localStorage.getItem(s(0,"gui"));l&&(o.load=JSON.parse(l))}this.__closeButton=document.createElement("div"),this.__closeButton.innerHTML=e.TEXT_CLOSED,S.default.addClass(this.__closeButton,e.CLASS_CLOSE_BUTTON),o.closeOnTop?(S.default.addClass(this.__closeButton,e.CLASS_CLOSE_TOP),this.domElement.insertBefore(this.__closeButton,this.domElement.childNodes[0])):(S.default.addClass(this.__closeButton,e.CLASS_CLOSE_BOTTOM),this.domElement.appendChild(this.__closeButton)),S.default.bind(this.__closeButton,"click",function(){n.closed=!n.closed})}else{void 0===o.closed&&(o.closed=!0);var u=document.createTextNode(o.name);S.default.addClass(u,"controller-name");var d=i(n,u),f=function(e){return e.preventDefault(),n.closed=!n.closed,!1};S.default.addClass(this.__ul,e.CLASS_CLOSED),S.default.addClass(d,"title"),S.default.bind(d,"click",f),o.closed||(this.closed=!1)}o.autoPlace&&(k.default.isUndefined(o.parent)&&(B&&(M=document.createElement("div"),S.default.addClass(M,"dg"),S.default.addClass(M,e.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(M),B=!1),M.appendChild(this.domElement),S.default.addClass(this.domElement,e.CLASS_AUTO_PLACE)),this.parent||c(n,o.width)),this.__resizeHandler=function(){n.onResizeDebounced()},S.default.bind(window,"resize",this.__resizeHandler),S.default.bind(this.__ul,"webkitTransitionEnd",this.__resizeHandler),S.default.bind(this.__ul,"transitionend",this.__resizeHandler),S.default.bind(this.__ul,"oTransitionEnd",this.__resizeHandler),this.onResize(),o.resizable&&function(e){function t(t){return t.preventDefault(),e.width+=i-t.clientX,e.onResize(),i=t.clientX,!1}function n(){S.default.removeClass(e.__closeButton,H.CLASS_DRAG),S.default.unbind(window,"mousemove",t),S.default.unbind(window,"mouseup",n)}function o(o){return o.preventDefault(),i=o.clientX,S.default.addClass(e.__closeButton,H.CLASS_DRAG),S.default.bind(window,"mousemove",t),S.default.bind(window,"mouseup",n),!1}var i=void 0;e.__resize_handle=document.createElement("div"),k.default.extend(e.__resize_handle.style,{width:"6px",marginLeft:"-3px",height:"200px",cursor:"ew-resize",position:"absolute"}),S.default.bind(e.__resize_handle,"mousedown",o),S.default.bind(e.__closeButton,"mousedown",o),e.domElement.insertBefore(e.__resize_handle,e.domElement.firstElementChild)}(this),a=function(){R&&"true"===localStorage.getItem(s(0,"isLocal"))&&localStorage.setItem(s(0,"gui"),JSON.stringify(n.getSaveObject()))},this.saveToLocalStorageIfPossible=a,o.parent||function(){var e=n.getRoot();e.width+=1,k.default.defer(function(){e.width-=1})}()};H.toggleHide=function(){N=!N,k.default.each(j,function(e){e.domElement.style.display=N?"none":""})},H.CLASS_AUTO_PLACE="a",H.CLASS_AUTO_PLACE_CONTAINER="ac",H.CLASS_MAIN="main",H.CLASS_CONTROLLER_ROW="cr",H.CLASS_TOO_TALL="taller-than-window",H.CLASS_CLOSED="closed",H.CLASS_CLOSE_BUTTON="close-button",H.CLASS_CLOSE_TOP="close-top",H.CLASS_CLOSE_BOTTOM="close-bottom",H.CLASS_DRAG="drag",H.DEFAULT_WIDTH=245,H.TEXT_CLOSED="Close Controls",H.TEXT_OPEN="Open Controls",H._keydownHandler=function(e){"text"===document.activeElement.type||72!==e.which&&72!==e.keyCode||H.toggleHide()},S.default.bind(window,"keydown",H._keydownHandler,!1),k.default.extend(H.prototype,{add:function(e,t){return l(this,e,t,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(e,t){return l(this,e,t,{color:!0})},remove:function(e){this.__ul.removeChild(e.__li),this.__controllers.splice(this.__controllers.indexOf(e),1);var t=this;k.default.defer(function(){t.onResize()})},destroy:function(){this.autoPlace&&M.removeChild(this.domElement),S.default.unbind(window,"keydown",H._keydownHandler,!1),S.default.unbind(window,"resize",this.__resizeHandler),this.saveToLocalStorageIfPossible&&S.default.unbind(window,"unload",this.saveToLocalStorageIfPossible)},addFolder:function(e){if(void 0!==this.__folders[e])throw new Error('You already have a folder in this GUI by the name "'+e+'"');var t={name:e,parent:this};t.autoPlace=this.autoPlace,this.load&&this.load.folders&&this.load.folders[e]&&(t.closed=this.load.folders[e].closed,t.load=this.load.folders[e]);var n=new H(t);this.__folders[e]=n;var o=i(this,n.domElement);return S.default.addClass(o,"folder"),n},open:function(){this.closed=!1},close:function(){this.closed=!0},onResize:function(){var e=this.getRoot();if(e.scrollable){var t=S.default.getOffset(e.__ul).top,n=0;k.default.each(e.__ul.childNodes,function(t){e.autoPlace&&t===e.__save_row||(n+=S.default.getHeight(t))}),window.innerHeight-t-20<n?(S.default.addClass(e.domElement,H.CLASS_TOO_TALL),e.__ul.style.height=window.innerHeight-t-20+"px"):(S.default.removeClass(e.domElement,H.CLASS_TOO_TALL),e.__ul.style.height="auto")}e.__resize_handle&&k.default.defer(function(){e.__resize_handle.style.height=e.__ul.offsetHeight+"px"}),e.__closeButton&&(e.__closeButton.style.width=e.width+"px")},onResizeDebounced:k.default.debounce(function(){this.onResize()},50),remember:function(){if(k.default.isUndefined(L)&&(L=new A.default,L.domElement.innerHTML=m.default),this.parent)throw new Error("You can only call remember on a top level GUI.");var e=this;k.default.each(Array.prototype.slice.call(arguments),function(t){0===e.__rememberedObjects.length&&function(e){var t=e.__save_row=document.createElement("li");S.default.addClass(e.domElement,"has-save"),e.__ul.insertBefore(t,e.__ul.firstChild),S.default.addClass(t,"save-row");var n=document.createElement("span");n.innerHTML="&nbsp;",S.default.addClass(n,"button gears");var o=document.createElement("span");o.innerHTML="Save",S.default.addClass(o,"button"),S.default.addClass(o,"save");var i=document.createElement("span");i.innerHTML="New",S.default.addClass(i,"button"),S.default.addClass(i,"save-as");var r=document.createElement("span");r.innerHTML="Revert",S.default.addClass(r,"button"),S.default.addClass(r,"revert");var a=e.__preset_select=document.createElement("select");if(e.load&&e.load.remembered?k.default.each(e.load.remembered,function(t,n){u(e,n,n===e.preset)}):u(e,T,!1),S.default.bind(a,"change",function(){for(var t=0;t<e.__preset_select.length;t++)e.__preset_select[t].innerHTML=e.__preset_select[t].value;e.preset=this.value}),t.appendChild(a),t.appendChild(n),t.appendChild(o),t.appendChild(i),t.appendChild(r),R){var l=document.getElementById("dg-local-explain"),c=document.getElementById("dg-local-storage");document.getElementById("dg-save-locally").style.display="block","true"===localStorage.getItem(s(0,"isLocal"))&&c.setAttribute("checked","checked"),d(e,l),S.default.bind(c,"change",function(){e.useLocalStorage=!e.useLocalStorage,d(e,l)})}var f=document.getElementById("dg-new-constructor");S.default.bind(f,"keydown",function(e){!e.metaKey||67!==e.which&&67!==e.keyCode||L.hide()}),S.default.bind(n,"click",function(){f.innerHTML=JSON.stringify(e.getSaveObject(),void 0,2),L.show(),f.focus(),f.select()}),S.default.bind(o,"click",function(){e.save()}),S.default.bind(i,"click",function(){var t=prompt("Enter a new preset name.");t&&e.saveAs(t)}),S.default.bind(r,"click",function(){e.revert()})}(e),-1===e.__rememberedObjects.indexOf(t)&&e.__rememberedObjects.push(t)}),this.autoPlace&&c(this,this.width)},getRoot:function(){for(var e=this;e.parent;)e=e.parent;return e},getSaveObject:function(){var e=this.load;return e.closed=this.closed,this.__rememberedObjects.length>0&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=f(this)),e.folders={},k.default.each(this.__folders,function(t,n){e.folders[n]=t.getSaveObject()}),e},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=f(this),r(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered[T]=f(this,!0)),this.load.remembered[e]=f(this),this.preset=e,u(this,e,!0),this.saveToLocalStorageIfPossible()},revert:function(e){k.default.each(this.__controllers,function(t){this.getRoot().load.remembered?a(e||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())},this),k.default.each(this.__folders,function(e){e.revert(e)}),e||r(this.getRoot(),!1)},listen:function(e){var t=0===this.__listening.length;this.__listening.push(e),t&&_(this.__listening)},updateDisplay:function(){k.default.each(this.__controllers,function(e){e.updateDisplay()}),k.default.each(this.__folders,function(e){e.updateDisplay()})}}),t.default=H,e.exports=t.default},function(e,t){"use strict";e.exports={load:function(e,t){var n=t||document,o=n.createElement("link");o.type="text/css",o.rel="stylesheet",o.href=e,n.getElementsByTagName("head")[0].appendChild(o)},inject:function(e,t){var n=t||document,o=document.createElement("style");o.type="text/css",o.innerHTML=e;var i=n.getElementsByTagName("head")[0];try{i.appendChild(o)}catch(e){}}}},function(e,t){e.exports="<div id=dg-save class=\"dg dialogue\"> Here's the new load parameter for your <code>GUI</code>'s constructor: <textarea id=dg-new-constructor></textarea> <div id=dg-save-locally> <input id=dg-local-storage type=checkbox /> Automatically save values to <code>localStorage</code> on exit. <div id=dg-local-explain>The values saved to <code>localStorage</code> will override those passed to <code>dat.GUI</code>'s constructor. This makes it easier to work incrementally, but <code>localStorage</code> is fragile, and your friends may not see the same values you do. </div> </div> </div>"},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=o(n(10)),r=o(n(13)),a=o(n(14)),l=o(n(11)),s=o(n(15)),u=o(n(8)),d=o(n(5));t.default=function(e,t){var n=e[t];return d.default.isArray(arguments[2])||d.default.isObject(arguments[2])?new i.default(e,t,arguments[2]):d.default.isNumber(n)?d.default.isNumber(arguments[2])&&d.default.isNumber(arguments[3])?d.default.isNumber(arguments[4])?new a.default(e,t,arguments[2],arguments[3],arguments[4]):new a.default(e,t,arguments[2],arguments[3]):d.default.isNumber(arguments[4])?new r.default(e,t,{min:arguments[2],max:arguments[3],step:arguments[4]}):new r.default(e,t,{min:arguments[2],max:arguments[3]}):d.default.isString(n)?new l.default(e,t):d.default.isFunction(n)?new s.default(e,t,""):d.default.isBoolean(n)?new u.default(e,t):null},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)},e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=o(n(9)),r=o(n(5)),a=function(){function e(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.backgroundElement=document.createElement("div"),r.default.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),i.default.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),r.default.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var t=this;i.default.bind(this.backgroundElement,"click",function(){t.hide()})}return e.prototype.show=function(){var e=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),r.default.defer(function(){e.backgroundElement.style.opacity=1,e.domElement.style.opacity=1,e.domElement.style.webkitTransform="scale(1)"})},e.prototype.hide=function(){var e=this,t=function t(){e.domElement.style.display="none",e.backgroundElement.style.display="none",i.default.unbind(e.domElement,"webkitTransitionEnd",t),i.default.unbind(e.domElement,"transitionend",t),i.default.unbind(e.domElement,"oTransitionEnd",t)};i.default.bind(this.domElement,"webkitTransitionEnd",t),i.default.bind(this.domElement,"transitionend",t),i.default.bind(this.domElement,"oTransitionEnd",t),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"},e.prototype.layout=function(){this.domElement.style.left=window.innerWidth/2-i.default.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-i.default.getHeight(this.domElement)/2+"px"},e}();t.default=a,e.exports=t.default},function(e,t,n){(e.exports=n(24)()).push([e.id,".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1!important}.dg.main .close-button.drag,.dg.main:hover .close-button{opacity:1}.dg.main .close-button{transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{transition:height .1s ease-out;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid transparent}.dg li.title{margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.boolean,.dg .cr.boolean *,.dg .cr.function,.dg .cr.function *,.dg .cr.function .property-name{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco,monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px Lucida Grande,sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid hsla(0,0%,100%,.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2fa1d6}.dg .cr.number input[type=text]{color:#2fa1d6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.boolean:hover,.dg .cr.function:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2fa1d6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}",""])},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t];n[2]?e.push("@media "+n[2]+"{"+n[1]+"}"):e.push(n[1])}return e.join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var o={},i=0;i<this.length;i++){var r=this[i][0];"number"==typeof r&&(o[r]=!0)}for(i=0;i<t.length;i++){var a=t[i];"number"==typeof a[0]&&o[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),e.push(a))}},e}}])});
  },{}],44:[function(require,module,exports) {
  var global = (1,eval)("this");
  var t=(0,eval)("this");!function(t,e){"use strict";var i={},s=t.document,n=t.GreenSockGlobals=t.GreenSockGlobals||t;if(!n.TweenLite){var r,a,o,l,h,_=function(t){var e,i=t.split("."),s=n;for(e=0;e<i.length;e++)s[i[e]]=s=s[i[e]]||{};return s},u=_("com.greensock"),f=function(t){var e,i=[],s=t.length;for(e=0;e!==s;i.push(t[e++]));return i},c=function(){},p=function(){var t=Object.prototype.toString,e=t.call([]);return function(i){return null!=i&&(i instanceof Array||"object"==typeof i&&!!i.push&&t.call(i)===e)}}(),m={},d=function(s,r,a,o){this.sc=m[s]?m[s].sc:[],m[s]=this,this.gsClass=null,this.func=a;var l=[];this.check=function(h){for(var u,f,c,p,v=r.length,g=v;--v>-1;)(u=m[r[v]]||new d(r[v],[])).gsClass?(l[v]=u.gsClass,g--):h&&u.sc.push(this);if(0===g&&a){if(f=("com.greensock."+s).split("."),c=f.pop(),p=_(f.join("."))[c]=this.gsClass=a.apply(a,l),o)if(n[c]=i[c]=p,"undefined"!=typeof module&&module.exports)if(s===e){module.exports=i[e]=p;for(v in i)p[v]=i[v]}else i[e]&&(i[e][c]=p);else"function"==typeof define&&define.amd&&define((t.GreenSockAMDPath?t.GreenSockAMDPath+"/":"")+s.split(".").pop(),[],function(){return p});for(v=0;v<this.sc.length;v++)this.sc[v].check()}},this.check(!0)},v=t._gsDefine=function(t,e,i,s){return new d(t,e,i,s)},g=u._class=function(t,e,i){return e=e||function(){},v(t,[],function(){return e},i),e};v.globals=n;var T=[0,0,1,1],y=g("easing.Ease",function(t,e,i,s){this._func=t,this._type=i||0,this._power=s||0,this._params=e?T.concat(e):T},!0),w=y.map={},P=y.register=function(t,e,i,s){for(var n,r,a,o,l=e.split(","),h=l.length,_=(i||"easeIn,easeOut,easeInOut").split(",");--h>-1;)for(r=l[h],n=s?g("easing."+r,null,!0):u.easing[r]||{},a=_.length;--a>-1;)o=_[a],w[r+"."+o]=w[o+r]=n[o]=t.getRatio?t:t[o]||new t};for((o=y.prototype)._calcEnd=!1,o.getRatio=function(t){if(this._func)return this._params[0]=t,this._func.apply(null,this._params);var e=this._type,i=this._power,s=1===e?1-t:2===e?t:t<.5?2*t:2*(1-t);return 1===i?s*=s:2===i?s*=s*s:3===i?s*=s*s*s:4===i&&(s*=s*s*s*s),1===e?1-s:2===e?s:t<.5?s/2:1-s/2},a=(r=["Linear","Quad","Cubic","Quart","Quint,Strong"]).length;--a>-1;)o=r[a]+",Power"+a,P(new y(null,null,1,a),o,"easeOut",!0),P(new y(null,null,2,a),o,"easeIn"+(0===a?",easeNone":"")),P(new y(null,null,3,a),o,"easeInOut");w.linear=u.easing.Linear.easeIn,w.swing=u.easing.Quad.easeInOut;var b=g("events.EventDispatcher",function(t){this._listeners={},this._eventTarget=t||this});(o=b.prototype).addEventListener=function(t,e,i,s,n){n=n||0;var r,a,o=this._listeners[t],_=0;for(this!==l||h||l.wake(),null==o&&(this._listeners[t]=o=[]),a=o.length;--a>-1;)(r=o[a]).c===e&&r.s===i?o.splice(a,1):0===_&&r.pr<n&&(_=a+1);o.splice(_,0,{c:e,s:i,up:s,pr:n})},o.removeEventListener=function(t,e){var i,s=this._listeners[t];if(s)for(i=s.length;--i>-1;)if(s[i].c===e)return void s.splice(i,1)},o.dispatchEvent=function(t){var e,i,s,n=this._listeners[t];if(n)for((e=n.length)>1&&(n=n.slice(0)),i=this._eventTarget;--e>-1;)(s=n[e])&&(s.up?s.c.call(s.s||i,{type:t,target:i}):s.c.call(s.s||i))};var k=t.requestAnimationFrame,S=t.cancelAnimationFrame,A=Date.now||function(){return(new Date).getTime()},x=A();for(a=(r=["ms","moz","webkit","o"]).length;--a>-1&&!k;)k=t[r[a]+"RequestAnimationFrame"],S=t[r[a]+"CancelAnimationFrame"]||t[r[a]+"CancelRequestAnimationFrame"];g("Ticker",function(t,e){var i,n,r,a,o,_=this,u=A(),f=!(!1===e||!k)&&"auto",p=500,m=33,d=function(t){var e,s,l=A()-x;l>p&&(u+=l-m),x+=l,_.time=(x-u)/1e3,e=_.time-o,(!i||e>0||!0===t)&&(_.frame++,o+=e+(e>=a?.004:a-e),s=!0),!0!==t&&(r=n(d)),s&&_.dispatchEvent("tick")};b.call(_),_.time=_.frame=0,_.tick=function(){d(!0)},_.lagSmoothing=function(t,e){if(!arguments.length)return p<1e10;p=t||1e10,m=Math.min(e,p,0)},_.sleep=function(){null!=r&&(f&&S?S(r):clearTimeout(r),n=c,r=null,_===l&&(h=!1))},_.wake=function(t){null!==r?_.sleep():t?u+=-x+(x=A()):_.frame>10&&(x=A()-p+5),n=0===i?c:f&&k?k:function(t){return setTimeout(t,1e3*(o-_.time)+1|0)},_===l&&(h=!0),d(2)},_.fps=function(t){if(!arguments.length)return i;a=1/((i=t)||60),o=this.time+a,_.wake()},_.useRAF=function(t){if(!arguments.length)return f;_.sleep(),f=t,_.fps(i)},_.fps(t),setTimeout(function(){"auto"===f&&_.frame<5&&"hidden"!==s.visibilityState&&_.useRAF(!1)},1500)}),(o=u.Ticker.prototype=new u.events.EventDispatcher).constructor=u.Ticker;var R=g("core.Animation",function(t,e){if(this.vars=e=e||{},this._duration=this._totalDuration=t||0,this._delay=Number(e.delay)||0,this._timeScale=1,this._active=!0===e.immediateRender,this.data=e.data,this._reversed=!0===e.reversed,H){h||l.wake();var i=this.vars.useFrames?K:H;i.add(this,i._time),this.vars.paused&&this.paused(!0)}});l=R.ticker=new u.Ticker,(o=R.prototype)._dirty=o._gc=o._initted=o._paused=!1,o._totalTime=o._time=0,o._rawPrevTime=-1,o._next=o._last=o._onUpdate=o._timeline=o.timeline=null,o._paused=!1;var C=function(){h&&A()-x>2e3&&("hidden"!==s.visibilityState||!l.lagSmoothing())&&l.wake();var t=setTimeout(C,2e3);t.unref&&t.unref()};C(),o.play=function(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},o.pause=function(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},o.resume=function(t,e){return null!=t&&this.seek(t,e),this.paused(!1)},o.seek=function(t,e){return this.totalTime(Number(t),!1!==e)},o.restart=function(t,e){return this.reversed(!1).paused(!1).totalTime(t?-this._delay:0,!1!==e,!0)},o.reverse=function(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},o.render=function(t,e,i){},o.invalidate=function(){return this._time=this._totalTime=0,this._initted=this._gc=!1,this._rawPrevTime=-1,!this._gc&&this.timeline||this._enabled(!0),this},o.isActive=function(){var t,e=this._timeline,i=this._startTime;return!e||!this._gc&&!this._paused&&e.isActive()&&(t=e.rawTime(!0))>=i&&t<i+this.totalDuration()/this._timeScale-1e-7},o._enabled=function(t,e){return h||l.wake(),this._gc=!t,this._active=this.isActive(),!0!==e&&(t&&!this.timeline?this._timeline.add(this,this._startTime-this._delay):!t&&this.timeline&&this._timeline._remove(this,!0)),!1},o._kill=function(t,e){return this._enabled(!1,!1)},o.kill=function(t,e){return this._kill(t,e),this},o._uncache=function(t){for(var e=t?this:this.timeline;e;)e._dirty=!0,e=e.timeline;return this},o._swapSelfInParams=function(t){for(var e=t.length,i=t.concat();--e>-1;)"{self}"===t[e]&&(i[e]=this);return i},o._callback=function(t){var e=this.vars,i=e[t],s=e[t+"Params"],n=e[t+"Scope"]||e.callbackScope||this;switch(s?s.length:0){case 0:i.call(n);break;case 1:i.call(n,s[0]);break;case 2:i.call(n,s[0],s[1]);break;default:i.apply(n,s)}},o.eventCallback=function(t,e,i,s){if("on"===(t||"").substr(0,2)){var n=this.vars;if(1===arguments.length)return n[t];null==e?delete n[t]:(n[t]=e,n[t+"Params"]=p(i)&&-1!==i.join("").indexOf("{self}")?this._swapSelfInParams(i):i,n[t+"Scope"]=s),"onUpdate"===t&&(this._onUpdate=e)}return this},o.delay=function(t){return arguments.length?(this._timeline.smoothChildTiming&&this.startTime(this._startTime+t-this._delay),this._delay=t,this):this._delay},o.duration=function(t){return arguments.length?(this._duration=this._totalDuration=t,this._uncache(!0),this._timeline.smoothChildTiming&&this._time>0&&this._time<this._duration&&0!==t&&this.totalTime(this._totalTime*(t/this._duration),!0),this):(this._dirty=!1,this._duration)},o.totalDuration=function(t){return this._dirty=!1,arguments.length?this.duration(t):this._totalDuration},o.time=function(t,e){return arguments.length?(this._dirty&&this.totalDuration(),this.totalTime(t>this._duration?this._duration:t,e)):this._time},o.totalTime=function(t,e,i){if(h||l.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(t<0&&!i&&(t+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var s=this._totalDuration,n=this._timeline;if(t>s&&!i&&(t=s),this._startTime=(this._paused?this._pauseTime:n._time)-(this._reversed?s-t:t)/this._timeScale,n._dirty||this._uncache(!1),n._timeline)for(;n._timeline;)n._timeline._time!==(n._startTime+n._totalTime)/n._timeScale&&n.totalTime(n._totalTime,!0),n=n._timeline}this._gc&&this._enabled(!0,!1),this._totalTime===t&&0!==this._duration||(O.length&&V(),this.render(t,e,!1),O.length&&V())}return this},o.progress=o.totalProgress=function(t,e){var i=this.duration();return arguments.length?this.totalTime(i*t,e):i?this._time/i:this.ratio},o.startTime=function(t){return arguments.length?(t!==this._startTime&&(this._startTime=t,this.timeline&&this.timeline._sortChildren&&this.timeline.add(this,t-this._delay)),this):this._startTime},o.endTime=function(t){return this._startTime+(0!=t?this.totalDuration():this.duration())/this._timeScale},o.timeScale=function(t){if(!arguments.length)return this._timeScale;var e,i;for(t=t||1e-10,this._timeline&&this._timeline.smoothChildTiming&&(i=(e=this._pauseTime)||0===e?e:this._timeline.totalTime(),this._startTime=i-(i-this._startTime)*this._timeScale/t),this._timeScale=t,i=this.timeline;i&&i.timeline;)i._dirty=!0,i.totalDuration(),i=i.timeline;return this},o.reversed=function(t){return arguments.length?(t!=this._reversed&&(this._reversed=t,this.totalTime(this._timeline&&!this._timeline.smoothChildTiming?this.totalDuration()-this._totalTime:this._totalTime,!0)),this):this._reversed},o.paused=function(t){if(!arguments.length)return this._paused;var e,i,s=this._timeline;return t!=this._paused&&s&&(h||t||l.wake(),i=(e=s.rawTime())-this._pauseTime,!t&&s.smoothChildTiming&&(this._startTime+=i,this._uncache(!1)),this._pauseTime=t?e:null,this._paused=t,this._active=this.isActive(),!t&&0!==i&&this._initted&&this.duration()&&(e=s.smoothChildTiming?this._totalTime:(e-this._startTime)/this._timeScale,this.render(e,e===this._totalTime,!0))),this._gc&&!t&&this._enabled(!0,!1),this};var D=g("core.SimpleTimeline",function(t){R.call(this,0,t),this.autoRemoveChildren=this.smoothChildTiming=!0});(o=D.prototype=new R).constructor=D,o.kill()._gc=!1,o._first=o._last=o._recent=null,o._sortChildren=!1,o.add=o.insert=function(t,e,i,s){var n,r;if(t._startTime=Number(e||0)+t._delay,t._paused&&this!==t._timeline&&(t._pauseTime=t._startTime+(this.rawTime()-t._startTime)/t._timeScale),t.timeline&&t.timeline._remove(t,!0),t.timeline=t._timeline=this,t._gc&&t._enabled(!0,!0),n=this._last,this._sortChildren)for(r=t._startTime;n&&n._startTime>r;)n=n._prev;return n?(t._next=n._next,n._next=t):(t._next=this._first,this._first=t),t._next?t._next._prev=t:this._last=t,t._prev=n,this._recent=t,this._timeline&&this._uncache(!0),this},o._remove=function(t,e){return t.timeline===this&&(e||t._enabled(!1,!0),t._prev?t._prev._next=t._next:this._first===t&&(this._first=t._next),t._next?t._next._prev=t._prev:this._last===t&&(this._last=t._prev),t._next=t._prev=t.timeline=null,t===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},o.render=function(t,e,i){var s,n=this._first;for(this._totalTime=this._time=this._rawPrevTime=t;n;)s=n._next,(n._active||t>=n._startTime&&!n._paused&&!n._gc)&&(n._reversed?n.render((n._dirty?n.totalDuration():n._totalDuration)-(t-n._startTime)*n._timeScale,e,i):n.render((t-n._startTime)*n._timeScale,e,i)),n=s},o.rawTime=function(){return h||l.wake(),this._totalTime};var I=g("TweenLite",function(e,i,s){if(R.call(this,i,s),this.render=I.prototype.render,null==e)throw"Cannot tween a null target.";this.target=e="string"!=typeof e?e:I.selector(e)||e;var n,r,a,o=e.jquery||e.length&&e!==t&&e[0]&&(e[0]===t||e[0].nodeType&&e[0].style&&!e.nodeType),l=this.vars.overwrite;if(this._overwrite=l=null==l?$[I.defaultOverwrite]:"number"==typeof l?l>>0:$[l],(o||e instanceof Array||e.push&&p(e))&&"number"!=typeof e[0])for(this._targets=a=f(e),this._propLookup=[],this._siblings=[],n=0;n<a.length;n++)(r=a[n])?"string"!=typeof r?r.length&&r!==t&&r[0]&&(r[0]===t||r[0].nodeType&&r[0].style&&!r.nodeType)?(a.splice(n--,1),this._targets=a=a.concat(f(r))):(this._siblings[n]=W(r,this,!1),1===l&&this._siblings[n].length>1&&Y(r,this,null,1,this._siblings[n])):"string"==typeof(r=a[n--]=I.selector(r))&&a.splice(n+1,1):a.splice(n--,1);else this._propLookup={},this._siblings=W(e,this,!1),1===l&&this._siblings.length>1&&Y(e,this,null,1,this._siblings);(this.vars.immediateRender||0===i&&0===this._delay&&!1!==this.vars.immediateRender)&&(this._time=-1e-10,this.render(Math.min(0,-this._delay)))},!0),E=function(e){return e&&e.length&&e!==t&&e[0]&&(e[0]===t||e[0].nodeType&&e[0].style&&!e.nodeType)};(o=I.prototype=new R).constructor=I,o.kill()._gc=!1,o.ratio=0,o._firstPT=o._targets=o._overwrittenProps=o._startAt=null,o._notifyPluginsOfEnabled=o._lazy=!1,I.version="1.20.3",I.defaultEase=o._ease=new y(null,null,1,1),I.defaultOverwrite="auto",I.ticker=l,I.autoSleep=120,I.lagSmoothing=function(t,e){l.lagSmoothing(t,e)},I.selector=t.$||t.jQuery||function(e){var i=t.$||t.jQuery;return i?(I.selector=i,i(e)):void 0===s?e:s.querySelectorAll?s.querySelectorAll(e):s.getElementById("#"===e.charAt(0)?e.substr(1):e)};var O=[],z={},F=/(?:(-|-=|\+=)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi,U=/[\+-]=-?[\.\d]/,L=function(t){for(var e,i=this._firstPT;i;)e=i.blob?1===t&&null!=this.end?this.end:t?this.join(""):this.start:i.c*t+i.s,i.m?e=i.m(e,this._target||i.t):e<1e-6&&e>-1e-6&&!i.blob&&(e=0),i.f?i.fp?i.t[i.p](i.fp,e):i.t[i.p](e):i.t[i.p]=e,i=i._next},N=function(t,e,i,s){var n,r,a,o,l,h,_,u=[],f=0,c="",p=0;for(u.start=t,u.end=e,t=u[0]=t+"",e=u[1]=e+"",i&&(i(u),t=u[0],e=u[1]),u.length=0,n=t.match(F)||[],r=e.match(F)||[],s&&(s._next=null,s.blob=1,u._firstPT=u._applyPT=s),l=r.length,o=0;o<l;o++)_=r[o],c+=(h=e.substr(f,e.indexOf(_,f)-f))||!o?h:",",f+=h.length,p?p=(p+1)%5:"rgba("===h.substr(-5)&&(p=1),_===n[o]||n.length<=o?c+=_:(c&&(u.push(c),c=""),a=parseFloat(n[o]),u.push(a),u._firstPT={_next:u._firstPT,t:u,p:u.length-1,s:a,c:("="===_.charAt(1)?parseInt(_.charAt(0)+"1",10)*parseFloat(_.substr(2)):parseFloat(_)-a)||0,f:0,m:p&&p<4?Math.round:0}),f+=_.length;return(c+=e.substr(f))&&u.push(c),u.setRatio=L,U.test(e)&&(u.end=null),u},j=function(t,e,i,s,n,r,a,o,l){"function"==typeof s&&(s=s(l||0,t));var h=typeof t[e],_="function"!==h?"":e.indexOf("set")||"function"!=typeof t["get"+e.substr(3)]?e:"get"+e.substr(3),u="get"!==i?i:_?a?t[_](a):t[_]():t[e],f="string"==typeof s&&"="===s.charAt(1),c={t:t,p:e,s:u,f:"function"===h,pg:0,n:n||e,m:r?"function"==typeof r?r:Math.round:0,pr:0,c:f?parseInt(s.charAt(0)+"1",10)*parseFloat(s.substr(2)):parseFloat(s)-u||0};if(("number"!=typeof u||"number"!=typeof s&&!f)&&(a||isNaN(u)||!f&&isNaN(s)||"boolean"==typeof u||"boolean"==typeof s?(c.fp=a,c={t:N(u,f?parseFloat(c.s)+c.c:s,o||I.defaultStringFilter,c),p:"setRatio",s:0,c:1,f:2,pg:0,n:n||e,pr:0,m:0}):(c.s=parseFloat(u),f||(c.c=parseFloat(s)-c.s||0))),c.c)return(c._next=this._firstPT)&&(c._next._prev=c),this._firstPT=c,c},G=I._internals={isArray:p,isSelector:E,lazyTweens:O,blobDif:N},M=I._plugins={},Q=G.tweenLookup={},q=0,B=G.reservedProps={ease:1,delay:1,overwrite:1,onComplete:1,onCompleteParams:1,onCompleteScope:1,useFrames:1,runBackwards:1,startAt:1,onUpdate:1,onUpdateParams:1,onUpdateScope:1,onStart:1,onStartParams:1,onStartScope:1,onReverseComplete:1,onReverseCompleteParams:1,onReverseCompleteScope:1,onRepeat:1,onRepeatParams:1,onRepeatScope:1,easeParams:1,yoyo:1,immediateRender:1,repeat:1,repeatDelay:1,data:1,paused:1,reversed:1,autoCSS:1,lazy:1,onOverwrite:1,callbackScope:1,stringFilter:1,id:1,yoyoEase:1},$={none:0,all:1,auto:2,concurrent:3,allOnStart:4,preexisting:5,true:1,false:0},K=R._rootFramesTimeline=new D,H=R._rootTimeline=new D,J=30,V=G.lazyRender=function(){var t,e=O.length;for(z={};--e>-1;)(t=O[e])&&!1!==t._lazy&&(t.render(t._lazy[0],t._lazy[1],!0),t._lazy=!1);O.length=0};H._startTime=l.time,K._startTime=l.frame,H._active=K._active=!0,setTimeout(V,1),R._updateRoot=I.render=function(){var t,e,i;if(O.length&&V(),H.render((l.time-H._startTime)*H._timeScale,!1,!1),K.render((l.frame-K._startTime)*K._timeScale,!1,!1),O.length&&V(),l.frame>=J){J=l.frame+(parseInt(I.autoSleep,10)||120);for(i in Q){for(t=(e=Q[i].tweens).length;--t>-1;)e[t]._gc&&e.splice(t,1);0===e.length&&delete Q[i]}if((!(i=H._first)||i._paused)&&I.autoSleep&&!K._first&&1===l._listeners.tick.length){for(;i&&i._paused;)i=i._next;i||l.sleep()}}},l.addEventListener("tick",R._updateRoot);var W=function(t,e,i){var s,n,r=t._gsTweenID;if(Q[r||(t._gsTweenID=r="t"+q++)]||(Q[r]={target:t,tweens:[]}),e&&(s=Q[r].tweens,s[n=s.length]=e,i))for(;--n>-1;)s[n]===e&&s.splice(n,1);return Q[r].tweens},X=function(t,e,i,s){var n,r,a=t.vars.onOverwrite;return a&&(n=a(t,e,i,s)),(a=I.onOverwrite)&&(r=a(t,e,i,s)),!1!==n&&!1!==r},Y=function(t,e,i,s,n){var r,a,o,l;if(1===s||s>=4){for(l=n.length,r=0;r<l;r++)if((o=n[r])!==e)o._gc||o._kill(null,t,e)&&(a=!0);else if(5===s)break;return a}var h,_=e._startTime+1e-10,u=[],f=0,c=0===e._duration;for(r=n.length;--r>-1;)(o=n[r])===e||o._gc||o._paused||(o._timeline!==e._timeline?(h=h||Z(e,0,c),0===Z(o,h,c)&&(u[f++]=o)):o._startTime<=_&&o._startTime+o.totalDuration()/o._timeScale>_&&((c||!o._initted)&&_-o._startTime<=2e-10||(u[f++]=o)));for(r=f;--r>-1;)if(o=u[r],2===s&&o._kill(i,t,e)&&(a=!0),2!==s||!o._firstPT&&o._initted){if(2!==s&&!X(o,e))continue;o._enabled(!1,!1)&&(a=!0)}return a},Z=function(t,e,i){for(var s=t._timeline,n=s._timeScale,r=t._startTime;s._timeline;){if(r+=s._startTime,n*=s._timeScale,s._paused)return-100;s=s._timeline}return(r/=n)>e?r-e:i&&r===e||!t._initted&&r-e<2e-10?1e-10:(r+=t.totalDuration()/t._timeScale/n)>e+1e-10?0:r-e-1e-10};o._init=function(){var t,e,i,s,n,r,a=this.vars,o=this._overwrittenProps,l=this._duration,h=!!a.immediateRender,_=a.ease;if(a.startAt){this._startAt&&(this._startAt.render(-1,!0),this._startAt.kill()),n={};for(s in a.startAt)n[s]=a.startAt[s];if(n.data="isStart",n.overwrite=!1,n.immediateRender=!0,n.lazy=h&&!1!==a.lazy,n.startAt=n.delay=null,n.onUpdate=a.onUpdate,n.onUpdateParams=a.onUpdateParams,n.onUpdateScope=a.onUpdateScope||a.callbackScope||this,this._startAt=I.to(this.target,0,n),h)if(this._time>0)this._startAt=null;else if(0!==l)return}else if(a.runBackwards&&0!==l)if(this._startAt)this._startAt.render(-1,!0),this._startAt.kill(),this._startAt=null;else{0!==this._time&&(h=!1),i={};for(s in a)B[s]&&"autoCSS"!==s||(i[s]=a[s]);if(i.overwrite=0,i.data="isFromStart",i.lazy=h&&!1!==a.lazy,i.immediateRender=h,this._startAt=I.to(this.target,0,i),h){if(0===this._time)return}else this._startAt._init(),this._startAt._enabled(!1),this.vars.immediateRender&&(this._startAt=null)}if(this._ease=_=_?_ instanceof y?_:"function"==typeof _?new y(_,a.easeParams):w[_]||I.defaultEase:I.defaultEase,a.easeParams instanceof Array&&_.config&&(this._ease=_.config.apply(_,a.easeParams)),this._easeType=this._ease._type,this._easePower=this._ease._power,this._firstPT=null,this._targets)for(r=this._targets.length,t=0;t<r;t++)this._initProps(this._targets[t],this._propLookup[t]={},this._siblings[t],o?o[t]:null,t)&&(e=!0);else e=this._initProps(this.target,this._propLookup,this._siblings,o,0);if(e&&I._onPluginEvent("_onInitAllProps",this),o&&(this._firstPT||"function"!=typeof this.target&&this._enabled(!1,!1)),a.runBackwards)for(i=this._firstPT;i;)i.s+=i.c,i.c=-i.c,i=i._next;this._onUpdate=a.onUpdate,this._initted=!0},o._initProps=function(e,i,s,n,r){var a,o,l,h,_,u;if(null==e)return!1;z[e._gsTweenID]&&V(),this.vars.css||e.style&&e!==t&&e.nodeType&&M.css&&!1!==this.vars.autoCSS&&function(t,e){var i,s={};for(i in t)B[i]||i in e&&"transform"!==i&&"x"!==i&&"y"!==i&&"width"!==i&&"height"!==i&&"className"!==i&&"border"!==i||!(!M[i]||M[i]&&M[i]._autoCSS)||(s[i]=t[i],delete t[i]);t.css=s}(this.vars,e);for(a in this.vars)if(u=this.vars[a],B[a])u&&(u instanceof Array||u.push&&p(u))&&-1!==u.join("").indexOf("{self}")&&(this.vars[a]=u=this._swapSelfInParams(u,this));else if(M[a]&&(h=new M[a])._onInitTween(e,this.vars[a],this,r)){for(this._firstPT=_={_next:this._firstPT,t:h,p:"setRatio",s:0,c:1,f:1,n:a,pg:1,pr:h._priority,m:0},o=h._overwriteProps.length;--o>-1;)i[h._overwriteProps[o]]=this._firstPT;(h._priority||h._onInitAllProps)&&(l=!0),(h._onDisable||h._onEnable)&&(this._notifyPluginsOfEnabled=!0),_._next&&(_._next._prev=_)}else i[a]=j.call(this,e,a,"get",u,a,0,null,this.vars.stringFilter,r);return n&&this._kill(n,e)?this._initProps(e,i,s,n,r):this._overwrite>1&&this._firstPT&&s.length>1&&Y(e,this,i,this._overwrite,s)?(this._kill(i,e),this._initProps(e,i,s,n,r)):(this._firstPT&&(!1!==this.vars.lazy&&this._duration||this.vars.lazy&&!this._duration)&&(z[e._gsTweenID]=!0),l)},o.render=function(t,e,i){var s,n,r,a,o=this._time,l=this._duration,h=this._rawPrevTime;if(t>=l-1e-7&&t>=0)this._totalTime=this._time=l,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1,this._reversed||(s=!0,n="onComplete",i=i||this._timeline.autoRemoveChildren),0===l&&(this._initted||!this.vars.lazy||i)&&(this._startTime===this._timeline._duration&&(t=0),(h<0||t<=0&&t>=-1e-7||1e-10===h&&"isPause"!==this.data)&&h!==t&&(i=!0,h>1e-10&&(n="onReverseComplete")),this._rawPrevTime=a=!e||t||h===t?t:1e-10);else if(t<1e-7)this._totalTime=this._time=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0,(0!==o||0===l&&h>0)&&(n="onReverseComplete",s=this._reversed),t<0&&(this._active=!1,0===l&&(this._initted||!this.vars.lazy||i)&&(h>=0&&(1e-10!==h||"isPause"!==this.data)&&(i=!0),this._rawPrevTime=a=!e||t||h===t?t:1e-10)),(!this._initted||this._startAt&&this._startAt.progress())&&(i=!0);else if(this._totalTime=this._time=t,this._easeType){var _=t/l,u=this._easeType,f=this._easePower;(1===u||3===u&&_>=.5)&&(_=1-_),3===u&&(_*=2),1===f?_*=_:2===f?_*=_*_:3===f?_*=_*_*_:4===f&&(_*=_*_*_*_),this.ratio=1===u?1-_:2===u?_:t/l<.5?_/2:1-_/2}else this.ratio=this._ease.getRatio(t/l);if(this._time!==o||i){if(!this._initted){if(this._init(),!this._initted||this._gc)return;if(!i&&this._firstPT&&(!1!==this.vars.lazy&&this._duration||this.vars.lazy&&!this._duration))return this._time=this._totalTime=o,this._rawPrevTime=h,O.push(this),void(this._lazy=[t,e]);this._time&&!s?this.ratio=this._ease.getRatio(this._time/l):s&&this._ease._calcEnd&&(this.ratio=this._ease.getRatio(0===this._time?0:1))}for(!1!==this._lazy&&(this._lazy=!1),this._active||!this._paused&&this._time!==o&&t>=0&&(this._active=!0),0===o&&(this._startAt&&(t>=0?this._startAt.render(t,!0,i):n||(n="_dummyGS")),this.vars.onStart&&(0===this._time&&0!==l||e||this._callback("onStart"))),r=this._firstPT;r;)r.f?r.t[r.p](r.c*this.ratio+r.s):r.t[r.p]=r.c*this.ratio+r.s,r=r._next;this._onUpdate&&(t<0&&this._startAt&&-1e-4!==t&&this._startAt.render(t,!0,i),e||(this._time!==o||s||i)&&this._callback("onUpdate")),n&&(this._gc&&!i||(t<0&&this._startAt&&!this._onUpdate&&-1e-4!==t&&this._startAt.render(t,!0,i),s&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[n]&&this._callback(n),0===l&&1e-10===this._rawPrevTime&&1e-10!==a&&(this._rawPrevTime=0)))}},o._kill=function(t,e,i){if("all"===t&&(t=null),null==t&&(null==e||e===this.target))return this._lazy=!1,this._enabled(!1,!1);e="string"!=typeof e?e||this._targets||this.target:I.selector(e)||e;var s,n,r,a,o,l,h,_,u,f=i&&this._time&&i._startTime===this._startTime&&this._timeline===i._timeline;if((p(e)||E(e))&&"number"!=typeof e[0])for(s=e.length;--s>-1;)this._kill(t,e[s],i)&&(l=!0);else{if(this._targets){for(s=this._targets.length;--s>-1;)if(e===this._targets[s]){o=this._propLookup[s]||{},this._overwrittenProps=this._overwrittenProps||[],n=this._overwrittenProps[s]=t?this._overwrittenProps[s]||{}:"all";break}}else{if(e!==this.target)return!1;o=this._propLookup,n=this._overwrittenProps=t?this._overwrittenProps||{}:"all"}if(o){if(h=t||o,_=t!==n&&"all"!==n&&t!==o&&("object"!=typeof t||!t._tempKill),i&&(I.onOverwrite||this.vars.onOverwrite)){for(r in h)o[r]&&(u||(u=[]),u.push(r));if((u||!t)&&!X(this,i,e,u))return!1}for(r in h)(a=o[r])&&(f&&(a.f?a.t[a.p](a.s):a.t[a.p]=a.s,l=!0),a.pg&&a.t._kill(h)&&(l=!0),a.pg&&0!==a.t._overwriteProps.length||(a._prev?a._prev._next=a._next:a===this._firstPT&&(this._firstPT=a._next),a._next&&(a._next._prev=a._prev),a._next=a._prev=null),delete o[r]),_&&(n[r]=1);!this._firstPT&&this._initted&&this._enabled(!1,!1)}}return l},o.invalidate=function(){return this._notifyPluginsOfEnabled&&I._onPluginEvent("_onDisable",this),this._firstPT=this._overwrittenProps=this._startAt=this._onUpdate=null,this._notifyPluginsOfEnabled=this._active=this._lazy=!1,this._propLookup=this._targets?{}:[],R.prototype.invalidate.call(this),this.vars.immediateRender&&(this._time=-1e-10,this.render(Math.min(0,-this._delay))),this},o._enabled=function(t,e){if(h||l.wake(),t&&this._gc){var i,s=this._targets;if(s)for(i=s.length;--i>-1;)this._siblings[i]=W(s[i],this,!0);else this._siblings=W(this.target,this,!0)}return R.prototype._enabled.call(this,t,e),!(!this._notifyPluginsOfEnabled||!this._firstPT)&&I._onPluginEvent(t?"_onEnable":"_onDisable",this)},I.to=function(t,e,i){return new I(t,e,i)},I.from=function(t,e,i){return i.runBackwards=!0,i.immediateRender=0!=i.immediateRender,new I(t,e,i)},I.fromTo=function(t,e,i,s){return s.startAt=i,s.immediateRender=0!=s.immediateRender&&0!=i.immediateRender,new I(t,e,s)},I.delayedCall=function(t,e,i,s,n){return new I(e,0,{delay:t,onComplete:e,onCompleteParams:i,callbackScope:s,onReverseComplete:e,onReverseCompleteParams:i,immediateRender:!1,lazy:!1,useFrames:n,overwrite:0})},I.set=function(t,e){return new I(t,0,e)},I.getTweensOf=function(t,e){if(null==t)return[];t="string"!=typeof t?t:I.selector(t)||t;var i,s,n,r;if((p(t)||E(t))&&"number"!=typeof t[0]){for(i=t.length,s=[];--i>-1;)s=s.concat(I.getTweensOf(t[i],e));for(i=s.length;--i>-1;)for(r=s[i],n=i;--n>-1;)r===s[n]&&s.splice(i,1)}else if(t._gsTweenID)for(i=(s=W(t).concat()).length;--i>-1;)(s[i]._gc||e&&!s[i].isActive())&&s.splice(i,1);return s||[]},I.killTweensOf=I.killDelayedCallsTo=function(t,e,i){"object"==typeof e&&(i=e,e=!1);for(var s=I.getTweensOf(t,e),n=s.length;--n>-1;)s[n]._kill(i,t)};var tt=g("plugins.TweenPlugin",function(t,e){this._overwriteProps=(t||"").split(","),this._propName=this._overwriteProps[0],this._priority=e||0,this._super=tt.prototype},!0);if(o=tt.prototype,tt.version="1.19.0",tt.API=2,o._firstPT=null,o._addTween=j,o.setRatio=L,o._kill=function(t){var e,i=this._overwriteProps,s=this._firstPT;if(null!=t[this._propName])this._overwriteProps=[];else for(e=i.length;--e>-1;)null!=t[i[e]]&&i.splice(e,1);for(;s;)null!=t[s.n]&&(s._next&&(s._next._prev=s._prev),s._prev?(s._prev._next=s._next,s._prev=null):this._firstPT===s&&(this._firstPT=s._next)),s=s._next;return!1},o._mod=o._roundProps=function(t){for(var e,i=this._firstPT;i;)(e=t[this._propName]||null!=i.n&&t[i.n.split(this._propName+"_").join("")])&&"function"==typeof e&&(2===i.f?i.t._applyPT.m=e:i.m=e),i=i._next},I._onPluginEvent=function(t,e){var i,s,n,r,a,o=e._firstPT;if("_onInitAllProps"===t){for(;o;){for(a=o._next,s=n;s&&s.pr>o.pr;)s=s._next;(o._prev=s?s._prev:r)?o._prev._next=o:n=o,(o._next=s)?s._prev=o:r=o,o=a}o=e._firstPT=n}for(;o;)o.pg&&"function"==typeof o.t[t]&&o.t[t]()&&(i=!0),o=o._next;return i},tt.activate=function(t){for(var e=t.length;--e>-1;)t[e].API===tt.API&&(M[(new t[e])._propName]=t[e]);return!0},v.plugin=function(t){if(!(t&&t.propName&&t.init&&t.API))throw"illegal plugin definition.";var e,i=t.propName,s=t.priority||0,n=t.overwriteProps,r={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_mod",mod:"_mod",initAll:"_onInitAllProps"},a=g("plugins."+i.charAt(0).toUpperCase()+i.substr(1)+"Plugin",function(){tt.call(this,i,s),this._overwriteProps=n||[]},!0===t.global),o=a.prototype=new tt(i);o.constructor=a,a.API=t.API;for(e in r)"function"==typeof t[e]&&(o[r[e]]=t[e]);return a.version=t.version,tt.activate([a]),a},r=t._gsQueue){for(a=0;a<r.length;a++)r[a]();for(o in m)m[o].func||t.console.log("GSAP encountered missing dependency: "+o)}h=!1}}("undefined"!=typeof module&&module.exports&&void 0!==t?t:this||window,"TweenLite");
  },{}],28:[function(require,module,exports) {
  var global = (1,eval)("this");
  var e=(0,eval)("this");!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Stats=t()}(this,function(){"use strict";var e=function(){function t(e){return i.appendChild(e.dom),e}function n(e){for(var t=0;t<i.children.length;t++)i.children[t].style.display=t===e?"block":"none";l=e}var l=0,i=document.createElement("div");i.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",i.addEventListener("click",function(e){e.preventDefault(),n(++l%i.children.length)},!1);var a=(performance||Date).now(),o=a,f=0,r=t(new e.Panel("FPS","#0ff","#002")),d=t(new e.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=t(new e.Panel("MB","#f08","#201"));return n(0),{REVISION:16,dom:i,addPanel:t,showPanel:n,begin:function(){a=(performance||Date).now()},end:function(){f++;var e=(performance||Date).now();if(d.update(e-a,200),e>o+1e3&&(r.update(1e3*f/(e-o),100),o=e,f=0,c)){var t=performance.memory;c.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){a=this.end()},domElement:i,setMode:n}};return e.Panel=function(e,t,n){var l=1/0,i=0,a=Math.round,o=a(window.devicePixelRatio||1),f=80*o,r=48*o,d=3*o,c=2*o,p=3*o,u=15*o,s=74*o,m=30*o,h=document.createElement("canvas");h.width=f,h.height=r,h.style.cssText="width:80px;height:48px";var v=h.getContext("2d");return v.font="bold "+9*o+"px Helvetica,Arial,sans-serif",v.textBaseline="top",v.fillStyle=n,v.fillRect(0,0,f,r),v.fillStyle=t,v.fillText(e,d,c),v.fillRect(p,u,s,m),v.fillStyle=n,v.globalAlpha=.9,v.fillRect(p,u,s,m),{dom:h,update:function(r,y){l=Math.min(l,r),i=Math.max(i,r),v.fillStyle=n,v.globalAlpha=1,v.fillRect(0,0,f,u),v.fillStyle=t,v.fillText(a(r)+" "+e+" ("+a(l)+"-"+a(i)+")",d,c),v.drawImage(h,p+o,u,s-o,m,p,u,s-o,m),v.fillRect(p+s-o,u,o,m),v.fillStyle=n,v.globalAlpha=.9,v.fillRect(p+s-o,u,o,a((1-r/y)*m))}}},e});
  },{}],14:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const E=exports.DEPTH_BUFFER_BIT=256,_=exports.STENCIL_BUFFER_BIT=1024,R=exports.COLOR_BUFFER_BIT=16384,T=exports.POINTS=0,A=exports.LINES=1,e=exports.LINE_LOOP=2,x=exports.LINE_STRIP=3,t=exports.TRIANGLES=4,s=exports.TRIANGLE_STRIP=5,o=exports.TRIANGLE_FAN=6,r=exports.ZERO=0,p=exports.ONE=1,N=exports.SRC_COLOR=768,I=exports.ONE_MINUS_SRC_COLOR=769,S=exports.SRC_ALPHA=770,O=exports.ONE_MINUS_SRC_ALPHA=771,F=exports.DST_ALPHA=772,M=exports.ONE_MINUS_DST_ALPHA=773,C=exports.DST_COLOR=774,L=exports.ONE_MINUS_DST_COLOR=775,B=exports.SRC_ALPHA_SATURATE=776,U=exports.CONSTANT_COLOR=32769,D=exports.ONE_MINUS_CONSTANT_COLOR=32770,P=exports.CONSTANT_ALPHA=32771,G=exports.ONE_MINUS_CONSTANT_ALPHA=32772,X=exports.FUNC_ADD=32774,H=exports.FUNC_SUBSTRACT=32778,W=exports.FUNC_REVERSE_SUBTRACT=32779,V=exports.BLEND_EQUATION=32777,Y=exports.BLEND_EQUATION_RGB=32777,K=exports.BLEND_EQUATION_ALPHA=34877,Z=exports.BLEND_DST_RGB=32968,Q=exports.BLEND_SRC_RGB=32969,J=exports.BLEND_DST_ALPHA=32970,c=exports.BLEND_SRC_ALPHA=32971,u=exports.BLEND_COLOR=32773,d=exports.ARRAY_BUFFER_BINDING=34964,i=exports.ELEMENT_ARRAY_BUFFER_BINDING=34965,l=exports.LINE_WIDTH=2849,n=exports.ALIASED_POINT_SIZE_RANGE=33901,a=exports.ALIASED_LINE_WIDTH_RANGE=33902,b=exports.CULL_FACE_MODE=2885,f=exports.FRONT_FACE=2886,j=exports.DEPTH_RANGE=2928,v=exports.DEPTH_WRITEMASK=2930,y=exports.DEPTH_CLEAR_VALUE=2931,g=exports.DEPTH_FUNC=2932,h=exports.STENCIL_CLEAR_VALUE=2961,k=exports.STENCIL_FUNC=2962,m=exports.STENCIL_FAIL=2964,q=exports.STENCIL_PASS_DEPTH_FAIL=2965,w=exports.STENCIL_PASS_DEPTH_PASS=2966,z=exports.STENCIL_REF=2967,$=exports.STENCIL_VALUE_MASK=2963,EE=exports.STENCIL_WRITEMASK=2968,_E=exports.STENCIL_BACK_FUNC=34816,RE=exports.STENCIL_BACK_FAIL=34817,TE=exports.STENCIL_BACK_PASS_DEPTH_FAIL=34818,AE=exports.STENCIL_BACK_PASS_DEPTH_PASS=34819,eE=exports.STENCIL_BACK_REF=36003,xE=exports.STENCIL_BACK_VALUE_MASK=36004,tE=exports.STENCIL_BACK_WRITEMASK=36005,sE=exports.VIEWPORT=2978,oE=exports.SCISSOR_BOX=3088,rE=exports.COLOR_CLEAR_VALUE=3106,pE=exports.COLOR_WRITEMASK=3107,NE=exports.UNPACK_ALIGNMENT=3317,IE=exports.PACK_ALIGNMENT=3333,SE=exports.MAX_TEXTURE_SIZE=3379,OE=exports.MAX_VIEWPORT_DIMS=3386,FE=exports.SUBPIXEL_BITS=3408,ME=exports.RED_BITS=3410,CE=exports.GREEN_BITS=3411,LE=exports.BLUE_BITS=3412,BE=exports.ALPHA_BITS=3413,UE=exports.DEPTH_BITS=3414,DE=exports.STENCIL_BITS=3415,PE=exports.POLYGON_OFFSET_UNITS=10752,GE=exports.POLYGON_OFFSET_FACTOR=32824,XE=exports.TEXTURE_BINDING_2D=32873,HE=exports.SAMPLE_BUFFERS=32936,WE=exports.SAMPLES=32937,VE=exports.SAMPLE_COVERAGE_VALUE=32938,YE=exports.SAMPLE_COVERAGE_INVERT=32939,KE=exports.COMPRESSED_TEXTURE_FORMATS=34467,ZE=exports.VENDOR=7936,QE=exports.RENDERER=7937,JE=exports.VERSION=7938,cE=exports.IMPLEMENTATION_COLOR_READ_TYPE=35738,uE=exports.IMPLEMENTATION_COLOR_READ_FORMAT=35739,dE=exports.BROWSER_DEFAULT_WEBGL=37444,iE=exports.STATIC_DRAW=35044,lE=exports.STREAM_DRAW=35040,nE=exports.DYNAMIC_DRAW=35048,aE=exports.ARRAY_BUFFER=34962,bE=exports.ELEMENT_ARRAY_BUFFER=34963,fE=exports.BUFFER_SIZE=34660,jE=exports.BUFFER_USAGE=34661,vE=exports.CURRENT_VERTEX_ATTRIB=34342,yE=exports.VERTEX_ATTRIB_ARRAY_ENABLED=34338,gE=exports.VERTEX_ATTRIB_ARRAY_SIZE=34339,hE=exports.VERTEX_ATTRIB_ARRAY_STRIDE=34340,kE=exports.VERTEX_ATTRIB_ARRAY_TYPE=34341,mE=exports.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922,qE=exports.VERTEX_ATTRIB_ARRAY_POINTER=34373,wE=exports.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975,zE=exports.CULL_FACE=2884,$E=exports.FRONT=1028,E_=exports.BACK=1029,__=exports.FRONT_AND_BACK=1032,R_=exports.BLEND=3042,T_=exports.DEPTH_TEST=2929,A_=exports.DITHER=3024,e_=exports.POLYGON_OFFSET_FILL=32823,x_=exports.SAMPLE_ALPHA_TO_COVERAGE=32926,t_=exports.SAMPLE_COVERAGE=32928,s_=exports.SCISSOR_TEST=3089,o_=exports.STENCIL_TEST=2960,r_=exports.NO_ERROR=0,p_=exports.INVALID_ENUM=1280,N_=exports.INVALID_VALUE=1281,I_=exports.INVALID_OPERATION=1282,S_=exports.OUT_OF_MEMORY=1285,O_=exports.CONTEXT_LOST_WEBGL=37442,F_=exports.CW=2304,M_=exports.CCW=2305,C_=exports.DONT_CARE=4352,L_=exports.FASTEST=4353,B_=exports.NICEST=4354,U_=exports.GENERATE_MIPMAP_HINT=33170,D_=exports.BYTE=5120,P_=exports.UNSIGNED_BYTE=5121,G_=exports.SHORT=5122,X_=exports.UNSIGNED_SHORT=5123,H_=exports.INT=5124,W_=exports.UNSIGNED_INT=5125,V_=exports.FLOAT=5126,Y_=exports.DEPTH_COMPONENT=6402,K_=exports.ALPHA=6406,Z_=exports.RGB=6407,Q_=exports.RGBA=6408,J_=exports.LUMINANCE=6409,c_=exports.LUMINANCE_ALPHA=6410,u_=exports.UNSIGNED_SHORT_4_4_4_4=32819,d_=exports.UNSIGNED_SHORT_5_5_5_1=32820,i_=exports.UNSIGNED_SHORT_5_6_5=33635,l_=exports.FRAGMENT_SHADER=35632,n_=exports.VERTEX_SHADER=35633,a_=exports.COMPILE_STATUS=35713,b_=exports.DELETE_STATUS=35712,f_=exports.LINK_STATUS=35714,j_=exports.VALIDATE_STATUS=35715,v_=exports.ATTACHED_SHADERS=35717,y_=exports.ACTIVE_ATTRIBUTES=35721,g_=exports.ACTIVE_UNIFORMS=35718,h_=exports.MAX_VERTEX_ATTRIBS=34921,k_=exports.MAX_VERTEX_UNIFORM_VECTORS=2271,m_=exports.MAX_VARYING_VECTORS=2271,q_=exports.MAX_COMBINED_TEXTURE_IMAGE_UNITS=2228,w_=exports.MAX_VERTEX_TEXTURE_IMAGE_UNITS=2228,z_=exports.MAX_TEXTURE_IMAGE_UNITS=34930,$_=exports.MAX_FRAGMENT_UNIFORM_VECTORS=2271,ER=exports.SHADER_TYPE=2228,_R=exports.SHADING_LANGUAGE_VERSION=2232,RR=exports.CURRENT_PROGRAM=35725,TR=exports.NEVER=512,AR=exports.ALWAYS=519,eR=exports.LESS=513,xR=exports.EQUAL=514,tR=exports.LEQUAL=515,sR=exports.GREATER=516,oR=exports.GEQUAL=518,rR=exports.NOTEQUAL=517,pR=exports.KEEP=7680,NR=exports.REPLACE=7681,IR=exports.INCR=7682,SR=exports.DECR=7683,OR=exports.INVERT=5386,FR=exports.INCR_WRAP=34055,MR=exports.DECR_WRAP=34056,CR=exports.NEAREST=9728,LR=exports.LINEAR=9729,BR=exports.NEAREST_MIPMAP_NEAREST=9984,UR=exports.LINEAR_MIPMAP_NEAREST=9985,DR=exports.NEAREST_MIPMAP_LINEAR=9986,PR=exports.LINEAR_MIPMAP_LINEAR=9987,GR=exports.TEXTURE_MAG_FILTER=10240,XR=exports.TEXTURE_MIN_FILTER=10241,HR=exports.TEXTURE_WRAP_S=10242,WR=exports.TEXTURE_WRAP_T=10243,VR=exports.TEXTURE_2D=3553,YR=exports.TEXTURE=5890,KR=exports.TEXTURE_CUBE_MAP=34067,ZR=exports.TEXTURE_BINDING_CUBE_MAP=34068,QR=exports.TEXTURE_CUBE_MAP_POSITIVE_X=34069,JR=exports.TEXTURE_CUBE_MAP_NEGATIVE_X=34070,cR=exports.TEXTURE_CUBE_MAP_POSITIVE_Y=34071,uR=exports.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072,dR=exports.TEXTURE_CUBE_MAP_POSITIVE_Z=34073,iR=exports.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074,lR=exports.MAX_CUBE_MAP_TEXTURE_SIZE=34076,nR=exports.TEXTURE0=33984,aR=exports.ACTIVE_TEXTURE=34016,bR=exports.REPEAT=10497,fR=exports.CLAMP_TO_EDGE=33071,jR=exports.MIRRORED_REPEAT=33648,vR=exports.FLOAT_VEC2=35664,yR=exports.FLOAT_VEC3=35665,gR=exports.FLOAT_VEC4=35666,hR=exports.INT_VEC2=35667,kR=exports.INT_VEC3=35668,mR=exports.INT_VEC4=35669,qR=exports.BOOL=35670,wR=exports.BOOL_VEC2=35671,zR=exports.BOOL_VEC3=35672,$R=exports.BOOL_VEC4=35673,ET=exports.FLOAT_MAT2=35674,_T=exports.FLOAT_MAT3=35675,RT=exports.FLOAT_MAT4=35676,TT=exports.SAMPLER_2D=35678,AT=exports.SAMPLER_CUBE=35680,eT=exports.LOW_FLOAT=36336,xT=exports.MEDIUM_FLOAT=36337,tT=exports.HIGH_FLOAT=36338,sT=exports.LOW_INT=36339,oT=exports.MEDIUM_INT=36340,rT=exports.HIGH_INT=36341,pT=exports.FRAMEBUFFER=36160,NT=exports.RENDERBUFFER=36161,IT=exports.RGBA4=32854,ST=exports.RGB5_A1=32855,OT=exports.RGB565=36194,FT=exports.DEPTH_COMPONENT16=33189,MT=exports.STENCIL_INDEX=6401,CT=exports.STENCIL_INDEX8=36168,LT=exports.RENDERBUFFER_WIDTH=36162,BT=exports.RENDERBUFFER_HEIGHT=36163,UT=exports.RENDERBUFFER_INTERNAL_FORMAT=36164,DT=exports.RENDERBUFFER_RED_SIZE=36176,PT=exports.RENDERBUFFER_GREEN_SIZE=36177,GT=exports.RENDERBUFFER_BLUE_SIZE=36178,XT=exports.RENDERBUFFER_ALPHA_SIZE=36179,HT=exports.RENDERBUFFER_DEPTH_SIZE=36180,WT=exports.RENDERBUFFER_STENCIL_SIZE=36181,VT=exports.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048,YT=exports.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049,KT=exports.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050,ZT=exports.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051,QT=exports.COLOR_ATTACHMENT0=36064,JT=exports.DEPTH_ATTACHMENT=36096,cT=exports.STENCIL_ATTACHMENT=36128,uT=exports.NONE=0,dT=exports.FRAMEBUFFER_COMPLETE=36053,iT=exports.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054,lT=exports.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055,nT=exports.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057,aT=exports.FRAMEBUFFER_UNSUPPORTED=36061,bT=exports.FRAMEBUFFER_BINDING=36006,fT=exports.RENDERBUFFER_BINDING=36007,jT=exports.MAX_RENDERBUFFER_SIZE=34024,vT=exports.INVALID_FRAMEBUFFER_OPERATION=1286,yT=exports.UNPACK_FLIP_Y_WEBGL=37440,gT=exports.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441,hT=exports.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443,kT=exports.READ_BUFFER=3074,mT=exports.UNPACK_ROW_LENGTH=3314,qT=exports.UNPACK_SKIP_ROWS=3315,wT=exports.UNPACK_SKIP_PIXELS=3316,zT=exports.PACK_ROW_LENGTH=3330,$T=exports.PACK_SKIP_ROWS=3331,EA=exports.PACK_SKIP_PIXELS=3332,_A=exports.TEXTURE_BINDING_3D=32874,RA=exports.UNPACK_SKIP_IMAGES=32877,TA=exports.UNPACK_IMAGE_HEIGHT=32878,AA=exports.MAX_3D_TEXTURE_SIZE=32883,eA=exports.MAX_ELEMENTS_VERTICES=33e3,xA=exports.MAX_ELEMENTS_INDICES=33001,tA=exports.MAX_TEXTURE_LOD_BIAS=34045,sA=exports.MAX_FRAGMENT_UNIFORM_COMPONENTS=35657,oA=exports.MAX_VERTEX_UNIFORM_COMPONENTS=35658,rA=exports.MAX_ARRAY_TEXTURE_LAYERS=35071,pA=exports.MIN_PROGRAM_TEXEL_OFFSET=35076,NA=exports.MAX_PROGRAM_TEXEL_OFFSET=35077,IA=exports.MAX_VARYING_COMPONENTS=35659,SA=exports.FRAGMENT_SHADER_DERIVATIVE_HINT=35723,OA=exports.RASTERIZER_DISCARD=35977,FA=exports.VERTEX_ARRAY_BINDING=34229,MA=exports.MAX_VERTEX_OUTPUT_COMPONENTS=37154,CA=exports.MAX_FRAGMENT_INPUT_COMPONENTS=37157,LA=exports.MAX_SERVER_WAIT_TIMEOUT=37137,BA=exports.MAX_ELEMENT_INDEX=36203,UA=exports.RED=6403,DA=exports.RGB8=32849,PA=exports.RGBA8=32856,GA=exports.RGB10_A2=32857,XA=exports.TEXTURE_3D=32879,HA=exports.TEXTURE_WRAP_R=32882,WA=exports.TEXTURE_MIN_LOD=33082,VA=exports.TEXTURE_MAX_LOD=33083,YA=exports.TEXTURE_BASE_LEVEL=33084,KA=exports.TEXTURE_MAX_LEVEL=33085,ZA=exports.TEXTURE_COMPARE_MODE=34892,QA=exports.TEXTURE_COMPARE_FUNC=34893,JA=exports.SRGB=35904,cA=exports.SRGB8=35905,uA=exports.SRGB8_ALPHA8=35907,dA=exports.COMPARE_REF_TO_TEXTURE=34894,iA=exports.RGBA32F=34836,lA=exports.RGB32F=34837,nA=exports.RGBA16F=34842,aA=exports.RGB16F=34843,bA=exports.TEXTURE_2D_ARRAY=35866,fA=exports.TEXTURE_BINDING_2D_ARRAY=35869,jA=exports.R11F_G11F_B10F=35898,vA=exports.RGB9_E5=35901,yA=exports.RGBA32UI=36208,gA=exports.RGB32UI=36209,hA=exports.RGBA16UI=36214,kA=exports.RGB16UI=36215,mA=exports.RGBA8UI=36220,qA=exports.RGB8UI=36221,wA=exports.RGBA32I=36226,zA=exports.RGB32I=36227,$A=exports.RGBA16I=36232,Ee=exports.RGB16I=36233,_e=exports.RGBA8I=36238,Re=exports.RGB8I=36239,Te=exports.RED_INTEGER=36244,Ae=exports.RGB_INTEGER=36248,ee=exports.RGBA_INTEGER=36249,xe=exports.R8=33321,te=exports.RG8=33323,se=exports.R16F=33325,oe=exports.R32F=33326,re=exports.RG16F=33327,pe=exports.RG32F=33328,Ne=exports.R8I=33329,Ie=exports.R8UI=33330,Se=exports.R16I=33331,Oe=exports.R16UI=33332,Fe=exports.R32I=33333,Me=exports.R32UI=33334,Ce=exports.RG8I=33335,Le=exports.RG8UI=33336,Be=exports.RG16I=33337,Ue=exports.RG16UI=33338,De=exports.RG32I=33339,Pe=exports.RG32UI=33340,Ge=exports.R8_SNORM=36756,Xe=exports.RG8_SNORM=36757,He=exports.RGB8_SNORM=36758,We=exports.RGBA8_SNORM=36759,Ve=exports.RGB10_A2UI=36975,Ye=exports.TEXTURE_IMMUTABLE_FORMAT=37167,Ke=exports.TEXTURE_IMMUTABLE_LEVELS=33503,Ze=exports.UNSIGNED_INT_2_10_10_10_REV=33640,Qe=exports.UNSIGNED_INT_10F_11F_11F_REV=35899,Je=exports.UNSIGNED_INT_5_9_9_9_REV=35902,ce=exports.FLOAT_32_UNSIGNED_INT_24_8_REV=36269,ue=exports.UNSIGNED_INT_24_8=34042,de=exports.HALF_FLOAT=5131,ie=exports.RG=33319,le=exports.RG_INTEGER=33320,ne=exports.INT_2_10_10_10_REV=36255,ae=exports.CURRENT_QUERY=34917,be=exports.QUERY_RESULT=34918,fe=exports.QUERY_RESULT_AVAILABLE=34919,je=exports.ANY_SAMPLES_PASSED=35887,ve=exports.ANY_SAMPLES_PASSED_CONSERVATIVE=36202,ye=exports.MAX_DRAW_BUFFERS=34852,ge=exports.DRAW_BUFFER0=34853,he=exports.DRAW_BUFFER1=34854,ke=exports.DRAW_BUFFER2=34855,me=exports.DRAW_BUFFER3=34856,qe=exports.DRAW_BUFFER4=34857,we=exports.DRAW_BUFFER5=34858,ze=exports.DRAW_BUFFER6=34859,$e=exports.DRAW_BUFFER7=34860,Ex=exports.DRAW_BUFFER8=34861,_x=exports.DRAW_BUFFER9=34862,Rx=exports.DRAW_BUFFER10=34863,Tx=exports.DRAW_BUFFER11=34864,Ax=exports.DRAW_BUFFER12=34865,ex=exports.DRAW_BUFFER13=34866,xx=exports.DRAW_BUFFER14=34867,tx=exports.DRAW_BUFFER15=34868,sx=exports.MAX_COLOR_ATTACHMENTS=36063,ox=exports.COLOR_ATTACHMENT1=36065,rx=exports.COLOR_ATTACHMENT2=36066,px=exports.COLOR_ATTACHMENT3=36067,Nx=exports.COLOR_ATTACHMENT4=36068,Ix=exports.COLOR_ATTACHMENT5=36069,Sx=exports.COLOR_ATTACHMENT6=36070,Ox=exports.COLOR_ATTACHMENT7=36071,Fx=exports.COLOR_ATTACHMENT8=36072,Mx=exports.COLOR_ATTACHMENT9=36073,Cx=exports.COLOR_ATTACHMENT10=36074,Lx=exports.COLOR_ATTACHMENT11=36075,Bx=exports.COLOR_ATTACHMENT12=36076,Ux=exports.COLOR_ATTACHMENT13=36077,Dx=exports.COLOR_ATTACHMENT14=36078,Px=exports.COLOR_ATTACHMENT15=36079,Gx=exports.SAMPLER_3D=35679,Xx=exports.SAMPLER_2D_SHADOW=35682,Hx=exports.SAMPLER_2D_ARRAY=36289,Wx=exports.SAMPLER_2D_ARRAY_SHADOW=36292,Vx=exports.SAMPLER_CUBE_SHADOW=36293,Yx=exports.INT_SAMPLER_2D=36298,Kx=exports.INT_SAMPLER_3D=36299,Zx=exports.INT_SAMPLER_CUBE=36300,Qx=exports.INT_SAMPLER_2D_ARRAY=36303,Jx=exports.UNSIGNED_INT_SAMPLER_2D=36306,cx=exports.UNSIGNED_INT_SAMPLER_3D=36307,ux=exports.UNSIGNED_INT_SAMPLER_CUBE=36308,dx=exports.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311,ix=exports.MAX_SAMPLES=36183,lx=exports.SAMPLER_BINDING=35097,nx=exports.PIXEL_PACK_BUFFER=35051,ax=exports.PIXEL_UNPACK_BUFFER=35052,bx=exports.PIXEL_PACK_BUFFER_BINDING=35053,fx=exports.PIXEL_UNPACK_BUFFER_BINDING=35055,jx=exports.COPY_READ_BUFFER=36662,vx=exports.COPY_WRITE_BUFFER=36663,yx=exports.COPY_READ_BUFFER_BINDING=36662,gx=exports.COPY_WRITE_BUFFER_BINDING=36663,hx=exports.FLOAT_MAT2x3=35685,kx=exports.FLOAT_MAT2x4=35686,mx=exports.FLOAT_MAT3x2=35687,qx=exports.FLOAT_MAT3x4=35688,wx=exports.FLOAT_MAT4x2=35689,zx=exports.FLOAT_MAT4x3=35690,$x=exports.UNSIGNED_INT_VEC2=36294,Et=exports.UNSIGNED_INT_VEC3=36295,_t=exports.UNSIGNED_INT_VEC4=36296,Rt=exports.UNSIGNED_NORMALIZED=35863,Tt=exports.SIGNED_NORMALIZED=36764,At=exports.VERTEX_ATTRIB_ARRAY_INTEGER=35069,et=exports.VERTEX_ATTRIB_ARRAY_DIVISOR=35070,xt=exports.TRANSFORM_FEEDBACK_BUFFER_MODE=35967,tt=exports.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS=35968,st=exports.TRANSFORM_FEEDBACK_VARYINGS=35971,ot=exports.TRANSFORM_FEEDBACK_BUFFER_START=35972,rt=exports.TRANSFORM_FEEDBACK_BUFFER_SIZE=35973,pt=exports.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN=35976,Nt=exports.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS=35978,It=exports.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS=35979,St=exports.INTERLEAVED_ATTRIBS=35980,Ot=exports.SEPARATE_ATTRIBS=35981,Ft=exports.TRANSFORM_FEEDBACK_BUFFER=35982,Mt=exports.TRANSFORM_FEEDBACK_BUFFER_BINDING=35983,Ct=exports.TRANSFORM_FEEDBACK=36386,Lt=exports.TRANSFORM_FEEDBACK_PAUSED=36387,Bt=exports.TRANSFORM_FEEDBACK_ACTIVE=36388,Ut=exports.TRANSFORM_FEEDBACK_BINDING=36389,Dt=exports.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING=33296,Pt=exports.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE=33297,Gt=exports.FRAMEBUFFER_ATTACHMENT_RED_SIZE=33298,Xt=exports.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE=33299,Ht=exports.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE=33300,Wt=exports.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE=33301,Vt=exports.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE=33302,Yt=exports.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE=33303,Kt=exports.FRAMEBUFFER_DEFAULT=33304,Zt=exports.DEPTH_STENCIL_ATTACHMENT=33306,Qt=exports.DEPTH_STENCIL=34041,Jt=exports.DEPTH24_STENCIL8=35056,ct=exports.DRAW_FRAMEBUFFER_BINDING=36006,ut=exports.READ_FRAMEBUFFER=36008,dt=exports.DRAW_FRAMEBUFFER=36009,it=exports.READ_FRAMEBUFFER_BINDING=36010,lt=exports.RENDERBUFFER_SAMPLES=36011,nt=exports.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER=36052,at=exports.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE=36182,bt=exports.UNIFORM_BUFFER=35345,ft=exports.UNIFORM_BUFFER_BINDING=35368,jt=exports.UNIFORM_BUFFER_START=35369,vt=exports.UNIFORM_BUFFER_SIZE=35370,yt=exports.MAX_VERTEX_UNIFORM_BLOCKS=35371,gt=exports.MAX_FRAGMENT_UNIFORM_BLOCKS=35373,ht=exports.MAX_COMBINED_UNIFORM_BLOCKS=35374,kt=exports.MAX_UNIFORM_BUFFER_BINDINGS=35375,mt=exports.MAX_UNIFORM_BLOCK_SIZE=35376,qt=exports.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS=35377,wt=exports.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS=35379,zt=exports.UNIFORM_BUFFER_OFFSET_ALIGNMENT=35380,$t=exports.ACTIVE_UNIFORM_BLOCKS=35382,Es=exports.UNIFORM_TYPE=35383,_s=exports.UNIFORM_SIZE=35384,Rs=exports.UNIFORM_BLOCK_INDEX=35386,Ts=exports.UNIFORM_OFFSET=35387,As=exports.UNIFORM_ARRAY_STRIDE=35388,es=exports.UNIFORM_MATRIX_STRIDE=35389,xs=exports.UNIFORM_IS_ROW_MAJOR=35390,ts=exports.UNIFORM_BLOCK_BINDING=35391,ss=exports.UNIFORM_BLOCK_DATA_SIZE=35392,os=exports.UNIFORM_BLOCK_ACTIVE_UNIFORMS=35394,rs=exports.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES=35395,ps=exports.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER=35396,Ns=exports.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER=35398,Is=exports.OBJECT_TYPE=37138,Ss=exports.SYNC_CONDITION=37139,Os=exports.SYNC_STATUS=37140,Fs=exports.SYNC_FLAGS=37141,Ms=exports.SYNC_FENCE=37142,Cs=exports.SYNC_GPU_COMMANDS_COMPLETE=37143,Ls=exports.UNSIGNALED=37144,Bs=exports.SIGNALED=37145,Us=exports.ALREADY_SIGNALED=37146,Ds=exports.TIMEOUT_EXPIRED=37147,Ps=exports.CONDITION_SATISFIED=37148,Gs=exports.WAIT_FAILED=37149,Xs=exports.SYNC_FLUSH_COMMANDS_BIT=1,Hs=exports.COLOR=6144,Ws=exports.DEPTH=6145,Vs=exports.STENCIL=6146,Ys=exports.MIN=32775,Ks=exports.MAX=32776,Zs=exports.DEPTH_COMPONENT24=33190,Qs=exports.STREAM_READ=35041,Js=exports.STREAM_COPY=35042,cs=exports.STATIC_READ=35045,us=exports.STATIC_COPY=35046,ds=exports.DYNAMIC_READ=35049,is=exports.DYNAMIC_COPY=35050,ls=exports.DEPTH_COMPONENT32F=36012,ns=exports.DEPTH32F_STENCIL8=36013,as=exports.INVALID_INDEX=4294967295,bs=exports.TIMEOUT_IGNORED=-1,fs=exports.MAX_CLIENT_WAIT_TIMEOUT_WEBGL=37447,js=exports.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE=35070,vs=exports.UNMASKED_VENDOR_WEBGL=37445,ys=exports.UNMASKED_RENDERER_WEBGL=37446,gs=exports.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047,hs=exports.TEXTURE_MAX_ANISOTROPY_EXT=34046,ks=exports.COMPRESSED_RGB_S3TC_DXT1_EXT=33776,ms=exports.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777,qs=exports.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778,ws=exports.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779,zs=exports.COMPRESSED_R11_EAC=37488,$s=exports.COMPRESSED_SIGNED_R11_EAC=37489,Eo=exports.COMPRESSED_RG11_EAC=37490,_o=exports.COMPRESSED_SIGNED_RG11_EAC=37491,Ro=exports.COMPRESSED_RGB8_ETC2=37492,To=exports.COMPRESSED_RGBA8_ETC2_EAC=37493,Ao=exports.COMPRESSED_SRGB8_ETC2=37494,eo=exports.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37495,xo=exports.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37496,to=exports.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37497,so=exports.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840,oo=exports.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842,ro=exports.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841,po=exports.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843,No=exports.COMPRESSED_RGB_ETC1_WEBGL=36196,Io=exports.COMPRESSED_RGB_ATC_WEBGL=35986,So=exports.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986,Oo=exports.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798,Fo=exports.UNSIGNED_INT_24_8_WEBGL=34042,Mo=exports.HALF_FLOAT_OES=36193,Co=exports.RGBA32F_EXT=34836,Lo=exports.RGB32F_EXT=34837,Bo=exports.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT=2081,Uo=exports.UNSIGNED_NORMALIZED_EXT=2241,Do=exports.MIN_EXT=32775,Po=exports.MAX_EXT=32776,Go=exports.SRGB_EXT=35904,Xo=exports.SRGB_ALPHA_EXT=35906,Ho=exports.SRGB8_ALPHA8_EXT=35907,Wo=exports.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT=33296,Vo=exports.FRAGMENT_SHADER_DERIVATIVE_HINT_OES=35723,Yo=exports.COLOR_ATTACHMENT0_WEBGL=36064,Ko=exports.COLOR_ATTACHMENT1_WEBGL=36065,Zo=exports.COLOR_ATTACHMENT2_WEBGL=36066,Qo=exports.COLOR_ATTACHMENT3_WEBGL=36067,Jo=exports.COLOR_ATTACHMENT4_WEBGL=36068,co=exports.COLOR_ATTACHMENT5_WEBGL=36069,uo=exports.COLOR_ATTACHMENT6_WEBGL=36070,io=exports.COLOR_ATTACHMENT7_WEBGL=36071,lo=exports.COLOR_ATTACHMENT8_WEBGL=36072,no=exports.COLOR_ATTACHMENT9_WEBGL=36073,ao=exports.COLOR_ATTACHMENT10_WEBGL=36074,bo=exports.COLOR_ATTACHMENT11_WEBGL=36075,fo=exports.COLOR_ATTACHMENT12_WEBGL=36076,jo=exports.COLOR_ATTACHMENT13_WEBGL=36077,vo=exports.COLOR_ATTACHMENT14_WEBGL=36078,yo=exports.COLOR_ATTACHMENT15_WEBGL=36079,go=exports.DRAW_BUFFER0_WEBGL=34853,ho=exports.DRAW_BUFFER1_WEBGL=34854,ko=exports.DRAW_BUFFER2_WEBGL=34855,mo=exports.DRAW_BUFFER3_WEBGL=34856,qo=exports.DRAW_BUFFER4_WEBGL=34857,wo=exports.DRAW_BUFFER5_WEBGL=34858,zo=exports.DRAW_BUFFER6_WEBGL=34859,$o=exports.DRAW_BUFFER7_WEBGL=34860,Er=exports.DRAW_BUFFER8_WEBGL=34861,_r=exports.DRAW_BUFFER9_WEBGL=34862,Rr=exports.DRAW_BUFFER10_WEBGL=34863,Tr=exports.DRAW_BUFFER11_WEBGL=34864,Ar=exports.DRAW_BUFFER12_WEBGL=34865,er=exports.DRAW_BUFFER13_WEBGL=34866,xr=exports.DRAW_BUFFER14_WEBGL=34867,tr=exports.DRAW_BUFFER15_WEBGL=34868,sr=exports.MAX_COLOR_ATTACHMENTS_WEBGL=36063,or=exports.MAX_DRAW_BUFFERS_WEBGL=34852,rr=exports.VERTEX_ARRAY_BINDING_OES=34229,pr=exports.QUERY_COUNTER_BITS_EXT=34916,Nr=exports.CURRENT_QUERY_EXT=34917,Ir=exports.QUERY_RESULT_EXT=34918,Sr=exports.QUERY_RESULT_AVAILABLE_EXT=34919,Or=exports.TIME_ELAPSED_EXT=35007,Fr=exports.TIMESTAMP_EXT=36392,Mr=exports.GPU_DISJOINT_EXT=36795;
  },{}],13:[function(require,module,exports) {
  !function(e){"use strict";function t(){}function n(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function r(e){return function(){return this[e].apply(this,arguments)}}function i(e){return"function"==typeof e||e instanceof RegExp||!(!e||"object"!=typeof e)&&i(e.listener)}var s=t.prototype,o=e.EventEmitter;s.getListeners=function(e){var t,n,r=this._getEvents();if(e instanceof RegExp){t={};for(n in r)r.hasOwnProperty(n)&&e.test(n)&&(t[n]=r[n])}else t=r[e]||(r[e]=[]);return t},s.flattenListeners=function(e){var t,n=[];for(t=0;t<e.length;t+=1)n.push(e[t].listener);return n},s.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&((t={})[e]=n),t||n},s.addListener=function(e,t){if(!i(t))throw new TypeError("listener must be a function");var r,s=this.getListenersAsObject(e),o="object"==typeof t;for(r in s)s.hasOwnProperty(r)&&-1===n(s[r],t)&&s[r].push(o?t:{listener:t,once:!1});return this},s.on=r("addListener"),s.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},s.once=r("addOnceListener"),s.defineEvent=function(e){return this.getListeners(e),this},s.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},s.removeListener=function(e,t){var r,i,s=this.getListenersAsObject(e);for(i in s)s.hasOwnProperty(i)&&-1!==(r=n(s[i],t))&&s[i].splice(r,1);return this},s.off=r("removeListener"),s.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},s.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},s.manipulateListeners=function(e,t,n){var r,i,s=e?this.removeListener:this.addListener,o=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(r=n.length;r--;)s.call(this,t,n[r]);else for(r in t)t.hasOwnProperty(r)&&(i=t[r])&&("function"==typeof i?s.call(this,r,i):o.call(this,r,i));return this},s.removeEvent=function(e){var t,n=typeof e,r=this._getEvents();if("string"===n)delete r[e];else if(e instanceof RegExp)for(t in r)r.hasOwnProperty(t)&&e.test(t)&&delete r[t];else delete this._events;return this},s.removeAllListeners=r("removeEvent"),s.emitEvent=function(e,t){var n,r,i,s,o=this.getListenersAsObject(e);for(s in o)if(o.hasOwnProperty(s))for(n=o[s].slice(0),i=0;i<n.length;i++)!0===(r=n[i]).once&&this.removeListener(e,r.listener),r.listener.apply(this,t||[])===this._getOnceReturnValue()&&this.removeListener(e,r.listener);return this},s.trigger=r("emitEvent"),s.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},s.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},s._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},s._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return e.EventEmitter=o,t},"function"==typeof define&&define.amd?define(function(){return t}):"object"==typeof module&&module.exports?module.exports=t:e.EventEmitter=t}(this||{});
  },{}],35:[function(require,module,exports) {
  "use strict";function t(t){exports.ARRAY_TYPE=o=t}function r(t){return t*n}function e(t,r){return Math.abs(t-r)<=a*Math.max(1,Math.abs(t),Math.abs(r))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.setMatrixArrayType=t,exports.toRadian=r,exports.equals=e;var a=exports.EPSILON=1e-6,o=exports.ARRAY_TYPE="undefined"!=typeof Float32Array?Float32Array:Array,s=exports.RANDOM=Math.random,n=Math.PI/180;
  },{}],38:[function(require,module,exports) {
  "use strict";function t(t){if(t&&t.__esModule)return t;var r={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r.default=t,r}function r(){var t=new R.ARRAY_TYPE(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function n(t){var r=new R.ARRAY_TYPE(4);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}function e(t,r){return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t}function o(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function a(t,r,n,e){var o=new R.ARRAY_TYPE(4);return o[0]=t,o[1]=r,o[2]=n,o[3]=e,o}function u(t,r,n,e,o){return t[0]=r,t[1]=n,t[2]=e,t[3]=o,t}function s(t,r){if(t===r){var n=r[1];t[1]=r[2],t[2]=n}else t[0]=r[0],t[1]=r[2],t[2]=r[1],t[3]=r[3];return t}function i(t,r){var n=r[0],e=r[1],o=r[2],a=r[3],u=n*a-o*e;return u?(u=1/u,t[0]=a*u,t[1]=-e*u,t[2]=-o*u,t[3]=n*u,t):null}function p(t,r){var n=r[0];return t[0]=r[3],t[1]=-r[1],t[2]=-r[2],t[3]=n,t}function c(t){return t[0]*t[3]-t[2]*t[1]}function f(t,r,n){var e=r[0],o=r[1],a=r[2],u=r[3],s=n[0],i=n[1],p=n[2],c=n[3];return t[0]=e*s+a*i,t[1]=o*s+u*i,t[2]=e*p+a*c,t[3]=o*p+u*c,t}function x(t,r,n){var e=r[0],o=r[1],a=r[2],u=r[3],s=Math.sin(n),i=Math.cos(n);return t[0]=e*i+a*s,t[1]=o*i+u*s,t[2]=e*-s+a*i,t[3]=o*-s+u*i,t}function l(t,r,n){var e=r[0],o=r[1],a=r[2],u=r[3],s=n[0],i=n[1];return t[0]=e*s,t[1]=o*s,t[2]=a*i,t[3]=u*i,t}function M(t,r){var n=Math.sin(r),e=Math.cos(r);return t[0]=e,t[1]=n,t[2]=-n,t[3]=e,t}function h(t,r){return t[0]=r[0],t[1]=0,t[2]=0,t[3]=r[1],t}function b(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function v(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))}function m(t,r,n,e){return t[2]=e[2]/e[0],n[0]=e[0],n[1]=e[1],n[3]=e[3]-t[2]*n[1],[t,r,n]}function d(t,r,n){return t[0]=r[0]+n[0],t[1]=r[1]+n[1],t[2]=r[2]+n[2],t[3]=r[3]+n[3],t}function P(t,r,n){return t[0]=r[0]-n[0],t[1]=r[1]-n[1],t[2]=r[2]-n[2],t[3]=r[3]-n[3],t}function w(t,r){return t[0]===r[0]&&t[1]===r[1]&&t[2]===r[2]&&t[3]===r[3]}function y(t,r){var n=t[0],e=t[1],o=t[2],a=t[3],u=r[0],s=r[1],i=r[2],p=r[3];return Math.abs(n-u)<=R.EPSILON*Math.max(1,Math.abs(n),Math.abs(u))&&Math.abs(e-s)<=R.EPSILON*Math.max(1,Math.abs(e),Math.abs(s))&&Math.abs(o-i)<=R.EPSILON*Math.max(1,Math.abs(o),Math.abs(i))&&Math.abs(a-p)<=R.EPSILON*Math.max(1,Math.abs(a),Math.abs(p))}function A(t,r,n){return t[0]=r[0]*n,t[1]=r[1]*n,t[2]=r[2]*n,t[3]=r[3]*n,t}function E(t,r,n,e){return t[0]=r[0]+n[0]*e,t[1]=r[1]+n[1]*e,t[2]=r[2]+n[2]*e,t[3]=r[3]+n[3]*e,t}Object.defineProperty(exports,"__esModule",{value:!0}),exports.sub=exports.mul=void 0,exports.create=r,exports.clone=n,exports.copy=e,exports.identity=o,exports.fromValues=a,exports.set=u,exports.transpose=s,exports.invert=i,exports.adjoint=p,exports.determinant=c,exports.multiply=f,exports.rotate=x,exports.scale=l,exports.fromRotation=M,exports.fromScaling=h,exports.str=b,exports.frob=v,exports.LDU=m,exports.add=d,exports.subtract=P,exports.exactEquals=w,exports.equals=y,exports.multiplyScalar=A,exports.multiplyScalarAndAdd=E;var O=require("./common"),R=t(O),S=exports.mul=f,_=exports.sub=P;
  },{"./common":35}],39:[function(require,module,exports) {
  "use strict";function t(t){if(t&&t.__esModule)return t;var r={};if(null!=t)for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(r[a]=t[a]);return r.default=t,r}function r(){var t=new y.ARRAY_TYPE(6);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function a(t){var r=new y.ARRAY_TYPE(6);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r}function n(t,r){return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t}function e(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function o(t,r,a,n,e,o){var u=new y.ARRAY_TYPE(6);return u[0]=t,u[1]=r,u[2]=a,u[3]=n,u[4]=e,u[5]=o,u}function u(t,r,a,n,e,o,u){return t[0]=r,t[1]=a,t[2]=n,t[3]=e,t[4]=o,t[5]=u,t}function s(t,r){var a=r[0],n=r[1],e=r[2],o=r[3],u=r[4],s=r[5],i=a*o-n*e;return i?(i=1/i,t[0]=o*i,t[1]=-n*i,t[2]=-e*i,t[3]=a*i,t[4]=(e*s-o*u)*i,t[5]=(n*u-a*s)*i,t):null}function i(t){return t[0]*t[3]-t[1]*t[2]}function p(t,r,a){var n=r[0],e=r[1],o=r[2],u=r[3],s=r[4],i=r[5],p=a[0],c=a[1],M=a[2],h=a[3],x=a[4],f=a[5];return t[0]=n*p+o*c,t[1]=e*p+u*c,t[2]=n*M+o*h,t[3]=e*M+u*h,t[4]=n*x+o*f+s,t[5]=e*x+u*f+i,t}function c(t,r,a){var n=r[0],e=r[1],o=r[2],u=r[3],s=r[4],i=r[5],p=Math.sin(a),c=Math.cos(a);return t[0]=n*c+o*p,t[1]=e*c+u*p,t[2]=n*-p+o*c,t[3]=e*-p+u*c,t[4]=s,t[5]=i,t}function M(t,r,a){var n=r[0],e=r[1],o=r[2],u=r[3],s=r[4],i=r[5],p=a[0],c=a[1];return t[0]=n*p,t[1]=e*p,t[2]=o*c,t[3]=u*c,t[4]=s,t[5]=i,t}function h(t,r,a){var n=r[0],e=r[1],o=r[2],u=r[3],s=r[4],i=r[5],p=a[0],c=a[1];return t[0]=n,t[1]=e,t[2]=o,t[3]=u,t[4]=n*p+o*c+s,t[5]=e*p+u*c+i,t}function x(t,r){var a=Math.sin(r),n=Math.cos(r);return t[0]=n,t[1]=a,t[2]=-a,t[3]=n,t[4]=0,t[5]=0,t}function f(t,r){return t[0]=r[0],t[1]=0,t[2]=0,t[3]=r[1],t[4]=0,t[5]=0,t}function l(t,r){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=r[0],t[5]=r[1],t}function b(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function m(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)}function v(t,r,a){return t[0]=r[0]+a[0],t[1]=r[1]+a[1],t[2]=r[2]+a[2],t[3]=r[3]+a[3],t[4]=r[4]+a[4],t[5]=r[5]+a[5],t}function d(t,r,a){return t[0]=r[0]-a[0],t[1]=r[1]-a[1],t[2]=r[2]-a[2],t[3]=r[3]-a[3],t[4]=r[4]-a[4],t[5]=r[5]-a[5],t}function P(t,r,a){return t[0]=r[0]*a,t[1]=r[1]*a,t[2]=r[2]*a,t[3]=r[3]*a,t[4]=r[4]*a,t[5]=r[5]*a,t}function w(t,r,a,n){return t[0]=r[0]+a[0]*n,t[1]=r[1]+a[1]*n,t[2]=r[2]+a[2]*n,t[3]=r[3]+a[3]*n,t[4]=r[4]+a[4]*n,t[5]=r[5]+a[5]*n,t}function E(t,r){return t[0]===r[0]&&t[1]===r[1]&&t[2]===r[2]&&t[3]===r[3]&&t[4]===r[4]&&t[5]===r[5]}function O(t,r){var a=t[0],n=t[1],e=t[2],o=t[3],u=t[4],s=t[5],i=r[0],p=r[1],c=r[2],M=r[3],h=r[4],x=r[5];return Math.abs(a-i)<=y.EPSILON*Math.max(1,Math.abs(a),Math.abs(i))&&Math.abs(n-p)<=y.EPSILON*Math.max(1,Math.abs(n),Math.abs(p))&&Math.abs(e-c)<=y.EPSILON*Math.max(1,Math.abs(e),Math.abs(c))&&Math.abs(o-M)<=y.EPSILON*Math.max(1,Math.abs(o),Math.abs(M))&&Math.abs(u-h)<=y.EPSILON*Math.max(1,Math.abs(u),Math.abs(h))&&Math.abs(s-x)<=y.EPSILON*Math.max(1,Math.abs(s),Math.abs(x))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.sub=exports.mul=void 0,exports.create=r,exports.clone=a,exports.copy=n,exports.identity=e,exports.fromValues=o,exports.set=u,exports.invert=s,exports.determinant=i,exports.multiply=p,exports.rotate=c,exports.scale=M,exports.translate=h,exports.fromRotation=x,exports.fromScaling=f,exports.fromTranslation=l,exports.str=b,exports.frob=m,exports.add=v,exports.subtract=d,exports.multiplyScalar=P,exports.multiplyScalarAndAdd=w,exports.exactEquals=E,exports.equals=O;var S=require("./common"),y=t(S),A=exports.mul=p,R=exports.sub=d;
  },{"./common":35}],36:[function(require,module,exports) {
  "use strict";function t(t){if(t&&t.__esModule)return t;var r={};if(null!=t)for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(r[a]=t[a]);return r.default=t,r}function r(){var t=new Y.ARRAY_TYPE(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function a(t,r){return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[4],t[4]=r[5],t[5]=r[6],t[6]=r[8],t[7]=r[9],t[8]=r[10],t}function n(t){var r=new Y.ARRAY_TYPE(9);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r}function o(t,r){return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t}function e(t,r,a,n,o,e,s,u,M){var p=new Y.ARRAY_TYPE(9);return p[0]=t,p[1]=r,p[2]=a,p[3]=n,p[4]=o,p[5]=e,p[6]=s,p[7]=u,p[8]=M,p}function s(t,r,a,n,o,e,s,u,M,p){return t[0]=r,t[1]=a,t[2]=n,t[3]=o,t[4]=e,t[5]=s,t[6]=u,t[7]=M,t[8]=p,t}function u(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function M(t,r){if(t===r){var a=r[1],n=r[2],o=r[5];t[1]=r[3],t[2]=r[6],t[3]=a,t[5]=r[7],t[6]=n,t[7]=o}else t[0]=r[0],t[1]=r[3],t[2]=r[6],t[3]=r[1],t[4]=r[4],t[5]=r[7],t[6]=r[2],t[7]=r[5],t[8]=r[8];return t}function p(t,r){var a=r[0],n=r[1],o=r[2],e=r[3],s=r[4],u=r[5],M=r[6],p=r[7],i=r[8],h=i*s-u*p,c=-i*e+u*M,f=p*e-s*M,x=a*h+n*c+o*f;return x?(x=1/x,t[0]=h*x,t[1]=(-i*n+o*p)*x,t[2]=(u*n-o*s)*x,t[3]=c*x,t[4]=(i*a-o*M)*x,t[5]=(-u*a+o*e)*x,t[6]=f*x,t[7]=(-p*a+n*M)*x,t[8]=(s*a-n*e)*x,t):null}function i(t,r){var a=r[0],n=r[1],o=r[2],e=r[3],s=r[4],u=r[5],M=r[6],p=r[7],i=r[8];return t[0]=s*i-u*p,t[1]=o*p-n*i,t[2]=n*u-o*s,t[3]=u*M-e*i,t[4]=a*i-o*M,t[5]=o*e-a*u,t[6]=e*p-s*M,t[7]=n*M-a*p,t[8]=a*s-n*e,t}function h(t){var r=t[0],a=t[1],n=t[2],o=t[3],e=t[4],s=t[5],u=t[6],M=t[7],p=t[8];return r*(p*e-s*M)+a*(-p*o+s*u)+n*(M*o-e*u)}function c(t,r,a){var n=r[0],o=r[1],e=r[2],s=r[3],u=r[4],M=r[5],p=r[6],i=r[7],h=r[8],c=a[0],f=a[1],x=a[2],b=a[3],l=a[4],m=a[5],v=a[6],d=a[7],P=a[8];return t[0]=c*n+f*s+x*p,t[1]=c*o+f*u+x*i,t[2]=c*e+f*M+x*h,t[3]=b*n+l*s+m*p,t[4]=b*o+l*u+m*i,t[5]=b*e+l*M+m*h,t[6]=v*n+d*s+P*p,t[7]=v*o+d*u+P*i,t[8]=v*e+d*M+P*h,t}function f(t,r,a){var n=r[0],o=r[1],e=r[2],s=r[3],u=r[4],M=r[5],p=r[6],i=r[7],h=r[8],c=a[0],f=a[1];return t[0]=n,t[1]=o,t[2]=e,t[3]=s,t[4]=u,t[5]=M,t[6]=c*n+f*s+p,t[7]=c*o+f*u+i,t[8]=c*e+f*M+h,t}function x(t,r,a){var n=r[0],o=r[1],e=r[2],s=r[3],u=r[4],M=r[5],p=r[6],i=r[7],h=r[8],c=Math.sin(a),f=Math.cos(a);return t[0]=f*n+c*s,t[1]=f*o+c*u,t[2]=f*e+c*M,t[3]=f*s-c*n,t[4]=f*u-c*o,t[5]=f*M-c*e,t[6]=p,t[7]=i,t[8]=h,t}function b(t,r,a){var n=a[0],o=a[1];return t[0]=n*r[0],t[1]=n*r[1],t[2]=n*r[2],t[3]=o*r[3],t[4]=o*r[4],t[5]=o*r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t}function l(t,r){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=r[0],t[7]=r[1],t[8]=1,t}function m(t,r){var a=Math.sin(r),n=Math.cos(r);return t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function v(t,r){return t[0]=r[0],t[1]=0,t[2]=0,t[3]=0,t[4]=r[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function d(t,r){return t[0]=r[0],t[1]=r[1],t[2]=0,t[3]=r[2],t[4]=r[3],t[5]=0,t[6]=r[4],t[7]=r[5],t[8]=1,t}function P(t,r){var a=r[0],n=r[1],o=r[2],e=r[3],s=a+a,u=n+n,M=o+o,p=a*s,i=n*s,h=n*u,c=o*s,f=o*u,x=o*M,b=e*s,l=e*u,m=e*M;return t[0]=1-h-x,t[3]=i-m,t[6]=c+l,t[1]=i+m,t[4]=1-p-x,t[7]=f-b,t[2]=c-l,t[5]=f+b,t[8]=1-p-h,t}function w(t,r){var a=r[0],n=r[1],o=r[2],e=r[3],s=r[4],u=r[5],M=r[6],p=r[7],i=r[8],h=r[9],c=r[10],f=r[11],x=r[12],b=r[13],l=r[14],m=r[15],v=a*u-n*s,d=a*M-o*s,P=a*p-e*s,w=n*M-o*u,E=n*p-e*u,O=o*p-e*M,S=i*b-h*x,I=i*l-c*x,L=i*m-f*x,N=h*l-c*b,y=h*m-f*b,A=c*m-f*l,R=v*A-d*y+P*N+w*L-E*I+O*S;return R?(R=1/R,t[0]=(u*A-M*y+p*N)*R,t[1]=(M*L-s*A-p*I)*R,t[2]=(s*y-u*L+p*S)*R,t[3]=(o*y-n*A-e*N)*R,t[4]=(a*A-o*L+e*I)*R,t[5]=(n*L-a*y-e*S)*R,t[6]=(b*O-l*E+m*w)*R,t[7]=(l*P-x*O-m*d)*R,t[8]=(x*E-b*P+m*v)*R,t):null}function E(t,r,a){return t[0]=2/r,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/a,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function O(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function S(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))}function I(t,r,a){return t[0]=r[0]+a[0],t[1]=r[1]+a[1],t[2]=r[2]+a[2],t[3]=r[3]+a[3],t[4]=r[4]+a[4],t[5]=r[5]+a[5],t[6]=r[6]+a[6],t[7]=r[7]+a[7],t[8]=r[8]+a[8],t}function L(t,r,a){return t[0]=r[0]-a[0],t[1]=r[1]-a[1],t[2]=r[2]-a[2],t[3]=r[3]-a[3],t[4]=r[4]-a[4],t[5]=r[5]-a[5],t[6]=r[6]-a[6],t[7]=r[7]-a[7],t[8]=r[8]-a[8],t}function N(t,r,a){return t[0]=r[0]*a,t[1]=r[1]*a,t[2]=r[2]*a,t[3]=r[3]*a,t[4]=r[4]*a,t[5]=r[5]*a,t[6]=r[6]*a,t[7]=r[7]*a,t[8]=r[8]*a,t}function y(t,r,a,n){return t[0]=r[0]+a[0]*n,t[1]=r[1]+a[1]*n,t[2]=r[2]+a[2]*n,t[3]=r[3]+a[3]*n,t[4]=r[4]+a[4]*n,t[5]=r[5]+a[5]*n,t[6]=r[6]+a[6]*n,t[7]=r[7]+a[7]*n,t[8]=r[8]+a[8]*n,t}function A(t,r){return t[0]===r[0]&&t[1]===r[1]&&t[2]===r[2]&&t[3]===r[3]&&t[4]===r[4]&&t[5]===r[5]&&t[6]===r[6]&&t[7]===r[7]&&t[8]===r[8]}function R(t,r){var a=t[0],n=t[1],o=t[2],e=t[3],s=t[4],u=t[5],M=t[6],p=t[7],i=t[8],h=r[0],c=r[1],f=r[2],x=r[3],b=r[4],l=r[5],m=r[6],v=r[7],d=r[8];return Math.abs(a-h)<=Y.EPSILON*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(n-c)<=Y.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(o-f)<=Y.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(e-x)<=Y.EPSILON*Math.max(1,Math.abs(e),Math.abs(x))&&Math.abs(s-b)<=Y.EPSILON*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(u-l)<=Y.EPSILON*Math.max(1,Math.abs(u),Math.abs(l))&&Math.abs(M-m)<=Y.EPSILON*Math.max(1,Math.abs(M),Math.abs(m))&&Math.abs(p-v)<=Y.EPSILON*Math.max(1,Math.abs(p),Math.abs(v))&&Math.abs(i-d)<=Y.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.sub=exports.mul=void 0,exports.create=r,exports.fromMat4=a,exports.clone=n,exports.copy=o,exports.fromValues=e,exports.set=s,exports.identity=u,exports.transpose=M,exports.invert=p,exports.adjoint=i,exports.determinant=h,exports.multiply=c,exports.translate=f,exports.rotate=x,exports.scale=b,exports.fromTranslation=l,exports.fromRotation=m,exports.fromScaling=v,exports.fromMat2d=d,exports.fromQuat=P,exports.normalFromMat4=w,exports.projection=E,exports.str=O,exports.frob=S,exports.add=I,exports.subtract=L,exports.multiplyScalar=N,exports.multiplyScalarAndAdd=y,exports.exactEquals=A,exports.equals=R;var _=require("./common"),Y=t(_),j=exports.mul=c,q=exports.sub=L;
  },{"./common":35}],37:[function(require,module,exports) {
  "use strict";function t(t){if(t&&t.__esModule)return t;var a={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(a[r]=t[r]);return a.default=t,a}function a(){var t=new C.ARRAY_TYPE(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function r(t){var a=new C.ARRAY_TYPE(16);return a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3],a[4]=t[4],a[5]=t[5],a[6]=t[6],a[7]=t[7],a[8]=t[8],a[9]=t[9],a[10]=t[10],a[11]=t[11],a[12]=t[12],a[13]=t[13],a[14]=t[14],a[15]=t[15],a}function o(t,a){return t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],t[4]=a[4],t[5]=a[5],t[6]=a[6],t[7]=a[7],t[8]=a[8],t[9]=a[9],t[10]=a[10],t[11]=a[11],t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15],t}function n(t,a,r,o,n,e,s,i,h,M,u,v,p,c,f,x){var d=new C.ARRAY_TYPE(16);return d[0]=t,d[1]=a,d[2]=r,d[3]=o,d[4]=n,d[5]=e,d[6]=s,d[7]=i,d[8]=h,d[9]=M,d[10]=u,d[11]=v,d[12]=p,d[13]=c,d[14]=f,d[15]=x,d}function e(t,a,r,o,n,e,s,i,h,M,u,v,p,c,f,x,d){return t[0]=a,t[1]=r,t[2]=o,t[3]=n,t[4]=e,t[5]=s,t[6]=i,t[7]=h,t[8]=M,t[9]=u,t[10]=v,t[11]=p,t[12]=c,t[13]=f,t[14]=x,t[15]=d,t}function s(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function i(t,a){if(t===a){var r=a[1],o=a[2],n=a[3],e=a[6],s=a[7],i=a[11];t[1]=a[4],t[2]=a[8],t[3]=a[12],t[4]=r,t[6]=a[9],t[7]=a[13],t[8]=o,t[9]=e,t[11]=a[14],t[12]=n,t[13]=s,t[14]=i}else t[0]=a[0],t[1]=a[4],t[2]=a[8],t[3]=a[12],t[4]=a[1],t[5]=a[5],t[6]=a[9],t[7]=a[13],t[8]=a[2],t[9]=a[6],t[10]=a[10],t[11]=a[14],t[12]=a[3],t[13]=a[7],t[14]=a[11],t[15]=a[15];return t}function h(t,a){var r=a[0],o=a[1],n=a[2],e=a[3],s=a[4],i=a[5],h=a[6],M=a[7],u=a[8],v=a[9],p=a[10],c=a[11],f=a[12],x=a[13],d=a[14],b=a[15],l=r*i-o*s,m=r*h-n*s,P=r*M-e*s,S=o*h-n*i,O=o*M-e*i,E=n*M-e*h,I=u*x-v*f,w=u*d-p*f,L=u*b-c*f,N=v*d-p*x,q=v*b-c*x,R=p*b-c*d,g=l*R-m*q+P*N+S*L-O*w+E*I;return g?(g=1/g,t[0]=(i*R-h*q+M*N)*g,t[1]=(n*q-o*R-e*N)*g,t[2]=(x*E-d*O+b*S)*g,t[3]=(p*O-v*E-c*S)*g,t[4]=(h*L-s*R-M*w)*g,t[5]=(r*R-n*L+e*w)*g,t[6]=(d*P-f*E-b*m)*g,t[7]=(u*E-p*P+c*m)*g,t[8]=(s*q-i*L+M*I)*g,t[9]=(o*L-r*q-e*I)*g,t[10]=(f*O-x*P+b*l)*g,t[11]=(v*P-u*O-c*l)*g,t[12]=(i*w-s*N-h*I)*g,t[13]=(r*N-o*w+n*I)*g,t[14]=(x*m-f*S-d*l)*g,t[15]=(u*S-v*m+p*l)*g,t):null}function M(t,a){var r=a[0],o=a[1],n=a[2],e=a[3],s=a[4],i=a[5],h=a[6],M=a[7],u=a[8],v=a[9],p=a[10],c=a[11],f=a[12],x=a[13],d=a[14],b=a[15];return t[0]=i*(p*b-c*d)-v*(h*b-M*d)+x*(h*c-M*p),t[1]=-(o*(p*b-c*d)-v*(n*b-e*d)+x*(n*c-e*p)),t[2]=o*(h*b-M*d)-i*(n*b-e*d)+x*(n*M-e*h),t[3]=-(o*(h*c-M*p)-i*(n*c-e*p)+v*(n*M-e*h)),t[4]=-(s*(p*b-c*d)-u*(h*b-M*d)+f*(h*c-M*p)),t[5]=r*(p*b-c*d)-u*(n*b-e*d)+f*(n*c-e*p),t[6]=-(r*(h*b-M*d)-s*(n*b-e*d)+f*(n*M-e*h)),t[7]=r*(h*c-M*p)-s*(n*c-e*p)+u*(n*M-e*h),t[8]=s*(v*b-c*x)-u*(i*b-M*x)+f*(i*c-M*v),t[9]=-(r*(v*b-c*x)-u*(o*b-e*x)+f*(o*c-e*v)),t[10]=r*(i*b-M*x)-s*(o*b-e*x)+f*(o*M-e*i),t[11]=-(r*(i*c-M*v)-s*(o*c-e*v)+u*(o*M-e*i)),t[12]=-(s*(v*d-p*x)-u*(i*d-h*x)+f*(i*p-h*v)),t[13]=r*(v*d-p*x)-u*(o*d-n*x)+f*(o*p-n*v),t[14]=-(r*(i*d-h*x)-s*(o*d-n*x)+f*(o*h-n*i)),t[15]=r*(i*p-h*v)-s*(o*p-n*v)+u*(o*h-n*i),t}function u(t){var a=t[0],r=t[1],o=t[2],n=t[3],e=t[4],s=t[5],i=t[6],h=t[7],M=t[8],u=t[9],v=t[10],p=t[11],c=t[12],f=t[13],x=t[14],d=t[15];return(a*s-r*e)*(v*d-p*x)-(a*i-o*e)*(u*d-p*f)+(a*h-n*e)*(u*x-v*f)+(r*i-o*s)*(M*d-p*c)-(r*h-n*s)*(M*x-v*c)+(o*h-n*i)*(M*f-u*c)}function v(t,a,r){var o=a[0],n=a[1],e=a[2],s=a[3],i=a[4],h=a[5],M=a[6],u=a[7],v=a[8],p=a[9],c=a[10],f=a[11],x=a[12],d=a[13],b=a[14],l=a[15],m=r[0],P=r[1],S=r[2],O=r[3];return t[0]=m*o+P*i+S*v+O*x,t[1]=m*n+P*h+S*p+O*d,t[2]=m*e+P*M+S*c+O*b,t[3]=m*s+P*u+S*f+O*l,m=r[4],P=r[5],S=r[6],O=r[7],t[4]=m*o+P*i+S*v+O*x,t[5]=m*n+P*h+S*p+O*d,t[6]=m*e+P*M+S*c+O*b,t[7]=m*s+P*u+S*f+O*l,m=r[8],P=r[9],S=r[10],O=r[11],t[8]=m*o+P*i+S*v+O*x,t[9]=m*n+P*h+S*p+O*d,t[10]=m*e+P*M+S*c+O*b,t[11]=m*s+P*u+S*f+O*l,m=r[12],P=r[13],S=r[14],O=r[15],t[12]=m*o+P*i+S*v+O*x,t[13]=m*n+P*h+S*p+O*d,t[14]=m*e+P*M+S*c+O*b,t[15]=m*s+P*u+S*f+O*l,t}function p(t,a,r){var o=r[0],n=r[1],e=r[2],s=void 0,i=void 0,h=void 0,M=void 0,u=void 0,v=void 0,p=void 0,c=void 0,f=void 0,x=void 0,d=void 0,b=void 0;return a===t?(t[12]=a[0]*o+a[4]*n+a[8]*e+a[12],t[13]=a[1]*o+a[5]*n+a[9]*e+a[13],t[14]=a[2]*o+a[6]*n+a[10]*e+a[14],t[15]=a[3]*o+a[7]*n+a[11]*e+a[15]):(s=a[0],i=a[1],h=a[2],M=a[3],u=a[4],v=a[5],p=a[6],c=a[7],f=a[8],x=a[9],d=a[10],b=a[11],t[0]=s,t[1]=i,t[2]=h,t[3]=M,t[4]=u,t[5]=v,t[6]=p,t[7]=c,t[8]=f,t[9]=x,t[10]=d,t[11]=b,t[12]=s*o+u*n+f*e+a[12],t[13]=i*o+v*n+x*e+a[13],t[14]=h*o+p*n+d*e+a[14],t[15]=M*o+c*n+b*e+a[15]),t}function c(t,a,r){var o=r[0],n=r[1],e=r[2];return t[0]=a[0]*o,t[1]=a[1]*o,t[2]=a[2]*o,t[3]=a[3]*o,t[4]=a[4]*n,t[5]=a[5]*n,t[6]=a[6]*n,t[7]=a[7]*n,t[8]=a[8]*e,t[9]=a[9]*e,t[10]=a[10]*e,t[11]=a[11]*e,t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15],t}function f(t,a,r,o){var n=o[0],e=o[1],s=o[2],i=Math.sqrt(n*n+e*e+s*s),h=void 0,M=void 0,u=void 0,v=void 0,p=void 0,c=void 0,f=void 0,x=void 0,d=void 0,b=void 0,l=void 0,m=void 0,P=void 0,S=void 0,O=void 0,E=void 0,I=void 0,w=void 0,L=void 0,N=void 0,q=void 0,R=void 0,g=void 0,y=void 0;return Math.abs(i)<C.EPSILON?null:(i=1/i,n*=i,e*=i,s*=i,h=Math.sin(r),M=Math.cos(r),u=1-M,v=a[0],p=a[1],c=a[2],f=a[3],x=a[4],d=a[5],b=a[6],l=a[7],m=a[8],P=a[9],S=a[10],O=a[11],E=n*n*u+M,I=e*n*u+s*h,w=s*n*u-e*h,L=n*e*u-s*h,N=e*e*u+M,q=s*e*u+n*h,R=n*s*u+e*h,g=e*s*u-n*h,y=s*s*u+M,t[0]=v*E+x*I+m*w,t[1]=p*E+d*I+P*w,t[2]=c*E+b*I+S*w,t[3]=f*E+l*I+O*w,t[4]=v*L+x*N+m*q,t[5]=p*L+d*N+P*q,t[6]=c*L+b*N+S*q,t[7]=f*L+l*N+O*q,t[8]=v*R+x*g+m*y,t[9]=p*R+d*g+P*y,t[10]=c*R+b*g+S*y,t[11]=f*R+l*g+O*y,a!==t&&(t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15]),t)}function x(t,a,r){var o=Math.sin(r),n=Math.cos(r),e=a[4],s=a[5],i=a[6],h=a[7],M=a[8],u=a[9],v=a[10],p=a[11];return a!==t&&(t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15]),t[4]=e*n+M*o,t[5]=s*n+u*o,t[6]=i*n+v*o,t[7]=h*n+p*o,t[8]=M*n-e*o,t[9]=u*n-s*o,t[10]=v*n-i*o,t[11]=p*n-h*o,t}function d(t,a,r){var o=Math.sin(r),n=Math.cos(r),e=a[0],s=a[1],i=a[2],h=a[3],M=a[8],u=a[9],v=a[10],p=a[11];return a!==t&&(t[4]=a[4],t[5]=a[5],t[6]=a[6],t[7]=a[7],t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15]),t[0]=e*n-M*o,t[1]=s*n-u*o,t[2]=i*n-v*o,t[3]=h*n-p*o,t[8]=e*o+M*n,t[9]=s*o+u*n,t[10]=i*o+v*n,t[11]=h*o+p*n,t}function b(t,a,r){var o=Math.sin(r),n=Math.cos(r),e=a[0],s=a[1],i=a[2],h=a[3],M=a[4],u=a[5],v=a[6],p=a[7];return a!==t&&(t[8]=a[8],t[9]=a[9],t[10]=a[10],t[11]=a[11],t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15]),t[0]=e*n+M*o,t[1]=s*n+u*o,t[2]=i*n+v*o,t[3]=h*n+p*o,t[4]=M*n-e*o,t[5]=u*n-s*o,t[6]=v*n-i*o,t[7]=p*n-h*o,t}function l(t,a){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=a[0],t[13]=a[1],t[14]=a[2],t[15]=1,t}function m(t,a){return t[0]=a[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=a[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function P(t,a,r){var o=r[0],n=r[1],e=r[2],s=Math.sqrt(o*o+n*n+e*e),i=void 0,h=void 0,M=void 0;return Math.abs(s)<C.EPSILON?null:(s=1/s,o*=s,n*=s,e*=s,i=Math.sin(a),h=Math.cos(a),M=1-h,t[0]=o*o*M+h,t[1]=n*o*M+e*i,t[2]=e*o*M-n*i,t[3]=0,t[4]=o*n*M-e*i,t[5]=n*n*M+h,t[6]=e*n*M+o*i,t[7]=0,t[8]=o*e*M+n*i,t[9]=n*e*M-o*i,t[10]=e*e*M+h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function S(t,a){var r=Math.sin(a),o=Math.cos(a);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function O(t,a){var r=Math.sin(a),o=Math.cos(a);return t[0]=o,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function E(t,a){var r=Math.sin(a),o=Math.cos(a);return t[0]=o,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function I(t,a,r){var o=a[0],n=a[1],e=a[2],s=a[3],i=o+o,h=n+n,M=e+e,u=o*i,v=o*h,p=o*M,c=n*h,f=n*M,x=e*M,d=s*i,b=s*h,l=s*M;return t[0]=1-(c+x),t[1]=v+l,t[2]=p-b,t[3]=0,t[4]=v-l,t[5]=1-(u+x),t[6]=f+d,t[7]=0,t[8]=p+b,t[9]=f-d,t[10]=1-(u+c),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function w(t,a){return t[0]=a[12],t[1]=a[13],t[2]=a[14],t}function L(t,a){var r=a[0],o=a[1],n=a[2],e=a[4],s=a[5],i=a[6],h=a[8],M=a[9],u=a[10];return t[0]=Math.sqrt(r*r+o*o+n*n),t[1]=Math.sqrt(e*e+s*s+i*i),t[2]=Math.sqrt(h*h+M*M+u*u),t}function N(t,a){var r=a[0]+a[5]+a[10],o=0;return r>0?(o=2*Math.sqrt(r+1),t[3]=.25*o,t[0]=(a[6]-a[9])/o,t[1]=(a[8]-a[2])/o,t[2]=(a[1]-a[4])/o):a[0]>a[5]&a[0]>a[10]?(o=2*Math.sqrt(1+a[0]-a[5]-a[10]),t[3]=(a[6]-a[9])/o,t[0]=.25*o,t[1]=(a[1]+a[4])/o,t[2]=(a[8]+a[2])/o):a[5]>a[10]?(o=2*Math.sqrt(1+a[5]-a[0]-a[10]),t[3]=(a[8]-a[2])/o,t[0]=(a[1]+a[4])/o,t[1]=.25*o,t[2]=(a[6]+a[9])/o):(o=2*Math.sqrt(1+a[10]-a[0]-a[5]),t[3]=(a[1]-a[4])/o,t[0]=(a[8]+a[2])/o,t[1]=(a[6]+a[9])/o,t[2]=.25*o),t}function q(t,a,r,o){var n=a[0],e=a[1],s=a[2],i=a[3],h=n+n,M=e+e,u=s+s,v=n*h,p=n*M,c=n*u,f=e*M,x=e*u,d=s*u,b=i*h,l=i*M,m=i*u,P=o[0],S=o[1],O=o[2];return t[0]=(1-(f+d))*P,t[1]=(p+m)*P,t[2]=(c-l)*P,t[3]=0,t[4]=(p-m)*S,t[5]=(1-(v+d))*S,t[6]=(x+b)*S,t[7]=0,t[8]=(c+l)*O,t[9]=(x-b)*O,t[10]=(1-(v+f))*O,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function R(t,a,r,o,n){var e=a[0],s=a[1],i=a[2],h=a[3],M=e+e,u=s+s,v=i+i,p=e*M,c=e*u,f=e*v,x=s*u,d=s*v,b=i*v,l=h*M,m=h*u,P=h*v,S=o[0],O=o[1],E=o[2],I=n[0],w=n[1],L=n[2];return t[0]=(1-(x+b))*S,t[1]=(c+P)*S,t[2]=(f-m)*S,t[3]=0,t[4]=(c-P)*O,t[5]=(1-(p+b))*O,t[6]=(d+l)*O,t[7]=0,t[8]=(f+m)*E,t[9]=(d-l)*E,t[10]=(1-(p+x))*E,t[11]=0,t[12]=r[0]+I-(t[0]*I+t[4]*w+t[8]*L),t[13]=r[1]+w-(t[1]*I+t[5]*w+t[9]*L),t[14]=r[2]+L-(t[2]*I+t[6]*w+t[10]*L),t[15]=1,t}function g(t,a){var r=a[0],o=a[1],n=a[2],e=a[3],s=r+r,i=o+o,h=n+n,M=r*s,u=o*s,v=o*i,p=n*s,c=n*i,f=n*h,x=e*s,d=e*i,b=e*h;return t[0]=1-v-f,t[1]=u+b,t[2]=p-d,t[3]=0,t[4]=u-b,t[5]=1-M-f,t[6]=c+x,t[7]=0,t[8]=p+d,t[9]=c-x,t[10]=1-M-v,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function y(t,a,r,o,n,e,s){var i=1/(r-a),h=1/(n-o),M=1/(e-s);return t[0]=2*e*i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*e*h,t[6]=0,t[7]=0,t[8]=(r+a)*i,t[9]=(n+o)*h,t[10]=(s+e)*M,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*e*2*M,t[15]=0,t}function A(t,a,r,o,n){var e=1/Math.tan(a/2),s=1/(o-n);return t[0]=e/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(n+o)*s,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*n*o*s,t[15]=0,t}function T(t,a,r,o){var n=Math.tan(a.upDegrees*Math.PI/180),e=Math.tan(a.downDegrees*Math.PI/180),s=Math.tan(a.leftDegrees*Math.PI/180),i=Math.tan(a.rightDegrees*Math.PI/180),h=2/(s+i),M=2/(n+e);return t[0]=h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=M,t[6]=0,t[7]=0,t[8]=-(s-i)*h*.5,t[9]=(n-e)*M*.5,t[10]=o/(r-o),t[11]=-1,t[12]=0,t[13]=0,t[14]=o*r/(r-o),t[15]=0,t}function Y(t,a,r,o,n,e,s){var i=1/(a-r),h=1/(o-n),M=1/(e-s);return t[0]=-2*i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*M,t[11]=0,t[12]=(a+r)*i,t[13]=(n+o)*h,t[14]=(s+e)*M,t[15]=1,t}function _(t,a,r,o){var n=void 0,e=void 0,s=void 0,i=void 0,h=void 0,M=void 0,u=void 0,v=void 0,p=void 0,c=void 0,f=a[0],x=a[1],d=a[2],b=o[0],l=o[1],m=o[2],P=r[0],S=r[1],O=r[2];return Math.abs(f-P)<C.EPSILON&&Math.abs(x-S)<C.EPSILON&&Math.abs(d-O)<C.EPSILON?mat4.identity(t):(u=f-P,v=x-S,p=d-O,c=1/Math.sqrt(u*u+v*v+p*p),u*=c,v*=c,p*=c,n=l*p-m*v,e=m*u-b*p,s=b*v-l*u,(c=Math.sqrt(n*n+e*e+s*s))?(n*=c=1/c,e*=c,s*=c):(n=0,e=0,s=0),i=v*s-p*e,h=p*n-u*s,M=u*e-v*n,(c=Math.sqrt(i*i+h*h+M*M))?(i*=c=1/c,h*=c,M*=c):(i=0,h=0,M=0),t[0]=n,t[1]=i,t[2]=u,t[3]=0,t[4]=e,t[5]=h,t[6]=v,t[7]=0,t[8]=s,t[9]=M,t[10]=p,t[11]=0,t[12]=-(n*f+e*x+s*d),t[13]=-(i*f+h*x+M*d),t[14]=-(u*f+v*x+p*d),t[15]=1,t)}function D(t,a,r,o){var n=a[0],e=a[1],s=a[2],i=o[0],h=o[1],M=o[2],u=n-r[0],v=e-r[1],p=s-r[2],c=u*u+v*v+p*p;c>0&&(u*=c=1/Math.sqrt(c),v*=c,p*=c);var f=h*p-M*v,x=M*u-i*p,d=i*v-h*u;return t[0]=f,t[1]=x,t[2]=d,t[3]=0,t[4]=v*d-p*x,t[5]=p*f-u*d,t[6]=u*x-v*f,t[7]=0,t[8]=u,t[9]=v,t[10]=p,t[11]=0,t[12]=n,t[13]=e,t[14]=s,t[15]=1,t}function j(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function F(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))}function V(t,a,r){return t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t[3]=a[3]+r[3],t[4]=a[4]+r[4],t[5]=a[5]+r[5],t[6]=a[6]+r[6],t[7]=a[7]+r[7],t[8]=a[8]+r[8],t[9]=a[9]+r[9],t[10]=a[10]+r[10],t[11]=a[11]+r[11],t[12]=a[12]+r[12],t[13]=a[13]+r[13],t[14]=a[14]+r[14],t[15]=a[15]+r[15],t}function X(t,a,r){return t[0]=a[0]-r[0],t[1]=a[1]-r[1],t[2]=a[2]-r[2],t[3]=a[3]-r[3],t[4]=a[4]-r[4],t[5]=a[5]-r[5],t[6]=a[6]-r[6],t[7]=a[7]-r[7],t[8]=a[8]-r[8],t[9]=a[9]-r[9],t[10]=a[10]-r[10],t[11]=a[11]-r[11],t[12]=a[12]-r[12],t[13]=a[13]-r[13],t[14]=a[14]-r[14],t[15]=a[15]-r[15],t}function Z(t,a,r){return t[0]=a[0]*r,t[1]=a[1]*r,t[2]=a[2]*r,t[3]=a[3]*r,t[4]=a[4]*r,t[5]=a[5]*r,t[6]=a[6]*r,t[7]=a[7]*r,t[8]=a[8]*r,t[9]=a[9]*r,t[10]=a[10]*r,t[11]=a[11]*r,t[12]=a[12]*r,t[13]=a[13]*r,t[14]=a[14]*r,t[15]=a[15]*r,t}function k(t,a,r,o){return t[0]=a[0]+r[0]*o,t[1]=a[1]+r[1]*o,t[2]=a[2]+r[2]*o,t[3]=a[3]+r[3]*o,t[4]=a[4]+r[4]*o,t[5]=a[5]+r[5]*o,t[6]=a[6]+r[6]*o,t[7]=a[7]+r[7]*o,t[8]=a[8]+r[8]*o,t[9]=a[9]+r[9]*o,t[10]=a[10]+r[10]*o,t[11]=a[11]+r[11]*o,t[12]=a[12]+r[12]*o,t[13]=a[13]+r[13]*o,t[14]=a[14]+r[14]*o,t[15]=a[15]+r[15]*o,t}function Q(t,a){return t[0]===a[0]&&t[1]===a[1]&&t[2]===a[2]&&t[3]===a[3]&&t[4]===a[4]&&t[5]===a[5]&&t[6]===a[6]&&t[7]===a[7]&&t[8]===a[8]&&t[9]===a[9]&&t[10]===a[10]&&t[11]===a[11]&&t[12]===a[12]&&t[13]===a[13]&&t[14]===a[14]&&t[15]===a[15]}function z(t,a){var r=t[0],o=t[1],n=t[2],e=t[3],s=t[4],i=t[5],h=t[6],M=t[7],u=t[8],v=t[9],p=t[10],c=t[11],f=t[12],x=t[13],d=t[14],b=t[15],l=a[0],m=a[1],P=a[2],S=a[3],O=a[4],E=a[5],I=a[6],w=a[7],L=a[8],N=a[9],q=a[10],R=a[11],g=a[12],y=a[13],A=a[14],T=a[15];return Math.abs(r-l)<=C.EPSILON*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(o-m)<=C.EPSILON*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(n-P)<=C.EPSILON*Math.max(1,Math.abs(n),Math.abs(P))&&Math.abs(e-S)<=C.EPSILON*Math.max(1,Math.abs(e),Math.abs(S))&&Math.abs(s-O)<=C.EPSILON*Math.max(1,Math.abs(s),Math.abs(O))&&Math.abs(i-E)<=C.EPSILON*Math.max(1,Math.abs(i),Math.abs(E))&&Math.abs(h-I)<=C.EPSILON*Math.max(1,Math.abs(h),Math.abs(I))&&Math.abs(M-w)<=C.EPSILON*Math.max(1,Math.abs(M),Math.abs(w))&&Math.abs(u-L)<=C.EPSILON*Math.max(1,Math.abs(u),Math.abs(L))&&Math.abs(v-N)<=C.EPSILON*Math.max(1,Math.abs(v),Math.abs(N))&&Math.abs(p-q)<=C.EPSILON*Math.max(1,Math.abs(p),Math.abs(q))&&Math.abs(c-R)<=C.EPSILON*Math.max(1,Math.abs(c),Math.abs(R))&&Math.abs(f-g)<=C.EPSILON*Math.max(1,Math.abs(f),Math.abs(g))&&Math.abs(x-y)<=C.EPSILON*Math.max(1,Math.abs(x),Math.abs(y))&&Math.abs(d-A)<=C.EPSILON*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(b-T)<=C.EPSILON*Math.max(1,Math.abs(b),Math.abs(T))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.sub=exports.mul=void 0,exports.create=a,exports.clone=r,exports.copy=o,exports.fromValues=n,exports.set=e,exports.identity=s,exports.transpose=i,exports.invert=h,exports.adjoint=M,exports.determinant=u,exports.multiply=v,exports.translate=p,exports.scale=c,exports.rotate=f,exports.rotateX=x,exports.rotateY=d,exports.rotateZ=b,exports.fromTranslation=l,exports.fromScaling=m,exports.fromRotation=P,exports.fromXRotation=S,exports.fromYRotation=O,exports.fromZRotation=E,exports.fromRotationTranslation=I,exports.getTranslation=w,exports.getScaling=L,exports.getRotation=N,exports.fromRotationTranslationScale=q,exports.fromRotationTranslationScaleOrigin=R,exports.fromQuat=g,exports.frustum=y,exports.perspective=A,exports.perspectiveFromFieldOfView=T,exports.ortho=Y,exports.lookAt=_,exports.targetTo=D,exports.str=j,exports.frob=F,exports.add=V,exports.subtract=X,exports.multiplyScalar=Z,exports.multiplyScalarAndAdd=k,exports.exactEquals=Q,exports.equals=z;var B=require("./common"),C=t(B),G=exports.mul=v,H=exports.sub=X;
  },{"./common":35}],42:[function(require,module,exports) {
  "use strict";function t(t){if(t&&t.__esModule)return t;var r={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r.default=t,r}function r(){var t=new X.ARRAY_TYPE(3);return t[0]=0,t[1]=0,t[2]=0,t}function n(t){var r=new X.ARRAY_TYPE(3);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r}function e(t){var r=t[0],n=t[1],e=t[2];return Math.sqrt(r*r+n*n+e*e)}function o(t,r,n){var e=new X.ARRAY_TYPE(3);return e[0]=t,e[1]=r,e[2]=n,e}function a(t,r){return t[0]=r[0],t[1]=r[1],t[2]=r[2],t}function s(t,r,n,e){return t[0]=r,t[1]=n,t[2]=e,t}function u(t,r,n){return t[0]=r[0]+n[0],t[1]=r[1]+n[1],t[2]=r[2]+n[2],t}function i(t,r,n){return t[0]=r[0]-n[0],t[1]=r[1]-n[1],t[2]=r[2]-n[2],t}function c(t,r,n){return t[0]=r[0]*n[0],t[1]=r[1]*n[1],t[2]=r[2]*n[2],t}function x(t,r,n){return t[0]=r[0]/n[0],t[1]=r[1]/n[1],t[2]=r[2]/n[2],t}function p(t,r){return t[0]=Math.ceil(r[0]),t[1]=Math.ceil(r[1]),t[2]=Math.ceil(r[2]),t}function f(t,r){return t[0]=Math.floor(r[0]),t[1]=Math.floor(r[1]),t[2]=Math.floor(r[2]),t}function h(t,r,n){return t[0]=Math.min(r[0],n[0]),t[1]=Math.min(r[1],n[1]),t[2]=Math.min(r[2],n[2]),t}function M(t,r,n){return t[0]=Math.max(r[0],n[0]),t[1]=Math.max(r[1],n[1]),t[2]=Math.max(r[2],n[2]),t}function v(t,r){return t[0]=Math.round(r[0]),t[1]=Math.round(r[1]),t[2]=Math.round(r[2]),t}function l(t,r,n){return t[0]=r[0]*n,t[1]=r[1]*n,t[2]=r[2]*n,t}function d(t,r,n,e){return t[0]=r[0]+n[0]*e,t[1]=r[1]+n[1]*e,t[2]=r[2]+n[2]*e,t}function m(t,r){var n=r[0]-t[0],e=r[1]-t[1],o=r[2]-t[2];return Math.sqrt(n*n+e*e+o*o)}function b(t,r){var n=r[0]-t[0],e=r[1]-t[1],o=r[2]-t[2];return n*n+e*e+o*o}function q(t){var r=t[0],n=t[1],e=t[2];return r*r+n*n+e*e}function A(t,r){return t[0]=-r[0],t[1]=-r[1],t[2]=-r[2],t}function P(t,r){return t[0]=1/r[0],t[1]=1/r[1],t[2]=1/r[2],t}function E(t,r){var n=r[0],e=r[1],o=r[2],a=n*n+e*e+o*o;return a>0&&(a=1/Math.sqrt(a),t[0]=r[0]*a,t[1]=r[1]*a,t[2]=r[2]*a),t}function O(t,r){return t[0]*r[0]+t[1]*r[1]+t[2]*r[2]}function R(t,r,n){var e=r[0],o=r[1],a=r[2],s=n[0],u=n[1],i=n[2];return t[0]=o*i-a*u,t[1]=a*s-e*i,t[2]=e*u-o*s,t}function Y(t,r,n,e){var o=r[0],a=r[1],s=r[2];return t[0]=o+e*(n[0]-o),t[1]=a+e*(n[1]-a),t[2]=s+e*(n[2]-s),t}function _(t,r,n,e,o,a){var s=a*a,u=s*(2*a-3)+1,i=s*(a-2)+a,c=s*(a-1),x=s*(3-2*a);return t[0]=r[0]*u+n[0]*i+e[0]*c+o[0]*x,t[1]=r[1]*u+n[1]*i+e[1]*c+o[1]*x,t[2]=r[2]*u+n[2]*i+e[2]*c+o[2]*x,t}function g(t,r,n,e,o,a){var s=1-a,u=s*s,i=a*a,c=u*s,x=3*a*u,p=3*i*s,f=i*a;return t[0]=r[0]*c+n[0]*x+e[0]*p+o[0]*f,t[1]=r[1]*c+n[1]*x+e[1]*p+o[1]*f,t[2]=r[2]*c+n[2]*x+e[2]*p+o[2]*f,t}function L(t,r){r=r||1;var n=2*X.RANDOM()*Math.PI,e=2*X.RANDOM()-1,o=Math.sqrt(1-e*e)*r;return t[0]=Math.cos(n)*o,t[1]=Math.sin(n)*o,t[2]=e*r,t}function y(t,r,n){var e=r[0],o=r[1],a=r[2],s=n[3]*e+n[7]*o+n[11]*a+n[15];return s=s||1,t[0]=(n[0]*e+n[4]*o+n[8]*a+n[12])/s,t[1]=(n[1]*e+n[5]*o+n[9]*a+n[13])/s,t[2]=(n[2]*e+n[6]*o+n[10]*a+n[14])/s,t}function D(t,r,n){var e=r[0],o=r[1],a=r[2];return t[0]=e*n[0]+o*n[3]+a*n[6],t[1]=e*n[1]+o*n[4]+a*n[7],t[2]=e*n[2]+o*n[5]+a*n[8],t}function I(t,r,n){var e=r[0],o=r[1],a=r[2],s=n[0],u=n[1],i=n[2],c=n[3],x=c*e+u*a-i*o,p=c*o+i*e-s*a,f=c*a+s*o-u*e,h=-s*e-u*o-i*a;return t[0]=x*c+h*-s+p*-i-f*-u,t[1]=p*c+h*-u+f*-s-x*-i,t[2]=f*c+h*-i+x*-u-p*-s,t}function N(t,r,n,e){var o=[],a=[];return o[0]=r[0]-n[0],o[1]=r[1]-n[1],o[2]=r[2]-n[2],a[0]=o[0],a[1]=o[1]*Math.cos(e)-o[2]*Math.sin(e),a[2]=o[1]*Math.sin(e)+o[2]*Math.cos(e),t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t}function w(t,r,n,e){var o=[],a=[];return o[0]=r[0]-n[0],o[1]=r[1]-n[1],o[2]=r[2]-n[2],a[0]=o[2]*Math.sin(e)+o[0]*Math.cos(e),a[1]=o[1],a[2]=o[2]*Math.cos(e)-o[0]*Math.sin(e),t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t}function S(t,r,n,e){var o=[],a=[];return o[0]=r[0]-n[0],o[1]=r[1]-n[1],o[2]=r[2]-n[2],a[0]=o[0]*Math.cos(e)-o[1]*Math.sin(e),a[1]=o[0]*Math.sin(e)+o[1]*Math.cos(e),a[2]=o[2],t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t}function T(t,r){var n=o(t[0],t[1],t[2]),e=o(r[0],r[1],r[2]);E(n,n),E(e,e);var a=O(n,e);return a>1?0:a<-1?Math.PI:Math.acos(a)}function j(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function z(t,r){return t[0]===r[0]&&t[1]===r[1]&&t[2]===r[2]}function Q(t,r){var n=t[0],e=t[1],o=t[2],a=r[0],s=r[1],u=r[2];return Math.abs(n-a)<=X.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(e-s)<=X.EPSILON*Math.max(1,Math.abs(e),Math.abs(s))&&Math.abs(o-u)<=X.EPSILON*Math.max(1,Math.abs(o),Math.abs(u))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.forEach=exports.sqrLen=exports.len=exports.sqrDist=exports.dist=exports.div=exports.mul=exports.sub=void 0,exports.create=r,exports.clone=n,exports.length=e,exports.fromValues=o,exports.copy=a,exports.set=s,exports.add=u,exports.subtract=i,exports.multiply=c,exports.divide=x,exports.ceil=p,exports.floor=f,exports.min=h,exports.max=M,exports.round=v,exports.scale=l,exports.scaleAndAdd=d,exports.distance=m,exports.squaredDistance=b,exports.squaredLength=q,exports.negate=A,exports.inverse=P,exports.normalize=E,exports.dot=O,exports.cross=R,exports.lerp=Y,exports.hermite=_,exports.bezier=g,exports.random=L,exports.transformMat4=y,exports.transformMat3=D,exports.transformQuat=I,exports.rotateX=N,exports.rotateY=w,exports.rotateZ=S,exports.angle=T,exports.str=j,exports.exactEquals=z,exports.equals=Q;var V=require("./common"),X=t(V),Z=exports.sub=i,k=exports.mul=c,B=exports.div=x,C=exports.dist=m,F=exports.sqrDist=b,G=exports.len=e,H=exports.sqrLen=q,J=exports.forEach=function(){var t=r();return function(r,n,e,o,a,s){var u=void 0,i=void 0;for(n||(n=3),e||(e=0),i=o?Math.min(o*n+e,r.length):r.length,u=e;u<i;u+=n)t[0]=r[u],t[1]=r[u+1],t[2]=r[u+2],a(t,t,s),r[u]=t[0],r[u+1]=t[1],r[u+2]=t[2];return r}}();
  },{"./common":35}],43:[function(require,module,exports) {
  "use strict";function t(t){if(t&&t.__esModule)return t;var r={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r.default=t,r}function r(){var t=new w.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function n(t){var r=new w.ARRAY_TYPE(4);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}function e(t,r,n,e){var o=new w.ARRAY_TYPE(4);return o[0]=t,o[1]=r,o[2]=n,o[3]=e,o}function o(t,r){return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t}function a(t,r,n,e,o){return t[0]=r,t[1]=n,t[2]=e,t[3]=o,t}function s(t,r,n){return t[0]=r[0]+n[0],t[1]=r[1]+n[1],t[2]=r[2]+n[2],t[3]=r[3]+n[3],t}function u(t,r,n){return t[0]=r[0]-n[0],t[1]=r[1]-n[1],t[2]=r[2]-n[2],t[3]=r[3]-n[3],t}function i(t,r,n){return t[0]=r[0]*n[0],t[1]=r[1]*n[1],t[2]=r[2]*n[2],t[3]=r[3]*n[3],t}function x(t,r,n){return t[0]=r[0]/n[0],t[1]=r[1]/n[1],t[2]=r[2]/n[2],t[3]=r[3]/n[3],t}function c(t,r){return t[0]=Math.ceil(r[0]),t[1]=Math.ceil(r[1]),t[2]=Math.ceil(r[2]),t[3]=Math.ceil(r[3]),t}function p(t,r){return t[0]=Math.floor(r[0]),t[1]=Math.floor(r[1]),t[2]=Math.floor(r[2]),t[3]=Math.floor(r[3]),t}function f(t,r,n){return t[0]=Math.min(r[0],n[0]),t[1]=Math.min(r[1],n[1]),t[2]=Math.min(r[2],n[2]),t[3]=Math.min(r[3],n[3]),t}function h(t,r,n){return t[0]=Math.max(r[0],n[0]),t[1]=Math.max(r[1],n[1]),t[2]=Math.max(r[2],n[2]),t[3]=Math.max(r[3],n[3]),t}function M(t,r){return t[0]=Math.round(r[0]),t[1]=Math.round(r[1]),t[2]=Math.round(r[2]),t[3]=Math.round(r[3]),t}function l(t,r,n){return t[0]=r[0]*n,t[1]=r[1]*n,t[2]=r[2]*n,t[3]=r[3]*n,t}function d(t,r,n,e){return t[0]=r[0]+n[0]*e,t[1]=r[1]+n[1]*e,t[2]=r[2]+n[2]*e,t[3]=r[3]+n[3]*e,t}function v(t,r){var n=r[0]-t[0],e=r[1]-t[1],o=r[2]-t[2],a=r[3]-t[3];return Math.sqrt(n*n+e*e+o*o+a*a)}function m(t,r){var n=r[0]-t[0],e=r[1]-t[1],o=r[2]-t[2],a=r[3]-t[3];return n*n+e*e+o*o+a*a}function b(t){var r=t[0],n=t[1],e=t[2],o=t[3];return Math.sqrt(r*r+n*n+e*e+o*o)}function q(t){var r=t[0],n=t[1],e=t[2],o=t[3];return r*r+n*n+e*e+o*o}function A(t,r){return t[0]=-r[0],t[1]=-r[1],t[2]=-r[2],t[3]=-r[3],t}function O(t,r){return t[0]=1/r[0],t[1]=1/r[1],t[2]=1/r[2],t[3]=1/r[3],t}function E(t,r){var n=r[0],e=r[1],o=r[2],a=r[3],s=n*n+e*e+o*o+a*a;return s>0&&(s=1/Math.sqrt(s),t[0]=n*s,t[1]=e*s,t[2]=o*s,t[3]=a*s),t}function R(t,r){return t[0]*r[0]+t[1]*r[1]+t[2]*r[2]+t[3]*r[3]}function P(t,r,n,e){var o=r[0],a=r[1],s=r[2],u=r[3];return t[0]=o+e*(n[0]-o),t[1]=a+e*(n[1]-a),t[2]=s+e*(n[2]-s),t[3]=u+e*(n[3]-u),t}function N(t,r){return r=r||1,t[0]=w.RANDOM(),t[1]=w.RANDOM(),t[2]=w.RANDOM(),t[3]=w.RANDOM(),E(t,t),l(t,t,r),t}function D(t,r,n){var e=r[0],o=r[1],a=r[2],s=r[3];return t[0]=n[0]*e+n[4]*o+n[8]*a+n[12]*s,t[1]=n[1]*e+n[5]*o+n[9]*a+n[13]*s,t[2]=n[2]*e+n[6]*o+n[10]*a+n[14]*s,t[3]=n[3]*e+n[7]*o+n[11]*a+n[15]*s,t}function L(t,r,n){var e=r[0],o=r[1],a=r[2],s=n[0],u=n[1],i=n[2],x=n[3],c=x*e+u*a-i*o,p=x*o+i*e-s*a,f=x*a+s*o-u*e,h=-s*e-u*o-i*a;return t[0]=c*x+h*-s+p*-i-f*-u,t[1]=p*x+h*-u+f*-s-c*-i,t[2]=f*x+h*-i+c*-u-p*-s,t[3]=r[3],t}function _(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function Y(t,r){return t[0]===r[0]&&t[1]===r[1]&&t[2]===r[2]&&t[3]===r[3]}function g(t,r){var n=t[0],e=t[1],o=t[2],a=t[3],s=r[0],u=r[1],i=r[2],x=r[3];return Math.abs(n-s)<=w.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(e-u)<=w.EPSILON*Math.max(1,Math.abs(e),Math.abs(u))&&Math.abs(o-i)<=w.EPSILON*Math.max(1,Math.abs(o),Math.abs(i))&&Math.abs(a-x)<=w.EPSILON*Math.max(1,Math.abs(a),Math.abs(x))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.forEach=exports.sqrLen=exports.len=exports.sqrDist=exports.dist=exports.div=exports.mul=exports.sub=void 0,exports.create=r,exports.clone=n,exports.fromValues=e,exports.copy=o,exports.set=a,exports.add=s,exports.subtract=u,exports.multiply=i,exports.divide=x,exports.ceil=c,exports.floor=p,exports.min=f,exports.max=h,exports.round=M,exports.scale=l,exports.scaleAndAdd=d,exports.distance=v,exports.squaredDistance=m,exports.length=b,exports.squaredLength=q,exports.negate=A,exports.inverse=O,exports.normalize=E,exports.dot=R,exports.lerp=P,exports.random=N,exports.transformMat4=D,exports.transformQuat=L,exports.str=_,exports.exactEquals=Y,exports.equals=g;var y=require("./common"),w=t(y),I=exports.sub=u,S=exports.mul=i,T=exports.div=x,j=exports.dist=v,z=exports.sqrDist=m,Q=exports.len=b,V=exports.sqrLen=q,k=exports.forEach=function(){var t=r();return function(r,n,e,o,a,s){var u=void 0,i=void 0;for(n||(n=4),e||(e=0),i=o?Math.min(o*n+e,r.length):r.length,u=e;u<i;u+=n)t[0]=r[u],t[1]=r[u+1],t[2]=r[u+2],t[3]=r[u+3],a(t,t,s),r[u]=t[0],r[u+1]=t[1],r[u+2]=t[2],r[u+3]=t[3];return r}}();
  },{"./common":35}],40:[function(require,module,exports) {
  "use strict";function t(t){if(t&&t.__esModule)return t;var r={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=t[e]);return r.default=t,r}function r(){var t=new d.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function e(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function o(t,r,e){e*=.5;var o=Math.sin(e);return t[0]=o*r[0],t[1]=o*r[1],t[2]=o*r[2],t[3]=Math.cos(e),t}function s(t,r){var e=2*Math.acos(r[3]),o=Math.sin(e/2);return 0!=o?(t[0]=r[0]/o,t[1]=r[1]/o,t[2]=r[2]/o):(t[0]=1,t[1]=0,t[2]=0),e}function n(t,r,e){var o=r[0],s=r[1],n=r[2],a=r[3],u=e[0],p=e[1],i=e[2],x=e[3];return t[0]=o*x+a*u+s*i-n*p,t[1]=s*x+a*p+n*u-o*i,t[2]=n*x+a*i+o*p-s*u,t[3]=a*x-o*u-s*p-n*i,t}function a(t,r,e){e*=.5;var o=r[0],s=r[1],n=r[2],a=r[3],u=Math.sin(e),p=Math.cos(e);return t[0]=o*p+a*u,t[1]=s*p+n*u,t[2]=n*p-s*u,t[3]=a*p-o*u,t}function u(t,r,e){e*=.5;var o=r[0],s=r[1],n=r[2],a=r[3],u=Math.sin(e),p=Math.cos(e);return t[0]=o*p-n*u,t[1]=s*p+a*u,t[2]=n*p+o*u,t[3]=a*p-s*u,t}function p(t,r,e){e*=.5;var o=r[0],s=r[1],n=r[2],a=r[3],u=Math.sin(e),p=Math.cos(e);return t[0]=o*p+s*u,t[1]=s*p-o*u,t[2]=n*p+a*u,t[3]=a*p-n*u,t}function i(t,r){var e=r[0],o=r[1],s=r[2];return t[0]=e,t[1]=o,t[2]=s,t[3]=Math.sqrt(Math.abs(1-e*e-o*o-s*s)),t}function x(t,r,e,o){var s=r[0],n=r[1],a=r[2],u=r[3],p=e[0],i=e[1],x=e[2],c=e[3],l=void 0,f=void 0,h=void 0,v=void 0,M=void 0;return(f=s*p+n*i+a*x+u*c)<0&&(f=-f,p=-p,i=-i,x=-x,c=-c),1-f>1e-6?(l=Math.acos(f),h=Math.sin(l),v=Math.sin((1-o)*l)/h,M=Math.sin(o*l)/h):(v=1-o,M=o),t[0]=v*s+M*p,t[1]=v*n+M*i,t[2]=v*a+M*x,t[3]=v*u+M*c,t}function c(t,r){var e=r[0],o=r[1],s=r[2],n=r[3],a=e*e+o*o+s*s+n*n,u=a?1/a:0;return t[0]=-e*u,t[1]=-o*u,t[2]=-s*u,t[3]=n*u,t}function l(t,r){return t[0]=-r[0],t[1]=-r[1],t[2]=-r[2],t[3]=r[3],t}function f(t,r){var e=r[0]+r[4]+r[8],o=void 0;if(e>0)o=Math.sqrt(e+1),t[3]=.5*o,o=.5/o,t[0]=(r[5]-r[7])*o,t[1]=(r[6]-r[2])*o,t[2]=(r[1]-r[3])*o;else{var s=0;r[4]>r[0]&&(s=1),r[8]>r[3*s+s]&&(s=2);var n=(s+1)%3,a=(s+2)%3;o=Math.sqrt(r[3*s+s]-r[3*n+n]-r[3*a+a]+1),t[s]=.5*o,o=.5/o,t[3]=(r[3*n+a]-r[3*a+n])*o,t[n]=(r[3*n+s]+r[3*s+n])*o,t[a]=(r[3*a+s]+r[3*s+a])*o}return t}function h(t,r,e,o){var s=.5*Math.PI/180;r*=s,e*=s,o*=s;var n=Math.sin(r),a=Math.cos(r),u=Math.sin(e),p=Math.cos(e),i=Math.sin(o),x=Math.cos(o);return t[0]=n*p*x-a*u*i,t[1]=a*u*x+n*p*i,t[2]=a*p*i-n*u*x,t[3]=a*p*x+n*u*i,t}function v(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}Object.defineProperty(exports,"__esModule",{value:!0}),exports.setAxes=exports.sqlerp=exports.rotationTo=exports.equals=exports.exactEquals=exports.normalize=exports.sqrLen=exports.squaredLength=exports.len=exports.length=exports.lerp=exports.dot=exports.scale=exports.mul=exports.add=exports.set=exports.copy=exports.fromValues=exports.clone=void 0,exports.create=r,exports.identity=e,exports.setAxisAngle=o,exports.getAxisAngle=s,exports.multiply=n,exports.rotateX=a,exports.rotateY=u,exports.rotateZ=p,exports.calculateW=i,exports.slerp=x,exports.invert=c,exports.conjugate=l,exports.fromMat3=f,exports.fromEuler=h,exports.str=v;var M=require("./common"),d=t(M),q=require("./mat3"),m=t(q),g=require("./vec3"),y=t(g),A=require("./vec4"),E=t(A),L=exports.clone=E.clone,P=exports.fromValues=E.fromValues,V=exports.copy=E.copy,_=exports.set=E.set,z=exports.add=E.add,b=exports.mul=n,j=exports.scale=E.scale,O=exports.dot=E.dot,T=exports.lerp=E.lerp,Y=exports.length=E.length,w=exports.len=Y,I=exports.squaredLength=E.squaredLength,R=exports.sqrLen=I,W=exports.normalize=E.normalize,X=exports.exactEquals=E.exactEquals,Z=exports.equals=E.equals,k=exports.rotationTo=function(){var t=y.create(),r=y.fromValues(1,0,0),e=y.fromValues(0,1,0);return function(s,n,a){var u=y.dot(n,a);return u<-.999999?(y.cross(t,r,n),y.len(t)<1e-6&&y.cross(t,e,n),y.normalize(t,t),o(s,t,Math.PI),s):u>.999999?(s[0]=0,s[1]=0,s[2]=0,s[3]=1,s):(y.cross(t,n,a),s[0]=t[0],s[1]=t[1],s[2]=t[2],s[3]=1+u,W(s,s))}}(),B=exports.sqlerp=function(){var t=r(),e=r();return function(r,o,s,n,a,u){return x(t,o,a,u),x(e,s,n,u),x(r,t,e,2*u*(1-u)),r}}(),C=exports.setAxes=function(){var t=m.create();return function(r,e,o,s){return t[0]=o[0],t[3]=o[1],t[6]=o[2],t[1]=s[0],t[4]=s[1],t[7]=s[2],t[2]=-e[0],t[5]=-e[1],t[8]=-e[2],W(r,f(r,t))}}();
  },{"./common":35,"./mat3":36,"./vec3":42,"./vec4":43}],41:[function(require,module,exports) {
  "use strict";function r(r){if(r&&r.__esModule)return r;var t={};if(null!=r)for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n]);return t.default=r,t}function t(){var r=new j.ARRAY_TYPE(2);return r[0]=0,r[1]=0,r}function n(r){var t=new j.ARRAY_TYPE(2);return t[0]=r[0],t[1]=r[1],t}function e(r,t){var n=new j.ARRAY_TYPE(2);return n[0]=r,n[1]=t,n}function o(r,t){return r[0]=t[0],r[1]=t[1],r}function s(r,t,n){return r[0]=t,r[1]=n,r}function u(r,t,n){return r[0]=t[0]+n[0],r[1]=t[1]+n[1],r}function a(r,t,n){return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r}function i(r,t,n){return r[0]=t[0]*n[0],r[1]=t[1]*n[1],r}function c(r,t,n){return r[0]=t[0]/n[0],r[1]=t[1]/n[1],r}function p(r,t){return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r}function x(r,t){return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r}function f(r,t,n){return r[0]=Math.min(t[0],n[0]),r[1]=Math.min(t[1],n[1]),r}function h(r,t,n){return r[0]=Math.max(t[0],n[0]),r[1]=Math.max(t[1],n[1]),r}function M(r,t){return r[0]=Math.round(t[0]),r[1]=Math.round(t[1]),r}function l(r,t,n){return r[0]=t[0]*n,r[1]=t[1]*n,r}function v(r,t,n,e){return r[0]=t[0]+n[0]*e,r[1]=t[1]+n[1]*e,r}function d(r,t){var n=t[0]-r[0],e=t[1]-r[1];return Math.sqrt(n*n+e*e)}function m(r,t){var n=t[0]-r[0],e=t[1]-r[1];return n*n+e*e}function q(r){var t=r[0],n=r[1];return Math.sqrt(t*t+n*n)}function b(r){var t=r[0],n=r[1];return t*t+n*n}function A(r,t){return r[0]=-t[0],r[1]=-t[1],r}function E(r,t){return r[0]=1/t[0],r[1]=1/t[1],r}function P(r,t){var n=t[0],e=t[1],o=n*n+e*e;return o>0&&(o=1/Math.sqrt(o),r[0]=t[0]*o,r[1]=t[1]*o),r}function R(r,t){return r[0]*t[0]+r[1]*t[1]}function _(r,t,n){var e=t[0]*n[1]-t[1]*n[0];return r[0]=r[1]=0,r[2]=e,r}function O(r,t,n,e){var o=t[0],s=t[1];return r[0]=o+e*(n[0]-o),r[1]=s+e*(n[1]-s),r}function Y(r,t){t=t||1;var n=2*j.RANDOM()*Math.PI;return r[0]=Math.cos(n)*t,r[1]=Math.sin(n)*t,r}function g(r,t,n){var e=t[0],o=t[1];return r[0]=n[0]*e+n[2]*o,r[1]=n[1]*e+n[3]*o,r}function y(r,t,n){var e=t[0],o=t[1];return r[0]=n[0]*e+n[2]*o+n[4],r[1]=n[1]*e+n[3]*o+n[5],r}function L(r,t,n){var e=t[0],o=t[1];return r[0]=n[0]*e+n[3]*o+n[6],r[1]=n[1]*e+n[4]*o+n[7],r}function w(r,t,n){var e=t[0],o=t[1];return r[0]=n[0]*e+n[4]*o+n[12],r[1]=n[1]*e+n[5]*o+n[13],r}function D(r){return"vec2("+r[0]+", "+r[1]+")"}function I(r,t){return r[0]===t[0]&&r[1]===t[1]}function N(r,t){var n=r[0],e=r[1],o=t[0],s=t[1];return Math.abs(n-o)<=j.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(e-s)<=j.EPSILON*Math.max(1,Math.abs(e),Math.abs(s))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.forEach=exports.sqrLen=exports.sqrDist=exports.dist=exports.div=exports.mul=exports.sub=exports.len=void 0,exports.create=t,exports.clone=n,exports.fromValues=e,exports.copy=o,exports.set=s,exports.add=u,exports.subtract=a,exports.multiply=i,exports.divide=c,exports.ceil=p,exports.floor=x,exports.min=f,exports.max=h,exports.round=M,exports.scale=l,exports.scaleAndAdd=v,exports.distance=d,exports.squaredDistance=m,exports.length=q,exports.squaredLength=b,exports.negate=A,exports.inverse=E,exports.normalize=P,exports.dot=R,exports.cross=_,exports.lerp=O,exports.random=Y,exports.transformMat2=g,exports.transformMat2d=y,exports.transformMat3=L,exports.transformMat4=w,exports.str=D,exports.exactEquals=I,exports.equals=N;var T=require("./common"),j=r(T),S=exports.len=q,z=exports.sub=a,V=exports.mul=i,k=exports.div=c,B=exports.dist=d,C=exports.sqrDist=m,F=exports.sqrLen=b,G=exports.forEach=function(){var r=t();return function(t,n,e,o,s,u){var a=void 0,i=void 0;for(n||(n=2),e||(e=0),i=o?Math.min(o*n+e,t.length):t.length,a=e;a<i;a+=n)r[0]=t[a],r[1]=t[a+1],s(r,r,u),t[a]=r[0],t[a+1]=r[1];return t}}();
  },{"./common":35}],34:[function(require,module,exports) {
  "use strict";function e(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r.default=e,r}Object.defineProperty(exports,"__esModule",{value:!0}),exports.vec4=exports.vec3=exports.vec2=exports.quat=exports.mat4=exports.mat3=exports.mat2d=exports.mat2=exports.glMatrix=void 0;var r=require("./gl-matrix/common"),t=e(r),a=require("./gl-matrix/mat2"),o=e(a),x=require("./gl-matrix/mat2d"),i=e(x),s=require("./gl-matrix/mat3"),m=e(s),p=require("./gl-matrix/mat4"),u=e(p),l=require("./gl-matrix/quat"),c=e(l),v=require("./gl-matrix/vec2"),q=e(v),g=require("./gl-matrix/vec3"),n=e(g),d=require("./gl-matrix/vec4"),f=e(d);exports.glMatrix=t,exports.mat2=o,exports.mat2d=i,exports.mat3=m,exports.mat4=u,exports.quat=c,exports.vec2=q,exports.vec3=n,exports.vec4=f;
  },{"./gl-matrix/common":35,"./gl-matrix/mat2":38,"./gl-matrix/mat2d":39,"./gl-matrix/mat3":36,"./gl-matrix/mat4":37,"./gl-matrix/quat":40,"./gl-matrix/vec2":41,"./gl-matrix/vec3":42,"./gl-matrix/vec4":43}],10:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const n=exports.baseShaderVertSrc="\nattribute vec4 position;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\n\nvoid main() {\n    gl_Position = projectionMatrix * viewMatrix * modelMatrix * position;\n    gl_PointSize = 10.;\n}",i=exports.baseShaderFragSrc="\nprecision mediump float;\n\nuniform bool uWireframe;\n\nvoid main() {\n    float colorR = gl_FrontFacing ? 1.0 : 0.0;\n    float colorG = gl_FrontFacing ? 0.0 : 1.0;\n    \n    gl_FragColor = vec4(colorR, colorG, 0.0, 1.0);\n\n}",o=exports.wireFrameFragSrc="\nprecision mediump float;\n\nvoid main(){\n    gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n}\n",r=exports.base2ShaderVertSrc="#version 300 es\nin vec4 position;\nin vec3 barycentricPosition;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nout vec3 vBarycentricPosition;\n\nvoid main() {\n    gl_Position = projectionMatrix * viewMatrix * modelMatrix * position;\n    \n    vBarycentricPosition = barycentricPosition; \n}\n",e=exports.base2ShaderFragSrc="#version 300 es\nprecision mediump float;\nin vec3 vBarycentricPosition;\n\nuniform bool uWireframe;\n\nout vec4 outColor;\n\nvoid main() {\n\n    if(uWireframe){\n        float minBarycentricVal = min(min(vBarycentricPosition.x, vBarycentricPosition.y), vBarycentricPosition.z);\n        if(minBarycentricVal > 0.01) discard;\n    }\n    \n    outColor = vec4(1.0, 0.0, 0.0, 1.0);\n}\n",t=exports.normalShaderVertSrc="\nattribute vec4 position;\nattribute vec3 normal;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec3 vBarycentricPosition;\nvarying vec3 vNormal;\n\nvoid main() {\n    gl_Position = projectionMatrix * viewMatrix * modelMatrix * position;\n    vNormal = normal;\n}\n",a=exports.normalShaderFragSrc="\nprecision mediump float;\n\nvarying vec3 vNormal;\n\nvoid main() {\n    vec3 faceColor = (vNormal + vec3(0.5))/2.0;\n    gl_FragColor = vec4(faceColor, 1.0);\n}";
  },{}],27:[function(require,module,exports) {
  "use strict";function e(e){let r=e.split("\n");for(let e=0;e<r.length;e++)r[e]=e+1+": "+r[e];return r.join("\n")}function r(e,r,t){let n=e.createShader(r);return e.shaderSource(n,t),e.compileShader(n),e.getShaderParameter(n,e.COMPILE_STATUS),""!==e.getShaderInfoLog(n)?null:n}Object.defineProperty(exports,"__esModule",{value:!0}),exports.webGLShader=r;
  },{}],16:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Program=void 0;var t=require("./utils/webglShader"),r=require("tubugl-constants");class e{constructor(t,r,e,i={}){this._isReady=!1,this._isDebgu=i.isDebug,this._gl=t,this._initProgram(r,e,i),this._setProperties()}_initProgram(e,i,s){this._vertexShader=(0,t.webGLShader)(this._gl,r.VERTEX_SHADER,e),this._fragmentShader=(0,t.webGLShader)(this._gl,r.FRAGMENT_SHADER,i),this._program=this._gl.createProgram(),this._gl.attachShader(this._program,this._vertexShader),this._gl.attachShader(this._program,this._fragmentShader),this._gl.linkProgram(this._program);try{if(!this._gl.getProgramParameter(this._program,r.LINK_STATUS))throw this._gl.getProgramInfoLog(this._program)}catch(t){}}_setProperties(){let t;const e=this._gl.getProgramParameter(this._program,r.ACTIVE_UNIFORMS);for(this._uniform={},t=0;t<e;t++){let e,i=this._gl.getActiveUniform(this._program,t),s=this._gl.getUniformLocation(this._program,i.name);switch(i.type){case r.FLOAT:e="float";break;case r.FLOAT_VEC2:e="vec2";break;case r.FLOAT_VEC3:e="vec3";break;case r.FLOAT_VEC4:e="vec4";break;case r.FLOAT_MAT2:e="mat2";break;case r.FLOAT_MAT3:e="mat3";break;case r.FLOAT_MAT4:e="mat4"}this._uniform[i.name]={location:s,type:i.type,typeName:e,size:i.size}}const i=this._gl.getProgramParameter(this._program,r.ACTIVE_ATTRIBUTES);for(this._attrib={},t=0;t<i;t++){let r=this._gl.getActiveAttrib(this._program,t);this._attrib[r.name]={location:this._gl.getAttribLocation(this._program,r.name),type:r.type,size:r.size}}return this}bind(){return this._gl.useProgram(this._program),this}getAttrib(t){return this._attrib[t]}getUniforms(t){return this._uniform[t]}setUniformTexture(t){let{uniformName:r,textureNum:e}=t,i=this.getUniforms(r);this._gl.uniform1i(i.location,e)}dispose(){null!==this._gl&&(this._gl.deleteProgram(this._program),this._gl.deleteShader(this._vertexShader),this._gl.deleteShader(this._fragmentShader),this._gl=null)}}exports.Program=e;
  },{"./utils/webglShader":27,"tubugl-constants":14}],31:[function(require,module,exports) {
  "use strict";function e(){let e=document.createElement("canvas");try{return!(!window.WebGLRenderingContext||!e.getContext("experimental-webgl")&&!e.getContext("webgl"))}catch(e){return null}}function t(){let e=document.createElement("canvas");try{return!!window.WebGL2RenderingContext&&!!e.getContext("webgl")}catch(e){return null}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.detectorWebGL=e,exports.detectorWebGL2=t;
  },{}],18:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Program2=void 0;var r=require("./utils/webglShader"),e=require("./utils/detector"),t=require("./program"),a=require("tubugl-constants");class s extends t.Program{constructor(r,t,a,s={}){(0,e.detectorWebGL2)(),super(r,t,a,s)}_initProgram(e,t,s={}){this._vertexShader=(0,r.webGLShader)(this._gl,a.VERTEX_SHADER,e),this._fragmentShader=(0,r.webGLShader)(this._gl,a.FRAGMENT_SHADER,t),this._program=this._gl.createProgram(),this._gl.attachShader(this._program,this._vertexShader),this._gl.attachShader(this._program,this._fragmentShader),s.transformFeedback&&Array.isArray(s.transformFeedback)&&(this._transformFeedback=s.transformFeedback,this._gl.transformFeedbackVaryings(this._program,this._transformFeedback,a.SEPARATE_ATTRIBS)),this._gl.linkProgram(this._program);try{if(!this._gl.getProgramParameter(this._program,a.LINK_STATUS))throw this._gl.getProgramInfoLog(this._program)}catch(r){}}}exports.Program2=s;
  },{"./utils/webglShader":27,"./utils/detector":31,"./program":16,"tubugl-constants":14}],19:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ArrayBuffer=void 0;var t=require("tubugl-constants");class r{constructor(t,r,e={}){this.gl=t,this.buffer=this.gl.createBuffer(),this.attribs=[];try{if(!(r instanceof Float32Array||r instanceof Float64Array))throw"data should be  Float32Array or Flaot64Array";this.bind(),this.setData(r,e.usage),this.unbind()}catch(t){}}bind(){return this.gl.bindBuffer(t.ARRAY_BUFFER,this.buffer),this}unbind(){return this.gl.bindBuffer(t.ARRAY_BUFFER,null),this}setData(r,e=t.STATIC_DRAW){return this.dataArray=r,this.gl.bufferData(t.ARRAY_BUFFER,r,e),this}setAttribs(r,e,i=t.FLOAT,s=!1,a=0,n=0){return this.attribs.push({name:r,size:e,type:i,normalize:s,stride:a,offset:n}),this}attribPointer(t){return this.attribs.forEach(r=>{let e=t.getAttrib(r.name).location,{size:i,type:s,normalize:a,stride:n,offset:o}=r;this.gl.enableVertexAttribArray(e),this.gl.vertexAttribPointer(e,i,s,a,n,o)}),this}disablePoiner(t){return this.attribs.forEach(r=>{let e=t.getAttrib(r.name).location;this.gl.disableVertexAttribArray(e)}),this}}exports.ArrayBuffer=r;
  },{"tubugl-constants":14}],21:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});class t{constructor(t,r){this.gl=t,this.buffer=this.gl.createBuffer();try{if(!(r instanceof Uint16Array))throw"data should be Uint16Array";this.setData(r)}catch(t){}}setData(t){return this.dataArray=t,this.bind(),this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER,t,this.gl.STATIC_DRAW),this}bind(){return this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this.buffer),this}}exports.IndexArrayBuffer=t;
  },{}],20:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Texture=exports.textureNum=void 0;var t=require("tubugl-constants");let e=exports.textureNum=0;class r{constructor(r,i,s=t.RGB,h=t.RGB,_=t.UNSIGNED_BYTE,u=e){if(this._gl=r,this._gl&&(this._texture=this._gl.createTexture(),this.uniformName=i,this.uniformName))return this.textureNum=e,this.unit=t.TEXTURE0+e,this.setFormat(s,h,_),exports.textureNum=e+=1,this}activeTexture(){return this._gl.activeTexture(this.unit),this}bind(){return this._gl.bindTexture(t.TEXTURE_2D,this._texture),this}fromImage(e,r,i){return this._width=r||e.width,this._height=i||e.height,this._gl.texImage2D(t.TEXTURE_2D,0,this._internalFormt,this._format,this._type,e),this}setFormat(t,e,r){return t&&(this._format=t),e&&(this._internalFormt=e),r&&(this._type=r),this}isActiveTexture(t){return t===this.unit}setFilter(e=t.LINEAR){return this.setMinFilter(e),this.setMagFilter(e),this}setMagFilter(e=t.LINEAR){return this._gl.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e),this}setMinFilter(e=t.NEAREST){return this._gl.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,e),this}wrap(e=t.CLAMP_TO_EDGE){return this._gl.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,e),this._gl.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,e),this}generateMipmap(){return this._gl.generateMipmap(t.TEXTURE_2D),this}}exports.Texture=r;
  },{"tubugl-constants":14}],32:[function(require,module,exports) {
  "use strict";function e(e){return 0==(e&e-1)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.isPowerOf2=e;
  },{}],24:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.FrameBuffer=void 0;var e=require("tubugl-constants"),t=require("./utils/functions");class r{constructor(t,r=256,i=256){this._gl=t,this._width=r,this._height=i,this._texture=this._makeTexture(),this._gl.texImage2D(e.TEXTURE_2D,0,e.RGBA,r,i,0,e.RGBA,e.UNSIGNED_BYTE,null),this._frameBuffer=this._gl.createFramebuffer(),this._gl.bindFramebuffer(e.FRAMEBUFFER,this._frameBuffer),this._gl.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this._texture,0)}bind(){return this._gl.bindFramebuffer(e.FRAMEBUFFER,this._frameBuffer),this}updateViewport(){return this._gl.viewport(0,0,this._width,this._height),this}unbind(){return this._gl.bindFramebuffer(e.FRAMEBUFFER,null),this}_makeTexture(){let t=this._gl.createTexture();return this._gl.bindTexture(e.TEXTURE_2D,t),this._gl.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),this._gl.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),this._gl.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),this._gl.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),t}getTexture(){return this._texture}}exports.FrameBuffer=r;
  },{"tubugl-constants":14,"./utils/functions":32}],22:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TransformFeedback=void 0;var r=require("tubugl-constants");class e{constructor(r){this._gl=r,this._transfromFeedback=r.createTransformFeedback(),this._arrayBuffers=[]}bind(){return this._gl.bindTransformFeedback(r.TRANSFORM_FEEDBACK,this._transfromFeedback),this}unbindBufferBase(){return this._arrayBuffers.forEach((e,a)=>this._gl.bindBufferBase(r.TRANSFORM_FEEDBACK_BUFFER,a,null)),this}updateBufferBase(e){this._arrayBuffers.forEach((a,s)=>{this._gl.bindBuffer(r.ARRAY_BUFFER,a.read.buffer),this._gl.bindBufferBase(r.TRANSFORM_FEEDBACK_BUFFER,s,a.write.buffer),a.read.attribPointer(e)})}addArrayBufer(r,e){this._arrayBuffers[r]=e}swapArrayBuffers(){this._arrayBuffers.forEach(r=>{let e=r.read;r.read=r.write,r.write=e})}update(){}}exports.TransformFeedback=e;
  },{"tubugl-constants":14}],23:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.VAO=void 0;var r=require("tubugl-constants");class e{constructor(r){this._gl=r,this._vao=r.createVertexArray(),this._arrayBuffers={}}bind(){return this._gl.bindVertexArray(this._vao),this}updateArrayBuffer(r,e,t){return this._arrayBuffers[t]=e,e.attribPointer(r),this}updateIndexBuffer(r){r.bind()}delete(){return this._gl.deleteVertexArray(this._vao),this}}exports.VAO=e;
  },{"tubugl-constants":14}],25:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DrawCall=exports.draw=void 0;var e=require("tubugl-constants");let t=exports.draw={array:function(t,r,n=e.TRIANGLES){t.drawArrays(n,0,r)},element:function(t,r,n=e.TRIANGLES){t.drawElements(n,r,e.UNSIGNED_SHORT,0)},elementPoints:function(t,r){this.element(t,r,e.POINTS)},arrayPoint:function(t,r){this.array(t,r,e.POINTS)},elementTriangles:function(t,r){this.element(t,r,e.POINTS)},arrayLines:function(t,r){this.array(t,r,e.LINES)},elementLines:function(t,r){this.element(t,r,e.LINES)}};class r{constructor(t=e.TRIANGLES){}draw(){}}exports.DrawCall=r;
  },{"tubugl-constants":14}],12:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./src/program");Object.defineProperty(exports,"Program",{enumerable:!0,get:function(){return e.Program}});var r=require("./src/program2");Object.defineProperty(exports,"Program2",{enumerable:!0,get:function(){return r.Program2}});var t=require("./src/arrayBuffer");Object.defineProperty(exports,"ArrayBuffer",{enumerable:!0,get:function(){return t.ArrayBuffer}});var n=require("./src/indexArrayBuffer");Object.defineProperty(exports,"IndexArrayBuffer",{enumerable:!0,get:function(){return n.IndexArrayBuffer}});var u=require("./src/texture");Object.defineProperty(exports,"Texture",{enumerable:!0,get:function(){return u.Texture}});var a=require("./src/frameBuffer");Object.defineProperty(exports,"FrameBuffer",{enumerable:!0,get:function(){return a.FrameBuffer}});var f=require("./src/tranformFeedback");Object.defineProperty(exports,"TransformFeedback",{enumerable:!0,get:function(){return f.TransformFeedback}});var o=require("./src/vao");Object.defineProperty(exports,"VAO",{enumerable:!0,get:function(){return o.VAO}});var c=require("./src/draw");Object.defineProperty(exports,"draw",{enumerable:!0,get:function(){return c.draw}});var i=require("./src/utils/webglShader");Object.defineProperty(exports,"webGLShader",{enumerable:!0,get:function(){return i.webGLShader}});
  },{"./src/program":16,"./src/program2":18,"./src/arrayBuffer":19,"./src/indexArrayBuffer":21,"./src/texture":20,"./src/frameBuffer":24,"./src/tranformFeedback":22,"./src/vao":23,"./src/draw":25,"./src/utils/webglShader":27}],26:[function(require,module,exports) {
  "use strict";function e(e){let r=[];for(let t=0;t<e.length/3;t++)r.push(e[3*t]),r.push(e[3*t+1]),r.push(e[3*t+1]),r.push(e[3*t+2]),r.push(e[3*t+2]),r.push(e[3*t]);return r=new Uint16Array(r)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.generateWireframeIndices=e;
  },{}],15:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./src/utils");Object.defineProperty(exports,"generateWireframeIndices",{enumerable:!0,get:function(){return e.generateWireframeIndices}});
  },{"./src/utils":26}],17:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});class t{constructor(t=0,e=0,s=0){this.needsUpdate=!0,this._x=t,this._y=e,this._z=s,this.array=new Float32Array([t,e,s])}set x(t){this.needsUpdate=!0,this._x=t,this.array[0]=t}get x(){return this._x}set y(t){this.needsUpdate=!0,this._y=t,this.array[1]=t}get y(){return this._y}set z(t){this.needsUpdate=!0,this._z=t,this.array[2]=t}get z(){return this._z}}exports.Vector3=t;
  },{}],11:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./src/vector3");Object.defineProperty(exports,"Vector3",{enumerable:!0,get:function(){return e.Vector3}});
  },{"./src/vector3":17}],7:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ProceduralCube=void 0;var t=require("gl-matrix/src/gl-matrix"),e=require("./shaders/base.shader"),i=require("tubugl-core"),s=require("tubugl-constants"),r=require("tubugl-utils"),a=require("tubugl-math");const h=require("wolfy87-eventemitter");class o extends h{constructor(e,i=100,s=100,r=100,h=1,o=1,n=1,d={}){super(),this._params=d,this._isNeedUpdate=!0,this._isWire=!!d.isWire,this._isDepthTest=!d.isDepthTest||d.isDepthTest,this._isTransparent=!!d.isTransparent,this._isGl2=d.isGl2,this._modelMatrix=t.mat4.create(),this._gl=e,this._side=d.side?d.side:"double",this._width=i,this._height=s,this._depth=r,this._widthSegments=h,this._heightSegments=o,this._depthSegments=n,this.position=new a.Vector3,this.rotation=new a.Vector3,this.scale=new a.Vector3(1,1,1),this._makeProgram(d),this._makeBuffers(),this._isWire&&(this._makeWireframe(),this._makeWireframeBuffer())}get modelMatrix(){return this._modelMatrix}setPosition(t,e,i){return this._isNeedUpdate=!0,void 0!==t&&(this.position.x=t),void 0!==e&&(this.position.y=e),void 0!==i&&(this.position.z=i),this}setRotation(t,e,i){return this._isNeedUpdate=!0,void 0!==t&&(this.rotation.x=t),void 0!==e&&(this.rotation.y=e),void 0!==i&&(this.rotation.z=i),this}getVertice(){return this._positionBuffer.dataArray}render(t){this.update(t).draw(),this._isWire&&this.updateWire(t).drawWireframe()}update(t){this._updateModelMatrix();let e=this._program;return e.bind(),this._updateAttributes(e),this._gl.uniformMatrix4fv(e.getUniforms("modelMatrix").location,!1,this._modelMatrix),this._gl.uniformMatrix4fv(e.getUniforms("viewMatrix").location,!1,t.viewMatrix),this._gl.uniformMatrix4fv(e.getUniforms("projectionMatrix").location,!1,t.projectionMatrix),this}updateWire(t){let e=this._wireframeProgram;return e.bind(),this._positionBuffer.bind().attribPointer(e),this._wireframeIndexBuffer.bind(),this._gl.uniformMatrix4fv(e.getUniforms("modelMatrix").location,!1,this._modelMatrix),this._gl.uniformMatrix4fv(e.getUniforms("viewMatrix").location,!1,t.viewMatrix),this._gl.uniformMatrix4fv(e.getUniforms("projectionMatrix").location,!1,t.projectionMatrix),this}draw(){return"double"===this._side?this._gl.disable(s.CULL_FACE):"front"===this._side?(this._gl.enable(s.CULL_FACE),this._gl.cullFace(s.BACK)):(this._gl.enable(s.CULL_FACE),this._gl.cullFace(s.FRONT)),this._isDepthTest?this._gl.enable(s.DEPTH_TEST):this._gl.disable(s.DEPTH_TEST),this._isTransparent?(this._gl.blendFunc(s.SRC_ALPHA,s.ONE),this._gl.enable(s.BLEND)):(this._gl.blendFunc(s.SRC_ALPHA,s.ZERO),this._gl.disable(s.BLEND)),this._gl.drawElements(s.TRIANGLES,this._cnt,s.UNSIGNED_SHORT,0),this}resize(){}addGui(t){t.add(this,"_isWire").name("isWire").onChange(()=>{this._isWire&&!this._wireframeProgram&&(this._makeWireframe(),this._makeWireframeBuffer())});let e=t.addFolder("position");e.add(this.position,"x",-100,100),e.add(this.position,"y",-100,100),e.add(this.position,"z",-100,100);let i=t.addFolder("rotation");i.add(this.rotation,"x",-Math.PI,Math.PI).step(.01),i.add(this.rotation,"y",-Math.PI,Math.PI).step(.01),i.add(this.rotation,"z",-Math.PI,Math.PI).step(.01)}drawWireframe(){this._gl.drawElements(s.LINES,this._wireframeIndexCnt,s.UNSIGNED_SHORT,0)}_updateModelMatrix(){if(this._isNeedUpdate||this.position.needsUpdate||this.rotation.needsUpdate||this.scale.needsUpdate)return t.mat4.fromTranslation(this._modelMatrix,this.position.array),t.mat4.scale(this._modelMatrix,this._modelMatrix,this.scale.array),t.mat4.rotateX(this._modelMatrix,this._modelMatrix,this.rotation.array[0]),t.mat4.rotateY(this._modelMatrix,this._modelMatrix,this.rotation.array[1]),t.mat4.rotateZ(this._modelMatrix,this._modelMatrix,this.rotation.array[2]),this._isNeedUpdate=!1,this.position.needsUpdate=!1,this.rotation.needsUpdate=!1,this.scale.needsUpdate=!1,this}_makeProgram(t){const s=t.fragmentShaderSrc?t.fragmentShaderSrc:this._isGl2?e.base2ShaderFragSrc:e.baseShaderFragSrc,r=t.vertexShaderSrc?t.vertexShaderSrc:this._isGl2?e.base2ShaderVertSrc:e.baseShaderVertSrc;this._program=new i.Program(this._gl,r,s)}_makeWireframe(){this._wireframeProgram=new i.Program(this._gl,e.baseShaderVertSrc,e.wireFrameFragSrc)}_makeBuffers(){this._isGl2&&(this._vao=new i.VAO(this._gl),this._vao.bind());let t=4*(this._widthSegments+this._heightSegments+this._depthSegments-3),e=2*((this._widthSegments-1)*(this._heightSegments-1)+(this._widthSegments-1)*(this._depthSegments-1)+(this._heightSegments-1)*(this._depthSegments-1));this._verticeNum=8+t+e,this._positionBuffer=new i.ArrayBuffer(this._gl,o.getVertices(this._width,this._height,this._depth,this._widthSegments,this._heightSegments,this._depthSegments)),this._positionBuffer.setAttribs("position",3),this._vao&&this._positionBuffer.bind().attribPointer(this._program),this._indexBuffer=new i.IndexArrayBuffer(this._gl,o.getIndices(this._widthSegments,this._heightSegments,this._depthSegments)),this._cnt=this._indexBuffer.dataArray.length}_makeWireframeBuffer(){this._wireframeIndexBuffer=new i.IndexArrayBuffer(this._gl,(0,r.generateWireframeIndices)(this._indexBuffer.dataArray)),this._wireframeIndexCnt=this._wireframeIndexBuffer.dataArray.length}_updateAttributes(t){this._vao?this._vao.bind():(this._positionBuffer.bind().attribPointer(t),this._indexBuffer.bind())}static getVertices(t,e,i,s,r,a){let h,o,n,d=[],_=0;const l=1/s,u=1/r,c=1/a,f=t/2,m=e/2,p=i/2;for(o=0;o<=r;o++){let r=e*u*o-m;for(h=0;h<=s;h++)d[_++]=t*l*h-f,d[_++]=r,d[_++]=p;for(n=1;n<=a;n++)d[_++]=f,d[_++]=r,d[_++]=p-n*c*i;for(h=s-1;h>=0;h--)d[_++]=t*l*h-f,d[_++]=r,d[_++]=-p;for(n=a-1;n>0;n--)d[_++]=-f,d[_++]=r,d[_++]=p-n*c*i}for(o=0;o<2;o++){let e=0===o?-m:m;for(n=1;n<a;n++){let r=p-n*c*i;for(h=1;h<s;h++){let i=h*l*t-f;d[_++]=i,d[_++]=e,d[_++]=r}}}return d=new Float32Array(d)}static _getBarycentricVertices(t,e){let i,s=[];for(let r=0;r<=e;r++)for(let e=0;e<=t;e++)switch((i=2*r+e)%3){case 0:s.push(1),s.push(0),s.push(0);break;case 1:s.push(0),s.push(1),s.push(0);break;case 2:s.push(0),s.push(0),s.push(1)}return s=new Float32Array(s)}static getIndices(t,e,i){let s=[],r=2*(t+i);for(let t=0;t<e;t++){let e=r*t;for(let t=0;t<r;t++)s.push(t+e),t===r-1?s.push(0+e):s.push(t+1+e),s.push(t+r+e),t===r-1?(s.push(0+e),s.push(r+e)):(s.push(t+1+e),s.push(t+1+r+e)),s.push(t+r+e)}return s=s.concat(o.createFace(t,e,i,!1)),s=s.concat(o.createFace(t,e,i)),s=new Uint16Array(s)}static createFace(t,e,i,s=!0){let r=[],a=2*(t+i),h=s?a*(e+1)+(i-1)*(t-1):a*(e+1),n=s?a*e:0,d=s?o.setTopQuad:o.setQuad;if(1===t||1===i){let e=Math.max(t,i);if(1===t)for(let t=0;t<e;t++)r=0===t?r.concat(d(n+t,n+t+1,n+t+2,n+a-1-t)):r.concat(d(n+a-t,n+t+1,n+t+2,n+a-1-t));else for(let t=0;t<e;t++)r=r.concat(d(n+t,n+t+1,n+a-2-t,n+a-1-t))}else{r=r.concat(d(n,n+1,h,n+a-1));for(let e=1;e<t-1;e++)r=r.concat(d(n+e,n+e+1,h+e,h+e-1));r=r.concat(d(n+t-1,n+t,n+t+1,h+t-2));for(let e=1;e<i-1;e++){r=r.concat(d(n+a-e,h+(e-1)*(t-1),h+e*(t-1),n+a-e-1));for(let i=1;i<t-1;i++)r=r.concat(d(h+i-1+(e-1)*(t-1),h+i+(e-1)*(t-1),h+i+e*(t-1),h+i+e*(t-1)-1));r=r.concat(d(h+e*(t-1)-1,n+t+e,n+t+e+1,h+(e+1)*(t-1)-1))}r=r.concat(d(n+a-i+1,h+(i-2)*(t-1),n+a-i-1,n+a-i));for(let e=1;e<t-1;e++)r=r.concat(d(h+(i-2)*(t-1)+e-1,h+(i-2)*(t-1)+e,n+a-i-e-1,n+a-i-e));r=r.concat(d(h+(i-1)*(t-1)-1,n+t+i-1,n+t+i,n+t+i+1))}return r}static setTopQuad(t,e,i,s){let r=[];return r.push(t),r.push(e),r.push(i),r.push(i),r.push(s),r.push(t),r}static setQuad(t,e,i,s){let r=[];return r.push(e),r.push(t),r.push(i),r.push(s),r.push(i),r.push(t),r}static _getWireframeIndices(t){}}exports.ProceduralCube=o;
  },{"wolfy87-eventemitter":13,"gl-matrix/src/gl-matrix":34,"./shaders/base.shader":10,"tubugl-core":12,"tubugl-constants":14,"tubugl-utils":15,"tubugl-math":11}],8:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ProceduralRoundingCube=void 0;var e=require("./proceduralCube"),r=require("tubugl-core"),t=require("gl-matrix/src/gl-matrix"),s=require("./shaders/base.shader");class i extends e.ProceduralCube{constructor(e,r=100,t=100,s=100,i=2,a=1,h=1,o=1,u={}){u.roundness=i,super(e,r,t,s,a,h,o,u)}getNormals(){return this._normalBuffer.dataArray}_makeBuffers(){super._makeBuffers();let e=this._positionBuffer.dataArray,s=[],i=t.vec3.create(),a=t.vec3.create(),h=this._params.roundness;for(let r=0;r<e.length/3;r++){let o=e[3*r],u=e[3*r+1],d=e[3*r+2];t.vec3.set(a,o,u,d),o<-this._width/2+h?a[0]=-this._width/2+h:o>this._width/2-h&&(a[0]=this._width/2-h),u<-this._height/2+h?a[1]=-this._height/2+h:u>this._height/2-h&&(a[1]=this._height/2-h),d<-this._depth/2+h?a[2]=-this._depth/2+h:d>this._depth/2-h&&(a[2]=this._depth/2-h),t.vec3.set(i,o-a[0],u-a[1],d-a[2]),t.vec3.normalize(i,i),e[3*r]=a[0]+i[0]*h,e[3*r+1]=a[1]+i[1]*h,e[3*r+2]=a[2]+i[2]*h,s.push(i[0]),s.push(i[1]),s.push(i[2])}this._positionBuffer.bind().setData(e),this._normalBuffer=new r.ArrayBuffer(this._gl,new Float32Array(s)),this._normalBuffer.setAttribs("normal",3)}_updateAttributes(e){this._vao?this._vao.bind():(this._positionBuffer.bind().attribPointer(e),this._normalBuffer.bind().attribPointer(e),this._indexBuffer.bind())}_makeProgram(e){const t=e.vertexShaderSrc?e.vertexShaderSrc:this._isGl2?s.base2ShaderVertSrc:s.normalShaderVertSrc,i=e.fragmentShaderSrc?e.fragmentShaderSrc:this._isGl2?s.base2ShaderFragSrc:s.normalShaderFragSrc;this._program=new r.Program(this._gl,t,i)}}exports.ProceduralRoundingCube=i;
  },{"./proceduralCube":7,"tubugl-core":12,"gl-matrix/src/gl-matrix":34,"./shaders/base.shader":10}],9:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.NormalHelper=void 0;var i=require("tubugl-core"),t=require("tubugl-core/src/vao"),r=require("tubugl-core/src/arrayBuffer"),e=require("tubugl-constants"),n=require("gl-matrix/src/gl-matrix"),o=require("tubugl-core/src/indexArrayBuffer");const a=require("wolfy87-eventemitter"),s="\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec3 vBarycentricPosition;\n\nvoid main() {\n\tgl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position + normal * 3., 1.0);\n\tgl_PointSize = 6.;\n}\n",l="\nprecision mediump float;\n\nvoid main() {\n\tfloat alpha = clamp( 4.0 * (1.0 - distance(gl_PointCoord, vec2(0.5))/0.5 ), 0.0, 1.0);\n\n\tif(alpha < 0.001 ) discard;\n    \n    gl_FragColor = vec4(1.0, 1.0, 1.0, alpha);\n}\n",h="\nattribute vec3 position;\nattribute vec3 normal;\nattribute float side;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nuniform float lineLength;\n\nvarying vec3 vBarycentricPosition;\n\nvoid main() {\n\tgl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position + normal * lineLength * side, 1.0);\n}\n",_="\nprecision mediump float;\n\nvoid main() {\n    gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n}\n";class f extends a{constructor(i,t,r={}){super(),this._gl=i,this._shape=t,this._isGl2=!!r.isGL2,this._modelMatrix=n.mat4.create(),this._lineLength=20,this._makeProgram(),this._makeBuffer()}_makeProgram(){this._program=new i.Program(this._gl,s,l),this._lineProgram=new i.Program(this._gl,h,_)}_makeBuffer(){this._isGl2&&(this._vao=new t.VAO(this._gl),this._vao.bind());const i=this._shape.getVertice();this._positionBuffer=new r.ArrayBuffer(this._gl,i),this._positionBuffer.setAttribs("position",3);const e=this._shape.getNormals();this._normalBuffer=new r.ArrayBuffer(this._gl,e),this._normalBuffer.setAttribs("normal",3),this._vao&&(this._positionBuffer.bind().attribPointer(this._program),this._normalBuffer.bind().attribPointer(this._program)),this._pointNum=this._positionBuffer.dataArray.length/3;let n=new Float32Array(2*i.length),a=new Float32Array(2*e.length),s=new Float32Array(i.length/3*2),l=[];for(let t=0;t<this._pointNum;t++)n[6*t]=i[3*t],n[6*t+1]=i[3*t+1],n[6*t+2]=i[3*t+2],n[6*t+3]=i[3*t],n[6*t+4]=i[3*t+1],n[6*t+5]=i[3*t+2],a[6*t]=e[3*t],a[6*t+1]=e[3*t+1],a[6*t+2]=e[3*t+2],a[6*t+3]=e[3*t],a[6*t+4]=e[3*t+1],a[6*t+5]=e[3*t+2],s[2*t]=0,s[2*t+1]=1,l.push(2*t),l.push(2*t+1);this._linePositionBuffer=new r.ArrayBuffer(this._gl,n),this._linePositionBuffer.setAttribs("position",3),this._lineNormalBuffer=new r.ArrayBuffer(this._gl,a),this._lineNormalBuffer.setAttribs("normal",3),this._lineSideBuffer=new r.ArrayBuffer(this._gl,s),this._lineSideBuffer.setAttribs("side",1),this._lineIndexBuffer=new o.IndexArrayBuffer(this._gl,new Uint16Array(l)),this._lineCnt=this._lineIndexBuffer.dataArray.length}_updateModelMatrix(){return n.mat4.copy(this._modelMatrix,this._shape.modelMatrix),this}render(i){this._updateModelMatrix(),this.updateDot(i).drawDot(),this.updateLine(i).drawLine()}updateDot(i){return this._program.bind(),this._vao?this._vao.bind():(this._positionBuffer.bind().attribPointer(this._program),this._normalBuffer.bind().attribPointer(this._program)),this._gl.uniformMatrix4fv(this._program.getUniforms("modelMatrix").location,!1,this._modelMatrix),this._gl.uniformMatrix4fv(this._program.getUniforms("viewMatrix").location,!1,i.viewMatrix),this._gl.uniformMatrix4fv(this._program.getUniforms("projectionMatrix").location,!1,i.projectionMatrix),this}updateLine(i){return this._lineProgram.bind(),this._linePositionBuffer.bind().attribPointer(this._lineProgram),this._lineNormalBuffer.bind().attribPointer(this._lineProgram),this._lineSideBuffer.bind().attribPointer(this._lineProgram),this._lineIndexBuffer.bind(),this._gl.uniform1f(this._lineProgram.getUniforms("lineLength").location,this._lineLength),this._gl.uniformMatrix4fv(this._lineProgram.getUniforms("modelMatrix").location,!1,this._modelMatrix),this._gl.uniformMatrix4fv(this._lineProgram.getUniforms("viewMatrix").location,!1,i.viewMatrix),this._gl.uniformMatrix4fv(this._lineProgram.getUniforms("projectionMatrix").location,!1,i.projectionMatrix),this}drawDot(){this._gl.disable(e.CULL_FACE),this._gl.enable(e.DEPTH_TEST),this._gl.blendFunc(e.SRC_ALPHA,e.ONE),this._gl.enable(e.BLEND),this._gl.drawArrays(e.POINTS,0,this._pointNum)}drawLine(){this._gl.disable(e.CULL_FACE),this._gl.enable(e.DEPTH_TEST),this._gl.blendFunc(e.SRC_ALPHA,e.ZERO),this._gl.disable(e.BLEND),this._gl.drawElements(e.LINES,this._lineCnt,e.UNSIGNED_SHORT,0)}}exports.NormalHelper=f;
  },{"wolfy87-eventemitter":13,"tubugl-core":12,"tubugl-core/src/vao":23,"tubugl-core/src/arrayBuffer":19,"tubugl-constants":14,"gl-matrix/src/gl-matrix":34,"tubugl-core/src/indexArrayBuffer":21}],6:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./src/proceduralCube");Object.defineProperty(exports,"ProceduralCube",{enumerable:!0,get:function(){return e.ProceduralCube}});var r=require("./src/proceduralRoundingCube");Object.defineProperty(exports,"ProceduralRoundingCube",{enumerable:!0,get:function(){return r.ProceduralRoundingCube}});var u=require("./src/normalHelper");Object.defineProperty(exports,"NormalHelper",{enumerable:!0,get:function(){return u.NormalHelper}});
  },{"./src/proceduralCube":7,"./src/proceduralRoundingCube":8,"./src/normalHelper":9}],54:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const n=exports.baseVertSrc="\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec3 vBarycentricPosition;\n\nvoid main() {\n\tgl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position + normal * 3., 1.0);\n\tgl_PointSize = 6.;\n}\n",i=exports.baseFragSrc="\nprecision mediump float;\n\nvoid main() {\n\tfloat alpha = clamp( 4.0 * (1.0 - distance(gl_PointCoord, vec2(0.5))/0.5 ), 0.0, 1.0);\n\n\tif(alpha < 0.001 ) discard;\n    \n    gl_FragColor = vec4(1.0, 1.0, 1.0, alpha);\n}\n",t=exports.lineVertSrc="\nattribute vec3 position;\nattribute vec3 normal;\nattribute float side;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nuniform float lineLength;\n\nvarying vec3 vBarycentricPosition;\n\nvoid main() {\n\tgl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position + normal * lineLength * side, 1.0);\n}\n",o=exports.lineFragSrc="\nprecision mediump float;\n\nvoid main() {\n    gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n}\n";
  },{}],46:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.NormalHelper=void 0;var i=require("tubugl-core"),t=require("tubugl-core/src/vao"),r=require("tubugl-core/src/arrayBuffer"),e=require("tubugl-constants"),s=require("gl-matrix/src/gl-matrix"),n=require("tubugl-core/src/indexArrayBuffer"),a=require("./shaders/normalHelper.shader");const o=require("wolfy87-eventemitter");class l extends o{constructor(i,t,r={}){super(),this.visible=!0,this._gl=i,this._shape=t,this._isGl2=!!r.isGL2,this._modelMatrix=s.mat4.create(),this._lineLength=20,this._makeProgram(),this._makeBuffer()}render(i){this.visible&&(this._updateModelMatrix(),this.updateDot(i).drawDot(),this.updateLine(i).drawLine())}updateDot(i){return this._program.bind(),this._vao?this._vao.bind():(this._positionBuffer.bind().attribPointer(this._program),this._normalBuffer.bind().attribPointer(this._program)),this._gl.uniformMatrix4fv(this._program.getUniforms("modelMatrix").location,!1,this._modelMatrix),this._gl.uniformMatrix4fv(this._program.getUniforms("viewMatrix").location,!1,i.viewMatrix),this._gl.uniformMatrix4fv(this._program.getUniforms("projectionMatrix").location,!1,i.projectionMatrix),this}updateLine(i){return this._lineProgram.bind(),this._linePositionBuffer.bind().attribPointer(this._lineProgram),this._lineNormalBuffer.bind().attribPointer(this._lineProgram),this._lineSideBuffer.bind().attribPointer(this._lineProgram),this._lineIndexBuffer.bind(),this._gl.uniform1f(this._lineProgram.getUniforms("lineLength").location,this._lineLength),this._gl.uniformMatrix4fv(this._lineProgram.getUniforms("modelMatrix").location,!1,this._modelMatrix),this._gl.uniformMatrix4fv(this._lineProgram.getUniforms("viewMatrix").location,!1,i.viewMatrix),this._gl.uniformMatrix4fv(this._lineProgram.getUniforms("projectionMatrix").location,!1,i.projectionMatrix),this}drawDot(){this._gl.disable(e.CULL_FACE),this._gl.enable(e.DEPTH_TEST),this._gl.blendFunc(e.SRC_ALPHA,e.ONE),this._gl.enable(e.BLEND),this._gl.drawArrays(e.POINTS,0,this._pointNum)}drawLine(){this._gl.disable(e.CULL_FACE),this._gl.enable(e.DEPTH_TEST),this._gl.blendFunc(e.SRC_ALPHA,e.ZERO),this._gl.disable(e.BLEND),this._gl.drawElements(e.LINES,this._lineCnt,e.UNSIGNED_SHORT,0)}addGui(i){i.addFolder("normal helper").add(this,"visible").listen()}_updateModelMatrix(){return s.mat4.copy(this._modelMatrix,this._shape.modelMatrix),this}_makeProgram(){this._program=new i.Program(this._gl,a.baseVertSrc,a.baseFragSrc),this._lineProgram=new i.Program(this._gl,a.lineVertSrc,a.lineFragSrc)}_makeBuffer(){this._isGl2&&(this._vao=new t.VAO(this._gl),this._vao.bind());const i=this._shape.getVertice();this._positionBuffer=new r.ArrayBuffer(this._gl,i),this._positionBuffer.setAttribs("position",3);const e=this._shape.getNormals();this._normalBuffer=new r.ArrayBuffer(this._gl,e),this._normalBuffer.setAttribs("normal",3),this._vao&&(this._positionBuffer.bind().attribPointer(this._program),this._normalBuffer.bind().attribPointer(this._program)),this._pointNum=this._positionBuffer.dataArray.length/3;let s=new Float32Array(2*i.length),a=new Float32Array(2*e.length),o=new Float32Array(i.length/3*2),l=[];for(let t=0;t<this._pointNum;t++)s[6*t]=i[3*t],s[6*t+1]=i[3*t+1],s[6*t+2]=i[3*t+2],s[6*t+3]=i[3*t],s[6*t+4]=i[3*t+1],s[6*t+5]=i[3*t+2],a[6*t]=e[3*t],a[6*t+1]=e[3*t+1],a[6*t+2]=e[3*t+2],a[6*t+3]=e[3*t],a[6*t+4]=e[3*t+1],a[6*t+5]=e[3*t+2],o[2*t]=0,o[2*t+1]=1,l.push(2*t),l.push(2*t+1);this._linePositionBuffer=new r.ArrayBuffer(this._gl,s),this._linePositionBuffer.setAttribs("position",3),this._lineNormalBuffer=new r.ArrayBuffer(this._gl,a),this._lineNormalBuffer.setAttribs("normal",3),this._lineSideBuffer=new r.ArrayBuffer(this._gl,o),this._lineSideBuffer.setAttribs("side",1),this._lineIndexBuffer=new n.IndexArrayBuffer(this._gl,new Uint16Array(l)),this._lineCnt=this._lineIndexBuffer.dataArray.length}}exports.NormalHelper=l;
  },{"wolfy87-eventemitter":13,"tubugl-core":12,"tubugl-core/src/vao":23,"tubugl-core/src/arrayBuffer":19,"tubugl-constants":14,"gl-matrix/src/gl-matrix":34,"tubugl-core/src/indexArrayBuffer":21,"./shaders/normalHelper.shader":54}],53:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const n=exports.baseShaderVertSrc="\nattribute vec4 position;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec3 vBarycentricPosition;\n\nvoid main() {\n    gl_Position = projectionMatrix * viewMatrix * modelMatrix * position;\n    \n}",i=exports.baseShaderFragSrc="\nprecision mediump float;\n\nuniform bool uWireframe;\n\n\nvoid main() {\n    float colorR = gl_FrontFacing ? 1.0 : 0.0;\n    float colorG = gl_FrontFacing ? 0.0 : 1.0;\n    \n    gl_FragColor = vec4(colorR, colorG, 0.0, 1.0);\n\n}",o=exports.wireFrameFragSrc="\nprecision mediump float;\n\nvoid main(){\n    gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n}\n",r=exports.base2ShaderVertSrc="#version 300 es\nin vec4 position;\nin vec3 barycentricPosition;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nout vec3 vBarycentricPosition;\n\nvoid main() {\n    gl_Position = projectionMatrix * viewMatrix * modelMatrix * position;\n    \n    vBarycentricPosition = barycentricPosition; \n}\n",e=exports.base2ShaderFragSrc="#version 300 es\nprecision mediump float;\nin vec3 vBarycentricPosition;\n\nuniform bool uWireframe;\n\nout vec4 outColor;\n\nvoid main() {\n\n    if(uWireframe){\n        float minBarycentricVal = min(min(vBarycentricPosition.x, vBarycentricPosition.y), vBarycentricPosition.z);\n        if(minBarycentricVal > 0.01) discard;\n    }\n    \n    outColor = vec4(1.0, 0.0, 0.0, 1.0);\n}\n";
  },{}],52:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Plane=void 0;var t=require("gl-matrix/src/gl-matrix"),i=require("./shaders/base.shader"),e=require("tubugl-core"),r=require("tubugl-constants"),s=require("tubugl-utils"),a=require("tubugl-math");const h=require("wolfy87-eventemitter");class o extends h{constructor(i,e=100,r=100,s=1,h=1,o={}){super(),this.position=new a.Vector3,this.rotation=new a.Vector3,this.scale=new a.Vector3(1,1,1),this._isGl2=o.isGl2,this._gl=i,this._side=o.side?o.side:"double",this._width=e,this._height=r,this._segmentW=s,this._segmentH=h,this._modelMatrix=t.mat4.create(),this._isNeedUpdate=!0,this._isWire=!!o.isWire,this._isDepthTest=!!o.isDepthTest,this._isTransparent=!!o.isTransparent,this._makeProgram(o),this._makeBuffer(),this._isWire&&(this._makeWireframe(),this._makeWireframeBuffer())}setPosition(t,i,e){return this._isNeedUpdate=!0,void 0!==t&&(this.position.x=t),void 0!==i&&(this.position.y=i),void 0!==e&&(this.position.z=e),this}setRotation(t,i,e){return this._isNeedUpdate=!0,void 0!==t&&(this.rotation.x=t),void 0!==i&&(this.rotation.y=i),void 0!==e&&(this.rotation.z=e),this}_makeProgram(t){const r=t.fragmentShaderSrc?t.fragmentShaderSrc:this._isGl2?i.base2ShaderFragSrc:i.baseShaderFragSrc,s=t.vertexShaderSrc?t.vertexShaderSrc:this._isGl2?i.base2ShaderVertSrc:i.baseShaderVertSrc;this._program=new e.Program(this._gl,s,r)}_makeWireframe(){this._wireframeProgram=new e.Program(this._gl,i.baseShaderVertSrc,i.wireFrameFragSrc)}_makeBuffer(){this._isGl2&&(this._vao=new e.VAO(this._gl),this._vao.bind()),this._positionBuffer=new e.ArrayBuffer(this._gl,this._getVertices(this._width,this._height,this._segmentW,this._segmentH)),this._positionBuffer.setAttribs("position",2),this._vao&&this._positionBuffer.bind().attribPointer(this._program);let t=this._getIndices(this._segmentW,this._segmentH);this._indexBuffer=new e.IndexArrayBuffer(this._gl,t),this._cnt=t.length}_makeWireframeBuffer(){this._wireframeIndexBuffer=new e.IndexArrayBuffer(this._gl,(0,s.generateWireframeIndices)(this._indexBuffer.dataArray)),this._wireframeIndexCnt=this._wireframeIndexBuffer.dataArray.length}render(t){this.update(t).draw(),this._isWire&&this.updateWire(t).drawWireframe()}update(t){return this._updateModelMatrix(),this._program.bind(),this._vao?this._vao.bind():(this._positionBuffer.bind().attribPointer(this._program),this._indexBuffer.bind()),this._gl.uniformMatrix4fv(this._program.getUniforms("modelMatrix").location,!1,this._modelMatrix),this._gl.uniformMatrix4fv(this._program.getUniforms("viewMatrix").location,!1,t.viewMatrix),this._gl.uniformMatrix4fv(this._program.getUniforms("projectionMatrix").location,!1,t.projectionMatrix),this}updateWire(t){let i=this._wireframeProgram;return i.bind(),this._positionBuffer.bind().attribPointer(i),this._wireframeIndexBuffer.bind(),this._gl.uniformMatrix4fv(i.getUniforms("modelMatrix").location,!1,this._modelMatrix),this._gl.uniformMatrix4fv(i.getUniforms("viewMatrix").location,!1,t.viewMatrix),this._gl.uniformMatrix4fv(i.getUniforms("projectionMatrix").location,!1,t.projectionMatrix),this}draw(){return"double"===this._side?this._gl.disable(r.CULL_FACE):"front"===this._side?(this._gl.enable(r.CULL_FACE),this._gl.cullFace(r.BACK)):(this._gl.enable(r.CULL_FACE),this._gl.cullFace(r.FRONT)),this._isDepthTest?this._gl.enable(r.DEPTH_TEST):this._gl.disable(r.DEPTH_TEST),this._isTransparent?(this._gl.blendFunc(r.SRC_ALPHA,r.ONE),this._gl.enable(r.BLEND)):(this._gl.blendFunc(r.SRC_ALPHA,r.ZERO),this._gl.disable(r.BLEND)),this._gl.drawElements(r.TRIANGLES,this._cnt,r.UNSIGNED_SHORT,0),this}drawWireframe(){this._gl.drawElements(r.LINES,this._wireframeIndexCnt,r.UNSIGNED_SHORT,0)}resize(){}addGui(t){t.add(this,"_isWire").name("isWire").onChange(()=>{this._isWire&&!this._wireframeProgram&&(this._makeWireframe(),this._makeWireframeBuffer())})}_updateModelMatrix(){if(this._isNeedUpdate||this.position.needsUpdate||this.rotation.needsUpdate||this.scale.needsUpdate)return t.mat4.fromTranslation(this._modelMatrix,this.position.array),t.mat4.scale(this._modelMatrix,this._modelMatrix,this.scale.array),t.mat4.rotateX(this._modelMatrix,this._modelMatrix,this.rotation.array[0]),t.mat4.rotateY(this._modelMatrix,this._modelMatrix,this.rotation.array[1]),t.mat4.rotateZ(this._modelMatrix,this._modelMatrix,this.rotation.array[2]),this._isNeedUpdate=!1,this.position.needsUpdate=!1,this.rotation.needsUpdate=!1,this.scale.needsUpdate=!1,this}_getVertices(t,i,e,r){let s=[],a=1/e,h=1/r;for(let o=0;o<=r;o++){let r=(h*o-.5)*i;for(let i=0;i<=e;i++){let e=(a*i-.5)*t;s.push(e),s.push(r)}}return s=new Float32Array(s)}_getIndices(t,i){let e=[];for(let r=0;r<i;r++)for(let i=0;i<t;i++){let s=r*(t+1),a=(r+1)*(t+1);e.push(s+i),e.push(s+i+1),e.push(a+i),e.push(s+i+1),e.push(a+i+1),e.push(a+i)}return e=new Uint16Array(e)}}exports.Plane=o;
  },{"wolfy87-eventemitter":13,"gl-matrix/src/gl-matrix":34,"./shaders/base.shader":53,"tubugl-core":12,"tubugl-constants":14,"tubugl-utils":15,"tubugl-math":11}],49:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./src/plane");Object.defineProperty(exports,"Plane",{enumerable:!0,get:function(){return e.Plane}});
  },{"./src/plane":52}],51:[function(require,module,exports) {
  (function(){var e,n,r,t,f,a,u,c,o,i,l,s,b,d,h,p,g,m,v,y,w,k,_,N,M,x,A,O,j,q,G,L,P,B,R,Y,E,S,X,z,U,V,C,F,I,K,Z,D,$,H,J,Q,T,W,ee,ne,re,te,fe,ae,ue,ce,oe,ie,le,se,be,de,he,pe,ge,ve,ye,we,ke,_e,Ne,Me,xe,Ae,Oe=[].slice;_e=function(){var e,n,r,t,f;for(e={},t=0,n=(f="Boolean Number String Function Array Date RegExp Undefined Null".split(" ")).length;t<n;t++)r=f[t],e["[object "+r+"]"]=r.toLowerCase();return function(n){var r;return r=Object.prototype.toString.call(n),e[r]||"object"}}(),Z=function(e,n,r){return null==n&&(n=0),null==r&&(r=1),e<n&&(e=n),e>r&&(e=r),e},Ne=function(e){return e.length>=3?[].slice.call(e):e[0]},w=function(e){var n,r;for(e._clipped=!1,e._unclipped=e.slice(0),n=r=0;r<3;n=++r)n<3?((e[n]<0||e[n]>255)&&(e._clipped=!0),e[n]<0&&(e[n]=0),e[n]>255&&(e[n]=255)):3===n&&(e[n]<0&&(e[n]=0),e[n]>1&&(e[n]=1));return e._clipped||delete e._unclipped,e},t=Math.PI,ge=Math.round,_=Math.cos,O=Math.floor,ee=Math.pow,D=Math.log,ye=Math.sin,we=Math.sqrt,d=Math.atan2,J=Math.max,b=Math.abs,u=2*t,f=t/3,n=t/180,a=180/t,(y=function(){return arguments[0]instanceof e?arguments[0]:function(e,n,r){r.prototype=e.prototype;var t=new r,f=e.apply(t,n);return Object(f)===f?f:t}(e,arguments,function(){})}).default=y,s=[],"undefined"!=typeof module&&null!==module&&null!=module.exports&&(module.exports=y),"function"==typeof define&&define.amd?define([],function(){return y}):("undefined"!=typeof exports&&null!==exports?exports:this).chroma=y,y.version="1.3.4",l={},o=[],i=!1,e=function(){function e(){var e,n,r,t,f,a,u,c;for(this,n=[],u=0,t=arguments.length;u<t;u++)null!=(e=arguments[u])&&n.push(e);if(n.length>1&&(a=n[n.length-1]),null!=l[a])this._rgb=w(l[a](Ne(n.slice(0,-1))));else{for(i||(o=o.sort(function(e,n){return n.p-e.p}),i=!0),c=0,f=o.length;c<f&&(r=o[c],!(a=r.test.apply(r,n)));c++);a&&(this._rgb=w(l[a].apply(l,n)))}this._rgb,null==this._rgb&&(this._rgb=[0,0,0]),3===this._rgb.length&&this._rgb.push(1)}return e.prototype.toString=function(){return this.hex()},e.prototype.clone=function(){return y(me._rgb)},e}(),y._input=l,y.brewer=m={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},function(){var e,n;n=[];for(e in m)n.push(m[e.toLowerCase()]=m[e])}(),y.colors=Me={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflower:"#6495ed",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},V=function(){var e,n,t,f,a,u,c,o,i;return n=Ne(arguments),a=n[0],e=n[1],t=n[2],o=(a+16)/116,c=isNaN(e)?o:o+e/500,i=isNaN(t)?o:o-t/200,o=r.Yn*C(o),c=r.Xn*C(c),i=r.Zn*C(i),u=Ae(3.2404542*c-1.5371385*o-.4985314*i),f=Ae(-.969266*c+1.8760108*o+.041556*i),t=Ae(.0556434*c-.2040259*o+1.0572252*i),[u,f,t,n.length>3?n[3]:1]},Ae=function(e){return 255*(e<=.00304?12.92*e:1.055*ee(e,1/2.4)-.055)},C=function(e){return e>r.t1?e*e*e:r.t2*(e-r.t0)},r={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},oe=function(){var e,n,r,t,f,a,u,c;return t=Ne(arguments),r=t[0],n=t[1],e=t[2],f=de(r,n,e),a=f[0],u=f[1],c=f[2],[116*u-16,500*(a-u),200*(u-c)]},he=function(e){return(e/=255)<=.04045?e/12.92:ee((e+.055)/1.055,2.4)},xe=function(e){return e>r.t3?ee(e,1/3):e/r.t2+r.t0},de=function(){var e,n,t,f,a,u,c;return f=Ne(arguments),t=f[0],n=f[1],e=f[2],t=he(t),n=he(n),e=he(e),a=xe((.4124564*t+.3575761*n+.1804375*e)/r.Xn),u=xe((.2126729*t+.7151522*n+.072175*e)/r.Yn),c=xe((.0193339*t+.119192*n+.9503041*e)/r.Zn),[a,u,c]},y.lab=function(){return function(e,n,r){r.prototype=e.prototype;var t=new r,f=e.apply(t,n);return Object(f)===f?f:t}(e,Oe.call(arguments).concat(["lab"]),function(){})},l.lab=V,e.prototype.lab=function(){return oe(this._rgb)},h=function(e){var n,r,t,f,a,u,c,o,i,l,s;return 2===(e=function(){var n,r,t;for(t=[],r=0,n=e.length;r<n;r++)f=e[r],t.push(y(f));return t}()).length?(i=function(){var n,r,t;for(t=[],r=0,n=e.length;r<n;r++)f=e[r],t.push(f.lab());return t}(),a=i[0],u=i[1],n=function(e){var n,r;return r=function(){var r,t;for(t=[],n=r=0;r<=2;n=++r)t.push(a[n]+e*(u[n]-a[n]));return t}(),y.lab.apply(y,r)}):3===e.length?(l=function(){var n,r,t;for(t=[],r=0,n=e.length;r<n;r++)f=e[r],t.push(f.lab());return t}(),a=l[0],u=l[1],c=l[2],n=function(e){var n,r;return r=function(){var r,t;for(t=[],n=r=0;r<=2;n=++r)t.push((1-e)*(1-e)*a[n]+2*(1-e)*e*u[n]+e*e*c[n]);return t}(),y.lab.apply(y,r)}):4===e.length?(s=function(){var n,r,t;for(t=[],r=0,n=e.length;r<n;r++)f=e[r],t.push(f.lab());return t}(),a=s[0],u=s[1],c=s[2],o=s[3],n=function(e){var n,r;return r=function(){var r,t;for(t=[],n=r=0;r<=2;n=++r)t.push((1-e)*(1-e)*(1-e)*a[n]+3*(1-e)*(1-e)*e*u[n]+3*(1-e)*e*e*c[n]+e*e*e*o[n]);return t}(),y.lab.apply(y,r)}):5===e.length&&(r=h(e.slice(0,3)),t=h(e.slice(2,5)),n=function(e){return e<.5?r(2*e):t(2*(e-.5))}),n},y.bezier=function(e){var n;return n=h(e),n.scale=function(){return y.scale(n)},n},y.cubehelix=function(e,n,r,t,f){var a,c,o;return null==e&&(e=300),null==n&&(n=-1.5),null==r&&(r=1),null==t&&(t=1),null==f&&(f=[0,1]),a=0,"array"===_e(f)?c=f[1]-f[0]:(c=0,f=[f,f]),o=function(o){var i,l,s,b,d,h,p,g,m;return i=u*((e+120)/360+n*o),p=ee(f[0]+c*o,t),h=0!==a?r[0]+o*a:r,l=h*p*(1-p)/2,b=_(i),m=ye(i),g=p+l*(-.14861*b+1.78277*m),d=p+l*(-.29227*b-.90649*m),s=p+l*(1.97294*b),y(w([255*g,255*d,255*s]))},o.start=function(n){return null==n?e:(e=n,o)},o.rotations=function(e){return null==e?n:(n=e,o)},o.gamma=function(e){return null==e?t:(t=e,o)},o.hue=function(e){return null==e?r:(r=e,"array"===_e(r)?0===(a=r[1]-r[0])&&(r=r[1]):a=0,o)},o.lightness=function(e){return null==e?f:("array"===_e(e)?(f=e,c=e[1]-e[0]):(f=[e,e],c=0),o)},o.scale=function(){return y.scale(o)},o.hue(r),o},y.random=function(){var n,r,t;for(r="0123456789abcdef",n="#",t=0;t<6;++t)n+=r.charAt(O(16*Math.random()));return new e(n)},s=[],y.interpolate=R=function(e,n,r,t){var f,a,u,c;for(null==r&&(r=.5),null==t&&(t="rgb"),"object"!==_e(e)&&(e=y(e)),"object"!==_e(n)&&(n=y(n)),u=0,a=s.length;u<a;u++)if(f=s[u],t===f[0]){c=f[1](e,n,r,t);break}if(null==c)throw"color mode "+t+" is not supported";return c.alpha(e.alpha()+r*(n.alpha()-e.alpha()))},e.prototype.interpolate=function(e,n,r){return R(this,e,n,r)},y.mix=R,e.prototype.mix=e.prototype.interpolate,l.rgb=function(){var e,n,r,t;n=Ne(arguments),r=[];for(e in n)t=n[e],r.push(t);return r},y.rgb=function(){return function(e,n,r){r.prototype=e.prototype;var t=new r,f=e.apply(t,n);return Object(f)===f?f:t}(e,Oe.call(arguments).concat(["rgb"]),function(){})},e.prototype.rgb=function(e){return null==e&&(e=!0),e?this._rgb.map(Math.round).slice(0,3):this._rgb.slice(0,3)},e.prototype.rgba=function(e){return null==e&&(e=!0),e?[Math.round(this._rgb[0]),Math.round(this._rgb[1]),Math.round(this._rgb[2]),this._rgb[3]]:this._rgb.slice(0)},o.push({p:3,test:function(e){var n;return n=Ne(arguments),"array"===_e(n)&&3===n.length?"rgb":4===n.length&&"number"===_e(n[3])&&n[3]>=0&&n[3]<=1?"rgb":void 0}}),l.lrgb=l.rgb,S=function(n,r,t,f){var a,u;return a=n._rgb,u=r._rgb,new e(we(ee(a[0],2)*(1-t)+ee(u[0],2)*t),we(ee(a[1],2)*(1-t)+ee(u[1],2)*t),we(ee(a[2],2)*(1-t)+ee(u[2],2)*t),f)},c=function(n){var r,t,f,a,u;for(r=1/n.length,u=[0,0,0,0],f=0,t=n.length;f<t;f++)a=n[f]._rgb,u[0]+=ee(a[0],2)*r,u[1]+=ee(a[1],2)*r,u[2]+=ee(a[2],2)*r,u[3]+=a[3]*r;return u[0]=we(u[0]),u[1]=we(u[1]),u[2]=we(u[2]),new e(u)},s.push(["lrgb",S]),y.average=function(e,n){var r,f,a,u,o,i,l,s,b,h,p,g,m;if(null==n&&(n="rgb"),b=e.length,e=e.map(function(e){return y(e)}),l=e.splice(0,1)[0],"lrgb"===n)return c(e);g=l.get(n),u=[],o=0,i=0;for(s in g)g[s]=g[s]||0,u.push(isNaN(g[s])?0:1),"h"!==n.charAt(s)||isNaN(g[s])||(r=g[s]/180*t,o+=_(r),i+=ye(r));for(f=l.alpha(),p=0,h=e.length;p<h;p++){m=(a=e[p]).get(n),f+=a.alpha();for(s in g)isNaN(m[s])||(g[s]+=m[s],u[s]+=1,"h"===n.charAt(s)&&(r=g[s]/180*t,o+=_(r),i+=ye(r)))}for(s in g)if(g[s]=g[s]/u[s],"h"===n.charAt(s)){for(r=d(i/u[s],o/u[s])/t*180;r<0;)r+=360;for(;r>=360;)r-=360;g[s]=r}return y(g,n).alpha(f/b)},q=function(e){var n,r,t,f,a,u;if(e.match(/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/))return 4!==e.length&&7!==e.length||(e=e.substr(1)),3===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]),u=parseInt(e,16),f=u>>16,t=u>>8&255,r=255&u,[f,t,r,1];if(e.match(/^#?([A-Fa-f0-9]{8})$/))return 9===e.length&&(e=e.substr(1)),u=parseInt(e,16),f=u>>24&255,t=u>>16&255,r=u>>8&255,n=ge((255&u)/255*100)/100,[f,t,r,n];if(null!=l.css&&(a=l.css(e)))return a;throw"unknown color: "+e},fe=function(e,n){var r,t,f,a,u,c,o;return null==n&&(n="rgb"),u=e[0],f=e[1],t=e[2],r=e[3],u=Math.round(u),f=Math.round(f),t=Math.round(t),o=u<<16|f<<8|t,c="000000"+o.toString(16),c=c.substr(c.length-6),a="0"+ge(255*r).toString(16),a=a.substr(a.length-2),"#"+function(){switch(n.toLowerCase()){case"rgba":return c+a;case"argb":return a+c;default:return c}}()},l.hex=function(e){return q(e)},y.hex=function(){return function(e,n,r){r.prototype=e.prototype;var t=new r,f=e.apply(t,n);return Object(f)===f?f:t}(e,Oe.call(arguments).concat(["hex"]),function(){})},e.prototype.hex=function(e){return null==e&&(e="rgb"),fe(this._rgb,e)},o.push({p:4,test:function(e){if(1===arguments.length&&"string"===_e(e))return"hex"}}),P=function(){var e,n,r,t,f,a,u,c,o,i,l,s,b,d;if(e=Ne(arguments),f=e[0],l=e[1],u=e[2],0===l)o=t=n=255*u;else{for(d=[0,0,0],r=[0,0,0],s=2*u-(b=u<.5?u*(1+l):u+l-u*l),f/=360,d[0]=f+1/3,d[1]=f,d[2]=f-1/3,a=c=0;c<=2;a=++c)d[a]<0&&(d[a]+=1),d[a]>1&&(d[a]-=1),6*d[a]<1?r[a]=s+6*(b-s)*d[a]:2*d[a]<1?r[a]=b:3*d[a]<2?r[a]=s+(b-s)*(2/3-d[a])*6:r[a]=s;o=(i=[ge(255*r[0]),ge(255*r[1]),ge(255*r[2])])[0],t=i[1],n=i[2]}return e.length>3?[o,t,n,e[3]]:[o,t,n]},ue=function(e,n,r){var t,f,a,u,c;return void 0!==e&&e.length>=3&&(e=(u=e)[0],n=u[1],r=u[2]),e/=255,n/=255,r/=255,a=Math.min(e,n,r),J=Math.max(e,n,r),f=(J+a)/2,J===a?(c=0,t=Number.NaN):c=f<.5?(J-a)/(J+a):(J-a)/(2-J-a),e===J?t=(n-r)/(J-a):n===J?t=2+(r-e)/(J-a):r===J&&(t=4+(e-n)/(J-a)),(t*=60)<0&&(t+=360),[t,c,f]},y.hsl=function(){return function(e,n,r){r.prototype=e.prototype;var t=new r,f=e.apply(t,n);return Object(f)===f?f:t}(e,Oe.call(arguments).concat(["hsl"]),function(){})},l.hsl=P,e.prototype.hsl=function(){return ue(this._rgb)},B=function(){var e,n,r,t,f,a,u,c,o,i,l,s,b,d,h,p,g,m;if(e=Ne(arguments),f=e[0],p=e[1],m=e[2],m*=255,0===p)o=t=n=m;else switch(360===f&&(f=0),f>360&&(f-=360),f<0&&(f+=360),f/=60,a=O(f),r=f-a,u=m*(1-p),c=m*(1-p*r),g=m*(1-p*(1-r)),a){case 0:o=(i=[m,g,u])[0],t=i[1],n=i[2];break;case 1:o=(l=[c,m,u])[0],t=l[1],n=l[2];break;case 2:o=(s=[u,m,g])[0],t=s[1],n=s[2];break;case 3:o=(b=[u,c,m])[0],t=b[1],n=b[2];break;case 4:o=(d=[g,u,m])[0],t=d[1],n=d[2];break;case 5:o=(h=[m,u,c])[0],t=h[1],n=h[2]}return[o,t,n,e.length>3?e[3]:1]},ce=function(){var e,n,r,t,f,a,u,c,o;return u=Ne(arguments),a=u[0],r=u[1],e=u[2],f=Math.min(a,r,e),J=Math.max(a,r,e),n=J-f,o=J/255,0===J?(t=Number.NaN,c=0):(c=n/J,a===J&&(t=(r-e)/n),r===J&&(t=2+(e-a)/n),e===J&&(t=4+(a-r)/n),(t*=60)<0&&(t+=360)),[t,c,o]},y.hsv=function(){return function(e,n,r){r.prototype=e.prototype;var t=new r,f=e.apply(t,n);return Object(f)===f?f:t}(e,Oe.call(arguments).concat(["hsv"]),function(){})},l.hsv=B,e.prototype.hsv=function(){return ce(this._rgb)},T=function(e){var n,r,t;return"number"===_e(e)&&e>=0&&e<=16777215?(t=e>>16,r=e>>8&255,n=255&e,[t,r,n,1]):[0,0,0,1]},se=function(){var e,n,r,t;return t=Ne(arguments),r=t[0],n=t[1],e=t[2],(r<<16)+(n<<8)+e},y.num=function(n){return new e(n,"num")},e.prototype.num=function(e){return null==e&&(e="rgb"),se(this._rgb,e)},l.num=T,o.push({p:1,test:function(e){if(1===arguments.length&&"number"===_e(e)&&e>=0&&e<=16777215)return"num"}}),j=function(){var e,n,r,t,f,a,u,c,o,i,l,s,b,d,h,p,g,m,v,y;if(r=Ne(arguments),c=r[0],f=r[1],n=r[2],f/=100,u=u/100*255,e=255*f,0===f)s=u=t=n;else switch(360===c&&(c=0),c>360&&(c-=360),c<0&&(c+=360),c/=60,o=O(c),a=c-o,i=n*(1-f),l=i+e*(1-a),v=i+e*a,y=i+e,o){case 0:s=(b=[y,v,i])[0],u=b[1],t=b[2];break;case 1:s=(d=[l,y,i])[0],u=d[1],t=d[2];break;case 2:s=(h=[i,y,v])[0],u=h[1],t=h[2];break;case 3:s=(p=[i,l,y])[0],u=p[1],t=p[2];break;case 4:s=(g=[v,i,y])[0],u=g[1],t=g[2];break;case 5:s=(m=[y,i,l])[0],u=m[1],t=m[2]}return[s,u,t,r.length>3?r[3]:1]},te=function(){var e,n,r,t,f,a,u,c,o;return o=Ne(arguments),c=o[0],f=o[1],n=o[2],u=Math.min(c,f,n),J=Math.max(c,f,n),t=J-u,r=100*t/255,e=u/(255-t)*100,0===t?a=Number.NaN:(c===J&&(a=(f-n)/t),f===J&&(a=2+(n-c)/t),n===J&&(a=4+(c-f)/t),(a*=60)<0&&(a+=360)),[a,r,e]},y.hcg=function(){return function(e,n,r){r.prototype=e.prototype;var t=new r,f=e.apply(t,n);return Object(f)===f?f:t}(e,Oe.call(arguments).concat(["hcg"]),function(){})},l.hcg=j,e.prototype.hcg=function(){return te(this._rgb)},N=function(e){var n,r,t,f,a,u,c,o;if(e=e.toLowerCase(),null!=y.colors&&y.colors[e])return q(y.colors[e]);if(a=e.match(/rgb\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*\)/)){for(c=a.slice(1,4),f=u=0;u<=2;f=++u)c[f]=+c[f];c[3]=1}else if(a=e.match(/rgba\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*,\s*([01]|[01]?\.\d+)\)/))for(c=a.slice(1,5),f=o=0;o<=3;f=++o)c[f]=+c[f];else if(a=e.match(/rgb\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/)){for(c=a.slice(1,4),f=n=0;n<=2;f=++n)c[f]=ge(2.55*c[f]);c[3]=1}else if(a=e.match(/rgba\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/)){for(c=a.slice(1,5),f=r=0;r<=2;f=++r)c[f]=ge(2.55*c[f]);c[3]=+c[3]}else(a=e.match(/hsl\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/))?((t=a.slice(1,4))[1]*=.01,t[2]*=.01,(c=P(t))[3]=1):(a=e.match(/hsla\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/))&&((t=a.slice(1,4))[1]*=.01,t[2]*=.01,(c=P(t))[3]=+a[4]);return c},re=function(e){var n;return"rgb"==(n=e[3]<1?"rgba":"rgb")?n+"("+e.slice(0,3).map(ge).join(",")+")":"rgba"===n?n+"("+e.slice(0,3).map(ge).join(",")+","+e[3]+")":void 0},pe=function(e){return ge(100*e)/100},L=function(e,n){var r;return r=n<1?"hsla":"hsl",e[0]=pe(e[0]||0),e[1]=pe(100*e[1])+"%",e[2]=pe(100*e[2])+"%","hsla"===r&&(e[3]=n),r+"("+e.join(",")+")"},l.css=function(e){return N(e)},y.css=function(){return function(e,n,r){r.prototype=e.prototype;var t=new r,f=e.apply(t,n);return Object(f)===f?f:t}(e,Oe.call(arguments).concat(["css"]),function(){})},e.prototype.css=function(e){return null==e&&(e="rgb"),"rgb"===e.slice(0,3)?re(this._rgb):"hsl"===e.slice(0,3)?L(this.hsl(),this.alpha()):void 0},l.named=function(e){return q(Me[e])},o.push({p:5,test:function(e){if(1===arguments.length&&null!=Me[e])return"named"}}),e.prototype.name=function(e){var n,r;arguments.length&&(Me[e]&&(this._rgb=q(Me[e])),this._rgb[3]=1),n=this.hex();for(r in Me)if(n===Me[r])return r;return n},F=function(){var e,r,t,f;return f=Ne(arguments),t=f[0],e=f[1],r=f[2],r*=n,[t,_(r)*e,ye(r)*e]},I=function(){var e,n,r,t,f,a,u,c,o,i,l;return r=Ne(arguments),c=r[0],f=r[1],u=r[2],i=F(c,f,u),e=i[0],n=i[1],t=i[2],l=V(e,n,t),o=l[0],a=l[1],t=l[2],[o,a,t,r.length>3?r[3]:1]},U=function(){var e,n,r,t,f,u;return u=Ne(arguments),f=u[0],e=u[1],n=u[2],r=we(e*e+n*n),t=(d(n,e)*a+360)%360,0===ge(1e4*r)&&(t=Number.NaN),[f,r,t]},ie=function(){var e,n,r,t,f,a,u;return a=Ne(arguments),f=a[0],r=a[1],n=a[2],u=oe(f,r,n),t=u[0],e=u[1],n=u[2],U(t,e,n)},y.lch=function(){var n;return n=Ne(arguments),new e(n,"lch")},y.hcl=function(){var n;return n=Ne(arguments),new e(n,"hcl")},l.lch=I,l.hcl=function(){var e,n,r,t;return t=Ne(arguments),n=t[0],e=t[1],r=t[2],I([r,e,n])},e.prototype.lch=function(){return ie(this._rgb)},e.prototype.hcl=function(){return ie(this._rgb).reverse()},ne=function(e){var n,r,t,f,a,u,c,o,i;return null==e&&(e="rgb"),o=Ne(arguments),c=o[0],f=o[1],n=o[2],c/=255,f/=255,n/=255,a=1-Math.max(c,Math.max(f,n)),t=a<1?1/(1-a):0,r=(1-c-a)*t,u=(1-f-a)*t,i=(1-n-a)*t,[r,u,i,a]},k=function(){var e,n,r,t,f,a,u,c,o;return n=Ne(arguments),t=n[0],u=n[1],o=n[2],a=n[3],e=n.length>4?n[4]:1,1===a?[0,0,0,e]:(c=t>=1?0:255*(1-t)*(1-a),f=u>=1?0:255*(1-u)*(1-a),r=o>=1?0:255*(1-o)*(1-a),[c,f,r,e])},l.cmyk=function(){return k(Ne(arguments))},y.cmyk=function(){return function(e,n,r){r.prototype=e.prototype;var t=new r,f=e.apply(t,n);return Object(f)===f?f:t}(e,Oe.call(arguments).concat(["cmyk"]),function(){})},e.prototype.cmyk=function(){return ne(this._rgb)},l.gl=function(){var e,n,r,t,f;for(t=function(){var e,r;e=Ne(arguments),r=[];for(n in e)f=e[n],r.push(f);return r}.apply(this,arguments),e=r=0;r<=2;e=++r)t[e]*=255;return t},y.gl=function(){return function(e,n,r){r.prototype=e.prototype;var t=new r,f=e.apply(t,n);return Object(f)===f?f:t}(e,Oe.call(arguments).concat(["gl"]),function(){})},e.prototype.gl=function(){var e;return e=this._rgb,[e[0]/255,e[1]/255,e[2]/255,e[3]]},le=function(e,n,r){var t;return t=Ne(arguments),e=t[0],n=t[1],r=t[2],e=$(e),n=$(n),r=$(r),.2126*e+.7152*n+.0722*r},$=function(e){return(e/=255)<=.03928?e/12.92:ee((e+.055)/1.055,2.4)},z=function(n,r,t,f){var a,u;return a=n._rgb,u=r._rgb,new e(a[0]+t*(u[0]-a[0]),a[1]+t*(u[1]-a[1]),a[2]+t*(u[2]-a[2]),f)},s.push(["rgb",z]),e.prototype.luminance=function(e,n){var r,t,f,a;return null==n&&(n="rgb"),arguments.length?(0===e?this._rgb=[0,0,0,this._rgb[3]]:1===e?this._rgb=[255,255,255,this._rgb[3]]:(t=1e-7,f=20,a=function(r,u){var c,o;return o=r.interpolate(u,.5,n),c=o.luminance(),Math.abs(e-c)<t||!f--?o:c>e?a(r,o):a(o,u)},r=le(this._rgb),this._rgb=(r>e?a(y("black"),this):a(this,y("white"))).rgba()),this):le(this._rgb)},ke=function(e){var n,r,t,f;return(f=e/100)<66?(t=255,r=-155.25485562709179-.44596950469579133*(r=f-2)+104.49216199393888*D(r),n=f<20?0:.8274096064007395*(n=f-10)-254.76935184120902+115.67994401066147*D(n)):(t=351.97690566805693+.114206453784165*(t=f-55)-40.25366309332127*D(t),r=325.4494125711974+.07943456536662342*(r=f-50)-28.0852963507957*D(r),n=255),[t,r,n]},be=function(){var e,n,r,t,f,a,u;for(t=(f=Ne(arguments))[0],f[1],e=f[2],r=1e3,n=4e4,.4;n-r>.4;)(a=ke(u=.5*(n+r)))[2]/a[0]>=e/t?n=u:r=u;return ge(u)},y.temperature=y.kelvin=function(){return function(e,n,r){r.prototype=e.prototype;var t=new r,f=e.apply(t,n);return Object(f)===f?f:t}(e,Oe.call(arguments).concat(["temperature"]),function(){})},l.temperature=l.kelvin=l.K=ke,e.prototype.temperature=function(){return be(this._rgb)},e.prototype.kelvin=e.prototype.temperature,y.contrast=function(n,r){var t,f,a,u;return"string"!==(a=_e(n))&&"number"!==a||(n=new e(n)),"string"!==(u=_e(r))&&"number"!==u||(r=new e(r)),t=n.luminance(),f=r.luminance(),t>f?(t+.05)/(f+.05):(f+.05)/(t+.05)},y.distance=function(n,r,t){var f,a,u,c,o,i,l;null==t&&(t="lab"),"string"!==(o=_e(n))&&"number"!==o||(n=new e(n)),"string"!==(i=_e(r))&&"number"!==i||(r=new e(r)),u=n.get(t),c=r.get(t),l=0;for(a in u)l+=(f=(u[a]||0)-(c[a]||0))*f;return Math.sqrt(l)},y.deltaE=function(n,r,f,a){var u,c,o,i,l,s,h,p,g,m,v,y,w,k,N,M,x,A,O,j,q,G,L,P,B,R,Y;for(null==f&&(f=1),null==a&&(a=1),"string"!==(x=_e(n))&&"number"!==x||(n=new e(n)),"string"!==(A=_e(r))&&"number"!==A||(r=new e(r)),u=(O=n.lab())[0],o=O[1],l=O[2],c=(j=r.lab())[0],i=j[1],s=j[2],h=we(o*o+l*l),p=we(i*i+s*s),L=u<16?.511:.040975*u/(1+.01765*u),q=.0638*h/(1+.0131*h)+.638,M=h<1e-6?0:180*d(l,o)/t;M<0;)M+=360;for(;M>=360;)M-=360;return P=M>=164&&M<=345?.56+b(.2*_(t*(M+168)/180)):.36+b(.4*_(t*(M+35)/180)),g=h*h*h*h,N=we(g/(g+1900)),G=q*(N*P+1-N),k=u-c,w=h-p,v=o-i,y=l-s,m=v*v+y*y-w*w,B=k/(f*L),R=w/(a*q),Y=G,we(B*B+R*R+m/(Y*Y))},e.prototype.get=function(e){var n,r,t,f,a;return this,f=e.split("."),t=f[0],n=f[1],a=this[t](),n?(r=t.indexOf(n))>-1?a[r]:void 0:a},e.prototype.set=function(e,n){var r,t,f,a,u;if(this,a=e.split("."),f=a[0],r=a[1]){if(u=this[f](),(t=f.indexOf(r))>-1)if("string"===_e(n))switch(n.charAt(0)){case"+":case"-":u[t]+=+n;break;case"*":u[t]*=+n.substr(1);break;case"/":u[t]/=+n.substr(1);break;default:u[t]=+n}else u[t]=n}else u=n;return y(u,f).alpha(this.alpha())},e.prototype.clipped=function(){return this._rgb._clipped||!1},e.prototype.alpha=function(e){return arguments.length?y.rgb([this._rgb[0],this._rgb[1],this._rgb[2],e]):this._rgb[3]},e.prototype.darken=function(e){var n;return null==e&&(e=1),this,n=this.lab(),n[0]-=r.Kn*e,y.lab(n).alpha(this.alpha())},e.prototype.brighten=function(e){return null==e&&(e=1),this.darken(-e)},e.prototype.darker=e.prototype.darken,e.prototype.brighter=e.prototype.brighten,e.prototype.saturate=function(e){var n;return null==e&&(e=1),this,n=this.lch(),n[1]+=e*r.Kn,n[1]<0&&(n[1]=0),y.lch(n).alpha(this.alpha())},e.prototype.desaturate=function(e){return null==e&&(e=1),this.saturate(-e)},e.prototype.premultiply=function(){var e,n;return n=this.rgb(),e=this.alpha(),y(n[0]*e,n[1]*e,n[2]*e,e)},Q=function(e,n){return e*n/255},M=function(e,n){return e>n?n:e},K=function(e,n){return e>n?e:n},ve=function(e,n){return 255*(1-(1-e/255)*(1-n/255))},W=function(e,n){return n<128?2*e*n/255:255*(1-2*(1-e/255)*(1-n/255))},v=function(e,n){return 255*(1-(1-n/255)/(e/255))},x=function(e,n){return 255===e?255:(e=n/255*255/(1-e/255))>255?255:e},(p=function(e,n,r){if(!p[r])throw"unknown blend mode "+r;return p[r](e,n)}).normal=(g=function(e){return function(n,r){var t,f;return t=y(r).rgb(),f=y(n).rgb(),y(e(t,f),"rgb")}})((A=function(e){return function(n,r){var t,f,a;for(a=[],t=f=0;f<=3;t=++f)a[t]=e(n[t],r[t]);return a}})(function(e,n){return e})),p.multiply=g(A(Q)),p.screen=g(A(ve)),p.overlay=g(A(W)),p.darken=g(A(M)),p.lighten=g(A(K)),p.dodge=g(A(x)),p.burn=g(A(v)),y.blend=p,y.analyze=function(e){var n,r,t,f;for(t={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0},r=0,n=e.length;r<n;r++)null==(f=e[r])||isNaN(f)||(t.values.push(f),t.sum+=f,f<t.min&&(t.min=f),f>t.max&&(t.max=f),t.count+=1);return t.domain=[t.min,t.max],t.limits=function(e,n){return y.limits(t,e,n)},t},y.scale=function(e,n){var r,t,f,a,u,c,o,i,l,s,b,d,h,p,g,m,v,w,k,_;return i="rgb",l=y("#ccc"),h=0,!1,u=[0,1],d=[],b=[0,0],r=!1,f=[],s=!1,o=0,c=1,a=!1,t={},p=!0,k=function(e){var n,r,t,a,u,c;if(null==e&&(e=["#fff","#000"]),null!=e&&"string"===_e(e)&&null!=y.brewer&&(e=y.brewer[e]||y.brewer[e.toLowerCase()]||e),"array"===_e(e)){for(n=t=0,a=(e=e.slice(0)).length-1;0<=a?t<=a:t>=a;n=0<=a?++t:--t)r=e[n],"string"===_e(r)&&(e[n]=y(r));for(d.length=0,n=c=0,u=e.length-1;0<=u?c<=u:c>=u;n=0<=u?++c:--c)d.push(n/(e.length-1))}return w(),f=e},m=function(e){var n,t;if(null!=r){for(t=r.length-1,n=0;n<t&&e>=r[n];)n++;return n-1}return 0},_=function(e){return e},function(e){var n,t,f,a,u;return u=e,r.length>2&&(a=r.length-1,n=m(e),f=r[0]+(r[1]-r[0])*(0+.5*h),t=r[a-1]+(r[a]-r[a-1])*(1-.5*h),u=o+(r[n]+.5*(r[n+1]-r[n])-f)/(t-f)*(c-o)),u},v=function(e,n){var a,u,s,h,g,v,w;if(null==n&&(n=!1),isNaN(e))return l;if(n?w=e:r&&r.length>2?(w=m(e)/(r.length-2),w=b[0]+w*(1-b[0]-b[1])):c!==o?(w=(e-o)/(c-o),w=b[0]+w*(1-b[0]-b[1]),w=Math.min(1,Math.max(0,w))):w=1,n||(w=_(w)),s=Math.floor(1e4*w),p&&t[s])a=t[s];else{if("array"===_e(f))for(u=h=0,v=d.length-1;0<=v?h<=v:h>=v;u=0<=v?++h:--h){if(g=d[u],w<=g){a=f[u];break}if(w>=g&&u===d.length-1){a=f[u];break}if(w>g&&w<d[u+1]){w=(w-g)/(d[u+1]-g),a=y.interpolate(f[u],f[u+1],w,i);break}}else"function"===_e(f)&&(a=f(w));p&&(t[s]=a)}return a},w=function(){return t={}},k(e),g=function(e){var n;return n=y(v(e)),s&&n[s]?n[s]():n},g.classes=function(e){var n;return null!=e?("array"===_e(e)?(r=e,u=[e[0],e[e.length-1]]):(n=y.analyze(u),r=0===e?[n.min,n.max]:y.limits(n,"e",e)),g):r},g.domain=function(e){var n,r,t,a,i,l,s;if(!arguments.length)return u;if(o=e[0],c=e[e.length-1],d=[],t=f.length,e.length===t&&o!==c)for(i=0,a=e.length;i<a;i++)r=e[i],d.push((r-o)/(c-o));else for(n=s=0,l=t-1;0<=l?s<=l:s>=l;n=0<=l?++s:--s)d.push(n/(t-1));return u=[o,c],g},g.mode=function(e){return arguments.length?(i=e,w(),g):i},g.range=function(e,n){return k(e),g},g.out=function(e){return s=e,g},g.spread=function(e){return arguments.length?(h=e,g):h},g.correctLightness=function(e){return null==e&&(e=!0),a=e,w(),_=a?function(e){var n,r,t,f,a,u,c,o,i;for(n=v(0,!0).lab()[0],r=v(1,!0).lab()[0],c=n>r,t=v(e,!0).lab()[0],f=t-(a=n+(r-n)*e),o=0,i=1,u=20;Math.abs(f)>.01&&u-- >0;)c&&(f*=-1),f<0?(o=e,e+=.5*(i-e)):(i=e,e+=.5*(o-e)),t=v(e,!0).lab()[0],f=t-a;return e}:function(e){return e},g},g.padding=function(e){return null!=e?("number"===_e(e)&&(e=[e,e]),b=e,g):b},g.colors=function(n,t){var a,c,o,i,l,s,b,d;if(arguments.length<2&&(t="hex"),l=[],0===arguments.length)l=f.slice(0);else if(1===n)l=[g(.5)];else if(n>1)c=u[0],a=u[1]-c,l=function(){s=[];for(var e=0;0<=n?e<n:e>n;0<=n?e++:e--)s.push(e);return s}.apply(this).map(function(e){return g(c+e/(n-1)*a)});else{if(e=[],b=[],r&&r.length>2)for(o=d=1,i=r.length;1<=i?d<i:d>i;o=1<=i?++d:--d)b.push(.5*(r[o-1]+r[o]));else b=u;l=b.map(function(e){return g(e)})}return y[t]&&(l=l.map(function(e){return e[t]()})),l},g.cache=function(e){return null!=e?p=e:p},g},null==y.scales&&(y.scales={}),y.scales.cool=function(){return y.scale([y.hsl(180,1,.9),y.hsl(250,.7,.4)])},y.scales.hot=function(){return y.scale(["#000","#f00","#ff0","#fff"],[0,.25,.75,1]).mode("rgb")},y.analyze=function(e,n,r){var t,f,a,u,c,o;if(c={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0},null==r&&(r=function(){return!0}),t=function(e){null==e||isNaN(e)||(c.values.push(e),c.sum+=e,e<c.min&&(c.min=e),e>c.max&&(c.max=e),c.count+=1)},o=function(e,f){if(r(e,f))return null!=n&&"function"===_e(n)?t(n(e)):null!=n&&"string"===_e(n)||"number"===_e(n)?t(e[n]):t(e)},"array"===_e(e))for(u=0,a=e.length;u<a;u++)o(e[u]);else for(f in e)o(e[f],f);return c.domain=[c.min,c.max],c.limits=function(e,n){return y.limits(c,e,n)},c},y.limits=function(e,n,r){var t,f,a,u,c,o,i,l,s,d,h,p,g,m,v,w,k,_,N,M,x,A,j,q,G,L,P,B,R,Y,E,S,X,z,U,V,C,F,I,K,Z,$,H,Q,T,W,ne,re,te,fe,ae,ue,ce,oe,ie;if(null==n&&(n="equal"),null==r&&(r=7),"array"===_e(e)&&(e=y.analyze(e)),G=e.min,J=e.max,e.sum,oe=e.values.sort(function(e,n){return e-n}),1===r)return[G,J];if(j=[],"c"===n.substr(0,1)&&(j.push(G),j.push(J)),"e"===n.substr(0,1)){for(j.push(G),M=E=1,U=r-1;1<=U?E<=U:E>=U;M=1<=U?++E:--E)j.push(G+M/r*(J-G));j.push(J)}else if("l"===n.substr(0,1)){if(G<=0)throw"Logarithmic scales are only possible for values > 0";for(L=Math.LOG10E*D(G),q=Math.LOG10E*D(J),j.push(G),M=ie=1,V=r-1;1<=V?ie<=V:ie>=V;M=1<=V?++ie:--ie)j.push(ee(10,L+M/r*(q-L)));j.push(J)}else if("q"===n.substr(0,1)){for(j.push(G),M=t=1,$=r-1;1<=$?t<=$:t>=$;M=1<=$?++t:--t)S=(oe.length-1)*M/r,(X=O(S))===S?j.push(oe[X]):(z=S-X,j.push(oe[X]*(1-z)+oe[X+1]*z));j.push(J)}else if("k"===n.substr(0,1)){for(B=oe.length,m=new Array(B),_=new Array(r),fe=!0,R=0,w=null,(w=[]).push(G),M=f=1,H=r-1;1<=H?f<=H:f>=H;M=1<=H?++f:--f)w.push(G+M/r*(J-G));for(w.push(J);fe;){for(x=a=0,Q=r-1;0<=Q?a<=Q:a>=Q;x=0<=Q?++a:--a)_[x]=0;for(M=u=0,T=B-1;0<=T?u<=T:u>=T;M=0<=T?++u:--u){for(ce=oe[M],P=Number.MAX_VALUE,x=c=0,W=r-1;0<=W?c<=W:c>=W;x=0<=W?++c:--c)(N=b(w[x]-ce))<P&&(P=N,v=x);_[v]++,m[M]=v}for(Y=new Array(r),x=o=0,ne=r-1;0<=ne?o<=ne:o>=ne;x=0<=ne?++o:--o)Y[x]=null;for(M=i=0,re=B-1;0<=re?i<=re:i>=re;M=0<=re?++i:--i)null===Y[k=m[M]]?Y[k]=oe[M]:Y[k]+=oe[M];for(x=l=0,te=r-1;0<=te?l<=te:l>=te;x=0<=te?++l:--l)Y[x]*=1/_[x];for(fe=!1,x=s=0,C=r-1;0<=C?s<=C:s>=C;x=0<=C?++s:--s)if(Y[x]!==w[M]){fe=!0;break}w=Y,++R>200&&(fe=!1)}for(A={},x=d=0,F=r-1;0<=F?d<=F:d>=F;x=0<=F?++d:--d)A[x]=[];for(M=h=0,I=B-1;0<=I?h<=I:h>=I;M=0<=I?++h:--h)A[k=m[M]].push(oe[M]);for(ae=[],x=p=0,K=r-1;0<=K?p<=K:p>=K;x=0<=K?++p:--p)ae.push(A[x][0]),ae.push(A[x][A[x].length-1]);for(ae=ae.sort(function(e,n){return e-n}),j.push(ae[0]),M=g=1,Z=ae.length-1;g<=Z;M=g+=2)ue=ae[M],isNaN(ue)||-1!==j.indexOf(ue)||j.push(ue)}return j},G=function(e,n,r){var t,a,c,o;return t=Ne(arguments),e=t[0],n=t[1],r=t[2],isNaN(e)&&(e=0),(e/=360)<1/3?c=1-((a=(1-n)/3)+(o=(1+n*_(u*e)/_(f-u*e))/3)):e<2/3?a=1-((o=(1-n)/3)+(c=(1+n*_(u*(e-=1/3))/_(f-u*e))/3)):o=1-((c=(1-n)/3)+(a=(1+n*_(u*(e-=2/3))/_(f-u*e))/3)),o=Z(r*o*3),c=Z(r*c*3),a=Z(r*a*3),[255*o,255*c,255*a,t.length>3?t[3]:1]},ae=function(){var e,n,r,t,f,a,c,o;return c=Ne(arguments),a=c[0],n=c[1],e=c[2],u=2*Math.PI,a/=255,n/=255,e/=255,f=Math.min(a,n,e),t=(a+n+e)/3,0===(o=1-f/t)?r=0:(r=(a-n+(a-e))/2,r/=Math.sqrt((a-n)*(a-n)+(a-e)*(n-e)),r=Math.acos(r),e>n&&(r=u-r),r/=u),[360*r,o,t]},y.hsi=function(){return function(e,n,r){r.prototype=e.prototype;var t=new r,f=e.apply(t,n);return Object(f)===f?f:t}(e,Oe.call(arguments).concat(["hsi"]),function(){})},l.hsi=G,e.prototype.hsi=function(){return ae(this._rgb)},Y=function(e,n,r,t){var f,a,u,c,o,i,l,s,b,d,h;return"hsl"===t?(d=e.hsl(),h=n.hsl()):"hsv"===t?(d=e.hsv(),h=n.hsv()):"hcg"===t?(d=e.hcg(),h=n.hcg()):"hsi"===t?(d=e.hsi(),h=n.hsi()):"lch"!==t&&"hcl"!==t||(t="hcl",d=e.hcl(),h=n.hcl()),"h"===t.substr(0,1)&&(a=d[0],s=d[1],o=d[2],u=h[0],b=h[1],i=h[2]),isNaN(a)||isNaN(u)?isNaN(a)?isNaN(u)?f=Number.NaN:(f=u,1!==o&&0!==o||"hsv"===t||(l=b)):(f=a,1!==i&&0!==i||"hsv"===t||(l=s)):f=a+r*(u>a&&u-a>180?u-(a+360):u<a&&a-u>180?u+360-a:u-a),null==l&&(l=s+r*(b-s)),c=o+r*(i-o),y[t](f,l,c)},X=function(e,n,r,t){var f,a;return f=e.num(),a=n.num(),y.num(f+(a-f)*r,"num")},(s=s.concat(function(){var e,n,r,t;for(t=[],n=0,e=(r=["hsv","hsl","hsi","hcl","lch","hcg"]).length;n<e;n++)H=r[n],t.push([H,Y]);return t}())).push(["num",X]),E=function(n,r,t,f){var a,u;return a=n.lab(),u=r.lab(),new e(a[0]+t*(u[0]-a[0]),a[1]+t*(u[1]-a[1]),a[2]+t*(u[2]-a[2]),f)},s.push(["lab",E])}).call(this);
  },{}],48:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const n=exports.baseVertSrc="\nprecision mediump float;\nattribute vec4 position;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvoid main() {\n    gl_Position = projectionMatrix * viewMatrix * modelMatrix * position;\n}\n",t=exports.baseFragSrc="\nprecision mediump float;\nuniform vec3 uColor;\n\nvoid main(){\n    gl_FragColor = vec4(uColor, 1.0);\n}\n",i=exports.axisVertSrc="\nattribute float rate;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nuniform vec3 uStartPosition;\nuniform vec3 uDir;\nuniform float uLength;\n\nvoid main() {\n\tvec4 targetPos = vec4(uStartPosition + uDir * rate * uLength, 1.0);\n    gl_Position = projectionMatrix * viewMatrix * modelMatrix * targetPos;\n}\n";
  },{}],47:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GridHelper=void 0;var i=require("tubugl-2d-shape"),r=require("tubugl-core"),t=require("tubugl-constants"),s=require("gl-matrix"),e=require("./shaders/gridhelper.shader");const a=require("chroma-js");class o extends i.Plane{constructor(i,r=100,t=100,s=1,e=1,o={}){o.isWire=!0,super(i,r,t,s,e,o),this.visible=!0,this.rotation.x=Math.PI/2,this._color=o.color?o.color:"#ffffff",this._glColor=a(this._color).gl(),this._makeAxis(o)}updateColor(i){this._color=i,this._glColor=a(this._color).gl()}render(i){this.visible&&(this._updateModelMatrix(),this.updateWire(i).drawWireframe(),this.updateAxis(i).drawAxis(-this._width/2,-this._height/2).drawAxis(this._width/2,this._height/2))}updateWire(i){return super.updateWire(i),this._gl.uniform3f(this._wireframeProgram.getUniforms("uColor").location,this._glColor[0],this._glColor[1],this._glColor[2]),this}updateAxis(i){return this._axisProgram.bind(),this._axisRateBuffer.bind().attribPointer(this._axisProgram),this._gl.uniformMatrix4fv(this._axisProgram.getUniforms("modelMatrix").location,!1,this._axisModelMat),this._gl.uniformMatrix4fv(this._axisProgram.getUniforms("viewMatrix").location,!1,i.viewMatrix),this._gl.uniformMatrix4fv(this._axisProgram.getUniforms("projectionMatrix").location,!1,i.projectionMatrix),this._gl.uniform1f(this._axisProgram.getUniforms("uLength").location,this._axisSize),this}drawAxis(i=0,r){return this._gl.uniform3f(this._axisProgram.getUniforms("uStartPosition").location,i,2,r),[[1,0,0],[0,1,0],[0,0,1]].forEach(i=>{this._gl.uniform3f(this._axisProgram.getUniforms("uDir").location,i[0],i[1],i[2]),this._gl.uniform3f(this._axisProgram.getUniforms("uColor").location,i[0],i[1],i[2]),this._gl.drawArrays(t.LINES,0,this._axisCnt)}),this}addGui(i){i.addFolder("gridHelper").add(this,"visible")}_makeWireframe(){this._wireframeProgram=new r.Program(this._gl,e.baseVertSrc,e.baseFragSrc)}_makeAxis(i){this._axisProgram=new r.Program(this._gl,e.axisVertSrc,e.baseFragSrc),this._axisRateBuffer=new r.ArrayBuffer(this._gl,new Float32Array([0,1])),this._axisRateBuffer.setAttribs("rate",1),this._axisCnt=2,this._axisSize=i.axisSize?i.axisSize:150,this._axisModelMat=s.mat4.create()}}exports.GridHelper=o;
  },{"tubugl-2d-shape":49,"chroma-js":51,"tubugl-core":12,"tubugl-constants":14,"gl-matrix":34,"./shaders/gridhelper.shader":48}],29:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./src/normalHelper");Object.defineProperty(exports,"NormalHelper",{enumerable:!0,get:function(){return e.NormalHelper}});var r=require("./src/gridHelper");Object.defineProperty(exports,"GridHelper",{enumerable:!0,get:function(){return r.GridHelper}});
  },{"./src/normalHelper":46,"./src/gridHelper":47}],33:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PerspectiveCamera=void 0;var t=require("gl-matrix/src/gl-matrix");const i=require("wolfy87-eventemitter");class e extends i{constructor(i=window.innerWidth,e=window.innerHeight,o=60,r=1,a=1e3){super(),this._position=new Float32Array([0,0,0]),this._rotation=new Float32Array([0,0,0]),this._fov=o,this._width=i,this._height=e,this._near=r,this._far=a,this.viewMatrix=t.mat4.create(),this.projectionMatrix=t.mat4.create(),this._updateViewMatrix(),this._updateProjectionMatrix()}update(){return this._updateViewMatrix(),this}setPosition(t,i,e){this.updatePosition(t,i,e)}updatePosition(t,i,e){return void 0!==t&&(this._position[0]=t),void 0!==i&&(this._position[1]=i),void 0!==e&&(this._position[2]=e),this}setRotation(t,i,e){this.updateRotation(t,i,e)}updateRotation(t,i,e){return void 0!==t&&(this._rotation[0]=t),void 0!==i&&(this._rotation[1]=i),void 0!==e&&(this._rotation[2]=e),this}lookAt(i){return t.mat4.lookAt(this.viewMatrix,this._position,i,[0,1,0]),this}log(){}updateSize(t,i){this._width=t,this._height=i,this._updateProjectionMatrix()}updateFov(t){this._fov=t,this._updateProjectionMatrix()}updateDistance(t,i){t&&(this._near=t),i&&(this._far=i),this._updateProjectionMatrix()}_updateProjectionMatrix(){t.mat4.perspective(this.projectionMatrix,this._fov/180*Math.PI,this._width/this._height,this._near,this._far)}_updateViewMatrix(){return t.mat4.fromTranslation(this.viewMatrix,this._position),t.mat4.rotateX(this.viewMatrix,this.viewMatrix,this._rotation[0]),t.mat4.rotateX(this.viewMatrix,this.viewMatrix,this._rotation[1]),t.mat4.rotateX(this.viewMatrix,this.viewMatrix,this._rotation[2]),this}}exports.PerspectiveCamera=e;
  },{"wolfy87-eventemitter":13,"gl-matrix/src/gl-matrix":34}],30:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./src/perspectiveCamera");Object.defineProperty(exports,"PerspectiveCamera",{enumerable:!0,get:function(){return e.PerspectiveCamera}});
  },{"./src/perspectiveCamera":33}],5:[function(require,module,exports) {
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tubugl-constants"),i=require("../../index"),e=require("tubugl-helper"),s=require("tubugl-camera");const h=require("dat.gui/build/dat.gui.min"),a=require("gsap/TweenLite"),r=require("stats.js");class o{constructor(t={}){this._isMouseDown=!1,this._isPlaneAnimation=!1,this._width=t.width?t.width:window.innerWidth,this._height=t.height?t.height:window.innerHeight,this.canvas=document.createElement("canvas"),this.gl=this.canvas.getContext("webgl"),this._setClear(),this._makeBox(),this._makeHelper(),this._makeCamera(),this.resize(this._width,this._height),t.isDebug&&(this.stats=new r,document.body.appendChild(this.stats.dom),this._addGui())}animateIn(){this.isLoop=!0,a.ticker.addEventListener("tick",this.loop,this)}loop(){this.stats&&this.stats.update();let t=this.gl;t.viewport(0,0,this._width,this._height),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this._camera.updatePosition(this._camera.rad*Math.sin(this._camera.theta)*Math.cos(this._camera.phi),this._camera.rad*Math.sin(this._camera.phi),this._camera.rad*Math.cos(this._camera.theta)*Math.cos(this._camera.phi)).lookAt([0,0,0]),this._box.render(this._camera),this._normalHelper.render(this._camera)}animateOut(){a.ticker.removeEventListener("tick",this.loop,this)}mouseMoveHandler(t){if(!this._isMouseDown)return;const i=2*Math.PI;this._camera.theta+=(t.x-this._prevMouse.x)*-i,this._camera.phi+=(t.y-this._prevMouse.y)*-i,this._prevMouse=t}mouseDownHandler(t){this._isMouseDown=!0,this._prevMouse=t}mouseupHandler(){this._isMouseDown=!1}onKeyDown(t){switch(t.which){case 27:this._playAndStop()}}_playAndStop(){this.isLoop=!this.isLoop,this.isLoop?(a.ticker.addEventListener("tick",this.loop,this),this.playAndStopGui.name("pause")):(a.ticker.removeEventListener("tick",this.loop,this),this.playAndStopGui.name("play"))}resize(t,i){this._width=t,this._height=i,this.canvas.width=this._width,this.canvas.height=this._height,this.gl.viewport(0,0,this._width,this._height),this._box.resize(this._width,this._height)}destroy(){}_setClear(){this.gl.clearColor(0,0,0,1),this.gl.enable(t.DEPTH_TEST)}_makeBox(){this._box=new i.ProceduralRoundingCube(this.gl,300,300,300,100,10,10,10,{isWire:!0})}_makeHelper(){this._normalHelper=new e.NormalHelper(this.gl,this._box)}_makeCamera(){this._camera=new s.PerspectiveCamera(window.innerWidth,window.innerHeight,60,1,2e3),this._camera.theta=0,this._camera.phi=0,this._camera.rad=800}_addGui(){this.gui=new h.GUI,this.playAndStopGui=this.gui.add(this,"_playAndStop").name("pause"),this._boxGUIFolder=this.gui.addFolder("rounding  cube"),this._box.addGui(this._boxGUIFolder),this._boxGUIFolder.open()}}exports.default=o;
  },{"dat.gui/build/dat.gui.min":45,"gsap/TweenLite":44,"stats.js":28,"tubugl-constants":14,"../../index":6,"tubugl-helper":29,"tubugl-camera":30}],4:[function(require,module,exports) {
  "use strict";function n(n){return n&&n.__esModule?n:{default:n}}function e(){r=new a.default({isDebug:!1}),document.body.appendChild(r.canvas),r.canvas.addEventListener("mousemove",t,!1),r.canvas.addEventListener("mousedown",d,!1),r.canvas.addEventListener("mouseup",o,!1)}function i(){r.animateIn()}function t(n){let e=n.clientX/window.innerWidth*2-1,i=-n.clientY/window.innerHeight*2+1;r.mouseMoveHandler({x:e,y:i})}function d(n){let e=n.clientX/window.innerWidth*2-1,i=-n.clientY/window.innerHeight*2+1;r.mouseDownHandler({x:e,y:i})}function o(){r.mouseupHandler()}var u=require("./index"),a=n(u);let r;e(),i(),window.addEventListener("resize",function(){r.resize(window.innerWidth,window.innerHeight)}),window.addEventListener("keydown",function(n){r.onKeyDown(n)});
  },{"./index":5}]},{},[4])