aframe-master.min.js 1.1 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646
  1. (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.AFRAME = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
  2. (function (process){
  3. var TWEEN=TWEEN||function(){var n=[];return{getAll:function(){return n},removeAll:function(){n=[]},add:function(t){n.push(t)},remove:function(t){var r=n.indexOf(t);r!==-1&&n.splice(r,1)},update:function(t,r){if(0===n.length)return!1;var i=0;for(t=void 0!==t?t:TWEEN.now();i<n.length;)n[i].update(t)||r?i++:n.splice(i,1);return!0}}}();"undefined"==typeof window&&"undefined"!=typeof process?TWEEN.now=function(){var n=process.hrtime();return 1e3*n[0]+n[1]/1e6}:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?TWEEN.now=window.performance.now.bind(window.performance):void 0!==Date.now?TWEEN.now=Date.now:TWEEN.now=function(){return(new Date).getTime()},TWEEN.Tween=function(n){var t,r=n,i={},u={},e={},o=1e3,a=0,f=!1,c=!1,s=!1,h=0,l=null,E=TWEEN.Easing.Linear.None,p=TWEEN.Interpolation.Linear,d=[],v=null,w=!1,I=null,M=null,T=null;this.to=function(n,t){return u=n,void 0!==t&&(o=t),this},this.start=function(n){TWEEN.add(this),c=!0,w=!1,l=void 0!==n?n:TWEEN.now(),l+=h;for(var t in u){if(u[t]instanceof Array){if(0===u[t].length)continue;u[t]=[r[t]].concat(u[t])}void 0!==r[t]&&(i[t]=r[t],i[t]instanceof Array==!1&&(i[t]*=1),e[t]=i[t]||0)}return this},this.stop=function(){return c?(TWEEN.remove(this),c=!1,null!==T&&T.call(r,r),this.stopChainedTweens(),this):this},this.end=function(){return this.update(l+o),this},this.stopChainedTweens=function(){for(var n=0,t=d.length;n<t;n++)d[n].stop()},this.delay=function(n){return h=n,this},this.repeat=function(n){return a=n,this},this.repeatDelay=function(n){return t=n,this},this.yoyo=function(n){return f=n,this},this.easing=function(n){return E=n,this},this.interpolation=function(n){return p=n,this},this.chain=function(){return d=arguments,this},this.onStart=function(n){return v=n,this},this.onUpdate=function(n){return I=n,this},this.onComplete=function(n){return M=n,this},this.onStop=function(n){return T=n,this},this.update=function(n){var c,T,N;if(n<l)return!0;w===!1&&(null!==v&&v.call(r,r),w=!0),T=(n-l)/o,T=T>1?1:T,N=E(T);for(c in u)if(void 0!==i[c]){var W=i[c]||0,O=u[c];O instanceof Array?r[c]=p(O,N):("string"==typeof O&&(O="+"===O.charAt(0)||"-"===O.charAt(0)?W+parseFloat(O):parseFloat(O)),"number"==typeof O&&(r[c]=W+(O-W)*N))}if(null!==I&&I.call(r,N),1===T){if(a>0){isFinite(a)&&a--;for(c in e){if("string"==typeof u[c]&&(e[c]=e[c]+parseFloat(u[c])),f){var m=e[c];e[c]=u[c],u[c]=m}i[c]=e[c]}return f&&(s=!s),l=void 0!==t?n+t:n+h,!0}null!==M&&M.call(r,r);for(var g=0,y=d.length;g<y;g++)d[g].start(l+o);return!1}return!0}},TWEEN.Easing={Linear:{None:function(n){return n}},Quadratic:{In:function(n){return n*n},Out:function(n){return n*(2-n)},InOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)}},Cubic:{In:function(n){return n*n*n},Out:function(n){return--n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)}},Quartic:{In:function(n){return n*n*n*n},Out:function(n){return 1- --n*n*n*n},InOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)}},Quintic:{In:function(n){return n*n*n*n*n},Out:function(n){return--n*n*n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)}},Sinusoidal:{In:function(n){return 1-Math.cos(n*Math.PI/2)},Out:function(n){return Math.sin(n*Math.PI/2)},InOut:function(n){return.5*(1-Math.cos(Math.PI*n))}},Exponential:{In:function(n){return 0===n?0:Math.pow(1024,n-1)},Out:function(n){return 1===n?1:1-Math.pow(2,-10*n)},InOut:function(n){return 0===n?0:1===n?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)}},Circular:{In:function(n){return 1-Math.sqrt(1-n*n)},Out:function(n){return Math.sqrt(1- --n*n)},InOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)}},Elastic:{In:function(n){return 0===n?0:1===n?1:-Math.pow(2,10*(n-1))*Math.sin(5*(n-1.1)*Math.PI)},Out:function(n){return 0===n?0:1===n?1:Math.pow(2,-10*n)*Math.sin(5*(n-.1)*Math.PI)+1},InOut:function(n){return 0===n?0:1===n?1:(n*=2,n<1?-.5*Math.pow(2,10*(n-1))*Math.sin(5*(n-1.1)*Math.PI):.5*Math.pow(2,-10*(n-1))*Math.sin(5*(n-1.1)*Math.PI)+1)}},Back:{In:function(n){var t=1.70158;return n*n*((t+1)*n-t)},Out:function(n){var t=1.70158;return--n*n*((t+1)*n+t)+1},InOut:function(n){var t=2.5949095;return(n*=2)<1?.5*(n*n*((t+1)*n-t)):.5*((n-=2)*n*((t+1)*n+t)+2)}},Bounce:{In:function(n){return 1-TWEEN.Easing.Bounce.Out(1-n)},Out:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},InOut:function(n){return n<.5?.5*TWEEN.Easing.Bounce.In(2*n):.5*TWEEN.Easing.Bounce.Out(2*n-1)+.5}}},TWEEN.Interpolation={Linear:function(n,t){var r=n.length-1,i=r*t,u=Math.floor(i),e=TWEEN.Interpolation.Utils.Linear;return t<0?e(n[0],n[1],i):t>1?e(n[r],n[r-1],r-i):e(n[u],n[u+1>r?r:u+1],i-u)},Bezier:function(n,t){for(var r=0,i=n.length-1,u=Math.pow,e=TWEEN.Interpolation.Utils.Bernstein,o=0;o<=i;o++)r+=u(1-t,i-o)*u(t,o)*n[o]*e(i,o);return r},CatmullRom:function(n,t){var r=n.length-1,i=r*t,u=Math.floor(i),e=TWEEN.Interpolation.Utils.CatmullRom;return n[0]===n[r]?(t<0&&(u=Math.floor(i=r*(1+t))),e(n[(u-1+r)%r],n[u],n[(u+1)%r],n[(u+2)%r],i-u)):t<0?n[0]-(e(n[0],n[0],n[1],n[1],-i)-n[0]):t>1?n[r]-(e(n[r],n[r],n[r-1],n[r-1],i-r)-n[r]):e(n[u?u-1:0],n[u],n[r<u+1?r:u+1],n[r<u+2?r:u+2],i-u)},Utils:{Linear:function(n,t,r){return(t-n)*r+n},Bernstein:function(n,t){var r=TWEEN.Interpolation.Utils.Factorial;return r(n)/r(t)/r(n-t)},Factorial:function(){var n=[1];return function(t){var r=1;if(n[t])return n[t];for(var i=t;i>1;i--)r*=i;return n[t]=r,r}}(),CatmullRom:function(n,t,r,i,u){var e=.5*(r-n),o=.5*(i-t),a=u*u,f=u*a;return(2*t-2*r+e+o)*f+(-3*t+3*r-2*e-o)*a+e*u+t}}},function(n){"function"==typeof define&&define.amd?define([],function(){return TWEEN}):"undefined"!=typeof module&&"object"==typeof exports?module.exports=TWEEN:void 0!==n&&(n.TWEEN=TWEEN)}(this);
  4. }).call(this,_dereq_('_process'))
  5. },{"_process":33}],2:[function(_dereq_,module,exports){
  6. function anArray(r){return r.BYTES_PER_ELEMENT&&"[object ArrayBuffer]"===str.call(r.buffer)||Array.isArray(r)}var str=Object.prototype.toString;module.exports=anArray;
  7. },{}],3:[function(_dereq_,module,exports){
  8. module.exports=function(e,n){return"number"==typeof e?e:"number"==typeof n?n:0};
  9. },{}],4:[function(_dereq_,module,exports){
  10. "use strict";function placeHoldersCount(o){var r=o.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===o[r-2]?2:"="===o[r-1]?1:0}function byteLength(o){return 3*o.length/4-placeHoldersCount(o)}function toByteArray(o){var r,e,t,u,n,p,a=o.length;n=placeHoldersCount(o),p=new Arr(3*a/4-n),t=n>0?a-4:a;var l=0;for(r=0,e=0;r<t;r+=4,e+=3)u=revLookup[o.charCodeAt(r)]<<18|revLookup[o.charCodeAt(r+1)]<<12|revLookup[o.charCodeAt(r+2)]<<6|revLookup[o.charCodeAt(r+3)],p[l++]=u>>16&255,p[l++]=u>>8&255,p[l++]=255&u;return 2===n?(u=revLookup[o.charCodeAt(r)]<<2|revLookup[o.charCodeAt(r+1)]>>4,p[l++]=255&u):1===n&&(u=revLookup[o.charCodeAt(r)]<<10|revLookup[o.charCodeAt(r+1)]<<4|revLookup[o.charCodeAt(r+2)]>>2,p[l++]=u>>8&255,p[l++]=255&u),p}function tripletToBase64(o){return lookup[o>>18&63]+lookup[o>>12&63]+lookup[o>>6&63]+lookup[63&o]}function encodeChunk(o,r,e){for(var t,u=[],n=r;n<e;n+=3)t=(o[n]<<16)+(o[n+1]<<8)+o[n+2],u.push(tripletToBase64(t));return u.join("")}function fromByteArray(o){for(var r,e=o.length,t=e%3,u="",n=[],p=16383,a=0,l=e-t;a<l;a+=p)n.push(encodeChunk(o,a,a+p>l?l:a+p));return 1===t?(r=o[e-1],u+=lookup[r>>2],u+=lookup[r<<4&63],u+="=="):2===t&&(r=(o[e-2]<<8)+o[e-1],u+=lookup[r>>10],u+=lookup[r>>4&63],u+=lookup[r<<2&63],u+="="),n.push(u),n.join("")}exports.byteLength=byteLength,exports.toByteArray=toByteArray,exports.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;
  11. },{}],5:[function(_dereq_,module,exports){
  12. "use strict";module.exports={createLink:function(e,t){var a=document.head||document.getElementsByTagName("head")[0],n=document.createElement("link");n.href=e,n.rel="stylesheet";for(var d in t)if(t.hasOwnProperty(d)){var r=t[d];n.setAttribute("data-"+d,r)}a.appendChild(n)},createStyle:function(e,t){var a=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css";for(var d in t)if(t.hasOwnProperty(d)){var r=t[d];n.setAttribute("data-"+d,r)}n.sheet?(n.innerHTML=e,n.sheet.cssText=e,a.appendChild(n)):n.styleSheet?(a.appendChild(n),n.styleSheet.cssText=e):(n.appendChild(document.createTextNode(e)),a.appendChild(n))}};
  13. },{}],6:[function(_dereq_,module,exports){
  14. var Buffer=_dereq_("buffer").Buffer;module.exports=function(f,e){if(Buffer.isBuffer(f)&&Buffer.isBuffer(e)){if("function"==typeof f.equals)return f.equals(e);if(f.length!==e.length)return!1;for(var r=0;r<f.length;r++)if(f[r]!==e[r])return!1;return!0}};
  15. },{"buffer":7}],7:[function(_dereq_,module,exports){
  16. (function (global){
  17. "use strict";function typedArraySupport(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(t,e){if(kMaxLength()<e)throw new RangeError("Invalid typed array length");return Buffer.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=Buffer.prototype):(null===t&&(t=new Buffer(e)),t.length=e),t}function Buffer(t,e,r){if(!(Buffer.TYPED_ARRAY_SUPPORT||this instanceof Buffer))return new Buffer(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return allocUnsafe(this,t)}return from(this,t,e,r)}function from(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?fromArrayBuffer(t,e,r,n):"string"==typeof e?fromString(t,e,r):fromObject(t,e)}function assertSize(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function alloc(t,e,r,n){return assertSize(e),e<=0?createBuffer(t,e):void 0!==r?"string"==typeof n?createBuffer(t,e).fill(r,n):createBuffer(t,e).fill(r):createBuffer(t,e)}function allocUnsafe(t,e){if(assertSize(e),t=createBuffer(t,e<0?0:0|checked(e)),!Buffer.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function fromString(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!Buffer.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|byteLength(e,r);t=createBuffer(t,n);var f=t.write(e,r);return f!==n&&(t=t.slice(0,f)),t}function fromArrayLike(t,e){var r=e.length<0?0:0|checked(e.length);t=createBuffer(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function fromArrayBuffer(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),Buffer.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=Buffer.prototype):t=fromArrayLike(t,e),t}function fromObject(t,e){if(Buffer.isBuffer(e)){var r=0|checked(e.length);return t=createBuffer(t,r),0===t.length?t:(e.copy(t,0,0,r),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||isnan(e.length)?createBuffer(t,0):fromArrayLike(t,e);if("Buffer"===e.type&&isArray(e.data))return fromArrayLike(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked(t){if(t>=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|t}function SlowBuffer(t){return+t!=t&&(t=0),Buffer.alloc(+t)}function byteLength(t,e){if(Buffer.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return utf8ToBytes(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return base64ToBytes(t).length;default:if(n)return utf8ToBytes(t).length;e=(""+e).toLowerCase(),n=!0}}function slowToString(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return hexSlice(this,e,r);case"utf8":case"utf-8":return utf8Slice(this,e,r);case"ascii":return asciiSlice(this,e,r);case"latin1":case"binary":return latin1Slice(this,e,r);case"base64":return base64Slice(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function swap(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function bidirectionalIndexOf(t,e,r,n,f){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=f?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(f)return-1;r=t.length-1}else if(r<0){if(!f)return-1;r=0}if("string"==typeof e&&(e=Buffer.from(e,n)),Buffer.isBuffer(e))return 0===e.length?-1:arrayIndexOf(t,e,r,n,f);if("number"==typeof e)return e&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?f?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):arrayIndexOf(t,[e],r,n,f);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(t,e,r,n,f){function i(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var o=1,u=t.length,s=e.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,u/=2,s/=2,r/=2}var a;if(f){var h=-1;for(a=r;a<u;a++)if(i(t,a)===i(e,h===-1?0:a-h)){if(h===-1&&(h=a),a-h+1===s)return h*o}else h!==-1&&(a-=a-h),h=-1}else for(r+s>u&&(r=u-s),a=r;a>=0;a--){for(var c=!0,l=0;l<s;l++)if(i(t,a+l)!==i(e,l)){c=!1;break}if(c)return a}return-1}function hexWrite(t,e,r,n){r=Number(r)||0;var f=t.length-r;n?(n=Number(n),n>f&&(n=f)):n=f;var i=e.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var o=0;o<n;++o){var u=parseInt(e.substr(2*o,2),16);if(isNaN(u))return o;t[r+o]=u}return o}function utf8Write(t,e,r,n){return blitBuffer(utf8ToBytes(e,t.length-r),t,r,n)}function asciiWrite(t,e,r,n){return blitBuffer(asciiToBytes(e),t,r,n)}function latin1Write(t,e,r,n){return asciiWrite(t,e,r,n)}function base64Write(t,e,r,n){return blitBuffer(base64ToBytes(e),t,r,n)}function ucs2Write(t,e,r,n){return blitBuffer(utf16leToBytes(e,t.length-r),t,r,n)}function base64Slice(t,e,r){return 0===e&&r===t.length?base64.fromByteArray(t):base64.fromByteArray(t.slice(e,r))}function utf8Slice(t,e,r){r=Math.min(t.length,r);for(var n=[],f=e;f<r;){var i=t[f],o=null,u=i>239?4:i>223?3:i>191?2:1;if(f+u<=r){var s,a,h,c;switch(u){case 1:i<128&&(o=i);break;case 2:s=t[f+1],128===(192&s)&&(c=(31&i)<<6|63&s,c>127&&(o=c));break;case 3:s=t[f+1],a=t[f+2],128===(192&s)&&128===(192&a)&&(c=(15&i)<<12|(63&s)<<6|63&a,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:s=t[f+1],a=t[f+2],h=t[f+3],128===(192&s)&&128===(192&a)&&128===(192&h)&&(c=(15&i)<<18|(63&s)<<12|(63&a)<<6|63&h,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,u=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),f+=u}return decodeCodePointsArray(n)}function decodeCodePointsArray(t){var e=t.length;if(e<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=MAX_ARGUMENTS_LENGTH));return r}function asciiSlice(t,e,r){var n="";r=Math.min(t.length,r);for(var f=e;f<r;++f)n+=String.fromCharCode(127&t[f]);return n}function latin1Slice(t,e,r){var n="";r=Math.min(t.length,r);for(var f=e;f<r;++f)n+=String.fromCharCode(t[f]);return n}function hexSlice(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var f="",i=e;i<r;++i)f+=toHex(t[i]);return f}function utf16leSlice(t,e,r){for(var n=t.slice(e,r),f="",i=0;i<n.length;i+=2)f+=String.fromCharCode(n[i]+256*n[i+1]);return f}function checkOffset(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function checkInt(t,e,r,n,f,i){if(!Buffer.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>f||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function objectWriteUInt16(t,e,r,n){e<0&&(e=65535+e+1);for(var f=0,i=Math.min(t.length-r,2);f<i;++f)t[r+f]=(e&255<<8*(n?f:1-f))>>>8*(n?f:1-f)}function objectWriteUInt32(t,e,r,n){e<0&&(e=4294967295+e+1);for(var f=0,i=Math.min(t.length-r,4);f<i;++f)t[r+f]=e>>>8*(n?f:3-f)&255}function checkIEEE754(t,e,r,n,f,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function writeFloat(t,e,r,n,f){return f||checkIEEE754(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),ieee754.write(t,e,r,n,23,4),r+4}function writeDouble(t,e,r,n,f){return f||checkIEEE754(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),ieee754.write(t,e,r,n,52,8),r+8}function base64clean(t){if(t=stringtrim(t).replace(INVALID_BASE64_RE,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function stringtrim(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function toHex(t){return t<16?"0"+t.toString(16):t.toString(16)}function utf8ToBytes(t,e){e=e||1/0;for(var r,n=t.length,f=null,i=[],o=0;o<n;++o){if(r=t.charCodeAt(o),r>55295&&r<57344){if(!f){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&i.push(239,191,189);continue}f=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),f=r;continue}r=(f-55296<<10|r-56320)+65536}else f&&(e-=3)>-1&&i.push(239,191,189);if(f=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function asciiToBytes(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function utf16leToBytes(t,e){for(var r,n,f,i=[],o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),n=r>>8,f=r%256,i.push(f),i.push(n);return i}function base64ToBytes(t){return base64.toByteArray(base64clean(t))}function blitBuffer(t,e,r,n){for(var f=0;f<n&&!(f+r>=e.length||f>=t.length);++f)e[f+r]=t[f];return f}function isnan(t){return t!==t}var base64=_dereq_("base64-js"),ieee754=_dereq_("ieee754"),isArray=_dereq_("isarray");exports.Buffer=Buffer,exports.SlowBuffer=SlowBuffer,exports.INSPECT_MAX_BYTES=50,Buffer.TYPED_ARRAY_SUPPORT=void 0!==global.TYPED_ARRAY_SUPPORT?global.TYPED_ARRAY_SUPPORT:typedArraySupport(),exports.kMaxLength=kMaxLength(),Buffer.poolSize=8192,Buffer._augment=function(t){return t.__proto__=Buffer.prototype,t},Buffer.from=function(t,e,r){return from(null,t,e,r)},Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0})),Buffer.alloc=function(t,e,r){return alloc(null,t,e,r)},Buffer.allocUnsafe=function(t){return allocUnsafe(null,t)},Buffer.allocUnsafeSlow=function(t){return allocUnsafe(null,t)},Buffer.isBuffer=function(t){return!(null==t||!t._isBuffer)},Buffer.compare=function(t,e){if(!Buffer.isBuffer(t)||!Buffer.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,f=0,i=Math.min(r,n);f<i;++f)if(t[f]!==e[f]){r=t[f],n=e[f];break}return r<n?-1:n<r?1:0},Buffer.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.concat=function(t,e){if(!isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return Buffer.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=Buffer.allocUnsafe(e),f=0;for(r=0;r<t.length;++r){var i=t[r];if(!Buffer.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,f),f+=i.length}return n},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)swap(this,e,e+1);return this},Buffer.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)swap(this,e,e+3),swap(this,e+1,e+2);return this},Buffer.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)swap(this,e,e+7),swap(this,e+1,e+6),swap(this,e+2,e+5),swap(this,e+3,e+4);return this},Buffer.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?utf8Slice(this,0,t):slowToString.apply(this,arguments)},Buffer.prototype.equals=function(t){if(!Buffer.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===Buffer.compare(this,t)},Buffer.prototype.inspect=function(){var t="",e=exports.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},Buffer.prototype.compare=function(t,e,r,n,f){if(!Buffer.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===f&&(f=this.length),e<0||r>t.length||n<0||f>this.length)throw new RangeError("out of range index");if(n>=f&&e>=r)return 0;if(n>=f)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,f>>>=0,this===t)return 0;for(var i=f-n,o=r-e,u=Math.min(i,o),s=this.slice(n,f),a=t.slice(e,r),h=0;h<u;++h)if(s[h]!==a[h]){i=s[h],o=a[h];break}return i<o?-1:o<i?1:0},Buffer.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1},Buffer.prototype.indexOf=function(t,e,r){return bidirectionalIndexOf(this,t,e,r,!0)},Buffer.prototype.lastIndexOf=function(t,e,r){return bidirectionalIndexOf(this,t,e,r,!1)},Buffer.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var f=this.length-e;if((void 0===r||r>f)&&(r=f),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return hexWrite(this,t,e,r);case"utf8":case"utf-8":return utf8Write(this,t,e,r);case"ascii":return asciiWrite(this,t,e,r);case"latin1":case"binary":return latin1Write(this,t,e,r);case"base64":return base64Write(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;Buffer.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e<t&&(e=t);var n;if(Buffer.TYPED_ARRAY_SUPPORT)n=this.subarray(t,e),n.__proto__=Buffer.prototype;else{var f=e-t;n=new Buffer(f,void 0);for(var i=0;i<f;++i)n[i]=this[i+t]}return n},Buffer.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||checkOffset(t,e,this.length);for(var n=this[t],f=1,i=0;++i<e&&(f*=256);)n+=this[t+i]*f;return n},Buffer.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||checkOffset(t,e,this.length);for(var n=this[t+--e],f=1;e>0&&(f*=256);)n+=this[t+--e]*f;return n},Buffer.prototype.readUInt8=function(t,e){return e||checkOffset(t,1,this.length),this[t]},Buffer.prototype.readUInt16LE=function(t,e){return e||checkOffset(t,2,this.length),this[t]|this[t+1]<<8},Buffer.prototype.readUInt16BE=function(t,e){return e||checkOffset(t,2,this.length),this[t]<<8|this[t+1]},Buffer.prototype.readUInt32LE=function(t,e){return e||checkOffset(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},Buffer.prototype.readUInt32BE=function(t,e){return e||checkOffset(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Buffer.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||checkOffset(t,e,this.length);for(var n=this[t],f=1,i=0;++i<e&&(f*=256);)n+=this[t+i]*f;return f*=128,n>=f&&(n-=Math.pow(2,8*e)),n},Buffer.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||checkOffset(t,e,this.length);for(var n=e,f=1,i=this[t+--n];n>0&&(f*=256);)i+=this[t+--n]*f;return f*=128,i>=f&&(i-=Math.pow(2,8*e)),i},Buffer.prototype.readInt8=function(t,e){return e||checkOffset(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},Buffer.prototype.readInt16LE=function(t,e){e||checkOffset(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function(t,e){e||checkOffset(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function(t,e){return e||checkOffset(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Buffer.prototype.readInt32BE=function(t,e){return e||checkOffset(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Buffer.prototype.readFloatLE=function(t,e){return e||checkOffset(t,4,this.length),ieee754.read(this,t,!0,23,4)},Buffer.prototype.readFloatBE=function(t,e){return e||checkOffset(t,4,this.length),ieee754.read(this,t,!1,23,4)},Buffer.prototype.readDoubleLE=function(t,e){return e||checkOffset(t,8,this.length),ieee754.read(this,t,!0,52,8)},Buffer.prototype.readDoubleBE=function(t,e){return e||checkOffset(t,8,this.length),ieee754.read(this,t,!1,52,8)},Buffer.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e|=0,r|=0,!n){var f=Math.pow(2,8*r)-1;checkInt(this,t,e,r,f,0)}var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},Buffer.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e|=0,r|=0,!n){var f=Math.pow(2,8*r)-1;checkInt(this,t,e,r,f,0)}var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},Buffer.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},Buffer.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):objectWriteUInt16(this,t,e,!0),e+2},Buffer.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):objectWriteUInt16(this,t,e,!1),e+2},Buffer.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):objectWriteUInt32(this,t,e,!0),e+4},Buffer.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):objectWriteUInt32(this,t,e,!1),e+4},Buffer.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var f=Math.pow(2,8*r-1);checkInt(this,t,e,r,f-1,-f)}var i=0,o=1,u=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===u&&0!==this[e+i-1]&&(u=1),this[e+i]=(t/o>>0)-u&255;return e+r},Buffer.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var f=Math.pow(2,8*r-1);checkInt(this,t,e,r,f-1,-f)}var i=r-1,o=1,u=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===u&&0!==this[e+i+1]&&(u=1),this[e+i]=(t/o>>0)-u&255;return e+r},Buffer.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},Buffer.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):objectWriteUInt16(this,t,e,!0),e+2},Buffer.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):objectWriteUInt16(this,t,e,!1),e+2},Buffer.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):objectWriteUInt32(this,t,e,!0),e+4},Buffer.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):objectWriteUInt32(this,t,e,!1),e+4},Buffer.prototype.writeFloatLE=function(t,e,r){return writeFloat(this,t,e,!0,r)},Buffer.prototype.writeFloatBE=function(t,e,r){return writeFloat(this,t,e,!1,r)},Buffer.prototype.writeDoubleLE=function(t,e,r){return writeDouble(this,t,e,!0,r)},Buffer.prototype.writeDoubleBE=function(t,e,r){return writeDouble(this,t,e,!1,r)},Buffer.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var f,i=n-r;if(this===t&&r<e&&e<n)for(f=i-1;f>=0;--f)t[f+e]=this[f+r];else if(i<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(f=0;f<i;++f)t[f+e]=this[f+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},Buffer.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var f=t.charCodeAt(0);f<256&&(t=f)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!Buffer.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var i;if("number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var o=Buffer.isBuffer(t)?t:utf8ToBytes(new Buffer(t,n).toString()),u=o.length;for(i=0;i<r-e;++i)this[i+e]=o[i%u]}return this};var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g;
  18. }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  19. },{"base64-js":4,"ieee754":16,"isarray":22}],8:[function(_dereq_,module,exports){
  20. function useColors(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function formatArgs(){var o=arguments,e=this.useColors;if(o[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+o[0]+(e?"%c ":" "),!e)return o;var r="color: "+this.color;o=[o[0],r,"color: inherit"].concat(Array.prototype.slice.call(o,1));var t=0,s=0;return o[0].replace(/%[a-z%]/g,function(o){"%%"!==o&&(t++,"%c"===o&&(s=t))}),o.splice(s,0,r),o}function log(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(o){try{null==o?exports.storage.removeItem("debug"):exports.storage.debug=o}catch(o){}}function load(){var o;try{o=exports.storage.debug}catch(o){}return o}function localstorage(){try{return window.localStorage}catch(o){}}exports=module.exports=_dereq_("./debug"),exports.log=log,exports.formatArgs=formatArgs,exports.save=save,exports.load=load,exports.useColors=useColors,exports.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:localstorage(),exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],exports.formatters.j=function(o){return JSON.stringify(o)},exports.enable(load());
  21. },{"./debug":9}],9:[function(_dereq_,module,exports){
  22. function selectColor(){return exports.colors[prevColor++%exports.colors.length]}function debug(e){function r(){}function o(){var e=o;null==e.useColors&&(e.useColors=exports.useColors()),null==e.color&&e.useColors&&(e.color=selectColor());var r=Array.prototype.slice.call(arguments);r[0]=exports.coerce(r[0]),"string"!=typeof r[0]&&(r=["%o"].concat(r));var s=0;r[0]=r[0].replace(/%([a-z%])/g,function(o,t){if("%%"===o)return o;s++;var n=exports.formatters[t];if("function"==typeof n){var l=r[s];o=n.call(e,l),r.splice(s,1),s--}return o}),"function"==typeof exports.formatArgs&&(r=exports.formatArgs.apply(e,r));var t=o.log||exports.log||console.log.bind(console);t.apply(e,r)}r.enabled=!1,o.enabled=!0;var s=exports.enabled(e)?o:r;return s.namespace=e,s}function enable(e){exports.save(e);for(var r=(e||"").split(/[\s,]+/),o=r.length,s=0;s<o;s++)r[s]&&(e=r[s].replace(/\*/g,".*?"),"-"===e[0]?exports.skips.push(new RegExp("^"+e.substr(1)+"$")):exports.names.push(new RegExp("^"+e+"$")))}function disable(){exports.enable("")}function enabled(e){var r,o;for(r=0,o=exports.skips.length;r<o;r++)if(exports.skips[r].test(e))return!1;for(r=0,o=exports.names.length;r<o;r++)if(exports.names[r].test(e))return!0;return!1}function coerce(e){return e instanceof Error?e.stack||e.message:e}exports=module.exports=debug,exports.coerce=coerce,exports.disable=disable,exports.enable=enable,exports.enabled=enabled,exports.names=[],exports.skips=[],exports.formatters={};var prevColor=0;
  23. },{}],10:[function(_dereq_,module,exports){
  24. "use strict";function toObject(r){if(null===r||void 0===r)throw new TypeError("Sources cannot be null or undefined");return Object(r)}function assignKey(r,e,n){var t=e[n];if(void 0!==t&&null!==t){if(hasOwnProperty.call(r,n)&&(void 0===r[n]||null===r[n]))throw new TypeError("Cannot convert undefined or null to object ("+n+")");hasOwnProperty.call(r,n)&&isObj(t)?r[n]=assign(Object(r[n]),e[n]):r[n]=t}}function assign(r,e){if(r===e)return r;e=Object(e);for(var n in e)hasOwnProperty.call(e,n)&&assignKey(r,e,n);if(Object.getOwnPropertySymbols)for(var t=Object.getOwnPropertySymbols(e),o=0;o<t.length;o++)propIsEnumerable.call(e,t[o])&&assignKey(r,e,t[o]);return r}var isObj=_dereq_("is-obj"),hasOwnProperty=Object.prototype.hasOwnProperty,propIsEnumerable=Object.prototype.propertyIsEnumerable;module.exports=function(r){r=toObject(r);for(var e=1;e<arguments.length;e++)assign(r,arguments[e]);return r};
  25. },{"is-obj":21}],11:[function(_dereq_,module,exports){
  26. !function(t,r,n,a){"use strict";function l(e,t){for(var r=0,n=e.length;r<n;r++)m(e[r],t)}function i(e){for(var t,r=0,n=e.length;r<n;r++)t=e[r],y(t,H[u(t)])}function o(e){return function(t){ae(t)&&(m(t,e),l(t.querySelectorAll(x),e))}}function u(e){var t=oe.call(e,"is"),r=e.nodeName.toUpperCase(),n=G.call(U,t?k+t.toUpperCase():_+r);return t&&-1<n&&!c(r,t)?-1:n}function c(e,t){return-1<x.indexOf(e+'[is="'+t+'"]')}function s(e){var t=e.currentTarget,r=e.attrChange,n=e.attrName,a=e.target;me&&(!a||a===t)&&t.attributeChangedCallback&&"style"!==n&&e.prevValue!==e.newValue&&t.attributeChangedCallback(n,r===e[F]?null:e.prevValue,r===e[I]?null:e.newValue)}function d(e){var t=o(e);return function(e){g.push(t,e.target)}}function f(e){be&&(be=!1,e.currentTarget.removeEventListener(P,f)),l((e.target||r).querySelectorAll(x),e.detail===T?T:L),ne&&p()}function h(e,t){var r=this;ue.call(r,e,t),C.call(r,{target:r})}function v(e,t){ee(e,t),O?O.observe(e,de):(pe&&(e.setAttribute=h,e[w]=E(e),e.addEventListener(R,C)),e.addEventListener(D,s)),e.createdCallback&&me&&(e.created=!0,e.createdCallback(),e.created=!1)}function p(){for(var e,t=0,r=le.length;t<r;t++)e=le[t],Z.contains(e)||(r--,le.splice(t--,1),m(e,T))}function b(e){throw new Error("A "+e+" type is already registered")}function m(e,t){var r,n=u(e);-1<n&&(N(e,H[n]),n=0,t!==L||e[L]?t===T&&!e[T]&&(e[L]=!1,e[T]=!0,n=1):(e[T]=!1,e[L]=!0,n=1,ne&&G.call(le,e)<0&&le.push(e)),n&&(r=e[t+"Callback"])&&r.call(e))}if(!(a in r)){var g,C,A,E,O,N,y,w="__"+a+(1e5*Math.random()>>0),L="attached",T="detached",M="extends",F="ADDITION",V="MODIFICATION",I="REMOVAL",D="DOMAttrModified",P="DOMContentLoaded",R="DOMSubtreeModified",_="<",k="=",q=/^[A-Z][A-Z0-9]*(?:-[A-Z0-9]+)+$/,S=["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"],U=[],H=[],x="",Z=r.documentElement,G=U.indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},j=n.prototype,z=j.hasOwnProperty,K=j.isPrototypeOf,W=n.defineProperty,X=n.getOwnPropertyDescriptor,Y=n.getOwnPropertyNames,$=n.getPrototypeOf,B=n.setPrototypeOf,J=!!n.__proto__,Q=n.create||function e(t){return t?(e.prototype=t,new e):this},ee=B||(J?function(e,t){return e.__proto__=t,e}:Y&&X?function(){function e(e,t){for(var r,n=Y(t),a=0,l=n.length;a<l;a++)r=n[a],z.call(e,r)||W(e,r,X(t,r))}return function(t,r){do e(t,r);while((r=$(r))&&!K.call(r,t));return t}}():function(e,t){for(var r in t)e[r]=t[r];return e}),te=t.MutationObserver||t.WebKitMutationObserver,re=(t.HTMLElement||t.Element||t.Node).prototype,ne=!K.call(re,Z),ae=ne?function(e){return 1===e.nodeType}:function(e){return K.call(re,e)},le=ne&&[],ie=re.cloneNode,oe=re.getAttribute,ue=re.setAttribute,ce=re.removeAttribute,se=r.createElement,de=te&&{attributes:!0,characterData:!0,attributeOldValue:!0},fe=te||function(e){pe=!1,Z.removeEventListener(D,fe)},he=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,10)},ve=!1,pe=!0,be=!0,me=!0;B||J?(N=function(e,t){K.call(t,e)||v(e,t)},y=v):(N=function(e,t){e[w]||(e[w]=n(!0),v(e,t))},y=N),ne?(pe=!1,function(){var t=X(re,"addEventListener"),r=t.value,n=function(e){var t=new CustomEvent(D,{bubbles:!0});t.attrName=e,t.prevValue=oe.call(this,e),t.newValue=null,t[I]=t.attrChange=2,ce.call(this,e),this.dispatchEvent(t)},a=function(t,r){var n=this.hasAttribute(t),a=n&&oe.call(this,t);e=new CustomEvent(D,{bubbles:!0}),ue.call(this,t,r),e.attrName=t,e.prevValue=n?a:null,e.newValue=r,n?e[V]=e.attrChange=1:e[F]=e.attrChange=0,this.dispatchEvent(e)},l=function(e){var t,r=e.currentTarget,n=r[w],a=e.propertyName;n.hasOwnProperty(a)&&(n=n[a],t=new CustomEvent(D,{bubbles:!0}),t.attrName=n.name,t.prevValue=n.value||null,t.newValue=n.value=r[a]||null,null==t.prevValue?t[F]=t.attrChange=0:t[V]=t.attrChange=1,r.dispatchEvent(t))};t.value=function(e,t,i){e===D&&this.attributeChangedCallback&&this.setAttribute!==a&&(this[w]={className:{name:"class",value:this.className}},this.setAttribute=a,this.removeAttribute=n,r.call(this,"propertychange",l)),r.call(this,e,t,i)},W(re,"addEventListener",t)}()):te||(Z.addEventListener(D,fe),Z.setAttribute(w,1),Z.removeAttribute(w),pe&&(C=function(e){var t,r,n,a=this;if(a===e.target){t=a[w],a[w]=r=E(a);for(n in r){if(!(n in t))return A(0,a,n,t[n],r[n],F);if(r[n]!==t[n])return A(1,a,n,t[n],r[n],V)}for(n in t)if(!(n in r))return A(2,a,n,t[n],r[n],I)}},A=function(e,t,r,n,a,l){var i={attrChange:e,currentTarget:t,attrName:r,prevValue:n,newValue:a};i[l]=e,s(i)},E=function(e){for(var t,r,n={},a=e.attributes,l=0,i=a.length;l<i;l++)t=a[l],r=t.name,"setAttribute"!==r&&(n[r]=t.value);return n})),r[a]=function(e,t){if(n=e.toUpperCase(),ve||(ve=!0,te?(O=function(e,t){function r(e,t){for(var r=0,n=e.length;r<n;t(e[r++]));}return new te(function(n){for(var a,l,i,o=0,u=n.length;o<u;o++)a=n[o],"childList"===a.type?(r(a.addedNodes,e),r(a.removedNodes,t)):(l=a.target,me&&l.attributeChangedCallback&&"style"!==a.attributeName&&(i=oe.call(l,a.attributeName),i!==a.oldValue&&l.attributeChangedCallback(a.attributeName,a.oldValue,i)))})}(o(L),o(T)),O.observe(r,{childList:!0,subtree:!0})):(g=[],he(function e(){for(;g.length;)g.shift().call(null,g.shift());he(e)}),r.addEventListener("DOMNodeInserted",d(L)),r.addEventListener("DOMNodeRemoved",d(T))),r.addEventListener(P,f),r.addEventListener("readystatechange",f),r.createElement=function(e,t){var n=se.apply(r,arguments),a=""+e,l=G.call(U,(t?k:_)+(t||a).toUpperCase()),i=-1<l;return t&&(n.setAttribute("is",t=t.toLowerCase()),i&&(i=c(a.toUpperCase(),t))),me=!r.createElement.innerHTMLHelper,i&&y(n,H[l]),n},re.cloneNode=function(e){var t=ie.call(this,!!e),r=u(t);return-1<r&&y(t,H[r]),e&&i(t.querySelectorAll(x)),t}),-2<G.call(U,k+n)+G.call(U,_+n)&&b(e),!q.test(n)||-1<G.call(S,n))throw new Error("The type "+e+" is invalid");var n,a,s=function(){return v?r.createElement(p,n):r.createElement(p)},h=t||j,v=z.call(h,M),p=v?t[M].toUpperCase():n;return v&&-1<G.call(U,_+p)&&b(p),a=U.push((v?k:_)+n)-1,x=x.concat(x.length?",":"",v?p+'[is="'+e.toLowerCase()+'"]':p),s.prototype=H[a]=z.call(h,"prototype")?h.prototype:Q(re),l(r.querySelectorAll(x),L),s}}}(window,document,Object,"registerElement");
  27. },{}],12:[function(_dereq_,module,exports){
  28. module.exports=function(r){switch(r){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}};
  29. },{}],13:[function(_dereq_,module,exports){
  30. function flattenVertexData(e,t,r){if(!e)throw new TypeError("must specify data as first parameter");if(r=0|+(r||0),Array.isArray(e)&&Array.isArray(e[0])){var a=e[0].length,n=e.length*a;t&&"string"!=typeof t||(t=new(dtype(t||"float32"))(n+r));var o=t.length-r;if(n!==o)throw new Error("source length "+n+" ("+a+"x"+e.length+") does not match destination length "+o);for(var s=0,f=r;s<e.length;s++)for(var l=0;l<a;l++)t[f++]=e[s][l]}else if(t&&"string"!=typeof t)t.set(e,r);else{var i=dtype(t||"float32");0===r?t=new i(e):(t=new i(e.length+r),t.set(e,r))}return t}var dtype=_dereq_("dtype");module.exports=flattenVertexData;
  31. },{"dtype":12}],14:[function(_dereq_,module,exports){
  32. function forEach(r,t,o){if(!isFunction(t))throw new TypeError("iterator must be a function");arguments.length<3&&(o=this),"[object Array]"===toString.call(r)?forEachArray(r,t,o):"string"==typeof r?forEachString(r,t,o):forEachObject(r,t,o)}function forEachArray(r,t,o){for(var n=0,a=r.length;n<a;n++)hasOwnProperty.call(r,n)&&t.call(o,r[n],n,r)}function forEachString(r,t,o){for(var n=0,a=r.length;n<a;n++)t.call(o,r.charAt(n),n,r)}function forEachObject(r,t,o){for(var n in r)hasOwnProperty.call(r,n)&&t.call(o,r[n],n,r)}var isFunction=_dereq_("is-function");module.exports=forEach;var toString=Object.prototype.toString,hasOwnProperty=Object.prototype.hasOwnProperty;
  33. },{"is-function":20}],15:[function(_dereq_,module,exports){
  34. (function (global){
  35. "undefined"!=typeof window?module.exports=window:"undefined"!=typeof global?module.exports=global:"undefined"!=typeof self?module.exports=self:module.exports={};
  36. }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  37. },{}],16:[function(_dereq_,module,exports){
  38. exports.read=function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<<w)-1,e=f>>1,i=-7,N=t?h-1:0,n=t?-1:1,s=a[o+N];for(N+=n,M=s&(1<<-i)-1,s>>=-i,i+=w;i>0;M=256*M+a[o+N],N+=n,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+a[o+N],N+=n,i-=8);if(0===M)M=1-e;else{if(M===f)return p?NaN:(s?-1:1)*(1/0);p+=Math.pow(2,r),M-=e}return(s?-1:1)*p*Math.pow(2,M-r)},exports.write=function(a,o,t,r,h,M){var p,w,f,e=8*M-h-1,i=(1<<e)-1,N=i>>1,n=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,p=i):(p=Math.floor(Math.log(o)/Math.LN2),o*(f=Math.pow(2,-p))<1&&(p--,f*=2),o+=p+N>=1?n/f:n*Math.pow(2,1-N),o*f>=2&&(p++,f/=2),p+N>=i?(w=0,p=i):p+N>=1?(w=(o*f-1)*Math.pow(2,h),p+=N):(w=o*Math.pow(2,N-1)*Math.pow(2,h),p=0));h>=8;a[t+s]=255&w,s+=u,w/=256,h-=8);for(p=p<<h|w,e+=h;e>0;a[t+s]=255&p,s+=u,p/=256,e-=8);a[t+s-u]|=128*l};
  39. },{}],17:[function(_dereq_,module,exports){
  40. module.exports=function(r){if(!r||"string"!=typeof r)throw new Error("must specify property for indexof search");return new Function("array","value","start",["start = start || 0","for (var i=start; i<array.length; i++)",' if (array[i]["'+r+'"] === value)'," return i","return -1"].join("\n"))};
  41. },{}],18:[function(_dereq_,module,exports){
  42. "function"==typeof Object.create?module.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:module.exports=function(t,e){t.super_=e;var o=function(){};o.prototype=e.prototype,t.prototype=new o,t.prototype.constructor=t};
  43. },{}],19:[function(_dereq_,module,exports){
  44. function isBuffer(f){return!!f.constructor&&"function"==typeof f.constructor.isBuffer&&f.constructor.isBuffer(f)}function isSlowBuffer(f){return"function"==typeof f.readFloatLE&&"function"==typeof f.slice&&isBuffer(f.slice(0,0))}module.exports=function(f){return null!=f&&(isBuffer(f)||isSlowBuffer(f)||!!f._isBuffer)};
  45. },{}],20:[function(_dereq_,module,exports){
  46. function isFunction(o){var t=toString.call(o);return"[object Function]"===t||"function"==typeof o&&"[object RegExp]"!==t||"undefined"!=typeof window&&(o===window.setTimeout||o===window.alert||o===window.confirm||o===window.prompt)}module.exports=isFunction;var toString=Object.prototype.toString;
  47. },{}],21:[function(_dereq_,module,exports){
  48. "use strict";module.exports=function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)};
  49. },{}],22:[function(_dereq_,module,exports){
  50. var toString={}.toString;module.exports=Array.isArray||function(r){return"[object Array]"==toString.call(r)};
  51. },{}],23:[function(_dereq_,module,exports){
  52. function TextLayout(t){this.glyphs=[],this._measure=this.computeMetrics.bind(this),this.update(t)}function addGetter(t){Object.defineProperty(TextLayout.prototype,t,{get:wrapper(t),configurable:!0})}function wrapper(t){return new Function(["return function "+t+"() {"," return this._"+t,"}"].join("\n"))()}function getGlyphById(t,e){if(!t.chars||0===t.chars.length)return null;var r=findChar(t.chars,e);return r>=0?t.chars[r]:null}function getXHeight(t){for(var e=0;e<X_HEIGHTS.length;e++){var r=X_HEIGHTS[e].charCodeAt(0),i=findChar(t.chars,r);if(i>=0)return t.chars[i].height}return 0}function getMGlyph(t){for(var e=0;e<M_WIDTHS.length;e++){var r=M_WIDTHS[e].charCodeAt(0),i=findChar(t.chars,r);if(i>=0)return t.chars[i]}return 0}function getCapHeight(t){for(var e=0;e<CAP_HEIGHTS.length;e++){var r=CAP_HEIGHTS[e].charCodeAt(0),i=findChar(t.chars,r);if(i>=0)return t.chars[i].height}return 0}function getKerning(t,e,r){if(!t.kernings||0===t.kernings.length)return 0;for(var i=t.kernings,n=0;n<i.length;n++){var a=i[n];if(a.first===e&&a.second===r)return a.amount}return 0}function getAlignType(t){return"center"===t?ALIGN_CENTER:"right"===t?ALIGN_RIGHT:ALIGN_LEFT}var wordWrap=_dereq_("word-wrapper"),xtend=_dereq_("xtend"),findChar=_dereq_("indexof-property")("id"),number=_dereq_("as-number"),X_HEIGHTS=["x","e","a","o","n","s","r","c","u","m","v","w","z"],M_WIDTHS=["m","w"],CAP_HEIGHTS=["H","I","N","E","F","K","L","T","U","V","W","X","Y","Z"],TAB_ID="\t".charCodeAt(0),SPACE_ID=" ".charCodeAt(0),ALIGN_LEFT=0,ALIGN_CENTER=1,ALIGN_RIGHT=2;module.exports=function(t){return new TextLayout(t)},TextLayout.prototype.update=function(t){if(t=xtend({measure:this._measure},t),this._opt=t,this._opt.tabSize=number(this._opt.tabSize,4),!t.font)throw new Error("must provide a valid bitmap font");var e=this.glyphs,r=t.text||"",i=t.font;this._setupSpaceGlyphs(i);var n=wordWrap.lines(r,t),a=t.width||0;e.length=0;var h=n.reduce(function(t,e){return Math.max(t,e.width,a)},0),o=0,s=0,c=number(t.lineHeight,i.common.lineHeight),u=i.common.base,l=c-u,p=t.letterSpacing||0,d=c*n.length-l,f=getAlignType(this._opt.align);s-=d,this._width=h,this._height=d,this._descender=c-u,this._baseline=u,this._xHeight=getXHeight(i),this._capHeight=getCapHeight(i),this._lineHeight=c,this._ascender=c-l-this._xHeight;var g=this;n.forEach(function(t,n){for(var a,u=t.start,l=t.end,d=t.width,_=u;_<l;_++){var y=r.charCodeAt(_),G=g.getGlyph(i,y);if(G){a&&(o+=getKerning(i,a.id,G.id));var T=o;f===ALIGN_CENTER?T+=(h-d)/2:f===ALIGN_RIGHT&&(T+=h-d),e.push({position:[T,s],data:G,index:_,line:n}),o+=G.xadvance+p,a=G}}s+=c,o=0}),this._linesTotal=n.length},TextLayout.prototype._setupSpaceGlyphs=function(t){if(this._fallbackSpaceGlyph=null,this._fallbackTabGlyph=null,t.chars&&0!==t.chars.length){var e=getGlyphById(t,SPACE_ID)||getMGlyph(t)||t.chars[0],r=this._opt.tabSize*e.xadvance;this._fallbackSpaceGlyph=e,this._fallbackTabGlyph=xtend(e,{x:0,y:0,xadvance:r,id:TAB_ID,xoffset:0,yoffset:0,width:0,height:0})}},TextLayout.prototype.getGlyph=function(t,e){var r=getGlyphById(t,e);return r?r:e===TAB_ID?this._fallbackTabGlyph:e===SPACE_ID?this._fallbackSpaceGlyph:null},TextLayout.prototype.computeMetrics=function(t,e,r,i){var n,a,h=this._opt.letterSpacing||0,o=this._opt.font,s=0,c=0,u=0;if(!o.chars||0===o.chars.length)return{start:e,end:e,width:0};r=Math.min(t.length,r);for(var l=e;l<r;l++){var p=t.charCodeAt(l),n=this.getGlyph(o,p);if(n){var d=(n.xoffset,a?getKerning(o,a.id,n.id):0);s+=d;var f=s+n.xadvance+h,g=s+n.width;if(g>=i||f>=i)break;s=f,c=g,a=n}u++}return a&&(c+=a.xoffset),{start:e,end:e+u,width:c}},["width","height","descender","ascender","xHeight","baseline","capHeight","lineHeight"].forEach(addGetter);
  53. },{"as-number":3,"indexof-property":17,"word-wrapper":72,"xtend":75}],24:[function(_dereq_,module,exports){
  54. (function (Buffer){
  55. function isArrayBuffer(r){var e=Object.prototype.toString;return"[object ArrayBuffer]"===e.call(r)}function getBinaryOpts(r){if(xml2)return xtend(r,{responseType:"arraybuffer"});if("undefined"==typeof window.XMLHttpRequest)throw new Error("your browser does not support XHR loading");var e=new window.XMLHttpRequest;return e.overrideMimeType("text/plain; charset=x-user-defined"),xtend({xhr:e},r)}var xhr=_dereq_("xhr"),noop=function(){},parseASCII=_dereq_("parse-bmfont-ascii"),parseXML=_dereq_("parse-bmfont-xml"),readBinary=_dereq_("parse-bmfont-binary"),isBinaryFormat=_dereq_("./lib/is-binary"),xtend=_dereq_("xtend"),xml2=function(){return window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}();module.exports=function(r,e){e="function"==typeof e?e:noop,"string"==typeof r?r={uri:r}:r||(r={});var t=r.binary;t&&(r=getBinaryOpts(r)),xhr(r,function(t,n,i){if(t)return e(t);if(!/^2/.test(n.statusCode))return e(new Error("http status code: "+n.statusCode));if(!i)return e(new Error("no body result"));var o=!1;if(isArrayBuffer(i)){var a=new Uint8Array(i);i=new Buffer(a,"binary")}isBinaryFormat(i)&&(o=!0,"string"==typeof i&&(i=new Buffer(i,"binary"))),o||(Buffer.isBuffer(i)&&(i=i.toString(r.encoding)),i=i.trim());var s;try{var u=n.headers["content-type"];s=o?readBinary(i):/json/.test(u)||"{"===i.charAt(0)?JSON.parse(i):/xml/.test(u)||"<"===i.charAt(0)?parseXML(i):parseASCII(i)}catch(r){e(new Error("error parsing font "+r.message)),e=noop}e(null,s)})};
  56. }).call(this,_dereq_("buffer").Buffer)
  57. },{"./lib/is-binary":25,"buffer":7,"parse-bmfont-ascii":27,"parse-bmfont-binary":28,"parse-bmfont-xml":29,"xhr":73,"xtend":75}],25:[function(_dereq_,module,exports){
  58. (function (Buffer){
  59. var equal=_dereq_("buffer-equal"),HEADER=new Buffer([66,77,70,3]);module.exports=function(e){return"string"==typeof e?"BMF"===e.substring(0,3):e.length>4&&equal(e.slice(0,4),HEADER)};
  60. }).call(this,_dereq_("buffer").Buffer)
  61. },{"buffer":7,"buffer-equal":6}],26:[function(_dereq_,module,exports){
  62. "use strict";function toObject(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function shouldUseNative(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var r={},t=0;t<10;t++)r["_"+String.fromCharCode(t)]=t;var n=Object.getOwnPropertyNames(r).map(function(e){return r[e]});if("0123456789"!==n.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}var hasOwnProperty=Object.prototype.hasOwnProperty,propIsEnumerable=Object.prototype.propertyIsEnumerable;module.exports=shouldUseNative()?Object.assign:function(e,r){for(var t,n,o=toObject(e),a=1;a<arguments.length;a++){t=Object(arguments[a]);for(var c in t)hasOwnProperty.call(t,c)&&(o[c]=t[c]);if(Object.getOwnPropertySymbols){n=Object.getOwnPropertySymbols(t);for(var s=0;s<n.length;s++)propIsEnumerable.call(t,n[s])&&(o[n[s]]=t[n[s]])}}return o};
  63. },{}],27:[function(_dereq_,module,exports){
  64. function splitLine(e,r){if(e=e.replace(/\t+/g," ").trim(),!e)return null;var t=e.indexOf(" ");if(t===-1)throw new Error("no named row at line "+r);var a=e.substring(0,t);e=e.substring(t+1),e=e.replace(/letter=[\'\"]\S+[\'\"]/gi,""),e=e.split("="),e=e.map(function(e){return e.trim().match(/(".*?"|[^"\s]+)+(?=\s*|\s*$)/g)});for(var n=[],i=0;i<e.length;i++){var s=e[i];0===i?n.push({key:s[0],data:""}):i===e.length-1?n[n.length-1].data=parseData(s[0]):(n[n.length-1].data=parseData(s[0]),n.push({key:s[1],data:""}))}var o={key:a,data:{}};return n.forEach(function(e){o.data[e.key]=e.data}),o}function parseData(e){return e&&0!==e.length?0===e.indexOf('"')||0===e.indexOf("'")?e.substring(1,e.length-1):e.indexOf(",")!==-1?parseIntList(e):parseInt(e,10):""}function parseIntList(e){return e.split(",").map(function(e){return parseInt(e,10)})}module.exports=function(e){if(!e)throw new Error("no data provided");e=e.toString().trim();var r={pages:[],chars:[],kernings:[]},t=e.split(/\r\n?|\n/g);if(0===t.length)throw new Error("no data in BMFont file");for(var a=0;a<t.length;a++){var n=splitLine(t[a],a);if(n)if("page"===n.key){if("number"!=typeof n.data.id)throw new Error("malformed file at line "+a+" -- needs page id=N");if("string"!=typeof n.data.file)throw new Error("malformed file at line "+a+' -- needs page file="path"');r.pages[n.data.id]=n.data.file}else"chars"===n.key||"kernings"===n.key||("char"===n.key?r.chars.push(n.data):"kerning"===n.key?r.kernings.push(n.data):r[n.key]=n.data)}return r};
  65. },{}],28:[function(_dereq_,module,exports){
  66. function readBlock(r,e,n){if(n>e.length-1)return 0;var a=e.readUInt8(n++),t=e.readInt32LE(n);switch(n+=4,a){case 1:r.info=readInfo(e,n);break;case 2:r.common=readCommon(e,n);break;case 3:r.pages=readPages(e,n,t);break;case 4:r.chars=readChars(e,n,t);break;case 5:r.kernings=readKernings(e,n,t)}return 5+t}function readInfo(r,e){var n={};n.size=r.readInt16LE(e);var a=r.readUInt8(e+2);return n.smooth=a>>7&1,n.unicode=a>>6&1,n.italic=a>>5&1,n.bold=a>>4&1,a>>3&1&&(n.fixedHeight=1),n.charset=r.readUInt8(e+3)||"",n.stretchH=r.readUInt16LE(e+4),n.aa=r.readUInt8(e+6),n.padding=[r.readInt8(e+7),r.readInt8(e+8),r.readInt8(e+9),r.readInt8(e+10)],n.spacing=[r.readInt8(e+11),r.readInt8(e+12)],n.outline=r.readUInt8(e+13),n.face=readStringNT(r,e+14),n}function readCommon(r,e){var n={};n.lineHeight=r.readUInt16LE(e),n.base=r.readUInt16LE(e+2),n.scaleW=r.readUInt16LE(e+4),n.scaleH=r.readUInt16LE(e+6),n.pages=r.readUInt16LE(e+8);r.readUInt8(e+10);return n.packed=0,n.alphaChnl=r.readUInt8(e+11),n.redChnl=r.readUInt8(e+12),n.greenChnl=r.readUInt8(e+13),n.blueChnl=r.readUInt8(e+14),n}function readPages(r,e,n){for(var a=[],t=readNameNT(r,e),d=t.length+1,o=n/d,i=0;i<o;i++)a[i]=r.slice(e,e+t.length).toString("utf8"),e+=d;return a}function readChars(r,e,n){for(var a=[],t=n/20,d=0;d<t;d++){var o={},i=20*d;o.id=r.readUInt32LE(e+0+i),o.x=r.readUInt16LE(e+4+i),o.y=r.readUInt16LE(e+6+i),o.width=r.readUInt16LE(e+8+i),o.height=r.readUInt16LE(e+10+i),o.xoffset=r.readInt16LE(e+12+i),o.yoffset=r.readInt16LE(e+14+i),o.xadvance=r.readInt16LE(e+16+i),o.page=r.readUInt8(e+18+i),o.chnl=r.readUInt8(e+19+i),a[d]=o}return a}function readKernings(r,e,n){for(var a=[],t=n/10,d=0;d<t;d++){var o={},i=10*d;o.first=r.readUInt32LE(e+0+i),o.second=r.readUInt32LE(e+4+i),o.amount=r.readInt16LE(e+8+i),a[d]=o}return a}function readNameNT(r,e){for(var n=e;n<r.length&&0!==r[n];n++);return r.slice(e,n)}function readStringNT(r,e){return readNameNT(r,e).toString("utf8")}var HEADER=[66,77,70];module.exports=function(r){if(r.length<6)throw new Error("invalid buffer length for BMFont");var e=HEADER.every(function(e,n){return r.readUInt8(n)===e});if(!e)throw new Error("BMFont missing BMF byte header");var n=3,a=r.readUInt8(n++);if(a>3)throw new Error("Only supports BMFont Binary v3 (BMFont App v1.10)");for(var t={kernings:[],chars:[]},d=0;d<5;d++)n+=readBlock(t,r,n);return t};
  67. },{}],29:[function(_dereq_,module,exports){
  68. function getAttribs(e){var t=getAttribList(e);return t.reduce(function(e,t){var r=mapName(t.nodeName);return e[r]=t.nodeValue,e},{})}function getAttribList(e){for(var t=[],r=0;r<e.attributes.length;r++)t.push(e.attributes[r]);return t}function mapName(e){return NAME_MAP[e.toLowerCase()]||e}var parseAttributes=_dereq_("./parse-attribs"),parseFromString=_dereq_("xml-parse-from-string"),NAME_MAP={scaleh:"scaleH",scalew:"scaleW",stretchh:"stretchH",lineheight:"lineHeight",alphachnl:"alphaChnl",redchnl:"redChnl",greenchnl:"greenChnl",bluechnl:"blueChnl"};module.exports=function(e){e=e.toString();var t=parseFromString(e),r={pages:[],chars:[],kernings:[]};["info","common"].forEach(function(e){var a=t.getElementsByTagName(e)[0];a&&(r[e]=parseAttributes(getAttribs(a)))});var a=t.getElementsByTagName("pages")[0];if(!a)throw new Error("malformed file -- no <pages> element");for(var n=a.getElementsByTagName("page"),i=0;i<n.length;i++){var s=n[i],g=parseInt(s.getAttribute("id"),10),l=s.getAttribute("file");if(isNaN(g))throw new Error('malformed file -- page "id" attribute is NaN');if(!l)throw new Error('malformed file -- needs page "file" attribute');r.pages[parseInt(g,10)]=l}return["chars","kernings"].forEach(function(e){var a=t.getElementsByTagName(e)[0];if(a)for(var n=e.substring(0,e.length-1),i=a.getElementsByTagName(n),s=0;s<i.length;s++){var g=i[s];r[e].push(parseAttributes(getAttribs(g)))}}),r};
  69. },{"./parse-attribs":30,"xml-parse-from-string":74}],30:[function(_dereq_,module,exports){
  70. function parseIntList(t){return t.split(",").map(function(t){return parseInt(t,10)})}var GLYPH_DESIGNER_ERROR="chasrset";module.exports=function(t){GLYPH_DESIGNER_ERROR in t&&(t.charset=t[GLYPH_DESIGNER_ERROR],delete t[GLYPH_DESIGNER_ERROR]);for(var n in t)"face"!==n&&"charset"!==n&&("padding"===n||"spacing"===n?t[n]=parseIntList(t[n]):t[n]=parseInt(t[n],10));return t};
  71. },{}],31:[function(_dereq_,module,exports){
  72. var trim=_dereq_("trim"),forEach=_dereq_("for-each"),isArray=function(r){return"[object Array]"===Object.prototype.toString.call(r)};module.exports=function(r){if(!r)return{};var e={};return forEach(trim(r).split("\n"),function(r){var t=r.indexOf(":"),i=trim(r.slice(0,t)).toLowerCase(),o=trim(r.slice(t+1));"undefined"==typeof e[i]?e[i]=o:isArray(e[i])?e[i].push(o):e[i]=[e[i],o]}),e};
  73. },{"for-each":14,"trim":46}],32:[function(_dereq_,module,exports){
  74. (function (global){
  75. var performance=global.performance||{},present=function(){for(var e=["now","webkitNow","msNow","mozNow","oNow"];e.length;){var n=e.shift();if(n in performance)return performance[n].bind(performance)}var r=Date.now||function(){return(new Date).getTime()},o=(performance.timing||{}).navigationStart||r();return function(){return r()-o}}();present.performanceNow=performance.now,present.noConflict=function(){performance.now=present.performanceNow},present.conflict=function(){performance.now=present},present.conflict(),module.exports=present;
  76. }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  77. },{}],33:[function(_dereq_,module,exports){
  78. function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch(t){try{return cachedSetTimeout.call(null,e,0)}catch(t){return cachedSetTimeout.call(this,e,0)}}}function runClearTimeout(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(e);try{return cachedClearTimeout(e)}catch(t){try{return cachedClearTimeout.call(null,e)}catch(t){return cachedClearTimeout.call(this,e)}}}function cleanUpNextTick(){draining&&currentQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue.length;t;){for(currentQueue=queue,queue=[];++queueIndex<t;)currentQueue&&currentQueue[queueIndex].run();queueIndex=-1,t=queue.length}currentQueue=null,draining=!1,runClearTimeout(e)}}function Item(e,t){this.fun=e,this.array=t}function noop(){}var process=module.exports={},cachedSetTimeout,cachedClearTimeout;!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var queue=[],draining=!1,currentQueue,queueIndex=-1;process.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var u=1;u<arguments.length;u++)t[u-1]=arguments[u];queue.push(new Item(e,t)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.binding=function(e){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(e){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};
  79. },{}],34:[function(_dereq_,module,exports){
  80. !function(t){function e(t,e){return function(){t.apply(e,arguments)}}function n(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],f(t,e(r,this),e(i,this))}function o(t){var e=this;return null===this._state?void this._deferreds.push(t):void l(function(){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return void(e._state?t.resolve:t.reject)(e._value);var o;try{o=n(e._value)}catch(e){return void t.reject(e)}t.resolve(o)})}function r(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void f(e(n,t),e(r,this),e(i,this))}this._state=!0,this._value=t,u.call(this)}catch(t){i.call(this,t)}}function i(t){this._state=!1,this._value=t,u.call(this)}function u(){for(var t=0,e=this._deferreds.length;t<e;t++)o.call(this,this._deferreds[t]);this._deferreds=null}function c(t,e,n,o){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=o}function f(t,e,n){var o=!1;try{t(function(t){o||(o=!0,e(t))},function(t){o||(o=!0,n(t))})}catch(t){if(o)return;o=!0,n(t)}}var s=setTimeout,l="function"==typeof setImmediate&&setImmediate||function(t){s(t,1)},h=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};n.prototype.catch=function(t){return this.then(null,t)},n.prototype.then=function(t,e){var r=this;return new n(function(n,i){o.call(r,new c(t,e,n,i))})},n.all=function(){var t=Array.prototype.slice.call(1===arguments.length&&h(arguments[0])?arguments[0]:arguments);return new n(function(e,n){function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var c=u.then;if("function"==typeof c)return void c.call(u,function(t){o(i,t)},n)}t[i]=u,0===--r&&e(t)}catch(t){n(t)}}if(0===t.length)return e([]);for(var r=t.length,i=0;i<t.length;i++)o(i,t[i])})},n.resolve=function(t){return t&&"object"==typeof t&&t.constructor===n?t:new n(function(e){e(t)})},n.reject=function(t){return new n(function(e,n){n(t)})},n.race=function(t){return new n(function(e,n){for(var o=0,r=t.length;o<r;o++)t[o].then(e,n)})},n._setImmediateFn=function(t){l=t},"undefined"!=typeof module&&module.exports?module.exports=n:t.Promise||(t.Promise=n)}(this);
  81. },{}],35:[function(_dereq_,module,exports){
  82. var dtype=_dereq_("dtype"),anArray=_dereq_("an-array"),isBuffer=_dereq_("is-buffer"),CW=[0,2,3],CCW=[2,1,3];module.exports=function(r,e){r&&(anArray(r)||isBuffer(r))||(e=r||{},r=null),e="number"==typeof e?{count:e}:e||{};for(var t="string"==typeof e.type?e.type:"uint16",u="number"==typeof e.count?e.count:1,n=e.start||0,a=e.clockwise!==!1?CW:CCW,f=a[0],o=a[1],y=a[2],i=6*u,p=r||new(dtype(t))(i),s=0,c=0;s<i;s+=6,c+=4){var C=s+n;p[C+0]=c+0,p[C+1]=c+1,p[C+2]=c+2,p[C+3]=c+f,p[C+4]=c+o,p[C+5]=c+y}return p};
  83. },{"an-array":2,"dtype":12,"is-buffer":19}],36:[function(_dereq_,module,exports){
  84. function parse(r){var n=function(r){return r.trim()},e={};return getKeyValueChunks(r).map(n).filter(Boolean).forEach(function(r){var n=r.indexOf(":"),t=r.substr(0,n).trim(),i=r.substr(n+1).trim();e[t]=i}),e}function getKeyValueChunks(r){for(var n,e=[],t=0,i=";",u=/url\([^\)]+$/,s="";t<r.length;)n=r.indexOf(i,t),n===-1&&(n=r.length),s+=r.substring(t,n),u.test(s)?(s+=";",t=n+1):(e.push(s),s="",t=n+1);return e}function stringify(r){return Object.keys(r).map(function(n){return n+":"+r[n]}).join(";")}function normalize(r){return stringify(parse(r))}module.exports.parse=parse,module.exports.stringify=stringify,module.exports.normalize=normalize;
  85. },{}],37:[function(_dereq_,module,exports){
  86. function TextGeometry(e){Base.call(this),"string"==typeof e&&(e={text:e}),this._opt=assign({},e),e&&this.update(e)}var createLayout=_dereq_("layout-bmfont-text"),inherits=_dereq_("inherits"),createIndices=_dereq_("quad-indices"),buffer=_dereq_("three-buffer-vertex-data"),assign=_dereq_("object-assign"),vertices=_dereq_("./lib/vertices"),utils=_dereq_("./lib/utils"),Base=THREE.BufferGeometry;module.exports=function(e){return new TextGeometry(e)},inherits(TextGeometry,Base),TextGeometry.prototype.update=function(e){if("string"==typeof e&&(e={text:e}),e=assign({},this._opt,e),!e.font)throw new TypeError("must specify a { font } in options");this.layout=createLayout(e);var t=e.flipY!==!1,i=e.font,r=i.common.scaleW,o=i.common.scaleH,s=this.layout.glyphs.filter(function(e){var t=e.data;return t.width*t.height>0});this.visibleGlyphs=s;var n=vertices.positions(s),u=vertices.uvs(s,r,o,t),a=createIndices({clockwise:!0,type:"uint16",count:s.length});if(buffer.index(this,a,1,"uint16"),buffer.attr(this,"position",n,2),buffer.attr(this,"uv",u,2),!e.multipage&&"page"in this.attributes)this.removeAttribute("page");else if(e.multipage){var h=vertices.pages(s);buffer.attr(this,"page",h,1)}},TextGeometry.prototype.computeBoundingSphere=function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var e=this.attributes.position.array,t=this.attributes.position.itemSize;return!e||!t||e.length<2?(this.boundingSphere.radius=0,void this.boundingSphere.center.set(0,0,0)):(utils.computeSphere(e,this.boundingSphere),void(isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.')))},TextGeometry.prototype.computeBoundingBox=function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var e=this.boundingBox,t=this.attributes.position.array,i=this.attributes.position.itemSize;return!t||!i||t.length<2?void e.makeEmpty():void utils.computeBox(t,e)};
  87. },{"./lib/utils":38,"./lib/vertices":39,"inherits":18,"layout-bmfont-text":23,"object-assign":26,"quad-indices":35,"three-buffer-vertex-data":40}],38:[function(_dereq_,module,exports){
  88. function bounds(x){var m=x.length/itemSize;box.min[0]=x[0],box.min[1]=x[1],box.max[0]=x[0],box.max[1]=x[1];for(var o=0;o<m;o++){var i=x[o*itemSize+0],a=x[o*itemSize+1];box.min[0]=Math.min(i,box.min[0]),box.min[1]=Math.min(a,box.min[1]),box.max[0]=Math.max(i,box.max[0]),box.max[1]=Math.max(a,box.max[1])}}var itemSize=2,box={min:[0,0],max:[0,0]};module.exports.computeBox=function(x,m){bounds(x),m.min.set(box.min[0],box.min[1],0),m.max.set(box.max[0],box.max[1],0)},module.exports.computeSphere=function(x,m){bounds(x);var o=box.min[0],i=box.min[1],a=box.max[0],n=box.max[1],b=a-o,e=n-i,t=Math.sqrt(b*b+e*e);m.center.set(o+b/2,i+e/2,0),m.radius=t/2};
  89. },{}],39:[function(_dereq_,module,exports){
  90. module.exports.pages=function t(o){var t=new Float32Array(4*o.length*1),n=0;return o.forEach(function(o){var r=o.data.page||0;t[n++]=r,t[n++]=r,t[n++]=r,t[n++]=r}),t},module.exports.uvs=function t(o,n,r,a){var t=new Float32Array(4*o.length*2),e=0;return o.forEach(function(o){var i=o.data,f=i.x+i.width,u=i.y+i.height,h=i.x/n,s=i.y/r,c=f/n,l=u/r;a&&(s=(r-i.y)/r,l=(r-u)/r),t[e++]=h,t[e++]=s,t[e++]=h,t[e++]=l,t[e++]=c,t[e++]=l,t[e++]=c,t[e++]=s}),t},module.exports.positions=function t(o){var t=new Float32Array(4*o.length*2),n=0;return o.forEach(function(o){var r=o.data,a=o.position[0]+r.xoffset,e=o.position[1]+r.yoffset,i=r.width,f=r.height;t[n++]=a,t[n++]=e,t[n++]=a,t[n++]=e+f,t[n++]=a+i,t[n++]=e+f,t[n++]=a+i,t[n++]=e}),t};
  91. },{}],40:[function(_dereq_,module,exports){
  92. function setIndex(e,t,r,n){"number"!=typeof r&&(r=1),"string"!=typeof n&&(n="uint16");var i=!e.index&&"function"!=typeof e.setIndex,a=i?e.getAttribute("index"):e.index,u=updateAttribute(a,t,r,n);u&&(i?e.addAttribute("index",u):e.index=u)}function setAttribute(e,t,r,n,i){if("number"!=typeof n&&(n=3),"string"!=typeof i&&(i="float32"),Array.isArray(r)&&Array.isArray(r[0])&&r[0].length!==n)throw new Error("Nested vertex array has unexpected size; expected "+n+" but found "+r[0].length);var a=e.getAttribute(t),u=updateAttribute(a,r,n,i);u&&e.addAttribute(t,u)}function updateAttribute(e,t,r,n){if(t=t||[],!e||rebuildAttribute(e,t,r)){t=flatten(t,n);var i=e&&"function"!=typeof e.setArray;return e&&!i||(i&&!warned&&(warned=!0,console.warn(["A WebGL buffer is being updated with a new size or itemSize, ","however this version of ThreeJS only supports fixed-size buffers.","\nThe old buffer may still be kept in memory.\n","To avoid memory leaks, it is recommended that you dispose ","your geometries and create new ones, or update to ThreeJS r82 or newer.\n","See here for discussion:\n","https://github.com/mrdoob/three.js/pull/9631"].join(""))),e=new THREE.BufferAttribute(t,r)),e.itemSize=r,e.needsUpdate=!0,"function"==typeof e.setArray&&e.setArray(t),e}return flatten(t,e.array),e.needsUpdate=!0,null}function rebuildAttribute(e,t,r){if(e.itemSize!==r)return!0;if(!e.array)return!0;var n=e.array.length;return Array.isArray(t)&&Array.isArray(t[0])?n!==t.length*r:n!==t.length}var flatten=_dereq_("flatten-vertex-data"),warned=!1;module.exports.attr=setAttribute,module.exports.index=setIndex;
  93. },{"flatten-vertex-data":13}],41:[function(_dereq_,module,exports){
  94. !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.THREE={})}(this,function(t){"use strict";function e(){}function r(t,e){this.x=t||0,this.y=e||0}function n(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function i(t,e,r,n){this._x=t||0,this._y=e||0,this._z=r||0,this._w=void 0!==n?n:1}function a(t,e,r){this.x=t||0,this.y=e||0,this.z=r||0}function o(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}function s(t,e,n,i,a,c,h,l,u,p){Object.defineProperty(this,"id",{value:oc++}),this.uuid=ac.generateUUID(),this.name="",this.image=void 0!==t?t:s.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:s.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:ts,this.wrapT=void 0!==i?i:ts,this.magFilter=void 0!==a?a:as,this.minFilter=void 0!==c?c:ss,this.anisotropy=void 0!==u?u:1,this.format=void 0!==h?h:ws,this.type=void 0!==l?l:cs,this.offset=new r(0,0),this.repeat=new r(1,1),this.center=new r(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new o,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==p?p:Zs,this.version=0,this.onUpdate=null}function c(t,e,r,n){this.x=t||0,this.y=e||0,this.z=r||0,this.w=void 0!==n?n:1}function h(t,e,r){this.uuid=ac.generateUUID(),this.width=t,this.height=e,this.scissor=new c(0,0,t,e),this.scissorTest=!1,this.viewport=new c(0,0,t,e),r=r||{},void 0===r.minFilter&&(r.minFilter=as),this.texture=new s(void 0,void 0,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),this.depthBuffer=void 0===r.depthBuffer||r.depthBuffer,this.stencilBuffer=void 0===r.stencilBuffer||r.stencilBuffer,this.depthTexture=void 0!==r.depthTexture?r.depthTexture:null}function l(t,e,r){h.call(this,t,e,r),this.activeCubeFace=0,this.activeMipMapLevel=0}function u(t,e,r,n,i,a,o,c,h,l,u,p){s.call(this,null,a,o,c,h,l,n,i,u,p),this.image={data:t,width:e,height:r},this.magFilter=void 0!==h?h:rs,this.minFilter=void 0!==l?l:rs,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function p(t,e,r,n,i,a,o,c,h,l){t=void 0!==t?t:[],e=void 0!==e?e:Xo,s.call(this,t,e,r,n,i,a,o,c,h,l),this.flipY=!1}function d(){this.seq=[],this.map={}}function f(t,e,r){var n=t[0];if(n<=0||n>0)return t;var i=e*r,a=hc[i];if(void 0===a&&(a=new Float32Array(i),hc[i]=a),0!==e){n.toArray(a,0);for(var o=1,s=0;o!==e;++o)s+=r,t[o].toArray(a,s)}return a}function m(t,e){var r=lc[e];void 0===r&&(r=new Int32Array(e),lc[e]=r);for(var n=0;n!==e;++n)r[n]=t.allocTextureUnit();return r}function v(t,e){t.uniform1f(this.addr,e)}function g(t,e){t.uniform1i(this.addr,e)}function y(t,e){void 0===e.x?t.uniform2fv(this.addr,e):t.uniform2f(this.addr,e.x,e.y)}function x(t,e){void 0!==e.x?t.uniform3f(this.addr,e.x,e.y,e.z):void 0!==e.r?t.uniform3f(this.addr,e.r,e.g,e.b):t.uniform3fv(this.addr,e)}function b(t,e){void 0===e.x?t.uniform4fv(this.addr,e):t.uniform4f(this.addr,e.x,e.y,e.z,e.w)}function _(t,e){t.uniformMatrix2fv(this.addr,!1,e.elements||e)}function w(t,e){void 0===e.elements?t.uniformMatrix3fv(this.addr,!1,e):(pc.set(e.elements),t.uniformMatrix3fv(this.addr,!1,pc))}function M(t,e){void 0===e.elements?t.uniformMatrix4fv(this.addr,!1,e):(uc.set(e.elements),t.uniformMatrix4fv(this.addr,!1,uc))}function E(t,e,r){var n=r.allocTextureUnit();t.uniform1i(this.addr,n),r.setTexture2D(e||sc,n)}function T(t,e,r){var n=r.allocTextureUnit();t.uniform1i(this.addr,n),r.setTextureCube(e||cc,n)}function S(t,e){t.uniform2iv(this.addr,e)}function A(t,e){t.uniform3iv(this.addr,e)}function R(t,e){t.uniform4iv(this.addr,e)}function L(t){switch(t){case 5126:return v;case 35664:return y;case 35665:return x;case 35666:return b;case 35674:return _;case 35675:return w;case 35676:return M;case 35678:case 36198:return E;case 35680:return T;case 5124:case 35670:return g;case 35667:case 35671:return S;case 35668:case 35672:return A;case 35669:case 35673:return R}}function P(t,e){t.uniform1fv(this.addr,e)}function C(t,e){t.uniform1iv(this.addr,e)}function I(t,e){t.uniform2fv(this.addr,f(e,this.size,2))}function O(t,e){t.uniform3fv(this.addr,f(e,this.size,3))}function N(t,e){t.uniform4fv(this.addr,f(e,this.size,4))}function U(t,e){t.uniformMatrix2fv(this.addr,!1,f(e,this.size,4))}function D(t,e){t.uniformMatrix3fv(this.addr,!1,f(e,this.size,9))}function B(t,e){t.uniformMatrix4fv(this.addr,!1,f(e,this.size,16))}function F(t,e,r){var n=e.length,i=m(r,n);t.uniform1iv(this.addr,i);for(var a=0;a!==n;++a)r.setTexture2D(e[a]||sc,i[a])}function z(t,e,r){var n=e.length,i=m(r,n);t.uniform1iv(this.addr,i);for(var a=0;a!==n;++a)r.setTextureCube(e[a]||cc,i[a])}function G(t){switch(t){case 5126:return P;case 35664:return I;case 35665:return O;case 35666:return N;case 35674:return U;case 35675:return D;case 35676:return B;case 35678:return F;case 35680:return z;case 5124:case 35670:return C;case 35667:case 35671:return S;case 35668:case 35672:return A;case 35669:case 35673:return R}}function H(t,e,r){this.id=t,this.addr=r,this.setValue=L(e.type)}function V(t,e,r){this.id=t,this.addr=r,this.size=e.size,this.setValue=G(e.type)}function k(t){this.id=t,d.call(this)}function j(t,e){t.seq.push(e),t.map[e.id]=e}function W(t,e,r){var n=t.name,i=n.length;for(dc.lastIndex=0;;){var a=dc.exec(n),o=dc.lastIndex,s=a[1],c="]"===a[2],h=a[3];if(c&&(s|=0),void 0===h||"["===h&&o+2===i){j(r,void 0===h?new H(s,t,e):new V(s,t,e));break}var l=r.map,u=l[s];void 0===u&&(u=new k(s),j(r,u)),r=u}}function X(t,e,r){d.call(this),this.renderer=r;for(var n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),i=0;i<n;++i){var a=t.getActiveUniform(e,i),o=a.name,s=t.getUniformLocation(e,o);W(a,s,this)}}function q(t,e,r){return void 0===e&&void 0===r?this.set(t):this.setRGB(t,e,r)}function Y(t,e){this.min=void 0!==t?t:new r(+(1/0),+(1/0)),this.max=void 0!==e?e:new r(-(1/0),-(1/0))}function Z(t,e,n,i,o){function s(){var t=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),r=new Uint16Array([0,1,2,0,2,3]);h=e.createBuffer(),l=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,h),e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,l),e.bufferData(e.ELEMENT_ARRAY_BUFFER,r,e.STATIC_DRAW),m=e.createTexture(),v=e.createTexture(),n.bindTexture(e.TEXTURE_2D,m),e.texImage2D(e.TEXTURE_2D,0,e.RGB,16,16,0,e.RGB,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),n.bindTexture(e.TEXTURE_2D,v),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,16,16,0,e.RGBA,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),u={vertexShader:["uniform lowp int renderType;","uniform vec3 screenPosition;","uniform vec2 scale;","uniform float rotation;","uniform sampler2D occlusionMap;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","varying float vVisibility;","void main() {","\tvUV = uv;","\tvec2 pos = position;","\tif ( renderType == 2 ) {","\t\tvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );","\t\tvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );","\t\tvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );","\t\tvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );","\t\tvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );","\t\tvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );","\t\tvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );","\t\tvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );","\t\tvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );","\t\tvVisibility = visibility.r / 9.0;","\t\tvVisibility *= 1.0 - visibility.g / 9.0;","\t\tvVisibility *= visibility.b / 9.0;","\t\tvVisibility *= 1.0 - visibility.a / 9.0;","\t\tpos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;","\t\tpos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;","\t}","\tgl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );","}"].join("\n"),fragmentShader:["uniform lowp int renderType;","uniform sampler2D map;","uniform float opacity;","uniform vec3 color;","varying vec2 vUV;","varying float vVisibility;","void main() {","\tif ( renderType == 0 ) {","\t\tgl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );","\t} else if ( renderType == 1 ) {","\t\tgl_FragColor = texture2D( map, vUV );","\t} else {","\t\tvec4 texture = texture2D( map, vUV );","\t\ttexture.a *= opacity * vVisibility;","\t\tgl_FragColor = texture;","\t\tgl_FragColor.rgb *= color;","\t}","}"].join("\n")},p=c(u),d={vertex:e.getAttribLocation(p,"position"),uv:e.getAttribLocation(p,"uv")},f={renderType:e.getUniformLocation(p,"renderType"),map:e.getUniformLocation(p,"map"),occlusionMap:e.getUniformLocation(p,"occlusionMap"),opacity:e.getUniformLocation(p,"opacity"),color:e.getUniformLocation(p,"color"),scale:e.getUniformLocation(p,"scale"),rotation:e.getUniformLocation(p,"rotation"),screenPosition:e.getUniformLocation(p,"screenPosition")}}function c(t){var r=e.createProgram(),n=e.createShader(e.FRAGMENT_SHADER),i=e.createShader(e.VERTEX_SHADER),a="precision "+o.precision+" float;\n";return e.shaderSource(n,a+t.fragmentShader),e.shaderSource(i,a+t.vertexShader),e.compileShader(n),e.compileShader(i),e.attachShader(r,n),e.attachShader(r,i),e.linkProgram(r),r}var h,l,u,p,d,f,m,v;this.render=function(t,o,c,u){if(0!==t.length){var g=new a,y=u.w/u.z,x=.5*u.z,b=.5*u.w,_=16/u.w,w=new r(_*y,_),M=new a(1,1,0),E=new r(1,1),T=new Y;T.min.set(u.x,u.y),T.max.set(u.x+(u.z-16),u.y+(u.w-16)),void 0===p&&s(),n.useProgram(p),n.initAttributes(),n.enableAttribute(d.vertex),n.enableAttribute(d.uv),n.disableUnusedAttributes(),e.uniform1i(f.occlusionMap,0),e.uniform1i(f.map,1),e.bindBuffer(e.ARRAY_BUFFER,h),e.vertexAttribPointer(d.vertex,2,e.FLOAT,!1,16,0),e.vertexAttribPointer(d.uv,2,e.FLOAT,!1,16,8),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,l),n.disable(e.CULL_FACE),n.buffers.depth.setMask(!1);for(var S=0,A=t.length;S<A;S++){_=16/u.w,w.set(_*y,_);var R=t[S];if(g.set(R.matrixWorld.elements[12],R.matrixWorld.elements[13],R.matrixWorld.elements[14]),g.applyMatrix4(c.matrixWorldInverse),g.applyMatrix4(c.projectionMatrix),M.copy(g),E.x=u.x+M.x*x+x-8,E.y=u.y+M.y*b+b-8,T.containsPoint(E)===!0){n.activeTexture(e.TEXTURE0),n.bindTexture(e.TEXTURE_2D,null),n.activeTexture(e.TEXTURE1),n.bindTexture(e.TEXTURE_2D,m),e.copyTexImage2D(e.TEXTURE_2D,0,e.RGB,E.x,E.y,16,16,0),e.uniform1i(f.renderType,0),e.uniform2f(f.scale,w.x,w.y),e.uniform3f(f.screenPosition,M.x,M.y,M.z),n.disable(e.BLEND),n.enable(e.DEPTH_TEST),e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0),n.activeTexture(e.TEXTURE0),n.bindTexture(e.TEXTURE_2D,v),e.copyTexImage2D(e.TEXTURE_2D,0,e.RGBA,E.x,E.y,16,16,0),e.uniform1i(f.renderType,1),n.disable(e.DEPTH_TEST),n.activeTexture(e.TEXTURE1),n.bindTexture(e.TEXTURE_2D,m),e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0),R.positionScreen.copy(M),R.customUpdateCallback?R.customUpdateCallback(R):R.updateLensFlares(),e.uniform1i(f.renderType,2),n.enable(e.BLEND);for(var L=0,P=R.lensFlares.length;L<P;L++){var C=R.lensFlares[L];C.opacity>.001&&C.scale>.001&&(M.x=C.x,M.y=C.y,M.z=C.z,_=C.size*C.scale/u.w,w.x=_*y,w.y=_,e.uniform3f(f.screenPosition,M.x,M.y,M.z),e.uniform2f(f.scale,w.x,w.y),e.uniform1f(f.rotation,C.rotation),e.uniform1f(f.opacity,C.opacity),e.uniform3f(f.color,C.color.r,C.color.g,C.color.b),n.setBlending(C.blending,C.blendEquation,C.blendSrc,C.blendDst),i.setTexture2D(C.texture,1),e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0))}}}n.enable(e.CULL_FACE),n.enable(e.DEPTH_TEST),n.buffers.depth.setMask(!0),n.reset()}}}function J(t,e,r,n,i,a,o,c,h){s.call(this,t,e,r,n,i,a,o,c,h),this.needsUpdate=!0}function Q(t,e,r,n,o){function s(){var t=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),r=new Uint16Array([0,1,2,0,2,3]);l=e.createBuffer(),u=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,l),e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,u),e.bufferData(e.ELEMENT_ARRAY_BUFFER,r,e.STATIC_DRAW),p=c(),d={position:e.getAttribLocation(p,"position"),uv:e.getAttribLocation(p,"uv")},f={uvOffset:e.getUniformLocation(p,"uvOffset"),uvScale:e.getUniformLocation(p,"uvScale"),rotation:e.getUniformLocation(p,"rotation"),scale:e.getUniformLocation(p,"scale"),color:e.getUniformLocation(p,"color"),map:e.getUniformLocation(p,"map"),opacity:e.getUniformLocation(p,"opacity"),modelViewMatrix:e.getUniformLocation(p,"modelViewMatrix"),projectionMatrix:e.getUniformLocation(p,"projectionMatrix"),fogType:e.getUniformLocation(p,"fogType"),fogDensity:e.getUniformLocation(p,"fogDensity"),fogNear:e.getUniformLocation(p,"fogNear"),fogFar:e.getUniformLocation(p,"fogFar"),fogColor:e.getUniformLocation(p,"fogColor"),fogDepth:e.getUniformLocation(p,"fogDepth"),alphaTest:e.getUniformLocation(p,"alphaTest")};var n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");n.width=8,n.height=8;var i=n.getContext("2d");i.fillStyle="white",i.fillRect(0,0,8,8),m=new J(n)}function c(){var t=e.createProgram(),r=e.createShader(e.VERTEX_SHADER),n=e.createShader(e.FRAGMENT_SHADER);return e.shaderSource(r,["precision "+o.precision+" float;","#define SHADER_NAME SpriteMaterial","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float rotation;","uniform vec2 scale;","uniform vec2 uvOffset;","uniform vec2 uvScale;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","varying float fogDepth;","void main() {","\tvUV = uvOffset + uv * uvScale;","\tvec2 alignedPosition = position * scale;","\tvec2 rotatedPosition;","\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;","\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;","\tvec4 mvPosition;","\tmvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );","\tmvPosition.xy += rotatedPosition;","\tgl_Position = projectionMatrix * mvPosition;","\tfogDepth = - mvPosition.z;","}"].join("\n")),e.shaderSource(n,["precision "+o.precision+" float;","#define SHADER_NAME SpriteMaterial","uniform vec3 color;","uniform sampler2D map;","uniform float opacity;","uniform int fogType;","uniform vec3 fogColor;","uniform float fogDensity;","uniform float fogNear;","uniform float fogFar;","uniform float alphaTest;","varying vec2 vUV;","varying float fogDepth;","void main() {","\tvec4 texture = texture2D( map, vUV );","\tgl_FragColor = vec4( color * texture.xyz, texture.a * opacity );","\tif ( gl_FragColor.a < alphaTest ) discard;","\tif ( fogType > 0 ) {","\t\tfloat fogFactor = 0.0;","\t\tif ( fogType == 1 ) {","\t\t\tfogFactor = smoothstep( fogNear, fogFar, fogDepth );","\t\t} else {","\t\t\tconst float LOG2 = 1.442695;","\t\t\tfogFactor = exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 );","\t\t\tfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","\t\t}","\t\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );","\t}","}"].join("\n")),e.compileShader(r),e.compileShader(n),e.attachShader(t,r),e.attachShader(t,n),e.linkProgram(t),t}function h(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:e.id-t.id}var l,u,p,d,f,m,v=new a,g=new i,y=new a;this.render=function(i,a,o){if(0!==i.length){void 0===p&&s(),r.useProgram(p),r.initAttributes(),r.enableAttribute(d.position),r.enableAttribute(d.uv),r.disableUnusedAttributes(),r.disable(e.CULL_FACE),r.enable(e.BLEND),e.bindBuffer(e.ARRAY_BUFFER,l),e.vertexAttribPointer(d.position,2,e.FLOAT,!1,16,0),e.vertexAttribPointer(d.uv,2,e.FLOAT,!1,16,8),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,u),e.uniformMatrix4fv(f.projectionMatrix,!1,o.projectionMatrix.elements),r.activeTexture(e.TEXTURE0),e.uniform1i(f.map,0);var c=0,x=0,b=a.fog;b?(e.uniform3f(f.fogColor,b.color.r,b.color.g,b.color.b),b.isFog?(e.uniform1f(f.fogNear,b.near),e.uniform1f(f.fogFar,b.far),e.uniform1i(f.fogType,1),c=1,x=1):b.isFogExp2&&(e.uniform1f(f.fogDensity,b.density),e.uniform1i(f.fogType,2),c=2,x=2)):(e.uniform1i(f.fogType,0),c=0,x=0);for(var _=0,w=i.length;_<w;_++){var M=i[_];M.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,M.matrixWorld),M.z=-M.modelViewMatrix.elements[14]}i.sort(h);for(var E=[],_=0,w=i.length;_<w;_++){var M=i[_],T=M.material;if(T.visible!==!1){M.onBeforeRender(t,a,o,void 0,T,void 0),e.uniform1f(f.alphaTest,T.alphaTest),e.uniformMatrix4fv(f.modelViewMatrix,!1,M.modelViewMatrix.elements),M.matrixWorld.decompose(v,g,y),E[0]=y.x,E[1]=y.y;var S=0;a.fog&&T.fog&&(S=x),c!==S&&(e.uniform1i(f.fogType,S),c=S),null!==T.map?(e.uniform2f(f.uvOffset,T.map.offset.x,T.map.offset.y),e.uniform2f(f.uvScale,T.map.repeat.x,T.map.repeat.y)):(e.uniform2f(f.uvOffset,0,0),e.uniform2f(f.uvScale,1,1)),e.uniform1f(f.opacity,T.opacity),e.uniform3f(f.color,T.color.r,T.color.g,T.color.b),e.uniform1f(f.rotation,T.rotation),e.uniform2fv(f.scale,E),r.setBlending(T.blending,T.blendEquation,T.blendSrc,T.blendDst,T.blendEquationAlpha,T.blendSrcAlpha,T.blendDstAlpha,T.premultipliedAlpha),r.buffers.depth.setTest(T.depthTest),r.buffers.depth.setMask(T.depthWrite),r.buffers.color.setMask(T.colorWrite),n.setTexture2D(T.map||m,0),e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0),M.onAfterRender(t,a,o,void 0,T,void 0)}}r.enable(e.CULL_FACE),r.reset()}}}function K(){Object.defineProperty(this,"id",{value:bl++}),this.uuid=ac.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=so,this.side=Ka,this.flatShading=!1,this.vertexColors=no,this.opacity=1,this.transparent=!1,this.blendSrc=wo,this.blendDst=Mo,this.blendEquation=po,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Io,this.depthTest=!0,this.depthWrite=!0,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.overdraw=0,this.visible=!0,this.userData={},this.needsUpdate=!0}function $(t){K.call(this),this.type="MeshDepthMaterial",this.depthPacking=nc,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.setValues(t)}function tt(t){K.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new a,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.lights=!1,this.setValues(t)}function et(t,e){this.min=void 0!==t?t:new a(+(1/0),+(1/0),+(1/0)),this.max=void 0!==e?e:new a(-(1/0),-(1/0),-(1/0))}function rt(t,e){this.center=void 0!==t?t:new a,this.radius=void 0!==e?e:0}function nt(t,e){this.normal=void 0!==t?t:new a(1,0,0),this.constant=void 0!==e?e:0}function it(t,e,r,n,i,a){this.planes=[void 0!==t?t:new nt,void 0!==e?e:new nt,void 0!==r?r:new nt,void 0!==n?n:new nt,void 0!==i?i:new nt,void 0!==a?a:new nt]}function at(t,e,i){function o(e,r,n,i,a,o){var s=e.geometry,c=null,h=x,l=e.customDepthMaterial;if(n&&(h=b,l=e.customDistanceMaterial),l)c=l;else{var u=!1;r.morphTargets&&(s&&s.isBufferGeometry?u=s.morphAttributes&&s.morphAttributes.position&&s.morphAttributes.position.length>0:s&&s.isGeometry&&(u=s.morphTargets&&s.morphTargets.length>0)),e.isSkinnedMesh&&r.skinning===!1&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e);var p=e.isSkinnedMesh&&r.skinning,d=0;u&&(d|=v),p&&(d|=g),c=h[d]}if(t.localClippingEnabled&&r.clipShadows===!0&&0!==r.clippingPlanes.length){var f=c.uuid,m=r.uuid,y=_[f];void 0===y&&(y={},_[f]=y);var w=y[m];void 0===w&&(w=c.clone(),y[m]=w),c=w}c.visible=r.visible,c.wireframe=r.wireframe;var M=r.side;return P.renderSingleSided&&M==to&&(M=Ka),P.renderReverseSided&&(M===Ka?M=$a:M===$a&&(M=Ka)),c.side=M,c.clipShadows=r.clipShadows,c.clippingPlanes=r.clippingPlanes,c.clipIntersection=r.clipIntersection,c.wireframeLinewidth=r.wireframeLinewidth,c.linewidth=r.linewidth,n&&c.isMeshDistanceMaterial&&(c.referencePosition.copy(i),c.nearDistance=a,c.farDistance=o),c}function s(r,n,i,a){if(r.visible!==!1){var c=r.layers.test(n.layers);if(c&&(r.isMesh||r.isLine||r.isPoints)&&r.castShadow&&(!r.frustumCulled||l.intersectsObject(r))){r.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,r.matrixWorld);var h=e.update(r),u=r.material;if(Array.isArray(u))for(var p=h.groups,d=0,f=p.length;d<f;d++){var v=p[d],g=u[v.materialIndex];if(g&&g.visible){var y=o(r,g,a,m,i.near,i.far);t.renderBufferDirect(i,null,h,y,r,v)}}else if(u.visible){var y=o(r,u,a,m,i.near,i.far);t.renderBufferDirect(i,null,h,y,r,null)}}for(var x=r.children,b=0,_=x.length;b<_;b++)s(x[b],n,i,a)}}for(var l=new it,u=new n,p=new r,d=new r(i,i),f=new a,m=new a,v=1,g=2,y=(v|g)+1,x=new Array(y),b=new Array(y),_={},w=[new a(1,0,0),new a(-1,0,0),new a(0,0,1),new a(0,0,-1),new a(0,1,0),new a(0,-1,0)],M=[new a(0,1,0),new a(0,1,0),new a(0,1,0),new a(0,1,0),new a(0,0,1),new a(0,0,-1)],E=[new c,new c,new c,new c,new c,new c],T=0;T!==y;++T){var S=0!==(T&v),A=0!==(T&g),R=new $({depthPacking:ic,morphTargets:S,skinning:A});x[T]=R;var L=new tt({morphTargets:S,skinning:A});b[T]=L}var P=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ja,this.renderReverseSided=!0,this.renderSingleSided=!0,this.render=function(e,r,n){if(P.enabled!==!1&&(P.autoUpdate!==!1||P.needsUpdate!==!1)&&0!==e.length){var i=t.context,a=t.state;a.disable(i.BLEND),a.buffers.color.setClear(1,1,1,1),a.buffers.depth.setTest(!0),a.setScissorTest(!1);for(var o,c=0,v=e.length;c<v;c++){var g=e[c],y=g.shadow,x=g&&g.isPointLight;if(void 0!==y){var b=y.camera;if(p.copy(y.mapSize),p.min(d),x){var _=p.x,T=p.y;E[0].set(2*_,T,_,T),E[1].set(0,T,_,T),E[2].set(3*_,T,_,T),E[3].set(_,T,_,T),E[4].set(3*_,0,_,T),E[5].set(_,0,_,T),p.x*=4,p.y*=2}if(null===y.map){var S={minFilter:rs,magFilter:rs,format:ws};y.map=new h(p.x,p.y,S),y.map.texture.name=g.name+".shadowMap",b.updateProjectionMatrix()}y.isSpotLightShadow&&y.update(g);var A=y.map,R=y.matrix;m.setFromMatrixPosition(g.matrixWorld),b.position.copy(m),x?(o=6,R.makeTranslation(-m.x,-m.y,-m.z)):(o=1,f.setFromMatrixPosition(g.target.matrixWorld),b.lookAt(f),b.updateMatrixWorld(),R.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),R.multiply(b.projectionMatrix),R.multiply(b.matrixWorldInverse)),t.setRenderTarget(A),t.clear();for(var L=0;L<o;L++){if(x){f.copy(b.position),f.add(w[L]),b.up.copy(M[L]),b.lookAt(f),b.updateMatrixWorld();var C=E[L];a.viewport(C)}u.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse),l.setFromMatrix(u),s(r,n,b,x)}}else console.warn("THREE.WebGLShadowMap:",g,"has no shadow.")}P.needsUpdate=!1}}}function ot(t){function e(e,r){var n=e.array,i=e.dynamic?t.DYNAMIC_DRAW:t.STATIC_DRAW,a=t.createBuffer();t.bindBuffer(r,a),t.bufferData(r,n,i),e.onUploadCallback();var o=t.FLOAT;return n instanceof Float32Array?o=t.FLOAT:n instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):n instanceof Uint16Array?o=t.UNSIGNED_SHORT:n instanceof Int16Array?o=t.SHORT:n instanceof Uint32Array?o=t.UNSIGNED_INT:n instanceof Int32Array?o=t.INT:n instanceof Int8Array?o=t.BYTE:n instanceof Uint8Array&&(o=t.UNSIGNED_BYTE),{buffer:a,type:o,bytesPerElement:n.BYTES_PER_ELEMENT,version:e.version}}function r(e,r,n){var i=r.array,a=r.updateRange;t.bindBuffer(n,e),r.dynamic===!1?t.bufferData(n,i,t.STATIC_DRAW):a.count===-1?t.bufferSubData(n,0,i):0===a.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(t.bufferSubData(n,a.offset*i.BYTES_PER_ELEMENT,i.subarray(a.offset,a.offset+a.count)),a.count=-1)}function n(t){return t.isInterleavedBufferAttribute&&(t=t.data),o[t.uuid]}function i(e){e.isInterleavedBufferAttribute&&(e=e.data);var r=o[e.uuid];r&&(t.deleteBuffer(r.buffer),delete o[e.uuid])}function a(t,n){t.isInterleavedBufferAttribute&&(t=t.data);var i=o[t.uuid];void 0===i?o[t.uuid]=e(t,n):i.version<t.version&&(r(i.buffer,t,n),i.version=t.version)}var o={};return{get:n,remove:i,update:a}}function st(t,e,r,n){this._x=t||0,this._y=e||0,this._z=r||0,this._order=n||st.DefaultOrder}function ct(){this.mask=1}function ht(){function t(){c.setFromEuler(s,!1)}function e(){s.setFromQuaternion(c,void 0,!1)}Object.defineProperty(this,"id",{value:_l++}),this.uuid=ac.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=ht.DefaultUp.clone();var r=new a,s=new st,c=new i,h=new a(1,1,1);s.onChange(t),c.onChange(e),Object.defineProperties(this,{position:{enumerable:!0,value:r},rotation:{enumerable:!0,value:s},quaternion:{enumerable:!0,value:c},scale:{enumerable:!0,value:h},modelViewMatrix:{value:new n},normalMatrix:{value:new o}}),this.matrix=new n,this.matrixWorld=new n,this.matrixAutoUpdate=ht.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new ct,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function lt(){ht.call(this),this.type="Camera",this.matrixWorldInverse=new n,this.projectionMatrix=new n}function ut(t,e,r,n,i,a){lt.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=r,this.bottom=n,this.near=void 0!==i?i:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function pt(t,e,r,n,i,o){this.a=t,this.b=e,this.c=r,this.normal=n&&n.isVector3?n:new a,this.vertexNormals=Array.isArray(n)?n:[],this.color=i&&i.isColor?i:new q,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=void 0!==o?o:0}function dt(){Object.defineProperty(this,"id",{value:wl+=2}),this.uuid=ac.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}function ft(t,e,r){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.uuid=ac.generateUUID(),this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=r===!0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function mt(t,e,r){ft.call(this,new Int8Array(t),e,r)}function vt(t,e,r){ft.call(this,new Uint8Array(t),e,r)}function gt(t,e,r){ft.call(this,new Uint8ClampedArray(t),e,r)}function yt(t,e,r){ft.call(this,new Int16Array(t),e,r)}function xt(t,e,r){ft.call(this,new Uint16Array(t),e,r)}function bt(t,e,r){ft.call(this,new Int32Array(t),e,r)}function _t(t,e,r){ft.call(this,new Uint32Array(t),e,r)}function wt(t,e,r){ft.call(this,new Float32Array(t),e,r)}function Mt(t,e,r){ft.call(this,new Float64Array(t),e,r)}function Et(){this.indices=[],this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function Tt(t){if(0===t.length)return-(1/0);for(var e=t[0],r=1,n=t.length;r<n;++r)t[r]>e&&(e=t[r]);return e}function St(){Object.defineProperty(this,"id",{value:Ml+=2}),this.uuid=ac.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0}}function At(t,e,r,n,i,a){dt.call(this),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:r,widthSegments:n,heightSegments:i,depthSegments:a},this.fromBufferGeometry(new Rt(t,e,r,n,i,a)),this.mergeVertices()}function Rt(t,e,r,n,i,o){function s(t,e,r,n,i,o,s,m,v,g,y){var x,b,_=o/v,w=s/g,M=o/2,E=s/2,T=m/2,S=v+1,A=g+1,R=0,L=0,P=new a;for(b=0;b<A;b++){var C=b*w-E;for(x=0;x<S;x++){var I=x*_-M;P[t]=I*n,P[e]=C*i,P[r]=T,l.push(P.x,P.y,P.z),P[t]=0,P[e]=0,P[r]=m>0?1:-1,u.push(P.x,P.y,P.z),p.push(x/v),p.push(1-b/g),R+=1}}for(b=0;b<g;b++)for(x=0;x<v;x++){var O=d+x+S*b,N=d+x+S*(b+1),U=d+(x+1)+S*(b+1),D=d+(x+1)+S*b;h.push(O,N,D),h.push(N,U,D),L+=6}c.addGroup(f,L,y),f+=L,d+=R}St.call(this),this.type="BoxBufferGeometry",this.parameters={width:t,height:e,depth:r,widthSegments:n,heightSegments:i,depthSegments:o};var c=this;t=t||1,e=e||1,r=r||1,n=Math.floor(n)||1,i=Math.floor(i)||1,o=Math.floor(o)||1;var h=[],l=[],u=[],p=[],d=0,f=0;s("z","y","x",-1,-1,r,e,t,o,i,0),s("z","y","x",1,-1,r,e,-t,o,i,1),s("x","z","y",1,1,t,r,e,n,o,2),s("x","z","y",1,-1,t,r,-e,n,o,3),s("x","y","z",1,-1,t,e,r,n,i,4),s("x","y","z",-1,-1,t,e,-r,n,i,5),this.setIndex(h),this.addAttribute("position",new wt(l,3)),this.addAttribute("normal",new wt(u,3)),this.addAttribute("uv",new wt(p,2))}function Lt(t,e,r,n){dt.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:r,heightSegments:n},this.fromBufferGeometry(new Pt(t,e,r,n)),this.mergeVertices()}function Pt(t,e,r,n){St.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:r,heightSegments:n},t=t||1,e=e||1;var i,a,o=t/2,s=e/2,c=Math.floor(r)||1,h=Math.floor(n)||1,l=c+1,u=h+1,p=t/c,d=e/h,f=[],m=[],v=[],g=[];for(a=0;a<u;a++){var y=a*d-s;for(i=0;i<l;i++){var x=i*p-o;m.push(x,-y,0),v.push(0,0,1),g.push(i/c),g.push(1-a/h)}}for(a=0;a<h;a++)for(i=0;i<c;i++){var b=i+l*a,_=i+l*(a+1),w=i+1+l*(a+1),M=i+1+l*a;f.push(b,_,M),f.push(_,w,M)}this.setIndex(f),this.addAttribute("position",new wt(m,3)),this.addAttribute("normal",new wt(v,3)),this.addAttribute("uv",new wt(g,2))}function Ct(t){K.call(this),this.type="MeshBasicMaterial",this.color=new q(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Bo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.lights=!1,this.setValues(t)}function It(t){K.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}function Ot(t,e){this.origin=void 0!==t?t:new a,this.direction=void 0!==e?e:new a}function Nt(t,e){this.start=void 0!==t?t:new a,this.end=void 0!==e?e:new a}function Ut(t,e,r){this.a=void 0!==t?t:new a,this.b=void 0!==e?e:new a,this.c=void 0!==r?r:new a}function Dt(t,e){ht.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new St,this.material=void 0!==e?e:new Ct({color:16777215*Math.random()
  95. }),this.drawMode=Xs,this.updateMorphTargets()}function Bt(t,e,r,n){function i(e,n,i,u){var p=n.background;null===p?a(h,l):p&&p.isColor&&(a(p,1),u=!0),(t.autoClear||u)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),p&&p.isCubeTexture?(void 0===c&&(c=new Dt(new Rt(1,1,1),new It({uniforms:xl.cube.uniforms,vertexShader:xl.cube.vertexShader,fragmentShader:xl.cube.fragmentShader,side:$a,depthTest:!0,depthWrite:!1,fog:!1})),c.geometry.removeAttribute("normal"),c.geometry.removeAttribute("uv"),c.onBeforeRender=function(t,e,r){this.matrixWorld.copyPosition(r.matrixWorld)},r.update(c.geometry)),c.material.uniforms.tCube.value=p,e.push(c,c.geometry,c.material,0,null)):p&&p.isTexture&&(void 0===o&&(o=new ut(-1,1,1,-1,0,1),s=new Dt(new Pt(2,2),new Ct({depthTest:!1,depthWrite:!1,fog:!1})),r.update(s.geometry)),s.material.map=p,t.renderBufferDirect(o,null,s.geometry,s.material,s,null))}function a(t,r){e.buffers.color.setClear(t.r,t.g,t.b,r,n)}var o,s,c,h=new q(0),l=0;return{getClearColor:function(){return h},setClearColor:function(t,e){h.set(t),l=void 0!==e?e:1,a(h,l)},getClearAlpha:function(){return l},setClearAlpha:function(t){l=t,a(h,l)},render:i}}function Ft(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program&&e.program&&t.program!==e.program?t.program.id-e.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function zt(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Gt(){function t(){i=0,a.length=0,o.length=0}function e(t,e,r,s,c){var h=n[i];void 0===h?(h={id:t.id,object:t,geometry:e,material:r,program:r.program,renderOrder:t.renderOrder,z:s,group:c},n[i]=h):(h.id=t.id,h.object=t,h.geometry=e,h.material=r,h.program=r.program,h.renderOrder=t.renderOrder,h.z=s,h.group=c),(r.transparent===!0?o:a).push(h),i++}function r(){a.length>1&&a.sort(Ft),o.length>1&&o.sort(zt)}var n=[],i=0,a=[],o=[];return{opaque:a,transparent:o,init:t,push:e,sort:r}}function Ht(){function t(t,e){var n=t.id+","+e.id,i=r[n];return void 0===i&&(i=new Gt,r[n]=i),i}function e(){r={}}var r={};return{get:t,dispose:e}}function Vt(t,e){return Math.abs(e[1])-Math.abs(t[1])}function kt(t){function e(e,i,a,o){var s=e.morphTargetInfluences,c=s.length,h=r[i.id];if(void 0===h){h=[];for(var l=0;l<c;l++)h[l]=[l,0];r[i.id]=h}for(var u=a.morphTargets&&i.morphAttributes.position,p=a.morphNormals&&i.morphAttributes.normal,l=0;l<c;l++){var d=h[l];0!==d[1]&&(u&&i.removeAttribute("morphTarget"+l),p&&i.removeAttribute("morphNormal"+l))}for(var l=0;l<c;l++){var d=h[l];d[0]=l,d[1]=s[l]}h.sort(Vt);for(var l=0;l<8;l++){var d=h[l];if(d){var f=d[0],m=d[1];if(m){u&&i.addAttribute("morphTarget"+l,u[f]),p&&i.addAttribute("morphNormal"+l,p[f]),n[l]=m;continue}}n[l]=0}o.getUniforms().setValue(t,"morphTargetInfluences",n)}var r={},n=new Float32Array(8);return{update:e}}function jt(t,e,r){function n(t){s=t}function i(t){c=t.type,h=t.bytesPerElement}function a(e,n){t.drawElements(s,n,c,e*h),r.calls++,r.vertices+=n,s===t.TRIANGLES?r.faces+=n/3:s===t.POINTS&&(r.points+=n)}function o(n,i,a){var o=e.get("ANGLE_instanced_arrays");return null===o?void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."):(o.drawElementsInstancedANGLE(s,a,c,i*h,n.maxInstancedCount),r.calls++,r.vertices+=a*n.maxInstancedCount,void(s===t.TRIANGLES?r.faces+=n.maxInstancedCount*a/3:s===t.POINTS&&(r.points+=n.maxInstancedCount*a)))}var s,c,h;this.setMode=n,this.setIndex=i,this.render=a,this.renderInstances=o}function Wt(t,e,r){function n(t){o=t}function i(e,n){t.drawArrays(o,e,n),r.calls++,r.vertices+=n,o===t.TRIANGLES?r.faces+=n/3:o===t.POINTS&&(r.points+=n)}function a(n,i,a){var s=e.get("ANGLE_instanced_arrays");if(null===s)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");var c=n.attributes.position;c.isInterleavedBufferAttribute?(a=c.data.count,s.drawArraysInstancedANGLE(o,0,a,n.maxInstancedCount)):s.drawArraysInstancedANGLE(o,i,a,n.maxInstancedCount),r.calls++,r.vertices+=a*n.maxInstancedCount,o===t.TRIANGLES?r.faces+=n.maxInstancedCount*a/3:o===t.POINTS&&(r.points+=n.maxInstancedCount*a)}var o;this.setMode=n,this.render=i,this.renderInstances=a}function Xt(t,e,r){function n(t){var i=t.target,a=s[i.id];null!==a.index&&e.remove(a.index);for(var o in a.attributes)e.remove(a.attributes[o]);i.removeEventListener("dispose",n),delete s[i.id];var h=c[i.id];h&&(e.remove(h),delete c[i.id]),h=c[a.id],h&&(e.remove(h),delete c[a.id]),r.geometries--}function i(t,e){var i=s[e.id];return i?i:(e.addEventListener("dispose",n),e.isBufferGeometry?i=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new St).setFromObject(t)),i=e._bufferGeometry),s[e.id]=i,r.geometries++,i)}function a(r){var n=r.index,i=r.attributes;null!==n&&e.update(n,t.ELEMENT_ARRAY_BUFFER);for(var a in i)e.update(i[a],t.ARRAY_BUFFER);var o=r.morphAttributes;for(var a in o)for(var s=o[a],c=0,h=s.length;c<h;c++)e.update(s[c],t.ARRAY_BUFFER)}function o(r){var n=c[r.id];if(n)return n;var i=[],a=r.index,o=r.attributes;if(null!==a)for(var s=a.array,h=0,l=s.length;h<l;h+=3){var u=s[h+0],p=s[h+1],d=s[h+2];i.push(u,p,p,d,d,u)}else for(var s=o.position.array,h=0,l=s.length/3-1;h<l;h+=3){var u=h+0,p=h+1,d=h+2;i.push(u,p,p,d,d,u)}return n=new(Tt(i)>65535?_t:xt)(i,1),e.update(n,t.ELEMENT_ARRAY_BUFFER),c[r.id]=n,n}var s={},c={};return{get:i,update:a,getWireframeAttribute:o}}function qt(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var n;switch(e.type){case"DirectionalLight":n={direction:new a,color:new q,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new r};break;case"SpotLight":n={position:new a,direction:new a,color:new q,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new r};break;case"PointLight":n={position:new a,color:new q,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new r,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":n={direction:new a,skyColor:new q,groundColor:new q};break;case"RectAreaLight":n={color:new q,position:new a,halfWidth:new a,halfHeight:new a}}return t[e.id]=n,n}}}function Yt(){function t(t,n,a){for(var c=0,h=0,l=0,u=0,p=0,d=0,f=0,m=0,v=a.matrixWorldInverse,g=0,y=t.length;g<y;g++){var x=t[g],b=x.color,_=x.intensity,w=x.distance,M=x.shadow&&x.shadow.map?x.shadow.map.texture:null;if(x.isAmbientLight)c+=b.r*_,h+=b.g*_,l+=b.b*_;else if(x.isDirectionalLight){var E=e.get(x);if(E.color.copy(x.color).multiplyScalar(x.intensity),E.direction.setFromMatrixPosition(x.matrixWorld),i.setFromMatrixPosition(x.target.matrixWorld),E.direction.sub(i),E.direction.transformDirection(v),E.shadow=x.castShadow,x.castShadow){var T=x.shadow;E.shadowBias=T.bias,E.shadowRadius=T.radius,E.shadowMapSize=T.mapSize}r.directionalShadowMap[u]=M,r.directionalShadowMatrix[u]=x.shadow.matrix,r.directional[u]=E,u++}else if(x.isSpotLight){var E=e.get(x);if(E.position.setFromMatrixPosition(x.matrixWorld),E.position.applyMatrix4(v),E.color.copy(b).multiplyScalar(_),E.distance=w,E.direction.setFromMatrixPosition(x.matrixWorld),i.setFromMatrixPosition(x.target.matrixWorld),E.direction.sub(i),E.direction.transformDirection(v),E.coneCos=Math.cos(x.angle),E.penumbraCos=Math.cos(x.angle*(1-x.penumbra)),E.decay=0===x.distance?0:x.decay,E.shadow=x.castShadow,x.castShadow){var T=x.shadow;E.shadowBias=T.bias,E.shadowRadius=T.radius,E.shadowMapSize=T.mapSize}r.spotShadowMap[d]=M,r.spotShadowMatrix[d]=x.shadow.matrix,r.spot[d]=E,d++}else if(x.isRectAreaLight){var E=e.get(x);E.color.copy(b).multiplyScalar(_/(x.width*x.height)),E.position.setFromMatrixPosition(x.matrixWorld),E.position.applyMatrix4(v),s.identity(),o.copy(x.matrixWorld),o.premultiply(v),s.extractRotation(o),E.halfWidth.set(.5*x.width,0,0),E.halfHeight.set(0,.5*x.height,0),E.halfWidth.applyMatrix4(s),E.halfHeight.applyMatrix4(s),r.rectArea[f]=E,f++}else if(x.isPointLight){var E=e.get(x);if(E.position.setFromMatrixPosition(x.matrixWorld),E.position.applyMatrix4(v),E.color.copy(x.color).multiplyScalar(x.intensity),E.distance=x.distance,E.decay=0===x.distance?0:x.decay,E.shadow=x.castShadow,x.castShadow){var T=x.shadow;E.shadowBias=T.bias,E.shadowRadius=T.radius,E.shadowMapSize=T.mapSize,E.shadowCameraNear=T.camera.near,E.shadowCameraFar=T.camera.far}r.pointShadowMap[p]=M,r.pointShadowMatrix[p]=x.shadow.matrix,r.point[p]=E,p++}else if(x.isHemisphereLight){var E=e.get(x);E.direction.setFromMatrixPosition(x.matrixWorld),E.direction.transformDirection(v),E.direction.normalize(),E.skyColor.copy(x.color).multiplyScalar(_),E.groundColor.copy(x.groundColor).multiplyScalar(_),r.hemi[m]=E,m++}}r.ambient[0]=c,r.ambient[1]=h,r.ambient[2]=l,r.directional.length=u,r.spot.length=d,r.rectArea.length=f,r.point.length=p,r.hemi.length=m,r.hash=u+","+p+","+d+","+f+","+m+","+n.length}var e=new qt,r={hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},i=new a,o=new n,s=new n;return{setup:t,state:r}}function Zt(t,e){function r(r){var n=e.frame,a=r.geometry,o=t.get(r,a);return i[o.id]!==n&&(a.isGeometry&&o.updateFromObject(r),t.update(o),i[o.id]=n),o}function n(){i={}}var i={};return{update:r,clear:n}}function Jt(t){for(var e=t.split("\n"),r=0;r<e.length;r++)e[r]=r+1+": "+e[r];return e.join("\n")}function Qt(t,e,r){var n=t.createShader(e);return t.shaderSource(n,r),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS)===!1&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==t.getShaderInfoLog(n)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",e===t.VERTEX_SHADER?"vertex":"fragment",t.getShaderInfoLog(n),Jt(r)),n}function Kt(t){switch(t){case Zs:return["Linear","( value )"];case Js:return["sRGB","( value )"];case Ks:return["RGBE","( value )"];case tc:return["RGBM","( value, 7.0 )"];case ec:return["RGBM","( value, 16.0 )"];case rc:return["RGBD","( value, 256.0 )"];case Qs:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+t)}}function $t(t,e){var r=Kt(e);return"vec4 "+t+"( vec4 value ) { return "+r[0]+"ToLinear"+r[1]+"; }"}function te(t,e){var r=Kt(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+r[0]+r[1]+"; }"}function ee(t,e){var r;switch(e){case Ho:r="Linear";break;case Vo:r="Reinhard";break;case ko:r="Uncharted2";break;case jo:r="OptimizedCineon";break;default:throw new Error("unsupported toneMapping: "+e)}return"vec3 "+t+"( vec3 color ) { return "+r+"ToneMapping( color ); }"}function re(t,e,r){t=t||{};var n=[t.derivatives||e.envMapCubeUV||e.bumpMap||e.normalMap||e.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(t.fragDepth||e.logarithmicDepthBuffer)&&r.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",t.drawBuffers&&r.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(t.shaderTextureLOD||e.envMap)&&r.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""];return n.filter(ae).join("\n")}function ne(t){var e=[];for(var r in t){var n=t[r];n!==!1&&e.push("#define "+r+" "+n)}return e.join("\n")}function ie(t,e){for(var r={},n=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),i=0;i<n;i++){var a=t.getActiveAttrib(e,i),o=a.name;r[o]=t.getAttribLocation(e,o)}return r}function ae(t){return""!==t}function oe(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights)}function se(t){function e(t,e){var r=yl[e];if(void 0===r)throw new Error("Can not resolve #include <"+e+">");return se(r)}var r=/^[ \t]*#include +<([\w\d.]+)>/gm;return t.replace(r,e)}function ce(t){function e(t,e,r,n){for(var i="",a=parseInt(e);a<parseInt(r);a++)i+=n.replace(/\[ i \]/g,"[ "+a+" ]");return i}var r=/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;return t.replace(r,e)}function he(t,e,r,n,i,a){var o=t.context,s=n.defines,c=i.vertexShader,h=i.fragmentShader,l="SHADOWMAP_TYPE_BASIC";a.shadowMapType===Ja?l="SHADOWMAP_TYPE_PCF":a.shadowMapType===Qa&&(l="SHADOWMAP_TYPE_PCF_SOFT");var u="ENVMAP_TYPE_CUBE",p="ENVMAP_MODE_REFLECTION",d="ENVMAP_BLENDING_MULTIPLY";if(a.envMap){switch(n.envMap.mapping){case Xo:case qo:u="ENVMAP_TYPE_CUBE";break;case Qo:case Ko:u="ENVMAP_TYPE_CUBE_UV";break;case Yo:case Zo:u="ENVMAP_TYPE_EQUIREC";break;case Jo:u="ENVMAP_TYPE_SPHERE"}switch(n.envMap.mapping){case qo:case Zo:p="ENVMAP_MODE_REFRACTION"}switch(n.combine){case Bo:d="ENVMAP_BLENDING_MULTIPLY";break;case Fo:d="ENVMAP_BLENDING_MIX";break;case zo:d="ENVMAP_BLENDING_ADD"}}var f,m,v=t.gammaFactor>0?t.gammaFactor:1,g=re(n.extensions,a,e),y=ne(s),x=o.createProgram();n.isRawShaderMaterial?(f=[y].filter(ae).join("\n"),f.length>0&&(f+="\n"),m=[g,y].filter(ae).join("\n"),m.length>0&&(m+="\n")):(f=["precision "+a.precision+" float;","precision "+a.precision+" int;","#define SHADER_NAME "+i.name,y,a.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+v,"#define MAX_BONES "+a.maxBones,a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+p:"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.displacementMap&&a.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.vertexColors?"#define USE_COLOR":"",a.flatShading?"#define FLAT_SHADED":"",a.skinning?"#define USE_SKINNING":"",a.useVertexTexture?"#define BONE_TEXTURE":"",a.morphTargets?"#define USE_MORPHTARGETS":"",a.morphNormals&&a.flatShading===!1?"#define USE_MORPHNORMALS":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+a.numClippingPlanes,a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+l:"",a.sizeAttenuation?"#define USE_SIZEATTENUATION":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&e.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(ae).join("\n"),m=[g,"precision "+a.precision+" float;","precision "+a.precision+" int;","#define SHADER_NAME "+i.name,y,a.alphaTest?"#define ALPHATEST "+a.alphaTest:"","#define GAMMA_FACTOR "+v,a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+u:"",a.envMap?"#define "+p:"",a.envMap?"#define "+d:"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.vertexColors?"#define USE_COLOR":"",a.gradientMap?"#define USE_GRADIENTMAP":"",a.flatShading?"#define FLAT_SHADED":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+a.numClippingPlanes,"#define UNION_CLIPPING_PLANES "+(a.numClippingPlanes-a.numClipIntersection),a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+l:"",a.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",a.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&e.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",a.envMap&&e.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",a.toneMapping!==Go?"#define TONE_MAPPING":"",a.toneMapping!==Go?yl.tonemapping_pars_fragment:"",a.toneMapping!==Go?ee("toneMapping",a.toneMapping):"",a.dithering?"#define DITHERING":"",a.outputEncoding||a.mapEncoding||a.envMapEncoding||a.emissiveMapEncoding?yl.encodings_pars_fragment:"",a.mapEncoding?$t("mapTexelToLinear",a.mapEncoding):"",a.envMapEncoding?$t("envMapTexelToLinear",a.envMapEncoding):"",a.emissiveMapEncoding?$t("emissiveMapTexelToLinear",a.emissiveMapEncoding):"",a.outputEncoding?te("linearToOutputTexel",a.outputEncoding):"",a.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(ae).join("\n")),c=se(c),c=oe(c,a),h=se(h),h=oe(h,a),n.isShaderMaterial||(c=ce(c),h=ce(h));var b=f+c,_=m+h,w=Qt(o,o.VERTEX_SHADER,b),M=Qt(o,o.FRAGMENT_SHADER,_);o.attachShader(x,w),o.attachShader(x,M),void 0!==n.index0AttributeName?o.bindAttribLocation(x,0,n.index0AttributeName):a.morphTargets===!0&&o.bindAttribLocation(x,0,"position"),o.linkProgram(x);var E=o.getProgramInfoLog(x),T=o.getShaderInfoLog(w),S=o.getShaderInfoLog(M),A=!0,R=!0;o.getProgramParameter(x,o.LINK_STATUS)===!1?(A=!1,console.error("THREE.WebGLProgram: shader error: ",o.getError(),"gl.VALIDATE_STATUS",o.getProgramParameter(x,o.VALIDATE_STATUS),"gl.getProgramInfoLog",E,T,S)):""!==E?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",E):""!==T&&""!==S||(R=!1),R&&(this.diagnostics={runnable:A,material:n,programLog:E,vertexShader:{log:T,prefix:f},fragmentShader:{log:S,prefix:m}}),o.deleteShader(w),o.deleteShader(M);var L;this.getUniforms=function(){return void 0===L&&(L=new X(o,x,t)),L};var P;return this.getAttributes=function(){return void 0===P&&(P=ie(o,x)),P},this.destroy=function(){o.deleteProgram(x),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.id=El++,this.code=r,this.usedTimes=1,this.program=x,this.vertexShader=w,this.fragmentShader=M,this}function le(t,e,r){function n(t){var e=t.skeleton,n=e.bones;if(r.floatVertexTextures)return 1024;var i=r.maxVertexUniforms,a=Math.floor((i-20)/4),o=Math.min(a,n.length);return o<n.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+n.length+" bones. This GPU supports "+o+"."),0):o}function i(t,e){var r;return t?t.isTexture?r=t.encoding:t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),r=t.texture.encoding):r=Zs,r===Zs&&e&&(r=Qs),r}var a=[],o={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow"},s=["precision","supportsVertexTextures","map","mapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering"];this.getParameters=function(e,a,s,c,h,l,u){var p=o[e.type],d=u.isSkinnedMesh?n(u):0,f=r.precision;null!==e.precision&&(f=r.getMaxPrecision(e.precision),f!==e.precision&&console.warn("THREE.WebGLProgram.getParameters:",e.precision,"not supported, using",f,"instead."));var m=t.getRenderTarget(),v={shaderID:p,precision:f,supportsVertexTextures:r.vertexTextures,outputEncoding:i(m?m.texture:null,t.gammaOutput),map:!!e.map,mapEncoding:i(e.map,t.gammaInput),envMap:!!e.envMap,envMapMode:e.envMap&&e.envMap.mapping,envMapEncoding:i(e.envMap,t.gammaInput),envMapCubeUV:!!e.envMap&&(e.envMap.mapping===Qo||e.envMap.mapping===Ko),lightMap:!!e.lightMap,aoMap:!!e.aoMap,emissiveMap:!!e.emissiveMap,emissiveMapEncoding:i(e.emissiveMap,t.gammaInput),bumpMap:!!e.bumpMap,normalMap:!!e.normalMap,displacementMap:!!e.displacementMap,roughnessMap:!!e.roughnessMap,metalnessMap:!!e.metalnessMap,specularMap:!!e.specularMap,alphaMap:!!e.alphaMap,gradientMap:!!e.gradientMap,combine:e.combine,vertexColors:e.vertexColors,fog:!!c,useFog:e.fog,fogExp:c&&c.isFogExp2,flatShading:e.flatShading,sizeAttenuation:e.sizeAttenuation,logarithmicDepthBuffer:r.logarithmicDepthBuffer,skinning:e.skinning&&d>0,maxBones:d,useVertexTexture:r.floatVertexTextures,morphTargets:e.morphTargets,morphNormals:e.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numClippingPlanes:h,numClipIntersection:l,dithering:e.dithering,shadowMapEnabled:t.shadowMap.enabled&&u.receiveShadow&&s.length>0,shadowMapType:t.shadowMap.type,toneMapping:t.toneMapping,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:e.premultipliedAlpha,alphaTest:e.alphaTest,doubleSided:e.side===to,flipSided:e.side===$a,depthPacking:void 0!==e.depthPacking&&e.depthPacking};return v},this.getProgramCode=function(e,r){var n=[];if(r.shaderID?n.push(r.shaderID):(n.push(e.fragmentShader),n.push(e.vertexShader)),void 0!==e.defines)for(var i in e.defines)n.push(i),n.push(e.defines[i]);for(var a=0;a<s.length;a++)n.push(r[s[a]]);return n.push(e.onBeforeCompile.toString()),n.push(t.gammaOutput),n.join()},this.acquireProgram=function(r,n,i,o){for(var s,c=0,h=a.length;c<h;c++){var l=a[c];if(l.code===o){s=l,++s.usedTimes;break}}return void 0===s&&(s=new he(t,e,o,r,n,i),a.push(s)),s},this.releaseProgram=function(t){if(0===--t.usedTimes){var e=a.indexOf(t);a[e]=a[a.length-1],a.pop(),t.destroy()}},this.programs=a}function ue(t,e,r,n,i,a,o){function s(t,e){if(t.width>e||t.height>e){var r=e/Math.max(t.width,t.height),n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");n.width=Math.floor(t.width*r),n.height=Math.floor(t.height*r);var i=n.getContext("2d");return i.drawImage(t,0,0,t.width,t.height,0,0,n.width,n.height),console.warn("THREE.WebGLRenderer: image is too big ("+t.width+"x"+t.height+"). Resized to "+n.width+"x"+n.height,t),n}return t}function c(t){return ac.isPowerOfTwo(t.width)&&ac.isPowerOfTwo(t.height)}function h(t){if(t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof ImageBitmap){var e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");e.width=ac.floorPowerOfTwo(t.width),e.height=ac.floorPowerOfTwo(t.height);var r=e.getContext("2d");return r.drawImage(t,0,0,e.width,e.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+t.width+"x"+t.height+"). Resized to "+e.width+"x"+e.height,t),e}return t}function l(t){return t.wrapS!==ts||t.wrapT!==ts||t.minFilter!==rs&&t.minFilter!==as}function u(t,e){return t.generateMipmaps&&e&&t.minFilter!==rs&&t.minFilter!==as}function p(e){return e===rs||e===ns||e===is?t.NEAREST:t.LINEAR}function d(t){var e=t.target;e.removeEventListener("dispose",d),m(e),e.isVideoTexture&&delete P[e.id],o.textures--}function f(t){var e=t.target;e.removeEventListener("dispose",f),v(e),o.textures--}function m(e){var r=n.get(e);if(e.image&&r.__image__webglTextureCube)t.deleteTexture(r.__image__webglTextureCube);else{if(void 0===r.__webglInit)return;t.deleteTexture(r.__webglTexture)}n.remove(e)}function v(e){var r=n.get(e),i=n.get(e.texture);if(e){if(void 0!==i.__webglTexture&&t.deleteTexture(i.__webglTexture),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLRenderTargetCube)for(var a=0;a<6;a++)t.deleteFramebuffer(r.__webglFramebuffer[a]),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer[a]);else t.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer);n.remove(e.texture),n.remove(e)}}function g(e,i){var a=n.get(e);if(e.version>0&&a.__version!==e.version){var o=e.image;if(void 0===o)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",e);else{if(o.complete!==!1)return void _(a,e,i);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",e)}}r.activeTexture(t.TEXTURE0+i),r.bindTexture(t.TEXTURE_2D,a.__webglTexture)}function y(e,h){var l=n.get(e);if(6===e.image.length)if(e.version>0&&l.__version!==e.version){l.__image__webglTextureCube||(e.addEventListener("dispose",d),l.__image__webglTextureCube=t.createTexture(),o.textures++),r.activeTexture(t.TEXTURE0+h),r.bindTexture(t.TEXTURE_CUBE_MAP,l.__image__webglTextureCube),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e.flipY);for(var p=e&&e.isCompressedTexture,f=e.image[0]&&e.image[0].isDataTexture,m=[],v=0;v<6;v++)p||f?m[v]=f?e.image[v].image:e.image[v]:m[v]=s(e.image[v],i.maxCubemapSize);var g=m[0],y=c(g),x=a.convert(e.format),_=a.convert(e.type);b(t.TEXTURE_CUBE_MAP,e,y);for(var v=0;v<6;v++)if(p)for(var w,M=m[v].mipmaps,E=0,T=M.length;E<T;E++)w=M[E],e.format!==ws&&e.format!==_s?r.getCompressedTextureFormats().indexOf(x)>-1?r.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+v,E,x,w.width,w.height,0,w.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):r.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+v,E,x,w.width,w.height,0,x,_,w.data);else f?r.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+v,0,x,m[v].width,m[v].height,0,x,_,m[v].data):r.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+v,0,x,x,_,m[v]);u(e,y)&&t.generateMipmap(t.TEXTURE_CUBE_MAP),l.__version=e.version,e.onUpdate&&e.onUpdate(e)}else r.activeTexture(t.TEXTURE0+h),r.bindTexture(t.TEXTURE_CUBE_MAP,l.__image__webglTextureCube)}function x(e,i){r.activeTexture(t.TEXTURE0+i),r.bindTexture(t.TEXTURE_CUBE_MAP,n.get(e).__webglTexture)}function b(r,o,s){var c;if(s?(t.texParameteri(r,t.TEXTURE_WRAP_S,a.convert(o.wrapS)),t.texParameteri(r,t.TEXTURE_WRAP_T,a.convert(o.wrapT)),t.texParameteri(r,t.TEXTURE_MAG_FILTER,a.convert(o.magFilter)),t.texParameteri(r,t.TEXTURE_MIN_FILTER,a.convert(o.minFilter))):(t.texParameteri(r,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(r,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),o.wrapS===ts&&o.wrapT===ts||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",o),t.texParameteri(r,t.TEXTURE_MAG_FILTER,p(o.magFilter)),t.texParameteri(r,t.TEXTURE_MIN_FILTER,p(o.minFilter)),o.minFilter!==rs&&o.minFilter!==as&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",o)),c=e.get("EXT_texture_filter_anisotropic")){if(o.type===fs&&null===e.get("OES_texture_float_linear"))return;if(o.type===ms&&null===e.get("OES_texture_half_float_linear"))return;(o.anisotropy>1||n.get(o).__currentAnisotropy)&&(t.texParameterf(r,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),n.get(o).__currentAnisotropy=o.anisotropy)}}function _(e,n,p){void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",d),e.__webglTexture=t.createTexture(),n.isVideoTexture&&(P[n.id]=n),o.textures++),r.activeTexture(t.TEXTURE0+p),r.bindTexture(t.TEXTURE_2D,e.__webglTexture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,n.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,n.unpackAlignment);var f=s(n.image,i.maxTextureSize);l(n)&&c(f)===!1&&(f=h(f));var m=c(f),v=a.convert(n.format),g=a.convert(n.type);b(t.TEXTURE_2D,n,m);var y,x=n.mipmaps;if(n.isDepthTexture){var _=t.DEPTH_COMPONENT;if(n.type===fs){if(!L)throw new Error("Float Depth Texture only supported in WebGL2.0");_=t.DEPTH_COMPONENT32F}else L&&(_=t.DEPTH_COMPONENT16);n.format===Ss&&_===t.DEPTH_COMPONENT&&n.type!==us&&n.type!==ds&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=us,g=a.convert(n.type)),n.format===As&&(_=t.DEPTH_STENCIL,n.type!==xs&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=xs,g=a.convert(n.type))),r.texImage2D(t.TEXTURE_2D,0,_,f.width,f.height,0,v,g,null)}else if(n.isDataTexture)if(x.length>0&&m){for(var w=0,M=x.length;w<M;w++)y=x[w],r.texImage2D(t.TEXTURE_2D,w,v,y.width,y.height,0,v,g,y.data);n.generateMipmaps=!1}else r.texImage2D(t.TEXTURE_2D,0,v,f.width,f.height,0,v,g,f.data);else if(n.isCompressedTexture)for(var w=0,M=x.length;w<M;w++)y=x[w],n.format!==ws&&n.format!==_s?r.getCompressedTextureFormats().indexOf(v)>-1?r.compressedTexImage2D(t.TEXTURE_2D,w,v,y.width,y.height,0,y.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):r.texImage2D(t.TEXTURE_2D,w,v,y.width,y.height,0,v,g,y.data);else if(x.length>0&&m){for(var w=0,M=x.length;w<M;w++)y=x[w],r.texImage2D(t.TEXTURE_2D,w,v,v,g,y);n.generateMipmaps=!1}else r.texImage2D(t.TEXTURE_2D,0,v,v,g,f);u(n,m)&&t.generateMipmap(t.TEXTURE_2D),e.__version=n.version,n.onUpdate&&n.onUpdate(n)}function w(e,i,o,s){var c=a.convert(i.texture.format),h=a.convert(i.texture.type);r.texImage2D(s,0,c,i.width,i.height,0,c,h,null),t.bindFramebuffer(t.FRAMEBUFFER,e),t.framebufferTexture2D(t.FRAMEBUFFER,o,s,n.get(i.texture).__webglTexture,0),t.bindFramebuffer(t.FRAMEBUFFER,null)}function M(e,r){t.bindRenderbuffer(t.RENDERBUFFER,e),r.depthBuffer&&!r.stencilBuffer?(t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,r.width,r.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e)):r.depthBuffer&&r.stencilBuffer?(t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,r.width,r.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e)):t.renderbufferStorage(t.RENDERBUFFER,t.RGBA4,r.width,r.height),t.bindRenderbuffer(t.RENDERBUFFER,null)}function E(e,r){var i=r&&r.isWebGLRenderTargetCube;if(i)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(t.FRAMEBUFFER,e),!r.depthTexture||!r.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(r.depthTexture).__webglTexture&&r.depthTexture.image.width===r.width&&r.depthTexture.image.height===r.height||(r.depthTexture.image.width=r.width,r.depthTexture.image.height=r.height,r.depthTexture.needsUpdate=!0),g(r.depthTexture,0);var a=n.get(r.depthTexture).__webglTexture;if(r.depthTexture.format===Ss)t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,a,0);else{
  96. if(r.depthTexture.format!==As)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,a,0)}}function T(e){var r=n.get(e),i=e.isWebGLRenderTargetCube===!0;if(e.depthTexture){if(i)throw new Error("target.depthTexture not supported in Cube render targets");E(r.__webglFramebuffer,e)}else if(i){r.__webglDepthbuffer=[];for(var a=0;a<6;a++)t.bindFramebuffer(t.FRAMEBUFFER,r.__webglFramebuffer[a]),r.__webglDepthbuffer[a]=t.createRenderbuffer(),M(r.__webglDepthbuffer[a],e)}else t.bindFramebuffer(t.FRAMEBUFFER,r.__webglFramebuffer),r.__webglDepthbuffer=t.createRenderbuffer(),M(r.__webglDepthbuffer,e);t.bindFramebuffer(t.FRAMEBUFFER,null)}function S(e){var i=n.get(e),a=n.get(e.texture);e.addEventListener("dispose",f),a.__webglTexture=t.createTexture(),o.textures++;var s=e.isWebGLRenderTargetCube===!0,h=c(e);if(s){i.__webglFramebuffer=[];for(var l=0;l<6;l++)i.__webglFramebuffer[l]=t.createFramebuffer()}else i.__webglFramebuffer=t.createFramebuffer();if(s){r.bindTexture(t.TEXTURE_CUBE_MAP,a.__webglTexture),b(t.TEXTURE_CUBE_MAP,e.texture,h);for(var l=0;l<6;l++)w(i.__webglFramebuffer[l],e,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+l);u(e.texture,h)&&t.generateMipmap(t.TEXTURE_CUBE_MAP),r.bindTexture(t.TEXTURE_CUBE_MAP,null)}else r.bindTexture(t.TEXTURE_2D,a.__webglTexture),b(t.TEXTURE_2D,e.texture,h),w(i.__webglFramebuffer,e,t.COLOR_ATTACHMENT0,t.TEXTURE_2D),u(e.texture,h)&&t.generateMipmap(t.TEXTURE_2D),r.bindTexture(t.TEXTURE_2D,null);e.depthBuffer&&T(e)}function A(e){var i=e.texture,a=c(e);if(u(i,a)){var o=e.isWebGLRenderTargetCube?t.TEXTURE_CUBE_MAP:t.TEXTURE_2D,s=n.get(i).__webglTexture;r.bindTexture(o,s),t.generateMipmap(o),r.bindTexture(o,null)}}function R(){for(var t in P)P[t].update()}var L="undefined"!=typeof WebGL2RenderingContext&&t instanceof window.WebGL2RenderingContext,P={};this.setTexture2D=g,this.setTextureCube=y,this.setTextureCubeDynamic=x,this.setupRenderTarget=S,this.updateRenderTargetMipmap=A,this.updateVideoTextures=R}function pe(){function t(t){var e=t.uuid,r=n[e];return void 0===r&&(r={},n[e]=r),r}function e(t){delete n[t.uuid]}function r(){n={}}var n={};return{get:t,remove:e,clear:r}}function de(t,e,r){function n(){var e=!1,r=new c,n=null,i=new c(0,0,0,0);return{setMask:function(r){n===r||e||(t.colorMask(r,r,r,r),n=r)},setLocked:function(t){e=t},setClear:function(e,n,a,o,s){s===!0&&(e*=o,n*=o,a*=o),r.set(e,n,a,o),i.equals(r)===!1&&(t.clearColor(e,n,a,o),i.copy(r))},reset:function(){e=!1,n=null,i.set(-1,0,0,0)}}}function i(){var e=!1,r=null,n=null,i=null;return{setTest:function(e){e?p(t.DEPTH_TEST):d(t.DEPTH_TEST)},setMask:function(n){r===n||e||(t.depthMask(n),r=n)},setFunc:function(e){if(n!==e){if(e)switch(e){case Lo:t.depthFunc(t.NEVER);break;case Po:t.depthFunc(t.ALWAYS);break;case Co:t.depthFunc(t.LESS);break;case Io:t.depthFunc(t.LEQUAL);break;case Oo:t.depthFunc(t.EQUAL);break;case No:t.depthFunc(t.GEQUAL);break;case Uo:t.depthFunc(t.GREATER);break;case Do:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}else t.depthFunc(t.LEQUAL);n=e}},setLocked:function(t){e=t},setClear:function(e){i!==e&&(t.clearDepth(e),i=e)},reset:function(){e=!1,r=null,n=null,i=null}}}function a(){var e=!1,r=null,n=null,i=null,a=null,o=null,s=null,c=null,h=null;return{setTest:function(e){e?p(t.STENCIL_TEST):d(t.STENCIL_TEST)},setMask:function(n){r===n||e||(t.stencilMask(n),r=n)},setFunc:function(e,r,o){n===e&&i===r&&a===o||(t.stencilFunc(e,r,o),n=e,i=r,a=o)},setOp:function(e,r,n){o===e&&s===r&&c===n||(t.stencilOp(e,r,n),o=e,s=r,c=n)},setLocked:function(t){e=t},setClear:function(e){h!==e&&(t.clearStencil(e),h=e)},reset:function(){e=!1,r=null,n=null,i=null,a=null,o=null,s=null,c=null,h=null}}}function o(e,r,n){var i=new Uint8Array(4),a=t.createTexture();t.bindTexture(e,a),t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST);for(var o=0;o<n;o++)t.texImage2D(r+o,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,i);return a}function s(){for(var t=0,e=N.length;t<e;t++)N[t]=0}function h(r){if(N[r]=1,0===U[r]&&(t.enableVertexAttribArray(r),U[r]=1),0!==D[r]){var n=e.get("ANGLE_instanced_arrays");n.vertexAttribDivisorANGLE(r,0),D[r]=0}}function l(r,n){if(N[r]=1,0===U[r]&&(t.enableVertexAttribArray(r),U[r]=1),D[r]!==n){var i=e.get("ANGLE_instanced_arrays");i.vertexAttribDivisorANGLE(r,n),D[r]=n}}function u(){for(var e=0,r=U.length;e!==r;++e)U[e]!==N[e]&&(t.disableVertexAttribArray(e),U[e]=0)}function p(e){B[e]!==!0&&(t.enable(e),B[e]=!0)}function d(e){B[e]!==!1&&(t.disable(e),B[e]=!1)}function f(){if(null===F&&(F=[],e.get("WEBGL_compressed_texture_pvrtc")||e.get("WEBGL_compressed_texture_s3tc")||e.get("WEBGL_compressed_texture_etc1")))for(var r=t.getParameter(t.COMPRESSED_TEXTURE_FORMATS),n=0;n<r.length;n++)F.push(r[n]);return F}function m(e){return z!==e&&(t.useProgram(e),z=e,!0)}function v(e,n,i,a,o,s,c,h){if(e!==oo?p(t.BLEND):d(t.BLEND),e!==uo){if(e!==G||h!==q)switch(e){case co:h?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ONE,t.ONE,t.ONE,t.ONE)):(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.SRC_ALPHA,t.ONE));break;case ho:h?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ZERO,t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ONE_MINUS_SRC_ALPHA)):(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ZERO,t.ONE_MINUS_SRC_COLOR));break;case lo:h?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ZERO,t.SRC_COLOR,t.ZERO,t.SRC_ALPHA)):(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ZERO,t.SRC_COLOR));break;default:h?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA)):(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA))}H=null,V=null,k=null,j=null,W=null,X=null}else o=o||n,s=s||i,c=c||a,n===H&&o===j||(t.blendEquationSeparate(r.convert(n),r.convert(o)),H=n,j=o),i===V&&a===k&&s===W&&c===X||(t.blendFuncSeparate(r.convert(i),r.convert(a),r.convert(s),r.convert(c)),V=i,k=a,W=s,X=c);G=e,q=h}function g(e,r){e.side===to?d(t.CULL_FACE):p(t.CULL_FACE);var n=e.side===$a;r&&(n=!n),y(n),e.transparent===!0?v(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha):v(oo),C.setFunc(e.depthFunc),C.setTest(e.depthTest),C.setMask(e.depthWrite),P.setMask(e.colorWrite),_(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)}function y(e){Y!==e&&(e?t.frontFace(t.CW):t.frontFace(t.CCW),Y=e)}function x(e){e!==ka?(p(t.CULL_FACE),e!==Z&&(e===ja?t.cullFace(t.BACK):e===Wa?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):d(t.CULL_FACE),Z=e}function b(e){e!==J&&(et&&t.lineWidth(e),J=e)}function _(e,r,n){e?(p(t.POLYGON_OFFSET_FILL),Q===r&&K===n||(t.polygonOffset(r,n),Q=r,K=n)):d(t.POLYGON_OFFSET_FILL)}function w(e){e?p(t.SCISSOR_TEST):d(t.SCISSOR_TEST)}function M(e){void 0===e&&(e=t.TEXTURE0+$-1),rt!==e&&(t.activeTexture(e),rt=e)}function E(e,r){null===rt&&M();var n=nt[rt];void 0===n&&(n={type:void 0,texture:void 0},nt[rt]=n),n.type===e&&n.texture===r||(t.bindTexture(e,r||ot[e]),n.type=e,n.texture=r)}function T(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function S(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function A(e){it.equals(e)===!1&&(t.scissor(e.x,e.y,e.z,e.w),it.copy(e))}function R(e){at.equals(e)===!1&&(t.viewport(e.x,e.y,e.z,e.w),at.copy(e))}function L(){for(var e=0;e<U.length;e++)1===U[e]&&(t.disableVertexAttribArray(e),U[e]=0);B={},F=null,rt=null,nt={},z=null,G=null,Y=null,Z=null,P.reset(),C.reset(),I.reset()}var P=new n,C=new i,I=new a,O=t.getParameter(t.MAX_VERTEX_ATTRIBS),N=new Uint8Array(O),U=new Uint8Array(O),D=new Uint8Array(O),B={},F=null,z=null,G=null,H=null,V=null,k=null,j=null,W=null,X=null,q=!1,Y=null,Z=null,J=null,Q=null,K=null,$=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS),tt=parseFloat(/^WebGL\ ([0-9])/.exec(t.getParameter(t.VERSION))[1]),et=parseFloat(tt)>=1,rt=null,nt={},it=new c,at=new c,ot={};return ot[t.TEXTURE_2D]=o(t.TEXTURE_2D,t.TEXTURE_2D,1),ot[t.TEXTURE_CUBE_MAP]=o(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),P.setClear(0,0,0,1),C.setClear(1),I.setClear(0),p(t.DEPTH_TEST),C.setFunc(Io),y(!1),x(ja),p(t.CULL_FACE),p(t.BLEND),v(so),{buffers:{color:P,depth:C,stencil:I},initAttributes:s,enableAttribute:h,enableAttributeAndDivisor:l,disableUnusedAttributes:u,enable:p,disable:d,getCompressedTextureFormats:f,useProgram:m,setBlending:v,setMaterial:g,setFlipSided:y,setCullFace:x,setLineWidth:b,setPolygonOffset:_,setScissorTest:w,activeTexture:M,bindTexture:E,compressedTexImage2D:T,texImage2D:S,scissor:A,viewport:R,reset:L}}function fe(t,e,r){function n(){if(void 0!==a)return a;var r=e.get("EXT_texture_filter_anisotropic");return a=null!==r?t.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}function i(e){if("highp"===e){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var a,o=void 0!==r.precision?r.precision:"highp",s=i(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var c=r.logarithmicDepthBuffer===!0,h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),l=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),u=t.getParameter(t.MAX_TEXTURE_SIZE),p=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),d=t.getParameter(t.MAX_VERTEX_ATTRIBS),f=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),m=t.getParameter(t.MAX_VARYING_VECTORS),v=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),g=l>0,y=!!e.get("OES_texture_float"),x=g&&y;return{getMaxAnisotropy:n,getMaxPrecision:i,precision:o,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:l,maxTextureSize:u,maxCubemapSize:p,maxAttributes:d,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:v,vertexTextures:g,floatFragmentTextures:y,floatVertexTextures:x}}function me(t,e,r,n){lt.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==r?r:.1,this.far=void 0!==n?n:2e3,this.focus=10,this.aspect=void 0!==e?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function ve(t){me.call(this),this.cameras=t||[]}function ge(t){function e(){if(null!==i&&i.isPresenting){var e=i.getEyeParameters("left"),n=e.renderWidth,a=e.renderHeight;m=t.getPixelRatio(),f=t.getSize(),t.setDrawingBufferSize(2*n,a,1)}else r.enabled&&t.setDrawingBufferSize(f.width,f.height,m)}var r=this,i=null,a=null,o=null,s=new n,h=new n;r.userHeight=1.6,"undefined"!=typeof window&&"VRFrameData"in window&&(a=new window.VRFrameData);var l=new n,u=new me;u.bounds=new c(0,0,.5,1),u.layers.enable(1);var p=new me;p.bounds=new c(.5,0,.5,1),p.layers.enable(2);var d=new ve([u,p]);d.layers.enable(1),d.layers.enable(2);var f,m;"undefined"!=typeof window&&window.addEventListener("vrdisplaypresentchange",e,!1),this.enabled=!1,this.getDevice=function(){return i},this.setDevice=function(t){void 0!==t&&(i=t)},this.setPoseTarget=function(t){void 0!==t&&(o=t)},this.getCamera=function(t){if(null===i)return t;i.depthNear=t.near,i.depthFar=t.far,i.getFrameData(a);var e=a.pose,n=null!==o?o:t;null!==e.position?n.position.fromArray(e.position):n.position.set(0,r.userHeight,0),null!==e.orientation&&n.quaternion.fromArray(e.orientation),n.updateMatrixWorld();var c=i.stageParameters;if(c?s.fromArray(c.sittingToStandingTransform):s.makeTranslation(0,r.userHeight,0),h.getInverse(s),n.matrixWorld.multiply(s),t.matrixWorldInverse.multiply(h),i.isPresenting===!1)return t;u.near=t.near,p.near=t.near,u.far=t.far,p.far=t.far,d.matrixWorld.copy(t.matrixWorld),d.matrixWorldInverse.copy(t.matrixWorldInverse),u.matrixWorldInverse.fromArray(a.leftViewMatrix),p.matrixWorldInverse.fromArray(a.rightViewMatrix),u.matrixWorldInverse.multiply(h),p.matrixWorldInverse.multiply(h);var f=n.parent;null!==f&&(l.getInverse(f.matrixWorld),u.matrixWorldInverse.multiply(l),p.matrixWorldInverse.multiply(l)),u.matrixWorld.getInverse(u.matrixWorldInverse),p.matrixWorld.getInverse(p.matrixWorldInverse),u.projectionMatrix.fromArray(a.leftProjectionMatrix),p.projectionMatrix.fromArray(a.rightProjectionMatrix),d.projectionMatrix.copy(u.projectionMatrix);var m=i.getLayers();if(m.length){var v=m[0];null!==v.leftBounds&&4===v.leftBounds.length&&u.bounds.fromArray(v.leftBounds),null!==v.rightBounds&&4===v.rightBounds.length&&p.bounds.fromArray(v.rightBounds)}return d},this.getStandingMatrix=function(){return s},this.submitFrame=function(){i&&i.isPresenting&&i.submitFrame()},this.dispose=function(){"undefined"!=typeof window&&window.removeEventListener("vrdisplaypresentchange",e)}}function ye(t){var e={};return{get:function(r){if(void 0!==e[r])return e[r];var n;switch(r){case"WEBGL_depth_texture":n=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":n=t.getExtension("WEBGL_compressed_texture_etc1");break;default:n=t.getExtension(r)}return null===n&&console.warn("THREE.WebGLRenderer: "+r+" extension not supported."),e[r]=n,n}}}function xe(){function t(){l.value!==n&&(l.value=n,l.needsUpdate=i>0),r.numPlanes=i,r.numIntersection=0}function e(t,e,n,i){var a=null!==t?t.length:0,o=null;if(0!==a){if(o=l.value,i!==!0||null===o){var s=n+4*a,u=e.matrixWorldInverse;h.getNormalMatrix(u),(null===o||o.length<s)&&(o=new Float32Array(s));for(var p=0,d=n;p!==a;++p,d+=4)c.copy(t[p]).applyMatrix4(u,h),c.normal.toArray(o,d),o[d+3]=c.constant}l.value=o,l.needsUpdate=!0}return r.numPlanes=a,o}var r=this,n=null,i=0,a=!1,s=!1,c=new nt,h=new o,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(t,r,o){var s=0!==t.length||r||0!==i||a;return a=r,n=e(t,o,0),i=t.length,s},this.beginShadows=function(){s=!0,e(null)},this.endShadows=function(){s=!1,t()},this.setState=function(r,o,c,h,u,p){if(!a||null===r||0===r.length||s&&!c)s?e(null):t();else{var d=s?0:i,f=4*d,m=u.clippingState||null;l.value=m,m=e(r,h,f,p);for(var v=0;v!==f;++v)m[v]=n[v];u.clippingState=m,this.numIntersection=o?this.numPlanes:0,this.numPlanes+=d}}}function be(t,e){function r(r){var n;if(r===$o)return t.REPEAT;if(r===ts)return t.CLAMP_TO_EDGE;if(r===es)return t.MIRRORED_REPEAT;if(r===rs)return t.NEAREST;if(r===ns)return t.NEAREST_MIPMAP_NEAREST;if(r===is)return t.NEAREST_MIPMAP_LINEAR;if(r===as)return t.LINEAR;if(r===os)return t.LINEAR_MIPMAP_NEAREST;if(r===ss)return t.LINEAR_MIPMAP_LINEAR;if(r===cs)return t.UNSIGNED_BYTE;if(r===vs)return t.UNSIGNED_SHORT_4_4_4_4;if(r===gs)return t.UNSIGNED_SHORT_5_5_5_1;if(r===ys)return t.UNSIGNED_SHORT_5_6_5;if(r===hs)return t.BYTE;if(r===ls)return t.SHORT;if(r===us)return t.UNSIGNED_SHORT;if(r===ps)return t.INT;if(r===ds)return t.UNSIGNED_INT;if(r===fs)return t.FLOAT;if(r===ms&&(n=e.get("OES_texture_half_float"),null!==n))return n.HALF_FLOAT_OES;if(r===bs)return t.ALPHA;if(r===_s)return t.RGB;if(r===ws)return t.RGBA;if(r===Ms)return t.LUMINANCE;if(r===Es)return t.LUMINANCE_ALPHA;if(r===Ss)return t.DEPTH_COMPONENT;if(r===As)return t.DEPTH_STENCIL;if(r===po)return t.FUNC_ADD;if(r===fo)return t.FUNC_SUBTRACT;if(r===mo)return t.FUNC_REVERSE_SUBTRACT;if(r===yo)return t.ZERO;if(r===xo)return t.ONE;if(r===bo)return t.SRC_COLOR;if(r===_o)return t.ONE_MINUS_SRC_COLOR;if(r===wo)return t.SRC_ALPHA;if(r===Mo)return t.ONE_MINUS_SRC_ALPHA;if(r===Eo)return t.DST_ALPHA;if(r===To)return t.ONE_MINUS_DST_ALPHA;if(r===So)return t.DST_COLOR;if(r===Ao)return t.ONE_MINUS_DST_COLOR;if(r===Ro)return t.SRC_ALPHA_SATURATE;if((r===Rs||r===Ls||r===Ps||r===Cs)&&(n=e.get("WEBGL_compressed_texture_s3tc"),null!==n)){if(r===Rs)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===Ls)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===Ps)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===Cs)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((r===Is||r===Os||r===Ns||r===Us)&&(n=e.get("WEBGL_compressed_texture_pvrtc"),null!==n)){if(r===Is)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===Os)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===Ns)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===Us)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(r===Ds&&(n=e.get("WEBGL_compressed_texture_etc1"),null!==n))return n.COMPRESSED_RGB_ETC1_WEBGL;if((r===vo||r===go)&&(n=e.get("EXT_blend_minmax"),null!==n)){if(r===vo)return n.MIN_EXT;if(r===go)return n.MAX_EXT}return r===xs&&(n=e.get("WEBGL_depth_texture"),null!==n)?n.UNSIGNED_INT_24_8_WEBGL:0}return{convert:r}}function _e(t){function e(){return null===et?vt:1}function r(){Pt=new ye(Rt),Pt.get("WEBGL_depth_texture"),Pt.get("OES_texture_float"),Pt.get("OES_texture_float_linear"),Pt.get("OES_texture_half_float"),Pt.get("OES_texture_half_float_linear"),Pt.get("OES_standard_derivatives"),Pt.get("OES_element_index_uint"),Pt.get("ANGLE_instanced_arrays"),ee=new be(Rt,Pt),Ct=new fe(Rt,Pt,t),It=new de(Rt,Pt,ee),It.scissor(ut.copy(yt).multiplyScalar(vt)),It.viewport(lt.copy(gt).multiplyScalar(vt)),Ot=new pe,Nt=new ue(Rt,Pt,It,Ot,Ct,ee,St),Ut=new ot(Rt),Dt=new Xt(Rt,Ut,St),Ft=new Zt(Dt,At),Jt=new kt(Rt),Gt=new le($,Pt,Ct),zt=new Yt,Vt=new Ht,qt=new Bt($,It,Dt,V),Qt=new Wt(Rt,Pt,At),Kt=new jt(Rt,Pt,At),$t=new Z($,Rt,It,Nt,Ct),te=new Q($,Rt,It,Nt,Ct),$.info.programs=Gt.programs,$.context=Rt,$.capabilities=Ct,$.extensions=Pt,$.properties=Ot,$.renderLists=Vt,$.state=It}function i(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),tt=!0}function o(){console.log("THREE.WebGLRenderer: Context Restored."),tt=!1,r()}function s(t){var e=t.target;e.removeEventListener("dispose",s),h(e)}function h(t){l(t),Ot.remove(t)}function l(t){var e=Ot.get(t).program;t.program=void 0,void 0!==e&&Gt.releaseProgram(e)}function p(t,e,r){t.render(function(t){$.renderBufferImmediate(t,e,r)})}function d(t,e,r,n){if(r&&r.isInstancedBufferGeometry&&null===Pt.get("ANGLE_instanced_arrays"))return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");void 0===n&&(n=0),It.initAttributes();var i=r.attributes,a=e.getAttributes(),o=t.defaultAttributeValues;for(var s in a){var c=a[s];if(c>=0){var h=i[s];if(void 0!==h){var l=h.normalized,u=h.itemSize,p=Ut.get(h);if(void 0===p)continue;var d=p.buffer,f=p.type,m=p.bytesPerElement;if(h.isInterleavedBufferAttribute){var v=h.data,g=v.stride,y=h.offset;v&&v.isInstancedInterleavedBuffer?(It.enableAttributeAndDivisor(c,v.meshPerAttribute),void 0===r.maxInstancedCount&&(r.maxInstancedCount=v.meshPerAttribute*v.count)):It.enableAttribute(c),Rt.bindBuffer(Rt.ARRAY_BUFFER,d),Rt.vertexAttribPointer(c,u,f,l,g*m,(n*g+y)*m)}else h.isInstancedBufferAttribute?(It.enableAttributeAndDivisor(c,h.meshPerAttribute),void 0===r.maxInstancedCount&&(r.maxInstancedCount=h.meshPerAttribute*h.count)):It.enableAttribute(c),Rt.bindBuffer(Rt.ARRAY_BUFFER,d),Rt.vertexAttribPointer(c,u,f,l,0,n*u*m)}else if(void 0!==o){var x=o[s];if(void 0!==x)switch(x.length){case 2:Rt.vertexAttrib2fv(c,x);break;case 3:Rt.vertexAttrib3fv(c,x);break;case 4:Rt.vertexAttrib4fv(c,x);break;default:Rt.vertexAttrib1fv(c,x)}}}}It.disableUnusedAttributes()}function f(){if(!ie){var t=re.getDevice();t&&t.isPresenting?t.requestAnimationFrame(m):window.requestAnimationFrame(m),ie=!0}}function m(t){null!==ae&&ae(t);var e=re.getDevice();e&&e.isPresenting?e.requestAnimationFrame(m):window.requestAnimationFrame(m)}function v(t,e,r){if(t.visible!==!1){var n=t.layers.test(e.layers);if(n)if(t.isLight)W.push(t),t.castShadow&&q.push(t);else if(t.isSprite)t.frustumCulled&&!bt.intersectsSprite(t)||J.push(t);else if(t.isLensFlare)K.push(t);else if(t.isImmediateRenderObject)r&&Tt.setFromMatrixPosition(t.matrixWorld).applyMatrix4(Et),Y.push(t,null,t.material,Tt.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.update(),!t.frustumCulled||bt.intersectsObject(t))){r&&Tt.setFromMatrixPosition(t.matrixWorld).applyMatrix4(Et);var i=Ft.update(t),a=t.material;if(Array.isArray(a))for(var o=i.groups,s=0,c=o.length;s<c;s++){var h=o[s],l=a[h.materialIndex];l&&l.visible&&Y.push(t,i,l,Tt.z,h)}else a.visible&&Y.push(t,i,a,Tt.z,null)}for(var u=t.children,s=0,c=u.length;s<c;s++)v(u[s],e,r)}}function g(t,e,r,n){for(var i=0,a=t.length;i<a;i++){var o=t[i],s=o.object,c=o.geometry,h=void 0===n?o.material:n,l=o.group;if(r.isArrayCamera){ht=r;for(var u=r.cameras,p=0,d=u.length;p<d;p++){var f=u[p];if(s.layers.test(f.layers)){var m=f.bounds,v=m.x*ft,g=m.y*mt,x=m.z*ft,b=m.w*mt;It.viewport(lt.set(v,g,x,b).multiplyScalar(vt)),y(s,e,f,c,h,l)}}}else ht=null,y(s,e,r,c,h,l)}}function y(t,e,r,n,i,a){if(t.onBeforeRender($,e,r,n,i,a),t.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){var o=t.isMesh&&t.matrixWorld.determinant()<0;It.setMaterial(i,o);var s=b(r,e.fog,i,t);st="",p(t,s,i)}else $.renderBufferDirect(r,e.fog,n,i,t,a);t.onAfterRender($,e,r,n,i,a)}function x(t,e,r){var n=Ot.get(t),i=Gt.getParameters(t,zt.state,q,e,_t.numPlanes,_t.numIntersection,r),a=Gt.getProgramCode(t,i),o=n.program,c=!0;if(void 0===o)t.addEventListener("dispose",s);else if(o.code!==a)l(t);else{if(void 0!==i.shaderID)return;c=!1}if(c){if(i.shaderID){var h=xl[i.shaderID];n.shader={name:t.type,uniforms:vc.clone(h.uniforms),vertexShader:h.vertexShader,fragmentShader:h.fragmentShader}}else n.shader={name:t.type,uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader};t.onBeforeCompile(n.shader),o=Gt.acquireProgram(t,n.shader,i,a),n.program=o,t.program=o}var u=o.getAttributes();if(t.morphTargets){t.numSupportedMorphTargets=0;for(var p=0;p<$.maxMorphTargets;p++)u["morphTarget"+p]>=0&&t.numSupportedMorphTargets++}if(t.morphNormals){t.numSupportedMorphNormals=0;for(var p=0;p<$.maxMorphNormals;p++)u["morphNormal"+p]>=0&&t.numSupportedMorphNormals++}var d=n.shader.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&t.clipping!==!0||(n.numClippingPlanes=_t.numPlanes,n.numIntersection=_t.numIntersection,d.clippingPlanes=_t.uniform),n.fog=e,n.lightsHash=zt.state.hash,t.lights&&(d.ambientLightColor.value=zt.state.ambient,d.directionalLights.value=zt.state.directional,d.spotLights.value=zt.state.spot,d.rectAreaLights.value=zt.state.rectArea,d.pointLights.value=zt.state.point,d.hemisphereLights.value=zt.state.hemi,d.directionalShadowMap.value=zt.state.directionalShadowMap,d.directionalShadowMatrix.value=zt.state.directionalShadowMatrix,d.spotShadowMap.value=zt.state.spotShadowMap,d.spotShadowMatrix.value=zt.state.spotShadowMatrix,d.pointShadowMap.value=zt.state.pointShadowMap,d.pointShadowMatrix.value=zt.state.pointShadowMatrix);var f=n.program.getUniforms(),m=X.seqWithValue(f.seq,d);n.uniformsList=m}function b(t,e,r,n){dt=0;var i=Ot.get(r);if(wt&&(Mt||t!==ct)){var a=t===ct&&r.id===nt;_t.setState(r.clippingPlanes,r.clipIntersection,r.clipShadows,t,i,a)}r.needsUpdate===!1&&(void 0===i.program?r.needsUpdate=!0:r.fog&&i.fog!==e?r.needsUpdate=!0:r.lights&&i.lightsHash!==zt.state.hash?r.needsUpdate=!0:void 0===i.numClippingPlanes||i.numClippingPlanes===_t.numPlanes&&i.numIntersection===_t.numIntersection||(r.needsUpdate=!0)),r.needsUpdate&&(x(r,e,n),r.needsUpdate=!1);var o=!1,s=!1,c=!1,h=i.program,l=h.getUniforms(),p=i.shader.uniforms;if(It.useProgram(h.program)&&(o=!0,s=!0,c=!0),r.id!==nt&&(nt=r.id,s=!0),o||t!==ct){if(l.setValue(Rt,"projectionMatrix",t.projectionMatrix),Ct.logarithmicDepthBuffer&&l.setValue(Rt,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),ct!==(ht||t)&&(ct=ht||t,s=!0,c=!0),r.isShaderMaterial||r.isMeshPhongMaterial||r.isMeshStandardMaterial||r.envMap){var d=l.map.cameraPosition;void 0!==d&&d.setValue(Rt,Tt.setFromMatrixPosition(t.matrixWorld))}(r.isMeshPhongMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial||r.skinning)&&l.setValue(Rt,"viewMatrix",t.matrixWorldInverse)}if(r.skinning){l.setOptional(Rt,n,"bindMatrix"),l.setOptional(Rt,n,"bindMatrixInverse");var f=n.skeleton;if(f){var m=f.bones;if(Ct.floatVertexTextures){if(void 0===f.boneTexture){var v=Math.sqrt(4*m.length);v=ac.ceilPowerOfTwo(v),v=Math.max(v,4);var g=new Float32Array(v*v*4);g.set(f.boneMatrices);var y=new u(g,v,v,ws,fs);f.boneMatrices=g,f.boneTexture=y,f.boneTextureSize=v}l.setValue(Rt,"boneTexture",f.boneTexture),l.setValue(Rt,"boneTextureSize",f.boneTextureSize)}else l.setOptional(Rt,f,"boneMatrices")}}return s&&(l.setValue(Rt,"toneMappingExposure",$.toneMappingExposure),l.setValue(Rt,"toneMappingWhitePoint",$.toneMappingWhitePoint),r.lights&&N(p,c),e&&r.fog&&T(p,e),r.isMeshBasicMaterial?_(p,r):r.isMeshLambertMaterial?(_(p,r),S(p,r)):r.isMeshPhongMaterial?(_(p,r),r.isMeshToonMaterial?R(p,r):A(p,r)):r.isMeshStandardMaterial?(_(p,r),r.isMeshPhysicalMaterial?P(p,r):L(p,r)):r.isMeshDepthMaterial?(_(p,r),C(p,r)):r.isMeshDistanceMaterial?(_(p,r),I(p,r)):r.isMeshNormalMaterial?(_(p,r),O(p,r)):r.isLineBasicMaterial?(w(p,r),r.isLineDashedMaterial&&M(p,r)):r.isPointsMaterial?E(p,r):r.isShadowMaterial&&(p.color.value=r.color,p.opacity.value=r.opacity),void 0!==p.ltcMat&&(p.ltcMat.value=mc.LTC_MAT_TEXTURE),void 0!==p.ltcMag&&(p.ltcMag.value=mc.LTC_MAG_TEXTURE),X.upload(Rt,i.uniformsList,p,$)),l.setValue(Rt,"modelViewMatrix",n.modelViewMatrix),l.setValue(Rt,"normalMatrix",n.normalMatrix),l.setValue(Rt,"modelMatrix",n.matrixWorld),h}function _(t,e){t.opacity.value=e.opacity,e.color&&(t.diffuse.value=e.color),e.emissive&&t.emissive.value.copy(e.emissive).multiplyScalar(e.emissiveIntensity),e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.specularMap&&(t.specularMap.value=e.specularMap),e.envMap&&(t.envMap.value=e.envMap,t.flipEnvMap.value=e.envMap&&e.envMap.isCubeTexture?-1:1,t.reflectivity.value=e.reflectivity,t.refractionRatio.value=e.refractionRatio),e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.aoMap&&(t.aoMap.value=e.aoMap,t.aoMapIntensity.value=e.aoMapIntensity);var r;if(e.map?r=e.map:e.specularMap?r=e.specularMap:e.displacementMap?r=e.displacementMap:e.normalMap?r=e.normalMap:e.bumpMap?r=e.bumpMap:e.roughnessMap?r=e.roughnessMap:e.metalnessMap?r=e.metalnessMap:e.alphaMap?r=e.alphaMap:e.emissiveMap&&(r=e.emissiveMap),void 0!==r){if(r.isWebGLRenderTarget&&(r=r.texture),r.matrixAutoUpdate===!0){var n=r.offset,i=r.repeat,a=r.rotation,o=r.center;r.matrix.setUvTransform(n.x,n.y,i.x,i.y,a,o.x,o.y)}t.uvTransform.value.copy(r.matrix)}}function w(t,e){t.diffuse.value=e.color,t.opacity.value=e.opacity}function M(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}function E(t,e){if(t.diffuse.value=e.color,t.opacity.value=e.opacity,t.size.value=e.size*vt,t.scale.value=.5*mt,t.map.value=e.map,null!==e.map){if(e.map.matrixAutoUpdate===!0){var r=e.map.offset,n=e.map.repeat,i=e.map.rotation,a=e.map.center;e.map.matrix.setUvTransform(r.x,r.y,n.x,n.y,i,a.x,a.y)}t.uvTransform.value.copy(e.map.matrix)}}function T(t,e){t.fogColor.value=e.color,e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)}function S(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}function A(t,e){t.specular.value=e.specular,t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale)),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function R(t,e){A(t,e),e.gradientMap&&(t.gradientMap.value=e.gradientMap)}function L(t,e){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale)),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),e.envMap&&(t.envMapIntensity.value=e.envMapIntensity)}function P(t,e){t.clearCoat.value=e.clearCoat,t.clearCoatRoughness.value=e.clearCoatRoughness,L(t,e)}function C(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function I(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}function O(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale)),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function N(t,e){t.ambientLightColor.needsUpdate=e,t.directionalLights.needsUpdate=e,t.pointLights.needsUpdate=e,t.spotLights.needsUpdate=e,t.rectAreaLights.needsUpdate=e,t.hemisphereLights.needsUpdate=e}function U(){var t=dt;return t>=Ct.maxTextures&&console.warn("THREE.WebGLRenderer: Trying to use "+t+" texture units while this GPU supports only "+Ct.maxTextures),dt+=1,t}console.log("THREE.WebGLRenderer",Ha),t=t||{};var D=void 0!==t.canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),B=void 0!==t.context?t.context:null,F=void 0!==t.alpha&&t.alpha,z=void 0===t.depth||t.depth,G=void 0===t.stencil||t.stencil,H=void 0!==t.antialias&&t.antialias,V=void 0===t.premultipliedAlpha||t.premultipliedAlpha,k=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,j=void 0!==t.powerPreference?t.powerPreference:"default",W=[],q=[],Y=null,J=[],K=[];this.domElement=D,this.context=null,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=Ho,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var $=this,tt=!1,et=null,rt=null,nt=-1,st="",ct=null,ht=null,lt=new c,ut=new c,pt=null,dt=0,ft=D.width,mt=D.height,vt=1,gt=new c(0,0,ft,mt),yt=new c(0,0,ft,mt),xt=!1,bt=new it,_t=new xe,wt=!1,Mt=!1,Et=new n,Tt=new a,St={geometries:0,textures:0},At={frame:0,calls:0,vertices:0,faces:0,points:0};this.info={render:At,memory:St,programs:null};var Rt;try{var Lt={alpha:F,depth:z,stencil:G,antialias:H,premultipliedAlpha:V,preserveDrawingBuffer:k,powerPreference:j};if(D.addEventListener("webglcontextlost",i,!1),D.addEventListener("webglcontextrestored",o,!1),Rt=B||D.getContext("webgl",Lt)||D.getContext("experimental-webgl",Lt),null===Rt)throw null!==D.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===Rt.getShaderPrecisionFormat&&(Rt.getShaderPrecisionFormat=function(){
  97. return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){console.error("THREE.WebGLRenderer: "+t.message)}var Pt,Ct,It,Ot,Nt,Ut,Dt,Ft,zt,Gt,Vt,qt,Jt,Qt,Kt,$t,te,ee;r();var re=new ge($);this.vr=re;var ne=new at($,Ft,Ct.maxTextureSize);this.shadowMap=ne,this.getContext=function(){return Rt},this.getContextAttributes=function(){return Rt.getContextAttributes()},this.forceContextLoss=function(){var t=Pt.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){var t=Pt.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return vt},this.setPixelRatio=function(t){void 0!==t&&(vt=t,this.setSize(ft,mt,!1))},this.getSize=function(){return{width:ft,height:mt}},this.setSize=function(t,e,r){var n=re.getDevice();return n&&n.isPresenting?void console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(ft=t,mt=e,D.width=t*vt,D.height=e*vt,r!==!1&&(D.style.width=t+"px",D.style.height=e+"px"),void this.setViewport(0,0,t,e))},this.getDrawingBufferSize=function(){return{width:ft*vt,height:mt*vt}},this.setDrawingBufferSize=function(t,e,r){ft=t,mt=e,vt=r,D.width=t*r,D.height=e*r,this.setViewport(0,0,t,e)},this.setViewport=function(t,e,r,n){gt.set(t,mt-e-n,r,n),It.viewport(lt.copy(gt).multiplyScalar(vt))},this.setScissor=function(t,e,r,n){yt.set(t,mt-e-n,r,n),It.scissor(ut.copy(yt).multiplyScalar(vt))},this.setScissorTest=function(t){It.setScissorTest(xt=t)},this.getClearColor=function(){return qt.getClearColor()},this.setClearColor=function(){qt.setClearColor.apply(qt,arguments)},this.getClearAlpha=function(){return qt.getClearAlpha()},this.setClearAlpha=function(){qt.setClearAlpha.apply(qt,arguments)},this.clear=function(t,e,r){var n=0;(void 0===t||t)&&(n|=Rt.COLOR_BUFFER_BIT),(void 0===e||e)&&(n|=Rt.DEPTH_BUFFER_BIT),(void 0===r||r)&&(n|=Rt.STENCIL_BUFFER_BIT),Rt.clear(n)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.clearTarget=function(t,e,r,n){this.setRenderTarget(t),this.clear(e,r,n)},this.dispose=function(){D.removeEventListener("webglcontextlost",i,!1),D.removeEventListener("webglcontextrestored",o,!1),Vt.dispose(),re.dispose()},this.renderBufferImmediate=function(t,e,r){It.initAttributes();var n=Ot.get(t);t.hasPositions&&!n.position&&(n.position=Rt.createBuffer()),t.hasNormals&&!n.normal&&(n.normal=Rt.createBuffer()),t.hasUvs&&!n.uv&&(n.uv=Rt.createBuffer()),t.hasColors&&!n.color&&(n.color=Rt.createBuffer());var i=e.getAttributes();if(t.hasPositions&&(Rt.bindBuffer(Rt.ARRAY_BUFFER,n.position),Rt.bufferData(Rt.ARRAY_BUFFER,t.positionArray,Rt.DYNAMIC_DRAW),It.enableAttribute(i.position),Rt.vertexAttribPointer(i.position,3,Rt.FLOAT,!1,0,0)),t.hasNormals){if(Rt.bindBuffer(Rt.ARRAY_BUFFER,n.normal),!r.isMeshPhongMaterial&&!r.isMeshStandardMaterial&&!r.isMeshNormalMaterial&&r.flatShading===!0)for(var a=0,o=3*t.count;a<o;a+=9){var s=t.normalArray,c=(s[a+0]+s[a+3]+s[a+6])/3,h=(s[a+1]+s[a+4]+s[a+7])/3,l=(s[a+2]+s[a+5]+s[a+8])/3;s[a+0]=c,s[a+1]=h,s[a+2]=l,s[a+3]=c,s[a+4]=h,s[a+5]=l,s[a+6]=c,s[a+7]=h,s[a+8]=l}Rt.bufferData(Rt.ARRAY_BUFFER,t.normalArray,Rt.DYNAMIC_DRAW),It.enableAttribute(i.normal),Rt.vertexAttribPointer(i.normal,3,Rt.FLOAT,!1,0,0)}t.hasUvs&&r.map&&(Rt.bindBuffer(Rt.ARRAY_BUFFER,n.uv),Rt.bufferData(Rt.ARRAY_BUFFER,t.uvArray,Rt.DYNAMIC_DRAW),It.enableAttribute(i.uv),Rt.vertexAttribPointer(i.uv,2,Rt.FLOAT,!1,0,0)),t.hasColors&&r.vertexColors!==no&&(Rt.bindBuffer(Rt.ARRAY_BUFFER,n.color),Rt.bufferData(Rt.ARRAY_BUFFER,t.colorArray,Rt.DYNAMIC_DRAW),It.enableAttribute(i.color),Rt.vertexAttribPointer(i.color,3,Rt.FLOAT,!1,0,0)),It.disableUnusedAttributes(),Rt.drawArrays(Rt.TRIANGLES,0,t.count),t.count=0},this.renderBufferDirect=function(t,r,n,i,a,o){var s=a.isMesh&&a.matrixWorld.determinant()<0;It.setMaterial(i,s);var c=b(t,r,i,a),h=n.id+"_"+c.id+"_"+(i.wireframe===!0),l=!1;h!==st&&(st=h,l=!0),a.morphTargetInfluences&&(Jt.update(a,n,i,c),l=!0);var u=n.index,p=n.attributes.position,f=1;i.wireframe===!0&&(u=Dt.getWireframeAttribute(n),f=2);var m,v=Qt;null!==u&&(m=Ut.get(u),v=Kt,v.setIndex(m)),l&&(d(i,c,n),null!==u&&Rt.bindBuffer(Rt.ELEMENT_ARRAY_BUFFER,m.buffer));var g=0;null!==u?g=u.count:void 0!==p&&(g=p.count);var y=n.drawRange.start*f,x=n.drawRange.count*f,_=null!==o?o.start*f:0,w=null!==o?o.count*f:1/0,M=Math.max(y,_),E=Math.min(g,y+x,_+w)-1,T=Math.max(0,E-M+1);if(0!==T){if(a.isMesh)if(i.wireframe===!0)It.setLineWidth(i.wireframeLinewidth*e()),v.setMode(Rt.LINES);else switch(a.drawMode){case Xs:v.setMode(Rt.TRIANGLES);break;case qs:v.setMode(Rt.TRIANGLE_STRIP);break;case Ys:v.setMode(Rt.TRIANGLE_FAN)}else if(a.isLine){var S=i.linewidth;void 0===S&&(S=1),It.setLineWidth(S*e()),a.isLineSegments?v.setMode(Rt.LINES):a.isLineLoop?v.setMode(Rt.LINE_LOOP):v.setMode(Rt.LINE_STRIP)}else a.isPoints&&v.setMode(Rt.POINTS);n&&n.isInstancedBufferGeometry?n.maxInstancedCount>0&&v.renderInstances(n,M,T):v.render(M,T)}},this.compile=function(t,e){W.length=0,q.length=0,t.traverse(function(t){t.isLight&&(W.push(t),t.castShadow&&q.push(t))}),zt.setup(W,q,e),t.traverse(function(e){if(e.material)if(Array.isArray(e.material))for(var r=0;r<e.material.length;r++)x(e.material[r],t.fog,e);else x(e.material,t.fog,e)})};var ie=!1,ae=null;this.animate=function(t){ae=t,f()},this.render=function(t,e,r,n){if(!e||!e.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!tt){st="",nt=-1,ct=null,t.autoUpdate===!0&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),re.enabled&&(e=re.getCamera(e)),Et.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),bt.setFromMatrix(Et),W.length=0,q.length=0,J.length=0,K.length=0,Mt=this.localClippingEnabled,wt=_t.init(this.clippingPlanes,Mt,e),Y=Vt.get(t,e),Y.init(),v(t,e,$.sortObjects),$.sortObjects===!0&&Y.sort(),Nt.updateVideoTextures(),wt&&_t.beginShadows(),ne.render(q,t,e),zt.setup(W,q,e),wt&&_t.endShadows(),At.frame++,At.calls=0,At.vertices=0,At.faces=0,At.points=0,void 0===r&&(r=null),this.setRenderTarget(r),qt.render(Y,t,e,n);var i=Y.opaque,a=Y.transparent;if(t.overrideMaterial){var o=t.overrideMaterial;i.length&&g(i,t,e,o),a.length&&g(a,t,e,o)}else i.length&&g(i,t,e),a.length&&g(a,t,e);te.render(J,t,e),$t.render(K,t,e,lt),r&&Nt.updateRenderTargetMipmap(r),It.buffers.depth.setTest(!0),It.buffers.depth.setMask(!0),It.buffers.color.setMask(!0),It.setPolygonOffset(!1),re.enabled&&re.submitFrame()}},this.setFaceCulling=function(t,e){It.setCullFace(t),It.setFlipSided(e===qa)},this.allocTextureUnit=U,this.setTexture2D=function(){var t=!1;return function(e,r){e&&e.isWebGLRenderTarget&&(t||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),t=!0),e=e.texture),Nt.setTexture2D(e,r)}}(),this.setTexture=function(){var t=!1;return function(e,r){t||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),t=!0),Nt.setTexture2D(e,r)}}(),this.setTextureCube=function(){var t=!1;return function(e,r){e&&e.isWebGLRenderTargetCube&&(t||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),t=!0),e=e.texture),e&&e.isCubeTexture||Array.isArray(e.image)&&6===e.image.length?Nt.setTextureCube(e,r):Nt.setTextureCubeDynamic(e,r)}}(),this.getRenderTarget=function(){return et},this.setRenderTarget=function(t){et=t,t&&void 0===Ot.get(t).__webglFramebuffer&&Nt.setupRenderTarget(t);var e=null,r=!1;if(t){var n=Ot.get(t).__webglFramebuffer;t.isWebGLRenderTargetCube?(e=n[t.activeCubeFace],r=!0):e=n,lt.copy(t.viewport),ut.copy(t.scissor),pt=t.scissorTest}else lt.copy(gt).multiplyScalar(vt),ut.copy(yt).multiplyScalar(vt),pt=xt;if(rt!==e&&(Rt.bindFramebuffer(Rt.FRAMEBUFFER,e),rt=e),It.viewport(lt),It.scissor(ut),It.setScissorTest(pt),r){var i=Ot.get(t.texture);Rt.framebufferTexture2D(Rt.FRAMEBUFFER,Rt.COLOR_ATTACHMENT0,Rt.TEXTURE_CUBE_MAP_POSITIVE_X+t.activeCubeFace,i.__webglTexture,t.activeMipMapLevel)}},this.readRenderTargetPixels=function(t,e,r,n,i,a){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");var o=Ot.get(t).__webglFramebuffer;if(o){var s=!1;o!==rt&&(Rt.bindFramebuffer(Rt.FRAMEBUFFER,o),s=!0);try{var c=t.texture,h=c.format,l=c.type;if(h!==ws&&ee.convert(h)!==Rt.getParameter(Rt.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(l===cs||ee.convert(l)===Rt.getParameter(Rt.IMPLEMENTATION_COLOR_READ_TYPE)||l===fs&&(Pt.get("OES_texture_float")||Pt.get("WEBGL_color_buffer_float"))||l===ms&&Pt.get("EXT_color_buffer_half_float")))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");Rt.checkFramebufferStatus(Rt.FRAMEBUFFER)===Rt.FRAMEBUFFER_COMPLETE?e>=0&&e<=t.width-n&&r>=0&&r<=t.height-i&&Rt.readPixels(e,r,n,i,ee.convert(h),ee.convert(l),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&Rt.bindFramebuffer(Rt.FRAMEBUFFER,rt)}}}}function we(t,e){this.name="",this.color=new q(t),this.density=void 0!==e?e:25e-5}function Me(t,e,r){this.name="",this.color=new q(t),this.near=void 0!==e?e:1,this.far=void 0!==r?r:1e3}function Ee(){ht.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function Te(t,e,r,n,i){ht.call(this),this.lensFlares=[],this.positionScreen=new a,this.customUpdateCallback=void 0,void 0!==t&&this.add(t,e,r,n,i)}function Se(t){K.call(this),this.type="SpriteMaterial",this.color=new q(16777215),this.map=null,this.rotation=0,this.fog=!1,this.lights=!1,this.setValues(t)}function Ae(t){ht.call(this),this.type="Sprite",this.material=void 0!==t?t:new Se}function Re(){ht.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function Le(t,e){if(t=t||[],this.bones=t.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var r=0,i=this.bones.length;r<i;r++)this.boneInverses.push(new n)}}function Pe(){ht.call(this),this.type="Bone"}function Ce(t,e){Dt.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new n,this.bindMatrixInverse=new n;var r=this.initBones(),i=new Le(r);this.bind(i,this.matrixWorld),this.normalizeSkinWeights()}function Ie(t){K.call(this),this.type="LineBasicMaterial",this.color=new q(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(t)}function Oe(t,e,r){return 1===r?(console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new Ne(t,e)):(ht.call(this),this.type="Line",this.geometry=void 0!==t?t:new St,void(this.material=void 0!==e?e:new Ie({color:16777215*Math.random()})))}function Ne(t,e){Oe.call(this,t,e),this.type="LineSegments"}function Ue(t,e){Oe.call(this,t,e),this.type="LineLoop"}function De(t){K.call(this),this.type="PointsMaterial",this.color=new q(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.lights=!1,this.setValues(t)}function Be(t,e){ht.call(this),this.type="Points",this.geometry=void 0!==t?t:new St,this.material=void 0!==e?e:new De({color:16777215*Math.random()})}function Fe(){ht.call(this),this.type="Group"}function ze(t,e,r,n,i,a,o,c,h){function l(){t.removeEventListener("loadeddata",l,!1),u.needsUpdate=!0}s.call(this,t,e,r,n,i,a,o,c,h),this.generateMipmaps=!1;var u=this;t.addEventListener("loadeddata",l,!1)}function Ge(t,e,r,n,i,a,o,c,h,l,u,p){s.call(this,null,a,o,c,h,l,n,i,u,p),this.image={width:e,height:r},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function He(t,e,r,n,i,a,o,c,h,l){if(l=void 0!==l?l:Ss,l!==Ss&&l!==As)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===r&&l===Ss&&(r=us),void 0===r&&l===As&&(r=xs),s.call(this,null,n,i,a,o,c,l,r,h),this.image={width:t,height:e},this.magFilter=void 0!==o?o:rs,this.minFilter=void 0!==c?c:rs,this.flipY=!1,this.generateMipmaps=!1}function Ve(t){St.call(this),this.type="WireframeGeometry";var e,r,n,i,o,s,c,h,l,u,p=[],d=[0,0],f={},m=["a","b","c"];if(t&&t.isGeometry){var v=t.faces;for(e=0,n=v.length;e<n;e++){var g=v[e];for(r=0;r<3;r++)c=g[m[r]],h=g[m[(r+1)%3]],d[0]=Math.min(c,h),d[1]=Math.max(c,h),l=d[0]+","+d[1],void 0===f[l]&&(f[l]={index1:d[0],index2:d[1]})}for(l in f)s=f[l],u=t.vertices[s.index1],p.push(u.x,u.y,u.z),u=t.vertices[s.index2],p.push(u.x,u.y,u.z)}else if(t&&t.isBufferGeometry){var y,x,b,_,w,M,E,T;if(u=new a,null!==t.index){for(y=t.attributes.position,x=t.index,b=t.groups,0===b.length&&(b=[{start:0,count:x.count,materialIndex:0}]),i=0,o=b.length;i<o;++i)for(_=b[i],w=_.start,M=_.count,e=w,n=w+M;e<n;e+=3)for(r=0;r<3;r++)c=x.getX(e+r),h=x.getX(e+(r+1)%3),d[0]=Math.min(c,h),d[1]=Math.max(c,h),l=d[0]+","+d[1],void 0===f[l]&&(f[l]={index1:d[0],index2:d[1]});for(l in f)s=f[l],u.fromBufferAttribute(y,s.index1),p.push(u.x,u.y,u.z),u.fromBufferAttribute(y,s.index2),p.push(u.x,u.y,u.z)}else for(y=t.attributes.position,e=0,n=y.count/3;e<n;e++)for(r=0;r<3;r++)E=3*e+r,u.fromBufferAttribute(y,E),p.push(u.x,u.y,u.z),T=3*e+(r+1)%3,u.fromBufferAttribute(y,T),p.push(u.x,u.y,u.z)}this.addAttribute("position",new wt(p,3))}function ke(t,e,r){dt.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:r},this.fromBufferGeometry(new je(t,e,r)),this.mergeVertices()}function je(t,e,r){St.call(this),this.type="ParametricBufferGeometry",this.parameters={func:t,slices:e,stacks:r};var n,i,o=[],s=[],c=[],h=[],l=1e-5,u=new a,p=new a,d=new a,f=new a,m=new a,v=e+1;for(n=0;n<=r;n++){var g=n/r;for(i=0;i<=e;i++){var y=i/e;p=t(y,g,p),s.push(p.x,p.y,p.z),y-l>=0?(d=t(y-l,g,d),f.subVectors(p,d)):(d=t(y+l,g,d),f.subVectors(d,p)),g-l>=0?(d=t(y,g-l,d),m.subVectors(p,d)):(d=t(y,g+l,d),m.subVectors(d,p)),u.crossVectors(f,m).normalize(),c.push(u.x,u.y,u.z),h.push(y,g)}}for(n=0;n<r;n++)for(i=0;i<e;i++){var x=n*v+i,b=n*v+i+1,_=(n+1)*v+i+1,w=(n+1)*v+i;o.push(x,b,w),o.push(b,_,w)}this.setIndex(o),this.addAttribute("position",new wt(s,3)),this.addAttribute("normal",new wt(c,3)),this.addAttribute("uv",new wt(h,2))}function We(t,e,r,n){dt.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:r,detail:n},this.fromBufferGeometry(new Xe(t,e,r,n)),this.mergeVertices()}function Xe(t,e,n,i){function o(t){for(var r=new a,n=new a,i=new a,o=0;o<e.length;o+=3)p(e[o+0],r),p(e[o+1],n),p(e[o+2],i),s(r,n,i,t)}function s(t,e,r,n){var i,a,o=Math.pow(2,n),s=[];for(i=0;i<=o;i++){s[i]=[];var c=t.clone().lerp(r,i/o),h=e.clone().lerp(r,i/o),l=o-i;for(a=0;a<=l;a++)0===a&&i===o?s[i][a]=c:s[i][a]=c.clone().lerp(h,a/l)}for(i=0;i<o;i++)for(a=0;a<2*(o-i)-1;a++){var p=Math.floor(a/2);a%2===0?(u(s[i][p+1]),u(s[i+1][p]),u(s[i][p])):(u(s[i][p+1]),u(s[i+1][p+1]),u(s[i+1][p]))}}function c(t){for(var e=new a,r=0;r<g.length;r+=3)e.x=g[r+0],e.y=g[r+1],e.z=g[r+2],e.normalize().multiplyScalar(t),g[r+0]=e.x,g[r+1]=e.y,g[r+2]=e.z}function h(){for(var t=new a,e=0;e<g.length;e+=3){t.x=g[e+0],t.y=g[e+1],t.z=g[e+2];var r=m(t)/2/Math.PI+.5,n=v(t)/Math.PI+.5;y.push(r,1-n)}d(),l()}function l(){for(var t=0;t<y.length;t+=6){var e=y[t+0],r=y[t+2],n=y[t+4],i=Math.max(e,r,n),a=Math.min(e,r,n);i>.9&&a<.1&&(e<.2&&(y[t+0]+=1),r<.2&&(y[t+2]+=1),n<.2&&(y[t+4]+=1))}}function u(t){g.push(t.x,t.y,t.z)}function p(e,r){var n=3*e;r.x=t[n+0],r.y=t[n+1],r.z=t[n+2]}function d(){for(var t=new a,e=new a,n=new a,i=new a,o=new r,s=new r,c=new r,h=0,l=0;h<g.length;h+=9,l+=6){t.set(g[h+0],g[h+1],g[h+2]),e.set(g[h+3],g[h+4],g[h+5]),n.set(g[h+6],g[h+7],g[h+8]),o.set(y[l+0],y[l+1]),s.set(y[l+2],y[l+3]),c.set(y[l+4],y[l+5]),i.copy(t).add(e).add(n).divideScalar(3);var u=m(i);f(o,l+0,t,u),f(s,l+2,e,u),f(c,l+4,n,u)}}function f(t,e,r,n){n<0&&1===t.x&&(y[e]=t.x-1),0===r.x&&0===r.z&&(y[e]=n/2/Math.PI+.5)}function m(t){return Math.atan2(t.z,-t.x)}function v(t){return Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))}St.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:i},n=n||1,i=i||0;var g=[],y=[];o(i),c(n),h(),this.addAttribute("position",new wt(g,3)),this.addAttribute("normal",new wt(g.slice(),3)),this.addAttribute("uv",new wt(y,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}function qe(t,e){dt.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Ye(t,e)),this.mergeVertices()}function Ye(t,e){var r=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],n=[2,1,0,0,3,2,1,3,0,2,3,1];Xe.call(this,r,n,t,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Ze(t,e){dt.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Je(t,e)),this.mergeVertices()}function Je(t,e){var r=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],n=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];Xe.call(this,r,n,t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Qe(t,e){dt.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Ke(t,e)),this.mergeVertices()}function Ke(t,e){var r=(1+Math.sqrt(5))/2,n=[-1,r,0,1,r,0,-1,-r,0,1,-r,0,0,-1,r,0,1,r,0,-1,-r,0,1,-r,r,0,-1,r,0,1,-r,0,-1,-r,0,1],i=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];Xe.call(this,n,i,t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function $e(t,e){dt.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new tr(t,e)),this.mergeVertices()}function tr(t,e){var r=(1+Math.sqrt(5))/2,n=1/r,i=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-r,0,-n,r,0,n,-r,0,n,r,-n,-r,0,-n,r,0,n,-r,0,n,r,0,-r,0,-n,r,0,-n,-r,0,n,r,0,n],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];Xe.call(this,i,a,t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function er(t,e,r,n,i,a){dt.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:r,radialSegments:n,closed:i},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new rr(t,e,r,n,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function rr(t,e,n,i,o){function s(){for(p=0;p<e;p++)c(p);c(o===!1?e:0),l(),h()}function c(r){g=t.getPointAt(r/e,g);var a=u.normals[r],o=u.binormals[r];for(d=0;d<=i;d++){var s=d/i*Math.PI*2,c=Math.sin(s),h=-Math.cos(s);m.x=h*a.x+c*o.x,m.y=h*a.y+c*o.y,m.z=h*a.z+c*o.z,m.normalize(),x.push(m.x,m.y,m.z),f.x=g.x+n*m.x,f.y=g.y+n*m.y,f.z=g.z+n*m.z,y.push(f.x,f.y,f.z)}}function h(){for(d=1;d<=e;d++)for(p=1;p<=i;p++){var t=(i+1)*(d-1)+(p-1),r=(i+1)*d+(p-1),n=(i+1)*d+p,a=(i+1)*(d-1)+p;_.push(t,r,a),_.push(r,n,a)}}function l(){for(p=0;p<=e;p++)for(d=0;d<=i;d++)v.x=p/e,v.y=d/i,b.push(v.x,v.y)}St.call(this),this.type="TubeBufferGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:i,closed:o},e=e||64,n=n||1,i=i||8,o=o||!1;var u=t.computeFrenetFrames(e,o);this.tangents=u.tangents,this.normals=u.normals,this.binormals=u.binormals;var p,d,f=new a,m=new a,v=new r,g=new a,y=[],x=[],b=[],_=[];s(),this.setIndex(_),this.addAttribute("position",new wt(y,3)),this.addAttribute("normal",new wt(x,3)),this.addAttribute("uv",new wt(b,2))}function nr(t,e,r,n,i,a,o){dt.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:r,radialSegments:n,p:i,q:a},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new ir(t,e,r,n,i,a)),this.mergeVertices()}function ir(t,e,r,n,i,o){function s(t,e,r,n,i){var a=Math.cos(t),o=Math.sin(t),s=r/e*t,c=Math.cos(s);i.x=n*(2+c)*.5*a,i.y=n*(2+c)*o*.5,i.z=n*Math.sin(s)*.5}St.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:t,tube:e,tubularSegments:r,radialSegments:n,p:i,q:o},t=t||1,e=e||.4,r=Math.floor(r)||64,n=Math.floor(n)||8,i=i||2,o=o||3;var c,h,l=[],u=[],p=[],d=[],f=new a,m=new a,v=new a,g=new a,y=new a,x=new a,b=new a;for(c=0;c<=r;++c){var _=c/r*i*Math.PI*2;for(s(_,i,o,t,v),s(_+.01,i,o,t,g),x.subVectors(g,v),b.addVectors(g,v),y.crossVectors(x,b),b.crossVectors(y,x),y.normalize(),b.normalize(),h=0;h<=n;++h){var w=h/n*Math.PI*2,M=-e*Math.cos(w),E=e*Math.sin(w);f.x=v.x+(M*b.x+E*y.x),f.y=v.y+(M*b.y+E*y.y),f.z=v.z+(M*b.z+E*y.z),u.push(f.x,f.y,f.z),m.subVectors(f,v).normalize(),p.push(m.x,m.y,m.z),d.push(c/r),d.push(h/n)}}for(h=1;h<=r;h++)for(c=1;c<=n;c++){var T=(n+1)*(h-1)+(c-1),S=(n+1)*h+(c-1),A=(n+1)*h+c,R=(n+1)*(h-1)+c;l.push(T,S,R),l.push(S,A,R)}this.setIndex(l),this.addAttribute("position",new wt(u,3)),this.addAttribute("normal",new wt(p,3)),this.addAttribute("uv",new wt(d,2))}function ar(t,e,r,n,i){dt.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:r,tubularSegments:n,arc:i},this.fromBufferGeometry(new or(t,e,r,n,i)),this.mergeVertices()}function or(t,e,r,n,i){St.call(this),this.type="TorusBufferGeometry",this.parameters={radius:t,tube:e,radialSegments:r,tubularSegments:n,arc:i},t=t||1,e=e||.4,r=Math.floor(r)||8,n=Math.floor(n)||6,i=i||2*Math.PI;var o,s,c=[],h=[],l=[],u=[],p=new a,d=new a,f=new a;for(o=0;o<=r;o++)for(s=0;s<=n;s++){var m=s/n*i,v=o/r*Math.PI*2;d.x=(t+e*Math.cos(v))*Math.cos(m),d.y=(t+e*Math.cos(v))*Math.sin(m),d.z=e*Math.sin(v),h.push(d.x,d.y,d.z),p.x=t*Math.cos(m),p.y=t*Math.sin(m),f.subVectors(d,p).normalize(),l.push(f.x,f.y,f.z),u.push(s/n),u.push(o/r)}for(o=1;o<=r;o++)for(s=1;s<=n;s++){var g=(n+1)*o+s-1,y=(n+1)*(o-1)+s-1,x=(n+1)*(o-1)+s,b=(n+1)*o+s;c.push(g,y,b),c.push(y,x,b)}this.setIndex(c),this.addAttribute("position",new wt(h,3)),this.addAttribute("normal",new wt(l,3)),this.addAttribute("uv",new wt(u,2))}function sr(t,e,r,n,i){var a,o;if(i===Nr(t,e,r,n)>0)for(a=e;a<r;a+=n)o=Cr(a,t[a],t[a+1],o);else for(a=r-n;a>=e;a-=n)o=Cr(a,t[a],t[a+1],o);return o&&Tr(o,o.next)&&(Ir(o),o=o.next),o}function cr(t,e){if(!t)return t;e||(e=t);var r,n=t;do if(r=!1,n.steiner||!Tr(n,n.next)&&0!==Er(n.prev,n,n.next))n=n.next;else{if(Ir(n),n=e=n.prev,n===n.next)break;r=!0}while(r||n!==e);return e}function hr(t,e,r,n,i,a,o){if(t){!o&&a&&yr(t,n,i,a);for(var s,c,h=t;t.prev!==t.next;)if(s=t.prev,c=t.next,a?ur(t,n,i,a):lr(t))e.push(s.i/r),e.push(t.i/r),e.push(c.i/r),Ir(t),t=c.next,h=c.next;else if(t=c,t===h){o?1===o?(t=pr(t,e,r),hr(t,e,r,n,i,a,2)):2===o&&dr(t,e,r,n,i,a):hr(cr(t),e,r,n,i,a,1);break}}}function lr(t){var e=t.prev,r=t,n=t.next;if(Er(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(wr(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&Er(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function ur(t,e,r,n){var i=t.prev,a=t,o=t.next;if(Er(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,c=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,h=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,l=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,u=br(s,c,e,r,n),p=br(h,l,e,r,n),d=t.nextZ;d&&d.z<=p;){if(d!==t.prev&&d!==t.next&&wr(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Er(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=t.prevZ;d&&d.z>=u;){if(d!==t.prev&&d!==t.next&&wr(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Er(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function pr(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!Tr(i,a)&&Sr(i,n,n.next,a)&&Rr(i,a)&&Rr(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),Ir(n),Ir(n.next),n=t=a),n=n.next}while(n!==t);return n}function dr(t,e,r,n,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Mr(o,s)){var c=Pr(o,s);return o=cr(o,o.next),c=cr(c,c.next),hr(o,e,r,n,i,a),void hr(c,e,r,n,i,a)}s=s.next}o=o.next}while(o!==t)}function fr(t,e,r,n){var i,a,o,s,c,h=[];for(i=0,a=e.length;i<a;i++)o=e[i]*n,s=i<a-1?e[i+1]*n:t.length,c=sr(t,o,s,n,!1),c===c.next&&(c.steiner=!0),h.push(_r(c));for(h.sort(mr),i=0;i<h.length;i++)vr(h[i],r),r=cr(r,r.next);return r}function mr(t,e){return t.x-e.x}function vr(t,e){if(e=gr(t,e)){var r=Pr(e,t);cr(r,r.next)}}function gr(t,e){var r,n=e,i=t.x,a=t.y,o=-(1/0);do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!r)return null;if(i===o)return r.prev;var c,h=r,l=r.x,u=r.y,p=1/0;for(n=r.next;n!==h;)i>=n.x&&n.x>=l&&i!==n.x&&wr(a<u?i:o,a,l,u,a<u?o:i,a,n.x,n.y)&&(c=Math.abs(a-n.y)/(i-n.x),(c<p||c===p&&n.x>r.x)&&Rr(n,t)&&(r=n,p=c)),n=n.next;return r}function yr(t,e,r,n){var i=t;do null===i.z&&(i.z=br(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,xr(i)}function xr(t){var e,r,n,i,a,o,s,c,h=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e<h&&(s++,n=n.nextZ,n);e++);for(c=h;s>0||c>0&&n;)0!==s&&(0===c||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,c--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,h*=2}while(o>1);return t}function br(t,e,r,n,i){return t=32767*(t-r)*i,e=32767*(e-n)*i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function _r(t){var e=t,r=t;do e.x<r.x&&(r=e),e=e.next;while(e!==t);return r}function wr(t,e,r,n,i,a,o,s){return(i-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function Mr(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!Ar(t,e)&&Rr(t,e)&&Rr(e,t)&&Lr(t,e)}function Er(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Tr(t,e){return t.x===e.x&&t.y===e.y}function Sr(t,e,r,n){return!!(Tr(t,e)&&Tr(r,n)||Tr(t,n)&&Tr(r,e))||Er(t,e,r)>0!=Er(t,e,n)>0&&Er(r,n,t)>0!=Er(r,n,e)>0}function Ar(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Sr(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function Rr(t,e){return Er(t.prev,t,t.next)<0?Er(t,e,t.next)>=0&&Er(t,t.prev,e)>=0:Er(t,e,t.prev)<0||Er(t,t.next,e)<0}function Lr(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==t);return n}function Pr(t,e){var r=new Or(t.i,t.x,t.y),n=new Or(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function Cr(t,e,r,n){var i=new Or(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Ir(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Or(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Nr(t,e,r,n){for(var i=0,a=e,o=r-n;a<r;a+=n)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}function Ur(t,e){dt.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},this.fromBufferGeometry(new Dr(t,e)),this.mergeVertices()}function Dr(t,e){"undefined"!=typeof t&&(St.call(this),this.type="ExtrudeBufferGeometry",t=Array.isArray(t)?t:[t],this.addShapeList(t,e),this.computeVertexNormals())}function Br(t,e){dt.call(this),this.type="TextGeometry",this.parameters={text:t,parameters:e},this.fromBufferGeometry(new Fr(t,e)),this.mergeVertices()}function Fr(t,e){e=e||{};var r=e.font;if(!r||!r.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new dt;var n=r.generateShapes(t,e.size,e.curveSegments);e.amount=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),Dr.call(this,n,e),this.type="TextBufferGeometry"}function zr(t,e,r,n,i,a,o){dt.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:r,phiStart:n,phiLength:i,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new Gr(t,e,r,n,i,a,o)),this.mergeVertices()}function Gr(t,e,r,n,i,o,s){St.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:r,phiStart:n,phiLength:i,thetaStart:o,thetaLength:s},t=t||1,e=Math.max(3,Math.floor(e)||8),r=Math.max(2,Math.floor(r)||6),n=void 0!==n?n:0,i=void 0!==i?i:2*Math.PI,o=void 0!==o?o:0,s=void 0!==s?s:Math.PI;var c,h,l=o+s,u=0,p=[],d=new a,f=new a,m=[],v=[],g=[],y=[];for(h=0;h<=r;h++){var x=[],b=h/r;for(c=0;c<=e;c++){var _=c/e;d.x=-t*Math.cos(n+_*i)*Math.sin(o+b*s),d.y=t*Math.cos(o+b*s),d.z=t*Math.sin(n+_*i)*Math.sin(o+b*s),v.push(d.x,d.y,d.z),f.set(d.x,d.y,d.z).normalize(),g.push(f.x,f.y,f.z),y.push(_,1-b),x.push(u++)}p.push(x)}for(h=0;h<r;h++)for(c=0;c<e;c++){var w=p[h][c+1],M=p[h][c],E=p[h+1][c],T=p[h+1][c+1];(0!==h||o>0)&&m.push(w,M,T),(h!==r-1||l<Math.PI)&&m.push(M,E,T)}this.setIndex(m),this.addAttribute("position",new wt(v,3)),this.addAttribute("normal",new wt(g,3)),this.addAttribute("uv",new wt(y,2))}function Hr(t,e,r,n,i,a){dt.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:r,phiSegments:n,thetaStart:i,thetaLength:a},this.fromBufferGeometry(new Vr(t,e,r,n,i,a)),this.mergeVertices()}function Vr(t,e,n,i,o,s){St.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:i,thetaStart:o,thetaLength:s},t=t||.5,e=e||1,o=void 0!==o?o:0,s=void 0!==s?s:2*Math.PI,n=void 0!==n?Math.max(3,n):8,i=void 0!==i?Math.max(1,i):1;var c,h,l,u=[],p=[],d=[],f=[],m=t,v=(e-t)/i,g=new a,y=new r;for(h=0;h<=i;h++){for(l=0;l<=n;l++)c=o+l/n*s,g.x=m*Math.cos(c),g.y=m*Math.sin(c),p.push(g.x,g.y,g.z),d.push(0,0,1),y.x=(g.x/e+1)/2,y.y=(g.y/e+1)/2,f.push(y.x,y.y);m+=v}for(h=0;h<i;h++){var x=h*(n+1);for(l=0;l<n;l++){c=l+x;var b=c,_=c+n+1,w=c+n+2,M=c+1;u.push(b,_,M),u.push(_,w,M)}}this.setIndex(u),this.addAttribute("position",new wt(p,3)),this.addAttribute("normal",new wt(d,3)),this.addAttribute("uv",new wt(f,2))}function kr(t,e,r,n){dt.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:r,phiLength:n},this.fromBufferGeometry(new jr(t,e,r,n)),this.mergeVertices()}function jr(t,e,n,i){St.call(this),this.type="LatheBufferGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},e=Math.floor(e)||12,n=n||0,i=i||2*Math.PI,i=ac.clamp(i,0,2*Math.PI);var o,s,c,h=[],l=[],u=[],p=1/e,d=new a,f=new r;for(s=0;s<=e;s++){var m=n+s*p*i,v=Math.sin(m),g=Math.cos(m);for(c=0;c<=t.length-1;c++)d.x=t[c].x*v,d.y=t[c].y,d.z=t[c].x*g,l.push(d.x,d.y,d.z),f.x=s/e,f.y=c/(t.length-1),u.push(f.x,f.y)}for(s=0;s<e;s++)for(c=0;c<t.length-1;c++){o=c+s*t.length;var y=o,x=o+t.length,b=o+t.length+1,_=o+1;h.push(y,x,_),h.push(x,b,_)}if(this.setIndex(h),this.addAttribute("position",new wt(l,3)),this.addAttribute("uv",new wt(u,2)),this.computeVertexNormals(),i===2*Math.PI){var w=this.attributes.normal.array,M=new a,E=new a,T=new a;for(o=e*t.length*3,s=0,c=0;s<t.length;s++,c+=3)M.x=w[c+0],M.y=w[c+1],M.z=w[c+2],E.x=w[o+c+0],E.y=w[o+c+1],E.z=w[o+c+2],T.addVectors(M,E).normalize(),w[c+0]=w[o+c+0]=T.x,w[c+1]=w[o+c+1]=T.y,w[c+2]=w[o+c+2]=T.z}}function Wr(t,e){dt.call(this),this.type="ShapeGeometry","object"==typeof e&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),e=e.curveSegments),this.parameters={shapes:t,curveSegments:e},this.fromBufferGeometry(new Xr(t,e)),this.mergeVertices()}function Xr(t,e){function r(t){var r,s,h,l=i.length/3,u=t.extractPoints(e),p=u.shape,d=u.holes;if(Sl.isClockWise(p)===!1)for(p=p.reverse(),
  98. r=0,s=d.length;r<s;r++)h=d[r],Sl.isClockWise(h)===!0&&(d[r]=h.reverse());var f=Sl.triangulateShape(p,d);for(r=0,s=d.length;r<s;r++)h=d[r],p=p.concat(h);for(r=0,s=p.length;r<s;r++){var m=p[r];i.push(m.x,m.y,0),a.push(0,0,1),o.push(m.x,m.y)}for(r=0,s=f.length;r<s;r++){var v=f[r],g=v[0]+l,y=v[1]+l,x=v[2]+l;n.push(g,y,x),c+=3}}St.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:e},e=e||12;var n=[],i=[],a=[],o=[],s=0,c=0;if(Array.isArray(t)===!1)r(t);else for(var h=0;h<t.length;h++)r(t[h]),this.addGroup(s,c,h),s+=c,c=0;this.setIndex(n),this.addAttribute("position",new wt(i,3)),this.addAttribute("normal",new wt(a,3)),this.addAttribute("uv",new wt(o,2))}function qr(t,e){if(e.shapes=[],Array.isArray(t))for(var r=0,n=t.length;r<n;r++){var i=t[r];e.shapes.push(i.uuid)}else e.shapes.push(t.uuid);return e}function Yr(t,e){St.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1;var r,n,i,a,o=[],s=Math.cos(ac.DEG2RAD*e),c=[0,0],h={},l=["a","b","c"];t.isBufferGeometry?(a=new dt,a.fromBufferGeometry(t)):a=t.clone(),a.mergeVertices(),a.computeFaceNormals();for(var u=a.vertices,p=a.faces,d=0,f=p.length;d<f;d++)for(var m=p[d],v=0;v<3;v++)r=m[l[v]],n=m[l[(v+1)%3]],c[0]=Math.min(r,n),c[1]=Math.max(r,n),i=c[0]+","+c[1],void 0===h[i]?h[i]={index1:c[0],index2:c[1],face1:d,face2:void 0}:h[i].face2=d;for(i in h){var g=h[i];if(void 0===g.face2||p[g.face1].normal.dot(p[g.face2].normal)<=s){var y=u[g.index1];o.push(y.x,y.y,y.z),y=u[g.index2],o.push(y.x,y.y,y.z)}}this.addAttribute("position",new wt(o,3))}function Zr(t,e,r,n,i,a,o,s){dt.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:r,radialSegments:n,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new Jr(t,e,r,n,i,a,o,s)),this.mergeVertices()}function Jr(t,e,n,i,o,s,c,h){function l(){var r,s,l=new a,u=new a,_=0,w=(e-t)/n;for(s=0;s<=o;s++){var M=[],E=s/o,T=E*(e-t)+t;for(r=0;r<=i;r++){var S=r/i,A=S*h+c,R=Math.sin(A),L=Math.cos(A);u.x=T*R,u.y=-E*n+x,u.z=T*L,f.push(u.x,u.y,u.z),l.set(R,w,L).normalize(),m.push(l.x,l.y,l.z),v.push(S,1-E),M.push(g++)}y.push(M)}for(r=0;r<i;r++)for(s=0;s<o;s++){var P=y[s][r],C=y[s+1][r],I=y[s+1][r+1],O=y[s][r+1];d.push(P,C,O),d.push(C,I,O),_+=6}p.addGroup(b,_,0),b+=_}function u(n){var o,s,l,u=new r,y=new a,_=0,w=n===!0?t:e,M=n===!0?1:-1;for(s=g,o=1;o<=i;o++)f.push(0,x*M,0),m.push(0,M,0),v.push(.5,.5),g++;for(l=g,o=0;o<=i;o++){var E=o/i,T=E*h+c,S=Math.cos(T),A=Math.sin(T);y.x=w*A,y.y=x*M,y.z=w*S,f.push(y.x,y.y,y.z),m.push(0,M,0),u.x=.5*S+.5,u.y=.5*A*M+.5,v.push(u.x,u.y),g++}for(o=0;o<i;o++){var R=s+o,L=l+o;n===!0?d.push(L,L+1,R):d.push(L+1,L,R),_+=3}p.addGroup(b,_,n===!0?1:2),b+=_}St.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:i,heightSegments:o,openEnded:s,thetaStart:c,thetaLength:h};var p=this;t=void 0!==t?t:1,e=void 0!==e?e:1,n=n||1,i=Math.floor(i)||8,o=Math.floor(o)||1,s=void 0!==s&&s,c=void 0!==c?c:0,h=void 0!==h?h:2*Math.PI;var d=[],f=[],m=[],v=[],g=0,y=[],x=n/2,b=0;l(),s===!1&&(t>0&&u(!0),e>0&&u(!1)),this.setIndex(d),this.addAttribute("position",new wt(f,3)),this.addAttribute("normal",new wt(m,3)),this.addAttribute("uv",new wt(v,2))}function Qr(t,e,r,n,i,a,o){Zr.call(this,0,t,e,r,n,i,a,o),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:r,heightSegments:n,openEnded:i,thetaStart:a,thetaLength:o}}function Kr(t,e,r,n,i,a,o){Jr.call(this,0,t,e,r,n,i,a,o),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:r,heightSegments:n,openEnded:i,thetaStart:a,thetaLength:o}}function $r(t,e,r,n){dt.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:r,thetaLength:n},this.fromBufferGeometry(new tn(t,e,r,n)),this.mergeVertices()}function tn(t,e,n,i){St.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:i},t=t||1,e=void 0!==e?Math.max(3,e):8,n=void 0!==n?n:0,i=void 0!==i?i:2*Math.PI;var o,s,c=[],h=[],l=[],u=[],p=new a,d=new r;for(h.push(0,0,0),l.push(0,0,1),u.push(.5,.5),s=0,o=3;s<=e;s++,o+=3){var f=n+s/e*i;p.x=t*Math.cos(f),p.y=t*Math.sin(f),h.push(p.x,p.y,p.z),l.push(0,0,1),d.x=(h[o]/t+1)/2,d.y=(h[o+1]/t+1)/2,u.push(d.x,d.y)}for(o=1;o<=e;o++)c.push(o,o+1,0);this.setIndex(c),this.addAttribute("position",new wt(h,3)),this.addAttribute("normal",new wt(l,3)),this.addAttribute("uv",new wt(u,2))}function en(t){K.call(this),this.type="ShadowMaterial",this.color=new q(0),this.opacity=1,this.lights=!0,this.transparent=!0,this.setValues(t)}function rn(t){It.call(this,t),this.type="RawShaderMaterial"}function nn(t){K.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new q(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new q(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new r(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function an(t){nn.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(t)}function on(t){K.call(this),this.type="MeshPhongMaterial",this.color=new q(16777215),this.specular=new q(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new q(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new r(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Bo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function sn(t){on.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(t)}function cn(t){K.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new r(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function hn(t){K.call(this),this.type="MeshLambertMaterial",this.color=new q(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new q(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Bo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function ln(t){Ie.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}function un(t,e,r){var n=this,i=!1,a=0,o=0,s=void 0;this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=r,this.itemStart=function(t){o++,i===!1&&void 0!==n.onStart&&n.onStart(t,a,o),i=!0},this.itemEnd=function(t){a++,void 0!==n.onProgress&&n.onProgress(t,a,o),a===o&&(i=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(t){void 0!==n.onError&&n.onError(t)},this.resolveURL=function(t){return s?s(t):t},this.setURLModifier=function(t){return s=t,this}}function pn(t){this.manager=void 0!==t?t:Pl}function dn(t){this.manager=void 0!==t?t:Pl,this._parser=null}function fn(t){this.manager=void 0!==t?t:Pl,this._parser=null}function mn(t){this.manager=void 0!==t?t:Pl}function vn(t){this.manager=void 0!==t?t:Pl}function gn(t){this.manager=void 0!==t?t:Pl}function yn(){this.type="Curve",this.arcLengthDivisions=200}function xn(t,e,r,n,i,a,o,s){yn.call(this),this.type="EllipseCurve",this.aX=t||0,this.aY=e||0,this.xRadius=r||1,this.yRadius=n||1,this.aStartAngle=i||0,this.aEndAngle=a||2*Math.PI,this.aClockwise=o||!1,this.aRotation=s||0}function bn(t,e,r,n,i,a){xn.call(this,t,e,r,r,n,i,a),this.type="ArcCurve"}function _n(){function t(t,a,o,s){e=t,r=o,n=-3*t+3*a-2*o-s,i=2*t-2*a+o+s}var e=0,r=0,n=0,i=0;return{initCatmullRom:function(e,r,n,i,a){t(r,n,a*(n-e),a*(i-r))},initNonuniformCatmullRom:function(e,r,n,i,a,o,s){var c=(r-e)/a-(n-e)/(a+o)+(n-r)/o,h=(n-r)/o-(i-r)/(o+s)+(i-n)/s;c*=o,h*=o,t(r,n,c,h)},calc:function(t){var a=t*t,o=a*t;return e+r*t+n*a+i*o}}}function wn(t,e,r,n){yn.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=e||!1,this.curveType=r||"centripetal",this.tension=n||.5}function Mn(t,e,r,n,i){var a=.5*(n-e),o=.5*(i-r),s=t*t,c=t*s;return(2*r-2*n+a+o)*c+(-3*r+3*n-2*a-o)*s+a*t+r}function En(t,e){var r=1-t;return r*r*e}function Tn(t,e){return 2*(1-t)*t*e}function Sn(t,e){return t*t*e}function An(t,e,r,n){return En(t,e)+Tn(t,r)+Sn(t,n)}function Rn(t,e){var r=1-t;return r*r*r*e}function Ln(t,e){var r=1-t;return 3*r*r*t*e}function Pn(t,e){return 3*(1-t)*t*t*e}function Cn(t,e){return t*t*t*e}function In(t,e,r,n,i){return Rn(t,e)+Ln(t,r)+Pn(t,n)+Cn(t,i)}function On(t,e,n,i){yn.call(this),this.type="CubicBezierCurve",this.v0=t||new r,this.v1=e||new r,this.v2=n||new r,this.v3=i||new r}function Nn(t,e,r,n){yn.call(this),this.type="CubicBezierCurve3",this.v0=t||new a,this.v1=e||new a,this.v2=r||new a,this.v3=n||new a}function Un(t,e){yn.call(this),this.type="LineCurve",this.v1=t||new r,this.v2=e||new r}function Dn(t,e){yn.call(this),this.type="LineCurve3",this.v1=t||new a,this.v2=e||new a}function Bn(t,e,n){yn.call(this),this.type="QuadraticBezierCurve",this.v0=t||new r,this.v1=e||new r,this.v2=n||new r}function Fn(t,e,r){yn.call(this),this.type="QuadraticBezierCurve3",this.v0=t||new a,this.v1=e||new a,this.v2=r||new a}function zn(t){yn.call(this),this.type="SplineCurve",this.points=t||[]}function Gn(){yn.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Hn(t){Gn.call(this),this.type="Path",this.currentPoint=new r,t&&this.setFromPoints(t)}function Vn(t){Hn.call(this,t),this.uuid=ac.generateUUID(),this.type="Shape",this.holes=[]}function kn(t,e){ht.call(this),this.type="Light",this.color=new q(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0}function jn(t,e,r){kn.call(this,t,r),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(ht.DefaultUp),this.updateMatrix(),this.groundColor=new q(e)}function Wn(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new r(512,512),this.map=null,this.matrix=new n}function Xn(){Wn.call(this,new me(50,1,.5,500))}function qn(t,e,r,n,i,a){kn.call(this,t,e),this.type="SpotLight",this.position.copy(ht.DefaultUp),this.updateMatrix(),this.target=new ht,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==r?r:0,this.angle=void 0!==n?n:Math.PI/3,this.penumbra=void 0!==i?i:0,this.decay=void 0!==a?a:1,this.shadow=new Xn}function Yn(t,e,r,n){kn.call(this,t,e),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==r?r:0,this.decay=void 0!==n?n:1,this.shadow=new Wn(new me(90,1,.5,500))}function Zn(){Wn.call(this,new ut(-5,5,5,-5,.5,500))}function Jn(t,e){kn.call(this,t,e),this.type="DirectionalLight",this.position.copy(ht.DefaultUp),this.updateMatrix(),this.target=new ht,this.shadow=new Zn}function Qn(t,e){kn.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function Kn(t,e,r,n){kn.call(this,t,e),this.type="RectAreaLight",this.position.set(0,1,0),this.updateMatrix(),this.width=void 0!==r?r:10,this.height=void 0!==n?n:10}function $n(t,e,r,n){hi.call(this,t,e,r,n)}function ti(t,e,r){hi.call(this,t,e,r)}function ei(t,e,r,n){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new e.constructor(r),this.sampleValues=e,this.valueSize=r}function ri(t,e,r,n){ei.call(this,t,e,r,n)}function ni(t,e,r,n){hi.call(this,t,e,r,n)}function ii(t,e,r,n){hi.call(this,t,e,r,n)}function ai(t,e,r,n){hi.call(this,t,e,r,n)}function oi(t,e,r,n){ei.call(this,t,e,r,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function si(t,e,r,n){ei.call(this,t,e,r,n)}function ci(t,e,r,n){ei.call(this,t,e,r,n)}function hi(t,e,r,n){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Bl.convertArray(e,this.TimeBufferType),this.values=Bl.convertArray(r,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation),this.validate(),this.optimize()}function li(t,e,r,n){hi.call(this,t,e,r,n)}function ui(t,e,r){this.name=t,this.tracks=r,this.duration=void 0!==e?e:-1,this.uuid=ac.generateUUID(),this.duration<0&&this.resetDuration(),this.optimize()}function pi(t){this.manager=void 0!==t?t:Pl,this.textures={}}function di(t){this.manager=void 0!==t?t:Pl}function fi(){this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}}function mi(t){"boolean"==typeof t&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),t=void 0),this.manager=void 0!==t?t:Pl,this.withCredentials=!1}function vi(t){this.manager=void 0!==t?t:Pl,this.texturePath=""}function gi(t){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.manager=void 0!==t?t:Pl,this.options=void 0}function yi(){this.type="ShapePath",this.subPaths=[],this.currentPath=null}function xi(t){this.type="Font",this.data=t}function bi(t){this.manager=void 0!==t?t:Pl}function _i(t){this.manager=void 0!==t?t:Pl}function wi(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new me,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new me,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}function Mi(t,e,r){ht.call(this),this.type="CubeCamera";var n=90,i=1,o=new me(n,i,t,e);o.up.set(0,-1,0),o.lookAt(new a(1,0,0)),this.add(o);var s=new me(n,i,t,e);s.up.set(0,-1,0),s.lookAt(new a(-1,0,0)),this.add(s);var c=new me(n,i,t,e);c.up.set(0,0,1),c.lookAt(new a(0,1,0)),this.add(c);var h=new me(n,i,t,e);h.up.set(0,0,-1),h.lookAt(new a(0,-1,0)),this.add(h);var u=new me(n,i,t,e);u.up.set(0,-1,0),u.lookAt(new a(0,0,1)),this.add(u);var p=new me(n,i,t,e);p.up.set(0,-1,0),p.lookAt(new a(0,0,-1)),this.add(p);var d={format:_s,magFilter:as,minFilter:as};this.renderTarget=new l(r,r,d),this.renderTarget.texture.name="CubeCamera",this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();var r=this.renderTarget,n=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,r.activeCubeFace=0,t.render(e,o,r),r.activeCubeFace=1,t.render(e,s,r),r.activeCubeFace=2,t.render(e,c,r),r.activeCubeFace=3,t.render(e,h,r),r.activeCubeFace=4,t.render(e,u,r),r.texture.generateMipmaps=n,r.activeCubeFace=5,t.render(e,p,r),t.setRenderTarget(null)},this.clear=function(t,e,r,n){for(var i=this.renderTarget,a=0;a<6;a++)i.activeCubeFace=a,t.setRenderTarget(i),t.clear(e,r,n);t.setRenderTarget(null)}}function Ei(){ht.call(this),this.type="AudioListener",this.context=jl.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null}function Ti(t){ht.call(this),this.type="Audio",this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.loop=!1,this.startTime=0,this.offset=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function Si(t){Ti.call(this,t),this.panner=this.context.createPanner(),this.panner.connect(this.gain)}function Ai(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}function Ri(t,e,r){this.binding=t,this.valueSize=r;var n,i=Float64Array;switch(e){case"quaternion":n=this._slerp;break;case"string":case"bool":i=Array,n=this._select;break;default:n=this._lerp}this.buffer=new i(4*r),this._mixBufferRegion=n,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}function Li(t,e,r){var n=r||Pi.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,n)}function Pi(t,e,r){this.path=e,this.parsedPath=r||Pi.parseTrackName(e),this.node=Pi.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function Ci(){this.uuid=ac.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var e=0,r=arguments.length;e!==r;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var n=this;this.stats={objects:{get total(){return n._objects.length},get inUse(){return this.total-n.nCachedObjects_}},get bindingsPerObject(){return n._bindings.length}}}function Ii(t,e,r){this._mixer=t,this._clip=e,this._localRoot=r||null;for(var n=e.tracks,i=n.length,a=new Array(i),o={endingStart:ks,endingEnd:ks},s=0;s!==i;++s){var c=n[s].createInterpolant(null);a[s]=c,c.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(i),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Fs,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function Oi(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Ni(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function Ui(){St.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function Di(t,e,r,n){this.uuid=ac.generateUUID(),this.data=t,this.itemSize=e,this.offset=r,this.normalized=n===!0}function Bi(t,e){this.uuid=ac.generateUUID(),this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function Fi(t,e,r){Bi.call(this,t,e),this.meshPerAttribute=r||1}function zi(t,e,r){ft.call(this,t,e),this.meshPerAttribute=r||1}function Gi(t,e,r,n){this.ray=new Ot(t,e),this.near=r||0,this.far=n||1/0,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function Hi(t,e){return t.distance-e.distance}function Vi(t,e,r,n){if(t.visible!==!1&&(t.raycast(e,r),n===!0))for(var i=t.children,a=0,o=i.length;a<o;a++)Vi(i[a],e,r,!0)}function ki(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}function ji(t,e,r){return this.radius=void 0!==t?t:1,this.phi=void 0!==e?e:0,this.theta=void 0!==r?r:0,this}function Wi(t,e,r){return this.radius=void 0!==t?t:1,this.theta=void 0!==e?e:0,this.y=void 0!==r?r:0,this}function Xi(t){ht.call(this),this.material=t,this.render=function(){}}function qi(t,e,r,n){this.object=t,this.size=void 0!==e?e:1;var i=void 0!==r?r:16711680,a=void 0!==n?n:1,o=0,s=this.object.geometry;s&&s.isGeometry?o=3*s.faces.length:s&&s.isBufferGeometry&&(o=s.attributes.normal.count);var c=new St,h=new wt(2*o*3,3);c.addAttribute("position",h),Ne.call(this,c,new Ie({color:i,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}function Yi(t,e){ht.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;for(var r=new St,n=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],i=0,a=1,o=32;i<o;i++,a++){var s=i/o*Math.PI*2,c=a/o*Math.PI*2;n.push(Math.cos(s),Math.sin(s),1,Math.cos(c),Math.sin(c),1)}r.addAttribute("position",new wt(n,3));var h=new Ie({fog:!1});this.cone=new Ne(r,h),this.add(this.cone),this.update()}function Zi(t){var e=[];t&&t.isBone&&e.push(t);for(var r=0;r<t.children.length;r++)e.push.apply(e,Zi(t.children[r]));return e}function Ji(t){for(var e=Zi(t),r=new St,n=[],i=[],a=new q(0,0,1),o=new q(0,1,0),s=0;s<e.length;s++){var c=e[s];c.parent&&c.parent.isBone&&(n.push(0,0,0),n.push(0,0,0),i.push(a.r,a.g,a.b),i.push(o.r,o.g,o.b))}r.addAttribute("position",new wt(n,3)),r.addAttribute("color",new wt(i,3));var h=new Ie({vertexColors:ao,depthTest:!1,depthWrite:!1,transparent:!0});Ne.call(this,r,h),this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}function Qi(t,e,r){this.light=t,this.light.updateMatrixWorld(),this.color=r;var n=new Gr(e,4,2),i=new Ct({wireframe:!0,fog:!1});Dt.call(this,n,i),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function Ki(t,e){ht.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;var r=new Ie({fog:!1}),n=new St;n.addAttribute("position",new ft(new Float32Array(15),3)),this.line=new Oe(n,r),this.add(this.line),this.update()}function $i(t,e,r){ht.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=r;var n=new Je(e);n.rotateY(.5*Math.PI),this.material=new Ct({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=ao);var i=n.getAttribute("position"),a=new Float32Array(3*i.count);n.addAttribute("color",new ft(a,3)),this.add(new Dt(n,this.material)),this.update()}function ta(t,e,r,n){t=t||10,e=e||10,r=new q(void 0!==r?r:4473924),n=new q(void 0!==n?n:8947848);for(var i=e/2,a=t/e,o=t/2,s=[],c=[],h=0,l=0,u=-o;h<=e;h++,u+=a){s.push(-o,0,u,o,0,u),s.push(u,0,-o,u,0,o);var p=h===i?r:n;p.toArray(c,l),l+=3,p.toArray(c,l),l+=3,p.toArray(c,l),l+=3,p.toArray(c,l),l+=3}var d=new St;d.addAttribute("position",new wt(s,3)),d.addAttribute("color",new wt(c,3));var f=new Ie({vertexColors:ao});Ne.call(this,d,f)}function ea(t,e,r,n,i,a){t=t||10,e=e||16,r=r||8,n=n||64,i=new q(void 0!==i?i:4473924),a=new q(void 0!==a?a:8947848);var o,s,c,h,l,u,p,d=[],f=[];for(h=0;h<=e;h++)c=h/e*(2*Math.PI),o=Math.sin(c)*t,s=Math.cos(c)*t,d.push(0,0,0),d.push(o,0,s),p=1&h?i:a,f.push(p.r,p.g,p.b),f.push(p.r,p.g,p.b);for(h=0;h<=r;h++)for(p=1&h?i:a,u=t-t/r*h,l=0;l<n;l++)c=l/n*(2*Math.PI),o=Math.sin(c)*u,s=Math.cos(c)*u,d.push(o,0,s),f.push(p.r,p.g,p.b),c=(l+1)/n*(2*Math.PI),o=Math.sin(c)*u,s=Math.cos(c)*u,d.push(o,0,s),f.push(p.r,p.g,p.b);var m=new St;m.addAttribute("position",new wt(d,3)),m.addAttribute("color",new wt(f,3));var v=new Ie({vertexColors:ao});Ne.call(this,m,v)}function ra(t,e,r,n){this.object=t,this.size=void 0!==e?e:1;var i=void 0!==r?r:16776960,a=void 0!==n?n:1,o=0,s=this.object.geometry;s&&s.isGeometry?o=s.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");var c=new St,h=new wt(2*o*3,3);c.addAttribute("position",h),Ne.call(this,c,new Ie({color:i,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}function na(t,e,r){ht.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=r,void 0===e&&(e=1);var n=new St;n.addAttribute("position",new wt([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));var i=new Ie({fog:!1});this.lightPlane=new Oe(n,i),this.add(this.lightPlane),n=new St,n.addAttribute("position",new wt([0,0,0,0,0,1],3)),this.targetLine=new Oe(n,i),this.add(this.targetLine),this.update()}function ia(t){function e(t,e,n){r(t,n),r(e,n)}function r(t,e){a.push(0,0,0),o.push(e.r,e.g,e.b),void 0===s[t]&&(s[t]=[]),s[t].push(a.length/3-1)}var n=new St,i=new Ie({color:16777215,vertexColors:io}),a=[],o=[],s={},c=new q(16755200),h=new q(16711680),l=new q(43775),u=new q(16777215),p=new q(3355443);e("n1","n2",c),e("n2","n4",c),e("n4","n3",c),e("n3","n1",c),e("f1","f2",c),e("f2","f4",c),e("f4","f3",c),e("f3","f1",c),e("n1","f1",c),e("n2","f2",c),e("n3","f3",c),e("n4","f4",c),e("p","n1",h),e("p","n2",h),e("p","n3",h),e("p","n4",h),e("u1","u2",l),e("u2","u3",l),e("u3","u1",l),e("c","t",u),e("p","c",p),e("cn1","cn2",p),e("cn3","cn4",p),e("cf1","cf2",p),e("cf3","cf4",p),n.addAttribute("position",new wt(a,3)),n.addAttribute("color",new wt(o,3)),Ne.call(this,n,i),this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update()}function aa(t,e){this.object=t,void 0===e&&(e=16776960);var r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new Float32Array(24),i=new St;i.setIndex(new ft(r,1)),i.addAttribute("position",new ft(n,3)),Ne.call(this,i,new Ie({color:e})),this.matrixAutoUpdate=!1,this.update()}function oa(t,e){this.type="Box3Helper",this.box=t;var r=void 0!==e?e:16776960,n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],a=new St;a.setIndex(new ft(n,1)),a.addAttribute("position",new wt(i,3)),Ne.call(this,a,new Ie({color:r})),this.geometry.computeBoundingSphere()}function sa(t,e,r){this.type="PlaneHelper",this.plane=t,this.size=void 0===e?1:e;var n=void 0!==r?r:16776960,i=[1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],a=new St;a.addAttribute("position",new wt(i,3)),a.computeBoundingSphere(),Oe.call(this,a,new Ie({color:n}));var o=[1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],s=new St;s.addAttribute("position",new wt(o,3)),s.computeBoundingSphere(),this.add(new Dt(s,new Ct({color:n,opacity:.2,transparent:!0,depthWrite:!1})))}function ca(t,e,r,n,i,a){ht.call(this),void 0===n&&(n=16776960),void 0===r&&(r=1),void 0===i&&(i=.2*r),void 0===a&&(a=.2*i),void 0===Wl&&(Wl=new St,Wl.addAttribute("position",new wt([0,0,0,0,1,0],3)),Xl=new Jr(0,.5,1,5,1),Xl.translate(0,-.5,0)),this.position.copy(e),this.line=new Oe(Wl,new Ie({color:n})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Dt(Xl,new Ct({color:n})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(r,i,a)}function ha(t){t=t||1;var e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],r=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],n=new St;n.addAttribute("position",new wt(e,3)),n.addAttribute("color",new wt(r,3));var i=new Ie({vertexColors:ao});Ne.call(this,n,i)}function la(t,e,r,n,i,a,o){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new pt(t,e,r,i,a,o)}function ua(t){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),t}function pa(t){return void 0===t&&(t=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),t.isMultiMaterial=!0,t.materials=t,t.clone=function(){return t.slice()},t}function da(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new Be(t,e)}function fa(t){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new Ae(t)}function ma(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new Be(t,e)}function va(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new De(t)}function ga(t){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new De(t)}function ya(t){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new De(t)}function xa(t,e,r){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new a(t,e,r)}function ba(t,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new ft(t,e).setDynamic(!0)}function _a(t,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new mt(t,e)}function wa(t,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new vt(t,e)}function Ma(t,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new gt(t,e)}function Ea(t,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new yt(t,e)}function Ta(t,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new xt(t,e)}function Sa(t,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new bt(t,e)}function Aa(t,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new _t(t,e)}function Ra(t,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new wt(t,e)}function La(t,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Mt(t,e)}function Pa(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),wn.call(this,t),this.type="catmullrom",this.closed=!0}function Ca(t){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),wn.call(this,t),this.type="catmullrom"}function Ia(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),wn.call(this,t),this.type="catmullrom"}function Oa(t){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new ha(t)}function Na(t,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new aa(t,e)}function Ua(t,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new Ne(new Yr(t.geometry),new Ie({color:void 0!==e?e:16777215}))}function Da(t,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new Ne(new Ve(t.geometry),new Ie({color:void 0!==e?e:16777215}))}function Ba(t){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new pn(t)}function Fa(t){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new fn(t)}function za(){console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(t,e){console.warn("THREE.Projector: .projectVector() is now vector.project()."),t.project(e)},this.unprojectVector=function(t,e){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),t.unproject(e)},this.pickingRay=function(){console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}}function Ga(){console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),this.domElement=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),this.clear=function(){},this.render=function(){},this.setClearColor=function(){},this.setSize=function(){}}void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){
  99. return t<0?-1:t>0?1:+t}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&!function(){Object.assign=function(t){if(void 0===t||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),r=1;r<arguments.length;r++){var n=arguments[r];if(void 0!==n&&null!==n)for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}}(),Object.assign(e.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var r=this._listeners;void 0===r[t]&&(r[t]=[]),r[t].indexOf(e)===-1&&r[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var r=this._listeners;return void 0!==r[t]&&r[t].indexOf(e)!==-1},removeEventListener:function(t,e){if(void 0!==this._listeners){var r=this._listeners,n=r[t];if(void 0!==n){var i=n.indexOf(e);i!==-1&&n.splice(i,1)}}},dispatchEvent:function(t){if(void 0!==this._listeners){var e=this._listeners,r=e[t.type];if(void 0!==r){t.target=this;for(var n=r.slice(0),i=0,a=n.length;i<a;i++)n[i].call(this,t)}}}});var Ha="89",Va={LEFT:0,MIDDLE:1,RIGHT:2},ka=0,ja=1,Wa=2,Xa=3,qa=0,Ya=1,Za=0,Ja=1,Qa=2,Ka=0,$a=1,to=2,eo=1,ro=2,no=0,io=1,ao=2,oo=0,so=1,co=2,ho=3,lo=4,uo=5,po=100,fo=101,mo=102,vo=103,go=104,yo=200,xo=201,bo=202,_o=203,wo=204,Mo=205,Eo=206,To=207,So=208,Ao=209,Ro=210,Lo=0,Po=1,Co=2,Io=3,Oo=4,No=5,Uo=6,Do=7,Bo=0,Fo=1,zo=2,Go=0,Ho=1,Vo=2,ko=3,jo=4,Wo=300,Xo=301,qo=302,Yo=303,Zo=304,Jo=305,Qo=306,Ko=307,$o=1e3,ts=1001,es=1002,rs=1003,ns=1004,is=1005,as=1006,os=1007,ss=1008,cs=1009,hs=1010,ls=1011,us=1012,ps=1013,ds=1014,fs=1015,ms=1016,vs=1017,gs=1018,ys=1019,xs=1020,bs=1021,_s=1022,ws=1023,Ms=1024,Es=1025,Ts=ws,Ss=1026,As=1027,Rs=2001,Ls=2002,Ps=2003,Cs=2004,Is=2100,Os=2101,Ns=2102,Us=2103,Ds=2151,Bs=2200,Fs=2201,zs=2202,Gs=2300,Hs=2301,Vs=2302,ks=2400,js=2401,Ws=2402,Xs=0,qs=1,Ys=2,Zs=3e3,Js=3001,Qs=3007,Ks=3002,$s=3003,tc=3004,ec=3005,rc=3006,nc=3200,ic=3201,ac={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){for(var t=[],e=0;e<256;e++)t[e]=(e<16?"0":"")+e.toString(16).toUpperCase();return function(){var e=4294967295*Math.random()|0,r=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return t[255&e]+t[e>>8&255]+t[e>>16&255]+t[e>>24&255]+"-"+t[255&r]+t[r>>8&255]+"-"+t[r>>16&15|64]+t[r>>24&255]+"-"+t[63&n|128]+t[n>>8&255]+"-"+t[n>>16&255]+t[n>>24&255]+t[255&i]+t[i>>8&255]+t[i>>16&255]+t[i>>24&255]}}(),clamp:function(t,e,r){return Math.max(e,Math.min(r,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,r,n,i){return n+(t-e)*(i-n)/(r-e)},lerp:function(t,e,r){return(1-r)*t+r*e},smoothstep:function(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e),t*t*(3-2*t))},smootherstep:function(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e),t*t*t*(t*(6*t-15)+10))},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*ac.DEG2RAD},radToDeg:function(t){return t*ac.RAD2DEG},isPowerOfTwo:function(t){return 0===(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}};Object.defineProperties(r.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(r.prototype,{isVector2:!0,set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},applyMatrix3:function(t){var e=this.x,r=this.y,n=t.elements;return this.x=n[0]*e+n[3]*r+n[6],this.y=n[1]*e+n[4]*r+n[7],this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(){var t=new r,e=new r;return function(r,n){return t.set(r,r),e.set(n,n),this.clamp(t,e)}}(),clampLength:function(t,e){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(e,r)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,r=this.y-t.y;return e*e+r*r},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,r){return this.subVectors(e,t).multiplyScalar(r).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e,r){return void 0!==r&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){var r=Math.cos(e),n=Math.sin(e),i=this.x-t.x,a=this.y-t.y;return this.x=i*r-a*n+t.x,this.y=i*n+a*r+t.y,this}}),Object.assign(n.prototype,{isMatrix4:!0,set:function(t,e,r,n,i,a,o,s,c,h,l,u,p,d,f,m){var v=this.elements;return v[0]=t,v[4]=e,v[8]=r,v[12]=n,v[1]=i,v[5]=a,v[9]=o,v[13]=s,v[2]=c,v[6]=h,v[10]=l,v[14]=u,v[3]=p,v[7]=d,v[11]=f,v[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new n).fromArray(this.elements)},copy:function(t){var e=this.elements,r=t.elements;return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],this},copyPosition:function(t){var e=this.elements,r=t.elements;return e[12]=r[12],e[13]=r[13],e[14]=r[14],this},extractBasis:function(t,e,r){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,r){return this.set(t.x,e.x,r.x,0,t.y,e.y,r.y,0,t.z,e.z,r.z,0,0,0,0,1),this},extractRotation:function(){var t=new a;return function(e){var r=this.elements,n=e.elements,i=1/t.setFromMatrixColumn(e,0).length(),a=1/t.setFromMatrixColumn(e,1).length(),o=1/t.setFromMatrixColumn(e,2).length();return r[0]=n[0]*i,r[1]=n[1]*i,r[2]=n[2]*i,r[4]=n[4]*a,r[5]=n[5]*a,r[6]=n[6]*a,r[8]=n[8]*o,r[9]=n[9]*o,r[10]=n[10]*o,this}}(),makeRotationFromEuler:function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,r=t.x,n=t.y,i=t.z,a=Math.cos(r),o=Math.sin(r),s=Math.cos(n),c=Math.sin(n),h=Math.cos(i),l=Math.sin(i);if("XYZ"===t.order){var u=a*h,p=a*l,d=o*h,f=o*l;e[0]=s*h,e[4]=-s*l,e[8]=c,e[1]=p+d*c,e[5]=u-f*c,e[9]=-o*s,e[2]=f-u*c,e[6]=d+p*c,e[10]=a*s}else if("YXZ"===t.order){var m=s*h,v=s*l,g=c*h,y=c*l;e[0]=m+y*o,e[4]=g*o-v,e[8]=a*c,e[1]=a*l,e[5]=a*h,e[9]=-o,e[2]=v*o-g,e[6]=y+m*o,e[10]=a*s}else if("ZXY"===t.order){var m=s*h,v=s*l,g=c*h,y=c*l;e[0]=m-y*o,e[4]=-a*l,e[8]=g+v*o,e[1]=v+g*o,e[5]=a*h,e[9]=y-m*o,e[2]=-a*c,e[6]=o,e[10]=a*s}else if("ZYX"===t.order){var u=a*h,p=a*l,d=o*h,f=o*l;e[0]=s*h,e[4]=d*c-p,e[8]=u*c+f,e[1]=s*l,e[5]=f*c+u,e[9]=p*c-d,e[2]=-c,e[6]=o*s,e[10]=a*s}else if("YZX"===t.order){var x=a*s,b=a*c,_=o*s,w=o*c;e[0]=s*h,e[4]=w-x*l,e[8]=_*l+b,e[1]=l,e[5]=a*h,e[9]=-o*h,e[2]=-c*h,e[6]=b*l+_,e[10]=x-w*l}else if("XZY"===t.order){var x=a*s,b=a*c,_=o*s,w=o*c;e[0]=s*h,e[4]=-l,e[8]=c*h,e[1]=x*l+w,e[5]=a*h,e[9]=b*l-_,e[2]=_*l-b,e[6]=o*h,e[10]=w*l+x}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(t){var e=this.elements,r=t._x,n=t._y,i=t._z,a=t._w,o=r+r,s=n+n,c=i+i,h=r*o,l=r*s,u=r*c,p=n*s,d=n*c,f=i*c,m=a*o,v=a*s,g=a*c;return e[0]=1-(p+f),e[4]=l-g,e[8]=u+v,e[1]=l+g,e[5]=1-(h+f),e[9]=d-m,e[2]=u-v,e[6]=d+m,e[10]=1-(h+p),e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},lookAt:function(){var t=new a,e=new a,r=new a;return function(n,i,a){var o=this.elements;return r.subVectors(n,i),0===r.lengthSq()&&(r.z=1),r.normalize(),t.crossVectors(a,r),0===t.lengthSq()&&(1===Math.abs(a.z)?r.x+=1e-4:r.z+=1e-4,r.normalize(),t.crossVectors(a,r)),t.normalize(),e.crossVectors(r,t),o[0]=t.x,o[4]=e.x,o[8]=r.x,o[1]=t.y,o[5]=e.y,o[9]=r.y,o[2]=t.z,o[6]=e.z,o[10]=r.z,this}}(),multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var r=t.elements,n=e.elements,i=this.elements,a=r[0],o=r[4],s=r[8],c=r[12],h=r[1],l=r[5],u=r[9],p=r[13],d=r[2],f=r[6],m=r[10],v=r[14],g=r[3],y=r[7],x=r[11],b=r[15],_=n[0],w=n[4],M=n[8],E=n[12],T=n[1],S=n[5],A=n[9],R=n[13],L=n[2],P=n[6],C=n[10],I=n[14],O=n[3],N=n[7],U=n[11],D=n[15];return i[0]=a*_+o*T+s*L+c*O,i[4]=a*w+o*S+s*P+c*N,i[8]=a*M+o*A+s*C+c*U,i[12]=a*E+o*R+s*I+c*D,i[1]=h*_+l*T+u*L+p*O,i[5]=h*w+l*S+u*P+p*N,i[9]=h*M+l*A+u*C+p*U,i[13]=h*E+l*R+u*I+p*D,i[2]=d*_+f*T+m*L+v*O,i[6]=d*w+f*S+m*P+v*N,i[10]=d*M+f*A+m*C+v*U,i[14]=d*E+f*R+m*I+v*D,i[3]=g*_+y*T+x*L+b*O,i[7]=g*w+y*S+x*P+b*N,i[11]=g*M+y*A+x*C+b*U,i[15]=g*E+y*R+x*I+b*D,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},applyToBufferAttribute:function(){var t=new a;return function(e){for(var r=0,n=e.count;r<n;r++)t.x=e.getX(r),t.y=e.getY(r),t.z=e.getZ(r),t.applyMatrix4(this),e.setXYZ(r,t.x,t.y,t.z);return e}}(),determinant:function(){var t=this.elements,e=t[0],r=t[4],n=t[8],i=t[12],a=t[1],o=t[5],s=t[9],c=t[13],h=t[2],l=t[6],u=t[10],p=t[14],d=t[3],f=t[7],m=t[11],v=t[15];return d*(+i*s*l-n*c*l-i*o*u+r*c*u+n*o*p-r*s*p)+f*(+e*s*p-e*c*u+i*a*u-n*a*p+n*c*h-i*s*h)+m*(+e*c*l-e*o*p-i*a*l+r*a*p+i*o*h-r*c*h)+v*(-n*o*h-e*s*l+e*o*u+n*a*l-r*a*u+r*s*h)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},setPosition:function(t){var e=this.elements;return e[12]=t.x,e[13]=t.y,e[14]=t.z,this},getInverse:function(t,e){var r=this.elements,n=t.elements,i=n[0],a=n[1],o=n[2],s=n[3],c=n[4],h=n[5],l=n[6],u=n[7],p=n[8],d=n[9],f=n[10],m=n[11],v=n[12],g=n[13],y=n[14],x=n[15],b=d*y*u-g*f*u+g*l*m-h*y*m-d*l*x+h*f*x,_=v*f*u-p*y*u-v*l*m+c*y*m+p*l*x-c*f*x,w=p*g*u-v*d*u+v*h*m-c*g*m-p*h*x+c*d*x,M=v*d*l-p*g*l-v*h*f+c*g*f+p*h*y-c*d*y,E=i*b+a*_+o*w+s*M;if(0===E){var T="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(e===!0)throw new Error(T);return console.warn(T),this.identity()}var S=1/E;return r[0]=b*S,r[1]=(g*f*s-d*y*s-g*o*m+a*y*m+d*o*x-a*f*x)*S,r[2]=(h*y*s-g*l*s+g*o*u-a*y*u-h*o*x+a*l*x)*S,r[3]=(d*l*s-h*f*s-d*o*u+a*f*u+h*o*m-a*l*m)*S,r[4]=_*S,r[5]=(p*y*s-v*f*s+v*o*m-i*y*m-p*o*x+i*f*x)*S,r[6]=(v*l*s-c*y*s-v*o*u+i*y*u+c*o*x-i*l*x)*S,r[7]=(c*f*s-p*l*s+p*o*u-i*f*u-c*o*m+i*l*m)*S,r[8]=w*S,r[9]=(v*d*s-p*g*s-v*a*m+i*g*m+p*a*x-i*d*x)*S,r[10]=(c*g*s-v*h*s+v*a*u-i*g*u-c*a*x+i*h*x)*S,r[11]=(p*h*s-c*d*s-p*a*u+i*d*u+c*a*m-i*h*m)*S,r[12]=M*S,r[13]=(p*g*o-v*d*o+v*a*f-i*g*f-p*a*y+i*d*y)*S,r[14]=(v*h*o-c*g*o-v*a*l+i*g*l+c*a*y-i*h*y)*S,r[15]=(c*d*o-p*h*o+p*a*l-i*d*l-c*a*f+i*h*f)*S,this},scale:function(t){var e=this.elements,r=t.x,n=t.y,i=t.z;return e[0]*=r,e[4]*=n,e[8]*=i,e[1]*=r,e[5]*=n,e[9]*=i,e[2]*=r,e[6]*=n,e[10]*=i,e[3]*=r,e[7]*=n,e[11]*=i,this},getMaxScaleOnAxis:function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],r=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,r,n))},makeTranslation:function(t,e,r){return this.set(1,0,0,t,0,1,0,e,0,0,1,r,0,0,0,1),this},makeRotationX:function(t){var e=Math.cos(t),r=Math.sin(t);return this.set(1,0,0,0,0,e,-r,0,0,r,e,0,0,0,0,1),this},makeRotationY:function(t){var e=Math.cos(t),r=Math.sin(t);return this.set(e,0,r,0,0,1,0,0,-r,0,e,0,0,0,0,1),this},makeRotationZ:function(t){var e=Math.cos(t),r=Math.sin(t);return this.set(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){var r=Math.cos(e),n=Math.sin(e),i=1-r,a=t.x,o=t.y,s=t.z,c=i*a,h=i*o;return this.set(c*a+r,c*o-n*s,c*s+n*o,0,c*o+n*s,h*o+r,h*s-n*a,0,c*s-n*o,h*s+n*a,i*s*s+r,0,0,0,0,1),this},makeScale:function(t,e,r){return this.set(t,0,0,0,0,e,0,0,0,0,r,0,0,0,0,1),this},makeShear:function(t,e,r){return this.set(1,e,r,0,t,1,r,0,t,e,1,0,0,0,0,1),this},compose:function(t,e,r){return this.makeRotationFromQuaternion(e),this.scale(r),this.setPosition(t),this},decompose:function(){var t=new a,e=new n;return function(r,n,i){var a=this.elements,o=t.set(a[0],a[1],a[2]).length(),s=t.set(a[4],a[5],a[6]).length(),c=t.set(a[8],a[9],a[10]).length(),h=this.determinant();h<0&&(o=-o),r.x=a[12],r.y=a[13],r.z=a[14],e.copy(this);var l=1/o,u=1/s,p=1/c;return e.elements[0]*=l,e.elements[1]*=l,e.elements[2]*=l,e.elements[4]*=u,e.elements[5]*=u,e.elements[6]*=u,e.elements[8]*=p,e.elements[9]*=p,e.elements[10]*=p,n.setFromRotationMatrix(e),i.x=o,i.y=s,i.z=c,this}}(),makePerspective:function(t,e,r,n,i,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*i/(e-t),c=2*i/(r-n),h=(e+t)/(e-t),l=(r+n)/(r-n),u=-(a+i)/(a-i),p=-2*a*i/(a-i);return o[0]=s,o[4]=0,o[8]=h,o[12]=0,o[1]=0,o[5]=c,o[9]=l,o[13]=0,o[2]=0,o[6]=0,o[10]=u,o[14]=p,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(t,e,r,n,i,a){var o=this.elements,s=1/(e-t),c=1/(r-n),h=1/(a-i),l=(e+t)*s,u=(r+n)*c,p=(a+i)*h;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-l,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-u,o[2]=0,o[6]=0,o[10]=-2*h,o[14]=-p,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(t){for(var e=this.elements,r=t.elements,n=0;n<16;n++)if(e[n]!==r[n])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var r=0;r<16;r++)this.elements[r]=t[r+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var r=this.elements;return t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=r[3],t[e+4]=r[4],t[e+5]=r[5],t[e+6]=r[6],t[e+7]=r[7],t[e+8]=r[8],t[e+9]=r[9],t[e+10]=r[10],t[e+11]=r[11],t[e+12]=r[12],t[e+13]=r[13],t[e+14]=r[14],t[e+15]=r[15],t}}),Object.assign(i,{slerp:function(t,e,r,n){return r.copy(t).slerp(e,n)},slerpFlat:function(t,e,r,n,i,a,o){var s=r[n+0],c=r[n+1],h=r[n+2],l=r[n+3],u=i[a+0],p=i[a+1],d=i[a+2],f=i[a+3];if(l!==f||s!==u||c!==p||h!==d){var m=1-o,v=s*u+c*p+h*d+l*f,g=v>=0?1:-1,y=1-v*v;if(y>Number.EPSILON){var x=Math.sqrt(y),b=Math.atan2(x,v*g);m=Math.sin(m*b)/x,o=Math.sin(o*b)/x}var _=o*g;if(s=s*m+u*_,c=c*m+p*_,h=h*m+d*_,l=l*m+f*_,m===1-o){var w=1/Math.sqrt(s*s+c*c+h*h+l*l);s*=w,c*=w,h*=w,l*=w}}t[e]=s,t[e+1]=c,t[e+2]=h,t[e+3]=l}}),Object.defineProperties(i.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback()}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback()}}}),Object.assign(i.prototype,{set:function(t,e,r,n){return this._x=t,this._y=e,this._z=r,this._w=n,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this.onChangeCallback(),this},setFromEuler:function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var r=t._x,n=t._y,i=t._z,a=t.order,o=Math.cos,s=Math.sin,c=o(r/2),h=o(n/2),l=o(i/2),u=s(r/2),p=s(n/2),d=s(i/2);return"XYZ"===a?(this._x=u*h*l+c*p*d,this._y=c*p*l-u*h*d,this._z=c*h*d+u*p*l,this._w=c*h*l-u*p*d):"YXZ"===a?(this._x=u*h*l+c*p*d,this._y=c*p*l-u*h*d,this._z=c*h*d-u*p*l,this._w=c*h*l+u*p*d):"ZXY"===a?(this._x=u*h*l-c*p*d,this._y=c*p*l+u*h*d,this._z=c*h*d+u*p*l,this._w=c*h*l-u*p*d):"ZYX"===a?(this._x=u*h*l-c*p*d,this._y=c*p*l+u*h*d,this._z=c*h*d-u*p*l,this._w=c*h*l+u*p*d):"YZX"===a?(this._x=u*h*l+c*p*d,this._y=c*p*l+u*h*d,this._z=c*h*d-u*p*l,this._w=c*h*l-u*p*d):"XZY"===a&&(this._x=u*h*l-c*p*d,this._y=c*p*l-u*h*d,this._z=c*h*d+u*p*l,this._w=c*h*l+u*p*d),e!==!1&&this.onChangeCallback(),this},setFromAxisAngle:function(t,e){var r=e/2,n=Math.sin(r);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(r),this.onChangeCallback(),this},setFromRotationMatrix:function(t){var e,r=t.elements,n=r[0],i=r[4],a=r[8],o=r[1],s=r[5],c=r[9],h=r[2],l=r[6],u=r[10],p=n+s+u;return p>0?(e=.5/Math.sqrt(p+1),this._w=.25/e,this._x=(l-c)*e,this._y=(a-h)*e,this._z=(o-i)*e):n>s&&n>u?(e=2*Math.sqrt(1+n-s-u),this._w=(l-c)/e,this._x=.25*e,this._y=(i+o)/e,this._z=(a+h)/e):s>u?(e=2*Math.sqrt(1+s-n-u),this._w=(a-h)/e,this._x=(i+o)/e,this._y=.25*e,this._z=(c+l)/e):(e=2*Math.sqrt(1+u-n-s),this._w=(o-i)/e,this._x=(a+h)/e,this._y=(c+l)/e,this._z=.25*e),this.onChangeCallback(),this},setFromUnitVectors:function(){var t,e=new a,r=1e-6;return function(n,i){return void 0===e&&(e=new a),t=n.dot(i)+1,t<r?(t=0,Math.abs(n.x)>Math.abs(n.z)?e.set(-n.y,n.x,0):e.set(0,-n.z,n.y)):e.crossVectors(n,i),this._x=e.x,this._y=e.y,this._z=e.z,this._w=t,this.normalize()}}(),inverse:function(){return this.conjugate().normalize()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this.onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var r=t._x,n=t._y,i=t._z,a=t._w,o=e._x,s=e._y,c=e._z,h=e._w;return this._x=r*h+a*o+n*c-i*s,this._y=n*h+a*s+i*o-r*c,this._z=i*h+a*c+r*s-n*o,this._w=a*h-r*o-n*s-i*c,this.onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var r=this._x,n=this._y,i=this._z,a=this._w,o=a*t._w+r*t._x+n*t._y+i*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=r,this._y=n,this._z=i,this;var s=Math.sqrt(1-o*o);if(Math.abs(s)<.001)return this._w=.5*(a+this._w),this._x=.5*(r+this._x),this._y=.5*(n+this._y),this._z=.5*(i+this._z),this;var c=Math.atan2(s,o),h=Math.sin((1-e)*c)/s,l=Math.sin(e*c)/s;return this._w=a*h+this._w*l,this._x=r*h+this._x*l,this._y=n*h+this._y*l,this._z=i*h+this._z*l,this.onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),Object.assign(a.prototype,{isVector3:!0,set:function(t,e,r){return this.x=t,this.y=e,this.z=r,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:function(){var t=new i;return function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(t.setFromEuler(e))}}(),applyAxisAngle:function(){var t=new i;return function(e,r){return this.applyQuaternion(t.setFromAxisAngle(e,r))}}(),applyMatrix3:function(t){var e=this.x,r=this.y,n=this.z,i=t.elements;return this.x=i[0]*e+i[3]*r+i[6]*n,this.y=i[1]*e+i[4]*r+i[7]*n,this.z=i[2]*e+i[5]*r+i[8]*n,this},applyMatrix4:function(t){var e=this.x,r=this.y,n=this.z,i=t.elements,a=1/(i[3]*e+i[7]*r+i[11]*n+i[15]);return this.x=(i[0]*e+i[4]*r+i[8]*n+i[12])*a,this.y=(i[1]*e+i[5]*r+i[9]*n+i[13])*a,this.z=(i[2]*e+i[6]*r+i[10]*n+i[14])*a,this},applyQuaternion:function(t){var e=this.x,r=this.y,n=this.z,i=t.x,a=t.y,o=t.z,s=t.w,c=s*e+a*n-o*r,h=s*r+o*e-i*n,l=s*n+i*r-a*e,u=-i*e-a*r-o*n;return this.x=c*s+u*-i+h*-o-l*-a,this.y=h*s+u*-a+l*-i-c*-o,this.z=l*s+u*-o+c*-a-h*-i,this},project:function(){var t=new n;return function(e){return t.multiplyMatrices(e.projectionMatrix,t.getInverse(e.matrixWorld)),this.applyMatrix4(t)}}(),unproject:function(){var t=new n;return function(e){return t.multiplyMatrices(e.matrixWorld,t.getInverse(e.projectionMatrix)),this.applyMatrix4(t)}}(),transformDirection:function(t){var e=this.x,r=this.y,n=this.z,i=t.elements;return this.x=i[0]*e+i[4]*r+i[8]*n,this.y=i[1]*e+i[5]*r+i[9]*n,this.z=i[2]*e+i[6]*r+i[10]*n,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(){var t=new a,e=new a;return function(r,n){return t.set(r,r,r),e.set(n,n,n),this.clamp(t,e)}}(),clampLength:function(t,e){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(e,r)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,r){return this.subVectors(e,t).multiplyScalar(r).add(t)},cross:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)},crossVectors:function(t,e){var r=t.x,n=t.y,i=t.z,a=e.x,o=e.y,s=e.z;return this.x=n*s-i*o,this.y=i*a-r*s,this.z=r*o-n*a,this},projectOnVector:function(t){var e=t.dot(this)/t.lengthSq();return this.copy(t).multiplyScalar(e)},projectOnPlane:function(){var t=new a;return function(e){return t.copy(this).projectOnVector(e),this.sub(t)}}(),reflect:function(){var t=new a;return function(e){return this.sub(t.copy(e).multiplyScalar(2*this.dot(e)))}}(),angleTo:function(t){var e=this.dot(t)/Math.sqrt(this.lengthSq()*t.lengthSq());return Math.acos(ac.clamp(e,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,r=this.y-t.y,n=this.z-t.z;return e*e+r*r+n*n},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){var e=Math.sin(t.phi)*t.radius;return this.x=e*Math.sin(t.theta),this.y=Math.cos(t.phi)*t.radius,this.z=e*Math.cos(t.theta),this},setFromCylindrical:function(t){return this.x=t.radius*Math.sin(t.theta),this.y=t.y,this.z=t.radius*Math.cos(t.theta),this},setFromMatrixPosition:function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),r=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=r,this.z=n,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.elements,4*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e,r){return void 0!==r&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}}),Object.assign(o.prototype,{isMatrix3:!0,set:function(t,e,r,n,i,a,o,s,c){var h=this.elements;return h[0]=t,h[1]=n,h[2]=o,h[3]=e,h[4]=i,h[5]=s,h[6]=r,h[7]=a,h[8]=c,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){var e=this.elements,r=t.elements;return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],this},setFromMatrix4:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},applyToBufferAttribute:function(){var t=new a;return function(e){for(var r=0,n=e.count;r<n;r++)t.x=e.getX(r),t.y=e.getY(r),t.z=e.getZ(r),t.applyMatrix3(this),e.setXYZ(r,t.x,t.y,t.z);return e}}(),multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var r=t.elements,n=e.elements,i=this.elements,a=r[0],o=r[3],s=r[6],c=r[1],h=r[4],l=r[7],u=r[2],p=r[5],d=r[8],f=n[0],m=n[3],v=n[6],g=n[1],y=n[4],x=n[7],b=n[2],_=n[5],w=n[8];return i[0]=a*f+o*g+s*b,i[3]=a*m+o*y+s*_,i[6]=a*v+o*x+s*w,i[1]=c*f+h*g+l*b,i[4]=c*m+h*y+l*_,i[7]=c*v+h*x+l*w,i[2]=u*f+p*g+d*b,i[5]=u*m+p*y+d*_,i[8]=u*v+p*x+d*w,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t=this.elements,e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],h=t[8];return e*a*h-e*o*c-r*i*h+r*o*s+n*i*c-n*a*s},getInverse:function(t,e){t&&t.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var r=t.elements,n=this.elements,i=r[0],a=r[1],o=r[2],s=r[3],c=r[4],h=r[5],l=r[6],u=r[7],p=r[8],d=p*c-h*u,f=h*l-p*s,m=u*s-c*l,v=i*d+a*f+o*m;if(0===v){var g="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(e===!0)throw new Error(g);return console.warn(g),this.identity()}var y=1/v;return n[0]=d*y,n[1]=(o*u-p*a)*y,n[2]=(h*a-o*c)*y,n[3]=f*y,n[4]=(p*i-o*l)*y,n[5]=(o*s-h*i)*y,n[6]=m*y,n[7]=(a*l-u*i)*y,n[8]=(c*i-a*s)*y,this},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},setUvTransform:function(t,e,r,n,i,a,o){var s=Math.cos(i),c=Math.sin(i);this.set(r*s,r*c,-r*(s*a+c*o)+a+t,-n*c,n*s,-n*(-c*a+s*o)+o+e,0,0,1);
  100. },scale:function(t,e){var r=this.elements;return r[0]*=t,r[3]*=t,r[6]*=t,r[1]*=e,r[4]*=e,r[7]*=e,this},rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=this.elements,i=n[0],a=n[3],o=n[6],s=n[1],c=n[4],h=n[7];return n[0]=e*i+r*s,n[3]=e*a+r*c,n[6]=e*o+r*h,n[1]=-r*i+e*s,n[4]=-r*a+e*c,n[7]=-r*o+e*h,this},translate:function(t,e){var r=this.elements;return r[0]+=t*r[2],r[3]+=t*r[5],r[6]+=t*r[8],r[1]+=e*r[2],r[4]+=e*r[5],r[7]+=e*r[8],this},equals:function(t){for(var e=this.elements,r=t.elements,n=0;n<9;n++)if(e[n]!==r[n])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var r=0;r<9;r++)this.elements[r]=t[r+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var r=this.elements;return t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=r[3],t[e+4]=r[4],t[e+5]=r[5],t[e+6]=r[6],t[e+7]=r[7],t[e+8]=r[8],t}});var oc=0;s.DEFAULT_IMAGE=void 0,s.DEFAULT_MAPPING=Wo,s.prototype=Object.assign(Object.create(e.prototype),{constructor:s,isTexture:!0,clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){function e(t){var e;if(t instanceof HTMLCanvasElement)e=t;else{e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),e.width=t.width,e.height=t.height;var r=e.getContext("2d");t instanceof ImageData?r.putImageData(t,0,0):r.drawImage(t,0,0,t.width,t.height)}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}var r=void 0===t||"string"==typeof t;if(!r&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(void 0!==this.image){var i=this.image;void 0===i.uuid&&(i.uuid=ac.generateUUID()),r||void 0!==t.images[i.uuid]||(t.images[i.uuid]={uuid:i.uuid,url:e(i)}),n.image=i.uuid}return r||(t.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(this.mapping===Wo){if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case $o:t.x=t.x-Math.floor(t.x);break;case ts:t.x=t.x<0?0:1;break;case es:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case $o:t.y=t.y-Math.floor(t.y);break;case ts:t.y=t.y<0?0:1;break;case es:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}this.flipY&&(t.y=1-t.y)}}}),Object.defineProperty(s.prototype,"needsUpdate",{set:function(t){t===!0&&this.version++}}),Object.assign(c.prototype,{isVector4:!0,set:function(t,e,r,n){return this.x=t,this.y=e,this.z=r,this.w=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var e=this.x,r=this.y,n=this.z,i=this.w,a=t.elements;return this.x=a[0]*e+a[4]*r+a[8]*n+a[12]*i,this.y=a[1]*e+a[5]*r+a[9]*n+a[13]*i,this.z=a[2]*e+a[6]*r+a[10]*n+a[14]*i,this.w=a[3]*e+a[7]*r+a[11]*n+a[15]*i,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,r,n,i,a=.01,o=.1,s=t.elements,c=s[0],h=s[4],l=s[8],u=s[1],p=s[5],d=s[9],f=s[2],m=s[6],v=s[10];if(Math.abs(h-u)<a&&Math.abs(l-f)<a&&Math.abs(d-m)<a){if(Math.abs(h+u)<o&&Math.abs(l+f)<o&&Math.abs(d+m)<o&&Math.abs(c+p+v-3)<o)return this.set(1,0,0,0),this;e=Math.PI;var g=(c+1)/2,y=(p+1)/2,x=(v+1)/2,b=(h+u)/4,_=(l+f)/4,w=(d+m)/4;return g>y&&g>x?g<a?(r=0,n=.707106781,i=.707106781):(r=Math.sqrt(g),n=b/r,i=_/r):y>x?y<a?(r=.707106781,n=0,i=.707106781):(n=Math.sqrt(y),r=b/n,i=w/n):x<a?(r=.707106781,n=.707106781,i=0):(i=Math.sqrt(x),r=_/i,n=w/i),this.set(r,n,i,e),this}var M=Math.sqrt((m-d)*(m-d)+(l-f)*(l-f)+(u-h)*(u-h));return Math.abs(M)<.001&&(M=1),this.x=(m-d)/M,this.y=(l-f)/M,this.z=(u-h)/M,this.w=Math.acos((c+p+v-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(){var t,e;return function(r,n){return void 0===t&&(t=new c,e=new c),t.set(r,r,r,r),e.set(n,n,n,n),this.clamp(t,e)}}(),clampLength:function(t,e){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(e,r)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,r){return this.subVectors(e,t).multiplyScalar(r).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e,r){return void 0!==r&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}}),h.prototype=Object.assign(Object.create(e.prototype),{constructor:h,isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),l.prototype=Object.create(h.prototype),l.prototype.constructor=l,l.prototype.isWebGLRenderTargetCube=!0,u.prototype=Object.create(s.prototype),u.prototype.constructor=u,u.prototype.isDataTexture=!0,p.prototype=Object.create(s.prototype),p.prototype.constructor=p,p.prototype.isCubeTexture=!0,Object.defineProperty(p.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}});var sc=new s,cc=new p,hc=[],lc=[],uc=new Float32Array(16),pc=new Float32Array(9);k.prototype.setValue=function(t,e){for(var r=this.seq,n=0,i=r.length;n!==i;++n){var a=r[n];a.setValue(t,e[a.id])}};var dc=/([\w\d_]+)(\])?(\[|\.)?/g;X.prototype.setValue=function(t,e,r){var n=this.map[e];void 0!==n&&n.setValue(t,r,this.renderer)},X.prototype.setOptional=function(t,e,r){var n=e[r];void 0!==n&&this.setValue(t,r,n)},X.upload=function(t,e,r,n){for(var i=0,a=e.length;i!==a;++i){var o=e[i],s=r[o.id];s.needsUpdate!==!1&&o.setValue(t,s.value,n)}},X.seqWithValue=function(t,e){for(var r=[],n=0,i=t.length;n!==i;++n){var a=t[n];a.id in e&&r.push(a)}return r};var fc={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Object.assign(q.prototype,{isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,r){return this.r=t,this.g=e,this.b=r,this},setHSL:function(){function t(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+6*(e-t)*(2/3-r):t}return function(e,r,n){if(e=ac.euclideanModulo(e,1),r=ac.clamp(r,0,1),n=ac.clamp(n,0,1),0===r)this.r=this.g=this.b=n;else{var i=n<=.5?n*(1+r):n+r-n*r,a=2*n-i;this.r=t(a,i,e+1/3),this.g=t(a,i,e),this.b=t(a,i,e-1/3)}return this}}(),setStyle:function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var r;if(r=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var n,i=r[1],a=r[2];switch(i){case"rgb":case"rgba":if(n=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,e(n[5]),this;if(n=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,e(n[5]),this;break;case"hsl":case"hsla":if(n=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(n[1])/360,s=parseInt(n[2],10)/100,c=parseInt(n[3],10)/100;return e(n[5]),this.setHSL(o,s,c)}}}else if(r=/^\#([A-Fa-f0-9]+)$/.exec(t)){var h=r[1],l=h.length;if(3===l)return this.r=parseInt(h.charAt(0)+h.charAt(0),16)/255,this.g=parseInt(h.charAt(1)+h.charAt(1),16)/255,this.b=parseInt(h.charAt(2)+h.charAt(2),16)/255,this;if(6===l)return this.r=parseInt(h.charAt(0)+h.charAt(1),16)/255,this.g=parseInt(h.charAt(2)+h.charAt(3),16)/255,this.b=parseInt(h.charAt(4)+h.charAt(5),16)/255,this}if(t&&t.length>0){var h=fc[t];void 0!==h?this.setHex(h):console.warn("THREE.Color: Unknown color "+t)}return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var r=e>0?1/e:1;return this.r=Math.pow(t.r,r),this.g=Math.pow(t.g,r),this.b=Math.pow(t.b,r),this},convertGammaToLinear:function(){var t=this.r,e=this.g,r=this.b;return this.r=t*t,this.g=e*e,this.b=r*r,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){var e,r,n=t||{h:0,s:0,l:0},i=this.r,a=this.g,o=this.b,s=Math.max(i,a,o),c=Math.min(i,a,o),h=(c+s)/2;if(c===s)e=0,r=0;else{var l=s-c;switch(r=h<=.5?l/(s+c):l/(2-s-c),s){case i:e=(a-o)/l+(a<o?6:0);break;case a:e=(o-i)/l+2;break;case o:e=(i-a)/l+4}e/=6}return n.h=e,n.s=r,n.l=h,n},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(t,e,r){var n=this.getHSL();return n.h+=t,n.s+=e,n.l+=r,this.setHSL(n.h,n.s,n.l),this},add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},sub:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t},toJSON:function(){return this.getHex()}});var mc={common:{diffuse:{value:new q(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new o},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new r(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new q(16777215)}},lights:{ambientLightColor:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new q(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new o}}},vc={merge:function(t){for(var e={},r=0;r<t.length;r++){var n=this.clone(t[r]);for(var i in n)e[i]=n[i]}return e},clone:function(t){var e={};for(var r in t){e[r]={};for(var n in t[r]){var i=t[r][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture)?e[r][n]=i.clone():Array.isArray(i)?e[r][n]=i.slice():e[r][n]=i}}return e}},gc="#ifdef USE_ALPHAMAP\r\n\r\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\r\n\r\n#endif\r\n",yc="#ifdef USE_ALPHAMAP\r\n\r\n\tuniform sampler2D alphaMap;\r\n\r\n#endif\r\n",xc="#ifdef ALPHATEST\r\n\r\n\tif ( diffuseColor.a < ALPHATEST ) discard;\r\n\r\n#endif\r\n",bc="#ifdef USE_AOMAP\r\n\r\n\t// reads channel R, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\r\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\r\n\r\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\r\n\r\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\r\n\r\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\r\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\r\n\r\n\t#endif\r\n\r\n#endif\r\n",_c="#ifdef USE_AOMAP\r\n\r\n\tuniform sampler2D aoMap;\r\n\tuniform float aoMapIntensity;\r\n\r\n#endif",wc="\r\nvec3 transformed = vec3( position );\r\n",Mc="\r\nvec3 objectNormal = vec3( normal );\r\n",Ec='float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\r\n\r\n\tif( decayExponent > 0.0 ) {\r\n\r\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\r\n\r\n\t\t// based upon Frostbite 3 Moving to Physically-based Rendering\r\n\t\t// page 32, equation 26: E[window1]\r\n\t\t// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\r\n\t\t// this is intended to be used on spot and point lights who are represented as luminous intensity\r\n\t\t// but who must be converted to luminous irradiance for surface lighting calculation\r\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\r\n\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\r\n\t\treturn distanceFalloff * maxDistanceCutoffFactor;\r\n\r\n#else\r\n\r\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\r\n\r\n#endif\r\n\r\n\t}\r\n\r\n\treturn 1.0;\r\n\r\n}\r\n\r\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\r\n\r\n\treturn RECIPROCAL_PI * diffuseColor;\r\n\r\n} // validated\r\n\r\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\r\n\r\n\t// Original approximation by Christophe Schlick \'94\r\n\t// float fresnel = pow( 1.0 - dotLH, 5.0 );\r\n\r\n\t// Optimized variant (presented by Epic at SIGGRAPH \'13)\r\n\t// https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf\r\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\r\n\r\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\r\n\r\n} // validated\r\n\r\n// Microfacet Models for Refraction through Rough Surfaces - equation (34)\r\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\r\n// alpha is "roughness squared" in Disney’s reparameterization\r\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\r\n\r\n\t// geometry term (normalized) = G(l)⋅G(v) / 4(n⋅l)(n⋅v)\r\n\t// also see #12151\r\n\r\n\tfloat a2 = pow2( alpha );\r\n\r\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\r\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\r\n\r\n\treturn 1.0 / ( gl * gv );\r\n\r\n} // validated\r\n\r\n// Moving Frostbite to Physically Based Rendering 3.0 - page 12, listing 2\r\n// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\r\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\r\n\r\n\tfloat a2 = pow2( alpha );\r\n\r\n\t// dotNL and dotNV are explicitly swapped. This is not a mistake.\r\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\r\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\r\n\r\n\treturn 0.5 / max( gv + gl, EPSILON );\r\n\r\n}\r\n\r\n// Microfacet Models for Refraction through Rough Surfaces - equation (33)\r\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\r\n// alpha is "roughness squared" in Disney’s reparameterization\r\nfloat D_GGX( const in float alpha, const in float dotNH ) {\r\n\r\n\tfloat a2 = pow2( alpha );\r\n\r\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; // avoid alpha = 0 with dotNH = 1\r\n\r\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\r\n\r\n}\r\n\r\n// GGX Distribution, Schlick Fresnel, GGX-Smith Visibility\r\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\r\n\r\n\tfloat alpha = pow2( roughness ); // UE4\'s roughness\r\n\r\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\r\n\r\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\r\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\r\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\r\n\r\n\tvec3 F = F_Schlick( specularColor, dotLH );\r\n\r\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\r\n\r\n\tfloat D = D_GGX( alpha, dotNH );\r\n\r\n\treturn F * ( G * D );\r\n\r\n} // validated\r\n\r\n// Rect Area Light\r\n\r\n// Area light computation code adapted from:\r\n// Real-Time Polygonal-Light Shading with Linearly Transformed Cosines\r\n// By: Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt\r\n// https://drive.google.com/file/d/0BzvWIdpUpRx_d09ndGVjNVJzZjA/view\r\n// https://eheitzresearch.wordpress.com/415-2/\r\n// http://blog.selfshadow.com/sandbox/ltc.html\r\n\r\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\r\n\r\n\tconst float LUT_SIZE = 64.0;\r\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\r\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\r\n\r\n\tfloat theta = acos( dot( N, V ) );\r\n\r\n\t// Parameterization of texture:\r\n\t// sqrt(roughness) -> [0,1]\r\n\t// theta -> [0, PI/2]\r\n\tvec2 uv = vec2(\r\n\t\tsqrt( saturate( roughness ) ),\r\n\t\tsaturate( theta / ( 0.5 * PI ) ) );\r\n\r\n\t// Ensure we don\'t have nonlinearities at the look-up table\'s edges\r\n\t// see: http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter24.html\r\n\t// "Shader Analysis" section\r\n\tuv = uv * LUT_SCALE + LUT_BIAS;\r\n\r\n\treturn uv;\r\n\r\n}\r\n\r\n// Real-Time Area Lighting: a Journey from Research to Production\r\n// By: Stephen Hill & Eric Heitz\r\n// http://advances.realtimerendering.com/s2016/s2016_ltc_rnd.pdf\r\n// An approximation for the form factor of a clipped rectangle.\r\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\r\n\r\n\tfloat l = length( f );\r\n\r\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\r\n\r\n}\r\n\r\n// Real-Time Polygonal-Light Shading with Linearly Transformed Cosines\r\n// also Real-Time Area Lighting: a Journey from Research to Production\r\n// http://advances.realtimerendering.com/s2016/s2016_ltc_rnd.pdf\r\n// Normalization by 2*PI is incorporated in this function itself.\r\n// theta/sin(theta) is approximated by rational polynomial\r\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\r\n\r\n\tfloat x = dot( v1, v2 );\r\n\r\n\tfloat y = abs( x );\r\n\tfloat a = 0.86267 + (0.49788 + 0.01436 * y ) * y;\r\n\tfloat b = 3.45068 + (4.18814 + y) * y;\r\n\tfloat v = a / b;\r\n\r\n\tfloat theta_sintheta = (x > 0.0) ? v : 0.5 * inversesqrt( 1.0 - x * x ) - v;\r\n\r\n\treturn cross( v1, v2 ) * theta_sintheta;\r\n\r\n}\r\n\r\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\r\n\r\n\t// bail if point is on back side of plane of light\r\n\t// assumes ccw winding order of light vertices\r\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\r\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\r\n\tvec3 lightNormal = cross( v1, v2 );\r\n\r\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\r\n\r\n\t// construct orthonormal basis around N\r\n\tvec3 T1, T2;\r\n\tT1 = normalize( V - N * dot( V, N ) );\r\n\tT2 = - cross( N, T1 ); // negated from paper; possibly due to a different assumed handedness of world coordinate system\r\n\r\n\t// compute transform\r\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\r\n\r\n\t// transform rect\r\n\tvec3 coords[ 4 ];\r\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\r\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\r\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\r\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\r\n\r\n\t// project rect onto sphere\r\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\r\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\r\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\r\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\r\n\r\n\t// calculate vector form factor\r\n\tvec3 vectorFormFactor = vec3( 0.0 );\r\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\r\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\r\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\r\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\r\n\r\n\t// adjust for horizon clipping\r\n\tvec3 result = vec3( LTC_ClippedSphereFormFactor( vectorFormFactor ) );\r\n\r\n\treturn result;\r\n\r\n}\r\n\r\n// End Rect Area Light\r\n\r\n// ref: https://www.unrealengine.com/blog/physically-based-shading-on-mobile - environmentBRDF for GGX on mobile\r\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\r\n\r\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\r\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\r\n\r\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\r\n\r\n\tvec4 r = roughness * c0 + c1;\r\n\r\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\r\n\r\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\r\n\r\n\treturn specularColor * AB.x + AB.y;\r\n\r\n} // validated\r\n\r\n\r\nfloat G_BlinnPhong_Implicit( ) {\r\n\r\n\t// geometry term is (n dot l)(n dot v) / 4(n dot l)(n dot v)\r\n\treturn 0.25;\r\n\r\n}\r\n\r\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\r\n\r\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\r\n\r\n}\r\n\r\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\r\n\r\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\r\n\r\n\t//float dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\r\n\t//float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\r\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\r\n\r\n\tvec3 F = F_Schlick( specularColor, dotLH );\r\n\r\n\tfloat G = G_BlinnPhong_Implicit( );\r\n\r\n\tfloat D = D_BlinnPhong( shininess, dotNH );\r\n\r\n\treturn F * ( G * D );\r\n\r\n} // validated\r\n\r\n// source: http://simonstechblog.blogspot.ca/2011/12/microfacet-brdf.html\r\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\r\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\r\n}\r\n\r\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\r\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\r\n}\r\n',Tc="#ifdef USE_BUMPMAP\r\n\r\n\tuniform sampler2D bumpMap;\r\n\tuniform float bumpScale;\r\n\r\n\t// Derivative maps - bump mapping unparametrized surfaces by Morten Mikkelsen\r\n\t// http://mmikkelsen3d.blogspot.sk/2011/07/derivative-maps.html\r\n\r\n\t// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\r\n\r\n\tvec2 dHdxy_fwd() {\r\n\r\n\t\tvec2 dSTdx = dFdx( vUv );\r\n\t\tvec2 dSTdy = dFdy( vUv );\r\n\r\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\r\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\r\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\r\n\r\n\t\treturn vec2( dBx, dBy );\r\n\r\n\t}\r\n\r\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\r\n\r\n\t\t// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\r\n\r\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\r\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\r\n\t\tvec3 vN = surf_norm;\t\t// normalized\r\n\r\n\t\tvec3 R1 = cross( vSigmaY, vN );\r\n\t\tvec3 R2 = cross( vN, vSigmaX );\r\n\r\n\t\tfloat fDet = dot( vSigmaX, R1 );\r\n\r\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\r\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\r\n\r\n\t}\r\n\r\n#endif\r\n",Sc="#if NUM_CLIPPING_PLANES > 0\r\n\r\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; ++ i ) {\r\n\r\n\t\tvec4 plane = clippingPlanes[ i ];\r\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\r\n\r\n\t}\r\n\t\t\r\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\r\n\r\n\t\tbool clipped = true;\r\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; ++ i ) {\r\n\t\t\tvec4 plane = clippingPlanes[ i ];\r\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\r\n\t\t}\r\n\r\n\t\tif ( clipped ) discard;\r\n\t\r\n\t#endif\r\n\r\n#endif\r\n",Ac="#if NUM_CLIPPING_PLANES > 0\r\n\r\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\r\n\t\tvarying vec3 vViewPosition;\r\n\t#endif\r\n\r\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\r\n\r\n#endif\r\n",Rc="#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\r\n\tvarying vec3 vViewPosition;\r\n#endif\r\n",Lc="#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\r\n\tvViewPosition = - mvPosition.xyz;\r\n#endif\r\n\r\n",Pc="#ifdef USE_COLOR\r\n\r\n\tdiffuseColor.rgb *= vColor;\r\n\r\n#endif",Cc="#ifdef USE_COLOR\r\n\r\n\tvarying vec3 vColor;\r\n\r\n#endif\r\n",Ic="#ifdef USE_COLOR\r\n\r\n\tvarying vec3 vColor;\r\n\r\n#endif",Oc="#ifdef USE_COLOR\r\n\r\n\tvColor.xyz = color.xyz;\r\n\r\n#endif",Nc="#define PI 3.14159265359\r\n#define PI2 6.28318530718\r\n#define PI_HALF 1.5707963267949\r\n#define RECIPROCAL_PI 0.31830988618\r\n#define RECIPROCAL_PI2 0.15915494\r\n#define LOG2 1.442695\r\n#define EPSILON 1e-6\r\n\r\n#define saturate(a) clamp( a, 0.0, 1.0 )\r\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\r\n\r\nfloat pow2( const in float x ) { return x*x; }\r\nfloat pow3( const in float x ) { return x*x*x; }\r\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\r\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\r\n// expects values in the range of [0,1]x[0,1], returns values in the [0,1] range.\r\n// do not collapse into a single function per: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\r\nhighp float rand( const in vec2 uv ) {\r\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\r\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\r\n\treturn fract(sin(sn) * c);\r\n}\r\n\r\nstruct IncidentLight {\r\n\tvec3 color;\r\n\tvec3 direction;\r\n\tbool visible;\r\n};\r\n\r\nstruct ReflectedLight {\r\n\tvec3 directDiffuse;\r\n\tvec3 directSpecular;\r\n\tvec3 indirectDiffuse;\r\n\tvec3 indirectSpecular;\r\n};\r\n\r\nstruct GeometricContext {\r\n\tvec3 position;\r\n\tvec3 normal;\r\n\tvec3 viewDir;\r\n};\r\n\r\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\r\n\r\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\r\n\r\n}\r\n\r\n// http://en.wikibooks.org/wiki/GLSL_Programming/Applying_Matrix_Transformations\r\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\r\n\r\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\r\n\r\n}\r\n\r\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\r\n\r\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\r\n\r\n\treturn - distance * planeNormal + point;\r\n\r\n}\r\n\r\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\r\n\r\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\r\n\r\n}\r\n\r\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\r\n\r\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\r\n\r\n}\r\n\r\nmat3 transposeMat3( const in mat3 m ) {\r\n\r\n\tmat3 tmp;\r\n\r\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\r\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\r\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\r\n\r\n\treturn tmp;\r\n\r\n}\r\n\r\n// https://en.wikipedia.org/wiki/Relative_luminance\r\nfloat linearToRelativeLuminance( const in vec3 color ) {\r\n\r\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\r\n\r\n\treturn dot( weights, color.rgb );\r\n\r\n}\r\n",Uc="#ifdef ENVMAP_TYPE_CUBE_UV\r\n\r\n#define cubeUV_textureSize (1024.0)\r\n\r\nint getFaceFromDirection(vec3 direction) {\r\n\tvec3 absDirection = abs(direction);\r\n\tint face = -1;\r\n\tif( absDirection.x > absDirection.z ) {\r\n\t\tif(absDirection.x > absDirection.y )\r\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\r\n\t\telse\r\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\r\n\t}\r\n\telse {\r\n\t\tif(absDirection.z > absDirection.y )\r\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\r\n\t\telse\r\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\r\n\t}\r\n\treturn face;\r\n}\r\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\r\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\r\n\r\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\r\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\r\n\tfloat dxRoughness = dFdx(roughness);\r\n\tfloat dyRoughness = dFdy(roughness);\r\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\r\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\r\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\r\n\t// Clamp the value to the max mip level counts. hard coded to 6 mips\r\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\r\n\tfloat mipLevel = 0.5 * log2(d);\r\n\treturn vec2(floor(mipLevel), fract(mipLevel));\r\n}\r\n\r\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\r\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\r\n\r\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\r\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\r\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\r\n\r\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\r\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\r\n\t// float powScale = exp2(roughnessLevel + mipLevel);\r\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\r\n\t// float scale = 1.0 / exp2(roughnessLevel + 2.0 + mipLevel);\r\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\r\n\t// float mipOffset = 0.75*(1.0 - 1.0/exp2(mipLevel))/exp2(roughnessLevel);\r\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\r\n\r\n\tbool bRes = mipLevel == 0.0;\r\n\tscale = bRes && (scale < a) ? a : scale;\r\n\r\n\tvec3 r;\r\n\tvec2 offset;\r\n\tint face = getFaceFromDirection(direction);\r\n\r\n\tfloat rcpPowScale = 1.0 / powScale;\r\n\r\n\tif( face == 0) {\r\n\t\tr = vec3(direction.x, -direction.z, direction.y);\r\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\r\n\t}\r\n\telse if( face == 1) {\r\n\t\tr = vec3(direction.y, direction.x, direction.z);\r\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\r\n\t}\r\n\telse if( face == 2) {\r\n\t\tr = vec3(direction.z, direction.x, direction.y);\r\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\r\n\t}\r\n\telse if( face == 3) {\r\n\t\tr = vec3(direction.x, direction.z, direction.y);\r\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\r\n\t}\r\n\telse if( face == 4) {\r\n\t\tr = vec3(direction.y, direction.x, -direction.z);\r\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\r\n\t}\r\n\telse {\r\n\t\tr = vec3(direction.z, -direction.x, direction.y);\r\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\r\n\t}\r\n\tr = normalize(r);\r\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\r\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\r\n\tvec2 base = offset + vec2( texelOffset );\r\n\treturn base + s * ( scale - 2.0 * texelOffset );\r\n}\r\n\r\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\r\n\r\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\r\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\r\n\tfloat r1 = floor(roughnessVal);\r\n\tfloat r2 = r1 + 1.0;\r\n\tfloat t = fract(roughnessVal);\r\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\r\n\tfloat s = mipInfo.y;\r\n\tfloat level0 = mipInfo.x;\r\n\tfloat level1 = level0 + 1.0;\r\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\r\n\r\n\t// round to nearest mipmap if we are not interpolating.\r\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\r\n\r\n\t// Tri linear interpolation.\r\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\r\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\r\n\r\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\r\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\r\n\r\n\tvec4 result = mix(color10, color20, t);\r\n\r\n\treturn vec4(result.rgb, 1.0);\r\n}\r\n\r\n#endif\r\n",Dc="vec3 transformedNormal = normalMatrix * objectNormal;\r\n\r\n#ifdef FLIP_SIDED\r\n\r\n\ttransformedNormal = - transformedNormal;\r\n\r\n#endif\r\n",Bc="#ifdef USE_DISPLACEMENTMAP\r\n\r\n\tuniform sampler2D displacementMap;\r\n\tuniform float displacementScale;\r\n\tuniform float displacementBias;\r\n\r\n#endif\r\n",Fc="#ifdef USE_DISPLACEMENTMAP\r\n\r\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\r\n\r\n#endif\r\n",zc="#ifdef USE_EMISSIVEMAP\r\n\r\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\r\n\r\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\r\n\r\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\r\n\r\n#endif\r\n",Gc="#ifdef USE_EMISSIVEMAP\r\n\r\n\tuniform sampler2D emissiveMap;\r\n\r\n#endif\r\n",Hc=" gl_FragColor = linearToOutputTexel( gl_FragColor );\r\n",Vc="// For a discussion of what this is, please read this: http://lousodrome.net/blog/light/2013/05/26/gamma-correct-and-hdr-rendering-in-a-32-bits-buffer/\r\n\r\nvec4 LinearToLinear( in vec4 value ) {\r\n\treturn value;\r\n}\r\n\r\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\r\n\treturn vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\r\n}\r\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\r\n\treturn vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\r\n}\r\n\r\nvec4 sRGBToLinear( in vec4 value ) {\r\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\r\n}\r\nvec4 LinearTosRGB( in vec4 value ) {\r\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\r\n}\r\n\r\nvec4 RGBEToLinear( in vec4 value ) {\r\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\r\n}\r\nvec4 LinearToRGBE( in vec4 value ) {\r\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\r\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\r\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\r\n// return vec4( value.brg, ( 3.0 + 128.0 ) / 256.0 );\r\n}\r\n\r\n// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html\r\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\r\n\treturn vec4( value.xyz * value.w * maxRange, 1.0 );\r\n}\r\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\r\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\r\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\r\n\tM = ceil( M * 255.0 ) / 255.0;\r\n\treturn vec4( value.rgb / ( M * maxRange ), M );\r\n}\r\n\r\n// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html\r\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\r\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\r\n}\r\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\r\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\r\n\tfloat D = max( maxRange / maxRGB, 1.0 );\r\n\tD = min( floor( D ) / 255.0, 1.0 );\r\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\r\n}\r\n\r\n// LogLuv reference: http://graphicrants.blogspot.ca/2009/04/rgbm-color-encoding.html\r\n\r\n// M matrix, for encoding\r\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\r\nvec4 LinearToLogLuv( in vec4 value ) {\r\n\tvec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\r\n\tXp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\r\n\tvec4 vResult;\r\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\r\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\r\n\tvResult.w = fract(Le);\r\n\tvResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\r\n\treturn vResult;\r\n}\r\n\r\n// Inverse M matrix, for decoding\r\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\r\nvec4 LogLuvToLinear( in vec4 value ) {\r\n\tfloat Le = value.z * 255.0 + value.w;\r\n\tvec3 Xp_Y_XYZp;\r\n\tXp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\r\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\r\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\r\n\tvec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\r\n\treturn vec4( max(vRGB, 0.0), 1.0 );\r\n}\r\n",kc="#ifdef USE_ENVMAP\r\n\r\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\r\n\r\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\r\n\r\n\t\t// Transforming Normal Vectors with the Inverse Transformation\r\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\r\n\r\n\t\t#ifdef ENVMAP_MODE_REFLECTION\r\n\r\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\r\n\r\n\t\t#else\r\n\r\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\r\n\r\n\t\t#endif\r\n\r\n\t#else\r\n\r\n\t\tvec3 reflectVec = vReflect;\r\n\r\n\t#endif\r\n\r\n\t#ifdef ENVMAP_TYPE_CUBE\r\n\r\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\r\n\r\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\r\n\r\n\t\tvec2 sampleUV;\r\n\r\n\t\treflectVec = normalize( reflectVec );\r\n\r\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\r\n\r\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\r\n\r\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\r\n\r\n\t#elif defined( ENVMAP_TYPE_SPHERE )\r\n\r\n\t\treflectVec = normalize( reflectVec );\r\n\r\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\r\n\r\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\r\n\r\n\t#else\r\n\r\n\t\tvec4 envColor = vec4( 0.0 );\r\n\r\n\t#endif\r\n\r\n\tenvColor = envMapTexelToLinear( envColor );\r\n\r\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\r\n\r\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\r\n\r\n\t#elif defined( ENVMAP_BLENDING_MIX )\r\n\r\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\r\n\r\n\t#elif defined( ENVMAP_BLENDING_ADD )\r\n\r\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",jc="#if defined( USE_ENVMAP ) || defined( PHYSICAL )\r\n\tuniform float reflectivity;\r\n\tuniform float envMapIntensity;\r\n#endif\r\n\r\n#ifdef USE_ENVMAP\r\n\r\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\r\n\t\tvarying vec3 vWorldPosition;\r\n\t#endif\r\n\r\n\t#ifdef ENVMAP_TYPE_CUBE\r\n\t\tuniform samplerCube envMap;\r\n\t#else\r\n\t\tuniform sampler2D envMap;\r\n\t#endif\r\n\tuniform float flipEnvMap;\r\n\r\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\r\n\t\tuniform float refractionRatio;\r\n\t#else\r\n\t\tvarying vec3 vReflect;\r\n\t#endif\r\n\r\n#endif\r\n",Wc="#ifdef USE_ENVMAP\r\n\r\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\r\n\t\tvarying vec3 vWorldPosition;\r\n\r\n\t#else\r\n\r\n\t\tvarying vec3 vReflect;\r\n\t\tuniform float refractionRatio;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",Xc="#ifdef USE_ENVMAP\r\n\r\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\r\n\r\n\t\tvWorldPosition = worldPosition.xyz;\r\n\r\n\t#else\r\n\r\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\r\n\r\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\r\n\r\n\t\t#ifdef ENVMAP_MODE_REFLECTION\r\n\r\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\r\n\r\n\t\t#else\r\n\r\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\r\n\r\n\t\t#endif\r\n\r\n\t#endif\r\n\r\n#endif\r\n",qc="\r\n#ifdef USE_FOG\r\nfogDepth = -mvPosition.z;\r\n#endif",Yc="#ifdef USE_FOG\r\n\r\n varying float fogDepth;\r\n\r\n#endif\r\n",Zc="#ifdef USE_FOG\r\n\r\n\t#ifdef FOG_EXP2\r\n\r\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\r\n\r\n\t#else\r\n\r\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\r\n\r\n\t#endif\r\n\r\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\r\n\r\n#endif\r\n",Jc="#ifdef USE_FOG\r\n\r\n\tuniform vec3 fogColor;\r\n\tvarying float fogDepth;\r\n\r\n\t#ifdef FOG_EXP2\r\n\r\n\t\tuniform float fogDensity;\r\n\r\n\t#else\r\n\r\n\t\tuniform float fogNear;\r\n\t\tuniform float fogFar;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",Qc="#ifdef TOON\r\n\r\n\tuniform sampler2D gradientMap;\r\n\r\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\r\n\r\n\t\t// dotNL will be from -1.0 to 1.0\r\n\t\tfloat dotNL = dot( normal, lightDirection );\r\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\r\n\r\n\t\t#ifdef USE_GRADIENTMAP\r\n\r\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\r\n\r\n\t\t#else\r\n\r\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\r\n\r\n\t\t#endif\r\n\r\n\r\n\t}\r\n\r\n#endif\r\n",Kc="#ifdef USE_LIGHTMAP\r\n\r\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity; // factor of PI should not be present; included here to prevent breakage\r\n\r\n#endif\r\n",$c="#ifdef USE_LIGHTMAP\r\n\r\n\tuniform sampler2D lightMap;\r\n\tuniform float lightMapIntensity;\r\n\r\n#endif",th="vec3 diffuse = vec3( 1.0 );\r\n\r\nGeometricContext geometry;\r\ngeometry.position = mvPosition.xyz;\r\ngeometry.normal = normalize( transformedNormal );\r\ngeometry.viewDir = normalize( -mvPosition.xyz );\r\n\r\nGeometricContext backGeometry;\r\nbackGeometry.position = geometry.position;\r\nbackGeometry.normal = -geometry.normal;\r\nbackGeometry.viewDir = geometry.viewDir;\r\n\r\nvLightFront = vec3( 0.0 );\r\n\r\n#ifdef DOUBLE_SIDED\r\n\tvLightBack = vec3( 0.0 );\r\n#endif\r\n\r\nIncidentLight directLight;\r\nfloat dotNL;\r\nvec3 directLightColor_Diffuse;\r\n\r\n#if NUM_POINT_LIGHTS > 0\r\n\r\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\r\n\r\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\r\n\r\n\t\tdotNL = dot( geometry.normal, directLight.direction );\r\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\r\n\r\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#ifdef DOUBLE_SIDED\r\n\r\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#endif\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if NUM_SPOT_LIGHTS > 0\r\n\r\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\r\n\r\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\r\n\r\n\t\tdotNL = dot( geometry.normal, directLight.direction );\r\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\r\n\r\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#ifdef DOUBLE_SIDED\r\n\r\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#endif\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n\r\n#if NUM_DIR_LIGHTS > 0\r\n\r\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\r\n\r\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\r\n\r\n\t\tdotNL = dot( geometry.normal, directLight.direction );\r\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\r\n\r\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#ifdef DOUBLE_SIDED\r\n\r\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#endif\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if NUM_HEMI_LIGHTS > 0\r\n\r\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\r\n\r\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\r\n\r\n\t\t#ifdef DOUBLE_SIDED\r\n\r\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\r\n\r\n\t\t#endif\r\n\r\n\t}\r\n\r\n#endif\r\n",eh="uniform vec3 ambientLightColor;\r\n\r\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\r\n\r\n\tvec3 irradiance = ambientLightColor;\r\n\r\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\tirradiance *= PI;\r\n\r\n\t#endif\r\n\r\n\treturn irradiance;\r\n\r\n}\r\n\r\n#if NUM_DIR_LIGHTS > 0\r\n\r\n\tstruct DirectionalLight {\r\n\t\tvec3 direction;\r\n\t\tvec3 color;\r\n\r\n\t\tint shadow;\r\n\t\tfloat shadowBias;\r\n\t\tfloat shadowRadius;\r\n\t\tvec2 shadowMapSize;\r\n\t};\r\n\r\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\r\n\r\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\r\n\r\n\t\tdirectLight.color = directionalLight.color;\r\n\t\tdirectLight.direction = directionalLight.direction;\r\n\t\tdirectLight.visible = true;\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n#if NUM_POINT_LIGHTS > 0\r\n\r\n\tstruct PointLight {\r\n\t\tvec3 position;\r\n\t\tvec3 color;\r\n\t\tfloat distance;\r\n\t\tfloat decay;\r\n\r\n\t\tint shadow;\r\n\t\tfloat shadowBias;\r\n\t\tfloat shadowRadius;\r\n\t\tvec2 shadowMapSize;\r\n\t\tfloat shadowCameraNear;\r\n\t\tfloat shadowCameraFar;\r\n\t};\r\n\r\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\r\n\r\n\t// directLight is an out parameter as having it as a return value caused compiler errors on some devices\r\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\r\n\r\n\t\tvec3 lVector = pointLight.position - geometry.position;\r\n\t\tdirectLight.direction = normalize( lVector );\r\n\r\n\t\tfloat lightDistance = length( lVector );\r\n\r\n\t\tdirectLight.color = pointLight.color;\r\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\r\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n#if NUM_SPOT_LIGHTS > 0\r\n\r\n\tstruct SpotLight {\r\n\t\tvec3 position;\r\n\t\tvec3 direction;\r\n\t\tvec3 color;\r\n\t\tfloat distance;\r\n\t\tfloat decay;\r\n\t\tfloat coneCos;\r\n\t\tfloat penumbraCos;\r\n\r\n\t\tint shadow;\r\n\t\tfloat shadowBias;\r\n\t\tfloat shadowRadius;\r\n\t\tvec2 shadowMapSize;\r\n\t};\r\n\r\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\r\n\r\n\t// directLight is an out parameter as having it as a return value caused compiler errors on some devices\r\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\r\n\r\n\t\tvec3 lVector = spotLight.position - geometry.position;\r\n\t\tdirectLight.direction = normalize( lVector );\r\n\r\n\t\tfloat lightDistance = length( lVector );\r\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\r\n\r\n\t\tif ( angleCos > spotLight.coneCos ) {\r\n\r\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\r\n\r\n\t\t\tdirectLight.color = spotLight.color;\r\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\r\n\t\t\tdirectLight.visible = true;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tdirectLight.color = vec3( 0.0 );\r\n\t\t\tdirectLight.visible = false;\r\n\r\n\t\t}\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n#if NUM_RECT_AREA_LIGHTS > 0\r\n\r\n\tstruct RectAreaLight {\r\n\t\tvec3 color;\r\n\t\tvec3 position;\r\n\t\tvec3 halfWidth;\r\n\t\tvec3 halfHeight;\r\n\t};\r\n\r\n\t// Pre-computed values of LinearTransformedCosine approximation of BRDF\r\n\t// BRDF approximation Texture is 64x64\r\n\tuniform sampler2D ltcMat; // RGBA Float\r\n\tuniform sampler2D ltcMag; // Alpha Float (only has w component)\r\n\r\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\r\n\r\n#endif\r\n\r\n\r\n#if NUM_HEMI_LIGHTS > 0\r\n\r\n\tstruct HemisphereLight {\r\n\t\tvec3 direction;\r\n\t\tvec3 skyColor;\r\n\t\tvec3 groundColor;\r\n\t};\r\n\r\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\r\n\r\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\r\n\r\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\r\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\r\n\r\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\r\n\r\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\t\tirradiance *= PI;\r\n\r\n\t\t#endif\r\n\r\n\t\treturn irradiance;\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n#if defined( USE_ENVMAP ) && defined( PHYSICAL )\r\n\r\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\r\n\r\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\r\n\r\n\t\t#ifdef ENVMAP_TYPE_CUBE\r\n\r\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\r\n\r\n\t\t\t// TODO: replace with properly filtered cubemaps and access the irradiance LOD level, be it the last LOD level\r\n\t\t\t// of a specular cubemap, or just the default level of a specially created irradiance cubemap.\r\n\r\n\t\t\t#ifdef TEXTURE_LOD_EXT\r\n\r\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\r\n\r\n\t\t\t#else\r\n\r\n\t\t\t\t// force the bias high to get the last LOD level as it is the most blurred.\r\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\r\n\r\n\t\t\t#endif\r\n\r\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\r\n\r\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\r\n\r\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\r\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\r\n\r\n\t\t#else\r\n\r\n\t\t\tvec4 envMapColor = vec4( 0.0 );\r\n\r\n\t\t#endif\r\n\r\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\r\n\r\n\t}\r\n\r\n\t// taken from here: http://casual-effects.blogspot.ca/2011/08/plausible-environment-lighting-in-two.html\r\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\r\n\r\n\t\t//float envMapWidth = pow( 2.0, maxMIPLevelScalar );\r\n\t\t//float desiredMIPLevel = log2( envMapWidth * sqrt( 3.0 ) ) - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\r\n\r\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\r\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\r\n\r\n\t\t// clamp to allowable LOD ranges.\r\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\r\n\r\n\t}\r\n\r\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\r\n\r\n\t\t#ifdef ENVMAP_MODE_REFLECTION\r\n\r\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\r\n\r\n\t\t#else\r\n\r\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\r\n\r\n\t\t#endif\r\n\r\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\r\n\r\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\r\n\r\n\t\t#ifdef ENVMAP_TYPE_CUBE\r\n\r\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\r\n\r\n\t\t\t#ifdef TEXTURE_LOD_EXT\r\n\r\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\r\n\r\n\t\t\t#else\r\n\r\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\r\n\r\n\t\t\t#endif\r\n\r\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\r\n\r\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\r\n\r\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\r\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\r\n\r\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\r\n\r\n\t\t\tvec2 sampleUV;\r\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\r\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\r\n\r\n\t\t\t#ifdef TEXTURE_LOD_EXT\r\n\r\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\r\n\r\n\t\t\t#else\r\n\r\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\r\n\r\n\t\t\t#endif\r\n\r\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\r\n\r\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\r\n\r\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\r\n\r\n\t\t\t#ifdef TEXTURE_LOD_EXT\r\n\r\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\r\n\r\n\t\t\t#else\r\n\r\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\r\n\r\n\t\t\t#endif\r\n\r\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\r\n\r\n\t\t#endif\r\n\r\n\t\treturn envMapColor.rgb * envMapIntensity;\r\n\r\n\t}\r\n\r\n#endif\r\n",rh="BlinnPhongMaterial material;\r\nmaterial.diffuseColor = diffuseColor.rgb;\r\nmaterial.specularColor = specular;\r\nmaterial.specularShininess = shininess;\r\nmaterial.specularStrength = specularStrength;\r\n",nh="varying vec3 vViewPosition;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n\r\nstruct BlinnPhongMaterial {\r\n\r\n\tvec3\tdiffuseColor;\r\n\tvec3\tspecularColor;\r\n\tfloat\tspecularShininess;\r\n\tfloat\tspecularStrength;\r\n\r\n};\r\n\r\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\t#ifdef TOON\r\n\r\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\r\n\r\n\t#else\r\n\r\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\r\n\t\tvec3 irradiance = dotNL * directLight.color;\r\n\r\n\t#endif\r\n\r\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\tirradiance *= PI; // punctual light\r\n\r\n\t#endif\r\n\r\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\r\n\r\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\r\n\r\n}\r\n\r\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\r\n\r\n}\r\n\r\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\r\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\r\n\r\n#define Material_LightProbeLOD( material )\t(0)\r\n",ih="PhysicalMaterial material;\r\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\r\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\r\n#ifdef STANDARD\r\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\r\n#else\r\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\r\n\tmaterial.clearCoat = saturate( clearCoat ); // Burley clearcoat model\r\n\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\r\n#endif\r\n",ah="struct PhysicalMaterial {\r\n\r\n\tvec3\tdiffuseColor;\r\n\tfloat\tspecularRoughness;\r\n\tvec3\tspecularColor;\r\n\r\n\t#ifndef STANDARD\r\n\t\tfloat clearCoat;\r\n\t\tfloat clearCoatRoughness;\r\n\t#endif\r\n\r\n};\r\n\r\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\r\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\r\n\r\n// Clear coat directional hemishperical reflectance (this approximation should be improved)\r\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\r\n\r\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\r\n\r\n}\r\n\r\n#if NUM_RECT_AREA_LIGHTS > 0\r\n\r\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\t\tvec3 normal = geometry.normal;\r\n\t\tvec3 viewDir = geometry.viewDir;\r\n\t\tvec3 position = geometry.position;\r\n\t\tvec3 lightPos = rectAreaLight.position;\r\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\r\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\r\n\t\tvec3 lightColor = rectAreaLight.color;\r\n\t\tfloat roughness = material.specularRoughness;\r\n\r\n\t\tvec3 rectCoords[ 4 ];\r\n\t\trectCoords[ 0 ] = lightPos - halfWidth - halfHeight; // counterclockwise\r\n\t\trectCoords[ 1 ] = lightPos + halfWidth - halfHeight;\r\n\t\trectCoords[ 2 ] = lightPos + halfWidth + halfHeight;\r\n\t\trectCoords[ 3 ] = lightPos - halfWidth + halfHeight;\r\n\r\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\r\n\r\n\t\tfloat norm = texture2D( ltcMag, uv ).a;\r\n\r\n\t\tvec4 t = texture2D( ltcMat, uv );\r\n\r\n\t\tmat3 mInv = mat3(\r\n\t\t\tvec3( 1, 0, t.y ),\r\n\t\t\tvec3( 0, t.z, 0 ),\r\n\t\t\tvec3( t.w, 0, t.x )\r\n\t\t);\r\n\r\n\t\treflectedLight.directSpecular += lightColor * material.specularColor * norm * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); // no fresnel\r\n\r\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1 ), rectCoords );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\r\n\r\n\tvec3 irradiance = dotNL * directLight.color;\r\n\r\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\tirradiance *= PI; // punctual light\r\n\r\n\t#endif\r\n\r\n\t#ifndef STANDARD\r\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\r\n\t#else\r\n\t\tfloat clearCoatDHR = 0.0;\r\n\t#endif\r\n\r\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\r\n\r\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\r\n\r\n\t#ifndef STANDARD\r\n\r\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\r\n\r\n\t#endif\r\n\r\n}\r\n\r\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\r\n\r\n}\r\n\r\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\t#ifndef STANDARD\r\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\t\tfloat dotNL = dotNV;\r\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\r\n\t#else\r\n\t\tfloat clearCoatDHR = 0.0;\r\n\t#endif\r\n\r\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\r\n\r\n\t#ifndef STANDARD\r\n\r\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\r\n\r\n\t#endif\r\n\r\n}\r\n\r\n#define RE_Direct\t\t\t\tRE_Direct_Physical\r\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\r\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\r\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\r\n\r\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\r\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\r\n\r\n// ref: https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\r\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\r\n\r\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\r\n\r\n}\r\n",oh="\r\n\r\nGeometricContext geometry;\r\n\r\ngeometry.position = - vViewPosition;\r\ngeometry.normal = normal;\r\ngeometry.viewDir = normalize( vViewPosition );\r\n\r\nIncidentLight directLight;\r\n\r\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\r\n\r\n\tPointLight pointLight;\r\n\r\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\r\n\r\n\t\tpointLight = pointLights[ i ];\r\n\r\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\r\n\r\n\t\t#ifdef USE_SHADOWMAP\r\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\r\n\t\t#endif\r\n\r\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\r\n\r\n\tSpotLight spotLight;\r\n\r\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\r\n\r\n\t\tspotLight = spotLights[ i ];\r\n\r\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\r\n\r\n\t\t#ifdef USE_SHADOWMAP\r\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\r\n\t\t#endif\r\n\r\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\r\n\r\n\tDirectionalLight directionalLight;\r\n\r\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\r\n\r\n\t\tdirectionalLight = directionalLights[ i ];\r\n\r\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\r\n\r\n\t\t#ifdef USE_SHADOWMAP\r\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\r\n\t\t#endif\r\n\r\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\r\n\r\n\tRectAreaLight rectAreaLight;\r\n\r\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\r\n\r\n\t\trectAreaLight = rectAreaLights[ i ];\r\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if defined( RE_IndirectDiffuse )\r\n\r\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\r\n\r\n\t#ifdef USE_LIGHTMAP\r\n\r\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\r\n\r\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\t\tlightMapIrradiance *= PI; // factor of PI should not be present; included here to prevent breakage\r\n\r\n\t\t#endif\r\n\r\n\t\tirradiance += lightMapIrradiance;\r\n\r\n\t#endif\r\n\r\n\t#if ( NUM_HEMI_LIGHTS > 0 )\r\n\r\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\r\n\r\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\r\n\r\n\t\t}\r\n\r\n\t#endif\r\n\r\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\r\n\r\n\t\t// TODO, replace 8 with the real maxMIPLevel\r\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\r\n\r\n\t#endif\r\n\r\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\r\n\r\n#endif\r\n\r\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\r\n\r\n\t// TODO, replace 8 with the real maxMIPLevel\r\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\r\n\r\n\t#ifndef STANDARD\r\n\t\tvec3 clearCoatRadiance = getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), 8 );\r\n\t#else\r\n\t\tvec3 clearCoatRadiance = vec3( 0.0 );\r\n\t#endif\r\n\r\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\r\n\r\n#endif\r\n",sh="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\r\n\r\n\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\r\n\r\n#endif",ch="#ifdef USE_LOGDEPTHBUF\r\n\r\n\tuniform float logDepthBufFC;\r\n\r\n\t#ifdef USE_LOGDEPTHBUF_EXT\r\n\r\n\t\tvarying float vFragDepth;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",hh="#ifdef USE_LOGDEPTHBUF\r\n\r\n\t#ifdef USE_LOGDEPTHBUF_EXT\r\n\r\n\t\tvarying float vFragDepth;\r\n\r\n\t#endif\r\n\r\n\tuniform float logDepthBufFC;\r\n\r\n#endif",lh="#ifdef USE_LOGDEPTHBUF\r\n\r\n\t#ifdef USE_LOGDEPTHBUF_EXT\r\n\r\n\t\tvFragDepth = 1.0 + gl_Position.w;\r\n\r\n\t#else\r\n\r\n\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\r\n\r\n\t\tgl_Position.z *= gl_Position.w;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",uh="#ifdef USE_MAP\r\n\r\n\tvec4 texelColor = texture2D( map, vUv );\r\n\r\n\ttexelColor = mapTexelToLinear( texelColor );\r\n\tdiffuseColor *= texelColor;\r\n\r\n#endif\r\n",ph="#ifdef USE_MAP\r\n\r\n\tuniform sampler2D map;\r\n\r\n#endif\r\n",dh="#ifdef USE_MAP\r\n\r\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\r\n\tvec4 mapTexel = texture2D( map, uv );\r\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\r\n\r\n#endif\r\n",fh="#ifdef USE_MAP\r\n\r\n\tuniform mat3 uvTransform;\r\n\tuniform sampler2D map;\r\n\r\n#endif\r\n",mh="float metalnessFactor = metalness;\r\n\r\n#ifdef USE_METALNESSMAP\r\n\r\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\r\n\r\n\t// reads channel B, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\r\n\tmetalnessFactor *= texelMetalness.b;\r\n\r\n#endif\r\n",vh="#ifdef USE_METALNESSMAP\r\n\r\n\tuniform sampler2D metalnessMap;\r\n\r\n#endif",gh="#ifdef USE_MORPHNORMALS\r\n\r\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\r\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\r\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\r\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\r\n\r\n#endif\r\n",yh="#ifdef USE_MORPHTARGETS\r\n\r\n\t#ifndef USE_MORPHNORMALS\r\n\r\n\tuniform float morphTargetInfluences[ 8 ];\r\n\r\n\t#else\r\n\r\n\tuniform float morphTargetInfluences[ 4 ];\r\n\r\n\t#endif\r\n\r\n#endif",xh="#ifdef USE_MORPHTARGETS\r\n\r\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\r\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\r\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\r\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\r\n\r\n\t#ifndef USE_MORPHNORMALS\r\n\r\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\r\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\r\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\r\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\r\n\r\n\t#endif\r\n\r\n#endif\r\n",bh="#ifdef FLAT_SHADED\r\n\r\n\t// Workaround for Adreno/Nexus5 not able able to do dFdx( vViewPosition ) ...\r\n\r\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\r\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\r\n\tvec3 normal = normalize( cross( fdx, fdy ) );\r\n\r\n#else\r\n\r\n\tvec3 normal = normalize( vNormal );\r\n\r\n\t#ifdef DOUBLE_SIDED\r\n\r\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\r\n\r\n\t#endif\r\n\r\n#endif\r\n\r\n#ifdef USE_NORMALMAP\r\n\r\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\r\n\r\n#elif defined( USE_BUMPMAP )\r\n\r\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\r\n\r\n#endif\r\n",_h="#ifdef USE_NORMALMAP\r\n\r\n\tuniform sampler2D normalMap;\r\n\tuniform vec2 normalScale;\r\n\r\n\t// Per-Pixel Tangent Space Normal Mapping\r\n\t// http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html\r\n\r\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\r\n\r\n\t\t// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\r\n\r\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\r\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\r\n\t\tvec2 st0 = dFdx( vUv.st );\r\n\t\tvec2 st1 = dFdy( vUv.st );\r\n\r\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\r\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\r\n\t\tvec3 N = normalize( surf_norm );\r\n\r\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\r\n\t\tmapN.xy = normalScale * mapN.xy;\r\n\t\tmat3 tsn = mat3( S, T, N );\r\n\t\treturn normalize( tsn * mapN );\r\n\r\n\t}\r\n\r\n#endif\r\n",wh="vec3 packNormalToRGB( const in vec3 normal ) {\r\n\treturn normalize( normal ) * 0.5 + 0.5;\r\n}\r\n\r\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\r\n\treturn 2.0 * rgb.xyz - 1.0;\r\n}\r\n\r\nconst float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1)\r\nconst float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1)\r\n\r\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\r\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\r\n\r\nconst float ShiftRight8 = 1. / 256.;\r\n\r\nvec4 packDepthToRGBA( const in float v ) {\r\n\tvec4 r = vec4( fract( v * PackFactors ), v );\r\n\tr.yzw -= r.xyz * ShiftRight8; // tidy overflow\r\n\treturn r * PackUpscale;\r\n}\r\n\r\nfloat unpackRGBAToDepth( const in vec4 v ) {\r\n\treturn dot( v, UnpackFactors );\r\n}\r\n\r\n// NOTE: viewZ/eyeZ is < 0 when in front of the camera per OpenGL conventions\r\n\r\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\r\n\treturn ( viewZ + near ) / ( near - far );\r\n}\r\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\r\n\treturn linearClipZ * ( near - far ) - near;\r\n}\r\n\r\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\r\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\r\n}\r\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\r\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\r\n}\r\n",Mh="#ifdef PREMULTIPLIED_ALPHA\r\n\r\n\t// Get get normal blending with premultipled, use with CustomBlending, OneFactor, OneMinusSrcAlphaFactor, AddEquation.\r\n\tgl_FragColor.rgb *= gl_FragColor.a;\r\n\r\n#endif\r\n",Eh="vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\r\n\r\ngl_Position = projectionMatrix * mvPosition;\r\n",Th="#if defined( DITHERING )\r\n\r\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\r\n\r\n#endif\r\n",Sh="#if defined( DITHERING )\r\n\r\n\t// based on https://www.shadertoy.com/view/MslGR8\r\n\tvec3 dithering( vec3 color ) {\r\n\t\t//Calculate grid position\r\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\r\n\r\n\t\t//Shift the individual colors differently, thus making it even harder to see the dithering pattern\r\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\r\n\r\n\t\t//modify shift acording to grid position.\r\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\r\n\r\n\t\t//shift the color by dither_shift\r\n\t\treturn color + dither_shift_RGB;\r\n\t}\r\n\r\n#endif\r\n",Ah="float roughnessFactor = roughness;\r\n\r\n#ifdef USE_ROUGHNESSMAP\r\n\r\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\r\n\r\n\t// reads channel G, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\r\n\troughnessFactor *= texelRoughness.g;\r\n\r\n#endif\r\n",Rh="#ifdef USE_ROUGHNESSMAP\r\n\r\n\tuniform sampler2D roughnessMap;\r\n\r\n#endif",Lh="#ifdef USE_SHADOWMAP\r\n\r\n\t#if NUM_DIR_LIGHTS > 0\r\n\r\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\r\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\t#if NUM_SPOT_LIGHTS > 0\r\n\r\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\r\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\t#if NUM_POINT_LIGHTS > 0\r\n\r\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\r\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\r\n\r\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\r\n\r\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\r\n\r\n\t}\r\n\r\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\r\n\r\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\r\n\r\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\r\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\r\n\r\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\r\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\r\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\r\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\r\n\r\n\t\tvec2 f = fract( uv * size + 0.5 );\r\n\r\n\t\tfloat a = mix( lb, lt, f.y );\r\n\t\tfloat b = mix( rb, rt, f.y );\r\n\t\tfloat c = mix( a, b, f.x );\r\n\r\n\t\treturn c;\r\n\r\n\t}\r\n\r\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\r\n\r\n\t\tfloat shadow = 1.0;\r\n\r\n\t\tshadowCoord.xyz /= shadowCoord.w;\r\n\t\tshadowCoord.z += shadowBias;\r\n\r\n\t\t// if ( something && something ) breaks ATI OpenGL shader compiler\r\n\t\t// if ( all( something, something ) ) using this instead\r\n\r\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\r\n\t\tbool inFrustum = all( inFrustumVec );\r\n\r\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\r\n\r\n\t\tbool frustumTest = all( frustumTestVec );\r\n\r\n\t\tif ( frustumTest ) {\r\n\r\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\r\n\r\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\r\n\r\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\r\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\r\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\r\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\r\n\r\n\t\t\tshadow = (\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\r\n\t\t\t) * ( 1.0 / 9.0 );\r\n\r\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\r\n\r\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\r\n\r\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\r\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\r\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\r\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\r\n\r\n\t\t\tshadow = (\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\r\n\t\t\t) * ( 1.0 / 9.0 );\r\n\r\n\t\t#else // no percentage-closer filtering:\r\n\r\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\r\n\r\n\t\t#endif\r\n\r\n\t\t}\r\n\r\n\t\treturn shadow;\r\n\r\n\t}\r\n\r\n\t// cubeToUV() maps a 3D direction vector suitable for cube texture mapping to a 2D\r\n\t// vector suitable for 2D texture mapping. This code uses the following layout for the\r\n\t// 2D texture:\r\n\t//\r\n\t// xzXZ\r\n\t// y Y\r\n\t//\r\n\t// Y - Positive y direction\r\n\t// y - Negative y direction\r\n\t// X - Positive x direction\r\n\t// x - Negative x direction\r\n\t// Z - Positive z direction\r\n\t// z - Negative z direction\r\n\t//\r\n\t// Source and test bed:\r\n\t// https://gist.github.com/tschw/da10c43c467ce8afd0c4\r\n\r\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\r\n\r\n\t\t// Number of texels to avoid at the edge of each square\r\n\r\n\t\tvec3 absV = abs( v );\r\n\r\n\t\t// Intersect unit cube\r\n\r\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\r\n\t\tabsV *= scaleToCube;\r\n\r\n\t\t// Apply scale to avoid seams\r\n\r\n\t\t// two texels less per square (one texel will do for NEAREST)\r\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\r\n\r\n\t\t// Unwrap\r\n\r\n\t\t// space: -1 ... 1 range for each square\r\n\t\t//\r\n\t\t// #X##\t\tdim := ( 4 , 2 )\r\n\t\t// # #\t\tcenter := ( 1 , 1 )\r\n\r\n\t\tvec2 planar = v.xy;\r\n\r\n\t\tfloat almostATexel = 1.5 * texelSizeY;\r\n\t\tfloat almostOne = 1.0 - almostATexel;\r\n\r\n\t\tif ( absV.z >= almostOne ) {\r\n\r\n\t\t\tif ( v.z > 0.0 )\r\n\t\t\t\tplanar.x = 4.0 - v.x;\r\n\r\n\t\t} else if ( absV.x >= almostOne ) {\r\n\r\n\t\t\tfloat signX = sign( v.x );\r\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\r\n\r\n\t\t} else if ( absV.y >= almostOne ) {\r\n\r\n\t\t\tfloat signY = sign( v.y );\r\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\r\n\t\t\tplanar.y = v.z * signY - 2.0;\r\n\r\n\t\t}\r\n\r\n\t\t// Transform to UV space\r\n\r\n\t\t// scale := 0.5 / dim\r\n\t\t// translate := ( center + 0.5 ) / dim\r\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\r\n\r\n\t}\r\n\r\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\r\n\r\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\r\n\r\n\t\t// for point lights, the uniform @vShadowCoord is re-purposed to hold\r\n\t\t// the vector from the light to the world-space position of the fragment.\r\n\t\tvec3 lightToPosition = shadowCoord.xyz;\r\n\r\n\t\t// dp = normalized distance from light to fragment position\r\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); // need to clamp?\r\n\t\tdp += shadowBias;\r\n\r\n\t\t// bd3D = base direction 3D\r\n\t\tvec3 bd3D = normalize( lightToPosition );\r\n\r\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\r\n\r\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\r\n\r\n\t\t\treturn (\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\r\n\t\t\t) * ( 1.0 / 9.0 );\r\n\r\n\t\t#else // no percentage-closer filtering\r\n\r\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\r\n\r\n\t\t#endif\r\n\r\n\t}\r\n\r\n#endif\r\n",Ph="#ifdef USE_SHADOWMAP\r\n\r\n\t#if NUM_DIR_LIGHTS > 0\r\n\r\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\r\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\t#if NUM_SPOT_LIGHTS > 0\r\n\r\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\r\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\t#if NUM_POINT_LIGHTS > 0\r\n\r\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\r\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\r\n\r\n#endif\r\n",Ch="#ifdef USE_SHADOWMAP\r\n\r\n\t#if NUM_DIR_LIGHTS > 0\r\n\r\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\r\n\r\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\t#if NUM_SPOT_LIGHTS > 0\r\n\r\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\r\n\r\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\t#if NUM_POINT_LIGHTS > 0\r\n\r\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\r\n\r\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\r\n\r\n#endif\r\n",Ih="float getShadowMask() {\r\n\r\n\tfloat shadow = 1.0;\r\n\r\n\t#ifdef USE_SHADOWMAP\r\n\r\n\t#if NUM_DIR_LIGHTS > 0\r\n\r\n\tDirectionalLight directionalLight;\r\n\r\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\r\n\r\n\t\tdirectionalLight = directionalLights[ i ];\r\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\t#if NUM_SPOT_LIGHTS > 0\r\n\r\n\tSpotLight spotLight;\r\n\r\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\r\n\r\n\t\tspotLight = spotLights[ i ];\r\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\t#if NUM_POINT_LIGHTS > 0\r\n\r\n\tPointLight pointLight;\r\n\r\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\r\n\r\n\t\tpointLight = pointLights[ i ];\r\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\r\n\r\n\t#endif\r\n\r\n\treturn shadow;\r\n\r\n}\r\n",Oh="#ifdef USE_SKINNING\r\n\r\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\r\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\r\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\r\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\r\n\r\n#endif",Nh="#ifdef USE_SKINNING\r\n\r\n\tuniform mat4 bindMatrix;\r\n\tuniform mat4 bindMatrixInverse;\r\n\r\n\t#ifdef BONE_TEXTURE\r\n\r\n\t\tuniform sampler2D boneTexture;\r\n\t\tuniform int boneTextureSize;\r\n\r\n\t\tmat4 getBoneMatrix( const in float i ) {\r\n\r\n\t\t\tfloat j = i * 4.0;\r\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\r\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\r\n\r\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\r\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\r\n\r\n\t\t\ty = dy * ( y + 0.5 );\r\n\r\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\r\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\r\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\r\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\r\n\r\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\r\n\r\n\t\t\treturn bone;\r\n\r\n\t\t}\r\n\r\n\t#else\r\n\r\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\r\n\r\n\t\tmat4 getBoneMatrix( const in float i ) {\r\n\r\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\r\n\t\t\treturn bone;\r\n\r\n\t\t}\r\n\r\n\t#endif\r\n\r\n#endif\r\n",Uh="#ifdef USE_SKINNING\r\n\r\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\r\n\r\n\tvec4 skinned = vec4( 0.0 );\r\n\tskinned += boneMatX * skinVertex * skinWeight.x;\r\n\tskinned += boneMatY * skinVertex * skinWeight.y;\r\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\r\n\tskinned += boneMatW * skinVertex * skinWeight.w;\r\n\r\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\r\n\r\n#endif\r\n",Dh="#ifdef USE_SKINNING\r\n\r\n\tmat4 skinMatrix = mat4( 0.0 );\r\n\tskinMatrix += skinWeight.x * boneMatX;\r\n\tskinMatrix += skinWeight.y * boneMatY;\r\n\tskinMatrix += skinWeight.z * boneMatZ;\r\n\tskinMatrix += skinWeight.w * boneMatW;\r\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\r\n\r\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\r\n\r\n#endif\r\n",Bh="float specularStrength;\r\n\r\n#ifdef USE_SPECULARMAP\r\n\r\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\r\n\tspecularStrength = texelSpecular.r;\r\n\r\n#else\r\n\r\n\tspecularStrength = 1.0;\r\n\r\n#endif",Fh="#ifdef USE_SPECULARMAP\r\n\r\n\tuniform sampler2D specularMap;\r\n\r\n#endif",zh="#if defined( TONE_MAPPING )\r\n\r\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\r\n\r\n#endif\r\n",Gh="#ifndef saturate\r\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\r\n#endif\r\n\r\nuniform float toneMappingExposure;\r\nuniform float toneMappingWhitePoint;\r\n\r\n// exposure only\r\nvec3 LinearToneMapping( vec3 color ) {\r\n\r\n\treturn toneMappingExposure * color;\r\n\r\n}\r\n\r\n// source: https://www.cs.utah.edu/~reinhard/cdrom/\r\nvec3 ReinhardToneMapping( vec3 color ) {\r\n\r\n\tcolor *= toneMappingExposure;\r\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\r\n\r\n}\r\n\r\n// source: http://filmicgames.com/archives/75\r\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\r\nvec3 Uncharted2ToneMapping( vec3 color ) {\r\n\r\n\t// John Hable's filmic operator from Uncharted 2 video game\r\n\tcolor *= toneMappingExposure;\r\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\r\n\r\n}\r\n\r\n// source: http://filmicgames.com/archives/75\r\nvec3 OptimizedCineonToneMapping( vec3 color ) {\r\n\r\n\t// optimized filmic operator by Jim Hejl and Richard Burgess-Dawson\r\n\tcolor *= toneMappingExposure;\r\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\r\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\r\n\r\n}\r\n",Hh="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\r\n\r\n\tvarying vec2 vUv;\r\n\r\n#endif",Vh="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\r\n\r\n\tvarying vec2 vUv;\r\n\tuniform mat3 uvTransform;\r\n\r\n#endif\r\n",kh="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\r\n\r\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\r\n\r\n#endif",jh="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\r\n\r\n\tvarying vec2 vUv2;\r\n\r\n#endif",Wh="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\r\n\r\n\tattribute vec2 uv2;\r\n\tvarying vec2 vUv2;\r\n\r\n#endif",Xh="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\r\n\r\n\tvUv2 = uv2;\r\n\r\n#endif",qh="#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\r\n\r\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\r\n\r\n#endif\r\n",Yh="uniform samplerCube tCube;\r\nuniform float tFlip;\r\nuniform float opacity;\r\n\r\nvarying vec3 vWorldPosition;\r\n\r\nvoid main() {\r\n\r\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\r\n\tgl_FragColor.a *= opacity;\r\n\r\n}\r\n",Zh="varying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n\r\nvoid main() {\r\n\r\n\tvWorldPosition = transformDirection( position, modelMatrix );\r\n\r\n\t#include <begin_vertex>\r\n\t#include <project_vertex>\r\n\r\n\tgl_Position.z = gl_Position.w; // set z to camera.far\r\n\r\n}\r\n",Jh="#if DEPTH_PACKING == 3200\r\n\r\n\tuniform float opacity;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <uv_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( 1.0 );\r\n\r\n\t#if DEPTH_PACKING == 3200\r\n\r\n\t\tdiffuseColor.a = opacity;\r\n\r\n\t#endif\r\n\r\n\t#include <map_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\r\n\t#if DEPTH_PACKING == 3200\r\n\r\n\t\tgl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );\r\n\r\n\t#elif DEPTH_PACKING == 3201\r\n\r\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\r\n\r\n\t#endif\r\n\r\n}\r\n",Qh="#include <common>\r\n#include <uv_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\r\n\t#include <skinbase_vertex>\r\n\r\n\t#ifdef USE_DISPLACEMENTMAP\r\n\r\n\t\t#include <beginnormal_vertex>\r\n\t\t#include <morphnormal_vertex>\r\n\t\t#include <skinnormal_vertex>\r\n\r\n\t#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n}\r\n",Kh="#define DISTANCE\r\n\r\nuniform vec3 referencePosition;\r\nuniform float nearDistance;\r\nuniform float farDistance;\r\nvarying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <uv_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main () {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( 1.0 );\r\n\r\n\t#include <map_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\r\n\tfloat dist = length( vWorldPosition - referencePosition );\r\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\r\n\tdist = saturate( dist ); // clamp to [ 0, 1 ]\r\n\r\n\tgl_FragColor = packDepthToRGBA( dist );\r\n\r\n}\r\n",$h="#define DISTANCE\r\n\r\nvarying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n#include <uv_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\r\n\t#include <skinbase_vertex>\r\n\r\n\t#ifdef USE_DISPLACEMENTMAP\r\n\r\n\t\t#include <beginnormal_vertex>\r\n\t\t#include <morphnormal_vertex>\r\n\t\t#include <skinnormal_vertex>\r\n\r\n\t#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <worldpos_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n\tvWorldPosition = worldPosition.xyz;\r\n\r\n}\r\n",tl="uniform sampler2D tEquirect;\r\n\r\nvarying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n\r\nvoid main() {\r\n\r\n\tvec3 direction = normalize( vWorldPosition );\r\n\r\n\tvec2 sampleUV;\r\n\r\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\r\n\r\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\r\n\r\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\r\n\r\n}\r\n",el="varying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n\r\nvoid main() {\r\n\r\n\tvWorldPosition = transformDirection( position, modelMatrix );\r\n\r\n\t#include <begin_vertex>\r\n\t#include <project_vertex>\r\n\r\n}\r\n",rl="uniform vec3 diffuse;\r\nuniform float opacity;\r\n\r\nuniform float dashSize;\r\nuniform float totalSize;\r\n\r\nvarying float vLineDistance;\r\n\r\n#include <common>\r\n#include <color_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\r\n\r\n\t\tdiscard;\r\n\r\n\t}\r\n\r\n\tvec3 outgoingLight = vec3( 0.0 );\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <color_fragment>\r\n\r\n\toutgoingLight = diffuseColor.rgb; // simple shader\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\r\n}\r\n",nl="uniform float scale;\r\nattribute float lineDistance;\r\n\r\nvarying float vLineDistance;\r\n\r\n#include <common>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <color_vertex>\r\n\r\n\tvLineDistance = scale * lineDistance;\r\n\r\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\r\n\tgl_Position = projectionMatrix * mvPosition;\r\n\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",il="uniform vec3 diffuse;\r\nuniform float opacity;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <color_pars_fragment>\r\n#include <uv_pars_fragment>\r\n#include <uv2_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <aomap_pars_fragment>\r\n#include <lightmap_pars_fragment>\r\n#include <envmap_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <specularmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\t#include <specularmap_fragment>\r\n\r\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\r\n\r\n\t// accumulation (baked indirect lighting only)\r\n\t#ifdef USE_LIGHTMAP\r\n\r\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\r\n\r\n\t#else\r\n\r\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\r\n\r\n\t#endif\r\n\r\n\t// modulation\r\n\t#include <aomap_fragment>\r\n\r\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\r\n\r\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\r\n\r\n\t#include <envmap_fragment>\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\r\n}\r\n",al="#include <common>\r\n#include <uv_pars_vertex>\r\n#include <uv2_pars_vertex>\r\n#include <envmap_pars_vertex>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\t#include <uv2_vertex>\r\n\t#include <color_vertex>\r\n\t#include <skinbase_vertex>\r\n\r\n\t#ifdef USE_ENVMAP\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n\t#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\r\n\t#include <worldpos_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\t#include <envmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",ol="uniform vec3 diffuse;\r\nuniform vec3 emissive;\r\nuniform float opacity;\r\n\r\nvarying vec3 vLightFront;\r\n\r\n#ifdef DOUBLE_SIDED\r\n\r\n\tvarying vec3 vLightBack;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <dithering_pars_fragment>\r\n#include <color_pars_fragment>\r\n#include <uv_pars_fragment>\r\n#include <uv2_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <aomap_pars_fragment>\r\n#include <lightmap_pars_fragment>\r\n#include <emissivemap_pars_fragment>\r\n#include <envmap_pars_fragment>\r\n#include <bsdfs>\r\n#include <lights_pars>\r\n#include <fog_pars_fragment>\r\n#include <shadowmap_pars_fragment>\r\n#include <shadowmask_pars_fragment>\r\n#include <specularmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\r\n\tvec3 totalEmissiveRadiance = emissive;\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\t#include <specularmap_fragment>\r\n\t#include <emissivemap_fragment>\r\n\r\n\t// accumulation\r\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\r\n\r\n\t#include <lightmap_fragment>\r\n\r\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\r\n\r\n\t#ifdef DOUBLE_SIDED\r\n\r\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\r\n\r\n\t#else\r\n\r\n\t\treflectedLight.directDiffuse = vLightFront;\r\n\r\n\t#endif\r\n\r\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\r\n\r\n\t// modulation\r\n\t#include <aomap_fragment>\r\n\r\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\r\n\r\n\t#include <envmap_fragment>\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <dithering_fragment>\r\n\r\n}\r\n",sl="#define LAMBERT\r\n\r\nvarying vec3 vLightFront;\r\n\r\n#ifdef DOUBLE_SIDED\r\n\r\n\tvarying vec3 vLightBack;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <uv_pars_vertex>\r\n#include <uv2_pars_vertex>\r\n#include <envmap_pars_vertex>\r\n#include <bsdfs>\r\n#include <lights_pars>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\t#include <uv2_vertex>\r\n\t#include <color_vertex>\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinbase_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n\t#include <worldpos_vertex>\r\n\t#include <envmap_vertex>\r\n\t#include <lights_lambert_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",cl="#define PHONG\r\n\r\nuniform vec3 diffuse;\r\nuniform vec3 emissive;\r\nuniform vec3 specular;\r\nuniform float shininess;\r\nuniform float opacity;\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <dithering_pars_fragment>\r\n#include <color_pars_fragment>\r\n#include <uv_pars_fragment>\r\n#include <uv2_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <aomap_pars_fragment>\r\n#include <lightmap_pars_fragment>\r\n#include <emissivemap_pars_fragment>\r\n#include <envmap_pars_fragment>\r\n#include <gradientmap_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <bsdfs>\r\n#include <lights_pars>\r\n#include <lights_phong_pars_fragment>\r\n#include <shadowmap_pars_fragment>\r\n#include <bumpmap_pars_fragment>\r\n#include <normalmap_pars_fragment>\r\n#include <specularmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\r\n\tvec3 totalEmissiveRadiance = emissive;\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\t#include <specularmap_fragment>\r\n\t#include <normal_fragment>\r\n\t#include <emissivemap_fragment>\r\n\r\n\t// accumulation\r\n\t#include <lights_phong_fragment>\r\n\t#include <lights_template>\r\n\r\n\t// modulation\r\n\t#include <aomap_fragment>\r\n\r\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\r\n\r\n\t#include <envmap_fragment>\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <dithering_fragment>\r\n\r\n}\r\n",hl="#define PHONG\r\n\r\nvarying vec3 vViewPosition;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <uv_pars_vertex>\r\n#include <uv2_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <envmap_pars_vertex>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\t#include <uv2_vertex>\r\n\t#include <color_vertex>\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinbase_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\r\n\r\n\tvNormal = normalize( transformedNormal );\r\n\r\n#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n\tvViewPosition = - mvPosition.xyz;\r\n\r\n\t#include <worldpos_vertex>\r\n\t#include <envmap_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",ll="#define PHYSICAL\r\n\r\nuniform vec3 diffuse;\r\nuniform vec3 emissive;\r\nuniform float roughness;\r\nuniform float metalness;\r\nuniform float opacity;\r\n\r\n#ifndef STANDARD\r\n\tuniform float clearCoat;\r\n\tuniform float clearCoatRoughness;\r\n#endif\r\n\r\nvarying vec3 vViewPosition;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <dithering_pars_fragment>\r\n#include <color_pars_fragment>\r\n#include <uv_pars_fragment>\r\n#include <uv2_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <aomap_pars_fragment>\r\n#include <lightmap_pars_fragment>\r\n#include <emissivemap_pars_fragment>\r\n#include <envmap_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <bsdfs>\r\n#include <cube_uv_reflection_fragment>\r\n#include <lights_pars>\r\n#include <lights_physical_pars_fragment>\r\n#include <shadowmap_pars_fragment>\r\n#include <bumpmap_pars_fragment>\r\n#include <normalmap_pars_fragment>\r\n#include <roughnessmap_pars_fragment>\r\n#include <metalnessmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\r\n\tvec3 totalEmissiveRadiance = emissive;\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\t#include <roughnessmap_fragment>\r\n\t#include <metalnessmap_fragment>\r\n\t#include <normal_fragment>\r\n\t#include <emissivemap_fragment>\r\n\r\n\t// accumulation\r\n\t#include <lights_physical_fragment>\r\n\t#include <lights_template>\r\n\r\n\t// modulation\r\n\t#include <aomap_fragment>\r\n\r\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <dithering_fragment>\r\n\r\n}\r\n",ul="#define PHYSICAL\r\n\r\nvarying vec3 vViewPosition;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <uv_pars_vertex>\r\n#include <uv2_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\t#include <uv2_vertex>\r\n\t#include <color_vertex>\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinbase_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\r\n\r\n\tvNormal = normalize( transformedNormal );\r\n\r\n#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n\tvViewPosition = - mvPosition.xyz;\r\n\r\n\t#include <worldpos_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",pl="#define NORMAL\r\n\r\nuniform float opacity;\r\n\r\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\r\n\r\n\tvarying vec3 vViewPosition;\r\n\r\n#endif\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <packing>\r\n#include <uv_pars_fragment>\r\n#include <bumpmap_pars_fragment>\r\n#include <normalmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <normal_fragment>\r\n\r\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\r\n\r\n}\r\n",dl="#define NORMAL\r\n\r\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\r\n\r\n\tvarying vec3 vViewPosition;\r\n\r\n#endif\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <uv_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinbase_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\r\n\r\n\tvNormal = normalize( transformedNormal );\r\n\r\n#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\r\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\r\n\r\n\tvViewPosition = - mvPosition.xyz;\r\n\r\n#endif\r\n\r\n}\r\n",fl="uniform vec3 diffuse;\r\nuniform float opacity;\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <color_pars_fragment>\r\n#include <map_particle_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <shadowmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec3 outgoingLight = vec3( 0.0 );\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_particle_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphatest_fragment>\r\n\r\n\toutgoingLight = diffuseColor.rgb;\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\r\n}\r\n",ml="uniform float size;\r\nuniform float scale;\r\n\r\n#include <common>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <color_vertex>\r\n\t#include <begin_vertex>\r\n\t#include <project_vertex>\r\n\r\n\t#ifdef USE_SIZEATTENUATION\r\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\r\n\t#else\r\n\t\tgl_PointSize = size;\r\n\t#endif\r\n\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\t#include <worldpos_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",vl="uniform vec3 color;\r\nuniform float opacity;\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <fog_pars_fragment>\r\n#include <bsdfs>\r\n#include <lights_pars>\r\n#include <shadowmap_pars_fragment>\r\n#include <shadowmask_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\r\n\r\n\t#include <fog_fragment>\r\n\r\n}\r\n",gl="#include <fog_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <begin_vertex>\r\n\t#include <project_vertex>\r\n\t#include <worldpos_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",yl={
  101. alphamap_fragment:gc,alphamap_pars_fragment:yc,alphatest_fragment:xc,aomap_fragment:bc,aomap_pars_fragment:_c,begin_vertex:wc,beginnormal_vertex:Mc,bsdfs:Ec,bumpmap_pars_fragment:Tc,clipping_planes_fragment:Sc,clipping_planes_pars_fragment:Ac,clipping_planes_pars_vertex:Rc,clipping_planes_vertex:Lc,color_fragment:Pc,color_pars_fragment:Cc,color_pars_vertex:Ic,color_vertex:Oc,common:Nc,cube_uv_reflection_fragment:Uc,defaultnormal_vertex:Dc,displacementmap_pars_vertex:Bc,displacementmap_vertex:Fc,emissivemap_fragment:zc,emissivemap_pars_fragment:Gc,encodings_fragment:Hc,encodings_pars_fragment:Vc,envmap_fragment:kc,envmap_pars_fragment:jc,envmap_pars_vertex:Wc,envmap_vertex:Xc,fog_vertex:qc,fog_pars_vertex:Yc,fog_fragment:Zc,fog_pars_fragment:Jc,gradientmap_pars_fragment:Qc,lightmap_fragment:Kc,lightmap_pars_fragment:$c,lights_lambert_vertex:th,lights_pars:eh,lights_phong_fragment:rh,lights_phong_pars_fragment:nh,lights_physical_fragment:ih,lights_physical_pars_fragment:ah,lights_template:oh,logdepthbuf_fragment:sh,logdepthbuf_pars_fragment:ch,logdepthbuf_pars_vertex:hh,logdepthbuf_vertex:lh,map_fragment:uh,map_pars_fragment:ph,map_particle_fragment:dh,map_particle_pars_fragment:fh,metalnessmap_fragment:mh,metalnessmap_pars_fragment:vh,morphnormal_vertex:gh,morphtarget_pars_vertex:yh,morphtarget_vertex:xh,normal_fragment:bh,normalmap_pars_fragment:_h,packing:wh,premultiplied_alpha_fragment:Mh,project_vertex:Eh,dithering_fragment:Th,dithering_pars_fragment:Sh,roughnessmap_fragment:Ah,roughnessmap_pars_fragment:Rh,shadowmap_pars_fragment:Lh,shadowmap_pars_vertex:Ph,shadowmap_vertex:Ch,shadowmask_pars_fragment:Ih,skinbase_vertex:Oh,skinning_pars_vertex:Nh,skinning_vertex:Uh,skinnormal_vertex:Dh,specularmap_fragment:Bh,specularmap_pars_fragment:Fh,tonemapping_fragment:zh,tonemapping_pars_fragment:Gh,uv_pars_fragment:Hh,uv_pars_vertex:Vh,uv_vertex:kh,uv2_pars_fragment:jh,uv2_pars_vertex:Wh,uv2_vertex:Xh,worldpos_vertex:qh,cube_frag:Yh,cube_vert:Zh,depth_frag:Jh,depth_vert:Qh,distanceRGBA_frag:Kh,distanceRGBA_vert:$h,equirect_frag:tl,equirect_vert:el,linedashed_frag:rl,linedashed_vert:nl,meshbasic_frag:il,meshbasic_vert:al,meshlambert_frag:ol,meshlambert_vert:sl,meshphong_frag:cl,meshphong_vert:hl,meshphysical_frag:ll,meshphysical_vert:ul,normal_frag:pl,normal_vert:dl,points_frag:fl,points_vert:ml,shadow_frag:vl,shadow_vert:gl},xl={basic:{uniforms:vc.merge([mc.common,mc.specularmap,mc.envmap,mc.aomap,mc.lightmap,mc.fog]),vertexShader:yl.meshbasic_vert,fragmentShader:yl.meshbasic_frag},lambert:{uniforms:vc.merge([mc.common,mc.specularmap,mc.envmap,mc.aomap,mc.lightmap,mc.emissivemap,mc.fog,mc.lights,{emissive:{value:new q(0)}}]),vertexShader:yl.meshlambert_vert,fragmentShader:yl.meshlambert_frag},phong:{uniforms:vc.merge([mc.common,mc.specularmap,mc.envmap,mc.aomap,mc.lightmap,mc.emissivemap,mc.bumpmap,mc.normalmap,mc.displacementmap,mc.gradientmap,mc.fog,mc.lights,{emissive:{value:new q(0)},specular:{value:new q(1118481)},shininess:{value:30}}]),vertexShader:yl.meshphong_vert,fragmentShader:yl.meshphong_frag},standard:{uniforms:vc.merge([mc.common,mc.envmap,mc.aomap,mc.lightmap,mc.emissivemap,mc.bumpmap,mc.normalmap,mc.displacementmap,mc.roughnessmap,mc.metalnessmap,mc.fog,mc.lights,{emissive:{value:new q(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:yl.meshphysical_vert,fragmentShader:yl.meshphysical_frag},points:{uniforms:vc.merge([mc.points,mc.fog]),vertexShader:yl.points_vert,fragmentShader:yl.points_frag},dashed:{uniforms:vc.merge([mc.common,mc.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:yl.linedashed_vert,fragmentShader:yl.linedashed_frag},depth:{uniforms:vc.merge([mc.common,mc.displacementmap]),vertexShader:yl.depth_vert,fragmentShader:yl.depth_frag},normal:{uniforms:vc.merge([mc.common,mc.bumpmap,mc.normalmap,mc.displacementmap,{opacity:{value:1}}]),vertexShader:yl.normal_vert,fragmentShader:yl.normal_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:yl.cube_vert,fragmentShader:yl.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:yl.equirect_vert,fragmentShader:yl.equirect_frag},distanceRGBA:{uniforms:vc.merge([mc.common,mc.displacementmap,{referencePosition:{value:new a},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:yl.distanceRGBA_vert,fragmentShader:yl.distanceRGBA_frag},shadow:{uniforms:vc.merge([mc.lights,mc.fog,{color:{value:new q(0)},opacity:{value:1}}]),vertexShader:yl.shadow_vert,fragmentShader:yl.shadow_frag}};xl.physical={uniforms:vc.merge([xl.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:yl.meshphysical_vert,fragmentShader:yl.meshphysical_frag},Object.assign(Y.prototype,{set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,r=t.length;e<r;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(){var t=new r;return function(e,r){var n=t.copy(r).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=+(1/0),this.max.x=this.max.y=-(1/0),this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(t){var e=t||new r;return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){var e=t||new r;return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){var n=e||new r;return n.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)},clampPoint:function(t,e){var n=e||new r;return n.copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new r;return function(e){var r=t.copy(e).clamp(this.min,this.max);return r.sub(e).length()}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}),J.prototype=Object.create(s.prototype),J.prototype.constructor=J;var bl=0;K.prototype=Object.assign(Object.create(e.prototype),{constructor:K,isMaterial:!0,onBeforeCompile:function(){},setValues:function(t){if(void 0!==t)for(var e in t){var r=t[e];if(void 0!==r)if("shading"!==e){var n=this[e];void 0!==n?n&&n.isColor?n.set(r):n&&n.isVector3&&r&&r.isVector3?n.copy(r):"overdraw"===e?this[e]=Number(r):this[e]=r:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=r===eo;else console.warn("THREE.Material: '"+e+"' parameter is undefined.")}},toJSON:function(t){function e(t){var e=[];for(var r in t){var n=t[r];delete n.metadata,e.push(n)}return e}var r=void 0===t||"string"==typeof t;r&&(t={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearCoat&&(n.clearCoat=this.clearCoat),void 0!==this.clearCoatRoughness&&(n.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,n.reflectivity=this.reflectivity),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==so&&(n.blending=this.blending),this.flatShading===!0&&(n.flatShading=this.flatShading),this.side!==Ka&&(n.side=this.side),this.vertexColors!==no&&(n.vertexColors=this.vertexColors),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,0!==this.rotation&&(n.rotation=this.rotation),1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),this.morphTargets===!0&&(n.morphTargets=!0),this.skinning===!0&&(n.skinning=!0),this.visible===!1&&(n.visible=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),r){var i=e(t.textures),a=e(t.images);i.length>0&&(n.textures=i),a.length>0&&(n.images=a)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.lights=t.lights,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.overdraw=t.overdraw,this.visible=t.visible,this.userData=JSON.parse(JSON.stringify(t.userData)),this.clipShadows=t.clipShadows,this.clipIntersection=t.clipIntersection;var e=t.clippingPlanes,r=null;if(null!==e){var n=e.length;r=new Array(n);for(var i=0;i!==n;++i)r[i]=e[i].clone()}return this.clippingPlanes=r,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),$.prototype=Object.create(K.prototype),$.prototype.constructor=$,$.prototype.isMeshDepthMaterial=!0,$.prototype.copy=function(t){return K.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},tt.prototype=Object.create(K.prototype),tt.prototype.constructor=tt,tt.prototype.isMeshDistanceMaterial=!0,tt.prototype.copy=function(t){return K.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this},Object.assign(et.prototype,{isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=+(1/0),r=+(1/0),n=+(1/0),i=-(1/0),a=-(1/0),o=-(1/0),s=0,c=t.length;s<c;s+=3){var h=t[s],l=t[s+1],u=t[s+2];h<e&&(e=h),l<r&&(r=l),u<n&&(n=u),h>i&&(i=h),l>a&&(a=l),u>o&&(o=u)}return this.min.set(e,r,n),this.max.set(i,a,o),this},setFromBufferAttribute:function(t){for(var e=+(1/0),r=+(1/0),n=+(1/0),i=-(1/0),a=-(1/0),o=-(1/0),s=0,c=t.count;s<c;s++){var h=t.getX(s),l=t.getY(s),u=t.getZ(s);h<e&&(e=h),l<r&&(r=l),u<n&&(n=u),h>i&&(i=h),l>a&&(a=l),u>o&&(o=u)}return this.min.set(e,r,n),this.max.set(i,a,o),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,r=t.length;e<r;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(){var t=new a;return function(e,r){var n=t.copy(r).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}}(),setFromObject:function(t){return this.makeEmpty(),this.expandByObject(t)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=+(1/0),this.max.x=this.max.y=this.max.z=-(1/0),this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(t){var e=t||new a;return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){var e=t||new a;return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},expandByObject:function(){function t(t){var a=t.geometry;if(void 0!==a)if(a.isGeometry){var o=a.vertices;for(r=0,n=o.length;r<n;r++)i.copy(o[r]),i.applyMatrix4(t.matrixWorld),e.expandByPoint(i)}else if(a.isBufferGeometry){var s=a.attributes.position;if(void 0!==s)for(r=0,n=s.count;r<n;r++)i.fromBufferAttribute(s,r).applyMatrix4(t.matrixWorld),e.expandByPoint(i)}}var e,r,n,i=new a;return function(r){return e=this,r.updateMatrixWorld(!0),r.traverse(t),this}}(),containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){var r=e||new a;return r.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},intersectsSphere:function(){var t=new a;return function(e){return this.clampPoint(e.center,t),t.distanceToSquared(e.center)<=e.radius*e.radius}}(),intersectsPlane:function(t){var e,r;return t.normal.x>0?(e=t.normal.x*this.min.x,r=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,r=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,r+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,r+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,r+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,r+=t.normal.z*this.min.z),e<=t.constant&&r>=t.constant},clampPoint:function(t,e){var r=e||new a;return r.copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new a;return function(e){var r=t.copy(e).clamp(this.min,this.max);return r.sub(e).length()}}(),getBoundingSphere:function(){var t=new a;return function(e){var r=e||new rt;return this.getCenter(r.center),r.radius=.5*this.getSize(t).length(),r}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(){var t=[new a,new a,new a,new a,new a,new a,new a,new a];return function(e){return this.isEmpty()?this:(t[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),t[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),t[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),t[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),t[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),t[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),t[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),t[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(t),this)}}(),translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}),Object.assign(rt.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(){var t=new et;return function(e,r){var n=this.center;void 0!==r?n.copy(r):t.setFromPoints(e).getCenter(n);for(var i=0,a=0,o=e.length;a<o;a++)i=Math.max(i,n.distanceToSquared(e[a]));return this.radius=Math.sqrt(i),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return this.radius<=0},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,e){var r=this.center.distanceToSquared(t),n=e||new a;return n.copy(t),r>this.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n},getBoundingBox:function(t){var e=t||new et;return e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}}),Object.assign(nt.prototype,{set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,r,n){return this.normal.set(t,e,r),this.constant=n,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(){var t=new a,e=new a;return function(r,n,i){var a=t.subVectors(i,n).cross(e.subVectors(r,n)).normalize();return this.setFromNormalAndCoplanarPoint(a,r),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){var r=e||new a;return r.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(){var t=new a;return function(e,r){var n=r||new a,i=e.delta(t),o=this.normal.dot(i);if(0!==o){var s=-(e.start.dot(this.normal)+this.constant)/o;if(!(s<0||s>1))return n.copy(i).multiplyScalar(s).add(e.start)}else if(0===this.distanceToPoint(e.start))return n.copy(e.start)}}(),intersectsLine:function(t){var e=this.distanceToPoint(t.start),r=this.distanceToPoint(t.end);return e<0&&r>0||r<0&&e>0},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){var e=t||new a;return e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var t=new a,e=new o;return function(r,n){var i=n||e.getNormalMatrix(r),a=this.coplanarPoint(t).applyMatrix4(r),o=this.normal.applyMatrix3(i).normalize();return this.constant=-a.dot(o),this}}(),translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}}),Object.assign(it.prototype,{set:function(t,e,r,n,i,a){var o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(r),o[3].copy(n),o[4].copy(i),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,r=0;r<6;r++)e[r].copy(t.planes[r]);return this},setFromMatrix:function(t){var e=this.planes,r=t.elements,n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],c=r[5],h=r[6],l=r[7],u=r[8],p=r[9],d=r[10],f=r[11],m=r[12],v=r[13],g=r[14],y=r[15];return e[0].setComponents(o-n,l-s,f-u,y-m).normalize(),e[1].setComponents(o+n,l+s,f+u,y+m).normalize(),e[2].setComponents(o+i,l+c,f+p,y+v).normalize(),e[3].setComponents(o-i,l-c,f-p,y-v).normalize(),e[4].setComponents(o-a,l-h,f-d,y-g).normalize(),e[5].setComponents(o+a,l+h,f+d,y+g).normalize(),this},intersectsObject:function(){var t=new rt;return function(e){var r=e.geometry;return null===r.boundingSphere&&r.computeBoundingSphere(),t.copy(r.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(t)}}(),intersectsSprite:function(){var t=new rt;return function(e){return t.center.set(0,0,0),t.radius=.7071067811865476,t.applyMatrix4(e.matrixWorld),this.intersectsSphere(t)}}(),intersectsSphere:function(t){for(var e=this.planes,r=t.center,n=-t.radius,i=0;i<6;i++){var a=e[i].distanceToPoint(r);if(a<n)return!1}return!0},intersectsBox:function(){var t=new a,e=new a;return function(r){for(var n=this.planes,i=0;i<6;i++){var a=n[i];t.x=a.normal.x>0?r.min.x:r.max.x,e.x=a.normal.x>0?r.max.x:r.min.x,t.y=a.normal.y>0?r.min.y:r.max.y,e.y=a.normal.y>0?r.max.y:r.min.y,t.z=a.normal.z>0?r.min.z:r.max.z,e.z=a.normal.z>0?r.max.z:r.min.z;var o=a.distanceToPoint(t),s=a.distanceToPoint(e);if(o<0&&s<0)return!1}return!0}}(),containsPoint:function(t){for(var e=this.planes,r=0;r<6;r++)if(e[r].distanceToPoint(t)<0)return!1;return!0}}),st.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],st.DefaultOrder="XYZ",Object.defineProperties(st.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback()}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback()}}}),Object.assign(st.prototype,{isEuler:!0,set:function(t,e,r,n){return this._x=t,this._y=e,this._z=r,this._order=n||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this.onChangeCallback(),this},setFromRotationMatrix:function(t,e,r){var n=ac.clamp,i=t.elements,a=i[0],o=i[4],s=i[8],c=i[1],h=i[5],l=i[9],u=i[2],p=i[6],d=i[10];return e=e||this._order,"XYZ"===e?(this._y=Math.asin(n(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(p,h),this._z=0)):"YXZ"===e?(this._x=Math.asin(-n(l,-1,1)),Math.abs(l)<.99999?(this._y=Math.atan2(s,d),this._z=Math.atan2(c,h)):(this._y=Math.atan2(-u,a),this._z=0)):"ZXY"===e?(this._x=Math.asin(n(p,-1,1)),Math.abs(p)<.99999?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-o,h)):(this._y=0,this._z=Math.atan2(c,a))):"ZYX"===e?(this._y=Math.asin(-n(u,-1,1)),Math.abs(u)<.99999?(this._x=Math.atan2(p,d),this._z=Math.atan2(c,a)):(this._x=0,this._z=Math.atan2(-o,h))):"YZX"===e?(this._z=Math.asin(n(c,-1,1)),Math.abs(c)<.99999?(this._x=Math.atan2(-l,h),this._y=Math.atan2(-u,a)):(this._x=0,this._y=Math.atan2(s,d))):"XZY"===e?(this._z=Math.asin(-n(o,-1,1)),Math.abs(o)<.99999?(this._x=Math.atan2(p,h),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-l,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,r!==!1&&this.onChangeCallback(),this},setFromQuaternion:function(){var t=new n;return function(e,r,n){return t.makeRotationFromQuaternion(e),this.setFromRotationMatrix(t,r,n)}}(),setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(){var t=new i;return function(e){return t.setFromEuler(this),this.setFromQuaternion(t,e)}}(),equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new a(this._x,this._y,this._z)},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),Object.assign(ct.prototype,{set:function(t){this.mask=1<<t|0},enable:function(t){this.mask|=1<<t|0},toggle:function(t){this.mask^=1<<t|0},disable:function(t){this.mask&=~(1<<t|0)},test:function(t){return 0!==(this.mask&t.mask)}});var _l=0;ht.DefaultUp=new a(0,1,0),ht.DefaultMatrixAutoUpdate=!0,ht.prototype=Object.assign(Object.create(e.prototype),{constructor:ht,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(t){this.matrix.multiplyMatrices(t,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(t){return this.quaternion.premultiply(t),this},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(){var t=new i;return function(e,r){return t.setFromAxisAngle(e,r),this.quaternion.multiply(t),this}}(),rotateOnWorldAxis:function(){var t=new i;return function(e,r){return t.setFromAxisAngle(e,r),this.quaternion.premultiply(t),this}}(),rotateX:function(){var t=new a(1,0,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateY:function(){var t=new a(0,1,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateZ:function(){var t=new a(0,0,1);return function(e){return this.rotateOnAxis(t,e)}}(),translateOnAxis:function(){var t=new a;return function(e,r){return t.copy(e).applyQuaternion(this.quaternion),this.position.add(t.multiplyScalar(r)),this}}(),translateX:function(){var t=new a(1,0,0);return function(e){return this.translateOnAxis(t,e)}}(),translateY:function(){var t=new a(0,1,0);return function(e){return this.translateOnAxis(t,e)}}(),translateZ:function(){var t=new a(0,0,1);return function(e){return this.translateOnAxis(t,e)}}(),localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var t=new n;return function(e){return e.applyMatrix4(t.getInverse(this.matrixWorld))}}(),lookAt:function(){var t=new n,e=new a;return function(r,n,i){r.isVector3?e.copy(r):e.set(r,n,i),this.isCamera?t.lookAt(this.position,e,this.up):t.lookAt(e,this.position,this.up),this.quaternion.setFromRotationMatrix(t)}}(),add:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,t.dispatchEvent({type:"added"}),this.children.push(t)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)},remove:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}var r=this.children.indexOf(t);return r!==-1&&(t.parent=null,t.dispatchEvent({type:"removed"}),this.children.splice(r,1)),this},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(var r=0,n=this.children.length;r<n;r++){var i=this.children[r],a=i.getObjectByProperty(t,e);if(void 0!==a)return a}},getWorldPosition:function(t){var e=t||new a;return this.updateMatrixWorld(!0),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var t=new a,e=new a;return function(r){var n=r||new i;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(t,n,e),n}}(),getWorldRotation:function(){var t=new i;return function(e){var r=e||new st;return this.getWorldQuaternion(t),r.setFromQuaternion(t,this.rotation.order,!1)}}(),getWorldScale:function(){var t=new a,e=new i;return function(r){var n=r||new a;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(t,e,n),n}}(),getWorldDirection:function(){var t=new i;return function(e){var r=e||new a;return this.getWorldQuaternion(t),r.set(0,0,1).applyQuaternion(t)}}(),raycast:function(){},traverse:function(t){t(this);for(var e=this.children,r=0,n=e.length;r<n;r++)e[r].traverse(t)},traverseVisible:function(t){if(this.visible!==!1){t(this);for(var e=this.children,r=0,n=e.length;r<n;r++)e[r].traverseVisible(t)}},traverseAncestors:function(t){var e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(var e=this.children,r=0,n=e.length;r<n;r++)e[r].updateMatrixWorld(t)},toJSON:function(t){function e(e,r){return void 0===e[r.uuid]&&(e[r.uuid]=r.toJSON(t)),r.uuid}function r(t){var e=[];for(var r in t){var n=t[r];delete n.metadata,e.push(n)}return e}var n=void 0===t||"string"==typeof t,i={};n&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var a={};if(a.uuid=this.uuid,a.type=this.type,""!==this.name&&(a.name=this.name),this.castShadow===!0&&(a.castShadow=!0),this.receiveShadow===!0&&(a.receiveShadow=!0),this.visible===!1&&(a.visible=!1),"{}"!==JSON.stringify(this.userData)&&(a.userData=this.userData),a.matrix=this.matrix.toArray(),void 0!==this.geometry){a.geometry=e(t.geometries,this.geometry);var o=this.geometry.parameters;if(void 0!==o&&void 0!==o.shapes){var s=o.shapes;if(Array.isArray(s))for(var c=0,h=s.length;c<h;c++){
  102. var l=s[c];e(t.shapes,l)}else e(t.shapes,s)}}if(void 0!==this.material)if(Array.isArray(this.material)){for(var u=[],c=0,h=this.material.length;c<h;c++)u.push(e(t.materials,this.material[c]));a.material=u}else a.material=e(t.materials,this.material);if(this.children.length>0){a.children=[];for(var c=0;c<this.children.length;c++)a.children.push(this.children[c].toJSON(t).object)}if(n){var p=r(t.geometries),d=r(t.materials),f=r(t.textures),m=r(t.images),s=r(t.shapes);p.length>0&&(i.geometries=p),d.length>0&&(i.materials=d),f.length>0&&(i.textures=f),m.length>0&&(i.images=m),s.length>0&&(i.shapes=s)}return i.object=a,i},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(var r=0;r<t.children.length;r++){var n=t.children[r];this.add(n.clone())}return this}}),lt.prototype=Object.assign(Object.create(ht.prototype),{constructor:lt,isCamera:!0,copy:function(t,e){return ht.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this},getWorldDirection:function(){var t=new i;return function(e){var r=e||new a;return this.getWorldQuaternion(t),r.set(0,0,-1).applyQuaternion(t)}}(),updateMatrixWorld:function(t){ht.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),ut.prototype=Object.assign(Object.create(lt.prototype),{constructor:ut,isOrthographicCamera:!0,copy:function(t,e){return lt.prototype.copy.call(this,t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,e,r,n,i,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=r,this.view.offsetY=n,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,n=(this.top+this.bottom)/2,i=r-t,a=r+t,o=n+e,s=n-e;if(null!==this.view&&this.view.enabled){var c=this.zoom/(this.view.width/this.view.fullWidth),h=this.zoom/(this.view.height/this.view.fullHeight),l=(this.right-this.left)/this.view.width,u=(this.top-this.bottom)/this.view.height;i+=l*(this.view.offsetX/c),a=i+l*(this.view.width/c),o-=u*(this.view.offsetY/h),s=o-u*(this.view.height/h)}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far)},toJSON:function(t){var e=ht.prototype.toJSON.call(this,t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}),Object.assign(pt.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var e=0,r=t.vertexNormals.length;e<r;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(var e=0,r=t.vertexColors.length;e<r;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}});var wl=0;dt.prototype=Object.assign(Object.create(e.prototype),{constructor:dt,isGeometry:!0,applyMatrix:function(t){for(var e=(new o).getNormalMatrix(t),r=0,n=this.vertices.length;r<n;r++){var i=this.vertices[r];i.applyMatrix4(t)}for(var r=0,n=this.faces.length;r<n;r++){var a=this.faces[r];a.normal.applyMatrix3(e).normalize();for(var s=0,c=a.vertexNormals.length;s<c;s++)a.vertexNormals[s].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(){var t=new n;return function(e){return t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t=new n;return function(e){return t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t=new n;return function(e){return t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t=new n;return function(e,r,n){return t.makeTranslation(e,r,n),this.applyMatrix(t),this}}(),scale:function(){var t=new n;return function(e,r,n){return t.makeScale(e,r,n),this.applyMatrix(t),this}}(),lookAt:function(){var t=new ht;return function(e){t.lookAt(e),t.updateMatrix(),this.applyMatrix(t.matrix)}}(),fromBufferGeometry:function(t){function e(t,e,r,i){var a=void 0!==c?[p[t].clone(),p[e].clone(),p[r].clone()]:[],o=void 0!==h?[n.colors[t].clone(),n.colors[e].clone(),n.colors[r].clone()]:[],s=new pt(t,e,r,a,o,i);n.faces.push(s),void 0!==l&&n.faceVertexUvs[0].push([d[t].clone(),d[e].clone(),d[r].clone()]),void 0!==u&&n.faceVertexUvs[1].push([f[t].clone(),f[e].clone(),f[r].clone()])}var n=this,i=null!==t.index?t.index.array:void 0,o=t.attributes,s=o.position.array,c=void 0!==o.normal?o.normal.array:void 0,h=void 0!==o.color?o.color.array:void 0,l=void 0!==o.uv?o.uv.array:void 0,u=void 0!==o.uv2?o.uv2.array:void 0;void 0!==u&&(this.faceVertexUvs[1]=[]);for(var p=[],d=[],f=[],m=0,v=0;m<s.length;m+=3,v+=2)n.vertices.push(new a(s[m],s[m+1],s[m+2])),void 0!==c&&p.push(new a(c[m],c[m+1],c[m+2])),void 0!==h&&n.colors.push(new q(h[m],h[m+1],h[m+2])),void 0!==l&&d.push(new r(l[v],l[v+1])),void 0!==u&&f.push(new r(u[v],u[v+1]));var g=t.groups;if(g.length>0)for(var m=0;m<g.length;m++)for(var y=g[m],x=y.start,b=y.count,v=x,_=x+b;v<_;v+=3)void 0!==i?e(i[v],i[v+1],i[v+2],y.materialIndex):e(v,v+1,v+2,y.materialIndex);else if(void 0!==i)for(var m=0;m<i.length;m+=3)e(i[m],i[m+1],i[m+2]);else for(var m=0;m<s.length/3;m+=3)e(m,m+1,m+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:function(){this.computeBoundingBox();var t=this.boundingBox.getCenter().negate();return this.translate(t.x,t.y,t.z),t},normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=this.boundingSphere.radius,r=0===e?1:1/e,i=new n;return i.set(r,0,0,-r*t.x,0,r,0,-r*t.y,0,0,r,-r*t.z,0,0,0,1),this.applyMatrix(i),this},computeFaceNormals:function(){for(var t=new a,e=new a,r=0,n=this.faces.length;r<n;r++){var i=this.faces[r],o=this.vertices[i.a],s=this.vertices[i.b],c=this.vertices[i.c];t.subVectors(c,s),e.subVectors(o,s),t.cross(e),t.normalize(),i.normal.copy(t)}},computeVertexNormals:function(t){void 0===t&&(t=!0);var e,r,n,i,o,s;for(s=new Array(this.vertices.length),e=0,r=this.vertices.length;e<r;e++)s[e]=new a;if(t){var c,h,l,u=new a,p=new a;for(n=0,i=this.faces.length;n<i;n++)o=this.faces[n],c=this.vertices[o.a],h=this.vertices[o.b],l=this.vertices[o.c],u.subVectors(l,h),p.subVectors(c,h),u.cross(p),s[o.a].add(u),s[o.b].add(u),s[o.c].add(u)}else for(this.computeFaceNormals(),n=0,i=this.faces.length;n<i;n++)o=this.faces[n],s[o.a].add(o.normal),s[o.b].add(o.normal),s[o.c].add(o.normal);for(e=0,r=this.vertices.length;e<r;e++)s[e].normalize();for(n=0,i=this.faces.length;n<i;n++){o=this.faces[n];var d=o.vertexNormals;3===d.length?(d[0].copy(s[o.a]),d[1].copy(s[o.b]),d[2].copy(s[o.c])):(d[0]=s[o.a].clone(),d[1]=s[o.b].clone(),d[2]=s[o.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,e,r;for(this.computeFaceNormals(),t=0,e=this.faces.length;t<e;t++){r=this.faces[t];var n=r.vertexNormals;3===n.length?(n[0].copy(r.normal),n[1].copy(r.normal),n[2].copy(r.normal)):(n[0]=r.normal.clone(),n[1]=r.normal.clone(),n[2]=r.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,r,n,i;for(r=0,n=this.faces.length;r<n;r++)for(i=this.faces[r],i.__originalFaceNormal?i.__originalFaceNormal.copy(i.normal):i.__originalFaceNormal=i.normal.clone(),i.__originalVertexNormals||(i.__originalVertexNormals=[]),t=0,e=i.vertexNormals.length;t<e;t++)i.__originalVertexNormals[t]?i.__originalVertexNormals[t].copy(i.vertexNormals[t]):i.__originalVertexNormals[t]=i.vertexNormals[t].clone();var o=new dt;for(o.faces=this.faces,t=0,e=this.morphTargets.length;t<e;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];var s,c,h=this.morphNormals[t].faceNormals,l=this.morphNormals[t].vertexNormals;for(r=0,n=this.faces.length;r<n;r++)s=new a,c={a:new a,b:new a,c:new a},h.push(s),l.push(c)}var u=this.morphNormals[t];o.vertices=this.morphTargets[t].vertices,o.computeFaceNormals(),o.computeVertexNormals();var s,c;for(r=0,n=this.faces.length;r<n;r++)i=this.faces[r],s=u.faceNormals[r],c=u.vertexNormals[r],s.copy(i.normal),c.a.copy(i.vertexNormals[0]),c.b.copy(i.vertexNormals[1]),c.c.copy(i.vertexNormals[2])}for(r=0,n=this.faces.length;r<n;r++)i=this.faces[r],i.normal=i.__originalFaceNormal,i.vertexNormals=i.__originalVertexNormals},computeLineDistances:function(){for(var t=0,e=this.vertices,r=0,n=e.length;r<n;r++)r>0&&(t+=e[r].distanceTo(e[r-1])),this.lineDistances[r]=t},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new et),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new rt),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,r){if(!t||!t.isGeometry)return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t);var n,i=this.vertices.length,a=this.vertices,s=t.vertices,c=this.faces,h=t.faces,l=this.faceVertexUvs[0],u=t.faceVertexUvs[0],p=this.colors,d=t.colors;void 0===r&&(r=0),void 0!==e&&(n=(new o).getNormalMatrix(e));for(var f=0,m=s.length;f<m;f++){var v=s[f],g=v.clone();void 0!==e&&g.applyMatrix4(e),a.push(g)}for(var f=0,m=d.length;f<m;f++)p.push(d[f].clone());for(f=0,m=h.length;f<m;f++){var y,x,b,_=h[f],w=_.vertexNormals,M=_.vertexColors;y=new pt(_.a+i,_.b+i,_.c+i),y.normal.copy(_.normal),void 0!==n&&y.normal.applyMatrix3(n).normalize();for(var E=0,T=w.length;E<T;E++)x=w[E].clone(),void 0!==n&&x.applyMatrix3(n).normalize(),y.vertexNormals.push(x);y.color.copy(_.color);for(var E=0,T=M.length;E<T;E++)b=M[E],y.vertexColors.push(b.clone());y.materialIndex=_.materialIndex+r,c.push(y)}for(f=0,m=u.length;f<m;f++){var S=u[f],A=[];if(void 0!==S){for(var E=0,T=S.length;E<T;E++)A.push(S[E].clone());l.push(A)}}},mergeMesh:function(t){return t&&t.isMesh?(t.matrixAutoUpdate&&t.updateMatrix(),void this.merge(t.geometry,t.matrix)):void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t)},mergeVertices:function(){var t,e,r,n,i,a,o,s,c={},h=[],l=[],u=4,p=Math.pow(10,u);for(r=0,n=this.vertices.length;r<n;r++)t=this.vertices[r],e=Math.round(t.x*p)+"_"+Math.round(t.y*p)+"_"+Math.round(t.z*p),void 0===c[e]?(c[e]=r,h.push(this.vertices[r]),l[r]=h.length-1):l[r]=l[c[e]];var d=[];for(r=0,n=this.faces.length;r<n;r++){i=this.faces[r],i.a=l[i.a],i.b=l[i.b],i.c=l[i.c],a=[i.a,i.b,i.c];for(var f=0;f<3;f++)if(a[f]===a[(f+1)%3]){d.push(r);break}}for(r=d.length-1;r>=0;r--){var m=d[r];for(this.faces.splice(m,1),o=0,s=this.faceVertexUvs.length;o<s;o++)this.faceVertexUvs[o].splice(m,1)}var v=this.vertices.length-h.length;return this.vertices=h,v},setFromPoints:function(t){this.vertices=[];for(var e=0,r=t.length;e<r;e++){var n=t[e];this.vertices.push(new a(n.x,n.y,n.z||0))}return this},sortFacesByMaterialIndex:function(){function t(t,e){return t.materialIndex-e.materialIndex}for(var e=this.faces,r=e.length,n=0;n<r;n++)e[n]._id=n;e.sort(t);var i,a,o=this.faceVertexUvs[0],s=this.faceVertexUvs[1];o&&o.length===r&&(i=[]),s&&s.length===r&&(a=[]);for(var n=0;n<r;n++){var c=e[n]._id;i&&i.push(o[c]),a&&a.push(s[c])}i&&(this.faceVertexUvs[0]=i),a&&(this.faceVertexUvs[1]=a)},toJSON:function(){function t(t,e,r){return r?t|1<<e:t&~(1<<e)}function e(t){var e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==p[e]?p[e]:(p[e]=u.length/3,u.push(t.x,t.y,t.z),p[e])}function r(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==f[e]?f[e]:(f[e]=d.length,d.push(t.getHex()),f[e])}function n(t){var e=t.x.toString()+t.y.toString();return void 0!==v[e]?v[e]:(v[e]=m.length/2,m.push(t.x,t.y),v[e])}var i={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),void 0!==this.parameters){var a=this.parameters;for(var o in a)void 0!==a[o]&&(i[o]=a[o]);return i}for(var s=[],c=0;c<this.vertices.length;c++){var h=this.vertices[c];s.push(h.x,h.y,h.z)}for(var l=[],u=[],p={},d=[],f={},m=[],v={},c=0;c<this.faces.length;c++){var g=this.faces[c],y=!0,x=!1,b=void 0!==this.faceVertexUvs[0][c],_=g.normal.length()>0,w=g.vertexNormals.length>0,M=1!==g.color.r||1!==g.color.g||1!==g.color.b,E=g.vertexColors.length>0,T=0;if(T=t(T,0,0),T=t(T,1,y),T=t(T,2,x),T=t(T,3,b),T=t(T,4,_),T=t(T,5,w),T=t(T,6,M),T=t(T,7,E),l.push(T),l.push(g.a,g.b,g.c),l.push(g.materialIndex),b){var S=this.faceVertexUvs[0][c];l.push(n(S[0]),n(S[1]),n(S[2]))}if(_&&l.push(e(g.normal)),w){var A=g.vertexNormals;l.push(e(A[0]),e(A[1]),e(A[2]))}if(M&&l.push(r(g.color)),E){var R=g.vertexColors;l.push(r(R[0]),r(R[1]),r(R[2]))}}return i.data={},i.data.vertices=s,i.data.normals=u,d.length>0&&(i.data.colors=d),m.length>0&&(i.data.uvs=[m]),i.data.faces=l,i},clone:function(){return(new dt).copy(this)},copy:function(t){var e,r,n,i,a,o;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var s=t.vertices;for(e=0,r=s.length;e<r;e++)this.vertices.push(s[e].clone());var c=t.colors;for(e=0,r=c.length;e<r;e++)this.colors.push(c[e].clone());var h=t.faces;for(e=0,r=h.length;e<r;e++)this.faces.push(h[e].clone());for(e=0,r=t.faceVertexUvs.length;e<r;e++){var l=t.faceVertexUvs[e];for(void 0===this.faceVertexUvs[e]&&(this.faceVertexUvs[e]=[]),n=0,i=l.length;n<i;n++){var u=l[n],p=[];for(a=0,o=u.length;a<o;a++){var d=u[a];p.push(d.clone())}this.faceVertexUvs[e].push(p)}}var f=t.morphTargets;for(e=0,r=f.length;e<r;e++){var m={};if(m.name=f[e].name,void 0!==f[e].vertices)for(m.vertices=[],n=0,i=f[e].vertices.length;n<i;n++)m.vertices.push(f[e].vertices[n].clone());if(void 0!==f[e].normals)for(m.normals=[],n=0,i=f[e].normals.length;n<i;n++)m.normals.push(f[e].normals[n].clone());this.morphTargets.push(m)}var v=t.morphNormals;for(e=0,r=v.length;e<r;e++){var g={};if(void 0!==v[e].vertexNormals)for(g.vertexNormals=[],n=0,i=v[e].vertexNormals.length;n<i;n++){var y=v[e].vertexNormals[n],x={};x.a=y.a.clone(),x.b=y.b.clone(),x.c=y.c.clone(),g.vertexNormals.push(x)}if(void 0!==v[e].faceNormals)for(g.faceNormals=[],n=0,i=v[e].faceNormals.length;n<i;n++)g.faceNormals.push(v[e].faceNormals[n].clone());this.morphNormals.push(g)}var b=t.skinWeights;for(e=0,r=b.length;e<r;e++)this.skinWeights.push(b[e].clone());var _=t.skinIndices;for(e=0,r=_.length;e<r;e++)this.skinIndices.push(_[e].clone());var w=t.lineDistances;for(e=0,r=w.length;e<r;e++)this.lineDistances.push(w[e]);var M=t.boundingBox;null!==M&&(this.boundingBox=M.clone());var E=t.boundingSphere;return null!==E&&(this.boundingSphere=E.clone()),this.elementsNeedUpdate=t.elementsNeedUpdate,this.verticesNeedUpdate=t.verticesNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.lineDistancesNeedUpdate=t.lineDistancesNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(ft.prototype,"needsUpdate",{set:function(t){t===!0&&this.version++}}),Object.assign(ft.prototype,{isBufferAttribute:!0,setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==t?t.length/this.itemSize:0,this.array=t},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.dynamic=t.dynamic,this},copyAt:function(t,e,r){t*=this.itemSize,r*=e.itemSize;for(var n=0,i=this.itemSize;n<i;n++)this.array[t+n]=e.array[r+n];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var e=this.array,r=0,n=0,i=t.length;n<i;n++){var a=t[n];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",n),a=new q),e[r++]=a.r,e[r++]=a.g,e[r++]=a.b}return this},copyIndicesArray:function(t){for(var e=this.array,r=0,n=0,i=t.length;n<i;n++){var a=t[n];e[r++]=a.a,e[r++]=a.b,e[r++]=a.c}return this},copyVector2sArray:function(t){for(var e=this.array,n=0,i=0,a=t.length;i<a;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),o=new r),e[n++]=o.x,e[n++]=o.y}return this},copyVector3sArray:function(t){for(var e=this.array,r=0,n=0,i=t.length;n<i;n++){var o=t[n];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",n),o=new a),e[r++]=o.x,e[r++]=o.y,e[r++]=o.z}return this},copyVector4sArray:function(t){for(var e=this.array,r=0,n=0,i=t.length;n<i;n++){var a=t[n];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",n),a=new c),e[r++]=a.x,e[r++]=a.y,e[r++]=a.z,e[r++]=a.w}return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=r,this},setXYZ:function(t,e,r,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=r,this.array[t+2]=n,this},setXYZW:function(t,e,r,n,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=r,this.array[t+2]=n,this.array[t+3]=i,this},onUpload:function(t){return this.onUploadCallback=t,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)}}),mt.prototype=Object.create(ft.prototype),mt.prototype.constructor=mt,vt.prototype=Object.create(ft.prototype),vt.prototype.constructor=vt,gt.prototype=Object.create(ft.prototype),gt.prototype.constructor=gt,yt.prototype=Object.create(ft.prototype),yt.prototype.constructor=yt,xt.prototype=Object.create(ft.prototype),xt.prototype.constructor=xt,bt.prototype=Object.create(ft.prototype),bt.prototype.constructor=bt,_t.prototype=Object.create(ft.prototype),_t.prototype.constructor=_t,wt.prototype=Object.create(ft.prototype),wt.prototype.constructor=wt,Mt.prototype=Object.create(ft.prototype),Mt.prototype.constructor=Mt,Object.assign(Et.prototype,{computeGroups:function(t){for(var e,r=[],n=void 0,i=t.faces,a=0;a<i.length;a++){var o=i[a];o.materialIndex!==n&&(n=o.materialIndex,void 0!==e&&(e.count=3*a-e.start,r.push(e)),e={start:3*a,materialIndex:n})}void 0!==e&&(e.count=3*a-e.start,r.push(e)),this.groups=r},fromGeometry:function(t){var e,n=t.faces,i=t.vertices,a=t.faceVertexUvs,o=a[0]&&a[0].length>0,s=a[1]&&a[1].length>0,c=t.morphTargets,h=c.length;if(h>0){e=[];for(var l=0;l<h;l++)e[l]=[];this.morphTargets.position=e}var u,p=t.morphNormals,d=p.length;if(d>0){u=[];for(var l=0;l<d;l++)u[l]=[];this.morphTargets.normal=u}for(var f=t.skinIndices,m=t.skinWeights,v=f.length===i.length,g=m.length===i.length,l=0;l<n.length;l++){var y=n[l];this.vertices.push(i[y.a],i[y.b],i[y.c]);var x=y.vertexNormals;if(3===x.length)this.normals.push(x[0],x[1],x[2]);else{var b=y.normal;this.normals.push(b,b,b)}var _=y.vertexColors;if(3===_.length)this.colors.push(_[0],_[1],_[2]);else{var w=y.color;this.colors.push(w,w,w)}if(o===!0){var M=a[0][l];void 0!==M?this.uvs.push(M[0],M[1],M[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",l),this.uvs.push(new r,new r,new r))}if(s===!0){var M=a[1][l];void 0!==M?this.uvs2.push(M[0],M[1],M[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",l),this.uvs2.push(new r,new r,new r))}for(var E=0;E<h;E++){var T=c[E].vertices;e[E].push(T[y.a],T[y.b],T[y.c])}for(var E=0;E<d;E++){var S=p[E].vertexNormals[l];u[E].push(S.a,S.b,S.c)}v&&this.skinIndices.push(f[y.a],f[y.b],f[y.c]),g&&this.skinWeights.push(m[y.a],m[y.b],m[y.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this}});var Ml=1;St.prototype=Object.assign(Object.create(e.prototype),{constructor:St,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(Tt(t)>65535?_t:xt)(t,1):this.index=t},addAttribute:function(t,e){return e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),void this.setIndex(e)):(this.attributes[t]=e,this):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),void this.addAttribute(t,new ft(arguments[1],arguments[2])))},getAttribute:function(t){return this.attributes[t]},removeAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,r){this.groups.push({start:t,count:e,materialIndex:void 0!==r?r:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix:function(t){var e=this.attributes.position;void 0!==e&&(t.applyToBufferAttribute(e),e.needsUpdate=!0);var r=this.attributes.normal;if(void 0!==r){var n=(new o).getNormalMatrix(t);n.applyToBufferAttribute(r),r.needsUpdate=!0}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(){var t=new n;return function(e){return t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t=new n;return function(e){return t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t=new n;return function(e){return t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t=new n;return function(e,r,n){return t.makeTranslation(e,r,n),this.applyMatrix(t),this}}(),scale:function(){var t=new n;return function(e,r,n){return t.makeScale(e,r,n),this.applyMatrix(t),this}}(),lookAt:function(){var t=new ht;return function(e){t.lookAt(e),t.updateMatrix(),this.applyMatrix(t.matrix)}}(),center:function(){this.computeBoundingBox();var t=this.boundingBox.getCenter().negate();return this.translate(t.x,t.y,t.z),t},setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){var r=new wt(3*e.vertices.length,3),n=new wt(3*e.colors.length,3);if(this.addAttribute("position",r.copyVector3sArray(e.vertices)),this.addAttribute("color",n.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var i=new wt(e.lineDistances.length,1);this.addAttribute("lineDistance",i.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},setFromPoints:function(t){for(var e=[],r=0,n=t.length;r<n;r++){var i=t[r];e.push(i.x,i.y,i.z||0)}return this.addAttribute("position",new wt(e,3)),this},updateFromObject:function(t){var e=t.geometry;if(t.isMesh){var r=e.__directGeometry;if(e.elementsNeedUpdate===!0&&(r=void 0,e.elementsNeedUpdate=!1),void 0===r)return this.fromGeometry(e);r.verticesNeedUpdate=e.verticesNeedUpdate,r.normalsNeedUpdate=e.normalsNeedUpdate,r.colorsNeedUpdate=e.colorsNeedUpdate,r.uvsNeedUpdate=e.uvsNeedUpdate,r.groupsNeedUpdate=e.groupsNeedUpdate,e.verticesNeedUpdate=!1,e.normalsNeedUpdate=!1,e.colorsNeedUpdate=!1,e.uvsNeedUpdate=!1,e.groupsNeedUpdate=!1,e=r}var n;return e.verticesNeedUpdate===!0&&(n=this.attributes.position,void 0!==n&&(n.copyVector3sArray(e.vertices),n.needsUpdate=!0),e.verticesNeedUpdate=!1),e.normalsNeedUpdate===!0&&(n=this.attributes.normal,void 0!==n&&(n.copyVector3sArray(e.normals),n.needsUpdate=!0),e.normalsNeedUpdate=!1),e.colorsNeedUpdate===!0&&(n=this.attributes.color,void 0!==n&&(n.copyColorsArray(e.colors),n.needsUpdate=!0),e.colorsNeedUpdate=!1),e.uvsNeedUpdate&&(n=this.attributes.uv,void 0!==n&&(n.copyVector2sArray(e.uvs),n.needsUpdate=!0),e.uvsNeedUpdate=!1),e.lineDistancesNeedUpdate&&(n=this.attributes.lineDistance,void 0!==n&&(n.copyArray(e.lineDistances),n.needsUpdate=!0),e.lineDistancesNeedUpdate=!1),e.groupsNeedUpdate&&(e.computeGroups(t.geometry),this.groups=e.groups,e.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new Et).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){var e=new Float32Array(3*t.vertices.length);if(this.addAttribute("position",new ft(e,3).copyVector3sArray(t.vertices)),t.normals.length>0){var r=new Float32Array(3*t.normals.length);this.addAttribute("normal",new ft(r,3).copyVector3sArray(t.normals))}if(t.colors.length>0){var n=new Float32Array(3*t.colors.length);this.addAttribute("color",new ft(n,3).copyColorsArray(t.colors))}if(t.uvs.length>0){var i=new Float32Array(2*t.uvs.length);this.addAttribute("uv",new ft(i,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){var a=new Float32Array(2*t.uvs2.length);this.addAttribute("uv2",new ft(a,2).copyVector2sArray(t.uvs2))}if(t.indices.length>0){var o=Tt(t.indices)>65535?Uint32Array:Uint16Array,s=new o(3*t.indices.length);this.setIndex(new ft(s,1).copyIndicesArray(t.indices))}this.groups=t.groups;for(var c in t.morphTargets){for(var h=[],l=t.morphTargets[c],u=0,p=l.length;u<p;u++){var d=l[u],f=new wt(3*d.length,3);h.push(f.copyVector3sArray(d))}this.morphAttributes[c]=h}if(t.skinIndices.length>0){var m=new wt(4*t.skinIndices.length,4);this.addAttribute("skinIndex",m.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){var v=new wt(4*t.skinWeights.length,4);this.addAttribute("skinWeight",v.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new et);var t=this.attributes.position;void 0!==t?this.boundingBox.setFromBufferAttribute(t):this.boundingBox.makeEmpty(),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){var t=new et,e=new a;return function(){null===this.boundingSphere&&(this.boundingSphere=new rt);var r=this.attributes.position;if(r){var n=this.boundingSphere.center;t.setFromBufferAttribute(r),t.getCenter(n);for(var i=0,a=0,o=r.count;a<o;a++)e.x=r.getX(a),e.y=r.getY(a),e.z=r.getZ(a),i=Math.max(i,n.distanceToSquared(e));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var t=this.index,e=this.attributes,r=this.groups;if(e.position){var n=e.position.array;if(void 0===e.normal)this.addAttribute("normal",new ft(new Float32Array(n.length),3));else for(var i=e.normal.array,o=0,s=i.length;o<s;o++)i[o]=0;var c,h,l,u=e.normal.array,p=new a,d=new a,f=new a,m=new a,v=new a;if(t){var g=t.array;0===r.length&&this.addGroup(0,g.length);for(var y=0,x=r.length;y<x;++y)for(var b=r[y],_=b.start,w=b.count,o=_,s=_+w;o<s;o+=3)c=3*g[o+0],h=3*g[o+1],l=3*g[o+2],p.fromArray(n,c),d.fromArray(n,h),f.fromArray(n,l),m.subVectors(f,d),v.subVectors(p,d),m.cross(v),u[c]+=m.x,u[c+1]+=m.y,u[c+2]+=m.z,u[h]+=m.x,u[h+1]+=m.y,u[h+2]+=m.z,u[l]+=m.x,u[l+1]+=m.y,u[l+2]+=m.z}else for(var o=0,s=n.length;o<s;o+=9)p.fromArray(n,o),d.fromArray(n,o+3),f.fromArray(n,o+6),m.subVectors(f,d),v.subVectors(p,d),m.cross(v),u[o]=m.x,u[o+1]=m.y,u[o+2]=m.z,u[o+3]=m.x,u[o+4]=m.y,u[o+5]=m.z,u[o+6]=m.x,u[o+7]=m.y,u[o+8]=m.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},merge:function(t,e){if(!t||!t.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t);void 0===e&&(e=0);var r=this.attributes;for(var n in r)if(void 0!==t.attributes[n])for(var i=r[n],a=i.array,o=t.attributes[n],s=o.array,c=o.itemSize,h=0,l=c*e;h<s.length;h++,l++)a[l]=s[h];return this},normalizeNormals:function(){var t=new a;return function(){for(var e=this.attributes.normal,r=0,n=e.count;r<n;r++)t.x=e.getX(r),t.y=e.getY(r),t.z=e.getZ(r),t.normalize(),e.setXYZ(r,t.x,t.y,t.z)}}(),toNonIndexed:function(){if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new St,e=this.index.array,r=this.attributes;for(var n in r){for(var i=r[n],a=i.array,o=i.itemSize,s=new a.constructor(e.length*o),c=0,h=0,l=0,u=e.length;l<u;l++){c=e[l]*o;for(var p=0;p<o;p++)s[h++]=a[c++]}t.addAttribute(n,new ft(s,o))}return t},toJSON:function(){var t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),void 0!==this.parameters){var e=this.parameters;for(var r in e)void 0!==e[r]&&(t[r]=e[r]);return t}t.data={attributes:{}};var n=this.index;if(null!==n){var i=Array.prototype.slice.call(n.array);t.data.index={type:n.array.constructor.name,array:i}}var a=this.attributes;for(var r in a){var o=a[r],i=Array.prototype.slice.call(o.array);t.data.attributes[r]={itemSize:o.itemSize,type:o.array.constructor.name,array:i,normalized:o.normalized}}var s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));var c=this.boundingSphere;return null!==c&&(t.data.boundingSphere={center:c.center.toArray(),radius:c.radius}),t},clone:function(){return(new St).copy(this)},copy:function(t){var e,r,n;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var i=t.index;null!==i&&this.setIndex(i.clone());var a=t.attributes;for(e in a){var o=a[e];this.addAttribute(e,o.clone())}var s=t.morphAttributes;for(e in s){var c=[],h=s[e];for(r=0,n=h.length;r<n;r++)c.push(h[r].clone());this.morphAttributes[e]=c}var l=t.groups;for(r=0,n=l.length;r<n;r++){var u=l[r];this.addGroup(u.start,u.count,u.materialIndex)}var p=t.boundingBox;null!==p&&(this.boundingBox=p.clone());var d=t.boundingSphere;return null!==d&&(this.boundingSphere=d.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),At.prototype=Object.create(dt.prototype),
  103. At.prototype.constructor=At,Rt.prototype=Object.create(St.prototype),Rt.prototype.constructor=Rt,Lt.prototype=Object.create(dt.prototype),Lt.prototype.constructor=Lt,Pt.prototype=Object.create(St.prototype),Pt.prototype.constructor=Pt,Ct.prototype=Object.create(K.prototype),Ct.prototype.constructor=Ct,Ct.prototype.isMeshBasicMaterial=!0,Ct.prototype.copy=function(t){return K.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this},It.prototype=Object.create(K.prototype),It.prototype.constructor=It,It.prototype.isShaderMaterial=!0,It.prototype.copy=function(t){return K.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=vc.clone(t.uniforms),this.defines=t.defines,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=t.extensions,this},It.prototype.toJSON=function(t){var e=K.prototype.toJSON.call(this,t);return e.uniforms=this.uniforms,e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e},Object.assign(Ot.prototype,{set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){var r=e||new a;return r.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(){var t=new a;return function(e){return this.origin.copy(this.at(e,t)),this}}(),closestPointToPoint:function(t,e){var r=e||new a;r.subVectors(t,this.origin);var n=r.dot(this.direction);return n<0?r.copy(this.origin):r.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(){var t=new a;return function(e){var r=t.subVectors(e,this.origin).dot(this.direction);return r<0?this.origin.distanceToSquared(e):(t.copy(this.direction).multiplyScalar(r).add(this.origin),t.distanceToSquared(e))}}(),distanceSqToSegment:function(){var t=new a,e=new a,r=new a;return function(n,i,a,o){t.copy(n).add(i).multiplyScalar(.5),e.copy(i).sub(n).normalize(),r.copy(this.origin).sub(t);var s,c,h,l,u=.5*n.distanceTo(i),p=-this.direction.dot(e),d=r.dot(this.direction),f=-r.dot(e),m=r.lengthSq(),v=Math.abs(1-p*p);if(v>0)if(s=p*f-d,c=p*d-f,l=u*v,s>=0)if(c>=-l)if(c<=l){var g=1/v;s*=g,c*=g,h=s*(s+p*c+2*d)+c*(p*s+c+2*f)+m}else c=u,s=Math.max(0,-(p*c+d)),h=-s*s+c*(c+2*f)+m;else c=-u,s=Math.max(0,-(p*c+d)),h=-s*s+c*(c+2*f)+m;else c<=-l?(s=Math.max(0,-(-p*u+d)),c=s>0?-u:Math.min(Math.max(-u,-f),u),h=-s*s+c*(c+2*f)+m):c<=l?(s=0,c=Math.min(Math.max(-u,-f),u),h=c*(c+2*f)+m):(s=Math.max(0,-(p*u+d)),c=s>0?u:Math.min(Math.max(-u,-f),u),h=-s*s+c*(c+2*f)+m);else c=p>0?-u:u,s=Math.max(0,-(p*c+d)),h=-s*s+c*(c+2*f)+m;return a&&a.copy(this.direction).multiplyScalar(s).add(this.origin),o&&o.copy(e).multiplyScalar(c).add(t),h}}(),intersectSphere:function(){var t=new a;return function(e,r){t.subVectors(e.center,this.origin);var n=t.dot(this.direction),i=t.dot(t)-n*n,a=e.radius*e.radius;if(i>a)return null;var o=Math.sqrt(a-i),s=n-o,c=n+o;return s<0&&c<0?null:s<0?this.at(c,r):this.at(s,r)}}(),intersectsSphere:function(t){return this.distanceToPoint(t.center)<=t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var r=-(this.origin.dot(t.normal)+t.constant)/e;return r>=0?r:null},intersectPlane:function(t,e){var r=this.distanceToPlane(t);return null===r?null:this.at(r,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);if(0===e)return!0;var r=t.normal.dot(this.direction);return r*e<0},intersectBox:function(t,e){var r,n,i,a,o,s,c=1/this.direction.x,h=1/this.direction.y,l=1/this.direction.z,u=this.origin;return c>=0?(r=(t.min.x-u.x)*c,n=(t.max.x-u.x)*c):(r=(t.max.x-u.x)*c,n=(t.min.x-u.x)*c),h>=0?(i=(t.min.y-u.y)*h,a=(t.max.y-u.y)*h):(i=(t.max.y-u.y)*h,a=(t.min.y-u.y)*h),r>a||i>n?null:((i>r||r!==r)&&(r=i),(a<n||n!==n)&&(n=a),l>=0?(o=(t.min.z-u.z)*l,s=(t.max.z-u.z)*l):(o=(t.max.z-u.z)*l,s=(t.min.z-u.z)*l),r>s||o>n?null:((o>r||r!==r)&&(r=o),(s<n||n!==n)&&(n=s),n<0?null:this.at(r>=0?r:n,e)))},intersectsBox:function(){var t=new a;return function(e){return null!==this.intersectBox(e,t)}}(),intersectTriangle:function(){var t=new a,e=new a,r=new a,n=new a;return function(i,a,o,s,c){e.subVectors(a,i),r.subVectors(o,i),n.crossVectors(e,r);var h,l=this.direction.dot(n);if(l>0){if(s)return null;h=1}else{if(!(l<0))return null;h=-1,l=-l}t.subVectors(this.origin,i);var u=h*this.direction.dot(r.crossVectors(t,r));if(u<0)return null;var p=h*this.direction.dot(e.cross(t));if(p<0)return null;if(u+p>l)return null;var d=-h*t.dot(n);return d<0?null:this.at(d/l,c)}}(),applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}}),Object.assign(Nt.prototype,{set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){var e=t||new a;return e.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){var e=t||new a;return e.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){var r=e||new a;return this.delta(r).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(){var t=new a,e=new a;return function(r,n){t.subVectors(r,this.start),e.subVectors(this.end,this.start);var i=e.dot(e),a=e.dot(t),o=a/i;return n&&(o=ac.clamp(o,0,1)),o}}(),closestPointToPoint:function(t,e,r){var n=this.closestPointToPointParameter(t,e),i=r||new a;return this.delta(i).multiplyScalar(n).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}),Object.assign(Ut,{normal:function(){var t=new a;return function(e,r,n,i){var o=i||new a;o.subVectors(n,r),t.subVectors(e,r),o.cross(t);var s=o.lengthSq();return s>0?o.multiplyScalar(1/Math.sqrt(s)):o.set(0,0,0)}}(),barycoordFromPoint:function(){var t=new a,e=new a,r=new a;return function(n,i,o,s,c){t.subVectors(s,i),e.subVectors(o,i),r.subVectors(n,i);var h=t.dot(t),l=t.dot(e),u=t.dot(r),p=e.dot(e),d=e.dot(r),f=h*p-l*l,m=c||new a;if(0===f)return m.set(-2,-1,-1);var v=1/f,g=(p*u-l*d)*v,y=(h*d-l*u)*v;return m.set(1-g-y,y,g)}}(),containsPoint:function(){var t=new a;return function(e,r,n,i){var a=Ut.barycoordFromPoint(e,r,n,i,t);return a.x>=0&&a.y>=0&&a.x+a.y<=1}}()}),Object.assign(Ut.prototype,{set:function(t,e,r){return this.a.copy(t),this.b.copy(e),this.c.copy(r),this},setFromPointsAndIndices:function(t,e,r,n){return this.a.copy(t[e]),this.b.copy(t[r]),this.c.copy(t[n]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},area:function(){var t=new a,e=new a;return function(){return t.subVectors(this.c,this.b),e.subVectors(this.a,this.b),.5*t.cross(e).length()}}(),midpoint:function(t){var e=t||new a;return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(t){return Ut.normal(this.a,this.b,this.c,t)},plane:function(t){var e=t||new nt;return e.setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(t,e){return Ut.barycoordFromPoint(t,this.a,this.b,this.c,e)},containsPoint:function(t){return Ut.containsPoint(t,this.a,this.b,this.c)},closestPointToPoint:function(){var t=new nt,e=[new Nt,new Nt,new Nt],r=new a,n=new a;return function(i,o){var s=o||new a,c=1/0;if(t.setFromCoplanarPoints(this.a,this.b,this.c),t.projectPoint(i,r),this.containsPoint(r)===!0)s.copy(r);else{e[0].set(this.a,this.b),e[1].set(this.b,this.c),e[2].set(this.c,this.a);for(var h=0;h<e.length;h++){e[h].closestPointToPoint(r,!0,n);var l=r.distanceToSquared(n);l<c&&(c=l,s.copy(n))}}return s}}(),equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}),Dt.prototype=Object.assign(Object.create(ht.prototype),{constructor:Dt,isMesh:!0,setDrawMode:function(t){this.drawMode=t},copy:function(t){return ht.prototype.copy.call(this,t),this.drawMode=t.drawMode,void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this},updateMorphTargets:function(){var t,e,r,n=this.geometry;if(n.isBufferGeometry){var i=n.morphAttributes,a=Object.keys(i);if(a.length>0){var o=i[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=o.length;t<e;t++)r=o[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[r]=t}}else{var s=n.morphTargets;if(void 0!==s&&s.length>0)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=s.length;t<e;t++)r=s[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[r]=t}},raycast:function(){function t(t,e,r,n,i,a,o){return Ut.barycoordFromPoint(t,e,r,n,y),i.multiplyScalar(y.x),a.multiplyScalar(y.y),o.multiplyScalar(y.z),i.add(a).add(o),i.clone()}function e(t,e,r,n,i,a,o,s){var c;if(c=e.side===$a?n.intersectTriangle(o,a,i,!0,s):n.intersectTriangle(i,a,o,e.side!==to,s),null===c)return null;b.copy(s),b.applyMatrix4(t.matrixWorld);var h=r.ray.origin.distanceTo(b);return h<r.near||h>r.far?null:{distance:h,point:b.clone(),object:t}}function i(r,n,i,a,o,s,c,p){h.fromBufferAttribute(a,s),l.fromBufferAttribute(a,c),u.fromBufferAttribute(a,p);var d=e(r,r.material,n,i,h,l,u,x);return d&&(o&&(m.fromBufferAttribute(o,s),v.fromBufferAttribute(o,c),g.fromBufferAttribute(o,p),d.uv=t(x,h,l,u,m,v,g)),d.face=new pt(s,c,p,Ut.normal(h,l,u)),d.faceIndex=s),d}var o=new n,s=new Ot,c=new rt,h=new a,l=new a,u=new a,p=new a,d=new a,f=new a,m=new r,v=new r,g=new r,y=new a,x=new a,b=new a;return function(r,n){var a=this.geometry,y=this.material,b=this.matrixWorld;if(void 0!==y&&(null===a.boundingSphere&&a.computeBoundingSphere(),c.copy(a.boundingSphere),c.applyMatrix4(b),r.ray.intersectsSphere(c)!==!1&&(o.getInverse(b),s.copy(r.ray).applyMatrix4(o),null===a.boundingBox||s.intersectsBox(a.boundingBox)!==!1))){var _;if(a.isBufferGeometry){var w,M,E,T,S,A=a.index,R=a.attributes.position,L=a.attributes.uv;if(null!==A)for(T=0,S=A.count;T<S;T+=3)w=A.getX(T),M=A.getX(T+1),E=A.getX(T+2),_=i(this,r,s,R,L,w,M,E),_&&(_.faceIndex=Math.floor(T/3),n.push(_));else if(void 0!==R)for(T=0,S=R.count;T<S;T+=3)w=T,M=T+1,E=T+2,_=i(this,r,s,R,L,w,M,E),_&&(_.index=w,n.push(_))}else if(a.isGeometry){var P,C,I,O,N=Array.isArray(y),U=a.vertices,D=a.faces,B=a.faceVertexUvs[0];B.length>0&&(O=B);for(var F=0,z=D.length;F<z;F++){var G=D[F],H=N?y[G.materialIndex]:y;if(void 0!==H){if(P=U[G.a],C=U[G.b],I=U[G.c],H.morphTargets===!0){var V=a.morphTargets,k=this.morphTargetInfluences;h.set(0,0,0),l.set(0,0,0),u.set(0,0,0);for(var j=0,W=V.length;j<W;j++){var X=k[j];if(0!==X){var q=V[j].vertices;h.addScaledVector(p.subVectors(q[G.a],P),X),l.addScaledVector(d.subVectors(q[G.b],C),X),u.addScaledVector(f.subVectors(q[G.c],I),X)}}h.add(P),l.add(C),u.add(I),P=h,C=l,I=u}if(_=e(this,H,r,s,P,C,I,x)){if(O&&O[F]){var Y=O[F];m.copy(Y[0]),v.copy(Y[1]),g.copy(Y[2]),_.uv=t(x,P,C,I,m,v,g)}_.face=G,_.faceIndex=F,n.push(_)}}}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var El=0;me.prototype=Object.assign(Object.create(lt.prototype),{constructor:me,isPerspectiveCamera:!0,copy:function(t,e){return lt.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){var e=.5*this.getFilmHeight()/t;this.fov=2*ac.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*ac.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*ac.RAD2DEG*Math.atan(Math.tan(.5*ac.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,r,n,i,a){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=r,this.view.offsetY=n,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*ac.DEG2RAD*this.fov)/this.zoom,r=2*e,n=this.aspect*r,i=-.5*n,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;i+=a.offsetX*n/o,e-=a.offsetY*r/s,n*=a.width/o,r*=a.height/s}var c=this.filmOffset;0!==c&&(i+=t*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+n,e,e-r,t,this.far)},toJSON:function(t){var e=ht.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}),ve.prototype=Object.assign(Object.create(me.prototype),{constructor:ve,isArrayCamera:!0}),we.prototype.isFogExp2=!0,we.prototype.clone=function(){return new we(this.color.getHex(),this.density)},we.prototype.toJSON=function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}},Me.prototype.isFog=!0,Me.prototype.clone=function(){return new Me(this.color.getHex(),this.near,this.far)},Me.prototype.toJSON=function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}},Ee.prototype=Object.assign(Object.create(ht.prototype),{constructor:Ee,copy:function(t,e){return ht.prototype.copy.call(this,t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},toJSON:function(t){var e=ht.prototype.toJSON.call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e}}),Te.prototype=Object.assign(Object.create(ht.prototype),{constructor:Te,isLensFlare:!0,copy:function(t){ht.prototype.copy.call(this,t),this.positionScreen.copy(t.positionScreen),this.customUpdateCallback=t.customUpdateCallback;for(var e=0,r=t.lensFlares.length;e<r;e++)this.lensFlares.push(t.lensFlares[e]);return this},add:function(t,e,r,n,i,a){void 0===e&&(e=-1),void 0===r&&(r=0),void 0===a&&(a=1),void 0===i&&(i=new q(16777215)),void 0===n&&(n=so),r=Math.min(r,Math.max(0,r)),this.lensFlares.push({texture:t,size:e,distance:r,x:0,y:0,z:0,scale:1,rotation:0,opacity:a,color:i,blending:n})},updateLensFlares:function(){var t,e,r=this.lensFlares.length,n=2*-this.positionScreen.x,i=2*-this.positionScreen.y;for(t=0;t<r;t++)e=this.lensFlares[t],e.x=this.positionScreen.x+n*e.distance,e.y=this.positionScreen.y+i*e.distance,e.wantedRotation=e.x*Math.PI*.25,e.rotation+=.25*(e.wantedRotation-e.rotation)}}),Se.prototype=Object.create(K.prototype),Se.prototype.constructor=Se,Se.prototype.isSpriteMaterial=!0,Se.prototype.copy=function(t){return K.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.rotation=t.rotation,this},Ae.prototype=Object.assign(Object.create(ht.prototype),{constructor:Ae,isSprite:!0,raycast:function(){var t=new a,e=new a,r=new a;return function(n,i){e.setFromMatrixPosition(this.matrixWorld),n.ray.closestPointToPoint(e,t),r.setFromMatrixScale(this.matrixWorld);var a=r.x*r.y/4;if(!(e.distanceToSquared(t)>a)){var o=n.ray.origin.distanceTo(t);o<n.near||o>n.far||i.push({distance:o,point:t.clone(),face:null,object:this})}}}(),clone:function(){return new this.constructor(this.material).copy(this)}}),Re.prototype=Object.assign(Object.create(ht.prototype),{constructor:Re,copy:function(t){ht.prototype.copy.call(this,t,!1);for(var e=t.levels,r=0,n=e.length;r<n;r++){var i=e[r];this.addLevel(i.object.clone(),i.distance)}return this},addLevel:function(t,e){void 0===e&&(e=0),e=Math.abs(e);for(var r=this.levels,n=0;n<r.length&&!(e<r[n].distance);n++);r.splice(n,0,{distance:e,object:t}),this.add(t)},getObjectForDistance:function(t){for(var e=this.levels,r=1,n=e.length;r<n&&!(t<e[r].distance);r++);return e[r-1].object},raycast:function(){var t=new a;return function(e,r){t.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(t);this.getObjectForDistance(n).raycast(e,r)}}(),update:function(){var t=new a,e=new a;return function(r){var n=this.levels;if(n.length>1){t.setFromMatrixPosition(r.matrixWorld),e.setFromMatrixPosition(this.matrixWorld);var i=t.distanceTo(e);n[0].object.visible=!0;for(var a=1,o=n.length;a<o&&i>=n[a].distance;a++)n[a-1].object.visible=!1,n[a].object.visible=!0;for(;a<o;a++)n[a].object.visible=!1}}}(),toJSON:function(t){var e=ht.prototype.toJSON.call(this,t);e.object.levels=[];for(var r=this.levels,n=0,i=r.length;n<i;n++){var a=r[n];e.object.levels.push({object:a.object.uuid,distance:a.distance})}return e}}),Object.assign(Le.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var r=new n;this.bones[t]&&r.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(r)}},pose:function(){var t,e,r;for(e=0,r=this.bones.length;e<r;e++)t=this.bones[e],t&&t.matrixWorld.getInverse(this.boneInverses[e]);for(e=0,r=this.bones.length;e<r;e++)t=this.bones[e],t&&(t.parent&&t.parent.isBone?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},update:function(){var t=new n,e=new n;return function(){for(var r=this.bones,n=this.boneInverses,i=this.boneMatrices,a=this.boneTexture,o=0,s=r.length;o<s;o++){var c=r[o]?r[o].matrixWorld:e;t.multiplyMatrices(c,n[o]),t.toArray(i,16*o)}void 0!==a&&(a.needsUpdate=!0)}}(),clone:function(){return new Le(this.bones,this.boneInverses)}}),Pe.prototype=Object.assign(Object.create(ht.prototype),{constructor:Pe,isBone:!0}),Ce.prototype=Object.assign(Object.create(Dt.prototype),{constructor:Ce,isSkinnedMesh:!0,initBones:function(){var t,e,r,n,i=[];if(this.geometry&&void 0!==this.geometry.bones){for(r=0,n=this.geometry.bones.length;r<n;r++)e=this.geometry.bones[r],t=new Pe,i.push(t),t.name=e.name,t.position.fromArray(e.pos),t.quaternion.fromArray(e.rotq),void 0!==e.scl&&t.scale.fromArray(e.scl);for(r=0,n=this.geometry.bones.length;r<n;r++)e=this.geometry.bones[r],e.parent!==-1&&null!==e.parent&&void 0!==i[e.parent]?i[e.parent].add(i[r]):this.add(i[r])}return this.updateMatrixWorld(!0),i},bind:function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){var t,e;if(this.geometry&&this.geometry.isGeometry)for(e=0;e<this.geometry.skinWeights.length;e++){var r=this.geometry.skinWeights[e];t=1/r.manhattanLength(),t!==1/0?r.multiplyScalar(t):r.set(1,0,0,0)}else if(this.geometry&&this.geometry.isBufferGeometry){var n=new c,i=this.geometry.attributes.skinWeight;for(e=0;e<i.count;e++)n.x=i.getX(e),n.y=i.getY(e),n.z=i.getZ(e),n.w=i.getW(e),t=1/n.manhattanLength(),t!==1/0?n.multiplyScalar(t):n.set(1,0,0,0),i.setXYZW(e,n.x,n.y,n.z,n.w)}},updateMatrixWorld:function(t){Dt.prototype.updateMatrixWorld.call(this,t),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Ie.prototype=Object.create(K.prototype),Ie.prototype.constructor=Ie,Ie.prototype.isLineBasicMaterial=!0,Ie.prototype.copy=function(t){return K.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this},Oe.prototype=Object.assign(Object.create(ht.prototype),{constructor:Oe,isLine:!0,raycast:function(){var t=new n,e=new Ot,r=new rt;return function(n,i){var o=n.linePrecision,s=o*o,c=this.geometry,h=this.matrixWorld;if(null===c.boundingSphere&&c.computeBoundingSphere(),r.copy(c.boundingSphere),r.applyMatrix4(h),n.ray.intersectsSphere(r)!==!1){t.getInverse(h),e.copy(n.ray).applyMatrix4(t);var l=new a,u=new a,p=new a,d=new a,f=this&&this.isLineSegments?2:1;if(c.isBufferGeometry){var m=c.index,v=c.attributes,g=v.position.array;if(null!==m)for(var y=m.array,x=0,b=y.length-1;x<b;x+=f){var _=y[x],w=y[x+1];l.fromArray(g,3*_),u.fromArray(g,3*w);var M=e.distanceSqToSegment(l,u,d,p);if(!(M>s)){d.applyMatrix4(this.matrixWorld);var E=n.ray.origin.distanceTo(d);E<n.near||E>n.far||i.push({distance:E,point:p.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else for(var x=0,b=g.length/3-1;x<b;x+=f){l.fromArray(g,3*x),u.fromArray(g,3*x+3);var M=e.distanceSqToSegment(l,u,d,p);if(!(M>s)){d.applyMatrix4(this.matrixWorld);var E=n.ray.origin.distanceTo(d);E<n.near||E>n.far||i.push({distance:E,point:p.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}else if(c.isGeometry)for(var T=c.vertices,S=T.length,x=0;x<S-1;x+=f){var M=e.distanceSqToSegment(T[x],T[x+1],d,p);if(!(M>s)){d.applyMatrix4(this.matrixWorld);var E=n.ray.origin.distanceTo(d);E<n.near||E>n.far||i.push({distance:E,point:p.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Ne.prototype=Object.assign(Object.create(Oe.prototype),{constructor:Ne,isLineSegments:!0}),Ue.prototype=Object.assign(Object.create(Oe.prototype),{constructor:Ue,isLineLoop:!0}),De.prototype=Object.create(K.prototype),De.prototype.constructor=De,De.prototype.isPointsMaterial=!0,De.prototype.copy=function(t){return K.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this},Be.prototype=Object.assign(Object.create(ht.prototype),{constructor:Be,isPoints:!0,raycast:function(){var t=new n,e=new Ot,r=new rt;return function(n,i){function o(t,r){var a=e.distanceSqToPoint(t);if(a<p){var o=e.closestPointToPoint(t);o.applyMatrix4(h);var c=n.ray.origin.distanceTo(o);if(c<n.near||c>n.far)return;i.push({distance:c,distanceToRay:Math.sqrt(a),point:o.clone(),index:r,face:null,object:s})}}var s=this,c=this.geometry,h=this.matrixWorld,l=n.params.Points.threshold;if(null===c.boundingSphere&&c.computeBoundingSphere(),r.copy(c.boundingSphere),r.applyMatrix4(h),r.radius+=l,n.ray.intersectsSphere(r)!==!1){t.getInverse(h),e.copy(n.ray).applyMatrix4(t);var u=l/((this.scale.x+this.scale.y+this.scale.z)/3),p=u*u,d=new a;if(c.isBufferGeometry){var f=c.index,m=c.attributes,v=m.position.array;if(null!==f)for(var g=f.array,y=0,x=g.length;y<x;y++){var b=g[y];d.fromArray(v,3*b),o(d,b)}else for(var y=0,_=v.length/3;y<_;y++)d.fromArray(v,3*y),o(d,y)}else for(var w=c.vertices,y=0,_=w.length;y<_;y++)o(w[y],y)}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Fe.prototype=Object.assign(Object.create(ht.prototype),{constructor:Fe,isGroup:!0}),ze.prototype=Object.assign(Object.create(s.prototype),{constructor:ze,isVideoTexture:!0,update:function(){var t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),Ge.prototype=Object.create(s.prototype),Ge.prototype.constructor=Ge,Ge.prototype.isCompressedTexture=!0,He.prototype=Object.create(s.prototype),He.prototype.constructor=He,He.prototype.isDepthTexture=!0,Ve.prototype=Object.create(St.prototype),Ve.prototype.constructor=Ve,ke.prototype=Object.create(dt.prototype),ke.prototype.constructor=ke,je.prototype=Object.create(St.prototype),je.prototype.constructor=je,We.prototype=Object.create(dt.prototype),We.prototype.constructor=We,Xe.prototype=Object.create(St.prototype),Xe.prototype.constructor=Xe,qe.prototype=Object.create(dt.prototype),qe.prototype.constructor=qe,Ye.prototype=Object.create(Xe.prototype),Ye.prototype.constructor=Ye,Ze.prototype=Object.create(dt.prototype),Ze.prototype.constructor=Ze,Je.prototype=Object.create(Xe.prototype),Je.prototype.constructor=Je,Qe.prototype=Object.create(dt.prototype),Qe.prototype.constructor=Qe,Ke.prototype=Object.create(Xe.prototype),Ke.prototype.constructor=Ke,$e.prototype=Object.create(dt.prototype),$e.prototype.constructor=$e,tr.prototype=Object.create(Xe.prototype),tr.prototype.constructor=tr,er.prototype=Object.create(dt.prototype),er.prototype.constructor=er,rr.prototype=Object.create(St.prototype),rr.prototype.constructor=rr,nr.prototype=Object.create(dt.prototype),nr.prototype.constructor=nr,ir.prototype=Object.create(St.prototype),ir.prototype.constructor=ir,ar.prototype=Object.create(dt.prototype),ar.prototype.constructor=ar,or.prototype=Object.create(St.prototype),or.prototype.constructor=or;var Tl={triangulate:function(t,e,r){r=r||2;var n=e&&e.length,i=n?e[0]*r:t.length,a=sr(t,0,i,r,!0),o=[];if(!a)return o;var s,c,h,l,u,p,d;if(n&&(a=fr(t,e,a,r)),t.length>80*r){s=h=t[0],c=l=t[1];for(var f=r;f<i;f+=r)u=t[f],p=t[f+1],u<s&&(s=u),p<c&&(c=p),u>h&&(h=u),p>l&&(l=p);d=Math.max(h-s,l-c),d=0!==d?1/d:0}return hr(a,o,r,s,c,d),o}},Sl={area:function(t){for(var e=t.length,r=0,n=e-1,i=0;i<e;n=i++)r+=t[n].x*t[i].y-t[i].x*t[n].y;return.5*r},isClockWise:function(t){return Sl.area(t)<0},triangulateShape:function(t,e){function r(t){var e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function n(t,e){for(var r=0;r<e.length;r++)t.push(e[r].x),t.push(e[r].y)}var i=[],a=[],o=[];r(t),n(i,t);var s=t.length;for(e.forEach(r),h=0;h<e.length;h++)a.push(s),s+=e[h].length,n(i,e[h]);for(var c=Tl.triangulate(i,a),h=0;h<c.length;h+=3)o.push(c.slice(h,h+3));return o}};Ur.prototype=Object.create(dt.prototype),Ur.prototype.constructor=Ur,Dr.prototype=Object.create(St.prototype),Dr.prototype.constructor=Dr,Dr.prototype.getArrays=function(){var t=this.getAttribute("position"),e=t?Array.prototype.slice.call(t.array):[],r=this.getAttribute("uv"),n=r?Array.prototype.slice.call(r.array):[],i=this.index,a=i?Array.prototype.slice.call(i.array):[];return{position:e,uv:n,index:a}},Dr.prototype.addShapeList=function(t,e){var r=t.length;e.arrays=this.getArrays();for(var n=0;n<r;n++){var i=t[n];this.addShape(i,e)}this.setIndex(e.arrays.index),this.addAttribute("position",new wt(e.arrays.position,3)),this.addAttribute("uv",new wt(e.arrays.uv,2))},Dr.prototype.addShape=function(t,e){function n(t,e,r){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(r).add(t)}function i(t,e,n){var i,a,o,s=t.x-e.x,c=t.y-e.y,h=n.x-t.x,l=n.y-t.y,u=s*s+c*c,p=s*l-c*h;if(Math.abs(p)>Number.EPSILON){var d=Math.sqrt(u),f=Math.sqrt(h*h+l*l),m=e.x-c/d,v=e.y+s/d,g=n.x-l/f,y=n.y+h/f,x=((g-m)*l-(y-v)*h)/(s*l-c*h);i=m+s*x-t.x,a=v+c*x-t.y;var b=i*i+a*a;if(b<=2)return new r(i,a);o=Math.sqrt(b/2)}else{var _=!1;s>Number.EPSILON?h>Number.EPSILON&&(_=!0):s<-Number.EPSILON?h<-Number.EPSILON&&(_=!0):Math.sign(c)===Math.sign(l)&&(_=!0),_?(i=-c,a=s,o=Math.sqrt(u)):(i=s,a=c,o=Math.sqrt(u/2))}return new r(i/o,a/o)}function o(){var t=b.length/3;if(R){var r=0,n=J*r;for($=0;$<Q;$++)Z=V[$],l(Z[2]+n,Z[1]+n,Z[0]+n);for(r=P+2*A,n=J*r,$=0;$<Q;$++)Z=V[$],l(Z[0]+n,Z[1]+n,Z[2]+n)}else{for($=0;$<Q;$++)Z=V[$],l(Z[2],Z[1],Z[0]);for($=0;$<Q;$++)Z=V[$],l(Z[0]+J*P,Z[1]+J*P,Z[2]+J*P)}B.addGroup(t,b.length/3-t,void 0!==e.material?e.material:0)}function s(){var t=b.length/3,r=0;for(c(k,r),r+=k.length,U=0,D=G.length;U<D;U++)N=G[U],c(N,r),r+=N.length;B.addGroup(t,b.length/3-t,void 0!==e.extrudeMaterial?e.extrudeMaterial:1)}function c(t,e){var r,n;for($=t.length;--$>=0;){r=$,n=$-1,n<0&&(n=t.length-1);var i=0,a=P+2*A;for(i=0;i<a;i++){var o=J*i,s=J*(i+1),c=e+r+o,h=e+n+o,l=e+n+s,p=e+r+s;u(c,h,l,p)}}}function h(t,e,r){M.push(t),M.push(e),M.push(r)}function l(t,e,r){p(t),p(e),p(r);var n=b.length/3,i=O.generateTopUV(B,b,n-3,n-2,n-1);d(i[0]),d(i[1]),d(i[2])}function u(t,e,r,n){p(t),p(e),p(n),p(e),p(r),p(n);var i=b.length/3,a=O.generateSideWallUV(B,b,i-6,i-3,i-2,i-1);d(a[0]),d(a[1]),d(a[3]),d(a[1]),d(a[2]),d(a[3])}function p(t){_.push(b.length/3),b.push(M[3*t+0]),b.push(M[3*t+1]),b.push(M[3*t+2])}function d(t){w.push(t.x),w.push(t.y)}var f,m,v,g,y,x=e.arrays?e.arrays:this.getArrays(),b=x.position,_=x.index,w=x.uv,M=[],E=void 0!==e.amount?e.amount:100,T=void 0!==e.bevelThickness?e.bevelThickness:6,S=void 0!==e.bevelSize?e.bevelSize:T-2,A=void 0!==e.bevelSegments?e.bevelSegments:3,R=void 0===e.bevelEnabled||e.bevelEnabled,L=void 0!==e.curveSegments?e.curveSegments:12,P=void 0!==e.steps?e.steps:1,C=e.extrudePath,I=!1,O=void 0!==e.UVGenerator?e.UVGenerator:Ur.WorldUVGenerator;C&&(f=C.getSpacedPoints(P),I=!0,R=!1,m=void 0!==e.frames?e.frames:C.computeFrenetFrames(P,!1),v=new a,g=new a,y=new a),R||(A=0,T=0,S=0);var N,U,D,B=this,F=t.extractPoints(L),z=F.shape,G=F.holes,H=!Sl.isClockWise(z);if(H)for(z=z.reverse(),U=0,D=G.length;U<D;U++)N=G[U],Sl.isClockWise(N)&&(G[U]=N.reverse());var V=Sl.triangulateShape(z,G),k=z;for(U=0,D=G.length;U<D;U++)N=G[U],z=z.concat(N);for(var j,W,X,q,Y,Z,J=z.length,Q=V.length,K=[],$=0,tt=k.length,et=tt-1,rt=$+1;$<tt;$++,et++,rt++)et===tt&&(et=0),rt===tt&&(rt=0),K[$]=i(k[$],k[et],k[rt]);var nt,it=[],at=K.concat();for(U=0,D=G.length;U<D;U++){for(N=G[U],nt=[],$=0,tt=N.length,et=tt-1,rt=$+1;$<tt;$++,et++,rt++)et===tt&&(et=0),rt===tt&&(rt=0),nt[$]=i(N[$],N[et],N[rt]);it.push(nt),at=at.concat(nt)}for(j=0;j<A;j++){for(X=j/A,q=T*Math.cos(X*Math.PI/2),W=S*Math.sin(X*Math.PI/2),$=0,tt=k.length;$<tt;$++)Y=n(k[$],K[$],W),h(Y.x,Y.y,-q);for(U=0,D=G.length;U<D;U++)for(N=G[U],nt=it[U],$=0,tt=N.length;$<tt;$++)Y=n(N[$],nt[$],W),h(Y.x,Y.y,-q)}for(W=S,$=0;$<J;$++)Y=R?n(z[$],at[$],W):z[$],I?(g.copy(m.normals[0]).multiplyScalar(Y.x),v.copy(m.binormals[0]).multiplyScalar(Y.y),y.copy(f[0]).add(g).add(v),h(y.x,y.y,y.z)):h(Y.x,Y.y,0);var ot;for(ot=1;ot<=P;ot++)for($=0;$<J;$++)Y=R?n(z[$],at[$],W):z[$],I?(g.copy(m.normals[ot]).multiplyScalar(Y.x),v.copy(m.binormals[ot]).multiplyScalar(Y.y),y.copy(f[ot]).add(g).add(v),h(y.x,y.y,y.z)):h(Y.x,Y.y,E/P*ot);for(j=A-1;j>=0;j--){for(X=j/A,q=T*Math.cos(X*Math.PI/2),W=S*Math.sin(X*Math.PI/2),$=0,tt=k.length;$<tt;$++)Y=n(k[$],K[$],W),h(Y.x,Y.y,E+q);for(U=0,D=G.length;U<D;U++)for(N=G[U],nt=it[U],$=0,tt=N.length;$<tt;$++)Y=n(N[$],nt[$],W),I?h(Y.x,Y.y+f[P-1].y,f[P-1].x+q):h(Y.x,Y.y,E+q)}o(),s(),e.arrays||(this.setIndex(_),this.addAttribute("position",new wt(b,3)),this.addAttribute("uv",new wt(w,2)))},Ur.WorldUVGenerator={generateTopUV:function(t,e,n,i,a){var o=e[3*n],s=e[3*n+1],c=e[3*i],h=e[3*i+1],l=e[3*a],u=e[3*a+1];return[new r(o,s),new r(c,h),new r(l,u)];
  104. },generateSideWallUV:function(t,e,n,i,a,o){var s=e[3*n],c=e[3*n+1],h=e[3*n+2],l=e[3*i],u=e[3*i+1],p=e[3*i+2],d=e[3*a],f=e[3*a+1],m=e[3*a+2],v=e[3*o],g=e[3*o+1],y=e[3*o+2];return Math.abs(c-u)<.01?[new r(s,1-h),new r(l,1-p),new r(d,1-m),new r(v,1-y)]:[new r(c,1-h),new r(u,1-p),new r(f,1-m),new r(g,1-y)]}},Br.prototype=Object.create(dt.prototype),Br.prototype.constructor=Br,Fr.prototype=Object.create(Dr.prototype),Fr.prototype.constructor=Fr,zr.prototype=Object.create(dt.prototype),zr.prototype.constructor=zr,Gr.prototype=Object.create(St.prototype),Gr.prototype.constructor=Gr,Hr.prototype=Object.create(dt.prototype),Hr.prototype.constructor=Hr,Vr.prototype=Object.create(St.prototype),Vr.prototype.constructor=Vr,kr.prototype=Object.create(dt.prototype),kr.prototype.constructor=kr,jr.prototype=Object.create(St.prototype),jr.prototype.constructor=jr,Wr.prototype=Object.create(dt.prototype),Wr.prototype.constructor=Wr,Wr.prototype.toJSON=function(){var t=dt.prototype.toJSON.call(this),e=this.parameters.shapes;return qr(e,t)},Xr.prototype=Object.create(St.prototype),Xr.prototype.constructor=Xr,Xr.prototype.toJSON=function(){var t=St.prototype.toJSON.call(this),e=this.parameters.shapes;return qr(e,t)},Yr.prototype=Object.create(St.prototype),Yr.prototype.constructor=Yr,Zr.prototype=Object.create(dt.prototype),Zr.prototype.constructor=Zr,Jr.prototype=Object.create(St.prototype),Jr.prototype.constructor=Jr,Qr.prototype=Object.create(Zr.prototype),Qr.prototype.constructor=Qr,Kr.prototype=Object.create(Jr.prototype),Kr.prototype.constructor=Kr,$r.prototype=Object.create(dt.prototype),$r.prototype.constructor=$r,tn.prototype=Object.create(St.prototype),tn.prototype.constructor=tn;var Al=Object.freeze({WireframeGeometry:Ve,ParametricGeometry:ke,ParametricBufferGeometry:je,TetrahedronGeometry:qe,TetrahedronBufferGeometry:Ye,OctahedronGeometry:Ze,OctahedronBufferGeometry:Je,IcosahedronGeometry:Qe,IcosahedronBufferGeometry:Ke,DodecahedronGeometry:$e,DodecahedronBufferGeometry:tr,PolyhedronGeometry:We,PolyhedronBufferGeometry:Xe,TubeGeometry:er,TubeBufferGeometry:rr,TorusKnotGeometry:nr,TorusKnotBufferGeometry:ir,TorusGeometry:ar,TorusBufferGeometry:or,TextGeometry:Br,TextBufferGeometry:Fr,SphereGeometry:zr,SphereBufferGeometry:Gr,RingGeometry:Hr,RingBufferGeometry:Vr,PlaneGeometry:Lt,PlaneBufferGeometry:Pt,LatheGeometry:kr,LatheBufferGeometry:jr,ShapeGeometry:Wr,ShapeBufferGeometry:Xr,ExtrudeGeometry:Ur,ExtrudeBufferGeometry:Dr,EdgesGeometry:Yr,ConeGeometry:Qr,ConeBufferGeometry:Kr,CylinderGeometry:Zr,CylinderBufferGeometry:Jr,CircleGeometry:$r,CircleBufferGeometry:tn,BoxGeometry:At,BoxBufferGeometry:Rt});en.prototype=Object.create(K.prototype),en.prototype.constructor=en,en.prototype.isShadowMaterial=!0,rn.prototype=Object.create(It.prototype),rn.prototype.constructor=rn,rn.prototype.isRawShaderMaterial=!0,nn.prototype=Object.create(K.prototype),nn.prototype.constructor=nn,nn.prototype.isMeshStandardMaterial=!0,nn.prototype.copy=function(t){return K.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},an.prototype=Object.create(nn.prototype),an.prototype.constructor=an,an.prototype.isMeshPhysicalMaterial=!0,an.prototype.copy=function(t){return nn.prototype.copy.call(this,t),this.defines={PHYSICAL:""},this.reflectivity=t.reflectivity,this.clearCoat=t.clearCoat,this.clearCoatRoughness=t.clearCoatRoughness,this},on.prototype=Object.create(K.prototype),on.prototype.constructor=on,on.prototype.isMeshPhongMaterial=!0,on.prototype.copy=function(t){return K.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},sn.prototype=Object.create(on.prototype),sn.prototype.constructor=sn,sn.prototype.isMeshToonMaterial=!0,sn.prototype.copy=function(t){return on.prototype.copy.call(this,t),this.gradientMap=t.gradientMap,this},cn.prototype=Object.create(K.prototype),cn.prototype.constructor=cn,cn.prototype.isMeshNormalMaterial=!0,cn.prototype.copy=function(t){return K.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},hn.prototype=Object.create(K.prototype),hn.prototype.constructor=hn,hn.prototype.isMeshLambertMaterial=!0,hn.prototype.copy=function(t){return K.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},ln.prototype=Object.create(Ie.prototype),ln.prototype.constructor=ln,ln.prototype.isLineDashedMaterial=!0,ln.prototype.copy=function(t){return Ie.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var Rl=Object.freeze({ShadowMaterial:en,SpriteMaterial:Se,RawShaderMaterial:rn,ShaderMaterial:It,PointsMaterial:De,MeshPhysicalMaterial:an,MeshStandardMaterial:nn,MeshPhongMaterial:on,MeshToonMaterial:sn,MeshNormalMaterial:cn,MeshLambertMaterial:hn,MeshDepthMaterial:$,MeshDistanceMaterial:tt,MeshBasicMaterial:Ct,LineDashedMaterial:ln,LineBasicMaterial:Ie,Material:K}),Ll={enabled:!1,files:{},add:function(t,e){this.enabled!==!1&&(this.files[t]=e)},get:function(t){if(this.enabled!==!1)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}},Pl=new un,Cl={};Object.assign(pn.prototype,{load:function(t,e,r,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var i=this,a=Ll.get(t);if(void 0!==a)return i.manager.itemStart(t),setTimeout(function(){e&&e(a),i.manager.itemEnd(t)},0),a;if(void 0!==Cl[t])return void Cl[t].push({onLoad:e,onProgress:r,onError:n});var o=/^data:(.*?)(;base64)?,(.*)$/,s=t.match(o);if(s){var c=s[1],h=!!s[2],l=s[3];l=window.decodeURIComponent(l),h&&(l=window.atob(l));try{var u,p=(this.responseType||"").toLowerCase();switch(p){case"arraybuffer":case"blob":for(var d=new Uint8Array(l.length),f=0;f<l.length;f++)d[f]=l.charCodeAt(f);u="blob"===p?new Blob([d.buffer],{type:c}):d.buffer;break;case"document":var m=new DOMParser;u=m.parseFromString(l,c);break;case"json":u=JSON.parse(l);break;default:u=l}window.setTimeout(function(){e&&e(u),i.manager.itemEnd(t)},0)}catch(e){window.setTimeout(function(){n&&n(e),i.manager.itemEnd(t),i.manager.itemError(t)},0)}}else{Cl[t]=[],Cl[t].push({onLoad:e,onProgress:r,onError:n});var v=new XMLHttpRequest;v.open("GET",t,!0),v.addEventListener("load",function(e){var r=this.response;Ll.add(t,r);var n=Cl[t];if(delete Cl[t],200===this.status){for(var a=0,o=n.length;a<o;a++){var s=n[a];s.onLoad&&s.onLoad(r)}i.manager.itemEnd(t)}else if(0===this.status){console.warn("THREE.FileLoader: HTTP Status 0 received.");for(var a=0,o=n.length;a<o;a++){var s=n[a];s.onLoad&&s.onLoad(r)}i.manager.itemEnd(t)}else{for(var a=0,o=n.length;a<o;a++){var s=n[a];s.onError&&s.onError(e)}i.manager.itemEnd(t),i.manager.itemError(t)}},!1),v.addEventListener("progress",function(e){for(var r=Cl[t],n=0,i=r.length;n<i;n++){var a=r[n];a.onProgress&&a.onProgress(e)}},!1),v.addEventListener("error",function(e){var r=Cl[t];delete Cl[t];for(var n=0,a=r.length;n<a;n++){var o=r[n];o.onError&&o.onError(e)}i.manager.itemEnd(t),i.manager.itemError(t)},!1),void 0!==this.responseType&&(v.responseType=this.responseType),void 0!==this.withCredentials&&(v.withCredentials=this.withCredentials),v.overrideMimeType&&v.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain");for(var g in this.requestHeader)v.setRequestHeader(g,this.requestHeader[g]);v.send(null)}return i.manager.itemStart(t),v},setPath:function(t){return this.path=t,this},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setMimeType:function(t){return this.mimeType=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}}),Object.assign(dn.prototype,{load:function(t,e,r,n){function i(i){c.load(t[i],function(t){var r=a._parser(t,!0);o[i]={width:r.width,height:r.height,format:r.format,mipmaps:r.mipmaps},h+=1,6===h&&(1===r.mipmapCount&&(s.minFilter=as),s.format=r.format,s.needsUpdate=!0,e&&e(s))},r,n)}var a=this,o=[],s=new Ge;s.image=o;var c=new pn(this.manager);if(c.setPath(this.path),c.setResponseType("arraybuffer"),Array.isArray(t))for(var h=0,l=0,u=t.length;l<u;++l)i(l);else c.load(t,function(t){var r=a._parser(t,!0);if(r.isCubemap)for(var n=r.mipmaps.length/r.mipmapCount,i=0;i<n;i++){o[i]={mipmaps:[]};for(var c=0;c<r.mipmapCount;c++)o[i].mipmaps.push(r.mipmaps[i*r.mipmapCount+c]),o[i].format=r.format,o[i].width=r.width,o[i].height=r.height}else s.image.width=r.width,s.image.height=r.height,s.mipmaps=r.mipmaps;1===r.mipmapCount&&(s.minFilter=as),s.format=r.format,s.needsUpdate=!0,e&&e(s)},r,n);return s},setPath:function(t){return this.path=t,this}}),Object.assign(fn.prototype,{load:function(t,e,r,n){var i=this,a=new u,o=new pn(this.manager);return o.setResponseType("arraybuffer"),o.load(t,function(t){var r=i._parser(t);r&&(void 0!==r.image?a.image=r.image:void 0!==r.data&&(a.image.width=r.width,a.image.height=r.height,a.image.data=r.data),a.wrapS=void 0!==r.wrapS?r.wrapS:ts,a.wrapT=void 0!==r.wrapT?r.wrapT:ts,a.magFilter=void 0!==r.magFilter?r.magFilter:as,a.minFilter=void 0!==r.minFilter?r.minFilter:ss,a.anisotropy=void 0!==r.anisotropy?r.anisotropy:1,void 0!==r.format&&(a.format=r.format),void 0!==r.type&&(a.type=r.type),void 0!==r.mipmaps&&(a.mipmaps=r.mipmaps),1===r.mipmapCount&&(a.minFilter=as),a.needsUpdate=!0,e&&e(a,r))},r,n),a}}),Object.assign(mn.prototype,{crossOrigin:"Anonymous",load:function(t,e,r,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var i=this,a=Ll.get(t);if(void 0!==a)return i.manager.itemStart(t),setTimeout(function(){e&&e(a),i.manager.itemEnd(t)},0),a;var o=document.createElementNS("http://www.w3.org/1999/xhtml","img");return o.addEventListener("load",function(){Ll.add(t,this),e&&e(this),i.manager.itemEnd(t)},!1),o.addEventListener("error",function(e){n&&n(e),i.manager.itemEnd(t),i.manager.itemError(t)},!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(t),o.src=t,o},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(vn.prototype,{crossOrigin:"Anonymous",load:function(t,e,r,n){function i(r){o.load(t[r],function(t){a.images[r]=t,s++,6===s&&(a.needsUpdate=!0,e&&e(a))},void 0,n)}var a=new p,o=new mn(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);for(var s=0,c=0;c<t.length;++c)i(c);return a},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(gn.prototype,{crossOrigin:"Anonymous",load:function(t,e,r,n){var i=new s,a=new mn(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(t,function(r){i.image=r;var n=t.search(/\.(jpg|jpeg)$/)>0||0===t.search(/^data\:image\/jpeg/);i.format=n?_s:ws,i.needsUpdate=!0,void 0!==e&&e(i)},r,n),i},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(yn.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){var r=this.getUtoTmapping(t);return this.getPoint(r,e)},getPoints:function(t){void 0===t&&(t=5);for(var e=[],r=0;r<=t;r++)e.push(this.getPoint(r/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);for(var e=[],r=0;r<=t;r++)e.push(this.getPointAt(r/t));return e},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,r,n=[],i=this.getPoint(0),a=0;for(n.push(0),r=1;r<=t;r++)e=this.getPoint(r/t),a+=e.distanceTo(i),n.push(a),i=e;return this.cacheArcLengths=n,n},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var r,n=this.getLengths(),i=0,a=n.length;r=e?e:t*n[a-1];for(var o,s=0,c=a-1;s<=c;)if(i=Math.floor(s+(c-s)/2),o=n[i]-r,o<0)s=i+1;else{if(!(o>0)){c=i;break}c=i-1}if(i=c,n[i]===r)return i/(a-1);var h=n[i],l=n[i+1],u=l-h,p=(r-h)/u,d=(i+p)/(a-1);return d},getTangent:function(t){var e=1e-4,r=t-e,n=t+e;r<0&&(r=0),n>1&&(n=1);var i=this.getPoint(r),a=this.getPoint(n),o=a.clone().sub(i);return o.normalize()},getTangentAt:function(t){var e=this.getUtoTmapping(t);return this.getTangent(e)},computeFrenetFrames:function(t,e){var r,i,o,s=new a,c=[],h=[],l=[],u=new a,p=new n;for(r=0;r<=t;r++)i=r/t,c[r]=this.getTangentAt(i),c[r].normalize();h[0]=new a,l[0]=new a;var d=Number.MAX_VALUE,f=Math.abs(c[0].x),m=Math.abs(c[0].y),v=Math.abs(c[0].z);for(f<=d&&(d=f,s.set(1,0,0)),m<=d&&(d=m,s.set(0,1,0)),v<=d&&s.set(0,0,1),u.crossVectors(c[0],s).normalize(),h[0].crossVectors(c[0],u),l[0].crossVectors(c[0],h[0]),r=1;r<=t;r++)h[r]=h[r-1].clone(),l[r]=l[r-1].clone(),u.crossVectors(c[r-1],c[r]),u.length()>Number.EPSILON&&(u.normalize(),o=Math.acos(ac.clamp(c[r-1].dot(c[r]),-1,1)),h[r].applyMatrix4(p.makeRotationAxis(u,o))),l[r].crossVectors(c[r],h[r]);if(e===!0)for(o=Math.acos(ac.clamp(h[0].dot(h[t]),-1,1)),o/=t,c[0].dot(u.crossVectors(h[0],h[t]))>0&&(o=-o),r=1;r<=t;r++)h[r].applyMatrix4(p.makeRotationAxis(c[r],o*r)),l[r].crossVectors(c[r],h[r]);return{tangents:c,normals:h,binormals:l}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){var t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),xn.prototype=Object.create(yn.prototype),xn.prototype.constructor=xn,xn.prototype.isEllipseCurve=!0,xn.prototype.getPoint=function(t,e){for(var n=e||new r,i=2*Math.PI,a=this.aEndAngle-this.aStartAngle,o=Math.abs(a)<Number.EPSILON;a<0;)a+=i;for(;a>i;)a-=i;a<Number.EPSILON&&(a=o?0:i),this.aClockwise!==!0||o||(a===i?a=-i:a-=i);var s=this.aStartAngle+t*a,c=this.aX+this.xRadius*Math.cos(s),h=this.aY+this.yRadius*Math.sin(s);if(0!==this.aRotation){var l=Math.cos(this.aRotation),u=Math.sin(this.aRotation),p=c-this.aX,d=h-this.aY;c=p*l-d*u+this.aX,h=p*u+d*l+this.aY}return n.set(c,h)},xn.prototype.copy=function(t){return yn.prototype.copy.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},xn.prototype.toJSON=function(){var t=yn.prototype.toJSON.call(this);return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t},xn.prototype.fromJSON=function(t){return yn.prototype.fromJSON.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},bn.prototype=Object.create(xn.prototype),bn.prototype.constructor=bn,bn.prototype.isArcCurve=!0;var Il=new a,Ol=new _n,Nl=new _n,Ul=new _n;wn.prototype=Object.create(yn.prototype),wn.prototype.constructor=wn,wn.prototype.isCatmullRomCurve3=!0,wn.prototype.getPoint=function(t,e){var r=e||new a,n=this.points,i=n.length,o=(i-(this.closed?0:1))*t,s=Math.floor(o),c=o-s;this.closed?s+=s>0?0:(Math.floor(Math.abs(s)/n.length)+1)*n.length:0===c&&s===i-1&&(s=i-2,c=1);var h,l,u,p;if(this.closed||s>0?h=n[(s-1)%i]:(Il.subVectors(n[0],n[1]).add(n[0]),h=Il),l=n[s%i],u=n[(s+1)%i],this.closed||s+2<i?p=n[(s+2)%i]:(Il.subVectors(n[i-1],n[i-2]).add(n[i-1]),p=Il),"centripetal"===this.curveType||"chordal"===this.curveType){var d="chordal"===this.curveType?.5:.25,f=Math.pow(h.distanceToSquared(l),d),m=Math.pow(l.distanceToSquared(u),d),v=Math.pow(u.distanceToSquared(p),d);m<1e-4&&(m=1),f<1e-4&&(f=m),v<1e-4&&(v=m),Ol.initNonuniformCatmullRom(h.x,l.x,u.x,p.x,f,m,v),Nl.initNonuniformCatmullRom(h.y,l.y,u.y,p.y,f,m,v),Ul.initNonuniformCatmullRom(h.z,l.z,u.z,p.z,f,m,v)}else"catmullrom"===this.curveType&&(Ol.initCatmullRom(h.x,l.x,u.x,p.x,this.tension),Nl.initCatmullRom(h.y,l.y,u.y,p.y,this.tension),Ul.initCatmullRom(h.z,l.z,u.z,p.z,this.tension));return r.set(Ol.calc(c),Nl.calc(c),Ul.calc(c)),r},wn.prototype.copy=function(t){yn.prototype.copy.call(this,t),this.points=[];for(var e=0,r=t.points.length;e<r;e++){var n=t.points[e];this.points.push(n.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},wn.prototype.toJSON=function(){var t=yn.prototype.toJSON.call(this);t.points=[];for(var e=0,r=this.points.length;e<r;e++){var n=this.points[e];t.points.push(n.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t},wn.prototype.fromJSON=function(t){yn.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,r=t.points.length;e<r;e++){var n=t.points[e];this.points.push((new a).fromArray(n))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},On.prototype=Object.create(yn.prototype),On.prototype.constructor=On,On.prototype.isCubicBezierCurve=!0,On.prototype.getPoint=function(t,e){var n=e||new r,i=this.v0,a=this.v1,o=this.v2,s=this.v3;return n.set(In(t,i.x,a.x,o.x,s.x),In(t,i.y,a.y,o.y,s.y)),n},On.prototype.copy=function(t){return yn.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},On.prototype.toJSON=function(){var t=yn.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},On.prototype.fromJSON=function(t){return yn.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},Nn.prototype=Object.create(yn.prototype),Nn.prototype.constructor=Nn,Nn.prototype.isCubicBezierCurve3=!0,Nn.prototype.getPoint=function(t,e){var r=e||new a,n=this.v0,i=this.v1,o=this.v2,s=this.v3;return r.set(In(t,n.x,i.x,o.x,s.x),In(t,n.y,i.y,o.y,s.y),In(t,n.z,i.z,o.z,s.z)),r},Nn.prototype.copy=function(t){return yn.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},Nn.prototype.toJSON=function(){var t=yn.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},Nn.prototype.fromJSON=function(t){return yn.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},Un.prototype=Object.create(yn.prototype),Un.prototype.constructor=Un,Un.prototype.isLineCurve=!0,Un.prototype.getPoint=function(t,e){var n=e||new r;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Un.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Un.prototype.getTangent=function(){var t=this.v2.clone().sub(this.v1);return t.normalize()},Un.prototype.copy=function(t){return yn.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Un.prototype.toJSON=function(){var t=yn.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Un.prototype.fromJSON=function(t){return yn.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Dn.prototype=Object.create(yn.prototype),Dn.prototype.constructor=Dn,Dn.prototype.isLineCurve3=!0,Dn.prototype.getPoint=function(t,e){var r=e||new a;return 1===t?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(t).add(this.v1)),r},Dn.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Dn.prototype.copy=function(t){return yn.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Dn.prototype.toJSON=function(){var t=yn.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Dn.prototype.fromJSON=function(t){return yn.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Bn.prototype=Object.create(yn.prototype),Bn.prototype.constructor=Bn,Bn.prototype.isQuadraticBezierCurve=!0,Bn.prototype.getPoint=function(t,e){var n=e||new r,i=this.v0,a=this.v1,o=this.v2;return n.set(An(t,i.x,a.x,o.x),An(t,i.y,a.y,o.y)),n},Bn.prototype.copy=function(t){return yn.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Bn.prototype.toJSON=function(){var t=yn.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Bn.prototype.fromJSON=function(t){return yn.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Fn.prototype=Object.create(yn.prototype),Fn.prototype.constructor=Fn,Fn.prototype.isQuadraticBezierCurve3=!0,Fn.prototype.getPoint=function(t,e){var r=e||new a,n=this.v0,i=this.v1,o=this.v2;return r.set(An(t,n.x,i.x,o.x),An(t,n.y,i.y,o.y),An(t,n.z,i.z,o.z)),r},Fn.prototype.copy=function(t){return yn.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Fn.prototype.toJSON=function(){var t=yn.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Fn.prototype.fromJSON=function(t){return yn.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},zn.prototype=Object.create(yn.prototype),zn.prototype.constructor=zn,zn.prototype.isSplineCurve=!0,zn.prototype.getPoint=function(t,e){var n=e||new r,i=this.points,a=(i.length-1)*t,o=Math.floor(a),s=a-o,c=i[0===o?o:o-1],h=i[o],l=i[o>i.length-2?i.length-1:o+1],u=i[o>i.length-3?i.length-1:o+2];return n.set(Mn(s,c.x,h.x,l.x,u.x),Mn(s,c.y,h.y,l.y,u.y)),n},zn.prototype.copy=function(t){yn.prototype.copy.call(this,t),this.points=[];for(var e=0,r=t.points.length;e<r;e++){var n=t.points[e];this.points.push(n.clone())}return this},zn.prototype.toJSON=function(){var t=yn.prototype.toJSON.call(this);t.points=[];for(var e=0,r=this.points.length;e<r;e++){var n=this.points[e];t.points.push(n.toArray())}return t},zn.prototype.fromJSON=function(t){yn.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push((new r).fromArray(i))}return this};var Dl=Object.freeze({ArcCurve:bn,CatmullRomCurve3:wn,CubicBezierCurve:On,CubicBezierCurve3:Nn,EllipseCurve:xn,LineCurve:Un,LineCurve3:Dn,QuadraticBezierCurve:Bn,QuadraticBezierCurve3:Fn,SplineCurve:zn});Gn.prototype=Object.assign(Object.create(yn.prototype),{constructor:Gn,add:function(t){this.curves.push(t)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new Un(e,t))},getPoint:function(t){for(var e=t*this.getLength(),r=this.getCurveLengths(),n=0;n<r.length;){if(r[n]>=e){var i=r[n]-e,a=this.curves[n],o=a.getLength(),s=0===o?0:1-i/o;return a.getPointAt(s)}n++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,r=0,n=this.curves.length;r<n;r++)e+=this.curves[r].getLength(),t.push(e);return this.cacheLengths=t,t},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],r=0;r<=t;r++)e.push(this.getPoint(r/t));return this.autoClose&&e.push(e[0]),e},getPoints:function(t){t=t||12;for(var e,r=[],n=0,i=this.curves;n<i.length;n++)for(var a=i[n],o=a&&a.isEllipseCurve?2*t:a&&a.isLineCurve?1:a&&a.isSplineCurve?t*a.points.length:t,s=a.getPoints(o),c=0;c<s.length;c++){var h=s[c];e&&e.equals(h)||(r.push(h),e=h)}return this.autoClose&&r.length>1&&!r[r.length-1].equals(r[0])&&r.push(r[0]),r},copy:function(t){yn.prototype.copy.call(this,t),this.curves=[];for(var e=0,r=t.curves.length;e<r;e++){var n=t.curves[e];this.curves.push(n.clone())}return this.autoClose=t.autoClose,this},toJSON:function(){var t=yn.prototype.toJSON.call(this);t.autoClose=this.autoClose,t.curves=[];for(var e=0,r=this.curves.length;e<r;e++){var n=this.curves[e];t.curves.push(n.toJSON())}return t},fromJSON:function(t){yn.prototype.fromJSON.call(this,t),this.autoClose=t.autoClose,this.curves=[];for(var e=0,r=t.curves.length;e<r;e++){var n=t.curves[e];this.curves.push((new Dl[n.type]).fromJSON(n))}return this}}),Hn.prototype=Object.assign(Object.create(Gn.prototype),{constructor:Hn,setFromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,r=t.length;e<r;e++)this.lineTo(t[e].x,t[e].y)},moveTo:function(t,e){this.currentPoint.set(t,e)},lineTo:function(t,e){var n=new Un(this.currentPoint.clone(),new r(t,e));this.curves.push(n),this.currentPoint.set(t,e)},quadraticCurveTo:function(t,e,n,i){var a=new Bn(this.currentPoint.clone(),new r(t,e),new r(n,i));this.curves.push(a),this.currentPoint.set(n,i)},bezierCurveTo:function(t,e,n,i,a,o){var s=new On(this.currentPoint.clone(),new r(t,e),new r(n,i),new r(a,o));this.curves.push(s),this.currentPoint.set(a,o)},splineThru:function(t){var e=[this.currentPoint.clone()].concat(t),r=new zn(e);this.curves.push(r),this.currentPoint.copy(t[t.length-1])},arc:function(t,e,r,n,i,a){var o=this.currentPoint.x,s=this.currentPoint.y;this.absarc(t+o,e+s,r,n,i,a)},absarc:function(t,e,r,n,i,a){this.absellipse(t,e,r,r,n,i,a)},ellipse:function(t,e,r,n,i,a,o,s){var c=this.currentPoint.x,h=this.currentPoint.y;this.absellipse(t+c,e+h,r,n,i,a,o,s)},absellipse:function(t,e,r,n,i,a,o,s){var c=new xn(t,e,r,n,i,a,o,s);if(this.curves.length>0){var h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);var l=c.getPoint(1);this.currentPoint.copy(l)},copy:function(t){return Gn.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){var t=Gn.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return Gn.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),Vn.prototype=Object.assign(Object.create(Hn.prototype),{constructor:Vn,getPointsHoles:function(t){for(var e=[],r=0,n=this.holes.length;r<n;r++)e[r]=this.holes[r].getPoints(t);return e},extractPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},copy:function(t){Hn.prototype.copy.call(this,t),this.holes=[];for(var e=0,r=t.holes.length;e<r;e++){var n=t.holes[e];this.holes.push(n.clone())}return this},toJSON:function(){var t=Hn.prototype.toJSON.call(this);t.uuid=this.uuid,t.holes=[];for(var e=0,r=this.holes.length;e<r;e++){var n=this.holes[e];t.holes.push(n.toJSON())}return t},fromJSON:function(t){Hn.prototype.fromJSON.call(this,t),this.uuid=t.uuid,this.holes=[];for(var e=0,r=t.holes.length;e<r;e++){var n=t.holes[e];this.holes.push((new Hn).fromJSON(n))}return this}}),kn.prototype=Object.assign(Object.create(ht.prototype),{constructor:kn,isLight:!0,copy:function(t){return ht.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){var e=ht.prototype.toJSON.call(this,t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}),jn.prototype=Object.assign(Object.create(kn.prototype),{constructor:jn,isHemisphereLight:!0,copy:function(t){return kn.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(Wn.prototype,{copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t={};return 0!==this.bias&&(t.bias=this.bias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}),Xn.prototype=Object.assign(Object.create(Wn.prototype),{constructor:Xn,isSpotLightShadow:!0,update:function(t){var e=this.camera,r=2*ac.RAD2DEG*t.angle,n=this.mapSize.width/this.mapSize.height,i=t.distance||e.far;r===e.fov&&n===e.aspect&&i===e.far||(e.fov=r,e.aspect=n,e.far=i,e.updateProjectionMatrix())}}),qn.prototype=Object.assign(Object.create(kn.prototype),{constructor:qn,isSpotLight:!0,copy:function(t){return kn.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Yn.prototype=Object.assign(Object.create(kn.prototype),{constructor:Yn,isPointLight:!0,copy:function(t){return kn.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),Zn.prototype=Object.assign(Object.create(Wn.prototype),{constructor:Zn}),Jn.prototype=Object.assign(Object.create(kn.prototype),{
  105. constructor:Jn,isDirectionalLight:!0,copy:function(t){return kn.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Qn.prototype=Object.assign(Object.create(kn.prototype),{constructor:Qn,isAmbientLight:!0}),Kn.prototype=Object.assign(Object.create(kn.prototype),{constructor:Kn,isRectAreaLight:!0,copy:function(t){return kn.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},toJSON:function(t){var e=kn.prototype.toJSON.call(this,t);return e.object.width=this.width,e.object.height=this.height,e}}),$n.prototype=Object.assign(Object.create(hi.prototype),{constructor:$n,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:Gs,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),ti.prototype=Object.assign(Object.create(hi.prototype),{constructor:ti,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:Gs,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Object.assign(ei.prototype,{evaluate:function(t){var e=this.parameterPositions,r=this._cachedIndex,n=e[r],i=e[r-1];t:{e:{var a;r:{n:if(!(t<n)){for(var o=r+2;;){if(void 0===n){if(t<i)break n;return r=e.length,this._cachedIndex=r,this.afterEnd_(r-1,t,i)}if(r===o)break;if(i=n,n=e[++r],t<n)break e}a=e.length;break r}{if(t>=i)break t;var s=e[1];t<s&&(r=2,i=s);for(var o=r-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,t,n);if(r===o)break;if(n=i,i=e[--r-1],t>=i)break e}a=r,r=0}}for(;r<a;){var c=r+a>>>1;t<e[c]?a=c:r=c+1}if(n=e[r],i=e[r-1],void 0===i)return this._cachedIndex=0,this.beforeStart_(0,t,n);if(void 0===n)return r=e.length,this._cachedIndex=r,this.afterEnd_(r-1,i,t)}this._cachedIndex=r,this.intervalChanged_(r,i,n)}return this.interpolate_(r,i,t,n)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){for(var e=this.resultBuffer,r=this.sampleValues,n=this.valueSize,i=t*n,a=0;a!==n;++a)e[a]=r[i+a];return e},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(ei.prototype,{beforeStart_:ei.prototype.copySampleValue_,afterEnd_:ei.prototype.copySampleValue_}),ri.prototype=Object.assign(Object.create(ei.prototype),{constructor:ri,interpolate_:function(t,e,r,n){for(var a=this.resultBuffer,o=this.sampleValues,s=this.valueSize,c=t*s,h=(r-e)/(n-e),l=c+s;c!==l;c+=4)i.slerpFlat(a,0,o,c-s,o,c,h);return a}}),ni.prototype=Object.assign(Object.create(hi.prototype),{constructor:ni,ValueTypeName:"quaternion",DefaultInterpolation:Hs,InterpolantFactoryMethodLinear:function(t){return new ri(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),ii.prototype=Object.assign(Object.create(hi.prototype),{constructor:ii,ValueTypeName:"color"}),ai.prototype=Object.assign(Object.create(hi.prototype),{constructor:ai,ValueTypeName:"number"}),oi.prototype=Object.assign(Object.create(ei.prototype),{constructor:oi,DefaultSettings_:{endingStart:ks,endingEnd:ks},intervalChanged_:function(t,e,r){var n=this.parameterPositions,i=t-2,a=t+1,o=n[i],s=n[a];if(void 0===o)switch(this.getSettings_().endingStart){case js:i=t,o=2*e-r;break;case Ws:i=n.length-2,o=e+n[i]-n[i+1];break;default:i=t,o=r}if(void 0===s)switch(this.getSettings_().endingEnd){case js:a=t,s=2*r-e;break;case Ws:a=1,s=r+n[1]-n[0];break;default:a=t-1,s=e}var c=.5*(r-e),h=this.valueSize;this._weightPrev=c/(e-o),this._weightNext=c/(s-r),this._offsetPrev=i*h,this._offsetNext=a*h},interpolate_:function(t,e,r,n){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,c=s-o,h=this._offsetPrev,l=this._offsetNext,u=this._weightPrev,p=this._weightNext,d=(r-e)/(n-e),f=d*d,m=f*d,v=-u*m+2*u*f-u*d,g=(1+u)*m+(-1.5-2*u)*f+(-.5+u)*d+1,y=(-1-p)*m+(1.5+p)*f+.5*d,x=p*m-p*f,b=0;b!==o;++b)i[b]=v*a[h+b]+g*a[c+b]+y*a[s+b]+x*a[l+b];return i}}),si.prototype=Object.assign(Object.create(ei.prototype),{constructor:si,interpolate_:function(t,e,r,n){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,c=s-o,h=(r-e)/(n-e),l=1-h,u=0;u!==o;++u)i[u]=a[c+u]*l+a[s+u]*h;return i}}),ci.prototype=Object.assign(Object.create(ei.prototype),{constructor:ci,interpolate_:function(t){return this.copySampleValue_(t-1)}});var Bl={arraySlice:function(t,e,r){return Bl.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==r?r:t.length)):t.slice(e,r)},convertArray:function(t,e,r){return!t||!r&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){function e(e,r){return t[e]-t[r]}for(var r=t.length,n=new Array(r),i=0;i!==r;++i)n[i]=i;return n.sort(e),n},sortedArray:function(t,e,r){for(var n=t.length,i=new t.constructor(n),a=0,o=0;o!==n;++a)for(var s=r[a]*e,c=0;c!==e;++c)i[o++]=t[s+c];return i},flattenJSON:function(t,e,r,n){for(var i=1,a=t[0];void 0!==a&&void 0===a[n];)a=t[i++];if(void 0!==a){var o=a[n];if(void 0!==o)if(Array.isArray(o)){do o=a[n],void 0!==o&&(e.push(a.time),r.push.apply(r,o)),a=t[i++];while(void 0!==a)}else if(void 0!==o.toArray){do o=a[n],void 0!==o&&(e.push(a.time),o.toArray(r,r.length)),a=t[i++];while(void 0!==a)}else do o=a[n],void 0!==o&&(e.push(a.time),r.push(o)),a=t[i++];while(void 0!==a)}}};Object.assign(hi,{parse:function(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var e=hi._getTrackTypeForValueTypeName(t.type);if(void 0===t.times){var r=[],n=[];Bl.flattenJSON(t.keys,r,n,"value"),t.times=r,t.values=n}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)},toJSON:function(t){var e,r=t.constructor;if(void 0!==r.toJSON)e=r.toJSON(t);else{e={name:t.name,times:Bl.convertArray(t.times,Array),values:Bl.convertArray(t.values,Array)};var n=t.getInterpolation();n!==t.DefaultInterpolation&&(e.interpolation=n)}return e.type=t.ValueTypeName,e},_getTrackTypeForValueTypeName:function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return ai;case"vector":case"vector2":case"vector3":case"vector4":return li;case"color":return ii;case"quaternion":return ni;case"bool":case"boolean":return ti;case"string":return $n}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}}),Object.assign(hi.prototype,{constructor:hi,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:Hs,InterpolantFactoryMethodDiscrete:function(t){return new ci(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new si(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new oi(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var e;switch(t){case Gs:e=this.InterpolantFactoryMethodDiscrete;break;case Hs:e=this.InterpolantFactoryMethodLinear;break;case Vs:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){var r="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(r);this.setInterpolation(this.DefaultInterpolation)}return void console.warn("THREE.KeyframeTrack:",r)}this.createInterpolant=e},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Gs;case this.InterpolantFactoryMethodLinear:return Hs;case this.InterpolantFactoryMethodSmooth:return Vs}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var e=this.times,r=0,n=e.length;r!==n;++r)e[r]+=t;return this},scale:function(t){if(1!==t)for(var e=this.times,r=0,n=e.length;r!==n;++r)e[r]*=t;return this},trim:function(t,e){for(var r=this.times,n=r.length,i=0,a=n-1;i!==n&&r[i]<t;)++i;for(;a!==-1&&r[a]>e;)--a;if(++a,0!==i||a!==n){i>=a&&(a=Math.max(a,1),i=a-1);var o=this.getValueSize();this.times=Bl.arraySlice(r,i,a),this.values=Bl.arraySlice(this.values,i*o,a*o)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var r=this.times,n=this.values,i=r.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var a=null,o=0;o!==i;o++){var s=r[o];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),t=!1;break}if(null!==a&&a>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),t=!1;break}a=s}if(void 0!==n&&Bl.isTypedArray(n))for(var o=0,c=n.length;o!==c;++o){var h=n[o];if(isNaN(h)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,h),t=!1;break}}return t},optimize:function(){for(var t=this.times,e=this.values,r=this.getValueSize(),n=this.getInterpolation()===Vs,i=1,a=t.length-1,o=1;o<a;++o){var s=!1,c=t[o],h=t[o+1];if(c!==h&&(1!==o||c!==c[0]))if(n)s=!0;else for(var l=o*r,u=l-r,p=l+r,d=0;d!==r;++d){var f=e[l+d];if(f!==e[u+d]||f!==e[p+d]){s=!0;break}}if(s){if(o!==i){t[i]=t[o];for(var m=o*r,v=i*r,d=0;d!==r;++d)e[v+d]=e[m+d]}++i}}if(a>0){t[i]=t[a];for(var m=a*r,v=i*r,d=0;d!==r;++d)e[v+d]=e[m+d];++i}return i!==t.length&&(this.times=Bl.arraySlice(t,0,i),this.values=Bl.arraySlice(e,0,i*r)),this}}),li.prototype=Object.assign(Object.create(hi.prototype),{constructor:li,ValueTypeName:"vector"}),Object.assign(ui,{parse:function(t){for(var e=[],r=t.tracks,n=1/(t.fps||1),i=0,a=r.length;i!==a;++i)e.push(hi.parse(r[i]).scale(n));return new ui(t.name,t.duration,e)},toJSON:function(t){for(var e=[],r=t.tracks,n={name:t.name,duration:t.duration,tracks:e},i=0,a=r.length;i!==a;++i)e.push(hi.toJSON(r[i]));return n},CreateFromMorphTargetSequence:function(t,e,r,n){for(var i=e.length,a=[],o=0;o<i;o++){var s=[],c=[];s.push((o+i-1)%i,o,(o+1)%i),c.push(0,1,0);var h=Bl.getKeyframeOrder(s);s=Bl.sortedArray(s,1,h),c=Bl.sortedArray(c,1,h),n||0!==s[0]||(s.push(i),c.push(c[0])),a.push(new ai(".morphTargetInfluences["+e[o].name+"]",s,c).scale(1/r))}return new ui(t,-1,a)},findByName:function(t,e){var r=t;if(!Array.isArray(t)){var n=t;r=n.geometry&&n.geometry.animations||n.animations}for(var i=0;i<r.length;i++)if(r[i].name===e)return r[i];return null},CreateClipsFromMorphTargetSequences:function(t,e,r){for(var n={},i=/^([\w-]*?)([\d]+)$/,a=0,o=t.length;a<o;a++){var s=t[a],c=s.name.match(i);if(c&&c.length>1){var h=c[1],l=n[h];l||(n[h]=l=[]),l.push(s)}}var u=[];for(var h in n)u.push(ui.CreateFromMorphTargetSequence(h,n[h],e,r));return u},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var r=function(t,e,r,n,i){if(0!==r.length){var a=[],o=[];Bl.flattenJSON(r,a,o,n),0!==a.length&&i.push(new t(e,a,o))}},n=[],i=t.name||"default",a=t.length||-1,o=t.fps||30,s=t.hierarchy||[],c=0;c<s.length;c++){var h=s[c].keys;if(h&&0!==h.length)if(h[0].morphTargets){for(var l={},u=0;u<h.length;u++)if(h[u].morphTargets)for(var p=0;p<h[u].morphTargets.length;p++)l[h[u].morphTargets[p]]=-1;for(var d in l){for(var f=[],m=[],p=0;p!==h[u].morphTargets.length;++p){var v=h[u];f.push(v.time),m.push(v.morphTarget===d?1:0)}n.push(new ai(".morphTargetInfluence["+d+"]",f,m))}a=l.length*(o||1)}else{var g=".bones["+e[c].name+"]";r(li,g+".position",h,"pos",n),r(ni,g+".quaternion",h,"rot",n),r(li,g+".scale",h,"scl",n)}}if(0===n.length)return null;var y=new ui(i,a,n);return y}}),Object.assign(ui.prototype,{resetDuration:function(){for(var t=this.tracks,e=0,r=0,n=t.length;r!==n;++r){var i=this.tracks[r];e=Math.max(e,i.times[i.times.length-1])}this.duration=e},trim:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},optimize:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}}),Object.assign(pi.prototype,{load:function(t,e,r,n){var i=this,a=new pn(i.manager);a.load(t,function(t){e(i.parse(JSON.parse(t)))},r,n)},setTextures:function(t){this.textures=t},parse:function(t){function e(t){return void 0===n[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),n[t]}var n=this.textures,i=new Rl[t.type];if(void 0!==t.uuid&&(i.uuid=t.uuid),void 0!==t.name&&(i.name=t.name),void 0!==t.color&&i.color.setHex(t.color),void 0!==t.roughness&&(i.roughness=t.roughness),void 0!==t.metalness&&(i.metalness=t.metalness),void 0!==t.emissive&&i.emissive.setHex(t.emissive),void 0!==t.specular&&i.specular.setHex(t.specular),void 0!==t.shininess&&(i.shininess=t.shininess),void 0!==t.clearCoat&&(i.clearCoat=t.clearCoat),void 0!==t.clearCoatRoughness&&(i.clearCoatRoughness=t.clearCoatRoughness),void 0!==t.uniforms&&(i.uniforms=t.uniforms),void 0!==t.vertexShader&&(i.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(i.fragmentShader=t.fragmentShader),void 0!==t.vertexColors&&(i.vertexColors=t.vertexColors),void 0!==t.fog&&(i.fog=t.fog),void 0!==t.flatShading&&(i.flatShading=t.flatShading),void 0!==t.blending&&(i.blending=t.blending),void 0!==t.side&&(i.side=t.side),void 0!==t.opacity&&(i.opacity=t.opacity),void 0!==t.transparent&&(i.transparent=t.transparent),void 0!==t.alphaTest&&(i.alphaTest=t.alphaTest),void 0!==t.depthTest&&(i.depthTest=t.depthTest),void 0!==t.depthWrite&&(i.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(i.colorWrite=t.colorWrite),void 0!==t.wireframe&&(i.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(i.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(i.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(i.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(i.rotation=t.rotation),1!==t.linewidth&&(i.linewidth=t.linewidth),void 0!==t.dashSize&&(i.dashSize=t.dashSize),void 0!==t.gapSize&&(i.gapSize=t.gapSize),void 0!==t.scale&&(i.scale=t.scale),void 0!==t.skinning&&(i.skinning=t.skinning),void 0!==t.morphTargets&&(i.morphTargets=t.morphTargets),void 0!==t.dithering&&(i.dithering=t.dithering),void 0!==t.visible&&(i.visible=t.visible),void 0!==t.userData&&(i.userData=t.userData),void 0!==t.shading&&(i.flatShading=1===t.shading),void 0!==t.size&&(i.size=t.size),void 0!==t.sizeAttenuation&&(i.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(i.map=e(t.map)),void 0!==t.alphaMap&&(i.alphaMap=e(t.alphaMap),i.transparent=!0),void 0!==t.bumpMap&&(i.bumpMap=e(t.bumpMap)),void 0!==t.bumpScale&&(i.bumpScale=t.bumpScale),void 0!==t.normalMap&&(i.normalMap=e(t.normalMap)),void 0!==t.normalScale){var a=t.normalScale;Array.isArray(a)===!1&&(a=[a,a]),i.normalScale=(new r).fromArray(a)}return void 0!==t.displacementMap&&(i.displacementMap=e(t.displacementMap)),void 0!==t.displacementScale&&(i.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(i.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(i.roughnessMap=e(t.roughnessMap)),void 0!==t.metalnessMap&&(i.metalnessMap=e(t.metalnessMap)),void 0!==t.emissiveMap&&(i.emissiveMap=e(t.emissiveMap)),void 0!==t.emissiveIntensity&&(i.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(i.specularMap=e(t.specularMap)),void 0!==t.envMap&&(i.envMap=e(t.envMap)),void 0!==t.reflectivity&&(i.reflectivity=t.reflectivity),void 0!==t.lightMap&&(i.lightMap=e(t.lightMap)),void 0!==t.lightMapIntensity&&(i.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(i.aoMap=e(t.aoMap)),void 0!==t.aoMapIntensity&&(i.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(i.gradientMap=e(t.gradientMap)),i}}),Object.assign(di.prototype,{load:function(t,e,r,n){var i=this,a=new pn(i.manager);a.load(t,function(t){e(i.parse(JSON.parse(t)))},r,n)},parse:function(t){var e=new St,r=t.data.index;if(void 0!==r){var n=new Fl[r.type](r.array);e.setIndex(new ft(n,1))}var i=t.data.attributes;for(var o in i){var s=i[o],n=new Fl[s.type](s.array);e.addAttribute(o,new ft(n,s.itemSize,s.normalized))}var c=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==c)for(var h=0,l=c.length;h!==l;++h){var u=c[h];e.addGroup(u.start,u.count,u.materialIndex)}var p=t.data.boundingSphere;if(void 0!==p){var d=new a;void 0!==p.center&&d.fromArray(p.center),e.boundingSphere=new rt(d,p.radius)}return e}});var Fl={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};fi.Handlers={handlers:[],add:function(t,e){this.handlers.push(t,e)},get:function(t){for(var e=this.handlers,r=0,n=e.length;r<n;r+=2){var i=e[r],a=e[r+1];if(i.test(t))return a}return null}},Object.assign(fi.prototype,{crossOrigin:void 0,initMaterials:function(t,e,r){for(var n=[],i=0;i<t.length;++i)n[i]=this.createMaterial(t[i],e,r);return n},createMaterial:function(){var t={NoBlending:oo,NormalBlending:so,AdditiveBlending:co,SubtractiveBlending:ho,MultiplyBlending:lo,CustomBlending:uo},e=new q,r=new gn,n=new pi;return function(i,a,o){function s(t,e,n,i,s){var h,l=a+t,u=fi.Handlers.get(l);null!==u?h=u.load(l):(r.setCrossOrigin(o),h=r.load(l)),void 0!==e&&(h.repeat.fromArray(e),1!==e[0]&&(h.wrapS=$o),1!==e[1]&&(h.wrapT=$o)),void 0!==n&&h.offset.fromArray(n),void 0!==i&&("repeat"===i[0]&&(h.wrapS=$o),"mirror"===i[0]&&(h.wrapS=es),"repeat"===i[1]&&(h.wrapT=$o),"mirror"===i[1]&&(h.wrapT=es)),void 0!==s&&(h.anisotropy=s);var p=ac.generateUUID();return c[p]=h,p}var c={},h={uuid:ac.generateUUID(),type:"MeshLambertMaterial"};for(var l in i){var u=i[l];switch(l){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":h.name=u;break;case"blending":h.blending=t[u];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",l,"is no longer supported.");break;case"colorDiffuse":h.color=e.fromArray(u).getHex();break;case"colorSpecular":h.specular=e.fromArray(u).getHex();break;case"colorEmissive":h.emissive=e.fromArray(u).getHex();break;case"specularCoef":h.shininess=u;break;case"shading":"basic"===u.toLowerCase()&&(h.type="MeshBasicMaterial"),"phong"===u.toLowerCase()&&(h.type="MeshPhongMaterial"),"standard"===u.toLowerCase()&&(h.type="MeshStandardMaterial");break;case"mapDiffuse":h.map=s(u,i.mapDiffuseRepeat,i.mapDiffuseOffset,i.mapDiffuseWrap,i.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":h.emissiveMap=s(u,i.mapEmissiveRepeat,i.mapEmissiveOffset,i.mapEmissiveWrap,i.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":h.lightMap=s(u,i.mapLightRepeat,i.mapLightOffset,i.mapLightWrap,i.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":h.aoMap=s(u,i.mapAORepeat,i.mapAOOffset,i.mapAOWrap,i.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":h.bumpMap=s(u,i.mapBumpRepeat,i.mapBumpOffset,i.mapBumpWrap,i.mapBumpAnisotropy);break;case"mapBumpScale":h.bumpScale=u;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":h.normalMap=s(u,i.mapNormalRepeat,i.mapNormalOffset,i.mapNormalWrap,i.mapNormalAnisotropy);break;case"mapNormalFactor":h.normalScale=[u,u];break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":h.specularMap=s(u,i.mapSpecularRepeat,i.mapSpecularOffset,i.mapSpecularWrap,i.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":h.metalnessMap=s(u,i.mapMetalnessRepeat,i.mapMetalnessOffset,i.mapMetalnessWrap,i.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":h.roughnessMap=s(u,i.mapRoughnessRepeat,i.mapRoughnessOffset,i.mapRoughnessWrap,i.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":h.alphaMap=s(u,i.mapAlphaRepeat,i.mapAlphaOffset,i.mapAlphaWrap,i.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":h.side=$a;break;case"doubleSided":h.side=to;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),h.opacity=u;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":h[l]=u;break;case"vertexColors":u===!0&&(h.vertexColors=ao),"face"===u&&(h.vertexColors=io);break;default:console.error("THREE.Loader.createMaterial: Unsupported",l,u)}}return"MeshBasicMaterial"===h.type&&delete h.emissive,"MeshPhongMaterial"!==h.type&&delete h.specular,h.opacity<1&&(h.transparent=!0),n.setTextures(c),n.parse(h)}}()});var zl={decodeText:function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var e="",r=0,n=t.length;r<n;r++)e+=String.fromCharCode(t[r]);return e},extractUrlBase:function(t){var e=t.split("/");return 1===e.length?"./":(e.pop(),e.join("/")+"/")}};Object.assign(mi.prototype,{load:function(t,e,r,n){var i=this,a=this.texturePath&&"string"==typeof this.texturePath?this.texturePath:zl.extractUrlBase(t),o=new pn(this.manager);o.setWithCredentials(this.withCredentials),o.load(t,function(r){var n=JSON.parse(r),o=n.metadata;if(void 0!==o){var s=o.type;if(void 0!==s){if("object"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+t+" should be loaded with THREE.ObjectLoader instead.");if("scene"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+t+" should be loaded with THREE.SceneLoader instead.")}}var c=i.parse(n,a);e(c.geometry,c.materials)},r,n)},setTexturePath:function(t){this.texturePath=t},parse:function(){function t(t,e){function n(t,e){return t&1<<e}var i,o,s,c,h,l,u,p,d,f,m,v,g,y,x,b,_,w,M,E,T,S,A,R,L,P,C,I=t.faces,O=t.vertices,N=t.normals,U=t.colors,D=t.scale,B=0;if(void 0!==t.uvs){for(i=0;i<t.uvs.length;i++)t.uvs[i].length&&B++;for(i=0;i<B;i++)e.faceVertexUvs[i]=[]}for(c=0,h=O.length;c<h;)w=new a,w.x=O[c++]*D,w.y=O[c++]*D,w.z=O[c++]*D,e.vertices.push(w);for(c=0,h=I.length;c<h;)if(f=I[c++],m=n(f,0),v=n(f,1),g=n(f,3),y=n(f,4),x=n(f,5),b=n(f,6),_=n(f,7),m){if(E=new pt,E.a=I[c],E.b=I[c+1],E.c=I[c+3],T=new pt,T.a=I[c+1],T.b=I[c+2],T.c=I[c+3],c+=4,v&&(d=I[c++],E.materialIndex=d,T.materialIndex=d),s=e.faces.length,g)for(i=0;i<B;i++)for(R=t.uvs[i],e.faceVertexUvs[i][s]=[],e.faceVertexUvs[i][s+1]=[],o=0;o<4;o++)p=I[c++],P=R[2*p],C=R[2*p+1],L=new r(P,C),2!==o&&e.faceVertexUvs[i][s].push(L),0!==o&&e.faceVertexUvs[i][s+1].push(L);if(y&&(u=3*I[c++],E.normal.set(N[u++],N[u++],N[u]),T.normal.copy(E.normal)),x)for(i=0;i<4;i++)u=3*I[c++],A=new a(N[u++],N[u++],N[u]),2!==i&&E.vertexNormals.push(A),0!==i&&T.vertexNormals.push(A);if(b&&(l=I[c++],S=U[l],E.color.setHex(S),T.color.setHex(S)),_)for(i=0;i<4;i++)l=I[c++],S=U[l],2!==i&&E.vertexColors.push(new q(S)),0!==i&&T.vertexColors.push(new q(S));e.faces.push(E),e.faces.push(T)}else{if(M=new pt,M.a=I[c++],M.b=I[c++],M.c=I[c++],v&&(d=I[c++],M.materialIndex=d),s=e.faces.length,g)for(i=0;i<B;i++)for(R=t.uvs[i],e.faceVertexUvs[i][s]=[],o=0;o<3;o++)p=I[c++],P=R[2*p],C=R[2*p+1],L=new r(P,C),e.faceVertexUvs[i][s].push(L);if(y&&(u=3*I[c++],M.normal.set(N[u++],N[u++],N[u])),x)for(i=0;i<3;i++)u=3*I[c++],A=new a(N[u++],N[u++],N[u]),M.vertexNormals.push(A);if(b&&(l=I[c++],M.color.setHex(U[l])),_)for(i=0;i<3;i++)l=I[c++],M.vertexColors.push(new q(U[l]));e.faces.push(M)}}function e(t,e){var r=void 0!==t.influencesPerVertex?t.influencesPerVertex:2;if(t.skinWeights)for(var n=0,i=t.skinWeights.length;n<i;n+=r){var a=t.skinWeights[n],o=r>1?t.skinWeights[n+1]:0,s=r>2?t.skinWeights[n+2]:0,h=r>3?t.skinWeights[n+3]:0;e.skinWeights.push(new c(a,o,s,h))}if(t.skinIndices)for(var n=0,i=t.skinIndices.length;n<i;n+=r){var l=t.skinIndices[n],u=r>1?t.skinIndices[n+1]:0,p=r>2?t.skinIndices[n+2]:0,d=r>3?t.skinIndices[n+3]:0;e.skinIndices.push(new c(l,u,p,d))}e.bones=t.bones,e.bones&&e.bones.length>0&&(e.skinWeights.length!==e.skinIndices.length||e.skinIndices.length!==e.vertices.length)&&console.warn("When skinning, number of vertices ("+e.vertices.length+"), skinIndices ("+e.skinIndices.length+"), and skinWeights ("+e.skinWeights.length+") should match.")}function n(t,e){var r=t.scale;if(void 0!==t.morphTargets)for(var n=0,i=t.morphTargets.length;n<i;n++){e.morphTargets[n]={},e.morphTargets[n].name=t.morphTargets[n].name,e.morphTargets[n].vertices=[];for(var o=e.morphTargets[n].vertices,s=t.morphTargets[n].vertices,c=0,h=s.length;c<h;c+=3){var l=new a;l.x=s[c]*r,l.y=s[c+1]*r,l.z=s[c+2]*r,o.push(l)}}if(void 0!==t.morphColors&&t.morphColors.length>0){console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');for(var u=e.faces,p=t.morphColors[0].colors,n=0,i=u.length;n<i;n++)u[n].color.fromArray(p,3*n)}}function i(t,e){var r=[],n=[];void 0!==t.animation&&n.push(t.animation),void 0!==t.animations&&(t.animations.length?n=n.concat(t.animations):n.push(t.animations));for(var i=0;i<n.length;i++){var a=ui.parseAnimation(n[i],e.bones);a&&r.push(a)}if(e.morphTargets){var o=ui.CreateClipsFromMorphTargetSequences(e.morphTargets,10);r=r.concat(o)}r.length>0&&(e.animations=r)}return function(r,a){void 0!==r.data&&(r=r.data),void 0!==r.scale?r.scale=1/r.scale:r.scale=1;var o=new dt;if(t(r,o),e(r,o),n(r,o),i(r,o),o.computeFaceNormals(),o.computeBoundingSphere(),void 0===r.materials||0===r.materials.length)return{geometry:o};var s=fi.prototype.initMaterials(r.materials,a,this.crossOrigin);return{geometry:o,materials:s}}}()}),Object.assign(vi.prototype,{load:function(t,e,r,n){""===this.texturePath&&(this.texturePath=t.substring(0,t.lastIndexOf("/")+1));var i=this,a=new pn(i.manager);a.load(t,function(r){var a=null;try{a=JSON.parse(r)}catch(e){return void 0!==n&&n(e),void console.error("THREE:ObjectLoader: Can't parse "+t+".",e.message)}var o=a.metadata;return void 0===o||void 0===o.type||"geometry"===o.type.toLowerCase()?void console.error("THREE.ObjectLoader: Can't load "+t+". Use THREE.JSONLoader instead."):void i.parse(a,e)},r,n)},setTexturePath:function(t){this.texturePath=t},setCrossOrigin:function(t){this.crossOrigin=t},parse:function(t,e){var r=this.parseShape(t.shapes),n=this.parseGeometries(t.geometries,r),i=this.parseImages(t.images,function(){void 0!==e&&e(s)}),a=this.parseTextures(t.textures,i),o=this.parseMaterials(t.materials,a),s=this.parseObject(t.object,n,o);return t.animations&&(s.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0!==e&&e(s),s},parseShape:function(t){var e={};if(void 0!==t)for(var r=0,n=t.length;r<n;r++){var i=(new Vn).fromJSON(t[r]);e[i.uuid]=i}return e},parseGeometries:function(t,e){var r={};if(void 0!==t)for(var n=new mi,i=new di,a=0,o=t.length;a<o;a++){var s,c=t[a];switch(c.type){case"PlaneGeometry":case"PlaneBufferGeometry":s=new Al[c.type](c.width,c.height,c.widthSegments,c.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":s=new Al[c.type](c.width,c.height,c.depth,c.widthSegments,c.heightSegments,c.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":s=new Al[c.type](c.radius,c.segments,c.thetaStart,c.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":s=new Al[c.type](c.radiusTop,c.radiusBottom,c.height,c.radialSegments,c.heightSegments,c.openEnded,c.thetaStart,c.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":s=new Al[c.type](c.radius,c.height,c.radialSegments,c.heightSegments,c.openEnded,c.thetaStart,c.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":s=new Al[c.type](c.radius,c.widthSegments,c.heightSegments,c.phiStart,c.phiLength,c.thetaStart,c.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":s=new Al[c.type](c.radius,c.detail);break;case"RingGeometry":case"RingBufferGeometry":s=new Al[c.type](c.innerRadius,c.outerRadius,c.thetaSegments,c.phiSegments,c.thetaStart,c.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":s=new Al[c.type](c.radius,c.tube,c.radialSegments,c.tubularSegments,c.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":s=new Al[c.type](c.radius,c.tube,c.tubularSegments,c.radialSegments,c.p,c.q);break;case"LatheGeometry":case"LatheBufferGeometry":s=new Al[c.type](c.points,c.segments,c.phiStart,c.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":s=new Al[c.type](c.vertices,c.indices,c.radius,c.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var h=[],a=0,o=c.shapes.length;a<o;a++){var l=e[c.shapes[a]];h.push(l)}s=new Al[c.type](h,c.curveSegments);break;case"BufferGeometry":s=i.parse(c);break;case"Geometry":s=n.parse(c,this.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+c.type+'"');continue}s.uuid=c.uuid,void 0!==c.name&&(s.name=c.name),r[c.uuid]=s}return r},parseMaterials:function(t,e){var r={};if(void 0!==t){var n=new pi;n.setTextures(e);for(var i=0,a=t.length;i<a;i++){var o=t[i];if("MultiMaterial"===o.type){for(var s=[],c=0;c<o.materials.length;c++)s.push(n.parse(o.materials[c]));r[o.uuid]=s}else r[o.uuid]=n.parse(o)}}return r},parseAnimations:function(t){for(var e=[],r=0;r<t.length;r++){var n=ui.parse(t[r]);e.push(n)}return e},parseImages:function(t,e){function r(t){return n.manager.itemStart(t),o.load(t,function(){n.manager.itemEnd(t)},void 0,function(){n.manager.itemEnd(t),n.manager.itemError(t)})}var n=this,i={};if(void 0!==t&&t.length>0){var a=new un(e),o=new mn(a);o.setCrossOrigin(this.crossOrigin);for(var s=0,c=t.length;s<c;s++){var h=t[s],l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url)?h.url:n.texturePath+h.url;i[h.uuid]=r(l)}}return i},parseTextures:function(t,e){function r(t,e){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}var n={};if(void 0!==t)for(var i=0,a=t.length;i<a;i++){var o=t[i];void 0===o.image&&console.warn('THREE.ObjectLoader: No "image" specified for',o.uuid),void 0===e[o.image]&&console.warn("THREE.ObjectLoader: Undefined image",o.image);var c=new s(e[o.image]);c.needsUpdate=!0,c.uuid=o.uuid,void 0!==o.name&&(c.name=o.name),void 0!==o.mapping&&(c.mapping=r(o.mapping,Gl)),void 0!==o.offset&&c.offset.fromArray(o.offset),void 0!==o.repeat&&c.repeat.fromArray(o.repeat),void 0!==o.center&&c.center.fromArray(o.center),void 0!==o.rotation&&(c.rotation=o.rotation),void 0!==o.wrap&&(c.wrapS=r(o.wrap[0],Hl),c.wrapT=r(o.wrap[1],Hl)),void 0!==o.minFilter&&(c.minFilter=r(o.minFilter,Vl)),void 0!==o.magFilter&&(c.magFilter=r(o.magFilter,Vl)),void 0!==o.anisotropy&&(c.anisotropy=o.anisotropy),void 0!==o.flipY&&(c.flipY=o.flipY),n[o.uuid]=c}return n},parseObject:function(){var t=new n;return function(e,r,n){function i(t){return void 0===r[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),r[t]}function a(t){if(void 0!==t){if(Array.isArray(t)){for(var e=[],r=0,i=t.length;r<i;r++){var a=t[r];void 0===n[a]&&console.warn("THREE.ObjectLoader: Undefined material",a),e.push(n[a])}return e}return void 0===n[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),n[t]}}var o;switch(e.type){case"Scene":o=new Ee,void 0!==e.background&&Number.isInteger(e.background)&&(o.background=new q(e.background)),void 0!==e.fog&&("Fog"===e.fog.type?o.fog=new Me(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(o.fog=new we(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":o=new me(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(o.focus=e.focus),void 0!==e.zoom&&(o.zoom=e.zoom),void 0!==e.filmGauge&&(o.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(o.filmOffset=e.filmOffset),
  106. void 0!==e.view&&(o.view=Object.assign({},e.view));break;case"OrthographicCamera":o=new ut(e.left,e.right,e.top,e.bottom,e.near,e.far);break;case"AmbientLight":o=new Qn(e.color,e.intensity);break;case"DirectionalLight":o=new Jn(e.color,e.intensity);break;case"PointLight":o=new Yn(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":o=new Kn(e.color,e.intensity,e.width,e.height);break;case"SpotLight":o=new qn(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":o=new jn(e.color,e.groundColor,e.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var s=i(e.geometry),c=a(e.material);o=s.bones&&s.bones.length>0?new Ce(s,c):new Dt(s,c);break;case"LOD":o=new Re;break;case"Line":o=new Oe(i(e.geometry),a(e.material),e.mode);break;case"LineLoop":o=new Ue(i(e.geometry),a(e.material));break;case"LineSegments":o=new Ne(i(e.geometry),a(e.material));break;case"PointCloud":case"Points":o=new Be(i(e.geometry),a(e.material));break;case"Sprite":o=new Ae(a(e.material));break;case"Group":o=new Fe;break;default:o=new ht}if(o.uuid=e.uuid,void 0!==e.name&&(o.name=e.name),void 0!==e.matrix?(t.fromArray(e.matrix),t.decompose(o.position,o.quaternion,o.scale)):(void 0!==e.position&&o.position.fromArray(e.position),void 0!==e.rotation&&o.rotation.fromArray(e.rotation),void 0!==e.quaternion&&o.quaternion.fromArray(e.quaternion),void 0!==e.scale&&o.scale.fromArray(e.scale)),void 0!==e.castShadow&&(o.castShadow=e.castShadow),void 0!==e.receiveShadow&&(o.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(o.shadow.bias=e.shadow.bias),void 0!==e.shadow.radius&&(o.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&o.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(o.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(o.visible=e.visible),void 0!==e.userData&&(o.userData=e.userData),void 0!==e.children)for(var h=e.children,l=0;l<h.length;l++)o.add(this.parseObject(h[l],r,n));if("LOD"===e.type)for(var u=e.levels,p=0;p<u.length;p++){var d=u[p],f=o.getObjectByProperty("uuid",d.object);void 0!==f&&o.addLevel(f,d.distance)}return o}}()});var Gl={UVMapping:Wo,CubeReflectionMapping:Xo,CubeRefractionMapping:qo,EquirectangularReflectionMapping:Yo,EquirectangularRefractionMapping:Zo,SphericalReflectionMapping:Jo,CubeUVReflectionMapping:Qo,CubeUVRefractionMapping:Ko},Hl={RepeatWrapping:$o,ClampToEdgeWrapping:ts,MirroredRepeatWrapping:es},Vl={NearestFilter:rs,NearestMipMapNearestFilter:ns,NearestMipMapLinearFilter:is,LinearFilter:as,LinearMipMapNearestFilter:os,LinearMipMapLinearFilter:ss};gi.prototype={constructor:gi,setOptions:function(t){return this.options=t,this},load:function(t,e,r,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t);var i=this,a=Ll.get(t);return void 0!==a?(i.manager.itemStart(t),setTimeout(function(){e&&e(a),i.manager.itemEnd(t)},0),a):void fetch(t).then(function(t){return t.blob()}).then(function(t){return createImageBitmap(t,i.options)}).then(function(r){Ll.add(t,r),e&&e(r),i.manager.itemEnd(t)}).catch(function(e){n&&n(e),i.manager.itemEnd(t),i.manager.itemError(t)})},setCrossOrigin:function(){return this},setPath:function(t){return this.path=t,this}},Object.assign(yi.prototype,{moveTo:function(t,e){this.currentPath=new Hn,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e)},lineTo:function(t,e){this.currentPath.lineTo(t,e)},quadraticCurveTo:function(t,e,r,n){this.currentPath.quadraticCurveTo(t,e,r,n)},bezierCurveTo:function(t,e,r,n,i,a){this.currentPath.bezierCurveTo(t,e,r,n,i,a)},splineThru:function(t){this.currentPath.splineThru(t)},toShapes:function(t,e){function r(t){for(var e=[],r=0,n=t.length;r<n;r++){var i=t[r],a=new Vn;a.curves=i.curves,e.push(a)}return e}function n(t,e){for(var r=e.length,n=!1,i=r-1,a=0;a<r;i=a++){var o=e[i],s=e[a],c=s.x-o.x,h=s.y-o.y;if(Math.abs(h)>Number.EPSILON){if(h<0&&(o=e[a],c=-c,s=e[i],h=-h),t.y<o.y||t.y>s.y)continue;if(t.y===o.y){if(t.x===o.x)return!0}else{var l=h*(t.x-o.x)-c*(t.y-o.y);if(0===l)return!0;if(l<0)continue;n=!n}}else{if(t.y!==o.y)continue;if(s.x<=t.x&&t.x<=o.x||o.x<=t.x&&t.x<=s.x)return!0}}return n}var i=Sl.isClockWise,a=this.subPaths;if(0===a.length)return[];if(e===!0)return r(a);var o,s,c,h=[];if(1===a.length)return s=a[0],c=new Vn,c.curves=s.curves,h.push(c),h;var l=!i(a[0].getPoints());l=t?!l:l;var u,p=[],d=[],f=[],m=0;d[m]=void 0,f[m]=[];for(var v=0,g=a.length;v<g;v++)s=a[v],u=s.getPoints(),o=i(u),o=t?!o:o,o?(!l&&d[m]&&m++,d[m]={s:new Vn,p:u},d[m].s.curves=s.curves,l&&m++,f[m]=[]):f[m].push({h:s,p:u[0]});if(!d[0])return r(a);if(d.length>1){for(var y=!1,x=[],b=0,_=d.length;b<_;b++)p[b]=[];for(var b=0,_=d.length;b<_;b++)for(var w=f[b],M=0;M<w.length;M++){for(var E=w[M],T=!0,S=0;S<d.length;S++)n(E.p,d[S].p)&&(b!==S&&x.push({froms:b,tos:S,hole:M}),T?(T=!1,p[S].push(E)):y=!0);T&&p[b].push(E)}x.length>0&&(y||(f=p))}for(var A,v=0,R=d.length;v<R;v++){c=d[v].s,h.push(c),A=f[v];for(var L=0,P=A.length;L<P;L++)c.holes.push(A[L].h)}return h}}),Object.assign(xi.prototype,{isFont:!0,generateShapes:function(t,e,r){function n(t){for(var r=String(t).split(""),n=e/a.resolution,o=(a.boundingBox.yMax-a.boundingBox.yMin+a.underlineThickness)*n,s=0,c=0,h=[],l=0;l<r.length;l++){var u=r[l];if("\n"===u)s=0,c-=o;else{var p=i(u,n,s,c);s+=p.offsetX,h.push(p.path)}}return h}function i(t,e,r,n){var i=a.glyphs[t]||a.glyphs["?"];if(i){var o,s,c,h,l,u,p,d,f,m,v,g=new yi,y=[];if(i.o)for(var x=i._cachedOutline||(i._cachedOutline=i.o.split(" ")),b=0,_=x.length;b<_;){var w=x[b++];switch(w){case"m":o=x[b++]*e+r,s=x[b++]*e+n,g.moveTo(o,s);break;case"l":o=x[b++]*e+r,s=x[b++]*e+n,g.lineTo(o,s);break;case"q":c=x[b++]*e+r,h=x[b++]*e+n,p=x[b++]*e+r,d=x[b++]*e+n,g.quadraticCurveTo(p,d,c,h),v=y[y.length-1],v&&(l=v.x,u=v.y);break;case"b":c=x[b++]*e+r,h=x[b++]*e+n,p=x[b++]*e+r,d=x[b++]*e+n,f=x[b++]*e+r,m=x[b++]*e+n,g.bezierCurveTo(p,d,f,m,c,h),v=y[y.length-1],v&&(l=v.x,u=v.y)}}return{offsetX:i.ha*e,path:g}}}void 0===e&&(e=100),void 0===r&&(r=4);for(var a=this.data,o=n(t),s=[],c=0,h=o.length;c<h;c++)Array.prototype.push.apply(s,o[c].toShapes());return s}}),Object.assign(bi.prototype,{load:function(t,e,r,n){var i=this,a=new pn(this.manager);a.setPath(this.path),a.load(t,function(t){var r;try{r=JSON.parse(t)}catch(e){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),r=JSON.parse(t.substring(65,t.length-2))}var n=i.parse(r);e&&e(n)},r,n)},parse:function(t){return new xi(t)},setPath:function(t){return this.path=t,this}});var kl,jl={getContext:function(){return void 0===kl&&(kl=new(window.AudioContext||window.webkitAudioContext)),kl},setContext:function(t){kl=t}};Object.assign(_i.prototype,{load:function(t,e,r,n){var i=new pn(this.manager);i.setResponseType("arraybuffer"),i.load(t,function(t){var r=jl.getContext();r.decodeAudioData(t,function(t){e(t)})},r,n)}}),Object.assign(wi.prototype,{update:function(){var t,e,r,i,a,o,s,c,h=new n,l=new n;return function(n){var u=t!==this||e!==n.focus||r!==n.fov||i!==n.aspect*this.aspect||a!==n.near||o!==n.far||s!==n.zoom||c!==this.eyeSep;if(u){t=this,e=n.focus,r=n.fov,i=n.aspect*this.aspect,a=n.near,o=n.far,s=n.zoom;var p=n.projectionMatrix.clone();c=this.eyeSep/2;var d,f,m=c*a/e,v=a*Math.tan(ac.DEG2RAD*r*.5)/s;l.elements[12]=-c,h.elements[12]=c,d=-v*i+m,f=v*i+m,p.elements[0]=2*a/(f-d),p.elements[8]=(f+d)/(f-d),this.cameraL.projectionMatrix.copy(p),d=-v*i-m,f=v*i-m,p.elements[0]=2*a/(f-d),p.elements[8]=(f+d)/(f-d),this.cameraR.projectionMatrix.copy(p)}this.cameraL.matrixWorld.copy(n.matrixWorld).multiply(l),this.cameraR.matrixWorld.copy(n.matrixWorld).multiply(h)}}()}),Mi.prototype=Object.create(ht.prototype),Mi.prototype.constructor=Mi,Ei.prototype=Object.assign(Object.create(ht.prototype),{constructor:Ei,getInput:function(){return this.gain},removeFilter:function(){null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null)},getFilter:function(){return this.filter},setFilter:function(t){null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination)},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(t){this.gain.gain.value=t},updateMatrixWorld:function(){var t=new a,e=new i,r=new a,n=new a;return function(i){ht.prototype.updateMatrixWorld.call(this,i);var a=this.context.listener,o=this.up;this.matrixWorld.decompose(t,e,r),n.set(0,0,-1).applyQuaternion(e),a.positionX?(a.positionX.setValueAtTime(t.x,this.context.currentTime),a.positionY.setValueAtTime(t.y,this.context.currentTime),a.positionZ.setValueAtTime(t.z,this.context.currentTime),a.forwardX.setValueAtTime(n.x,this.context.currentTime),a.forwardY.setValueAtTime(n.y,this.context.currentTime),a.forwardZ.setValueAtTime(n.z,this.context.currentTime),a.upX.setValueAtTime(o.x,this.context.currentTime),a.upY.setValueAtTime(o.y,this.context.currentTime),a.upZ.setValueAtTime(o.z,this.context.currentTime)):(a.setPosition(t.x,t.y,t.z),a.setOrientation(n.x,n.y,n.z,o.x,o.y,o.z))}}()}),Ti.prototype=Object.assign(Object.create(ht.prototype),{constructor:Ti,getOutput:function(){return this.gain},setNodeSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},setBuffer:function(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(this.isPlaying===!0)return void console.warn("THREE.Audio: Audio is already playing.");if(this.hasPlaybackControl===!1)return void console.warn("THREE.Audio: this Audio has no playback control.");var t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.onended=this.onEnded.bind(this),t.playbackRate.setValueAtTime(this.playbackRate,this.startTime),this.startTime=this.context.currentTime,t.start(this.startTime,this.offset),this.isPlaying=!0,this.source=t,this.connect()},pause:function(){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):(this.isPlaying===!0&&(this.source.stop(),this.offset+=(this.context.currentTime-this.startTime)*this.playbackRate,this.isPlaying=!1),this)},stop:function(){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):(this.source.stop(),this.offset=0,this.isPlaying=!1,this)},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(t){return t||(t=[]),this.isPlaying===!0?(this.disconnect(),this.filters=t,this.connect()):this.filters=t,this},getFilter:function(){return this.getFilters()[0]},setFilter:function(t){return this.setFilters(t?[t]:[])},setPlaybackRate:function(t){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):(this.playbackRate=t,this.isPlaying===!0&&this.source.playbackRate.setValueAtTime(this.playbackRate,this.context.currentTime),this)},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(t){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):(this.loop=t,this.isPlaying===!0&&(this.source.loop=this.loop),this)},getVolume:function(){return this.gain.gain.value},setVolume:function(t){return this.gain.gain.value=t,this}}),Si.prototype=Object.assign(Object.create(Ti.prototype),{constructor:Si,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(t){this.panner.refDistance=t},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(t){this.panner.rolloffFactor=t},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(t){this.panner.distanceModel=t},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(t){this.panner.maxDistance=t},updateMatrixWorld:function(){var t=new a;return function(e){ht.prototype.updateMatrixWorld.call(this,e),t.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(t.x,t.y,t.z)}}()}),Object.assign(Ai.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var t=0,e=this.getFrequencyData(),r=0;r<e.length;r++)t+=e[r];return t/e.length}}),Object.assign(Ri.prototype,{accumulate:function(t,e){var r=this.buffer,n=this.valueSize,i=t*n+n,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==n;++o)r[i+o]=r[o];a=e}else{a+=e;var s=e/a;this._mixBufferRegion(r,i,0,s,n)}this.cumulativeWeight=a},apply:function(t){var e=this.valueSize,r=this.buffer,n=t*e+e,i=this.cumulativeWeight,a=this.binding;if(this.cumulativeWeight=0,i<1){var o=3*e;this._mixBufferRegion(r,n,o,1-i,e)}for(var s=e,c=e+e;s!==c;++s)if(r[s]!==r[s+e]){a.setValue(r,n);break}},saveOriginalState:function(){var t=this.binding,e=this.buffer,r=this.valueSize,n=3*r;t.getValue(e,n);for(var i=r,a=n;i!==a;++i)e[i]=e[n+i%r];this.cumulativeWeight=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_select:function(t,e,r,n,i){if(n>=.5)for(var a=0;a!==i;++a)t[e+a]=t[r+a]},_slerp:function(t,e,r,n){i.slerpFlat(t,e,t,e,t,r,n)},_lerp:function(t,e,r,n,i){for(var a=1-n,o=0;o!==i;++o){var s=e+o;t[s]=t[s]*a+t[r+o]*n}}}),Object.assign(Li.prototype,{getValue:function(t,e){this.bind();var r=this._targetGroup.nCachedObjects_,n=this._bindings[r];void 0!==n&&n.getValue(t,e)},setValue:function(t,e){for(var r=this._bindings,n=this._targetGroup.nCachedObjects_,i=r.length;n!==i;++n)r[n].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,r=t.length;e!==r;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,r=t.length;e!==r;++e)t[e].unbind()}}),Object.assign(Pi,{Composite:Li,create:function(t,e,r){return t&&t.isAnimationObjectGroup?new Pi.Composite(t,e,r):new Pi(t,e,r)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace(/[^\w-]/g,"")},parseTrackName:function(){var t=/((?:[\w-]+[\/:])*)/,e=/([\w-\.]+)?/,r=/(?:\.([\w-]+)(?:\[(.+)\])?)?/,n=/\.([\w-]+)(?:\[(.+)\])?/,i=new RegExp("^"+t.source+e.source+r.source+n.source+"$"),a=["material","materials","bones"];return function(t){var e=i.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var r={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},n=r.nodeName&&r.nodeName.lastIndexOf(".");if(void 0!==n&&n!==-1){var o=r.nodeName.substring(n+1);a.indexOf(o)!==-1&&(r.nodeName=r.nodeName.substring(0,n),r.objectName=o)}if(null===r.propertyName||0===r.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return r}}(),findNode:function(t,e){if(!e||""===e||"root"===e||"."===e||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){var r=function(t){for(var r=0;r<t.bones.length;r++){var n=t.bones[r];if(n.name===e)return n}return null},n=r(t.skeleton);if(n)return n}if(t.children){var i=function(t){for(var r=0;r<t.length;r++){var n=t[r];if(n.name===e||n.uuid===e)return n;var a=i(n.children);if(a)return a}return null},a=i(t.children);if(a)return a}return null}}),Object.assign(Pi.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){for(var r=this.resolvedProperty,n=0,i=r.length;n!==i;++n)t[e++]=r[n]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.targetObject[this.propertyName]=t[e]},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){for(var r=this.resolvedProperty,n=0,i=r.length;n!==i;++n)r[n]=t[e++]},function(t,e){for(var r=this.resolvedProperty,n=0,i=r.length;n!==i;++n)r[n]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){for(var r=this.resolvedProperty,n=0,i=r.length;n!==i;++n)r[n]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){var t=this.node,e=this.parsedPath,r=e.objectName,n=e.propertyName,i=e.propertyIndex;if(t||(t=Pi.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(r){var a=e.objectIndex;switch(r){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(var o=0;o<t.length;o++)if(t[o].name===a){a=o;break}break;default:if(void 0===t[r])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[r]}if(void 0!==a){if(void 0===t[a])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[a]}}var s=t[n];if(void 0===s){var c=e.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+n+" but it wasn't found.",t)}var h=this.Versioning.None;void 0!==t.needsUpdate?(h=this.Versioning.NeedsUpdate,this.targetObject=t):void 0!==t.matrixWorldNeedsUpdate&&(h=this.Versioning.MatrixWorldNeedsUpdate,this.targetObject=t);var l=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===n){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(t.geometry.isBufferGeometry){if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(var o=0;o<this.node.geometry.morphAttributes.position.length;o++)if(t.geometry.morphAttributes.position[o].name===i){i=o;break}}else{if(!t.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(var o=0;o<this.node.geometry.morphTargets.length;o++)if(t.geometry.morphTargets[o].name===i){i=o;break}}}l=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else void 0!==s.fromArray&&void 0!==s.toArray?(l=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(l=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=n;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][h]},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(Pi.prototype,{_getValue_unbound:Pi.prototype.getValue,_setValue_unbound:Pi.prototype.setValue}),Object.assign(Ci.prototype,{isAnimationObjectGroup:!0,add:function(){for(var t=this._objects,e=t.length,r=this.nCachedObjects_,n=this._indicesByUUID,i=this._paths,a=this._parsedPaths,o=this._bindings,s=o.length,c=0,h=arguments.length;c!==h;++c){var l=arguments[c],u=l.uuid,p=n[u],d=void 0;if(void 0===p){p=e++,n[u]=p,t.push(l);for(var f=0,m=s;f!==m;++f)o[f].push(new Pi(l,i[f],a[f]))}else if(p<r){d=t[p];var v=--r,g=t[v];n[g.uuid]=p,t[p]=g,n[u]=v,t[v]=l;for(var f=0,m=s;f!==m;++f){var y=o[f],x=y[v],b=y[p];y[p]=x,void 0===b&&(b=new Pi(l,i[f],a[f])),y[v]=b}}else t[p]!==d&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=r},remove:function(){for(var t=this._objects,e=this.nCachedObjects_,r=this._indicesByUUID,n=this._bindings,i=n.length,a=0,o=arguments.length;a!==o;++a){var s=arguments[a],c=s.uuid,h=r[c];if(void 0!==h&&h>=e){var l=e++,u=t[l];r[u.uuid]=h,t[h]=u,r[c]=l,t[l]=s;for(var p=0,d=i;p!==d;++p){var f=n[p],m=f[l],v=f[h];f[h]=m,f[l]=v}}}this.nCachedObjects_=e},uncache:function(){for(var t=this._objects,e=t.length,r=this.nCachedObjects_,n=this._indicesByUUID,i=this._bindings,a=i.length,o=0,s=arguments.length;o!==s;++o){var c=arguments[o],h=c.uuid,l=n[h];if(void 0!==l)if(delete n[h],l<r){var u=--r,p=t[u],d=--e,f=t[d];n[p.uuid]=l,t[l]=p,n[f.uuid]=u,t[u]=f,t.pop();for(var m=0,v=a;m!==v;++m){var g=i[m],y=g[u],x=g[d];g[l]=y,g[u]=x,g.pop()}}else{var d=--e,f=t[d];n[f.uuid]=l,t[l]=f,t.pop();for(var m=0,v=a;m!==v;++m){var g=i[m];g[l]=g[d],g.pop()}}}this.nCachedObjects_=r},subscribe_:function(t,e){var r=this._bindingsIndicesByPath,n=r[t],i=this._bindings;if(void 0!==n)return i[n];var a=this._paths,o=this._parsedPaths,s=this._objects,c=s.length,h=this.nCachedObjects_,l=new Array(c);n=i.length,r[t]=n,a.push(t),o.push(e),i.push(l);for(var u=h,p=s.length;u!==p;++u){var d=s[u];l[u]=new Pi(d,t,e)}return l},unsubscribe_:function(t){var e=this._bindingsIndicesByPath,r=e[t];if(void 0!==r){var n=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o],c=t[o];e[c]=r,a[r]=s,a.pop(),i[r]=i[o],i.pop(),n[r]=n[o],n.pop()}}}),Object.assign(Ii.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(t){return this._startTime=t,this},setLoop:function(t,e){return this.loop=t,this.repetitions=e,this},setEffectiveWeight:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(t){return this._scheduleFading(t,0,1)},fadeOut:function(t){return this._scheduleFading(t,1,0)},crossFadeFrom:function(t,e,r){if(t.fadeOut(e),this.fadeIn(e),r){var n=this._clip.duration,i=t._clip.duration,a=i/n,o=n/i;t.warp(1,a,e),this.warp(o,1,e)}return this},crossFadeTo:function(t,e,r){return t.crossFadeFrom(this,e,r)},stopFading:function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this._effectiveTimeScale,0,t)},warp:function(t,e,r){var n=this._mixer,i=n.time,a=this._timeScaleInterpolant,o=this.timeScale;null===a&&(a=n._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,c=a.sampleValues;return s[0]=i,s[1]=i+r,c[0]=t/o,c[1]=e/o,this},stopWarping:function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(t,e,r,n){if(!this.enabled)return void this._updateWeight(t);var i=this._startTime;if(null!==i){var a=(t-i)*r;if(a<0||0===r)return;this._startTime=null,e=r*a}e*=this._updateTimeScale(t);var o=this._updateTime(e),s=this._updateWeight(t);if(s>0)for(var c=this._interpolants,h=this._propertyBindings,l=0,u=c.length;l!==u;++l)c[l].evaluate(o),h[l].accumulate(n,s)},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var r=this._weightInterpolant;if(null!==r){var n=r.evaluate(t)[0];e*=n,t>r.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=e,e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var r=this._timeScaleInterpolant;if(null!==r){var n=r.evaluate(t)[0];e*=n,t>r.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e},_updateTime:function(t){var e=this.time+t;if(0===t)return e;var r=this._clip.duration,n=this.loop,i=this._loopCount;if(n===Bs){i===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(e>=r)e=r;else{if(!(e<0))break t;e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{var a=n===zs;if(i===-1&&(t>=0?(i=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),e>=r||e<0){var o=Math.floor(e/r);e-=r*o,i+=Math.abs(o);var s=this.repetitions-i;if(s<0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=t>0?r:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(0===s){var c=t<0;this._setEndings(c,!c,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}if(a&&1===(1&i))return this.time=e,r-e}return this.time=e,e},_setEndings:function(t,e,r){var n=this._interpolantSettings;r?(n.endingStart=js,n.endingEnd=js):(t?n.endingStart=this.zeroSlopeAtStart?js:ks:n.endingStart=Ws,e?n.endingEnd=this.zeroSlopeAtEnd?js:ks:n.endingEnd=Ws)},_scheduleFading:function(t,e,r){var n=this._mixer,i=n.time,a=this._weightInterpolant;null===a&&(a=n._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=e,o[1]=i+t,s[1]=r,this}}),Oi.prototype=Object.assign(Object.create(e.prototype),{constructor:Oi,_bindAction:function(t,e){var r=t._localRoot||this._root,n=t._clip.tracks,i=n.length,a=t._propertyBindings,o=t._interpolants,s=r.uuid,c=this._bindingsByRootAndName,h=c[s];void 0===h&&(h={},c[s]=h);for(var l=0;l!==i;++l){var u=n[l],p=u.name,d=h[p];if(void 0!==d)a[l]=d;else{if(d=a[l],void 0!==d){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,p));continue}var f=e&&e._propertyBindings[l].binding.parsedPath;d=new Ri(Pi.create(r,p,f),u.ValueTypeName,u.getValueSize()),++d.referenceCount,this._addInactiveBinding(d,s,p),a[l]=d}o[l].resultBuffer=d.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,r=t._clip.uuid,n=this._actionsByClip[r];this._bindAction(t,n&&n.knownActions[0]),this._addInactiveAction(t,r,e)}for(var i=t._propertyBindings,a=0,o=i.length;a!==o;++a){var s=i[a];0===s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,r=0,n=e.length;r!==n;++r){var i=e[r];0===--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&e<this._nActiveActions},_addInactiveAction:function(t,e,r){var n=this._actions,i=this._actionsByClip,a=i[e];if(void 0===a)a={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,i[e]=a;else{var o=a.knownActions;t._byClipCacheIndex=o.length,o.push(t)}t._cacheIndex=n.length,n.push(t),a.actionByRoot[r]=t},_removeInactiveAction:function(t){var e=this._actions,r=e[e.length-1],n=t._cacheIndex;r._cacheIndex=n,e[n]=r,e.pop(),t._cacheIndex=null;var i=t._clip.uuid,a=this._actionsByClip,o=a[i],s=o.knownActions,c=s[s.length-1],h=t._byClipCacheIndex;c._byClipCacheIndex=h,s[h]=c,s.pop(),t._byClipCacheIndex=null;var l=o.actionByRoot,u=(t._localRoot||this._root).uuid;delete l[u],0===s.length&&delete a[i],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){for(var e=t._propertyBindings,r=0,n=e.length;r!==n;++r){var i=e[r];0===--i.referenceCount&&this._removeInactiveBinding(i)}},_lendAction:function(t){var e=this._actions,r=t._cacheIndex,n=this._nActiveActions++,i=e[n];t._cacheIndex=n,e[n]=t,i._cacheIndex=r,e[r]=i},_takeBackAction:function(t){var e=this._actions,r=t._cacheIndex,n=--this._nActiveActions,i=e[n];t._cacheIndex=n,e[n]=t,i._cacheIndex=r,e[r]=i},_addInactiveBinding:function(t,e,r){var n=this._bindingsByRootAndName,i=n[e],a=this._bindings;void 0===i&&(i={},n[e]=i),i[r]=t,t._cacheIndex=a.length,a.push(t)},_removeInactiveBinding:function(t){var e=this._bindings,r=t.binding,n=r.rootNode.uuid,i=r.path,a=this._bindingsByRootAndName,o=a[n],s=e[e.length-1],c=t._cacheIndex;s._cacheIndex=c,e[c]=s,e.pop(),delete o[i];t:{for(var h in o)break t;delete a[n]}},_lendBinding:function(t){var e=this._bindings,r=t._cacheIndex,n=this._nActiveBindings++,i=e[n];t._cacheIndex=n,e[n]=t,i._cacheIndex=r,e[r]=i},_takeBackBinding:function(t){var e=this._bindings,r=t._cacheIndex,n=--this._nActiveBindings,i=e[n];t._cacheIndex=n,e[n]=t,i._cacheIndex=r,e[r]=i},_lendControlInterpolant:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,r=t[e];return void 0===r&&(r=new si(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),r.__cacheIndex=e,t[e]=r),r},_takeBackControlInterpolant:function(t){var e=this._controlInterpolants,r=t.__cacheIndex,n=--this._nActiveControlInterpolants,i=e[n];t.__cacheIndex=n,e[n]=t,i.__cacheIndex=r,e[r]=i},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(t,e){var r=e||this._root,n=r.uuid,i="string"==typeof t?ui.findByName(r,t):t,a=null!==i?i.uuid:t,o=this._actionsByClip[a],s=null;
  107. if(void 0!==o){var c=o.actionByRoot[n];if(void 0!==c)return c;s=o.knownActions[0],null===i&&(i=s._clip)}if(null===i)return null;var h=new Ii(this,i,e);return this._bindAction(h,s),this._addInactiveAction(h,a,n),h},existingAction:function(t,e){var r=e||this._root,n=r.uuid,i="string"==typeof t?ui.findByName(r,t):t,a=i?i.uuid:t,o=this._actionsByClip[a];return void 0!==o?o.actionByRoot[n]||null:null},stopAllAction:function(){var t=this._actions,e=this._nActiveActions,r=this._bindings,n=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var i=0;i!==e;++i)t[i].reset();for(var i=0;i!==n;++i)r[i].useCount=0;return this},update:function(t){t*=this.timeScale;for(var e=this._actions,r=this._nActiveActions,n=this.time+=t,i=Math.sign(t),a=this._accuIndex^=1,o=0;o!==r;++o){var s=e[o];s._update(n,t,i,a)}for(var c=this._bindings,h=this._nActiveBindings,o=0;o!==h;++o)c[o].apply(a);return this},getRoot:function(){return this._root},uncacheClip:function(t){var e=this._actions,r=t.uuid,n=this._actionsByClip,i=n[r];if(void 0!==i){for(var a=i.knownActions,o=0,s=a.length;o!==s;++o){var c=a[o];this._deactivateAction(c);var h=c._cacheIndex,l=e[e.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,l._cacheIndex=h,e[h]=l,e.pop(),this._removeInactiveBindingsForAction(c)}delete n[r]}},uncacheRoot:function(t){var e=t.uuid,r=this._actionsByClip;for(var n in r){var i=r[n].actionByRoot,a=i[e];void 0!==a&&(this._deactivateAction(a),this._removeInactiveAction(a))}var o=this._bindingsByRootAndName,s=o[e];if(void 0!==s)for(var c in s){var h=s[c];h.restoreOriginalState(),this._removeInactiveBinding(h)}},uncacheAction:function(t,e){var r=this.existingAction(t,e);null!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}}),Ni.prototype.clone=function(){return new Ni(void 0===this.value.clone?this.value:this.value.clone())},Ui.prototype=Object.assign(Object.create(St.prototype),{constructor:Ui,isInstancedBufferGeometry:!0,copy:function(t){return St.prototype.copy.call(this,t),this.maxInstancedCount=t.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)}}),Object.defineProperties(Di.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(Di.prototype,{isInterleavedBufferAttribute:!0,setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,e,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=r,this},setXYZ:function(t,e,r,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=r,this.data.array[t+2]=n,this},setXYZW:function(t,e,r,n,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=r,this.data.array[t+2]=n,this.data.array[t+3]=i,this}}),Object.defineProperty(Bi.prototype,"needsUpdate",{set:function(t){t===!0&&this.version++}}),Object.assign(Bi.prototype,{isInterleavedBuffer:!0,setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==t?t.length/this.stride:0,this.array=t},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.dynamic=t.dynamic,this},copyAt:function(t,e,r){t*=this.stride,r*=e.stride;for(var n=0,i=this.stride;n<i;n++)this.array[t+n]=e.array[r+n];return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(t){return this.onUploadCallback=t,this}}),Fi.prototype=Object.assign(Object.create(Bi.prototype),{constructor:Fi,isInstancedInterleavedBuffer:!0,copy:function(t){return Bi.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),zi.prototype=Object.assign(Object.create(ft.prototype),{constructor:zi,isInstancedBufferAttribute:!0,copy:function(t){return ft.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),Object.assign(Gi.prototype,{linePrecision:1,set:function(t,e){this.ray.set(t,e)},setFromCamera:function(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize()):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,e){var r=[];return Vi(t,this,r,e),r.sort(Hi),r},intersectObjects:function(t,e){var r=[];if(Array.isArray(t)===!1)return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),r;for(var n=0,i=t.length;n<i;n++)Vi(t[n],this,r,e);return r.sort(Hi),r}}),Object.assign(ki.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var e=("undefined"==typeof performance?Date:performance).now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}),Object.assign(ji.prototype,{set:function(t,e,r){return this.radius=t,this.phi=e,this.theta=r,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this},makeSafe:function(){var t=1e-6;return this.phi=Math.max(t,Math.min(Math.PI-t,this.phi)),this},setFromVector3:function(t){return this.radius=t.length(),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t.x,t.z),this.phi=Math.acos(ac.clamp(t.y/this.radius,-1,1))),this}}),Object.assign(Wi.prototype,{set:function(t,e,r){return this.radius=t,this.theta=e,this.y=r,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this},setFromVector3:function(t){return this.radius=Math.sqrt(t.x*t.x+t.z*t.z),this.theta=Math.atan2(t.x,t.z),this.y=t.y,this}}),Xi.prototype=Object.create(ht.prototype),Xi.prototype.constructor=Xi,Xi.prototype.isImmediateRenderObject=!0,qi.prototype=Object.create(Ne.prototype),qi.prototype.constructor=qi,qi.prototype.update=function(){var t=new a,e=new a,r=new o;return function(){var n=["a","b","c"];this.object.updateMatrixWorld(!0),r.getNormalMatrix(this.object.matrixWorld);var i=this.object.matrixWorld,a=this.geometry.attributes.position,o=this.object.geometry;if(o&&o.isGeometry)for(var s=o.vertices,c=o.faces,h=0,l=0,u=c.length;l<u;l++)for(var p=c[l],d=0,f=p.vertexNormals.length;d<f;d++){var m=s[p[n[d]]],v=p.vertexNormals[d];t.copy(m).applyMatrix4(i),e.copy(v).applyMatrix3(r).normalize().multiplyScalar(this.size).add(t),a.setXYZ(h,t.x,t.y,t.z),h+=1,a.setXYZ(h,e.x,e.y,e.z),h+=1}else if(o&&o.isBufferGeometry)for(var g=o.attributes.position,y=o.attributes.normal,h=0,d=0,f=g.count;d<f;d++)t.set(g.getX(d),g.getY(d),g.getZ(d)).applyMatrix4(i),e.set(y.getX(d),y.getY(d),y.getZ(d)),e.applyMatrix3(r).normalize().multiplyScalar(this.size).add(t),a.setXYZ(h,t.x,t.y,t.z),h+=1,a.setXYZ(h,e.x,e.y,e.z),h+=1;a.needsUpdate=!0}}(),Yi.prototype=Object.create(ht.prototype),Yi.prototype.constructor=Yi,Yi.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},Yi.prototype.update=function(){var t=new a,e=new a;return function(){this.light.updateMatrixWorld();var r=this.light.distance?this.light.distance:1e3,n=r*Math.tan(this.light.angle);this.cone.scale.set(n,n,r),t.setFromMatrixPosition(this.light.matrixWorld),e.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(e.sub(t)),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}(),Ji.prototype=Object.create(Ne.prototype),Ji.prototype.constructor=Ji,Ji.prototype.updateMatrixWorld=function(){var t=new a,e=new n,r=new n;return function(n){var i=this.bones,a=this.geometry,o=a.getAttribute("position");r.getInverse(this.root.matrixWorld);for(var s=0,c=0;s<i.length;s++){var h=i[s];h.parent&&h.parent.isBone&&(e.multiplyMatrices(r,h.matrixWorld),t.setFromMatrixPosition(e),o.setXYZ(c,t.x,t.y,t.z),e.multiplyMatrices(r,h.parent.matrixWorld),t.setFromMatrixPosition(e),o.setXYZ(c+1,t.x,t.y,t.z),c+=2)}a.getAttribute("position").needsUpdate=!0,ht.prototype.updateMatrixWorld.call(this,n)}}(),Qi.prototype=Object.create(Dt.prototype),Qi.prototype.constructor=Qi,Qi.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},Qi.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)},Ki.prototype=Object.create(ht.prototype),Ki.prototype.constructor=Ki,Ki.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},Ki.prototype.update=function(){var t=.5*this.light.width,e=.5*this.light.height,r=this.line.geometry.attributes.position,n=r.array;n[0]=t,n[1]=-e,n[2]=0,n[3]=t,n[4]=e,n[5]=0,n[6]=-t,n[7]=e,n[8]=0,n[9]=-t,n[10]=-e,n[11]=0,n[12]=t,n[13]=-e,n[14]=0,r.needsUpdate=!0,void 0!==this.color?this.line.material.color.set(this.color):this.line.material.color.copy(this.light.color)},$i.prototype=Object.create(ht.prototype),$i.prototype.constructor=$i,$i.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},$i.prototype.update=function(){var t=new a,e=new q,r=new q;return function(){var n=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var i=n.geometry.getAttribute("color");e.copy(this.light.color),r.copy(this.light.groundColor);for(var a=0,o=i.count;a<o;a++){var s=a<o/2?e:r;i.setXYZ(a,s.r,s.g,s.b)}i.needsUpdate=!0}n.lookAt(t.setFromMatrixPosition(this.light.matrixWorld).negate())}}(),ta.prototype=Object.create(Ne.prototype),ta.prototype.constructor=ta,ea.prototype=Object.create(Ne.prototype),ea.prototype.constructor=ea,ra.prototype=Object.create(Ne.prototype),ra.prototype.constructor=ra,ra.prototype.update=function(){var t=new a,e=new a,r=new o;return function(){this.object.updateMatrixWorld(!0),r.getNormalMatrix(this.object.matrixWorld);for(var n=this.object.matrixWorld,i=this.geometry.attributes.position,a=this.object.geometry,o=a.vertices,s=a.faces,c=0,h=0,l=s.length;h<l;h++){var u=s[h],p=u.normal;t.copy(o[u.a]).add(o[u.b]).add(o[u.c]).divideScalar(3).applyMatrix4(n),e.copy(p).applyMatrix3(r).normalize().multiplyScalar(this.size).add(t),i.setXYZ(c,t.x,t.y,t.z),c+=1,i.setXYZ(c,e.x,e.y,e.z),c+=1}i.needsUpdate=!0}}(),na.prototype=Object.create(ht.prototype),na.prototype.constructor=na,na.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},na.prototype.update=function(){var t=new a,e=new a,r=new a;return function(){t.setFromMatrixPosition(this.light.matrixWorld),e.setFromMatrixPosition(this.light.target.matrixWorld),r.subVectors(e,t),this.lightPlane.lookAt(r),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(r),this.targetLine.scale.z=r.length()}}(),ia.prototype=Object.create(Ne.prototype),ia.prototype.constructor=ia,ia.prototype.update=function(){function t(t,a,o,s){n.set(a,o,s).unproject(i);var c=r[t];if(void 0!==c)for(var h=e.getAttribute("position"),l=0,u=c.length;l<u;l++)h.setXYZ(c[l],n.x,n.y,n.z)}var e,r,n=new a,i=new lt;return function(){e=this.geometry,r=this.pointMap;var n=1,a=1;i.projectionMatrix.copy(this.camera.projectionMatrix),t("c",0,0,-1),t("t",0,0,1),t("n1",-n,-a,-1),t("n2",n,-a,-1),t("n3",-n,a,-1),t("n4",n,a,-1),t("f1",-n,-a,1),t("f2",n,-a,1),t("f3",-n,a,1),t("f4",n,a,1),t("u1",.7*n,1.1*a,-1),t("u2",.7*-n,1.1*a,-1),t("u3",0,2*a,-1),t("cf1",-n,0,1),t("cf2",n,0,1),t("cf3",0,-a,1),t("cf4",0,a,1),t("cn1",-n,0,-1),t("cn2",n,0,-1),t("cn3",0,-a,-1),t("cn4",0,a,-1),e.getAttribute("position").needsUpdate=!0}}(),aa.prototype=Object.create(Ne.prototype),aa.prototype.constructor=aa,aa.prototype.update=function(){var t=new et;return function(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&t.setFromObject(this.object),!t.isEmpty()){var r=t.min,n=t.max,i=this.geometry.attributes.position,a=i.array;a[0]=n.x,a[1]=n.y,a[2]=n.z,a[3]=r.x,a[4]=n.y,a[5]=n.z,a[6]=r.x,a[7]=r.y,a[8]=n.z,a[9]=n.x,a[10]=r.y,a[11]=n.z,a[12]=n.x,a[13]=n.y,a[14]=r.z,a[15]=r.x,a[16]=n.y,a[17]=r.z,a[18]=r.x,a[19]=r.y,a[20]=r.z,a[21]=n.x,a[22]=r.y,a[23]=r.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}(),aa.prototype.setFromObject=function(t){return this.object=t,this.update(),this},oa.prototype=Object.create(Ne.prototype),oa.prototype.constructor=oa,oa.prototype.updateMatrixWorld=function(t){var e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),ht.prototype.updateMatrixWorld.call(this,t))},sa.prototype=Object.create(Oe.prototype),sa.prototype.constructor=sa,sa.prototype.updateMatrixWorld=function(t){var e=-this.plane.constant;Math.abs(e)<1e-8&&(e=1e-8),this.scale.set(.5*this.size,.5*this.size,e),this.lookAt(this.plane.normal),ht.prototype.updateMatrixWorld.call(this,t)};var Wl,Xl;ca.prototype=Object.create(ht.prototype),ca.prototype.constructor=ca,ca.prototype.setDirection=function(){var t,e=new a;return function(r){r.y>.99999?this.quaternion.set(0,0,0,1):r.y<-.99999?this.quaternion.set(1,0,0,0):(e.set(r.z,0,-r.x).normalize(),t=Math.acos(r.y),this.quaternion.setFromAxisAngle(e,t))}}(),ca.prototype.setLength=function(t,e,r){void 0===e&&(e=.2*t),void 0===r&&(r=.2*e),this.line.scale.set(1,Math.max(0,t-e),1),this.line.updateMatrix(),this.cone.scale.set(r,e,r),this.cone.position.y=t,this.cone.updateMatrix()},ca.prototype.setColor=function(t){this.line.material.color.copy(t),this.cone.material.color.copy(t)},ha.prototype=Object.create(Ne.prototype),ha.prototype.constructor=ha;var ql={createMultiMaterialObject:function(t,e){for(var r=new Fe,n=0,i=e.length;n<i;n++)r.add(new Dt(t,e[n]));return r},detach:function(t,e,r){t.applyMatrix(e.matrixWorld),e.remove(t),r.add(t)},attach:function(t,e,r){t.applyMatrix((new n).getInverse(r.matrixWorld)),e.remove(t),r.add(t)}},Yl=0,Zl=1;yn.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(yn.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Object.assign(Gn.prototype,{createPointsGeometry:function(t){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var e=new dt,r=0,n=t.length;r<n;r++){var i=t[r];e.vertices.push(new a(i.x,i.y,i.z||0))}return e}}),Object.assign(Hn.prototype,{fromPoints:function(t){console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)}}),Pa.prototype=Object.create(wn.prototype),Ca.prototype=Object.create(wn.prototype),Ia.prototype=Object.create(wn.prototype),Object.assign(Ia.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),ta.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Ji.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(fi.prototype,{extractUrlBase:function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),zl.extractUrlBase(t)}}),Object.assign(Y.prototype,{center:function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},size:function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(et.prototype,{center:function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionSphere:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},size:function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),Nt.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Object.assign(ac,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(t){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),ac.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),ac.ceilPowerOfTwo(t)}}),Object.assign(o.prototype,{flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBuffer:function(t){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(n.prototype,{extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){var t;return function(){return void 0===t&&(t=new a),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),t.setFromMatrixColumn(this,3)}}(),setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBuffer:function(t){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,r,n,i,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,n,r,i,a)}}),nt.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},i.prototype.multiplyVector3=function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},Object.assign(Ot.prototype,{isIntersectionBox:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionPlane:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},isIntersectionSphere:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(Vn.prototype,{extractAllPoints:function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Ur(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Wr(this,t)}}),Object.assign(r.prototype,{fromAttribute:function(t,e,r){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,r)},distanceToManhattan:function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(a.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},applyProjection:function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},fromAttribute:function(t,e,r){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,r)},distanceToManhattan:function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(c.prototype,{fromAttribute:function(t,e,r){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,r)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),dt.prototype.computeTangents=function(){console.warn("THREE.Geometry: .computeTangents() has been removed.")},Object.assign(ht.prototype,{getChildByName:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)}}),Object.defineProperties(ht.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.defineProperties(Re.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Le.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Object.defineProperty(yn.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),me.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(kn.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(ft.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}}}),Object.assign(St.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},addDrawCall:function(t,e,r){void 0!==r&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")}}),Object.defineProperties(St.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(Ni.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(K.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new q}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=t===eo}}}),Object.defineProperties(on.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(It.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  108. this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.assign(_e.prototype,{getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")}}),Object.defineProperties(_e.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){return this.shadowMap.cullFace},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),this.shadowMap.cullFace=t}}}),Object.defineProperties(at.prototype,{cullFace:{get:function(){return this.renderReverseSided?Wa:ja},set:function(t){var e=t!==ja;console.warn("WebGLRenderer: .shadowMap.cullFace is deprecated. Set .shadowMap.renderReverseSided to "+e+"."),this.renderReverseSided=e}}}),Object.defineProperties(h.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Object.defineProperties(ge.prototype,{standing:{set:function(){console.warn("THREE.WebVRManager: .standing has been removed.")}}}),Ti.prototype.load=function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var e=this,r=new _i;return r.load(t,function(t){e.setBuffer(t)}),this},Ai.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Mi.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)};var Jl={merge:function(t,e,r){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var n;e.isMesh&&(e.matrixAutoUpdate&&e.updateMatrix(),n=e.matrix,e=e.geometry),t.merge(e,n,r)},center:function(t){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),t.center()}},Ql={crossOrigin:void 0,loadTexture:function(t,e,r,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new gn;i.setCrossOrigin(this.crossOrigin);var a=i.load(t,r,void 0,n);return e&&(a.mapping=e),a},loadTextureCube:function(t,e,r,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new vn;i.setCrossOrigin(this.crossOrigin);var a=i.load(t,r,void 0,n);return e&&(a.mapping=e),a},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")}};t.WebGLRenderTargetCube=l,t.WebGLRenderTarget=h,t.WebGLRenderer=_e,t.ShaderLib=xl,t.UniformsLib=mc,t.UniformsUtils=vc,t.ShaderChunk=yl,t.FogExp2=we,t.Fog=Me,t.Scene=Ee,t.LensFlare=Te,t.Sprite=Ae,t.LOD=Re,t.SkinnedMesh=Ce,t.Skeleton=Le,t.Bone=Pe,t.Mesh=Dt,t.LineSegments=Ne,t.LineLoop=Ue,t.Line=Oe,t.Points=Be,t.Group=Fe,t.VideoTexture=ze,t.DataTexture=u,t.CompressedTexture=Ge,t.CubeTexture=p,t.CanvasTexture=J,t.DepthTexture=He,t.Texture=s,t.CompressedTextureLoader=dn,t.DataTextureLoader=fn,t.CubeTextureLoader=vn,t.TextureLoader=gn,t.ObjectLoader=vi,t.MaterialLoader=pi,t.BufferGeometryLoader=di,t.DefaultLoadingManager=Pl,t.LoadingManager=un,t.JSONLoader=mi,t.ImageLoader=mn,t.ImageBitmapLoader=gi,t.FontLoader=bi,t.FileLoader=pn,t.Loader=fi,t.LoaderUtils=zl,t.Cache=Ll,t.AudioLoader=_i,t.SpotLightShadow=Xn,t.SpotLight=qn,t.PointLight=Yn,t.RectAreaLight=Kn,t.HemisphereLight=jn,t.DirectionalLightShadow=Zn,t.DirectionalLight=Jn,t.AmbientLight=Qn,t.LightShadow=Wn,t.Light=kn,t.StereoCamera=wi,t.PerspectiveCamera=me,t.OrthographicCamera=ut,t.CubeCamera=Mi,t.ArrayCamera=ve,t.Camera=lt,t.AudioListener=Ei,t.PositionalAudio=Si,t.AudioContext=jl,t.AudioAnalyser=Ai,t.Audio=Ti,t.VectorKeyframeTrack=li,t.StringKeyframeTrack=$n,t.QuaternionKeyframeTrack=ni,t.NumberKeyframeTrack=ai,t.ColorKeyframeTrack=ii,t.BooleanKeyframeTrack=ti,t.PropertyMixer=Ri,t.PropertyBinding=Pi,t.KeyframeTrack=hi,t.AnimationUtils=Bl,t.AnimationObjectGroup=Ci,t.AnimationMixer=Oi,t.AnimationClip=ui,t.Uniform=Ni,t.InstancedBufferGeometry=Ui,t.BufferGeometry=St,t.Geometry=dt,t.InterleavedBufferAttribute=Di,t.InstancedInterleavedBuffer=Fi,t.InterleavedBuffer=Bi,t.InstancedBufferAttribute=zi,t.Face3=pt,t.Object3D=ht,t.Raycaster=Gi,t.Layers=ct,t.EventDispatcher=e,t.Clock=ki,t.QuaternionLinearInterpolant=ri,t.LinearInterpolant=si,t.DiscreteInterpolant=ci,t.CubicInterpolant=oi,t.Interpolant=ei,t.Triangle=Ut,t.Math=ac,t.Spherical=ji,t.Cylindrical=Wi,t.Plane=nt,t.Frustum=it,t.Sphere=rt,t.Ray=Ot,t.Matrix4=n,t.Matrix3=o,t.Box3=et,t.Box2=Y,t.Line3=Nt,t.Euler=st,t.Vector4=c,t.Vector3=a,t.Vector2=r,t.Quaternion=i,t.Color=q,t.ImmediateRenderObject=Xi,t.VertexNormalsHelper=qi,t.SpotLightHelper=Yi,t.SkeletonHelper=Ji,t.PointLightHelper=Qi,t.RectAreaLightHelper=Ki,t.HemisphereLightHelper=$i,t.GridHelper=ta,t.PolarGridHelper=ea,t.FaceNormalsHelper=ra,t.DirectionalLightHelper=na,t.CameraHelper=ia,t.BoxHelper=aa,t.Box3Helper=oa,t.PlaneHelper=sa,t.ArrowHelper=ca,t.AxesHelper=ha,t.Shape=Vn,t.Path=Hn,t.ShapePath=yi,t.Font=xi,t.CurvePath=Gn,t.Curve=yn,t.ShapeUtils=Sl,t.SceneUtils=ql,t.WebGLUtils=be,t.WireframeGeometry=Ve,t.ParametricGeometry=ke,t.ParametricBufferGeometry=je,t.TetrahedronGeometry=qe,t.TetrahedronBufferGeometry=Ye,t.OctahedronGeometry=Ze,t.OctahedronBufferGeometry=Je,t.IcosahedronGeometry=Qe,t.IcosahedronBufferGeometry=Ke,t.DodecahedronGeometry=$e,t.DodecahedronBufferGeometry=tr,t.PolyhedronGeometry=We,t.PolyhedronBufferGeometry=Xe,t.TubeGeometry=er,t.TubeBufferGeometry=rr,t.TorusKnotGeometry=nr,t.TorusKnotBufferGeometry=ir,t.TorusGeometry=ar,t.TorusBufferGeometry=or,t.TextGeometry=Br,t.TextBufferGeometry=Fr,t.SphereGeometry=zr,t.SphereBufferGeometry=Gr,t.RingGeometry=Hr,t.RingBufferGeometry=Vr,t.PlaneGeometry=Lt,t.PlaneBufferGeometry=Pt,t.LatheGeometry=kr,t.LatheBufferGeometry=jr,t.ShapeGeometry=Wr,t.ShapeBufferGeometry=Xr,t.ExtrudeGeometry=Ur,t.ExtrudeBufferGeometry=Dr,t.EdgesGeometry=Yr,t.ConeGeometry=Qr,t.ConeBufferGeometry=Kr,t.CylinderGeometry=Zr,t.CylinderBufferGeometry=Jr,t.CircleGeometry=$r,t.CircleBufferGeometry=tn,t.BoxGeometry=At,t.BoxBufferGeometry=Rt,t.ShadowMaterial=en,t.SpriteMaterial=Se,t.RawShaderMaterial=rn,t.ShaderMaterial=It,t.PointsMaterial=De,t.MeshPhysicalMaterial=an,t.MeshStandardMaterial=nn,t.MeshPhongMaterial=on,t.MeshToonMaterial=sn,t.MeshNormalMaterial=cn,t.MeshLambertMaterial=hn,t.MeshDepthMaterial=$,t.MeshDistanceMaterial=tt;t.MeshBasicMaterial=Ct;t.LineDashedMaterial=ln,t.LineBasicMaterial=Ie,t.Material=K,t.Float64BufferAttribute=Mt,t.Float32BufferAttribute=wt,t.Uint32BufferAttribute=_t,t.Int32BufferAttribute=bt,t.Uint16BufferAttribute=xt,t.Int16BufferAttribute=yt,t.Uint8ClampedBufferAttribute=gt,t.Uint8BufferAttribute=vt,t.Int8BufferAttribute=mt,t.BufferAttribute=ft,t.ArcCurve=bn,t.CatmullRomCurve3=wn,t.CubicBezierCurve=On,t.CubicBezierCurve3=Nn,t.EllipseCurve=xn,t.LineCurve=Un,t.LineCurve3=Dn,t.QuadraticBezierCurve=Bn,t.QuadraticBezierCurve3=Fn,t.SplineCurve=zn,t.REVISION=Ha,t.MOUSE=Va,t.CullFaceNone=ka,t.CullFaceBack=ja,t.CullFaceFront=Wa,t.CullFaceFrontBack=Xa,t.FrontFaceDirectionCW=qa,t.FrontFaceDirectionCCW=Ya,t.BasicShadowMap=Za,t.PCFShadowMap=Ja,t.PCFSoftShadowMap=Qa,t.FrontSide=Ka,t.BackSide=$a,t.DoubleSide=to,t.FlatShading=eo,t.SmoothShading=ro,t.NoColors=no,t.FaceColors=io,t.VertexColors=ao,t.NoBlending=oo,t.NormalBlending=so,t.AdditiveBlending=co,t.SubtractiveBlending=ho,t.MultiplyBlending=lo,t.CustomBlending=uo,t.AddEquation=po,t.SubtractEquation=fo,t.ReverseSubtractEquation=mo,t.MinEquation=vo,t.MaxEquation=go,t.ZeroFactor=yo,t.OneFactor=xo,t.SrcColorFactor=bo,t.OneMinusSrcColorFactor=_o,t.SrcAlphaFactor=wo,t.OneMinusSrcAlphaFactor=Mo,t.DstAlphaFactor=Eo,t.OneMinusDstAlphaFactor=To,t.DstColorFactor=So,t.OneMinusDstColorFactor=Ao,t.SrcAlphaSaturateFactor=Ro,t.NeverDepth=Lo,t.AlwaysDepth=Po,t.LessDepth=Co,t.LessEqualDepth=Io,t.EqualDepth=Oo,t.GreaterEqualDepth=No,t.GreaterDepth=Uo,t.NotEqualDepth=Do,t.MultiplyOperation=Bo,t.MixOperation=Fo,t.AddOperation=zo,t.NoToneMapping=Go,t.LinearToneMapping=Ho,t.ReinhardToneMapping=Vo,t.Uncharted2ToneMapping=ko,t.CineonToneMapping=jo,t.UVMapping=Wo,t.CubeReflectionMapping=Xo,t.CubeRefractionMapping=qo,t.EquirectangularReflectionMapping=Yo,t.EquirectangularRefractionMapping=Zo,t.SphericalReflectionMapping=Jo,t.CubeUVReflectionMapping=Qo,t.CubeUVRefractionMapping=Ko,t.RepeatWrapping=$o,t.ClampToEdgeWrapping=ts,t.MirroredRepeatWrapping=es,t.NearestFilter=rs,t.NearestMipMapNearestFilter=ns,t.NearestMipMapLinearFilter=is,t.LinearFilter=as,t.LinearMipMapNearestFilter=os,t.LinearMipMapLinearFilter=ss,t.UnsignedByteType=cs,t.ByteType=hs,t.ShortType=ls,t.UnsignedShortType=us,t.IntType=ps,t.UnsignedIntType=ds,t.FloatType=fs,t.HalfFloatType=ms,t.UnsignedShort4444Type=vs,t.UnsignedShort5551Type=gs,t.UnsignedShort565Type=ys,t.UnsignedInt248Type=xs,t.AlphaFormat=bs,t.RGBFormat=_s,t.RGBAFormat=ws,t.LuminanceFormat=Ms,t.LuminanceAlphaFormat=Es,t.RGBEFormat=Ts,t.DepthFormat=Ss,t.DepthStencilFormat=As,t.RGB_S3TC_DXT1_Format=Rs,t.RGBA_S3TC_DXT1_Format=Ls,t.RGBA_S3TC_DXT3_Format=Ps,t.RGBA_S3TC_DXT5_Format=Cs,t.RGB_PVRTC_4BPPV1_Format=Is,t.RGB_PVRTC_2BPPV1_Format=Os,t.RGBA_PVRTC_4BPPV1_Format=Ns,t.RGBA_PVRTC_2BPPV1_Format=Us,t.RGB_ETC1_Format=Ds,t.LoopOnce=Bs,t.LoopRepeat=Fs,t.LoopPingPong=zs,t.InterpolateDiscrete=Gs,t.InterpolateLinear=Hs,t.InterpolateSmooth=Vs,t.ZeroCurvatureEnding=ks,t.ZeroSlopeEnding=js,t.WrapAroundEnding=Ws,t.TrianglesDrawMode=Xs,t.TriangleStripDrawMode=qs,t.TriangleFanDrawMode=Ys,t.LinearEncoding=Zs,t.sRGBEncoding=Js,t.GammaEncoding=Qs,t.RGBEEncoding=Ks,t.LogLuvEncoding=$s,t.RGBM7Encoding=tc,t.RGBM16Encoding=ec,t.RGBDEncoding=rc,t.BasicDepthPacking=nc,t.RGBADepthPacking=ic,t.CubeGeometry=At,t.Face4=la,t.LineStrip=Yl,t.LinePieces=Zl,t.MeshFaceMaterial=ua,t.MultiMaterial=pa,t.PointCloud=da,t.Particle=fa,t.ParticleSystem=ma,t.PointCloudMaterial=va,t.ParticleBasicMaterial=ga,t.ParticleSystemMaterial=ya,t.Vertex=xa,t.DynamicBufferAttribute=ba,t.Int8Attribute=_a,t.Uint8Attribute=wa,t.Uint8ClampedAttribute=Ma,t.Int16Attribute=Ea,t.Uint16Attribute=Ta,t.Int32Attribute=Sa,t.Uint32Attribute=Aa,t.Float32Attribute=Ra,t.Float64Attribute=La,t.ClosedSplineCurve3=Pa,t.SplineCurve3=Ca,t.Spline=Ia,t.AxisHelper=Oa,t.BoundingBoxHelper=Na,t.EdgesHelper=Ua,t.WireframeHelper=Da,t.XHRLoader=Ba,t.BinaryTextureLoader=Fa,t.GeometryUtils=Jl,t.ImageUtils=Ql,t.Projector=za,t.CanvasRenderer=Ga,Object.defineProperty(t,"__esModule",{value:!0})});
  109. },{}],42:[function(_dereq_,module,exports){
  110. THREE.ColladaLoader=function(e){this.manager=void 0!==e?e:THREE.DefaultLoadingManager},THREE.ColladaLoader.prototype={constructor:THREE.ColladaLoader,crossOrigin:"Anonymous",load:function(e,t,r,a){var n=this,i=void 0===n.path?THREE.LoaderUtils.extractUrlBase(e):n.path,s=new THREE.FileLoader(n.manager);s.load(e,function(e){t(n.parse(e,i))},r,a)},setPath:function(e){this.path=e},options:{set convertUpAxis(e){console.warn("THREE.ColladaLoader: options.convertUpAxis() has been removed. Up axis is converted automatically.")}},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e,t){function r(e,t){for(var r=[],a=e.childNodes,n=0,i=a.length;n<i;n++){var s=a[n];s.nodeName===t&&r.push(s)}return r}function a(e){if(0===e.length)return[];for(var t=e.trim().split(/\s+/),r=new Array(t.length),a=0,n=t.length;a<n;a++)r[a]=t[a];return r}function n(e){if(0===e.length)return[];for(var t=e.trim().split(/\s+/),r=new Array(t.length),a=0,n=t.length;a<n;a++)r[a]=parseFloat(t[a]);return r}function i(e){if(0===e.length)return[];for(var t=e.trim().split(/\s+/),r=new Array(t.length),a=0,n=t.length;a<n;a++)r[a]=parseInt(t[a]);return r}function s(e){return e.substring(1)}function o(){return"three_default_"+dt++}function c(e){return 0===Object.keys(e).length}function l(e){return{unit:d(r(e,"unit")[0]),upAxis:u(r(e,"up_axis")[0])}}function d(e){return void 0!==e?parseFloat(e.getAttribute("meter")):1}function u(e){return void 0!==e?e.textContent:"Y_UP"}function f(e,t,a,n){var i=r(e,t)[0];if(void 0!==i)for(var s=r(i,a),o=0;o<s.length;o++)n(s[o])}function m(e,t){for(var r in e){var a=e[r];a.build=t(e[r])}}function h(e,t){return void 0!==e.build?e.build:(e.build=t(e),e.build)}function p(e){for(var t={sources:{},samplers:{},channels:{}},r=0,a=e.childNodes.length;r<a;r++){var n=e.childNodes[r];if(1===n.nodeType){var i;switch(n.nodeName){case"source":i=n.getAttribute("id"),t.sources[i]=pe(n);break;case"sampler":i=n.getAttribute("id"),t.samplers[i]=v(n);break;case"channel":i=n.getAttribute("target"),t.channels[i]=g(n);break;default:console.log(n)}}}ut.animations[e.getAttribute("id")]=t}function v(e){for(var t={inputs:{}},r=0,a=e.childNodes.length;r<a;r++){var n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"input":var i=s(n.getAttribute("source")),o=n.getAttribute("semantic");t.inputs[o]=i}}return t}function g(e){var t={},r=e.getAttribute("target"),a=r.split("/"),n=a.shift(),i=a.shift(),o=i.indexOf("(")!==-1,c=i.indexOf(".")!==-1;if(c)a=i.split("."),i=a.shift(),t.member=a.shift();else if(o){var l=i.split("(");i=l.shift();for(var d=0;d<l.length;d++)l[d]=parseInt(l[d].replace(/\)/,""));t.indices=l}return t.id=n,t.sid=i,t.arraySyntax=o,t.memberSyntax=c,t.sampler=s(e.getAttribute("source")),t}function b(e){var t=[],r=e.channels,a=e.samplers,n=e.sources;for(var i in r)if(r.hasOwnProperty(i)){var s=r[i],o=a[s.sampler],c=o.inputs.INPUT,l=o.inputs.OUTPUT,d=n[c],u=n[l],f=E(s,d,u);T(f,t)}return t}function y(e){return h(ut.animations[e],b)}function E(e,t,r){var a,n,i,s,o,c,l=ut.nodes[e.id],d=Je(l.id),u=l.transforms[e.sid],f=l.matrix.clone().transpose(),m={};switch(u){case"matrix":for(i=0,s=t.array.length;i<s;i++)if(a=t.array[i],n=i*r.stride,void 0===m[a]&&(m[a]={}),e.arraySyntax===!0){var h=r.array[n],p=e.indices[0]+4*e.indices[1];m[a][p]=h}else for(o=0,c=r.stride;o<c;o++)m[a][o]=r.array[n+o];break;case"translate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',u);break;case"rotate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',u);break;case"scale":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',u)}var v=N(m,f),g={name:d.uuid,keyframes:v};return g}function N(e,t){function r(e,t){return e.time-t.time}var a=[];for(var n in e)a.push({time:parseFloat(n),value:e[n]});a.sort(r);for(var i=0;i<16;i++)w(a,i,t.elements[i]);return a}function T(e,t){for(var r=e.keyframes,a=e.name,n=[],i=[],s=[],o=[],c=0,l=r.length;c<l;c++){var d=r[c],u=d.time,f=d.value;tt.fromArray(f).transpose(),tt.decompose(Ze,et,$e),n.push(u),i.push(Ze.x,Ze.y,Ze.z),s.push(et.x,et.y,et.z,et.w),o.push($e.x,$e.y,$e.z)}return i.length>0&&t.push(new THREE.VectorKeyframeTrack(a+".position",n,i)),s.length>0&&t.push(new THREE.QuaternionKeyframeTrack(a+".quaternion",n,s)),o.length>0&&t.push(new THREE.VectorKeyframeTrack(a+".scale",n,o)),t}function w(e,t,r){var a,n,i,s=!0;for(n=0,i=e.length;n<i;n++)a=e[n],void 0===a.value[t]?a.value[t]=null:s=!1;if(s===!0)for(n=0,i=e.length;n<i;n++)a=e[n],a.value[t]=r;else k(e,t)}function k(e,t){for(var r,a,n=0,i=e.length;n<i;n++){var s=e[n];if(null===s.value[t]){if(r=x(e,n,t),a=A(e,n,t),null===r){s.value[t]=a.value[t];continue}if(null===a){s.value[t]=r.value[t];continue}R(s,r,a,t)}}}function x(e,t,r){for(;t>=0;){var a=e[t];if(null!==a.value[r])return a;t--}return null}function A(e,t,r){for(;t<e.length;){var a=e[t];if(null!==a.value[r])return a;t++}return null}function R(e,t,r,a){return r.time-t.time===0?void(e.value[a]=t.value[a]):void(e.value[a]=(e.time-t.time)*(r.value[a]-t.value[a])/(r.time-t.time)+t.value[a])}function H(e){for(var t={name:e.getAttribute("id")||"default",start:parseFloat(e.getAttribute("start")||0),end:parseFloat(e.getAttribute("end")||0),animations:[]},r=0,a=e.childNodes.length;r<a;r++){var n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"instance_animation":t.animations.push(s(n.getAttribute("url")))}}ut.clips[e.getAttribute("id")]=t}function C(e){for(var t=[],r=e.name,a=e.end-e.start||-1,n=e.animations,i=0,s=n.length;i<s;i++)for(var o=y(n[i]),c=0,l=o.length;c<l;c++)t.push(o[c]);return new THREE.AnimationClip(r,a,t)}function _(e){return h(ut.clips[e],C)}function L(e){for(var t={},r=0,a=e.childNodes.length;r<a;r++){var n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"skin":t.id=s(n.getAttribute("source")),t.skin=M(n);break;case"morph":t.id=s(n.getAttribute("source")),console.warn("THREE.ColladaLoader: Morph target animation not supported yet.")}}ut.controllers[e.getAttribute("id")]=t}function M(e){for(var t={sources:{}},r=0,a=e.childNodes.length;r<a;r++){var i=e.childNodes[r];if(1===i.nodeType)switch(i.nodeName){case"bind_shape_matrix":t.bindShapeMatrix=n(i.textContent);break;case"source":var s=i.getAttribute("id");t.sources[s]=pe(i);break;case"joints":t.joints=j(i);break;case"vertex_weights":t.vertexWeights=O(i)}}return t}function j(e){for(var t={inputs:{}},r=0,a=e.childNodes.length;r<a;r++){var n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"input":var i=n.getAttribute("semantic"),o=s(n.getAttribute("source"));t.inputs[i]=o}}return t}function O(e){for(var t={inputs:{}},r=0,a=e.childNodes.length;r<a;r++){var n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"input":var o=n.getAttribute("semantic"),c=s(n.getAttribute("source")),l=parseInt(n.getAttribute("offset"));t.inputs[o]={id:c,offset:l};break;case"vcount":t.vcount=i(n.textContent);break;case"v":t.v=i(n.textContent)}}return t}function I(e){var t={id:e.id},r=ut.geometries[t.id];return void 0!==e.skin&&(t.skin=S(e.skin),r.sources.skinIndices=t.skin.indices,r.sources.skinWeights=t.skin.weights),t}function S(e){function t(e,t){return t.weight-e.weight}var r,a,n,i=4,s={joints:[],indices:{array:[],stride:i},weights:{array:[],stride:i}},o=e.sources,c=e.vertexWeights,l=c.vcount,d=c.v,u=c.inputs.JOINT.offset,f=c.inputs.WEIGHT.offset,m=e.sources[e.joints.inputs.JOINT],h=e.sources[e.joints.inputs.INV_BIND_MATRIX],p=o[c.inputs.WEIGHT.id].array,v=0;for(r=0,n=l.length;r<n;r++){var g=l[r],b=[];for(a=0;a<g;a++){var y=d[v+u],E=d[v+f],N=p[E];b.push({index:y,weight:N}),v+=2}for(b.sort(t),a=0;a<i;a++){var T=b[a];void 0!==T?(s.indices.array.push(T.index),s.weights.array.push(T.weight)):(s.indices.array.push(0),s.weights.array.push(0))}}for(s.bindMatrix=(new THREE.Matrix4).fromArray(e.bindShapeMatrix).transpose(),r=0,n=m.array.length;r<n;r++){var w=m.array[r],k=(new THREE.Matrix4).fromArray(h.array,r*h.stride).transpose();s.joints.push({name:w,boneInverse:k})}return s}function q(e){return h(ut.controllers[e],I)}function P(e){var t={init_from:r(e,"init_from")[0].textContent};ut.images[e.getAttribute("id")]=t}function F(e){return void 0!==e.build?e.build:e.init_from}function U(e){return h(ut.images[e],F)}function B(e){for(var t={},r=0,a=e.childNodes.length;r<a;r++){var n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"profile_COMMON":t.profile=V(n)}}ut.effects[e.getAttribute("id")]=t}function V(e){for(var t={surfaces:{},samplers:{}},r=0,a=e.childNodes.length;r<a;r++){var n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"newparam":z(n,t);break;case"technique":t.technique=J(n)}}return t}function z(e,t){for(var r=e.getAttribute("sid"),a=0,n=e.childNodes.length;a<n;a++){var i=e.childNodes[a];if(1===i.nodeType)switch(i.nodeName){case"surface":t.surfaces[r]=W(i);break;case"sampler2D":t.samplers[r]=D(i)}}}function W(e){for(var t={},r=0,a=e.childNodes.length;r<a;r++){var n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"init_from":t.init_from=n.textContent}}return t}function D(e){for(var t={},r=0,a=e.childNodes.length;r<a;r++){var n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"source":t.source=n.textContent}}return t}function J(e){for(var t={},r=0,a=e.childNodes.length;r<a;r++){var n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"constant":case"lambert":case"blinn":case"phong":t.type=n.nodeName,t.parameters=G(n)}}return t}function G(e){for(var t={},r=0,a=e.childNodes.length;r<a;r++){var n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"emission":case"diffuse":case"specular":case"shininess":case"transparent":case"transparency":t[n.nodeName]=K(n)}}return t}function K(e){for(var t={},r=0,a=e.childNodes.length;r<a;r++){var i=e.childNodes[r];if(1===i.nodeType)switch(i.nodeName){case"color":t[i.nodeName]=n(i.textContent);break;case"float":t[i.nodeName]=parseFloat(i.textContent);break;case"texture":t[i.nodeName]={id:i.getAttribute("texture"),extra:X(i)}}}return t}function X(e){for(var t={technique:{}},r=0,a=e.childNodes.length;r<a;r++){var n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"extra":Q(n,t)}}return t}function Q(e,t){for(var r=0,a=e.childNodes.length;r<a;r++){var n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"technique":Y(n,t)}}}function Y(e,t){for(var r=0,a=e.childNodes.length;r<a;r++){var n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"repeatU":case"repeatV":case"offsetU":case"offsetV":t.technique[n.nodeName]=parseFloat(n.textContent);break;case"wrapU":case"wrapV":"TRUE"===n.textContent.toUpperCase()?t.technique[n.nodeName]=1:"FALSE"===n.textContent.toUpperCase()?t.technique[n.nodeName]=0:t.technique[n.nodeName]=parseInt(n.textContent)}}}function Z(e){return e}function $(e){return h(ut.effects[e],Z)}function ee(e){for(var t={name:e.getAttribute("name")},r=0,a=e.childNodes.length;r<a;r++){var n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"instance_effect":t.url=s(n.getAttribute("url"))}}ut.materials[e.getAttribute("id")]=t}function te(e){function t(e){var t=a.profile.samplers[e.id];if(void 0!==t){var r=a.profile.surfaces[t.source],n=ot.load(U(r.init_from)),i=e.extra;if(void 0!==i&&void 0!==i.technique&&c(i.technique)===!1){var s=i.technique;n.wrapS=s.wrapU?THREE.RepeatWrapping:THREE.ClampToEdgeWrapping,n.wrapT=s.wrapV?THREE.RepeatWrapping:THREE.ClampToEdgeWrapping,n.offset.set(s.offsetU||0,s.offsetV||0),n.repeat.set(s.repeatU||1,s.repeatV||1)}else n.wrapS=THREE.RepeatWrapping,n.wrapT=THREE.RepeatWrapping;return n}return console.error("THREE.ColladaLoader: Undefined sampler",e.id),null}var r,a=$(e.url),n=a.profile.technique;switch(n.type){case"phong":case"blinn":r=new THREE.MeshPhongMaterial;break;case"lambert":r=new THREE.MeshLambertMaterial;break;default:r=new THREE.MeshBasicMaterial}r.name=e.name;var i=n.parameters;for(var s in i){var o=i[s];switch(s){case"diffuse":o.color&&r.color.fromArray(o.color),o.texture&&(r.map=t(o.texture));break;case"specular":o.color&&r.specular&&r.specular.fromArray(o.color),o.texture&&(r.specularMap=t(o.texture));break;case"shininess":o.float&&r.shininess&&(r.shininess=o.float);break;case"emission":o.color&&r.emissive&&r.emissive.fromArray(o.color);break;case"transparent":r.transparent=!0;break;case"transparency":void 0!==o.float&&(r.opacity=o.float),r.transparent=!0}}return r}function re(e){return h(ut.materials[e],te)}function ae(e){for(var t={name:e.getAttribute("name")},r=0,a=e.childNodes.length;r<a;r++){var n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"optics":t.optics=ne(n)}}ut.cameras[e.getAttribute("id")]=t}function ne(e){for(var t=0;t<e.childNodes.length;t++){var r=e.childNodes[t];switch(r.nodeName){case"technique_common":return ie(r)}}return{}}function ie(e){for(var t={},r=0;r<e.childNodes.length;r++){var a=e.childNodes[r];switch(a.nodeName){case"perspective":case"orthographic":t.technique=a.nodeName,t.parameters=se(a)}}return t}function se(e){for(var t={},r=0;r<e.childNodes.length;r++){var a=e.childNodes[r];switch(a.nodeName){case"xfov":case"yfov":case"xmag":case"ymag":case"znear":case"zfar":case"aspect_ratio":t[a.nodeName]=parseFloat(a.textContent)}}return t}function oe(e){var t;switch(e.optics.technique){case"perspective":t=new THREE.PerspectiveCamera(e.optics.parameters.yfov,e.optics.parameters.aspect_ratio,e.optics.parameters.znear,e.optics.parameters.zfar);break;case"orthographic":var r=e.optics.parameters.ymag,a=e.optics.parameters.xmag,n=e.optics.parameters.aspect_ratio;a=void 0===a?r*n:a,r=void 0===r?a/n:r,a*=.5,r*=.5,t=new THREE.OrthographicCamera(-a,a,r,-r,e.optics.parameters.znear,e.optics.parameters.zfar);break;default:t=new THREE.PerspectiveCamera}return t.name=e.name,t}function ce(e){var t=ut.cameras[e];return void 0!==t?h(t,oe):(console.warn("THREE.ColladaLoader: Couldn't find camera with ID:",e),null)}function le(e){for(var t={},r=0,a=e.childNodes.length;r<a;r++){var n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"technique_common":t=de(n)}}ut.lights[e.getAttribute("id")]=t}function de(e){for(var t={},r=0,a=e.childNodes.length;r<a;r++){var n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"directional":case"point":case"spot":case"ambient":t.technique=n.nodeName,t.parameters=ue(n)}}return t}function ue(e){for(var t={},r=0,a=e.childNodes.length;r<a;r++){var i=e.childNodes[r];if(1===i.nodeType)switch(i.nodeName){case"color":var s=n(i.textContent);t.color=(new THREE.Color).fromArray(s);break;case"falloff_angle":t.falloffAngle=parseFloat(i.textContent);break;case"quadratic_attenuation":var o=parseFloat(i.textContent);t.distance=o?Math.sqrt(1/o):0}}return t}function fe(e){var t;switch(e.technique){case"directional":t=new THREE.DirectionalLight;break;case"point":t=new THREE.PointLight;break;case"spot":t=new THREE.SpotLight;break;case"ambient":t=new THREE.AmbientLight}return e.parameters.color&&t.color.copy(e.parameters.color),e.parameters.distance&&(t.distance=e.parameters.distance),t}function me(e){var t=ut.lights[e];return void 0!==t?h(t,fe):(console.warn("THREE.ColladaLoader: Couldn't find light with ID:",e),null)}function he(e){var t={name:e.getAttribute("name"),sources:{},vertices:{},primitives:[]},a=r(e,"mesh")[0];if(void 0!==a){for(var n=0;n<a.childNodes.length;n++){var i=a.childNodes[n];if(1===i.nodeType){var s=i.getAttribute("id");switch(i.nodeName){case"source":t.sources[s]=pe(i);break;case"vertices":t.vertices=ve(i);break;case"polygons":console.warn("THREE.ColladaLoader: Unsupported primitive type: ",i.nodeName);break;case"lines":case"linestrips":case"polylist":case"triangles":t.primitives.push(ge(i));break;default:console.log(i)}}}ut.geometries[e.getAttribute("id")]=t}}function pe(e){for(var t={array:[],stride:3},i=0;i<e.childNodes.length;i++){var s=e.childNodes[i];if(1===s.nodeType)switch(s.nodeName){case"float_array":t.array=n(s.textContent);break;case"Name_array":t.array=a(s.textContent);break;case"technique_common":var o=r(s,"accessor")[0];void 0!==o&&(t.stride=parseInt(o.getAttribute("stride")))}}return t}function ve(e){for(var t={},r=0;r<e.childNodes.length;r++){var a=e.childNodes[r];1===a.nodeType&&(t[a.getAttribute("semantic")]=s(a.getAttribute("source")))}return t}function ge(e){for(var t={type:e.nodeName,material:e.getAttribute("material"),count:parseInt(e.getAttribute("count")),inputs:{},stride:0},r=0,a=e.childNodes.length;r<a;r++){var n=e.childNodes[r];if(1===n.nodeType)switch(n.nodeName){case"input":var o=s(n.getAttribute("source")),c=n.getAttribute("semantic"),l=parseInt(n.getAttribute("offset"));t.inputs[c]={id:o,offset:l},t.stride=Math.max(t.stride,l+1);break;case"vcount":t.vcount=i(n.textContent);break;case"p":t.p=i(n.textContent)}}return t}function be(e){for(var t={},r=0;r<e.length;r++){var a=e[r];void 0===t[a.type]&&(t[a.type]=[]),t[a.type].push(a)}return t}function ye(e){var t={},r=e.sources,a=e.vertices,n=e.primitives;if(0===n.length)return{};var i=be(n);for(var s in i)t[s]=Ee(i[s],r,a);return t}function Ee(e,t,r){for(var a={},n={array:[],stride:0},i={array:[],stride:0},s={array:[],stride:0},o={array:[],stride:0},c={array:[],stride:4},l={array:[],stride:4},d=new THREE.BufferGeometry,u=[],f=0,m=0,h=0;h<e.length;h++){var p=e[h],v=p.inputs,g=1;p.vcount&&4===p.vcount[0]&&(g=2),m="lines"===p.type||"linestrips"===p.type?2*p.count:3*p.count*g,d.addGroup(f,m,h),f+=m,p.material&&u.push(p.material);for(var b in v){var y=v[b];switch(b){case"VERTEX":for(var E in r){var N=r[E];switch(E){case"POSITION":Ne(p,t[N],y.offset,n.array),n.stride=t[N].stride,t.skinWeights&&t.skinIndices&&(Ne(p,t.skinIndices,y.offset,c.array),Ne(p,t.skinWeights,y.offset,l.array));break;case"NORMAL":Ne(p,t[N],y.offset,i.array),i.stride=t[N].stride;break;case"COLOR":Ne(p,t[N],y.offset,o.array),o.stride=t[N].stride;break;case"TEXCOORD":Ne(p,t[N],y.offset,s.array),s.stride=t[N].stride;break;default:console.warn('THREE.ColladaLoader: Semantic "%s" not handled in geometry build process.',E)}}break;case"NORMAL":Ne(p,t[y.id],y.offset,i.array),i.stride=t[y.id].stride;break;case"COLOR":Ne(p,t[y.id],y.offset,o.array),o.stride=t[y.id].stride;break;case"TEXCOORD":Ne(p,t[y.id],y.offset,s.array),s.stride=t[y.id].stride}}}return n.array.length>0&&d.addAttribute("position",new THREE.Float32BufferAttribute(n.array,n.stride)),i.array.length>0&&d.addAttribute("normal",new THREE.Float32BufferAttribute(i.array,i.stride)),o.array.length>0&&d.addAttribute("color",new THREE.Float32BufferAttribute(o.array,o.stride)),s.array.length>0&&d.addAttribute("uv",new THREE.Float32BufferAttribute(s.array,s.stride)),c.array.length>0&&d.addAttribute("skinIndex",new THREE.Float32BufferAttribute(c.array,c.stride)),l.array.length>0&&d.addAttribute("skinWeight",new THREE.Float32BufferAttribute(l.array,l.stride)),a.data=d,a.type=e[0].type,a.materialKeys=u,a}function Ne(e,t,r,a){function n(e){for(var t=i[e+r]*d,n=t+d;t<n;t++)a.push(l[t])}var i=e.p,s=e.stride,o=e.vcount,c=0,l=t.array,d=t.stride;if(void 0!==e.vcount){for(var u=0,f=0,m=o.length;f<m;f++){var h=o[f];if(4===h){var p=u+0*s,v=u+1*s,g=u+2*s,b=u+3*s;n(p),n(v),n(b),n(v),n(g),n(b)}else if(3===h){var p=u+0*s,v=u+1*s,g=u+2*s;n(p),n(v),n(g)}else c=Math.max(c,h);u+=s*h}c>0&&console.log("THREE.ColladaLoader: Geometry has faces with more than 4 vertices.")}else for(var f=0,m=i.length;f<m;f+=s)n(f)}function Te(e){return h(ut.geometries[e],ye)}function we(e){for(var t={name:e.getAttribute("name")||"",joints:{},links:[]},r=0;r<e.childNodes.length;r++){var a=e.childNodes[r];if(1===a.nodeType)switch(a.nodeName){case"technique_common":Ae(a,t)}}ut.kinematicsModels[e.getAttribute("id")]=t}function ke(e){return void 0!==e.build?e.build:e}function xe(e){return h(ut.kinematicsModels[e],ke)}function Ae(e,t){for(var r=0;r<e.childNodes.length;r++){var a=e.childNodes[r];if(1===a.nodeType)switch(a.nodeName){case"joint":t.joints[a.getAttribute("sid")]=Re(a);break;case"link":t.links.push(Ce(a))}}}function Re(e){for(var t,r=0;r<e.childNodes.length;r++){var a=e.childNodes[r];if(1===a.nodeType)switch(a.nodeName){case"prismatic":case"revolute":t=He(a)}}return t}function He(e,t){for(var t={sid:e.getAttribute("sid"),name:e.getAttribute("name")||"",axis:new THREE.Vector3,limits:{min:0,max:0},type:e.nodeName,static:!1,zeroPosition:0,middlePosition:0},r=0;r<e.childNodes.length;r++){var a=e.childNodes[r];if(1===a.nodeType)switch(a.nodeName){case"axis":var i=n(a.textContent);t.axis.fromArray(i);break;case"limits":var s=a.getElementsByTagName("max")[0],o=a.getElementsByTagName("min")[0];t.limits.max=parseFloat(s.textContent),t.limits.min=parseFloat(o.textContent)}}return t.limits.min>=t.limits.max&&(t.static=!0),t.middlePosition=(t.limits.min+t.limits.max)/2,t}function Ce(e){for(var t={sid:e.getAttribute("sid"),name:e.getAttribute("name")||"",attachments:[],transforms:[]},r=0;r<e.childNodes.length;r++){var a=e.childNodes[r];if(1===a.nodeType)switch(a.nodeName){case"attachment_full":t.attachments.push(_e(a));break;case"matrix":case"translate":case"rotate":t.transforms.push(Le(a))}}return t}function _e(e){for(var t={joint:e.getAttribute("joint").split("/").pop(),transforms:[],links:[]},r=0;r<e.childNodes.length;r++){var a=e.childNodes[r];if(1===a.nodeType)switch(a.nodeName){case"link":t.links.push(Ce(a));break;case"matrix":case"translate":case"rotate":t.transforms.push(Le(a))}}return t}function Le(e){var t={type:e.nodeName},r=n(e.textContent);switch(t.type){case"matrix":t.obj=new THREE.Matrix4,t.obj.fromArray(r).transpose();break;case"translate":t.obj=new THREE.Vector3,t.obj.fromArray(r);break;case"rotate":t.obj=new THREE.Vector3,t.obj.fromArray(r),t.angle=THREE.Math.degToRad(r[3])}return t}function Me(e){for(var t={bindJointAxis:[]},r=0;r<e.childNodes.length;r++){var a=e.childNodes[r];if(1===a.nodeType)switch(a.nodeName){case"bind_joint_axis":t.bindJointAxis.push(je(a))}}ut.kinematicsScenes[s(e.getAttribute("url"))]=t}function je(e){for(var t={target:e.getAttribute("target").split("/").pop()},r=0;r<e.childNodes.length;r++){var a=e.childNodes[r];if(1===a.nodeType)switch(a.nodeName){case"axis":var n=a.getElementsByTagName("param")[0];t.axis=n.textContent;var i=t.axis.split("inst_").pop().split("axis")[0];t.jointIndex=i.substr(0,i.length-1)}}return t}function Oe(e){return void 0!==e.build?e.build:e}function Ie(e){return h(ut.kinematicsScenes[e],Oe)}function Se(){function e(e,t){var r=t.getAttribute("name"),a=n.joints[e];s.traverse(function(n){n.name===r&&(c[e]={object:n,transforms:qe(t),joint:a,position:a.zeroPosition})})}var t=Object.keys(ut.kinematicsModels)[0],r=Object.keys(ut.kinematicsScenes)[0],a=Object.keys(ut.visualScenes)[0];if(void 0!==t&&void 0!==r){for(var n=xe(t),i=Ie(r),s=Xe(a),o=i.bindJointAxis,c={},l=0,d=o.length;l<d;l++){var u=o[l],f=nt.querySelector('[sid="'+u.target+'"]');if(f){var m=f.parentElement;e(u.jointIndex,m)}}var h=new THREE.Matrix4;lt={joints:n&&n.joints,getJointValue:function(e){var t=c[e];return t?t.position:void console.warn("THREE.ColladaLoader: Joint "+e+" doesn't exist.")},setJointValue:function(e,t){var r=c[e];if(r){var a=r.joint;if(t>a.limits.max||t<a.limits.min)console.warn("THREE.ColladaLoader: Joint "+e+" value "+t+" outside of limits (min: "+a.limits.min+", max: "+a.limits.max+").");else if(a.static)console.warn("THREE.ColladaLoader: Joint "+e+" is static.");else{var n=r.object,i=a.axis,s=r.transforms;tt.identity();for(var o=0;o<s.length;o++){var l=s[o];if(l.sid&&l.sid.indexOf(e)!==-1)switch(a.type){case"revolute":tt.multiply(h.makeRotationAxis(i,THREE.Math.degToRad(t)));break;case"prismatic":tt.multiply(h.makeTranslation(i.x*t,i.y*t,i.z*t));break;default:console.warn("THREE.ColladaLoader: Unknown joint type: "+a.type)}else switch(l.type){case"matrix":tt.multiply(l.obj);break;case"translate":tt.multiply(h.makeTranslation(l.obj.x,l.obj.y,l.obj.z));break;case"scale":tt.scale(l.obj);break;case"rotate":tt.multiply(h.makeRotationAxis(l.obj,l.angle))}}n.matrix.copy(tt),n.matrix.decompose(n.position,n.quaternion,n.scale),c[e].position=t}}else console.log("THREE.ColladaLoader: "+e+" does not exist.")}}}}function qe(e){for(var t=[],r=nt.querySelector('[id="'+e.id+'"]'),a=0;a<r.childNodes.length;a++){var i=r.childNodes[a];if(1===i.nodeType)switch(i.nodeName){case"matrix":var s=n(i.textContent),o=(new THREE.Matrix4).fromArray(s).transpose();t.push({sid:i.getAttribute("sid"),type:i.nodeName,obj:o});break;case"translate":case"scale":var s=n(i.textContent),c=(new THREE.Vector3).fromArray(s);t.push({sid:i.getAttribute("sid"),type:i.nodeName,obj:c});break;case"rotate":var s=n(i.textContent),c=(new THREE.Vector3).fromArray(s),l=THREE.Math.degToRad(s[3]);t.push({sid:i.getAttribute("sid"),type:i.nodeName,obj:c,angle:l})}}return t}function Pe(e){for(var t=e.getElementsByTagName("node"),r=0;r<t.length;r++){var a=t[r];a.hasAttribute("id")===!1&&a.setAttribute("id",o())}}function Fe(e){for(var t={name:e.getAttribute("name")||"",type:e.getAttribute("type"),id:e.getAttribute("id"),sid:e.getAttribute("sid"),matrix:new THREE.Matrix4,nodes:[],instanceCameras:[],instanceControllers:[],instanceLights:[],instanceGeometries:[],instanceNodes:[],transforms:{}},r=0;r<e.childNodes.length;r++){var a=e.childNodes[r];if(1===a.nodeType)switch(a.nodeName){case"node":t.nodes.push(a.getAttribute("id")),Fe(a);break;case"instance_camera":t.instanceCameras.push(s(a.getAttribute("url")));break;case"instance_controller":t.instanceControllers.push(Ue(a));break;case"instance_light":t.instanceLights.push(s(a.getAttribute("url")));break;case"instance_geometry":t.instanceGeometries.push(Ue(a));break;case"instance_node":t.instanceNodes.push(s(a.getAttribute("url")));break;case"matrix":var i=n(a.textContent);t.matrix.multiply(tt.fromArray(i).transpose()),t.transforms[a.getAttribute("sid")]=a.nodeName;break;case"translate":var i=n(a.textContent);rt.fromArray(i),t.matrix.multiply(tt.makeTranslation(rt.x,rt.y,rt.z)),t.transforms[a.getAttribute("sid")]=a.nodeName;break;case"rotate":var i=n(a.textContent),o=THREE.Math.degToRad(i[3]);t.matrix.multiply(tt.makeRotationAxis(rt.fromArray(i),o)),t.transforms[a.getAttribute("sid")]=a.nodeName;break;case"scale":var i=n(a.textContent);t.matrix.scale(rt.fromArray(i)),t.transforms[a.getAttribute("sid")]=a.nodeName;break;case"extra":break;default:console.log(a)}}return ut.nodes[t.id]=t,t}function Ue(e){for(var t={id:s(e.getAttribute("url")),materials:{},skeletons:[]},r=0;r<e.childNodes.length;r++){var a=e.childNodes[r];switch(a.nodeName){case"bind_material":for(var n=a.getElementsByTagName("instance_material"),i=0;i<n.length;i++){var o=n[i],c=o.getAttribute("symbol"),l=o.getAttribute("target");t.materials[c]=s(l)}break;case"skeleton":t.skeletons.push(s(a.textContent))}}return t}function Be(e,t){var r,a,n,i=[],s=[];for(r=0;r<e.length;r++){var o=e[r],c=Je(o);Ve(c,t,i)}for(r=0;r<t.length;r++)for(a=0;a<i.length;a++)if(n=i[a],n.bone.name===t[r].name){s[r]=n,n.processed=!0;break}for(r=0;r<i.length;r++)n=i[r],n.processed===!1&&(s.push(n),n.processed=!0);var l=[],d=[];for(r=0;r<s.length;r++)n=s[r],l.push(n.bone),d.push(n.boneInverse);return new THREE.Skeleton(l,d)}function Ve(e,t,r){e.traverse(function(e){if(e.isBone===!0){for(var a,n=0;n<t.length;n++){var i=t[n];if(i.name===e.name){a=i.boneInverse;break}}void 0===a&&(a=new THREE.Matrix4),r.push({bone:e,boneInverse:a,processed:!1})}})}function ze(e){for(var t=[],r=e.matrix,a=e.nodes,n=e.type,i=e.instanceCameras,s=e.instanceControllers,o=e.instanceLights,c=e.instanceGeometries,l=e.instanceNodes,d=0,u=a.length;d<u;d++)t.push(Je(a[d]));for(var d=0,u=i.length;d<u;d++){var f=ce(i[d]);null!==f&&t.push(f.clone())}for(var d=0,u=s.length;d<u;d++)for(var m=s[d],h=q(m.id),p=Te(h.id),v=De(p,m.materials),g=m.skeletons,b=h.skin.joints,y=Be(g,b),E=0,N=v.length;E<N;E++){var T=v[E];T.isSkinnedMesh&&(T.bind(y,h.skin.bindMatrix),T.normalizeSkinWeights()),t.push(T)}for(var d=0,u=o.length;d<u;d++){var w=me(o[d]);null!==w&&t.push(w.clone())}for(var d=0,u=c.length;d<u;d++)for(var m=c[d],p=Te(m.id),v=De(p,m.materials),E=0,N=v.length;E<N;E++)t.push(v[E]);for(var d=0,u=l.length;d<u;d++)t.push(Je(l[d]).clone());var T;if(0===a.length&&1===t.length)T=t[0];else{T="JOINT"===n?new THREE.Bone:new THREE.Group;for(var d=0;d<t.length;d++)T.add(t[d])}return T.name="JOINT"===n?e.sid:e.name,T.matrix.copy(r),T.matrix.decompose(T.position,T.quaternion,T.scale),T}function We(e,t){for(var r=[],a=0,n=e.length;a<n;a++){var i=t[e[a]];r.push(re(i))}return r}function De(e,t){var r=[];for(var a in e){var n=e[a],i=We(n.materialKeys,t);0===i.length&&("lines"===a||"linestrips"===a?i.push(new THREE.LineBasicMaterial):i.push(new THREE.MeshPhongMaterial));var s=void 0!==n.data.attributes.skinIndex;if(s)for(var o=0,c=i.length;o<c;o++)i[o].skinning=!0;var l,d=1===i.length?i[0]:i;switch(a){case"lines":l=new THREE.LineSegments(n.data,d);break;case"linestrips":l=new THREE.Line(n.data,d);break;case"triangles":case"polylist":l=s?new THREE.SkinnedMesh(n.data,d):new THREE.Mesh(n.data,d)}r.push(l)}return r}function Je(e){return h(ut.nodes[e],ze)}function Ge(e){var t={name:e.getAttribute("name"),children:[]};Pe(e);for(var a=r(e,"node"),n=0;n<a.length;n++)t.children.push(Fe(a[n]));ut.visualScenes[e.getAttribute("id")]=t}function Ke(e){var t=new THREE.Group;t.name=e.name;for(var r=e.children,a=0;a<r.length;a++){var n=r[a];null===n.id?t.add(ze(n)):t.add(Je(n.id))}return t}function Xe(e){return h(ut.visualScenes[e],Ke)}function Qe(e){var t=r(e,"instance_visual_scene")[0];return Xe(s(t.getAttribute("url")))}function Ye(){var e=ut.clips;if(c(e)===!0){if(c(ut.animations)===!1){var t=[];for(var r in ut.animations)for(var a=y(r),n=0,i=a.length;n<i;n++)t.push(a[n]);ct.push(new THREE.AnimationClip("default",-1,t))}}else for(var r in e)ct.push(_(r))}var Ze=new THREE.Vector3,$e=new THREE.Vector3,et=new THREE.Quaternion,tt=new THREE.Matrix4,rt=new THREE.Vector3;if(console.time("THREE.ColladaLoader"),0===e.length)return{scene:new THREE.Scene};console.time("THREE.ColladaLoader: DOMParser");var at=(new DOMParser).parseFromString(e,"application/xml");console.timeEnd("THREE.ColladaLoader: DOMParser");var nt=r(at,"COLLADA")[0],it=nt.getAttribute("version");console.log("THREE.ColladaLoader: File version",it);var st=l(r(nt,"asset")[0]),ot=new THREE.TextureLoader(this.manager);ot.setPath(t).setCrossOrigin(this.crossOrigin);var ct=[],lt={},dt=0,ut={animations:{},clips:{},controllers:{},images:{},effects:{},materials:{},cameras:{},lights:{},geometries:{},nodes:{},visualScenes:{},kinematicsModels:{},kinematicsScenes:{}};console.time("THREE.ColladaLoader: Parse"),f(nt,"library_animations","animation",p),f(nt,"library_animation_clips","animation_clip",H),f(nt,"library_controllers","controller",L),f(nt,"library_images","image",P),f(nt,"library_effects","effect",B),f(nt,"library_materials","material",ee),f(nt,"library_cameras","camera",ae),f(nt,"library_lights","light",le),f(nt,"library_geometries","geometry",he),f(nt,"library_nodes","node",Fe),f(nt,"library_visual_scenes","visual_scene",Ge),f(nt,"library_kinematics_models","kinematics_model",we),f(nt,"scene","instance_kinematics_scene",Me),console.timeEnd("THREE.ColladaLoader: Parse"),console.time("THREE.ColladaLoader: Build"),m(ut.animations,b),m(ut.clips,C),m(ut.controllers,I),m(ut.images,F),m(ut.effects,Z),m(ut.materials,te),m(ut.cameras,oe),m(ut.lights,fe),m(ut.geometries,ye),m(ut.visualScenes,Ke),console.timeEnd("THREE.ColladaLoader: Build"),Ye(),Se();var ft=Qe(r(nt,"scene")[0]);return"Z_UP"===st.upAxis&&(ft.rotation.x=-Math.PI/2),ft.scale.multiplyScalar(st.unit),console.timeEnd("THREE.ColladaLoader"),{animations:ct,kinematics:lt,library:ut,scene:ft}}};
  111. },{}],43:[function(_dereq_,module,exports){
  112. THREE.GLTFLoader=function(){function e(e){this.manager=void 0!==e?e:THREE.DefaultLoadingManager}function a(){var e={};return{get:function(a){return e[a]},add:function(a,t){e[a]=t},remove:function(a){delete e[a]},removeAll:function(){e={}}}}function t(e){this.name=d.KHR_LIGHTS,this.lights={};var a=e.extensions&&e.extensions[d.KHR_LIGHTS]||{},t=a.lights||{};for(var r in t){var s,n=t[r],i=(new THREE.Color).fromArray(n.color);switch(n.type){case"directional":s=new THREE.DirectionalLight(i),s.position.set(0,0,1);break;case"point":s=new THREE.PointLight(i);break;case"spot":s=new THREE.SpotLight(i),s.position.set(0,0,1);break;case"ambient":s=new THREE.AmbientLight(i)}s&&(void 0!==n.constantAttenuation&&(s.intensity=n.constantAttenuation),void 0!==n.linearAttenuation&&(s.distance=1/n.linearAttenuation),void 0!==n.quadraticAttenuation&&(s.decay=n.quadraticAttenuation),void 0!==n.fallOffAngle&&(s.angle=n.fallOffAngle),void 0!==n.fallOffExponent&&console.warn("THREE.GLTFLoader:: light.fallOffExponent not currently supported."),s.name=n.name||"light_"+r,this.lights[r]=s)}}function r(e){this.name=d.KHR_MATERIALS_COMMON}function s(e){this.name=d.KHR_BINARY_GLTF,this.content=null,this.body=null;var a=new DataView(e,0,m);if(this.header={magic:THREE.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:a.getUint32(4,!0),length:a.getUint32(8,!0)},this.header.magic!==E)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected. Use LegacyGLTFLoader instead.");for(var t=new DataView(e,m),r=0;r<t.byteLength;){var s=t.getUint32(r,!0);r+=4;var n=t.getUint32(r,!0);if(r+=4,n===f.JSON){var i=new Uint8Array(e,m+r,s);this.content=THREE.LoaderUtils.decodeText(i)}else if(n===f.BIN){var o=m+r;this.body=e.slice(o,o+s)}r+=s}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}function n(){return{name:d.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return THREE.ShaderMaterial},extendParams:function(e,a,t){var r=a.extensions[this.name],s=THREE.ShaderLib.standard,n=THREE.UniformsUtils.clone(s.uniforms),i=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),o=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),l=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\ttexelSpecular = sRGBToLinear( texelSpecular );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),u=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),p=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb;","material.specularRoughness = clamp( 1.0 - glossinessFactor, 0.04, 1.0 );","material.specularColor = specularFactor.rgb;"].join("\n"),c=s.fragmentShader.replace("#include <specularmap_fragment>","").replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>",i).replace("#include <metalnessmap_pars_fragment>",o).replace("#include <roughnessmap_fragment>",l).replace("#include <metalnessmap_fragment>",u).replace("#include <lights_physical_fragment>",p);delete n.roughness,delete n.metalness,delete n.roughnessMap,delete n.metalnessMap,n.specular={value:(new THREE.Color).setHex(1118481)},n.glossiness={value:.5},n.specularMap={value:null},n.glossinessMap={value:null},e.vertexShader=s.vertexShader,e.fragmentShader=c,e.uniforms=n,e.defines={STANDARD:""},e.color=new THREE.Color(1,1,1),e.opacity=1;var d=[];if(Array.isArray(r.diffuseFactor)){var E=r.diffuseFactor;e.color.fromArray(E),e.opacity=E[3]}if(void 0!==r.diffuseTexture&&d.push(t.assignTexture(e,"map",r.diffuseTexture.index)),e.emissive=new THREE.Color(0,0,0),e.glossiness=void 0!==r.glossinessFactor?r.glossinessFactor:1,e.specular=new THREE.Color(1,1,1),Array.isArray(r.specularFactor)&&e.specular.fromArray(r.specularFactor),void 0!==r.specularGlossinessTexture){var m=r.specularGlossinessTexture.index;d.push(t.assignTexture(e,"glossinessMap",m)),d.push(t.assignTexture(e,"specularMap",m))}return Promise.all(d)},createMaterial:function(e){var a=new THREE.ShaderMaterial({defines:e.defines,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,uniforms:e.uniforms,fog:!0,lights:!0,opacity:e.opacity,transparent:e.transparent});return a.isGLTFSpecularGlossinessMaterial=!0,a.color=e.color,a.map=void 0===e.map?null:e.map,a.lightMap=null,a.lightMapIntensity=1,a.aoMap=void 0===e.aoMap?null:e.aoMap,a.aoMapIntensity=1,a.emissive=e.emissive,a.emissiveIntensity=1,a.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,a.bumpMap=void 0===e.bumpMap?null:e.bumpMap,a.bumpScale=1,a.normalMap=void 0===e.normalMap?null:e.normalMap,e.normalScale&&(a.normalScale=e.normalScale),a.displacementMap=null,a.displacementScale=1,a.displacementBias=0,a.specularMap=void 0===e.specularMap?null:e.specularMap,a.specular=e.specular,a.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,a.glossiness=e.glossiness,a.alphaMap=null,a.envMap=void 0===e.envMap?null:e.envMap,a.envMapIntensity=1,a.refractionRatio=.98,a.extensions.derivatives=!0,a},cloneMaterial:function(e){var a=e.clone();a.isGLTFSpecularGlossinessMaterial=!0;for(var t=this.specularGlossinessParams,r=0,s=t.length;r<s;r++)a[t[r]]=e[t[r]];return a},refreshUniforms:function(e,a,t,r,s,n){var i=s.uniforms,o=s.defines;i.opacity.value=s.opacity,i.diffuse.value.copy(s.color),i.emissive.value.copy(s.emissive).multiplyScalar(s.emissiveIntensity),i.map.value=s.map,i.specularMap.value=s.specularMap,i.alphaMap.value=s.alphaMap,i.lightMap.value=s.lightMap,i.lightMapIntensity.value=s.lightMapIntensity,i.aoMap.value=s.aoMap,i.aoMapIntensity.value=s.aoMapIntensity;var l;if(s.map?l=s.map:s.specularMap?l=s.specularMap:s.displacementMap?l=s.displacementMap:s.normalMap?l=s.normalMap:s.bumpMap?l=s.bumpMap:s.glossinessMap?l=s.glossinessMap:s.alphaMap?l=s.alphaMap:s.emissiveMap&&(l=s.emissiveMap),void 0!==l){l.isWebGLRenderTarget&&(l=l.texture);var u,p;if(void 0!==l.matrix){if(l.matrixAutoUpdate===!0){u=l.offset,p=l.repeat;var c=l.rotation,d=l.center;l.matrix.setUvTransform(u.x,u.y,p.x,p.y,c,d.x,d.y)}i.uvTransform.value.copy(l.matrix)}else u=l.offset,p=l.repeat,i.offsetRepeat.value.set(u.x,u.y,p.x,p.y)}i.envMap.value=s.envMap,i.envMapIntensity.value=s.envMapIntensity,i.flipEnvMap.value=s.envMap&&s.envMap.isCubeTexture?-1:1,i.refractionRatio.value=s.refractionRatio,i.specular.value.copy(s.specular),i.glossiness.value=s.glossiness,i.glossinessMap.value=s.glossinessMap,i.emissiveMap.value=s.emissiveMap,i.bumpMap.value=s.bumpMap,i.normalMap.value=s.normalMap,i.displacementMap.value=s.displacementMap,i.displacementScale.value=s.displacementScale,i.displacementBias.value=s.displacementBias,null!==i.glossinessMap.value&&void 0===o.USE_GLOSSINESSMAP&&(o.USE_GLOSSINESSMAP="",o.USE_ROUGHNESSMAP=""),null===i.glossinessMap.value&&void 0!==o.USE_GLOSSINESSMAP&&(delete o.USE_GLOSSINESSMAP,delete o.USE_ROUGHNESSMAP)}}}function i(e,a){return"string"!=typeof e||""===e?"":/^(https?:)?\/\//i.test(e)?e:/^data:.*,.*$/i.test(e)?e:/^blob:.*$/i.test(e)?e:a+e}function o(){return new THREE.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:THREE.FrontSide})}function l(e,a,t,r){var s=e.geometry,n=e.material,i=t.targets,o=s.morphAttributes;o.position=[],o.normal=[],n.morphTargets=!0;for(var l=0,u=i.length;l<u;l++){var p,c,d=i[l],E="morphTarget"+l;if(void 0!==d.POSITION){p=r[d.POSITION].clone();for(var m=s.attributes.position,f=0,h=p.count;f<h;f++)p.setXYZ(f,p.getX(f)+m.getX(f),p.getY(f)+m.getY(f),p.getZ(f)+m.getZ(f))}else s.attributes.position&&(p=s.attributes.position.clone());if(void 0!==p&&(p.name=E,o.position.push(p)),void 0!==d.NORMAL){n.morphNormals=!0,c=r[d.NORMAL].clone();for(var v=s.attributes.normal,f=0,h=c.count;f<h;f++)c.setXYZ(f,c.getX(f)+v.getX(f),c.getY(f)+v.getY(f),c.getZ(f)+v.getZ(f))}else void 0!==s.attributes.normal&&(c=s.attributes.normal.clone());void 0!==c&&(c.name=E,o.normal.push(c))}if(e.updateMorphTargets(),void 0!==a.weights)for(var l=0,u=a.weights.length;l<u;l++)e.morphTargetInfluences[l]=a.weights[l]}function u(e,a){if(e.indices!==a.indices)return!1;var t=e.attributes||{},r=a.attributes||{},s=Object.keys(t),n=Object.keys(r);if(s.length!==n.length)return!1;for(var i=0,o=s.length;i<o;i++){var l=s[i];if(t[l]!==r[l])return!1}return!0}function p(e,a){for(var t=0,r=e.length;t<r;t++){var s=e[t];if(u(s.primitive,a))return s.geometry}return null}function c(e,t,r){this.json=e||{},this.extensions=t||{},this.options=r||{},this.cache=new a,this.primitiveCache=[],this.textureLoader=new THREE.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new THREE.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer")}e.prototype={constructor:e,crossOrigin:"Anonymous",load:function(e,a,t,r){var s=this,n=void 0!==this.path?this.path:THREE.LoaderUtils.extractUrlBase(e),i=new THREE.FileLoader(s.manager);i.setResponseType("arraybuffer"),i.load(e,function(e){try{s.parse(e,n,a,r)}catch(e){if(void 0===r)throw e;r(e)}},t,r)},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this},parse:function(e,a,i,o){var l,u={};if("string"==typeof e)l=e;else{var p=THREE.LoaderUtils.decodeText(new Uint8Array(e,0,4));if(p===E){try{u[d.KHR_BINARY_GLTF]=new s(e)}catch(e){return void(o&&o(e))}l=u[d.KHR_BINARY_GLTF].content}else l=THREE.LoaderUtils.decodeText(new Uint8Array(e))}var m=JSON.parse(l);if(void 0===m.asset||m.asset.version[0]<2)return void(o&&o(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported. Use LegacyGLTFLoader instead.")));m.extensionsUsed&&(m.extensionsUsed.indexOf(d.KHR_LIGHTS)>=0&&(u[d.KHR_LIGHTS]=new t(m)),m.extensionsUsed.indexOf(d.KHR_MATERIALS_COMMON)>=0&&(u[d.KHR_MATERIALS_COMMON]=new r(m)),m.extensionsUsed.indexOf(d.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS)>=0&&(u[d.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]=new n)),console.time("GLTFLoader");var f=new c(m,u,{path:a||this.path||"",crossOrigin:this.crossOrigin,manager:this.manager});f.parse(function(e,a,t,r,s){console.timeEnd("GLTFLoader");var n={scene:e,scenes:a,cameras:t,animations:r,asset:s};i(n)},o)}};var d={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_LIGHTS:"KHR_lights",KHR_MATERIALS_COMMON:"KHR_materials_common",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness"};r.prototype.getMaterialType=function(e){var a=e.extensions[this.name];switch(a.type){case"commonBlinn":case"commonPhong":return THREE.MeshPhongMaterial;case"commonLambert":return THREE.MeshLambertMaterial;case"commonConstant":default:return THREE.MeshBasicMaterial}},r.prototype.extendParams=function(e,a,t){var r=a.extensions[this.name],s=[],n=[];switch(r.type){case"commonBlinn":case"commonPhong":n.push("diffuseFactor","diffuseTexture","specularFactor","specularTexture","shininessFactor");break;case"commonLambert":n.push("diffuseFactor","diffuseTexture");break;case"commonConstant":}var i={};return n.forEach(function(e){void 0!==r[e]&&(i[e]=r[e])}),void 0!==i.diffuseFactor&&(e.color=(new THREE.Color).fromArray(i.diffuseFactor),e.opacity=i.diffuseFactor[3]),void 0!==i.diffuseTexture&&s.push(t.assignTexture(e,"map",i.diffuseTexture.index)),void 0!==i.specularFactor&&(e.specular=(new THREE.Color).fromArray(i.specularFactor)),void 0!==i.specularTexture&&s.push(t.assignTexture(e,"specularMap",i.specularTexture.index)),void 0!==i.shininessFactor&&(e.shininess=i.shininessFactor),Promise.all(s)};var E="glTF",m=12,f={JSON:1313821514,BIN:5130562},h={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},v=({5126:Number,35675:THREE.Matrix3,35676:THREE.Matrix4,35664:THREE.Vector2,35665:THREE.Vector3,35666:THREE.Vector4,35678:THREE.Texture},{5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array}),T={9728:THREE.NearestFilter,9729:THREE.LinearFilter,9984:THREE.NearestMipMapNearestFilter,9985:THREE.LinearMipMapNearestFilter,9986:THREE.NearestMipMapLinearFilter,9987:THREE.LinearMipMapLinearFilter},R={33071:THREE.ClampToEdgeWrapping,33648:THREE.MirroredRepeatWrapping,10497:THREE.RepeatWrapping},g={6406:THREE.AlphaFormat,6407:THREE.RGBFormat,6408:THREE.RGBAFormat,6409:THREE.LuminanceFormat,6410:THREE.LuminanceAlphaFormat},M={5121:THREE.UnsignedByteType,32819:THREE.UnsignedShort4444Type,32820:THREE.UnsignedShort5551Type,33635:THREE.UnsignedShort565Type},S=({1028:THREE.BackSide,1029:THREE.FrontSide},{512:THREE.NeverDepth,513:THREE.LessDepth,514:THREE.EqualDepth,515:THREE.LessEqualDepth,516:THREE.GreaterEqualDepth,517:THREE.NotEqualDepth,518:THREE.GreaterEqualDepth,519:THREE.AlwaysDepth},{32774:THREE.AddEquation,32778:THREE.SubtractEquation,32779:THREE.ReverseSubtractEquation},{0:THREE.ZeroFactor,1:THREE.OneFactor,768:THREE.SrcColorFactor,769:THREE.OneMinusSrcColorFactor,770:THREE.SrcAlphaFactor,771:THREE.OneMinusSrcAlphaFactor,772:THREE.DstAlphaFactor,773:THREE.OneMinusDstAlphaFactor,774:THREE.DstColorFactor,775:THREE.OneMinusDstColorFactor,776:THREE.SrcAlphaSaturateFactor},{SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16}),H={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},L={CUBICSPLINE:THREE.InterpolateSmooth,LINEAR:THREE.InterpolateLinear,STEP:THREE.InterpolateDiscrete},y={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};return c.prototype.parse=function(e,a){var t=this.json;this.cache.removeAll(),this.markDefs(),this.getMultiDependencies(["scene","animation","camera"]).then(function(a){var r=a.scenes||[],s=r[t.scene||0],n=a.animations||[],i=t.asset,o=a.cameras||[];e(s,r,o,n,i)}).catch(a)},c.prototype.markDefs=function(){for(var e=this.json.nodes||[],a=this.json.skins||[],t=this.json.meshes||[],r={},s={},n=0,i=a.length;n<i;n++)for(var o=a[n].joints,l=0,u=o.length;l<u;l++)e[o[l]].isBone=!0;for(var p=0,c=e.length;p<c;p++){var d=e[p];void 0!==d.mesh&&(void 0===r[d.mesh]&&(r[d.mesh]=s[d.mesh]=0),r[d.mesh]++,void 0!==d.skin&&(t[d.mesh].isSkinnedMesh=!0))}this.json.meshReferences=r,this.json.meshUses=s},c.prototype.getDependency=function(e,a){var t=e+":"+a,r=this.cache.get(t);if(!r){var s="load"+e.charAt(0).toUpperCase()+e.slice(1);r=this[s](a),this.cache.add(t,r)}return r},c.prototype.getDependencies=function(e){var a=this.cache.get(e);if(!a){var t=this,r=this.json[e+("mesh"===e?"es":"s")]||[];a=Promise.all(r.map(function(a,r){return t.getDependency(e,r)})),this.cache.add(e,a)}return a},c.prototype.getMultiDependencies=function(e){for(var a={},t=[],r=0,s=e.length;r<s;r++){var n=e[r],i=this.getDependencies(n);i=i.then(function(e,t){a[e]=t}.bind(this,n+("mesh"===n?"es":"s"))),t.push(i)}return Promise.all(t).then(function(){return a})},c.prototype.loadBuffer=function(e){var a=this.json.buffers[e],t=this.fileLoader;if(a.type&&"arraybuffer"!==a.type)throw new Error("THREE.GLTFLoader: "+a.type+" buffer type is not supported.");if(void 0===a.uri&&0===e)return Promise.resolve(this.extensions[d.KHR_BINARY_GLTF].body);var r=this.options;return new Promise(function(e,s){t.load(i(a.uri,r.path),e,void 0,function(){s(new Error('THREE.GLTFLoader: Failed to load buffer "'+a.uri+'".'))})})},c.prototype.loadBufferView=function(e){var a=this.json.bufferViews[e];return this.getDependency("buffer",a.buffer).then(function(e){var t=a.byteLength||0,r=a.byteOffset||0;return e.slice(r,r+t)})},c.prototype.loadAccessor=function(e){var a=this.json,t=this.json.accessors[e],r=[];return void 0!==t.bufferView?r.push(this.getDependency("bufferView",t.bufferView)):r.push(null),void 0!==t.sparse&&(r.push(this.getDependency("bufferView",t.sparse.indices.bufferView)),r.push(this.getDependency("bufferView",t.sparse.values.bufferView))),Promise.all(r).then(function(e){var r,s,n=e[0],i=S[t.type],o=v[t.componentType],l=o.BYTES_PER_ELEMENT,u=l*i,p=a.bufferViews[t.bufferView].byteStride,c=t.normalized===!0;if(p&&p!==u){r=new o(n);var d=new THREE.InterleavedBuffer(r,p/l);s=new THREE.InterleavedBufferAttribute(d,i,t.byteOffset/l,c)}else r=null===n?new o(t.count*i):new o(n,t.byteOffset,t.count*i),s=new THREE.BufferAttribute(r,i,c);if(void 0!==t.sparse){var E=S.SCALAR,m=v[t.sparse.indices.componentType],f=t.sparse.indices.byteOffset||0,h=t.sparse.values.byteOffset||0,T=new m(e[1],f,t.sparse.count*E),R=new o(e[2],h,t.sparse.count*i);null!==n&&s.setArray(s.array.slice());for(var g=0,M=T.length;g<M;g++){var H=T[g];if(s.setX(H,R[g*i]),i>=2&&s.setY(H,R[g*i+1]),i>=3&&s.setZ(H,R[g*i+2]),i>=4&&s.setW(H,R[g*i+3]),i>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return s})},c.prototype.loadTexture=function(e){var a=this,t=this.json,r=this.options,s=this.textureLoader,n=window.URL||window.webkitURL,o=t.textures[e],l=t.images[o.source],u=l.uri,p=!1;return void 0!==l.bufferView&&(u=a.getDependency("bufferView",l.bufferView).then(function(e){p=!0;var a=new Blob([e],{type:l.mimeType});return u=n.createObjectURL(a)})),Promise.resolve(u).then(function(e){var a=THREE.Loader.Handlers.get(e)||s;return new Promise(function(t,s){a.load(i(e,r.path),t,void 0,s)})}).then(function(e){p===!0&&n.revokeObjectURL(u),e.flipY=!1,void 0!==o.name&&(e.name=o.name),e.format=void 0!==o.format?g[o.format]:THREE.RGBAFormat,void 0!==o.internalFormat&&e.format!==g[o.internalFormat]&&console.warn("THREE.GLTFLoader: Three.js does not support texture internalFormat which is different from texture format. internalFormat will be forced to be the same value as format."),e.type=void 0!==o.type?M[o.type]:THREE.UnsignedByteType;var a=t.samplers||{},r=a[o.sampler]||{};return e.magFilter=T[r.magFilter]||THREE.LinearFilter,e.minFilter=T[r.minFilter]||THREE.LinearMipMapLinearFilter,e.wrapS=R[r.wrapS]||THREE.RepeatWrapping,e.wrapT=R[r.wrapT]||THREE.RepeatWrapping,e})},c.prototype.assignTexture=function(e,a,t){return this.getDependency("texture",t).then(function(t){e[a]=t})},c.prototype.loadMaterial=function(e){var a,t=this,r=(this.json,this.extensions),s=this.json.materials[e],n={},i=s.extensions||{},o=[];if(i[d.KHR_MATERIALS_COMMON]){var l=r[d.KHR_MATERIALS_COMMON];a=l.getMaterialType(s),o.push(l.extendParams(n,s,t))}else if(i[d.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var u=r[d.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];a=u.getMaterialType(s),o.push(u.extendParams(n,s,t))}else if(void 0!==s.pbrMetallicRoughness){a=THREE.MeshStandardMaterial;var p=s.pbrMetallicRoughness;if(n.color=new THREE.Color(1,1,1),n.opacity=1,Array.isArray(p.baseColorFactor)){var c=p.baseColorFactor;n.color.fromArray(c),n.opacity=c[3]}if(void 0!==p.baseColorTexture&&o.push(t.assignTexture(n,"map",p.baseColorTexture.index)),n.metalness=void 0!==p.metallicFactor?p.metallicFactor:1,n.roughness=void 0!==p.roughnessFactor?p.roughnessFactor:1,void 0!==p.metallicRoughnessTexture){var E=p.metallicRoughnessTexture.index;o.push(t.assignTexture(n,"metalnessMap",E)),o.push(t.assignTexture(n,"roughnessMap",E))}}else a=THREE.MeshPhongMaterial;s.doubleSided===!0&&(n.side=THREE.DoubleSide);var m=s.alphaMode||y.OPAQUE;return m===y.BLEND?n.transparent=!0:(n.transparent=!1,m===y.MASK&&(n.alphaTest=void 0!==s.alphaCutoff?s.alphaCutoff:.5)),void 0!==s.normalTexture&&(o.push(t.assignTexture(n,"normalMap",s.normalTexture.index)),n.normalScale=new THREE.Vector2(1,1),void 0!==s.normalTexture.scale&&n.normalScale.set(s.normalTexture.scale,s.normalTexture.scale)),void 0!==s.occlusionTexture&&(o.push(t.assignTexture(n,"aoMap",s.occlusionTexture.index)),void 0!==s.occlusionTexture.strength&&(n.aoMapIntensity=s.occlusionTexture.strength)),void 0!==s.emissiveFactor&&(a===THREE.MeshBasicMaterial?n.color=(new THREE.Color).fromArray(s.emissiveFactor):n.emissive=(new THREE.Color).fromArray(s.emissiveFactor)),void 0!==s.emissiveTexture&&(a===THREE.MeshBasicMaterial?o.push(t.assignTexture(n,"map",s.emissiveTexture.index)):o.push(t.assignTexture(n,"emissiveMap",s.emissiveTexture.index))),Promise.all(o).then(function(){var e;return e=a===THREE.ShaderMaterial?r[d.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(n):new a(n),void 0!==s.name&&(e.name=s.name),e.normalScale&&(e.normalScale.x=-e.normalScale.x),e.map&&(e.map.encoding=THREE.sRGBEncoding),e.emissiveMap&&(e.emissiveMap.encoding=THREE.sRGBEncoding),s.extras&&(e.userData=s.extras),e})},c.prototype.loadGeometries=function(e){var a=this.primitiveCache;return this.getDependencies("accessor").then(function(t){for(var r=[],s=0,n=e.length;s<n;s++){var i=e[s],o=p(a,i);if(o)r.push(o);else{var l=new THREE.BufferGeometry,u=i.attributes;for(var c in u){var d=u[c],E=t[d];switch(c){case"POSITION":l.addAttribute("position",E);break;case"NORMAL":l.addAttribute("normal",E);break;case"TEXCOORD_0":case"TEXCOORD0":case"TEXCOORD":l.addAttribute("uv",E);break;case"TEXCOORD_1":l.addAttribute("uv2",E);break;case"COLOR_0":case"COLOR0":case"COLOR":l.addAttribute("color",E);break;case"WEIGHTS_0":case"WEIGHT":l.addAttribute("skinWeight",E);break;case"JOINTS_0":case"JOINT":l.addAttribute("skinIndex",E)}}void 0!==i.indices&&l.setIndex(t[i.indices]),a.push({primitive:i,geometry:l}),r.push(l)}}return r})},c.prototype.loadMesh=function(e){var a=this,t=(this.json,this.extensions),r=this.json.meshes[e];return this.getMultiDependencies(["accessor","material"]).then(function(s){var n=new THREE.Group,i=r.primitives;return a.loadGeometries(i).then(function(a){for(var u=0,p=i.length;u<p;u++){var c=i[u],E=a[u],m=void 0===c.material?o():s.materials[c.material];m.aoMap&&void 0===E.attributes.uv2&&void 0!==E.attributes.uv&&(console.log("THREE.GLTFLoader: Duplicating UVs to support aoMap."),E.addAttribute("uv2",new THREE.BufferAttribute(E.attributes.uv.array,2)));var f=void 0!==E.attributes.color,v=void 0===E.attributes.normal,T=r.isSkinnedMesh===!0,R=void 0!==c.targets;if(f||v||T||R)if(m.isGLTFSpecularGlossinessMaterial){var g=t[d.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];m=g.cloneMaterial(m)}else m=m.clone();f&&(m.vertexColors=THREE.VertexColors,m.needsUpdate=!0),v&&(m.flatShading=!0);var M;if(c.mode===h.TRIANGLES||c.mode===h.TRIANGLE_STRIP||c.mode===h.TRIANGLE_FAN||void 0===c.mode)T?(M=new THREE.SkinnedMesh(E,m),m.skinning=!0):M=new THREE.Mesh(E,m),c.mode===h.TRIANGLE_STRIP?M.drawMode=THREE.TriangleStripDrawMode:c.mode===h.TRIANGLE_FAN&&(M.drawMode=THREE.TriangleFanDrawMode);else if(c.mode===h.LINES)M=new THREE.LineSegments(E,m);else if(c.mode===h.LINE_STRIP)M=new THREE.Line(E,m);else if(c.mode===h.LINE_LOOP)M=new THREE.LineLoop(E,m);else{if(c.mode!==h.POINTS)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+c.mode);M=new THREE.Points(E,m)}if(M.name=r.name||"mesh_"+e,R&&l(M,r,c,s.accessors),void 0!==r.extras&&(M.userData=r.extras),void 0!==c.extras&&(M.geometry.userData=c.extras),m.isGLTFSpecularGlossinessMaterial===!0&&(M.onBeforeRender=t[d.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].refreshUniforms),!(i.length>1))return M;M.name+="_"+u,n.add(M)}return n})})},c.prototype.loadCamera=function(e){var a,t=this.json.cameras[e],r=t[t.type];if(!r)return void console.warn("THREE.GLTFLoader: Missing camera parameters.");if("perspective"===t.type){var s=r.aspectRatio||1,n=r.yfov*s;a=new THREE.PerspectiveCamera(THREE.Math.radToDeg(n),s,r.znear||1,r.zfar||2e6)}else"orthographic"===t.type&&(a=new THREE.OrthographicCamera(r.xmag/-2,r.xmag/2,r.ymag/2,r.ymag/-2,r.znear,r.zfar));return void 0!==t.name&&(a.name=t.name),t.extras&&(a.userData=t.extras),Promise.resolve(a)},c.prototype.loadSkin=function(e){var a=this.json.skins[e],t={joints:a.joints};return void 0===a.inverseBindMatrices?Promise.resolve(t):this.getDependency("accessor",a.inverseBindMatrices).then(function(e){return t.inverseBindMatrices=e,t})},c.prototype.loadAnimation=function(e){var a=(this.json,this.json.animations[e]);return this.getMultiDependencies(["accessor","node"]).then(function(t){for(var r=[],s=0,n=a.channels.length;s<n;s++){var i=a.channels[s],o=a.samplers[i.sampler];if(o){var l=i.target,u=void 0!==l.node?l.node:l.id,p=void 0!==a.parameters?a.parameters[o.input]:o.input,c=void 0!==a.parameters?a.parameters[o.output]:o.output,d=t.accessors[p],E=t.accessors[c],m=t.nodes[u];if(m){m.updateMatrix(),m.matrixAutoUpdate=!0;var f;switch(H[l.path]){case H.weights:f=THREE.NumberKeyframeTrack;break;case H.rotation:f=THREE.QuaternionKeyframeTrack;break;case H.position:case H.scale:default:f=THREE.VectorKeyframeTrack}var h=m.name?m.name:m.uuid;if("CUBICSPLINE"===o.interpolation){for(var v=E.itemSize,T=E.array.constructor,R=new T(E.count*v/3),g=0,M=E.count;g<M;g+=3)R[g*v/3]=E.getX(g+1),v>1&&(R[g*v/3+1]=E.getY(g+1)),v>2&&(R[g*v/3+2]=E.getZ(g+1)),v>3&&(R[g*v/3+3]=E.getW(g+1));E=new THREE.BufferAttribute(R,v/3,E.normalized)}var S=void 0!==o.interpolation?L[o.interpolation]:THREE.InterpolateLinear,y=[];H[l.path]===H.weights?m.traverse(function(e){e.isMesh===!0&&e.material.morphTargets===!0&&y.push(e.name?e.name:e.uuid)}):y.push(h);for(var g=0,M=y.length;g<M;g++)r.push(new f(y[g]+"."+H[l.path],THREE.AnimationUtils.arraySlice(d.array,0),THREE.AnimationUtils.arraySlice(E.array,0),S))}}}var u=void 0!==a.name?a.name:"animation_"+e;return new THREE.AnimationClip(u,void 0,r)})},c.prototype.loadNode=function(e){var a=(this.json,this.extensions),t=this.json.meshReferences,r=this.json.meshUses,s=this.json.nodes[e];return this.getMultiDependencies(["mesh","skin","camera"]).then(function(e){var n;if(s.isBone===!0)n=new THREE.Bone;else if(void 0!==s.mesh){var i=e.meshes[s.mesh];if(n=i.clone(),i.isGroup===!0)for(var o=0,l=i.children.length;o<l;o++){var u=i.children[o];u.material&&u.material.isGLTFSpecularGlossinessMaterial===!0&&(n.children[o].onBeforeRender=u.onBeforeRender)}else i.material&&i.material.isGLTFSpecularGlossinessMaterial===!0&&(n.onBeforeRender=i.onBeforeRender);t[s.mesh]>1&&(n.name+="_instance_"+r[s.mesh]++)}else if(void 0!==s.camera)n=e.cameras[s.camera];else if(s.extensions&&s.extensions[d.KHR_LIGHTS]&&void 0!==s.extensions[d.KHR_LIGHTS].light){var p=a[d.KHR_LIGHTS].lights;n=p[s.extensions[d.KHR_LIGHTS].light]}else n=new THREE.Object3D;if(void 0!==s.name&&(n.name=THREE.PropertyBinding.sanitizeNodeName(s.name)),s.extras&&(n.userData=s.extras),void 0!==s.matrix){var c=new THREE.Matrix4;c.fromArray(s.matrix),n.applyMatrix(c)}else void 0!==s.translation&&n.position.fromArray(s.translation),void 0!==s.rotation&&n.quaternion.fromArray(s.rotation),void 0!==s.scale&&n.scale.fromArray(s.scale);return n})},c.prototype.loadScene=function(){function e(a,t,r,s,n){var i=s[a],o=r.nodes[a];if(void 0!==o.skin)for(var l=i.isGroup===!0?i.children:[i],u=0,p=l.length;u<p;u++){for(var c=l[u],d=n[o.skin],E=[],m=[],f=0,h=d.joints.length;f<h;f++){var v=d.joints[f],T=s[v];if(T){E.push(T);var R=new THREE.Matrix4;void 0!==d.inverseBindMatrices&&R.fromArray(d.inverseBindMatrices.array,16*f),m.push(R)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',v)}c.bind(new THREE.Skeleton(E,m),c.matrixWorld)}if(t.add(i),o.children)for(var g=o.children,u=0,p=g.length;u<p;u++){var M=g[u];e(M,i,r,s,n)}}return function(a){var t=this.json,r=this.extensions,s=this.json.scenes[a];return this.getMultiDependencies(["node","skin"]).then(function(a){var n=new THREE.Scene;void 0!==s.name&&(n.name=s.name),s.extras&&(n.userData=s.extras);for(var i=s.nodes||[],o=0,l=i.length;o<l;o++)e(i[o],n,t,a.nodes,a.skins);if(s.extensions&&s.extensions[d.KHR_LIGHTS]&&void 0!==s.extensions[d.KHR_LIGHTS].light){var u=r[d.KHR_LIGHTS].lights;n.add(u[s.extensions[d.KHR_LIGHTS].light])}return n})}}(),e}();
  113. },{}],44:[function(_dereq_,module,exports){
  114. THREE.MTLLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager},THREE.MTLLoader.prototype={constructor:THREE.MTLLoader,load:function(t,a,e,r){var s=this,i=new THREE.FileLoader(this.manager);i.setPath(this.path),i.load(t,function(t){a(s.parse(t))},e,r)},setPath:function(t){this.path=t},setTexturePath:function(t){this.texturePath=t},setBaseUrl:function(t){console.warn("THREE.MTLLoader: .setBaseUrl() is deprecated. Use .setTexturePath( path ) for texture path or .setPath( path ) for general base path instead."),this.setTexturePath(t)},setCrossOrigin:function(t){this.crossOrigin=t},setMaterialOptions:function(t){this.materialOptions=t},parse:function(t){for(var a=t.split("\n"),e={},r=/\s+/,s={},i=0;i<a.length;i++){var o=a[i];if(o=o.trim(),0!==o.length&&"#"!==o.charAt(0)){var n=o.indexOf(" "),p=n>=0?o.substring(0,n):o;p=p.toLowerCase();var h=n>=0?o.substring(n+1):"";if(h=h.trim(),"newmtl"===p)e={name:h},s[h]=e;else if(e)if("ka"===p||"kd"===p||"ks"===p){var l=h.split(r,3);e[p]=[parseFloat(l[0]),parseFloat(l[1]),parseFloat(l[2])]}else e[p]=h}}var c=new THREE.MTLLoader.MaterialCreator(this.texturePath||this.path,this.materialOptions);return c.setCrossOrigin(this.crossOrigin),c.setManager(this.manager),c.setMaterials(s),c}},THREE.MTLLoader.MaterialCreator=function(t,a){this.baseUrl=t||"",this.options=a,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.side=this.options&&this.options.side?this.options.side:THREE.FrontSide,this.wrap=this.options&&this.options.wrap?this.options.wrap:THREE.RepeatWrapping},THREE.MTLLoader.MaterialCreator.prototype={constructor:THREE.MTLLoader.MaterialCreator,crossOrigin:"Anonymous",setCrossOrigin:function(t){this.crossOrigin=t},setManager:function(t){this.manager=t},setMaterials:function(t){this.materialsInfo=this.convert(t),this.materials={},this.materialsArray=[],this.nameLookup={}},convert:function(t){if(!this.options)return t;var a={};for(var e in t){var r=t[e],s={};a[e]=s;for(var i in r){var o=!0,n=r[i],p=i.toLowerCase();switch(p){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(n=[n[0]/255,n[1]/255,n[2]/255]),this.options&&this.options.ignoreZeroRGBs&&0===n[0]&&0===n[1]&&0===n[2]&&(o=!1)}o&&(s[p]=n)}}return a},preload:function(){for(var t in this.materialsInfo)this.create(t)},getIndex:function(t){return this.nameLookup[t]},getAsArray:function(){var t=0;for(var a in this.materialsInfo)this.materialsArray[t]=this.create(a),this.nameLookup[a]=t,t++;return this.materialsArray},create:function(t){return void 0===this.materials[t]&&this.createMaterial_(t),this.materials[t]},createMaterial_:function(t){function a(t,a){return"string"!=typeof a||""===a?"":/^https?:\/\//i.test(a)?a:t+a}function e(t,e){if(!i[t]){var s=r.getTextureParams(e,i),o=r.loadTexture(a(r.baseUrl,s.url));o.repeat.copy(s.scale),o.offset.copy(s.offset),o.wrapS=r.wrap,o.wrapT=r.wrap,i[t]=o}}var r=this,s=this.materialsInfo[t],i={name:t,side:this.side};for(var o in s){var n,p=s[o];if(""!==p)switch(o.toLowerCase()){case"kd":i.color=(new THREE.Color).fromArray(p);break;case"ks":i.specular=(new THREE.Color).fromArray(p);break;case"map_kd":e("map",p);break;case"map_ks":e("specularMap",p);break;case"norm":e("normalMap",p);break;case"map_bump":case"bump":e("bumpMap",p);break;case"ns":i.shininess=parseFloat(p);break;case"d":n=parseFloat(p),n<1&&(i.opacity=n,i.transparent=!0);break;case"tr":n=parseFloat(p),n>0&&(i.opacity=1-n,i.transparent=!0)}}return this.materials[t]=new THREE.MeshPhongMaterial(i),this.materials[t]},getTextureParams:function(t,a){var e,r={scale:new THREE.Vector2(1,1),offset:new THREE.Vector2(0,0)},s=t.split(/\s+/);return e=s.indexOf("-bm"),e>=0&&(a.bumpScale=parseFloat(s[e+1]),s.splice(e,2)),e=s.indexOf("-s"),e>=0&&(r.scale.set(parseFloat(s[e+1]),parseFloat(s[e+2])),s.splice(e,4)),e=s.indexOf("-o"),e>=0&&(r.offset.set(parseFloat(s[e+1]),parseFloat(s[e+2])),s.splice(e,4)),r.url=s.join(" ").trim(),r},loadTexture:function(t,a,e,r,s){var i,o=THREE.Loader.Handlers.get(t),n=void 0!==this.manager?this.manager:THREE.DefaultLoadingManager;return null===o&&(o=new THREE.TextureLoader(n)),o.setCrossOrigin&&o.setCrossOrigin(this.crossOrigin),i=o.load(t,e,r,s),void 0!==a&&(i.mapping=a),i}};
  115. },{}],45:[function(_dereq_,module,exports){
  116. THREE.OBJLoader=function(){function t(){var t={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materialLibraries:[],startObject:function(t,e){if(this.object&&this.object.fromDeclaration===!1)return this.object.name=t,void(this.object.fromDeclaration=e!==!1);var r=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object={name:t||"",fromDeclaration:e!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[]},materials:[],smooth:!0,startMaterial:function(t,e){var r=this._finalize(!1);r&&(r.inherited||r.groupCount<=0)&&this.materials.splice(r.index,1);var i={index:this.materials.length,name:t||"",mtllib:Array.isArray(e)&&e.length>0?e[e.length-1]:"",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(t){var e={index:"number"==typeof t?t:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return e.clone=this.clone.bind(e),e}};return this.materials.push(i),i},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(t){var e=this.currentMaterial();if(e&&e.groupEnd===-1&&(e.groupEnd=this.geometry.vertices.length/3,e.groupCount=e.groupEnd-e.groupStart,e.inherited=!1),t&&this.materials.length>1)for(var r=this.materials.length-1;r>=0;r--)this.materials[r].groupCount<=0&&this.materials.splice(r,1);return t&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),e}},r&&r.name&&"function"==typeof r.clone){var i=r.clone(0);i.inherited=!0,this.object.materials.push(i)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)},parseNormalIndex:function(t,e){var r=parseInt(t,10);return 3*(r>=0?r-1:r+e/3)},parseUVIndex:function(t,e){var r=parseInt(t,10);return 2*(r>=0?r-1:r+e/2)},addVertex:function(t,e,r){var i=this.vertices,s=this.object.geometry.vertices;s.push(i[t+0],i[t+1],i[t+2]),s.push(i[e+0],i[e+1],i[e+2]),s.push(i[r+0],i[r+1],i[r+2])},addVertexLine:function(t){var e=this.vertices,r=this.object.geometry.vertices;r.push(e[t+0],e[t+1],e[t+2])},addNormal:function(t,e,r){var i=this.normals,s=this.object.geometry.normals;s.push(i[t+0],i[t+1],i[t+2]),s.push(i[e+0],i[e+1],i[e+2]),s.push(i[r+0],i[r+1],i[r+2])},addColor:function(t,e,r){var i=this.colors,s=this.object.geometry.colors;s.push(i[t+0],i[t+1],i[t+2]),s.push(i[e+0],i[e+1],i[e+2]),s.push(i[r+0],i[r+1],i[r+2])},addUV:function(t,e,r){var i=this.uvs,s=this.object.geometry.uvs;s.push(i[t+0],i[t+1]),s.push(i[e+0],i[e+1]),s.push(i[r+0],i[r+1])},addUVLine:function(t){var e=this.uvs,r=this.object.geometry.uvs;r.push(e[t+0],e[t+1])},addFace:function(t,e,r,i,s,a,n,o,h){var l=this.vertices.length,u=this.parseVertexIndex(t,l),c=this.parseVertexIndex(e,l),m=this.parseVertexIndex(r,l);if(this.addVertex(u,c,m),void 0!==i){var p=this.uvs.length;u=this.parseUVIndex(i,p),c=this.parseUVIndex(s,p),m=this.parseUVIndex(a,p),this.addUV(u,c,m)}if(void 0!==n){var f=this.normals.length;u=this.parseNormalIndex(n,f),c=n===o?u:this.parseNormalIndex(o,f),m=n===h?u:this.parseNormalIndex(h,f),this.addNormal(u,c,m)}this.colors.length>0&&this.addColor(u,c,m)},addLineGeometry:function(t,e){this.object.geometry.type="Line";for(var r=this.vertices.length,i=this.uvs.length,s=0,a=t.length;s<a;s++)this.addVertexLine(this.parseVertexIndex(t[s],r));for(var n=0,a=e.length;n<a;n++)this.addUVLine(this.parseUVIndex(e[n],i))}};return t.startObject("",!1),t}function e(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager,this.materials=null}var r=/^[og]\s*(.+)?/,i=/^mtllib /,s=/^usemtl /;return e.prototype={constructor:e,load:function(t,e,r,i){var s=this,a=new THREE.FileLoader(s.manager);a.setPath(this.path),a.load(t,function(t){e(s.parse(t))},r,i)},setPath:function(t){this.path=t},setMaterials:function(t){return this.materials=t,this},parse:function(e){console.time("OBJLoader");var a=new t;e.indexOf("\r\n")!==-1&&(e=e.replace(/\r\n/g,"\n")),e.indexOf("\\\n")!==-1&&(e=e.replace(/\\\n/g,""));for(var n=e.split("\n"),o="",h="",l=0,u=[],c="function"==typeof"".trimLeft,m=0,p=n.length;m<p;m++)if(o=n[m],o=c?o.trimLeft():o.trim(),l=o.length,0!==l&&(h=o.charAt(0),"#"!==h))if("v"===h){var f=o.split(/\s+/);switch(f[0]){case"v":a.vertices.push(parseFloat(f[1]),parseFloat(f[2]),parseFloat(f[3])),8===f.length&&a.colors.push(parseFloat(f[4]),parseFloat(f[5]),parseFloat(f[6]));break;case"vn":a.normals.push(parseFloat(f[1]),parseFloat(f[2]),parseFloat(f[3]));break;case"vt":a.uvs.push(parseFloat(f[1]),parseFloat(f[2]))}}else if("f"===h){for(var d=o.substr(1).trim(),v=d.split(/\s+/),g=[],b=0,E=v.length;b<E;b++){var j=v[b];if(j.length>0){var x=j.split("/");g.push(x)}}for(var L=g[0],b=1,E=g.length-1;b<E;b++){var y=g[b],w=g[b+1];a.addFace(L[0],y[0],w[0],L[1],y[1],w[1],L[2],y[2],w[2])}}else if("l"===h){var V=o.substring(1).trim().split(" "),F=[],H=[];if(o.indexOf("/")===-1)F=V;else for(var R=0,T=V.length;R<T;R++){var I=V[R].split("/");""!==I[0]&&F.push(I[0]),""!==I[1]&&H.push(I[1])}a.addLineGeometry(F,H)}else if(null!==(u=r.exec(o))){var M=(" "+u[0].substr(1).trim()).substr(1);a.startObject(M)}else if(s.test(o))a.object.startMaterial(o.substring(7).trim(),a.materialLibraries);else if(i.test(o))a.materialLibraries.push(o.substring(7).trim());else{if("s"!==h){if("\0"===o)continue;throw new Error('THREE.OBJLoader: Unexpected line: "'+o+'"')}if(u=o.split(" "),u.length>1){var B=u[1].trim().toLowerCase();a.object.smooth="0"!==B&&"off"!==B}else a.object.smooth=!0;var A=a.object.currentMaterial();A&&(A.smooth=a.object.smooth)}a.finalize();var O=new THREE.Group;O.materialLibraries=[].concat(a.materialLibraries);for(var m=0,p=a.objects.length;m<p;m++){var U=a.objects[m],C=U.geometry,z=U.materials,N="Line"===C.type;if(0!==C.vertices.length){var S=new THREE.BufferGeometry;S.addAttribute("position",new THREE.Float32BufferAttribute(C.vertices,3)),C.normals.length>0?S.addAttribute("normal",new THREE.Float32BufferAttribute(C.normals,3)):S.computeVertexNormals(),C.colors.length>0&&S.addAttribute("color",new THREE.Float32BufferAttribute(C.colors,3)),C.uvs.length>0&&S.addAttribute("uv",new THREE.Float32BufferAttribute(C.uvs,2));for(var _=[],G=0,D=z.length;G<D;G++){var J=z[G],A=void 0;if(null!==this.materials&&(A=this.materials.create(J.name),N&&A&&!(A instanceof THREE.LineBasicMaterial))){var P=new THREE.LineBasicMaterial;P.copy(A),A=P}A||(A=N?new THREE.LineBasicMaterial:new THREE.MeshPhongMaterial,A.name=J.name),A.flatShading=!J.smooth,_.push(A)}var k;if(_.length>1){for(var G=0,D=z.length;G<D;G++){var J=z[G];S.addGroup(J.groupStart,J.groupCount,G)}k=N?new THREE.LineSegments(S,_):new THREE.Mesh(S,_)}else k=N?new THREE.LineSegments(S,_[0]):new THREE.Mesh(S,_[0]);k.name=U.name,O.add(k)}}return console.timeEnd("OBJLoader"),O}},e}();
  117. },{}],46:[function(_dereq_,module,exports){
  118. function trim(r){return r.replace(/^\s*|\s*$/g,"")}exports=module.exports=trim,exports.left=function(r){return r.replace(/^\s*/,"")},exports.right=function(r){return r.replace(/\s*$/,"")};
  119. },{}],47:[function(_dereq_,module,exports){
  120. module.exports={"_args":[[{"raw":"webvr-polyfill@^0.9.40","scope":null,"escapedName":"webvr-polyfill","name":"webvr-polyfill","rawSpec":"^0.9.40","spec":">=0.9.40 <0.10.0","type":"range"},"/home/ubuntu/a-frobot/aframe"]],"_from":"webvr-polyfill@>=0.9.40 <0.10.0","_id":"webvr-polyfill@0.9.40","_inCache":true,"_location":"/webvr-polyfill","_nodeVersion":"8.6.0","_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webvr-polyfill-0.9.40.tgz_1507657755590_0.00047161197289824486"},"_npmUser":{"name":"jsantell","email":"jsantell@gmail.com"},"_npmVersion":"5.3.0","_phantomChildren":{},"_requested":{"raw":"webvr-polyfill@^0.9.40","scope":null,"escapedName":"webvr-polyfill","name":"webvr-polyfill","rawSpec":"^0.9.40","spec":">=0.9.40 <0.10.0","type":"range"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/webvr-polyfill/-/webvr-polyfill-0.9.40.tgz","_shasum":"2cfa0ec0e0cc6ba7238c73a09cba4952fff59a63","_shrinkwrap":null,"_spec":"webvr-polyfill@^0.9.40","_where":"/home/ubuntu/a-frobot/aframe","authors":["Boris Smus <boris@smus.com>","Brandon Jones <tojiro@gmail.com>","Jordan Santell <jordan@jsantell.com>"],"bugs":{"url":"https://github.com/googlevr/webvr-polyfill/issues"},"dependencies":{},"description":"Use WebVR today, on mobile or desktop, without requiring a special browser build.","devDependencies":{"chai":"^3.5.0","jsdom":"^9.12.0","mocha":"^3.2.0","semver":"^5.3.0","webpack":"^2.6.1","webpack-dev-server":"2.7.1"},"directories":{},"dist":{"integrity":"sha512-m7jhJHjFcUYPyPSNeGmly7a2h/cP7bARz0OZMoUn5SueVXEKeZ4P7bzbAUDBDvvqCsa5gHgM3PFIhYe13bqaWw==","shasum":"2cfa0ec0e0cc6ba7238c73a09cba4952fff59a63","tarball":"https://registry.npmjs.org/webvr-polyfill/-/webvr-polyfill-0.9.40.tgz"},"gitHead":"45828ffdb8c3e0f9bb90296d6039d3cc7909ba8e","homepage":"https://github.com/googlevr/webvr-polyfill","keywords":["vr","webvr"],"license":"Apache-2.0","main":"src/node-entry","maintainers":[{"name":"jsantell","email":"jsantell@gmail.com"},{"name":"toji","email":"tojiro@gmail.com"},{"name":"smus","email":"boris@smus.com"}],"name":"webvr-polyfill","optionalDependencies":{},"readme":"ERROR: No README data found!","repository":{"type":"git","url":"git+https://github.com/googlevr/webvr-polyfill.git"},"scripts":{"build":"webpack","start":"npm run watch","test":"mocha","watch":"webpack-dev-server"},"version":"0.9.40"}
  121. },{}],48:[function(_dereq_,module,exports){
  122. function VRFrameData(){this.leftProjectionMatrix=new Float32Array(16),this.leftViewMatrix=new Float32Array(16),this.rightProjectionMatrix=new Float32Array(16),this.rightViewMatrix=new Float32Array(16),this.pose=null}function VRDisplay(){this.isPolyfilled=!0,this.displayId=nextDisplayId++,this.displayName="webvr-polyfill displayName",this.depthNear=.01,this.depthFar=1e4,this.isConnected=!0,this.isPresenting=!1,this.capabilities={hasPosition:!1,hasOrientation:!1,hasExternalDisplay:!1,canPresent:!1,maxLayers:1},this.stageParameters=null,this.waitingForPresent_=!1,this.layer_=null,this.fullscreenElement_=null,this.fullscreenWrapper_=null,this.fullscreenElementCachedStyle_=null,this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null,this.wakelock_=new WakeLock}function VRDevice(){this.isPolyfilled=!0,this.hardwareUnitId="webvr-polyfill hardwareUnitId",this.deviceId="webvr-polyfill deviceId",this.deviceName="webvr-polyfill deviceName"}function HMDVRDevice(){}function PositionSensorVRDevice(){}var Util=_dereq_("./util.js"),WakeLock=_dereq_("./wakelock.js"),nextDisplayId=1e3,hasShowDeprecationWarning=!1,defaultLeftBounds=[0,0,.5,1],defaultRightBounds=[.5,0,.5,1];VRDisplay.prototype.getFrameData=function(e){return Util.frameDataFromPose(e,this.getPose(),this)},VRDisplay.prototype.getPose=function(){return this.getImmediatePose()},VRDisplay.prototype.requestAnimationFrame=function(e){return window.requestAnimationFrame(e)},VRDisplay.prototype.cancelAnimationFrame=function(e){return window.cancelAnimationFrame(e)},VRDisplay.prototype.wrapForFullscreen=function(e){function r(){if(i.fullscreenElement_){var e=["position: absolute","top: 0","left: 0","width: "+Math.max(screen.width,screen.height)+"px","height: "+Math.min(screen.height,screen.width)+"px","border: 0","margin: 0","padding: 0"];i.fullscreenElement_.setAttribute("style",e.join("; ")+";")}}if(Util.isIOS())return e;if(!this.fullscreenWrapper_){this.fullscreenWrapper_=document.createElement("div");var t=["height: "+Math.min(screen.height,screen.width)+"px !important","top: 0 !important","left: 0 !important","right: 0 !important","border: 0","margin: 0","padding: 0","z-index: 999999 !important","position: fixed"];this.fullscreenWrapper_.setAttribute("style",t.join("; ")+";"),this.fullscreenWrapper_.classList.add("webvr-polyfill-fullscreen-wrapper")}if(this.fullscreenElement_==e)return this.fullscreenWrapper_;this.removeFullscreenWrapper(),this.fullscreenElement_=e;var n=this.fullscreenElement_.parentElement;n.insertBefore(this.fullscreenWrapper_,this.fullscreenElement_),n.removeChild(this.fullscreenElement_),this.fullscreenWrapper_.insertBefore(this.fullscreenElement_,this.fullscreenWrapper_.firstChild),this.fullscreenElementCachedStyle_=this.fullscreenElement_.getAttribute("style");var i=this;return r(),this.fullscreenWrapper_},VRDisplay.prototype.removeFullscreenWrapper=function(){if(this.fullscreenElement_){var e=this.fullscreenElement_;this.fullscreenElementCachedStyle_?e.setAttribute("style",this.fullscreenElementCachedStyle_):e.removeAttribute("style"),this.fullscreenElement_=null,this.fullscreenElementCachedStyle_=null;var r=this.fullscreenWrapper_.parentElement;return this.fullscreenWrapper_.removeChild(e),r.insertBefore(e,this.fullscreenWrapper_),r.removeChild(this.fullscreenWrapper_),e}},VRDisplay.prototype.requestPresent=function(e){var r=this.isPresenting,t=this;return e instanceof Array||(hasShowDeprecationWarning||(console.warn("Using a deprecated form of requestPresent. Should pass in an array of VRLayers."),hasShowDeprecationWarning=!0),e=[e]),new Promise(function(n,i){if(!t.capabilities.canPresent)return void i(new Error("VRDisplay is not capable of presenting."));if(0==e.length||e.length>t.capabilities.maxLayers)return void i(new Error("Invalid number of layers."));var s=e[0];if(!s.source)return void n();var l=s.leftBounds||defaultLeftBounds,a=s.rightBounds||defaultRightBounds;if(r){var o=t.layer_;o.source!==s.source&&(o.source=s.source);for(var c=0;c<4;c++)o.leftBounds[c]=l[c],o.rightBounds[c]=a[c];return void n()}if(t.layer_={predistorted:s.predistorted,source:s.source,leftBounds:l.slice(0),rightBounds:a.slice(0)},t.waitingForPresent_=!1,t.layer_&&t.layer_.source){var u=t.wrapForFullscreen(t.layer_.source),p=function(){var e=Util.getFullscreenElement();t.isPresenting=u===e,t.isPresenting?(screen.orientation&&screen.orientation.lock&&screen.orientation.lock("landscape-primary").catch(function(e){console.error("screen.orientation.lock() failed due to",e.message)}),t.waitingForPresent_=!1,t.beginPresent_(),n()):(screen.orientation&&screen.orientation.unlock&&screen.orientation.unlock(),t.removeFullscreenWrapper(),t.wakelock_.release(),t.endPresent_(),t.removeFullscreenListeners_()),t.fireVRDisplayPresentChange_()},h=function(){t.waitingForPresent_&&(t.removeFullscreenWrapper(),t.removeFullscreenListeners_(),t.wakelock_.release(),t.waitingForPresent_=!1,t.isPresenting=!1,i(new Error("Unable to present.")))};t.addFullscreenListeners_(u,p,h),Util.requestFullscreen(u)?(t.wakelock_.request(),t.waitingForPresent_=!0):(Util.isIOS()||Util.isWebViewAndroid())&&(t.wakelock_.request(),t.isPresenting=!0,t.beginPresent_(),t.fireVRDisplayPresentChange_(),n())}t.waitingForPresent_||Util.isIOS()||(Util.exitFullscreen(),i(new Error("Unable to present.")))})},VRDisplay.prototype.exitPresent=function(){var e=this.isPresenting,r=this;return this.isPresenting=!1,this.layer_=null,this.wakelock_.release(),new Promise(function(t,n){e?(!Util.exitFullscreen()&&Util.isIOS()&&(r.endPresent_(),r.fireVRDisplayPresentChange_()),Util.isWebViewAndroid()&&(r.removeFullscreenWrapper(),r.removeFullscreenListeners_(),r.endPresent_(),r.fireVRDisplayPresentChange_()),t()):n(new Error("Was not presenting to VRDisplay."))})},VRDisplay.prototype.getLayers=function(){return this.layer_?[this.layer_]:[]},VRDisplay.prototype.fireVRDisplayPresentChange_=function(){var e=new CustomEvent("vrdisplaypresentchange",{detail:{display:this}});window.dispatchEvent(e)},VRDisplay.prototype.fireVRDisplayConnect_=function(){var e=new CustomEvent("vrdisplayconnect",{detail:{display:this}});window.dispatchEvent(e)},VRDisplay.prototype.addFullscreenListeners_=function(e,r,t){this.removeFullscreenListeners_(),this.fullscreenEventTarget_=e,this.fullscreenChangeHandler_=r,this.fullscreenErrorHandler_=t,r&&(document.fullscreenEnabled?e.addEventListener("fullscreenchange",r,!1):document.webkitFullscreenEnabled?e.addEventListener("webkitfullscreenchange",r,!1):document.mozFullScreenEnabled?document.addEventListener("mozfullscreenchange",r,!1):document.msFullscreenEnabled&&e.addEventListener("msfullscreenchange",r,!1)),t&&(document.fullscreenEnabled?e.addEventListener("fullscreenerror",t,!1):document.webkitFullscreenEnabled?e.addEventListener("webkitfullscreenerror",t,!1):document.mozFullScreenEnabled?document.addEventListener("mozfullscreenerror",t,!1):document.msFullscreenEnabled&&e.addEventListener("msfullscreenerror",t,!1))},VRDisplay.prototype.removeFullscreenListeners_=function(){if(this.fullscreenEventTarget_){var e=this.fullscreenEventTarget_;if(this.fullscreenChangeHandler_){var r=this.fullscreenChangeHandler_;e.removeEventListener("fullscreenchange",r,!1),e.removeEventListener("webkitfullscreenchange",r,!1),document.removeEventListener("mozfullscreenchange",r,!1),e.removeEventListener("msfullscreenchange",r,!1)}if(this.fullscreenErrorHandler_){var t=this.fullscreenErrorHandler_;e.removeEventListener("fullscreenerror",t,!1),e.removeEventListener("webkitfullscreenerror",t,!1),document.removeEventListener("mozfullscreenerror",t,!1),e.removeEventListener("msfullscreenerror",t,!1)}this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null}},VRDisplay.prototype.beginPresent_=function(){},VRDisplay.prototype.endPresent_=function(){},VRDisplay.prototype.submitFrame=function(e){},VRDisplay.prototype.getEyeParameters=function(e){return null},HMDVRDevice.prototype=new VRDevice,PositionSensorVRDevice.prototype=new VRDevice,module.exports.VRFrameData=VRFrameData,module.exports.VRDisplay=VRDisplay,module.exports.VRDevice=VRDevice,module.exports.HMDVRDevice=HMDVRDevice,module.exports.PositionSensorVRDevice=PositionSensorVRDevice;
  123. },{"./util.js":68,"./wakelock.js":70}],49:[function(_dereq_,module,exports){
  124. function CardboardDistorter(e){this.gl=e,this.ctxAttribs=e.getContextAttributes(),this.meshWidth=20,this.meshHeight=20,this.bufferScale=window.WebVRConfig.BUFFER_SCALE,this.bufferWidth=e.drawingBufferWidth,this.bufferHeight=e.drawingBufferHeight,this.realBindFramebuffer=e.bindFramebuffer,this.realEnable=e.enable,this.realDisable=e.disable,this.realColorMask=e.colorMask,this.realClearColor=e.clearColor,this.realViewport=e.viewport,Util.isIOS()||(this.realCanvasWidth=Object.getOwnPropertyDescriptor(e.canvas.__proto__,"width"),this.realCanvasHeight=Object.getOwnPropertyDescriptor(e.canvas.__proto__,"height")),this.isPatched=!1,this.lastBoundFramebuffer=null,this.cullFace=!1,this.depthTest=!1,this.blend=!1,this.scissorTest=!1,this.stencilTest=!1,this.viewport=[0,0,0,0],this.colorMask=[!0,!0,!0,!0],this.clearColor=[0,0,0,0],this.attribs={position:0,texCoord:1},this.program=Util.linkProgram(e,distortionVS,distortionFS,this.attribs),this.uniforms=Util.getProgramUniforms(e,this.program),this.viewportOffsetScale=new Float32Array(8),this.setTextureBounds(),this.vertexBuffer=e.createBuffer(),this.indexBuffer=e.createBuffer(),this.indexCount=0,this.renderTarget=e.createTexture(),this.framebuffer=e.createFramebuffer(),this.depthStencilBuffer=null,this.depthBuffer=null,this.stencilBuffer=null,this.ctxAttribs.depth&&this.ctxAttribs.stencil?this.depthStencilBuffer=e.createRenderbuffer():this.ctxAttribs.depth?this.depthBuffer=e.createRenderbuffer():this.ctxAttribs.stencil&&(this.stencilBuffer=e.createRenderbuffer()),this.patch(),this.onResize(),window.WebVRConfig.CARDBOARD_UI_DISABLED||(this.cardboardUI=new CardboardUI(e))}var CardboardUI=_dereq_("./cardboard-ui.js"),Util=_dereq_("./util.js"),WGLUPreserveGLState=_dereq_("./deps/wglu-preserve-state.js"),distortionVS=["attribute vec2 position;","attribute vec3 texCoord;","varying vec2 vTexCoord;","uniform vec4 viewportOffsetScale[2];","void main() {"," vec4 viewport = viewportOffsetScale[int(texCoord.z)];"," vTexCoord = (texCoord.xy * viewport.zw) + viewport.xy;"," gl_Position = vec4( position, 1.0, 1.0 );","}"].join("\n"),distortionFS=["precision mediump float;","uniform sampler2D diffuse;","varying vec2 vTexCoord;","void main() {"," gl_FragColor = texture2D(diffuse, vTexCoord);","}"].join("\n");CardboardDistorter.prototype.destroy=function(){var e=this.gl;this.unpatch(),e.deleteProgram(this.program),e.deleteBuffer(this.vertexBuffer),e.deleteBuffer(this.indexBuffer),e.deleteTexture(this.renderTarget),e.deleteFramebuffer(this.framebuffer),this.depthStencilBuffer&&e.deleteRenderbuffer(this.depthStencilBuffer),this.depthBuffer&&e.deleteRenderbuffer(this.depthBuffer),this.stencilBuffer&&e.deleteRenderbuffer(this.stencilBuffer),this.cardboardUI&&this.cardboardUI.destroy()},CardboardDistorter.prototype.onResize=function(){var e=this.gl,r=this,t=[e.RENDERBUFFER_BINDING,e.TEXTURE_BINDING_2D,e.TEXTURE0];WGLUPreserveGLState(e,t,function(e){r.realBindFramebuffer.call(e,e.FRAMEBUFFER,null),r.scissorTest&&r.realDisable.call(e,e.SCISSOR_TEST),r.realColorMask.call(e,!0,!0,!0,!0),r.realViewport.call(e,0,0,e.drawingBufferWidth,e.drawingBufferHeight),r.realClearColor.call(e,0,0,0,1),e.clear(e.COLOR_BUFFER_BIT),r.realBindFramebuffer.call(e,e.FRAMEBUFFER,r.framebuffer),e.bindTexture(e.TEXTURE_2D,r.renderTarget),e.texImage2D(e.TEXTURE_2D,0,r.ctxAttribs.alpha?e.RGBA:e.RGB,r.bufferWidth,r.bufferHeight,0,r.ctxAttribs.alpha?e.RGBA:e.RGB,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r.renderTarget,0),r.ctxAttribs.depth&&r.ctxAttribs.stencil?(e.bindRenderbuffer(e.RENDERBUFFER,r.depthStencilBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,r.bufferWidth,r.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,r.depthStencilBuffer)):r.ctxAttribs.depth?(e.bindRenderbuffer(e.RENDERBUFFER,r.depthBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,r.bufferWidth,r.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,r.depthBuffer)):r.ctxAttribs.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,r.stencilBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.STENCIL_INDEX8,r.bufferWidth,r.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,r.stencilBuffer)),!e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer incomplete!"),r.realBindFramebuffer.call(e,e.FRAMEBUFFER,r.lastBoundFramebuffer),r.scissorTest&&r.realEnable.call(e,e.SCISSOR_TEST),r.realColorMask.apply(e,r.colorMask),r.realViewport.apply(e,r.viewport),r.realClearColor.apply(e,r.clearColor)}),this.cardboardUI&&this.cardboardUI.onResize()},CardboardDistorter.prototype.patch=function(){if(!this.isPatched){var e=this,r=this.gl.canvas,t=this.gl;Util.isIOS()||(r.width=Util.getScreenWidth()*this.bufferScale,r.height=Util.getScreenHeight()*this.bufferScale,Object.defineProperty(r,"width",{configurable:!0,enumerable:!0,get:function(){return e.bufferWidth},set:function(t){e.bufferWidth=t,e.realCanvasWidth.set.call(r,t),e.onResize()}}),Object.defineProperty(r,"height",{configurable:!0,enumerable:!0,get:function(){return e.bufferHeight},set:function(t){e.bufferHeight=t,e.realCanvasHeight.set.call(r,t),e.onResize()}})),this.lastBoundFramebuffer=t.getParameter(t.FRAMEBUFFER_BINDING),null==this.lastBoundFramebuffer&&(this.lastBoundFramebuffer=this.framebuffer,this.gl.bindFramebuffer(t.FRAMEBUFFER,this.framebuffer)),this.gl.bindFramebuffer=function(r,i){e.lastBoundFramebuffer=i?i:e.framebuffer,e.realBindFramebuffer.call(t,r,e.lastBoundFramebuffer)},this.cullFace=t.getParameter(t.CULL_FACE),this.depthTest=t.getParameter(t.DEPTH_TEST),this.blend=t.getParameter(t.BLEND),this.scissorTest=t.getParameter(t.SCISSOR_TEST),this.stencilTest=t.getParameter(t.STENCIL_TEST),t.enable=function(r){switch(r){case t.CULL_FACE:e.cullFace=!0;break;case t.DEPTH_TEST:e.depthTest=!0;break;case t.BLEND:e.blend=!0;break;case t.SCISSOR_TEST:e.scissorTest=!0;break;case t.STENCIL_TEST:e.stencilTest=!0}e.realEnable.call(t,r)},t.disable=function(r){switch(r){case t.CULL_FACE:e.cullFace=!1;break;case t.DEPTH_TEST:e.depthTest=!1;break;case t.BLEND:e.blend=!1;break;case t.SCISSOR_TEST:e.scissorTest=!1;break;case t.STENCIL_TEST:e.stencilTest=!1}e.realDisable.call(t,r)},this.colorMask=t.getParameter(t.COLOR_WRITEMASK),t.colorMask=function(r,i,a,s){e.colorMask[0]=r,e.colorMask[1]=i,e.colorMask[2]=a,e.colorMask[3]=s,e.realColorMask.call(t,r,i,a,s)},this.clearColor=t.getParameter(t.COLOR_CLEAR_VALUE),t.clearColor=function(r,i,a,s){e.clearColor[0]=r,e.clearColor[1]=i,e.clearColor[2]=a,e.clearColor[3]=s,e.realClearColor.call(t,r,i,a,s)},this.viewport=t.getParameter(t.VIEWPORT),t.viewport=function(r,i,a,s){e.viewport[0]=r,e.viewport[1]=i,e.viewport[2]=a,e.viewport[3]=s,e.realViewport.call(t,r,i,a,s)},this.isPatched=!0,Util.safariCssSizeWorkaround(r)}},CardboardDistorter.prototype.unpatch=function(){if(this.isPatched){var e=this.gl,r=this.gl.canvas;Util.isIOS()||(Object.defineProperty(r,"width",this.realCanvasWidth),Object.defineProperty(r,"height",this.realCanvasHeight)),r.width=this.bufferWidth,r.height=this.bufferHeight,e.bindFramebuffer=this.realBindFramebuffer,e.enable=this.realEnable,e.disable=this.realDisable,e.colorMask=this.realColorMask,e.clearColor=this.realClearColor,e.viewport=this.realViewport,this.lastBoundFramebuffer==this.framebuffer&&e.bindFramebuffer(e.FRAMEBUFFER,null),this.isPatched=!1,setTimeout(function(){Util.safariCssSizeWorkaround(r)},1)}},CardboardDistorter.prototype.setTextureBounds=function(e,r){e||(e=[0,0,.5,1]),r||(r=[.5,0,.5,1]),this.viewportOffsetScale[0]=e[0],this.viewportOffsetScale[1]=e[1],this.viewportOffsetScale[2]=e[2],this.viewportOffsetScale[3]=e[3],this.viewportOffsetScale[4]=r[0],this.viewportOffsetScale[5]=r[1],this.viewportOffsetScale[6]=r[2],this.viewportOffsetScale[7]=r[3]},CardboardDistorter.prototype.submitFrame=function(){var e=this.gl,r=this,t=[];if(window.WebVRConfig.DIRTY_SUBMIT_FRAME_BINDINGS||t.push(e.CURRENT_PROGRAM,e.ARRAY_BUFFER_BINDING,e.ELEMENT_ARRAY_BUFFER_BINDING,e.TEXTURE_BINDING_2D,e.TEXTURE0),WGLUPreserveGLState(e,t,function(e){r.realBindFramebuffer.call(e,e.FRAMEBUFFER,null),r.cullFace&&r.realDisable.call(e,e.CULL_FACE),r.depthTest&&r.realDisable.call(e,e.DEPTH_TEST),r.blend&&r.realDisable.call(e,e.BLEND),r.scissorTest&&r.realDisable.call(e,e.SCISSOR_TEST),r.stencilTest&&r.realDisable.call(e,e.STENCIL_TEST),r.realColorMask.call(e,!0,!0,!0,!0),r.realViewport.call(e,0,0,e.drawingBufferWidth,e.drawingBufferHeight),(r.ctxAttribs.alpha||Util.isIOS())&&(r.realClearColor.call(e,0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)),e.useProgram(r.program),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,r.indexBuffer),e.bindBuffer(e.ARRAY_BUFFER,r.vertexBuffer),e.enableVertexAttribArray(r.attribs.position),e.enableVertexAttribArray(r.attribs.texCoord),e.vertexAttribPointer(r.attribs.position,2,e.FLOAT,!1,20,0),e.vertexAttribPointer(r.attribs.texCoord,3,e.FLOAT,!1,20,8),e.activeTexture(e.TEXTURE0),e.uniform1i(r.uniforms.diffuse,0),e.bindTexture(e.TEXTURE_2D,r.renderTarget),e.uniform4fv(r.uniforms.viewportOffsetScale,r.viewportOffsetScale),e.drawElements(e.TRIANGLES,r.indexCount,e.UNSIGNED_SHORT,0),r.cardboardUI&&r.cardboardUI.renderNoState(),r.realBindFramebuffer.call(r.gl,e.FRAMEBUFFER,r.framebuffer),r.ctxAttribs.preserveDrawingBuffer||(r.realClearColor.call(e,0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)),window.WebVRConfig.DIRTY_SUBMIT_FRAME_BINDINGS||r.realBindFramebuffer.call(e,e.FRAMEBUFFER,r.lastBoundFramebuffer),r.cullFace&&r.realEnable.call(e,e.CULL_FACE),r.depthTest&&r.realEnable.call(e,e.DEPTH_TEST),r.blend&&r.realEnable.call(e,e.BLEND),r.scissorTest&&r.realEnable.call(e,e.SCISSOR_TEST),r.stencilTest&&r.realEnable.call(e,e.STENCIL_TEST),r.realColorMask.apply(e,r.colorMask),r.realViewport.apply(e,r.viewport),!r.ctxAttribs.alpha&&r.ctxAttribs.preserveDrawingBuffer||r.realClearColor.apply(e,r.clearColor)}),Util.isIOS()){var i=e.canvas;i.width==r.bufferWidth&&i.height==r.bufferHeight||(r.bufferWidth=i.width,r.bufferHeight=i.height,r.onResize())}},CardboardDistorter.prototype.updateDeviceInfo=function(e){var r=this.gl,t=this,i=[r.ARRAY_BUFFER_BINDING,r.ELEMENT_ARRAY_BUFFER_BINDING];WGLUPreserveGLState(r,i,function(r){var i=t.computeMeshVertices_(t.meshWidth,t.meshHeight,e);if(r.bindBuffer(r.ARRAY_BUFFER,t.vertexBuffer),r.bufferData(r.ARRAY_BUFFER,i,r.STATIC_DRAW),!t.indexCount){var a=t.computeMeshIndices_(t.meshWidth,t.meshHeight);r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t.indexBuffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,a,r.STATIC_DRAW),t.indexCount=a.length}})},CardboardDistorter.prototype.computeMeshVertices_=function(e,r,t){for(var i=new Float32Array(2*e*r*5),a=t.getLeftEyeVisibleTanAngles(),s=t.getLeftEyeNoLensTanAngles(),l=t.getLeftEyeVisibleScreenRect(s),f=0,o=0;o<2;o++){for(var n=0;n<r;n++)for(var c=0;c<e;c++,f++){var h=c/(e-1),u=n/(r-1),d=h,E=u,b=Util.lerp(a[0],a[2],h),R=Util.lerp(a[3],a[1],u),T=Math.sqrt(b*b+R*R),F=t.distortion.distortInverse(T),p=b*F/T,B=R*F/T;h=(p-s[0])/(s[2]-s[0]),u=(B-s[3])/(s[1]-s[3]);t.device.widthMeters/t.device.heightMeters;h=2*(l.x+h*l.width-.5),u=2*(l.y+u*l.height-.5),i[5*f+0]=h,i[5*f+1]=u,i[5*f+2]=d,i[5*f+3]=E,i[5*f+4]=o}var C=a[2]-a[0];a[0]=-(C+a[0]),a[2]=C-a[2],C=s[2]-s[0],s[0]=-(C+s[0]),s[2]=C-s[2],l.x=1-(l.x+l.width)}return i},CardboardDistorter.prototype.computeMeshIndices_=function(e,r){for(var t=new Uint16Array(2*(e-1)*(r-1)*6),i=e/2,a=r/2,s=0,l=0,f=0;f<2;f++)for(var o=0;o<r;o++)for(var n=0;n<e;n++,s++)0!=n&&0!=o&&(n<=i==o<=a?(t[l++]=s,t[l++]=s-e-1,t[l++]=s-e,t[l++]=s-e-1,t[l++]=s,t[l++]=s-1):(t[l++]=s-1,t[l++]=s-e,t[l++]=s,t[l++]=s-e,t[l++]=s-1,t[l++]=s-e-1));return t},CardboardDistorter.prototype.getOwnPropertyDescriptor_=function(e,r){var t=Object.getOwnPropertyDescriptor(e,r);return void 0!==t.get&&void 0!==t.set||(t.configurable=!0,t.enumerable=!0,t.get=function(){return this.getAttribute(r)},t.set=function(e){this.setAttribute(r,e)}),t},module.exports=CardboardDistorter;
  125. },{"./cardboard-ui.js":50,"./deps/wglu-preserve-state.js":52,"./util.js":68}],50:[function(_dereq_,module,exports){
  126. function CardboardUI(e){this.gl=e,this.attribs={position:0},this.program=Util.linkProgram(e,uiVS,uiFS,this.attribs),this.uniforms=Util.getProgramUniforms(e,this.program),this.vertexBuffer=e.createBuffer(),this.gearOffset=0,this.gearVertexCount=0,this.arrowOffset=0,this.arrowVertexCount=0,this.projMat=new Float32Array(16),this.listener=null,this.onResize()}var Util=_dereq_("./util.js"),WGLUPreserveGLState=_dereq_("./deps/wglu-preserve-state.js"),uiVS=["attribute vec2 position;","uniform mat4 projectionMat;","void main() {"," gl_Position = projectionMat * vec4( position, -1.0, 1.0 );","}"].join("\n"),uiFS=["precision mediump float;","uniform vec4 color;","void main() {"," gl_FragColor = color;","}"].join("\n"),DEG2RAD=Math.PI/180,kAnglePerGearSection=60,kOuterRimEndAngle=12,kInnerRimBeginAngle=20,kOuterRadius=1,kMiddleRadius=.75,kInnerRadius=.3125,kCenterLineThicknessDp=4,kButtonWidthDp=28,kTouchSlopFactor=1.5,Angles=[0,kOuterRimEndAngle,kInnerRimBeginAngle,kAnglePerGearSection-kInnerRimBeginAngle,kAnglePerGearSection-kOuterRimEndAngle];CardboardUI.prototype.destroy=function(){var e=this.gl;this.listener&&e.canvas.removeEventListener("click",this.listener,!1),e.deleteProgram(this.program),e.deleteBuffer(this.vertexBuffer)},CardboardUI.prototype.listen=function(e,t){var r=this.gl.canvas;this.listener=function(i){var n=r.clientWidth/2,o=kButtonWidthDp*kTouchSlopFactor;i.clientX>n-o&&i.clientX<n+o&&i.clientY>r.clientHeight-o?e(i):i.clientX<o&&i.clientY<o&&t(i)},r.addEventListener("click",this.listener,!1)},CardboardUI.prototype.onResize=function(){var e=this.gl,t=this,r=[e.ARRAY_BUFFER_BINDING];WGLUPreserveGLState(e,r,function(e){function r(e,t){var r=(90-e)*DEG2RAD,i=Math.cos(r),a=Math.sin(r);n.push(kInnerRadius*i*l+o,kInnerRadius*a*l+l),n.push(t*i*l+o,t*a*l+l)}function i(t,r){n.push(f+t,e.drawingBufferHeight-f-r)}var n=[],o=e.drawingBufferWidth/2,a=Math.max(screen.width,screen.height)*window.devicePixelRatio,s=e.drawingBufferWidth/a,u=s*window.devicePixelRatio,d=kCenterLineThicknessDp*u/2,h=kButtonWidthDp*kTouchSlopFactor*u,l=kButtonWidthDp*u/2,f=(kButtonWidthDp*kTouchSlopFactor-kButtonWidthDp)*u;n.push(o-d,h),n.push(o-d,e.drawingBufferHeight),n.push(o+d,h),n.push(o+d,e.drawingBufferHeight),t.gearOffset=n.length/2;for(var g=0;g<=6;g++){var R=g*kAnglePerGearSection;r(R,kOuterRadius),r(R+kOuterRimEndAngle,kOuterRadius),r(R+kInnerRimBeginAngle,kMiddleRadius),r(R+(kAnglePerGearSection-kInnerRimBeginAngle),kMiddleRadius),r(R+(kAnglePerGearSection-kOuterRimEndAngle),kOuterRadius)}t.gearVertexCount=n.length/2-t.gearOffset,t.arrowOffset=n.length/2;var c=d/Math.sin(45*DEG2RAD);i(0,l),i(l,0),i(l+c,c),i(c,l+c),i(c,l-c),i(0,l),i(l,2*l),i(l+c,2*l-c),i(c,l-c),i(0,l),i(c,l-d),i(kButtonWidthDp*u,l-d),i(c,l+d),i(kButtonWidthDp*u,l+d),t.arrowVertexCount=n.length/2-t.arrowOffset,e.bindBuffer(e.ARRAY_BUFFER,t.vertexBuffer),e.bufferData(e.ARRAY_BUFFER,new Float32Array(n),e.STATIC_DRAW)})},CardboardUI.prototype.render=function(){var e=this.gl,t=this,r=[e.CULL_FACE,e.DEPTH_TEST,e.BLEND,e.SCISSOR_TEST,e.STENCIL_TEST,e.COLOR_WRITEMASK,e.VIEWPORT,e.CURRENT_PROGRAM,e.ARRAY_BUFFER_BINDING];WGLUPreserveGLState(e,r,function(e){e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.BLEND),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.colorMask(!0,!0,!0,!0),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),t.renderNoState()})},CardboardUI.prototype.renderNoState=function(){var e=this.gl;e.useProgram(this.program),e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),e.enableVertexAttribArray(this.attribs.position),e.vertexAttribPointer(this.attribs.position,2,e.FLOAT,!1,8,0),e.uniform4f(this.uniforms.color,1,1,1,1),Util.orthoMatrix(this.projMat,0,e.drawingBufferWidth,0,e.drawingBufferHeight,.1,1024),e.uniformMatrix4fv(this.uniforms.projectionMat,!1,this.projMat),e.drawArrays(e.TRIANGLE_STRIP,0,4),e.drawArrays(e.TRIANGLE_STRIP,this.gearOffset,this.gearVertexCount),e.drawArrays(e.TRIANGLE_STRIP,this.arrowOffset,this.arrowVertexCount)},module.exports=CardboardUI;
  127. },{"./deps/wglu-preserve-state.js":52,"./util.js":68}],51:[function(_dereq_,module,exports){
  128. function CardboardVRDisplay(){this.displayName="Cardboard VRDisplay (webvr-polyfill)",this.capabilities.hasOrientation=!0,this.capabilities.canPresent=!0,this.bufferScale_=window.WebVRConfig.BUFFER_SCALE,this.poseSensor_=new FusionPoseSensor,this.distorter_=null,this.cardboardUI_=null,this.dpdb_=new Dpdb(!0,this.onDeviceParamsUpdated_.bind(this)),this.deviceInfo_=new DeviceInfo(this.dpdb_.getDeviceParams()),this.viewerSelector_=new ViewerSelector,this.viewerSelector_.onChange(this.onViewerChanged_.bind(this)),this.deviceInfo_.setViewer(this.viewerSelector_.getCurrentViewer()),window.WebVRConfig.ROTATE_INSTRUCTIONS_DISABLED||(this.rotateInstructions_=new RotateInstructions),Util.isIOS()&&window.addEventListener("resize",this.onResize_.bind(this))}var CardboardDistorter=_dereq_("./cardboard-distorter.js"),CardboardUI=_dereq_("./cardboard-ui.js"),DeviceInfo=_dereq_("./device-info.js"),Dpdb=_dereq_("./dpdb/dpdb.js"),FusionPoseSensor=_dereq_("./sensor-fusion/fusion-pose-sensor.js"),RotateInstructions=_dereq_("./rotate-instructions.js"),ViewerSelector=_dereq_("./viewer-selector.js"),VRDisplay=_dereq_("./base.js").VRDisplay,Util=_dereq_("./util.js"),Eye={LEFT:"left",RIGHT:"right"};CardboardVRDisplay.prototype=new VRDisplay,CardboardVRDisplay.prototype.getImmediatePose=function(){return{position:this.poseSensor_.getPosition(),orientation:this.poseSensor_.getOrientation(),linearVelocity:null,linearAcceleration:null,angularVelocity:null,angularAcceleration:null}},CardboardVRDisplay.prototype.resetPose=function(){this.poseSensor_.resetPose()},CardboardVRDisplay.prototype.getEyeParameters=function(e){var t,i=[.5*this.deviceInfo_.viewer.interLensDistance,0,0];if(e==Eye.LEFT)i[0]*=-1,t=this.deviceInfo_.getFieldOfViewLeftEye();else{if(e!=Eye.RIGHT)return console.error("Invalid eye provided: %s",e),null;t=this.deviceInfo_.getFieldOfViewRightEye()}return{fieldOfView:t,offset:i,renderWidth:.5*this.deviceInfo_.device.width*this.bufferScale_,renderHeight:this.deviceInfo_.device.height*this.bufferScale_}},CardboardVRDisplay.prototype.onDeviceParamsUpdated_=function(e){Util.isDebug()&&console.log("DPDB reported that device params were updated."),this.deviceInfo_.updateDeviceParams(e),this.distorter_&&this.distorter_.updateDeviceInfo(this.deviceInfo_)},CardboardVRDisplay.prototype.updateBounds_=function(){this.layer_&&this.distorter_&&(this.layer_.leftBounds||this.layer_.rightBounds)&&this.distorter_.setTextureBounds(this.layer_.leftBounds,this.layer_.rightBounds)},CardboardVRDisplay.prototype.beginPresent_=function(){var e=this.layer_.source.getContext("webgl");e||(e=this.layer_.source.getContext("experimental-webgl")),e||(e=this.layer_.source.getContext("webgl2")),e&&(this.layer_.predistorted?window.WebVRConfig.CARDBOARD_UI_DISABLED||(e.canvas.width=Util.getScreenWidth()*this.bufferScale_,e.canvas.height=Util.getScreenHeight()*this.bufferScale_,this.cardboardUI_=new CardboardUI(e)):(this.distorter_=new CardboardDistorter(e),this.distorter_.updateDeviceInfo(this.deviceInfo_),this.cardboardUI_=this.distorter_.cardboardUI),this.cardboardUI_&&this.cardboardUI_.listen(function(e){this.viewerSelector_.show(this.layer_.source.parentElement),e.stopPropagation(),e.preventDefault()}.bind(this),function(e){this.exitPresent(),e.stopPropagation(),e.preventDefault()}.bind(this)),this.rotateInstructions_&&(Util.isLandscapeMode()&&Util.isMobile()?this.rotateInstructions_.showTemporarily(3e3,this.layer_.source.parentElement):this.rotateInstructions_.update()),this.orientationHandler=this.onOrientationChange_.bind(this),window.addEventListener("orientationchange",this.orientationHandler),this.vrdisplaypresentchangeHandler=this.updateBounds_.bind(this),window.addEventListener("vrdisplaypresentchange",this.vrdisplaypresentchangeHandler),this.fireVRDisplayDeviceParamsChange_())},CardboardVRDisplay.prototype.endPresent_=function(){this.distorter_&&(this.distorter_.destroy(),this.distorter_=null),this.cardboardUI_&&(this.cardboardUI_.destroy(),this.cardboardUI_=null),this.rotateInstructions_&&this.rotateInstructions_.hide(),this.viewerSelector_.hide(),window.removeEventListener("orientationchange",this.orientationHandler),window.removeEventListener("vrdisplaypresentchange",this.vrdisplaypresentchangeHandler)},CardboardVRDisplay.prototype.submitFrame=function(e){if(this.distorter_)this.updateBounds_(),this.distorter_.submitFrame();else if(this.cardboardUI_&&this.layer_){var t=this.layer_.source.getContext("webgl").canvas;t.width==this.lastWidth&&t.height==this.lastHeight||this.cardboardUI_.onResize(),this.lastWidth=t.width,this.lastHeight=t.height,this.cardboardUI_.render()}},CardboardVRDisplay.prototype.onOrientationChange_=function(e){this.viewerSelector_.hide(),this.rotateInstructions_&&this.rotateInstructions_.update(),this.onResize_()},CardboardVRDisplay.prototype.onResize_=function(e){if(this.layer_){var t=this.layer_.source.getContext("webgl"),i=["position: absolute","top: 0","left: 0","width: 100vw","height: 100vh","border: 0","margin: 0","padding: 0px","box-sizing: content-box"];t.canvas.setAttribute("style",i.join("; ")+";"),Util.safariCssSizeWorkaround(t.canvas)}},CardboardVRDisplay.prototype.onViewerChanged_=function(e){this.deviceInfo_.setViewer(e),this.distorter_&&this.distorter_.updateDeviceInfo(this.deviceInfo_),this.fireVRDisplayDeviceParamsChange_()},CardboardVRDisplay.prototype.fireVRDisplayDeviceParamsChange_=function(){var e=new CustomEvent("vrdisplaydeviceparamschange",{detail:{vrdisplay:this,deviceInfo:this.deviceInfo_}});window.dispatchEvent(e)},module.exports=CardboardVRDisplay;
  129. },{"./base.js":48,"./cardboard-distorter.js":49,"./cardboard-ui.js":50,"./device-info.js":53,"./dpdb/dpdb.js":57,"./rotate-instructions.js":62,"./sensor-fusion/fusion-pose-sensor.js":64,"./util.js":68,"./viewer-selector.js":69}],52:[function(_dereq_,module,exports){
  130. function WGLUPreserveGLState(e,E,r){if(!E)return void r(e);for(var a=[],T=null,R=0;R<E.length;++R){var _=E[R];switch(_){case e.TEXTURE_BINDING_2D:case e.TEXTURE_BINDING_CUBE_MAP:var t=E[++R];if(t<e.TEXTURE0||t>e.TEXTURE31){console.error("TEXTURE_BINDING_2D or TEXTURE_BINDING_CUBE_MAP must be followed by a valid texture unit"),a.push(null,null);break}T||(T=e.getParameter(e.ACTIVE_TEXTURE)),e.activeTexture(t),a.push(e.getParameter(_),null);break;case e.ACTIVE_TEXTURE:T=e.getParameter(e.ACTIVE_TEXTURE),a.push(null);break;default:a.push(e.getParameter(_))}}r(e);for(var R=0;R<E.length;++R){var _=E[R],s=a[R];switch(_){case e.ACTIVE_TEXTURE:break;case e.ARRAY_BUFFER_BINDING:e.bindBuffer(e.ARRAY_BUFFER,s);break;case e.COLOR_CLEAR_VALUE:e.clearColor(s[0],s[1],s[2],s[3]);break;case e.COLOR_WRITEMASK:e.colorMask(s[0],s[1],s[2],s[3]);break;case e.CURRENT_PROGRAM:e.useProgram(s);break;case e.ELEMENT_ARRAY_BUFFER_BINDING:e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,s);break;case e.FRAMEBUFFER_BINDING:e.bindFramebuffer(e.FRAMEBUFFER,s);break;case e.RENDERBUFFER_BINDING:e.bindRenderbuffer(e.RENDERBUFFER,s);break;case e.TEXTURE_BINDING_2D:var t=E[++R];if(t<e.TEXTURE0||t>e.TEXTURE31)break;e.activeTexture(t),e.bindTexture(e.TEXTURE_2D,s);break;case e.TEXTURE_BINDING_CUBE_MAP:var t=E[++R];if(t<e.TEXTURE0||t>e.TEXTURE31)break;e.activeTexture(t),e.bindTexture(e.TEXTURE_CUBE_MAP,s);break;case e.VIEWPORT:e.viewport(s[0],s[1],s[2],s[3]);break;case e.BLEND:case e.CULL_FACE:case e.DEPTH_TEST:case e.SCISSOR_TEST:case e.STENCIL_TEST:s?e.enable(_):e.disable(_);break;default:console.log("No GL restore behavior for 0x"+_.toString(16))}T&&e.activeTexture(T)}}module.exports=WGLUPreserveGLState;
  131. },{}],53:[function(_dereq_,module,exports){
  132. function Device(e){this.width=e.width||Util.getScreenWidth(),this.height=e.height||Util.getScreenHeight(),this.widthMeters=e.widthMeters,this.heightMeters=e.heightMeters,this.bevelMeters=e.bevelMeters}function DeviceInfo(e){this.viewer=Viewers.CardboardV2,this.updateDeviceParams(e),this.distortion=new Distortion(this.viewer.distortionCoefficients)}function CardboardViewer(e){this.id=e.id,this.label=e.label,this.fov=e.fov,this.interLensDistance=e.interLensDistance,this.baselineLensDistance=e.baselineLensDistance,this.screenLensDistance=e.screenLensDistance,this.distortionCoefficients=e.distortionCoefficients,this.inverseCoefficients=e.inverseCoefficients}var Distortion=_dereq_("./distortion/distortion.js"),MathUtil=_dereq_("./math-util.js"),Util=_dereq_("./util.js"),DEFAULT_ANDROID=new Device({widthMeters:.11,heightMeters:.062,bevelMeters:.004}),DEFAULT_IOS=new Device({widthMeters:.1038,heightMeters:.0584,bevelMeters:.004}),Viewers={CardboardV1:new CardboardViewer({id:"CardboardV1",label:"Cardboard I/O 2014",fov:40,interLensDistance:.06,baselineLensDistance:.035,screenLensDistance:.042,distortionCoefficients:[.441,.156],inverseCoefficients:[-.4410035,.42756155,-.4804439,.5460139,-.58821183,.5733938,-.48303202,.33299083,-.17573841,.0651772,-.01488963,.001559834]}),CardboardV2:new CardboardViewer({id:"CardboardV2",label:"Cardboard I/O 2015",fov:60,interLensDistance:.064,baselineLensDistance:.035,screenLensDistance:.039,distortionCoefficients:[.34,.55],inverseCoefficients:[-.33836704,-.18162185,.862655,-1.2462051,1.0560602,-.58208317,.21609078,-.05444823,.009177956,-.0009904169,6183535e-11,-16981803e-13]})},DEFAULT_LEFT_CENTER={x:.5,y:.5},DEFAULT_RIGHT_CENTER={x:.5,y:.5};DeviceInfo.prototype.updateDeviceParams=function(e){this.device=this.determineDevice_(e)||this.device},DeviceInfo.prototype.getDevice=function(){return this.device},DeviceInfo.prototype.setViewer=function(e){this.viewer=e,this.distortion=new Distortion(this.viewer.distortionCoefficients)},DeviceInfo.prototype.determineDevice_=function(e){if(!e)return Util.isIOS()?(console.warn("Using fallback iOS device measurements."),DEFAULT_IOS):(console.warn("Using fallback Android device measurements."),DEFAULT_ANDROID);var t=.0254,i=t/e.xdpi,s=t/e.ydpi,n=Util.getScreenWidth(),r=Util.getScreenHeight();return new Device({widthMeters:i*n,heightMeters:s*r,bevelMeters:.001*e.bevelMm})},DeviceInfo.prototype.getDistortedFieldOfViewLeftEye=function(){var e=this.viewer,t=this.device,i=this.distortion,s=e.screenLensDistance,n=(t.widthMeters-e.interLensDistance)/2,r=e.interLensDistance/2,o=e.baselineLensDistance-t.bevelMeters,a=t.heightMeters-o,h=MathUtil.radToDeg*Math.atan(i.distort(n/s)),d=MathUtil.radToDeg*Math.atan(i.distort(r/s)),c=MathUtil.radToDeg*Math.atan(i.distort(o/s)),D=MathUtil.radToDeg*Math.atan(i.distort(a/s));return{leftDegrees:Math.min(h,e.fov),rightDegrees:Math.min(d,e.fov),downDegrees:Math.min(c,e.fov),upDegrees:Math.min(D,e.fov)}},DeviceInfo.prototype.getLeftEyeVisibleTanAngles=function(){var e=this.viewer,t=this.device,i=this.distortion,s=Math.tan(-MathUtil.degToRad*e.fov),n=Math.tan(MathUtil.degToRad*e.fov),r=Math.tan(MathUtil.degToRad*e.fov),o=Math.tan(-MathUtil.degToRad*e.fov),a=t.widthMeters/4,h=t.heightMeters/2,d=e.baselineLensDistance-t.bevelMeters-h,c=e.interLensDistance/2-a,D=-d,f=e.screenLensDistance,v=i.distort((c-a)/f),M=i.distort((D+h)/f),g=i.distort((c+a)/f),l=i.distort((D-h)/f),w=new Float32Array(4);return w[0]=Math.max(s,v),w[1]=Math.min(n,M),w[2]=Math.min(r,g),w[3]=Math.max(o,l),w},DeviceInfo.prototype.getLeftEyeNoLensTanAngles=function(){var e=this.viewer,t=this.device,i=this.distortion,s=new Float32Array(4),n=i.distortInverse(Math.tan(-MathUtil.degToRad*e.fov)),r=i.distortInverse(Math.tan(MathUtil.degToRad*e.fov)),o=i.distortInverse(Math.tan(MathUtil.degToRad*e.fov)),a=i.distortInverse(Math.tan(-MathUtil.degToRad*e.fov)),h=t.widthMeters/4,d=t.heightMeters/2,c=e.baselineLensDistance-t.bevelMeters-d,D=e.interLensDistance/2-h,f=-c,v=e.screenLensDistance,M=(D-h)/v,g=(f+d)/v,l=(D+h)/v,w=(f-d)/v;return s[0]=Math.max(n,M),s[1]=Math.min(r,g),s[2]=Math.min(o,l),s[3]=Math.max(a,w),s},DeviceInfo.prototype.getLeftEyeVisibleScreenRect=function(e){var t=this.viewer,i=this.device,s=t.screenLensDistance,n=(i.widthMeters-t.interLensDistance)/2,r=t.baselineLensDistance-i.bevelMeters,o=(e[0]*s+n)/i.widthMeters,a=(e[1]*s+r)/i.heightMeters,h=(e[2]*s+n)/i.widthMeters,d=(e[3]*s+r)/i.heightMeters;return{x:o,y:d,width:h-o,height:a-d}},DeviceInfo.prototype.getFieldOfViewLeftEye=function(e){return e?this.getUndistortedFieldOfViewLeftEye():this.getDistortedFieldOfViewLeftEye()},DeviceInfo.prototype.getFieldOfViewRightEye=function(e){var t=this.getFieldOfViewLeftEye(e);return{leftDegrees:t.rightDegrees,rightDegrees:t.leftDegrees,upDegrees:t.upDegrees,downDegrees:t.downDegrees}},DeviceInfo.prototype.getUndistortedFieldOfViewLeftEye=function(){var e=this.getUndistortedParams_();return{leftDegrees:MathUtil.radToDeg*Math.atan(e.outerDist),rightDegrees:MathUtil.radToDeg*Math.atan(e.innerDist),downDegrees:MathUtil.radToDeg*Math.atan(e.bottomDist),upDegrees:MathUtil.radToDeg*Math.atan(e.topDist)}},DeviceInfo.prototype.getUndistortedViewportLeftEye=function(){var e=this.getUndistortedParams_(),t=this.viewer,i=this.device,s=t.screenLensDistance,n=i.widthMeters/s,r=i.heightMeters/s,o=i.width/n,a=i.height/r,h=Math.round((e.eyePosX-e.outerDist)*o),d=Math.round((e.eyePosY-e.bottomDist)*a);return{x:h,y:d,width:Math.round((e.eyePosX+e.innerDist)*o)-h,height:Math.round((e.eyePosY+e.topDist)*a)-d}},DeviceInfo.prototype.getUndistortedParams_=function(){var e=this.viewer,t=this.device,i=this.distortion,s=e.screenLensDistance,n=e.interLensDistance/2/s,r=t.widthMeters/s,o=t.heightMeters/s,a=r/2-n,h=(e.baselineLensDistance-t.bevelMeters)/s,d=e.fov,c=i.distortInverse(Math.tan(MathUtil.degToRad*d)),D=Math.min(a,c),f=Math.min(n,c),v=Math.min(h,c),M=Math.min(o-h,c);return{outerDist:D,innerDist:f,topDist:M,bottomDist:v,eyePosX:a,eyePosY:h}},DeviceInfo.Viewers=Viewers,module.exports=DeviceInfo;
  133. },{"./distortion/distortion.js":55,"./math-util.js":59,"./util.js":68}],54:[function(_dereq_,module,exports){
  134. function VRDisplayHMDDevice(e){this.display=e,this.hardwareUnitId=e.displayId,this.deviceId="webvr-polyfill:HMD:"+e.displayId,this.deviceName=e.displayName+" (HMD)"}function VRDisplayPositionSensorDevice(e){this.display=e,this.hardwareUnitId=e.displayId,this.deviceId="webvr-polyfill:PositionSensor: "+e.displayId,this.deviceName=e.displayName+" (PositionSensor)"}var VRDisplay=_dereq_("./base.js").VRDisplay,HMDVRDevice=_dereq_("./base.js").HMDVRDevice,PositionSensorVRDevice=_dereq_("./base.js").PositionSensorVRDevice;VRDisplayHMDDevice.prototype=new HMDVRDevice,VRDisplayHMDDevice.prototype.getEyeParameters=function(e){var i=this.display.getEyeParameters(e);return{currentFieldOfView:i.fieldOfView,maximumFieldOfView:i.fieldOfView,minimumFieldOfView:i.fieldOfView,recommendedFieldOfView:i.fieldOfView,eyeTranslation:{x:i.offset[0],y:i.offset[1],z:i.offset[2]},renderRect:{x:"right"==e?i.renderWidth:0,y:0,width:i.renderWidth,height:i.renderHeight}}},VRDisplayHMDDevice.prototype.setFieldOfView=function(e,i,t,o){},VRDisplayPositionSensorDevice.prototype=new PositionSensorVRDevice,VRDisplayPositionSensorDevice.prototype.getState=function(){var e=this.display.getPose();return{position:e.position?{x:e.position[0],y:e.position[1],z:e.position[2]}:null,orientation:e.orientation?{x:e.orientation[0],y:e.orientation[1],z:e.orientation[2],w:e.orientation[3]}:null,linearVelocity:null,linearAcceleration:null,angularVelocity:null,angularAcceleration:null}},VRDisplayPositionSensorDevice.prototype.resetState=function(){return this.positionDevice.resetPose()},module.exports.VRDisplayHMDDevice=VRDisplayHMDDevice,module.exports.VRDisplayPositionSensorDevice=VRDisplayPositionSensorDevice;
  135. },{"./base.js":48}],55:[function(_dereq_,module,exports){
  136. function Distortion(t){this.coefficients=t}Distortion.prototype.distortInverse=function(t){for(var i=0,o=1,r=t-this.distort(i);Math.abs(o-i)>1e-4;){var s=t-this.distort(o),n=o-s*((o-i)/(s-r));i=o,o=n,r=s}return o},Distortion.prototype.distort=function(t){for(var i=t*t,o=0,r=0;r<this.coefficients.length;r++)o=i*(o+this.coefficients[r]);return(o+1)*t},module.exports=Distortion;
  137. },{}],56:[function(_dereq_,module,exports){
  138. module.exports={"format":1,"last_updated":"2017-08-27T14:39:31Z","devices":[{"type":"android","rules":[{"mdmh":"asus/*/Nexus 7/*"},{"ua":"Nexus 7"}],"dpi":[320.8,323],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"asus/*/ASUS_Z00AD/*"},{"ua":"ASUS_Z00AD"}],"dpi":[403,404.6],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"Google/*/Pixel XL/*"},{"ua":"Pixel XL"}],"dpi":[537.9,533],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"Google/*/Pixel/*"},{"ua":"Pixel"}],"dpi":[432.6,436.7],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"HTC/*/HTC6435LVW/*"},{"ua":"HTC6435LVW"}],"dpi":[449.7,443.3],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"HTC/*/HTC One XL/*"},{"ua":"HTC One XL"}],"dpi":[315.3,314.6],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"htc/*/Nexus 9/*"},{"ua":"Nexus 9"}],"dpi":289,"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"HTC/*/HTC One M9/*"},{"ua":"HTC One M9"}],"dpi":[442.5,443.3],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"HTC/*/HTC One_M8/*"},{"ua":"HTC One_M8"}],"dpi":[449.7,447.4],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"HTC/*/HTC One/*"},{"ua":"HTC One"}],"dpi":472.8,"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"Huawei/*/Nexus 6P/*"},{"ua":"Nexus 6P"}],"dpi":[515.1,518],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"LENOVO/*/Lenovo PB2-690Y/*"},{"ua":"Lenovo PB2-690Y"}],"dpi":[457.2,454.713],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"LGE/*/Nexus 5X/*"},{"ua":"Nexus 5X"}],"dpi":[422,419.9],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"LGE/*/LGMS345/*"},{"ua":"LGMS345"}],"dpi":[221.7,219.1],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"LGE/*/LG-D800/*"},{"ua":"LG-D800"}],"dpi":[422,424.1],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"LGE/*/LG-D850/*"},{"ua":"LG-D850"}],"dpi":[537.9,541.9],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"LGE/*/VS985 4G/*"},{"ua":"VS985 4G"}],"dpi":[537.9,535.6],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"LGE/*/Nexus 5/*"},{"ua":"Nexus 5 B"}],"dpi":[442.4,444.8],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"LGE/*/Nexus 4/*"},{"ua":"Nexus 4"}],"dpi":[319.8,318.4],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"LGE/*/LG-P769/*"},{"ua":"LG-P769"}],"dpi":[240.6,247.5],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"LGE/*/LGMS323/*"},{"ua":"LGMS323"}],"dpi":[206.6,204.6],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"LGE/*/LGLS996/*"},{"ua":"LGLS996"}],"dpi":[403.4,401.5],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"Micromax/*/4560MMX/*"},{"ua":"4560MMX"}],"dpi":[240,219.4],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"Micromax/*/A250/*"},{"ua":"Micromax A250"}],"dpi":[480,446.4],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"Micromax/*/Micromax AQ4501/*"},{"ua":"Micromax AQ4501"}],"dpi":240,"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"motorola/*/DROID RAZR/*"},{"ua":"DROID RAZR"}],"dpi":[368.1,256.7],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"motorola/*/XT830C/*"},{"ua":"XT830C"}],"dpi":[254,255.9],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"motorola/*/XT1021/*"},{"ua":"XT1021"}],"dpi":[254,256.7],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"motorola/*/XT1023/*"},{"ua":"XT1023"}],"dpi":[254,256.7],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"motorola/*/XT1028/*"},{"ua":"XT1028"}],"dpi":[326.6,327.6],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"motorola/*/XT1034/*"},{"ua":"XT1034"}],"dpi":[326.6,328.4],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"motorola/*/XT1053/*"},{"ua":"XT1053"}],"dpi":[315.3,316.1],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"motorola/*/XT1562/*"},{"ua":"XT1562"}],"dpi":[403.4,402.7],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"motorola/*/Nexus 6/*"},{"ua":"Nexus 6 B"}],"dpi":[494.3,489.7],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"motorola/*/XT1063/*"},{"ua":"XT1063"}],"dpi":[295,296.6],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"motorola/*/XT1064/*"},{"ua":"XT1064"}],"dpi":[295,295.6],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"motorola/*/XT1092/*"},{"ua":"XT1092"}],"dpi":[422,424.1],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"motorola/*/XT1095/*"},{"ua":"XT1095"}],"dpi":[422,423.4],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"motorola/*/G4/*"},{"ua":"Moto G (4)"}],"dpi":401,"bw":4,"ac":1000},{"type":"android","rules":[{"mdmh":"OnePlus/*/A0001/*"},{"ua":"A0001"}],"dpi":[403.4,401],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"OnePlus/*/ONE E1005/*"},{"ua":"ONE E1005"}],"dpi":[442.4,441.4],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"OnePlus/*/ONE A2005/*"},{"ua":"ONE A2005"}],"dpi":[391.9,405.4],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"OPPO/*/X909/*"},{"ua":"X909"}],"dpi":[442.4,444.1],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/GT-I9082/*"},{"ua":"GT-I9082"}],"dpi":[184.7,185.4],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G360P/*"},{"ua":"SM-G360P"}],"dpi":[196.7,205.4],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/Nexus S/*"},{"ua":"Nexus S"}],"dpi":[234.5,229.8],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/GT-I9300/*"},{"ua":"GT-I9300"}],"dpi":[304.8,303.9],"bw":5,"ac":500},{"type":"android","rules":[{"mdmh":"samsung/*/SM-T230NU/*"},{"ua":"SM-T230NU"}],"dpi":216,"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"samsung/*/SGH-T399/*"},{"ua":"SGH-T399"}],"dpi":[217.7,231.4],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SGH-M919/*"},{"ua":"SGH-M919"}],"dpi":[440.8,437.7],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-N9005/*"},{"ua":"SM-N9005"}],"dpi":[386.4,387],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"samsung/*/SAMSUNG-SM-N900A/*"},{"ua":"SAMSUNG-SM-N900A"}],"dpi":[386.4,387.7],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/GT-I9500/*"},{"ua":"GT-I9500"}],"dpi":[442.5,443.3],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"samsung/*/GT-I9505/*"},{"ua":"GT-I9505"}],"dpi":439.4,"bw":4,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G900F/*"},{"ua":"SM-G900F"}],"dpi":[415.6,431.6],"bw":5,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G900M/*"},{"ua":"SM-G900M"}],"dpi":[415.6,431.6],"bw":5,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G800F/*"},{"ua":"SM-G800F"}],"dpi":326.8,"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G906S/*"},{"ua":"SM-G906S"}],"dpi":[562.7,572.4],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/GT-I9300/*"},{"ua":"GT-I9300"}],"dpi":[306.7,304.8],"bw":5,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-T535/*"},{"ua":"SM-T535"}],"dpi":[142.6,136.4],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"samsung/*/SM-N920C/*"},{"ua":"SM-N920C"}],"dpi":[515.1,518.4],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-N920W8/*"},{"ua":"SM-N920W8"}],"dpi":[515.1,518.4],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/GT-I9300I/*"},{"ua":"GT-I9300I"}],"dpi":[304.8,305.8],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/GT-I9195/*"},{"ua":"GT-I9195"}],"dpi":[249.4,256.7],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"samsung/*/SPH-L520/*"},{"ua":"SPH-L520"}],"dpi":[249.4,255.9],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SAMSUNG-SGH-I717/*"},{"ua":"SAMSUNG-SGH-I717"}],"dpi":285.8,"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SPH-D710/*"},{"ua":"SPH-D710"}],"dpi":[217.7,204.2],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/GT-N7100/*"},{"ua":"GT-N7100"}],"dpi":265.1,"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SCH-I605/*"},{"ua":"SCH-I605"}],"dpi":265.1,"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/Galaxy Nexus/*"},{"ua":"Galaxy Nexus"}],"dpi":[315.3,314.2],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-N910H/*"},{"ua":"SM-N910H"}],"dpi":[515.1,518],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-N910C/*"},{"ua":"SM-N910C"}],"dpi":[515.2,520.2],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G130M/*"},{"ua":"SM-G130M"}],"dpi":[165.9,164.8],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G928I/*"},{"ua":"SM-G928I"}],"dpi":[515.1,518.4],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G920F/*"},{"ua":"SM-G920F"}],"dpi":580.6,"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G920P/*"},{"ua":"SM-G920P"}],"dpi":[522.5,577],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G925F/*"},{"ua":"SM-G925F"}],"dpi":580.6,"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G925V/*"},{"ua":"SM-G925V"}],"dpi":[522.5,576.6],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G930F/*"},{"ua":"SM-G930F"}],"dpi":576.6,"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G935F/*"},{"ua":"SM-G935F"}],"dpi":533,"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G950F/*"},{"ua":"SM-G950F"}],"dpi":[562.707,565.293],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"samsung/*/SM-G955U/*"},{"ua":"SM-G955U"}],"dpi":[522.514,525.762],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"Sony/*/C6903/*"},{"ua":"C6903"}],"dpi":[442.5,443.3],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"Sony/*/D6653/*"},{"ua":"D6653"}],"dpi":[428.6,427.6],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"Sony/*/E6653/*"},{"ua":"E6653"}],"dpi":[428.6,425.7],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"Sony/*/E6853/*"},{"ua":"E6853"}],"dpi":[403.4,401.9],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"Sony/*/SGP321/*"},{"ua":"SGP321"}],"dpi":[224.7,224.1],"bw":3,"ac":500},{"type":"android","rules":[{"mdmh":"TCT/*/ALCATEL ONE TOUCH Fierce/*"},{"ua":"ALCATEL ONE TOUCH Fierce"}],"dpi":[240,247.5],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"THL/*/thl 5000/*"},{"ua":"thl 5000"}],"dpi":[480,443.3],"bw":3,"ac":1000},{"type":"android","rules":[{"mdmh":"ZTE/*/ZTE Blade L2/*"},{"ua":"ZTE Blade L2"}],"dpi":240,"bw":3,"ac":500},{"type":"ios","rules":[{"res":[640,960]}],"dpi":[325.1,328.4],"bw":4,"ac":1000},{"type":"ios","rules":[{"res":[640,1136]}],"dpi":[317.1,320.2],"bw":3,"ac":1000},{"type":"ios","rules":[{"res":[750,1334]}],"dpi":326.4,"bw":4,"ac":1000},{"type":"ios","rules":[{"res":[1242,2208]}],"dpi":[453.6,458.4],"bw":4,"ac":1000},{"type":"ios","rules":[{"res":[1125,2001]}],"dpi":[410.9,415.4],"bw":4,"ac":1000}]}
  139. },{}],57:[function(_dereq_,module,exports){
  140. function Dpdb(e,r){if(this.dpdb=DPDB_CACHE,this.recalculateDeviceParams_(),e){this.onDeviceParamsUpdated=r;var i=new XMLHttpRequest,t=this;i.open("GET",ONLINE_DPDB_URL,!0),i.addEventListener("load",function(){t.loading=!1,i.status>=200&&i.status<=299?(t.dpdb=JSON.parse(i.response),t.recalculateDeviceParams_()):console.error("Error loading online DPDB!")}),i.send()}}function DeviceParams(e){this.xdpi=e.xdpi,this.ydpi=e.ydpi,this.bevelMm=e.bevelMm}var DPDB_CACHE=_dereq_("./dpdb.json"),Util=_dereq_("../util.js"),ONLINE_DPDB_URL="https://dpdb.webvr.rocks/dpdb.json";Dpdb.prototype.getDeviceParams=function(){return this.deviceParams},Dpdb.prototype.recalculateDeviceParams_=function(){var e=this.calcDeviceParams_();e?(this.deviceParams=e,this.onDeviceParamsUpdated&&this.onDeviceParamsUpdated(this.deviceParams)):console.error("Failed to recalculate device parameters.")},Dpdb.prototype.calcDeviceParams_=function(){var e=this.dpdb;if(!e)return console.error("DPDB not available."),null;if(1!=e.format)return console.error("DPDB has unexpected format version."),null;if(!e.devices||!e.devices.length)return console.error("DPDB does not have a devices section."),null;var r=navigator.userAgent||navigator.vendor||window.opera,i=Util.getScreenWidth(),t=Util.getScreenHeight();if(!e.devices)return console.error("DPDB has no devices section."),null;for(var a=0;a<e.devices.length;a++){var s=e.devices[a];if(s.rules)if("ios"==s.type||"android"==s.type){if(Util.isIOS()==("ios"==s.type)){for(var n=!1,o=0;o<s.rules.length;o++){var c=s.rules[o];if(this.matchRule_(c,r,i,t)){n=!0;break}}if(n){var d=s.dpi[0]||s.dpi,l=s.dpi[1]||s.dpi;return new DeviceParams({xdpi:d,ydpi:l,bevelMm:s.bw})}}}else console.warn("Device["+a+"] has invalid type.");else console.warn("Device["+a+"] has no rules section.")}return console.warn("No DPDB device match."),null},Dpdb.prototype.matchRule_=function(e,r,i,t){if(!e.ua&&!e.res)return!1;if(e.ua&&r.indexOf(e.ua)<0)return!1;if(e.res){if(!e.res[0]||!e.res[1])return!1;var a=e.res[0],s=e.res[1];if(Math.min(i,t)!=Math.min(a,s)||Math.max(i,t)!=Math.max(a,s))return!1}return!0},module.exports=Dpdb;
  141. },{"../util.js":68,"./dpdb.json":56}],58:[function(_dereq_,module,exports){
  142. var Util=_dereq_("./util.js"),WebVRPolyfill=_dereq_("./webvr-polyfill.js").WebVRPolyfill;window.WebVRConfig=Util.extend({FORCE_ENABLE_VR:!1,K_FILTER:.98,PREDICTION_TIME_S:.04,TOUCH_PANNER_DISABLED:!0,CARDBOARD_UI_DISABLED:!1,ROTATE_INSTRUCTIONS_DISABLED:!1,YAW_ONLY:!1,MOUSE_KEYBOARD_CONTROLS_DISABLED:!1,DEFER_INITIALIZATION:!1,ENABLE_DEPRECATED_API:!1,BUFFER_SCALE:.5,DIRTY_SUBMIT_FRAME_BINDINGS:!1,ALWAYS_APPEND_POLYFILL_DISPLAY:!1,GET_VR_DISPLAYS_TIMEOUT:1e3},window.WebVRConfig),window.WebVRConfig.DEFER_INITIALIZATION?window.InitializeWebVRPolyfill=function(){new WebVRPolyfill}:new WebVRPolyfill,window.WebVRPolyfill=WebVRPolyfill;
  143. },{"./util.js":68,"./webvr-polyfill.js":71}],59:[function(_dereq_,module,exports){
  144. var MathUtil=window.MathUtil||{};MathUtil.degToRad=Math.PI/180,MathUtil.radToDeg=180/Math.PI,MathUtil.Vector2=function(t,i){this.x=t||0,this.y=i||0},MathUtil.Vector2.prototype={constructor:MathUtil.Vector2,set:function(t,i){return this.x=t,this.y=i,this},copy:function(t){return this.x=t.x,this.y=t.y,this},subVectors:function(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this}},MathUtil.Vector3=function(t,i,s){this.x=t||0,this.y=i||0,this.z=s||0},MathUtil.Vector3.prototype={constructor:MathUtil.Vector3,set:function(t,i,s){return this.x=t,this.y=i,this.z=s,this},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},normalize:function(){var t=this.length();if(0!==t){var i=1/t;this.multiplyScalar(i)}else this.x=0,this.y=0,this.z=0;return this},multiplyScalar:function(t){this.x*=t,this.y*=t,this.z*=t},applyQuaternion:function(t){var i=this.x,s=this.y,h=this.z,n=t.x,r=t.y,o=t.z,a=t.w,e=a*i+r*h-o*s,u=a*s+o*i-n*h,y=a*h+n*s-r*i,c=-n*i-r*s-o*h;return this.x=e*a+c*-n+u*-o-y*-r,this.y=u*a+c*-r+y*-n-e*-o,this.z=y*a+c*-o+e*-r-u*-n,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},crossVectors:function(t,i){var s=t.x,h=t.y,n=t.z,r=i.x,o=i.y,a=i.z;return this.x=h*a-n*o,this.y=n*r-s*a,this.z=s*o-h*r,this}},MathUtil.Quaternion=function(t,i,s,h){this.x=t||0,this.y=i||0,this.z=s||0,this.w=void 0!==h?h:1},MathUtil.Quaternion.prototype={constructor:MathUtil.Quaternion,set:function(t,i,s,h){return this.x=t,this.y=i,this.z=s,this.w=h,this},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},setFromEulerXYZ:function(t,i,s){var h=Math.cos(t/2),n=Math.cos(i/2),r=Math.cos(s/2),o=Math.sin(t/2),a=Math.sin(i/2),e=Math.sin(s/2);return this.x=o*n*r+h*a*e,this.y=h*a*r-o*n*e,this.z=h*n*e+o*a*r,this.w=h*n*r-o*a*e,this},setFromEulerYXZ:function(t,i,s){var h=Math.cos(t/2),n=Math.cos(i/2),r=Math.cos(s/2),o=Math.sin(t/2),a=Math.sin(i/2),e=Math.sin(s/2);return this.x=o*n*r+h*a*e,this.y=h*a*r-o*n*e,this.z=h*n*e-o*a*r,this.w=h*n*r+o*a*e,this},setFromAxisAngle:function(t,i){var s=i/2,h=Math.sin(s);return this.x=t.x*h,this.y=t.y*h,this.z=t.z*h,this.w=Math.cos(s),this},multiply:function(t){return this.multiplyQuaternions(this,t)},multiplyQuaternions:function(t,i){var s=t.x,h=t.y,n=t.z,r=t.w,o=i.x,a=i.y,e=i.z,u=i.w;return this.x=s*u+r*o+h*e-n*a,this.y=h*u+r*a+n*o-s*e,this.z=n*u+r*e+s*a-h*o,this.w=r*u-s*o-h*a-n*e,this},inverse:function(){return this.x*=-1,this.y*=-1,this.z*=-1,this.normalize(),this},normalize:function(){var t=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===t?(this.x=0,this.y=0,this.z=0,this.w=1):(t=1/t,this.x=this.x*t,this.y=this.y*t,this.z=this.z*t,this.w=this.w*t),this},slerp:function(t,i){if(0===i)return this;if(1===i)return this.copy(t);var s=this.x,h=this.y,n=this.z,r=this.w,o=r*t.w+s*t.x+h*t.y+n*t.z;if(o<0?(this.w=-t.w,this.x=-t.x,this.y=-t.y,this.z=-t.z,o=-o):this.copy(t),o>=1)return this.w=r,this.x=s,this.y=h,this.z=n,this;var a=Math.acos(o),e=Math.sqrt(1-o*o);if(Math.abs(e)<.001)return this.w=.5*(r+this.w),this.x=.5*(s+this.x),this.y=.5*(h+this.y),this.z=.5*(n+this.z),this;var u=Math.sin((1-i)*a)/e,y=Math.sin(i*a)/e;return this.w=r*u+this.w*y,this.x=s*u+this.x*y,this.y=h*u+this.y*y,this.z=n*u+this.z*y,this},setFromUnitVectors:function(){var t,i,s=1e-6;return function(h,n){return void 0===t&&(t=new MathUtil.Vector3),i=h.dot(n)+1,i<s?(i=0,Math.abs(h.x)>Math.abs(h.z)?t.set(-h.y,h.x,0):t.set(0,-h.z,h.y)):t.crossVectors(h,n),this.x=t.x,this.y=t.y,this.z=t.z,this.w=i,this.normalize(),this}}()},module.exports=MathUtil;
  145. },{}],60:[function(_dereq_,module,exports){
  146. function MouseKeyboardVRDisplay(){this.displayName="Mouse and Keyboard VRDisplay (webvr-polyfill)",this.capabilities.hasOrientation=!0,window.addEventListener("keydown",this.onKeyDown_.bind(this)),window.addEventListener("mousemove",this.onMouseMove_.bind(this)),window.addEventListener("mousedown",this.onMouseDown_.bind(this)),window.addEventListener("mouseup",this.onMouseUp_.bind(this)),this.phi_=0,this.theta_=0,this.targetAngle_=null,this.angleAnimation_=null,this.orientation_=new MathUtil.Quaternion,this.rotateStart_=new MathUtil.Vector2,this.rotateEnd_=new MathUtil.Vector2,this.rotateDelta_=new MathUtil.Vector2,this.isDragging_=!1,this.orientationOut_=new Float32Array(4)}var VRDisplay=_dereq_("./base.js").VRDisplay,MathUtil=_dereq_("./math-util.js"),Util=_dereq_("./util.js"),KEY_SPEED=.15,KEY_ANIMATION_DURATION=80,MOUSE_SPEED_X=.5,MOUSE_SPEED_Y=.3;MouseKeyboardVRDisplay.prototype=new VRDisplay,MouseKeyboardVRDisplay.prototype.getImmediatePose=function(){return this.orientation_.setFromEulerYXZ(this.phi_,this.theta_,0),this.orientationOut_[0]=this.orientation_.x,this.orientationOut_[1]=this.orientation_.y,this.orientationOut_[2]=this.orientation_.z,this.orientationOut_[3]=this.orientation_.w,{position:null,orientation:this.orientationOut_,linearVelocity:null,linearAcceleration:null,angularVelocity:null,angularAcceleration:null}},MouseKeyboardVRDisplay.prototype.onKeyDown_=function(t){38==t.keyCode?this.animatePhi_(this.phi_+KEY_SPEED):39==t.keyCode?this.animateTheta_(this.theta_-KEY_SPEED):40==t.keyCode?this.animatePhi_(this.phi_-KEY_SPEED):37==t.keyCode&&this.animateTheta_(this.theta_+KEY_SPEED)},MouseKeyboardVRDisplay.prototype.animateTheta_=function(t){this.animateKeyTransitions_("theta_",t)},MouseKeyboardVRDisplay.prototype.animatePhi_=function(t){t=Util.clamp(t,-Math.PI/2,Math.PI/2),this.animateKeyTransitions_("phi_",t)},MouseKeyboardVRDisplay.prototype.animateKeyTransitions_=function(t,i){this.angleAnimation_&&cancelAnimationFrame(this.angleAnimation_);var e=this[t],o=new Date;this.angleAnimation_=requestAnimationFrame(function n(){var a=new Date-o;if(a>=KEY_ANIMATION_DURATION)return this[t]=i,void cancelAnimationFrame(this.angleAnimation_);this.angleAnimation_=requestAnimationFrame(n.bind(this));var s=a/KEY_ANIMATION_DURATION;this[t]=e+(i-e)*s}.bind(this))},MouseKeyboardVRDisplay.prototype.onMouseDown_=function(t){this.rotateStart_.set(t.clientX,t.clientY),this.isDragging_=!0},MouseKeyboardVRDisplay.prototype.onMouseMove_=function(t){if(this.isDragging_||this.isPointerLocked_()){if(this.isPointerLocked_()){var i=t.movementX||t.mozMovementX||0,e=t.movementY||t.mozMovementY||0;this.rotateEnd_.set(this.rotateStart_.x-i,this.rotateStart_.y-e)}else this.rotateEnd_.set(t.clientX,t.clientY);this.rotateDelta_.subVectors(this.rotateEnd_,this.rotateStart_),this.rotateStart_.copy(this.rotateEnd_),this.phi_+=2*Math.PI*this.rotateDelta_.y/screen.height*MOUSE_SPEED_Y,this.theta_+=2*Math.PI*this.rotateDelta_.x/screen.width*MOUSE_SPEED_X,this.phi_=Util.clamp(this.phi_,-Math.PI/2,Math.PI/2)}},MouseKeyboardVRDisplay.prototype.onMouseUp_=function(t){this.isDragging_=!1},MouseKeyboardVRDisplay.prototype.isPointerLocked_=function(){var t=document.pointerLockElement||document.mozPointerLockElement||document.webkitPointerLockElement;return void 0!==t},MouseKeyboardVRDisplay.prototype.resetPose=function(){this.phi_=0,this.theta_=0},module.exports=MouseKeyboardVRDisplay;
  147. },{"./base.js":48,"./math-util.js":59,"./util.js":68}],61:[function(_dereq_,module,exports){
  148. (function (global){
  149. "undefined"!=typeof global&&global.window&&(global.document=global.window.document,global.navigator=global.window.navigator),_dereq_("./main");
  150. }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  151. },{"./main":58}],62:[function(_dereq_,module,exports){
  152. function RotateInstructions(){this.loadIcon_();var M=document.createElement("div"),N=M.style;N.position="fixed",N.top=0,N.right=0,N.bottom=0,N.left=0,N.backgroundColor="gray",N.fontFamily="sans-serif",N.zIndex=1e6;var D=document.createElement("img");D.src=this.icon;var N=D.style;N.marginLeft="25%",N.marginTop="25%",N.width="50%",M.appendChild(D);var j=document.createElement("div"),N=j.style;N.textAlign="center",N.fontSize="16px",N.lineHeight="24px",N.margin="24px 25%",N.width="50%",j.innerHTML="Place your phone into your Cardboard viewer.",M.appendChild(j);var L=document.createElement("div"),N=L.style;N.backgroundColor="#CFD8DC",N.position="fixed",N.bottom=0,N.width="100%",N.height="48px",N.padding="14px 24px",N.boxSizing="border-box",N.color="#656A6B",M.appendChild(L);var I=document.createElement("div");I.style.float="left",I.innerHTML="No Cardboard viewer?";var g=document.createElement("a");g.href="https://www.google.com/get/cardboard/get-cardboard/",g.innerHTML="get one",g.target="_blank";var N=g.style;N.float="right",N.fontWeight=600,N.textTransform="uppercase",N.borderLeft="1px solid gray",N.paddingLeft="24px",N.textDecoration="none",N.color="#656A6B",L.appendChild(I),L.appendChild(g),this.overlay=M,this.text=j,this.hide()}var Util=_dereq_("./util.js");RotateInstructions.prototype.show=function(M){M||this.overlay.parentElement?M&&(this.overlay.parentElement&&this.overlay.parentElement!=M&&this.overlay.parentElement.removeChild(this.overlay),M.appendChild(this.overlay)):document.body.appendChild(this.overlay),this.overlay.style.display="block";var N=this.overlay.querySelector("img"),D=N.style;Util.isLandscapeMode()?(D.width="20%",D.marginLeft="40%",D.marginTop="3%"):(D.width="50%",D.marginLeft="25%",D.marginTop="25%")},RotateInstructions.prototype.hide=function(){this.overlay.style.display="none"},RotateInstructions.prototype.showTemporarily=function(M,N){this.show(N),this.timer=setTimeout(this.hide.bind(this),M)},RotateInstructions.prototype.disableShowTemporarily=function(){clearTimeout(this.timer)},RotateInstructions.prototype.update=function(){this.disableShowTemporarily(),!Util.isLandscapeMode()&&Util.isMobile()?this.show():this.hide()},RotateInstructions.prototype.loadIcon_=function(){this.icon=Util.base64("image/svg+xml","PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9IjE5OHB4IiBoZWlnaHQ9IjI0MHB4IiB2aWV3Qm94PSIwIDAgMTk4IDI0MCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWxuczpza2V0Y2g9Imh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaC9ucyI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDMuMy4zICgxMjA4MSkgLSBodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2ggLS0+CiAgICA8dGl0bGU+dHJhbnNpdGlvbjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPjwvZGVmcz4KICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHNrZXRjaDp0eXBlPSJNU1BhZ2UiPgogICAgICAgIDxnIGlkPSJ0cmFuc2l0aW9uIiBza2V0Y2g6dHlwZT0iTVNBcnRib2FyZEdyb3VwIj4KICAgICAgICAgICAgPGcgaWQ9IkltcG9ydGVkLUxheWVycy1Db3B5LTQtKy1JbXBvcnRlZC1MYXllcnMtQ29weS0rLUltcG9ydGVkLUxheWVycy1Db3B5LTItQ29weSIgc2tldGNoOnR5cGU9Ik1TTGF5ZXJHcm91cCI+CiAgICAgICAgICAgICAgICA8ZyBpZD0iSW1wb3J0ZWQtTGF5ZXJzLUNvcHktNCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMC4wMDAwMDAsIDEwNy4wMDAwMDApIiBza2V0Y2g6dHlwZT0iTVNTaGFwZUdyb3VwIj4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTQ5LjYyNSwyLjUyNyBDMTQ5LjYyNSwyLjUyNyAxNTUuODA1LDYuMDk2IDE1Ni4zNjIsNi40MTggTDE1Ni4zNjIsNy4zMDQgQzE1Ni4zNjIsNy40ODEgMTU2LjM3NSw3LjY2NCAxNTYuNCw3Ljg1MyBDMTU2LjQxLDcuOTM0IDE1Ni40Miw4LjAxNSAxNTYuNDI3LDguMDk1IEMxNTYuNTY3LDkuNTEgMTU3LjQwMSwxMS4wOTMgMTU4LjUzMiwxMi4wOTQgTDE2NC4yNTIsMTcuMTU2IEwxNjQuMzMzLDE3LjA2NiBDMTY0LjMzMywxNy4wNjYgMTY4LjcxNSwxNC41MzYgMTY5LjU2OCwxNC4wNDIgQzE3MS4wMjUsMTQuODgzIDE5NS41MzgsMjkuMDM1IDE5NS41MzgsMjkuMDM1IEwxOTUuNTM4LDgzLjAzNiBDMTk1LjUzOCw4My44MDcgMTk1LjE1Miw4NC4yNTMgMTk0LjU5LDg0LjI1MyBDMTk0LjM1Nyw4NC4yNTMgMTk0LjA5NSw4NC4xNzcgMTkzLjgxOCw4NC4wMTcgTDE2OS44NTEsNzAuMTc5IEwxNjkuODM3LDcwLjIwMyBMMTQyLjUxNSw4NS45NzggTDE0MS42NjUsODQuNjU1IEMxMzYuOTM0LDgzLjEyNiAxMzEuOTE3LDgxLjkxNSAxMjYuNzE0LDgxLjA0NSBDMTI2LjcwOSw4MS4wNiAxMjYuNzA3LDgxLjA2OSAxMjYuNzA3LDgxLjA2OSBMMTIxLjY0LDk4LjAzIEwxMTMuNzQ5LDEwMi41ODYgTDExMy43MTIsMTAyLjUyMyBMMTEzLjcxMiwxMzAuMTEzIEMxMTMuNzEyLDEzMC44ODUgMTEzLjMyNiwxMzEuMzMgMTEyLjc2NCwxMzEuMzMgQzExMi41MzIsMTMxLjMzIDExMi4yNjksMTMxLjI1NCAxMTEuOTkyLDEzMS4wOTQgTDY5LjUxOSwxMDYuNTcyIEM2OC41NjksMTA2LjAyMyA2Ny43OTksMTA0LjY5NSA2Ny43OTksMTAzLjYwNSBMNjcuNzk5LDEwMi41NyBMNjcuNzc4LDEwMi42MTcgQzY3LjI3LDEwMi4zOTMgNjYuNjQ4LDEwMi4yNDkgNjUuOTYyLDEwMi4yMTggQzY1Ljg3NSwxMDIuMjE0IDY1Ljc4OCwxMDIuMjEyIDY1LjcwMSwxMDIuMjEyIEM2NS42MDYsMTAyLjIxMiA2NS41MTEsMTAyLjIxNSA2NS40MTYsMTAyLjIxOSBDNjUuMTk1LDEwMi4yMjkgNjQuOTc0LDEwMi4yMzUgNjQuNzU0LDEwMi4yMzUgQzY0LjMzMSwxMDIuMjM1IDYzLjkxMSwxMDIuMjE2IDYzLjQ5OCwxMDIuMTc4IEM2MS44NDMsMTAyLjAyNSA2MC4yOTgsMTAxLjU3OCA1OS4wOTQsMTAwLjg4MiBMMTIuNTE4LDczLjk5MiBMMTIuNTIzLDc0LjAwNCBMMi4yNDUsNTUuMjU0IEMxLjI0NCw1My40MjcgMi4wMDQsNTEuMDM4IDMuOTQzLDQ5LjkxOCBMNTkuOTU0LDE3LjU3MyBDNjAuNjI2LDE3LjE4NSA2MS4zNSwxNy4wMDEgNjIuMDUzLDE3LjAwMSBDNjMuMzc5LDE3LjAwMSA2NC42MjUsMTcuNjYgNjUuMjgsMTguODU0IEw2NS4yODUsMTguODUxIEw2NS41MTIsMTkuMjY0IEw2NS41MDYsMTkuMjY4IEM2NS45MDksMjAuMDAzIDY2LjQwNSwyMC42OCA2Ni45ODMsMjEuMjg2IEw2Ny4yNiwyMS41NTYgQzY5LjE3NCwyMy40MDYgNzEuNzI4LDI0LjM1NyA3NC4zNzMsMjQuMzU3IEM3Ni4zMjIsMjQuMzU3IDc4LjMyMSwyMy44NCA4MC4xNDgsMjIuNzg1IEM4MC4xNjEsMjIuNzg1IDg3LjQ2NywxOC41NjYgODcuNDY3LDE4LjU2NiBDODguMTM5LDE4LjE3OCA4OC44NjMsMTcuOTk0IDg5LjU2NiwxNy45OTQgQzkwLjg5MiwxNy45OTQgOTIuMTM4LDE4LjY1MiA5Mi43OTIsMTkuODQ3IEw5Ni4wNDIsMjUuNzc1IEw5Ni4wNjQsMjUuNzU3IEwxMDIuODQ5LDI5LjY3NCBMMTAyLjc0NCwyOS40OTIgTDE0OS42MjUsMi41MjcgTTE0OS42MjUsMC44OTIgQzE0OS4zNDMsMC44OTIgMTQ5LjA2MiwwLjk2NSAxNDguODEsMS4xMSBMMTAyLjY0MSwyNy42NjYgTDk3LjIzMSwyNC41NDIgTDk0LjIyNiwxOS4wNjEgQzkzLjMxMywxNy4zOTQgOTEuNTI3LDE2LjM1OSA4OS41NjYsMTYuMzU4IEM4OC41NTUsMTYuMzU4IDg3LjU0NiwxNi42MzIgODYuNjQ5LDE3LjE1IEM4My44NzgsMTguNzUgNzkuNjg3LDIxLjE2OSA3OS4zNzQsMjEuMzQ1IEM3OS4zNTksMjEuMzUzIDc5LjM0NSwyMS4zNjEgNzkuMzMsMjEuMzY5IEM3Ny43OTgsMjIuMjU0IDc2LjA4NCwyMi43MjIgNzQuMzczLDIyLjcyMiBDNzIuMDgxLDIyLjcyMiA2OS45NTksMjEuODkgNjguMzk3LDIwLjM4IEw2OC4xNDUsMjAuMTM1IEM2Ny43MDYsMTkuNjcyIDY3LjMyMywxOS4xNTYgNjcuMDA2LDE4LjYwMSBDNjYuOTg4LDE4LjU1OSA2Ni45NjgsMTguNTE5IDY2Ljk0NiwxOC40NzkgTDY2LjcxOSwxOC4wNjUgQzY2LjY5LDE4LjAxMiA2Ni42NTgsMTcuOTYgNjYuNjI0LDE3LjkxMSBDNjUuNjg2LDE2LjMzNyA2My45NTEsMTUuMzY2IDYyLjA1MywxNS4zNjYgQzYxLjA0MiwxNS4zNjYgNjAuMDMzLDE1LjY0IDU5LjEzNiwxNi4xNTggTDMuMTI1LDQ4LjUwMiBDMC40MjYsNTAuMDYxIC0wLjYxMyw1My40NDIgMC44MTEsNTYuMDQgTDExLjA4OSw3NC43OSBDMTEuMjY2LDc1LjExMyAxMS41MzcsNzUuMzUzIDExLjg1LDc1LjQ5NCBMNTguMjc2LDEwMi4yOTggQzU5LjY3OSwxMDMuMTA4IDYxLjQzMywxMDMuNjMgNjMuMzQ4LDEwMy44MDYgQzYzLjgxMiwxMDMuODQ4IDY0LjI4NSwxMDMuODcgNjQuNzU0LDEwMy44NyBDNjUsMTAzLjg3IDY1LjI0OSwxMDMuODY0IDY1LjQ5NCwxMDMuODUyIEM2NS41NjMsMTAzLjg0OSA2NS42MzIsMTAzLjg0NyA2NS43MDEsMTAzLjg0NyBDNjUuNzY0LDEwMy44NDcgNjUuODI4LDEwMy44NDkgNjUuODksMTAzLjg1MiBDNjUuOTg2LDEwMy44NTYgNjYuMDgsMTAzLjg2MyA2Ni4xNzMsMTAzLjg3NCBDNjYuMjgyLDEwNS40NjcgNjcuMzMyLDEwNy4xOTcgNjguNzAyLDEwNy45ODggTDExMS4xNzQsMTMyLjUxIEMxMTEuNjk4LDEzMi44MTIgMTEyLjIzMiwxMzIuOTY1IDExMi43NjQsMTMyLjk2NSBDMTE0LjI2MSwxMzIuOTY1IDExNS4zNDcsMTMxLjc2NSAxMTUuMzQ3LDEzMC4xMTMgTDExNS4zNDcsMTAzLjU1MSBMMTIyLjQ1OCw5OS40NDYgQzEyMi44MTksOTkuMjM3IDEyMy4wODcsOTguODk4IDEyMy4yMDcsOTguNDk4IEwxMjcuODY1LDgyLjkwNSBDMTMyLjI3OSw4My43MDIgMTM2LjU1Nyw4NC43NTMgMTQwLjYwNyw4Ni4wMzMgTDE0MS4xNCw4Ni44NjIgQzE0MS40NTEsODcuMzQ2IDE0MS45NzcsODcuNjEzIDE0Mi41MTYsODcuNjEzIEMxNDIuNzk0LDg3LjYxMyAxNDMuMDc2LDg3LjU0MiAxNDMuMzMzLDg3LjM5MyBMMTY5Ljg2NSw3Mi4wNzYgTDE5Myw4NS40MzMgQzE5My41MjMsODUuNzM1IDE5NC4wNTgsODUuODg4IDE5NC41OSw4NS44ODggQzE5Ni4wODcsODUuODg4IDE5Ny4xNzMsODQuNjg5IDE5Ny4xNzMsODMuMDM2IEwxOTcuMTczLDI5LjAzNSBDMTk3LjE3MywyOC40NTEgMTk2Ljg2MSwyNy45MTEgMTk2LjM1NSwyNy42MTkgQzE5Ni4zNTUsMjcuNjE5IDE3MS44NDMsMTMuNDY3IDE3MC4zODUsMTIuNjI2IEMxNzAuMTMyLDEyLjQ4IDE2OS44NSwxMi40MDcgMTY5LjU2OCwxMi40MDcgQzE2OS4yODUsMTIuNDA3IDE2OS4wMDIsMTIuNDgxIDE2OC43NDksMTIuNjI3IEMxNjguMTQzLDEyLjk3OCAxNjUuNzU2LDE0LjM1NyAxNjQuNDI0LDE1LjEyNSBMMTU5LjYxNSwxMC44NyBDMTU4Ljc5NiwxMC4xNDUgMTU4LjE1NCw4LjkzNyAxNTguMDU0LDcuOTM0IEMxNTguMDQ1LDcuODM3IDE1OC4wMzQsNy43MzkgMTU4LjAyMSw3LjY0IEMxNTguMDA1LDcuNTIzIDE1Ny45OTgsNy40MSAxNTcuOTk4LDcuMzA0IEwxNTcuOTk4LDYuNDE4IEMxNTcuOTk4LDUuODM0IDE1Ny42ODYsNS4yOTUgMTU3LjE4MSw1LjAwMiBDMTU2LjYyNCw0LjY4IDE1MC40NDIsMS4xMTEgMTUwLjQ0MiwxLjExMSBDMTUwLjE4OSwwLjk2NSAxNDkuOTA3LDAuODkyIDE0OS42MjUsMC44OTIiIGlkPSJGaWxsLTEiIGZpbGw9IiM0NTVBNjQiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNOTYuMDI3LDI1LjYzNiBMMTQyLjYwMyw1Mi41MjcgQzE0My44MDcsNTMuMjIyIDE0NC41ODIsNTQuMTE0IDE0NC44NDUsNTUuMDY4IEwxNDQuODM1LDU1LjA3NSBMNjMuNDYxLDEwMi4wNTcgTDYzLjQ2LDEwMi4wNTcgQzYxLjgwNiwxMDEuOTA1IDYwLjI2MSwxMDEuNDU3IDU5LjA1NywxMDAuNzYyIEwxMi40ODEsNzMuODcxIEw5Ni4wMjcsMjUuNjM2IiBpZD0iRmlsbC0yIiBmaWxsPSIjRkFGQUZBIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTYzLjQ2MSwxMDIuMTc0IEM2My40NTMsMTAyLjE3NCA2My40NDYsMTAyLjE3NCA2My40MzksMTAyLjE3MiBDNjEuNzQ2LDEwMi4wMTYgNjAuMjExLDEwMS41NjMgNTguOTk4LDEwMC44NjMgTDEyLjQyMiw3My45NzMgQzEyLjM4Niw3My45NTIgMTIuMzY0LDczLjkxNCAxMi4zNjQsNzMuODcxIEMxMi4zNjQsNzMuODMgMTIuMzg2LDczLjc5MSAxMi40MjIsNzMuNzcgTDk1Ljk2OCwyNS41MzUgQzk2LjAwNCwyNS41MTQgOTYuMDQ5LDI1LjUxNCA5Ni4wODUsMjUuNTM1IEwxNDIuNjYxLDUyLjQyNiBDMTQzLjg4OCw1My4xMzQgMTQ0LjY4Miw1NC4wMzggMTQ0Ljk1Nyw1NS4wMzcgQzE0NC45Nyw1NS4wODMgMTQ0Ljk1Myw1NS4xMzMgMTQ0LjkxNSw1NS4xNjEgQzE0NC45MTEsNTUuMTY1IDE0NC44OTgsNTUuMTc0IDE0NC44OTQsNTUuMTc3IEw2My41MTksMTAyLjE1OCBDNjMuNTAxLDEwMi4xNjkgNjMuNDgxLDEwMi4xNzQgNjMuNDYxLDEwMi4xNzQgTDYzLjQ2MSwxMDIuMTc0IFogTTEyLjcxNCw3My44NzEgTDU5LjExNSwxMDAuNjYxIEM2MC4yOTMsMTAxLjM0MSA2MS43ODYsMTAxLjc4MiA2My40MzUsMTAxLjkzNyBMMTQ0LjcwNyw1NS4wMTUgQzE0NC40MjgsNTQuMTA4IDE0My42ODIsNTMuMjg1IDE0Mi41NDQsNTIuNjI4IEw5Ni4wMjcsMjUuNzcxIEwxMi43MTQsNzMuODcxIEwxMi43MTQsNzMuODcxIFoiIGlkPSJGaWxsLTMiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTQ4LjMyNyw1OC40NzEgQzE0OC4xNDUsNTguNDggMTQ3Ljk2Miw1OC40OCAxNDcuNzgxLDU4LjQ3MiBDMTQ1Ljg4Nyw1OC4zODkgMTQ0LjQ3OSw1Ny40MzQgMTQ0LjYzNiw1Ni4zNCBDMTQ0LjY4OSw1NS45NjcgMTQ0LjY2NCw1NS41OTcgMTQ0LjU2NCw1NS4yMzUgTDYzLjQ2MSwxMDIuMDU3IEM2NC4wODksMTAyLjExNSA2NC43MzMsMTAyLjEzIDY1LjM3OSwxMDIuMDk5IEM2NS41NjEsMTAyLjA5IDY1Ljc0MywxMDIuMDkgNjUuOTI1LDEwMi4wOTggQzY3LjgxOSwxMDIuMTgxIDY5LjIyNywxMDMuMTM2IDY5LjA3LDEwNC4yMyBMMTQ4LjMyNyw1OC40NzEiIGlkPSJGaWxsLTQiIGZpbGw9IiNGRkZGRkYiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNNjkuMDcsMTA0LjM0NyBDNjkuMDQ4LDEwNC4zNDcgNjkuMDI1LDEwNC4zNCA2OS4wMDUsMTA0LjMyNyBDNjguOTY4LDEwNC4zMDEgNjguOTQ4LDEwNC4yNTcgNjguOTU1LDEwNC4yMTMgQzY5LDEwMy44OTYgNjguODk4LDEwMy41NzYgNjguNjU4LDEwMy4yODggQzY4LjE1MywxMDIuNjc4IDY3LjEwMywxMDIuMjY2IDY1LjkyLDEwMi4yMTQgQzY1Ljc0MiwxMDIuMjA2IDY1LjU2MywxMDIuMjA3IDY1LjM4NSwxMDIuMjE1IEM2NC43NDIsMTAyLjI0NiA2NC4wODcsMTAyLjIzMiA2My40NSwxMDIuMTc0IEM2My4zOTksMTAyLjE2OSA2My4zNTgsMTAyLjEzMiA2My4zNDcsMTAyLjA4MiBDNjMuMzM2LDEwMi4wMzMgNjMuMzU4LDEwMS45ODEgNjMuNDAyLDEwMS45NTYgTDE0NC41MDYsNTUuMTM0IEMxNDQuNTM3LDU1LjExNiAxNDQuNTc1LDU1LjExMyAxNDQuNjA5LDU1LjEyNyBDMTQ0LjY0Miw1NS4xNDEgMTQ0LjY2OCw1NS4xNyAxNDQuNjc3LDU1LjIwNCBDMTQ0Ljc4MSw1NS41ODUgMTQ0LjgwNiw1NS45NzIgMTQ0Ljc1MSw1Ni4zNTcgQzE0NC43MDYsNTYuNjczIDE0NC44MDgsNTYuOTk0IDE0NS4wNDcsNTcuMjgyIEMxNDUuNTUzLDU3Ljg5MiAxNDYuNjAyLDU4LjMwMyAxNDcuNzg2LDU4LjM1NSBDMTQ3Ljk2NCw1OC4zNjMgMTQ4LjE0Myw1OC4zNjMgMTQ4LjMyMSw1OC4zNTQgQzE0OC4zNzcsNTguMzUyIDE0OC40MjQsNTguMzg3IDE0OC40MzksNTguNDM4IEMxNDguNDU0LDU4LjQ5IDE0OC40MzIsNTguNTQ1IDE0OC4zODUsNTguNTcyIEw2OS4xMjksMTA0LjMzMSBDNjkuMTExLDEwNC4zNDIgNjkuMDksMTA0LjM0NyA2OS4wNywxMDQuMzQ3IEw2OS4wNywxMDQuMzQ3IFogTTY1LjY2NSwxMDEuOTc1IEM2NS43NTQsMTAxLjk3NSA2NS44NDIsMTAxLjk3NyA2NS45MywxMDEuOTgxIEM2Ny4xOTYsMTAyLjAzNyA2OC4yODMsMTAyLjQ2OSA2OC44MzgsMTAzLjEzOSBDNjkuMDY1LDEwMy40MTMgNjkuMTg4LDEwMy43MTQgNjkuMTk4LDEwNC4wMjEgTDE0Ny44ODMsNTguNTkyIEMxNDcuODQ3LDU4LjU5MiAxNDcuODExLDU4LjU5MSAxNDcuNzc2LDU4LjU4OSBDMTQ2LjUwOSw1OC41MzMgMTQ1LjQyMiw1OC4xIDE0NC44NjcsNTcuNDMxIEMxNDQuNTg1LDU3LjA5MSAxNDQuNDY1LDU2LjcwNyAxNDQuNTIsNTYuMzI0IEMxNDQuNTYzLDU2LjAyMSAxNDQuNTUyLDU1LjcxNiAxNDQuNDg4LDU1LjQxNCBMNjMuODQ2LDEwMS45NyBDNjQuMzUzLDEwMi4wMDIgNjQuODY3LDEwMi4wMDYgNjUuMzc0LDEwMS45ODIgQzY1LjQ3MSwxMDEuOTc3IDY1LjU2OCwxMDEuOTc1IDY1LjY2NSwxMDEuOTc1IEw2NS42NjUsMTAxLjk3NSBaIiBpZD0iRmlsbC01IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTIuMjA4LDU1LjEzNCBDMS4yMDcsNTMuMzA3IDEuOTY3LDUwLjkxNyAzLjkwNiw0OS43OTcgTDU5LjkxNywxNy40NTMgQzYxLjg1NiwxNi4zMzMgNjQuMjQxLDE2LjkwNyA2NS4yNDMsMTguNzM0IEw2NS40NzUsMTkuMTQ0IEM2NS44NzIsMTkuODgyIDY2LjM2OCwyMC41NiA2Ni45NDUsMjEuMTY1IEw2Ny4yMjMsMjEuNDM1IEM3MC41NDgsMjQuNjQ5IDc1LjgwNiwyNS4xNTEgODAuMTExLDIyLjY2NSBMODcuNDMsMTguNDQ1IEM4OS4zNywxNy4zMjYgOTEuNzU0LDE3Ljg5OSA5Mi43NTUsMTkuNzI3IEw5Ni4wMDUsMjUuNjU1IEwxMi40ODYsNzMuODg0IEwyLjIwOCw1NS4xMzQgWiIgaWQ9IkZpbGwtNiIgZmlsbD0iI0ZBRkFGQSI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xMi40ODYsNzQuMDAxIEMxMi40NzYsNzQuMDAxIDEyLjQ2NSw3My45OTkgMTIuNDU1LDczLjk5NiBDMTIuNDI0LDczLjk4OCAxMi4zOTksNzMuOTY3IDEyLjM4NCw3My45NCBMMi4xMDYsNTUuMTkgQzEuMDc1LDUzLjMxIDEuODU3LDUwLjg0NSAzLjg0OCw0OS42OTYgTDU5Ljg1OCwxNy4zNTIgQzYwLjUyNSwxNi45NjcgNjEuMjcxLDE2Ljc2NCA2Mi4wMTYsMTYuNzY0IEM2My40MzEsMTYuNzY0IDY0LjY2NiwxNy40NjYgNjUuMzI3LDE4LjY0NiBDNjUuMzM3LDE4LjY1NCA2NS4zNDUsMTguNjYzIDY1LjM1MSwxOC42NzQgTDY1LjU3OCwxOS4wODggQzY1LjU4NCwxOS4xIDY1LjU4OSwxOS4xMTIgNjUuNTkxLDE5LjEyNiBDNjUuOTg1LDE5LjgzOCA2Ni40NjksMjAuNDk3IDY3LjAzLDIxLjA4NSBMNjcuMzA1LDIxLjM1MSBDNjkuMTUxLDIzLjEzNyA3MS42NDksMjQuMTIgNzQuMzM2LDI0LjEyIEM3Ni4zMTMsMjQuMTIgNzguMjksMjMuNTgyIDgwLjA1MywyMi41NjMgQzgwLjA2NCwyMi41NTcgODAuMDc2LDIyLjU1MyA4MC4wODgsMjIuNTUgTDg3LjM3MiwxOC4zNDQgQzg4LjAzOCwxNy45NTkgODguNzg0LDE3Ljc1NiA4OS41MjksMTcuNzU2IEM5MC45NTYsMTcuNzU2IDkyLjIwMSwxOC40NzIgOTIuODU4LDE5LjY3IEw5Ni4xMDcsMjUuNTk5IEM5Ni4xMzgsMjUuNjU0IDk2LjExOCwyNS43MjQgOTYuMDYzLDI1Ljc1NiBMMTIuNTQ1LDczLjk4NSBDMTIuNTI2LDczLjk5NiAxMi41MDYsNzQuMDAxIDEyLjQ4Niw3NC4wMDEgTDEyLjQ4Niw3NC4wMDEgWiBNNjIuMDE2LDE2Ljk5NyBDNjEuMzEyLDE2Ljk5NyA2MC42MDYsMTcuMTkgNTkuOTc1LDE3LjU1NCBMMy45NjUsNDkuODk5IEMyLjA4Myw1MC45ODUgMS4zNDEsNTMuMzA4IDIuMzEsNTUuMDc4IEwxMi41MzEsNzMuNzIzIEw5NS44NDgsMjUuNjExIEw5Mi42NTMsMTkuNzgyIEM5Mi4wMzgsMTguNjYgOTAuODcsMTcuOTkgODkuNTI5LDE3Ljk5IEM4OC44MjUsMTcuOTkgODguMTE5LDE4LjE4MiA4Ny40ODksMTguNTQ3IEw4MC4xNzIsMjIuNzcyIEM4MC4xNjEsMjIuNzc4IDgwLjE0OSwyMi43ODIgODAuMTM3LDIyLjc4NSBDNzguMzQ2LDIzLjgxMSA3Ni4zNDEsMjQuMzU0IDc0LjMzNiwyNC4zNTQgQzcxLjU4OCwyNC4zNTQgNjkuMDMzLDIzLjM0NyA2Ny4xNDIsMjEuNTE5IEw2Ni44NjQsMjEuMjQ5IEM2Ni4yNzcsMjAuNjM0IDY1Ljc3NCwxOS45NDcgNjUuMzY3LDE5LjIwMyBDNjUuMzYsMTkuMTkyIDY1LjM1NiwxOS4xNzkgNjUuMzU0LDE5LjE2NiBMNjUuMTYzLDE4LjgxOSBDNjUuMTU0LDE4LjgxMSA2NS4xNDYsMTguODAxIDY1LjE0LDE4Ljc5IEM2NC41MjUsMTcuNjY3IDYzLjM1NywxNi45OTcgNjIuMDE2LDE2Ljk5NyBMNjIuMDE2LDE2Ljk5NyBaIiBpZD0iRmlsbC03IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTQyLjQzNCw0OC44MDggTDQyLjQzNCw0OC44MDggQzM5LjkyNCw0OC44MDcgMzcuNzM3LDQ3LjU1IDM2LjU4Miw0NS40NDMgQzM0Ljc3MSw0Mi4xMzkgMzYuMTQ0LDM3LjgwOSAzOS42NDEsMzUuNzg5IEw1MS45MzIsMjguNjkxIEM1My4xMDMsMjguMDE1IDU0LjQxMywyNy42NTggNTUuNzIxLDI3LjY1OCBDNTguMjMxLDI3LjY1OCA2MC40MTgsMjguOTE2IDYxLjU3MywzMS4wMjMgQzYzLjM4NCwzNC4zMjcgNjIuMDEyLDM4LjY1NyA1OC41MTQsNDAuNjc3IEw0Ni4yMjMsNDcuNzc1IEM0NS4wNTMsNDguNDUgNDMuNzQyLDQ4LjgwOCA0Mi40MzQsNDguODA4IEw0Mi40MzQsNDguODA4IFogTTU1LjcyMSwyOC4xMjUgQzU0LjQ5NSwyOC4xMjUgNTMuMjY1LDI4LjQ2MSA1Mi4xNjYsMjkuMDk2IEwzOS44NzUsMzYuMTk0IEMzNi41OTYsMzguMDg3IDM1LjMwMiw0Mi4xMzYgMzYuOTkyLDQ1LjIxOCBDMzguMDYzLDQ3LjE3MyA0MC4wOTgsNDguMzQgNDIuNDM0LDQ4LjM0IEM0My42NjEsNDguMzQgNDQuODksNDguMDA1IDQ1Ljk5LDQ3LjM3IEw1OC4yODEsNDAuMjcyIEM2MS41NiwzOC4zNzkgNjIuODUzLDM0LjMzIDYxLjE2NCwzMS4yNDggQzYwLjA5MiwyOS4yOTMgNTguMDU4LDI4LjEyNSA1NS43MjEsMjguMTI1IEw1NS43MjEsMjguMTI1IFoiIGlkPSJGaWxsLTgiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTQ5LjU4OCwyLjQwNyBDMTQ5LjU4OCwyLjQwNyAxNTUuNzY4LDUuOTc1IDE1Ni4zMjUsNi4yOTcgTDE1Ni4zMjUsNy4xODQgQzE1Ni4zMjUsNy4zNiAxNTYuMzM4LDcuNTQ0IDE1Ni4zNjIsNy43MzMgQzE1Ni4zNzMsNy44MTQgMTU2LjM4Miw3Ljg5NCAxNTYuMzksNy45NzUgQzE1Ni41Myw5LjM5IDE1Ny4zNjMsMTAuOTczIDE1OC40OTUsMTEuOTc0IEwxNjUuODkxLDE4LjUxOSBDMTY2LjA2OCwxOC42NzUgMTY2LjI0OSwxOC44MTQgMTY2LjQzMiwxOC45MzQgQzE2OC4wMTEsMTkuOTc0IDE2OS4zODIsMTkuNCAxNjkuNDk0LDE3LjY1MiBDMTY5LjU0MywxNi44NjggMTY5LjU1MSwxNi4wNTcgMTY5LjUxNywxNS4yMjMgTDE2OS41MTQsMTUuMDYzIEwxNjkuNTE0LDEzLjkxMiBDMTcwLjc4LDE0LjY0MiAxOTUuNTAxLDI4LjkxNSAxOTUuNTAxLDI4LjkxNSBMMTk1LjUwMSw4Mi45MTUgQzE5NS41MDEsODQuMDA1IDE5NC43MzEsODQuNDQ1IDE5My43ODEsODMuODk3IEwxNTEuMzA4LDU5LjM3NCBDMTUwLjM1OCw1OC44MjYgMTQ5LjU4OCw1Ny40OTcgMTQ5LjU4OCw1Ni40MDggTDE0OS41ODgsMjIuMzc1IiBpZD0iRmlsbC05IiBmaWxsPSIjRkFGQUZBIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTE5NC41NTMsODQuMjUgQzE5NC4yOTYsODQuMjUgMTk0LjAxMyw4NC4xNjUgMTkzLjcyMiw4My45OTcgTDE1MS4yNSw1OS40NzYgQzE1MC4yNjksNTguOTA5IDE0OS40NzEsNTcuNTMzIDE0OS40NzEsNTYuNDA4IEwxNDkuNDcxLDIyLjM3NSBMMTQ5LjcwNSwyMi4zNzUgTDE0OS43MDUsNTYuNDA4IEMxNDkuNzA1LDU3LjQ1OSAxNTAuNDUsNTguNzQ0IDE1MS4zNjYsNTkuMjc0IEwxOTMuODM5LDgzLjc5NSBDMTk0LjI2Myw4NC4wNCAxOTQuNjU1LDg0LjA4MyAxOTQuOTQyLDgzLjkxNyBDMTk1LjIyNyw4My43NTMgMTk1LjM4NCw4My4zOTcgMTk1LjM4NCw4Mi45MTUgTDE5NS4zODQsMjguOTgyIEMxOTQuMTAyLDI4LjI0MiAxNzIuMTA0LDE1LjU0MiAxNjkuNjMxLDE0LjExNCBMMTY5LjYzNCwxNS4yMiBDMTY5LjY2OCwxNi4wNTIgMTY5LjY2LDE2Ljg3NCAxNjkuNjEsMTcuNjU5IEMxNjkuNTU2LDE4LjUwMyAxNjkuMjE0LDE5LjEyMyAxNjguNjQ3LDE5LjQwNSBDMTY4LjAyOCwxOS43MTQgMTY3LjE5NywxOS41NzggMTY2LjM2NywxOS4wMzIgQzE2Ni4xODEsMTguOTA5IDE2NS45OTUsMTguNzY2IDE2NS44MTQsMTguNjA2IEwxNTguNDE3LDEyLjA2MiBDMTU3LjI1OSwxMS4wMzYgMTU2LjQxOCw5LjQzNyAxNTYuMjc0LDcuOTg2IEMxNTYuMjY2LDcuOTA3IDE1Ni4yNTcsNy44MjcgMTU2LjI0Nyw3Ljc0OCBDMTU2LjIyMSw3LjU1NSAxNTYuMjA5LDcuMzY1IDE1Ni4yMDksNy4xODQgTDE1Ni4yMDksNi4zNjQgQzE1NS4zNzUsNS44ODMgMTQ5LjUyOSwyLjUwOCAxNDkuNTI5LDIuNTA4IEwxNDkuNjQ2LDIuMzA2IEMxNDkuNjQ2LDIuMzA2IDE1NS44MjcsNS44NzQgMTU2LjM4NCw2LjE5NiBMMTU2LjQ0Miw2LjIzIEwxNTYuNDQyLDcuMTg0IEMxNTYuNDQyLDcuMzU1IDE1Ni40NTQsNy41MzUgMTU2LjQ3OCw3LjcxNyBDMTU2LjQ4OSw3LjggMTU2LjQ5OSw3Ljg4MiAxNTYuNTA3LDcuOTYzIEMxNTYuNjQ1LDkuMzU4IDE1Ny40NTUsMTAuODk4IDE1OC41NzIsMTEuODg2IEwxNjUuOTY5LDE4LjQzMSBDMTY2LjE0MiwxOC41ODQgMTY2LjMxOSwxOC43MiAxNjYuNDk2LDE4LjgzNyBDMTY3LjI1NCwxOS4zMzYgMTY4LDE5LjQ2NyAxNjguNTQzLDE5LjE5NiBDMTY5LjAzMywxOC45NTMgMTY5LjMyOSwxOC40MDEgMTY5LjM3NywxNy42NDUgQzE2OS40MjcsMTYuODY3IDE2OS40MzQsMTYuMDU0IDE2OS40MDEsMTUuMjI4IEwxNjkuMzk3LDE1LjA2NSBMMTY5LjM5NywxMy43MSBMMTY5LjU3MiwxMy44MSBDMTcwLjgzOSwxNC41NDEgMTk1LjU1OSwyOC44MTQgMTk1LjU1OSwyOC44MTQgTDE5NS42MTgsMjguODQ3IEwxOTUuNjE4LDgyLjkxNSBDMTk1LjYxOCw4My40ODQgMTk1LjQyLDgzLjkxMSAxOTUuMDU5LDg0LjExOSBDMTk0LjkwOCw4NC4yMDYgMTk0LjczNyw4NC4yNSAxOTQuNTUzLDg0LjI1IiBpZD0iRmlsbC0xMCIgZmlsbD0iIzYwN0Q4QiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xNDUuNjg1LDU2LjE2MSBMMTY5LjgsNzAuMDgzIEwxNDMuODIyLDg1LjA4MSBMMTQyLjM2LDg0Ljc3NCBDMTM1LjgyNiw4Mi42MDQgMTI4LjczMiw4MS4wNDYgMTIxLjM0MSw4MC4xNTggQzExNi45NzYsNzkuNjM0IDExMi42NzgsODEuMjU0IDExMS43NDMsODMuNzc4IEMxMTEuNTA2LDg0LjQxNCAxMTEuNTAzLDg1LjA3MSAxMTEuNzMyLDg1LjcwNiBDMTEzLjI3LDg5Ljk3MyAxMTUuOTY4LDk0LjA2OSAxMTkuNzI3LDk3Ljg0MSBMMTIwLjI1OSw5OC42ODYgQzEyMC4yNiw5OC42ODUgOTQuMjgyLDExMy42ODMgOTQuMjgyLDExMy42ODMgTDcwLjE2Nyw5OS43NjEgTDE0NS42ODUsNTYuMTYxIiBpZD0iRmlsbC0xMSIgZmlsbD0iI0ZGRkZGRiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik05NC4yODIsMTEzLjgxOCBMOTQuMjIzLDExMy43ODUgTDY5LjkzMyw5OS43NjEgTDcwLjEwOCw5OS42NiBMMTQ1LjY4NSw1Ni4wMjYgTDE0NS43NDMsNTYuMDU5IEwxNzAuMDMzLDcwLjA4MyBMMTQzLjg0Miw4NS4yMDUgTDE0My43OTcsODUuMTk1IEMxNDMuNzcyLDg1LjE5IDE0Mi4zMzYsODQuODg4IDE0Mi4zMzYsODQuODg4IEMxMzUuNzg3LDgyLjcxNCAxMjguNzIzLDgxLjE2MyAxMjEuMzI3LDgwLjI3NCBDMTIwLjc4OCw4MC4yMDkgMTIwLjIzNiw4MC4xNzcgMTE5LjY4OSw4MC4xNzcgQzExNS45MzEsODAuMTc3IDExMi42MzUsODEuNzA4IDExMS44NTIsODMuODE5IEMxMTEuNjI0LDg0LjQzMiAxMTEuNjIxLDg1LjA1MyAxMTEuODQyLDg1LjY2NyBDMTEzLjM3Nyw4OS45MjUgMTE2LjA1OCw5My45OTMgMTE5LjgxLDk3Ljc1OCBMMTE5LjgyNiw5Ny43NzkgTDEyMC4zNTIsOTguNjE0IEMxMjAuMzU0LDk4LjYxNyAxMjAuMzU2LDk4LjYyIDEyMC4zNTgsOTguNjI0IEwxMjAuNDIyLDk4LjcyNiBMMTIwLjMxNyw5OC43ODcgQzEyMC4yNjQsOTguODE4IDk0LjU5OSwxMTMuNjM1IDk0LjM0LDExMy43ODUgTDk0LjI4MiwxMTMuODE4IEw5NC4yODIsMTEzLjgxOCBaIE03MC40MDEsOTkuNzYxIEw5NC4yODIsMTEzLjU0OSBMMTE5LjA4NCw5OS4yMjkgQzExOS42Myw5OC45MTQgMTE5LjkzLDk4Ljc0IDEyMC4xMDEsOTguNjU0IEwxMTkuNjM1LDk3LjkxNCBDMTE1Ljg2NCw5NC4xMjcgMTEzLjE2OCw5MC4wMzMgMTExLjYyMiw4NS43NDYgQzExMS4zODIsODUuMDc5IDExMS4zODYsODQuNDA0IDExMS42MzMsODMuNzM4IEMxMTIuNDQ4LDgxLjUzOSAxMTUuODM2LDc5Ljk0MyAxMTkuNjg5LDc5Ljk0MyBDMTIwLjI0Niw3OS45NDMgMTIwLjgwNiw3OS45NzYgMTIxLjM1NSw4MC4wNDIgQzEyOC43NjcsODAuOTMzIDEzNS44NDYsODIuNDg3IDE0Mi4zOTYsODQuNjYzIEMxNDMuMjMyLDg0LjgzOCAxNDMuNjExLDg0LjkxNyAxNDMuNzg2LDg0Ljk2NyBMMTY5LjU2Niw3MC4wODMgTDE0NS42ODUsNTYuMjk1IEw3MC40MDEsOTkuNzYxIEw3MC40MDEsOTkuNzYxIFoiIGlkPSJGaWxsLTEyIiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTE2Ny4yMywxOC45NzkgTDE2Ny4yMyw2OS44NSBMMTM5LjkwOSw4NS42MjMgTDEzMy40NDgsNzEuNDU2IEMxMzIuNTM4LDY5LjQ2IDEzMC4wMiw2OS43MTggMTI3LjgyNCw3Mi4wMyBDMTI2Ljc2OSw3My4xNCAxMjUuOTMxLDc0LjU4NSAxMjUuNDk0LDc2LjA0OCBMMTE5LjAzNCw5Ny42NzYgTDkxLjcxMiwxMTMuNDUgTDkxLjcxMiw2Mi41NzkgTDE2Ny4yMywxOC45NzkiIGlkPSJGaWxsLTEzIiBmaWxsPSIjRkZGRkZGIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTkxLjcxMiwxMTMuNTY3IEM5MS42OTIsMTEzLjU2NyA5MS42NzIsMTEzLjU2MSA5MS42NTMsMTEzLjU1MSBDOTEuNjE4LDExMy41MyA5MS41OTUsMTEzLjQ5MiA5MS41OTUsMTEzLjQ1IEw5MS41OTUsNjIuNTc5IEM5MS41OTUsNjIuNTM3IDkxLjYxOCw2Mi40OTkgOTEuNjUzLDYyLjQ3OCBMMTY3LjE3MiwxOC44NzggQzE2Ny4yMDgsMTguODU3IDE2Ny4yNTIsMTguODU3IDE2Ny4yODgsMTguODc4IEMxNjcuMzI0LDE4Ljg5OSAxNjcuMzQ3LDE4LjkzNyAxNjcuMzQ3LDE4Ljk3OSBMMTY3LjM0Nyw2OS44NSBDMTY3LjM0Nyw2OS44OTEgMTY3LjMyNCw2OS45MyAxNjcuMjg4LDY5Ljk1IEwxMzkuOTY3LDg1LjcyNSBDMTM5LjkzOSw4NS43NDEgMTM5LjkwNSw4NS43NDUgMTM5Ljg3Myw4NS43MzUgQzEzOS44NDIsODUuNzI1IDEzOS44MTYsODUuNzAyIDEzOS44MDIsODUuNjcyIEwxMzMuMzQyLDcxLjUwNCBDMTMyLjk2Nyw3MC42ODIgMTMyLjI4LDcwLjIyOSAxMzEuNDA4LDcwLjIyOSBDMTMwLjMxOSw3MC4yMjkgMTI5LjA0NCw3MC45MTUgMTI3LjkwOCw3Mi4xMSBDMTI2Ljg3NCw3My4yIDEyNi4wMzQsNzQuNjQ3IDEyNS42MDYsNzYuMDgyIEwxMTkuMTQ2LDk3LjcwOSBDMTE5LjEzNyw5Ny43MzggMTE5LjExOCw5Ny43NjIgMTE5LjA5Miw5Ny43NzcgTDkxLjc3LDExMy41NTEgQzkxLjc1MiwxMTMuNTYxIDkxLjczMiwxMTMuNTY3IDkxLjcxMiwxMTMuNTY3IEw5MS43MTIsMTEzLjU2NyBaIE05MS44MjksNjIuNjQ3IEw5MS44MjksMTEzLjI0OCBMMTE4LjkzNSw5Ny41OTggTDEyNS4zODIsNzYuMDE1IEMxMjUuODI3LDc0LjUyNSAxMjYuNjY0LDczLjA4MSAxMjcuNzM5LDcxLjk1IEMxMjguOTE5LDcwLjcwOCAxMzAuMjU2LDY5Ljk5NiAxMzEuNDA4LDY5Ljk5NiBDMTMyLjM3Nyw2OS45OTYgMTMzLjEzOSw3MC40OTcgMTMzLjU1NCw3MS40MDcgTDEzOS45NjEsODUuNDU4IEwxNjcuMTEzLDY5Ljc4MiBMMTY3LjExMywxOS4xODEgTDkxLjgyOSw2Mi42NDcgTDkxLjgyOSw2Mi42NDcgWiIgaWQ9IkZpbGwtMTQiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTY4LjU0MywxOS4yMTMgTDE2OC41NDMsNzAuMDgzIEwxNDEuMjIxLDg1Ljg1NyBMMTM0Ljc2MSw3MS42ODkgQzEzMy44NTEsNjkuNjk0IDEzMS4zMzMsNjkuOTUxIDEyOS4xMzcsNzIuMjYzIEMxMjguMDgyLDczLjM3NCAxMjcuMjQ0LDc0LjgxOSAxMjYuODA3LDc2LjI4MiBMMTIwLjM0Niw5Ny45MDkgTDkzLjAyNSwxMTMuNjgzIEw5My4wMjUsNjIuODEzIEwxNjguNTQzLDE5LjIxMyIgaWQ9IkZpbGwtMTUiIGZpbGw9IiNGRkZGRkYiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNOTMuMDI1LDExMy44IEM5My4wMDUsMTEzLjggOTIuOTg0LDExMy43OTUgOTIuOTY2LDExMy43ODUgQzkyLjkzMSwxMTMuNzY0IDkyLjkwOCwxMTMuNzI1IDkyLjkwOCwxMTMuNjg0IEw5Mi45MDgsNjIuODEzIEM5Mi45MDgsNjIuNzcxIDkyLjkzMSw2Mi43MzMgOTIuOTY2LDYyLjcxMiBMMTY4LjQ4NCwxOS4xMTIgQzE2OC41MiwxOS4wOSAxNjguNTY1LDE5LjA5IDE2OC42MDEsMTkuMTEyIEMxNjguNjM3LDE5LjEzMiAxNjguNjYsMTkuMTcxIDE2OC42NiwxOS4yMTIgTDE2OC42Niw3MC4wODMgQzE2OC42Niw3MC4xMjUgMTY4LjYzNyw3MC4xNjQgMTY4LjYwMSw3MC4xODQgTDE0MS4yOCw4NS45NTggQzE0MS4yNTEsODUuOTc1IDE0MS4yMTcsODUuOTc5IDE0MS4xODYsODUuOTY4IEMxNDEuMTU0LDg1Ljk1OCAxNDEuMTI5LDg1LjkzNiAxNDEuMTE1LDg1LjkwNiBMMTM0LjY1NSw3MS43MzggQzEzNC4yOCw3MC45MTUgMTMzLjU5Myw3MC40NjMgMTMyLjcyLDcwLjQ2MyBDMTMxLjYzMiw3MC40NjMgMTMwLjM1Nyw3MS4xNDggMTI5LjIyMSw3Mi4zNDQgQzEyOC4xODYsNzMuNDMzIDEyNy4zNDcsNzQuODgxIDEyNi45MTksNzYuMzE1IEwxMjAuNDU4LDk3Ljk0MyBDMTIwLjQ1LDk3Ljk3MiAxMjAuNDMxLDk3Ljk5NiAxMjAuNDA1LDk4LjAxIEw5My4wODMsMTEzLjc4NSBDOTMuMDY1LDExMy43OTUgOTMuMDQ1LDExMy44IDkzLjAyNSwxMTMuOCBMOTMuMDI1LDExMy44IFogTTkzLjE0Miw2Mi44ODEgTDkzLjE0MiwxMTMuNDgxIEwxMjAuMjQ4LDk3LjgzMiBMMTI2LjY5NSw3Ni4yNDggQzEyNy4xNCw3NC43NTggMTI3Ljk3Nyw3My4zMTUgMTI5LjA1Miw3Mi4xODMgQzEzMC4yMzEsNzAuOTQyIDEzMS41NjgsNzAuMjI5IDEzMi43Miw3MC4yMjkgQzEzMy42ODksNzAuMjI5IDEzNC40NTIsNzAuNzMxIDEzNC44NjcsNzEuNjQxIEwxNDEuMjc0LDg1LjY5MiBMMTY4LjQyNiw3MC4wMTYgTDE2OC40MjYsMTkuNDE1IEw5My4xNDIsNjIuODgxIEw5My4xNDIsNjIuODgxIFoiIGlkPSJGaWxsLTE2IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTE2OS44LDcwLjA4MyBMMTQyLjQ3OCw4NS44NTcgTDEzNi4wMTgsNzEuNjg5IEMxMzUuMTA4LDY5LjY5NCAxMzIuNTksNjkuOTUxIDEzMC4zOTMsNzIuMjYzIEMxMjkuMzM5LDczLjM3NCAxMjguNSw3NC44MTkgMTI4LjA2NCw3Ni4yODIgTDEyMS42MDMsOTcuOTA5IEw5NC4yODIsMTEzLjY4MyBMOTQuMjgyLDYyLjgxMyBMMTY5LjgsMTkuMjEzIEwxNjkuOCw3MC4wODMgWiIgaWQ9IkZpbGwtMTciIGZpbGw9IiNGQUZBRkEiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNOTQuMjgyLDExMy45MTcgQzk0LjI0MSwxMTMuOTE3IDk0LjIwMSwxMTMuOTA3IDk0LjE2NSwxMTMuODg2IEM5NC4wOTMsMTEzLjg0NSA5NC4wNDgsMTEzLjc2NyA5NC4wNDgsMTEzLjY4NCBMOTQuMDQ4LDYyLjgxMyBDOTQuMDQ4LDYyLjczIDk0LjA5Myw2Mi42NTIgOTQuMTY1LDYyLjYxMSBMMTY5LjY4MywxOS4wMSBDMTY5Ljc1NSwxOC45NjkgMTY5Ljg0NCwxOC45NjkgMTY5LjkxNywxOS4wMSBDMTY5Ljk4OSwxOS4wNTIgMTcwLjAzMywxOS4xMjkgMTcwLjAzMywxOS4yMTIgTDE3MC4wMzMsNzAuMDgzIEMxNzAuMDMzLDcwLjE2NiAxNjkuOTg5LDcwLjI0NCAxNjkuOTE3LDcwLjI4NSBMMTQyLjU5NSw4Ni4wNiBDMTQyLjUzOCw4Ni4wOTIgMTQyLjQ2OSw4Ni4xIDE0Mi40MDcsODYuMDggQzE0Mi4zNDQsODYuMDYgMTQyLjI5Myw4Ni4wMTQgMTQyLjI2Niw4NS45NTQgTDEzNS44MDUsNzEuNzg2IEMxMzUuNDQ1LDcwLjk5NyAxMzQuODEzLDcwLjU4IDEzMy45NzcsNzAuNTggQzEzMi45MjEsNzAuNTggMTMxLjY3Niw3MS4yNTIgMTMwLjU2Miw3Mi40MjQgQzEyOS41NCw3My41MDEgMTI4LjcxMSw3NC45MzEgMTI4LjI4Nyw3Ni4zNDggTDEyMS44MjcsOTcuOTc2IEMxMjEuODEsOTguMDM0IDEyMS43NzEsOTguMDgyIDEyMS43Miw5OC4xMTIgTDk0LjM5OCwxMTMuODg2IEM5NC4zNjIsMTEzLjkwNyA5NC4zMjIsMTEzLjkxNyA5NC4yODIsMTEzLjkxNyBMOTQuMjgyLDExMy45MTcgWiBNOTQuNTE1LDYyLjk0OCBMOTQuNTE1LDExMy4yNzkgTDEyMS40MDYsOTcuNzU0IEwxMjcuODQsNzYuMjE1IEMxMjguMjksNzQuNzA4IDEyOS4xMzcsNzMuMjQ3IDEzMC4yMjQsNzIuMTAzIEMxMzEuNDI1LDcwLjgzOCAxMzIuNzkzLDcwLjExMiAxMzMuOTc3LDcwLjExMiBDMTM0Ljk5NSw3MC4xMTIgMTM1Ljc5NSw3MC42MzggMTM2LjIzLDcxLjU5MiBMMTQyLjU4NCw4NS41MjYgTDE2OS41NjYsNjkuOTQ4IEwxNjkuNTY2LDE5LjYxNyBMOTQuNTE1LDYyLjk0OCBMOTQuNTE1LDYyLjk0OCBaIiBpZD0iRmlsbC0xOCIgZmlsbD0iIzYwN0Q4QiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xMDkuODk0LDkyLjk0MyBMMTA5Ljg5NCw5Mi45NDMgQzEwOC4xMiw5Mi45NDMgMTA2LjY1Myw5Mi4yMTggMTA1LjY1LDkwLjgyMyBDMTA1LjU4Myw5MC43MzEgMTA1LjU5Myw5MC42MSAxMDUuNjczLDkwLjUyOSBDMTA1Ljc1Myw5MC40NDggMTA1Ljg4LDkwLjQ0IDEwNS45NzQsOTAuNTA2IEMxMDYuNzU0LDkxLjA1MyAxMDcuNjc5LDkxLjMzMyAxMDguNzI0LDkxLjMzMyBDMTEwLjA0Nyw5MS4zMzMgMTExLjQ3OCw5MC44OTQgMTEyLjk4LDkwLjAyNyBDMTE4LjI5MSw4Ni45NiAxMjIuNjExLDc5LjUwOSAxMjIuNjExLDczLjQxNiBDMTIyLjYxMSw3MS40ODkgMTIyLjE2OSw2OS44NTYgMTIxLjMzMyw2OC42OTIgQzEyMS4yNjYsNjguNiAxMjEuMjc2LDY4LjQ3MyAxMjEuMzU2LDY4LjM5MiBDMTIxLjQzNiw2OC4zMTEgMTIxLjU2Myw2OC4yOTkgMTIxLjY1Niw2OC4zNjUgQzEyMy4zMjcsNjkuNTM3IDEyNC4yNDcsNzEuNzQ2IDEyNC4yNDcsNzQuNTg0IEMxMjQuMjQ3LDgwLjgyNiAxMTkuODIxLDg4LjQ0NyAxMTQuMzgyLDkxLjU4NyBDMTEyLjgwOCw5Mi40OTUgMTExLjI5OCw5Mi45NDMgMTA5Ljg5NCw5Mi45NDMgTDEwOS44OTQsOTIuOTQzIFogTTEwNi45MjUsOTEuNDAxIEMxMDcuNzM4LDkyLjA1MiAxMDguNzQ1LDkyLjI3OCAxMDkuODkzLDkyLjI3OCBMMTA5Ljg5NCw5Mi4yNzggQzExMS4yMTUsOTIuMjc4IDExMi42NDcsOTEuOTUxIDExNC4xNDgsOTEuMDg0IEMxMTkuNDU5LDg4LjAxNyAxMjMuNzgsODAuNjIxIDEyMy43OCw3NC41MjggQzEyMy43OCw3Mi41NDkgMTIzLjMxNyw3MC45MjkgMTIyLjQ1NCw2OS43NjcgQzEyMi44NjUsNzAuODAyIDEyMy4wNzksNzIuMDQyIDEyMy4wNzksNzMuNDAyIEMxMjMuMDc5LDc5LjY0NSAxMTguNjUzLDg3LjI4NSAxMTMuMjE0LDkwLjQyNSBDMTExLjY0LDkxLjMzNCAxMTAuMTMsOTEuNzQyIDEwOC43MjQsOTEuNzQyIEMxMDguMDgzLDkxLjc0MiAxMDcuNDgxLDkxLjU5MyAxMDYuOTI1LDkxLjQwMSBMMTA2LjkyNSw5MS40MDEgWiIgaWQ9IkZpbGwtMTkiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTEzLjA5Nyw5MC4yMyBDMTE4LjQ4MSw4Ny4xMjIgMTIyLjg0NSw3OS41OTQgMTIyLjg0NSw3My40MTYgQzEyMi44NDUsNzEuMzY1IDEyMi4zNjIsNjkuNzI0IDEyMS41MjIsNjguNTU2IEMxMTkuNzM4LDY3LjMwNCAxMTcuMTQ4LDY3LjM2MiAxMTQuMjY1LDY5LjAyNiBDMTA4Ljg4MSw3Mi4xMzQgMTA0LjUxNyw3OS42NjIgMTA0LjUxNyw4NS44NCBDMTA0LjUxNyw4Ny44OTEgMTA1LDg5LjUzMiAxMDUuODQsOTAuNyBDMTA3LjYyNCw5MS45NTIgMTEwLjIxNCw5MS44OTQgMTEzLjA5Nyw5MC4yMyIgaWQ9IkZpbGwtMjAiIGZpbGw9IiNGQUZBRkEiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTA4LjcyNCw5MS42MTQgTDEwOC43MjQsOTEuNjE0IEMxMDcuNTgyLDkxLjYxNCAxMDYuNTY2LDkxLjQwMSAxMDUuNzA1LDkwLjc5NyBDMTA1LjY4NCw5MC43ODMgMTA1LjY2NSw5MC44MTEgMTA1LjY1LDkwLjc5IEMxMDQuNzU2LDg5LjU0NiAxMDQuMjgzLDg3Ljg0MiAxMDQuMjgzLDg1LjgxNyBDMTA0LjI4Myw3OS41NzUgMTA4LjcwOSw3MS45NTMgMTE0LjE0OCw2OC44MTIgQzExNS43MjIsNjcuOTA0IDExNy4yMzIsNjcuNDQ5IDExOC42MzgsNjcuNDQ5IEMxMTkuNzgsNjcuNDQ5IDEyMC43OTYsNjcuNzU4IDEyMS42NTYsNjguMzYyIEMxMjEuNjc4LDY4LjM3NyAxMjEuNjk3LDY4LjM5NyAxMjEuNzEyLDY4LjQxOCBDMTIyLjYwNiw2OS42NjIgMTIzLjA3OSw3MS4zOSAxMjMuMDc5LDczLjQxNSBDMTIzLjA3OSw3OS42NTggMTE4LjY1Myw4Ny4xOTggMTEzLjIxNCw5MC4zMzggQzExMS42NCw5MS4yNDcgMTEwLjEzLDkxLjYxNCAxMDguNzI0LDkxLjYxNCBMMTA4LjcyNCw5MS42MTQgWiBNMTA2LjAwNiw5MC41MDUgQzEwNi43OCw5MS4wMzcgMTA3LjY5NCw5MS4yODEgMTA4LjcyNCw5MS4yODEgQzExMC4wNDcsOTEuMjgxIDExMS40NzgsOTAuODY4IDExMi45OCw5MC4wMDEgQzExOC4yOTEsODYuOTM1IDEyMi42MTEsNzkuNDk2IDEyMi42MTEsNzMuNDAzIEMxMjIuNjExLDcxLjQ5NCAxMjIuMTc3LDY5Ljg4IDEyMS4zNTYsNjguNzE4IEMxMjAuNTgyLDY4LjE4NSAxMTkuNjY4LDY3LjkxOSAxMTguNjM4LDY3LjkxOSBDMTE3LjMxNSw2Ny45MTkgMTE1Ljg4Myw2OC4zNiAxMTQuMzgyLDY5LjIyNyBDMTA5LjA3MSw3Mi4yOTMgMTA0Ljc1MSw3OS43MzMgMTA0Ljc1MSw4NS44MjYgQzEwNC43NTEsODcuNzM1IDEwNS4xODUsODkuMzQzIDEwNi4wMDYsOTAuNTA1IEwxMDYuMDA2LDkwLjUwNSBaIiBpZD0iRmlsbC0yMSIgZmlsbD0iIzYwN0Q4QiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xNDkuMzE4LDcuMjYyIEwxMzkuMzM0LDE2LjE0IEwxNTUuMjI3LDI3LjE3MSBMMTYwLjgxNiwyMS4wNTkgTDE0OS4zMTgsNy4yNjIiIGlkPSJGaWxsLTIyIiBmaWxsPSIjRkFGQUZBIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTE2OS42NzYsMTMuODQgTDE1OS45MjgsMTkuNDY3IEMxNTYuMjg2LDIxLjU3IDE1MC40LDIxLjU4IDE0Ni43ODEsMTkuNDkxIEMxNDMuMTYxLDE3LjQwMiAxNDMuMTgsMTQuMDAzIDE0Ni44MjIsMTEuOSBMMTU2LjMxNyw2LjI5MiBMMTQ5LjU4OCwyLjQwNyBMNjcuNzUyLDQ5LjQ3OCBMMTEzLjY3NSw3NS45OTIgTDExNi43NTYsNzQuMjEzIEMxMTcuMzg3LDczLjg0OCAxMTcuNjI1LDczLjMxNSAxMTcuMzc0LDcyLjgyMyBDMTE1LjAxNyw2OC4xOTEgMTE0Ljc4MSw2My4yNzcgMTE2LjY5MSw1OC41NjEgQzEyMi4zMjksNDQuNjQxIDE0MS4yLDMzLjc0NiAxNjUuMzA5LDMwLjQ5MSBDMTczLjQ3OCwyOS4zODggMTgxLjk4OSwyOS41MjQgMTkwLjAxMywzMC44ODUgQzE5MC44NjUsMzEuMDMgMTkxLjc4OSwzMC44OTMgMTkyLjQyLDMwLjUyOCBMMTk1LjUwMSwyOC43NSBMMTY5LjY3NiwxMy44NCIgaWQ9IkZpbGwtMjMiIGZpbGw9IiNGQUZBRkEiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTEzLjY3NSw3Ni40NTkgQzExMy41OTQsNzYuNDU5IDExMy41MTQsNzYuNDM4IDExMy40NDIsNzYuMzk3IEw2Ny41MTgsNDkuODgyIEM2Ny4zNzQsNDkuNzk5IDY3LjI4NCw0OS42NDUgNjcuMjg1LDQ5LjQ3OCBDNjcuMjg1LDQ5LjMxMSA2Ny4zNzQsNDkuMTU3IDY3LjUxOSw0OS4wNzMgTDE0OS4zNTUsMi4wMDIgQzE0OS40OTksMS45MTkgMTQ5LjY3NywxLjkxOSAxNDkuODIxLDIuMDAyIEwxNTYuNTUsNS44ODcgQzE1Ni43NzQsNi4wMTcgMTU2Ljg1LDYuMzAyIDE1Ni43MjIsNi41MjYgQzE1Ni41OTIsNi43NDkgMTU2LjMwNyw2LjgyNiAxNTYuMDgzLDYuNjk2IEwxNDkuNTg3LDIuOTQ2IEw2OC42ODcsNDkuNDc5IEwxMTMuNjc1LDc1LjQ1MiBMMTE2LjUyMyw3My44MDggQzExNi43MTUsNzMuNjk3IDExNy4xNDMsNzMuMzk5IDExNi45NTgsNzMuMDM1IEMxMTQuNTQyLDY4LjI4NyAxMTQuMyw2My4yMjEgMTE2LjI1OCw1OC4zODUgQzExOS4wNjQsNTEuNDU4IDEyNS4xNDMsNDUuMTQzIDEzMy44NCw0MC4xMjIgQzE0Mi40OTcsMzUuMTI0IDE1My4zNTgsMzEuNjMzIDE2NS4yNDcsMzAuMDI4IEMxNzMuNDQ1LDI4LjkyMSAxODIuMDM3LDI5LjA1OCAxOTAuMDkxLDMwLjQyNSBDMTkwLjgzLDMwLjU1IDE5MS42NTIsMzAuNDMyIDE5Mi4xODYsMzAuMTI0IEwxOTQuNTY3LDI4Ljc1IEwxNjkuNDQyLDE0LjI0NCBDMTY5LjIxOSwxNC4xMTUgMTY5LjE0MiwxMy44MjkgMTY5LjI3MSwxMy42MDYgQzE2OS40LDEzLjM4MiAxNjkuNjg1LDEzLjMwNiAxNjkuOTA5LDEzLjQzNSBMMTk1LjczNCwyOC4zNDUgQzE5NS44NzksMjguNDI4IDE5NS45NjgsMjguNTgzIDE5NS45NjgsMjguNzUgQzE5NS45NjgsMjguOTE2IDE5NS44NzksMjkuMDcxIDE5NS43MzQsMjkuMTU0IEwxOTIuNjUzLDMwLjkzMyBDMTkxLjkzMiwzMS4zNSAxOTAuODksMzEuNTA4IDE4OS45MzUsMzEuMzQ2IEMxODEuOTcyLDI5Ljk5NSAxNzMuNDc4LDI5Ljg2IDE2NS4zNzIsMzAuOTU0IEMxNTMuNjAyLDMyLjU0MyAxNDIuODYsMzUuOTkzIDEzNC4zMDcsNDAuOTMxIEMxMjUuNzkzLDQ1Ljg0NyAxMTkuODUxLDUyLjAwNCAxMTcuMTI0LDU4LjczNiBDMTE1LjI3LDYzLjMxNCAxMTUuNTAxLDY4LjExMiAxMTcuNzksNzIuNjExIEMxMTguMTYsNzMuMzM2IDExNy44NDUsNzQuMTI0IDExNi45OSw3NC42MTcgTDExMy45MDksNzYuMzk3IEMxMTMuODM2LDc2LjQzOCAxMTMuNzU2LDc2LjQ1OSAxMTMuNjc1LDc2LjQ1OSIgaWQ9IkZpbGwtMjQiIGZpbGw9IiM0NTVBNjQiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTUzLjMxNiwyMS4yNzkgQzE1MC45MDMsMjEuMjc5IDE0OC40OTUsMjAuNzUxIDE0Ni42NjQsMTkuNjkzIEMxNDQuODQ2LDE4LjY0NCAxNDMuODQ0LDE3LjIzMiAxNDMuODQ0LDE1LjcxOCBDMTQzLjg0NCwxNC4xOTEgMTQ0Ljg2LDEyLjc2MyAxNDYuNzA1LDExLjY5OCBMMTU2LjE5OCw2LjA5MSBDMTU2LjMwOSw2LjAyNSAxNTYuNDUyLDYuMDYyIDE1Ni41MTgsNi4xNzMgQzE1Ni41ODMsNi4yODQgMTU2LjU0Nyw2LjQyNyAxNTYuNDM2LDYuNDkzIEwxNDYuOTQsMTIuMTAyIEMxNDUuMjQ0LDEzLjA4MSAxNDQuMzEyLDE0LjM2NSAxNDQuMzEyLDE1LjcxOCBDMTQ0LjMxMiwxNy4wNTggMTQ1LjIzLDE4LjMyNiAxNDYuODk3LDE5LjI4OSBDMTUwLjQ0NiwyMS4zMzggMTU2LjI0LDIxLjMyNyAxNTkuODExLDE5LjI2NSBMMTY5LjU1OSwxMy42MzcgQzE2OS42NywxMy41NzMgMTY5LjgxMywxMy42MTEgMTY5Ljg3OCwxMy43MjMgQzE2OS45NDMsMTMuODM0IDE2OS45MDQsMTMuOTc3IDE2OS43OTMsMTQuMDQyIEwxNjAuMDQ1LDE5LjY3IEMxNTguMTg3LDIwLjc0MiAxNTUuNzQ5LDIxLjI3OSAxNTMuMzE2LDIxLjI3OSIgaWQ9IkZpbGwtMjUiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTEzLjY3NSw3NS45OTIgTDY3Ljc2Miw0OS40ODQiIGlkPSJGaWxsLTI2IiBmaWxsPSIjNDU1QTY0Ij48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTExMy42NzUsNzYuMzQyIEMxMTMuNjE1LDc2LjM0MiAxMTMuNTU1LDc2LjMyNyAxMTMuNSw3Ni4yOTUgTDY3LjU4Nyw0OS43ODcgQzY3LjQxOSw0OS42OSA2Ny4zNjIsNDkuNDc2IDY3LjQ1OSw0OS4zMDkgQzY3LjU1Niw0OS4xNDEgNjcuNzcsNDkuMDgzIDY3LjkzNyw0OS4xOCBMMTEzLjg1LDc1LjY4OCBDMTE0LjAxOCw3NS43ODUgMTE0LjA3NSw3NiAxMTMuOTc4LDc2LjE2NyBDMTEzLjkxNCw3Ni4yNzkgMTEzLjc5Niw3Ni4zNDIgMTEzLjY3NSw3Ni4zNDIiIGlkPSJGaWxsLTI3IiBmaWxsPSIjNDU1QTY0Ij48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTY3Ljc2Miw0OS40ODQgTDY3Ljc2MiwxMDMuNDg1IEM2Ny43NjIsMTA0LjU3NSA2OC41MzIsMTA1LjkwMyA2OS40ODIsMTA2LjQ1MiBMMTExLjk1NSwxMzAuOTczIEMxMTIuOTA1LDEzMS41MjIgMTEzLjY3NSwxMzEuMDgzIDExMy42NzUsMTI5Ljk5MyBMMTEzLjY3NSw3NS45OTIiIGlkPSJGaWxsLTI4IiBmaWxsPSIjRkFGQUZBIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTExMi43MjcsMTMxLjU2MSBDMTEyLjQzLDEzMS41NjEgMTEyLjEwNywxMzEuNDY2IDExMS43OCwxMzEuMjc2IEw2OS4zMDcsMTA2Ljc1NSBDNjguMjQ0LDEwNi4xNDIgNjcuNDEyLDEwNC43MDUgNjcuNDEyLDEwMy40ODUgTDY3LjQxMiw0OS40ODQgQzY3LjQxMiw0OS4yOSA2Ny41NjksNDkuMTM0IDY3Ljc2Miw0OS4xMzQgQzY3Ljk1Niw0OS4xMzQgNjguMTEzLDQ5LjI5IDY4LjExMyw0OS40ODQgTDY4LjExMywxMDMuNDg1IEM2OC4xMTMsMTA0LjQ0NSA2OC44MiwxMDUuNjY1IDY5LjY1NywxMDYuMTQ4IEwxMTIuMTMsMTMwLjY3IEMxMTIuNDc0LDEzMC44NjggMTEyLjc5MSwxMzAuOTEzIDExMywxMzAuNzkyIEMxMTMuMjA2LDEzMC42NzMgMTEzLjMyNSwxMzAuMzgxIDExMy4zMjUsMTI5Ljk5MyBMMTEzLjMyNSw3NS45OTIgQzExMy4zMjUsNzUuNzk4IDExMy40ODIsNzUuNjQxIDExMy42NzUsNzUuNjQxIEMxMTMuODY5LDc1LjY0MSAxMTQuMDI1LDc1Ljc5OCAxMTQuMDI1LDc1Ljk5MiBMMTE0LjAyNSwxMjkuOTkzIEMxMTQuMDI1LDEzMC42NDggMTEzLjc4NiwxMzEuMTQ3IDExMy4zNSwxMzEuMzk5IEMxMTMuMTYyLDEzMS41MDcgMTEyLjk1MiwxMzEuNTYxIDExMi43MjcsMTMxLjU2MSIgaWQ9IkZpbGwtMjkiIGZpbGw9IiM0NTVBNjQiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTEyLjg2LDQwLjUxMiBDMTEyLjg2LDQwLjUxMiAxMTIuODYsNDAuNTEyIDExMi44NTksNDAuNTEyIEMxMTAuNTQxLDQwLjUxMiAxMDguMzYsMzkuOTkgMTA2LjcxNywzOS4wNDEgQzEwNS4wMTIsMzguMDU3IDEwNC4wNzQsMzYuNzI2IDEwNC4wNzQsMzUuMjkyIEMxMDQuMDc0LDMzLjg0NyAxMDUuMDI2LDMyLjUwMSAxMDYuNzU0LDMxLjUwNCBMMTE4Ljc5NSwyNC41NTEgQzEyMC40NjMsMjMuNTg5IDEyMi42NjksMjMuMDU4IDEyNS4wMDcsMjMuMDU4IEMxMjcuMzI1LDIzLjA1OCAxMjkuNTA2LDIzLjU4MSAxMzEuMTUsMjQuNTMgQzEzMi44NTQsMjUuNTE0IDEzMy43OTMsMjYuODQ1IDEzMy43OTMsMjguMjc4IEMxMzMuNzkzLDI5LjcyNCAxMzIuODQxLDMxLjA2OSAxMzEuMTEzLDMyLjA2NyBMMTE5LjA3MSwzOS4wMTkgQzExNy40MDMsMzkuOTgyIDExNS4xOTcsNDAuNTEyIDExMi44Niw0MC41MTIgTDExMi44Niw0MC41MTIgWiBNMTI1LjAwNywyMy43NTkgQzEyMi43OSwyMy43NTkgMTIwLjcwOSwyNC4yNTYgMTE5LjE0NiwyNS4xNTggTDEwNy4xMDQsMzIuMTEgQzEwNS42MDIsMzIuOTc4IDEwNC43NzQsMzQuMTA4IDEwNC43NzQsMzUuMjkyIEMxMDQuNzc0LDM2LjQ2NSAxMDUuNTg5LDM3LjU4MSAxMDcuMDY3LDM4LjQzNCBDMTA4LjYwNSwzOS4zMjMgMTEwLjY2MywzOS44MTIgMTEyLjg1OSwzOS44MTIgTDExMi44NiwzOS44MTIgQzExNS4wNzYsMzkuODEyIDExNy4xNTgsMzkuMzE1IDExOC43MjEsMzguNDEzIEwxMzAuNzYyLDMxLjQ2IEMxMzIuMjY0LDMwLjU5MyAxMzMuMDkyLDI5LjQ2MyAxMzMuMDkyLDI4LjI3OCBDMTMzLjA5MiwyNy4xMDYgMTMyLjI3OCwyNS45OSAxMzAuOCwyNS4xMzYgQzEyOS4yNjEsMjQuMjQ4IDEyNy4yMDQsMjMuNzU5IDEyNS4wMDcsMjMuNzU5IEwxMjUuMDA3LDIzLjc1OSBaIiBpZD0iRmlsbC0zMCIgZmlsbD0iIzYwN0Q4QiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xNjUuNjMsMTYuMjE5IEwxNTkuODk2LDE5LjUzIEMxNTYuNzI5LDIxLjM1OCAxNTEuNjEsMjEuMzY3IDE0OC40NjMsMTkuNTUgQzE0NS4zMTYsMTcuNzMzIDE0NS4zMzIsMTQuNzc4IDE0OC40OTksMTIuOTQ5IEwxNTQuMjMzLDkuNjM5IEwxNjUuNjMsMTYuMjE5IiBpZD0iRmlsbC0zMSIgZmlsbD0iI0ZBRkFGQSI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xNTQuMjMzLDEwLjQ0OCBMMTY0LjIyOCwxNi4yMTkgTDE1OS41NDYsMTguOTIzIEMxNTguMTEyLDE5Ljc1IDE1Ni4xOTQsMjAuMjA2IDE1NC4xNDcsMjAuMjA2IEMxNTIuMTE4LDIwLjIwNiAxNTAuMjI0LDE5Ljc1NyAxNDguODE0LDE4Ljk0MyBDMTQ3LjUyNCwxOC4xOTkgMTQ2LjgxNCwxNy4yNDkgMTQ2LjgxNCwxNi4yNjkgQzE0Ni44MTQsMTUuMjc4IDE0Ny41MzcsMTQuMzE0IDE0OC44NSwxMy41NTYgTDE1NC4yMzMsMTAuNDQ4IE0xNTQuMjMzLDkuNjM5IEwxNDguNDk5LDEyLjk0OSBDMTQ1LjMzMiwxNC43NzggMTQ1LjMxNiwxNy43MzMgMTQ4LjQ2MywxOS41NSBDMTUwLjAzMSwyMC40NTUgMTUyLjA4NiwyMC45MDcgMTU0LjE0NywyMC45MDcgQzE1Ni4yMjQsMjAuOTA3IDE1OC4zMDYsMjAuNDQ3IDE1OS44OTYsMTkuNTMgTDE2NS42MywxNi4yMTkgTDE1NC4yMzMsOS42MzkiIGlkPSJGaWxsLTMyIiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTE0NS40NDUsNzIuNjY3IEwxNDUuNDQ1LDcyLjY2NyBDMTQzLjY3Miw3Mi42NjcgMTQyLjIwNCw3MS44MTcgMTQxLjIwMiw3MC40MjIgQzE0MS4xMzUsNzAuMzMgMTQxLjE0NSw3MC4xNDcgMTQxLjIyNSw3MC4wNjYgQzE0MS4zMDUsNjkuOTg1IDE0MS40MzIsNjkuOTQ2IDE0MS41MjUsNzAuMDExIEMxNDIuMzA2LDcwLjU1OSAxNDMuMjMxLDcwLjgyMyAxNDQuMjc2LDcwLjgyMiBDMTQ1LjU5OCw3MC44MjIgMTQ3LjAzLDcwLjM3NiAxNDguNTMyLDY5LjUwOSBDMTUzLjg0Miw2Ni40NDMgMTU4LjE2Myw1OC45ODcgMTU4LjE2Myw1Mi44OTQgQzE1OC4xNjMsNTAuOTY3IDE1Ny43MjEsNDkuMzMyIDE1Ni44ODQsNDguMTY4IEMxNTYuODE4LDQ4LjA3NiAxNTYuODI4LDQ3Ljk0OCAxNTYuOTA4LDQ3Ljg2NyBDMTU2Ljk4OCw0Ny43ODYgMTU3LjExNCw0Ny43NzQgMTU3LjIwOCw0Ny44NCBDMTU4Ljg3OCw0OS4wMTIgMTU5Ljc5OCw1MS4yMiAxNTkuNzk4LDU0LjA1OSBDMTU5Ljc5OCw2MC4zMDEgMTU1LjM3Myw2OC4wNDYgMTQ5LjkzMyw3MS4xODYgQzE0OC4zNiw3Mi4wOTQgMTQ2Ljg1LDcyLjY2NyAxNDUuNDQ1LDcyLjY2NyBMMTQ1LjQ0NSw3Mi42NjcgWiBNMTQyLjQ3Niw3MSBDMTQzLjI5LDcxLjY1MSAxNDQuMjk2LDcyLjAwMiAxNDUuNDQ1LDcyLjAwMiBDMTQ2Ljc2Nyw3Mi4wMDIgMTQ4LjE5OCw3MS41NSAxNDkuNyw3MC42ODIgQzE1NS4wMSw2Ny42MTcgMTU5LjMzMSw2MC4xNTkgMTU5LjMzMSw1NC4wNjUgQzE1OS4zMzEsNTIuMDg1IDE1OC44NjgsNTAuNDM1IDE1OC4wMDYsNDkuMjcyIEMxNTguNDE3LDUwLjMwNyAxNTguNjMsNTEuNTMyIDE1OC42Myw1Mi44OTIgQzE1OC42Myw1OS4xMzQgMTU0LjIwNSw2Ni43NjcgMTQ4Ljc2NSw2OS45MDcgQzE0Ny4xOTIsNzAuODE2IDE0NS42ODEsNzEuMjgzIDE0NC4yNzYsNzEuMjgzIEMxNDMuNjM0LDcxLjI4MyAxNDMuMDMzLDcxLjE5MiAxNDIuNDc2LDcxIEwxNDIuNDc2LDcxIFoiIGlkPSJGaWxsLTMzIiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTE0OC42NDgsNjkuNzA0IEMxNTQuMDMyLDY2LjU5NiAxNTguMzk2LDU5LjA2OCAxNTguMzk2LDUyLjg5MSBDMTU4LjM5Niw1MC44MzkgMTU3LjkxMyw0OS4xOTggMTU3LjA3NCw0OC4wMyBDMTU1LjI4OSw0Ni43NzggMTUyLjY5OSw0Ni44MzYgMTQ5LjgxNiw0OC41MDEgQzE0NC40MzMsNTEuNjA5IDE0MC4wNjgsNTkuMTM3IDE0MC4wNjgsNjUuMzE0IEMxNDAuMDY4LDY3LjM2NSAxNDAuNTUyLDY5LjAwNiAxNDEuMzkxLDcwLjE3NCBDMTQzLjE3Niw3MS40MjcgMTQ1Ljc2NSw3MS4zNjkgMTQ4LjY0OCw2OS43MDQiIGlkPSJGaWxsLTM0IiBmaWxsPSIjRkFGQUZBIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTE0NC4yNzYsNzEuMjc2IEwxNDQuMjc2LDcxLjI3NiBDMTQzLjEzMyw3MS4yNzYgMTQyLjExOCw3MC45NjkgMTQxLjI1Nyw3MC4zNjUgQzE0MS4yMzYsNzAuMzUxIDE0MS4yMTcsNzAuMzMyIDE0MS4yMDIsNzAuMzExIEMxNDAuMzA3LDY5LjA2NyAxMzkuODM1LDY3LjMzOSAxMzkuODM1LDY1LjMxNCBDMTM5LjgzNSw1OS4wNzMgMTQ0LjI2LDUxLjQzOSAxNDkuNyw0OC4yOTggQzE1MS4yNzMsNDcuMzkgMTUyLjc4NCw0Ni45MjkgMTU0LjE4OSw0Ni45MjkgQzE1NS4zMzIsNDYuOTI5IDE1Ni4zNDcsNDcuMjM2IDE1Ny4yMDgsNDcuODM5IEMxNTcuMjI5LDQ3Ljg1NCAxNTcuMjQ4LDQ3Ljg3MyAxNTcuMjYzLDQ3Ljg5NCBDMTU4LjE1Nyw0OS4xMzggMTU4LjYzLDUwLjg2NSAxNTguNjMsNTIuODkxIEMxNTguNjMsNTkuMTMyIDE1NC4yMDUsNjYuNzY2IDE0OC43NjUsNjkuOTA3IEMxNDcuMTkyLDcwLjgxNSAxNDUuNjgxLDcxLjI3NiAxNDQuMjc2LDcxLjI3NiBMMTQ0LjI3Niw3MS4yNzYgWiBNMTQxLjU1OCw3MC4xMDQgQzE0Mi4zMzEsNzAuNjM3IDE0My4yNDUsNzEuMDA1IDE0NC4yNzYsNzEuMDA1IEMxNDUuNTk4LDcxLjAwNSAxNDcuMDMsNzAuNDY3IDE0OC41MzIsNjkuNiBDMTUzLjg0Miw2Ni41MzQgMTU4LjE2Myw1OS4wMzMgMTU4LjE2Myw1Mi45MzkgQzE1OC4xNjMsNTEuMDMxIDE1Ny43MjksNDkuMzg1IDE1Ni45MDcsNDguMjIzIEMxNTYuMTMzLDQ3LjY5MSAxNTUuMjE5LDQ3LjQwOSAxNTQuMTg5LDQ3LjQwOSBDMTUyLjg2Nyw0Ny40MDkgMTUxLjQzNSw0Ny44NDIgMTQ5LjkzMyw0OC43MDkgQzE0NC42MjMsNTEuNzc1IDE0MC4zMDIsNTkuMjczIDE0MC4zMDIsNjUuMzY2IEMxNDAuMzAyLDY3LjI3NiAxNDAuNzM2LDY4Ljk0MiAxNDEuNTU4LDcwLjEwNCBMMTQxLjU1OCw3MC4xMDQgWiIgaWQ9IkZpbGwtMzUiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTUwLjcyLDY1LjM2MSBMMTUwLjM1Nyw2NS4wNjYgQzE1MS4xNDcsNjQuMDkyIDE1MS44NjksNjMuMDQgMTUyLjUwNSw2MS45MzggQzE1My4zMTMsNjAuNTM5IDE1My45NzgsNTkuMDY3IDE1NC40ODIsNTcuNTYzIEwxNTQuOTI1LDU3LjcxMiBDMTU0LjQxMiw1OS4yNDUgMTUzLjczMyw2MC43NDUgMTUyLjkxLDYyLjE3MiBDMTUyLjI2Miw2My4yOTUgMTUxLjUyNSw2NC4zNjggMTUwLjcyLDY1LjM2MSIgaWQ9IkZpbGwtMzYiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTE1LjkxNyw4NC41MTQgTDExNS41NTQsODQuMjIgQzExNi4zNDQsODMuMjQ1IDExNy4wNjYsODIuMTk0IDExNy43MDIsODEuMDkyIEMxMTguNTEsNzkuNjkyIDExOS4xNzUsNzguMjIgMTE5LjY3OCw3Ni43MTcgTDEyMC4xMjEsNzYuODY1IEMxMTkuNjA4LDc4LjM5OCAxMTguOTMsNzkuODk5IDExOC4xMDYsODEuMzI2IEMxMTcuNDU4LDgyLjQ0OCAxMTYuNzIyLDgzLjUyMSAxMTUuOTE3LDg0LjUxNCIgaWQ9IkZpbGwtMzciIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTE0LDEzMC40NzYgTDExNCwxMzAuMDA4IEwxMTQsNzYuMDUyIEwxMTQsNzUuNTg0IEwxMTQsNzYuMDUyIEwxMTQsMTMwLjAwOCBMMTE0LDEzMC40NzYiIGlkPSJGaWxsLTM4IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgICAgICA8ZyBpZD0iSW1wb3J0ZWQtTGF5ZXJzLUNvcHkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDYyLjAwMDAwMCwgMC4wMDAwMDApIiBza2V0Y2g6dHlwZT0iTVNTaGFwZUdyb3VwIj4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTkuODIyLDM3LjQ3NCBDMTkuODM5LDM3LjMzOSAxOS43NDcsMzcuMTk0IDE5LjU1NSwzNy4wODIgQzE5LjIyOCwzNi44OTQgMTguNzI5LDM2Ljg3MiAxOC40NDYsMzcuMDM3IEwxMi40MzQsNDAuNTA4IEMxMi4zMDMsNDAuNTg0IDEyLjI0LDQwLjY4NiAxMi4yNDMsNDAuNzkzIEMxMi4yNDUsNDAuOTI1IDEyLjI0NSw0MS4yNTQgMTIuMjQ1LDQxLjM3MSBMMTIuMjQ1LDQxLjQxNCBMMTIuMjM4LDQxLjU0MiBDOC4xNDgsNDMuODg3IDUuNjQ3LDQ1LjMyMSA1LjY0Nyw0NS4zMjEgQzUuNjQ2LDQ1LjMyMSAzLjU3LDQ2LjM2NyAyLjg2LDUwLjUxMyBDMi44Niw1MC41MTMgMS45NDgsNTcuNDc0IDEuOTYyLDcwLjI1OCBDMS45NzcsODIuODI4IDIuNTY4LDg3LjMyOCAzLjEyOSw5MS42MDkgQzMuMzQ5LDkzLjI5MyA2LjEzLDkzLjczNCA2LjEzLDkzLjczNCBDNi40NjEsOTMuNzc0IDYuODI4LDkzLjcwNyA3LjIxLDkzLjQ4NiBMODIuNDgzLDQ5LjkzNSBDODQuMjkxLDQ4Ljg2NiA4NS4xNSw0Ni4yMTYgODUuNTM5LDQzLjY1MSBDODYuNzUyLDM1LjY2MSA4Ny4yMTQsMTAuNjczIDg1LjI2NCwzLjc3MyBDODUuMDY4LDMuMDggODQuNzU0LDIuNjkgODQuMzk2LDIuNDkxIEw4Mi4zMSwxLjcwMSBDODEuNTgzLDEuNzI5IDgwLjg5NCwyLjE2OCA4MC43NzYsMi4yMzYgQzgwLjYzNiwyLjMxNyA0MS44MDcsMjQuNTg1IDIwLjAzMiwzNy4wNzIgTDE5LjgyMiwzNy40NzQiIGlkPSJGaWxsLTEiIGZpbGw9IiNGRkZGRkYiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNODIuMzExLDEuNzAxIEw4NC4zOTYsMi40OTEgQzg0Ljc1NCwyLjY5IDg1LjA2OCwzLjA4IDg1LjI2NCwzLjc3MyBDODcuMjEzLDEwLjY3MyA4Ni43NTEsMzUuNjYgODUuNTM5LDQzLjY1MSBDODUuMTQ5LDQ2LjIxNiA4NC4yOSw0OC44NjYgODIuNDgzLDQ5LjkzNSBMNy4yMSw5My40ODYgQzYuODk3LDkzLjY2NyA2LjU5NSw5My43NDQgNi4zMTQsOTMuNzQ0IEw2LjEzMSw5My43MzMgQzYuMTMxLDkzLjczNCAzLjM0OSw5My4yOTMgMy4xMjgsOTEuNjA5IEMyLjU2OCw4Ny4zMjcgMS45NzcsODIuODI4IDEuOTYzLDcwLjI1OCBDMS45NDgsNTcuNDc0IDIuODYsNTAuNTEzIDIuODYsNTAuNTEzIEMzLjU3LDQ2LjM2NyA1LjY0Nyw0NS4zMjEgNS42NDcsNDUuMzIxIEM1LjY0Nyw0NS4zMjEgOC4xNDgsNDMuODg3IDEyLjIzOCw0MS41NDIgTDEyLjI0NSw0MS40MTQgTDEyLjI0NSw0MS4zNzEgQzEyLjI0NSw0MS4yNTQgMTIuMjQ1LDQwLjkyNSAxMi4yNDMsNDAuNzkzIEMxMi4yNCw0MC42ODYgMTIuMzAyLDQwLjU4MyAxMi40MzQsNDAuNTA4IEwxOC40NDYsMzcuMDM2IEMxOC41NzQsMzYuOTYyIDE4Ljc0NiwzNi45MjYgMTguOTI3LDM2LjkyNiBDMTkuMTQ1LDM2LjkyNiAxOS4zNzYsMzYuOTc5IDE5LjU1NCwzNy4wODIgQzE5Ljc0NywzNy4xOTQgMTkuODM5LDM3LjM0IDE5LjgyMiwzNy40NzQgTDIwLjAzMywzNy4wNzIgQzQxLjgwNiwyNC41ODUgODAuNjM2LDIuMzE4IDgwLjc3NywyLjIzNiBDODAuODk0LDIuMTY4IDgxLjU4MywxLjcyOSA4Mi4zMTEsMS43MDEgTTgyLjMxMSwwLjcwNCBMODIuMjcyLDAuNzA1IEM4MS42NTQsMC43MjggODAuOTg5LDAuOTQ5IDgwLjI5OCwxLjM2MSBMODAuMjc3LDEuMzczIEM4MC4xMjksMS40NTggNTkuNzY4LDEzLjEzNSAxOS43NTgsMzYuMDc5IEMxOS41LDM1Ljk4MSAxOS4yMTQsMzUuOTI5IDE4LjkyNywzNS45MjkgQzE4LjU2MiwzNS45MjkgMTguMjIzLDM2LjAxMyAxNy45NDcsMzYuMTczIEwxMS45MzUsMzkuNjQ0IEMxMS40OTMsMzkuODk5IDExLjIzNiw0MC4zMzQgMTEuMjQ2LDQwLjgxIEwxMS4yNDcsNDAuOTYgTDUuMTY3LDQ0LjQ0NyBDNC43OTQsNDQuNjQ2IDIuNjI1LDQ1Ljk3OCAxLjg3Nyw1MC4zNDUgTDEuODcxLDUwLjM4NCBDMS44NjIsNTAuNDU0IDAuOTUxLDU3LjU1NyAwLjk2NSw3MC4yNTkgQzAuOTc5LDgyLjg3OSAxLjU2OCw4Ny4zNzUgMi4xMzcsOTEuNzI0IEwyLjEzOSw5MS43MzkgQzIuNDQ3LDk0LjA5NCA1LjYxNCw5NC42NjIgNS45NzUsOTQuNzE5IEw2LjAwOSw5NC43MjMgQzYuMTEsOTQuNzM2IDYuMjEzLDk0Ljc0MiA2LjMxNCw5NC43NDIgQzYuNzksOTQuNzQyIDcuMjYsOTQuNjEgNy43MSw5NC4zNSBMODIuOTgzLDUwLjc5OCBDODQuNzk0LDQ5LjcyNyA4NS45ODIsNDcuMzc1IDg2LjUyNSw0My44MDEgQzg3LjcxMSwzNS45ODcgODguMjU5LDEwLjcwNSA4Ni4yMjQsMy41MDIgQzg1Ljk3MSwyLjYwOSA4NS41MiwxLjk3NSA4NC44ODEsMS42MiBMODQuNzQ5LDEuNTU4IEw4Mi42NjQsMC43NjkgQzgyLjU1MSwwLjcyNSA4Mi40MzEsMC43MDQgODIuMzExLDAuNzA0IiBpZD0iRmlsbC0yIiBmaWxsPSIjNDU1QTY0Ij48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTY2LjI2NywxMS41NjUgTDY3Ljc2MiwxMS45OTkgTDExLjQyMyw0NC4zMjUiIGlkPSJGaWxsLTMiIGZpbGw9IiNGRkZGRkYiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTIuMjAyLDkwLjU0NSBDMTIuMDI5LDkwLjU0NSAxMS44NjIsOTAuNDU1IDExLjc2OSw5MC4yOTUgQzExLjYzMiw5MC4wNTcgMTEuNzEzLDg5Ljc1MiAxMS45NTIsODkuNjE0IEwzMC4zODksNzguOTY5IEMzMC42MjgsNzguODMxIDMwLjkzMyw3OC45MTMgMzEuMDcxLDc5LjE1MiBDMzEuMjA4LDc5LjM5IDMxLjEyNyw3OS42OTYgMzAuODg4LDc5LjgzMyBMMTIuNDUxLDkwLjQ3OCBMMTIuMjAyLDkwLjU0NSIgaWQ9IkZpbGwtNCIgZmlsbD0iIzYwN0Q4QiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xMy43NjQsNDIuNjU0IEwxMy42NTYsNDIuNTkyIEwxMy43MDIsNDIuNDIxIEwxOC44MzcsMzkuNDU3IEwxOS4wMDcsMzkuNTAyIEwxOC45NjIsMzkuNjczIEwxMy44MjcsNDIuNjM3IEwxMy43NjQsNDIuNjU0IiBpZD0iRmlsbC01IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTguNTIsOTAuMzc1IEw4LjUyLDQ2LjQyMSBMOC41ODMsNDYuMzg1IEw3NS44NCw3LjU1NCBMNzUuODQsNTEuNTA4IEw3NS43NzgsNTEuNTQ0IEw4LjUyLDkwLjM3NSBMOC41Miw5MC4zNzUgWiBNOC43Nyw0Ni41NjQgTDguNzcsODkuOTQ0IEw3NS41OTEsNTEuMzY1IEw3NS41OTEsNy45ODUgTDguNzcsNDYuNTY0IEw4Ljc3LDQ2LjU2NCBaIiBpZD0iRmlsbC02IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTI0Ljk4Niw4My4xODIgQzI0Ljc1Niw4My4zMzEgMjQuMzc0LDgzLjU2NiAyNC4xMzcsODMuNzA1IEwxMi42MzIsOTAuNDA2IEMxMi4zOTUsOTAuNTQ1IDEyLjQyNiw5MC42NTggMTIuNyw5MC42NTggTDEzLjI2NSw5MC42NTggQzEzLjU0LDkwLjY1OCAxMy45NTgsOTAuNTQ1IDE0LjE5NSw5MC40MDYgTDI1LjcsODMuNzA1IEMyNS45MzcsODMuNTY2IDI2LjEyOCw4My40NTIgMjYuMTI1LDgzLjQ0OSBDMjYuMTIyLDgzLjQ0NyAyNi4xMTksODMuMjIgMjYuMTE5LDgyLjk0NiBDMjYuMTE5LDgyLjY3MiAyNS45MzEsODIuNTY5IDI1LjcwMSw4Mi43MTkgTDI0Ljk4Niw4My4xODIiIGlkPSJGaWxsLTciIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTMuMjY2LDkwLjc4MiBMMTIuNyw5MC43ODIgQzEyLjUsOTAuNzgyIDEyLjM4NCw5MC43MjYgMTIuMzU0LDkwLjYxNiBDMTIuMzI0LDkwLjUwNiAxMi4zOTcsOTAuMzk5IDEyLjU2OSw5MC4yOTkgTDI0LjA3NCw4My41OTcgQzI0LjMxLDgzLjQ1OSAyNC42ODksODMuMjI2IDI0LjkxOCw4My4wNzggTDI1LjYzMyw4Mi42MTQgQzI1LjcyMyw4Mi41NTUgMjUuODEzLDgyLjUyNSAyNS44OTksODIuNTI1IEMyNi4wNzEsODIuNTI1IDI2LjI0NCw4Mi42NTUgMjYuMjQ0LDgyLjk0NiBDMjYuMjQ0LDgzLjE2IDI2LjI0NSw4My4zMDkgMjYuMjQ3LDgzLjM4MyBMMjYuMjUzLDgzLjM4NyBMMjYuMjQ5LDgzLjQ1NiBDMjYuMjQ2LDgzLjUzMSAyNi4yNDYsODMuNTMxIDI1Ljc2Myw4My44MTIgTDE0LjI1OCw5MC41MTQgQzE0LDkwLjY2NSAxMy41NjQsOTAuNzgyIDEzLjI2Niw5MC43ODIgTDEzLjI2Niw5MC43ODIgWiBNMTIuNjY2LDkwLjUzMiBMMTIuNyw5MC41MzMgTDEzLjI2Niw5MC41MzMgQzEzLjUxOCw5MC41MzMgMTMuOTE1LDkwLjQyNSAxNC4xMzIsOTAuMjk5IEwyNS42MzcsODMuNTk3IEMyNS44MDUsODMuNDk5IDI1LjkzMSw4My40MjQgMjUuOTk4LDgzLjM4MyBDMjUuOTk0LDgzLjI5OSAyNS45OTQsODMuMTY1IDI1Ljk5NCw4Mi45NDYgTDI1Ljg5OSw4Mi43NzUgTDI1Ljc2OCw4Mi44MjQgTDI1LjA1NCw4My4yODcgQzI0LjgyMiw4My40MzcgMjQuNDM4LDgzLjY3MyAyNC4yLDgzLjgxMiBMMTIuNjk1LDkwLjUxNCBMMTIuNjY2LDkwLjUzMiBMMTIuNjY2LDkwLjUzMiBaIiBpZD0iRmlsbC04IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTEzLjI2Niw4OS44NzEgTDEyLjcsODkuODcxIEMxMi41LDg5Ljg3MSAxMi4zODQsODkuODE1IDEyLjM1NCw4OS43MDUgQzEyLjMyNCw4OS41OTUgMTIuMzk3LDg5LjQ4OCAxMi41NjksODkuMzg4IEwyNC4wNzQsODIuNjg2IEMyNC4zMzIsODIuNTM1IDI0Ljc2OCw4Mi40MTggMjUuMDY3LDgyLjQxOCBMMjUuNjMyLDgyLjQxOCBDMjUuODMyLDgyLjQxOCAyNS45NDgsODIuNDc0IDI1Ljk3OCw4Mi41ODQgQzI2LjAwOCw4Mi42OTQgMjUuOTM1LDgyLjgwMSAyNS43NjMsODIuOTAxIEwxNC4yNTgsODkuNjAzIEMxNCw4OS43NTQgMTMuNTY0LDg5Ljg3MSAxMy4yNjYsODkuODcxIEwxMy4yNjYsODkuODcxIFogTTEyLjY2Niw4OS42MjEgTDEyLjcsODkuNjIyIEwxMy4yNjYsODkuNjIyIEMxMy41MTgsODkuNjIyIDEzLjkxNSw4OS41MTUgMTQuMTMyLDg5LjM4OCBMMjUuNjM3LDgyLjY4NiBMMjUuNjY3LDgyLjY2OCBMMjUuNjMyLDgyLjY2NyBMMjUuMDY3LDgyLjY2NyBDMjQuODE1LDgyLjY2NyAyNC40MTgsODIuNzc1IDI0LjIsODIuOTAxIEwxMi42OTUsODkuNjAzIEwxMi42NjYsODkuNjIxIEwxMi42NjYsODkuNjIxIFoiIGlkPSJGaWxsLTkiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTIuMzcsOTAuODAxIEwxMi4zNyw4OS41NTQgTDEyLjM3LDkwLjgwMSIgaWQ9IkZpbGwtMTAiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNNi4xMyw5My45MDEgQzUuMzc5LDkzLjgwOCA0LjgxNiw5My4xNjQgNC42OTEsOTIuNTI1IEMzLjg2LDg4LjI4NyAzLjU0LDgzLjc0MyAzLjUyNiw3MS4xNzMgQzMuNTExLDU4LjM4OSA0LjQyMyw1MS40MjggNC40MjMsNTEuNDI4IEM1LjEzNCw0Ny4yODIgNy4yMSw0Ni4yMzYgNy4yMSw0Ni4yMzYgQzcuMjEsNDYuMjM2IDgxLjY2NywzLjI1IDgyLjA2OSwzLjAxNyBDODIuMjkyLDIuODg4IDg0LjU1NiwxLjQzMyA4NS4yNjQsMy45NCBDODcuMjE0LDEwLjg0IDg2Ljc1MiwzNS44MjcgODUuNTM5LDQzLjgxOCBDODUuMTUsNDYuMzgzIDg0LjI5MSw0OS4wMzMgODIuNDgzLDUwLjEwMSBMNy4yMSw5My42NTMgQzYuODI4LDkzLjg3NCA2LjQ2MSw5My45NDEgNi4xMyw5My45MDEgQzYuMTMsOTMuOTAxIDMuMzQ5LDkzLjQ2IDMuMTI5LDkxLjc3NiBDMi41NjgsODcuNDk1IDEuOTc3LDgyLjk5NSAxLjk2Miw3MC40MjUgQzEuOTQ4LDU3LjY0MSAyLjg2LDUwLjY4IDIuODYsNTAuNjggQzMuNTcsNDYuNTM0IDUuNjQ3LDQ1LjQ4OSA1LjY0Nyw0NS40ODkgQzUuNjQ2LDQ1LjQ4OSA4LjA2NSw0NC4wOTIgMTIuMjQ1LDQxLjY3OSBMMTMuMTE2LDQxLjU2IEwxOS43MTUsMzcuNzMgTDE5Ljc2MSwzNy4yNjkgTDYuMTMsOTMuOTAxIiBpZD0iRmlsbC0xMSIgZmlsbD0iI0ZBRkFGQSI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik02LjMxNyw5NC4xNjEgTDYuMTAyLDk0LjE0OCBMNi4xMDEsOTQuMTQ4IEw1Ljg1Nyw5NC4xMDEgQzUuMTM4LDkzLjk0NSAzLjA4NSw5My4zNjUgMi44ODEsOTEuODA5IEMyLjMxMyw4Ny40NjkgMS43MjcsODIuOTk2IDEuNzEzLDcwLjQyNSBDMS42OTksNTcuNzcxIDIuNjA0LDUwLjcxOCAyLjYxMyw1MC42NDggQzMuMzM4LDQ2LjQxNyA1LjQ0NSw0NS4zMSA1LjUzNSw0NS4yNjYgTDEyLjE2Myw0MS40MzkgTDEzLjAzMyw0MS4zMiBMMTkuNDc5LDM3LjU3OCBMMTkuNTEzLDM3LjI0NCBDMTkuNTI2LDM3LjEwNyAxOS42NDcsMzcuMDA4IDE5Ljc4NiwzNy4wMjEgQzE5LjkyMiwzNy4wMzQgMjAuMDIzLDM3LjE1NiAyMC4wMDksMzcuMjkzIEwxOS45NSwzNy44ODIgTDEzLjE5OCw0MS44MDEgTDEyLjMyOCw0MS45MTkgTDUuNzcyLDQ1LjcwNCBDNS43NDEsNDUuNzIgMy43ODIsNDYuNzcyIDMuMTA2LDUwLjcyMiBDMy4wOTksNTAuNzgyIDIuMTk4LDU3LjgwOCAyLjIxMiw3MC40MjQgQzIuMjI2LDgyLjk2MyAyLjgwOSw4Ny40MiAzLjM3Myw5MS43MjkgQzMuNDY0LDkyLjQyIDQuMDYyLDkyLjg4MyA0LjY4Miw5My4xODEgQzQuNTY2LDkyLjk4NCA0LjQ4Niw5Mi43NzYgNC40NDYsOTIuNTcyIEMzLjY2NSw4OC41ODggMy4yOTEsODQuMzcgMy4yNzYsNzEuMTczIEMzLjI2Miw1OC41MiA0LjE2Nyw1MS40NjYgNC4xNzYsNTEuMzk2IEM0LjkwMSw0Ny4xNjUgNy4wMDgsNDYuMDU5IDcuMDk4LDQ2LjAxNCBDNy4wOTQsNDYuMDE1IDgxLjU0MiwzLjAzNCA4MS45NDQsMi44MDIgTDgxLjk3MiwyLjc4NSBDODIuODc2LDIuMjQ3IDgzLjY5MiwyLjA5NyA4NC4zMzIsMi4zNTIgQzg0Ljg4NywyLjU3MyA4NS4yODEsMy4wODUgODUuNTA0LDMuODcyIEM4Ny41MTgsMTEgODYuOTY0LDM2LjA5MSA4NS43ODUsNDMuODU1IEM4NS4yNzgsNDcuMTk2IDg0LjIxLDQ5LjM3IDgyLjYxLDUwLjMxNyBMNy4zMzUsOTMuODY5IEM2Ljk5OSw5NC4wNjMgNi42NTgsOTQuMTYxIDYuMzE3LDk0LjE2MSBMNi4zMTcsOTQuMTYxIFogTTYuMTcsOTMuNjU0IEM2LjQ2Myw5My42OSA2Ljc3NCw5My42MTcgNy4wODUsOTMuNDM3IEw4Mi4zNTgsNDkuODg2IEM4NC4xODEsNDguODA4IDg0Ljk2LDQ1Ljk3MSA4NS4yOTIsNDMuNzggQzg2LjQ2NiwzNi4wNDkgODcuMDIzLDExLjA4NSA4NS4wMjQsNC4wMDggQzg0Ljg0NiwzLjM3NyA4NC41NTEsMi45NzYgODQuMTQ4LDIuODE2IEM4My42NjQsMi42MjMgODIuOTgyLDIuNzY0IDgyLjIyNywzLjIxMyBMODIuMTkzLDMuMjM0IEM4MS43OTEsMy40NjYgNy4zMzUsNDYuNDUyIDcuMzM1LDQ2LjQ1MiBDNy4zMDQsNDYuNDY5IDUuMzQ2LDQ3LjUyMSA0LjY2OSw1MS40NzEgQzQuNjYyLDUxLjUzIDMuNzYxLDU4LjU1NiAzLjc3NSw3MS4xNzMgQzMuNzksODQuMzI4IDQuMTYxLDg4LjUyNCA0LjkzNiw5Mi40NzYgQzUuMDI2LDkyLjkzNyA1LjQxMiw5My40NTkgNS45NzMsOTMuNjE1IEM2LjA4Nyw5My42NCA2LjE1OCw5My42NTIgNi4xNjksOTMuNjU0IEw2LjE3LDkzLjY1NCBMNi4xNyw5My42NTQgWiIgaWQ9IkZpbGwtMTIiIGZpbGw9IiM0NTVBNjQiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNNy4zMTcsNjguOTgyIEM3LjgwNiw2OC43MDEgOC4yMDIsNjguOTI2IDguMjAyLDY5LjQ4NyBDOC4yMDIsNzAuMDQ3IDcuODA2LDcwLjczIDcuMzE3LDcxLjAxMiBDNi44MjksNzEuMjk0IDYuNDMzLDcxLjA2OSA2LjQzMyw3MC41MDggQzYuNDMzLDY5Ljk0OCA2LjgyOSw2OS4yNjUgNy4zMTcsNjguOTgyIiBpZD0iRmlsbC0xMyIgZmlsbD0iI0ZGRkZGRiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik02LjkyLDcxLjEzMyBDNi42MzEsNzEuMTMzIDYuNDMzLDcwLjkwNSA2LjQzMyw3MC41MDggQzYuNDMzLDY5Ljk0OCA2LjgyOSw2OS4yNjUgNy4zMTcsNjguOTgyIEM3LjQ2LDY4LjkgNy41OTUsNjguODYxIDcuNzE0LDY4Ljg2MSBDOC4wMDMsNjguODYxIDguMjAyLDY5LjA5IDguMjAyLDY5LjQ4NyBDOC4yMDIsNzAuMDQ3IDcuODA2LDcwLjczIDcuMzE3LDcxLjAxMiBDNy4xNzQsNzEuMDk0IDcuMDM5LDcxLjEzMyA2LjkyLDcxLjEzMyBNNy43MTQsNjguNjc0IEM3LjU1Nyw2OC42NzQgNy4zOTIsNjguNzIzIDcuMjI0LDY4LjgyMSBDNi42NzYsNjkuMTM4IDYuMjQ2LDY5Ljg3OSA2LjI0Niw3MC41MDggQzYuMjQ2LDcwLjk5NCA2LjUxNyw3MS4zMiA2LjkyLDcxLjMyIEM3LjA3OCw3MS4zMiA3LjI0Myw3MS4yNzEgNy40MTEsNzEuMTc0IEM3Ljk1OSw3MC44NTcgOC4zODksNzAuMTE3IDguMzg5LDY5LjQ4NyBDOC4zODksNjkuMDAxIDguMTE3LDY4LjY3NCA3LjcxNCw2OC42NzQiIGlkPSJGaWxsLTE0IiBmaWxsPSIjODA5N0EyIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTYuOTIsNzAuOTQ3IEM2LjY0OSw3MC45NDcgNi42MjEsNzAuNjQgNi42MjEsNzAuNTA4IEM2LjYyMSw3MC4wMTcgNi45ODIsNjkuMzkyIDcuNDExLDY5LjE0NSBDNy41MjEsNjkuMDgyIDcuNjI1LDY5LjA0OSA3LjcxNCw2OS4wNDkgQzcuOTg2LDY5LjA0OSA4LjAxNSw2OS4zNTUgOC4wMTUsNjkuNDg3IEM4LjAxNSw2OS45NzggNy42NTIsNzAuNjAzIDcuMjI0LDcwLjg1MSBDNy4xMTUsNzAuOTE0IDcuMDEsNzAuOTQ3IDYuOTIsNzAuOTQ3IE03LjcxNCw2OC44NjEgQzcuNTk1LDY4Ljg2MSA3LjQ2LDY4LjkgNy4zMTcsNjguOTgyIEM2LjgyOSw2OS4yNjUgNi40MzMsNjkuOTQ4IDYuNDMzLDcwLjUwOCBDNi40MzMsNzAuOTA1IDYuNjMxLDcxLjEzMyA2LjkyLDcxLjEzMyBDNy4wMzksNzEuMTMzIDcuMTc0LDcxLjA5NCA3LjMxNyw3MS4wMTIgQzcuODA2LDcwLjczIDguMjAyLDcwLjA0NyA4LjIwMiw2OS40ODcgQzguMjAyLDY5LjA5IDguMDAzLDY4Ljg2MSA3LjcxNCw2OC44NjEiIGlkPSJGaWxsLTE1IiBmaWxsPSIjODA5N0EyIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTcuNDQ0LDg1LjM1IEM3LjcwOCw4NS4xOTggNy45MjEsODUuMzE5IDcuOTIxLDg1LjYyMiBDNy45MjEsODUuOTI1IDcuNzA4LDg2LjI5MiA3LjQ0NCw4Ni40NDQgQzcuMTgxLDg2LjU5NyA2Ljk2Nyw4Ni40NzUgNi45NjcsODYuMTczIEM2Ljk2Nyw4NS44NzEgNy4xODEsODUuNTAyIDcuNDQ0LDg1LjM1IiBpZD0iRmlsbC0xNiIgZmlsbD0iI0ZGRkZGRiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik03LjIzLDg2LjUxIEM3LjA3NCw4Ni41MSA2Ljk2Nyw4Ni4zODcgNi45NjcsODYuMTczIEM2Ljk2Nyw4NS44NzEgNy4xODEsODUuNTAyIDcuNDQ0LDg1LjM1IEM3LjUyMSw4NS4zMDUgNy41OTQsODUuMjg0IDcuNjU4LDg1LjI4NCBDNy44MTQsODUuMjg0IDcuOTIxLDg1LjQwOCA3LjkyMSw4NS42MjIgQzcuOTIxLDg1LjkyNSA3LjcwOCw4Ni4yOTIgNy40NDQsODYuNDQ0IEM3LjM2Nyw4Ni40ODkgNy4yOTQsODYuNTEgNy4yMyw4Ni41MSBNNy42NTgsODUuMDk4IEM3LjU1OCw4NS4wOTggNy40NTUsODUuMTI3IDcuMzUxLDg1LjE4OCBDNy4wMzEsODUuMzczIDYuNzgxLDg1LjgwNiA2Ljc4MSw4Ni4xNzMgQzYuNzgxLDg2LjQ4MiA2Ljk2Niw4Ni42OTcgNy4yMyw4Ni42OTcgQzcuMzMsODYuNjk3IDcuNDMzLDg2LjY2NiA3LjUzOCw4Ni42MDcgQzcuODU4LDg2LjQyMiA4LjEwOCw4NS45ODkgOC4xMDgsODUuNjIyIEM4LjEwOCw4NS4zMTMgNy45MjMsODUuMDk4IDcuNjU4LDg1LjA5OCIgaWQ9IkZpbGwtMTciIGZpbGw9IiM4MDk3QTIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNNy4yMyw4Ni4zMjIgTDcuMTU0LDg2LjE3MyBDNy4xNTQsODUuOTM4IDcuMzMzLDg1LjYyOSA3LjUzOCw4NS41MTIgTDcuNjU4LDg1LjQ3MSBMNy43MzQsODUuNjIyIEM3LjczNCw4NS44NTYgNy41NTUsODYuMTY0IDcuMzUxLDg2LjI4MiBMNy4yMyw4Ni4zMjIgTTcuNjU4LDg1LjI4NCBDNy41OTQsODUuMjg0IDcuNTIxLDg1LjMwNSA3LjQ0NCw4NS4zNSBDNy4xODEsODUuNTAyIDYuOTY3LDg1Ljg3MSA2Ljk2Nyw4Ni4xNzMgQzYuOTY3LDg2LjM4NyA3LjA3NCw4Ni41MSA3LjIzLDg2LjUxIEM3LjI5NCw4Ni41MSA3LjM2Nyw4Ni40ODkgNy40NDQsODYuNDQ0IEM3LjcwOCw4Ni4yOTIgNy45MjEsODUuOTI1IDcuOTIxLDg1LjYyMiBDNy45MjEsODUuNDA4IDcuODE0LDg1LjI4NCA3LjY1OCw4NS4yODQiIGlkPSJGaWxsLTE4IiBmaWxsPSIjODA5N0EyIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTc3LjI3OCw3Ljc2OSBMNzcuMjc4LDUxLjQzNiBMMTAuMjA4LDkwLjE2IEwxMC4yMDgsNDYuNDkzIEw3Ny4yNzgsNy43NjkiIGlkPSJGaWxsLTE5IiBmaWxsPSIjNDU1QTY0Ij48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTEwLjA4Myw5MC4zNzUgTDEwLjA4Myw0Ni40MjEgTDEwLjE0Niw0Ni4zODUgTDc3LjQwMyw3LjU1NCBMNzcuNDAzLDUxLjUwOCBMNzcuMzQxLDUxLjU0NCBMMTAuMDgzLDkwLjM3NSBMMTAuMDgzLDkwLjM3NSBaIE0xMC4zMzMsNDYuNTY0IEwxMC4zMzMsODkuOTQ0IEw3Ny4xNTQsNTEuMzY1IEw3Ny4xNTQsNy45ODUgTDEwLjMzMyw0Ni41NjQgTDEwLjMzMyw0Ni41NjQgWiIgaWQ9IkZpbGwtMjAiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xMjUuNzM3LDg4LjY0NyBMMTE4LjA5OCw5MS45ODEgTDExOC4wOTgsODQgTDEwNi42MzksODguNzEzIEwxMDYuNjM5LDk2Ljk4MiBMOTksMTAwLjMxNSBMMTEyLjM2OSwxMDMuOTYxIEwxMjUuNzM3LDg4LjY0NyIgaWQ9IkltcG9ydGVkLUxheWVycy1Db3B5LTIiIGZpbGw9IiM0NTVBNjQiIHNrZXRjaDp0eXBlPSJNU1NoYXBlR3JvdXAiPjwvcGF0aD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+");
  153. },module.exports=RotateInstructions;
  154. },{"./util.js":68}],63:[function(_dereq_,module,exports){
  155. function ComplementaryFilter(t){this.kFilter=t,this.currentAccelMeasurement=new SensorSample,this.currentGyroMeasurement=new SensorSample,this.previousGyroMeasurement=new SensorSample,Util.isIOS()?this.filterQ=new MathUtil.Quaternion(-1,0,0,1):this.filterQ=new MathUtil.Quaternion(1,0,0,1),this.previousFilterQ=new MathUtil.Quaternion,this.previousFilterQ.copy(this.filterQ),this.accelQ=new MathUtil.Quaternion,this.isOrientationInitialized=!1,this.estimatedGravity=new MathUtil.Vector3,this.measuredGravity=new MathUtil.Vector3,this.gyroIntegralQ=new MathUtil.Quaternion}var SensorSample=_dereq_("./sensor-sample.js"),MathUtil=_dereq_("../math-util.js"),Util=_dereq_("../util.js");ComplementaryFilter.prototype.addAccelMeasurement=function(t,e){this.currentAccelMeasurement.set(t,e)},ComplementaryFilter.prototype.addGyroMeasurement=function(t,e){this.currentGyroMeasurement.set(t,e);var i=e-this.previousGyroMeasurement.timestampS;Util.isTimestampDeltaValid(i)&&this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},ComplementaryFilter.prototype.run_=function(){if(!this.isOrientationInitialized)return this.accelQ=this.accelToQuaternion_(this.currentAccelMeasurement.sample),this.previousFilterQ.copy(this.accelQ),void(this.isOrientationInitialized=!0);var t=this.currentGyroMeasurement.timestampS-this.previousGyroMeasurement.timestampS,e=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,t);this.gyroIntegralQ.multiply(e),this.filterQ.copy(this.previousFilterQ),this.filterQ.multiply(e);var i=new MathUtil.Quaternion;i.copy(this.filterQ),i.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(i),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample),this.measuredGravity.normalize();var r=new MathUtil.Quaternion;r.setFromUnitVectors(this.estimatedGravity,this.measuredGravity),r.inverse(),Util.isDebug()&&console.log("Delta: %d deg, G_est: (%s, %s, %s), G_meas: (%s, %s, %s)",MathUtil.radToDeg*Util.getQuaternionAngle(r),this.estimatedGravity.x.toFixed(1),this.estimatedGravity.y.toFixed(1),this.estimatedGravity.z.toFixed(1),this.measuredGravity.x.toFixed(1),this.measuredGravity.y.toFixed(1),this.measuredGravity.z.toFixed(1));var s=new MathUtil.Quaternion;s.copy(this.filterQ),s.multiply(r),this.filterQ.slerp(s,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},ComplementaryFilter.prototype.getOrientation=function(){return this.filterQ},ComplementaryFilter.prototype.accelToQuaternion_=function(t){var e=new MathUtil.Vector3;e.copy(t),e.normalize();var i=new MathUtil.Quaternion;return i.setFromUnitVectors(new MathUtil.Vector3(0,0,-1),e),i.inverse(),i},ComplementaryFilter.prototype.gyroToQuaternionDelta_=function(t,e){var i=new MathUtil.Quaternion,r=new MathUtil.Vector3;return r.copy(t),r.normalize(),i.setFromAxisAngle(r,t.length()*e),i},module.exports=ComplementaryFilter;
  156. },{"../math-util.js":59,"../util.js":68,"./sensor-sample.js":66}],64:[function(_dereq_,module,exports){
  157. function FusionPoseSensor(){this.deviceId="webvr-polyfill:fused",this.deviceName="VR Position Device (webvr-polyfill:fused)",this.accelerometer=new MathUtil.Vector3,this.gyroscope=new MathUtil.Vector3,this.start(),this.filter=new ComplementaryFilter(window.WebVRConfig.K_FILTER),this.posePredictor=new PosePredictor(window.WebVRConfig.PREDICTION_TIME_S),this.touchPanner=new TouchPanner,this.filterToWorldQ=new MathUtil.Quaternion,Util.isIOS()?this.filterToWorldQ.setFromAxisAngle(new MathUtil.Vector3(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new MathUtil.Vector3(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new MathUtil.Quaternion,this.worldToScreenQ=new MathUtil.Quaternion,this.originalPoseAdjustQ=new MathUtil.Quaternion,this.originalPoseAdjustQ.setFromAxisAngle(new MathUtil.Vector3(0,0,1),-window.orientation*Math.PI/180),this.setScreenTransform_(),Util.isLandscapeMode()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new MathUtil.Quaternion,this.isFirefoxAndroid=Util.isFirefoxAndroid(),this.isIOS=Util.isIOS(),this.orientationOut_=new Float32Array(4)}var ComplementaryFilter=_dereq_("./complementary-filter.js"),PosePredictor=_dereq_("./pose-predictor.js"),TouchPanner=_dereq_("../touch-panner.js"),MathUtil=_dereq_("../math-util.js"),Util=_dereq_("../util.js");FusionPoseSensor.prototype.getPosition=function(){return null},FusionPoseSensor.prototype.getOrientation=function(){var e=this.filter.getOrientation();this.predictedQ=this.posePredictor.getPrediction(e,this.gyroscope,this.previousTimestampS);var t=new MathUtil.Quaternion;return t.copy(this.filterToWorldQ),t.multiply(this.resetQ),window.WebVRConfig.TOUCH_PANNER_DISABLED||t.multiply(this.touchPanner.getOrientation()),t.multiply(this.predictedQ),t.multiply(this.worldToScreenQ),window.WebVRConfig.YAW_ONLY&&(t.x=0,t.z=0,t.normalize()),this.orientationOut_[0]=t.x,this.orientationOut_[1]=t.y,this.orientationOut_[2]=t.z,this.orientationOut_[3]=t.w,this.orientationOut_},FusionPoseSensor.prototype.resetPose=function(){this.resetQ.copy(this.filter.getOrientation()),this.resetQ.x=0,this.resetQ.y=0,this.resetQ.z*=-1,this.resetQ.normalize(),Util.isLandscapeMode()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ),window.WebVRConfig.TOUCH_PANNER_DISABLED||this.touchPanner.resetSensor()},FusionPoseSensor.prototype.onDeviceMotion_=function(e){this.updateDeviceMotion_(e)},FusionPoseSensor.prototype.updateDeviceMotion_=function(e){var t=e.accelerationIncludingGravity,i=e.rotationRate,o=e.timeStamp/1e3,n=o-this.previousTimestampS;return n<=Util.MIN_TIMESTEP||n>Util.MAX_TIMESTEP?(console.warn("Invalid timestamps detected. Time step between successive gyroscope sensor samples is very small or not monotonic"),void(this.previousTimestampS=o)):(this.accelerometer.set(-t.x,-t.y,-t.z),Util.isR7()?this.gyroscope.set(-i.beta,i.alpha,i.gamma):this.gyroscope.set(i.alpha,i.beta,i.gamma),(this.isIOS||this.isFirefoxAndroid)&&this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addAccelMeasurement(this.accelerometer,o),this.filter.addGyroMeasurement(this.gyroscope,o),void(this.previousTimestampS=o))},FusionPoseSensor.prototype.onOrientationChange_=function(e){this.setScreenTransform_()},FusionPoseSensor.prototype.onMessage_=function(e){var t=e.data;if(t&&t.type){var i=t.type.toLowerCase();"devicemotion"===i&&this.updateDeviceMotion_(t.deviceMotionEvent)}},FusionPoseSensor.prototype.setScreenTransform_=function(){switch(this.worldToScreenQ.set(0,0,0,1),window.orientation){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new MathUtil.Vector3(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new MathUtil.Vector3(0,0,1),Math.PI/2);break;case 180:}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},FusionPoseSensor.prototype.start=function(){this.onDeviceMotionCallback_=this.onDeviceMotion_.bind(this),this.onOrientationChangeCallback_=this.onOrientationChange_.bind(this),this.onMessageCallback_=this.onMessage_.bind(this),Util.isIOS()&&Util.isInsideCrossDomainIFrame()&&window.addEventListener("message",this.onMessageCallback_),window.addEventListener("orientationchange",this.onOrientationChangeCallback_),window.addEventListener("devicemotion",this.onDeviceMotionCallback_)},FusionPoseSensor.prototype.stop=function(){window.removeEventListener("devicemotion",this.onDeviceMotionCallback_),window.removeEventListener("orientationchange",this.onOrientationChangeCallback_),window.removeEventListener("message",this.onMessageCallback_)},module.exports=FusionPoseSensor;
  158. },{"../math-util.js":59,"../touch-panner.js":67,"../util.js":68,"./complementary-filter.js":63,"./pose-predictor.js":65}],65:[function(_dereq_,module,exports){
  159. function PosePredictor(t){this.predictionTimeS=t,this.previousQ=new MathUtil.Quaternion,this.previousTimestampS=null,this.deltaQ=new MathUtil.Quaternion,this.outQ=new MathUtil.Quaternion}var MathUtil=_dereq_("../math-util"),Util=_dereq_("../util");PosePredictor.prototype.getPrediction=function(t,i,e){if(!this.previousTimestampS)return this.previousQ.copy(t),this.previousTimestampS=e,t;var o=new MathUtil.Vector3;o.copy(i),o.normalize();var s=i.length();if(s<20*MathUtil.degToRad)return Util.isDebug()&&console.log("Moving slowly, at %s deg/s: no prediction",(MathUtil.radToDeg*s).toFixed(1)),this.outQ.copy(t),this.previousQ.copy(t),this.outQ;var r=(e-this.previousTimestampS,s*this.predictionTimeS);return this.deltaQ.setFromAxisAngle(o,r),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(t),this.previousTimestampS=e,this.outQ},module.exports=PosePredictor;
  160. },{"../math-util":59,"../util":68}],66:[function(_dereq_,module,exports){
  161. function SensorSample(e,t){this.set(e,t)}SensorSample.prototype.set=function(e,t){this.sample=e,this.timestampS=t},SensorSample.prototype.copy=function(e){this.set(e.sample,e.timestampS)},module.exports=SensorSample;
  162. },{}],67:[function(_dereq_,module,exports){
  163. function TouchPanner(){window.addEventListener("touchstart",this.onTouchStart_.bind(this)),window.addEventListener("touchmove",this.onTouchMove_.bind(this)),window.addEventListener("touchend",this.onTouchEnd_.bind(this)),this.isTouching=!1,this.rotateStart=new MathUtil.Vector2,this.rotateEnd=new MathUtil.Vector2,this.rotateDelta=new MathUtil.Vector2,this.theta=0,this.orientation=new MathUtil.Quaternion}var MathUtil=_dereq_("./math-util.js"),Util=_dereq_("./util.js"),ROTATE_SPEED=.5;TouchPanner.prototype.getOrientation=function(){return this.orientation.setFromEulerXYZ(0,0,this.theta),this.orientation},TouchPanner.prototype.resetSensor=function(){this.theta=0},TouchPanner.prototype.onTouchStart_=function(t){t.touches&&1==t.touches.length&&(this.rotateStart.set(t.touches[0].pageX,t.touches[0].pageY),this.isTouching=!0)},TouchPanner.prototype.onTouchMove_=function(t){if(this.isTouching){this.rotateEnd.set(t.touches[0].pageX,t.touches[0].pageY),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart),this.rotateStart.copy(this.rotateEnd),Util.isIOS()&&(this.rotateDelta.x*=-1);var e=document.body;this.theta+=2*Math.PI*this.rotateDelta.x/e.clientWidth*ROTATE_SPEED}},TouchPanner.prototype.onTouchEnd_=function(t){this.isTouching=!1},module.exports=TouchPanner;
  164. },{"./math-util.js":59,"./util.js":68}],68:[function(_dereq_,module,exports){
  165. var Util=window.Util||{};Util.MIN_TIMESTEP=.001,Util.MAX_TIMESTEP=1,Util.base64=function(e,t){return"data:"+e+";base64,"+t},Util.clamp=function(e,t,i){return Math.min(Math.max(t,e),i)},Util.lerp=function(e,t,i){return e+(t-e)*i},Util.race=function(e){return Promise.race?Promise.race(e):new Promise(function(t,i){for(var r=0;r<e.length;r++)e[r].then(t,i)})},Util.isIOS=function(){var e=/iPad|iPhone|iPod/.test(navigator.platform);return function(){return e}}(),Util.isWebViewAndroid=function(){var e=navigator.userAgent.indexOf("Version")!==-1&&navigator.userAgent.indexOf("Android")!==-1&&navigator.userAgent.indexOf("Chrome")!==-1;return function(){return e}}(),Util.isSafari=function(){var e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return e}}(),Util.isFirefoxAndroid=function(){var e=navigator.userAgent.indexOf("Firefox")!==-1&&navigator.userAgent.indexOf("Android")!==-1;return function(){return e}}(),Util.isR7=function(){var e=navigator.userAgent.indexOf("R7 Build")!==-1;return function(){return e}}(),Util.isLandscapeMode=function(){var e=90==window.orientation||window.orientation==-90;return Util.isR7()?!e:e},Util.isTimestampDeltaValid=function(e){return!isNaN(e)&&(!(e<=Util.MIN_TIMESTEP)&&!(e>Util.MAX_TIMESTEP))},Util.getScreenWidth=function(){return Math.max(window.screen.width,window.screen.height)*window.devicePixelRatio},Util.getScreenHeight=function(){return Math.min(window.screen.width,window.screen.height)*window.devicePixelRatio},Util.requestFullscreen=function(e){if(Util.isWebViewAndroid())return!1;if(e.requestFullscreen)e.requestFullscreen();else if(e.webkitRequestFullscreen)e.webkitRequestFullscreen();else if(e.mozRequestFullScreen)e.mozRequestFullScreen();else{if(!e.msRequestFullscreen)return!1;e.msRequestFullscreen()}return!0},Util.exitFullscreen=function(){if(document.exitFullscreen)document.exitFullscreen();else if(document.webkitExitFullscreen)document.webkitExitFullscreen();else if(document.mozCancelFullScreen)document.mozCancelFullScreen();else{if(!document.msExitFullscreen)return!1;document.msExitFullscreen()}return!0},Util.getFullscreenElement=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},Util.linkProgram=function(e,t,i,r){var n=e.createShader(e.VERTEX_SHADER);e.shaderSource(n,t),e.compileShader(n);var o=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(o,i),e.compileShader(o);var a=e.createProgram();e.attachShader(a,n),e.attachShader(a,o);for(var l in r)e.bindAttribLocation(a,r[l],l);return e.linkProgram(a),e.deleteShader(n),e.deleteShader(o),a},Util.getProgramUniforms=function(e,t){for(var i={},r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),n="",o=0;o<r;o++){var a=e.getActiveUniform(t,o);n=a.name.replace("[0]",""),i[n]=e.getUniformLocation(t,n)}return i},Util.orthoMatrix=function(e,t,i,r,n,o,a){var l=1/(t-i),c=1/(r-n),u=1/(o-a);return e[0]=-2*l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+i)*l,e[13]=(n+r)*c,e[14]=(a+o)*u,e[15]=1,e},Util.copyArray=function(e,t){for(var i=0,r=e.length;i<r;i++)t[i]=e[i]},Util.isMobile=function(){var e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0)}(navigator.userAgent||navigator.vendor||window.opera),e},Util.extend=function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},Util.safariCssSizeWorkaround=function(e){if(Util.isIOS()){var t=e.style.width,i=e.style.height;e.style.width=parseInt(t)+1+"px",e.style.height=parseInt(i)+"px",setTimeout(function(){e.style.width=t,e.style.height=i},100)}window.Util=Util,window.canvas=e},Util.isDebug=function(){return Util.getQueryParameter("debug")},Util.getQueryParameter=function(e){var e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),t=new RegExp("[\\?&]"+e+"=([^&#]*)"),i=t.exec(location.search);return null===i?"":decodeURIComponent(i[1].replace(/\+/g," "))},Util.frameDataFromPose=function(){function e(e,t,i,r){var n=Math.tan(t?t.upDegrees*o:a),l=Math.tan(t?t.downDegrees*o:a),c=Math.tan(t?t.leftDegrees*o:a),u=Math.tan(t?t.rightDegrees*o:a),s=2/(c+u),m=2/(n+l);return e[0]=s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=m,e[6]=0,e[7]=0,e[8]=-((c-u)*s*.5),e[9]=(n-l)*m*.5,e[10]=r/(i-r),e[11]=-1,e[12]=0,e[13]=0,e[14]=r*i/(i-r),e[15]=0,e}function t(e,t,i){var r=t[0],n=t[1],o=t[2],a=t[3],l=r+r,c=n+n,u=o+o,s=r*l,m=r*c,d=r*u,f=n*c,g=n*u,w=o*u,p=a*l,h=a*c,v=a*u;return e[0]=1-(f+w),e[1]=m+v,e[2]=d-h,e[3]=0,e[4]=m-v,e[5]=1-(s+w),e[6]=g+p,e[7]=0,e[8]=d+h,e[9]=g-p,e[10]=1-(s+f),e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e}function i(e,t,i){var r,n,o,a,l,c,u,s,m,d,f,g,w=i[0],p=i[1],h=i[2];return t===e?(e[12]=t[0]*w+t[4]*p+t[8]*h+t[12],e[13]=t[1]*w+t[5]*p+t[9]*h+t[13],e[14]=t[2]*w+t[6]*p+t[10]*h+t[14],e[15]=t[3]*w+t[7]*p+t[11]*h+t[15]):(r=t[0],n=t[1],o=t[2],a=t[3],l=t[4],c=t[5],u=t[6],s=t[7],m=t[8],d=t[9],f=t[10],g=t[11],e[0]=r,e[1]=n,e[2]=o,e[3]=a,e[4]=l,e[5]=c,e[6]=u,e[7]=s,e[8]=m,e[9]=d,e[10]=f,e[11]=g,e[12]=r*w+l*p+m*h+t[12],e[13]=n*w+c*p+d*h+t[13],e[14]=o*w+u*p+f*h+t[14],e[15]=a*w+s*p+g*h+t[15]),e}function r(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],a=t[4],l=t[5],c=t[6],u=t[7],s=t[8],m=t[9],d=t[10],f=t[11],g=t[12],w=t[13],p=t[14],h=t[15],v=i*l-r*a,U=i*c-n*a,b=i*u-o*a,x=r*c-n*l,k=r*u-o*l,F=n*u-o*c,y=s*w-m*g,P=s*p-d*g,S=s*h-f*g,M=m*p-d*w,E=m*h-f*w,A=d*h-f*p,R=v*A-U*E+b*M+x*S-k*P+F*y;return R?(R=1/R,e[0]=(l*A-c*E+u*M)*R,e[1]=(n*E-r*A-o*M)*R,e[2]=(w*F-p*k+h*x)*R,e[3]=(d*k-m*F-f*x)*R,e[4]=(c*S-a*A-u*P)*R,e[5]=(i*A-n*S+o*P)*R,e[6]=(p*b-g*F-h*U)*R,e[7]=(s*F-d*b+f*U)*R,e[8]=(a*E-l*S+u*y)*R,e[9]=(r*S-i*E-o*y)*R,e[10]=(g*k-w*b+h*v)*R,e[11]=(m*b-s*k-f*v)*R,e[12]=(l*P-a*M-c*y)*R,e[13]=(i*M-r*P+n*y)*R,e[14]=(w*U-g*x-p*v)*R,e[15]=(s*x-m*U+d*v)*R,e):null}function n(n,o,a,u,s){e(n,u?u.fieldOfView:null,s.depthNear,s.depthFar);var m=a.orientation||l,d=a.position||c;t(o,m,d),u&&i(o,o,u.offset),r(o,o)}var o=Math.PI/180,a=.25*Math.PI,l=new Float32Array([0,0,0,1]),c=new Float32Array([0,0,0]);return function(e,t,i){return!(!e||!t)&&(e.pose=t,e.timestamp=t.timestamp,n(e.leftProjectionMatrix,e.leftViewMatrix,t,i.getEyeParameters("left"),i),n(e.rightProjectionMatrix,e.rightViewMatrix,t,i.getEyeParameters("right"),i),!0)}}(),Util.isInsideCrossDomainIFrame=function(){var e=window.self!==window.top,t=Util.getDomainFromUrl(document.referrer),i=Util.getDomainFromUrl(window.location.href);return e&&t!==i},Util.getDomainFromUrl=function(e){var t;return t=e.indexOf("://")>-1?e.split("/")[2]:e.split("/")[0],t=t.split(":")[0]},module.exports=Util;
  166. },{}],69:[function(_dereq_,module,exports){
  167. function ViewerSelector(){try{this.selectedKey=localStorage.getItem(VIEWER_KEY)}catch(e){console.error("Failed to load viewer profile: %s",e)}this.selectedKey||(this.selectedKey=DEFAULT_VIEWER),this.dialog=this.createDialog_(DeviceInfo.Viewers),this.root=null,this.onChangeCallbacks_=[]}var DeviceInfo=_dereq_("./device-info.js"),Util=_dereq_("./util.js"),DEFAULT_VIEWER="CardboardV1",VIEWER_KEY="WEBVR_CARDBOARD_VIEWER",CLASS_NAME="webvr-polyfill-viewer-selector";ViewerSelector.prototype.show=function(e){this.root=e,e.appendChild(this.dialog);var t=this.dialog.querySelector("#"+this.selectedKey);t.checked=!0,this.dialog.style.display="block"},ViewerSelector.prototype.hide=function(){this.root&&this.root.contains(this.dialog)&&this.root.removeChild(this.dialog),this.dialog.style.display="none"},ViewerSelector.prototype.getCurrentViewer=function(){return DeviceInfo.Viewers[this.selectedKey]},ViewerSelector.prototype.getSelectedKey_=function(){var e=this.dialog.querySelector("input[name=field]:checked");return e?e.id:null},ViewerSelector.prototype.onChange=function(e){this.onChangeCallbacks_.push(e)},ViewerSelector.prototype.fireOnChange_=function(e){for(var t=0;t<this.onChangeCallbacks_.length;t++)this.onChangeCallbacks_[t](e)},ViewerSelector.prototype.onSave_=function(){if(this.selectedKey=this.getSelectedKey_(),!this.selectedKey||!DeviceInfo.Viewers[this.selectedKey])return void console.error("ViewerSelector.onSave_: this should never happen!");this.fireOnChange_(DeviceInfo.Viewers[this.selectedKey]);try{localStorage.setItem(VIEWER_KEY,this.selectedKey)}catch(e){console.error("Failed to save viewer profile: %s",e)}this.hide()},ViewerSelector.prototype.createDialog_=function(e){var t=document.createElement("div");t.classList.add(CLASS_NAME),t.style.display="none";var i=document.createElement("div"),o=i.style;o.position="fixed",o.left=0,o.top=0,o.width="100%",o.height="100%",o.background="rgba(0, 0, 0, 0.3)",i.addEventListener("click",this.hide.bind(this));var r=280,n=document.createElement("div"),o=n.style;o.boxSizing="border-box",o.position="fixed",o.top="24px",o.left="50%",o.marginLeft=-r/2+"px",o.width=r+"px",o.padding="24px",o.overflow="hidden",o.background="#fafafa",o.fontFamily="'Roboto', sans-serif",o.boxShadow="0px 5px 20px #666",n.appendChild(this.createH1_("Select your viewer"));for(var l in e)n.appendChild(this.createChoice_(l,e[l].label));return n.appendChild(this.createButton_("Save",this.onSave_.bind(this))),t.appendChild(i),t.appendChild(n),t},ViewerSelector.prototype.createH1_=function(e){var t=document.createElement("h1"),i=t.style;return i.color="black",i.fontSize="20px",i.fontWeight="bold",i.marginTop=0,i.marginBottom="24px",t.innerHTML=e,t},ViewerSelector.prototype.createChoice_=function(e,t){var i=document.createElement("div");i.style.marginTop="8px",i.style.color="black";var o=document.createElement("input");o.style.fontSize="30px",o.setAttribute("id",e),o.setAttribute("type","radio"),o.setAttribute("value",e),o.setAttribute("name","field");var r=document.createElement("label");return r.style.marginLeft="4px",r.setAttribute("for",e),r.innerHTML=t,i.appendChild(o),i.appendChild(r),i},ViewerSelector.prototype.createButton_=function(e,t){var i=document.createElement("button");i.innerHTML=e;var o=i.style;return o.float="right",o.textTransform="uppercase",o.color="#1094f7",o.fontSize="14px",o.letterSpacing=0,o.border=0,o.background="none",o.marginTop="16px",i.addEventListener("click",t),i},module.exports=ViewerSelector;
  168. },{"./device-info.js":53,"./util.js":68}],70:[function(_dereq_,module,exports){
  169. function AndroidWakeLock(){function A(A,e,o){var t=document.createElement("source");t.src=o,t.type="video/"+e,A.appendChild(t)}var e=document.createElement("video");e.setAttribute("loop",""),A(e,"webm",Util.base64("video/webm","GkXfo0AgQoaBAUL3gQFC8oEEQvOBCEKCQAR3ZWJtQoeBAkKFgQIYU4BnQI0VSalmQCgq17FAAw9CQE2AQAZ3aGFtbXlXQUAGd2hhbW15RIlACECPQAAAAAAAFlSua0AxrkAu14EBY8WBAZyBACK1nEADdW5khkAFVl9WUDglhohAA1ZQOIOBAeBABrCBCLqBCB9DtnVAIueBAKNAHIEAAIAwAQCdASoIAAgAAUAmJaQAA3AA/vz0AAA=")),A(e,"mp4",Util.base64("video/mp4","AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAAAhmcmVlAAAAG21kYXQAAAGzABAHAAABthADAowdbb9/AAAC6W1vb3YAAABsbXZoZAAAAAB8JbCAfCWwgAAAA+gAAAAAAAEAAAEAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIVdHJhawAAAFx0a2hkAAAAD3wlsIB8JbCAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAIAAAACAAAAAABsW1kaWEAAAAgbWRoZAAAAAB8JbCAfCWwgAAAA+gAAAAAVcQAAAAAAC1oZGxyAAAAAAAAAAB2aWRlAAAAAAAAAAAAAAAAVmlkZW9IYW5kbGVyAAAAAVxtaW5mAAAAFHZtaGQAAAABAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAEcc3RibAAAALhzdHNkAAAAAAAAAAEAAACobXA0dgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAIAAgASAAAAEgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABj//wAAAFJlc2RzAAAAAANEAAEABDwgEQAAAAADDUAAAAAABS0AAAGwAQAAAbWJEwAAAQAAAAEgAMSNiB9FAEQBFGMAAAGyTGF2YzUyLjg3LjQGAQIAAAAYc3R0cwAAAAAAAAABAAAAAQAAAAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAFHN0c3oAAAAAAAAAEwAAAAEAAAAUc3RjbwAAAAAAAAABAAAALAAAAGB1ZHRhAAAAWG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAK2lsc3QAAAAjqXRvbwAAABtkYXRhAAAAAQAAAABMYXZmNTIuNzguMw==")),this.request=function(){e.paused&&e.play()},this.release=function(){e.pause()}}function iOSWakeLock(){var A=null;this.request=function(){A||(A=setInterval(function(){window.location=window.location,setTimeout(window.stop,0)},3e4))},this.release=function(){A&&(clearInterval(A),A=null)}}function getWakeLock(){var A=navigator.userAgent||navigator.vendor||window.opera;return A.match(/iPhone/i)||A.match(/iPod/i)?iOSWakeLock:AndroidWakeLock}var Util=_dereq_("./util.js");module.exports=getWakeLock();
  170. },{"./util.js":68}],71:[function(_dereq_,module,exports){
  171. function WebVRPolyfill(){this.displays=[],this.devices=[],this.devicesPopulated=!1,this.nativeWebVRAvailable=this.isWebVRAvailable(),this.nativeLegacyWebVRAvailable=this.isDeprecatedWebVRAvailable(),this.nativeGetVRDisplaysFunc=this.nativeWebVRAvailable?navigator.getVRDisplays:null,this.nativeLegacyWebVRAvailable||this.nativeWebVRAvailable||(this.enablePolyfill(),window.WebVRConfig.ENABLE_DEPRECATED_API&&this.enableDeprecatedPolyfill()),InstallWebVRSpecShim()}function InstallWebVRSpecShim(){"VRDisplay"in window&&!("VRFrameData"in window)&&(window.VRFrameData=VRFrameData,"depthNear"in window.VRDisplay.prototype||(window.VRDisplay.prototype.depthNear=.01),"depthFar"in window.VRDisplay.prototype||(window.VRDisplay.prototype.depthFar=1e4),window.VRDisplay.prototype.getFrameData=function(e){return Util.frameDataFromPose(e,this.getPose(),this)})}var Util=_dereq_("./util.js"),CardboardVRDisplay=_dereq_("./cardboard-vr-display.js"),MouseKeyboardVRDisplay=_dereq_("./mouse-keyboard-vr-display.js"),VRDisplay=_dereq_("./base.js").VRDisplay,VRFrameData=_dereq_("./base.js").VRFrameData,HMDVRDevice=_dereq_("./base.js").HMDVRDevice,PositionSensorVRDevice=_dereq_("./base.js").PositionSensorVRDevice,VRDisplayHMDDevice=_dereq_("./display-wrappers.js").VRDisplayHMDDevice,VRDisplayPositionSensorDevice=_dereq_("./display-wrappers.js").VRDisplayPositionSensorDevice,version=_dereq_("../package.json").version;WebVRPolyfill.prototype.isWebVRAvailable=function(){return"getVRDisplays"in navigator},WebVRPolyfill.prototype.isDeprecatedWebVRAvailable=function(){return"getVRDevices"in navigator||"mozGetVRDevices"in navigator},WebVRPolyfill.prototype.connectDisplay=function(e){e.fireVRDisplayConnect_(),this.displays.push(e)},WebVRPolyfill.prototype.populateDevices=function(){if(!this.devicesPopulated){var e=null;this.isCardboardCompatible()&&(e=new CardboardVRDisplay,this.connectDisplay(e),window.WebVRConfig.ENABLE_DEPRECATED_API&&(this.devices.push(new VRDisplayHMDDevice(e)),this.devices.push(new VRDisplayPositionSensorDevice(e)))),this.isMobile()||window.WebVRConfig.MOUSE_KEYBOARD_CONTROLS_DISABLED||(e=new MouseKeyboardVRDisplay,this.connectDisplay(e),window.WebVRConfig.ENABLE_DEPRECATED_API&&(this.devices.push(new VRDisplayHMDDevice(e)),this.devices.push(new VRDisplayPositionSensorDevice(e)))),this.devicesPopulated=!0}},WebVRPolyfill.prototype.enablePolyfill=function(){if(navigator.getVRDisplays=this.getVRDisplays.bind(this),this.nativeWebVRAvailable&&window.VRFrameData){var e=window.VRFrameData,i=new window.VRFrameData,t=window.VRDisplay.prototype.getFrameData;window.VRFrameData=VRFrameData,window.VRDisplay.prototype.getFrameData=function(a){return a instanceof e?void t.call(this,a):(t.call(this,i),a.pose=i.pose,Util.copyArray(i.leftProjectionMatrix,a.leftProjectionMatrix),Util.copyArray(i.rightProjectionMatrix,a.rightProjectionMatrix),Util.copyArray(i.leftViewMatrix,a.leftViewMatrix),void Util.copyArray(i.rightViewMatrix,a.rightViewMatrix))}}if(window.VRDisplay=VRDisplay,navigator&&"undefined"==typeof navigator.vrEnabled){var a=this;Object.defineProperty(navigator,"vrEnabled",{get:function(){return a.isCardboardCompatible()&&(a.isFullScreenAvailable()||Util.isIOS())}})}"VRFrameData"in window||(window.VRFrameData=VRFrameData)},WebVRPolyfill.prototype.enableDeprecatedPolyfill=function(){navigator.getVRDevices=this.getVRDevices.bind(this),window.HMDVRDevice=HMDVRDevice,window.PositionSensorVRDevice=PositionSensorVRDevice},WebVRPolyfill.prototype.getVRDisplays=function(){this.populateDevices();var e=this.displays;if(!this.nativeWebVRAvailable)return Promise.resolve(e);var i,t=this.nativeGetVRDisplaysFunc.call(navigator),a=new Promise(function(e){i=setTimeout(function(){console.warn("Native WebVR implementation detected, but `getVRDisplays()` failed to resolve. Falling back to polyfill."),e([])},window.WebVRConfig.GET_VR_DISPLAYS_TIMEOUT)});return Util.race([t,a]).then(function(t){return clearTimeout(i),window.WebVRConfig.ALWAYS_APPEND_POLYFILL_DISPLAY?t.concat(e):t.length>0?t:e})},WebVRPolyfill.prototype.getVRDevices=function(){console.warn("getVRDevices is deprecated. Please update your code to use getVRDisplays instead.");var e=this;return new Promise(function(i,t){try{if(!e.devicesPopulated){if(e.nativeWebVRAvailable)return navigator.getVRDisplays(function(t){for(var a=0;a<t.length;++a)e.devices.push(new VRDisplayHMDDevice(t[a])),e.devices.push(new VRDisplayPositionSensorDevice(t[a]));e.devicesPopulated=!0,i(e.devices)},t);if(e.nativeLegacyWebVRAvailable)return(navigator.getVRDDevices||navigator.mozGetVRDevices)(function(t){for(var a=0;a<t.length;++a)t[a]instanceof HMDVRDevice&&e.devices.push(t[a]),t[a]instanceof PositionSensorVRDevice&&e.devices.push(t[a]);e.devicesPopulated=!0,i(e.devices)},t)}e.populateDevices(),i(e.devices)}catch(e){t(e)}})},WebVRPolyfill.prototype.NativeVRFrameData=window.VRFrameData,WebVRPolyfill.prototype.isMobile=function(){return/Android/i.test(navigator.userAgent)||/iPhone|iPad|iPod/i.test(navigator.userAgent)},WebVRPolyfill.prototype.isCardboardCompatible=function(){return this.isMobile()||window.WebVRConfig.FORCE_ENABLE_VR},WebVRPolyfill.prototype.isFullScreenAvailable=function(){return document.fullscreenEnabled||document.mozFullScreenEnabled||document.webkitFullscreenEnabled||!1},WebVRPolyfill.InstallWebVRSpecShim=InstallWebVRSpecShim,WebVRPolyfill.version=version,module.exports.WebVRPolyfill=WebVRPolyfill;
  172. },{"../package.json":47,"./base.js":48,"./cardboard-vr-display.js":51,"./display-wrappers.js":54,"./mouse-keyboard-vr-display.js":60,"./util.js":68}],72:[function(_dereq_,module,exports){
  173. function idxOf(e,n,r,t){var i=e.indexOf(n,r);return i===-1||i>t?t:i}function isWhitespace(e){return whitespace.test(e)}function pre(e,n,r,t,i){for(var a=[],o=r,s=r;s<t&&s<n.length;s++){var h=n.charAt(s),u=newline.test(h);if(u||s===t-1){var f=u?s:s+1,p=e(n,o,f,i);a.push(p),o=s+1}}return a}function greedy(e,n,r,t,i,a){var o=[],s=i;for("nowrap"===a&&(s=Number.MAX_VALUE);r<t&&r<n.length;){for(var h=idxOf(n,newlineChar,r,t);r<h&&isWhitespace(n.charAt(r));)r++;var u=e(n,r,h,s),f=r+(u.end-u.start),p=f+newlineChar.length;if(f<h){for(;f>r&&!isWhitespace(n.charAt(f));)f--;if(f===r)p>r+newlineChar.length&&p--,f=p;else for(p=f;f>r&&isWhitespace(n.charAt(f-newlineChar.length));)f--}if(f>=r){var c=e(n,r,f,s);o.push(c)}r=p}return o}function monospace(e,n,r,t){var i=Math.min(t,r-n);return{start:n,end:n+i}}var newline=/\n/,newlineChar="\n",whitespace=/\s/;module.exports=function(e,n){var r=module.exports.lines(e,n);return r.map(function(n){return e.substring(n.start,n.end)}).join("\n")},module.exports.lines=function(e,n){if(n=n||{},0===n.width&&"nowrap"!==n.mode)return[];e=e||"";var r="number"==typeof n.width?n.width:Number.MAX_VALUE,t=Math.max(0,n.start||0),i="number"==typeof n.end?n.end:e.length,a=n.mode,o=n.measure||monospace;return"pre"===a?pre(o,e,t,i,r):greedy(o,e,t,i,r,a)};
  174. },{}],73:[function(_dereq_,module,exports){
  175. "use strict";function forEachArray(e,t){for(var r=0;r<e.length;r++)t(e[r])}function isEmpty(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function initParams(e,t,r){var n=e;return isFunction(t)?(r=t,"string"==typeof e&&(n={uri:e})):n=xtend(t,{uri:e}),n.callback=r,n}function createXHR(e,t,r){return t=initParams(e,t,r),_createXHR(t)}function _createXHR(e){function t(){4===i.readyState&&o()}function r(){var e=void 0;if(e=i.response?i.response:i.responseText||getXml(i),X)try{e=JSON.parse(e)}catch(e){}return e}function n(e){return clearTimeout(d),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,a(e,h)}function o(){if(!c){var t;clearTimeout(d),t=e.useXDR&&void 0===i.status?200:1223===i.status?204:i.status;var n=h,o=null;return 0!==t?(n={body:r(),statusCode:t,method:l,headers:{},url:p,rawRequest:i},i.getAllResponseHeaders&&(n.headers=parseHeaders(i.getAllResponseHeaders()))):o=new Error("Internal XMLHttpRequest Error"),a(o,n,n.body)}}if("undefined"==typeof e.callback)throw new Error("callback argument missing");var s=!1,a=function(t,r,n){s||(s=!0,e.callback(t,r,n))},i=e.xhr||null;i||(i=e.cors||e.useXDR?new createXHR.XDomainRequest:new createXHR.XMLHttpRequest);var u,c,d,p=i.url=e.uri||e.url,l=i.method=e.method||"GET",f=e.body||e.data,m=i.headers=e.headers||{},R=!!e.sync,X=!1,h={body:void 0,headers:{},statusCode:0,method:l,url:p,rawRequest:i};if("json"in e&&e.json!==!1&&(X=!0,m.accept||m.Accept||(m.Accept="application/json"),"GET"!==l&&"HEAD"!==l&&(m["content-type"]||m["Content-Type"]||(m["Content-Type"]="application/json"),f=JSON.stringify(e.json===!0?f:e.json))),i.onreadystatechange=t,i.onload=o,i.onerror=n,i.onprogress=function(){},i.onabort=function(){c=!0},i.ontimeout=n,i.open(l,p,!R,e.username,e.password),R||(i.withCredentials=!!e.withCredentials),!R&&e.timeout>0&&(d=setTimeout(function(){if(!c){c=!0,i.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",n(e)}},e.timeout)),i.setRequestHeader)for(u in m)m.hasOwnProperty(u)&&i.setRequestHeader(u,m[u]);else if(e.headers&&!isEmpty(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(i.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(i),i.send(f||null),i}function getXml(e){if("document"===e.responseType)return e.responseXML;var t=204===e.status&&e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;return""!==e.responseType||t?null:e.responseXML}function noop(){}var window=_dereq_("global/window"),isFunction=_dereq_("is-function"),parseHeaders=_dereq_("parse-headers"),xtend=_dereq_("xtend");module.exports=createXHR,createXHR.XMLHttpRequest=window.XMLHttpRequest||noop,createXHR.XDomainRequest="withCredentials"in new createXHR.XMLHttpRequest?createXHR.XMLHttpRequest:window.XDomainRequest,forEachArray(["get","put","post","patch","head","delete"],function(e){createXHR["delete"===e?"del":e]=function(t,r,n){return r=initParams(t,r,n),r.method=e.toUpperCase(),_createXHR(r)}});
  176. },{"global/window":15,"is-function":20,"parse-headers":31,"xtend":75}],74:[function(_dereq_,module,exports){
  177. module.exports=function(){return"undefined"!=typeof window.DOMParser?function(e){var n=new window.DOMParser;return n.parseFromString(e,"application/xml")}:"undefined"!=typeof window.ActiveXObject&&new window.ActiveXObject("Microsoft.XMLDOM")?function(e){var n=new window.ActiveXObject("Microsoft.XMLDOM");return n.async="false",n.loadXML(e),n}:function(e){var n=document.createElement("div");return n.innerHTML=e,n}}();
  178. },{}],75:[function(_dereq_,module,exports){
  179. function extend(){for(var r={},e=0;e<arguments.length;e++){var t=arguments[e];for(var n in t)hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r}module.exports=extend;var hasOwnProperty=Object.prototype.hasOwnProperty;
  180. },{}],76:[function(_dereq_,module,exports){
  181. module.exports={"name":"aframe","version":"0.7.0","description":"A web framework for building virtual reality experiences.","homepage":"https://aframe.io/","main":"dist/aframe-master.js","scripts":{"browserify":"browserify src/index.js -s 'AFRAME' -p browserify-derequire","build":"shx mkdir -p build/ && npm run browserify -- --debug -t [envify --INSPECTOR_VERSION dev] -o build/aframe.js","codecov":"codecov","dev":"npm run build && cross-env INSPECTOR_VERSION=dev node ./scripts/budo -t envify","dist":"node scripts/updateVersionLog.js && npm run dist:min && npm run dist:max","dist:max":"npm run browserify -s -- --debug | exorcist dist/aframe-master.js.map > dist/aframe-master.js","dist:min":"npm run browserify -s -- --debug -p [minifyify --map aframe-master.min.js.map --output dist/aframe-master.min.js.map] -o dist/aframe-master.min.js","docs":"markserv --dir docs --port 9001","preghpages":"node ./scripts/preghpages.js","ghpages":"ghpages -p gh-pages/","lint":"semistandard -v | snazzy","lint:fix":"semistandard --fix","precommit":"npm run lint","prepush":"node scripts/testOnlyCheck.js","prerelease":"node scripts/release.js 0.6.1 0.7.0","start":"npm run dev","test":"karma start ./tests/karma.conf.js","test:docs":"node scripts/docsLint.js","test:firefox":"npm test -- --browsers Firefox","test:chrome":"npm test -- --browsers Chrome","test:node":"mocha --ui tdd tests/node"},"repository":"aframevr/aframe","license":"MIT","dependencies":{"@tweenjs/tween.js":"^16.8.0","browserify-css":"^0.8.2","debug":"ngokevin/debug#noTimestamp","deep-assign":"^2.0.0","document-register-element":"dmarcos/document-register-element#8ccc532b7","envify":"^3.4.1","load-bmfont":"^1.2.3","object-assign":"^4.0.1","present":"0.0.6","promise-polyfill":"^3.1.0","style-attr":"^1.0.2","three":"github:dmarcos/three.js#r89fix","three-bmfont-text":"^2.1.0","webvr-polyfill":"^0.9.40"},"devDependencies":{"browserify":"^13.1.0","browserify-derequire":"^0.9.4","browserify-istanbul":"^2.0.0","budo":"^9.2.0","chai":"^3.5.0","chai-shallow-deep-equal":"^1.4.0","chalk":"^1.1.3","codecov":"^1.0.1","cross-env":"^5.0.1","exorcist":"^0.4.0","ghpages":"0.0.8","git-rev":"^0.2.1","glob":"^7.1.1","husky":"^0.11.7","istanbul":"^0.4.5","jsdom":"^9.11.0","karma":"1.4.1","karma-browserify":"^5.1.0","karma-chai-shallow-deep-equal":"0.0.4","karma-chrome-launcher":"^2.0.0","karma-coverage":"^1.1.1","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.0.0","karma-mocha":"^1.1.1","karma-mocha-reporter":"^2.1.0","karma-sinon-chai":"1.2.4","lolex":"^1.5.1","markserv":"github:sukima/markserv#feature/fix-broken-websoketio-link","minifyify":"^7.3.3","mocha":"^3.0.2","mozilla-download":"^1.1.1","replace-in-file":"^2.5.3","semistandard":"^9.0.0","shelljs":"^0.7.7","shx":"^0.2.2","sinon":"^1.17.5","sinon-chai":"2.8.0","snazzy":"^5.0.0","too-wordy":"ngokevin/too-wordy","uglifyjs":"^2.4.10","write-good":"^0.9.1"},"link":true,"browserify":{"transform":["browserify-css","envify"]},"semistandard":{"ignore":["build/**","dist/**","examples/**/shaders/*.js","**/vendor/**"]},"keywords":["3d","aframe","cardboard","components","oculus","three","three.js","rift","vive","vr","web-components","webvr"],"browserify-css":{"minify":true},"engines":{"node":">= 4.6.0","npm":"^2.15.9"}}
  182. },{}],77:[function(_dereq_,module,exports){
  183. var registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three");module.exports.Component=registerComponent("camera",{schema:{active:{default:!0},far:{default:1e4},fov:{default:80,min:0},near:{default:.005,min:0},spectator:{default:!1},zoom:{default:1,min:0}},init:function(){var e,t=this.el;e=this.camera=new THREE.PerspectiveCamera,t.setObject3D("camera",e)},update:function(e){var t=this.data,a=this.camera;a.aspect=t.aspect||window.innerWidth/window.innerHeight,a.far=t.far,a.fov=t.fov,a.near=t.near,a.zoom=t.zoom,a.updateProjectionMatrix(),this.updateActiveCamera(e),this.updateSpectatorCamera(e)},updateActiveCamera:function(e){var t=this.data,a=this.el,r=this.system;e&&e.active===t.active||t.spectator||(t.active&&r.activeCameraEl!==a?r.setActiveCamera(a):t.active||r.activeCameraEl!==a||r.disableActiveCamera())},updateSpectatorCamera:function(e){var t=this.data,a=this.el,r=this.system;e&&e.spectator===t.spectator||(t.spectator&&r.spectatorCameraEl!==a?r.setSpectatorCamera(a):t.spectator||r.spectatorCameraEl!==a||r.disableSpectatorCamera())},remove:function(){this.el.removeObject3D("camera")}});
  184. },{"../core/component":126,"../lib/three":174}],78:[function(_dereq_,module,exports){
  185. var registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three");module.exports.Component=registerComponent("collada-model",{schema:{type:"asset"},init:function(){this.model=null,this.loader=new THREE.ColladaLoader,this.loader.options.convertUpAxis=!0},update:function(){var e=this,o=this.el,t=this.data;t&&(this.remove(),this.loader.load(t,function(t){e.model=t.scene,o.setObject3D("mesh",e.model),o.emit("model-loaded",{format:"collada",model:e.model})}))},remove:function(){this.model&&this.el.removeObject3D("mesh")}});
  186. },{"../core/component":126,"../lib/three":174}],79:[function(_dereq_,module,exports){
  187. var registerComponent=_dereq_("../core/component").registerComponent,utils=_dereq_("../utils/"),bind=utils.bind,EVENTS={CLICK:"click",FUSING:"fusing",MOUSEENTER:"mouseenter",MOUSEDOWN:"mousedown",MOUSELEAVE:"mouseleave",MOUSEUP:"mouseup"},STATES={FUSING:"cursor-fusing",HOVERING:"cursor-hovering",HOVERED:"cursor-hovered"},CANVAS_EVENTS={DOWN:["mousedown","touchstart"],UP:["mouseup","touchend"]};module.exports.Component=registerComponent("cursor",{dependencies:["raycaster"],schema:{downEvents:{default:[]},fuse:{default:utils.device.isMobile()},fuseTimeout:{default:1500,min:0},upEvents:{default:[]},rayOrigin:{default:"entity",oneOf:["mouse","entity"]}},init:function(){var e=this;this.fuseTimeout=void 0,this.cursorDownEl=null,this.intersection=null,this.intersectedEl=null,this.canvasBounds=document.body.getBoundingClientRect(),this.updateCanvasBounds=utils.debounce(function(){e.canvasBounds=e.el.sceneEl.canvas.getBoundingClientRect()},200),this.eventDetail={},this.intersectedEventDetail={cursorEl:this.el},this.onCursorDown=bind(this.onCursorDown,this),this.onCursorUp=bind(this.onCursorUp,this),this.onIntersection=bind(this.onIntersection,this),this.onIntersectionCleared=bind(this.onIntersectionCleared,this),this.onMouseMove=bind(this.onMouseMove,this)},update:function(e){this.data.rayOrigin!==e.rayOrigin&&this.updateMouseEventListeners()},play:function(){this.addEventListeners()},pause:function(){this.removeEventListeners()},remove:function(){var e=this.el;e.removeState(STATES.HOVERING),e.removeState(STATES.FUSING),clearTimeout(this.fuseTimeout),this.intersectedEl&&this.intersectedEl.removeState(STATES.HOVERED),this.removeEventListeners()},addEventListeners:function(){function e(){t=s.sceneEl.canvas,n.downEvents.length||n.upEvents.length||(CANVAS_EVENTS.DOWN.forEach(function(e){t.addEventListener(e,i.onCursorDown)}),CANVAS_EVENTS.UP.forEach(function(e){t.addEventListener(e,i.onCursorUp)}))}var t,n=this.data,s=this.el,i=this;t=s.sceneEl.canvas,t?e():s.sceneEl.addEventListener("render-target-loaded",e),n.downEvents.forEach(function(e){s.addEventListener(e,i.onCursorDown)}),n.upEvents.forEach(function(e){s.addEventListener(e,i.onCursorUp)}),s.addEventListener("raycaster-intersection",this.onIntersection),s.addEventListener("raycaster-intersection-cleared",this.onIntersectionCleared),window.addEventListener("resize",this.updateCanvasBounds)},removeEventListeners:function(){var e,t=this.data,n=this.el,s=this;e=n.sceneEl.canvas,!e||t.downEvents.length||t.upEvents.length||(CANVAS_EVENTS.DOWN.forEach(function(t){e.removeEventListener(t,s.onCursorDown)}),CANVAS_EVENTS.UP.forEach(function(t){e.removeEventListener(t,s.onCursorUp)})),t.downEvents.forEach(function(e){n.removeEventListener(e,s.onCursorDown)}),t.upEvents.forEach(function(e){n.removeEventListener(e,s.onCursorUp)}),n.removeEventListener("raycaster-intersection",this.onIntersection),n.removeEventListener("raycaster-intersection-cleared",this.onIntersectionCleared),e.removeEventListener("mousemove",this.onMouseMove),e.removeEventListener("touchstart",this.onMouseMove),e.removeEventListener("touchmove",this.onMouseMove),e.removeEventListener("resize",this.updateCanvasBounds)},updateMouseEventListeners:function(){var e,t=this.el;e=t.sceneEl.canvas,e.removeEventListener("mousemove",this.onMouseMove),e.removeEventListener("touchmove",this.onMouseMove),t.setAttribute("raycaster","useWorldCoordinates",!1),"mouse"===this.data.rayOrigin&&(e.addEventListener("mousemove",this.onMouseMove,!1),e.addEventListener("touchmove",this.onMouseMove,!1),t.setAttribute("raycaster","useWorldCoordinates",!0),this.updateCanvasBounds())},onMouseMove:function(){var e=new THREE.Vector3,t=new THREE.Vector2,n=new THREE.Vector3,s={origin:n,direction:e};return function(i){var o,r,a,u=this.canvasBounds,c=this.el.sceneEl.camera;c.parent.updateMatrixWorld(),c.updateMatrixWorld(),r="touchmove"===i.type||"touchstart"===i.type?i.touches.item(0):i,o=r.clientX-u.left,a=r.clientY-u.top,t.x=o/u.width*2-1,t.y=2*-(a/u.height)+1,n.setFromMatrixPosition(c.matrixWorld),e.set(t.x,t.y,.5).unproject(c).sub(n).normalize(),this.el.setAttribute("raycaster",s),"touchmove"===i.type&&i.preventDefault()}}(),onCursorDown:function(e){"mouse"===this.data.rayOrigin&&"touchstart"===e.type&&(this.onMouseMove(e),this.el.components.raycaster.checkIntersections(),e.preventDefault()),this.twoWayEmit(EVENTS.MOUSEDOWN),this.cursorDownEl=this.intersectedEl},onCursorUp:function(e){this.twoWayEmit(EVENTS.MOUSEUP),this.cursorDownEl&&this.cursorDownEl!==this.intersectedEl&&(this.intersectedEventDetail.intersection=null,this.cursorDownEl.emit(EVENTS.MOUSEUP,this.intersectedEventDetail)),!this.data.fuse&&this.intersectedEl&&this.cursorDownEl===this.intersectedEl&&this.twoWayEmit(EVENTS.CLICK),this.cursorDownEl=null,"touchend"===e.type&&e.preventDefault()},onIntersection:function(e){var t,n,s,i=this.el;if(t=e.detail.els[0]===i?1:0,s=e.detail.intersections[t],n=e.detail.els[t]){if(this.intersectedEl===n)return void(this.intersection=s);this.intersectedEl&&this.clearCurrentIntersection(),this.setIntersection(n,s)}},onIntersectionCleared:function(e){var t=e.detail.clearedEls;t.indexOf(this.intersectedEl)!==-1&&this.clearCurrentIntersection()},setIntersection:function(e,t){var n=this.el,s=this.data,i=this;this.intersection=t,this.intersectedEl=e,n.addState(STATES.HOVERING),e.addState(STATES.HOVERED),this.twoWayEmit(EVENTS.MOUSEENTER),0!==s.fuseTimeout&&s.fuse&&(n.addState(STATES.FUSING),this.twoWayEmit(EVENTS.FUSING),this.fuseTimeout=setTimeout(function(){n.removeState(STATES.FUSING),i.twoWayEmit(EVENTS.CLICK)},s.fuseTimeout))},clearCurrentIntersection:function(){var e,t,n,s=this.el;this.intersectedEl.removeState(STATES.HOVERED),s.removeState(STATES.HOVERING),s.removeState(STATES.FUSING),this.twoWayEmit(EVENTS.MOUSELEAVE),this.intersection=null,this.intersectedEl=null,clearTimeout(this.fuseTimeout),n=this.el.components.raycaster.intersections,0!==n.length&&(e=n[0].object.el===s?1:0,t=n[e],t&&this.setIntersection(t.object.el,t))},twoWayEmit:function(e){var t=this.el,n=this.intersectedEl,s=this.intersection;this.eventDetail.intersectedEl=n,this.eventDetail.intersection=s,t.emit(e,this.eventDetail),n&&(this.intersectedEventDetail.intersection=s,n.emit(e,this.intersectedEventDetail))}});
  188. },{"../core/component":126,"../utils/":196}],80:[function(_dereq_,module,exports){
  189. var registerComponent=_dereq_("../core/component").registerComponent,bind=_dereq_("../utils/bind"),checkControllerPresentAndSetup=_dereq_("../utils/tracked-controls").checkControllerPresentAndSetup,trackedControlsUtils=_dereq_("../utils/tracked-controls"),emitIfAxesChanged=trackedControlsUtils.emitIfAxesChanged,onButtonEvent=trackedControlsUtils.onButtonEvent,DAYDREAM_CONTROLLER_MODEL_BASE_URL="https://cdn.aframe.io/controllers/google/",DAYDREAM_CONTROLLER_MODEL_OBJ_URL=DAYDREAM_CONTROLLER_MODEL_BASE_URL+"vr_controller_daydream.obj",DAYDREAM_CONTROLLER_MODEL_OBJ_MTL=DAYDREAM_CONTROLLER_MODEL_BASE_URL+"vr_controller_daydream.mtl",GAMEPAD_ID_PREFIX="Daydream Controller";module.exports.Component=registerComponent("daydream-controls",{schema:{hand:{default:""},buttonColor:{type:"color",default:"#000000"},buttonTouchedColor:{type:"color",default:"#777777"},buttonHighlightColor:{type:"color",default:"#FFFFFF"},model:{default:!0},rotationOffset:{default:0},armModel:{default:!0}},mapping:{axes:{trackpad:[0,1]},buttons:["trackpad","menu","system"]},bindMethods:function(){this.onModelLoaded=bind(this.onModelLoaded,this),this.onControllersUpdate=bind(this.onControllersUpdate,this),this.checkIfControllerPresent=bind(this.checkIfControllerPresent,this),this.removeControllersUpdateListener=bind(this.removeControllersUpdateListener,this),this.onAxisMoved=bind(this.onAxisMoved,this)},init:function(){var t=this;this.animationActive="pointing",this.onButtonChanged=bind(this.onButtonChanged,this),this.onButtonDown=function(e){onButtonEvent(e.detail.id,"down",t)},this.onButtonUp=function(e){onButtonEvent(e.detail.id,"up",t)},this.onButtonTouchStart=function(e){onButtonEvent(e.detail.id,"touchstart",t)},this.onButtonTouchEnd=function(e){onButtonEvent(e.detail.id,"touchend",t)},this.onAxisMoved=bind(this.onAxisMoved,this),this.controllerPresent=!1,this.lastControllerCheck=0,this.bindMethods(),this.checkControllerPresentAndSetup=checkControllerPresentAndSetup,this.emitIfAxesChanged=emitIfAxesChanged},addEventListeners:function(){var t=this.el;t.addEventListener("buttonchanged",this.onButtonChanged),t.addEventListener("buttondown",this.onButtonDown),t.addEventListener("buttonup",this.onButtonUp),t.addEventListener("touchstart",this.onButtonTouchStart),t.addEventListener("touchend",this.onButtonTouchEnd),t.addEventListener("model-loaded",this.onModelLoaded),t.addEventListener("axismove",this.onAxisMoved),this.controllerEventsActive=!0},removeEventListeners:function(){var t=this.el;t.removeEventListener("buttonchanged",this.onButtonChanged),t.removeEventListener("buttondown",this.onButtonDown),t.removeEventListener("buttonup",this.onButtonUp),t.removeEventListener("touchstart",this.onButtonTouchStart),t.removeEventListener("touchend",this.onButtonTouchEnd),t.removeEventListener("model-loaded",this.onModelLoaded),t.removeEventListener("axismove",this.onAxisMoved),this.controllerEventsActive=!1},checkIfControllerPresent:function(){this.checkControllerPresentAndSetup(this,GAMEPAD_ID_PREFIX,{hand:this.data.hand})},play:function(){this.checkIfControllerPresent(),this.addControllersUpdateListener()},pause:function(){this.removeEventListeners(),this.removeControllersUpdateListener()},injectTrackedControls:function(){var t=this.el,e=this.data;t.setAttribute("tracked-controls",{armModel:e.armModel,hand:e.hand,idPrefix:GAMEPAD_ID_PREFIX,rotationOffset:e.rotationOffset}),this.data.model&&this.el.setAttribute("obj-model",{obj:DAYDREAM_CONTROLLER_MODEL_OBJ_URL,mtl:DAYDREAM_CONTROLLER_MODEL_OBJ_MTL})},addControllersUpdateListener:function(){this.el.sceneEl.addEventListener("controllersupdated",this.onControllersUpdate,!1)},removeControllersUpdateListener:function(){this.el.sceneEl.removeEventListener("controllersupdated",this.onControllersUpdate,!1)},onControllersUpdate:function(){this.checkIfControllerPresent()},onModelLoaded:function(t){var e,o=t.detail.model;this.data.model&&(e=this.buttonMeshes={},e.menu=o.getObjectByName("AppButton_AppButton_Cylinder.004"),e.system=o.getObjectByName("HomeButton_HomeButton_Cylinder.005"),e.trackpad=o.getObjectByName("TouchPad_TouchPad_Cylinder.003"),o.position.set(0,0,-.04))},onAxisMoved:function(t){this.emitIfAxesChanged(this,this.mapping.axes,t)},onButtonChanged:function(t){var e=this.mapping.buttons[t.detail.id];e&&this.el.emit(e+"changed",t.detail.state)},updateModel:function(t,e){this.data.model&&this.updateButtonModel(t,e)},updateButtonModel:function(t,e){var o=this.buttonMeshes;if(o&&o[t]){var n;switch(e){case"down":n=this.data.buttonHighlightColor;break;case"touchstart":n=this.data.buttonTouchedColor;break;default:n=this.data.buttonColor}o[t].material.color.set(n)}}});
  190. },{"../core/component":126,"../utils/bind":190,"../utils/tracked-controls":201}],81:[function(_dereq_,module,exports){
  191. var registerComponent=_dereq_("../core/component").registerComponent,bind=_dereq_("../utils/bind"),trackedControlsUtils=_dereq_("../utils/tracked-controls"),checkControllerPresentAndSetup=trackedControlsUtils.checkControllerPresentAndSetup,emitIfAxesChanged=trackedControlsUtils.emitIfAxesChanged,onButtonEvent=trackedControlsUtils.onButtonEvent,GEARVR_CONTROLLER_MODEL_BASE_URL="https://cdn.aframe.io/controllers/samsung/",GEARVR_CONTROLLER_MODEL_OBJ_URL=GEARVR_CONTROLLER_MODEL_BASE_URL+"gear_vr_controller.obj",GEARVR_CONTROLLER_MODEL_OBJ_MTL=GEARVR_CONTROLLER_MODEL_BASE_URL+"gear_vr_controller.mtl",GAMEPAD_ID_PREFIX="Gear VR";module.exports.Component=registerComponent("gearvr-controls",{schema:{hand:{default:""},buttonColor:{type:"color",default:"#000000"},buttonTouchedColor:{type:"color",default:"#777777"},buttonHighlightColor:{type:"color",default:"#FFFFFF"},model:{default:!0},rotationOffset:{default:0},armModel:{default:!0}},mapping:{axes:{trackpad:[0,1]},buttons:["trackpad","trigger"]},bindMethods:function(){this.onModelLoaded=bind(this.onModelLoaded,this),this.onControllersUpdate=bind(this.onControllersUpdate,this),this.checkIfControllerPresent=bind(this.checkIfControllerPresent,this),this.removeControllersUpdateListener=bind(this.removeControllersUpdateListener,this),this.onAxisMoved=bind(this.onAxisMoved,this)},init:function(){var t=this;this.animationActive="pointing",this.onButtonChanged=bind(this.onButtonChanged,this),this.onButtonDown=function(e){onButtonEvent(e.detail.id,"down",t)},this.onButtonUp=function(e){onButtonEvent(e.detail.id,"up",t)},this.onButtonTouchStart=function(e){onButtonEvent(e.detail.id,"touchstart",t)},this.onButtonTouchEnd=function(e){onButtonEvent(e.detail.id,"touchend",t)},this.onAxisMoved=bind(this.onAxisMoved,this),this.controllerPresent=!1,this.lastControllerCheck=0,this.bindMethods(),this.checkControllerPresentAndSetup=checkControllerPresentAndSetup,this.emitIfAxesChanged=emitIfAxesChanged},addEventListeners:function(){var t=this.el;t.addEventListener("buttonchanged",this.onButtonChanged),t.addEventListener("buttondown",this.onButtonDown),t.addEventListener("buttonup",this.onButtonUp),t.addEventListener("touchstart",this.onButtonTouchStart),t.addEventListener("touchend",this.onButtonTouchEnd),t.addEventListener("model-loaded",this.onModelLoaded),t.addEventListener("axismove",this.onAxisMoved),this.controllerEventsActive=!0,this.addControllersUpdateListener()},removeEventListeners:function(){var t=this.el;t.removeEventListener("buttonchanged",this.onButtonChanged),t.removeEventListener("buttondown",this.onButtonDown),t.removeEventListener("buttonup",this.onButtonUp),t.removeEventListener("touchstart",this.onButtonTouchStart),t.removeEventListener("touchend",this.onButtonTouchEnd),t.removeEventListener("model-loaded",this.onModelLoaded),t.removeEventListener("axismove",this.onAxisMoved),this.controllerEventsActive=!1,this.removeControllersUpdateListener()},checkIfControllerPresent:function(){this.checkControllerPresentAndSetup(this,GAMEPAD_ID_PREFIX,this.data.hand?{hand:this.data.hand}:{})},play:function(){this.checkIfControllerPresent(),this.addControllersUpdateListener()},pause:function(){this.removeEventListeners(),this.removeControllersUpdateListener()},injectTrackedControls:function(){var t=this.el,e=this.data;t.setAttribute("tracked-controls",{armModel:e.armModel,idPrefix:GAMEPAD_ID_PREFIX,rotationOffset:e.rotationOffset}),this.data.model&&this.el.setAttribute("obj-model",{obj:GEARVR_CONTROLLER_MODEL_OBJ_URL,mtl:GEARVR_CONTROLLER_MODEL_OBJ_MTL})},addControllersUpdateListener:function(){this.el.sceneEl.addEventListener("controllersupdated",this.onControllersUpdate,!1)},removeControllersUpdateListener:function(){this.el.sceneEl.removeEventListener("controllersupdated",this.onControllersUpdate,!1)},onControllersUpdate:function(){this.checkIfControllerPresent()},onModelLoaded:function(t){var e,n=t.detail.model;this.data.model&&(e=this.buttonMeshes={},e.trigger=n.children[2],e.trackpad=n.children[1])},onButtonChanged:function(t){var e=this.mapping.buttons[t.detail.id];e&&this.el.emit(e+"changed",t.detail.state)},onAxisMoved:function(t){this.emitIfAxesChanged(this,this.mapping.axes,t)},updateModel:function(t,e){this.data.model&&this.updateButtonModel(t,e)},updateButtonModel:function(t,e){var n=this.buttonMeshes;if(n&&n[t]){var o;switch(e){case"down":o=this.data.buttonHighlightColor;break;case"touchstart":o=this.data.buttonTouchedColor;break;default:o=this.data.buttonColor}n[t].material.color.set(o)}}});
  192. },{"../core/component":126,"../utils/bind":190,"../utils/tracked-controls":201}],82:[function(_dereq_,module,exports){
  193. var geometries=_dereq_("../core/geometry").geometries,geometryNames=_dereq_("../core/geometry").geometryNames,registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),dummyGeometry=new THREE.Geometry;module.exports.Component=registerComponent("geometry",{schema:{buffer:{default:!0},primitive:{default:"box",oneOf:geometryNames},skipCache:{default:!1}},init:function(){this.geometry=null},update:function(e){var t,r=this.data,m=this.el,o=this.system;this.geometry&&(o.unuseGeometry(e),this.geometry=null),this.geometry=o.getOrCreateGeometry(r),t=m.getObject3D("mesh"),t?t.geometry=this.geometry:(t=new THREE.Mesh,t.geometry=this.geometry,m.setObject3D("mesh",t))},remove:function(){this.system.unuseGeometry(this.data),this.el.getObject3D("mesh").geometry=dummyGeometry,this.geometry=null},updateSchema:function(e){var t=e.primitive,r=this.data&&this.data.primitive,m=geometries[t]&&geometries[t].schema;if(!m)throw new Error("Unknown geometry schema `"+t+"`");r&&r===t||this.extendSchema(m)}});
  194. },{"../core/component":126,"../core/geometry":127,"../lib/three":174}],83:[function(_dereq_,module,exports){
  195. var registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/"),warn=utils.debug("components:gltf-model:warn");module.exports.Component=registerComponent("gltf-model",{schema:{type:"model"},init:function(){this.model=null,this.loader=new THREE.GLTFLoader},update:function(){var e=this,o=this.el,t=this.data;t&&(this.remove(),this.loader.load(t,function(t){e.model=t.scene||t.scenes[0],e.model.animations=t.animations,o.setObject3D("mesh",e.model),o.emit("model-loaded",{format:"gltf",model:e.model})},void 0,function(e){var i=e&&e.message?e.message:"Failed to load glTF model";warn(i),o.emit("model-error",{format:"gltf",src:t})}))},remove:function(){this.model&&this.el.removeObject3D("mesh")}});
  196. },{"../core/component":126,"../lib/three":174,"../utils/":196}],84:[function(_dereq_,module,exports){
  197. function getGestureEventName(t,e){var n;if(t)return n=EVENTS[t],"grip"===n?n+(e?"close":"open"):"point"===n||"thumb"===n?n+(e?"up":"down"):"pointing"===n||"pistol"===n?n+(e?"start":"end"):void 0}function isViveController(t){var e=t&&t.controller&&t.controller.id;return e&&0===e.indexOf("OpenVR ")}var registerComponent=_dereq_("../core/component").registerComponent,MODEL_URLS={left:"https://cdn.aframe.io/controllers/oculus-hands/v2/leftHand.json",right:"https://cdn.aframe.io/controllers/oculus-hands/v2/rightHand.json"},ANIMATIONS={open:"Open",point:"Point",pointThumb:"Point + Thumb",fist:"Fist",hold:"Hold",thumbUp:"Thumb Up"},EVENTS={};EVENTS[ANIMATIONS.fist]="grip",EVENTS[ANIMATIONS.thumbUp]="pistol",EVENTS[ANIMATIONS.point]="pointing",EVENTS[ANIMATIONS.thumb]="thumb",module.exports.Component=registerComponent("hand-controls",{schema:{default:"left"},init:function(){var t=this,e=this.el;this.gesture=ANIMATIONS.open,this.pressedButtons={},this.touchedButtons={},this.loader=new THREE.ObjectLoader,this.loader.setCrossOrigin("anonymous"),this.onGripDown=function(){t.handleButton("grip","down")},this.onGripUp=function(){t.handleButton("grip","up")},this.onTrackpadDown=function(){t.handleButton("trackpad","down")},this.onTrackpadUp=function(){t.handleButton("trackpad","up")},this.onTrackpadTouchStart=function(){t.handleButton("trackpad","touchstart")},this.onTrackpadTouchEnd=function(){t.handleButton("trackpad","touchend")},this.onTriggerDown=function(){t.handleButton("trigger","down")},this.onTriggerUp=function(){t.handleButton("trigger","up")},this.onTriggerTouchStart=function(){t.handleButton("trigger","touchstart")},this.onTriggerTouchEnd=function(){t.handleButton("trigger","touchend")},this.onGripTouchStart=function(){t.handleButton("grip","touchstart")},this.onGripTouchEnd=function(){t.handleButton("grip","touchend")},this.onThumbstickDown=function(){t.handleButton("thumbstick","down")},this.onThumbstickUp=function(){t.handleButton("thumbstick","up")},this.onAorXTouchStart=function(){t.handleButton("AorX","touchstart")},this.onAorXTouchEnd=function(){t.handleButton("AorX","touchend")},this.onBorYTouchStart=function(){t.handleButton("BorY","touchstart")},this.onBorYTouchEnd=function(){t.handleButton("BorY","touchend")},this.onSurfaceTouchStart=function(){t.handleButton("surface","touchstart")},this.onSurfaceTouchEnd=function(){t.handleButton("surface","touchend")},this.onControllerConnected=function(){t.setModelVisibility(!0)},this.onControllerDisconnected=function(){t.setModelVisibility(!1)},e.addEventListener("controllerconnected",this.onControllerConnected),e.addEventListener("controllerdisconnected",this.onControllerDisconnected)},play:function(){this.addEventListeners()},pause:function(){this.removeEventListeners()},tick:function(t,e){var n=this.el.getObject3D("mesh");n&&n.mixer&&n.mixer.update(e/1e3)},addEventListeners:function(){var t=this.el;t.addEventListener("gripdown",this.onGripDown),t.addEventListener("gripup",this.onGripUp),t.addEventListener("trackpaddown",this.onTrackpadDown),t.addEventListener("trackpadup",this.onTrackpadUp),t.addEventListener("trackpadtouchstart",this.onTrackpadTouchStart),t.addEventListener("trackpadtouchend",this.onTrackpadTouchEnd),t.addEventListener("triggerdown",this.onTriggerDown),t.addEventListener("triggerup",this.onTriggerUp),t.addEventListener("triggertouchstart",this.onTriggerTouchStart),t.addEventListener("triggertouchend",this.onTriggerTouchEnd),t.addEventListener("griptouchstart",this.onGripTouchStart),t.addEventListener("griptouchend",this.onGripTouchEnd),t.addEventListener("thumbstickdown",this.onThumbstickDown),t.addEventListener("thumbstickup",this.onThumbstickUp),t.addEventListener("abuttontouchstart",this.onAorXTouchStart),t.addEventListener("abuttontouchend",this.onAorXTouchEnd),t.addEventListener("bbuttontouchstart",this.onBorYTouchStart),t.addEventListener("bbuttontouchend",this.onBorYTouchEnd),t.addEventListener("xbuttontouchstart",this.onAorXTouchStart),t.addEventListener("xbuttontouchend",this.onAorXTouchEnd),t.addEventListener("ybuttontouchstart",this.onBorYTouchStart),t.addEventListener("ybuttontouchend",this.onBorYTouchEnd),t.addEventListener("surfacetouchstart",this.onSurfaceTouchStart),t.addEventListener("surfacetouchend",this.onSurfaceTouchEnd)},removeEventListeners:function(){var t=this.el;t.removeEventListener("gripdown",this.onGripDown),t.removeEventListener("gripup",this.onGripUp),t.removeEventListener("trackpaddown",this.onTrackpadDown),t.removeEventListener("trackpadup",this.onTrackpadUp),t.removeEventListener("trackpadtouchstart",this.onTrackpadTouchStart),t.removeEventListener("trackpadtouchend",this.onTrackpadTouchEnd),t.removeEventListener("triggerdown",this.onTriggerDown),t.removeEventListener("triggerup",this.onTriggerUp),t.removeEventListener("triggertouchstart",this.onTriggerTouchStart),t.removeEventListener("triggertouchend",this.onTriggerTouchEnd),t.removeEventListener("griptouchstart",this.onGripTouchStart),t.removeEventListener("griptouchend",this.onGripTouchEnd),t.removeEventListener("thumbstickdown",this.onThumbstickDown),t.removeEventListener("thumbstickup",this.onThumbstickUp),t.removeEventListener("abuttontouchstart",this.onAorXTouchStart),t.removeEventListener("abuttontouchend",this.onAorXTouchEnd),t.removeEventListener("bbuttontouchstart",this.onBorYTouchStart),t.removeEventListener("bbuttontouchend",this.onBorYTouchEnd),t.removeEventListener("xbuttontouchstart",this.onAorXTouchStart),t.removeEventListener("xbuttontouchend",this.onAorXTouchEnd),t.removeEventListener("ybuttontouchstart",this.onBorYTouchStart),t.removeEventListener("ybuttontouchend",this.onBorYTouchEnd),t.removeEventListener("surfacetouchstart",this.onSurfaceTouchStart),t.removeEventListener("surfacetouchend",this.onSurfaceTouchEnd)},update:function(t){var e,n=this.el,o=this.data;e={hand:o,model:!1,rotationOffset:"left"===o?90:-90},o!==t&&this.loader.load(MODEL_URLS[o],function(t){var o=t.getObjectByName("Hand");o.material.skinning=!0,o.mixer=new THREE.AnimationMixer(o),n.setObject3D("mesh",o),o.position.set(0,0,0),o.rotation.set(0,0,0),o.visible=!1,n.setAttribute("vive-controls",e),n.setAttribute("oculus-touch-controls",e),n.setAttribute("windows-motion-controls",e)})},remove:function(){this.el.removeObject3D("mesh")},handleButton:function(t,e){var n,o="down"===e,i="touchstart"===e;if(0===e.indexOf("touch")){if(i===this.touchedButtons[t])return;this.touchedButtons[t]=i}else{if(o===this.pressedButtons[t])return;this.pressedButtons[t]=o}n=this.gesture,this.gesture=this.determineGesture(),this.gesture!==n&&(this.animateGesture(this.gesture,n),this.emitGestureEvents(this.gesture,n))},determineGesture:function(){var t,e=this.pressedButtons.grip,n=this.pressedButtons.surface||this.touchedButtons.surface,o=this.pressedButtons.trackpad||this.touchedButtons.trackpad,i=this.pressedButtons.trigger||this.touchedButtons.trigger,r=this.touchedButtons.AorX||this.touchedButtons.BorY,s=isViveController(this.el.components["tracked-controls"]);return e?t=s?ANIMATIONS.fist:n||r||o?i?ANIMATIONS.fist:ANIMATIONS.point:i?ANIMATIONS.thumbUp:ANIMATIONS.pointThumb:i?t=s?ANIMATIONS.fist:ANIMATIONS.hold:s&&o&&(t=ANIMATIONS.point),t},animateGesture:function(t,e){return t?void this.playAnimation(t||ANIMATIONS.open,e,!1):void this.playAnimation(e,e,!0)},emitGestureEvents:function(t,e){var n,o=this.el;e!==t&&(n=getGestureEventName(e,!1),n&&o.emit(n),n=getGestureEventName(t,!0),n&&o.emit(n))},playAnimation:function(t,e,n){var o,i,r=this.el.getObject3D("mesh");if(r){if(i=r.mixer.clipAction(t),i.clampWhenFinished=!0,i.loop=THREE.PingPong,i.repetitions=0,i.timeScale=n?-1:1,i.weight=1,!e||t===e)return r.mixer.stopAllAction(),void i.play();o=r.mixer.clipAction(e),r.mixer.stopAllAction(),o.weight=.15,o.play(),i.play(),o.crossFadeTo(i,.15,!0)}},setModelVisibility:function(t){var e=this.el.getObject3D("mesh");e&&(e.visible=t)}});
  198. },{"../core/component":126}],85:[function(_dereq_,module,exports){
  199. _dereq_("./camera"),_dereq_("./collada-model"),_dereq_("./cursor"),_dereq_("./daydream-controls"),_dereq_("./gearvr-controls"),_dereq_("./geometry"),_dereq_("./gltf-model"),_dereq_("./hand-controls"),_dereq_("./laser-controls"),_dereq_("./light"),_dereq_("./line"),_dereq_("./link"),_dereq_("./look-controls"),_dereq_("./material"),_dereq_("./obj-model"),_dereq_("./oculus-touch-controls"),_dereq_("./position"),_dereq_("./raycaster"),_dereq_("./rotation"),_dereq_("./scale"),_dereq_("./shadow"),_dereq_("./sound"),_dereq_("./text"),_dereq_("./tracked-controls"),_dereq_("./visible"),_dereq_("./vive-controls"),_dereq_("./wasd-controls"),_dereq_("./windows-motion-controls"),_dereq_("./scene/background"),_dereq_("./scene/debug"),_dereq_("./scene/embedded"),_dereq_("./scene/inspector"),_dereq_("./scene/fog"),_dereq_("./scene/keyboard-shortcuts"),_dereq_("./scene/pool"),_dereq_("./scene/screenshot"),_dereq_("./scene/stats"),_dereq_("./scene/vr-mode-ui");
  200. },{"./camera":77,"./collada-model":78,"./cursor":79,"./daydream-controls":80,"./gearvr-controls":81,"./geometry":82,"./gltf-model":83,"./hand-controls":84,"./laser-controls":86,"./light":87,"./line":88,"./link":89,"./look-controls":90,"./material":91,"./obj-model":92,"./oculus-touch-controls":93,"./position":94,"./raycaster":95,"./rotation":96,"./scale":97,"./scene/background":98,"./scene/debug":99,"./scene/embedded":100,"./scene/fog":101,"./scene/inspector":102,"./scene/keyboard-shortcuts":103,"./scene/pool":104,"./scene/screenshot":105,"./scene/stats":106,"./scene/vr-mode-ui":107,"./shadow":108,"./sound":109,"./text":110,"./tracked-controls":111,"./visible":112,"./vive-controls":113,"./wasd-controls":114,"./windows-motion-controls":115}],86:[function(_dereq_,module,exports){
  201. var registerComponent=_dereq_("../core/component").registerComponent,utils=_dereq_("../utils/");registerComponent("laser-controls",{schema:{hand:{default:"right"}},init:function(){function t(t){var r=e[t.detail.name];if(r){var n=utils.extend({showLine:!0},r.raycaster||{});t.detail.rayOrigin&&(n.origin=t.detail.rayOrigin.origin,n.direction=t.detail.rayOrigin.direction,n.showLine=!0),t.detail.rayOrigin||!i.modelReady?o.setAttribute("raycaster",n):o.setAttribute("raycaster","showLine",!0),o.setAttribute("cursor",utils.extend({fuse:!1},r.cursor))}}function r(){o.setAttribute("raycaster","showLine",!1)}var e=this.config,n=this.data,o=this.el,i=this;o.setAttribute("daydream-controls",{hand:n.hand}),o.setAttribute("gearvr-controls",{hand:n.hand}),o.setAttribute("oculus-touch-controls",{hand:n.hand}),o.setAttribute("vive-controls",{hand:n.hand}),o.setAttribute("windows-motion-controls",{hand:n.hand}),o.addEventListener("controllerconnected",t),o.addEventListener("controllerdisconnected",r),o.addEventListener("controllermodelready",function(r){t(r),i.modelReady=!0})},config:{"daydream-controls":{cursor:{downEvents:["trackpaddown"],upEvents:["trackpadup"]}},"gearvr-controls":{cursor:{downEvents:["trackpaddown"],upEvents:["trackpadup"]},raycaster:{origin:{x:0,y:5e-4,z:0}}},"oculus-touch-controls":{cursor:{downEvents:["triggerdown"],upEvents:["triggerup"]},raycaster:{origin:{x:.001,y:0,z:.065},direction:{x:0,y:-.8,z:-1}}},"vive-controls":{cursor:{downEvents:["triggerdown"],upEvents:["triggerup"]}},"windows-motion-controls":{cursor:{downEvents:["triggerdown"],upEvents:["triggerup"]},raycaster:{showLine:!1}}}});
  202. },{"../core/component":126,"../utils/":196}],87:[function(_dereq_,module,exports){
  203. var bind=_dereq_("../utils/bind"),diff=_dereq_("../utils").diff,debug=_dereq_("../utils/debug"),registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),degToRad=THREE.Math.degToRad,warn=debug("components:light:warn");module.exports.Component=registerComponent("light",{schema:{angle:{default:60,if:{type:["spot"]}},color:{type:"color"},groundColor:{type:"color",if:{type:["hemisphere"]}},decay:{default:1,if:{type:["point","spot"]}},distance:{default:0,min:0,if:{type:["point","spot"]}},intensity:{default:1,min:0,if:{type:["ambient","directional","hemisphere","point","spot"]}},penumbra:{default:0,min:0,max:1,if:{type:["spot"]}},type:{default:"directional",oneOf:["ambient","directional","hemisphere","point","spot"]},target:{type:"selector",if:{type:["spot","directional"]}},castShadow:{default:!1,if:{type:["point","spot","directional"]}},shadowBias:{default:0,if:{castShadow:!0}},shadowCameraFar:{default:500,if:{castShadow:!0}},shadowCameraFov:{default:90,if:{castShadow:!0}},shadowCameraNear:{default:.5,if:{castShadow:!0}},shadowCameraTop:{default:5,if:{castShadow:!0}},shadowCameraRight:{default:5,if:{castShadow:!0}},shadowCameraBottom:{default:-5,if:{castShadow:!0}},shadowCameraLeft:{default:-5,if:{castShadow:!0}},shadowCameraVisible:{default:!1,if:{castShadow:!0}},shadowMapHeight:{default:512,if:{castShadow:!0}},shadowMapWidth:{default:512,if:{castShadow:!0}}},init:function(){var e=this.el;this.light=null,this.defaultTarget=null,this.system.registerLight(e)},update:function(e){var a=this.data,t=diff(a,e),o=this.light,i=this;if(o&&!("type"in t)){var r=!1;return void Object.keys(t).forEach(function(e){var t=a[e];switch(e){case"color":o.color.set(t);break;case"groundColor":o.groundColor.set(t);break;case"angle":o.angle=degToRad(t);break;case"target":null===t?"spot"!==a.type&&"directional"!==a.type||(o.target=i.defaultTarget):t.hasLoaded?i.onSetTarget(t,o):t.addEventListener("loaded",bind(i.onSetTarget,i,t,o));break;case"castShadow":case"shadowBias":case"shadowCameraFar":case"shadowCameraFov":case"shadowCameraNear":case"shadowCameraTop":case"shadowCameraRight":case"shadowCameraBottom":case"shadowCameraLeft":case"shadowCameraVisible":case"shadowMapHeight":case"shadowMapWidth":r||(i.updateShadow(),r=!0);break;default:o[e]=t}})}this.setLight(this.data),this.updateShadow()},setLight:function(e){var a=this.el,t=this.getLight(e);t&&(this.light&&a.removeObject3D("light"),this.light=t,this.light.el=a,a.setObject3D("light",this.light),"spot"!==e.type&&"directional"!==e.type&&"hemisphere"!==e.type||a.getObject3D("light").translateY(-1),"spot"===e.type&&(a.setObject3D("light-target",this.defaultTarget),a.getObject3D("light-target").position.set(0,0,-1)))},updateShadow:function(){var e=this.el,a=this.data,t=this.light;t.castShadow=a.castShadow;var o=e.getObject3D("cameraHelper");return a.shadowCameraVisible&&!o?e.setObject3D("cameraHelper",new THREE.CameraHelper(t.shadow.camera)):!a.shadowCameraVisible&&o&&e.removeObject3D("cameraHelper"),a.castShadow?(t.shadow.bias=a.shadowBias,t.shadow.mapSize.height=a.shadowMapHeight,t.shadow.mapSize.width=a.shadowMapWidth,t.shadow.camera.near=a.shadowCameraNear,t.shadow.camera.far=a.shadowCameraFar,t.shadow.camera instanceof THREE.OrthographicCamera?(t.shadow.camera.top=a.shadowCameraTop,t.shadow.camera.right=a.shadowCameraRight,t.shadow.camera.bottom=a.shadowCameraBottom,t.shadow.camera.left=a.shadowCameraLeft):t.shadow.camera.fov=a.shadowCameraFov,t.shadow.camera.updateProjectionMatrix(),void(o&&o.update())):t},getLight:function(e){var a=e.angle,t=new THREE.Color(e.color).getHex(),o=e.decay,i=e.distance,r=new THREE.Color(e.groundColor).getHex(),s=e.intensity,d=e.type,h=e.target,n=null;switch(d.toLowerCase()){case"ambient":return new THREE.AmbientLight(t,s);case"directional":return n=new THREE.DirectionalLight(t,s),this.defaultTarget=n.target,h&&(h.hasLoaded?this.onSetTarget(h,n):h.addEventListener("loaded",bind(this.onSetTarget,this,h,n))),n;case"hemisphere":return new THREE.HemisphereLight(t,r,s);case"point":return new THREE.PointLight(t,s,i,o);case"spot":return n=new THREE.SpotLight(t,s,i,degToRad(a),e.penumbra,o),this.defaultTarget=n.target,h&&(h.hasLoaded?this.onSetTarget(h,n):h.addEventListener("loaded",bind(this.onSetTarget,this,h,n))),n;default:warn("%s is not a valid light type. Choose from ambient, directional, hemisphere, point, spot.",d)}},onSetTarget:function(e,a){a.target=e.object3D},remove:function(){var e=this.el;e.removeObject3D("light"),e.getObject3D("cameraHelper")&&e.removeObject3D("cameraHelper")}});
  204. },{"../core/component":126,"../lib/three":174,"../utils":196,"../utils/bind":190,"../utils/debug":192}],88:[function(_dereq_,module,exports){
  205. function isEqualVec3(t,e){return!(!t||!e)&&(t.x===e.x&&t.y===e.y&&t.z===e.z)}var registerComponent=_dereq_("../core/component").registerComponent;module.exports.Component=registerComponent("line",{schema:{start:{type:"vec3",default:{x:0,y:0,z:0}},end:{type:"vec3",default:{x:0,y:0,z:0}},color:{type:"color",default:"#74BEC1"},opacity:{type:"number",default:1},visible:{default:!0}},multiple:!0,init:function(){var t,e,i=this.data;e=this.material=new THREE.LineBasicMaterial({color:i.color,opacity:i.opacity,transparent:i.opacity<1,visible:i.visible}),t=this.geometry=new THREE.BufferGeometry,t.addAttribute("position",new THREE.BufferAttribute(new Float32Array(6),3)),this.line=new THREE.Line(t,e),this.el.setObject3D(this.attrName,this.line)},update:function(t){var e=this.data,i=this.geometry,r=!1,a=this.material,o=i.attributes.position.array;isEqualVec3(e.start,t.start)||(o[0]=e.start.x,o[1]=e.start.y,o[2]=e.start.z,r=!0),isEqualVec3(e.end,t.end)||(o[3]=e.end.x,o[4]=e.end.y,o[5]=e.end.z,r=!0),r&&(i.attributes.position.needsUpdate=!0,i.computeBoundingSphere()),a.color.setStyle(e.color),a.opacity=e.opacity,a.transparent=e.opacity<1,a.visible=e.visible},remove:function(){this.el.removeObject3D("line",this.line)}});
  206. },{"../core/component":126}],89:[function(_dereq_,module,exports){
  207. var registerComponent=_dereq_("../core/component").registerComponent,registerShader=_dereq_("../core/shader").registerShader,THREE=_dereq_("../lib/three");module.exports.Component=registerComponent("link",{schema:{backgroundColor:{default:"red",type:"color"},borderColor:{default:"white",type:"color"},highlighted:{default:!1},highlightedColor:{default:"#24CAFF",type:"color"},href:{default:""},image:{type:"asset"},on:{default:"click"},peekMode:{default:!1},title:{default:""},titleColor:{default:"white",type:"color"},visualAspectEnabled:{default:!0}},init:function(){this.navigate=this.navigate.bind(this),this.previousQuaternion=void 0,this.quaternionClone=new THREE.Quaternion,this.hiddenEls=[],this.initVisualAspect()},update:function(e){var t,i,r=this.data,o=this.el;t=r.highlighted?r.highlightedColor:r.backgroundColor,i=r.highlighted?r.highlightedColor:r.borderColor,o.setAttribute("material","backgroundColor",t),o.setAttribute("material","strokeColor",i),r.on!==e.on&&this.updateEventListener(),r.visualAspectEnabled&&void 0!==e.peekMode&&r.peekMode!==e.peekMode&&this.updatePeekMode(),r.image&&e.image!==r.image&&o.setAttribute("material","pano","string"==typeof r.image?r.image:r.image.src)},updatePeekMode:function(){var e=this.el,t=this.sphereEl;this.data.peekMode?(this.hideAll(),e.getObject3D("mesh").visible=!1,t.setAttribute("visible",!0)):(this.showAll(),e.getObject3D("mesh").visible=!0,t.setAttribute("visible",!1))},play:function(){this.updateEventListener()},pause:function(){this.removeEventListener()},updateEventListener:function(){var e=this.el;e.isPlaying&&(this.removeEventListener(),e.addEventListener(this.data.on,this.navigate))},removeEventListener:function(){var e=this.data.on;e&&this.el.removeEventListener(e,this.navigate)},initVisualAspect:function(){var e,t,i,r=this.el;this.data.visualAspectEnabled&&(i=this.textEl=this.textEl||document.createElement("a-entity"),t=this.sphereEl=this.sphereEl||document.createElement("a-entity"),e=this.semiSphereEl=this.semiSphereEl||document.createElement("a-entity"),r.setAttribute("geometry",{primitive:"circle",radius:1,segments:64}),r.setAttribute("material",{shader:"portal",pano:this.data.image,side:"double"}),i.setAttribute("text",{color:this.data.titleColor,align:"center",font:"kelsonsans",value:this.data.title||this.data.href,width:4}),i.setAttribute("position","0 1.5 0"),r.appendChild(i),e.setAttribute("geometry",{primitive:"sphere",radius:1,phiStart:0,segmentsWidth:64,segmentsHeight:64,phiLength:180,thetaStart:0,thetaLength:360}),e.setAttribute("material",{shader:"portal",borderEnabled:0,pano:this.data.image,side:"back"}),e.setAttribute("rotation","0 180 0"),e.setAttribute("position","0 0 0"),e.setAttribute("visible",!1),r.appendChild(e),t.setAttribute("geometry",{primitive:"sphere",radius:10,segmentsWidth:64,segmentsHeight:64}),t.setAttribute("material",{shader:"portal",borderEnabled:0,pano:this.data.image,side:"back"}),t.setAttribute("visible",!1),r.appendChild(t))},navigate:function(){window.location=this.data.href},tick:function(){var e=new THREE.Vector3,t=new THREE.Vector3,i=new THREE.Quaternion,r=new THREE.Vector3;return function(){var o,a,n=this.el,s=n.object3D,l=n.sceneEl.camera,d=this.textEl;if(this.data.visualAspectEnabled)if(s.updateMatrixWorld(),l.parent.updateMatrixWorld(),l.updateMatrixWorld(),s.matrix.decompose(t,i,r),t.setFromMatrixPosition(s.matrixWorld),e.setFromMatrixPosition(l.matrixWorld),a=t.distanceTo(e),a>20)this.previousQuaternion||(this.quaternionClone.copy(i),this.previousQuaternion=this.quaternionClone),s.lookAt(e);else{if(o=this.calculateCameraPortalOrientation(),a<.5){if(this.semiSphereEl.getAttribute("visible")===!0)return;d.setAttribute("text","width",1.5),o<=0?(d.setAttribute("position","0 0 0.75"),d.setAttribute("rotation","0 180 0"),this.semiSphereEl.setAttribute("rotation","0 0 0")):(d.setAttribute("position","0 0 -0.75"),d.setAttribute("rotation","0 0 0"),this.semiSphereEl.setAttribute("rotation","0 180 0")),n.getObject3D("mesh").visible=!1,this.semiSphereEl.setAttribute("visible",!0),this.peekCameraPortalOrientation=o}else o<=0?d.setAttribute("rotation","0 180 0"):d.setAttribute("rotation","0 0 0"),d.setAttribute("text","width",5),d.setAttribute("position","0 1.5 0"),n.getObject3D("mesh").visible=!0,this.semiSphereEl.setAttribute("visible",!1),this.peekCameraPortalOrientation=void 0;this.previousQuaternion&&(s.quaternion.copy(this.previousQuaternion),this.previousQuaternion=void 0)}}}(),hideAll:function(){var e=this.el,t=this.hiddenEls,i=this;t.length>0||e.sceneEl.object3D.traverse(function(r){r&&r.el&&r.el.hasAttribute("link-controls")||r.el&&r!==e.sceneEl.object3D&&r.el!==e&&r.el!==i.sphereEl&&r.el!==e.sceneEl.cameraEl&&r.el.getAttribute("visible")!==!1&&r.el!==i.textEl&&r.el!==i.semiSphereEl&&(r.el.setAttribute("visible",!1),t.push(r.el))})},showAll:function(){this.hiddenEls.forEach(function(e){e.setAttribute("visible",!0)}),this.hiddenEls=[]},calculateCameraPortalOrientation:function(){var e=new THREE.Matrix4,t=new THREE.Vector3,i=new THREE.Vector3(0,0,1),r=new THREE.Vector3(0,0,0);return function(){var o=this.el,a=o.sceneEl.camera;return t.set(0,0,0),i.set(0,0,1),r.set(0,0,0),o.object3D.matrixWorld.extractRotation(e),i.applyMatrix4(e),o.object3D.updateMatrixWorld(),o.object3D.localToWorld(r),a.parent.parent.updateMatrixWorld(),a.parent.updateMatrixWorld(),a.updateMatrixWorld(),a.localToWorld(t),t.sub(r).normalize(),i.normalize(),Math.sign(i.dot(t))}}(),remove:function(){this.removeEventListener()}}),registerShader("portal",{schema:{borderEnabled:{default:1,type:"int",is:"uniform"},backgroundColor:{default:"red",type:"color",is:"uniform"},pano:{type:"map",is:"uniform"},strokeColor:{default:"white",type:"color",is:"uniform"}},vertexShader:["vec3 portalPosition;","varying vec3 vWorldPosition;","varying float vDistanceToCenter;","varying float vDistance;","void main() {","vDistanceToCenter = clamp(length(position - vec3(0.0, 0.0, 0.0)), 0.0, 1.0);","portalPosition = (modelMatrix * vec4(0.0, 0.0, 0.0, 1.0)).xyz;","vDistance = length(portalPosition - cameraPosition);","vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;","gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);","}"].join("\n"),fragmentShader:["#define RECIPROCAL_PI2 0.15915494","uniform sampler2D pano;","uniform vec3 strokeColor;","uniform vec3 backgroundColor;","uniform float borderEnabled;","varying float vDistanceToCenter;","varying float vDistance;","varying vec3 vWorldPosition;","void main() {","vec3 direction = normalize(vWorldPosition - cameraPosition);","vec2 sampleUV;","float borderThickness = clamp(exp(-vDistance / 50.0), 0.6, 0.95);","sampleUV.y = saturate(direction.y * 0.5 + 0.5);","sampleUV.x = atan(direction.z, -direction.x) * -RECIPROCAL_PI2 + 0.5;","if (vDistanceToCenter > borderThickness && borderEnabled == 1.0) {","gl_FragColor = vec4(strokeColor, 1.0);","} else {","gl_FragColor = mix(texture2D(pano, sampleUV), vec4(backgroundColor, 1.0), clamp(pow((vDistance / 15.0), 2.0), 0.0, 1.0));","}","}"].join("\n")});
  208. },{"../core/component":126,"../core/shader":135,"../lib/three":174}],90:[function(_dereq_,module,exports){
  209. var registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/"),bind=utils.bind,PolyfillControls=_dereq_("../utils").device.PolyfillControls,GRABBING_CLASS="a-grabbing",PI_2=Math.PI/2,radToDeg=THREE.Math.radToDeg,checkHasPositionalTracking=utils.device.checkHasPositionalTracking;module.exports.Component=registerComponent("look-controls",{dependencies:["position","rotation"],schema:{enabled:{default:!0},touchEnabled:{default:!0},hmdEnabled:{default:!0},pointerLockEnabled:{default:!0},reverseMouseDrag:{default:!1}},init:function(){this.previousHMDPosition=new THREE.Vector3,this.hmdQuaternion=new THREE.Quaternion,this.hmdEuler=new THREE.Euler,this.position=new THREE.Vector3,this.savedRotation=new THREE.Vector3,this.savedPosition=new THREE.Vector3,this.polyfillObject=new THREE.Object3D,this.polyfillControls=new PolyfillControls(this.polyfillObject),this.rotation={},this.deltaRotation={},this.savedPose=null,this.pointerLocked=!1,this.setupMouseControls(),this.bindMethods(),this.el.sceneEl.is("vr-mode")&&this.onEnterVR()},update:function(t){var e=this.data;e.enabled!==t.enabled&&this.updateGrabCursor(e.enabled),!t||e.hmdEnabled||t.hmdEnabled||(this.pitchObject.rotation.set(0,0,0),this.yawObject.rotation.set(0,0,0)),t&&!e.pointerLockEnabled!==t.pointerLockEnabled&&(this.removeEventListeners(),this.addEventListeners(),this.pointerLocked&&document.exitPointerLock())},tick:function(t){var e=this.data;e.enabled&&this.updateOrientation()},play:function(){this.addEventListeners()},pause:function(){this.removeEventListeners()},remove:function(){this.removeEventListeners()},bindMethods:function(){this.onMouseDown=bind(this.onMouseDown,this),this.onMouseMove=bind(this.onMouseMove,this),this.onMouseUp=bind(this.onMouseUp,this),this.onTouchStart=bind(this.onTouchStart,this),this.onTouchMove=bind(this.onTouchMove,this),this.onTouchEnd=bind(this.onTouchEnd,this),this.onEnterVR=bind(this.onEnterVR,this),this.onExitVR=bind(this.onExitVR,this),this.onPointerLockChange=bind(this.onPointerLockChange,this),this.onPointerLockError=bind(this.onPointerLockError,this)},setupMouseControls:function(){this.mouseDown=!1,this.pitchObject=new THREE.Object3D,this.yawObject=new THREE.Object3D,this.yawObject.position.y=10,this.yawObject.add(this.pitchObject)},addEventListeners:function(){var t=this.el.sceneEl,e=t.canvas;return e?(e.addEventListener("mousedown",this.onMouseDown,!1),window.addEventListener("mousemove",this.onMouseMove,!1),window.addEventListener("mouseup",this.onMouseUp,!1),e.addEventListener("touchstart",this.onTouchStart),window.addEventListener("touchmove",this.onTouchMove),window.addEventListener("touchend",this.onTouchEnd),t.addEventListener("enter-vr",this.onEnterVR),t.addEventListener("exit-vr",this.onExitVR),void(this.data.pointerLockEnabled&&(document.addEventListener("pointerlockchange",this.onPointerLockChange,!1),document.addEventListener("mozpointerlockchange",this.onPointerLockChange,!1),document.addEventListener("pointerlockerror",this.onPointerLockError,!1)))):void t.addEventListener("render-target-loaded",bind(this.addEventListeners,this))},removeEventListeners:function(){var t=this.el.sceneEl,e=t&&t.canvas;e&&(e.removeEventListener("mousedown",this.onMouseDown),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("touchstart",this.onTouchStart),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd),t.removeEventListener("enter-vr",this.onEnterVR),t.removeEventListener("exit-vr",this.onExitVR),document.removeEventListener("pointerlockchange",this.onPointerLockChange,!1),document.removeEventListener("mozpointerlockchange",this.onPointerLockChange,!1),document.removeEventListener("pointerlockerror",this.onPointerLockError,!1))},updateOrientation:function(){var t=this.hmdEuler,e=this.pitchObject,o=this.yawObject,n=this.el.sceneEl,i=this.rotation;n.is("vr-mode")&&n.checkHeadsetConnected()||(this.polyfillControls.update(),t.setFromQuaternion(this.polyfillObject.quaternion,"YXZ"),i.x=radToDeg(t.x)+radToDeg(e.rotation.x),i.y=radToDeg(t.y)+radToDeg(o.rotation.y),i.z=0,this.el.setAttribute("rotation",i))},onMouseMove:function(t){var e,o,n=this.pitchObject,i=this.yawObject,s=this.previousMouseEvent;this.data.enabled&&(this.mouseDown||this.pointerLocked)&&(e=t.movementX||t.mozMovementX,o=t.movementY||t.mozMovementY,void 0!==e&&void 0!==o||(e=t.screenX-s.screenX,o=t.screenY-s.screenY),this.previousMouseEvent=t,i.rotation.y-=.002*e,n.rotation.x-=.002*o,n.rotation.x=Math.max(-PI_2,Math.min(PI_2,n.rotation.x)))},onMouseDown:function(t){if(this.data.enabled&&0===t.button){var e=this.el.sceneEl,o=e&&e.canvas;this.mouseDown=!0,this.previousMouseEvent=t,document.body.classList.add(GRABBING_CLASS),this.data.pointerLockEnabled&&!this.pointerLocked&&(o.requestPointerLock?o.requestPointerLock():o.mozRequestPointerLock&&o.mozRequestPointerLock())}},onMouseUp:function(){this.mouseDown=!1,document.body.classList.remove(GRABBING_CLASS)},onTouchStart:function(t){1===t.touches.length&&this.data.touchEnabled&&(this.touchStart={x:t.touches[0].pageX,y:t.touches[0].pageY},this.touchStarted=!0)},onTouchMove:function(t){var e,o=this.el.sceneEl.canvas,n=this.yawObject;this.touchStarted&&this.data.touchEnabled&&(e=2*Math.PI*(t.touches[0].pageX-this.touchStart.x)/o.clientWidth,n.rotation.y-=.5*e,this.touchStart={x:t.touches[0].pageX,y:t.touches[0].pageY})},onTouchEnd:function(){this.touchStarted=!1},onEnterVR:function(){this.saveCameraPose()},onExitVR:function(){this.restoreCameraPose(),this.previousHMDPosition.set(0,0,0)},onPointerLockChange:function(){this.pointerLocked=!(!document.pointerLockElement&&!document.mozPointerLockElement)},onPointerLockError:function(){this.pointerLocked=!1},updateGrabCursor:function(t){function e(){n.canvas.classList.add("a-grab-cursor")}function o(){n.canvas.classList.remove("a-grab-cursor")}var n=this.el.sceneEl;return n.canvas?t?void e():void o():void(t?n.addEventListener("render-target-loaded",e):n.addEventListener("render-target-loaded",o))},saveCameraPose:function(){var t=this.el,e=t.getAttribute("position"),o=t.getAttribute("rotation"),n=void 0!==this.hasPositionalTracking?this.hasPositionalTracking:checkHasPositionalTracking();!this.savedPose&&n&&(this.savedPose={position:this.savedPosition.copy(e),rotation:this.savedRotation.copy(o)})},restoreCameraPose:function(){var t=this.el,e=this.savedPose,o=void 0!==this.hasPositionalTracking?this.hasPositionalTracking:checkHasPositionalTracking();e&&o&&(t.setAttribute("position",e.position),t.setAttribute("rotation",e.rotation),this.savedPose=null)}});
  210. },{"../core/component":126,"../lib/three":174,"../utils":196,"../utils/":196}],91:[function(_dereq_,module,exports){
  211. function parseSide(e){switch(e){case"back":return THREE.BackSide;case"double":return THREE.DoubleSide;default:return THREE.FrontSide}}function parseVertexColors(e){switch(e){case"face":return THREE.FaceColors;case"vertex":return THREE.VertexColors;default:return THREE.NoColors}}function disposeMaterial(e,t){e.dispose(),t.unregisterMaterial(e)}var utils=_dereq_("../utils/"),component=_dereq_("../core/component"),THREE=_dereq_("../lib/three"),shader=_dereq_("../core/shader"),error=utils.debug("components:material:error"),registerComponent=component.registerComponent,shaders=shader.shaders,shaderNames=shader.shaderNames;module.exports.Component=registerComponent("material",{schema:{alphaTest:{default:0,min:0,max:1},depthTest:{default:!0},depthWrite:{default:!0},flatShading:{default:!1},npot:{default:!1},offset:{type:"vec2",default:{x:0,y:0}},opacity:{default:1,min:0,max:1},repeat:{type:"vec2",default:{x:1,y:1}},shader:{default:"standard",oneOf:shaderNames},side:{default:"front",oneOf:["front","back","double"]},transparent:{default:!1},vertexColors:{type:"string",default:"none",oneOf:["face","vertex"]},visible:{default:!0}},init:function(){this.material=null},update:function(e){var t=this.data;this.shader&&t.shader===e.shader||this.updateShader(t.shader),this.shader.update(this.data),this.updateMaterial(e)},updateSchema:function(e){var t=e.shader,a=this.data&&this.data.shader,r=t||a,s=shaders[r]&&shaders[r].schema;s||error("Unknown shader schema "+r),a&&t===a||(this.extendSchema(s),this.updateBehavior())},updateBehavior:function(){var e=this.schema,t=this,a=this.el.sceneEl,r={},s=function(e,a){Object.keys(r).forEach(function(t){r[t]=e}),t.shader.update(r)};this.tick=void 0,Object.keys(e).forEach(function(a){"time"===e[a].type&&(t.tick=s,r[a]=!0)}),a&&(this.tick?a.addBehavior(this):a.removeBehavior(this))},updateShader:function(e){var t,a=this.data,r=shaders[e]&&shaders[e].Shader;if(!r)throw new Error("Unknown shader "+e);t=this.shader=new r,t.el=this.el,t.init(a),this.setMaterial(t.material),this.updateSchema(a)},updateMaterial:function(e){var t=this.data,a=this.material;a.alphaTest=t.alphaTest,a.depthTest=t.depthTest!==!1,a.depthWrite=t.depthWrite!==!1,a.opacity=t.opacity,a.flatShading=t.flatShading,a.side=parseSide(t.side),a.transparent=t.transparent!==!1||t.opacity<1,a.vertexColors=parseVertexColors(t.vertexColors),a.visible=t.visible,!Object.keys(e).length||e.alphaTest===t.alphaTest&&e.side===t.side&&e.vertexColors===t.vertexColors||(a.needsUpdate=!0)},remove:function(){var e=new THREE.MeshBasicMaterial,t=this.material,a=this.el.getObject3D("mesh");a&&(a.material=e),disposeMaterial(t,this.system)},setMaterial:function(e){var t,a=this.el,r=this.system;this.material&&disposeMaterial(this.material,r),this.material=e,r.registerMaterial(e),t=a.getObject3D("mesh"),t?t.material=e:a.addEventListener("object3dset",function t(r){"mesh"===r.detail.type&&r.target===a&&(a.getObject3D("mesh").material=e,a.removeEventListener("object3dset",t))})}});
  212. },{"../core/component":126,"../core/shader":135,"../lib/three":174,"../utils/":196}],92:[function(_dereq_,module,exports){
  213. var debug=_dereq_("../utils/debug"),registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),warn=debug("components:obj-model:warn");module.exports.Component=registerComponent("obj-model",{schema:{mtl:{type:"model"},obj:{type:"model"}},init:function(){this.model=null,this.objLoader=new THREE.OBJLoader,this.mtlLoader=new THREE.MTLLoader(this.objLoader.manager),this.mtlLoader.crossOrigin=""},update:function(){var e=this.data;e.obj&&(this.remove(),this.loadObj(e.obj,e.mtl))},remove:function(){this.model&&this.el.removeObject3D("mesh")},loadObj:function(e,o){var t=this,r=this.el,a=this.mtlLoader,i=this.objLoader;return o?(r.hasAttribute("material")&&warn("Material component properties are ignored when a .MTL is provided"),a.setTexturePath(o.substr(0,o.lastIndexOf("/")+1)),void a.load(o,function(o){o.preload(),i.setMaterials(o),i.load(e,function(e){t.model=e,r.setObject3D("mesh",e),r.emit("model-loaded",{format:"obj",model:e})})})):void i.load(e,function(e){var o=r.components.material;o&&e.traverse(function(e){e instanceof THREE.Mesh&&(e.material=o.material)}),t.model=e,r.setObject3D("mesh",e),r.emit("model-loaded",{format:"obj",model:e})})}});
  214. },{"../core/component":126,"../lib/three":174,"../utils/debug":192}],93:[function(_dereq_,module,exports){
  215. var bind=_dereq_("../utils/bind"),registerComponent=_dereq_("../core/component").registerComponent,trackedControlsUtils=_dereq_("../utils/tracked-controls"),onButtonEvent=trackedControlsUtils.onButtonEvent,TOUCH_CONTROLLER_MODEL_BASE_URL="https://cdn.aframe.io/controllers/oculus/oculus-touch-controller-",TOUCH_CONTROLLER_MODEL_OBJ_URL_L=TOUCH_CONTROLLER_MODEL_BASE_URL+"left.obj",TOUCH_CONTROLLER_MODEL_OBJ_MTL_L=TOUCH_CONTROLLER_MODEL_BASE_URL+"left.mtl",TOUCH_CONTROLLER_MODEL_OBJ_URL_R=TOUCH_CONTROLLER_MODEL_BASE_URL+"right.obj",TOUCH_CONTROLLER_MODEL_OBJ_MTL_R=TOUCH_CONTROLLER_MODEL_BASE_URL+"right.mtl",GAMEPAD_ID_PREFIX="Oculus Touch",PIVOT_OFFSET={x:0,y:-.015,z:.04};module.exports.Component=registerComponent("oculus-touch-controls",{schema:{hand:{default:"left"},buttonColor:{type:"color",default:"#999"},buttonTouchColor:{type:"color",default:"#8AB"},buttonHighlightColor:{type:"color",default:"#2DF"},model:{default:!0},rotationOffset:{default:0}},mapping:{left:{axes:{thumbstick:[0,1]},buttons:["thumbstick","trigger","grip","xbutton","ybutton","surface"]},right:{axes:{thumbstick:[0,1]},buttons:["thumbstick","trigger","grip","abutton","bbutton","surface"]}},bindMethods:function(){this.onModelLoaded=bind(this.onModelLoaded,this),this.onControllersUpdate=bind(this.onControllersUpdate,this),this.checkIfControllerPresent=bind(this.checkIfControllerPresent,this),this.onAxisMoved=bind(this.onAxisMoved,this)},init:function(){var t=this;this.onButtonChanged=bind(this.onButtonChanged,this),this.onButtonDown=function(e){onButtonEvent(e.detail.id,"down",t,t.data.hand)},this.onButtonUp=function(e){onButtonEvent(e.detail.id,"up",t,t.data.hand)},this.onButtonTouchStart=function(e){onButtonEvent(e.detail.id,"touchstart",t,t.data.hand)},this.onButtonTouchEnd=function(e){onButtonEvent(e.detail.id,"touchend",t,t.data.hand)},this.controllerPresent=!1,this.lastControllerCheck=0,this.previousButtonValues={},this.bindMethods(),this.emitIfAxesChanged=trackedControlsUtils.emitIfAxesChanged,this.checkControllerPresentAndSetup=trackedControlsUtils.checkControllerPresentAndSetup},addEventListeners:function(){var t=this.el;t.addEventListener("buttonchanged",this.onButtonChanged),t.addEventListener("buttondown",this.onButtonDown),t.addEventListener("buttonup",this.onButtonUp),t.addEventListener("touchstart",this.onButtonTouchStart),t.addEventListener("touchend",this.onButtonTouchEnd),t.addEventListener("axismove",this.onAxisMoved),t.addEventListener("model-loaded",this.onModelLoaded),this.controllerEventsActive=!0},removeEventListeners:function(){var t=this.el;t.removeEventListener("buttonchanged",this.onButtonChanged),t.removeEventListener("buttondown",this.onButtonDown),t.removeEventListener("buttonup",this.onButtonUp),t.removeEventListener("touchstart",this.onButtonTouchStart),t.removeEventListener("touchend",this.onButtonTouchEnd),t.removeEventListener("axismove",this.onAxisMoved),t.removeEventListener("model-loaded",this.onModelLoaded),this.controllerEventsActive=!1},checkIfControllerPresent:function(){this.checkControllerPresentAndSetup(this,GAMEPAD_ID_PREFIX,{hand:this.data.hand})},play:function(){this.checkIfControllerPresent(),this.addControllersUpdateListener()},pause:function(){this.removeEventListeners(),this.removeControllersUpdateListener()},updateControllerModel:function(){var t,e;this.data.model&&("right"===this.data.hand?(t="url("+TOUCH_CONTROLLER_MODEL_OBJ_URL_R+")",e="url("+TOUCH_CONTROLLER_MODEL_OBJ_MTL_R+")"):(t="url("+TOUCH_CONTROLLER_MODEL_OBJ_URL_L+")",e="url("+TOUCH_CONTROLLER_MODEL_OBJ_MTL_L+")"),this.el.setAttribute("obj-model",{obj:t,mtl:e}))},injectTrackedControls:function(){var t=this.data,e="right"===t.hand?-90:90;this.el.setAttribute("tracked-controls",{id:"right"===t.hand?"Oculus Touch (Right)":"Oculus Touch (Left)",controller:0,rotationOffset:t.rotationOffset!==-999?t.rotationOffset:e}),this.updateControllerModel()},addControllersUpdateListener:function(){this.el.sceneEl.addEventListener("controllersupdated",this.onControllersUpdate,!1)},removeControllersUpdateListener:function(){this.el.sceneEl.removeEventListener("controllersupdated",this.onControllersUpdate,!1)},onControllersUpdate:function(){this.checkIfControllerPresent()},onButtonChanged:function(t){var e,o=this.mapping[this.data.hand].buttons[t.detail.id],n=this.buttonMeshes;o&&("trigger"!==o&&"grip"!==o||(e=t.detail.state.value),n&&("trigger"===o&&n.trigger&&(n.trigger.rotation.x=-e*(Math.PI/24)),"grip"===o&&n.grip&&(n.grip.rotation.y=("left"===this.data.hand?-1:1)*e*(Math.PI/60))),this.el.emit(o+"changed",t.detail.state))},onModelLoaded:function(t){var e,o=t.detail.model;if(this.data.model){var n="left"===this.data.hand;e=this.buttonMeshes={},e.grip=o.getObjectByName(n?"buttonHand_oculus-touch-controller-left.004":"buttonHand_oculus-touch-controller-right.005"),e.thumbstick=o.getObjectByName(n?"stick_oculus-touch-controller-left.007":"stick_oculus-touch-controller-right.004"),e.trigger=o.getObjectByName(n?"buttonTrigger_oculus-touch-controller-left.005":"buttonTrigger_oculus-touch-controller-right.006"),e.xbutton=o.getObjectByName("buttonX_oculus-touch-controller-left.002"),e.abutton=o.getObjectByName("buttonA_oculus-touch-controller-right.002"),e.ybutton=o.getObjectByName("buttonY_oculus-touch-controller-left.001"),e.bbutton=o.getObjectByName("buttonB_oculus-touch-controller-right.003"),o.position=PIVOT_OFFSET}},onAxisMoved:function(t){this.emitIfAxesChanged(this,this.mapping[this.data.hand].axes,t)},updateModel:function(t,e){this.data.model&&this.updateButtonModel(t,e)},updateButtonModel:function(t,e){var o="up"===e||"touchend"===e?this.data.buttonColor:"touchstart"===e?this.data.buttonTouchColor:this.data.buttonHighlightColor,n=this.buttonMeshes;this.data.model&&n&&n[t]&&n[t].material.color.set(o)}});
  216. },{"../core/component":126,"../utils/bind":190,"../utils/tracked-controls":201}],94:[function(_dereq_,module,exports){
  217. var registerComponent=_dereq_("../core/component").registerComponent;module.exports.Component=registerComponent("position",{schema:{type:"vec3"},update:function(){var e=this.el.object3D,o=this.data;e.position.set(o.x,o.y,o.z)}});
  218. },{"../core/component":126}],95:[function(_dereq_,module,exports){
  219. function copyArray(e,t){var i;for(e.length=t.length,i=0;i<t.length;i++)e[i]=t[i]}var registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/"),warn=utils.debug("components:raycaster:warn"),OBSERVER_SELECTOR_RE=/^[\w\s-.,[\]#]*$/,OBSERVER_CONFIG={childList:!0,attributes:!0,subtree:!0};module.exports.Component=registerComponent("raycaster",{schema:{autoRefresh:{default:!0},direction:{type:"vec3",default:{x:0,y:0,z:-1}},enabled:{default:!0},far:{default:1e3},interval:{default:0},near:{default:0},objects:{default:""},origin:{type:"vec3"},recursive:{default:!0},showLine:{default:!1},useWorldCoordinates:{default:!1}},init:function(){this.clearedIntersectedEls=[],this.unitLineEndVec3=new THREE.Vector3,this.intersectedEls=[],this.intersections=[],this.newIntersectedEls=[],this.newIntersections=[],this.objects=[],this.prevCheckTime=void 0,this.prevIntersectedEls=[],this.raycaster=new THREE.Raycaster,this.updateOriginDirection(),this.setDirty=this.setDirty.bind(this),this.observer=new MutationObserver(this.setDirty),this.dirty=!0,this.lineEndVec3=new THREE.Vector3,this.otherLineEndVec3=new THREE.Vector3,this.lineData={end:this.lineEndVec3},this.intersectedClearedDetail={el:this.el},this.intersectionClearedDetail={clearedEls:this.clearedIntersectedEls}},update:function(e){var t=this.data,i=this.el,s=this.raycaster;s.far=t.far,s.near=t.near,!t.showLine||t.far===e.far&&t.origin===e.origin&&t.direction===e.direction&&e.showLine||(this.unitLineEndVec3.copy(t.origin).add(t.direction).normalize(),this.drawLine()),!t.showLine&&e.showLine&&i.removeAttribute("line"),t.objects===e.objects||OBSERVER_SELECTOR_RE.test(t.objects)||warn('Selector "'+t.objects+'" may not update automatically with DOM changes.'),t.autoRefresh!==e.autoRefresh&&i.isPlaying&&(t.autoRefresh?this.addEventListeners():this.removeEventListeners()),this.setDirty()},play:function(){this.addEventListeners()},pause:function(){this.removeEventListeners()},remove:function(){this.data.showLine&&this.el.removeAttribute("line")},addEventListeners:function(){this.data.autoRefresh&&(this.observer.observe(this.el.sceneEl,OBSERVER_CONFIG),this.el.sceneEl.addEventListener("object3dset",this.setDirty),this.el.sceneEl.addEventListener("object3dremove",this.setDirty))},removeEventListeners:function(){this.observer.disconnect(),this.el.sceneEl.removeEventListener("object3dset",this.setDirty),this.el.sceneEl.removeEventListener("object3dremove",this.setDirty)},setDirty:function(){this.dirty=!0},refreshObjects:function(){var e,t=this.data;e=t.objects?this.el.sceneEl.querySelectorAll(t.objects):this.el.sceneEl.children,this.objects=this.flattenChildrenShallow(e),this.dirty=!1},tick:function(e){var t=this.data,i=this.prevCheckTime;i&&e-i<t.interval||(this.prevCheckTime=e,this.checkIntersections())},checkIntersections:function(){var e,t,i,s,n=this.clearedIntersectedEls,r=this.el,o=this.data,c=this.intersectedEls,a=this.intersections,h=this.newIntersectedEls,l=this.newIntersections,d=this.prevIntersectedEls,u=this;if(this.data.enabled){for(this.dirty&&this.refreshObjects(),copyArray(this.prevIntersectedEls,this.intersectedEls),this.updateOriginDirection(),s=this.raycaster.intersectObjects(this.objects,o.recursive),a.length=0,c.length=0,e=0;e<s.length;e++)t=s[e],o.showLine&&t.object===r.getObject3D("line")||t.object.el&&(a.push(t),c.push(t.object.el));for(l.length=0,h.length=0,e=0;e<a.length;e++)d.indexOf(a[e].object.el)===-1&&(l.push(a[e]),h.push(a[e].object.el));for(n.length=0,e=0;e<d.length;e++)c.indexOf(d[e])===-1&&(d[e].emit("raycaster-intersected-cleared",this.intersectedClearedDetail),n.push(d[e]));for(n.length&&r.emit("raycaster-intersection-cleared",this.intersectionClearedDetail),e=0;e<h.length;e++)h[e].emit("raycaster-intersected",{el:r,intersection:l[e]});l.length&&r.emit("raycaster-intersection",{els:h,intersections:l}),setTimeout(function(){u.data.showLine&&(a.length&&(i=a[0].object.el===r&&a[1]?a[1].distance:a[0].distance),u.drawLine(i))})}},updateOriginDirection:function(){var e=new THREE.Vector3,t=new THREE.Vector3;return function(){var i=this.el,s=this.data;return s.useWorldCoordinates?void this.raycaster.set(s.origin,s.direction):(i.object3D.updateMatrixWorld(),i.object3D.getWorldPosition(t),0===s.origin.x&&0===s.origin.y&&0===s.origin.z||(t=i.object3D.localToWorld(t.copy(s.origin))),e.copy(s.direction).transformDirection(i.object3D.matrixWorld).normalize(),void this.raycaster.set(t,e))}}(),drawLine:function(e){var t,i=this.data,s=this.el;t=this.lineData.end===this.lineEndVec3?this.otherLineEndVec3:this.lineEndVec3,void 0===e&&(e=i.far===1/0?1e3:i.far),this.lineData.start=i.origin,this.lineData.end=t.copy(this.unitLineEndVec3).multiplyScalar(e),s.setAttribute("line",this.lineData)},flattenChildrenShallow:function(){var e=[];return function(t){var i,s,n=this.objects;for(e.length=0,s=0;s<t.length;s++)t[s].object3D&&e.push(t[s].object3D);for(n.length=0,s=0;s<e.length;s++)i=e[s].children,i&&i.length&&n.push.apply(n,i);return n}}()});
  220. },{"../core/component":126,"../lib/three":174,"../utils/":196}],96:[function(_dereq_,module,exports){
  221. var degToRad=_dereq_("../lib/three").Math.degToRad,registerComponent=_dereq_("../core/component").registerComponent;module.exports.Component=registerComponent("rotation",{schema:{type:"vec3"},update:function(){var e=this.data,o=this.el.object3D;o.rotation.set(degToRad(e.x),degToRad(e.y),degToRad(e.z)),o.rotation.order="YXZ"}});
  222. },{"../core/component":126,"../lib/three":174}],97:[function(_dereq_,module,exports){
  223. var registerComponent=_dereq_("../core/component").registerComponent,zeroScale=1e-5;module.exports.Component=registerComponent("scale",{schema:{type:"vec3",default:{x:1,y:1,z:1}},update:function(){var e=this.data,o=this.el.object3D,t=0===e.x?zeroScale:e.x,r=0===e.y?zeroScale:e.y,a=0===e.z?zeroScale:e.z;o.scale.set(t,r,a)}});
  224. },{"../core/component":126}],98:[function(_dereq_,module,exports){
  225. var register=_dereq_("../../core/component").registerComponent;module.exports.Component=register("background",{schema:{color:{type:"color",default:"black"},transparent:{default:!1}},update:function(){var e=this.data,r=this.el.object3D;return e.transparent?void(r.background=null):void(r.background=new THREE.Color(e.color))}});
  226. },{"../../core/component":126}],99:[function(_dereq_,module,exports){
  227. var register=_dereq_("../../core/component").registerComponent;module.exports.Component=register("debug",{schema:{default:!0}});
  228. },{"../../core/component":126}],100:[function(_dereq_,module,exports){
  229. var registerComponent=_dereq_("../../core/component").registerComponent;module.exports.Component=registerComponent("embedded",{dependencies:["vr-mode-ui"],schema:{default:!0},update:function(){var e=this.el,r=e.querySelector(".a-enter-vr");this.data===!0?(r&&r.classList.add("embedded"),e.removeFullScreenStyles()):(r&&r.classList.remove("embedded"),e.addFullScreenStyles())}});
  230. },{"../../core/component":126}],101:[function(_dereq_,module,exports){
  231. function getFog(e){var o;return o="exponential"===e.type?new THREE.FogExp2(e.color,e.density):new THREE.Fog(e.color,e.near,e.far),o.name=e.type,o}var register=_dereq_("../../core/component").registerComponent,THREE=_dereq_("../../lib/three"),debug=_dereq_("../../utils/debug"),warn=debug("components:fog:warn");module.exports.Component=register("fog",{schema:{color:{type:"color",default:"#000"},density:{default:25e-5},far:{default:1e3,min:0},near:{default:1,min:0},type:{default:"linear",oneOf:["linear","exponential"]}},update:function(){var e=this.data,o=this.el,t=this.el.object3D.fog;return o.isScene?t&&e.type===t.name?void Object.keys(this.schema).forEach(function(o){var n=e[o];"color"===o&&(n=new THREE.Color(n)),t[o]=n}):(o.object3D.fog=getFog(e),void o.systems.material.updateMaterials()):void warn("Fog component can only be applied to <a-scene>")},remove:function(){var e=this.el.object3D.fog;e&&(e.far=0,e.near=.1)}});
  232. },{"../../core/component":126,"../../lib/three":174,"../../utils/debug":192}],102:[function(_dereq_,module,exports){
  233. (function (process){
  234. function getFuzzyPatchVersion(e){var n=e.split(".");return n[2]="x",n.join(".")}var AFRAME_INJECTED=_dereq_("../../constants").AFRAME_INJECTED,bind=_dereq_("../../utils/bind"),pkg=_dereq_("../../../package"),registerComponent=_dereq_("../../core/component").registerComponent,INSPECTOR_DEV_URL="https://aframe.io/aframe-inspector/dist/aframe-inspector.js",INSPECTOR_RELEASE_URL="https://unpkg.com/aframe-inspector@"+getFuzzyPatchVersion(pkg.version)+"/dist/aframe-inspector.min.js",INSPECTOR_URL="dev"===process.env.INSPECTOR_VERSION?INSPECTOR_DEV_URL:INSPECTOR_RELEASE_URL,LOADING_MESSAGE="Loading Inspector",LOADING_ERROR_MESSAGE="Error loading Inspector";module.exports.Component=registerComponent("inspector",{schema:{url:{default:INSPECTOR_URL}},init:function(){this.onKeydown=bind(this.onKeydown,this),this.onMessage=bind(this.onMessage,this),this.initOverlay(),window.addEventListener("keydown",this.onKeydown),window.addEventListener("message",this.onMessage)},initOverlay:function(){var e='<span class="dots"><span>.</span><span>.</span><span>.</span></span>';this.loadingMessageEl=document.createElement("div"),this.loadingMessageEl.classList.add("a-inspector-loader"),this.loadingMessageEl.innerHTML=LOADING_MESSAGE+e},remove:function(){this.removeEventListeners()},onKeydown:function(e){var n=73===e.keyCode&&e.ctrlKey&&e.altKey;this.data&&n&&this.injectInspector()},showLoader:function(){document.body.appendChild(this.loadingMessageEl)},hideLoader:function(){document.body.removeChild(this.loadingMessageEl)},onMessage:function(e){"INJECT_AFRAME_INSPECTOR"===e.data&&this.injectInspector()},injectInspector:function(){var e,n=this;AFRAME.INSPECTOR||AFRAME.inspectorInjected||(this.showLoader(),e=document.createElement("script"),e.src=this.data.url,e.setAttribute("data-name","aframe-inspector"),e.setAttribute(AFRAME_INJECTED,""),e.onload=function(){AFRAME.INSPECTOR.open(),n.hideLoader(),n.removeEventListeners()},e.onerror=function(){n.loadingMessageEl.innerHTML=LOADING_ERROR_MESSAGE},document.head.appendChild(e),AFRAME.inspectorInjected=!0)},removeEventListeners:function(){window.removeEventListener("keydown",this.onKeydown),window.removeEventListener("message",this.onMessage)}});
  235. }).call(this,_dereq_('_process'))
  236. },{"../../../package":76,"../../constants":117,"../../core/component":126,"../../utils/bind":190,"_process":33}],103:[function(_dereq_,module,exports){
  237. var registerComponent=_dereq_("../../core/component").registerComponent,shouldCaptureKeyEvent=_dereq_("../../utils/").shouldCaptureKeyEvent;module.exports.Component=registerComponent("keyboard-shortcuts",{schema:{enterVR:{default:!0},exitVR:{default:!0}},init:function(){var e=this,t=this.el;this.listener=window.addEventListener("keyup",function(n){shouldCaptureKeyEvent(n)&&(e.enterVREnabled&&70===n.keyCode&&t.enterVR(),e.enterVREnabled&&27===n.keyCode&&t.exitVR())},!1)},update:function(e){var t=this.data;this.enterVREnabled=t.enterVR},remove:function(){window.removeEventListener("keyup",this.listener)}});
  238. },{"../../core/component":126,"../../utils/":196}],104:[function(_dereq_,module,exports){
  239. var debug=_dereq_("../../utils/debug"),registerComponent=_dereq_("../../core/component").registerComponent,warn=debug("components:pool:warn");module.exports.Component=registerComponent("pool",{schema:{mixin:{default:""},size:{default:0},dynamic:{default:!1}},multiple:!0,initPool:function(){var t,i=this.data.mixin;if(i)for(this.availableEls=[],this.usedEls=[],t=0;t<this.data.size;++t)this.createEntity()},update:function(t){var i=this.data;t.mixin===i.mixin&&t.size===i.size||this.initPool()},createEntity:function(){var t=document.createElement("a-entity");t.play=this.wrapPlay(t.play),t.setAttribute("mixin",this.data.mixin),t.setAttribute("visible",!1),this.el.appendChild(t),this.availableEls.push(t)},wrapPlay:function(t){var i=this.usedEls;return function(){i.indexOf(this)!==-1&&t.call(this)}},requestEntity:function(){var t;if(0===this.availableEls.length){if(this.data.dynamic===!1)return void warn("Requested entity from empty pool "+this.name);warn("Requested entity from empty pool. This pool is dynamicand will resize automatically. You might want to increase its initial size"+this.name),this.createEntity()}return t=this.availableEls.shift(),this.usedEls.push(t),t.setAttribute("visible",!0),t},returnEntity:function(t){var i=this.usedEls.indexOf(t);return i===-1?void warn("The returned entity was not previously pooled from "+this.name):(this.usedEls.splice(i,1),this.availableEls.push(t),t.setAttribute("visible",!1),void t.pause())}});
  240. },{"../../core/component":126,"../../utils/debug":192}],105:[function(_dereq_,module,exports){
  241. var registerComponent=_dereq_("../../core/component").registerComponent,THREE=_dereq_("../../lib/three"),VERTEX_SHADER=["attribute vec3 position;","attribute vec2 uv;","uniform mat4 projectionMatrix;","uniform mat4 modelViewMatrix;","varying vec2 vUv;","void main() {"," vUv = vec2( 1.- uv.x, uv.y );"," gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),FRAGMENT_SHADER=["precision mediump float;","uniform samplerCube map;","varying vec2 vUv;","#define M_PI 3.141592653589793238462643383279","void main() {"," vec2 uv = vUv;"," float longitude = uv.x * 2. * M_PI - M_PI + M_PI / 2.;"," float latitude = uv.y * M_PI;"," vec3 dir = vec3("," - sin( longitude ) * sin( latitude ),"," cos( latitude ),"," - cos( longitude ) * sin( latitude )"," );"," normalize( dir );"," gl_FragColor = vec4( textureCube( map, dir ).rgb, 1.0 );","}"].join("\n");module.exports.Component=registerComponent("screenshot",{schema:{width:{default:4096},height:{default:2048},camera:{type:"selector"}},init:function(){function e(){var e=t.renderer.getContext();e&&(a.cubeMapSize=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),a.material=new THREE.RawShaderMaterial({uniforms:{map:{type:"t",value:null}},vertexShader:VERTEX_SHADER,fragmentShader:FRAGMENT_SHADER,side:THREE.DoubleSide}),a.quad=new THREE.Mesh(new THREE.PlaneBufferGeometry(1,1),a.material),a.quad.visible=!1,a.camera=new THREE.OrthographicCamera(-.5,.5,.5,-.5,-1e4,1e4),a.canvas=document.createElement("canvas"),a.ctx=a.canvas.getContext("2d"),t.camera&&t.camera.add(a.quad),a.onKeyDown=a.onKeyDown.bind(a),a.onCameraActive=a.onCameraActive.bind(a),t.addEventListener("camera-set-active",a.onCameraActive))}var t=this.el,a=this;t.renderer?e():t.addEventListener("render-target-loaded",e)},getRenderTarget:function(e,t){return new THREE.WebGLRenderTarget(e,t,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,wrapS:THREE.ClampToEdgeWrapping,wrapT:THREE.ClampToEdgeWrapping,format:THREE.RGBAFormat,type:THREE.UnsignedByteType})},resize:function(e,t){this.quad.scale.set(e,t,1),this.camera.left=-1*e/2,this.camera.right=e/2,this.camera.top=t/2,this.camera.bottom=-1*t/2,this.camera.updateProjectionMatrix(),this.canvas.width=e,this.canvas.height=t},play:function(){window.addEventListener("keydown",this.onKeyDown)},onCameraActive:function(e){var t=this.quad.parent;t&&t.remove(this.quad),e.detail.cameraEl.getObject3D("camera").add(this.quad)},onKeyDown:function(e){var t=83===e.keyCode&&e.ctrlKey&&e.altKey;if(this.data&&t){var a=e.shiftKey?"equirectangular":"perspective";this.capture(a)}},setCapture:function(e){var t,a,i,r=this.el;return"perspective"===e?(this.quad.visible=!1,a=this.data.camera&&this.data.camera.components.camera.camera||r.camera,t={width:this.data.width,height:this.data.height}):(a=this.camera,a.position.copy(r.camera.getWorldPosition()),a.rotation.copy(r.camera.getWorldRotation()),i=new THREE.CubeCamera(r.camera.near,r.camera.far,Math.min(this.cubeMapSize,2048)),i.position.copy(r.camera.getWorldPosition()),i.rotation.copy(r.camera.getWorldRotation()),i.updateCubeMap(r.renderer,r.object3D),this.quad.material.uniforms.map.value=i.renderTarget.texture,t={width:this.data.width,height:this.data.height},this.quad.visible=!0),{camera:a,size:t,projection:e}},capture:function(e){var t=this.setCapture(e);this.renderCapture(t.camera,t.size,t.projection),this.saveCapture()},getCanvas:function(e){var t=this.setCapture(e);return this.renderCapture(t.camera,t.size,t.projection),this.canvas},renderCapture:function(e,t,a){var i,r,n,o=this.el.renderer.autoClear,c=this.el,d=this.el.renderer;r=this.getRenderTarget(t.width,t.height),n=new Uint8Array(4*t.width*t.height),this.resize(t.width,t.height),d.autoClear=!0,d.render(c.object3D,e,r,!0),d.autoClear=o,d.readRenderTargetPixels(r,0,0,t.width,t.height,n),"perspective"===a&&(n=this.flipPixelsVertically(n,t.width,t.height)),i=new ImageData(new Uint8ClampedArray(n),t.width,t.height),this.quad.visible=!1,this.ctx.putImageData(i,0,0)},flipPixelsVertically:function(e,t,a){for(var i=e.slice(0),r=0;r<t;++r)for(var n=0;n<a;++n)i[4*r+n*t*4]=e[4*r+(a-n)*t*4],i[4*r+1+n*t*4]=e[4*r+1+(a-n)*t*4],i[4*r+2+n*t*4]=e[4*r+2+(a-n)*t*4],i[4*r+3+n*t*4]=e[4*r+3+(a-n)*t*4];return i},saveCapture:function(){this.canvas.toBlob(function(e){var t="screenshot-"+document.title.toLowerCase()+"-"+Date.now()+".png",a=document.createElement("a"),i=URL.createObjectURL(e);a.href=i,a.setAttribute("download",t),a.innerHTML="downloading...",a.style.display="none",document.body.appendChild(a),setTimeout(function(){a.click(),document.body.removeChild(a)},1)},"image/png")}});
  242. },{"../../core/component":126,"../../lib/three":174}],106:[function(_dereq_,module,exports){
  243. function createStats(t){var e=new ThreeStats(t.renderer),s=new AFrameStats(t),i=t.isMobile?[]:[e,s];return new RStats({css:[],values:{fps:{caption:"fps",below:30}},groups:[{caption:"Framerate",values:["fps","raf"]}],plugins:i})}var registerComponent=_dereq_("../../core/component").registerComponent,RStats=_dereq_("../../../vendor/rStats"),utils=_dereq_("../../utils");_dereq_("../../../vendor/rStats.extras"),_dereq_("../../lib/rStatsAframe");var AFrameStats=window.aframeStats,bind=utils.bind,HIDDEN_CLASS="a-hidden",ThreeStats=window.threeStats;module.exports.Component=registerComponent("stats",{schema:{default:!0},init:function(){var t=this.el;"false"!==utils.getUrlParameter("stats")&&(this.stats=createStats(t),this.statsEl=document.querySelector(".rs-base"),this.hideBound=bind(this.hide,this),this.showBound=bind(this.show,this),t.addEventListener("enter-vr",this.hideBound),t.addEventListener("exit-vr",this.showBound))},update:function(){if(this.stats)return this.data?this.show():this.hide()},remove:function(){this.el.removeEventListener("enter-vr",this.hideBound),this.el.removeEventListener("exit-vr",this.showBound),this.statsEl&&this.statsEl.parentNode.removeChild(this.statsEl)},tick:function(){var t=this.stats;t&&(t("rAF").tick(),t("FPS").frame(),t().update())},hide:function(){this.statsEl.classList.add(HIDDEN_CLASS)},show:function(){this.statsEl.classList.remove(HIDDEN_CLASS)}});
  244. },{"../../../vendor/rStats":203,"../../../vendor/rStats.extras":202,"../../core/component":126,"../../lib/rStatsAframe":173,"../../utils":196}],107:[function(_dereq_,module,exports){
  245. function createEnterVRButton(t){var e,n;return n=document.createElement("div"),n.classList.add(ENTER_VR_CLASS),n.setAttribute(constants.AFRAME_INJECTED,""),e=document.createElement("button"),e.className=ENTER_VR_BTN_CLASS,e.setAttribute("title","Enter VR mode with a headset or fullscreen mode on a desktop. Visit https://webvr.rocks or https://webvr.info for more information."),e.setAttribute(constants.AFRAME_INJECTED,""),n.appendChild(e),e.addEventListener("click",function(e){t()}),n}function createOrientationModal(t){var e=document.createElement("div");e.className=ORIENTATION_MODAL_CLASS,e.classList.add(HIDDEN_CLASS),e.setAttribute(constants.AFRAME_INJECTED,"");var n=document.createElement("button");return n.setAttribute(constants.AFRAME_INJECTED,""),n.innerHTML="Exit VR",n.addEventListener("click",t),e.appendChild(n),e}var registerComponent=_dereq_("../../core/component").registerComponent,constants=_dereq_("../../constants/"),utils=_dereq_("../../utils/"),bind=utils.bind,ENTER_VR_CLASS="a-enter-vr",ENTER_VR_BTN_CLASS="a-enter-vr-button",HIDDEN_CLASS="a-hidden",ORIENTATION_MODAL_CLASS="a-orientation-modal";module.exports.Component=registerComponent("vr-mode-ui",{dependencies:["canvas"],schema:{enabled:{default:!0}},init:function(){var t=this,e=this.el;"false"!==utils.getUrlParameter("ui")&&(this.insideLoader=!1,this.enterVREl=null,this.orientationModalEl=null,this.bindMethods(),e.addEventListener("enter-vr",this.updateEnterVRInterface),e.addEventListener("exit-vr",this.updateEnterVRInterface),window.addEventListener("message",function(e){"loaderReady"===e.data.type&&(t.insideLoader=!0,t.remove())}),window.addEventListener("orientationchange",this.toggleOrientationModalIfNeeded))},bindMethods:function(){this.onEnterVRButtonClick=bind(this.onEnterVRButtonClick,this),this.onModalClick=bind(this.onModalClick,this),this.toggleOrientationModalIfNeeded=bind(this.toggleOrientationModalIfNeeded,this),this.updateEnterVRInterface=bind(this.updateEnterVRInterface,this)},onModalClick:function(){this.el.exitVR()},onEnterVRButtonClick:function(){this.el.enterVR()},update:function(){var t=this.el;return!this.data.enabled||this.insideLoader||"false"===utils.getUrlParameter("ui")?this.remove():void(this.enterVREl||this.orientationModalEl||(this.enterVREl=createEnterVRButton(this.onEnterVRButtonClick),t.appendChild(this.enterVREl),this.orientationModalEl=createOrientationModal(this.onModalClick),t.appendChild(this.orientationModalEl),this.updateEnterVRInterface()))},remove:function(){[this.enterVREl,this.orientationModalEl].forEach(function(t){t&&t.parentNode.removeChild(t)})},updateEnterVRInterface:function(){this.toggleEnterVRButtonIfNeeded(),this.toggleOrientationModalIfNeeded()},toggleEnterVRButtonIfNeeded:function(){var t=this.el;this.enterVREl&&(t.is("vr-mode")?this.enterVREl.classList.add(HIDDEN_CLASS):this.enterVREl.classList.remove(HIDDEN_CLASS))},toggleOrientationModalIfNeeded:function(){var t=this.el,e=this.orientationModalEl;e&&t.isMobile&&(!utils.device.isLandscape()&&t.is("vr-mode")?e.classList.remove(HIDDEN_CLASS):e.classList.add(HIDDEN_CLASS))}});
  246. },{"../../constants/":117,"../../core/component":126,"../../utils/":196}],108:[function(_dereq_,module,exports){
  247. var component=_dereq_("../core/component"),THREE=_dereq_("../lib/three"),bind=_dereq_("../utils/bind"),registerComponent=component.registerComponent;module.exports.Component=registerComponent("shadow",{schema:{cast:{default:!0},receive:{default:!0}},init:function(){this.onMeshChanged=bind(this.update,this),this.el.addEventListener("object3dset",this.onMeshChanged),this.system.setShadowMapEnabled(!0)},update:function(){var e=this.data;this.updateDescendants(e.cast,e.receive)},remove:function(){var e=this.el;e.removeEventListener("object3dset",this.onMeshChanged),this.updateDescendants(!1,!1)},updateDescendants:function(e,t){var n=this.el.sceneEl;this.el.object3D.traverse(function(a){if(a instanceof THREE.Mesh&&(a.castShadow=e,a.receiveShadow=t,n.hasLoaded&&a.material))for(var s=Array.isArray(a.material)?a.material:[a.material],i=0;i<s.length;i++)s[i].needsUpdate=!0})}});
  248. },{"../core/component":126,"../lib/three":174,"../utils/bind":190}],109:[function(_dereq_,module,exports){
  249. var registerComponent=_dereq_("../core/component").registerComponent,debug=_dereq_("../utils/debug"),bind=_dereq_("../utils/bind"),THREE=_dereq_("../lib/three"),warn=debug("components:sound:warn");module.exports.Component=registerComponent("sound",{schema:{autoplay:{default:!1},distanceModel:{default:"inverse",oneOf:["linear","inverse","exponential"]},loop:{default:!1},maxDistance:{default:1e4},on:{default:""},poolSize:{default:1},positional:{default:!0},refDistance:{default:1},rolloffFactor:{default:1},src:{type:"audio"},volume:{default:1}},multiple:!0,init:function(){this.listener=null,this.audioLoader=new THREE.AudioLoader,this.pool=new THREE.Group,this.loaded=!1,this.mustPlay=!1,this.playSound=bind(this.playSound,this)},update:function(e){var t=this.data,o=t.src!==e.src;if(o){if(!t.src)return void warn("Audio source was not specified with `src`");this.setupSound()}if(this.pool.children.forEach(function(e){t.positional&&(e.setDistanceModel(t.distanceModel),e.setMaxDistance(t.maxDistance),e.setRefDistance(t.refDistance),e.setRolloffFactor(t.rolloffFactor)),e.setLoop(t.loop),e.setVolume(t.volume),e.isPaused=!1}),t.on!==e.on&&this.updateEventListener(e.on),o){var i=this;this.loaded=!1,this.audioLoader.load(t.src,function(e){i.pool.children.forEach(function(t){t.setBuffer(e)}),i.loaded=!0,THREE.Cache.remove(t.src),(i.data.autoplay||i.mustPlay)&&i.playSound(),i.el.emit("sound-loaded")})}},pause:function(){this.stopSound(),this.removeEventListener()},play:function(){this.data.autoplay&&this.playSound(),this.updateEventListener()},remove:function(){this.removeEventListener(),this.el.removeObject3D(this.attrName);try{this.pool.children.forEach(function(e){e.disconnect()})}catch(e){warn("Audio source not properly disconnected")}},updateEventListener:function(e){var t=this.el;e&&t.removeEventListener(e,this.playSound),t.addEventListener(this.data.on,this.playSound)},removeEventListener:function(){this.el.removeEventListener(this.data.on,this.playSound)},setupSound:function(){var e=this.el,t=e.sceneEl;this.pool.children.length>0&&(this.stopSound(),e.removeObject3D("sound"));var o=this.listener=t.audioListener||new THREE.AudioListener;t.audioListener=o,t.camera&&t.camera.add(o),t.addEventListener("camera-set-active",function(e){e.detail.cameraEl.getObject3D("camera").add(o)}),this.pool=new THREE.Group;for(var i=0;i<this.data.poolSize;i++){var n=this.data.positional?new THREE.PositionalAudio(o):new THREE.Audio(o);this.pool.add(n)}e.setObject3D(this.attrName,this.pool),this.pool.children.forEach(function(t){t.onEnded=function(){t.isPlaying=!1,e.emit("sound-ended",{index:i})}})},pauseSound:function(){this.isPlaying=!1,this.pool.children.forEach(function(e){e.source&&e.source.buffer&&e.isPlaying&&!e.isPaused&&(e.isPaused=!0,e.pause())})},playSound:function(){if(!this.loaded)return warn("Sound not loaded yet. It will be played once it finished loading"),void(this.mustPlay=!0);var e=!1;return this.isPlaying=!0,this.pool.children.forEach(function(t){if(!t.isPlaying&&t.buffer&&!e)return t.play(),t.isPaused=!1,void(e=!0)}),e?void(this.mustPlay=!1):void warn("All the sounds are playing. If you need to play more sounds simultaneously consider increasing the size of pool with the `poolSize` attribute.",this.el)},stopSound:function(){this.isPlaying=!1,this.pool.children.forEach(function(e){e.source&&e.source.buffer&&e.stop()})}});
  250. },{"../core/component":126,"../lib/three":174,"../utils/bind":190,"../utils/debug":192}],110:[function(_dereq_,module,exports){
  251. function parseSide(t){switch(t){case"back":return THREE.FrontSide;case"double":return THREE.DoubleSide;default:return THREE.BackSide}}function coerceData(t){return t=utils.clone(t),void 0!==t.lineHeight&&(t.lineHeight=parseFloat(t.lineHeight),isFinite(t.lineHeight)||(t.lineHeight=void 0)),void 0!==t.width&&(t.width=parseFloat(t.width),isFinite(t.width)||(t.width=void 0)),t}function loadFont(t,e){return new Promise(function(r,o){loadBMFont(t,function(n,i){return n?(error("Error loading font",t),void o(n)):(t.indexOf("/Roboto-msdf.json")>=0&&(e=30),e&&i.chars.map(function(t){t.yoffset+=e}),void r(i))})})}function loadTexture(t){return new Promise(function(e,r){(new THREE.ImageLoader).load(t,function(t){e(t)},void 0,function(){error("Error loading font image",t),r(null)})})}function createShader(t,e,r){var o,n;return n=new shaders[e].Shader,n.el=t,n.init(r),n.update(r),o=n.material,o.transparent=r.transparent,{material:o,shader:n}}function updateBaseMaterial(t,e){t.side=e.side}function computeWidth(t,e,r){return t||(.5+e)*r}function computeFontWidthFactor(t){var e=0,r=0,o=0;return t.chars.map(function(t){e+=t.xadvance,t.id>=48&&t.id<=57&&(o++,r+=t.xadvance)}),o?r/o:e/t.chars.length}function PromiseCache(){var t=this.cache={};this.get=function(e,r){return e in t?t[e]:(t[e]=r(),t[e])}}var createTextGeometry=_dereq_("three-bmfont-text"),loadBMFont=_dereq_("load-bmfont"),registerComponent=_dereq_("../core/component").registerComponent,coreShader=_dereq_("../core/shader"),THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/"),error=utils.debug("components:text:error"),shaders=coreShader.shaders,warn=utils.debug("components:text:warn"),DEFAULT_WIDTH=1,MAX_ANISOTROPY=16,FONT_BASE_URL="https://cdn.aframe.io/fonts/",FONTS={aileronsemibold:FONT_BASE_URL+"Aileron-Semibold.fnt",dejavu:FONT_BASE_URL+"DejaVu-sdf.fnt",exo2bold:FONT_BASE_URL+"Exo2Bold.fnt",exo2semibold:FONT_BASE_URL+"Exo2SemiBold.fnt",kelsonsans:FONT_BASE_URL+"KelsonSans.fnt",monoid:FONT_BASE_URL+"Monoid.fnt",mozillavr:FONT_BASE_URL+"mozillavr.fnt",roboto:FONT_BASE_URL+"Roboto-msdf.json",sourcecodepro:FONT_BASE_URL+"SourceCodePro.fnt"},MSDF_FONTS=["roboto"],DEFAULT_FONT="roboto";module.exports.FONTS=FONTS;var cache=new PromiseCache,fontWidthFactors={},textures={};module.exports.Component=registerComponent("text",{multiple:!0,schema:{align:{type:"string",default:"left",oneOf:["left","right","center"]},alphaTest:{default:.5},anchor:{default:"center",oneOf:["left","right","center","align"]},baseline:{default:"center",oneOf:["top","center","bottom"]},color:{type:"color",default:"#FFF"},font:{type:"string",default:DEFAULT_FONT},fontImage:{type:"string"},height:{type:"number"},letterSpacing:{type:"number",default:0},lineHeight:{type:"number"},opacity:{type:"number",default:1},shader:{default:"sdf",oneOf:shaders},side:{default:"front",oneOf:["front","back","double"]},tabSize:{default:4},transparent:{default:!0},value:{type:"string"},whiteSpace:{default:"normal",oneOf:["normal","pre","nowrap"]},width:{type:"number"},wrapCount:{type:"number",default:40},wrapPixels:{type:"number"},xOffset:{type:"number",default:0},yOffset:{type:"number",default:0},zOffset:{type:"number",default:.001}},init:function(){this.geometry=createTextGeometry(),this.createOrUpdateMaterial(),this.mesh=new THREE.Mesh(this.geometry,this.material),this.el.setObject3D(this.attrName,this.mesh)},update:function(t){var e=coerceData(this.data),r=this.currentFont,o=this.getFontImageSrc();return textures[o]?this.texture=textures[o]:(this.texture=textures[o]=new THREE.Texture,this.texture.anisotropy=MAX_ANISOTROPY),this.createOrUpdateMaterial(),t.font!==e.font?void this.updateFont():void(r&&(this.updateGeometry(this.geometry,e,r),this.updateLayout(e)))},remove:function(){this.geometry.dispose(),this.geometry=null,this.el.removeObject3D(this.attrName),this.material.dispose(),this.material=null,this.texture.dispose(),this.texture=null,this.shaderObject&&delete this.shaderObject},createOrUpdateMaterial:function(){var t,e,r,o,n=this.data,i=this.material;return o=n.shader,MSDF_FONTS.indexOf(n.font)!==-1||n.font.indexOf("-msdf.")>=0?o="msdf":n.font in FONTS&&MSDF_FONTS.indexOf(n.font)===-1&&(o="sdf"),t=(this.shaderObject&&this.shaderObject.name)!==o,r={alphaTest:n.alphaTest,color:n.color,map:this.texture,opacity:n.opacity,side:parseSide(n.side),transparent:n.transparent},t?(e=createShader(this.el,o,r),this.material=e.material,this.shaderObject=e.shader,updateBaseMaterial(this.material,r),void(this.mesh&&(this.mesh.material=this.material))):(this.shaderObject.update(r),i.transparent=r.transparent,void updateBaseMaterial(i,r))},updateFont:function(){var t,e=this.data,r=this.el,o=this.geometry,n=this;e.font||warn("No font specified. Using the default font."),this.mesh.visible=!1,t=this.lookupFont(e.font||DEFAULT_FONT)||e.font,cache.get(t,function(){return loadFont(t,e.yOffset)}).then(function(i){var a,s;if(1!==i.pages.length)throw new Error("Currently only single-page bitmap fonts are supported.");fontWidthFactors[t]||(i.widthFactor=fontWidthFactors[i]=computeFontWidthFactor(i)),a=coerceData(e),n.updateGeometry(o,n.data,i),n.currentFont=i,n.updateLayout(a),s=n.getFontImageSrc(),cache.get(s,function(){return loadTexture(s)}).then(function(t){var o=n.texture;o.image=t,o.needsUpdate=!0,textures[s]=o,n.texture=o,n.mesh.visible=!0,r.emit("textfontset",{font:e.font,fontObj:i})}).catch(function(t){throw error(t),t})}).catch(function(t){throw error(t),t})},getFontImageSrc:function(){var t=this.lookupFont(this.data.font||DEFAULT_FONT)||this.data.font;return this.data.fontImage||t.replace(/(\.fnt)|(\.json)/,".png")},updateLayout:function(t){var e,r,o,n,i,a,s,h,d=this.el,u=this.geometry,l=d.getAttribute("geometry"),c=u.layout,f=this.mesh;if(l=d.getAttribute("geometry"),a=t.width||l&&l.width||DEFAULT_WIDTH,n=computeWidth(t.wrapPixels,t.wrapCount,this.currentFont.widthFactor),i=a/n,o=i*(c.height+c.descender),l&&(l.width||d.setAttribute("geometry","width",a),l.height||d.setAttribute("geometry","height",o)),e="align"===t.anchor?t.align:t.anchor,"left"===e)s=0;else if("right"===e)s=-1*c.width;else{if("center"!==e)throw new TypeError("Invalid text.anchor property value",e);s=-1*c.width/2}if(r=t.baseline,"bottom"===r)h=0;else if("top"===r)h=-1*c.height+c.ascender;else{if("center"!==r)throw new TypeError("Invalid text.baseline property value",r);h=-1*c.height/2}f.position.x=s*i+t.xOffset,f.position.y=h*i,f.position.z=t.zOffset,f.scale.set(i,-1*i,i),this.geometry.computeBoundingSphere()},lookupFont:function(t){return FONTS[t]},updateGeometry:function(t,e,r){t.update(utils.extend({},e,{font:r,width:computeWidth(e.wrapPixels,e.wrapCount,r.widthFactor),text:e.value.toString().replace(/\\n/g,"\n").replace(/\\t/g,"\t"),lineHeight:e.lineHeight||r.common.lineHeight}))}});
  252. },{"../core/component":126,"../core/shader":135,"../lib/three":174,"../utils/":196,"load-bmfont":24,"three-bmfont-text":37}],111:[function(_dereq_,module,exports){
  253. var registerComponent=_dereq_("../core/component").registerComponent,controllerUtils=_dereq_("../utils/tracked-controls"),DEFAULT_CAMERA_HEIGHT=_dereq_("../constants").DEFAULT_CAMERA_HEIGHT,THREE=_dereq_("../lib/three"),DEFAULT_HANDEDNESS=_dereq_("../constants").DEFAULT_HANDEDNESS,EYES_TO_ELBOW={x:.175,y:-.3,z:-.03},FOREARM={x:0,y:0,z:-.175};module.exports.Component=registerComponent("tracked-controls",{schema:{controller:{default:0},id:{type:"string",default:""},hand:{type:"string",default:""},idPrefix:{type:"string",default:""},rotationOffset:{default:0},armModel:{default:!0},headElement:{type:"selector"}},init:function(){this.axis=[0,0,0],this.buttonStates={},this.changedAxes=[],this.targetControllerNumber=this.data.controller,this.axisMoveEventDetail={axis:this.axis,changed:this.changedAxes},this.deltaControllerPosition=new THREE.Vector3,this.controllerQuaternion=new THREE.Quaternion,this.controllerEuler=new THREE.Euler,this.updateGamepad(),this.el.object3D.matrixAutoUpdate=!1},tick:function(t,e){var i=this.el.getObject3D("mesh");i&&i.update&&i.update(e/1e3),this.updateGamepad(),this.updatePose(),this.updateButtons()},defaultUserHeight:function(){return DEFAULT_CAMERA_HEIGHT},getHeadElement:function(){return this.data.headElement||this.el.sceneEl.camera.el},updateGamepad:function(){var t=this.data,e=controllerUtils.findMatchingController(this.system.controllers,t.id,t.idPrefix,t.hand,t.controller);this.controller=e},applyArmModel:function(t){var e,i,n,o,r,s=this.controller,a=this.controllerEuler,l=this.controllerQuaternion,h=this.deltaControllerPosition;i=this.getHeadElement(),n=i.object3D,r=this.defaultUserHeight(),o=s.pose,e=(s?s.hand:void 0)||DEFAULT_HANDEDNESS,t.copy(n.position),h.set(EYES_TO_ELBOW.x*("left"===e?-1:"right"===e?1:0),EYES_TO_ELBOW.y,EYES_TO_ELBOW.z),h.multiplyScalar(r),h.applyAxisAngle(n.up,n.rotation.y),t.add(h),h.set(FOREARM.x,FOREARM.y,FOREARM.z),h.multiplyScalar(r),o.orientation?l.fromArray(o.orientation):l.copy(n.quaternion),a.setFromQuaternion(l),a.set(a.x,a.y,0),h.applyEuler(a),t.add(h)},updatePose:function(){var t,e,i=this.controller,n=this.el.object3D,o=this.system.vrDisplay;i&&(t=i.pose,null!==t.position?n.position.fromArray(t.position):this.data.armModel&&this.applyArmModel(n.position),null!==t.orientation&&n.quaternion.fromArray(t.orientation),o&&(e=this.el.sceneEl.renderer.vr.getStandingMatrix(),n.matrixAutoUpdate=!1,n.matrix.compose(n.position,n.quaternion,n.scale),n.matrix.multiplyMatrices(e,n.matrix),n.matrixWorldNeedsUpdate=!0))},updateButtons:function(){var t,e,i=this.controller;if(i){for(e=0;e<i.buttons.length;++e)this.buttonStates[e]||(this.buttonStates[e]={pressed:!1,touched:!1,value:0}),t=i.buttons[e],this.handleButton(e,t);this.handleAxes()}},handleButton:function(t,e){var i=this.handlePress(t,e)||this.handleTouch(t,e)||this.handleValue(t,e);return!!i&&(this.el.emit("buttonchanged",{id:t,state:e}),!0)},handleAxes:function(){var t,e=!1,i=this.controller.axes,n=this.axis,o=this.changedAxes;for(this.changedAxes.length=0,t=0;t<i.length;++t)o.push(n[t]!==i[t]),o[t]&&(e=!0);if(!e)return!1;for(this.axis.length=0,t=0;t<i.length;t++)this.axis.push(i[t]);return this.el.emit("axismove",this.axisMoveEventDetail),!0},handlePress:function(t,e){var i,n=this.buttonStates[t];return e.pressed!==n.pressed&&(i=e.pressed?"down":"up",this.el.emit("button"+i,{id:t,state:e}),n.pressed=e.pressed,!0)},handleTouch:function(t,e){var i,n=this.buttonStates[t];return e.touched!==n.touched&&(i=e.touched?"start":"end",this.el.emit("touch"+i,{id:t,state:e},!0,{touches:[]}),n.touched=e.touched,!0)},handleValue:function(t,e){var i=this.buttonStates[t];return e.value!==i.value&&(i.value=e.value,!0)}});
  254. },{"../constants":117,"../core/component":126,"../lib/three":174,"../utils/tracked-controls":201}],112:[function(_dereq_,module,exports){
  255. var registerComponent=_dereq_("../core/component").registerComponent;module.exports.Component=registerComponent("visible",{schema:{default:!0},update:function(){this.el.object3D.visible=this.data}});
  256. },{"../core/component":126}],113:[function(_dereq_,module,exports){
  257. var registerComponent=_dereq_("../core/component").registerComponent,utils=_dereq_("../utils/"),bind=utils.bind,trackedControlsUtils=_dereq_("../utils/tracked-controls"),checkControllerPresentAndSetup=trackedControlsUtils.checkControllerPresentAndSetup,emitIfAxesChanged=trackedControlsUtils.emitIfAxesChanged,onButtonEvent=trackedControlsUtils.onButtonEvent,VIVE_CONTROLLER_MODEL_OBJ_URL="https://cdn.aframe.io/controllers/vive/vr_controller_vive.obj",VIVE_CONTROLLER_MODEL_OBJ_MTL="https://cdn.aframe.io/controllers/vive/vr_controller_vive.mtl",GAMEPAD_ID_PREFIX="OpenVR ";module.exports.Component=registerComponent("vive-controls",{schema:{hand:{default:"left"},buttonColor:{type:"color",default:"#FAFAFA"},buttonHighlightColor:{type:"color",default:"#22D1EE"},model:{default:!0},rotationOffset:{default:0}},mapping:{axes:{trackpad:[0,1]},buttons:["trackpad","trigger","grip","menu","system"]},init:function(){var t=this;this.animationActive="pointing",this.checkControllerPresentAndSetup=checkControllerPresentAndSetup,this.controllerPresent=!1,this.emitIfAxesChanged=emitIfAxesChanged,this.lastControllerCheck=0,this.onButtonChanged=bind(this.onButtonChanged,this),this.onButtonDown=function(e){onButtonEvent(e.detail.id,"down",t)},this.onButtonUp=function(e){onButtonEvent(e.detail.id,"up",t)},this.onButtonTouchEnd=function(e){onButtonEvent(e.detail.id,"touchend",t)},this.onButtonTouchStart=function(e){onButtonEvent(e.detail.id,"touchstart",t)},this.onAxisMoved=bind(this.onAxisMoved,this),this.previousButtonValues={},this.bindMethods()},play:function(){this.checkIfControllerPresent(),this.addControllersUpdateListener()},pause:function(){this.removeEventListeners(),this.removeControllersUpdateListener()},bindMethods:function(){this.onModelLoaded=bind(this.onModelLoaded,this),this.onControllersUpdate=bind(this.onControllersUpdate,this),this.checkIfControllerPresent=bind(this.checkIfControllerPresent,this),this.removeControllersUpdateListener=bind(this.removeControllersUpdateListener,this),this.onAxisMoved=bind(this.onAxisMoved,this)},addEventListeners:function(){var t=this.el;t.addEventListener("buttonchanged",this.onButtonChanged),t.addEventListener("buttondown",this.onButtonDown),t.addEventListener("buttonup",this.onButtonUp),t.addEventListener("touchend",this.onButtonTouchEnd),t.addEventListener("touchstart",this.onButtonTouchStart),t.addEventListener("model-loaded",this.onModelLoaded),t.addEventListener("axismove",this.onAxisMoved),this.controllerEventsActive=!0},removeEventListeners:function(){var t=this.el;t.removeEventListener("buttonchanged",this.onButtonChanged),t.removeEventListener("buttondown",this.onButtonDown),t.removeEventListener("buttonup",this.onButtonUp),t.removeEventListener("touchend",this.onButtonTouchEnd),t.removeEventListener("touchstart",this.onButtonTouchStart),t.removeEventListener("model-loaded",this.onModelLoaded),t.removeEventListener("axismove",this.onAxisMoved),this.controllerEventsActive=!1},checkIfControllerPresent:function(){var t=this.data,e="right"===t.hand?0:"left"===t.hand?1:2;this.checkControllerPresentAndSetup(this,GAMEPAD_ID_PREFIX,{index:e})},injectTrackedControls:function(){var t=this.el,e=this.data;t.setAttribute("tracked-controls",{idPrefix:GAMEPAD_ID_PREFIX,controller:"right"===e.hand?0:"left"===e.hand?1:2,rotationOffset:e.rotationOffset}),this.data.model&&this.el.setAttribute("obj-model",{obj:VIVE_CONTROLLER_MODEL_OBJ_URL,mtl:VIVE_CONTROLLER_MODEL_OBJ_MTL})},addControllersUpdateListener:function(){this.el.sceneEl.addEventListener("controllersupdated",this.onControllersUpdate,!1)},removeControllersUpdateListener:function(){this.el.sceneEl.removeEventListener("controllersupdated",this.onControllersUpdate,!1)},onControllersUpdate:function(){this.checkIfControllerPresent()},onButtonChanged:function(t){var e,o=this.mapping.buttons[t.detail.id],n=this.buttonMeshes;o&&("trigger"===o&&(e=t.detail.state.value,n&&n.trigger&&(n.trigger.rotation.x=-e*(Math.PI/12))),this.el.emit(o+"changed",t.detail.state))},onModelLoaded:function(t){var e,o=t.detail.model,n=this;this.data.model&&(e=this.buttonMeshes={},e.grip={left:o.getObjectByName("leftgrip"),right:o.getObjectByName("rightgrip")},e.menu=o.getObjectByName("menubutton"),e.system=o.getObjectByName("systembutton"),e.trackpad=o.getObjectByName("touchpad"),e.trigger=o.getObjectByName("trigger"),Object.keys(e).forEach(function(t){n.setButtonColor(t,n.data.buttonColor)}),o.position.set(0,-.015,.04))},onAxisMoved:function(t){this.emitIfAxesChanged(this,this.mapping.axes,t)},updateModel:function(t,e){var o,n;this.data.model&&(n=e.indexOf("touch")!==-1,n||(o="up"===e?this.data.buttonColor:this.data.buttonHighlightColor,this.setButtonColor(t,o)))},setButtonColor:function(t,e){var o=this.buttonMeshes;if(o)return"grip"===t?(o.grip.left.material.color.set(e),void o.grip.right.material.color.set(e)):void o[t].material.color.set(e)}});
  258. },{"../core/component":126,"../utils/":196,"../utils/tracked-controls":201}],114:[function(_dereq_,module,exports){
  259. function isEmptyObject(e){var t;for(t in e)return!1;return!0}var KEYCODE_TO_CODE=_dereq_("../constants").keyboardevent.KEYCODE_TO_CODE,registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/"),bind=utils.bind,shouldCaptureKeyEvent=utils.shouldCaptureKeyEvent,CLAMP_VELOCITY=1e-5,MAX_DELTA=.2,KEYS=["KeyW","KeyA","KeyS","KeyD","ArrowUp","ArrowLeft","ArrowRight","ArrowDown"];module.exports.Component=registerComponent("wasd-controls",{schema:{acceleration:{default:65},adAxis:{default:"x",oneOf:["x","y","z"]},adEnabled:{default:!0},adInverted:{default:!1},easing:{default:20},enabled:{default:!0},fly:{default:!1},wsAxis:{default:"z",oneOf:["x","y","z"]},wsEnabled:{default:!0},wsInverted:{default:!1}},init:function(){this.keys={},this.position={},this.velocity=new THREE.Vector3,this.onBlur=bind(this.onBlur,this),this.onFocus=bind(this.onFocus,this),this.onKeyDown=bind(this.onKeyDown,this),this.onKeyUp=bind(this.onKeyUp,this),this.onVisibilityChange=bind(this.onVisibilityChange,this),this.attachVisibilityEventListeners()},tick:function(e,t){var i,n,s=this.data,o=this.el,r=this.position,a=this.velocity;(a[s.adAxis]||a[s.wsAxis]||!isEmptyObject(this.keys))&&(t/=1e3,this.updateVelocity(t),(a[s.adAxis]||a[s.wsAxis])&&(i=o.getAttribute("position"),n=this.getMovementVector(t),r.x=i.x+n.x,r.y=i.y+n.y,r.z=i.z+n.z,o.setAttribute("position",r)))},remove:function(){this.removeKeyEventListeners(),this.removeVisibilityEventListeners()},play:function(){this.attachKeyEventListeners()},pause:function(){this.keys={},this.removeKeyEventListeners()},updateVelocity:function(e){var t,i,n,s,o,r=this.data,a=this.keys,d=this.velocity;return i=r.adAxis,s=r.wsAxis,e>MAX_DELTA?(d[i]=0,void(d[s]=0)):(0!==d[i]&&(d[i]-=d[i]*r.easing*e),0!==d[s]&&(d[s]-=d[s]*r.easing*e),Math.abs(d[i])<CLAMP_VELOCITY&&(d[i]=0),Math.abs(d[s])<CLAMP_VELOCITY&&(d[s]=0),void(r.enabled&&(t=r.acceleration,r.adEnabled&&(n=r.adInverted?-1:1,(a.KeyA||a.ArrowLeft)&&(d[i]-=n*t*e),(a.KeyD||a.ArrowRight)&&(d[i]+=n*t*e)),r.wsEnabled&&(o=r.wsInverted?-1:1,(a.KeyW||a.ArrowUp)&&(d[s]-=o*t*e),(a.KeyS||a.ArrowDown)&&(d[s]+=o*t*e)))))},getMovementVector:function(){var e=new THREE.Vector3(0,0,0),t=new THREE.Euler(0,0,0,"YXZ");return function(i){var n,s=this.el.getAttribute("rotation"),o=this.velocity;return e.copy(o),e.multiplyScalar(i),s?(n=this.data.fly?s.x:0,t.set(THREE.Math.degToRad(n),THREE.Math.degToRad(s.y),0),e.applyEuler(t),e):e}}(),attachVisibilityEventListeners:function(){window.addEventListener("blur",this.onBlur),window.addEventListener("focus",this.onFocus),document.addEventListener("visibilitychange",this.onVisibilityChange)},removeVisibilityEventListeners:function(){window.removeEventListener("blur",this.onBlur),window.removeEventListener("focus",this.onFocus),document.removeEventListener("visibilitychange",this.onVisibilityChange)},attachKeyEventListeners:function(){window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp)},removeKeyEventListeners:function(){window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp)},onBlur:function(){this.pause()},onFocus:function(){this.play()},onVisibilityChange:function(){document.hidden?this.onBlur():this.onFocus()},onKeyDown:function(e){var t;shouldCaptureKeyEvent(e)&&(t=e.code||KEYCODE_TO_CODE[e.keyCode],KEYS.indexOf(t)!==-1&&(this.keys[t]=!0))},onKeyUp:function(e){var t;t=e.code||KEYCODE_TO_CODE[e.keyCode],delete this.keys[t]}});
  260. },{"../constants":117,"../core/component":126,"../lib/three":174,"../utils/":196}],115:[function(_dereq_,module,exports){
  261. var bind=_dereq_("../utils/bind"),registerComponent=_dereq_("../core/component").registerComponent,trackedControlsUtils=_dereq_("../utils/tracked-controls"),onButtonEvent=trackedControlsUtils.onButtonEvent,utils=_dereq_("../utils/"),debug=utils.debug("components:windows-motion-controls:debug"),warn=utils.debug("components:windows-motion-controls:warn"),DEFAULT_HANDEDNESS=_dereq_("../constants").DEFAULT_HANDEDNESS,MODEL_BASE_URL="https://cdn.aframe.io/controllers/microsoft/",MODEL_FILENAMES={left:"left.glb",right:"right.glb",default:"universal.glb"},GAMEPAD_ID_PREFIX="Spatial Controller (Spatial Interaction Source) ",GAMEPAD_ID_PATTERN=/([0-9a-zA-Z]+-[0-9a-zA-Z]+)$/;module.exports.Component=registerComponent("windows-motion-controls",{schema:{hand:{default:DEFAULT_HANDEDNESS},pair:{default:0},model:{default:!0},hideDisconnected:{default:!0}},mapping:{axes:{thumbstick:[0,1],trackpad:[2,3]},buttons:["thumbstick","trigger","grip","menu","trackpad"],axisMeshNames:["THUMBSTICK_X","THUMBSTICK_Y","TOUCHPAD_TOUCH_X","TOUCHPAD_TOUCH_Y"],buttonMeshNames:{trigger:"SELECT",menu:"MENU",grip:"GRASP",thumbstick:"THUMBSTICK_PRESS",trackpad:"TOUCHPAD_PRESS"},pointingPoseMeshName:"POINTING_POSE"},bindMethods:function(){this.onModelError=bind(this.onModelError,this),this.onModelLoaded=bind(this.onModelLoaded,this),this.onControllersUpdate=bind(this.onControllersUpdate,this),this.checkIfControllerPresent=bind(this.checkIfControllerPresent,this),this.onAxisMoved=bind(this.onAxisMoved,this)},init:function(){var t=this,e=this.el;this.onButtonChanged=bind(this.onButtonChanged,this),this.onButtonDown=function(e){onButtonEvent(e,"down",t)},this.onButtonUp=function(e){onButtonEvent(e,"up",t)},this.onButtonTouchStart=function(e){onButtonEvent(e,"touchstart",t)},this.onButtonTouchEnd=function(e){onButtonEvent(e,"touchend",t)},this.onControllerConnected=function(){t.setModelVisibility(!0)},this.onControllerDisconnected=function(){t.setModelVisibility(!1)},this.controllerPresent=!1,this.lastControllerCheck=0,this.previousButtonValues={},this.bindMethods(),this.loadedMeshInfo={buttonMeshes:null,axisMeshes:null},this.rayOrigin={origin:new THREE.Vector3,direction:new THREE.Vector3(0,0,-1),createdFromMesh:!1},this.emitIfAxesChanged=trackedControlsUtils.emitIfAxesChanged,this.checkControllerPresentAndSetup=trackedControlsUtils.checkControllerPresentAndSetup,e.addEventListener("controllerconnected",this.onControllerConnected),e.addEventListener("controllerdisconnected",this.onControllerDisconnected)},addEventListeners:function(){var t=this.el;t.addEventListener("buttonchanged",this.onButtonChanged),t.addEventListener("buttondown",this.onButtonDown),t.addEventListener("buttonup",this.onButtonUp),t.addEventListener("touchstart",this.onButtonTouchStart),t.addEventListener("touchend",this.onButtonTouchEnd),t.addEventListener("axismove",this.onAxisMoved),t.addEventListener("model-error",this.onModelError),t.addEventListener("model-loaded",this.onModelLoaded),this.controllerEventsActive=!0},removeEventListeners:function(){var t=this.el;t.removeEventListener("buttonchanged",this.onButtonChanged),t.removeEventListener("buttondown",this.onButtonDown),t.removeEventListener("buttonup",this.onButtonUp),t.removeEventListener("touchstart",this.onButtonTouchStart),t.removeEventListener("touchend",this.onButtonTouchEnd),t.removeEventListener("axismove",this.onAxisMoved),t.removeEventListener("model-error",this.onModelError),t.removeEventListener("model-loaded",this.onModelLoaded),this.controllerEventsActive=!1},checkIfControllerPresent:function(){this.checkControllerPresentAndSetup(this,GAMEPAD_ID_PREFIX,{hand:this.data.hand,index:this.data.pair})},play:function(){this.checkIfControllerPresent(),this.addControllersUpdateListener()},pause:function(){this.removeEventListeners(),this.removeControllersUpdateListener()},updateControllerModel:function(){if(!this.data.model||this.rayOrigin.createdFromMesh)return void this.modelReady();var t=this.createControllerModelUrl();this.loadModel(t)},createControllerModelUrl:function(t){var e,n=this.el.components["tracked-controls"],o=n?n.controller:null,i="default",s=this.data.hand;if(o&&(s=o.hand,!t)){var r=o.id.match(GAMEPAD_ID_PATTERN);i=r&&r[0]||i}return e=MODEL_FILENAMES[s]||MODEL_FILENAMES.default,MODEL_BASE_URL+i+"/"+e},injectTrackedControls:function(){var t=this.data;this.el.setAttribute("tracked-controls",{idPrefix:GAMEPAD_ID_PREFIX,controller:t.pair,hand:t.hand,armModel:!1}),this.updateControllerModel()},addControllersUpdateListener:function(){this.el.sceneEl.addEventListener("controllersupdated",this.onControllersUpdate,!1)},removeControllersUpdateListener:function(){this.el.sceneEl.removeEventListener("controllersupdated",this.onControllersUpdate,!1)},onControllersUpdate:function(){this.checkIfControllerPresent()},onModelError:function(t){var e=this.createControllerModelUrl(!0);t.detail.src!==e?(warn("Failed to load controller model for device, attempting to load default."),this.loadModel(e)):warn("Failed to load default controller model.")},loadModel:function(t){this.el.setAttribute("gltf-model","url("+t+")")},onModelLoaded:function(t){function e(t,e){for(var n=0,o=t.children.length;n<o;n++){var i=t.children[n];if(i&&i.name===e)return i}}var n,o,i,s,r=this.controllerModel=t.detail.model,a=this.loadedMeshInfo;if(debug("Processing model"),a.buttonMeshes={},a.axisMeshes={},r){for(n=0;n<this.mapping.buttons.length;n++)o=this.mapping.buttonMeshNames[this.mapping.buttons[n]],o?(i=r.getObjectByName(o),i?(s={index:n,value:e(i,"VALUE"),pressed:e(i,"PRESSED"),unpressed:e(i,"UNPRESSED")},s.value&&s.pressed&&s.unpressed?a.buttonMeshes[this.mapping.buttons[n]]=s:warn("Missing button submesh under mesh with name: "+o+"(VALUE: "+!!s.value+", PRESSED: "+!!s.pressed+", UNPRESSED:"+!!s.unpressed+")")):warn("Missing button mesh with name: "+o)):debug("Skipping unknown button at index: "+n+" with mapped name: "+this.mapping.buttons[n]);for(n=0;n<this.mapping.axisMeshNames.length;n++)o=this.mapping.axisMeshNames[n],o?(i=r.getObjectByName(o),i?(s={index:n,value:e(i,"VALUE"),min:e(i,"MIN"),max:e(i,"MAX")},s.value&&s.min&&s.max?a.axisMeshes[n]=s:warn("Missing axis submesh under mesh with name: "+o+"(VALUE: "+!!s.value+", MIN: "+!!s.min+", MAX:"+!!s.max+")")):warn("Missing axis mesh with name: "+o)):debug("Skipping unknown axis at index: "+n);this.calculateRayOriginFromMesh(r),this.setModelVisibility()}debug("Model load complete.")},calculateRayOriginFromMesh:function(){var t=new THREE.Quaternion;return function(e){var n;if(this.rayOrigin.origin.set(0,0,0),this.rayOrigin.direction.set(0,0,-1),this.rayOrigin.createdFromMesh=!0,n=e.getObjectByName(this.mapping.pointingPoseMeshName)){var o=e.parent;o&&(e.parent=null,e.updateMatrixWorld(!0),e.parent=o),n.getWorldPosition(this.rayOrigin.origin),n.getWorldQuaternion(t),this.rayOrigin.direction.applyQuaternion(t),o&&e.updateMatrixWorld(!0)}else debug("Mesh does not contain pointing origin data, defaulting to none.");this.modelReady()}}(),lerpAxisTransform:function(){var t=new THREE.Quaternion;return function(e,n){var o=this.loadedMeshInfo.axisMeshes[e];if(o){var i=o.min,s=o.max,r=o.value,a=.5*n+.5;r.setRotationFromQuaternion(t.copy(i.quaternion).slerp(s.quaternion,a)),r.position.lerpVectors(i.position,s.position,a)}}}(),lerpButtonTransform:function(){var t=new THREE.Quaternion;return function(e,n){var o=this.loadedMeshInfo.buttonMeshes[e];if(o){var i=o.unpressed,s=o.pressed,r=o.value;r.setRotationFromQuaternion(t.copy(i.quaternion).slerp(s.quaternion,n)),r.position.lerpVectors(i.position,s.position,n)}}}(),modelReady:function(){this.el.emit("controllermodelready",{name:"windows-motion-controls",model:this.data.model,rayOrigin:this.rayOrigin})},onButtonChanged:function(t){var e=this.mapping.buttons[t.detail.id];e&&(this.loadedMeshInfo&&this.loadedMeshInfo.buttonMeshes&&this.lerpButtonTransform(e,t.detail.state.value),this.el.emit(e+"changed",t.detail.state))},onAxisMoved:function(t){var e=this.mapping.axisMeshNames.length;if(this.loadedMeshInfo&&this.loadedMeshInfo.axisMeshes)for(var n=0;n<e;n++)this.lerpAxisTransform(n,t.detail.axis[n]||0);this.emitIfAxesChanged(this,this.mapping.axes,t)},setModelVisibility:function(t){var e=this.el.getObject3D("mesh");t=void 0!==t?t:this.modelVisible,this.modelVisible=t,e&&(e.visible=t)}});
  262. },{"../constants":117,"../core/component":126,"../utils/":196,"../utils/bind":190,"../utils/tracked-controls":201}],116:[function(_dereq_,module,exports){
  263. var TWEEN=_dereq_("@tweenjs/tween.js"),DIRECTIONS={alternate:"alternate",alternateReverse:"alternate-reverse",normal:"normal",reverse:"reverse"},EASING_FUNCTIONS={linear:TWEEN.Easing.Linear.None,ease:TWEEN.Easing.Cubic.InOut,"ease-in":TWEEN.Easing.Cubic.In,"ease-out":TWEEN.Easing.Cubic.Out,"ease-in-out":TWEEN.Easing.Cubic.InOut,"ease-cubic":TWEEN.Easing.Cubic.In,"ease-in-cubic":TWEEN.Easing.Cubic.In,"ease-out-cubic":TWEEN.Easing.Cubic.Out,"ease-in-out-cubic":TWEEN.Easing.Cubic.InOut,"ease-quad":TWEEN.Easing.Quadratic.InOut,"ease-in-quad":TWEEN.Easing.Quadratic.In,"ease-out-quad":TWEEN.Easing.Quadratic.Out,"ease-in-out-quad":TWEEN.Easing.Quadratic.InOut,"ease-quart":TWEEN.Easing.Quartic.InOut,"ease-in-quart":TWEEN.Easing.Quartic.In,"ease-out-quart":TWEEN.Easing.Quartic.Out,"ease-in-out-quart":TWEEN.Easing.Quartic.InOut,"ease-quint":TWEEN.Easing.Quintic.InOut,"ease-in-quint":TWEEN.Easing.Quintic.In,"ease-out-quint":TWEEN.Easing.Quintic.Out,"ease-in-out-quint":TWEEN.Easing.Quintic.InOut,"ease-sine":TWEEN.Easing.Sinusoidal.InOut,"ease-in-sine":TWEEN.Easing.Sinusoidal.In,"ease-out-sine":TWEEN.Easing.Sinusoidal.Out,"ease-in-out-sine":TWEEN.Easing.Sinusoidal.InOut,"ease-expo":TWEEN.Easing.Exponential.InOut,"ease-in-expo":TWEEN.Easing.Exponential.In,"ease-out-expo":TWEEN.Easing.Exponential.Out,"ease-in-out-expo":TWEEN.Easing.Exponential.InOut,"ease-circ":TWEEN.Easing.Circular.InOut,"ease-in-circ":TWEEN.Easing.Circular.In,"ease-out-circ":TWEEN.Easing.Circular.Out,"ease-in-out-circ":TWEEN.Easing.Circular.InOut,"ease-elastic":TWEEN.Easing.Elastic.InOut,"ease-in-elastic":TWEEN.Easing.Elastic.In,"ease-out-elastic":TWEEN.Easing.Elastic.Out,"ease-in-out-elastic":TWEEN.Easing.Elastic.InOut,"ease-back":TWEEN.Easing.Back.InOut,"ease-in-back":TWEEN.Easing.Back.In,"ease-out-back":TWEEN.Easing.Back.Out,"ease-in-out-back":TWEEN.Easing.Back.InOut,"ease-bounce":TWEEN.Easing.Bounce.InOut,"ease-in-bounce":TWEEN.Easing.Bounce.In,"ease-out-bounce":TWEEN.Easing.Bounce.Out,"ease-in-out-bounce":TWEEN.Easing.Bounce.InOut},FILLS={backwards:"backwards",both:"both",forwards:"forwards",none:"none"},REPEATS={indefinite:"indefinite"},DEFAULTS={attribute:"rotation",begin:"",end:"",delay:0,dur:1e3,easing:"ease",direction:DIRECTIONS.normal,fill:FILLS.forwards,from:void 0,repeat:0,to:void 0};module.exports.defaults=DEFAULTS,module.exports.directions=DIRECTIONS,module.exports.easingFunctions=EASING_FUNCTIONS,module.exports.fills=FILLS,module.exports.repeats=REPEATS;
  264. },{"@tweenjs/tween.js":1}],117:[function(_dereq_,module,exports){
  265. module.exports={AFRAME_INJECTED:"aframe-injected",DEFAULT_CAMERA_HEIGHT:1.6,DEFAULT_HANDEDNESS:"right",animation:_dereq_("./animation"),keyboardevent:_dereq_("./keyboardevent")};
  266. },{"./animation":116,"./keyboardevent":118}],118:[function(_dereq_,module,exports){
  267. module.exports={KEYCODE_TO_CODE:{38:"ArrowUp",37:"ArrowLeft",40:"ArrowDown",39:"ArrowRight",87:"KeyW",65:"KeyA",83:"KeyS",68:"KeyD"}};
  268. },{}],119:[function(_dereq_,module,exports){
  269. function cloneValue(t){return utils.extend({},t)}function getAnimationValues(t,e,i,n,a){function o(){var e=m[0],i=m[1],n=t.components[e],a=n&&n.schema;return a&&a[i]&&"color"===a[i].type}function s(){v=m[0],p=m[1],c=t.components[v],c||(t.setAttribute(v,""),c=t.components[v]),h=c.schema,void 0===i?b[e]=getComponentProperty(t,e):b[e]=i,b[e]=parseProperty(b[e],h[p]),g[e]=parseProperty(n,h[p]),f=function(i){e in i&&t.setAttribute(v,p,i[e])}}function r(){b=i?coordinates.parse(i):a,g=coordinates.parse(n),f=function(i){t.setAttribute(e,i)}}function u(){void 0===i?b[e]=!1:b[e]=strToBool(i),b[e]=boolToNum(b[e]),g[e]=boolToNum(strToBool(n)),f=function(i){t.setAttribute(e,!!i[e])}}function l(){b=new THREE.Color(i||t.getAttribute(e)),g=new THREE.Color(n),f=function(i){m.length>1&&t.setAttribute(m[0],m[1],rgbVectorToHex(i)),t.setAttribute(e,rgbVectorToHex(i))}}function d(){void 0===i?b[e]=parseFloat(t.getAttribute(e)):b[e]=parseFloat(i),g[e]=parseFloat(n),f=function(i){t.setAttribute(e,i[e])}}var h,c,p,v,f,m=e.split("."),b={},g={};return 2===m.length?o()?l():s():n&&isCoordinates(n)?r():["true","false"].indexOf(n)!==-1?u():isNaN(n)?l():d(),{from:b,partialSetAttribute:f,to:g}}function strToBool(t){return"true"===t}function boolToNum(t){return t?1:0}function componentToHex(t){var e=t.toString(16);return 1===e.length?"0"+e:e}function convertToIntegerColor(t){return Math.floor(255*Math.min(Math.abs(t),1))}function rgbVectorToHex(t){return"#"+["r","g","b"].map(function(e){return componentToHex(convertToIntegerColor(t[e]))}).join("")}var ANode=_dereq_("./a-node"),animationConstants=_dereq_("../constants/animation"),coordinates=_dereq_("../utils/").coordinates,parseProperty=_dereq_("./schema").parseProperty,registerElement=_dereq_("./a-register-element").registerElement,TWEEN=_dereq_("@tweenjs/tween.js"),THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/"),bind=utils.bind,getComponentProperty=utils.entity.getComponentProperty,DEFAULTS=animationConstants.defaults,DIRECTIONS=animationConstants.directions,EASING_FUNCTIONS=animationConstants.easingFunctions,FILLS=animationConstants.fills,REPEATS=animationConstants.repeats,isCoordinates=coordinates.isCoordinates;module.exports.AAnimation=registerElement("a-animation",{prototype:Object.create(ANode.prototype,{createdCallback:{value:function(){this.bindMethods(),this.isRunning=!1,this.partialSetAttribute=function(){},this.tween=null}},attachedCallback:{value:function(){this.el=this.parentNode,this.handleMixinUpdate(),this.update(),this.load()}},attributeChangedCallback:{value:function(t,e,i){this.hasLoaded&&this.isRunning&&(this.stop(),this.handleMixinUpdate(),this.update())}},detachedCallback:{value:function(){this.isRunning&&this.stop()}},getTween:{value:function(){var t,e,i,n,a=this,o=a.data,s=a.el,r=o.attribute,u=parseInt(o.delay,10),l=getComponentProperty(s,r),d=a.getDirection(o.direction),h=EASING_FUNCTIONS[o.easing],c=o.fill,p=o.repeat===REPEATS.indefinite?1/0:0,v=!1;return t=getAnimationValues(s,r,o.from||a.initialValue,o.to,l),e=t.from,i=t.to,a.partialSetAttribute=t.partialSetAttribute,void 0===a.count&&(a.count=p===1/0?0:parseInt(o.repeat,10)),isNaN(u)&&(u=0),a.initialValue=a.initialValue||cloneValue(l),p===1/0&&c===FILLS.forwards&&[DIRECTIONS.alternate,DIRECTIONS.alternateReverse].indexOf(o.direction)!==-1&&(v=!0),d===DIRECTIONS.reverse&&(n=i,i=cloneValue(e),e=cloneValue(n)),[FILLS.backwards,FILLS.both].indexOf(c)!==-1&&a.partialSetAttribute(e),new TWEEN.Tween(cloneValue(e)).to(i,o.dur).delay(u).easing(h).repeat(p).yoyo(v).onUpdate(function(){a.partialSetAttribute(this)}).onComplete(bind(a.onCompleted,a))}},update:{value:function(){var t=this.data;"infinite"===t.repeat&&console.warn("Using 'infinite' as 'repeat' value is invalid. Use 'indefinite' instead."),""===t.begin||isNaN(t.begin)||(console.warn("Using 'begin' to specify a delay is deprecated. Use 'delay' instead."),t.delay=t.begin,t.begin="");var e=t.begin,i=t.end;this.evt&&this.removeEventListeners(this.evt),this.evt={begin:e,end:i},this.addEventListeners(this.evt),""===e&&(this.stop(),this.start())},writable:window.debug},onCompleted:{value:function(){var t=this.data;return this.isRunning=!1,[FILLS.backwards,FILLS.none].indexOf(t.fill)!==-1&&this.partialSetAttribute(this.initialValue),0===this.count?(this.count=void 0,void this.emit("animationend")):(this.isRunning=!1,this.count--,void this.start())}},start:{value:function(){var t=this;return this.el.hasLoaded?void(!this.isRunning&&this.el.isPlaying&&(this.tween=this.getTween(),this.isRunning=!0,this.tween.start(),this.emit("animationstart"))):void this.el.addEventListener("loaded",function(){t.start()})},writable:!0},stop:{value:function(){var t=this.tween;t&&(t.stop(),this.isRunning=!1,[FILLS.backwards,FILLS.none].indexOf(this.data.fill)!==-1&&this.partialSetAttribute(this.initialValue),this.emit("animationstop"))},writable:!0},getDirection:{value:function(t){return t===DIRECTIONS.alternate?(this.prevDirection=this.prevDirection===DIRECTIONS.normal?DIRECTIONS.reverse:DIRECTIONS.normal,this.prevDirection):t===DIRECTIONS.alternateReverse?(this.prevDirection=this.prevDirection===DIRECTIONS.reverse?DIRECTIONS.normal:DIRECTIONS.reverse,this.prevDirection):t}},bindMethods:{value:function(){this.start=bind(this.start,this),this.stop=bind(this.stop,this),this.onStateAdded=bind(this.onStateAdded,this),this.onStateRemoved=bind(this.onStateRemoved,this)}},addEventListeners:{value:function(t){var e=this.el,i=this;utils.splitString(t.begin).forEach(function(t){e.addEventListener(t,i.start)}),utils.splitString(t.end).forEach(function(t){e.addEventListener(t,i.stop)}),""===t.begin&&e.addEventListener("play",this.start),e.addEventListener("pause",this.stop),e.addEventListener("stateadded",this.onStateAdded),e.addEventListener("stateremoved",this.onStateRemoved)}},removeEventListeners:{value:function(t){var e=this.el,i=this.start,n=this.stop;utils.splitString(t.begin).forEach(function(t){e.removeEventListener(t,i)}),utils.splitString(t.end).forEach(function(t){e.removeEventListener(t,n)}),e.removeEventListener("stateadded",this.onStateAdded),e.removeEventListener("stateremoved",this.onStateRemoved)}},onStateAdded:{value:function(t){t.detail.state===this.data.begin&&this.start()},writable:!0},onStateRemoved:{value:function(t){t.detail.state===this.data.begin&&this.stop()},writable:!0},handleMixinUpdate:{value:function(){var t,e,i,n={};i=document.querySelector("#"+this.getAttribute("mixin")),e=i?utils.getElData(i,DEFAULTS):{},t=utils.getElData(this,DEFAULTS),utils.extend(n,DEFAULTS,e,t),this.data=n}}})}),module.exports.getAnimationValues=getAnimationValues;
  270. },{"../constants/animation":116,"../lib/three":174,"../utils/":196,"./a-node":124,"./a-register-element":125,"./schema":134,"@tweenjs/tween.js":1}],120:[function(_dereq_,module,exports){
  271. function mediaElementLoaded(e){if(e.hasAttribute("autoplay")||"auto"===e.getAttribute("preload"))return new Promise(function(t,r){function i(){for(var r=0,i=0;i<e.buffered.length;i++)r+=e.buffered.end(i)-e.buffered.start(i);r>=e.duration&&(THREE.Cache.files[e.getAttribute("src")]=e,t())}return 4===e.readyState?t():e.error?r():(e.addEventListener("loadeddata",i,!1),e.addEventListener("progress",i,!1),void e.addEventListener("error",r,!1))})}function fixUpMediaElement(e){var t=setCrossOrigin(e);return t.tagName&&"video"===t.tagName.toLowerCase()&&(t.setAttribute("playsinline",""),t.setAttribute("webkit-playsinline","")),t!==e&&(e.parentNode.appendChild(t),e.parentNode.removeChild(e)),t}function setCrossOrigin(e){var t,r;if(e.hasAttribute("crossorigin"))return e;if(r=e.getAttribute("src"),null!==r){if(r.indexOf("://")===-1)return e;if(extractDomain(r)===window.location.host)return e}return warn('Cross-origin element (e.g., <img>) was requested without `crossorigin` set. A-Frame will re-request the asset with `crossorigin` attribute set. Please set `crossorigin` on the element (e.g., <img crossorigin="anonymous">)',r),e.crossOrigin="anonymous",t=e.cloneNode(!0)}function extractDomain(e){var t=e.indexOf("://")>-1?e.split("/")[2]:e.split("/")[0];return t.substring(0,t.indexOf(":"))}function inferResponseType(e){var t=e.lastIndexOf(".");if(t>=0){var r=e.slice(t,e.length);if(".gltf"===r||".glb"===r)return"arraybuffer"}return"text"}var ANode=_dereq_("./a-node"),bind=_dereq_("../utils/bind"),debug=_dereq_("../utils/debug"),registerElement=_dereq_("./a-register-element").registerElement,THREE=_dereq_("../lib/three"),fileLoader=new THREE.FileLoader,warn=debug("core:a-assets:warn");module.exports=registerElement("a-assets",{prototype:Object.create(ANode.prototype,{createdCallback:{value:function(){this.isAssets=!0,this.fileLoader=fileLoader,this.timeout=null}},attachedCallback:{value:function(){var e,t,r,i,s,o,n=this,a=[];if(!this.parentNode.isScene)throw new Error("<a-assets> must be a child of a <a-scene>.");for(s=this.querySelectorAll("img"),e=0;e<s.length;e++)i=fixUpMediaElement(s[e]),a.push(new Promise(function(t,r){THREE.Cache.files[s[e].getAttribute("src")]=i,i.onload=t,i.onerror=r}));for(r=this.querySelectorAll("audio, video"),e=0;e<r.length;e++)t=fixUpMediaElement(r[e]),t.src||t.srcObject||warn("Audio/video asset has neither `src` nor `srcObject` attributes."),a.push(mediaElementLoaded(t));Promise.all(a).then(bind(this.load,this)),o=parseInt(this.getAttribute("timeout"),10)||3e3,this.timeout=setTimeout(function(){n.hasLoaded||(warn("Asset loading timed out in ",o,"ms"),n.emit("timeout"),n.load())},o)}},detachedCallback:{value:function(){this.timeout&&clearTimeout(this.timeout)}},load:{value:function(){ANode.prototype.load.call(this,null,function(e){return e.isAssetItem&&e.hasAttribute("src")})}}})}),registerElement("a-asset-item",{prototype:Object.create(ANode.prototype,{createdCallback:{value:function(){this.data=null,this.isAssetItem=!0}},attachedCallback:{value:function(){var e=this,t=this.getAttribute("src");fileLoader.setResponseType(this.getAttribute("response-type")||inferResponseType(t)),fileLoader.load(t,function(t){e.data=t,setTimeout(function(){ANode.prototype.load.call(e)})},function(t){e.emit("progress",{loadedBytes:t.loaded,totalBytes:t.total,xhr:t})},function(t){e.emit("error",{xhr:t})})}}})}),module.exports.inferResponseType=inferResponseType;
  272. },{"../lib/three":174,"../utils/bind":190,"../utils/debug":192,"./a-node":124,"./a-register-element":125}],121:[function(_dereq_,module,exports){
  273. var debug=_dereq_("../utils/debug"),registerElement=_dereq_("./a-register-element").registerElement,warn=debug("core:cubemap:warn");module.exports=registerElement("a-cubemap",{prototype:Object.create(window.HTMLElement.prototype,{attachedCallback:{value:function(){this.srcs=this.validate()},writable:window.debug},validate:{value:function(){var e,t=this.querySelectorAll("[src]"),r=[];if(6===t.length){for(e=0;e<t.length;e++)r.push(t[e].getAttribute("src"));return r}warn("<a-cubemap> did not contain exactly six elements each with a `src` attribute.")},writable:window.debug}})});
  274. },{"../utils/debug":192,"./a-register-element":125}],122:[function(_dereq_,module,exports){
  275. function checkComponentDefined(t,e){return void 0!==t.defaultComponents[e]||(!(!t.components[e]||!t.components[e].attrValue)||isComponentMixedIn(e,t.mixinEls))}function isComponentMixedIn(t,e){var i,n=!1;for(i=0;i<e.length&&!(n=e[i].hasAttribute(t));++i);return n}function mergeComponentData(t,e){return e?e.constructor===Object?utils.extend(e,utils.styleParser.parse(t||{})):t||e:t}function isComponent(t){return t.indexOf(MULTIPLE_COMPONENT_DELIMITER)!==-1&&(t=utils.split(t,MULTIPLE_COMPONENT_DELIMITER)[0]),!!COMPONENTS[t]}function getRotation(t){var e=THREE.Math.radToDeg,i=t.object3D.rotation,n=t.rotationObj;return n.x=e(i.x),n.y=e(i.y),n.z=e(i.z),n}var ANode=_dereq_("./a-node"),COMPONENTS=_dereq_("./component").components,registerElement=_dereq_("./a-register-element").registerElement,THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/"),AEntity,debug=utils.debug("core:a-entity:debug"),warn=utils.debug("core:a-entity:warn"),MULTIPLE_COMPONENT_DELIMITER="__",proto=Object.create(ANode.prototype,{defaultComponents:{value:{position:"",rotation:"",scale:"",visible:""}},createdCallback:{value:function(){this.components={},this.initializingComponents={},this.componentsToUpdate={},this.isEntity=!0,this.isPlaying=!1,this.object3D=new THREE.Group,this.object3D.el=this,this.object3DMap={},this.parentEl=null,this.rotationObj={},this.states=[]}},attributeChangedCallback:{value:function(t,e,i){var n=this.components[t];return n&&n.justInitialized&&""===i?void delete n.justInitialized:void((n||null!==i)&&this.setEntityAttribute(t,e,i))}},attachedCallback:{value:function(){var t,e=this.sceneEl,i=this;if(this.addToParent(),!this.isScene)return e?(t=e.querySelector("a-assets"),t&&!t.hasLoaded?void t.addEventListener("loaded",function(){i.load()}):void this.load()):void this.load()}},detachedCallback:{value:function(){var t;if(this.parentEl){for(t in this.components)this.removeComponent(t);this.isScene||(this.removeFromParent(),ANode.prototype.detachedCallback.call(this),this.object3D.el=null)}}},handleMixinUpdate:{value:function(t){return t?void this.updateComponent(t,this.getDOMAttribute(t)):void this.updateComponents()}},getObject3D:{value:function(t){return this.object3DMap[t]}},setObject3D:{value:function(t,e){var i,n=this;if(!(e instanceof THREE.Object3D))throw new Error("`Entity.setObject3D` was called with an object that was not an instance of THREE.Object3D.");i=this.getObject3D(t),i&&this.object3D.remove(i),e.el=this,e.children.length&&e.traverse(function(t){t.el=n}),this.object3D.add(e),this.object3DMap[t]=e,this.emit("object3dset",{object:e,type:t})}},removeObject3D:{value:function(t){var e=this.getObject3D(t);return e?(this.object3D.remove(e),delete this.object3DMap[t],void this.emit("object3dremove",{type:t})):void warn("Tried to remove `Object3D` of type:",t,"which was not defined.")}},getOrCreateObject3D:{value:function(t,e){var i=this.getObject3D(t);return!i&&e&&(i=new e,this.setObject3D(t,i)),warn("`getOrCreateObject3D` has been deprecated. Use `setObject3D()` and `object3dset` event instead."),i}},add:{value:function(t){if(!t.object3D)throw new Error("Trying to add an element that doesn't have an `object3D`");this.object3D.add(t.object3D),this.emit("child-attached",{el:t})}},addToParent:{value:function(){var t=this.parentEl=this.parentNode;t&&t.add&&!this.attachedToParent&&(t.add(this),this.attachedToParent=!0)}},removeFromParent:{value:function(){var t=this.parentEl;this.parentEl.remove(this),this.attachedToParent=!1,this.parentEl=this.parentNode=null,t.emit("child-detached",{el:this})}},load:{value:function(){var t=this;!this.hasLoaded&&this.parentEl&&ANode.prototype.load.call(this,function(){t.parentEl&&(t.updateComponents(),(t.isScene||t.parentEl.isPlaying)&&t.play())})},writable:window.debug},remove:{value:function(t){this.object3D.remove(t.object3D)}},getChildEntities:{value:function(){for(var t=this.children,e=[],i=0;i<t.length;i++){var n=t[i];n instanceof AEntity&&e.push(n)}return e}},initComponent:{value:function(t,e,i){var n,o,s,a,r;if(s=utils.split(t,MULTIPLE_COMPONENT_DELIMITER),o=s[1],a=s[0],COMPONENTS[a]&&(r=checkComponentDefined(this,t)||void 0!==e,(r||i)&&!(t in this.components))){if(this.initComponentDependencies(a),o&&!COMPONENTS[a].multiple)throw new Error("Trying to initialize multiple components of type `"+a+"`. There can only be one component of this type per entity.");n=new COMPONENTS[a].Component(this,e,o),this.isPlaying&&n.play(),this.hasAttribute(t)||(n.justInitialized=!0,window.HTMLElement.prototype.setAttribute.call(this,t,"")),debug("Component initialized: %s",t)}},writable:window.debug},initComponentDependencies:{value:function(t){var e,i,n=this,o=COMPONENTS[t];if(o&&(e=COMPONENTS[t].dependencies))for(i=0;i<e.length;i++)n.initComponent(e[i],window.HTMLElement.prototype.getAttribute.call(n,e[i])||void 0,!0)}},removeComponent:{value:function(t){var e,i;if(i=t in this.defaultComponents,!i&&(e=this.components[t])){if(!e.initialized)return void this.addEventListener("componentinitialized",function e(i){i.detail.name===t&&(this.removeComponent(t),this.removeEventListener("componentinitialized",e))});e.pause(),e.remove(),delete this.components[t],this.emit("componentremoved",e.evtDetail)}},writable:window.debug},updateComponents:{value:function(){var t,e,i,n,o=this.componentsToUpdate;if(this.hasLoaded){for(i=0;i<this.mixinEls.length;i++)for(n in this.mixinEls[i].componentCache)isComponent(n)&&(o[n]=!0);if(this.getExtraComponents){e=this.getExtraComponents();for(n in e)isComponent(n)&&(o[n]=!0)}for(i=0;i<this.attributes.length;++i)n=this.attributes[i].name,isComponent(n)&&(o[n]=!0);for(n in this.defaultComponents)t=mergeComponentData(this.getDOMAttribute(n),e&&e[n]),this.updateComponent(n,t),delete o[n];for(n in o)t=mergeComponentData(this.getDOMAttribute(n),e&&e[n]),this.updateComponent(n,t),delete o[n]}},writable:window.debug},updateComponent:{value:function(t,e,i){var n=this.components[t],o=t in this.defaultComponents;return n?null!==e||o?void n.updateProperties(e,i):void this.removeComponent(t):void this.initComponent(t,e,!1)}},removeAttribute:{value:function(t,e){var i=this.components[t];if(!i||void 0!==e||(this.removeComponent(t),!this.components[t])){if(i&&void 0!==e)return void i.resetProperty(e);"mixin"===t&&this.mixinUpdate(""),window.HTMLElement.prototype.removeAttribute.call(this,t)}}},play:{value:function(){var t,e,i;if(!this.isPlaying&&this.hasLoaded){this.isPlaying=!0;for(i in this.components)this.components[i].play();for(t=this.getChildEntities(),e=0;e<t.length;e++)t[e].play();this.emit("play")}},writable:!0},pause:{value:function(){var t,e,i;if(this.isPlaying){this.isPlaying=!1;for(i in this.components)this.components[i].pause();for(t=this.getChildEntities(),e=0;e<t.length;e++)t[e].pause();this.emit("pause")}},writable:!0},setEntityAttribute:{value:function(t,e,i){if(COMPONENTS[t]||this.components[t])return void this.updateComponent(t,i);if("mixin"===t){if(i===this.computedMixinStr)return;this.mixinUpdate(i,e)}}},mixinUpdate:{value:function(t,e){e=e||this.getAttribute("mixin"),this.updateMixins(t,e),this.updateComponents()}},setAttribute:{value:function(t,e,i){var n,o,s,a,r;return a=t.indexOf(MULTIPLE_COMPONENT_DELIMITER),s=a>0?t.substring(0,a):t,COMPONENTS[s]?(!this.components[t]&&this.hasAttribute(t)&&this.updateComponent(t,window.HTMLElement.prototype.getAttribute.call(this,t)),"undefined"!=typeof i&&"string"==typeof e&&e.length>0&&"string"==typeof utils.styleParser.parse(e)?(n={},n[e]=i,o=!1):(n=e,o=i===!0),this.updateComponent(t,n,o),r=this.sceneEl&&this.sceneEl.getAttribute("debug"),void(r&&this.components[t].flushToDOM())):("mixin"===t&&this.mixinUpdate(e),void ANode.prototype.setAttribute.call(this,t,e))},writable:window.debug},flushToDOM:{value:function(t){var e,i,n,o=this.components,s=this.defaultComponents,a=this.children;for(n in o)o[n].flushToDOM(n in s);if(t)for(i=0;i<a.length;++i)e=a[i],e.flushToDOM&&e.flushToDOM(t)}},getAttribute:{value:function(t){var e;return"position"===t?this.object3D.position:"rotation"===t?getRotation(this):"scale"===t?this.object3D.scale:"visible"===t?this.object3D.visible:(e=this.components[t],e?e.data:window.HTMLElement.prototype.getAttribute.call(this,t))},writable:window.debug},getComputedAttribute:{value:function(t){return warn("`getComputedAttribute` is deprecated. Use `getAttribute` instead."),this.getAttribute(t)}},getDOMAttribute:{value:function(t){var e=this.components[t];return e?e.attrValue:window.HTMLElement.prototype.getAttribute.call(this,t)},writable:window.debug},addState:{value:function(t){this.is(t)||(this.states.push(t),this.emit("stateadded",t))}},removeState:{value:function(t){var e=this.states.indexOf(t);e!==-1&&(this.states.splice(e,1),this.emit("stateremoved",t))}},is:{value:function(t){return this.states.indexOf(t)!==-1}}});AEntity=registerElement("a-entity",{prototype:proto}),module.exports=AEntity;
  276. },{"../lib/three":174,"../utils/":196,"./a-node":124,"./a-register-element":125,"./component":126}],123:[function(_dereq_,module,exports){
  277. var ANode=_dereq_("./a-node"),registerElement=_dereq_("./a-register-element").registerElement,components=_dereq_("./component").components,utils=_dereq_("../utils"),MULTIPLE_COMPONENT_DELIMITER="__";module.exports=registerElement("a-mixin",{prototype:Object.create(ANode.prototype,{createdCallback:{value:function(){this.componentCache={},this.id=this.getAttribute("id"),this.isMixin=!0}},attributeChangedCallback:{value:function(t,e,i){this.cacheAttribute(t,i)}},attachedCallback:{value:function(){this.sceneEl=this.closestScene(),this.cacheAttributes(),this.updateEntities(),this.load()}},setAttribute:{value:function(t,e){window.HTMLElement.prototype.setAttribute.call(this,t,e),this.cacheAttribute(t,e)}},cacheAttribute:{value:function(t,e){var i,n;n=utils.split(t,MULTIPLE_COMPONENT_DELIMITER)[0],i=components[n],i&&(void 0===e&&(e=window.HTMLElement.prototype.getAttribute.call(this,t)),this.componentCache[t]=i.parseAttrValueForCache(e))}},getAttribute:{value:function(t){return this.componentCache[t]||window.HTMLElement.prototype.getAttribute.call(this,t)}},cacheAttributes:{value:function(){var t,e,i=this.attributes;for(e=0;e<i.length;e++)t=i[e].name,this.cacheAttribute(t)}},updateEntities:{value:function(){var t,e,i;if(this.sceneEl)for(e=this.sceneEl.querySelectorAll("[mixin~="+this.id+"]"),i=0;i<e.length;i++)t=e[i],t.hasLoaded&&!t.isMixin&&t.mixinUpdate(this.id)}}})});
  278. },{"../utils":196,"./a-node":124,"./a-register-element":125,"./component":126}],124:[function(_dereq_,module,exports){
  279. var registerElement=_dereq_("./a-register-element").registerElement,isNode=_dereq_("./a-register-element").isNode,utils=_dereq_("../utils/"),warn=utils.debug("core:a-node:warn"),MIXIN_OBSERVER_CONFIG={attributes:!0};module.exports=registerElement("a-node",{prototype:Object.create(window.HTMLElement.prototype,{createdCallback:{value:function(){this.computedMixinStr="",this.hasLoaded=!1,this.isNode=!0,this.mixinEls=[],this.mixinObservers={}},writable:window.debug},attachedCallback:{value:function(){var e;this.sceneEl=this.closestScene(),this.sceneEl||warn("You are attempting to attach <"+this.tagName+"> outside of an A-Frame scene. Append this element to `<a-scene>` instead."),this.hasLoaded=!1,this.emit("nodeready",void 0,!1),this.isMixin||(e=this.getAttribute("mixin"),e&&this.updateMixins(e))},writable:window.debug},attributeChangedCallback:{value:function(e,t,i){i!==this.computedMixinStr&&("mixin"!==e||this.isMixin||this.updateMixins(i,t))}},closestScene:{value:function(){for(var e=this;e&&!e.isScene;)e=e.parentElement;return e}},closest:{value:function(e){for(var t=this.matches||this.mozMatchesSelector||this.msMatchesSelector||this.oMatchesSelector||this.webkitMatchesSelector,i=this;i&&!t.call(i,e);)i=i.parentElement;return i}},detachedCallback:{value:function(){this.hasLoaded=!1}},load:{value:function(e,t){var i,n,s=this;this.hasLoaded||(t=t||isNode,i=this.getChildren(),n=i.filter(t).map(function(e){return new Promise(function(t){return e.hasLoaded?t():void e.addEventListener("loaded",t)})}),Promise.all(n).then(function(){s.hasLoaded=!0,e&&e(),s.emit("loaded",void 0,!1)}))},writable:!0},getChildren:{value:function(){return Array.prototype.slice.call(this.children,0)}},updateMixins:{value:function(){var e=[],t=[];return function(i,n){var s,r,a;for(e.length=0,t.length=0,r=i?utils.split(i.trim(),/\s+/):e,a=n?utils.split(n.trim(),/\s+/):t,s=0;s<a.length;s++)r.indexOf(a[s])===-1&&this.unregisterMixin(a[s]);for(this.computedMixinStr="",this.mixinEls.length=0,s=0;s<r.length;s++)this.registerMixin(document.getElementById(r[s]));this.computedMixinStr&&(this.computedMixinStr=this.computedMixinStr.trim(),window.HTMLElement.prototype.setAttribute.call(this,"mixin",this.computedMixinStr))}}()},registerMixin:{value:function(e){var t,i,n;if(e){if(n=e.getAttribute("mixin"))for(t=utils.split(n.trim(),/\s+/),i=0;i<t.length;i++)this.registerMixin(document.getElementById(t[i]));this.computedMixinStr=this.computedMixinStr+" "+e.id,this.mixinEls.push(e),this.attachMixinListener(e)}}},setAttribute:{value:function(e,t){"mixin"===e&&this.updateMixins(t),window.HTMLElement.prototype.setAttribute.call(this,e,t)}},unregisterMixin:{value:function(e){var t,i,n=this.mixinEls;for(t=0;t<n.length;++t)if(i=n[t],e===i.id){n.splice(t,1);break}this.removeMixinListener(e)}},removeMixinListener:{value:function(e){var t=this.mixinObservers[e];t&&(t.disconnect(),this.mixinObservers[e]=null)}},attachMixinListener:{value:function(e){var t,i,n,s=this;e&&(i=e.id,t=this.mixinObservers[i],t||(n=new MutationObserver(function(e){s.handleMixinUpdate(e[0].attributeName)}),n.observe(e,MIXIN_OBSERVER_CONFIG),this.mixinObservers[i]=n))}},handleMixinUpdate:{value:function(){}},emit:{value:function(){var e={};return function(t,i,n,s){void 0===n&&(n=!0),e.bubbles=!!n,e.detail=i,s&&(e=utils.extend({},s,e)),this.dispatchEvent(new CustomEvent(t,e))}}(),writable:window.debug}})});
  280. },{"../utils/":196,"./a-register-element":125}],125:[function(_dereq_,module,exports){
  281. /*
  282. ------------------------------------------------------------
  283. ------------- WARNING WARNING WARNING WARNING --------------
  284. ------------------------------------------------------------
  285. This module wraps registerElement to deal with components that inherit from
  286. `ANode` and `AEntity`. It's a pass through in any other case.
  287. It wraps some of the prototype methods of the created element to make sure
  288. that the corresponding functions in the base prototypes (`AEntity` and `ANode`)
  289. are also invoked. The method in the base prototype is always called before the one
  290. in the derived prototype.
  291. */
  292. // Polyfill `document.registerElement`.
  293. _dereq_('document-register-element');
  294. var ANode; // Must declare before AEntity. Initialized at the bottom.
  295. var AEntity;
  296. var knownTags = module.exports.knownTags = {};
  297. function addTagName (tagName) {
  298. knownTags[tagName.toLowerCase()] = true;
  299. }
  300. /**
  301. * Return whether the element type is one of our known registered ones.
  302. *
  303. * @param {string} node - The name of the tag to register.
  304. * @returns {boolean} Whether the tag name matches that of our registered custom elements.
  305. */
  306. module.exports.isNode = function (node) {
  307. return node.tagName.toLowerCase() in knownTags || node.isNode;
  308. };
  309. /**
  310. * @param {string} tagName - The name of the tag to register.
  311. * @param {object} obj - The prototype of the new element.
  312. * @returns {object} The prototype of the new element.
  313. */
  314. module.exports.registerElement = function (tagName, obj) {
  315. var proto = Object.getPrototypeOf(obj.prototype);
  316. var newObj = obj;
  317. var isANode = ANode && proto === ANode.prototype;
  318. var isAEntity = AEntity && proto === AEntity.prototype;
  319. if (isANode || isAEntity) { addTagName(tagName); }
  320. // Wrap if element inherits from `ANode`.
  321. if (isANode) {
  322. newObj = wrapANodeMethods(obj.prototype);
  323. newObj = {prototype: Object.create(proto, newObj)};
  324. }
  325. // Wrap if element inherits from `AEntity`.
  326. if (isAEntity) {
  327. newObj = wrapAEntityMethods(obj.prototype);
  328. newObj = {prototype: Object.create(proto, newObj)};
  329. }
  330. // Give all functions their proper name.
  331. for (var propName of Object.getOwnPropertyNames(newObj.prototype)) {
  332. var propVal = newObj.prototype[propName];
  333. if (typeof propVal === 'function') {
  334. propVal.displayName = propName;
  335. }
  336. }
  337. return document.registerElement(tagName, newObj);
  338. };
  339. /**
  340. * Wrap some obj methods to call those on `ANode` base prototype.
  341. *
  342. * @param {object} obj - Object that contains the methods that will be wrapped.
  343. * @return {object} An object with the same properties as the input parameter but
  344. * with some of methods wrapped.
  345. */
  346. function wrapANodeMethods (obj) {
  347. var newObj = {};
  348. var ANodeMethods = [
  349. 'attachedCallback',
  350. 'attributeChangedCallback',
  351. 'createdCallback'
  352. ];
  353. wrapMethods(newObj, ANodeMethods, obj, ANode.prototype);
  354. copyProperties(obj, newObj);
  355. return newObj;
  356. }
  357. /**
  358. * This wraps some of the obj methods to call those on `AEntity` base prototype.
  359. *
  360. * @param {object} obj - The objects that contains the methods that will be wrapped.
  361. * @return {object} - An object with the same properties as the input parameter but
  362. * with some of methods wrapped.
  363. */
  364. function wrapAEntityMethods (obj) {
  365. var newObj = {};
  366. var ANodeMethods = [
  367. 'attachedCallback',
  368. 'attributeChangedCallback',
  369. 'createdCallback'
  370. ];
  371. var AEntityMethods = [
  372. 'attachedCallback',
  373. 'attributeChangedCallback',
  374. 'createdCallback',
  375. 'detachedCallback'
  376. ];
  377. wrapMethods(newObj, ANodeMethods, obj, ANode.prototype);
  378. wrapMethods(newObj, AEntityMethods, obj, AEntity.prototype);
  379. // Copies the remaining properties into the new object.
  380. copyProperties(obj, newObj);
  381. return newObj;
  382. }
  383. /**
  384. * Wrap a list a methods to ensure that those in the base prototype are called
  385. * before the derived one.
  386. *
  387. * @param {object} targetObj - Object that will contain the wrapped methods.
  388. * @param {array} methodList - List of methods from the derivedObj that will be wrapped.
  389. * @param {object} derivedObject - Object that inherits from the baseObj.
  390. * @param {object} baseObj - Object that derivedObj inherits from.
  391. */
  392. function wrapMethods (targetObj, methodList, derivedObj, baseObj) {
  393. methodList.forEach(function (methodName) {
  394. wrapMethod(targetObj, methodName, derivedObj, baseObj);
  395. });
  396. }
  397. module.exports.wrapMethods = wrapMethods;
  398. /**
  399. * Wrap one method to ensure that the one in the base prototype is called before
  400. * the one in the derived one.
  401. *
  402. * @param {object} obj - Object that will contain the wrapped method.
  403. * @param {string} methodName - The name of the method that will be wrapped.
  404. * @param {object} derivedObject - Object that inherits from the baseObj.
  405. * @param {object} baseObj - Object that derivedObj inherits from.
  406. */
  407. function wrapMethod (obj, methodName, derivedObj, baseObj) {
  408. var derivedMethod = derivedObj[methodName];
  409. var baseMethod = baseObj[methodName];
  410. // Derived prototype does not define method, no need to wrap.
  411. if (!derivedMethod || !baseMethod) { return; }
  412. // Derived prototype doesn't override the one in the base one, no need to wrap.
  413. if (derivedMethod === baseMethod) { return; }
  414. // Wrap to ensure the base method is called before the one in the derived prototype.
  415. obj[methodName] = {
  416. value: function wrappedMethod () {
  417. baseMethod.apply(this, arguments);
  418. return derivedMethod.apply(this, arguments);
  419. },
  420. writable: window.debug
  421. };
  422. }
  423. /**
  424. * It copies the properties from source to destination object if they don't
  425. * exist already.
  426. *
  427. * @param {object} source - The object where properties are copied from.
  428. * @param {type} destination - The object where properties are copied to.
  429. */
  430. function copyProperties (source, destination) {
  431. var props = Object.getOwnPropertyNames(source);
  432. props.forEach(function (prop) {
  433. var desc;
  434. if (!destination[prop]) {
  435. desc = Object.getOwnPropertyDescriptor(source, prop);
  436. destination[prop] = {value: source[prop], writable: desc.writable};
  437. }
  438. });
  439. }
  440. ANode = _dereq_('./a-node');
  441. AEntity = _dereq_('./a-entity');
  442. },{"./a-entity":122,"./a-node":124,"document-register-element":11}],126:[function(_dereq_,module,exports){
  443. function cloneData(e){var t,i,r={};for(i in e)t=e[i],r[i]=isObjectOrArray(t)?utils.clone(t):t;return r}function extendProperties(e,t,i){return!i||null!==t&&"object"==typeof t?utils.extend(e,t):t}function hasBehavior(e){return e.tick||e.tock}function wrapPause(e){return function(){var t=this.el.sceneEl;this.isPlaying&&(e.call(this),this.isPlaying=!1,hasBehavior(this)&&t.removeBehavior(this))}}function wrapPlay(e){return function(){var t=this.el.sceneEl,i=this.el.isPlaying&&!this.isPlaying;this.initialized&&i&&(e.call(this),this.isPlaying=!0,hasBehavior(this)&&t.addBehavior(this))}}function isObjectOrArray(e){return e&&(e.constructor===Object||e.constructor===Array)}var schema=_dereq_("./schema"),scenes=_dereq_("./scene/scenes"),systems=_dereq_("./system"),utils=_dereq_("../utils/"),components=module.exports.components={},parseProperties=schema.parseProperties,parseProperty=schema.parseProperty,processSchema=schema.process,isSingleProp=schema.isSingleProperty,stringifyProperties=schema.stringifyProperties,stringifyProperty=schema.stringifyProperty,styleParser=utils.styleParser,warn=utils.debug("core:component:warn"),aframeScript=document.currentScript,upperCaseRegExp=new RegExp("[A-Z]+"),Component=module.exports.Component=function(e,t,i){var r=this;this.el=e,this.id=i,this.attrName=this.name+(i?"__"+i:""),this.evtDetail={id:this.id,name:this.name},this.initialized=!1,this.el.components[this.attrName]=this,this.oldData=void 0,this.previousAttrValue=void 0,this.throttledEmitComponentChanged=utils.throttle(function(){e.emit("componentchanged",r.evtDetail,!1)},200),this.updateProperties(t)};if(Component.prototype={schema:{},init:function(){},update:function(e){},updateSchema:void 0,tick:void 0,tock:void 0,play:function(){},pause:function(){},remove:function(){},parse:function(e,t){var i=this.schema;return isSingleProp(i)?parseProperty(e,i):parseProperties(styleParser.parse(e),i,!0,this.name,t)},stringify:function(e){var t=this.schema;return"string"==typeof e?e:isSingleProp(t)?stringifyProperty(e,t):(e=stringifyProperties(e,t),styleParser.stringify(e))},updateCachedAttrValue:function(e,t){var i,r=this.parseAttrValueForCache(e),s=isSingleProp(this.schema);if(void 0!==e)if(s||t)this.attrValue=r;else{this.attrValue=this.attrValue?cloneData(this.attrValue):{};for(i in r)this.attrValue[i]=r[i]}},parseAttrValueForCache:function(e){var t;return"string"!=typeof e?e:(isSingleProp(this.schema)?(t=this.schema.parse(e),"string"==typeof t&&(t=e)):t=styleParser.parse(e),t)},flushToDOM:function(e){var t=e?this.data:this.attrValue;t&&window.HTMLElement.prototype.setAttribute.call(this.el,this.attrName,this.stringify(t))},updateProperties:function(e,t){var i,r,s,a=this.el,o=this.oldData;if(!a.hasLoaded)return void this.updateCachedAttrValue(e);if(i=isSingleProp(this.schema),s=null!==e&&"object"==typeof this.previousAttrValue&&e===this.previousAttrValue){for(r in this.attrValue)if(!(r in e)){s=!1;break}for(r in e)if(!(r in this.attrValue)){s=!1;break}}if(this.previousAttrValue=e,e=this.parseAttrValueForCache(e),this.updateCachedAttrValue(e,t),this.updateSchema&&this.updateSchema(this.buildData(this.attrValue,!1,!0)),this.data=this.buildData(this.attrValue,t,!1,s),this.initialized){if(utils.deepEqual(this.oldData,this.data))return;this.oldData=extendProperties({},this.data,i),this.update(o),this.throttledEmitComponentChanged()}else{if(a.initializingComponents[this.name])return;a.initializingComponents[this.name]=!0,this.init(),this.initialized=!0,delete a.initializingComponents[this.name],o=i&&"object"!=typeof parseProperty(void 0,this.schema)?void 0:{},this.oldData=extendProperties({},this.data,i),this.update(o),a.isPlaying&&this.play(),a.emit("componentinitialized",this.evtDetail,!1)}},resetProperty:function(e){if(isSingleProp(this.schema))this.attrValue=void 0;else{if(!(e in this.attrValue))return;delete this.attrValue[e]}this.updateProperties(this.attrValue)},extendSchema:function(e){var t=utils.extend({},components[this.name].schema);utils.extend(t,e),this.schema=processSchema(t),this.el.emit("schemachanged",{component:this.name})},buildData:function(e,t,i,r){var s,a,o,n,p,h,c,l,u=this.schema,m=isSingleProp(u),d=this.el.mixinEls;if(s=e&&e.constructor===Array?e.length:void 0!==e&&null!==e,m)a=isObjectOrArray(u.default)?utils.clone(u.default):u.default;else for(l=!t&&this.attrValue,a="object"==typeof l?cloneData(l):{},c=0,n=Object.keys(u),p=n.length;c<p;c++)o=u[n[c]].default,void 0===a[n[c]]&&(a[n[c]]=isObjectOrArray(o)?utils.clone(o):o);for(c=0;c<d.length;c++)h=d[c].getAttribute(this.attrName),h&&(a=extendProperties(a,h,m));if(s){if(m)return r===!0?e:parseProperty(e,u);a=extendProperties(a,e,m)}else{if(r===!0)return a;if(m)return parseProperty(a,u)}return r===!0?a:parseProperties(a,u,void 0,this.name,i)}},window.debug)var registrationOrderWarnings=module.exports.registrationOrderWarnings={};module.exports.registerComponent=function(e,t){var i,r={};if(document.currentScript&&document.currentScript!==aframeScript&&scenes.forEach(function(t){t.hasLoaded||document.currentScript.compareDocumentPosition(t)!==Node.DOCUMENT_POSITION_FOLLOWING&&(warn("The component `"+e+"` was registered in a <script> tag after the scene. Component <script> tags in an HTML file should be declared *before* the scene such that the component is available to entities during scene initialization."),window.debug&&(registrationOrderWarnings[e]=!0))}),upperCaseRegExp.test(e)===!0&&warn("The component name `"+e+"` contains uppercase characters, but HTML will ignore the capitalization of attribute names. Change the name to be lowercase: `"+e.toLowerCase()+"`"),e.indexOf("__")!==-1)throw new Error("The component name `"+e+"` is not allowed. The sequence __ (double underscore) is reserved to specify an id for multiple components of the same type");if(Object.keys(t).forEach(function(e){r[e]={value:t[e],writable:!0}}),components[e])throw new Error("The component `"+e+"` has been already registered. Check that you are not loading two versions of the same component or two different components of the same name.");return i=function(e,t,i){Component.call(this,e,t,i)},i.prototype=Object.create(Component.prototype,r),i.prototype.name=e,i.prototype.constructor=i,i.prototype.system=systems&&systems.systems[e],i.prototype.play=wrapPlay(i.prototype.play),i.prototype.pause=wrapPause(i.prototype.pause),components[e]={Component:i,dependencies:i.prototype.dependencies,isSingleProp:isSingleProp(i.prototype.schema),multiple:i.prototype.multiple,parse:i.prototype.parse,parseAttrValueForCache:i.prototype.parseAttrValueForCache,schema:utils.extend(processSchema(i.prototype.schema,i.prototype.name)),stringify:i.prototype.stringify,type:i.prototype.type},i};
  444. },{"../utils/":196,"./scene/scenes":132,"./schema":134,"./system":136}],127:[function(_dereq_,module,exports){
  445. var schema=_dereq_("./schema"),processSchema=schema.process,geometries=module.exports.geometries={},geometryNames=module.exports.geometryNames=[],THREE=_dereq_("../lib/three"),Geometry=module.exports.Geometry=function(){};Geometry.prototype={schema:{},init:function(e){return this.geometry=new THREE.Geometry,this.geometry},update:function(e){}},module.exports.registerGeometry=function(e,t){var r,o={};if(Object.keys(t).forEach(function(e){o[e]={value:t[e],writable:!0}}),geometries[e])throw new Error("The geometry `"+e+"` has been already registered");return r=function(){Geometry.call(this)},r.prototype=Object.create(Geometry.prototype,o),r.prototype.name=e,r.prototype.constructor=r,geometries[e]={Geometry:r,schema:processSchema(r.prototype.schema)},geometryNames.push(e),r};
  446. },{"../lib/three":174,"./schema":134}],128:[function(_dereq_,module,exports){
  447. function registerPropertyType(e,r,t,n){return"type"in propertyTypes?void error("Property type "+e+" is already registered."):void(propertyTypes[e]={default:r,parse:t||defaultParse,stringify:n||defaultStringify})}function arrayParse(e){function r(e){return e.trim()}return Array.isArray(e)?e:e&&"string"==typeof e?e.split(",").map(r):[]}function arrayStringify(e){return e.join(", ")}function assetParse(e){var r,t;return"string"!=typeof e?e:(t=e.match(/\url\((.+)\)/),t?t[1]:"#"===e.charAt(0)?(r=document.getElementById(e.substring(1)))?"CANVAS"===r.tagName||"VIDEO"===r.tagName||"IMG"===r.tagName?r:r.getAttribute("src"):void warn('"'+e+'" asset not found.'):e)}function defaultParse(e){return e}function defaultStringify(e){return null===e?"null":e.toString()}function boolParse(e){return"false"!==e&&e!==!1}function intParse(e){return parseInt(e,10)}function numberParse(e){return parseFloat(e,10)}function selectorParse(e){return e?"string"!=typeof e?e:"#"!==e[0]||nonCharRegex.test(e)?document.querySelector(e):document.getElementById(e.substring(1)):null}function selectorAllParse(e){return e?"string"!=typeof e?e:Array.prototype.slice.call(document.querySelectorAll(e),0):null}function selectorStringify(e){return e.getAttribute?"#"+e.getAttribute("id"):defaultStringify(e)}function selectorAllStringify(e){return e instanceof Array?e.map(function(e){return"#"+e.getAttribute("id")}).join(", "):defaultStringify(e)}function srcParse(e){return warn("`src` property type is deprecated. Use `asset` instead."),assetParse(e)}function vecParse(e){return coordinates.parse(e,this.default)}function isValidDefaultValue(e,r){return("audio"!==e||"string"==typeof r)&&(!("array"===e&&!Array.isArray(r))&&(("asset"!==e||"string"==typeof r)&&(("boolean"!==e||"boolean"==typeof r)&&(("color"!==e||"string"==typeof r)&&(("int"!==e||"number"==typeof r)&&(("number"!==e||"number"==typeof r)&&(("map"!==e||"string"==typeof r)&&(("model"!==e||"string"==typeof r)&&(("selector"!==e||"string"==typeof r||null===r)&&(("selectorAll"!==e||"string"==typeof r||null===r)&&(("src"!==e||"string"==typeof r)&&(("string"!==e||"string"==typeof r)&&(("time"!==e||"number"==typeof r)&&("vec2"===e?isValidDefaultCoordinate(r,2):"vec3"===e?isValidDefaultCoordinate(r,3):"vec4"!==e||isValidDefaultCoordinate(r,4)))))))))))))))}function isValidDefaultCoordinate(e,r){if(null===e)return!0;if("object"!=typeof e)return!1;if(Object.keys(e).length!==r)return!1;var t=e.x,n=e.y,i=e.z,o=e.w;return"number"==typeof t&&"number"==typeof n&&(!(r>2&&"number"!=typeof i)&&!(r>3&&"number"!=typeof o))}var coordinates=_dereq_("../utils/coordinates"),debug=_dereq_("debug"),error=debug("core:propertyTypes:warn"),warn=debug("core:propertyTypes:warn"),propertyTypes=module.exports.propertyTypes={},nonCharRegex=/[,> .[\]:]/;registerPropertyType("audio","",assetParse),registerPropertyType("array",[],arrayParse,arrayStringify),registerPropertyType("asset","",assetParse),registerPropertyType("boolean",!1,boolParse),registerPropertyType("color","#FFF",defaultParse,defaultStringify),registerPropertyType("int",0,intParse),registerPropertyType("number",0,numberParse),registerPropertyType("map","",assetParse),registerPropertyType("model","",assetParse),registerPropertyType("selector",null,selectorParse,selectorStringify),registerPropertyType("selectorAll",null,selectorAllParse,selectorAllStringify),registerPropertyType("src","",srcParse),registerPropertyType("string","",defaultParse,defaultStringify),registerPropertyType("time",0,intParse),registerPropertyType("vec2",{x:0,y:0},vecParse,coordinates.stringify),registerPropertyType("vec3",{x:0,y:0,z:0},vecParse,coordinates.stringify),registerPropertyType("vec4",{x:0,y:0,z:0,w:0},vecParse,coordinates.stringify),module.exports.registerPropertyType=registerPropertyType,module.exports.isValidDefaultValue=isValidDefaultValue,module.exports.isValidDefaultCoordinate=isValidDefaultCoordinate;
  448. },{"../utils/coordinates":191,"debug":8}],129:[function(_dereq_,module,exports){
  449. function getCanvasSize(e,t){return t?{height:e.parentElement.offsetHeight,width:e.parentElement.offsetWidth}:{height:window.innerHeight,width:window.innerWidth}}function requestFullscreen(e){var t=e.requestFullscreen||e.webkitRequestFullscreen||e.mozRequestFullScreen||e.msRequestFullscreen;t.apply(e)}function exitFullscreen(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}function shouldAntiAlias(e){return null!==e.getAttribute("antialias")?"true"===e.getAttribute("antialias"):!e.isMobile}function setupCanvas(e){function t(){var t=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement;t||e.exitVR(),document.activeElement.blur(),document.body.focus()}var i;i=document.createElement("canvas"),i.classList.add("a-canvas"),i.dataset.aframeCanvas=!0,e.appendChild(i),document.addEventListener("fullscreenchange",t),document.addEventListener("mozfullscreenchange",t),document.addEventListener("webkitfullscreenchange",t),i.addEventListener("touchmove",function(e){e.preventDefault()}),e.canvas=i,e.emit("render-target-loaded",{target:i}),setTimeout(bind(e.resize,e),0)}var initMetaTags=_dereq_("./metaTags").inject,initWakelock=_dereq_("./wakelock"),re=_dereq_("../a-register-element"),scenes=_dereq_("./scenes"),systems=_dereq_("../system").systems,THREE=_dereq_("../../lib/three"),TWEEN=_dereq_("@tweenjs/tween.js"),utils=_dereq_("../../utils/"),AEntity=_dereq_("../a-entity"),ANode=_dereq_("../a-node"),initPostMessageAPI=_dereq_("./postMessage"),bind=utils.bind,isIOS=utils.device.isIOS(),isMobile=utils.device.isMobile(),registerElement=re.registerElement,warn=utils.debug("core:a-scene:warn");module.exports.AScene=registerElement("a-scene",{prototype:Object.create(AEntity.prototype,{defaultComponents:{value:{inspector:"","keyboard-shortcuts":"",screenshot:"","vr-mode-ui":""}},createdCallback:{value:function(){this.isIOS=isIOS,this.isMobile=isMobile,this.isScene=!0,this.object3D=new THREE.Scene,this.render=bind(this.render,this),this.systems={},this.systemNames=[],this.time=0,this.init()}},init:{value:function(){this.behaviors={tick:[],tock:[]},this.hasLoaded=!1,this.isPlaying=!1,this.originalHTML=this.innerHTML,this.renderTarget=null,setupCanvas(this),this.setupRenderer(),this.resize(),this.addFullScreenStyles(),initPostMessageAPI(this)},writable:!0},addFullScreenStyles:{value:function(){var e=document.documentElement;e.classList.add("a-html"),document.body.classList.add("a-body"),this.classList.add("fullscreen")}},removeFullScreenStyles:{value:function(){var e=document.documentElement;e.classList.remove("a-html"),document.body.classList.remove("a-body"),this.classList.remove("fullscreen")}},attachedCallback:{value:function(){var e,t=this;initMetaTags(this),initWakelock(this),this.initSystems(),e=bind(this.resize,this),window.addEventListener("load",e),window.addEventListener("resize",function(){this.isIOS?setTimeout(e,100):e()}),this.play(),scenes.push(this),this.onVRPresentChangeBound=bind(this.onVRPresentChange,this),window.addEventListener("vrdisplaypresentchange",this.onVRPresentChangeBound),this.enterVRBound=function(){t.enterVR()},this.exitVRBound=function(){t.exitVR()},this.exitVRTrueBound=function(){t.exitVR(!0)},this.pointerRestrictedBound=function(){t.pointerRestricted()},this.pointerUnrestrictedBound=function(){t.pointerUnrestricted()},window.addEventListener("vrdisplayactivate",this.enterVRBound),window.addEventListener("vrdisplaydeactivate",this.exitVRBound),window.addEventListener("vrdisplaydisconnect",this.exitVRTrueBound),window.addEventListener("vrdisplaypointerrestricted",this.pointerRestrictedBound),window.addEventListener("vrdisplaypointerunrestricted",this.pointerUnrestrictedBound)},writable:window.debug},initSystems:{value:function(){Object.keys(systems).forEach(bind(this.initSystem,this))}},initSystem:{value:function(e){this.systems[e]||(this.systems[e]=new systems[e](this),this.systemNames.push(e))}},detachedCallback:{value:function(){var e=scenes.indexOf(this);scenes.splice(e,1),window.removeEventListener("vrdisplaypresentchange",this.onVRPresentChangeBound),window.removeEventListener("vrdisplayactivate",this.enterVRBound),window.removeEventListener("vrdisplaydeactivate",this.exitVRBound),window.removeEventListener("vrdisplayconnect",this.enterVRBound),window.removeEventListener("vrdisplaydisconnect",this.exitVRTrueBound),window.removeEventListener("vrdisplaypointerrestricted",this.pointerRestrictedBound),window.removeEventListener("vrdisplaypointerunrestricted",this.pointerUnrestrictedBound)}},addBehavior:{value:function(e){var t,i,s=this.behaviors;for(i in s)e[i]&&(t=this.behaviors[i],t.indexOf(e)===-1&&t.push(e))}},getPointerLockElement:{value:function(){return document.pointerLockElement},writable:window.debug},checkHeadsetConnected:{value:utils.device.checkHeadsetConnected,writable:window.debug},enterVR:{value:function(e){function t(){n.addState("vr-mode"),n.emit("enter-vr",{target:n}),n.isMobile&&screen.orientation&&screen.orientation.lock&&screen.orientation.lock("landscape"),n.addFullScreenStyles(),n.isMobile||n.checkHeadsetConnected()||requestFullscreen(n.canvas),n.resize()}function i(e){throw e&&e.message?new Error("Failed to enter VR mode (`requestPresent`): "+e.message):new Error("Failed to enter VR mode (`requestPresent`).")}var s,n=this,r=n.renderer.vr;return this.is("vr-mode")?Promise.resolve("Already in VR."):e||!this.checkHeadsetConnected()&&!this.isMobile?(t(),Promise.resolve()):(s=utils.device.getVRDisplay(),r.setDevice(s),r.enabled=!0,r.setPoseTarget(this.camera.el.object3D),s.requestPresent([{source:this.canvas}]).then(t,i))},writable:!0},exitVR:{value:function(e){function t(){n.removeState("vr-mode"),n.isMobile&&screen.orientation&&screen.orientation.unlock&&screen.orientation.unlock(),n.hasAttribute("embedded")&&n.removeFullScreenStyles(),n.resize(),n.isIOS&&utils.forceCanvasResizeSafariMobile(this.canvas),n.emit("exit-vr",{target:n})}function i(e){throw e&&e.message?new Error("Failed to exit VR mode (`exitPresent`): "+e.message):new Error("Failed to exit VR mode (`exitPresent`).")}var s,n=this;return this.is("vr-mode")?(exitFullscreen(),e||!this.checkHeadsetConnected()&&!this.isMobile?(t(),Promise.resolve()):(this.renderer.vr.enabled=!1,s=utils.device.getVRDisplay(),s.exitPresent().then(t,i))):Promise.resolve("Not in VR.")},writable:!0},pointerRestricted:{value:function(){if(this.canvas){var e=this.getPointerLockElement();e&&e!==this.canvas&&document.exitPointerLock&&document.exitPointerLock(),this.canvas.requestPointerLock&&this.canvas.requestPointerLock()}}},pointerUnrestricted:{value:function(){var e=this.getPointerLockElement();e&&e===this.canvas&&document.exitPointerLock&&document.exitPointerLock()}},onVRPresentChange:{value:function(e){var t=e.display||e.detail.display;return t.isPresenting?void this.enterVR(!0):void this.exitVR(!0)}},getAttribute:{value:function(e){var t=this.systems[e];return t?t.data:AEntity.prototype.getAttribute.call(this,e)}},getComputedAttribute:{value:function(e){warn("`getComputedAttribute` is deprecated. Use `getAttribute` instead."),this.getAttribute(e)}},getDOMAttribute:{value:function(e){var t=this.systems[e];return t?t.data:AEntity.prototype.getDOMAttribute.call(this,e)}},setAttribute:{value:function(e,t,i){var s=this.systems[e];return s?(ANode.prototype.setAttribute.call(this,e,t),void s.updateProperties(t)):void AEntity.prototype.setAttribute.call(this,e,t,i)}},removeBehavior:{value:function(e){var t,i,s,n=this.behaviors;for(i in n)e[i]&&(t=this.behaviors[i],s=t.indexOf(e),s!==-1&&t.splice(s,1))}},resize:{value:function(){var e,t,i,s=this.camera,n=this.canvas,r=this.getAttribute("embedded")&&!this.is("vr-mode");t=this.renderer.vr.getDevice(),i=this.renderer.vr.enabled&&t&&t.isPresenting,!s||!n||this.is("vr-mode")&&(this.isMobile||i)||(e=getCanvasSize(n,r),s.aspect=e.width/e.height,s.updateProjectionMatrix(),this.renderer.setSize(e.width,e.height,!1))},writable:!0},setupRenderer:{value:function(){var e;e=this.renderer=new THREE.WebGLRenderer({canvas:this.canvas,antialias:shouldAntiAlias(this),alpha:!0}),e.setPixelRatio(window.devicePixelRatio),e.sortObjects=!1},writable:window.debug},play:{value:function(){var e=this;return this.renderStarted?void AEntity.prototype.play.call(this):(this.addEventListener("loaded",function(){function e(e){e.renderStarted||(e.resize(),e.renderer&&(window.performance&&window.performance.mark("render-started"),e.clock=new THREE.Clock,e.render(),e.renderStarted=!0,e.emit("renderstart")))}return AEntity.prototype.play.call(this),this.camera?void e(this):void this.addEventListener("camera-set-active",function(){e(this)})}),void setTimeout(function(){AEntity.prototype.load.call(e)}))}},updateComponent:{value:function(e){e in systems||AEntity.prototype.updateComponent.apply(this,arguments)}},tick:{value:function(e,t){var i,s=this.systems;for(TWEEN.update(),i=0;i<this.behaviors.tick.length;i++)this.behaviors.tick[i].el.isPlaying&&this.behaviors.tick[i].tick(e,t);for(i=0;i<this.systemNames.length;i++)s[this.systemNames[i]].tick&&s[this.systemNames[i]].tick(e,t)}},tock:{value:function(e,t){var i,s=this.systems;for(i=0;i<this.behaviors.tock.length;i++)this.behaviors.tock[i].el.isPlaying&&this.behaviors.tock[i].tock(e,t);for(i=0;i<this.systemNames.length;i++)s[this.systemNames[i]].tock&&s[this.systemNames[i]].tock(e,t)}},render:{value:function(){var e=1e3*this.clock.getDelta(),t=this.renderer;this.time=1e3*this.clock.elapsedTime,this.isPlaying&&this.tick(this.time,e),t.animate(this.render),t.render(this.object3D,this.camera,this.renderTarget),this.isPlaying&&this.tock(this.time,e)},writable:!0}})}),module.exports.shouldAntiAlias=shouldAntiAlias,module.exports.setupCanvas=setupCanvas;
  450. },{"../../lib/three":174,"../../utils/":196,"../a-entity":122,"../a-node":124,"../a-register-element":125,"../system":136,"./metaTags":130,"./postMessage":131,"./scenes":132,"./wakelock":133,"@tweenjs/tween.js":1}],130:[function(_dereq_,module,exports){
  451. function Meta(e){return{tagName:"meta",attributes:e,exists:function(){return document.querySelector('meta[name="'+e.name+'"]')}}}function Link(e){return{tagName:"link",attributes:e,exists:function(){return document.querySelector('link[rel="'+e.rel+'"]')}}}function createTag(e){if(e&&e.tagName){var t=document.createElement(e.tagName);return t.setAttribute(constants.AFRAME_INJECTED,""),extend(t,e.attributes)}}var constants=_dereq_("../../constants/"),extend=_dereq_("../../utils").extend,MOBILE_HEAD_TAGS=module.exports.MOBILE_HEAD_TAGS=[Meta({name:"viewport",content:"width=device-width,initial-scale=1,maximum-scale=1,shrink-to-fit=no,user-scalable=no,minimal-ui"}),Meta({name:"mobile-web-app-capable",content:"yes"}),Meta({name:"theme-color",content:"black"})],MOBILE_IOS_HEAD_TAGS=[Meta({name:"apple-mobile-web-app-capable",content:"yes"}),Meta({name:"apple-mobile-web-app-status-bar-style",content:"black"}),Link({rel:"apple-touch-icon",href:"https://aframe.io/images/aframe-logo-152.png"})];module.exports.inject=function(e){function t(e){e&&!e.exists()&&(a=createTag(e),a&&(r?r.parentNode.insertBefore(a,r):n.appendChild(a),i.push(a)))}var a,n=document.head,r=n.querySelector("script"),i=[];return MOBILE_HEAD_TAGS.forEach(t),e.isIOS&&MOBILE_IOS_HEAD_TAGS.forEach(t),i};
  452. },{"../../constants/":117,"../../utils":196}],131:[function(_dereq_,module,exports){
  453. function postMessageAPIHandler(e){var a=this;if(e.data)switch(e.data.type){case"vr":switch(e.data.data){case"enter":a.enterVR();break;case"exit":a.exitVR()}}}var bind=_dereq_("../../utils/bind"),isIframed=_dereq_("../../utils/").isIframed;module.exports=function(e){isIframed()&&window.addEventListener("message",bind(postMessageAPIHandler,e))};
  454. },{"../../utils/":196,"../../utils/bind":190}],132:[function(_dereq_,module,exports){
  455. module.exports=[];
  456. },{}],133:[function(_dereq_,module,exports){
  457. var Wakelock=_dereq_("../../../vendor/wakelock/wakelock");module.exports=function(e){if(e.isMobile){var n=e.wakelock=new Wakelock;e.addEventListener("enter-vr",function(){n.request()}),e.addEventListener("exit-vr",function(){n.release()})}};
  458. },{"../../../vendor/wakelock/wakelock":205}],134:[function(_dereq_,module,exports){
  459. function isSingleProperty(r){return"type"in r?"string"==typeof r.type:"default"in r}function processPropertyDefinition(r,e){var t,o,n=r.default,p=r.type;return r.type?"bool"===r.type?p="boolean":"float"===r.type&&(p="number"):p=void 0===n||"boolean"!=typeof n&&"number"!=typeof n?Array.isArray(n)?"array":"string":typeof n,o=propertyTypes[p],o||warn("Unknown property type for component `"+e+"`: "+p),t=!!r.parse,r.parse=r.parse||o.parse,r.stringify=r.stringify||o.stringify,r.type=p,"default"in r?t||isValidDefaultValue(p,n)||warn("Default value `"+n+"` does not match type `"+p+"` in component `"+e+"`"):r.default=o.default,r}function parseProperty(r,e){return void 0!==r&&null!==r&&""!==r||(r=e.default,Array.isArray(r)&&(r=r.slice())),e.parse(r,e.default)}function stringifyProperty(r,e){return"object"!=typeof r?r:e&&null!==r?e.stringify(r):JSON.stringify(r)}var utils=_dereq_("../utils/"),PropertyTypes=_dereq_("./propertyTypes"),debug=utils.debug,isValidDefaultValue=PropertyTypes.isValidDefaultValue,propertyTypes=PropertyTypes.propertyTypes,warn=debug("core:schema:warn");module.exports.isSingleProperty=isSingleProperty,module.exports.process=function(r,e){var t;if(isSingleProperty(r))return processPropertyDefinition(r,e);for(t in r)r[t]=processPropertyDefinition(r[t],e);return r},module.exports.processPropertyDefinition=processPropertyDefinition,module.exports.parseProperties=function(){var r=[];return function(e,t,o,n,p){var i,s,y,u;r.length=0;for(s in o?e:t)r.push(s);if(null===e||"object"!=typeof e)return e;for(s in e)t[s]||p||warn("Unknown property `"+s+"` for component/system `"+n+"`.");for(i=0;i<r.length;i++){if(s=r[i],y=t[s],u=e[s],!t[s])return;e[s]=parseProperty(u,y)}return e}}(),module.exports.parseProperty=parseProperty,module.exports.stringifyProperties=function(r,e){var t,o,n,p,i={};for(t in r)o=e[t],n=r[t],p=n,"object"==typeof p&&(p=stringifyProperty(n,o),o||warn("Unknown component property: "+t)),i[t]=p;return i},module.exports.stringifyProperty=stringifyProperty;
  460. },{"../utils/":196,"./propertyTypes":128}],135:[function(_dereq_,module,exports){
  461. var schema=_dereq_("./schema"),processSchema=schema.process,shaders=module.exports.shaders={},shaderNames=module.exports.shaderNames=[],THREE=_dereq_("../lib/three"),utils=_dereq_("../utils"),propertyToThreeMapping={array:"v3",color:"v3",int:"i",number:"f",map:"t",time:"f",vec2:"v2",vec3:"v3",vec4:"v4"},Shader=module.exports.Shader=function(){};Shader.prototype={schema:{},vertexShader:"void main() {gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);}",fragmentShader:"void main() {gl_FragColor = vec4(1.0, 0.0, 1.0, 1.0);}",init:function(e){return this.attributes=this.initVariables(e,"attribute"),this.uniforms=this.initVariables(e,"uniform"),this.material=new(this.raw?THREE.RawShaderMaterial:THREE.ShaderMaterial)({uniforms:this.uniforms,vertexShader:this.vertexShader,fragmentShader:this.fragmentShader}),this.material},initVariables:function(e,r){var t={},a=this.schema;return Object.keys(a).forEach(function(e){if(a[e].is===r){var i=propertyToThreeMapping[a[e].type];t[e]={type:i,value:void 0}}}),t},update:function(e){this.updateVariables(e,"attribute"),this.updateVariables(e,"uniform")},updateVariables:function(e,r){var t=this,a="uniform"===r?this.uniforms:this.attributes,i=this.schema;Object.keys(e).forEach(function(s){var o;if(i[s]&&i[s].is===r){if("map"===i[s].type){if(!a[s]||a[s].value===e[s])return;return o="_texture_"+s,t.el.addEventListener("materialtextureloaded",function(){a[s].value=t.material[o],a[s].needsUpdate=!0}),void utils.material.updateMapMaterialFromData(o,s,t,e)}a[s].value=t.parseValue(i[s].type,e[s]),a[s].needsUpdate=!0}})},parseValue:function(e,r){var t;switch(e){case"vec2":return new THREE.Vector2(r.x,r.y);case"vec3":return new THREE.Vector3(r.x,r.y,r.z);case"vec4":return new THREE.Vector4(r.x,r.y,r.z,r.w);case"color":return t=new THREE.Color(r),new THREE.Vector3(t.r,t.g,t.b);case"map":return THREE.ImageUtils.loadTexture(r);default:return r}}},module.exports.registerShader=function(e,r){var t,a={};if(Object.keys(r).forEach(function(e){a[e]={value:r[e],writable:!0}}),shaders[e])throw new Error("The shader "+e+" has been already registered");return t=function(){Shader.call(this)},t.prototype=Object.create(Shader.prototype,a),t.prototype.name=e,t.prototype.constructor=t,shaders[e]={Shader:t,schema:processSchema(t.prototype.schema)},shaderNames.push(e),t};
  462. },{"../lib/three":174,"../utils":196,"./schema":134}],136:[function(_dereq_,module,exports){
  463. var components=_dereq_("./component"),schema=_dereq_("./schema"),utils=_dereq_("../utils/"),parseProperties=schema.parseProperties,parseProperty=schema.parseProperty,processSchema=schema.process,isSingleProp=schema.isSingleProperty,styleParser=utils.styleParser,systems=module.exports.systems={},System=module.exports.System=function(e){var t=components&&components.components[this.name];this.el=e,this.sceneEl=e,t&&(t.Component.prototype.system=this),this.buildData(),this.init(),this.update({})};System.prototype={schema:{},init:function(){},update:function(e){},updateProperties:function(e){var t=this.data;Object.keys(schema).length&&(this.buildData(e),this.update(t))},buildData:function(e){var t=this.schema;Object.keys(t).length&&(e=e||window.HTMLElement.prototype.getAttribute.call(this.sceneEl,this.name),isSingleProp(t)?this.data=parseProperty(e,t):this.data=parseProperties(styleParser.parse(e)||{},t))},tick:void 0,tock:void 0,play:function(){},pause:function(){}},module.exports.registerSystem=function(e,t){var s,o,r={},i=utils.findAllScenes(document);if(Object.keys(t).forEach(function(e){r[e]={value:t[e],writable:!0}}),systems[e])throw new Error("The system `"+e+"` has been already registered. Check that you are not loading two versions of the same system or two different systems of the same name.");for(o=function(e){System.call(this,e)},o.prototype=Object.create(System.prototype,r),o.prototype.name=e,o.prototype.constructor=o,o.prototype.schema=utils.extend(processSchema(o.prototype.schema)),systems[e]=o,s=0;s<i.length;s++)i[s].initSystem(e)};
  464. },{"../utils/":196,"./component":126,"./schema":134}],137:[function(_dereq_,module,exports){
  465. _dereq_("./pivot");
  466. },{"./pivot":138}],138:[function(_dereq_,module,exports){
  467. var registerComponent=_dereq_("../../core/component").registerComponent,THREE=_dereq_("../../lib/three"),originalPosition=new THREE.Vector3,originalRotation=new THREE.Vector3;registerComponent("pivot",{dependencies:["position"],schema:{type:"vec3"},init:function(){var o=this.data,i=this.el,t=i.object3D.parent,e=i.object3D,n=new THREE.Group;originalPosition.copy(e.position),originalRotation.copy(e.rotation),t.remove(e),n.add(e),t.add(n),i.object3D=n,e.position.set(-1*o.x,-1*o.y,-1*o.z),n.position.set(o.x+originalPosition.x,o.y+originalPosition.y,o.z+originalPosition.z),n.rotation.copy(e.rotation),e.rotation.set(0,0,0)}});
  468. },{"../../core/component":126,"../../lib/three":174}],139:[function(_dereq_,module,exports){
  469. function addMapping(e){var a=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();"fog"===e&&(a="material-fog"),"visible"===e&&(a="material-visible"),materialMappings[a]="material."+e}var components=_dereq_("../../core/component").components,shaders=_dereq_("../../core/shader").shaders,utils=_dereq_("../../utils/"),materialMappings={};Object.keys(components.material.schema).forEach(addMapping),Object.keys(shaders.standard.schema).forEach(addMapping),module.exports=function(){return{defaultComponents:{material:{}},mappings:utils.extend({},materialMappings)}};
  470. },{"../../core/component":126,"../../core/shader":135,"../../utils/":196}],140:[function(_dereq_,module,exports){
  471. _dereq_("./primitives/a-camera"),_dereq_("./primitives/a-collada-model"),_dereq_("./primitives/a-cursor"),_dereq_("./primitives/a-curvedimage"),_dereq_("./primitives/a-gltf-model"),_dereq_("./primitives/a-image"),_dereq_("./primitives/a-light"),_dereq_("./primitives/a-link"),_dereq_("./primitives/a-obj-model"),_dereq_("./primitives/a-sky"),_dereq_("./primitives/a-sound"),_dereq_("./primitives/a-text"),_dereq_("./primitives/a-video"),_dereq_("./primitives/a-videosphere"),_dereq_("./primitives/meshPrimitives");
  472. },{"./primitives/a-camera":142,"./primitives/a-collada-model":143,"./primitives/a-cursor":144,"./primitives/a-curvedimage":145,"./primitives/a-gltf-model":146,"./primitives/a-image":147,"./primitives/a-light":148,"./primitives/a-link":149,"./primitives/a-obj-model":150,"./primitives/a-sky":151,"./primitives/a-sound":152,"./primitives/a-text":153,"./primitives/a-video":154,"./primitives/a-videosphere":155,"./primitives/meshPrimitives":156}],141:[function(_dereq_,module,exports){
  473. function addComponentMapping(e,t){var i=components[e].schema;Object.keys(i).map(function(i){var n=i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();void 0!==t[n]&&(n=e+"-"+i),t[n]=e+"."+i})}function definePrimitive(e,t,i){i=i||{},Object.keys(t).map(function(e){addComponentMapping(e,i)}),module.exports.registerPrimitive(e,utils.extendDeep({},null,{defaultComponents:t,mappings:i}))}var AEntity=_dereq_("../../core/a-entity"),components=_dereq_("../../core/component").components,registerElement=_dereq_("../../core/a-register-element").registerElement,utils=_dereq_("../../utils/"),debug=utils.debug,setComponentProperty=utils.entity.setComponentProperty,log=debug("extras:primitives:debug"),warn=debug("extras:primitives:warn"),primitives=module.exports.primitives={};module.exports.registerPrimitive=function(e,t){e=e.toLowerCase(),log("Registering <%s>",e),t.defaultAttributes&&warn("The 'defaultAttributes' object is deprecated. Use 'defaultComponents' instead.");var i=registerElement(e,{prototype:Object.create(AEntity.prototype,{defaultComponentsFromPrimitive:{value:t.defaultComponents||t.defaultAttributes||{}},deprecated:{value:t.deprecated||null},deprecatedMappings:{value:t.deprecatedMappings||{}},mappings:{value:t.mappings||{}},createdCallback:{value:function(){t.deprecated&&console.warn(t.deprecated),this.resolveMappingCollisions()}},resolveMappingCollisions:{value:function(){var e=this.mappings,t=this;Object.keys(e).forEach(function(i){var n;i!==i.toLowerCase()&&warn("Mapping keys should be specified in lower case. The mapping key "+i+" may not be recognized"),components[i]&&(n=e[i].replace(".","-"),e[n]=e[i],delete e[i],console.warn("The primitive "+t.tagName.toLowerCase()+" has a mapping collision. The attribute "+i+" has the same name as a registered component and has been renamed to "+n))})}},getExtraComponents:{value:function(){function e(e,r){return t(e)?i(r):t(r)?i(e):n(e)&&n(r)?utils.extendDeep(e,r):i(r)}function t(e){return"undefined"==typeof e}function i(e){return n(e)?utils.extendDeep({},e):e}function n(e){return null!==e&&e.constructor===Object}var r,o,a,s,p,u,l=this;for(o=utils.clone(this.defaultComponentsFromPrimitive),p=this.getAttribute("mixin"),p&&(p=p.trim().split(" "),p.forEach(function(t){var i=l.sceneEl.querySelector("#"+t).componentCache;Object.keys(i).forEach(function(t){o[t]=e(o[t],i[t])})})),a=0;a<this.attributes.length;a++)r=this.attributes[a],s=this.mappings[r.name],s&&(u=utils.entity.getComponentPropertyPath(s),u.constructor===Array?(o[u[0]]=o[u[0]]||{},o[u[0]][u[1]]=r.value.trim()):o[u]=r.value.trim());return o}},attributeChangedCallback:{value:function(e,t,i){var n=this.mappings[e];e in this.deprecatedMappings&&console.warn(this.deprecatedMappings[e]),e&&n&&setComponentProperty(this,n,i)}}})});return primitives[e]=i,i},module.exports.definePrimitive=definePrimitive;
  474. },{"../../core/a-entity":122,"../../core/a-register-element":125,"../../core/component":126,"../../utils/":196}],142:[function(_dereq_,module,exports){
  475. var registerPrimitive=_dereq_("../primitives").registerPrimitive;registerPrimitive("a-camera",{defaultComponents:{camera:{},"look-controls":{},"wasd-controls":{}},mappings:{active:"camera.active",far:"camera.far",fov:"camera.fov","look-controls-enabled":"look-controls.enabled",near:"camera.near","wasd-controls-enabled":"wasd-controls.enabled","reverse-mouse-drag":"look-controls.reverseMouseDrag",zoom:"camera.zoom"}});
  476. },{"../primitives":141}],143:[function(_dereq_,module,exports){
  477. var registerPrimitive=_dereq_("../primitives").registerPrimitive;registerPrimitive("a-collada-model",{mappings:{src:"collada-model"}});
  478. },{"../primitives":141}],144:[function(_dereq_,module,exports){
  479. var getMeshMixin=_dereq_("../getMeshMixin"),registerPrimitive=_dereq_("../primitives").registerPrimitive,utils=_dereq_("../../../utils/");registerPrimitive("a-cursor",utils.extendDeep({},getMeshMixin(),{defaultComponents:{cursor:{},geometry:{primitive:"ring",radiusOuter:.016,radiusInner:.01,segmentsTheta:32},material:{color:"#000",shader:"flat",opacity:.8},position:{x:0,y:0,z:-1}},mappings:{far:"raycaster.far",fuse:"cursor.fuse","fuse-timeout":"cursor.fuseTimeout",interval:"raycaster.interval",objects:"raycaster.objects"}}));
  480. },{"../../../utils/":196,"../getMeshMixin":139,"../primitives":141}],145:[function(_dereq_,module,exports){
  481. var getMeshMixin=_dereq_("../getMeshMixin"),registerPrimitive=_dereq_("../primitives").registerPrimitive,utils=_dereq_("../../../utils/");registerPrimitive("a-curvedimage",utils.extendDeep({},getMeshMixin(),{defaultComponents:{geometry:{height:1,primitive:"cylinder",radius:2,segmentsRadial:48,thetaLength:270,openEnded:!0,thetaStart:0},material:{color:"#FFF",shader:"flat",side:"double",transparent:!0,repeat:"-1 1"}},mappings:{height:"geometry.height","open-ended":"geometry.openEnded",radius:"geometry.radius",segments:"geometry.segmentsRadial",start:"geometry.thetaStart","theta-length":"geometry.thetaLength","theta-start":"geometry.thetaStart",width:"geometry.thetaLength"}}));
  482. },{"../../../utils/":196,"../getMeshMixin":139,"../primitives":141}],146:[function(_dereq_,module,exports){
  483. var registerPrimitive=_dereq_("../primitives").registerPrimitive;registerPrimitive("a-gltf-model",{mappings:{src:"gltf-model"}});
  484. },{"../primitives":141}],147:[function(_dereq_,module,exports){
  485. var getMeshMixin=_dereq_("../getMeshMixin"),registerPrimitive=_dereq_("../primitives").registerPrimitive,utils=_dereq_("../../../utils/");registerPrimitive("a-image",utils.extendDeep({},getMeshMixin(),{defaultComponents:{geometry:{primitive:"plane"},material:{color:"#FFF",shader:"flat",side:"double",transparent:!0}},mappings:{height:"geometry.height",width:"geometry.width"}}));
  486. },{"../../../utils/":196,"../getMeshMixin":139,"../primitives":141}],148:[function(_dereq_,module,exports){
  487. var registerPrimitive=_dereq_("../primitives").registerPrimitive;registerPrimitive("a-light",{defaultComponents:{light:{}},mappings:{angle:"light.angle",color:"light.color","ground-color":"light.groundColor",decay:"light.decay",distance:"light.distance",intensity:"light.intensity",penumbra:"light.penumbra",type:"light.type",target:"light.target"}});
  488. },{"../primitives":141}],149:[function(_dereq_,module,exports){
  489. var registerPrimitive=_dereq_("../primitives").registerPrimitive;registerPrimitive("a-link",{defaultComponents:{},mappings:{href:"link.href",image:"link.image",title:"link.title"}});
  490. },{"../primitives":141}],150:[function(_dereq_,module,exports){
  491. var meshMixin=_dereq_("../getMeshMixin")(),registerPrimitive=_dereq_("../primitives").registerPrimitive,utils=_dereq_("../../../utils/");registerPrimitive("a-obj-model",utils.extendDeep({},meshMixin,{defaultComponents:{"obj-model":{}},mappings:{src:"obj-model.obj",mtl:"obj-model.mtl"}}));
  492. },{"../../../utils/":196,"../getMeshMixin":139,"../primitives":141}],151:[function(_dereq_,module,exports){
  493. var getMeshMixin=_dereq_("../getMeshMixin"),registerPrimitive=_dereq_("../primitives").registerPrimitive,utils=_dereq_("../../../utils/"),meshPrimitives=_dereq_("./meshPrimitives");registerPrimitive("a-sky",utils.extendDeep({},getMeshMixin(),{defaultComponents:{geometry:{primitive:"sphere",radius:5e3,segmentsWidth:64,segmentsHeight:32},material:{color:"#FFF",shader:"flat",npot:!0},scale:"-1 1 1"},mappings:utils.extendDeep({},meshPrimitives["a-sphere"].prototype.mappings)}));
  494. },{"../../../utils/":196,"../getMeshMixin":139,"../primitives":141,"./meshPrimitives":156}],152:[function(_dereq_,module,exports){
  495. var registerPrimitive=_dereq_("../primitives").registerPrimitive;registerPrimitive("a-sound",{defaultComponents:{sound:{}},mappings:{src:"sound.src",on:"sound.on",autoplay:"sound.autoplay",loop:"sound.loop",volume:"sound.volume"}});
  496. },{"../primitives":141}],153:[function(_dereq_,module,exports){
  497. var definePrimitive=_dereq_("../primitives").definePrimitive;definePrimitive("a-text",{text:{anchor:"align",width:5}});
  498. },{"../primitives":141}],154:[function(_dereq_,module,exports){
  499. var getMeshMixin=_dereq_("../getMeshMixin"),registerPrimitive=_dereq_("../primitives").registerPrimitive,utils=_dereq_("../../../utils/");registerPrimitive("a-video",utils.extendDeep({},getMeshMixin(),{defaultComponents:{geometry:{primitive:"plane"},material:{color:"#FFF",shader:"flat",side:"double",transparent:!0}},mappings:{height:"geometry.height",width:"geometry.width"}}));
  500. },{"../../../utils/":196,"../getMeshMixin":139,"../primitives":141}],155:[function(_dereq_,module,exports){
  501. var getMeshMixin=_dereq_("../getMeshMixin"),registerPrimitive=_dereq_("../primitives").registerPrimitive,utils=_dereq_("../../../utils/");registerPrimitive("a-videosphere",utils.extendDeep({},getMeshMixin(),{defaultComponents:{geometry:{primitive:"sphere",radius:5e3,segmentsWidth:64,segmentsHeight:32},material:{color:"#FFF",shader:"flat",npot:!0},scale:"-1 1 1"},mappings:{radius:"geometry.radius","segments-height":"geometry.segmentsHeight","segments-width":"geometry.segmentsWidth"}}));
  502. },{"../../../utils/":196,"../getMeshMixin":139,"../primitives":141}],156:[function(_dereq_,module,exports){
  503. function unCamelCase(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}var getMeshMixin=_dereq_("../getMeshMixin"),geometries=_dereq_("../../../core/geometry").geometries,geometryNames=_dereq_("../../../core/geometry").geometryNames,registerPrimitive=_dereq_("../primitives").registerPrimitive,utils=_dereq_("../../../utils/"),meshPrimitives=module.exports={};geometryNames.forEach(function(e){var i=geometries[e],r=unCamelCase(e),t={};Object.keys(i.schema).forEach(function(e){t[unCamelCase(e)]="geometry."+e});var m="a-"+r,s=registerPrimitive(m,utils.extendDeep({},getMeshMixin(),{defaultComponents:{geometry:{primitive:e}},mappings:t}));meshPrimitives[m]=s});
  504. },{"../../../core/geometry":127,"../../../utils/":196,"../getMeshMixin":139,"../primitives":141}],157:[function(_dereq_,module,exports){
  505. var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three");registerGeometry("box",{schema:{depth:{default:1,min:0},height:{default:1,min:0},width:{default:1,min:0},segmentsHeight:{default:1,min:1,max:20,type:"int"},segmentsWidth:{default:1,min:1,max:20,type:"int"},segmentsDepth:{default:1,min:1,max:20,type:"int"}},init:function(e){this.geometry=new THREE.BoxGeometry(e.width,e.height,e.depth,e.segmentsWidth,e.segmentsHeight,e.segmentsDepth)}});
  506. },{"../core/geometry":127,"../lib/three":174}],158:[function(_dereq_,module,exports){
  507. var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three"),degToRad=THREE.Math.degToRad;registerGeometry("circle",{schema:{radius:{default:1,min:0},segments:{default:32,min:3,type:"int"},thetaLength:{default:360,min:0},thetaStart:{default:0}},init:function(e){this.geometry=new THREE.CircleGeometry(e.radius,e.segments,degToRad(e.thetaStart),degToRad(e.thetaLength))}});
  508. },{"../core/geometry":127,"../lib/three":174}],159:[function(_dereq_,module,exports){
  509. var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three"),degToRad=THREE.Math.degToRad;registerGeometry("cone",{schema:{height:{default:1,min:0},openEnded:{default:!1},radiusBottom:{default:1,min:0},radiusTop:{default:.01,min:0},segmentsHeight:{default:18,min:1,type:"int"},segmentsRadial:{default:36,min:3,type:"int"},thetaLength:{default:360,min:0},thetaStart:{default:0}},init:function(e){this.geometry=new THREE.CylinderGeometry(e.radiusTop,e.radiusBottom,e.height,e.segmentsRadial,e.segmentsHeight,e.openEnded,degToRad(e.thetaStart),degToRad(e.thetaLength))}});
  510. },{"../core/geometry":127,"../lib/three":174}],160:[function(_dereq_,module,exports){
  511. var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three"),degToRad=THREE.Math.degToRad;registerGeometry("cylinder",{schema:{height:{default:1,min:0},openEnded:{default:!1},radius:{default:1,min:0},segmentsHeight:{default:18,min:1,type:"int"},segmentsRadial:{default:36,min:3,type:"int"},thetaLength:{default:360,min:0},thetaStart:{default:0}},init:function(e){this.geometry=new THREE.CylinderGeometry(e.radius,e.radius,e.height,e.segmentsRadial,e.segmentsHeight,e.openEnded,degToRad(e.thetaStart),degToRad(e.thetaLength))}});
  512. },{"../core/geometry":127,"../lib/three":174}],161:[function(_dereq_,module,exports){
  513. var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three");registerGeometry("dodecahedron",{schema:{detail:{default:0,min:0,max:5,type:"int"},radius:{default:1,min:0}},init:function(e){this.geometry=new THREE.DodecahedronGeometry(e.radius,e.detail)}});
  514. },{"../core/geometry":127,"../lib/three":174}],162:[function(_dereq_,module,exports){
  515. var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three");registerGeometry("icosahedron",{schema:{detail:{default:0,min:0,max:5,type:"int"},radius:{default:1,min:0}},init:function(e){this.geometry=new THREE.IcosahedronGeometry(e.radius,e.detail)}});
  516. },{"../core/geometry":127,"../lib/three":174}],163:[function(_dereq_,module,exports){
  517. _dereq_("./box.js"),_dereq_("./circle.js"),_dereq_("./cone.js"),_dereq_("./cylinder.js"),_dereq_("./dodecahedron.js"),_dereq_("./icosahedron.js"),_dereq_("./octahedron.js"),_dereq_("./plane.js"),_dereq_("./ring.js"),_dereq_("./sphere.js"),_dereq_("./tetrahedron.js"),_dereq_("./torus.js"),_dereq_("./torusKnot.js"),_dereq_("./triangle.js");
  518. },{"./box.js":157,"./circle.js":158,"./cone.js":159,"./cylinder.js":160,"./dodecahedron.js":161,"./icosahedron.js":162,"./octahedron.js":164,"./plane.js":165,"./ring.js":166,"./sphere.js":167,"./tetrahedron.js":168,"./torus.js":169,"./torusKnot.js":170,"./triangle.js":171}],164:[function(_dereq_,module,exports){
  519. var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three");registerGeometry("octahedron",{schema:{detail:{default:0,min:0,max:5,type:"int"},radius:{default:1,min:0}},init:function(e){this.geometry=new THREE.OctahedronGeometry(e.radius,e.detail)}});
  520. },{"../core/geometry":127,"../lib/three":174}],165:[function(_dereq_,module,exports){
  521. var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three");registerGeometry("plane",{schema:{height:{default:1,min:0},width:{default:1,min:0},segmentsHeight:{default:1,min:1,max:20,type:"int"},segmentsWidth:{default:1,min:1,max:20,type:"int"}},init:function(e){this.geometry=new THREE.PlaneGeometry(e.width,e.height,e.segmentsWidth,e.segmentsHeight)}});
  522. },{"../core/geometry":127,"../lib/three":174}],166:[function(_dereq_,module,exports){
  523. var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three"),degToRad=THREE.Math.degToRad;registerGeometry("ring",{schema:{radiusInner:{default:.8,min:0},radiusOuter:{default:1.2,min:0},segmentsPhi:{default:10,min:1,type:"int"},segmentsTheta:{default:32,min:3,type:"int"},thetaLength:{default:360,min:0},thetaStart:{default:0}},init:function(e){this.geometry=new THREE.RingGeometry(e.radiusInner,e.radiusOuter,e.segmentsTheta,e.segmentsPhi,degToRad(e.thetaStart),degToRad(e.thetaLength))}});
  524. },{"../core/geometry":127,"../lib/three":174}],167:[function(_dereq_,module,exports){
  525. var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three"),degToRad=THREE.Math.degToRad;registerGeometry("sphere",{schema:{radius:{default:1,min:0},phiLength:{default:360},phiStart:{default:0,min:0},thetaLength:{default:180,min:0},thetaStart:{default:0},segmentsHeight:{default:18,min:2,type:"int"},segmentsWidth:{default:36,min:3,type:"int"}},init:function(e){this.geometry=new THREE.SphereGeometry(e.radius,e.segmentsWidth,e.segmentsHeight,degToRad(e.phiStart),degToRad(e.phiLength),degToRad(e.thetaStart),degToRad(e.thetaLength))}});
  526. },{"../core/geometry":127,"../lib/three":174}],168:[function(_dereq_,module,exports){
  527. var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three");registerGeometry("tetrahedron",{schema:{detail:{default:0,min:0,max:5,type:"int"},radius:{default:1,min:0}},init:function(e){this.geometry=new THREE.TetrahedronGeometry(e.radius,e.detail)}});
  528. },{"../core/geometry":127,"../lib/three":174}],169:[function(_dereq_,module,exports){
  529. var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three"),degToRad=THREE.Math.degToRad;registerGeometry("torus",{schema:{arc:{default:360},radius:{default:1,min:0},radiusTubular:{default:.2,min:0},segmentsRadial:{default:36,min:2,type:"int"},segmentsTubular:{default:32,min:3,type:"int"}},init:function(e){this.geometry=new THREE.TorusGeometry(e.radius,2*e.radiusTubular,e.segmentsRadial,e.segmentsTubular,degToRad(e.arc))}});
  530. },{"../core/geometry":127,"../lib/three":174}],170:[function(_dereq_,module,exports){
  531. var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three");registerGeometry("torusKnot",{schema:{p:{default:2,min:1},q:{default:3,min:1},radius:{default:1,min:0},radiusTubular:{default:.2,min:0},segmentsRadial:{default:8,min:3,type:"int"},segmentsTubular:{default:100,min:3,type:"int"}},init:function(e){this.geometry=new THREE.TorusKnotGeometry(e.radius,2*e.radiusTubular,e.segmentsTubular,e.segmentsRadial,e.p,e.q)}});
  532. },{"../core/geometry":127,"../lib/three":174}],171:[function(_dereq_,module,exports){
  533. var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three"),quaternion=new THREE.Quaternion,rotateVector=new THREE.Vector3(0,0,1),uvMinVector=new THREE.Vector2,uvMaxVector=new THREE.Vector2,uvScaleVector=new THREE.Vector2;registerGeometry("triangle",{schema:{vertexA:{type:"vec3",default:{x:0,y:.5,z:0}},vertexB:{type:"vec3",default:{x:-.5,y:-.5,z:0}},vertexC:{type:"vec3",default:{x:.5,y:-.5,z:0}}},init:function(e){var t,r,o,c,n,a;o=new THREE.Triangle,o.a.set(e.vertexA.x,e.vertexA.y,e.vertexA.z),o.b.set(e.vertexB.x,e.vertexB.y,e.vertexB.z),o.c.set(e.vertexC.x,e.vertexC.y,e.vertexC.z),r=o.normal(),quaternion.setFromUnitVectors(r,rotateVector),c=o.a.clone().applyQuaternion(quaternion),n=o.b.clone().applyQuaternion(quaternion),a=o.c.clone().applyQuaternion(quaternion),uvMinVector.set(Math.min(c.x,n.x,a.x),Math.min(c.y,n.y,a.y)),uvMaxVector.set(Math.max(c.x,n.x,a.x),Math.max(c.y,n.y,a.y)),uvScaleVector.set(0,0).subVectors(uvMaxVector,uvMinVector),c=(new THREE.Vector2).subVectors(c,uvMinVector).divide(uvScaleVector),n=(new THREE.Vector2).subVectors(n,uvMinVector).divide(uvScaleVector),a=(new THREE.Vector2).subVectors(a,uvMinVector).divide(uvScaleVector),t=this.geometry=new THREE.Geometry,t.vertices.push(o.a),t.vertices.push(o.b),t.vertices.push(o.c),t.faces.push(new THREE.Face3(0,1,2,r)),t.faceVertexUvs[0]=[[c,n,a]]}});
  534. },{"../core/geometry":127,"../lib/three":174}],172:[function(_dereq_,module,exports){
  535. window.hasNativeWebVRImplementation=!!window.navigator.getVRDisplays||!!window.navigator.getVRDevices,window.WebVRConfig=window.WebVRConfig||{BUFFER_SCALE:1,CARDBOARD_UI_DISABLED:!0,ROTATE_INSTRUCTIONS_DISABLED:!0,TOUCH_PANNER_DISABLED:!0,MOUSE_KEYBOARD_CONTROLS_DISABLED:!0},_dereq_("webvr-polyfill");var utils=_dereq_("./utils/"),debug=utils.debug,error=debug("A-Frame:error"),warn=debug("A-Frame:warn");window.document.currentScript&&window.document.currentScript.parentNode!==window.document.head&&!window.debug&&warn("Put the A-Frame <script> tag in the <head> of the HTML *before* the scene to ensure everything for A-Frame is properly registered before they are used from HTML."),"file:"===window.location.protocol&&error("This HTML file is currently being served via the file:// protocol. Assets, textures, and models WILL NOT WORK due to cross-origin policy! Please use a local or hosted server: https://aframe.io/docs/0.5.0/introduction/getting-started.html#using-a-local-server."),window.Promise=window.Promise||_dereq_("promise-polyfill"),utils.device.isIOSOlderThan10(window.navigator.userAgent)&&(window.WebVRConfig.BUFFER_SCALE=1/window.devicePixelRatio),_dereq_("present"),utils.device.isBrowserEnvironment&&(_dereq_("./style/aframe.css"),_dereq_("./style/rStats.css"));var AScene=_dereq_("./core/scene/a-scene").AScene,components=_dereq_("./core/component").components,registerComponent=_dereq_("./core/component").registerComponent,registerGeometry=_dereq_("./core/geometry").registerGeometry,registerPrimitive=_dereq_("./extras/primitives/primitives").registerPrimitive,registerShader=_dereq_("./core/shader").registerShader,registerSystem=_dereq_("./core/system").registerSystem,shaders=_dereq_("./core/shader").shaders,systems=_dereq_("./core/system").systems,THREE=window.THREE=_dereq_("./lib/three"),TWEEN=window.TWEEN=_dereq_("@tweenjs/tween.js"),pkg=_dereq_("../package");_dereq_("./components/index"),_dereq_("./geometries/index"),_dereq_("./shaders/index"),_dereq_("./systems/index");var ANode=_dereq_("./core/a-node"),AEntity=_dereq_("./core/a-entity");_dereq_("./core/a-animation"),_dereq_("./core/a-assets"),_dereq_("./core/a-cubemap"),_dereq_("./core/a-mixin"),_dereq_("./extras/components/"),_dereq_("./extras/primitives/"),console.log("A-Frame Version: 0.7.0 (Date 2018-01-24, Commit #2d651b7)"),console.log("three Version:",pkg.dependencies.three),console.log("WebVR Polyfill Version:",pkg.dependencies["webvr-polyfill"]),module.exports=window.AFRAME={AComponent:_dereq_("./core/component").Component,AEntity:AEntity,ANode:ANode,AScene:AScene,components:components,geometries:_dereq_("./core/geometry").geometries,registerComponent:registerComponent,registerElement:_dereq_("./core/a-register-element").registerElement,registerGeometry:registerGeometry,registerPrimitive:registerPrimitive,registerShader:registerShader,registerSystem:registerSystem,primitives:{getMeshMixin:_dereq_("./extras/primitives/getMeshMixin"),primitives:_dereq_("./extras/primitives/primitives").primitives},scenes:_dereq_("./core/scene/scenes"),schema:_dereq_("./core/schema"),shaders:shaders,systems:systems,THREE:THREE,TWEEN:TWEEN,utils:utils,version:pkg.version};
  536. },{"../package":76,"./components/index":85,"./core/a-animation":119,"./core/a-assets":120,"./core/a-cubemap":121,"./core/a-entity":122,"./core/a-mixin":123,"./core/a-node":124,"./core/a-register-element":125,"./core/component":126,"./core/geometry":127,"./core/scene/a-scene":129,"./core/scene/scenes":132,"./core/schema":134,"./core/shader":135,"./core/system":136,"./extras/components/":137,"./extras/primitives/":140,"./extras/primitives/getMeshMixin":139,"./extras/primitives/primitives":141,"./geometries/index":163,"./lib/three":174,"./shaders/index":176,"./style/aframe.css":181,"./style/rStats.css":182,"./systems/index":185,"./utils/":196,"@tweenjs/tween.js":1,"present":32,"promise-polyfill":34,"webvr-polyfill":61}],173:[function(_dereq_,module,exports){
  537. window.aframeStats=function(t){function e(){i("te").set(n()),window.performance.getEntriesByName&&i("lt").set(window.performance.getEntriesByName("render-started")[0].startTime.toFixed(0))}function n(){var t=c.querySelectorAll("*");return Array.prototype.slice.call(t).filter(function(t){return t.isEntity}),t.length}function r(){}function a(){}function o(t){i=t}var i=null,c=t,s={te:{caption:"Entities"},lt:{caption:"Load Time"}},u=[{caption:"A-Frame",values:["te","lt"]}];return{update:e,start:r,end:a,attach:o,values:s,groups:u,fractions:[]}},"object"==typeof module&&(module.exports={aframeStats:window.aframeStats});
  538. },{}],174:[function(_dereq_,module,exports){
  539. (function (global){
  540. var THREE=global.THREE=_dereq_("three");THREE.TextureLoader&&(THREE.TextureLoader.prototype.crossOrigin="anonymous"),THREE.ImageLoader&&(THREE.ImageLoader.prototype.crossOrigin="anonymous"),THREE.Cache&&(THREE.Cache.enabled=!0),_dereq_("three/examples/js/loaders/GLTFLoader"),_dereq_("three/examples/js/loaders/OBJLoader"),_dereq_("three/examples/js/loaders/MTLLoader"),_dereq_("three/examples/js/loaders/ColladaLoader"),THREE.ColladaLoader.prototype.crossOrigin="anonymous",THREE.GLTFLoader.prototype.crossOrigin="anonymous",THREE.MTLLoader.prototype.crossOrigin="anonymous",THREE.OBJLoader.prototype.crossOrigin="anonymous",module.exports=THREE;
  541. }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  542. },{"three":41,"three/examples/js/loaders/ColladaLoader":42,"three/examples/js/loaders/GLTFLoader":43,"three/examples/js/loaders/MTLLoader":44,"three/examples/js/loaders/OBJLoader":45}],175:[function(_dereq_,module,exports){
  543. function getMaterialData(e){return{fog:e.fog,color:new THREE.Color(e.color),wireframe:e.wireframe,wireframeLinewidth:e.wireframeLinewidth}}var registerShader=_dereq_("../core/shader").registerShader,THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/");module.exports.Shader=registerShader("flat",{schema:{color:{type:"color"},fog:{default:!0},height:{default:256},offset:{type:"vec2",default:{x:0,y:0}},repeat:{type:"vec2",default:{x:1,y:1}},src:{type:"map"},width:{default:512},wireframe:{default:!1},wireframeLinewidth:{default:2}},init:function(e){this.textureSrc=null,this.material=new THREE.MeshBasicMaterial(getMaterialData(e)),utils.material.updateMap(this,e)},update:function(e){this.updateMaterial(e),utils.material.updateMap(this,e)},updateMaterial:function(e){var t=this.material;e=getMaterialData(e),Object.keys(e).forEach(function(a){t[a]=e[a]})}});
  544. },{"../core/shader":135,"../lib/three":174,"../utils/":196}],176:[function(_dereq_,module,exports){
  545. _dereq_("./flat"),_dereq_("./standard"),_dereq_("./sdf"),_dereq_("./msdf"),_dereq_("./ios10hls");
  546. },{"./flat":175,"./ios10hls":177,"./msdf":178,"./sdf":179,"./standard":180}],177:[function(_dereq_,module,exports){
  547. var registerShader=_dereq_("../core/shader").registerShader;module.exports.Shader=registerShader("ios10hls",{schema:{src:{type:"map",is:"uniform"},opacity:{type:"number",is:"uniform",default:1}},vertexShader:["varying vec2 vUV;","void main(void) {"," gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);"," vUV = uv;","}"].join("\n"),fragmentShader:["uniform sampler2D src;","uniform float opacity;","varying vec2 vUV;","void main() {"," vec2 offset = vec2(0, 0);"," vec2 repeat = vec2(1, 1);"," vec4 color = texture2D(src, vec2(vUV.x / repeat.x + offset.x, (1.0 - vUV.y) / repeat.y + offset.y)).bgra;"," gl_FragColor = vec4(color.rgb, opacity);","}"].join("\n")});
  548. },{"../core/shader":135}],178:[function(_dereq_,module,exports){
  549. var registerShader=_dereq_("../core/shader").registerShader;module.exports.Shader=registerShader("msdf",{schema:{alphaTest:{type:"number",is:"uniform",default:.5},color:{type:"color",is:"uniform",default:"white"},map:{type:"map",is:"uniform"},opacity:{type:"number",is:"uniform",default:1}},raw:!0,vertexShader:["attribute vec2 uv;","attribute vec3 position;","uniform mat4 projectionMatrix;","uniform mat4 modelViewMatrix;","varying vec2 vUV;","void main(void) {"," gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);"," vUV = uv;","}"].join("\n"),fragmentShader:["#ifdef GL_OES_standard_derivatives","#extension GL_OES_standard_derivatives: enable","#endif","precision highp float;","#define BIG_ENOUGH 0.001","#define MODIFIED_ALPHATEST (0.02 * isBigEnough / BIG_ENOUGH)","#define ALL_SMOOTH 0.4","#define ALL_ROUGH 0.02","#define DISCARD_ALPHA (alphaTest / (2.2 - 1.2 * ratio))","uniform sampler2D map;","uniform vec3 color;","uniform float opacity;","uniform float alphaTest;","varying vec2 vUV;","float median(float r, float g, float b) {"," return max(min(r, g), min(max(r, g), b));","}","void main() {"," vec3 sample = 1.0 - texture2D(map, vUV).rgb;"," float sigDist = median(sample.r, sample.g, sample.b) - 0.5;"," float alpha = clamp(sigDist/fwidth(sigDist) + 0.5, 0.0, 1.0);"," float dscale = 0.353505;"," vec2 duv = dscale * (dFdx(vUV) + dFdy(vUV));"," float isBigEnough = max(abs(duv.x), abs(duv.y));"," if (isBigEnough > BIG_ENOUGH) {"," float ratio = BIG_ENOUGH / isBigEnough;"," alpha = ratio * alpha + (1.0 - ratio) * (sigDist + 0.5);"," }"," if (isBigEnough <= BIG_ENOUGH && alpha < alphaTest) { discard; return; }"," if (alpha < alphaTest * MODIFIED_ALPHATEST) { discard; return; }"," gl_FragColor = vec4(color.xyz, alpha * opacity);","}"].join("\n")});
  550. },{"../core/shader":135}],179:[function(_dereq_,module,exports){
  551. var registerShader=_dereq_("../core/shader").registerShader;module.exports.Shader=registerShader("sdf",{schema:{alphaTest:{type:"number",is:"uniform",default:.5},color:{type:"color",is:"uniform",default:"white"},map:{type:"map",is:"uniform"},opacity:{type:"number",is:"uniform",default:1}},raw:!0,vertexShader:["attribute vec2 uv;","attribute vec3 position;","uniform mat4 projectionMatrix;","uniform mat4 modelViewMatrix;","varying vec2 vUV;","void main(void) {"," gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);"," vUV = uv;","}"].join("\n"),fragmentShader:["#ifdef GL_OES_standard_derivatives","#extension GL_OES_standard_derivatives: enable","#endif","precision highp float;","#define BIG_ENOUGH 0.001","#define MODIFIED_ALPHATEST (0.02 * isBigEnough / BIG_ENOUGH)","#define ALL_SMOOTH 0.4","#define ALL_ROUGH 0.02","#define DISCARD_ALPHA (alphaTest / (2.2 - 1.2 * ratio))","uniform sampler2D map;","uniform vec3 color;","uniform float opacity;","uniform float alphaTest;","varying vec2 vUV;","#ifdef GL_OES_standard_derivatives","float contour(float width, float value) {"," return smoothstep(0.5 - value, 0.5 + value, width);","}","#else","float aastep(float value, float afwidth) {"," return smoothstep(0.5 - afwidth, 0.5 + afwidth, value);","}","#endif","void main() {","#ifdef GL_OES_standard_derivatives"," vec2 uv = vUV;"," vec4 texColor = texture2D(map, uv);"," float dist = texColor.a;"," float width = fwidth(dist);"," float alpha = contour(dist, width);"," float dscale = 0.353505;"," vec2 duv = dscale * (dFdx(uv) + dFdy(uv));"," float isBigEnough = max(abs(duv.x), abs(duv.y));"," if (isBigEnough > BIG_ENOUGH) {"," float ratio = BIG_ENOUGH / isBigEnough;"," alpha = ratio * alpha + (1.0 - ratio) * dist;"," }"," else if (isBigEnough <= BIG_ENOUGH) {"," vec4 box = vec4 (uv - duv, uv + duv);"," alpha = (alpha + 0.5 * ("," contour(texture2D(map, box.xy).a, width)"," + contour(texture2D(map, box.zw).a, width)"," + contour(texture2D(map, box.xw).a, width)"," + contour(texture2D(map, box.zy).a, width)"," )) / 3.0;"," }"," if (isBigEnough <= BIG_ENOUGH && alpha < alphaTest) { discard; return; }"," if (alpha < alphaTest * MODIFIED_ALPHATEST) { discard; return; }","#else"," vec4 texColor = texture2D(map, vUV);"," float value = texColor.a;"," float afwidth = (1.0 / 32.0) * (1.4142135623730951 / (2.0 * gl_FragCoord.w));"," float alpha = aastep(value, afwidth);"," float ratio = (gl_FragCoord.w >= ALL_SMOOTH) ? 1.0 : (gl_FragCoord.w < ALL_ROUGH) ? 0.0 : (gl_FragCoord.w - ALL_ROUGH) / (ALL_SMOOTH - ALL_ROUGH);"," if (alpha < alphaTest) { if (ratio >= 1.0) { discard; return; } alpha = 0.0; }"," alpha = alpha * ratio + (1.0 - ratio) * value;"," if (ratio < 1.0)"," if (alpha <= DISCARD_ALPHA) { discard; return; }","#endif"," gl_FragColor = vec4(color, opacity * alpha);","}"].join("\n")});
  552. },{"../core/shader":135}],180:[function(_dereq_,module,exports){
  553. function getMaterialData(e){var t={color:new THREE.Color(e.color),emissive:new THREE.Color(e.emissive),emissiveIntensity:e.emissiveIntensity,fog:e.fog,metalness:e.metalness,roughness:e.roughness,wireframe:e.wireframe,wireframeLinewidth:e.wireframeLinewidth};return e.normalMap&&(t.normalScale=e.normalScale),e.ambientOcclusionMap&&(t.aoMapIntensity=e.ambientOcclusionMapIntensity),e.displacementMap&&(t.displacementScale=e.displacementScale,t.displacementBias=e.displacementBias),t}var registerShader=_dereq_("../core/shader").registerShader,THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/"),CubeLoader=new THREE.CubeTextureLoader,texturePromises={};module.exports.Shader=registerShader("standard",{schema:{ambientOcclusionMap:{type:"map"},ambientOcclusionMapIntensity:{default:1},ambientOcclusionTextureOffset:{type:"vec2"},ambientOcclusionTextureRepeat:{type:"vec2",default:{x:1,y:1}},color:{type:"color"},displacementMap:{type:"map"},displacementScale:{default:1},displacementBias:{default:.5},displacementTextureOffset:{type:"vec2"},displacementTextureRepeat:{type:"vec2",default:{x:1,y:1}},emissive:{type:"color",default:"#000"},emissiveIntensity:{default:1},envMap:{default:""},fog:{default:!0},height:{default:256},metalness:{default:0,min:0,max:1},metalnessMap:{type:"map"},metalnessTextureOffset:{type:"vec2"},metalnessTextureRepeat:{type:"vec2",default:{x:1,y:1}},normalMap:{type:"map"},normalScale:{type:"vec2",default:{x:1,y:1}},normalTextureOffset:{type:"vec2"},normalTextureRepeat:{type:"vec2",default:{x:1,y:1}},offset:{type:"vec2",default:{x:0,y:0}},repeat:{type:"vec2",default:{x:1,y:1}},roughness:{default:.5,min:0,max:1},roughnessMap:{type:"map"},roughnessTextureOffset:{type:"vec2"},roughnessTextureRepeat:{type:"vec2",default:{x:1,y:1}},sphericalEnvMap:{type:"map"},src:{type:"map"},width:{default:512},wireframe:{default:!1},wireframeLinewidth:{default:2}},init:function(e){this.material=new THREE.MeshStandardMaterial(getMaterialData(e)),utils.material.updateMap(this,e),e.normalMap&&utils.material.updateDistortionMap("normal",this,e),e.displacementMap&&utils.material.updateDistortionMap("displacement",this,e),e.ambientOcclusionMap&&utils.material.updateDistortionMap("ambientOcclusion",this,e),e.metalnessMap&&utils.material.updateDistortionMap("metalness",this,e),e.roughnessMap&&utils.material.updateDistortionMap("roughness",this,e),this.updateEnvMap(e)},update:function(e){this.updateMaterial(e),utils.material.updateMap(this,e),e.normalMap&&utils.material.updateDistortionMap("normal",this,e),e.displacementMap&&utils.material.updateDistortionMap("displacement",this,e),e.ambientOcclusionMap&&utils.material.updateDistortionMap("ambientOcclusion",this,e),e.metalnessMap&&utils.material.updateDistortionMap("metalness",this,e),e.roughnessMap&&utils.material.updateDistortionMap("roughness",this,e),this.updateEnvMap(e)},updateMaterial:function(e){var t=this.material;e=getMaterialData(e),Object.keys(e).forEach(function(a){t[a]=e[a]})},updateEnvMap:function(e){var t=this,a=this.material,i=e.envMap,s=e.sphericalEnvMap;return!i&&!s||this.isLoadingEnvMap?(a.envMap=null,void(a.needsUpdate=!0)):(this.isLoadingEnvMap=!0,s?void this.el.sceneEl.systems.material.loadTexture(s,{src:s},function(e){t.isLoadingEnvMap=!1,e.mapping=THREE.SphericalReflectionMapping,a.envMap=e,utils.material.handleTextureEvents(t.el,e),a.needsUpdate=!0}):texturePromises[i]?void texturePromises[i].then(function(e){t.isLoadingEnvMap=!1,a.envMap=e,utils.material.handleTextureEvents(t.el,e),a.needsUpdate=!0}):void(texturePromises[i]=new Promise(function(e){utils.srcLoader.validateCubemapSrc(i,function(i){CubeLoader.load(i,function(i){t.isLoadingEnvMap=!1,a.envMap=i,utils.material.handleTextureEvents(t.el,i),e(i)})})})))}});
  554. },{"../core/shader":135,"../lib/three":174,"../utils/":196}],181:[function(_dereq_,module,exports){
  555. var css = ".a-html{bottom:0;left:0;position:fixed;right:0;top:0;--caca:0}.a-body{height:100%;margin:0;overflow:hidden;padding:0;width:100%}:-webkit-full-screen{background-color:transparent}.a-hidden{display:none!important}.a-canvas{height:100%;left:0;position:absolute;top:0;width:100%}.a-canvas.a-grab-cursor:hover{cursor:grab;cursor:-moz-grab;cursor:-webkit-grab}.a-canvas.a-grab-cursor:active,.a-grabbing{cursor:grabbing;cursor:-moz-grabbing;cursor:-webkit-grabbing}// Class is removed when doing <a-scene embedded>. a-scene.fullscreen .a-canvas{width:100%!important;height:100%!important;top:0!important;left:0!important;right:0!important;bottom:0!important;z-index:999999!important;position:fixed!important}.a-inspector-loader{background-color:#ed3160;position:fixed;left:3px;top:3px;padding:6px 10px;color:#fff;text-decoration:none;font-size:12px;font-family:Roboto,sans-serif;text-align:center;z-index:99999;width:204px}@keyframes dots-1{from{opacity:0}25%{opacity:1}}@keyframes dots-2{from{opacity:0}50%{opacity:1}}@keyframes dots-3{from{opacity:0}75%{opacity:1}}@-webkit-keyframes dots-1{from{opacity:0}25%{opacity:1}}@-webkit-keyframes dots-2{from{opacity:0}50%{opacity:1}}@-webkit-keyframes dots-3{from{opacity:0}75%{opacity:1}}.a-inspector-loader .dots span{animation:dots-1 2s infinite steps(1);-webkit-animation:dots-1 2s infinite steps(1)}.a-inspector-loader .dots span:first-child+span{animation-name:dots-2;-webkit-animation-name:dots-2}.a-inspector-loader .dots span:first-child+span+span{animation-name:dots-3;-webkit-animation-name:dots-3}a-scene{display:block;position:relative;height:100%;width:100%}a-assets,a-scene audio,a-scene img,a-scene video{display:none}.a-enter-vr-modal,.a-orientation-modal{font-family:Consolas,Andale Mono,Courier New,monospace}.a-enter-vr-modal a{border-bottom:1px solid #fff;padding:2px 0;text-decoration:none;transition:.1s color ease-in}.a-enter-vr-modal a:hover{background-color:#fff;color:#111;padding:2px 4px;position:relative;left:-4px}.a-enter-vr{font-family:sans-serif,monospace;font-size:13px;width:100%;font-weight:200;line-height:16px;position:absolute;right:20px;bottom:20px}.a-enter-vr.embedded{right:5px;bottom:5px}.a-enter-vr-button,.a-enter-vr-modal,.a-enter-vr-modal a{color:#fff}.a-enter-vr-button{background:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20245.82%20141.73%22%3E%3Cdefs%3E%3Cstyle%3E.a%7Bfill%3A%23fff%3Bfill-rule%3Aevenodd%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Emask%3C%2Ftitle%3E%3Cpath%20class%3D%22a%22%20d%3D%22M175.56%2C111.37c-22.52%2C0-40.77-18.84-40.77-42.07S153%2C27.24%2C175.56%2C27.24s40.77%2C18.84%2C40.77%2C42.07S198.08%2C111.37%2C175.56%2C111.37ZM26.84%2C69.31c0-23.23%2C18.25-42.07%2C40.77-42.07s40.77%2C18.84%2C40.77%2C42.07-18.26%2C42.07-40.77%2C42.07S26.84%2C92.54%2C26.84%2C69.31ZM27.27%2C0C11.54%2C0%2C0%2C12.34%2C0%2C28.58V110.9c0%2C16.24%2C11.54%2C30.83%2C27.27%2C30.83H99.57c2.17%2C0%2C4.19-1.83%2C5.4-3.7L116.47%2C118a8%2C8%2C0%2C0%2C1%2C12.52-.18l11.51%2C20.34c1.2%2C1.86%2C3.22%2C3.61%2C5.39%2C3.61h72.29c15.74%2C0%2C27.63-14.6%2C27.63-30.83V28.58C245.82%2C12.34%2C233.93%2C0%2C218.19%2C0H27.27Z%22%2F%3E%3C%2Fsvg%3E) 50% 50%/70% 70% no-repeat rgba(0,0,0,.35);border:0;bottom:0;cursor:pointer;min-width:50px;min-height:30px;padding-right:5%;padding-top:4%;position:absolute;right:0;transition:background-color .05s ease;-webkit-transition:background-color .05s ease;z-index:9999}.a-enter-vr-button:active,.a-enter-vr-button:hover{background-color:#666}[data-a-enter-vr-no-webvr] .a-enter-vr-button{border-color:#666;opacity:.65}[data-a-enter-vr-no-webvr] .a-enter-vr-button:active,[data-a-enter-vr-no-webvr] .a-enter-vr-button:hover{background-color:rgba(0,0,0,.35);cursor:not-allowed}.a-enter-vr-modal{background-color:#666;border-radius:0;display:none;min-height:32px;margin-right:70px;padding:9px;width:280px;right:2%;position:absolute}.a-enter-vr-modal:after{border-bottom:10px solid transparent;border-left:10px solid #666;border-top:10px solid transparent;display:inline-block;content:'';position:absolute;right:-5px;top:5px;width:0;height:0}.a-enter-vr-modal a,.a-enter-vr-modal p{display:inline}.a-enter-vr-modal p{margin:0}.a-enter-vr-modal p:after{content:' '}[data-a-enter-vr-no-headset].a-enter-vr:hover .a-enter-vr-modal,[data-a-enter-vr-no-webvr].a-enter-vr:hover .a-enter-vr-modal{display:block}.a-orientation-modal{background:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20xmlns%3Axlink%3D%22http%3A//www.w3.org/1999/xlink%22%20version%3D%221.1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%2090%2090%22%20enable-background%3D%22new%200%200%2090%2090%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20points%3D%220%2C0%200%2C0%200%2C0%20%22%3E%3C/polygon%3E%3Cg%3E%3Cpath%20d%3D%22M71.545%2C48.145h-31.98V20.743c0-2.627-2.138-4.765-4.765-4.765H18.456c-2.628%2C0-4.767%2C2.138-4.767%2C4.765v42.789%20%20%20c0%2C2.628%2C2.138%2C4.766%2C4.767%2C4.766h5.535v0.959c0%2C2.628%2C2.138%2C4.765%2C4.766%2C4.765h42.788c2.628%2C0%2C4.766-2.137%2C4.766-4.765V52.914%20%20%20C76.311%2C50.284%2C74.173%2C48.145%2C71.545%2C48.145z%20M18.455%2C16.935h16.344c2.1%2C0%2C3.808%2C1.708%2C3.808%2C3.808v27.401H37.25V22.636%20%20%20c0-0.264-0.215-0.478-0.479-0.478H16.482c-0.264%2C0-0.479%2C0.214-0.479%2C0.478v36.585c0%2C0.264%2C0.215%2C0.478%2C0.479%2C0.478h7.507v7.644%20%20%20h-5.534c-2.101%2C0-3.81-1.709-3.81-3.81V20.743C14.645%2C18.643%2C16.354%2C16.935%2C18.455%2C16.935z%20M16.96%2C23.116h19.331v25.031h-7.535%20%20%20c-2.628%2C0-4.766%2C2.139-4.766%2C4.768v5.828h-7.03V23.116z%20M71.545%2C73.064H28.757c-2.101%2C0-3.81-1.708-3.81-3.808V52.914%20%20%20c0-2.102%2C1.709-3.812%2C3.81-3.812h42.788c2.1%2C0%2C3.809%2C1.71%2C3.809%2C3.812v16.343C75.354%2C71.356%2C73.645%2C73.064%2C71.545%2C73.064z%22%3E%3C/path%3E%3Cpath%20d%3D%22M28.919%2C58.424c-1.466%2C0-2.659%2C1.193-2.659%2C2.66c0%2C1.466%2C1.193%2C2.658%2C2.659%2C2.658c1.468%2C0%2C2.662-1.192%2C2.662-2.658%20%20%20C31.581%2C59.617%2C30.387%2C58.424%2C28.919%2C58.424z%20M28.919%2C62.786c-0.939%2C0-1.703-0.764-1.703-1.702c0-0.939%2C0.764-1.704%2C1.703-1.704%20%20%20c0.94%2C0%2C1.705%2C0.765%2C1.705%2C1.704C30.623%2C62.022%2C29.858%2C62.786%2C28.919%2C62.786z%22%3E%3C/path%3E%3Cpath%20d%3D%22M69.654%2C50.461H33.069c-0.264%2C0-0.479%2C0.215-0.479%2C0.479v20.288c0%2C0.264%2C0.215%2C0.478%2C0.479%2C0.478h36.585%20%20%20c0.263%2C0%2C0.477-0.214%2C0.477-0.478V50.939C70.131%2C50.676%2C69.917%2C50.461%2C69.654%2C50.461z%20M69.174%2C51.417V70.75H33.548V51.417H69.174z%22%3E%3C/path%3E%3Cpath%20d%3D%22M45.201%2C30.296c6.651%2C0%2C12.233%2C5.351%2C12.551%2C11.977l-3.033-2.638c-0.193-0.165-0.507-0.142-0.675%2C0.048%20%20%20c-0.174%2C0.198-0.153%2C0.501%2C0.045%2C0.676l3.883%2C3.375c0.09%2C0.075%2C0.198%2C0.115%2C0.312%2C0.115c0.141%2C0%2C0.273-0.061%2C0.362-0.166%20%20%20l3.371-3.877c0.173-0.2%2C0.151-0.502-0.047-0.675c-0.194-0.166-0.508-0.144-0.676%2C0.048l-2.592%2C2.979%20%20%20c-0.18-3.417-1.629-6.605-4.099-9.001c-2.538-2.461-5.877-3.817-9.404-3.817c-0.264%2C0-0.479%2C0.215-0.479%2C0.479%20%20%20C44.72%2C30.083%2C44.936%2C30.296%2C45.201%2C30.296z%22%3E%3C/path%3E%3C/g%3E%3C/svg%3E) center/50% 50% no-repeat rgba(244,244,244,1);bottom:0;font-size:14px;font-weight:600;left:0;line-height:20px;right:0;position:fixed;top:0;z-index:9999999}.a-orientation-modal:after{color:#666;content:\"Insert phone into Cardboard holder.\";display:block;position:absolute;text-align:center;top:70%;transform:translateY(-70%);width:100%}.a-orientation-modal button{background:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20xmlns%3Axlink%3D%22http%3A//www.w3.org/1999/xlink%22%20version%3D%221.1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%20100%20100%22%20enable-background%3D%22new%200%200%20100%20100%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23000000%22%20d%3D%22M55.209%2C50l17.803-17.803c1.416-1.416%2C1.416-3.713%2C0-5.129c-1.416-1.417-3.713-1.417-5.129%2C0L50.08%2C44.872%20%20L32.278%2C27.069c-1.416-1.417-3.714-1.417-5.129%2C0c-1.417%2C1.416-1.417%2C3.713%2C0%2C5.129L44.951%2C50L27.149%2C67.803%20%20c-1.417%2C1.416-1.417%2C3.713%2C0%2C5.129c0.708%2C0.708%2C1.636%2C1.062%2C2.564%2C1.062c0.928%2C0%2C1.856-0.354%2C2.564-1.062L50.08%2C55.13l17.803%2C17.802%20%20c0.708%2C0.708%2C1.637%2C1.062%2C2.564%2C1.062s1.856-0.354%2C2.564-1.062c1.416-1.416%2C1.416-3.713%2C0-5.129L55.209%2C50z%22%3E%3C/path%3E%3C/svg%3E) no-repeat;border:none;height:50px;text-indent:-9999px;width:50px}"; (_dereq_("browserify-css").createStyle(css, { "href": "src/style/aframe.css"})); module.exports = css;
  556. },{"browserify-css":5}],182:[function(_dereq_,module,exports){
  557. var css = ".rs-base{background-color:#333;color:#fafafa;border-radius:0;font:10px monospace;left:5px;line-height:1em;opacity:.85;overflow:hidden;padding:10px;position:fixed;top:5px;width:300px;z-index:10000}.rs-base div.hidden{display:none}.rs-base h1{color:#fff;cursor:pointer;font-size:1.4em;font-weight:300;margin:0 0 5px;padding:0}.rs-group{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-direction:column-reverse;flex-direction:column-reverse;margin-bottom:5px}.rs-group:last-child{margin-bottom:0}.rs-counter-base{align-items:center;display:-webkit-box;display:-webkit-flex;display:flex;height:10px;-webkit-justify-content:space-between;justify-content:space-between;margin:2px 0}.rs-counter-base.alarm{color:#b70000;text-shadow:0 0 0 #b70000,0 0 1px #fff,0 0 1px #fff,0 0 2px #fff,0 0 2px #fff,0 0 3px #fff,0 0 3px #fff,0 0 4px #fff,0 0 4px #fff}.rs-counter-id{font-weight:300;-webkit-box-ordinal-group:0;-webkit-order:0;order:0;width:54px}.rs-counter-value{font-weight:300;-webkit-box-ordinal-group:1;-webkit-order:1;order:1;text-align:right;width:35px}.rs-canvas{-webkit-box-ordinal-group:2;-webkit-order:2;order:2}@media (min-width:480px){.rs-base{left:20px;top:20px}}"; (_dereq_("browserify-css").createStyle(css, { "href": "src/style/rStats.css"})); module.exports = css;
  558. },{"browserify-css":5}],183:[function(_dereq_,module,exports){
  559. function removeDefaultCamera(e){var t,a=e.camera;a&&(t=e.querySelector("["+DEFAULT_CAMERA_ATTR+"]"),t&&e.removeChild(t))}var bind=_dereq_("../utils/bind"),constants=_dereq_("../constants/"),registerSystem=_dereq_("../core/system").registerSystem,DEFAULT_CAMERA_ATTR="data-aframe-default-camera";module.exports.System=registerSystem("camera",{init:function(){this.activeCameraEl=null,this.sceneEl.addEventListener("loaded",bind(this.setupDefaultCamera,this))},setupDefaultCamera:function(){var e,t,a=this.sceneEl;return a.camera&&!a.camera.el.getAttribute("camera").spectator?void a.emit("camera-ready",{cameraEl:a.camera.el}):(t=document.createElement("a-entity"),t.setAttribute("position",{x:0,y:constants.DEFAULT_CAMERA_HEIGHT,z:0}),e=document.createElement("a-entity"),e.setAttribute("camera",{active:!0}),e.setAttribute("wasd-controls",""),e.setAttribute("look-controls",""),e.setAttribute(constants.AFRAME_INJECTED,""),t.setAttribute(DEFAULT_CAMERA_ATTR,""),t.appendChild(e),a.appendChild(t),a.addEventListener("enter-vr",this.removeDefaultOffset),a.addEventListener("exit-vr",this.addDefaultOffset),void a.emit("camera-ready",{cameraEl:e}))},disableActiveCamera:function(){var e=this.sceneEl.querySelectorAll("[camera]"),t=e[e.length-1];t.setAttribute("camera","active",!0)},setActiveCamera:function(e){var t,a,r,i,c=this.activeCameraEl,s=this.sceneEl;if(i=e.getObject3D("camera"),i&&e!==this.activeCameraEl){var m=s.querySelector("["+DEFAULT_CAMERA_ATTR+"]"),n=m&&m.querySelector("[camera]");for(e!==n&&removeDefaultCamera(s),this.activeCameraEl=e,this.activeCameraEl.play(),s.camera=i,c&&c.setAttribute("camera","active",!1),a=s.querySelectorAll("[camera]"),r=0;r<a.length;r++)t=a[r],t.isEntity&&e!==t&&(t.setAttribute("camera","active",!1),t.pause());s.emit("camera-set-active",{cameraEl:e})}},setSpectatorCamera:function(e){var t,a,r=this.spectatorCameraEl,i=this.sceneEl;t=e.getObject3D("camera"),t&&e!==this.spectatorCameraEl&&(r&&r.setAttribute("camera","spectator",!1),a=this.spectatorCameraEl=e,a.setAttribute("camera","active",!1),a.play(),i.emit("camera-set-spectator",{cameraEl:e}))},disableSpectatorCamera:function(){this.spectatorCameraEl=void 0},tock:function(){var e,t=this.sceneEl,a=t.renderer.vr.enabled;this.spectatorCameraEl&&!t.isMobile&&(e=this.spectatorCameraEl.components.camera.camera,t.renderer.vr.enabled=!1,t.renderer.render(t.object3D,e),t.renderer.vr.enabled=a)}});
  560. },{"../constants/":117,"../core/system":136,"../utils/bind":190}],184:[function(_dereq_,module,exports){
  561. function createGeometry(e){var t=e.primitive,r=geometries[t]&&geometries[t].Geometry,o=new r;if(!r)throw new Error("Unknown geometry `"+t+"`");return o.init(e),toBufferGeometry(o.geometry,e.buffer)}function decrementCacheCount(e,t){e[t]--}function incrementCacheCount(e,t){e[t]=void 0===e[t]?1:e[t]+1}function toBufferGeometry(e,t){var r;return t?(r=(new THREE.BufferGeometry).fromGeometry(e),r.metadata={type:e.type,parameters:e.parameters||{}},e.dispose(),r):e}var geometries=_dereq_("../core/geometry").geometries,registerSystem=_dereq_("../core/system").registerSystem,THREE=_dereq_("../lib/three");module.exports.System=registerSystem("geometry",{init:function(){this.cache={},this.cacheCount={}},clearCache:function(){this.cache={},this.cacheCount={}},getOrCreateGeometry:function(e){var t,r,o=this.cache;return e.skipCache?createGeometry(e):(r=this.hash(e),t=o[r],incrementCacheCount(this.cacheCount,r),t?t:(t=createGeometry(e),o[r]=t,t))},unuseGeometry:function(e){var t,r,o=this.cache,i=this.cacheCount;e.skipCache||(r=this.hash(e),o[r]&&(decrementCacheCount(i,r),i[r]>0||(t=o[r],t.dispose(),delete o[r],delete i[r])))},hash:function(e){return JSON.stringify(e)}});
  562. },{"../core/geometry":127,"../core/system":136,"../lib/three":174}],185:[function(_dereq_,module,exports){
  563. _dereq_("./camera"),_dereq_("./geometry"),_dereq_("./light"),_dereq_("./material"),_dereq_("./shadow"),_dereq_("./tracked-controls");
  564. },{"./camera":183,"./geometry":184,"./light":186,"./material":187,"./shadow":188,"./tracked-controls":189}],186:[function(_dereq_,module,exports){
  565. var registerSystem=_dereq_("../core/system").registerSystem,bind=_dereq_("../utils/bind"),constants=_dereq_("../constants/"),DEFAULT_LIGHT_ATTR="data-aframe-default-light";module.exports.System=registerSystem("light",{schema:{defaultLightsEnabled:{default:!0}},init:function(){this.defaultLights=!1,this.userDefinedLights=!1,this.sceneEl.addEventListener("loaded",bind(this.setupDefaultLights,this))},registerLight:function(t){t.hasAttribute(DEFAULT_LIGHT_ATTR)||(this.removeDefaultLights(),this.userDefinedLights=!0)},removeDefaultLights:function(){var t,e=this.sceneEl;if(this.defaultLights){t=document.querySelectorAll("["+DEFAULT_LIGHT_ATTR+"]");for(var i=0;i<t.length;i++)e.removeChild(t[i]);this.defaultLights=!1}},setupDefaultLights:function(){var t,e,i=this.sceneEl;this.userDefinedLights||this.defaultLights||!this.data.defaultLightsEnabled||(t=document.createElement("a-entity"),t.setAttribute("light",{color:"#BBB",type:"ambient"}),t.setAttribute(DEFAULT_LIGHT_ATTR,""),t.setAttribute(constants.AFRAME_INJECTED,""),i.appendChild(t),e=document.createElement("a-entity"),e.setAttribute("light",{color:"#FFF",intensity:.6,castShadow:!0}),e.setAttribute("position",{x:-.5,y:1,z:1}),e.setAttribute(DEFAULT_LIGHT_ATTR,""),e.setAttribute(constants.AFRAME_INJECTED,""),i.appendChild(e),this.defaultLights=!0)}});
  566. },{"../constants/":117,"../core/system":136,"../utils/bind":190}],187:[function(_dereq_,module,exports){
  567. function calculateVideoCacheHash(e,t){var r,i,n,a=t.getAttribute("id");if(a)return a;for(i="",n=e||{},r=0;r<t.attributes.length;r++)n[t.attributes[r].name]=t.attributes[r].value;return Object.keys(n).sort().forEach(function(e){i+=e+":"+n[e]+";"}),i}function loadImageTexture(e,t){function r(r,i){function n(e){setTextureProperties(e,t),e.needsUpdate=!0,r(e)}var a="string"!=typeof e;return a?void n(new THREE.Texture(e)):void TextureLoader.load(e,n,function(){},function(e){error("`$s` could not be fetched (Error code: %s; Response: %s)",e.status,e.statusText)})}return new Promise(r)}function setTextureProperties(e,t){var r=t.offset||{x:0,y:0},i=t.repeat||{x:1,y:1},n=t.npot||!1;n&&(e.wrapS=THREE.ClampToEdgeWrapping,e.wrapT=THREE.ClampToEdgeWrapping,e.magFilter=THREE.LinearFilter,e.minFilter=THREE.LinearFilter),1===i.x&&1===i.y||(e.wrapS=THREE.RepeatWrapping,e.wrapT=THREE.RepeatWrapping,e.repeat.set(i.x,i.y)),0===r.x&&0===r.y||e.offset.set(r.x,r.y)}function createVideoEl(e,t,r){var i=document.createElement("video");return i.width=t,i.height=r,i.setAttribute("playsinline",""),i.setAttribute("webkit-playsinline",""),i.autoplay=!0,i.loop=!0,i.crossOrigin="anonymous",i.addEventListener("error",function(){warn("`$s` is not a valid video",e)},!0),i.src=e,i}function fixVideoAttributes(e){return e.autoplay=e.hasAttribute("autoplay")&&"false"!==e.getAttribute("autoplay"),e.controls=e.hasAttribute("controls")&&"false"!==e.getAttribute("controls"),"false"===e.getAttribute("loop")&&e.removeAttribute("loop"),"false"===e.getAttribute("preload")&&(e.preload="none"),e.crossOrigin=e.crossOrigin||"anonymous",e.setAttribute("playsinline",""),e.setAttribute("webkit-playsinline",""),e}var registerSystem=_dereq_("../core/system").registerSystem,THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/"),isHLS=_dereq_("../utils/material").isHLS,bind=utils.bind,debug=utils.debug,error=debug("components:texture:error"),TextureLoader=new THREE.TextureLoader,warn=debug("components:texture:warn");TextureLoader.setCrossOrigin("anonymous"),module.exports.System=registerSystem("material",{init:function(){this.materials={},this.textureCounts={},this.textureCache={},this.sceneEl.addEventListener("materialtextureloaded",bind(this.onMaterialTextureLoaded,this))},clearTextureCache:function(){this.textureCache={}},loadTexture:function(e,t,r){function i(e){a.loadImage(e,t,r)}function n(e){a.loadVideo(e,t,r)}var a=this;return"CANVAS"===e.tagName?void this.loadCanvas(e,t,r):"VIDEO"===e.tagName?(e.src||e.srcObject||e.childElementCount||warn("Video element was defined with neither `source` elements nor `src` / `srcObject` attributes."),void this.loadVideo(e,t,r)):void utils.srcLoader.validateSrc(e,i,n)},loadImage:function(e,t,r){var i=this.hash(t),n=this.textureCache;return n[i]?void n[i].then(r):(n[i]=loadImageTexture(e,t),void n[i].then(r))},loadCanvas:function(e,t,r){e.readyState=2,e.HAVE_CURRENT_DATA=2,this.loadVideo(e,t,r)},loadVideo:function(e,t,r){function i(e){e.texture.needsUpdate=!0,r(e.texture,e.videoEl)}var n,a,o,s,u=this.textureCache;if("string"!=typeof e){if(o=e,n=this.hashVideo(t,o),u[n])return void u[n].then(i);fixVideoAttributes(o)}return o=o||createVideoEl(e,t.width,t.height),n=this.hashVideo(t,o),u[n]?void u[n].then(i):(a=new THREE.VideoTexture(o),a.minFilter=THREE.LinearFilter,setTextureProperties(a,t),this.sceneEl.isIOS&&isHLS(o.src||o.getAttribute("src"),o.type||o.getAttribute("type"))&&(a.format=THREE.RGBAFormat,a.needsCorrectionBGRA=!0,a.flipY=!1,a.needsCorrectionFlipY=!0),s={texture:a,videoEl:o},u[n]=Promise.resolve(s),void i(s))},hash:function(e){return e.src.tagName&&(e=utils.extendDeep({},e),e.src=e.src.src),JSON.stringify(e)},hashVideo:function(e,t){return calculateVideoCacheHash(e,t)},registerMaterial:function(e){this.materials[e.uuid]=e},unregisterMaterial:function(e){delete this.materials[e.uuid];var t=this.textureCounts;Object.keys(e).filter(function(t){return e[t]&&e[t].isTexture}).forEach(function(r){t[e[r].uuid]--,t[e[r].uuid]<=0&&e[r].dispose()})},updateMaterials:function(e){var t=this.materials;Object.keys(t).forEach(function(e){t[e].needsUpdate=!0})},onMaterialTextureLoaded:function(e){this.textureCounts[e.detail.texture.uuid]||(this.textureCounts[e.detail.texture.uuid]=0),this.textureCounts[e.detail.texture.uuid]++}});
  568. },{"../core/system":136,"../lib/three":174,"../utils/":196,"../utils/material":197}],188:[function(_dereq_,module,exports){
  569. var registerSystem=_dereq_("../core/system").registerSystem,THREE=_dereq_("../lib/three"),SHADOW_MAP_TYPE_MAP={basic:THREE.BasicShadowMap,pcf:THREE.PCFShadowMap,pcfsoft:THREE.PCFSoftShadowMap};module.exports.System=registerSystem("shadow",{schema:{autoUpdate:{default:!0},renderReverseSided:{default:!0},renderSingleSided:{default:!0},type:{default:"pcf",oneOf:["basic","pcf","pcfsoft"]}},init:function(){var e=this.sceneEl,d=this.data;this.shadowMapEnabled=!1,e.renderer&&(e.renderer.shadowMap.type=SHADOW_MAP_TYPE_MAP[d.type],e.renderer.shadowMap.renderReverseSided=d.renderReverseSided,e.renderer.shadowMap.renderSingleSided=d.renderSingleSided,e.renderer.shadowMap.autoUpdate=d.autoUpdate,this.setShadowMapEnabled(this.shadowMapEnabled))},setShadowMapEnabled:function(e){var d=this.sceneEl.renderer;this.shadowMapEnabled=e,d&&(d.shadowMap.enabled=e)}});
  570. },{"../core/system":136,"../lib/three":174}],189:[function(_dereq_,module,exports){
  571. var registerSystem=_dereq_("../core/system").registerSystem,utils=_dereq_("../utils");module.exports.System=registerSystem("tracked-controls",{init:function(){var t=this;this.controllers=[],this.updateControllerList(navigator.getGamepads&&navigator.getGamepads()),this.throttledUpdateControllerList=utils.throttle(this.updateControllerList,500,this),navigator.getVRDisplays&&this.sceneEl.addEventListener("enter-vr",function(){navigator.getVRDisplays().then(function(e){e.length&&(t.vrDisplay=e[0])})})},tick:function(){var t;t=navigator.getGamepads&&navigator.getGamepads(),this.throttledUpdateControllerList(t)},updateControllerList:function(t){var e,r,s,i=this.controllers;if(t){for(s=i.length,i.length=0,r=0;r<t.length;++r)e=t[r],e&&e.pose&&i.push(e);i.length!==s&&this.el.emit("controllersupdated",void 0,!1)}}});
  572. },{"../core/system":136,"../utils":196}],190:[function(_dereq_,module,exports){
  573. module.exports=function(r,t){return function(n){return function(){var o=n.concat(Array.prototype.slice.call(arguments,0));return r.apply(t,o)}}(Array.prototype.slice.call(arguments,2))};
  574. },{}],191:[function(_dereq_,module,exports){
  575. function parse(e,r){var o,t;return e&&e instanceof Object?(r&&(e.x=void 0===e.x?r.x:e.x,e.y=void 0===e.y?r.y:e.y,e.z=void 0===e.z?r.z:e.z,e.w=void 0===e.w?r.w:e.w),vecParseFloat(e)):null===e||void 0===e?"object"==typeof r?extend({},r):r:(o=e.trim().replace(/\s+/g," ").split(" "),t={},t.x=o[0]||r&&r.x,t.y=o[1]||r&&r.y,t.z=o[2]||r&&r.z,t.w=o[3]||r&&r.w,vecParseFloat(t))}function stringify(e){return"object"!=typeof e?e:[e.x,e.y,e.z,e.w].join(" ").trim()}function isCoordinates(e){return regex.test(e)}function vecParseFloat(e){var r;for(r in e)void 0!==e[r]?e[r].constructor===String&&(e[r]=parseFloat(e[r],10)):delete e[r];return e}var debug=_dereq_("./debug"),extend=_dereq_("object-assign"),warn=debug("utils:coordinates:warn"),regex=/^\s*((-?\d*\.{0,1}\d+(e-?\d+)?)\s+){2,3}(-?\d*\.{0,1}\d+(e-?\d+)?)\s*$/;module.exports.regex=regex,module.exports.parse=parse,module.exports.stringify=stringify,module.exports.isCoordinates=isCoordinates,module.exports.isCoordinate=function(e){return warn("`AFRAME.utils.isCoordinate` has been renamed to `AFRAME.utils.isCoordinates`"),isCoordinates(e)},module.exports.toVector3=function(e){return new THREE.Vector3(e.x,e.y,e.z)};
  576. },{"./debug":192,"object-assign":26}],192:[function(_dereq_,module,exports){
  577. (function (process){
  578. function getDebugNamespaceType(e){var r=e.split(":");return r[r.length-1]}function getDebugNamespaceColor(e){var r=getDebugNamespaceType(e),o=settings.colors&&settings.colors[r];return o||null}function storage(){try{return window.localStorage}catch(e){}}var debugLib=_dereq_("debug"),extend=_dereq_("object-assign"),settings={colors:{debug:"gray",error:"red",info:"gray",warn:"orange"}},debug=function(e){var r=debugLib(e);return r.color=getDebugNamespaceColor(e),r};extend(debug,debugLib);var ls=storage();ls&&(parseInt(ls.logs,10)||"true"===ls.logs)?debug.enable("*"):debug.enable("*:error,*:info,*:warn"),process.browser&&(window.logs=debug),module.exports=debug;
  579. }).call(this,_dereq_('_process'))
  580. },{"_process":33,"debug":8,"object-assign":26}],193:[function(_dereq_,module,exports){
  581. (function (process){
  582. function getVRDisplay(){return vrDisplay}function checkHeadsetConnected(){return!!getVRDisplay()}function checkHasPositionalTracking(){var i=getVRDisplay();return!isMobile()&&!isGearVR()&&(i&&i.capabilities.hasPosition)}function isTablet(i){var e=i||window.navigator.userAgent;return/ipad|Nexus (7|9)|xoom|sch-i800|playbook|tablet|kindle/i.test(e)}function isIOS(){return/iPad|iPhone|iPod/.test(window.navigator.platform)}function isGearVR(){return/SamsungBrowser.+Mobile VR/i.test(window.navigator.userAgent)}function isR7(){return/R7 Build/.test(window.navigator.userAgent)}var vrDisplay,polyfilledVRDisplay,POLYFILL_VRDISPLAY_ID="Cardboard VRDisplay (webvr-polyfill)";navigator.getVRDisplays&&navigator.getVRDisplays().then(function(i){vrDisplay=i.length&&i[0],polyfilledVRDisplay=vrDisplay.displayName===POLYFILL_VRDISPLAY_ID}),module.exports.getVRDisplay=getVRDisplay,module.exports.checkHeadsetConnected=checkHeadsetConnected,module.exports.checkHasPositionalTracking=checkHasPositionalTracking;var isMobile=function(){var i=!1;return function(e){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(i=!0),(isIOS()||isTablet()||isR7())&&(i=!0)}(window.navigator.userAgent||window.navigator.vendor||window.opera),function(){return i}}();module.exports.isMobile=isMobile,module.exports.isTablet=isTablet,module.exports.isIOS=isIOS,module.exports.isGearVR=isGearVR,module.exports.isR7=isR7,module.exports.isLandscape=function(){var i=window.orientation;return isR7()&&(i+=90),90===i||i===-90},module.exports.isIOSOlderThan10=function(i){return/(iphone|ipod|ipad).*os.(7|8|9)/i.test(i)},module.exports.isBrowserEnvironment=!(process&&!process.browser),module.exports.isNodeEnvironment=!module.exports.isBrowserEnvironment,module.exports.PolyfillControls=function(i){var e;window.VRFrameData&&(e=new window.VRFrameData),this.update=function(){var o;vrDisplay&&polyfilledVRDisplay&&(vrDisplay.getFrameData(e),o=e.pose,null!==o.orientation&&i.quaternion.fromArray(o.orientation),null!==o.position?i.position.fromArray(o.position):i.position.set(0,0,0))}};
  583. }).call(this,_dereq_('_process'))
  584. },{"_process":33}],194:[function(_dereq_,module,exports){
  585. function getComponentPropertyPath(t,e){return e=e||".",propertyPathCache[e]||(propertyPathCache[e]={}),t.indexOf(e)!==-1?propertyPathCache[e][t]=t.split(e):propertyPathCache[e][t]=t,propertyPathCache[e][t]}var propertyPathCache={};module.exports.getComponentPropertyPath=getComponentPropertyPath,module.exports.propertyPathCache=propertyPathCache,module.exports.getComponentProperty=function(t,e,r){var o;return r=r||".",e.indexOf(r)!==-1?(o=getComponentPropertyPath(e,r),o.constructor===String?t.getAttribute(o):t.getAttribute(o[0])[o[1]]):t.getAttribute(e)},module.exports.setComponentProperty=function(t,e,r,o){var p;return o=o||".",e.indexOf(o)!==-1?(p=getComponentPropertyPath(e,o),void(p.constructor===String?t.setAttribute(p,r):t.setAttribute(p[0],p[1],r))):void t.setAttribute(e,r)};
  586. },{}],195:[function(_dereq_,module,exports){
  587. module.exports=function(t){var e=t.style.width,s=t.style.height;t.style.width=parseInt(e,10)+1+"px",t.style.height=parseInt(s,10)+1+"px",setTimeout(function(){t.style.width=e,t.style.height=s},200)};
  588. },{}],196:[function(_dereq_,module,exports){
  589. var debug=_dereq_("./debug"),deepAssign=_dereq_("deep-assign"),device=_dereq_("./device"),objectAssign=_dereq_("object-assign"),objectPool=_dereq_("./object-pool"),warn=debug("utils:warn");module.exports.bind=_dereq_("./bind"),module.exports.coordinates=_dereq_("./coordinates"),module.exports.debug=debug,module.exports.device=device,module.exports.entity=_dereq_("./entity"),module.exports.forceCanvasResizeSafariMobile=_dereq_("./forceCanvasResizeSafariMobile"),module.exports.material=_dereq_("./material"),module.exports.objectPool=objectPool,module.exports.styleParser=_dereq_("./styleParser"),module.exports.trackedControls=_dereq_("./tracked-controls"),module.exports.checkHeadsetConnected=function(){return warn("`utils.checkHeadsetConnected` has moved to `utils.device.checkHeadsetConnected`"),device.checkHeadsetConnected(arguments)},module.exports.isGearVR=function(){return warn("`utils.isGearVR` has moved to `utils.device.isGearVR`"),device.isGearVR(arguments)},module.exports.isIOS=function(){return warn("`utils.isIOS` has moved to `utils.device.isIOS`"),device.isIOS(arguments)},module.exports.isMobile=function(){return warn("`utils.isMobile has moved to `utils.device.isMobile`"),device.isMobile(arguments)},module.exports.throttle=function(e,r,t){var o;return t&&(e=module.exports.bind(e,t)),function(){var t=Date.now(),n="undefined"==typeof o?r:t-o;("undefined"==typeof o||n>=r)&&(o=t,e.apply(null,arguments))}},module.exports.throttleTick=function(e,r,t){var o;return t&&(e=module.exports.bind(e,t)),function(t,n){var u="undefined"==typeof o?n:t-o;("undefined"==typeof o||u>=r)&&(o=t,e(t,u))}},module.exports.debounce=function(e,r,t){var o;return function(){var n=this,u=arguments,i=function(){o=null,t||e.apply(n,u)},c=t&&!o;clearTimeout(o),o=setTimeout(i,r),c&&e.apply(n,u)}},module.exports.extend=objectAssign,module.exports.extendDeep=deepAssign,module.exports.clone=function(e){return JSON.parse(JSON.stringify(e))};var deepEqual=function(){var e=objectPool.createPool(function(){return[]});return function(r,t){var o,n,u,i,c,s;if(void 0===r||void 0===t||null===r||null===t||!(r&&t&&r.constructor===Object&&t.constructor===Object||r.constructor===Array&&t.constructor===Array))return r===t;n=e.use(),u=e.use(),n.length=0,u.length=0;for(o in r)n.push(o);for(o in t)u.push(o);if(n.length!==u.length)return e.recycle(n),e.recycle(u),!1;for(i=0;i<n.length;++i)if(c=r[n[i]],s=t[n[i]],"object"==typeof c||"object"==typeof s||Array.isArray(c)&&Array.isArray(s)){if(c===s)continue;if(!deepEqual(c,s))return e.recycle(n),e.recycle(u),!1}else if(c!==s)return e.recycle(n),e.recycle(u),!1;return e.recycle(n),e.recycle(u),!0}}();module.exports.deepEqual=deepEqual,module.exports.diff=function(){var e=[];return function(r,t,o){var n,u,i,c,s,l,d;c=o||{},e.length=0;for(s in r)e.push(s);if(!t)return c;for(i in t)e.indexOf(i)===-1&&e.push(i);for(l=0;l<e.length;l++)s=e[l],n=r[s],u=t[s],d=n&&u&&n.constructor===Object&&u.constructor===Object,(d&&!deepEqual(n,u)||!d&&n!==u)&&(c[s]=u);return c}}(),module.exports.shouldCaptureKeyEvent=function(e){return!e.metaKey&&document.activeElement===document.body},module.exports.splitString=function(e,r){"undefined"==typeof r&&(r=" ");var t=new RegExp(r,"g");return e=(e||"").replace(t,r),e.split(r)},module.exports.getElData=function(e,r){function t(r){e.hasAttribute(r)&&(o[r]=e.getAttribute(r))}r=r||{};var o={};return Object.keys(r).forEach(t),o},module.exports.getUrlParameter=function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var r=new RegExp("[\\?&]"+e+"=([^&#]*)"),t=r.exec(location.search);return null===t?"":decodeURIComponent(t[1].replace(/\+/g," "))},module.exports.isIframed=function(){return window.top!==window.self},module.exports.findAllScenes=function(e){for(var r=[],t=e.getElementsByTagName("*"),o=0,n=t.length;o<n;o++)t[o].isScene&&r.push(t[o]);return r},module.exports.srcLoader=_dereq_("./src-loader"),module.exports.split=function(){var e={};return function(r,t){return t in e||(e[t]={}),r in e[t]?e[t][r]:(e[t][r]=r.split(t),e[t][r])}}();
  590. },{"./bind":190,"./coordinates":191,"./debug":192,"./device":193,"./entity":194,"./forceCanvasResizeSafariMobile":195,"./material":197,"./object-pool":198,"./src-loader":199,"./styleParser":200,"./tracked-controls":201,"deep-assign":10,"object-assign":26}],197:[function(_dereq_,module,exports){
  591. function handleTextureEvents(e,t){t&&(e.emit("materialtextureloaded",{src:t.image,texture:t}),t.image&&"VIDEO"===t.image.tagName&&(t.image.addEventListener("loadeddata",function(){e.components&&e.components.material&&(t.needsCorrectionBGRA&&t.needsCorrectionFlipY&&["standard","flat"].indexOf(e.components.material.data.shader)!==-1&&e.setAttribute("material","shader","ios10hls"),e.emit("materialvideoloadeddata",{src:t.image,texture:t}))}),t.image.addEventListener("ended",function(){e.emit("materialvideoended",{src:t.image,texture:t})})))}var THREE=_dereq_("../lib/three"),HLS_MIMETYPES=["application/x-mpegurl","application/vnd.apple.mpegurl"];module.exports.updateMapMaterialFromData=function(e,t,a,r){function n(t){a.materialSrcs[e]===d&&i(t)}function i(t){s[e]=t,s.needsUpdate=!0,handleTextureEvents(o,t)}var o=a.el,s=a.material,d=r[t];return a.materialSrcs||(a.materialSrcs={}),d?void(d!==a.materialSrcs[e]&&(a.materialSrcs[e]=d,d instanceof THREE.Texture?i(d):o.sceneEl.systems.material.loadTexture(d,{src:d,repeat:r.repeat,offset:r.offset,npot:r.npot},n))):(delete a.materialSrcs[e],void i(null))},module.exports.updateMap=function(e,t){return module.exports.updateMapMaterialFromData("map","src",e,t)},module.exports.updateDistortionMap=function(e,t,a){function r(e){o[n+"Map"]=e,o.needsUpdate=!0,handleTextureEvents(i,e)}var n=e;"ambientOcclusion"===e&&(n="ao");var i=t.el,o=t.material,s=a[e+"Map"],d={};if(d.src=s,d.offset=a[e+"TextureOffset"],d.repeat=a[e+"TextureRepeat"],d.wrap=a[e+"TextureWrap"],s){if(s===t[e+"TextureSrc"])return;return t[e+"TextureSrc"]=s,void i.sceneEl.systems.material.loadTexture(s,d,r)}o.map&&r(null)},module.exports.handleTextureEvents=handleTextureEvents,module.exports.isHLS=function(e,t){return!(!t||!HLS_MIMETYPES.includes(t.toLowerCase()))||!!(e&&e.toLowerCase().indexOf(".m3u8")>0)};
  592. },{"../lib/three":174}],198:[function(_dereq_,module,exports){
  593. function defaultObjectFactory(){return{}}function clearObject(e){var t;if(e.constructor===Object)for(t in e)e[t]=void 0}var EMPTY_SLOT=Object.freeze(Object.create(null));module.exports.createPool=function(e){function t(){var e;return null!==o&&o!==l.length||r(l.length||5),e=l[o],l[o++]=EMPTY_SLOT,clearObject(e),e}function n(e){if(e instanceof Object)return null===o||o===-1?void(l[l.length]=e):void(l[--o]=e)}function r(t){var n,r;if(t=void 0===t?l.length:t,t>0&&null==o&&(o=0),t>0)for(n=l.length,l.length+=Number(t),r=n;r<l.length;r++)l[r]=e();return l.length}function c(){return l.length}var l=[],o=null;return e=e||defaultObjectFactory,{grow:r,pool:l,recycle:n,size:c,use:t}},module.exports.clearObject=clearObject;
  594. },{}],199:[function(_dereq_,module,exports){
  595. function validateSrc(e,a,t){checkIsImage(e,function(r){return r?void a(e):void t(e)})}function validateCubemapSrc(e,a){function t(e){s.push(e),6===s.length&&a(s)}var r,n,c,o="",s=[];for(n=0;n<5;n++)o+="(url\\((?:[^\\)]+)\\),\\s*)";if(o+="(url\\((?:[^\\)]+)\\)\\s*)",c=e.match(new RegExp(o)))for(n=1;n<7;n++)validateSrc(parseUrl(c[n]),t);else if(r=validateAndGetQuerySelector(e))return"A-CUBEMAP"===r.tagName&&r.srcs?a(r.srcs):void warn('Selector "%s" does not point to <a-cubemap>',e)}function parseUrl(e){var a=e.match(/\url\((.+)\)/);if(a)return a[1]}function checkIsImage(e,a){var t;return e.tagName?void a("IMG"===e.tagName):(t=new XMLHttpRequest,t.open("HEAD",e),t.addEventListener("load",function(r){var n;t.status>=200&&t.status<300?(n=t.getResponseHeader("Content-Type"),null==n?checkIsImageFallback(e,a):a(n.startsWith("image")?!0:!1)):checkIsImageFallback(e,a),t.abort()}),void t.send())}function checkIsImageFallback(e,a){function t(){a(!0)}function r(){a(!1)}var n=new Image;n.addEventListener("load",t),n.addEventListener("error",r),n.src=e}function validateAndGetQuerySelector(e){try{var a=document.querySelector(e);return a||warn('No element was found matching the selector: "%s"',e),a}catch(a){return void warn('"%s" is not a valid selector',e)}}var debug=_dereq_("./debug"),warn=debug("utils:src-loader:warn");module.exports={parseUrl:parseUrl,validateSrc:validateSrc,validateCubemapSrc:validateCubemapSrc};
  596. },{"./debug":192}],200:[function(_dereq_,module,exports){
  597. function toCamelCase(e){function r(e){return e[1].toUpperCase()}return e.replace(/-([a-z])/g,r)}function transformKeysToCamelCase(e){var r=Object.keys(e),t={};return r.forEach(function(r){var s=toCamelCase(r);t[s]=e[r]}),t}var styleParser=_dereq_("style-attr");module.exports.parse=function(e){var r;return"string"!=typeof e?e:(r=styleParser.parse(e),r[""]?e:transformKeysToCamelCase(r))},module.exports.stringify=function(e){return"string"==typeof e?e:styleParser.stringify(e)},module.exports.toCamelCase=toCamelCase,module.exports.transformKeysToCamelCase=transformKeysToCamelCase;
  598. },{"style-attr":36}],201:[function(_dereq_,module,exports){
  599. function isControllerPresent(e,n,t){var r,o,l=e.el.sceneEl,i=t.index||0;return!!n&&(!!(o=l&&l.systems["tracked-controls"])&&(r=o.controllers,!!r.length&&!!findMatchingController(r,null,n,t.hand,i)))}function findMatchingController(e,n,t,r,o){var l,i,s=0,d=o||0;for(i=0;i<e.length;i++)if(l=e[i],(!t||l.id.indexOf(t)!==-1)&&(t||l.id===n)&&(!r||!l.hand||r===l.hand)){if(r&&!l.hand&&(d=NUM_HANDS*o+(r===DEFAULT_HANDEDNESS?0:1)),s===d)return l;++s}}var DEFAULT_HANDEDNESS=_dereq_("../constants").DEFAULT_HANDEDNESS,AXIS_LABELS=["x","y","z","w"],NUM_HANDS=2;module.exports.checkControllerPresentAndSetup=function(e,n,t){var r=e.el,o=isControllerPresent(e,n,t);return e.controllerPresent&&!e.controllerEventsActive&&e.addEventListeners(),o===e.controllerPresent?o:(e.controllerPresent=o,void(o?(e.injectTrackedControls(),e.addEventListeners(),r.emit("controllerconnected",{name:e.name,component:e})):(e.removeEventListeners(),r.emit("controllerdisconnected",{name:e.name,component:e}))))},module.exports.isControllerPresent=isControllerPresent,module.exports.findMatchingController=findMatchingController,module.exports.emitIfAxesChanged=function(e,n,t){var r,o,l,i,s,d;for(o=Object.keys(n),s=0;s<o.length;s++){for(r=n[o[s]],l=!1,d=0;d<r.length;d++)t.detail.changed[r[d]]&&(l=!0);if(l){for(i={},d=0;d<r.length;d++)i[AXIS_LABELS[d]]=t.detail.axis[r[d]];e.el.emit(o[s]+"moved",i)}}},module.exports.onButtonEvent=function(e,n,t,r){var o=r?t.mapping[r]:t.mapping,l=o.buttons[e];t.el.emit(l+n),t.updateModel&&t.updateModel(l,n)};
  600. },{"../constants":117}],202:[function(_dereq_,module,exports){
  601. window.glStats=function(){function e(e,r){return function(){r.apply(this,arguments),e.apply(this,arguments)}}function r(){a("allcalls").set(s+i),a("drawElements").set(i),a("drawArrays").set(s),a("bindTexture").set(m),a("useProgram").set(d),a("glfaces").set(l),a("glvertices").set(c),a("glpoints").set(p)}function n(){s=0,i=0,d=0,l=0,c=0,p=0,m=0}function t(){}function o(e){a=e}var a=null,s=0,i=0,d=0,l=0,c=0,p=0,m=0;WebGLRenderingContext.prototype.drawArrays=e(WebGLRenderingContext.prototype.drawArrays,function(){s++,arguments[0]==this.POINTS?p+=arguments[2]:c+=arguments[2]}),WebGLRenderingContext.prototype.drawElements=e(WebGLRenderingContext.prototype.drawElements,function(){i++,l+=arguments[1]/3,c+=arguments[1]}),WebGLRenderingContext.prototype.useProgram=e(WebGLRenderingContext.prototype.useProgram,function(){d++}),WebGLRenderingContext.prototype.bindTexture=e(WebGLRenderingContext.prototype.bindTexture,function(){m++});var f={allcalls:{over:3e3,caption:"Calls (hook)"},drawelements:{caption:"drawElements (hook)"},drawarrays:{caption:"drawArrays (hook)"}},u=[{caption:"WebGL",values:["allcalls","drawelements","drawarrays","useprogram","bindtexture","glfaces","glvertices","glpoints"]}],y=[{base:"allcalls",steps:["drawelements","drawarrays"]}];return{update:r,start:n,end:t,attach:o,values:f,groups:u,fractions:y}},window.threeStats=function(e){function r(){a("renderer.info.memory.geometries").set(e.info.memory.geometries),a("renderer.info.programs").set(e.info.programs.length),a("renderer.info.memory.textures").set(e.info.memory.textures),a("renderer.info.render.calls").set(e.info.render.calls),a("renderer.info.render.faces").set(e.info.render.faces),a("renderer.info.render.points").set(e.info.render.points),a("renderer.info.render.vertices").set(e.info.render.vertices)}function n(){}function t(){}function o(e){a=e}var a=null,s={"renderer.info.memory.geometries":{caption:"Geometries"},"renderer.info.memory.textures":{caption:"Textures"},"renderer.info.programs":{caption:"Programs"},"renderer.info.render.calls":{caption:"Calls"},"renderer.info.render.faces":{caption:"Faces",over:1e3},"renderer.info.render.points":{caption:"Points"},"renderer.info.render.vertices":{caption:"Vertices"}},i=[{caption:"Three.js - Memory",values:["renderer.info.memory.geometries","renderer.info.programs","renderer.info.memory.textures"]},{caption:"Three.js - Render",values:["renderer.info.render.calls","renderer.info.render.faces","renderer.info.render.points","renderer.info.render.vertices"]}],d=[];return{update:r,start:n,end:t,attach:o,values:s,groups:i,fractions:d}},window.BrowserStats=function(){function e(e){var r=100,n=Math.floor(Math.log(e)/p);return Math.round(e*r/Math.pow(1024,n))/r}function r(){s=e(performance.memory.usedJSHeapSize),i=e(performance.memory.totalJSHeapSize),a("memory").set(s),a("total").set(i)}function n(){s=0}function t(){}function o(e){a=e}var a=null,s=0,i=0;window.performance&&!performance.memory&&(performance.memory={usedJSHeapSize:0,totalJSHeapSize:0}),0===performance.memory.totalJSHeapSize&&console.warn("totalJSHeapSize === 0... performance.memory is only available in Chrome .");var d={memory:{caption:"Used Memory",average:!0,avgMs:1e3,over:22},total:{caption:"Total Memory"}},l=[{caption:"Browser",values:["memory","total"]}],c=[{base:"total",steps:["memory"]}],p=Math.log(1024);return{update:r,start:n,end:t,attach:o,values:d,groups:l,fractions:c}},"object"==typeof module&&(module.exports={glStats:window.glStats,threeStats:window.threeStats,BrowserStats:window.BrowserStats});
  602. },{}],203:[function(_dereq_,module,exports){
  603. "use strict";!function(){"performance"in window==0&&(window.performance={});var e=window.performance;if("now"in e==0){var t=Date.now();e.timing&&e.timing.navigationStart&&(t=e.timing.navigationStart),e.now=function(){return Date.now()-t}}e.mark||(e.mark=function(){}),e.measure||(e.measure=function(){})}(),window.rStats=function(e){function t(e,t){for(var n=Object.keys(e),a=0,r=n.length;a<r;a++)t(n[a])}function n(e){var t=document.createElement("link");t.href=e,t.rel="stylesheet",t.type="text/css",document.getElementsByTagName("head")[0].appendChild(t)}function a(e,t,n){function a(){o.width=v,o.height=g,o.style.width=o.width+"px",o.style.height=o.height+"px",o.className="rs-canvas",e.appendChild(o),c.fillStyle="#444444",c.fillRect(0,0,o.width,o.height)}function r(e,t){s+=.1*(e-s),l*=.99,s>l&&(l=s),c.drawImage(o,1,0,o.width-1,o.height,0,0,o.width-1,o.height),t?c.drawImage(p,o.width-1,o.height-s*o.height/l-g):c.drawImage(d,o.width-1,o.height-s*o.height/l-g)}var i=n||{},o=document.createElement("canvas"),c=o.getContext("2d"),l=0,s=0,u=i.color?i.color:"#666666",d=document.createElement("canvas"),f=d.getContext("2d");d.width=1,d.height=2*g,f.fillStyle="#444444",f.fillRect(0,0,1,2*g),f.fillStyle=u,f.fillRect(0,g,1,g),f.fillStyle="#ffffff",f.globalAlpha=.5,f.fillRect(0,g,1,1),f.globalAlpha=1;var p=document.createElement("canvas"),h=p.getContext("2d");return p.width=1,p.height=2*g,h.fillStyle="#444444",h.fillRect(0,0,1,2*g),h.fillStyle="#b70000",h.fillRect(0,g,1,g),h.globalAlpha=.5,h.fillStyle="#ffffff",h.fillRect(0,g,1,1),h.globalAlpha=1,a(),{draw:r}}function r(e,n){function a(){i.width=v,i.height=g*n,i.style.width=i.width+"px",i.style.height=i.height+"px",i.className="rs-canvas",e.appendChild(i),o.fillStyle="#444444",o.fillRect(0,0,i.width,i.height)}function r(e){o.drawImage(i,1,0,i.width-1,i.height,0,0,i.width-1,i.height);var n=0;t(e,function(t){var a=e[t]*i.height;o.fillStyle=u[t],o.fillRect(i.width-1,n,1,a),n+=a})}var i=document.createElement("canvas"),o=i.getContext("2d");return a(),{draw:r}}function i(e,t){function n(e){if(x&&x.average){v+=e,C++;var t=performance.now();t-w>=(x.avgMs||1e3)&&(g=v/C,v=0,w=t,C=0)}}function r(){d=performance.now(),s.userTimingAPI&&performance.mark(f+"-start"),I=!0}function i(){p=performance.now()-d,s.userTimingAPI&&(performance.mark(f+"-end"),I&&performance.measure(f,f+"-start",f+"-end")),n(p)}function o(){i(),r()}function c(){var e=x&&x.average?g:p;b.nodeValue=Math.round(100*e)/100;var t=x&&(x.below&&p<x.below||x.over&&p>x.over);N.draw(p,t),y.className=t?"rs-counter-base alarm":"rs-counter-base"}function l(){var e=performance.now(),t=e-d;h++,t>1e3&&(p=x&&x.interpolate===!1?h:1e3*h/t,h=0,d=e,n(p))}function u(e){p=e,n(p)}var d,f=e,p=0,h=0,g=0,v=0,w=performance.now(),C=0,y=document.createElement("div"),E=document.createElement("span"),S=document.createElement("div"),b=document.createTextNode(""),x=s?s.values[f.toLowerCase()]:null,N=new a(y,f,x),I=!1;return E.className="rs-counter-id",E.textContent=x&&x.caption?x.caption:f,S.className="rs-counter-value",S.appendChild(b),y.appendChild(E),y.appendChild(S),t?t.div.appendChild(y):m.appendChild(y),d=performance.now(),{set:u,start:r,tick:o,end:i,frame:l,value:function(){return p},draw:c}}function o(e){var n=e.toLowerCase();if(void 0===n&&(n="default"),w[n])return w[n];var a=null;s&&s.groups&&t(s.groups,function(e){var t=s.groups[parseInt(e,10)];a||t.values.indexOf(n.toLowerCase())===-1||(a=t)});var r=new i(n,a);return w[n]=r,r}function c(){if(s.plugins){s.values||(s.values={}),s.groups||(s.groups=[]),s.fractions||(s.fractions=[]);for(var e=0;e<s.plugins.length;e++)s.plugins[e].attach(o),t(s.plugins[e].values,function(t){s.values[t]=s.plugins[e].values[t]}),s.groups=s.groups.concat(s.plugins[e].groups),s.fractions=s.fractions.concat(s.plugins[e].fractions)}else s.plugins={};h=document.createElement("div"),h.className="rs-base",m=document.createElement("div"),m.className="rs-container",m.style.height="auto",h.appendChild(m),document.body.appendChild(h),s&&(s.groups&&t(s.groups,function(e){var t=s.groups[parseInt(e,10)],n=document.createElement("div");n.className="rs-group",t.div=n;var a=document.createElement("h1");a.textContent=t.caption,a.addEventListener("click",function(e){this.classList.toggle("hidden"),e.preventDefault()}.bind(n)),m.appendChild(a),m.appendChild(n)}),s.fractions&&t(s.fractions,function(e){var n=s.fractions[parseInt(e,10)],a=document.createElement("div");a.className="rs-fraction";var i=document.createElement("div");i.className="rs-legend";var o=0;t(s.fractions[e].steps,function(t){var n=document.createElement("p");n.textContent=s.fractions[e].steps[t],n.style.color=u[o],i.appendChild(n),o++}),a.appendChild(i),a.style.height=o*g+"px",n.div=a;var c=new r(a,o);n.graph=c,m.appendChild(a)}))}function l(){t(s.plugins,function(e){s.plugins[e].update()}),t(w,function(e){w[e].draw()}),s&&s.fractions&&t(s.fractions,function(e){var n=s.fractions[parseInt(e,10)],a=[],r=w[n.base.toLowerCase()];r&&(r=r.value(),t(s.fractions[e].steps,function(t){var n=s.fractions[e].steps[parseInt(t,10)].toLowerCase(),i=w[n];i&&a.push(i.value()/r)})),n.graph.draw(a)})}var s=e||{},u=s.colours||["#850700","#c74900","#fcb300","#284280","#4c7c0c"],d="https://fonts.googleapis.com/css?family=Roboto+Condensed:400,700,300",f=(s.CSSPath?s.CSSPath:"")+"rStats.css",p=s.css||[d,f];p.forEach(function(e){n(e)}),s.values||(s.values={});var h,m,g=10,v=200,w={};return c(),function(e){return e?o(e):{element:h,update:l}}},"object"==typeof module&&(module.exports=window.rStats);
  604. },{}],204:[function(_dereq_,module,exports){
  605. var Util={};Util.base64=function(e,i){return"data:"+e+";base64,"+i},Util.isMobile=function(){var e=!1;return function(i){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(i)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(i.substr(0,4)))&&(e=!0)}(navigator.userAgent||navigator.vendor||window.opera),e},Util.isIOS=function(){return/(iPad|iPhone|iPod)/g.test(navigator.userAgent)},Util.isIFrame=function(){try{return window.self!==window.top}catch(e){return!0}},Util.appendQueryParameter=function(e,i,t){var a=e.indexOf("?")<0?"?":"&";return e+=a+i+"="+t},Util.getQueryParameter=function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i=new RegExp("[\\?&]"+e+"=([^&#]*)"),t=i.exec(location.search);return null===t?"":decodeURIComponent(t[1].replace(/\+/g," "))},Util.isLandscapeMode=function(){return 90==window.orientation||window.orientation==-90},module.exports=Util;
  606. },{}],205:[function(_dereq_,module,exports){
  607. function AndroidWakeLock(){var A=document.createElement("video");A.addEventListener("ended",function(){A.play()}),this.request=function(){A.paused&&(A.src=Util.base64("video/webm","GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4ECQoWBAhhTgGcBAAAAAAAH4xFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsggfG7AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU2LjQwLjEwMVdBjUxhdmY1Ni40MC4xMDFzpJAGSJTMbsLpDt/ySkipgX1fRImIQO1MAAAAAAAWVK5rAQAAAAAAADuuAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDmDgQEj44OEO5rKAOABAAAAAAAABrCBsLqBkB9DtnUBAAAAAAAAo+eBAKOmgQAAgKJJg0IAAV4BHsAHBIODCoAACmH2MAAAZxgz4dPSTFi5JACjloED6ACmAECSnABMQAADYAAAWi0quoCjloEH0ACmAECSnABNwAADYAAAWi0quoCjloELuACmAECSnABNgAADYAAAWi0quoCjloEPoACmAECSnABNYAADYAAAWi0quoCjloETiACmAECSnABNIAADYAAAWi0quoAfQ7Z1AQAAAAAAAJTnghdwo5aBAAAApgBAkpwATOAAA2AAAFotKrqAo5aBA+gApgBAkpwATMAAA2AAAFotKrqAo5aBB9AApgBAkpwATIAAA2AAAFotKrqAo5aBC7gApgBAkpwATEAAA2AAAFotKrqAo5aBD6AApgDAkpwAQ2AAA2AAAFotKrqAo5aBE4gApgBAkpwATCAAA2AAAFotKrqAH0O2dQEAAAAAAACU54Iu4KOWgQAAAKYAQJKcAEvAAANgAABaLSq6gKOWgQPoAKYAQJKcAEtgAANgAABaLSq6gKOWgQfQAKYAQJKcAEsAAANgAABaLSq6gKOWgQu4AKYAQJKcAEqAAANgAABaLSq6gKOWgQ+gAKYAQJKcAEogAANgAABaLSq6gKOWgROIAKYAQJKcAEnAAANgAABaLSq6gB9DtnUBAAAAAAAAlOeCRlCjloEAAACmAECSnABJgAADYAAAWi0quoCjloED6ACmAECSnABJIAADYAAAWi0quoCjloEH0ACmAMCSnABDYAADYAAAWi0quoCjloELuACmAECSnABI4AADYAAAWi0quoCjloEPoACmAECSnABIoAADYAAAWi0quoCjloETiACmAECSnABIYAADYAAAWi0quoAfQ7Z1AQAAAAAAAJTngl3Ao5aBAAAApgBAkpwASCAAA2AAAFotKrqAo5aBA+gApgBAkpwASAAAA2AAAFotKrqAo5aBB9AApgBAkpwAR8AAA2AAAFotKrqAo5aBC7gApgBAkpwAR4AAA2AAAFotKrqAo5aBD6AApgBAkpwAR2AAA2AAAFotKrqAo5aBE4gApgBAkpwARyAAA2AAAFotKrqAH0O2dQEAAAAAAACU54J1MKOWgQAAAKYAwJKcAENgAANgAABaLSq6gKOWgQPoAKYAQJKcAEbgAANgAABaLSq6gKOWgQfQAKYAQJKcAEagAANgAABaLSq6gKOWgQu4AKYAQJKcAEaAAANgAABaLSq6gKOWgQ+gAKYAQJKcAEZAAANgAABaLSq6gKOWgROIAKYAQJKcAEYAAANgAABaLSq6gB9DtnUBAAAAAAAAlOeCjKCjloEAAACmAECSnABF4AADYAAAWi0quoCjloED6ACmAECSnABFwAADYAAAWi0quoCjloEH0ACmAECSnABFoAADYAAAWi0quoCjloELuACmAECSnABFgAADYAAAWi0quoCjloEPoACmAMCSnABDYAADYAAAWi0quoCjloETiACmAECSnABFYAADYAAAWi0quoAfQ7Z1AQAAAAAAAJTngqQQo5aBAAAApgBAkpwARUAAA2AAAFotKrqAo5aBA+gApgBAkpwARSAAA2AAAFotKrqAo5aBB9AApgBAkpwARQAAA2AAAFotKrqAo5aBC7gApgBAkpwARQAAA2AAAFotKrqAo5aBD6AApgBAkpwAROAAA2AAAFotKrqAo5aBE4gApgBAkpwARMAAA2AAAFotKrqAH0O2dQEAAAAAAACU54K7gKOWgQAAAKYAQJKcAESgAANgAABaLSq6gKOWgQPoAKYAQJKcAESAAANgAABaLSq6gKOWgQfQAKYAwJKcAENgAANgAABaLSq6gKOWgQu4AKYAQJKcAERgAANgAABaLSq6gKOWgQ+gAKYAQJKcAERAAANgAABaLSq6gKOWgROIAKYAQJKcAEQgAANgAABaLSq6gB9DtnUBAAAAAAAAlOeC0vCjloEAAACmAECSnABEIAADYAAAWi0quoCjloED6ACmAECSnABEAAADYAAAWi0quoCjloEH0ACmAECSnABD4AADYAAAWi0quoCjloELuACmAECSnABDwAADYAAAWi0quoCjloEPoACmAECSnABDoAADYAAAWi0quoCjloETiACmAECSnABDgAADYAAAWi0quoAcU7trAQAAAAAAABG7j7OBALeK94EB8YIBd/CBAw=="),A.play())},this.release=function(){A.pause(),A.src=""}}function iOSWakeLock(){var A=null;this.request=function(){A||(A=setInterval(function(){window.location.href="/",setTimeout(window.stop,0)},15e3))},this.release=function(){A&&(clearInterval(A),A=null)}}function getWakeLock(){var A=navigator.userAgent||navigator.vendor||window.opera;return A.match(/iPhone/i)||A.match(/iPod/i)?iOSWakeLock:AndroidWakeLock}var Util=_dereq_("./util.js");module.exports=getWakeLock();
  608. },{"./util.js":204}]},{},[172])(172)
  609. });
  610. //# sourceMappingURL=aframe-master.min.js.map