-
Notifications
You must be signed in to change notification settings - Fork 6
/
reveal-leap-motion.min.js
18 lines (18 loc) · 88.8 KB
/
reveal-leap-motion.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*!
* reveal-leap-motion v1.1.0
* https://github.com/gneatgeek/reveal-leap-motion
*
* Copyright 2016 Rory Hardy, James Sun, and other contributors
* Released under the Apache-2.0 license
* https://github.com/gneatgeek/reveal-leap-motion/blob/master/LICENSE
*
* ===================================================================
*
* LeapJS v0.6.4
* http://github.com/leapmotion/leapjs/
*
* Copyright 2013 LeapMotion, Inc. and other contributors
* Released under the Apache-2.0 license
* http://github.com/leapmotion/leapjs/blob/master/LICENSE.txt
*/
!function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=34)}([function(t,e,n){(function(){var n=this,r=n._,i={},o=Array.prototype,s=Object.prototype,a=Function.prototype,u=o.push,c=o.slice,l=o.concat,h=s.toString,p=s.hasOwnProperty,f=o.forEach,d=o.map,v=o.reduce,m=o.reduceRight,y=o.filter,g=o.every,b=o.some,w=o.indexOf,x=o.lastIndexOf,M=Array.isArray,_=Object.keys,j=a.bind,S=function(t){return t instanceof S?t:this instanceof S?void(this._wrapped=t):new S(t)};void 0!==t&&t.exports&&(e=t.exports=S),e._=S,S.VERSION="1.4.4";var P=S.each=S.forEach=function(t,e,n){if(null!=t)if(f&&t.forEach===f)t.forEach(e,n);else if(t.length===+t.length){for(var r=0,o=t.length;r<o;r++)if(e.call(n,t[r],r,t)===i)return}else for(var s in t)if(S.has(t,s)&&e.call(n,t[s],s,t)===i)return};S.map=S.collect=function(t,e,n){var r=[];return null==t?r:d&&t.map===d?t.map(e,n):(P(t,function(t,i,o){r[r.length]=e.call(n,t,i,o)}),r)};var F="Reduce of empty array with no initial value";S.reduce=S.foldl=S.inject=function(t,e,n,r){var i=arguments.length>2;if(null==t&&(t=[]),v&&t.reduce===v)return r&&(e=S.bind(e,r)),i?t.reduce(e,n):t.reduce(e);if(P(t,function(t,o,s){i?n=e.call(r,n,t,o,s):(n=t,i=!0)}),!i)throw new TypeError(F);return n},S.reduceRight=S.foldr=function(t,e,n,r){var i=arguments.length>2;if(null==t&&(t=[]),m&&t.reduceRight===m)return r&&(e=S.bind(e,r)),i?t.reduceRight(e,n):t.reduceRight(e);var o=t.length;if(o!==+o){var s=S.keys(t);o=s.length}if(P(t,function(a,u,c){u=s?s[--o]:--o,i?n=e.call(r,n,t[u],u,c):(n=t[u],i=!0)}),!i)throw new TypeError(F);return n},S.find=S.detect=function(t,e,n){var r;return O(t,function(t,i,o){if(e.call(n,t,i,o))return r=t,!0}),r},S.filter=S.select=function(t,e,n){var r=[];return null==t?r:y&&t.filter===y?t.filter(e,n):(P(t,function(t,i,o){e.call(n,t,i,o)&&(r[r.length]=t)}),r)},S.reject=function(t,e,n){return S.filter(t,function(t,r,i){return!e.call(n,t,r,i)},n)},S.every=S.all=function(t,e,n){e||(e=S.identity);var r=!0;return null==t?r:g&&t.every===g?t.every(e,n):(P(t,function(t,o,s){if(!(r=r&&e.call(n,t,o,s)))return i}),!!r)};var O=S.some=S.any=function(t,e,n){e||(e=S.identity);var r=!1;return null==t?r:b&&t.some===b?t.some(e,n):(P(t,function(t,o,s){if(r||(r=e.call(n,t,o,s)))return i}),!!r)};S.contains=S.include=function(t,e){return null!=t&&(w&&t.indexOf===w?-1!=t.indexOf(e):O(t,function(t){return t===e}))},S.invoke=function(t,e){var n=c.call(arguments,2),r=S.isFunction(e);return S.map(t,function(t){return(r?e:t[e]).apply(t,n)})},S.pluck=function(t,e){return S.map(t,function(t){return t[e]})},S.where=function(t,e,n){return S.isEmpty(e)?n?null:[]:S[n?"find":"filter"](t,function(t){for(var n in e)if(e[n]!==t[n])return!1;return!0})},S.findWhere=function(t,e){return S.where(t,e,!0)},S.max=function(t,e,n){if(!e&&S.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.max.apply(Math,t);if(!e&&S.isEmpty(t))return-1/0;var r={computed:-1/0,value:-1/0};return P(t,function(t,i,o){var s=e?e.call(n,t,i,o):t;s>=r.computed&&(r={value:t,computed:s})}),r.value},S.min=function(t,e,n){if(!e&&S.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.min.apply(Math,t);if(!e&&S.isEmpty(t))return 1/0;var r={computed:1/0,value:1/0};return P(t,function(t,i,o){var s=e?e.call(n,t,i,o):t;s<r.computed&&(r={value:t,computed:s})}),r.value},S.shuffle=function(t){var e,n=0,r=[];return P(t,function(t){e=S.random(n++),r[n-1]=r[e],r[e]=t}),r};var E=function(t){return S.isFunction(t)?t:function(e){return e[t]}};S.sortBy=function(t,e,n){var r=E(e);return S.pluck(S.map(t,function(t,e,i){return{value:t,index:e,criteria:r.call(n,t,e,i)}}).sort(function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return t.index<e.index?-1:1}),"value")};var k=function(t,e,n,r){var i={},o=E(e||S.identity);return P(t,function(e,s){var a=o.call(n,e,s,t);r(i,a,e)}),i};S.groupBy=function(t,e,n){return k(t,e,n,function(t,e,n){(S.has(t,e)?t[e]:t[e]=[]).push(n)})},S.countBy=function(t,e,n){return k(t,e,n,function(t,e){S.has(t,e)||(t[e]=0),t[e]++})},S.sortedIndex=function(t,e,n,r){n=null==n?S.identity:E(n);for(var i=n.call(r,e),o=0,s=t.length;o<s;){var a=o+s>>>1;n.call(r,t[a])<i?o=a+1:s=a}return o},S.toArray=function(t){return t?S.isArray(t)?c.call(t):t.length===+t.length?S.map(t,S.identity):S.values(t):[]},S.size=function(t){return null==t?0:t.length===+t.length?t.length:S.keys(t).length},S.first=S.head=S.take=function(t,e,n){if(null!=t)return null==e||n?t[0]:c.call(t,0,e)},S.initial=function(t,e,n){return c.call(t,0,t.length-(null==e||n?1:e))},S.last=function(t,e,n){if(null!=t)return null==e||n?t[t.length-1]:c.call(t,Math.max(t.length-e,0))},S.rest=S.tail=S.drop=function(t,e,n){return c.call(t,null==e||n?1:e)},S.compact=function(t){return S.filter(t,S.identity)};var A=function(t,e,n){return P(t,function(t){S.isArray(t)?e?u.apply(n,t):A(t,e,n):n.push(t)}),n};S.flatten=function(t,e){return A(t,e,[])},S.without=function(t){return S.difference(t,c.call(arguments,1))},S.uniq=S.unique=function(t,e,n,r){S.isFunction(e)&&(r=n,n=e,e=!1);var i=n?S.map(t,n,r):t,o=[],s=[];return P(i,function(n,r){(e?r&&s[s.length-1]===n:S.contains(s,n))||(s.push(n),o.push(t[r]))}),o},S.union=function(){return S.uniq(l.apply(o,arguments))},S.intersection=function(t){var e=c.call(arguments,1);return S.filter(S.uniq(t),function(t){return S.every(e,function(e){return S.indexOf(e,t)>=0})})},S.difference=function(t){var e=l.apply(o,c.call(arguments,1));return S.filter(t,function(t){return!S.contains(e,t)})},S.zip=function(){for(var t=c.call(arguments),e=S.max(S.pluck(t,"length")),n=new Array(e),r=0;r<e;r++)n[r]=S.pluck(t,""+r);return n},S.object=function(t,e){if(null==t)return{};for(var n={},r=0,i=t.length;r<i;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n},S.indexOf=function(t,e,n){if(null==t)return-1;var r=0,i=t.length;if(n){if("number"!=typeof n)return r=S.sortedIndex(t,e),t[r]===e?r:-1;r=n<0?Math.max(0,i+n):n}if(w&&t.indexOf===w)return t.indexOf(e,n);for(;r<i;r++)if(t[r]===e)return r;return-1},S.lastIndexOf=function(t,e,n){if(null==t)return-1;var r=null!=n;if(x&&t.lastIndexOf===x)return r?t.lastIndexOf(e,n):t.lastIndexOf(e);for(var i=r?n:t.length;i--;)if(t[i]===e)return i;return-1},S.range=function(t,e,n){arguments.length<=1&&(e=t||0,t=0),n=arguments[2]||1;for(var r=Math.max(Math.ceil((e-t)/n),0),i=0,o=new Array(r);i<r;)o[i++]=t,t+=n;return o},S.bind=function(t,e){if(t.bind===j&&j)return j.apply(t,c.call(arguments,1));var n=c.call(arguments,2);return function(){return t.apply(e,n.concat(c.call(arguments)))}},S.partial=function(t){var e=c.call(arguments,1);return function(){return t.apply(this,e.concat(c.call(arguments)))}},S.bindAll=function(t){var e=c.call(arguments,1);return 0===e.length&&(e=S.functions(t)),P(e,function(e){t[e]=S.bind(t[e],t)}),t},S.memoize=function(t,e){var n={};return e||(e=S.identity),function(){var r=e.apply(this,arguments);return S.has(n,r)?n[r]:n[r]=t.apply(this,arguments)}},S.delay=function(t,e){var n=c.call(arguments,2);return setTimeout(function(){return t.apply(null,n)},e)},S.defer=function(t){return S.delay.apply(S,[t,1].concat(c.call(arguments,1)))},S.throttle=function(t,e){var n,r,i,o,s=0,a=function(){s=new Date,i=null,o=t.apply(n,r)};return function(){var u=new Date,c=e-(u-s);return n=this,r=arguments,c<=0?(clearTimeout(i),i=null,s=u,o=t.apply(n,r)):i||(i=setTimeout(a,c)),o}},S.debounce=function(t,e,n){var r,i;return function(){var o=this,s=arguments,a=function(){r=null,n||(i=t.apply(o,s))},u=n&&!r;return clearTimeout(r),r=setTimeout(a,e),u&&(i=t.apply(o,s)),i}},S.once=function(t){var e,n=!1;return function(){return n?e:(n=!0,e=t.apply(this,arguments),t=null,e)}},S.wrap=function(t,e){return function(){var n=[t];return u.apply(n,arguments),e.apply(this,n)}},S.compose=function(){var t=arguments;return function(){for(var e=arguments,n=t.length-1;n>=0;n--)e=[t[n].apply(this,e)];return e[0]}},S.after=function(t,e){return t<=0?e():function(){if(--t<1)return e.apply(this,arguments)}},S.keys=_||function(t){if(t!==Object(t))throw new TypeError("Invalid object");var e=[];for(var n in t)S.has(t,n)&&(e[e.length]=n);return e},S.values=function(t){var e=[];for(var n in t)S.has(t,n)&&e.push(t[n]);return e},S.pairs=function(t){var e=[];for(var n in t)S.has(t,n)&&e.push([n,t[n]]);return e},S.invert=function(t){var e={};for(var n in t)S.has(t,n)&&(e[t[n]]=n);return e},S.functions=S.methods=function(t){var e=[];for(var n in t)S.isFunction(t[n])&&e.push(n);return e.sort()},S.extend=function(t){return P(c.call(arguments,1),function(e){if(e)for(var n in e)t[n]=e[n]}),t},S.pick=function(t){var e={},n=l.apply(o,c.call(arguments,1));return P(n,function(n){n in t&&(e[n]=t[n])}),e},S.omit=function(t){var e={},n=l.apply(o,c.call(arguments,1));for(var r in t)S.contains(n,r)||(e[r]=t[r]);return e},S.defaults=function(t){return P(c.call(arguments,1),function(e){if(e)for(var n in e)null==t[n]&&(t[n]=e[n])}),t},S.clone=function(t){return S.isObject(t)?S.isArray(t)?t.slice():S.extend({},t):t},S.tap=function(t,e){return e(t),t};var z=function(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;t instanceof S&&(t=t._wrapped),e instanceof S&&(e=e._wrapped);var i=h.call(t);if(i!=h.call(e))return!1;switch(i){case"[object String]":return t==String(e);case"[object Number]":return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object RegExp]":return t.source==e.source&&t.global==e.global&&t.multiline==e.multiline&&t.ignoreCase==e.ignoreCase}if("object"!=typeof t||"object"!=typeof e)return!1;for(var o=n.length;o--;)if(n[o]==t)return r[o]==e;n.push(t),r.push(e);var s=0,a=!0;if("[object Array]"==i){if(s=t.length,a=s==e.length)for(;s--&&(a=z(t[s],e[s],n,r)););}else{var u=t.constructor,c=e.constructor;if(u!==c&&!(S.isFunction(u)&&u instanceof u&&S.isFunction(c)&&c instanceof c))return!1;for(var l in t)if(S.has(t,l)&&(s++,!(a=S.has(e,l)&&z(t[l],e[l],n,r))))break;if(a){for(l in e)if(S.has(e,l)&&!s--)break;a=!s}}return n.pop(),r.pop(),a};S.isEqual=function(t,e){return z(t,e,[],[])},S.isEmpty=function(t){if(null==t)return!0;if(S.isArray(t)||S.isString(t))return 0===t.length;for(var e in t)if(S.has(t,e))return!1;return!0},S.isElement=function(t){return!(!t||1!==t.nodeType)},S.isArray=M||function(t){return"[object Array]"==h.call(t)},S.isObject=function(t){return t===Object(t)},P(["Arguments","Function","String","Number","Date","RegExp"],function(t){S["is"+t]=function(e){return h.call(e)=="[object "+t+"]"}}),S.isArguments(arguments)||(S.isArguments=function(t){return!(!t||!S.has(t,"callee"))}),S.isFunction=function(t){return"function"==typeof t},S.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},S.isNaN=function(t){return S.isNumber(t)&&t!=+t},S.isBoolean=function(t){return!0===t||!1===t||"[object Boolean]"==h.call(t)},S.isNull=function(t){return null===t},S.isUndefined=function(t){return void 0===t},S.has=function(t,e){return p.call(t,e)},S.noConflict=function(){return n._=r,this},S.identity=function(t){return t},S.times=function(t,e,n){for(var r=Array(t),i=0;i<t;i++)r[i]=e.call(n,i);return r},S.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))};var L={escape:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}};L.unescape=S.invert(L.escape);var I={escape:new RegExp("["+S.keys(L.escape).join("")+"]","g"),unescape:new RegExp("("+S.keys(L.unescape).join("|")+")","g")};S.each(["escape","unescape"],function(t){S[t]=function(e){return null==e?"":(""+e).replace(I[t],function(e){return L[t][e]})}}),S.result=function(t,e){if(null==t)return null;var n=t[e];return S.isFunction(n)?n.call(t):n},S.mixin=function(t){P(S.functions(t),function(e){var n=S[e]=t[e];S.prototype[e]=function(){var t=[this._wrapped];return u.apply(t,arguments),V.call(this,n.apply(S,t))}})};var T=0;S.uniqueId=function(t){var e=++T+"";return t?t+e:e},S.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var C=/(.)^/,q={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\t|\u2028|\u2029/g;S.template=function(t,e,n){var r;n=S.defaults({},n,S.templateSettings);var i=new RegExp([(n.escape||C).source,(n.interpolate||C).source,(n.evaluate||C).source].join("|")+"|$","g"),o=0,s="__p+='";t.replace(i,function(e,n,r,i,a){return s+=t.slice(o,a).replace(D,function(t){return"\\"+q[t]}),n&&(s+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),r&&(s+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),i&&(s+="';\n"+i+"\n__p+='"),o=a+e.length,e}),s+="';\n",n.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{r=new Function(n.variable||"obj","_",s)}catch(t){throw t.source=s,t}if(e)return r(e,S);var a=function(t){return r.call(this,t,S)};return a.source="function("+(n.variable||"obj")+"){\n"+s+"}",a},S.chain=function(t){return S(t).chain()};var V=function(t){return this._chain?S(t).chain():t};S.mixin(S),P(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=o[t];S.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!=t&&"splice"!=t||0!==n.length||delete n[0],V.call(this,n)}}),P(["concat","join","slice"],function(t){var e=o[t];S.prototype[t]=function(){return V.call(this,e.apply(this._wrapped,arguments))}}),S.extend(S.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this)},function(t,e,n){!function(t){"use strict";var n={};n.exports=e,function(t){if(!e)var e=1e-6;if(!n)var n="undefined"!=typeof Float32Array?Float32Array:Array;if(!r)var r=Math.random;var i={};i.setMatrixArrayType=function(t){n=t},void 0!==t&&(t.glMatrix=i);var o=Math.PI/180;i.toRadian=function(t){return t*o};var s={};s.create=function(){var t=new n(2);return t[0]=0,t[1]=0,t},s.clone=function(t){var e=new n(2);return e[0]=t[0],e[1]=t[1],e},s.fromValues=function(t,e){var r=new n(2);return r[0]=t,r[1]=e,r},s.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},s.set=function(t,e,n){return t[0]=e,t[1]=n,t},s.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},s.subtract=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t},s.sub=s.subtract,s.multiply=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t},s.mul=s.multiply,s.divide=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t},s.div=s.divide,s.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},s.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t},s.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},s.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t},s.distance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)},s.dist=s.distance,s.squaredDistance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r},s.sqrDist=s.squaredDistance,s.length=function(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)},s.len=s.length,s.squaredLength=function(t){var e=t[0],n=t[1];return e*e+n*n},s.sqrLen=s.squaredLength,s.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},s.normalize=function(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t},s.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},s.cross=function(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t},s.lerp=function(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t},s.random=function(t,e){e=e||1;var n=2*r()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},s.transformMat2=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t},s.transformMat2d=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t},s.transformMat3=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t},s.transformMat4=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t},s.forEach=function(){var t=s.create();return function(e,n,r,i,o,s){var a,u;for(n||(n=2),r||(r=0),u=i?Math.min(i*n+r,e.length):e.length,a=r;a<u;a+=n)t[0]=e[a],t[1]=e[a+1],o(t,t,s),e[a]=t[0],e[a+1]=t[1];return e}}(),s.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},void 0!==t&&(t.vec2=s);var a={};a.create=function(){var t=new n(3);return t[0]=0,t[1]=0,t[2]=0,t},a.clone=function(t){var e=new n(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},a.fromValues=function(t,e,r){var i=new n(3);return i[0]=t,i[1]=e,i[2]=r,i},a.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},a.set=function(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t},a.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t},a.subtract=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t},a.sub=a.subtract,a.multiply=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t},a.mul=a.multiply,a.divide=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t},a.div=a.divide,a.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},a.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},a.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t},a.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t},a.distance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(n*n+r*r+i*i)},a.dist=a.distance,a.squaredDistance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i},a.sqrDist=a.squaredDistance,a.length=function(t){var e=t[0],n=t[1],r=t[2];return Math.sqrt(e*e+n*n+r*r)},a.len=a.length,a.squaredLength=function(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r},a.sqrLen=a.squaredLength,a.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},a.normalize=function(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t},a.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},a.cross=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=n[0],a=n[1],u=n[2];return t[0]=i*u-o*a,t[1]=o*s-r*u,t[2]=r*a-i*s,t},a.lerp=function(t,e,n,r){var i=e[0],o=e[1],s=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=s+r*(n[2]-s),t},a.random=function(t,e){e=e||1;var n=2*r()*Math.PI,i=2*r()-1,o=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(n)*o,t[1]=Math.sin(n)*o,t[2]=i*e,t},a.transformMat4=function(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12],t[1]=n[1]*r+n[5]*i+n[9]*o+n[13],t[2]=n[2]*r+n[6]*i+n[10]*o+n[14],t},a.transformMat3=function(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t},a.transformQuat=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=n[0],a=n[1],u=n[2],c=n[3],l=c*r+a*o-u*i,h=c*i+u*r-s*o,p=c*o+s*i-a*r,f=-s*r-a*i-u*o;return t[0]=l*c+f*-s+h*-u-p*-a,t[1]=h*c+f*-a+p*-s-l*-u,t[2]=p*c+f*-u+l*-a-h*-s,t},a.rotateX=function(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},a.rotateY=function(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},a.rotateZ=function(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},a.forEach=function(){var t=a.create();return function(e,n,r,i,o,s){var a,u;for(n||(n=3),r||(r=0),u=i?Math.min(i*n+r,e.length):e.length,a=r;a<u;a+=n)t[0]=e[a],t[1]=e[a+1],t[2]=e[a+2],o(t,t,s),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2];return e}}(),a.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},void 0!==t&&(t.vec3=a);var u={};u.create=function(){var t=new n(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},u.clone=function(t){var e=new n(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},u.fromValues=function(t,e,r,i){var o=new n(4);return o[0]=t,o[1]=e,o[2]=r,o[3]=i,o},u.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},u.set=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},u.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},u.subtract=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t},u.sub=u.subtract,u.multiply=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t},u.mul=u.multiply,u.divide=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t},u.div=u.divide,u.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t[3]=Math.min(e[3],n[3]),t},u.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t[3]=Math.max(e[3],n[3]),t},u.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},u.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t},u.distance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return Math.sqrt(n*n+r*r+i*i+o*o)},u.dist=u.distance,u.squaredDistance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return n*n+r*r+i*i+o*o},u.sqrDist=u.squaredDistance,u.length=function(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.sqrt(e*e+n*n+r*r+i*i)},u.len=u.length,u.squaredLength=function(t){var e=t[0],n=t[1],r=t[2],i=t[3];return e*e+n*n+r*r+i*i},u.sqrLen=u.squaredLength,u.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},u.normalize=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=n*n+r*r+i*i+o*o;return s>0&&(s=1/Math.sqrt(s),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t[3]=e[3]*s),t},u.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},u.lerp=function(t,e,n,r){var i=e[0],o=e[1],s=e[2],a=e[3];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=s+r*(n[2]-s),t[3]=a+r*(n[3]-a),t},u.random=function(t,e){return e=e||1,t[0]=r(),t[1]=r(),t[2]=r(),t[3]=r(),u.normalize(t,t),u.scale(t,t,e),t},u.transformMat4=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*s,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*s,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*s,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*s,t},u.transformQuat=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=n[0],a=n[1],u=n[2],c=n[3],l=c*r+a*o-u*i,h=c*i+u*r-s*o,p=c*o+s*i-a*r,f=-s*r-a*i-u*o;return t[0]=l*c+f*-s+h*-u-p*-a,t[1]=h*c+f*-a+p*-s-l*-u,t[2]=p*c+f*-u+l*-a-h*-s,t},u.forEach=function(){var t=u.create();return function(e,n,r,i,o,s){var a,u;for(n||(n=4),r||(r=0),u=i?Math.min(i*n+r,e.length):e.length,a=r;a<u;a+=n)t[0]=e[a],t[1]=e[a+1],t[2]=e[a+2],t[3]=e[a+3],o(t,t,s),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2],e[a+3]=t[3];return e}}(),u.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},void 0!==t&&(t.vec4=u);var c={};c.create=function(){var t=new n(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},c.clone=function(t){var e=new n(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},c.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},c.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},c.transpose=function(t,e){if(t===e){var n=e[1];t[1]=e[2],t[2]=n}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},c.invert=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=n*o-i*r;return s?(s=1/s,t[0]=o*s,t[1]=-r*s,t[2]=-i*s,t[3]=n*s,t):null},c.adjoint=function(t,e){var n=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=n,t},c.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},c.multiply=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=n[0],u=n[1],c=n[2],l=n[3];return t[0]=r*a+o*u,t[1]=i*a+s*u,t[2]=r*c+o*l,t[3]=i*c+s*l,t},c.mul=c.multiply,c.rotate=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(n),u=Math.cos(n);return t[0]=r*u+o*a,t[1]=i*u+s*a,t[2]=r*-a+o*u,t[3]=i*-a+s*u,t},c.scale=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=n[0],u=n[1];return t[0]=r*a,t[1]=i*a,t[2]=o*u,t[3]=s*u,t},c.str=function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},c.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},c.LDU=function(t,e,n,r){return t[2]=r[2]/r[0],n[0]=r[0],n[1]=r[1],n[3]=r[3]-t[2]*n[1],[t,e,n]},void 0!==t&&(t.mat2=c);var l={};l.create=function(){var t=new n(6);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},l.clone=function(t){var e=new n(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},l.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},l.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},l.invert=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],u=n*o-r*i;return u?(u=1/u,t[0]=o*u,t[1]=-r*u,t[2]=-i*u,t[3]=n*u,t[4]=(i*a-o*s)*u,t[5]=(r*s-n*a)*u,t):null},l.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},l.multiply=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],u=e[5],c=n[0],l=n[1],h=n[2],p=n[3],f=n[4],d=n[5];return t[0]=r*c+o*l,t[1]=i*c+s*l,t[2]=r*h+o*p,t[3]=i*h+s*p,t[4]=r*f+o*d+a,t[5]=i*f+s*d+u,t},l.mul=l.multiply,l.rotate=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],u=e[5],c=Math.sin(n),l=Math.cos(n);return t[0]=r*l+o*c,t[1]=i*l+s*c,t[2]=r*-c+o*l,t[3]=i*-c+s*l,t[4]=a,t[5]=u,t},l.scale=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],u=e[5],c=n[0],l=n[1];return t[0]=r*c,t[1]=i*c,t[2]=o*l,t[3]=s*l,t[4]=a,t[5]=u,t},l.translate=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],u=e[5],c=n[0],l=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=s,t[4]=r*c+o*l+a,t[5]=i*c+s*l+u,t},l.str=function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},l.frob=function(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)},void 0!==t&&(t.mat2d=l);var h={};h.create=function(){var t=new n(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},h.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},h.clone=function(t){var e=new n(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},h.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},h.identity=function(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},h.transpose=function(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},h.invert=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],u=e[6],c=e[7],l=e[8],h=l*s-a*c,p=-l*o+a*u,f=c*o-s*u,d=n*h+r*p+i*f;return d?(d=1/d,t[0]=h*d,t[1]=(-l*r+i*c)*d,t[2]=(a*r-i*s)*d,t[3]=p*d,t[4]=(l*n-i*u)*d,t[5]=(-a*n+i*o)*d,t[6]=f*d,t[7]=(-c*n+r*u)*d,t[8]=(s*n-r*o)*d,t):null},h.adjoint=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],u=e[6],c=e[7],l=e[8];return t[0]=s*l-a*c,t[1]=i*c-r*l,t[2]=r*a-i*s,t[3]=a*u-o*l,t[4]=n*l-i*u,t[5]=i*o-n*a,t[6]=o*c-s*u,t[7]=r*u-n*c,t[8]=n*s-r*o,t},h.determinant=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],s=t[5],a=t[6],u=t[7],c=t[8];return e*(c*o-s*u)+n*(-c*i+s*a)+r*(u*i-o*a)},h.multiply=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],u=e[5],c=e[6],l=e[7],h=e[8],p=n[0],f=n[1],d=n[2],v=n[3],m=n[4],y=n[5],g=n[6],b=n[7],w=n[8];return t[0]=p*r+f*s+d*c,t[1]=p*i+f*a+d*l,t[2]=p*o+f*u+d*h,t[3]=v*r+m*s+y*c,t[4]=v*i+m*a+y*l,t[5]=v*o+m*u+y*h,t[6]=g*r+b*s+w*c,t[7]=g*i+b*a+w*l,t[8]=g*o+b*u+w*h,t},h.mul=h.multiply,h.translate=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],u=e[5],c=e[6],l=e[7],h=e[8],p=n[0],f=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=s,t[4]=a,t[5]=u,t[6]=p*r+f*s+c,t[7]=p*i+f*a+l,t[8]=p*o+f*u+h,t},h.rotate=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],u=e[5],c=e[6],l=e[7],h=e[8],p=Math.sin(n),f=Math.cos(n);return t[0]=f*r+p*s,t[1]=f*i+p*a,t[2]=f*o+p*u,t[3]=f*s-p*r,t[4]=f*a-p*i,t[5]=f*u-p*o,t[6]=c,t[7]=l,t[8]=h,t},h.scale=function(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},h.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},h.fromQuat=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=n+n,a=r+r,u=i+i,c=n*s,l=r*s,h=r*a,p=i*s,f=i*a,d=i*u,v=o*s,m=o*a,y=o*u;return t[0]=1-h-d,t[3]=l-y,t[6]=p+m,t[1]=l+y,t[4]=1-c-d,t[7]=f-v,t[2]=p-m,t[5]=f+v,t[8]=1-c-h,t},h.normalFromMat4=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],u=e[6],c=e[7],l=e[8],h=e[9],p=e[10],f=e[11],d=e[12],v=e[13],m=e[14],y=e[15],g=n*a-r*s,b=n*u-i*s,w=n*c-o*s,x=r*u-i*a,M=r*c-o*a,_=i*c-o*u,j=l*v-h*d,S=l*m-p*d,P=l*y-f*d,F=h*m-p*v,O=h*y-f*v,E=p*y-f*m,k=g*E-b*O+w*F+x*P-M*S+_*j;return k?(k=1/k,t[0]=(a*E-u*O+c*F)*k,t[1]=(u*P-s*E-c*S)*k,t[2]=(s*O-a*P+c*j)*k,t[3]=(i*O-r*E-o*F)*k,t[4]=(n*E-i*P+o*S)*k,t[5]=(r*P-n*O-o*j)*k,t[6]=(v*_-m*M+y*x)*k,t[7]=(m*w-d*_-y*b)*k,t[8]=(d*M-v*w+y*g)*k,t):null},h.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},h.frob=function(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))},void 0!==t&&(t.mat3=h);var p={};p.create=function(){var t=new n(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},p.clone=function(t){var e=new n(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},p.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},p.identity=function(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},p.transpose=function(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],s=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=s,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},p.invert=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],u=e[6],c=e[7],l=e[8],h=e[9],p=e[10],f=e[11],d=e[12],v=e[13],m=e[14],y=e[15],g=n*a-r*s,b=n*u-i*s,w=n*c-o*s,x=r*u-i*a,M=r*c-o*a,_=i*c-o*u,j=l*v-h*d,S=l*m-p*d,P=l*y-f*d,F=h*m-p*v,O=h*y-f*v,E=p*y-f*m,k=g*E-b*O+w*F+x*P-M*S+_*j;return k?(k=1/k,t[0]=(a*E-u*O+c*F)*k,t[1]=(i*O-r*E-o*F)*k,t[2]=(v*_-m*M+y*x)*k,t[3]=(p*M-h*_-f*x)*k,t[4]=(u*P-s*E-c*S)*k,t[5]=(n*E-i*P+o*S)*k,t[6]=(m*w-d*_-y*b)*k,t[7]=(l*_-p*w+f*b)*k,t[8]=(s*O-a*P+c*j)*k,t[9]=(r*P-n*O-o*j)*k,t[10]=(d*M-v*w+y*g)*k,t[11]=(h*w-l*M-f*g)*k,t[12]=(a*S-s*F-u*j)*k,t[13]=(n*F-r*S+i*j)*k,t[14]=(v*b-d*x-m*g)*k,t[15]=(l*x-h*b+p*g)*k,t):null},p.adjoint=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],u=e[6],c=e[7],l=e[8],h=e[9],p=e[10],f=e[11],d=e[12],v=e[13],m=e[14],y=e[15];return t[0]=a*(p*y-f*m)-h*(u*y-c*m)+v*(u*f-c*p),t[1]=-(r*(p*y-f*m)-h*(i*y-o*m)+v*(i*f-o*p)),t[2]=r*(u*y-c*m)-a*(i*y-o*m)+v*(i*c-o*u),t[3]=-(r*(u*f-c*p)-a*(i*f-o*p)+h*(i*c-o*u)),t[4]=-(s*(p*y-f*m)-l*(u*y-c*m)+d*(u*f-c*p)),t[5]=n*(p*y-f*m)-l*(i*y-o*m)+d*(i*f-o*p),t[6]=-(n*(u*y-c*m)-s*(i*y-o*m)+d*(i*c-o*u)),t[7]=n*(u*f-c*p)-s*(i*f-o*p)+l*(i*c-o*u),t[8]=s*(h*y-f*v)-l*(a*y-c*v)+d*(a*f-c*h),t[9]=-(n*(h*y-f*v)-l*(r*y-o*v)+d*(r*f-o*h)),t[10]=n*(a*y-c*v)-s*(r*y-o*v)+d*(r*c-o*a),t[11]=-(n*(a*f-c*h)-s*(r*f-o*h)+l*(r*c-o*a)),t[12]=-(s*(h*m-p*v)-l*(a*m-u*v)+d*(a*p-u*h)),t[13]=n*(h*m-p*v)-l*(r*m-i*v)+d*(r*p-i*h),t[14]=-(n*(a*m-u*v)-s*(r*m-i*v)+d*(r*u-i*a)),t[15]=n*(a*p-u*h)-s*(r*p-i*h)+l*(r*u-i*a),t},p.determinant=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],s=t[5],a=t[6],u=t[7],c=t[8],l=t[9],h=t[10],p=t[11],f=t[12],d=t[13],v=t[14],m=t[15];return(e*s-n*o)*(h*m-p*v)-(e*a-r*o)*(l*m-p*d)+(e*u-i*o)*(l*v-h*d)+(n*a-r*s)*(c*m-p*f)-(n*u-i*s)*(c*v-h*f)+(r*u-i*a)*(c*d-l*f)},p.multiply=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],u=e[5],c=e[6],l=e[7],h=e[8],p=e[9],f=e[10],d=e[11],v=e[12],m=e[13],y=e[14],g=e[15],b=n[0],w=n[1],x=n[2],M=n[3];return t[0]=b*r+w*a+x*h+M*v,t[1]=b*i+w*u+x*p+M*m,t[2]=b*o+w*c+x*f+M*y,t[3]=b*s+w*l+x*d+M*g,b=n[4],w=n[5],x=n[6],M=n[7],t[4]=b*r+w*a+x*h+M*v,t[5]=b*i+w*u+x*p+M*m,t[6]=b*o+w*c+x*f+M*y,t[7]=b*s+w*l+x*d+M*g,b=n[8],w=n[9],x=n[10],M=n[11],t[8]=b*r+w*a+x*h+M*v,t[9]=b*i+w*u+x*p+M*m,t[10]=b*o+w*c+x*f+M*y,t[11]=b*s+w*l+x*d+M*g,b=n[12],w=n[13],x=n[14],M=n[15],t[12]=b*r+w*a+x*h+M*v,t[13]=b*i+w*u+x*p+M*m,t[14]=b*o+w*c+x*f+M*y,t[15]=b*s+w*l+x*d+M*g,t},p.mul=p.multiply,p.translate=function(t,e,n){var r,i,o,s,a,u,c,l,h,p,f,d,v=n[0],m=n[1],y=n[2];return e===t?(t[12]=e[0]*v+e[4]*m+e[8]*y+e[12],t[13]=e[1]*v+e[5]*m+e[9]*y+e[13],t[14]=e[2]*v+e[6]*m+e[10]*y+e[14],t[15]=e[3]*v+e[7]*m+e[11]*y+e[15]):(r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],u=e[5],c=e[6],l=e[7],h=e[8],p=e[9],f=e[10],d=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=s,t[4]=a,t[5]=u,t[6]=c,t[7]=l,t[8]=h,t[9]=p,t[10]=f,t[11]=d,t[12]=r*v+a*m+h*y+e[12],t[13]=i*v+u*m+p*y+e[13],t[14]=o*v+c*m+f*y+e[14],t[15]=s*v+l*m+d*y+e[15]),t},p.scale=function(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},p.rotate=function(t,n,r,i){var o,s,a,u,c,l,h,p,f,d,v,m,y,g,b,w,x,M,_,j,S,P,F,O,E=i[0],k=i[1],A=i[2],z=Math.sqrt(E*E+k*k+A*A);return Math.abs(z)<e?null:(z=1/z,E*=z,k*=z,A*=z,o=Math.sin(r),s=Math.cos(r),a=1-s,u=n[0],c=n[1],l=n[2],h=n[3],p=n[4],f=n[5],d=n[6],v=n[7],m=n[8],y=n[9],g=n[10],b=n[11],w=E*E*a+s,x=k*E*a+A*o,M=A*E*a-k*o,_=E*k*a-A*o,j=k*k*a+s,S=A*k*a+E*o,P=E*A*a+k*o,F=k*A*a-E*o,O=A*A*a+s,t[0]=u*w+p*x+m*M,t[1]=c*w+f*x+y*M,t[2]=l*w+d*x+g*M,t[3]=h*w+v*x+b*M,t[4]=u*_+p*j+m*S,t[5]=c*_+f*j+y*S,t[6]=l*_+d*j+g*S,t[7]=h*_+v*j+b*S,t[8]=u*P+p*F+m*O,t[9]=c*P+f*F+y*O,t[10]=l*P+d*F+g*O,t[11]=h*P+v*F+b*O,n!==t&&(t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t)},p.rotateX=function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],s=e[5],a=e[6],u=e[7],c=e[8],l=e[9],h=e[10],p=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+c*r,t[5]=s*i+l*r,t[6]=a*i+h*r,t[7]=u*i+p*r,t[8]=c*i-o*r,t[9]=l*i-s*r,t[10]=h*i-a*r,t[11]=p*i-u*r,t},p.rotateY=function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],s=e[1],a=e[2],u=e[3],c=e[8],l=e[9],h=e[10],p=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-c*r,t[1]=s*i-l*r,t[2]=a*i-h*r,t[3]=u*i-p*r,t[8]=o*r+c*i,t[9]=s*r+l*i,t[10]=a*r+h*i,t[11]=u*r+p*i,t},p.rotateZ=function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],s=e[1],a=e[2],u=e[3],c=e[4],l=e[5],h=e[6],p=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+c*r,t[1]=s*i+l*r,t[2]=a*i+h*r,t[3]=u*i+p*r,t[4]=c*i-o*r,t[5]=l*i-s*r,t[6]=h*i-a*r,t[7]=p*i-u*r,t},p.fromRotationTranslation=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=r+r,u=i+i,c=o+o,l=r*a,h=r*u,p=r*c,f=i*u,d=i*c,v=o*c,m=s*a,y=s*u,g=s*c;return t[0]=1-(f+v),t[1]=h+g,t[2]=p-y,t[3]=0,t[4]=h-g,t[5]=1-(l+v),t[6]=d+m,t[7]=0,t[8]=p+y,t[9]=d-m,t[10]=1-(l+f),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},p.fromQuat=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=n+n,a=r+r,u=i+i,c=n*s,l=r*s,h=r*a,p=i*s,f=i*a,d=i*u,v=o*s,m=o*a,y=o*u;return t[0]=1-h-d,t[1]=l+y,t[2]=p-m,t[3]=0,t[4]=l-y,t[5]=1-c-d,t[6]=f+v,t[7]=0,t[8]=p+m,t[9]=f-v,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},p.frustum=function(t,e,n,r,i,o,s){var a=1/(n-e),u=1/(i-r),c=1/(o-s);return t[0]=2*o*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(n+e)*a,t[9]=(i+r)*u,t[10]=(s+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*o*2*c,t[15]=0,t},p.perspective=function(t,e,n,r,i){var o=1/Math.tan(e/2),s=1/(r-i);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+r)*s,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*r*s,t[15]=0,t},p.ortho=function(t,e,n,r,i,o,s){var a=1/(e-n),u=1/(r-i),c=1/(o-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*a,t[13]=(i+r)*u,t[14]=(s+o)*c,t[15]=1,t},p.lookAt=function(t,n,r,i){var o,s,a,u,c,l,h,f,d,v,m=n[0],y=n[1],g=n[2],b=i[0],w=i[1],x=i[2],M=r[0],_=r[1],j=r[2];return Math.abs(m-M)<e&&Math.abs(y-_)<e&&Math.abs(g-j)<e?p.identity(t):(h=m-M,f=y-_,d=g-j,v=1/Math.sqrt(h*h+f*f+d*d),h*=v,f*=v,d*=v,o=w*d-x*f,s=x*h-b*d,a=b*f-w*h,v=Math.sqrt(o*o+s*s+a*a),v?(v=1/v,o*=v,s*=v,a*=v):(o=0,s=0,a=0),u=f*a-d*s,c=d*o-h*a,l=h*s-f*o,v=Math.sqrt(u*u+c*c+l*l),v?(v=1/v,u*=v,c*=v,l*=v):(u=0,c=0,l=0),t[0]=o,t[1]=u,t[2]=h,t[3]=0,t[4]=s,t[5]=c,t[6]=f,t[7]=0,t[8]=a,t[9]=l,t[10]=d,t[11]=0,t[12]=-(o*m+s*y+a*g),t[13]=-(u*m+c*y+l*g),t[14]=-(h*m+f*y+d*g),t[15]=1,t)},p.str=function(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]+")"},p.frob=function(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[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))},void 0!==t&&(t.mat4=p);var f={};f.create=function(){var t=new n(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},f.rotationTo=function(){var t=a.create(),e=a.fromValues(1,0,0),n=a.fromValues(0,1,0);return function(r,i,o){var s=a.dot(i,o);return s<-.999999?(a.cross(t,e,i),a.length(t)<1e-6&&a.cross(t,n,i),a.normalize(t,t),f.setAxisAngle(r,t,Math.PI),r):s>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(a.cross(t,i,o),r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=1+s,f.normalize(r,r))}}(),f.setAxes=function(){var t=h.create();return function(e,n,r,i){return t[0]=r[0],t[3]=r[1],t[6]=r[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-n[0],t[5]=-n[1],t[8]=-n[2],f.normalize(e,f.fromMat3(e,t))}}(),f.clone=u.clone,f.fromValues=u.fromValues,f.copy=u.copy,f.set=u.set,f.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},f.setAxisAngle=function(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t},f.add=u.add,f.multiply=function(t,e,n){var r=e[0],i=e[1],o=e[2],s=e[3],a=n[0],u=n[1],c=n[2],l=n[3];return t[0]=r*l+s*a+i*c-o*u,t[1]=i*l+s*u+o*a-r*c,t[2]=o*l+s*c+r*u-i*a,t[3]=s*l-r*a-i*u-o*c,t},f.mul=f.multiply,f.scale=u.scale,f.rotateX=function(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(n),u=Math.cos(n);return t[0]=r*u+s*a,t[1]=i*u+o*a,t[2]=o*u-i*a,t[3]=s*u-r*a,t},f.rotateY=function(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(n),u=Math.cos(n);return t[0]=r*u-o*a,t[1]=i*u+s*a,t[2]=o*u+r*a,t[3]=s*u-i*a,t},f.rotateZ=function(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(n),u=Math.cos(n);return t[0]=r*u+i*a,t[1]=i*u-r*a,t[2]=o*u+s*a,t[3]=s*u-o*a,t},f.calculateW=function(t,e){var n=e[0],r=e[1],i=e[2];return t[0]=n,t[1]=r,t[2]=i,t[3]=-Math.sqrt(Math.abs(1-n*n-r*r-i*i)),t},f.dot=u.dot,f.lerp=u.lerp,f.slerp=function(t,e,n,r){var i,o,s,a,u,c=e[0],l=e[1],h=e[2],p=e[3],f=n[0],d=n[1],v=n[2],m=n[3];return o=c*f+l*d+h*v+p*m,o<0&&(o=-o,f=-f,d=-d,v=-v,m=-m),1-o>1e-6?(i=Math.acos(o),s=Math.sin(i),a=Math.sin((1-r)*i)/s,u=Math.sin(r*i)/s):(a=1-r,u=r),t[0]=a*c+u*f,t[1]=a*l+u*d,t[2]=a*h+u*v,t[3]=a*p+u*m,t},f.invert=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=n*n+r*r+i*i+o*o,a=s?1/s:0;return t[0]=-n*a,t[1]=-r*a,t[2]=-i*a,t[3]=o*a,t},f.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},f.length=u.length,f.len=f.length,f.squaredLength=u.squaredLength,f.sqrLen=f.squaredLength,f.normalize=u.normalize,f.fromMat3=function(t,e){var n,r=e[0]+e[4]+e[8];if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[7]-e[5])*n,t[1]=(e[2]-e[6])*n,t[2]=(e[3]-e[1])*n;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,s=(i+2)%3;n=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*s+s]+1),t[i]=.5*n,n=.5/n,t[3]=(e[3*s+o]-e[3*o+s])*n,t[o]=(e[3*o+i]+e[3*i+o])*n,t[s]=(e[3*s+i]+e[3*i+s])*n}return t},f.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},void 0!==t&&(t.quat=f)}(n.exports)}()},function(t,e,n){var r=n(1),i=(r.vec3,t.exports=function(t){this.valid=!0,this.id=t.id,this.handId=t.handId,this.length=t.length,this.tool=t.tool,this.width=t.width,this.direction=t.direction,this.stabilizedTipPosition=t.stabilizedTipPosition,this.tipPosition=t.tipPosition,this.tipVelocity=t.tipVelocity,this.touchZone=t.touchZone,this.touchDistance=t.touchDistance,this.timeVisible=t.timeVisible});i.prototype.toString=function(){return"Pointable [ id:"+this.id+" "+this.length+"mmx | width:"+this.width+"mm | direction:"+this.direction+" ]"},i.prototype.hand=function(){return this.frame.hand(this.handId)},i.Invalid={valid:!1}},function(t,e){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(t){return"function"==typeof t}function i(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function s(t){return void 0===t}t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!i(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,n,i,a,u,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var l=new Error('Uncaught, unspecified "error" event. ('+e+")");throw l.context=e,l}if(n=this._events[t],s(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),n.apply(this,a)}else if(o(n))for(a=Array.prototype.slice.call(arguments,1),c=n.slice(),i=c.length,u=0;u<i;u++)c[u].apply(this,a);return!0},n.prototype.addListener=function(t,e){var i;if(!r(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,r(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned&&(i=s(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&i>0&&this._events[t].length>i&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function n(){this.removeListener(t,n),i||(i=!0,e.apply(this,arguments))}if(!r(e))throw TypeError("listener must be a function");var i=!1;return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var n,i,s,a;if(!r(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],s=n.length,i=-1,n===e||r(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(n)){for(a=s;a-- >0;)if(n[a]===e||n[a].listener&&n[a].listener===e){i=a;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],r(n))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?r(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(r(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,n){var r=n(2),i=n(14),o=n(1),s=o.mat3,a=o.vec3,u=n(0),c=t.exports=function(t){this.id=t.id,this.palmPosition=t.palmPosition,this.direction=t.direction,this.palmVelocity=t.palmVelocity,this.palmNormal=t.palmNormal,this.sphereCenter=t.sphereCenter,this.sphereRadius=t.sphereRadius,this.valid=!0,this.pointables=[],this.fingers=[],t.armBasis?this.arm=new i(this,{type:4,width:t.armWidth,prevJoint:t.elbow,nextJoint:t.wrist,basis:t.armBasis}):this.arm=null,this.tools=[],this._translation=t.t,this._rotation=u.flatten(t.r),this._scaleFactor=t.s,this.timeVisible=t.timeVisible,this.stabilizedPalmPosition=t.stabilizedPalmPosition,this.type=t.type,this.grabStrength=t.grabStrength,this.pinchStrength=t.pinchStrength,this.confidence=t.confidence};c.prototype.finger=function(t){var e=this.frame.finger(t);return e&&e.handId==this.id?e:r.Invalid},c.prototype.rotationAngle=function(t,e){if(!this.valid||!t.valid)return 0;if(!t.hand(this.id).valid)return 0;var n=this.rotationMatrix(t),r=.5*(n[0]+n[4]+n[8]-1),i=Math.acos(r);if(i=isNaN(i)?0:i,void 0!==e){var o=this.rotationAxis(t);i*=a.dot(o,a.normalize(a.create(),e))}return i},c.prototype.rotationAxis=function(t){if(!this.valid||!t.valid)return a.create();var e=t.hand(this.id);return e.valid?a.normalize(a.create(),[this._rotation[7]-e._rotation[5],this._rotation[2]-e._rotation[6],this._rotation[3]-e._rotation[1]]):a.create()},c.prototype.rotationMatrix=function(t){if(!this.valid||!t.valid)return s.create();var e=t.hand(this.id);if(!e.valid)return s.create();var n=s.transpose(s.create(),this._rotation);return s.multiply(s.create(),e._rotation,n)},c.prototype.scaleFactor=function(t){if(!this.valid||!t.valid)return 1;var e=t.hand(this.id);return e.valid?Math.exp(this._scaleFactor-e._scaleFactor):1},c.prototype.translation=function(t){if(!this.valid||!t.valid)return a.create();var e=t.hand(this.id);return e.valid?[this._translation[0]-e._translation[0],this._translation[1]-e._translation[1],this._translation[2]-e._translation[2]]:a.create()},c.prototype.toString=function(){return"Hand ("+this.type+") [ id: "+this.id+" | palm velocity:"+this.palmVelocity+" | sphere center:"+this.sphereCenter+" ] "},c.prototype.pitch=function(){return Math.atan2(this.direction[1],-this.direction[2])},c.prototype.yaw=function(){return Math.atan2(this.direction[0],-this.direction[2])},c.prototype.roll=function(){return Math.atan2(this.palmNormal[0],-this.palmNormal[1])},c.Invalid={valid:!1,fingers:[],tools:[],pointables:[],left:!1,pointable:function(){return r.Invalid},finger:function(){return r.Invalid},toString:function(){return"invalid frame"},dump:function(){return this.toString()},rotationAngle:function(){return 0},rotationMatrix:function(){return s.create()},rotationAxis:function(){return a.create()},scaleFactor:function(){return 1},translation:function(){return a.create()}}},function(t,e,n){var r=n(2),i=n(14),o=n(16),s=n(0),a=t.exports=function(t){r.call(this,t),this.dipPosition=t.dipPosition,this.pipPosition=t.pipPosition,this.mcpPosition=t.mcpPosition,this.carpPosition=t.carpPosition,this.extended=t.extended,this.type=t.type,this.finger=!0,this.positions=[this.carpPosition,this.mcpPosition,this.pipPosition,this.dipPosition,this.tipPosition],t.bases?this.addBones(t):o.warnBones()};s.extend(a.prototype,r.prototype),a.prototype.addBones=function(t){this.metacarpal=new i(this,{type:0,width:this.width,prevJoint:this.carpPosition,nextJoint:this.mcpPosition,basis:t.bases[0]}),this.proximal=new i(this,{type:1,width:this.width,prevJoint:this.mcpPosition,nextJoint:this.pipPosition,basis:t.bases[1]}),this.medial=new i(this,{type:2,width:this.width,prevJoint:this.pipPosition,nextJoint:this.dipPosition,basis:t.bases[2]}),this.distal=new i(this,{type:3,width:this.width,prevJoint:this.dipPosition,nextJoint:t.btipPosition,basis:t.bases[3]}),this.bones=[this.metacarpal,this.proximal,this.medial,this.distal]},a.prototype.toString=function(){return"Finger [ id:"+this.id+" "+this.length+"mmx | width:"+this.width+"mm | direction:"+this.direction+" ]"},a.Invalid={valid:!1}},function(t,e,n){var r=n(4),i=n(2),o=n(7).createGesture,s=n(1),a=s.mat3,u=s.vec3,c=n(15),l=n(5),h=n(0),p=t.exports=function(t){if(this.valid=!0,this.id=t.id,this.timestamp=t.timestamp,this.hands=[],this.handsMap={},this.pointables=[],this.tools=[],this.fingers=[],t.interactionBox&&(this.interactionBox=new c(t.interactionBox)),this.gestures=[],this.pointablesMap={},this._translation=t.t,this._rotation=h.flatten(t.r),this._scaleFactor=t.s,this.data=t,this.type="frame",this.currentFrameRate=t.currentFrameRate,t.gestures)for(var e=0,n=t.gestures.length;e!=n;e++)this.gestures.push(o(t.gestures[e]));this.postprocessData(t)};p.prototype.postprocessData=function(t){t||(t=this.data);for(var e=0,n=t.hands.length;e!=n;e++){var o=new r(t.hands[e]);o.frame=this,this.hands.push(o),this.handsMap[o.id]=o}t.pointables=h.sortBy(t.pointables,function(t){return t.id});for(var s=0,a=t.pointables.length;s!=a;s++){var u=t.pointables[s],c=u.dipPosition?new l(u):new i(u);c.frame=this,this.addPointable(c)}},p.prototype.addPointable=function(t){if(this.pointables.push(t),this.pointablesMap[t.id]=t,(t.tool?this.tools:this.fingers).push(t),void 0!==t.handId&&this.handsMap.hasOwnProperty(t.handId)){var e=this.handsMap[t.handId];switch(e.pointables.push(t),(t.tool?e.tools:e.fingers).push(t),t.type){case 0:e.thumb=t;break;case 1:e.indexFinger=t;break;case 2:e.middleFinger=t;break;case 3:e.ringFinger=t;break;case 4:e.pinky=t}}},p.prototype.tool=function(t){var e=this.pointable(t);return e.tool?e:i.Invalid},p.prototype.pointable=function(t){return this.pointablesMap[t]||i.Invalid},p.prototype.finger=function(t){var e=this.pointable(t);return e.tool?i.Invalid:e},p.prototype.hand=function(t){return this.handsMap[t]||r.Invalid},p.prototype.rotationAngle=function(t,e){if(!this.valid||!t.valid)return 0;var n=this.rotationMatrix(t),r=.5*(n[0]+n[4]+n[8]-1),i=Math.acos(r);if(i=isNaN(i)?0:i,void 0!==e){var o=this.rotationAxis(t);i*=u.dot(o,u.normalize(u.create(),e))}return i},p.prototype.rotationAxis=function(t){return this.valid&&t.valid?u.normalize(u.create(),[this._rotation[7]-t._rotation[5],this._rotation[2]-t._rotation[6],this._rotation[3]-t._rotation[1]]):u.create()},p.prototype.rotationMatrix=function(t){if(!this.valid||!t.valid)return a.create();var e=a.transpose(a.create(),this._rotation);return a.multiply(a.create(),t._rotation,e)},p.prototype.scaleFactor=function(t){return this.valid&&t.valid?Math.exp(this._scaleFactor-t._scaleFactor):1},p.prototype.translation=function(t){return this.valid&&t.valid?u.subtract(u.create(),this._translation,t._translation):u.create()},p.prototype.toString=function(){var t="Frame [ id:"+this.id+" | timestamp:"+this.timestamp+" | Hand count:("+this.hands.length+") | Pointable count:("+this.pointables.length+")";return this.gestures&&(t+=" | Gesture count:("+this.gestures.length+")"),t+=" ]"},p.prototype.dump=function(){var t="";t+="Frame Info:<br/>",t+=this.toString(),t+="<br/><br/>Hands:<br/>";for(var e=0,n=this.hands.length;e!=n;e++)t+=" "+this.hands[e].toString()+"<br/>";t+="<br/><br/>Pointables:<br/>";for(var r=0,i=this.pointables.length;r!=i;r++)t+=" "+this.pointables[r].toString()+"<br/>";if(this.gestures){t+="<br/><br/>Gestures:<br/>";for(var o=0,s=this.gestures.length;o!=s;o++)t+=" "+this.gestures[o].toString()+"<br/>"}return t+="<br/><br/>Raw JSON:<br/>",t+=JSON.stringify(this.data)},p.Invalid={valid:!1,hands:[],fingers:[],tools:[],gestures:[],pointables:[],pointable:function(){return i.Invalid},finger:function(){return i.Invalid},hand:function(){return r.Invalid},toString:function(){return"invalid frame"},dump:function(){return this.toString()},rotationAngle:function(){return 0},rotationMatrix:function(){return a.create()},rotationAxis:function(){return u.create()},scaleFactor:function(){return 1},translation:function(){return u.create()}}},function(t,e,n){var r=n(1),i=r.vec3,o=n(3).EventEmitter,s=n(0),a=(e.createGesture=function(t){var e;switch(t.type){case"circle":e=new u(t);break;case"swipe":e=new c(t);break;case"screenTap":e=new l(t);break;case"keyTap":e=new h(t);break;default:throw"unknown gesture type"}return e.id=t.id,e.handIds=t.handIds.slice(),e.pointableIds=t.pointableIds.slice(),e.duration=t.duration,e.state=t.state,e.type=t.type,e},e.gestureListener=function(t,e){var n={},r={};t.on("gesture",function(t,i){if(t.type==e){if(("start"==t.state||"stop"==t.state)&&void 0===r[t.id]){var o=new a(t,i);r[t.id]=o,s.each(n,function(t,e){o.on(e,t)})}r[t.id].update(t,i),"stop"==t.state&&delete r[t.id]}});var i={start:function(t){return n.start=t,i},stop:function(t){return n.stop=t,i},complete:function(t){return n.stop=t,i},update:function(t){return n.update=t,i}};return i},e.Gesture=function(t,e){this.gestures=[t],this.frames=[e]});a.prototype.update=function(t,e){this.lastGesture=t,this.lastFrame=e,this.gestures.push(t),this.frames.push(e),this.emit(t.state,this)},a.prototype.translation=function(){return i.subtract(i.create(),this.lastGesture.startPosition,this.lastGesture.position)},s.extend(a.prototype,o.prototype);var u=function(t){this.center=t.center,this.normal=t.normal,this.progress=t.progress,this.radius=t.radius};u.prototype.toString=function(){return"CircleGesture ["+JSON.stringify(this)+"]"};var c=function(t){this.startPosition=t.startPosition,this.position=t.position,this.direction=t.direction,this.speed=t.speed};c.prototype.toString=function(){return"SwipeGesture ["+JSON.stringify(this)+"]"};var l=function(t){this.position=t.position,this.direction=t.direction,this.progress=t.progress};l.prototype.toString=function(){return"ScreenTapGesture ["+JSON.stringify(this)+"]"};var h=function(t){this.position=t.position,this.direction=t.direction,this.progress=t.progress};h.prototype.toString=function(){return"KeyTapGesture ["+JSON.stringify(this)+"]"}},function(t,e,n){function r(t){return null==t?void 0===t?u:a:c&&c in Object(t)?o(t):s(t)}var i=n(26),o=n(49),s=n(50),a="[object Null]",u="[object Undefined]",c=i?i.toStringTag:void 0;t.exports=r},function(t,e,n){var r=n(27),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},function(t,e){function n(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}t.exports=n},function(t,e,n){function r(t){return null!=t&&o(t.length)&&!i(t)}var i=n(25),o=n(30);t.exports=r},function(t,e){function n(t){return null!=t&&"object"==typeof t}t.exports=n},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(t){if(l===setTimeout)return setTimeout(t,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function o(t){if(h===clearTimeout)return clearTimeout(t);if((h===r||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(t);try{return h(t)}catch(e){try{return h.call(null,t)}catch(e){return h.call(this,t)}}}function s(){v&&f&&(v=!1,f.length?d=f.concat(d):m=-1,d.length&&a())}function a(){if(!v){var t=i(s);v=!0;for(var e=d.length;e;){for(f=d,d=[];++m<e;)f&&f[m].run();m=-1,e=d.length}f=null,v=!1,o(t)}}function u(t,e){this.fun=t,this.array=e}function c(){}var l,h,p=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(t){l=n}try{h="function"==typeof clearTimeout?clearTimeout:r}catch(t){h=r}}();var f,d=[],v=!1,m=-1;p.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];d.push(new u(t,e)),1!==d.length||v||i(a)},u.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=c,p.addListener=c,p.once=c,p.off=c,p.removeListener=c,p.removeAllListeners=c,p.emit=c,p.prependListener=c,p.prependOnceListener=c,p.listeners=function(t){return[]},p.binding=function(t){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(t){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},function(t,e,n){var r=(n(2),n(1)),i=r.vec3,o=r.mat3,s=r.mat4,a=(n(0),t.exports=function(t,e){this.finger=t,this._center=null,this._matrix=null,this.type=e.type,this.prevJoint=e.prevJoint,this.nextJoint=e.nextJoint,this.width=e.width;var n=new Array(3);i.sub(n,e.nextJoint,e.prevJoint),this.length=i.length(n),this.basis=e.basis});a.prototype.left=function(){return this._left?this._left:(this._left=o.determinant(this.basis[0].concat(this.basis[1]).concat(this.basis[2]))<0,this._left)},a.prototype.matrix=function(){if(this._matrix)return this._matrix;var t=this.basis,e=this._matrix=s.create();return e[0]=t[0][0],e[1]=t[0][1],e[2]=t[0][2],e[4]=t[1][0],e[5]=t[1][1],e[6]=t[1][2],e[8]=t[2][0],e[9]=t[2][1],e[10]=t[2][2],e[3]=this.center()[0],e[7]=this.center()[1],e[11]=this.center()[2],this.left()&&(e[0]*=-1,e[1]*=-1,e[2]*=-1),this._matrix},a.prototype.lerp=function(t,e){i.lerp(t,this.prevJoint,this.nextJoint,e)},a.prototype.center=function(){if(this._center)return this._center;var t=i.create();return this.lerp(t,.5),this._center=t,t},a.prototype.direction=function(){return[-1*this.basis[2][0],-1*this.basis[2][1],-1*this.basis[2][2]]}},function(t,e,n){var r=n(1),i=r.vec3,o=t.exports=function(t){this.valid=!0,this.center=t.center,this.size=t.size,this.width=t.size[0],this.height=t.size[1],this.depth=t.size[2]};o.prototype.denormalizePoint=function(t){return i.fromValues((t[0]-.5)*this.size[0]+this.center[0],(t[1]-.5)*this.size[1]+this.center[1],(t[2]-.5)*this.size[2]+this.center[2])},o.prototype.normalizePoint=function(t,e){var n=i.fromValues((t[0]-this.center[0])/this.size[0]+.5,(t[1]-this.center[1])/this.size[1]+.5,(t[2]-this.center[2])/this.size[2]+.5);return e&&(n[0]=Math.min(Math.max(n[0],0),1),n[1]=Math.min(Math.max(n[1],0),1),n[2]=Math.min(Math.max(n[2],0),1)),n},o.prototype.toString=function(){return"InteractionBox [ width:"+this.width+" | height:"+this.height+" | depth:"+this.depth+" ]"},o.Invalid={valid:!1}},function(t,e,n){(function(e){var n=t.exports=function(t,e){this.options=e||{},this.message=t,this.createElement()};n.prototype.createElement=function(){this.element=document.createElement("div"),this.element.className="leapjs-dialog",this.element.style.position="fixed",this.element.style.top="8px",this.element.style.left=0,this.element.style.right=0,this.element.style.textAlign="center",this.element.style.zIndex=1e3;var t=document.createElement("div");this.element.appendChild(t),t.style.className="leapjs-dialog",t.style.display="inline-block",t.style.margin="auto",t.style.padding="8px",t.style.color="#222",t.style.background="#eee",t.style.borderRadius="4px",t.style.border="1px solid #999",t.style.textAlign="left",t.style.cursor="pointer",t.style.whiteSpace="nowrap",t.style.transition="box-shadow 1s linear",t.innerHTML=this.message,this.options.onclick&&t.addEventListener("click",this.options.onclick),this.options.onmouseover&&t.addEventListener("mouseover",this.options.onmouseover),this.options.onmouseout&&t.addEventListener("mouseout",this.options.onmouseout),this.options.onmousemove&&t.addEventListener("mousemove",this.options.onmousemove)},n.prototype.show=function(){return document.body.appendChild(this.element),this},n.prototype.hide=function(){return document.body.removeChild(this.element),this},n.warnOutOfDate=function(t){t||(t={});var e="http://developer.leapmotion.com?";t.returnTo=window.location.href;for(var r in t)e+=r+"="+encodeURIComponent(t[r])+"&";var i;return i=new n("This site requires Leap Motion Tracking V2.<button id='leapjs-accept-upgrade' style='color: #444; transition: box-shadow 100ms linear; cursor: pointer; vertical-align: baseline; margin-left: 16px;'>Upgrade</button><button id='leapjs-decline-upgrade' style='color: #444; transition: box-shadow 100ms linear; cursor: pointer; vertical-align: baseline; margin-left: 8px; '>Not Now</button>",{onclick:function(t){if("leapjs-decline-upgrade"!=t.target.id){var n=window.open(e,"_blank","height=800,width=1000,location=1,menubar=1,resizable=1,status=1,toolbar=1,scrollbars=1");window.focus&&n.focus()}return i.hide(),!0},onmousemove:function(t){t.target==document.getElementById("leapjs-decline-upgrade")?(document.getElementById("leapjs-decline-upgrade").style.color="#000",document.getElementById("leapjs-decline-upgrade").style.boxShadow="0px 0px 2px #5daa00",document.getElementById("leapjs-accept-upgrade").style.color="#444",document.getElementById("leapjs-accept-upgrade").style.boxShadow="none"):(document.getElementById("leapjs-accept-upgrade").style.color="#000",document.getElementById("leapjs-accept-upgrade").style.boxShadow="0px 0px 2px #5daa00",document.getElementById("leapjs-decline-upgrade").style.color="#444",document.getElementById("leapjs-decline-upgrade").style.boxShadow="none")},onmouseout:function(){document.getElementById("leapjs-decline-upgrade").style.color="#444",document.getElementById("leapjs-decline-upgrade").style.boxShadow="none",document.getElementById("leapjs-accept-upgrade").style.color="#444",document.getElementById("leapjs-accept-upgrade").style.boxShadow="none"}}),i.show()},n.hasWarnedBones=!1,n.warnBones=function(){this.hasWarnedBones||(this.hasWarnedBones=!0,console.warn("Your Leap Service is out of date"),void 0!==e&&e.versions&&e.versions.node||this.warnOutOfDate({reason:"bones"}))}}).call(e,n(13))},function(t,e){var n=t.exports=function(t){this.pos=0,this._buf=[],this.size=t};n.prototype.get=function(t){if(void 0==t&&(t=0),!(t>=this.size||t>=this._buf.length))return this._buf[(this.pos-t-1)%this.size]},n.prototype.push=function(t){return this._buf[this.pos%this.size]=t,this.pos++}},function(t,e,n){var r=n(19).chooseProtocol,i=n(3).EventEmitter,o=n(0),s=t.exports=function(t){this.opts=o.defaults(t||{},{host:"127.0.0.1",enableGestures:!1,scheme:this.getScheme(),port:this.getPort(),background:!1,optimizeHMD:!1,requestProtocolVersion:s.defaultProtocolVersion}),this.host=this.opts.host,this.port=this.opts.port,this.scheme=this.opts.scheme,this.protocolVersionVerified=!1,this.background=null,this.optimizeHMD=null,this.on("ready",function(){this.enableGestures(this.opts.enableGestures),this.setBackground(this.opts.background),this.setOptimizeHMD(this.opts.optimizeHMD),this.opts.optimizeHMD?console.log("Optimized for head mounted display usage."):console.log("Optimized for desktop usage.")})};s.defaultProtocolVersion=6,s.prototype.getUrl=function(){return this.scheme+"//"+this.host+":"+this.port+"/v"+this.opts.requestProtocolVersion+".json"},s.prototype.getScheme=function(){return"ws:"},s.prototype.getPort=function(){return 6437},s.prototype.setBackground=function(t){this.opts.background=t,this.protocol&&this.protocol.sendBackground&&this.background!==this.opts.background&&(this.background=this.opts.background,this.protocol.sendBackground(this,this.opts.background))},s.prototype.setOptimizeHMD=function(t){this.opts.optimizeHMD=t,this.protocol&&this.protocol.sendOptimizeHMD&&this.optimizeHMD!==this.opts.optimizeHMD&&(this.optimizeHMD=this.opts.optimizeHMD,this.protocol.sendOptimizeHMD(this,this.opts.optimizeHMD))},s.prototype.handleOpen=function(){this.connected||(this.connected=!0,this.emit("connect"))},s.prototype.enableGestures=function(t){this.gesturesEnabled=!!t,this.send(this.protocol.encode({enableGestures:this.gesturesEnabled}))},s.prototype.handleClose=function(t,e){this.connected&&(this.disconnect(),1001===t&&this.opts.requestProtocolVersion>1&&(this.protocolVersionVerified?this.protocolVersionVerified=!1:this.opts.requestProtocolVersion--),this.startReconnection())},s.prototype.startReconnection=function(){var t=this;this.reconnectionTimer||(this.reconnectionTimer=setInterval(function(){t.reconnect()},500))},s.prototype.stopReconnection=function(){this.reconnectionTimer=clearInterval(this.reconnectionTimer)},s.prototype.disconnect=function(t){if(t||this.stopReconnection(),this.socket)return this.socket.close(),delete this.socket,delete this.protocol,delete this.background,delete this.optimizeHMD,delete this.focusedState,this.connected&&(this.connected=!1,this.emit("disconnect")),!0},s.prototype.reconnect=function(){this.connected?this.stopReconnection():(this.disconnect(!0),this.connect())},s.prototype.handleData=function(t){var e,n=JSON.parse(t);void 0===this.protocol?(e=this.protocol=r(n),this.protocolVersionVerified=!0,this.emit("ready")):e=this.protocol(n),this.emit(e.type,e)},s.prototype.connect=function(){if(!this.socket)return this.socket=this.setupSocket(),!0},s.prototype.send=function(t){this.socket.send(t)},s.prototype.reportFocus=function(t){this.connected&&this.focusedState!==t&&(this.focusedState=t,this.emit(this.focusedState?"focus":"blur"),this.protocol&&this.protocol.sendFocused&&this.protocol.sendFocused(this,this.focusedState))},o.extend(s.prototype,i.prototype)},function(t,e,n){var r=n(6),i=(n(4),n(2),n(5),n(0)),o=n(3).EventEmitter,s=function(t){this.type=t.type,this.state=t.state};e.chooseProtocol=function(t){var e;switch(t.version){case 1:case 2:case 3:case 4:case 5:case 6:e=a(t),e.sendBackground=function(t,n){t.send(e.encode({background:n}))},e.sendFocused=function(t,n){t.send(e.encode({focused:n}))},e.sendOptimizeHMD=function(t,n){t.send(e.encode({optimizeHMD:n}))};break;default:throw"unrecognized version"}return e};var a=e.JSONProtocol=function(t){var e=function(t){if(t.event)return new s(t.event);e.emit("beforeFrameCreated",t);var n=new r(t);return e.emit("afterFrameCreated",n,t),n};return e.encode=function(t){return JSON.stringify(t)},e.version=t.version,e.serviceVersion=t.serviceVersion,e.versionLong="Version "+t.version,e.type="protocol",i.extend(e,o.prototype),e}},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";var r=n(46),i=n.n(r),o={autoCenter:!0,gestureDelay:500,naturalSwipe:!0,pointerColor:"#00aaff",pointerOpacity:.7,pointerSize:15,pointerTolerance:120},s=Reveal.getConfig()["reveal-leap-motion"],a=i()({},o,s);e.a=a},function(t,e,n){function r(t,e,n){var r=t[e];a.call(t,e)&&o(r,n)&&(void 0!==n||e in t)||i(t,e,n)}var i=n(23),o=n(28),s=Object.prototype,a=s.hasOwnProperty;t.exports=r},function(t,e,n){function r(t,e,n){"__proto__"==e&&i?i(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var i=n(24);t.exports=r},function(t,e,n){var r=n(47),i=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=i},function(t,e,n){function r(t){if(!o(t))return!1;var e=i(t);return e==a||e==u||e==s||e==c}var i=n(8),o=n(10),s="[object AsyncFunction]",a="[object Function]",u="[object GeneratorFunction]",c="[object Proxy]";t.exports=r},function(t,e,n){var r=n(9),i=r.Symbol;t.exports=i},function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(e,n(20))},function(t,e){function n(t,e){return t===e||t!==t&&e!==e}t.exports=n},function(t,e){function n(t){return t}t.exports=n},function(t,e){function n(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=r}var r=9007199254740991;t.exports=n},function(t,e){function n(t,e){var n=typeof t;return!!(e=null==e?r:e)&&("number"==n||"symbol"!=n&&i.test(t))&&t>-1&&t%1==0&&t<e}var r=9007199254740991,i=/^(?:0|[1-9]\d*)$/;t.exports=n},function(t,e){function n(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||r)}var r=Object.prototype;t.exports=n},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(35),i=n.n(r),o=n(45),s=n(80),a={enableGestures:!0};i.a.loop(a,function(t){Object(s.a)(t.fingers),Object(o.a)(t)})},function(t,e,n){t.exports={Controller:n(36),Frame:n(6),Gesture:n(7),Hand:n(4),Pointable:n(2),Finger:n(5),InteractionBox:n(15),CircularBuffer:n(17),UI:n(41),JSONProtocol:n(19).JSONProtocol,glMatrix:n(1),mat3:n(1).mat3,vec3:n(1).vec3,loopController:void 0,version:n(44),_:n(0),EventEmitter:n(3).EventEmitter,loop:function(t,e){return t&&void 0===e&&"[object Function]"==={}.toString.call(t)&&(e=t,t={}),this.loopController?t&&this.loopController.setupFrameEvents(t):this.loopController=new this.Controller(t),this.loopController.loop(e),this.loopController},plugin:function(t,e){this.Controller.plugin(t,e)}}},function(t,e,n){(function(e){var r=n(6),i=n(4),o=n(2),s=n(5),a=n(17),u=n(37),c=n(3).EventEmitter,l=n(7).gestureListener,h=n(16),p=n(0),f=t.exports=function(t){var i=void 0!==e&&e.versions&&e.versions.node,o=this;t=p.defaults(t||{},{inNode:i}),this.inNode=t.inNode,t=p.defaults(t||{},{frameEventName:this.useAnimationLoop()?"animationFrame":"deviceFrame",suppressAnimationLoop:!this.useAnimationLoop(),loopWhileDisconnected:!0,useAllPlugins:!1,checkVersion:!0}),this.animationFrameRequested=!1,this.onAnimationFrame=function(t){o.lastConnectionFrame.valid&&o.emit("animationFrame",o.lastConnectionFrame),o.emit("frameEnd",t),o.loopWhileDisconnected&&(!1!==o.connection.focusedState||o.connection.opts.background)?window.requestAnimationFrame(o.onAnimationFrame):o.animationFrameRequested=!1},this.suppressAnimationLoop=t.suppressAnimationLoop,this.loopWhileDisconnected=t.loopWhileDisconnected,this.frameEventName=t.frameEventName,this.useAllPlugins=t.useAllPlugins,this.history=new a(200),this.lastFrame=r.Invalid,this.lastValidFrame=r.Invalid,this.lastConnectionFrame=r.Invalid,this.accumulatedGestures=[],this.checkVersion=t.checkVersion,void 0===t.connectionType?this.connectionType=n(this.inBrowser()?38:39):this.connectionType=t.connectionType,this.connection=new this.connectionType(t),this.streamingCount=0,this.devices={},this.plugins={},this._pluginPipelineSteps={},this._pluginExtendedMethods={},t.useAllPlugins&&this.useRegisteredPlugins(),this.setupFrameEvents(t),this.setupConnectionEvents(),this.startAnimationLoop()};f.prototype.gesture=function(t,e){var n=l(this,t);return void 0!==e&&n.stop(e),n},f.prototype.setBackground=function(t){return this.connection.setBackground(t),this},f.prototype.setOptimizeHMD=function(t){return this.connection.setOptimizeHMD(t),this},f.prototype.inBrowser=function(){return!this.inNode},f.prototype.useAnimationLoop=function(){return this.inBrowser()&&!this.inBackgroundPage()},f.prototype.inBackgroundPage=function(){return"undefined"!=typeof chrome&&chrome.extension&&chrome.extension.getBackgroundPage&&chrome.extension.getBackgroundPage()===window},f.prototype.connect=function(){return this.connection.connect(),this},f.prototype.streaming=function(){return this.streamingCount>0},f.prototype.connected=function(){return!!this.connection.connected},f.prototype.startAnimationLoop=function(){this.suppressAnimationLoop||this.animationFrameRequested||(this.animationFrameRequested=!0,window.requestAnimationFrame(this.onAnimationFrame))},f.prototype.disconnect=function(){return this.connection.disconnect(),this},f.prototype.frame=function(t){return this.history.get(t)||r.Invalid},f.prototype.loop=function(t){return t&&("function"==typeof t?this.on(this.frameEventName,t):this.setupFrameEvents(t)),this.connect()},f.prototype.addStep=function(t){this.pipeline||(this.pipeline=new u(this)),this.pipeline.addStep(t)},f.prototype.processFrame=function(t){t.gestures&&(this.accumulatedGestures=this.accumulatedGestures.concat(t.gestures)),this.lastConnectionFrame=t,this.startAnimationLoop(),this.emit("deviceFrame",t)},f.prototype.processFinishedFrame=function(t){if(this.lastFrame=t,t.valid&&(this.lastValidFrame=t),t.controller=this,t.historyIdx=this.history.push(t),t.gestures){t.gestures=this.accumulatedGestures,this.accumulatedGestures=[];for(var e=0;e!=t.gestures.length;e++)this.emit("gesture",t.gestures[e],t)}this.pipeline&&((t=this.pipeline.run(t))||(t=r.Invalid)),this.emit("frame",t),this.emitHandEvents(t)},f.prototype.emitHandEvents=function(t){for(var e=0;e<t.hands.length;e++)this.emit("hand",t.hands[e])},f.prototype.setupFrameEvents=function(t){t.frame&&this.on("frame",t.frame),t.hand&&this.on("hand",t.hand)},f.prototype.setupConnectionEvents=function(){var t=this;this.connection.on("frame",function(e){t.processFrame(e)}),this.on(this.frameEventName,function(e){t.processFinishedFrame(e)});var e=function(){if(t.connection.opts.requestProtocolVersion<5&&0==t.streamingCount){t.streamingCount=1;var n={attached:!0,streaming:!0,type:"unknown",id:"Lx00000000000"};t.devices[n.id]=n,t.emit("deviceAttached",n),t.emit("deviceStreaming",n),t.emit("streamingStarted",n),t.connection.removeListener("frame",e)}},n=function(){if(t.streamingCount>0){for(var e in t.devices)t.emit("deviceStopped",t.devices[e]),t.emit("deviceRemoved",t.devices[e]);t.emit("streamingStopped",t.devices[e]),t.streamingCount=0;for(var e in t.devices)delete t.devices[e]}};this.connection.on("focus",function(){t.loopWhileDisconnected&&t.startAnimationLoop(),t.emit("focus")}),this.connection.on("blur",function(){t.emit("blur")}),this.connection.on("protocol",function(e){e.on("beforeFrameCreated",function(e){t.emit("beforeFrameCreated",e)}),e.on("afterFrameCreated",function(e,n){t.emit("afterFrameCreated",e,n)}),t.emit("protocol",e)}),this.connection.on("ready",function(){t.checkVersion&&!t.inNode&&t.checkOutOfDate(),t.emit("ready")}),this.connection.on("connect",function(){t.emit("connect"),t.connection.removeListener("frame",e),t.connection.on("frame",e)}),this.connection.on("disconnect",function(){t.emit("disconnect"),n()}),this.connection.on("deviceConnect",function(r){r.state?(t.emit("deviceConnected"),t.connection.removeListener("frame",e),t.connection.on("frame",e)):(t.emit("deviceDisconnected"),n())}),this.connection.on("deviceEvent",function(e){var n=e.state,r=t.devices[n.id],i={};for(var o in n)r&&r.hasOwnProperty(o)&&r[o]==n[o]||(i[o]=!0);t.devices[n.id]=n,i.attached&&t.emit(n.attached?"deviceAttached":"deviceRemoved",n),i.streaming&&(n.streaming?(t.streamingCount++,t.emit("deviceStreaming",n),1==t.streamingCount&&t.emit("streamingStarted",n),i.attached||t.emit("deviceConnected")):i.attached&&n.attached||(t.streamingCount--,t.emit("deviceStopped",n),0==t.streamingCount&&t.emit("streamingStopped",n),t.emit("deviceDisconnected")))}),this.on("newListener",function(t,e){"deviceConnected"!=t&&"deviceDisconnected"!=t||console.warn(t+" events are depricated. Consider using 'streamingStarted/streamingStopped' or 'deviceStreaming/deviceStopped' instead")})},f.prototype.checkOutOfDate=function(){console.assert(this.connection&&this.connection.protocol);var t=this.connection.protocol.serviceVersion,e=this.connection.protocol.version,n=this.connectionType.defaultProtocolVersion;return n>e&&(console.warn("Your Protocol Version is v"+e+", this app was designed for v"+n),h.warnOutOfDate({sV:t,pV:e}),!0)},f._pluginFactories={},f.plugin=function(t,e){return this._pluginFactories[t]&&console.warn('Plugin "'+t+'" already registered'),this._pluginFactories[t]=e},f.plugins=function(){return p.keys(this._pluginFactories)};var d=function(t,e,n){-1!=["beforeFrameCreated","afterFrameCreated"].indexOf(e)?this.on(e,n):(this.pipeline||(this.pipeline=new u(this)),this._pluginPipelineSteps[t]||(this._pluginPipelineSteps[t]=[]),this._pluginPipelineSteps[t].push(this.pipeline.addWrappedStep(e,n)))},v=function(t,e,n){var a;switch(this._pluginExtendedMethods[t]||(this._pluginExtendedMethods[t]=[]),e){case"frame":a=r;break;case"hand":a=i;break;case"pointable":a=o,p.extend(s.prototype,n),p.extend(s.Invalid,n);break;case"finger":a=s;break;default:throw t+' specifies invalid object type "'+e+'" for prototypical extension'}p.extend(a.prototype,n),p.extend(a.Invalid,n),this._pluginExtendedMethods[t].push([a,n])};f.prototype.use=function(t,e){var n,r,i,o;if(!(r="function"==typeof t?t:f._pluginFactories[t]))throw"Leap Plugin "+t+" not found.";if(e||(e={}),this.plugins[t])return p.extend(this.plugins[t],e),this;this.plugins[t]=e,o=r.call(this,e);for(i in o)n=o[i],"function"==typeof n?d.call(this,t,i,n):v.call(this,t,i,n);return this},f.prototype.stopUsing=function(t){var e,n,r=this._pluginPipelineSteps[t],i=this._pluginExtendedMethods[t],o=0;if(this.plugins[t]){if(r)for(o=0;o<r.length;o++)this.pipeline.removeStep(r[o]);if(i)for(o=0;o<i.length;o++){e=i[o][0],n=i[o][1];for(var s in n)delete e.prototype[s],delete e.Invalid[s]}return delete this.plugins[t],this}},f.prototype.useRegisteredPlugins=function(){for(var t in f._pluginFactories)this.use(t)},p.extend(f.prototype,c.prototype)}).call(e,n(13))},function(t,e){var n=t.exports=function(t){this.steps=[],this.controller=t};n.prototype.addStep=function(t){this.steps.push(t)},n.prototype.run=function(t){for(var e=this.steps.length,n=0;n!=e&&t;n++)t=this.steps[n](t);return t},n.prototype.removeStep=function(t){var e=this.steps.indexOf(t);if(-1===e)throw"Step not found in pipeline";this.steps.splice(e,1)},n.prototype.addWrappedStep=function(t,e){var n=this.controller,r=function(r){var i,o,s;for(i="frame"==t?[r]:r[t+"s"]||[],o=0,s=i.length;o<s;o++)e.call(n,i[o]);return r};return this.addStep(r),r}},function(t,e,n){var r=t.exports=n(18),i=n(0),o=t.exports=function(t){r.call(this,t);var e=this;this.on("ready",function(){e.startFocusLoop()}),this.on("disconnect",function(){e.stopFocusLoop()})};i.extend(o.prototype,r.prototype),o.__proto__=r,o.prototype.useSecure=function(){return"https:"===location.protocol},o.prototype.getScheme=function(){return this.useSecure()?"wss:":"ws:"},o.prototype.getPort=function(){return this.useSecure()?6436:6437},o.prototype.setupSocket=function(){var t=this,e=new WebSocket(this.getUrl());return e.onopen=function(){t.handleOpen()},e.onclose=function(e){t.handleClose(e.code,e.reason)},e.onmessage=function(e){t.handleData(e.data)},e.onerror=function(e){t.useSecure()&&"wss:"===t.scheme&&(t.scheme="ws:",t.port=6437,t.disconnect(),t.connect())},e},o.prototype.startFocusLoop=function(){if(!this.focusDetectorTimer){var t=this,e=null;e=void 0!==document.hidden?"hidden":void 0!==document.mozHidden?"mozHidden":void 0!==document.msHidden?"msHidden":void 0!==document.webkitHidden?"webkitHidden":void 0,void 0===t.windowVisible&&(t.windowVisible=void 0===e||!1===document[e]);var n=window.addEventListener("focus",function(e){t.windowVisible=!0,i()}),r=window.addEventListener("blur",function(e){t.windowVisible=!1,i()});this.on("disconnect",function(){window.removeEventListener("focus",n),window.removeEventListener("blur",r)});var i=function(){var n=void 0===e||!1===document[e];t.reportFocus(n&&t.windowVisible)};i(),this.focusDetectorTimer=setInterval(i,100)}},o.prototype.stopFocusLoop=function(){this.focusDetectorTimer&&(clearTimeout(this.focusDetectorTimer),delete this.focusDetectorTimer)}},function(t,e,n){var r=n(40),i=n(18),o=n(0),s=t.exports=function(t){i.call(this,t);var e=this;this.on("ready",function(){e.reportFocus(!0)})};o.extend(s.prototype,i.prototype),s.__proto__=i,s.prototype.setupSocket=function(){var t=this,e=new r(this.getUrl());return e.on("open",function(){t.handleOpen()}),e.on("message",function(e){t.handleData(e)}),e.on("close",function(e,n){t.handleClose(e,n)}),e.on("error",function(){t.startReconnection()}),e}},function(t,e,n){(function(e){t.exports=function(){return e.WebSocket||e.MozWebSocket}}).call(e,n(20))},function(t,e,n){e.UI={Region:n(42),Cursor:n(43)}},function(t,e,n){var r=n(3).EventEmitter,i=n(0),o=t.exports=function(t,e){this.start=new Vector(t),this.end=new Vector(e),this.enteredFrame=null};o.prototype.hasPointables=function(t){for(var e=0;e!=t.pointables.length;e++){var n=t.pointables[e].tipPosition;if(n.x>=this.start.x&&n.x<=this.end.x&&n.y>=this.start.y&&n.y<=this.end.y&&n.z>=this.start.z&&n.z<=this.end.z)return!0}return!1},o.prototype.listener=function(t){var e=this;return t&&t.nearThreshold&&this.setupNearRegion(t.nearThreshold),function(t){return e.updatePosition(t)}},o.prototype.clipper=function(){var t=this;return function(e){return t.updatePosition(e),t.enteredFrame?e:null}},o.prototype.setupNearRegion=function(t){var e=this.nearRegion=new o([this.start.x-t,this.start.y-t,this.start.z-t],[this.end.x+t,this.end.y+t,this.end.z+t]),n=this;e.on("enter",function(t){n.emit("near",t)}),e.on("exit",function(t){n.emit("far",t)}),n.on("exit",function(t){n.emit("near",t)})},o.prototype.updatePosition=function(t){return this.nearRegion&&this.nearRegion.updatePosition(t),this.hasPointables(t)&&null==this.enteredFrame?(this.enteredFrame=t,this.emit("enter",this.enteredFrame)):this.hasPointables(t)||null==this.enteredFrame||(this.enteredFrame=null,this.emit("exit",this.enteredFrame)),t},o.prototype.normalize=function(t){return new Vector([(t.x-this.start.x)/(this.end.x-this.start.x),(t.y-this.start.y)/(this.end.y-this.start.y),(t.z-this.start.z)/(this.end.z-this.start.z)])},o.prototype.mapToXY=function(t,e,n){var r=this.normalize(t),i=r.x,o=r.y;return i>1?i=1:i<-1&&(i=-1),o>1?o=1:o<-1&&(o=-1),[(i+1)/2*e,(1-o)/2*n,r.z]},i.extend(o.prototype,r.prototype)},function(t,e){t.exports=function(){return function(t){var e=t.pointables.sort(function(t,e){return t.z-e.z})[0];return e&&e.valid&&(t.cursorPosition=e.tipPosition),t}}},function(t,e){t.exports={full:"0.6.4",major:0,minor:6,dot:4}},function(t,e,n){"use strict";function r(t){var e=t.fingers,n=t.gestures,r=t.hands,s=(new Date).getTime();if(n.length>0&&s-o>i.a.gestureDelay){var a=n[0];if(1===r.length&&e[2].extended){if("swipe"===a.type){var u=a.direction[0],c=a.direction[1];Math.abs(u)>Math.abs(c)?u>0?i.a.naturalSwipe?Reveal.left():Reveal.right():i.a.naturalSwipe?Reveal.right():Reveal.left():c>0?i.a.naturalSwipe?Reveal.down():Reveal.up():i.a.naturalSwipe?Reveal.up():Reveal.down(),o=s}}else 2===r.length&&("swipe"===a.type&&a.direction[1]>0&&Reveal.toggleOverview(),o=s)}}var i=n(21),o=0;e.a=r},function(t,e,n){var r=n(22),i=n(55),o=n(56),s=n(11),a=n(32),u=n(65),c=Object.prototype,l=c.hasOwnProperty,h=o(function(t,e){if(a(e)||s(e))return void i(e,u(e),t);for(var n in e)l.call(e,n)&&r(t,n,e[n])});t.exports=h},function(t,e,n){function r(t,e){var n=o(t,e);return i(n)?n:void 0}var i=n(48),o=n(54);t.exports=r},function(t,e,n){function r(t){return!(!s(t)||o(t))&&(i(t)?d:c).test(a(t))}var i=n(25),o=n(51),s=n(10),a=n(53),u=/[\\^$.*+?()[\]{}|]/g,c=/^\[object .+?Constructor\]$/,l=Function.prototype,h=Object.prototype,p=l.toString,f=h.hasOwnProperty,d=RegExp("^"+p.call(f).replace(u,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=r},function(t,e,n){function r(t){var e=s.call(t,u),n=t[u];try{t[u]=void 0;var r=!0}catch(t){}var i=a.call(t);return r&&(e?t[u]=n:delete t[u]),i}var i=n(26),o=Object.prototype,s=o.hasOwnProperty,a=o.toString,u=i?i.toStringTag:void 0;t.exports=r},function(t,e){function n(t){return i.call(t)}var r=Object.prototype,i=r.toString;t.exports=n},function(t,e,n){function r(t){return!!o&&o in t}var i=n(52),o=function(){var t=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();t.exports=r},function(t,e,n){var r=n(9),i=r["__core-js_shared__"];t.exports=i},function(t,e){function n(t){if(null!=t){try{return i.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var r=Function.prototype,i=r.toString;t.exports=n},function(t,e){function n(t,e){return null==t?void 0:t[e]}t.exports=n},function(t,e,n){function r(t,e,n,r){var s=!n;n||(n={});for(var a=-1,u=e.length;++a<u;){var c=e[a],l=r?r(n[c],t[c],c,n,t):void 0;void 0===l&&(l=t[c]),s?o(n,c,l):i(n,c,l)}return n}var i=n(22),o=n(23);t.exports=r},function(t,e,n){function r(t){return i(function(e,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(s=t.length>3&&"function"==typeof s?(i--,s):void 0,a&&o(n[0],n[1],a)&&(s=i<3?void 0:s,i=1),e=Object(e);++r<i;){var u=n[r];u&&t(e,u,r,s)}return e})}var i=n(57),o=n(64);t.exports=r},function(t,e,n){function r(t,e){return s(o(t,e,i),t+"")}var i=n(29),o=n(58),s=n(60);t.exports=r},function(t,e,n){function r(t,e,n){return e=o(void 0===e?t.length-1:e,0),function(){for(var r=arguments,s=-1,a=o(r.length-e,0),u=Array(a);++s<a;)u[s]=r[e+s];s=-1;for(var c=Array(e+1);++s<e;)c[s]=r[s];return c[e]=n(u),i(t,this,c)}}var i=n(59),o=Math.max;t.exports=r},function(t,e){function n(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}t.exports=n},function(t,e,n){var r=n(61),i=n(63),o=i(r);t.exports=o},function(t,e,n){var r=n(62),i=n(24),o=n(29),s=i?function(t,e){return i(t,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:o;t.exports=s},function(t,e){function n(t){return function(){return t}}t.exports=n},function(t,e){function n(t){var e=0,n=0;return function(){var s=o(),a=i-(s-n);if(n=s,a>0){if(++e>=r)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var r=800,i=16,o=Date.now;t.exports=n},function(t,e,n){function r(t,e,n){if(!a(n))return!1;var r=typeof e;return!!("number"==r?o(n)&&s(e,n.length):"string"==r&&e in n)&&i(n[e],t)}var i=n(28),o=n(11),s=n(31),a=n(10);t.exports=r},function(t,e,n){function r(t){return s(t)?i(t):o(t)}var i=n(66),o=n(77),s=n(11);t.exports=r},function(t,e,n){function r(t,e){var n=s(t),r=!n&&o(t),l=!n&&!r&&a(t),p=!n&&!r&&!l&&c(t),f=n||r||l||p,d=f?i(t.length,String):[],v=d.length;for(var m in t)!e&&!h.call(t,m)||f&&("length"==m||l&&("offset"==m||"parent"==m)||p&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||u(m,v))||d.push(m);return d}var i=n(67),o=n(68),s=n(70),a=n(71),u=n(31),c=n(73),l=Object.prototype,h=l.hasOwnProperty;t.exports=r},function(t,e){function n(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}t.exports=n},function(t,e,n){var r=n(69),i=n(12),o=Object.prototype,s=o.hasOwnProperty,a=o.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(t){return i(t)&&s.call(t,"callee")&&!a.call(t,"callee")};t.exports=u},function(t,e,n){function r(t){return o(t)&&i(t)==s}var i=n(8),o=n(12),s="[object Arguments]";t.exports=r},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){(function(t){var r=n(9),i=n(72),o="object"==typeof e&&e&&!e.nodeType&&e,s=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=s&&s.exports===o,u=a?r.Buffer:void 0,c=u?u.isBuffer:void 0,l=c||i;t.exports=l}).call(e,n(33)(t))},function(t,e){function n(){return!1}t.exports=n},function(t,e,n){var r=n(74),i=n(75),o=n(76),s=o&&o.isTypedArray,a=s?i(s):r;t.exports=a},function(t,e,n){function r(t){return s(t)&&o(t.length)&&!!a[i(t)]}var i=n(8),o=n(30),s=n(12),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=r},function(t,e){function n(t){return function(e){return t(e)}}t.exports=n},function(t,e,n){(function(t){var r=n(27),i="object"==typeof e&&e&&!e.nodeType&&e,o=i&&"object"==typeof t&&t&&!t.nodeType&&t,s=o&&o.exports===i,a=s&&r.process,u=function(){try{return a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=u}).call(e,n(33)(t))},function(t,e,n){function r(t){if(!i(t))return o(t);var e=[];for(var n in Object(t))a.call(t,n)&&"constructor"!=n&&e.push(n);return e}var i=n(32),o=n(78),s=Object.prototype,a=s.hasOwnProperty;t.exports=r},function(t,e,n){var r=n(79),i=r(Object.keys,Object);t.exports=i},function(t,e){function n(t,e){return function(n){return t(e(n))}}t.exports=n},function(t,e,n){"use strict";function r(t,e,n){var r=-3*t;r<o.a.pointerSize&&(r=o.a.pointerSize),c.style.borderRadius=r-5+"px",c.style.height=r+"px",c.style.left=e+"px",c.style.top=n+"px",c.style.width=r+"px"}function i(t){if(t.length>0&&t[1].extended&&!t[2].extended){var e=u.offsetHeight,n=u.offsetWidth,i=t[1].tipPosition,a=void 0,p=void 0;l||(l=!0,h=t[1].tipPosition,c.style.visibility="visible"),o.a.autoCenter?(a=Object(s.a)(i[0],h[0],n,o.a.pointerTolerance),p=Object(s.a)(i[1],h[1],e,o.a.pointerTolerance,!0)):(a=Object(s.b)(i[0],n,o.a.pointerTolerance),p=Object(s.c)(i[1],e,o.a.pointerTolerance)),r(i[2],a,p)}else l&&(l=!1,c.style.visibility="hidden")}var o=n(21),s=n(81),a=document,u=a.body,c=document.createElement("div"),l=!1,h=void 0;c.id="reveal-leap-motion",c.style.backgroundColor=o.a.pointerColor,c.style.opacity=o.a.pointerOpacity,c.style.position="absolute",c.style.visibility="hidden",c.style.zIndex="50",u.appendChild(c),e.a=i},function(t,e,n){"use strict";function r(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=(t-e)*n/r;return i&&(o*=-1),o+n/2}function i(t,e,n){return t*e/n+e/2}function o(t,e,n){return(1-(t-50)/n)*e}n.d(e,"a",function(){return r}),n.d(e,"b",function(){return i}),n.d(e,"c",function(){return o})}]);