From 621f097454bea09fd5b1e8702a2e0a170260e6ab Mon Sep 17 00:00:00 2001 From: Rory Hardy Date: Sun, 4 Feb 2018 20:55:32 -0800 Subject: [PATCH] Compiled project --- reveal-leap-motion.min.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/reveal-leap-motion.min.js b/reveal-leap-motion.min.js index d7c7946..f3b69d9 100644 --- a/reveal-leap-motion.min.js +++ b/reveal-leap-motion.min.js @@ -6,6 +6,4 @@ * Released under the Apache-2.0 license * https://github.com/gneatgeek/reveal-leap-motion/blob/master/LICENSE */ -!function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i=n(37),o=r(i),s=n(69),a=r(s),u=n(33),c=!1,l=0,p=void 0,h={autoCenter:!0,gestureDelay:500,naturalSwipe:!0,pointerColor:"#00aaff",pointerOpacity:.7,pointerSize:15,pointerTolerance:120},f=document.body,d={enableGestures:!0},v=Reveal.getConfig()["reveal-leap-motion"],m=document.createElement("div"),y=(0,a.default)({},h,v);m.id="reveal-leap-motion",m.style.backgroundColor=y.pointerColor,m.style.opacity=y.pointerOpacity,m.style.position="absolute",m.style.visibility="hidden",m.style.zIndex=50,f.appendChild(m);var g=function(t){var e=-3*t;e0&&t.fingers[1].extended&&!t.fingers[2].extended){var n=f.offsetHeight,r=f.offsetWidth,i=t.fingers[1].tipPosition;if(g(i[2]),y.autoCenter){c||(c=!0,p=t.fingers[1].tipPosition);var o=(0,u.computeCenteredPosition)(i[0],p[0],r,y.pointerTolerance),s=(0,u.computeCenteredPosition)(i[1],p[1],n,y.pointerTolerance,!0);m.style.left=o+"px",m.style.top=s+"px"}else{var a=(0,u.computeLeftPosition)(i[0],r,y.pointerTolerance),h=(0,u.computeTopPosition)(i[1],n,y.pointerTolerance);m.style.left=a+"px",m.style.top=h+"px"}}else c=!1,m.style.visibility="hidden";if(t.gestures.length>0&&e-l>y.gestureDelay){var d=t.gestures[0];if(1===t.hands.length&&t.fingers[2].extended){if("swipe"===d.type){var v=d.direction[0],b=d.direction[1];Math.abs(v)>Math.abs(b)?v>0?y.naturalSwipe?Reveal.left():Reveal.right():y.naturalSwipe?Reveal.right():Reveal.left():b>0?y.naturalSwipe?Reveal.down():Reveal.up():y.naturalSwipe?Reveal.up():Reveal.down(),l=e}}else 2===t.hands.length&&("swipe"===d.type&&d.direction[1]>0&&Reveal.toggleOverview(),l=e)}})},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,p=s.toString,h=s.hasOwnProperty,f=o.forEach,d=o.map,v=o.reduce,m=o.reduceRight,y=o.filter,g=o.every,b=o.some,x=o.indexOf,w=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)};"undefined"!=typeof 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;r2;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 E(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 E=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&&(x&&t.indexOf===x?t.indexOf(e)!=-1:E(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;sr||void 0===n)return 1;if(n>>1;n.call(r,t[a])=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=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 L=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=p.call(t);if(i!=p.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=L(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)&&L(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 L(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]"==p.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 p.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 t===!0||t===!1||"[object Boolean]"==p.call(t)},S.isNull=function(t){return null===t},S.isUndefined=function(t){return void 0===t},S.has=function(t,e){return h.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":">",'"':""","'":"'","/":"/"}};z.unescape=S.invert(z.escape);var I={escape:new RegExp("["+S.keys(z.escape).join("")+"]","g"),unescape:new RegExp("("+S.keys(z.unescape).join("|")+")","g")};S.each(["escape","unescape"],function(t){S[t]=function(e){return null==e?"":(""+e).replace(I[t],function(e){return z[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},"undefined"!=typeof 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;a0&&(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,p=c*i+u*r-s*o,h=c*o+s*i-a*r,f=-s*r-a*i-u*o;return t[0]=l*c+f*-s+p*-u-h*-a,t[1]=p*c+f*-a+h*-s-l*-u,t[2]=h*c+f*-u+l*-a-p*-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;a0&&(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,p=c*i+u*r-s*o,h=c*o+s*i-a*r,f=-s*r-a*i-u*o;return t[0]=l*c+f*-s+p*-u-h*-a,t[1]=p*c+f*-a+h*-s-l*-u,t[2]=h*c+f*-u+l*-a-p*-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.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=p.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],p=e[2],h=e[3],f=n[0],d=n[1],v=n[2],m=n[3];return o=c*f+l*d+p*v+h*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*p+u*v,t[3]=a*h+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]+")"},"undefined"!=typeof t&&(t.quat=f)}(n.exports)}(this)},function(t,e,n){var r=n(2),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],e 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;u0&&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){var e;return e=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(3),i=n(14),o=n(17),s=n(1),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(3),i=n(14),o=n(2),s=o.mat3,a=o.vec3,u=n(1),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;var n=t.hand(this.id);if(!n.valid)return 0;var r=this.rotationMatrix(t),i=.5*(r[0]+r[4]+r[8]-1),o=Math.acos(i);if(o=isNaN(o)?0:o,void 0!==e){var s=this.rotationAxis(t);o*=a.dot(s,a.normalize(a.create(),e))}return o},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),r=s.multiply(s.create(),e._rotation,n);return r},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(6),i=n(3),o=n(8).createGesture,s=n(2),a=s.mat3,u=s.vec3,c=n(18),l=n(5),p=n(1),h=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=p.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)};h.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=p.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)}},h.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}}},h.prototype.tool=function(t){var e=this.pointable(t);return e.tool?e:i.Invalid},h.prototype.pointable=function(t){return this.pointablesMap[t]||i.Invalid},h.prototype.finger=function(t){var e=this.pointable(t);return e.tool?i.Invalid:e},h.prototype.hand=function(t){return this.handsMap[t]||r.Invalid},h.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},h.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()},h.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)},h.prototype.scaleFactor=function(t){return this.valid&&t.valid?Math.exp(this._scaleFactor-t._scaleFactor):1},h.prototype.translation=function(t){return this.valid&&t.valid?u.subtract(u.create(),this._translation,t._translation):u.create()},h.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+=" ]"},h.prototype.dump=function(){var t="";t+="Frame Info:
",t+=this.toString(),t+="

Hands:
";for(var e=0,n=this.hands.length;e!=n;e++)t+=" "+this.hands[e].toString()+"
";t+="

Pointables:
";for(var r=0,i=this.pointables.length;r!=i;r++)t+=" "+this.pointables[r].toString()+"
";if(this.gestures){t+="

Gestures:
";for(var o=0,s=this.gestures.length;o!=s;o++)t+=" "+this.gestures[o].toString()+"
"}return t+="

Raw JSON:
",t+=JSON.stringify(this.data)},h.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(2),i=r.vec3,o=n(4).EventEmitter,s=n(1),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 p(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 p=function(t){this.position=t.position,this.direction=t.direction,this.progress=t.progress};p.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(20),o=n(57),s=n(63),a="[object Null]",u="[object Undefined]",c=i?i.toStringTag:void 0;t.exports=r},function(t,e,n){var r=n(24),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},function(t,e,n){function r(t){return null!=t&&o(t.length)&&!i(t)}var i=n(29),o=n(30);t.exports=r},function(t,e){function n(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}t.exports=n},function(t,e){function n(t){return null!=t&&"object"==typeof t}t.exports=n},function(t,e,n){var r=(n(3),n(2)),i=r.vec3,o=r.mat3,s=r.mat4,a=(n(1),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[this.basis[2][0]*-1,this.basis[2][1]*-1,this.basis[2][2]*-1]}},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(4).EventEmitter,o=n(1),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){(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,o=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},s="This site requires Leap Motion Tracking V2."; -return i=new n(s,{onclick:o,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"),"undefined"!=typeof e&&e.versions&&e.versions.node||this.warnOutOfDate({reason:"bones"}))}}).call(e,n(31))},function(t,e,n){var r=n(2),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){var r=n(7),i=(n(6),n(3),n(5),n(1)),o=n(4).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,n){var r=n(10),i=r.Symbol;t.exports=i},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(22),o=n(27),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(23);t.exports=r},function(t,e,n){var r=n(56),i=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=i},function(t,e){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(e,function(){return this}())},function(t,e){function n(t,e){return e=null==e?r:e,!!e&&("number"==typeof t||i.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=r}var r=9007199254740991;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(p===clearTimeout)return clearTimeout(t);if((p===r||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(t);try{return p(t)}catch(e){try{return p.call(null,t)}catch(e){return p.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=[];++m1)for(var n=1;n4&&void 0!==arguments[4]&&arguments[4],o=(t-e)*n/r;return i&&(o*=-1),o+n/2},r=function(t,e,n){return t*e/n+e/2},i=function(t,e,n){return(1-(t-50)/n)*e};e.computeCenteredPosition=n,e.computeLeftPosition=r,e.computeTopPosition=i},function(t,e,n){var r=t.exports=n(16),i=n(1),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="undefined"!=typeof document.hidden?"hidden":"undefined"!=typeof document.mozHidden?"mozHidden":"undefined"!=typeof document.msHidden?"msHidden":"undefined"!=typeof document.webkitHidden?"webkitHidden":void 0,void 0===t.windowVisible&&(t.windowVisible=void 0===e||document[e]===!1);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||document[e]===!1;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(77),i=n(16),o=n(1),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){var r=n(7),i=n(6),o=n(3),s=n(5),a=n(15),u=n(38),c=n(4).EventEmitter,l=n(8).gestureListener,p=n(17),h=n(1),f=t.exports=function(t){var i="undefined"!=typeof e&&e.versions&&e.versions.node,o=this;t=h.defaults(t||{},{inNode:i}),this.inNode=t.inNode,t=h.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&&(o.connection.focusedState!==!1||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()?34:35):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||(t=r.Invalid)),this.emit("frame",t),this.emitHandEvents(t)},f.prototype.emitHandEvents=function(t){for(var e=0;e0){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),p.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 h.keys(this._pluginFactories)};var d=function(t,e,n){["beforeFrameCreated","afterFrameCreated"].indexOf(e)!=-1?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,h.extend(s.prototype,n),h.extend(s.Invalid,n);break;case"finger":a=s;break;default:throw t+' specifies invalid object type "'+e+'" for prototypical extension'}h.extend(a.prototype,n),h.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],!r)throw"Leap Plugin "+t+" not found.";if(e||(e={}),this.plugins[t])return h.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=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={full:"0.6.4",major:0,minor:6,dot:4}},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){function r(t,e){var n=s(t),r=!n&&o(t),l=!n&&!r&&a(t),h=!n&&!r&&!l&&c(t),f=n||r||l||h,d=f?i(t.length,String):[],v=d.length;for(var m in t)!e&&!p.call(t,m)||f&&("length"==m||l&&("offset"==m||"parent"==m)||h&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||u(m,v))||d.push(m);return d}var i=n(51),o=n(71),s=n(72),a=n(73),u=n(25),c=n(74),l=Object.prototype,p=l.hasOwnProperty;t.exports=r},function(t,e,n){function r(t){return o(t)&&i(t)==s}var i=n(9),o=n(13),s="[object Arguments]";t.exports=r},function(t,e,n){function r(t){if(!s(t)||o(t))return!1;var e=i(t)?d:c;return e.test(a(t))}var i=n(29),o=n(60),s=n(12),a=n(68),u=/[\\^$.*+?()[\]{}|]/g,c=/^\[object .+?Constructor\]$/,l=Function.prototype,p=Object.prototype,h=l.toString,f=p.hasOwnProperty,d=RegExp("^"+h.call(f).replace(u,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=r},function(t,e,n){function r(t){return s(t)&&o(t.length)&&!!O[i(t)]}var i=n(9),o=n(30),s=n(13),a="[object Arguments]",u="[object Array]",c="[object Boolean]",l="[object Date]",p="[object Error]",h="[object Function]",f="[object Map]",d="[object Number]",v="[object Object]",m="[object RegExp]",y="[object Set]",g="[object String]",b="[object WeakMap]",x="[object ArrayBuffer]",w="[object DataView]",M="[object Float32Array]",_="[object Float64Array]",j="[object Int8Array]",S="[object Int16Array]",P="[object Int32Array]",F="[object Uint8Array]",E="[object Uint8ClampedArray]",k="[object Uint16Array]",A="[object Uint32Array]",O={};O[M]=O[_]=O[j]=O[S]=O[P]=O[F]=O[E]=O[k]=O[A]=!0,O[a]=O[u]=O[x]=O[c]=O[w]=O[l]=O[p]=O[h]=O[f]=O[d]=O[v]=O[m]=O[y]=O[g]=O[b]=!1,t.exports=r},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(26),o=n(61),s=Object.prototype,a=s.hasOwnProperty;t.exports=r},function(t,e,n){function r(t,e){return s(o(t,e,i),t+"")}var i=n(28),o=n(65),s=n(66);t.exports=r},function(t,e,n){var r=n(70),i=n(23),o=n(28),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,e){for(var n=-1,r=Array(t);++n1?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);++r0){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){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,n){var r=n(21),i=n(53),o=n(55),s=n(11),a=n(26),u=n(75),c=Object.prototype,l=c.hasOwnProperty,p=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=p},function(t,e){function n(t){return function(){return t}}t.exports=n},function(t,e,n){var r=n(45),i=n(13),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){var n=Array.isArray;t.exports=n},function(t,e,n){(function(t){var r=n(10),i=n(76),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(32)(t))},function(t,e,n){var r=n(47),i=n(52),o=n(62),s=o&&o.isTypedArray,a=s?i(s):r;t.exports=a},function(t,e,n){function r(t){return s(t)?i(t):o(t)}var i=n(44),o=n(48),s=n(11);t.exports=r},function(t,e){function n(){return!1}t.exports=n},function(t,e){(function(e){t.exports=function(){return e.WebSocket||e.MozWebSocket}}).call(e,function(){return this}())}]); \ No newline at end of file +!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;r2;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;sr||void 0===n)return 1;if(n>>1;n.call(r,t[a])=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=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":">",'"':""","'":"'","/":"/"}};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;a0&&(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;a0&&(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.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;u0&&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:
",t+=this.toString(),t+="

Hands:
";for(var e=0,n=this.hands.length;e!=n;e++)t+=" "+this.hands[e].toString()+"
";t+="

Pointables:
";for(var r=0,i=this.pointables.length;r!=i;r++)t+=" "+this.pointables[r].toString()+"
";if(this.gestures){t+="

Gestures:
";for(var o=0,s=this.gestures.length;o!=s;o++)t+=" "+this.gestures[o].toString()+"
"}return t+="

Raw JSON:
",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=[];++m1)for(var n=1;nUpgrade",{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&&t0},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;e0){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=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;++a1?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);++r0){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);++n0&&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})}]); \ No newline at end of file