!function(e){e.__DEV__=!1,e.__BUNDLE_START_TIME__=e.nativePerformanceNow?e.nativePerformanceNow():Date.now()}("undefined"!=typeof global?global:"undefined"!=typeof self?self:this);
!function(r){"use strict";function e(r,e,t){e in u||(u[e]={dependencyMap:t,exports:void 0,factory:r,hasError:!1,isInitialized:!1})}function t(r){var e=r,t=u[e];return t&&t.isInitialized?t.exports:n(e,t)}function n(e,t){if(!c&&r.ErrorUtils){c=!0;var n=void 0;try{n=i(e,t)}catch(e){r.ErrorUtils.reportFatalError(e)}return c=!1,n}return i(e,t)}function i(e,n){var i=r.nativeRequire;if(!n&&i&&(i(e),n=u[e]),!n)throw o(e);if(n.hasError)throw a(e,n.error);n.isInitialized=!0;var c=n.exports={},s=n,d=s.factory,f=s.dependencyMap;try{var l={exports:c};return d(r,t,l,c,f),n.factory=void 0,n.dependencyMap=void 0,n.exports=l.exports}catch(r){throw n.hasError=!0,n.error=r,n.isInitialized=!1,n.exports=void 0,r}}function o(r){var e='Requiring unknown module "'+r+'".';return Error(e)}function a(r,e){var t=r;return Error('Requiring module "'+t+'", which threw an exception: '+e)}r.require=t,r.__d=e;var u=Object.create(null);t.async=function(r){return Promise.resolve().then(function(){return t(r)})};var c=!1}("undefined"!=typeof global?global:"undefined"!=typeof self?self:this);
!function(n){Object.assign=function(n,e){for(var f=1;f<arguments.length;f++){var l=arguments[f];if(null!=l)for(var i in l)n[i]=l[i]}return n}}("undefined"!=typeof global?global:"undefined"!=typeof self?self:this);
!function(n){function r(r){return function(){var e=void 0;e=1===arguments.length&&"string"==typeof arguments[0]?arguments[0]:Array.prototype.map.call(arguments,function(n){return i(n,{depth:10})}).join(", ");var t=r;"Warning: "===e.slice(0,9)&&t>=u.error&&(t=u.warn),n.__inspectorLog&&n.__inspectorLog(a[t],e,[].slice.call(arguments),l),n.nativeLoggingHook(e,t)}}function e(n,r){return Array.apply(null,Array(r)).map(function(){return n})}function t(r){function t(n,r){var t=n.map(function(n,r){var t=e(" ",p[r]-n.length).join("");return n+t});return r=r||" ",t.join(r+"|"+r)}if(!Array.isArray(r)){var i=r;r=[];for(var a in i)if(i.hasOwnProperty(a)){var l=i[a];l[o]=a,r.push(l)}}if(0===r.length)return void n.nativeLoggingHook("",u.info);var c=Object.keys(r[0]).sort(),f=[],p=[];c.forEach(function(n,e){p[e]=n.length;for(var t=0;t<r.length;t++){var i=(r[t][n]||"?").toString();f[t]=f[t]||[],f[t][e]=i,p[e]=Math.max(p[e],i.length)}});for(var s=p.map(function(n){return e("-",n).join("")}),g=t(s,"-"),y=t(c),v=[y,g],h=0;h<r.length;h++)v.push(t(f[h]));n.nativeLoggingHook("\n"+v.join("\n"),u.info)}var i=function(){function n(n,e){var i={seen:[],stylize:r};return t(i,n,e.depth)}function r(n,r){return n}function e(n){var r={};return n.forEach(function(n,e){r[n]=!0}),r}function t(n,r,t){var f=i(n,r);if(f)return f;var p=Object.keys(r),s=e(p);if(b(r)&&(p.indexOf("message")>=0||p.indexOf("description")>=0))return o(r);if(0===p.length){if(m(r)){var g=r.name?": "+r.name:"";return n.stylize("[Function"+g+"]","special")}if(v(r))return n.stylize(RegExp.prototype.toString.call(r),"regexp");if(d(r))return n.stylize(Date.prototype.toString.call(r),"date");if(b(r))return o(r)}var y="",h=!1,j=["{","}"];if(c(r)&&(h=!0,j=["[","]"]),m(r)){var z=r.name?": "+r.name:"";y=" [Function"+z+"]"}if(v(r)&&(y=" "+RegExp.prototype.toString.call(r)),d(r)&&(y=" "+Date.prototype.toUTCString.call(r)),b(r)&&(y=" "+o(r)),0===p.length&&(!h||0==r.length))return j[0]+y+j[1];if(t<0)return v(r)?n.stylize(RegExp.prototype.toString.call(r),"regexp"):n.stylize("[Object]","special");n.seen.push(r);var O;return O=h?u(n,r,t,s,p):p.map(function(e){return a(n,r,t,s,e,h)}),n.seen.pop(),l(O,y,j)}function i(n,r){if(y(r))return n.stylize("undefined","undefined");if(g(r)){var e="'"+JSON.stringify(r).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return n.stylize(e,"string")}return s(r)?n.stylize(""+r,"number"):f(r)?n.stylize(""+r,"boolean"):p(r)?n.stylize("null","null"):void 0}function o(n){return"["+Error.prototype.toString.call(n)+"]"}function u(n,r,e,t,i){for(var o=[],u=0,l=r.length;u<l;++u)z(r,String(u))?o.push(a(n,r,e,t,String(u),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(a(n,r,e,t,i,!0))}),o}function a(n,r,e,i,o,u){var a,l,c;if(c=Object.getOwnPropertyDescriptor(r,o)||{value:r[o]},c.get?l=c.set?n.stylize("[Getter/Setter]","special"):n.stylize("[Getter]","special"):c.set&&(l=n.stylize("[Setter]","special")),z(i,o)||(a="["+o+"]"),l||(n.seen.indexOf(c.value)<0?(l=p(e)?t(n,c.value,null):t(n,c.value,e-1),l.indexOf("\n")>-1&&(l=u?l.split("\n").map(function(n){return"  "+n}).join("\n").substr(2):"\n"+l.split("\n").map(function(n){return"   "+n}).join("\n"))):l=n.stylize("[Circular]","special")),y(a)){if(u&&o.match(/^\d+$/))return l;a=JSON.stringify(""+o),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=n.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=n.stylize(a,"string"))}return a+": "+l}function l(n,r,e){var t=0,i=n.reduce(function(n,r){return t++,r.indexOf("\n")>=0&&t++,n+r.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?e[0]+(""===r?"":r+"\n ")+" "+n.join(",\n  ")+" "+e[1]:e[0]+r+" "+n.join(", ")+" "+e[1]}function c(n){return Array.isArray(n)}function f(n){return"boolean"==typeof n}function p(n){return null===n}function s(n){return"number"==typeof n}function g(n){return"string"==typeof n}function y(n){return void 0===n}function v(n){return h(n)&&"[object RegExp]"===j(n)}function h(n){return"object"==typeof n&&null!==n}function d(n){return h(n)&&"[object Date]"===j(n)}function b(n){return h(n)&&("[object Error]"===j(n)||n instanceof Error)}function m(n){return"function"==typeof n}function j(n){return Object.prototype.toString.call(n)}function z(n,r){return Object.prototype.hasOwnProperty.call(n,r)}return n}(),o="(index)",u={trace:0,info:1,warn:2,error:3},a=[];a[u.trace]="debug",a[u.info]="log",a[u.warn]="warning",a[u.error]="error";var l=1;if(n.nativeLoggingHook){n.console;n.console={error:r(u.error),info:r(u.info),log:r(u.info),warn:r(u.warn),trace:r(u.trace),debug:r(u.trace),table:t}}else if(!n.console){var c=n.print||function(){};n.console={error:c,info:c,log:c,warn:c,trace:c,debug:c,table:c}}}("undefined"!=typeof global?global:"undefined"!=typeof self?self:this);
!function(r){var n=0,t=function(r){throw r},u={setGlobalHandler:function(r){t=r},getGlobalHandler:function(){return t},reportError:function(r){t&&t(r)},reportFatalError:function(r){t&&t(r,!0)},applyWithGuard:function(r,t,e){try{return n++,r.apply(t,e)}catch(r){u.reportError(r)}finally{n--}return null},applyWithGuardIfNeeded:function(r,n,t){return u.inGuard()?r.apply(n,t):(u.applyWithGuard(r,n,t),null)},inGuard:function(){return n},guard:function(r,n,t){function e(){return u.applyWithGuard(r,t||this,arguments,null,n)}return"function"!=typeof r?(console.warn("A function must be passed to ErrorUtils.guard, got ",r),null):(n=n||r.name||"<generated guard>",e)}};r.ErrorUtils=u}("undefined"!=typeof global?global:"undefined"!=typeof self?self:this);
!function(e){if(void 0===Number.EPSILON&&Object.defineProperty(Number,"EPSILON",{value:Math.pow(2,-52)}),void 0===Number.MAX_SAFE_INTEGER&&Object.defineProperty(Number,"MAX_SAFE_INTEGER",{value:Math.pow(2,53)-1}),void 0===Number.MIN_SAFE_INTEGER&&Object.defineProperty(Number,"MIN_SAFE_INTEGER",{value:-(Math.pow(2,53)-1)}),!Number.isNaN){var r=e.isNaN;Object.defineProperty(Number,"isNaN",{configurable:!0,enumerable:!1,value:function(e){return"number"==typeof e&&r(e)},writable:!0})}}("undefined"!=typeof global?global:"undefined"!=typeof self?self:this);
!function(t){String.prototype.startsWith||(String.prototype.startsWith=function(t){"use strict";if(null==this)throw TypeError();var r=String(this),e=arguments.length>1?Number(arguments[1])||0:0,n=Math.min(Math.max(e,0),r.length);return r.indexOf(String(t),e)===n}),String.prototype.endsWith||(String.prototype.endsWith=function(t){"use strict";if(null==this)throw TypeError();var r=String(this),e=r.length,n=String(t),i=arguments.length>1?Number(arguments[1])||0:e,o=Math.min(Math.max(i,0),e),h=o-n.length;return!(h<0)&&r.lastIndexOf(n,h)===h}),String.prototype.repeat||(String.prototype.repeat=function(t){"use strict";if(null==this)throw TypeError();var r=String(this);if(t=Number(t)||0,t<0||t===1/0)throw RangeError();if(1===t)return r;for(var e="";t;)1&t&&(e+=r),(t>>=1)&&(r+=r);return e}),String.prototype.includes||(String.prototype.includes=function(t,r){"use strict";return"number"!=typeof r&&(r=0),!(r+t.length>this.length)&&this.indexOf(t,r)!==-1}),String.prototype.codePointAt||(String.prototype.codePointAt=function(t){if(null==this)throw TypeError();var r=String(this),e=r.length,n=t?Number(t):0;if(Number.isNaN(n)&&(n=0),!(n<0||n>=e)){var i,o=r.charCodeAt(n);return o>=55296&&o<=56319&&e>n+1&&(i=r.charCodeAt(n+1),i>=56320&&i<=57343)?1024*(o-55296)+i-56320+65536:o}})}("undefined"!=typeof global?global:"undefined"!=typeof self?self:this);
!function(e){function r(e,r){if(null==this)throw new TypeError("Array.prototype.findIndex called on null or undefined");if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var n=Object(this),t=n.length>>>0,o=0;o<t;o++)if(e.call(r,n[o],o,n))return o;return-1}Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{enumerable:!1,writable:!0,configurable:!0,value:r}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{enumerable:!1,writable:!0,configurable:!0,value:function(e,n){if(null==this)throw new TypeError("Array.prototype.find called on null or undefined");var t=r.call(this,e,n);return t===-1?void 0:this[t]}}),Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{enumerable:!1,writable:!0,configurable:!0,value:function(e){var r=Object(this),n=parseInt(r.length)||0;if(0===n)return!1;var t,o=parseInt(arguments[1])||0;o>=0?t=o:(t=n+o,t<0&&(t=0));for(var i;t<n;){if(i=r[t],e===i||e!==e&&i!==i)return!0;t++}return!1}})}("undefined"!=typeof global?global:"undefined"!=typeof self?self:this);
!function(n){Array.from||(Array.from=function(n){if(null==n)throw new TypeError("Object is null or undefined");var e,o,t=arguments[1],f=arguments[2],r=this,l=Object(n),i="function"==typeof Symbol&&"function"==typeof Symbol?Symbol.iterator:"@@iterator",u="function"==typeof t,y="function"==typeof l[i],a=0;if(y){e="function"==typeof r?new r:[];for(var c,p=l[i]();!(c=p.next()).done;)o=c.value,u&&(o=t.call(f,o,a)),e[a]=o,a+=1;return e.length=a,e}var b=l.length;for((isNaN(b)||b<0)&&(b=0),e="function"==typeof r?new r(b):new Array(b);a<b;)o=l[a],u&&(o=t.call(f,o,a)),e[a]=o,a+=1;return e.length=a,e})}("undefined"!=typeof global?global:"undefined"!=typeof self?self:this);
!function(e){!function(){"use strict";var e=Object.prototype.hasOwnProperty;"function"!=typeof Object.entries&&(Object.entries=function(n){if(null==n)throw new TypeError("Object.entries called on non-object");var t=[];for(var o in n)e.call(n,o)&&t.push([o,n[o]]);return t}),"function"!=typeof Object.values&&(Object.values=function(n){if(null==n)throw new TypeError("Object.values called on non-object");var t=[];for(var o in n)e.call(n,o)&&t.push(n[o]);return t})}()}("undefined"!=typeof global?global:"undefined"!=typeof self?self:this);
!function(e){var r=e.babelHelpers={};r.typeof="function"==typeof Symbol&&"symbol"==typeof("function"==typeof Symbol?Symbol.iterator:"@@iterator")?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==("function"==typeof Symbol?Symbol.prototype:"@@prototype")?"symbol":typeof e},r.createRawReactElement=function(){var e="function"==typeof Symbol&&("function"==typeof Symbol?Symbol.for:"@@for")&&("function"==typeof Symbol?Symbol.for:"@@for")("react.element")||60103;return function(r,t,n){return{$$typeof:e,type:r,key:t,ref:null,props:n,_owner:null}}}(),r.classCallCheck=function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")},r.createClass=function(){function e(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(r,t,n){return t&&e(r.prototype,t),n&&e(r,n),r}}(),r.defineEnumerableProperties=function(e,r){for(var t in r){var n=r[t];n.configurable=n.enumerable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,t,n)}return e},r.defineProperty=function(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e},r._extends=r.extends=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},r.get=function e(r,t,n){null===r&&(r=Function.prototype);var o=Object.getOwnPropertyDescriptor(r,t);if(void 0===o){var i=Object.getPrototypeOf(r);return null===i?void 0:e(i,t,n)}if("value"in o)return o.value;var f=o.get;if(void 0!==f)return f.call(n)},r.inherits=function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function, not "+typeof r);e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r)},r.interopRequireDefault=function(e){return e&&e.__esModule?e:{default:e}},r.interopRequireWildcard=function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r.default=e,r},r.objectWithoutProperties=function(e,r){var t={};for(var n in e)r.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},r.possibleConstructorReturn=function(e,r){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!r||"object"!=typeof r&&"function"!=typeof r?e:r},r.slicedToArray=function(){function e(e,r){var t=[],n=!0,o=!1,i=void 0;try{for(var f,u=e["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(n=(f=u.next()).done)&&(t.push(f.value),!r||t.length!==r);n=!0);}catch(e){o=!0,i=e}finally{try{!n&&u.return&&u.return()}finally{if(o)throw i}}return t}return function(r,t){if(Array.isArray(r))return r;if(("function"==typeof Symbol?Symbol.iterator:"@@iterator")in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r.taggedTemplateLiteral=function(e,r){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(r)}}))},r.toArray=function(e){return Array.isArray(e)?e:Array.from(e)},r.toConsumableArray=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)}}("undefined"!=typeof global?global:"undefined"!=typeof self?self:this);
__d(function(e,r,t,a){function n(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=new o.ReactInstance(e,r,babelHelpers.extends({fullScreen:!0,nativeModules:[function(e){return new u.default(e)}]},t));a.renderToLocation(a.createRoot("Marks"),a.getDefaultLocation());var n=a.getDefaultSurface();n.setShape(o.Surface.SurfaceShape.Flat),n.resize(200,90),n.setAngle(0,-.4),a.renderToSurface(a.createRoot("Ediphy360",{}),n),a.renderToSurface(a.createRoot("Proyector"),i),a.compositor.setBackground("./static_assets/360_world.jpg")}var o=r(12),c=r(147),u=babelHelpers.interopRequireDefault(c),i=new o.Surface(700,600,o.Surface.SurfaceShape.Cylinder);window.React360={init:n}},0);
__d(function(e,t,a,o){Object.defineProperty(o,"__esModule",{value:!0}),o.getSupportedFormats=o.addCustomizedVideoPlayer=o.BasicVideoPlayer=o.Surface=o.ReactInstance=o.ReactNativeContext=o.RCTBaseView=o.Module=o.Location=o.createRootView=o.bundleFromLocation=void 0;var r=t(13),i=babelHelpers.interopRequireDefault(r),l=t(14),u=babelHelpers.interopRequireDefault(l),d=t(110),n=babelHelpers.interopRequireDefault(d),p=t(19),s=babelHelpers.interopRequireDefault(p),c=t(64),f=babelHelpers.interopRequireDefault(c),b=t(112),R=babelHelpers.interopRequireDefault(b),V=t(104),m=babelHelpers.interopRequireDefault(V),C=t(146),q=t(17);o.bundleFromLocation=i.default,o.createRootView=u.default,o.Location=n.default,o.Module=s.default,o.RCTBaseView=f.default,o.ReactNativeContext=q.ReactNativeContext,o.ReactInstance=R.default,o.Surface=m.default,o.BasicVideoPlayer=C.BasicVideoPlayer,o.addCustomizedVideoPlayer=C.addCustomizedVideoPlayer,o.getSupportedFormats=C.getSupportedFormats},12);
__d(function(t,n,e,o){function r(t){var n=location.pathname;try{var e=new URL(t);return e.toString()}catch(e){return n=n.endsWith("/")?n.substr(0,n.length-1):n.substr(0,n.lastIndexOf("/")),location.protocol+"//"+location.host+n+"/"+t}}Object.defineProperty(o,"__esModule",{value:!0}),o.default=r},13);
__d(function(e,t,o,a){function r(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)throw new Error("ReactVR Root View must attach to an OVRUI GUI!");if(!t||"string"!=typeof t)throw new Error("ReactVR Root View must have a module name to mount");var a=!1,r=o.initialProps||{},n={isLowLatency:!!o.isLowLatency,customViews:o.customViews};o.assetRoot&&(n.assetRoot=o.assetRoot),s.test(location.search)&&(n.enableHotReload=!0),o.enableHotReload&&(n.enableHotReload=o.enableHotReload);var u=o.executor||new i.default({enableDevTools:a}),d=o.bundle||"../index.bundle?platform=vr";n.enableHotReload&&(d+="&hot=true");var f=new l.ReactNativeContext(e,u,n);if(Array.isArray(o.nativeModules))for(var c=o.nativeModules,v=Array.isArray(c),R=0,c=v?c:c["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();;){var b;if(v){if(R>=c.length)break;b=c[R++]}else{if(R=c.next(),R.done)break;b=R.value}var w=b;f.registerModule(w)}f.init(d);var m=f.createRootView(t,r);return{context:f,frame:function(e){f.frame(e,m)},rootTag:m}}Object.defineProperty(a,"__esModule",{value:!0}),a.default=r;var n=t(15),i=babelHelpers.interopRequireDefault(n),l=t(17),s=/\bhotreload\b/},14);
__d(function(e,n,t,s){Object.defineProperty(s,"__esModule",{value:!0});var r=n(16),o=babelHelpers.interopRequireDefault(r),a=function(e){function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};babelHelpers.classCallCheck(this,n);var t=babelHelpers.possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).call(this)),s=new Blob(["var Status = undefined;\n\n__DEVTOOLS__ = "+(e.enableDevTools?"true":"false")+";\n\n__postMessage = postMessage;\n\n__loadBundle = function(bundle) {\n  importScripts(bundle);\n};\n\nonmessage = function(e) {\n"+o.default.BRIDGE_HANDLER_CODE+"\n}"]),r=URL.createObjectURL(s);return t._worker=new Worker(r),t._worker.onmessage=function(e){var n=e.data;n&&n instanceof Object&&t._messageQueue.push(n)},t}return babelHelpers.inherits(n,e),babelHelpers.createClass(n,[{key:"moduleConfig",value:function(e){var n=JSON.stringify({cmd:"moduleConfig",moduleConfig:{remoteModuleConfig:e}},o.default.replaceHiddenAttributes);this._worker.postMessage(n)}},{key:"setConstant",value:function(e,n){var t=JSON.stringify({cmd:"setConstant",key:e,value:n});this._worker.postMessage(t)}},{key:"exec",value:function(e){var n=JSON.stringify({cmd:"bundle",bundleName:e});this._worker.postMessage(n)}},{key:"call",value:function(e,n,t){var s=JSON.stringify({cmd:"exec",module:e,function:n,args:t});this._worker.postMessage(s)}},{key:"invoke",value:function(e,n){var t=JSON.stringify({cmd:"invoke",id:e,args:n});this._worker.postMessage(t)}},{key:"flush",value:function(){var e=JSON.stringify({cmd:"flush"});this._worker.postMessage(e)}}]),n}(o.default);s.default=a},15);
__d(function(e,n,s,l){Object.defineProperty(l,"__esModule",{value:!0});var t=function(){function e(){babelHelpers.classCallCheck(this,e),this._messageQueue=[]}return babelHelpers.createClass(e,[{key:"poll",value:function(){var e=this._messageQueue.length;return 0===e?null:this._messageQueue.shift()}},{key:"moduleConfig",value:function(e){}},{key:"setConstant",value:function(e,n){}},{key:"exec",value:function(e){}},{key:"call",value:function(e,n,s){}},{key:"invoke",value:function(e,n){}},{key:"flush",value:function(){}}],[{key:"replaceHiddenAttributes",value:function(e,n){return e.charAt&&"_"===e.charAt(0)?void 0:n}}]),e}();t.BRIDGE_HANDLER_CODE="\nvar msg = JSON.parse(e.data);\nif (!msg || !msg.cmd) {\n  return;\n}\nif (msg.cmd === 'setConstant') {\n  self[msg.key] = self[msg.value];\n} else\nif (msg.cmd === 'moduleConfig' ) {\n  __fbBatchedBridgeConfig = msg.moduleConfig;\n  Status = 'moduleConfig';\n} else\nif (msg.cmd === 'bundle' && Status === 'moduleConfig') {\n  try {\n    __loadBundle(msg.bundleName);\n    Status = 'bundle';\n  } catch (e) {\n    console.warn(e);\n    var xmlhttp = new XMLHttpRequest();\n    xmlhttp.open(\"GET\", msg.bundleName, true);\n    xmlhttp.onreadystatechange=function() {\n      if (xmlhttp.readyState == 4) {\n        var result = JSON.parse(xmlhttp.responseText);\n        if (result) {\n          if (result.type === 'UnableToResolveError' || result.type === 'NotFoundError') {\n            console.warn(result.message);\n          } else {\n            if (result.snippet) {\n              // remove all color characters and split the lines for improved clarity\n              result.snippet = result.snippet.replace(/\\u001b\\[.*?m/g, '').split('\\n');\n            }\n            if (result.filename && result.filename.indexOf(':') <= 2) {\n              result.filename = 'file:///' + result.filename;\n            }\n            if (result.errors) {\n              for (var i=0; i<result.errors.length; i++) {\n                var error = result.errors[i];\n                if (error.filename && error.filename.indexOf(':') <= 2) {\n                  error.filename = 'file:///' + error.filename;\n                }\n              }\n            }\n            console.warn(JSON.stringify(result, undefined, 2));\n          }\n        }\n      }\n    }\n    xmlhttp.send(null);\n  }\n} else if (Status === 'bundle') {\n  if (msg.cmd === 'exec') {\n    var results = __fbBatchedBridge.callFunctionReturnFlushedQueue.apply(null, [msg.module, msg.function, msg.args]);\n    try {\n      __postMessage({cmd: 'exec', results: results});\n    } catch (e) {\n      console.warn(e);\n      console.warn(msg);\n      console.warn(JSON.stringify(results))\n    }\n  } else\n  if (msg.cmd === 'invoke') {\n    var results = __fbBatchedBridge.invokeCallbackAndReturnFlushedQueue.apply(null, [msg.id, msg.args]);\n    try {\n      __postMessage({cmd: 'exec', results: results});\n    } catch (e) {\n      console.warn(e);\n      console.warn(msg);\n      console.warn(JSON.stringify(results))\n    }\n  } else\n  if (msg.cmd === 'flush') {\n    var results = __fbBatchedBridge.flushedQueue.apply(null);\n    try {\n      __postMessage({cmd: 'exec', results: results});\n    } catch (e) {\n      console.warn(e);\n      console.warn(msg);\n      console.warn(JSON.stringify(results))\n    }\n  }\n}",l.default=t},16);
__d(function(e,t,i,r){function a(e){for(var t=[],i=e.modules,r=Array.isArray(i),a=0,i=r?i:i["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();;){var s;if(r){if(a>=i.length)break;s=i[a++]}else{if(a=i.next(),a.done)break;s=a.value}var o=s,l=o._describe();t.push(l)}return t}Object.defineProperty(r,"__esModule",{value:!0}),r.ReactNativeContext=void 0;var s=t(18),o=babelHelpers.interopRequireDefault(s),l=t(20),n=babelHelpers.interopRequireDefault(l),u=t(21),h=babelHelpers.interopRequireDefault(u),c=t(22),d=babelHelpers.interopRequireDefault(c),f=t(23),p=babelHelpers.interopRequireDefault(f),g=t(24),v=babelHelpers.interopRequireDefault(g),b=t(25),m=babelHelpers.interopRequireDefault(b),w=t(26),y=babelHelpers.interopRequireDefault(w),R=t(27),T=babelHelpers.interopRequireDefault(R),M=t(28),H=babelHelpers.interopRequireDefault(M),x=t(29),D=babelHelpers.interopRequireDefault(x),S=t(30),k=babelHelpers.interopRequireDefault(S),E=t(31),_=t(32),q=t(34),C=babelHelpers.interopRequireDefault(q),A=t(36),I=babelHelpers.interopRequireDefault(A),F=t(42),U=babelHelpers.interopRequireDefault(F),L=t(49),V=babelHelpers.interopRequireDefault(L),P=t(51),G=babelHelpers.interopRequireDefault(P),O=t(52),N=babelHelpers.interopRequireDefault(O),j=t(106),W=babelHelpers.interopRequireDefault(j),z=t(107),B=babelHelpers.interopRequireDefault(z),J=t(108),K=babelHelpers.interopRequireDefault(J),Q=t(109),X=babelHelpers.interopRequireDefault(Q),Y=t(33),Z=t(35),$=babelHelpers.interopRequireWildcard(Z),ee=10,te=1e-4;r.ReactNativeContext=function(){function e(t,i){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};babelHelpers.classCallCheck(this,e),this.modules=[],this.currentRootTag=1,this.executor=i,this.guiSys=t,this.messages=[],this.isLowLatency=!!r.isLowLatency,this.enableHotReload=!!r.enableHotReload,this.lastHit=null,this.lastLocalIntersect=null,this.lastSource=null,this.UIManager=new N.default(this,t,r.customViews),this.Timing=new G.default(this),this.RCTResourceManager=new E.RCTResourceManager,this.RCTInputControls=new _.RCTInputControls(this,t),this.HeadModel=new C.default(this),this.VideoModule=new I.default(this),this.AudioModule=new U.default(this),this.TextureManager=new V.default,this.GlyphTextures=new v.default(this),this._moduleForTag=[],this._cameraParentFromTag=[],this.registerModule(this.UIManager),this.registerModule(new o.default),this.registerModule(new n.default(this)),this.registerModule(new h.default(this)),this.registerModule(new d.default),this.registerModule(new m.default(this)),this.registerModule(new D.default(this)),this.registerModule(new y.default(this)),this.registerModule(new T.default(this)),this.registerModule(new H.default(this)),this.registerModule(new k.default),this.registerModule(this.Timing),this.registerModule(this.VideoModule),this.registerModule(this.AudioModule),this.registerModule(new W.default(this)),this.registerModule(new B.default),this.registerModule(new K.default),this.registerModule(new X.default(this)),this.registerModule(new p.default(r.assetRoot||"")),this.registerModule(this.GlyphTextures),t.eventDispatcher.addEventListener("GuiSysEvent",this._onGuiSysEvent.bind(this)),t.eventDispatcher.addEventListener("UIViewEvent",this._onUIViewEvent.bind(this))}return babelHelpers.createClass(e,[{key:"init",value:function(e){if(this.executor.moduleConfig(a(this)),this.executor.exec(e),this.enableHotReload){var t=new URL(e);console.warn("HotReload on "+e),this.callFunction("HMRClient","enable",["vr",t.pathname.toString().substr(1),t.hostname,t.port])}}},{key:"shutdown",value:function(){for(var e=this.modules,t=Array.isArray(e),i=0,e=t?e:e["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();;){var r;if(t){if(i>=e.length)break;r=e[i++]}else{if(i=e.next(),i.done)break;r=i.value}var a=r;"function"==typeof a.shutdown&&a.shutdown()}}},{key:"createRootView",value:function(e,t,i,r){var a=this.currentRootTag;return this.currentRootTag+=ee,this.executor.call("AppRegistry","runApplication",[e,{initialProps:t,rootTag:a}]),this._moduleForTag[a]=e,i||(this._cameraParentFromTag[a]=new $.Object3D),this.UIManager.createRootView(a,i,r),a}},{key:"updateRootView",value:function(e,t){this.executor.call("AppRegistry","runApplication",[this._moduleForTag[e],{initialProps:t,rootTag:e}])}},{key:"destroyRootView",value:function(e){delete this._moduleForTag[e];var t=this._cameraParentFromTag[e];if(t){for(var i=t.children,r=Array.isArray(i),a=0,i=r?i:i["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();;){var s;if(r){if(a>=i.length)break;s=i[a++]}else{if(a=i.next(),a.done)break;s=a.value}var o=s;t.remove(o)}delete this._cameraParentFromTag[e]}this.executor.call("AppRegistry","unmountApplicationComponentAtRootTag",[e])}},{key:"_onGuiSysEvent",value:function(e){switch(e.eventType){case Y.GuiSysEventType.HIT_CHANGED:this.lastHit===e.args.currentHit&&this.lastSource===e.args.currentSource||(this.lastHit=e.args.currentHit,this.lastSource=e.args.currentSource)}}},{key:"_onUIViewEvent",value:function(e){switch(e.eventType){case Y.UIViewEventType.FOCUS_LOST:var t=e.view?this.getHitTag(e.view):void 0,i=e.args.target?this.getHitTag(e.args.target):void 0,r={target:i,source:e.args.source};t&&this.callFunction("RCTEventEmitter","receiveEvent",[t,"topExit",r]);break;case Y.UIViewEventType.FOCUS_GAINED:var a=e.view?this.getHitTag(e.view):void 0,s=e.args.target?this.getHitTag(e.args.target):void 0,o={target:s,source:e.args.source};a&&this.callFunction("RCTEventEmitter","receiveEvent",[a,"topEnter",o])}}},{key:"frame",value:function(e,t){var i=window.performance?performance.now():Date.now();if(this.Timing&&this.Timing.frame(i),this.lastHit&&this.lastHit.owner&&this.lastHit.owner.receivesMoveEvent){var r=this.guiSys.getLastLocalIntersect();if(r||(this.lastLocalIntersect=null),r){var a=this.lastLocalIntersect;if(!a||Math.abs(r[0]-a[0])>te||Math.abs(r[1]-a[1])>te){var s=this.getHitTag(this.lastHit),o={offset:r};this.callFunction("RCTEventEmitter","receiveEvent",[s,"topMove",o]),this.lastLocalIntersect=r}}}this.executor.flush();for(var l=this.executor.poll();l;){if("exec"===l.cmd){var n=l.results;if(n&&n.length>=3)for(var u=n[0],h=n[1],c=n[2],d=0;d<u.length;d++)this.modules[u[d]]._functionMap[h[d]].apply(this.modules[u[d]],c[d])}l=this.executor.poll()}this.UIManager&&this.UIManager.frame(i),this.HeadModel&&this.HeadModel.frame(e),this.VideoModule&&this.VideoModule.frame(),this.AudioModule&&this.AudioModule.frame(e),this.TextureManager.frame(),t&&this._applySceneTransform(e,t),this.Timing&&this.Timing.idle(i)}},{key:"_applySceneTransform",value:function(e,t){var i=this.UIManager.getSceneCameraTransform(t),r=this._cameraParentFromTag[t];if(i&&r){if(e.parent&&e.parent.uuid!==r.uuid)return console.warn("Camera object already has a parent; Use of 'transform' property on <Scene> will have no effect."),void(this._cameraParentFromTag[t]=null);0===r.children.length&&r.add(e),r.matrixAutoUpdate=!1,r.matrix.fromArray(i),r.updateMatrixWorld(!0)}}},{key:"getHitTag",value:function(e){for(var t=e;t;){if(t.tag)return t.tag;t=t.parent}}},{key:"callFunction",value:function(e,t,i){this.executor.call(e,t,i)}},{key:"invokeCallback",value:function(e,t){this.executor.invoke(e,t)}},{key:"registerModule",value:function(e){this.modules.push(e)}},{key:"registerTextureSource",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.TextureManager.registerLocalTextureSource(e,t,i)}}]),e}()},17);
__d(function(e,t,r,l){Object.defineProperty(l,"__esModule",{value:!0});var n=t(19),s=babelHelpers.interopRequireDefault(n),o=function(e){function t(){babelHelpers.classCallCheck(this,t);var e=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"AndroidConstants"));return e.Version=22,e}return babelHelpers.inherits(t,e),t}(s.default);l.default=o},18);
__d(function(e,t,r,n){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(t){babelHelpers.classCallCheck(this,e),t.startsWith("RCT")&&(t=t.substr(3)),this.name=t,this._functionMap=[]}return babelHelpers.createClass(e,[{key:"getName",value:function(){return this.name}},{key:"_describe",value:function(){for(var e={},t=[],r=[],n=[],a=0,i=Object.getPrototypeOf(this),s=Object.getOwnPropertyNames(i),o=s,u=Array.isArray(o),f=0,o=u?o:o["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();;){var c;if(u){if(f>=o.length)break;c=o[f++]}else{if(f=o.next(),f.done)break;c=f.value}var l=c,b=i[l];if("_"!==l[0]&&"constructor"!==l&&"function"==typeof b){var h=l;"$"===h[0]&&(h=h.substring(1),r.push(a)),this._functionMap[a]=b,t.push(h),a++}}for(var p in this){var b=this[p];"_"!==p[0]&&"function"!=typeof b&&(e[p]=b)}return[this.name,e,t,r,n]}}]),e}();n.default=a},19);
__d(function(e,n,r,t){Object.defineProperty(t,"__esModule",{value:!0});var o=n(19),a=babelHelpers.interopRequireDefault(o),i=function(e){function n(e){babelHelpers.classCallCheck(this,n);var r=babelHelpers.possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,"AsyncLocalStorage"));return r._rnctx=e,r._db=null,r}return babelHelpers.inherits(n,e),babelHelpers.createClass(n,[{key:"_prepareDB",value:function(){var e=this;return new Promise(function(n,r){if(e._db)return n(e._db);var t=window.indexedDB.open("AsyncStorage",1);t.onerror=function(e){r({message:"Error opening database"})},t.onupgradeneeded=function(r){var t=r.target.result;e._db=t,t.createObjectStore("pairs",{keyPath:"key"}),n(t)},t.onsuccess=function(r){var t=r.target.result;e._db=t,n(t)}})}},{key:"_getRow",value:function(e,n){return new Promise(function(r,t){var o=e.get(n);o.onerror=function(e){t({message:e.target.error.name,key:n})},o.onsuccess=function(e){var t=e.target.result;r(t?[t.key,t.value]:[n,void 0])}})}},{key:"_putRow",value:function(e,n){return new Promise(function(r,t){var o=e.put(n);o.onerror=function(e){t({message:e.target.error.name,key:n.key})},o.onsuccess=function(){r()}})}},{key:"_deleteRow",value:function(e,n){return new Promise(function(r,t){var o=e.delete(n);o.onerror=function(e){t({message:e.target.error.name,key:n})},o.onsuccess=function(){r()}})}},{key:"multiGet",value:function(e,n){var r=this;this._prepareDB().then(function(n){var t=n.transaction(["pairs"]),o=t.objectStore("pairs"),a=[];return e.forEach(function(e){return a.push(r._getRow(o,e))}),Promise.all(a)}).then(function(e){r._rnctx.invokeCallback(n,[void 0,e])},function(e){r._rnctx.invokeCallback(n,[e])})}},{key:"multiSet",value:function(e,n){var r=this;this._prepareDB().then(function(n){var t=n.transaction(["pairs"],"readwrite"),o=t.objectStore("pairs"),a=[];return e.forEach(function(e){var n={key:e[0],value:e[1]};a.push(r._putRow(o,n))}),Promise.all(a)}).then(function(){r._rnctx.invokeCallback(n,[])},function(e){r._rnctx.invokeCallback(n,[e])})}},{key:"multiRemove",value:function(e,n){var r=this;this._prepareDB().then(function(n){var t=n.transaction(["pairs"],"readwrite"),o=t.objectStore("pairs"),a=[];return e.forEach(function(e){return a.push(r._deleteRow(o,e))}),Promise.all(a)}).then(function(){r._rnctx.invokeCallback(n,[])},function(e){r._rnctx.invokeCallback(n,[e])})}},{key:"clear",value:function(e){var n=this;this._prepareDB().then(function(e){return new Promise(function(n,r){var t=e.transaction(["pairs"],"readwrite"),o=t.objectStore("pairs"),a=o.clear();a.onerror=function(e){r({message:e.target.error.name})},a.onsuccess=function(){n()}})}).then(function(){n._rnctx.invokeCallback(e,[])},function(r){n._rnctx.invokeCallback(e,[r])})}},{key:"getAllKeys",value:function(e){var n=this;this._prepareDB().then(function(e){return new Promise(function(n,r){var t=e.transaction(["pairs"]),o=t.objectStore("pairs"),a=o.openCursor(),i=[];a.onerror=function(e){r({message:e.target.error.name})},a.onsuccess=function(e){var r=e.target.result;r?(i.push(r.key),r.continue()):n(i)}})}).then(function(r){n._rnctx.invokeCallback(e,[void 0,r])},function(r){n._rnctx.invokeCallback(e,[r])})}}]),n}(a.default);t.default=i},20);
__d(function(e,t,n,a){function r(e){return e?{index:e.index,id:e.id,buttons:e.buttons.length,axes:e.axes.length,hand:e.hand||null}:null}Object.defineProperty(a,"__esModule",{value:!0});var i=t(19),l=babelHelpers.interopRequireDefault(i),o=(navigator.getGamepads?navigator.getGamepads:navigator.webkitGetGamepads?navigator.webkitGetGamepads:function(){return[]}).bind(navigator),c=function(e){function t(e){babelHelpers.classCallCheck(this,t);var n=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"ControllerInfo"));return n._rnctx=e,window.addEventListener("gamepadconnected",function(e){n._rnctx.callFunction("RCTDeviceEventEmitter","emit",["controllerConnected",r(e.gamepad)])}),window.addEventListener("gamepaddisconnected",function(e){n._rnctx.callFunction("RCTDeviceEventEmitter","emit",["controllerDisconnected",r(e.gamepad)])}),n}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"$getControllers",value:function(e){for(var t=[],n=o(),a=0;a<n.length;a++){var i=n[a];i&&t.push(r(n[a]))}this._rnctx.invokeCallback(e,[t])}}]),t}(l.default);a.default=c},21);
__d(function(e,t,i,l){Object.defineProperty(l,"__esModule",{value:!0});var s=t(19),n=babelHelpers.interopRequireDefault(s),r=function(e){function t(){babelHelpers.classCallCheck(this,t);var e=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"DeviceInfo"));return e.Dimensions={windowPhysicalPixels:{width:1024,height:1024,scale:1,fontScale:1,densityDpi:1},screenPhysicalPixels:{width:1024,height:1024,scale:1,fontScale:1,densityDpi:1}},e}return babelHelpers.inherits(t,e),t}(n.default);l.default=r},22);
__d(function(e,t,r,l){Object.defineProperty(l,"__esModule",{value:!0});var s=t(19),a=babelHelpers.interopRequireDefault(s),o=function(e){function t(e){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"ExternalAssets"));return r.assetRoot=e,r}return babelHelpers.inherits(t,e),t}(a.default);l.default=o},23);
__d(function(e,t,r,a){function l(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#ffffff";e.fillStyle=r;for(var a=0,l=t.length;a<l;a++)switch(t[a][0]){case"move":var n=t[a][1],c=t[a][2];e.moveTo(n,c);break;case"line":var o=t[a][1],i=t[a][2];e.lineTo(o,i);break;case"arc":var s=t[a][1],u=t[a][2],f=t[a][3],h=t[a][4],b=t[a][5],v=!!t[a][6];e.arc(s,u,f,h,b,v);break;case"rect":var g=t[a][1],d=t[a][2],p=t[a][3],_=t[a][4];e.rect(g,d,p,_);break;case"begin":e.beginPath();break;case"end":e.fill()}t.length&&"end"!==t[t.length-1][0]&&e.fill()}Object.defineProperty(a,"__esModule",{value:!0});var n=t(19),c=babelHelpers.interopRequireDefault(n),o=function(e){function t(e){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"GlyphTextures"));return r._rnctx=e,r}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"registerGlyph",value:function(e,t){var r=document.createElement("canvas");r.width=t.width,r.height=t.height;var a=r.getContext("2d");if(!a)throw new Error("Could not generate 2d context of canvas");a.translate(.5,.5),l(a,t.instructions,t.color);var n="glyph/"+e;this._rnctx.TextureManager.registerLocalTextureSource(n,r)}}]),t}(c.default);a.default=o},24);
__d(function(t,e,n,i){Object.defineProperty(i,"__esModule",{value:!0});var l=e(19),o=babelHelpers.interopRequireDefault(l),r=function(t){function e(t){babelHelpers.classCallCheck(this,e);var n=babelHelpers.possibleConstructorReturn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,"History"));return n._rnctx=t,window.addEventListener("popstate",function(t){n._rnctx.callFunction("RCTDeviceEventEmitter","emit",["historyPopState",{state:t.state}]),n._rnctx.callFunction("RCTDeviceEventEmitter","emit",["url",window.location.toString()])}),n}return babelHelpers.inherits(e,t),babelHelpers.createClass(e,[{key:"$length",value:function(t){this._rnctx.invokeCallback(t,[window.history.length])}},{key:"$state",value:function(t){this._rnctx.invokeCallback(t,[window.history.state])}},{key:"$back",value:function(t){window.history.back(),this._rnctx.invokeCallback(t,[!0])}},{key:"$forward",value:function(t){window.history.forward(),this._rnctx.invokeCallback(t,[!0])}},{key:"$go",value:function(t,e){window.history.go(t),this._rnctx.invokeCallback(e,[!0])}},{key:"$pushState",value:function(){var t,e;if(arguments.length<4){var n;return void this._rnctx.invokeCallback((n=arguments.length-1,arguments.length<=n?void 0:arguments[n]),[new Error("pushState requires at least two arguments")])}var i=arguments.length<=0?void 0:arguments[0],l=arguments.length<=1?void 0:arguments[1],o=(t=arguments.length-2,arguments.length<=t?void 0:arguments[t]),r=(e=arguments.length-1,arguments.length<=e?void 0:arguments[e]),a=4===arguments.length?void 0:arguments.length<=2?void 0:arguments[2];try{window.history.pushState(i,l,a),this._rnctx.callFunction("RCTDeviceEventEmitter","emit",["url",window.location.toString()]),this._rnctx.invokeCallback(o,[!0])}catch(t){this._rnctx.invokeCallback(r,[t])}}},{key:"$replaceState",value:function(){var t,e;if(arguments.length<4){var n;return void this._rnctx.invokeCallback((n=arguments.length-1,arguments.length<=n?void 0:arguments[n]),[new Error("replaceState requires at least two arguments")])}var i=arguments.length<=0?void 0:arguments[0],l=arguments.length<=1?void 0:arguments[1],o=(t=arguments.length-2,arguments.length<=t?void 0:arguments[t]),r=(e=arguments.length-1,arguments.length<=e?void 0:arguments[e]),a=4===arguments.length?void 0:arguments.length<=2?void 0:arguments[2];try{window.history.pushState(i,l,a),this._rnctx.invokeCallback(o,[!0])}catch(t){this._rnctx.invokeCallback(r,[t])}}}]),e}(o.default);i.default=r},25);
__d(function(e,t,n,l){Object.defineProperty(l,"__esModule",{value:!0});var a=t(19),i=babelHelpers.interopRequireDefault(a),o=location.href,r=function(e){function t(e){babelHelpers.classCallCheck(this,t);var n=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"LinkingManager"));return n._rnctx=e,n}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"$openURL",value:function(e,t,n){window.location=new URL(e,window.location).toString(),this._rnctx.invokeCallback(t,[!0])}},{key:"$canOpenURL",value:function(e,t,n){this._rnctx.invokeCallback(t,[!0])}},{key:"$getInitialURL",value:function(e,t){this._rnctx.invokeCallback(e,[o])}}]),t}(i.default);l.default=r},26);
__d(function(e,o,r,t){Object.defineProperty(t,"__esModule",{value:!0});var a=o(19),l=babelHelpers.interopRequireDefault(a),s=function(e){function o(e){babelHelpers.classCallCheck(this,o);var r=babelHelpers.possibleConstructorReturn(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,"Location"));r._rnctx=e;var t=window.location;return r.href=t.href,r.protocol=t.protocol,r.host=t.host,r.hostname=t.hostname,r.port=t.port,r.search=t.search,r.hash=t.hash,r.username=t.username,r.password=t.password,r}return babelHelpers.inherits(o,e),babelHelpers.createClass(o,[{key:"reload",value:function(e){window.location.reload(e)}},{key:"replace",value:function(e){window.location.replace(e)}}]),o}(l.default);t.default=s},27);
__d(function(e,t,a,i){function o(e){var t=e.coords,a=e.timestamp;return{coords:{latitude:t.latitude,longitude:t.longitude,altitude:t.altitude,accuracy:t.accuracy,altitudeAccuracy:t.altitudeAccuracy,heading:t.heading},timestamp:a}}Object.defineProperty(i,"__esModule",{value:!0});var n=t(19),c=babelHelpers.interopRequireDefault(n),r=function(e){function t(e){babelHelpers.classCallCheck(this,t);var a=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"LocationObserver"));return a._rnctx=e,a._watchID=null,a}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"requestAuthorization",value:function(){navigator.geolocation.getCurrentPosition(function(){})}},{key:"getCurrentPosition",value:function(e,t,a){var i=this;navigator.geolocation||this._rnctx.invokeCallback(a,[]);var n={};"boolean"==typeof e.enableHighAccuracy&&(n.enableHighAccuracy=e.enableHighAccuracy),"number"==typeof e.maximumAge&&(n.maximumAge=e.maximumAge),"number"==typeof e.timeout&&(n.timeout=e.timeout),navigator.geolocation.getCurrentPosition(function(e){i._rnctx.invokeCallback(t,[o(e)])},function(e){var t=e.code,o=e.message;i._rnctx.invokeCallback(a,[{code:t,message:o}])},n)}},{key:"startObserving",value:function(e){var t=this;if(null===this._watchID){var a={};"boolean"==typeof e.enableHighAccuracy&&(a.enableHighAccuracy=e.enableHighAccuracy),"number"==typeof e.maximumAge&&(a.maximumAge=e.maximumAge),"number"==typeof e.timeout&&(a.timeout=e.timeout),this._watchID=navigator.geolocation.watchPosition(function(e){t._rnctx.callFunction("RCTDeviceEventEmitter","emit",["geolocationDidChange",o(e)])},function(e){var a=e.code,i=e.message;t._rnctx.callFunction("RCTDeviceEventEmitter","emit",["geolocationError",{code:a,message:i}])},a)}}},{key:"stopObserving",value:function(){null!==this._watchID&&navigator.geolocation.clearWatch(this._watchID)}}]),t}(c.default);i.default=r},28);
__d(function(e,t,n,r){Object.defineProperty(r,"__esModule",{value:!0});var i=t(19),a=babelHelpers.interopRequireDefault(i),l=function(e){function t(e){babelHelpers.classCallCheck(this,t);var n=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"Networking"));return n._rnctx=e,n}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"sendRequest",value:function(e,t,n,r,i,a,l,o){var s=this;if(e=e.toUpperCase(),"GET"!==e&&"POST"!==e&&"PATCH"!==e&&"PUT"!==e&&"DELETE"!==e)throw new Error("Invalid method type");var c={method:e,headers:r};if(("POST"===e||"PATCH"===e)&&i)if(i.string)c.body=i.string;else if(i.formData){for(var u=new FormData,d=0;d<i.formData.length;d++)u.append(i.formData[d].fieldName,i.formData[d].string);c.body=u}else i.string&&(c.body=i.string);var f=new Request(t,c);fetch(f,c).then(function(e){return s._rnctx.callFunction("RCTDeviceEventEmitter","emit",["didReceiveNetworkResponse",[n,e.status,[]]]),"text"===a?e.text().then(function(e){return s._handleText(n,e)}):e.blob().then(function(e){return s._handleBase64(n,e)})}).catch(function(e){console.error(e)})}},{key:"_handleText",value:function(e,t){this._rnctx.callFunction("RCTDeviceEventEmitter","emit",["didReceiveNetworkData",[e,t]]),this._rnctx.callFunction("RCTDeviceEventEmitter","emit",["didCompleteNetworkResponse",[e,null]])}},{key:"_handleBase64",value:function(e,t){var n=this,r=new FileReader;r.onload=function(t){var r=t.target.result.indexOf(";base64,");r=r>=0?r+8:r,n._rnctx.callFunction("RCTDeviceEventEmitter","emit",["didReceiveNetworkData",[e,t.target.result.slice(r)]]),n._rnctx.callFunction("RCTDeviceEventEmitter","emit",["didCompleteNetworkResponse",[e,null]])},r.readAsDataURL(t)}}]),t}(a.default);r.default=l},29);
__d(function(e,t,r,l){Object.defineProperty(l,"__esModule",{value:!0});var a=t(19),n=babelHelpers.interopRequireDefault(a),o=function(e){function t(){babelHelpers.classCallCheck(this,t);var e=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"PlatformConstants"));return e.reactNativeVersion={major:0,minor:49,patch:5,prerelease:null},e}return babelHelpers.inherits(t,e),t}(n.default);l.default=o},30);
__d(function(e,i,r,t){function o(){this._resourceDictionaries={},this._resourceListener={};for(var e in this._validProtocols)this._resourceDictionaries[e]={}}Object.defineProperty(t,"__esModule",{value:!0}),t.RCTResourceManager=o,o.prototype=babelHelpers.extends(Object.create(Object.prototype),{constructor:o,_validProtocols:{MonoTexture:"MonoTexture"},isValidProtocol:function(e){return this._validProtocols[e]===e},isValidUrl:function(e){var i=this.parseUrl(e);return i.protocol&&i.handle&&this.isValidProtocol(i.protocol)},parseUrl:function(e){var i=void 0,r=void 0;if(e){var t=e.indexOf("://");t>-1&&(i=e.slice(0,t),r=e.slice(t+3))}return{protocol:i,handle:r}},genUrl:function(e,i){return e+"://"+i},addListener:function(e,i){i&&(void 0===this._resourceListener[e]&&(this._resourceListener[e]=[]),this._resourceListener[e].indexOf(i)===-1&&this._resourceListener[e].push(i))},removeListener:function(e,i){var r=this._resourceListener[e];if(void 0!==r&&void 0!==i){var t=r.indexOf(i);t!==-1&&r.splice(t,1)}},_dispatchUpdate:function(e,i){var r=this.genUrl(e,i);if(this._resourceListener[r])for(var t=0;t<this._resourceListener[r].length;t++){var o=this._resourceListener[r][t];o(r)}},addResource:function(e,i,r){this.isValidProtocol()&&(this._resourceDictionaries[e][i]=r,this._dispatchUpdate(e,i))},getResource:function(e,i){if(this.isValidProtocol())return this._resourceDictionaries[e]?this._resourceDictionaries[e][i]:void 0},removeResource:function(e,i){this.isValidProtocol()&&this._resourceDictionaries[e]&&(delete this._resourceDictionaries[e][i],this._dispatchUpdate(e,i))}})},31);
__d(function(t,e,n,i){function r(t){return"GamepadInputEvent"===t.type&&0===t.button&&"keyup"===t.eventType||"KeyboardInputEvent"===t.type&&"Space"===t.code&&"keyup"===t.eventType}Object.defineProperty(i,"__esModule",{value:!0}),i.RCTInputControls=void 0;var c=e(33);e(17);i.RCTInputControls=function(){function t(e,n){babelHelpers.classCallCheck(this,t),this._rnctx=e,this._guiSys=n,n.eventDispatcher.addEventListener("GuiSysEvent",this._onInputEvent.bind(this)),n.eventDispatcher.addEventListener("InputChannelEvent",this._onInputChannelEvent.bind(this))}return babelHelpers.createClass(t,[{key:"_onInputEvent",value:function(t){if(t.eventType===c.GuiSysEventType.INPUT_EVENT){var e=this._rnctx.lastHit?this._rnctx.getHitTag(this._rnctx.lastHit):null;if(e){var n=this._rnctx.lastSource;this._rnctx.callFunction("RCTEventEmitter","receiveEvent",[e,"topInput",{inputEvent:t.args.inputEvent,target:e,source:n}]),r(t.args.inputEvent)&&this._rnctx.callFunction("RCTEventEmitter","receiveEvent",[e,"topChange",[]])}this._rnctx.callFunction("RCTDeviceEventEmitter","emit",["onReceivedInputEvent",t.args.inputEvent,e])}}},{key:"_onInputChannelEvent",value:function(t){var e=this._rnctx.lastHit?this._rnctx.getHitTag(this._rnctx.lastHit):null;if(e){var n=this._rnctx.lastSource;this._rnctx.callFunction("RCTEventEmitter","receiveEvent",[e,"topInput",{inputEvent:t.args,target:e,source:n}])}this._rnctx.callFunction("RCTDeviceEventEmitter","emit",["onReceivedInputEvent",t.args,e])}}]),t}()},32);
__d(function(e,t,s,i){Object.defineProperty(i,"__esModule",{value:!0});i.GuiSysEventType={HIT_CHANGED:"HIT_CHANGED",INPUT_EVENT:"INPUT_EVENT"},i.GuiSysEvent=function e(t,s){babelHelpers.classCallCheck(this,e),this.type="GuiSysEvent",this.eventType=t,this.args=s},i.UIViewEventType={FOCUS_LOST:"FOCUS_LOST",FOCUS_GAINED:"FOCUS_GAINED"},i.UIViewEvent=function e(t,s,i){babelHelpers.classCallCheck(this,e),this.type="UIViewEvent",this.view=t,this.eventType=s,this.args=i}},33);
__d(function(e,t,r,a){Object.defineProperty(a,"__esModule",{value:!0});var i=t(35),n=babelHelpers.interopRequireWildcard(i),l=function(){function e(t){babelHelpers.classCallCheck(this,e),this._rnctx=t}return babelHelpers.createClass(e,[{key:"sendHeadModel",value:function(e){e.updateMatrixWorld(!0);var t=e.matrixWorld,r=new n.Matrix4;r.getInverse(t);var a=t.toArray(),i=r.toArray(),l=this._rnctx.lastHit?this._rnctx.getHitTag(this._rnctx.lastHit):null,c=this._rnctx.lastSource;l&&this._rnctx.callFunction("RCTEventEmitter","receiveEvent",[l,"topHeadPose",{headMatrix:a,viewMatrix:i,target:l,source:c}]),this._rnctx.callFunction("RCTDeviceEventEmitter","emit",["onReceivedHeadMatrix",a,i,e.fov,e.aspect])}},{key:"frame",value:function(e){this.sendHeadModel(e)}}]),e}();a.default=l},34);
__d(function(e,t,i,r){!function(e,t){"object"==typeof r&&"undefined"!=typeof i?t(r):"function"==typeof define&&define.amd?define(["exports"],t):t(e.THREE=e.THREE||{})}(this,function(e){"use strict";function t(){}function i(e,t){this.x=e||0,this.y=t||0}function r(e,t,n,a,o,s,c,l,h,u){Object.defineProperty(this,"id",{value:Cs++}),this.uuid=Ps.generateUUID(),this.name="",this.image=void 0!==e?e:r.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:r.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:To,this.wrapT=void 0!==a?a:To,this.magFilter=void 0!==o?o:Po,this.minFilter=void 0!==s?s:Io,this.anisotropy=void 0!==h?h:1,this.format=void 0!==c?c:qo,this.type=void 0!==l?l:Uo,this.offset=new i(0,0),this.repeat=new i(1,1),this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==u?u:bs,this.version=0,this.onUpdate=null}function n(e,t,i,r){this.x=e||0,this.y=t||0,this.z=i||0,this.w=void 0!==r?r:1}function a(e,t,i){this.uuid=Ps.generateUUID(),this.width=e,this.height=t,this.scissor=new n(0,0,e,t),this.scissorTest=!1,this.viewport=new n(0,0,e,t),i=i||{},void 0===i.minFilter&&(i.minFilter=Po),this.texture=new r(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0===i.stencilBuffer||i.stencilBuffer,this.depthTexture=void 0!==i.depthTexture?i.depthTexture:null}function o(e,t,i){a.call(this,e,t,i),this.activeCubeFace=0,this.activeMipMapLevel=0}function s(e,t,i,r){this._x=e||0,this._y=t||0,this._z=i||0,this._w=void 0!==r?r:1}function c(e,t,i){this.x=e||0,this.y=t||0,this.z=i||0}function l(){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 h(e,t,i,n,a,o,s,c,l,h,u,p){r.call(this,null,o,s,c,l,h,n,a,u,p),this.image={data:e,width:t,height:i},this.magFilter=void 0!==l?l:Ao,this.minFilter=void 0!==h?h:Ao,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function u(e,t,i,n,a,o,s,c,l,h){e=void 0!==e?e:[],t=void 0!==t?t:go,r.call(this,e,t,i,n,a,o,s,c,l,h),this.flipY=!1}function p(){this.seq=[],this.map={}}function d(e,t,i){var r=e[0];if(r<=0||r>0)return e;var n=t*i,a=Ns[n];if(void 0===a&&(a=new Float32Array(n),Ns[n]=a),0!==t){r.toArray(a,0);for(var o=1,s=0;o!==t;++o)s+=i,e[o].toArray(a,s)}return a}function f(e,t){var i=Ds[t];void 0===i&&(i=new Int32Array(t),Ds[t]=i);for(var r=0;r!==t;++r)i[r]=e.allocTextureUnit();return i}function m(e,t){e.uniform1f(this.addr,t)}function v(e,t){e.uniform1i(this.addr,t)}function g(e,t){void 0===t.x?e.uniform2fv(this.addr,t):e.uniform2f(this.addr,t.x,t.y)}function y(e,t){void 0!==t.x?e.uniform3f(this.addr,t.x,t.y,t.z):void 0!==t.r?e.uniform3f(this.addr,t.r,t.g,t.b):e.uniform3fv(this.addr,t)}function x(e,t){void 0===t.x?e.uniform4fv(this.addr,t):e.uniform4f(this.addr,t.x,t.y,t.z,t.w)}function b(e,t){e.uniformMatrix2fv(this.addr,!1,t.elements||t)}function _(e,t){void 0===t.elements?e.uniformMatrix3fv(this.addr,!1,t):(Bs.set(t.elements),e.uniformMatrix3fv(this.addr,!1,Bs))}function w(e,t){void 0===t.elements?e.uniformMatrix4fv(this.addr,!1,t):(Fs.set(t.elements),e.uniformMatrix4fv(this.addr,!1,Fs))}function M(e,t,i){var r=i.allocTextureUnit();e.uniform1i(this.addr,r),i.setTexture2D(t||Is,r)}function E(e,t,i){var r=i.allocTextureUnit();e.uniform1i(this.addr,r),i.setTextureCube(t||Us,r)}function T(e,t){e.uniform2iv(this.addr,t)}function S(e,t){e.uniform3iv(this.addr,t)}function A(e,t){e.uniform4iv(this.addr,t)}function R(e){switch(e){case 5126:return m;case 35664:return g;case 35665:return y;case 35666:return x;case 35674:return b;case 35675:return _;case 35676:return w;case 35678:case 36198:return M;case 35680:return E;case 5124:case 35670:return v;case 35667:case 35671:return T;case 35668:case 35672:return S;case 35669:case 35673:return A}}function L(e,t){e.uniform1fv(this.addr,t)}function P(e,t){e.uniform1iv(this.addr,t)}function C(e,t){e.uniform2fv(this.addr,d(t,this.size,2))}function I(e,t){e.uniform3fv(this.addr,d(t,this.size,3))}function U(e,t){e.uniform4fv(this.addr,d(t,this.size,4))}function N(e,t){e.uniformMatrix2fv(this.addr,!1,d(t,this.size,4))}function D(e,t){e.uniformMatrix3fv(this.addr,!1,d(t,this.size,9))}function F(e,t){e.uniformMatrix4fv(this.addr,!1,d(t,this.size,16))}function B(e,t,i){var r=t.length,n=f(i,r);e.uniform1iv(this.addr,n);for(var a=0;a!==r;++a)i.setTexture2D(t[a]||Is,n[a])}function O(e,t,i){var r=t.length,n=f(i,r);e.uniform1iv(this.addr,n);for(var a=0;a!==r;++a)i.setTextureCube(t[a]||Us,n[a])}function z(e){switch(e){case 5126:return L;case 35664:return C;case 35665:return I;case 35666:return U;case 35674:return N;case 35675:return D;case 35676:return F;case 35678:return B;case 35680:return O;case 5124:case 35670:return P;case 35667:case 35671:return T;case 35668:case 35672:return S;case 35669:case 35673:return A}}function H(e,t,i){this.id=e,this.addr=i,this.setValue=R(t.type)}function G(e,t,i){this.id=e,this.addr=i,this.size=t.size,this.setValue=z(t.type)}function V(e){this.id=e,p.call(this)}function k(e,t){e.seq.push(t),e.map[t.id]=t}function W(e,t,i){var r=e.name,n=r.length;for(Os.lastIndex=0;;){var a=Os.exec(r),o=Os.lastIndex,s=a[1],c="]"===a[2],l=a[3];if(c&&(s|=0),void 0===l||"["===l&&o+2===n){k(i,void 0===l?new H(s,e,t):new G(s,e,t));break}var h=i.map,u=h[s];void 0===u&&(u=new V(s),k(i,u)),i=u}}function j(e,t,i){p.call(this),this.renderer=i;for(var r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),n=0;n<r;++n){var a=e.getActiveUniform(t,n),o=a.name,s=e.getUniformLocation(t,o);W(a,s,this)}}function X(e,t,i){return void 0===t&&void 0===i?this.set(e):this.setRGB(e,t,i)}function q(e,t){this.min=void 0!==e?e:new i(+(1/0),+(1/0)),this.max=void 0!==t?t:new i(-(1/0),-(1/0))}function Y(e,t,r,n,a){function o(){var e=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),i=new Uint16Array([0,1,2,0,2,3]);l=t.createBuffer(),h=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferData(t.ARRAY_BUFFER,e,t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,h),t.bufferData(t.ELEMENT_ARRAY_BUFFER,i,t.STATIC_DRAW),m=t.createTexture(),v=t.createTexture(),r.bindTexture(t.TEXTURE_2D,m),t.texImage2D(t.TEXTURE_2D,0,t.RGB,16,16,0,t.RGB,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),r.bindTexture(t.TEXTURE_2D,v),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,16,16,0,t.RGBA,t.UNSIGNED_BYTE,null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.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() {","vUV = uv;","vec2 pos = position;","if ( renderType == 2 ) {","vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );","vVisibility =        visibility.r / 9.0;","vVisibility *= 1.0 - visibility.g / 9.0;","vVisibility *=       visibility.b / 9.0;","vVisibility *= 1.0 - visibility.a / 9.0;","pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;","pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;","}","gl_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() {","if ( renderType == 0 ) {","gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );","} else if ( renderType == 1 ) {","gl_FragColor = texture2D( map, vUV );","} else {","vec4 texture = texture2D( map, vUV );","texture.a *= opacity * vVisibility;","gl_FragColor = texture;","gl_FragColor.rgb *= color;","}","}"].join("\n")},p=s(u),d={vertex:t.getAttribLocation(p,"position"),uv:t.getAttribLocation(p,"uv")},f={renderType:t.getUniformLocation(p,"renderType"),map:t.getUniformLocation(p,"map"),occlusionMap:t.getUniformLocation(p,"occlusionMap"),opacity:t.getUniformLocation(p,"opacity"),color:t.getUniformLocation(p,"color"),scale:t.getUniformLocation(p,"scale"),rotation:t.getUniformLocation(p,"rotation"),screenPosition:t.getUniformLocation(p,"screenPosition")}}function s(e){var i=t.createProgram(),r=t.createShader(t.FRAGMENT_SHADER),n=t.createShader(t.VERTEX_SHADER),o="precision "+a.precision+" float;\n";return t.shaderSource(r,o+e.fragmentShader),t.shaderSource(n,o+e.vertexShader),t.compileShader(r),t.compileShader(n),t.attachShader(i,r),t.attachShader(i,n),t.linkProgram(i),i}var l,h,u,p,d,f,m,v;this.render=function(e,a,s,u){if(0!==e.length){var g=new c,y=u.w/u.z,x=.5*u.z,b=.5*u.w,_=16/u.w,w=new i(_*y,_),M=new c(1,1,0),E=new i(1,1),T=new q;T.min.set(u.x,u.y),T.max.set(u.x+(u.z-16),u.y+(u.w-16)),void 0===p&&o(),r.useProgram(p),r.initAttributes(),r.enableAttribute(d.vertex),r.enableAttribute(d.uv),r.disableUnusedAttributes(),t.uniform1i(f.occlusionMap,0),t.uniform1i(f.map,1),t.bindBuffer(t.ARRAY_BUFFER,l),t.vertexAttribPointer(d.vertex,2,t.FLOAT,!1,16,0),t.vertexAttribPointer(d.uv,2,t.FLOAT,!1,16,8),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,h),r.disable(t.CULL_FACE),r.buffers.depth.setMask(!1);for(var S=0,A=e.length;S<A;S++){_=16/u.w,w.set(_*y,_);var R=e[S];if(g.set(R.matrixWorld.elements[12],R.matrixWorld.elements[13],R.matrixWorld.elements[14]),g.applyMatrix4(s.matrixWorldInverse),g.applyMatrix4(s.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){r.activeTexture(t.TEXTURE0),r.bindTexture(t.TEXTURE_2D,null),r.activeTexture(t.TEXTURE1),r.bindTexture(t.TEXTURE_2D,m),t.copyTexImage2D(t.TEXTURE_2D,0,t.RGB,E.x,E.y,16,16,0),t.uniform1i(f.renderType,0),t.uniform2f(f.scale,w.x,w.y),t.uniform3f(f.screenPosition,M.x,M.y,M.z),r.disable(t.BLEND),r.enable(t.DEPTH_TEST),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0),r.activeTexture(t.TEXTURE0),r.bindTexture(t.TEXTURE_2D,v),t.copyTexImage2D(t.TEXTURE_2D,0,t.RGBA,E.x,E.y,16,16,0),t.uniform1i(f.renderType,1),r.disable(t.DEPTH_TEST),r.activeTexture(t.TEXTURE1),r.bindTexture(t.TEXTURE_2D,m),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0),R.positionScreen.copy(M),R.customUpdateCallback?R.customUpdateCallback(R):R.updateLensFlares(),t.uniform1i(f.renderType,2),r.enable(t.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=_,t.uniform3f(f.screenPosition,M.x,M.y,M.z),t.uniform2f(f.scale,w.x,w.y),t.uniform1f(f.rotation,C.rotation),t.uniform1f(f.opacity,C.opacity),t.uniform3f(f.color,C.color.r,C.color.g,C.color.b),r.setBlending(C.blending,C.blendEquation,C.blendSrc,C.blendDst),n.setTexture2D(C.texture,1),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0))}}}r.enable(t.CULL_FACE),r.enable(t.DEPTH_TEST),r.buffers.depth.setMask(!0),r.reset()}}}function Z(e,t,i,n,a,o,s,c,l){r.call(this,e,t,i,n,a,o,s,c,l),this.needsUpdate=!0}function J(e,t,i,r,n){function a(){var e=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),i=new Uint16Array([0,1,2,0,2,3]);h=t.createBuffer(),u=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,h),t.bufferData(t.ARRAY_BUFFER,e,t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,u),t.bufferData(t.ELEMENT_ARRAY_BUFFER,i,t.STATIC_DRAW),p=o(),d={position:t.getAttribLocation(p,"position"),uv:t.getAttribLocation(p,"uv")},f={uvOffset:t.getUniformLocation(p,"uvOffset"),uvScale:t.getUniformLocation(p,"uvScale"),rotation:t.getUniformLocation(p,"rotation"),scale:t.getUniformLocation(p,"scale"),color:t.getUniformLocation(p,"color"),map:t.getUniformLocation(p,"map"),opacity:t.getUniformLocation(p,"opacity"),modelViewMatrix:t.getUniformLocation(p,"modelViewMatrix"),projectionMatrix:t.getUniformLocation(p,"projectionMatrix"),fogType:t.getUniformLocation(p,"fogType"),fogDensity:t.getUniformLocation(p,"fogDensity"),fogNear:t.getUniformLocation(p,"fogNear"),fogFar:t.getUniformLocation(p,"fogFar"),fogColor:t.getUniformLocation(p,"fogColor"),alphaTest:t.getUniformLocation(p,"alphaTest")};var r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");r.width=8,r.height=8;var n=r.getContext("2d");n.fillStyle="white",n.fillRect(0,0,8,8),m=new Z(r)}function o(){var e=t.createProgram(),i=t.createShader(t.VERTEX_SHADER),r=t.createShader(t.FRAGMENT_SHADER);return t.shaderSource(i,["precision "+n.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;","void main() {","vUV = uvOffset + uv * uvScale;","vec2 alignedPosition = position * scale;","vec2 rotatedPosition;","rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;","rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;","vec4 finalPosition;","finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );","finalPosition.xy += rotatedPosition;","finalPosition = projectionMatrix * finalPosition;","gl_Position = finalPosition;","}"].join("\n")),t.shaderSource(r,["precision "+n.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;","void main() {","vec4 texture = texture2D( map, vUV );","if ( texture.a < alphaTest ) discard;","gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );","if ( fogType > 0 ) {","float depth = gl_FragCoord.z / gl_FragCoord.w;","float fogFactor = 0.0;","if ( fogType == 1 ) {","fogFactor = smoothstep( fogNear, fogFar, depth );","} else {","const float LOG2 = 1.442695;","fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );","fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","}","gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );","}","}"].join("\n")),t.compileShader(i),t.compileShader(r),t.attachShader(e,i),t.attachShader(e,r),t.linkProgram(e),e}function l(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:t.id-e.id}var h,u,p,d,f,m,v=new c,g=new s,y=new c;this.render=function(n,o,s){if(0!==n.length){void 0===p&&a(),i.useProgram(p),i.initAttributes(),i.enableAttribute(d.position),i.enableAttribute(d.uv),i.disableUnusedAttributes(),i.disable(t.CULL_FACE),i.enable(t.BLEND),t.bindBuffer(t.ARRAY_BUFFER,h),t.vertexAttribPointer(d.position,2,t.FLOAT,!1,16,0),t.vertexAttribPointer(d.uv,2,t.FLOAT,!1,16,8),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,u),t.uniformMatrix4fv(f.projectionMatrix,!1,s.projectionMatrix.elements),i.activeTexture(t.TEXTURE0),t.uniform1i(f.map,0);var c=0,x=0,b=o.fog;b?(t.uniform3f(f.fogColor,b.color.r,b.color.g,b.color.b),b.isFog?(t.uniform1f(f.fogNear,b.near),t.uniform1f(f.fogFar,b.far),t.uniform1i(f.fogType,1),c=1,x=1):b.isFogExp2&&(t.uniform1f(f.fogDensity,b.density),t.uniform1i(f.fogType,2),c=2,x=2)):(t.uniform1i(f.fogType,0),c=0,x=0);for(var _=0,w=n.length;_<w;_++){var M=n[_];M.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,M.matrixWorld),M.z=-M.modelViewMatrix.elements[14]}n.sort(l);for(var E=[],_=0,w=n.length;_<w;_++){var M=n[_],T=M.material;if(T.visible!==!1){M.onBeforeRender(e,o,s,void 0,T,void 0),t.uniform1f(f.alphaTest,T.alphaTest),t.uniformMatrix4fv(f.modelViewMatrix,!1,M.modelViewMatrix.elements),M.matrixWorld.decompose(v,g,y),E[0]=y.x,E[1]=y.y;var S=0;o.fog&&T.fog&&(S=x),c!==S&&(t.uniform1i(f.fogType,S),c=S),null!==T.map?(t.uniform2f(f.uvOffset,T.map.offset.x,T.map.offset.y),t.uniform2f(f.uvScale,T.map.repeat.x,T.map.repeat.y)):(t.uniform2f(f.uvOffset,0,0),t.uniform2f(f.uvScale,1,1)),t.uniform1f(f.opacity,T.opacity),t.uniform3f(f.color,T.color.r,T.color.g,T.color.b),t.uniform1f(f.rotation,T.rotation),t.uniform2fv(f.scale,E),i.setBlending(T.blending,T.blendEquation,T.blendSrc,T.blendDst,T.blendEquationAlpha,T.blendSrcAlpha,T.blendDstAlpha,T.premultipliedAlpha),i.buffers.depth.setTest(T.depthTest),i.buffers.depth.setMask(T.depthWrite),r.setTexture2D(T.map||m,0),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0),M.onAfterRender(e,o,s,void 0,T,void 0)}}i.enable(t.CULL_FACE),i.reset()}}}function Q(){Object.defineProperty(this,"id",{value:jl++}),this.uuid=Ps.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=Ia,this.side=Ma,this.flatShading=!1,this.vertexColors=Ra,this.opacity=1,this.transparent=!1,this.blendSrc=Xa,this.blendDst=qa,this.blendEquation=Ba,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 K(e){Q.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!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}function $(e){Q.call(this),this.type="MeshDepthMaterial",this.depthPacking=Rs,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(e)}function ee(e){Q.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new c,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(e)}function te(e,t){this.min=void 0!==e?e:new c(+(1/0),+(1/0),+(1/0)),this.max=void 0!==t?t:new c(-(1/0),-(1/0),-(1/0))}function ie(e,t){this.center=void 0!==e?e:new c,this.radius=void 0!==t?t:0}function re(){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 ne(e,t){this.normal=void 0!==e?e:new c(1,0,0),this.constant=void 0!==t?t:0}function ae(e,t,i,r,n,a){this.planes=[void 0!==e?e:new ne,void 0!==t?t:new ne,void 0!==i?i:new ne,void 0!==r?r:new ne,void 0!==n?n:new ne,void 0!==a?a:new ne]}function oe(e,t,r){function o(t,i,r,n,a,o){var s=t.geometry,c=null,l=x,h=t.customDepthMaterial;if(r&&(l=b,h=t.customDistanceMaterial),h)c=h;else{var u=!1;i.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)),t.isSkinnedMesh&&i.skinning===!1&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t);var p=t.isSkinnedMesh&&i.skinning,d=0;u&&(d|=v),p&&(d|=g),c=l[d]}if(e.localClippingEnabled&&i.clipShadows===!0&&0!==i.clippingPlanes.length){var f=c.uuid,m=i.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=i.visible,c.wireframe=i.wireframe;var M=i.side;return P.renderSingleSided&&M==Ta&&(M=Ma),P.renderReverseSided&&(M===Ma?M=Ea:M===Ea&&(M=Ma)),c.side=M,c.clipShadows=i.clipShadows,c.clippingPlanes=i.clippingPlanes,c.clipIntersection=i.clipIntersection,c.wireframeLinewidth=i.wireframeLinewidth,c.linewidth=i.linewidth,r&&c.isMeshDistanceMaterial&&(c.referencePosition.copy(n),c.nearDistance=a,c.farDistance=o),c}function s(i,r,n,a){if(i.visible!==!1){var c=i.layers.test(r.layers);if(c&&(i.isMesh||i.isLine||i.isPoints)&&i.castShadow&&(!i.frustumCulled||h.intersectsObject(i))){i.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,i.matrixWorld);var l=t.update(i),u=i.material;if(Array.isArray(u))for(var p=l.groups,d=0,f=p.length;d<f;d++){var v=p[d],g=u[v.materialIndex];if(g&&g.visible){var y=o(i,g,a,m,n.near,n.far);e.renderBufferDirect(n,null,l,y,i,v)}}else if(u.visible){var y=o(i,u,a,m,n.near,n.far);e.renderBufferDirect(n,null,l,y,i,null)}}for(var x=i.children,b=0,_=x.length;b<_;b++)s(x[b],r,n,a)}}for(var h=new ae,u=new l,p=new i,d=new i(r,r),f=new c,m=new c,v=1,g=2,y=(v|g)+1,x=new Array(y),b=new Array(y),_={},w=[new c(1,0,0),new c(-1,0,0),new c(0,0,1),new c(0,0,-1),new c(0,1,0),new c(0,-1,0)],M=[new c(0,1,0),new c(0,1,0),new c(0,1,0),new c(0,1,0),new c(0,0,1),new c(0,0,-1)],E=[new n,new n,new n,new n,new n,new n],T=0;T!==y;++T){var S=0!==(T&v),A=0!==(T&g),R=new $({depthPacking:Ls,morphTargets:S,skinning:A});x[T]=R;var L=new ee({morphTargets:S,skinning:A});b[T]=L}var P=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=_a,this.renderReverseSided=!0,this.renderSingleSided=!0,this.render=function(t,i,r){if(P.enabled!==!1&&(P.autoUpdate!==!1||P.needsUpdate!==!1)&&0!==t.length){var n=e.context,o=e.state;o.disable(n.BLEND),o.buffers.color.setClear(1,1,1,1),o.buffers.depth.setTest(!0),o.setScissorTest(!1);for(var c,l=0,v=t.length;l<v;l++){var g=t[l],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:Ao,magFilter:Ao,format:qo};y.map=new a(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?(c=6,R.makeTranslation(-m.x,-m.y,-m.z)):(c=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)),e.setRenderTarget(A),e.clear();for(var L=0;L<c;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];o.viewport(C)}u.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse),h.setFromMatrix(u),s(i,r,b,x)}}else console.warn("THREE.WebGLShadowMap:",g,"has no shadow.")}P.needsUpdate=!1}}}function se(e){function t(t,i){var r=t.array,n=t.dynamic?e.DYNAMIC_DRAW:e.STATIC_DRAW,a=e.createBuffer();e.bindBuffer(i,a),e.bufferData(i,r,n),t.onUploadCallback();var o=e.FLOAT;return r instanceof Float32Array?o=e.FLOAT:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?o=e.UNSIGNED_SHORT:r instanceof Int16Array?o=e.SHORT:r instanceof Uint32Array?o=e.UNSIGNED_INT:r instanceof Int32Array?o=e.INT:r instanceof Int8Array?o=e.BYTE:r instanceof Uint8Array&&(o=e.UNSIGNED_BYTE),{buffer:a,type:o,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version}}function i(t,i,r){var n=i.array,a=i.updateRange;e.bindBuffer(r,t),i.dynamic===!1?e.bufferData(r,n,e.STATIC_DRAW):a.count===-1?e.bufferSubData(r,0,n):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."):(e.bufferSubData(r,a.offset*n.BYTES_PER_ELEMENT,n.subarray(a.offset,a.offset+a.count)),a.count=-1)}function r(e){return e.isInterleavedBufferAttribute&&(e=e.data),o[e.uuid]}function n(t){t.isInterleavedBufferAttribute&&(t=t.data);var i=o[t.uuid];i&&(e.deleteBuffer(i.buffer),delete o[t.uuid])}function a(e,r){e.isInterleavedBufferAttribute&&(e=e.data);var n=o[e.uuid];void 0===n?o[e.uuid]=t(e,r):n.version<e.version&&(i(n.buffer,e,r),n.version=e.version)}var o={};return{get:r,remove:n,update:a}}function ce(e,t,i,r){this._x=e||0,this._y=t||0,this._z=i||0,this._order=r||ce.DefaultOrder}function le(){this.mask=1}function he(){function e(){n.setFromEuler(r,!1)}function t(){r.setFromQuaternion(n,void 0,!1)}Object.defineProperty(this,"id",{value:Xl++}),this.uuid=Ps.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=he.DefaultUp.clone();var i=new c,r=new ce,n=new s,a=new c(1,1,1);r.onChange(e),n.onChange(t),Object.defineProperties(this,{position:{enumerable:!0,value:i},rotation:{enumerable:!0,value:r},quaternion:{enumerable:!0,value:n},scale:{enumerable:!0,value:a},modelViewMatrix:{value:new l},normalMatrix:{value:new re}}),this.matrix=new l,this.matrixWorld=new l,this.matrixAutoUpdate=he.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new le,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function ue(){he.call(this),this.type="Camera",this.matrixWorldInverse=new l,this.projectionMatrix=new l}function pe(e,t,i,r,n,a){ue.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=void 0!==n?n:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function de(e,t,i,r){ue.call(this),this.type="PerspectiveCamera",this.fov=void 0!==e?e:50,this.zoom=1,this.near=void 0!==i?i:.1,this.far=void 0!==r?r:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function fe(e,t,i,r,n,a){this.a=e,this.b=t,this.c=i,this.normal=r&&r.isVector3?r:new c,this.vertexNormals=Array.isArray(r)?r:[],this.color=n&&n.isColor?n:new X,this.vertexColors=Array.isArray(n)?n:[],this.materialIndex=void 0!==a?a:0}function me(){return ql++}function ve(){Object.defineProperty(this,"id",{value:me()}),this.uuid=Ps.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 ge(e,t,i){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.uuid=Ps.generateUUID(),this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=i===!0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function ye(e,t){ge.call(this,new Int8Array(e),t)}function xe(e,t){ge.call(this,new Uint8Array(e),t)}function be(e,t){ge.call(this,new Uint8ClampedArray(e),t)}function _e(e,t){ge.call(this,new Int16Array(e),t)}function we(e,t){ge.call(this,new Uint16Array(e),t)}function Me(e,t){ge.call(this,new Int32Array(e),t)}function Ee(e,t){ge.call(this,new Uint32Array(e),t)}function Te(e,t){ge.call(this,new Float32Array(e),t)}function Se(e,t){ge.call(this,new Float64Array(e),t)}function Ae(){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 Re(e){if(0===e.length)return-(1/0);for(var t=e[0],i=1,r=e.length;i<r;++i)e[i]>t&&(t=e[i]);return t}function Le(){Object.defineProperty(this,"id",{value:me()}),this.uuid=Ps.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 Pe(e,t,i,r,n,a){ve.call(this),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:n,depthSegments:a},this.fromBufferGeometry(new Ce(e,t,i,r,n,a)),this.mergeVertices()}function Ce(e,t,i,r,n,a){function o(e,t,i,r,n,a,o,m,v,g,y){var x,b,_=a/v,w=o/g,M=a/2,E=o/2,T=m/2,S=v+1,A=g+1,R=0,L=0,P=new c;for(b=0;b<A;b++){var C=b*w-E;for(x=0;x<S;x++){var I=x*_-M;P[e]=I*r,P[t]=C*n,P[i]=T,h.push(P.x,P.y,P.z),P[e]=0,P[t]=0,P[i]=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 U=d+x+S*b,N=d+x+S*(b+1),D=d+(x+1)+S*(b+1),F=d+(x+1)+S*b;l.push(U,N,F),l.push(N,D,F),L+=6}s.addGroup(f,L,y),f+=L,d+=R}Le.call(this),this.type="BoxBufferGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:n,depthSegments:a};var s=this;r=Math.floor(r)||1,n=Math.floor(n)||1,a=Math.floor(a)||1;var l=[],h=[],u=[],p=[],d=0,f=0;o("z","y","x",-1,-1,i,t,e,a,n,0),o("z","y","x",1,-1,i,t,-e,a,n,1),o("x","z","y",1,1,e,i,t,r,a,2),o("x","z","y",1,-1,e,i,-t,r,a,3),o("x","y","z",1,-1,e,t,i,r,n,4),o("x","y","z",-1,-1,e,t,-i,r,n,5),this.setIndex(l),this.addAttribute("position",new Te(h,3)),this.addAttribute("normal",new Te(u,3)),this.addAttribute("uv",new Te(p,2))}function Ie(e,t,i,r){ve.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:r},this.fromBufferGeometry(new Ue(e,t,i,r)),this.mergeVertices()}function Ue(e,t,i,r){Le.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:r};var n,a,o=e/2,s=t/2,c=Math.floor(i)||1,l=Math.floor(r)||1,h=c+1,u=l+1,p=e/c,d=t/l,f=[],m=[],v=[],g=[];for(a=0;a<u;a++){var y=a*d-s;for(n=0;n<h;n++){var x=n*p-o;m.push(x,-y,0),v.push(0,0,1),g.push(n/c),g.push(1-a/l)}}for(a=0;a<l;a++)for(n=0;n<c;n++){var b=n+h*a,_=n+h*(a+1),w=n+1+h*(a+1),M=n+1+h*a;f.push(b,_,M),f.push(_,w,M)}this.setIndex(f),this.addAttribute("position",new Te(m,3)),this.addAttribute("normal",new Te(v,3)),this.addAttribute("uv",new Te(g,2))}function Ne(e){Q.call(this),this.type="MeshBasicMaterial",this.color=new X(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=so,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(e)}function De(e,t){this.origin=void 0!==e?e:new c,this.direction=void 0!==t?t:new c}function Fe(e,t){this.start=void 0!==e?e:new c,this.end=void 0!==t?t:new c}function Be(e,t,i){this.a=void 0!==e?e:new c,this.b=void 0!==t?t:new c,this.c=void 0!==i?i:new c}function Oe(e,t){he.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new Le,this.material=void 0!==t?t:new Ne({color:16777215*Math.random()}),this.drawMode=gs,this.updateMorphTargets()}function ze(e,t,i,r){
function n(t,r,n,u){var p=r.background;null===p?a(l,h):p&&p.isColor&&(a(p,1),u=!0),(e.autoClear||u)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),p&&p.isCubeTexture?(void 0===c&&(c=new Oe(new Ce(1,1,1),new K({uniforms:Wl.cube.uniforms,vertexShader:Wl.cube.vertexShader,fragmentShader:Wl.cube.fragmentShader,side:Ea,depthTest:!0,depthWrite:!1,polygonOffset:!0,fog:!1})),c.geometry.removeAttribute("normal"),c.geometry.removeAttribute("uv"),c.onBeforeRender=function(e,t,i){var r=i.far;this.matrixWorld.makeScale(r,r,r),this.matrixWorld.copyPosition(i.matrixWorld),this.material.polygonOffsetUnits=10*r},i.update(c.geometry)),c.material.uniforms.tCube.value=p,t.push(c,c.geometry,c.material,0,null)):p&&p.isTexture&&(void 0===o&&(o=new pe(-1,1,1,-1,0,1),s=new Oe(new Ue(2,2),new Ne({depthTest:!1,depthWrite:!1,fog:!1})),i.update(s.geometry)),s.material.map=p,e.renderBufferDirect(o,null,s.geometry,s.material,s,null))}function a(e,i){t.buffers.color.setClear(e.r,e.g,e.b,i,r)}var o,s,c,l=new X(0),h=0;return{getClearColor:function(){return l},setClearColor:function(e,t){l.set(e),h=void 0!==t?t:1,a(l,h)},getClearAlpha:function(){return h},setClearAlpha:function(e){h=e,a(l,h)},render:n}}function He(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program&&t.program&&e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function Ge(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function Ve(){function e(){n=0,a.length=0,o.length=0}function t(e,t,i,s,c){var l=r[n];void 0===l?(l={id:e.id,object:e,geometry:t,material:i,program:i.program,renderOrder:e.renderOrder,z:s,group:c},r[n]=l):(l.id=e.id,l.object=e,l.geometry=t,l.material=i,l.program=i.program,l.renderOrder=e.renderOrder,l.z=s,l.group=c),(i.transparent===!0?o:a).push(l),n++}function i(){a.length>1&&a.sort(He),o.length>1&&o.sort(Ge)}var r=[],n=0,a=[],o=[];return{opaque:a,transparent:o,init:e,push:t,sort:i}}function ke(){function e(e,t){var r=e.id+","+t.id,n=i[r];return void 0===n&&(n=new Ve,i[r]=n),n}function t(){i={}}var i={};return{get:e,dispose:t}}function We(e,t){return Math.abs(t[1])-Math.abs(e[1])}function je(e){function t(t,n,a,o){var s=t.morphTargetInfluences,c=s.length,l=i[n.id];if(void 0===l){l=[];for(var h=0;h<c;h++)l[h]=[h,0];i[n.id]=l}for(var u=a.morphTargets&&n.morphAttributes.position,p=a.morphNormals&&n.morphAttributes.normal,h=0;h<c;h++){var d=l[h];0!==d[1]&&(u&&n.removeAttribute("morphTarget"+h),p&&n.removeAttribute("morphNormal"+h))}for(var h=0;h<c;h++){var d=l[h];d[0]=h,d[1]=s[h]}l.sort(We);for(var h=0;h<8;h++){var d=l[h];if(d){var f=d[0],m=d[1];if(m){u&&n.addAttribute("morphTarget"+h,u[f]),p&&n.addAttribute("morphNormal"+h,p[f]),r[h]=m;continue}}r[h]=0}o.getUniforms().setValue(e,"morphTargetInfluences",r)}var i={},r=new Float32Array(8);return{update:t}}function Xe(e,t,i){function r(e){s=e}function n(e){c=e.type,l=e.bytesPerElement}function a(t,r){e.drawElements(s,r,c,t*l),i.calls++,i.vertices+=r,s===e.TRIANGLES?i.faces+=r/3:s===e.POINTS&&(i.points+=r)}function o(r,n,a){var o=t.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,n*l,r.maxInstancedCount),i.calls++,i.vertices+=a*r.maxInstancedCount,void(s===e.TRIANGLES?i.faces+=r.maxInstancedCount*a/3:s===e.POINTS&&(i.points+=r.maxInstancedCount*a)))}var s,c,l;this.setMode=r,this.setIndex=n,this.render=a,this.renderInstances=o}function qe(e,t,i){function r(e){o=e}function n(t,r){e.drawArrays(o,t,r),i.calls++,i.vertices+=r,o===e.TRIANGLES?i.faces+=r/3:o===e.POINTS&&(i.points+=r)}function a(r,n,a){var s=t.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=r.attributes.position;c.isInterleavedBufferAttribute?(a=c.data.count,s.drawArraysInstancedANGLE(o,0,a,r.maxInstancedCount)):s.drawArraysInstancedANGLE(o,n,a,r.maxInstancedCount),i.calls++,i.vertices+=a*r.maxInstancedCount,o===e.TRIANGLES?i.faces+=r.maxInstancedCount*a/3:o===e.POINTS&&(i.points+=r.maxInstancedCount*a)}var o;this.setMode=r,this.render=n,this.renderInstances=a}function Ye(e,t,i){function r(e){var n=e.target,a=s[n.id];null!==a.index&&t.remove(a.index);for(var o in a.attributes)t.remove(a.attributes[o]);n.removeEventListener("dispose",r),delete s[n.id];var l=c[n.id];l&&(t.remove(l),delete c[n.id]),l=c[a.id],l&&(t.remove(l),delete c[a.id]),i.geometries--}function n(e,t){var n=s[t.id];return n?n:(t.addEventListener("dispose",r),t.isBufferGeometry?n=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new Le).setFromObject(e)),n=t._bufferGeometry),s[t.id]=n,i.geometries++,n)}function a(i){var r=i.index,n=i.attributes;null!==r&&t.update(r,e.ELEMENT_ARRAY_BUFFER);for(var a in n)t.update(n[a],e.ARRAY_BUFFER);var o=i.morphAttributes;for(var a in o)for(var s=o[a],c=0,l=s.length;c<l;c++)t.update(s[c],e.ARRAY_BUFFER)}function o(i){var r=c[i.id];if(r)return r;var n=[],a=i.index,o=i.attributes;if(null!==a)for(var s=a.array,l=0,h=s.length;l<h;l+=3){var u=s[l+0],p=s[l+1],d=s[l+2];n.push(u,p,p,d,d,u)}else for(var s=o.position.array,l=0,h=s.length/3-1;l<h;l+=3){var u=l+0,p=l+1,d=l+2;n.push(u,p,p,d,d,u)}return r=new(Re(n)>65535?Ee:we)(n,1),t.update(r,e.ELEMENT_ARRAY_BUFFER),c[i.id]=r,r}var s={},c={};return{get:n,update:a,getWireframeAttribute:o}}function Ze(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var r;switch(t.type){case"DirectionalLight":r={direction:new c,color:new X,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new i};break;case"SpotLight":r={position:new c,direction:new c,color:new X,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new i};break;case"PointLight":r={position:new c,color:new X,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new i,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":r={direction:new c,skyColor:new X,groundColor:new X};break;case"RectAreaLight":r={color:new X,position:new c,halfWidth:new c,halfHeight:new c}}return e[t.id]=r,r}}}function Je(){function e(e,o,s){for(var c=0,l=0,h=0,u=0,p=0,d=0,f=0,m=0,v=s.matrixWorldInverse,g=0,y=e.length;g<y;g++){var x=e[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*_,l+=b.g*_,h+=b.b*_;else if(x.isDirectionalLight){var E=t.get(x);if(E.color.copy(x.color).multiplyScalar(x.intensity),E.direction.setFromMatrixPosition(x.matrixWorld),r.setFromMatrixPosition(x.target.matrixWorld),E.direction.sub(r),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}i.directionalShadowMap[u]=M,i.directionalShadowMatrix[u]=x.shadow.matrix,i.directional[u]=E,u++}else if(x.isSpotLight){var E=t.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),r.setFromMatrixPosition(x.target.matrixWorld),E.direction.sub(r),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}i.spotShadowMap[d]=M,i.spotShadowMatrix[d]=x.shadow.matrix,i.spot[d]=E,d++}else if(x.isRectAreaLight){var E=t.get(x);E.color.copy(b).multiplyScalar(_/(x.width*x.height)),E.position.setFromMatrixPosition(x.matrixWorld),E.position.applyMatrix4(v),a.identity(),n.copy(x.matrixWorld),n.premultiply(v),a.extractRotation(n),E.halfWidth.set(.5*x.width,0,0),E.halfHeight.set(0,.5*x.height,0),E.halfWidth.applyMatrix4(a),E.halfHeight.applyMatrix4(a),i.rectArea[f]=E,f++}else if(x.isPointLight){var E=t.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}i.pointShadowMap[p]=M,i.pointShadowMatrix[p]=x.shadow.matrix,i.point[p]=E,p++}else if(x.isHemisphereLight){var E=t.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(_),i.hemi[m]=E,m++}}i.ambient[0]=c,i.ambient[1]=l,i.ambient[2]=h,i.directional.length=u,i.spot.length=d,i.rectArea.length=f,i.point.length=p,i.hemi.length=m,i.hash=u+","+p+","+d+","+f+","+m+","+o.length}var t=new Ze,i={hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},r=new c,n=new l,a=new l;return{setup:e,state:i}}function Qe(e,t){function i(i){var r=t.frame,a=i.geometry,o=e.get(i,a);return n[o.id]!==r&&(a.isGeometry&&o.updateFromObject(i),e.update(o),n[o.id]=r),o}function r(){n={}}var n={};return{update:i,clear:r}}function Ke(e){for(var t=e.split("\n"),i=0;i<t.length;i++)t[i]=i+1+": "+t[i];return t.join("\n")}function $e(e,t,i){var r=e.createShader(t);return e.shaderSource(r,i),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)===!1&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==e.getShaderInfoLog(r)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",t===e.VERTEX_SHADER?"vertex":"fragment",e.getShaderInfoLog(r),Ke(i)),r}function et(e){switch(e){case bs:return["Linear","( value )"];case _s:return["sRGB","( value )"];case Ms:return["RGBE","( value )"];case Ts:return["RGBM","( value, 7.0 )"];case Ss:return["RGBM","( value, 16.0 )"];case As:return["RGBD","( value, 256.0 )"];case ws:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+e)}}function tt(e,t){var i=et(t);return"vec4 "+e+"( vec4 value ) { return "+i[0]+"ToLinear"+i[1]+"; }"}function it(e,t){var i=et(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+i[0]+i[1]+"; }"}function rt(e,t){var i;switch(t){case uo:i="Linear";break;case po:i="Reinhard";break;case fo:i="Uncharted2";break;case mo:i="OptimizedCineon";break;default:throw new Error("unsupported toneMapping: "+t)}return"vec3 "+e+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function nt(e,t,i){e=e||{};var r=[e.derivatives||t.envMapCubeUV||t.bumpMap||t.normalMap||t.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(e.fragDepth||t.logarithmicDepthBuffer)&&i.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",e.drawBuffers&&i.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(e.shaderTextureLOD||t.envMap)&&i.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""];return r.filter(st).join("\n")}function at(e){var t=[];for(var i in e){var r=e[i];r!==!1&&t.push("#define "+i+" "+r)}return t.join("\n")}function ot(e,t,i){for(var r={},n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),a=0;a<n;a++){var o=e.getActiveAttrib(t,a),s=o.name;r[s]=e.getAttribLocation(t,s)}return r}function st(e){return""!==e}function ct(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights)}function lt(e){function t(e,t){var i=kl[t];if(void 0===i)throw new Error("Can not resolve #include <"+t+">");return lt(i)}var i=/^[ \t]*#include +<([\w\d.]+)>/gm;return e.replace(i,t)}function ht(e){function t(e,t,i,r){for(var n="",a=parseInt(t);a<parseInt(i);a++)n+=r.replace(/\[ i \]/g,"[ "+a+" ]");return n}var i=/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;return e.replace(i,t)}function ut(e,t,i,r,n,a){var o=e.context,s=r.defines,c=n.vertexShader,l=n.fragmentShader,h="SHADOWMAP_TYPE_BASIC";a.shadowMapType===_a?h="SHADOWMAP_TYPE_PCF":a.shadowMapType===wa&&(h="SHADOWMAP_TYPE_PCF_SOFT");var u="ENVMAP_TYPE_CUBE",p="ENVMAP_MODE_REFLECTION",d="ENVMAP_BLENDING_MULTIPLY";if(a.envMap){switch(r.envMap.mapping){case go:case yo:u="ENVMAP_TYPE_CUBE";break;case wo:case Mo:u="ENVMAP_TYPE_CUBE_UV";break;case xo:case bo:u="ENVMAP_TYPE_EQUIREC";break;case _o:u="ENVMAP_TYPE_SPHERE"}switch(r.envMap.mapping){case yo:case bo:p="ENVMAP_MODE_REFRACTION"}switch(r.combine){case so:d="ENVMAP_BLENDING_MULTIPLY";break;case co:d="ENVMAP_BLENDING_MIX";break;case lo:d="ENVMAP_BLENDING_ADD"}}var f,m,v=e.gammaFactor>0?e.gammaFactor:1,g=nt(r.extensions,a,t),y=at(s),x=o.createProgram();r.isRawShaderMaterial?(f=[y,"\n"].filter(st).join("\n"),m=[g,y,"\n"].filter(st).join("\n")):(f=["precision "+a.precision+" float;","precision "+a.precision+" int;","#define SHADER_NAME "+n.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 "+h:"",a.sizeAttenuation?"#define USE_SIZEATTENUATION":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&t.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(st).join("\n"),m=[g,"precision "+a.precision+" float;","precision "+a.precision+" int;","#define SHADER_NAME "+n.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 "+h:"",a.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",a.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&t.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",a.envMap&&t.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",a.toneMapping!==ho?"#define TONE_MAPPING":"",a.toneMapping!==ho?kl.tonemapping_pars_fragment:"",a.toneMapping!==ho?rt("toneMapping",a.toneMapping):"",a.dithering?"#define DITHERING":"",a.outputEncoding||a.mapEncoding||a.envMapEncoding||a.emissiveMapEncoding?kl.encodings_pars_fragment:"",a.mapEncoding?tt("mapTexelToLinear",a.mapEncoding):"",a.envMapEncoding?tt("envMapTexelToLinear",a.envMapEncoding):"",a.emissiveMapEncoding?tt("emissiveMapTexelToLinear",a.emissiveMapEncoding):"",a.outputEncoding?it("linearToOutputTexel",a.outputEncoding):"",a.depthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(st).join("\n")),c=lt(c),c=ct(c,a),l=lt(l),l=ct(l,a),r.isShaderMaterial||(c=ht(c),l=ht(l));var b=f+c,_=m+l,w=$e(o,o.VERTEX_SHADER,b),M=$e(o,o.FRAGMENT_SHADER,_);o.attachShader(x,w),o.attachShader(x,M),void 0!==r.index0AttributeName?o.bindAttribLocation(x,0,r.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:r,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 j(o,x,e)),L};var P;return this.getAttributes=function(){return void 0===P&&(P=ot(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=Yl++,this.code=i,this.usedTimes=1,this.program=x,this.vertexShader=w,this.fragmentShader=M,this}function pt(e,t,i){function r(e){var t=e.skeleton,r=t.bones;if(i.floatVertexTextures)return 1024;var n=i.maxVertexUniforms,a=Math.floor((n-20)/4),o=Math.min(a,r.length);return o<r.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+r.length+" bones. This GPU supports "+o+"."),0):o}function n(e,t){var i;return e?e.isTexture?i=e.encoding:e.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),i=e.texture.encoding):i=bs,i===bs&&t&&(i=ws),i}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(t,a,s,c,l,h,u){var p=o[t.type],d=u.isSkinnedMesh?r(u):0,f=i.precision;null!==t.precision&&(f=i.getMaxPrecision(t.precision),f!==t.precision&&console.warn("THREE.WebGLProgram.getParameters:",t.precision,"not supported, using",f,"instead."));var m=e.getRenderTarget(),v={shaderID:p,precision:f,supportsVertexTextures:i.vertexTextures,outputEncoding:n(m?m.texture:null,e.gammaOutput),map:!!t.map,mapEncoding:n(t.map,e.gammaInput),envMap:!!t.envMap,envMapMode:t.envMap&&t.envMap.mapping,envMapEncoding:n(t.envMap,e.gammaInput),envMapCubeUV:!!t.envMap&&(t.envMap.mapping===wo||t.envMap.mapping===Mo),lightMap:!!t.lightMap,aoMap:!!t.aoMap,emissiveMap:!!t.emissiveMap,emissiveMapEncoding:n(t.emissiveMap,e.gammaInput),bumpMap:!!t.bumpMap,normalMap:!!t.normalMap,displacementMap:!!t.displacementMap,roughnessMap:!!t.roughnessMap,metalnessMap:!!t.metalnessMap,specularMap:!!t.specularMap,alphaMap:!!t.alphaMap,gradientMap:!!t.gradientMap,combine:t.combine,vertexColors:t.vertexColors,fog:!!c,useFog:t.fog,fogExp:c&&c.isFogExp2,flatShading:t.flatShading,sizeAttenuation:t.sizeAttenuation,logarithmicDepthBuffer:i.logarithmicDepthBuffer,skinning:t.skinning&&d>0,maxBones:d,useVertexTexture:i.floatVertexTextures,morphTargets:t.morphTargets,morphNormals:t.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numClippingPlanes:l,numClipIntersection:h,dithering:t.dithering,shadowMapEnabled:e.shadowMap.enabled&&u.receiveShadow&&s.length>0,shadowMapType:e.shadowMap.type,toneMapping:e.toneMapping,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:t.premultipliedAlpha,alphaTest:t.alphaTest,doubleSided:t.side===Ta,flipSided:t.side===Ea,depthPacking:void 0!==t.depthPacking&&t.depthPacking};return v},this.getProgramCode=function(t,i){var r=[];if(i.shaderID?r.push(i.shaderID):(r.push(t.fragmentShader),r.push(t.vertexShader)),void 0!==t.defines)for(var n in t.defines)r.push(n),r.push(t.defines[n]);for(var a=0;a<s.length;a++)r.push(i[s[a]]);return r.push(t.onBeforeCompile.toString()),r.push(e.gammaOutput),r.join()},this.acquireProgram=function(i,r,n,o){for(var s,c=0,l=a.length;c<l;c++){var h=a[c];if(h.code===o){s=h,++s.usedTimes;break}}return void 0===s&&(s=new ut(e,t,o,i,r,n),a.push(s)),s},this.releaseProgram=function(e){if(0===--e.usedTimes){var t=a.indexOf(e);a[t]=a[a.length-1],a.pop(),e.destroy()}},this.programs=a}function dt(e,t,i,r,n,a,o){function s(e,t){if(e.width>t||e.height>t){var i=t/Math.max(e.width,e.height),r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");r.width=Math.floor(e.width*i),r.height=Math.floor(e.height*i);var n=r.getContext("2d");return n.drawImage(e,0,0,e.width,e.height,0,0,r.width,r.height),console.warn("THREE.WebGLRenderer: image is too big ("+e.width+"x"+e.height+"). Resized to "+r.width+"x"+r.height,e),r}return e}function c(e){return Ps.isPowerOfTwo(e.width)&&Ps.isPowerOfTwo(e.height)}function l(e){if(e instanceof HTMLImageElement||e instanceof HTMLCanvasElement){var t=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");t.width=Ps.nearestPowerOfTwo(e.width),t.height=Ps.nearestPowerOfTwo(e.height);var i=t.getContext("2d");return i.drawImage(e,0,0,t.width,t.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+e.width+"x"+e.height+"). Resized to "+t.width+"x"+t.height,e),t}return e}function h(e){return e.wrapS!==To||e.wrapT!==To||e.minFilter!==Ao&&e.minFilter!==Po}function u(e,t){return e.generateMipmaps&&t&&e.minFilter!==Ao&&e.minFilter!==Po}function p(t){return t===Ao||t===Ro||t===Lo?e.NEAREST:e.LINEAR}function d(e){var t=e.target;t.removeEventListener("dispose",d),m(t),o.textures--}function f(e){var t=e.target;t.removeEventListener("dispose",f),v(t),o.textures--}function m(t){var i=r.get(t);if(t.image&&i.__image__webglTextureCube)e.deleteTexture(i.__image__webglTextureCube);else{if(void 0===i.__webglInit)return;e.deleteTexture(i.__webglTexture)}r.remove(t)}function v(t){var i=r.get(t),n=r.get(t.texture);if(t){if(void 0!==n.__webglTexture&&e.deleteTexture(n.__webglTexture),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLRenderTargetCube)for(var a=0;a<6;a++)e.deleteFramebuffer(i.__webglFramebuffer[a]),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer[a]);else e.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer);r.remove(t.texture),r.remove(t)}}function g(t,n){var a=r.get(t);if(t.version>0&&a.__version!==t.version){var o=t.image;if(void 0===o)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",t);else{if(o.complete!==!1)return void _(a,t,n);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",t)}}i.activeTexture(e.TEXTURE0+n),i.bindTexture(e.TEXTURE_2D,a.__webglTexture)}function y(t,l){var h=r.get(t);if(6===t.image.length)if(t.version>0&&h.__version!==t.version){h.__image__webglTextureCube||(t.addEventListener("dispose",d),h.__image__webglTextureCube=e.createTexture(),o.textures++),i.activeTexture(e.TEXTURE0+l),i.bindTexture(e.TEXTURE_CUBE_MAP,h.__image__webglTextureCube),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t.flipY);for(var p=t&&t.isCompressedTexture,f=t.image[0]&&t.image[0].isDataTexture,m=[],v=0;v<6;v++)p||f?m[v]=f?t.image[v].image:t.image[v]:m[v]=s(t.image[v],n.maxCubemapSize);var g=m[0],y=c(g),x=a.convert(t.format),_=a.convert(t.type);b(e.TEXTURE_CUBE_MAP,t,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],t.format!==qo&&t.format!==Xo?i.getCompressedTextureFormats().indexOf(x)>-1?i.compressedTexImage2D(e.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()"):i.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+v,E,x,w.width,w.height,0,x,_,w.data);else f?i.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+v,0,x,m[v].width,m[v].height,0,x,_,m[v].data):i.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+v,0,x,x,_,m[v]);u(t,y)&&e.generateMipmap(e.TEXTURE_CUBE_MAP),h.__version=t.version,t.onUpdate&&t.onUpdate(t)}else i.activeTexture(e.TEXTURE0+l),i.bindTexture(e.TEXTURE_CUBE_MAP,h.__image__webglTextureCube)}function x(t,n){i.activeTexture(e.TEXTURE0+n),i.bindTexture(e.TEXTURE_CUBE_MAP,r.get(t).__webglTexture)}function b(i,o,s){var c;if(s?(e.texParameteri(i,e.TEXTURE_WRAP_S,a.convert(o.wrapS)),e.texParameteri(i,e.TEXTURE_WRAP_T,a.convert(o.wrapT)),e.texParameteri(i,e.TEXTURE_MAG_FILTER,a.convert(o.magFilter)),e.texParameteri(i,e.TEXTURE_MIN_FILTER,a.convert(o.minFilter))):(e.texParameteri(i,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(i,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),o.wrapS===To&&o.wrapT===To||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",o),e.texParameteri(i,e.TEXTURE_MAG_FILTER,p(o.magFilter)),e.texParameteri(i,e.TEXTURE_MIN_FILTER,p(o.minFilter)),o.minFilter!==Ao&&o.minFilter!==Po&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",o)),c=t.get("EXT_texture_filter_anisotropic")){if(o.type===zo&&null===t.get("OES_texture_float_linear"))return;if(o.type===Ho&&null===t.get("OES_texture_half_float_linear"))return;(o.anisotropy>1||r.get(o).__currentAnisotropy)&&(e.texParameterf(i,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,n.getMaxAnisotropy())),r.get(o).__currentAnisotropy=o.anisotropy)}}function _(t,r,p){void 0===t.__webglInit&&(t.__webglInit=!0,r.addEventListener("dispose",d),t.__webglTexture=e.createTexture(),o.textures++),i.activeTexture(e.TEXTURE0+p),i.bindTexture(e.TEXTURE_2D,t.__webglTexture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,r.unpackAlignment);var f=s(r.image,n.maxTextureSize);h(r)&&c(f)===!1&&(f=l(f));var m=c(f),v=a.convert(r.format),g=a.convert(r.type);b(e.TEXTURE_2D,r,m);var y,x=r.mipmaps;if(r.isDepthTexture){var _=e.DEPTH_COMPONENT;if(r.type===zo){if(!R)throw new Error("Float Depth Texture only supported in WebGL2.0");_=e.DEPTH_COMPONENT32F}else R&&(_=e.DEPTH_COMPONENT16);r.format===Qo&&_===e.DEPTH_COMPONENT&&r.type!==Fo&&r.type!==Oo&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=Fo,g=a.convert(r.type)),r.format===Ko&&(_=e.DEPTH_STENCIL,r.type!==Wo&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=Wo,g=a.convert(r.type))),i.texImage2D(e.TEXTURE_2D,0,_,f.width,f.height,0,v,g,null)}else if(r.isDataTexture)if(x.length>0&&m){for(var w=0,M=x.length;w<M;w++)y=x[w],i.texImage2D(e.TEXTURE_2D,w,v,y.width,y.height,0,v,g,y.data);r.generateMipmaps=!1}else i.texImage2D(e.TEXTURE_2D,0,v,f.width,f.height,0,v,g,f.data);else if(r.isCompressedTexture)for(var w=0,M=x.length;w<M;w++)y=x[w],r.format!==qo&&r.format!==Xo?i.getCompressedTextureFormats().indexOf(v)>-1?i.compressedTexImage2D(e.TEXTURE_2D,w,v,y.width,y.height,0,y.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):i.texImage2D(e.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],i.texImage2D(e.TEXTURE_2D,w,v,v,g,y);r.generateMipmaps=!1}else i.texImage2D(e.TEXTURE_2D,0,v,v,g,f);u(r,m)&&e.generateMipmap(e.TEXTURE_2D),t.__version=r.version,r.onUpdate&&r.onUpdate(r)}function w(t,n,o,s){var c=a.convert(n.texture.format),l=a.convert(n.texture.type);i.texImage2D(s,0,c,n.width,n.height,0,c,l,null),e.bindFramebuffer(e.FRAMEBUFFER,t),e.framebufferTexture2D(e.FRAMEBUFFER,o,s,r.get(n.texture).__webglTexture,0),e.bindFramebuffer(e.FRAMEBUFFER,null)}function M(t,i){e.bindRenderbuffer(e.RENDERBUFFER,t),i.depthBuffer&&!i.stencilBuffer?(e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,i.width,i.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t)):i.depthBuffer&&i.stencilBuffer?(e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,i.width,i.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t)):e.renderbufferStorage(e.RENDERBUFFER,e.RGBA4,i.width,i.height),e.bindRenderbuffer(e.RENDERBUFFER,null)}function E(t,i){var n=i&&i.isWebGLRenderTargetCube;if(n)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(e.FRAMEBUFFER,t),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),g(i.depthTexture,0);var a=r.get(i.depthTexture).__webglTexture;if(i.depthTexture.format===Qo)e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a,0);else{
if(i.depthTexture.format!==Ko)throw new Error("Unknown depthTexture format");e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,a,0)}}function T(t){var i=r.get(t),n=t.isWebGLRenderTargetCube===!0;if(t.depthTexture){if(n)throw new Error("target.depthTexture not supported in Cube render targets");E(i.__webglFramebuffer,t)}else if(n){i.__webglDepthbuffer=[];for(var a=0;a<6;a++)e.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[a]),i.__webglDepthbuffer[a]=e.createRenderbuffer(),M(i.__webglDepthbuffer[a],t)}else e.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer=e.createRenderbuffer(),M(i.__webglDepthbuffer,t);e.bindFramebuffer(e.FRAMEBUFFER,null)}function S(t){var n=r.get(t),a=r.get(t.texture);t.addEventListener("dispose",f),a.__webglTexture=e.createTexture(),o.textures++;var s=t.isWebGLRenderTargetCube===!0,l=c(t);if(s){n.__webglFramebuffer=[];for(var h=0;h<6;h++)n.__webglFramebuffer[h]=e.createFramebuffer()}else n.__webglFramebuffer=e.createFramebuffer();if(s){i.bindTexture(e.TEXTURE_CUBE_MAP,a.__webglTexture),b(e.TEXTURE_CUBE_MAP,t.texture,l);for(var h=0;h<6;h++)w(n.__webglFramebuffer[h],t,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+h);u(t.texture,l)&&e.generateMipmap(e.TEXTURE_CUBE_MAP),i.bindTexture(e.TEXTURE_CUBE_MAP,null)}else i.bindTexture(e.TEXTURE_2D,a.__webglTexture),b(e.TEXTURE_2D,t.texture,l),w(n.__webglFramebuffer,t,e.COLOR_ATTACHMENT0,e.TEXTURE_2D),u(t.texture,l)&&e.generateMipmap(e.TEXTURE_2D),i.bindTexture(e.TEXTURE_2D,null);t.depthBuffer&&T(t)}function A(t){var n=t.texture,a=c(t);if(u(n,a)){var o=t.isWebGLRenderTargetCube?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,s=r.get(n).__webglTexture;i.bindTexture(o,s),e.generateMipmap(o),i.bindTexture(o,null)}}var R="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext;this.setTexture2D=g,this.setTextureCube=y,this.setTextureCubeDynamic=x,this.setupRenderTarget=S,this.updateRenderTargetMipmap=A}function ft(){function e(e){var t=e.uuid,i=r[t];return void 0===i&&(i={},r[t]=i),i}function t(e){delete r[e.uuid]}function i(){r={}}var r={};return{get:e,remove:t,clear:i}}function mt(e,t,i){function r(){var t=!1,i=new n,r=null,a=new n(0,0,0,0);return{setMask:function(i){r===i||t||(e.colorMask(i,i,i,i),r=i)},setLocked:function(e){t=e},setClear:function(t,r,n,o,s){s===!0&&(t*=o,r*=o,n*=o),i.set(t,r,n,o),a.equals(i)===!1&&(e.clearColor(t,r,n,o),a.copy(i))},reset:function(){t=!1,r=null,a.set(-1,0,0,0)}}}function a(){var t=!1,i=null,r=null,n=null;return{setTest:function(t){t?p(e.DEPTH_TEST):d(e.DEPTH_TEST)},setMask:function(r){i===r||t||(e.depthMask(r),i=r)},setFunc:function(t){if(r!==t){if(t)switch(t){case $a:e.depthFunc(e.NEVER);break;case eo:e.depthFunc(e.ALWAYS);break;case to:e.depthFunc(e.LESS);break;case io:e.depthFunc(e.LEQUAL);break;case ro:e.depthFunc(e.EQUAL);break;case no:e.depthFunc(e.GEQUAL);break;case ao:e.depthFunc(e.GREATER);break;case oo:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}else e.depthFunc(e.LEQUAL);r=t}},setLocked:function(e){t=e},setClear:function(t){n!==t&&(e.clearDepth(t),n=t)},reset:function(){t=!1,i=null,r=null,n=null}}}function o(){var t=!1,i=null,r=null,n=null,a=null,o=null,s=null,c=null,l=null;return{setTest:function(t){t?p(e.STENCIL_TEST):d(e.STENCIL_TEST)},setMask:function(r){i===r||t||(e.stencilMask(r),i=r)},setFunc:function(t,i,o){r===t&&n===i&&a===o||(e.stencilFunc(t,i,o),r=t,n=i,a=o)},setOp:function(t,i,r){o===t&&s===i&&c===r||(e.stencilOp(t,i,r),o=t,s=i,c=r)},setLocked:function(e){t=e},setClear:function(t){l!==t&&(e.clearStencil(t),l=t)},reset:function(){t=!1,i=null,r=null,n=null,a=null,o=null,s=null,c=null,l=null}}}function s(t,i,r){var n=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(var o=0;o<r;o++)e.texImage2D(i+o,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,n);return a}function c(){for(var e=0,t=N.length;e<t;e++)N[e]=0}function l(i){if(N[i]=1,0===D[i]&&(e.enableVertexAttribArray(i),D[i]=1),0!==F[i]){var r=t.get("ANGLE_instanced_arrays");r.vertexAttribDivisorANGLE(i,0),F[i]=0}}function h(i,r){if(N[i]=1,0===D[i]&&(e.enableVertexAttribArray(i),D[i]=1),F[i]!==r){var n=t.get("ANGLE_instanced_arrays");n.vertexAttribDivisorANGLE(i,r),F[i]=r}}function u(){for(var t=0,i=D.length;t!==i;++t)D[t]!==N[t]&&(e.disableVertexAttribArray(t),D[t]=0)}function p(t){B[t]!==!0&&(e.enable(t),B[t]=!0)}function d(t){B[t]!==!1&&(e.disable(t),B[t]=!1)}function f(){if(null===O&&(O=[],t.get("WEBGL_compressed_texture_pvrtc")||t.get("WEBGL_compressed_texture_s3tc")||t.get("WEBGL_compressed_texture_etc1")))for(var i=e.getParameter(e.COMPRESSED_TEXTURE_FORMATS),r=0;r<i.length;r++)O.push(i[r]);return O}function m(t){return z!==t&&(e.useProgram(t),z=t,!0)}function v(t,r,n,a,o,s,c,l){if(t!==Ca?p(e.BLEND):d(e.BLEND),t!==Fa){if(t!==H||l!==q)switch(t){case Ua:l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE,e.ONE,e.ONE)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.SRC_ALPHA,e.ONE));break;case Na:l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ZERO,e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ONE_MINUS_SRC_ALPHA)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.ONE_MINUS_SRC_COLOR));break;case Da:l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ZERO,e.SRC_COLOR,e.ZERO,e.SRC_ALPHA)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.SRC_COLOR));break;default:l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)):(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA))}G=null,V=null,k=null,W=null,j=null,X=null}else o=o||r,s=s||n,c=c||a,r===G&&o===W||(e.blendEquationSeparate(i.convert(r),i.convert(o)),G=r,W=o),n===V&&a===k&&s===j&&c===X||(e.blendFuncSeparate(i.convert(n),i.convert(a),i.convert(s),i.convert(c)),V=n,k=a,j=s,X=c);H=t,q=l}function g(t){t.side===Ta?d(e.CULL_FACE):p(e.CULL_FACE),y(t.side===Ea),t.transparent===!0?v(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha):v(Ca),C.setFunc(t.depthFunc),C.setTest(t.depthTest),C.setMask(t.depthWrite),P.setMask(t.colorWrite),_(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)}function y(t){Y!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),Y=t)}function x(t){t!==fa?(p(e.CULL_FACE),t!==Z&&(t===ma?e.cullFace(e.BACK):t===va?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):d(e.CULL_FACE),Z=t}function b(t){t!==J&&(te&&e.lineWidth(t),J=t)}function _(t,i,r){t?(p(e.POLYGON_OFFSET_FILL),Q===i&&K===r||(e.polygonOffset(i,r),Q=i,K=r)):d(e.POLYGON_OFFSET_FILL)}function w(t){t?p(e.SCISSOR_TEST):d(e.SCISSOR_TEST)}function M(t){void 0===t&&(t=e.TEXTURE0+$-1),ie!==t&&(e.activeTexture(t),ie=t)}function E(t,i){null===ie&&M();var r=re[ie];void 0===r&&(r={type:void 0,texture:void 0},re[ie]=r),r.type===t&&r.texture===i||(e.bindTexture(t,i||oe[t]),r.type=t,r.texture=i)}function T(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function S(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function A(t){ne.equals(t)===!1&&(e.scissor(t.x,t.y,t.z,t.w),ne.copy(t))}function R(t){ae.equals(t)===!1&&(e.viewport(t.x,t.y,t.z,t.w),ae.copy(t))}function L(){for(var t=0;t<D.length;t++)1===D[t]&&(e.disableVertexAttribArray(t),D[t]=0);B={},O=null,ie=null,re={},z=null,H=null,Y=null,Z=null,P.reset(),C.reset(),I.reset()}var P=new r,C=new a,I=new o,U=e.getParameter(e.MAX_VERTEX_ATTRIBS),N=new Uint8Array(U),D=new Uint8Array(U),F=new Uint8Array(U),B={},O=null,z=null,H=null,G=null,V=null,k=null,W=null,j=null,X=null,q=!1,Y=null,Z=null,J=null,Q=null,K=null,$=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),ee=parseFloat(/^WebGL\ ([0-9])/.exec(e.getParameter(e.VERSION))[1]),te=parseFloat(ee)>=1,ie=null,re={},ne=new n,ae=new n,oe={};return oe[e.TEXTURE_2D]=s(e.TEXTURE_2D,e.TEXTURE_2D,1),oe[e.TEXTURE_CUBE_MAP]=s(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),P.setClear(0,0,0,1),C.setClear(1),I.setClear(0),p(e.DEPTH_TEST),C.setFunc(io),y(!1),x(ma),p(e.CULL_FACE),p(e.BLEND),v(Ia),{buffers:{color:P,depth:C,stencil:I},initAttributes:c,enableAttribute:l,enableAttributeAndDivisor:h,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 vt(e,t,i){function r(){if(void 0!==a)return a;var i=t.get("EXT_texture_filter_anisotropic");return a=null!==i?e.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}function n(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var a,o=void 0!==i.precision?i.precision:"highp",s=n(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var c=i.logarithmicDepthBuffer===!0&&!!t.get("EXT_frag_depth"),l=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),h=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),u=e.getParameter(e.MAX_TEXTURE_SIZE),p=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),d=e.getParameter(e.MAX_VERTEX_ATTRIBS),f=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),m=e.getParameter(e.MAX_VARYING_VECTORS),v=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),g=h>0,y=!!t.get("OES_texture_float"),x=g&&y;return{getMaxAnisotropy:r,getMaxPrecision:n,precision:o,logarithmicDepthBuffer:c,maxTextures:l,maxVertexTextures:h,maxTextureSize:u,maxCubemapSize:p,maxAttributes:d,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:v,vertexTextures:g,floatFragmentTextures:y,floatVertexTextures:x}}function gt(e){de.call(this),this.cameras=e||[]}function yt(e){function t(){if(null!==r&&r.isPresenting){var t=r.getEyeParameters("left"),n=t.renderWidth,a=t.renderHeight;f=e.getPixelRatio(),d=e.getSize(),e.setDrawingBufferSize(2*n,a,1)}else i.enabled&&e.setDrawingBufferSize(d.width,d.height,f)}var i=this,r=null,a=null;"VRFrameData"in window&&(a=new window.VRFrameData);var o=new l,s=new l,c=new l,h=new de;h.bounds=new n(0,0,.5,1),h.layers.enable(1);var u=new de;u.bounds=new n(.5,0,.5,1),u.layers.enable(2);var p=new gt([h,u]);p.layers.enable(1),p.layers.enable(2);var d,f;window.addEventListener("vrdisplaypresentchange",t,!1),this.enabled=!1,this.standing=!1,this.getDevice=function(){return r},this.setDevice=function(e){void 0!==e&&(r=e)},this.getCamera=function(e){if(null===r)return e;r.depthNear=e.near,r.depthFar=e.far,r.getFrameData(a);var t=a.pose;null!==t.position?e.position.fromArray(t.position):e.position.set(0,0,0),null!==t.orientation&&e.quaternion.fromArray(t.orientation),e.updateMatrixWorld();var i=r.stageParameters;if(this.standing&&i&&(s.fromArray(i.sittingToStandingTransform),c.getInverse(s),e.matrixWorld.multiply(s),e.matrixWorldInverse.multiply(c)),r.isPresenting===!1)return e;h.near=e.near,u.near=e.near,h.far=e.far,u.far=e.far,p.matrixWorld.copy(e.matrixWorld),p.matrixWorldInverse.copy(e.matrixWorldInverse),h.matrixWorldInverse.fromArray(a.leftViewMatrix),u.matrixWorldInverse.fromArray(a.rightViewMatrix),this.standing&&i&&(h.matrixWorldInverse.multiply(c),u.matrixWorldInverse.multiply(c));var n=e.parent;null!==n&&(o.getInverse(n.matrixWorld),h.matrixWorldInverse.multiply(o),u.matrixWorldInverse.multiply(o)),h.matrixWorld.getInverse(h.matrixWorldInverse),u.matrixWorld.getInverse(u.matrixWorldInverse),h.projectionMatrix.fromArray(a.leftProjectionMatrix),u.projectionMatrix.fromArray(a.rightProjectionMatrix),p.projectionMatrix.copy(h.projectionMatrix);var l=r.getLayers();if(l.length){var d=l[0];null!==d.leftBounds&&4===d.leftBounds.length&&h.bounds.fromArray(d.leftBounds),null!==d.rightBounds&&4===d.rightBounds.length&&u.bounds.fromArray(d.rightBounds)}return p},this.getStandingMatrix=function(){return s},this.submitFrame=function(){r&&r.isPresenting&&r.submitFrame()},this.dispose=function(){window.removeEventListener("vrdisplaypresentchange",t)}}function xt(e){var t={};return{get:function(i){if(void 0!==t[i])return t[i];var r;switch(i){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":r=e.getExtension("WEBGL_compressed_texture_etc1");break;default:r=e.getExtension(i)}return null===r&&console.warn("THREE.WebGLRenderer: "+i+" extension not supported."),t[i]=r,r}}}function bt(){function e(){l.value!==r&&(l.value=r,l.needsUpdate=n>0),i.numPlanes=n,i.numIntersection=0}function t(e,t,r,n){var a=null!==e?e.length:0,o=null;if(0!==a){if(o=l.value,n!==!0||null===o){var h=r+4*a,u=t.matrixWorldInverse;c.getNormalMatrix(u),(null===o||o.length<h)&&(o=new Float32Array(h));for(var p=0,d=r;p!==a;++p,d+=4)s.copy(e[p]).applyMatrix4(u,c),s.normal.toArray(o,d),o[d+3]=s.constant}l.value=o,l.needsUpdate=!0}return i.numPlanes=a,o}var i=this,r=null,n=0,a=!1,o=!1,s=new ne,c=new re,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(e,i,o){var s=0!==e.length||i||0!==n||a;return a=i,r=t(e,o,0),n=e.length,s},this.beginShadows=function(){o=!0,t(null)},this.endShadows=function(){o=!1,e()},this.setState=function(i,s,c,h,u,p){if(!a||null===i||0===i.length||o&&!c)o?t(null):e();else{var d=o?0:n,f=4*d,m=u.clippingState||null;l.value=m,m=t(i,h,f,p);for(var v=0;v!==f;++v)m[v]=r[v];u.clippingState=m,this.numIntersection=s?this.numPlanes:0,this.numPlanes+=d}}}function _t(e,t){function i(i){var r;if(i===Eo)return e.REPEAT;if(i===To)return e.CLAMP_TO_EDGE;if(i===So)return e.MIRRORED_REPEAT;if(i===Ao)return e.NEAREST;if(i===Ro)return e.NEAREST_MIPMAP_NEAREST;if(i===Lo)return e.NEAREST_MIPMAP_LINEAR;if(i===Po)return e.LINEAR;if(i===Co)return e.LINEAR_MIPMAP_NEAREST;if(i===Io)return e.LINEAR_MIPMAP_LINEAR;if(i===Uo)return e.UNSIGNED_BYTE;if(i===Go)return e.UNSIGNED_SHORT_4_4_4_4;if(i===Vo)return e.UNSIGNED_SHORT_5_5_5_1;if(i===ko)return e.UNSIGNED_SHORT_5_6_5;if(i===No)return e.BYTE;if(i===Do)return e.SHORT;if(i===Fo)return e.UNSIGNED_SHORT;if(i===Bo)return e.INT;if(i===Oo)return e.UNSIGNED_INT;if(i===zo)return e.FLOAT;if(i===Ho&&(r=t.get("OES_texture_half_float"),null!==r))return r.HALF_FLOAT_OES;if(i===jo)return e.ALPHA;if(i===Xo)return e.RGB;if(i===qo)return e.RGBA;if(i===Yo)return e.LUMINANCE;if(i===Zo)return e.LUMINANCE_ALPHA;if(i===Qo)return e.DEPTH_COMPONENT;if(i===Ko)return e.DEPTH_STENCIL;if(i===Ba)return e.FUNC_ADD;if(i===Oa)return e.FUNC_SUBTRACT;if(i===za)return e.FUNC_REVERSE_SUBTRACT;if(i===Va)return e.ZERO;if(i===ka)return e.ONE;if(i===Wa)return e.SRC_COLOR;if(i===ja)return e.ONE_MINUS_SRC_COLOR;if(i===Xa)return e.SRC_ALPHA;if(i===qa)return e.ONE_MINUS_SRC_ALPHA;if(i===Ya)return e.DST_ALPHA;if(i===Za)return e.ONE_MINUS_DST_ALPHA;if(i===Ja)return e.DST_COLOR;if(i===Qa)return e.ONE_MINUS_DST_COLOR;if(i===Ka)return e.SRC_ALPHA_SATURATE;if((i===$o||i===es||i===ts||i===is)&&(r=t.get("WEBGL_compressed_texture_s3tc"),null!==r)){if(i===$o)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===es)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===ts)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===is)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((i===rs||i===ns||i===as||i===os)&&(r=t.get("WEBGL_compressed_texture_pvrtc"),null!==r)){if(i===rs)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===ns)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===as)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===os)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(i===ss&&(r=t.get("WEBGL_compressed_texture_etc1"),null!==r))return r.COMPRESSED_RGB_ETC1_WEBGL;if((i===Ha||i===Ga)&&(r=t.get("EXT_blend_minmax"),null!==r)){if(i===Ha)return r.MIN_EXT;if(i===Ga)return r.MAX_EXT}return i===Wo&&(r=t.get("WEBGL_depth_texture"),null!==r)?r.UNSIGNED_INT_24_8_WEBGL:0}return{convert:i}}function wt(e){function t(){return null===ee?me:1}function i(){Pe=new xt(Ae),Pe.get("WEBGL_depth_texture"),Pe.get("OES_texture_float"),Pe.get("OES_texture_float_linear"),Pe.get("OES_texture_half_float"),Pe.get("OES_texture_half_float_linear"),Pe.get("OES_standard_derivatives"),Pe.get("ANGLE_instanced_arrays"),Pe.get("OES_element_index_uint")&&(Le.MaxIndex=4294967296),tt=new _t(Ae,Pe),Ce=new vt(Ae,Pe,e),Ie=new mt(Ae,Pe,tt),Ie.scissor(he.copy(ge).multiplyScalar(me)),Ie.viewport(le.copy(ve).multiplyScalar(me)),Ue=new ft,Ne=new dt(Ae,Pe,Ie,Ue,Ce,tt,Te),De=new se(Ae),Fe=new Ye(Ae,De,Te),Be=new Qe(Fe,Se),We=new je(Ae),He=new pt(K,Pe,Ce),Oe=new Je,Ge=new ke,Ve=new ze(K,Ie,Fe,V),Ze=new qe(Ae,Pe,Se),Ke=new Xe(Ae,Pe,Se),$e=new Y(K,Ae,Ie,Ne,Ce),et=new J(K,Ae,Ie,Ne,Ce),K.info.programs=He.programs,K.context=Ae,K.capabilities=Ce,K.extensions=Pe,K.properties=Ue,K.renderLists=Ge,K.state=Ie}function r(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),$=!0}function a(e){console.log("THREE.WebGLRenderer: Context Restored."),$=!1,i()}function o(e){var t=e.target;t.removeEventListener("dispose",o),s(t)}function s(e){u(e),Ue.remove(e)}function u(e){var t=Ue.get(e).program;e.program=void 0,void 0!==t&&He.releaseProgram(t)}function p(e,t,i){e.render(function(e){K.renderBufferImmediate(e,t,i)})}function d(e,t,i,r){if(i&&i.isInstancedBufferGeometry&&null===Pe.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===r&&(r=0),Ie.initAttributes();var n=i.attributes,a=t.getAttributes(),o=e.defaultAttributeValues;for(var s in a){var c=a[s];if(c>=0){var l=n[s];if(void 0!==l){var h=l.normalized,u=l.itemSize,p=De.get(l);if(void 0===p)continue;var d=p.buffer,f=p.type,m=p.bytesPerElement;if(l.isInterleavedBufferAttribute){var v=l.data,g=v.stride,y=l.offset;v&&v.isInstancedInterleavedBuffer?(Ie.enableAttributeAndDivisor(c,v.meshPerAttribute),void 0===i.maxInstancedCount&&(i.maxInstancedCount=v.meshPerAttribute*v.count)):Ie.enableAttribute(c),Ae.bindBuffer(Ae.ARRAY_BUFFER,d),Ae.vertexAttribPointer(c,u,f,h,g*m,(r*g+y)*m)}else l.isInstancedBufferAttribute?(Ie.enableAttributeAndDivisor(c,l.meshPerAttribute),void 0===i.maxInstancedCount&&(i.maxInstancedCount=l.meshPerAttribute*l.count)):Ie.enableAttribute(c),Ae.bindBuffer(Ae.ARRAY_BUFFER,d),Ae.vertexAttribPointer(c,u,f,h,0,r*u*m)}else if(void 0!==o){var x=o[s];if(void 0!==x)switch(x.length){case 2:Ae.vertexAttrib2fv(c,x);break;case 3:Ae.vertexAttrib3fv(c,x);break;case 4:Ae.vertexAttrib4fv(c,x);break;default:Ae.vertexAttrib1fv(c,x)}}}}Ie.disableUnusedAttributes()}function f(){nt||((it.getDevice()||window).requestAnimationFrame(m),nt=!0)}function m(e){null!==at&&at(e),(it.getDevice()||window).requestAnimationFrame(m)}function v(e,t,i){if(e.visible){var r=e.layers.test(t.layers);if(r)if(e.isLight)W.push(e),e.castShadow&&X.push(e);else if(e.isSprite)e.frustumCulled&&!xe.intersectsSprite(e)||Z.push(e);else if(e.isLensFlare)Q.push(e);else if(e.isImmediateRenderObject)i&&Ee.setFromMatrixPosition(e.matrixWorld).applyMatrix4(Me),q.push(e,null,e.material,Ee.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.update(),!e.frustumCulled||xe.intersectsObject(e))){i&&Ee.setFromMatrixPosition(e.matrixWorld).applyMatrix4(Me);var n=Be.update(e),a=e.material;if(Array.isArray(a))for(var o=n.groups,s=0,c=o.length;s<c;s++){var l=o[s],h=a[l.materialIndex];h&&h.visible&&q.push(e,n,h,Ee.z,l)}else a.visible&&q.push(e,n,a,Ee.z,null)}for(var u=e.children,s=0,c=u.length;s<c;s++)v(u[s],t,i)}}function g(e,t,i,r){for(var n=0,a=e.length;n<a;n++){var o=e[n],s=o.object,c=o.geometry,l=void 0===r?o.material:r,h=o.group;if(i.isArrayCamera){ce=i;for(var u=i.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*de,g=m.y*fe,x=m.z*de,b=m.w*fe;Ie.viewport(le.set(v,g,x,b).multiplyScalar(me)),y(s,t,f,c,l,h)}}}else ce=null,y(s,t,i,c,l,h)}}function y(e,t,i,r,n,a){if(e.onBeforeRender(K,t,i,r,n,a),e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.isImmediateRenderObject){Ie.setMaterial(n);var o=b(i,t.fog,n,e);re="",p(e,o,n)}else K.renderBufferDirect(i,t.fog,r,n,e,a);e.onAfterRender(K,t,i,r,n,a)}function x(e,t,i){var r=Ue.get(e),n=He.getParameters(e,Oe.state,X,t,be.numPlanes,be.numIntersection,i),a=He.getProgramCode(e,n),s=r.program,c=!0;if(void 0===s)e.addEventListener("dispose",o);else if(s.code!==a)u(e);else{if(void 0!==n.shaderID)return;c=!1}if(c){if(n.shaderID){var l=Wl[n.shaderID];r.shader={name:e.type,uniforms:Gs.clone(l.uniforms),vertexShader:l.vertexShader,fragmentShader:l.fragmentShader}}else r.shader={name:e.type,uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};e.onBeforeCompile(r.shader),s=He.acquireProgram(e,r.shader,n,a),r.program=s,e.program=s}var h=s.getAttributes();if(e.morphTargets){e.numSupportedMorphTargets=0;for(var p=0;p<K.maxMorphTargets;p++)h["morphTarget"+p]>=0&&e.numSupportedMorphTargets++}if(e.morphNormals){e.numSupportedMorphNormals=0;for(var p=0;p<K.maxMorphNormals;p++)h["morphNormal"+p]>=0&&e.numSupportedMorphNormals++}var d=r.shader.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&e.clipping!==!0||(r.numClippingPlanes=be.numPlanes,r.numIntersection=be.numIntersection,d.clippingPlanes=be.uniform),r.fog=t,r.lightsHash=Oe.state.hash,e.lights&&(d.ambientLightColor.value=Oe.state.ambient,d.directionalLights.value=Oe.state.directional,d.spotLights.value=Oe.state.spot,d.rectAreaLights.value=Oe.state.rectArea,d.pointLights.value=Oe.state.point,d.hemisphereLights.value=Oe.state.hemi,d.directionalShadowMap.value=Oe.state.directionalShadowMap,d.directionalShadowMatrix.value=Oe.state.directionalShadowMatrix,d.spotShadowMap.value=Oe.state.spotShadowMap,d.spotShadowMatrix.value=Oe.state.spotShadowMatrix,d.pointShadowMap.value=Oe.state.pointShadowMap,d.pointShadowMatrix.value=Oe.state.pointShadowMatrix);var f=r.program.getUniforms(),m=j.seqWithValue(f.seq,d);r.uniformsList=m}function b(e,t,i,r){pe=0;var n=Ue.get(i);if(_e&&(we||e!==ne)){var a=e===ne&&i.id===ie;be.setState(i.clippingPlanes,i.clipIntersection,i.clipShadows,e,n,a)}i.needsUpdate===!1&&(void 0===n.program?i.needsUpdate=!0:i.fog&&n.fog!==t?i.needsUpdate=!0:i.lights&&n.lightsHash!==Oe.state.hash?i.needsUpdate=!0:void 0===n.numClippingPlanes||n.numClippingPlanes===be.numPlanes&&n.numIntersection===be.numIntersection||(i.needsUpdate=!0)),i.needsUpdate&&(x(i,t,r),i.needsUpdate=!1);var o=!1,s=!1,c=!1,l=n.program,u=l.getUniforms(),p=n.shader.uniforms;if(Ie.useProgram(l.program)&&(o=!0,s=!0,c=!0),i.id!==ie&&(ie=i.id,s=!0),o||e!==ne){if(u.setValue(Ae,"projectionMatrix",e.projectionMatrix),Ce.logarithmicDepthBuffer&&u.setValue(Ae,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),ne!==(ce||e)&&(ne=ce||e,s=!0,c=!0),i.isShaderMaterial||i.isMeshPhongMaterial||i.isMeshStandardMaterial||i.envMap){var d=u.map.cameraPosition;void 0!==d&&d.setValue(Ae,Ee.setFromMatrixPosition(e.matrixWorld))}(i.isMeshPhongMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial||i.skinning)&&u.setValue(Ae,"viewMatrix",e.matrixWorldInverse)}if(i.skinning){u.setOptional(Ae,r,"bindMatrix"),u.setOptional(Ae,r,"bindMatrixInverse");var f=r.skeleton;if(f){var m=f.bones;if(Ce.floatVertexTextures){if(void 0===f.boneTexture){var v=Math.sqrt(4*m.length);v=Ps.nextPowerOfTwo(Math.ceil(v)),v=Math.max(v,4);var g=new Float32Array(v*v*4);g.set(f.boneMatrices);var y=new h(g,v,v,qo,zo);f.boneMatrices=g,f.boneTexture=y,f.boneTextureSize=v}u.setValue(Ae,"boneTexture",f.boneTexture),u.setValue(Ae,"boneTextureSize",f.boneTextureSize)}else u.setOptional(Ae,f,"boneMatrices")}}return s&&(u.setValue(Ae,"toneMappingExposure",K.toneMappingExposure),u.setValue(Ae,"toneMappingWhitePoint",K.toneMappingWhitePoint),i.lights&&N(p,c),t&&i.fog&&T(p,t),i.isMeshBasicMaterial?_(p,i):i.isMeshLambertMaterial?(_(p,i),S(p,i)):i.isMeshPhongMaterial?(_(p,i),i.isMeshToonMaterial?R(p,i):A(p,i)):i.isMeshStandardMaterial?(_(p,i),i.isMeshPhysicalMaterial?P(p,i):L(p,i)):i.isMeshDepthMaterial?(_(p,i),C(p,i)):i.isMeshDistanceMaterial?(_(p,i),I(p,i)):i.isMeshNormalMaterial?(_(p,i),U(p,i)):i.isLineBasicMaterial?(w(p,i),i.isLineDashedMaterial&&M(p,i)):i.isPointsMaterial?E(p,i):i.isShadowMaterial&&(p.color.value=i.color,p.opacity.value=i.opacity),void 0!==p.ltcMat&&(p.ltcMat.value=Hs.LTC_MAT_TEXTURE),void 0!==p.ltcMag&&(p.ltcMag.value=Hs.LTC_MAG_TEXTURE),j.upload(Ae,n.uniformsList,p,K)),u.setValue(Ae,"modelViewMatrix",r.modelViewMatrix),u.setValue(Ae,"normalMatrix",r.normalMatrix),u.setValue(Ae,"modelMatrix",r.matrixWorld),l}function _(e,t){e.opacity.value=t.opacity,t.color&&(e.diffuse.value=t.color),t.emissive&&e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.specularMap&&(e.specularMap.value=t.specularMap),t.envMap&&(e.envMap.value=t.envMap,e.flipEnvMap.value=t.envMap&&t.envMap.isCubeTexture?-1:1,e.reflectivity.value=t.reflectivity,e.refractionRatio.value=t.refractionRatio),t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.aoMap&&(e.aoMap.value=t.aoMap,e.aoMapIntensity.value=t.aoMapIntensity);var i;if(t.map?i=t.map:t.specularMap?i=t.specularMap:t.displacementMap?i=t.displacementMap:t.normalMap?i=t.normalMap:t.bumpMap?i=t.bumpMap:t.roughnessMap?i=t.roughnessMap:t.metalnessMap?i=t.metalnessMap:t.alphaMap?i=t.alphaMap:t.emissiveMap&&(i=t.emissiveMap),void 0!==i){i.isWebGLRenderTarget&&(i=i.texture);var r=i.offset,n=i.repeat;e.offsetRepeat.value.set(r.x,r.y,n.x,n.y)}}function w(e,t){e.diffuse.value=t.color,e.opacity.value=t.opacity}function M(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}function E(e,t){if(e.diffuse.value=t.color,e.opacity.value=t.opacity,e.size.value=t.size*me,e.scale.value=.5*fe,e.map.value=t.map,null!==t.map){var i=t.map.offset,r=t.map.repeat;e.offsetRepeat.value.set(i.x,i.y,r.x,r.y)}}function T(e,t){e.fogColor.value=t.color,t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)}function S(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}function A(e,t){e.specular.value=t.specular,e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale)),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function R(e,t){A(e,t),t.gradientMap&&(e.gradientMap.value=t.gradientMap)}function L(e,t){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale)),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}function P(e,t){e.clearCoat.value=t.clearCoat,e.clearCoatRoughness.value=t.clearCoatRoughness,L(e,t)}function C(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function I(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}function U(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale)),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function N(e,t){e.ambientLightColor.needsUpdate=t,e.directionalLights.needsUpdate=t,e.pointLights.needsUpdate=t,e.spotLights.needsUpdate=t,e.rectAreaLights.needsUpdate=t,e.hemisphereLights.needsUpdate=t}function D(){var e=pe;return e>=Ce.maxTextures&&console.warn("THREE.WebGLRenderer: Trying to use "+e+" texture units while this GPU supports only "+Ce.maxTextures),pe+=1,e}console.log("THREE.WebGLRenderer",pa),e=e||{};var F=void 0!==e.canvas?e.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),B=void 0!==e.context?e.context:null,O=void 0!==e.alpha&&e.alpha,z=void 0===e.depth||e.depth,H=void 0===e.stencil||e.stencil,G=void 0!==e.antialias&&e.antialias,V=void 0===e.premultipliedAlpha||e.premultipliedAlpha,k=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,W=[],X=[],q=null,Z=[],Q=[];this.domElement=F,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=uo,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var K=this,$=!1,ee=null,te=null,ie=-1,re="",ne=null,ce=null,le=new n,he=new n,ue=null,pe=0,de=F.width,fe=F.height,me=1,ve=new n(0,0,de,fe),ge=new n(0,0,de,fe),ye=!1,xe=new ae,be=new bt,_e=!1,we=!1,Me=new l,Ee=new c,Te={geometries:0,textures:0},Se={frame:0,calls:0,vertices:0,faces:0,points:0};this.info={render:Se,memory:Te,programs:null};var Ae;try{var Re={alpha:O,depth:z,stencil:H,antialias:G,premultipliedAlpha:V,preserveDrawingBuffer:k};if(Ae=B||F.getContext("webgl",Re)||F.getContext("experimental-webgl",Re),null===Ae)throw null!==F.getContext("webgl")?"Error creating WebGL context with your selected attributes.":"Error creating WebGL context.";void 0===Ae.getShaderPrecisionFormat&&(Ae.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}}),F.addEventListener("webglcontextlost",r,!1),F.addEventListener("webglcontextrestored",a,!1)}catch(e){console.error("THREE.WebGLRenderer: "+e)}var Pe,Ce,Ie,Ue,Ne,De,Fe,Be,Oe,He,Ge,Ve,We,Ze,Ke,$e,et,tt;i();var it=new yt(K);this.vr=it;var rt=new oe(K,Be,Ce.maxTextureSize);this.shadowMap=rt,this.getContext=function(){return Ae},this.getContextAttributes=function(){return Ae.getContextAttributes()},this.forceContextLoss=function(){var e=Pe.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){var e=Pe.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return me},this.setPixelRatio=function(e){void 0!==e&&(me=e,this.setSize(de,fe,!1))},this.getSize=function(){return{width:de,height:fe}},this.setSize=function(e,t,i){var r=it.getDevice();return r&&r.isPresenting?void console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(de=e,fe=t,F.width=e*me,F.height=t*me,
i!==!1&&(F.style.width=e+"px",F.style.height=t+"px"),void this.setViewport(0,0,e,t))},this.getDrawingBufferSize=function(){return{width:de*me,height:fe*me}},this.setDrawingBufferSize=function(e,t,i){de=e,fe=t,me=i,F.width=e*i,F.height=t*i,this.setViewport(0,0,e,t)},this.setViewport=function(e,t,i,r){ve.set(e,fe-t-r,i,r),Ie.viewport(le.copy(ve).multiplyScalar(me))},this.setScissor=function(e,t,i,r){ge.set(e,fe-t-r,i,r),Ie.scissor(he.copy(ge).multiplyScalar(me))},this.setScissorTest=function(e){Ie.setScissorTest(ye=e)},this.getClearColor=Ve.getClearColor,this.setClearColor=Ve.setClearColor,this.getClearAlpha=Ve.getClearAlpha,this.setClearAlpha=Ve.setClearAlpha,this.clear=function(e,t,i){var r=0;(void 0===e||e)&&(r|=Ae.COLOR_BUFFER_BIT),(void 0===t||t)&&(r|=Ae.DEPTH_BUFFER_BIT),(void 0===i||i)&&(r|=Ae.STENCIL_BUFFER_BIT),Ae.clear(r)},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(e,t,i,r){this.setRenderTarget(e),this.clear(t,i,r)},this.dispose=function(){F.removeEventListener("webglcontextlost",r,!1),F.removeEventListener("webglcontextrestored",a,!1),Ge.dispose(),it.dispose()},this.renderBufferImmediate=function(e,t,i){Ie.initAttributes();var r=Ue.get(e);e.hasPositions&&!r.position&&(r.position=Ae.createBuffer()),e.hasNormals&&!r.normal&&(r.normal=Ae.createBuffer()),e.hasUvs&&!r.uv&&(r.uv=Ae.createBuffer()),e.hasColors&&!r.color&&(r.color=Ae.createBuffer());var n=t.getAttributes();if(e.hasPositions&&(Ae.bindBuffer(Ae.ARRAY_BUFFER,r.position),Ae.bufferData(Ae.ARRAY_BUFFER,e.positionArray,Ae.DYNAMIC_DRAW),Ie.enableAttribute(n.position),Ae.vertexAttribPointer(n.position,3,Ae.FLOAT,!1,0,0)),e.hasNormals){if(Ae.bindBuffer(Ae.ARRAY_BUFFER,r.normal),!i.isMeshPhongMaterial&&!i.isMeshStandardMaterial&&!i.isMeshNormalMaterial&&i.flatShading===!0)for(var a=0,o=3*e.count;a<o;a+=9){var s=e.normalArray,c=(s[a+0]+s[a+3]+s[a+6])/3,l=(s[a+1]+s[a+4]+s[a+7])/3,h=(s[a+2]+s[a+5]+s[a+8])/3;s[a+0]=c,s[a+1]=l,s[a+2]=h,s[a+3]=c,s[a+4]=l,s[a+5]=h,s[a+6]=c,s[a+7]=l,s[a+8]=h}Ae.bufferData(Ae.ARRAY_BUFFER,e.normalArray,Ae.DYNAMIC_DRAW),Ie.enableAttribute(n.normal),Ae.vertexAttribPointer(n.normal,3,Ae.FLOAT,!1,0,0)}e.hasUvs&&i.map&&(Ae.bindBuffer(Ae.ARRAY_BUFFER,r.uv),Ae.bufferData(Ae.ARRAY_BUFFER,e.uvArray,Ae.DYNAMIC_DRAW),Ie.enableAttribute(n.uv),Ae.vertexAttribPointer(n.uv,2,Ae.FLOAT,!1,0,0)),e.hasColors&&i.vertexColors!==Ra&&(Ae.bindBuffer(Ae.ARRAY_BUFFER,r.color),Ae.bufferData(Ae.ARRAY_BUFFER,e.colorArray,Ae.DYNAMIC_DRAW),Ie.enableAttribute(n.color),Ae.vertexAttribPointer(n.color,3,Ae.FLOAT,!1,0,0)),Ie.disableUnusedAttributes(),Ae.drawArrays(Ae.TRIANGLES,0,e.count),e.count=0},this.renderBufferDirect=function(e,i,r,n,a,o){Ie.setMaterial(n);var s=b(e,i,n,a),c=r.id+"_"+s.id+"_"+(n.wireframe===!0),l=!1;c!==re&&(re=c,l=!0),a.morphTargetInfluences&&(We.update(a,r,n,s),l=!0);var h=r.index,u=r.attributes.position,p=1;n.wireframe===!0&&(h=Fe.getWireframeAttribute(r),p=2);var f,m=Ze;null!==h&&(f=De.get(h),m=Ke,m.setIndex(f)),l&&(d(n,s,r),null!==h&&Ae.bindBuffer(Ae.ELEMENT_ARRAY_BUFFER,f.buffer));var v=0;null!==h?v=h.count:void 0!==u&&(v=u.count);var g=r.drawRange.start*p,y=r.drawRange.count*p,x=null!==o?o.start*p:0,_=null!==o?o.count*p:1/0,w=Math.max(g,x),M=Math.min(v,g+y,x+_)-1,E=Math.max(0,M-w+1);if(0!==E){if(a.isMesh)if(n.wireframe===!0)Ie.setLineWidth(n.wireframeLinewidth*t()),m.setMode(Ae.LINES);else switch(a.drawMode){case gs:m.setMode(Ae.TRIANGLES);break;case ys:m.setMode(Ae.TRIANGLE_STRIP);break;case xs:m.setMode(Ae.TRIANGLE_FAN)}else if(a.isLine){var T=n.linewidth;void 0===T&&(T=1),Ie.setLineWidth(T*t()),a.isLineSegments?m.setMode(Ae.LINES):a.isLineLoop?m.setMode(Ae.LINE_LOOP):m.setMode(Ae.LINE_STRIP)}else a.isPoints&&m.setMode(Ae.POINTS);r&&r.isInstancedBufferGeometry?r.maxInstancedCount>0&&m.renderInstances(r,w,E):m.render(w,E)}},this.compile=function(e,t){W.length=0,X.length=0,e.traverse(function(e){e.isLight&&(W.push(e),e.castShadow&&X.push(e))}),Oe.setup(W,X,t),e.traverse(function(t){if(t.material)if(Array.isArray(t.material))for(var i=0;i<t.material.length;i++)x(t.material[i],e.fog,t);else x(t.material,e.fog,t)})};var nt=!1,at=null;this.animate=function(e){at=e,f()},this.render=function(e,t,i,r){if(!t||!t.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!$){re="",ie=-1,ne=null,e.autoUpdate===!0&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),it.enabled&&(t=it.getCamera(t)),Me.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),xe.setFromMatrix(Me),W.length=0,X.length=0,Z.length=0,Q.length=0,we=this.localClippingEnabled,_e=be.init(this.clippingPlanes,we,t),q=Ge.get(e,t),q.init(),v(e,t,K.sortObjects),K.sortObjects===!0&&q.sort(),_e&&be.beginShadows(),rt.render(X,e,t),Oe.setup(W,X,t),_e&&be.endShadows(),Se.frame++,Se.calls=0,Se.vertices=0,Se.faces=0,Se.points=0,void 0===i&&(i=null),this.setRenderTarget(i),Ve.render(q,e,t,r);var n=q.opaque,a=q.transparent;if(e.overrideMaterial){var o=e.overrideMaterial;n.length&&g(n,e,t,o),a.length&&g(a,e,t,o)}else n.length&&g(n,e,t),a.length&&g(a,e,t);et.render(Z,e,t),$e.render(Q,e,t,le),i&&Ne.updateRenderTargetMipmap(i),Ie.buffers.depth.setTest(!0),Ie.buffers.depth.setMask(!0),Ie.buffers.color.setMask(!0),Ie.setPolygonOffset(!1),it.enabled&&it.submitFrame()}},this.setFaceCulling=function(e,t){Ie.setCullFace(e),Ie.setFlipSided(t===ya)},this.allocTextureUnit=D,this.setTexture2D=function(){var e=!1;return function(t,i){t&&t.isWebGLRenderTarget&&(e||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),e=!0),t=t.texture),Ne.setTexture2D(t,i)}}(),this.setTexture=function(){var e=!1;return function(t,i){e||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),e=!0),Ne.setTexture2D(t,i)}}(),this.setTextureCube=function(){var e=!1;return function(t,i){t&&t.isWebGLRenderTargetCube&&(e||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),e=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?Ne.setTextureCube(t,i):Ne.setTextureCubeDynamic(t,i)}}(),this.getRenderTarget=function(){return ee},this.setRenderTarget=function(e){ee=e,e&&void 0===Ue.get(e).__webglFramebuffer&&Ne.setupRenderTarget(e);var t=null,i=!1;if(e){var r=Ue.get(e).__webglFramebuffer;e.isWebGLRenderTargetCube?(t=r[e.activeCubeFace],i=!0):t=r,le.copy(e.viewport),he.copy(e.scissor),ue=e.scissorTest}else le.copy(ve).multiplyScalar(me),he.copy(ge).multiplyScalar(me),ue=ye;if(te!==t&&(Ae.bindFramebuffer(Ae.FRAMEBUFFER,t),te=t),Ie.viewport(le),Ie.scissor(he),Ie.setScissorTest(ue),i){var n=Ue.get(e.texture);Ae.framebufferTexture2D(Ae.FRAMEBUFFER,Ae.COLOR_ATTACHMENT0,Ae.TEXTURE_CUBE_MAP_POSITIVE_X+e.activeCubeFace,n.__webglTexture,e.activeMipMapLevel)}},this.readRenderTargetPixels=function(e,t,i,r,n,a){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");var o=Ue.get(e).__webglFramebuffer;if(o){var s=!1;o!==te&&(Ae.bindFramebuffer(Ae.FRAMEBUFFER,o),s=!0);try{var c=e.texture,l=c.format,h=c.type;if(l!==qo&&tt.convert(l)!==Ae.getParameter(Ae.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(h===Uo||tt.convert(h)===Ae.getParameter(Ae.IMPLEMENTATION_COLOR_READ_TYPE)||h===zo&&(Pe.get("OES_texture_float")||Pe.get("WEBGL_color_buffer_float"))||h===Ho&&Pe.get("EXT_color_buffer_half_float")))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");Ae.checkFramebufferStatus(Ae.FRAMEBUFFER)===Ae.FRAMEBUFFER_COMPLETE?t>=0&&t<=e.width-r&&i>=0&&i<=e.height-n&&Ae.readPixels(t,i,r,n,tt.convert(l),tt.convert(h),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&Ae.bindFramebuffer(Ae.FRAMEBUFFER,te)}}}}function Mt(e,t){this.name="",this.color=new X(e),this.density=void 0!==t?t:25e-5}function Et(e,t,i){this.name="",this.color=new X(e),this.near=void 0!==t?t:1,this.far=void 0!==i?i:1e3}function Tt(){he.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function St(e,t,i,r,n){he.call(this),this.lensFlares=[],this.positionScreen=new c,this.customUpdateCallback=void 0,void 0!==e&&this.add(e,t,i,r,n)}function At(e){Q.call(this),this.type="SpriteMaterial",this.color=new X(16777215),this.map=null,this.rotation=0,this.fog=!1,this.lights=!1,this.setValues(e)}function Rt(e){he.call(this),this.type="Sprite",this.material=void 0!==e?e:new At}function Lt(){he.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function Pt(e,t){if(e=e||[],this.bones=e.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var i=0,r=this.bones.length;i<r;i++)this.boneInverses.push(new l)}}function Ct(){he.call(this),this.type="Bone"}function It(e,t){Oe.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new l,this.bindMatrixInverse=new l;var i=this.initBones(),r=new Pt(i);this.bind(r,this.matrixWorld),this.normalizeSkinWeights()}function Ut(e){Q.call(this),this.type="LineBasicMaterial",this.color=new X(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(e)}function Nt(e,t,i){return 1===i?(console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new Dt(e,t)):(he.call(this),this.type="Line",this.geometry=void 0!==e?e:new Le,void(this.material=void 0!==t?t:new Ut({color:16777215*Math.random()})))}function Dt(e,t){Nt.call(this,e,t),this.type="LineSegments"}function Ft(e,t){Nt.call(this,e,t),this.type="LineLoop"}function Bt(e){Q.call(this),this.type="PointsMaterial",this.color=new X(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.lights=!1,this.setValues(e)}function Ot(e,t){he.call(this),this.type="Points",this.geometry=void 0!==e?e:new Le,this.material=void 0!==t?t:new Bt({color:16777215*Math.random()})}function zt(){he.call(this),this.type="Group"}function Ht(e,t,i,n,a,o,s,c,l){function h(){requestAnimationFrame(h),e.readyState>=e.HAVE_CURRENT_DATA&&(u.needsUpdate=!0)}r.call(this,e,t,i,n,a,o,s,c,l),this.generateMipmaps=!1;var u=this;h()}function Gt(e,t,i,n,a,o,s,c,l,h,u,p){r.call(this,null,o,s,c,l,h,n,a,u,p),this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function Vt(e,t,i,n,a,o,s,c,l,h){if(h=void 0!==h?h:Qo,h!==Qo&&h!==Ko)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&h===Qo&&(i=Fo),void 0===i&&h===Ko&&(i=Wo),r.call(this,null,n,a,o,s,c,h,i,l),this.image={width:e,height:t},this.magFilter=void 0!==s?s:Ao,this.minFilter=void 0!==c?c:Ao,this.flipY=!1,this.generateMipmaps=!1}function kt(e){Le.call(this),this.type="WireframeGeometry";var t,i,r,n,a,o,s,l,h,u,p=[],d=[0,0],f={},m=["a","b","c"];if(e&&e.isGeometry){var v=e.faces;for(t=0,r=v.length;t<r;t++){var g=v[t];for(i=0;i<3;i++)s=g[m[i]],l=g[m[(i+1)%3]],d[0]=Math.min(s,l),d[1]=Math.max(s,l),h=d[0]+","+d[1],void 0===f[h]&&(f[h]={index1:d[0],index2:d[1]})}for(h in f)o=f[h],u=e.vertices[o.index1],p.push(u.x,u.y,u.z),u=e.vertices[o.index2],p.push(u.x,u.y,u.z)}else if(e&&e.isBufferGeometry){var y,x,b,_,w,M,E,T;if(u=new c,null!==e.index){for(y=e.attributes.position,x=e.index,b=e.groups,0===b.length&&(b=[{start:0,count:x.count,materialIndex:0}]),n=0,a=b.length;n<a;++n)for(_=b[n],w=_.start,M=_.count,t=w,r=w+M;t<r;t+=3)for(i=0;i<3;i++)s=x.getX(t+i),l=x.getX(t+(i+1)%3),d[0]=Math.min(s,l),d[1]=Math.max(s,l),h=d[0]+","+d[1],void 0===f[h]&&(f[h]={index1:d[0],index2:d[1]});for(h in f)o=f[h],u.fromBufferAttribute(y,o.index1),p.push(u.x,u.y,u.z),u.fromBufferAttribute(y,o.index2),p.push(u.x,u.y,u.z)}else for(y=e.attributes.position,t=0,r=y.count/3;t<r;t++)for(i=0;i<3;i++)E=3*t+i,u.fromBufferAttribute(y,E),p.push(u.x,u.y,u.z),T=3*t+(i+1)%3,u.fromBufferAttribute(y,T),p.push(u.x,u.y,u.z)}this.addAttribute("position",new Te(p,3))}function Wt(e,t,i){ve.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:i},this.fromBufferGeometry(new jt(e,t,i)),this.mergeVertices()}function jt(e,t,i){Le.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:i};var r,n,a=[],o=[],s=[],l=[],h=1e-5,u=new c,p=new c,d=new c,f=new c,m=new c,v=t+1;for(r=0;r<=i;r++){var g=r/i;for(n=0;n<=t;n++){var y=n/t;p=e(y,g,p),o.push(p.x,p.y,p.z),y-h>=0?(d=e(y-h,g,d),f.subVectors(p,d)):(d=e(y+h,g,d),f.subVectors(d,p)),g-h>=0?(d=e(y,g-h,d),m.subVectors(p,d)):(d=e(y,g+h,d),m.subVectors(d,p)),u.crossVectors(f,m).normalize(),s.push(u.x,u.y,u.z),l.push(y,g)}}for(r=0;r<i;r++)for(n=0;n<t;n++){var x=r*v+n,b=r*v+n+1,_=(r+1)*v+n+1,w=(r+1)*v+n;a.push(x,b,w),a.push(b,_,w)}this.setIndex(a),this.addAttribute("position",new Te(o,3)),this.addAttribute("normal",new Te(s,3)),this.addAttribute("uv",new Te(l,2))}function Xt(e,t,i,r){ve.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:r},this.fromBufferGeometry(new qt(e,t,i,r)),this.mergeVertices()}function qt(e,t,r,n){function a(e){for(var i=new c,r=new c,n=new c,a=0;a<t.length;a+=3)p(t[a+0],i),p(t[a+1],r),p(t[a+2],n),o(i,r,n,e)}function o(e,t,i,r){var n,a,o=Math.pow(2,r),s=[];for(n=0;n<=o;n++){s[n]=[];var c=e.clone().lerp(i,n/o),l=t.clone().lerp(i,n/o),h=o-n;for(a=0;a<=h;a++)0===a&&n===o?s[n][a]=c:s[n][a]=c.clone().lerp(l,a/h)}for(n=0;n<o;n++)for(a=0;a<2*(o-n)-1;a++){var p=Math.floor(a/2);a%2===0?(u(s[n][p+1]),u(s[n+1][p]),u(s[n][p])):(u(s[n][p+1]),u(s[n+1][p+1]),u(s[n+1][p]))}}function s(e){for(var t=new c,i=0;i<g.length;i+=3)t.x=g[i+0],t.y=g[i+1],t.z=g[i+2],t.normalize().multiplyScalar(e),g[i+0]=t.x,g[i+1]=t.y,g[i+2]=t.z}function l(){for(var e=new c,t=0;t<g.length;t+=3){e.x=g[t+0],e.y=g[t+1],e.z=g[t+2];var i=m(e)/2/Math.PI+.5,r=v(e)/Math.PI+.5;y.push(i,1-r)}d(),h()}function h(){for(var e=0;e<y.length;e+=6){var t=y[e+0],i=y[e+2],r=y[e+4],n=Math.max(t,i,r),a=Math.min(t,i,r);n>.9&&a<.1&&(t<.2&&(y[e+0]+=1),i<.2&&(y[e+2]+=1),r<.2&&(y[e+4]+=1))}}function u(e){g.push(e.x,e.y,e.z)}function p(t,i){var r=3*t;i.x=e[r+0],i.y=e[r+1],i.z=e[r+2]}function d(){for(var e=new c,t=new c,r=new c,n=new c,a=new i,o=new i,s=new i,l=0,h=0;l<g.length;l+=9,h+=6){e.set(g[l+0],g[l+1],g[l+2]),t.set(g[l+3],g[l+4],g[l+5]),r.set(g[l+6],g[l+7],g[l+8]),a.set(y[h+0],y[h+1]),o.set(y[h+2],y[h+3]),s.set(y[h+4],y[h+5]),n.copy(e).add(t).add(r).divideScalar(3);var u=m(n);f(a,h+0,e,u),f(o,h+2,t,u),f(s,h+4,r,u)}}function f(e,t,i,r){r<0&&1===e.x&&(y[t]=e.x-1),0===i.x&&0===i.z&&(y[t]=r/2/Math.PI+.5)}function m(e){return Math.atan2(e.z,-e.x)}function v(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}Le.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:e,indices:t,radius:r,detail:n},r=r||1,n=n||0;var g=[],y=[];a(n),s(r),l(),this.addAttribute("position",new Te(g,3)),this.addAttribute("normal",new Te(g.slice(),3)),this.addAttribute("uv",new Te(y,2)),0===n?this.computeVertexNormals():this.normalizeNormals()}function Yt(e,t){ve.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Zt(e,t)),this.mergeVertices()}function Zt(e,t){var i=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];qt.call(this,i,r,e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Jt(e,t){ve.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Qt(e,t)),this.mergeVertices()}function Qt(e,t){var i=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];qt.call(this,i,r,e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Kt(e,t){ve.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new $t(e,t)),this.mergeVertices()}function $t(e,t){var i=(1+Math.sqrt(5))/2,r=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],n=[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];qt.call(this,r,n,e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}function ei(e,t){ve.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new ti(e,t)),this.mergeVertices()}function ti(e,t){var i=(1+Math.sqrt(5))/2,r=1/i,n=[-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,-r,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r],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];qt.call(this,n,a,e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}function ii(e,t,i,r,n,a){ve.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:i,radialSegments:r,closed:n},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new ri(e,t,i,r,n);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function ri(e,t,r,n,a){function o(){for(p=0;p<t;p++)s(p);s(a===!1?t:0),h(),l()}function s(i){var a=e.getPointAt(i/t),o=u.normals[i],s=u.binormals[i];for(d=0;d<=n;d++){var c=d/n*Math.PI*2,l=Math.sin(c),h=-Math.cos(c);m.x=h*o.x+l*s.x,m.y=h*o.y+l*s.y,m.z=h*o.z+l*s.z,m.normalize(),y.push(m.x,m.y,m.z),f.x=a.x+r*m.x,f.y=a.y+r*m.y,f.z=a.z+r*m.z,g.push(f.x,f.y,f.z)}}function l(){for(d=1;d<=t;d++)for(p=1;p<=n;p++){var e=(n+1)*(d-1)+(p-1),i=(n+1)*d+(p-1),r=(n+1)*d+p,a=(n+1)*(d-1)+p;b.push(e,i,a),b.push(i,r,a)}}function h(){for(p=0;p<=t;p++)for(d=0;d<=n;d++)v.x=p/t,v.y=d/n,x.push(v.x,v.y)}Le.call(this),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:r,radialSegments:n,closed:a},t=t||64,r=r||1,n=n||8,a=a||!1;var u=e.computeFrenetFrames(t,a);this.tangents=u.tangents,this.normals=u.normals,this.binormals=u.binormals;var p,d,f=new c,m=new c,v=new i,g=[],y=[],x=[],b=[];o(),this.setIndex(b),this.addAttribute("position",new Te(g,3)),this.addAttribute("normal",new Te(y,3)),this.addAttribute("uv",new Te(x,2))}function ni(e,t,i,r,n,a,o){ve.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:r,p:n,q:a},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new ai(e,t,i,r,n,a)),this.mergeVertices()}function ai(e,t,i,r,n,a){function o(e,t,i,r,n){var a=Math.cos(e),o=Math.sin(e),s=i/t*e,c=Math.cos(s);n.x=r*(2+c)*.5*a,n.y=r*(2+c)*o*.5,n.z=r*Math.sin(s)*.5}Le.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:r,p:n,q:a},e=e||100,t=t||40,i=Math.floor(i)||64,r=Math.floor(r)||8,n=n||2,a=a||3;var s,l,h=[],u=[],p=[],d=[],f=new c,m=new c,v=new c,g=new c,y=new c,x=new c,b=new c;for(s=0;s<=i;++s){var _=s/i*n*Math.PI*2;for(o(_,n,a,e,v),o(_+.01,n,a,e,g),x.subVectors(g,v),b.addVectors(g,v),y.crossVectors(x,b),b.crossVectors(y,x),y.normalize(),b.normalize(),l=0;l<=r;++l){var w=l/r*Math.PI*2,M=-t*Math.cos(w),E=t*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(s/i),d.push(l/r)}}for(l=1;l<=i;l++)for(s=1;s<=r;s++){var T=(r+1)*(l-1)+(s-1),S=(r+1)*l+(s-1),A=(r+1)*l+s,R=(r+1)*(l-1)+s;h.push(T,S,R),h.push(S,A,R)}this.setIndex(h),this.addAttribute("position",new Te(u,3)),this.addAttribute("normal",new Te(p,3)),this.addAttribute("uv",new Te(d,2))}function oi(e,t,i,r,n){ve.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:r,arc:n},this.fromBufferGeometry(new si(e,t,i,r,n)),this.mergeVertices()}function si(e,t,i,r,n){Le.call(this),this.type="TorusBufferGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:r,arc:n},e=e||100,t=t||40,i=Math.floor(i)||8,r=Math.floor(r)||6,n=n||2*Math.PI;var a,o,s=[],l=[],h=[],u=[],p=new c,d=new c,f=new c;for(a=0;a<=i;a++)for(o=0;o<=r;o++){var m=o/r*n,v=a/i*Math.PI*2;d.x=(e+t*Math.cos(v))*Math.cos(m),d.y=(e+t*Math.cos(v))*Math.sin(m),d.z=t*Math.sin(v),l.push(d.x,d.y,d.z),p.x=e*Math.cos(m),p.y=e*Math.sin(m),f.subVectors(d,p).normalize(),h.push(f.x,f.y,f.z),u.push(o/r),u.push(a/i)}for(a=1;a<=i;a++)for(o=1;o<=r;o++){var g=(r+1)*a+o-1,y=(r+1)*(a-1)+o-1,x=(r+1)*(a-1)+o,b=(r+1)*a+o;s.push(g,y,b),s.push(y,x,b)}this.setIndex(s),this.addAttribute("position",new Te(l,3)),this.addAttribute("normal",new Te(h,3)),this.addAttribute("uv",new Te(u,2))}function ci(e,t){ve.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},this.fromBufferGeometry(new li(e,t)),this.mergeVertices()}function li(e,t){"undefined"!=typeof e&&(Le.call(this),this.type="ExtrudeBufferGeometry",e=Array.isArray(e)?e:[e],this.addShapeList(e,t),this.computeVertexNormals())}function hi(e,t){ve.call(this),this.type="TextGeometry",this.parameters={text:e,parameters:t},this.fromBufferGeometry(new ui(e,t)),this.mergeVertices()}function ui(e,t){t=t||{};var i=t.font;if(!i||!i.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new ve;var r=i.generateShapes(e,t.size,t.curveSegments);t.amount=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),li.call(this,r,t),this.type="TextBufferGeometry"}function pi(e,t,i,r,n,a,o){ve.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:r,phiLength:n,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new di(e,t,i,r,n,a,o)),this.mergeVertices()}function di(e,t,i,r,n,a,o){Le.call(this),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:r,phiLength:n,thetaStart:a,thetaLength:o},e=e||50,t=Math.max(3,Math.floor(t)||8),i=Math.max(2,Math.floor(i)||6),r=void 0!==r?r:0,n=void 0!==n?n:2*Math.PI,a=void 0!==a?a:0,o=void 0!==o?o:Math.PI;var s,l,h=a+o,u=0,p=[],d=new c,f=new c,m=[],v=[],g=[],y=[];for(l=0;l<=i;l++){var x=[],b=l/i;for(s=0;s<=t;s++){var _=s/t;d.x=-e*Math.cos(r+_*n)*Math.sin(a+b*o),d.y=e*Math.cos(a+b*o),d.z=e*Math.sin(r+_*n)*Math.sin(a+b*o),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(l=0;l<i;l++)for(s=0;s<t;s++){var w=p[l][s+1],M=p[l][s],E=p[l+1][s],T=p[l+1][s+1];(0!==l||a>0)&&m.push(w,M,T),(l!==i-1||h<Math.PI)&&m.push(M,E,T)}this.setIndex(m),this.addAttribute("position",new Te(v,3)),this.addAttribute("normal",new Te(g,3)),this.addAttribute("uv",new Te(y,2))}function fi(e,t,i,r,n,a){ve.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:r,thetaStart:n,thetaLength:a},this.fromBufferGeometry(new mi(e,t,i,r,n,a)),this.mergeVertices()}function mi(e,t,r,n,a,o){Le.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:r,phiSegments:n,thetaStart:a,thetaLength:o},e=e||20,t=t||50,a=void 0!==a?a:0,o=void 0!==o?o:2*Math.PI,r=void 0!==r?Math.max(3,r):8,n=void 0!==n?Math.max(1,n):1;var s,l,h,u=[],p=[],d=[],f=[],m=e,v=(t-e)/n,g=new c,y=new i;for(l=0;l<=n;l++){for(h=0;h<=r;h++)s=a+h/r*o,g.x=m*Math.cos(s),g.y=m*Math.sin(s),p.push(g.x,g.y,g.z),d.push(0,0,1),y.x=(g.x/t+1)/2,y.y=(g.y/t+1)/2,f.push(y.x,y.y);m+=v}for(l=0;l<n;l++){var x=l*(r+1);for(h=0;h<r;h++){s=h+x;var b=s,_=s+r+1,w=s+r+2,M=s+1;u.push(b,_,M),u.push(_,w,M)}}this.setIndex(u),this.addAttribute("position",new Te(p,3)),this.addAttribute("normal",new Te(d,3)),this.addAttribute("uv",new Te(f,2))}function vi(e,t,i,r){ve.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},this.fromBufferGeometry(new gi(e,t,i,r)),this.mergeVertices()}function gi(e,t,r,n){Le.call(this),this.type="LatheBufferGeometry",this.parameters={points:e,segments:t,phiStart:r,phiLength:n},t=Math.floor(t)||12,r=r||0,n=n||2*Math.PI,n=Ps.clamp(n,0,2*Math.PI);var a,o,s,l=[],h=[],u=[],p=1/t,d=new c,f=new i;for(o=0;o<=t;o++){var m=r+o*p*n,v=Math.sin(m),g=Math.cos(m);for(s=0;s<=e.length-1;s++)d.x=e[s].x*v,d.y=e[s].y,d.z=e[s].x*g,h.push(d.x,d.y,d.z),f.x=o/t,f.y=s/(e.length-1),u.push(f.x,f.y)}for(o=0;o<t;o++)for(s=0;s<e.length-1;s++){a=s+o*e.length;var y=a,x=a+e.length,b=a+e.length+1,_=a+1;l.push(y,x,_),l.push(x,b,_)}if(this.setIndex(l),this.addAttribute("position",new Te(h,3)),this.addAttribute("uv",new Te(u,2)),this.computeVertexNormals(),n===2*Math.PI){var w=this.attributes.normal.array,M=new c,E=new c,T=new c;for(a=t*e.length*3,o=0,s=0;o<e.length;o++,s+=3)M.x=w[s+0],M.y=w[s+1],M.z=w[s+2],E.x=w[a+s+0],E.y=w[a+s+1],E.z=w[a+s+2],T.addVectors(M,E).normalize(),w[s+0]=w[a+s+0]=T.x,w[s+1]=w[a+s+1]=T.y,w[s+2]=w[a+s+2]=T.z}}function yi(e,t){ve.call(this),this.type="ShapeGeometry","object"==typeof t&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),t=t.curveSegments),this.parameters={shapes:e,curveSegments:t},this.fromBufferGeometry(new xi(e,t)),this.mergeVertices()}function xi(e,t){function i(e){var i,s,l,h=n.length/3,u=e.extractPoints(t),p=u.shape,d=u.holes;if(Zl.isClockWise(p)===!1)for(p=p.reverse(),i=0,s=d.length;i<s;i++)l=d[i],Zl.isClockWise(l)===!0&&(d[i]=l.reverse());var f=Zl.triangulateShape(p,d);for(i=0,s=d.length;i<s;i++)l=d[i],p=p.concat(l);for(i=0,s=p.length;i<s;i++){var m=p[i];n.push(m.x,m.y,0),a.push(0,0,1),o.push(m.x,m.y)}for(i=0,s=f.length;i<s;i++){var v=f[i],g=v[0]+h,y=v[1]+h,x=v[2]+h;r.push(g,y,x),c+=3}}Le.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:e,curveSegments:t},t=t||12;var r=[],n=[],a=[],o=[],s=0,c=0;if(Array.isArray(e)===!1)i(e);else for(var l=0;l<e.length;l++)i(e[l]),this.addGroup(s,c,l),s+=c,c=0;this.setIndex(r),this.addAttribute("position",new Te(n,3)),this.addAttribute("normal",new Te(a,3)),this.addAttribute("uv",new Te(o,2))}function bi(e,t){Le.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=void 0!==t?t:1;var i,r,n,a,o=[],s=Math.cos(Ps.DEG2RAD*t),c=[0,0],l={},h=["a","b","c"];e.isBufferGeometry?(a=new ve,a.fromBufferGeometry(e)):a=e.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++)i=m[h[v]],r=m[h[(v+1)%3]],c[0]=Math.min(i,r),c[1]=Math.max(i,r),n=c[0]+","+c[1],void 0===l[n]?l[n]={index1:c[0],index2:c[1],face1:d,face2:void 0}:l[n].face2=d;for(n in l){var g=l[n];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 Te(o,3))}function _i(e,t,i,r,n,a,o,s){ve.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:n,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new wi(e,t,i,r,n,a,o,s)),this.mergeVertices()}function wi(e,t,r,n,a,o,s,l){function h(){var i,o,h=new c,u=new c,_=0,w=(t-e)/r;for(o=0;o<=a;o++){var M=[],E=o/a,T=E*(t-e)+e;for(i=0;i<=n;i++){var S=i/n,A=S*l+s,R=Math.sin(A),L=Math.cos(A);u.x=T*R,u.y=-E*r+x,u.z=T*L,f.push(u.x,u.y,u.z),h.set(R,w,L).normalize(),m.push(h.x,h.y,h.z),v.push(S,1-E),M.push(g++)}y.push(M)}for(i=0;i<n;i++)for(o=0;o<a;o++){var P=y[o][i],C=y[o+1][i],I=y[o+1][i+1],U=y[o][i+1];d.push(P,C,U),d.push(C,I,U),_+=6}p.addGroup(b,_,0),b+=_}function u(r){var a,o,h,u=new i,y=new c,_=0,w=r===!0?e:t,M=r===!0?1:-1;for(o=g,a=1;a<=n;a++)f.push(0,x*M,0),m.push(0,M,0),v.push(.5,.5),g++;for(h=g,a=0;a<=n;a++){var E=a/n,T=E*l+s,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(a=0;a<n;a++){var R=o+a,L=h+a;r===!0?d.push(L,L+1,R):d.push(L+1,L,R),_+=3}p.addGroup(b,_,r===!0?1:2),b+=_}Le.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:r,radialSegments:n,heightSegments:a,openEnded:o,thetaStart:s,thetaLength:l};var p=this;e=void 0!==e?e:20,t=void 0!==t?t:20,r=void 0!==r?r:100,n=Math.floor(n)||8,a=Math.floor(a)||1,o=void 0!==o&&o,s=void 0!==s?s:0,l=void 0!==l?l:2*Math.PI;var d=[],f=[],m=[],v=[],g=0,y=[],x=r/2,b=0;h(),o===!1&&(e>0&&u(!0),t>0&&u(!1)),this.setIndex(d),this.addAttribute("position",new Te(f,3)),this.addAttribute("normal",new Te(m,3)),this.addAttribute("uv",new Te(v,2))}function Mi(e,t,i,r,n,a,o){_i.call(this,0,e,t,i,r,n,a,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:r,openEnded:n,thetaStart:a,thetaLength:o}}function Ei(e,t,i,r,n,a,o){wi.call(this,0,e,t,i,r,n,a,o),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:r,openEnded:n,thetaStart:a,thetaLength:o}}function Ti(e,t,i,r){ve.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:r},this.fromBufferGeometry(new Si(e,t,i,r)),this.mergeVertices()}function Si(e,t,r,n){Le.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:r,thetaLength:n},e=e||50,t=void 0!==t?Math.max(3,t):8,r=void 0!==r?r:0,n=void 0!==n?n:2*Math.PI;var a,o,s=[],l=[],h=[],u=[],p=new c,d=new i;for(l.push(0,0,0),h.push(0,0,1),u.push(.5,.5),o=0,a=3;o<=t;o++,a+=3){var f=r+o/t*n;p.x=e*Math.cos(f),p.y=e*Math.sin(f),l.push(p.x,p.y,p.z),h.push(0,0,1),d.x=(l[a]/e+1)/2,d.y=(l[a+1]/e+1)/2,u.push(d.x,d.y)}for(a=1;a<=t;a++)s.push(a,a+1,0);this.setIndex(s),this.addAttribute("position",new Te(l,3)),this.addAttribute("normal",new Te(h,3)),this.addAttribute("uv",new Te(u,2))}function Ai(e){Q.call(this),this.type="ShadowMaterial",this.color=new X(0),this.opacity=1,this.lights=!0,this.transparent=!0,this.setValues(e)}function Ri(e){K.call(this,e),this.type="RawShaderMaterial"}function Li(e){Q.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new X(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 X(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new i(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(e)}function Pi(e){Li.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(e)}function Ci(e){Q.call(this),this.type="MeshPhongMaterial",this.color=new X(16777215),this.specular=new X(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new X(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new i(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=so,
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(e)}function Ii(e){Ci.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(e)}function Ui(e){Q.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new i(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(e)}function Ni(e){Q.call(this),this.type="MeshLambertMaterial",this.color=new X(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new X(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=so,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(e)}function Di(e){Ut.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}function Fi(e,t,i){var r=this,n=!1,a=0,o=0;this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(e){o++,n===!1&&void 0!==r.onStart&&r.onStart(e,a,o),n=!0},this.itemEnd=function(e){a++,void 0!==r.onProgress&&r.onProgress(e,a,o),a===o&&(n=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)}}function Bi(e){this.manager=void 0!==e?e:$l}function Oi(e){this.manager=void 0!==e?e:$l,this._parser=null}function zi(e){this.manager=void 0!==e?e:$l,this._parser=null}function Hi(e){this.manager=void 0!==e?e:$l}function Gi(e){this.manager=void 0!==e?e:$l}function Vi(e){this.manager=void 0!==e?e:$l}function ki(e,t){he.call(this),this.type="Light",this.color=new X(e),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0}function Wi(e,t,i){ki.call(this,e,i),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(he.DefaultUp),this.updateMatrix(),this.groundColor=new X(t)}function ji(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new i(512,512),this.map=null,this.matrix=new l}function Xi(){ji.call(this,new de(50,1,.5,500))}function qi(e,t,i,r,n,a){ki.call(this,e,t),this.type="SpotLight",this.position.copy(he.DefaultUp),this.updateMatrix(),this.target=new he,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=void 0!==i?i:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==n?n:0,this.decay=void 0!==a?a:1,this.shadow=new Xi}function Yi(e,t,i,r){ki.call(this,e,t),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),this.distance=void 0!==i?i:0,this.decay=void 0!==r?r:1,this.shadow=new ji(new de(90,1,.5,500))}function Zi(){ji.call(this,new pe(-5,5,5,-5,.5,500))}function Ji(e,t){ki.call(this,e,t),this.type="DirectionalLight",this.position.copy(he.DefaultUp),this.updateMatrix(),this.target=new he,this.shadow=new Zi}function Qi(e,t){ki.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}function Ki(e,t,i,r){ki.call(this,e,t),this.type="RectAreaLight",this.position.set(0,1,0),this.updateMatrix(),this.width=void 0!==i?i:10,this.height=void 0!==r?r:10}function $i(e,t,i,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(i),this.sampleValues=t,this.valueSize=i}function er(e,t,i,r){$i.call(this,e,t,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function tr(e,t,i,r){$i.call(this,e,t,i,r)}function ir(e,t,i,r){$i.call(this,e,t,i,r)}function rr(e,t,i,r){if(void 0===e)throw new Error("track name is undefined");if(void 0===t||0===t.length)throw new Error("no keyframes in track named "+e);this.name=e,this.times=eh.convertArray(t,this.TimeBufferType),this.values=eh.convertArray(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation),this.validate(),this.optimize()}function nr(e,t,i,r){rr.call(this,e,t,i,r)}function ar(e,t,i,r){$i.call(this,e,t,i,r)}function or(e,t,i,r){rr.call(this,e,t,i,r)}function sr(e,t,i,r){rr.call(this,e,t,i,r)}function cr(e,t,i,r){rr.call(this,e,t,i,r)}function lr(e,t,i){rr.call(this,e,t,i)}function hr(e,t,i,r){rr.call(this,e,t,i,r)}function ur(e,t,i,r){rr.apply(this,arguments)}function pr(e,t,i){this.name=e,this.tracks=i,this.duration=void 0!==t?t:-1,this.uuid=Ps.generateUUID(),this.duration<0&&this.resetDuration(),this.optimize()}function dr(e){this.manager=void 0!==e?e:$l,this.textures={}}function fr(e){this.manager=void 0!==e?e:$l}function mr(){this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}}function vr(e){"boolean"==typeof e&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),e=void 0),this.manager=void 0!==e?e:$l,this.withCredentials=!1}function gr(e){this.manager=void 0!==e?e:$l,this.texturePath=""}function yr(e,t,i,r,n){var a=.5*(r-t),o=.5*(n-i),s=e*e,c=e*s;return(2*i-2*r+a+o)*c+(-3*i+3*r-2*a-o)*s+a*e+i}function xr(e,t){var i=1-e;return i*i*t}function br(e,t){return 2*(1-e)*e*t}function _r(e,t){return e*e*t}function wr(e,t,i,r){return xr(e,t)+br(e,i)+_r(e,r)}function Mr(e,t){var i=1-e;return i*i*i*t}function Er(e,t){var i=1-e;return 3*i*i*e*t}function Tr(e,t){return 3*(1-e)*e*e*t}function Sr(e,t){return e*e*e*t}function Ar(e,t,i,r,n){return Mr(e,t)+Er(e,i)+Tr(e,r)+Sr(e,n)}function Rr(){this.arcLengthDivisions=200}function Lr(e,t){Rr.call(this),this.v1=e,this.v2=t}function Pr(){Rr.call(this),this.curves=[],this.autoClose=!1}function Cr(e,t,i,r,n,a,o,s){Rr.call(this),this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=n,this.aEndAngle=a,this.aClockwise=o,this.aRotation=s||0}function Ir(e){Rr.call(this),this.points=void 0===e?[]:e}function Ur(e,t,i,r){Rr.call(this),this.v0=e,this.v1=t,this.v2=i,this.v3=r}function Nr(e,t,i){Rr.call(this),this.v0=e,this.v1=t,this.v2=i}function Dr(e){Pr.call(this),this.currentPoint=new i,e&&this.fromPoints(e)}function Fr(){Dr.apply(this,arguments),this.holes=[]}function Br(){this.subPaths=[],this.currentPath=null}function Or(e){this.data=e}function zr(e){this.manager=void 0!==e?e:$l}function Hr(e){this.manager=void 0!==e?e:$l}function Gr(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new de,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new de,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}function Vr(e,t,i){he.call(this),this.type="CubeCamera";var r=90,n=1,a=new de(r,n,e,t);a.up.set(0,-1,0),a.lookAt(new c(1,0,0)),this.add(a);var s=new de(r,n,e,t);s.up.set(0,-1,0),s.lookAt(new c(-1,0,0)),this.add(s);var l=new de(r,n,e,t);l.up.set(0,0,1),l.lookAt(new c(0,1,0)),this.add(l);var h=new de(r,n,e,t);h.up.set(0,0,-1),h.lookAt(new c(0,-1,0)),this.add(h);var u=new de(r,n,e,t);u.up.set(0,-1,0),u.lookAt(new c(0,0,1)),this.add(u);var p=new de(r,n,e,t);p.up.set(0,-1,0),p.lookAt(new c(0,0,-1)),this.add(p);var d={format:Xo,magFilter:Po,minFilter:Po};this.renderTarget=new o(i,i,d),this.renderTarget.texture.name="CubeCamera",this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var i=this.renderTarget,r=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,i.activeCubeFace=0,e.render(t,a,i),i.activeCubeFace=1,e.render(t,s,i),i.activeCubeFace=2,e.render(t,l,i),i.activeCubeFace=3,e.render(t,h,i),i.activeCubeFace=4,e.render(t,u,i),i.texture.generateMipmaps=r,i.activeCubeFace=5,e.render(t,p,i),e.setRenderTarget(null)},this.clear=function(e,t,i,r){for(var n=this.renderTarget,a=0;a<6;a++)n.activeCubeFace=a,e.setRenderTarget(n),e.clear(t,i,r);e.setRenderTarget(null)}}function kr(){he.call(this),this.type="AudioListener",this.context=ch.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null}function Wr(e){he.call(this),this.type="Audio",this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.loop=!1,this.startTime=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function jr(e){Wr.call(this,e),this.panner=this.context.createPanner(),this.panner.connect(this.gain)}function Xr(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=void 0!==t?t:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}function qr(e,t,i){this.binding=e,this.valueSize=i;var r,n=Float64Array;switch(t){case"quaternion":r=this._slerp;break;case"string":case"bool":n=Array,r=this._select;break;default:r=this._lerp}this.buffer=new n(4*i),this._mixBufferRegion=r,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}function Yr(e,t,i){var r=i||Zr.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}function Zr(e,t,i){this.path=t,this.parsedPath=i||Zr.parseTrackName(t),this.node=Zr.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function Jr(e){this.uuid=Ps.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var i=0,r=arguments.length;i!==r;++i)t[arguments[i].uuid]=i;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 Qr(e,t,i){this._mixer=e,this._clip=t,this._localRoot=i||null;for(var r=t.tracks,n=r.length,a=new Array(n),o={endingStart:fs,endingEnd:fs},s=0;s!==n;++s){var c=r[s].createInterpolant(null);a[s]=c,c.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(n),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=ls,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 Kr(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function $r(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}function en(){Le.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function tn(e,t,i,r){this.uuid=Ps.generateUUID(),this.data=e,this.itemSize=t,this.offset=i,this.normalized=r===!0}function rn(e,t){this.uuid=Ps.generateUUID(),this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function nn(e,t,i){rn.call(this,e,t),this.meshPerAttribute=i||1}function an(e,t,i){ge.call(this,e,t),this.meshPerAttribute=i||1}function on(e,t,i,r){this.ray=new De(e,t),this.near=i||0,this.far=r||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 sn(e,t){return e.distance-t.distance}function cn(e,t,i,r){if(e.visible!==!1&&(e.raycast(t,i),r===!0))for(var n=e.children,a=0,o=n.length;a<o;a++)cn(n[a],t,i,!0)}function ln(e){this.autoStart=void 0===e||e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}function hn(e,t,i){return this.radius=void 0!==e?e:1,this.phi=void 0!==t?t:0,this.theta=void 0!==i?i:0,this}function un(e,t,i){return this.radius=void 0!==e?e:1,this.theta=void 0!==t?t:0,this.y=void 0!==i?i:0,this}function pn(e){he.call(this),this.material=e,this.render=function(e){}}function dn(e,t,i,r){this.object=e,this.size=void 0!==t?t:1;var n=void 0!==i?i:16711680,a=void 0!==r?r: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 Le,l=new Te(2*o*3,3);c.addAttribute("position",l),Dt.call(this,c,new Ut({color:n,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}function fn(e,t){he.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;for(var i=new Le,r=[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],n=0,a=1,o=32;n<o;n++,a++){var s=n/o*Math.PI*2,c=a/o*Math.PI*2;r.push(Math.cos(s),Math.sin(s),1,Math.cos(c),Math.sin(c),1)}i.addAttribute("position",new Te(r,3));var l=new Ut({fog:!1});this.cone=new Dt(i,l),this.add(this.cone),this.update()}function mn(e){var t=[];e&&e.isBone&&t.push(e);for(var i=0;i<e.children.length;i++)t.push.apply(t,mn(e.children[i]));return t}function vn(e){for(var t=mn(e),i=new Le,r=[],n=[],a=new X(0,0,1),o=new X(0,1,0),s=0;s<t.length;s++){var c=t[s];c.parent&&c.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),n.push(a.r,a.g,a.b),n.push(o.r,o.g,o.b))}i.addAttribute("position",new Te(r,3)),i.addAttribute("color",new Te(n,3));var l=new Ut({vertexColors:Pa,depthTest:!1,depthWrite:!1,transparent:!0});Dt.call(this,i,l),this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.onBeforeRender()}function gn(e,t,i){this.light=e,this.light.updateMatrixWorld(),this.color=i;var r=new di(t,4,2),n=new Ne({wireframe:!0,fog:!1});Oe.call(this,r,n),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function yn(e,t){he.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;var i=new Ut({fog:!1}),r=new Le;r.addAttribute("position",new ge(new Float32Array(15),3)),this.line=new Nt(r,i),this.add(this.line),this.update()}function xn(e,t,i){he.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i;var r=new Qt(t);r.rotateY(.5*Math.PI),this.material=new Ne({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=Pa);var n=r.getAttribute("position"),a=new Float32Array(3*n.count);r.addAttribute("color",new ge(a,3)),this.add(new Oe(r,this.material)),this.update()}function bn(e,t,i,r){e=e||10,t=t||10,i=new X(void 0!==i?i:4473924),r=new X(void 0!==r?r:8947848);for(var n=t/2,a=e/t,o=e/2,s=[],c=[],l=0,h=0,u=-o;l<=t;l++,u+=a){s.push(-o,0,u,o,0,u),s.push(u,0,-o,u,0,o);var p=l===n?i:r;p.toArray(c,h),h+=3,p.toArray(c,h),h+=3,p.toArray(c,h),h+=3,p.toArray(c,h),h+=3}var d=new Le;d.addAttribute("position",new Te(s,3)),d.addAttribute("color",new Te(c,3));var f=new Ut({vertexColors:Pa});Dt.call(this,d,f)}function _n(e,t,i,r,n,a){e=e||10,t=t||16,i=i||8,r=r||64,n=new X(void 0!==n?n:4473924),a=new X(void 0!==a?a:8947848);var o,s,c,l,h,u,p,d=[],f=[];for(l=0;l<=t;l++)c=l/t*(2*Math.PI),o=Math.sin(c)*e,s=Math.cos(c)*e,d.push(0,0,0),d.push(o,0,s),p=1&l?n:a,f.push(p.r,p.g,p.b),f.push(p.r,p.g,p.b);for(l=0;l<=i;l++)for(p=1&l?n:a,u=e-e/i*l,h=0;h<r;h++)c=h/r*(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=(h+1)/r*(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 Le;m.addAttribute("position",new Te(d,3)),m.addAttribute("color",new Te(f,3));var v=new Ut({vertexColors:Pa});Dt.call(this,m,v)}function wn(e,t,i,r){this.object=e,this.size=void 0!==t?t:1;var n=void 0!==i?i:16776960,a=void 0!==r?r: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 Le,l=new Te(2*o*3,3);c.addAttribute("position",l),Dt.call(this,c,new Ut({color:n,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}function Mn(e,t,i){he.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,void 0===t&&(t=1);var r=new Le;r.addAttribute("position",new Te([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));var n=new Ut({fog:!1});this.lightPlane=new Nt(r,n),this.add(this.lightPlane),r=new Le,r.addAttribute("position",new Te([0,0,0,0,0,1],3)),this.targetLine=new Nt(r,n),this.add(this.targetLine),this.update()}function En(e){function t(e,t,r){i(e,r),i(t,r)}function i(e,t){a.push(0,0,0),o.push(t.r,t.g,t.b),void 0===s[e]&&(s[e]=[]),s[e].push(a.length/3-1)}var r=new Le,n=new Ut({color:16777215,vertexColors:La}),a=[],o=[],s={},c=new X(16755200),l=new X(16711680),h=new X(43775),u=new X(16777215),p=new X(3355443);t("n1","n2",c),t("n2","n4",c),t("n4","n3",c),t("n3","n1",c),t("f1","f2",c),t("f2","f4",c),t("f4","f3",c),t("f3","f1",c),t("n1","f1",c),t("n2","f2",c),t("n3","f3",c),t("n4","f4",c),t("p","n1",l),t("p","n2",l),t("p","n3",l),t("p","n4",l),t("u1","u2",h),t("u2","u3",h),t("u3","u1",h),t("c","t",u),t("p","c",p),t("cn1","cn2",p),t("cn3","cn4",p),t("cf1","cf2",p),t("cf3","cf4",p),r.addAttribute("position",new Te(a,3)),r.addAttribute("color",new Te(o,3)),Dt.call(this,r,n),this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update()}function Tn(e,t){this.object=e,void 0===t&&(t=16776960);var i=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]),r=new Float32Array(24),n=new Le;n.setIndex(new ge(i,1)),n.addAttribute("position",new ge(r,3)),Dt.call(this,n,new Ut({color:t})),this.matrixAutoUpdate=!1,this.update()}function Sn(e,t){this.type="Box3Helper",this.box=e;var i=void 0!==t?t:16776960,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=[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 Le;a.setIndex(new ge(r,1)),a.addAttribute("position",new Te(n,3)),Dt.call(this,a,new Ut({color:i})),this.geometry.computeBoundingSphere(),this.onBeforeRender()}function An(e,t,i){this.type="PlaneHelper",this.plane=e,this.size=void 0===t?1:t;var r=void 0!==i?i:16776960,n=[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 Le;a.addAttribute("position",new Te(n,3)),a.computeBoundingSphere(),Nt.call(this,a,new Ut({color:r}));var o=[1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],s=new Le;s.addAttribute("position",new Te(o,3)),s.computeBoundingSphere(),this.add(new Oe(s,new Ne({color:r,opacity:.2,transparent:!0,depthWrite:!1}))),this.onBeforeRender()}function Rn(e,t,i,r,n,a){he.call(this),void 0===r&&(r=16776960),void 0===i&&(i=1),void 0===n&&(n=.2*i),void 0===a&&(a=.2*n),void 0===lh&&(lh=new Le,lh.addAttribute("position",new Te([0,0,0,0,1,0],3)),hh=new wi(0,.5,1,5,1),hh.translate(0,-.5,0)),this.position.copy(t),this.line=new Nt(lh,new Ut({color:r})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Oe(hh,new Ne({color:r})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(i,n,a)}function Ln(e){e=e||1;var t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new Le;r.addAttribute("position",new Te(t,3)),r.addAttribute("color",new Te(i,3));var n=new Ut({vertexColors:Pa});Dt.call(this,r,n)}function Pn(){function e(e,a,o,s){t=e,i=o,r=-3*e+3*a-2*o-s,n=2*e-2*a+o+s}var t=0,i=0,r=0,n=0;return{initCatmullRom:function(t,i,r,n,a){e(i,r,a*(r-t),a*(n-i))},initNonuniformCatmullRom:function(t,i,r,n,a,o,s){var c=(i-t)/a-(r-t)/(a+o)+(r-i)/o,l=(r-i)/o-(n-i)/(o+s)+(n-r)/s;c*=o,l*=o,e(i,r,c,l)},calc:function(e){var a=e*e,o=a*e;return t+i*e+r*a+n*o}}}function Cn(e){Rr.call(this),e.length<2&&console.warn("THREE.CatmullRomCurve3: Points array needs at least two entries."),this.points=e||[],this.closed=!1}function In(e,t,i,r){Rr.call(this),this.v0=e,this.v1=t,this.v2=i,this.v3=r}function Un(e,t,i){Rr.call(this),this.v0=e,this.v1=t,this.v2=i}function Nn(e,t){Rr.call(this),this.v1=e,this.v2=t}function Dn(e,t,i,r,n,a){Cr.call(this,e,t,i,i,r,n,a)}function Fn(e,t,i,r,n,a,o){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new fe(e,t,i,n,a,o)}function Bn(e){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),e}function On(e){return void 0===e&&(e=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),e.isMultiMaterial=!0,e.materials=e,e.clone=function(){return e.slice()},e}function zn(e,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new Ot(e,t)}function Hn(e){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new Rt(e)}function Gn(e,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new Ot(e,t)}function Vn(e){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new Bt(e)}function kn(e){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new Bt(e)}function Wn(e){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new Bt(e)}function jn(e,t,i){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new c(e,t,i)}function Xn(e,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new ge(e,t).setDynamic(!0)}function qn(e,t){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new ye(e,t)}function Yn(e,t){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new xe(e,t)}function Zn(e,t){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new be(e,t)}function Jn(e,t){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new _e(e,t)}function Qn(e,t){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new we(e,t)}function Kn(e,t){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new Me(e,t)}function $n(e,t){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new Ee(e,t)}function ea(e,t){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new Te(e,t)}function ta(e,t){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Se(e,t)}function ia(e){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Cn.call(this,e),this.type="catmullrom",this.closed=!0}function ra(e){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Cn.call(this,e),this.type="catmullrom"}function na(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Cn.call(this,e),this.type="catmullrom"}function aa(e,t){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Tn(e,t)}function oa(e,t){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new Dt(new bi(e.geometry),new Ut({color:void 0!==t?t:16777215}))}function sa(e,t){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new Dt(new kt(e.geometry),new Ut({color:void 0!==t?t:16777215}))}function ca(e){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new Bi(e)}function la(e){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new zi(e)}function ha(){console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(e,t){console.warn("THREE.Projector: .projectVector() is now vector.project()."),e.project(t)},this.unprojectVector=function(e,t){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),e.unproject(t)},this.pickingRay=function(){console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}}function ua(){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(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}),void 0===Math.sign&&(Math.sign=function(e){return e<0?-1:e>0?1:+e}),void 0===Function.prototype.name&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&!function(){Object.assign=function(e){if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var r=arguments[i];if(void 0!==r&&null!==r)for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}}(),babelHelpers.extends(t.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var i=this._listeners;void 0===i[e]&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var i=this._listeners;return void 0!==i[e]&&i[e].indexOf(t)!==-1},removeEventListener:function(e,t){if(void 0!==this._listeners){var i=this._listeners,r=i[e];if(void 0!==r){var n=r.indexOf(t);n!==-1&&r.splice(n,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners,i=t[e.type];if(void 0!==i){e.target=this;for(var r=i.slice(0),n=0,a=r.length;n<a;n++)r[n].call(this,e)}}}});var pa="87",da={LEFT:0,MIDDLE:1,RIGHT:2},fa=0,ma=1,va=2,ga=3,ya=0,xa=1,ba=0,_a=1,wa=2,Ma=0,Ea=1,Ta=2,Sa=1,Aa=2,Ra=0,La=1,Pa=2,Ca=0,Ia=1,Ua=2,Na=3,Da=4,Fa=5,Ba=100,Oa=101,za=102,Ha=103,Ga=104,Va=200,ka=201,Wa=202,ja=203,Xa=204,qa=205,Ya=206,Za=207,Ja=208,Qa=209,Ka=210,$a=0,eo=1,to=2,io=3,ro=4,no=5,ao=6,oo=7,so=0,co=1,lo=2,ho=0,uo=1,po=2,fo=3,mo=4,vo=300,go=301,yo=302,xo=303,bo=304,_o=305,wo=306,Mo=307,Eo=1e3,To=1001,So=1002,Ao=1003,Ro=1004,Lo=1005,Po=1006,Co=1007,Io=1008,Uo=1009,No=1010,Do=1011,Fo=1012,Bo=1013,Oo=1014,zo=1015,Ho=1016,Go=1017,Vo=1018,ko=1019,Wo=1020,jo=1021,Xo=1022,qo=1023,Yo=1024,Zo=1025,Jo=qo,Qo=1026,Ko=1027,$o=2001,es=2002,ts=2003,is=2004,rs=2100,ns=2101,as=2102,os=2103,ss=2151,cs=2200,ls=2201,hs=2202,us=2300,ps=2301,ds=2302,fs=2400,ms=2401,vs=2402,gs=0,ys=1,xs=2,bs=3e3,_s=3001,ws=3007,Ms=3002,Es=3003,Ts=3004,Ss=3005,As=3006,Rs=3200,Ls=3201,Ps={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var e,t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),i=new Array(36),r=0;return function(){for(var n=0;n<36;n++)8===n||13===n||18===n||23===n?i[n]="-":14===n?i[n]="4":(r<=2&&(r=33554432+16777216*Math.random()|0),e=15&r,r>>=4,i[n]=t[19===n?3&e|8:e]);return i.join("")}}(),clamp:function(e,t,i){return Math.max(t,Math.min(i,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,i,r,n){return r+(e-t)*(n-r)/(i-t)},lerp:function(e,t,i){return(1-i)*e+i*t},smoothstep:function(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t),e*e*(3-2*e))},smootherstep:function(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t),e*e*e*(e*(6*e-15)+10))},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*Ps.DEG2RAD},radToDeg:function(e){return e*Ps.RAD2DEG},isPowerOfTwo:function(e){return 0===(e&e-1)&&0!==e},nearestPowerOfTwo:function(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))},nextPowerOfTwo:function(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,e}};Object.defineProperties(i.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),babelHelpers.extends(i.prototype,{isVector2:!0,set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.x=e,this.y=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this},clampScalar:function(){var e=new i,t=new i;return function(i,r){return e.set(i,i),t.set(r,r),this.clamp(e,t)}}(),clampLength:function(e,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))},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(e){return this.x*e.x+this.y*e.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)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function e(){var e=Math.atan2(this.y,this.x);return e<0&&(e+=2*Math.PI),e},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,i=this.y-e.y;return t*t+i*i},distanceToManhattan:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,i){return this.subVectors(t,e).multiplyScalar(i).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute:function(e,t,i){return void 0!==i&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),
this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var i=Math.cos(t),r=Math.sin(t),n=this.x-e.x,a=this.y-e.y;return this.x=n*i-a*r+e.x,this.y=n*r+a*i+e.y,this}});var Cs=0;r.DEFAULT_IMAGE=void 0,r.DEFAULT_MAPPING=vo,Object.defineProperty(r.prototype,"needsUpdate",{set:function(e){e===!0&&this.version++}}),babelHelpers.extends(r.prototype,t.prototype,{constructor:r,isTexture:!0,clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){function t(e){var t;if(e instanceof HTMLCanvasElement)t=e;else{t=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),t.width=e.width,t.height=e.height;var i=t.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height)}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}if(void 0!==e.textures[this.uuid])return e.textures[this.uuid];var i={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],wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(void 0!==this.image){var r=this.image;void 0===r.uuid&&(r.uuid=Ps.generateUUID()),void 0===e.images[r.uuid]&&(e.images[r.uuid]={uuid:r.uuid,url:t(r)}),i.image=r.uuid}return e.textures[this.uuid]=i,i},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(this.mapping===vo){if(e.multiply(this.repeat),e.add(this.offset),e.x<0||e.x>1)switch(this.wrapS){case Eo:e.x=e.x-Math.floor(e.x);break;case To:e.x=e.x<0?0:1;break;case So:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case Eo:e.y=e.y-Math.floor(e.y);break;case To:e.y=e.y<0?0:1;break;case So:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}this.flipY&&(e.y=1-e.y)}}}),babelHelpers.extends(n.prototype,{isVector4:!0,set:function(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){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: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var t=this.x,i=this.y,r=this.z,n=this.w,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*r+a[12]*n,this.y=a[1]*t+a[5]*i+a[9]*r+a[13]*n,this.z=a[2]*t+a[6]*i+a[10]*r+a[14]*n,this.w=a[3]*t+a[7]*i+a[11]*r+a[15]*n,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){var t,i,r,n,a=.01,o=.1,s=e.elements,c=s[0],l=s[4],h=s[8],u=s[1],p=s[5],d=s[9],f=s[2],m=s[6],v=s[10];if(Math.abs(l-u)<a&&Math.abs(h-f)<a&&Math.abs(d-m)<a){if(Math.abs(l+u)<o&&Math.abs(h+f)<o&&Math.abs(d+m)<o&&Math.abs(c+p+v-3)<o)return this.set(1,0,0,0),this;t=Math.PI;var g=(c+1)/2,y=(p+1)/2,x=(v+1)/2,b=(l+u)/4,_=(h+f)/4,w=(d+m)/4;return g>y&&g>x?g<a?(i=0,r=.707106781,n=.707106781):(i=Math.sqrt(g),r=b/i,n=_/i):y>x?y<a?(i=.707106781,r=0,n=.707106781):(r=Math.sqrt(y),i=b/r,n=w/r):x<a?(i=.707106781,r=.707106781,n=0):(n=Math.sqrt(x),i=_/n,r=w/n),this.set(i,r,n,t),this}var M=Math.sqrt((m-d)*(m-d)+(h-f)*(h-f)+(u-l)*(u-l));return Math.abs(M)<.001&&(M=1),this.x=(m-d)/M,this.y=(h-f)/M,this.z=(u-l)/M,this.w=Math.acos((c+p+v-1)/2),this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this},clampScalar:function(){var e,t;return function(i,r){return void 0===e&&(e=new n,t=new n),e.set(i,i,i,i),t.set(r,r,r,r),this.clamp(e,t)}}(),clampLength:function(e,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))},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(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.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)},lengthManhattan: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(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,i){return this.subVectors(t,e).multiplyScalar(i).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromBufferAttribute:function(e,t,i){return void 0!==i&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}}),babelHelpers.extends(a.prototype,t.prototype,{isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),o.prototype=Object.create(a.prototype),o.prototype.constructor=o,o.prototype.isWebGLRenderTargetCube=!0,babelHelpers.extends(s,{slerp:function(e,t,i,r){return i.copy(e).slerp(t,r)},slerpFlat:function(e,t,i,r,n,a,o){var s=i[r+0],c=i[r+1],l=i[r+2],h=i[r+3],u=n[a+0],p=n[a+1],d=n[a+2],f=n[a+3];if(h!==f||s!==u||c!==p||l!==d){var m=1-o,v=s*u+c*p+l*d+h*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*_,l=l*m+d*_,h=h*m+f*_,m===1-o){var w=1/Math.sqrt(s*s+c*c+l*l+h*h);s*=w,c*=w,l*=w,h*=w}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=h}}),Object.defineProperties(s.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this.onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this.onChangeCallback()}}}),babelHelpers.extends(s.prototype,{set:function(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this.onChangeCallback(),this},setFromEuler:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var i=e._x,r=e._y,n=e._z,a=e.order,o=Math.cos,s=Math.sin,c=o(i/2),l=o(r/2),h=o(n/2),u=s(i/2),p=s(r/2),d=s(n/2);return"XYZ"===a?(this._x=u*l*h+c*p*d,this._y=c*p*h-u*l*d,this._z=c*l*d+u*p*h,this._w=c*l*h-u*p*d):"YXZ"===a?(this._x=u*l*h+c*p*d,this._y=c*p*h-u*l*d,this._z=c*l*d-u*p*h,this._w=c*l*h+u*p*d):"ZXY"===a?(this._x=u*l*h-c*p*d,this._y=c*p*h+u*l*d,this._z=c*l*d+u*p*h,this._w=c*l*h-u*p*d):"ZYX"===a?(this._x=u*l*h-c*p*d,this._y=c*p*h+u*l*d,this._z=c*l*d-u*p*h,this._w=c*l*h+u*p*d):"YZX"===a?(this._x=u*l*h+c*p*d,this._y=c*p*h+u*l*d,this._z=c*l*d-u*p*h,this._w=c*l*h-u*p*d):"XZY"===a&&(this._x=u*l*h-c*p*d,this._y=c*p*h-u*l*d,this._z=c*l*d+u*p*h,this._w=c*l*h+u*p*d),t!==!1&&this.onChangeCallback(),this},setFromAxisAngle:function(e,t){var i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this.onChangeCallback(),this},setFromRotationMatrix:function(e){var t,i=e.elements,r=i[0],n=i[4],a=i[8],o=i[1],s=i[5],c=i[9],l=i[2],h=i[6],u=i[10],p=r+s+u;return p>0?(t=.5/Math.sqrt(p+1),this._w=.25/t,this._x=(h-c)*t,this._y=(a-l)*t,this._z=(o-n)*t):r>s&&r>u?(t=2*Math.sqrt(1+r-s-u),this._w=(h-c)/t,this._x=.25*t,this._y=(n+o)/t,this._z=(a+l)/t):s>u?(t=2*Math.sqrt(1+s-r-u),this._w=(a-l)/t,this._x=(n+o)/t,this._y=.25*t,this._z=(c+h)/t):(t=2*Math.sqrt(1+u-r-s),this._w=(o-n)/t,this._x=(a+l)/t,this._y=(c+h)/t,this._z=.25*t),this.onChangeCallback(),this},setFromUnitVectors:function(){var e,t=new c,i=1e-6;return function(r,n){return void 0===t&&(t=new c),e=r.dot(n)+1,e<i?(e=0,Math.abs(r.x)>Math.abs(r.z)?t.set(-r.y,r.x,0):t.set(0,-r.z,r.y)):t.crossVectors(r,n),this._x=t.x,this._y=t.y,this._z=t.z,this._w=e,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(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._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 e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this.onChangeCallback(),this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var i=e._x,r=e._y,n=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=i*l+a*o+r*c-n*s,this._y=r*l+a*s+n*o-i*c,this._z=n*l+a*c+i*s-r*o,this._w=a*l-i*o-r*s-n*c,this.onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var i=this._x,r=this._y,n=this._z,a=this._w,o=a*e._w+i*e._x+r*e._y+n*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=i,this._y=r,this._z=n,this;var s=Math.sqrt(1-o*o);if(Math.abs(s)<.001)return this._w=.5*(a+this._w),this._x=.5*(i+this._x),this._y=.5*(r+this._y),this._z=.5*(n+this._z),this;var c=Math.atan2(s,o),l=Math.sin((1-t)*c)/s,h=Math.sin(t*c)/s;return this._w=a*l+this._w*h,this._x=i*l+this._x*h,this._y=r*l+this._y*h,this._z=n*l+this._z*h,this.onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}}),babelHelpers.extends(c.prototype,{isVector3:!0,set:function(e,t,i){return this.x=e,this.y=t,this.z=i,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:function(){var e=new s;return function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(e.setFromEuler(t))}}(),applyAxisAngle:function(){var e=new s;return function(t,i){return this.applyQuaternion(e.setFromAxisAngle(t,i))}}(),applyMatrix3:function(e){var t=this.x,i=this.y,r=this.z,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6]*r,this.y=n[1]*t+n[4]*i+n[7]*r,this.z=n[2]*t+n[5]*i+n[8]*r,this},applyMatrix4:function(e){var t=this.x,i=this.y,r=this.z,n=e.elements,a=1/(n[3]*t+n[7]*i+n[11]*r+n[15]);return this.x=(n[0]*t+n[4]*i+n[8]*r+n[12])*a,this.y=(n[1]*t+n[5]*i+n[9]*r+n[13])*a,this.z=(n[2]*t+n[6]*i+n[10]*r+n[14])*a,this},applyQuaternion:function(e){var t=this.x,i=this.y,r=this.z,n=e.x,a=e.y,o=e.z,s=e.w,c=s*t+a*r-o*i,l=s*i+o*t-n*r,h=s*r+n*i-a*t,u=-n*t-a*i-o*r;return this.x=c*s+u*-n+l*-o-h*-a,this.y=l*s+u*-a+h*-n-c*-o,this.z=h*s+u*-o+c*-a-l*-n,this},project:function(){var e=new l;return function(t){return e.multiplyMatrices(t.projectionMatrix,e.getInverse(t.matrixWorld)),this.applyMatrix4(e)}}(),unproject:function(){var e=new l;return function(t){return e.multiplyMatrices(t.matrixWorld,e.getInverse(t.projectionMatrix)),this.applyMatrix4(e)}}(),transformDirection:function(e){var t=this.x,i=this.y,r=this.z,n=e.elements;return this.x=n[0]*t+n[4]*i+n[8]*r,this.y=n[1]*t+n[5]*i+n[9]*r,this.z=n[2]*t+n[6]*i+n[10]*r,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this},clampScalar:function(){var e=new c,t=new c;return function(i,r){return e.set(i,i,i),t.set(r,r,r),this.clamp(e,t)}}(),clampLength:function(e,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))},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(e){return this.x*e.x+this.y*e.y+this.z*e.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)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,i){return this.subVectors(t,e).multiplyScalar(i).add(e)},cross:function(e,t){if(void 0!==t)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t);var i=this.x,r=this.y,n=this.z;return this.x=r*e.z-n*e.y,this.y=n*e.x-i*e.z,this.z=i*e.y-r*e.x,this},crossVectors:function(e,t){var i=e.x,r=e.y,n=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-n*o,this.y=n*a-i*s,this.z=i*o-r*a,this},projectOnVector:function(e){var t=e.dot(this)/e.lengthSq();return this.copy(e).multiplyScalar(t)},projectOnPlane:function(){var e=new c;return function(t){return e.copy(this).projectOnVector(t),this.sub(e)}}(),reflect:function(){var e=new c;return function(t){return this.sub(e.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(e){var t=this.dot(e)/Math.sqrt(this.lengthSq()*e.lengthSq());return Math.acos(Ps.clamp(t,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r},distanceToManhattan:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){var t=Math.sin(e.phi)*e.radius;return this.x=t*Math.sin(e.theta),this.y=Math.cos(e.phi)*e.radius,this.z=t*Math.cos(e.theta),this},setFromCylindrical:function(e){return this.x=e.radius*Math.sin(e.theta),this.y=e.y,this.z=e.radius*Math.cos(e.theta),this},setFromMatrixPosition:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,i){return void 0!==i&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}}),babelHelpers.extends(l.prototype,{isMatrix4:!0,set:function(e,t,i,r,n,a,o,s,c,l,h,u,p,d,f,m){var v=this.elements;return v[0]=e,v[4]=t,v[8]=i,v[12]=r,v[1]=n,v[5]=a,v[9]=o,v[13]=s,v[2]=c,v[6]=l,v[10]=h,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 l).fromArray(this.elements)},copy:function(e){var t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this},copyPosition:function(e){var t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this},extractBasis:function(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this},makeBasis:function(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this},extractRotation:function(){var e=new c;return function(t){var i=this.elements,r=t.elements,n=1/e.setFromMatrixColumn(t,0).length(),a=1/e.setFromMatrixColumn(t,1).length(),o=1/e.setFromMatrixColumn(t,2).length();return i[0]=r[0]*n,i[1]=r[1]*n,i[2]=r[2]*n,i[4]=r[4]*a,i[5]=r[5]*a,i[6]=r[6]*a,i[8]=r[8]*o,i[9]=r[9]*o,i[10]=r[10]*o,this}}(),makeRotationFromEuler:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,i=e.x,r=e.y,n=e.z,a=Math.cos(i),o=Math.sin(i),s=Math.cos(r),c=Math.sin(r),l=Math.cos(n),h=Math.sin(n);if("XYZ"===e.order){var u=a*l,p=a*h,d=o*l,f=o*h;t[0]=s*l,t[4]=-s*h,t[8]=c,t[1]=p+d*c,t[5]=u-f*c,t[9]=-o*s,t[2]=f-u*c,t[6]=d+p*c,t[10]=a*s}else if("YXZ"===e.order){var m=s*l,v=s*h,g=c*l,y=c*h;t[0]=m+y*o,t[4]=g*o-v,t[8]=a*c,t[1]=a*h,t[5]=a*l,t[9]=-o,t[2]=v*o-g,t[6]=y+m*o,t[10]=a*s}else if("ZXY"===e.order){var m=s*l,v=s*h,g=c*l,y=c*h;t[0]=m-y*o,t[4]=-a*h,t[8]=g+v*o,t[1]=v+g*o,t[5]=a*l,t[9]=y-m*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if("ZYX"===e.order){var u=a*l,p=a*h,d=o*l,f=o*h;t[0]=s*l,t[4]=d*c-p,t[8]=u*c+f,t[1]=s*h,t[5]=f*c+u,t[9]=p*c-d,t[2]=-c,t[6]=o*s,t[10]=a*s}else if("YZX"===e.order){var x=a*s,b=a*c,_=o*s,w=o*c;t[0]=s*l,t[4]=w-x*h,t[8]=_*h+b,t[1]=h,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=b*h+_,t[10]=x-w*h}else if("XZY"===e.order){var x=a*s,b=a*c,_=o*s,w=o*c;t[0]=s*l,t[4]=-h,t[8]=c*l,t[1]=x*h+w,t[5]=a*l,t[9]=b*h-_,t[2]=_*h-b,t[6]=o*l,t[10]=w*h+x}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:function(e){var t=this.elements,i=e._x,r=e._y,n=e._z,a=e._w,o=i+i,s=r+r,c=n+n,l=i*o,h=i*s,u=i*c,p=r*s,d=r*c,f=n*c,m=a*o,v=a*s,g=a*c;return t[0]=1-(p+f),t[4]=h-g,t[8]=u+v,t[1]=h+g,t[5]=1-(l+f),t[9]=d-m,t[2]=u-v,t[6]=d+m,t[10]=1-(l+p),t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},lookAt:function(){var e=new c,t=new c,i=new c;return function(r,n,a){var o=this.elements;return i.subVectors(r,n),0===i.lengthSq()&&(i.z=1),i.normalize(),e.crossVectors(a,i),0===e.lengthSq()&&(1===Math.abs(a.z)?i.x+=1e-4:i.z+=1e-4,i.normalize(),e.crossVectors(a,i)),e.normalize(),t.crossVectors(i,e),o[0]=e.x,o[4]=t.x,o[8]=i.x,o[1]=e.y,o[5]=t.y,o[9]=i.y,o[2]=e.z,o[6]=t.z,o[10]=i.z,this}}(),multiply:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var i=e.elements,r=t.elements,n=this.elements,a=i[0],o=i[4],s=i[8],c=i[12],l=i[1],h=i[5],u=i[9],p=i[13],d=i[2],f=i[6],m=i[10],v=i[14],g=i[3],y=i[7],x=i[11],b=i[15],_=r[0],w=r[4],M=r[8],E=r[12],T=r[1],S=r[5],A=r[9],R=r[13],L=r[2],P=r[6],C=r[10],I=r[14],U=r[3],N=r[7],D=r[11],F=r[15];return n[0]=a*_+o*T+s*L+c*U,n[4]=a*w+o*S+s*P+c*N,n[8]=a*M+o*A+s*C+c*D,n[12]=a*E+o*R+s*I+c*F,n[1]=l*_+h*T+u*L+p*U,n[5]=l*w+h*S+u*P+p*N,n[9]=l*M+h*A+u*C+p*D,n[13]=l*E+h*R+u*I+p*F,n[2]=d*_+f*T+m*L+v*U,n[6]=d*w+f*S+m*P+v*N,n[10]=d*M+f*A+m*C+v*D,n[14]=d*E+f*R+m*I+v*F,n[3]=g*_+y*T+x*L+b*U,n[7]=g*w+y*S+x*P+b*N,n[11]=g*M+y*A+x*C+b*D,n[15]=g*E+y*R+x*I+b*F,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},applyToBufferAttribute:function(){var e=new c;return function(t){for(var i=0,r=t.count;i<r;i++)e.x=t.getX(i),e.y=t.getY(i),e.z=t.getZ(i),e.applyMatrix4(this),t.setXYZ(i,e.x,e.y,e.z);return t}}(),determinant:function(){var e=this.elements,t=e[0],i=e[4],r=e[8],n=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],h=e[6],u=e[10],p=e[14],d=e[3],f=e[7],m=e[11],v=e[15];return d*(+n*s*h-r*c*h-n*o*u+i*c*u+r*o*p-i*s*p)+f*(+t*s*p-t*c*u+n*a*u-r*a*p+r*c*l-n*s*l)+m*(+t*c*h-t*o*p-n*a*h+i*a*p+n*o*l-i*c*l)+v*(-r*o*l-t*s*h+t*o*u+r*a*h-i*a*u+i*s*l)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},setPosition:function(e){var t=this.elements;return t[12]=e.x,t[13]=e.y,t[14]=e.z,this},getInverse:function(e,t){var i=this.elements,r=e.elements,n=r[0],a=r[1],o=r[2],s=r[3],c=r[4],l=r[5],h=r[6],u=r[7],p=r[8],d=r[9],f=r[10],m=r[11],v=r[12],g=r[13],y=r[14],x=r[15],b=d*y*u-g*f*u+g*h*m-l*y*m-d*h*x+l*f*x,_=v*f*u-p*y*u-v*h*m+c*y*m+p*h*x-c*f*x,w=p*g*u-v*d*u+v*l*m-c*g*m-p*l*x+c*d*x,M=v*d*h-p*g*h-v*l*f+c*g*f+p*l*y-c*d*y,E=n*b+a*_+o*w+s*M;if(0===E){var T="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(t===!0)throw new Error(T);return console.warn(T),this.identity()}var S=1/E;return i[0]=b*S,i[1]=(g*f*s-d*y*s-g*o*m+a*y*m+d*o*x-a*f*x)*S,i[2]=(l*y*s-g*h*s+g*o*u-a*y*u-l*o*x+a*h*x)*S,i[3]=(d*h*s-l*f*s-d*o*u+a*f*u+l*o*m-a*h*m)*S,i[4]=_*S,i[5]=(p*y*s-v*f*s+v*o*m-n*y*m-p*o*x+n*f*x)*S,i[6]=(v*h*s-c*y*s-v*o*u+n*y*u+c*o*x-n*h*x)*S,i[7]=(c*f*s-p*h*s+p*o*u-n*f*u-c*o*m+n*h*m)*S,i[8]=w*S,i[9]=(v*d*s-p*g*s-v*a*m+n*g*m+p*a*x-n*d*x)*S,i[10]=(c*g*s-v*l*s+v*a*u-n*g*u-c*a*x+n*l*x)*S,i[11]=(p*l*s-c*d*s-p*a*u+n*d*u+c*a*m-n*l*m)*S,i[12]=M*S,i[13]=(p*g*o-v*d*o+v*a*f-n*g*f-p*a*y+n*d*y)*S,i[14]=(v*l*o-c*g*o-v*a*h+n*g*h+c*a*y-n*l*y)*S,i[15]=(c*d*o-p*l*o+p*a*h-n*d*h-c*a*f+n*l*f)*S,this},scale:function(e){var t=this.elements,i=e.x,r=e.y,n=e.z;return t[0]*=i,t[4]*=r,t[8]*=n,t[1]*=i,t[5]*=r,t[9]*=n,t[2]*=i,t[6]*=r,t[10]*=n,t[3]*=i,t[7]*=r,t[11]*=n,this},getMaxScaleOnAxis:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))},makeTranslation:function(e,t,i){return this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this},makeRotationX:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this},makeRotationY:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this},makeRotationZ:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,t){var i=Math.cos(t),r=Math.sin(t),n=1-i,a=e.x,o=e.y,s=e.z,c=n*a,l=n*o;return this.set(c*a+i,c*o-r*s,c*s+r*o,0,c*o+r*s,l*o+i,l*s-r*a,0,c*s-r*o,l*s+r*a,n*s*s+i,0,0,0,0,1),this},makeScale:function(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this},makeShear:function(e,t,i){return this.set(1,t,i,0,e,1,i,0,e,t,1,0,0,0,0,1),this},compose:function(e,t,i){return this.makeRotationFromQuaternion(t),this.scale(i),this.setPosition(e),this},decompose:function(){var e=new c,t=new l;return function(i,r,n){var a=this.elements,o=e.set(a[0],a[1],a[2]).length(),s=e.set(a[4],a[5],a[6]).length(),c=e.set(a[8],a[9],a[10]).length(),l=this.determinant();l<0&&(o=-o),i.x=a[12],i.y=a[13],i.z=a[14],t.copy(this);var h=1/o,u=1/s,p=1/c;return t.elements[0]*=h,t.elements[1]*=h,t.elements[2]*=h,t.elements[4]*=u,t.elements[5]*=u,t.elements[6]*=u,t.elements[8]*=p,t.elements[9]*=p,t.elements[10]*=p,r.setFromRotationMatrix(t),n.x=o,n.y=s,n.z=c,this}}(),makePerspective:function(e,t,i,r,n,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*n/(t-e),c=2*n/(i-r),l=(t+e)/(t-e),h=(i+r)/(i-r),u=-(a+n)/(a-n),p=-2*a*n/(a-n);return o[0]=s,o[4]=0,o[8]=l,o[12]=0,o[1]=0,o[5]=c,o[9]=h,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(e,t,i,r,n,a){var o=this.elements,s=1/(t-e),c=1/(i-r),l=1/(a-n),h=(t+e)*s,u=(i+r)*c,p=(a+n)*l;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-h,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-u,o[2]=0,o[6]=0,o[10]=-2*l,o[14]=-p,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(e){for(var t=this.elements,i=e.elements,r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var i=0;i<16;i++)this.elements[i]=e[i+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}),h.prototype=Object.create(r.prototype),h.prototype.constructor=h,h.prototype.isDataTexture=!0,u.prototype=Object.create(r.prototype),u.prototype.constructor=u,u.prototype.isCubeTexture=!0,Object.defineProperty(u.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}});var Is=new r,Us=new u,Ns=[],Ds=[],Fs=new Float32Array(16),Bs=new Float32Array(9);V.prototype.setValue=function(e,t){for(var i=this.seq,r=0,n=i.length;r!==n;++r){var a=i[r];a.setValue(e,t[a.id])}};var Os=/([\w\d_]+)(\])?(\[|\.)?/g;j.prototype.setValue=function(e,t,i){var r=this.map[t];void 0!==r&&r.setValue(e,i,this.renderer)},j.prototype.setOptional=function(e,t,i){var r=t[i];void 0!==r&&this.setValue(e,i,r)},j.upload=function(e,t,i,r){for(var n=0,a=t.length;n!==a;++n){var o=t[n],s=i[o.id];s.needsUpdate!==!1&&o.setValue(e,s.value,r)}},j.seqWithValue=function(e,t){for(var i=[],r=0,n=e.length;r!==n;++r){var a=e[r];a.id in t&&i.push(a)}return i};var zs={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};babelHelpers.extends(X.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},setScalar:function(e){return this.r=e,this.g=e,this.b=e,this},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,i){return this.r=e,this.g=t,this.b=i,this},setHSL:function(){function e(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<.16666666666666666?e+6*(t-e)*i:i<.5?t:i<.6666666666666666?e+6*(t-e)*(.6666666666666666-i):e}return function(t,i,r){if(t=Ps.euclideanModulo(t,1),i=Ps.clamp(i,0,1),r=Ps.clamp(r,0,1),0===i)this.r=this.g=this.b=r;else{var n=r<=.5?r*(1+i):r+i-r*i,a=2*r-n;this.r=e(a,n,t+.3333333333333333),this.g=e(a,n,t),this.b=e(a,n,t-.3333333333333333)}return this}}(),setStyle:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var i;if(i=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var r,n=i[1],a=i[2];switch(n){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,c=parseInt(r[3],10)/100;return t(r[5]),this.setHSL(o,s,c)}}}else if(i=/^\#([A-Fa-f0-9]+)$/.exec(e)){var l=i[1],h=l.length;if(3===h)return this.r=parseInt(l.charAt(0)+l.charAt(0),16)/255,this.g=parseInt(l.charAt(1)+l.charAt(1),16)/255,this.b=parseInt(l.charAt(2)+l.charAt(2),16)/255,this;if(6===h)return this.r=parseInt(l.charAt(0)+l.charAt(1),16)/255,this.g=parseInt(l.charAt(2)+l.charAt(3),16)/255,this.b=parseInt(l.charAt(4)+l.charAt(5),16)/255,this}if(e&&e.length>0){var l=zs[e];void 0!==l?this.setHex(l):console.warn("THREE.Color: Unknown color "+e)}return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){void 0===t&&(t=2);var i=t>0?1/t:1;return this.r=Math.pow(e.r,i),this.g=Math.pow(e.g,i),this.b=Math.pow(e.b,i),this},convertGammaToLinear:function(){var e=this.r,t=this.g,i=this.b;return this.r=e*e,this.g=t*t,this.b=i*i,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(e){var t,i,r=e||{h:0,s:0,l:0},n=this.r,a=this.g,o=this.b,s=Math.max(n,a,o),c=Math.min(n,a,o),l=(c+s)/2;if(c===s)t=0,i=0;else{var h=s-c;switch(i=l<=.5?h/(s+c):h/(2-s-c),s){case n:t=(a-o)/h+(a<o?6:0);break;case a:t=(o-n)/h+2;break;case o:t=(n-a)/h+4}t/=6}return r.h=t,r.s=i,r.l=l,r},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(e,t,i){var r=this.getHSL();return r.h+=e,r.s+=t,r.l+=i,this.setHSL(r.h,r.s,r.l),this},add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},sub:function(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,t){return void 0===t&&(t=0),this.r=e[t],this.g=e[t+1],this.b=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e},toJSON:function(){return this.getHex()}});var Hs={common:{diffuse:{value:new X(15658734)},opacity:{value:1},map:{value:null},offsetRepeat:{value:new n(0,0,1,1)},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 i(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 X(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 X(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},offsetRepeat:{value:new n(0,0,1,1)}}},Gs={merge:function(e){for(var t={},i=0;i<e.length;i++){var r=this.clone(e[i]);for(var n in r)t[n]=r[n]}return t},clone:function(e){var t={};for(var i in e){t[i]={};for(var r in e[i]){var n=e[i][r];n&&(n.isColor||n.isMatrix3||n.isMatrix4||n.isVector2||n.isVector3||n.isVector4||n.isTexture)?t[i][r]=n.clone():Array.isArray(n)?t[i][r]=n.slice():t[i][r]=n}}return t}},Vs="#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",ks="#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",Ws="#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",js="#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n",Xs="#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",qs="\nvec3 transformed = vec3( position );\n",Ys="\nvec3 objectNormal = vec3( normal );\n",Zs="float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t}\n\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE  = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS  = 0.5 / LUT_SIZE;\n\tfloat theta = acos( dot( N, V ) );\n\tvec2 uv = vec2(\n\t\tsqrt( saturate( roughness ) ),\n\t\tsaturate( theta / ( 0.5 * PI ) ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.86267 + (0.49788 + 0.01436 * y ) * y;\n\tfloat b = 3.45068 + (4.18814 + y) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = (x > 0.0) ? v : 0.5 * inversesqrt( 1.0 - x * x ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transpose( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tvec3 result = vec3( LTC_ClippedSphereFormFactor( vectorFormFactor ) );\n\treturn result;\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n",Js="#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n",Qs="#if NUM_CLIPPING_PLANES > 0\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; ++ i ) {\n\t\tvec4 plane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t\t\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; ++ i ) {\n\t\t\tvec4 plane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t\n\t#endif\n#endif\n",Ks="#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif\n",$s="#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvarying vec3 vViewPosition;\n#endif\n",ec="#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n",tc="#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",ic="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",rc="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",nc="#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",ac="#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transpose( const in mat3 v ) {\n\tmat3 tmp;\n\ttmp[0] = vec3(v[0].x, v[1].x, v[2].x);\n\ttmp[1] = vec3(v[0].y, v[1].y, v[2].y);\n\ttmp[2] = vec3(v[0].z, v[1].z, v[2].z);\n\treturn tmp;\n}\n",oc="#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1  (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale =  bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif\n",sc="vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n",cc="#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",lc="#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",hc="#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",uc="#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",pc="  gl_FragColor = linearToOutputTexel( gl_FragColor );\n",dc="\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\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 );\n}\nvec4 LinearTosRGB( in vec4 value ) {\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 );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat M      = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM            = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat D      = max( maxRange / maxRGB, 1.0 );\n\tD            = min( floor( D ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value )  {\n\tvec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n\tXp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract(Le);\n\tvResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n\treturn vec4( max(vRGB, 0.0), 1.0 );\n}\n",fc="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",mc="#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",vc="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif\n",gc="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif\n",yc="\n#ifdef USE_FOG\nfogDepth = -mvPosition.z;\n#endif",xc="#ifdef USE_FOG\n  varying float fogDepth;\n#endif\n",bc="#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",_c="#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif\n",wc="#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif\n",Mc="#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",Ec="#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",Tc="vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",Sc="uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight  ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltcMat;\tuniform sampler2D ltcMag;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",Ac="BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",Rc="varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",Lc="PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif\n",Pc="struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos - halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos + halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos + halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos - halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tfloat norm = texture2D( ltcMag, uv ).a;\n\t\tvec4 t = texture2D( ltcMat, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3(   1,   0, t.y ),\n\t\t\tvec3(   0, t.z,   0 ),\n\t\t\tvec3( t.w,   0, t.x )\n\t\t);\n\t\treflectedLight.directSpecular += lightColor * material.specularColor * norm * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material )   GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material )   GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n",Cc="\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\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;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\t#ifndef STANDARD\n\t\tvec3 clearCoatRadiance = getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), 8 );\n\t#else\n\t\tvec3 clearCoatRadiance = vec3( 0.0 );\n\t#endif\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif\n",Ic="#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",Uc="#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",Nc="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",Dc="#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n",Fc="#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",Bc="#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",Oc="#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",zc="#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",Hc="float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif\n",Gc="#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",Vc="#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",kc="#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",Wc="#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n",jc="#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",Xc="#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n",qc="vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 1.0 - 2.0 * rgb.xyz;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256.,  256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}\n",Yc="#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",Zc="vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;\n",Jc="#if defined( DITHERING )\n  gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif\n",Qc="#if defined( DITHERING )\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif\n",Kc="float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif\n",$c="#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",el="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",tl="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",il="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",rl="float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",nl="#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",al="#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",ol="#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif\n",sl="#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix  = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",cl="float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",ll="#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",hl="#if defined( TONE_MAPPING )\n  gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",ul="#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\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 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",pl="#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 )\n\tvarying vec2 vUv;\n#endif",dl="#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 )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n",fl="#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 )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",ml="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",vl="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",gl="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",yl="#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( PHYSICAL ) || defined( LAMBERT ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n#endif\n",xl="uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldPosition;\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\tgl_FragColor.a *= opacity;\n}\n",bl="varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}\n",_l="#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}\n",wl="#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}\n",Ml="#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}\n",El="#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}\n",Tl="uniform sampler2D tEquirect;\nvarying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}\n",Sl="varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}\n",Al="uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",Rl="uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}\n",Ll="uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",Pl="#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}\n",Cl="uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",Il="#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",Ul="#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",Nl="#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",Dl="#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",Fl="#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",Bl="#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}\n",Ol="#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}\n",zl="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",Hl="uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",Gl="uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <bsdfs>\n#include <lights_pars>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n}\n",Vl="#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n",kl={
alphamap_fragment:Vs,alphamap_pars_fragment:ks,alphatest_fragment:Ws,aomap_fragment:js,aomap_pars_fragment:Xs,begin_vertex:qs,beginnormal_vertex:Ys,bsdfs:Zs,bumpmap_pars_fragment:Js,clipping_planes_fragment:Qs,clipping_planes_pars_fragment:Ks,clipping_planes_pars_vertex:$s,clipping_planes_vertex:ec,color_fragment:tc,color_pars_fragment:ic,color_pars_vertex:rc,color_vertex:nc,common:ac,cube_uv_reflection_fragment:oc,defaultnormal_vertex:sc,displacementmap_pars_vertex:cc,displacementmap_vertex:lc,emissivemap_fragment:hc,emissivemap_pars_fragment:uc,encodings_fragment:pc,encodings_pars_fragment:dc,envmap_fragment:fc,envmap_pars_fragment:mc,envmap_pars_vertex:vc,envmap_vertex:gc,fog_vertex:yc,fog_pars_vertex:xc,fog_fragment:bc,fog_pars_fragment:_c,gradientmap_pars_fragment:wc,lightmap_fragment:Mc,lightmap_pars_fragment:Ec,lights_lambert_vertex:Tc,lights_pars:Sc,lights_phong_fragment:Ac,lights_phong_pars_fragment:Rc,lights_physical_fragment:Lc,lights_physical_pars_fragment:Pc,lights_template:Cc,logdepthbuf_fragment:Ic,logdepthbuf_pars_fragment:Uc,logdepthbuf_pars_vertex:Nc,logdepthbuf_vertex:Dc,map_fragment:Fc,map_pars_fragment:Bc,map_particle_fragment:Oc,map_particle_pars_fragment:zc,metalnessmap_fragment:Hc,metalnessmap_pars_fragment:Gc,morphnormal_vertex:Vc,morphtarget_pars_vertex:kc,morphtarget_vertex:Wc,normal_fragment:jc,normalmap_pars_fragment:Xc,packing:qc,premultiplied_alpha_fragment:Yc,project_vertex:Zc,dithering_fragment:Jc,dithering_pars_fragment:Qc,roughnessmap_fragment:Kc,roughnessmap_pars_fragment:$c,shadowmap_pars_fragment:el,shadowmap_pars_vertex:tl,shadowmap_vertex:il,shadowmask_pars_fragment:rl,skinbase_vertex:nl,skinning_pars_vertex:al,skinning_vertex:ol,skinnormal_vertex:sl,specularmap_fragment:cl,specularmap_pars_fragment:ll,tonemapping_fragment:hl,tonemapping_pars_fragment:ul,uv_pars_fragment:pl,uv_pars_vertex:dl,uv_vertex:fl,uv2_pars_fragment:ml,uv2_pars_vertex:vl,uv2_vertex:gl,worldpos_vertex:yl,cube_frag:xl,cube_vert:bl,depth_frag:_l,depth_vert:wl,distanceRGBA_frag:Ml,distanceRGBA_vert:El,equirect_frag:Tl,equirect_vert:Sl,linedashed_frag:Al,linedashed_vert:Rl,meshbasic_frag:Ll,meshbasic_vert:Pl,meshlambert_frag:Cl,meshlambert_vert:Il,meshphong_frag:Ul,meshphong_vert:Nl,meshphysical_frag:Dl,meshphysical_vert:Fl,normal_frag:Bl,normal_vert:Ol,points_frag:zl,points_vert:Hl,shadow_frag:Gl,shadow_vert:Vl},Wl={basic:{uniforms:Gs.merge([Hs.common,Hs.specularmap,Hs.envmap,Hs.aomap,Hs.lightmap,Hs.fog]),vertexShader:kl.meshbasic_vert,fragmentShader:kl.meshbasic_frag},lambert:{uniforms:Gs.merge([Hs.common,Hs.specularmap,Hs.envmap,Hs.aomap,Hs.lightmap,Hs.emissivemap,Hs.fog,Hs.lights,{emissive:{value:new X(0)}}]),vertexShader:kl.meshlambert_vert,fragmentShader:kl.meshlambert_frag},phong:{uniforms:Gs.merge([Hs.common,Hs.specularmap,Hs.envmap,Hs.aomap,Hs.lightmap,Hs.emissivemap,Hs.bumpmap,Hs.normalmap,Hs.displacementmap,Hs.gradientmap,Hs.fog,Hs.lights,{emissive:{value:new X(0)},specular:{value:new X(1118481)},shininess:{value:30}}]),vertexShader:kl.meshphong_vert,fragmentShader:kl.meshphong_frag},standard:{uniforms:Gs.merge([Hs.common,Hs.envmap,Hs.aomap,Hs.lightmap,Hs.emissivemap,Hs.bumpmap,Hs.normalmap,Hs.displacementmap,Hs.roughnessmap,Hs.metalnessmap,Hs.fog,Hs.lights,{emissive:{value:new X(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:kl.meshphysical_vert,fragmentShader:kl.meshphysical_frag},points:{uniforms:Gs.merge([Hs.points,Hs.fog]),vertexShader:kl.points_vert,fragmentShader:kl.points_frag},dashed:{uniforms:Gs.merge([Hs.common,Hs.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:kl.linedashed_vert,fragmentShader:kl.linedashed_frag},depth:{uniforms:Gs.merge([Hs.common,Hs.displacementmap]),vertexShader:kl.depth_vert,fragmentShader:kl.depth_frag},normal:{uniforms:Gs.merge([Hs.common,Hs.bumpmap,Hs.normalmap,Hs.displacementmap,{opacity:{value:1}}]),vertexShader:kl.normal_vert,fragmentShader:kl.normal_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:kl.cube_vert,fragmentShader:kl.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:kl.equirect_vert,fragmentShader:kl.equirect_frag},distanceRGBA:{uniforms:Gs.merge([Hs.common,Hs.displacementmap,{referencePosition:{value:new c},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:kl.distanceRGBA_vert,fragmentShader:kl.distanceRGBA_frag},shadow:{uniforms:Gs.merge([Hs.lights,{color:{value:new X(0)},opacity:{value:1}}]),vertexShader:kl.shadow_vert,fragmentShader:kl.shadow_frag}};Wl.physical={uniforms:Gs.merge([Wl.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:kl.meshphysical_vert,fragmentShader:kl.meshphysical_frag},babelHelpers.extends(q.prototype,{set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new i;return function(t,i){var r=e.copy(i).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.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(e){var t=e||new i;return this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){var t=e||new i;return this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y},getParameter:function(e,t){var r=t||new i;return r.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)},clampPoint:function(e,t){var r=t||new i;return r.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new i;return function(t){var i=e.copy(t).clamp(this.min,this.max);return i.sub(t).length()}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}),Z.prototype=Object.create(r.prototype),Z.prototype.constructor=Z;var jl=0;babelHelpers.extends(Q.prototype,t.prototype,{isMaterial:!0,onBeforeCompile:function(){},setValues:function(e){if(void 0!==e)for(var t in e){var i=e[t];if(void 0!==i)if("shading"!==t){var r=this[t];void 0!==r?r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):"overdraw"===t?this[t]=Number(i):this[t]=i:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=i===Sa;else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}},toJSON:function(e){function t(e){var t=[];for(var i in e){var r=e[i];delete r.metadata,t.push(r)}return t}var i=void 0===e;i&&(e={textures:{},images:{}});var r={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),void 0!==this.roughness&&(r.roughness=this.roughness),void 0!==this.metalness&&(r.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),void 0!==this.shininess&&(r.shininess=this.shininess),void 0!==this.clearCoat&&(r.clearCoat=this.clearCoat),void 0!==this.clearCoatRoughness&&(r.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,r.reflectivity=this.reflectivity),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.size&&(r.size=this.size),void 0!==this.sizeAttenuation&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==Ia&&(r.blending=this.blending),this.flatShading===!0&&(r.flatShading=this.flatShading),this.side!==Ma&&(r.side=this.side),this.vertexColors!==Ra&&(r.vertexColors=this.vertexColors),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=this.transparent),r.depthFunc=this.depthFunc,r.depthTest=this.depthTest,r.depthWrite=this.depthWrite,this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(r.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(r.wireframeLinejoin=this.wireframeLinejoin),this.morphTargets===!0&&(r.morphTargets=!0),this.skinning===!0&&(r.skinning=!0),this.visible===!1&&(r.visible=!1),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),i){var n=t(e.textures),a=t(e.images);n.length>0&&(r.textures=n),a.length>0&&(r.images=a)}return r},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.lights=e.lights,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.overdraw=e.overdraw,this.visible=e.visible,this.userData=JSON.parse(JSON.stringify(e.userData)),this.clipShadows=e.clipShadows,this.clipIntersection=e.clipIntersection;var t=e.clippingPlanes,i=null;if(null!==t){var r=t.length;i=new Array(r);for(var n=0;n!==r;++n)i[n]=t[n].clone()}return this.clippingPlanes=i,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),K.prototype=Object.create(Q.prototype),K.prototype.constructor=K,K.prototype.isShaderMaterial=!0,K.prototype.copy=function(e){return Q.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Gs.clone(e.uniforms),this.defines=e.defines,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=e.extensions,this},K.prototype.toJSON=function(e){var t=Q.prototype.toJSON.call(this,e);return t.uniforms=this.uniforms,t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t},$.prototype=Object.create(Q.prototype),$.prototype.constructor=$,$.prototype.isMeshDepthMaterial=!0,$.prototype.copy=function(e){return Q.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},ee.prototype=Object.create(Q.prototype),ee.prototype.constructor=ee,ee.prototype.isMeshDistanceMaterial=!0,ee.prototype.copy=function(e){return Q.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this},babelHelpers.extends(te.prototype,{isBox3:!0,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=+(1/0),i=+(1/0),r=+(1/0),n=-(1/0),a=-(1/0),o=-(1/0),s=0,c=e.length;s<c;s+=3){var l=e[s],h=e[s+1],u=e[s+2];l<t&&(t=l),h<i&&(i=h),u<r&&(r=u),l>n&&(n=l),h>a&&(a=h),u>o&&(o=u)}return this.min.set(t,i,r),this.max.set(n,a,o),this},setFromBufferAttribute:function(e){for(var t=+(1/0),i=+(1/0),r=+(1/0),n=-(1/0),a=-(1/0),o=-(1/0),s=0,c=e.count;s<c;s++){var l=e.getX(s),h=e.getY(s),u=e.getZ(s);l<t&&(t=l),h<i&&(i=h),u<r&&(r=u),l>n&&(n=l),h>a&&(a=h),u>o&&(o=u)}return this.min.set(t,i,r),this.max.set(n,a,o),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new c;return function(t,i){var r=e.copy(i).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}}(),setFromObject:function(e){return this.makeEmpty(),this.expandByObject(e)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.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(e){var t=e||new c;return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){var t=e||new c;return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},expandByObject:function(){var e=new c;return function(t){var i=this;return t.updateMatrixWorld(!0),t.traverse(function(t){var r,n,a=t.geometry;if(void 0!==a)if(a.isGeometry){var o=a.vertices;for(r=0,n=o.length;r<n;r++)e.copy(o[r]),e.applyMatrix4(t.matrixWorld),i.expandByPoint(e)}else if(a.isBufferGeometry){var s=a.attributes.position;if(void 0!==s)for(r=0,n=s.count;r<n;r++)e.fromBufferAttribute(s,r).applyMatrix4(t.matrixWorld),i.expandByPoint(e)}}),this}}(),containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},getParameter:function(e,t){var i=t||new c;return i.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)},intersectsSphere:function(){var e=new c;return function(t){return this.clampPoint(t.center,e),e.distanceToSquared(t.center)<=t.radius*t.radius}}(),intersectsPlane:function(e){var t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=e.constant&&i>=e.constant},clampPoint:function(e,t){var i=t||new c;return i.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new c;return function(t){var i=e.copy(t).clamp(this.min,this.max);return i.sub(t).length()}}(),getBoundingSphere:function(){var e=new c;return function(t){var i=t||new ie;return this.getCenter(i.center),i.radius=.5*this.getSize(e).length(),i}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:function(){var e=[new c,new c,new c,new c,new c,new c,new c,new c];return function(t){return this.isEmpty()?this:(e[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),e[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),e[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),e[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),e[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),e[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),e[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),e[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(e),this)}}(),translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}),babelHelpers.extends(ie.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(){var e=new te;return function(t,i){var r=this.center;void 0!==i?r.copy(i):e.setFromPoints(t).getCenter(r);for(var n=0,a=0,o=t.length;a<o;a++)n=Math.max(n,r.distanceToSquared(t[a]));return this.radius=Math.sqrt(n),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},empty:function(){return this.radius<=0},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius},clampPoint:function(e,t){var i=this.center.distanceToSquared(e),r=t||new c;return r.copy(e),i>this.radius*this.radius&&(r.sub(this.center).normalize(),r.multiplyScalar(this.radius).add(this.center)),r},getBoundingBox:function(e){var t=e||new te;return t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}}),babelHelpers.extends(re.prototype,{isMatrix3:!0,set:function(e,t,i,r,n,a,o,s,c){var l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=n,l[5]=s,l[6]=i,l[7]=a,l[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(e){var t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this},setFromMatrix4:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},applyToBufferAttribute:function(){var e=new c;return function(t){for(var i=0,r=t.count;i<r;i++)e.x=t.getX(i),e.y=t.getY(i),e.z=t.getZ(i),e.applyMatrix3(this),t.setXYZ(i,e.x,e.y,e.z);return t}}(),multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var i=e.elements,r=t.elements,n=this.elements,a=i[0],o=i[3],s=i[6],c=i[1],l=i[4],h=i[7],u=i[2],p=i[5],d=i[8],f=r[0],m=r[3],v=r[6],g=r[1],y=r[4],x=r[7],b=r[2],_=r[5],w=r[8];return n[0]=a*f+o*g+s*b,n[3]=a*m+o*y+s*_,n[6]=a*v+o*x+s*w,n[1]=c*f+l*g+h*b,n[4]=c*m+l*y+h*_,n[7]=c*v+l*x+h*w,n[2]=u*f+p*g+d*b,n[5]=u*m+p*y+d*_,n[8]=u*v+p*x+d*w,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},determinant:function(){var e=this.elements,t=e[0],i=e[1],r=e[2],n=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-i*n*l+i*o*s+r*n*c-r*a*s},getInverse:function(e,t){e&&e.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var i=e.elements,r=this.elements,n=i[0],a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],h=i[6],u=i[7],p=i[8],d=p*c-l*u,f=l*h-p*s,m=u*s-c*h,v=n*d+a*f+o*m;if(0===v){var g="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(t===!0)throw new Error(g);return console.warn(g),this.identity()}var y=1/v;return r[0]=d*y,r[1]=(o*u-p*a)*y,r[2]=(l*a-o*c)*y,r[3]=f*y,r[4]=(p*n-o*h)*y,r[5]=(o*s-l*n)*y,r[6]=m*y,r[7]=(a*h-u*n)*y,r[8]=(c*n-a*s)*y,this},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},getNormalMatrix:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this},equals:function(e){for(var t=this.elements,i=e.elements,r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var i=0;i<9;i++)this.elements[i]=e[i+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}}),babelHelpers.extends(ne.prototype,{set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,i,r){return this.normal.set(e,t,i),this.constant=r,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(){var e=new c,t=new c;return function(i,r,n){var a=e.subVectors(n,r).cross(t.subVectors(i,r)).normalize();return this.setFromNormalAndCoplanarPoint(a,i),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){var i=t||new c;return i.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(){var e=new c;return function(t,i){var r=i||new c,n=t.delta(e),a=this.normal.dot(n);if(0!==a){var o=-(t.start.dot(this.normal)+this.constant)/a;if(!(o<0||o>1))return r.copy(n).multiplyScalar(o).add(t.start)}else if(0===this.distanceToPoint(t.start))return r.copy(t.start)}}(),intersectsLine:function(e){var t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){var t=e||new c;return t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var e=new c,t=new re;return function(i,r){var n=r||t.getNormalMatrix(i),a=this.coplanarPoint(e).applyMatrix4(i),o=this.normal.applyMatrix3(n).normalize();return this.constant=-a.dot(o),this}}(),translate:function(e){return this.constant-=e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}}),babelHelpers.extends(ae.prototype,{set:function(e,t,i,r,n,a){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(i),o[3].copy(r),o[4].copy(n),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){for(var t=this.planes,i=0;i<6;i++)t[i].copy(e.planes[i]);return this},setFromMatrix:function(e){var t=this.planes,i=e.elements,r=i[0],n=i[1],a=i[2],o=i[3],s=i[4],c=i[5],l=i[6],h=i[7],u=i[8],p=i[9],d=i[10],f=i[11],m=i[12],v=i[13],g=i[14],y=i[15];return t[0].setComponents(o-r,h-s,f-u,y-m).normalize(),t[1].setComponents(o+r,h+s,f+u,y+m).normalize(),t[2].setComponents(o+n,h+c,f+p,y+v).normalize(),t[3].setComponents(o-n,h-c,f-p,y-v).normalize(),t[4].setComponents(o-a,h-l,f-d,y-g).normalize(),t[5].setComponents(o+a,h+l,f+d,y+g).normalize(),this},intersectsObject:function(){var e=new ie;return function(t){var i=t.geometry;return null===i.boundingSphere&&i.computeBoundingSphere(),e.copy(i.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(e)}}(),intersectsSprite:function(){var e=new ie;return function(t){return e.center.set(0,0,0),e.radius=.7071067811865476,e.applyMatrix4(t.matrixWorld),this.intersectsSphere(e)}}(),intersectsSphere:function(e){for(var t=this.planes,i=e.center,r=-e.radius,n=0;n<6;n++){var a=t[n].distanceToPoint(i);if(a<r)return!1}return!0},intersectsBox:function(){var e=new c,t=new c;return function(i){for(var r=this.planes,n=0;n<6;n++){var a=r[n];e.x=a.normal.x>0?i.min.x:i.max.x,t.x=a.normal.x>0?i.max.x:i.min.x,e.y=a.normal.y>0?i.min.y:i.max.y,t.y=a.normal.y>0?i.max.y:i.min.y,e.z=a.normal.z>0?i.min.z:i.max.z,t.z=a.normal.z>0?i.max.z:i.min.z;var o=a.distanceToPoint(e),s=a.distanceToPoint(t);if(o<0&&s<0)return!1}return!0}}(),containsPoint:function(e){for(var t=this.planes,i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}}),ce.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],ce.DefaultOrder="XYZ",Object.defineProperties(ce.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this.onChangeCallback()}},order:{get:function(){return this._order},set:function(e){this._order=e,this.onChangeCallback()}}}),babelHelpers.extends(ce.prototype,{isEuler:!0,set:function(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._order=r||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this.onChangeCallback(),this},setFromRotationMatrix:function(e,t,i){var r=Ps.clamp,n=e.elements,a=n[0],o=n[4],s=n[8],c=n[1],l=n[5],h=n[9],u=n[2],p=n[6],d=n[10];return t=t||this._order,"XYZ"===t?(this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-h,d),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(p,l),this._z=0)):"YXZ"===t?(this._x=Math.asin(-r(h,-1,1)),Math.abs(h)<.99999?(this._y=Math.atan2(s,d),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-u,a),this._z=0)):"ZXY"===t?(this._x=Math.asin(r(p,-1,1)),Math.abs(p)<.99999?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(c,a))):"ZYX"===t?(this._y=Math.asin(-r(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,l))):"YZX"===t?(this._z=Math.asin(r(c,-1,1)),Math.abs(c)<.99999?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-u,a)):(this._x=0,this._y=Math.atan2(s,d))):"XZY"===t?(this._z=Math.asin(-r(o,-1,1)),Math.abs(o)<.99999?(this._x=Math.atan2(p,l),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-h,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,i!==!1&&this.onChangeCallback(),this},setFromQuaternion:function(){var e=new l;return function(t,i,r){return e.makeRotationFromQuaternion(t),this.setFromRotationMatrix(e,i,r)}}(),setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(){var e=new s;return function(t){return e.setFromEuler(this),this.setFromQuaternion(e,t)}}(),equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new c(this._x,this._y,this._z)},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}}),babelHelpers.extends(le.prototype,{set:function(e){this.mask=1<<e|0},enable:function(e){this.mask|=1<<e|0},toggle:function(e){this.mask^=1<<e|0},disable:function(e){this.mask&=~(1<<e|0)},test:function(e){return 0!==(this.mask&e.mask)}});var Xl=0;he.DefaultUp=new c(0,1,0),he.DefaultMatrixAutoUpdate=!0,babelHelpers.extends(he.prototype,t.prototype,{isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(e){this.matrix.multiplyMatrices(e,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(e){return this.quaternion.premultiply(e),this},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:function(){var e=new s;return function(t,i){return e.setFromAxisAngle(t,i),this.quaternion.multiply(e),this}}(),rotateX:function(){var e=new c(1,0,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateY:function(){var e=new c(0,1,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateZ:function(){var e=new c(0,0,1);return function(t){return this.rotateOnAxis(e,t)}}(),translateOnAxis:function(){var e=new c;return function(t,i){return e.copy(t).applyQuaternion(this.quaternion),this.position.add(e.multiplyScalar(i)),this}}(),translateX:function(){var e=new c(1,0,0);return function(t){return this.translateOnAxis(e,t)}}(),translateY:function(){var e=new c(0,1,0);return function(t){return this.translateOnAxis(e,t)}}(),translateZ:function(){var e=new c(0,0,1);return function(t){return this.translateOnAxis(e,t)}}(),localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var e=new l;return function(t){return t.applyMatrix4(e.getInverse(this.matrixWorld))}}(),lookAt:function(){var e=new l;return function(t){this.isCamera?e.lookAt(this.position,t,this.up):e.lookAt(t,this.position,this.up),this.quaternion.setFromRotationMatrix(e)}}(),add:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),
e.parent=this,e.dispatchEvent({type:"added"}),this.children.push(e)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)},remove:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}var i=this.children.indexOf(e);return i!==-1&&(e.parent=null,e.dispatchEvent({type:"removed"}),this.children.splice(i,1)),this},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var i=0,r=this.children.length;i<r;i++){var n=this.children[i],a=n.getObjectByProperty(e,t);if(void 0!==a)return a}},getWorldPosition:function(e){var t=e||new c;return this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var e=new c,t=new c;return function(i){var r=i||new s;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(e,r,t),r}}(),getWorldRotation:function(){var e=new s;return function(t){var i=t||new ce;return this.getWorldQuaternion(e),i.setFromQuaternion(e,this.rotation.order,!1)}}(),getWorldScale:function(){var e=new c,t=new s;return function(i){var r=i||new c;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(e,t,r),r}}(),getWorldDirection:function(){var e=new s;return function(t){var i=t||new c;return this.getWorldQuaternion(e),i.set(0,0,1).applyQuaternion(e)}}(),raycast:function(){},traverse:function(e){e(this);for(var t=this.children,i=0,r=t.length;i<r;i++)t[i].traverse(e)},traverseVisible:function(e){if(this.visible!==!1){e(this);for(var t=this.children,i=0,r=t.length;i<r;i++)t[i].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=this.children,i=0,r=t.length;i<r;i++)t[i].updateMatrixWorld(e)},toJSON:function(e){function t(t,i){return void 0===t[i.uuid]&&(t[i.uuid]=i.toJSON(e)),i.uuid}function i(e){var t=[];for(var i in e){var r=e[i];delete r.metadata,t.push(r)}return t}var r=void 0===e||""===e,n={};r&&(e={geometries:{},materials:{},textures:{},images:{}},n.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=t(e.geometries,this.geometry)),void 0!==this.material)if(Array.isArray(this.material)){for(var o=[],s=0,c=this.material.length;s<c;s++)o.push(t(e.materials,this.material[s]));a.material=o}else a.material=t(e.materials,this.material);if(this.children.length>0){a.children=[];for(var s=0;s<this.children.length;s++)a.children.push(this.children[s].toJSON(e).object)}if(r){var l=i(e.geometries),h=i(e.materials),u=i(e.textures),p=i(e.images);l.length>0&&(n.geometries=l),h.length>0&&(n.materials=h),u.length>0&&(n.textures=u),p.length>0&&(n.images=p)}return n.object=a,n},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(var i=0;i<e.children.length;i++){var r=e.children[i];this.add(r.clone())}return this}}),ue.prototype=babelHelpers.extends(Object.create(he.prototype),{constructor:ue,isCamera:!0,copy:function(e,t){return he.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this},getWorldDirection:function(){var e=new s;return function(t){var i=t||new c;return this.getWorldQuaternion(e),i.set(0,0,-1).applyQuaternion(e)}}(),updateMatrixWorld:function(e){he.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),pe.prototype=babelHelpers.extends(Object.create(ue.prototype),{constructor:pe,isOrthographicCamera:!0,copy:function(e,t){return ue.prototype.copy.call(this,e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:babelHelpers.extends({},e.view),this},setViewOffset:function(e,t,i,r,n,a){this.view={fullWidth:e,fullHeight:t,offsetX:i,offsetY:r,width:n,height:a},this.updateProjectionMatrix()},clearViewOffset:function(){this.view=null,this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2,n=i-e,a=i+e,o=r+t,s=r-t;if(null!==this.view){var c=this.zoom/(this.view.width/this.view.fullWidth),l=this.zoom/(this.view.height/this.view.fullHeight),h=(this.right-this.left)/this.view.width,u=(this.top-this.bottom)/this.view.height;n+=h*(this.view.offsetX/c),a=n+h*(this.view.width/c),o-=u*(this.view.offsetY/l),s=o-u*(this.view.height/l)}this.projectionMatrix.makeOrthographic(n,a,o,s,this.near,this.far)},toJSON:function(e){var t=he.prototype.toJSON.call(this,e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=babelHelpers.extends({},this.view)),t}}),de.prototype=babelHelpers.extends(Object.create(ue.prototype),{constructor:de,isPerspectiveCamera:!0,copy:function(e,t){return ue.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:babelHelpers.extends({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*Ps.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*Ps.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*Ps.RAD2DEG*Math.atan(Math.tan(.5*Ps.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(e,t,i,r,n,a){this.aspect=e/t,this.view={fullWidth:e,fullHeight:t,offsetX:i,offsetY:r,width:n,height:a},this.updateProjectionMatrix()},clearViewOffset:function(){this.view=null,this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*Ps.DEG2RAD*this.fov)/this.zoom,i=2*t,r=this.aspect*i,n=-.5*r,a=this.view;if(null!==a){var o=a.fullWidth,s=a.fullHeight;n+=a.offsetX*r/o,t-=a.offsetY*i/s,r*=a.width/o,i*=a.height/s}var c=this.filmOffset;0!==c&&(n+=e*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(n,n+r,t,t-i,e,this.far)},toJSON:function(e){var t=he.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=babelHelpers.extends({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}),babelHelpers.extends(fe.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var t=0,i=e.vertexNormals.length;t<i;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(var t=0,i=e.vertexColors.length;t<i;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}});var ql=0;babelHelpers.extends(ve.prototype,t.prototype,{isGeometry:!0,applyMatrix:function(e){for(var t=(new re).getNormalMatrix(e),i=0,r=this.vertices.length;i<r;i++){var n=this.vertices[i];n.applyMatrix4(e)}for(var i=0,r=this.faces.length;i<r;i++){var a=this.faces[i];a.normal.applyMatrix3(t).normalize();for(var o=0,s=a.vertexNormals.length;o<s;o++)a.vertexNormals[o].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(){var e=new l;return function(t){return e.makeRotationX(t),this.applyMatrix(e),this}}(),rotateY:function(){var e=new l;return function(t){return e.makeRotationY(t),this.applyMatrix(e),this}}(),rotateZ:function(){var e=new l;return function(t){return e.makeRotationZ(t),this.applyMatrix(e),this}}(),translate:function(){var e=new l;return function(t,i,r){return e.makeTranslation(t,i,r),this.applyMatrix(e),this}}(),scale:function(){var e=new l;return function(t,i,r){return e.makeScale(t,i,r),this.applyMatrix(e),this}}(),lookAt:function(){var e=new he;return function(t){e.lookAt(t),e.updateMatrix(),this.applyMatrix(e.matrix)}}(),fromBufferGeometry:function(e){function t(e,t,i,n){var a=void 0!==s?[p[e].clone(),p[t].clone(),p[i].clone()]:[],o=void 0!==l?[r.colors[e].clone(),r.colors[t].clone(),r.colors[i].clone()]:[],c=new fe(e,t,i,a,o,n);r.faces.push(c),void 0!==h&&r.faceVertexUvs[0].push([d[e].clone(),d[t].clone(),d[i].clone()]),void 0!==u&&r.faceVertexUvs[1].push([f[e].clone(),f[t].clone(),f[i].clone()])}var r=this,n=null!==e.index?e.index.array:void 0,a=e.attributes,o=a.position.array,s=void 0!==a.normal?a.normal.array:void 0,l=void 0!==a.color?a.color.array:void 0,h=void 0!==a.uv?a.uv.array:void 0,u=void 0!==a.uv2?a.uv2.array:void 0;void 0!==u&&(this.faceVertexUvs[1]=[]);for(var p=[],d=[],f=[],m=0,v=0;m<o.length;m+=3,v+=2)r.vertices.push(new c(o[m],o[m+1],o[m+2])),void 0!==s&&p.push(new c(s[m],s[m+1],s[m+2])),void 0!==l&&r.colors.push(new X(l[m],l[m+1],l[m+2])),void 0!==h&&d.push(new i(h[v],h[v+1])),void 0!==u&&f.push(new i(u[v],u[v+1]));var g=e.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!==n?t(n[v],n[v+1],n[v+2],y.materialIndex):t(v,v+1,v+2,y.materialIndex);else if(void 0!==n)for(var m=0;m<n.length;m+=3)t(n[m],n[m+1],n[m+2]);else for(var m=0;m<o.length/3;m+=3)t(m,m+1,m+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){this.computeBoundingBox();var e=this.boundingBox.getCenter().negate();return this.translate(e.x,e.y,e.z),e},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,i=0===t?1:1/t,r=new l;return r.set(i,0,0,-i*e.x,0,i,0,-i*e.y,0,0,i,-i*e.z,0,0,0,1),this.applyMatrix(r),this},computeFaceNormals:function(){for(var e=new c,t=new c,i=0,r=this.faces.length;i<r;i++){var n=this.faces[i],a=this.vertices[n.a],o=this.vertices[n.b],s=this.vertices[n.c];e.subVectors(s,o),t.subVectors(a,o),e.cross(t),e.normalize(),n.normal.copy(e)}},computeVertexNormals:function(e){void 0===e&&(e=!0);var t,i,r,n,a,o;for(o=new Array(this.vertices.length),t=0,i=this.vertices.length;t<i;t++)o[t]=new c;if(e){var s,l,h,u=new c,p=new c;for(r=0,n=this.faces.length;r<n;r++)a=this.faces[r],s=this.vertices[a.a],l=this.vertices[a.b],h=this.vertices[a.c],u.subVectors(h,l),p.subVectors(s,l),u.cross(p),o[a.a].add(u),o[a.b].add(u),o[a.c].add(u)}else for(this.computeFaceNormals(),r=0,n=this.faces.length;r<n;r++)a=this.faces[r],o[a.a].add(a.normal),o[a.b].add(a.normal),o[a.c].add(a.normal);for(t=0,i=this.vertices.length;t<i;t++)o[t].normalize();for(r=0,n=this.faces.length;r<n;r++){a=this.faces[r];var d=a.vertexNormals;3===d.length?(d[0].copy(o[a.a]),d[1].copy(o[a.b]),d[2].copy(o[a.c])):(d[0]=o[a.a].clone(),d[1]=o[a.b].clone(),d[2]=o[a.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var e,t,i;for(this.computeFaceNormals(),e=0,t=this.faces.length;e<t;e++){i=this.faces[e];var r=i.vertexNormals;3===r.length?(r[0].copy(i.normal),r[1].copy(i.normal),r[2].copy(i.normal)):(r[0]=i.normal.clone(),r[1]=i.normal.clone(),r[2]=i.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,t,i,r,n;for(i=0,r=this.faces.length;i<r;i++)for(n=this.faces[i],n.__originalFaceNormal?n.__originalFaceNormal.copy(n.normal):n.__originalFaceNormal=n.normal.clone(),n.__originalVertexNormals||(n.__originalVertexNormals=[]),e=0,t=n.vertexNormals.length;e<t;e++)n.__originalVertexNormals[e]?n.__originalVertexNormals[e].copy(n.vertexNormals[e]):n.__originalVertexNormals[e]=n.vertexNormals[e].clone();var a=new ve;for(a.faces=this.faces,e=0,t=this.morphTargets.length;e<t;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];var o,s,l=this.morphNormals[e].faceNormals,h=this.morphNormals[e].vertexNormals;for(i=0,r=this.faces.length;i<r;i++)o=new c,s={a:new c,b:new c,c:new c},l.push(o),h.push(s)}var u=this.morphNormals[e];a.vertices=this.morphTargets[e].vertices,a.computeFaceNormals(),a.computeVertexNormals();var o,s;for(i=0,r=this.faces.length;i<r;i++)n=this.faces[i],o=u.faceNormals[i],s=u.vertexNormals[i],o.copy(n.normal),s.a.copy(n.vertexNormals[0]),s.b.copy(n.vertexNormals[1]),s.c.copy(n.vertexNormals[2])}for(i=0,r=this.faces.length;i<r;i++)n=this.faces[i],n.normal=n.__originalFaceNormal,n.vertexNormals=n.__originalVertexNormals},computeLineDistances:function(){for(var e=0,t=this.vertices,i=0,r=t.length;i<r;i++)i>0&&(e+=t[i].distanceTo(t[i-1])),this.lineDistances[i]=e},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new te),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new ie),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,i){if(!e||!e.isGeometry)return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e);var r,n=this.vertices.length,a=this.vertices,o=e.vertices,s=this.faces,c=e.faces,l=this.faceVertexUvs[0],h=e.faceVertexUvs[0],u=this.colors,p=e.colors;void 0===i&&(i=0),void 0!==t&&(r=(new re).getNormalMatrix(t));for(var d=0,f=o.length;d<f;d++){var m=o[d],v=m.clone();void 0!==t&&v.applyMatrix4(t),a.push(v)}for(var d=0,f=p.length;d<f;d++)u.push(p[d].clone());for(d=0,f=c.length;d<f;d++){var g,y,x,b=c[d],_=b.vertexNormals,w=b.vertexColors;g=new fe(b.a+n,b.b+n,b.c+n),g.normal.copy(b.normal),void 0!==r&&g.normal.applyMatrix3(r).normalize();for(var M=0,E=_.length;M<E;M++)y=_[M].clone(),void 0!==r&&y.applyMatrix3(r).normalize(),g.vertexNormals.push(y);g.color.copy(b.color);for(var M=0,E=w.length;M<E;M++)x=w[M],g.vertexColors.push(x.clone());g.materialIndex=b.materialIndex+i,s.push(g)}for(d=0,f=h.length;d<f;d++){var T=h[d],S=[];if(void 0!==T){for(var M=0,E=T.length;M<E;M++)S.push(T[M].clone());l.push(S)}}},mergeMesh:function(e){return e&&e.isMesh?(e.matrixAutoUpdate&&e.updateMatrix(),void this.merge(e.geometry,e.matrix)):void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e)},mergeVertices:function(){var e,t,i,r,n,a,o,s,c={},l=[],h=[],u=4,p=Math.pow(10,u);for(i=0,r=this.vertices.length;i<r;i++)e=this.vertices[i],t=Math.round(e.x*p)+"_"+Math.round(e.y*p)+"_"+Math.round(e.z*p),void 0===c[t]?(c[t]=i,l.push(this.vertices[i]),h[i]=l.length-1):h[i]=h[c[t]];var d=[];for(i=0,r=this.faces.length;i<r;i++){n=this.faces[i],n.a=h[n.a],n.b=h[n.b],n.c=h[n.c],a=[n.a,n.b,n.c];for(var f=0;f<3;f++)if(a[f]===a[(f+1)%3]){d.push(i);break}}for(i=d.length-1;i>=0;i--){var m=d[i];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-l.length;return this.vertices=l,v},sortFacesByMaterialIndex:function(){function e(e,t){return e.materialIndex-t.materialIndex}for(var t=this.faces,i=t.length,r=0;r<i;r++)t[r]._id=r;t.sort(e);var n,a,o=this.faceVertexUvs[0],s=this.faceVertexUvs[1];o&&o.length===i&&(n=[]),s&&s.length===i&&(a=[]);for(var r=0;r<i;r++){var c=t[r]._id;n&&n.push(o[c]),a&&a.push(s[c])}n&&(this.faceVertexUvs[0]=n),a&&(this.faceVertexUvs[1]=a)},toJSON:function(){function e(e,t,i){return i?e|1<<t:e&~(1<<t)}function t(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==p[t]?p[t]:(p[t]=u.length/3,u.push(e.x,e.y,e.z),p[t])}function i(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==f[t]?f[t]:(f[t]=d.length,d.push(e.getHex()),f[t])}function r(e){var t=e.x.toString()+e.y.toString();return void 0!==v[t]?v[t]:(v[t]=m.length/2,m.push(e.x,e.y),v[t])}var n={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),void 0!==this.parameters){var a=this.parameters;for(var o in a)void 0!==a[o]&&(n[o]=a[o]);return n}for(var s=[],c=0;c<this.vertices.length;c++){var l=this.vertices[c];s.push(l.x,l.y,l.z)}for(var h=[],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=e(T,0,0),T=e(T,1,y),T=e(T,2,x),T=e(T,3,b),T=e(T,4,_),T=e(T,5,w),T=e(T,6,M),T=e(T,7,E),h.push(T),h.push(g.a,g.b,g.c),h.push(g.materialIndex),b){var S=this.faceVertexUvs[0][c];h.push(r(S[0]),r(S[1]),r(S[2]))}if(_&&h.push(t(g.normal)),w){var A=g.vertexNormals;h.push(t(A[0]),t(A[1]),t(A[2]))}if(M&&h.push(i(g.color)),E){var R=g.vertexColors;h.push(i(R[0]),i(R[1]),i(R[2]))}}return n.data={},n.data.vertices=s,n.data.normals=u,d.length>0&&(n.data.colors=d),m.length>0&&(n.data.uvs=[m]),n.data.faces=h,n},clone:function(){return(new ve).copy(this)},copy:function(e){var t,i,r,n,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=e.name;var s=e.vertices;for(t=0,i=s.length;t<i;t++)this.vertices.push(s[t].clone());var c=e.colors;for(t=0,i=c.length;t<i;t++)this.colors.push(c[t].clone());var l=e.faces;for(t=0,i=l.length;t<i;t++)this.faces.push(l[t].clone());for(t=0,i=e.faceVertexUvs.length;t<i;t++){var h=e.faceVertexUvs[t];for(void 0===this.faceVertexUvs[t]&&(this.faceVertexUvs[t]=[]),r=0,n=h.length;r<n;r++){var u=h[r],p=[];for(a=0,o=u.length;a<o;a++){var d=u[a];p.push(d.clone())}this.faceVertexUvs[t].push(p)}}var f=e.morphTargets;for(t=0,i=f.length;t<i;t++){var m={};if(m.name=f[t].name,void 0!==f[t].vertices)for(m.vertices=[],r=0,n=f[t].vertices.length;r<n;r++)m.vertices.push(f[t].vertices[r].clone());if(void 0!==f[t].normals)for(m.normals=[],r=0,n=f[t].normals.length;r<n;r++)m.normals.push(f[t].normals[r].clone());this.morphTargets.push(m)}var v=e.morphNormals;for(t=0,i=v.length;t<i;t++){var g={};if(void 0!==v[t].vertexNormals)for(g.vertexNormals=[],r=0,n=v[t].vertexNormals.length;r<n;r++){var y=v[t].vertexNormals[r],x={};x.a=y.a.clone(),x.b=y.b.clone(),x.c=y.c.clone(),g.vertexNormals.push(x)}if(void 0!==v[t].faceNormals)for(g.faceNormals=[],r=0,n=v[t].faceNormals.length;r<n;r++)g.faceNormals.push(v[t].faceNormals[r].clone());this.morphNormals.push(g)}var b=e.skinWeights;for(t=0,i=b.length;t<i;t++)this.skinWeights.push(b[t].clone());var _=e.skinIndices;for(t=0,i=_.length;t<i;t++)this.skinIndices.push(_[t].clone());var w=e.lineDistances;for(t=0,i=w.length;t<i;t++)this.lineDistances.push(w[t]);var M=e.boundingBox;null!==M&&(this.boundingBox=M.clone());var E=e.boundingSphere;return null!==E&&(this.boundingSphere=E.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(ge.prototype,"needsUpdate",{set:function(e){e===!0&&this.version++}}),babelHelpers.extends(ge.prototype,{isBufferAttribute:!0,setArray:function(e){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==e?e.length/this.itemSize:0,this.array=e},setDynamic:function(e){return this.dynamic=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.dynamic=e.dynamic,this},copyAt:function(e,t,i){e*=this.itemSize,i*=t.itemSize;for(var r=0,n=this.itemSize;r<n;r++)this.array[e+r]=t.array[i+r];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,i=0,r=0,n=e.length;r<n;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),a=new X),t[i++]=a.r,t[i++]=a.g,t[i++]=a.b}return this},copyIndicesArray:function(e){for(var t=this.array,i=0,r=0,n=e.length;r<n;r++){var a=e[r];t[i++]=a.a,t[i++]=a.b,t[i++]=a.c}return this},copyVector2sArray:function(e){for(var t=this.array,r=0,n=0,a=e.length;n<a;n++){var o=e[n];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",n),o=new i),t[r++]=o.x,t[r++]=o.y}return this},copyVector3sArray:function(e){for(var t=this.array,i=0,r=0,n=e.length;r<n;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),a=new c),t[i++]=a.x,t[i++]=a.y,t[i++]=a.z}return this},copyVector4sArray:function(e){for(var t=this.array,i=0,r=0,a=e.length;r<a;r++){var o=e[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),o=new n),t[i++]=o.x,t[i++]=o.y,t[i++]=o.z,t[i++]=o.w}return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this},setXYZ:function(e,t,i,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this},setXYZW:function(e,t,i,r,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=n,this},onUpload:function(e){return this.onUploadCallback=e,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)}}),ye.prototype=Object.create(ge.prototype),ye.prototype.constructor=ye,xe.prototype=Object.create(ge.prototype),xe.prototype.constructor=xe,be.prototype=Object.create(ge.prototype),be.prototype.constructor=be,_e.prototype=Object.create(ge.prototype),_e.prototype.constructor=_e,we.prototype=Object.create(ge.prototype),we.prototype.constructor=we,Me.prototype=Object.create(ge.prototype),Me.prototype.constructor=Me,Ee.prototype=Object.create(ge.prototype),Ee.prototype.constructor=Ee,Te.prototype=Object.create(ge.prototype),Te.prototype.constructor=Te,Se.prototype=Object.create(ge.prototype),Se.prototype.constructor=Se,babelHelpers.extends(Ae.prototype,{computeGroups:function(e){for(var t,i=[],r=void 0,n=e.faces,a=0;a<n.length;a++){var o=n[a];o.materialIndex!==r&&(r=o.materialIndex,void 0!==t&&(t.count=3*a-t.start,i.push(t)),t={start:3*a,materialIndex:r})}void 0!==t&&(t.count=3*a-t.start,i.push(t)),this.groups=i},fromGeometry:function(e){var t,r=e.faces,n=e.vertices,a=e.faceVertexUvs,o=a[0]&&a[0].length>0,s=a[1]&&a[1].length>0,c=e.morphTargets,l=c.length;if(l>0){t=[];for(var h=0;h<l;h++)t[h]=[];this.morphTargets.position=t}var u,p=e.morphNormals,d=p.length;if(d>0){u=[];for(var h=0;h<d;h++)u[h]=[];this.morphTargets.normal=u}for(var f=e.skinIndices,m=e.skinWeights,v=f.length===n.length,g=m.length===n.length,h=0;h<r.length;h++){var y=r[h];this.vertices.push(n[y.a],n[y.b],n[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][h];void 0!==M?this.uvs.push(M[0],M[1],M[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",h),this.uvs.push(new i,new i,new i))}if(s===!0){var M=a[1][h];void 0!==M?this.uvs2.push(M[0],M[1],M[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",h),this.uvs2.push(new i,new i,new i))}for(var E=0;E<l;E++){var T=c[E].vertices;t[E].push(T[y.a],T[y.b],T[y.c])}for(var E=0;E<d;E++){var S=p[E].vertexNormals[h];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(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this}}),Le.MaxIndex=65535,babelHelpers.extends(Le.prototype,t.prototype,{isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){Array.isArray(e)?this.index=new(Re(e)>65535?Ee:we)(e,1):this.index=e},addAttribute:function(e,t){return t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),void this.setIndex(t)):(this.attributes[e]=t,this):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),void this.addAttribute(e,new ge(arguments[1],arguments[2])))},getAttribute:function(e){return this.attributes[e]},removeAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,i){this.groups.push({start:e,count:t,materialIndex:void 0!==i?i:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix:function(e){var t=this.attributes.position;void 0!==t&&(e.applyToBufferAttribute(t),t.needsUpdate=!0);var i=this.attributes.normal;if(void 0!==i){var r=(new re).getNormalMatrix(e);r.applyToBufferAttribute(i),i.needsUpdate=!0}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(){var e=new l;return function(t){return e.makeRotationX(t),this.applyMatrix(e),this}}(),rotateY:function(){var e=new l;return function(t){return e.makeRotationY(t),this.applyMatrix(e),this}}(),rotateZ:function(){var e=new l;return function(t){return e.makeRotationZ(t),this.applyMatrix(e),this}}(),translate:function(){var e=new l;return function(t,i,r){return e.makeTranslation(t,i,r),this.applyMatrix(e),this}}(),scale:function(){var e=new l;return function(t,i,r){return e.makeScale(t,i,r),this.applyMatrix(e),this}}(),lookAt:function(){var e=new he;return function(t){e.lookAt(t),e.updateMatrix(),this.applyMatrix(e.matrix)}}(),center:function(){this.computeBoundingBox();var e=this.boundingBox.getCenter().negate();return this.translate(e.x,e.y,e.z),e},setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var i=new Te(3*t.vertices.length,3),r=new Te(3*t.colors.length,3);if(this.addAttribute("position",i.copyVector3sArray(t.vertices)),this.addAttribute("color",r.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var n=new Te(t.lineDistances.length,1);this.addAttribute("lineDistance",n.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},updateFromObject:function(e){var t=e.geometry;if(e.isMesh){var i=t.__directGeometry;if(t.elementsNeedUpdate===!0&&(i=void 0,t.elementsNeedUpdate=!1),void 0===i)return this.fromGeometry(t);i.verticesNeedUpdate=t.verticesNeedUpdate,i.normalsNeedUpdate=t.normalsNeedUpdate,i.colorsNeedUpdate=t.colorsNeedUpdate,i.uvsNeedUpdate=t.uvsNeedUpdate,i.groupsNeedUpdate=t.groupsNeedUpdate,t.verticesNeedUpdate=!1,t.normalsNeedUpdate=!1,t.colorsNeedUpdate=!1,t.uvsNeedUpdate=!1,t.groupsNeedUpdate=!1,t=i}var r;return t.verticesNeedUpdate===!0&&(r=this.attributes.position,void 0!==r&&(r.copyVector3sArray(t.vertices),r.needsUpdate=!0),t.verticesNeedUpdate=!1),t.normalsNeedUpdate===!0&&(r=this.attributes.normal,void 0!==r&&(r.copyVector3sArray(t.normals),r.needsUpdate=!0),t.normalsNeedUpdate=!1),t.colorsNeedUpdate===!0&&(r=this.attributes.color,void 0!==r&&(r.copyColorsArray(t.colors),r.needsUpdate=!0),t.colorsNeedUpdate=!1),t.uvsNeedUpdate&&(r=this.attributes.uv,void 0!==r&&(r.copyVector2sArray(t.uvs),r.needsUpdate=!0),t.uvsNeedUpdate=!1),t.lineDistancesNeedUpdate&&(r=this.attributes.lineDistance,void 0!==r&&(r.copyArray(t.lineDistances),r.needsUpdate=!0),t.lineDistancesNeedUpdate=!1),t.groupsNeedUpdate&&(t.computeGroups(e.geometry),this.groups=t.groups,t.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=(new Ae).fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(3*e.vertices.length);if(this.addAttribute("position",new ge(t,3).copyVector3sArray(e.vertices)),e.normals.length>0){var i=new Float32Array(3*e.normals.length);this.addAttribute("normal",new ge(i,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var r=new Float32Array(3*e.colors.length);this.addAttribute("color",new ge(r,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var n=new Float32Array(2*e.uvs.length);this.addAttribute("uv",new ge(n,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var a=new Float32Array(2*e.uvs2.length);this.addAttribute("uv2",new ge(a,2).copyVector2sArray(e.uvs2))}if(e.indices.length>0){var o=Re(e.indices)>65535?Uint32Array:Uint16Array,s=new o(3*e.indices.length);this.setIndex(new ge(s,1).copyIndicesArray(e.indices))}this.groups=e.groups;for(var c in e.morphTargets){for(var l=[],h=e.morphTargets[c],u=0,p=h.length;u<p;u++){var d=h[u],f=new Te(3*d.length,3);l.push(f.copyVector3sArray(d))}this.morphAttributes[c]=l}if(e.skinIndices.length>0){var m=new Te(4*e.skinIndices.length,4);this.addAttribute("skinIndex",m.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var v=new Te(4*e.skinWeights.length,4);this.addAttribute("skinWeight",v.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new te);var e=this.attributes.position;void 0!==e?this.boundingBox.setFromBufferAttribute(e):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 e=new te,t=new c;return function(){
null===this.boundingSphere&&(this.boundingSphere=new ie);var i=this.attributes.position;if(i){var r=this.boundingSphere.center;e.setFromBufferAttribute(i),e.getCenter(r);for(var n=0,a=0,o=i.count;a<o;a++)t.x=i.getX(a),t.y=i.getY(a),t.z=i.getZ(a),n=Math.max(n,r.distanceToSquared(t));this.boundingSphere.radius=Math.sqrt(n),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 e=this.index,t=this.attributes,i=this.groups;if(t.position){var r=t.position.array;if(void 0===t.normal)this.addAttribute("normal",new ge(new Float32Array(r.length),3));else for(var n=t.normal.array,a=0,o=n.length;a<o;a++)n[a]=0;var s,l,h,u=t.normal.array,p=new c,d=new c,f=new c,m=new c,v=new c;if(e){var g=e.array;0===i.length&&this.addGroup(0,g.length);for(var y=0,x=i.length;y<x;++y)for(var b=i[y],_=b.start,w=b.count,a=_,o=_+w;a<o;a+=3)s=3*g[a+0],l=3*g[a+1],h=3*g[a+2],p.fromArray(r,s),d.fromArray(r,l),f.fromArray(r,h),m.subVectors(f,d),v.subVectors(p,d),m.cross(v),u[s]+=m.x,u[s+1]+=m.y,u[s+2]+=m.z,u[l]+=m.x,u[l+1]+=m.y,u[l+2]+=m.z,u[h]+=m.x,u[h+1]+=m.y,u[h+2]+=m.z}else for(var a=0,o=r.length;a<o;a+=9)p.fromArray(r,a),d.fromArray(r,a+3),f.fromArray(r,a+6),m.subVectors(f,d),v.subVectors(p,d),m.cross(v),u[a]=m.x,u[a+1]=m.y,u[a+2]=m.z,u[a+3]=m.x,u[a+4]=m.y,u[a+5]=m.z,u[a+6]=m.x,u[a+7]=m.y,u[a+8]=m.z;this.normalizeNormals(),t.normal.needsUpdate=!0}},merge:function(e,t){if(!e||!e.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e);void 0===t&&(t=0);var i=this.attributes;for(var r in i)if(void 0!==e.attributes[r])for(var n=i[r],a=n.array,o=e.attributes[r],s=o.array,c=o.itemSize,l=0,h=c*t;l<s.length;l++,h++)a[h]=s[l];return this},normalizeNormals:function(){var e=new c;return function(){for(var t=this.attributes.normal,i=0,r=t.count;i<r;i++)e.x=t.getX(i),e.y=t.getY(i),e.z=t.getZ(i),e.normalize(),t.setXYZ(i,e.x,e.y,e.z)}}(),toNonIndexed:function(){if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var e=new Le,t=this.index.array,i=this.attributes;for(var r in i){for(var n=i[r],a=n.array,o=n.itemSize,s=new a.constructor(t.length*o),c=0,l=0,h=0,u=t.length;h<u;h++){c=t[h]*o;for(var p=0;p<o;p++)s[l++]=a[c++]}e.addAttribute(r,new ge(s,o))}return e},toJSON:function(){var e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){var t=this.parameters;for(var i in t)void 0!==t[i]&&(e[i]=t[i]);return e}e.data={attributes:{}};var r=this.index;if(null!==r){var n=Array.prototype.slice.call(r.array);e.data.index={type:r.array.constructor.name,array:n}}var a=this.attributes;for(var i in a){var o=a[i],n=Array.prototype.slice.call(o.array);e.data.attributes[i]={itemSize:o.itemSize,type:o.array.constructor.name,array:n,normalized:o.normalized}}var s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));var c=this.boundingSphere;return null!==c&&(e.data.boundingSphere={center:c.center.toArray(),radius:c.radius}),e},clone:function(){return(new Le).copy(this)},copy:function(e){var t,i,r;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var n=e.index;null!==n&&this.setIndex(n.clone());var a=e.attributes;for(t in a){var o=a[t];this.addAttribute(t,o.clone())}var s=e.morphAttributes;for(t in s){var c=[],l=s[t];for(i=0,r=l.length;i<r;i++)c.push(l[i].clone());this.morphAttributes[t]=c}var h=e.groups;for(i=0,r=h.length;i<r;i++){var u=h[i];this.addGroup(u.start,u.count,u.materialIndex)}var p=e.boundingBox;null!==p&&(this.boundingBox=p.clone());var d=e.boundingSphere;return null!==d&&(this.boundingSphere=d.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Pe.prototype=Object.create(ve.prototype),Pe.prototype.constructor=Pe,Ce.prototype=Object.create(Le.prototype),Ce.prototype.constructor=Ce,Ie.prototype=Object.create(ve.prototype),Ie.prototype.constructor=Ie,Ue.prototype=Object.create(Le.prototype),Ue.prototype.constructor=Ue,Ne.prototype=Object.create(Q.prototype),Ne.prototype.constructor=Ne,Ne.prototype.isMeshBasicMaterial=!0,Ne.prototype.copy=function(e){return Q.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this},babelHelpers.extends(De.prototype,{set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){var i=t||new c;return i.copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:function(){var e=new c;return function(t){return this.origin.copy(this.at(t,e)),this}}(),closestPointToPoint:function(e,t){var i=t||new c;i.subVectors(e,this.origin);var r=i.dot(this.direction);return r<0?i.copy(this.origin):i.copy(this.direction).multiplyScalar(r).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(){var e=new c;return function(t){var i=e.subVectors(t,this.origin).dot(this.direction);return i<0?this.origin.distanceToSquared(t):(e.copy(this.direction).multiplyScalar(i).add(this.origin),e.distanceToSquared(t))}}(),distanceSqToSegment:function(){var e=new c,t=new c,i=new c;return function(r,n,a,o){e.copy(r).add(n).multiplyScalar(.5),t.copy(n).sub(r).normalize(),i.copy(this.origin).sub(e);var s,c,l,h,u=.5*r.distanceTo(n),p=-this.direction.dot(t),d=i.dot(this.direction),f=-i.dot(t),m=i.lengthSq(),v=Math.abs(1-p*p);if(v>0)if(s=p*f-d,c=p*d-f,h=u*v,s>=0)if(c>=-h)if(c<=h){var g=1/v;s*=g,c*=g,l=s*(s+p*c+2*d)+c*(p*s+c+2*f)+m}else c=u,s=Math.max(0,-(p*c+d)),l=-s*s+c*(c+2*f)+m;else c=-u,s=Math.max(0,-(p*c+d)),l=-s*s+c*(c+2*f)+m;else c<=-h?(s=Math.max(0,-(-p*u+d)),c=s>0?-u:Math.min(Math.max(-u,-f),u),l=-s*s+c*(c+2*f)+m):c<=h?(s=0,c=Math.min(Math.max(-u,-f),u),l=c*(c+2*f)+m):(s=Math.max(0,-(p*u+d)),c=s>0?u:Math.min(Math.max(-u,-f),u),l=-s*s+c*(c+2*f)+m);else c=p>0?-u:u,s=Math.max(0,-(p*c+d)),l=-s*s+c*(c+2*f)+m;return a&&a.copy(this.direction).multiplyScalar(s).add(this.origin),o&&o.copy(t).multiplyScalar(c).add(e),l}}(),intersectSphere:function(){var e=new c;return function(t,i){e.subVectors(t.center,this.origin);var r=e.dot(this.direction),n=e.dot(e)-r*r,a=t.radius*t.radius;if(n>a)return null;var o=Math.sqrt(a-n),s=r-o,c=r+o;return s<0&&c<0?null:s<0?this.at(c,i):this.at(s,i)}}(),intersectsSphere:function(e){return this.distanceToPoint(e.center)<=e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null},intersectPlane:function(e,t){var i=this.distanceToPlane(e);return null===i?null:this.at(i,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);if(0===t)return!0;var i=e.normal.dot(this.direction);return i*t<0},intersectBox:function(e,t){var i,r,n,a,o,s,c=1/this.direction.x,l=1/this.direction.y,h=1/this.direction.z,u=this.origin;return c>=0?(i=(e.min.x-u.x)*c,r=(e.max.x-u.x)*c):(i=(e.max.x-u.x)*c,r=(e.min.x-u.x)*c),l>=0?(n=(e.min.y-u.y)*l,a=(e.max.y-u.y)*l):(n=(e.max.y-u.y)*l,a=(e.min.y-u.y)*l),i>a||n>r?null:((n>i||i!==i)&&(i=n),(a<r||r!==r)&&(r=a),h>=0?(o=(e.min.z-u.z)*h,s=(e.max.z-u.z)*h):(o=(e.max.z-u.z)*h,s=(e.min.z-u.z)*h),i>s||o>r?null:((o>i||i!==i)&&(i=o),(s<r||r!==r)&&(r=s),r<0?null:this.at(i>=0?i:r,t)))},intersectsBox:function(){var e=new c;return function(t){return null!==this.intersectBox(t,e)}}(),intersectTriangle:function(){var e=new c,t=new c,i=new c,r=new c;return function(n,a,o,s,c){t.subVectors(a,n),i.subVectors(o,n),r.crossVectors(t,i);var l,h=this.direction.dot(r);if(h>0){if(s)return null;l=1}else{if(!(h<0))return null;l=-1,h=-h}e.subVectors(this.origin,n);var u=l*this.direction.dot(i.crossVectors(e,i));if(u<0)return null;var p=l*this.direction.dot(t.cross(e));if(p<0)return null;if(u+p>h)return null;var d=-l*e.dot(r);return d<0?null:this.at(d/h,c)}}(),applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}}),babelHelpers.extends(Fe.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){var t=e||new c;return t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){var t=e||new c;return t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){var i=t||new c;return this.delta(i).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(){var e=new c,t=new c;return function(i,r){e.subVectors(i,this.start),t.subVectors(this.end,this.start);var n=t.dot(t),a=t.dot(e),o=a/n;return r&&(o=Ps.clamp(o,0,1)),o}}(),closestPointToPoint:function(e,t,i){var r=this.closestPointToPointParameter(e,t),n=i||new c;return this.delta(n).multiplyScalar(r).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}),babelHelpers.extends(Be,{normal:function(){var e=new c;return function(t,i,r,n){var a=n||new c;a.subVectors(r,i),e.subVectors(t,i),a.cross(e);var o=a.lengthSq();return o>0?a.multiplyScalar(1/Math.sqrt(o)):a.set(0,0,0)}}(),barycoordFromPoint:function(){var e=new c,t=new c,i=new c;return function(r,n,a,o,s){e.subVectors(o,n),t.subVectors(a,n),i.subVectors(r,n);var l=e.dot(e),h=e.dot(t),u=e.dot(i),p=t.dot(t),d=t.dot(i),f=l*p-h*h,m=s||new c;if(0===f)return m.set(-2,-1,-1);var v=1/f,g=(p*u-h*d)*v,y=(l*d-h*u)*v;return m.set(1-g-y,y,g)}}(),containsPoint:function(){var e=new c;return function(t,i,r,n){var a=Be.barycoordFromPoint(t,i,r,n,e);return a.x>=0&&a.y>=0&&a.x+a.y<=1}}()}),babelHelpers.extends(Be.prototype,{set:function(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this},setFromPointsAndIndices:function(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},area:function(){var e=new c,t=new c;return function(){return e.subVectors(this.c,this.b),t.subVectors(this.a,this.b),.5*e.cross(t).length()}}(),midpoint:function(e){var t=e||new c;return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(.3333333333333333)},normal:function(e){return Be.normal(this.a,this.b,this.c,e)},plane:function(e){var t=e||new ne;return t.setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(e,t){return Be.barycoordFromPoint(e,this.a,this.b,this.c,t)},containsPoint:function(e){return Be.containsPoint(e,this.a,this.b,this.c)},closestPointToPoint:function(){var e=new ne,t=[new Fe,new Fe,new Fe],i=new c,r=new c;return function(n,a){var o=a||new c,s=1/0;if(e.setFromCoplanarPoints(this.a,this.b,this.c),e.projectPoint(n,i),this.containsPoint(i)===!0)o.copy(i);else{t[0].set(this.a,this.b),t[1].set(this.b,this.c),t[2].set(this.c,this.a);for(var l=0;l<t.length;l++){t[l].closestPointToPoint(i,!0,r);var h=i.distanceToSquared(r);h<s&&(s=h,o.copy(r))}}return o}}(),equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}),Oe.prototype=babelHelpers.extends(Object.create(he.prototype),{constructor:Oe,isMesh:!0,setDrawMode:function(e){this.drawMode=e},copy:function(e){return he.prototype.copy.call(this,e),this.drawMode=e.drawMode,this},updateMorphTargets:function(){var e,t,i,r=this.geometry;if(r.isBufferGeometry){var n=r.morphAttributes,a=Object.keys(n);if(a.length>0){var o=n[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e<t;e++)i=o[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=e}}else{var s=r.morphTargets;if(void 0!==s&&s.length>0)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=s.length;e<t;e++)i=s[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=e}},raycast:function(){function e(e,t,i,r,n,a,o){return Be.barycoordFromPoint(e,t,i,r,y),n.multiplyScalar(y.x),a.multiplyScalar(y.y),o.multiplyScalar(y.z),n.add(a).add(o),n.clone()}function t(e,t,i,r,n,a,o,s){var c;if(c=t.side===Ea?r.intersectTriangle(o,a,n,!0,s):r.intersectTriangle(n,a,o,t.side!==Ta,s),null===c)return null;b.copy(s),b.applyMatrix4(e.matrixWorld);var l=i.ray.origin.distanceTo(b);return l<i.near||l>i.far?null:{distance:l,point:b.clone(),object:e}}function r(i,r,n,a,o,c,l,p){s.fromBufferAttribute(a,c),h.fromBufferAttribute(a,l),u.fromBufferAttribute(a,p);var d=t(i,i.material,r,n,s,h,u,x);return d&&(o&&(m.fromBufferAttribute(o,c),v.fromBufferAttribute(o,l),g.fromBufferAttribute(o,p),d.uv=e(x,s,h,u,m,v,g)),d.face=new fe(c,l,p,Be.normal(s,h,u)),d.faceIndex=c),d}var n=new l,a=new De,o=new ie,s=new c,h=new c,u=new c,p=new c,d=new c,f=new c,m=new i,v=new i,g=new i,y=new c,x=new c,b=new c;return function(i,c){var l=this.geometry,y=this.material,b=this.matrixWorld;if(void 0!==y&&(null===l.boundingSphere&&l.computeBoundingSphere(),o.copy(l.boundingSphere),o.applyMatrix4(b),i.ray.intersectsSphere(o)!==!1&&(n.getInverse(b),a.copy(i.ray).applyMatrix4(n),null===l.boundingBox||a.intersectsBox(l.boundingBox)!==!1))){var _;if(l.isBufferGeometry){var w,M,E,T,S,A=l.index,R=l.attributes.position,L=l.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),_=r(this,i,a,R,L,w,M,E),_&&(_.faceIndex=Math.floor(T/3),c.push(_));else for(T=0,S=R.count;T<S;T+=3)w=T,M=T+1,E=T+2,_=r(this,i,a,R,L,w,M,E),_&&(_.index=w,c.push(_))}else if(l.isGeometry){var P,C,I,U,N=Array.isArray(y),D=l.vertices,F=l.faces,B=l.faceVertexUvs[0];B.length>0&&(U=B);for(var O=0,z=F.length;O<z;O++){var H=F[O],G=N?y[H.materialIndex]:y;if(void 0!==G){if(P=D[H.a],C=D[H.b],I=D[H.c],G.morphTargets===!0){var V=l.morphTargets,k=this.morphTargetInfluences;s.set(0,0,0),h.set(0,0,0),u.set(0,0,0);for(var W=0,j=V.length;W<j;W++){var X=k[W];if(0!==X){var q=V[W].vertices;s.addScaledVector(p.subVectors(q[H.a],P),X),h.addScaledVector(d.subVectors(q[H.b],C),X),u.addScaledVector(f.subVectors(q[H.c],I),X)}}s.add(P),h.add(C),u.add(I),P=s,C=h,I=u}if(_=t(this,G,i,a,P,C,I,x)){if(U&&U[O]){var Y=U[O];m.copy(Y[0]),v.copy(Y[1]),g.copy(Y[2]),_.uv=e(x,P,C,I,m,v,g)}_.face=H,_.faceIndex=O,c.push(_)}}}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Yl=0;gt.prototype=babelHelpers.extends(Object.create(de.prototype),{constructor:gt,isArrayCamera:!0}),Mt.prototype.isFogExp2=!0,Mt.prototype.clone=function(){return new Mt(this.color.getHex(),this.density)},Mt.prototype.toJSON=function(e){return{type:"FogExp2",color:this.color.getHex(),density:this.density}},Et.prototype.isFog=!0,Et.prototype.clone=function(){return new Et(this.color.getHex(),this.near,this.far)},Et.prototype.toJSON=function(e){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}},Tt.prototype=babelHelpers.extends(Object.create(he.prototype),{constructor:Tt,copy:function(e,t){return he.prototype.copy.call(this,e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},toJSON:function(e){var t=he.prototype.toJSON.call(this,e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}),St.prototype=babelHelpers.extends(Object.create(he.prototype),{constructor:St,isLensFlare:!0,copy:function(e){he.prototype.copy.call(this,e),this.positionScreen.copy(e.positionScreen),this.customUpdateCallback=e.customUpdateCallback;for(var t=0,i=e.lensFlares.length;t<i;t++)this.lensFlares.push(e.lensFlares[t]);return this},add:function(e,t,i,r,n,a){void 0===t&&(t=-1),void 0===i&&(i=0),void 0===a&&(a=1),void 0===n&&(n=new X(16777215)),void 0===r&&(r=Ia),i=Math.min(i,Math.max(0,i)),this.lensFlares.push({texture:e,size:t,distance:i,x:0,y:0,z:0,scale:1,rotation:0,opacity:a,color:n,blending:r})},updateLensFlares:function(){var e,t,i=this.lensFlares.length,r=2*-this.positionScreen.x,n=2*-this.positionScreen.y;for(e=0;e<i;e++)t=this.lensFlares[e],t.x=this.positionScreen.x+r*t.distance,t.y=this.positionScreen.y+n*t.distance,t.wantedRotation=t.x*Math.PI*.25,t.rotation+=.25*(t.wantedRotation-t.rotation)}}),At.prototype=Object.create(Q.prototype),At.prototype.constructor=At,At.prototype.isSpriteMaterial=!0,At.prototype.copy=function(e){return Q.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.rotation=e.rotation,this},Rt.prototype=babelHelpers.extends(Object.create(he.prototype),{constructor:Rt,isSprite:!0,raycast:function(){var e=new c,t=new c,i=new c;return function(r,n){t.setFromMatrixPosition(this.matrixWorld),r.ray.closestPointToPoint(t,e),i.setFromMatrixScale(this.matrixWorld);var a=i.x*i.y/4;if(!(t.distanceToSquared(e)>a)){var o=r.ray.origin.distanceTo(e);o<r.near||o>r.far||n.push({distance:o,point:e.clone(),face:null,object:this})}}}(),clone:function(){return new this.constructor(this.material).copy(this)}}),Lt.prototype=babelHelpers.extends(Object.create(he.prototype),{constructor:Lt,copy:function(e){he.prototype.copy.call(this,e,!1);for(var t=e.levels,i=0,r=t.length;i<r;i++){var n=t[i];this.addLevel(n.object.clone(),n.distance)}return this},addLevel:function(e,t){void 0===t&&(t=0),t=Math.abs(t);for(var i=this.levels,r=0;r<i.length&&!(t<i[r].distance);r++);i.splice(r,0,{distance:t,object:e}),this.add(e)},getObjectForDistance:function(e){for(var t=this.levels,i=1,r=t.length;i<r&&!(e<t[i].distance);i++);return t[i-1].object},raycast:function(){var e=new c;return function(t,i){e.setFromMatrixPosition(this.matrixWorld);var r=t.ray.origin.distanceTo(e);this.getObjectForDistance(r).raycast(t,i)}}(),update:function(){var e=new c,t=new c;return function(i){var r=this.levels;if(r.length>1){e.setFromMatrixPosition(i.matrixWorld),t.setFromMatrixPosition(this.matrixWorld);var n=e.distanceTo(t);r[0].object.visible=!0;for(var a=1,o=r.length;a<o&&n>=r[a].distance;a++)r[a-1].object.visible=!1,r[a].object.visible=!0;for(;a<o;a++)r[a].object.visible=!1}}}(),toJSON:function(e){var t=he.prototype.toJSON.call(this,e);t.object.levels=[];for(var i=this.levels,r=0,n=i.length;r<n;r++){var a=i[r];t.object.levels.push({object:a.object.uuid,distance:a.distance})}return t}}),babelHelpers.extends(Pt.prototype,{calculateInverses:function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var i=new l;this.bones[e]&&i.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(i)}},pose:function(){var e,t,i;for(t=0,i=this.bones.length;t<i;t++)e=this.bones[t],e&&e.matrixWorld.getInverse(this.boneInverses[t]);for(t=0,i=this.bones.length;t<i;t++)e=this.bones[t],e&&(e.parent&&e.parent.isBone?(e.matrix.getInverse(e.parent.matrixWorld),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))},update:function(){var e=new l,t=new l;return function(){for(var i=this.bones,r=this.boneInverses,n=this.boneMatrices,a=this.boneTexture,o=0,s=i.length;o<s;o++){var c=i[o]?i[o].matrixWorld:t;e.multiplyMatrices(c,r[o]),e.toArray(n,16*o)}void 0!==a&&(a.needsUpdate=!0)}}(),clone:function(){return new Pt(this.bones,this.boneInverses)}}),Ct.prototype=babelHelpers.extends(Object.create(he.prototype),{constructor:Ct,isBone:!0}),It.prototype=babelHelpers.extends(Object.create(Oe.prototype),{constructor:It,isSkinnedMesh:!0,initBones:function(){var e,t,i,r,n=[];if(this.geometry&&void 0!==this.geometry.bones){for(i=0,r=this.geometry.bones.length;i<r;i++)t=this.geometry.bones[i],e=new Ct,n.push(e),e.name=t.name,e.position.fromArray(t.pos),e.quaternion.fromArray(t.rotq),void 0!==t.scl&&e.scale.fromArray(t.scl);for(i=0,r=this.geometry.bones.length;i<r;i++)t=this.geometry.bones[i],t.parent!==-1&&null!==t.parent&&void 0!==n[t.parent]?n[t.parent].add(n[i]):this.add(n[i])}return this.updateMatrixWorld(!0),n},bind:function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){var e,t;if(this.geometry&&this.geometry.isGeometry)for(t=0;t<this.geometry.skinWeights.length;t++){var i=this.geometry.skinWeights[t];e=1/i.lengthManhattan(),e!==1/0?i.multiplyScalar(e):i.set(1,0,0,0)}else if(this.geometry&&this.geometry.isBufferGeometry){var r=new n,a=this.geometry.attributes.skinWeight;for(t=0;t<a.count;t++)r.x=a.getX(t),r.y=a.getY(t),r.z=a.getZ(t),r.w=a.getW(t),e=1/r.lengthManhattan(),e!==1/0?r.multiplyScalar(e):r.set(1,0,0,0),a.setXYZW(t,r.x,r.y,r.z,r.w)}},updateMatrixWorld:function(e){Oe.prototype.updateMatrixWorld.call(this,e),"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)}}),Ut.prototype=Object.create(Q.prototype),Ut.prototype.constructor=Ut,Ut.prototype.isLineBasicMaterial=!0,Ut.prototype.copy=function(e){return Q.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this},Nt.prototype=babelHelpers.extends(Object.create(he.prototype),{constructor:Nt,isLine:!0,raycast:function(){var e=new l,t=new De,i=new ie;return function(r,n){var a=r.linePrecision,o=a*a,s=this.geometry,l=this.matrixWorld;if(null===s.boundingSphere&&s.computeBoundingSphere(),i.copy(s.boundingSphere),i.applyMatrix4(l),r.ray.intersectsSphere(i)!==!1){e.getInverse(l),t.copy(r.ray).applyMatrix4(e);var h=new c,u=new c,p=new c,d=new c,f=this&&this.isLineSegments?2:1;if(s.isBufferGeometry){var m=s.index,v=s.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];h.fromArray(g,3*_),u.fromArray(g,3*w);var M=t.distanceSqToSegment(h,u,d,p);if(!(M>o)){d.applyMatrix4(this.matrixWorld);var E=r.ray.origin.distanceTo(d);E<r.near||E>r.far||n.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){h.fromArray(g,3*x),u.fromArray(g,3*x+3);var M=t.distanceSqToSegment(h,u,d,p);if(!(M>o)){d.applyMatrix4(this.matrixWorld);var E=r.ray.origin.distanceTo(d);E<r.near||E>r.far||n.push({distance:E,point:p.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}else if(s.isGeometry)for(var T=s.vertices,S=T.length,x=0;x<S-1;x+=f){var M=t.distanceSqToSegment(T[x],T[x+1],d,p);if(!(M>o)){d.applyMatrix4(this.matrixWorld);var E=r.ray.origin.distanceTo(d);E<r.near||E>r.far||n.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)}}),Dt.prototype=babelHelpers.extends(Object.create(Nt.prototype),{constructor:Dt,isLineSegments:!0}),Ft.prototype=babelHelpers.extends(Object.create(Nt.prototype),{constructor:Ft,isLineLoop:!0}),Bt.prototype=Object.create(Q.prototype),Bt.prototype.constructor=Bt,Bt.prototype.isPointsMaterial=!0,Bt.prototype.copy=function(e){return Q.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this},Ot.prototype=babelHelpers.extends(Object.create(he.prototype),{constructor:Ot,isPoints:!0,raycast:function(){var e=new l,t=new De,i=new ie;return function(r,n){function a(e,i){var a=t.distanceSqToPoint(e);if(a<p){var s=t.closestPointToPoint(e);s.applyMatrix4(l);var c=r.ray.origin.distanceTo(s);if(c<r.near||c>r.far)return;n.push({distance:c,distanceToRay:Math.sqrt(a),point:s.clone(),index:i,face:null,object:o})}}var o=this,s=this.geometry,l=this.matrixWorld,h=r.params.Points.threshold;if(null===s.boundingSphere&&s.computeBoundingSphere(),i.copy(s.boundingSphere),i.applyMatrix4(l),i.radius+=h,r.ray.intersectsSphere(i)!==!1){e.getInverse(l),t.copy(r.ray).applyMatrix4(e);var u=h/((this.scale.x+this.scale.y+this.scale.z)/3),p=u*u,d=new c;if(s.isBufferGeometry){var f=s.index,m=s.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),a(d,b)}else for(var y=0,_=v.length/3;y<_;y++)d.fromArray(v,3*y),a(d,y)}else for(var w=s.vertices,y=0,_=w.length;y<_;y++)a(w[y],y)}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),zt.prototype=babelHelpers.extends(Object.create(he.prototype),{constructor:zt}),Ht.prototype=Object.create(r.prototype),Ht.prototype.constructor=Ht,Gt.prototype=Object.create(r.prototype),Gt.prototype.constructor=Gt,Gt.prototype.isCompressedTexture=!0,Vt.prototype=Object.create(r.prototype),Vt.prototype.constructor=Vt,Vt.prototype.isDepthTexture=!0,kt.prototype=Object.create(Le.prototype),kt.prototype.constructor=kt,Wt.prototype=Object.create(ve.prototype),Wt.prototype.constructor=Wt,jt.prototype=Object.create(Le.prototype),jt.prototype.constructor=jt,Xt.prototype=Object.create(ve.prototype),Xt.prototype.constructor=Xt,qt.prototype=Object.create(Le.prototype),qt.prototype.constructor=qt,Yt.prototype=Object.create(ve.prototype),Yt.prototype.constructor=Yt,Zt.prototype=Object.create(qt.prototype),Zt.prototype.constructor=Zt,Jt.prototype=Object.create(ve.prototype),Jt.prototype.constructor=Jt,Qt.prototype=Object.create(qt.prototype),Qt.prototype.constructor=Qt,Kt.prototype=Object.create(ve.prototype),Kt.prototype.constructor=Kt,$t.prototype=Object.create(qt.prototype),$t.prototype.constructor=$t,ei.prototype=Object.create(ve.prototype),ei.prototype.constructor=ei,ti.prototype=Object.create(qt.prototype),ti.prototype.constructor=ti,ii.prototype=Object.create(ve.prototype),ii.prototype.constructor=ii,ri.prototype=Object.create(Le.prototype),ri.prototype.constructor=ri,ni.prototype=Object.create(ve.prototype),ni.prototype.constructor=ni,ai.prototype=Object.create(Le.prototype),ai.prototype.constructor=ai,oi.prototype=Object.create(ve.prototype),oi.prototype.constructor=oi,si.prototype=Object.create(Le.prototype),si.prototype.constructor=si;var Zl={area:function(e){for(var t=e.length,i=0,r=t-1,n=0;n<t;r=n++)i+=e[r].x*e[n].y-e[n].x*e[r].y;return.5*i},triangulate:function(){function e(e,t,i,r,n,a){var o,s,c,l,h,u,p,d,f;if(s=e[a[t]].x,c=e[a[t]].y,l=e[a[i]].x,h=e[a[i]].y,u=e[a[r]].x,p=e[a[r]].y,(l-s)*(p-c)-(h-c)*(u-s)<=0)return!1;var m,v,g,y,x,b,_,w,M,E,T,S,A,R,L;for(m=u-l,v=p-h,g=s-u,y=c-p,x=l-s,b=h-c,o=0;o<n;o++)if(d=e[a[o]].x,f=e[a[o]].y,!(d===s&&f===c||d===l&&f===h||d===u&&f===p)&&(_=d-s,w=f-c,M=d-l,E=f-h,T=d-u,S=f-p,L=m*E-v*M,A=x*w-b*_,R=g*S-y*T,L>=-Number.EPSILON&&R>=-Number.EPSILON&&A>=-Number.EPSILON))return!1;return!0}return function(t,i){var r=t.length;if(r<3)return null;var n,a,o,s=[],c=[],l=[];if(Zl.area(t)>0)for(a=0;a<r;a++)c[a]=a;else for(a=0;a<r;a++)c[a]=r-1-a;var h=r,u=2*h;for(a=h-1;h>2;){if(u--<=0)return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),i?l:s;if(n=a,h<=n&&(n=0),a=n+1,h<=a&&(a=0),o=a+1,h<=o&&(o=0),e(t,n,a,o,h,c)){var p,d,f,m,v;for(p=c[n],d=c[a],f=c[o],s.push([t[p],t[d],t[f]]),l.push([c[n],c[a],c[o]]),m=a,v=a+1;v<h;m++,v++)c[m]=c[v];h--,u=2*h}}return i?l:s}}(),triangulateShape:function(e,t){function i(e){var t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function r(e,t,i){return e.x!==t.x?e.x<t.x?e.x<=i.x&&i.x<=t.x:t.x<=i.x&&i.x<=e.x:e.y<t.y?e.y<=i.y&&i.y<=t.y:t.y<=i.y&&i.y<=e.y}function n(e,t,i,n,a){var o=t.x-e.x,s=t.y-e.y,c=n.x-i.x,l=n.y-i.y,h=e.x-i.x,u=e.y-i.y,p=s*c-o*l,d=s*h-o*u;if(Math.abs(p)>Number.EPSILON){var f;if(p>0){if(d<0||d>p)return[];if(f=l*h-c*u,f<0||f>p)return[]}else{if(d>0||d<p)return[];if(f=l*h-c*u,f>0||f<p)return[]}if(0===f)return!a||0!==d&&d!==p?[e]:[];if(f===p)return!a||0!==d&&d!==p?[t]:[];if(0===d)return[i];if(d===p)return[n];var m=f/p;return[{x:e.x+m*o,y:e.y+m*s}]}if(0!==d||l*h!==c*u)return[];var v=0===o&&0===s,g=0===c&&0===l;if(v&&g)return e.x!==i.x||e.y!==i.y?[]:[e];if(v)return r(i,n,e)?[e]:[];if(g)return r(e,t,i)?[i]:[];var y,x,b,_,w,M,E,T;return 0!==o?(e.x<t.x?(y=e,b=e.x,x=t,_=t.x):(y=t,b=t.x,x=e,_=e.x),i.x<n.x?(w=i,E=i.x,M=n,T=n.x):(w=n,E=n.x,M=i,T=i.x)):(e.y<t.y?(y=e,b=e.y,x=t,_=t.y):(y=t,b=t.y,x=e,_=e.y),i.y<n.y?(w=i,E=i.y,M=n,T=n.y):(w=n,E=n.y,M=i,T=i.y)),b<=E?_<E?[]:_===E?a?[]:[w]:_<=T?[w,x]:[w,M]:b>T?[]:b===T?a?[]:[y]:_<=T?[y,x]:[y,M]}function a(e,t,i,r){var n=t.x-e.x,a=t.y-e.y,o=i.x-e.x,s=i.y-e.y,c=r.x-e.x,l=r.y-e.y,h=n*s-a*o,u=n*l-a*c;if(Math.abs(h)>Number.EPSILON){var p=c*s-l*o;return h>0?u>=0&&p>=0:u>=0||p>=0}return u>0}function o(e,t){function i(e,t){var i=y.length-1,r=e-1;r<0&&(r=i);var n=e+1;n>i&&(n=0);var o=a(y[e],y[r],y[n],s[t]);if(!o)return!1;var c=s.length-1,l=t-1;l<0&&(l=c);var h=t+1;return h>c&&(h=0),o=a(s[t],s[l],s[h],y[e]),!!o}function r(e,t){var i,r,a;for(i=0;i<y.length;i++)if(r=i+1,r%=y.length,a=n(e,t,y[i],y[r],!0),a.length>0)return!0;return!1}function o(e,i){var r,a,o,s,c;for(r=0;r<x.length;r++)for(a=t[x[r]],o=0;o<a.length;o++)if(s=o+1,s%=a.length,c=n(e,i,a[o],a[s],!0),c.length>0)return!0;return!1}for(var s,c,l,h,u,p,d,f,m,v,g,y=e.concat(),x=[],b=[],_=0,w=t.length;_<w;_++)x.push(_);for(var M=0,E=2*x.length;x.length>0;){if(E--,E<0){console.log('THREE.ShapeUtils: Infinite Loop! Holes left:" + indepHoles.length + ", Probably Hole outside Shape!');break}for(l=M;l<y.length;l++){h=y[l],c=-1;for(var _=0;_<x.length;_++)if(p=x[_],d=h.x+":"+h.y+":"+p,void 0===b[d]){s=t[p];for(var T=0;T<s.length;T++)if(u=s[T],i(l,T)&&!r(h,u)&&!o(h,u)){c=T,x.splice(_,1),f=y.slice(0,l+1),m=y.slice(l),v=s.slice(c),g=s.slice(0,c+1),y=f.concat(v).concat(g).concat(m),M=l;break}if(c>=0)break;b[d]=!0}if(c>=0)break}}return y}i(e),t.forEach(i);for(var s,c,l,h,u,p,d={},f=e.concat(),m=0,v=t.length;m<v;m++)Array.prototype.push.apply(f,t[m]);for(s=0,c=f.length;s<c;s++)u=f[s].x+":"+f[s].y,void 0!==d[u]&&console.warn("THREE.ShapeUtils: Duplicate point",u,s),d[u]=s;var g=o(e,t),y=Zl.triangulate(g,!1);for(s=0,c=y.length;s<c;s++)for(h=y[s],l=0;l<3;l++)u=h[l].x+":"+h[l].y,p=d[u],void 0!==p&&(h[l]=p);return y.concat()},isClockWise:function(e){return Zl.area(e)<0}};ci.prototype=Object.create(ve.prototype),ci.prototype.constructor=ci,li.prototype=Object.create(Le.prototype),li.prototype.constructor=li,li.prototype.getArrays=function(){var e=this.getAttribute("position"),t=e?Array.prototype.slice.call(e.array):[],i=this.getAttribute("uv"),r=i?Array.prototype.slice.call(i.array):[],n=this.index,a=n?Array.prototype.slice.call(n.array):[];return{position:t,uv:r,index:a}},li.prototype.addShapeList=function(e,t){var i=e.length;t.arrays=this.getArrays();for(var r=0;r<i;r++){var n=e[r];
this.addShape(n,t)}this.setIndex(t.arrays.index),this.addAttribute("position",new Te(t.arrays.position,3)),this.addAttribute("uv",new Te(t.arrays.uv,2))},li.prototype.addShape=function(e,t){function r(e,t,i){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(i).add(e)}function n(e,t,r){var n,a,o,s=e.x-t.x,c=e.y-t.y,l=r.x-e.x,h=r.y-e.y,u=s*s+c*c,p=s*h-c*l;if(Math.abs(p)>Number.EPSILON){var d=Math.sqrt(u),f=Math.sqrt(l*l+h*h),m=t.x-c/d,v=t.y+s/d,g=r.x-h/f,y=r.y+l/f,x=((g-m)*h-(y-v)*l)/(s*h-c*l);n=m+s*x-e.x,a=v+c*x-e.y;var b=n*n+a*a;if(b<=2)return new i(n,a);o=Math.sqrt(b/2)}else{var _=!1;s>Number.EPSILON?l>Number.EPSILON&&(_=!0):s<-Number.EPSILON?l<-Number.EPSILON&&(_=!0):Math.sign(c)===Math.sign(h)&&(_=!0),_?(n=-c,a=s,o=Math.sqrt(u)):(n=s,a=c,o=Math.sqrt(u/2))}return new i(n/o,a/o)}function a(){var e=b.length/3;if(R){var i=0,r=J*i;for($=0;$<Q;$++)Z=V[$],h(Z[2]+r,Z[1]+r,Z[0]+r);for(i=P+2*A,r=J*i,$=0;$<Q;$++)Z=V[$],h(Z[0]+r,Z[1]+r,Z[2]+r)}else{for($=0;$<Q;$++)Z=V[$],h(Z[2],Z[1],Z[0]);for($=0;$<Q;$++)Z=V[$],h(Z[0]+J*P,Z[1]+J*P,Z[2]+J*P)}B.addGroup(e,b.length/3-e,void 0!==t.material?t.material:0)}function o(){var e=b.length/3,i=0;for(s(k,i),i+=k.length,D=0,F=H.length;D<F;D++)N=H[D],s(N,i),i+=N.length;B.addGroup(e,b.length/3-e,void 0!==t.extrudeMaterial?t.extrudeMaterial:1)}function s(e,t){var i,r;for($=e.length;--$>=0;){i=$,r=$-1,r<0&&(r=e.length-1);var n=0,a=P+2*A;for(n=0;n<a;n++){var o=J*n,s=J*(n+1),c=t+i+o,l=t+r+o,h=t+r+s,p=t+i+s;u(c,l,h,p,e,n,a,i,r)}}}function l(e,t,i){M.push(e),M.push(t),M.push(i)}function h(e,t,i){p(e),p(t),p(i);var r=b.length/3,n=U.generateTopUV(B,b,r-3,r-2,r-1);d(n[0]),d(n[1]),d(n[2])}function u(e,t,i,r,n,a,o,s,c){p(e),p(t),p(r),p(t),p(i),p(r);var l=b.length/3,h=U.generateSideWallUV(B,b,l-6,l-3,l-2,l-1);d(h[0]),d(h[1]),d(h[3]),d(h[1]),d(h[2]),d(h[3])}function p(e){_.push(b.length/3),b.push(M[3*e+0]),b.push(M[3*e+1]),b.push(M[3*e+2])}function d(e){w.push(e.x),w.push(e.y)}var f,m,v,g,y,x=t.arrays?t.arrays:this.getArrays(),b=x.position,_=x.index,w=x.uv,M=[],E=void 0!==t.amount?t.amount:100,T=void 0!==t.bevelThickness?t.bevelThickness:6,S=void 0!==t.bevelSize?t.bevelSize:T-2,A=void 0!==t.bevelSegments?t.bevelSegments:3,R=void 0===t.bevelEnabled||t.bevelEnabled,L=void 0!==t.curveSegments?t.curveSegments:12,P=void 0!==t.steps?t.steps:1,C=t.extrudePath,I=!1,U=void 0!==t.UVGenerator?t.UVGenerator:ci.WorldUVGenerator;C&&(f=C.getSpacedPoints(P),I=!0,R=!1,m=void 0!==t.frames?t.frames:C.computeFrenetFrames(P,!1),v=new c,g=new c,y=new c),R||(A=0,T=0,S=0);var N,D,F,B=this,O=e.extractPoints(L),z=O.shape,H=O.holes,G=!Zl.isClockWise(z);if(G)for(z=z.reverse(),D=0,F=H.length;D<F;D++)N=H[D],Zl.isClockWise(N)&&(H[D]=N.reverse());var V=Zl.triangulateShape(z,H),k=z;for(D=0,F=H.length;D<F;D++)N=H[D],z=z.concat(N);for(var W,j,X,q,Y,Z,J=z.length,Q=V.length,K=[],$=0,ee=k.length,te=ee-1,ie=$+1;$<ee;$++,te++,ie++)te===ee&&(te=0),ie===ee&&(ie=0),K[$]=n(k[$],k[te],k[ie]);var re,ne=[],ae=K.concat();for(D=0,F=H.length;D<F;D++){for(N=H[D],re=[],$=0,ee=N.length,te=ee-1,ie=$+1;$<ee;$++,te++,ie++)te===ee&&(te=0),ie===ee&&(ie=0),re[$]=n(N[$],N[te],N[ie]);ne.push(re),ae=ae.concat(re)}for(W=0;W<A;W++){for(X=W/A,q=T*Math.cos(X*Math.PI/2),j=S*Math.sin(X*Math.PI/2),$=0,ee=k.length;$<ee;$++)Y=r(k[$],K[$],j),l(Y.x,Y.y,-q);for(D=0,F=H.length;D<F;D++)for(N=H[D],re=ne[D],$=0,ee=N.length;$<ee;$++)Y=r(N[$],re[$],j),l(Y.x,Y.y,-q)}for(j=S,$=0;$<J;$++)Y=R?r(z[$],ae[$],j):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),l(y.x,y.y,y.z)):l(Y.x,Y.y,0);var oe;for(oe=1;oe<=P;oe++)for($=0;$<J;$++)Y=R?r(z[$],ae[$],j):z[$],I?(g.copy(m.normals[oe]).multiplyScalar(Y.x),v.copy(m.binormals[oe]).multiplyScalar(Y.y),y.copy(f[oe]).add(g).add(v),l(y.x,y.y,y.z)):l(Y.x,Y.y,E/P*oe);for(W=A-1;W>=0;W--){for(X=W/A,q=T*Math.cos(X*Math.PI/2),j=S*Math.sin(X*Math.PI/2),$=0,ee=k.length;$<ee;$++)Y=r(k[$],K[$],j),l(Y.x,Y.y,E+q);for(D=0,F=H.length;D<F;D++)for(N=H[D],re=ne[D],$=0,ee=N.length;$<ee;$++)Y=r(N[$],re[$],j),I?l(Y.x,Y.y+f[P-1].y,f[P-1].x+q):l(Y.x,Y.y,E+q)}a(),o(),t.arrays||(this.setIndex(_),this.addAttribute("position",new Te(b,3)),this.addAttribute("uv",new Te(t.arrays.uv,2)))},ci.WorldUVGenerator={generateTopUV:function(e,t,r,n,a){var o=t[3*r],s=t[3*r+1],c=t[3*n],l=t[3*n+1],h=t[3*a],u=t[3*a+1];return[new i(o,s),new i(c,l),new i(h,u)]},generateSideWallUV:function(e,t,r,n,a,o){var s=t[3*r],c=t[3*r+1],l=t[3*r+2],h=t[3*n],u=t[3*n+1],p=t[3*n+2],d=t[3*a],f=t[3*a+1],m=t[3*a+2],v=t[3*o],g=t[3*o+1],y=t[3*o+2];return Math.abs(c-u)<.01?[new i(s,1-l),new i(h,1-p),new i(d,1-m),new i(v,1-y)]:[new i(c,1-l),new i(u,1-p),new i(f,1-m),new i(g,1-y)]}},hi.prototype=Object.create(ve.prototype),hi.prototype.constructor=hi,ui.prototype=Object.create(li.prototype),ui.prototype.constructor=ui,pi.prototype=Object.create(ve.prototype),pi.prototype.constructor=pi,di.prototype=Object.create(Le.prototype),di.prototype.constructor=di,fi.prototype=Object.create(ve.prototype),fi.prototype.constructor=fi,mi.prototype=Object.create(Le.prototype),mi.prototype.constructor=mi,vi.prototype=Object.create(ve.prototype),vi.prototype.constructor=vi,gi.prototype=Object.create(Le.prototype),gi.prototype.constructor=gi,yi.prototype=Object.create(ve.prototype),yi.prototype.constructor=yi,xi.prototype=Object.create(Le.prototype),xi.prototype.constructor=xi,bi.prototype=Object.create(Le.prototype),bi.prototype.constructor=bi,_i.prototype=Object.create(ve.prototype),_i.prototype.constructor=_i,wi.prototype=Object.create(Le.prototype),wi.prototype.constructor=wi,Mi.prototype=Object.create(_i.prototype),Mi.prototype.constructor=Mi,Ei.prototype=Object.create(wi.prototype),Ei.prototype.constructor=Ei,Ti.prototype=Object.create(ve.prototype),Ti.prototype.constructor=Ti,Si.prototype=Object.create(Le.prototype),Si.prototype.constructor=Si;var Jl=Object.freeze({WireframeGeometry:kt,ParametricGeometry:Wt,ParametricBufferGeometry:jt,TetrahedronGeometry:Yt,TetrahedronBufferGeometry:Zt,OctahedronGeometry:Jt,OctahedronBufferGeometry:Qt,IcosahedronGeometry:Kt,IcosahedronBufferGeometry:$t,DodecahedronGeometry:ei,DodecahedronBufferGeometry:ti,PolyhedronGeometry:Xt,PolyhedronBufferGeometry:qt,TubeGeometry:ii,TubeBufferGeometry:ri,TorusKnotGeometry:ni,TorusKnotBufferGeometry:ai,TorusGeometry:oi,TorusBufferGeometry:si,TextGeometry:hi,TextBufferGeometry:ui,SphereGeometry:pi,SphereBufferGeometry:di,RingGeometry:fi,RingBufferGeometry:mi,PlaneGeometry:Ie,PlaneBufferGeometry:Ue,LatheGeometry:vi,LatheBufferGeometry:gi,ShapeGeometry:yi,ShapeBufferGeometry:xi,ExtrudeGeometry:ci,ExtrudeBufferGeometry:li,EdgesGeometry:bi,ConeGeometry:Mi,ConeBufferGeometry:Ei,CylinderGeometry:_i,CylinderBufferGeometry:wi,CircleGeometry:Ti,CircleBufferGeometry:Si,BoxGeometry:Pe,BoxBufferGeometry:Ce});Ai.prototype=Object.create(Q.prototype),Ai.prototype.constructor=Ai,Ai.prototype.isShadowMaterial=!0,Ri.prototype=Object.create(K.prototype),Ri.prototype.constructor=Ri,Ri.prototype.isRawShaderMaterial=!0,Li.prototype=Object.create(Q.prototype),Li.prototype.constructor=Li,Li.prototype.isMeshStandardMaterial=!0,Li.prototype.copy=function(e){return Q.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Pi.prototype=Object.create(Li.prototype),Pi.prototype.constructor=Pi,Pi.prototype.isMeshPhysicalMaterial=!0,Pi.prototype.copy=function(e){return Li.prototype.copy.call(this,e),this.defines={PHYSICAL:""},this.reflectivity=e.reflectivity,this.clearCoat=e.clearCoat,this.clearCoatRoughness=e.clearCoatRoughness,this},Ci.prototype=Object.create(Q.prototype),Ci.prototype.constructor=Ci,Ci.prototype.isMeshPhongMaterial=!0,Ci.prototype.copy=function(e){return Q.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Ii.prototype=Object.create(Ci.prototype),Ii.prototype.constructor=Ii,Ii.prototype.isMeshToonMaterial=!0,Ii.prototype.copy=function(e){return Ci.prototype.copy.call(this,e),this.gradientMap=e.gradientMap,this},Ui.prototype=Object.create(Q.prototype),Ui.prototype.constructor=Ui,Ui.prototype.isMeshNormalMaterial=!0,Ui.prototype.copy=function(e){return Q.prototype.copy.call(this,e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Ni.prototype=Object.create(Q.prototype),Ni.prototype.constructor=Ni,Ni.prototype.isMeshLambertMaterial=!0,Ni.prototype.copy=function(e){return Q.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Di.prototype=Object.create(Ut.prototype),Di.prototype.constructor=Di,Di.prototype.isLineDashedMaterial=!0,Di.prototype.copy=function(e){return Ut.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var Ql=Object.freeze({ShadowMaterial:Ai,SpriteMaterial:At,RawShaderMaterial:Ri,ShaderMaterial:K,PointsMaterial:Bt,MeshPhysicalMaterial:Pi,MeshStandardMaterial:Li,MeshPhongMaterial:Ci,MeshToonMaterial:Ii,MeshNormalMaterial:Ui,MeshLambertMaterial:Ni,MeshDepthMaterial:$,MeshDistanceMaterial:ee,MeshBasicMaterial:Ne,LineDashedMaterial:Di,LineBasicMaterial:Ut,Material:Q}),Kl={enabled:!1,files:{},add:function(e,t){this.enabled!==!1&&(this.files[e]=t)},get:function(e){if(this.enabled!==!1)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},$l=new Fi;babelHelpers.extends(Bi.prototype,{load:function(e,t,i,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e);var n=this,a=Kl.get(e);if(void 0!==a)return n.manager.itemStart(e),setTimeout(function(){t&&t(a),n.manager.itemEnd(e)},0),a;var o=/^data:(.*?)(;base64)?,(.*)$/,s=e.match(o);if(s){var c=s[1],l=!!s[2],h=s[3];h=window.decodeURIComponent(h),l&&(h=window.atob(h));try{var u,p=(this.responseType||"").toLowerCase();switch(p){case"arraybuffer":case"blob":u=new ArrayBuffer(h.length);for(var d=new Uint8Array(u),f=0;f<h.length;f++)d[f]=h.charCodeAt(f);"blob"===p&&(u=new Blob([u],{type:c}));break;case"document":var m=new DOMParser;u=m.parseFromString(h,c);break;case"json":u=JSON.parse(h);break;default:u=h}window.setTimeout(function(){t&&t(u),n.manager.itemEnd(e)},0)}catch(t){window.setTimeout(function(){r&&r(t),n.manager.itemEnd(e),n.manager.itemError(e)},0)}}else{var v=new XMLHttpRequest;v.open("GET",e,!0),v.addEventListener("load",function(i){var a=i.target.response;Kl.add(e,a),200===this.status?(t&&t(a),n.manager.itemEnd(e)):0===this.status?(console.warn("THREE.FileLoader: HTTP Status 0 received."),t&&t(a),n.manager.itemEnd(e)):(r&&r(i),n.manager.itemEnd(e),n.manager.itemError(e))},!1),void 0!==i&&v.addEventListener("progress",function(e){i(e)},!1),v.addEventListener("error",function(t){r&&r(t),n.manager.itemEnd(e),n.manager.itemError(e)},!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 n.manager.itemStart(e),v},setPath:function(e){return this.path=e,this},setResponseType:function(e){return this.responseType=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setMimeType:function(e){return this.mimeType=e,this},setRequestHeader:function(e){return this.requestHeader=e,this}}),babelHelpers.extends(Oi.prototype,{load:function(e,t,i,r){function n(n){c.load(e[n],function(e){var i=a._parser(e,!0);o[n]={width:i.width,height:i.height,format:i.format,mipmaps:i.mipmaps},l+=1,6===l&&(1===i.mipmapCount&&(s.minFilter=Po),s.format=i.format,s.needsUpdate=!0,t&&t(s))},i,r)}var a=this,o=[],s=new Gt;s.image=o;var c=new Bi(this.manager);if(c.setPath(this.path),c.setResponseType("arraybuffer"),Array.isArray(e))for(var l=0,h=0,u=e.length;h<u;++h)n(h);else c.load(e,function(e){var i=a._parser(e,!0);if(i.isCubemap)for(var r=i.mipmaps.length/i.mipmapCount,n=0;n<r;n++){o[n]={mipmaps:[]};for(var c=0;c<i.mipmapCount;c++)o[n].mipmaps.push(i.mipmaps[n*i.mipmapCount+c]),o[n].format=i.format,o[n].width=i.width,o[n].height=i.height}else s.image.width=i.width,s.image.height=i.height,s.mipmaps=i.mipmaps;1===i.mipmapCount&&(s.minFilter=Po),s.format=i.format,s.needsUpdate=!0,t&&t(s)},i,r);return s},setPath:function(e){return this.path=e,this}}),babelHelpers.extends(zi.prototype,{load:function(e,t,i,r){var n=this,a=new h,o=new Bi(this.manager);return o.setResponseType("arraybuffer"),o.load(e,function(e){var i=n._parser(e);i&&(void 0!==i.image?a.image=i.image:void 0!==i.data&&(a.image.width=i.width,a.image.height=i.height,a.image.data=i.data),a.wrapS=void 0!==i.wrapS?i.wrapS:To,a.wrapT=void 0!==i.wrapT?i.wrapT:To,a.magFilter=void 0!==i.magFilter?i.magFilter:Po,a.minFilter=void 0!==i.minFilter?i.minFilter:Io,a.anisotropy=void 0!==i.anisotropy?i.anisotropy:1,void 0!==i.format&&(a.format=i.format),void 0!==i.type&&(a.type=i.type),void 0!==i.mipmaps&&(a.mipmaps=i.mipmaps),1===i.mipmapCount&&(a.minFilter=Po),a.needsUpdate=!0,t&&t(a,i))},i,r),a}}),babelHelpers.extends(Hi.prototype,{crossOrigin:"Anonymous",load:function(e,t,i,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e);var n=this,a=Kl.get(e);if(void 0!==a)return n.manager.itemStart(e),setTimeout(function(){t&&t(a),n.manager.itemEnd(e)},0),a;var o=document.createElementNS("http://www.w3.org/1999/xhtml","img");return o.addEventListener("load",function(){Kl.add(e,this),t&&t(this),n.manager.itemEnd(e)},!1),o.addEventListener("error",function(t){r&&r(t),n.manager.itemEnd(e),n.manager.itemError(e)},!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),n.manager.itemStart(e),o.src=e,o},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),babelHelpers.extends(Gi.prototype,{crossOrigin:"Anonymous",load:function(e,t,i,r){function n(i){o.load(e[i],function(e){a.images[i]=e,s++,6===s&&(a.needsUpdate=!0,t&&t(a))},void 0,r)}var a=new u,o=new Hi(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);for(var s=0,c=0;c<e.length;++c)n(c);return a},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),babelHelpers.extends(Vi.prototype,{crossOrigin:"Anonymous",load:function(e,t,i,n){var a=new Hi(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);var o=new r;return o.image=a.load(e,function(){var i=e.search(/\.(jpg|jpeg)$/)>0||0===e.search(/^data\:image\/jpeg/);o.format=i?Xo:qo,o.needsUpdate=!0,void 0!==t&&t(o)},i,n),o},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),ki.prototype=babelHelpers.extends(Object.create(he.prototype),{constructor:ki,isLight:!0,copy:function(e){return he.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=he.prototype.toJSON.call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}),Wi.prototype=babelHelpers.extends(Object.create(ki.prototype),{constructor:Wi,isHemisphereLight:!0,copy:function(e){return ki.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}),babelHelpers.extends(ji.prototype,{copy:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}),Xi.prototype=babelHelpers.extends(Object.create(ji.prototype),{constructor:Xi,isSpotLightShadow:!0,update:function(e){var t=this.camera,i=2*Ps.RAD2DEG*e.angle,r=this.mapSize.width/this.mapSize.height,n=e.distance||t.far;i===t.fov&&r===t.aspect&&n===t.far||(t.fov=i,t.aspect=r,t.far=n,t.updateProjectionMatrix())}}),qi.prototype=babelHelpers.extends(Object.create(ki.prototype),{constructor:qi,isSpotLight:!0,copy:function(e){return ki.prototype.copy.call(this,e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Yi.prototype=babelHelpers.extends(Object.create(ki.prototype),{constructor:Yi,isPointLight:!0,copy:function(e){return ki.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),Zi.prototype=babelHelpers.extends(Object.create(ji.prototype),{constructor:Zi}),Ji.prototype=babelHelpers.extends(Object.create(ki.prototype),{constructor:Ji,isDirectionalLight:!0,copy:function(e){return ki.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Qi.prototype=babelHelpers.extends(Object.create(ki.prototype),{constructor:Qi,isAmbientLight:!0}),Ki.prototype=babelHelpers.extends(Object.create(ki.prototype),{constructor:Ki,isRectAreaLight:!0,copy:function(e){return ki.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){var t=ki.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}});var eh={arraySlice:function(e,t,i){return eh.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==i?i:e.length)):e.slice(t,i)},convertArray:function(e,t,i){return!e||!i&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){function t(t,i){return e[t]-e[i]}for(var i=e.length,r=new Array(i),n=0;n!==i;++n)r[n]=n;return r.sort(t),r},sortedArray:function(e,t,i){for(var r=e.length,n=new e.constructor(r),a=0,o=0;o!==r;++a)for(var s=i[a]*t,c=0;c!==t;++c)n[o++]=e[s+c];return n},flattenJSON:function(e,t,i,r){for(var n=1,a=e[0];void 0!==a&&void 0===a[r];)a=e[n++];if(void 0!==a){var o=a[r];if(void 0!==o)if(Array.isArray(o)){do o=a[r],void 0!==o&&(t.push(a.time),i.push.apply(i,o)),a=e[n++];while(void 0!==a)}else if(void 0!==o.toArray){do o=a[r],void 0!==o&&(t.push(a.time),o.toArray(i,i.length)),a=e[n++];while(void 0!==a)}else do o=a[r],void 0!==o&&(t.push(a.time),i.push(o)),a=e[n++];while(void 0!==a)}}};babelHelpers.extends($i.prototype,{evaluate:function(e){var t=this.parameterPositions,i=this._cachedIndex,r=t[i],n=t[i-1];e:{t:{var a;i:{r:if(!(e<r)){for(var o=i+2;;){if(void 0===r){if(e<n)break r;return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,e,n)}if(i===o)break;if(n=r,r=t[++i],e<r)break t}a=t.length;break i}{if(e>=n)break e;var s=t[1];e<s&&(i=2,n=s);for(var o=i-2;;){if(void 0===n)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(i===o)break;if(r=n,n=t[--i-1],e>=n)break t}a=i,i=0}}for(;i<a;){var c=i+a>>>1;e<t[c]?a=c:i=c+1}if(r=t[i],n=t[i-1],void 0===n)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(void 0===r)return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,n,e)}this._cachedIndex=i,this.intervalChanged_(i,n,r)}return this.interpolate_(i,n,e,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){for(var t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,n=e*r,a=0;a!==r;++a)t[a]=i[n+a];return t},interpolate_:function(e,t,i,r){throw new Error("call to abstract method")},intervalChanged_:function(e,t,i){}}),babelHelpers.extends($i.prototype,{beforeStart_:$i.prototype.copySampleValue_,afterEnd_:$i.prototype.copySampleValue_}),er.prototype=babelHelpers.extends(Object.create($i.prototype),{constructor:er,DefaultSettings_:{endingStart:fs,endingEnd:fs},intervalChanged_:function(e,t,i){var r=this.parameterPositions,n=e-2,a=e+1,o=r[n],s=r[a];if(void 0===o)switch(this.getSettings_().endingStart){case ms:n=e,o=2*t-i;break;case vs:n=r.length-2,o=t+r[n]-r[n+1];break;default:n=e,o=i}if(void 0===s)switch(this.getSettings_().endingEnd){case ms:a=e,s=2*i-t;break;case vs:a=1,s=i+r[1]-r[0];break;default:a=e-1,s=t}var c=.5*(i-t),l=this.valueSize;this._weightPrev=c/(t-o),this._weightNext=c/(s-i),this._offsetPrev=n*l,this._offsetNext=a*l},interpolate_:function(e,t,i,r){for(var n=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=this._offsetPrev,h=this._offsetNext,u=this._weightPrev,p=this._weightNext,d=(i-t)/(r-t),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)n[b]=v*a[l+b]+g*a[c+b]+y*a[s+b]+x*a[h+b];return n}}),tr.prototype=babelHelpers.extends(Object.create($i.prototype),{constructor:tr,interpolate_:function(e,t,i,r){for(var n=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=(i-t)/(r-t),h=1-l,u=0;u!==o;++u)n[u]=a[c+u]*h+a[s+u]*l;return n}}),ir.prototype=babelHelpers.extends(Object.create($i.prototype),{constructor:ir,interpolate_:function(e,t,i,r){return this.copySampleValue_(e-1)}});var th;th={TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:ps,InterpolantFactoryMethodDiscrete:function(e){return new ir(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new tr(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new er(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t;switch(e){case us:t=this.InterpolantFactoryMethodDiscrete;break;case ps:t=this.InterpolantFactoryMethodLinear;break;case ds:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){var i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(i);this.setInterpolation(this.DefaultInterpolation)}return void console.warn("THREE.KeyframeTrackPrototype:",i)}this.createInterpolant=t},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return us;case this.InterpolantFactoryMethodLinear:return ps;case this.InterpolantFactoryMethodSmooth:return ds}},getValueSize:function(){return this.values.length/this.times.length},shift:function(e){if(0!==e)for(var t=this.times,i=0,r=t.length;i!==r;++i)t[i]+=e;return this},scale:function(e){if(1!==e)for(var t=this.times,i=0,r=t.length;i!==r;++i)t[i]*=e;return this},trim:function(e,t){for(var i=this.times,r=i.length,n=0,a=r-1;n!==r&&i[n]<e;)++n;for(;a!==-1&&i[a]>t;)--a;if(++a,0!==n||a!==r){n>=a&&(a=Math.max(a,1),n=a-1);var o=this.getValueSize();this.times=eh.arraySlice(i,n,a),this.values=eh.arraySlice(this.values,n*o,a*o)}return this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrackPrototype: Invalid value size in track.",this),e=!1);var i=this.times,r=this.values,n=i.length;0===n&&(console.error("THREE.KeyframeTrackPrototype: Track is empty.",this),e=!1);for(var a=null,o=0;o!==n;o++){var s=i[o];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrackPrototype: Time is not a valid number.",this,o,s),e=!1;break}if(null!==a&&a>s){console.error("THREE.KeyframeTrackPrototype: Out of order keys.",this,o,s,a),e=!1;break}a=s}if(void 0!==r&&eh.isTypedArray(r))for(var o=0,c=r.length;o!==c;++o){var l=r[o];if(isNaN(l)){console.error("THREE.KeyframeTrackPrototype: Value is not a valid number.",this,o,l),e=!1;break}}return e},optimize:function(){for(var e=this.times,t=this.values,i=this.getValueSize(),r=this.getInterpolation()===ds,n=1,a=e.length-1,o=1;o<a;++o){var s=!1,c=e[o],l=e[o+1];if(c!==l&&(1!==o||c!==c[0]))if(r)s=!0;else for(var h=o*i,u=h-i,p=h+i,d=0;d!==i;++d){var f=t[h+d];if(f!==t[u+d]||f!==t[p+d]){s=!0;break}}if(s){if(o!==n){e[n]=e[o];for(var m=o*i,v=n*i,d=0;d!==i;++d)t[v+d]=t[m+d]}++n}}if(a>0){e[n]=e[a];for(var m=a*i,v=n*i,d=0;d!==i;++d)t[v+d]=t[m+d];++n}return n!==e.length&&(this.times=eh.arraySlice(e,0,n),this.values=eh.arraySlice(t,0,n*i)),this}},nr.prototype=babelHelpers.extends(Object.create(th),{constructor:nr,ValueTypeName:"vector"}),ar.prototype=babelHelpers.extends(Object.create($i.prototype),{constructor:ar,interpolate_:function(e,t,i,r){for(var n=this.resultBuffer,a=this.sampleValues,o=this.valueSize,c=e*o,l=(i-t)/(r-t),h=c+o;c!==h;c+=4)s.slerpFlat(n,0,a,c-o,a,c,l);return n}}),or.prototype=babelHelpers.extends(Object.create(th),{constructor:or,ValueTypeName:"quaternion",DefaultInterpolation:ps,InterpolantFactoryMethodLinear:function(e){return new ar(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),sr.prototype=babelHelpers.extends(Object.create(th),{constructor:sr,ValueTypeName:"number"}),cr.prototype=babelHelpers.extends(Object.create(th),{constructor:cr,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:us,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),lr.prototype=babelHelpers.extends(Object.create(th),{constructor:lr,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:us,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),hr.prototype=babelHelpers.extends(Object.create(th),{constructor:hr,ValueTypeName:"color"}),ur.prototype=th,th.constructor=ur,babelHelpers.extends(ur,{parse:function(e){if(void 0===e.type)throw new Error("track type undefined, can not parse");var t=ur._getTrackTypeForValueTypeName(e.type);if(void 0===e.times){var i=[],r=[];eh.flattenJSON(e.keys,i,r,"value"),e.times=i,e.values=r}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)},toJSON:function(e){var t,i=e.constructor;if(void 0!==i.toJSON)t=i.toJSON(e);else{t={name:e.name,times:eh.convertArray(e.times,Array),values:eh.convertArray(e.values,Array)};var r=e.getInterpolation();r!==e.DefaultInterpolation&&(t.interpolation=r)}return t.type=e.ValueTypeName,t},_getTrackTypeForValueTypeName:function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return sr;case"vector":case"vector2":case"vector3":case"vector4":return nr;case"color":return hr;case"quaternion":return or;case"bool":case"boolean":return lr;case"string":return cr}throw new Error("Unsupported typeName: "+e)}}),babelHelpers.extends(pr,{parse:function(e){for(var t=[],i=e.tracks,r=1/(e.fps||1),n=0,a=i.length;n!==a;++n)t.push(ur.parse(i[n]).scale(r));return new pr(e.name,e.duration,t)},toJSON:function(e){for(var t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t},n=0,a=i.length;n!==a;++n)t.push(ur.toJSON(i[n]));return r},CreateFromMorphTargetSequence:function(e,t,i,r){for(var n=t.length,a=[],o=0;o<n;o++){var s=[],c=[];s.push((o+n-1)%n,o,(o+1)%n),c.push(0,1,0);var l=eh.getKeyframeOrder(s);s=eh.sortedArray(s,1,l),c=eh.sortedArray(c,1,l),r||0!==s[0]||(s.push(n),c.push(c[0])),a.push(new sr(".morphTargetInfluences["+t[o].name+"]",s,c).scale(1/i))}return new pr(e,-1,a)},findByName:function(e,t){var i=e;if(!Array.isArray(e)){var r=e;i=r.geometry&&r.geometry.animations||r.animations}for(var n=0;n<i.length;n++)if(i[n].name===t)return i[n];return null},CreateClipsFromMorphTargetSequences:function(e,t,i){for(var r={},n=/^([\w-]*?)([\d]+)$/,a=0,o=e.length;a<o;a++){var s=e[a],c=s.name.match(n);if(c&&c.length>1){var l=c[1],h=r[l];h||(r[l]=h=[]),h.push(s)}}var u=[];for(var l in r)u.push(pr.CreateFromMorphTargetSequence(l,r[l],t,i));return u},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var i=function(e,t,i,r,n){if(0!==i.length){var a=[],o=[];eh.flattenJSON(i,a,o,r),0!==a.length&&n.push(new e(t,a,o))}},r=[],n=e.name||"default",a=e.length||-1,o=e.fps||30,s=e.hierarchy||[],c=0;c<s.length;c++){var l=s[c].keys;if(l&&0!==l.length)if(l[0].morphTargets){for(var h={},u=0;u<l.length;u++)if(l[u].morphTargets)for(var p=0;p<l[u].morphTargets.length;p++)h[l[u].morphTargets[p]]=-1;for(var d in h){for(var f=[],m=[],p=0;p!==l[u].morphTargets.length;++p){var v=l[u];f.push(v.time),m.push(v.morphTarget===d?1:0)}r.push(new sr(".morphTargetInfluence["+d+"]",f,m))}a=h.length*(o||1)}else{var g=".bones["+t[c].name+"]";i(nr,g+".position",l,"pos",r),i(or,g+".quaternion",l,"rot",r),i(nr,g+".scale",l,"scl",r)}}if(0===r.length)return null;var y=new pr(n,a,r);return y}}),babelHelpers.extends(pr.prototype,{resetDuration:function(){for(var e=this.tracks,t=0,i=0,r=e.length;i!==r;++i){var n=this.tracks[i];t=Math.max(t,n.times[n.times.length-1])}this.duration=t},trim:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this},optimize:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}}),babelHelpers.extends(dr.prototype,{load:function(e,t,i,r){var n=this,a=new Bi(n.manager);a.load(e,function(e){t(n.parse(JSON.parse(e)))},i,r)},setTextures:function(e){this.textures=e},parse:function(e){function t(e){return void 0===r[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),
r[e]}var r=this.textures,n=new Ql[e.type];if(void 0!==e.uuid&&(n.uuid=e.uuid),void 0!==e.name&&(n.name=e.name),void 0!==e.color&&n.color.setHex(e.color),void 0!==e.roughness&&(n.roughness=e.roughness),void 0!==e.metalness&&(n.metalness=e.metalness),void 0!==e.emissive&&n.emissive.setHex(e.emissive),void 0!==e.specular&&n.specular.setHex(e.specular),void 0!==e.shininess&&(n.shininess=e.shininess),void 0!==e.clearCoat&&(n.clearCoat=e.clearCoat),void 0!==e.clearCoatRoughness&&(n.clearCoatRoughness=e.clearCoatRoughness),void 0!==e.uniforms&&(n.uniforms=e.uniforms),void 0!==e.vertexShader&&(n.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(n.fragmentShader=e.fragmentShader),void 0!==e.vertexColors&&(n.vertexColors=e.vertexColors),void 0!==e.fog&&(n.fog=e.fog),void 0!==e.flatShading&&(n.flatShading=e.flatShading),void 0!==e.blending&&(n.blending=e.blending),void 0!==e.side&&(n.side=e.side),void 0!==e.opacity&&(n.opacity=e.opacity),void 0!==e.transparent&&(n.transparent=e.transparent),void 0!==e.alphaTest&&(n.alphaTest=e.alphaTest),void 0!==e.depthTest&&(n.depthTest=e.depthTest),void 0!==e.depthWrite&&(n.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(n.colorWrite=e.colorWrite),void 0!==e.wireframe&&(n.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(n.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(n.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(n.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.skinning&&(n.skinning=e.skinning),void 0!==e.morphTargets&&(n.morphTargets=e.morphTargets),void 0!==e.dithering&&(n.dithering=e.dithering),void 0!==e.visible&&(n.visible=e.visible),void 0!==e.userData&&(n.userData=e.userData),void 0!==e.shading&&(n.flatShading=1===e.shading),void 0!==e.size&&(n.size=e.size),void 0!==e.sizeAttenuation&&(n.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(n.map=t(e.map)),void 0!==e.alphaMap&&(n.alphaMap=t(e.alphaMap),n.transparent=!0),void 0!==e.bumpMap&&(n.bumpMap=t(e.bumpMap)),void 0!==e.bumpScale&&(n.bumpScale=e.bumpScale),void 0!==e.normalMap&&(n.normalMap=t(e.normalMap)),void 0!==e.normalScale){var a=e.normalScale;Array.isArray(a)===!1&&(a=[a,a]),n.normalScale=(new i).fromArray(a)}return void 0!==e.displacementMap&&(n.displacementMap=t(e.displacementMap)),void 0!==e.displacementScale&&(n.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(n.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(n.roughnessMap=t(e.roughnessMap)),void 0!==e.metalnessMap&&(n.metalnessMap=t(e.metalnessMap)),void 0!==e.emissiveMap&&(n.emissiveMap=t(e.emissiveMap)),void 0!==e.emissiveIntensity&&(n.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(n.specularMap=t(e.specularMap)),void 0!==e.envMap&&(n.envMap=t(e.envMap)),void 0!==e.reflectivity&&(n.reflectivity=e.reflectivity),void 0!==e.lightMap&&(n.lightMap=t(e.lightMap)),void 0!==e.lightMapIntensity&&(n.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(n.aoMap=t(e.aoMap)),void 0!==e.aoMapIntensity&&(n.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(n.gradientMap=t(e.gradientMap)),n}}),babelHelpers.extends(fr.prototype,{load:function(e,t,i,r){var n=this,a=new Bi(n.manager);a.load(e,function(e){t(n.parse(JSON.parse(e)))},i,r)},parse:function(e){var t=new Le,i=e.data.index;if(void 0!==i){var r=new ih[i.type](i.array);t.setIndex(new ge(r,1))}var n=e.data.attributes;for(var a in n){var o=n[a],r=new ih[o.type](o.array);t.addAttribute(a,new ge(r,o.itemSize,o.normalized))}var s=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==s)for(var l=0,h=s.length;l!==h;++l){var u=s[l];t.addGroup(u.start,u.count,u.materialIndex)}var p=e.data.boundingSphere;if(void 0!==p){var d=new c;void 0!==p.center&&d.fromArray(p.center),t.boundingSphere=new ie(d,p.radius)}return t}});var ih={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};mr.Handlers={handlers:[],add:function(e,t){this.handlers.push(e,t)},get:function(e){for(var t=this.handlers,i=0,r=t.length;i<r;i+=2){var n=t[i],a=t[i+1];if(n.test(e))return a}return null}},babelHelpers.extends(mr.prototype,{crossOrigin:void 0,extractUrlBase:function(e){var t=e.split("/");return 1===t.length?"./":(t.pop(),t.join("/")+"/")},initMaterials:function(e,t,i){for(var r=[],n=0;n<e.length;++n)r[n]=this.createMaterial(e[n],t,i);return r},createMaterial:function(){var e={NoBlending:Ca,NormalBlending:Ia,AdditiveBlending:Ua,SubtractiveBlending:Na,MultiplyBlending:Da,CustomBlending:Fa},t=new X,i=new Vi,r=new dr;return function(n,a,o){function s(e,t,r,n,s){var l,h=a+e,u=mr.Handlers.get(h);null!==u?l=u.load(h):(i.setCrossOrigin(o),l=i.load(h)),void 0!==t&&(l.repeat.fromArray(t),1!==t[0]&&(l.wrapS=Eo),1!==t[1]&&(l.wrapT=Eo)),void 0!==r&&l.offset.fromArray(r),void 0!==n&&("repeat"===n[0]&&(l.wrapS=Eo),"mirror"===n[0]&&(l.wrapS=So),"repeat"===n[1]&&(l.wrapT=Eo),"mirror"===n[1]&&(l.wrapT=So)),void 0!==s&&(l.anisotropy=s);var p=Ps.generateUUID();return c[p]=l,p}var c={},l={uuid:Ps.generateUUID(),type:"MeshLambertMaterial"};for(var h in n){var u=n[h];switch(h){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":l.name=u;break;case"blending":l.blending=e[u];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",h,"is no longer supported.");break;case"colorDiffuse":l.color=t.fromArray(u).getHex();break;case"colorSpecular":l.specular=t.fromArray(u).getHex();break;case"colorEmissive":l.emissive=t.fromArray(u).getHex();break;case"specularCoef":l.shininess=u;break;case"shading":"basic"===u.toLowerCase()&&(l.type="MeshBasicMaterial"),"phong"===u.toLowerCase()&&(l.type="MeshPhongMaterial"),"standard"===u.toLowerCase()&&(l.type="MeshStandardMaterial");break;case"mapDiffuse":l.map=s(u,n.mapDiffuseRepeat,n.mapDiffuseOffset,n.mapDiffuseWrap,n.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":l.emissiveMap=s(u,n.mapEmissiveRepeat,n.mapEmissiveOffset,n.mapEmissiveWrap,n.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":l.lightMap=s(u,n.mapLightRepeat,n.mapLightOffset,n.mapLightWrap,n.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":l.aoMap=s(u,n.mapAORepeat,n.mapAOOffset,n.mapAOWrap,n.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":l.bumpMap=s(u,n.mapBumpRepeat,n.mapBumpOffset,n.mapBumpWrap,n.mapBumpAnisotropy);break;case"mapBumpScale":l.bumpScale=u;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":l.normalMap=s(u,n.mapNormalRepeat,n.mapNormalOffset,n.mapNormalWrap,n.mapNormalAnisotropy);break;case"mapNormalFactor":l.normalScale=[u,u];break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":l.specularMap=s(u,n.mapSpecularRepeat,n.mapSpecularOffset,n.mapSpecularWrap,n.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":l.metalnessMap=s(u,n.mapMetalnessRepeat,n.mapMetalnessOffset,n.mapMetalnessWrap,n.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":l.roughnessMap=s(u,n.mapRoughnessRepeat,n.mapRoughnessOffset,n.mapRoughnessWrap,n.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":l.alphaMap=s(u,n.mapAlphaRepeat,n.mapAlphaOffset,n.mapAlphaWrap,n.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":l.side=Ea;break;case"doubleSided":l.side=Ta;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),l.opacity=u;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":l[h]=u;break;case"vertexColors":u===!0&&(l.vertexColors=Pa),"face"===u&&(l.vertexColors=La);break;default:console.error("THREE.Loader.createMaterial: Unsupported",h,u)}}return"MeshBasicMaterial"===l.type&&delete l.emissive,"MeshPhongMaterial"!==l.type&&delete l.specular,l.opacity<1&&(l.transparent=!0),r.setTextures(c),r.parse(l)}}()}),babelHelpers.extends(vr.prototype,{load:function(e,t,i,r){var n=this,a=this.texturePath&&"string"==typeof this.texturePath?this.texturePath:mr.prototype.extractUrlBase(e),o=new Bi(this.manager);o.setWithCredentials(this.withCredentials),o.load(e,function(i){var r=JSON.parse(i),o=r.metadata;if(void 0!==o){var s=o.type;if(void 0!==s){if("object"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+e+" should be loaded with THREE.ObjectLoader instead.");if("scene"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+e+" should be loaded with THREE.SceneLoader instead.")}}var c=n.parse(r,a);t(c.geometry,c.materials)},i,r)},setTexturePath:function(e){this.texturePath=e},parse:function(){function e(e,t){function r(e,t){return e&1<<t}var n,a,o,s,l,h,u,p,d,f,m,v,g,y,x,b,_,w,M,E,T,S,A,R,L,P,C,I=e.faces,U=e.vertices,N=e.normals,D=e.colors,F=e.scale,B=0;if(void 0!==e.uvs){for(n=0;n<e.uvs.length;n++)e.uvs[n].length&&B++;for(n=0;n<B;n++)t.faceVertexUvs[n]=[]}for(s=0,l=U.length;s<l;)w=new c,w.x=U[s++]*F,w.y=U[s++]*F,w.z=U[s++]*F,t.vertices.push(w);for(s=0,l=I.length;s<l;)if(f=I[s++],m=r(f,0),v=r(f,1),g=r(f,3),y=r(f,4),x=r(f,5),b=r(f,6),_=r(f,7),m){if(E=new fe,E.a=I[s],E.b=I[s+1],E.c=I[s+3],T=new fe,T.a=I[s+1],T.b=I[s+2],T.c=I[s+3],s+=4,v&&(d=I[s++],E.materialIndex=d,T.materialIndex=d),o=t.faces.length,g)for(n=0;n<B;n++)for(R=e.uvs[n],t.faceVertexUvs[n][o]=[],t.faceVertexUvs[n][o+1]=[],a=0;a<4;a++)p=I[s++],P=R[2*p],C=R[2*p+1],L=new i(P,C),2!==a&&t.faceVertexUvs[n][o].push(L),0!==a&&t.faceVertexUvs[n][o+1].push(L);if(y&&(u=3*I[s++],E.normal.set(N[u++],N[u++],N[u]),T.normal.copy(E.normal)),x)for(n=0;n<4;n++)u=3*I[s++],A=new c(N[u++],N[u++],N[u]),2!==n&&E.vertexNormals.push(A),0!==n&&T.vertexNormals.push(A);if(b&&(h=I[s++],S=D[h],E.color.setHex(S),T.color.setHex(S)),_)for(n=0;n<4;n++)h=I[s++],S=D[h],2!==n&&E.vertexColors.push(new X(S)),0!==n&&T.vertexColors.push(new X(S));t.faces.push(E),t.faces.push(T)}else{if(M=new fe,M.a=I[s++],M.b=I[s++],M.c=I[s++],v&&(d=I[s++],M.materialIndex=d),o=t.faces.length,g)for(n=0;n<B;n++)for(R=e.uvs[n],t.faceVertexUvs[n][o]=[],a=0;a<3;a++)p=I[s++],P=R[2*p],C=R[2*p+1],L=new i(P,C),t.faceVertexUvs[n][o].push(L);if(y&&(u=3*I[s++],M.normal.set(N[u++],N[u++],N[u])),x)for(n=0;n<3;n++)u=3*I[s++],A=new c(N[u++],N[u++],N[u]),M.vertexNormals.push(A);if(b&&(h=I[s++],M.color.setHex(D[h])),_)for(n=0;n<3;n++)h=I[s++],M.vertexColors.push(new X(D[h]));t.faces.push(M)}}function t(e,t){var i=void 0!==e.influencesPerVertex?e.influencesPerVertex:2;if(e.skinWeights)for(var r=0,a=e.skinWeights.length;r<a;r+=i){var o=e.skinWeights[r],s=i>1?e.skinWeights[r+1]:0,c=i>2?e.skinWeights[r+2]:0,l=i>3?e.skinWeights[r+3]:0;t.skinWeights.push(new n(o,s,c,l))}if(e.skinIndices)for(var r=0,a=e.skinIndices.length;r<a;r+=i){var h=e.skinIndices[r],u=i>1?e.skinIndices[r+1]:0,p=i>2?e.skinIndices[r+2]:0,d=i>3?e.skinIndices[r+3]:0;t.skinIndices.push(new n(h,u,p,d))}t.bones=e.bones,t.bones&&t.bones.length>0&&(t.skinWeights.length!==t.skinIndices.length||t.skinIndices.length!==t.vertices.length)&&console.warn("When skinning, number of vertices ("+t.vertices.length+"), skinIndices ("+t.skinIndices.length+"), and skinWeights ("+t.skinWeights.length+") should match.")}function r(e,t){var i=e.scale;if(void 0!==e.morphTargets)for(var r=0,n=e.morphTargets.length;r<n;r++){t.morphTargets[r]={},t.morphTargets[r].name=e.morphTargets[r].name,t.morphTargets[r].vertices=[];for(var a=t.morphTargets[r].vertices,o=e.morphTargets[r].vertices,s=0,l=o.length;s<l;s+=3){var h=new c;h.x=o[s]*i,h.y=o[s+1]*i,h.z=o[s+2]*i,a.push(h)}}if(void 0!==e.morphColors&&e.morphColors.length>0){console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');for(var u=t.faces,p=e.morphColors[0].colors,r=0,n=u.length;r<n;r++)u[r].color.fromArray(p,3*r)}}function a(e,t){var i=[],r=[];void 0!==e.animation&&r.push(e.animation),void 0!==e.animations&&(e.animations.length?r=r.concat(e.animations):r.push(e.animations));for(var n=0;n<r.length;n++){var a=pr.parseAnimation(r[n],t.bones);a&&i.push(a)}if(t.morphTargets){var o=pr.CreateClipsFromMorphTargetSequences(t.morphTargets,10);i=i.concat(o)}i.length>0&&(t.animations=i)}return function(i,n){void 0!==i.data&&(i=i.data),void 0!==i.scale?i.scale=1/i.scale:i.scale=1;var o=new ve;if(e(i,o),t(i,o),r(i,o),a(i,o),o.computeFaceNormals(),o.computeBoundingSphere(),void 0===i.materials||0===i.materials.length)return{geometry:o};var s=mr.prototype.initMaterials(i.materials,n,this.crossOrigin);return{geometry:o,materials:s}}}()}),babelHelpers.extends(gr.prototype,{load:function(e,t,i,r){""===this.texturePath&&(this.texturePath=e.substring(0,e.lastIndexOf("/")+1));var n=this,a=new Bi(n.manager);a.load(e,function(i){var a=null;try{a=JSON.parse(i)}catch(t){return void 0!==r&&r(t),void console.error("THREE:ObjectLoader: Can't parse "+e+".",t.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 "+e+". Use THREE.JSONLoader instead."):void n.parse(a,t)},i,r)},setTexturePath:function(e){this.texturePath=e},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e,t){var i=this.parseGeometries(e.geometries),r=this.parseImages(e.images,function(){void 0!==t&&t(o)}),n=this.parseTextures(e.textures,r),a=this.parseMaterials(e.materials,n),o=this.parseObject(e.object,i,a);return e.animations&&(o.animations=this.parseAnimations(e.animations)),void 0!==e.images&&0!==e.images.length||void 0!==t&&t(o),o},parseGeometries:function(e){var t={};if(void 0!==e)for(var i=new vr,r=new fr,n=0,a=e.length;n<a;n++){var o,s=e[n];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new Jl[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new Jl[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new Jl[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new Jl[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":o=new Jl[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new Jl[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"IcosahedronGeometry":case"OctahedronGeometry":case"TetrahedronGeometry":o=new Jl[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new Jl[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new Jl[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new Jl[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"LatheGeometry":case"LatheBufferGeometry":o=new Jl[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"BufferGeometry":o=r.parse(s);break;case"Geometry":o=i.parse(s,this.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),t[s.uuid]=o}return t},parseMaterials:function(e,t){var i={};if(void 0!==e){var r=new dr;r.setTextures(t);for(var n=0,a=e.length;n<a;n++){var o=e[n];if("MultiMaterial"===o.type){for(var s=[],c=0;c<o.materials.length;c++)s.push(r.parse(o.materials[c]));i[o.uuid]=s}else i[o.uuid]=r.parse(o)}}return i},parseAnimations:function(e){for(var t=[],i=0;i<e.length;i++){var r=pr.parse(e[i]);t.push(r)}return t},parseImages:function(e,t){function i(e){return r.manager.itemStart(e),o.load(e,function(){r.manager.itemEnd(e)},void 0,function(){r.manager.itemEnd(e),r.manager.itemError(e)})}var r=this,n={};if(void 0!==e&&e.length>0){var a=new Fi(t),o=new Hi(a);o.setCrossOrigin(this.crossOrigin);for(var s=0,c=e.length;s<c;s++){var l=e[s],h=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l.url)?l.url:r.texturePath+l.url;n[l.uuid]=i(h)}}return n},parseTextures:function(e,t){function i(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}var n={};if(void 0!==e)for(var a=0,o=e.length;a<o;a++){var s=e[a];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===t[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image);var c=new r(t[s.image]);c.needsUpdate=!0,c.uuid=s.uuid,void 0!==s.name&&(c.name=s.name),void 0!==s.mapping&&(c.mapping=i(s.mapping,rh)),void 0!==s.offset&&c.offset.fromArray(s.offset),void 0!==s.repeat&&c.repeat.fromArray(s.repeat),void 0!==s.wrap&&(c.wrapS=i(s.wrap[0],nh),c.wrapT=i(s.wrap[1],nh)),void 0!==s.minFilter&&(c.minFilter=i(s.minFilter,ah)),void 0!==s.magFilter&&(c.magFilter=i(s.magFilter,ah)),void 0!==s.anisotropy&&(c.anisotropy=s.anisotropy),void 0!==s.flipY&&(c.flipY=s.flipY),n[s.uuid]=c}return n},parseObject:function(){var e=new l;return function(t,i,r){function n(e){return void 0===i[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),i[e]}function a(e){if(void 0!==e){if(Array.isArray(e)){for(var t=[],i=0,n=e.length;i<n;i++){var a=e[i];void 0===r[a]&&console.warn("THREE.ObjectLoader: Undefined material",a),t.push(r[a])}return t}return void 0===r[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),r[e]}}var o;switch(t.type){case"Scene":o=new Tt,void 0!==t.background&&Number.isInteger(t.background)&&(o.background=new X(t.background)),void 0!==t.fog&&("Fog"===t.fog.type?o.fog=new Et(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(o.fog=new Mt(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":o=new de(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(o.focus=t.focus),void 0!==t.zoom&&(o.zoom=t.zoom),void 0!==t.filmGauge&&(o.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(o.filmOffset=t.filmOffset),void 0!==t.view&&(o.view=babelHelpers.extends({},t.view));break;case"OrthographicCamera":o=new pe(t.left,t.right,t.top,t.bottom,t.near,t.far);break;case"AmbientLight":o=new Qi(t.color,t.intensity);break;case"DirectionalLight":o=new Ji(t.color,t.intensity);break;case"PointLight":o=new Yi(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":o=new Ki(t.color,t.intensity,t.width,t.height);break;case"SpotLight":o=new qi(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":o=new Wi(t.color,t.groundColor,t.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var s=n(t.geometry),c=a(t.material);o=s.bones&&s.bones.length>0?new It(s,c):new Oe(s,c);break;case"LOD":o=new Lt;break;case"Line":o=new Nt(n(t.geometry),a(t.material),t.mode);break;case"LineLoop":o=new Ft(n(t.geometry),a(t.material));break;case"LineSegments":o=new Dt(n(t.geometry),a(t.material));break;case"PointCloud":case"Points":o=new Ot(n(t.geometry),a(t.material));break;case"Sprite":o=new Rt(a(t.material));break;case"Group":o=new zt;break;default:o=new he}if(o.uuid=t.uuid,void 0!==t.name&&(o.name=t.name),void 0!==t.matrix?(e.fromArray(t.matrix),e.decompose(o.position,o.quaternion,o.scale)):(void 0!==t.position&&o.position.fromArray(t.position),void 0!==t.rotation&&o.rotation.fromArray(t.rotation),void 0!==t.quaternion&&o.quaternion.fromArray(t.quaternion),void 0!==t.scale&&o.scale.fromArray(t.scale)),void 0!==t.castShadow&&(o.castShadow=t.castShadow),void 0!==t.receiveShadow&&(o.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(o.shadow.bias=t.shadow.bias),void 0!==t.shadow.radius&&(o.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&o.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(o.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(o.visible=t.visible),void 0!==t.userData&&(o.userData=t.userData),void 0!==t.children)for(var l=t.children,h=0;h<l.length;h++)o.add(this.parseObject(l[h],i,r));if("LOD"===t.type)for(var u=t.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 rh={UVMapping:vo,CubeReflectionMapping:go,CubeRefractionMapping:yo,EquirectangularReflectionMapping:xo,EquirectangularRefractionMapping:bo,SphericalReflectionMapping:_o,CubeUVReflectionMapping:wo,CubeUVRefractionMapping:Mo},nh={RepeatWrapping:Eo,ClampToEdgeWrapping:To,MirroredRepeatWrapping:So},ah={NearestFilter:Ao,NearestMipMapNearestFilter:Ro,NearestMipMapLinearFilter:Lo,LinearFilter:Po,LinearMipMapNearestFilter:Co,LinearMipMapLinearFilter:Io};babelHelpers.extends(Rr.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e){var t=this.getUtoTmapping(e);return this.getPoint(t)},getPoints:function(e){void 0===e&&(e=5);for(var t=[],i=0;i<=e;i++)t.push(this.getPoint(i/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);for(var t=[],i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,i,r=[],n=this.getPoint(0),a=0;for(r.push(0),i=1;i<=e;i++)t=this.getPoint(i/e),a+=t.distanceTo(n),r.push(a),n=t;return this.cacheArcLengths=r,r},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var i,r=this.getLengths(),n=0,a=r.length;i=t?t:e*r[a-1];for(var o,s=0,c=a-1;s<=c;)if(n=Math.floor(s+(c-s)/2),o=r[n]-i,o<0)s=n+1;else{if(!(o>0)){c=n;break}c=n-1}if(n=c,r[n]===i)return n/(a-1);var l=r[n],h=r[n+1],u=h-l,p=(i-l)/u,d=(n+p)/(a-1);return d},getTangent:function(e){var t=1e-4,i=e-t,r=e+t;i<0&&(i=0),r>1&&(r=1);var n=this.getPoint(i),a=this.getPoint(r),o=a.clone().sub(n);return o.normalize()},getTangentAt:function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)},computeFrenetFrames:function(e,t){var i,r,n,a=new c,o=[],s=[],h=[],u=new c,p=new l;for(i=0;i<=e;i++)r=i/e,o[i]=this.getTangentAt(r),o[i].normalize();s[0]=new c,h[0]=new c;var d=Number.MAX_VALUE,f=Math.abs(o[0].x),m=Math.abs(o[0].y),v=Math.abs(o[0].z);for(f<=d&&(d=f,a.set(1,0,0)),m<=d&&(d=m,a.set(0,1,0)),v<=d&&a.set(0,0,1),u.crossVectors(o[0],a).normalize(),s[0].crossVectors(o[0],u),h[0].crossVectors(o[0],s[0]),i=1;i<=e;i++)s[i]=s[i-1].clone(),h[i]=h[i-1].clone(),u.crossVectors(o[i-1],o[i]),u.length()>Number.EPSILON&&(u.normalize(),n=Math.acos(Ps.clamp(o[i-1].dot(o[i]),-1,1)),s[i].applyMatrix4(p.makeRotationAxis(u,n))),h[i].crossVectors(o[i],s[i]);if(t===!0)for(n=Math.acos(Ps.clamp(s[0].dot(s[e]),-1,1)),n/=e,o[0].dot(u.crossVectors(s[0],s[e]))>0&&(n=-n),i=1;i<=e;i++)s[i].applyMatrix4(p.makeRotationAxis(o[i],n*i)),h[i].crossVectors(o[i],s[i]);return{tangents:o,normals:s,binormals:h}}}),Lr.prototype=Object.create(Rr.prototype),Lr.prototype.constructor=Lr,Lr.prototype.isLineCurve=!0,Lr.prototype.getPoint=function(e){if(1===e)return this.v2.clone();var t=this.v2.clone().sub(this.v1);return t.multiplyScalar(e).add(this.v1),t},Lr.prototype.getPointAt=function(e){return this.getPoint(e)},Lr.prototype.getTangent=function(e){var t=this.v2.clone().sub(this.v1);return t.normalize()},Pr.prototype=babelHelpers.extends(Object.create(Rr.prototype),{constructor:Pr,add:function(e){this.curves.push(e)},closePath:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Lr(t,e))},getPoint:function(e){for(var t=e*this.getLength(),i=this.getCurveLengths(),r=0;r<i.length;){if(i[r]>=t){var n=i[r]-t,a=this.curves[r],o=a.getLength(),s=0===o?0:1-n/o;return a.getPointAt(s)}r++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.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 e=[],t=0,i=0,r=this.curves.length;i<r;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e},getSpacedPoints:function(e){void 0===e&&(e=40);for(var t=[],i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t},getPoints:function(e){e=e||12;for(var t,i=[],r=0,n=this.curves;r<n.length;r++)for(var a=n[r],o=a&&a.isEllipseCurve?2*e:a&&a.isLineCurve?1:a&&a.isSplineCurve?e*a.points.length:e,s=a.getPoints(o),c=0;c<s.length;c++){var l=s[c];t&&t.equals(l)||(i.push(l),t=l)}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},createPointsGeometry:function(e){var t=this.getPoints(e);return this.createGeometry(t)},createSpacedPointsGeometry:function(e){var t=this.getSpacedPoints(e);return this.createGeometry(t)},createGeometry:function(e){for(var t=new ve,i=0,r=e.length;i<r;i++){var n=e[i];t.vertices.push(new c(n.x,n.y,n.z||0))}return t}}),Cr.prototype=Object.create(Rr.prototype),Cr.prototype.constructor=Cr,Cr.prototype.isEllipseCurve=!0,Cr.prototype.getPoint=function(e){for(var t=2*Math.PI,r=this.aEndAngle-this.aStartAngle,n=Math.abs(r)<Number.EPSILON;r<0;)r+=t;for(;r>t;)r-=t;r<Number.EPSILON&&(r=n?0:t),this.aClockwise!==!0||n||(r===t?r=-t:r-=t);var a=this.aStartAngle+e*r,o=this.aX+this.xRadius*Math.cos(a),s=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){var c=Math.cos(this.aRotation),l=Math.sin(this.aRotation),h=o-this.aX,u=s-this.aY;o=h*c-u*l+this.aX,s=h*l+u*c+this.aY}return new i(o,s)},Ir.prototype=Object.create(Rr.prototype),Ir.prototype.constructor=Ir,Ir.prototype.isSplineCurve=!0,Ir.prototype.getPoint=function(e){var t=this.points,r=(t.length-1)*e,n=Math.floor(r),a=r-n,o=t[0===n?n:n-1],s=t[n],c=t[n>t.length-2?t.length-1:n+1],l=t[n>t.length-3?t.length-1:n+2];return new i(yr(a,o.x,s.x,c.x,l.x),yr(a,o.y,s.y,c.y,l.y))},Ur.prototype=Object.create(Rr.prototype),Ur.prototype.constructor=Ur,Ur.prototype.getPoint=function(e){var t=this.v0,r=this.v1,n=this.v2,a=this.v3;return new i(Ar(e,t.x,r.x,n.x,a.x),Ar(e,t.y,r.y,n.y,a.y))},Nr.prototype=Object.create(Rr.prototype),Nr.prototype.constructor=Nr,Nr.prototype.getPoint=function(e){var t=this.v0,r=this.v1,n=this.v2;return new i(wr(e,t.x,r.x,n.x),wr(e,t.y,r.y,n.y))};var oh=babelHelpers.extends(Object.create(Pr.prototype),{fromPoints:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,i=e.length;t<i;t++)this.lineTo(e[t].x,e[t].y)},moveTo:function(e,t){this.currentPoint.set(e,t)},lineTo:function(e,t){var r=new Lr(this.currentPoint.clone(),new i(e,t));this.curves.push(r),this.currentPoint.set(e,t)},quadraticCurveTo:function(e,t,r,n){var a=new Nr(this.currentPoint.clone(),new i(e,t),new i(r,n));this.curves.push(a),this.currentPoint.set(r,n)},bezierCurveTo:function(e,t,r,n,a,o){var s=new Ur(this.currentPoint.clone(),new i(e,t),new i(r,n),new i(a,o));this.curves.push(s),this.currentPoint.set(a,o)},splineThru:function(e){var t=[this.currentPoint.clone()].concat(e),i=new Ir(t);this.curves.push(i),this.currentPoint.copy(e[e.length-1])},arc:function(e,t,i,r,n,a){var o=this.currentPoint.x,s=this.currentPoint.y;this.absarc(e+o,t+s,i,r,n,a)},absarc:function(e,t,i,r,n,a){this.absellipse(e,t,i,i,r,n,a)},ellipse:function(e,t,i,r,n,a,o,s){var c=this.currentPoint.x,l=this.currentPoint.y;this.absellipse(e+c,t+l,i,r,n,a,o,s)},absellipse:function(e,t,i,r,n,a,o,s){var c=new Cr(e,t,i,r,n,a,o,s);if(this.curves.length>0){var l=c.getPoint(0);l.equals(this.currentPoint)||this.lineTo(l.x,l.y)}this.curves.push(c);var h=c.getPoint(1);this.currentPoint.copy(h)}});Dr.prototype=oh,oh.constructor=Dr,Fr.prototype=babelHelpers.extends(Object.create(oh),{constructor:Fr,getPointsHoles:function(e){for(var t=[],i=0,r=this.holes.length;i<r;i++)t[i]=this.holes[i].getPoints(e);return t},extractAllPoints:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}},extractPoints:function(e){return this.extractAllPoints(e)}}),babelHelpers.extends(Br.prototype,{moveTo:function(e,t){this.currentPath=new Dr,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t)},lineTo:function(e,t){this.currentPath.lineTo(e,t)},quadraticCurveTo:function(e,t,i,r){this.currentPath.quadraticCurveTo(e,t,i,r)},bezierCurveTo:function(e,t,i,r,n,a){this.currentPath.bezierCurveTo(e,t,i,r,n,a)},splineThru:function(e){this.currentPath.splineThru(e)},toShapes:function(e,t){function i(e){for(var t=[],i=0,r=e.length;i<r;i++){var n=e[i],a=new Fr;a.curves=n.curves,t.push(a)}return t}function r(e,t){for(var i=t.length,r=!1,n=i-1,a=0;a<i;n=a++){var o=t[n],s=t[a],c=s.x-o.x,l=s.y-o.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(o=t[a],c=-c,s=t[n],l=-l),e.y<o.y||e.y>s.y)continue;if(e.y===o.y){if(e.x===o.x)return!0}else{var h=l*(e.x-o.x)-c*(e.y-o.y);if(0===h)return!0;if(h<0)continue;r=!r}}else{if(e.y!==o.y)continue;if(s.x<=e.x&&e.x<=o.x||o.x<=e.x&&e.x<=s.x)return!0}}return r}var n=Zl.isClockWise,a=this.subPaths;if(0===a.length)return[];if(t===!0)return i(a);var o,s,c,l=[];if(1===a.length)return s=a[0],c=new Fr,c.curves=s.curves,l.push(c),l;var h=!n(a[0].getPoints());h=e?!h:h;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=n(u),o=e?!o:o,o?(!h&&d[m]&&m++,d[m]={s:new Fr,p:u},d[m].s.curves=s.curves,h&&m++,f[m]=[]):f[m].push({h:s,p:u[0]});if(!d[0])return i(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++)r(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,l.push(c),A=f[v];for(var L=0,P=A.length;L<P;L++)c.holes.push(A[L].h)}return l}}),babelHelpers.extends(Or.prototype,{isFont:!0,generateShapes:function(e,t,i){function r(e){for(var i=String(e).split(""),r=t/a.resolution,o=(a.boundingBox.yMax-a.boundingBox.yMin+a.underlineThickness)*r,s=0,c=0,l=[],h=0;h<i.length;h++){var u=i[h];if("\n"===u)s=0,c-=o;else{var p=n(u,r,s,c);s+=p.offsetX,l.push(p.path)}}return l}function n(e,t,r,n){var o=a.glyphs[e]||a.glyphs["?"];if(o){var s,c,l,h,u,p,d,f,m,v,g,y=new Br,x=[];if(o.o)for(var b=o._cachedOutline||(o._cachedOutline=o.o.split(" ")),_=0,w=b.length;_<w;){var M=b[_++];switch(M){case"m":s=b[_++]*t+r,c=b[_++]*t+n,y.moveTo(s,c);break;case"l":s=b[_++]*t+r,c=b[_++]*t+n,y.lineTo(s,c);break;case"q":if(l=b[_++]*t+r,h=b[_++]*t+n,d=b[_++]*t+r,f=b[_++]*t+n,y.quadraticCurveTo(d,f,l,h),g=x[x.length-1]){u=g.x,p=g.y;for(var E=1;E<=i;E++){var T=E/i;wr(T,u,d,l),wr(T,p,f,h)}}break;case"b":if(l=b[_++]*t+r,h=b[_++]*t+n,d=b[_++]*t+r,f=b[_++]*t+n,m=b[_++]*t+r,v=b[_++]*t+n,y.bezierCurveTo(d,f,m,v,l,h),g=x[x.length-1]){u=g.x,p=g.y;for(var E=1;E<=i;E++){var T=E/i;Ar(T,u,d,m,l),Ar(T,p,f,v,h)}}}}return{offsetX:o.ha*t,path:y}}}void 0===t&&(t=100),void 0===i&&(i=4);for(var a=this.data,o=r(e),s=[],c=0,l=o.length;c<l;c++)Array.prototype.push.apply(s,o[c].toShapes());return s}}),babelHelpers.extends(zr.prototype,{load:function(e,t,i,r){var n=this,a=new Bi(this.manager);
a.load(e,function(e){var i;try{i=JSON.parse(e)}catch(t){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),i=JSON.parse(e.substring(65,e.length-2))}var r=n.parse(i);t&&t(r)},i,r)},parse:function(e){return new Or(e)}});var sh,ch={getContext:function(){return void 0===sh&&(sh=new(window.AudioContext||window.webkitAudioContext)),sh},setContext:function(e){sh=e}};babelHelpers.extends(Hr.prototype,{load:function(e,t,i,r){var n=new Bi(this.manager);n.setResponseType("arraybuffer"),n.load(e,function(e){var i=ch.getContext();i.decodeAudioData(e,function(e){t(e)})},i,r)}}),babelHelpers.extends(Gr.prototype,{update:function(){var e,t,i,r,n,a,o,s,c=new l,h=new l;return function(l){var u=e!==this||t!==l.focus||i!==l.fov||r!==l.aspect*this.aspect||n!==l.near||a!==l.far||o!==l.zoom||s!==this.eyeSep;if(u){e=this,t=l.focus,i=l.fov,r=l.aspect*this.aspect,n=l.near,a=l.far,o=l.zoom;var p=l.projectionMatrix.clone();s=this.eyeSep/2;var d,f,m=s*n/t,v=n*Math.tan(Ps.DEG2RAD*i*.5)/o;h.elements[12]=-s,c.elements[12]=s,d=-v*r+m,f=v*r+m,p.elements[0]=2*n/(f-d),p.elements[8]=(f+d)/(f-d),this.cameraL.projectionMatrix.copy(p),d=-v*r-m,f=v*r-m,p.elements[0]=2*n/(f-d),p.elements[8]=(f+d)/(f-d),this.cameraR.projectionMatrix.copy(p)}this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(h),this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(c)}}()}),Vr.prototype=Object.create(he.prototype),Vr.prototype.constructor=Vr,kr.prototype=babelHelpers.extends(Object.create(he.prototype),{constructor:kr,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(e){null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination)},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(e){this.gain.gain.value=e},updateMatrixWorld:function(){var e=new c,t=new s,i=new c,r=new c;return function(n){he.prototype.updateMatrixWorld.call(this,n);var a=this.context.listener,o=this.up;this.matrixWorld.decompose(e,t,i),r.set(0,0,-1).applyQuaternion(t),a.positionX?(a.positionX.setValueAtTime(e.x,this.context.currentTime),a.positionY.setValueAtTime(e.y,this.context.currentTime),a.positionZ.setValueAtTime(e.z,this.context.currentTime),a.forwardX.setValueAtTime(r.x,this.context.currentTime),a.forwardY.setValueAtTime(r.y,this.context.currentTime),a.forwardZ.setValueAtTime(r.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(e.x,e.y,e.z),a.setOrientation(r.x,r.y,r.z,o.x,o.y,o.z))}}()}),Wr.prototype=babelHelpers.extends(Object.create(he.prototype),{constructor:Wr,getOutput:function(){return this.gain},setNodeSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this},setBuffer:function(e){return this.buffer=e,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 e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.onended=this.onEnded.bind(this),e.playbackRate.setValueAtTime(this.playbackRate,this.startTime),e.start(0,this.startTime),this.isPlaying=!0,this.source=e,this.connect()},pause:function(){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):(this.source.stop(),this.startTime=this.context.currentTime,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.startTime=0,this.isPlaying=!1,this)},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);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 e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(e){return e||(e=[]),this.isPlaying===!0?(this.disconnect(),this.filters=e,this.connect()):this.filters=e,this},getFilter:function(){return this.getFilters()[0]},setFilter:function(e){return this.setFilters(e?[e]:[])},setPlaybackRate:function(e){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):(this.playbackRate=e,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(e){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):(this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this)},getVolume:function(){return this.gain.gain.value},setVolume:function(e){return this.gain.gain.value=e,this}}),jr.prototype=babelHelpers.extends(Object.create(Wr.prototype),{constructor:jr,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(e){this.panner.refDistance=e},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(e){this.panner.rolloffFactor=e},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(e){this.panner.distanceModel=e},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(e){this.panner.maxDistance=e},updateMatrixWorld:function(){var e=new c;return function(t){he.prototype.updateMatrixWorld.call(this,t),e.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(e.x,e.y,e.z)}}()}),babelHelpers.extends(Xr.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var e=0,t=this.getFrequencyData(),i=0;i<t.length;i++)e+=t[i];return e/t.length}}),babelHelpers.extends(qr.prototype,{accumulate:function(e,t){var i=this.buffer,r=this.valueSize,n=e*r+r,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==r;++o)i[n+o]=i[o];a=t}else{a+=t;var s=t/a;this._mixBufferRegion(i,n,0,s,r)}this.cumulativeWeight=a},apply:function(e){var t=this.valueSize,i=this.buffer,r=e*t+t,n=this.cumulativeWeight,a=this.binding;if(this.cumulativeWeight=0,n<1){var o=3*t;this._mixBufferRegion(i,r,o,1-n,t)}for(var s=t,c=t+t;s!==c;++s)if(i[s]!==i[s+t]){a.setValue(i,r);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,i=this.valueSize,r=3*i;e.getValue(t,r);for(var n=i,a=r;n!==a;++n)t[n]=t[r+n%i];this.cumulativeWeight=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_select:function(e,t,i,r,n){if(r>=.5)for(var a=0;a!==n;++a)e[t+a]=e[i+a]},_slerp:function(e,t,i,r){s.slerpFlat(e,t,e,t,e,i,r)},_lerp:function(e,t,i,r,n){for(var a=1-r,o=0;o!==n;++o){var s=t+o;e[s]=e[s]*a+e[i+o]*r}}}),babelHelpers.extends(Yr.prototype,{getValue:function(e,t){this.bind();var i=this._targetGroup.nCachedObjects_,r=this._bindings[i];void 0!==r&&r.getValue(e,t)},setValue:function(e,t){for(var i=this._bindings,r=this._targetGroup.nCachedObjects_,n=i.length;r!==n;++r)i[r].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}),babelHelpers.extends(Zr,{Composite:Yr,create:function(e,t,i){return e&&e.isAnimationObjectGroup?new Zr.Composite(e,t,i):new Zr(e,t,i)},sanitizeNodeName:function(e){return e.replace(/\s/g,"_").replace(/[^\w-]/g,"")},parseTrackName:function(){var e=/((?:[\w-]+[\/:])*)/,t=/([\w-\.]+)?/,i=/(?:\.([\w-]+)(?:\[(.+)\])?)?/,r=/\.([\w-]+)(?:\[(.+)\])?/,n=new RegExp("^"+e.source+t.source+i.source+r.source+"$"),a=["material","materials","bones"];return function(e){var t=n.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==r&&r!==-1){var o=i.nodeName.substring(r+1);a.indexOf(o)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=o)}if(null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}}(),findNode:function(e,t){if(!t||""===t||"root"===t||"."===t||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){var i=function(e){for(var i=0;i<e.bones.length;i++){var r=e.bones[i];if(r.name===t)return r}return null},r=i(e.skeleton);if(r)return r}if(e.children){var n=function e(i){for(var r=0;r<i.length;r++){var n=i[r];if(n.name===t||n.uuid===t)return n;var a=e(n.children);if(a)return a}return null},a=n(e.children);if(a)return a}return null}}),babelHelpers.extends(Zr.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(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var i=this.resolvedProperty,r=0,n=i.length;r!==n;++r)e[t++]=i[r]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.node[this.propertyName]=e[t]},function(e,t){this.node[this.propertyName]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.node[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){for(var i=this.resolvedProperty,r=0,n=i.length;r!==n;++r)i[r]=e[t++]},function(e,t){for(var i=this.resolvedProperty,r=0,n=i.length;r!==n;++r)i[r]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var i=this.resolvedProperty,r=0,n=i.length;r!==n;++r)i[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,i=t.objectName,r=t.propertyName,n=t.propertyIndex;if(e||(e=Zr.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(i){var a=t.objectIndex;switch(i){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(var o=0;o<e.length;o++)if(e[o].name===a){a=o;break}break;default:if(void 0===e[i])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[i]}if(void 0!==a){if(void 0===e[a])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[a]}}var s=e[r];if(void 0===s){var c=t.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+r+" but it wasn't found.",e)}var l=this.Versioning.None;void 0!==e.needsUpdate?(l=this.Versioning.NeedsUpdate,this.targetObject=e):void 0!==e.matrixWorldNeedsUpdate&&(l=this.Versioning.MatrixWorldNeedsUpdate,this.targetObject=e);var h=this.BindingType.Direct;if(void 0!==n){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(e.geometry.isBufferGeometry){if(!e.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(e.geometry.morphAttributes.position[o].name===n){n=o;break}}else{if(!e.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(e.geometry.morphTargets[o].name===n){n=o;break}}}h=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=n}else void 0!==s.fromArray&&void 0!==s.toArray?(h=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(h=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[h],this.setValue=this.SetterByBindingTypeAndVersioning[h][l]},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),babelHelpers.extends(Zr.prototype,{_getValue_unbound:Zr.prototype.getValue,_setValue_unbound:Zr.prototype.setValue}),babelHelpers.extends(Jr.prototype,{isAnimationObjectGroup:!0,add:function(e){for(var t=this._objects,i=t.length,r=this.nCachedObjects_,n=this._indicesByUUID,a=this._paths,o=this._parsedPaths,s=this._bindings,c=s.length,l=0,h=arguments.length;l!==h;++l){var u=arguments[l],p=u.uuid,d=n[p],f=void 0;if(void 0===d){d=i++,n[p]=d,t.push(u);for(var m=0,v=c;m!==v;++m)s[m].push(new Zr(u,a[m],o[m]))}else if(d<r){f=t[d];var g=--r,y=t[g];n[y.uuid]=d,t[d]=y,n[p]=g,t[g]=u;for(var m=0,v=c;m!==v;++m){var x=s[m],b=x[g],_=x[d];x[d]=b,void 0===_&&(_=new Zr(u,a[m],o[m])),x[g]=_}}else t[d]!==f&&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(e){for(var t=this._objects,i=this.nCachedObjects_,r=this._indicesByUUID,n=this._bindings,a=n.length,o=0,s=arguments.length;o!==s;++o){var c=arguments[o],l=c.uuid,h=r[l];if(void 0!==h&&h>=i){var u=i++,p=t[u];r[p.uuid]=h,t[h]=p,r[l]=u,t[u]=c;for(var d=0,f=a;d!==f;++d){var m=n[d],v=m[u],g=m[h];m[h]=v,m[u]=g}}}this.nCachedObjects_=i},uncache:function(e){for(var t=this._objects,i=t.length,r=this.nCachedObjects_,n=this._indicesByUUID,a=this._bindings,o=a.length,s=0,c=arguments.length;s!==c;++s){var l=arguments[s],h=l.uuid,u=n[h];if(void 0!==u)if(delete n[h],u<r){var p=--r,d=t[p],f=--i,m=t[f];n[d.uuid]=u,t[u]=d,n[m.uuid]=p,t[p]=m,t.pop();for(var v=0,g=o;v!==g;++v){var y=a[v],x=y[p],b=y[f];y[u]=x,y[p]=b,y.pop()}}else{var f=--i,m=t[f];n[m.uuid]=u,t[u]=m,t.pop();for(var v=0,g=o;v!==g;++v){var y=a[v];y[u]=y[f],y.pop()}}}this.nCachedObjects_=r},subscribe_:function(e,t){var i=this._bindingsIndicesByPath,r=i[e],n=this._bindings;if(void 0!==r)return n[r];var a=this._paths,o=this._parsedPaths,s=this._objects,c=s.length,l=this.nCachedObjects_,h=new Array(c);r=n.length,i[e]=r,a.push(e),o.push(t),n.push(h);for(var u=l,p=s.length;u!==p;++u){var d=s[u];h[u]=new Zr(d,e,t)}return h},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,i=t[e];if(void 0!==i){var r=this._paths,n=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o],c=e[o];t[c]=i,a[i]=s,a.pop(),n[i]=n[o],n.pop(),r[i]=r[o],r.pop()}}}),babelHelpers.extends(Qr.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(e){return this._startTime=e,this},setLoop:function(e,t){return this.loop=e,this.repetitions=t,this},setEffectiveWeight:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(e){return this._scheduleFading(e,0,1)},fadeOut:function(e){return this._scheduleFading(e,1,0)},crossFadeFrom:function(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){var r=this._clip.duration,n=e._clip.duration,a=n/r,o=r/n;e.warp(1,a,t),this.warp(o,1,t)}return this},crossFadeTo:function(e,t,i){return e.crossFadeFrom(this,t,i)},stopFading:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},setEffectiveTimeScale:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()},syncWith:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()},halt:function(e){return this.warp(this._effectiveTimeScale,0,e)},warp:function(e,t,i){var r=this._mixer,n=r.time,a=this._timeScaleInterpolant,o=this.timeScale;null===a&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,c=a.sampleValues;return s[0]=n,s[1]=n+i,c[0]=e/o,c[1]=t/o,this},stopWarping:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(e,t,i,r){if(!this.enabled)return void this._updateWeight(e);var n=this._startTime;if(null!==n){var a=(e-n)*i;if(a<0||0===i)return;this._startTime=null,t=i*a}t*=this._updateTimeScale(e);var o=this._updateTime(t),s=this._updateWeight(e);if(s>0)for(var c=this._interpolants,l=this._propertyBindings,h=0,u=c.length;h!==u;++h)c[h].evaluate(o),l[h].accumulate(r,s)},_updateWeight:function(e){var t=0;if(this.enabled){t=this.weight;var i=this._weightInterpolant;if(null!==i){var r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var i=this._timeScaleInterpolant;if(null!==i){var r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t},_updateTime:function(e){var t=this.time+e;if(0===e)return t;var i=this._clip.duration,r=this.loop,n=this._loopCount;if(r===cs){n===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(t>=i)t=i;else{if(!(t<0))break e;t=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{var a=r===hs;if(n===-1&&(e>=0?(n=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),t>=i||t<0){var o=Math.floor(t/i);t-=i*o,n+=Math.abs(o);var s=this.repetitions-n;if(s<0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,t=e>0?i:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(0===s){var c=e<0;this._setEndings(c,!c,a)}else this._setEndings(!1,!1,a);this._loopCount=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}if(a&&1===(1&n))return this.time=t,i-t}return this.time=t,t},_setEndings:function(e,t,i){var r=this._interpolantSettings;i?(r.endingStart=ms,r.endingEnd=ms):(e?r.endingStart=this.zeroSlopeAtStart?ms:fs:r.endingStart=vs,t?r.endingEnd=this.zeroSlopeAtEnd?ms:fs:r.endingEnd=vs)},_scheduleFading:function(e,t,i){var r=this._mixer,n=r.time,a=this._weightInterpolant;null===a&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=n,s[0]=t,o[1]=n+e,s[1]=i,this}}),babelHelpers.extends(Kr.prototype,t.prototype,{_bindAction:function(e,t){var i=e._localRoot||this._root,r=e._clip.tracks,n=r.length,a=e._propertyBindings,o=e._interpolants,s=i.uuid,c=this._bindingsByRootAndName,l=c[s];void 0===l&&(l={},c[s]=l);for(var h=0;h!==n;++h){var u=r[h],p=u.name,d=l[p];if(void 0!==d)a[h]=d;else{if(d=a[h],void 0!==d){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,p));continue}var f=t&&t._propertyBindings[h].binding.parsedPath;d=new qr(Zr.create(i,p,f),u.ValueTypeName,u.getValueSize()),++d.referenceCount,this._addInactiveBinding(d,s,p),a[h]=d}o[h].resultBuffer=d.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,i=e._clip.uuid,r=this._actionsByClip[i];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,i,t)}for(var n=e._propertyBindings,a=0,o=n.length;a!==o;++a){var s=n[a];0===s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,i=0,r=t.length;i!==r;++i){var n=t[i];0===--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return null!==t&&t<this._nActiveActions},_addInactiveAction:function(e,t,i){var r=this._actions,n=this._actionsByClip,a=n[t];if(void 0===a)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,n[t]=a;else{var o=a.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=r.length,r.push(e),a.actionByRoot[i]=e},_removeInactiveAction:function(e){var t=this._actions,i=t[t.length-1],r=e._cacheIndex;i._cacheIndex=r,t[r]=i,t.pop(),e._cacheIndex=null;var n=e._clip.uuid,a=this._actionsByClip,o=a[n],s=o.knownActions,c=s[s.length-1],l=e._byClipCacheIndex;c._byClipCacheIndex=l,s[l]=c,s.pop(),e._byClipCacheIndex=null;var h=o.actionByRoot,u=(e._localRoot||this._root).uuid;delete h[u],0===s.length&&delete a[n],this._removeInactiveBindingsForAction(e)},_removeInactiveBindingsForAction:function(e){for(var t=e._propertyBindings,i=0,r=t.length;i!==r;++i){var n=t[i];0===--n.referenceCount&&this._removeInactiveBinding(n)}},_lendAction:function(e){var t=this._actions,i=e._cacheIndex,r=this._nActiveActions++,n=t[r];e._cacheIndex=r,t[r]=e,n._cacheIndex=i,t[i]=n},_takeBackAction:function(e){var t=this._actions,i=e._cacheIndex,r=--this._nActiveActions,n=t[r];e._cacheIndex=r,t[r]=e,n._cacheIndex=i,t[i]=n},_addInactiveBinding:function(e,t,i){var r=this._bindingsByRootAndName,n=r[t],a=this._bindings;void 0===n&&(n={},r[t]=n),n[i]=e,e._cacheIndex=a.length,a.push(e)},_removeInactiveBinding:function(e){var t=this._bindings,i=e.binding,r=i.rootNode.uuid,n=i.path,a=this._bindingsByRootAndName,o=a[r],s=t[t.length-1],c=e._cacheIndex;s._cacheIndex=c,t[c]=s,t.pop(),delete o[n];e:{for(var l in o)break e;delete a[r]}},_lendBinding:function(e){var t=this._bindings,i=e._cacheIndex,r=this._nActiveBindings++,n=t[r];e._cacheIndex=r,t[r]=e,n._cacheIndex=i,t[i]=n},_takeBackBinding:function(e){var t=this._bindings,i=e._cacheIndex,r=--this._nActiveBindings,n=t[r];e._cacheIndex=r,t[r]=e,n._cacheIndex=i,t[i]=n},_lendControlInterpolant:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,i=e[t];return void 0===i&&(i=new tr(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),i.__cacheIndex=t,e[t]=i),i},_takeBackControlInterpolant:function(e){var t=this._controlInterpolants,i=e.__cacheIndex,r=--this._nActiveControlInterpolants,n=t[r];e.__cacheIndex=r,t[r]=e,n.__cacheIndex=i,t[i]=n},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(e,t){var i=t||this._root,r=i.uuid,n="string"==typeof e?pr.findByName(i,e):e,a=null!==n?n.uuid:e,o=this._actionsByClip[a],s=null;if(void 0!==o){var c=o.actionByRoot[r];if(void 0!==c)return c;s=o.knownActions[0],null===n&&(n=s._clip)}if(null===n)return null;var l=new Qr(this,n,t);return this._bindAction(l,s),this._addInactiveAction(l,a,r),l},existingAction:function(e,t){var i=t||this._root,r=i.uuid,n="string"==typeof e?pr.findByName(i,e):e,a=n?n.uuid:e,o=this._actionsByClip[a];return void 0!==o?o.actionByRoot[r]||null:null},stopAllAction:function(){var e=this._actions,t=this._nActiveActions,i=this._bindings,r=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var n=0;n!==t;++n)e[n].reset();for(var n=0;n!==r;++n)i[n].useCount=0;return this},update:function(e){e*=this.timeScale;for(var t=this._actions,i=this._nActiveActions,r=this.time+=e,n=Math.sign(e),a=this._accuIndex^=1,o=0;o!==i;++o){var s=t[o];s._update(r,e,n,a)}for(var c=this._bindings,l=this._nActiveBindings,o=0;o!==l;++o)c[o].apply(a);return this},getRoot:function(){return this._root},uncacheClip:function(e){var t=this._actions,i=e.uuid,r=this._actionsByClip,n=r[i];if(void 0!==n){for(var a=n.knownActions,o=0,s=a.length;o!==s;++o){var c=a[o];this._deactivateAction(c);var l=c._cacheIndex,h=t[t.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,h._cacheIndex=l,t[l]=h,t.pop(),this._removeInactiveBindingsForAction(c)}delete r[i]}},uncacheRoot:function(e){var t=e.uuid,i=this._actionsByClip;for(var r in i){var n=i[r].actionByRoot,a=n[t];void 0!==a&&(this._deactivateAction(a),this._removeInactiveAction(a))}var o=this._bindingsByRootAndName,s=o[t];if(void 0!==s)for(var c in s){var l=s[c];l.restoreOriginalState(),this._removeInactiveBinding(l)}},uncacheAction:function(e,t){var i=this.existingAction(e,t);null!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}}),$r.prototype.clone=function(){return new $r(void 0===this.value.clone?this.value:this.value.clone())},en.prototype=babelHelpers.extends(Object.create(Le.prototype),{constructor:en,isInstancedBufferGeometry:!0,addGroup:function(e,t,i){this.groups.push({start:e,count:t,materialIndex:i})},copy:function(e){var t=e.index;null!==t&&this.setIndex(t.clone());var i=e.attributes;for(var r in i){var n=i[r];this.addAttribute(r,n.clone())}for(var a=e.groups,o=0,s=a.length;o<s;o++){var c=a[o];this.addGroup(c.start,c.count,c.materialIndex)}return this}}),Object.defineProperties(tn.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),babelHelpers.extends(tn.prototype,{isInterleavedBufferAttribute:!0,setX:function(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this},setY:function(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this},setZ:function(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this},setW:function(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this},getX:function(e){return this.data.array[e*this.data.stride+this.offset]},getY:function(e){return this.data.array[e*this.data.stride+this.offset+1]},getZ:function(e){return this.data.array[e*this.data.stride+this.offset+2]},getW:function(e){return this.data.array[e*this.data.stride+this.offset+3]},setXY:function(e,t,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this},setXYZ:function(e,t,i,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this},setXYZW:function(e,t,i,r,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this.data.array[e+3]=n,this}}),Object.defineProperty(rn.prototype,"needsUpdate",{set:function(e){e===!0&&this.version++}}),babelHelpers.extends(rn.prototype,{isInterleavedBuffer:!0,setArray:function(e){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==e?e.length/this.stride:0,this.array=e},setDynamic:function(e){return this.dynamic=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.dynamic=e.dynamic,this},copyAt:function(e,t,i){e*=this.stride,i*=t.stride;for(var r=0,n=this.stride;r<n;r++)this.array[e+r]=t.array[i+r];return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(e){return this.onUploadCallback=e,this}}),nn.prototype=babelHelpers.extends(Object.create(rn.prototype),{constructor:nn,isInstancedInterleavedBuffer:!0,copy:function(e){return rn.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}}),an.prototype=babelHelpers.extends(Object.create(ge.prototype),{constructor:an,isInstancedBufferAttribute:!0,copy:function(e){return ge.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}}),babelHelpers.extends(on.prototype,{linePrecision:1,set:function(e,t){this.ray.set(e,t)},setFromCamera:function(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize()):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(e,t){var i=[];return cn(e,this,i,t),i.sort(sn),i},intersectObjects:function(e,t){var i=[];if(Array.isArray(e)===!1)return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(var r=0,n=e.length;r<n;r++)cn(e[r],this,i,t);return i.sort(sn),i}}),babelHelpers.extends(ln.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 e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var t=("undefined"==typeof performance?Date:performance).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}),babelHelpers.extends(hn.prototype,{set:function(e,t,i){return this.radius=e,this.phi=t,this.theta=i,this},clone:function(){return(new this.constructor).copy(this);
},copy:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this},makeSafe:function(){var e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),this},setFromVector3:function(e){return this.radius=e.length(),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e.x,e.z),this.phi=Math.acos(Ps.clamp(e.y/this.radius,-1,1))),this}}),babelHelpers.extends(un.prototype,{set:function(e,t,i){return this.radius=e,this.theta=t,this.y=i,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this},setFromVector3:function(e){return this.radius=Math.sqrt(e.x*e.x+e.z*e.z),this.theta=Math.atan2(e.x,e.z),this.y=e.y,this}}),pn.prototype=Object.create(he.prototype),pn.prototype.constructor=pn,pn.prototype.isImmediateRenderObject=!0,dn.prototype=Object.create(Dt.prototype),dn.prototype.constructor=dn,dn.prototype.update=function(){var e=new c,t=new c,i=new re;return function(){var r=["a","b","c"];this.object.updateMatrixWorld(!0),i.getNormalMatrix(this.object.matrixWorld);var n=this.object.matrixWorld,a=this.geometry.attributes.position,o=this.object.geometry;if(o&&o.isGeometry)for(var s=o.vertices,c=o.faces,l=0,h=0,u=c.length;h<u;h++)for(var p=c[h],d=0,f=p.vertexNormals.length;d<f;d++){var m=s[p[r[d]]],v=p.vertexNormals[d];e.copy(m).applyMatrix4(n),t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),a.setXYZ(l,e.x,e.y,e.z),l+=1,a.setXYZ(l,t.x,t.y,t.z),l+=1}else if(o&&o.isBufferGeometry)for(var g=o.attributes.position,y=o.attributes.normal,l=0,d=0,f=g.count;d<f;d++)e.set(g.getX(d),g.getY(d),g.getZ(d)).applyMatrix4(n),t.set(y.getX(d),y.getY(d),y.getZ(d)),t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),a.setXYZ(l,e.x,e.y,e.z),l+=1,a.setXYZ(l,t.x,t.y,t.z),l+=1;a.needsUpdate=!0}}(),fn.prototype=Object.create(he.prototype),fn.prototype.constructor=fn,fn.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},fn.prototype.update=function(){var e=new c,t=new c;return function(){this.light.updateMatrixWorld();var i=this.light.distance?this.light.distance:1e3,r=i*Math.tan(this.light.angle);this.cone.scale.set(r,r,i),e.setFromMatrixPosition(this.light.matrixWorld),t.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(t.sub(e)),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}(),vn.prototype=Object.create(Dt.prototype),vn.prototype.constructor=vn,vn.prototype.onBeforeRender=function(){var e=new c,t=new l,i=new l;return function(){var r=this.bones,n=this.geometry,a=n.getAttribute("position");i.getInverse(this.root.matrixWorld);for(var o=0,s=0;o<r.length;o++){var c=r[o];c.parent&&c.parent.isBone&&(t.multiplyMatrices(i,c.matrixWorld),e.setFromMatrixPosition(t),a.setXYZ(s,e.x,e.y,e.z),t.multiplyMatrices(i,c.parent.matrixWorld),e.setFromMatrixPosition(t),a.setXYZ(s+1,e.x,e.y,e.z),s+=2)}n.getAttribute("position").needsUpdate=!0}}(),gn.prototype=Object.create(Oe.prototype),gn.prototype.constructor=gn,gn.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},gn.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)},yn.prototype=Object.create(he.prototype),yn.prototype.constructor=yn,yn.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},yn.prototype.update=function(){var e=.5*this.light.width,t=.5*this.light.height,i=this.line.geometry.attributes.position,r=i.array;r[0]=e,r[1]=-t,r[2]=0,r[3]=e,r[4]=t,r[5]=0,r[6]=-e,r[7]=t,r[8]=0,r[9]=-e,r[10]=-t,r[11]=0,r[12]=e,r[13]=-t,r[14]=0,i.needsUpdate=!0,void 0!==this.color?this.line.material.color.set(this.color):this.line.material.color.copy(this.light.color)},xn.prototype=Object.create(he.prototype),xn.prototype.constructor=xn,xn.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},xn.prototype.update=function(){var e=new c,t=new X,i=new X;return function(){var r=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var n=r.geometry.getAttribute("color");t.copy(this.light.color),i.copy(this.light.groundColor);for(var a=0,o=n.count;a<o;a++){var s=a<o/2?t:i;n.setXYZ(a,s.r,s.g,s.b)}n.needsUpdate=!0}r.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate())}}(),bn.prototype=Object.create(Dt.prototype),bn.prototype.constructor=bn,_n.prototype=Object.create(Dt.prototype),_n.prototype.constructor=_n,wn.prototype=Object.create(Dt.prototype),wn.prototype.constructor=wn,wn.prototype.update=function(){var e=new c,t=new c,i=new re;return function(){this.object.updateMatrixWorld(!0),i.getNormalMatrix(this.object.matrixWorld);for(var r=this.object.matrixWorld,n=this.geometry.attributes.position,a=this.object.geometry,o=a.vertices,s=a.faces,c=0,l=0,h=s.length;l<h;l++){var u=s[l],p=u.normal;e.copy(o[u.a]).add(o[u.b]).add(o[u.c]).divideScalar(3).applyMatrix4(r),t.copy(p).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),n.setXYZ(c,e.x,e.y,e.z),c+=1,n.setXYZ(c,t.x,t.y,t.z),c+=1}n.needsUpdate=!0}}(),Mn.prototype=Object.create(he.prototype),Mn.prototype.constructor=Mn,Mn.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},Mn.prototype.update=function(){var e=new c,t=new c,i=new c;return function(){e.setFromMatrixPosition(this.light.matrixWorld),t.setFromMatrixPosition(this.light.target.matrixWorld),i.subVectors(t,e),this.lightPlane.lookAt(i),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(i),this.targetLine.scale.z=i.length()}}(),En.prototype=Object.create(Dt.prototype),En.prototype.constructor=En,En.prototype.update=function(){function e(e,a,o,s){r.set(a,o,s).unproject(n);var c=i[e];if(void 0!==c)for(var l=t.getAttribute("position"),h=0,u=c.length;h<u;h++)l.setXYZ(c[h],r.x,r.y,r.z)}var t,i,r=new c,n=new ue;return function(){t=this.geometry,i=this.pointMap;var r=1,a=1;n.projectionMatrix.copy(this.camera.projectionMatrix),e("c",0,0,-1),e("t",0,0,1),e("n1",-r,-a,-1),e("n2",r,-a,-1),e("n3",-r,a,-1),e("n4",r,a,-1),e("f1",-r,-a,1),e("f2",r,-a,1),e("f3",-r,a,1),e("f4",r,a,1),e("u1",.7*r,1.1*a,-1),e("u2",.7*-r,1.1*a,-1),e("u3",0,2*a,-1),e("cf1",-r,0,1),e("cf2",r,0,1),e("cf3",0,-a,1),e("cf4",0,a,1),e("cn1",-r,0,-1),e("cn2",r,0,-1),e("cn3",0,-a,-1),e("cn4",0,a,-1),t.getAttribute("position").needsUpdate=!0}}(),Tn.prototype=Object.create(Dt.prototype),Tn.prototype.constructor=Tn,Tn.prototype.update=function(){var e=new te;return function(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&e.setFromObject(this.object),!e.isEmpty()){var i=e.min,r=e.max,n=this.geometry.attributes.position,a=n.array;a[0]=r.x,a[1]=r.y,a[2]=r.z,a[3]=i.x,a[4]=r.y,a[5]=r.z,a[6]=i.x,a[7]=i.y,a[8]=r.z,a[9]=r.x,a[10]=i.y,a[11]=r.z,a[12]=r.x,a[13]=r.y,a[14]=i.z,a[15]=i.x,a[16]=r.y,a[17]=i.z,a[18]=i.x,a[19]=i.y,a[20]=i.z,a[21]=r.x,a[22]=i.y,a[23]=i.z,n.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}(),Tn.prototype.setFromObject=function(e){return this.object=e,this.update(),this},Sn.prototype=Object.create(Dt.prototype),Sn.prototype.constructor=Sn,Sn.prototype.onBeforeRender=function(){var e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5))},An.prototype=Object.create(Nt.prototype),An.prototype.constructor=An,An.prototype.onBeforeRender=function(){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),this.updateMatrixWorld()};var lh,hh;Rn.prototype=Object.create(he.prototype),Rn.prototype.constructor=Rn,Rn.prototype.setDirection=function(){var e,t=new c;return function(i){i.y>.99999?this.quaternion.set(0,0,0,1):i.y<-.99999?this.quaternion.set(1,0,0,0):(t.set(i.z,0,-i.x).normalize(),e=Math.acos(i.y),this.quaternion.setFromAxisAngle(t,e))}}(),Rn.prototype.setLength=function(e,t,i){void 0===t&&(t=.2*e),void 0===i&&(i=.2*t),this.line.scale.set(1,Math.max(0,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()},Rn.prototype.setColor=function(e){this.line.material.color.copy(e),this.cone.material.color.copy(e)},Ln.prototype=Object.create(Dt.prototype),Ln.prototype.constructor=Ln;var uh=new c,ph=new Pn,dh=new Pn,fh=new Pn;Cn.prototype=Object.create(Rr.prototype),Cn.prototype.constructor=Cn,Cn.prototype.getPoint=function(e){var t=this.points,i=t.length,r=(i-(this.closed?0:1))*e,n=Math.floor(r),a=r-n;this.closed?n+=n>0?0:(Math.floor(Math.abs(n)/t.length)+1)*t.length:0===a&&n===i-1&&(n=i-2,a=1);var o,s,l,h;if(this.closed||n>0?o=t[(n-1)%i]:(uh.subVectors(t[0],t[1]).add(t[0]),o=uh),s=t[n%i],l=t[(n+1)%i],this.closed||n+2<i?h=t[(n+2)%i]:(uh.subVectors(t[i-1],t[i-2]).add(t[i-1]),h=uh),void 0===this.type||"centripetal"===this.type||"chordal"===this.type){var u="chordal"===this.type?.5:.25,p=Math.pow(o.distanceToSquared(s),u),d=Math.pow(s.distanceToSquared(l),u),f=Math.pow(l.distanceToSquared(h),u);d<1e-4&&(d=1),p<1e-4&&(p=d),f<1e-4&&(f=d),ph.initNonuniformCatmullRom(o.x,s.x,l.x,h.x,p,d,f),dh.initNonuniformCatmullRom(o.y,s.y,l.y,h.y,p,d,f),fh.initNonuniformCatmullRom(o.z,s.z,l.z,h.z,p,d,f)}else if("catmullrom"===this.type){var m=void 0!==this.tension?this.tension:.5;ph.initCatmullRom(o.x,s.x,l.x,h.x,m),dh.initCatmullRom(o.y,s.y,l.y,h.y,m),fh.initCatmullRom(o.z,s.z,l.z,h.z,m)}return new c(ph.calc(a),dh.calc(a),fh.calc(a))},In.prototype=Object.create(Rr.prototype),In.prototype.constructor=In,In.prototype.getPoint=function(e){var t=this.v0,i=this.v1,r=this.v2,n=this.v3;return new c(Ar(e,t.x,i.x,r.x,n.x),Ar(e,t.y,i.y,r.y,n.y),Ar(e,t.z,i.z,r.z,n.z))},Un.prototype=Object.create(Rr.prototype),Un.prototype.constructor=Un,Un.prototype.getPoint=function(e){var t=this.v0,i=this.v1,r=this.v2;return new c(wr(e,t.x,i.x,r.x),wr(e,t.y,i.y,r.y),wr(e,t.z,i.z,r.z))},Nn.prototype=Object.create(Rr.prototype),Nn.prototype.constructor=Nn,Nn.prototype.getPoint=function(e){if(1===e)return this.v2.clone();var t=new c;return t.subVectors(this.v2,this.v1),t.multiplyScalar(e),t.add(this.v1),t},Dn.prototype=Object.create(Cr.prototype),Dn.prototype.constructor=Dn;var mh={createMultiMaterialObject:function(e,t){for(var i=new zt,r=0,n=t.length;r<n;r++)i.add(new Oe(e,t[r]));return i},detach:function(e,t,i){e.applyMatrix(t.matrixWorld),t.remove(e),i.add(e)},attach:function(e,t,i){e.applyMatrix((new l).getInverse(i.matrixWorld)),t.remove(e),i.add(e)}},vh=0,gh=1;Rr.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(Rr.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},ia.prototype=Object.create(Cn.prototype),ra.prototype=Object.create(Cn.prototype),na.prototype=Object.create(Cn.prototype),babelHelpers.extends(na.prototype,{initFromArray:function(e){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(e){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(e){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),bn.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},vn.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},babelHelpers.extends(q.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),babelHelpers.extends(te.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),Fe.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Ps.random16=function(){return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),Math.random()},babelHelpers.extends(re.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(e){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBuffer:function(e,t,i){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(e)},applyToVector3Array:function(e,t,i){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),babelHelpers.extends(l.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){var e;return function(){return void 0===e&&(e=new c),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),e.setFromMatrixColumn(this,3)}}(),setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(e){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.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(e,t,i){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(e)},applyToVector3Array:function(e,t,i){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,i,r,n,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,r,i,n,a)}}),ne.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},s.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},babelHelpers.extends(De.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),babelHelpers.extends(Fr.prototype,{extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new ci(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new yi(this,e)}}),babelHelpers.extends(i.prototype,{fromAttribute:function(e,t,i){return console.error("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,i)}}),babelHelpers.extends(c.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(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,i){return console.error("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,i)}}),babelHelpers.extends(n.prototype,{fromAttribute:function(e,t,i){return console.error("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,i)}}),ve.prototype.computeTangents=function(){console.warn("THREE.Geometry: .computeTangents() has been removed.")},babelHelpers.extends(he.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)}}),Object.defineProperties(he.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},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(Lt.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Pt.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Object.defineProperty(Rr.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),de.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(ki.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(ge.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}}}),babelHelpers.extends(Le.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addDrawCall:function(e,t,i){void 0!==i&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},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(Le.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($r.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(Q.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 X}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=e===Sa}}}),Object.defineProperties(Ci.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(K.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),babelHelpers.extends(wt.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},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(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},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(wt.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){return this.shadowMap.cullFace},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),this.shadowMap.cullFace=e}}}),Object.defineProperties(oe.prototype,{cullFace:{get:function(){return this.renderReverseSided?va:ma},set:function(e){var t=e!==ma;console.warn("WebGLRenderer: .shadowMap.cullFace is deprecated. Set .shadowMap.renderReverseSided to "+t+"."),this.renderReverseSided=t}}}),Object.defineProperties(a.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Wr.prototype.load=function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this,i=new Hr;return i.load(e,function(e){t.setBuffer(e)}),this},Xr.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),
this.getFrequencyData()},Vr.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)};var yh={merge:function(e,t,i){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var r;t.isMesh&&(t.matrixAutoUpdate&&t.updateMatrix(),r=t.matrix,t=t.geometry),e.merge(t,r,i)},center:function(e){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),e.center()}},xh={crossOrigin:void 0,loadTexture:function(e,t,i,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var n=new Vi;n.setCrossOrigin(this.crossOrigin);var a=n.load(e,i,void 0,r);return t&&(a.mapping=t),a},loadTextureCube:function(e,t,i,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var n=new Gi;n.setCrossOrigin(this.crossOrigin);var a=n.load(e,i,void 0,r);return t&&(a.mapping=t),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.")}};e.WebGLRenderTargetCube=o,e.WebGLRenderTarget=a,e.WebGLRenderer=wt,e.ShaderLib=Wl,e.UniformsLib=Hs,e.UniformsUtils=Gs,e.ShaderChunk=kl,e.FogExp2=Mt,e.Fog=Et,e.Scene=Tt,e.LensFlare=St,e.Sprite=Rt,e.LOD=Lt,e.SkinnedMesh=It,e.Skeleton=Pt,e.Bone=Ct,e.Mesh=Oe,e.LineSegments=Dt,e.LineLoop=Ft,e.Line=Nt,e.Points=Ot,e.Group=zt,e.VideoTexture=Ht,e.DataTexture=h,e.CompressedTexture=Gt,e.CubeTexture=u,e.CanvasTexture=Z,e.DepthTexture=Vt,e.Texture=r,e.CompressedTextureLoader=Oi,e.DataTextureLoader=zi,e.CubeTextureLoader=Gi,e.TextureLoader=Vi,e.ObjectLoader=gr,e.MaterialLoader=dr,e.BufferGeometryLoader=fr,e.DefaultLoadingManager=$l,e.LoadingManager=Fi,e.JSONLoader=vr,e.ImageLoader=Hi,e.FontLoader=zr,e.FileLoader=Bi,e.Loader=mr,e.Cache=Kl,e.AudioLoader=Hr,e.SpotLightShadow=Xi,e.SpotLight=qi,e.PointLight=Yi,e.RectAreaLight=Ki,e.HemisphereLight=Wi,e.DirectionalLightShadow=Zi,e.DirectionalLight=Ji,e.AmbientLight=Qi,e.LightShadow=ji,e.Light=ki,e.StereoCamera=Gr,e.PerspectiveCamera=de,e.OrthographicCamera=pe,e.CubeCamera=Vr,e.ArrayCamera=gt,e.Camera=ue,e.AudioListener=kr,e.PositionalAudio=jr,e.AudioContext=ch,e.AudioAnalyser=Xr,e.Audio=Wr,e.VectorKeyframeTrack=nr,e.StringKeyframeTrack=cr,e.QuaternionKeyframeTrack=or,e.NumberKeyframeTrack=sr,e.ColorKeyframeTrack=hr,e.BooleanKeyframeTrack=lr,e.PropertyMixer=qr,e.PropertyBinding=Zr,e.KeyframeTrack=ur,e.AnimationUtils=eh,e.AnimationObjectGroup=Jr,e.AnimationMixer=Kr,e.AnimationClip=pr,e.Uniform=$r,e.InstancedBufferGeometry=en,e.BufferGeometry=Le,e.GeometryIdCount=me,e.Geometry=ve,e.InterleavedBufferAttribute=tn,e.InstancedInterleavedBuffer=nn,e.InterleavedBuffer=rn,e.InstancedBufferAttribute=an,e.Face3=fe,e.Object3D=he,e.Raycaster=on,e.Layers=le,e.EventDispatcher=t,e.Clock=ln,e.QuaternionLinearInterpolant=ar,e.LinearInterpolant=tr,e.DiscreteInterpolant=ir,e.CubicInterpolant=er,e.Interpolant=$i,e.Triangle=Be,e.Math=Ps,e.Spherical=hn,e.Cylindrical=un,e.Plane=ne,e.Frustum=ae,e.Sphere=ie,e.Ray=De,e.Matrix4=l,e.Matrix3=re,e.Box3=te,e.Box2=q,e.Line3=Fe,e.Euler=ce,e.Vector4=n,e.Vector3=c,e.Vector2=i,e.Quaternion=s,e.Color=X,e.ImmediateRenderObject=pn,e.VertexNormalsHelper=dn,e.SpotLightHelper=fn,e.SkeletonHelper=vn,e.PointLightHelper=gn,e.RectAreaLightHelper=yn,e.HemisphereLightHelper=xn,e.GridHelper=bn,e.PolarGridHelper=_n,e.FaceNormalsHelper=wn,e.DirectionalLightHelper=Mn,e.CameraHelper=En,e.BoxHelper=Tn,e.Box3Helper=Sn,e.PlaneHelper=An,e.ArrowHelper=Rn,e.AxisHelper=Ln,e.CatmullRomCurve3=Cn,e.CubicBezierCurve3=In,e.QuadraticBezierCurve3=Un,e.LineCurve3=Nn,e.ArcCurve=Dn,e.EllipseCurve=Cr,e.SplineCurve=Ir,e.CubicBezierCurve=Ur,e.QuadraticBezierCurve=Nr,e.LineCurve=Lr,e.Shape=Fr,e.Path=Dr,e.ShapePath=Br,e.Font=Or,e.CurvePath=Pr,e.Curve=Rr,e.ShapeUtils=Zl,e.SceneUtils=mh,e.WebGLUtils=_t,e.WireframeGeometry=kt,e.ParametricGeometry=Wt,e.ParametricBufferGeometry=jt,e.TetrahedronGeometry=Yt,e.TetrahedronBufferGeometry=Zt,e.OctahedronGeometry=Jt,e.OctahedronBufferGeometry=Qt,e.IcosahedronGeometry=Kt,e.IcosahedronBufferGeometry=$t,e.DodecahedronGeometry=ei,e.DodecahedronBufferGeometry=ti,e.PolyhedronGeometry=Xt,e.PolyhedronBufferGeometry=qt,e.TubeGeometry=ii,e.TubeBufferGeometry=ri,e.TorusKnotGeometry=ni,e.TorusKnotBufferGeometry=ai,e.TorusGeometry=oi,e.TorusBufferGeometry=si,e.TextGeometry=hi,e.TextBufferGeometry=ui,e.SphereGeometry=pi,e.SphereBufferGeometry=di,e.RingGeometry=fi,e.RingBufferGeometry=mi,e.PlaneGeometry=Ie,e.PlaneBufferGeometry=Ue,e.LatheGeometry=vi,e.LatheBufferGeometry=gi,e.ShapeGeometry=yi,e.ShapeBufferGeometry=xi,e.ExtrudeGeometry=ci,e.ExtrudeBufferGeometry=li,e.EdgesGeometry=bi,e.ConeGeometry=Mi,e.ConeBufferGeometry=Ei,e.CylinderGeometry=_i,e.CylinderBufferGeometry=wi,e.CircleGeometry=Ti,e.CircleBufferGeometry=Si,e.BoxGeometry=Pe,e.BoxBufferGeometry=Ce,e.ShadowMaterial=Ai,e.SpriteMaterial=At,e.RawShaderMaterial=Ri,e.ShaderMaterial=K;e.PointsMaterial=Bt;e.MeshPhysicalMaterial=Pi,e.MeshStandardMaterial=Li,e.MeshPhongMaterial=Ci,e.MeshToonMaterial=Ii,e.MeshNormalMaterial=Ui,e.MeshLambertMaterial=Ni,e.MeshDepthMaterial=$,e.MeshDistanceMaterial=ee,e.MeshBasicMaterial=Ne,e.LineDashedMaterial=Di,e.LineBasicMaterial=Ut,e.Material=Q,e.Float64BufferAttribute=Se,e.Float32BufferAttribute=Te,e.Uint32BufferAttribute=Ee,e.Int32BufferAttribute=Me,e.Uint16BufferAttribute=we,e.Int16BufferAttribute=_e,e.Uint8ClampedBufferAttribute=be,e.Uint8BufferAttribute=xe,e.Int8BufferAttribute=ye,e.BufferAttribute=ge,e.REVISION=pa,e.MOUSE=da,e.CullFaceNone=fa,e.CullFaceBack=ma,e.CullFaceFront=va,e.CullFaceFrontBack=ga,e.FrontFaceDirectionCW=ya,e.FrontFaceDirectionCCW=xa,e.BasicShadowMap=ba,e.PCFShadowMap=_a,e.PCFSoftShadowMap=wa,e.FrontSide=Ma,e.BackSide=Ea,e.DoubleSide=Ta,e.FlatShading=Sa,e.SmoothShading=Aa,e.NoColors=Ra,e.FaceColors=La,e.VertexColors=Pa,e.NoBlending=Ca,e.NormalBlending=Ia,e.AdditiveBlending=Ua,e.SubtractiveBlending=Na,e.MultiplyBlending=Da,e.CustomBlending=Fa,e.AddEquation=Ba,e.SubtractEquation=Oa,e.ReverseSubtractEquation=za,e.MinEquation=Ha,e.MaxEquation=Ga,e.ZeroFactor=Va,e.OneFactor=ka,e.SrcColorFactor=Wa,e.OneMinusSrcColorFactor=ja,e.SrcAlphaFactor=Xa,e.OneMinusSrcAlphaFactor=qa,e.DstAlphaFactor=Ya,e.OneMinusDstAlphaFactor=Za,e.DstColorFactor=Ja,e.OneMinusDstColorFactor=Qa,e.SrcAlphaSaturateFactor=Ka,e.NeverDepth=$a,e.AlwaysDepth=eo,e.LessDepth=to,e.LessEqualDepth=io,e.EqualDepth=ro,e.GreaterEqualDepth=no,e.GreaterDepth=ao,e.NotEqualDepth=oo,e.MultiplyOperation=so,e.MixOperation=co,e.AddOperation=lo,e.NoToneMapping=ho,e.LinearToneMapping=uo,e.ReinhardToneMapping=po,e.Uncharted2ToneMapping=fo,e.CineonToneMapping=mo,e.UVMapping=vo,e.CubeReflectionMapping=go,e.CubeRefractionMapping=yo,e.EquirectangularReflectionMapping=xo,e.EquirectangularRefractionMapping=bo,e.SphericalReflectionMapping=_o,e.CubeUVReflectionMapping=wo,e.CubeUVRefractionMapping=Mo,e.RepeatWrapping=Eo,e.ClampToEdgeWrapping=To,e.MirroredRepeatWrapping=So,e.NearestFilter=Ao,e.NearestMipMapNearestFilter=Ro,e.NearestMipMapLinearFilter=Lo,e.LinearFilter=Po,e.LinearMipMapNearestFilter=Co,e.LinearMipMapLinearFilter=Io,e.UnsignedByteType=Uo,e.ByteType=No,e.ShortType=Do,e.UnsignedShortType=Fo,e.IntType=Bo,e.UnsignedIntType=Oo,e.FloatType=zo,e.HalfFloatType=Ho,e.UnsignedShort4444Type=Go,e.UnsignedShort5551Type=Vo,e.UnsignedShort565Type=ko,e.UnsignedInt248Type=Wo,e.AlphaFormat=jo,e.RGBFormat=Xo,e.RGBAFormat=qo,e.LuminanceFormat=Yo,e.LuminanceAlphaFormat=Zo,e.RGBEFormat=Jo,e.DepthFormat=Qo,e.DepthStencilFormat=Ko,e.RGB_S3TC_DXT1_Format=$o,e.RGBA_S3TC_DXT1_Format=es,e.RGBA_S3TC_DXT3_Format=ts,e.RGBA_S3TC_DXT5_Format=is,e.RGB_PVRTC_4BPPV1_Format=rs,e.RGB_PVRTC_2BPPV1_Format=ns,e.RGBA_PVRTC_4BPPV1_Format=as,e.RGBA_PVRTC_2BPPV1_Format=os,e.RGB_ETC1_Format=ss,e.LoopOnce=cs,e.LoopRepeat=ls,e.LoopPingPong=hs,e.InterpolateDiscrete=us,e.InterpolateLinear=ps,e.InterpolateSmooth=ds,e.ZeroCurvatureEnding=fs,e.ZeroSlopeEnding=ms,e.WrapAroundEnding=vs,e.TrianglesDrawMode=gs,e.TriangleStripDrawMode=ys,e.TriangleFanDrawMode=xs,e.LinearEncoding=bs,e.sRGBEncoding=_s,e.GammaEncoding=ws,e.RGBEEncoding=Ms,e.LogLuvEncoding=Es,e.RGBM7Encoding=Ts,e.RGBM16Encoding=Ss,e.RGBDEncoding=As,e.BasicDepthPacking=Rs,e.RGBADepthPacking=Ls,e.CubeGeometry=Pe,e.Face4=Fn,e.LineStrip=vh,e.LinePieces=gh,e.MeshFaceMaterial=Bn,e.MultiMaterial=On,e.PointCloud=zn,e.Particle=Hn,e.ParticleSystem=Gn,e.PointCloudMaterial=Vn,e.ParticleBasicMaterial=kn,e.ParticleSystemMaterial=Wn,e.Vertex=jn,e.DynamicBufferAttribute=Xn,e.Int8Attribute=qn,e.Uint8Attribute=Yn,e.Uint8ClampedAttribute=Zn,e.Int16Attribute=Jn,e.Uint16Attribute=Qn,e.Int32Attribute=Kn,e.Uint32Attribute=$n,e.Float32Attribute=ea,e.Float64Attribute=ta,e.ClosedSplineCurve3=ia,e.SplineCurve3=ra,e.Spline=na,e.BoundingBoxHelper=aa,e.EdgesHelper=oa,e.WireframeHelper=sa,e.XHRLoader=ca,e.BinaryTextureLoader=la,e.GeometryUtils=yh,e.ImageUtils=xh,e.Projector=ha,e.CanvasRenderer=ua,Object.defineProperty(e,"__esModule",{value:!0})})},35);
__d(function(e,t,a,i){Object.defineProperty(i,"__esModule",{value:!0});var n=t(37),s=t(40),l=babelHelpers.interopRequireDefault(s),r=t(19),o=babelHelpers.interopRequireDefault(r),d=t(41),u=babelHelpers.interopRequireDefault(d),v={canplay:"onVideoCanPlay",durationchange:"onVideoDurationChange",ended:"onVideoEnded",error:"onVideoError",timeupdate:"onVideoTimeUpdate",playing:"onVideoPlaying",pause:"onVideoPause"},c=function(e){function t(e){babelHelpers.classCallCheck(this,t);var a=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"RCTVideoModule"));return a.supportedFormats=(0,n.getCustomizedSupportedFormats)()||[],a._videoDefs={},a._players={},a._rnctx=e,a._mediaEventCallbacks={},a}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"addHandle",value:function(e){var t=new l.default;this._players[e]=t,this._videoDefs[e]=this._createVideoDef(),this._mediaEventCallbacks[e]={},t.onMediaEvent=this._onMediaEvent.bind(this,e)}},{key:"_createVideoDef",value:function(){return{}}},{key:"_onMediaEvent",value:function(e,t){var a=t.type;if(v[a]){var i=v[a],n=new u.default(t);this._rnctx.callFunction("RCTDeviceEventEmitter","emit",[i,e,n]);var s=this._mediaEventCallbacks[e]?this._mediaEventCallbacks[e][a]:null;s&&s.forEach(function(t){return t(e,n)})}}},{key:"_addMediaEventListener",value:function(e,t,a){if(!this._mediaEventCallbacks[e])return void console.warn("RCTVideoModule.addMediaEventListener: can't add listener on a not exist handle: "+e);if(!v[t])return void console.warn("RCTVideoModule.addMediaEventListener: can't add listener on a not supported eventType: "+t);this._mediaEventCallbacks[e][t]||(this._mediaEventCallbacks[e][t]=[]);var i=this._mediaEventCallbacks[e][t];i.indexOf(a)===-1&&i.push(a)}},{key:"_removeMediaEventListener",value:function(e,t,a){if(this._mediaEventCallbacks[e]&&this._mediaEventCallbacks[e][t]){var i=this._mediaEventCallbacks[e][t];if(i){var n=i.indexOf(a);n!==-1&&i.splice(n,1)}}}},{key:"setUrl",value:function(e,t){this._videoDefs[e].src=t}},{key:"setFormat",value:function(e,t){this._videoDefs[e].format=t}},{key:"setMetaData",value:function(e,t){this._videoDefs[e].metaData=t}},{key:"getVideoTexture",value:function(e){if(!e)return null;var t=this._players[e];return t.videoTextures[0]}},{key:"load",value:function(e){this._players[e].setVideo(this._videoDefs[e]);var t={type:"MonoTextureInfo",texture:this._players[e].videoTextures[0]};this._rnctx.RCTResourceManager.addResource("MonoTexture",e,t)}},{key:"play",value:function(e){this._players[e].videoPlayer.play()}},{key:"pause",value:function(e){this._players[e].videoPlayer.pause()}},{key:"seekTo",value:function(e,t){this._players[e].videoPlayer.seekTo(t)}},{key:"setMuted",value:function(e,t){this._players[e].videoPlayer.setMuted(t)}},{key:"setVolume",value:function(e,t){this._players[e].videoPlayer.setVolume(t)}},{key:"unload",value:function(e){this._rnctx.RCTResourceManager.removeResource("MonoTexture",e),this._players[e].dispose(),delete this._players[e],delete this._videoDefs[e],delete this._mediaEventCallbacks[e]}},{key:"frame",value:function(){for(var e in this._players)this._players[e].frame()}}]),t}(o.default);i.default=c},36);
__d(function(e,r,t,u){function o(e){for(var r=0;r<p.length;r++){var t=p[r],u=e?e.format:null;if(null==t.supportedFormats||null==u||t.supportedFormats.indexOf(u)>-1)return t}return d.default}function n(e){p.push(e)}function l(){if(s)return s;s=(0,i.default)();for(var e=0;e<p.length;e++){var r=p[e];if(r.supportedFormats)for(var t=r.supportedFormats,u=0;u<t.length;u++)s.indexOf(t[u])<0&&s.push(t[u])}return s}Object.defineProperty(u,"__esModule",{value:!0}),u.getVideoPlayer=o,u.addCustomizedVideoPlayer=n,u.getCustomizedSupportedFormats=l;var a=r(38),d=babelHelpers.interopRequireDefault(a),f=r(39),i=babelHelpers.interopRequireDefault(f),p=[],s=null},37);
__d(function(e,t,i,n){Object.defineProperty(n,"__esModule",{value:!0});var o=["canplay","durationchange","ended","error","timeupdate","pause","playing"],d=function(){function e(){babelHelpers.classCallCheck(this,e),this.videoElement=document.createElement("video"),this.videoElement.style.display="none",this.videoElement.setAttribute("playsinline","playsinline"),this.videoElement.setAttribute("webkit-playsinline","webkit-playsinline"),document.body&&document.body.appendChild(this.videoElement),this._volume=1,this._muted=!1,this.onMediaEvent=void 0,this._onMediaEvent=this._onMediaEvent.bind(this)}return babelHelpers.createClass(e,[{key:"initializeVideo",value:function(e,t){this.videoElement.src=e,this.videoElement.crossOrigin="anonymous",this._bindMediaEvents(),this.videoElement.load()}},{key:"hasEnoughData",value:function(){return!!this.videoElement&&this.videoElement.readyState===this.videoElement.HAVE_ENOUGH_DATA}},{key:"_bindMediaEvents",value:function(){var e=this;o.forEach(function(t){e.videoElement.addEventListener(t,e._onMediaEvent)})}},{key:"_unbindMediaEvents",value:function(){var e=this;o.forEach(function(t){e.videoElement.removeEventListener(t,e._onMediaEvent)})}},{key:"_onMediaEvent",value:function(e){"function"==typeof this.onMediaEvent&&this.onMediaEvent(e)}},{key:"setVolume",value:function(e){this.videoElement.volume=e}},{key:"setMuted",value:function(e){this.videoElement.muted=e}},{key:"play",value:function(){this.videoElement.play()}},{key:"pause",value:function(){this.videoElement.pause()}},{key:"seekTo",value:function(e){this.videoElement.currentTime=e}},{key:"dispose",value:function(){this.pause(),document.body&&document.body.removeChild(this.videoElement),this.videoElement.src="",this._unbindMediaEvents(),this.onMediaEvent=void 0}}]),e}();d.supportedFormats=null,n.default=d},38);
__d(function(e,o,r,v){function a(){if(d)return d;var e=document.createElement("video");d=[];for(var o in c){var r=e.canPlayType(c[o]);r.length&&"no"!==r&&d.push(o)}return d}Object.defineProperty(v,"__esModule",{value:!0}),v.default=a;var c={ogg:'video/ogg; codecs="theora, vorbis"',mp4:'video/mp4; codecs="avc1.4D401E, mp4a.40.2"',mkv:'video/x-matroska; codecs="theora, vorbis"',webm:'video/webm; codecs="vp8, vorbis"'},d=null},39);
__d(function(e,i,t,a){Object.defineProperty(a,"__esModule",{value:!0});var s=i(37),o=i(35),r=babelHelpers.interopRequireWildcard(o),n=function(){function e(){babelHelpers.classCallCheck(this,e),this.videoPlayer=null,this.videoTextures=[],this.onMediaEvent=void 0,this._onMediaEvent=this._onMediaEvent.bind(this)}return babelHelpers.createClass(e,[{key:"setVideo",value:function(e){this._freeVideoPlayer(),this._freeTexture(),this._setVideoDef(e),this.videoPlayer=new((0,s.getVideoPlayer)(this.videoDef)),this.videoPlayer.onMediaEvent=this._onMediaEvent;var i=new r.Texture(this.videoPlayer.videoElement);if(i.generateMipmaps=!1,i.wrapS=r.ClampToEdgeWrapping,i.wrapT=r.ClampToEdgeWrapping,i.minFilter=r.LinearFilter,i.magFilter=r.LinearFilter,this.videoTextures[0]=i,this.videoDef){var t=this.videoDef;this.videoPlayer&&this.videoPlayer.initializeVideo(t.src,t.metaData)}}},{key:"_setVideoDef",value:function(e){this.videoDef={src:e.src,format:e.format,metaData:e.metaData}}},{key:"_onMediaEvent",value:function(e){"function"==typeof this.onMediaEvent&&this.onMediaEvent(e)}},{key:"_freeVideoPlayer",value:function(){this.videoPlayer&&this.videoPlayer.dispose(),this.videoPlayer=null}},{key:"_freeTexture",value:function(){for(var e=0;e<this.videoTextures.length;e++)this.videoTextures[e]&&this.videoTextures[e].dispose();this.videoTextures=[]}},{key:"frame",value:function(){if(this.videoPlayer&&this.videoPlayer.hasEnoughData())for(var e=0;e<this.videoTextures.length;e++)this.videoTextures[e]&&(this.videoTextures[e].needsUpdate=!0)}},{key:"dispose",value:function(){this._freeVideoPlayer(),this._freeTexture(),this.onMediaEvent=void 0}}]),e}();a.default=n},40);
__d(function(t,e,r,a){Object.defineProperty(a,"__esModule",{value:!0});var i=function t(e){babelHelpers.classCallCheck(this,t),this.type=e.type,this.timeStamp=e.timeStamp,e.target&&(this.target={},this.target.currentTime=e.target.currentTime,this.target.duration=e.target.duration,this.target.ended=e.target.ended,this.target.error=e.target.error)};a.default=i},41);
__d(function(e,t,n,i){Object.defineProperty(i,"__esModule",{value:!0});var a=t(43),o=babelHelpers.interopRequireDefault(a),s=t(44),l=babelHelpers.interopRequireDefault(s),u=t(48),r=babelHelpers.interopRequireDefault(u),d=t(19),c=babelHelpers.interopRequireDefault(d),p=t(35),v=babelHelpers.interopRequireWildcard(p),f=t(41),h=babelHelpers.interopRequireDefault(f),_={canplay:"onAudioCanPlay",durationchange:"onAudioDurationChange",ended:"onAudioEnded",error:"onAudioError",timeupdate:"onAudioTimeUpdate",playing:"onAudioPlaying",pause:"onAudioPause"},m=function(e){function t(e){babelHelpers.classCallCheck(this,t);var n=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"RCTAudioModule"));return n.audioContext=r.default.supported()?new r.default:null,n.supportedFormats=(0,o.default)()||[],n._audioDefs={},n._components={},n._rnctx=e,n._mediaEventCallbacks={},n}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"addHandle",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.audioContext){var n=new l.default(this.audioContext,t);this._components[e]=n,this._audioDefs[e]=this._createAudioDef(),this._mediaEventCallbacks[e]={},n.onMediaEvent=this._onMediaEvent.bind(this,e)}}},{key:"_createAudioDef",value:function(){return{streamingType:"buffer"}}},{key:"_onMediaEvent",value:function(e,t){var n=t.type;if(_[n]){var i=_[n],a=new h.default(t);this._rnctx.callFunction("RCTDeviceEventEmitter","emit",[i,e,a]);var o=this._mediaEventCallbacks[e]?this._mediaEventCallbacks[e][n]:null;o&&o.forEach(function(t){return t(e,a)})}}},{key:"_addMediaEventListener",value:function(e,t,n){if(!this._mediaEventCallbacks[e])return void console.warn("RCTAudioModule.addMediaEventListener: can't add listener on a not exist handle: "+e);if(!_[t])return void console.warn("RCTAudioModule.addMediaEventListener: can't add listener on a not supported eventType: "+t);this._mediaEventCallbacks[e][t]||(this._mediaEventCallbacks[e][t]=[]);var i=this._mediaEventCallbacks[e][t];i.indexOf(n)===-1&&i.push(n)}},{key:"_removeMediaEventListener",value:function(e,t,n){if(this._mediaEventCallbacks[e]&&this._mediaEventCallbacks[e][t]){var i=this._mediaEventCallbacks[e][t];if(i){var a=i.indexOf(n);a!==-1&&i.splice(a,1)}}}},{key:"setUrl",value:function(e,t){this._audioDefs[e].src=t}},{key:"load",value:function(e){this._components[e].setAudio(this._audioDefs[e])}},{key:"play",value:function(e){this._components[e].play()}},{key:"seekTo",value:function(e,t){this._components[e].seekTo(t)}},{key:"pause",value:function(e){this._components[e].pause()}},{key:"stop",value:function(e){this._components[e].stop()}},{key:"unload",value:function(e){this._components[e].dispose(),delete this._components[e],delete this._audioDefs[e],delete this._mediaEventCallbacks[e]}},{key:"setPosition",value:function(e,t){var n=new v.Vector3;n.fromArray(t),this._components[e].position=n}},{key:"setVolume",value:function(e,t){return"number"!=typeof t?void console.warn("AudioModule setVolume expected args (handle: string, volume: number)"):void(this._components[e].volume=t)}},{key:"setMuted",value:function(e,t){this._components[e].muted=t}},{key:"frame",value:function(e){this.audioContext&&this.audioContext.frame(e);for(var t in this._components)this._components[t].frame()}}]),t}(c.default);i.default=m},42);
__d(function(e,o,a,u){function c(){if(n)return n;var e=document.createElement("audio");n=[];for(var o in d){var a=e.canPlayType(d[o]);a.length&&"no"!==a&&n.push(o)}return n}Object.defineProperty(u,"__esModule",{value:!0}),u.default=c;var d={mp3:'audio/mpeg; codecs="mp3"',m4a:"audio/aac",ogg:'audio/ogg; codecs="vorbis"',wav:'audio/wav; codecs="1"',webm:'audio/webm; codecs="vorbis"'},n=null},43);
__d(function(e,t,n,i){Object.defineProperty(i,"__esModule",{value:!0});var s=t(45),o=babelHelpers.interopRequireDefault(s),a=t(35),u=babelHelpers.interopRequireWildcard(a),r=1,c="HRTF",h="inverse",_=60,d=120,l=.25,p=function(){function e(t,n){babelHelpers.classCallCheck(this,e),this._vrAudioContext=t,this.audioConfig=n,this._position=new u.Vector3(0,0,0),this._rotation=new u.Euler(0,0,0,"XYZ"),this._volume=r,this._muted=!1,this._gain=this._vrAudioContext.getWebAudioContext().createGain(),this.updateGainValue(),this._panner=void 0,this.onMediaEvent=void 0,this._onMediaEvent=this._onMediaEvent.bind(this)}return babelHelpers.createClass(e,[{key:"_setAudioDef",value:function(e){this.audioDef={streamingType:e.streamingType,src:e.src}}},{key:"_onMediaEvent",value:function(e){"function"==typeof this.onMediaEvent&&this.onMediaEvent(e)}},{key:"_createPanner",value:function(){var e=this.audioConfig;this._panner=this._vrAudioContext.getWebAudioContext().createPanner(),this._panner.panningModel=e.panningModel?e.panningModel:c,this._panner.distanceModel=e.distanceModel?e.distanceModel:h,this._panner.coneInnerAngle=e.coneInnerAngle?e.coneInnerAngle:_,this._panner.coneOuterAngle=e.coneOuterAngle?e.coneOuterAngle:d,this._panner.coneOuterGain=e.coneOuterGain?e.coneOuterGain:l}},{key:"_connectNodes",value:function(){var e=[];if(this._source){var t=this._source.getSourceNode();t&&e.push(t)}this._gain&&e.push(this._gain),this._panner&&e.push(this._panner);for(var n=0;n<e.length-1;n++)e[n].connect(e[n+1]);if(e.length>0){var i=this._vrAudioContext.getWebAudioContext().destination;e[e.length-1].connect(i)}}},{key:"_disconnectNodes",value:function(){this._gain&&this._gain.disconnect(),this._panner&&this._panner.disconnect()}},{key:"_freeSource",value:function(){this._source&&(this._source.dispose(),this._source=void 0)}},{key:"setAudio",value:function(e){this._disconnectNodes(),this._freeSource(),this._setAudioDef(e),this._source=new o.default(this._vrAudioContext),this._source.onMediaEvent=this._onMediaEvent,this._source.initializeAudio(this.audioDef.src)}},{key:"play",value:function(){if(this._source){var e=this._source;this._disconnectNodes(),e.play(),this._connectNodes()}}},{key:"seekTo",value:function(e){if(this._source){var t=this._source;this._disconnectNodes(),t.seekTo(e),t.isPlaying&&this._connectNodes()}}},{key:"pause",value:function(){this._source&&(this._source.pause(),this._disconnectNodes())}},{key:"stop",value:function(){this._source&&(this._source.stop(),this._disconnectNodes())}},{key:"updateGainValue",value:function(){var e=this._muted?0:this._volume;this._gain.gain.value=e}},{key:"frame",value:function(){this._source&&this._source.frame()}},{key:"dispose",value:function(){this._disconnectNodes(),this._freeSource(),this.onMediaEvent=void 0}},{key:"position",get:function(){return this._position},set:function(e){this._panner||this._createPanner(),this._position.copy(e),this._panner&&this._panner.setPosition(this._position.x,this._position.y,this._position.z)}},{key:"rotation",get:function(){return this._rotation},set:function(e){this._panner||this._createPanner(),this._rotation.copy(e);var t=new u.Vector3(0,0,-1);t.applyEuler(this._rotation),this._panner&&this._panner.setOrientation(t.x,t.y,t.z)}},{key:"volume",get:function(){return this._volume},set:function(e){this._volume=e,this.updateGainValue()}},{key:"muted",get:function(){return this._muted},set:function(e){this._muted=e,this.updateGainValue()}}]),e}();i.default=p},44);
__d(function(e,t,i,n){Object.defineProperty(n,"__esModule",{value:!0});var o=t(46),a=babelHelpers.interopRequireWildcard(o),s=t(47),r=(babelHelpers.interopRequireDefault(s),function(){function e(t){babelHelpers.classCallCheck(this,e),this._vrAudioContext=t,this._playbackTime=0,this._startTime=0,this._isPlaying=!1,this._error=null,this._ended=!1,this.onMediaEvent=void 0}return babelHelpers.createClass(e,[{key:"initializeAudio",value:function(e){var t=this;this.url&&this._buffer&&a.releaseRef(this.url),this.stopSourceNode(),this._playbackTime=0,this._buffer=null,this._error=null,this._ended=!1,this.url=e,a.fetch(e,this._vrAudioContext,function(i,n){n?(console.warn("Failed to fetch audio:",e),t._error=n,t._onMediaEvent(t.createMediaEvent("error"))):(t._buffer=i,t._onMediaEvent(t.createMediaEvent("canplay")),t._onMediaEvent(t.createMediaEvent("durationchange")))})}},{key:"createMediaEvent",value:function(e){var t=this._buffer?this._buffer.duration:0,i=this._isPlaying?this._vrAudioContext.getWebAudioContext().currentTime-this._startTime+this._playbackTime:this._playbackTime;return{type:e,timeStamp:Date.now(),target:{currentTime:i,duration:t,ended:this._ended,error:this._error}}}},{key:"getSourceNode",value:function(){return this._sourceNode}},{key:"_onMediaEvent",value:function(e){"function"==typeof this.onMediaEvent&&this.onMediaEvent(e)}},{key:"play",value:function(){this._isPlaying||(this.playSourceNode(),this._onMediaEvent(this.createMediaEvent("playing")))}},{key:"playSourceNode",value:function(){var e=this;this.stopSourceNode();var t=this._vrAudioContext.getWebAudioContext().createBufferSource();return this._sourceNode=t,t.onended=function(){e.stopSourceNode(),e._playbackTime=0,e._ended=!0,e._onMediaEvent(e.createMediaEvent("ended"))},this._buffer?(t.buffer=this._buffer,t.start(0,this._playbackTime),this._ended=!1,this._isPlaying=!0,void(this._startTime=this._vrAudioContext.getWebAudioContext().currentTime)):void console.warn("play() called before audio loaded for url",this.url)}},{key:"seekTo",value:function(e){this._buffer&&(e=e||0,e<-this._buffer.duration||e>this._buffer.duration?(console.warn("seekTo() time out of range: "+e),e=0):e<0&&(e=this._buffer.duration+e),this._isPlaying?(this.stopSourceNode(),this._playbackTime=e,this.playSourceNode()):this._playbackTime=e)}},{key:"pause",value:function(){this._isPlaying&&(this.stopSourceNode(),this._playbackTime=this._vrAudioContext.getWebAudioContext().currentTime-this._startTime+this._playbackTime,this._onMediaEvent(this.createMediaEvent("pause")))}},{key:"stop",value:function(){this._isPlaying&&(this.stopSourceNode(),this._playbackTime=0,this._ended=!0,this._onMediaEvent(this.createMediaEvent("ended")))}},{key:"stopSourceNode",value:function(){var e=this._sourceNode;e&&(e.stop(),e.disconnect(),this._sourceNode=void 0),this._isPlaying=!1}},{key:"frame",value:function(){this._isPlaying&&this._onMediaEvent(this.createMediaEvent("timeupdate"))}},{key:"dispose",value:function(){this.stopSourceNode(),this.url&&this._buffer&&a.releaseRef(this.url),this.onMediaEvent=void 0}},{key:"isPlaying",get:function(){return this._isPlaying}}]),e}());n.default=r},45);
__d(function(e,u,n,f){function r(e,u,n){if(d[e]&&(d[e].ref++,n(d[e].buffer,null)),c[e])c[e].push(n);else{c[e]=[n];var f=new XMLHttpRequest;f.open("GET",e),f.responseType="arraybuffer",f.onload=function(){200===f.status?u.getWebAudioContext().decodeAudioData(f.response,function(u){o(e,u)},function(u){i(e,new a.default(l.MEDIA_ERR_DECODE,"[VRAudioBufferSource] Decoding failure: "+e+" ("+u+")"))}):i(e,new a.default(l.MEDIA_ERR_NETWORK,"[VRAudioBufferSource] XHR Error: "+e+" ("+f.statusText+")"))},f.onerror=function(u){i(e,new a.default(l.MEDIA_ERR_NETWORK,"[VRAudioBufferSource] XHR Network failure: "+e))},f.send()}}function t(e){d[e]&&(d[e].ref--,d[e].ref<=0&&delete d[e])}function o(e,u){var n=c[e];delete c[e],d[e]={buffer:u,ref:n.length},n.map(function(u){u(d[e].buffer,null)})}function i(e,u){var n=c[e];delete c[e],n.map(function(e){e(null,u)})}Object.defineProperty(f,"__esModule",{value:!0}),f.fetch=r,f.releaseRef=t;var l=u(47),a=babelHelpers.interopRequireDefault(l),d={},c={}},46);
__d(function(e,_,E,R){Object.defineProperty(R,"__esModule",{value:!0});var s=(R.MEDIA_ERR_ABORTED=1,R.MEDIA_ERR_NETWORK=2,R.MEDIA_ERR_DECODE=3,R.MEDIA_ERR_SRC_NOT_SUPPORTED=4,function e(_,E){babelHelpers.classCallCheck(this,e),this.code=_,this.message=E});R.default=s},47);
__d(function(o,e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var i=e(35),r=babelHelpers.interopRequireWildcard(i),u=window.hasOwnProperty("webkitAudioContext")||window.hasOwnProperty("AudioContext"),l=u?window.AudioContext||window.webkitAudioContext:null;window.hasOwnProperty("webkitAudioContext")&&!window.hasOwnProperty("AudioContext")&&console.log("Outdated version of Web Audio API detected.");var s=function(){function o(){if(babelHelpers.classCallCheck(this,o),!u||"function"!=typeof l)throw new Error("Cannot create VRAudioContext, AudioContext is not supported");this._context=new l}return babelHelpers.createClass(o,[{key:"getWebAudioContext",value:function(){return this._context}},{key:"frame",value:function(o){if(this._context){var e=this._context.listener,t=o.localToWorld(new r.Vector3(0,0,0)),n=o.localToWorld(new r.Vector3(0,0,-1)).sub(t).normalize(),i=o.localToWorld(new r.Vector3(0,1,0)).sub(t).normalize();e.setOrientation(n.x,n.y,n.z,i.x,i.y,i.z),"function"==typeof e.setPosition?e.setPosition(t.x,t.y,t.z):e.positionX&&e.positionY&&e.positionZ&&(e.positionX.value=t.x,e.positionY.value=t.y,e.positionZ.value=t.z)}}}],[{key:"supported",value:function(){return u}}]),o}();n.default=s},48);
__d(function(e,t,u,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t(50),i=babelHelpers.interopRequireDefault(n),s=t(35),a=function(){function e(){var t=this,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;babelHelpers.classCallCheck(this,e),this._queueSize=u,this._textureMap={},this._pendingTextures={},this._ejectionQueue=[],this._customTextureLoads={},this._customTexturesWithUpdates=[],this._refCountCache=new i.default(function(e){if(t._ejectionQueue.push(e),t._ejectionQueue.length>t._queueSize){var u=t._ejectionQueue.shift(),r=t._textureMap[u];delete t._textureMap[u],r&&r.dispose()}})}return babelHelpers.createClass(e,[{key:"isTextureCached",value:function(e){return e in this._textureMap}},{key:"isTextureLoading",value:function(e){return e in this._pendingTextures}},{key:"isTextureReferenced",value:function(e){return this._refCountCache.has(e)}},{key:"isTextureInEjectionQueue",value:function(e){return this._ejectionQueue.indexOf(e)>-1}},{key:"getTextureForURL",value:function(e){var t=this;if(this._textureMap[e])return Promise.resolve(this._textureMap[e]);if(this._pendingTextures[e])return this._pendingTextures[e];if(e.startsWith("texture://")){var u=new Promise(function(u,r){t._customTextureLoads[e]=u});return this._pendingTextures[e]=u,u}var r=new Promise(function(u,r){var n=new s.TextureLoader;n.setCrossOrigin("anonymous"),n.load(e,function(r){t._textureMap[e]=r,delete t._pendingTextures[e],u(r)},void 0,function(e){r(e)})});return this._pendingTextures[e]=r,r}},{key:"addReference",value:function(e){if(!e.startsWith("texture://"))if(this._refCountCache.has(e))this._refCountCache.addReference(e);else{var t=this._ejectionQueue.indexOf(e);t>-1&&this._ejectionQueue.splice(t,1),this._refCountCache.addEntry(e,!0)}}},{key:"removeReference",value:function(e){e.startsWith("texture://")||this._refCountCache.has(e)&&this._refCountCache.removeReference(e)}},{key:"registerLocalTextureSource",value:function(e,t){var u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!(t instanceof HTMLCanvasElement))throw new Error("Unsupported texture source");var r=new s.Texture(t);r.needsUpdate=!0;var n="texture://"+e;this._textureMap[n]=r,u.updateOnFrame&&this._customTexturesWithUpdates.push(r),delete this._pendingTextures[n],this._customTextureLoads[n]&&(this._customTextureLoads[n](r),delete this._customTextureLoads[n])}},{key:"frame",value:function(){for(var e=this._customTexturesWithUpdates,t=0,u=e.length;t<u;t++)e[t].needsUpdate=!0}}]),e}();r.default=a},49);
__d(function(e,t,a,s){Object.defineProperty(s,"__esModule",{value:!0});var r=function(){function e(t){babelHelpers.classCallCheck(this,e),this._cleanup=t,this._stateCache={}}return babelHelpers.createClass(e,[{key:"has",value:function(e){return!!this._stateCache[e]}},{key:"get",value:function(e){var t=this._stateCache[e];if(!t)throw new Error("RefCountCache entry for "+e+" not found");return t.state}},{key:"addEntry",value:function(e,t){var a=this._stateCache[e];a||(this._stateCache[e]={refs:1,state:t})}},{key:"addReference",value:function(e){var t=this._stateCache[e];return t?(t.refs++,t.refs):0}},{key:"removeReference",value:function(e){var t=this._stateCache[e];return t?(t.refs--,t.refs<=0&&(this._cleanup&&this._cleanup(e,t.state),delete this._stateCache[e]),Math.max(0,t.refs)):0}}]),e}();s.default=r},50);
__d(function(e,t,r,i){Object.defineProperty(i,"__esModule",{value:!0});var a=t(19),n=babelHelpers.interopRequireDefault(a),l=1,s=function(e){function t(e){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"Timing"));return r._timers={},r._rnctx=e,r._sendIdleEvents=!1,r._targetFrameDuration=1e3/(e.isLowLatency?90:60),r}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"createTimer",value:function(e,t,r,i){var a=Date.now(),n=r+16.666666666666668,l=Math.max(0,r-n+t),s=a+l;this._timers[String(e)]={callbackID:e,duration:t,jsSchedulingTime:s,repeats:i}}},{key:"deleteTimer",value:function(e){delete this._timers[String(e)]}},{key:"setSendIdleEvents",value:function(e){this._sendIdleEvents=e}},{key:"frame",value:function(e){var t=[],r=[],i=Date.now();for(var a in this._timers){var n=this._timers[a];n.jsSchedulingTime<=i&&(r.push(this._timers[a].callbackID),n.repeats?n.jsSchedulingTime+=n.duration:t.push(a))}r.length&&this._rnctx.callFunction("JSTimers","callTimers",[r]);for(var l=t,s=Array.isArray(l),o=0,l=s?l:l["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();;){var c;if(s){if(o>=l.length)break;c=l[o++]}else{if(o=l.next(),o.done)break;c=o.value}var u=c;delete this._timers[u]}}},{key:"idle",value:function(e){if(this._sendIdleEvents){var t=window.performance?performance.now():Date.now(),r=t-e;this._targetFrameDuration-r>=l&&this._rnctx.callFunction("JSTimers","callIdleCallbacks",[Date.now()-r])}}}]),t}(n.default);i.default=s},51);
__d(function(e,t,i,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t(53),a=babelHelpers.interopRequireDefault(n),o=t(66),u=babelHelpers.interopRequireDefault(o),s=t(67),l=babelHelpers.interopRequireDefault(s),d=t(68),f=babelHelpers.interopRequireDefault(d),g=t(69),p=babelHelpers.interopRequireDefault(g),v=t(70),c=babelHelpers.interopRequireDefault(v),h=t(71),y=babelHelpers.interopRequireDefault(h),w=t(80),b=babelHelpers.interopRequireDefault(w),m=t(81),C=babelHelpers.interopRequireDefault(m),_=t(92),T=babelHelpers.interopRequireDefault(_),V=t(93),k=babelHelpers.interopRequireDefault(V),N=t(94),S=babelHelpers.interopRequireDefault(N),R=t(95),D=babelHelpers.interopRequireDefault(R),H=t(96),x=babelHelpers.interopRequireDefault(H),L=t(98),G=babelHelpers.interopRequireDefault(L),q=t(99),Y=babelHelpers.interopRequireDefault(q),P=t(100),O=babelHelpers.interopRequireDefault(P),E=t(101),I=babelHelpers.interopRequireDefault(E),W=t(102),M=babelHelpers.interopRequireDefault(W),B=t(103),U=babelHelpers.interopRequireDefault(B),F=t(105),A=babelHelpers.interopRequireDefault(F),j=t(79),z=babelHelpers.interopRequireDefault(j),Q=t(19),J=babelHelpers.interopRequireDefault(Q),K=t(35),X=babelHelpers.interopRequireWildcard(K),Z=t(58),$=babelHelpers.interopRequireWildcard(Z),ee=t(62),te=babelHelpers.interopRequireWildcard(ee),ie={color:!0,backgroundColor:!0,transform:!0,borderColor:!0,opacity:!0},re=function(e){function t(e,i){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];babelHelpers.classCallCheck(this,t);var n=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"UIManager"));return n._rnctx=e,n._guiSys=i,n.customDirectEventTypes={topLayout:{registrationName:"onLayout"},topLoadStart:{registrationName:"onLoadStart"},topLoad:{registrationName:"onLoad"},topLoadEnd:{registrationName:"onLoadEnd"},topEnter:{registrationName:"onEnter"},topExit:{registrationName:"onExit"},topMove:{registrationName:"onMove"},topDurationChange:{registrationName:"onDurationChange"},topEnded:{registrationName:"onEnded"},topTimeUpdate:{registrationName:"onTimeUpdate"},topPlayStatusChange:{registrationName:"onPlayStatusChange"}},n.customBubblingEventTypes={topChange:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"}},topInput:{phasedRegistrationNames:{bubbled:"onInput",captured:"onInputCapture"}},topHeadPose:{phasedRegistrationNames:{bubbled:"onHeadPose",captured:"onHeadPoseCapture"}}},n._views={},n._viewTypes={},n._viewCreator={},n._rootViews={},n._viewsOfType={},n._layoutAnimation=null,n.registerViewType("RCTView",c.default.describe(),function(){return new c.default(i)}),n.registerViewType("LiveEnvCamera",b.default.describe(),function(){return new b.default(i)}),n.registerViewType("RCTImageView",p.default.describe(),function(){return new p.default(i,e)}),n.registerViewType("Pano",y.default.describe(),function(){return new y.default(i,e)}),n.registerViewType("Model",C.default.describe(),function(){return new C.default(i,e)}),n.registerViewType("Scene",T.default.describe(),function(){return new T.default(i)}),n.registerViewType("Sound",k.default.describe(),function(){return new k.default(i,e)}),n.registerViewType("RCTText",S.default.describe(),function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new S.default(i,e,!!t.inSurfaceContext)}),n.registerViewType("RCTRawText",D.default.describe(),function(){return new D.default(i)}),n.registerViewType("Video",x.default.describe(),function(){return new x.default(i,e)}),n.registerViewType("VideoPano",G.default.describe(),function(){return new G.default(i,e)}),n.registerViewType("AmbientLight",Y.default.describe(),function(){return new Y.default(i)}),n.registerViewType("DirectionalLight",O.default.describe(),function(){return new O.default(i)}),n.registerViewType("PointLight",I.default.describe(),function(){return new I.default(i)}),n.registerViewType("SpotLight",M.default.describe(),function(){return new M.default(i)}),n.registerViewType("CylindricalPanel",U.default.describe(),function(){return new U.default(i)}),n.registerViewType("QuadPanel",A.default.describe(),function(){return new A.default(i)}),n.registerViewType("Box",a.default.describe(),function(){return new a.default(i,e)}),n.registerViewType("Cylinder",u.default.describe(),function(){return new u.default(i,e)}),n.registerViewType("Plane",l.default.describe(),function(){return new l.default(i,e)}),n.registerViewType("Sphere",f.default.describe(),function(){return new f.default(i,e)}),n.registerViewType("Prefetch",z.default.describe(),function(){return new z.default(i)}),r.forEach(function(e){var t=e.name,r=e.view;n.registerViewType(t,r.describe(),function(){return new r(i)})}),n}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"createView",value:function(e,t,i,r){var n=this._rootViews[String(i)],a=!(!n||!n.inSurfaceContext),o=this._viewCreator[t]({inSurfaceContext:a});return this._views[String(e)]=o,o.UIManager=this,o.tag=e,o.view&&(o.view.tag=e),o.rootTag=i,this._viewTypes[String(e)]=t,this._viewsOfType[t][String(e)]=o,this.updateView(e,t,r),this._views[String(e)].makeDirty(),this._views[String(e)]}},{key:"setChildren",value:function(e,t){for(var i=this._views[String(e)],r=0;r<t.length;r++){var n=this._views[String(t[r])];n&&(i.addChild(r,n),n.setParent(i),n.makeDirty())}}},{key:"manageChildren",value:function(e,t,i,r,n,a){var o=this._views[String(e)];if(o){var u=t?t.length:0,s=[],l=[],d=[],f=[];if(t&&i)for(var g=0;g<t.length;g++){var p=t[g],v=o.getChild(p).getTag();s[g]={tag:v,index:i[g]},l[g]=p,d[g]=v}if(r)for(var c=0;c<r.length;c++){var h=r[c],y=n[c];s[u+c]={tag:h,index:y}}if(a)for(var w=0;w<a.length;w++){var b=a[w],m=o.getChild(b).getTag();l[u+w]=b,d[u+w]=m,f[w]=m}s.sort(function(e,t){return e.index-t.index}),l.sort(function(e,t){return e-t});for(var C=l.length-1;C>=0;C--)o.removeChild(l[C]);for(var _=0;_<s.length;_++){var T=s[_],V=this._views[String(T.tag)];o.addChild(T.index,V),V.setParent(o),V.makeDirty()}for(var k=0;k<f.length;k++)this.purgeView(this._views[String(f[k])])}}},{key:"registerViewType",value:function(e,t,i){this[e]=t,this._viewCreator[e]=i,this._viewsOfType[e]={}}},{key:"updateView",value:function(e,t,i){var r=this._views[String(e)],n=!1;for(var a in i)this[t]&&this[t].NativeProps[a]?r.props[a]=i[a]:("function"==typeof r["_"+a]?r["_"+a](i[a]):r.style[a]=i[a],n=n||!ie[a]);n&&r.makeDirty(),"function"==typeof r.updateView&&r.updateView()}},{key:"purgeView",value:function(e){e.makeDirty(),e.dispose();var t=this._viewTypes[String(e.tag)];delete this._viewTypes[String(e.tag)],delete this._views[String(e.tag)],delete this._viewsOfType[t][String(e.tag)];for(var i=0;i<e.children.length;i++)this.purgeView(e.children[i]);e.children=[]}},{key:"createRootView",value:function(e,t,i){var r=this.createView(e,"RCTView",e,{});i&&(r.inSurfaceContext=!0),this._rootViews[String(e)]=r,this._guiSys.add(r.view,t)}},{key:"removeRootView",value:function(e){var t=this._views[String(e)];t&&(delete this._rootViews[String(e)],this.purgeView(t))}},{key:"replaceExistingNonRootView",value:function(e,t){var i=this._views[String(e)];if(i){i.makeDirty();var r=i.getParent();if(r){var n=r.getIndexOf(i);n!==-1&&this.manageChildren(r.getTag(),null,null,[t],[n],[n])}}}},{key:"removeSubviewsFromContainerWithID",value:function(e){var t=this._views[String(e)];if(t){t.makeDirty();for(var i=[],r=0;r<t.getChildCount();r++)i.push(r);for(var n=i.length-1;n>=0;n--){var a=t.getChild(i[n]);this.purgeView(a),a.setParent(null),t.removeChild(i[n])}}}},{key:"presentLayout",value:function(e){e.presentLayout&&e.presentLayout(),e.isDirty=!1;for(var t=0;t<e.children.length;t++)this.presentLayout(e.children[t])}},{key:"frame",value:function(e){this._lastFrameStart<0&&(this._lastFrameStart=e);var t=e-this._lastFrameStart;this._lastFrameStart=e;for(var i in this._views)this._views[i].frame(e,t);this.layout()}},{key:"layout",value:function(){for(var e in this._rootViews){var t=this._rootViews[e];t.YGNode.calculateLayout(te.UNDEFINED,te.UNDEFINED,te.DIRECTION_LTR),this.presentLayout(t)}}},{key:"getSceneCameraTransform",value:function(e){var t=this._viewsOfType.Scene;if(!t||0===Object.keys(t).length)return null;var i=function(t){for(var i in t){var r=t[i];if(r.rootTag===e)return r}return null}(t);return i&&i.style&&i.style.transform}},{key:"getLayers",value:function(){var e=this._viewsOfType.CylindricalPanel;return e}},{key:"setCursorVisibility",value:function(e){this._guiSys.setCursorVisibility(e)}},{key:"measureTextHeight",value:function(e,t,i,r,n){var a=$.wrapLines(this._guiSys.font,e,t,i,void 0,r),o=$.measureText(this._guiSys.font,a,t);this._rnctx.invokeCallback(n,[o.maxHeight])}},{key:"setBoundingBoxVisible",value:function(e,t){var i=this._views[String(e)],r=i.view;if(r){var n=null;if(r.children.forEach(function(e){e.__REACT_VR_BOUNDING&&(n=e)}),t){if(n)return;var a=new X.Box3;a.setFromObject(r);var o=new X.Mesh(new X.BoxGeometry(a.max.x-a.min.x,a.max.y-a.min.y,a.max.z-a.min.z,1,1,1),new X.MeshBasicMaterial({wireframe:!0,color:14962137}));o.__REACT_VR_BOUNDING=!0,r.add(o)}else{if(!n)return;r.remove(n)}}}},{key:"measure",value:function(e,t){var i=this._views[String(e)];if(!i)return void this._rnctx.invokeCallback(t,[]);for(var r=0,n=0,a=i.YGNode.getComputedWidth(),o=i.YGNode.getComputedHeight();i;)r+=i.YGNode.getComputedLeft()-i.YGNode.getComputedWidth()*i.style.layoutOrigin[0],n+=i.YGNode.getComputedTop()-i.YGNode.getComputedHeight()*i.style.layoutOrigin[1],i=i.getParent();this._rnctx.invokeCallback(t,[0,0,a,o,r,n])}},{key:"measureInWindow",value:function(e,t){var i=this._views[String(e)];if(!i)return void this._rnctx.invokeCallback(t,[]);for(var r=0,n=0,a=i.YGNode.getComputedWidth(),o=i.YGNode.getComputedHeight();i;)r+=i.YGNode.getComputedLeft()-i.YGNode.getComputedWidth()*i.style.layoutOrigin[0],n+=i.YGNode.getComputedTop()-i.YGNode.getComputedHeight()*i.style.layoutOrigin[1],i=i.getParent();this._rnctx.invokeCallback(t,[r,n,a,o])}},{key:"measureLayout",value:function(e,t,i,r){var n=this._views[String(e)];if(!n)return void this._rnctx.invokeCallback(i,[]);for(var a=0,o=0,u=n.YGNode.getComputedWidth(),s=n.YGNode.getComputedHeight();n&&n.tag!==t;)a+=n.YGNode.getComputedLeft()-n.YGNode.getComputedWidth()*n.style.layoutOrigin[0],o+=n.YGNode.getComputedTop()-n.YGNode.getComputedHeight()*n.style.layoutOrigin[1],n=n.getParent();this._rnctx.invokeCallback(r,[a,o,u,s])}},{key:"measureLayoutRelativeToParent",value:function(e,t,i){var r=this._views[String(e)];if(!r)return void this._rnctx.invokeCallback(i,[]);var n=r.YGNode.getComputedLeft()-r.YGNode.getComputedWidth()*r.style.layoutOrigin[0],a=r.YGNode.getComputedTop()-r.YGNode.getComputedHeight()*r.style.layoutOrigin[1],o=r.YGNode.getComputedWidth(),u=r.YGNode.getComputedHeight();this._rnctx.invokeCallback(i,[n,a,o,u])}},{key:"configureNextLayoutAnimation",value:function(e,t,i){this._layoutAnimation=e}},{key:"dispatchViewManagerCommand",value:function(e,t,i){var r=this._views[String(e)];return r?void r.receiveCommand(t,i):void console.warn("UIManager.dispatchViewManagerCommand: dispatching command on a nonexistent view: "+e)}}]),t}(J.default);r.default=re},52);
__d(function(e,t,i,r){Object.defineProperty(r,"__esModule",{value:!0});var n=t(35),d=t(54),s=babelHelpers.interopRequireDefault(d),o=t(55),a=babelHelpers.interopRequireDefault(o),p=function(e){function t(e,i){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i));return r._dimWidth=1,r._dimHeight=1,r._dimDepth=1,r._needsUpdate=!1,Object.defineProperty(r.props,"dimWidth",{set:function(e){r._dimWidth=e,r._needsUpdate=!0}}),Object.defineProperty(r.props,"dimHeight",{set:function(e){r._dimHeight=e,r._needsUpdate=!0}}),Object.defineProperty(r.props,"dimDepth",{set:function(e){r._dimDepth=e,r._needsUpdate=!0}}),r._generateGeometry=r._generateGeometry.bind(r),r}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"frame",value:function(){this._needsUpdate&&(this._needsUpdate=!1,this._generateGeometry())}},{key:"_generateGeometry",value:function(){var e=new n.BoxBufferGeometry(this._dimWidth,this._dimHeight,this._dimDepth);this._setGeometry(e)}}],[{key:"describe",value:function(){return(0,s.default)(babelHelpers.get(t.__proto__||Object.getPrototypeOf(t),"describe",this).call(this),{NativeProps:{dimWidth:"number",dimHeight:"number",dimDepth:"number"}})}}]),t}(a.default);r.default=p},53);
__d(function(e,r,o,t){function n(e,r){var o={};for(var t in r)e.hasOwnProperty(t)&&r.hasOwnProperty(t)?"object"==typeof e[t]&&"object"==typeof r[t]?o[t]=n(e[t],r[t]):o[t]=r[t]:r.hasOwnProperty(t)&&(o[t]=r[t]);for(var a in e)a in r||!e.hasOwnProperty(a)||(o[a]=e[a]);return o}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},54);
__d(function(e,t,r,i){Object.defineProperty(i,"__esModule",{value:!0});var a=t(35),l=babelHelpers.interopRequireWildcard(a),s=t(56),n=babelHelpers.interopRequireDefault(s),o=t(61),u=babelHelpers.interopRequireDefault(o),h=t(54),_=babelHelpers.interopRequireDefault(h),p=t(62),d=babelHelpers.interopRequireWildcard(p),c=t(64),f=babelHelpers.interopRequireDefault(c),b=function(e){function t(e,r){babelHelpers.classCallCheck(this,t);var i=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return i._lit=!1,i._shader=!1,i._wireframe=!1,i._textureURL=null,i._loadingURL=null,i._texture=null,i._litMaterial=new l.MeshPhongMaterial({color:16777215}),i._unlitMaterial=new l.MeshBasicMaterial({color:16777215}),i._shaderMaterial=new l.ShaderMaterial,i._shaderUniformsMap={texture:{value:null}},i._rnctx=r,i.mesh=null,i.view=new n.default(e),Object.defineProperty(i.style,"opacity",{configurable:!0,set:function(e){null===e?(i._litMaterial.opacity=1,i._unlitMaterial.opacity=1,i._litMaterial.transparent=!1,i._unlitMaterial.transparent=!1):(i._litMaterial.opacity=e,i._unlitMaterial.opacity=e,i._litMaterial.transparent=e<1,i._unlitMaterial.transparent=e<1)}}),Object.defineProperty(i.props,"pointerEvents",{set:function(e){null===e&&(e="auto"),i.view.setPointerEvents(e)}}),Object.defineProperty(i.props,"lit",{set:i._setLit.bind(i)}),Object.defineProperty(i.props,"wireframe",{set:i._setWireframe.bind(i)}),Object.defineProperty(i.props,"materialParameters",{set:i._setMaterialParameters.bind(i)}),Object.defineProperty(i.props,"texture",{set:i._setTexture.bind(i)}),Object.defineProperty(i.style,"color",{set:i._setColor.bind(i)}),i}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"_setColor",value:function(e){this._color=e,null==e?(this._litMaterial.color.setHex(16777215),this._unlitMaterial.color.setHex(16777215)):(this._litMaterial.color.setHex(e),this._unlitMaterial.color.setHex(e))}},{key:"_setTexture",value:function(e){var t=this;if(!e)return this._texture&&(this._texture=null,this._textureURL&&(this._rnctx.TextureManager.removeReference(this._textureURL),this._textureURL=null)),this._litMaterial.map=null,this._unlitMaterial.map=null,this._shaderUniformsMap.texture.value=null,this._litMaterial.needsUpdate=!0,this._unlitMaterial.needsUpdate=!0,void(this._shaderMaterial.needsUpdate=!0);var r=(0,u.default)(e);if(!r)throw new Error('Invalid value for "texture" property: '+JSON.stringify(e));var i="object"==typeof e?e.repeat:null;this._loadingURL=r;var a=this._rnctx.TextureManager;a.addReference(r),a.getTextureForURL(r).then(function(e){if(r!==t._loadingURL)return void a.removeReference(r);if(t._loadingURL=null,t._textureURL&&a.removeReference(t._textureURL),t._texture=e,t._texture.needsUpdate=!0,t._textureURL=r,i&&Array.isArray(i)){var s;t._texture.wrapS=l.RepeatWrapping,t._texture.wrapT=l.RepeatWrapping,(s=t._texture.repeat).set.apply(s,babelHelpers.toConsumableArray(i))}t._litMaterial.map=t._texture,t._unlitMaterial.map=t._texture,t._shaderUniformsMap.texture.value=e,t._litMaterial.needsUpdate=!0,t._unlitMaterial.needsUpdate=!0,t._shaderMaterial.needsUpdate=!0},function(e){a.removeReference(r),t._loadingURL=null,console.error(e)}).catch(function(e){console.error(e)})}},{key:"_setLit",value:function(e){this._lit=e;var t=this._shader?this._shaderMaterial:e?this._litMaterial:this._unlitMaterial;this.mesh&&(this.mesh.material=t)}},{key:"_setWireframe",value:function(e){this._wireframe=e,this._litMaterial.wireframe=e,this._unlitMaterial.wireframe=e}},{key:"_setGeometry",value:function(e){if(this.mesh)this.mesh.geometry=e;else{var t=this._shader?this._shaderMaterial:this._lit?this._litMaterial:this._unlitMaterial;this.mesh=new l.Mesh(e,t),this.view.add(this.mesh)}}},{key:"_setMaterialParameters",value:function(e){if(e||(e={fog:!0,blending:l.NormalBlending,side:l.FrontSide,shading:l.SmoothShading,vertexColors:l.NoColors,transparent:!1,blendSrc:l.SrcAlphaFactor,blendDst:l.OneMinusSrcAlphaFactor,blendEquation:l.AddEquation,blendSrcAlpha:null,blendDstAlpha:null,blendEquationAlpha:null,depthFunc:l.LessEqualDepth,depthTest:!0,depthWrite:!0,clippingPlanes:null,clipShadows:!1,colorWrite:!0}),e.vertexShader||e.fragmentShader){var t=e.uniforms||{};delete e.uniforms;var r=this._shaderMaterial.uniforms;for(var i in r)delete r[i];for(var a in this._shaderUniformsMap)r[a]=this._shaderUniformsMap[a];for(var s in t)r[s]=t[s];this._shaderMaterial.setValues(e),this._shader=!0,this.mesh&&(this.mesh.material=this._shaderMaterial)}else this._litMaterial.setValues(e),this._unlitMaterial.setValues(e),this._shader=!1,this.mesh&&(this.mesh.material=this._lit?this._litMaterial:this._unlitMaterial)}},{key:"presentLayout",value:function(){babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"presentLayout",this).call(this),this.mesh&&this.mesh.geometry&&(this.mesh.geometry.visible=this.YGNode.getDisplay()!==d.DISPLAY_NONE)}},{key:"dispose",value:function(){this._texture&&(this._texture=null,this._textureURL&&(this._rnctx.TextureManager.removeReference(this._textureURL),this._textureURL=null)),this._litMaterial.dispose(),this._shaderMaterial.dispose(),this._unlitMaterial.dispose(),babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"dispose",this).call(this),this._geometry=null,this.mesh=null}}],[{key:"describe",value:function(){return(0,_.default)(babelHelpers.get(t.__proto__||Object.getPrototypeOf(t),"describe",this).call(this),{NativeProps:{lit:"boolean",pointerEvents:"string",texture:"object",wireframe:"boolean",materialParameters:"object"}})}}]),t}(f.default);i.default=b},55);
__d(function(t,e,i,a){function r(t,e){o.Object3D.call(this),this.type="UIView",this.clippingEnabled=!1,this.clipPlanes=[new o.Plane(new o.Vector3(1,0,0),16384),new o.Plane(new o.Vector3(-1,0,0),16384),new o.Plane(new o.Vector3(0,1,0),16384),new o.Plane(new o.Vector3(0,-1,0),16384)],this.geometry=new o.PlaneGeometry(0,0),this.backgroundMaterial=new o.MeshBasicMaterial({clippingPlanes:this.clipPlanes,color:d,side:o.DoubleSide}),this.backgroundMaterial.transparent=!0,this.backgroundMaterial.visible=!1,this.backgroundMaterial.depthWrite=!1,this.borderMaterial=new o.MeshBasicMaterial({clippingPlanes:this.clipPlanes,color:f,side:o.DoubleSide}),this.borderMaterial.transparent=!0,this.borderMaterial.visible=!1,this.borderMaterial.depthWrite=!1,this.imageMaterial=new o.MeshBasicMaterial({clippingPlanes:this.clipPlanes,color:y,side:o.DoubleSide}),this.imageMaterial.transparent=!0,this.imageMaterial.visible=!1,this.imageMaterial.depthWrite=!1,this.material=[this.backgroundMaterial,this.borderMaterial,this.imageMaterial],this.material.side=o.DoubleSide,this.guiSys=t,this.zIndex=0,this.drawMode=o.TrianglesDrawMode,this.opacity=1,this.dirtyGeometry=!0,this.frame=[0,0,0,0],this.targetFrame=[0,0,0,0],this.frameDirty=!0,this.inset=[0,0,0,0],this.insetSize=[0,0,0,0],this.hitSlop=[0,0,0,0],this.cursorVisibilitySlop=[0,0,0,0],this.borderWidth=[0,0,0,0],this.borderRadius=[0,0,0,0],this.scaleType=(0,l.defaultScaleType)(),this.textureDim=[0,0],this.crop=[0,0,1,1],this.backgroundOpacity=1,this.borderOpacity=1,this.imageOpacity=1,this.matrixAutoUpdate=!1,this.localRotate=new o.Matrix4,this.localPosition=[0,0,0],this.layoutZOffset=m,this.text=null,this.textDirty=!1,this.textHAlign=h.CENTER_LINE,this.textLinecount=0,this.textVAlign=h.CENTER,this.textColor=new o.Color,this.textSize=2,this.textMesh=new o.Mesh(new o.BufferGeometry,t.font.material),this.textMesh.type="SDFText",this.textMesh.textClip=[-16384,-16384,16384,16384],this.textMesh.visible=!1,this.textMesh.onBeforeRender=function(t,e,i,a,r,s){a&&a.isSDFText&&a.onBeforeRender(this,r)},this.textFontParms={AlphaCenter:.47,ColorCenter:.5},this.autoScale=!1,this.isInteractable=!1,this.isMouseInteractable=!1,this.pointerEvents=l.PointerEvents.AUTO,this.billboarding="off",this.immediateListener=null,void 0!==e&&(0,l.setParams)(this,e),this.textMesh.raycast=function(){},this.add(this.textMesh)}Object.defineProperty(a,"__esModule",{value:!0}),a.default=r;var s=e(35),o=babelHelpers.interopRequireWildcard(s),n=e(57),h=e(58),l=e(60),m=1,c=0,u=1,p=2,d=16777215,f=0,y=16777215,g={spring:function(t){return 1+Math.pow(2,-10*t)*Math.sin((t-.125)*Math.PI*2/.5)},linear:function(t){return t},easeInEaseOut:function(t){return t<.5?2*t*t:-1+(4-2*t)*t},easeIn:function(t){return t*t},easeOut:function(t){return t*(2-t)},keyboard:function(t){return t}};r.prototype=babelHelpers.extends(Object.create(o.Object3D.prototype),{constructor:r,isMesh:!0,isGui:!0,updateGeometry:function(t){var e=new o.Matrix4,i={frame:[0,0,0,0]};return function(t){if(this.dirtyGeometry){this.text?this.textDirty&&(this.autoScale&&(i.dim=(0,h.measureText)(this.guiSys.font,this.text,this.textSize),this.frame[2]=i.dim.maxWidth,this.frame[3]=i.dim.maxHeight),i.frame[0]=-this.frame[2]/2,i.frame[1]=-this.frame[3]/2,i.frame[2]=this.frame[2],i.frame[3]=this.frame[3],i.hAlign=this.textHAlign,i.vAlign=this.textVAlign,i.lineCount=this.textLinecount,i.fontParms=this.textFontParms,i.autoScale=this.autoScale,this.textMesh.geometry.dispose(),this.textMesh.geometry=new h.BitmapFontGeometry(this.guiSys.font,this.text,this.textSize,i),this.textMesh.visible=!!this.textMesh.geometry,this.textMesh.material=this.textMesh.geometry.materials,this.textMesh.position.z=.01,this.textDirty=!1):(this.textMesh.geometry.dispose(),this.textMesh.visible=!1,this.textDirty=!1);var a=this.frame[0]+this.frame[2]/2,r=this.frame[1]-this.frame[3]/2,s=this.layoutZOffset*this.guiSys.ZOffsetScale;this.parent&&this.parent.frame&&(a-=this.parent.frame[2]/2,r+=this.parent.frame[3]/2),this.localTransform?(this.matrix.fromArray(this.localTransform),this.matrix.elements[12]+=a,this.matrix.elements[13]+=r,this.matrix.elements[14]+=s):(e.makeTranslation(a+this.localPosition[0],r+this.localPosition[1],s+this.localPosition[2]),this.matrix.multiplyMatrices(e,this.localRotate)),this.frameDirty&&(this.geometry.dispose(),this.geometry=new n.VectorGeometry([this.frame[2],this.frame[3]],this.borderMaterial.visible?this.borderWidth:void 0,this.borderRadius,c,p,u),this.needsUpdate=!0,this.frameDirty=!1),this.dirtyGeometry=!1}}}(),updateBillboard:function(t){var e=new o.Vector3,i=new o.Vector3,a=new o.Vector3,r=new o.Vector3,s=new o.Vector3,n=new o.Vector3,h=new o.Vector3,l=new o.Vector3,m=new o.Vector3(0,1,0),c=new o.Matrix4,u=new o.Matrix4,p=new o.Matrix4;return function(t){var o=t.camera.matrixWorld;e.setFromMatrixPosition(this.matrixWorld),i.setFromMatrixPosition(o),o.extractBasis(a,r,s),h.copy(m),l.copy(s),l.y=0,l.normalize(),n.crossVectors(h,l).normalize(),c.identity();var d=c.elements;d[0]=n.x,d[4]=h.x,d[8]=l.x,d[1]=n.y,d[5]=h.y,d[9]=l.y,d[2]=n.z,d[6]=h.z,d[10]=l.z,this.parent&&(u.getInverse(this.parent.matrixWorld),p.extractRotation(u),c.multiply(p)),this.matrix.extractRotation(c)}}(),applyUpdates:function(t,e){this.updateGeometry(e),this.backgroundMaterial.opacity=t*this.backgroundOpacity,this.borderMaterial.opacity=t*this.borderOpacity,this.imageMaterial.opacity=t*this.imageOpacity,this.textMesh.opacity=t},setFrame:function(t,e,i,a,r){if(t!==this.targetFrame[0]||e!==this.targetFrame[1]||i!==this.targetFrame[2]||a!==this.targetFrame[3])if(this.targetFrame[0]=t,this.targetFrame[1]=e,this.targetFrame[2]=i,this.targetFrame[3]=a,r){var s=this,o=[this.frame[0],this.frame[1],this.frame[2],this.frame[3]],n=Date.now(),h=0===this.frame[2]&&0===this.frame[3]&&r.create?r.create:r.update,l=function l(m){var c=m-n,u=h?g[h.type](Math.min(1,c/r.duration)):1,p=1-u;s.frame[0]=o[0]*p+t*u,s.frame[1]=o[1]*p+e*u,s.frame[2]=o[2]*p+i*u,s.frame[3]=o[3]*p+a*u,s.dirtyGeometry=!0,s.frameDirty=!0,c<r.duration&&h?s.animatorHandle=s.guiSys.requestFrameFunction(l):s.animatorHandle=null};this.guiSys.cancelFrameFunction(s.animatorHandle),l(n)}else this.frame[0]=t,this.frame[1]=e,this.frame[2]=i,this.frame[3]=a,this.dirtyGeometry=!0,this.frameDirty=!0},setHitSlop:function(t,e,i,a){this.hitSlop[0]=t,this.hitSlop[1]=e,this.hitSlop[2]=i,this.hitSlop[3]=a},setCursorVisibilitySlop:function(t,e,i,a){this.cursorVisibilitySlop[0]=t,this.cursorVisibilitySlop[1]=e,this.cursorVisibilitySlop[2]=i,this.cursorVisibilitySlop[3]=a},setLayoutZOffset:function(t){this.layoutZOffset=t,this.dirtyGeometry=!0},setLocalTransform:function(t){this.localTransform=t.slice(),this.dirtyGeometry=!0},setLocalRotation:function(t){t.isEuler?this.localRotate.makeRotationFromEuler(t):this.localRotate.makeRotationFromQuaternion(t),this.localTransform=void 0,this.dirtyGeometry=!0},setLocalPosition:function(t){this.localTransform=void 0,this.localPosition[0]=t[0],this.localPosition[1]=t[1],this.localPosition[2]=t[2],this.dirtyGeometry=!0},setImage:function(t,e,i){var a=this;if(t){if(this.imageMaterial.mapurl===t)return void(e&&e(!0,this.imageMaterial.map.naturalWidth,this.imageMaterial.map.naturalHeight));delete this.imageMaterial.mapurl;var r=new o.TextureLoader;r.setCrossOrigin("Access-Control-Allow-Origin"),r.load(t,function(i){a.imageMaterial.map=i,a.imageMaterial.mapurl=t,a.updateOffsetRepeat(),a.imageMaterial.visible=!0,a.imageMaterial.needsUpdate=!0,e&&e(!0,i.image.naturalWidth,i.image.naturalHeight)},function(t){},function(t){a.imageMaterial.map&&a.imageMaterial.map.dispose(),a.imageMaterial.map=void 0,e&&e(!1)}),this.imageMaterial.visible=!!i}else this.imageMaterial.map&&this.imageMaterial.map.dispose(),this.imageMaterial.map=void 0,this.imageMaterial.visible=!1,e&&e(!1);this.imageMaterial.needsUpdate=!0},setImageTexture:function(t){if(t){if(!(t instanceof o.Texture||t.isWebGLRenderTarget))throw new Error("Image textures must be of type THREE.Texture");delete this.imageMaterial.mapurl,this.imageMaterial.map=t,this.updateOffsetRepeat(),this.imageMaterial.visible=!0}else this.imageMaterial.mapurl&&(this.imageMaterial.map&&this.imageMaterial.map.dispose(),delete this.imageMaterial.mapurl),delete this.imageMaterial.map,this.imageMaterial.visible=!1;this.imageMaterial.needsUpdate=!0},setClipPlanes:function(t){this.clipPlanes[0].setComponents(1,0,0,-t[0]),this.clipPlanes[1].setComponents(-1,0,0,t[2]),this.clipPlanes[2].setComponents(0,1,0,-t[1]),this.clipPlanes[3].setComponents(0,-1,0,t[3])},setImageColor:function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];null==e[0]?(this.imageOpacity=1,this.imageMaterial.color.set(y)):(this.imageOpacity="number"==typeof e[0]?(e[0]>>24&255)/255:1,this.imageMaterial.color.set.apply(this.imageMaterial.color,e)),this.imageMaterial.needsUpdate=!0},setBackgroundColor:function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];null==e[0]?(this.backgroundOpacity=1,this.backgroundMaterial.color.set(d),this.backgroundMaterial.visible=!1):(this.backgroundOpacity="number"==typeof e[0]?(e[0]>>24&255)/255:1,this.backgroundMaterial.color.set.apply(this.backgroundMaterial.color,e),this.backgroundMaterial.visible=!0),this.backgroundMaterial.needsUpdate=!0},setBorderColor:function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];null==e[0]?(this.borderOpacity=1,this.borderMaterial.color.set(f)):(this.borderOpacity="number"==typeof e[0]?(e[0]>>24&255)/255:1,this.borderMaterial.color.set.apply(this.borderMaterial.color,arguments)),this.borderMaterial.needsUpdate=!0},setInset:function(t){this.inset=t.slice(),this.dirtyGeometry=!0},setInsetSize:function(t){this.insetSize=t.slice(),this.dirtyGeometry=!0},setBorderWidth:function(t){var e=void 0;e="number"==typeof t?[t,t,t,t]:t,e[0]===this.borderWidth[0]&&e[1]===this.borderWidth[1]&&e[2]===this.borderWidth[2]&&e[3]===this.borderWidth[3]||(this.borderWidth=e.slice(),this.borderMaterial.visible=e[0]>0||e[1]>0||e[2]>0||e[3]>0,this.frameDirty=!0,this.dirtyGeometry=!0)},setBorderRadius:function(t){for(var e=0;e<4;e++)this.borderRadius[e]!==t[e]&&(this.borderRadius[e]=t[e],this.frameDirty=!0,this.dirtyGeometry=!0)},setResizeMode:function(t){var e=(0,l.resizeModetoScaleType)(t);this.scaleType!==e&&(this.scaleType=e,this.frameDirty=!0,this.dirtyGeometry=!0)},setTextureCrop:function(t){this.crop=t.slice(),this.updateOffsetRepeat()},updateOffsetRepeat:function(){if(this.imageMaterial.map){var t=new o.Vector2(this.crop[0],1-(this.crop[1]+this.crop[3])),e=new o.Vector2(this.crop[2],this.crop[3]);if(this.imageMaterial.map.offset!==t||this.imageMaterial.map.repeat!==e){this.imageMaterial.map.offset=t,this.imageMaterial.map.repeat=e,this.imageMaterial.needsUpdate=!0;var i=this.imageMaterial.map.image?this.imageMaterial.map.image.width:0,a=this.imageMaterial.map.image?this.imageMaterial.map.image.height:0;i===this.textureDim[0]&&a===this.textureDim[0]||(this.textureDim=[i,a],this.frameDirty=!0,this.dirtyGeometry=!0)}}},setOpacity:function(t){this.opacity=t,this.visible=t>0},setAlphaTest:function(t){this.imageMaterial.alphaTest=t,this.imageMaterial.needsUpdate=!0},setText:function(t){this.text=t,this.textDirty=!0,this.dirtyGeometry=!0},setTextAlphaCenter:function(t){this.textFontParms.AlphaCenter=t,this.dirtyGeometry=!0},setTextColor:function(t){this.textColor.set(t)},setTextColorCenter:function(t){this.textFontParms.ColorCenter=t,this.dirtyGeometry=!0},setTextHAlign:function(t){this.textDirty=!0,this.textHAlign=t,this.dirtyGeometry=!0},setTextLinecount:function(t){this.textDirty=!0,this.textLinecount=t,this.dirtyGeometry=!0},setTextSize:function(t){this.textDirty=!0,this.textSize=t,this.dirtyGeometry=!0},setTextVAlign:function(t){this.textDirty=!0,this.textVAlign=t,this.dirtyGeometry=!0},setAutoScale:function(t){this.autoScale=t},setIsInteractable:function(t){this.isInteractable=t},setIsMouseInteractable:function(t){this.isMouseInteractable=t},setPointerEvents:function(t){this.pointerEvents=t},setBillboarding:function(t){this.billboarding=t},calcWorldClipRect:function(){return this.clippingEnabled?[this.matrixWorld.elements[12]-this.frame[2]/2,this.matrixWorld.elements[13]-this.frame[3]/2,this.matrixWorld.elements[12]+this.frame[2]/2,this.matrixWorld.elements[13]+this.frame[3]/2]:[0,0,16384,16384]},setImmediateListener:function(t){this.immediateListener=t},shouldAcceptHitEvent:function(){return!(this.pointerEvents===l.PointerEvents.NONE||this.pointerEvents===l.PointerEvents.BOX_NONE)},shouldInterceptHitEvent:function(){return this.pointerEvents===l.PointerEvents.NONE||this.pointerEvents===l.PointerEvents.BOX_ONLY},forceRaycastTest:function(t){this.forceRaycastTestEnabled=t},raycast:function(){function t(t,e){var o=-t[2]/2-e[0],m=-t[3]/2-e[3],c=t[2]/2+e[2],u=t[3]/2+e[1];a.fromArray([o,u,0]),r.fromArray([c,u,0]),s.fromArray([o,m,0]),n.fromArray([c,m,0]);var p=i.intersectTriangle(a,r,n,!1,l);if(p=p||i.intersectTriangle(a,n,s,!1,l)){var d=c-o,f=u-m;h.set((l.x+d/2)/d,(-l.y+f/2)/f,0)}return p}var e=new o.Matrix4,i=new o.Ray,a=new o.Vector3,r=new o.Vector3,s=new o.Vector3,n=new o.Vector3,h=new o.Vector3,l=new o.Vector3,m=new o.Vector3;return function(a,r){var s=this.material;if(!this.forceRaycastTestEnabled){if(void 0===s)return;if(this.backgroundMaterial.opacity<.00392156862745098&&this.borderMaterial.opacity<.00392156862745098&&this.imageMaterial.opacity<.00392156862745098)return;if(!this.backgroundMaterial.visible&&!this.borderMaterial.visible&&!this.imageMaterial.visible)return}e.getInverse(this.matrixWorld),i.copy(a.ray).applyMatrix4(e);var o=t(this.frame,this.hitSlop),n=!1;if(!o){var l=this.cursorVisibilitySlop[0]>this.hitSlop[0]||this.cursorVisibilitySlop[1]>this.hitSlop[1]||this.cursorVisibilitySlop[2]>this.hitSlop[2]||this.cursorVisibilitySlop[3]>this.hitSlop[3];if("auto"===this.guiSys.cursorVisibility&&l&&(o=t(this.frame,this.cursorVisibilitySlop)),!o)return;n=!0}m.copy(o),m.applyMatrix4(this.matrixWorld);var c=a.ray.origin.distanceTo(m);c<a.near||c>a.far||r.push({distance:c,point:m.clone(),object:this,isAlmostHit:n,uv:h.clone()})}}(),clone:function(){return new this.constructor(this.material).copy(this)},dispose:function(){this.geometry&&(this.geometry.dispose(),this.geometry=null),this.material&&(this.material.dispose(),this.material=null)}})},56);
__d(function(t,i,o,n){function s(t,i){var o;(o=t.positions).push.apply(o,babelHelpers.toConsumableArray(i)),t.positions.push(0)}function e(t,i,o){var n,s;(n=t.positions).push.apply(n,babelHelpers.toConsumableArray(i)),t.positions.push(0),(s=t.positions).push.apply(s,babelHelpers.toConsumableArray(o)),t.positions.push(0)}function a(t,i,o,n,e,r,p,h,u,v){if(!(v>10)){var f=.5*(i+n),l=.5*(o+e),d=.5*(n+r),c=.5*(e+p),m=.5*(r+h),M=.5*(p+u),b=.5*(f+d),g=.5*(l+c),y=h-i,A=u-o,w=Math.abs((n-h)*A-(e-u)*y),B=Math.abs((r-h)*A-(p-u)*y),G=1e-4*(y*y+A*A);if(G<=0||(w+B)*(w+B)<G)return void s(t,[h,u]);var k=.5*(d+m),H=.5*(c+M),_=.5*(b+k),x=.5*(g+H);a(t,i,o,f,l,b,g,_,x,v+1),a(t,_,x,k,H,m,M,h,u,v+1)}}function r(t,i,o,n,e,a,p,h,u,v,f,l,d,c,m,M,b,g){if(!(g>10)){var y=.5*(i+n),A=.5*(o+e),w=.5*(n+a),B=.5*(e+p),G=.5*(a+h),k=.5*(p+u),H=.5*(y+w),_=.5*(A+B),x=h-i,C=u-o,R=Math.abs((n-h)*C-(e-u)*x),j=Math.abs((a-h)*C-(p-u)*x),F=1e-4*(x*x+C*C);if(F<=0||(R+j)*(R+j)<F)return s(t,[h,u]),void s(t,[M,b]);var I=.5*(w+G),O=.5*(B+k),U=.5*(H+I),V=.5*(_+O),q=.5*(v+l),P=.5*(f+d),S=.5*(l+c),W=.5*(d+m),z=.5*(c+M),D=.5*(m+b),E=.5*(q+S),J=.5*(P+W),K=.5*(S+z),L=.5*(W+D),N=.5*(E+K),Q=.5*(J+L);r(t,i,o,y,A,H,_,U,V,v,f,q,P,E,J,N,Q,g+1),r(t,U,V,I,O,G,k,h,u,N,Q,K,L,z,D,M,b,g+1)}}function p(t,i,o){for(var n={positions:[]},e=0,r=void 0,p=void 0,h=void 0,u=void 0;e<t.length;){var v=t[e];switch(v){case b:r=t[e+1],s(n,r),e+=2;break;case g:r=t[e+1],s(n,r),e+=2;break;case y:p=n.positions.length-3,h=t[e+1],u=t[e+2],r=t[e+3],a(n,n.positions[p+0],n.positions[p+1],h[0],h[1],u[0],u[1],r[0],r[1],0),e+=4}}if(n.length>1){var f=n.positions.length-3,l=n.positions[f+0]-n.positions[0],d=n.positions[f+1]-n.positions[1],c=l*l+d*d;c<.001&&(n.length-=1)}var m=[];if(i>0&&o>0)for(var M=0;M<n.positions.length;M+=3)m.push(n.positions[M+0]/i+.5),m.push(n.positions[M+1]/o+.5);else for(var A=0;A<n.positions.length;A+=3)m.push(0),m.push(0);return n.uvs=m,n}function h(t,i,o){for(var n={positions:[]},s=0,a=void 0,p=void 0,h=void 0,u=void 0,v=void 0,f=void 0,l=void 0,d=void 0;s<t.length;){var c=t[s];switch(c){case b:a=t[s+1],s+=2,h=t[s+1],e(n,a,h),s+=2;break;case g:a=t[s+1],s+=2,h=t[s+1],e(n,a,h),s+=2;break;case y:p=n.positions.length-6,u=n.positions.length-3,v=t[s+1],f=t[s+2],a=t[s+3],s+=4,l=t[s+1],d=t[s+2],h=t[s+3],r(n,n.positions[p+0],n.positions[p+1],v[0],v[1],f[0],f[1],a[0],a[1],n.positions[u+0],n.positions[u+1],l[0],l[1],d[0],d[1],h[0],h[1],0),s+=4}}var m=[];if(i>0&&o>0)for(var M=0;M<n.positions.length;M+=3)m.push(n.positions[M+0]/i+.5),m.push(n.positions[M+1]/o+.5);else for(var A=0;A<n.positions.length;A+=3)m.push(0),m.push(0);return n.uvs=m,n}function u(t,i,o,n){var s=[b,[t,i],g,[t,i+n],g,[t+o,i+n],g,[t+o,i]];return p(s,o,n)}function v(t,i,o,n,s,e,a,r){if(a<.001&&r<.001&&s<.001&&e<.001)return u(t,i,o,n);var h=.5*Math.abs(o),v=.5*Math.abs(n),f=Math.min(e,h),l=Math.min(e,v),d=Math.min(s,h),c=Math.min(s,v),m=Math.min(r,h),M=Math.min(r,v),w=Math.min(a,h),B=Math.min(a,v),G=[b,[t,i+B],g,[t,i+n-l],y,[t,i+n-l*(1-A)],[t+f*(1-A),i+n],[t+f,i+n],g,[t+o-d,i+n],y,[t+o-d*(1-A),i+n],[t+o,i+n-c*(1-A)],[t+o,i+n-c],g,[t+o,i+M],y,[t+o,i+M*(1-A)],[t+o-m*(1-A),i],[t+o-m,i],g,[t+w,i],y,[t+w*(1-A),i],[t,i+B*(1-A)],[t,i+B]];return p(G,o,n)}function f(t){for(var i=[],o=2;o<t;o++)i.push(0),i.push(o-1),i.push(o);return i}function l(t,i,o,n,s,e,a,r,p,u,v,f){var l=Math.min(o,s),d=Math.max(l,o-a)-l,c=Math.min(n,r),m=Math.max(c,n-e)-c;if(v<.001&&f<.001&&p<.001&&u<.001){var M=[b,[t,i],b,[t+l,i+c],g,[t,i+n],g,[t+l,i+c+m],g,[t+o,i+n],g,[t+l+d,i+c+m],g,[t+o,i],g,[t+l+d,i+c]];return h(M)}var w=.5*o,B=.5*n,G=.5*d,k=.5*m,H=Math.min(u,w),_=Math.min(u,B),x=Math.min(p,w),C=Math.min(p,B),R=Math.min(f,w),j=Math.min(f,B),F=Math.min(v,w),I=Math.min(v,B),O=Math.min(u,G),U=Math.min(u,k),V=Math.min(p,G),q=Math.min(p,k),P=Math.min(f,G),S=Math.min(f,k),W=Math.min(v,G),z=Math.min(v,k),D=[b,[t,i+I],b,[t+l,i+c+z],g,[t,i+n-_],g,[t+l,i+c+m-U],y,[t,i+n-_*(1-A)],[t+H*(1-A),i+n],[t+H,i+n],y,[t+l,i+c+m-U*(1-A)],[t+l+O*(1-A),i+c+m],[t+l+O,i+c+m],g,[t+o-x,i+n],g,[t+l+d-V,i+c+m],y,[t+o-x*(1-A),i+n],[t+o,i+n-C*(1-A)],[t+o,i+n-C],y,[t+l+d-V*(1-A),i+c+m],[t+l+d,i+c+m-q*(1-A)],[t+l+d,i+c+m-q],g,[t+o,i+j],g,[t+l+d,i+c+S],y,[t+o,i+j*(1-A)],[t+o-R*(1-A),i],[t+o-R,i],y,[t+l+d,i+c+S*(1-A)],[t+l+d-P*(1-A),i+c],[t+l+d-P,i+c],g,[t+F,i],g,[t+l+W,i+c],y,[t+F*(1-A),i],[t,i+I*(1-A)],[t,i+I],y,[t+l+W*(1-A),i+c],[t+l,i+c+z*(1-A)],[t+l,i+c+z]];return h(D)}function d(t,i){for(var o=[],n=0;n<i;n+=2){var s=(n+2)%i;o.push(n+t),o.push(s+t),o.push(n+1+t),o.push(n+1+t),o.push(s+t),o.push(s+1+t)}return o}function c(t,i,o,n,s,e){M.BufferGeometry.apply(this),t=t||[1,1];var a=v(.5*-t[0],.5*-t[1],t[0],t[1],o[0],o[1],o[2],o[3]),r=f(a.positions.length/3),p=r.length;if(i){var h=l(.5*-t[0],.5*-t[1],t[0],t[1],i[0],i[1],i[2],i[3],o[0],o[1],o[2],o[3]),u=d(a.positions.length/3,h.positions.length/3);a.positions=a.positions.concat(h.positions),a.uvs=a.uvs.concat(h.uvs),r=r.concat(u)}this.addAttribute("position",new M.BufferAttribute(new Float32Array(a.positions),3)),this.addAttribute("uv",new M.BufferAttribute(new Float32Array(a.uvs),2)),this.addGroup(0,p,n),this.addGroup(0,p,s),i&&this.addGroup(p,r.length-p,e),this.setIndex(new M.BufferAttribute(new Uint32Array(r),1)),this.needsUpdate=!0,this.computeBoundingSphere()}Object.defineProperty(n,"__esModule",{value:!0}),n.vgRoundedBorderRectVarying=l,n.vgGenerateIndicesBorder=d,n.VectorGeometry=c;var m=i(35),M=babelHelpers.interopRequireWildcard(m),b=0,g=1,y=2,A=.5522847493;c.prototype=Object.create(M.BufferGeometry.prototype),c.prototype.constructor=c},57);
__d(function(t,e,a,i){function r(t){return 32===t||13===t||10===t}function n(t){return 13===t||10===t}function o(t){return 32===t||9===t}function s(t,e,a){var i=e.data.CharMap[42];return{text:t,fontObject:e,cursor:0,nextBreak:function(t){var e=0;if(this.cursor>=this.text.length)return null;var s=this.text.charCodeAt(this.cursor++);if(s===N){if(this.cursor+=4,this.cursor>=this.text.length)return null;s=this.text.charCodeAt(this.cursor++)}var l=this.fontObject,h=this.fontObject.data.CharMap[s];if(!h)for(var c=0;c<this.fontObject.fallbacks.length;c++){var d=this.fontObject.fallbacks[c];if(h=d.data.CharMap[s]){l=d;break}}h=h||i,l=l||this.fontObject;var u=l.data,v=a/u.FontHeight;if(e+=h.AdvanceX*v,r(s))return{position:this.cursor,required:n(s),whitespace:o(s),split:!1,width:e};for(s=this.text.charCodeAt(this.cursor),s===N&&(this.cursor+=5,s=this.text.charCodeAt(this.cursor));this.cursor<this.text.length&&!r(s);){var p=u.CharMap[s]||i,f=p.AdvanceX*v;if(e+f>t)return{position:this.cursor,required:!1,whitespace:!1,split:!0,width:e};e+=f,this.cursor++,s=this.text.charCodeAt(this.cursor),s===N&&(this.cursor+=5,s=this.text.charCodeAt(this.cursor))}return{position:this.cursor,required:!1,whitespace:!1,split:!1,width:e}}}}function l(t,e,a,i,r,n,o){for(var l=0,h=0,c=new s(e,t,a),d=void 0,u=[],v=0;d=c.nextBreak(i);)d.whitespace&&0===v&&(l=d.position),(d.required||0!==v&&v+d.width>i)&&(l!==h&&(u[u.length]=e.slice(l,h).trim()),v=0,l=h,d.whitespace)?l=d.position:(v+=d.width,h=d.position);return l<e.length&&(u[u.length]=e.slice(l).trim()),n>0&&u.splice(n),r&&(o?u.splice(Math.ceil(r/a)):u.splice(Math.floor(r/a))),u}function h(t,e,a,i,r,n,o){return l(t,e,a,i,r,n,o).join("\n")}function c(t,e,a){for(var i={maxWidth:0,maxHeight:0,maxDescent:0,numLines:1,lineWidths:[]},r=0,o=t.data.CharMap[42],s=0;s<e.length;s++){var l=e.charCodeAt(s);if(l!==N)if(n(l))r>i.maxWidth&&(i.maxWidth=r),s!==e.length-1&&(i.maxHeight+=a,i.maxDescent=0),i.lineWidths[i.lineWidths.length]=r,r=0,i.numLines++;else{var h=t,c=t.data.CharMap[l];if(!c)for(var d=0;d<t.fallbacks.length;d++){var u=t.fallbacks[d];if(c=u.data.CharMap[l]){h=u;break}}c=c||o,h=h||t;var v=h.data,p=a/v.FontHeight,f=a/v.FontHeight,x=(c.Height-c.BearingY)*f;x>i.maxDescent&&(i.maxDescent=x),r+=c.AdvanceX*p}else s+=4}return r>i.maxWidth&&(i.maxWidth=r),r>0&&(i.maxHeight+=a,i.lineWidths[i.lineWidths.length]=r),i.maxDescent>0&&(i.maxHeight+=i.maxDescent),i}function d(t,e,a){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=i.frame||[0,0,0,0],o=i.deltaZ||0,s=i.hAlign||F,l=i.vAlign||g,h=i.fontParms||{AlphaCenter:.47,ColorCenter:.49},d=i.dim||c(t,e,a),u=Math.min(255,255*h.AlphaCenter||108),v=Math.min(255,255*h.ColorCenter||128);if(f.BufferGeometry.apply(this),t.data){var p=[0,0],x=e.length,H=new Float32Array(4*x*3),E=new Float32Array(4*x*2),L=new Uint8Array(4*x*4),b=new Uint8Array(4*x*4),w=new Uint32Array(6*x);s===F?p[0]=r[0]:s===A?p[0]=r[0]+r[2]/2-d.maxWidth/2:s===T&&(p[0]=r[0]+r[2]-d.maxWidth);var P=t.data,R=a/t.data.FontHeight;if(l===g)p[1]=r[1]+d.maxHeight-a;else if(l===A){var y=P.MaxAscent,D=P.MaxDescent,W=P.FontHeight,B=y+D+W*(d.numLines-1);p[1]=(B/2-W)*R}else if(l===C){var I=P.MaxAscent,X=P.MaxDescent,S=P.FontHeight,U=I+X,k=(S*(d.numLines-1)+U)*R;p[1]=.5*(k-a)-X*R}else l===_?p[1]=r[1]+r[3]-a:l===m&&(p[1]=r[1]+d.maxHeight-a);var G=p[0];s===M?p[0]=r[0]+r[2]/2-d.lineWidths[0]/2:s===O&&(p[0]=r[0]+r[2]-d.lineWidths[0]);for(var V=0,Y=0,j=0,J=[255,255,255,255],q=P.CharMap[42],z=0,K=t,Z=[],Q=0;Q<e.length;Q++){var $=e.charCodeAt(Q);if($!==N)if(n($))p[0]=G,p[1]-=a,Y++,s===M?p[0]=r[0]+r[2]/2-d.lineWidths[Y]/2:s===O&&(p[0]=r[0]+r[2]-d.lineWidths[Y]);else{var tt=t,et=t.data.CharMap[$];if(!et)for(var at=0;at<t.fallbacks.length;at++){var it=t.fallbacks[at];if(et=it.data.CharMap[$]){tt=it;break}}et=et||q,tt=tt||t;var rt=tt.data,nt=a/rt.FontHeight,ot=a/rt.FontHeight;tt!==K&&(z!==j&&(this.addGroup(6*z,6*(j-z),Z.length),Z.push(K.material)),z=j,K=tt);var st=et.X/rt.NaturalWidth,lt=et.Y/rt.NaturalHeight,ht=(et.X+et.Width)/rt.NaturalWidth,ct=(et.Y+et.Height)/rt.NaturalHeight,dt=et.BearingX*nt,ut=et.BearingY*ot,vt=(et.Width+et.BearingX)*nt,pt=(et.Height-et.BearingY)*ot,ft=[1,0,0],xt=[0,1,0];H[12*j+0]=p[0]+ft[0]*dt-xt[0]*pt,H[12*j+1]=p[1]+ft[1]*dt-xt[1]*pt,H[12*j+2]=V+ft[2]*dt-xt[2]*pt,E[8*j+0]=st,E[8*j+1]=ct,L[16*j+0]=u,L[16*j+1]=v,L[16*j+2]=2,L[16*j+3]=255,b[16*j+0]=J[0],b[16*j+1]=J[1],b[16*j+2]=J[2],b[16*j+3]=J[3],H[12*j+3]=p[0]+ft[0]*dt+xt[0]*ut,H[12*j+4]=p[1]+ft[1]*dt+xt[1]*ut,H[12*j+5]=V+ft[2]*dt+xt[2]*ut,E[8*j+2]=st,E[8*j+3]=lt,L[16*j+4]=u,L[16*j+5]=v,L[16*j+6]=2,L[16*j+7]=255,b[16*j+4]=J[0],b[16*j+5]=J[1],b[16*j+6]=J[2],b[16*j+7]=J[3],H[12*j+6]=p[0]+ft[0]*vt+xt[0]*ut,H[12*j+7]=p[1]+ft[1]*vt+xt[1]*ut,H[12*j+8]=V+ft[2]*vt+xt[2]*ut,E[8*j+4]=ht,E[8*j+5]=lt,L[16*j+8]=u,L[16*j+9]=v,L[16*j+10]=2,L[16*j+11]=255,b[16*j+8]=J[0],b[16*j+9]=J[1],b[16*j+10]=J[2],b[16*j+11]=J[3],H[12*j+9]=p[0]+ft[0]*vt-xt[0]*pt,H[12*j+10]=p[1]+ft[1]*vt-xt[1]*pt,H[12*j+11]=V+ft[2]*vt-xt[2]*pt,E[8*j+6]=ht,E[8*j+7]=ct,L[16*j+12]=u,L[16*j+13]=v,L[16*j+14]=2,L[16*j+15]=255,b[16*j+12]=J[0],b[16*j+13]=J[1],b[16*j+14]=J[2],b[16*j+15]=J[3],w[6*j+0]=4*j+0,w[6*j+1]=4*j+1,w[6*j+2]=4*j+2,w[6*j+3]=4*j+0,w[6*j+4]=4*j+2,w[6*j+5]=4*j+3,j++,p[0]+=et.AdvanceX*nt,V+=o}else J[0]=e.charCodeAt(Q+1),J[1]=e.charCodeAt(Q+2),J[2]=e.charCodeAt(Q+3),J[3]=e.charCodeAt(Q+4),Q+=4}this.type="SDFText",this.isSDFText=!0,this.onBeforeRender=function(t,e){t.parent.textColor&&e.uniforms.textColor.value.set(t.parent.textColor.r,t.parent.textColor.g,t.parent.textColor.b,t.opacity);var a=t.textClip;a&&t.parent.clippingEnabled?e.uniforms.clipRegion.value.set(a[0],a[1],a[2],a[3]):e.uniforms.clipRegion.value.set(-16384,-16384,16384,16384)},this.textClip=[-16384,-16384,16384,16384],this.addAttribute("position",new f.BufferAttribute(H,3)),this.addAttribute("uv",new f.BufferAttribute(E,2)),this.addAttribute("fontParms",new f.BufferAttribute(L,4,!0)),this.addAttribute("textColors",new f.BufferAttribute(b,4,!0)),this.setIndex(new f.BufferAttribute(w,1)),z!==j&&(this.addGroup(6*z,6*(j-z),Z.length),Z.push(K.material)),this.computeBoundingSphere(),this.materials=Z}}function u(t,e,a){function i(t){t.CharMap=[],t.MaxAscent=0,t.MaxDescent=0;for(var e in t.Glyphs){var a=t.Glyphs[e];t.CharMap[a.CharCode]=a;var i=a.BearingY,r=a.Height-a.BearingY;i>t.MaxAscent&&(t.MaxAscent=i),r>t.MaxDescent&&(t.MaxDescent=r)}}function r(){for(var t={CharMap:{},NaturalWidth:x.DEFAULT_FONT_JSON.NaturalWidth,NaturalHeight:x.DEFAULT_FONT_JSON.NaturalHeight,FontHeight:x.DEFAULT_FONT_JSON.FontHeight,MaxAscent:x.DEFAULT_FONT_JSON.MaxAscent,MaxDescent:x.DEFAULT_FONT_JSON.MaxDescent},e=x.DEFAULT_FONT_JSON.Glyphs,a=e.length;a--;){var i=e[a],r={X:i[1],Y:i[2],Width:i[3],Height:i[4],AdvanceX:i[5],AdvanceY:i[6],BearingX:i[7],BearingY:i[8]};t.CharMap[i[0]]=r}return t}t||(e=x.DEFAULT_FONT_TEXTURE);var n=(new f.TextureLoader).load(e,function(t){t.wrapS=f.ClampToEdgeWrapping,t.wrapT=f.ClampToEdgeWrapping,t.minFilter=f.LinearFilter,t.flipY=!1}),o={texture:{value:n},textColor:{type:"v4",value:new f.Vector4},clipRegion:{type:"v4",value:new f.Vector4(-16384,-16384,16384,16384)}},s=new f.ShaderMaterial({uniforms:o,vertexShader:H,fragmentShader:E,side:f.DoubleSide,extensions:{derivatives:!0}});s.premultipliedAlpha=!0,s.depthWrite=!1,s.transparent=!0;var l={data:null,material:s,fallbacks:[]};if(!t)return l.data=r(),l;var h=a||new f.FileLoader;return new Promise(function(e,a){h.load(t,function(t){var a=JSON.parse(t);i(a),l.data=a,e(l)})})}function v(t,e){t.fallbacks.push(e)}Object.defineProperty(i,"__esModule",{value:!0}),i.SDFFONT_MARKER_COLOR=i.TOP=i.RIGHT_LINE=i.RIGHT=i.LEFT=i.CENTER_LINE=i.CENTER_FIXEDHEIGHT=i.CENTER=i.BOTTOM=i.BASELINE=void 0,i.splitLines=l,i.wrapLines=h,i.measureText=c,i.BitmapFontGeometry=d,i.loadFont=u,i.addFontFallback=v;var p=e(35),f=babelHelpers.interopRequireWildcard(p),x=e(59),g=i.BASELINE="baseline",m=i.BOTTOM="bottom",A=i.CENTER="center",C=i.CENTER_FIXEDHEIGHT="center_fixedheight",M=i.CENTER_LINE="center_line",F=i.LEFT="left",T=i.RIGHT="right",O=i.RIGHT_LINE="right_line",_=i.TOP="top",N=i.SDFFONT_MARKER_COLOR=0,H="\nvarying vec2 vUv;\nattribute vec4 fontParms;\nattribute vec4 textColors;\nvarying vec4 vFontParms;\nvarying vec4 vTextColor;\nvarying vec4 vMVPosition;\nvoid main( ) {\n  vUv = uv;\n  vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n  vFontParms = fontParms;\n  vTextColor = textColors;\n  vMVPosition = mvPosition;\n  gl_Position = projectionMatrix * mvPosition;\n}\n",E="\nuniform sampler2D texture;\nuniform vec4 textColor;\nuniform vec4 clipRegion;\nvarying vec4 vTextColor;\nvarying vec4 vFontParms;\nvarying vec4 vMVPosition;\nvarying vec2 vUv;\nvoid main( void ) {\n  float distance = texture2D( texture, vUv ).r;\n  float ds = vFontParms.z * 255.0;\n  float dd = fwidth( vUv.x ) * vFontParms.w * 16.0 * ds;\n  float ALPHA_MIN = vFontParms.x - dd;\n  float ALPHA_MAX = vFontParms.x + dd;\n  float COLOR_MIN = vFontParms.y - dd;\n  float COLOR_MAX = vFontParms.y + dd;\n  float value = ( clamp( distance, COLOR_MIN, COLOR_MAX ) - COLOR_MIN ) / max(0.00001, COLOR_MAX - COLOR_MIN );\n  float alpha = ( clamp( distance, ALPHA_MIN, ALPHA_MAX ) - ALPHA_MIN ) / max(0.00001,  ALPHA_MAX - ALPHA_MIN );\n  if (vMVPosition.x < clipRegion.x) {\n    discard;\n  }\n  if (vMVPosition.y < clipRegion.y) {\n    discard;\n  }\n  if (vMVPosition.x > clipRegion.z) {\n    discard;\n  }\n  if (vMVPosition.y > clipRegion.w) {\n    discard;\n  }\n  float premultAlphaValue = value * vTextColor.w * textColor.w;\n  gl_FragColor = vec4(\n    premultAlphaValue,\n    premultAlphaValue,\n    premultAlphaValue,\n    alpha) *\n    vTextColor *\n    textColor;\n}\n";d.prototype=Object.create(f.BufferGeometry.prototype),d.prototype.constructor=d},58);
__d(function(A,D,I,g){Object.defineProperty(g,"__esModule",{value:!0});g.DEFAULT_FONT_TEXTURE="data:image/png;base64, ",
g.DEFAULT_FONT_JSON={NaturalWidth:8192,NaturalHeight:3435,FontHeight:307,MaxAscent:314,MaxDescent:130,Weights:[{AlphaCenterOffset:0,ColorCenterOffset:0},{AlphaCenterOffset:-.025,ColorCenterOffset:-.025},{AlphaCenterOffset:-.0385,ColorCenterOffset:-.0385},{AlphaCenterOffset:-.05,ColorCenterOffset:-.05}],Glyphs:[[0,-1,-1,0,0,0,0,0,0],[1,-1,-1,0,0,0,0,0,0],[2,-1,-1,0,0,0,0,0,0],[3,-1,-1,0,0,0,0,0,0],[4,-1,-1,0,0,0,0,0,0],[5,-1,-1,0,0,0,0,0,0],[6,-1,-1,0,0,0,0,0,0],[7,-1,-1,0,0,0,0,0,0],[8,-1,-1,0,0,0,0,0,0],[9,-1,-1,0,0,0,0,0,0],[10,-1,-1,0,0,0,0,0,0],[11,-1,-1,0,0,0,0,0,0],[12,-1,-1,0,0,0,0,0,0],[13,1365,3220,128,128,116,253,-64,64],[14,-1,-1,0,0,0,0,0,0],[15,-1,-1,0,0,0,0,0,0],[16,-1,-1,0,0,0,0,0,0],[17,-1,-1,0,0,0,0,0,0],[18,-1,-1,0,0,0,0,0,0],[19,-1,-1,0,0,0,0,0,0],[20,-1,-1,0,0,0,0,0,0],[21,-1,-1,0,0,0,0,0,0],[22,-1,-1,0,0,0,0,0,0],[23,-1,-1,0,0,0,0,0,0],[24,-1,-1,0,0,0,0,0,0],[25,-1,-1,0,0,0,0,0,0],[26,-1,-1,0,0,0,0,0,0],[27,-1,-1,0,0,0,0,0,0],[28,-1,-1,0,0,0,0,0,0],[29,-1,-1,0,0,0,0,0,0],[30,-1,-1,0,0,0,0,0,0],[31,-1,-1,0,0,0,0,0,0],[32,1237,3220,128,128,119,253,-64,64],[33,3410,1438,164,317,106,253,-29,250],[34,6106,2964,203,197,121,253,-41,250],[35,2278,1756,276,314,158,253,-59,250],[36,6816,752,260,327,152,253,-54,257],[37,4379,752,338,333,234,253,-52,259],[38,3184,1114,300,322,192,253,-54,254],[39,6656,2964,153,197,70,253,-41,250],[40,1362,0,187,380,75,253,-52,274],[41,1549,0,187,380,75,253,-61,274],[42,4683,2964,238,232,127,253,-56,250],[43,5471,2693,263,263,173,253,-44,215],[44,6309,2964,174,197,72,253,-54,96],[45,259,3220,204,151,98,253,-53,141],[46,7774,2964,164,164,72,253,-46,97],[47,4951,752,233,333,104,253,-66,256],[48,3773,1114,275,322,173,253,-51,254],[49,7387,1756,202,314,119,253,-52,250],[50,7079,1114,253,319,151,253,-52,254],[51,1418,1114,256,323,155,253,-50,254],[52,3102,1756,272,314,158,253,-56,250],[53,6824,1114,255,319,155,253,-49,250],[54,6559,1114,265,319,161,253,-51,251],[55,4936,1756,253,314,143,253,-55,250],[56,4048,1114,264,322,162,253,-51,254],[57,5300,1114,265,320,163,253,-52,254],[58,810,2964,164,256,72,253,-46,189],[59,6375,2383,174,290,72,253,-54,189],[60,6549,2383,256,280,168,253,-44,219],[61,5132,2964,263,200,175,253,-44,183],[62,6805,2383,256,280,168,253,-44,219],[63,4573,1114,249,321,148,253,-51,254],[64,318,1114,319,323,215,253,-52,213],[65,4945,1438,309,315,187,253,-61,250],[66,1724,1756,277,314,181,253,-42,250],[67,3484,1114,289,322,181,253,-53,254],[68,0,1756,296,314,200,253,-42,250],[69,4681,1756,255,314,163,253,-42,250],[70,5189,1756,250,314,153,253,-42,250],[71,2884,1114,300,322,200,253,-53,254],[72,880,1756,285,314,201,253,-42,250],[73,7589,1756,156,314,72,253,-42,250],[74,1146,1438,233,318,132,253,-60,250],[75,1165,1756,280,314,179,253,-41,250],[76,5935,1756,246,314,141,253,-42,250],[77,7199,1438,328,314,240,253,-44,250],[78,296,1756,292,314,208,253,-42,250],[79,1915,1114,325,322,219,253,-53,254],[80,3374,1756,263,314,166,253,-42,250],[81,0,1438,333,318,218,253,-53,254],[82,5536,1438,271,315,172,253,-42,250],[83,4312,1114,261,322,156,253,-52,254],[84,1445,1756,279,314,159,253,-60,250],[85,620,1438,284,318,200,253,-42,250],[86,7527,1438,300,314,182,253,-59,250],[87,6065,1438,384,314,265,253,-59,250],[88,7827,1438,297,314,175,253,-61,250],[89,588,1756,292,314,174,253,-59,250],[90,2828,1756,274,314,167,253,-53,250],[91,2445,0,178,379,83,253,-39,273],[92,4717,752,234,333,103,253,-65,256],[93,2623,0,178,379,83,253,-56,273],[94,3559,2964,257,244,169,253,-44,256],[95,853,3220,256,143,128,253,-64,44],[96,7245,2964,183,170,65,253,-67,245],[97,7654,2693,244,257,145,253,-53,190],[98,898,1114,260,323,161,253,-47,255],[99,7185,2693,239,259,132,253,-53,191],[100,637,1114,261,323,161,253,-53,255],[101,6937,2693,248,259,142,253,-53,191],[102,1379,1438,213,318,87,253,-60,254],[103,5565,1114,260,320,160,253,-51,191],[104,6071,1114,244,320,150,253,-47,255],[105,7986,2070,162,311,64,253,-49,247],[106,3577,0,190,376,65,253,-77,247],[107,6315,1114,244,320,135,253,-47,255],[108,7761,1114,155,319,65,253,-45,255],[109,0,2964,324,256,230,253,-47,191],[110,324,2964,244,256,150,253,-47,191],[111,6676,2693,261,259,155,253,-53,191],[112,2486,1438,260,317,161,253,-47,191],[113,2225,1438,261,317,161,253,-53,191],[114,974,2964,204,255,98,253,-47,191],[115,7424,2693,230,258,123,253,-54,191],[116,6163,2383,212,295,95,253,-59,227],[117,568,2964,242,256,147,253,-47,188],[118,1994,2964,255,251,133,253,-61,187],[119,1413,2964,325,251,203,253,-61,187],[120,1738,2964,256,251,134,253,-61,187],[121,774,2070,255,313,133,253,-61,187],[122,1178,2964,235,252,119,253,-57,187],[123,2245,0,200,379,92,253,-54,273],[124,3314,752,146,354,68,253,-39,272],[125,2045,0,200,379,92,253,-54,273],[126,6995,2964,250,172,167,253,-41,165],[127,-1,-1,0,0,0,0,0,0],[128,-1,-1,0,0,0,0,0,0],[129,-1,-1,0,0,0,0,0,0],[130,-1,-1,0,0,0,0,0,0],[131,-1,-1,0,0,0,0,0,0],[132,-1,-1,0,0,0,0,0,0],[133,-1,-1,0,0,0,0,0,0],[134,-1,-1,0,0,0,0,0,0],[135,-1,-1,0,0,0,0,0,0],[136,-1,-1,0,0,0,0,0,0],[137,-1,-1,0,0,0,0,0,0],[138,-1,-1,0,0,0,0,0,0],[139,-1,-1,0,0,0,0,0,0],[140,-1,-1,0,0,0,0,0,0],[141,-1,-1,0,0,0,0,0,0],[142,-1,-1,0,0,0,0,0,0],[143,-1,-1,0,0,0,0,0,0],[144,-1,-1,0,0,0,0,0,0],[145,-1,-1,0,0,0,0,0,0],[146,-1,-1,0,0,0,0,0,0],[147,-1,-1,0,0,0,0,0,0],[148,-1,-1,0,0,0,0,0,0],[149,-1,-1,0,0,0,0,0,0],[150,-1,-1,0,0,0,0,0,0],[151,-1,-1,0,0,0,0,0,0],[152,-1,-1,0,0,0,0,0,0],[153,-1,-1,0,0,0,0,0,0],[154,-1,-1,0,0,0,0,0,0],[155,-1,-1,0,0,0,0,0,0],[156,-1,-1,0,0,0,0,0,0],[157,-1,-1,0,0,0,0,0,0],[158,-1,-1,0,0,0,0,0,0],[159,-1,-1,0,0,0,0,0,0],[160,1109,3220,128,128,119,253,-64,64],[161,3246,1438,164,317,106,253,-29,191],[162,7148,1756,239,314,134,253,-53,250],[163,2746,1438,256,317,147,253,-57,253],[164,5734,2693,263,262,147,253,-58,224],[165,5254,1438,282,315,154,253,-64,250],[166,3168,752,146,354,68,253,-39,272],[167,3460,752,237,349,153,253,-42,254],[168,7938,2964,216,160,65,253,-76,240],[169,2240,1114,322,322,210,253,-54,254],[170,3137,2964,210,249,99,253,-57,254],[171,4264,2964,239,242,146,253,-49,183],[172,5395,2964,263,199,175,253,-44,170],[173,463,3220,190,149,82,257,-54,143],[174,2562,1114,322,322,210,253,-54,254],[175,653,3220,200,145,65,253,-68,229],[176,4921,2964,211,211,105,253,-53,254],[177,675,2693,263,268,173,253,-44,215],[178,4055,2964,209,243,99,253,-55,291],[179,3347,2964,212,245,102,253,-55,291],[180,7428,2964,182,170,65,253,-49,245],[181,7574,752,236,327,152,257,-42,201],[182,0,2070,260,313,162,253,-44,187],[183,7610,2964,164,164,72,253,-46,161],[184,6809,2964,186,186,65,253,-58,64],[185,4503,2964,180,240,88,253,-53,288],[186,2916,2964,221,249,107,253,-57,254],[187,3816,2964,239,243,146,253,-44,183],[188,5550,752,350,331,236,253,-53,258],[189,5900,752,349,331,240,253,-53,258],[190,5184,752,366,331,251,253,-55,258],[191,4822,1114,248,321,148,253,-50,191],[192,545,385,309,366,187,253,-61,301],[193,854,385,309,366,187,253,-61,301],[194,4354,385,309,364,187,253,-61,299],[195,650,752,309,361,187,253,-61,296],[196,7460,385,309,362,187,253,-61,297],[197,1736,0,309,379,187,253,-61,314],[198,6449,1438,376,314,266,253,-61,250],[199,2801,0,289,376,181,253,-53,254],[200,3150,385,255,365,163,253,-42,301],[201,3405,385,255,365,163,253,-42,301],[202,6950,385,255,363,163,253,-42,299],[203,1560,752,255,361,163,253,-42,297],[204,3845,385,184,365,72,253,-70,301],[205,3660,385,185,365,72,253,-42,301],[206,5526,385,212,364,72,253,-70,299],[207,274,752,216,362,72,253,-72,297],[208,4633,1438,312,315,200,253,-58,250],[209,1268,752,292,361,208,253,-42,296],[210,6333,0,325,369,219,253,-53,301],[211,6008,0,325,369,219,253,-53,301],[212,7510,0,325,367,219,253,-53,299],[213,4029,385,325,364,219,253,-53,296],[214,1692,385,325,365,219,253,-53,297],[215,2403,2964,250,250,165,253,-42,209],[216,6249,752,325,331,219,253,-53,259],[217,6658,0,284,369,200,253,-42,301],[218,6942,0,284,369,200,253,-42,301],[219,0,385,284,367,200,253,-42,299],[220,2601,385,284,365,200,253,-42,297],[221,2017,385,292,365,174,253,-59,301],[222,5807,1438,258,315,162,253,-42,250],[223,1158,1114,260,323,158,253,-46,256],[224,2258,2070,244,312,145,253,-53,245],[225,2014,2070,244,312,145,253,-53,245],[226,1852,2383,244,309,145,253,-53,242],[227,4554,2383,244,306,145,253,-53,239],[228,4075,2383,244,307,145,253,-53,240],[229,3002,1438,244,317,145,253,-53,250],[230,6345,2693,331,259,225,253,-53,191],[231,1029,2070,239,313,132,253,-53,191],[232,5687,1756,248,314,142,253,-53,246],[233,5439,1756,248,314,142,253,-53,246],[234,509,2383,248,310,142,253,-53,242],[235,2587,2383,248,308,142,253,-53,240],[236,1482,2383,185,310,64,253,-76,246],[237,1667,2383,185,310,64,253,-45,246],[238,5012,2383,212,306,64,253,-74,242],[239,5459,2383,216,305,64,253,-76,240],[240,7810,752,262,325,156,253,-53,257],[241,5675,2383,244,304,150,253,-47,239],[242,3898,1756,261,314,155,253,-53,246],[243,3637,1756,261,314,155,253,-53,246],[244,0,2383,261,310,155,253,-53,242],[245,3321,2383,261,307,155,253,-53,239],[246,2326,2383,261,308,155,253,-53,240],[247,2653,2964,263,249,175,253,-44,208],[248,938,2693,263,267,155,253,-54,195],[249,6423,1756,242,314,147,253,-47,246],[250,6665,1756,242,314,147,253,-47,246],[251,1001,2383,242,310,147,253,-47,242],[252,3079,2383,242,308,147,253,-47,240],[253,4046,0,255,371,133,253,-61,245],[254,823,0,260,382,161,253,-47,256],[255,1437,385,255,366,133,253,-61,240],[257,5919,2383,244,296,145,253,-53,229],[258,959,752,309,361,187,253,-61,296],[259,2835,2383,244,308,145,253,-53,241],[260,4301,0,309,370,187,253,-61,250],[261,757,2383,244,310,145,253,-53,190],[262,4610,0,289,370,181,253,-53,302],[263,6907,1756,241,314,132,253,-53,246],[268,7835,0,289,367,181,253,-53,299],[269,1243,2383,239,310,132,253,-53,242],[270,6101,385,296,363,200,253,-42,299],[271,0,1114,318,324,161,253,-53,256],[280,4899,0,263,370,163,253,-42,250],[281,3582,2383,249,307,142,253,-53,191],[282,7205,385,255,363,163,253,-42,299],[283,261,2383,248,310,142,253,-53,242],[286,4663,385,300,364,200,253,-53,296],[287,5423,0,260,370,160,253,-51,241],[304,490,752,160,362,72,253,-44,297],[305,2249,2964,154,251,64,253,-45,187],[306,333,1438,287,318,204,253,-42,250],[307,3351,0,226,376,129,253,-49,247],[321,4159,1756,261,314,141,253,-57,250],[322,7570,1114,191,319,66,253,-63,255],[323,2309,385,292,365,208,253,-42,301],[324,6348,2070,244,311,150,253,-47,246],[327,4963,385,292,364,208,253,-42,299],[328,3831,2383,244,307,150,253,-47,242],[336,5683,0,325,369,219,253,-53,301],[337,4420,1756,261,314,155,253,-53,246],[338,6825,1438,374,314,277,253,-48,250],[339,5997,2693,348,259,241,253,-53,191],[344,5255,385,271,364,172,253,-42,299],[345,4798,2383,214,306,98,253,-57,242],[346,5162,0,261,370,156,253,-52,302],[347,1498,2070,230,313,123,253,-54,246],[350,3090,0,261,376,156,253,-52,254],[351,1268,2070,230,313,123,253,-54,191],[352,284,385,261,367,156,253,-52,299],[353,2096,2383,230,309,123,253,-54,242],[354,3767,0,279,372,159,253,-60,250],[355,3697,752,212,349,95,253,-59,227],[356,6397,385,279,363,159,253,-60,299],[357,5825,1114,246,320,95,253,-59,252],[366,539,0,284,382,200,253,-42,314],[367,904,1438,242,318,147,253,-47,250],[368,7226,0,284,369,200,253,-42,301],[369,6181,1756,242,314,147,253,-47,246],[376,7769,385,292,362,174,253,-59,297],[377,1163,385,274,366,167,253,-53,302],[378,7306,2070,235,311,119,253,-57,246],[379,0,752,274,362,167,253,-53,297],[380,5224,2383,235,305,119,253,-57,240],[381,6676,385,274,363,167,253,-53,299],[382,4319,2383,235,307,119,253,-57,242],[536,278,0,261,384,156,253,-52,254],[537,5070,1114,230,321,123,253,-54,191],[538,1083,0,279,380,159,253,-60,250],[539,2956,752,212,357,95,253,-59,227],[1025,2734,752,222,358,135,257,-39,294],[1040,1728,2070,286,312,156,257,-65,248],[1041,7068,2070,238,311,148,257,-39,247],[1042,6100,2070,248,311,159,257,-39,247],[1043,7541,2070,223,311,126,257,-39,247],[1044,2170,752,287,359,166,257,-62,247],[1045,7764,2070,222,311,135,257,-39,247],[1046,2502,2070,338,311,209,257,-64,247],[1047,4388,1438,245,316,140,257,-55,249],[1048,4313,2070,265,311,187,257,-39,247],[1049,2885,385,265,365,187,257,-39,301],[1050,5346,2070,252,311,148,257,-39,247],[1051,2554,1756,274,314,171,257,-64,247],[1052,3173,2070,301,311,223,257,-39,247],[1053,4578,2070,258,311,180,257,-39,247],[1054,1939,1438,286,317,190,257,-48,250],[1055,4836,2070,255,311,177,257,-39,247],[1056,6830,2070,238,311,148,257,-39,247],[1057,3872,1438,259,316,154,257,-48,249],[1058,5091,2070,255,311,133,257,-61,247],[1059,2001,1756,277,314,150,257,-62,247],[1060,3574,1438,298,316,196,257,-51,249],[1061,4043,2070,270,311,140,257,-65,247],[1062,2457,752,277,359,179,257,-39,247],[1063,5849,2070,251,311,169,257,-43,247],[1064,2840,2070,333,311,255,257,-39,247],[1065,1815,752,355,359,255,257,-39,247],[1066,3763,2070,280,311,168,257,-61,247],[1067,3474,2070,289,311,211,257,-39,247],[1068,6592,2070,238,311,148,257,-39,247],[1069,4131,1438,257,316,152,257,-57,249],[1070,1592,1438,347,317,260,257,-39,250],[1071,5598,2070,251,311,151,257,-61,247],[1072,7846,2383,232,271,136,257,-52,204],[1073,7329,752,245,327,146,257,-49,260],[1074,3858,2693,237,265,145,257,-42,201],[1075,5268,2693,203,265,102,257,-42,201],[1076,260,2070,258,313,140,257,-59,201],[1077,7608,2383,238,271,137,257,-50,204],[1078,1445,2693,312,265,184,257,-64,201],[1079,0,2693,226,271,118,257,-56,204],[1080,3379,2693,241,265,157,257,-42,201],[1081,1674,1114,241,323,157,257,-42,259],[1082,4805,2693,232,265,126,257,-42,201],[1083,1201,2693,244,267,140,257,-62,201],[1084,2623,2693,268,265,184,257,-42,201],[1085,3138,2693,241,265,157,257,-42,201],[1086,7360,2383,248,271,148,257,-50,204],[1087,4569,2693,236,265,152,257,-42,201],[1088,6574,752,242,330,150,257,-42,204],[1089,451,2693,224,271,119,257,-50,204],[1090,5037,2693,231,265,113,257,-59,201],[1091,7076,752,253,327,125,257,-64,201],[1092,0,0,278,385,178,257,-50,259],[1093,2891,2693,247,265,128,257,-60,201],[1094,518,2070,256,313,154,257,-42,201],[1095,4095,2693,237,265,150,257,-45,201],[1096,1757,2693,307,265,223,257,-42,201],[1097,7745,1756,327,313,225,257,-42,201],[1098,2064,2693,283,265,174,257,-59,201],[1099,2347,2693,276,265,192,257,-42,201],[1100,4332,2693,237,265,145,257,-42,201],[1101,226,2693,225,271,118,257,-57,204],[1102,7061,2383,299,271,207,257,-42,204],[1103,3620,2693,238,265,136,257,-60,201],[1105,7332,1114,238,319,137,257,-50,252],[7843,4147,752,232,341,136,257,-52,274],[7867,3909,752,238,341,137,257,-50,274],[8211,0,3220,259,151,153,253,-53,141],[8217,6483,2964,173,197,73,253,-53,250],[8220,5882,2964,224,197,124,253,-47,251],[8222,5658,2964,224,197,122,253,-54,96],[65533,5738,385,363,363,256,257,-54,259]]}},59);
__d(function(e,r,o,n){function t(e,r){if(void 0!==r)for(var o in r){var n="set"+o.charAt(0).toUpperCase()+o.slice(1);if("function"==typeof e[n]){var t=r[o];e[n](t)}else console.warn('"'+n+'" is not a function of UIView.')}}function a(){return u.FIT_XY}function i(e){return"contain"===e?u.FIT_CENTER:"cover"===e?u.CENTER_CROP:"stretch"===e?u.FIT_XY:"center"===e?u.FIT_CENTER:null==e?a():(console.error("Invalid resize mode: '"+e+"'"),a())}Object.defineProperty(n,"__esModule",{value:!0}),n.setParams=t,n.defaultScaleType=a,n.resizeModetoScaleType=i;var c={getScaleParams:function(e,r,o,n,t){e=e||[1,1],r=r||[0,0];var a=[].concat(babelHelpers.toConsumableArray(e));if(e[0]>0&&e[1]>0&&r[0]>0&&r[1]>0){var i=[e[0]/r[0],e[1]/r[1]],c=Math.min(i[0],i[1]);a=[r[0]*c,r[1]*c]}return{dims:a,border:{cssBorderWidth:t,originalDim:e},cropUV:[0,0,1,1]}}},s={getScaleParams:function(e,r,o,n,t){return e=e||[1,1],r=r||[0,0],{dims:e,border:{texture:o,factor:[n[0]/e[0],n[1]/e[1],n[2]/e[0],n[3]/e[1]],cssBorderWidth:t},cropUV:[0,0,1,1]}}},l={getScaleParams:function(e,r,o,n,t){e=e||[1,1],r=r||[0,0];var a=[0,0];if(e[0]>0&&e[1]>0&&r[0]>0&&r[1]>0){var i=[r[0]/e[0],r[1]/e[1]],c=Math.min(i[0],i[1]);a=[(1-e[0]*c/r[0])/2,(1-e[1]*c/r[1])/2]}return{dims:e,border:{cssBorderWidth:t},cropUV:[a[0],a[1],1-a[0],1-a[1]]}}},u=n.ScaleType={FIT_CENTER:c,FIT_XY:s,CENTER_CROP:l};n.PointerEvents={AUTO:"auto",NONE:"none",BOX_NONE:"box-none",BOX_ONLY:"box-only"}},60);
__d(function(e,t,n,u){function o(e){return"string"==typeof e?e:"object"==typeof e&&"string"==typeof e.uri?e.uri:null}Object.defineProperty(u,"__esModule",{value:!0}),u.default=o},61);
__d(function(n,o,t,_){t.exports=o(63)},62);
__d(function(global,require,module,exports){!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.Yoga=n():e.Yoga=n()}(this,function(){return function(e){function n(t){if(r[t])return r[t].exports;var i=r[t]={i:t,l:!1,exports:{}};return e[t].call(i.exports,i,i.exports,n),i.l=!0,i.exports}var r={};return n.m=e,n.c=r,n.i=function(e){return e},n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="",n(n.s=11)}([function(e,n){function r(){throw new Error("setTimeout has not been defined")}function t(){throw new Error("clearTimeout has not been defined")}function i(e){if(l===setTimeout)return setTimeout(e,0);if((l===r||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(n){try{return l.call(null,e,0)}catch(n){return l.call(this,e,0)}}}function u(e){if(s===clearTimeout)return clearTimeout(e);if((s===t||!s)&&clearTimeout)return s=clearTimeout,clearTimeout(e);try{return s(e)}catch(n){try{return s.call(null,e)}catch(n){return s.call(this,e)}}}function o(){p&&_&&(p=!1,_.length?v=_.concat(v):h=-1,v.length&&a())}function a(){if(!p){var e=i(o);p=!0;for(var n=v.length;n;){for(_=v,v=[];++h<n;)_&&_[h].run();h=-1,n=v.length}_=null,p=!1,u(e)}}function f(e,n){this.fun=e,this.array=n}function c(){}var l,s,d=e.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:r}catch(e){l=r}try{s="function"==typeof clearTimeout?clearTimeout:t}catch(e){s=t}}();var _,v=[],p=!1,h=-1;d.nextTick=function(e){var n=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)n[r-1]=arguments[r];v.push(new f(e,n)),1!==v.length||p||i(a)},f.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=c,d.addListener=c,d.once=c,d.off=c,d.removeListener=c,d.removeAllListeners=c,d.emit=c,d.prependListener=c,d.prependOnceListener=c,d.listeners=function(e){return[]},d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(module,exports,__webpack_require__){(function(process,Buffer){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;!function(e,n){__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return n}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),!(void 0!==__WEBPACK_AMD_DEFINE_RESULT__&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}(this,function(Module,cb){function globalEval(e){eval.call(null,e)}function assert(e,n){e||abort("Assertion failed: "+n)}function getCFunc(ident){var func=Module["_"+ident];if(!func)try{func=eval("_"+ident)}catch(e){}return assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)"),func}function setValue(e,n,r,t){switch(r=r||"i8","*"===r.charAt(r.length-1)&&(r="i32"),r){case"i1":HEAP8[e>>0]=n;break;case"i8":HEAP8[e>>0]=n;break;case"i16":HEAP16[e>>1]=n;break;case"i32":HEAP32[e>>2]=n;break;case"i64":tempI64=[n>>>0,(tempDouble=n,+Math_abs(tempDouble)>=1?tempDouble>0?(0|Math_min(+Math_floor(tempDouble/4294967296),4294967295))>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[e>>2]=tempI64[0],HEAP32[e+4>>2]=tempI64[1];break;case"float":HEAPF32[e>>2]=n;break;case"double":HEAPF64[e>>3]=n;break;default:abort("invalid type for setValue: "+r)}}function getValue(e,n,r){switch(n=n||"i8","*"===n.charAt(n.length-1)&&(n="i32"),n){case"i1":return HEAP8[e>>0];case"i8":return HEAP8[e>>0];case"i16":return HEAP16[e>>1];case"i32":return HEAP32[e>>2];case"i64":return HEAP32[e>>2];case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];default:abort("invalid type for setValue: "+n)}return null}function allocate(e,n,r,t){var i,u;"number"==typeof e?(i=!0,u=e):(i=!1,u=e.length);var o,a="string"==typeof n?n:null;if(o=r==ALLOC_NONE?t:["function"==typeof _malloc?_malloc:Runtime.staticAlloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][void 0===r?ALLOC_STATIC:r](Math.max(u,a?1:n.length)),i){var f,t=o;for(assert(0==(3&o)),f=o+(u&-4);t<f;t+=4)HEAP32[t>>2]=0;for(f=o+u;t<f;)HEAP8[t++>>0]=0;return o}if("i8"===a)return e.subarray||e.slice?HEAPU8.set(e,o):HEAPU8.set(new Uint8Array(e),o),o;for(var c,l,s,d=0;d<u;){var _=e[d];"function"==typeof _&&(_=Runtime.getFunctionIndex(_)),c=a||n[d],0!==c?("i64"==c&&(c="i32"),setValue(o+d,_,c),s!==c&&(l=Runtime.getNativeTypeSize(c),s=c),d+=l):d++}return o}function getMemory(e){return staticSealed?runtimeInitialized?_malloc(e):Runtime.dynamicAlloc(e):Runtime.staticAlloc(e)}function Pointer_stringify(e,n){if(0===n||!e)return"";for(var r,t=0,i=0;;){if(r=HEAPU8[e+i>>0],t|=r,0==r&&!n)break;if(i++,n&&i==n)break}n||(n=i);var u="";if(t<128){for(var o,a=1024;n>0;)o=String.fromCharCode.apply(String,HEAPU8.subarray(e,e+Math.min(n,a))),u=u?u+o:o,e+=a,n-=a;return u}return Module.UTF8ToString(e)}function AsciiToString(e){for(var n="";;){var r=HEAP8[e++>>0];if(!r)return n;n+=String.fromCharCode(r)}}function stringToAscii(e,n){return writeAsciiToMemory(e,n,!1)}function UTF8ArrayToString(e,n){for(var r=n;e[r];)++r;if(r-n>16&&e.subarray&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(n,r));for(var t,i,u,o,a,f,c="";;){if(t=e[n++],!t)return c;if(128&t)if(i=63&e[n++],192!=(224&t))if(u=63&e[n++],224==(240&t)?t=(15&t)<<12|i<<6|u:(o=63&e[n++],240==(248&t)?t=(7&t)<<18|i<<12|u<<6|o:(a=63&e[n++],248==(252&t)?t=(3&t)<<24|i<<18|u<<12|o<<6|a:(f=63&e[n++],t=(1&t)<<30|i<<24|u<<18|o<<12|a<<6|f))),t<65536)c+=String.fromCharCode(t);else{var l=t-65536;c+=String.fromCharCode(55296|l>>10,56320|1023&l)}else c+=String.fromCharCode((31&t)<<6|i);else c+=String.fromCharCode(t)}}function UTF8ToString(e){return UTF8ArrayToString(HEAPU8,e)}function stringToUTF8Array(e,n,r,t){if(!(t>0))return 0;for(var i=r,u=r+t-1,o=0;o<e.length;++o){var a=e.charCodeAt(o);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++o)),a<=127){if(r>=u)break;n[r++]=a}else if(a<=2047){if(r+1>=u)break;n[r++]=192|a>>6,n[r++]=128|63&a}else if(a<=65535){if(r+2>=u)break;n[r++]=224|a>>12,n[r++]=128|a>>6&63,n[r++]=128|63&a}else if(a<=2097151){if(r+3>=u)break;n[r++]=240|a>>18,n[r++]=128|a>>12&63,n[r++]=128|a>>6&63,n[r++]=128|63&a}else if(a<=67108863){if(r+4>=u)break;n[r++]=248|a>>24,n[r++]=128|a>>18&63,n[r++]=128|a>>12&63,n[r++]=128|a>>6&63,n[r++]=128|63&a}else{if(r+5>=u)break;n[r++]=252|a>>30,n[r++]=128|a>>24&63,n[r++]=128|a>>18&63,n[r++]=128|a>>12&63,n[r++]=128|a>>6&63,n[r++]=128|63&a}}return n[r]=0,r-i}function stringToUTF8(e,n,r){return stringToUTF8Array(e,HEAPU8,n,r)}function lengthBytesUTF8(e){for(var n=0,r=0;r<e.length;++r){var t=e.charCodeAt(r);t>=55296&&t<=57343&&(t=65536+((1023&t)<<10)|1023&e.charCodeAt(++r)),t<=127?++n:n+=t<=2047?2:t<=65535?3:t<=2097151?4:t<=67108863?5:6}return n}function demangle(e){var n=Module.___cxa_demangle||Module.__cxa_demangle;if(n){try{var r=e.substr(1),t=lengthBytesUTF8(r)+1,i=_malloc(t);stringToUTF8(r,i,t);var u=_malloc(4),o=n(i,0,0,u);if(0===getValue(u,"i32")&&o)return Pointer_stringify(o)}catch(e){}finally{i&&_free(i),u&&_free(u),o&&_free(o)}return e}return Runtime.warnOnce("warning: build with  -s DEMANGLE_SUPPORT=1  to link in libcxxabi demangling"),e}function demangleAll(e){var n=/__Z[\w\d_]+/g;return e.replace(n,function(e){var n=demangle(e);return e===n?e:e+" ["+n+"]"})}function jsStackTrace(){var e=new Error;if(!e.stack){try{throw new Error(0)}catch(n){e=n}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}function stackTrace(){var e=jsStackTrace();return Module.extraStackTrace&&(e+="\n"+Module.extraStackTrace()),demangleAll(e)}function updateGlobalBufferViews(){Module.HEAP8=HEAP8=new Int8Array(buffer),Module.HEAP16=HEAP16=new Int16Array(buffer),Module.HEAP32=HEAP32=new Int32Array(buffer),Module.HEAPU8=HEAPU8=new Uint8Array(buffer),Module.HEAPU16=HEAPU16=new Uint16Array(buffer),Module.HEAPU32=HEAPU32=new Uint32Array(buffer),Module.HEAPF32=HEAPF32=new Float32Array(buffer),Module.HEAPF64=HEAPF64=new Float64Array(buffer)}function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with  -s TOTAL_MEMORY=X  with X higher than the current value "+TOTAL_MEMORY+", (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0 ")}function enlargeMemory(){abortOnCannotGrowMemory()}function getTotalMemory(){return TOTAL_MEMORY}function callRuntimeCallbacks(e){for(;e.length>0;){var n=e.shift();if("function"!=typeof n){var r=n.func;"number"==typeof r?void 0===n.arg?Module.dynCall_v(r):Module.dynCall_vi(r,n.arg):r(void 0===n.arg?null:n.arg)}else n()}}function preRun(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__),runtimeExited=!0}function postRun(){if(Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPreMain(e){__ATMAIN__.unshift(e)}function addOnExit(e){__ATEXIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}function intArrayFromString(e,n,r){var t=r>0?r:lengthBytesUTF8(e)+1,i=new Array(t),u=stringToUTF8Array(e,i,0,i.length);return n&&(i.length=u),i}function intArrayToString(e){for(var n=[],r=0;r<e.length;r++){var t=e[r];t>255&&(t&=255),n.push(String.fromCharCode(t))}return n.join("")}function writeStringToMemory(e,n,r){Runtime.warnOnce("writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!");var t,i;r&&(i=n+lengthBytesUTF8(e),t=HEAP8[i]),stringToUTF8(e,n,1/0),r&&(HEAP8[i]=t)}function writeArrayToMemory(e,n){HEAP8.set(e,n)}function writeAsciiToMemory(e,n,r){for(var t=0;t<e.length;++t)HEAP8[n++>>0]=e.charCodeAt(t);r||(HEAP8[n>>0]=0)}function getUniqueRunDependency(e){return e}function addRunDependency(e){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var n=dependenciesFulfilled;dependenciesFulfilled=null,n()}}function _emscripten_asm_const_iiiiiiii(e,n,r,t,i,u,o,a){return ASM_CONSTS[e](n,r,t,i,u,o,a)}function _emscripten_asm_const_iiiii(e,n,r,t,i){return ASM_CONSTS[e](n,r,t,i)}function _emscripten_asm_const_iiidddddd(e,n,r,t,i,u,o,a,f){return ASM_CONSTS[e](n,r,t,i,u,o,a,f)}function _emscripten_asm_const_iiididi(e,n,r,t,i,u,o){return ASM_CONSTS[e](n,r,t,i,u,o)}function _emscripten_asm_const_iiii(e,n,r,t){return ASM_CONSTS[e](n,r,t)}function _emscripten_asm_const_iiiid(e,n,r,t,i){return ASM_CONSTS[e](n,r,t,i)}function _emscripten_asm_const_iiiiii(e,n,r,t,i,u){return ASM_CONSTS[e](n,r,t,i,u)}function _atexit(e,n){__ATEXIT__.unshift({func:e,arg:n})}function ___cxa_atexit(){return _atexit.apply(null,arguments)}function _abort(){Module.abort()}function __decorate(e,n,r,t){var i,u=arguments.length,o=u<3?n:null===t?t=Object.getOwnPropertyDescriptor(n,r):t;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,n,r,t);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(u<3?i(o):u>3?i(n,r,o):i(n,r))||o);return u>3&&o&&Object.defineProperty(n,r,o),o}function _defineHidden(e){return function(n,r){Object.defineProperty(n,r,{configurable:!1,enumerable:!1,value:e,writable:!0})}}function __nbind_free_external(e){_nbind.externalList[e].dereference(e)}function __nbind_reference_external(e){_nbind.externalList[e].reference()}function _llvm_stackrestore(e){var n=_llvm_stacksave,r=n.LLVM_SAVEDSTACKS[e];n.LLVM_SAVEDSTACKS.splice(e,1),Runtime.stackRestore(r)}function __nbind_register_pool(e,n,r,t){_nbind.Pool.pageSize=e,_nbind.Pool.usedPtr=n/4,_nbind.Pool.rootPtr=r,_nbind.Pool.pagePtr=t/4,HEAP32[n/4]=16909060,1==HEAP8[n]&&(_nbind.bigEndian=!0),HEAP32[n/4]=0,_nbind.makeTypeKindTbl=(u={},u[1024]=_nbind.PrimitiveType,u[64]=_nbind.Int64Type,u[2048]=_nbind.BindClass,u[3072]=_nbind.BindClassPtr,u[4096]=_nbind.SharedClassPtr,u[5120]=_nbind.ArrayType,u[6144]=_nbind.ArrayType,u[7168]=_nbind.CStringType,u[9216]=_nbind.CallbackType,u[10240]=_nbind.BindType,u),_nbind.makeTypeNameTbl={Buffer:_nbind.BufferType,External:_nbind.ExternalType,Int64:_nbind.Int64Type,_nbind_new:_nbind.CreateValueType,bool:_nbind.BooleanType,"cbFunction &":_nbind.CallbackType,"const cbFunction &":_nbind.CallbackType,"const std::string &":_nbind.StringType,"std::string":_nbind.StringType},Module.toggleLightGC=_nbind.toggleLightGC,_nbind.callUpcast=Module.dynCall_ii;var i=_nbind.makeType(_nbind.constructType,{flags:2048,id:0,name:""});i.proto=Module,_nbind.BindClass.list.push(i);var u}function _emscripten_set_main_loop_timing(e,n){function r(e){e.source===window&&e.data===i&&(e.stopPropagation(),t.shift()())}if(Browser.mainLoop.timingMode=e,Browser.mainLoop.timingValue=n,!Browser.mainLoop.func)return 1;if(0==e)Browser.mainLoop.scheduler=function(){var e=0|Math.max(0,Browser.mainLoop.tickStartTime+n-_emscripten_get_now());setTimeout(Browser.mainLoop.runner,e)},Browser.mainLoop.method="timeout";else if(1==e)Browser.mainLoop.scheduler=function(){Browser.requestAnimationFrame(Browser.mainLoop.runner)},Browser.mainLoop.method="rAF";else if(2==e){if(!window.setImmediate){var t=[],i="setimmediate";window.addEventListener("message",r,!0),window.setImmediate=function(e){t.push(e),ENVIRONMENT_IS_WORKER?(void 0===Module.setImmediates&&(Module.setImmediates=[]),Module.setImmediates.push(e),window.postMessage({target:i})):window.postMessage(i,"*")}}Browser.mainLoop.scheduler=function(){window.setImmediate(Browser.mainLoop.runner)},Browser.mainLoop.method="immediate"}return 0}function _emscripten_get_now(){abort()}function _emscripten_set_main_loop(e,n,r,t,i){Module.noExitRuntime=!0,assert(!Browser.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Browser.mainLoop.func=e,Browser.mainLoop.arg=t;var u;u="undefined"!=typeof t?function(){Module.dynCall_vi(e,t)}:function(){Module.dynCall_v(e)};var o=Browser.mainLoop.currentlyRunningMainloop;if(Browser.mainLoop.runner=function(){if(!ABORT){if(Browser.mainLoop.queue.length>0){var e=Date.now(),n=Browser.mainLoop.queue.shift();if(n.func(n.arg),Browser.mainLoop.remainingBlockers){var r=Browser.mainLoop.remainingBlockers,t=r%1==0?r-1:Math.floor(r);n.counted?Browser.mainLoop.remainingBlockers=t:(t+=.5,Browser.mainLoop.remainingBlockers=(8*r+t)/9)}if(console.log('main loop blocker "'+n.name+'" took '+(Date.now()-e)+" ms"),Browser.mainLoop.updateStatus(),o<Browser.mainLoop.currentlyRunningMainloop)return;return void setTimeout(Browser.mainLoop.runner,0)}if(!(o<Browser.mainLoop.currentlyRunningMainloop)){if(Browser.mainLoop.currentFrameNumber=Browser.mainLoop.currentFrameNumber+1|0,1==Browser.mainLoop.timingMode&&Browser.mainLoop.timingValue>1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0)return void Browser.mainLoop.scheduler();0==Browser.mainLoop.timingMode&&(Browser.mainLoop.tickStartTime=_emscripten_get_now()),"timeout"===Browser.mainLoop.method&&Module.ctx&&(Module.printErr("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"),Browser.mainLoop.method=""),Browser.mainLoop.runIter(u),o<Browser.mainLoop.currentlyRunningMainloop||("object"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),Browser.mainLoop.scheduler())}}},i||(n&&n>0?_emscripten_set_main_loop_timing(0,1e3/n):_emscripten_set_main_loop_timing(1,1),Browser.mainLoop.scheduler()),r)throw"SimulateInfiniteLoop"}function ___syscall6(e,n){SYSCALLS.varargs=n;try{var r=SYSCALLS.getStreamFromFD();return FS.close(r),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall54(e,n){SYSCALLS.varargs=n;try{return 0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function _typeModule(e){function n(e,n,r,t,i,u){if(1==n){var o=896&t;128!=o&&256!=o&&384!=o||(e="X const")}var a;return a=u?r.replace("X",e).replace("Y",i):e.replace("X",r).replace("Y",i),a.replace(/([*&]) (?=[*&])/g,"$1")}function r(e,n,r,t,i){throw new Error(e+" type "+r.replace("X",n+"?")+(t?" with flag "+t:"")+" in "+i)}function t(e,o,a,f,c,l,s,d){void 0===l&&(l="X"),void 0===d&&(d=1);var _=a(e);if(_)return _;var v=f(e),p=v.placeholderFlag,h=u[p];s&&h&&(l=n(s[2],s[0],l,h[0],"?",!0));var b;0==p&&(b="Unbound"),p>=10&&(b="Corrupt"),d>20&&(b="Deeply nested"),b&&r(b,e,l,p,c||"?");var m,y=v.paramList[0],w=t(y,o,a,f,c,l,h,d+1),g={flags:h[0],id:e,name:"",paramList:[w]},T=[],M="?";switch(v.placeholderFlag){case 1:m=w.spec;break;case 2:if(1024==(15360&w.flags)&&1==w.spec.ptrSize){g.flags=7168;break}case 3:case 6:case 5:m=w.spec,2048!=(15360&w.flags);break;case 8:M=""+v.paramList[1],g.paramList.push(v.paramList[1]);break;case 9:for(var k=0,A=v.paramList[1];k<A.length;k++){var E=A[k],S=t(E,o,a,f,c,l,h,d+1);T.push(S.name),g.paramList.push(S)}M=T.join(", ")}if(g.name=n(h[2],h[0],w.name,w.flags,M),m){for(var C=0,L=Object.keys(m);C<L.length;C++){var R=L[C];g[R]=g[R]||m[R]}g.flags|=m.flags}return i(o,g)}function i(e,n){var r=n.flags,t=896&r,i=15360&r;return n.name||1024!=i||(1==n.ptrSize?n.name=(16&r?"":(8&r?"un":"")+"signed ")+"char":n.name=(8&r?"u":"")+(32&r?"float":"int")+(8*n.ptrSize+"_t")),8!=n.ptrSize||32&r||(i=64),2048==i&&(512==t||640==t?i=4096:t&&(i=3072)),e(i,n)}var u=[[0,1,"X"],[1,1,"const X"],[128,1,"X *"],[256,1,"X &"],[384,1,"X &&"],[512,1,"std::shared_ptr<X>"],[640,1,"std::unique_ptr<X>"],[5120,1,"std::vector<X>"],[6144,2,"std::array<X, Y>"],[9216,-1,"std::function<X (Y)>"]],o=function(){function e(e){this.id=e.id,this.name=e.name,this.flags=e.flags,this.spec=e}return e.prototype.toString=function(){return this.name},e}(),a={Type:o,getComplexType:t,makeType:i,structureList:u};return e.output=a,e.output||a}function __nbind_register_type(e,n){var r=_nbind.readAsciiString(n),t={flags:10240,id:e,name:r};_nbind.makeType(_nbind.constructType,t)}function __nbind_register_callback_signature(e,n){var r=_nbind.readTypeIdList(e,n),t=_nbind.callbackSignatureList.length;return _nbind.callbackSignatureList[t]=_nbind.makeJSCaller(r),t}function __extends(e,n){function r(){this.constructor=e}for(var t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);r.prototype=n.prototype,e.prototype=new r}function __nbind_register_class(e,n,r,t,i,u,o){var a=_nbind.readAsciiString(o),f=_nbind.readPolicyList(n),c=HEAPU32.subarray(e/4,e/4+2),l={flags:2048|(f.Value?2:0),id:c[0],name:a},s=_nbind.makeType(_nbind.constructType,l);s.ptrType=_nbind.getComplexType(c[1],_nbind.constructType,_nbind.getType,_nbind.queryType),s.destroy=_nbind.makeMethodCaller(s.ptrType,{boundID:l.id,flags:0,name:"destroy",num:0,ptr:u,title:s.name+".free",typeList:["void","uint32_t","uint32_t"]}),i&&(s.superIdList=Array.prototype.slice.call(HEAPU32.subarray(r/4,r/4+i)),s.upcastList=Array.prototype.slice.call(HEAPU32.subarray(t/4,t/4+i))),Module[s.name]=s.makeBound(f),_nbind.BindClass.list.push(s)}function _removeAccessorPrefix(e){var n=/^[Gg]et_?([A-Z]?([A-Z]?))/;return e.replace(n,function(e,n,r){return r?n:n.toLowerCase()})}function __nbind_register_function(e,n,r,t,i,u,o,a,f,c){var l,s=_nbind.getType(e),d=_nbind.readPolicyList(n),_=_nbind.readTypeIdList(r,t);if(5==o)l=[{direct:i,name:"__nbindConstructor",ptr:0,title:s.name+" constructor",typeList:["uint32_t"].concat(_.slice(1))},{direct:u,name:"__nbindValueConstructor",ptr:0,title:s.name+" value constructor",typeList:["void","uint32_t"].concat(_.slice(1))}];else{var v=_nbind.readAsciiString(a),p=(s.name&&s.name+".")+v;3!=o&&4!=o||(v=_removeAccessorPrefix(v)),l=[{boundID:e,direct:u,name:v,ptr:i,title:p,typeList:_}]}for(var h=0,b=l;h<b.length;h++){var m=b[h];m.signatureType=o,m.policyTbl=d,m.num=f,m.flags=c,s.addMethod(m)}}function _nbind_value(e,n){_nbind.typeNameTbl[e]||_nbind.throwError("Unknown value type "+e),Module.NBind.bind_value(e,n),_defineHidden(_nbind.typeNameTbl[e].proto.prototype.__nbindValueConstructor)(n.prototype,"__nbindValueConstructor")}function __nbind_get_value_object(e,n){var r=_nbind.popValue(e);if(!r.fromJS)throw new Error("Object "+r+" has no fromJS function");r.fromJS(function(){r.__nbindValueConstructor.apply(this,Array.prototype.concat.apply([n],arguments))})}function _emscripten_memcpy_big(e,n,r){return HEAPU8.set(HEAPU8.subarray(n,n+r),e),e}function __nbind_register_primitive(e,n,r){var t={flags:1024|r,id:e,ptrSize:n};_nbind.makeType(_nbind.constructType,t)}function ___setErrNo(e){return Module.___errno_location&&(HEAP32[Module.___errno_location()>>2]=e),e}function _llvm_stacksave(){var e=_llvm_stacksave;return e.LLVM_SAVEDSTACKS||(e.LLVM_SAVEDSTACKS=[]),e.LLVM_SAVEDSTACKS.push(Runtime.stackSave()),e.LLVM_SAVEDSTACKS.length-1}function ___syscall140(e,n){SYSCALLS.varargs=n;try{var r=SYSCALLS.getStreamFromFD(),t=(SYSCALLS.get(),SYSCALLS.get()),i=SYSCALLS.get(),u=SYSCALLS.get(),o=t;return FS.llseek(r,o,u),HEAP32[i>>2]=r.position,r.getdents&&0===o&&0===u&&(r.getdents=null),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall146(e,n){SYSCALLS.varargs=n;try{var r=SYSCALLS.get(),t=SYSCALLS.get(),i=SYSCALLS.get(),u=0;___syscall146.buffer||(___syscall146.buffers=[null,[],[]],___syscall146.printChar=function(e,n){var r=___syscall146.buffers[e];assert(r),0===n||10===n?((1===e?Module.print:Module.printErr)(UTF8ArrayToString(r,0)),r.length=0):r.push(n)});for(var o=0;o<i;o++){for(var a=HEAP32[t+8*o>>2],f=HEAP32[t+(8*o+4)>>2],c=0;c<f;c++)___syscall146.printChar(r,HEAPU8[a+c]);u+=f}return u}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function __nbind_finish(){for(var e=0,n=_nbind.BindClass.list;e<n.length;e++){var r=n[e];r.finish()}}function invoke_viiiii(e,n,r,t,i,u){try{Module.dynCall_viiiii(e,n,r,t,i,u)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_vid(e,n,r){try{Module.dynCall_vid(e,n,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_fiff(e,n,r,t){try{return Module.dynCall_fiff(e,n,r,t)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_vi(e,n){try{Module.dynCall_vi(e,n)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_vii(e,n,r){try{Module.dynCall_vii(e,n,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_ii(e,n){try{return Module.dynCall_ii(e,n)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_viddi(e,n,r,t,i){try{Module.dynCall_viddi(e,n,r,t,i)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_vidd(e,n,r,t){try{Module.dynCall_vidd(e,n,r,t)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_iiii(e,n,r,t){try{return Module.dynCall_iiii(e,n,r,t)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_diii(e,n,r,t){try{return Module.dynCall_diii(e,n,r,t)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_di(e,n){try{return Module.dynCall_di(e,n)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_iid(e,n,r){try{return Module.dynCall_iid(e,n,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_iii(e,n,r){try{return Module.dynCall_iii(e,n,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_viiddi(e,n,r,t,i,u){try{Module.dynCall_viiddi(e,n,r,t,i,u)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_viiiiii(e,n,r,t,i,u,o){try{Module.dynCall_viiiiii(e,n,r,t,i,u,o)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_dii(e,n,r){try{return Module.dynCall_dii(e,n,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_i(e){try{return Module.dynCall_i(e)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_viiid(e,n,r,t,i){try{Module.dynCall_viiid(e,n,r,t,i)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_viififi(e,n,r,t,i,u,o){try{Module.dynCall_viififi(e,n,r,t,i,u,o)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_viii(e,n,r,t){try{Module.dynCall_viii(e,n,r,t)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_v(e){try{Module.dynCall_v(e)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_viid(e,n,r,t){try{Module.dynCall_viid(e,n,r,t)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_idd(e,n,r){try{return Module.dynCall_idd(e,n,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_viiii(e,n,r,t,i){try{Module.dynCall_viiii(e,n,r,t,i)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function ExitStatus(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function run(e){function n(){Module.calledRun||(Module.calledRun=!0,ABORT||(ensureInitRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),Module._main&&shouldRunNow&&Module.callMain(e),postRun()))}e=e||Module.arguments,null===preloadStartTime&&(preloadStartTime=Date.now()),runDependencies>0||(preRun(),runDependencies>0||Module.calledRun||(Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("")},1),n()},1)):n()))}function exit(e,n){n&&Module.noExitRuntime||(Module.noExitRuntime||(ABORT=!0,EXITSTATUS=e,STACKTOP=initialStackTop,exitRuntime(),Module.onExit&&Module.onExit(e)),ENVIRONMENT_IS_NODE&&process.exit(e),Module.quit(e,new ExitStatus(e)))}function abort(e){Module.onAbort&&Module.onAbort(e),void 0!==e?(Module.print(e),Module.printErr(e),e=JSON.stringify(e)):e="",ABORT=!0,EXITSTATUS=1;var n="\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.",r="abort("+e+") at "+stackTrace()+n;throw abortDecorators&&abortDecorators.forEach(function(n){r=n(r,e)}),r}"function"==typeof Module&&(cb=Module,Module={}),Module.onRuntimeInitialized=function(e,n){return function(){e&&e.apply(this,arguments);try{Module.ccall("nbind_init")}catch(e){return void n(e)}n(null,{bind:Module._nbind_value,reflect:Module.NBind.reflect,queryType:Module.NBind.queryType,toggleLightGC:Module.toggleLightGC,lib:Module})}}(Module.onRuntimeInitialized,cb);var Module;Module||(Module=("undefined"!=typeof Module?Module:null)||{});var moduleOverrides={};for(var key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var ENVIRONMENT_IS_WEB=!1,ENVIRONMENT_IS_WORKER=!1,ENVIRONMENT_IS_NODE=!1,ENVIRONMENT_IS_SHELL=!1;if(Module.ENVIRONMENT)if("WEB"===Module.ENVIRONMENT)ENVIRONMENT_IS_WEB=!0;else if("WORKER"===Module.ENVIRONMENT)ENVIRONMENT_IS_WORKER=!0;else if("NODE"===Module.ENVIRONMENT)ENVIRONMENT_IS_NODE=!0;else{if("SHELL"!==Module.ENVIRONMENT)throw new Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.");ENVIRONMENT_IS_SHELL=!0}else ENVIRONMENT_IS_WEB="object"==typeof window,ENVIRONMENT_IS_WORKER="function"==typeof importScripts,ENVIRONMENT_IS_NODE="object"==typeof process&&!0&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER,ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){Module.print||(Module.print=console.log),Module.printErr||(Module.printErr=console.warn);var nodeFS,nodePath;Module.read=function(e,n){nodeFS||(nodeFS=__webpack_require__(7)),nodePath||(nodePath=__webpack_require__(8)),e=nodePath.normalize(e);var r=nodeFS.readFileSync(e);return n?r:r.toString()},Module.readBinary=function(e){var n=Module.read(e,!0);return n.buffer||(n=new Uint8Array(n)),assert(n.buffer),n},Module.load=function(e){globalEval(read(e))},Module.thisProgram||(process.argv.length>1?Module.thisProgram=process.argv[1].replace(/\\/g,"/"):Module.thisProgram="unknown-program"),Module.arguments=process.argv.slice(2),module.exports=Module,process.on("uncaughtException",function(e){if(!(e instanceof ExitStatus))throw e}),Module.inspect=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL)Module.print||(Module.print=print),"undefined"!=typeof printErr&&(Module.printErr=printErr),"undefined"!=typeof read?Module.read=read:Module.read=function(){throw"no read() available"},Module.readBinary=function(e){if("function"==typeof readbuffer)return new Uint8Array(readbuffer(e));var n=read(e,"binary");return assert("object"==typeof n),n},"undefined"!=typeof scriptArgs?Module.arguments=scriptArgs:"undefined"!=typeof arguments&&(Module.arguments=arguments),"function"==typeof quit&&(Module.quit=function(e,n){quit(e)});else{if(!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER)throw"Unknown runtime environment. Where are we?";if(Module.read=function(e){var n=new XMLHttpRequest;return n.open("GET",e,!1),n.send(null),n.responseText},ENVIRONMENT_IS_WORKER&&(Module.readBinary=function(e){var n=new XMLHttpRequest;return n.open("GET",e,!1),n.responseType="arraybuffer",n.send(null),new Uint8Array(n.response)}),Module.readAsync=function(e,n,r){var t=new XMLHttpRequest;t.open("GET",e,!0),t.responseType="arraybuffer",t.onload=function(){200==t.status||0==t.status&&t.response?n(t.response):r()},t.onerror=r,t.send(null)},"undefined"!=typeof arguments&&(Module.arguments=arguments),"undefined"!=typeof console)Module.print||(Module.print=function(e){console.log(e)}),Module.printErr||(Module.printErr=function(e){console.warn(e)});else{var TRY_USE_DUMP=!1;Module.print||(Module.print=TRY_USE_DUMP&&"undefined"!=typeof dump?function(e){dump(e)}:function(e){})}ENVIRONMENT_IS_WORKER&&(Module.load=importScripts),"undefined"==typeof Module.setWindowTitle&&(Module.setWindowTitle=function(e){document.title=e})}!Module.load&&Module.read&&(Module.load=function(e){globalEval(Module.read(e))}),Module.print||(Module.print=function(){}),Module.printErr||(Module.printErr=Module.print),Module.arguments||(Module.arguments=[]),Module.thisProgram||(Module.thisProgram="./this.program"),Module.quit||(Module.quit=function(e,n){throw n}),Module.print=Module.print,Module.printErr=Module.printErr,Module.preRun=[],Module.postRun=[];for(var key in moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);moduleOverrides=void 0;var Runtime={setTempRet0:function(e){return tempRet0=e,e},getTempRet0:function(){return tempRet0},stackSave:function(){return STACKTOP},stackRestore:function(e){STACKTOP=e;
},getNativeTypeSize:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:if("*"===e[e.length-1])return Runtime.QUANTUM_SIZE;if("i"===e[0]){var n=parseInt(e.substr(1));return assert(n%8===0),n/8}return 0}},getNativeFieldSize:function(e){return Math.max(Runtime.getNativeTypeSize(e),Runtime.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(e,n){return"double"===n||"i64"===n?7&e&&(assert(4===(7&e)),e+=4):assert(0===(3&e)),e},getAlignSize:function(e,n,r){return r||"i64"!=e&&"double"!=e?e?Math.min(n||(e?Runtime.getNativeFieldSize(e):0),Runtime.QUANTUM_SIZE):Math.min(n,8):8},dynCall:function(e,n,r){return r&&r.length?Module["dynCall_"+e].apply(null,[n].concat(r)):Module["dynCall_"+e].call(null,n)},functionPointers:[],addFunction:function(e){for(var n=0;n<Runtime.functionPointers.length;n++)if(!Runtime.functionPointers[n])return Runtime.functionPointers[n]=e,2*(1+n);throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS."},removeFunction:function(e){Runtime.functionPointers[(e-2)/2]=null},warnOnce:function(e){Runtime.warnOnce.shown||(Runtime.warnOnce.shown={}),Runtime.warnOnce.shown[e]||(Runtime.warnOnce.shown[e]=1,Module.printErr(e))},funcWrappers:{},getFuncWrapper:function(e,n){assert(n),Runtime.funcWrappers[n]||(Runtime.funcWrappers[n]={});var r=Runtime.funcWrappers[n];return r[e]||(1===n.length?r[e]=function(){return Runtime.dynCall(n,e)}:2===n.length?r[e]=function(r){return Runtime.dynCall(n,e,[r])}:r[e]=function(){return Runtime.dynCall(n,e,Array.prototype.slice.call(arguments))}),r[e]},getCompilerSetting:function(e){throw"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work"},stackAlloc:function(e){var n=STACKTOP;return STACKTOP=STACKTOP+e|0,STACKTOP=STACKTOP+15&-16,n},staticAlloc:function(e){var n=STATICTOP;return STATICTOP=STATICTOP+e|0,STATICTOP=STATICTOP+15&-16,n},dynamicAlloc:function(e){var n=HEAP32[DYNAMICTOP_PTR>>2],r=(n+e+15|0)&-16;if(HEAP32[DYNAMICTOP_PTR>>2]=r,r>=TOTAL_MEMORY){var t=enlargeMemory();if(!t)return HEAP32[DYNAMICTOP_PTR>>2]=n,0}return n},alignMemory:function(e,n){var r=e=Math.ceil(e/(n?n:16))*(n?n:16);return r},makeBigInt:function(e,n,r){var t=r?+(e>>>0)+4294967296*+(n>>>0):+(e>>>0)+4294967296*+(0|n);return t},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module.Runtime=Runtime;var ABORT=0,EXITSTATUS=0,cwrap,ccall;!function(){function parseJSFunc(e){var n=e.toString().match(sourceRegex).slice(1);return{arguments:n[0],body:n[1],returnValue:n[2]}}function ensureJSsource(){if(!JSsource){JSsource={};for(var e in JSfuncs)JSfuncs.hasOwnProperty(e)&&(JSsource[e]=parseJSFunc(JSfuncs[e]))}}var JSfuncs={stackSave:function(){Runtime.stackSave()},stackRestore:function(){Runtime.stackRestore()},arrayToC:function(e){var n=Runtime.stackAlloc(e.length);return writeArrayToMemory(e,n),n},stringToC:function(e){var n=0;if(null!==e&&void 0!==e&&0!==e){var r=(e.length<<2)+1;n=Runtime.stackAlloc(r),stringToUTF8(e,n,r)}return n}},toC={string:JSfuncs.stringToC,array:JSfuncs.arrayToC};ccall=function(e,n,r,t,i){var u=getCFunc(e),o=[],a=0;if(t)for(var f=0;f<t.length;f++){var c=toC[r[f]];c?(0===a&&(a=Runtime.stackSave()),o[f]=c(t[f])):o[f]=t[f]}var l=u.apply(null,o);if("string"===n&&(l=Pointer_stringify(l)),0!==a){if(i&&i.async)return void EmterpreterAsync.asyncFinalizers.push(function(){Runtime.stackRestore(a)});Runtime.stackRestore(a)}return l};var sourceRegex=/^function\s*[a-zA-Z$_0-9]*\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/,JSsource=null;cwrap=function cwrap(ident,returnType,argTypes){argTypes=argTypes||[];var cfunc=getCFunc(ident),numericArgs=argTypes.every(function(e){return"number"===e}),numericRet="string"!==returnType;if(numericRet&&numericArgs)return cfunc;var argNames=argTypes.map(function(e,n){return"$"+n}),funcstr="(function("+argNames.join(",")+") {",nargs=argTypes.length;if(!numericArgs){ensureJSsource(),funcstr+="var stack = "+JSsource.stackSave.body+";";for(var i=0;i<nargs;i++){var arg=argNames[i],type=argTypes[i];if("number"!==type){var convertCode=JSsource[type+"ToC"];funcstr+="var "+convertCode.arguments+" = "+arg+";",funcstr+=convertCode.body+";",funcstr+=arg+"=("+convertCode.returnValue+");"}}}var cfuncname=parseJSFunc(function(){return cfunc}).returnValue;if(funcstr+="var ret = "+cfuncname+"("+argNames.join(",")+");",!numericRet){var strgfy=parseJSFunc(function(){return Pointer_stringify}).returnValue;funcstr+="ret = "+strgfy+"(ret);"}return numericArgs||(ensureJSsource(),funcstr+=JSsource.stackRestore.body.replace("()","(stack)")+";"),funcstr+="return ret})",eval(funcstr)}}(),Module.ccall=ccall,Module.cwrap=cwrap,Module.setValue=setValue,Module.getValue=getValue;var ALLOC_NORMAL=0,ALLOC_STACK=1,ALLOC_STATIC=2,ALLOC_DYNAMIC=3,ALLOC_NONE=4;Module.ALLOC_NORMAL=ALLOC_NORMAL,Module.ALLOC_STACK=ALLOC_STACK,Module.ALLOC_STATIC=ALLOC_STATIC,Module.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module.ALLOC_NONE=ALLOC_NONE,Module.allocate=allocate,Module.getMemory=getMemory,Module.Pointer_stringify=Pointer_stringify,Module.AsciiToString=AsciiToString,Module.stringToAscii=stringToAscii;var UTF8Decoder="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;Module.UTF8ArrayToString=UTF8ArrayToString,Module.UTF8ToString=UTF8ToString,Module.stringToUTF8Array=stringToUTF8Array,Module.stringToUTF8=stringToUTF8,Module.lengthBytesUTF8=lengthBytesUTF8;var UTF16Decoder="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;Module.stackTrace=stackTrace;var HEAP,buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,STATIC_BASE,STATICTOP,staticSealed,STACK_BASE,STACKTOP,STACK_MAX,DYNAMIC_BASE,DYNAMICTOP_PTR;STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0,staticSealed=!1;var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||134217728;if(TOTAL_MEMORY<TOTAL_STACK&&Module.printErr("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+TOTAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")"),buffer=Module.buffer?Module.buffer:new ArrayBuffer(TOTAL_MEMORY),updateGlobalBufferViews(),HEAP32[0]=1668509029,HEAP16[1]=25459,115!==HEAPU8[2]||99!==HEAPU8[3])throw"Runtime error: expected the system to be little-endian!";Module.HEAP=HEAP,Module.buffer=buffer,Module.HEAP8=HEAP8,Module.HEAP16=HEAP16,Module.HEAP32=HEAP32,Module.HEAPU8=HEAPU8,Module.HEAPU16=HEAPU16,Module.HEAPU32=HEAPU32,Module.HEAPF32=HEAPF32,Module.HEAPF64=HEAPF64;var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1,runtimeExited=!1;if(Module.addOnPreRun=addOnPreRun,Module.addOnInit=addOnInit,Module.addOnPreMain=addOnPreMain,Module.addOnExit=addOnExit,Module.addOnPostRun=addOnPostRun,Module.intArrayFromString=intArrayFromString,Module.intArrayToString=intArrayToString,Module.writeStringToMemory=writeStringToMemory,Module.writeArrayToMemory=writeArrayToMemory,Module.writeAsciiToMemory=writeAsciiToMemory,Math.imul&&Math.imul(4294967295,5)===-5||(Math.imul=function(e,n){var r=e>>>16,t=65535&e,i=n>>>16,u=65535&n;return t*u+(r*u+t*i<<16)|0}),Math.imul=Math.imul,!Math.fround){var froundBuffer=new Float32Array(1);Math.fround=function(e){return froundBuffer[0]=e,froundBuffer[0]}}Math.fround=Math.fround,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var n=0;n<32;n++)if(e&1<<31-n)return n;return 32}),Math.clz32=Math.clz32,Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Math.trunc=Math.trunc;var Math_abs=Math.abs,Math_cos=Math.cos,Math_sin=Math.sin,Math_tan=Math.tan,Math_acos=Math.acos,Math_asin=Math.asin,Math_atan=Math.atan,Math_atan2=Math.atan2,Math_exp=Math.exp,Math_log=Math.log,Math_sqrt=Math.sqrt,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_pow=Math.pow,Math_imul=Math.imul,Math_fround=Math.fround,Math_round=Math.round,Math_min=Math.min,Math_clz32=Math.clz32,Math_trunc=Math.trunc,runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;Module.addRunDependency=addRunDependency,Module.removeRunDependency=removeRunDependency,Module.preloadedImages={},Module.preloadedAudios={};var ASM_CONSTS=[function(e,n,r,t,i,u,o,a){return _nbind.callbackSignatureList[e].apply(this,arguments)}];STATIC_BASE=Runtime.GLOBAL_BASE,STATICTOP=STATIC_BASE+12832,__ATINIT__.push({func:function(){__GLOBAL__sub_I_nbind_cc()}},{func:function(){__GLOBAL__sub_I_common_cc()}},{func:function(){__GLOBAL__sub_I_Binding_cc()}}),allocate([1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,192,127,0,0,192,127,0,0,192,127,3,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,3,0,0,0,0,0,192,127,3,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,192,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,192,127,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,0,128,191,0,0,128,191,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,232,3,0,0,232,3,0,0,0,0,192,127,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,192,127,3,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,3,0,0,0,0,0,0,0,2,0,0,0,3,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,200,18,0,0,210,18,0,0,218,18,0,0,162,18,0,0,176,18,0,0,188,18,0,0,223,45,0,0,224,45,0,0,225,45,0,0,224,45,0,0,225,45,0,0,0,0,0,0,0,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,2,0,0,0,5,0,0,0,226,45,0,0,224,45,0,0,224,45,0,0,224,45,0,0,224,45,0,0,224,45,0,0,224,45,0,0,227,45,0,0,228,45,0,0,224,45,0,0,224,45,0,0,225,45,0,0,229,45,0,0,228,45,0,0,229,45,0,0,228,45,0,0,192,4,0,0,3,0,0,0,230,45,0,0,208,4,0,0,231,45,0,0,2,0,0,0,232,45,0,0,208,4,0,0,231,45,0,0,228,45,0,0,208,4,0,0,228,45,0,0,208,4,0,0,231,45,0,0,224,45,0,0,225,45,0,0,224,45,0,0,0,0,0,0,0,0,0,0,2,0,0,0,6,0,0,0,7,0,0,0,2,0,0,0,8,0,0,0,226,45,0,0,225,45,0,0,224,45,0,0,233,45,0,0,233,45,0,0,225,45,0,0,225,45,0,0,228,45,0,0,224,45,0,0,228,45,0,0,225,45,0,0,224,45,0,0,228,45,0,0,225,45,0,0,228,45,0,0,92,5,0,0,3,0,0,0,100,5,0,0,1,0,0,0,232,45,0,0,228,45,0,0,124,5,0,0,225,45,0,0,224,45,0,0,2,0,0,0,233,45,0,0,124,5,0,0,204,23,0,0,144,5,0,0,2,0,0,0,227,45,0,0,0,0,0,0,0,0,0,0,2,0,0,0,9,0,0,0,10,0,0,0,2,0,0,0,11,0,0,0,192,5,0,0,224,45,0,0,224,45,0,0,2,0,0,0,223,45,0,0,192,5,0,0,229,45,0,0,225,45,0,0,228,45,0,0,225,45,0,0,229,45,0,0,2,0,0,0,238,45,0,0,244,5,0,0,48,24,0,0,241,45,0,0,254,45,0,0,255,45,0,0,0,46,0,0,1,46,0,0,2,46,0,0,231,45,0,0,225,45,0,0,3,46,0,0,4,46,0,0,5,46,0,0,6,46,0,0,7,46,0,0,224,45,0,0,0,0,0,0,228,45,0,0,61,24,0,0,229,45,0,0,66,24,0,0,9,46,0,0,71,24,0,0,192,4,0,0,83,24,0,0,104,6,0,0,96,24,0,0,10,46,0,0,115,24,0,0,11,46,0,0,124,24,0,0,0,0,0,0,3,0,0,0,112,6,0,0,1,0,0,0,230,45,0,0,0,0,0,0,0,0,0,0,2,0,0,0,12,0,0,0,13,0,0,0,2,0,0,0,14,0,0,0,228,45,0,0,12,46,0,0,172,6,0,0,231,45,0,0,180,6,0,0,188,6,0,0,2,0,0,0,196,6,0,0,7,0,0,0,12,46,0,0,7,0,0,0,172,6,0,0,1,0,0,0,0,46,0,0,228,45,0,0,12,46,0,0,180,6,0,0,228,45,0,0,12,46,0,0,172,6,0,0,228,45,0,0,12,46,0,0,254,45,0,0,254,45,0,0,10,46,0,0,254,45,0,0,12,46,0,0,10,46,0,0,254,45,0,0,12,46,0,0,180,6,0,0,10,46,0,0,254,45,0,0,12,46,0,0,231,45,0,0,10,46,0,0,254,45,0,0,48,7,0,0,231,45,0,0,2,0,0,0,12,46,0,0,228,45,0,0,231,45,0,0,231,45,0,0,231,45,0,0,231,45,0,0,10,46,0,0,12,46,0,0,192,4,0,0,228,45,0,0,192,4,0,0,192,4,0,0,192,4,0,0,192,4,0,0,192,4,0,0,228,45,0,0,172,6,0,0,192,4,0,0,0,0,0,0,0,0,0,0,2,0,0,0,15,0,0,0,16,0,0,0,2,0,0,0,17,0,0,0,156,7,0,0,2,0,0,0,13,46,0,0,226,45,0,0,231,45,0,0,176,7,0,0,5,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,3,0,0,0,22,46,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,188,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,9,0,0,5,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,3,0,0,0,30,46,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,111,117,108,100,32,110,111,116,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,32,102,111,114,32,108,105,115,116,0,67,111,117,108,100,32,110,111,116,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,32,102,111,114,32,105,116,101,109,115,0,67,111,117,108,100,32,110,111,116,32,101,120,116,101,110,100,32,97,108,108,111,99,97,116,105,111,110,32,102,111,114,32,105,116,101,109,115,0,37,115,0,67,111,117,108,100,32,110,111,116,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,32,102,111,114,32,110,111,100,101,0,67,97,110,110,111,116,32,114,101,115,101,116,32,97,32,110,111,100,101,32,119,104,105,99,104,32,115,116,105,108,108,32,104,97,115,32,99,104,105,108,100,114,101,110,32,97,116,116,97,99,104,101,100,0,67,97,110,110,111,116,32,114,101,115,101,116,32,97,32,110,111,100,101,32,115,116,105,108,108,32,97,116,116,97,99,104,101,100,32,116,111,32,97,32,112,97,114,101,110,116,0,67,97,110,110,111,116,32,115,101,116,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,58,32,78,111,100,101,115,32,119,105,116,104,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,32,99,97,110,110,111,116,32,104,97,118,101,32,99,104,105,108,100,114,101,110,46,0,67,104,105,108,100,32,97,108,114,101,97,100,121,32,104,97,115,32,97,32,112,97,114,101,110,116,44,32,105,116,32,109,117,115,116,32,98,101,32,114,101,109,111,118,101,100,32,102,105,114,115,116,46,0,67,97,110,110,111,116,32,97,100,100,32,99,104,105,108,100,58,32,78,111,100,101,115,32,119,105,116,104,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,32,99,97,110,110,111,116,32,104,97,118,101,32,99,104,105,108,100,114,101,110,46,0,79,110,108,121,32,108,101,97,102,32,110,111,100,101,115,32,119,105,116,104,32,99,117,115,116,111,109,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,115,104,111,117,108,100,32,109,97,110,117,97,108,108,121,32,109,97,114,107,32,116,104,101,109,115,101,108,118,101,115,32,97,115,32,100,105,114,116,121,0,67,97,110,110,111,116,32,103,101,116,32,108,97,121,111,117,116,32,112,114,111,112,101,114,116,105,101,115,32,111,102,32,109,117,108,116,105,45,101,100,103,101,32,115,104,111,114,116,104,97,110,100,115,0,123,0,108,97,121,111,117,116,58,32,123,0,119,105,100,116,104,58,32,37,103,44,32,0,104,101,105,103,104,116,58,32,37,103,44,32,0,116,111,112,58,32,37,103,44,32,0,108,101,102,116,58,32,37,103,0,109,97,114,103,105,110,58,32,91,108,58,37,103,44,116,58,37,103,44,114,58,37,103,44,98,58,37,103,44,115,116,97,114,116,58,37,103,44,101,110,100,58,37,103,93,0,98,111,114,100,101,114,58,32,91,108,58,37,103,44,116,58,37,103,44,114,58,37,103,44,98,58,37,103,44,115,116,97,114,116,58,37,103,44,101,110,100,58,37,103,93,0,112,97,100,100,105,110,103,58,32,91,108,58,37,103,44,116,58,37,103,44,114,58,37,103,44,98,58,37,103,44,115,116,97,114,116,58,37,103,44,101,110,100,58,37,103,93,0,125,44,32,0,102,108,101,120,68,105,114,101,99,116,105,111,110,58,32,39,99,111,108,117,109,110,39,44,32,0,102,108,101,120,68,105,114,101,99,116,105,111,110,58,32,39,99,111,108,117,109,110,45,114,101,118,101,114,115,101,39,44,32,0,102,108,101,120,68,105,114,101,99,116,105,111,110,58,32,39,114,111,119,39,44,32,0,102,108,101,120,68,105,114,101,99,116,105,111,110,58,32,39,114,111,119,45,114,101,118,101,114,115,101,39,44,32,0,106,117,115,116,105,102,121,67,111,110,116,101,110,116,58,32,39,99,101,110,116,101,114,39,44,32,0,106,117,115,116,105,102,121,67,111,110,116,101,110,116,58,32,39,102,108,101,120,45,101,110,100,39,44,32,0,106,117,115,116,105,102,121,67,111,110,116,101,110,116,58,32,39,115,112,97,99,101,45,97,114,111,117,110,100,39,44,32,0,106,117,115,116,105,102,121,67,111,110,116,101,110,116,58,32,39,115,112,97,99,101,45,98,101,116,119,101,101,110,39,44,32,0,97,108,105,103,110,73,116,101,109,115,58,32,39,99,101,110,116,101,114,39,44,32,0,97,108,105,103,110,73,116,101,109,115,58,32,39,102,108,101,120,45,101,110,100,39,44,32,0,97,108,105,103,110,73,116,101,109,115,58,32,39,115,116,114,101,116,99,104,39,44,32,0,97,108,105,103,110,67,111,110,116,101,110,116,58,32,39,99,101,110,116,101,114,39,44,32,0,97,108,105,103,110,67,111,110,116,101,110,116,58,32,39,102,108,101,120,45,101,110,100,39,44,32,0,97,108,105,103,110,67,111,110,116,101,110,116,58,32,39,115,116,114,101,116,99,104,39,44,32,0,97,108,105,103,110,83,101,108,102,58,32,39,102,108,101,120,45,115,116,97,114,116,39,44,32,0,97,108,105,103,110,83,101,108,102,58,32,39,99,101,110,116,101,114,39,44,32,0,97,108,105,103,110,83,101,108,102,58,32,39,102,108,101,120,45,101,110,100,39,44,32,0,97,108,105,103,110,83,101,108,102,58,32,39,115,116,114,101,116,99,104,39,44,32,0,102,108,101,120,71,114,111,119,0,102,108,101,120,83,104,114,105,110,107,0,102,108,101,120,66,97,115,105,115,0,111,118,101,114,102,108,111,119,58,32,39,104,105,100,100,101,110,39,44,32,0,111,118,101,114,102,108,111,119,58,32,39,118,105,115,105,98,108,101,39,44,32,0,111,118,101,114,102,108,111,119,58,32,39,115,99,114,111,108,108,39,44,32,0,109,97,114,103,105,110,0,109,97,114,103,105,110,76,101,102,116,0,109,97,114,103,105,110,82,105,103,104,116,0,109,97,114,103,105,110,84,111,112,0,109,97,114,103,105,110,66,111,116,116,111,109,0,109,97,114,103,105,110,83,116,97,114,116,0,109,97,114,103,105,110,69,110,100,0,112,97,100,100,105,110,103,0,112,97,100,100,105,110,103,76,101,102,116,0,112,97,100,100,105,110,103,82,105,103,104,116,0,112,97,100,100,105,110,103,84,111,112,0,112,97,100,100,105,110,103,66,111,116,116,111,109,0,112,97,100,100,105,110,103,83,116,97,114,116,0,112,97,100,100,105,110,103,69,110,100,0,98,111,114,100,101,114,87,105,100,116,104,0,98,111,114,100,101,114,76,101,102,116,87,105,100,116,104,0,98,111,114,100,101,114,82,105,103,104,116,87,105,100,116,104,0,98,111,114,100,101,114,84,111,112,87,105,100,116,104,0,98,111,114,100,101,114,66,111,116,116,111,109,87,105,100,116,104,0,98,111,114,100,101,114,83,116,97,114,116,87,105,100,116,104,0,98,111,114,100,101,114,69,110,100,87,105,100,116,104,0,119,105,100,116,104,0,104,101,105,103,104,116,0,109,97,120,87,105,100,116,104,0,109,97,120,72,101,105,103,104,116,0,109,105,110,87,105,100,116,104,0,109,105,110,72,101,105,103,104,116,0,112,111,115,105,116,105,111,110,58,32,39,97,98,115,111,108,117,116,101,39,44,32,0,108,101,102,116,0,114,105,103,104,116,0,116,111,112,0,98,111,116,116,111,109,0,99,104,105,108,100,114,101,110,58,32,91,10,0,93,125,44,10,0,125,44,10,0,112,116,0,37,0,37,115,58,32,37,103,37,115,44,32,0,67,97,110,110,111,116,32,103,101,116,32,99,111,109,112,117,116,101,100,32,118,97,108,117,101,32,111,102,32,109,117,108,116,105,45,101,100,103,101,32,115,104,111,114,116,104,97,110,100,115,0,37,115,58,32,37,103,44,32,0,32,32,0,37,115,37,100,46,123,91,115,107,105,112,112,101,100,93,32,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,97,119,58,32,37,102,32,97,104,58,32,37,102,32,61,62,32,100,58,32,40,37,102,44,32,37,102,41,32,37,115,10,0,42,0,37,115,37,100,46,123,37,115,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,97,119,58,32,37,102,32,97,104,58,32,37,102,32,37,115,10,0,37,115,37,100,46,125,37,115,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,100,58,32,40,37,102,44,32,37,102,41,32,37,115,10,0,79,117,116,32,111,102,32,99,97,99,104,101,32,101,110,116,114,105,101,115,33,0,97,118,97,105,108,97,98,108,101,87,105,100,116,104,32,105,115,32,105,110,100,101,102,105,110,105,116,101,32,115,111,32,119,105,100,116,104,77,101,97,115,117,114,101,77,111,100,101,32,109,117,115,116,32,98,101,32,89,71,77,101,97,115,117,114,101,77,111,100,101,85,110,100,101,102,105,110,101,100,0,97,118,97,105,108,97,98,108,101,72,101,105,103,104,116,32,105,115,32,105,110,100,101,102,105,110,105,116,101,32,115,111,32,104,101,105,103,104,116,77,101,97,115,117,114,101,77,111,100,101,32,109,117,115,116,32,98,101,32,89,71,77,101,97,115,117,114,101,77,111,100,101,85,110,100,101,102,105,110,101,100,0,102,108,101,120,0,115,116,114,101,116,99,104,0,97,98,115,45,109,101,97,115,117,114,101,0,97,98,115,45,108,97,121,111,117,116,0,69,120,112,101,99,116,32,99,117,115,116,111,109,32,98,97,115,101,108,105,110,101,32,102,117,110,99,116,105,111,110,32,116,111,32,110,111,116,32,114,101,116,117,114,110,32,78,97,78,0,109,101,97,115,117,114,101,0,69,120,112,101,99,116,101,100,32,110,111,100,101,32,116,111,32,104,97,118,101,32,99,117,115,116,111,109,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,0,76,65,89,95,85,78,68,69,70,73,78,69,68,0,76,65,89,95,69,88,65,67,84,76,89,0,76,65,89,95,65,84,95,77,79,83,84,0,85,78,68,69,70,73,78,69,68,0,69,88,65,67,84,76,89,0,65,84,95,77,79,83,84,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,105,110,105,116,105,97,108,0,78,111,100,101,0,99,114,101,97,116,101,0,100,101,115,116,114,111,121,0,114,101,115,101,116,0,99,111,112,121,83,116,121,108,101,0,115,101,116,80,111,115,105,116,105,111,110,84,121,112,101,0,115,101,116,80,111,115,105,116,105,111,110,0,115,101,116,80,111,115,105,116,105,111,110,80,101,114,99,101,110,116,0,115,101,116,65,108,105,103,110,67,111,110,116,101,110,116,0,115,101,116,65,108,105,103,110,73,116,101,109,115,0,115,101,116,65,108,105,103,110,83,101,108,102,0,115,101,116,70,108,101,120,68,105,114,101,99,116,105,111,110,0,115,101,116,70,108,101,120,87,114,97,112,0,115,101,116,74,117,115,116,105,102,121,67,111,110,116,101,110,116,0,115,101,116,77,97,114,103,105,110,0,115,101,116,77,97,114,103,105,110,80,101,114,99,101,110,116,0,115,101,116,77,97,114,103,105,110,65,117,116,111,0,115,101,116,79,118,101,114,102,108,111,119,0,115,101,116,68,105,115,112,108,97,121,0,115,101,116,70,108,101,120,0,115,101,116,70,108,101,120,66,97,115,105,115,0,115,101,116,70,108,101,120,66,97,115,105,115,80,101,114,99,101,110,116,0,115,101,116,70,108,101,120,71,114,111,119,0,115,101,116,70,108,101,120,83,104,114,105,110,107,0,115,101,116,87,105,100,116,104,0,115,101,116,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,87,105,100,116,104,65,117,116,111,0,115,101,116,72,101,105,103,104,116,0,115,101,116,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,72,101,105,103,104,116,65,117,116,111,0,115,101,116,77,105,110,87,105,100,116,104,0,115,101,116,77,105,110,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,77,105,110,72,101,105,103,104,116,0,115,101,116,77,105,110,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,77,97,120,87,105,100,116,104,0,115,101,116,77,97,120,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,77,97,120,72,101,105,103,104,116,0,115,101,116,77,97,120,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,65,115,112,101,99,116,82,97,116,105,111,0,115,101,116,66,111,114,100,101,114,0,115,101,116,80,97,100,100,105,110,103,0,115,101,116,80,97,100,100,105,110,103,80,101,114,99,101,110,116,0,103,101,116,80,111,115,105,116,105,111,110,84,121,112,101,0,103,101,116,80,111,115,105,116,105,111,110,0,103,101,116,65,108,105,103,110,67,111,110,116,101,110,116,0,103,101,116,65,108,105,103,110,73,116,101,109,115,0,103,101,116,65,108,105,103,110,83,101,108,102,0,103,101,116,70,108,101,120,68,105,114,101,99,116,105,111,110,0,103,101,116,70,108,101,120,87,114,97,112,0,103,101,116,74,117,115,116,105,102,121,67,111,110,116,101,110,116,0,103,101,116,77,97,114,103,105,110,0,103,101,116,70,108,101,120,66,97,115,105,115,0,103,101,116,70,108,101,120,71,114,111,119,0,103,101,116,70,108,101,120,83,104,114,105,110,107,0,103,101,116,87,105,100,116,104,0,103,101,116,72,101,105,103,104,116,0,103,101,116,77,105,110,87,105,100,116,104,0,103,101,116,77,105,110,72,101,105,103,104,116,0,103,101,116,77,97,120,87,105,100,116,104,0,103,101,116,77,97,120,72,101,105,103,104,116,0,103,101,116,65,115,112,101,99,116,82,97,116,105,111,0,103,101,116,66,111,114,100,101,114,0,103,101,116,79,118,101,114,102,108,111,119,0,103,101,116,68,105,115,112,108,97,121,0,103,101,116,80,97,100,100,105,110,103,0,105,110,115,101,114,116,67,104,105,108,100,0,114,101,109,111,118,101,67,104,105,108,100,0,103,101,116,67,104,105,108,100,67,111,117,110,116,0,103,101,116,80,97,114,101,110,116,0,103,101,116,67,104,105,108,100,0,115,101,116,77,101,97,115,117,114,101,70,117,110,99,0,117,110,115,101,116,77,101,97,115,117,114,101,70,117,110,99,0,115,101,116,72,97,115,78,101,119,76,97,121,111,117,116,0,103,101,116,72,97,115,78,101,119,76,97,121,111,117,116,0,109,97,114,107,68,105,114,116,121,0,105,115,68,105,114,116,121,0,99,97,108,99,117,108,97,116,101,76,97,121,111,117,116,0,103,101,116,67,111,109,112,117,116,101,100,76,101,102,116,0,103,101,116,67,111,109,112,117,116,101,100,82,105,103,104,116,0,103,101,116,67,111,109,112,117,116,101,100,84,111,112,0,103,101,116,67,111,109,112,117,116,101,100,66,111,116,116,111,109,0,103,101,116,67,111,109,112,117,116,101,100,87,105,100,116,104,0,103,101,116,67,111,109,112,117,116,101,100,72,101,105,103,104,116,0,103,101,116,67,111,109,112,117,116,101,100,76,97,121,111,117,116,0,103,101,116,67,111,109,112,117,116,101,100,77,97,114,103,105,110,0,103,101,116,67,111,109,112,117,116,101,100,66,111,114,100,101,114,0,103,101,116,67,111,109,112,117,116,101,100,80,97,100,100,105,110,103,0,86,97,108,117,101,0,76,97,121,111,117,116,0,83,105,122,101,0,103,101,116,73,110,115,116,97,110,99,101,67,111,117,110,116,0,105,115,69,120,112,101,114,105,109,101,110,116,97,108,70,101,97,116,117,114,101,69,110,97,98,108,101,100,0,115,101,116,69,120,112,101,114,105,109,101,110,116,97,108,70,101,97,116,117,114,101,69,110,97,98,108,101,100,0,73,110,116,54,52,0,1,1,1,2,2,4,4,4,4,8,8,4,8,118,111,105,100,0,98,111,111,108,0,115,116,100,58,58,115,116,114,105,110,103,0,99,98,70,117,110,99,116,105,111,110,32,38,0,99,111,110,115,116,32,99,98,70,117,110,99,116,105,111,110,32,38,0,69,120,116,101,114,110,97,108,0,66,117,102,102,101,114,0,78,66,105,110,100,73,68,0,78,66,105,110,100,0,98,105,110,100,95,118,97,108,117,101,0,114,101,102,108,101,99,116,0,113,117,101,114,121,84,121,112,101,0,108,97,108,108,111,99,0,108,114,101,115,101,116,0,123,114,101,116,117,114,110,40,95,110,98,105,110,100,46,99,97,108,108,98,97,99,107,83,105,103,110,97,116,117,114,101,76,105,115,116,91,36,48,93,46,97,112,112,108,121,40,116,104,105,115,44,97,114,103,117,109,101,110,116,115,41,41,59,125,0,95,110,98,105,110,100,95,110,101,119,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,46,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE);
var tempDoublePtr=STATICTOP;STATICTOP+=16,Module._i64Subtract=_i64Subtract,Module._i64Add=_i64Add,Module._roundf=_roundf,Module._memset=_memset,Module._bitshift64Shl=_bitshift64Shl;var _nbind={},Browser={mainLoop:{scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){Browser.mainLoop.scheduler=null,Browser.mainLoop.currentlyRunningMainloop++},resume:function(){Browser.mainLoop.currentlyRunningMainloop++;var e=Browser.mainLoop.timingMode,n=Browser.mainLoop.timingValue,r=Browser.mainLoop.func;Browser.mainLoop.func=null,_emscripten_set_main_loop(r,0,!1,Browser.mainLoop.arg,!0),_emscripten_set_main_loop_timing(e,n),Browser.mainLoop.scheduler()},updateStatus:function(){if(Module.setStatus){var e=Module.statusMessage||"Please wait...",n=Browser.mainLoop.remainingBlockers,r=Browser.mainLoop.expectedBlockers;n?n<r?Module.setStatus(e+" ("+(r-n)+"/"+r+")"):Module.setStatus(e):Module.setStatus("")}},runIter:function(e){if(!ABORT){if(Module.preMainLoop){var n=Module.preMainLoop();if(n===!1)return}try{e()}catch(e){if(e instanceof ExitStatus)return;throw e&&"object"==typeof e&&e.stack&&Module.printErr("exception thrown: "+[e,e.stack]),e}Module.postMainLoop&&Module.postMainLoop()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){function e(){Browser.pointerLock=document.pointerLockElement===Module.canvas||document.mozPointerLockElement===Module.canvas||document.webkitPointerLockElement===Module.canvas||document.msPointerLockElement===Module.canvas}if(Module.preloadPlugins||(Module.preloadPlugins=[]),!Browser.initted){Browser.initted=!0;try{new Blob,Browser.hasBlobConstructor=!0}catch(e){Browser.hasBlobConstructor=!1,console.log("warning: no blob constructor, cannot create blobs with mimetypes")}Browser.BlobBuilder="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:Browser.hasBlobConstructor?null:console.log("warning: no BlobBuilder"),Browser.URLObject="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,Module.noImageDecoding||"undefined"!=typeof Browser.URLObject||(console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),Module.noImageDecoding=!0);var n={};n.canHandle=function(e){return!Module.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},n.handle=function(e,n,r,t){var i=null;if(Browser.hasBlobConstructor)try{i=new Blob([e],{type:Browser.getMimetype(n)}),i.size!==e.length&&(i=new Blob([new Uint8Array(e).buffer],{type:Browser.getMimetype(n)}))}catch(e){Runtime.warnOnce("Blob constructor present but fails: "+e+"; falling back to blob builder")}if(!i){var u=new Browser.BlobBuilder;u.append(new Uint8Array(e).buffer),i=u.getBlob()}var o=Browser.URLObject.createObjectURL(i),a=new Image;a.onload=function(){assert(a.complete,"Image "+n+" could not be decoded");var t=document.createElement("canvas");t.width=a.width,t.height=a.height;var i=t.getContext("2d");i.drawImage(a,0,0),Module.preloadedImages[n]=t,Browser.URLObject.revokeObjectURL(o),r&&r(e)},a.onerror=function(e){console.log("Image "+o+" could not be decoded"),t&&t()},a.src=o},Module.preloadPlugins.push(n);var r={};r.canHandle=function(e){return!Module.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},r.handle=function(e,n,r,t){function i(t){o||(o=!0,Module.preloadedAudios[n]=t,r&&r(e))}function u(){o||(o=!0,Module.preloadedAudios[n]=new Audio,t&&t())}var o=!1;if(!Browser.hasBlobConstructor)return u();try{var a=new Blob([e],{type:Browser.getMimetype(n)})}catch(e){return u()}var f=Browser.URLObject.createObjectURL(a),c=new Audio;c.addEventListener("canplaythrough",function(){i(c)},!1),c.onerror=function(r){function t(e){for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="=",t="",i=0,u=0,o=0;o<e.length;o++)for(i=i<<8|e[o],u+=8;u>=6;){var a=i>>u-6&63;u-=6,t+=n[a]}return 2==u?(t+=n[(3&i)<<4],t+=r+r):4==u&&(t+=n[(15&i)<<2],t+=r),t}o||(console.log("warning: browser could not fully decode audio "+n+", trying slower base64 approach"),c.src="data:audio/x-"+n.substr(-3)+";base64,"+t(e),i(c))},c.src=f,Browser.safeSetTimeout(function(){i(c)},1e4)},Module.preloadPlugins.push(r);var t=Module.canvas;t&&(t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock||t.msRequestPointerLock||function(){},t.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},t.exitPointerLock=t.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",e,!1),document.addEventListener("mozpointerlockchange",e,!1),document.addEventListener("webkitpointerlockchange",e,!1),document.addEventListener("mspointerlockchange",e,!1),Module.elementPointerLock&&t.addEventListener("click",function(e){!Browser.pointerLock&&Module.canvas.requestPointerLock&&(Module.canvas.requestPointerLock(),e.preventDefault())},!1))}},createContext:function(e,n,r,t){if(n&&Module.ctx&&e==Module.canvas)return Module.ctx;var i,u;if(n){var o={antialias:!1,alpha:!1};if(t)for(var a in t)o[a]=t[a];u=GL.createContext(e,o),u&&(i=GL.getContext(u).GLctx)}else i=e.getContext("2d");return i?(r&&(n||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),Module.ctx=i,n&&GL.makeContextCurrent(u),Module.useWebGL=n,Browser.moduleContextCreatedCallbacks.forEach(function(e){e()}),Browser.init()),i):null},destroyContext:function(e,n,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(e,n,r){function t(){Browser.isFullscreen=!1;var e=i.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(i.exitFullscreen=document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){},i.exitFullscreen=i.exitFullscreen.bind(document),Browser.lockPointer&&i.requestPointerLock(),Browser.isFullscreen=!0,Browser.resizeCanvas&&Browser.setFullscreenCanvasSize()):(e.parentNode.insertBefore(i,e),e.parentNode.removeChild(e),Browser.resizeCanvas&&Browser.setWindowedCanvasSize()),Module.onFullScreen&&Module.onFullScreen(Browser.isFullscreen),Module.onFullscreen&&Module.onFullscreen(Browser.isFullscreen),Browser.updateCanvasDimensions(i)}Browser.lockPointer=e,Browser.resizeCanvas=n,Browser.vrDevice=r,"undefined"==typeof Browser.lockPointer&&(Browser.lockPointer=!0),"undefined"==typeof Browser.resizeCanvas&&(Browser.resizeCanvas=!1),"undefined"==typeof Browser.vrDevice&&(Browser.vrDevice=null);var i=Module.canvas;Browser.fullscreenHandlersInstalled||(Browser.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",t,!1),document.addEventListener("mozfullscreenchange",t,!1),document.addEventListener("webkitfullscreenchange",t,!1),document.addEventListener("MSFullscreenChange",t,!1));var u=document.createElement("div");i.parentNode.insertBefore(u,i),u.appendChild(i),u.requestFullscreen=u.requestFullscreen||u.mozRequestFullScreen||u.msRequestFullscreen||(u.webkitRequestFullscreen?function(){u.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}:null)||(u.webkitRequestFullScreen?function(){u.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),r?u.requestFullscreen({vrDisplay:r}):u.requestFullscreen()},requestFullScreen:function(e,n,r){return Module.printErr("Browser.requestFullScreen() is deprecated. Please call Browser.requestFullscreen instead."),Browser.requestFullScreen=function(e,n,r){return Browser.requestFullscreen(e,n,r)},Browser.requestFullscreen(e,n,r)},nextRAF:0,fakeRequestAnimationFrame:function(e){var n=Date.now();if(0===Browser.nextRAF)Browser.nextRAF=n+16.666666666666668;else for(;n+2>=Browser.nextRAF;)Browser.nextRAF+=16.666666666666668;var r=Math.max(Browser.nextRAF-n,0);setTimeout(e,r)},requestAnimationFrame:function(e){"undefined"==typeof window?Browser.fakeRequestAnimationFrame(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||Browser.fakeRequestAnimationFrame),window.requestAnimationFrame(e))},safeCallback:function(e){return function(){if(!ABORT)return e.apply(null,arguments)}},allowAsyncCallbacks:!0,queuedAsyncCallbacks:[],pauseAsyncCallbacks:function(){Browser.allowAsyncCallbacks=!1},resumeAsyncCallbacks:function(){if(Browser.allowAsyncCallbacks=!0,Browser.queuedAsyncCallbacks.length>0){var e=Browser.queuedAsyncCallbacks;Browser.queuedAsyncCallbacks=[],e.forEach(function(e){e()})}},safeRequestAnimationFrame:function(e){return Browser.requestAnimationFrame(function(){ABORT||(Browser.allowAsyncCallbacks?e():Browser.queuedAsyncCallbacks.push(e))})},safeSetTimeout:function(e,n){return Module.noExitRuntime=!0,setTimeout(function(){ABORT||(Browser.allowAsyncCallbacks?e():Browser.queuedAsyncCallbacks.push(e))},n)},safeSetInterval:function(e,n){return Module.noExitRuntime=!0,setInterval(function(){ABORT||Browser.allowAsyncCallbacks&&e()},n)},getMimetype:function(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]},getUserMedia:function(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:function(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY:function(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta:function(e){var n=0;switch(e.type){case"DOMMouseScroll":n=e.detail;break;case"mousewheel":n=e.wheelDelta;break;case"wheel":n=e.deltaY;break;default:throw"unrecognized mouse wheel event: "+e.type}return n},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(e){if(Browser.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?Browser.mouseMovementX=Browser.mouseMovementY=0:(Browser.mouseMovementX=Browser.getMovementX(e),Browser.mouseMovementY=Browser.getMovementY(e)),"undefined"!=typeof SDL?(Browser.mouseX=SDL.mouseX+Browser.mouseMovementX,Browser.mouseY=SDL.mouseY+Browser.mouseMovementY):(Browser.mouseX+=Browser.mouseMovementX,Browser.mouseY+=Browser.mouseMovementY);else{var n=Module.canvas.getBoundingClientRect(),r=Module.canvas.width,t=Module.canvas.height,i="undefined"!=typeof window.scrollX?window.scrollX:window.pageXOffset,u="undefined"!=typeof window.scrollY?window.scrollY:window.pageYOffset;if("touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var o=e.touch;if(void 0===o)return;var a=o.pageX-(i+n.left),f=o.pageY-(u+n.top);a*=r/n.width,f*=t/n.height;var c={x:a,y:f};if("touchstart"===e.type)Browser.lastTouches[o.identifier]=c,Browser.touches[o.identifier]=c;else if("touchend"===e.type||"touchmove"===e.type){var l=Browser.touches[o.identifier];l||(l=c),Browser.lastTouches[o.identifier]=l,Browser.touches[o.identifier]=c}return}var s=e.pageX-(i+n.left),d=e.pageY-(u+n.top);s*=r/n.width,d*=t/n.height,Browser.mouseMovementX=s-Browser.mouseX,Browser.mouseMovementY=d-Browser.mouseY,Browser.mouseX=s,Browser.mouseY=d}},asyncLoad:function(e,n,r,t){var i=t?"":getUniqueRunDependency("al "+e);Module.readAsync(e,function(r){assert(r,'Loading data file "'+e+'" failed (no arrayBuffer).'),n(new Uint8Array(r)),i&&removeRunDependency(i)},function(n){if(!r)throw'Loading data file "'+e+'" failed.';r()}),i&&addRunDependency(i)},resizeListeners:[],updateResizeListeners:function(){var e=Module.canvas;Browser.resizeListeners.forEach(function(n){n(e.width,e.height)})},setCanvasSize:function(e,n,r){var t=Module.canvas;Browser.updateCanvasDimensions(t,e,n),r||Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if("undefined"!=typeof SDL){var e=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];e|=8388608,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=e}Browser.updateResizeListeners()},setWindowedCanvasSize:function(){if("undefined"!=typeof SDL){var e=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];e&=-8388609,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=e}Browser.updateResizeListeners()},updateCanvasDimensions:function(e,n,r){n&&r?(e.widthNative=n,e.heightNative=r):(n=e.widthNative,r=e.heightNative);var t=n,i=r;if(Module.forcedAspectRatio&&Module.forcedAspectRatio>0&&(t/i<Module.forcedAspectRatio?t=Math.round(i*Module.forcedAspectRatio):i=Math.round(t/Module.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){var u=Math.min(screen.width/t,screen.height/i);t=Math.round(t*u),i=Math.round(i*u)}Browser.resizeCanvas?(e.width!=t&&(e.width=t),e.height!=i&&(e.height=i),"undefined"!=typeof e.style&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=n&&(e.width=n),e.height!=r&&(e.height=r),"undefined"!=typeof e.style&&(t!=n||i!=r?(e.style.setProperty("width",t+"px","important"),e.style.setProperty("height",i+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))},wgetRequests:{},nextWgetRequestHandle:0,getNextWgetRequestHandle:function(){var e=Browser.nextWgetRequestHandle;return Browser.nextWgetRequestHandle++,e}},SYSCALLS={varargs:0,get:function(e){SYSCALLS.varargs+=4;var n=HEAP32[SYSCALLS.varargs-4>>2];return n},getStr:function(){var e=Pointer_stringify(SYSCALLS.get());return e},get64:function(){var e=SYSCALLS.get(),n=SYSCALLS.get();return assert(e>=0?0===n:n===-1),e},getZero:function(){assert(0===SYSCALLS.get())}};Module._bitshift64Lshr=_bitshift64Lshr,Module._nbind_value=_nbind_value,Module._memcpy=_memcpy;var cttz_i8=allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],"i8",ALLOC_STATIC);Module._llvm_cttz_i32=_llvm_cttz_i32,Module.___udivmoddi4=___udivmoddi4,Module.___udivdi3=___udivdi3,Module._sbrk=_sbrk,Module.___uremdi3=___uremdi3,Module._llvm_bswap_i32=_llvm_bswap_i32;var ___dso_handle=STATICTOP;STATICTOP+=16,function(_nbind){function constructType(e,n){var r=10240==e?_nbind.makeTypeNameTbl[n.name]||_nbind.BindType:_nbind.makeTypeKindTbl[e],t=new r(n);return typeIdTbl[n.id]=t,_nbind.typeNameTbl[n.name]=t,t}function getType(e){return typeIdTbl[e]}function queryType(e){var n=HEAPU8[e],r=_nbind.structureList[n][1];e/=4,r<0&&(++e,r=HEAPU32[e]+1);var t=Array.prototype.slice.call(HEAPU32.subarray(e+1,e+1+r));return 9==n&&(t=[t[0],t.slice(1)]),{paramList:t,placeholderFlag:n}}function getTypes(e,n){return e.map(function(e){return"number"==typeof e?_nbind.getComplexType(e,constructType,getType,queryType,n):_nbind.typeNameTbl[e]})}function readTypeIdList(e,n){return Array.prototype.slice.call(HEAPU32,e/4,e/4+n)}function readAsciiString(e){for(var n=e;HEAPU8[n++];);return String.fromCharCode.apply("",HEAPU8.subarray(e,n-1))}function readPolicyList(e){var n={};if(e)for(;;){var r=HEAPU32[e/4];if(!r)break;n[readAsciiString(r)]=!0,e+=4}return n}function getDynCall(e,n){var r={float32_t:"d",float64_t:"d",int64_t:"d",uint64_t:"d",void:"v"},t=e.map(function(e){return r[e.name]||"i"}).join(""),i=Module["dynCall_"+t];if(!i)throw new Error("dynCall_"+t+" not found for "+n+"("+e.map(function(e){return e.name}).join(", ")+")");return i}function addMethod(e,n,r,t){var i=e[n];e.hasOwnProperty(n)&&i?((i.arity||0===i.arity)&&(i=_nbind.makeOverloader(i,i.arity),e[n]=i),i.addMethod(r,t)):(r.arity=t,e[n]=r)}function throwError(e){throw new Error(e)}function pushCString(e,n){if(null===e||void 0===e){if(n&&n.Nullable)return 0;throw new Error("Type mismatch")}if(n&&n.Strict){if("string"!=typeof e)throw new Error("Type mismatch")}else e=e.toString();var r=Module.lengthBytesUTF8(e)+1,t=_nbind.Pool.lalloc(r);return Module.stringToUTF8Array(e,HEAPU8,t,r),t}function popCString(e){return 0===e?null:Module.Pointer_stringify(e)}function makeBound(e,n){var r=function(e){function r(n,t,i,u){var o=e.call(this)||this;if(!(o instanceof r))return new(Function.prototype.bind.apply(r,Array.prototype.concat.apply([null],arguments)));var a=t,f=i,c=u;if(n!==_nbind.ptrMarker){var l=o.__nbindConstructor.apply(o,arguments);a=4608,c=HEAPU32[l/4],f=HEAPU32[l/4+1]}var s={configurable:!0,enumerable:!1,value:null,writable:!1},d={__nbindFlags:a,__nbindPtr:f};c&&(d.__nbindShared=c,_nbind.mark(o));for(var _=0,v=Object.keys(d);_<v.length;_++){var p=v[_];s.value=d[p],Object.defineProperty(o,p,s)}return _defineHidden(0)(o,"__nbindState"),o}return __extends(r,e),r.prototype.free=function(){n.destroy.call(this,this.__nbindShared,this.__nbindFlags),this.__nbindState|=2,disableMember(this,"__nbindShared"),disableMember(this,"__nbindPtr")},r}(Wrapper);return __decorate([_defineHidden()],r.prototype,"__nbindConstructor",void 0),__decorate([_defineHidden()],r.prototype,"__nbindValueConstructor",void 0),__decorate([_defineHidden(e)],r.prototype,"__nbindPolicies",void 0),r}function disableMember(e,n){function r(){throw new Error("Accessing deleted object")}Object.defineProperty(e,n,{configurable:!1,enumerable:!1,get:r,set:r})}function popPointer(e,n){return e?new n.proto(_nbind.ptrMarker,n.flags,e):null}function pushPointer(e,n,r){if(!(e instanceof _nbind.Wrapper)){if(r)return _nbind.pushValue(e);throw new Error("Type mismatch")}var t=e.__nbindPtr,i=e.__nbindType.classType,u=n.classType;if(e instanceof n.proto)for(;i!=u;)t=_nbind.callUpcast(i.upcastList[0],t),i=i.superList[0];else if(t=i.upcastStep(u,t),!t)throw new Error("Type mismatch");return t}function pushMutablePointer(e,n){var r=pushPointer(e,n);if(1&e.__nbindFlags)throw new Error("Passing a const value as a non-const argument");return r}function popShared(e,n){var r=HEAPU32[e/4],t=HEAPU32[e/4+1];return t?new n.proto(_nbind.ptrMarker,n.flags,t,r):null}function pushShared(e,n){if(!(e instanceof n.proto))throw new Error("Type mismatch");return e.__nbindShared}function pushMutableShared(e,n){if(!(e instanceof n.proto))throw new Error("Type mismatch");if(1&e.__nbindFlags)throw new Error("Passing a const value as a non-const argument");return e.__nbindShared}function popExternal(e){var n=_nbind.externalList[e];return n.dereference(e),n.data}function pushExternal(e){var n=new External(e);return n.reference(),n.register()}function pushValue(e){var n=firstFreeValue;return n?firstFreeValue=_nbind.valueList[n]:n=_nbind.valueList.length,_nbind.valueList[n]=e,2*n+1}function popValue(e,n){if(e||_nbind.throwError("Value type JavaScript class is missing or not registered"),1&e){e>>=1;var r=_nbind.valueList[e];return _nbind.valueList[e]=firstFreeValue,firstFreeValue=e,r}if(n)return _nbind.popShared(e,n);throw new Error("Invalid value slot "+e)}function push64(e){return"number"==typeof e?e:4096*pushValue(e)+valueBase}function pop64(e){return e<valueBase?e:popValue((e-valueBase)/4096)}function pushArray(e,n){if(!e)return 0;var r=e.length;if((n.size||0===n.size)&&r<n.size)throw new Error("Type mismatch");var t=n.memberType.ptrSize,i=_nbind.Pool.lalloc(4+r*t);HEAPU32[i/4]=r;var u=n.memberType.heap,o=(i+4)/t,a=n.memberType.wireWrite,f=0;if(a)for(;f<r;)u[o++]=a(e[f++]);else for(;f<r;)u[o++]=e[f++];return i}function popArray(e,n){if(0===e)return null;var r=HEAPU32[e/4],t=new Array(r),i=n.memberType.heap;e=(e+4)/n.memberType.ptrSize;var u=n.memberType.wireRead,o=0;if(u)for(;o<r;)t[o++]=u(i[e++]);else for(;o<r;)t[o++]=i[e++];return t}function pushString(e,n){if(null===e||void 0===e){if(!n||!n.Nullable)throw new Error("Type mismatch");e=""}if(n&&n.Strict){if("string"!=typeof e)throw new Error("Type mismatch")}else e=e.toString();var r=Module.lengthBytesUTF8(e),t=_nbind.Pool.lalloc(4+r+1);return HEAPU32[t/4]=r,Module.stringToUTF8Array(e,HEAPU8,t+4,r+1),t}function popString(e){if(0===e)return null;var n=HEAPU32[e/4];return Module.Pointer_stringify(e+4,n)}function makeArgList(e){return Array.apply(null,Array(e)).map(function(e,n){return"a"+(n+1)})}function anyNeedsWireWrite(e,n){return e.reduce(function(e,r){return e||r.needsWireWrite(n)},!1)}function anyNeedsWireRead(e,n){return e.reduce(function(e,r){return e||!!r.needsWireRead(n)},!1)}function makeWireRead(e,n,r,t){var i=e.length;return r.makeWireRead?r.makeWireRead(t,e,i):r.wireRead?(e[i]=r.wireRead,"(convertParamList["+i+"]("+t+"))"):t}function makeWireWrite(e,n,r,t){var i,u=e.length;return i=r.makeWireWrite?r.makeWireWrite(t,n,e,u):r.wireWrite,i?"string"==typeof i?i:(e[u]=i,"(convertParamList["+u+"]("+t+"))"):t}function buildCallerFunction(dynCall,ptrType,ptr,num,policyTbl,needsWireWrite,prefix,returnType,argTypeList,mask,err){var argList=makeArgList(argTypeList.length),convertParamList=[],callExpression=makeWireRead(convertParamList,policyTbl,returnType,"dynCall("+[prefix].concat(argList.map(function(e,n){return makeWireWrite(convertParamList,policyTbl,argTypeList[n],e)})).join(",")+")"),resourceSet=_nbind.listResources([returnType],argTypeList),sourceCode="function("+argList.join(",")+"){"+(mask?"this.__nbindFlags&mask&&err();":"")+resourceSet.makeOpen()+"var r="+callExpression+";"+resourceSet.makeClose()+"return r;}";return eval("("+sourceCode+")")}function buildJSCallerFunction(returnType,argTypeList){var argList=makeArgList(argTypeList.length),convertParamList=[],callExpression=makeWireWrite(convertParamList,null,returnType,"_nbind.externalList[num].data("+argList.map(function(e,n){return makeWireRead(convertParamList,null,argTypeList[n],e)}).join(",")+")"),resourceSet=_nbind.listResources(argTypeList,[returnType]);resourceSet.remove(_nbind.resources.pool);var sourceCode="function("+["dummy","num"].concat(argList).join(",")+"){"+resourceSet.makeOpen()+"var r="+callExpression+";"+resourceSet.makeClose()+"return r;}";return eval("("+sourceCode+")")}function makeJSCaller(e){var n=e.length-1,r=_nbind.getTypes(e,"callback"),t=r[0],i=r.slice(1),u=anyNeedsWireRead(i,null),o=t.needsWireWrite(null);if(!o&&!u)switch(n){case 0:return function(e,n){return _nbind.externalList[n].data()};case 1:return function(e,n,r){return _nbind.externalList[n].data(r)};case 2:return function(e,n,r,t){return _nbind.externalList[n].data(r,t)};case 3:return function(e,n,r,t,i){return _nbind.externalList[n].data(r,t,i)}}return buildJSCallerFunction(t,i)}function makeMethodCaller(e,n){function r(){throw new Error("Calling a non-const method on a const object")}var t=n.typeList.length-1,i=n.typeList.slice(0);i.splice(1,0,"uint32_t",n.boundID);var u=_nbind.getTypes(i,n.title),o=u[0],a=u.slice(3),f=o.needsWireRead(n.policyTbl),c=anyNeedsWireWrite(a,n.policyTbl),l=n.ptr,s=n.num,d=_nbind.getDynCall(u,n.title),_=1&~n.flags;if(!f&&!c)switch(t){case 0:return function(){return this.__nbindFlags&_?r():d(l,s,_nbind.pushPointer(this,e))};case 1:return function(n){return this.__nbindFlags&_?r():d(l,s,_nbind.pushPointer(this,e),n)};case 2:return function(n,t){return this.__nbindFlags&_?r():d(l,s,_nbind.pushPointer(this,e),n,t)};case 3:return function(n,t,i){return this.__nbindFlags&_?r():d(l,s,_nbind.pushPointer(this,e),n,t,i)}}return buildCallerFunction(d,e,l,s,n.policyTbl,c,"ptr,num,pushPointer(this,ptrType)",o,a,_,r)}function makeCaller(e){var n,r=e.typeList.length-1,t=_nbind.getTypes(e.typeList,e.title),i=t[0],u=t.slice(1),o=i.needsWireRead(e.policyTbl),a=anyNeedsWireWrite(u,e.policyTbl),f=e.direct,c=e.ptr;if(e.direct&&!o&&!a){switch(n=_nbind.getDynCall(t,e.title),r){case 0:return function(){return n(f)};case 1:return function(e){return n(f,e)};case 2:return function(e,r){return n(f,e,r)};case 3:return function(e,r,t){return n(f,e,r,t)}}c=0}var l;if(c){var s=e.typeList.slice(0);s.splice(1,0,"uint32_t"),t=_nbind.getTypes(s,e.title),l="ptr,num"}else c=f,l="ptr";return n=_nbind.getDynCall(t,e.title),buildCallerFunction(n,null,c,e.num,e.policyTbl,a,l,i,u)}function makeOverloader(e,n){function r(){return t[arguments.length].apply(this,arguments)}var t=[];return r.addMethod=function(e,n){t[n]=e},r.addMethod(e,n),r}function listResources(e,n){for(var r=new Resource,t=0,i=e;t<i.length;t++)for(var u=i[t],o=0,a=u.readResources||[];o<a.length;o++){var f=a[o];r.add(f)}for(var c=0,l=n;c<l.length;c++)for(var u=l[c],s=0,d=u.writeResources||[];s<d.length;s++){var f=d[s];r.add(f)}return r}function getBuffer(e){return e instanceof ArrayBuffer?new Uint8Array(e):e instanceof DataView?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function pushBuffer(e,n){if(null!==e&&void 0!==e||n&&n.Nullable&&(e=[]),"object"!=typeof e)throw new Error("Type mismatch");var r=e,t=r.byteLength||r.length;if(!t&&0!==t&&0!==r.byteLength)throw new Error("Type mismatch");var i=_nbind.Pool.lalloc(8),u=_malloc(t),o=i/4;return HEAPU32[o++]=t,HEAPU32[o++]=u,HEAPU32[o++]=new ExternalBuffer(e,u).register(),HEAPU8.set(getBuffer(e),u),i}function commitBuffer(e,n,r){var t=_nbind.externalList[e].data,i=Buffer;if("function"!=typeof Buffer&&(i=function(){}),t instanceof Array);else{var u=HEAPU8.subarray(n,n+r);if(t instanceof i){var o=void 0;o="function"==typeof Buffer.from&&Buffer.from.length>=3?Buffer.from(u):new Buffer(u),o.copy(t)}else getBuffer(t).set(u)}}function sweep(){for(var e=0,n=dirtyList;e<n.length;e++){var r=n[e];3&r.__nbindState||r.free()}dirtyList=[],gcTimer=0}function toggleLightGC(e){e?_nbind.mark=function(e){dirtyList.push(e),gcTimer||(gcTimer=setTimeout(sweep,0))}:_nbind.mark=function(e){}}var typeIdTbl={};_nbind.typeNameTbl={};var Pool=function(){function e(){}return e.lalloc=function(n){n=n+7&-8;var r=HEAPU32[e.usedPtr];if(n>e.pageSize/2||n>e.pageSize-r){var t=_nbind.typeNameTbl.NBind.proto;return t.lalloc(n)}return HEAPU32[e.usedPtr]=r+n,e.rootPtr+r},e.lreset=function(n,r){var t=HEAPU32[e.pagePtr];if(t){var i=_nbind.typeNameTbl.NBind.proto;i.lreset(n,r)}else HEAPU32[e.usedPtr]=n},e}();_nbind.Pool=Pool,_nbind.constructType=constructType,_nbind.getType=getType,_nbind.queryType=queryType,_nbind.getTypes=getTypes,_nbind.readTypeIdList=readTypeIdList,_nbind.readAsciiString=readAsciiString,_nbind.readPolicyList=readPolicyList,_nbind.getDynCall=getDynCall,_nbind.addMethod=addMethod,_nbind.throwError=throwError,_nbind.bigEndian=!1,_a=_typeModule(_typeModule),_nbind.Type=_a.Type,_nbind.makeType=_a.makeType,_nbind.getComplexType=_a.getComplexType,_nbind.structureList=_a.structureList;var BindType=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.heap=HEAPU32,n.ptrSize=4,n}return __extends(n,e),n.prototype.needsWireRead=function(e){return!!this.wireRead||!!this.makeWireRead},n.prototype.needsWireWrite=function(e){return!!this.wireWrite||!!this.makeWireWrite},n}(_nbind.Type);_nbind.BindType=BindType;var PrimitiveType=function(e){function n(n){var r=e.call(this,n)||this,t=32&n.flags?{32:HEAPF32,64:HEAPF64}:8&n.flags?{8:HEAPU8,16:HEAPU16,32:HEAPU32}:{8:HEAP8,16:HEAP16,32:HEAP32};return r.heap=t[8*n.ptrSize],r.ptrSize=n.ptrSize,r}return __extends(n,e),n.prototype.needsWireWrite=function(e){return!!e&&!!e.Strict},n.prototype.makeWireWrite=function(e,n){return n&&n.Strict&&function(e){if("number"==typeof e)return e;throw new Error("Type mismatch")}},n}(BindType);_nbind.PrimitiveType=PrimitiveType,_nbind.pushCString=pushCString,_nbind.popCString=popCString;var CStringType=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.wireRead=popCString,n.wireWrite=pushCString,n.readResources=[_nbind.resources.pool],n.writeResources=[_nbind.resources.pool],n}return __extends(n,e),n.prototype.makeWireWrite=function(e,n){return function(e){return pushCString(e,n)}},n}(BindType);_nbind.CStringType=CStringType;var BooleanType=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.wireRead=function(e){return!!e},n}return __extends(n,e),n.prototype.needsWireWrite=function(e){return!!e&&!!e.Strict},n.prototype.makeWireRead=function(e){return"!!("+e+")"},n.prototype.makeWireWrite=function(e,n){return n&&n.Strict&&function(e){if("boolean"==typeof e)return e;throw new Error("Type mismatch")}||e},n}(BindType);_nbind.BooleanType=BooleanType;var Wrapper=function(){function e(){}return e.prototype.persist=function(){this.__nbindState|=1},e}();_nbind.Wrapper=Wrapper,_nbind.makeBound=makeBound,_nbind.ptrMarker={};var BindClass=function(e){function n(n){var r=e.call(this,n)||this;return r.wireRead=function(e){return _nbind.popValue(e,r.ptrType)},r.wireWrite=function(e){return pushPointer(e,r.ptrType,!0)},r.pendingSuperCount=0,r.ready=!1,r.methodTbl={},n.paramList?(r.classType=n.paramList[0].classType,r.proto=r.classType.proto):r.classType=r,r}return __extends(n,e),n.prototype.makeBound=function(e){var n=_nbind.makeBound(e,this);return this.proto=n,this.ptrType.proto=n,n},n.prototype.addMethod=function(e){var n=this.methodTbl[e.name]||[];n.push(e),this.methodTbl[e.name]=n},n.prototype.registerMethods=function(e,n){for(var r,t=0,i=Object.keys(e.methodTbl);t<i.length;t++)for(var u=i[t],o=e.methodTbl[u],a=0,f=o;a<f.length;a++){var c=f[a],l=void 0,s=void 0;if(l=this.proto.prototype,!n||1==c.signatureType)switch(c.signatureType){case 1:l=this.proto;case 5:s=_nbind.makeCaller(c),_nbind.addMethod(l,c.name,s,c.typeList.length-1);break;case 4:r=_nbind.makeMethodCaller(e.ptrType,c);break;case 3:Object.defineProperty(l,c.name,{configurable:!0,enumerable:!1,get:_nbind.makeMethodCaller(e.ptrType,c),set:r});break;case 2:s=_nbind.makeMethodCaller(e.ptrType,c),_nbind.addMethod(l,c.name,s,c.typeList.length-1)}}},n.prototype.registerSuperMethods=function(e,n,r){if(!r[e.name]){r[e.name]=!0;for(var t,i=0,u=0,o=e.superIdList||[];u<o.length;u++){var a=o[u],f=_nbind.getType(a);t=i++<n||n<0?-1:0,this.registerSuperMethods(f,t,r)}this.registerMethods(e,n<0)}},n.prototype.finish=function(){if(this.ready)return this;this.ready=!0,this.superList=(this.superIdList||[]).map(function(e){return _nbind.getType(e).finish()});var e=this.proto;if(this.superList.length){var n=function(){this.constructor=e};n.prototype=this.superList[0].proto.prototype,e.prototype=new n}return e!=Module&&(e.prototype.__nbindType=this),this.registerSuperMethods(this,1,{}),this},n.prototype.upcastStep=function(e,n){if(e==this)return n;for(var r=0;r<this.superList.length;++r){var t=this.superList[r].upcastStep(e,_nbind.callUpcast(this.upcastList[r],n));if(t)return t}return 0},n}(_nbind.BindType);BindClass.list=[],_nbind.BindClass=BindClass,_nbind.popPointer=popPointer,_nbind.pushPointer=pushPointer;var BindClassPtr=function(e){function n(n){var r=e.call(this,n)||this;r.classType=n.paramList[0].classType,r.proto=r.classType.proto;var t=1&n.flags,i=256==(896&r.flags)&&2&n.flags,u=t?pushPointer:pushMutablePointer,o=i?_nbind.popValue:popPointer;return r.makeWireWrite=function(e,n){return n.Nullable?function(e){return e?u(e,r):0}:function(e){return u(e,r)}},r.wireRead=function(e){return o(e,r)},r.wireWrite=function(e){return u(e,r)},r}return __extends(n,e),n}(_nbind.BindType);_nbind.BindClassPtr=BindClassPtr,_nbind.popShared=popShared;var SharedClassPtr=function(e){function n(n){var r=e.call(this,n)||this;r.readResources=[_nbind.resources.pool],r.classType=n.paramList[0].classType,r.proto=r.classType.proto;var t=1&n.flags,i=t?pushShared:pushMutableShared;return r.wireRead=function(e){return popShared(e,r)},r.wireWrite=function(e){return i(e,r)},r}return __extends(n,e),n}(_nbind.BindType);_nbind.SharedClassPtr=SharedClassPtr,_nbind.externalList=[0];var firstFreeExternal=0,External=function(){function e(e){this.refCount=1,this.data=e}return e.prototype.register=function(){
var e=firstFreeExternal;return e?firstFreeExternal=_nbind.externalList[e]:e=_nbind.externalList.length,_nbind.externalList[e]=this,e},e.prototype.reference=function(){++this.refCount},e.prototype.dereference=function(e){0==--this.refCount&&(this.free&&this.free(),_nbind.externalList[e]=firstFreeExternal,firstFreeExternal=e)},e}();_nbind.External=External;var ExternalType=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.wireRead=popExternal,n.wireWrite=pushExternal,n}return __extends(n,e),n}(_nbind.BindType);_nbind.ExternalType=ExternalType,_nbind.callbackSignatureList=[];var CallbackType=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.wireWrite=function(e){return"function"!=typeof e&&_nbind.throwError("Type mismatch"),new _nbind.External(e).register()},n}return __extends(n,e),n}(_nbind.BindType);_nbind.CallbackType=CallbackType,_nbind.valueList=[0];var firstFreeValue=0;_nbind.pushValue=pushValue,_nbind.popValue=popValue;var valueBase=0x10000000000000000,CreateValueType=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return __extends(n,e),n.prototype.makeWireWrite=function(e){return"(_nbind.pushValue(new "+e+"))"},n}(_nbind.BindType);_nbind.CreateValueType=CreateValueType;var Int64Type=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.wireWrite=push64,n.wireRead=pop64,n}return __extends(n,e),n}(_nbind.BindType);_nbind.Int64Type=Int64Type,_nbind.pushArray=pushArray,_nbind.popArray=popArray;var ArrayType=function(e){function n(n){var r=e.call(this,n)||this;return r.wireRead=function(e){return popArray(e,r)},r.wireWrite=function(e){return pushArray(e,r)},r.readResources=[_nbind.resources.pool],r.writeResources=[_nbind.resources.pool],r.memberType=n.paramList[0],n.paramList[1]&&(r.size=n.paramList[1]),r}return __extends(n,e),n}(_nbind.BindType);_nbind.ArrayType=ArrayType,_nbind.pushString=pushString,_nbind.popString=popString;var StringType=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.wireRead=popString,n.wireWrite=pushString,n.readResources=[_nbind.resources.pool],n.writeResources=[_nbind.resources.pool],n}return __extends(n,e),n.prototype.makeWireWrite=function(e,n){return function(e){return pushString(e,n)}},n}(_nbind.BindType);_nbind.StringType=StringType,_nbind.buildJSCallerFunction=buildJSCallerFunction,_nbind.makeJSCaller=makeJSCaller,_nbind.makeMethodCaller=makeMethodCaller,_nbind.makeCaller=makeCaller,_nbind.makeOverloader=makeOverloader;var Resource=function(){function e(e,n){var r=this;this.makeOpen=function(){return Object.keys(r.openTbl).join("")},this.makeClose=function(){return Object.keys(r.closeTbl).join("")},this.openTbl={},this.closeTbl={},e&&(this.openTbl[e]=!0),n&&(this.closeTbl[n]=!0)}return e.prototype.add=function(e){for(var n=0,r=Object.keys(e.openTbl);n<r.length;n++){var t=r[n];this.openTbl[t]=!0}for(var i=0,u=Object.keys(e.closeTbl);i<u.length;i++){var t=u[i];this.closeTbl[t]=!0}},e.prototype.remove=function(e){for(var n=0,r=Object.keys(e.openTbl);n<r.length;n++){var t=r[n];delete this.openTbl[t]}for(var i=0,u=Object.keys(e.closeTbl);i<u.length;i++){var t=u[i];delete this.closeTbl[t]}},e}();_nbind.Resource=Resource,_nbind.listResources=listResources,_nbind.resources={pool:new Resource("var used=HEAPU32[_nbind.Pool.usedPtr],page=HEAPU32[_nbind.Pool.pagePtr];","_nbind.Pool.lreset(used,page);")};var ExternalBuffer=function(e){function n(n,r){var t=e.call(this,n)||this;return t.ptr=r,t}return __extends(n,e),n.prototype.free=function(){_free(this.ptr)},n}(_nbind.External),BufferType=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.wireWrite=pushBuffer,n.readResources=[_nbind.resources.pool],n.writeResources=[_nbind.resources.pool],n}return __extends(n,e),n.prototype.makeWireWrite=function(e,n){return function(e){return pushBuffer(e,n)}},n}(_nbind.BindType);_nbind.BufferType=BufferType,_nbind.commitBuffer=commitBuffer;var dirtyList=[],gcTimer=0;_nbind.mark=function(e){},_nbind.toggleLightGC=toggleLightGC}(_nbind),Module.requestFullScreen=function(e,n,r){Module.printErr("Module.requestFullScreen is deprecated. Please call Module.requestFullscreen instead."),Module.requestFullScreen=Module.requestFullscreen,Browser.requestFullScreen(e,n,r)},Module.requestFullscreen=function(e,n,r){Browser.requestFullscreen(e,n,r)},Module.requestAnimationFrame=function(e){Browser.requestAnimationFrame(e)},Module.setCanvasSize=function(e,n,r){Browser.setCanvasSize(e,n,r)},Module.pauseMainLoop=function(){Browser.mainLoop.pause()},Module.resumeMainLoop=function(){Browser.mainLoop.resume()},Module.getUserMedia=function(){Browser.getUserMedia()},Module.createContext=function(e,n,r,t){return Browser.createContext(e,n,r,t)},_emscripten_get_now=ENVIRONMENT_IS_NODE?function(){var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:"undefined"!=typeof dateNow?dateNow:"object"==typeof self&&self.performance&&"function"==typeof self.performance.now?function(){return self.performance.now()}:"object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:Date.now,__ATEXIT__.push(function(){var e=Module._fflush;e&&e(0);var n=___syscall146.printChar;if(n){var r=___syscall146.buffers;r[1].length&&n(1,10),r[2].length&&n(2,10)}}),DYNAMICTOP_PTR=allocate(1,"i32",ALLOC_STATIC),STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP),STACK_MAX=STACK_BASE+TOTAL_STACK,DYNAMIC_BASE=Runtime.alignMemory(STACK_MAX),HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE,staticSealed=!0,Module.asmGlobalArg={Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array,NaN:NaN,Infinity:1/0},Module.asmLibraryArg={abort:abort,assert:assert,enlargeMemory:enlargeMemory,getTotalMemory:getTotalMemory,abortOnCannotGrowMemory:abortOnCannotGrowMemory,invoke_viiiii:invoke_viiiii,invoke_vid:invoke_vid,invoke_fiff:invoke_fiff,invoke_vi:invoke_vi,invoke_vii:invoke_vii,invoke_ii:invoke_ii,invoke_viddi:invoke_viddi,invoke_vidd:invoke_vidd,invoke_iiii:invoke_iiii,invoke_diii:invoke_diii,invoke_di:invoke_di,invoke_iid:invoke_iid,invoke_iii:invoke_iii,invoke_viiddi:invoke_viiddi,invoke_viiiiii:invoke_viiiiii,invoke_dii:invoke_dii,invoke_i:invoke_i,invoke_viiid:invoke_viiid,invoke_viififi:invoke_viififi,invoke_viii:invoke_viii,invoke_v:invoke_v,invoke_viid:invoke_viid,invoke_idd:invoke_idd,invoke_viiii:invoke_viiii,_emscripten_asm_const_iiiii:_emscripten_asm_const_iiiii,_emscripten_asm_const_iiidddddd:_emscripten_asm_const_iiidddddd,_emscripten_asm_const_iiiid:_emscripten_asm_const_iiiid,__nbind_reference_external:__nbind_reference_external,_emscripten_asm_const_iiiiiiii:_emscripten_asm_const_iiiiiiii,_removeAccessorPrefix:_removeAccessorPrefix,_typeModule:_typeModule,__nbind_register_pool:__nbind_register_pool,__decorate:__decorate,_llvm_stackrestore:_llvm_stackrestore,___cxa_atexit:___cxa_atexit,__extends:__extends,__nbind_get_value_object:__nbind_get_value_object,_emscripten_set_main_loop_timing:_emscripten_set_main_loop_timing,__nbind_register_primitive:__nbind_register_primitive,__nbind_register_type:__nbind_register_type,_emscripten_memcpy_big:_emscripten_memcpy_big,__nbind_register_function:__nbind_register_function,___setErrNo:___setErrNo,__nbind_register_class:__nbind_register_class,__nbind_finish:__nbind_finish,_abort:_abort,_nbind_value:_nbind_value,_llvm_stacksave:_llvm_stacksave,___syscall54:___syscall54,_defineHidden:_defineHidden,_emscripten_set_main_loop:_emscripten_set_main_loop,_emscripten_get_now:_emscripten_get_now,__nbind_register_callback_signature:__nbind_register_callback_signature,_emscripten_asm_const_iiiiii:_emscripten_asm_const_iiiiii,__nbind_free_external:__nbind_free_external,_emscripten_asm_const_iiii:_emscripten_asm_const_iiii,_emscripten_asm_const_iiididi:_emscripten_asm_const_iiididi,___syscall6:___syscall6,_atexit:_atexit,___syscall140:___syscall140,___syscall146:___syscall146,DYNAMICTOP_PTR:DYNAMICTOP_PTR,tempDoublePtr:tempDoublePtr,ABORT:ABORT,STACKTOP:STACKTOP,STACK_MAX:STACK_MAX,cttz_i8:cttz_i8,___dso_handle:___dso_handle};var asm=function(e,n,r){"use asm";var t=new e.Int8Array(r);var i=new e.Int16Array(r);var u=new e.Int32Array(r);var o=new e.Uint8Array(r);var a=new e.Uint16Array(r);var f=new e.Uint32Array(r);var c=new e.Float32Array(r);var l=new e.Float64Array(r);var s=n.DYNAMICTOP_PTR|0;var d=n.tempDoublePtr|0;var _=n.ABORT|0;var v=n.STACKTOP|0;var p=n.STACK_MAX|0;var h=n.cttz_i8|0;var b=n.___dso_handle|0;var m=0;var y=0;var w=0;var g=0;var T=e.NaN,M=e.Infinity;var k=0,A=0,E=0,S=0,C=0;var L=0;var R=e.Math.floor;var P=e.Math.abs;var B=e.Math.sqrt;var O=e.Math.pow;var I=e.Math.cos;var N=e.Math.sin;var U=e.Math.tan;var F=e.Math.acos;var x=e.Math.asin;var D=e.Math.atan;var H=e.Math.atan2;var W=e.Math.exp;var Y=e.Math.log;var V=e.Math.ceil;var z=e.Math.imul;var j=e.Math.min;var q=e.Math.max;var G=e.Math.clz32;var X=e.Math.fround;var K=n.abort;var J=n.assert;var Z=n.enlargeMemory;var Q=n.getTotalMemory;var $=n.abortOnCannotGrowMemory;var ee=n.invoke_viiiii;var ne=n.invoke_vid;var re=n.invoke_fiff;var te=n.invoke_vi;var ie=n.invoke_vii;var ue=n.invoke_ii;var oe=n.invoke_viddi;var ae=n.invoke_vidd;var fe=n.invoke_iiii;var ce=n.invoke_diii;var le=n.invoke_di;var se=n.invoke_iid;var de=n.invoke_iii;var _e=n.invoke_viiddi;var ve=n.invoke_viiiiii;var pe=n.invoke_dii;var he=n.invoke_i;var be=n.invoke_viiid;var me=n.invoke_viififi;var ye=n.invoke_viii;var we=n.invoke_v;var ge=n.invoke_viid;var Te=n.invoke_idd;var Me=n.invoke_viiii;var ke=n._emscripten_asm_const_iiiii;var Ae=n._emscripten_asm_const_iiidddddd;var Ee=n._emscripten_asm_const_iiiid;var Se=n.__nbind_reference_external;var Ce=n._emscripten_asm_const_iiiiiiii;var Le=n._removeAccessorPrefix;var Re=n._typeModule;var Pe=n.__nbind_register_pool;var Be=n.__decorate;var Oe=n._llvm_stackrestore;var Ie=n.___cxa_atexit;var Ne=n.__extends;var Ue=n.__nbind_get_value_object;var Fe=n._emscripten_set_main_loop_timing;var xe=n.__nbind_register_primitive;var De=n.__nbind_register_type;var He=n._emscripten_memcpy_big;var We=n.__nbind_register_function;var Ye=n.___setErrNo;var Ve=n.__nbind_register_class;var ze=n.__nbind_finish;var je=n._abort;var qe=n._nbind_value;var Ge=n._llvm_stacksave;var Xe=n.___syscall54;var Ke=n._defineHidden;var Je=n._emscripten_set_main_loop;var Ze=n._emscripten_get_now;var Qe=n.__nbind_register_callback_signature;var $e=n._emscripten_asm_const_iiiiii;var en=n.__nbind_free_external;var nn=n._emscripten_asm_const_iiii;var rn=n._emscripten_asm_const_iiididi;var tn=n.___syscall6;var un=n._atexit;var on=n.___syscall140;var an=n.___syscall146;var fn=X(0);var cn=X(0);function ln(e){e=e|0;var n=0;n=v;v=v+e|0;v=v+15&-16;return n|0}function sn(){return v|0}function dn(e){e=e|0;v=e}function _n(e,n){e=e|0;n=n|0;v=e;p=n}function vn(e,n){e=e|0;n=n|0;if(!m){m=e;y=n}}function pn(e){e=e|0;L=e}function hn(){return L|0}function bn(e){e=e|0;var n=0,r=0,t=0,i=0;i=v;v=v+16|0;t=i+8|0;r=i;n=gS[u[2]&31](12)|0;if(!n){u[r>>2]=2464;An(0,2573,r);je()}u[n>>2]=e;u[n+4>>2]=0;r=gS[u[2]&31](e<<2)|0;u[n+8>>2]=r;if(!r){u[t>>2]=2499;An(0,2573,t);je()}else{v=i;return n|0}return 0}function mn(e){e=e|0;if(!e)return;yS[u[4]&127](u[e+8>>2]|0);yS[u[4]&127](e);return}function yn(e){e=e|0;if(!e)e=0;else e=u[e+4>>2]|0;return e|0}function wn(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0;l=v;v=v+16|0;f=l;o=u[e>>2]|0;if(!o){o=bn(4)|0;u[e>>2]=o}a=o+4|0;e=u[a>>2]|0;do{if((e|0)==(u[o>>2]|0)){u[o>>2]=e<<1;o=o+8|0;e=CS[u[3]&15](u[o>>2]|0,e<<3)|0;u[o>>2]=e;if(!e){u[f>>2]=2535;An(0,2573,f);je()}else{c=o;i=u[a>>2]|0;t=e;break}}else{t=o+8|0;c=t;i=e;t=u[t>>2]|0}}while(0);if(i>>>0<=r>>>0){c=t;f=i;f=f+1|0;u[a>>2]=f;r=c+(r<<2)|0;u[r>>2]=n;v=l;return}do{f=i;i=i+-1|0;u[t+(f<<2)>>2]=u[t+(i<<2)>>2];t=u[c>>2]|0}while(i>>>0>r>>>0);c=t;f=u[a>>2]|0;f=f+1|0;u[a>>2]=f;r=c+(r<<2)|0;u[r>>2]=n;v=l;return}function gn(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0;r=e+8|0;t=(u[r>>2]|0)+(n<<2)|0;i=u[t>>2]|0;u[t>>2]=0;t=e+4|0;e=(u[t>>2]|0)+-1|0;if(e>>>0<=n>>>0){r=e;u[t>>2]=r;return i|0}do{o=u[r>>2]|0;e=n;n=n+1|0;u[o+(e<<2)>>2]=u[o+(n<<2)>>2];u[(u[r>>2]|0)+(n<<2)>>2]=0;e=(u[t>>2]|0)+-1|0}while(n>>>0<e>>>0);u[t>>2]=e;return i|0}function Tn(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0;t=u[e+4>>2]|0;if(!t){o=0;return o|0}i=u[e+8>>2]|0;r=0;while(1){if((u[i+(r<<2)>>2]|0)==(n|0))break;r=r+1|0;if(r>>>0>=t>>>0){r=0;o=6;break}}if((o|0)==6)return r|0;o=gn(e,r)|0;return o|0}function Mn(e,n){e=e|0;n=n|0;if(!(yn(e)|0)){n=0;return n|0}n=u[(u[e+8>>2]|0)+(n<<2)>>2]|0;return n|0}function kn(){var e=0,n=0,r=0;r=v;v=v+16|0;n=r;e=gS[u[2]&31](980)|0;if(!e){u[n>>2]=2576;An(0,2573,n);je()}else{u[2326]=(u[2326]|0)+1;pE(e|0,20,980)|0;v=r;return e|0}return 0}function An(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0;t=v;v=v+16|0;i=t;u[i>>2]=r;kS[u[252]&7](e,n,i)|0;v=t;return}function En(e,n,r){e=e|0;n=n|0;r=r|0;if(!e){r=dA(u[491]|0,n,r)|0;return r|0}else{r=JA(n,r)|0;return r|0}return 0}function Sn(e){e=e|0;var n=0,r=0;n=e+940|0;r=u[n>>2]|0;if(r|0){Tn(u[r+944>>2]|0,e)|0;u[n>>2]=0}r=Cn(e)|0;if(r|0){n=0;do{u[(Ln(e,n)|0)+940>>2]=0;n=n+1|0}while((n|0)!=(r|0))}mn(u[e+944>>2]|0);yS[u[4]&127](e);u[2326]=(u[2326]|0)+-1;return}function Cn(e){e=e|0;return yn(u[e+944>>2]|0)|0}function Ln(e,n){e=e|0;n=n|0;return Mn(u[e+944>>2]|0,n)|0}function Rn(e,n){e=e|0;n=n|0;if(!(Tn(u[e+944>>2]|0,n)|0))return;u[n+940>>2]=0;Pn(e);return}function Pn(e){e=e|0;var n=0;while(1){n=e+968|0;if(t[n>>0]|0){e=4;break}t[n>>0]=1;c[e+504>>2]=X(T);e=u[e+940>>2]|0;if(!e){e=4;break}}if((e|0)==4)return}function Bn(e){e=e|0;var n=0,r=0,t=0;t=v;v=v+16|0;r=t+8|0;n=t;if(Cn(e)|0){u[n>>2]=2611;An(0,2573,n);je()}if(!(u[e+940>>2]|0)){mn(u[e+944>>2]|0);pE(e|0,20,980)|0;v=t;return}else{u[r>>2]=2665;An(0,2573,r);je()}}function On(){return u[2326]|0}function In(e,n){e=e|0;n=n|0;var r=0,t=0,i=0;i=v;v=v+16|0;t=i;if(n){if(!(Cn(e)|0))r=n;else{u[t>>2]=2712;An(0,2573,t);je()}}else r=0;u[e+952>>2]=r;v=i;return}function Nn(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;a=v;v=v+16|0;o=a+8|0;i=a;t=n+940|0;if(u[t>>2]|0){u[i>>2]=2792;An(0,2573,i);je()}if(!(u[e+952>>2]|0)){wn(e+944|0,n,r);u[t>>2]=e;Pn(e);v=a;return}else{u[o>>2]=2846;An(0,2573,o);je()}}function Un(e){e=e|0;return u[e+940>>2]|0}function Fn(e){e=e|0;var n=0,r=0;r=v;v=v+16|0;n=r;if(!(u[e+952>>2]|0)){u[n>>2]=2915;An(0,2573,n);je()}else{Pn(e);v=r;return}}function xn(e){e=e|0;return(t[e+968>>0]|0)!=0|0}function Dn(e,n){e=e|0;n=n|0;if(!(sA(e,n,400)|0))return;pE(e|0,n|0,400)|0;Pn(e);return}function Hn(e){e=e|0;var n=cn;n=X(c[e+44>>2]);if(Wn(n)|0){n=X(c[e+40>>2]);e=n>X(0)&((Wn(n)|0)^1);return X(e?n:X(0))}else return X(n);return cn}function Wn(e){e=X(e);return((Yn(e)|0)&2147483647)>>>0>2139095040|0}function Yn(e){e=X(e);return(c[d>>2]=e,u[d>>2]|0)|0}function Vn(e){e=e|0;var n=cn;n=X(c[e+48>>2]);if(Wn(n)|0){n=X(c[e+40>>2]);e=n<X(0)&((Wn(n)|0)^1);n=X(-n);return X(e?n:X(0))}else return X(n);return cn}function zn(e,n){e=e|0;n=n|0;var r=0,t=0;t=jn(n)|0;r=u[t+4>>2]|0;n=e;u[n>>2]=u[t>>2];u[n+4>>2]=r;return}function jn(e){e=e|0;var n=cn;switch(u[e+56>>2]|0){case 0:case 3:{n=X(c[e+40>>2]);e=n>X(0)&((Wn(n)|0)^1);return(e?1012:1020)|0}default:return e+52|0}return 0}function qn(e,n){e=e|0;n=X(n);var r=0;r=e+40|0;if(!(X(c[r>>2])!=n))return;c[r>>2]=n;Pn(e);return}function Gn(e,n){e=e|0;n=n|0;u[e+964>>2]=n;return}function Xn(e){e=e|0;return u[e+964>>2]|0}function Kn(e,n){e=e|0;n=n|0;t[e+969>>0]=n&1;return}function Jn(e){e=e|0;return(t[e+969>>0]|0)!=0|0}function Zn(e,n){e=e|0;n=n|0;var r=0;r=e+4|0;if((u[r>>2]|0)==(n|0))return;u[r>>2]=n;Pn(e);return}function Qn(e){e=e|0;return u[e+4>>2]|0}function $n(e,n){e=e|0;n=n|0;var r=0;r=e+8|0;if((u[r>>2]|0)==(n|0))return;u[r>>2]=n;Pn(e);return}function er(e){e=e|0;return u[e+8>>2]|0}function nr(e,n){e=e|0;n=n|0;var r=0;r=e+12|0;if((u[r>>2]|0)==(n|0))return;u[r>>2]=n;Pn(e);return}function rr(e){e=e|0;return u[e+12>>2]|0}function tr(e,n){e=e|0;n=n|0;var r=0;r=e+16|0;if((u[r>>2]|0)==(n|0))return;u[r>>2]=n;Pn(e);return}function ir(e){e=e|0;return u[e+16>>2]|0}function ur(e,n){e=e|0;n=n|0;var r=0;r=e+20|0;if((u[r>>2]|0)==(n|0))return;u[r>>2]=n;Pn(e);return}function or(e){e=e|0;return u[e+20>>2]|0}function ar(e,n){e=e|0;n=n|0;var r=0;r=e+24|0;if((u[r>>2]|0)==(n|0))return;u[r>>2]=n;Pn(e);return}function fr(e){e=e|0;return u[e+24>>2]|0}function cr(e,n){e=e|0;n=n|0;var r=0;r=e+28|0;if((u[r>>2]|0)==(n|0))return;u[r>>2]=n;Pn(e);return}function lr(e){e=e|0;return u[e+28>>2]|0}function sr(e,n){e=e|0;n=n|0;var r=0;r=e+32|0;if((u[r>>2]|0)==(n|0))return;u[r>>2]=n;Pn(e);return}function dr(e){e=e|0;return u[e+32>>2]|0}function _r(e,n){e=e|0;n=n|0;var r=0;r=e+36|0;if((u[r>>2]|0)==(n|0))return;u[r>>2]=n;Pn(e);return}function vr(e){e=e|0;return u[e+36>>2]|0}function pr(e,n){e=e|0;n=X(n);var r=0;r=e+44|0;if(!(X(c[r>>2])!=n))return;c[r>>2]=n;Pn(e);return}function hr(e,n){e=e|0;n=X(n);var r=0;r=e+48|0;if(!(X(c[r>>2])!=n))return;c[r>>2]=n;Pn(e);return}function br(e,n){e=e|0;n=X(n);var r=0,t=0;t=e+52|0;r=e+56|0;if(!(X(c[t>>2])!=n)?(u[r>>2]|0)==1:0)return;c[t>>2]=n;t=Wn(n)|0;u[r>>2]=t?3:1;Pn(e);return}function mr(e,n){e=e|0;n=X(n);var r=0,t=0;t=e+52|0;r=e+56|0;if(!(X(c[t>>2])!=n)?(u[r>>2]|0)==2:0)return;c[t>>2]=n;t=Wn(n)|0;u[r>>2]=t?3:2;Pn(e);return}function yr(e,n,r){e=e|0;n=n|0;r=X(r);var t=0;t=e+132+(n<<3)|0;n=e+132+(n<<3)+4|0;if(!(X(c[t>>2])!=r)?(u[n>>2]|0)==1:0)return;c[t>>2]=r;u[n>>2]=((Wn(r)|0)^1)&1;Pn(e);return}function wr(e,n,r){e=e|0;n=n|0;r=X(r);var t=0;t=e+132+(n<<3)|0;n=e+132+(n<<3)+4|0;if(!(X(c[t>>2])!=r)?(u[n>>2]|0)==2:0)return;c[t>>2]=r;t=Wn(r)|0;u[n>>2]=t?0:2;Pn(e);return}function gr(e,n,r){e=e|0;n=n|0;r=r|0;var t=0;t=n+132+(r<<3)|0;n=u[t+4>>2]|0;r=e;u[r>>2]=u[t>>2];u[r+4>>2]=n;return}function Tr(e,n,r){e=e|0;n=n|0;r=X(r);var t=0;t=e+60+(n<<3)|0;n=e+60+(n<<3)+4|0;if(!(X(c[t>>2])!=r)?(u[n>>2]|0)==1:0)return;c[t>>2]=r;u[n>>2]=((Wn(r)|0)^1)&1;Pn(e);return}function Mr(e,n,r){e=e|0;n=n|0;r=X(r);var t=0;t=e+60+(n<<3)|0;n=e+60+(n<<3)+4|0;if(!(X(c[t>>2])!=r)?(u[n>>2]|0)==2:0)return;c[t>>2]=r;t=Wn(r)|0;u[n>>2]=t?0:2;Pn(e);return}function kr(e,n,r){e=e|0;n=n|0;r=r|0;var t=0;t=n+60+(r<<3)|0;n=u[t+4>>2]|0;r=e;u[r>>2]=u[t>>2];u[r+4>>2]=n;return}function Ar(e,n){e=e|0;n=n|0;var r=0;r=e+60+(n<<3)+4|0;if((u[r>>2]|0)==3)return;c[e+60+(n<<3)>>2]=X(T);u[r>>2]=3;Pn(e);return}function Er(e,n,r){e=e|0;n=n|0;r=X(r);var t=0;t=e+204+(n<<3)|0;n=e+204+(n<<3)+4|0;if(!(X(c[t>>2])!=r)?(u[n>>2]|0)==1:0)return;c[t>>2]=r;u[n>>2]=((Wn(r)|0)^1)&1;Pn(e);return}function Sr(e,n,r){e=e|0;n=n|0;r=X(r);var t=0;t=e+204+(n<<3)|0;n=e+204+(n<<3)+4|0;if(!(X(c[t>>2])!=r)?(u[n>>2]|0)==2:0)return;c[t>>2]=r;t=Wn(r)|0;u[n>>2]=t?0:2;Pn(e);return}function Cr(e,n,r){e=e|0;n=n|0;r=r|0;var t=0;t=n+204+(r<<3)|0;n=u[t+4>>2]|0;r=e;u[r>>2]=u[t>>2];u[r+4>>2]=n;return}function Lr(e,n,r){e=e|0;n=n|0;r=X(r);var t=0;t=e+276+(n<<3)|0;n=e+276+(n<<3)+4|0;if(!(X(c[t>>2])!=r)?(u[n>>2]|0)==1:0)return;c[t>>2]=r;u[n>>2]=((Wn(r)|0)^1)&1;Pn(e);return}function Rr(e,n){e=e|0;n=n|0;return X(c[e+276+(n<<3)>>2])}function Pr(e,n){e=e|0;n=X(n);var r=0,t=0;t=e+348|0;r=e+352|0;if(!(X(c[t>>2])!=n)?(u[r>>2]|0)==1:0)return;c[t>>2]=n;t=Wn(n)|0;u[r>>2]=t?3:1;Pn(e);return}function Br(e,n){e=e|0;n=X(n);var r=0,t=0;t=e+348|0;r=e+352|0;if(!(X(c[t>>2])!=n)?(u[r>>2]|0)==2:0)return;c[t>>2]=n;t=Wn(n)|0;u[r>>2]=t?3:2;Pn(e);return}function Or(e){e=e|0;var n=0;n=e+352|0;if((u[n>>2]|0)==3)return;c[e+348>>2]=X(T);u[n>>2]=3;Pn(e);return}function Ir(e,n){e=e|0;n=n|0;var r=0,t=0;t=n+348|0;r=u[t+4>>2]|0;n=e;u[n>>2]=u[t>>2];u[n+4>>2]=r;return}function Nr(e,n){e=e|0;n=X(n);var r=0,t=0;t=e+356|0;r=e+360|0;if(!(X(c[t>>2])!=n)?(u[r>>2]|0)==1:0)return;c[t>>2]=n;t=Wn(n)|0;u[r>>2]=t?3:1;Pn(e);return}function Ur(e,n){e=e|0;n=X(n);var r=0,t=0;t=e+356|0;r=e+360|0;if(!(X(c[t>>2])!=n)?(u[r>>2]|0)==2:0)return;c[t>>2]=n;t=Wn(n)|0;u[r>>2]=t?3:2;Pn(e);return}function Fr(e){e=e|0;var n=0;n=e+360|0;if((u[n>>2]|0)==3)return;c[e+356>>2]=X(T);u[n>>2]=3;Pn(e);return}function xr(e,n){e=e|0;n=n|0;var r=0,t=0;t=n+356|0;r=u[t+4>>2]|0;n=e;u[n>>2]=u[t>>2];u[n+4>>2]=r;return}function Dr(e,n){e=e|0;n=X(n);var r=0,t=0;t=e+364|0;r=e+368|0;if(!(X(c[t>>2])!=n)?(u[r>>2]|0)==1:0)return;c[t>>2]=n;t=Wn(n)|0;u[r>>2]=t?3:1;Pn(e);return}function Hr(e,n){e=e|0;n=X(n);var r=0,t=0;t=e+364|0;r=e+368|0;if(!(X(c[t>>2])!=n)?(u[r>>2]|0)==2:0)return;c[t>>2]=n;t=Wn(n)|0;u[r>>2]=t?3:2;Pn(e);return}function Wr(e,n){e=e|0;n=n|0;var r=0,t=0;t=n+364|0;r=u[t+4>>2]|0;n=e;u[n>>2]=u[t>>2];u[n+4>>2]=r;return}function Yr(e,n){e=e|0;n=X(n);var r=0,t=0;t=e+372|0;r=e+376|0;if(!(X(c[t>>2])!=n)?(u[r>>2]|0)==1:0)return;c[t>>2]=n;t=Wn(n)|0;u[r>>2]=t?3:1;Pn(e);return}function Vr(e,n){e=e|0;n=X(n);var r=0,t=0;t=e+372|0;r=e+376|0;if(!(X(c[t>>2])!=n)?(u[r>>2]|0)==2:0)return;c[t>>2]=n;t=Wn(n)|0;u[r>>2]=t?3:2;Pn(e);return}function zr(e,n){e=e|0;n=n|0;var r=0,t=0;t=n+372|0;r=u[t+4>>2]|0;n=e;u[n>>2]=u[t>>2];u[n+4>>2]=r;return}function jr(e,n){e=e|0;n=X(n);var r=0,t=0;t=e+380|0;r=e+384|0;if(!(X(c[t>>2])!=n)?(u[r>>2]|0)==1:0)return;c[t>>2]=n;t=Wn(n)|0;u[r>>2]=t?3:1;Pn(e);return}function qr(e,n){e=e|0;n=X(n);var r=0,t=0;t=e+380|0;r=e+384|0;if(!(X(c[t>>2])!=n)?(u[r>>2]|0)==2:0)return;c[t>>2]=n;t=Wn(n)|0;u[r>>2]=t?3:2;Pn(e);return}function Gr(e,n){e=e|0;n=n|0;var r=0,t=0;t=n+380|0;r=u[t+4>>2]|0;n=e;u[n>>2]=u[t>>2];u[n+4>>2]=r;return}function Xr(e,n){e=e|0;n=X(n);var r=0,t=0;t=e+388|0;r=e+392|0;if(!(X(c[t>>2])!=n)?(u[r>>2]|0)==1:0)return;c[t>>2]=n;t=Wn(n)|0;u[r>>2]=t?3:1;Pn(e);return}function Kr(e,n){e=e|0;n=X(n);var r=0,t=0;t=e+388|0;r=e+392|0;if(!(X(c[t>>2])!=n)?(u[r>>2]|0)==2:0)return;c[t>>2]=n;t=Wn(n)|0;u[r>>2]=t?3:2;Pn(e);return}function Jr(e,n){e=e|0;n=n|0;var r=0,t=0;t=n+388|0;r=u[t+4>>2]|0;n=e;u[n>>2]=u[t>>2];u[n+4>>2]=r;return}function Zr(e,n){e=e|0;n=X(n);var r=0;r=e+396|0;if(!(X(c[r>>2])!=n))return;c[r>>2]=n;Pn(e);return}function Qr(e){e=e|0;return X(c[e+396>>2])}function $r(e){e=e|0;return X(c[e+400>>2])}function et(e){e=e|0;return X(c[e+404>>2])}function nt(e){e=e|0;return X(c[e+408>>2])}function rt(e){e=e|0;return X(c[e+412>>2])}function tt(e){e=e|0;return X(c[e+416>>2])}function it(e){e=e|0;return X(c[e+420>>2])}function ut(e,n){e=e|0;n=n|0;var r=0,t=0,i=cn;t=v;v=v+16|0;r=t;if(n>>>0>=6){u[r>>2]=3001;An(0,2573,r);je()}switch(n|0){case 0:{n=(u[e+496>>2]|0)==2?5:4;break}case 2:{n=(u[e+496>>2]|0)==2?4:5;break}default:{}}i=X(c[e+424+(n<<2)>>2]);v=t;return X(i)}function ot(e,n){e=e|0;n=n|0;var r=0,t=0,i=cn;t=v;v=v+16|0;r=t;if(n>>>0>=6){u[r>>2]=3001;An(0,2573,r);je()}switch(n|0){case 0:{n=(u[e+496>>2]|0)==2?5:4;break}case 2:{n=(u[e+496>>2]|0)==2?4:5;break}default:{}}i=X(c[e+448+(n<<2)>>2]);v=t;return X(i)}function at(e,n){e=e|0;n=n|0;var r=0,t=0,i=cn;t=v;v=v+16|0;r=t;if(n>>>0>=6){u[r>>2]=3001;An(0,2573,r);je()}switch(n|0){case 0:{n=(u[e+496>>2]|0)==2?5:4;break}case 2:{n=(u[e+496>>2]|0)==2?4:5;break}default:{}}i=X(c[e+472+(n<<2)>>2]);v=t;return X(i)}function ft(e,n){e=e|0;n=n|0;ct(e,n,0);return}function ct(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,s=0,d=0,_=0,p=0,h=0,b=0,m=0,y=0,w=0,g=0,T=0,M=0,k=0,A=0,E=0,S=0,C=0,L=0,R=0,P=0,B=0,O=0,I=0,N=0,U=0,F=0,x=0,D=0,H=0,W=0,Y=0;U=v;v=v+400|0;I=U+392|0;N=U+384|0;O=U+376|0;B=U+368|0;P=U+360|0;L=U+352|0;C=U+344|0;S=U+336|0;E=U+328|0;A=U+320|0;k=U+312|0;M=U+304|0;T=U+296|0;g=U+288|0;w=U+280|0;y=U+272|0;m=U+264|0;b=U+256|0;h=U+248|0;p=U+240|0;d=U+232|0;s=U+144|0;a=U+96|0;o=U+48|0;i=U+40|0;R=U+32|0;_=U+24|0;f=U+16|0;lt(r);An(3,3055,U);t=u[e+960>>2]|0;if(t|0)yS[t&127](e);if(n&1|0){An(3,3057,U+8|0);l[f>>3]=+X(c[e+416>>2]);An(3,3067,f);l[_>>3]=+X(c[e+420>>2]);An(3,3079,_);l[R>>3]=+X(c[e+404>>2]);An(3,3092,R);l[i>>3]=+X(c[e+400>>2]);An(3,3102,i);Y=+X(c[e+424>>2]);W=+X(c[e+428>>2]);H=+X(c[e+432>>2]);D=+X(c[e+436>>2]);x=+X(c[e+440>>2]);F=+X(c[e+444>>2]);l[o>>3]=Y;l[o+8>>3]=W;l[o+16>>3]=H;l[o+24>>3]=D;l[o+32>>3]=x;l[o+40>>3]=F;An(3,3111,o);F=+X(c[e+448>>2]);x=+X(c[e+452>>2]);D=+X(c[e+456>>2]);H=+X(c[e+460>>2]);W=+X(c[e+464>>2]);Y=+X(c[e+468>>2]);l[a>>3]=F;l[a+8>>3]=x;l[a+16>>3]=D;l[a+24>>3]=H;l[a+32>>3]=W;l[a+40>>3]=Y;An(3,3157,a);Y=+X(c[e+472>>2]);W=+X(c[e+476>>2]);H=+X(c[e+480>>2]);D=+X(c[e+484>>2]);x=+X(c[e+488>>2]);F=+X(c[e+492>>2]);l[s>>3]=Y;l[s+8>>3]=W;l[s+16>>3]=H;l[s+24>>3]=D;l[s+32>>3]=x;l[s+40>>3]=F;An(3,3203,s);An(3,3250,U+192|0)}if(n&2|0){switch(u[e+4>>2]|0){case 0:{An(3,3254,U+200|0);break}case 1:{An(3,3280,U+208|0);break}case 2:{An(3,3314,U+216|0);break}case 3:{An(3,3337,U+224|0);break}default:{}}switch(u[e+8>>2]|0){case 1:{An(3,3368,d);break}case 2:{An(3,3395,p);break}case 4:{An(3,3424,h);break}case 3:{An(3,3457,b);break}default:{}}switch(u[e+16>>2]|0){case 2:{An(3,3491,m);break}case 3:{An(3,3514,y);break}case 4:{An(3,3539,w);break}default:{}}switch(u[e+12>>2]|0){case 2:{An(3,3563,g);break}case 3:{An(3,3588,T);break}case 4:{An(3,3615,M);break}default:{}}switch(u[e+20>>2]|0){case 1:{An(3,3641,k);break}case 2:{An(3,3667,A);break}case 3:{An(3,3689,E);break}case 4:{An(3,3713,S);break}default:{}}st(3736,X(Hn(e)));st(3745,X(Vn(e)));dt(3756,jn(e)|0);switch(u[e+32>>2]|0){case 1:{An(3,3766,C);break}case 0:{An(3,3787,L);break}case 2:{An(3,3809,P);break}default:{}}t=e+60|0;P=_t(t)|0;i=vt(t,0,1012)|0;if(P)pt(3830,i);else{pt(3837,i);pt(3848,vt(t,2,1012)|0);pt(3860,vt(t,1,1012)|0);pt(3870,vt(t,3,1012)|0);pt(3883,vt(t,4,1012)|0);pt(3895,vt(t,5,1012)|0)}i=e+204|0;P=_t(i)|0;t=vt(i,0,1012)|0;if(P)pt(3905,t);else{pt(3913,t);pt(3925,vt(i,2,1012)|0);pt(3938,vt(i,1,1012)|0);pt(3949,vt(i,3,1012)|0);pt(3963,vt(i,4,1012)|0);pt(3976,vt(i,5,1012)|0)}t=e+276|0;P=_t(t)|0;i=vt(t,0,1012)|0;if(P)pt(3987,i);else{pt(3999,i);pt(4015,vt(t,2,1012)|0);pt(4032,vt(t,1,1012)|0);pt(4047,vt(t,3,1012)|0);pt(4065,vt(t,4,1012)|0);pt(4082,vt(t,5,1012)|0)}dt(4097,e+348|0);dt(4103,e+356|0);dt(4110,e+380|0);dt(4119,e+388|0);dt(4129,e+364|0);dt(4138,e+372|0);if((u[e+24>>2]|0)==1)An(3,4148,B);B=e+132|0;dt(4171,vt(B,0,1e3)|0);dt(4176,vt(B,2,1e3)|0);dt(4182,vt(B,1,1e3)|0);dt(4186,vt(B,3,1e3)|0)}o=yn(u[e+944>>2]|0)|0;if(!((n&4|0)!=0&(o|0)!=0)){An(3,4211,I);v=U;return}An(3,4193,O);i=r+1|0;t=0;do{ct(Ln(e,t)|0,n,i);t=t+1|0}while((t|0)!=(o|0));lt(r);An(3,4206,N);v=U;return}function lt(e){e=e|0;var n=0,r=0,t=0;t=v;v=v+16|0;r=t;if(!e){v=t;return}else n=0;do{An(3,4291,r);n=n+1|0}while((n|0)!=(e|0));v=t;return}function st(e,n){e=e|0;n=X(n);var r=0,t=0;t=v;v=v+16|0;r=t;if(Wn(n)|0){v=t;return}u[r>>2]=e;l[r+8>>3]=+n;An(3,4282,r);v=t;return}function dt(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0;i=v;v=v+32|0;t=i;r=u[n+4>>2]|0;if(!r){v=i;return}o=+X(c[n>>2]);u[t>>2]=e;l[t+8>>3]=o;u[t+16>>2]=(r|0)==1?4215:4218;An(3,4220,t);v=i;return}function _t(e){e=e|0;var n=0,r=0,t=0,i=0;t=v;v=v+16|0;r=t+8|0;n=t;i=e+8|0;u[n>>2]=u[e>>2];u[n+4>>2]=u[e+4>>2];u[r>>2]=u[i>>2];u[r+4>>2]=u[i+4>>2];if(!(bt(n,r)|0)){i=0;v=t;return i|0}i=e+16|0;u[n>>2]=u[e>>2];u[n+4>>2]=u[e+4>>2];u[r>>2]=u[i>>2];u[r+4>>2]=u[i+4>>2];if(!(bt(n,r)|0)){i=0;v=t;return i|0}i=e+24|0;u[n>>2]=u[e>>2];u[n+4>>2]=u[e+4>>2];u[r>>2]=u[i>>2];u[r+4>>2]=u[i+4>>2];i=bt(n,r)|0;v=t;return i|0}function vt(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0;i=v;v=v+16|0;t=i;if(n>>>0>=6){u[t>>2]=4231;An(0,2573,t);je()}if(u[e+(n<<3)+4>>2]|0){t=e+(n<<3)|0;v=i;return t|0}if((n|2|0)==3?u[e+60>>2]|0:0){t=e+56|0;v=i;return t|0}switch(n|0){case 0:case 2:case 4:case 5:{if(u[e+52>>2]|0){t=e+48|0;v=i;return t|0}break}default:{}}if(!(u[e+68>>2]|0)){t=(n|1|0)==5?1e3:r;v=i;return t|0}else{t=e+64|0;v=i;return t|0}return 0}function pt(e,n){e=e|0;n=n|0;var r=cn,t=0,i=0;i=v;v=v+32|0;t=i;r=X(c[n>>2]);if(ht(r,X(0))|0){v=i;return}n=(u[n+4>>2]|0)==1?4215:4218;u[t>>2]=e;l[t+8>>3]=+r;u[t+16>>2]=n;An(3,4220,t);v=i;return}function ht(e,n){e=X(e);n=X(n);var r=0;if(Wn(e)|0){r=Wn(n)|0;return r|0}else{r=X(P(X(e-n)))<X(999999974e-13);return r|0}return 0}function bt(e,n){e=e|0;n=n|0;var r=0,t=cn;r=u[e+4>>2]|0;if((r|0)!=(u[n+4>>2]|0)){r=0;return r|0}if(!r){r=1;return r|0}t=X(c[e>>2]);r=X(P(X(t-X(c[n>>2]))))<X(999999974e-13);return r|0}function mt(e,n,r,t,i,u,o,a,f,c,l,s){e=e|0;n=X(n);r=r|0;t=X(t);i=i|0;u=X(u);o=o|0;a=X(a);f=X(f);c=X(c);l=X(l);s=X(s);var d=0,_=cn,v=cn,p=0;if(f<X(0)|c<X(0)){o=0;return o|0}if((i|0)==(e|0))d=ht(u,n)|0;else d=0;if((o|0)==(r|0))p=ht(a,t)|0;else p=0;if((!d?(_=X(n-l),!(yt(e,_,f)|0)):0)?!(wt(e,_,i,f)|0):0)d=gt(e,_,i,u,f)|0;else d=1;if((!p?(v=X(t-s),!(yt(r,v,c)|0)):0)?!(wt(r,v,o,c)|0):0)e=gt(r,v,o,a,c)|0;else e=1;o=d&e;return o|0}function yt(e,n,r){e=e|0;n=X(n);r=X(r);if((e|0)==1)e=ht(n,r)|0;else e=0;return e|0}function wt(e,n,r,t){e=e|0;n=X(n);r=r|0;t=X(t);if((e|0)==2&(r|0)==0){if(!(n>=t))e=ht(n,t)|0;else e=1}else e=0;return e|0}function gt(e,n,r,t,i){e=e|0;n=X(n);r=r|0;t=X(t);i=X(i);if(!((e|0)==2&(r|0)==2&t>n)){r=0;return r|0}if(i<=n){r=1;return r|0}r=ht(n,i)|0;return r|0}function Tt(e,n,r,i,o,a,f,s,d,_){e=e|0;n=X(n);r=X(r);i=i|0;o=o|0;a=a|0;f=X(f);s=X(s);d=d|0;_=_|0;var p=0,h=0,b=0,m=0,y=cn,w=cn,g=0,T=0,M=0,k=0,A=0,E=0,S=0,C=0,L=0,R=cn,P=cn,B=cn,O=0,I=0;L=v;v=v+160|0;E=L+120|0;A=L+104|0;M=L+72|0;m=L+56|0;k=L+8|0;T=L;u[2328]=(u[2328]|0)+1;S=e+968|0;if((t[S>>0]|0)!=0?(u[e+508>>2]|0)!=(u[2327]|0):0)g=4;else if((u[e+512>>2]|0)==(i|0))C=0;else g=4;if((g|0)==4){u[e+516>>2]=0;u[e+920>>2]=-1;u[e+924>>2]=-1;c[e+928>>2]=X(-1);c[e+932>>2]=X(-1);C=1}e:do{if(!(u[e+952>>2]|0)){if(d){p=e+912|0;if(!(ht(X(c[p>>2]),n)|0)){g=21;break}if(!(ht(X(c[e+916>>2]),r)|0)){g=21;break}if((u[e+920>>2]|0)!=(o|0)){g=21;break}p=(u[e+924>>2]|0)==(a|0)?p:0;g=22;break}b=u[e+516>>2]|0;if(!b)g=21;else{h=0;while(1){p=e+520+(h*24|0)|0;if(((ht(X(c[p>>2]),n)|0?ht(X(c[e+520+(h*24|0)+4>>2]),r)|0:0)?(u[e+520+(h*24|0)+8>>2]|0)==(o|0):0)?(u[e+520+(h*24|0)+12>>2]|0)==(a|0):0){g=22;break e}h=h+1|0;if(h>>>0>=b>>>0){g=21;break}}}}else{y=X(Mt(e,2,f));w=X(Mt(e,0,f));p=e+912|0;B=X(c[p>>2]);P=X(c[e+916>>2]);R=X(c[e+928>>2]);if(!(mt(o,n,a,r,u[e+920>>2]|0,B,u[e+924>>2]|0,P,R,X(c[e+932>>2]),y,w)|0)){b=u[e+516>>2]|0;if(!b)g=21;else{h=0;while(1){p=e+520+(h*24|0)|0;R=X(c[p>>2]);P=X(c[e+520+(h*24|0)+4>>2]);B=X(c[e+520+(h*24|0)+16>>2]);if(mt(o,n,a,r,u[e+520+(h*24|0)+8>>2]|0,R,u[e+520+(h*24|0)+12>>2]|0,P,B,X(c[e+520+(h*24|0)+20>>2]),y,w)|0){g=22;break e}h=h+1|0;if(h>>>0>=b>>>0){g=21;break}}}}else g=22}}while(0);do{if((g|0)==21){if(!(t[11737]|0)){p=0;g=31}else{p=0;g=28}}else if((g|0)==22){h=(t[11737]|0)!=0;if(!((p|0)!=0&(C^1)))if(h){g=28;break}else{g=31;break}m=p+16|0;u[e+904>>2]=u[m>>2];b=p+20|0;u[e+908>>2]=u[b>>2];if(!((t[11738]|0)==0|h^1)){h=u[2328]|0;u[T>>2]=kt(h)|0;u[T+4>>2]=h;XA(4294,T)|0;h=u[e+960>>2]|0;if(h|0)yS[h&127](e);o=At(o,d)|0;a=At(a,d)|0;I=+X(c[m>>2]);O=+X(c[b>>2]);u[k>>2]=o;u[k+4>>2]=a;l[k+8>>3]=+n;l[k+16>>3]=+r;l[k+24>>3]=I;l[k+32>>3]=O;u[k+40>>2]=_;XA(4311,k)|0}}}while(0);if((g|0)==28){h=u[2328]|0;k=kt(h)|0;u[m>>2]=k;u[m+4>>2]=h;u[m+8>>2]=C?4360:11739;XA(4362,m)|0;h=u[e+960>>2]|0;if(h|0)yS[h&127](e);k=At(o,d)|0;g=At(a,d)|0;u[M>>2]=k;u[M+4>>2]=g;l[M+8>>3]=+n;l[M+16>>3]=+r;u[M+24>>2]=_;XA(4371,M)|0;g=31}if((g|0)==31){Et(e,n,r,i,o,a,f,s,d);if(t[11737]|0){h=u[2328]|0;k=kt(h)|0;u[A>>2]=k;u[A+4>>2]=h;u[A+8>>2]=C?4360:11739;XA(4405,A)|0;h=u[e+960>>2]|0;if(h|0)yS[h&127](e);k=At(o,d)|0;A=At(a,d)|0;O=+X(c[e+904>>2]);I=+X(c[e+908>>2]);u[E>>2]=k;u[E+4>>2]=A;l[E+8>>3]=O;l[E+16>>3]=I;u[E+24>>2]=_;XA(4414,E)|0}u[e+512>>2]=i;if(!p){h=e+516|0;p=u[h>>2]|0;if((p|0)==16){if(t[11737]|0)KA(4446)|0;u[h>>2]=0;p=0}if(d)p=e+912|0;else{u[h>>2]=p+1;p=e+520+(p*24|0)|0}c[p>>2]=n;c[p+4>>2]=r;u[p+8>>2]=o;u[p+12>>2]=a;u[p+16>>2]=u[e+904>>2];u[p+20>>2]=u[e+908>>2];p=0}}if(!d){S=u[2328]|0;S=S+-1|0;u[2328]=S;S=u[2327]|0;d=e+508|0;u[d>>2]=S;d=(p|0)==0;C=C|d;v=L;return C|0}u[e+416>>2]=u[e+904>>2];u[e+420>>2]=u[e+908>>2];t[e+969>>0]=1;t[S>>0]=0;S=u[2328]|0;S=S+-1|0;u[2328]=S;S=u[2327]|0;d=e+508|0;u[d>>2]=S;d=(p|0)==0;C=C|d;v=L;return C|0}function Mt(e,n,r){e=e|0;n=n|0;r=X(r);var t=cn;t=X(Lt(e,n,r));return X(t+X(Rt(e,n,r)))}function kt(e){e=e|0;return(e>>>0>60?4834:4834+(60-e)|0)|0}function At(e,n){e=e|0;n=n|0;var r=0,t=0,i=0;i=v;v=v+32|0;r=i+12|0;t=i;u[r>>2]=u[269];u[r+4>>2]=u[270];u[r+8>>2]=u[271];u[t>>2]=u[272];u[t+4>>2]=u[273];u[t+8>>2]=u[274];if(e>>>0>2){t=11739;v=i;return t|0}t=u[(n?t:r)+(e<<2)>>2]|0;v=i;return t|0}function Et(e,n,r,i,o,a,f,l,s){e=e|0;n=X(n);r=X(r);i=i|0;o=o|0;a=a|0;f=X(f);l=X(l);s=s|0;var _=0,p=0,h=0,b=0,m=cn,y=cn,w=cn,g=cn,T=cn,M=cn,k=cn,A=0,E=0,S=cn,C=0,L=cn,R=cn,P=0,B=0,O=0,I=0,N=0,U=0,F=0,x=0,D=0,H=0,W=0,Y=0,V=0,z=0,j=0,q=0,G=cn,K=0,J=0,Z=cn,Q=cn,$=cn,ee=cn,ne=cn,re=cn,te=0,ie=0,ue=0,oe=0,ae=cn,fe=cn,ce=cn,le=0,se=0,de=cn,_e=cn,ve=cn,pe=cn,he=cn,be=cn,me=cn,ye=cn,we=0,ge=0,Te=0,Me=0,ke=cn,Ae=0,Ee=0,Se=0,Ce=0,Le=0,Re=0,Pe=0,Be=0,Oe=0,Ie=0,Ne=0,Ue=0;
Ie=v;v=v+32|0;p=Ie+8|0;_=Ie;le=Ie+24|0;te=Ie+20|0;ie=Ie+16|0;ue=Ie+12|0;if(!((o|0)==0|(Wn(n)|0)^1)){u[_>>2]=4468;An(0,2573,_);je()}if(!((a|0)==0|(Wn(r)|0)^1)){u[p>>2]=4548;An(0,2573,p);je()}Le=St(e,i)|0;u[e+496>>2]=Le;Be=Ct(2,Le)|0;Oe=Ct(0,Le)|0;c[e+440>>2]=X(Lt(e,Be,f));c[e+444>>2]=X(Rt(e,Be,f));c[e+428>>2]=X(Lt(e,Oe,f));c[e+436>>2]=X(Rt(e,Oe,f));c[e+464>>2]=X(Pt(e,Be));c[e+468>>2]=X(Bt(e,Be));c[e+452>>2]=X(Pt(e,Oe));c[e+460>>2]=X(Bt(e,Oe));c[e+488>>2]=X(Ot(e,Be,f));c[e+492>>2]=X(It(e,Be,f));c[e+476>>2]=X(Ot(e,Oe,f));c[e+484>>2]=X(It(e,Oe,f));if(u[e+952>>2]|0){Nt(e,n,r,o,a,f,l);v=Ie;return}Re=e+944|0;Pe=yn(u[Re>>2]|0)|0;if(!Pe){Ut(e,n,r,o,a,f,l);v=Ie;return}if(!s?Ft(e,n,r,o,a,f,l)|0:0){v=Ie;return}Be=Ct(u[e+4>>2]|0,Le)|0;Oe=xt(Be,Le)|0;Ce=Dt(Be)|0;K=u[e+8>>2]|0;ge=e+28|0;J=(u[ge>>2]|0)!=0;he=Ce?f:l;me=Ce?l:f;Z=X(Ht(e,Be,f));Q=X(Wt(e,Be,f));m=X(Ht(e,Oe,f));be=X(Yt(e,Be,f));ye=X(Yt(e,Oe,f));C=Ce?o:a;we=Ce?a:o;ke=Ce?be:ye;T=Ce?ye:be;pe=X(Mt(e,2,f));g=X(Mt(e,0,f));y=X(X(X(Vt(e+364|0,f))-pe)-ke);w=X(X(X(Vt(e+380|0,f))-pe)-ke);M=X(X(X(Vt(e+372|0,l))-g)-T);k=X(X(X(Vt(e+388|0,l))-g)-T);$=Ce?y:M;ee=Ce?w:k;pe=X(n-pe);n=X(pe-ke);if(Wn(n)|0)ke=n;else ke=X(WA(X(VA(n,w)),y));_e=X(r-g);n=X(_e-T);if(Wn(n)|0)ve=n;else ve=X(WA(X(VA(n,k)),M));y=Ce?ke:ve;de=Ce?ve:ke;e:do{if((C|0)==1){i=0;p=0;while(1){_=Ln(e,p)|0;if(!i){if(X(Hn(_))>X(0)?X(Vn(_))>X(0):0)i=_;else i=0}else if(zt(_)|0){b=0;break e}p=p+1|0;if(p>>>0>=Pe>>>0){b=i;break}}}else b=0}while(0);A=b+500|0;E=b+504|0;i=0;_=0;n=X(0);h=0;do{p=Mn(u[Re>>2]|0,h)|0;if((u[p+36>>2]|0)==1){jt(p);t[p+969>>0]=1;t[p+968>>0]=0}else{qt(p);if(s)Gt(p,St(p,Le)|0,y,de,ke);do{if((u[p+24>>2]|0)!=1){if((p|0)==(b|0)){u[A>>2]=u[2327];c[E>>2]=X(0);break}else{Xt(e,p,ke,o,ve,ke,ve,a,Le);break}}else{if(_|0)u[_+948>>2]=p;u[p+948>>2]=0;_=p;i=(i|0)==0?p:i}}while(0);n=X(n+X(c[p+504>>2]))}h=h+1|0}while((h|0)!=(Pe|0));B=n>y;se=J&((C|0)==2&B)?1:C;P=(we|0)==1;I=P&(s^1);N=(se|0)==2;U=1028+(Be<<2)|0;F=(we|2|0)==2;x=(we|0)==2;q=P&(J^1);D=1044+(Oe<<2)|0;H=1044+(Oe<<2)|0;W=1060+(Oe<<2)|0;Y=1028+(Oe<<2)|0;V=1044+(Be<<2)|0;z=1044+(Be<<2)|0;j=1060+(Be<<2)|0;B=J&((C|0)!=0&B);P=P^1;T=y;b=0;O=0;re=X(0);ne=X(0);while(1){e:do{if(b>>>0<Pe>>>0){h=0;g=X(0);y=X(0);n=X(0);E=0;p=0;a=b;while(1){A=Mn(u[Re>>2]|0,a)|0;if((u[A+36>>2]|0)!=1?(u[A+936>>2]=O,(u[A+24>>2]|0)!=1):0){w=X(Vt(A+364+(u[U>>2]<<3)|0,he));_=A+504|0;w=X(WA(w,X(c[_>>2])));w=X(g+X(w+X(Mt(A,Be,ke))));if(J&(h|0)!=0&w>T){C=h;w=g;L=y;_=E;break e}if(zt(A)|0){y=X(y+X(Hn(A)));G=X(Vn(A));n=X(n-X(G*X(c[_>>2])))}if(p|0)u[p+948>>2]=A;u[A+948>>2]=0;h=h+1|0;p=A;_=(E|0)==0?A:E}else{w=g;_=E}A=a+1|0;if(A>>>0<Pe>>>0){g=w;E=_;a=A}else{C=h;L=y;a=A;break}}}else{C=0;w=X(0);L=X(0);n=X(0);_=0;a=b}}while(0);if(Wn(T)|0){if(w<$&((Wn($)|0)^1))G=$;else{E=w>ee&((Wn(ee)|0)^1);G=E?ee:T}}else G=T;if(Wn(G)|0){if(w<X(0))R=X(-w);else R=X(0)}else R=X(G-w);if(!I?(oe=(_|0)==0,!oe):0){h=R<X(0);r=X(R/n);A=R>X(0);S=X(R/L);M=X(0);k=X(0);y=X(0);p=_;while(1){g=X(c[p+504>>2]);do{if(h){T=X(g*X(Vn(p)));if(T!=X(-0)?(w=X(g-X(r*T)),ae=X(Kt(p,Be,w,G,ke)),w!=ae):0){w=X(M-X(ae-g));y=X(y+T)}else w=M}else if(A?(fe=X(Hn(p)),fe!=X(0)):0){T=X(g+X(S*fe));w=X(Kt(p,Be,T,G,ke));if(!(T!=w)){w=M;break}w=X(M-X(w-g));k=X(k-fe)}else w=M}while(0);p=u[p+948>>2]|0;if(!p)break;else M=w}n=X(n+y);y=X(R+w);if(!oe){A=y<X(0);E=n==X(0);r=X(y/n);h=y>X(0);M=X(y/X(L+k));n=X(0);p=_;do{w=X(c[p+504>>2]);do{if(A){L=X(w*X(Vn(p)));y=X(-L);if(L!=X(-0)){L=X(r*y);y=X(Kt(p,Be,X(w+(E?y:L)),G,ke))}else y=w}else if(h){y=X(Hn(p));if(!(y!=X(0))){y=w;break}y=X(Kt(p,Be,X(w+X(M*y)),G,ke))}else y=w}while(0);n=X(n-X(y-w));g=X(Mt(p,Be,ke));T=X(Mt(p,Oe,ke));w=X(y+g);c[te>>2]=w;u[ue>>2]=1;_=Wn(de)|0;do{if(_)Se=78;else{if(B|(Jt(p,Oe,de)|0|P)){Se=78;break}if((Zt(e,p)|0)!=4){Se=78;break}c[le>>2]=de;u[ie>>2]=1}}while(0);do{if((Se|0)==78){Se=0;if(Jt(p,Oe,de)|0){L=X(T+X(Vt(u[p+972+(u[Y>>2]<<2)>>2]|0,de)));c[le>>2]=L;u[ie>>2]=((Wn(L)|0)^1)&1;break}else{c[le>>2]=de;u[ie>>2]=_?0:2;break}}}while(0);_=p+396|0;y=X(c[_>>2]);if(!(Wn(y)|0)){S=X(w-g);L=X(S/y);y=X(y*S);y=X(WA(Ce?L:y,X(Yt(p,Oe,ke))));c[le>>2]=y;u[ie>>2]=1;if(zt(p)|0){y=X(VA(X(y-T),de));c[le>>2]=y;w=X(c[_>>2]);if(Ce)w=X(y*w);else w=X(y/w);c[te>>2]=X(g+w)}c[le>>2]=X(T+y)}Qt(X(Vt(p+380+(u[U>>2]<<3)|0,ke)),ue,te);Qt(X(Vt(p+380+(u[Y>>2]<<3)|0,ve)),ie,le);if(Jt(p,Oe,de)|0)_=0;else _=(Zt(e,p)|0)==4;L=X(c[te>>2]);S=X(c[le>>2]);Ne=u[ue>>2]|0;Ue=u[ie>>2]|0;Tt(p,Ce?L:S,Ce?S:L,Le,Ce?Ne:Ue,Ce?Ue:Ne,ke,ve,s&(_^1),4630)|0;p=u[p+948>>2]|0}while((p|0)!=0)}else n=X(0)}else n=X(0);n=X(R+n);if(N&n>X(0)){_=u[U>>2]|0;if((u[e+364+(_<<3)+4>>2]|0)!=0?(ce=X(Vt(e+364+(_<<3)|0,he)),ce>=X(0)):0)y=X(WA(X(0),X(ce-X(G-n))));else y=X(0)}else y=n;E=b>>>0<a>>>0;if(E){h=b;_=0;do{p=Mn(u[Re>>2]|0,h)|0;if(!(u[p+24>>2]|0))_=((u[p+60+(u[z>>2]<<3)+4>>2]|0)==3&1)+_+((u[p+60+(u[j>>2]<<3)+4>>2]|0)==3&1)|0;h=h+1|0}while((h|0)!=(a|0));if(_){g=X(0);T=X(0)}else Se=100}else Se=100;e:do{if((Se|0)==100){Se=0;switch(K|0){case 1:{_=0;g=X(y*X(.5));T=X(0);break e}case 2:{_=0;g=y;T=X(0);break e}case 3:{if(C>>>0<=1){_=0;g=X(0);T=X(0);break e}T=X((C+-1|0)>>>0);_=0;g=X(0);T=X(X(WA(y,X(0)))/T);break e}case 4:{T=X(y/X(C>>>0));_=0;g=X(T*X(.5));break e}default:{_=0;g=X(0);T=X(0);break e}}}}while(0);n=X(Z+g);if(E){w=X(y/X(_|0));A=b;y=X(0);do{h=Mn(u[Re>>2]|0,A)|0;e:do{if((u[h+36>>2]|0)!=1){p=h+24|0;_=u[p>>2]|0;do{if((_|0)==1){if(!($t(h,Be)|0)){_=u[p>>2]|0;break}if(!s)break e;R=X(ei(h,Be,G));R=X(R+X(Pt(e,Be)));R=X(R+X(Lt(h,Be,ke)));c[h+400+(u[V>>2]<<2)>>2]=R;break e}}while(0);if(_|0){if(!s)break;R=X(g+X(Pt(e,Be)));Ue=h+400+(u[V>>2]<<2)|0;c[Ue>>2]=X(R+X(c[Ue>>2]));break}R=X(w+n);n=(u[h+60+(u[z>>2]<<3)+4>>2]|0)==3?R:n;if(s){Ue=h+400+(u[V>>2]<<2)|0;c[Ue>>2]=X(n+X(c[Ue>>2]))}R=X(w+n);n=(u[h+60+(u[j>>2]<<3)+4>>2]|0)==3?R:n;if(I){R=X(T+X(Mt(h,Be,ke)));y=de;n=X(n+X(R+X(c[h+504>>2])));break}else{n=X(n+X(T+X(ni(h,Be,ke))));y=X(WA(y,X(ni(h,Oe,ke))));break}}}while(0);A=A+1|0}while((A|0)!=(a|0))}else y=X(0);T=X(Q+n);if(F){n=X(X(Kt(e,Oe,X(ye+y),me,f))-ye);if(x)n=X(VA(n,de))}else n=de;g=X(X(Kt(e,Oe,X(ye+(q?de:y)),me,f))-ye);if(E&s)do{A=Mn(u[Re>>2]|0,b)|0;do{if((u[A+36>>2]|0)!=1){if((u[A+24>>2]|0)==1){if($t(A,Oe)|0){y=X(ei(A,Oe,de));y=X(y+X(Pt(e,Oe)))}else y=X(Pt(e,Oe));R=X(y+X(Lt(A,Oe,ke)));c[A+400+(u[D>>2]<<2)>>2]=R;break}h=Zt(e,A)|0;_=u[H>>2]|0;do{if((h|0)==4){if((u[A+60+(_<<3)+4>>2]|0)==3){Se=140;break}if((u[A+60+(u[W>>2]<<3)+4>>2]|0)==3){Se=140;break}if(Jt(A,Oe,de)|0){y=m;break}p=u[U>>2]|0;Ne=u[A+904+(p<<2)>>2]|0;u[le>>2]=Ne;_=A+396|0;Ue=Wn(X(c[_>>2]))|0;w=(u[d>>2]=Ne,X(c[d>>2]));if(Ue)y=g;else{L=X(Mt(A,Oe,ke));y=X(c[_>>2]);R=X(w/y);y=X(w*y);y=X(L+(Ce?R:y))}c[te>>2]=y;c[le>>2]=X(X(Mt(A,Be,ke))+w);u[ie>>2]=1;u[ue>>2]=1;Qt(X(Vt(A+380+(p<<3)|0,G)),ie,le);Qt(X(Vt(A+380+(u[Y>>2]<<3)|0,de)),ue,te);y=X(c[le>>2]);L=X(c[te>>2]);R=Ce?y:L;y=Ce?L:y;Ue=((Wn(R)|0)^1)&1;Tt(A,R,y,Le,Ue,((Wn(y)|0)^1)&1,ke,ve,1,4635)|0;y=m}else Se=140}while(0);e:do{if((Se|0)==140){Se=0;y=X(n-X(ni(A,Oe,ke)));_=(u[A+60+(_<<3)+4>>2]|0)==3;p=(u[A+60+(u[W>>2]<<3)+4>>2]|0)==3;if(_&p){y=X(m+X(y*X(.5)));break}if(p){y=m;break}if(_){y=X(m+y);break}switch(h|0){case 1:{y=m;break e}case 2:{y=X(m+X(y*X(.5)));break e}default:{y=X(m+y);break e}}}}while(0);R=X(re+y);Ue=A+400+(u[D>>2]<<2)|0;c[Ue>>2]=X(R+X(c[Ue>>2]))}}while(0);b=b+1|0}while((b|0)!=(a|0));re=X(re+g);ne=X(WA(ne,T));C=O+1|0;if(a>>>0>=Pe>>>0)break;else{T=G;b=a;O=C}}do{if(s){_=C>>>0>1;if((!_?(u[e+12>>2]|0)!=4:0)?!(ri(e)|0):0)break;if(!(Wn(de)|0)){n=X(de-re);e:do{switch(u[e+12>>2]|0){case 3:{m=X(m+n);M=X(0);break}case 2:{m=X(m+X(n*X(.5)));M=X(0);break}case 4:{if(de>re)M=X(n/X(C>>>0));else M=X(0);break}case 7:if(de>re){m=X(m+X(n/X(C<<1>>>0)));M=X(n/X(C>>>0));M=_?M:X(0);break e}else{m=X(m+X(n*X(.5)));M=X(0);break e}case 6:{M=X(n/X(O>>>0));M=de>re&_?M:X(0);break}default:M=X(0)}}while(0);if(C|0){E=1044+(Oe<<2)|0;a=1028+(Oe<<2)|0;A=0;p=0;while(1){e:do{if(p>>>0<Pe>>>0){y=X(0);w=X(0);n=X(0);b=p;while(1){_=Mn(u[Re>>2]|0,b)|0;do{if((u[_+36>>2]|0)!=1?(u[_+24>>2]|0)==0:0){if((u[_+936>>2]|0)!=(A|0))break e;if(ti(_,Oe)|0){ce=X(c[_+904+(u[a>>2]<<2)>>2]);n=X(WA(n,X(ce+X(Mt(_,Oe,ke)))))}if((Zt(e,_)|0)!=5)break;fe=X(ii(_));fe=X(fe+X(Lt(_,0,ke)));ce=X(c[_+908>>2]);ce=X(X(ce+X(Mt(_,0,ke)))-fe);fe=X(WA(w,fe));ce=X(WA(y,ce));y=ce;w=fe;n=X(WA(n,X(fe+ce)))}}while(0);_=b+1|0;if(_>>>0<Pe>>>0)b=_;else{b=_;break}}}else{w=X(0);n=X(0);b=p}}while(0);T=X(M+n);g=m;m=X(m+T);if(p>>>0<b>>>0){w=X(g+w);_=p;do{h=Mn(u[Re>>2]|0,_)|0;e:do{if((u[h+36>>2]|0)!=1){if(u[h+24>>2]|0)break;switch(Zt(e,h)|0){case 1:{ce=X(g+X(Lt(h,Oe,ke)));c[h+400+(u[E>>2]<<2)>>2]=ce;break e}case 3:{ce=X(X(m-X(Rt(h,Oe,ke)))-X(c[h+904+(u[a>>2]<<2)>>2]));c[h+400+(u[E>>2]<<2)>>2]=ce;break e}case 2:{ce=X(g+X(X(T-X(c[h+904+(u[a>>2]<<2)>>2]))*X(.5)));c[h+400+(u[E>>2]<<2)>>2]=ce;break e}case 4:{ce=X(g+X(Lt(h,Oe,ke)));c[h+400+(u[E>>2]<<2)>>2]=ce;if(Jt(h,Oe,de)|0)break e;if(Ce){p=h+904|0;n=X(c[p>>2]);n=X(n+X(Mt(h,Oe,ke)));y=T}else{y=X(c[h+908>>2]);p=h+904|0;n=T;y=X(y+X(Mt(h,Oe,ke)))}if(ht(n,X(c[p>>2]))|0?ht(y,X(c[h+908>>2]))|0:0)break e;Tt(h,n,y,Le,1,1,ke,ve,1,4635)|0;break e}case 5:{c[h+404>>2]=X(X(w-X(ii(h)))+X(ei(h,0,de)));break e}default:break e}}}while(0);_=_+1|0}while((_|0)!=(b|0))}A=A+1|0;if((A|0)==(C|0))break;else p=b}}}}}while(0);c[e+904>>2]=X(Kt(e,2,pe,f,f));c[e+908>>2]=X(Kt(e,0,_e,l,f));if((se|0)!=0?(Te=u[e+32>>2]|0,Me=(se|0)==2,!(Me&(Te|0)!=2)):0){if(Me&(Te|0)==2){n=X(be+G);n=X(WA(X(VA(n,X(ui(e,Be,ne,he)))),be));Se=199}}else{n=X(Kt(e,Be,ne,he,f));Se=199}if((Se|0)==199)c[e+904+(u[1028+(Be<<2)>>2]<<2)>>2]=n;if((we|0)!=0?(Ae=u[e+32>>2]|0,Ee=(we|0)==2,!(Ee&(Ae|0)!=2)):0){if(Ee&(Ae|0)==2){n=X(ye+de);n=X(WA(X(VA(n,X(ui(e,Oe,X(ye+re),me)))),ye));Se=205}}else{n=X(Kt(e,Oe,X(ye+re),me,f));Se=205}if((Se|0)==205)c[e+904+(u[1028+(Oe<<2)>>2]<<2)>>2]=n;if(!s){v=Ie;return}if((u[ge>>2]|0)==2){p=1028+(Oe<<2)|0;h=1044+(Oe<<2)|0;_=0;do{b=Ln(e,_)|0;if(!(u[b+24>>2]|0)){Ne=u[p>>2]|0;f=X(c[e+904+(Ne<<2)>>2]);Ue=b+400+(u[h>>2]<<2)|0;f=X(f-X(c[Ue>>2]));c[Ue>>2]=X(f-X(c[b+904+(Ne<<2)>>2]))}_=_+1|0}while((_|0)!=(Pe|0))}if(i|0){_=Ce?se:o;do{oi(e,i,ke,_,ve,Le);i=u[i+948>>2]|0}while((i|0)!=0)}_=(Be|2|0)==3;p=(Oe|2|0)==3;if(_|p)i=0;else{v=Ie;return}do{h=Mn(u[Re>>2]|0,i)|0;if((u[h+36>>2]|0)!=1){if(_)ai(e,h,Be);if(p)ai(e,h,Oe)}i=i+1|0}while((i|0)!=(Pe|0));v=Ie;return}function St(e,n){e=e|0;n=n|0;e=u[e>>2]|0;return((e|0)==0?n|0?n:1:e)|0}function Ct(e,n){e=e|0;n=n|0;var r=0;e:do{if((n|0)==2){switch(e|0){case 2:{e=3;break e}case 3:break;default:{r=4;break e}}e=2}else r=4}while(0);return e|0}function Lt(e,n,r){e=e|0;n=n|0;r=X(r);if(Dt(n)|0?(u[e+96>>2]|0)!=0:0)e=e+92|0;else e=vt(e+60|0,u[1044+(n<<2)>>2]|0,1012)|0;return X(_i(e,r))}function Rt(e,n,r){e=e|0;n=n|0;r=X(r);if(Dt(n)|0?(u[e+104>>2]|0)!=0:0)e=e+100|0;else e=vt(e+60|0,u[1060+(n<<2)>>2]|0,1012)|0;return X(_i(e,r))}function Pt(e,n){e=e|0;n=n|0;var r=cn;if((Dt(n)|0?u[e+312>>2]|0:0)?(r=X(c[e+308>>2]),r>=X(0)):0)return X(r);r=X(WA(X(c[(vt(e+276|0,u[1044+(n<<2)>>2]|0,1012)|0)>>2]),X(0)));return X(r)}function Bt(e,n){e=e|0;n=n|0;var r=cn;if((Dt(n)|0?u[e+320>>2]|0:0)?(r=X(c[e+316>>2]),r>=X(0)):0)return X(r);r=X(WA(X(c[(vt(e+276|0,u[1060+(n<<2)>>2]|0,1012)|0)>>2]),X(0)));return X(r)}function Ot(e,n,r){e=e|0;n=n|0;r=X(r);var t=cn;if((Dt(n)|0?u[e+240>>2]|0:0)?(t=X(Vt(e+236|0,r)),t>=X(0)):0)return X(t);t=X(WA(X(Vt(vt(e+204|0,u[1044+(n<<2)>>2]|0,1012)|0,r)),X(0)));return X(t)}function It(e,n,r){e=e|0;n=n|0;r=X(r);var t=cn;if((Dt(n)|0?u[e+248>>2]|0:0)?(t=X(Vt(e+244|0,r)),t>=X(0)):0)return X(t);t=X(WA(X(Vt(vt(e+204|0,u[1060+(n<<2)>>2]|0,1012)|0,r)),X(0)));return X(t)}function Nt(e,n,r,t,i,o,a){e=e|0;n=X(n);r=X(r);t=t|0;i=i|0;o=X(o);a=X(a);var f=0,l=cn,s=cn,d=cn,_=cn,p=cn,h=cn,b=0,m=0,y=0;y=v;v=v+16|0;f=y;b=y+8|0;m=e+952|0;if(!(u[m>>2]|0)){u[f>>2]=4724;An(0,2573,f);je()}l=X(Yt(e,2,n));s=X(Yt(e,0,n));d=X(Mt(e,2,n));d=X(n-d);_=X(d-l);p=X(r-X(Mt(e,0,n)));h=X(p-s);if((t|0)==1&(i|0)==1){c[e+904>>2]=X(Kt(e,2,d,o,o));c[e+908>>2]=X(Kt(e,0,p,a,o));v=y;return}if(_<=X(0)|h<=X(0)){c[e+904>>2]=X(Kt(e,2,X(0),n,n));c[e+908>>2]=X(Kt(e,0,X(0),r,n));v=y;return}else{IS[u[m>>2]&1](b,e,_,t,h,i);a=X(l+X(c[b>>2]));c[e+904>>2]=X(Kt(e,2,(t|2|0)==2?a:d,n,n));a=X(s+X(c[b+4>>2]));c[e+908>>2]=X(Kt(e,0,(i|2|0)==2?a:p,r,n));v=y;return}}function Ut(e,n,r,t,i,u,o){e=e|0;n=X(n);r=X(r);t=t|0;i=i|0;u=X(u);o=X(o);var a=cn,f=cn,l=cn,s=cn;l=X(Yt(e,2,u));a=X(Yt(e,0,u));s=X(Mt(e,2,u));f=X(Mt(e,0,u));n=X(n-s);c[e+904>>2]=X(Kt(e,2,(t|2|0)==2?l:n,u,u));r=X(r-f);c[e+908>>2]=X(Kt(e,0,(i|2|0)==2?a:r,o,u));return}function Ft(e,n,r,t,i,u,o){e=e|0;n=X(n);r=X(r);t=t|0;i=i|0;u=X(u);o=X(o);var a=0,f=cn,l=cn;a=(t|0)==2;if((!(n<=X(0)&a)?!(r<=X(0)&(i|0)==2):0)?!((t|0)==1&(i|0)==1):0){a=0;return a|0}f=X(Mt(e,0,u));l=X(Mt(e,2,u));a=n<X(0)&a|(Wn(n)|0);n=X(n-l);c[e+904>>2]=X(Kt(e,2,a?X(0):n,u,u));n=X(r-f);a=r<X(0)&(i|0)==2|(Wn(r)|0);c[e+908>>2]=X(Kt(e,0,a?X(0):n,o,u));a=1;return a|0}function xt(e,n){e=e|0;n=n|0;if(!(li(e)|0)){n=0;return n|0}n=Ct(2,n)|0;return n|0}function Dt(e){e=e|0;return(e|1|0)==3|0}function Ht(e,n,r){e=e|0;n=n|0;r=X(r);r=X(Ot(e,n,r));return X(r+X(Pt(e,n)))}function Wt(e,n,r){e=e|0;n=n|0;r=X(r);r=X(It(e,n,r));return X(r+X(Bt(e,n)))}function Yt(e,n,r){e=e|0;n=n|0;r=X(r);var t=cn;t=X(Ht(e,n,r));return X(t+X(Wt(e,n,r)))}function Vt(e,n){e=e|0;n=X(n);switch(u[e+4>>2]|0){case 2:{n=X(X(X(c[e>>2])*n)/X(100));break}case 1:{n=X(c[e>>2]);break}default:n=X(T)}return X(n)}function zt(e){e=e|0;if(u[e+24>>2]|0){e=0;return e|0}if(X(Hn(e))!=X(0)){e=1;return e|0}e=X(Vn(e))!=X(0);return e|0}function jt(e){e=e|0;var n=0,r=0;dE(e+400|0,0,536)|0;t[e+969>>0]=1;r=Cn(e)|0;if(!r)return;n=e+944|0;e=0;do{jt(Mn(u[n>>2]|0,e)|0);e=e+1|0}while((e|0)!=(r|0));return}function qt(e){e=e|0;var n=0,r=0,t=0,i=0,o=0;i=v;v=v+16|0;t=i+8|0;r=i;n=e+380|0;if(!((u[e+384>>2]|0)!=0?(o=e+364|0,u[r>>2]=u[n>>2],u[r+4>>2]=u[n+4>>2],u[t>>2]=u[o>>2],u[t+4>>2]=u[o+4>>2],bt(r,t)|0):0))n=e+348|0;u[e+972>>2]=n;n=e+388|0;if(u[e+392>>2]|0?(o=e+372|0,u[r>>2]=u[n>>2],u[r+4>>2]=u[n+4>>2],u[t>>2]=u[o>>2],u[t+4>>2]=u[o+4>>2],bt(r,t)|0):0){t=n;o=e+976|0;u[o>>2]=t;v=i;return}t=e+356|0;o=e+976|0;u[o>>2]=t;v=i;return}function Gt(e,n,r,t,i){e=e|0;n=n|0;r=X(r);t=X(t);i=X(i);var o=0,a=cn;o=Ct(u[e+4>>2]|0,n)|0;n=xt(o,n)|0;r=X(di(e,o,r));t=X(di(e,n,t));a=X(r+X(Lt(e,o,i)));c[e+400+(u[1044+(o<<2)>>2]<<2)>>2]=a;r=X(r+X(Rt(e,o,i)));c[e+400+(u[1060+(o<<2)>>2]<<2)>>2]=r;r=X(t+X(Lt(e,n,i)));c[e+400+(u[1044+(n<<2)>>2]<<2)>>2]=r;i=X(t+X(Rt(e,n,i)));c[e+400+(u[1060+(n<<2)>>2]<<2)>>2]=i;return}function Xt(e,n,r,t,i,o,a,f,l){e=e|0;n=n|0;r=X(r);t=t|0;i=X(i);o=X(o);a=X(a);f=f|0;l=l|0;var s=cn,d=0,_=cn,p=0,h=cn,b=0,m=0,y=0,w=0,g=cn,M=cn,k=0,A=0,E=0,S=0,C=0,L=0,R=0;R=v;v=v+16|0;C=R+12|0;k=R+8|0;A=R+4|0;E=R;L=Ct(u[e+4>>2]|0,l)|0;S=Dt(L)|0;s=X(Vt(jn(n)|0,S?o:a));d=Jt(n,2,o)|0;b=Jt(n,0,a)|0;do{if(!(Wn(s)|0)?!(Wn(S?r:i)|0):0){d=n+504|0;if(!(Wn(X(c[d>>2]))|0)){if(!(si(1)|0))break;if((u[n+500>>2]|0)==(u[2327]|0))break}c[d>>2]=X(WA(s,X(Yt(n,L,o))))}else p=7}while(0);do{if((p|0)==7){w=S^1;m=d^1;if(!(w|m)){a=X(Vt(u[n+972>>2]|0,o));c[n+504>>2]=X(WA(a,X(Yt(n,2,o))));break}y=b^1;if(!(S|y)){a=X(Vt(u[n+976>>2]|0,a));c[n+504>>2]=X(WA(a,X(Yt(n,0,o))));break}c[C>>2]=X(T);c[k>>2]=X(T);u[A>>2]=0;u[E>>2]=0;g=X(Mt(n,2,o));M=X(Mt(n,0,o));if(d){h=X(g+X(Vt(u[n+972>>2]|0,o)));c[C>>2]=h;u[A>>2]=1;p=1}else{p=0;h=X(T)}if(b){_=X(M+X(Vt(u[n+976>>2]|0,a)));c[k>>2]=_;u[E>>2]=1;d=1}else{d=0;_=X(T)}b=u[e+32>>2]|0;if(!(S&(b|0)==2)){if(Wn(h)|0?!(Wn(r)|0):0){c[C>>2]=r;u[A>>2]=2;h=r;p=2}}else b=2;if((!((b|0)==2&w)?Wn(_)|0:0)?!(Wn(i)|0):0){c[k>>2]=i;u[E>>2]=2;_=i;d=2}if(S){if((f|0)==1&y&((Wn(i)|0)^1)?(Zt(e,n)|0)==4:0){c[k>>2]=i;u[E>>2]=1;d=1;_=i}}else if((t|0)==1&m&((Wn(r)|0)^1)?(Zt(e,n)|0)==4:0){c[C>>2]=r;u[A>>2]=1;p=1;h=r}s=X(c[n+396>>2]);do{if(!(Wn(s)|0)){if((p|0)==1&w){d=0;s=X(X(h-g)/s)}else{if(!(S&(d|0)==1))break;d=2;s=X(s*X(_-M))}c[n+504>>2]=X(WA(s,X(Yt(n,d,o))));v=R;return}}while(0);Qt(X(Vt(n+380|0,o)),A,C);Qt(X(Vt(n+388|0,a)),E,k);g=X(c[C>>2]);M=X(c[k>>2]);Tt(n,g,M,l,u[A>>2]|0,u[E>>2]|0,o,a,0,4716)|0;a=X(c[n+904+(u[1028+(L<<2)>>2]<<2)>>2]);c[n+504>>2]=X(WA(a,X(Yt(n,L,o))))}}while(0);u[n+500>>2]=u[2327];v=R;return}function Kt(e,n,r,t,i){e=e|0;n=n|0;r=X(r);t=X(t);i=X(i);t=X(ui(e,n,r,t));return X(WA(t,X(Yt(e,n,i))))}function Jt(e,n,r){e=e|0;n=n|0;r=X(r);e=u[e+972+(u[1028+(n<<2)>>2]<<2)>>2]|0;switch(u[e+4>>2]|0){case 1:{if(X(c[e>>2])<X(0)){n=0;return n|0}break}case 2:{if(X(c[e>>2])<X(0)){n=0;return n|0}n=(Wn(r)|0)^1;return n|0}case 0:case 3:{n=0;return n|0}default:{}}n=1;return n|0}function Zt(e,n){e=e|0;n=n|0;n=n+20|0;n=u[((u[n>>2]|0)==0?e+16|0:n)>>2]|0;if((n|0)==5?li(u[e+4>>2]|0)|0:0){e=1;return e|0}e=n;return e|0}function Qt(e,n,r){e=X(e);n=n|0;r=r|0;var t=cn;switch(u[n>>2]|0){case 2:case 1:{n=Wn(e)|0;t=X(c[r>>2]);c[r>>2]=n|t<e?t:e;return}case 0:{if(Wn(e)|0)return;u[n>>2]=2;c[r>>2]=e;return}default:return}}function $t(e,n){e=e|0;n=n|0;e=e+132|0;if(Dt(n)|0?u[(vt(e,4,1e3)|0)+4>>2]|0:0){n=1;return n|0}n=(u[(vt(e,u[1044+(n<<2)>>2]|0,1e3)|0)+4>>2]|0)!=0;return n|0}function ei(e,n,r){e=e|0;n=n|0;r=X(r);var t=0;e=e+132|0;if(!(Dt(n)|0?(t=vt(e,4,1e3)|0,(u[t+4>>2]|0)!=0):0)){t=vt(e,u[1044+(n<<2)>>2]|0,1e3)|0;if(!(u[t+4>>2]|0)){r=X(0);return X(r)}}r=X(Vt(t,r));return X(r)}function ni(e,n,r){e=e|0;n=n|0;r=X(r);var t=cn;t=X(c[e+904+(u[1028+(n<<2)>>2]<<2)>>2]);t=X(t+X(Lt(e,n,r)));return X(t+X(Rt(e,n,r)))}function ri(e){e=e|0;var n=0,r=0,t=0;if(li(u[e+4>>2]|0)|0){r=0;return r|0}if((u[e+16>>2]|0)==5){r=1;return r|0}r=Cn(e)|0;if(!r){r=0;return r|0}else n=0;while(1){t=Ln(e,n)|0;if((u[t+24>>2]|0)==0?(u[t+20>>2]|0)==5:0){n=1;e=7;break}n=n+1|0;if(n>>>0>=r>>>0){n=0;e=7;break}}if((e|0)==7)return n|0;return 0}function ti(e,n){e=e|0;n=n|0;var r=cn;r=X(c[e+904+(u[1028+(n<<2)>>2]<<2)>>2]);return r>=X(0)&((Wn(r)|0)^1)|0}function ii(e){e=e|0;var n=0,r=cn,t=0,i=0,o=0,a=0,f=0,l=cn,s=0;f=v;v=v+16|0;t=f;n=u[e+956>>2]|0;if(n|0){l=X(c[e+904>>2]);r=X(c[e+908>>2]);r=X(mS[n&0](e,l,r));if(Wn(r)|0){u[t>>2]=4666;An(0,2573,t);je()}else{l=r;v=f;return X(l)}}o=Cn(e)|0;if(o|0){t=0;i=0;while(1){n=Ln(e,i)|0;if(u[n+936>>2]|0){n=t;break}if((u[n+24>>2]|0)!=1){s=(Zt(e,n)|0)==5;if(s){a=11;break}else n=(t|0)==0?n:t}else n=t;i=i+1|0;if(i>>>0>=o>>>0)break;else t=n}if((a|0)==11){r=X(ii(n));s=n+404|0;l=X(c[s>>2]);l=X(r+l);v=f;return X(l)}if(n|0){s=n;r=X(ii(s));s=s+404|0;l=X(c[s>>2]);l=X(r+l);v=f;return X(l)}}l=X(c[e+908>>2]);v=f;return X(l)}function ui(e,n,r,t){e=e|0;n=n|0;r=X(r);t=X(t);var i=cn,u=0;if(!(li(n)|0)){if(Dt(n)|0){n=0;u=3}else{t=X(T);i=X(T)}}else{n=1;u=3}if((u|0)==3){i=X(Vt(e+364+(n<<3)|0,t));t=X(Vt(e+380+(n<<3)|0,t))}u=t<r&(t>=X(0)&((Wn(t)|0)^1));r=u?t:r;u=i>=X(0)&((Wn(i)|0)^1)&r<i;return X(u?i:r)}function oi(e,n,r,t,i,o){e=e|0;n=n|0;r=X(r);t=t|0;i=X(i);o=o|0;var a=cn,f=0,l=0,s=cn,d=cn,_=cn,v=0,p=0,h=0,b=0,m=cn,y=cn,w=0;p=Ct(u[e+4>>2]|0,o)|0;h=xt(p,o)|0;v=Dt(p)|0;s=X(Mt(n,2,r));_=X(Mt(n,0,r));if(!(Jt(n,2,r)|0)){if($t(n,2)|0?fi(n,2)|0:0){a=X(c[e+904>>2]);m=X(Pt(e,2));m=X(a-X(m+X(Bt(e,2))));a=X(ei(n,2,r));a=X(Kt(n,2,X(m-X(a+X(ci(n,2,r)))),r,r))}else a=X(T)}else a=X(s+X(Vt(u[n+972>>2]|0,r)));if(!(Jt(n,0,i)|0)){if($t(n,0)|0?fi(n,0)|0:0){m=X(c[e+908>>2]);y=X(Pt(e,0));y=X(m-X(y+X(Bt(e,0))));m=X(ei(n,0,i));i=X(Kt(n,0,X(y-X(m+X(ci(n,0,i)))),i,r))}else i=X(T)}else i=X(_+X(Vt(u[n+976>>2]|0,i)));f=Wn(a)|0;l=Wn(i)|0;do{if(f^l?(d=X(c[n+396>>2]),!(Wn(d)|0)):0){if(f){a=X(X(i-_)*d);a=X(s+X(WA(a,X(Yt(n,0,r)))));break}if(l){i=X(X(a-s)/d);i=X(_+X(WA(i,X(Yt(n,2,r)))))}}}while(0);l=Wn(a)|0;f=Wn(i)|0;if(l|f){w=(l^1)&1;t=r>X(0)&((t|0)!=0&l);a=v?a:t?r:a;Tt(n,a,i,o,v?w:t?2:w,l&(f^1)&1,a,i,0,4643)|0;a=X(c[n+904>>2]);a=X(a+X(Mt(n,2,r)));i=X(c[n+908>>2]);i=X(i+X(Mt(n,0,r)))}Tt(n,a,i,o,1,1,a,i,1,4655)|0;if(fi(n,p)|0?!($t(n,p)|0):0){w=u[1028+(p<<2)>>2]|0;y=X(c[e+904+(w<<2)>>2]);y=X(y-X(c[n+904+(w<<2)>>2]));y=X(y-X(Bt(e,p)));y=X(y-X(ci(n,p,r)));c[n+400+(u[1044+(p<<2)>>2]<<2)>>2]=y}else b=22;do{if((b|0)==22){if(!($t(n,p)|0)?(u[e+8>>2]|0)==1:0){w=u[1028+(p<<2)>>2]|0;y=X(c[e+904+(w<<2)>>2]);y=X(X(y-X(c[n+904+(w<<2)>>2]))*X(.5));c[n+400+(u[1044+(p<<2)>>2]<<2)>>2]=y;break}if(!($t(n,p)|0)?(u[e+8>>2]|0)==2:0){w=u[1028+(p<<2)>>2]|0;y=X(c[e+904+(w<<2)>>2]);y=X(y-X(c[n+904+(w<<2)>>2]));c[n+400+(u[1044+(p<<2)>>2]<<2)>>2]=y}}}while(0);if(fi(n,h)|0?!($t(n,h)|0):0){w=u[1028+(h<<2)>>2]|0;y=X(c[e+904+(w<<2)>>2]);y=X(y-X(c[n+904+(w<<2)>>2]));y=X(y-X(Bt(e,h)));y=X(y-X(ci(n,h,r)));c[n+400+(u[1044+(h<<2)>>2]<<2)>>2]=y;return}if(!($t(n,h)|0)?(Zt(e,n)|0)==2:0){w=u[1028+(h<<2)>>2]|0;y=X(c[e+904+(w<<2)>>2]);y=X(X(y-X(c[n+904+(w<<2)>>2]))*X(.5));c[n+400+(u[1044+(h<<2)>>2]<<2)>>2]=y;return}if($t(n,h)|0)return;if((Zt(e,n)|0)!=3)return;w=u[1028+(h<<2)>>2]|0;y=X(c[e+904+(w<<2)>>2]);y=X(y-X(c[n+904+(w<<2)>>2]));c[n+400+(u[1044+(h<<2)>>2]<<2)>>2]=y;return}function ai(e,n,r){e=e|0;n=n|0;r=r|0;var t=cn,i=0;i=u[1028+(r<<2)>>2]|0;t=X(c[n+904+(i<<2)>>2]);t=X(X(c[e+904+(i<<2)>>2])-t);t=X(t-X(c[n+400+(u[1044+(r<<2)>>2]<<2)>>2]));c[n+400+(u[1060+(r<<2)>>2]<<2)>>2]=t;return}function fi(e,n){e=e|0;n=n|0;e=e+132|0;if(Dt(n)|0?u[(vt(e,5,1e3)|0)+4>>2]|0:0){n=1;return n|0}n=(u[(vt(e,u[1060+(n<<2)>>2]|0,1e3)|0)+4>>2]|0)!=0;return n|0}function ci(e,n,r){e=e|0;n=n|0;r=X(r);var t=0;e=e+132|0;if(!(Dt(n)|0?(t=vt(e,5,1e3)|0,(u[t+4>>2]|0)!=0):0)){t=vt(e,u[1060+(n<<2)>>2]|0,1e3)|0;if(!(u[t+4>>2]|0)){r=X(0);return X(r)}}r=X(Vt(t,r));return X(r)}function li(e){e=e|0;return(e|1|0)==1|0}function si(e){e=e|0;return(t[11740+e>>0]|0)!=0|0}function di(e,n,r){e=e|0;n=n|0;r=X(r);if($t(e,n)|0){r=X(ei(e,n,r));return X(r)}else{r=X(-X(ci(e,n,r)));return X(r)}return cn}function _i(e,n){e=e|0;n=X(n);if((u[e+4>>2]|0)==3){n=X(0);return X(n)}n=X(Vt(e,n));return X(n)}function vi(e,n,r,i){e=e|0;n=X(n);r=X(r);i=i|0;var o=cn,a=cn,f=0,c=0;u[2327]=(u[2327]|0)+1;qt(e);do{if(Wn(n)|0){if(Jt(e,2,n)|0){o=X(Vt(u[e+972>>2]|0,n));c=1;o=X(o+X(Mt(e,2,n)));break}o=X(Vt(e+380|0,n));if(!(o>=X(0))){c=0;o=n}else c=2}else{c=1;o=n}}while(0);do{if(Wn(r)|0){if(Jt(e,0,r)|0){a=X(Vt(u[e+976>>2]|0,r));f=1;a=X(a+X(Mt(e,0,n)));break}a=X(Vt(e+388|0,r));if(!(a>=X(0))){f=0;a=r}else f=2}else{f=1;a=r}}while(0);if(!(Tt(e,o,a,i,c,f,n,r,1,4895)|0))return;Gt(e,u[e+496>>2]|0,n,r,n);if(si(0)|0)pi(e);if(!(t[11736]|0))return;ft(e,7);return}function pi(e){e=e|0;var n=0,r=0,t=cn,i=cn,o=0,a=cn,f=cn,l=cn;n=e+400|0;i=X(c[n>>2]);f=X(i-X(R(X(i))));r=e+404|0;t=X(c[r>>2]);a=X(t-X(R(X(t))));o=e+416|0;l=X(+sE(+X(f+X(c[o>>2]))));c[o>>2]=X(l-X(+sE(+f)));o=e+420|0;f=X(+sE(+X(a+X(c[o>>2]))));c[o>>2]=X(f-X(+sE(+a)));c[n>>2]=X(+sE(+i));c[r>>2]=X(+sE(+t));r=yn(u[e+944>>2]|0)|0;if(!r)return;else n=0;do{pi(Ln(e,n)|0);n=n+1|0}while((n|0)!=(r|0));return}function hi(e,n){e=e|0;n=n|0;t[11740+e>>0]=n&1;return}function bi(){var e=0;e=iE(8)|0;mi(e);return e|0}function mi(e){e=e|0;var n=0;n=kn()|0;u[e>>2]=n;u[e+4>>2]=0;Gn(n,e);return}function yi(e){e=e|0;if(e|0){wi(e);oE(e)}return}function wi(e){e=e|0;var n=0;Sn(u[e>>2]|0);n=e+4|0;e=u[n>>2]|0;u[n>>2]=0;if(e|0){gi(e);oE(e)}return}function gi(e){e=e|0;Ti(e);return}function Ti(e){e=e|0;e=u[e>>2]|0;if(e|0)en(e|0);return}function Mi(e){e=e|0;return Xn(e)|0}function ki(e){e=e|0;var n=0,r=0;r=e+4|0;n=u[r>>2]|0;u[r>>2]=0;if(n|0){gi(n);oE(n)}Bn(u[e>>2]|0);return}function Ai(e,n){e=e|0;n=n|0;Dn(u[e>>2]|0,u[n>>2]|0);return}function Ei(e,n){e=e|0;n=n|0;ar(u[e>>2]|0,n);return}function Si(e,n,r){e=e|0;n=n|0;r=+r;yr(u[e>>2]|0,n,X(r));return}function Ci(e,n,r){e=e|0;n=n|0;r=+r;wr(u[e>>2]|0,n,X(r));return}function Li(e,n){e=e|0;n=n|0;nr(u[e>>2]|0,n);return}function Ri(e,n){e=e|0;n=n|0;tr(u[e>>2]|0,n);return}function Pi(e,n){e=e|0;n=n|0;ur(u[e>>2]|0,n);return}function Bi(e,n){e=e|0;n=n|0;Zn(u[e>>2]|0,n);return}function Oi(e,n){e=e|0;n=n|0;cr(u[e>>2]|0,n);return}function Ii(e,n){e=e|0;n=n|0;$n(u[e>>2]|0,n);return}function Ni(e,n,r){e=e|0;n=n|0;r=+r;Tr(u[e>>2]|0,n,X(r));return}function Ui(e,n,r){e=e|0;n=n|0;r=+r;Mr(u[e>>2]|0,n,X(r));return}function Fi(e,n){e=e|0;n=n|0;Ar(u[e>>2]|0,n);return}function xi(e,n){e=e|0;n=n|0;sr(u[e>>2]|0,n);return}function Di(e,n){e=e|0;n=n|0;_r(u[e>>2]|0,n);return}function Hi(e,n){e=e|0;n=+n;qn(u[e>>2]|0,X(n));return}function Wi(e,n){e=e|0;n=+n;br(u[e>>2]|0,X(n));return}function Yi(e,n){e=e|0;n=+n;mr(u[e>>2]|0,X(n));return}function Vi(e,n){e=e|0;n=+n;pr(u[e>>2]|0,X(n));return}function zi(e,n){e=e|0;n=+n;hr(u[e>>2]|0,X(n));return}function ji(e,n){e=e|0;n=+n;Pr(u[e>>2]|0,X(n));return}function qi(e,n){e=e|0;n=+n;Br(u[e>>2]|0,X(n));return}function Gi(e){e=e|0;Or(u[e>>2]|0);return}function Xi(e,n){e=e|0;n=+n;Nr(u[e>>2]|0,X(n));return}function Ki(e,n){e=e|0;n=+n;Ur(u[e>>2]|0,X(n));return}function Ji(e){e=e|0;Fr(u[e>>2]|0);return}function Zi(e,n){e=e|0;n=+n;Dr(u[e>>2]|0,X(n));return}function Qi(e,n){e=e|0;n=+n;Hr(u[e>>2]|0,X(n));return}function $i(e,n){e=e|0;n=+n;Yr(u[e>>2]|0,X(n));return}function eu(e,n){e=e|0;n=+n;Vr(u[e>>2]|0,X(n));return}function nu(e,n){e=e|0;n=+n;jr(u[e>>2]|0,X(n));return}function ru(e,n){e=e|0;n=+n;qr(u[e>>2]|0,X(n));return}function tu(e,n){e=e|0;n=+n;Xr(u[e>>2]|0,X(n));return}function iu(e,n){e=e|0;n=+n;Kr(u[e>>2]|0,X(n));return}function uu(e,n){e=e|0;n=+n;Zr(u[e>>2]|0,X(n));return}function ou(e,n,r){e=e|0;n=n|0;r=+r;Lr(u[e>>2]|0,n,X(r));return}function au(e,n,r){e=e|0;n=n|0;r=+r;Er(u[e>>2]|0,n,X(r));return}function fu(e,n,r){e=e|0;n=n|0;r=+r;Sr(u[e>>2]|0,n,X(r));return}function cu(e){e=e|0;return fr(u[e>>2]|0)|0}function lu(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0;t=v;v=v+16|0;i=t;gr(i,u[n>>2]|0,r);su(e,i);v=t;return}function su(e,n){e=e|0;n=n|0;du(e,u[n+4>>2]|0,+X(c[n>>2]));return}function du(e,n,r){e=e|0;n=n|0;r=+r;u[e>>2]=n;l[e+8>>3]=r;return}function _u(e){e=e|0;return rr(u[e>>2]|0)|0}function vu(e){e=e|0;return ir(u[e>>2]|0)|0}function pu(e){e=e|0;return or(u[e>>2]|0)|0}function hu(e){e=e|0;return Qn(u[e>>2]|0)|0}function bu(e){e=e|0;return lr(u[e>>2]|0)|0}function mu(e){e=e|0;return er(u[e>>2]|0)|0}function yu(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0;t=v;v=v+16|0;i=t;kr(i,u[n>>2]|0,r);su(e,i);v=t;return}function wu(e){e=e|0;return dr(u[e>>2]|0)|0}function gu(e){e=e|0;return vr(u[e>>2]|0)|0}function Tu(e,n){e=e|0;n=n|0;var r=0,t=0;r=v;v=v+16|0;t=r;zn(t,u[n>>2]|0);su(e,t);v=r;return}function Mu(e){e=e|0;return+ +X(Hn(u[e>>2]|0))}function ku(e){e=e|0;return+ +X(Vn(u[e>>2]|0))}function Au(e,n){e=e|0;n=n|0;var r=0,t=0;r=v;v=v+16|0;t=r;Ir(t,u[n>>2]|0);su(e,t);v=r;return}function Eu(e,n){e=e|0;n=n|0;var r=0,t=0;r=v;v=v+16|0;t=r;xr(t,u[n>>2]|0);su(e,t);v=r;return}function Su(e,n){e=e|0;n=n|0;var r=0,t=0;r=v;v=v+16|0;t=r;Wr(t,u[n>>2]|0);su(e,t);v=r;return}function Cu(e,n){e=e|0;n=n|0;var r=0,t=0;r=v;v=v+16|0;t=r;zr(t,u[n>>2]|0);su(e,t);v=r;return}function Lu(e,n){e=e|0;n=n|0;var r=0,t=0;r=v;v=v+16|0;t=r;Gr(t,u[n>>2]|0);su(e,t);v=r;return}function Ru(e,n){e=e|0;n=n|0;var r=0,t=0;r=v;v=v+16|0;t=r;Jr(t,u[n>>2]|0);su(e,t);v=r;return}function Pu(e){e=e|0;return+ +X(Qr(u[e>>2]|0))}function Bu(e,n){e=e|0;n=n|0;return+ +X(Rr(u[e>>2]|0,n))}function Ou(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0;t=v;v=v+16|0;i=t;Cr(i,u[n>>2]|0,r);su(e,i);v=t;return}function Iu(e,n,r){e=e|0;n=n|0;r=r|0;Nn(u[e>>2]|0,u[n>>2]|0,r);return}function Nu(e,n){e=e|0;n=n|0;Rn(u[e>>2]|0,u[n>>2]|0);return}function Uu(e){e=e|0;return Cn(u[e>>2]|0)|0}function Fu(e){e=e|0;e=Un(u[e>>2]|0)|0;if(!e)e=0;else e=Mi(e)|0;return e|0}function xu(e,n){e=e|0;n=n|0;e=Ln(u[e>>2]|0,n)|0;if(!e)e=0;else e=Mi(e)|0;return e|0}function Du(e,n){e=e|0;n=n|0;var r=0,t=0;t=iE(4)|0;Hu(t,n);r=e+4|0;n=u[r>>2]|0;u[r>>2]=t;if(n|0){gi(n);oE(n)}In(u[e>>2]|0,1);return}function Hu(e,n){e=e|0;n=n|0;oo(e,n);return}function Wu(e,n,r,t,i,u){e=e|0;n=n|0;r=X(r);t=t|0;i=X(i);u=u|0;var o=0,a=0;o=v;v=v+16|0;a=o;Yu(a,Xn(n)|0,+r,t,+i,u);c[e>>2]=X(+l[a>>3]);c[e+4>>2]=X(+l[a+8>>3]);v=o;return}function Yu(e,n,r,t,i,o){e=e|0;n=n|0;r=+r;t=t|0;i=+i;o=o|0;var a=0,f=0,c=0,s=0,d=0;a=v;v=v+32|0;d=a+8|0;s=a+20|0;c=a;f=a+16|0;l[d>>3]=r;u[s>>2]=t;l[c>>3]=i;u[f>>2]=o;Vu(e,u[n+4>>2]|0,d,s,c,f);v=a;return}function Vu(e,n,r,t,i,o){e=e|0;n=n|0;r=r|0;t=t|0;i=i|0;o=o|0;var a=0,f=0;a=v;v=v+16|0;f=a;Sk(f);n=zu(n)|0;ju(e,n,+l[r>>3],u[t>>2]|0,+l[i>>3],u[o>>2]|0);Lk(f);v=a;return}function zu(e){e=e|0;return u[e>>2]|0}function ju(e,n,r,t,i,u){e=e|0;n=n|0;r=+r;t=t|0;i=+i;u=u|0;var o=0;o=Gu(qu()|0)|0;r=+Xu(r);t=Ku(t)|0;i=+Xu(i);Ju(e,rn(0,o|0,n|0,+r,t|0,+i,Ku(u)|0)|0);return}function qu(){var e=0;if(!(t[8840]|0)){to(9316);e=8840;u[e>>2]=1;u[e+4>>2]=0}return 9316}function Gu(e){e=e|0;return u[e+8>>2]|0}function Xu(e){e=+e;return+ +ro(e)}function Ku(e){e=e|0;return no(e)|0}function Ju(e,n){e=e|0;n=n|0;var r=0,t=0,i=0;i=v;v=v+32|0;r=i;t=n;if(!(t&1)){u[e>>2]=u[n>>2];u[e+4>>2]=u[n+4>>2];u[e+8>>2]=u[n+8>>2];u[e+12>>2]=u[n+12>>2]}else{Zu(r,0);Ue(t|0,r|0)|0;Qu(e,r);$u(r)}v=i;return}function Zu(e,n){e=e|0;n=n|0;eo(e,n);u[e+8>>2]=0;t[e+24>>0]=0;return}function Qu(e,n){e=e|0;n=n|0;n=n+8|0;u[e>>2]=u[n>>2];u[e+4>>2]=u[n+4>>2];u[e+8>>2]=u[n+8>>2];u[e+12>>2]=u[n+12>>2];return}function $u(e){e=e|0;t[e+24>>0]=0;return}function eo(e,n){e=e|0;n=n|0;u[e>>2]=n;return}function no(e){e=e|0;return e|0}function ro(e){e=+e;return+e}function to(e){e=e|0;uo(e,io()|0,4);return}function io(){return 1100}function uo(e,n,r){e=e|0;n=n|0;r=r|0;u[e>>2]=n;u[e+4>>2]=r;u[e+8>>2]=Qe(n|0,r+1|0)|0;return}function oo(e,n){e=e|0;n=n|0;n=u[n>>2]|0;u[e>>2]=n;Se(n|0);return}function ao(e){e=e|0;var n=0,r=0;r=e+4|0;n=u[r>>2]|0;u[r>>2]=0;if(n|0){gi(n);oE(n)}In(u[e>>2]|0,0);return}function fo(e){e=e|0;Fn(u[e>>2]|0);return}function co(e){e=e|0;return xn(u[e>>2]|0)|0}function lo(e,n){e=e|0;n=n|0;Kn(u[e>>2]|0,n);return}function so(e){e=e|0;return Jn(u[e>>2]|0)|0}function _o(e,n,r,t){e=e|0;n=+n;r=+r;t=t|0;vi(u[e>>2]|0,X(n),X(r),t);return}function vo(e){e=e|0;return+ +X($r(u[e>>2]|0))}function po(e){e=e|0;return+ +X(nt(u[e>>2]|0))}function ho(e){e=e|0;return+ +X(et(u[e>>2]|0))}function bo(e){e=e|0;return+ +X(rt(u[e>>2]|0))}function mo(e){e=e|0;return+ +X(tt(u[e>>2]|0))}function yo(e){e=e|0;return+ +X(it(u[e>>2]|0))}function wo(e,n){e=e|0;n=n|0;l[e>>3]=+X($r(u[n>>2]|0));l[e+8>>3]=+X(nt(u[n>>2]|0));l[e+16>>3]=+X(et(u[n>>2]|0));l[e+24>>3]=+X(rt(u[n>>2]|0));l[e+32>>3]=+X(tt(u[n>>2]|0));l[e+40>>3]=+X(it(u[n>>2]|0));return}function go(e,n){e=e|0;n=n|0;return+ +X(ut(u[e>>2]|0,n))}function To(e,n){e=e|0;n=n|0;return+ +X(ot(u[e>>2]|0,n))}function Mo(e,n){e=e|0;n=n|0;return+ +X(at(u[e>>2]|0,n))}function ko(e,n){e=e|0;n=n|0;hi(e,n);return}function Ao(e){e=e|0;return si(e)|0}function Eo(){return On()|0}function So(){Co();Lo();Ro();Po();Bo();Oo();Io();return}function Co(){zm(11756,6156,1);return}function Lo(){Em(11755,6127,3);return}function Ro(){cm(11754,6110,1);return}function Po(){Mb(10416);return}function Bo(){tb(10376);return}function Oo(){wh(10292);return}function Io(){No(9328);return}function No(e){e=e|0;var n=0,r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0,h=0,b=0,m=0,y=0,w=0,g=0,T=0,M=0,k=0,A=0,E=0,S=0,C=0,L=0,R=0,P=0,B=0,O=0,I=0,N=0,U=0,F=0,x=0,D=0,H=0,W=0,Y=0,V=0,z=0,j=0,q=0,G=0,X=0,K=0,J=0,Z=0,Q=0,$=0,ee=0,ne=0,re=0,te=0,ie=0,ue=0,oe=0,ae=0,fe=0,ce=0,le=0,se=0,de=0,_e=0,ve=0,pe=0,he=0,be=0,me=0,ye=0,we=0,ge=0,Te=0,Me=0,ke=0,Ae=0,Ee=0,Se=0,Ce=0,Le=0,Re=0,Pe=0,Be=0,Oe=0,Ie=0;n=v;v=v+688|0;r=n+672|0;Ie=n+664|0;Oe=n+656|0;Be=n+648|0;Pe=n+640|0;Re=n+632|0;Le=n+624|0;Ce=n+616|0;Se=n+608|0;Ee=n+600|0;Ae=n+592|0;ke=n+584|0;Me=n+576|0;Te=n+568|0;ge=n+560|0;we=n+552|0;ye=n+544|0;me=n+536|0;be=n+528|0;he=n+520|0;pe=n+512|0;ve=n+504|0;_e=n+496|0;de=n+488|0;se=n+480|0;le=n+472|0;ce=n+464|0;fe=n+456|0;ae=n+448|0;oe=n+440|0;ue=n+432|0;ie=n+424|0;te=n+416|0;re=n+408|0;ne=n+400|0;ee=n+392|0;$=n+384|0;Q=n+376|0;Z=n+368|0;J=n+360|0;K=n+352|0;X=n+344|0;G=n+336|0;q=n+328|0;j=n+320|0;z=n+312|0;V=n+304|0;Y=n+296|0;W=n+288|0;H=n+280|0;D=n+272|0;x=n+264|0;F=n+256|0;U=n+248|0;N=n+240|0;I=n+232|0;O=n+224|0;B=n+216|0;P=n+208|0;R=n+200|0;L=n+192|0;C=n+184|0;S=n+176|0;E=n+168|0;A=n+160|0;k=n+152|0;M=n+144|0;T=n+136|0;g=n+128|0;w=n+120|0;y=n+112|0;m=n+104|0;b=n+96|0;h=n+88|0;p=n+80|0;_=n+72|0;d=n+64|0;s=n+56|0;l=n+48|0;c=n+40|0;f=n+32|0;a=n+24|0;o=n+16|0;i=n+8|0;t=n;Uo(e,4903);Fo(e,4908,2)|0;xo(e,4915,18)|0;u[Ie>>2]=19;u[Ie+4>>2]=0;u[r>>2]=u[Ie>>2];u[r+4>>2]=u[Ie+4>>2];Do(e,4923,r)|0;u[Oe>>2]=2;u[Oe+4>>2]=0;u[r>>2]=u[Oe>>2];u[r+4>>2]=u[Oe+4>>2];Ho(e,4929,r)|0;u[Be>>2]=3;u[Be+4>>2]=0;u[r>>2]=u[Be>>2];u[r+4>>2]=u[Be+4>>2];Wo(e,4939,r)|0;u[Pe>>2]=1;u[Pe+4>>2]=0;u[r>>2]=u[Pe>>2];u[r+4>>2]=u[Pe+4>>2];Yo(e,4955,r)|0;u[Re>>2]=2;u[Re+4>>2]=0;u[r>>2]=u[Re>>2];u[r+4>>2]=u[Re+4>>2];Yo(e,4967,r)|0;u[Le>>2]=4;u[Le+4>>2]=0;u[r>>2]=u[Le>>2];u[r+4>>2]=u[Le+4>>2];Wo(e,4986,r)|0;u[Ce>>2]=5;u[Ce+4>>2]=0;u[r>>2]=u[Ce>>2];u[r+4>>2]=u[Ce+4>>2];Wo(e,5002,r)|0;
u[Se>>2]=6;u[Se+4>>2]=0;u[r>>2]=u[Se>>2];u[r+4>>2]=u[Se+4>>2];Wo(e,5016,r)|0;u[Ee>>2]=7;u[Ee+4>>2]=0;u[r>>2]=u[Ee>>2];u[r+4>>2]=u[Ee+4>>2];Wo(e,5029,r)|0;u[Ae>>2]=8;u[Ae+4>>2]=0;u[r>>2]=u[Ae>>2];u[r+4>>2]=u[Ae+4>>2];Wo(e,5046,r)|0;u[ke>>2]=9;u[ke+4>>2]=0;u[r>>2]=u[ke>>2];u[r+4>>2]=u[ke+4>>2];Wo(e,5058,r)|0;u[Me>>2]=3;u[Me+4>>2]=0;u[r>>2]=u[Me>>2];u[r+4>>2]=u[Me+4>>2];Yo(e,5076,r)|0;u[Te>>2]=4;u[Te+4>>2]=0;u[r>>2]=u[Te>>2];u[r+4>>2]=u[Te+4>>2];Yo(e,5086,r)|0;u[ge>>2]=10;u[ge+4>>2]=0;u[r>>2]=u[ge>>2];u[r+4>>2]=u[ge+4>>2];Wo(e,5103,r)|0;u[we>>2]=11;u[we+4>>2]=0;u[r>>2]=u[we>>2];u[r+4>>2]=u[we+4>>2];Wo(e,5117,r)|0;u[ye>>2]=12;u[ye+4>>2]=0;u[r>>2]=u[ye>>2];u[r+4>>2]=u[ye+4>>2];Wo(e,5129,r)|0;u[me>>2]=1;u[me+4>>2]=0;u[r>>2]=u[me>>2];u[r+4>>2]=u[me+4>>2];Vo(e,5140,r)|0;u[be>>2]=2;u[be+4>>2]=0;u[r>>2]=u[be>>2];u[r+4>>2]=u[be+4>>2];Vo(e,5148,r)|0;u[he>>2]=3;u[he+4>>2]=0;u[r>>2]=u[he>>2];u[r+4>>2]=u[he+4>>2];Vo(e,5161,r)|0;u[pe>>2]=4;u[pe+4>>2]=0;u[r>>2]=u[pe>>2];u[r+4>>2]=u[pe+4>>2];Vo(e,5181,r)|0;u[ve>>2]=5;u[ve+4>>2]=0;u[r>>2]=u[ve>>2];u[r+4>>2]=u[ve+4>>2];Vo(e,5193,r)|0;u[_e>>2]=6;u[_e+4>>2]=0;u[r>>2]=u[_e>>2];u[r+4>>2]=u[_e+4>>2];Vo(e,5207,r)|0;u[de>>2]=7;u[de+4>>2]=0;u[r>>2]=u[de>>2];u[r+4>>2]=u[de+4>>2];Vo(e,5216,r)|0;u[se>>2]=20;u[se+4>>2]=0;u[r>>2]=u[se>>2];u[r+4>>2]=u[se+4>>2];Do(e,5232,r)|0;u[le>>2]=8;u[le+4>>2]=0;u[r>>2]=u[le>>2];u[r+4>>2]=u[le+4>>2];Vo(e,5245,r)|0;u[ce>>2]=9;u[ce+4>>2]=0;u[r>>2]=u[ce>>2];u[r+4>>2]=u[ce+4>>2];Vo(e,5255,r)|0;u[fe>>2]=21;u[fe+4>>2]=0;u[r>>2]=u[fe>>2];u[r+4>>2]=u[fe+4>>2];Do(e,5272,r)|0;u[ae>>2]=10;u[ae+4>>2]=0;u[r>>2]=u[ae>>2];u[r+4>>2]=u[ae+4>>2];Vo(e,5286,r)|0;u[oe>>2]=11;u[oe+4>>2]=0;u[r>>2]=u[oe>>2];u[r+4>>2]=u[oe+4>>2];Vo(e,5298,r)|0;u[ue>>2]=12;u[ue+4>>2]=0;u[r>>2]=u[ue>>2];u[r+4>>2]=u[ue+4>>2];Vo(e,5317,r)|0;u[ie>>2]=13;u[ie+4>>2]=0;u[r>>2]=u[ie>>2];u[r+4>>2]=u[ie+4>>2];Vo(e,5330,r)|0;u[te>>2]=14;u[te+4>>2]=0;u[r>>2]=u[te>>2];u[r+4>>2]=u[te+4>>2];Vo(e,5350,r)|0;u[re>>2]=15;u[re+4>>2]=0;u[r>>2]=u[re>>2];u[r+4>>2]=u[re+4>>2];Vo(e,5362,r)|0;u[ne>>2]=16;u[ne+4>>2]=0;u[r>>2]=u[ne>>2];u[r+4>>2]=u[ne+4>>2];Vo(e,5381,r)|0;u[ee>>2]=17;u[ee+4>>2]=0;u[r>>2]=u[ee>>2];u[r+4>>2]=u[ee+4>>2];Vo(e,5394,r)|0;u[$>>2]=18;u[$+4>>2]=0;u[r>>2]=u[$>>2];u[r+4>>2]=u[$+4>>2];Vo(e,5414,r)|0;u[Q>>2]=5;u[Q+4>>2]=0;u[r>>2]=u[Q>>2];u[r+4>>2]=u[Q+4>>2];Yo(e,5429,r)|0;u[Z>>2]=6;u[Z+4>>2]=0;u[r>>2]=u[Z>>2];u[r+4>>2]=u[Z+4>>2];Yo(e,5439,r)|0;u[J>>2]=7;u[J+4>>2]=0;u[r>>2]=u[J>>2];u[r+4>>2]=u[J+4>>2];Yo(e,5450,r)|0;u[K>>2]=4;u[K+4>>2]=0;u[r>>2]=u[K>>2];u[r+4>>2]=u[K+4>>2];zo(e,5468,r)|0;u[X>>2]=1;u[X+4>>2]=0;u[r>>2]=u[X>>2];u[r+4>>2]=u[X+4>>2];jo(e,5484,r)|0;u[G>>2]=5;u[G+4>>2]=0;u[r>>2]=u[G>>2];u[r+4>>2]=u[G+4>>2];zo(e,5496,r)|0;u[q>>2]=6;u[q+4>>2]=0;u[r>>2]=u[q>>2];u[r+4>>2]=u[q+4>>2];zo(e,5512,r)|0;u[j>>2]=7;u[j+4>>2]=0;u[r>>2]=u[j>>2];u[r+4>>2]=u[j+4>>2];zo(e,5526,r)|0;u[z>>2]=8;u[z+4>>2]=0;u[r>>2]=u[z>>2];u[r+4>>2]=u[z+4>>2];zo(e,5539,r)|0;u[V>>2]=9;u[V+4>>2]=0;u[r>>2]=u[V>>2];u[r+4>>2]=u[V+4>>2];zo(e,5556,r)|0;u[Y>>2]=10;u[Y+4>>2]=0;u[r>>2]=u[Y>>2];u[r+4>>2]=u[Y+4>>2];zo(e,5568,r)|0;u[W>>2]=2;u[W+4>>2]=0;u[r>>2]=u[W>>2];u[r+4>>2]=u[W+4>>2];jo(e,5586,r)|0;u[H>>2]=13;u[H+4>>2]=0;u[r>>2]=u[H>>2];u[r+4>>2]=u[H+4>>2];qo(e,5596,r)|0;u[D>>2]=1;u[D+4>>2]=0;u[r>>2]=u[D>>2];u[r+4>>2]=u[D+4>>2];Go(e,5609,r)|0;u[x>>2]=2;u[x+4>>2]=0;u[r>>2]=u[x>>2];u[r+4>>2]=u[x+4>>2];Go(e,5621,r)|0;u[F>>2]=14;u[F+4>>2]=0;u[r>>2]=u[F>>2];u[r+4>>2]=u[F+4>>2];qo(e,5635,r)|0;u[U>>2]=15;u[U+4>>2]=0;u[r>>2]=u[U>>2];u[r+4>>2]=u[U+4>>2];qo(e,5644,r)|0;u[N>>2]=16;u[N+4>>2]=0;u[r>>2]=u[N>>2];u[r+4>>2]=u[N+4>>2];qo(e,5654,r)|0;u[I>>2]=17;u[I+4>>2]=0;u[r>>2]=u[I>>2];u[r+4>>2]=u[I+4>>2];qo(e,5666,r)|0;u[O>>2]=18;u[O+4>>2]=0;u[r>>2]=u[O>>2];u[r+4>>2]=u[O+4>>2];qo(e,5679,r)|0;u[B>>2]=19;u[B+4>>2]=0;u[r>>2]=u[B>>2];u[r+4>>2]=u[B+4>>2];qo(e,5691,r)|0;u[P>>2]=3;u[P+4>>2]=0;u[r>>2]=u[P>>2];u[r+4>>2]=u[P+4>>2];Go(e,5704,r)|0;u[R>>2]=1;u[R+4>>2]=0;u[r>>2]=u[R>>2];u[r+4>>2]=u[R+4>>2];Xo(e,5719,r)|0;u[L>>2]=11;u[L+4>>2]=0;u[r>>2]=u[L>>2];u[r+4>>2]=u[L+4>>2];zo(e,5729,r)|0;u[C>>2]=12;u[C+4>>2]=0;u[r>>2]=u[C>>2];u[r+4>>2]=u[C+4>>2];zo(e,5741,r)|0;u[S>>2]=3;u[S+4>>2]=0;u[r>>2]=u[S>>2];u[r+4>>2]=u[S+4>>2];jo(e,5752,r)|0;u[E>>2]=4;u[E+4>>2]=0;u[r>>2]=u[E>>2];u[r+4>>2]=u[E+4>>2];Ko(e,5763,r)|0;u[A>>2]=20;u[A+4>>2]=0;u[r>>2]=u[A>>2];u[r+4>>2]=u[A+4>>2];Jo(e,5775,r)|0;u[k>>2]=13;u[k+4>>2]=0;u[r>>2]=u[k>>2];u[r+4>>2]=u[k+4>>2];Zo(e,5787,r)|0;u[M>>2]=14;u[M+4>>2]=0;u[r>>2]=u[M>>2];u[r+4>>2]=u[M+4>>2];Qo(e,5801,r)|0;u[T>>2]=3;u[T+4>>2]=0;u[r>>2]=u[T>>2];u[r+4>>2]=u[T+4>>2];$o(e,5811,r)|0;u[g>>2]=21;u[g+4>>2]=0;u[r>>2]=u[g>>2];u[r+4>>2]=u[g+4>>2];ea(e,5820,r)|0;u[w>>2]=22;u[w+4>>2]=0;u[r>>2]=u[w>>2];u[r+4>>2]=u[w+4>>2];Do(e,5835,r)|0;u[y>>2]=22;u[y+4>>2]=0;u[r>>2]=u[y>>2];u[r+4>>2]=u[y+4>>2];na(e,5852,r)|0;u[m>>2]=15;u[m+4>>2]=0;u[r>>2]=u[m>>2];u[r+4>>2]=u[m+4>>2];ra(e,5868,r)|0;u[b>>2]=23;u[b+4>>2]=0;u[r>>2]=u[b>>2];u[r+4>>2]=u[b+4>>2];Do(e,5884,r)|0;u[h>>2]=16;u[h+4>>2]=0;u[r>>2]=u[h>>2];u[r+4>>2]=u[h+4>>2];ra(e,5894,r)|0;u[p>>2]=1;u[p+4>>2]=0;u[r>>2]=u[p>>2];u[r+4>>2]=u[p+4>>2];ta(e,5902,r)|0;u[_>>2]=4;u[_+4>>2]=0;u[r>>2]=u[_>>2];u[r+4>>2]=u[_+4>>2];Go(e,5918,r)|0;u[d>>2]=5;u[d+4>>2]=0;u[r>>2]=u[d>>2];u[r+4>>2]=u[d+4>>2];Go(e,5934,r)|0;u[s>>2]=6;u[s+4>>2]=0;u[r>>2]=u[s>>2];u[r+4>>2]=u[s+4>>2];Go(e,5951,r)|0;u[l>>2]=7;u[l+4>>2]=0;u[r>>2]=u[l>>2];u[r+4>>2]=u[l+4>>2];Go(e,5966,r)|0;u[c>>2]=8;u[c+4>>2]=0;u[r>>2]=u[c>>2];u[r+4>>2]=u[c+4>>2];Go(e,5984,r)|0;u[f>>2]=9;u[f+4>>2]=0;u[r>>2]=u[f>>2];u[r+4>>2]=u[f+4>>2];Go(e,6001,r)|0;u[a>>2]=23;u[a+4>>2]=0;u[r>>2]=u[a>>2];u[r+4>>2]=u[a+4>>2];ia(e,6019,r)|0;u[o>>2]=2;u[o+4>>2]=0;u[r>>2]=u[o>>2];u[r+4>>2]=u[o+4>>2];Xo(e,6037,r)|0;u[i>>2]=3;u[i+4>>2]=0;u[r>>2]=u[i>>2];u[r+4>>2]=u[i+4>>2];Xo(e,6055,r)|0;u[t>>2]=4;u[t+4>>2]=0;u[r>>2]=u[t>>2];u[r+4>>2]=u[t+4>>2];Xo(e,6073,r)|0;v=n;return}function Uo(e,n){e=e|0;n=n|0;var r=0;r=ch()|0;u[e>>2]=r;lh(r,n);vy(u[e>>2]|0);return}function Fo(e,n,r){e=e|0;n=n|0;r=r|0;qp(e,oa(n)|0,r,0);return e|0}function xo(e,n,r){e=e|0;n=n|0;r=r|0;Lp(e,oa(n)|0,r,0);return e|0}function Do(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];lp(e,n,i);v=t;return e|0}function Ho(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Yv(e,n,i);v=t;return e|0}function Wo(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Mv(e,n,i);v=t;return e|0}function Yo(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];iv(e,n,i);v=t;return e|0}function Vo(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];D_(e,n,i);v=t;return e|0}function zo(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];w_(e,n,i);v=t;return e|0}function jo(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];n_(e,n,i);v=t;return e|0}function qo(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];gd(e,n,i);v=t;return e|0}function Go(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];rd(e,n,i);v=t;return e|0}function Xo(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Fs(e,n,i);v=t;return e|0}function Ko(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];ms(e,n,i);v=t;return e|0}function Jo(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Jl(e,n,i);v=t;return e|0}function Zo(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Rl(e,n,i);v=t;return e|0}function Qo(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];sl(e,n,i);v=t;return e|0}function $o(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Yc(e,n,i);v=t;return e|0}function ea(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];mc(e,n,i);v=t;return e|0}function na(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Jf(e,n,i);v=t;return e|0}function ra(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Rf(e,n,i);v=t;return e|0}function ta(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];uf(e,n,i);v=t;return e|0}function ia(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];ua(e,n,i);v=t;return e|0}function ua(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=oa(n)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];aa(e,r,i,1);v=t;return}function oa(e){e=e|0;return e|0}function aa(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[e>>2]|0;e=fa()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=ca(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];sa(a,n,e,r,la(o,t)|0,t);v=i;return}function fa(){var e=0,n=0;if(!(t[8848]|0)){Ta(9332);Ie(24,9332,b|0)|0;n=8848;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(9332)|0)){e=9332;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));Ta(9332)}return 9332}function ca(e){e=e|0;return 0}function la(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[e>>2]|0;t=u[e+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=fa()|0;l=d+24|0;e=pa(n,4)|0;u[c>>2]=e;n=d+28|0;r=u[n>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];ha(r,i,e);e=(u[n>>2]|0)+12|0;u[n>>2]=e}else{ba(l,f,c);e=u[n>>2]|0}v=s;return((e-(u[l>>2]|0)|0)/12|0)+-1|0}function sa(e,n,r,t,i,o){e=e|0;n=n|0;r=r|0;t=t|0;i=i|0;o=o|0;var a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0;a=v;v=v+32|0;_=a+24|0;d=a+20|0;c=a+16|0;s=a+12|0;l=a+8|0;f=a+4|0;p=a;u[d>>2]=n;u[c>>2]=r;u[s>>2]=t;u[l>>2]=i;u[f>>2]=o;o=e+28|0;u[p>>2]=u[o>>2];u[_>>2]=u[p>>2];da(e+24|0,_,d,s,l,c,f)|0;u[o>>2]=u[u[o>>2]>>2];v=a;return}function da(e,n,r,t,i,o,a){e=e|0;n=n|0;r=r|0;t=t|0;i=i|0;o=o|0;a=a|0;e=_a(n)|0;n=iE(24)|0;va(n+4|0,u[r>>2]|0,u[t>>2]|0,u[i>>2]|0,u[o>>2]|0,u[a>>2]|0);u[n>>2]=u[e>>2];u[e>>2]=n;return n|0}function _a(e){e=e|0;return u[e>>2]|0}function va(e,n,r,t,i,o){e=e|0;n=n|0;r=r|0;t=t|0;i=i|0;o=o|0;u[e>>2]=n;u[e+4>>2]=r;u[e+8>>2]=t;u[e+12>>2]=i;u[e+16>>2]=o;return}function pa(e,n){e=e|0;n=n|0;return n|e|0}function ha(e,n,r){e=e|0;n=n|0;r=r|0;var t=0;t=u[n+4>>2]|0;u[e>>2]=u[n>>2];u[e+4>>2]=t;u[e+8>>2]=r;return}function ba(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=e+4|0;i=(((u[c>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=ma(e)|0;if(o>>>0<i>>>0)ZA(e);else{s=u[e>>2]|0;_=((u[e+8>>2]|0)-s|0)/12|0;d=_<<1;ya(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,e+8|0);c=f+8|0;o=u[c>>2]|0;i=u[n+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[n>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];ha(o,t,r);u[c>>2]=(u[c>>2]|0)+12;wa(e,f);ga(f);v=l;return}}function ma(e){e=e|0;return 357913941}function ya(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>357913941)je();else{i=iE(n*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r*12|0)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n*12|0);return}function wa(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function ga(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~(((t+-12-n|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)oE(e);return}function Ta(e){e=e|0;Ea(e);return}function Ma(e){e=e|0;Aa(e+24|0);return}function ka(e){e=e|0;return u[e>>2]|0}function Aa(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~(((n+-12-t|0)>>>0)/12|0)*12|0);oE(r)}return}function Ea(e){e=e|0;var n=0;n=Sa()|0;Ra(e,2,4,n,Ca()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function Sa(){return 9424}function Ca(){return 1176}function La(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0;r=v;v=v+16|0;t=r+8|0;i=r;o=Pa(e)|0;e=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=e;u[t>>2]=u[i>>2];u[t+4>>2]=u[i+4>>2];n=Ba(n,t)|0;v=r;return n|0}function Ra(e,n,r,t,i,o){e=e|0;n=n|0;r=r|0;t=t|0;i=i|0;o=o|0;u[e>>2]=n;u[e+4>>2]=r;u[e+8>>2]=t;u[e+12>>2]=i;u[e+16>>2]=o;return}function Pa(e){e=e|0;return(u[(fa()|0)+24>>2]|0)+(e*12|0)|0}function Ba(e,n){e=e|0;n=n|0;var r=0,t=0,i=0;i=v;v=v+48|0;t=i;r=u[n>>2]|0;n=u[n+4>>2]|0;e=e+(n>>1)|0;if(n&1)r=u[(u[e>>2]|0)+r>>2]|0;wS[r&31](t,e);t=Oa(t)|0;v=i;return t|0}function Oa(e){e=e|0;var n=0,r=0,t=0,i=0;i=v;v=v+32|0;n=i+12|0;r=i;t=Na(Ia()|0)|0;if(!t)e=Ha(e)|0;else{Ua(n,t);Fa(r,n);xa(e,r);e=Da(n)|0}v=i;return e|0}function Ia(){var e=0;if(!(t[8864]|0)){Za(9380);Ie(25,9380,b|0)|0;e=8864;u[e>>2]=1;u[e+4>>2]=0}return 9380}function Na(e){e=e|0;return u[e+36>>2]|0}function Ua(e,n){e=e|0;n=n|0;u[e>>2]=n;u[e+4>>2]=e;u[e+8>>2]=0;return}function Fa(e,n){e=e|0;n=n|0;u[e>>2]=u[n>>2];u[e+4>>2]=u[n+4>>2];u[e+8>>2]=0;return}function xa(e,n){e=e|0;n=n|0;ja(n,e,e+8|0,e+16|0,e+24|0,e+32|0,e+40|0)|0;return}function Da(e){e=e|0;return u[(u[e+4>>2]|0)+8>>2]|0}function Ha(e){e=e|0;var n=0,r=0,t=0,i=0,o=0,a=0,f=0,c=0;c=v;v=v+16|0;r=c+4|0;t=c;i=zg(8)|0;o=i;a=iE(48)|0;f=a;n=f+48|0;do{u[f>>2]=u[e>>2];f=f+4|0;e=e+4|0}while((f|0)<(n|0));n=o+4|0;u[n>>2]=a;f=iE(8)|0;a=u[n>>2]|0;u[t>>2]=0;u[r>>2]=u[t>>2];Wa(f,a,r);u[i>>2]=f;v=c;return o|0}function Wa(e,n,r){e=e|0;n=n|0;r=r|0;u[e>>2]=n;r=iE(16)|0;u[r+4>>2]=0;u[r+8>>2]=0;u[r>>2]=1128;u[r+12>>2]=n;u[e+4>>2]=r;return}function Ya(e){e=e|0;QA(e);oE(e);return}function Va(e){e=e|0;e=u[e+12>>2]|0;if(e|0)oE(e);return}function za(e){e=e|0;oE(e);return}function ja(e,n,r,t,i,o,a){e=e|0;n=n|0;r=r|0;t=t|0;i=i|0;o=o|0;a=a|0;o=qa(u[e>>2]|0,n,r,t,i,o,a)|0;a=e+4|0;u[(u[a>>2]|0)+8>>2]=o;return u[(u[a>>2]|0)+8>>2]|0}function qa(e,n,r,t,i,u,o){e=e|0;n=n|0;r=r|0;t=t|0;i=i|0;u=u|0;o=o|0;var a=0,f=0;a=v;v=v+16|0;f=a;Sk(f);e=zu(e)|0;o=Ga(e,+l[n>>3],+l[r>>3],+l[t>>3],+l[i>>3],+l[u>>3],+l[o>>3])|0;Lk(f);v=a;return o|0}function Ga(e,n,r,t,i,u,o){e=e|0;n=+n;r=+r;t=+t;i=+i;u=+u;o=+o;var a=0;a=Gu(Xa()|0)|0;n=+Xu(n);r=+Xu(r);t=+Xu(t);i=+Xu(i);u=+Xu(u);return Ae(0,a|0,e|0,+n,+r,+t,+i,+u,+ +Xu(o))|0}function Xa(){var e=0;if(!(t[8856]|0)){Ka(9368);e=8856;u[e>>2]=1;u[e+4>>2]=0}return 9368}function Ka(e){e=e|0;uo(e,Ja()|0,6);return}function Ja(){return 1148}function Za(e){e=e|0;tf(e);return}function Qa(e){e=e|0;$a(e+24|0);ef(e+16|0);return}function $a(e){e=e|0;rf(e);return}function ef(e){e=e|0;nf(e);return}function nf(e){e=e|0;var n=0,r=0;n=u[e>>2]|0;if(n|0)do{r=n;n=u[n>>2]|0;oE(r)}while((n|0)!=0);u[e>>2]=0;return}function rf(e){e=e|0;var n=0,r=0;n=u[e>>2]|0;if(n|0)do{r=n;n=u[n>>2]|0;oE(r)}while((n|0)!=0);u[e>>2]=0;return}function tf(e){e=e|0;var n=0;u[e+16>>2]=0;u[e+20>>2]=0;n=e+24|0;u[n>>2]=0;u[e+28>>2]=n;u[e+36>>2]=0;t[e+40>>0]=0;t[e+41>>0]=0;return}function uf(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=oa(n)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];of(e,r,i,0);v=t;return}function of(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[e>>2]|0;e=af()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=ff(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];sa(a,n,e,r,cf(o,t)|0,t);v=i;return}function af(){var e=0,n=0;if(!(t[8872]|0)){hf(9428);Ie(26,9428,b|0)|0;n=8872;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(9428)|0)){e=9428;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));hf(9428)}return 9428}function ff(e){e=e|0;return 0}function cf(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[e>>2]|0;t=u[e+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=af()|0;l=d+24|0;e=pa(n,4)|0;u[c>>2]=e;n=d+28|0;r=u[n>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];lf(r,i,e);e=(u[n>>2]|0)+12|0;u[n>>2]=e}else{sf(l,f,c);e=u[n>>2]|0}v=s;return((e-(u[l>>2]|0)|0)/12|0)+-1|0}function lf(e,n,r){e=e|0;n=n|0;r=r|0;var t=0;t=u[n+4>>2]|0;u[e>>2]=u[n>>2];u[e+4>>2]=t;u[e+8>>2]=r;return}function sf(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=e+4|0;i=(((u[c>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=df(e)|0;if(o>>>0<i>>>0)ZA(e);else{s=u[e>>2]|0;_=((u[e+8>>2]|0)-s|0)/12|0;d=_<<1;_f(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,e+8|0);c=f+8|0;o=u[c>>2]|0;i=u[n+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[n>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];lf(o,t,r);u[c>>2]=(u[c>>2]|0)+12;vf(e,f);pf(f);v=l;return}}function df(e){e=e|0;return 357913941}function _f(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>357913941)je();else{i=iE(n*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r*12|0)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n*12|0);return}function vf(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function pf(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~(((t+-12-n|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)oE(e);return}function hf(e){e=e|0;yf(e);return}function bf(e){e=e|0;mf(e+24|0);return}function mf(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~(((n+-12-t|0)>>>0)/12|0)*12|0);oE(r)}return}function yf(e){e=e|0;var n=0;n=Sa()|0;Ra(e,2,1,n,wf()|0,3);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function wf(){return 1180}function gf(e,n,r,t,i){e=e|0;n=n|0;r=+r;t=+t;i=i|0;var o=0,a=0,f=0,c=0;o=v;v=v+16|0;a=o+8|0;f=o;c=Tf(e)|0;e=u[c+4>>2]|0;u[f>>2]=u[c>>2];u[f+4>>2]=e;u[a>>2]=u[f>>2];u[a+4>>2]=u[f+4>>2];Mf(n,a,r,t,i);v=o;return}function Tf(e){e=e|0;return(u[(af()|0)+24>>2]|0)+(e*12|0)|0}function Mf(e,n,r,t,i){e=e|0;n=n|0;r=+r;t=+t;i=i|0;var o=0,a=0,f=0,c=0,l=0;l=v;v=v+16|0;a=l+2|0;f=l+1|0;c=l;o=u[n>>2]|0;n=u[n+4>>2]|0;e=e+(n>>1)|0;if(n&1)o=u[(u[e>>2]|0)+o>>2]|0;kf(a,r);r=+Af(a,r);kf(f,t);t=+Af(f,t);Ef(c,i);c=Sf(c,i)|0;TS[o&1](e,r,t,c);v=l;return}function kf(e,n){e=e|0;n=+n;return}function Af(e,n){e=e|0;n=+n;return+ +Lf(n)}function Ef(e,n){e=e|0;n=n|0;return}function Sf(e,n){e=e|0;n=n|0;return Cf(n)|0}function Cf(e){e=e|0;return e|0}function Lf(e){e=+e;return+e}function Rf(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=oa(n)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Pf(e,r,i,1);v=t;return}function Pf(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[e>>2]|0;e=Bf()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=Of(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];sa(a,n,e,r,If(o,t)|0,t);v=i;return}function Bf(){var e=0,n=0;if(!(t[8880]|0)){Wf(9464);Ie(27,9464,b|0)|0;n=8880;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(9464)|0)){e=9464;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));Wf(9464)}return 9464}function Of(e){e=e|0;return 0}function If(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[e>>2]|0;t=u[e+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Bf()|0;l=d+24|0;e=pa(n,4)|0;u[c>>2]=e;n=d+28|0;r=u[n>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Nf(r,i,e);e=(u[n>>2]|0)+12|0;u[n>>2]=e}else{Uf(l,f,c);e=u[n>>2]|0}v=s;return((e-(u[l>>2]|0)|0)/12|0)+-1|0}function Nf(e,n,r){e=e|0;n=n|0;r=r|0;var t=0;t=u[n+4>>2]|0;u[e>>2]=u[n>>2];u[e+4>>2]=t;u[e+8>>2]=r;return}function Uf(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=e+4|0;i=(((u[c>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=Ff(e)|0;if(o>>>0<i>>>0)ZA(e);else{s=u[e>>2]|0;_=((u[e+8>>2]|0)-s|0)/12|0;d=_<<1;xf(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,e+8|0);c=f+8|0;o=u[c>>2]|0;i=u[n+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[n>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];Nf(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Df(e,f);Hf(f);v=l;return}}function Ff(e){e=e|0;return 357913941}function xf(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>357913941)je();else{i=iE(n*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r*12|0)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n*12|0);return}function Df(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function Hf(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~(((t+-12-n|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)oE(e);return}function Wf(e){e=e|0;zf(e);return}function Yf(e){e=e|0;Vf(e+24|0);return}function Vf(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~(((n+-12-t|0)>>>0)/12|0)*12|0);oE(r)}return}function zf(e){e=e|0;var n=0;n=Sa()|0;Ra(e,2,5,n,jf()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function jf(){return 1196}function qf(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0;r=v;v=v+16|0;t=r+8|0;i=r;o=Gf(e)|0;e=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=e;u[t>>2]=u[i>>2];u[t+4>>2]=u[i+4>>2];n=Xf(n,t)|0;v=r;return n|0}function Gf(e){e=e|0;return(u[(Bf()|0)+24>>2]|0)+(e*12|0)|0}function Xf(e,n){e=e|0;n=n|0;var r=0;r=u[n>>2]|0;n=u[n+4>>2]|0;e=e+(n>>1)|0;if(n&1)r=u[(u[e>>2]|0)+r>>2]|0;return Kf(gS[r&31](e)|0)|0}function Kf(e){e=e|0;return e&1|0}function Jf(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=oa(n)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Zf(e,r,i,0);v=t;return}function Zf(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[e>>2]|0;e=Qf()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=$f(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];sa(a,n,e,r,ec(o,t)|0,t);v=i;return}function Qf(){var e=0,n=0;if(!(t[8888]|0)){ac(9500);Ie(28,9500,b|0)|0;n=8888;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(9500)|0)){e=9500;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));ac(9500)}return 9500}function $f(e){e=e|0;return 0}function ec(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[e>>2]|0;t=u[e+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Qf()|0;l=d+24|0;e=pa(n,4)|0;u[c>>2]=e;n=d+28|0;r=u[n>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];nc(r,i,e);e=(u[n>>2]|0)+12|0;u[n>>2]=e}else{rc(l,f,c);e=u[n>>2]|0}v=s;return((e-(u[l>>2]|0)|0)/12|0)+-1|0}function nc(e,n,r){e=e|0;n=n|0;r=r|0;var t=0;t=u[n+4>>2]|0;u[e>>2]=u[n>>2];u[e+4>>2]=t;u[e+8>>2]=r;return}function rc(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=e+4|0;i=(((u[c>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=tc(e)|0;if(o>>>0<i>>>0)ZA(e);else{s=u[e>>2]|0;_=((u[e+8>>2]|0)-s|0)/12|0;d=_<<1;ic(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,e+8|0);c=f+8|0;o=u[c>>2]|0;i=u[n+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[n>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];nc(o,t,r);u[c>>2]=(u[c>>2]|0)+12;uc(e,f);oc(f);v=l;return}}function tc(e){e=e|0;return 357913941}function ic(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>357913941)je();else{i=iE(n*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r*12|0)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n*12|0);return}function uc(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function oc(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~(((t+-12-n|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)oE(e);return}function ac(e){e=e|0;lc(e);return}function fc(e){e=e|0;cc(e+24|0);return}function cc(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~(((n+-12-t|0)>>>0)/12|0)*12|0);oE(r)}return}function lc(e){e=e|0;var n=0;n=Sa()|0;Ra(e,2,5,n,sc()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function sc(){return 1200}function dc(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=_c(e)|0;e=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=e;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];vc(n,i,r);v=t;return}function _c(e){e=e|0;return(u[(Qf()|0)+24>>2]|0)+(e*12|0)|0}function vc(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0;o=v;v=v+16|0;i=o;t=u[n>>2]|0;n=u[n+4>>2]|0;e=e+(n>>1)|0;if(n&1)t=u[(u[e>>2]|0)+t>>2]|0;pc(i,r);i=hc(i,r)|0;wS[t&31](e,i);v=o;return}function pc(e,n){e=e|0;n=n|0;return}function hc(e,n){e=e|0;n=n|0;return bc(n)|0}function bc(e){e=e|0;return(e|0)!=0|0}function mc(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=oa(n)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];yc(e,r,i,0);v=t;return}function yc(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[e>>2]|0;e=wc()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=gc(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];sa(a,n,e,r,Tc(o,t)|0,t);v=i;return}function wc(){var e=0,n=0;if(!(t[8896]|0)){Lc(9536);Ie(29,9536,b|0)|0;n=8896;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(9536)|0)){e=9536;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));Lc(9536)}return 9536}function gc(e){e=e|0;return 0}function Tc(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[e>>2]|0;t=u[e+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=wc()|0;l=d+24|0;e=pa(n,4)|0;u[c>>2]=e;n=d+28|0;r=u[n>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Mc(r,i,e);e=(u[n>>2]|0)+12|0;u[n>>2]=e}else{kc(l,f,c);e=u[n>>2]|0}v=s;return((e-(u[l>>2]|0)|0)/12|0)+-1|0}function Mc(e,n,r){e=e|0;n=n|0;r=r|0;var t=0;t=u[n+4>>2]|0;u[e>>2]=u[n>>2];u[e+4>>2]=t;u[e+8>>2]=r;return}function kc(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=e+4|0;i=(((u[c>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=Ac(e)|0;if(o>>>0<i>>>0)ZA(e);else{s=u[e>>2]|0;_=((u[e+8>>2]|0)-s|0)/12|0;d=_<<1;Ec(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,e+8|0);c=f+8|0;o=u[c>>2]|0;i=u[n+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[n>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];Mc(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Sc(e,f);Cc(f);v=l;return}}function Ac(e){e=e|0;return 357913941}function Ec(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>357913941)je();else{i=iE(n*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r*12|0)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n*12|0);return}function Sc(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function Cc(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~(((t+-12-n|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)oE(e);return}function Lc(e){e=e|0;Bc(e);return}function Rc(e){e=e|0;Pc(e+24|0);return}function Pc(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~(((n+-12-t|0)>>>0)/12|0)*12|0);oE(r)}return}function Bc(e){e=e|0;var n=0;n=Sa()|0;Ra(e,2,6,n,Oc()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function Oc(){return 1208}function Ic(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=Nc(e)|0;e=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=e;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Uc(n,i,r);v=t;return}function Nc(e){e=e|0;return(u[(wc()|0)+24>>2]|0)+(e*12|0)|0}function Uc(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0;o=v;v=v+16|0;i=o;t=u[n>>2]|0;n=u[n+4>>2]|0;e=e+(n>>1)|0;if(n&1)t=u[(u[e>>2]|0)+t>>2]|0;Fc(i,r);r=xc(i,r)|0;wS[t&31](e,r);Dc(i);v=o;return}function Fc(e,n){e=e|0;n=n|0;Hc(e,n);return}function xc(e,n){e=e|0;n=n|0;return e|0}function Dc(e){e=e|0;gi(e);return}function Hc(e,n){e=e|0;n=n|0;Wc(e,n);return}function Wc(e,n){e=e|0;n=n|0;u[e>>2]=n;return}function Yc(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=oa(n)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Vc(e,r,i,0);v=t;return}function Vc(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[e>>2]|0;e=zc()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=jc(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];sa(a,n,e,r,qc(o,t)|0,t);v=i;return}function zc(){var e=0,n=0;if(!(t[8904]|0)){$c(9572);Ie(30,9572,b|0)|0;n=8904;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(9572)|0)){e=9572;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));$c(9572)}return 9572}function jc(e){e=e|0;return 0}function qc(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[e>>2]|0;t=u[e+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=zc()|0;l=d+24|0;e=pa(n,4)|0;u[c>>2]=e;n=d+28|0;r=u[n>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Gc(r,i,e);e=(u[n>>2]|0)+12|0;u[n>>2]=e}else{Xc(l,f,c);e=u[n>>2]|0}v=s;return((e-(u[l>>2]|0)|0)/12|0)+-1|0}function Gc(e,n,r){e=e|0;n=n|0;r=r|0;var t=0;t=u[n+4>>2]|0;u[e>>2]=u[n>>2];u[e+4>>2]=t;u[e+8>>2]=r;return}function Xc(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=e+4|0;i=(((u[c>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=Kc(e)|0;if(o>>>0<i>>>0)ZA(e);else{s=u[e>>2]|0;_=((u[e+8>>2]|0)-s|0)/12|0;d=_<<1;Jc(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,e+8|0);c=f+8|0;o=u[c>>2]|0;i=u[n+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[n>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];Gc(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Zc(e,f);Qc(f);v=l;
return}}function Kc(e){e=e|0;return 357913941}function Jc(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>357913941)je();else{i=iE(n*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r*12|0)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n*12|0);return}function Zc(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function Qc(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~(((t+-12-n|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)oE(e);return}function $c(e){e=e|0;rl(e);return}function el(e){e=e|0;nl(e+24|0);return}function nl(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~(((n+-12-t|0)>>>0)/12|0)*12|0);oE(r)}return}function rl(e){e=e|0;var n=0;n=Sa()|0;Ra(e,2,5,n,tl()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function tl(){return 1224}function il(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=ul(e)|0;e=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=e;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];r=ol(n,i,r)|0;v=t;return r|0}function ul(e){e=e|0;return(u[(zc()|0)+24>>2]|0)+(e*12|0)|0}function ol(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0;o=v;v=v+16|0;i=o;t=u[n>>2]|0;n=u[n+4>>2]|0;e=e+(n>>1)|0;if(n&1)t=u[(u[e>>2]|0)+t>>2]|0;al(i,r);i=fl(i,r)|0;i=cl(CS[t&15](e,i)|0)|0;v=o;return i|0}function al(e,n){e=e|0;n=n|0;return}function fl(e,n){e=e|0;n=n|0;return ll(n)|0}function cl(e){e=e|0;return e|0}function ll(e){e=e|0;return e|0}function sl(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=oa(n)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];dl(e,r,i,0);v=t;return}function dl(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[e>>2]|0;e=_l()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=vl(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];sa(a,n,e,r,pl(o,t)|0,t);v=i;return}function _l(){var e=0,n=0;if(!(t[8912]|0)){Tl(9608);Ie(31,9608,b|0)|0;n=8912;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(9608)|0)){e=9608;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));Tl(9608)}return 9608}function vl(e){e=e|0;return 0}function pl(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[e>>2]|0;t=u[e+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=_l()|0;l=d+24|0;e=pa(n,4)|0;u[c>>2]=e;n=d+28|0;r=u[n>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];hl(r,i,e);e=(u[n>>2]|0)+12|0;u[n>>2]=e}else{bl(l,f,c);e=u[n>>2]|0}v=s;return((e-(u[l>>2]|0)|0)/12|0)+-1|0}function hl(e,n,r){e=e|0;n=n|0;r=r|0;var t=0;t=u[n+4>>2]|0;u[e>>2]=u[n>>2];u[e+4>>2]=t;u[e+8>>2]=r;return}function bl(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=e+4|0;i=(((u[c>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=ml(e)|0;if(o>>>0<i>>>0)ZA(e);else{s=u[e>>2]|0;_=((u[e+8>>2]|0)-s|0)/12|0;d=_<<1;yl(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,e+8|0);c=f+8|0;o=u[c>>2]|0;i=u[n+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[n>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];hl(o,t,r);u[c>>2]=(u[c>>2]|0)+12;wl(e,f);gl(f);v=l;return}}function ml(e){e=e|0;return 357913941}function yl(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>357913941)je();else{i=iE(n*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r*12|0)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n*12|0);return}function wl(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function gl(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~(((t+-12-n|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)oE(e);return}function Tl(e){e=e|0;Al(e);return}function Ml(e){e=e|0;kl(e+24|0);return}function kl(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~(((n+-12-t|0)>>>0)/12|0)*12|0);oE(r)}return}function Al(e){e=e|0;var n=0;n=Sa()|0;Ra(e,2,6,n,El()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function El(){return 1240}function Sl(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0;r=v;v=v+16|0;t=r+8|0;i=r;o=Cl(e)|0;e=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=e;u[t>>2]=u[i>>2];u[t+4>>2]=u[i+4>>2];n=Ll(n,t)|0;v=r;return n|0}function Cl(e){e=e|0;return(u[(_l()|0)+24>>2]|0)+(e*12|0)|0}function Ll(e,n){e=e|0;n=n|0;var r=0;r=u[n>>2]|0;n=u[n+4>>2]|0;e=e+(n>>1)|0;if(n&1)r=u[(u[e>>2]|0)+r>>2]|0;return cl(gS[r&31](e)|0)|0}function Rl(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=oa(n)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Pl(e,r,i,1);v=t;return}function Pl(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[e>>2]|0;e=Bl()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=Ol(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];sa(a,n,e,r,Il(o,t)|0,t);v=i;return}function Bl(){var e=0,n=0;if(!(t[8920]|0)){Wl(9644);Ie(32,9644,b|0)|0;n=8920;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(9644)|0)){e=9644;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));Wl(9644)}return 9644}function Ol(e){e=e|0;return 0}function Il(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[e>>2]|0;t=u[e+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Bl()|0;l=d+24|0;e=pa(n,4)|0;u[c>>2]=e;n=d+28|0;r=u[n>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Nl(r,i,e);e=(u[n>>2]|0)+12|0;u[n>>2]=e}else{Ul(l,f,c);e=u[n>>2]|0}v=s;return((e-(u[l>>2]|0)|0)/12|0)+-1|0}function Nl(e,n,r){e=e|0;n=n|0;r=r|0;var t=0;t=u[n+4>>2]|0;u[e>>2]=u[n>>2];u[e+4>>2]=t;u[e+8>>2]=r;return}function Ul(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=e+4|0;i=(((u[c>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=Fl(e)|0;if(o>>>0<i>>>0)ZA(e);else{s=u[e>>2]|0;_=((u[e+8>>2]|0)-s|0)/12|0;d=_<<1;xl(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,e+8|0);c=f+8|0;o=u[c>>2]|0;i=u[n+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[n>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];Nl(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Dl(e,f);Hl(f);v=l;return}}function Fl(e){e=e|0;return 357913941}function xl(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>357913941)je();else{i=iE(n*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r*12|0)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n*12|0);return}function Dl(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function Hl(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~(((t+-12-n|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)oE(e);return}function Wl(e){e=e|0;zl(e);return}function Yl(e){e=e|0;Vl(e+24|0);return}function Vl(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~(((n+-12-t|0)>>>0)/12|0)*12|0);oE(r)}return}function zl(e){e=e|0;var n=0;n=Sa()|0;Ra(e,2,7,n,jl()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function jl(){return 1244}function ql(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0;r=v;v=v+16|0;t=r+8|0;i=r;o=Gl(e)|0;e=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=e;u[t>>2]=u[i>>2];u[t+4>>2]=u[i+4>>2];n=Xl(n,t)|0;v=r;return n|0}function Gl(e){e=e|0;return(u[(Bl()|0)+24>>2]|0)+(e*12|0)|0}function Xl(e,n){e=e|0;n=n|0;var r=0;r=u[n>>2]|0;n=u[n+4>>2]|0;e=e+(n>>1)|0;if(n&1)r=u[(u[e>>2]|0)+r>>2]|0;return Kl(gS[r&31](e)|0)|0}function Kl(e){e=e|0;return e|0}function Jl(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=oa(n)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Zl(e,r,i,0);v=t;return}function Zl(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[e>>2]|0;e=Ql()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=$l(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];sa(a,n,e,r,es(o,t)|0,t);v=i;return}function Ql(){var e=0,n=0;if(!(t[8928]|0)){as(9680);Ie(33,9680,b|0)|0;n=8928;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(9680)|0)){e=9680;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));as(9680)}return 9680}function $l(e){e=e|0;return 0}function es(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[e>>2]|0;t=u[e+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Ql()|0;l=d+24|0;e=pa(n,4)|0;u[c>>2]=e;n=d+28|0;r=u[n>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];ns(r,i,e);e=(u[n>>2]|0)+12|0;u[n>>2]=e}else{rs(l,f,c);e=u[n>>2]|0}v=s;return((e-(u[l>>2]|0)|0)/12|0)+-1|0}function ns(e,n,r){e=e|0;n=n|0;r=r|0;var t=0;t=u[n+4>>2]|0;u[e>>2]=u[n>>2];u[e+4>>2]=t;u[e+8>>2]=r;return}function rs(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=e+4|0;i=(((u[c>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=ts(e)|0;if(o>>>0<i>>>0)ZA(e);else{s=u[e>>2]|0;_=((u[e+8>>2]|0)-s|0)/12|0;d=_<<1;is(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,e+8|0);c=f+8|0;o=u[c>>2]|0;i=u[n+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[n>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];ns(o,t,r);u[c>>2]=(u[c>>2]|0)+12;us(e,f);os(f);v=l;return}}function ts(e){e=e|0;return 357913941}function is(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>357913941)je();else{i=iE(n*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r*12|0)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n*12|0);return}function us(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function os(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~(((t+-12-n|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)oE(e);return}function as(e){e=e|0;ls(e);return}function fs(e){e=e|0;cs(e+24|0);return}function cs(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~(((n+-12-t|0)>>>0)/12|0)*12|0);oE(r)}return}function ls(e){e=e|0;var n=0;n=Sa()|0;Ra(e,2,7,n,ss()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function ss(){return 1248}function ds(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=_s(e)|0;e=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=e;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];vs(n,i,r);v=t;return}function _s(e){e=e|0;return(u[(Ql()|0)+24>>2]|0)+(e*12|0)|0}function vs(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0;o=v;v=v+16|0;i=o;t=u[n>>2]|0;n=u[n+4>>2]|0;e=e+(n>>1)|0;if(n&1)t=u[(u[e>>2]|0)+t>>2]|0;ps(i,r);i=hs(i,r)|0;wS[t&31](e,i);v=o;return}function ps(e,n){e=e|0;n=n|0;return}function hs(e,n){e=e|0;n=n|0;return bs(n)|0}function bs(e){e=e|0;return e|0}function ms(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=oa(n)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];ys(e,r,i,0);v=t;return}function ys(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[e>>2]|0;e=ws()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=gs(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];sa(a,n,e,r,Ts(o,t)|0,t);v=i;return}function ws(){var e=0,n=0;if(!(t[8936]|0)){Ls(9716);Ie(34,9716,b|0)|0;n=8936;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(9716)|0)){e=9716;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));Ls(9716)}return 9716}function gs(e){e=e|0;return 0}function Ts(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[e>>2]|0;t=u[e+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=ws()|0;l=d+24|0;e=pa(n,4)|0;u[c>>2]=e;n=d+28|0;r=u[n>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Ms(r,i,e);e=(u[n>>2]|0)+12|0;u[n>>2]=e}else{ks(l,f,c);e=u[n>>2]|0}v=s;return((e-(u[l>>2]|0)|0)/12|0)+-1|0}function Ms(e,n,r){e=e|0;n=n|0;r=r|0;var t=0;t=u[n+4>>2]|0;u[e>>2]=u[n>>2];u[e+4>>2]=t;u[e+8>>2]=r;return}function ks(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=e+4|0;i=(((u[c>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=As(e)|0;if(o>>>0<i>>>0)ZA(e);else{s=u[e>>2]|0;_=((u[e+8>>2]|0)-s|0)/12|0;d=_<<1;Es(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,e+8|0);c=f+8|0;o=u[c>>2]|0;i=u[n+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[n>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];Ms(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Ss(e,f);Cs(f);v=l;return}}function As(e){e=e|0;return 357913941}function Es(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>357913941)je();else{i=iE(n*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r*12|0)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n*12|0);return}function Ss(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function Cs(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~(((t+-12-n|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)oE(e);return}function Ls(e){e=e|0;Bs(e);return}function Rs(e){e=e|0;Ps(e+24|0);return}function Ps(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~(((n+-12-t|0)>>>0)/12|0)*12|0);oE(r)}return}function Bs(e){e=e|0;var n=0;n=Sa()|0;Ra(e,2,1,n,Os()|0,2);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function Os(){return 1256}function Is(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0;i=v;v=v+16|0;o=i+8|0;a=i;f=Ns(e)|0;e=u[f+4>>2]|0;u[a>>2]=u[f>>2];u[a+4>>2]=e;u[o>>2]=u[a>>2];u[o+4>>2]=u[a+4>>2];Us(n,o,r,t);v=i;return}function Ns(e){e=e|0;return(u[(ws()|0)+24>>2]|0)+(e*12|0)|0}function Us(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0;f=v;v=v+16|0;o=f+1|0;a=f;i=u[n>>2]|0;n=u[n+4>>2]|0;e=e+(n>>1)|0;if(n&1)i=u[(u[e>>2]|0)+i>>2]|0;ps(o,r);o=hs(o,r)|0;al(a,t);a=fl(a,t)|0;NS[i&15](e,o,a);v=f;return}function Fs(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=oa(n)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];xs(e,r,i,1);v=t;return}function xs(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[e>>2]|0;e=Ds()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=Hs(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];sa(a,n,e,r,Ws(o,t)|0,t);v=i;return}function Ds(){var e=0,n=0;if(!(t[8944]|0)){Xs(9752);Ie(35,9752,b|0)|0;n=8944;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(9752)|0)){e=9752;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));Xs(9752)}return 9752}function Hs(e){e=e|0;return 0}function Ws(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[e>>2]|0;t=u[e+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Ds()|0;l=d+24|0;e=pa(n,4)|0;u[c>>2]=e;n=d+28|0;r=u[n>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Ys(r,i,e);e=(u[n>>2]|0)+12|0;u[n>>2]=e}else{Vs(l,f,c);e=u[n>>2]|0}v=s;return((e-(u[l>>2]|0)|0)/12|0)+-1|0}function Ys(e,n,r){e=e|0;n=n|0;r=r|0;var t=0;t=u[n+4>>2]|0;u[e>>2]=u[n>>2];u[e+4>>2]=t;u[e+8>>2]=r;return}function Vs(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=e+4|0;i=(((u[c>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=zs(e)|0;if(o>>>0<i>>>0)ZA(e);else{s=u[e>>2]|0;_=((u[e+8>>2]|0)-s|0)/12|0;d=_<<1;js(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,e+8|0);c=f+8|0;o=u[c>>2]|0;i=u[n+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[n>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];Ys(o,t,r);u[c>>2]=(u[c>>2]|0)+12;qs(e,f);Gs(f);v=l;return}}function zs(e){e=e|0;return 357913941}function js(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>357913941)je();else{i=iE(n*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r*12|0)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n*12|0);return}function qs(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function Gs(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~(((t+-12-n|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)oE(e);return}function Xs(e){e=e|0;Zs(e);return}function Ks(e){e=e|0;Js(e+24|0);return}function Js(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~(((n+-12-t|0)>>>0)/12|0)*12|0);oE(r)}return}function Zs(e){e=e|0;var n=0;n=Sa()|0;Ra(e,2,1,n,Qs()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function Qs(){return 1268}function $s(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;i=v;v=v+16|0;o=i+8|0;a=i;f=ed(e)|0;e=u[f+4>>2]|0;u[a>>2]=u[f>>2];u[a+4>>2]=e;u[o>>2]=u[a>>2];u[o+4>>2]=u[a+4>>2];t=+nd(n,o,r);v=i;return+t}function ed(e){e=e|0;return(u[(Ds()|0)+24>>2]|0)+(e*12|0)|0}function nd(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;o=v;v=v+16|0;i=o;t=u[n>>2]|0;n=u[n+4>>2]|0;e=e+(n>>1)|0;if(n&1)t=u[(u[e>>2]|0)+t>>2]|0;Ef(i,r);i=Sf(i,r)|0;a=+ro(+PS[t&7](e,i));v=o;return+a}function rd(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=oa(n)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];td(e,r,i,1);v=t;return}function td(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[e>>2]|0;e=id()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=ud(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];sa(a,n,e,r,od(o,t)|0,t);v=i;return}function id(){var e=0,n=0;if(!(t[8952]|0)){_d(9788);Ie(36,9788,b|0)|0;n=8952;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(9788)|0)){e=9788;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));_d(9788)}return 9788}function ud(e){e=e|0;return 0}function od(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[e>>2]|0;t=u[e+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=id()|0;l=d+24|0;e=pa(n,4)|0;u[c>>2]=e;n=d+28|0;r=u[n>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];ad(r,i,e);e=(u[n>>2]|0)+12|0;u[n>>2]=e}else{fd(l,f,c);e=u[n>>2]|0}v=s;return((e-(u[l>>2]|0)|0)/12|0)+-1|0}function ad(e,n,r){e=e|0;n=n|0;r=r|0;var t=0;t=u[n+4>>2]|0;u[e>>2]=u[n>>2];u[e+4>>2]=t;u[e+8>>2]=r;return}function fd(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=e+4|0;i=(((u[c>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=cd(e)|0;if(o>>>0<i>>>0)ZA(e);else{s=u[e>>2]|0;_=((u[e+8>>2]|0)-s|0)/12|0;d=_<<1;ld(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,e+8|0);c=f+8|0;o=u[c>>2]|0;i=u[n+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[n>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];ad(o,t,r);u[c>>2]=(u[c>>2]|0)+12;sd(e,f);dd(f);v=l;return}}function cd(e){e=e|0;return 357913941}function ld(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>357913941)je();else{i=iE(n*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r*12|0)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n*12|0);return}function sd(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function dd(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~(((t+-12-n|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)oE(e);return}function _d(e){e=e|0;hd(e);return}function vd(e){e=e|0;pd(e+24|0);return}function pd(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~(((n+-12-t|0)>>>0)/12|0)*12|0);oE(r)}return}function hd(e){e=e|0;var n=0;n=Sa()|0;Ra(e,2,5,n,bd()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function bd(){return 1276}function md(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=yd(e)|0;e=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=e;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];r=+wd(n,i);v=t;return+r}function yd(e){e=e|0;return(u[(id()|0)+24>>2]|0)+(e*12|0)|0}function wd(e,n){e=e|0;n=n|0;var r=0;r=u[n>>2]|0;n=u[n+4>>2]|0;e=e+(n>>1)|0;if(n&1)r=u[(u[e>>2]|0)+r>>2]|0;return+ +ro(+ES[r&15](e))}function gd(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=oa(n)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Td(e,r,i,1);v=t;return}function Td(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[e>>2]|0;e=Md()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=kd(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];sa(a,n,e,r,Ad(o,t)|0,t);v=i;return}function Md(){var e=0,n=0;if(!(t[8960]|0)){Bd(9824);Ie(37,9824,b|0)|0;n=8960;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(9824)|0)){e=9824;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));Bd(9824)}return 9824}function kd(e){e=e|0;return 0}function Ad(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[e>>2]|0;t=u[e+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Md()|0;l=d+24|0;e=pa(n,4)|0;u[c>>2]=e;n=d+28|0;r=u[n>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Ed(r,i,e);e=(u[n>>2]|0)+12|0;u[n>>2]=e}else{Sd(l,f,c);e=u[n>>2]|0}v=s;return((e-(u[l>>2]|0)|0)/12|0)+-1|0}function Ed(e,n,r){e=e|0;n=n|0;r=r|0;var t=0;t=u[n+4>>2]|0;u[e>>2]=u[n>>2];u[e+4>>2]=t;u[e+8>>2]=r;return}function Sd(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=e+4|0;i=(((u[c>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=Cd(e)|0;if(o>>>0<i>>>0)ZA(e);else{s=u[e>>2]|0;_=((u[e+8>>2]|0)-s|0)/12|0;d=_<<1;Ld(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,e+8|0);c=f+8|0;o=u[c>>2]|0;i=u[n+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[n>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];Ed(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Rd(e,f);Pd(f);v=l;return}}function Cd(e){e=e|0;return 357913941}function Ld(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>357913941)je();else{i=iE(n*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r*12|0)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n*12|0);return}function Rd(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function Pd(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~(((t+-12-n|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)oE(e);return}function Bd(e){e=e|0;Nd(e);return}function Od(e){e=e|0;Id(e+24|0);return}function Id(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~(((n+-12-t|0)>>>0)/12|0)*12|0);oE(r)}return}function Nd(e){e=e|0;var n=0;n=Sa()|0;Ra(e,2,8,n,Ud()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function Ud(){return 1320}function Fd(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0;r=v;v=v+16|0;t=r+8|0;i=r;o=xd(e)|0;e=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=e;u[t>>2]=u[i>>2];u[t+4>>2]=u[i+4>>2];n=Dd(n,t)|0;v=r;return n|0}function xd(e){e=e|0;return(u[(Md()|0)+24>>2]|0)+(e*12|0)|0}function Dd(e,n){e=e|0;n=n|0;var r=0,t=0,i=0;i=v;v=v+16|0;t=i;r=u[n>>2]|0;n=u[n+4>>2]|0;e=e+(n>>1)|0;if(n&1)r=u[(u[e>>2]|0)+r>>2]|0;wS[r&31](t,e);t=Hd(t)|0;v=i;return t|0}function Hd(e){e=e|0;var n=0,r=0,t=0,i=0;i=v;v=v+32|0;n=i+12|0;r=i;t=Na(Wd()|0)|0;if(!t)e=Vd(e)|0;else{Ua(n,t);Fa(r,n);Yd(e,r);e=Da(n)|0}v=i;return e|0}function Wd(){var e=0;if(!(t[8976]|0)){e_(9872);Ie(25,9872,b|0)|0;e=8976;u[e>>2]=1;u[e+4>>2]=0}return 9872}function Yd(e,n){e=e|0;n=n|0;Xd(n,e,e+8|0)|0;return}function Vd(e){e=e|0;var n=0,r=0,t=0,i=0,o=0,a=0,f=0;r=v;v=v+16|0;i=r+4|0;a=r;t=zg(8)|0;n=t;f=iE(16)|0;u[f>>2]=u[e>>2];u[f+4>>2]=u[e+4>>2];u[f+8>>2]=u[e+8>>2];u[f+12>>2]=u[e+12>>2];o=n+4|0;u[o>>2]=f;e=iE(8)|0;o=u[o>>2]|0;u[a>>2]=0;u[i>>2]=u[a>>2];zd(e,o,i);u[t>>2]=e;v=r;return n|0}function zd(e,n,r){e=e|0;n=n|0;r=r|0;u[e>>2]=n;r=iE(16)|0;u[r+4>>2]=0;u[r+8>>2]=0;u[r>>2]=1288;u[r+12>>2]=n;u[e+4>>2]=r;return}function jd(e){e=e|0;QA(e);oE(e);return}function qd(e){e=e|0;e=u[e+12>>2]|0;if(e|0)oE(e);return}function Gd(e){e=e|0;oE(e);return}function Xd(e,n,r){e=e|0;n=n|0;r=r|0;n=Kd(u[e>>2]|0,n,r)|0;r=e+4|0;u[(u[r>>2]|0)+8>>2]=n;return u[(u[r>>2]|0)+8>>2]|0}function Kd(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0;t=v;v=v+16|0;i=t;Sk(i);e=zu(e)|0;r=Jd(e,u[n>>2]|0,+l[r>>3])|0;Lk(i);v=t;return r|0}function Jd(e,n,r){e=e|0;n=n|0;r=+r;var t=0;t=Gu(Zd()|0)|0;n=Ku(n)|0;return Ee(0,t|0,e|0,n|0,+ +Xu(r))|0}function Zd(){var e=0;if(!(t[8968]|0)){Qd(9860);e=8968;u[e>>2]=1;u[e+4>>2]=0}return 9860}function Qd(e){e=e|0;uo(e,$d()|0,2);return}function $d(){return 1308}function e_(e){e=e|0;tf(e);return}function n_(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=oa(n)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];r_(e,r,i,1);v=t;return}function r_(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[e>>2]|0;e=t_()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=i_(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];sa(a,n,e,r,u_(o,t)|0,t);v=i;return}function t_(){var e=0,n=0;if(!(t[8984]|0)){d_(9916);Ie(38,9916,b|0)|0;n=8984;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(9916)|0)){e=9916;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));d_(9916)}return 9916}function i_(e){e=e|0;return 0}function u_(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[e>>2]|0;t=u[e+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=t_()|0;l=d+24|0;e=pa(n,4)|0;u[c>>2]=e;n=d+28|0;r=u[n>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];o_(r,i,e);e=(u[n>>2]|0)+12|0;u[n>>2]=e}else{a_(l,f,c);e=u[n>>2]|0}v=s;return((e-(u[l>>2]|0)|0)/12|0)+-1|0}function o_(e,n,r){e=e|0;n=n|0;r=r|0;var t=0;t=u[n+4>>2]|0;u[e>>2]=u[n>>2];u[e+4>>2]=t;u[e+8>>2]=r;return}function a_(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=e+4|0;i=(((u[c>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=f_(e)|0;if(o>>>0<i>>>0)ZA(e);else{s=u[e>>2]|0;_=((u[e+8>>2]|0)-s|0)/12|0;d=_<<1;c_(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,e+8|0);c=f+8|0;o=u[c>>2]|0;i=u[n+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[n>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];o_(o,t,r);u[c>>2]=(u[c>>2]|0)+12;l_(e,f);s_(f);v=l;return}}function f_(e){e=e|0;return 357913941}function c_(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>357913941)je();else{i=iE(n*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r*12|0)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n*12|0);return}function l_(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function s_(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~(((t+-12-n|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)oE(e);return}function d_(e){e=e|0;p_(e);return}function __(e){e=e|0;v_(e+24|0);return}function v_(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~(((n+-12-t|0)>>>0)/12|0)*12|0);oE(r)}return}function p_(e){e=e|0;var n=0;n=Sa()|0;Ra(e,2,6,n,h_()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function h_(){return 1324}function b_(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=m_(e)|0;e=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=e;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];r=y_(n,i,r)|0;v=t;return r|0}function m_(e){e=e|0;return(u[(t_()|0)+24>>2]|0)+(e*12|0)|0}function y_(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;a=v;v=v+32|0;i=a;o=a+16|0;t=u[n>>2]|0;n=u[n+4>>2]|0;e=e+(n>>1)|0;if(n&1)t=u[(u[e>>2]|0)+t>>2]|0;Ef(o,r);o=Sf(o,r)|0;NS[t&15](i,e,o);o=Hd(i)|0;v=a;return o|0}function w_(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=oa(n)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];g_(e,r,i,1);v=t;return}function g_(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[e>>2]|0;e=T_()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=M_(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];sa(a,n,e,r,k_(o,t)|0,t);v=i;return}function T_(){var e=0,n=0;if(!(t[8992]|0)){P_(9952);Ie(39,9952,b|0)|0;n=8992;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(9952)|0)){e=9952;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));P_(9952)}return 9952}function M_(e){e=e|0;return 0}function k_(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[e>>2]|0;t=u[e+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=T_()|0;l=d+24|0;e=pa(n,4)|0;u[c>>2]=e;n=d+28|0;r=u[n>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];A_(r,i,e);e=(u[n>>2]|0)+12|0;u[n>>2]=e}else{E_(l,f,c);e=u[n>>2]|0}v=s;return((e-(u[l>>2]|0)|0)/12|0)+-1|0}function A_(e,n,r){e=e|0;n=n|0;r=r|0;var t=0;t=u[n+4>>2]|0;u[e>>2]=u[n>>2];u[e+4>>2]=t;u[e+8>>2]=r;return}function E_(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=e+4|0;i=(((u[c>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=S_(e)|0;if(o>>>0<i>>>0)ZA(e);else{s=u[e>>2]|0;_=((u[e+8>>2]|0)-s|0)/12|0;d=_<<1;C_(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,e+8|0);c=f+8|0;o=u[c>>2]|0;i=u[n+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[n>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];A_(o,t,r);u[c>>2]=(u[c>>2]|0)+12;L_(e,f);R_(f);v=l;return}}function S_(e){e=e|0;return 357913941}function C_(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>357913941)je();else{i=iE(n*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r*12|0)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n*12|0);return}function L_(e,n){
e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function R_(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~(((t+-12-n|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)oE(e);return}function P_(e){e=e|0;I_(e);return}function B_(e){e=e|0;O_(e+24|0);return}function O_(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~(((n+-12-t|0)>>>0)/12|0)*12|0);oE(r)}return}function I_(e){e=e|0;var n=0;n=Sa()|0;Ra(e,2,9,n,N_()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function N_(){return 1332}function U_(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0;r=v;v=v+16|0;t=r+8|0;i=r;o=F_(e)|0;e=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=e;u[t>>2]=u[i>>2];u[t+4>>2]=u[i+4>>2];n=x_(n,t)|0;v=r;return n|0}function F_(e){e=e|0;return(u[(T_()|0)+24>>2]|0)+(e*12|0)|0}function x_(e,n){e=e|0;n=n|0;var r=0;r=u[n>>2]|0;n=u[n+4>>2]|0;e=e+(n>>1)|0;if(n&1)r=u[(u[e>>2]|0)+r>>2]|0;return no(gS[r&31](e)|0)|0}function D_(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=oa(n)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];H_(e,r,i,0);v=t;return}function H_(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[e>>2]|0;e=W_()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=Y_(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];sa(a,n,e,r,V_(o,t)|0,t);v=i;return}function W_(){var e=0,n=0;if(!(t[9e3]|0)){J_(9988);Ie(40,9988,b|0)|0;n=9e3;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(9988)|0)){e=9988;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));J_(9988)}return 9988}function Y_(e){e=e|0;return 0}function V_(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[e>>2]|0;t=u[e+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=W_()|0;l=d+24|0;e=pa(n,4)|0;u[c>>2]=e;n=d+28|0;r=u[n>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];z_(r,i,e);e=(u[n>>2]|0)+12|0;u[n>>2]=e}else{j_(l,f,c);e=u[n>>2]|0}v=s;return((e-(u[l>>2]|0)|0)/12|0)+-1|0}function z_(e,n,r){e=e|0;n=n|0;r=r|0;var t=0;t=u[n+4>>2]|0;u[e>>2]=u[n>>2];u[e+4>>2]=t;u[e+8>>2]=r;return}function j_(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=e+4|0;i=(((u[c>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=q_(e)|0;if(o>>>0<i>>>0)ZA(e);else{s=u[e>>2]|0;_=((u[e+8>>2]|0)-s|0)/12|0;d=_<<1;G_(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,e+8|0);c=f+8|0;o=u[c>>2]|0;i=u[n+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[n>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];z_(o,t,r);u[c>>2]=(u[c>>2]|0)+12;X_(e,f);K_(f);v=l;return}}function q_(e){e=e|0;return 357913941}function G_(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>357913941)je();else{i=iE(n*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r*12|0)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n*12|0);return}function X_(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function K_(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~(((t+-12-n|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)oE(e);return}function J_(e){e=e|0;$_(e);return}function Z_(e){e=e|0;Q_(e+24|0);return}function Q_(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~(((n+-12-t|0)>>>0)/12|0)*12|0);oE(r)}return}function $_(e){e=e|0;var n=0;n=Sa()|0;Ra(e,2,8,n,ev()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function ev(){return 1336}function nv(e,n,r){e=e|0;n=n|0;r=+r;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=rv(e)|0;e=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=e;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];tv(n,i,r);v=t;return}function rv(e){e=e|0;return(u[(W_()|0)+24>>2]|0)+(e*12|0)|0}function tv(e,n,r){e=e|0;n=n|0;r=+r;var t=0,i=0,o=0;o=v;v=v+16|0;i=o;t=u[n>>2]|0;n=u[n+4>>2]|0;e=e+(n>>1)|0;if(n&1)t=u[(u[e>>2]|0)+t>>2]|0;kf(i,r);r=+Af(i,r);bS[t&31](e,r);v=o;return}function iv(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=oa(n)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];uv(e,r,i,0);v=t;return}function uv(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[e>>2]|0;e=ov()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=av(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];sa(a,n,e,r,fv(o,t)|0,t);v=i;return}function ov(){var e=0,n=0;if(!(t[9008]|0)){pv(10024);Ie(41,10024,b|0)|0;n=9008;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(10024)|0)){e=10024;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));pv(10024)}return 10024}function av(e){e=e|0;return 0}function fv(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[e>>2]|0;t=u[e+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=ov()|0;l=d+24|0;e=pa(n,4)|0;u[c>>2]=e;n=d+28|0;r=u[n>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];cv(r,i,e);e=(u[n>>2]|0)+12|0;u[n>>2]=e}else{lv(l,f,c);e=u[n>>2]|0}v=s;return((e-(u[l>>2]|0)|0)/12|0)+-1|0}function cv(e,n,r){e=e|0;n=n|0;r=r|0;var t=0;t=u[n+4>>2]|0;u[e>>2]=u[n>>2];u[e+4>>2]=t;u[e+8>>2]=r;return}function lv(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=e+4|0;i=(((u[c>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=sv(e)|0;if(o>>>0<i>>>0)ZA(e);else{s=u[e>>2]|0;_=((u[e+8>>2]|0)-s|0)/12|0;d=_<<1;dv(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,e+8|0);c=f+8|0;o=u[c>>2]|0;i=u[n+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[n>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];cv(o,t,r);u[c>>2]=(u[c>>2]|0)+12;_v(e,f);vv(f);v=l;return}}function sv(e){e=e|0;return 357913941}function dv(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>357913941)je();else{i=iE(n*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r*12|0)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n*12|0);return}function _v(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function vv(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~(((t+-12-n|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)oE(e);return}function pv(e){e=e|0;mv(e);return}function hv(e){e=e|0;bv(e+24|0);return}function bv(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~(((n+-12-t|0)>>>0)/12|0)*12|0);oE(r)}return}function mv(e){e=e|0;var n=0;n=Sa()|0;Ra(e,2,1,n,yv()|0,2);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function yv(){return 1344}function wv(e,n,r,t){e=e|0;n=n|0;r=r|0;t=+t;var i=0,o=0,a=0,f=0;i=v;v=v+16|0;o=i+8|0;a=i;f=gv(e)|0;e=u[f+4>>2]|0;u[a>>2]=u[f>>2];u[a+4>>2]=e;u[o>>2]=u[a>>2];u[o+4>>2]=u[a+4>>2];Tv(n,o,r,t);v=i;return}function gv(e){e=e|0;return(u[(ov()|0)+24>>2]|0)+(e*12|0)|0}function Tv(e,n,r,t){e=e|0;n=n|0;r=r|0;t=+t;var i=0,o=0,a=0,f=0;f=v;v=v+16|0;o=f+1|0;a=f;i=u[n>>2]|0;n=u[n+4>>2]|0;e=e+(n>>1)|0;if(n&1)i=u[(u[e>>2]|0)+i>>2]|0;Ef(o,r);o=Sf(o,r)|0;kf(a,t);t=+Af(a,t);FS[i&15](e,o,t);v=f;return}function Mv(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=oa(n)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];kv(e,r,i,0);v=t;return}function kv(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[e>>2]|0;e=Av()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=Ev(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];sa(a,n,e,r,Sv(o,t)|0,t);v=i;return}function Av(){var e=0,n=0;if(!(t[9016]|0)){Iv(10060);Ie(42,10060,b|0)|0;n=9016;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(10060)|0)){e=10060;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));Iv(10060)}return 10060}function Ev(e){e=e|0;return 0}function Sv(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[e>>2]|0;t=u[e+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Av()|0;l=d+24|0;e=pa(n,4)|0;u[c>>2]=e;n=d+28|0;r=u[n>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Cv(r,i,e);e=(u[n>>2]|0)+12|0;u[n>>2]=e}else{Lv(l,f,c);e=u[n>>2]|0}v=s;return((e-(u[l>>2]|0)|0)/12|0)+-1|0}function Cv(e,n,r){e=e|0;n=n|0;r=r|0;var t=0;t=u[n+4>>2]|0;u[e>>2]=u[n>>2];u[e+4>>2]=t;u[e+8>>2]=r;return}function Lv(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=e+4|0;i=(((u[c>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=Rv(e)|0;if(o>>>0<i>>>0)ZA(e);else{s=u[e>>2]|0;_=((u[e+8>>2]|0)-s|0)/12|0;d=_<<1;Pv(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,e+8|0);c=f+8|0;o=u[c>>2]|0;i=u[n+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[n>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];Cv(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Bv(e,f);Ov(f);v=l;return}}function Rv(e){e=e|0;return 357913941}function Pv(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>357913941)je();else{i=iE(n*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r*12|0)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n*12|0);return}function Bv(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function Ov(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~(((t+-12-n|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)oE(e);return}function Iv(e){e=e|0;Fv(e);return}function Nv(e){e=e|0;Uv(e+24|0);return}function Uv(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~(((n+-12-t|0)>>>0)/12|0)*12|0);oE(r)}return}function Fv(e){e=e|0;var n=0;n=Sa()|0;Ra(e,2,8,n,xv()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function xv(){return 1356}function Dv(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=Hv(e)|0;e=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=e;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Wv(n,i,r);v=t;return}function Hv(e){e=e|0;return(u[(Av()|0)+24>>2]|0)+(e*12|0)|0}function Wv(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0;o=v;v=v+16|0;i=o;t=u[n>>2]|0;n=u[n+4>>2]|0;e=e+(n>>1)|0;if(n&1)t=u[(u[e>>2]|0)+t>>2]|0;Ef(i,r);i=Sf(i,r)|0;wS[t&31](e,i);v=o;return}function Yv(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=oa(n)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Vv(e,r,i,0);v=t;return}function Vv(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[e>>2]|0;e=zv()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=jv(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];sa(a,n,e,r,qv(o,t)|0,t);v=i;return}function zv(){var e=0,n=0;if(!(t[9024]|0)){$v(10096);Ie(43,10096,b|0)|0;n=9024;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(10096)|0)){e=10096;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));$v(10096)}return 10096}function jv(e){e=e|0;return 0}function qv(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[e>>2]|0;t=u[e+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=zv()|0;l=d+24|0;e=pa(n,4)|0;u[c>>2]=e;n=d+28|0;r=u[n>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Gv(r,i,e);e=(u[n>>2]|0)+12|0;u[n>>2]=e}else{Xv(l,f,c);e=u[n>>2]|0}v=s;return((e-(u[l>>2]|0)|0)/12|0)+-1|0}function Gv(e,n,r){e=e|0;n=n|0;r=r|0;var t=0;t=u[n+4>>2]|0;u[e>>2]=u[n>>2];u[e+4>>2]=t;u[e+8>>2]=r;return}function Xv(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=e+4|0;i=(((u[c>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=Kv(e)|0;if(o>>>0<i>>>0)ZA(e);else{s=u[e>>2]|0;_=((u[e+8>>2]|0)-s|0)/12|0;d=_<<1;Jv(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,e+8|0);c=f+8|0;o=u[c>>2]|0;i=u[n+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[n>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];Gv(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Zv(e,f);Qv(f);v=l;return}}function Kv(e){e=e|0;return 357913941}function Jv(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>357913941)je();else{i=iE(n*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r*12|0)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n*12|0);return}function Zv(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function Qv(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~(((t+-12-n|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)oE(e);return}function $v(e){e=e|0;rp(e);return}function ep(e){e=e|0;np(e+24|0);return}function np(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~(((n+-12-t|0)>>>0)/12|0)*12|0);oE(r)}return}function rp(e){e=e|0;var n=0;n=Sa()|0;Ra(e,2,9,n,tp()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function tp(){return 1364}function ip(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=up(e)|0;e=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=e;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];op(n,i,r);v=t;return}function up(e){e=e|0;return(u[(zv()|0)+24>>2]|0)+(e*12|0)|0}function op(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0;o=v;v=v+16|0;i=o;t=u[n>>2]|0;n=u[n+4>>2]|0;e=e+(n>>1)|0;if(n&1)t=u[(u[e>>2]|0)+t>>2]|0;ap(i,r);i=fp(i,r)|0;wS[t&31](e,i);v=o;return}function ap(e,n){e=e|0;n=n|0;return}function fp(e,n){e=e|0;n=n|0;return cp(n)|0}function cp(e){e=e|0;return e|0}function lp(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=oa(n)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];sp(e,r,i,0);v=t;return}function sp(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[e>>2]|0;e=dp()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=_p(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];sa(a,n,e,r,vp(o,t)|0,t);v=i;return}function dp(){var e=0,n=0;if(!(t[9032]|0)){gp(10132);Ie(44,10132,b|0)|0;n=9032;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(10132)|0)){e=10132;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));gp(10132)}return 10132}function _p(e){e=e|0;return 0}function vp(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[e>>2]|0;t=u[e+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=dp()|0;l=d+24|0;e=pa(n,4)|0;u[c>>2]=e;n=d+28|0;r=u[n>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];pp(r,i,e);e=(u[n>>2]|0)+12|0;u[n>>2]=e}else{hp(l,f,c);e=u[n>>2]|0}v=s;return((e-(u[l>>2]|0)|0)/12|0)+-1|0}function pp(e,n,r){e=e|0;n=n|0;r=r|0;var t=0;t=u[n+4>>2]|0;u[e>>2]=u[n>>2];u[e+4>>2]=t;u[e+8>>2]=r;return}function hp(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=e+4|0;i=(((u[c>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=bp(e)|0;if(o>>>0<i>>>0)ZA(e);else{s=u[e>>2]|0;_=((u[e+8>>2]|0)-s|0)/12|0;d=_<<1;mp(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,e+8|0);c=f+8|0;o=u[c>>2]|0;i=u[n+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[n>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];pp(o,t,r);u[c>>2]=(u[c>>2]|0)+12;yp(e,f);wp(f);v=l;return}}function bp(e){e=e|0;return 357913941}function mp(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>357913941)je();else{i=iE(n*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r*12|0)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n*12|0);return}function yp(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function wp(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~(((t+-12-n|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)oE(e);return}function gp(e){e=e|0;kp(e);return}function Tp(e){e=e|0;Mp(e+24|0);return}function Mp(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~(((n+-12-t|0)>>>0)/12|0)*12|0);oE(r)}return}function kp(e){e=e|0;var n=0;n=Sa()|0;Ra(e,2,24,n,Ap()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function Ap(){return 1388}function Ep(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0;r=v;v=v+16|0;t=r+8|0;i=r;o=Sp(e)|0;e=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=e;u[t>>2]=u[i>>2];u[t+4>>2]=u[i+4>>2];Cp(n,t);v=r;return}function Sp(e){e=e|0;return(u[(dp()|0)+24>>2]|0)+(e*12|0)|0}function Cp(e,n){e=e|0;n=n|0;var r=0;r=u[n>>2]|0;n=u[n+4>>2]|0;e=e+(n>>1)|0;if(n&1)r=u[(u[e>>2]|0)+r>>2]|0;yS[r&127](e);return}function Lp(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0;o=u[e>>2]|0;i=Rp()|0;e=Pp(r)|0;sa(o,n,i,e,Bp(r,t)|0,t);return}function Rp(){var e=0,n=0;if(!(t[9040]|0)){Dp(10168);Ie(45,10168,b|0)|0;n=9040;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(10168)|0)){e=10168;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));Dp(10168)}return 10168}function Pp(e){e=e|0;return e|0}function Bp(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=e;c=Rp()|0;a=c+24|0;n=pa(n,4)|0;u[o>>2]=n;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){Op(t,e,n);n=(u[r>>2]|0)+8|0;u[r>>2]=n}else{Ip(a,i,o);n=u[r>>2]|0}v=f;return(n-(u[a>>2]|0)>>3)+-1|0}function Op(e,n,r){e=e|0;n=n|0;r=r|0;u[e>>2]=n;u[e+4>>2]=r;return}function Ip(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=e+4|0;a=((u[o>>2]|0)-(u[e>>2]|0)>>3)+1|0;t=Np(e)|0;if(t>>>0<a>>>0)ZA(e);else{c=u[e>>2]|0;s=(u[e+8>>2]|0)-c|0;l=s>>2;Up(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,e+8|0);a=i+8|0;Op(u[a>>2]|0,u[n>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;Fp(e,i);xp(i);v=f;return}}function Np(e){e=e|0;return 536870911}function Up(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>536870911)je();else{i=iE(n<<3)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r<<3)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n<<3);return}function Fp(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function xp(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~((t+-8-n|0)>>>3)<<3);e=u[e>>2]|0;if(e|0)oE(e);return}function Dp(e){e=e|0;Yp(e);return}function Hp(e){e=e|0;Wp(e+24|0);return}function Wp(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~((n+-8-t|0)>>>3)<<3);oE(r)}return}function Yp(e){e=e|0;var n=0;n=Sa()|0;Ra(e,1,25,n,ss()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function Vp(e,n){e=e|0;n=n|0;jp(u[(zp(e)|0)>>2]|0,n);return}function zp(e){e=e|0;return(u[(Rp()|0)+24>>2]|0)+(e<<3)|0}function jp(e,n){e=e|0;n=n|0;var r=0,t=0;r=v;v=v+16|0;t=r;ps(t,n);n=hs(t,n)|0;yS[e&127](n);v=r;return}function qp(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0;o=u[e>>2]|0;i=Gp()|0;e=Xp(r)|0;sa(o,n,i,e,Kp(r,t)|0,t);return}function Gp(){var e=0,n=0;if(!(t[9048]|0)){rh(10204);Ie(46,10204,b|0)|0;n=9048;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(10204)|0)){e=10204;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));rh(10204)}return 10204}function Xp(e){e=e|0;return e|0}function Kp(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=e;c=Gp()|0;a=c+24|0;n=pa(n,4)|0;u[o>>2]=n;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){Jp(t,e,n);n=(u[r>>2]|0)+8|0;u[r>>2]=n}else{Zp(a,i,o);n=u[r>>2]|0}v=f;return(n-(u[a>>2]|0)>>3)+-1|0}function Jp(e,n,r){e=e|0;n=n|0;r=r|0;u[e>>2]=n;u[e+4>>2]=r;return}function Zp(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=e+4|0;a=((u[o>>2]|0)-(u[e>>2]|0)>>3)+1|0;t=Qp(e)|0;if(t>>>0<a>>>0)ZA(e);else{c=u[e>>2]|0;s=(u[e+8>>2]|0)-c|0;l=s>>2;$p(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,e+8|0);a=i+8|0;Jp(u[a>>2]|0,u[n>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;eh(e,i);nh(i);v=f;return}}function Qp(e){e=e|0;return 536870911}function $p(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>536870911)je();else{i=iE(n<<3)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r<<3)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n<<3);return}function eh(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function nh(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~((t+-8-n|0)>>>3)<<3);e=u[e>>2]|0;if(e|0)oE(e);return}function rh(e){e=e|0;uh(e);return}function th(e){e=e|0;ih(e+24|0);return}function ih(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~((n+-8-t|0)>>>3)<<3);oE(r)}return}function uh(e){e=e|0;var n=0;n=Sa()|0;Ra(e,1,17,n,El()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function oh(e){e=e|0;return fh(u[(ah(e)|0)>>2]|0)|0}function ah(e){e=e|0;return(u[(Gp()|0)+24>>2]|0)+(e<<3)|0}function fh(e){e=e|0;return cl(BS[e&7]()|0)|0}function ch(){var e=0;if(!(t[9064]|0)){yh(10248);Ie(25,10248,b|0)|0;e=9064;u[e>>2]=1;u[e+4>>2]=0}return 10248}function lh(e,n){e=e|0;n=n|0;u[e>>2]=sh()|0;u[e+4>>2]=dh()|0;u[e+12>>2]=n;u[e+8>>2]=_h()|0;u[e+32>>2]=2;return}function sh(){return 11752}function dh(){return 1232}function _h(){return bh()|0}function vh(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;if((ph(t,896)|0)==512){if(r|0){hh(r);oE(r)}}else if(n|0){wi(n);oE(n)}return}function ph(e,n){e=e|0;n=n|0;return n&e|0}function hh(e){e=e|0;e=u[e+4>>2]|0;if(e|0)rE(e);return}function bh(){var e=0;if(!(t[9056]|0)){u[2560]=mh()|0;u[2561]=0;e=9056;u[e>>2]=1;u[e+4>>2]=0}return 10240}function mh(){return 0}function yh(e){e=e|0;tf(e);return}function wh(e){e=e|0;gh(e,6092);Th(e)|0;Mh(e)|0;return}function gh(e,n){e=e|0;n=n|0;var r=0;r=Wd()|0;u[e>>2]=r;Kh(r,n);vy(u[e>>2]|0);return}function Th(e){e=e|0;var n=0;n=u[e>>2]|0;Ah(n,Fh()|0);return e|0}function Mh(e){e=e|0;var n=0;n=u[e>>2]|0;Ah(n,kh()|0);return e|0}function kh(){var e=0;if(!(t[9072]|0)){Eh(10296);Ie(47,10296,b|0)|0;e=9072;u[e>>2]=1;u[e+4>>2]=0}if(!(ka(10296)|0))Eh(10296);return 10296}function Ah(e,n){e=e|0;n=n|0;sa(e,0,n,0,0,0);return}function Eh(e){e=e|0;Lh(e);Ph(e,9);return}function Sh(e){e=e|0;Ch(e+24|0);return}function Ch(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~((n+-8-t|0)>>>3)<<3);oE(r)}return}function Lh(e){e=e|0;var n=0;n=Sa()|0;Ra(e,5,1,n,Ih()|0,2);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function Rh(e,n,r){e=e|0;n=n|0;r=+r;Bh(e,n,r);return}function Ph(e,n){e=e|0;n=n|0;u[e+20>>2]=n;return}function Bh(e,n,r){e=e|0;n=n|0;r=+r;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;o=t+8|0;f=t+13|0;i=t;a=t+12|0;Ef(f,n);u[o>>2]=Sf(f,n)|0;kf(a,r);l[i>>3]=+Af(a,r);Oh(e,o,i);v=t;return}function Oh(e,n,r){e=e|0;n=n|0;r=r|0;du(e+8|0,u[n>>2]|0,+l[r>>3]);t[e+24>>0]=1;return}function Ih(){return 1392}function Nh(e,n){e=e|0;n=+n;return Uh(e,n)|0}function Uh(e,n){e=e|0;n=+n;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;t=v;v=v+16|0;o=t+4|0;a=t+8|0;f=t;i=zg(8)|0;r=i;c=iE(16)|0;Ef(o,e);e=Sf(o,e)|0;kf(a,n);du(c,e,+Af(a,n));a=r+4|0;u[a>>2]=c;e=iE(8)|0;a=u[a>>2]|0;u[f>>2]=0;u[o>>2]=u[f>>2];zd(e,a,o);u[i>>2]=e;v=t;return r|0}function Fh(){var e=0;if(!(t[9080]|0)){xh(10332);Ie(48,10332,b|0)|0;e=9080;u[e>>2]=1;u[e+4>>2]=0}if(!(ka(10332)|0))xh(10332);return 10332}function xh(e){e=e|0;Wh(e);Ph(e,49);return}function Dh(e){e=e|0;Hh(e+24|0);return}function Hh(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~((n+-8-t|0)>>>3)<<3);oE(r)}return}function Wh(e){e=e|0;var n=0;n=Sa()|0;Ra(e,5,3,n,qh()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function Yh(e){e=e|0;Vh(e);return}function Vh(e){e=e|0;zh(e);return}function zh(e){e=e|0;jh(e+8|0);t[e+24>>0]=1;return}function jh(e){e=e|0;u[e>>2]=0;l[e+8>>3]=0;return}function qh(){return 1412}function Gh(){return Xh()|0}function Xh(){var e=0,n=0,r=0,t=0,i=0,o=0,a=0;n=v;v=v+16|0;i=n+4|0;a=n;r=zg(8)|0;e=r;t=iE(16)|0;jh(t);o=e+4|0;u[o>>2]=t;t=iE(8)|0;o=u[o>>2]|0;u[a>>2]=0;u[i>>2]=u[a>>2];zd(t,o,i);u[r>>2]=t;v=n;return e|0}function Kh(e,n){e=e|0;n=n|0;u[e>>2]=Jh()|0;u[e+4>>2]=Zh()|0;u[e+12>>2]=n;u[e+8>>2]=Qh()|0;u[e+32>>2]=3;return}function Jh(){return 11753}function Zh(){return 1404}function Qh(){return nb()|0}function $h(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;if((ph(t,896)|0)==512){if(r|0){eb(r);oE(r)}}else if(n|0)oE(n);return}function eb(e){e=e|0;e=u[e+4>>2]|0;if(e|0)rE(e);return}function nb(){var e=0;if(!(t[9088]|0)){u[2592]=rb()|0;u[2593]=0;e=9088;u[e>>2]=1;u[e+4>>2]=0}return 10368}function rb(){return u[354]|0}function tb(e){e=e|0;ib(e,6098);ub(e)|0;return}function ib(e,n){e=e|0;n=n|0;var r=0;r=Ia()|0;u[e>>2]=r;bb(r,n);vy(u[e>>2]|0);return}function ub(e){e=e|0;var n=0;n=u[e>>2]|0;Ah(n,ob()|0);return e|0}function ob(){var e=0;if(!(t[9096]|0)){ab(10380);Ie(50,10380,b|0)|0;e=9096;u[e>>2]=1;u[e+4>>2]=0}if(!(ka(10380)|0))ab(10380);return 10380}function ab(e){e=e|0;lb(e);Ph(e,51);return}function fb(e){e=e|0;cb(e+24|0);return}function cb(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~((n+-8-t|0)>>>3)<<3);oE(r)}return}function lb(e){e=e|0;var n=0;n=Sa()|0;Ra(e,5,4,n,vb()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function sb(e){e=e|0;db(e);return}function db(e){e=e|0;_b(e);return}function _b(e){e=e|0;var n=0,r=0;n=e+8|0;r=n+48|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(r|0));t[e+56>>0]=1;return}function vb(){return 1420}function pb(){return hb()|0}function hb(){var e=0,n=0,r=0,t=0,i=0,o=0,a=0,f=0;a=v;v=v+16|0;e=a+4|0;n=a;r=zg(8)|0;t=r;i=iE(48)|0;o=i;f=o+48|0;do{u[o>>2]=0;o=o+4|0}while((o|0)<(f|0));o=t+4|0;u[o>>2]=i;f=iE(8)|0;o=u[o>>2]|0;u[n>>2]=0;u[e>>2]=u[n>>2];Wa(f,o,e);u[r>>2]=f;v=a;return t|0}function bb(e,n){e=e|0;n=n|0;u[e>>2]=mb()|0;u[e+4>>2]=yb()|0;u[e+12>>2]=n;u[e+8>>2]=wb()|0;u[e+32>>2]=4;return}function mb(){return 11747}function yb(){return 1424}function wb(){return nb()|0}function gb(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;if((ph(t,896)|0)==512){if(r|0){Tb(r);oE(r)}}else if(n|0)oE(n);return}function Tb(e){e=e|0;e=u[e+4>>2]|0;if(e|0)rE(e);return}function Mb(e){e=e|0;kb(e,6105);Ab(e)|0;Eb(e)|0;return}function kb(e,n){e=e|0;n=n|0;var r=0;r=nm()|0;u[e>>2]=r;rm(r,n);vy(u[e>>2]|0);return}function Ab(e){e=e|0;var n=0;n=u[e>>2]|0;Ah(n,Vb()|0);return e|0}function Eb(e){e=e|0;var n=0;n=u[e>>2]|0;Ah(n,Sb()|0);return e|0}function Sb(){var e=0;if(!(t[9104]|0)){Cb(10420);Ie(52,10420,b|0)|0;e=9104;u[e>>2]=1;u[e+4>>2]=0}if(!(ka(10420)|0))Cb(10420);return 10420}function Cb(e){e=e|0;Pb(e);Ph(e,1);return}function Lb(e){e=e|0;Rb(e+24|0);return}function Rb(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~((n+-8-t|0)>>>3)<<3);oE(r)}return}function Pb(e){e=e|0;var n=0;n=Sa()|0;Ra(e,5,1,n,Ub()|0,2);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function Bb(e,n,r){e=e|0;n=+n;r=+r;Ob(e,n,r);return}function Ob(e,n,r){e=e|0;n=+n;r=+r;var t=0,i=0,u=0,o=0,a=0;t=v;v=v+32|0;u=t+8|0;a=t+17|0;i=t;o=t+16|0;kf(a,n);l[u>>3]=+Af(a,n);kf(o,r);l[i>>3]=+Af(o,r);Ib(e,u,i);v=t;return}function Ib(e,n,r){e=e|0;n=n|0;r=r|0;Nb(e+8|0,+l[n>>3],+l[r>>3]);t[e+24>>0]=1;return}function Nb(e,n,r){e=e|0;n=+n;r=+r;l[e>>3]=n;l[e+8>>3]=r;return}function Ub(){return 1460}function Fb(e,n){e=+e;n=+n;return xb(e,n)|0}function xb(e,n){e=+e;n=+n;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;t=v;v=v+16|0;a=t+4|0;f=t+8|0;c=t;i=zg(8)|0;r=i;o=iE(16)|0;kf(a,e);e=+Af(a,e);kf(f,n);Nb(o,e,+Af(f,n));f=r+4|0;u[f>>2]=o;o=iE(8)|0;f=u[f>>2]|0;u[c>>2]=0;u[a>>2]=u[c>>2];Db(o,f,a);u[i>>2]=o;v=t;return r|0}function Db(e,n,r){e=e|0;n=n|0;r=r|0;u[e>>2]=n;r=iE(16)|0;u[r+4>>2]=0;u[r+8>>2]=0;u[r>>2]=1440;u[r+12>>2]=n;u[e+4>>2]=r;return}function Hb(e){e=e|0;QA(e);oE(e);return}function Wb(e){e=e|0;e=u[e+12>>2]|0;if(e|0)oE(e);return}function Yb(e){e=e|0;oE(e);return}function Vb(){var e=0;if(!(t[9112]|0)){zb(10456);Ie(53,10456,b|0)|0;e=9112;u[e>>2]=1;u[e+4>>2]=0}if(!(ka(10456)|0))zb(10456);return 10456}function zb(e){e=e|0;Gb(e);Ph(e,54);return}function jb(e){e=e|0;qb(e+24|0);return}function qb(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~((n+-8-t|0)>>>3)<<3);oE(r)}return}function Gb(e){e=e|0;var n=0;n=Sa()|0;Ra(e,5,5,n,Qb()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function Xb(e){e=e|0;Kb(e);return}function Kb(e){e=e|0;Jb(e);return}function Jb(e){e=e|0;Zb(e+8|0);t[e+24>>0]=1;return}function Zb(e){e=e|0;u[e>>2]=0;u[e+4>>2]=0;u[e+8>>2]=0;u[e+12>>2]=0;return}function Qb(){return 1480}function $b(){return em()|0}function em(){var e=0,n=0,r=0,t=0,i=0,o=0,a=0;n=v;v=v+16|0;i=n+4|0;a=n;r=zg(8)|0;e=r;t=iE(16)|0;Zb(t);o=e+4|0;u[o>>2]=t;t=iE(8)|0;o=u[o>>2]|0;u[a>>2]=0;u[i>>2]=u[a>>2];Db(t,o,i);u[r>>2]=t;v=n;return e|0}function nm(){var e=0;if(!(t[9120]|0)){fm(10492);Ie(25,10492,b|0)|0;e=9120;u[e>>2]=1;u[e+4>>2]=0}return 10492}function rm(e,n){e=e|0;n=n|0;u[e>>2]=tm()|0;u[e+4>>2]=im()|0;u[e+12>>2]=n;u[e+8>>2]=um()|0;u[e+32>>2]=5;return}function tm(){return 11743}function im(){return 1472}function um(){return nb()|0}function om(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;if((ph(t,896)|0)==512){if(r|0){am(r);oE(r)}}else if(n|0)oE(n);return}function am(e){e=e|0;e=u[e+4>>2]|0;if(e|0)rE(e);return}function fm(e){e=e|0;tf(e);return}function cm(e,n,r){e=e|0;n=n|0;r=r|0;e=oa(n)|0;n=lm(r)|0;r=sm(r,0)|0;By(e,n,r,dm()|0,0);return}function lm(e){e=e|0;return e|0}function sm(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=e;c=dm()|0;a=c+24|0;n=pa(n,4)|0;u[o>>2]=n;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){wm(t,e,n);n=(u[r>>2]|0)+8|0;u[r>>2]=n}else{gm(a,i,o);n=u[r>>2]|0}v=f;return(n-(u[a>>2]|0)>>3)+-1|0}function dm(){var e=0,n=0;if(!(t[9128]|0)){_m(10536);Ie(55,10536,b|0)|0;n=9128;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(10536)|0)){e=10536;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));_m(10536)}return 10536}function _m(e){e=e|0;hm(e);return}function vm(e){e=e|0;pm(e+24|0);return}function pm(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~((n+-8-t|0)>>>3)<<3);oE(r)}return}function hm(e){e=e|0;var n=0;n=Sa()|0;Ra(e,1,18,n,jl()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function bm(e){e=e|0;return ym(u[(mm(e)|0)>>2]|0)|0}function mm(e){e=e|0;return(u[(dm()|0)+24>>2]|0)+(e<<3)|0}function ym(e){
e=e|0;return Kl(BS[e&7]()|0)|0}function wm(e,n,r){e=e|0;n=n|0;r=r|0;u[e>>2]=n;u[e+4>>2]=r;return}function gm(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=e+4|0;a=((u[o>>2]|0)-(u[e>>2]|0)>>3)+1|0;t=Tm(e)|0;if(t>>>0<a>>>0)ZA(e);else{c=u[e>>2]|0;s=(u[e+8>>2]|0)-c|0;l=s>>2;Mm(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,e+8|0);a=i+8|0;wm(u[a>>2]|0,u[n>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;km(e,i);Am(i);v=f;return}}function Tm(e){e=e|0;return 536870911}function Mm(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>536870911)je();else{i=iE(n<<3)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r<<3)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n<<3);return}function km(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function Am(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~((t+-8-n|0)>>>3)<<3);e=u[e>>2]|0;if(e|0)oE(e);return}function Em(e,n,r){e=e|0;n=n|0;r=r|0;e=oa(n)|0;n=Sm(r)|0;r=Cm(r,0)|0;By(e,n,r,Lm()|0,0);return}function Sm(e){e=e|0;return e|0}function Cm(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=e;c=Lm()|0;a=c+24|0;n=pa(n,4)|0;u[o>>2]=n;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){xm(t,e,n);n=(u[r>>2]|0)+8|0;u[r>>2]=n}else{Dm(a,i,o);n=u[r>>2]|0}v=f;return(n-(u[a>>2]|0)>>3)+-1|0}function Lm(){var e=0,n=0;if(!(t[9136]|0)){Rm(10572);Ie(56,10572,b|0)|0;n=9136;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(10572)|0)){e=10572;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));Rm(10572)}return 10572}function Rm(e){e=e|0;Om(e);return}function Pm(e){e=e|0;Bm(e+24|0);return}function Bm(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~((n+-8-t|0)>>>3)<<3);oE(r)}return}function Om(e){e=e|0;var n=0;n=Sa()|0;Ra(e,1,10,n,Im()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function Im(){return 1484}function Nm(e,n){e=e|0;n=n|0;return Fm(u[(Um(e)|0)>>2]|0,n)|0}function Um(e){e=e|0;return(u[(Lm()|0)+24>>2]|0)+(e<<3)|0}function Fm(e,n){e=e|0;n=n|0;var r=0,t=0;r=v;v=v+16|0;t=r;Ef(t,n);n=Sf(t,n)|0;n=Kf(gS[e&31](n)|0)|0;v=r;return n|0}function xm(e,n,r){e=e|0;n=n|0;r=r|0;u[e>>2]=n;u[e+4>>2]=r;return}function Dm(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=e+4|0;a=((u[o>>2]|0)-(u[e>>2]|0)>>3)+1|0;t=Hm(e)|0;if(t>>>0<a>>>0)ZA(e);else{c=u[e>>2]|0;s=(u[e+8>>2]|0)-c|0;l=s>>2;Wm(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,e+8|0);a=i+8|0;xm(u[a>>2]|0,u[n>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;Ym(e,i);Vm(i);v=f;return}}function Hm(e){e=e|0;return 536870911}function Wm(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>536870911)je();else{i=iE(n<<3)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r<<3)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n<<3);return}function Ym(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function Vm(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~((t+-8-n|0)>>>3)<<3);e=u[e>>2]|0;if(e|0)oE(e);return}function zm(e,n,r){e=e|0;n=n|0;r=r|0;e=oa(n)|0;n=jm(r)|0;r=qm(r,0)|0;By(e,n,r,Gm()|0,0);return}function jm(e){e=e|0;return e|0}function qm(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=e;c=Gm()|0;a=c+24|0;n=pa(n,4)|0;u[o>>2]=n;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){ry(t,e,n);n=(u[r>>2]|0)+8|0;u[r>>2]=n}else{ty(a,i,o);n=u[r>>2]|0}v=f;return(n-(u[a>>2]|0)>>3)+-1|0}function Gm(){var e=0,n=0;if(!(t[9144]|0)){Xm(10608);Ie(57,10608,b|0)|0;n=9144;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(10608)|0)){e=10608;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));Xm(10608)}return 10608}function Xm(e){e=e|0;Zm(e);return}function Km(e){e=e|0;Jm(e+24|0);return}function Jm(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~((n+-8-t|0)>>>3)<<3);oE(r)}return}function Zm(e){e=e|0;var n=0;n=Sa()|0;Ra(e,1,10,n,Qm()|0,2);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function Qm(){return 1492}function $m(e,n,r){e=e|0;n=n|0;r=r|0;ny(u[(ey(e)|0)>>2]|0,n,r);return}function ey(e){e=e|0;return(u[(Gm()|0)+24>>2]|0)+(e<<3)|0}function ny(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,u=0;t=v;v=v+16|0;u=t+1|0;i=t;Ef(u,n);n=Sf(u,n)|0;pc(i,r);r=hc(i,r)|0;wS[e&31](n,r);v=t;return}function ry(e,n,r){e=e|0;n=n|0;r=r|0;u[e>>2]=n;u[e+4>>2]=r;return}function ty(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=e+4|0;a=((u[o>>2]|0)-(u[e>>2]|0)>>3)+1|0;t=iy(e)|0;if(t>>>0<a>>>0)ZA(e);else{c=u[e>>2]|0;s=(u[e+8>>2]|0)-c|0;l=s>>2;uy(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,e+8|0);a=i+8|0;ry(u[a>>2]|0,u[n>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;oy(e,i);ay(i);v=f;return}}function iy(e){e=e|0;return 536870911}function uy(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>536870911)je();else{i=iE(n<<3)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r<<3)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n<<3);return}function oy(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function ay(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~((t+-8-n|0)>>>3)<<3);e=u[e>>2]|0;if(e|0)oE(e);return}function fy(){cy();return}function cy(){ly(10644);return}function ly(e){e=e|0;sy(e,6186);return}function sy(e,n){e=e|0;n=n|0;var r=0;r=dy()|0;u[e>>2]=r;_y(r,n);vy(u[e>>2]|0);return}function dy(){var e=0;if(!(t[9152]|0)){ky(10652);Ie(25,10652,b|0)|0;e=9152;u[e>>2]=1;u[e+4>>2]=0}return 10652}function _y(e,n){e=e|0;n=n|0;u[e>>2]=yy()|0;u[e+4>>2]=wy()|0;u[e+12>>2]=n;u[e+8>>2]=gy()|0;u[e+32>>2]=6;return}function vy(e){e=e|0;var n=0,r=0;n=v;v=v+16|0;r=n;py()|0;u[r>>2]=e;hy(10648,r);v=n;return}function py(){if(!(t[11757]|0)){u[2662]=0;Ie(58,10648,b|0)|0;t[11757]=1}return 10648}function hy(e,n){e=e|0;n=n|0;var r=0;r=iE(8)|0;u[r+4>>2]=u[n>>2];u[r>>2]=u[e>>2];u[e>>2]=r;return}function by(e){e=e|0;my(e);return}function my(e){e=e|0;var n=0,r=0;n=u[e>>2]|0;if(n|0)do{r=n;n=u[n>>2]|0;oE(r)}while((n|0)!=0);u[e>>2]=0;return}function yy(){return 11758}function wy(){return 1504}function gy(){return bh()|0}function Ty(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;if((ph(t,896)|0)==512){if(r|0){My(r);oE(r)}}else if(n|0)oE(n);return}function My(e){e=e|0;e=u[e+4>>2]|0;if(e|0)rE(e);return}function ky(e){e=e|0;tf(e);return}function Ay(e,n){e=e|0;n=n|0;var r=0,t=0;py()|0;r=u[2662]|0;e:do{if(r|0){while(1){t=u[r+4>>2]|0;if(t|0?(lA(Ey(t)|0,e)|0)==0:0)break;r=u[r>>2]|0;if(!r)break e}Sy(t,n)}}while(0);return}function Ey(e){e=e|0;return u[e+12>>2]|0}function Sy(e,n){e=e|0;n=n|0;var r=0;e=e+36|0;r=u[e>>2]|0;if(r|0){gi(r);oE(r)}r=iE(4)|0;Hu(r,n);u[e>>2]=r;return}function Cy(){if(!(t[11759]|0)){u[2674]=0;Ie(59,10696,b|0)|0;t[11759]=1}return 10696}function Ly(){var e=0;if(!(t[11760]|0)){Ry();u[2675]=1512;t[11760]=1;e=1512}else e=u[2675]|0;return e|0}function Ry(){if(!(t[11784]|0)){t[11761]=pa(pa(8,0)|0,0)|0;t[11762]=pa(pa(0,0)|0,0)|0;t[11763]=pa(pa(0,16)|0,0)|0;t[11764]=pa(pa(8,0)|0,0)|0;t[11765]=pa(pa(0,0)|0,0)|0;t[11766]=pa(pa(8,0)|0,0)|0;t[11767]=pa(pa(0,0)|0,0)|0;t[11768]=pa(pa(8,0)|0,0)|0;t[11769]=pa(pa(0,0)|0,0)|0;t[11770]=pa(pa(8,0)|0,0)|0;t[11771]=pa(pa(0,0)|0,0)|0;t[11772]=pa(pa(0,0)|0,32)|0;t[11773]=pa(pa(0,0)|0,32)|0;t[11784]=1}return}function Py(){return 1580}function By(e,n,r,t,i){e=e|0;n=n|0;r=r|0;t=t|0;i=i|0;var o=0,a=0,f=0,c=0,l=0,s=0;o=v;v=v+32|0;s=o+16|0;l=o+12|0;c=o+8|0;f=o+4|0;a=o;u[s>>2]=e;u[l>>2]=n;u[c>>2]=r;u[f>>2]=t;u[a>>2]=i;Cy()|0;Oy(10696,s,l,c,f,a);v=o;return}function Oy(e,n,r,t,i,o){e=e|0;n=n|0;r=r|0;t=t|0;i=i|0;o=o|0;var a=0;a=iE(24)|0;va(a+4|0,u[n>>2]|0,u[r>>2]|0,u[t>>2]|0,u[i>>2]|0,u[o>>2]|0);u[a>>2]=u[e>>2];u[e>>2]=a;return}function Iy(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0,h=0,b=0,m=0,y=0,w=0;w=v;v=v+32|0;h=w+20|0;b=w+8|0;m=w+4|0;y=w;n=u[n>>2]|0;if(n|0){p=h+4|0;c=h+8|0;l=b+4|0;s=b+8|0;d=b+8|0;_=h+8|0;do{a=n+4|0;f=Ny(a)|0;if(f|0){i=Uy(f)|0;u[h>>2]=0;u[p>>2]=0;u[c>>2]=0;t=(Fy(f)|0)+1|0;xy(h,t);if(t|0)while(1){t=t+-1|0;gk(b,u[i>>2]|0);o=u[p>>2]|0;if(o>>>0<(u[_>>2]|0)>>>0){u[o>>2]=u[b>>2];u[p>>2]=(u[p>>2]|0)+4}else Dy(h,b);if(!t)break;else i=i+4|0}t=Hy(f)|0;u[b>>2]=0;u[l>>2]=0;u[s>>2]=0;e:do{if(u[t>>2]|0){i=0;o=0;while(1){if((i|0)==(o|0))Wy(b,t);else{u[i>>2]=u[t>>2];u[l>>2]=(u[l>>2]|0)+4}t=t+4|0;if(!(u[t>>2]|0))break e;i=u[l>>2]|0;o=u[d>>2]|0}}}while(0);u[m>>2]=Yy(a)|0;u[y>>2]=ka(f)|0;Vy(r,e,m,y,h,b);zy(b);jy(h)}n=u[n>>2]|0}while((n|0)!=0)}v=w;return}function Ny(e){e=e|0;return u[e+12>>2]|0}function Uy(e){e=e|0;return u[e+12>>2]|0}function Fy(e){e=e|0;return u[e+16>>2]|0}function xy(e,n){e=e|0;n=n|0;var r=0,t=0,i=0;i=v;v=v+32|0;r=i;t=u[e>>2]|0;if((u[e+8>>2]|0)-t>>2>>>0<n>>>0){kw(r,n,(u[e+4>>2]|0)-t>>2,e+8|0);Aw(e,r);Ew(r)}v=i;return}function Dy(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0;a=v;v=v+32|0;r=a;t=e+4|0;i=((u[t>>2]|0)-(u[e>>2]|0)>>2)+1|0;o=ww(e)|0;if(o>>>0<i>>>0)ZA(e);else{f=u[e>>2]|0;l=(u[e+8>>2]|0)-f|0;c=l>>1;kw(r,l>>2>>>0<o>>>1>>>0?c>>>0<i>>>0?i:c:o,(u[t>>2]|0)-f>>2,e+8|0);o=r+8|0;u[u[o>>2]>>2]=u[n>>2];u[o>>2]=(u[o>>2]|0)+4;Aw(e,r);Ew(r);v=a;return}}function Hy(e){e=e|0;return u[e+8>>2]|0}function Wy(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0;a=v;v=v+32|0;r=a;t=e+4|0;i=((u[t>>2]|0)-(u[e>>2]|0)>>2)+1|0;o=bw(e)|0;if(o>>>0<i>>>0)ZA(e);else{f=u[e>>2]|0;l=(u[e+8>>2]|0)-f|0;c=l>>1;gw(r,l>>2>>>0<o>>>1>>>0?c>>>0<i>>>0?i:c:o,(u[t>>2]|0)-f>>2,e+8|0);o=r+8|0;u[u[o>>2]>>2]=u[n>>2];u[o>>2]=(u[o>>2]|0)+4;Tw(e,r);Mw(r);v=a;return}}function Yy(e){e=e|0;return u[e>>2]|0}function Vy(e,n,r,t,i,u){e=e|0;n=n|0;r=r|0;t=t|0;i=i|0;u=u|0;qy(e,n,r,t,i,u);return}function zy(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~((n+-4-t|0)>>>2)<<2);oE(r)}return}function jy(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~((n+-4-t|0)>>>2)<<2);oE(r)}return}function qy(e,n,r,t,i,o){e=e|0;n=n|0;r=r|0;t=t|0;i=i|0;o=o|0;var a=0,f=0,c=0,l=0,s=0,d=0;a=v;v=v+48|0;s=a+40|0;f=a+32|0;d=a+24|0;c=a+12|0;l=a;Sk(f);e=zu(e)|0;u[d>>2]=u[n>>2];r=u[r>>2]|0;t=u[t>>2]|0;Gy(c,i);Xy(l,o);u[s>>2]=u[d>>2];Ky(e,s,r,t,c,l);zy(l);jy(c);Lk(f);v=a;return}function Gy(e,n){e=e|0;n=n|0;var r=0,t=0;u[e>>2]=0;u[e+4>>2]=0;u[e+8>>2]=0;r=n+4|0;t=(u[r>>2]|0)-(u[n>>2]|0)>>2;if(t|0){mw(e,t);yw(e,u[n>>2]|0,u[r>>2]|0,t)}return}function Xy(e,n){e=e|0;n=n|0;var r=0,t=0;u[e>>2]=0;u[e+4>>2]=0;u[e+8>>2]=0;r=n+4|0;t=(u[r>>2]|0)-(u[n>>2]|0)>>2;if(t|0){pw(e,t);hw(e,u[n>>2]|0,u[r>>2]|0,t)}return}function Ky(e,n,r,t,i,o){e=e|0;n=n|0;r=r|0;t=t|0;i=i|0;o=o|0;var a=0,f=0,c=0,l=0,s=0,d=0;a=v;v=v+32|0;s=a+28|0;d=a+24|0;f=a+12|0;c=a;l=Gu(Jy()|0)|0;u[d>>2]=u[n>>2];u[s>>2]=u[d>>2];n=Zy(s)|0;r=Qy(r)|0;t=$y(t)|0;u[f>>2]=u[i>>2];s=i+4|0;u[f+4>>2]=u[s>>2];d=i+8|0;u[f+8>>2]=u[d>>2];u[d>>2]=0;u[s>>2]=0;u[i>>2]=0;i=ew(f)|0;u[c>>2]=u[o>>2];s=o+4|0;u[c+4>>2]=u[s>>2];d=o+8|0;u[c+8>>2]=u[d>>2];u[d>>2]=0;u[s>>2]=0;u[o>>2]=0;Ce(0,l|0,e|0,n|0,r|0,t|0,i|0,nw(c)|0)|0;zy(c);jy(f);v=a;return}function Jy(){var e=0;if(!(t[9168]|0)){_w(10748);e=9168;u[e>>2]=1;u[e+4>>2]=0}return 10748}function Zy(e){e=e|0;return uw(e)|0}function Qy(e){e=e|0;return tw(e)|0}function $y(e){e=e|0;return Kl(e)|0}function ew(e){e=e|0;return iw(e)|0}function nw(e){e=e|0;return rw(e)|0}function rw(e){e=e|0;var n=0,r=0,t=0;t=(u[e+4>>2]|0)-(u[e>>2]|0)|0;r=t>>2;t=zg(t+4|0)|0;u[t>>2]=r;if(r|0){n=0;do{u[t+4+(n<<2)>>2]=tw(u[(u[e>>2]|0)+(n<<2)>>2]|0)|0;n=n+1|0}while((n|0)!=(r|0))}return t|0}function tw(e){e=e|0;return e|0}function iw(e){e=e|0;var n=0,r=0,t=0;t=(u[e+4>>2]|0)-(u[e>>2]|0)|0;r=t>>2;t=zg(t+4|0)|0;u[t>>2]=r;if(r|0){n=0;do{u[t+4+(n<<2)>>2]=uw((u[e>>2]|0)+(n<<2)|0)|0;n=n+1|0}while((n|0)!=(r|0))}return t|0}function uw(e){e=e|0;var n=0,r=0,t=0,i=0;i=v;v=v+32|0;n=i+12|0;r=i;t=Na(ow()|0)|0;if(!t)e=aw(e)|0;else{Ua(n,t);Fa(r,n);kk(e,r);e=Da(n)|0}v=i;return e|0}function ow(){var e=0;if(!(t[9160]|0)){dw(10704);Ie(25,10704,b|0)|0;e=9160;u[e>>2]=1;u[e+4>>2]=0}return 10704}function aw(e){e=e|0;var n=0,r=0,t=0,i=0,o=0,a=0,f=0;r=v;v=v+16|0;i=r+4|0;a=r;t=zg(8)|0;n=t;f=iE(4)|0;u[f>>2]=u[e>>2];o=n+4|0;u[o>>2]=f;e=iE(8)|0;o=u[o>>2]|0;u[a>>2]=0;u[i>>2]=u[a>>2];fw(e,o,i);u[t>>2]=e;v=r;return n|0}function fw(e,n,r){e=e|0;n=n|0;r=r|0;u[e>>2]=n;r=iE(16)|0;u[r+4>>2]=0;u[r+8>>2]=0;u[r>>2]=1664;u[r+12>>2]=n;u[e+4>>2]=r;return}function cw(e){e=e|0;QA(e);oE(e);return}function lw(e){e=e|0;e=u[e+12>>2]|0;if(e|0)oE(e);return}function sw(e){e=e|0;oE(e);return}function dw(e){e=e|0;tf(e);return}function _w(e){e=e|0;uo(e,vw()|0,5);return}function vw(){return 1684}function pw(e,n){e=e|0;n=n|0;var r=0;if((bw(e)|0)>>>0<n>>>0)ZA(e);if(n>>>0>1073741823)je();else{r=iE(n<<2)|0;u[e+4>>2]=r;u[e>>2]=r;u[e+8>>2]=r+(n<<2);return}}function hw(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;t=e+4|0;e=r-n|0;if((e|0)>0){pE(u[t>>2]|0,n|0,e|0)|0;u[t>>2]=(u[t>>2]|0)+(e>>>2<<2)}return}function bw(e){e=e|0;return 1073741823}function mw(e,n){e=e|0;n=n|0;var r=0;if((ww(e)|0)>>>0<n>>>0)ZA(e);if(n>>>0>1073741823)je();else{r=iE(n<<2)|0;u[e+4>>2]=r;u[e>>2]=r;u[e+8>>2]=r+(n<<2);return}}function yw(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;t=e+4|0;e=r-n|0;if((e|0)>0){pE(u[t>>2]|0,n|0,e|0)|0;u[t>>2]=(u[t>>2]|0)+(e>>>2<<2)}return}function ww(e){e=e|0;return 1073741823}function gw(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>1073741823)je();else{i=iE(n<<2)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r<<2)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n<<2);return}function Tw(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>2)<<2)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function Mw(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~((t+-4-n|0)>>>2)<<2);e=u[e>>2]|0;if(e|0)oE(e);return}function kw(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>1073741823)je();else{i=iE(n<<2)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r<<2)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n<<2);return}function Aw(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>2)<<2)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function Ew(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~((t+-4-n|0)>>>2)<<2);e=u[e>>2]|0;if(e|0)oE(e);return}function Sw(e,n,r,t,i){e=e|0;n=n|0;r=r|0;t=t|0;i=i|0;var o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0,h=0,b=0;b=v;v=v+32|0;s=b+20|0;d=b+12|0;l=b+16|0;_=b+4|0;p=b;h=b+8|0;f=Ly()|0;o=u[f>>2]|0;a=u[o>>2]|0;if(a|0){c=u[f+8>>2]|0;f=u[f+4>>2]|0;while(1){gk(s,a);Cw(e,s,f,c);o=o+4|0;a=u[o>>2]|0;if(!a)break;else{c=c+1|0;f=f+1|0}}}o=Py()|0;a=u[o>>2]|0;if(a|0)do{gk(s,a);u[d>>2]=u[o+4>>2];Lw(n,s,d);o=o+8|0;a=u[o>>2]|0}while((a|0)!=0);o=u[(py()|0)>>2]|0;if(o|0)do{n=u[o+4>>2]|0;gk(s,u[(Rw(n)|0)>>2]|0);u[d>>2]=Ey(n)|0;Pw(r,s,d);o=u[o>>2]|0}while((o|0)!=0);gk(l,0);o=Cy()|0;u[s>>2]=u[l>>2];Iy(s,o,i);o=u[(py()|0)>>2]|0;if(o|0){e=s+4|0;n=s+8|0;r=s+8|0;do{c=u[o+4>>2]|0;gk(d,u[(Rw(c)|0)>>2]|0);Ow(_,Bw(c)|0);a=u[_>>2]|0;if(a|0){u[s>>2]=0;u[e>>2]=0;u[n>>2]=0;do{gk(p,u[(Rw(u[a+4>>2]|0)|0)>>2]|0);f=u[e>>2]|0;if(f>>>0<(u[r>>2]|0)>>>0){u[f>>2]=u[p>>2];u[e>>2]=(u[e>>2]|0)+4}else Dy(s,p);a=u[a>>2]|0}while((a|0)!=0);Iw(t,d,s);jy(s)}u[h>>2]=u[d>>2];l=Nw(c)|0;u[s>>2]=u[h>>2];Iy(s,l,i);ef(_);o=u[o>>2]|0}while((o|0)!=0)}v=b;return}function Cw(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;Kw(e,n,r,t);return}function Lw(e,n,r){e=e|0;n=n|0;r=r|0;Xw(e,n,r);return}function Rw(e){e=e|0;return e|0}function Pw(e,n,r){e=e|0;n=n|0;r=r|0;Vw(e,n,r);return}function Bw(e){e=e|0;return e+16|0}function Ow(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;o=v;v=v+16|0;i=o+8|0;r=o;u[e>>2]=0;t=u[n>>2]|0;u[i>>2]=t;u[r>>2]=e;r=Ww(r)|0;if(t|0){t=iE(12)|0;a=(Yw(i)|0)+4|0;e=u[a+4>>2]|0;n=t+4|0;u[n>>2]=u[a>>2];u[n+4>>2]=e;n=u[u[i>>2]>>2]|0;u[i>>2]=n;if(!n)e=t;else{n=t;while(1){e=iE(12)|0;c=(Yw(i)|0)+4|0;f=u[c+4>>2]|0;a=e+4|0;u[a>>2]=u[c>>2];u[a+4>>2]=f;u[n>>2]=e;a=u[u[i>>2]>>2]|0;u[i>>2]=a;if(!a)break;else n=e}}u[e>>2]=u[r>>2];u[r>>2]=t}v=o;return}function Iw(e,n,r){e=e|0;n=n|0;r=r|0;Uw(e,n,r);return}function Nw(e){e=e|0;return e+24|0}function Uw(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+32|0;a=t+24|0;i=t+16|0;f=t+12|0;o=t;Sk(i);e=zu(e)|0;u[f>>2]=u[n>>2];Gy(o,r);u[a>>2]=u[f>>2];Fw(e,a,o);jy(o);Lk(i);v=t;return}function Fw(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+32|0;a=t+16|0;f=t+12|0;i=t;o=Gu(xw()|0)|0;u[f>>2]=u[n>>2];u[a>>2]=u[f>>2];n=Zy(a)|0;u[i>>2]=u[r>>2];a=r+4|0;u[i+4>>2]=u[a>>2];f=r+8|0;u[i+8>>2]=u[f>>2];u[f>>2]=0;u[a>>2]=0;u[r>>2]=0;ke(0,o|0,e|0,n|0,ew(i)|0)|0;jy(i);v=t;return}function xw(){var e=0;if(!(t[9176]|0)){Dw(10760);e=9176;u[e>>2]=1;u[e+4>>2]=0}return 10760}function Dw(e){e=e|0;uo(e,Hw()|0,2);return}function Hw(){return 1740}function Ww(e){e=e|0;return u[e>>2]|0}function Yw(e){e=e|0;return u[e>>2]|0}function Vw(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+32|0;o=t+16|0;i=t+8|0;a=t;Sk(i);e=zu(e)|0;u[a>>2]=u[n>>2];r=u[r>>2]|0;u[o>>2]=u[a>>2];zw(e,o,r);Lk(i);v=t;return}function zw(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;o=t+4|0;a=t;i=Gu(jw()|0)|0;u[a>>2]=u[n>>2];u[o>>2]=u[a>>2];n=Zy(o)|0;ke(0,i|0,e|0,n|0,Qy(r)|0)|0;v=t;return}function jw(){var e=0;if(!(t[9184]|0)){qw(10772);e=9184;u[e>>2]=1;u[e+4>>2]=0}return 10772}function qw(e){e=e|0;uo(e,Gw()|0,2);return}function Gw(){return 1752}function Xw(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+32|0;o=t+16|0;i=t+8|0;a=t;Sk(i);e=zu(e)|0;u[a>>2]=u[n>>2];r=u[r>>2]|0;u[o>>2]=u[a>>2];zw(e,o,r);Lk(i);v=t;return}function Kw(e,n,r,i){e=e|0;n=n|0;r=r|0;i=i|0;var o=0,a=0,f=0,c=0;o=v;v=v+32|0;f=o+16|0;a=o+8|0;c=o;Sk(a);e=zu(e)|0;u[c>>2]=u[n>>2];r=t[r>>0]|0;i=t[i>>0]|0;u[f>>2]=u[c>>2];Jw(e,f,r,i);Lk(a);v=o;return}function Jw(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0;i=v;v=v+16|0;a=i+4|0;f=i;o=Gu(Zw()|0)|0;u[f>>2]=u[n>>2];u[a>>2]=u[f>>2];n=Zy(a)|0;r=Qw(r)|0;$e(0,o|0,e|0,n|0,r|0,Qw(t)|0)|0;v=i;return}function Zw(){var e=0;if(!(t[9192]|0)){eg(10784);e=9192;u[e>>2]=1;u[e+4>>2]=0}return 10784}function Qw(e){e=e|0;return $w(e)|0}function $w(e){e=e|0;return e&255|0}function eg(e){e=e|0;uo(e,ng()|0,3);return}function ng(){return 1764}function rg(e,n,r){e=e|0;n=n|0;r=r|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0;p=v;v=v+32|0;c=p+8|0;l=p+4|0;s=p+20|0;d=p;Wc(e,0);i=Mk(n)|0;u[c>>2]=0;_=c+4|0;u[_>>2]=0;u[c+8>>2]=0;switch(i<<24>>24){case 0:{t[s>>0]=0;tg(l,r,s);ig(e,l)|0;Ti(l);break}case 8:{_=Tk(n)|0;t[s>>0]=8;gk(d,u[_+4>>2]|0);ug(l,r,s,d,_+8|0);ig(e,l)|0;Ti(l);break}case 9:{a=Tk(n)|0;n=u[a+4>>2]|0;if(n|0){f=c+8|0;o=a+12|0;while(1){n=n+-1|0;gk(l,u[o>>2]|0);i=u[_>>2]|0;if(i>>>0<(u[f>>2]|0)>>>0){u[i>>2]=u[l>>2];u[_>>2]=(u[_>>2]|0)+4}else Dy(c,l);if(!n)break;else o=o+4|0}}t[s>>0]=9;gk(d,u[a+8>>2]|0);og(l,r,s,d,c);ig(e,l)|0;Ti(l);break}default:{_=Tk(n)|0;t[s>>0]=i;gk(d,u[_+4>>2]|0);ag(l,r,s,d);ig(e,l)|0;Ti(l)}}jy(c);v=p;return}function tg(e,n,r){e=e|0;n=n|0;r=r|0;var i=0,u=0;i=v;v=v+16|0;u=i;Sk(u);n=zu(n)|0;gg(e,n,t[r>>0]|0);Lk(u);v=i;return}function ig(e,n){e=e|0;n=n|0;var r=0;r=u[e>>2]|0;if(r|0)en(r|0);u[e>>2]=u[n>>2];u[n>>2]=0;return e|0}function ug(e,n,r,i,o){e=e|0;n=n|0;r=r|0;i=i|0;o=o|0;var a=0,f=0,c=0,l=0;a=v;v=v+32|0;c=a+16|0;f=a+8|0;l=a;Sk(f);n=zu(n)|0;r=t[r>>0]|0;u[l>>2]=u[i>>2];o=u[o>>2]|0;u[c>>2]=u[l>>2];bg(e,n,r,c,o);Lk(f);v=a;return}function og(e,n,r,i,o){e=e|0;n=n|0;r=r|0;i=i|0;o=o|0;var a=0,f=0,c=0,l=0,s=0;a=v;v=v+32|0;l=a+24|0;f=a+16|0;s=a+12|0;c=a;Sk(f);n=zu(n)|0;r=t[r>>0]|0;u[s>>2]=u[i>>2];Gy(c,o);u[l>>2]=u[s>>2];_g(e,n,r,l,c);jy(c);Lk(f);v=a;return}function ag(e,n,r,i){e=e|0;n=n|0;r=r|0;i=i|0;var o=0,a=0,f=0,c=0;o=v;v=v+32|0;f=o+16|0;a=o+8|0;c=o;Sk(a);n=zu(n)|0;r=t[r>>0]|0;u[c>>2]=u[i>>2];u[f>>2]=u[c>>2];fg(e,n,r,f);Lk(a);v=o;return}function fg(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0;i=v;v=v+16|0;o=i+4|0;f=i;a=Gu(cg()|0)|0;r=Qw(r)|0;u[f>>2]=u[t>>2];u[o>>2]=u[f>>2];lg(e,ke(0,a|0,n|0,r|0,Zy(o)|0)|0);v=i;return}function cg(){var e=0;if(!(t[9200]|0)){sg(10796);e=9200;u[e>>2]=1;u[e+4>>2]=0}return 10796}function lg(e,n){e=e|0;n=n|0;Wc(e,n);return}function sg(e){e=e|0;uo(e,dg()|0,2);return}function dg(){return 1780}function _g(e,n,r,t,i){e=e|0;n=n|0;r=r|0;t=t|0;i=i|0;var o=0,a=0,f=0,c=0,l=0;o=v;v=v+32|0;c=o+16|0;l=o+12|0;a=o;f=Gu(vg()|0)|0;r=Qw(r)|0;u[l>>2]=u[t>>2];u[c>>2]=u[l>>2];t=Zy(c)|0;u[a>>2]=u[i>>2];c=i+4|0;u[a+4>>2]=u[c>>2];l=i+8|0;u[a+8>>2]=u[l>>2];u[l>>2]=0;u[c>>2]=0;u[i>>2]=0;lg(e,$e(0,f|0,n|0,r|0,t|0,ew(a)|0)|0);jy(a);v=o;return}function vg(){var e=0;if(!(t[9208]|0)){pg(10808);e=9208;u[e>>2]=1;u[e+4>>2]=0}return 10808}function pg(e){e=e|0;uo(e,hg()|0,3);return}function hg(){return 1792}function bg(e,n,r,t,i){e=e|0;n=n|0;r=r|0;t=t|0;i=i|0;var o=0,a=0,f=0,c=0;o=v;v=v+16|0;f=o+4|0;c=o;a=Gu(mg()|0)|0;r=Qw(r)|0;u[c>>2]=u[t>>2];u[f>>2]=u[c>>2];t=Zy(f)|0;lg(e,$e(0,a|0,n|0,r|0,t|0,$y(i)|0)|0);v=o;return}function mg(){var e=0;if(!(t[9216]|0)){yg(10820);e=9216;u[e>>2]=1;u[e+4>>2]=0}return 10820}function yg(e){e=e|0;uo(e,wg()|0,3);return}function wg(){return 1808}function gg(e,n,r){e=e|0;n=n|0;r=r|0;var t=0;t=Gu(Tg()|0)|0;lg(e,nn(0,t|0,n|0,Qw(r)|0)|0);return}function Tg(){var e=0;if(!(t[9224]|0)){Mg(10832);e=9224;u[e>>2]=1;u[e+4>>2]=0}return 10832}function Mg(e){e=e|0;uo(e,kg()|0,1);return}function kg(){return 1824}function Ag(){Eg();Sg();Cg();return}function Eg(){u[2712]=uE(65536)|0;return}function Sg(){Zg(10896);return}function Cg(){Lg(10856);return}function Lg(e){e=e|0;Rg(e,6275);Pg(e)|0;return}function Rg(e,n){e=e|0;n=n|0;var r=0;r=ow()|0;u[e>>2]=r;jg(r,n);vy(u[e>>2]|0);return}function Pg(e){e=e|0;var n=0;n=u[e>>2]|0;Ah(n,Bg()|0);return e|0}function Bg(){var e=0;if(!(t[9232]|0)){Og(10860);Ie(60,10860,b|0)|0;e=9232;u[e>>2]=1;u[e+4>>2]=0}if(!(ka(10860)|0))Og(10860);return 10860}function Og(e){e=e|0;Ug(e);Ph(e,26);return}function Ig(e){e=e|0;Ng(e+24|0);return}function Ng(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~((n+-8-t|0)>>>3)<<3);oE(r)}return}function Ug(e){e=e|0;var n=0;n=Sa()|0;Ra(e,5,19,n,Wg()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function Fg(e,n){e=e|0;n=n|0;xg(e,n);return}function xg(e,n){e=e|0;n=n|0;var r=0,t=0,i=0;r=v;v=v+16|0;t=r;i=r+4|0;al(i,n);u[t>>2]=fl(i,n)|0;Dg(e,t);v=r;return}function Dg(e,n){e=e|0;n=n|0;Hg(e+4|0,u[n>>2]|0);t[e+8>>0]=1;return}function Hg(e,n){e=e|0;n=n|0;u[e>>2]=n;return}function Wg(){return 1832}function Yg(e){e=e|0;return Vg(e)|0}function Vg(e){e=e|0;var n=0,r=0,t=0,i=0,o=0,a=0,f=0;r=v;v=v+16|0;i=r+4|0;a=r;t=zg(8)|0;n=t;f=iE(4)|0;al(i,e);Hg(f,fl(i,e)|0);o=n+4|0;u[o>>2]=f;e=iE(8)|0;o=u[o>>2]|0;u[a>>2]=0;u[i>>2]=u[a>>2];fw(e,o,i);u[t>>2]=e;v=r;return n|0}function zg(e){e=e|0;var n=0,r=0;e=e+7&-8;if(e>>>0<=32768?(n=u[2711]|0,e>>>0<=(65536-n|0)>>>0):0){r=(u[2712]|0)+n|0;u[2711]=n+e;e=r}else{e=uE(e+8|0)|0;u[e>>2]=u[2713];u[2713]=e;e=e+8|0}return e|0}function jg(e,n){e=e|0;n=n|0;u[e>>2]=qg()|0;u[e+4>>2]=Gg()|0;u[e+12>>2]=n;u[e+8>>2]=Xg()|0;u[e+32>>2]=7;return}function qg(){return 11788}function Gg(){return 1840}function Xg(){return nb()|0}function Kg(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;if((ph(t,896)|0)==512){if(r|0){Jg(r);oE(r)}}else if(n|0)oE(n);return}function Jg(e){e=e|0;e=u[e+4>>2]|0;if(e|0)rE(e);return}function Zg(e){e=e|0;Qg(e,6283);$g(e)|0;eT(e,6289,27)|0;nT(e,6300,1)|0;rT(e,6308,11)|0;tT(e,6318,20)|0;uT(e,6325,28)|0;return}function Qg(e,n){e=e|0;n=n|0;var r=0;r=_k()|0;u[e>>2]=r;vk(r,n);vy(u[e>>2]|0);return}function $g(e){e=e|0;var n=0;n=u[e>>2]|0;Ah(n,QM()|0);return e|0}function eT(e,n,r){e=e|0;n=n|0;r=r|0;PM(e,oa(n)|0,r,0);return e|0}function nT(e,n,r){e=e|0;n=n|0;r=r|0;_M(e,oa(n)|0,r,0);return e|0}function rT(e,n,r){e=e|0;n=n|0;r=r|0;YT(e,oa(n)|0,r,0);return e|0}function tT(e,n,r){e=e|0;n=n|0;r=r|0;kT(e,oa(n)|0,r,0);return e|0}function iT(e,n){e=e|0;n=n|0;var r=0,t=0;e:while(1){r=u[2713]|0;while(1){if((r|0)==(n|0))break e;t=u[r>>2]|0;u[2713]=t;if(!r)r=t;else break}oE(r)}u[2711]=e;return}function uT(e,n,r){e=e|0;n=n|0;r=r|0;oT(e,oa(n)|0,r,0);return e|0}function oT(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0;o=u[e>>2]|0;i=aT()|0;e=fT(r)|0;sa(o,n,i,e,cT(r,t)|0,t);return}function aT(){var e=0,n=0;if(!(t[9240]|0)){hT(10900);Ie(61,10900,b|0)|0;n=9240;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(10900)|0)){e=10900;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));hT(10900)}return 10900}function fT(e){e=e|0;return e|0}function cT(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=e;c=aT()|0;a=c+24|0;n=pa(n,4)|0;u[o>>2]=n;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){lT(t,e,n);n=(u[r>>2]|0)+8|0;u[r>>2]=n}else{sT(a,i,o);n=u[r>>2]|0}v=f;return(n-(u[a>>2]|0)>>3)+-1|0}function lT(e,n,r){e=e|0;n=n|0;r=r|0;u[e>>2]=n;u[e+4>>2]=r;return}function sT(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=e+4|0;a=((u[o>>2]|0)-(u[e>>2]|0)>>3)+1|0;t=dT(e)|0;if(t>>>0<a>>>0)ZA(e);else{c=u[e>>2]|0;s=(u[e+8>>2]|0)-c|0;l=s>>2;_T(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,e+8|0);a=i+8|0;lT(u[a>>2]|0,u[n>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;vT(e,i);pT(i);v=f;return}}function dT(e){e=e|0;return 536870911}function _T(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>536870911)je();else{i=iE(n<<3)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r<<3)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n<<3);return}function vT(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function pT(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~((t+-8-n|0)>>>3)<<3);e=u[e>>2]|0;if(e|0)oE(e);return}function hT(e){e=e|0;yT(e);return}function bT(e){e=e|0;mT(e+24|0);return}function mT(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~((n+-8-t|0)>>>3)<<3);oE(r)}return}function yT(e){e=e|0;var n=0;n=Sa()|0;Ra(e,1,12,n,wT()|0,2);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function wT(){return 1848}function gT(e,n,r){e=e|0;n=n|0;r=r|0;MT(u[(TT(e)|0)>>2]|0,n,r);return}function TT(e){e=e|0;return(u[(aT()|0)+24>>2]|0)+(e<<3)|0}function MT(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,u=0;t=v;v=v+16|0;u=t+1|0;i=t;al(u,n);n=fl(u,n)|0;al(i,r);r=fl(i,r)|0;wS[e&31](n,r);v=t;return}function kT(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0;o=u[e>>2]|0;i=AT()|0;e=ET(r)|0;sa(o,n,i,e,ST(r,t)|0,t);return}function AT(){var e=0,n=0;if(!(t[9248]|0)){IT(10936);Ie(62,10936,b|0)|0;n=9248;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(10936)|0)){e=10936;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));IT(10936)}return 10936}function ET(e){e=e|0;return e|0}function ST(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=e;c=AT()|0;a=c+24|0;n=pa(n,4)|0;u[o>>2]=n;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){CT(t,e,n);n=(u[r>>2]|0)+8|0;u[r>>2]=n}else{LT(a,i,o);n=u[r>>2]|0}v=f;return(n-(u[a>>2]|0)>>3)+-1|0}function CT(e,n,r){e=e|0;n=n|0;r=r|0;u[e>>2]=n;u[e+4>>2]=r;return}function LT(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=e+4|0;a=((u[o>>2]|0)-(u[e>>2]|0)>>3)+1|0;t=RT(e)|0;if(t>>>0<a>>>0)ZA(e);else{c=u[e>>2]|0;s=(u[e+8>>2]|0)-c|0;l=s>>2;PT(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,e+8|0);a=i+8|0;CT(u[a>>2]|0,u[n>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;BT(e,i);OT(i);v=f;return}}function RT(e){e=e|0;return 536870911}function PT(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>536870911)je();else{i=iE(n<<3)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r<<3)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n<<3);return}function BT(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function OT(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~((t+-8-n|0)>>>3)<<3);e=u[e>>2]|0;if(e|0)oE(e);return}function IT(e){e=e|0;FT(e);return}function NT(e){e=e|0;UT(e+24|0);return}function UT(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~((n+-8-t|0)>>>3)<<3);oE(r)}return}function FT(e){e=e|0;var n=0;n=Sa()|0;Ra(e,1,11,n,xT()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function xT(){return 1860}function DT(e,n){e=e|0;n=n|0;return WT(u[(HT(e)|0)>>2]|0,n)|0}function HT(e){e=e|0;return(u[(AT()|0)+24>>2]|0)+(e<<3)|0}function WT(e,n){e=e|0;n=n|0;var r=0,t=0;r=v;v=v+16|0;t=r;al(t,n);n=fl(t,n)|0;n=Kl(gS[e&31](n)|0)|0;v=r;return n|0}function YT(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0;o=u[e>>2]|0;i=VT()|0;e=zT(r)|0;sa(o,n,i,e,jT(r,t)|0,t);return}function VT(){var e=0,n=0;if(!(t[9256]|0)){QT(10972);Ie(63,10972,b|0)|0;n=9256;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(10972)|0)){e=10972;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));QT(10972)}return 10972}function zT(e){e=e|0;return e|0}function jT(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=e;c=VT()|0;a=c+24|0;n=pa(n,4)|0;u[o>>2]=n;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){qT(t,e,n);n=(u[r>>2]|0)+8|0;u[r>>2]=n}else{GT(a,i,o);n=u[r>>2]|0}v=f;return(n-(u[a>>2]|0)>>3)+-1|0}function qT(e,n,r){e=e|0;n=n|0;r=r|0;u[e>>2]=n;u[e+4>>2]=r;return}function GT(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=e+4|0;a=((u[o>>2]|0)-(u[e>>2]|0)>>3)+1|0;t=XT(e)|0;if(t>>>0<a>>>0)ZA(e);else{c=u[e>>2]|0;s=(u[e+8>>2]|0)-c|0;l=s>>2;KT(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,e+8|0);a=i+8|0;qT(u[a>>2]|0,u[n>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;JT(e,i);ZT(i);v=f;return}}function XT(e){e=e|0;return 536870911}function KT(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>536870911)je();else{i=iE(n<<3)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r<<3)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n<<3);return}function JT(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function ZT(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~((t+-8-n|0)>>>3)<<3);e=u[e>>2]|0;if(e|0)oE(e);return}function QT(e){e=e|0;nM(e);return}function $T(e){e=e|0;eM(e+24|0);return}function eM(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~((n+-8-t|0)>>>3)<<3);oE(r)}return}function nM(e){e=e|0;var n=0;n=Sa()|0;
Ra(e,1,7,n,rM()|0,2);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function rM(){return 1868}function tM(e,n,r){e=e|0;n=n|0;r=r|0;return uM(u[(iM(e)|0)>>2]|0,n,r)|0}function iM(e){e=e|0;return(u[(VT()|0)+24>>2]|0)+(e<<3)|0}function uM(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0;t=v;v=v+32|0;a=t+12|0;o=t+8|0;f=t;c=t+16|0;i=t+4|0;oM(c,n);aM(f,c,n);Fc(i,r);r=xc(i,r)|0;u[a>>2]=u[f>>2];NS[e&15](o,a,r);r=fM(o)|0;Ti(o);Dc(i);v=t;return r|0}function oM(e,n){e=e|0;n=n|0;return}function aM(e,n,r){e=e|0;n=n|0;r=r|0;cM(e,r);return}function fM(e){e=e|0;return zu(e)|0}function cM(e,n){e=e|0;n=n|0;var r=0,t=0,i=0;i=v;v=v+16|0;r=i;t=n;if(!(t&1))u[e>>2]=u[n>>2];else{lM(r,0);Ue(t|0,r|0)|0;sM(e,r);dM(r)}v=i;return}function lM(e,n){e=e|0;n=n|0;eo(e,n);u[e+4>>2]=0;t[e+8>>0]=0;return}function sM(e,n){e=e|0;n=n|0;u[e>>2]=u[n+4>>2];return}function dM(e){e=e|0;t[e+8>>0]=0;return}function _M(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0;o=u[e>>2]|0;i=vM()|0;e=pM(r)|0;sa(o,n,i,e,hM(r,t)|0,t);return}function vM(){var e=0,n=0;if(!(t[9264]|0)){MM(11008);Ie(64,11008,b|0)|0;n=9264;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(11008)|0)){e=11008;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));MM(11008)}return 11008}function pM(e){e=e|0;return e|0}function hM(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=e;c=vM()|0;a=c+24|0;n=pa(n,4)|0;u[o>>2]=n;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){bM(t,e,n);n=(u[r>>2]|0)+8|0;u[r>>2]=n}else{mM(a,i,o);n=u[r>>2]|0}v=f;return(n-(u[a>>2]|0)>>3)+-1|0}function bM(e,n,r){e=e|0;n=n|0;r=r|0;u[e>>2]=n;u[e+4>>2]=r;return}function mM(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=e+4|0;a=((u[o>>2]|0)-(u[e>>2]|0)>>3)+1|0;t=yM(e)|0;if(t>>>0<a>>>0)ZA(e);else{c=u[e>>2]|0;s=(u[e+8>>2]|0)-c|0;l=s>>2;wM(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,e+8|0);a=i+8|0;bM(u[a>>2]|0,u[n>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;gM(e,i);TM(i);v=f;return}}function yM(e){e=e|0;return 536870911}function wM(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>536870911)je();else{i=iE(n<<3)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r<<3)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n<<3);return}function gM(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function TM(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~((t+-8-n|0)>>>3)<<3);e=u[e>>2]|0;if(e|0)oE(e);return}function MM(e){e=e|0;EM(e);return}function kM(e){e=e|0;AM(e+24|0);return}function AM(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~((n+-8-t|0)>>>3)<<3);oE(r)}return}function EM(e){e=e|0;var n=0;n=Sa()|0;Ra(e,1,1,n,SM()|0,5);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function SM(){return 1880}function CM(e,n,r,t,i,o){e=e|0;n=n|0;r=r|0;t=t|0;i=i|0;o=o|0;RM(u[(LM(e)|0)>>2]|0,n,r,t,i,o);return}function LM(e){e=e|0;return(u[(vM()|0)+24>>2]|0)+(e<<3)|0}function RM(e,n,r,t,i,u){e=e|0;n=n|0;r=r|0;t=t|0;i=i|0;u=u|0;var o=0,a=0,f=0,c=0,l=0,s=0;o=v;v=v+32|0;a=o+16|0;f=o+12|0;c=o+8|0;l=o+4|0;s=o;Fc(a,n);n=xc(a,n)|0;Fc(f,r);r=xc(f,r)|0;Fc(c,t);t=xc(c,t)|0;Fc(l,i);i=xc(l,i)|0;Fc(s,u);u=xc(s,u)|0;hS[e&1](n,r,t,i,u);Dc(s);Dc(l);Dc(c);Dc(f);Dc(a);v=o;return}function PM(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0;o=u[e>>2]|0;i=BM()|0;e=OM(r)|0;sa(o,n,i,e,IM(r,t)|0,t);return}function BM(){var e=0,n=0;if(!(t[9272]|0)){WM(11044);Ie(65,11044,b|0)|0;n=9272;u[n>>2]=1;u[n+4>>2]=0}if(!(ka(11044)|0)){e=11044;n=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(n|0));WM(11044)}return 11044}function OM(e){e=e|0;return e|0}function IM(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=e;c=BM()|0;a=c+24|0;n=pa(n,4)|0;u[o>>2]=n;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){NM(t,e,n);n=(u[r>>2]|0)+8|0;u[r>>2]=n}else{UM(a,i,o);n=u[r>>2]|0}v=f;return(n-(u[a>>2]|0)>>3)+-1|0}function NM(e,n,r){e=e|0;n=n|0;r=r|0;u[e>>2]=n;u[e+4>>2]=r;return}function UM(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=e+4|0;a=((u[o>>2]|0)-(u[e>>2]|0)>>3)+1|0;t=FM(e)|0;if(t>>>0<a>>>0)ZA(e);else{c=u[e>>2]|0;s=(u[e+8>>2]|0)-c|0;l=s>>2;xM(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,e+8|0);a=i+8|0;NM(u[a>>2]|0,u[n>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;DM(e,i);HM(i);v=f;return}}function FM(e){e=e|0;return 536870911}function xM(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=t;do{if(n){if(n>>>0>536870911)je();else{i=iE(n<<3)|0;break}}else i=0}while(0);u[e>>2]=i;t=i+(r<<3)|0;u[e+8>>2]=t;u[e+4>>2]=t;u[e+12>>2]=i+(n<<3);return}function DM(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0;t=u[e>>2]|0;a=e+4|0;o=n+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){pE(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[e>>2]|0;u[e>>2]=r;u[t>>2]=o;o=n+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=n+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[n>>2]=u[t>>2];return}function HM(e){e=e|0;var n=0,r=0,t=0;n=u[e+4>>2]|0;r=e+8|0;t=u[r>>2]|0;if((t|0)!=(n|0))u[r>>2]=t+(~((t+-8-n|0)>>>3)<<3);e=u[e>>2]|0;if(e|0)oE(e);return}function WM(e){e=e|0;zM(e);return}function YM(e){e=e|0;VM(e+24|0);return}function VM(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~((n+-8-t|0)>>>3)<<3);oE(r)}return}function zM(e){e=e|0;var n=0;n=Sa()|0;Ra(e,1,13,n,jM()|0,2);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function jM(){return 1904}function qM(e,n,r){e=e|0;n=n|0;r=r|0;XM(u[(GM(e)|0)>>2]|0,n,r);return}function GM(e){e=e|0;return(u[(BM()|0)+24>>2]|0)+(e<<3)|0}function XM(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,u=0;t=v;v=v+16|0;u=t+4|0;i=t;KM(u,n);n=JM(u,n)|0;Fc(i,r);r=xc(i,r)|0;wS[e&31](n,r);Dc(i);v=t;return}function KM(e,n){e=e|0;n=n|0;return}function JM(e,n){e=e|0;n=n|0;return ZM(n)|0}function ZM(e){e=e|0;return e|0}function QM(){var e=0;if(!(t[9280]|0)){$M(11080);Ie(66,11080,b|0)|0;e=9280;u[e>>2]=1;u[e+4>>2]=0}if(!(ka(11080)|0))$M(11080);return 11080}function $M(e){e=e|0;rk(e);Ph(e,67);return}function ek(e){e=e|0;nk(e+24|0);return}function nk(e){e=e|0;var n=0,r=0,t=0;r=u[e>>2]|0;t=r;if(r|0){e=e+4|0;n=u[e>>2]|0;if((n|0)!=(r|0))u[e>>2]=n+(~((n+-8-t|0)>>>3)<<3);oE(r)}return}function rk(e){e=e|0;var n=0;n=Sa()|0;Ra(e,5,6,n,ok()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function tk(e){e=e|0;ik(e);return}function ik(e){e=e|0;uk(e);return}function uk(e){e=e|0;t[e+8>>0]=1;return}function ok(){return 1944}function ak(){return fk()|0}function fk(){var e=0,n=0,r=0,t=0,i=0,o=0,a=0;n=v;v=v+16|0;i=n+4|0;a=n;r=zg(8)|0;e=r;o=e+4|0;u[o>>2]=iE(1)|0;t=iE(8)|0;o=u[o>>2]|0;u[a>>2]=0;u[i>>2]=u[a>>2];ck(t,o,i);u[r>>2]=t;v=n;return e|0}function ck(e,n,r){e=e|0;n=n|0;r=r|0;u[e>>2]=n;r=iE(16)|0;u[r+4>>2]=0;u[r+8>>2]=0;u[r>>2]=1924;u[r+12>>2]=n;u[e+4>>2]=r;return}function lk(e){e=e|0;QA(e);oE(e);return}function sk(e){e=e|0;e=u[e+12>>2]|0;if(e|0)oE(e);return}function dk(e){e=e|0;oE(e);return}function _k(){var e=0;if(!(t[9288]|0)){wk(11116);Ie(25,11116,b|0)|0;e=9288;u[e>>2]=1;u[e+4>>2]=0}return 11116}function vk(e,n){e=e|0;n=n|0;u[e>>2]=pk()|0;u[e+4>>2]=hk()|0;u[e+12>>2]=n;u[e+8>>2]=bk()|0;u[e+32>>2]=8;return}function pk(){return 11789}function hk(){return 1948}function bk(){return bh()|0}function mk(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;if((ph(t,896)|0)==512){if(r|0){yk(r);oE(r)}}else if(n|0)oE(n);return}function yk(e){e=e|0;e=u[e+4>>2]|0;if(e|0)rE(e);return}function wk(e){e=e|0;tf(e);return}function gk(e,n){e=e|0;n=n|0;u[e>>2]=n;return}function Tk(e){e=e|0;return u[e>>2]|0}function Mk(e){e=e|0;return t[u[e>>2]>>0]|0}function kk(e,n){e=e|0;n=n|0;var r=0,t=0;r=v;v=v+16|0;t=r;u[t>>2]=u[e>>2];Ak(n,t)|0;v=r;return}function Ak(e,n){e=e|0;n=n|0;var r=0;r=Ek(u[e>>2]|0,n)|0;n=e+4|0;u[(u[n>>2]|0)+8>>2]=r;return u[(u[n>>2]|0)+8>>2]|0}function Ek(e,n){e=e|0;n=n|0;var r=0,t=0;r=v;v=v+16|0;t=r;Sk(t);e=zu(e)|0;n=Ck(e,u[n>>2]|0)|0;Lk(t);v=r;return n|0}function Sk(e){e=e|0;u[e>>2]=u[2711];u[e+4>>2]=u[2713];return}function Ck(e,n){e=e|0;n=n|0;var r=0;r=Gu(Rk()|0)|0;return nn(0,r|0,e|0,$y(n)|0)|0}function Lk(e){e=e|0;iT(u[e>>2]|0,u[e+4>>2]|0);return}function Rk(){var e=0;if(!(t[9296]|0)){Pk(11160);e=9296;u[e>>2]=1;u[e+4>>2]=0}return 11160}function Pk(e){e=e|0;uo(e,Bk()|0,1);return}function Bk(){return 1956}function Ok(){Ik();return}function Ik(){var e=0,n=0,r=0,i=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0,h=0,b=0,m=0,y=0;m=v;v=v+16|0;_=m+4|0;p=m;Pe(65536,10844,u[2712]|0,10852);r=Ly()|0;n=u[r>>2]|0;e=u[n>>2]|0;if(e|0){i=u[r+8>>2]|0;r=u[r+4>>2]|0;while(1){xe(e|0,o[r>>0]|0|0,t[i>>0]|0);n=n+4|0;e=u[n>>2]|0;if(!e)break;else{i=i+1|0;r=r+1|0}}}e=Py()|0;n=u[e>>2]|0;if(n|0)do{De(n|0,u[e+4>>2]|0);e=e+8|0;n=u[e>>2]|0}while((n|0)!=0);De(Nk()|0,6398);d=py()|0;e=u[d>>2]|0;e:do{if(e|0){do{Uk(u[e+4>>2]|0);e=u[e>>2]|0}while((e|0)!=0);e=u[d>>2]|0;if(e|0){s=d;do{while(1){a=e;e=u[e>>2]|0;a=u[a+4>>2]|0;if(!(Fk(a)|0))break;u[p>>2]=s;u[_>>2]=u[p>>2];xk(d,_)|0;if(!e)break e}Dk(a);s=u[s>>2]|0;n=Hk(a)|0;f=Ge()|0;c=v;v=v+((1*(n<<2)|0)+15&-16)|0;l=v;v=v+((1*(n<<2)|0)+15&-16)|0;n=u[(Bw(a)|0)>>2]|0;if(n|0){r=c;i=l;while(1){u[r>>2]=u[(Rw(u[n+4>>2]|0)|0)>>2];u[i>>2]=u[n+8>>2];n=u[n>>2]|0;if(!n)break;else{r=r+4|0;i=i+4|0}}}y=Rw(a)|0;n=Wk(a)|0;r=Hk(a)|0;i=Yk(a)|0;Ve(y|0,n|0,c|0,l|0,r|0,i|0,Ey(a)|0);Oe(f|0)}while((e|0)!=0)}}}while(0);e=u[(Cy()|0)>>2]|0;if(e|0)do{y=e+4|0;d=Ny(y)|0;a=Hy(d)|0;f=Uy(d)|0;c=(Fy(d)|0)+1|0;l=Vk(d)|0;s=zk(y)|0;d=ka(d)|0;_=Yy(y)|0;p=jk(y)|0;We(0,a|0,f|0,c|0,l|0,s|0,d|0,_|0,p|0,qk(y)|0);e=u[e>>2]|0}while((e|0)!=0);e=u[(py()|0)>>2]|0;e:do{if(e|0){n:while(1){n=u[e+4>>2]|0;if(n|0?(h=u[(Rw(n)|0)>>2]|0,b=u[(Nw(n)|0)>>2]|0,b|0):0){r=b;do{n=r+4|0;i=Ny(n)|0;r:do{if(i|0)switch(ka(i)|0){case 0:break n;case 4:case 3:case 2:{l=Hy(i)|0;s=Uy(i)|0;d=(Fy(i)|0)+1|0;_=Vk(i)|0;p=ka(i)|0;y=Yy(n)|0;We(h|0,l|0,s|0,d|0,_|0,0,p|0,y|0,jk(n)|0,qk(n)|0);break r}case 1:{c=Hy(i)|0;l=Uy(i)|0;s=(Fy(i)|0)+1|0;d=Vk(i)|0;_=zk(n)|0;p=ka(i)|0;y=Yy(n)|0;We(h|0,c|0,l|0,s|0,d|0,_|0,p|0,y|0,jk(n)|0,qk(n)|0);break r}case 5:{d=Hy(i)|0;_=Uy(i)|0;p=(Fy(i)|0)+1|0;y=Vk(i)|0;We(h|0,d|0,_|0,p|0,y|0,Gk(i)|0,ka(i)|0,0,0,0);break r}default:break r}}while(0);r=u[r>>2]|0}while((r|0)!=0)}e=u[e>>2]|0;if(!e)break e}je()}}while(0);ze();v=m;return}function Nk(){return 11746}function Uk(e){e=e|0;t[e+40>>0]=0;return}function Fk(e){e=e|0;return(t[e+40>>0]|0)!=0|0}function xk(e,n){e=e|0;n=n|0;n=Xk(n)|0;e=u[n>>2]|0;u[n>>2]=u[e>>2];oE(e);return u[n>>2]|0}function Dk(e){e=e|0;t[e+40>>0]=1;return}function Hk(e){e=e|0;return u[e+20>>2]|0}function Wk(e){e=e|0;return u[e+8>>2]|0}function Yk(e){e=e|0;return u[e+32>>2]|0}function Vk(e){e=e|0;return u[e+4>>2]|0}function zk(e){e=e|0;return u[e+4>>2]|0}function jk(e){e=e|0;return u[e+8>>2]|0}function qk(e){e=e|0;return u[e+16>>2]|0}function Gk(e){e=e|0;return u[e+20>>2]|0}function Xk(e){e=e|0;return u[e>>2]|0}function Kk(e){e=e|0;var n=0,r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0,h=0,b=0,m=0,y=0,w=0,g=0,T=0,M=0;M=v;v=v+16|0;_=M;do{if(e>>>0<245){l=e>>>0<11?16:e+11&-8;e=l>>>3;d=u[2793]|0;r=d>>>e;if(r&3|0){n=(r&1^1)+e|0;e=11212+(n<<1<<2)|0;r=e+8|0;t=u[r>>2]|0;i=t+8|0;o=u[i>>2]|0;if((e|0)==(o|0))u[2793]=d&~(1<<n);else{u[o+12>>2]=e;u[r>>2]=o}T=n<<3;u[t+4>>2]=T|3;T=t+T+4|0;u[T>>2]=u[T>>2]|1;T=i;v=M;return T|0}s=u[2795]|0;if(l>>>0>s>>>0){if(r|0){n=2<<e;n=r<<e&(n|0-n);n=(n&0-n)+-1|0;a=n>>>12&16;n=n>>>a;r=n>>>5&8;n=n>>>r;i=n>>>2&4;n=n>>>i;e=n>>>1&2;n=n>>>e;t=n>>>1&1;t=(r|a|i|e|t)+(n>>>t)|0;n=11212+(t<<1<<2)|0;e=n+8|0;i=u[e>>2]|0;a=i+8|0;r=u[a>>2]|0;if((n|0)==(r|0)){e=d&~(1<<t);u[2793]=e}else{u[r+12>>2]=n;u[e>>2]=r;e=d}o=(t<<3)-l|0;u[i+4>>2]=l|3;t=i+l|0;u[t+4>>2]=o|1;u[t+o>>2]=o;if(s|0){i=u[2798]|0;n=s>>>3;r=11212+(n<<1<<2)|0;n=1<<n;if(!(e&n)){u[2793]=e|n;n=r;e=r+8|0}else{e=r+8|0;n=u[e>>2]|0}u[e>>2]=i;u[n+12>>2]=i;u[i+8>>2]=n;u[i+12>>2]=r}u[2795]=o;u[2798]=t;T=a;v=M;return T|0}f=u[2794]|0;if(f){r=(f&0-f)+-1|0;a=r>>>12&16;r=r>>>a;o=r>>>5&8;r=r>>>o;c=r>>>2&4;r=r>>>c;t=r>>>1&2;r=r>>>t;e=r>>>1&1;e=u[11476+((o|a|c|t|e)+(r>>>e)<<2)>>2]|0;r=(u[e+4>>2]&-8)-l|0;t=u[e+16+(((u[e+16>>2]|0)==0&1)<<2)>>2]|0;if(!t){c=e;o=r}else{do{a=(u[t+4>>2]&-8)-l|0;c=a>>>0<r>>>0;r=c?a:r;e=c?t:e;t=u[t+16+(((u[t+16>>2]|0)==0&1)<<2)>>2]|0}while((t|0)!=0);c=e;o=r}a=c+l|0;if(c>>>0<a>>>0){i=u[c+24>>2]|0;n=u[c+12>>2]|0;do{if((n|0)==(c|0)){e=c+20|0;n=u[e>>2]|0;if(!n){e=c+16|0;n=u[e>>2]|0;if(!n){r=0;break}}while(1){r=n+20|0;t=u[r>>2]|0;if(t|0){n=t;e=r;continue}r=n+16|0;t=u[r>>2]|0;if(!t)break;else{n=t;e=r}}u[e>>2]=0;r=n}else{r=u[c+8>>2]|0;u[r+12>>2]=n;u[n+8>>2]=r;r=n}}while(0);do{if(i|0){n=u[c+28>>2]|0;e=11476+(n<<2)|0;if((c|0)==(u[e>>2]|0)){u[e>>2]=r;if(!r){u[2794]=f&~(1<<n);break}}else{u[i+16+(((u[i+16>>2]|0)!=(c|0)&1)<<2)>>2]=r;if(!r)break}u[r+24>>2]=i;n=u[c+16>>2]|0;if(n|0){u[r+16>>2]=n;u[n+24>>2]=r}n=u[c+20>>2]|0;if(n|0){u[r+20>>2]=n;u[n+24>>2]=r}}}while(0);if(o>>>0<16){T=o+l|0;u[c+4>>2]=T|3;T=c+T+4|0;u[T>>2]=u[T>>2]|1}else{u[c+4>>2]=l|3;u[a+4>>2]=o|1;u[a+o>>2]=o;if(s|0){t=u[2798]|0;n=s>>>3;r=11212+(n<<1<<2)|0;n=1<<n;if(!(d&n)){u[2793]=d|n;n=r;e=r+8|0}else{e=r+8|0;n=u[e>>2]|0}u[e>>2]=t;u[n+12>>2]=t;u[t+8>>2]=n;u[t+12>>2]=r}u[2795]=o;u[2798]=a}T=c+8|0;v=M;return T|0}else d=l}else d=l}else d=l}else if(e>>>0<=4294967231){e=e+11|0;l=e&-8;c=u[2794]|0;if(c){t=0-l|0;e=e>>>8;if(e){if(l>>>0>16777215)f=31;else{d=(e+1048320|0)>>>16&8;g=e<<d;s=(g+520192|0)>>>16&4;g=g<<s;f=(g+245760|0)>>>16&2;f=14-(s|d|f)+(g<<f>>>15)|0;f=l>>>(f+7|0)&1|f<<1}}else f=0;r=u[11476+(f<<2)>>2]|0;e:do{if(!r){r=0;e=0;g=57}else{e=0;a=l<<((f|0)==31?0:25-(f>>>1)|0);o=0;while(1){i=(u[r+4>>2]&-8)-l|0;if(i>>>0<t>>>0)if(!i){e=r;t=0;i=r;g=61;break e}else{e=r;t=i}i=u[r+20>>2]|0;r=u[r+16+(a>>>31<<2)>>2]|0;o=(i|0)==0|(i|0)==(r|0)?o:i;i=(r|0)==0;if(i){r=o;g=57;break}else a=a<<((i^1)&1)}}}while(0);if((g|0)==57){if((r|0)==0&(e|0)==0){e=2<<f;e=c&(e|0-e);if(!e){d=l;break}d=(e&0-e)+-1|0;a=d>>>12&16;d=d>>>a;o=d>>>5&8;d=d>>>o;f=d>>>2&4;d=d>>>f;s=d>>>1&2;d=d>>>s;r=d>>>1&1;e=0;r=u[11476+((o|a|f|s|r)+(d>>>r)<<2)>>2]|0}if(!r){f=e;a=t}else{i=r;g=61}}if((g|0)==61)while(1){g=0;r=(u[i+4>>2]&-8)-l|0;d=r>>>0<t>>>0;r=d?r:t;e=d?i:e;i=u[i+16+(((u[i+16>>2]|0)==0&1)<<2)>>2]|0;if(!i){f=e;a=r;break}else{t=r;g=61}}if((f|0)!=0?a>>>0<((u[2795]|0)-l|0)>>>0:0){o=f+l|0;if(f>>>0>=o>>>0){T=0;v=M;return T|0}i=u[f+24>>2]|0;n=u[f+12>>2]|0;do{if((n|0)==(f|0)){e=f+20|0;n=u[e>>2]|0;if(!n){e=f+16|0;n=u[e>>2]|0;if(!n){n=0;break}}while(1){r=n+20|0;t=u[r>>2]|0;if(t|0){n=t;e=r;continue}r=n+16|0;t=u[r>>2]|0;if(!t)break;else{n=t;e=r}}u[e>>2]=0}else{T=u[f+8>>2]|0;u[T+12>>2]=n;u[n+8>>2]=T}}while(0);do{if(i){e=u[f+28>>2]|0;r=11476+(e<<2)|0;if((f|0)==(u[r>>2]|0)){u[r>>2]=n;if(!n){t=c&~(1<<e);u[2794]=t;break}}else{u[i+16+(((u[i+16>>2]|0)!=(f|0)&1)<<2)>>2]=n;if(!n){t=c;break}}u[n+24>>2]=i;e=u[f+16>>2]|0;if(e|0){u[n+16>>2]=e;u[e+24>>2]=n}e=u[f+20>>2]|0;if(e){u[n+20>>2]=e;u[e+24>>2]=n;t=c}else t=c}else t=c}while(0);do{if(a>>>0>=16){u[f+4>>2]=l|3;u[o+4>>2]=a|1;u[o+a>>2]=a;n=a>>>3;if(a>>>0<256){r=11212+(n<<1<<2)|0;e=u[2793]|0;n=1<<n;if(!(e&n)){u[2793]=e|n;n=r;e=r+8|0}else{e=r+8|0;n=u[e>>2]|0}u[e>>2]=o;u[n+12>>2]=o;u[o+8>>2]=n;u[o+12>>2]=r;break}n=a>>>8;if(n){if(a>>>0>16777215)n=31;else{g=(n+1048320|0)>>>16&8;T=n<<g;w=(T+520192|0)>>>16&4;T=T<<w;n=(T+245760|0)>>>16&2;n=14-(w|g|n)+(T<<n>>>15)|0;n=a>>>(n+7|0)&1|n<<1}}else n=0;r=11476+(n<<2)|0;u[o+28>>2]=n;e=o+16|0;u[e+4>>2]=0;u[e>>2]=0;e=1<<n;if(!(t&e)){u[2794]=t|e;u[r>>2]=o;u[o+24>>2]=r;u[o+12>>2]=o;u[o+8>>2]=o;break}e=a<<((n|0)==31?0:25-(n>>>1)|0);r=u[r>>2]|0;while(1){if((u[r+4>>2]&-8|0)==(a|0)){g=97;break}t=r+16+(e>>>31<<2)|0;n=u[t>>2]|0;if(!n){g=96;break}else{e=e<<1;r=n}}if((g|0)==96){u[t>>2]=o;u[o+24>>2]=r;u[o+12>>2]=o;u[o+8>>2]=o;break}else if((g|0)==97){g=r+8|0;T=u[g>>2]|0;u[T+12>>2]=o;u[g>>2]=o;u[o+8>>2]=T;u[o+12>>2]=r;u[o+24>>2]=0;break}}else{T=a+l|0;u[f+4>>2]=T|3;T=f+T+4|0;u[T>>2]=u[T>>2]|1}}while(0);T=f+8|0;v=M;return T|0}else d=l}else d=l}else d=-1}while(0);r=u[2795]|0;if(r>>>0>=d>>>0){n=r-d|0;e=u[2798]|0;if(n>>>0>15){T=e+d|0;u[2798]=T;u[2795]=n;u[T+4>>2]=n|1;u[T+n>>2]=n;u[e+4>>2]=d|3}else{u[2795]=0;u[2798]=0;u[e+4>>2]=r|3;T=e+r+4|0;u[T>>2]=u[T>>2]|1}T=e+8|0;v=M;return T|0}a=u[2796]|0;if(a>>>0>d>>>0){w=a-d|0;u[2796]=w;T=u[2799]|0;g=T+d|0;u[2799]=g;u[g+4>>2]=w|1;u[T+4>>2]=d|3;T=T+8|0;v=M;return T|0}if(!(u[2911]|0)){u[2913]=4096;u[2912]=4096;u[2914]=-1;u[2915]=-1;u[2916]=0;u[2904]=0;e=_&-16^1431655768;u[_>>2]=e;u[2911]=e;e=4096}else e=u[2913]|0;f=d+48|0;c=d+47|0;o=e+c|0;i=0-e|0;l=o&i;if(l>>>0<=d>>>0){T=0;v=M;return T|0}e=u[2903]|0;if(e|0?(s=u[2901]|0,_=s+l|0,_>>>0<=s>>>0|_>>>0>e>>>0):0){T=0;v=M;return T|0}e:do{if(!(u[2904]&4)){r=u[2799]|0;n:do{if(r){t=11620;while(1){e=u[t>>2]|0;if(e>>>0<=r>>>0?(b=t+4|0,(e+(u[b>>2]|0)|0)>>>0>r>>>0):0)break;e=u[t+8>>2]|0;if(!e){g=118;break n}else t=e}n=o-a&i;if(n>>>0<2147483647){e=yE(n|0)|0;if((e|0)==((u[t>>2]|0)+(u[b>>2]|0)|0)){if((e|0)!=(-1|0)){a=n;o=e;g=135;break e}}else{t=e;g=126}}else n=0}else g=118}while(0);do{if((g|0)==118){r=yE(0)|0;if((r|0)!=(-1|0)?(n=r,p=u[2912]|0,h=p+-1|0,n=((h&n|0)==0?0:(h+n&0-p)-n|0)+l|0,p=u[2901]|0,h=n+p|0,n>>>0>d>>>0&n>>>0<2147483647):0){b=u[2903]|0;if(b|0?h>>>0<=p>>>0|h>>>0>b>>>0:0){n=0;break}e=yE(n|0)|0;if((e|0)==(r|0)){a=n;o=r;g=135;break e}else{t=e;g=126}}else n=0}}while(0);do{if((g|0)==126){r=0-n|0;if(!(f>>>0>n>>>0&(n>>>0<2147483647&(t|0)!=(-1|0))))if((t|0)==(-1|0)){n=0;break}else{a=n;o=t;g=135;break e}e=u[2913]|0;e=c-n+e&0-e;if(e>>>0>=2147483647){a=n;o=t;g=135;break e}if((yE(e|0)|0)==(-1|0)){yE(r|0)|0;n=0;break}else{a=e+n|0;o=t;g=135;break e}}}while(0);u[2904]=u[2904]|4;g=133}else{n=0;g=133}}while(0);if(((g|0)==133?l>>>0<2147483647:0)?(w=yE(l|0)|0,b=yE(0)|0,m=b-w|0,y=m>>>0>(d+40|0)>>>0,!((w|0)==(-1|0)|y^1|w>>>0<b>>>0&((w|0)!=(-1|0)&(b|0)!=(-1|0))^1)):0){a=y?m:n;o=w;g=135}if((g|0)==135){n=(u[2901]|0)+a|0;u[2901]=n;if(n>>>0>(u[2902]|0)>>>0)u[2902]=n;c=u[2799]|0;do{if(c){n=11620;while(1){e=u[n>>2]|0;r=n+4|0;t=u[r>>2]|0;if((o|0)==(e+t|0)){g=145;break}i=u[n+8>>2]|0;if(!i)break;else n=i}if(((g|0)==145?(u[n+12>>2]&8|0)==0:0)?c>>>0<o>>>0&c>>>0>=e>>>0:0){u[r>>2]=t+a;T=c+8|0;T=(T&7|0)==0?0:0-T&7;g=c+T|0;T=(u[2796]|0)+(a-T)|0;u[2799]=g;u[2796]=T;u[g+4>>2]=T|1;u[g+T+4>>2]=40;u[2800]=u[2915];break}if(o>>>0<(u[2797]|0)>>>0)u[2797]=o;r=o+a|0;n=11620;while(1){if((u[n>>2]|0)==(r|0)){g=153;break}e=u[n+8>>2]|0;if(!e)break;else n=e}if((g|0)==153?(u[n+12>>2]&8|0)==0:0){u[n>>2]=o;s=n+4|0;u[s>>2]=(u[s>>2]|0)+a;s=o+8|0;s=o+((s&7|0)==0?0:0-s&7)|0;n=r+8|0;n=r+((n&7|0)==0?0:0-n&7)|0;l=s+d|0;f=n-s-d|0;u[s+4>>2]=d|3;do{if((n|0)!=(c|0)){if((n|0)==(u[2798]|0)){T=(u[2795]|0)+f|0;u[2795]=T;u[2798]=l;u[l+4>>2]=T|1;u[l+T>>2]=T;break}e=u[n+4>>2]|0;if((e&3|0)==1){a=e&-8;t=e>>>3;e:do{if(e>>>0<256){e=u[n+8>>2]|0;r=u[n+12>>2]|0;if((r|0)==(e|0)){u[2793]=u[2793]&~(1<<t);break}else{u[e+12>>2]=r;u[r+8>>2]=e;break}}else{o=u[n+24>>2]|0;e=u[n+12>>2]|0;do{if((e|0)==(n|0)){t=n+16|0;r=t+4|0;e=u[r>>2]|0;if(!e){e=u[t>>2]|0;if(!e){e=0;break}else r=t}while(1){t=e+20|0;i=u[t>>2]|0;if(i|0){e=i;r=t;continue}t=e+16|0;i=u[t>>2]|0;if(!i)break;else{e=i;r=t}}u[r>>2]=0}else{T=u[n+8>>2]|0;u[T+12>>2]=e;u[e+8>>2]=T}}while(0);if(!o)break;r=u[n+28>>2]|0;t=11476+(r<<2)|0;do{if((n|0)!=(u[t>>2]|0)){u[o+16+(((u[o+16>>2]|0)!=(n|0)&1)<<2)>>2]=e;if(!e)break e}else{u[t>>2]=e;if(e|0)break;u[2794]=u[2794]&~(1<<r);break e}}while(0);u[e+24>>2]=o;r=n+16|0;t=u[r>>2]|0;if(t|0){u[e+16>>2]=t;u[t+24>>2]=e}r=u[r+4>>2]|0;if(!r)break;u[e+20>>2]=r;u[r+24>>2]=e}}while(0);n=n+a|0;i=a+f|0}else i=f;n=n+4|0;u[n>>2]=u[n>>2]&-2;u[l+4>>2]=i|1;u[l+i>>2]=i;n=i>>>3;if(i>>>0<256){r=11212+(n<<1<<2)|0;e=u[2793]|0;n=1<<n;if(!(e&n)){u[2793]=e|n;n=r;e=r+8|0}else{e=r+8|0;n=u[e>>2]|0}u[e>>2]=l;u[n+12>>2]=l;u[l+8>>2]=n;u[l+12>>2]=r;break}n=i>>>8;do{if(!n)n=0;else{if(i>>>0>16777215){n=31;break}g=(n+1048320|0)>>>16&8;T=n<<g;w=(T+520192|0)>>>16&4;T=T<<w;n=(T+245760|0)>>>16&2;n=14-(w|g|n)+(T<<n>>>15)|0;n=i>>>(n+7|0)&1|n<<1}}while(0);t=11476+(n<<2)|0;u[l+28>>2]=n;e=l+16|0;u[e+4>>2]=0;u[e>>2]=0;e=u[2794]|0;r=1<<n;if(!(e&r)){u[2794]=e|r;u[t>>2]=l;u[l+24>>2]=t;u[l+12>>2]=l;u[l+8>>2]=l;break}e=i<<((n|0)==31?0:25-(n>>>1)|0);r=u[t>>2]|0;while(1){if((u[r+4>>2]&-8|0)==(i|0)){g=194;break}t=r+16+(e>>>31<<2)|0;n=u[t>>2]|0;if(!n){g=193;break}else{e=e<<1;r=n}}if((g|0)==193){u[t>>2]=l;u[l+24>>2]=r;u[l+12>>2]=l;u[l+8>>2]=l;break}else if((g|0)==194){g=r+8|0;T=u[g>>2]|0;u[T+12>>2]=l;u[g>>2]=l;u[l+8>>2]=T;u[l+12>>2]=r;u[l+24>>2]=0;break}}else{T=(u[2796]|0)+f|0;u[2796]=T;u[2799]=l;u[l+4>>2]=T|1}}while(0);T=s+8|0;v=M;return T|0}n=11620;while(1){e=u[n>>2]|0;if(e>>>0<=c>>>0?(T=e+(u[n+4>>2]|0)|0,T>>>0>c>>>0):0)break;n=u[n+8>>2]|0}i=T+-47|0;e=i+8|0;e=i+((e&7|0)==0?0:0-e&7)|0;i=c+16|0;e=e>>>0<i>>>0?c:e;n=e+8|0;r=o+8|0;r=(r&7|0)==0?0:0-r&7;g=o+r|0;r=a+-40-r|0;u[2799]=g;u[2796]=r;u[g+4>>2]=r|1;u[g+r+4>>2]=40;u[2800]=u[2915];r=e+4|0;u[r>>2]=27;u[n>>2]=u[2905];u[n+4>>2]=u[2906];u[n+8>>2]=u[2907];u[n+12>>2]=u[2908];u[2905]=o;u[2906]=a;u[2908]=0;u[2907]=n;n=e+24|0;do{g=n;n=n+4|0;u[n>>2]=7}while((g+8|0)>>>0<T>>>0);if((e|0)!=(c|0)){o=e-c|0;u[r>>2]=u[r>>2]&-2;u[c+4>>2]=o|1;u[e>>2]=o;n=o>>>3;if(o>>>0<256){r=11212+(n<<1<<2)|0;e=u[2793]|0;n=1<<n;if(!(e&n)){u[2793]=e|n;n=r;e=r+8|0}else{e=r+8|0;n=u[e>>2]|0}u[e>>2]=c;u[n+12>>2]=c;u[c+8>>2]=n;u[c+12>>2]=r;break}n=o>>>8;if(n){if(o>>>0>16777215)r=31;else{g=(n+1048320|0)>>>16&8;T=n<<g;w=(T+520192|0)>>>16&4;T=T<<w;r=(T+245760|0)>>>16&2;r=14-(w|g|r)+(T<<r>>>15)|0;r=o>>>(r+7|0)&1|r<<1}}else r=0;t=11476+(r<<2)|0;u[c+28>>2]=r;u[c+20>>2]=0;u[i>>2]=0;n=u[2794]|0;e=1<<r;if(!(n&e)){u[2794]=n|e;u[t>>2]=c;u[c+24>>2]=t;u[c+12>>2]=c;u[c+8>>2]=c;break}e=o<<((r|0)==31?0:25-(r>>>1)|0);r=u[t>>2]|0;while(1){if((u[r+4>>2]&-8|0)==(o|0)){g=216;break}t=r+16+(e>>>31<<2)|0;n=u[t>>2]|0;if(!n){g=215;break}else{e=e<<1;r=n}}if((g|0)==215){u[t>>2]=c;u[c+24>>2]=r;u[c+12>>2]=c;u[c+8>>2]=c;break}else if((g|0)==216){g=r+8|0;T=u[g>>2]|0;u[T+12>>2]=c;u[g>>2]=c;u[c+8>>2]=T;u[c+12>>2]=r;u[c+24>>2]=0;break}}}else{T=u[2797]|0;if((T|0)==0|o>>>0<T>>>0)u[2797]=o;u[2905]=o;u[2906]=a;u[2908]=0;u[2802]=u[2911];u[2801]=-1;n=0;do{T=11212+(n<<1<<2)|0;u[T+12>>2]=T;u[T+8>>2]=T;n=n+1|0}while((n|0)!=32);T=o+8|0;T=(T&7|0)==0?0:0-T&7;g=o+T|0;T=a+-40-T|0;u[2799]=g;u[2796]=T;u[g+4>>2]=T|1;u[g+T+4>>2]=40;u[2800]=u[2915]}}while(0);n=u[2796]|0;if(n>>>0>d>>>0){w=n-d|0;u[2796]=w;T=u[2799]|0;g=T+d|0;u[2799]=g;u[g+4>>2]=w|1;u[T+4>>2]=d|3;T=T+8|0;v=M;return T|0}}u[(uA()|0)>>2]=12;T=0;v=M;return T|0}function Jk(e){e=e|0;var n=0,r=0,t=0,i=0,o=0,a=0,f=0,c=0;if(!e)return;r=e+-8|0;i=u[2797]|0;e=u[e+-4>>2]|0;n=e&-8;c=r+n|0;do{if(!(e&1)){t=u[r>>2]|0;if(!(e&3))return;a=r+(0-t)|0;o=t+n|0;if(a>>>0<i>>>0)return;if((a|0)==(u[2798]|0)){e=c+4|0;n=u[e>>2]|0;if((n&3|0)!=3){f=a;n=o;break}u[2795]=o;u[e>>2]=n&-2;u[a+4>>2]=o|1;u[a+o>>2]=o;return}r=t>>>3;if(t>>>0<256){e=u[a+8>>2]|0;n=u[a+12>>2]|0;if((n|0)==(e|0)){u[2793]=u[2793]&~(1<<r);f=a;n=o;break}else{u[e+12>>2]=n;u[n+8>>2]=e;f=a;n=o;break}}i=u[a+24>>2]|0;e=u[a+12>>2]|0;do{if((e|0)==(a|0)){r=a+16|0;n=r+4|0;e=u[n>>2]|0;if(!e){e=u[r>>2]|0;if(!e){e=0;break}else n=r}while(1){r=e+20|0;t=u[r>>2]|0;if(t|0){e=t;n=r;continue}r=e+16|0;t=u[r>>2]|0;if(!t)break;else{e=t;n=r}}u[n>>2]=0}else{f=u[a+8>>2]|0;u[f+12>>2]=e;u[e+8>>2]=f}}while(0);if(i){n=u[a+28>>2]|0;r=11476+(n<<2)|0;if((a|0)==(u[r>>2]|0)){u[r>>2]=e;if(!e){u[2794]=u[2794]&~(1<<n);f=a;n=o;break}}else{u[i+16+(((u[i+16>>2]|0)!=(a|0)&1)<<2)>>2]=e;if(!e){f=a;n=o;break}}u[e+24>>2]=i;n=a+16|0;r=u[n>>2]|0;if(r|0){u[e+16>>2]=r;u[r+24>>2]=e}n=u[n+4>>2]|0;if(n){u[e+20>>2]=n;u[n+24>>2]=e;f=a;n=o}else{f=a;n=o}}else{f=a;n=o}}else{f=r;a=r}}while(0);if(a>>>0>=c>>>0)return;e=c+4|0;t=u[e>>2]|0;if(!(t&1))return;if(!(t&2)){e=u[2798]|0;if((c|0)==(u[2799]|0)){c=(u[2796]|0)+n|0;u[2796]=c;u[2799]=f;u[f+4>>2]=c|1;if((f|0)!=(e|0))return;u[2798]=0;u[2795]=0;return}if((c|0)==(e|0)){c=(u[2795]|0)+n|0;u[2795]=c;u[2798]=a;u[f+4>>2]=c|1;u[a+c>>2]=c;return}i=(t&-8)+n|0;r=t>>>3;do{if(t>>>0<256){n=u[c+8>>2]|0;e=u[c+12>>2]|0;if((e|0)==(n|0)){u[2793]=u[2793]&~(1<<r);break}else{u[n+12>>2]=e;u[e+8>>2]=n;break}}else{o=u[c+24>>2]|0;e=u[c+12>>2]|0;do{if((e|0)==(c|0)){r=c+16|0;n=r+4|0;e=u[n>>2]|0;if(!e){e=u[r>>2]|0;if(!e){r=0;break}else n=r}while(1){r=e+20|0;t=u[r>>2]|0;if(t|0){e=t;n=r;continue}r=e+16|0;t=u[r>>2]|0;if(!t)break;else{e=t;n=r}}u[n>>2]=0;r=e}else{r=u[c+8>>2]|0;u[r+12>>2]=e;u[e+8>>2]=r;r=e}}while(0);if(o|0){e=u[c+28>>2]|0;n=11476+(e<<2)|0;if((c|0)==(u[n>>2]|0)){u[n>>2]=r;if(!r){u[2794]=u[2794]&~(1<<e);break}}else{u[o+16+(((u[o+16>>2]|0)!=(c|0)&1)<<2)>>2]=r;if(!r)break}u[r+24>>2]=o;e=c+16|0;n=u[e>>2]|0;if(n|0){u[r+16>>2]=n;u[n+24>>2]=r}e=u[e+4>>2]|0;if(e|0){u[r+20>>2]=e;u[e+24>>2]=r}}}}while(0);u[f+4>>2]=i|1;u[a+i>>2]=i;if((f|0)==(u[2798]|0)){u[2795]=i;return}}else{u[e>>2]=t&-2;u[f+4>>2]=n|1;u[a+n>>2]=n;i=n}e=i>>>3;if(i>>>0<256){r=11212+(e<<1<<2)|0;n=u[2793]|0;e=1<<e;if(!(n&e)){u[2793]=n|e;e=r;n=r+8|0}else{n=r+8|0;e=u[n>>2]|0}u[n>>2]=f;u[e+12>>2]=f;u[f+8>>2]=e;u[f+12>>2]=r;return}e=i>>>8;if(e){if(i>>>0>16777215)e=31;else{a=(e+1048320|0)>>>16&8;c=e<<a;o=(c+520192|0)>>>16&4;c=c<<o;e=(c+245760|0)>>>16&2;e=14-(o|a|e)+(c<<e>>>15)|0;e=i>>>(e+7|0)&1|e<<1}}else e=0;t=11476+(e<<2)|0;u[f+28>>2]=e;u[f+20>>2]=0;u[f+16>>2]=0;n=u[2794]|0;r=1<<e;do{if(n&r){n=i<<((e|0)==31?0:25-(e>>>1)|0);r=u[t>>2]|0;while(1){if((u[r+4>>2]&-8|0)==(i|0)){e=73;break}t=r+16+(n>>>31<<2)|0;e=u[t>>2]|0;if(!e){e=72;break}else{n=n<<1;r=e}}if((e|0)==72){u[t>>2]=f;u[f+24>>2]=r;u[f+12>>2]=f;u[f+8>>2]=f;break}else if((e|0)==73){a=r+8|0;c=u[a>>2]|0;u[c+12>>2]=f;u[a>>2]=f;u[f+8>>2]=c;u[f+12>>2]=r;u[f+24>>2]=0;break}}else{u[2794]=n|r;u[t>>2]=f;u[f+24>>2]=t;u[f+12>>2]=f;u[f+8>>2]=f}}while(0);c=(u[2801]|0)+-1|0;u[2801]=c;if(!c)e=11628;else return;while(1){e=u[e>>2]|0;if(!e)break;else e=e+8|0}u[2801]=-1;return}function Zk(e,n){e=e|0;n=n|0;var r=0,t=0;if(!e){n=Kk(n)|0;return n|0}if(n>>>0>4294967231){u[(uA()|0)>>2]=12;n=0;return n|0}r=Qk(e+-8|0,n>>>0<11?16:n+11&-8)|0;if(r|0){n=r+8|0;return n|0}r=Kk(n)|0;if(!r){n=0;return n|0}t=u[e+-4>>2]|0;t=(t&-8)-((t&3|0)==0?8:4)|0;pE(r|0,e|0,(t>>>0<n>>>0?t:n)|0)|0;Jk(e);n=r;return n|0}function Qk(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;d=e+4|0;s=u[d>>2]|0;r=s&-8;f=e+r|0;if(!(s&3)){if(n>>>0<256){e=0;return e|0}if(r>>>0>=(n+4|0)>>>0?(r-n|0)>>>0<=u[2913]<<1>>>0:0)return e|0;e=0;return e|0}if(r>>>0>=n>>>0){r=r-n|0;if(r>>>0<=15)return e|0;l=e+n|0;u[d>>2]=s&1|n|2;u[l+4>>2]=r|3;d=l+r+4|0;u[d>>2]=u[d>>2]|1;$k(l,r);return e|0}if((f|0)==(u[2799]|0)){l=(u[2796]|0)+r|0;r=l-n|0;t=e+n|0;if(l>>>0<=n>>>0){e=0;return e|0}u[d>>2]=s&1|n|2;u[t+4>>2]=r|1;u[2799]=t;u[2796]=r;return e|0}if((f|0)==(u[2798]|0)){i=(u[2795]|0)+r|0;if(i>>>0<n>>>0){e=0;return e|0}r=i-n|0;t=s&1;if(r>>>0>15){s=e+n|0;l=s+r|0;u[d>>2]=t|n|2;u[s+4>>2]=r|1;u[l>>2]=r;t=l+4|0;u[t>>2]=u[t>>2]&-2;t=s}else{u[d>>2]=t|i|2;t=e+i+4|0;u[t>>2]=u[t>>2]|1;t=0;r=0}u[2795]=r;u[2798]=t;return e|0}t=u[f+4>>2]|0;if(t&2|0){e=0;return e|0}c=(t&-8)+r|0;if(c>>>0<n>>>0){e=0;return e|0}l=c-n|0;i=t>>>3;do{if(t>>>0<256){t=u[f+8>>2]|0;r=u[f+12>>2]|0;if((r|0)==(t|0)){u[2793]=u[2793]&~(1<<i);break}else{u[t+12>>2]=r;u[r+8>>2]=t;break}}else{a=u[f+24>>2]|0;r=u[f+12>>2]|0;do{if((r|0)==(f|0)){i=f+16|0;t=i+4|0;r=u[t>>2]|0;if(!r){r=u[i>>2]|0;if(!r){i=0;break}else o=i}else o=t;while(1){i=r+20|0;t=u[i>>2]|0;if(t|0){r=t;o=i;continue}t=r+16|0;i=u[t>>2]|0;if(!i)break;else{r=i;o=t}}u[o>>2]=0;i=r}else{i=u[f+8>>2]|0;u[i+12>>2]=r;u[r+8>>2]=i;i=r}}while(0);if(a|0){r=u[f+28>>2]|0;t=11476+(r<<2)|0;if((f|0)==(u[t>>2]|0)){u[t>>2]=i;if(!i){u[2794]=u[2794]&~(1<<r);break}}else{u[a+16+(((u[a+16>>2]|0)!=(f|0)&1)<<2)>>2]=i;if(!i)break}u[i+24>>2]=a;r=f+16|0;t=u[r>>2]|0;if(t|0){u[i+16>>2]=t;u[t+24>>2]=i}r=u[r+4>>2]|0;if(r|0){u[i+20>>2]=r;u[r+24>>2]=i}}}}while(0);r=s&1;if(l>>>0<16){u[d>>2]=c|r|2;d=e+c+4|0;u[d>>2]=u[d>>2]|1;return e|0}else{s=e+n|0;u[d>>2]=r|n|2;u[s+4>>2]=l|3;d=s+l+4|0;u[d>>2]=u[d>>2]|1;$k(s,l);return e|0}return 0}function $k(e,n){e=e|0;n=n|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;c=e+n|0;r=u[e+4>>2]|0;do{if(!(r&1)){t=u[e>>2]|0;if(!(r&3))return;o=e+(0-t)|0;a=t+n|0;if((o|0)==(u[2798]|0)){e=c+4|0;r=u[e>>2]|0;if((r&3|0)!=3){f=o;r=a;break}u[2795]=a;u[e>>2]=r&-2;u[o+4>>2]=a|1;u[o+a>>2]=a;return}n=t>>>3;if(t>>>0<256){e=u[o+8>>2]|0;r=u[o+12>>2]|0;if((r|0)==(e|0)){u[2793]=u[2793]&~(1<<n);f=o;r=a;break}else{u[e+12>>2]=r;u[r+8>>2]=e;f=o;r=a;break}}i=u[o+24>>2]|0;e=u[o+12>>2]|0;do{if((e|0)==(o|0)){n=o+16|0;r=n+4|0;e=u[r>>2]|0;if(!e){e=u[n>>2]|0;if(!e){e=0;break}else r=n}while(1){n=e+20|0;t=u[n>>2]|0;if(t|0){e=t;r=n;continue}n=e+16|0;t=u[n>>2]|0;if(!t)break;else{e=t;r=n}}u[r>>2]=0}else{f=u[o+8>>2]|0;u[f+12>>2]=e;u[e+8>>2]=f}}while(0);if(i){r=u[o+28>>2]|0;n=11476+(r<<2)|0;if((o|0)==(u[n>>2]|0)){u[n>>2]=e;if(!e){u[2794]=u[2794]&~(1<<r);f=o;r=a;break}}else{u[i+16+(((u[i+16>>2]|0)!=(o|0)&1)<<2)>>2]=e;if(!e){f=o;r=a;break}}u[e+24>>2]=i;r=o+16|0;n=u[r>>2]|0;if(n|0){u[e+16>>2]=n;u[n+24>>2]=e}r=u[r+4>>2]|0;if(r){u[e+20>>2]=r;u[r+24>>2]=e;f=o;r=a}else{f=o;r=a}}else{f=o;r=a}}else{f=e;r=n}}while(0);e=c+4|0;t=u[e>>2]|0;if(!(t&2)){e=u[2798]|0;if((c|0)==(u[2799]|0)){c=(u[2796]|0)+r|0;u[2796]=c;u[2799]=f;u[f+4>>2]=c|1;if((f|0)!=(e|0))return;u[2798]=0;u[2795]=0;return}if((c|0)==(e|0)){c=(u[2795]|0)+r|0;u[2795]=c;u[2798]=f;u[f+4>>2]=c|1;u[f+c>>2]=c;return}o=(t&-8)+r|0;n=t>>>3;do{if(t>>>0<256){r=u[c+8>>2]|0;e=u[c+12>>2]|0;if((e|0)==(r|0)){u[2793]=u[2793]&~(1<<n);break}else{u[r+12>>2]=e;u[e+8>>2]=r;break}}else{i=u[c+24>>2]|0;e=u[c+12>>2]|0;do{if((e|0)==(c|0)){n=c+16|0;r=n+4|0;e=u[r>>2]|0;if(!e){e=u[n>>2]|0;if(!e){n=0;break}else r=n}while(1){n=e+20|0;t=u[n>>2]|0;if(t|0){e=t;r=n;continue}n=e+16|0;t=u[n>>2]|0;if(!t)break;else{e=t;r=n}}u[r>>2]=0;n=e}else{n=u[c+8>>2]|0;u[n+12>>2]=e;u[e+8>>2]=n;n=e}}while(0);if(i|0){e=u[c+28>>2]|0;r=11476+(e<<2)|0;if((c|0)==(u[r>>2]|0)){u[r>>2]=n;if(!n){u[2794]=u[2794]&~(1<<e);break}}else{u[i+16+(((u[i+16>>2]|0)!=(c|0)&1)<<2)>>2]=n;if(!n)break}u[n+24>>2]=i;e=c+16|0;r=u[e>>2]|0;if(r|0){u[n+16>>2]=r;u[r+24>>2]=n}e=u[e+4>>2]|0;if(e|0){u[n+20>>2]=e;u[e+24>>2]=n}}}}while(0);u[f+4>>2]=o|1;u[f+o>>2]=o;if((f|0)==(u[2798]|0)){u[2795]=o;return}else r=o}else{u[e>>2]=t&-2;u[f+4>>2]=r|1;u[f+r>>2]=r}e=r>>>3;if(r>>>0<256){n=11212+(e<<1<<2)|0;r=u[2793]|0;e=1<<e;if(!(r&e)){u[2793]=r|e;e=n;r=n+8|0}else{r=n+8|0;e=u[r>>2]|0}u[r>>2]=f;u[e+12>>2]=f;u[f+8>>2]=e;u[f+12>>2]=n;return}e=r>>>8;if(e){if(r>>>0>16777215)e=31;else{a=(e+1048320|0)>>>16&8;c=e<<a;o=(c+520192|0)>>>16&4;c=c<<o;e=(c+245760|0)>>>16&2;e=14-(o|a|e)+(c<<e>>>15)|0;e=r>>>(e+7|0)&1|e<<1}}else e=0;i=11476+(e<<2)|0;u[f+28>>2]=e;u[f+20>>2]=0;u[f+16>>2]=0;n=u[2794]|0;t=1<<e;if(!(n&t)){u[2794]=n|t;u[i>>2]=f;u[f+24>>2]=i;u[f+12>>2]=f;u[f+8>>2]=f;return}n=r<<((e|0)==31?0:25-(e>>>1)|0);t=u[i>>2]|0;while(1){if((u[t+4>>2]&-8|0)==(r|0)){e=69;break}i=t+16+(n>>>31<<2)|0;e=u[i>>2]|0;if(!e){e=68;break}else{n=n<<1;t=e}}if((e|0)==68){u[i>>2]=f;u[f+24>>2]=t;u[f+12>>2]=f;u[f+8>>2]=f;return}else if((e|0)==69){a=t+8|0;c=u[a>>2]|0;u[c+12>>2]=f;u[a>>2]=f;u[f+8>>2]=c;u[f+12>>2]=t;u[f+24>>2]=0;return}}function eA(){return 11668}function nA(e){e=e|0;var n=0,r=0;n=v;v=v+16|0;r=n;u[r>>2]=fA(u[e+60>>2]|0)|0;e=iA(tn(6,r|0)|0)|0;v=n;return e|0}function rA(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0;d=v;v=v+48|0;l=d+16|0;o=d;i=d+32|0;f=e+28|0;t=u[f>>2]|0;u[i>>2]=t;c=e+20|0;t=(u[c>>2]|0)-t|0;u[i+4>>2]=t;u[i+8>>2]=n;u[i+12>>2]=r;t=t+r|0;a=e+60|0;u[o>>2]=u[a>>2];u[o+4>>2]=i;u[o+8>>2]=2;o=iA(an(146,o|0)|0)|0;e:do{if((t|0)!=(o|0)){n=2;while(1){if((o|0)<0)break;t=t-o|0;p=u[i+4>>2]|0;_=o>>>0>p>>>0;i=_?i+8|0:i;n=(_<<31>>31)+n|0;p=o-(_?p:0)|0;u[i>>2]=(u[i>>2]|0)+p;_=i+4|0;u[_>>2]=(u[_>>2]|0)-p;u[l>>2]=u[a>>2];u[l+4>>2]=i;u[l+8>>2]=n;o=iA(an(146,l|0)|0)|0;if((t|0)==(o|0)){s=3;break e}}u[e+16>>2]=0;u[f>>2]=0;u[c>>2]=0;u[e>>2]=u[e>>2]|32;if((n|0)==2)r=0;else r=r-(u[i+4>>2]|0)|0}else s=3}while(0);if((s|0)==3){p=u[e+44>>2]|0;u[e+16>>2]=p+(u[e+48>>2]|0);u[f>>2]=p;u[c>>2]=p}v=d;return r|0}function tA(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0;i=v;v=v+32|0;o=i;t=i+20|0;u[o>>2]=u[e+60>>2];u[o+4>>2]=0;u[o+8>>2]=n;u[o+12>>2]=t;u[o+16>>2]=r;if((iA(on(140,o|0)|0)|0)<0){u[t>>2]=-1;e=-1}else e=u[t>>2]|0;v=i;return e|0}function iA(e){e=e|0;if(e>>>0>4294963200){u[(uA()|0)>>2]=0-e;e=-1}return e|0}function uA(){return(oA()|0)+64|0}function oA(){
return aA()|0}function aA(){return 2092}function fA(e){e=e|0;return e|0}function cA(e,n,r){e=e|0;n=n|0;r=r|0;var i=0,o=0;o=v;v=v+32|0;i=o;u[e+36>>2]=2;if((u[e>>2]&64|0)==0?(u[i>>2]=u[e+60>>2],u[i+4>>2]=21523,u[i+8>>2]=o+16,Xe(54,i|0)|0):0)t[e+75>>0]=-1;i=rA(e,n,r)|0;v=o;return i|0}function lA(e,n){e=e|0;n=n|0;var r=0,i=0;r=t[e>>0]|0;i=t[n>>0]|0;if(r<<24>>24==0?1:r<<24>>24!=i<<24>>24)e=i;else{do{e=e+1|0;n=n+1|0;r=t[e>>0]|0;i=t[n>>0]|0}while(!(r<<24>>24==0?1:r<<24>>24!=i<<24>>24));e=i}return(r&255)-(e&255)|0}function sA(e,n,r){e=e|0;n=n|0;r=r|0;var i=0,u=0;e:do{if(!r)e=0;else{while(1){i=t[e>>0]|0;u=t[n>>0]|0;if(i<<24>>24!=u<<24>>24)break;r=r+-1|0;if(!r){e=0;break e}else{e=e+1|0;n=n+1|0}}e=(i&255)-(u&255)|0}}while(0);return e|0}function dA(e,n,r){e=e|0;n=n|0;r=r|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0,h=0,b=0,m=0;m=v;v=v+224|0;d=m+120|0;_=m+80|0;h=m;b=m+136|0;i=_;o=i+40|0;do{u[i>>2]=0;i=i+4|0}while((i|0)<(o|0));u[d>>2]=u[r>>2];if((_A(0,n,d,h,_)|0)<0)r=-1;else{if((u[e+76>>2]|0)>-1)p=vA(e)|0;else p=0;r=u[e>>2]|0;s=r&32;if((t[e+74>>0]|0)<1)u[e>>2]=r&-33;i=e+48|0;if(!(u[i>>2]|0)){o=e+44|0;a=u[o>>2]|0;u[o>>2]=b;f=e+28|0;u[f>>2]=b;c=e+20|0;u[c>>2]=b;u[i>>2]=80;l=e+16|0;u[l>>2]=b+80;r=_A(e,n,d,h,_)|0;if(a){kS[u[e+36>>2]&7](e,0,0)|0;r=(u[c>>2]|0)==0?-1:r;u[o>>2]=a;u[i>>2]=0;u[l>>2]=0;u[f>>2]=0;u[c>>2]=0}}else r=_A(e,n,d,h,_)|0;i=u[e>>2]|0;u[e>>2]=i|s;if(p|0)pA(e);r=(i&32|0)==0?r:-1}v=m;return r|0}function _A(e,n,r,o,a){e=e|0;n=n|0;r=r|0;o=o|0;a=a|0;var f=0,c=0,s=0,d=0,_=0,p=0,h=0,b=0,m=0,y=0,w=0,g=0,T=0,M=0,k=0,A=0,E=0,S=0,C=0,R=0,P=0,B=0,O=0;O=v;v=v+64|0;C=O+16|0;R=O;E=O+24|0;P=O+8|0;B=O+20|0;u[C>>2]=n;M=(e|0)!=0;k=E+40|0;A=k;E=E+39|0;S=P+4|0;c=0;f=0;p=0;e:while(1){do{if((f|0)>-1)if((c|0)>(2147483647-f|0)){u[(uA()|0)>>2]=75;f=-1;break}else{f=c+f|0;break}}while(0);c=t[n>>0]|0;if(!(c<<24>>24)){T=87;break}else s=n;n:while(1){switch(c<<24>>24){case 37:{c=s;T=9;break n}case 0:{c=s;break n}default:{}}g=s+1|0;u[C>>2]=g;c=t[g>>0]|0;s=g}n:do{if((T|0)==9)while(1){T=0;if((t[s+1>>0]|0)!=37)break n;c=c+1|0;s=s+2|0;u[C>>2]=s;if((t[s>>0]|0)==37)T=9;else break}}while(0);c=c-n|0;if(M)hA(e,n,c);if(c|0){n=s;continue}d=s+1|0;c=(t[d>>0]|0)+-48|0;if(c>>>0<10){g=(t[s+2>>0]|0)==36;w=g?c:-1;p=g?1:p;d=g?s+3|0:d}else w=-1;u[C>>2]=d;c=t[d>>0]|0;s=(c<<24>>24)+-32|0;n:do{if(s>>>0<32){_=0;h=c;while(1){c=1<<s;if(!(c&75913)){c=h;break n}_=c|_;d=d+1|0;u[C>>2]=d;c=t[d>>0]|0;s=(c<<24>>24)+-32|0;if(s>>>0>=32)break;else h=c}}else _=0}while(0);if(c<<24>>24==42){s=d+1|0;c=(t[s>>0]|0)+-48|0;if(c>>>0<10?(t[d+2>>0]|0)==36:0){u[a+(c<<2)>>2]=10;c=u[o+((t[s>>0]|0)+-48<<3)>>2]|0;p=1;d=d+3|0}else{if(p|0){f=-1;break}if(M){p=(u[r>>2]|0)+3&~3;c=u[p>>2]|0;u[r>>2]=p+4;p=0;d=s}else{c=0;p=0;d=s}}u[C>>2]=d;g=(c|0)<0;c=g?0-c|0:c;_=g?_|8192:_}else{c=bA(C)|0;if((c|0)<0){f=-1;break}d=u[C>>2]|0}do{if((t[d>>0]|0)==46){if((t[d+1>>0]|0)!=42){u[C>>2]=d+1;s=bA(C)|0;d=u[C>>2]|0;break}h=d+2|0;s=(t[h>>0]|0)+-48|0;if(s>>>0<10?(t[d+3>>0]|0)==36:0){u[a+(s<<2)>>2]=10;s=u[o+((t[h>>0]|0)+-48<<3)>>2]|0;d=d+4|0;u[C>>2]=d;break}if(p|0){f=-1;break e}if(M){g=(u[r>>2]|0)+3&~3;s=u[g>>2]|0;u[r>>2]=g+4}else s=0;u[C>>2]=h;d=h}else s=-1}while(0);y=0;while(1){if(((t[d>>0]|0)+-65|0)>>>0>57){f=-1;break e}g=d+1|0;u[C>>2]=g;h=t[(t[d>>0]|0)+-65+(6409+(y*58|0))>>0]|0;b=h&255;if((b+-1|0)>>>0<8){y=b;d=g}else break}if(!(h<<24>>24)){f=-1;break}m=(w|0)>-1;do{if(h<<24>>24==19){if(m){f=-1;break e}else T=49}else{if(m){u[a+(w<<2)>>2]=b;m=o+(w<<3)|0;w=u[m+4>>2]|0;T=R;u[T>>2]=u[m>>2];u[T+4>>2]=w;T=49;break}if(!M){f=0;break e}mA(R,b,r)}}while(0);if((T|0)==49?(T=0,!M):0){c=0;n=g;continue}d=t[d>>0]|0;d=(y|0)!=0&(d&15|0)==3?d&-33:d;m=_&-65537;w=(_&8192|0)==0?_:m;n:do{switch(d|0){case 110:switch((y&255)<<24>>24){case 0:{u[u[R>>2]>>2]=f;c=0;n=g;continue e}case 1:{u[u[R>>2]>>2]=f;c=0;n=g;continue e}case 2:{c=u[R>>2]|0;u[c>>2]=f;u[c+4>>2]=((f|0)<0)<<31>>31;c=0;n=g;continue e}case 3:{i[u[R>>2]>>1]=f;c=0;n=g;continue e}case 4:{t[u[R>>2]>>0]=f;c=0;n=g;continue e}case 6:{u[u[R>>2]>>2]=f;c=0;n=g;continue e}case 7:{c=u[R>>2]|0;u[c>>2]=f;u[c+4>>2]=((f|0)<0)<<31>>31;c=0;n=g;continue e}default:{c=0;n=g;continue e}}case 112:{d=120;s=s>>>0>8?s:8;n=w|8;T=61;break}case 88:case 120:{n=w;T=61;break}case 111:{d=R;n=u[d>>2]|0;d=u[d+4>>2]|0;b=wA(n,d,k)|0;m=A-b|0;_=0;h=6873;s=(w&8|0)==0|(s|0)>(m|0)?s:m+1|0;m=w;T=67;break}case 105:case 100:{d=R;n=u[d>>2]|0;d=u[d+4>>2]|0;if((d|0)<0){n=cE(0,0,n|0,d|0)|0;d=L;_=R;u[_>>2]=n;u[_+4>>2]=d;_=1;h=6873;T=66;break n}else{_=(w&2049|0)!=0&1;h=(w&2048|0)==0?(w&1|0)==0?6873:6875:6874;T=66;break n}}case 117:{d=R;_=0;h=6873;n=u[d>>2]|0;d=u[d+4>>2]|0;T=66;break}case 99:{t[E>>0]=u[R>>2];n=E;_=0;h=6873;b=k;d=1;s=m;break}case 109:{d=TA(u[(uA()|0)>>2]|0)|0;T=71;break}case 115:{d=u[R>>2]|0;d=d|0?d:6883;T=71;break}case 67:{u[P>>2]=u[R>>2];u[S>>2]=0;u[R>>2]=P;b=-1;d=P;T=75;break}case 83:{n=u[R>>2]|0;if(!s){kA(e,32,c,0,w);n=0;T=84}else{b=s;d=n;T=75}break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{c=EA(e,+l[R>>3],c,s,w,d)|0;n=g;continue e}default:{_=0;h=6873;b=k;d=s;s=w}}}while(0);n:do{if((T|0)==61){w=R;y=u[w>>2]|0;w=u[w+4>>2]|0;b=yA(y,w,k,d&32)|0;h=(n&8|0)==0|(y|0)==0&(w|0)==0;_=h?0:2;h=h?6873:6873+(d>>4)|0;m=n;n=y;d=w;T=67}else if((T|0)==66){b=gA(n,d,k)|0;m=w;T=67}else if((T|0)==71){T=0;w=MA(d,0,s)|0;y=(w|0)==0;n=d;_=0;h=6873;b=y?d+s|0:w;d=y?s:w-d|0;s=m}else if((T|0)==75){T=0;h=d;n=0;s=0;while(1){_=u[h>>2]|0;if(!_)break;s=AA(B,_)|0;if((s|0)<0|s>>>0>(b-n|0)>>>0)break;n=s+n|0;if(b>>>0>n>>>0)h=h+4|0;else break}if((s|0)<0){f=-1;break e}kA(e,32,c,n,w);if(!n){n=0;T=84}else{_=0;while(1){s=u[d>>2]|0;if(!s){T=84;break n}s=AA(B,s)|0;_=s+_|0;if((_|0)>(n|0)){T=84;break n}hA(e,B,s);if(_>>>0>=n>>>0){T=84;break}else d=d+4|0}}}}while(0);if((T|0)==67){T=0;d=(n|0)!=0|(d|0)!=0;w=(s|0)!=0|d;d=((d^1)&1)+(A-b)|0;n=w?b:k;b=k;d=w?(s|0)>(d|0)?s:d:s;s=(s|0)>-1?m&-65537:m}else if((T|0)==84){T=0;kA(e,32,c,n,w^8192);c=(c|0)>(n|0)?c:n;n=g;continue}y=b-n|0;m=(d|0)<(y|0)?y:d;w=m+_|0;c=(c|0)<(w|0)?w:c;kA(e,32,c,w,s);hA(e,h,_);kA(e,48,c,w,s^65536);kA(e,48,m,y,0);hA(e,n,y);kA(e,32,c,w,s^8192);n=g}e:do{if((T|0)==87)if(!e)if(!p)f=0;else{f=1;while(1){n=u[a+(f<<2)>>2]|0;if(!n)break;mA(o+(f<<3)|0,n,r);f=f+1|0;if((f|0)>=10){f=1;break e}}while(1){if(u[a+(f<<2)>>2]|0){f=-1;break e}f=f+1|0;if((f|0)>=10){f=1;break}}}}while(0);v=O;return f|0}function vA(e){e=e|0;return 0}function pA(e){e=e|0;return}function hA(e,n,r){e=e|0;n=n|0;r=r|0;if(!(u[e>>2]&32))xA(n,r,e)|0;return}function bA(e){e=e|0;var n=0,r=0,i=0;r=u[e>>2]|0;i=(t[r>>0]|0)+-48|0;if(i>>>0<10){n=0;do{n=i+(n*10|0)|0;r=r+1|0;u[e>>2]=r;i=(t[r>>0]|0)+-48|0}while(i>>>0<10)}else n=0;return n|0}function mA(e,n,r){e=e|0;n=n|0;r=r|0;var t=0,i=0,o=0;e:do{if(n>>>0<=20)do{switch(n|0){case 9:{t=(u[r>>2]|0)+3&~3;n=u[t>>2]|0;u[r>>2]=t+4;u[e>>2]=n;break e}case 10:{t=(u[r>>2]|0)+3&~3;n=u[t>>2]|0;u[r>>2]=t+4;t=e;u[t>>2]=n;u[t+4>>2]=((n|0)<0)<<31>>31;break e}case 11:{t=(u[r>>2]|0)+3&~3;n=u[t>>2]|0;u[r>>2]=t+4;t=e;u[t>>2]=n;u[t+4>>2]=0;break e}case 12:{t=(u[r>>2]|0)+7&~7;n=t;i=u[n>>2]|0;n=u[n+4>>2]|0;u[r>>2]=t+8;t=e;u[t>>2]=i;u[t+4>>2]=n;break e}case 13:{i=(u[r>>2]|0)+3&~3;t=u[i>>2]|0;u[r>>2]=i+4;t=(t&65535)<<16>>16;i=e;u[i>>2]=t;u[i+4>>2]=((t|0)<0)<<31>>31;break e}case 14:{i=(u[r>>2]|0)+3&~3;t=u[i>>2]|0;u[r>>2]=i+4;i=e;u[i>>2]=t&65535;u[i+4>>2]=0;break e}case 15:{i=(u[r>>2]|0)+3&~3;t=u[i>>2]|0;u[r>>2]=i+4;t=(t&255)<<24>>24;i=e;u[i>>2]=t;u[i+4>>2]=((t|0)<0)<<31>>31;break e}case 16:{i=(u[r>>2]|0)+3&~3;t=u[i>>2]|0;u[r>>2]=i+4;i=e;u[i>>2]=t&255;u[i+4>>2]=0;break e}case 17:{i=(u[r>>2]|0)+7&~7;o=+l[i>>3];u[r>>2]=i+8;l[e>>3]=o;break e}case 18:{i=(u[r>>2]|0)+7&~7;o=+l[i>>3];u[r>>2]=i+8;l[e>>3]=o;break e}default:break e}}while(0)}while(0);return}function yA(e,n,r,i){e=e|0;n=n|0;r=r|0;i=i|0;if(!((e|0)==0&(n|0)==0))do{r=r+-1|0;t[r>>0]=o[6925+(e&15)>>0]|0|i;e=vE(e|0,n|0,4)|0;n=L}while(!((e|0)==0&(n|0)==0));return r|0}function wA(e,n,r){e=e|0;n=n|0;r=r|0;if(!((e|0)==0&(n|0)==0))do{r=r+-1|0;t[r>>0]=e&7|48;e=vE(e|0,n|0,3)|0;n=L}while(!((e|0)==0&(n|0)==0));return r|0}function gA(e,n,r){e=e|0;n=n|0;r=r|0;var i=0;if(n>>>0>0|(n|0)==0&e>>>0>4294967295){while(1){i=wE(e|0,n|0,10,0)|0;r=r+-1|0;t[r>>0]=i&255|48;i=e;e=mE(e|0,n|0,10,0)|0;if(!(n>>>0>9|(n|0)==9&i>>>0>4294967295))break;else n=L}n=e}else n=e;if(n)while(1){r=r+-1|0;t[r>>0]=(n>>>0)%10|0|48;if(n>>>0<10)break;else n=(n>>>0)/10|0}return r|0}function TA(e){e=e|0;return OA(e,u[(BA()|0)+188>>2]|0)|0}function MA(e,n,r){e=e|0;n=n|0;r=r|0;var i=0,o=0,a=0,f=0;a=n&255;i=(r|0)!=0;e:do{if(i&(e&3|0)!=0){o=n&255;while(1){if((t[e>>0]|0)==o<<24>>24){f=6;break e}e=e+1|0;r=r+-1|0;i=(r|0)!=0;if(!(i&(e&3|0)!=0)){f=5;break}}}else f=5}while(0);if((f|0)==5)if(i)f=6;else r=0;e:do{if((f|0)==6){o=n&255;if((t[e>>0]|0)!=o<<24>>24){i=z(a,16843009)|0;n:do{if(r>>>0>3)while(1){a=u[e>>2]^i;if((a&-2139062144^-2139062144)&a+-16843009|0)break;e=e+4|0;r=r+-4|0;if(r>>>0<=3){f=11;break n}}else f=11}while(0);if((f|0)==11)if(!r){r=0;break}while(1){if((t[e>>0]|0)==o<<24>>24)break e;e=e+1|0;r=r+-1|0;if(!r){r=0;break}}}}}while(0);return(r|0?e:0)|0}function kA(e,n,r,t,i){e=e|0;n=n|0;r=r|0;t=t|0;i=i|0;var u=0,o=0;o=v;v=v+256|0;u=o;if((r|0)>(t|0)&(i&73728|0)==0){i=r-t|0;dE(u|0,n|0,(i>>>0<256?i:256)|0)|0;if(i>>>0>255){n=r-t|0;do{hA(e,u,256);i=i+-256|0}while(i>>>0>255);i=n&255}hA(e,u,i)}v=o;return}function AA(e,n){e=e|0;n=n|0;if(!e)e=0;else e=RA(e,n,0)|0;return e|0}function EA(e,n,r,i,a,f){e=e|0;n=+n;r=r|0;i=i|0;a=a|0;f=f|0;var c=0,l=0,s=0,d=0,_=0,p=0,h=0,b=0,m=0,y=0,w=0,g=0,T=0,M=0,k=0,A=0,E=0,S=0,C=0,R=0,P=0,B=0,O=0;O=v;v=v+560|0;s=O+8|0;w=O;B=O+524|0;P=B;d=O+512|0;u[w>>2]=0;R=d+12|0;SA(n)|0;if((L|0)<0){n=-n;S=1;E=6890}else{S=(a&2049|0)!=0&1;E=(a&2048|0)==0?(a&1|0)==0?6891:6896:6893}SA(n)|0;C=L&2146435072;do{if(C>>>0<2146435072|(C|0)==2146435072&false){b=+CA(n,w)*2;c=b!=0;if(c)u[w>>2]=(u[w>>2]|0)+-1;T=f|32;if((T|0)==97){m=f&32;h=(m|0)==0?E:E+9|0;p=S|2;c=12-i|0;do{if(!(i>>>0>11|(c|0)==0)){n=8;do{c=c+-1|0;n=n*16}while((c|0)!=0);if((t[h>>0]|0)==45){n=-(n+(-b-n));break}else{n=b+n-n;break}}else n=b}while(0);l=u[w>>2]|0;c=(l|0)<0?0-l|0:l;c=gA(c,((c|0)<0)<<31>>31,R)|0;if((c|0)==(R|0)){c=d+11|0;t[c>>0]=48}t[c+-1>>0]=(l>>31&2)+43;_=c+-2|0;t[_>>0]=f+15;d=(i|0)<1;s=(a&8|0)==0;c=B;do{C=~~n;l=c+1|0;t[c>>0]=o[6925+C>>0]|m;n=(n-+(C|0))*16;if((l-P|0)==1?!(s&(d&n==0)):0){t[l>>0]=46;c=c+2|0}else c=l}while(n!=0);C=c-P|0;P=R-_|0;R=(i|0)!=0&(C+-2|0)<(i|0)?i+2|0:C;c=P+p+R|0;kA(e,32,r,c,a);hA(e,h,p);kA(e,48,r,c,a^65536);hA(e,B,C);kA(e,48,R-C|0,0,0);hA(e,_,P);kA(e,32,r,c,a^8192);break}l=(i|0)<0?6:i;if(c){c=(u[w>>2]|0)+-28|0;u[w>>2]=c;n=b*268435456}else{n=b;c=u[w>>2]|0}C=(c|0)<0?s:s+288|0;s=C;do{k=~~n>>>0;u[s>>2]=k;s=s+4|0;n=(n-+(k>>>0))*1e9}while(n!=0);if((c|0)>0){d=C;p=s;while(1){_=(c|0)<29?c:29;c=p+-4|0;if(c>>>0>=d>>>0){s=0;do{M=_E(u[c>>2]|0,0,_|0)|0;M=lE(M|0,L|0,s|0,0)|0;k=L;g=wE(M|0,k|0,1e9,0)|0;u[c>>2]=g;s=mE(M|0,k|0,1e9,0)|0;c=c+-4|0}while(c>>>0>=d>>>0);if(s){d=d+-4|0;u[d>>2]=s}}s=p;while(1){if(s>>>0<=d>>>0)break;c=s+-4|0;if(!(u[c>>2]|0))s=c;else break}c=(u[w>>2]|0)-_|0;u[w>>2]=c;if((c|0)>0)p=s;else break}}else d=C;if((c|0)<0){i=((l+25|0)/9|0)+1|0;y=(T|0)==102;do{m=0-c|0;m=(m|0)<9?m:9;if(d>>>0<s>>>0){_=(1<<m)+-1|0;p=1e9>>>m;h=0;c=d;do{k=u[c>>2]|0;u[c>>2]=(k>>>m)+h;h=z(k&_,p)|0;c=c+4|0}while(c>>>0<s>>>0);c=(u[d>>2]|0)==0?d+4|0:d;if(!h){d=c;c=s}else{u[s>>2]=h;d=c;c=s+4|0}}else{d=(u[d>>2]|0)==0?d+4|0:d;c=s}s=y?C:d;s=(c-s>>2|0)>(i|0)?s+(i<<2)|0:c;c=(u[w>>2]|0)+m|0;u[w>>2]=c}while((c|0)<0);c=d;i=s}else{c=d;i=s}k=C;if(c>>>0<i>>>0){s=(k-c>>2)*9|0;_=u[c>>2]|0;if(_>>>0>=10){d=10;do{d=d*10|0;s=s+1|0}while(_>>>0>=d>>>0)}}else s=0;y=(T|0)==103;g=(l|0)!=0;d=l-((T|0)!=102?s:0)+((g&y)<<31>>31)|0;if((d|0)<(((i-k>>2)*9|0)+-9|0)){d=d+9216|0;m=C+4+(((d|0)/9|0)+-1024<<2)|0;d=((d|0)%9|0)+1|0;if((d|0)<9){_=10;do{_=_*10|0;d=d+1|0}while((d|0)!=9)}else _=10;p=u[m>>2]|0;h=(p>>>0)%(_>>>0)|0;d=(m+4|0)==(i|0);if(!(d&(h|0)==0)){b=(((p>>>0)/(_>>>0)|0)&1|0)==0?9007199254740992:9007199254740994;M=(_|0)/2|0;n=h>>>0<M>>>0?.5:d&(h|0)==(M|0)?1:1.5;if(S){M=(t[E>>0]|0)==45;n=M?-n:n;b=M?-b:b}d=p-h|0;u[m>>2]=d;if(b+n!=b){M=d+_|0;u[m>>2]=M;if(M>>>0>999999999){s=m;while(1){d=s+-4|0;u[s>>2]=0;if(d>>>0<c>>>0){c=c+-4|0;u[c>>2]=0}M=(u[d>>2]|0)+1|0;u[d>>2]=M;if(M>>>0>999999999)s=d;else break}}else d=m;s=(k-c>>2)*9|0;p=u[c>>2]|0;if(p>>>0>=10){_=10;do{_=_*10|0;s=s+1|0}while(p>>>0>=_>>>0)}}else d=m}else d=m;d=d+4|0;d=i>>>0>d>>>0?d:i;M=c}else{d=i;M=c}T=d;while(1){if(T>>>0<=M>>>0){w=0;break}c=T+-4|0;if(!(u[c>>2]|0))T=c;else{w=1;break}}i=0-s|0;do{if(y){c=((g^1)&1)+l|0;if((c|0)>(s|0)&(s|0)>-5){_=f+-1|0;l=c+-1-s|0}else{_=f+-2|0;l=c+-1|0}c=a&8;if(!c){if(w?(A=u[T+-4>>2]|0,(A|0)!=0):0){if(!((A>>>0)%10|0)){d=0;c=10;do{c=c*10|0;d=d+1|0}while(!((A>>>0)%(c>>>0)|0|0))}else d=0}else d=9;c=((T-k>>2)*9|0)+-9|0;if((_|32|0)==102){m=c-d|0;m=(m|0)>0?m:0;l=(l|0)<(m|0)?l:m;m=0;break}else{m=c+s-d|0;m=(m|0)>0?m:0;l=(l|0)<(m|0)?l:m;m=0;break}}else m=c}else{_=f;m=a&8}}while(0);y=l|m;p=(y|0)!=0&1;h=(_|32|0)==102;if(h){g=0;c=(s|0)>0?s:0}else{c=(s|0)<0?i:s;c=gA(c,((c|0)<0)<<31>>31,R)|0;d=R;if((d-c|0)<2)do{c=c+-1|0;t[c>>0]=48}while((d-c|0)<2);t[c+-1>>0]=(s>>31&2)+43;c=c+-2|0;t[c>>0]=_;g=c;c=d-c|0}c=S+1+l+p+c|0;kA(e,32,r,c,a);hA(e,E,S);kA(e,48,r,c,a^65536);if(h){_=M>>>0>C>>>0?C:M;m=B+9|0;p=m;h=B+8|0;d=_;do{s=gA(u[d>>2]|0,0,m)|0;if((d|0)==(_|0)){if((s|0)==(m|0)){t[h>>0]=48;s=h}}else if(s>>>0>B>>>0){dE(B|0,48,s-P|0)|0;do{s=s+-1|0}while(s>>>0>B>>>0)}hA(e,s,p-s|0);d=d+4|0}while(d>>>0<=C>>>0);if(y|0)hA(e,6941,1);if(d>>>0<T>>>0&(l|0)>0)while(1){s=gA(u[d>>2]|0,0,m)|0;if(s>>>0>B>>>0){dE(B|0,48,s-P|0)|0;do{s=s+-1|0}while(s>>>0>B>>>0)}hA(e,s,(l|0)<9?l:9);d=d+4|0;s=l+-9|0;if(!(d>>>0<T>>>0&(l|0)>9)){l=s;break}else l=s}kA(e,48,l+9|0,9,0)}else{y=w?T:M+4|0;if((l|0)>-1){w=B+9|0;m=(m|0)==0;i=w;p=0-P|0;h=B+8|0;_=M;do{s=gA(u[_>>2]|0,0,w)|0;if((s|0)==(w|0)){t[h>>0]=48;s=h}do{if((_|0)==(M|0)){d=s+1|0;hA(e,s,1);if(m&(l|0)<1){s=d;break}hA(e,6941,1);s=d}else{if(s>>>0<=B>>>0)break;dE(B|0,48,s+p|0)|0;do{s=s+-1|0}while(s>>>0>B>>>0)}}while(0);P=i-s|0;hA(e,s,(l|0)>(P|0)?P:l);l=l-P|0;_=_+4|0}while(_>>>0<y>>>0&(l|0)>-1)}kA(e,48,l+18|0,18,0);hA(e,g,R-g|0)}kA(e,32,r,c,a^8192)}else{B=(f&32|0)!=0;c=S+3|0;kA(e,32,r,c,a&-65537);hA(e,E,S);hA(e,n!=n|false?B?6917:6921:B?6909:6913,3);kA(e,32,r,c,a^8192)}}while(0);v=O;return((c|0)<(r|0)?r:c)|0}function SA(e){e=+e;var n=0;l[d>>3]=e;n=u[d>>2]|0;L=u[d+4>>2]|0;return n|0}function CA(e,n){e=+e;n=n|0;return+ +LA(e,n)}function LA(e,n){e=+e;n=n|0;var r=0,t=0,i=0;l[d>>3]=e;r=u[d>>2]|0;t=u[d+4>>2]|0;i=vE(r|0,t|0,52)|0;switch(i&2047){case 0:{if(e!=0){e=+LA(e*0x10000000000000000,n);r=(u[n>>2]|0)+-64|0}else r=0;u[n>>2]=r;break}case 2047:break;default:{u[n>>2]=(i&2047)+-1022;u[d>>2]=r;u[d+4>>2]=t&-2146435073|1071644672;e=+l[d>>3]}}return+e}function RA(e,n,r){e=e|0;n=n|0;r=r|0;do{if(e){if(n>>>0<128){t[e>>0]=n;e=1;break}if(!(u[u[(PA()|0)+188>>2]>>2]|0))if((n&-128|0)==57216){t[e>>0]=n;e=1;break}else{u[(uA()|0)>>2]=84;e=-1;break}if(n>>>0<2048){t[e>>0]=n>>>6|192;t[e+1>>0]=n&63|128;e=2;break}if(n>>>0<55296|(n&-8192|0)==57344){t[e>>0]=n>>>12|224;t[e+1>>0]=n>>>6&63|128;t[e+2>>0]=n&63|128;e=3;break}if((n+-65536|0)>>>0<1048576){t[e>>0]=n>>>18|240;t[e+1>>0]=n>>>12&63|128;t[e+2>>0]=n>>>6&63|128;t[e+3>>0]=n&63|128;e=4;break}else{u[(uA()|0)>>2]=84;e=-1;break}}else e=1}while(0);return e|0}function PA(){return aA()|0}function BA(){return aA()|0}function OA(e,n){e=e|0;n=n|0;var r=0,i=0;i=0;while(1){if((o[6943+i>>0]|0)==(e|0)){e=2;break}r=i+1|0;if((r|0)==87){r=7031;i=87;e=5;break}else i=r}if((e|0)==2)if(!i)r=7031;else{r=7031;e=5}if((e|0)==5)while(1){do{e=r;r=r+1|0}while((t[e>>0]|0)!=0);i=i+-1|0;if(!i)break;else e=5}return IA(r,u[n+20>>2]|0)|0}function IA(e,n){e=e|0;n=n|0;return NA(e,n)|0}function NA(e,n){e=e|0;n=n|0;if(!n)n=0;else n=UA(u[n>>2]|0,u[n+4>>2]|0,e)|0;return(n|0?n:e)|0}function UA(e,n,r){e=e|0;n=n|0;r=r|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,v=0;v=(u[e>>2]|0)+1794895138|0;a=FA(u[e+8>>2]|0,v)|0;i=FA(u[e+12>>2]|0,v)|0;o=FA(u[e+16>>2]|0,v)|0;e:do{if((a>>>0<n>>>2>>>0?(_=n-(a<<2)|0,i>>>0<_>>>0&o>>>0<_>>>0):0)?((o|i)&3|0)==0:0){_=i>>>2;d=o>>>2;s=0;while(1){c=a>>>1;l=s+c|0;f=l<<1;o=f+_|0;i=FA(u[e+(o<<2)>>2]|0,v)|0;o=FA(u[e+(o+1<<2)>>2]|0,v)|0;if(!(o>>>0<n>>>0&i>>>0<(n-o|0)>>>0)){i=0;break e}if(t[e+(o+i)>>0]|0){i=0;break e}i=lA(r,e+o|0)|0;if(!i)break;i=(i|0)<0;if((a|0)==1){i=0;break e}else{s=i?s:l;a=i?c:a-c|0}}i=f+d|0;o=FA(u[e+(i<<2)>>2]|0,v)|0;i=FA(u[e+(i+1<<2)>>2]|0,v)|0;if(i>>>0<n>>>0&o>>>0<(n-i|0)>>>0)i=(t[e+(i+o)>>0]|0)==0?e+i|0:0;else i=0}else i=0}while(0);return i|0}function FA(e,n){e=e|0;n=n|0;var r=0;r=gE(e|0)|0;return((n|0)==0?e:r)|0}function xA(e,n,r){e=e|0;n=n|0;r=r|0;var i=0,o=0,a=0,f=0,c=0;i=r+16|0;o=u[i>>2]|0;if(!o){if(!(DA(r)|0)){o=u[i>>2]|0;a=5}else i=0}else a=5;e:do{if((a|0)==5){c=r+20|0;f=u[c>>2]|0;i=f;if((o-f|0)>>>0<n>>>0){i=kS[u[r+36>>2]&7](r,e,n)|0;break}n:do{if((t[r+75>>0]|0)>-1){f=n;while(1){if(!f){a=0;o=e;break n}o=f+-1|0;if((t[e+o>>0]|0)==10)break;else f=o}i=kS[u[r+36>>2]&7](r,e,f)|0;if(i>>>0<f>>>0)break e;a=f;o=e+f|0;n=n-f|0;i=u[c>>2]|0}else{a=0;o=e}}while(0);pE(i|0,o|0,n|0)|0;u[c>>2]=(u[c>>2]|0)+n;i=a+n|0}}while(0);return i|0}function DA(e){e=e|0;var n=0,r=0;n=e+74|0;r=t[n>>0]|0;t[n>>0]=r+255|r;n=u[e>>2]|0;if(!(n&8)){u[e+8>>2]=0;u[e+4>>2]=0;r=u[e+44>>2]|0;u[e+28>>2]=r;u[e+20>>2]=r;u[e+16>>2]=r+(u[e+48>>2]|0);e=0}else{u[e>>2]=n|32;e=-1}return e|0}function HA(e){e=e|0;var n=0,r=0,i=0;i=e;e:do{if(!(i&3))r=4;else{n=i;while(1){if(!(t[e>>0]|0)){e=n;break e}e=e+1|0;n=e;if(!(n&3)){r=4;break}}}}while(0);if((r|0)==4){while(1){n=u[e>>2]|0;if(!((n&-2139062144^-2139062144)&n+-16843009))e=e+4|0;else break}if((n&255)<<24>>24)do{e=e+1|0}while((t[e>>0]|0)!=0)}return e-i|0}function WA(e,n){e=X(e);n=X(n);var r=0,t=0;r=YA(e)|0;do{if((r&2147483647)>>>0<=2139095040){t=YA(n)|0;if((t&2147483647)>>>0<=2139095040)if((t^r|0)<0){e=(r|0)<0?n:e;break}else{e=e<n?n:e;break}}else e=n}while(0);return X(e)}function YA(e){e=X(e);return(c[d>>2]=e,u[d>>2]|0)|0}function VA(e,n){e=X(e);n=X(n);var r=0,t=0;r=zA(e)|0;do{if((r&2147483647)>>>0<=2139095040){t=zA(n)|0;if((t&2147483647)>>>0<=2139095040)if((t^r|0)<0){e=(r|0)<0?e:n;break}else{e=e<n?e:n;break}}else e=n}while(0);return X(e)}function zA(e){e=X(e);return(c[d>>2]=e,u[d>>2]|0)|0}function jA(e,n){e=e|0;n=n|0;var r=0;r=HA(e)|0;return((qA(e,1,r,n)|0)!=(r|0))<<31>>31|0}function qA(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0;i=z(r,n)|0;r=(n|0)==0?0:r;if((u[t+76>>2]|0)>-1){o=(vA(t)|0)==0;e=xA(e,i,t)|0;if(!o)pA(t)}else e=xA(e,i,t)|0;if((e|0)!=(i|0))r=(e>>>0)/(n>>>0)|0;return r|0}function GA(e,n){e=e|0;n=n|0;var r=0,i=0,a=0,f=0,c=0,l=0,s=0;s=v;v=v+16|0;c=s;l=n&255;t[c>>0]=l;i=e+16|0;a=u[i>>2]|0;if(!a){if(!(DA(e)|0)){a=u[i>>2]|0;f=4}else r=-1}else f=4;do{if((f|0)==4){f=e+20|0;i=u[f>>2]|0;if(i>>>0<a>>>0?(r=n&255,(r|0)!=(t[e+75>>0]|0)):0){u[f>>2]=i+1;t[i>>0]=l;break}if((kS[u[e+36>>2]&7](e,c,1)|0)==1)r=o[c>>0]|0;else r=-1}}while(0);v=s;return r|0}function XA(e,n){e=e|0;n=n|0;var r=0,t=0;r=v;v=v+16|0;t=r;u[t>>2]=n;n=dA(u[584]|0,e,t)|0;v=r;return n|0}function KA(e){e=e|0;var n=0,r=0,i=0,o=0;i=u[584]|0;if((u[i+76>>2]|0)>-1)o=vA(i)|0;else o=0;do{if((jA(e,i)|0)<0)e=1;else{if((t[i+75>>0]|0)!=10?(n=i+20|0,r=u[n>>2]|0,r>>>0<(u[i+16>>2]|0)>>>0):0){u[n>>2]=r+1;t[r>>0]=10;e=0;break}e=(GA(i,10)|0)<0}}while(0);if(o|0)pA(i);return e<<31>>31|0}function JA(e,n){e=e|0;n=n|0;return dA(u[584]|0,e,n)|0}function ZA(e){e=e|0;je()}function QA(e){e=e|0;return}function $A(e,n){e=e|0;n=n|0;return 0}function eE(e){e=e|0;if((nE(e+4|0)|0)==-1){yS[u[(u[e>>2]|0)+8>>2]&127](e);e=1}else e=0;return e|0}function nE(e){e=e|0;var n=0;n=u[e>>2]|0;u[e>>2]=n+-1;return n+-1|0}function rE(e){e=e|0;if(eE(e)|0)tE(e);return}function tE(e){e=e|0;var n=0;n=e+8|0;if(!((u[n>>2]|0)!=0?(nE(n)|0)!=-1:0))yS[u[(u[e>>2]|0)+16>>2]&127](e);return}function iE(e){e=e|0;var n=0;n=(e|0)==0?1:e;while(1){e=Kk(n)|0;if(e|0)break;e=aE()|0;if(!e){e=0;break}US[e&0]()}return e|0}function uE(e){e=e|0;return iE(e)|0}function oE(e){e=e|0;Jk(e);return}function aE(){var e=0;e=u[2933]|0;u[2933]=e+0;return e|0}function fE(){}function cE(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;t=n-t-(r>>>0>e>>>0|0)>>>0;return(L=t,e-r>>>0|0)|0}function lE(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;r=e+r>>>0;return(L=n+t+(r>>>0<e>>>0|0)>>>0,r|0)|0}function sE(e){e=+e;return e>=0?+R(e+.5):+V(e-.5)}function dE(e,n,r){e=e|0;n=n|0;r=r|0;var i=0,o=0,a=0,f=0;a=e+r|0;n=n&255;if((r|0)>=67){while(e&3){t[e>>0]=n;e=e+1|0}i=a&-4|0;o=i-64|0;f=n|n<<8|n<<16|n<<24;while((e|0)<=(o|0)){u[e>>2]=f;u[e+4>>2]=f;u[e+8>>2]=f;u[e+12>>2]=f;u[e+16>>2]=f;u[e+20>>2]=f;u[e+24>>2]=f;u[e+28>>2]=f;u[e+32>>2]=f;u[e+36>>2]=f;u[e+40>>2]=f;u[e+44>>2]=f;u[e+48>>2]=f;u[e+52>>2]=f;u[e+56>>2]=f;u[e+60>>2]=f;e=e+64|0}while((e|0)<(i|0)){u[e>>2]=f;e=e+4|0}}while((e|0)<(a|0)){t[e>>0]=n;e=e+1|0}return a-r|0}function _E(e,n,r){e=e|0;n=n|0;r=r|0;if((r|0)<32){L=n<<r|(e&(1<<r)-1<<32-r)>>>32-r;return e<<r}L=e<<r-32;return 0}function vE(e,n,r){e=e|0;n=n|0;r=r|0;if((r|0)<32){L=n>>>r;return e>>>r|(n&(1<<r)-1)<<32-r}L=0;return n>>>r-32|0}function pE(e,n,r){e=e|0;n=n|0;r=r|0;var i=0,o=0,a=0;if((r|0)>=8192)return He(e|0,n|0,r|0)|0;a=e|0;o=e+r|0;if((e&3)==(n&3)){while(e&3){if(!r)return a|0;t[e>>0]=t[n>>0]|0;e=e+1|0;n=n+1|0;r=r-1|0}r=o&-4|0;i=r-64|0;while((e|0)<=(i|0)){u[e>>2]=u[n>>2];u[e+4>>2]=u[n+4>>2];u[e+8>>2]=u[n+8>>2];u[e+12>>2]=u[n+12>>2];u[e+16>>2]=u[n+16>>2];u[e+20>>2]=u[n+20>>2];u[e+24>>2]=u[n+24>>2];u[e+28>>2]=u[n+28>>2];u[e+32>>2]=u[n+32>>2];u[e+36>>2]=u[n+36>>2];u[e+40>>2]=u[n+40>>2];u[e+44>>2]=u[n+44>>2];u[e+48>>2]=u[n+48>>2];u[e+52>>2]=u[n+52>>2];u[e+56>>2]=u[n+56>>2];u[e+60>>2]=u[n+60>>2];e=e+64|0;n=n+64|0}while((e|0)<(r|0)){u[e>>2]=u[n>>2];e=e+4|0;n=n+4|0}}else{r=o-4|0;while((e|0)<(r|0)){t[e>>0]=t[n>>0]|0;t[e+1>>0]=t[n+1>>0]|0;t[e+2>>0]=t[n+2>>0]|0;t[e+3>>0]=t[n+3>>0]|0;e=e+4|0;n=n+4|0}}while((e|0)<(o|0)){t[e>>0]=t[n>>0]|0;e=e+1|0;n=n+1|0}return a|0}function hE(e){e=e|0;var n=0;n=t[h+(e&255)>>0]|0;if((n|0)<8)return n|0;n=t[h+(e>>8&255)>>0]|0;if((n|0)<8)return n+8|0;n=t[h+(e>>16&255)>>0]|0;if((n|0)<8)return n+16|0;return(t[h+(e>>>24)>>0]|0)+24|0}function bE(e,n,r,t,i){e=e|0;n=n|0;r=r|0;t=t|0;i=i|0;var o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,v=0,p=0;s=e;c=n;l=c;a=r;_=t;f=_;if(!l){o=(i|0)!=0;if(!f){if(o){u[i>>2]=(s>>>0)%(a>>>0);u[i+4>>2]=0}_=0;i=(s>>>0)/(a>>>0)>>>0;return(L=_,i)|0}else{if(!o){_=0;i=0;return(L=_,i)|0}u[i>>2]=e|0;u[i+4>>2]=n&0;_=0;i=0;return(L=_,i)|0}}o=(f|0)==0;do{if(a){if(!o){o=(G(f|0)|0)-(G(l|0)|0)|0;if(o>>>0<=31){d=o+1|0;f=31-o|0;n=o-31>>31;a=d;e=s>>>(d>>>0)&n|l<<f;n=l>>>(d>>>0)&n;o=0;f=s<<f;break}if(!i){_=0;i=0;return(L=_,i)|0}u[i>>2]=e|0;u[i+4>>2]=c|n&0;_=0;i=0;return(L=_,i)|0}o=a-1|0;if(o&a|0){f=(G(a|0)|0)+33-(G(l|0)|0)|0;p=64-f|0;d=32-f|0;c=d>>31;v=f-32|0;n=v>>31;a=f;e=d-1>>31&l>>>(v>>>0)|(l<<d|s>>>(f>>>0))&n;n=n&l>>>(f>>>0);o=s<<p&c;f=(l<<p|s>>>(v>>>0))&c|s<<d&f-33>>31;break}if(i|0){u[i>>2]=o&s;u[i+4>>2]=0}if((a|0)==1){v=c|n&0;p=e|0|0;return(L=v,p)|0}else{p=hE(a|0)|0;v=l>>>(p>>>0)|0;p=l<<32-p|s>>>(p>>>0)|0;return(L=v,p)|0}}else{if(o){if(i|0){u[i>>2]=(l>>>0)%(a>>>0);u[i+4>>2]=0}v=0;p=(l>>>0)/(a>>>0)>>>0;return(L=v,p)|0}if(!s){if(i|0){u[i>>2]=0;u[i+4>>2]=(l>>>0)%(f>>>0)}v=0;p=(l>>>0)/(f>>>0)>>>0;return(L=v,p)|0}o=f-1|0;if(!(o&f)){if(i|0){u[i>>2]=e|0;u[i+4>>2]=o&l|n&0}v=0;p=l>>>((hE(f|0)|0)>>>0);return(L=v,p)|0}o=(G(f|0)|0)-(G(l|0)|0)|0;if(o>>>0<=30){n=o+1|0;f=31-o|0;a=n;e=l<<f|s>>>(n>>>0);n=l>>>(n>>>0);o=0;f=s<<f;break}if(!i){v=0;p=0;return(L=v,p)|0}u[i>>2]=e|0;u[i+4>>2]=c|n&0;v=0;p=0;return(L=v,p)|0}}while(0);if(!a){l=f;c=0;f=0}else{d=r|0|0;s=_|t&0;l=lE(d|0,s|0,-1,-1)|0;r=L;c=f;f=0;do{t=c;c=o>>>31|c<<1;o=f|o<<1;t=e<<1|t>>>31|0;_=e>>>31|n<<1|0;cE(l|0,r|0,t|0,_|0)|0;p=L;v=p>>31|((p|0)<0?-1:0)<<1;f=v&1;e=cE(t|0,_|0,v&d|0,(((p|0)<0?-1:0)>>31|((p|0)<0?-1:0)<<1)&s|0)|0;n=L;a=a-1|0}while((a|0)!=0);l=c;c=0}a=0;if(i|0){u[i>>2]=e;u[i+4>>2]=n}v=(o|0)>>>31|(l|a)<<1|(a<<1|o>>>31)&0|c;p=(o<<1|0)&-2|f;return(L=v,p)|0}function mE(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;return bE(e,n,r,t,0)|0}function yE(e){e=e|0;var n=0,r=0;r=e+15&-16|0;n=u[s>>2]|0;e=n+r|0;if((r|0)>0&(e|0)<(n|0)|(e|0)<0){$()|0;Ye(12);return-1}u[s>>2]=e;if((e|0)>(Q()|0)?(Z()|0)==0:0){u[s>>2]=n;Ye(12);return-1}return n|0}function wE(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;var i=0,o=0;o=v;v=v+16|0;i=o|0;bE(e,n,r,t,i)|0;v=o;return(L=u[i+4>>2]|0,u[i>>2]|0)|0}function gE(e){e=e|0;return(e&255)<<24|(e>>8&255)<<16|(e>>16&255)<<8|e>>>24|0}function TE(e,n,r,t,i,u){e=e|0;n=n|0;r=r|0;t=t|0;i=i|0;u=u|0;hS[e&1](n|0,r|0,t|0,i|0,u|0)}function ME(e,n,r){e=e|0;n=n|0;r=+r;bS[e&31](n|0,+r)}function kE(e,n,r,t){e=e|0;n=n|0;r=X(r);t=X(t);return X(mS[e&0](n|0,X(r),X(t)))}function AE(e,n){e=e|0;n=n|0;yS[e&127](n|0)}function EE(e,n,r){e=e|0;n=n|0;r=r|0;wS[e&31](n|0,r|0)}function SE(e,n){e=e|0;n=n|0;return gS[e&31](n|0)|0}function CE(e,n,r,t,i){e=e|0;n=n|0;r=+r;t=+t;i=i|0;TS[e&1](n|0,+r,+t,i|0)}function LE(e,n,r,t){e=e|0;n=n|0;r=+r;t=+t;MS[e&1](n|0,+r,+t)}function RE(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;return kS[e&7](n|0,r|0,t|0)|0}function PE(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;return+AS[e&1](n|0,r|0,t|0)}function BE(e,n){e=e|0;n=n|0;return+ES[e&15](n|0)}function OE(e,n,r){e=e|0;n=n|0;r=+r;return SS[e&1](n|0,+r)|0}function IE(e,n,r){e=e|0;n=n|0;r=r|0;return CS[e&15](n|0,r|0)|0}function NE(e,n,r,t,i,u){e=e|0;n=n|0;r=r|0;t=+t;i=+i;u=u|0;LS[e&1](n|0,r|0,+t,+i,u|0)}function UE(e,n,r,t,i,u,o){e=e|0;n=n|0;r=r|0;t=t|0;i=i|0;u=u|0;o=o|0;RS[e&1](n|0,r|0,t|0,i|0,u|0,o|0)}function FE(e,n,r){e=e|0;n=n|0;r=r|0;return+PS[e&7](n|0,r|0)}function xE(e){e=e|0;return BS[e&7]()|0}function DE(e,n,r,t,i){e=e|0;n=n|0;r=r|0;t=t|0;i=+i;OS[e&1](n|0,r|0,t|0,+i)}function HE(e,n,r,t,i,u,o){e=e|0;n=n|0;r=r|0;t=X(t);i=i|0;u=X(u);o=o|0;IS[e&1](n|0,r|0,X(t),i|0,X(u),o|0)}function WE(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;NS[e&15](n|0,r|0,t|0)}function YE(e){e=e|0;US[e&0]()}function VE(e,n,r,t){e=e|0;n=n|0;r=r|0;t=+t;FS[e&15](n|0,r|0,+t)}function zE(e,n,r){e=e|0;n=+n;r=+r;return xS[e&1](+n,+r)|0}function jE(e,n,r,t,i){e=e|0;n=n|0;r=r|0;t=t|0;i=i|0;DS[e&15](n|0,r|0,t|0,i|0)}function qE(e,n,r,t,i){e=e|0;n=n|0;r=r|0;t=t|0;i=i|0;K(0)}function GE(e,n){e=e|0;n=+n;K(1)}function XE(e,n,r){e=e|0;n=X(n);r=X(r);K(2);return cn}function KE(e){e=e|0;K(3)}function JE(e,n){e=e|0;n=n|0;K(4)}function ZE(e){e=e|0;K(5);return 0}function QE(e,n,r,t){e=e|0;n=+n;r=+r;t=t|0;K(6)}function $E(e,n,r){e=e|0;n=+n;r=+r;K(7)}function eS(e,n,r){e=e|0;n=n|0;r=r|0;K(8);return 0}function nS(e,n,r){e=e|0;n=n|0;r=r|0;K(9);return 0}function rS(e){e=e|0;K(10);return 0}function tS(e,n){e=e|0;n=+n;K(11);return 0}function iS(e,n){e=e|0;n=n|0;K(12);return 0}function uS(e,n,r,t,i){e=e|0;n=n|0;r=+r;t=+t;i=i|0;K(13)}function oS(e,n,r,t,i,u){e=e|0;n=n|0;r=r|0;t=t|0;i=i|0;u=u|0;K(14)}function aS(e,n){e=e|0;n=n|0;K(15);return 0}function fS(){K(16);return 0}function cS(e,n,r,t){e=e|0;n=n|0;r=r|0;t=+t;K(17)}function lS(e,n,r,t,i,u){e=e|0;n=n|0;r=X(r);t=t|0;i=X(i);u=u|0;K(18)}function sS(e,n,r){e=e|0;n=n|0;r=r|0;K(19)}function dS(){K(20)}function _S(e,n,r){e=e|0;n=n|0;r=+r;K(21)}function vS(e,n){e=+e;n=+n;K(22);return 0}function pS(e,n,r,t){e=e|0;n=n|0;r=r|0;t=t|0;K(23)}var hS=[qE,Sw];var bS=[GE,Hi,Wi,Yi,Vi,zi,ji,qi,Xi,Ki,Zi,Qi,$i,eu,nu,ru,tu,iu,uu,GE,GE,GE,GE,GE,GE,GE,GE,GE,GE,GE,GE,GE];var mS=[XE];var yS=[KE,Jk,QA,Ya,Va,za,jd,qd,Gd,Hb,Wb,Yb,cw,lw,sw,lk,sk,dk,yi,ki,Gi,Ji,ao,fo,Ma,Qa,bf,Yf,fc,Rc,el,Ml,Yl,fs,Rs,Ks,vd,Od,__,B_,Z_,hv,Nv,ep,Tp,Hp,th,Sh,Dh,Yh,fb,sb,Lb,jb,Xb,vm,Pm,Km,by,$a,Ig,bT,NT,$T,kM,YM,ek,tk,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE,KE];var wS=[JE,ko,Ai,Ei,Li,Ri,Pi,Bi,Oi,Ii,Fi,xi,Di,Tu,Au,Eu,Su,Cu,Lu,Ru,Nu,Du,lo,wo,Ep,Vp,Fg,Ay,iT,JE,JE,JE];var gS=[ZE,Kk,nA,Ao,cu,_u,vu,pu,hu,bu,mu,wu,gu,Uu,Fu,so,co,oh,bm,Yg,zg,ZE,ZE,ZE,ZE,ZE,ZE,ZE,ZE,ZE,ZE,ZE];var TS=[QE,_o];var MS=[$E,Bb];var kS=[eS,En,rA,tA,cA,il,b_,tM];var AS=[nS,$s];var ES=[rS,Mu,ku,Pu,vo,po,ho,bo,mo,yo,rS,rS,rS,rS,rS,rS];var SS=[tS,Nh];var CS=[iS,Zk,$A,xu,La,qf,Sl,ql,Fd,U_,Nm,DT,iS,iS,iS,iS];var LS=[uS,gf];var RS=[oS,CM];var PS=[aS,Bu,go,To,Mo,md,aS,aS];var BS=[fS,Eo,bi,Gh,pb,$b,ak,fS];var OS=[cS,wv];var IS=[lS,Wu];var NS=[sS,lu,yu,Ou,Iu,dc,Ic,ds,Dv,ip,$m,rg,gT,qM,sS,sS];var US=[dS];var FS=[_S,Si,Ci,Ni,Ui,ou,au,fu,nv,Rh,_S,_S,_S,_S,_S,_S];var xS=[vS,Fb];var DS=[pS,Is,vh,$h,gb,om,Ty,Kg,mk,pS,pS,pS,pS,pS,pS,pS];return{_roundf:sE,stackSave:sn,getTempRet0:hn,_memset:dE,setThrew:vn,_bitshift64Lshr:vE,_bitshift64Shl:_E,_llvm_cttz_i32:hE,_sbrk:yE,_memcpy:pE,stackAlloc:ln,___uremdi3:wE,_nbind_init:Ok,_i64Subtract:cE,___udivmoddi4:bE,setTempRet0:pn,_i64Add:lE,_emscripten_get_global_libc:eA,__GLOBAL__sub_I_Binding_cc:Ag,___udivdi3:mE,_llvm_bswap_i32:gE,__GLOBAL__sub_I_nbind_cc:So,_free:Jk,runPostSets:fE,establishStackSpace:_n,stackRestore:dn,_malloc:Kk,__GLOBAL__sub_I_common_cc:fy,stackAlloc:ln,stackSave:sn,stackRestore:dn,establishStackSpace:_n,setThrew:vn,setTempRet0:pn,getTempRet0:hn,dynCall_viiiii:TE,dynCall_vid:ME,dynCall_fiff:kE,dynCall_vi:AE,dynCall_vii:EE,dynCall_ii:SE,dynCall_viddi:CE,dynCall_vidd:LE,dynCall_iiii:RE,dynCall_diii:PE,dynCall_di:BE,dynCall_iid:OE,dynCall_iii:IE,dynCall_viiddi:NE,dynCall_viiiiii:UE,dynCall_dii:FE,dynCall_i:xE,dynCall_viiid:DE,dynCall_viififi:HE,dynCall_viii:WE,dynCall_v:YE,dynCall_viid:VE,dynCall_idd:zE,dynCall_viiii:jE}}(Module.asmGlobalArg,Module.asmLibraryArg,buffer),_roundf=Module._roundf=asm._roundf,stackSave=Module.stackSave=asm.stackSave,getTempRet0=Module.getTempRet0=asm.getTempRet0,_memset=Module._memset=asm._memset,setThrew=Module.setThrew=asm.setThrew,_bitshift64Lshr=Module._bitshift64Lshr=asm._bitshift64Lshr,_bitshift64Shl=Module._bitshift64Shl=asm._bitshift64Shl,_llvm_cttz_i32=Module._llvm_cttz_i32=asm._llvm_cttz_i32,_sbrk=Module._sbrk=asm._sbrk,_memcpy=Module._memcpy=asm._memcpy,stackAlloc=Module.stackAlloc=asm.stackAlloc,___uremdi3=Module.___uremdi3=asm.___uremdi3,_nbind_init=Module._nbind_init=asm._nbind_init,_i64Subtract=Module._i64Subtract=asm._i64Subtract,___udivmoddi4=Module.___udivmoddi4=asm.___udivmoddi4,setTempRet0=Module.setTempRet0=asm.setTempRet0,_i64Add=Module._i64Add=asm._i64Add,_emscripten_get_global_libc=Module._emscripten_get_global_libc=asm._emscripten_get_global_libc,__GLOBAL__sub_I_Binding_cc=Module.__GLOBAL__sub_I_Binding_cc=asm.__GLOBAL__sub_I_Binding_cc,___udivdi3=Module.___udivdi3=asm.___udivdi3,_llvm_bswap_i32=Module._llvm_bswap_i32=asm._llvm_bswap_i32,__GLOBAL__sub_I_nbind_cc=Module.__GLOBAL__sub_I_nbind_cc=asm.__GLOBAL__sub_I_nbind_cc,_free=Module._free=asm._free,runPostSets=Module.runPostSets=asm.runPostSets,establishStackSpace=Module.establishStackSpace=asm.establishStackSpace,stackRestore=Module.stackRestore=asm.stackRestore,_malloc=Module._malloc=asm._malloc,__GLOBAL__sub_I_common_cc=Module.__GLOBAL__sub_I_common_cc=asm.__GLOBAL__sub_I_common_cc,dynCall_viiiii=Module.dynCall_viiiii=asm.dynCall_viiiii,dynCall_vid=Module.dynCall_vid=asm.dynCall_vid,dynCall_fiff=Module.dynCall_fiff=asm.dynCall_fiff,dynCall_vi=Module.dynCall_vi=asm.dynCall_vi,dynCall_vii=Module.dynCall_vii=asm.dynCall_vii,dynCall_ii=Module.dynCall_ii=asm.dynCall_ii,dynCall_viddi=Module.dynCall_viddi=asm.dynCall_viddi,dynCall_vidd=Module.dynCall_vidd=asm.dynCall_vidd,dynCall_iiii=Module.dynCall_iiii=asm.dynCall_iiii,dynCall_diii=Module.dynCall_diii=asm.dynCall_diii,dynCall_di=Module.dynCall_di=asm.dynCall_di,dynCall_iid=Module.dynCall_iid=asm.dynCall_iid,dynCall_iii=Module.dynCall_iii=asm.dynCall_iii,dynCall_viiddi=Module.dynCall_viiddi=asm.dynCall_viiddi,dynCall_viiiiii=Module.dynCall_viiiiii=asm.dynCall_viiiiii,dynCall_dii=Module.dynCall_dii=asm.dynCall_dii,dynCall_i=Module.dynCall_i=asm.dynCall_i,dynCall_viiid=Module.dynCall_viiid=asm.dynCall_viiid,dynCall_viififi=Module.dynCall_viififi=asm.dynCall_viififi,dynCall_viii=Module.dynCall_viii=asm.dynCall_viii,dynCall_v=Module.dynCall_v=asm.dynCall_v,dynCall_viid=Module.dynCall_viid=asm.dynCall_viid,dynCall_idd=Module.dynCall_idd=asm.dynCall_idd,dynCall_viiii=Module.dynCall_viiii=asm.dynCall_viiii;Runtime.stackAlloc=Module.stackAlloc,Runtime.stackSave=Module.stackSave,Runtime.stackRestore=Module.stackRestore,Runtime.establishStackSpace=Module.establishStackSpace,Runtime.setTempRet0=Module.setTempRet0,Runtime.getTempRet0=Module.getTempRet0,Module.asm=asm,ExitStatus.prototype=new Error,ExitStatus.prototype.constructor=ExitStatus;var initialStackTop,preloadStartTime=null,calledMain=!1;dependenciesFulfilled=function e(){
Module.calledRun||run(),Module.calledRun||(dependenciesFulfilled=e)},Module.callMain=Module.callMain=function(e){function n(){for(var e=0;e<3;e++)t.push(0)}e=e||[],ensureInitRuntime();var r=e.length+1,t=[allocate(intArrayFromString(Module.thisProgram),"i8",ALLOC_NORMAL)];n();for(var i=0;i<r-1;i+=1)t.push(allocate(intArrayFromString(e[i]),"i8",ALLOC_NORMAL)),n();t.push(0),t=allocate(t,"i32",ALLOC_NORMAL);try{var u=Module._main(r,t,0);exit(u,!0)}catch(e){if(e instanceof ExitStatus)return;if("SimulateInfiniteLoop"==e)return void(Module.noExitRuntime=!0);var o=e;e&&"object"==typeof e&&e.stack&&(o=[e,e.stack]),Module.printErr("exception thrown: "+o),Module.quit(1,e)}finally{calledMain=!0}},Module.run=Module.run=run,Module.exit=Module.exit=exit;var abortDecorators=[];if(Module.abort=Module.abort=abort,Module.preInit)for("function"==typeof Module.preInit&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run()})}).call(exports,__webpack_require__(0),__webpack_require__(4).Buffer)},function(e,n,r){function t(e,n,r){var t=e[n];e[n]=function(){for(var e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return r.call.apply(r,[this,t].concat(n))}}e.exports=function(e,n){function i(){return n.setExperimentalFeatureEnabled.apply(n,arguments)}function u(){return n.isExperimentalFeatureEnabled.apply(n,arguments)}function o(){return n.getInstanceCount.apply(n,arguments)}for(var a=babelHelpers.extends({UNDEFINED:NaN},r(10)),f=function(){function e(n,r,t,i,u,o){babelHelpers.classCallCheck(this,e),this.left=n,this.right=r,this.top=t,this.bottom=i,this.width=u,this.height=o}return babelHelpers.createClass(e,[{key:"fromJS",value:function(e){e(this.left,this.right,this.top,this.bottom,this.width,this.height)}},{key:"toString",value:function(){return"<Layout#"+this.left+":"+this.right+";"+this.top+":"+this.bottom+";"+this.width+":"+this.height+">"}}]),e}(),c=function(){function e(n,r){babelHelpers.classCallCheck(this,e),this.width=n,this.height=r}return babelHelpers.createClass(e,null,[{key:"fromJS",value:function(n){var r=n.width,t=n.height;return new e(r,t)}}]),babelHelpers.createClass(e,[{key:"fromJS",value:function(e){e(this.width,this.height)}},{key:"toString",value:function(){return"<Size#"+this.width+"x"+this.height+">"}}]),e}(),l=function(){function e(n,r){babelHelpers.classCallCheck(this,e),this.unit=n,this.value=r}return babelHelpers.createClass(e,[{key:"fromJS",value:function(e){e(this.unit,this.value)}},{key:"toString",value:function(){switch(this.unit){case a.UNIT_POINT:return""+this.value;case a.UNIT_PERCENT:return this.value+"%";case a.UNIT_AUTO:return"auto";default:return this.value+"?"}}},{key:"valueOf",value:function(){return this.value}}]),e}(),s=function(e){var r,i=(r={},babelHelpers.defineProperty(r,a.UNIT_POINT,n.Node.prototype[e]),babelHelpers.defineProperty(r,a.UNIT_PERCENT,n.Node.prototype[e+"Percent"]),babelHelpers.defineProperty(r,a.UNIT_AUTO,n.Node.prototype[e+"Auto"]),r);t(n.Node.prototype,e,function(n){for(var r=arguments.length,t=Array(r>1?r-1:0),u=1;u<r;u++)t[u-1]=arguments[u];var o=t.pop(),f=void 0,c=void 0;if("auto"===o?(f=a.UNIT_AUTO,c=void 0):o instanceof l?(f=o.unit,c=o.valueOf()):(f="string"==typeof o&&o.endsWith("%")?a.UNIT_PERCENT:a.UNIT_POINT,c=parseFloat(o)),!Object.prototype.hasOwnProperty.call(i,f))throw new Error('Failed to execute "'+e+'": Unsupported unit.');if(void 0!==c){var s;return(s=i[f]).call.apply(s,[this].concat(t,[c]))}var d;return(d=i[f]).call.apply(d,[this].concat(t))})},d=["setPosition","setMargin","setFlexBasis","setWidth","setHeight","setMinWidth","setMinHeight","setMaxWidth","setMaxHeight","setPadding"],_=0;_<d.length;_++){var v=d[_];s(v)}return t(n.Node.prototype,"free",function(){n.Node.destroy(this)}),t(n.Node.prototype,"freeRecursive",function(){for(var e=0,n=this.getChildCount();e<n;++e)this.getChild(0).freeRecursive();this.free()}),t(n.Node.prototype,"setMeasureFunc",function(e,n){return n?e.call(this,function(){return c.fromJS(n.apply(void 0,arguments))}):this.unsetMeasureFunc()}),t(n.Node.prototype,"calculateLayout",function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.UNDEFINED,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.UNDEFINED,t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.DIRECTION_LTR;return e.call(this,n,r,t)}),e("Layout",f),e("Size",c),e("Value",l),babelHelpers.extends({Node:n.Node,Layout:f,Size:c,Value:l,setExperimentalFeatureEnabled:i,isExperimentalFeatureEnabled:u,getInstanceCount:o},a)}},function(e,n,r){"use strict";function t(e){var n=e.length;if(n%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[n-2]?2:"="===e[n-1]?1:0}function i(e){return 3*e.length/4-t(e)}function u(e){var n,r,i,u,o,a=e.length;u=t(e),o=new s(3*a/4-u),r=u>0?a-4:a;var f=0;for(n=0;n<r;n+=4)i=l[e.charCodeAt(n)]<<18|l[e.charCodeAt(n+1)]<<12|l[e.charCodeAt(n+2)]<<6|l[e.charCodeAt(n+3)],o[f++]=i>>16&255,o[f++]=i>>8&255,o[f++]=255&i;return 2===u?(i=l[e.charCodeAt(n)]<<2|l[e.charCodeAt(n+1)]>>4,o[f++]=255&i):1===u&&(i=l[e.charCodeAt(n)]<<10|l[e.charCodeAt(n+1)]<<4|l[e.charCodeAt(n+2)]>>2,o[f++]=i>>8&255,o[f++]=255&i),o}function o(e){return c[e>>18&63]+c[e>>12&63]+c[e>>6&63]+c[63&e]}function a(e,n,r){for(var t,i=[],u=n;u<r;u+=3)t=(e[u]<<16)+(e[u+1]<<8)+e[u+2],i.push(o(t));return i.join("")}function f(e){for(var n,r=e.length,t=r%3,i="",u=[],o=16383,f=0,l=r-t;f<l;f+=o)u.push(a(e,f,f+o>l?l:f+o));return 1===t?(n=e[r-1],i+=c[n>>2],i+=c[n<<4&63],i+="=="):2===t&&(n=(e[r-2]<<8)+e[r-1],i+=c[n>>10],i+=c[n>>4&63],i+=c[n<<2&63],i+="="),u.push(i),u.join("")}n.byteLength=i,n.toByteArray=u,n.fromByteArray=f;for(var c=[],l=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_=0,v=d.length;_<v;++_)c[_]=d[_],l[d.charCodeAt(_)]=_;l["-".charCodeAt(0)]=62,l["_".charCodeAt(0)]=63},function(e,n,r){"use strict";(function(e){function t(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}function i(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(e,n){if(i()<n)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(n),e.__proto__=o.prototype):(null===e&&(e=new o(n)),e.length=n),e}function o(e,n,r){if(!(o.TYPED_ARRAY_SUPPORT||this instanceof o))return new o(e,n,r);if("number"==typeof e){if("string"==typeof n)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return a(this,e,n,r)}function a(e,n,r,t){if("number"==typeof n)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&n instanceof ArrayBuffer?_(e,n,r,t):"string"==typeof n?s(e,n,r):v(e,n)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function c(e,n,r,t){return f(n),n<=0?u(e,n):void 0!==r?"string"==typeof t?u(e,n).fill(r,t):u(e,n).fill(r):u(e,n)}function l(e,n){if(f(n),e=u(e,n<0?0:0|p(n)),!o.TYPED_ARRAY_SUPPORT)for(var r=0;r<n;++r)e[r]=0;return e}function s(e,n,r){if("string"==typeof r&&""!==r||(r="utf8"),!o.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var t=0|b(n,r);e=u(e,t);var i=e.write(n,r);return i!==t&&(e=e.slice(0,i)),e}function d(e,n){var r=n.length<0?0:0|p(n.length);e=u(e,r);for(var t=0;t<r;t+=1)e[t]=255&n[t];return e}function _(e,n,r,t){if(n.byteLength,r<0||n.byteLength<r)throw new RangeError("'offset' is out of bounds");if(n.byteLength<r+(t||0))throw new RangeError("'length' is out of bounds");return n=void 0===r&&void 0===t?new Uint8Array(n):void 0===t?new Uint8Array(n,r):new Uint8Array(n,r,t),o.TYPED_ARRAY_SUPPORT?(e=n,e.__proto__=o.prototype):e=d(e,n),e}function v(e,n){if(o.isBuffer(n)){var r=0|p(n.length);return e=u(e,r),0===e.length?e:(n.copy(e,0,0,r),e)}if(n){if("undefined"!=typeof ArrayBuffer&&n.buffer instanceof ArrayBuffer||"length"in n)return"number"!=typeof n.length||J(n.length)?u(e,0):d(e,n);if("Buffer"===n.type&&$(n.data))return d(e,n.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function p(e){if(e>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function h(e){return+e!=e&&(e=0),o.alloc(+e)}function b(e,n){if(o.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var t=!1;;)switch(n){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return X(e).length;default:if(t)return j(e).length;n=(""+n).toLowerCase(),t=!0}}function m(e,n,r){var t=!1;if((void 0===n||n<0)&&(n=0),n>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,n>>>=0,r<=n)return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,n,r);case"utf8":case"utf-8":return L(this,n,r);case"ascii":return P(this,n,r);case"latin1":case"binary":return B(this,n,r);case"base64":return C(this,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,n,r);default:if(t)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),t=!0}}function y(e,n,r){var t=e[n];e[n]=e[r],e[r]=t}function w(e,n,r,t,i){if(0===e.length)return-1;if("string"==typeof r?(t=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof n&&(n=o.from(n,t)),o.isBuffer(n))return 0===n.length?-1:g(e,n,r,t,i);if("number"==typeof n)return n&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,n,r):Uint8Array.prototype.lastIndexOf.call(e,n,r):g(e,[n],r,t,i);throw new TypeError("val must be string, number or Buffer")}function g(e,n,r,t,i){function u(e,n){return 1===o?e[n]:e.readUInt16BE(n*o)}var o=1,a=e.length,f=n.length;if(void 0!==t&&(t=String(t).toLowerCase(),"ucs2"===t||"ucs-2"===t||"utf16le"===t||"utf-16le"===t)){if(e.length<2||n.length<2)return-1;o=2,a/=2,f/=2,r/=2}var c;if(i){var l=-1;for(c=r;c<a;c++)if(u(e,c)===u(n,l===-1?0:c-l)){if(l===-1&&(l=c),c-l+1===f)return l*o}else l!==-1&&(c-=c-l),l=-1}else for(r+f>a&&(r=a-f),c=r;c>=0;c--){for(var s=!0,d=0;d<f;d++)if(u(e,c+d)!==u(n,d)){s=!1;break}if(s)return c}return-1}function T(e,n,r,t){r=Number(r)||0;var i=e.length-r;t?(t=Number(t),t>i&&(t=i)):t=i;var u=n.length;if(u%2!==0)throw new TypeError("Invalid hex string");t>u/2&&(t=u/2);for(var o=0;o<t;++o){var a=parseInt(n.substr(2*o,2),16);if(isNaN(a))return o;e[r+o]=a}return o}function M(e,n,r,t){return K(j(n,e.length-r),e,r,t)}function k(e,n,r,t){return K(q(n),e,r,t)}function A(e,n,r,t){return k(e,n,r,t)}function E(e,n,r,t){return K(X(n),e,r,t)}function S(e,n,r,t){return K(G(n,e.length-r),e,r,t)}function C(e,n,r){return 0===n&&r===e.length?Z.fromByteArray(e):Z.fromByteArray(e.slice(n,r))}function L(e,n,r){r=Math.min(e.length,r);for(var t=[],i=n;i<r;){var u=e[i],o=null,a=u>239?4:u>223?3:u>191?2:1;if(i+a<=r){var f,c,l,s;switch(a){case 1:u<128&&(o=u);break;case 2:f=e[i+1],128===(192&f)&&(s=(31&u)<<6|63&f,s>127&&(o=s));break;case 3:f=e[i+1],c=e[i+2],128===(192&f)&&128===(192&c)&&(s=(15&u)<<12|(63&f)<<6|63&c,s>2047&&(s<55296||s>57343)&&(o=s));break;case 4:f=e[i+1],c=e[i+2],l=e[i+3],128===(192&f)&&128===(192&c)&&128===(192&l)&&(s=(15&u)<<18|(63&f)<<12|(63&c)<<6|63&l,s>65535&&s<1114112&&(o=s))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,t.push(o>>>10&1023|55296),o=56320|1023&o),t.push(o),i+=a}return R(t)}function R(e){var n=e.length;if(n<=ee)return String.fromCharCode.apply(String,e);for(var r="",t=0;t<n;)r+=String.fromCharCode.apply(String,e.slice(t,t+=ee));return r}function P(e,n,r){var t="";r=Math.min(e.length,r);for(var i=n;i<r;++i)t+=String.fromCharCode(127&e[i]);return t}function B(e,n,r){var t="";r=Math.min(e.length,r);for(var i=n;i<r;++i)t+=String.fromCharCode(e[i]);return t}function O(e,n,r){var t=e.length;(!n||n<0)&&(n=0),(!r||r<0||r>t)&&(r=t);for(var i="",u=n;u<r;++u)i+=z(e[u]);return i}function I(e,n,r){for(var t=e.slice(n,r),i="",u=0;u<t.length;u+=2)i+=String.fromCharCode(t[u]+256*t[u+1]);return i}function N(e,n,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+n>r)throw new RangeError("Trying to access beyond buffer length")}function U(e,n,r,t,i,u){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>i||n<u)throw new RangeError('"value" argument is out of bounds');if(r+t>e.length)throw new RangeError("Index out of range")}function F(e,n,r,t){n<0&&(n=65535+n+1);for(var i=0,u=Math.min(e.length-r,2);i<u;++i)e[r+i]=(n&255<<8*(t?i:1-i))>>>8*(t?i:1-i)}function x(e,n,r,t){n<0&&(n=4294967295+n+1);for(var i=0,u=Math.min(e.length-r,4);i<u;++i)e[r+i]=n>>>8*(t?i:3-i)&255}function D(e,n,r,t,i,u){if(r+t>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function H(e,n,r,t,i){return i||D(e,n,r,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(e,n,r,t,23,4),r+4}function W(e,n,r,t,i){return i||D(e,n,r,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(e,n,r,t,52,8),r+8}function Y(e){if(e=V(e).replace(ne,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function V(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function z(e){return e<16?"0"+e.toString(16):e.toString(16)}function j(e,n){n=n||1/0;for(var r,t=e.length,i=null,u=[],o=0;o<t;++o){if(r=e.charCodeAt(o),r>55295&&r<57344){if(!i){if(r>56319){(n-=3)>-1&&u.push(239,191,189);continue}if(o+1===t){(n-=3)>-1&&u.push(239,191,189);continue}i=r;continue}if(r<56320){(n-=3)>-1&&u.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(n-=3)>-1&&u.push(239,191,189);if(i=null,r<128){if((n-=1)<0)break;u.push(r)}else if(r<2048){if((n-=2)<0)break;u.push(r>>6|192,63&r|128)}else if(r<65536){if((n-=3)<0)break;u.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((n-=4)<0)break;u.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return u}function q(e){for(var n=[],r=0;r<e.length;++r)n.push(255&e.charCodeAt(r));return n}function G(e,n){for(var r,t,i,u=[],o=0;o<e.length&&!((n-=2)<0);++o)r=e.charCodeAt(o),t=r>>8,i=r%256,u.push(i),u.push(t);return u}function X(e){return Z.toByteArray(Y(e))}function K(e,n,r,t){for(var i=0;i<t&&!(i+r>=n.length||i>=e.length);++i)n[i+r]=e[i];return i}function J(e){return e!==e}var Z=r(3),Q=r(5),$=r(6);n.Buffer=o,n.SlowBuffer=h,n.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:t(),n.kMaxLength=i(),o.poolSize=8192,o._augment=function(e){return e.__proto__=o.prototype,e},o.from=function(e,n,r){return a(null,e,n,r)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&("function"==typeof Symbol?Symbol.species:"@@species")&&o["function"==typeof Symbol?Symbol.species:"@@species"]===o&&Object.defineProperty(o,"function"==typeof Symbol?Symbol.species:"@@species",{value:null,configurable:!0})),o.alloc=function(e,n,r){return c(null,e,n,r)},o.allocUnsafe=function(e){return l(null,e)},o.allocUnsafeSlow=function(e){return l(null,e)},o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.compare=function(e,n){if(!o.isBuffer(e)||!o.isBuffer(n))throw new TypeError("Arguments must be Buffers");if(e===n)return 0;for(var r=e.length,t=n.length,i=0,u=Math.min(r,t);i<u;++i)if(e[i]!==n[i]){r=e[i],t=n[i];break}return r<t?-1:t<r?1:0},o.isEncoding=function(e){switch(String(e).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}},o.concat=function(e,n){if(!$(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);var r;if(void 0===n)for(n=0,r=0;r<e.length;++r)n+=e[r].length;var t=o.allocUnsafe(n),i=0;for(r=0;r<e.length;++r){var u=e[r];if(!o.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(t,i),i+=u.length}return t},o.byteLength=b,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;n<e;n+=2)y(this,n,n+1);return this},o.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var n=0;n<e;n+=4)y(this,n,n+3),y(this,n+1,n+2);return this},o.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var n=0;n<e;n+=8)y(this,n,n+7),y(this,n+1,n+6),y(this,n+2,n+5),y(this,n+3,n+4);return this},o.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?L(this,0,e):m.apply(this,arguments)},o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",r=n.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},o.prototype.compare=function(e,n,r,t,i){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===n&&(n=0),void 0===r&&(r=e?e.length:0),void 0===t&&(t=0),void 0===i&&(i=this.length),n<0||r>e.length||t<0||i>this.length)throw new RangeError("out of range index");if(t>=i&&n>=r)return 0;if(t>=i)return-1;if(n>=r)return 1;if(n>>>=0,r>>>=0,t>>>=0,i>>>=0,this===e)return 0;for(var u=i-t,a=r-n,f=Math.min(u,a),c=this.slice(t,i),l=e.slice(n,r),s=0;s<f;++s)if(c[s]!==l[s]){u=c[s],a=l[s];break}return u<a?-1:a<u?1:0},o.prototype.includes=function(e,n,r){return this.indexOf(e,n,r)!==-1},o.prototype.indexOf=function(e,n,r){return w(this,e,n,r,!0)},o.prototype.lastIndexOf=function(e,n,r){return w(this,e,n,r,!1)},o.prototype.write=function(e,n,r,t){if(void 0===n)t="utf8",r=this.length,n=0;else if(void 0===r&&"string"==typeof n)t=n,r=this.length,n=0;else{if(!isFinite(n))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");n|=0,isFinite(r)?(r|=0,void 0===t&&(t="utf8")):(t=r,r=void 0)}var i=this.length-n;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");t||(t="utf8");for(var u=!1;;)switch(t){case"hex":return T(this,e,n,r);case"utf8":case"utf-8":return M(this,e,n,r);case"ascii":return k(this,e,n,r);case"latin1":case"binary":return A(this,e,n,r);case"base64":return E(this,e,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,n,r);default:if(u)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase(),u=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ee=4096;o.prototype.slice=function(e,n){var r=this.length;e=~~e,n=void 0===n?r:~~n,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),n<0?(n+=r,n<0&&(n=0)):n>r&&(n=r),n<e&&(n=e);var t;if(o.TYPED_ARRAY_SUPPORT)t=this.subarray(e,n),t.__proto__=o.prototype;else{var i=n-e;t=new o(i,void 0);for(var u=0;u<i;++u)t[u]=this[u+e]}return t},o.prototype.readUIntLE=function(e,n,r){e|=0,n|=0,r||N(e,n,this.length);for(var t=this[e],i=1,u=0;++u<n&&(i*=256);)t+=this[e+u]*i;return t},o.prototype.readUIntBE=function(e,n,r){e|=0,n|=0,r||N(e,n,this.length);for(var t=this[e+--n],i=1;n>0&&(i*=256);)t+=this[e+--n]*i;return t},o.prototype.readUInt8=function(e,n){return n||N(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,n){return n||N(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,n){return n||N(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,n){return n||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,n){return n||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,n,r){e|=0,n|=0,r||N(e,n,this.length);for(var t=this[e],i=1,u=0;++u<n&&(i*=256);)t+=this[e+u]*i;return i*=128,t>=i&&(t-=Math.pow(2,8*n)),t},o.prototype.readIntBE=function(e,n,r){e|=0,n|=0,r||N(e,n,this.length);for(var t=n,i=1,u=this[e+--t];t>0&&(i*=256);)u+=this[e+--t]*i;return i*=128,u>=i&&(u-=Math.pow(2,8*n)),u},o.prototype.readInt8=function(e,n){return n||N(e,1,this.length),128&this[e]?(255-this[e]+1)*-1:this[e]},o.prototype.readInt16LE=function(e,n){n||N(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(e,n){n||N(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(e,n){return n||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,n){return n||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,n){return n||N(e,4,this.length),Q.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,n){return n||N(e,4,this.length),Q.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,n){return n||N(e,8,this.length),Q.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,n){return n||N(e,8,this.length),Q.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,n,r,t){if(e=+e,n|=0,r|=0,!t){var i=Math.pow(2,8*r)-1;U(this,e,n,r,i,0)}var u=1,o=0;for(this[n]=255&e;++o<r&&(u*=256);)this[n+o]=e/u&255;return n+r},o.prototype.writeUIntBE=function(e,n,r,t){if(e=+e,n|=0,r|=0,!t){var i=Math.pow(2,8*r)-1;U(this,e,n,r,i,0)}var u=r-1,o=1;for(this[n+u]=255&e;--u>=0&&(o*=256);)this[n+u]=e/o&255;return n+r},o.prototype.writeUInt8=function(e,n,r){return e=+e,n|=0,r||U(this,e,n,1,255,0),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[n]=255&e,n+1},o.prototype.writeUInt16LE=function(e,n,r){return e=+e,n|=0,r||U(this,e,n,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[n]=255&e,this[n+1]=e>>>8):F(this,e,n,!0),n+2},o.prototype.writeUInt16BE=function(e,n,r){return e=+e,n|=0,r||U(this,e,n,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[n]=e>>>8,this[n+1]=255&e):F(this,e,n,!1),n+2},o.prototype.writeUInt32LE=function(e,n,r){return e=+e,n|=0,r||U(this,e,n,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[n+3]=e>>>24,this[n+2]=e>>>16,this[n+1]=e>>>8,this[n]=255&e):x(this,e,n,!0),n+4},o.prototype.writeUInt32BE=function(e,n,r){return e=+e,n|=0,r||U(this,e,n,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=255&e):x(this,e,n,!1),n+4},o.prototype.writeIntLE=function(e,n,r,t){if(e=+e,n|=0,!t){var i=Math.pow(2,8*r-1);U(this,e,n,r,i-1,-i)}var u=0,o=1,a=0;for(this[n]=255&e;++u<r&&(o*=256);)e<0&&0===a&&0!==this[n+u-1]&&(a=1),this[n+u]=(e/o>>0)-a&255;return n+r},o.prototype.writeIntBE=function(e,n,r,t){if(e=+e,n|=0,!t){var i=Math.pow(2,8*r-1);U(this,e,n,r,i-1,-i)}var u=r-1,o=1,a=0;for(this[n+u]=255&e;--u>=0&&(o*=256);)e<0&&0===a&&0!==this[n+u+1]&&(a=1),this[n+u]=(e/o>>0)-a&255;return n+r},o.prototype.writeInt8=function(e,n,r){return e=+e,n|=0,r||U(this,e,n,1,127,-128),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[n]=255&e,n+1},o.prototype.writeInt16LE=function(e,n,r){return e=+e,n|=0,r||U(this,e,n,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[n]=255&e,this[n+1]=e>>>8):F(this,e,n,!0),n+2},o.prototype.writeInt16BE=function(e,n,r){return e=+e,n|=0,r||U(this,e,n,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[n]=e>>>8,this[n+1]=255&e):F(this,e,n,!1),n+2},o.prototype.writeInt32LE=function(e,n,r){return e=+e,n|=0,r||U(this,e,n,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[n]=255&e,this[n+1]=e>>>8,this[n+2]=e>>>16,this[n+3]=e>>>24):x(this,e,n,!0),n+4},o.prototype.writeInt32BE=function(e,n,r){return e=+e,n|=0,r||U(this,e,n,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),o.TYPED_ARRAY_SUPPORT?(this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=255&e):x(this,e,n,!1),n+4},o.prototype.writeFloatLE=function(e,n,r){return H(this,e,n,!0,r)},o.prototype.writeFloatBE=function(e,n,r){return H(this,e,n,!1,r)},o.prototype.writeDoubleLE=function(e,n,r){return W(this,e,n,!0,r)},o.prototype.writeDoubleBE=function(e,n,r){return W(this,e,n,!1,r)},o.prototype.copy=function(e,n,r,t){if(r||(r=0),t||0===t||(t=this.length),n>=e.length&&(n=e.length),n||(n=0),t>0&&t<r&&(t=r),t===r)return 0;if(0===e.length||0===this.length)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(t<0)throw new RangeError("sourceEnd out of bounds");t>this.length&&(t=this.length),e.length-n<t-r&&(t=e.length-n+r);var i,u=t-r;if(this===e&&r<n&&n<t)for(i=u-1;i>=0;--i)e[i+n]=this[i+r];else if(u<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i<u;++i)e[i+n]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+u),n);return u},o.prototype.fill=function(e,n,r,t){if("string"==typeof e){if("string"==typeof n?(t=n,n=0,r=this.length):"string"==typeof r&&(t=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==t&&"string"!=typeof t)throw new TypeError("encoding must be a string");if("string"==typeof t&&!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t)}else"number"==typeof e&&(e&=255);if(n<0||this.length<n||this.length<r)throw new RangeError("Out of range index");if(r<=n)return this;n>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0);var u;if("number"==typeof e)for(u=n;u<r;++u)this[u]=e;else{var a=o.isBuffer(e)?e:j(new o(e,t).toString()),f=a.length;for(u=0;u<r-n;++u)this[u+n]=a[u%f]}return this};var ne=/[^+\/0-9A-Za-z-_]/g}).call(n,r(9))},function(e,n){n.read=function(e,n,r,t,i){var u,o,a=8*i-t-1,f=(1<<a)-1,c=f>>1,l=-7,s=r?i-1:0,d=r?-1:1,_=e[n+s];for(s+=d,u=_&(1<<-l)-1,_>>=-l,l+=a;l>0;u=256*u+e[n+s],s+=d,l-=8);for(o=u&(1<<-l)-1,u>>=-l,l+=t;l>0;o=256*o+e[n+s],s+=d,l-=8);if(0===u)u=1-c;else{if(u===f)return o?NaN:(_?-1:1)*(1/0);o+=Math.pow(2,t),u-=c}return(_?-1:1)*o*Math.pow(2,u-t)},n.write=function(e,n,r,t,i,u){var o,a,f,c=8*u-i-1,l=(1<<c)-1,s=l>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,_=t?0:u-1,v=t?1:-1,p=n<0||0===n&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(a=isNaN(n)?1:0,o=l):(o=Math.floor(Math.log(n)/Math.LN2),n*(f=Math.pow(2,-o))<1&&(o--,f*=2),n+=o+s>=1?d/f:d*Math.pow(2,1-s),n*f>=2&&(o++,f/=2),o+s>=l?(a=0,o=l):o+s>=1?(a=(n*f-1)*Math.pow(2,i),o+=s):(a=n*Math.pow(2,s-1)*Math.pow(2,i),o=0));i>=8;e[r+_]=255&a,_+=v,a/=256,i-=8);for(o=o<<i|a,c+=i;c>0;e[r+_]=255&o,_+=v,o/=256,c-=8);e[r+_-v]|=128*p}},function(e,n){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,n){},function(e,n,r){(function(e){function r(e,n){for(var r=0,t=e.length-1;t>=0;t--){var i=e[t];"."===i?e.splice(t,1):".."===i?(e.splice(t,1),r++):r&&(e.splice(t,1),r--)}if(n)for(;r--;r)e.unshift("..");return e}function t(e,n){if(e.filter)return e.filter(n);for(var r=[],t=0;t<e.length;t++)n(e[t],t,e)&&r.push(e[t]);return r}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,u=function(e){return i.exec(e).slice(1)};n.resolve=function(){for(var n="",i=!1,u=arguments.length-1;u>=-1&&!i;u--){var o=u>=0?arguments[u]:e.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(n=o+"/"+n,i="/"===o.charAt(0))}return n=r(t(n.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+n||"."},n.normalize=function(e){var i=n.isAbsolute(e),u="/"===o(e,-1);return e=r(t(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&u&&(e+="/"),(i?"/":"")+e},n.isAbsolute=function(e){return"/"===e.charAt(0)},n.join=function(){var e=Array.prototype.slice.call(arguments,0);return n.normalize(t(e,function(e,n){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},n.relative=function(e,r){function t(e){for(var n=0;n<e.length&&""===e[n];n++);for(var r=e.length-1;r>=0&&""===e[r];r--);return n>r?[]:e.slice(n,r-n+1)}e=n.resolve(e).substr(1),r=n.resolve(r).substr(1);for(var i=t(e.split("/")),u=t(r.split("/")),o=Math.min(i.length,u.length),a=o,f=0;f<o;f++)if(i[f]!==u[f]){a=f;break}for(var c=[],f=a;f<i.length;f++)c.push("..");return c=c.concat(u.slice(a)),c.join("/")},n.sep="/",n.delimiter=":",n.dirname=function(e){var n=u(e),r=n[0],t=n[1];return r||t?(t&&(t=t.substr(0,t.length-1)),r+t):"."},n.basename=function(e,n){var r=u(e)[2];return n&&r.substr(-1*n.length)===n&&(r=r.substr(0,r.length-n.length)),r},n.extname=function(e){return u(e)[3]};var o="b"==="ab".substr(-1)?function(e,n,r){return e.substr(n,r)}:function(e,n,r){return n<0&&(n=e.length+n),e.substr(n,r)}}).call(n,r(0))},function(e,n){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,n){e.exports={ALIGN_COUNT:8,ALIGN_AUTO:0,ALIGN_FLEX_START:1,ALIGN_CENTER:2,ALIGN_FLEX_END:3,ALIGN_STRETCH:4,ALIGN_BASELINE:5,ALIGN_SPACE_BETWEEN:6,ALIGN_SPACE_AROUND:7,DIMENSION_COUNT:2,DIMENSION_WIDTH:0,DIMENSION_HEIGHT:1,DIRECTION_COUNT:3,DIRECTION_INHERIT:0,DIRECTION_LTR:1,DIRECTION_RTL:2,DISPLAY_COUNT:2,DISPLAY_FLEX:0,DISPLAY_NONE:1,EDGE_COUNT:9,EDGE_LEFT:0,EDGE_TOP:1,EDGE_RIGHT:2,EDGE_BOTTOM:3,EDGE_START:4,EDGE_END:5,EDGE_HORIZONTAL:6,EDGE_VERTICAL:7,EDGE_ALL:8,EXPERIMENTAL_FEATURE_COUNT:2,EXPERIMENTAL_FEATURE_ROUNDING:0,EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS:1,FLEX_DIRECTION_COUNT:4,FLEX_DIRECTION_COLUMN:0,FLEX_DIRECTION_COLUMN_REVERSE:1,FLEX_DIRECTION_ROW:2,FLEX_DIRECTION_ROW_REVERSE:3,JUSTIFY_COUNT:5,JUSTIFY_FLEX_START:0,JUSTIFY_CENTER:1,JUSTIFY_FLEX_END:2,JUSTIFY_SPACE_BETWEEN:3,JUSTIFY_SPACE_AROUND:4,LOG_LEVEL_COUNT:5,LOG_LEVEL_ERROR:0,LOG_LEVEL_WARN:1,LOG_LEVEL_INFO:2,LOG_LEVEL_DEBUG:3,LOG_LEVEL_VERBOSE:4,MEASURE_MODE_COUNT:3,MEASURE_MODE_UNDEFINED:0,MEASURE_MODE_EXACTLY:1,MEASURE_MODE_AT_MOST:2,OVERFLOW_COUNT:3,OVERFLOW_VISIBLE:0,OVERFLOW_HIDDEN:1,OVERFLOW_SCROLL:2,POSITION_TYPE_COUNT:2,POSITION_TYPE_RELATIVE:0,POSITION_TYPE_ABSOLUTE:1,PRINT_OPTIONS_COUNT:3,PRINT_OPTIONS_LAYOUT:1,PRINT_OPTIONS_STYLE:2,PRINT_OPTIONS_CHILDREN:4,UNIT_COUNT:4,UNIT_UNDEFINED:0,UNIT_POINT:1,UNIT_PERCENT:2,UNIT_AUTO:3,WRAP_COUNT:3,WRAP_NO_WRAP:0,WRAP_WRAP:1,WRAP_WRAP_REVERSE:2}},function(e,n,r){var t=r(1),i=!1,u=null;if(t({},function(e,n){if(!i){if(i=!0,e)throw e;u=n}}),!i)throw new Error("Failed to load the yoga module - it needed to be loaded synchronously, but didn't");e.exports=r(2)(u.bind,u.lib)}])})},63);
__d(function(e,t,i,n){function o(e){if("string"==typeof e)return!0}Object.defineProperty(n,"__esModule",{value:!0});var s=t(65),r=babelHelpers.interopRequireDefault(s),a=t(62),l=babelHelpers.interopRequireWildcard(a),u=t(52),d=(babelHelpers.interopRequireDefault(u),["onEnter","onExit","onInput","onChange","onHeadPose","onChangeCaptured","onInputCaptured","onHeadPoseCaptured","onMove"]),h={onEnter:!0,onExit:!0,onInput:!0,onChange:!0,onHeadPose:!0,onChangeCaptured:!0,onInputCaptured:!0,onHeadPoseCaptured:!0,onMove:!0},E={nowrap:l.WRAP_NO_WRAP,wrap:l.WRAP_WRAP},N={column:l.FLEX_DIRECTION_COLUMN,"column-reverse":l.FLEX_DIRECTION_COLUMN_REVERSE,row:l.FLEX_DIRECTION_ROW,"row-reverse":l.FLEX_DIRECTION_ROW_REVERSE},c={"flex-start":l.JUSTIFY_FLEX_START,center:l.JUSTIFY_CENTER,"flex-end":l.JUSTIFY_FLEX_END,"space-between":l.JUSTIFY_SPACE_BETWEEN,"space-around":l.JUSTIFY_SPACE_AROUND},_={auto:l.ALIGN_AUTO,"flex-start":l.ALIGN_FLEX_START,center:l.ALIGN_CENTER,"flex-end":l.ALIGN_FLEX_END,stretch:l.ALIGN_STRETCH,baseline:l.ALIGN_BASELINE},f={relative:l.POSITION_TYPE_RELATIVE,absolute:l.POSITION_TYPE_ABSOLUTE},D={visible:l.OVERFLOW_VISIBLE,hidden:l.OVERFLOW_HIDDEN,scroll:l.OVERFLOW_SCROLL},G={flex:l.DISPLAY_FLEX,none:l.DISPLAY_NONE},p=-1,y=function(){function e(t){var i=this;babelHelpers.classCallCheck(this,e),this._borderRadius=null,this._borderTopLeftRadius=null,this._borderTopRightRadius=null,this._borderBottomLeftRadius=null,this._borderBottomRightRadius=null,this._borderRadiusDirty=!1,this._transformDirty=!0,this.YGNode=l.Node.create(),this.UIManager=null,this.tag=0,this.rootTag=0,this.children=[],this.parent=null,this.props={},this.style={layoutOrigin:[0,0]},this.interactableCount=0,this.inSurfaceContext=!1,this.mouseInteractableCount=0,this.isDirty=!0,this.receivesMoveEvent=!1,Object.defineProperty(this.style,"backgroundColor",{set:function(e){null==e&&(e=0),i.view.setBackgroundColor(e)}}),Object.defineProperty(this.style,"opacity",{configurable:!0,set:function(e){null==e&&(e=1),i.view.setOpacity(e)}}),Object.defineProperty(this.style,"borderColor",{set:function(e){null==e&&(e=4278190080),i.view.setBorderColor(e)}}),Object.defineProperty(this.style,"borderRadius",{set:function(e){null==e&&(e=0),i._borderRadius=e,i._borderRadiusDirty=!0}}),Object.defineProperty(this.style,"borderTopLeftRadius",{set:function(e){null==e&&(e=0),i._borderTopLeftRadius=e,i._borderRadiusDirty=!0}}),Object.defineProperty(this.style,"borderTopRightRadius",{set:function(e){null==e&&(e=0),i._borderTopRightRadius=e,i._borderRadiusDirty=!0}}),Object.defineProperty(this.style,"borderBottomLeftRadius",{set:function(e){null==e&&(e=0),i._borderBottomLeftRadius=e,i._borderRadiusDirty=!0}}),Object.defineProperty(this.style,"borderBottomRightRadius",{set:function(e){null==e&&(e=0),i._borderBottomRightRadius=e,i._borderRadiusDirty=!0}}),Object.defineProperty(this.style,"renderGroup",{set:function(e){null==e&&(e=!1),i.view&&(i.view.renderGroup=e)}}),d.forEach(function(e){Object.defineProperty(i.props,e.toString(),{set:function(t){i.props["_"+e]!==t&&(i.interactableCount+=t?1:-1,h[e]&&(i.mouseInteractableCount+=t?1:-1,i.view&&i.view.setIsMouseInteractable(i.mouseInteractableCount>0)),"onMove"===e&&(i.receivesMoveEvent=!!t),i.view&&i.view.setIsInteractable(i.interactableCount>0),i.view&&i.view.forceRaycastTest(i.interactableCount>0),i.props["_"+e]=t)}})}),this.view=null}return babelHelpers.createClass(e,[{key:"getTag",value:function(){return this.tag}},{key:"getIndexOf",value:function(e){return this.children.indexOf(e)}},{key:"getParent",value:function(){return this.parent}},{key:"addChild",value:function(e,t){this.children.splice(e,0,t),this.YGNode.insertChild(t.YGNode,e),this.view.add(t.view)}},{key:"setParent",value:function(e){this.parent=e}},{key:"removeChild",value:function(e){this.view.remove(this.children[e].view),this.YGNode.removeChild(this.YGNode.getChild(e)),this.children.splice(e,1)}},{key:"getChild",value:function(e){return this.children[e]}},{key:"getChildCount",value:function(){return this.children.length}},{key:"makeDirty",value:function(){for(var e=this;e;)e.isDirty=!0,e=e.getParent()}},{key:"receiveCommand",value:function(e,t){var i=this;switch(e){case p:var n=t.length<4;if(n)this.view&&this.view.setImmediateListener(null);else{var o=t[0],s=t[1],r=t[2],a=t[3];this.view&&this.view.setImmediateListener({eventType:o,callback:function(){return i.UIManager.dispatchViewManagerCommand(s,r,a)}})}}}},{key:"dispose",value:function(){e.disposeThreeJSObject(this.view),l.Node.destroy(this.YGNode),this.view=null}},{key:"frame",value:function(e,t){void 0!==this.style.opacity&&this.view.setOpacity(this.style.opacity)}},{key:"_left",value:function(e){null===e&&(e=l.UNDEFINED),o(e)?this.YGNode.setPositionPercent(l.EDGE_LEFT,parseFloat(e)):this.YGNode.setPosition(l.EDGE_LEFT,e)}},{key:"_top",value:function(e){null===e&&(e=l.UNDEFINED),o(e)?this.YGNode.setPositionPercent(l.EDGE_TOP,parseFloat(e)):this.YGNode.setPosition(l.EDGE_TOP,e)}},{key:"_right",value:function(e){null===e&&(e=l.UNDEFINED),o(e)?this.YGNode.setPositionPercent(l.EDGE_RIGHT,parseFloat(e)):this.YGNode.setPosition(l.EDGE_RIGHT,e)}},{key:"_bottom",value:function(e){null===e&&(e=l.UNDEFINED),o(e)?this.YGNode.setPositionPercent(l.EDGE_BOTTOM,parseFloat(e)):this.YGNode.setPosition(l.EDGE_BOTTOM,e)}},{key:"_margin",value:function(e){null===e&&(e=l.UNDEFINED),o(e)?this.YGNode.setMarginPercent(l.EDGE_ALL,parseFloat(e)):this.YGNode.setMargin(l.EDGE_ALL,e)}},{key:"_marginVertical",value:function(e){null===e&&(e=l.UNDEFINED),o(e)?this.YGNode.setMarginPercent(l.EDGE_VERTICAL,parseFloat(e)):this.YGNode.setMargin(l.EDGE_VERTICAL,e)}},{key:"_marginHorizontal",value:function(e){null===e&&(e=l.UNDEFINED),o(e)?this.YGNode.setMarginPercent(l.EDGE_HORIZONTAL,parseFloat(e)):this.YGNode.setMargin(l.EDGE_HORIZONTAL,e)}},{key:"_marginTop",value:function(e){null===e&&(e=l.UNDEFINED),o(e)?this.YGNode.setMarginPercent(l.EDGE_TOP,parseFloat(e)):this.YGNode.setMargin(l.EDGE_TOP,e)}},{key:"_marginBottom",value:function(e){null===e&&(e=l.UNDEFINED),o(e)?this.YGNode.setMarginPercent(l.EDGE_BOTTOM,parseFloat(e)):this.YGNode.setMargin(l.EDGE_BOTTOM,e)}},{key:"_marginLeft",value:function(e){null===e&&(e=l.UNDEFINED),o(e)?this.YGNode.setMarginPercent(l.EDGE_LEFT,parseFloat(e)):this.YGNode.setMargin(l.EDGE_LEFT,e)}},{key:"_marginRight",value:function(e){null===e&&(e=l.UNDEFINED),o(e)?this.YGNode.setMarginPercent(l.EDGE_RIGHT,parseFloat(e)):this.YGNode.setMargin(l.EDGE_RIGHT,e)}},{key:"_padding",value:function(e){null===e&&(e=l.UNDEFINED),o(e)?this.YGNode.setPaddingPercent(l.EDGE_ALL,parseFloat(e)):this.YGNode.setPadding(l.EDGE_ALL,e)}},{key:"_paddingVertical",value:function(e){null===e&&(e=l.UNDEFINED),o(e)?this.YGNode.setPaddingPercent(l.EDGE_VERTICAL,parseFloat(e)):this.YGNode.setPadding(l.EDGE_VERTICAL,e)}},{key:"_paddingHorizontal",value:function(e){null===e&&(e=l.UNDEFINED),o(e)?this.YGNode.setPaddingPercent(l.EDGE_HORIZONTAL,parseFloat(e)):this.YGNode.setPadding(l.EDGE_HORIZONTAL,e)}},{key:"_paddingTop",value:function(e){null===e&&(e=l.UNDEFINED),o(e)?this.YGNode.setPaddingPercent(l.EDGE_TOP,parseFloat(e)):this.YGNode.setPadding(l.EDGE_TOP,e)}},{key:"_paddingBottom",value:function(e){null===e&&(e=l.UNDEFINED),o(e)?this.YGNode.setPaddingPercent(l.EDGE_BOTTOM,parseFloat(e)):this.YGNode.setPadding(l.EDGE_BOTTOM,e)}},{key:"_paddingLeft",value:function(e){null===e&&(e=l.UNDEFINED),o(e)?this.YGNode.setPaddingPercent(l.EDGE_LEFT,parseFloat(e)):this.YGNode.setPadding(l.EDGE_LEFT,e)}},{key:"_paddingRight",value:function(e){null===e&&(e=l.UNDEFINED),o(e)?this.YGNode.setPaddingPercent(l.EDGE_RIGHT,parseFloat(e)):this.YGNode.setPadding(l.EDGE_RIGHT,e)}},{key:"_borderWidth",value:function(e){null===e&&(e=l.UNDEFINED),this.YGNode.setBorder(l.EDGE_ALL,e)}},{key:"_borderTopWidth",value:function(e){null===e&&(e=l.UNDEFINED),this.YGNode.setBorder(l.EDGE_TOP,e)}},{key:"_borderRightWidth",value:function(e){null===e&&(e=l.UNDEFINED),this.YGNode.setBorder(l.EDGE_RIGHT,e)}},{key:"_borderBottomWidth",value:function(e){null===e&&(e=l.UNDEFINED),this.YGNode.setBorder(l.EDGE_BOTTOM,e)}},{key:"_borderLeftWidth",value:function(e){null===e&&(e=l.UNDEFINED),this.YGNode.setBorder(l.EDGE_LEFT,e)}},{key:"_position",value:function(e){this.YGNode.setPositionType(null!==e?f[e]:0)}},{key:"_alignContent",value:function(e){this.YGNode.setAlignContent(null!==e?_[e]:0)}},{key:"_alignItems",value:function(e){this.YGNode.setAlignItems(null!==e?_[e]:0)}},{key:"_alignSelf",value:function(e){this.YGNode.setAlignSelf(null!==e?_[e]:0)}},{key:"_flexDirection",value:function(e){this.YGNode.setFlexDirection(null!==e?N[e]:l.UNDEFINED)}},{key:"_flexWrap",value:function(e){this.YGNode.setFlexWrap(null!==e?E[e]:l.UNDEFINED)}},{key:"_justifyContent",value:function(e){this.YGNode.setJustifyContent(null!==e?c[e]:l.JUSTIFY_FLEX_START)}},{key:"_overflow",value:function(e){this.view.clippingEnabled=e===l.OVERFLOW_HIDDEN,this.YGNode.setOverflow(null!==e?D[e]:l.OVERFLOW_VISIBLE)}},{key:"_display",value:function(e){this.YGNode.setDisplay(null!==e?G[e]:l.DISPLAY_FLEX)}},{key:"_flex",value:function(e){null===e&&(e=l.UNDEFINED),this.YGNode.setFlex(e)}},{key:"_flexBasis",value:function(e){null===e&&(e=l.UNDEFINED),o(e)?this.YGNode.setFlexBasisPercent(parseFloat(e)):this.YGNode.setFlexBasis(e)}},{key:"_flexGrow",value:function(e){null===e&&(e=l.UNDEFINED),this.YGNode.setFlexGrow(e)}},{key:"_flexShrink",value:function(e){null===e&&(e=l.UNDEFINED),this.YGNode.setFlexShrink(e)}},{key:"_width",value:function(e){null===e&&(e=l.UNDEFINED),o(e)?this.YGNode.setWidthPercent(parseFloat(e)):this.YGNode.setWidth(e)}},{key:"_height",value:function(e){null===e&&(e=l.UNDEFINED),o(e)?this.YGNode.setHeightPercent(parseFloat(e)):this.YGNode.setHeight(e)}},{key:"_minWidth",value:function(e){null===e&&(e=l.UNDEFINED),o(e)?this.YGNode.setMinWidthPercent(parseFloat(e)):this.YGNode.setMinWidth(e)}},{key:"_minHeight",value:function(e){null===e&&(e=l.UNDEFINED),o(e)?this.YGNode.setMinHeightPercent(parseFloat(e)):this.YGNode.setMinHeight(e)}},{key:"_maxWidth",value:function(e){null===e&&(e=l.UNDEFINED),o(e)?this.YGNode.setMaxWidthPercent(parseFloat(e)):this.YGNode.setMaxWidth(e)}},{key:"_maxHeight",value:function(e){null===e&&(e=l.UNDEFINED),o(e)?this.YGNode.setMaxHeightPercent(parseFloat(e)):this.YGNode.setMaxHeight(e)}},{key:"_aspectRatio",value:function(e){null===e&&(e=l.UNDEFINED),this.YGNode.setAspectRatio(e)}},{key:"_getBorderValue",value:function(e){var t=this.YGNode.getBorder(e),i=this.YGNode.getBorder(l.EDGE_ALL);return Number.isNaN(t)?Number.isNaN(i)?0:i:t}},{key:"_transform",value:function(e){null===e?this.style.transform=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:this.style.transform=e,this._transformDirty=!0}},{key:"presentLayout",value:function(){if(this.YGNode.getHasNewLayout()){this.YGNode.setHasNewLayout(!1);var e=this.YGNode.getComputedLeft(),t=this.YGNode.getComputedTop(),i=this.YGNode.getComputedWidth(),n=this.YGNode.getComputedHeight(),o=-this.style.layoutOrigin[0]*i,s=-this.style.layoutOrigin[1]*n;this.props.onLayout&&this.UIManager._rnctx.callFunction("RCTEventEmitter","receiveEvent",[this.getTag(),"topLayout",{x:o+e,y:s+t,width:i,height:n}]),this.view.visible=this.YGNode.getDisplay()!==l.DISPLAY_NONE,this.view.setBorderWidth([this._getBorderValue(l.EDGE_LEFT),this._getBorderValue(l.EDGE_TOP),this._getBorderValue(l.EDGE_RIGHT),this._getBorderValue(l.EDGE_BOTTOM)]),this.view.setFrame&&this.view.setFrame(o+e,-(s+t),i,n,this.UIManager._layoutAnimation)}if(this.style.transform&&this._transformDirty&&this.view.setLocalTransform&&(this.view.setLocalTransform(this.style.transform),this._transformDirty=!1),this.view.owner=this,this._borderRadiusDirty){var a=(0,r.default)(this._borderRadius)?this._borderRadius:0;this.view.setBorderRadius([(0,r.default)(this._borderTopRightRadius)?this._borderTopRightRadius:a,(0,r.default)(this._borderTopLeftRadius)?this._borderTopLeftRadius:a,(0,r.default)(this._borderBottomLeftRadius)?this._borderBottomLeftRadius:a,(0,r.default)(this._borderBottomRightRadius)?this._borderBottomRightRadius:a]),this._borderRadiusDirty=!1}}}],[{key:"disposeThreeJSObject",value:function(t){if(t){if(t.geometry&&(t.geometry.dispose(),t.geometry=null),t.material)if(Array.isArray(t.material)){for(var i=0;i<t.material.length;i++){var n=t.material[i];n.map&&(n.map.dispose(),n.map=null),n.dispose()}t.material=null}else t.material.map&&(t.material.map.dispose(),t.material.map=null),t.material.dispose();for(var o in t.children){var s=t.children[o];"UIView"!==s.type&&e.disposeThreeJSObject(t.children[o])}t.parent=null,t.children=[]}}},{key:"describe",value:function(){return{NativeProps:{onLayout:"function",onEnter:"function",onExit:"function",onInput:"function",onChange:"function",onHeadPose:"function",onChangeCaptured:"function",onInputCaptured:"function",onHeadPoseCaptured:"function",onMove:"function"},Commands:{setImmediateOnTouchEnd:p}}}}]),e}();n.default=y},64);
__d(function(e,n,t,u){function f(e){return"number"==typeof e&&e>=0}Object.defineProperty(u,"__esModule",{value:!0}),u.default=f},65);
__d(function(e,t,r,s){Object.defineProperty(s,"__esModule",{value:!0});var i=t(35),n=t(54),o=babelHelpers.interopRequireDefault(n),a=t(55),d=babelHelpers.interopRequireDefault(a),u=function(e){function t(e,r){babelHelpers.classCallCheck(this,t);var s=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return s._radiusTop=.5,s._radiusBottom=.5,s._dimHeight=1,s._segments=8,s._needsUpdate=!1,Object.defineProperty(s.props,"radiusTop",{set:function(e){s._radiusTop=e,s._needsUpdate=!0}}),Object.defineProperty(s.props,"radiusBottom",{set:function(e){s._radiusBottom=e,s._needsUpdate=!0}}),Object.defineProperty(s.props,"dimHeight",{set:function(e){s._dimHeight=e,s._needsUpdate=!0}}),Object.defineProperty(s.props,"segments",{set:function(e){s._segments=e,s._needsUpdate=!0}}),s._generateGeometry=s._generateGeometry.bind(s),s}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"frame",value:function(){this._needsUpdate&&(this._needsUpdate=!1,this._generateGeometry())}},{key:"_generateGeometry",value:function(){var e=new i.CylinderBufferGeometry(this._radiusTop,this._radiusBottom,this._dimHeight,this._segments);this._setGeometry(e)}}],[{key:"describe",value:function(){return(0,o.default)(babelHelpers.get(t.__proto__||Object.getPrototypeOf(t),"describe",this).call(this),{NativeProps:{radiusTop:"number",radiusBottom:"number",dimHeight:"number",segments:"number"}})}}]),t}(d.default);s.default=u},66);
__d(function(e,t,r,i){Object.defineProperty(i,"__esModule",{value:!0});var n=t(35),s=t(54),a=babelHelpers.interopRequireDefault(s),d=t(55),l=babelHelpers.interopRequireDefault(d),o=function(e){function t(e,r){babelHelpers.classCallCheck(this,t);var i=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return i._dimWidth=1,i._dimHeight=1,i._needsUpdate=!1,Object.defineProperty(i.props,"dimWidth",{set:function(e){i._dimWidth=e,i._needsUpdate=!0}}),Object.defineProperty(i.props,"dimHeight",{set:function(e){i._dimHeight=e,i._needsUpdate=!0}}),i._generateGeometry=i._generateGeometry.bind(i),i}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"frame",value:function(){this._needsUpdate&&(this._needsUpdate=!1,this._generateGeometry())}},{key:"_generateGeometry",value:function(){var e=new n.PlaneBufferGeometry(this._dimWidth,this._dimHeight);this._setGeometry(e)}}],[{key:"describe",value:function(){return(0,a.default)(babelHelpers.get(t.__proto__||Object.getPrototypeOf(t),"describe",this).call(this),{NativeProps:{dimWidth:"number",dimHeight:"number"}})}}]),t}(l.default);i.default=o},67);
__d(function(e,t,r,n){function i(e,t,r){var n=e+":"+t+":"+r,i=d[n];if(i)return i.count++,i.geom;var s=new a.SphereBufferGeometry(e,r,t);return d[n]={geom:s,count:1},s}Object.defineProperty(n,"__esModule",{value:!0});var s=t(35),a=babelHelpers.interopRequireWildcard(s),o=t(54),u=babelHelpers.interopRequireDefault(o),p=t(55),l=babelHelpers.interopRequireDefault(p),d={},h=function(){var e=new a.Matrix4,t=new a.Ray,r=new a.Vector3,n=new a.Vector3;return function(i,s,a){e.getInverse(this.matrixWorld),t.copy(s.ray).applyMatrix4(e);var o=t.intersectSphere(i,r);if(null!==o){n.copy(r),n.applyMatrix4(this.matrixWorld);var u=s.ray.origin.distanceTo(n);u<s.near||u>s.far||a.push({distance:u,point:n.clone(),object:this})}}}(),c=function(e){function t(e,r){babelHelpers.classCallCheck(this,t);var n=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return n._radius=.5,n._heightSegments=6,n._widthSegments=8,n._needsUpdate=!1,Object.defineProperty(n.props,"radius",{set:function(e){n._radius=e,n._needsUpdate=!0}}),Object.defineProperty(n.props,"heightSegments",{set:function(e){n._heightSegments=e,n._needsUpdate=!0}}),Object.defineProperty(n.props,"widthSegments",{set:function(e){n._widthSegments=e,n._needsUpdate=!0}}),n._generateGeometry=n._generateGeometry.bind(n),n}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"frame",value:function(){this._needsUpdate&&(this._needsUpdate=!1,this._generateGeometry())}},{key:"_generateGeometry",value:function(){var e=i(this._radius,this._widthSegments,this._heightSegments);this._setGeometry(e);var t=new a.Sphere(new a.Vector3(0,0,0),this._radius);this.mesh.raycast=h.bind(this.mesh,t)}}],[{key:"describe",value:function(){return(0,u.default)(babelHelpers.get(t.__proto__||Object.getPrototypeOf(t),"describe",this).call(this),{NativeProps:{radius:"number",widthSegments:"number",heightSegments:"number"}})}}]),t}(l.default);n.default=c},68);
__d(function(e,t,r,n){Object.defineProperty(n,"__esModule",{value:!0});var i=t(56),o=babelHelpers.interopRequireDefault(i),s=t(54),a=babelHelpers.interopRequireDefault(s),c=t(64),l=babelHelpers.interopRequireDefault(c),u=function(e){function t(e,r){babelHelpers.classCallCheck(this,t);var n=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.view=new o.default(e),n._rnctx=r,Object.defineProperty(n.props,"source",{set:function(e){n.UIManager._rnctx.callFunction("RCTEventEmitter","receiveEvent",[n.getTag(),"topLoadStart",[]]),0===e.uri.indexOf("texture://")?n._rnctx.TextureManager.getTextureForURL(e.uri).then(function(t){n.view.setImageTexture(t);var r=t.image,i=void 0,o=void 0;r instanceof Image?(i=r.naturalWidth,o=r.naturalHeight):(i=r.width||0,o=r.height||0),n.UIManager._rnctx.callFunction("RCTEventEmitter","receiveEvent",[n.getTag(),"topLoad",{url:e.uri,source:e,width:i,height:o}]),n.UIManager._rnctx.callFunction("RCTEventEmitter","receiveEvent",[n.getTag(),"topLoadEnd",[]])}).catch(function(){n.UIManager._rnctx.callFunction("RCTEventEmitter","receiveEvent",[n.getTag(),"topLoadEnd",[]])}):n.view.setImage(e.uri,function(t,r,i){t&&n.UIManager._rnctx.callFunction("RCTEventEmitter","receiveEvent",[n.getTag(),"topLoad",{url:e.uri,source:e,width:r,height:i}]),n.UIManager._rnctx.callFunction("RCTEventEmitter","receiveEvent",[n.getTag(),"topLoadEnd",[]])})}}),Object.defineProperty(n.props,"resizeMode",{set:function(e){null===e&&(e="stretch"),n.view.setResizeMode(e)}}),Object.defineProperty(n.props,"inset",{set:function(e){n.view.setInset(e)}}),Object.defineProperty(n.props,"insetSize",{set:function(e){n.view.setInsetSize(e)}}),Object.defineProperty(n.props,"crop",{set:function(e){n.view.setTextureCrop(e)}}),Object.defineProperty(n.props,"pointerEvents",{set:function(e){null===e&&(e="auto"),n.view.setPointerEvents(e)}}),Object.defineProperty(n.props,"hitSlop",{set:function(e){null===e&&(e=0),"number"==typeof e?n.view.setHitSlop(e,e,e,e):n.view.setHitSlop(e.left,e.top,e.right,e.bottom)}}),n.props.inset=[0,0,0,0],n.props.insetSize=[0,0,0,0],Object.defineProperty(n.style,"tintColor",{set:function(e){null===e&&(e=4294967295),n.view.setImageColor(e)}}),n}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"presentLayout",value:function(){babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"presentLayout",this).call(this)}}],[{key:"describe",value:function(){return(0,a.default)(babelHelpers.get(t.__proto__||Object.getPrototypeOf(t),"describe",this).call(this),{NativeProps:{source:"string",resizeMode:"string",inset:"number",insetSize:"number",crop:"number",pointerEvents:"string",hitSlop:"number"}})}}]),t}(l.default);n.default=u},69);
__d(function(e,t,r,i){Object.defineProperty(i,"__esModule",{value:!0});var o=t(56),l=babelHelpers.interopRequireDefault(o),s=t(54),n=babelHelpers.interopRequireDefault(s),p=t(64),b=babelHelpers.interopRequireDefault(p),u=function(e){function t(e){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.view=new l.default(e),Object.defineProperty(r.props,"pointerEvents",{set:function(e){null===e&&(e="auto"),r.view.setPointerEvents(e)}}),Object.defineProperty(r.props,"hitSlop",{set:function(e){null===e&&(e=0),"number"==typeof e?r.view.setHitSlop(e,e,e,e):r.view.setHitSlop(e.left,e.top,e.right,e.bottom)}}),Object.defineProperty(r.props,"cursorVisibilitySlop",{set:function(e){null===e&&(e=0),"number"==typeof e?r.view.setCursorVisibilitySlop(e,e,e,e):r.view.setCursorVisibilitySlop(e.left,e.top,e.right,e.bottom)}}),Object.defineProperty(r.props,"billboarding",{set:function(e){null===e&&(e="off"),r.view.setBillboarding(e)}}),r}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"presentLayout",value:function(){babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"presentLayout",this).call(this)}}],[{key:"describe",value:function(){return(0,n.default)(babelHelpers.get(t.__proto__||Object.getPrototypeOf(t),"describe",this).call(this),{NativeProps:{pointerEvents:"string",hitSlop:"number",cursorVisibilitySlop:"number",billboarding:"string"}})}}]),t}(b.default);i.default=u},70);
__d(function(e,t,a,r){Object.defineProperty(r,"__esModule",{value:!0});var i=t(72),o=babelHelpers.interopRequireDefault(i),l=t(64),n=babelHelpers.interopRequireDefault(l),s=t(56),p=babelHelpers.interopRequireDefault(s),_=t(54),u=babelHelpers.interopRequireDefault(_),c=t(75),m=babelHelpers.interopRequireDefault(c),h=t(76),f=t(77),v=t(78),d=t(35),g=babelHelpers.interopRequireWildcard(d),b=t(62),y=babelHelpers.interopRequireWildcard(b),M=t(79),x=babelHelpers.interopRequireDefault(M),O=function(){var e=new g.Matrix4,t=new g.Ray,a=new g.Sphere(new g.Vector3(0,0,0),1e3),r=new g.Vector3,i=new g.Vector3;return function(o,l){e.getInverse(this.matrixWorld),t.copy(o.ray).applyMatrix4(e);var n=t.intersectSphere(a,r);if(null!==n){i.copy(r),i.applyMatrix4(this.matrixWorld);var s=o.ray.origin.distanceTo(i);s<o.near||s>o.far||l.push({distance:s,point:i.clone(),object:this})}}}(),E=void 0,R=void 0,w=function(e){e._needsDispose?e.dispose():x.default.isCachedTexture(e)&&x.default.removeTextureFromCache(e)},T=function(e){function t(e,a){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return E=E||new g.SphereGeometry(1e3,50,50),R=R||new f.CubePanoBufferGeometry(2e3,3,2,1.01),r._tintOpacity=1,r._styleOpacity=1,r._sphereGeometry=E,r._cubeGeometry=R,r._material=new o.default({color:"white",side:g.DoubleSide}),r._globe=new g.Mesh(r._sphereGeometry,r._material),r._globe.onBeforeRender=function(e,t,a,r,i,o){1===a.viewID&&i.stereoOffsetRepeats[1]?i.uniforms.stereoOffsetRepeat.value=i.stereoOffsetRepeats[1]:i.uniforms.stereoOffsetRepeat.value=i.stereoOffsetRepeats[0],i._rightEnvMap&&(1===a.viewID?i.envMap=i._rightEnvMap:i.envMap=i._leftEnvMap,i.needsUpdate=!0)},r._globe.raycast=O.bind(r._globe),r._globe.rotation.y=-Math.PI/2,r.view=new p.default(e),r.view.zOffset=1e3,r.view.add(r._globe),r._localResource=new v.RCTBindedResource(a.RCTResourceManager),r.globeOnUpdate=r.globeOnUpdate.bind(r),Object.defineProperty(r.props,"source",{set:function(e){return r.setSource(e)}}),Object.defineProperty(r.style,"opacity",{set:function(e){r._styleOpacity=e,r._material.opacity=r._styleOpacity*r._tintOpacity,r._material.transparent=r._material.opacity<1}}),Object.defineProperty(r.style,"tintColor",{set:function(e){var t=parseInt(e.toString(16).slice(0,2),16)/255;r._material.color.set(e),r._tintOpacity=t,r._material.opacity=r._styleOpacity*r._tintOpacity,r._material.transparent=r._material.opacity<1}}),r}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"globeOnUpdate",value:function(e,t){var a=new g.Matrix4,r=new g.Matrix4;r.multiplyMatrices(t.matrixWorldInverse,this._globe.matrixWorld),a.multiplyMatrices(t.projectionMatrix,r),this._globe.geometry.update(this.maxDepth,a),this._globe.material=this._globe.geometry.material}},{key:"setSource",value:function(e){var t=this;if(e&&e.tile)this._globe.geometry.dispose(),this.maxDepth=e.maxDepth||2,this._globe.geometry=new h.HPanoBufferGeometry(1e3,this.maxDepth,e.tile),this._globe.onUpdate=this.globeOnUpdate;else{this._globe.geometry.dispose(),e&&"CUBEMAP_32"===e.layout?(this._globe.geometry=this._cubeGeometry,this._globe.scale.z=-1,this._material.useUV=1):(this._globe.geometry=this._sphereGeometry,this._globe.scale.z=1,this._material.useUV=0),this._globe.onUpdate=null,this.UIManager._rnctx.callFunction("RCTEventEmitter","receiveEvent",[this.getTag(),"topLoadStart",[]]);var a=function(e,t,a){var r=function(){return t(void 0,a)},i=function(e){e._needsDispose=!0,t(e,a)},o=void 0;if(null==e)r();else if(x.default.isCached(e)){var l=x.default.getFromCache(e);t(l,a)}else if(Array.isArray(e)){var n=new g.CubeTextureLoader;n.setCrossOrigin("Access-Control-Allow-Origin"),n.load(e,i,o,r)}else{var s=new g.TextureLoader;s.setCrossOrigin("Access-Control-Allow-Origin"),s.load(e,i,o,r)}},r=function(a,r){if(e===t._currentSource){if(t._globe.scale.x=-1,t._material.map&&w(t._material.map),t._material.envMap&&t._material.envMap!==t._material._leftEnvMap&&t._material.envMap!==t._material._rightEnvMap&&w(t._material.envMap),void 0===a)t._material.map=void 0,t._material.envMap=void 0;else if("MonoTextureInfo"===a.type)t._material.map=a.texture,t._material.envMap=void 0;else{e.enableMipmaps||(a.generateMipmaps=!1,a.minFilter=g.LinearFilter),a.wrapS=g.ClampToEdgeWrapping,a.wrapT=g.ClampToEdgeWrapping;var i=a.isCubeTexture?a:null,o=a.isCubeTexture?null:a;a.isCubeTexture&&(t._globe.scale.x=1),t._material.map=o,t._material.envMap=i,1===r?t._nextRightEnvMap=i:t._nextLeftEnvMap=i}var l=e&&e.stereo?e.stereo:"2D";t._material.stereoOffsetRepeats=m.default[l],t._material.stereoOffsetRepeats||(console.warn("Pano: stereo format '"+l+"' not supported."),t._material.stereoOffsetRepeats=m.default["2D"]),t._material.needsUpdate=!0,t._numTexturesToLoad--,0===t._numTexturesToLoad&&(t._material._leftEnvMap&&w(t._material._leftEnvMap),t._material._rightEnvMap&&w(t._material._rightEnvMap),t._material._leftEnvMap=t._nextLeftEnvMap,t._material._rightEnvMap=t._nextRightEnvMap,void 0!==a&&t.UIManager._rnctx.callFunction("RCTEventEmitter","receiveEvent",[t.getTag(),"topLoad",[]]),t.UIManager._rnctx.callFunction("RCTEventEmitter","receiveEvent",[t.getTag(),"topLoadEnd",[]]))}};if(this._currentSource=e,this._numTexturesToLoad=1,this._nextLeftEnvMap=void 0,this._nextRightEnvMap=void 0,Array.isArray(e)){if(6!==e.length&&12!==e.length||!e[0].uri)return void console.warn("Pano expected cubemap source in format [{uri: http..}, {uri: http..}, ... ]with length of 6 (or 12 for stereo)");var i=e.map(function(e){return e.uri});this._localResource.unregister(),12===i.length?(this._numTexturesToLoad=2,a(i.slice(0,6),r,0),a(i.slice(6,12),r,1)):a(i,r,0)}else{var o=e?e.uri:null;this._localResource.isValidUrl(o)?this._localResource.load(o,function(e){return r(e,0)}):(this._localResource.unregister(),a(o,r,0))}}}},{key:"presentLayout",value:function(){babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"presentLayout",this).call(this),this._globe.visible=this.YGNode.getDisplay()!==y.DISPLAY_NONE}},{key:"dispose",value:function(){this._material.map&&w(this._material.map),this._material.envMap&&this._material.envMap!==this._material._leftEnvMap&&this._material.envMap!==this._material._rightEnvMap&&w(this._material.envMap),this._material._leftEnvMap&&w(this._material._leftEnvMap),this._material._rightEnvMap&&w(this._material._rightEnvMap),this._localResource&&this._localResource.dispose(),babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"dispose",this).call(this)}}],[{key:"describe",value:function(){return(0,u.default)(babelHelpers.get(t.__proto__||Object.getPrototypeOf(t),"describe",this).call(this),{NativeProps:{source:"string"}})}}]),t}(n.default);r.default=T},71);
__d(function(e,t,r,s){Object.defineProperty(s,"__esModule",{value:!0});var a=t(35),o=babelHelpers.interopRequireWildcard(a),u=t(73),l=babelHelpers.interopRequireDefault(u),i=t(74),n=babelHelpers.interopRequireDefault(i),f=new o.Color,p=[new o.Vector4(0,0,1,1)],c=function(e){function t(e){babelHelpers.classCallCheck(this,t);var r=o.UniformsUtils.merge([new l.default,{color:{value:f,type:"f"},opacity:{value:1,type:"f"},useUV:{value:1,type:"f"},map:{value:null,type:"t"},envMap:{value:null,type:"t"},arcOffset:{value:0,type:"f"},arcLengthReciprocal:{value:1/Math.PI/2,type:"f"}}]),s=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{uniforms:r,vertexShader:n.default.stereo_basic_vert,fragmentShader:n.default.stereo_basic_frag}));return s.isStereoBasicTextureMaterial=!0,s.stereoOffsetRepeats=p,s.setValues(e),s}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"copy",value:function(e){return babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"copy",this).call(this,e),this.stereoOffsetRepeats=e.stereoOffsetRepeats.slice(),this}},{key:"color",set:function(e){this.uniforms.color.value=new o.Color(e)},get:function(){return this.uniforms.color.value}},{key:"opacity",set:function(e){this.uniforms&&(this.uniforms.opacity.value=e)},get:function(){return this.uniforms.opacity.value}},{key:"map",set:function(e){this.uniforms.map.value=e},get:function(){return this.uniforms.map.value}},{key:"envMap",set:function(e){this.uniforms.envMap.value=e},get:function(){return this.uniforms.envMap.value}},{key:"useUV",set:function(e){this.uniforms.useUV.value=e}}]),t}(o.ShaderMaterial);s.default=c},72);
__d(function(e,t,l,a){Object.defineProperty(a,"__esModule",{value:!0});var r=t(35),s=babelHelpers.interopRequireWildcard(r),i=function e(){babelHelpers.classCallCheck(this,e),this.stereoOffsetRepeat={type:"f",value:new s.Vector4(0,0,1,1)}};a.default=i},73);
__d(function(e,n,o,i){Object.defineProperty(i,"__esModule",{value:!0});var f={stereo_basic_vert:"\n      uniform vec4 stereoOffsetRepeat;\n      varying highp vec3 vPosition;\n      #ifndef USE_ENVMAP\n      varying highp vec2 vUv;\n      #endif\n      void main()\n      {\n          vPosition = position;\n          #ifndef USE_ENVMAP\n          vUv = uv * stereoOffsetRepeat.zw + stereoOffsetRepeat.xy;\n          #endif\n          gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n      }\n  ",stereo_basic_frag:"\n      #define RECIPROCAL_PI2 0.15915494\n      #define RECIPROCAL_PI 0.31830988\n      uniform vec4 stereoOffsetRepeat;\n      uniform vec3 color;\n      uniform float opacity;\n      uniform float useUV;\n      uniform float arcOffset;\n      uniform float arcLengthReciprocal;\n      #ifdef ENVMAP_TYPE_CUBE\n      uniform samplerCube envMap;\n      #else\n      uniform sampler2D map;\n      varying highp vec2 vUv;\n      #endif\n      varying highp vec3 vPosition;\n      void main()\n      {\n        vec4 diffuseColor = vec4( 1.0, 1.0, 1.0, opacity );\n\n        #ifdef ENVMAP_TYPE_CUBE\n        vec4 texColor = textureCube( envMap, vec3( vPosition.z, vPosition.yx ) );\n        #else\n        vec2 sampleUV;\n        if (useUV > 0.0) {\n          sampleUV = vUv;\n        } else {\n          vec3 nrm = normalize(vPosition);\n          sampleUV.y = asin(nrm.y) * RECIPROCAL_PI + 0.5;\n          sampleUV.x = (-atan( nrm.z, nrm.x ) + arcOffset) * arcLengthReciprocal + 0.5;\n          sampleUV = sampleUV * stereoOffsetRepeat.zw + stereoOffsetRepeat.xy;\n        }\n        vec4 texColor = texture2D( map, sampleUV );\n        #endif\n        diffuseColor *= texColor;\n        diffuseColor.rgb *= color;\n\n        gl_FragColor = diffuseColor;\n      }\n  "};i.default=f},74);
__d(function(e,r,t,n){Object.defineProperty(n,"__esModule",{value:!0});var o=r(35),c=babelHelpers.interopRequireWildcard(o),_={"2D":[new c.Vector4(0,0,1,1)],TOP_BOTTOM_3D:[new c.Vector4(0,.5,1,.5),new c.Vector4(0,0,1,.5)],BOTTOM_TOP_3D:[new c.Vector4(0,0,1,.5),new c.Vector4(0,.5,1,.5)],LEFT_RIGHT_3D:[new c.Vector4(0,0,.5,1),new c.Vector4(.5,0,.5,1)],RIGHT_LEFT_3D:[new c.Vector4(.5,0,.5,1),new c.Vector4(0,0,.5,1)]};n.default=_},75);
__d(function(e,t,i,r){function s(e){return e<0}function o(e,t,i,r,o){var a=t.x*e[0]+t.y*e[1]+t.z*e[2]+t.w*e[3],n=i.x*e[0]+i.y*e[1]+i.z*e[2]+i.w*e[3];if(a<0&&n<0)return!0;if(s(a)!==s(n))if(a<0){var f=i.x-t.x,l=i.y-t.y,d=i.z-t.z,h=i.w-t.w,p=o[0]-r[0],u=o[1]-r[1],c=-a/(n-a);t.x+=f*c,t.y+=l*c,t.z+=d*c,t.w+=h*c,r[0]+=p*c,r[1]+=u*c}else{var m=t.x-i.x,y=t.y-i.y,v=t.z-i.z,w=t.w-i.w,P=r[0]-o[0],x=r[1]-o[1],g=-n/(a-n);i.x+=m*g,i.y+=y*g,i.z+=v*g,i.w+=w*g,o[0]+=P*g,o[1]+=x*g}return!1}function a(e){return 1===e.length?"0"+e:e}function n(e,t,i){l.BufferGeometry.call(this),this.dirty=!0,this.type="HPanoBufferGeometry",this.material=[],this.materialsCached={},this.rad=e,this.baseurl=i,this.update(t)}Object.defineProperty(r,"__esModule",{value:!0}),r.HPanoBufferGeometry=n;var f=t(35),l=babelHelpers.interopRequireWildcard(f),d=function(){var e=new l.Vector4,t=new l.Vector4;return function(i,r,s,a,n,f){e.fromArray([r[0],r[1],r[2],1]),e.applyMatrix4(f),t.fromArray([s[0],s[1],s[2],1]),t.applyMatrix4(f);var l=!1;if(l=l||o([1,0,1,0],e,t,a,n),l=l||o([-1,0,1,0],e,t,a,n),l=l||o([0,1,1,0],e,t,a,n),l=l||o([0,-1,1,0],e,t,a,n),!l){var d=[e.x/e.w*512,e.y/e.w*512],h=[t.x/t.w*512,t.y/t.w*512],p=h[0]-d[0],u=h[1]-d[1],c=Math.sqrt(p*p+u*u),m=n[0]-a[0],y=n[1]-a[1],v=Math.sqrt(m*m+y*y),w=v/c;i.texelPerPixel=Math.min(i.texelPerPixel,w)}return l}}(),h=0,p=1,u=2;n.prototype=babelHelpers.extends(Object.create(l.BufferGeometry.prototype),{constructor:n,isHPanoBufferGeometry:!0,dispose:function(){l.BufferGeometry.prototype.dispose();for(var e=0;e<this.material.length;e++)this.material[e].map&&this.material[e].map.dispose(),this.material[e].map=null,this.material[e].dispose();this.material=[],this.materialsCached={}},update:function(e,t){function i(r,s,c,m,w,P,x,g){var S=y.baseurl.replace("%l",(g+1).toString()).replace("%s",x).replace("%h",(P[0]+1).toString()).replace("%v",(P[1]+1).toString()).replace("%0h",a((P[0]+1).toString())).replace("%0v",a((P[1]+1).toString())).replace("%t0",(P[0]+1).toString()).replace("%t1",(P[1]+1).toString()).replace("%0t0",a((P[0]+1).toString())).replace("%0t1",a((P[1]+1).toString())),b=y.materialsCached[S],U=!1;if(t){var A={texelPerPixel:1},V=!1;V|=!d(A,s,w,[0,0],[v,v],t),V|=!d(A,s,c,[0,0],[0,v],t),V|=!d(A,c,w,[v,0],[v,v],t),V|=!d(A,w,m,[v,v],[0,0],t),V|=!d(A,m,s,[0,0],[0,v],t),V&&(U=A.texelPerPixel<1)}b||(b=new l.MeshBasicMaterial({wireframe:!1,depthWrite:!1,color:["white","green","blue"][g],side:l.DoubleSide}),b.loadState=h,y.materialsCached[S]=b,b.index=y.material.length,b.level=g,y.material.push(b));var I=!1;if(b.loadState===u&&g!==e&&U){var B=[(s[0]+w[0])/2,(s[1]+w[1])/2,(s[2]+w[2])/2],C=[(s[0]+c[0])/2,(s[1]+c[1])/2,(s[2]+c[2])/2],M=[(m[0]+w[0])/2,(m[1]+w[1])/2,(m[2]+w[2])/2],z=[(s[0]+m[0])/2,(s[1]+m[1])/2,(s[2]+m[2])/2],G=[(c[0]+w[0])/2,(c[1]+w[1])/2,(c[2]+w[2])/2],q=!0;q&=i(r,s,C,z,B,[2*P[0],2*P[1]],x,g+1),q&=i(r,C,c,B,G,[2*P[0]+1,2*P[1]],x,g+1),q&=i(r,z,B,m,M,[2*P[0],2*P[1]+1],x,g+1),q&=i(r,B,G,M,w,[2*P[0]+1,2*P[1]+1],x,g+1),b.referenced=!0,q||(I=!0)}else{if(b.loadState===h){b.loadState=p;var H=new l.TextureLoader;H.load(S,function(e){e.wrapS=l.ClampToEdgeWrapping,e.wrapT=l.ClampToEdgeWrapping,e.minFilter=l.LinearFilter,b.loadState===p&&(b.map=e,b.needsUpdate=!0,b.loadState=u),y.dirty=!0},void 0,function(){console.log("failed to load "+S)})}b.referenced=!0,I=!0}if(I&&b.loadState===u){y.addGroup(r.offsetIndices,6,b.index),o[r.offsetPosition+0]=s[0],o[r.offsetPosition+1]=s[1],o[r.offsetPosition+2]=s[2],o[r.offsetPosition+3]=c[0],o[r.offsetPosition+4]=c[1],o[r.offsetPosition+5]=c[2],o[r.offsetPosition+6]=m[0],o[r.offsetPosition+7]=m[1],o[r.offsetPosition+8]=m[2],o[r.offsetPosition+9]=w[0],o[r.offsetPosition+10]=w[1],o[r.offsetPosition+11]=w[2],n[r.offsetUV+0]=0,n[r.offsetUV+1]=1,n[r.offsetUV+2]=1,n[r.offsetUV+3]=1,n[r.offsetUV+4]=0,n[r.offsetUV+5]=0,n[r.offsetUV+6]=1,n[r.offsetUV+7]=0;var D=r.offsetPosition/3;f[r.offsetIndices+0]=D+0,f[r.offsetIndices+1]=D+1,f[r.offsetIndices+2]=D+3,f[r.offsetIndices+3]=D+0,f[r.offsetIndices+4]=D+3,f[r.offsetIndices+5]=D+2,r.offsetPosition+=12,r.offsetUV+=8,r.offsetIndices+=6}return b.loadState===u}this.dirty=!1,null===this.boundingSphere&&(this.boundingSphere=new l.Sphere),this.boundingSphere.radius=Math.sqrt(3*this.rad*this.rad);var r=6*Math.pow(4,e),s=4*r;this.quadCount!==r&&(this.quadCount=r,this.positions=new Float32Array(3*s),this.uvs=new Float32Array(2*s),this.indices=new Uint16Array(6*r),this.setIndex(new l.BufferAttribute(this.indices,1).setDynamic(!0)),this.addAttribute("position",new l.BufferAttribute(this.positions,3).setDynamic(!0)),this.addAttribute("uv",new l.BufferAttribute(this.uvs,2).setDynamic(!0)));for(var o=this.positions,n=this.uvs,f=this.indices,c={offsetPosition:0,offsetUV:0,offsetIndices:0},m=0;m<this.material.length;m++)this.material[m].referenced=!1;this.clearGroups();var y=this,v=1024,w=this.rad;i(c,[-w,w,-w],[w,w,-w],[-w,-w,-w],[w,-w,-w],[0,0],"f",0),i(c,[w,w,w],[-w,w,w],[w,-w,w],[-w,-w,w],[0,0],"b",0),i(c,[w,w,-w],[w,w,w],[w,-w,-w],[w,-w,w],[0,0],"r",0),i(c,[-w,w,w],[-w,w,-w],[-w,-w,w],[-w,-w,-w],[0,0],"l",0),i(c,[-w,-w,-w],[w,-w,-w],[-w,-w,w],[w,-w,w],[0,0],"d",0),i(c,[-w,w,w],[w,w,w],[-w,w,-w],[w,w,-w],[0,0],"u",0),this.getAttribute("position").needsUpdate=!0,this.getAttribute("uv").needsUpdate=!0,this.getIndex().needsUpdate=!0;for(var P in this.materialsCached){var x=this.materialsCached[P];x.level>0&&!x.referenced&&x.map&&(x.map&&x.map.dispose(),x.map=null,x.loadState=h)}}})},76);
__d(function(e,r,t,o){function a(e,r,t,o){f.BufferGeometry.call(this),r=r||3,t=t||6/this.columns,o=o||1.01;for(var a=(o-1)/2,u=e/2,i=24,n=[5,1,3,7,0,4,6,2,6,7,3,2,0,1,5,4,4,5,7,6,1,0,2,3],s=new Float32Array(3*i),b=new Float32Array(2*i),l=new Uint32Array(36),d=0;d<i;d++){var c=n[d];s[3*d+0]=(2*(c>>2&1)-1)*u,s[3*d+1]=(2*(c>>1&1)-1)*u,s[3*d+2]=(2*(1&c)-1)*u}for(var y=1/r,p=1/t,v=0,A=0;A<t;++A)for(var B=0;B<r;++B){var w=t-1-A;b[v+0]=(B+a)*y,b[v+1]=(w+a)*p,b[v+2]=(B+1-a)*y,b[v+3]=(w+a)*p,b[v+4]=(B+1-a)*y,b[v+5]=(w+1-a)*p,b[v+6]=(B+a)*y,b[v+7]=(w+1-a)*p,v+=8}v=0;for(var h=0;h<i;h+=4)l[v+0]=h,l[v+1]=h+1,l[v+2]=h+2,l[v+3]=h,l[v+4]=h+2,l[v+5]=h+3,v+=6;this.addAttribute("position",new f.BufferAttribute(s,3)),this.addAttribute("uv",new f.BufferAttribute(b,2)),this.setIndex(new f.BufferAttribute(l,1))}Object.defineProperty(o,"__esModule",{value:!0}),o.CubePanoBufferGeometry=a;var u=r(35),f=babelHelpers.interopRequireWildcard(u);a.prototype=babelHelpers.extends(Object.create(f.BufferGeometry.prototype),{constructor:a,isCubePanoBufferGeometry:!0})},77);
__d(function(e,r,i,s){function t(e){this.resourceManager=e,this.url=void 0,this.callback=void 0}Object.defineProperty(s,"__esModule",{value:!0}),s.RCTBindedResource=t,t.prototype=babelHelpers.extends(Object.create(Object.prototype),{constructor:t,load:function(e,r){if(this.unregister(),this.resourceManager.isValidUrl(e)){var i=this,s=e,t=function(e){if(i.url===s){var t=i.resourceManager.parseUrl(e);r(i.resourceManager.getResource(t.protocol,t.handle))}};this.resourceManager.addListener(e,t),this.callback=t,this.url=s,t(e)}else console.warn("RCTBindedResource.load: requesting a not valid local resource "+e+".")},isValidUrl:function(e){return this.resourceManager.isValidUrl(e)},unregister:function(){this.resourceManager.isValidUrl(this.url)&&this.resourceManager.removeListener(this.url,this.callback),this.url=void 0,this.callback=void 0},dispose:function(){this.unregister()}})},78);
__d(function(e,r,t,c){Object.defineProperty(c,"__esModule",{value:!0});var o=r(35),a=babelHelpers.interopRequireWildcard(o),u=r(56),i=babelHelpers.interopRequireDefault(u),n=r(54),s=babelHelpers.interopRequireDefault(n),l=r(64),p=babelHelpers.interopRequireDefault(l),h=function(e){function r(e,t){babelHelpers.classCallCheck(this,r);var c=babelHelpers.possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return c.view=new i.default(e),Object.defineProperty(c.props,"source",{set:function(e){var t=r.uriKey(e);if(c.props._sourceKey){if(c.props._sourceKey===t)return;r.removeKeyFromCache(c.props._sourceKey)}c.prefetch(e),c.props._sourceKey=t}}),c}return babelHelpers.inherits(r,e),babelHelpers.createClass(r,[{key:"prefetch",value:function(e){if(null!=e)if(Array.isArray(e)){if(6!==e.length||!e[0].uri)return void console.warn("Prefetch expected cubemap source in format [{uri: http..}, {uri: http..}, ... ]");var t=e.map(r.getUri),c=new a.CubeTextureLoader;c.setCrossOrigin("Access-Control-Allow-Origin"),c.load(t,function(t){return r.addToCache(e,t)},function(){},function(){})}else{var o=r.getUri(e),u=new a.TextureLoader;u.setCrossOrigin("Access-Control-Allow-Origin"),u.load(o,function(t){return r.addToCache(e,t)},function(){},function(){})}}},{key:"dispose",value:function(){babelHelpers.get(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"dispose",this).call(this),this.props._sourceKey&&r.removeKeyFromCache(this.props._sourceKey)}}],[{key:"getUri",value:function(e){return e&&"string"!=typeof e?e.uri:e}},{key:"uriKey",value:function(e){if(Array.isArray(e)){if(6===e.length){var t=e.map(r.getUri);return t.join(",")}return null}return r.getUri(e)}},{key:"addToCache",value:function(e,t){r.cache||(r.cache={});var c=r.uriKey(e);r.cache[c]?r.cache[c].refs++:(t.__prefetchKey=c,r.cache[c]={refs:1,texture:t})}},{key:"isCached",value:function(e){return r.cache&&r.cache.hasOwnProperty(r.uriKey(e))}},{key:"isCachedTexture",value:function(e){return!!(e.__prefetchKey&&r.cache&&r.cache[e.__prefetchKey])&&r.cache[e.__prefetchKey].texture.id===e.id}},{key:"getFromCache",value:function(e){var t=r.uriKey(e);return r.cache&&r.cache[t]?(r.cache[t].refs++,r.cache[t].texture):null}},{key:"removeFromCache",value:function(e){r.removeKeyFromCache(r.uriKey(e))}},{key:"removeTextureFromCache",value:function(e){e.__prefetchKey&&r.removeKeyFromCache(e.__prefetchKey)}},{key:"removeKeyFromCache",value:function(e){r.cache&&r.cache[e]&&(r.cache[e].refs--,r.cache[e].refs<=0&&(r.cache[e].texture.dispose(),delete r.cache[e]))}},{key:"describe",value:function(){return(0,s.default)(babelHelpers.get(r.__proto__||Object.getPrototypeOf(r),"describe",this).call(this),{NativeProps:{source:"string"}})}}]),r}(p.default);c.default=h},79);
__d(function(e,t,r,i){Object.defineProperty(i,"__esModule",{value:!0});var o=t(35),a=babelHelpers.interopRequireWildcard(o),n=t(56),l=babelHelpers.interopRequireDefault(n),s=t(54),p=babelHelpers.interopRequireDefault(s),c=t(62),d=babelHelpers.interopRequireWildcard(c),v=t(64),u=babelHelpers.interopRequireDefault(v),_="\n      varying highp vec4 vUv;\n      void main()\n      {\n          vUv = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n          vUv.xy = (vUv.xy + vec2(vUv.w)) * 0.5;\n          gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n      }\n  ",b="\n      uniform sampler2D map;\n      varying highp vec4 vUv;\n      void main()\n      {\n        gl_FragColor = texture2DProj( map, vUv );\n      }\n  ",g=1e3,h=function(){var e=new a.Matrix4,t=new a.Ray,r=new a.Sphere(new a.Vector3(0,0,0),g),i=new a.Vector3,o=new a.Vector3;return function(a,n){e.getInverse(this.matrixWorld),t.copy(a.ray).applyMatrix4(e);var l=t.intersectSphere(r,i);if(null!==l){o.copy(i),o.applyMatrix4(this.matrixWorld);var s=a.ray.origin.distanceTo(o);s<a.near||s>a.far||n.push({distance:s,point:o.clone(),object:this})}}}(),y=function(e){function t(e,r){babelHelpers.classCallCheck(this,t);var i=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia;var o={video:{facingMode:{exact:"environment"}}},n=document.createElement("video"),s=new a.Texture(n);return s.minFilter=a.LinearFilter,i._video=n,i._videoTexture=s,navigator.getUserMedia(o,function(e){n.src=window.URL.createObjectURL(e)},function(e){console.log("navigator.getUserMedia error: ",e)}),i._sphereGeometry=new a.SphereGeometry(g,5,5),i._material=new a.ShaderMaterial({uniforms:{map:{value:s,type:"t"}},vertexShader:_,fragmentShader:b,side:a.DoubleSide}),i._onUpdate=i._onUpdate.bind(i),i._globe=new a.Mesh(i._sphereGeometry,i._material),i._globe.raycast=h.bind(i._globe),i._globe.rotation.y=-Math.PI/2,i._globe.onUpdate=i._onUpdate,i.view=new l.default(e),i.view.add(i._globe),i}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"_onUpdate",value:function(e,t){this._video.readyState===this._video.HAVE_ENOUGH_DATA&&(this._videoTexture.needsUpdate=!0)}},{key:"presentLayout",value:function(){babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"presentLayout",this).call(this),this._globe.visible=this.YGNode.getDisplay()!==d.DISPLAY_NONE}},{key:"dispose",value:function(){this._localResource&&this._localResource.dispose(),babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"dispose",this).call(this)}}],[{key:"describe",value:function(){return(0,p.default)(babelHelpers.get(t.__proto__||Object.getPrototypeOf(t),"describe",this).call(this),{NativeProps:{}})}}]),t}(u.default);i.default=y},80);
__d(function(e,t,s,i){Object.defineProperty(i,"__esModule",{value:!0});var n=t(82),a=t(54),r=babelHelpers.interopRequireDefault(a),l=t(55),c=babelHelpers.interopRequireDefault(l),o=function(e){function t(e,s){babelHelpers.classCallCheck(this,t);var i=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,s));return i.instance=null,Object.defineProperty(i.props,"source",{set:i._setSource.bind(i)}),i}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"_setSource",value:function(e){if(this.instance){if(this.instance.update(e))return;this.instance&&this.instance.dispose()}this.instance=(0,n.createModelInstance)(e,this.view,this._litMaterial,this._unlitMaterial),this.instance&&this.instance.setLit(this._lit)}},{key:"_setLit",value:function(e){this._lit=e,this.instance&&this.instance.setLit(e)}},{key:"frame",value:function(e,t){this.instance&&this.instance.frame(e,t)}},{key:"dispose",value:function(){this.instance&&this.instance.dispose(),this.instance=null,babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"dispose",this).call(this)}}],[{key:"describe",value:function(){return(0,r.default)(babelHelpers.get(t.__proto__||Object.getPrototypeOf(t),"describe",this).call(this),{NativeProps:{source:"object"}})}}]),t}(c.default);i.default=o},81);
__d(function(e,r,n,t){function l(e){c.push(e)}function a(e,r,n,t){if(!c)return null;for(var l=0;l<c.length;l++)if(c[l].canLoad(e))return c[l].createInstance(e,r,n,t);return null}Object.defineProperty(t,"__esModule",{value:!0}),t.registerModelLoader=l,t.createModelInstance=a;var u=r(35),i=(babelHelpers.interopRequireWildcard(u),r(83)),o=babelHelpers.interopRequireDefault(i),d=r(90),f=babelHelpers.interopRequireDefault(d),c=[];l(new f.default),l(new o.default)},82);
__d(function(e,t,i,r){Object.defineProperty(r,"__esModule",{value:!0});var s=t(35),l=t(84),a=t(87),o=t(61),n=babelHelpers.interopRequireDefault(o),h=function(){function e(t,i,r,s){if(babelHelpers.classCallCheck(this,e),this._lit=!0,this._objURL=null,this._mtlURL=null,this._objState=null,this._update=null,this._view=i,this._mesh=null,this._litMaterial=r,this._unlitMaterial=s,t.hasOwnProperty("obj")){var l=null;if(t.obj){var a=(0,n.default)(t.obj);if(!a)throw new Error('Invalid value for "obj" property: '+JSON.stringify(t.obj));l=a}l!==this._objURL&&this._setOBJ(l)}if(t.hasOwnProperty("mtl")){var o=null;if(t.mtl){var h=(0,n.default)(t.mtl);if(!h)throw new Error('Invalid value for "mtl" property: '+JSON.stringify(t.mtl));o=h}o!==this._mtlURL&&this._setMTL(o)}}return babelHelpers.createClass(e,[{key:"_setOBJ",value:function(e){var t=this;return e?void(0,a.fetchAndCacheOBJ)(e).then(function(i){t._objURL=e,t._objState=i,t._mesh&&(t._view.remove(t._mesh),"function"==typeof t._mesh.dispose&&t._mesh.dispose()),t._view&&(t._mesh=t._updateMeshes(),t._view.add(t._mesh))},function(t){console.error("Failed to fetch resource: "+JSON.stringify(e))}).catch(function(e){console.error("Failed to update mesh:",e)}):(this._objURL&&(this._objState=null,(0,a.removeOBJReference)(this._objURL),this._objURL=null),void(this._mesh&&(this._view.remove(this._mesh),"function"==typeof this._mesh.dispose&&this._mesh.dispose(),this._mesh=null)))}},{key:"_setMTL",value:function(e){var t=this;if(!e){if(this._mtlURL&&(this._materialMap=null,(0,l.removeMTLReference)(this._mtlURL),this._mtlURL=null),!this._mesh)return;var i=this._lit?this._litMaterial:this._unlitMaterial;return void("Group"===this._mesh.type?this._mesh.children.forEach(function(e){e.material=i}):this._mesh.material=i)}var r=(0,n.default)(e);if(!r)throw new Error('Invalid value for "mtl" property: '+JSON.stringify(e));(0,l.fetchAndCacheMTL)(r).then(function(e){t._mtlURL=r,t._materialMap=e,t._mesh&&t._updateMeshes(t._mesh)},function(e){console.error("Failed to fetch resource: "+r)}).catch(function(e){console.error("Failed to update mesh:",e)})}},{key:"_updateMeshes",value:function(e){var t=this;if(this._objState){var i=this._lit?this._litMaterial:this._unlitMaterial,r=e||new s.Group,l=0;return this._objState.objects.forEach(function(a){var o=a.geometry;if(!(o.position.length<1)){var n=a.materials.filter(function(e){return e.startGroup<e.endGroup||e.endGroup<0}),h=e?null:new s.BufferGeometry;h&&(h.addAttribute("position",new s.BufferAttribute(new Float32Array(o.position),3)),h.setIndex(new s.BufferAttribute(new Uint32Array(o.index),1)),o.hasUVs&&h.addAttribute("uv",new s.BufferAttribute(new Float32Array(o.uv),2)),o.hasNormals?h.addAttribute("normal",new s.BufferAttribute(new Float32Array(o.normal),3)):h.computeVertexNormals(),o.hasVertexColors?(h.addAttribute("color",new s.BufferAttribute(new Float32Array(o.color),3)),t._litMaterial.vertexColors=s.VertexColors,t._unlitMaterial.vertexColors=s.VertexColors):(t._litMaterial.vertexColors=s.NoColors,t._unlitMaterial.vertexColors=s.NoColors));var u=i;if(1===n.length)u=t._getMaterial(n[0].name),u.flatShading=!a.smooth;else if(n.length>1){for(var _=[],f=0;f<n.length;f++){var m=n[f].endGroup;m<0&&(m=o.index.length);var c=m-n[f].startGroup;if(c>0){h&&h.addGroup(n[f].startGroup,c,f);var v=t._getMaterial(n[f].name);v.flatShading=!a.smooth,_.push(v)}}u=_}if(e){var d=r.children[l];d&&d instanceof s.Mesh&&(d.material=u)}else if(h){var p=new s.Mesh(h,u);r.add(p)}l++}}),r}}},{key:"_getMaterial",value:function(e){if(!this._materialMap)return this._lit?this._litMaterial:this._unlitMaterial;var t=this._materialMap[e];return t?this._lit?t.lit:t.unlit:this._lit?this._litMaterial:this._unlitMaterial}},{key:"update",value:function(e){return!1}},{key:"setLit",value:function(e){var t=this._lit!==e;this._lit=e,t&&this._updateMeshes(this._mesh)}},{key:"setTexture",value:function(e){}},{key:"setWireframe",value:function(e){}},{key:"frame",value:function(e,t){}},{key:"dispose",value:function(){this._mtlURL&&(this._materialMap=null,(0,l.removeMTLReference)(this._mtlURL),this._mtlURL=null),this._objURL&&(this._objState=null,(0,a.removeOBJReference)(this._objURL),this._objURL=null),this._mesh&&(this._view.remove(this._mesh),"function"==typeof this._mesh.dispose&&this._mesh.dispose(),this._mesh=null)}}]),e}(),u=function(){function e(){babelHelpers.classCallCheck(this,e)}return babelHelpers.createClass(e,[{key:"canLoad",value:function(e){return e&&e.hasOwnProperty("obj")}},{key:"createInstance",value:function(e,t,i,r){return new h(e,t,i,r)}}]),e}();r.default=u},83);
__d(function(e,r,i,a){function n(e,r,i,a){var n=M[i]||i;if(!r[n]){var t=e+a.file,o=new p.Vector2(a.options.scale[0],a.options.scale[1]),l=new p.Vector2(a.options.origin[0],a.options.origin[1]);"bump"===i&&a.options.bumpMultiplier&&(r.bumpScale=a.options.bumpMultiplier);var s=new p.TextureLoader(p.DefaultLoadingManager);s.setCrossOrigin("anonymous");var u=s.load(t);u.name=a.file,u.repeat.copy(o),u.offset.copy(l),a.options.clamp?(u.wrapS=p.ClampToEdgeWrapping,u.wrapT=p.ClampToEdgeWrapping):(u.wrapS=p.RepeatWrapping,u.wrapT=p.RepeatWrapping),r[n]=u}}function t(e,r){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a={name:r.name},t=e.substr(0,e.lastIndexOf("/")+1),o=!i&&0!==r.illum&&1!==r.illum,l=4===r.illum||6===r.illum||7===r.illum||9===r.illum;if(r.specular&&o&&(a.specular=new p.Color(r.specular[0],r.specular[1],r.specular[2])),r.diffuse&&(a.color=new p.Color(r.diffuse[0],r.diffuse[1],r.diffuse[2])),r.emissive&&(i||(a.emissive=new p.Color(r.emissive[0],r.emissive[1],r.emissive[2]))),r.specularExp&&(i||(a.shininess=r.specularExp)),r.vertexColors&&(a.vertexColors=r.vertexColors),r.wireframe&&(a.wireframe=r.wireframe),r.color&&(a.color=r.color),r.textureMap)for(var s in r.textureMap)n(t,a,s,r.textureMap[s]);a.ambient&&!o&&delete a.ambient;var u=i?new p.MeshBasicMaterial(a):0===r.illum||1===r.illum?new p.MeshLambertMaterial(a):new p.MeshPhongMaterial(a);return(l||r.opacity&&r.opacity<1)&&(u.transparent=!0,u.opacity=r.opacity||1),u.url=e,u}function o(e){if(v.has(e))return v.addReference(e),Promise.resolve(v.get(e));var r=b[e];return r||(r=(0,m.default)(e).then(function(e){return(0,d.readMTLFile)(e)}).then(function(r){for(var i={},a=r,n=Array.isArray(a),o=0,a=n?a:a["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();;){var l;if(n){if(o>=a.length)break;l=a[o++]}else{if(o=a.next(),o.done)break;l=o.value}var s=l;i[s.name]={lit:t(e,s,!1),unlit:t(e,s,!0)}}return i}),b[e]=r),r.then(function(r){return v.has(e)?v.addReference(e):v.addEntry(e,r),e in b&&delete b[e],r})}function l(e){v.removeReference(e)}Object.defineProperty(a,"__esModule",{value:!0}),a.fetchAndCacheMTL=o,a.removeMTLReference=l;var s=r(35),p=babelHelpers.interopRequireWildcard(s),u=r(50),f=babelHelpers.interopRequireDefault(u),c=r(85),m=babelHelpers.interopRequireDefault(c),d=r(86),v=new f.default(function(e,r){for(var i in r)r[i].lit.dispose(),r[i].unlit.dispose()}),b={},M={bump:"bumpMap",diffuse:"map",displacement:"displacementMap",emissive:"emissiveMap",specular:"specularMap"}},84);
__d(function(e,n,r,t){function o(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(r,t){var o=new XMLHttpRequest;o.addEventListener("load",function(){var e=o.response;200===o.status?r(e):t(e)}),o.open("GET",e),"arraybuffer"===n.responseType&&(o.responseType="arraybuffer"),o.send()})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o},85);
__d(function(e,r,t,a){function i(e,r){var t=e.match(o);if(!t)throw new Error("Expected a series of numbers on line "+r);var a=[parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])];if(isNaN(a[0])||isNaN(a[1])||isNaN(a[2]))throw new Error("Invalid number on line "+r);for(var i=0;i<a.length;i++)a[i]<0?a[i]=0:a[i]>1&&(a[i]=1);return a}function s(e){for(var r=e.split(/\s+/),t={blendu:!0,blendv:!0,brightness:0,contrast:1,origin:[0,0,0],scale:[1,1,1],turbulence:[0,0,0],clamp:!1},a=r[r.length-1],i=0;i<r.length-1;){var s=r[i];if("-"===s[0])if("-blendu"!==s)if("-blendv"!==s)if("-boost"!==s)if("-mm"!==s)if("-o"!==s)if("-s"!==s)if("-t"!==s)if("-texres"!==s)if("-clamp"!==s)if("-bm"!==s)if("-imfchan"!==s)if("-type"!==s)i++;else{var n=r[i+1];"sphere"!==n&&"cube_top"!==n&&"cube_bottom"!==n&&"cube_front"!==n&&"cube_back"!==n&&"cube_left"!==n&&"cube_right"!==n||(t.type=n),i+=2}else{var u=r[i+1];"r"!==u&&"g"!==u&&"b"!==u&&"m"!==u&&"l"!==u&&"z"!==u||(t.imfchan=u),i+=2}else{var o=parseFloat(r[i+1]);isNaN(o)||(t.bumpMultiplier=o),i+=2}else{var l=r[i+1];"on"===l?t.clamp=!0:"off"===l&&(t.clamp=!1),i+=2}else{var f=r[i+1];t.texRes=f,i+=2}else{i++;var p=parseFloat(r[i]);if(i++,isNaN(p))continue;if(t.turbulence[0]=p,"-"!==r[i][0]){var b=parseFloat(r[i]);if(i++,isNaN(b))continue;if(t.turbulence[1]=b,"-"!==r[i][0]){var m=parseFloat(r[i]);if(i++,isNaN(m))continue;t.turbulence[2]=m}}}else{i++;var v=parseFloat(r[i]);if(i++,isNaN(v))continue;if(t.scale[0]=v,"-"!==r[i][0]){var c=parseFloat(r[i]);if(i++,isNaN(c))continue;if(t.scale[1]=c,"-"!==r[i][0]){var d=parseFloat(r[i]);if(i++,isNaN(d))continue;t.scale[2]=d}}}else{i++;var N=parseFloat(r[i]);if(i++,isNaN(N))continue;if(t.origin[0]=N,"-"!==r[i][0]){var x=parseFloat(r[i]);if(i++,isNaN(x))continue;if(t.origin[1]=x,"-"!==r[i][0]){var h=parseFloat(r[i]);if(i++,isNaN(h))continue;t.origin[2]=h}}}else{var w=parseFloat(r[i+1]),M=parseFloat(r[i+2]);isNaN(w)||isNaN(M)||(t.brightness=w,t.contrast=M),i+=3}else{var F=parseFloat(r[i+1]);isNaN(F)||(t.boost=F),i+=2}else{var g=r[i+1];"on"===g?t.blendv=!0:"off"===g&&(t.blendv=!1),i+=2}else{var _=r[i+1];"on"===_?t.blendu=!0:"off"===_&&(t.blendu=!1),i+=2}else i++}return{file:a,options:t}}function n(e,r,t){for(var a=0,n=r.length;a<n&&" "===r[a]||"\t"===r[a];)a++;if(!(a>=n)){var u=r[a];if("#"!==u){var o=e[e.length-1];if("K"===u){if("a"===r[a+1]){var l=i(r.substr(a+2),t);return void(o.ambient=l)}if("d"===r[a+1]){var f=i(r.substr(a+2),t);return void(o.diffuse=f)}if("s"===r[a+1]){var p=i(r.substr(a+2),t);return void(o.specular=p)}if("e"===r[a+1]){var b=i(r.substr(a+2),t);o.emissive=b}}if("d"===u&&(" "===r[a+1]||"\t"===r[a+1])){var m=parseFloat(r.substr(a+2).trim());if(isNaN(m))throw new Error("Density must be a number");return m<0?m=0:m>1&&(m=1),void(o.opacity=m)}if("T"===u&&"r"===r[a+1]){var v=parseFloat(r.substr(a+2).trim());if(isNaN(v))throw new Error("Transparency must be a number");return v<0?v=0:v>1&&(v=1),void(o.opacity=1-v)}if("N"===u&&"s"===r[a+1]){var c=parseFloat(r.substr(a+2).trim());if(isNaN(c))throw new Error("Specular exponent must be a number");return void(o.specularExp=c)}if("n"===u){if("newmtl"===r.substr(a,6)){var d=r.substr(a+7).trim();if(d.length<1)throw new Error("newmtl must provide a material name on line "+t);return void e.push({name:d})}throw new Error("Unknown identifier: u")}if("i"===u&&"illum"===r.substr(a,5)){var N=parseInt(r.substr(a+6).trim(),10);if(isNaN(N))throw new Error("Illumination mode must be a number on line "+t);o.illum=N}if("m"===u){var x=r.substr(a,6).toLowerCase();if("map_ka"===x){var h=s(r.substr(a+6).trim());return void(h.file&&(o.textureMap||(o.textureMap={}),o.textureMap.ambient=h))}if("map_kd"===x){var w=s(r.substr(a+6).trim());w.file&&(o.textureMap||(o.textureMap={}),o.textureMap.diffuse=w)}if("map_ks"===x){var M=s(r.substr(a+6).trim());M.file&&(o.textureMap||(o.textureMap={}),o.textureMap.specular=M)}if("map_ns"===x){var F=s(r.substr(a+6).trim());F.file&&(o.textureMap||(o.textureMap={}),o.textureMap.specularExp=F)}}if("map_bump"===r.substr(a,8).toLowerCase()){var g=s(r.substr(a+8).trim());g.file&&(o.textureMap||(o.textureMap={}),g.options.imfchan||(g.options.imfchan="l"),o.textureMap.bump=g)}if("bump"===r.substr(a,4).toLowerCase()){var _=s(r.substr(a+4).trim());_.file&&(o.textureMap||(o.textureMap={}),_.options.imfchan||(_.options.imfchan="l"),o.textureMap.bump=_)}if("disp"===r.substr(a,4).toLowerCase()){var E=s(r.substr(a+4).trim());E.file&&(o.textureMap||(o.textureMap={}),o.textureMap.displacement=E)}if("decal"===r.substr(a,5).toLowerCase()){var y=s(r.substr(a+5).trim());y.file&&(o.textureMap||(o.textureMap={}),o.textureMap.decal=y)}}}}function u(e){var r=[];e.indexOf("\r\n")>-1&&(e=e.replace("\r\n","\n"));var t=e.split("\n"),a=t.length,i=0;return new Promise(function(e,s){var u=function u(){for(var o=Date.now();Date.now()-o<16&&i<a;)try{n(r,t[i],i+1),i++}catch(e){s(e)}i>=a?e(r):setTimeout(u,0)};u()})}Object.defineProperty(a,"__esModule",{value:!0}),a.readChannels=i,a.readTextureOptions=s,a.readLine=n,a.readMTLFile=u;var o=/^\s+([\d\.]+)\s+([\d\.]+)\s+([\d\.]+)/},86);
__d(function(e,r,n,t){function u(e){if(c.has(e))return c.addReference(e),Promise.resolve(c.get(e));var r=s[e];return r||(r=(0,o.default)(e).then(function(e){return(0,f.readOBJFile)(e)}),s[e]=r),r.then(function(r){return c.has(e)?c.addReference(e):c.addEntry(e,r),e in s&&delete s[e],r})}function a(e){c.removeReference(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.fetchAndCacheOBJ=u,t.removeOBJReference=a;var f=r(88),d=r(50),i=babelHelpers.interopRequireDefault(d),l=r(85),o=babelHelpers.interopRequireDefault(l),c=new i.default,s={}},87);
__d(function(r,e,t,n){function i(r,e){var t=r.match(v);if(!t)throw new Error("Expected a series of numbers on line "+e);var n=[parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])];if(isNaN(n[0])||isNaN(n[1])||isNaN(n[2]))throw new Error("Invalid number on line "+e);if(t[0].length<r.length){var i=r.substr(t[0].length).match(v);if(i){var a=[parseFloat(i[1]),parseFloat(i[2]),parseFloat(i[3])];if(isNaN(a[0])||isNaN(a[1])||isNaN(a[2]))throw new Error("Invalid number on line "+e);n.push(a[0],a[1],a[2])}}return n}function a(r,e){var t=r.match(h);if(!t)throw new Error("Expected a series of numbers on line "+e);var n=[parseFloat(t[1]),parseFloat(t[2])];if(isNaN(n[0])||isNaN(n[1]))throw new Error("Invalid number on line "+e);return n}function o(r,e){for(var t=r,n=[];t.length>0;){var i=t.match(w);if(!i)throw new Error("Expected a vertex id on line "+e);var a=i[0],o=parseInt(i[1],10),s=i[2]?parseInt(i[2].substr(1),10):0;if(isNaN(o))throw new Error("Invalid vertex id on line "+e);if(isNaN(s))throw new Error("Invalid texture point id on line "+e);n.push([o,s]),t=t.substr(a.length)}return n}function s(r,e){for(var t=r,n=[];t.length>0;){var i=t.match(c);if(!i)throw new Error("Expected a vertex id on line "+e);var a=i[0],o=parseInt(i[1],10),s=i[2]?parseInt(i[2],10):0,l=i[3]?parseInt(i[3].substr(1),10):0;if(isNaN(o))throw new Error("Invalid vertex id on line "+e);if(isNaN(s))throw new Error("Invalid texture point id on line "+e);if(isNaN(l))throw new Error("Invalid normal id on line "+e);n.push([o,s,l]),t=t.substr(a.length)}return n}function l(r,e,t){for(var n=0,o=e.length;n<o&&" "===e[n]||"\t"===e[n];)n++;if(!(n>=o)){var l=e[n];if("#"!==l){if("v"===l){if(" "===e[n+1]||"\t"===e[n+1]){var u=i(e.substr(n+1),t);return void r.vertices.push(u)}if("n"===e[n+1]){var f=i(e.substr(n+2),t),v=[f[0],f[1],f[2]];return void r.normals.push(v)}if("t"===e[n+1]){var h=a(e.substr(n+2),t);return void r.textureCoords.push(h)}if("p"===e[n+1])throw new Error("Parametric curve points (vp) are currently unsupported");throw new Error("Unknown identifier: v"+(n+1<e.length?e[n+1]:""))}if("f"===l){if(" "===e[n+1]||"\t"===e[n+1]){var w=s(e.substr(n+1),t);return void r.currentObject.addFace(w)}throw new Error("Unknown identifier: f"+(n+1<e.length?e[n+1]:""))}if("l"===l){if(" "===e[n+1]||"\t"===e[n+1])return;throw new Error("Unknown identifier: l"+(n+1<e.length?e[n+1]:""))}if("s"===l){if(" "===e[n+1]||"\t"===e[n+1]){var c=e.substr(n+1).match(b);if(!c)throw new Error("Invalid smoothing flag on line "+t);var m=c[1];return void r.currentObject.setSmoothing("off"!==m)}throw new Error("Unknown identifier: s"+(n+1<e.length?e[n+1]:""))}if(!("g"!==l&&"o"!==l||" "!==e[n+1]&&"\t"!==e[n+1])){var p=e.substr(2).trim(),E=new d.default(r.vertices,r.textureCoords,r.normals,p);if(r.currentObject&&r.currentObject.materials.length>0){var N=r.currentObject.materials[r.currentObject.materials.length-1];E.addMaterial(N.name,N.lib)}return r.objects.push(E),void(r.currentObject=E)}if("m"===l){if("mtllib"===e.substr(n,6)){var g=e.substr(n+7).trim();if(g.length<1)throw new Error("mtllib must provide a file path on line "+t);return void r.materialLibraries.push(g)}throw new Error("Unknown identifier: m")}if("u"===l){if("usemtl"===e.substr(n,6)){var x=e.substr(n+7).trim();if(x.length<1)throw new Error("usemtl must provide a material name on line "+t);var I=r.materialLibraries[r.materialLibraries.length-1];return void r.currentObject.addMaterial(x,I)}throw new Error("Unknown identifier: u")}}}}function u(r){var e=r,t=[],n=[],i=[],a=new d.default(t,n,i),o={vertices:t,textureCoords:n,normals:i,materialLibraries:[],objects:[a],currentObject:a};e.indexOf("\r\n")>-1&&(e=e.replace("\r\n","\n"));var s=e.split("\n"),u=s.length,f=0;return new Promise(function(r,e){var t=function t(){for(var n=Date.now();Date.now()-n<16&&f<u;)try{l(o,s[f],f+1),f++}catch(r){e(r)}f>=u?r(o):setTimeout(t,0)};t()})}Object.defineProperty(n,"__esModule",{value:!0}),n.readPoints=i,n.readTexturePoints=a,n.readPairs=o,n.readTriplets=s,n.readLine=l,n.readOBJFile=u;var f=e(89),d=babelHelpers.interopRequireDefault(f),v=/^\s+(-?[\d.eE+-]+)\s+(-?[\d.eE+-]+)\s+(-?[\d.eE+-]+)/,h=/^\s+(-?[\d.eE+-]+)\s+(-?[\d.eE+-]+)/,w=/^\s*(-?\d+)(\/-?\d+)?\s*/,c=/^\s*(-?\d+)\/?(-?\d+)?(\/-?\d+)?\s*/,b=/^\s*(\d+|on|off)/},88);
__d(function(e,t,s,o){Object.defineProperty(o,"__esModule",{value:!0});var i=function(){function e(t,s,o){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";babelHelpers.classCallCheck(this,e),this.name=i,this.vertices=t,this.textureCoords=s,this.normals=o,this.smooth=!1,this.materials=[],this.geometry={position:[],normal:[],uv:[],color:[],indexedPositions:{},index:[],hasNormals:!1,hasUVs:!1,hasVertexColors:!1}}return babelHelpers.createClass(e,[{key:"setSmoothing",value:function(e){this.smooth=e}},{key:"addFace",value:function(e){for(var t=[],s=[],o=[],i=0;i<e.length;i++)t.push(e[i][0]<0?e[i][0]+this.vertices.length:e[i][0]-1),e[i][1]?(s.push(e[i][1]<0?e[i][1]+this.textureCoords.length:e[i][1]-1),this.geometry.hasUVs=!0):s.push(-1),e[i][2]?(o.push(e[i][2]<0?e[i][2]+this.normals.length:e[i][2]-1),this.geometry.hasNormals=!0):o.push(-1);for(var h=1;h+1<e.length;h++)this._pushGeometryPoint(t[0],s[0],o[0]),this._pushGeometryPoint(t[h],s[h],o[h]),this._pushGeometryPoint(t[h+1],s[h+1],o[h+1])}},{key:"addMaterial",value:function(e,t){var s=this.geometry.index.length;if(this.materials.length>0){var o=this.materials[this.materials.length-1];o.endGroup=s}this.materials.push({name:e,lib:t,startGroup:s,endGroup:-1})}},{key:"_pushGeometryPoint",value:function(e,t,s){var o=this.vertices[e],i=t<0?[0,0]:this.textureCoords[t],h=s<0?[0,0,1]:this.normals[s],r=[e,t,s].join(","),n=this.geometry.indexedPositions[r];if(void 0===n){var a=this.geometry.position.length/3|0;this.geometry.position.push(o[0]),this.geometry.position.push(o[1]),this.geometry.position.push(o[2]),this.geometry.uv.push(i[0]),this.geometry.uv.push(i[1]),this.geometry.normal.push(h[0]),this.geometry.normal.push(h[1]),this.geometry.normal.push(h[2]),this.geometry.index.push(a),this.geometry.indexedPositions[r]=a,o.length>=6&&(this.geometry.color.push(o[3]),this.geometry.color.push(o[4]),this.geometry.color.push(o[5]),this.geometry.hasVertexColors=!0)}else this.geometry.index.push(n)}}]),e}();o.default=i},89);
__d(function(e,i,t,n){function a(e){"function"==typeof e.dispose&&e.dispose(),e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose();for(var i=e.children,t=Array.isArray(i),n=0,i=t?i:i["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();;){var r;if(t){if(n>=i.length)break;r=i[n++]}else{if(n=i.next(),n.done)break;r=n.value}var s=r;a(s)}}Object.defineProperty(n,"__esModule",{value:!0});var r=i(35),s=babelHelpers.interopRequireWildcard(r),l=i(91),o=babelHelpers.interopRequireDefault(l),u=i(61),c=babelHelpers.interopRequireDefault(u),f=i(50),h=babelHelpers.interopRequireDefault(f);(0,o.default)(s);var m=new h.default(function(e,i){a(i.scene)}),v={},d=function(){function e(i,t){var n=this;babelHelpers.classCallCheck(this,e),this.url=(0,c.default)(i.gltf2)||"",this.parent=t,this.mixer=null,this.timeStamp=-1,this.activeAnimations={},this.allAnimations={};var a=function(e){m.has(n.url)&&m.addReference(n.url),n.scene=e.scene,n.mixer=new s.AnimationMixer(n.scene);var a=e.animations;if(a&&a.length)for(var r=0;r<a.length;r++){var l=a[r];n.allAnimations[l.name]=n.mixer.clipAction(l)}n.updateAnimation(i),requestAnimationFrame(function(){t.add(n.scene)})};if(m.has(this.url))return void a(m.get(this.url));if(v[this.url])return void v[this.url].push(a);var r=new s.GLTFLoader;r.load(this.url,function(e){a(e)},function(){},function(){console.error("failed to load GLTF",n.url),delete v[n.url]})}return babelHelpers.createClass(e,[{key:"updateAnimation",value:function(e){if(!e.animations||0===e.animations.length)return void(this.mixer&&(this.activeAnimations={},this.mixer.stopAllAction()));var i={};for(var t in e.animations){var n="animation_"+t;if(i[n]=!0,this.allAnimations[n]){var a=this.allAnimations[n],r=e.animations[t];r&&(a.fadeIn(r.fadeTime?r.fadeTime:0),a.setEffectiveTimeScale(r.timeScale?r.timeScale:1),a.setEffectiveWeight(r.weight?r.weight:1),r.syncWith&&this.allAnimations[r.syncWith]&&a.syncWith(this.allAnimations[r.syncWith])),this.activeAnimations[n]||a.play()}delete this.activeAnimations[n]}for(var s in this.activeAnimations)this.allAnimations[s]&&this.allAnimations[s].stop();this.activeAnimations=i}},{key:"update",value:function(e){var i=(0,c.default)(e.gltf2)||"";return i===this.url&&(this.updateAnimation(e),!0)}},{key:"frame",value:function(e,i){this.mixer&&this.mixer.update(.001*i)}},{key:"setLit",value:function(e){}},{key:"setTexture",value:function(e){}},{key:"setWireframe",value:function(e){}},{key:"dispose",value:function(){this.scene&&(m.removeReference(this.url),this.parent.remove(this.scene),delete this.scene)}}]),e}(),p=function(){function e(){babelHelpers.classCallCheck(this,e)}return babelHelpers.createClass(e,[{key:"canLoad",value:function(e){return e&&e.hasOwnProperty("gltf2")}},{key:"createInstance",value:function(e,i,t,n){return new d(e,i)}}]),e}();n.default=p},90);
__d(function(e,a,r,t){"use strict";r.exports=function(e){e.GLTFLoader=function(){function a(a){this.manager=void 0!==a?a:e.DefaultLoadingManager}function r(){var e={};return{get:function(a){return e[a]},add:function(a,r){e[a]=r},remove:function(a){delete e[a]},removeAll:function(){e={}},update:function(a,r){for(var t in e){var n=e[t];n.update&&n.update(a,r)}}}}function t(a){this.name=f.KHR_LIGHTS,this.lights={};var r=a.extensions&&a.extensions[f.KHR_LIGHTS]||{},t=r.lights||{};for(var n in t){var s,i=t[n],o=(new e.Color).fromArray(i.color);switch(i.type){case"directional":s=new e.DirectionalLight(o),s.position.set(0,0,1);break;case"point":s=new e.PointLight(o);break;case"spot":s=new e.SpotLight(o),s.position.set(0,0,1);break;case"ambient":s=new e.AmbientLight(o)}s&&(void 0!==i.constantAttenuation&&(s.intensity=i.constantAttenuation),void 0!==i.linearAttenuation&&(s.distance=1/i.linearAttenuation),void 0!==i.quadraticAttenuation&&(s.decay=i.quadraticAttenuation),void 0!==i.fallOffAngle&&(s.angle=i.fallOffAngle),void 0!==i.fallOffExponent&&console.warn("THREE.GLTFLoader:: light.fallOffExponent not currently supported."),s.name=i.name||"light_"+n,this.lights[n]=s)}}function n(e){this.name=f.KHR_MATERIALS_COMMON}function s(e){this.name=f.KHR_BINARY_GLTF,this.content=null,this.body=null;var a=new DataView(e,0,h);if(this.header={magic:u(new Uint8Array(e.slice(0,4))),version:a.getUint32(4,!0),length:a.getUint32(8,!0)},this.header.magic!==m)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected. Use GLTFLoader instead.");for(var r=new DataView(e,h),t=0;t<r.byteLength;){var n=r.getUint32(t,!0);t+=4;var s=r.getUint32(t,!0);if(t+=4,s===v.JSON){var i=new Uint8Array(e,h+t,n);this.content=u(i)}else if(s===v.BIN){var o=h+t;this.body=e.slice(o,o+n)}t+=n}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}function i(){return{name:f.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,getMaterialType:function(){return e.ShaderMaterial},extendParams:function(a,r,t){var n=r.extensions[this.name],s=e.ShaderLib.standard,i=e.UniformsUtils.clone(s.uniforms),o=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),l=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),u=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),c=["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"),d=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>",o).replace("#include <metalnessmap_pars_fragment>",l).replace("#include <roughnessmap_fragment>",u).replace("#include <metalnessmap_fragment>",c).replace("#include <lights_physical_fragment>",p);delete i.roughness,delete i.metalness,delete i.roughnessMap,delete i.metalnessMap,i.specular={value:(new e.Color).setHex(1118481)},i.glossiness={value:.5},i.specularMap={value:null},i.glossinessMap={value:null},a.vertexShader=s.vertexShader,a.fragmentShader=d,a.uniforms=i,a.defines={STANDARD:""},a.color=new e.Color(1,1,1),a.opacity=1;var f=[];if(Array.isArray(n.diffuseFactor)){var m=n.diffuseFactor;a.color.fromArray(m),a.opacity=m[3]}if(void 0!==n.diffuseTexture&&f.push(t.assignTexture(a,"map",n.diffuseTexture.index)),a.emissive=new e.Color(0,0,0),a.glossiness=void 0!==n.glossinessFactor?n.glossinessFactor:1,a.specular=new e.Color(1,1,1),Array.isArray(n.specularFactor)&&a.specular.fromArray(n.specularFactor),void 0!==n.specularGlossinessTexture){var h=n.specularGlossinessTexture.index;f.push(t.assignTexture(a,"glossinessMap",h)),f.push(t.assignTexture(a,"specularMap",h))}return Promise.all(f)},createMaterial:function(a){var r=new e.ShaderMaterial({defines:a.defines,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader,uniforms:a.uniforms,fog:!0,lights:!0,opacity:a.opacity,transparent:a.transparent});return r.isGLTFSpecularGlossinessMaterial=!0,r.color=a.color,r.map=void 0===a.map?null:a.map,r.lightMap=null,r.lightMapIntensity=1,r.aoMap=void 0===a.aoMap?null:a.aoMap,r.aoMapIntensity=1,r.emissive=a.emissive,r.emissiveIntensity=1,r.emissiveMap=void 0===a.emissiveMap?null:a.emissiveMap,r.bumpMap=void 0===a.bumpMap?null:a.bumpMap,r.bumpScale=1,r.normalMap=void 0===a.normalMap?null:a.normalMap,r.normalScale=new e.Vector2(1,1),r.displacementMap=null,r.displacementScale=1,r.displacementBias=0,r.specularMap=void 0===a.specularMap?null:a.specularMap,r.specular=a.specular,r.glossinessMap=void 0===a.glossinessMap?null:a.glossinessMap,r.glossiness=a.glossiness,r.alphaMap=null,r.envMap=void 0===a.envMap?null:a.envMap,r.envMapIntensity=1,r.refractionRatio=.98,r.extensions.derivatives=!0,r},refreshUniforms:function(e,a,r,t,n,s){var i=n.uniforms,o=n.defines;i.opacity.value=n.opacity,i.diffuse.value.copy(n.color),i.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity),i.map.value=n.map,i.specularMap.value=n.specularMap,i.alphaMap.value=n.alphaMap,i.lightMap.value=n.lightMap,i.lightMapIntensity.value=n.lightMapIntensity,i.aoMap.value=n.aoMap,i.aoMapIntensity.value=n.aoMapIntensity;var l;if(n.map?l=n.map:n.specularMap?l=n.specularMap:n.displacementMap?l=n.displacementMap:n.normalMap?l=n.normalMap:n.bumpMap?l=n.bumpMap:n.glossinessMap?l=n.glossinessMap:n.alphaMap?l=n.alphaMap:n.emissiveMap&&(l=n.emissiveMap),void 0!==l){l.isWebGLRenderTarget&&(l=l.texture);var u=l.offset,c=l.repeat;i.offsetRepeat.value.set(u.x,u.y,c.x,c.y)}i.envMap.value=n.envMap,i.envMapIntensity.value=n.envMapIntensity,i.flipEnvMap.value=n.envMap&&n.envMap.isCubeTexture?-1:1,i.refractionRatio.value=n.refractionRatio,i.specular.value.copy(n.specular),i.glossiness.value=n.glossiness,i.glossinessMap.value=n.glossinessMap,i.emissiveMap.value=n.emissiveMap,i.bumpMap.value=n.bumpMap,i.normalMap.value=n.normalMap,i.displacementMap.value=n.displacementMap,i.displacementScale.value=n.displacementScale,i.displacementBias.value=n.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 o(e,a,r){if(!e)return Promise.resolve();var t,n=[];if("[object Array]"===Object.prototype.toString.call(e)){t=[];for(var s=e.length,i=0;i<s;i++){var o=a.call(r||this,e[i],i);o&&(n.push(o),o instanceof Promise?o.then(function(e,a){t[e]=a}.bind(this,i)):t[i]=o)}}else{t={};for(var l in e)if(e.hasOwnProperty(l)){var o=a.call(r||this,e[l],l);o&&(n.push(o),o instanceof Promise?o.then(function(e,a){t[e]=a}.bind(this,l)):t[l]=o)}}return Promise.all(n).then(function(){return t})}function l(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 u(e){if(void 0!==window.TextDecoder)return(new TextDecoder).decode(e);for(var a="",r=0,t=e.length;r<t;r++)a+=String.fromCharCode(e[r]);return a}function c(){return new e.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:e.FrontSide})}function p(e,a,r,t){var n=e.geometry,s=e.material,i=r.targets,o=n.morphAttributes;o.position=[],o.normal=[],s.morphTargets=!0;for(var l=0,u=i.length;l<u;l++){var c,p,d=i[l],f="morphTarget"+l;if(void 0!==d.POSITION){c=t.accessors[d.POSITION].clone();for(var m=n.attributes.position,h=0,v=c.count;h<v;h++)c.setXYZ(h,c.getX(h)+m.getX(h),c.getY(h)+m.getY(h),c.getZ(h)+m.getZ(h))}else c=n.attributes.position.clone();if(void 0!==d.NORMAL){s.morphNormals=!0,p=t.accessors[d.NORMAL].clone();for(var g=n.attributes.normal,h=0,v=p.count;h<v;h++)p.setXYZ(h,p.getX(h)+g.getX(h),p.getY(h)+g.getY(h),p.getZ(h)+g.getZ(h))}else p=n.attributes.normal.clone();void 0!==d.TANGENT,c.name=f,p.name=f,o.position.push(c),o.normal.push(p)}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 d(e,a,t){this.json=e||{},this.extensions=a||{},this.options=t||{},this.cache=new r}a.prototype={constructor:a,crossOrigin:"Anonymous",load:function(a,r,t,n){var s=this,i=this.path&&"string"==typeof this.path?this.path:e.Loader.prototype.extractUrlBase(a),o=new e.FileLoader(s.manager);o.setResponseType("arraybuffer"),o.load(a,function(e){try{s.parse(e,i,r,n)}catch(e){n(e.constructor===Error?e:new Error("THREE.GLTFLoader: Unable to parse model."))}},t,n)},setCrossOrigin:function(e){this.crossOrigin=e},setPath:function(e){this.path=e},parse:function(e,a,r,o){var l,c={},p=u(new Uint8Array(e,0,4));p===m?(c[f.KHR_BINARY_GLTF]=new s(e),l=c[f.KHR_BINARY_GLTF].content):l=u(new Uint8Array(e));var h=JSON.parse(l);if(void 0===h.asset||h.asset.version[0]<2)return void o(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));h.extensionsUsed&&(h.extensionsUsed.indexOf(f.KHR_LIGHTS)>=0&&(c[f.KHR_LIGHTS]=new t(h)),h.extensionsUsed.indexOf(f.KHR_MATERIALS_COMMON)>=0&&(c[f.KHR_MATERIALS_COMMON]=new n(h)),h.extensionsUsed.indexOf(f.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS)>=0&&(c[f.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]=new i)),console.time("GLTFLoader");var v=new d(h,c,{path:a||this.path,crossOrigin:this.crossOrigin});v.parse(function(e,a,t,n){console.timeEnd("GLTFLoader");var s={scene:e,scenes:a,cameras:t,animations:n};r(s)},o)}};var f={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_LIGHTS:"KHR_lights",KHR_MATERIALS_COMMON:"KHR_materials_common",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness"};n.prototype.getMaterialType=function(a){var r=a.extensions[this.name];switch(r.type){case"commonBlinn":case"commonPhong":return e.MeshPhongMaterial;case"commonLambert":return e.MeshLambertMaterial;case"commonConstant":default:return e.MeshBasicMaterial}},n.prototype.extendParams=function(a,r,t){var n=r.extensions[this.name],s=[],i=[];switch(n.type){case"commonBlinn":case"commonPhong":i.push("diffuseFactor","diffuseTexture","specularFactor","specularTexture","shininessFactor");break;case"commonLambert":i.push("diffuseFactor","diffuseTexture");break;case"commonConstant":}var o={};return i.forEach(function(e){void 0!==n[e]&&(o[e]=n[e])}),void 0!==o.diffuseFactor&&(a.color=(new e.Color).fromArray(o.diffuseFactor),a.opacity=o.diffuseFactor[3]),void 0!==o.diffuseTexture&&s.push(t.assignTexture(a,"map",o.diffuseTexture.index)),void 0!==o.specularFactor&&(a.specular=(new e.Color).fromArray(o.specularFactor)),void 0!==o.specularTexture&&s.push(t.assignTexture(a,"specularMap",o.specularTexture.index)),void 0!==o.shininessFactor&&(a.shininess=o.shininessFactor),Promise.all(s)};var m="glTF",h=12,v={JSON:1313821514,BIN:5130562},g={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},M=({5126:Number,35675:e.Matrix3,35676:e.Matrix4,35664:e.Vector2,35665:e.Vector3,35666:e.Vector4,35678:e.Texture},{5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array}),S={9728:e.NearestFilter,9729:e.LinearFilter,9984:e.NearestMipMapNearestFilter,9985:e.LinearMipMapNearestFilter,9986:e.NearestMipMapLinearFilter,9987:e.LinearMipMapLinearFilter},T={33071:e.ClampToEdgeWrapping,33648:e.MirroredRepeatWrapping,10497:e.RepeatWrapping},L={6406:e.AlphaFormat,6407:e.RGBFormat,6408:e.RGBAFormat,6409:e.LuminanceFormat,6410:e.LuminanceAlphaFormat},A={5121:e.UnsignedByteType,32819:e.UnsignedShort4444Type,32820:e.UnsignedShort5551Type,33635:e.UnsignedShort565Type},y=({1028:e.BackSide,1029:e.FrontSide},{512:e.NeverDepth,513:e.LessDepth,514:e.EqualDepth,515:e.LessEqualDepth,516:e.GreaterEqualDepth,517:e.NotEqualDepth,518:e.GreaterEqualDepth,519:e.AlwaysDepth},{32774:e.AddEquation,32778:e.SubtractEquation,32779:e.ReverseSubtractEquation},{0:e.ZeroFactor,1:e.OneFactor,768:e.SrcColorFactor,769:e.OneMinusSrcColorFactor,770:e.SrcAlphaFactor,771:e.OneMinusSrcAlphaFactor,772:e.DstAlphaFactor,773:e.OneMinusDstAlphaFactor,774:e.DstColorFactor,775:e.OneMinusDstColorFactor,776:e.SrcAlphaSaturateFactor},{SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16}),E={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},R={CATMULLROMSPLINE:e.InterpolateSmooth,CUBICSPLINE:e.InterpolateSmooth,LINEAR:e.InterpolateLinear,STEP:e.InterpolateDiscrete},w={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};return d.prototype._withDependencies=function(e){for(var a={},r=0;r<e.length;r++){var t=e[r],n="load"+t.charAt(0).toUpperCase()+t.slice(1),s=this.cache.get(t);if(void 0!==s)a[t]=s;else if(this[n]){var i=this[n]();this.cache.add(t,i),a[t]=i}}return o(a,function(e){return e})},d.prototype.parse=function(e,a){var r=this.json;this.cache.removeAll(),this._withDependencies(["scenes","cameras","animations"]).then(function(a){var t=[];for(var n in a.scenes)t.push(a.scenes[n]);var s=void 0!==r.scene?a.scenes[r.scene]:t[0],i=[];for(var n in a.cameras){var o=a.cameras[n];i.push(o)}var l=[];for(var n in a.animations)l.push(a.animations[n]);e(s,t,i,l)}).catch(a)},d.prototype.getDependency=function(e,a){var r=e+":"+a,t=this.cache.get(r);if(!t){var n="load"+e.charAt(0).toUpperCase()+e.slice(1);t=this[n](a),this.cache.add(r,t)}return t},d.prototype.loadBuffer=function(a){var r=this.json.buffers[a];if(r.type&&"arraybuffer"!==r.type)throw new Error("THREE.GLTFLoader: %s buffer type is not supported.",r.type);if(void 0===r.uri&&0===a)return Promise.resolve(this.extensions[f.KHR_BINARY_GLTF].body);var t=this.options;return new Promise(function(a){var n=new e.FileLoader;n.setResponseType("arraybuffer"),n.load(l(r.uri,t.path),a)})},d.prototype.loadBufferView=function(e){var a=this.json.bufferViews[e];return this.getDependency("buffer",a.buffer).then(function(e){var r=a.byteLength||0,t=a.byteOffset||0;return e.slice(t,t+r)})},d.prototype.loadAccessors=function(){var a=this,r=this.json;return o(r.accessors,function(t){return a.getDependency("bufferView",t.bufferView).then(function(a){var n,s=y[t.type],i=M[t.componentType],o=i.BYTES_PER_ELEMENT,l=o*s,u=r.bufferViews[t.bufferView].byteStride;if(u&&u!==l){n=new i(a);var c=new e.InterleavedBuffer(n,u/o);return new e.InterleavedBufferAttribute(c,s,t.byteOffset/o)}return n=new i(a,t.byteOffset,t.count*s),new e.BufferAttribute(n,s)})})},d.prototype.loadTexture=function(a){var r=this,t=this.json,n=this.options,s=window.URL||window.webkitURL,i=t.textures[a],o=t.images[i.source],u=o.uri,c=!1;return void 0!==o.bufferView&&(u=r.getDependency("bufferView",o.bufferView).then(function(e){c=!0;var a=new Blob([e],{type:o.mimeType});return u=s.createObjectURL(a)})),Promise.resolve(u).then(function(a){var r=e.Loader.Handlers.get(a)||new e.TextureLoader;return r.setCrossOrigin(n.crossOrigin),new Promise(function(e,t){r.load(l(a,n.path),e,void 0,t)})}).then(function(a){void 0!==c&&s.revokeObjectURL(u),a.flipY=!1,void 0!==i.name&&(a.name=i.name),a.format=void 0!==i.format?L[i.format]:e.RGBAFormat,void 0!==i.internalFormat&&a.format!==L[i.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."),a.type=void 0!==i.type?A[i.type]:e.UnsignedByteType;var r=t.samplers||{},n=r[i.sampler]||{};return a.magFilter=S[n.magFilter]||e.LinearFilter,a.minFilter=S[n.minFilter]||e.LinearMipMapLinearFilter,a.wrapS=T[n.wrapS]||e.RepeatWrapping,a.wrapT=T[n.wrapT]||e.RepeatWrapping,a})},d.prototype.assignTexture=function(e,a,r){return this.getDependency("texture",r).then(function(r){e[a]=r})},d.prototype.loadMaterials=function(){var a=this,r=this.json,t=this.extensions;return o(r.materials,function(r){var n,s={},i=r.extensions||{},o=[];if(i[f.KHR_MATERIALS_COMMON]){var l=t[f.KHR_MATERIALS_COMMON];n=l.getMaterialType(r),o.push(l.extendParams(s,r,a))}else if(i[f.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var u=t[f.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];n=u.getMaterialType(r),o.push(u.extendParams(s,r,a))}else if(void 0!==r.pbrMetallicRoughness){n=e.MeshStandardMaterial;var c=r.pbrMetallicRoughness;if(s.color=new e.Color(1,1,1),s.opacity=1,Array.isArray(c.baseColorFactor)){var p=c.baseColorFactor;s.color.fromArray(p),s.opacity=p[3]}if(void 0!==c.baseColorTexture&&o.push(a.assignTexture(s,"map",c.baseColorTexture.index)),s.metalness=void 0!==c.metallicFactor?c.metallicFactor:1,s.roughness=void 0!==c.roughnessFactor?c.roughnessFactor:1,void 0!==c.metallicRoughnessTexture){var d=c.metallicRoughnessTexture.index;o.push(a.assignTexture(s,"metalnessMap",d)),o.push(a.assignTexture(s,"roughnessMap",d))}}else n=e.MeshPhongMaterial;r.doubleSided===!0&&(s.side=e.DoubleSide);var m=r.alphaMode||w.OPAQUE;return m!==w.OPAQUE?s.transparent=!0:s.transparent=!1,void 0!==r.normalTexture&&o.push(a.assignTexture(s,"normalMap",r.normalTexture.index)),void 0!==r.occlusionTexture&&o.push(a.assignTexture(s,"aoMap",r.occlusionTexture.index)),void 0!==r.emissiveFactor&&(n===e.MeshBasicMaterial?s.color=(new e.Color).fromArray(r.emissiveFactor):s.emissive=(new e.Color).fromArray(r.emissiveFactor)),void 0!==r.emissiveTexture&&(n===e.MeshBasicMaterial?o.push(a.assignTexture(s,"map",r.emissiveTexture.index)):o.push(a.assignTexture(s,"emissiveMap",r.emissiveTexture.index))),Promise.all(o).then(function(){var a;return a=n===e.ShaderMaterial?t[f.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(s):new n(s),void 0!==r.name&&(a.name=r.name),a.normalScale.x=-1,a.userData=r.extras,a})})},d.prototype.loadGeometries=function(a){return this._withDependencies(["accessors"]).then(function(r){return o(a,function(a){var t=new e.BufferGeometry,n=a.attributes;for(var s in n){var i=n[s];if(void 0===i)return;var o=r.accessors[i];switch(s){case"POSITION":t.addAttribute("position",o);break;case"NORMAL":t.addAttribute("normal",o);break;case"TEXCOORD_0":case"TEXCOORD0":case"TEXCOORD":t.addAttribute("uv",o);break;case"TEXCOORD_1":t.addAttribute("uv2",o);break;case"COLOR_0":case"COLOR0":case"COLOR":t.addAttribute("color",o);break;case"WEIGHTS_0":case"WEIGHT":t.addAttribute("skinWeight",o);break;case"JOINTS_0":case"JOINT":t.addAttribute("skinIndex",o)}}return void 0!==a.indices&&t.setIndex(r.accessors[a.indices]),t})})},d.prototype.loadMeshes=function(){var a=this,r=this.json;return this._withDependencies(["accessors","materials"]).then(function(t){return o(r.meshes,function(r){var n=new e.Group;void 0!==r.name&&(n.name=r.name),r.extras&&(n.userData=r.extras);var s=r.primitives||[];return a.loadGeometries(s).then(function(a){for(var i in s){var o=s[i],l=a[i],u=void 0===o.material?c():t.materials[o.material];u.aoMap&&void 0===l.attributes.uv2&&void 0!==l.attributes.uv&&(console.log("THREE.GLTFLoader: Duplicating UVs to support aoMap."),l.addAttribute("uv2",new e.BufferAttribute(l.attributes.uv.array,2))),void 0!==l.attributes.color&&(u.vertexColors=e.VertexColors,u.needsUpdate=!0),void 0===l.attributes.normal&&(void 0!==u.flatShading?u.flatShading=!0:u.shading=e.FlatShading);var d;if(o.mode===g.TRIANGLES||void 0===o.mode)d=new e.Mesh(l,u);else if(o.mode===g.TRIANGLE_STRIP)d=new e.Mesh(l,u),d.drawMode=e.TriangleStripDrawMode;else if(o.mode===g.TRIANGLE_FAN)d=new e.Mesh(l,u),d.drawMode=e.TriangleFanDrawMode;else if(o.mode===g.LINES)d=new e.LineSegments(l,u);else if(o.mode===g.LINE_STRIP)d=new e.Line(l,u);else if(o.mode===g.LINE_LOOP)d=new e.LineLoop(l,u);else{if(o.mode!==g.POINTS)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: ",o.mode);d=new e.Points(l,u)}d.name=n.name+"_"+i,void 0!==o.targets&&p(d,r,o,t),o.extras&&(d.userData=o.extras),n.add(d)}return n})})})},d.prototype.loadCameras=function(){var a=this.json;return o(a.cameras,function(a){var r,t=a[a.type];if(!t)return void console.warn("THREE.GLTFLoader: Missing camera parameters.");if("perspective"===a.type){var n=t.aspectRatio||1,s=t.yfov*n;r=new e.PerspectiveCamera(e.Math.radToDeg(s),n,t.znear||1,t.zfar||2e6)}else"orthographic"===a.type&&(r=new e.OrthographicCamera(t.xmag/-2,t.xmag/2,t.ymag/2,t.ymag/-2,t.znear,t.zfar));return void 0!==a.name&&(r.name=a.name),a.extras&&(r.userData=a.extras),r})},d.prototype.loadSkins=function(){var e=this.json;return this._withDependencies(["accessors"]).then(function(a){return o(e.skins,function(e){var r={joints:e.joints,inverseBindMatrices:a.accessors[e.inverseBindMatrices]};return r})})},d.prototype.loadAnimations=function(){var a=this.json;return this._withDependencies(["accessors","nodes"]).then(function(r){return o(a.animations,function(a,t){var n=[];for(var s in a.channels){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,c=void 0!==a.parameters?a.parameters[o.input]:o.input,p=void 0!==a.parameters?a.parameters[o.output]:o.output,d=r.accessors[c],f=r.accessors[p],m=r.nodes[u];if(m){m.updateMatrix(),m.matrixAutoUpdate=!0;var h;switch(E[l.path]){case E.weights:h=e.NumberKeyframeTrack;break;case E.rotation:h=e.QuaternionKeyframeTrack;break;case E.position:case E.scale:default:h=e.VectorKeyframeTrack}var v=m.name?m.name:m.uuid;"CATMULLROMSPLINE"===o.interpolation&&console.warn("THREE.GLTFLoader: CATMULLROMSPLINE interpolation is not supported. Using CUBICSPLINE instead.");var g=void 0!==o.interpolation?R[o.interpolation]:e.InterpolateLinear,M=[];E[l.path]===E.weights?m.traverse(function(e){e.isMesh===!0&&e.material.morphTargets===!0&&M.push(e.name?e.name:e.uuid)}):M.push(v);for(var S=0,T=M.length;S<T;S++)n.push(new h(M[S]+"."+E[l.path],e.AnimationUtils.arraySlice(d.array,0),e.AnimationUtils.arraySlice(f.array,0),g))}}}var u=void 0!==a.name?a.name:"animation_"+t;return new e.AnimationClip(u,void 0,n)})})},d.prototype.loadNodes=function(){var a=this.json,r=this.extensions,t=this,n=a.nodes||[],s=a.skins||[];return s.forEach(function(e){e.joints.forEach(function(e){n[e].isBone=!0})}),o(a.nodes,function(a){var r=new e.Matrix4,t=a.isBone===!0?new e.Bone:new e.Object3D;return void 0!==a.name&&(t.name=e.PropertyBinding.sanitizeNodeName(a.name)),a.extras&&(t.userData=a.extras),void 0!==a.matrix?(r.fromArray(a.matrix),t.applyMatrix(r)):(void 0!==a.translation&&t.position.fromArray(a.translation),void 0!==a.rotation&&t.quaternion.fromArray(a.rotation),void 0!==a.scale&&t.scale.fromArray(a.scale)),t}).then(function(n){return t._withDependencies(["meshes","skins","cameras"]).then(function(t){return o(n,function(s,i){var o,l=a.nodes[i];if(void 0!==l.mesh?o=[l.mesh]:void 0!==l.meshes&&(console.warn("THREE.GLTFLoader: Legacy glTF file detected. Nodes may have no more than one mesh."),o=l.meshes),void 0!==o)for(var u in o){var c=o[u],p=t.meshes[c];if(void 0!==p){var d=p.clone(!1);for(var m in p.children){var h=p.children[m],v=h,g=h.material,M=h.geometry,S=h.morphTargetInfluences,T=h.userData,L=h.name,A=g;switch(h.type){case"LineSegments":h=new e.LineSegments(M,A);break;case"LineLoop":h=new e.LineLoop(M,A);break;case"Line":h=new e.Line(M,A);break;case"Points":h=new e.Points(M,A);break;default:h=new e.Mesh(M,A),h.drawMode=v.drawMode}h.castShadow=!0,h.morphTargetInfluences=S,h.userData=T,h.name=L;var y;if(void 0!==l.skin&&(y=t.skins[l.skin]),y){var E=M;A=g,A.skinning=!0,h=new e.SkinnedMesh(E,A),h.castShadow=!0,h.userData=T,h.name=L;for(var R=[],w=[],x=0,_=y.joints.length;x<_;x++){var b=y.joints[x],F=n[b];if(F){R.push(F);var I=y.inverseBindMatrices.array,O=(new e.Matrix4).fromArray(I,16*x);w.push(O)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',b)}h.bind(new e.Skeleton(R,w),h.matrixWorld)}d.add(h)}s.add(d)}else console.warn('THREE.GLTFLoader: Could not find node "'+c+'".')}if(void 0!==l.camera){var G=t.cameras[l.camera];s.add(G)}if(l.extensions&&l.extensions[f.KHR_LIGHTS]&&void 0!==l.extensions[f.KHR_LIGHTS].light){var N=r[f.KHR_LIGHTS].lights;s.add(N[l.extensions[f.KHR_LIGHTS].light])}return s})})})},d.prototype.loadScenes=function(){function a(e,t,n){var s=n[e];t.add(s);var i=r.nodes[e];if(i.children)for(var o=i.children,l=0,u=o.length;l<u;l++){var c=o[l];a(c,s,n)}}var r=this.json,t=this.extensions;return this._withDependencies(["nodes"]).then(function(n){return o(r.scenes,function(r){var s=new e.Scene;void 0!==r.name&&(s.name=r.name),r.extras&&(s.userData=r.extras);for(var i=r.nodes||[],o=0,l=i.length;o<l;o++){var u=i[o];a(u,s,n.nodes)}if(s.traverse(function(e){e.material&&e.material.isGLTFSpecularGlossinessMaterial&&(e.onBeforeRender=t[f.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].refreshUniforms)}),r.extensions&&r.extensions[f.KHR_LIGHTS]&&void 0!==r.extensions[f.KHR_LIGHTS].light){var c=t[f.KHR_LIGHTS].lights;s.add(c[r.extensions[f.KHR_LIGHTS].light])}return s})})},a}()}},91);
__d(function(e,t,l,r){Object.defineProperty(r,"__esModule",{value:!0});var a=t(56),s=babelHelpers.interopRequireDefault(a),u=t(54),i=babelHelpers.interopRequireDefault(u),b=t(64),n=babelHelpers.interopRequireDefault(b),o=function(e){function t(e){babelHelpers.classCallCheck(this,t);var l=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return l.view=new s.default(e),l}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"presentLayout",value:function(){}}],[{key:"describe",value:function(){return(0,i.default)(babelHelpers.get(t.__proto__||Object.getPrototypeOf(t),"describe",this).call(this),{})}}]),t}(n.default);r.default=o},92);
__d(function(e,t,o,a){Object.defineProperty(a,"__esModule",{value:!0});var n=t(43),l=babelHelpers.interopRequireDefault(n),i=t(56),d=babelHelpers.interopRequireDefault(i),u=t(61),r=babelHelpers.interopRequireDefault(u),s=t(54),_=babelHelpers.interopRequireDefault(s),p=t(64),h=babelHelpers.interopRequireDefault(p),y=1,c=2,f=3,b=function(e){function t(e,o){babelHelpers.classCallCheck(this,t);var a=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return a.view=new d.default(e),a._rnctx=o,a._audioModule=o.AudioModule,a._counter=0,a._handle=null,a._playStatus="closed",a._onCanPlay=a._onCanPlay.bind(a),a._onPlaying=a._onPlaying.bind(a),a._onPause=a._onPause.bind(a),a._onEnded=a._onEnded.bind(a),a._onError=a._onError.bind(a),a._onDurationChange=a._onDurationChange.bind(a),a._onTimeUpdate=a._onTimeUpdate.bind(a),Object.defineProperty(a.props,"autoPlay",{set:function(e){a.props._autoPlay=e}}),Object.defineProperty(a.props,"volume",{set:function(e){e<0||(a.props._volume=e,a._handle&&a._audioModule.setVolume(a._handle,a.props._volume))}}),Object.defineProperty(a.props,"muted",{set:function(e){a.props._muted=e,a._handle&&a._audioModule.setMuted(a._handle,a.props._muted)}}),Object.defineProperty(a.props,"loop",{set:function(e){a.props._loop=e}}),Object.defineProperty(a.props,"playControl",{set:function(e){a.props._playControl=e,a._handle&&("stop"===a.props._playControl?a._audioModule.stop(a._handle):"pause"===a.props._playControl?a._audioModule.pause(a._handle):"play"===a.props._playControl&&a._audioModule.play(a._handle))}}),Object.defineProperty(a.props,"source",{set:function(e){var t=null;if(!e||"object"!=typeof e||"uri"in e){if(e&&(t=(0,r.default)(e),!t))return}else{var o=null;for(var n in e)if((0,l.default)().indexOf(n)>-1){o=n,t=(0,r.default)(e[n]);break}if(!o)return;if(!t)return}if(a.props._source=e,!a.props._source){var i=a._handle;return a._handle=null,i&&a._audioModule.unload(i),void a._updatePlayStatus("closed")}var d=a._handle;a._counter+=1,a._handle=[t,a.view.uuid,a._counter].join("-"),a._audioModule.addHandle(a._handle),a._audioModule.setUrl(a._handle,t),a.props._volume&&a._audioModule.setVolume(a._handle,a.props._volume),a.props._muted&&a._audioModule.setMuted(a._handle,a.props._muted),d&&a._audioModule.unload(d),a._audioModule._addMediaEventListener(a._handle,"canplay",a._onCanPlay),a._audioModule._addMediaEventListener(a._handle,"ended",a._onEnded),a._audioModule._addMediaEventListener(a._handle,"playing",a._onPlaying),a._audioModule._addMediaEventListener(a._handle,"pause",a._onPause),a._audioModule._addMediaEventListener(a._handle,"error",a._onError),a._audioModule._addMediaEventListener(a._handle,"durationchange",a._onDurationChange),a._audioModule._addMediaEventListener(a._handle,"timeupdate",a._onTimeUpdate),a._audioModule.load(a._handle),a._updatePlayStatus("loading")}}),a}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"presentLayout",value:function(){if(babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"presentLayout",this).call(this,this),this._handle){var e=this.view.getWorldPosition().toArray();this._audioModule.setPosition(this._handle,e)}}},{key:"dispose",value:function(){this._handle&&this._audioModule.unload(this._handle),babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"dispose",this).call(this)}},{key:"receiveCommand",value:function(e,o){switch(babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"receiveCommand",this).call(this,e,o),e){case y:if(this._handle){var a=o?o[0]:0;this._audioModule.seekTo(this._handle,a)}break;case c:this._handle&&this._audioModule.play(this._handle);break;case f:this._handle&&this._audioModule.pause(this._handle)}}},{key:"_onCanPlay",value:function(e){if(e===this._handle){this._updatePlayStatus("ready");var t=this.props._playControl;(this.props._autoPlay&&"stop"!==t||"play"===t)&&this._audioModule.play(e)}}},{key:"_onEnded",value:function(e){e===this._handle&&(this._updatePlayStatus("ended"),this.props._loop&&"stop"!==this.props._playControl&&this._audioModule.play(e),this._emitEvent("topEnded",[]))}},{key:"_onPlaying",value:function(e){e===this._handle&&this._updatePlayStatus("playing")}},{key:"_onPause",value:function(e){e===this._handle&&this._updatePlayStatus("paused")}},{key:"_onError",value:function(e,t){e===this._handle&&this._updatePlayStatus("error")}},{key:"_onDurationChange",value:function(e,t){if(e===this._handle){var o=t.target&&t.target.duration;o&&this._emitEvent("topDurationChange",{duration:o})}}},{key:"_onTimeUpdate",value:function(e,t){if(e===this._handle){var o=t.target&&t.target.currentTime;o&&this._emitEvent("topTimeUpdate",{currentTime:o})}}},{key:"_emitEvent",value:function(e,t){this._rnctx.callFunction("RCTEventEmitter","receiveEvent",[this.getTag(),e,t])}},{key:"_updatePlayStatus",value:function(e){this._playStatus!==e&&(this._playStatus=e,this._emitEvent("topPlayStatusChange",{playStatus:this._playStatus}))}}],[{key:"describe",value:function(){return(0,_.default)(babelHelpers.get(t.__proto__||Object.getPrototypeOf(t),"describe",this).call(this),{NativeProps:{autoPlay:"boolean",volume:"number",loop:"boolean",muted:"boolean",playControl:"string",source:"object"},Commands:{seekTo:y,play:c,pause:f}})}}]),t}(h.default);a.default=b},93);
__d(function(e,t,i,r){function o(e,t){var i=1/t;return Math.ceil(e*i)/i}Object.defineProperty(r,"__esModule",{value:!0});var n=t(64),s=babelHelpers.interopRequireDefault(n),l=t(58),a=babelHelpers.interopRequireWildcard(l),u=t(56),h=babelHelpers.interopRequireDefault(u),f=t(54),p=babelHelpers.interopRequireDefault(f),y=t(62),d=babelHelpers.interopRequireWildcard(y),_={auto:"left",left:"left",right:"right",center:"center_line",justify:"left"},c={auto:"top",top:"top",bottom:"bottom",center:"center"},x={normal:200,bold:600},b=function(e){function t(e,i,r){babelHelpers.classCallCheck(this,t);var o=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return o.view=new h.default(e),o.view.clippingEnabled=!0,o.guiSys=e,o.isTextNode=!0,o.inSurfaceContext=r,o._textDirty=!0,o._visualTextDirty=!0,o._fontBorderSize=0,o._fontWeight=0,o._isOnLayer=!1,o.textChildren=[],o.YGNode.setMeasureFunc(function(e,t,i,r){return o.measure(e,t,i,r)}),Object.defineProperty(o.props,"numberOfLines",{set:function(e){null===e&&(e=0),o.props._numberOfLines=e,o._textDirty=!0,o.markTextDirty(),o.makeDirty()}}),Object.defineProperty(o.props,"isOnLayer",{set:function(e){null===e&&(e=!1),o._isOnLayer=e,o.view.clippingEnabled=e,o._textDirty=!0,o.markTextDirty(),o.makeDirty()}}),Object.defineProperty(o.props,"hitSlop",{set:function(e){null===e&&(e=0),"number"==typeof e?o.view.setHitSlop(e,e,e,e):o.view.setHitSlop(e.left,e.top,e.right,e.bottom)}}),Object.defineProperty(o.style,"color",{set:function(e){null===e&&(e=4294967295),o.style._textColor=e,o.markTextDirty(),o.makeDirty()}}),Object.defineProperty(o.style,"fontSize",{set:function(e){null===e&&(e=o.inSurfaceContext?20:.1),o.view.setTextSize(e),o._fontSize=e,o._textDirty=!0,o.markTextDirty(),o.makeDirty()},get:function(){return o._fontSize}}),Object.defineProperty(o.style,"fontWeight",{set:function(e){null===e&&(e="normal");var t=x[e],i=parseInt(t?t:e,10);o._fontWeight=i,o.view.setTextAlphaCenter(.54-o._fontBorderSize-o._fontWeight/1e4),o.view.setTextColorCenter(.54-o._fontWeight/1e4)}}),Object.defineProperty(o.style,"textShadowRadius",{set:function(e){null===e&&(e=0),o._fontBorderSize=e,o.view.setTextAlphaCenter(.54-o._fontBorderSize-o._fontWeight/1e4),o.view.setTextColorCenter(.54-o._fontWeight/1e4)}}),Object.defineProperty(o.style,"textAlign",{set:function(e){null===e&&(e="auto"),o.markTextDirty(),o.view.setTextHAlign(_[e])}}),Object.defineProperty(o.style,"textAlignVertical",{set:function(e){null===e&&(e="auto"),o.markTextDirty(),o.view.setTextVAlign(c[e])}}),o.style.fontWeight="200",o.style.fontSize=o.inSurfaceContext?20:.1,o.style.textAlign="auto",o.style.textAlignVertical="auto",o.props.numberOfLines=0,o.style._textColor=void 0,o}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"measure",value:function(e,t,i,r){var n=this.getText(this.style._textColor||4294967295);if(n){if(t!==d.MEASURE_MODE_EXACTLY||r!==d.MEASURE_MODE_EXACTLY){var s=void 0;s=t!==d.MEASURE_MODE_UNDEFINED?a.wrapLines(this.guiSys.font,n,this._fontSize,e,void 0,this.props._numberOfLines):n;var l=a.measureText(this.guiSys.font,s,this._fontSize);t!==d.MEASURE_MODE_EXACTLY&&(e=l.maxWidth),r!==d.MEASURE_MODE_EXACTLY&&(i=l.maxHeight);var u=this._fontSize/100;e=o(e,u),i=o(i,u)}}else e=e||0,i=i||0;return{width:e,height:i}}},{key:"addChild",value:function(e,t){this.makeDirty(),this.textChildren.splice(e,0,t)}},{key:"removeChild",value:function(e){this.makeDirty(),this.textChildren.splice(e,1)}},{key:"getText",value:function(e){if(!this._textDirty)return this._text;for(var t=this.style._textColor?this.style._textColor:e,i="",r=0;r<this.textChildren.length;r++){var o=this.textChildren[r];o.isRawText&&o.props.text&&o.props.text.length?i+=String.fromCharCode(a.SDFFONT_MARKER_COLOR)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>0&255)+String.fromCharCode(t>>24&255)+o.props.text:o.isTextNode&&(i+=o.getText(t))}return this._text=i,this._textDirty=!1,this._visualTextDirty=!0,this._text}},{key:"presentLayout",value:function(){babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"presentLayout",this).call(this);var e=this.YGNode.getBorder(d.EDGE_LEFT);if(this.view.setBorderWidth(Number.isNaN(e)?0:e),this._textDirty||this._visualTextDirty||this.YGNode.getComputedWidth()!==this.previousWidth||this.YGNode.getComputedHeight()!==this.previousHeight){var i=a.wrapLines(this.guiSys.font,this.getText(this.style._textColor||4294967295),this._fontSize,this.YGNode.getComputedWidth(),this.YGNode.getComputedHeight(),this.props._lineCount,this._isOnLayer);this.view.setText(i),this._visualTextDirty=!1,this.previousWidth=this.YGNode.getComputedWidth(),this.previousHeight=this.YGNode.getComputedHeight()}}},{key:"markTextDirty",value:function(){this.YGNode.markDirty(),this._textDirty=!0}}],[{key:"describe",value:function(){return(0,p.default)(babelHelpers.get(t.__proto__||Object.getPrototypeOf(t),"describe",this).call(this),{NativeProps:{numberOfLines:"number",hitSlop:"number",isOnLayer:"number"}})}}]),t}(s.default);r.default=b},94);
__d(function(e,t,r,i){Object.defineProperty(i,"__esModule",{value:!0});var a=t(64),l=babelHelpers.interopRequireDefault(a),s=t(54),n=babelHelpers.interopRequireDefault(s),o=function(e){function t(e){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.isRawText=!0,Object.defineProperty(r.props,"text",{set:function(e){r._text=e||"",r._textDirty=!0,r.markTextDirty()},get:function(){return r._text}}),r}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"markTextDirty",value:function(){for(var e=this.getParent();e;)e.isDirty=!0,e.markTextDirty&&e.markTextDirty(),e=e.getParent()}}],[{key:"describe",value:function(){return(0,n.default)(babelHelpers.get(t.__proto__||Object.getPrototypeOf(t),"describe",this).call(this),{NativeProps:{text:"string"}})}}]),t}(l.default);i.default=o},95);
__d(function(e,t,r,o){Object.defineProperty(o,"__esModule",{value:!0});var l=t(35),s=babelHelpers.interopRequireWildcard(l),i=t(56),a=babelHelpers.interopRequireDefault(i),n=t(54),u=babelHelpers.interopRequireDefault(n),p=t(97),c=babelHelpers.interopRequireDefault(p),b=t(78),d=t(64),y=babelHelpers.interopRequireDefault(d),f=1,v=2,_=3,P=function(e){function t(e,r){babelHelpers.classCallCheck(this,t);var o=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return o.view=new a.default(e),o._localResource=new b.RCTBindedResource(r.RCTResourceManager),o._videoModule=r.VideoModule,o._rnctx=r,o.player=new c.default(r,o.view.uuid),o.player.onUpdateTexture=function(e){var t=function(e,t){var r=function(){return t(void 0)},o=void 0;if(null==e)r();else{var l=new s.TextureLoader;l.setCrossOrigin("Access-Control-Allow-Origin"),l.load(e,t,o,r)}},r=function(t){e===o._currentSource&&(t&&"MonoTextureInfo"===t.type?o.view.setImageTexture(t.texture):t?o.view.setImageTexture(t):o.view.setImageTexture(void 0))};o._currentSource=e,e&&e.uri?o._localResource.isValidUrl(e.uri)?o._localResource.load(e.uri,r):t(e.uri,r):(o._localResource.unregister(),r(void 0))},o.player.onEmitEvent=function(e,t){o._rnctx.callFunction("RCTEventEmitter","receiveEvent",[o.getTag(),e,t])},Object.defineProperty(o.props,"source",{set:function(e){o.player.setSource(e)}}),Object.defineProperty(o.props,"poster",{set:function(e){var t=e?e.uri:null;t?o.player.setPoster(e):o.player.setPoster(null)}}),Object.defineProperty(o.props,"playControl",{set:function(e){o.player.setPlayControl(e)}}),Object.defineProperty(o.props,"autoPlay",{set:function(e){o.player.setAutoPlay(e)}}),Object.defineProperty(o.props,"loop",{set:function(e){o.player.setLoop(e)}}),Object.defineProperty(o.props,"muted",{set:function(e){o.player.setMuted(e)}}),Object.defineProperty(o.props,"volume",{set:function(e){o.player.setVolume(e)}}),Object.defineProperty(o.style,"tintColor",{set:function(e){o.view.setImageColor(e)}}),o}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"dispose",value:function(){this._localResource&&this._localResource.dispose(),this.player.dispose(),babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"dispose",this).call(this)}},{key:"receiveCommand",value:function(e,r){switch(babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"receiveCommand",this).call(this,e,r),e){case f:var o=r?r[0]:0;this.player.seekTo(o);break;case v:this.player.play();break;case _:this.player.pause()}}}],[{key:"describe",value:function(){return(0,u.default)(babelHelpers.get(t.__proto__||Object.getPrototypeOf(t),"describe",this).call(this),{NativeProps:{autoPlay:"boolean",loop:"boolean",muted:"boolean",playControl:"string",volume:"number",source:"object",poster:"object"},Commands:{seekTo:f,play:v,pause:_}})}}]),t}(y.default);o.default=P},96);
__d(function(t,e,i,s){function n(t,e){this._rnctx=t,this._videoModule=t.VideoModule,this._tag=e,this._counter=0,this._handle=null,this._PlayStatus="closed",this._source=null,this._poster=null,this._playControl=null,this._autoPlay=!1,this._loop=!1,this._muted=null,this._volume=1,this.onUpdateTexture=void 0,this.onEmitEvent=void 0,this._onCanPlay=this._onCanPlay.bind(this),this._onPlaying=this._onPlaying.bind(this),this._onPause=this._onPause.bind(this),this._onEnded=this._onEnded.bind(this),this._onError=this._onError.bind(this),this._onDurationChange=this._onDurationChange.bind(this),this._onTimeUpdate=this._onTimeUpdate.bind(this)}Object.defineProperty(s,"__esModule",{value:!0}),s.default=n;var o=e(39),a=babelHelpers.interopRequireDefault(o);n.prototype=babelHelpers.extends(Object.create(Object.prototype),{constructor:n,_updateTexture:function(){var t=this._handle?babelHelpers.extends({},this._source,{uri:"MonoTexture://"+this._handle}):null;this.onUpdateTexture&&this.onUpdateTexture(t)},_updateTextureWithPoster:function(){this.onUpdateTexture&&this.onUpdateTexture(this._poster)},_onCanPlay:function(t,e){t===this._handle&&(this._poster||this._updateTexture(),this._updatePlayStatus("ready"),(this._autoPlay&&"pause"!==this._playControl||"play"===this._playControl)&&this._videoModule.play(t))},_onPlaying:function(){this._updatePlayStatus("playing"),this._updateTexture()},_onPause:function(){this._updatePlayStatus("paused")},_onEnded:function(t,e){t===this._handle&&(this._updatePlayStatus("ended"),this._loop&&"pause"!==this._playControl&&this._videoModule.play(t),this._emitEvent("topEnded",[]))},_onError:function(t,e){t===this._handle&&this._updatePlayStatus("error")},_onDurationChange:function(t,e){if(t===this._handle){var i=e.target&&e.target.duration;i&&this._emitEvent("topDurationChange",{duration:i})}},_onTimeUpdate:function(t,e){if(t===this._handle){var i=e.target&&e.target.currentTime;i&&this._emitEvent("topTimeUpdate",{currentTime:i})}},_chooseSupportSource:function(t){if(Array.isArray(t)){for(var e=0;e<t.length;e++){var i=t[e];if(i&&"object"==typeof i&&"uri"in i){if(!("format"in i))return i;if((0,a.default)().indexOf(i.format)>-1)return i}}return null}return t?t:null},setSource:function(t){var e=this._chooseSupportSource(t),i=this._source?this._source.uri:null,s=e?e.uri:null,n=e?e.format:null;if(this._source=e,i!==s){if(s){var o=this._handle;this._counter+=1,this._handle=[s,this._tag,this._counter].join("-"),this._videoModule.addHandle(this._handle),this._videoModule.setUrl(this._handle,s),this._videoModule.setFormat(this._handle,n),this._source.metaData&&this._videoModule.setMetaData(this._handle,this._source.metaData),this._videoModule._addMediaEventListener(this._handle,"canplay",this._onCanPlay),this._videoModule._addMediaEventListener(this._handle,"playing",this._onPlaying),this._videoModule._addMediaEventListener(this._handle,"pause",this._onPause),this._videoModule._addMediaEventListener(this._handle,"ended",this._onEnded),this._videoModule._addMediaEventListener(this._handle,"error",this._onError),this._videoModule._addMediaEventListener(this._handle,"durationchange",this._onDurationChange),this._videoModule._addMediaEventListener(this._handle,"timeupdate",this._onTimeUpdate),this._videoModule.load(this._handle),o&&this._videoModule.unload(o),this._updatePlayStatus("loading"),this._poster&&this._updateTextureWithPoster()}else{var a=this._handle;this._handle=null,a&&(this._updateTexture(),this._videoModule.unload(a)),this._updatePlayStatus("closed")}this._updateVideoStates()}},setPoster:function(t){this._poster=t,"loading"===this._PlayStatus&&this._poster&&this._updateTextureWithPoster()},_emitEvent:function(t,e){this.onEmitEvent&&this.onEmitEvent(t,e)},_updatePlayStatus:function(t){this._PlayStatus!==t&&(this._PlayStatus=t,this._emitEvent("topPlayStatusChange",{playStatus:this._PlayStatus}))},_updateVideoStates:function(){this._handle&&(this._videoModule.setMuted(this._handle,this._muted),this._videoModule.setVolume(this._handle,this._volume))},play:function(){this._handle&&this._videoModule.play(this._handle)},pause:function(){this._handle&&this._videoModule.pause(this._handle)},seekTo:function(t){this._videoModule.seekTo(this._handle,t)},setPlayControl:function(t){this._playControl=t,this._handle&&("pause"===this._playControl?this._videoModule.pause(this._handle):"play"===this._playControl&&this._videoModule.play(this._handle))},setAutoPlay:function(t){this._autoPlay=t},setLoop:function(t){this._loop=t},setMuted:function(t){this._muted=t,this._handle&&this._videoModule.setMuted(this._handle,this._muted)},setVolume:function(t){t="number"==typeof t?t:1,this._volume=t,this._handle&&this._videoModule.setVolume(this._handle,this._volume)},dispose:function(){this._handle&&this._videoModule.unload(this._handle)}})},97);
__d(function(e,t,o,r){Object.defineProperty(r,"__esModule",{value:!0});var l=t(71),p=babelHelpers.interopRequireDefault(l),s=t(54),a=babelHelpers.interopRequireDefault(s),n=t(97),i=babelHelpers.interopRequireDefault(n),u=1,c=2,b=3,y=function(e){function t(e,o){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,o));return r._rnctx=o,r.player=new i.default(o,r.view.uuid),r.player.onUpdateTexture=function(e){babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setSource",r).call(r,e)},r.player.onEmitEvent=function(e,t){r._rnctx.callFunction("RCTEventEmitter","receiveEvent",[r.getTag(),e,t])},Object.defineProperty(r.props,"poster",{set:function(e){var t=e?e.uri:null;t?r.player.setPoster(e):r.player.setPoster(null)}}),Object.defineProperty(r.props,"playControl",{set:function(e){r.player.setPlayControl(e)}}),Object.defineProperty(r.props,"autoPlay",{set:function(e){r.player.setAutoPlay(e)}}),Object.defineProperty(r.props,"loop",{set:function(e){r.player.setLoop(e)}}),Object.defineProperty(r.props,"muted",{set:function(e){r.player.setMuted(e)}}),Object.defineProperty(r.props,"volume",{set:function(e){r.player.setVolume(e)}}),r}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"receiveCommand",value:function(e,o){switch(babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"receiveCommand",this).call(this,e,o),e){case u:var r=o?o[0]:0;this.player.seekTo(r);break;case c:this.player.play();break;case b:this.player.pause()}}},{key:"setSource",value:function(e){this.player.setSource(e)}},{key:"dispose",value:function(){this.player.dispose(),babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"dispose",this).call(this)}}],[{key:"describe",value:function(){return(0,a.default)(babelHelpers.get(t.__proto__||Object.getPrototypeOf(t),"describe",this).call(this),{NativeProps:{autoPlay:"boolean",loop:"boolean",muted:"boolean",playControl:"string",volume:"number",source:"object",poster:"object"},Commands:{seekTo:u,play:c,pause:b}})}}]),t}(p.default);r.default=y},98);
__d(function(e,t,r,l){Object.defineProperty(l,"__esModule",{value:!0});var i=t(35),n=babelHelpers.interopRequireWildcard(i),s=t(56),o=babelHelpers.interopRequireDefault(s),a=t(54),b=babelHelpers.interopRequireDefault(a),u=t(64),p=babelHelpers.interopRequireDefault(u),c=function(e){function t(e){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),l=new n.AmbientLight;return r.view=new o.default(e),r.view.add(l),Object.defineProperty(r.props,"intensity",{set:function(e){l.intensity=e}}),Object.defineProperty(r.style,"color",{set:function(e){l.color.set(e)}}),r.props.intensity=1,r}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,null,[{key:"describe",value:function(){return(0,b.default)(babelHelpers.get(t.__proto__||Object.getPrototypeOf(t),"describe",this).call(this),{NativeProps:{intensity:"number"}})}}]),t}(p.default);l.default=c},99);
__d(function(e,t,r,i){Object.defineProperty(i,"__esModule",{value:!0});var l=t(35),n=babelHelpers.interopRequireWildcard(l),s=t(56),o=babelHelpers.interopRequireDefault(s),a=t(54),b=babelHelpers.interopRequireDefault(a),p=t(64),u=babelHelpers.interopRequireDefault(p),c=function(e){function t(e){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),i=new n.PointLight;return i.decay=0,i.position.set(0,1e3,0),r.view=new o.default(e),r.view.add(i),Object.defineProperty(r.props,"intensity",{set:function(e){i.intensity=e}}),Object.defineProperty(r.style,"color",{set:function(e){i.color.set(e)}}),r.props.intensity=1,r}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,null,[{key:"describe",value:function(){return(0,b.default)(babelHelpers.get(t.__proto__||Object.getPrototypeOf(t),"describe",this).call(this),{NativeProps:{intensity:"number"}})}}]),t}(u.default);i.default=c},100);
__d(function(e,t,r,n){Object.defineProperty(n,"__esModule",{value:!0});var i=t(35),s=babelHelpers.interopRequireWildcard(i),l=t(56),o=babelHelpers.interopRequireDefault(l),a=t(54),p=babelHelpers.interopRequireDefault(a),c=t(64),b=babelHelpers.interopRequireDefault(c),u=function(e){function t(e){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),n=new s.PointLight;return r.view=new o.default(e),r.view.add(n),Object.defineProperty(r.props,"intensity",{set:function(e){n.intensity=e}}),Object.defineProperty(r.props,"distance",{set:function(e){n.distance=e}}),Object.defineProperty(r.props,"decay",{set:function(e){n.decay=e}}),Object.defineProperty(r.style,"color",{set:function(e){n.color.set(e)}}),r.props.intensity=1,r.props.distance=0,r.props.decay=1,r}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,null,[{key:"describe",value:function(){return(0,p.default)(babelHelpers.get(t.__proto__||Object.getPrototypeOf(t),"describe",this).call(this),{NativeProps:{intensity:"number",distance:"number",decay:"number"}})}}]),t}(b.default);n.default=u},101);
__d(function(e,t,r,n){Object.defineProperty(n,"__esModule",{value:!0});var i=t(35),s=babelHelpers.interopRequireWildcard(i),p=t(56),a=babelHelpers.interopRequireDefault(p),o=t(54),l=babelHelpers.interopRequireDefault(o),b=t(64),u=babelHelpers.interopRequireDefault(b),c=function(e){function t(e){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),n=new s.SpotLight;return r.view=new a.default(e),r.view.add(n),Object.defineProperty(r.props,"intensity",{set:function(e){n.intensity=e}}),Object.defineProperty(r.props,"distance",{set:function(e){n.distance=e}}),Object.defineProperty(r.props,"decay",{set:function(e){n.decay=e}}),Object.defineProperty(r.props,"angle",{set:function(e){n.angle=e*Math.PI/180}}),Object.defineProperty(r.props,"penumbra",{set:function(e){n.penumbra=Math.min(Math.max(e,0),100)/100}}),Object.defineProperty(r.style,"color",{set:function(e){n.color.set(e)}}),r.props.intensity=1,r.props.distance=0,r.props.decay=1,r.props.angle=180,r.props.penumbra=0,r}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,null,[{key:"describe",value:function(){return(0,l.default)(babelHelpers.get(t.__proto__||Object.getPrototypeOf(t),"describe",this).call(this),{NativeProps:{intensity:"number",distance:"number",decay:"number",angle:"number",penumbra:"number"}})}}]),t}(u.default);n.default=c},102);
__d(function(e,t,r,i){Object.defineProperty(i,"__esModule",{value:!0});var s=t(104),l=babelHelpers.interopRequireDefault(s),a=t(56),o=babelHelpers.interopRequireDefault(a),n=t(54),c=babelHelpers.interopRequireDefault(n),u=t(62),f=babelHelpers.interopRequireWildcard(u),p=t(64),d=babelHelpers.interopRequireDefault(p),b=function(e){function t(e){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.surface=new l.default(0,0,s.SurfaceShape.Cylinder),r.guiSys=e,r.view=new o.default(e),r.view.add(r.surface._mesh),Object.defineProperty(r.style,"opacity",{configurable:!0,set:function(e){r.surface.setOpacity(e)}}),Object.defineProperty(r.props,"layer",{set:function(e){var t=e.radius||3;r.view.zOffset=t,r.surface.resize(e.width,e.height),r.guiSys.unregisterOffscreenRender(r.offscreenUID),r.offscreenUID=r.guiSys.registerOffscreenRender(r.surface.getScene(),r.surface.getCamera(),r.surface.getRenderTarget())}}),r}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"addChild",value:function(e,t){this.children.splice(e,0,t),this.YGNode.insertChild(t.YGNode,e),this.surface.getScene().add(t.view)}},{key:"removeChild",value:function(e){this.surface.getScene().remove(this.children[e].view),this.YGNode.removeChild(this.YGNode.getChild(e)),this.children.splice(e,1)}},{key:"presentLayout",value:function(){babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"presentLayout",this).call(this),this.surface.setVisibility(this.YGNode.getDisplay()!==f.DISPLAY_NONE)}},{key:"dispose",value:function(){this.guiSys.unregisterOffscreenRender(this.offscreenUID),babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"dispose",this).call(this)}}],[{key:"describe",value:function(){return(0,c.default)(babelHelpers.get(t.__proto__||Object.getPrototypeOf(t),"describe",this).call(this),{NativeProps:{layer:"object"}})}}]),t}(d.default);i.default=b},103);
__d(function(e,t,i,s){Object.defineProperty(s,"__esModule",{value:!0}),s.SurfaceShape=void 0;var a=t(35),r=babelHelpers.interopRequireWildcard(a),h=s.SurfaceShape={Cylinder:"Cylinder",Flat:"Flat"},n=4680,_=4,o=function(){function e(t,i){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h.Cylinder;babelHelpers.classCallCheck(this,e),this._width=t,this._height=i,this._density=n,this._radius=_,this._shape=s,this._yaw=0,this._pitch=0,this._material=new r.MeshBasicMaterial({wireframe:!1,transparent:!0,premultipliedAlpha:!0,color:"white",side:r.DoubleSide,depthWrite:!1,blending:r.CustomBlending,blendSrc:r.OneFactor,blendDst:r.OneMinusSrcAlphaFactor,blendEquation:r.AddEquation,blendSrcAlpha:r.OneFactor,blendDstAlpha:r.OneMinusSrcAlphaFactor,blendEquationAlpha:r.AddEquation}),this._camera=new r.OrthographicCamera,this._subScene=new r.Scene,this._subScene.scale.y=-1,this._renderTarget=new r.WebGLRenderTarget(t,i,{minFilter:r.LinearFilter,magFilter:r.LinearFilter,format:r.RGBAFormat}),this._material.map=this._renderTarget.texture,this._regenerateGeometry(),this._mesh=new r.Mesh(this._geometry,this._material),this._mesh.subScene=this._subScene,this._mesh.subSceneCamera=this._camera,this._mesh.scale.z=-1,this.resize(t,i)}return babelHelpers.createClass(e,[{key:"setDensity",value:function(e){if(e<0)throw new Error("Surface density cannot be negative");this._density=e,this._regenerateGeometry()}},{key:"setRadius",value:function(e){if(e<0)throw new Error("Surface radius cannot be negative");this._radius=e,this._shape===h.Cylinder?this._regenerateGeometry():this._shape===h.Flat&&this._recomputeOrientation()}},{key:"setShape",value:function(e){this._shape!==e&&(this._shape=e,this._regenerateGeometry(),this._recomputeOrientation())}},{key:"setAngle",value:function(e,t){this._yaw=e,this._pitch=t,this._recomputeOrientation()}},{key:"setOpacity",value:function(e){if(e<0||e>1)throw new Error("Surface opacity must be between 0.0 and 1.0");this._material.opacity=e}},{key:"setVisibility",value:function(e){this._mesh.visible=e}},{key:"getWidth",value:function(){return this._width}},{key:"getHeight",value:function(){return this._height}},{key:"getScene",value:function(){return this._subScene}},{key:"getCamera",value:function(){return this._camera}},{key:"getRenderTarget",value:function(){return this._renderTarget}},{key:"getNode",value:function(){return this._mesh}},{key:"resize",value:function(e,t){this._width=e,this._height=t,this._renderTarget.setSize(e,t),this._material.needsUpdate=!0,this._camera.left=0,this._camera.right=e,this._camera.top=0,this._camera.bottom=t,this._camera.near=-1e3,this._camera.far=1e3,this._camera.setViewOffset(e,t,0,0,e,t),this._camera.updateProjectionMatrix(),this._subScene._rttWidth=e,this._subScene._rttHeight=t,this._regenerateGeometry()}},{key:"_regenerateGeometry",value:function(){this._geometry&&this._geometry.dispose(),this._shape===h.Cylinder?this._geometry=e.createCylinderGeometry(this._width,this._height,this._density,this._radius):this._shape===h.Flat&&(this._geometry=e.createFlatGeometry(this._width,this._height,this._density,this._radius)),this._mesh&&(this._mesh.geometry=this._geometry,this._mesh.needsUpdate=!0)}},{key:"_recomputeOrientation",value:function(){if(this._shape===h.Cylinder)this._mesh&&(this._mesh.quaternion.set(0,0,0,1),this._mesh.position.set(0,0,0));else if(this._shape===h.Flat){var e=Math.cos(this._pitch)*this._radius,t=Math.sin(this._pitch)*this._radius,i=Math.sin(this._yaw)*e;e*=Math.cos(this._yaw),this._mesh.position.set(i,t,-e);var s=Math.sin(this._pitch/2),a=Math.cos(this._pitch/2),r=Math.sin(-this._yaw/2),n=Math.cos(-this._yaw/2);this._mesh.quaternion.set(n*s,r*a,-r*s,n*a)}}}],[{key:"createCylinderGeometry",value:function(e,t,i,s){var a=2*Math.PI*e/i,h=s*Math.PI*t/i;return new r.CylinderGeometry(s,s,2*h,60,6,!0,.5*-a,a)}},{key:"createFlatGeometry",value:function(e,t,i,s){var a=s*Math.PI*e/i,h=s*Math.PI*t/i;return new r.PlaneGeometry(2*a,2*h,1,1)}}]),e}();o.SurfaceShape=h,s.default=o},104);
__d(function(e,t,r,i){Object.defineProperty(i,"__esModule",{value:!0});var s=t(35),a=babelHelpers.interopRequireWildcard(s),l=t(56),n=babelHelpers.interopRequireDefault(l),p=t(54),o=babelHelpers.interopRequireDefault(p),h=t(62),c=babelHelpers.interopRequireWildcard(h),d=t(64),u=babelHelpers.interopRequireDefault(d),y=function(e){function t(e){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));r.material=new a.MeshBasicMaterial({wireframe:!1,transparent:!0,premultipliedAlpha:!0,color:"white",side:a.DoubleSide,depthWrite:!1,blending:a.CustomBlending,blendSrc:a.OneFactor,blendDst:a.OneMinusSrcAlphaFactor,blendEquation:a.AddEquation,blendSrcAlpha:a.OneFactor,blendDstAlpha:a.OneMinusSrcAlphaFactor,blendEquationAlpha:a.AddEquation}),r.guiSys=e,r.camera=new a.OrthographicCamera,r.subScene=new a.Scene;var i=new a.PlaneGeometry(1,1,1,1);return r.plane=new a.Mesh(i,r.material),r.plane.subScene=r.subScene,r.plane.subSceneCamera=r.camera,r.plane.scale.z=-1,r.view=new n.default(e),r.view.add(r.plane),r.subScene.scale.y=-1,r.isLayer=!0,Object.defineProperty(r.style,"opacity",{configurable:!0,set:function(e){r.material.opacity=e}}),Object.defineProperty(r.props,"layer",{set:function(e){r.props._layerWidth=e.width,r.props._layerHeight=e.height,r.props._layerDensity=e.density,r.props._layerDistance=e.distance||4,r.subScene._rttWidth=e.width,r.subScene._rttHeight=e.height,r.plane.geometry.dispose();var t=r.props._layerDistance*(Math.PI*e.width/r.props._layerDensity),i=r.props._layerDistance*(Math.PI*e.height/r.props._layerDensity);r.plane.geometry=new a.PlaneGeometry(2*t,2*i,1,1),r.plane.needsUpdate=!0,r._createRTT()}}),r}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"_createRTT",value:function(){this.props._layerWidth>0&&this.props._layerHeight>0&&(this.rtt?this.rtt.setSize(this.props._layerWidth,this.props._layerHeight):this.rtt=new a.WebGLRenderTarget(this.props._layerWidth,this.props._layerHeight,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat}),this.material.map=this.rtt.texture,this.material.needsUpdate=!0,this.camera=new a.OrthographicCamera(0,this.props._layerWidth,0,this.props._layerHeight,-1e3,1e3),this.camera.setViewOffset(this.props._layerWidth,this.props._layerHeight,0,0,this.props._layerWidth,this.props._layerHeight),this.plane.subSceneCamera=this.camera,this.guiSys.unregisterOffscreenRender(this.offscreenUID),this.offscreenUID=this.guiSys.registerOffscreenRender(this.subScene,this.camera,this.rtt))}},{key:"addChild",value:function(e,t){this.children.splice(e,0,t),this.YGNode.insertChild(t.YGNode,e),this.subScene.add(t.view)}},{key:"removeChild",value:function(e){this.subScene.remove(this.children[e].view),this.YGNode.removeChild(this.YGNode.getChild(e)),this.children.splice(e,1)}},{key:"presentLayout",value:function(){babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"presentLayout",this).call(this),this.plane.visible=this.YGNode.getDisplay()!==c.DISPLAY_NONE}},{key:"dispose",value:function(){this.guiSys.unregisterOffscreenRender(this.offscreenUID),babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"dispose",this).call(this)}}],[{key:"describe",value:function(){return(0,o.default)(babelHelpers.get(t.__proto__||Object.getPrototypeOf(t),"describe",this).call(this),{NativeProps:{layer:"object"}})}}]),t}(u.default);i.default=y},105);
__d(function(e,t,n,r){Object.defineProperty(r,"__esModule",{value:!0});var o=t(19),i=babelHelpers.interopRequireDefault(o),s=function(e){function t(e){babelHelpers.classCallCheck(this,t);var n=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"WebSocketModule"));return n._sockets={},n._rnctx=e,n}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"connect",value:function(e,t,n,r){var o=this,i=t?new WebSocket(e,t):new WebSocket(e);i.binaryType="arraybuffer",this._sockets[String(r)]=i,i.onclose=function(e){var t={id:r,code:e.code,reason:e.reason};o._rnctx.callFunction("RCTDeviceEventEmitter","emit",["websocketClosed",t])},i.onerror=function(e){var t={id:r,message:"Native WebSocket error"};o._rnctx.callFunction("RCTDeviceEventEmitter","emit",["websocketFailed",t])},i.onmessage=function(e){var t=e.data;if(t instanceof ArrayBuffer){for(var n=new Uint8Array(t),i=new Array(n.byteLength),s=0;s<i.length;s++)i[s]=String.fromCharCode(n[s]);t=btoa(i.join(""))}var a={id:r,type:"string"==typeof e.data?"string":"binary",data:t};o._rnctx.callFunction("RCTDeviceEventEmitter","emit",["websocketMessage",a])},i.onopen=function(e){var t={id:r};o._rnctx.callFunction("RCTDeviceEventEmitter","emit",["websocketOpen",t])}}},{key:"_send",value:function(e,t){var n=this._sockets[String(t)];if(!n)throw new Error("Error while sending data to WebSocket: no such socket");n.send(e)}},{key:"send",value:function(e,t){this._send(e,t)}},{key:"sendBinary",value:function(e,t){for(var n=atob(e),r=new Uint8Array(n.length),o=0;o<n.length;o++)r[o]=255&n.charCodeAt(o);this._send(r.buffer,t)}},{key:"ping",value:function(e){throw new Error("Cannot send a ping. Browser WebSocket APIs are not capable of sending specific opcodes")}},{key:"close",value:function(e,t,n){var r=void 0;if("undefined"!=typeof t&&"undefined"!=typeof n){r=String(n);var o=this._sockets[r];if(!o)return;o.close(e,t)}else{r=String(e);var i=this._sockets[r];if(!i)return;i.close()}delete this._sockets[r]}}]),t}(i.default);r.default=s},106);
__d(function(e,t,r,n){Object.defineProperty(n,"__esModule",{value:!0});var a=t(19),o=babelHelpers.interopRequireDefault(a),i=function(e){function t(){babelHelpers.classCallCheck(this,t);var e=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"ReactVRConstants"));return e.Version="0.1.0",e.Runtime="WebVR",e.RuntimeVersion=e.Version,e.userAgent=navigator&&navigator.userAgent,e.platform=navigator&&navigator.platform,e}return babelHelpers.inherits(t,e),t}(o.default);n.default=i},107);
__d(function(e,a,t,i){Object.defineProperty(i,"__esModule",{value:!0});var n=a(19),s=babelHelpers.interopRequireDefault(n),l=function(e){function a(){babelHelpers.classCallCheck(this,a);var e=babelHelpers.possibleConstructorReturn(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,"RCTExceptionsManager"));return e.hadFatal=void 0,e}return babelHelpers.inherits(a,e),babelHelpers.createClass(a,[{key:"displayStackAndMessage",value:function(e,a){var t="\n";if(a.indexOf("has not been registered")===-1||a.indexOf("AppRegistry.registerComponent")===-1){t+="-----\n";for(var i=0;i<e.length;i++){var n=e[i].file||"[unknown]",s=e[i].methodName||"[unknown]",l=e[i].lineNumber||0,r=e[i].column||0;t+="> "+s+"@"+n+" "+l+":"+r+"\n"}t+="-----\n"}t+=a||"",console.error(t)}},{key:"reportSoftException",value:function(e,a,t){if(!this.hadFatal){var i=a.slice();i.reverse(),this.displayStackAndMessage(i,e)}}},{key:"reportFatalException",value:function(e,a,t){if(!this.hadFatal){var i=a.slice();i.reverse(),this.displayStackAndMessage(i,e),this.hadFatal=t}}},{key:"updateExceptionMessage",value:function(e,a,t){if(!this.hadFatal||this.hadFatal===t){var i=a.slice();i.reverse();for(var n=0;n<i.length;n++)i[n].file&&i[n].file.indexOf(":")<=2&&(i[n].file="file:///"+i[n].file);this.displayStackAndMessage(i,e)}}},{key:"reportUnhandledException",value:function(e,a){if(!this.hadFatal){var t=a.slice();t.reverse(),this.displayStackAndMessage(t,e)}}}]),a}(s.default);i.default=l},108);
__d(function(e,t,o,l){Object.defineProperty(l,"__esModule",{value:!0});var a=t(19),r=babelHelpers.interopRequireDefault(a),c=function(e){function t(e){babelHelpers.classCallCheck(this,t);var o=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"RCTSourceCode"));o._rnctx=e,o.scriptURL=location.protocol+"//"+location.host;var l=location.pathname&&location.pathname.match(/^.*\//),a=l?l[0]:null;return o.scriptURL+=a?a:"/",o}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"getScriptText",value:function(e,t){this._rnctx.invokeCallback(e,[{fullSourceMappingURL:location.protocol+"//"+location.host+"/"}])}}]),t}(r.default);l.default=c},109);
__d(function(t,i,o,s){Object.defineProperty(s,"__esModule",{value:!0}),i(111);var e=function(){function t(i,o){babelHelpers.classCallCheck(this,t),i?this.worldPosition=[i[0],i[1],i[2]]:this.worldPosition=[0,0,0],o?this.worldRotation=[o[0],o[1],o[2],o[3]]:this.worldRotation=[0,0,0,1]}return babelHelpers.createClass(t,[{key:"setWorldPosition",value:function(t,i,o){this.worldPosition[0]=t,this.worldPosition[1]=i,this.worldPosition[2]=o,this._dirty=!0}},{key:"setWorldRotation",value:function(t,i,o,s){this.worldRotation[0]=t,this.worldRotation[1]=i,this.worldRotation[2]=o,this.worldRotation[3]=s,this._dirty=!0}},{key:"isDirty",value:function(){return this._dirty}},{key:"clearDirtyFlag",value:function(){this._dirty=!1}}]),t}();s.default=e},110);
__d(function(n,_,c,d){},111);
__d(function(e,t,i,a){Object.defineProperty(a,"__esModule",{value:!0});var s=t(35),r=babelHelpers.interopRequireWildcard(s),n=t(13),o=babelHelpers.interopRequireDefault(n),h=t(113),l=babelHelpers.interopRequireDefault(h),u=t(110),c=babelHelpers.interopRequireDefault(u),f=t(120),m=babelHelpers.interopRequireDefault(f),d=t(122),_=babelHelpers.interopRequireDefault(d),p=t(123),v=babelHelpers.interopRequireDefault(p),y=t(125),g=babelHelpers.interopRequireDefault(y),b=t(126),R=babelHelpers.interopRequireDefault(b),D=t(128),w=babelHelpers.interopRequireDefault(D),C=t(131),S=babelHelpers.interopRequireDefault(C),H=t(132),q=babelHelpers.interopRequireDefault(H),F=t(133),P=babelHelpers.interopRequireDefault(F),x=t(134),L=babelHelpers.interopRequireDefault(x);t(129),t(111);var k=t(135),V=babelHelpers.interopRequireDefault(k),Q=t(136),z=babelHelpers.interopRequireDefault(Q),A=t(137),E=babelHelpers.interopRequireDefault(A),M=t(138),W=babelHelpers.interopRequireDefault(M),T=t(141),B=babelHelpers.interopRequireDefault(T),O=t(142),j=babelHelpers.interopRequireDefault(O),N=t(144),U=babelHelpers.interopRequireDefault(N),G=t(127),I=function(){function e(t,i){var a=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};babelHelpers.classCallCheck(this,e),this.enterVR=this.enterVR.bind(this),this.frame=this.frame.bind(this),this._onResize=this._onResize.bind(this),this._appearanceStateStack=[],this._cameraPosition=[0,0,0],this._cameraQuat=[0,0,0,1],this._events=[],this._needsResize=!1,this._parent=i,this._rays=[],this._frameData=null,"VRFrameData"in window&&(this._frameData=new VRFrameData),this._looping=!1,this._nextFrame=null,this._lastFrameTime=0,this._focused2DSurface=null,s.fullScreen&&(i.style.position="fixed",i.style.top="0",i.style.left="0",i.style.margin="0",i.style.padding="0",i.style.width="100%",i.style.height=window.innerHeight+"px",window.addEventListener("resize",this._onResize)),this._eventLayer=document.createElement("div"),this._eventLayer.style.width=i.clientWidth+"px",this._eventLayer.style.height=i.clientHeight+"px",i.appendChild(this._eventLayer),this.scene=new r.Scene,this.controls=new w.default,this.overlay=s.customOverlay||new m.default(i),this.compositor=new l.default(this._eventLayer,this.scene);var n=s.assetRoot||"static_assets/";n.endsWith("/")||(n+="/"),this._assetRoot=n;var h={assetRoot:n,customViews:s.customViews||[],executor:s.executor,nativeModules:[new B.default(this.compositor.getEnvironment()),function(e){var t=new W.default(e);return a._audioModule=t,t},function(e){var t=new j.default(a.compositor.getVideoPlayerManager());return a._videoModule=t,t}].concat(babelHelpers.toConsumableArray(s.nativeModules||[]))};this.runtime=new U.default(this.scene,(0,o.default)(t),h),this.vrState=new _.default,this.vrState.onDisplayChange(function(e){e?a.overlay.setVRButtonState(!0,"View in VR",a.enterVR):a.overlay.setVRButtonState(!1,"No Headset",null)}),this.controls.addCameraController(new R.default(this._eventLayer)),this.controls.addCameraController(new v.default(this._eventLayer)),this.controls.addCameraController(new g.default(this._eventLayer)),this.controls.addEventChannel(new P.default(this._eventLayer)),this.controls.addEventChannel(new L.default(this._eventLayer)),this.controls.addEventChannel(new q.default),this.controls.addEventChannel(new S.default),this.controls.addRaycaster(new V.default),this.controls.addRaycaster(new z.default(this._eventLayer)),this.controls.addRaycaster(new E.default(this._eventLayer))}return babelHelpers.createClass(e,[{key:"_onResize",value:function(){this._needsResize=!0}},{key:"createRoot",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{name:e,initialProps:t}}},{key:"frame",value:function(e){var t=e||0;0===this._lastFrameTime&&(this._lastFrameTime=t);var i=Math.min(t-this._lastFrameTime,100);if(this._lastFrameTime=t,this._needsResize){var a=window.innerHeight,s=this._parent.clientWidth;this._parent.style.height=a+"px",this.resize(s,a),this._needsResize=!1}this._events.length=0,this._rays.length=0,this.controls.fillEvents(this._events),this.controls.fillRays(this._rays);var r=this.vrState.getCurrentDisplay(),n=this._frameData;if(this._focused2DSurface)this._cameraPosition[0]=0,this._cameraPosition[1]=0,this._cameraPosition[2]=0,this._cameraQuat[0]=0,this._cameraQuat[1]=0,this._cameraQuat[2]=0,this._cameraQuat[3]=1;else if(r&&r.isPresenting&&n){r.getFrameData(n);var o=n.pose;if(o.position){var h=o.position;this._cameraPosition[0]=h[0],this._cameraPosition[1]=h[1],this._cameraPosition[2]=h[2]}if(o.orientation){var l=o.orientation;this._cameraQuat[0]=l[0],this._cameraQuat[1]=l[1],this._cameraQuat[2]=l[2],this._cameraQuat[3]=l[3]}}else this.controls.fillCameraProperties(this._cameraPosition,this._cameraQuat);if(this._rays.length>0)for(var u=0;u<this._rays.length;u++){var c=this._rays[u];c.hasAbsoluteCoordinates||(c.origin[0]+=this._cameraPosition[0],c.origin[1]+=this._cameraPosition[1],c.origin[2]+=this._cameraPosition[2],(0,G.rotateByQuaternion)(c.direction,this._cameraQuat))}if(this._focused2DSurface?this.runtime.set2DRays(this._rays,this._focused2DSurface):this.runtime.setRays(this._rays,this._cameraPosition,this._cameraQuat),this.runtime.queueEvents(this._events),this.runtime.frame(this.compositor.getCamera(),this.compositor.getRenderer()),this._audioModule){var f=this._audioModule;f._setCameraParameters(this._cameraPosition,this._cameraQuat),f.frame(i)}this.compositor.frame(i);var m=this.compositor.getCursorVisibility();if("visible"===m||"auto"===m&&this.runtime.isCursorActive()?this.compositor.updateCursor(this._rays,this.runtime.getCursorDepth()):this.compositor.updateCursor(null,0),this.overlay.setCameraRotation(this._cameraQuat),this.compositor.setMouseCursorActive(this.runtime.isMouseCursorActive()),r&&r.isPresenting&&n){if(this.compositor.renderVR(r,n),this._looping)if(this._nextFrame){var d=this._nextFrame;d.vr=!0,d.id=r.requestAnimationFrame(this.frame)}else this._nextFrame={vr:!0,id:r.requestAnimationFrame(this.frame)}}else if(this._focused2DSurface){if(this.compositor.renderSurface(this._focused2DSurface),this._looping)if(this._nextFrame){var _=this._nextFrame;_.vr=!1,_.id=requestAnimationFrame(this.frame)}else this._nextFrame={vr:!1,id:requestAnimationFrame(this.frame)}}else if(this.compositor.render(this._cameraPosition,this._cameraQuat),this._looping)if(this._nextFrame){var p=this._nextFrame;p.vr=!1,p.id=requestAnimationFrame(this.frame)}else this._nextFrame={vr:!1,id:requestAnimationFrame(this.frame)}}},{key:"getDefaultSurface",value:function(){return this.compositor.getDefaultSurface()}},{key:"getDefaultLocation",value:function(){return this._defaultLocation||(this._defaultLocation=new c.default),this._defaultLocation}},{key:"renderToSurface",value:function(e,t){return this._looping||this.start(),this.compositor.showSurface(t),this.runtime.createRootView(e.name,e.initialProps,t)}},{key:"renderToLocation",value:function(e,t){return this._looping||this.start(),this.runtime.createRootView(e.name,e.initialProps,t)}},{key:"focusSurface",value:function(e){var t=e?this.compositor.getSurface(e):this.compositor.getDefaultSurface();if(!t)throw new Error("Cannot focus Surface "+(e||"")+", it is not registered");var i=this.compositor.getCanvas();this._appearanceStateStack.push({height:i.clientHeight,surface:this._focused2DSurface,width:i.clientWidth}),this._focused2DSurface=t,this.resize(t.getWidth(),t.getHeight()),this.overlay.hide()}},{key:"releaseSurface",value:function(){var e=this._appearanceStateStack.pop();e&&(this._focused2DSurface=e.surface,this.resize(e.width,e.height)),e&&e.surface||(this._focused2DSurface=null,this.overlay.show())}},{key:"start",value:function(){this._looping||(this._looping=!0,this.frame(0))}},{key:"stop",value:function(){this._looping=!1;var e=this._nextFrame;if(e){var t=this.vrState.getCurrentDisplay();t&&t.isPresenting?e.vr&&t.cancelAnimationFrame(e.id):e.vr||cancelAnimationFrame(e.id),this._nextFrame=null}}},{key:"enterVR",value:function(){var e=this,t=this.vrState.getCurrentDisplay();t&&!t.isPresenting&&t.requestPresent([{source:this.compositor.getCanvas()}]).then(function(){var i=t.getEyeParameters("left"),a=t.getEyeParameters("right");e.compositor.resize(i.renderWidth+a.renderWidth,Math.min(i.renderHeight,a.renderHeight),1)})}},{key:"resize",value:function(e,t){this._eventLayer.style.width=e+"px",this._eventLayer.style.height=t+"px",this.compositor.resizeCanvas(e,t)}},{key:"getAssetURL",value:function(e){return this._assetRoot+e}}]),e}();a.default=I},112);
__d(function(e,r,t,i){Object.defineProperty(i,"__esModule",{value:!0});var s=r(35),a=babelHelpers.interopRequireWildcard(s);r(111);var n=r(114),o=babelHelpers.interopRequireDefault(n),u=r(116),d=babelHelpers.interopRequireDefault(u),h=r(117),c=babelHelpers.interopRequireDefault(h),l=r(104),_=babelHelpers.interopRequireDefault(l),f=r(118),v=babelHelpers.interopRequireDefault(f),p="left",m="right",y=new a.PerspectiveCamera;y.matrixAutoUpdate=!1;var g=new a.PerspectiveCamera;g.matrixAutoUpdate=!1;var k=function(){function e(r,t){babelHelpers.classCallCheck(this,e),this._frame=r,this._cursorVisibility="auto",this._isMouseCursorActive=!1,this._defaultSurface=null,this._surfaces={},this._resourceManager=(0,o.default)(),this._videoPlayers=new v.default,this._camera=new a.PerspectiveCamera(60,r.clientWidth/r.clientHeight,.1,2e3),this._renderer=new a.WebGLRenderer({antialias:!0}),this._canvas=this._renderer.domElement,this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(r.clientWidth,r.clientHeight),r.appendChild(this._renderer.domElement),this._scene=t,this._environment=new c.default(this._resourceManager,this._videoPlayers),t.add(this._environment.getPanoNode()),this._surfaceRoot=new a.Object3D,t.add(this._surfaceRoot),this._cursor=new d.default,t.add(this._cursor.getMesh())}return babelHelpers.createClass(e,[{key:"setCursorVisibility",value:function(e){this._cursorVisibility=e}},{key:"setBackground",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._environment.setSource(e,r)}},{key:"setBackgroundVideo",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._environment.setVideoSource(e,r)}},{key:"createVideoPlayer",value:function(e){return this._videoPlayers.createPlayer(e)}},{key:"getVideoPlayerManager",value:function(){return this._videoPlayers}},{key:"getEnvironment",value:function(){return this._environment}},{key:"getCursorVisibility",value:function(){return this._cursorVisibility}},{key:"setMouseCursorActive",value:function(e){this._isMouseCursorActive!==e&&(this._isMouseCursorActive=e,this._frame.style.cursor=e?"pointer":"inherit")}},{key:"addSurface",value:function(e,r){if(this._surfaces[e])throw new Error("Cannot add Surface with tag '"+e+"', a Surface with that name already exists.");this._surfaces[e]=r}},{key:"showSurface",value:function(e){this._surfaceRoot.add(e.getNode())}},{key:"getSurface",value:function(e){return this._surfaces[e]}},{key:"getDefaultSurface",value:function(){return this._defaultSurface||(this._defaultSurface=new _.default(1e3,600)),this._defaultSurface}},{key:"getCanvas",value:function(){return this._canvas}},{key:"getCamera",value:function(){return this._camera}},{key:"getRenderer",value:function(){return this._renderer}},{key:"resize",value:function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;this._renderer.setPixelRatio(t),this._renderer.setSize(e,r,!1)}},{key:"resizeCanvas",value:function(e,r){this._camera.aspect=e/r,this._camera.updateProjectionMatrix(),this._renderer.setSize(e,r,!0)}},{key:"prepareForRender",value:function(e){this._environment.prepareForRender(e)}},{key:"frame",value:function(e){this._environment.frame(e),this._videoPlayers.frame()}},{key:"updateCursor",value:function(e,r){if(!e||e.length<1)return void this._cursor.hide();if(!e[0].drawsCursor)return void this._cursor.hide();this._cursor.show();var t=e[0].origin,i=e[0].direction,s=t[0]+i[0]*r,a=t[1]+i[1]*r,n=t[2]+i[2]*r;this._cursor.setPosition(s,a,n)}},{key:"render",value:function(e,r){this.prepareForRender(null),this._camera.position.set(e[0],e[1],e[2]),this._camera.quaternion.set(r[0],r[1],r[2],r[3]),this._renderer.render(this._scene,this._camera)}},{key:"renderSurface",value:function(e){this._renderer.render(e.getScene(),e.getCamera())}},{key:"renderVR",value:function(e,r){var t=this._scene.autoUpdate;t&&(this._scene.updateMatrixWorld(),this._scene.autoUpdate=!1);var i=this._renderer.getSize();this._renderer.setScissorTest(!0),this._camera.updateMatrixWorld(),y.matrixWorldInverse.fromArray(r.leftViewMatrix),g.matrixWorldInverse.fromArray(r.rightViewMatrix),y.matrixWorld.getInverse(y.matrixWorldInverse),g.matrixWorld.getInverse(g.matrixWorldInverse),y.projectionMatrix.fromArray(r.leftProjectionMatrix),g.projectionMatrix.fromArray(r.rightProjectionMatrix);var s=0,a=0,n=.5*i.width,o=i.height;this.prepareForRender(p),this._renderer.setViewport(s,a,n,o),this._renderer.setScissor(s,a,n,o),this._renderer.render(this._scene,y),s=n,this.prepareForRender(m),this._renderer.setViewport(s,a,n,o),this._renderer.setScissor(s,a,n,o),this._renderer.render(this._scene,g),this._renderer.setViewport(0,0,i.width,i.height),this._renderer.setScissorTest(!1),t&&(this._scene.autoUpdate=!0),e.submitFrame()}}]),e}();i.default=k},113);
__d(function(n,e,r,o){function u(n){return new i.default(function(n,e){return new Promise(function(e,r){var o=new Image;o.crossOrigin="Anonymous",o.onload=function(){e(o)},o.onerror=function(n){r(n)},o.src=n})},null,n)}Object.defineProperty(o,"__esModule",{value:!0}),o.default=u;var t=e(115),i=babelHelpers.interopRequireDefault(t)},114);
__d(function(e,t,n,u){Object.defineProperty(u,"__esModule",{value:!0});var i=t(50),s=babelHelpers.interopRequireDefault(i),r=function(){function e(t,n){var u=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;babelHelpers.classCallCheck(this,e),this._disposeMethod=n,this._ejectionQueue=[],this._loadMethod=t,this._pendingResources={},this._queueSize=i,this._refCountCache=new s.default(function(e){if(u._ejectionQueue.push(e),u._ejectionQueue.length>u._queueSize){var t=u._ejectionQueue.shift(),n=u._resourceMap[t];delete u._resourceMap[t],u._disposeMethod&&n&&u._disposeMethod(n)}}),this._resourceMap={}}return babelHelpers.createClass(e,[{key:"isResourceCached",value:function(e){return e in this._resourceMap}},{key:"isResourceLoading",value:function(e){return e in this._pendingResources}},{key:"isResourceReferenced",value:function(e){return this._refCountCache.has(e)}},{key:"isResourceInEjectionQueue",value:function(e){return this._ejectionQueue.indexOf(e)>-1}},{key:"getResourceForURL",value:function(e,t){var n=this;if(this._resourceMap[e])return Promise.resolve(this._resourceMap[e]);if(this._pendingResources[e])return this._pendingResources[e];var u=new Promise(function(u,i){n._loadMethod(e,t).then(function(t){n._resourceMap[e]=t,delete n._pendingResources[e],u(t)},function(e){i(e)})});return this._pendingResources[e]=u,u}},{key:"addReference",value:function(e){if(this._refCountCache.has(e))this._refCountCache.addReference(e);else{var t=this._ejectionQueue.indexOf(e);t>-1&&this._ejectionQueue.splice(t,1),this._refCountCache.addEntry(e,!0)}}},{key:"removeReference",value:function(e){this._refCountCache.has(e)&&this._refCountCache.removeReference(e)}},{key:"forEach",value:function(e){for(var t in this._resourceMap)e(t,this._resourceMap[t])}}]),e}();u.default=r},115);
__d(function(e,t,s,i){Object.defineProperty(i,"__esModule",{value:!0});var a=t(35),r=babelHelpers.interopRequireWildcard(a),n=.05,l=function(){function e(){babelHelpers.classCallCheck(this,e),this._texture=new r.Texture(e.createDefaultCursorImage()),this._texture.needsUpdate=!0;var t=new r.MeshBasicMaterial({transparent:!0,opacity:1,side:r.DoubleSide,map:this._texture});this._mesh=new r.Mesh(new r.PlaneGeometry(n,n),t),this._mesh.position.set(0,0,0),this._mesh.raycast=function(){return null},t.depthTest=!1,t.depthWrite=!1,t.renderOrder=1}return babelHelpers.createClass(e,[{key:"hide",value:function(){this._mesh.visible=!1}},{key:"show",value:function(){this._mesh.visible=!0}},{key:"getMesh",value:function(){return this._mesh}},{key:"setPosition",value:function(e,t,s){this._mesh.position.set(e,t,s),this._mesh.rotation.set(0,Math.atan2(e,s),0,"YXZ")}}],[{key:"createDefaultCursorImage",value:function(){var e=document.createElement("canvas");e.width=128,e.height=128;var t=e.getContext("2d");return t.beginPath(),t.arc(64,64,55,0,2*Math.PI),t.strokeStyle="#000000",t.fillStyle="#ffffff",t.lineWidth=9,t.stroke(),t.fill(),e}}]),e}();i.default=l},116);
__d(function(e,t,a,o){function n(e){return new Promise(function(t,a){var o=new Image;o.crossOrigin="Anonymous",o.onload=function(){t(o)},o.onerror=function(e){a(e)},o.src=e})}Object.defineProperty(o,"__esModule",{value:!0});var s=t(35),r=babelHelpers.interopRequireWildcard(s),i=t(72),h=babelHelpers.interopRequireDefault(i),p=function(){function e(t,a){babelHelpers.classCallCheck(this,e),this._resourceManager=t,this._videoPlayers=a,this._panoGeomSphere=new r.SphereGeometry(1e3,16,16),this._panoGeomHemisphere=new r.SphereGeometry(1e3,16,16,0,Math.PI),this._panoMaterial=new h.default({color:"#000000",side:r.DoubleSide}),this._panoMaterial.useUV=0,this._panoMesh=new r.Mesh(this._panoGeomSphere,this._panoMaterial),this._panoMesh.visible=!1,this._panoMesh.scale.set(-1,1,1),this._panoMesh.rotation.y=-Math.PI/2,this._panoEyeOffsets=[[0,0,1,1]],this._panoTransition=0}return babelHelpers.createClass(e,[{key:"_setPanoGeometryToSphere",value:function(){this._panoMesh.geometry=this._panoGeomSphere,this._panoMesh.rotation.y=-Math.PI/2,this._panoMaterial.uniforms.arcOffset.value=0,this._panoMaterial.uniforms.arcLengthReciprocal.value=1/Math.PI/2,this._panoMesh.needsUpdate=!0}},{key:"_setPanoGeometryToHemisphere",value:function(){this._panoMesh.geometry=this._panoGeomHemisphere,this._panoMesh.rotation.y=Math.PI,this._panoMaterial.uniforms.arcOffset.value=Math.PI/2,this._panoMaterial.uniforms.arcLengthReciprocal.value=1/Math.PI,this._panoMesh.needsUpdate=!0}},{key:"_loadImage",value:function(e,t){return this._resourceManager&&this._resourceManager.addReference(e),(this._resourceManager?this._resourceManager.getResourceForURL(e):n(e)).then(function(a){var o=new r.Texture(a);return o.minFilter=r.LinearFilter,o.needsUpdate=!0,{src:e,tex:o,format:t.format,width:a.width,height:a.height}})}},{key:"_updateTexture",value:function(e){if(e.src===this._panoSource){this._panoMesh.visible=!0,this._panoMaterial.map=e.tex;var t=e.width,a=e.height;t===a?"3DTB"===e.format?(this._panoEyeOffsets=[[0,0,1,.5],[0,.5,1,.5]],this._setPanoGeometryToSphere()):"3DBT"===e.format?(this._panoEyeOffsets=[[0,.5,1,.5],[0,0,1,.5]],this._setPanoGeometryToSphere()):(this._panoEyeOffsets=[[0,0,1,1]],this._setPanoGeometryToHemisphere()):t/2===a?"3DLR"===e.format?(this._panoEyeOffsets=[[0,0,.5,1],[.5,0,.5,1]],this._setPanoGeometryToHemisphere()):(this._panoEyeOffsets=[[0,0,1,1]],this._setPanoGeometryToSphere()):"3DTB"===e.format?(this._panoEyeOffsets=[[0,0,1,.5],[0,.5,1,.5]],this._setPanoGeometryToSphere()):"3DBT"===e.format&&(this._panoEyeOffsets=[[0,.5,1,.5],[0,0,1,.5]],this._setPanoGeometryToSphere()),this._panoMaterial.needsUpdate=!0}}},{key:"getPanoNode",value:function(){return this._panoMesh}},{key:"_setBackground",value:function(e,t,a){var o=this,n=this._panoSource;this._panoSource=t;var s="number"==typeof a?a:500,r=s?1/s:1;return this._panoTransition=n?-r:0,e?(this._panoLoad=e,e.then(function(e){return 0===o._panoTransition?(o._panoLoad=null,o._panoTransition=r,o._updateTexture(e)):Promise.resolve()})):(this._panoLoad=null,Promise.resolve())}},{key:"setSource",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._resourceManager&&this._panoSource&&this._resourceManager.removeReference(this._panoSource);var a=e?this._loadImage(e,t):null;return this._setBackground(a,e,t.transition)}},{key:"setVideoSource",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=this._videoPlayers?this._videoPlayers.getPlayer(e):null,o=a?a.load().then(function(t){return babelHelpers.extends({},t,{src:e})}):null;return this._setBackground(o,e,t.transition)}},{key:"prepareForRender",value:function(e){"right"===e&&this._panoEyeOffsets[1]?this._panoMaterial.uniforms.stereoOffsetRepeat.value=this._panoEyeOffsets[1]:this._panoMaterial.uniforms.stereoOffsetRepeat.value=this._panoEyeOffsets[0]}},{key:"frame",value:function(e){var t=this,a=this._panoTransition;if(0!==a){var o=a*e,n=this._panoMaterial.color,s=n.r,r=s+o;r<=0&&(this._panoTransition=0,r=0),r>=1&&(this._panoTransition=0,r=1),n.setRGB(r,r,r),a<0&&0===this._panoTransition&&this._panoLoad&&this._panoLoad.then(function(e){t._panoTransition=-a,t._updateTexture(e)})}}}]),e}();o.default=p},117);
__d(function(e,r,t,a){Object.defineProperty(a,"__esModule",{value:!0});var l=r(119),s=babelHelpers.interopRequireDefault(l),i=function(){function e(){babelHelpers.classCallCheck(this,e),this._players={}}return babelHelpers.createClass(e,[{key:"createPlayer",value:function(e){if(this._players[e])return this._players[e];var r=new s.default;return this._players[e]=r,r}},{key:"getPlayer",value:function(e){return this._players[e]}},{key:"destroyPlayer",value:function(e){var r=this._players[e];r&&(delete this._players[e],r.destroy())}},{key:"frame",value:function(){for(var e in this._players)this._players[e].refreshTexture()}}]),e}();a.default=i},118);
__d(function(e,t,n,i){function s(){var e=document.createElement("video");a=[];for(var t in o){var n=e.canPlayType(o[t]);n.length&&"no"!==n&&a.push(t)}}Object.defineProperty(i,"__esModule",{value:!0});var r=t(35),l=babelHelpers.interopRequireWildcard(r),o={ogg:'video/ogg; codecs="theora, vorbis"',mp4:'video/mp4; codecs="avc1.4D401E, mp4a.40.2"',mkv:'video/x-matroska; codecs="theora, vorbis"',webm:'video/webm; codecs="vp8, vorbis"'},a=null,u=function(){function e(){var t=this;babelHelpers.classCallCheck(this,e),this._onEnded=function(){t._playing=!1},this._playing=!1,this._primed=!1,this._element=document.createElement("video"),this._element.muted=!0,this._element.style.display="none",this._element.setAttribute("playsinline","playsinline"),this._element.setAttribute("webkit-playsinline","webkit-playsinline"),this._element.crossOrigin="anonymous",this._texture=null,document.body&&document.body.appendChild(this._element),this._load=null,this._element.addEventListener("ended",this._onEnded)}return babelHelpers.createClass(e,[{key:"setSource",value:function(e,t){var n=this;this._texture&&this._texture.dispose(),this._element.src=e,this._element.load(),this._load=new Promise(function(i,s){var r=!1;n._element.addEventListener("canplay",function(){if(!r){r=!0;var s=n._element.videoWidth,o=n._element.videoHeight,a=new l.Texture(n._element);a.generateMipmaps=!1,a.wrapS=l.ClampToEdgeWrapping,a.wrapT=l.ClampToEdgeWrapping,a.minFilter=l.LinearFilter,a.magFilter=l.LinearFilter,n._texture=a,i({format:t||"2D",height:o,src:e,tex:a,width:s})}}),n._element.addEventListener("error",function(){if(!r){r=!0;var e=n._element.error;s(new Error(e?e.message:"Unknown media error"))}})})}},{key:"load",value:function(){return this._load||Promise.reject(new Error("No source set"))}},{key:"refreshTexture",value:function(){this._texture&&this._playing&&(this._texture.needsUpdate=!0)}},{key:"setVolume",value:function(e){this._element.volume=Math.max(0,Math.min(e,1))}},{key:"setMuted",value:function(e){this._element.muted=e}},{key:"setLoop",value:function(e){this._element.loop=!0}},{key:"play",value:function(){this._element.play(),this._playing=!0}},{key:"pause",value:function(){this._element.pause(),this._playing=!1}},{key:"seekTo",value:function(e){this._element.currentTime=e}},{key:"destroy",value:function(){this.pause(),this._element.parentNode&&this._element.parentNode.removeChild(this._element),this._texture&&this._texture.dispose(),this._element.src=""}}],[{key:"getSupportedFormats",value:function(){return a||s(),a||[]}}]),e}();i.default=u},119);
__d(function(t,e,n,i){function o(t,e){var n=t.style;for(var i in e){var o=i;if(!n.hasOwnProperty(o)){var r=o[0].toUpperCase()+o.substr(1);n.hasOwnProperty("moz"+r)?o="moz"+r:n.hasOwnProperty("webkit"+r)&&(o="webkit"+r)}t.style[o]=e[i]}}Object.defineProperty(i,"__esModule",{value:!0}),e(111);var r=e(121),a={bottom:0,left:0,position:"absolute",right:0,top:0,pointerEvents:"none",userSelect:"none"},s={backgroundColor:"rgba(0,0,0,0.7)",borderRadius:"100%",height:"30px",marginTop:"-20px",padding:"5px",position:"absolute",right:"20px",top:"50%",width:"30px"},l={cursor:"pointer",pointerEvents:"initial",transformOrigin:"50% 50%"},p={background:"rgba(0, 0, 0, 0.7)",border:"2px solid #ffffff",borderRadius:"5px",bottom:"20px",color:"#ffffff",cursor:"pointer",display:"none",fontFamily:"Helvetica, Arial, sans-serif",fontSize:"16px",fontWeight:"normal",height:"38px",left:"18px",padding:"0 10px",pointerEvents:"initial",position:"absolute"},u={display:"inline-block",lineHeight:"38px",marginLeft:"10px",verticalAlign:"top"},d=function(){function t(e){var n=this;babelHelpers.classCallCheck(this,t),this._wrapper=document.createElement("div"),o(this._wrapper,a),e.appendChild(this._wrapper);var i=window.getComputedStyle(e);"static"!==i.position&&""!==i.position||(e.style.position="relative"),this._vrButton=document.createElement("a"),o(this._vrButton,p);var d=(0,r.createViewInVrGlyph)(38,38,"#ffffff");this._vrButton.appendChild(d);var h=document.createElement("span");o(h,u),this._vrButton.appendChild(h),this._vrButtonText=document.createTextNode("View in VR"),h.appendChild(this._vrButtonText),this._vrButton.addEventListener("click",function(){n._vrButtonHandler&&n._vrButtonHandler()}),this._vrButton.addEventListener("touchend",function(){n._vrButtonHandler&&n._vrButtonHandler()}),this._vrButton.style.display="none",this._wrapper.appendChild(this._vrButton);var f=document.createElement("div");o(f,s),this._compass=(0,r.createCompassGlyph)(30,30,"#ffffff"),o(this._compass,l),f.appendChild(this._compass),this._wrapper.appendChild(f)}return babelHelpers.createClass(t,[{key:"enableVRButton",value:function(){this._vrButton.style.display="block"}},{key:"disableVRButton",value:function(){this._vrButton.style.display="none"}},{key:"setVRButtonText",value:function(t){this._vrButtonText.nodeValue=t}},{key:"setVRButtonHandler",value:function(t){this._vrButtonHandler=t}},{key:"setVRButtonState",value:function(t,e,n){t?this.enableVRButton():this.disableVRButton(),this.setVRButtonText(e),this.setVRButtonHandler(n)}},{key:"setCameraRotation",value:function(t){var e=t[0],n=t[1],i=t[2],o=t[3],r=e*e,a=n*n,s=1/(r+a+i*i+o*o),l=-2*s*(e*i+n*o),p=-1+2*s*(r+a),u=Math.sqrt(l*l+p*p),d=(l>0?1:-1)*Math.acos(-1*p/u);this._compass.style.transform="rotate("+d+"rad)"}},{key:"hide",value:function(){this._wrapper.style.display="none"}},{key:"show",value:function(){this._wrapper.style.display="block"}}]),t}();i.default=d},120);
__d(function(e,t,r,n){function l(e,t,r,n){if(!e)throw new Error("No width specified!");if(!t)throw new Error("No height specified!");var l=document.createElementNS(f,"g");l.setAttributeNS(null,"fill",r),l.setAttributeNS(null,"stroke","none"),l.setAttributeNS(null,"fill-rule","evenodd");for(var i=0;i<n.length;i++){var u=document.createElementNS(f,"path");u.setAttributeNS(null,"d",n[i]),l.appendChild(u)}var o=document.createElementNS(f,"svg");return o.setAttributeNS(null,"width",e+"px"),o.setAttributeNS(null,"height",t+"px"),o.setAttributeNS(null,"viewBox","0 0 60 60"),o.appendChild(l),o}function i(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#ffffff";return l(e,t,r,o)}function u(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#ffffff";return l(e,t,r,c)}Object.defineProperty(n,"__esModule",{value:!0}),n.createCompassGlyph=i,n.createViewInVrGlyph=u;var f="http://www.w3.org/2000/svg",o=["M30,60 C46.5685425,60 60,46.5685425 60,30 C60,13.4314575 46.5685425,0 30,0 C13.4314575,0 0,13.4314575 0,30 C0,46.5685425 13.4314575,60 30,60 Z M30,58 C45.463973,58 58,45.463973 58,30 C58,14.536027 45.463973,2 30,2 C14.536027,2 2,14.536027 2,30 C2,45.463973 14.536027,58 30,58 Z","M42.7174074,12.0460131 C39.1265957,9.49790578 34.7382252,8 30,8 C25.2617748,8 20.8734043,9.49790578 17.2825926,12.0460131 L25.3754882,23.4712775 C26.6812379,22.544693 28.277009,22 30,22 C31.722991,22 33.3187621,22.544693 34.6245118,23.4712775 L42.7174074,12.0460131 Z","M26,30 a4,4 0 1,1 8,0 a4,4 0 1,1 -8,0"],c=["M17.9,26.2c-2.7,0-4.8,2.1-4.8,4.8s2.1,4.8,4.8,4.8s4.8-2.1,4.8-4.8S20.5,26.2,17.9,26.2z M41.9,12.9H18.1C8.1,12.9,0,21,0,31s8.1,18.1,18.1,18.1H42c10,0,18-8.1,18-18.1S52,12.9,41.9,12.9z M41.9,41.8h-3.6c-4,0-5.5-6.7-8.3-6.7s-4.1,6.7-8.3,6.7h-3.6c-6,0-10.9-4.9-10.9-10.9s4.9-10.9,10.9-10.9H42c6,0,10.9,4.9,10.9,10.9C52.8,37,48,41.8,41.9,41.8zM41.9,26.2c-2.7,0-4.8,2.1-4.8,4.8s2.1,4.8,4.8,4.8c2.7,0,4.8-2.1,4.8-4.8S44.5,26.2,41.9,26.2z"]},121);
__d(function(i,a,s,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function i(){var a=this;babelHelpers.classCallCheck(this,i),this._displayChangeCallbacks=[],this._enterCallbacks=[],this._exitCallbacks=[],this.onDisplayActivate=this.onDisplayActivate.bind(this),this.onDisplayDeactivate=this.onDisplayDeactivate.bind(this),this.onDisplayConnect=this.onDisplayConnect.bind(this),this.onDisplayDisconnect=this.onDisplayDisconnect.bind(this),this.onDisplayPresentChange=this.onDisplayPresentChange.bind(this),window.addEventListener("vrdisplayconnect",this.onDisplayConnect),window.addEventListener("vrdisplaydisconnect",this.onDisplayDisconnect),window.addEventListener("vrdisplaypresentchange",this.onDisplayPresentChange),"function"==typeof navigator.getVRDisplays&&navigator.getVRDisplays().then(function(i){i.length&&a.setCurrentDisplay(i[0])})}return babelHelpers.createClass(i,[{key:"_callEnterCallbacks",value:function(){for(var i=0;i<this._enterCallbacks.length;i++)this._enterCallbacks[i]()}},{key:"_callExitCallbacks",value:function(){for(var i=0;i<this._exitCallbacks.length;i++)this._exitCallbacks[i]()}},{key:"_callDisplayChangeCallbacks",value:function(){for(var i=0;i<this._displayChangeCallbacks.length;i++)this._displayChangeCallbacks[i](this.vrDisplay)}},{key:"onEnter",value:function(i){this._enterCallbacks.push(i)}},{key:"onExit",value:function(i){this._exitCallbacks.push(i)}},{key:"onDisplayChange",value:function(i){this._displayChangeCallbacks.push(i)}},{key:"setCurrentDisplay",value:function(i){this.vrDisplay=i,this._callDisplayChangeCallbacks()}},{key:"getCurrentDisplay",value:function(){return this.vrDisplay}},{key:"isPresenting",value:function(){return!!this.vrDisplay&&this.vrDisplay.isPresenting}},{key:"onDisplayActivate",value:function(i){var a=i.display;a===this.vrDisplay}},{key:"onDisplayDeactivate",value:function(i){var a=i.display;a===this.vrDisplay}},{key:"onDisplayConnect",value:function(i){var a=i.display;this.vrDisplay||this.setCurrentDisplay(a)}},{key:"onDisplayDisconnect",value:function(i){var a=this,s=i.display;s===this.vrDisplay&&"function"==typeof navigator.getVRDisplays&&navigator.getVRDisplays().then(function(i){0===i.length?a.setCurrentDisplay(i[0]):a.setCurrentDisplay(null)})}},{key:"onDisplayPresentChange",value:function(i){var a=i.display;this.vrDisplay&&a&&a.displayId===this.vrDisplay.displayId&&(a.isPresenting||this._callExitCallbacks())}}]),i}();t.default=n},122);
__d(function(t,e,i,s){Object.defineProperty(s,"__esModule",{value:!0}),e(111),e(124);var h=Math.PI/6,a=Math.PI/2,n=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h;babelHelpers.classCallCheck(this,t),this._deltaYaw=0,this._deltaPitch=0,this._draggingMouse=!1,this._draggingTouch=!1,this._enabled=!0,this._frame=e,this._lastMouseX=0,this._lastMouseY=0,this._lastTouchX=0,this._lastTouchY=0,this._verticalFov=i,this._onMouseDown=this._onMouseDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onTouchMove=this._onTouchMove.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._frame.addEventListener("mousedown",this._onMouseDown),document.addEventListener("mousemove",this._onMouseMove),document.addEventListener("mouseup",this._onMouseUp),this._frame.addEventListener("touchstart",this._onTouchStart),this._frame.addEventListener("touchmove",this._onTouchMove),this._frame.addEventListener("touchcancel",this._onTouchEnd),this._frame.addEventListener("touchend",this._onTouchEnd)}return babelHelpers.createClass(t,[{key:"_onMouseDown",value:function(t){this._enabled&&(this._draggingMouse=!0,this._lastMouseX=t.clientX,this._lastMouseY=t.clientY)}},{key:"_onMouseMove",value:function(t){if(this._draggingMouse){var e=this._frame.clientWidth,i=this._frame.clientHeight,s=e/i,h=t.clientX-this._lastMouseX,n=t.clientY-this._lastMouseY;this._lastMouseX=t.clientX,this._lastMouseY=t.clientY,this._deltaPitch+=h/e*this._verticalFov*s,this._deltaYaw+=n/i*this._verticalFov,this._deltaYaw=Math.max(-a,Math.min(a,this._deltaYaw))}}},{key:"_onMouseUp",value:function(){this._draggingMouse=!1}},{key:"_onTouchStart",value:function(t){this._enabled&&(this._draggingTouch=!0,this._lastTouchX=t.changedTouches[0].clientX,this._lastTouchY=t.changedTouches[0].clientY)}},{key:"_onTouchMove",value:function(t){if(this._draggingTouch){var e=t.changedTouches[0].clientX,i=t.changedTouches[0].clientY,s=this._frame.clientWidth,h=this._frame.clientHeight,n=s/h,o=e-this._lastTouchX,_=i-this._lastTouchY;this._lastTouchX=e,this._lastTouchY=i,this._deltaPitch+=o/s*this._verticalFov*n,this._deltaYaw+=_/h*this._verticalFov,this._deltaYaw=Math.max(-a,Math.min(a,this._deltaYaw))}}},{key:"_onTouchEnd",value:function(t){this._draggingTouch=!1}},{key:"enable",value:function(){this._enabled=!0,this._draggingMouse=!1,this._draggingTouch=!1}},{key:"disable",value:function(){this._enabled=!1,this._draggingMouse=!1,this._draggingTouch=!1}},{key:"fillCameraProperties",value:function(t,e){if(!this._enabled)return!1;if(0===this._deltaPitch&&0===this._deltaYaw)return!1;var i=Math.cos(this._deltaPitch/2),s=Math.sin(this._deltaPitch/2),h=Math.cos(this._deltaYaw/2),a=Math.sin(this._deltaYaw/2),n=e[0],o=e[1],_=e[2],u=e[3],c=i*n+s*_,l=i*o+s*u,d=i*_-s*n,r=i*u-s*o,M=r*a+c*h,g=l*h+d*a,v=-l*a+d*h,T=r*h-c*a;return e[0]=M,e[1]=g,e[2]=v,e[3]=T,this._deltaPitch=0,this._deltaYaw=0,!0}}]),t}();s.default=n},123);
__d(function(n,_,c,d){_(111)},124);
__d(function(t,e,a,i){Object.defineProperty(i,"__esModule",{value:!0}),e(111),e(124);var h=Math.PI/6,l=Math.PI/2,s=function(){function t(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h;babelHelpers.classCallCheck(this,t),this._deltaYaw=0,this._deltaPitch=0,this._enabled=!0,this._frame=e,this._lastX=0,this._lastY=0,this._verticalFov=a,this._onWheel=this._onWheel.bind(this),this._frame.addEventListener("wheel",this._onWheel)}return babelHelpers.createClass(t,[{key:"_onWheel",value:function(t){if(this._enabled){var e=this._frame.clientWidth,a=this._frame.clientHeight,i=e/a,h=t.deltaX,s=t.deltaY;this._deltaPitch+=h/e*this._verticalFov*i,this._deltaYaw+=s/a*this._verticalFov,this._deltaYaw=Math.max(-l,Math.min(l,this._deltaYaw)),t.preventDefault()}}},{key:"enable",value:function(){this._enabled=!0}},{key:"disable",value:function(){this._enabled=!1}},{key:"fillCameraProperties",value:function(t,e){if(!this._enabled)return!1;if(0===this._deltaPitch&&0===this._deltaYaw)return!1;var a=Math.cos(this._deltaPitch/2),i=Math.sin(this._deltaPitch/2),h=Math.cos(this._deltaYaw/2),l=Math.sin(this._deltaYaw/2),s=e[0],n=e[1],_=e[2],d=e[3],r=a*s+i*_,c=a*n+i*d,o=a*_-i*s,u=a*d-i*n,f=u*l+r*h,v=c*h+o*l,b=-c*l+o*h,P=u*h-r*l;return e[0]=f,e[1]=v,e[2]=b,e[3]=P,this._deltaPitch=0,this._deltaYaw=0,!0}}]),t}();i.default=s},125);
__d(function(t,e,i,n){function a(){var t=screen.orientation||screen.mozOrientation||screen.msOrientation||{},e=t.angle||window.orientation||0;return e*r}function s(){return"DeviceOrientationEvent"in window&&/Mobi/i.test(navigator.userAgent)&&!/OculusBrowser/i.test(navigator.userAgent)}Object.defineProperty(n,"__esModule",{value:!0});var h=e(127);e(111),e(124);var o=Math.PI/6,r=Math.PI/180,_=Math.PI/2,u=2*Math.PI,l=[-Math.sqrt(.5),0,0,Math.sqrt(.5)],c=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;babelHelpers.classCallCheck(this,t),this._alpha=null,this._beta=null,this._dragging=!1,this._gamma=null,this._enabled=s(),this._frame=e,this._lastX=0,this._lastY=0,this._screenOrientation=[0,0,0,1],this._onOrientationChange(),this._verticalFov=i,this._offsetYaw=0,this._offsetPitch=0,this._offsetYawQuat=null,this._offsetPitchQuat=[0,0,0,1],(0,h.setQuatFromXRotation)(this._offsetPitchQuat,0),this._onOrientationChange=this._onOrientationChange.bind(this),this._onDeviceOrientation=this._onDeviceOrientation.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onTouchMove=this._onTouchMove.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),window.addEventListener("orientationchange",this._onOrientationChange),window.addEventListener("deviceorientation",this._onDeviceOrientation),this._frame.addEventListener("touchstart",this._onTouchStart),this._frame.addEventListener("touchmove",this._onTouchMove),this._frame.addEventListener("touchcancel",this._onTouchEnd),this._frame.addEventListener("touchend",this._onTouchEnd)}return babelHelpers.createClass(t,[{key:"_onOrientationChange",value:function(){var t=a();(0,h.setQuatFromZRotation)(this._screenOrientation,-t),(0,h.quaternionPremultiply)(this._screenOrientation,l)}},{key:"_onDeviceOrientation",value:function(t){var e=t.alpha*r,i=t.beta*r,n=t.gamma*r;if(null===this._offsetYawQuat){var s=a()-e;this._offsetYawQuat=[0,0,0,1],this._offsetYaw=s}this._alpha=e,this._beta=i,this._gamma=n}},{key:"_onTouchStart",value:function(t){this._enabled&&(this._dragging=!0,this._lastX=t.changedTouches[0].clientX,this._lastY=t.changedTouches[0].clientY,t.preventDefault())}},{key:"_onTouchMove",value:function(t){if(this._enabled&&this._dragging){var e=t.changedTouches[0].clientX,i=t.changedTouches[0].clientY,n=e-this._lastX,a=i-this._lastY;this._lastX=e,this._lastY=i;var s=this._frame.clientWidth,h=this._frame.clientHeight,o=s/h;Math.abs(n)>=Math.abs(a)?(this._offsetYaw+=n/s*this._verticalFov*o,this._offsetYaw>u?this._offsetYaw-=u:this._offsetYaw<0&&(this._offsetYaw+=u)):(this._offsetPitch+=a/h*this._verticalFov,this._offsetPitch>_?this._offsetPitch=_:this._offsetPitch<-_&&(this._offsetPitch=-_)),t.preventDefault()}}},{key:"_onTouchEnd",value:function(t){this._enabled&&(this._dragging=!1,t.preventDefault())}},{key:"enable",value:function(){this._enabled=!0}},{key:"disable",value:function(){this._enabled=!1}},{key:"fillCameraProperties",value:function(t,e){if(!this._enabled)return!1;var i=this._alpha,n=this._beta,a=this._gamma;if(null===i||null===n||null===a)return!1;(0,h.setQuatFromEuler)(e,n||0,i||0,-(a||0)),(0,h.setQuatFromXRotation)(this._offsetPitchQuat,this._offsetPitch),(0,h.quaternionMultiply)(e,this._offsetPitchQuat);var s=this._offsetYawQuat;return s&&((0,h.setQuatFromYRotation)(s,this._offsetYaw),(0,h.quaternionPremultiply)(e,s)),(0,h.quaternionMultiply)(e,this._screenOrientation),!0}}]),t}();n.default=c},126);
__d(function(t,n,a,o){function i(t,n){var a=n[0],o=n[1],i=n[2],u=n[3],r=t[0],s=t[1],e=t[2],c=a+a,M=o+o,h=i+i,f=a*c,v=o*M,l=i*h,m=a*M,Q=a*h,F=o*h,y=u*c,_=u*M,d=u*h;t[0]=(1-v-l)*r+(m-d)*s+(Q+_)*e,t[1]=(m+d)*r+(1-f-l)*s+(F-y)*e,t[2]=(Q-_)*r+(F+y)*s+(1-f-v)*e}function u(t,n){var a=t[0],o=t[1],i=t[2],u=t[3],r=n[0],s=n[1],e=n[2],c=n[3];t[0]=a*c+u*r+o*e-i*s,t[1]=o*c+u*s+i*r-a*e,t[2]=i*c+u*e+a*s-o*r,t[3]=u*c-a*r-o*s-i*e}function r(t,n){var a=n[0],o=n[1],i=n[2],u=n[3],r=t[0],s=t[1],e=t[2],c=t[3];t[0]=a*c+u*r+o*e-i*s,t[1]=o*c+u*s+i*r-a*e,t[2]=i*c+u*e+a*s-o*r,t[3]=u*c-a*r-o*s-i*e}function s(t,n,a,o){var i=Math.cos(n/2),u=Math.cos(a/2),r=Math.cos(o/2),s=Math.sin(n/2),e=Math.sin(a/2),c=Math.sin(o/2);t[0]=s*u*r+i*e*c,t[1]=i*e*r-s*u*c,t[2]=i*u*c-s*e*r,t[3]=i*u*r+s*e*c}function e(t,n,a){var o=a/2,i=Math.sin(o),u=Math.cos(o);t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=u}function c(t,n){var a=n/2;t[0]=Math.sin(a),t[1]=0,t[2]=0,t[3]=Math.cos(a)}function M(t,n){var a=n/2;t[0]=0,t[1]=Math.sin(a),t[2]=0,t[3]=Math.cos(a)}function h(t,n){var a=n/2;t[0]=0,t[1]=0,t[2]=Math.sin(a),t[3]=Math.cos(a)}Object.defineProperty(o,"__esModule",{value:!0}),o.rotateByQuaternion=i,o.quaternionMultiply=u,o.quaternionPremultiply=r,o.setQuatFromEuler=s,o.setQuatFromAxisAngle=e,o.setQuatFromXRotation=c,o.setQuatFromYRotation=M,o.setQuatFromZRotation=h,n(111)},127);
__d(function(e,t,a,r){Object.defineProperty(r,"__esModule",{value:!0}),t(111),t(124),t(129),t(130);var s=function(){function e(){babelHelpers.classCallCheck(this,e),this.cameraControllers=[],this.eventChannels=[],this.raycasters=[],this._rayObjects=[]}return babelHelpers.createClass(e,[{key:"addCameraController",value:function(e){this.cameraControllers.push(e)}},{key:"addEventChannel",value:function(e){this.eventChannels.push(e)}},{key:"addRaycaster",value:function(e){this.raycasters.push(e),this._rayObjects.push({direction:[0,0,0],drawsCursor:!1,hasAbsoluteCoordinates:!1,maxLength:1/0,origin:[0,0,0],type:""})}},{key:"clearCameraControllers",value:function(){this.cameraControllers.length=0}},{key:"clearEventChannels",value:function(){this.eventChannels.length=0}},{key:"clearRaycasters",value:function(){this.raycasters.length=0}},{key:"getCameraControllers",value:function(){return this.cameraControllers.slice()}},{key:"getEventChannels",value:function(){return this.eventChannels.slice()}},{key:"getRaycasters",value:function(){return this.raycasters.slice()}},{key:"fillEvents",value:function(e){for(var t=0;t<this.eventChannels.length;t++){var a=this.eventChannels[t];a.getEvents(e)}}},{key:"fillRays",value:function(e){for(var t=0;t<this.raycasters.length;t++){var a=this.raycasters[t],r=this._rayObjects[t];a.fillDirection(r.direction)&&a.fillOrigin(r.origin)&&(r.type=a.getType(),r.maxLength=a.getMaxLength(),r.drawsCursor=a.drawsCursor(),r.hasAbsoluteCoordinates=a.hasAbsoluteCoordinates(),e.push(r))}}},{key:"fillCameraProperties",value:function(e,t){for(var a=0;a<this.cameraControllers.length;a++){var r=this.cameraControllers[a];if(r.fillCameraProperties(e,t))return}}}]),e}();r.default=s},128);
__d(function(n,_,c,d){},129);
__d(function(n,_,c,d){_(111)},130);
__d(function(e,t,n,a){Object.defineProperty(a,"__esModule",{value:!0});var i=(navigator.getGamepads?navigator.getGamepads:navigator.webkitGetGamepads?navigator.webkitGetGamepads:function(){return[]}).bind(navigator),o=500,r=[void 0,"confirm",void 0,"confirm","back"],s=[void 0,"confirm",void 0,void 0,"confirm"],p={"Gear VR Touchpad":["confirm"],"Gear VR Controller":["confirm","confirm"],"Oculus Go Controller":["confirm","confirm"],"Daydream Controller":["confirm"],"Oculus Touch (Left)":r,"Oculus Touch (Right)":r,"Spatial Controller (Spatial Interaction Source) 045E-065B":s,"Spatial Controller (Spatial Interaction Source) 045E-065D":s},u=a.STANDARD_MAPPING=["confirm","back","","","","","","","","","","","up","down","left","right"],c=["confirm"],d=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};babelHelpers.classCallCheck(this,e),this._mappingCache=[],this._previousState=[],this._customMapping=t,this._onGamepadConnected=this._onGamepadConnected.bind(this),this._onGamepadDisconnected=this._onGamepadDisconnected.bind(this),window.addEventListener("gamepadconnected",this._onGamepadConnected),window.addEventListener("gamepaddisconnected",this._onGamepadDisconnected)}return babelHelpers.createClass(e,[{key:"_getMapping",value:function(e,t){var n=e.index,a=this._mappingCache[n];return a||(a=this._updateCacheEntry(e)),a[t]||null}},{key:"mappingLookup",value:function(e){var t=this._customMapping[e.id];return t?t:"standard"===e.mapping?u:(t=p[e.id],t?t:c)}},{key:"_updateCacheEntry",value:function(e){for(var t=this.mappingLookup(e),n=new Array(t.length),a=0,i=t.length;a<i;a++)t[a]&&(n[a]=t[a]);return this._mappingCache[e.index]=n,n}},{key:"_onGamepadConnected",value:function(e){this._updateCacheEntry(e.gamepad)}},{key:"_onGamepadDisconnected",value:function(e){var t=e.gamepad;this._mappingCache[t.index]=null}},{key:"getEvents",value:function(e){for(var t=Date.now(),n=i(),a=0;a<n.length;a++){var r="gamepad_"+a;if(n[a]){this._previousState[a]||(this._previousState[a]={buttons:[],axes:[]});for(var s=this._previousState[a],p=n[a].buttons,u=0;u<p.length;u++){var c=s.buttons[u];c||(c={pressed:!1,startTime:-1},s.buttons[u]=c);var d="object"==typeof p[u]?p[u].pressed:1===p[u];if(c.pressed!==d)if(d){c.pressed=!0,c.startTime=t;var l={type:"button",button:u,action:"down",source:r},h=this._getMapping(n[a],u);h&&(l.buttonClass=h),e.push(l)}else{c.pressed=!1;var m={type:"button",button:u,action:"up",source:r},v=this._getMapping(n[a],u);v&&(m.buttonClass=v),e.push(m)}else if(d&&t-c.startTime>o){var g={type:"button",button:u,action:"repeat",source:r},f=this._getMapping(n[a],u);f&&(g.buttonClass=f),e.push(g)}}}else this._previousState[a]&&delete this._previousState[a]}}}]),e}();a.default=d},131);
__d(function(e,t,n,i){Object.defineProperty(i,"__esModule",{value:!0});var o=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];babelHelpers.classCallCheck(this,e),this._batchedEvents=[],this._mapping=[],this._mapping[13]="confirm",this._mapping[32]="confirm";for(var n=0,i=t.length;n<i;n++)n in t&&(this._mapping[n]=t[n]);this._onKeyDown=this._onKeyDown.bind(this),this._onKeyUp=this._onKeyUp.bind(this),window.addEventListener("keydown",this._onKeyDown,!0),window.addEventListener("keyup",this._onKeyUp,!0)}return babelHelpers.createClass(e,[{key:"_onKeyDown",value:function(e){var t=e.keyCode;if(t){var n={type:"button",button:t,action:e.repeat?"repeat":"down",source:"keyboard"},i=this._mapping[t];i&&(n.buttonClass=i),this._batchedEvents.push(n)}}},{key:"_onKeyUp",value:function(e){var t=e.keyCode;if(t){var n={type:"button",button:t,action:"up",source:"keyboard"},i=this._mapping[t];i&&(n.buttonClass=i),this._batchedEvents.push(n)}}},{key:"getEvents",value:function(e){for(var t=this._batchedEvents,n=0,i=t.length;n<i;n++)e.push(t[n]);t.length=0}}]),e}();i.default=o},132);
__d(function(t,e,n,o){Object.defineProperty(o,"__esModule",{value:!0});var s=function(){function t(e){babelHelpers.classCallCheck(this,t),this._batchedEvents=[],this._onMouseDown=this._onMouseDown.bind(this),this._onMouseUp=this._onMouseUp.bind(this),e.addEventListener("mousedown",this._onMouseDown,!0),e.addEventListener("mouseup",this._onMouseUp,!0)}return babelHelpers.createClass(t,[{key:"_onMouseDown",value:function(t){var e={type:"button",button:t.button,action:"down",source:"mouse"};0===t.button&&(e.buttonClass="confirm"),this._batchedEvents.push(e)}},{key:"_onMouseUp",value:function(t){var e={type:"button",button:t.button,action:"up",source:"mouse"};0===t.button&&(e.buttonClass="confirm"),this._batchedEvents.push(e)}},{key:"getEvents",value:function(t){for(var e=this._batchedEvents,n=0,o=e.length;n<o;n++)t.push(e[n]);e.length=0}}]),t}();o.default=s},133);
__d(function(t,n,e,o){Object.defineProperty(o,"__esModule",{value:!0});var s=function(){function t(n){babelHelpers.classCallCheck(this,t),this._batchedEvents=[],this._onTouchStart=this._onTouchStart.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),n.addEventListener("touchstart",this._onTouchStart,!0),n.addEventListener("touchend",this._onTouchEnd,!0),n.addEventListener("touchcancel",this._onTouchEnd,!0)}return babelHelpers.createClass(t,[{key:"_onTouchStart",value:function(t){var n={type:"button",button:0,action:"down",source:"touch",buttonClass:"confirm"};this._batchedEvents.push(n)}},{key:"_onTouchEnd",value:function(t){var n={type:"button",button:0,action:"up",source:"mouse",buttonClass:"confirm"};this._batchedEvents.push(n)}},{key:"getEvents",value:function(t){for(var n=this._batchedEvents,e=0,o=n.length;e<o;e++)t.push(n[e]);n.length=0}}]),t}();o.default=s},134);
__d(function(e,a,t,n){function i(e,a,t){u[0]=0,u[1]=0,u[2]=-.4,(0,r.rotateByQuaternion)(u,a),e[0]=u[0]+("left"===t?-.3:.3),e[1]=u[1]-.3,e[2]=u[2]}Object.defineProperty(n,"__esModule",{value:!0});var r=a(127);a(111),a(130);var d="controller",o="function"==typeof navigator.getGamepads?navigator.getGamepads.bind(navigator):function(){return[]},u=[0,0,-1],s=function(){function e(){var a=this;babelHelpers.classCallCheck(this,e),this._enabled=!0,this._gamepadID=null,this._gamepadIndex=-1;for(var t=o(),n=t.length;n--;)this._setGamepadIfValid(t[n]);window.addEventListener("gamepadconnected",function(e){a._setGamepadIfValid(e.gamepad)}),window.addEventListener("gamepaddisconnected",function(e){a._gamepadID&&e.gamepad.id===a._gamepadID&&a._setGamepad(null)})}return babelHelpers.createClass(e,[{key:"_setGamepadIfValid",value:function(e){e&&null===this._gamepadID&&e.pose&&this._setGamepad(e)}},{key:"_setGamepad",value:function(e){return e?(this._gamepadID=e.id,void(this._gamepadIndex=e.index)):(this._gamepadID=null,void(this._gamepadIndex=-1))}},{key:"_getGamepad",value:function(){var e=o();return e[this._gamepadIndex]}},{key:"enable",value:function(){this._enabled=!0}},{key:"disable",value:function(){this._enabled=!1}},{key:"getType",value:function(){return d}},{key:"getMaxLength",value:function(){return 1/0}},{key:"fillDirection",value:function(e){if(!this._enabled)return!1;if(!this._gamepadID)return!1;var a=this._getGamepad();if(!a)return!1;if(!a.pose||!a.pose.orientation)return!1;var t=a.pose.orientation;return e[0]=0,e[1]=0,e[2]=-1,(0,r.rotateByQuaternion)(e,t),!0}},{key:"fillOrigin",value:function(e){if(!this._enabled)return!1;if(!this._gamepadID)return!1;var a=this._getGamepad();if(!a)return!1;if(!a.pose)return!1;var t=a.pose;if(!t.position)return!!t.orientation&&(i(e,t.orientation,a.hand),!0);var n=t.position;return e[0]=n[0],e[1]=n[1],e[2]=n[2],!0}},{key:"drawsCursor",value:function(){return!0}},{key:"hasAbsoluteCoordinates",value:function(){return!0}}]),e}();n.default=s},135);
__d(function(e,t,n,i){Object.defineProperty(i,"__esModule",{value:!0}),t(111),t(130);var s="mouse",l=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:60;babelHelpers.classCallCheck(this,e),this._enabled=!0,this._fov=n,this._frame=t,this._lastX=null,this._lastY=null,this._onMouseMove=this._onMouseMove.bind(this),t.addEventListener("mousemove",this._onMouseMove)}return babelHelpers.createClass(e,[{key:"_onMouseMove",value:function(e){if(this._enabled){var t=this._frame.clientWidth,n=this._frame.clientHeight,i=e.offsetX/t*2-1,s=2*-(e.offsetY/n)+1;this._lastX=i,this._lastY=s}}},{key:"enable",value:function(){this._enabled=!0}},{key:"disable",value:function(){this._enabled=!1}},{key:"getType",value:function(){return s}},{key:"getMaxLength",value:function(){return 1/0}},{key:"fillDirection",value:function(e){if(!this._enabled)return!1;var t=this._lastX,n=this._lastY;if(null===t||null===n)return!1;var i=this._fov*Math.PI/180,s=Math.tan(i/2),l=this._frame.clientWidth/this._frame.clientHeight,a=l*s*t,u=s*n,r=Math.sqrt(1+a*a+u*u);return e[0]=a/r,e[1]=u/r,e[2]=-1/r,!0}},{key:"fillOrigin",value:function(e){return!!this._enabled&&(e[0]=0,e[1]=0,e[2]=0,!0)}},{key:"drawsCursor",value:function(){return!1}},{key:"hasAbsoluteCoordinates",value:function(){return!1}}]),e}();i.default=l},136);
__d(function(e,t,n,i){Object.defineProperty(i,"__esModule",{value:!0}),t(111),t(130);var s="touch",a=300,h=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:60;babelHelpers.classCallCheck(this,e),this._enabled=!0,this._fov=n,this._frame=t,this._lastX=null,this._lastY=null,this._touchReleaseTimeout=null,this._onTouchMove=this._onTouchMove.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._resetLastReading=this._resetLastReading.bind(this),t.addEventListener("touchstart",this._onTouchMove),t.addEventListener("touchmove",this._onTouchMove),t.addEventListener("touchend",this._onTouchEnd),t.addEventListener("touchcancel",this._onTouchEnd)}return babelHelpers.createClass(e,[{key:"_onTouchMove",value:function(e){if(this._enabled){var t=e.targetTouches;if(!t||t.length<1)return void this._endTouch();for(var n=this._frame.clientWidth,i=this._frame.clientHeight,s=e.targetTouches[0],a=s.pageX,h=s.pageY,u=this._frame;u&&u instanceof HTMLElement;)a-=u.offsetLeft,h-=u.offsetTop,u=u.parentNode;var o=a/n*2-1,l=2*-(h/i)+1;this._lastX=o,this._lastY=l}}},{key:"_onTouchEnd",value:function(e){this._enabled&&this._endTouch()}},{key:"_endTouch",value:function(){this._touchReleaseTimeout&&clearTimeout(this._touchReleaseTimeout),this._touchReleaseTimeout=setTimeout(this._resetLastReading,a)}},{key:"_resetLastReading",value:function(){this._lastX=null,this._lastY=null}},{key:"enable",value:function(){this._enabled=!0}},{key:"disable",value:function(){this._enabled=!1}},{key:"getType",value:function(){return s}},{key:"getMaxLength",value:function(){return 1/0}},{key:"fillDirection",value:function(e){if(!this._enabled)return!1;var t=this._lastX,n=this._lastY;if(null===t||null===n)return!1;var i=this._fov*Math.PI/180,s=Math.tan(i/2),a=this._frame.clientWidth/this._frame.clientHeight,h=a*s*t,u=s*n,o=Math.sqrt(1+h*h+u*u);return e[0]=h/o,e[1]=u/o,e[2]=-1/o,!0}},{key:"fillOrigin",value:function(e){return!!this._enabled&&(e[0]=0,e[1]=0,e[2]=0,!0)}},{key:"drawsCursor",value:function(){return!1}},{key:"hasAbsoluteCoordinates",value:function(){return!1}}]),e}();i.default=h},137);
__d(function(e,t,n,a){function i(e,t){return new Promise(function(n,a){e.decodeAudioData(t,function(e){return n(e)},function(e){return a(e)})})}Object.defineProperty(a,"__esModule",{value:!0});var o=t(139),r=babelHelpers.interopRequireDefault(o),s=t(140),u=babelHelpers.interopRequireDefault(s),l=t(127),d=t(19),h=babelHelpers.interopRequireDefault(d),f=[0,0,-1],c=[0,1,0],_=window.AudioContext||window.webkitAudioContext,v=function(e){function t(e){babelHelpers.classCallCheck(this,t);var n=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"AudioModule"));return n._audioCtx=new _,n._audioData={},n._handles={},n._loaders={},n._rnctx=e,n}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"_load",value:function(e){var t=this,n="string"==typeof e?e:e.uri;if(!n)return Promise.reject(new Error("Invalid audio URI"));if(this._audioData[n])return Promise.resolve(this._audioData[n]);if(this._loaders[n])return this._loaders[n];var a=fetch(n).then(function(e){return e.arrayBuffer()}).then(function(e){return i(t._audioCtx,e)}).then(function(e){return t._audioData[n]=e,delete t._loaders[n],e});return this._loaders[n]=a,a}},{key:"_setCameraParameters",value:function(e,t){f[0]=0,f[1]=0,f[2]=-1,c[0]=0,c[1]=1,c[2]=0,(0,l.rotateByQuaternion)(f,t),(0,l.rotateByQuaternion)(c,t),this._audioCtx.listener.setPosition(e[0],e[1],e[2]),this._audioCtx.listener.setOrientation(f[0],f[1],f[2],c[0],c[1],c[2])}},{key:"createAudio",value:function(e,t){var n=new r.default(t);this._handles[e]=n,this._load(t.source)}},{key:"playOneShot",value:function(e){var t=this,n=new r.default(babelHelpers.extends({},e,{autoPlay:!0}));this._load(e.source).then(function(e){var a=new u.default(e,t._audioCtx);n.setNode(a)})}},{key:"playEnvironmental",value:function(e){var t=this;this._envInstance&&this._envInstance.stop();var n=new r.default(babelHelpers.extends({},e,{autoPlay:!0,loop:!0}));this._load(e.source).then(function(e){var a=new u.default(e,t._audioCtx);n.setNode(a)}),this._envInstance=n}},{key:"setParams",value:function(e,t){var n=this._handles[e];n&&n.setParams(t)}},{key:"setEnvironmentalParams",value:function(e){this._envInstance&&this._envInstance.setParams(e)}},{key:"play",value:function(e,t){var n=this,a=this._handles[e];if(a)if(a.getNode())a.play(t);else{var i=a.getSource();this._load(i).then(function(e){var i=new u.default(e,n._audioCtx);a.setNode(i),a.play(t)})}}},{key:"stop",value:function(e){var t=this._handles[e];t&&t.stop()}},{key:"stopEnvironmental",value:function(){this._envInstance&&this._envInstance.stop()}},{key:"destroy",value:function(e){var t=this._handles[e];t&&(t.stop(),delete this._handles[e])}},{key:"load",value:function(e,t){var n=this;this._load(e).then(function(){n._rnctx.invokeCallback(t,[])})}},{key:"unload",value:function(e){var t="string"==typeof e?e:e.uri;t&&this._audioData[t]&&delete this._audioData[t]}},{key:"frame",value:function(e){for(var t in this._handles)this._handles[t].frame(e)}}]),t}(h.default);a.default=v},138);
__d(function(t,i,e,o){Object.defineProperty(o,"__esModule",{value:!0});var s=function(){function t(i){babelHelpers.classCallCheck(this,t),this._autoPlay=!!i.autoPlay,this._is3d=!!i.is3d,this._loop=!!i.loop,this._muted=!!i.muted,this._position=i.position,this._transition=0,this._volume=void 0!==i.volume?i.volume:1;var e=i.source,o="string"==typeof e?e:e.uri;if(!o)throw new Error("Invalid audio source");this._source=o}return babelHelpers.createClass(t,[{key:"getNode",value:function(){return this._node}},{key:"getSource",value:function(){return this._source}},{key:"is3D",value:function(){return this._is3d}},{key:"play",value:function(t){var i=this._node;i&&(t&&this.setParams(t),i.setLoop(this._loop),i.setMuted(this._muted),i.setVolume(this._volume),this._position&&i.setPosition(this._position),i.start({is3d:this.is3D()}))}},{key:"stop",value:function(){this._node&&this._node.stop()}},{key:"frame",value:function(t){if(this._node&&0!==this._transition){var i=this._node,e=this._transition*t,o=i.getVolume(),s=o+e;this._transition>0?s>this._volume&&(s=this._volume,this._transition=0):s<this._volume&&(s=this._volume,this._transition=0),i.setVolume(s)}}},{key:"setNode",value:function(t){this._node=t,this._autoPlay&&this.play()}},{key:"setVolume",value:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=this._volume;if(this._volume=t,0===i)return this._transition=0,void(this._node&&this._node.setVolume(t));var o=t-e;this._transition=o/i}},{key:"setLoop",value:function(t){this._loop=t,this._node&&this._node.setLoop(t)}},{key:"setMuted",value:function(t){this._muted=t,this._node&&this._node.setMuted(t)}},{key:"setPosition",value:function(t){this._position=t,this._node&&this._node.setPosition(t)}},{key:"setParams",value:function(t){void 0!==t.loop&&this.setLoop(t.loop),void 0!==t.muted&&this.setMuted(t.muted),void 0!==t.position&&this.setPosition(t.position),void 0!==t.volume&&this.setVolume(t.volume,t.fadeTime)}}]),t}();o.default=s},139);
__d(function(e,n,t,i){Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function e(n,t){var i=this;babelHelpers.classCallCheck(this,e),this._ctx=t,this._panner=t.createPanner(),this._playing=!1,this._source=t.createBufferSource(),this._source.buffer=n,this._gain=t.createGain(),this._source.connect(this._gain),this._onEnd=null,this._source.onended=function(e){i._playing=!1,i._onEnd&&i._onEnd()},this._volume=1}return babelHelpers.createClass(e,[{key:"isPlaying",value:function(){return this._playing}},{key:"setBuffer",value:function(e){this._source.buffer=e}},{key:"setLoop",value:function(e){this._source.loop=e}},{key:"setVolume",value:function(e){this._volume=e,this._gain.gain.setValueAtTime(Math.max(1e-5,Math.min(1,e)),this._ctx.currentTime)}},{key:"getVolume",value:function(){return this._volume}},{key:"setMuted",value:function(e){e?this._gain.gain.setValueAtTime(1e-5,this._ctx.currentTime):this._gain.gain.setValueAtTime(this._volume,this._ctx.currentTime)}},{key:"setPosition",value:function(e){this._panner.setPosition(e[0],e[1],e[2])}},{key:"start",value:function(e){this._playing=!0;var n=this._gain;e&&e.is3d&&(this._gain.connect(this._panner),this._panner.panningModel="HRTF",this._panner.distanceModel="inverse",this._panner.coneInnerAngle=360,this._panner.coneOuterAngle=0,this._panner.coneOuterGain=0,n=this._panner),n.connect(this._ctx.destination),this._source.start()}},{key:"stop",value:function(){this._playing&&(this._playing=!1,this._source.stop())}},{key:"onEnd",value:function(e){this._onEnd=e}}]),e}();i.default=s},140);
__d(function(e,t,r,l){Object.defineProperty(l,"__esModule",{value:!0});var o=t(19),n=babelHelpers.interopRequireDefault(o),s=function(e){function t(e){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"EnvironmentModule"));return r._env=e,r}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"loadScene",value:function(e){return"black"===e.type?void this._env.setSource(null):"photo"===e.type?void this._env.setSource(e.url,{format:e.stereo}):void("video"===e.type&&this._env.setVideoSource(e.player))}}]),t}(n.default);l.default=s},141);
__d(function(e,r,a,t){Object.defineProperty(t,"__esModule",{value:!0}),r(143);var l=r(19),s=babelHelpers.interopRequireDefault(l),o=function(e){function r(e){babelHelpers.classCallCheck(this,r);var a=babelHelpers.possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,"VideoModule"));return a._videoPlayers=e,a.allowCreatePlayer=!0,a}return babelHelpers.inherits(r,e),babelHelpers.createClass(r,[{key:"_applyParams",value:function(e,r){void 0!==r.muted&&e.setMuted(!!r.muted),void 0!==r.volume&&e.setVolume(r.volume)}},{key:"createPlayer",value:function(e){this._videoPlayers.createPlayer(e)}},{key:"destroyPlayer",value:function(e){this._videoPlayers.destroyPlayer(e)}},{key:"play",value:function(e,r){var a=this._videoPlayers.getPlayer(e);if(a){var t=r.source,l=babelHelpers.objectWithoutProperties(r,["source"]),s=null;if(Array.isArray(t)){s=t[0].url;for(var o=a.constructor.getSupportedFormats(),u=0;u<t.length;u++){var i=t[u],n=i.fileFormat||i.url.substr(i.url.lastIndexOf("."));if(o.indexOf(n)>0){s=i.url;break}}}else s=t.url;if(!s)throw new Error("Cannot play video, unsupported format");this._applyParams(a,l);var y=l.stereo||"2D";a.setSource(s,y),a.load().then(function(){return a.play()})}}},{key:"pause",value:function(e){var r=this._videoPlayers.getPlayer(e);r&&r.pause()}},{key:"resume",value:function(e){var r=this._videoPlayers.getPlayer(e);r&&r.play()}},{key:"stop",value:function(e){var r=this._videoPlayers.getPlayer(e);r&&(r.pause(),r.seekTo(0))}},{key:"seek",value:function(e,r){var a=this._videoPlayers.getPlayer(e);a&&a.seekTo(r)}},{key:"setParams",value:function(e,r){var a=this._videoPlayers.getPlayer(e);a&&this._applyParams(a,r)}}]),r}(s.default);t.default=o},142);
__d(function(n,_,c,d){},143);
__d(function(e,t,r,i){function s(e,t,r){if(e.visible!==!1){e.raycast(t,r);for(var i=e.children,n=0,o=i.length;n<o;n++)s(i[n],t,r)}}Object.defineProperty(i,"__esModule",{value:!0});var n=t(35),o=babelHelpers.interopRequireWildcard(n),a=t(110),u=babelHelpers.interopRequireDefault(a),c=t(104),l=babelHelpers.interopRequireDefault(c),h=t(15),f=babelHelpers.interopRequireDefault(h);t(111),t(129);var g=t(145),v=babelHelpers.interopRequireDefault(g),y=t(17),d=new o.Raycaster,p=[],b=4,S=function(){function e(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};babelHelpers.classCallCheck(this,e),this._rootLocations=[],this._cursorIntersectsSurface=!1;var s=!1;this.executor=i.executor||new f.default({enableDevTools:s}),this.guiSys=new v.default(t,{}),this.context=new y.ReactNativeContext(this.guiSys,this.executor,{assetRoot:i.assetRoot,customViews:i.customViews||[]});var n=i.nativeModules;if(n)for(var o=0;o<n.length;o++){var a=n[o];"function"==typeof a?this.context.registerModule(a(this.context)):this.context.registerModule(a)}this.context.init(r)}return babelHelpers.createClass(e,[{key:"createRootView",value:function(e,t,r){if(r instanceof l.default){this.guiSys.registerOffscreenRender(r.getScene(),r.getCamera(),r.getRenderTarget());var i=this.context.createRootView(e,t,r.getScene(),!0);return i}if(r instanceof u.default){var s=new o.Object3D;s.position.fromArray(r.worldPosition),s.quaternion.fromArray(r.worldRotation),this.guiSys.root.add(s),this._rootLocations.push({location:r,node:s});var n=this.context.createRootView(e,t,s);return n}throw new Error("Invalid mount point")}},{key:"frame",value:function(e,t){this.guiSys.frameRenderUpdates(e),this.context.frame(e);var r=this.guiSys.getOffscreenRenders();for(var i in r)if(r.hasOwnProperty(i)){var s=r[i],n=t.getClearColor(),o=t.getClearAlpha(),a=t.sortObjects,u=t.localClippingEnabled;t.localClippingEnabled=!0,t.setClearColor("#000",0),t.sortObjects=!1,t.render(s.scene,s.camera,s.renderTarget,!0),t.sortObjects=a,t.setClearColor(n,o),t.setRenderTarget(null),t.localClippingEnabled=u}for(var c=0;c<this._rootLocations.length;c++){var l=this._rootLocations[c],h=l.location,f=l.node;if(h.isDirty()){var g=h.worldPosition;f.position.set(g[0],g[1],g[2]);var v=h.worldRotation;f.quaternion.set(v[0],v[1],v[2],v[3]),h.clearDirtyFlag()}}}},{key:"queueEvents",value:function(e){for(var t=0;t<e.length;t++)this.guiSys.eventDispatcher.dispatchEvent({type:"InputChannelEvent",args:e[t]})}},{key:"setRays",value:function(e,t,r){if(e.length<1)return void this.guiSys.updateLastHit(null,"");var i=e[0],s=null;d.ray.origin.fromArray(i.origin),d.ray.direction.fromArray(i.direction);for(var n=d.intersectObject(this.guiSys.root,!0),o=!1,a=0;a<n.length;a++){var u=n[a];if(u.uv&&u.object&&u.object.subScene){o=!0;var c=u.distance,l=u.object.subScene,h=u.uv.x*l._rttWidth,f=(1-u.uv.y)*l._rttHeight,g=this.surfaceRaycast(l,h,f);g&&(u=g,u.distance=c)}s||u.isAlmostHit||(s=u)}this.setIntersection(s,i,o)}},{key:"surfaceRaycast",value:function(e,t,r){return d.ray.origin.set(t,r,.1),d.ray.direction.set(0,0,-1),p.length=0,s(e,d,p),0===p.length?null:p[p.length-1]}},{key:"setIntersection",value:function(e,t,r){this._cursorIntersectsSurface=!!r,e?(this.guiSys.updateLastHit(e.object,t.type),this.guiSys._cursor.intersectDistance=e.distance):this.guiSys.updateLastHit(null,t.type),this.guiSys.setCursorProperties(t.origin.slice(),t.direction.slice(),t.drawsCursor)}},{key:"set2DRays",value:function(e,t){if(e.length<1)return void this.guiSys.updateLastHit(null,"");var r=e[0],i=this.surfaceRaycast(t.getScene(),r.origin[0],r.origin[1]);this.setIntersection(i,r,!0)}},{key:"isMouseCursorActive",value:function(){return this.guiSys.mouseCursorActive}},{key:"isCursorActive",value:function(){if(this._cursorIntersectsSurface)return!0;var e=this.guiSys._cursor.lastHit,t=this.guiSys._cursor.lastAlmostHit,r=e&&e.isInteractable;return r||(r=t&&t.isInteractable),!!r}},{key:"getCursorDepth",value:function(){return this._cursorIntersectsSurface?b:this.guiSys._cursor.intersectDistance}}]),e}();i.default=S},144);
__d(function(e,t,s,r){function i(e,t){var s=e.elements[12]-t.elements[12],r=e.elements[13]-t.elements[13],i=e.elements[14]-t.elements[14];return Math.sqrt(s*s+r*r+i*i)}function a(e,t,s,r,n){if(e.renderGroup){var o=i(e.matrixWorld,s.camera.matrixWorld);o+=e.zOffset||0,r=s.renderOrder,"UIView"===e.type&&(o=Math.max(0,s.camera.far-o)),s.distances[r]=Math.floor(o*p)<<_}if(s.renderOrder++,e.renderOrder=s.distances[r]+s.renderOrder,"UIView"===e.type){var u=e.calcWorldClipRect();t*=e.opacity,e.setClipPlanes(n),e.applyUpdates(t,s),n=[Math.max(n[0],u[0]),Math.max(n[1],u[1]),Math.min(n[2],u[2]),Math.min(n[3],u[3])]}else"SDFText"===e.type&&(e.textClip[0]=n[0],e.textClip[1]=n[1],e.textClip[2]=n[2],e.textClip[3]=n[3]);for(var c in e.children)a(e.children[c],t,s,r,n)}function n(e,t){"UIView"===e.type&&"on"===e.billboarding&&e.updateBillboard(t);for(var s in e.children)n(e.children[s],t)}function o(e,t,s){if(e.visible!==!1){e.raycast(t,s);for(var r=e.children,i=0,a=r.length;i<a;i++)o(r[i],t,s)}}Object.defineProperty(r,"__esModule",{value:!0});var u=t(35),c=babelHelpers.interopRequireWildcard(u),l=t(58),h=t(33),d=t(60),v=.001,y=2,f=.025,p=64,_=9,m=300,g=0,C=new c.Raycaster,b=new c.Vector3,H=new c.Quaternion,k=function(){function e(t){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};babelHelpers.classCallCheck(this,e),this.root=t,this.guiRoot=new c.Object3D,this.root.add(this.guiRoot),this.isVRPresenting=!1,this._requestFrames={},this._offscreenRenders={},this._offscreenRenderUID=1,this._cursor={intersectDistance:0,lastHit:null,lastAlmostHit:null,source:null,rayOrigin:null,rayDirection:null,lastHitCache:[],drawsCursor:!1,lastLocalX:null,lastLocalY:null,lastHitImmediateListeners:null},this.ZOffsetScale=v,this.mouseOffset=null,this.mouseCursorInactiveStyle="default",this.mouseCursorActiveStyle="pointer",this.mouseCursorActive=!1,this.touchReleaseDelay=m,this.cursorVisibility="hidden",this.cursorAutoDepth=!0,this.cursorFixedDistance=y,s.font||(s.font=(0,l.loadFont)()),s.raycasters||(s.raycasters=[]),void 0!==s&&(0,d.setParams)(this,s),this.eventDispatcher=new c.EventDispatcher,this._inputEventSources=[],window.addEventListener("vrdisplaypresentchange",this._onPresentChange.bind(this))}return babelHelpers.createClass(e,[{key:"add",value:function(e,t){t?t.add(e):this.guiRoot.add(e)}},{key:"remove",value:function(e){e.parent&&e.parent.remove(e)}},{key:"requestFrameFunction",value:function(e){var t=g++;return this._requestFrames[t]=e,t}},{key:"cancelFrameFunction",value:function(e){delete this._requestFrames[e]}},{key:"applyUpdates",value:function(e,t){var s={camera:e,renderOrder:0,distances:[Math.floor(e.far*p)<<_],distancesNode:[null]};return a(t,1,s,0,[-16384,-16384,16384,16384]),t.updateMatrixWorld(),s}},{key:"frameRenderUpdates",value:function(e){var t=Date.now(),s=this._requestFrames;this._requestFrames={};for(var r in s)s[r](t);for(var i in this._offscreenRenders){var a=this._offscreenRenders[i];this.applyUpdates(a.camera,a.scene)}var o=this.applyUpdates(e,this.root);if(this.isVRPresenting||n(this.root,o),this._raycasters)for(var u=0;u<this._raycasters.length;u++)"function"==typeof this._raycasters[u].frame&&this._raycasters[u].frame(t);"hidden"===this.cursorVisibility||this.cursorMesh||this.addCursor()}},{key:"frameInputEvents",value:function(e,t){if(this._raycasters){for(var s=null,r=null,i=null,a=1/0,n=0;(!r||!i)&&n<this._raycasters.length;)s=this._raycasters[n],r=s.getRayOrigin(e),i=s.getRayDirection(e),a="function"==typeof s.getMaxLength?s.getMaxLength():1/0,n++;this._processRayData(e.getWorldPosition(),e.getWorldQuaternion(),r,i,a,s?s.getType():null,s?s.drawsCursor():null)}var o=t?t.domElement:null;this._domElement=o,this._fireInputEvents(o),this._updateMouseCursorStyle(o)}},{key:"_processRayData",value:function(e,t,s,r,i,a,n){if(s&&r){e instanceof c.Vector3?b.copy(e):b.set(e[0],e[1],e[2]),t instanceof c.Quaternion?H.copy(t):H.set(t[0],t[1],t[2],t[3]);var u=null,l=null;C.ray.origin.set(b.x+s[0],b.y+s[1],b.z+s[2]),C.ray.direction.fromArray(r),C.ray.direction.normalize(),C.ray.direction.applyQuaternion(H),C.far=i;for(var h=[C.ray.direction.x,C.ray.direction.y,C.ray.direction.z],d=C.intersectObject(this.root,!0),v=0;v<d.length;v++){var y=d[v];if(y.uv&&y.object&&y.object.subScene){var f=y.distance,p=y.object.subScene;C.ray.origin.set(p._rttWidth*y.uv.x,p._rttHeight*(1-y.uv.y),.1),C.ray.direction.set(0,0,-1);var _=[];if(o(p,C,_),0===_.length)continue;y=_[_.length-1],y.distance=f}u||y.isAlmostHit||(u=y),!l&&y.isAlmostHit&&(l=y)}u?(this.updateLastHit(u.object,a),u.uv&&(this._cursor.lastLocalX=u.uv.x,this._cursor.lastLocalY=u.uv.y),this._cursor.intersectDistance=u.distance):(this.updateLastHit(null,a),this._cursor.lastLocalX=null,this._cursor.lastLocalY=null),"auto"===this.cursorVisibility&&(!l||u&&u.object.isInteractable?this._cursor.lastAlmostHit=null:(this._cursor.lastAlmostHit=l.object,this._cursor.intersectDistance=l.distance)),this.setCursorProperties([b.x+s[0],b.y+s[1],b.z+s[2]],h,n)}else this.setLastHit(null,null),this.setCursorProperties(null,null,!1)}},{key:"setLastHit",value:function(e,t){this._cursor.lastHit=e,this._cursor.source=t}},{key:"setCursorProperties",value:function(e,t,s){this._cursor.rayOrigin=e,this._cursor.rayDirection=t,this._cursor.drawsCursor=s}},{key:"frame",value:function(e,t){this.frameRenderUpdates(e),this.frameInputEvents(e,t),this.updateCursor(e)}},{key:"updateLastHit",value:function(e,t){for(var s=[],r=[],i=e,a=[];i;)"UIView"===i.type&&a.push(i),i=i.parent;var n=null;this.mouseCursorActive=!1;for(var o=a.length-1;o>=0&&(a[o].shouldAcceptHitEvent()&&(n=a[o].id,s[a[o].id]=a[o],a[o].immediateListener&&r.push(a[o].immediateListener),a[o].isMouseInteractable&&(this.mouseCursorActive=!0)),!a[o].shouldInterceptHitEvent());o--);i=null!==n&&s[n]?s[n]:null,this._cursor.lastHit===i&&this._cursor.source===t||(this.eventDispatcher.dispatchEvent(new h.GuiSysEvent(h.GuiSysEventType.HIT_CHANGED,{lastHit:this._cursor.lastHit,currentHit:i,lastSource:this._cursor.source,currentSource:t})),this._cursor.lastHit=i,this._cursor.source=t);for(var u in this._cursor.lastHitCache)s[u]||this.eventDispatcher.dispatchEvent(new h.UIViewEvent(this._cursor.lastHitCache[u],h.UIViewEventType.FOCUS_LOST,{target:this._cursor.lastHit,source:this._cursor.source}));for(var c in s)this._cursor.lastHitCache[c]||this.eventDispatcher.dispatchEvent(new h.UIViewEvent(s[c],h.UIViewEventType.FOCUS_GAINED,{target:this._cursor.lastHit,source:this._cursor.source}));this._cursor.lastHitCache=s,this._cursor.lastHitImmediateListeners=r}},{key:"addCursor",value:function(){this.cursorMesh=this.makeDefaultCursor(),this.cursorMesh.raycast=function(){return null},this.root.add(this.cursorMesh),this.cursorMesh.visible=!1,this.cursorMesh.material.depthTest=!1,this.cursorMesh.material.depthWrite=!1,this.cursorMesh.renderOrder=1}},{key:"updateCursor",value:function(e){var t=this.cursorAutoDepth&&null!==this._cursor.lastHit?this._cursor.intersectDistance:this.cursorFixedDistance,s=this._cursor.rayOrigin,r=this._cursor.rayDirection;if(this.cursorMesh&&"hidden"!==this.cursorVisibility&&s&&r){var i=s[0]+r[0]*t,a=s[1]+r[1]*t,n=s[2]+r[2]*t;if(this.cursorMesh.position.set(e.position.x+i,e.position.y+a,e.position.z+n),this.cursorMesh.rotation.copy(e.getWorldRotation()),this.cursorAutoDepth){var o=Math.sqrt(i*i+a*a+n*n);this.cursorMesh.scale.set(o,o,o)}}if(this.cursorMesh){var u=!1;"auto"===this.cursorVisibility&&(u=null!==this._cursor.lastHit&&this._cursor.lastHit.isInteractable,u||(u=null!==this._cursor.lastAlmostHit&&this._cursor.lastAlmostHit.isInteractable)),this.cursorMesh.visible=this._cursor.drawsCursor&&("visible"===this.cursorVisibility||u)&&null!==s&&null!==r}}},{key:"makeDefaultCursor",value:function(){var e=document.createElement("canvas");e.width=256,e.height=256;var t=e.getContext("2d");t.beginPath(),t.arc(128,128,95,0,2*Math.PI),t.strokeStyle="rgba(256, 256, 256, 1)",t.fillStyle="rgba(256, 256, 256, 0.8)",t.lineWidth=25,t.stroke(),t.fill();var s=new c.Texture(e);s.needsUpdate=!0;var r=new c.MeshBasicMaterial({transparent:!0,opacity:1,side:c.DoubleSide,map:s}),i=new c.Mesh(new c.PlaneGeometry(f,f),r);return i}},{key:"_updateMouseCursorStyle",value:function(e){var t=this.mouseCursorActive?this.mouseCursorActiveStyle:this.mouseCursorInactiveStyle;e&&e.style&&(e.style.cursor=t,e.style.cursor="-webkit-"+t,e.style.cursor="-moz-"+t)}},{key:"_onPresentChange",value:function(e){this.isVRPresenting=e.display.isPresenting}},{key:"_fireInputEvents",value:function(e){for(var t=[],s=0;s<this._inputEventSources.length;s++){var r=this._inputEventSources[s];"function"==typeof r.getTarget&&r.getTarget()!==e&&r.setTarget(e);var i=r.getEvents();i&&(t=t.concat(i))}for(var a=0;a<t.length;a++)this.eventDispatcher.dispatchEvent(new h.GuiSysEvent(h.GuiSysEventType.INPUT_EVENT,{target:this._cursor.lastHit,source:this._cursor.source,inputEvent:t[a]}))}},{key:"_onTouchImmediate",value:function(e){var t=this._cursor.lastHitImmediateListeners;if(t)for(var s=0;s<t.length;s++)t[s].eventType===e.eventType&&t[s].callback(e)}},{key:"registerOffscreenRender",value:function(e,t,s){var r=this._offscreenRenderUID++;return this._offscreenRenders[r]={scene:e,camera:t,renderTarget:s},r}},{key:"unregisterOffscreenRender",value:function(e){e&&delete this._offscreenRenders[e]}},{key:"getOffscreenRenders",value:function(){return this._offscreenRenders}},{key:"setFont",value:function(e){this.font=e}},{key:"setMouseCursorInactiveStyle",value:function(e){this.mouseCursorInactiveStyle=e}},{key:"setMouseCursorActiveStyle",value:function(e){this.mouseCursorActiveStyle=e}},{key:"setCursorVisibility",value:function(e){var t=["visible","hidden","auto"];return t.includes(e)?void(this.cursorVisibility=e):void console.warn("Unknown cursorVisibility: "+e+" expected",t)}},{key:"setCursorAutoDepth",value:function(e){this.cursorAutoDepth=e}},{key:"setCursorFixedDistance",value:function(e){this.cursorFixedDistance=e}},{key:"setRaycasters",value:function(e){if(!Array.isArray(e))throw new Error("GuiSys raycasters must be an array of RayCaster objects");this._raycasters=e}},{key:"getLastLocalIntersect",value:function(){return null===this._cursor.lastLocalX||null===this._cursor.lastLocalY?null:[this._cursor.lastLocalX,this._cursor.lastLocalY]}}]),e}();r.default=k},145);
__d(function(e,d,o,a){Object.defineProperty(a,"__esModule",{value:!0}),a.getSupportedFormats=a.addCustomizedVideoPlayer=a.VRVideoComponent=a.BasicVideoPlayer=void 0;var t=d(38),i=babelHelpers.interopRequireDefault(t),r=d(40),l=babelHelpers.interopRequireDefault(r),u=d(37),p=d(39),s=babelHelpers.interopRequireDefault(p);a.BasicVideoPlayer=i.default,a.VRVideoComponent=l.default,a.addCustomizedVideoPlayer=u.addCustomizedVideoPlayer,a.getSupportedFormats=s.default},146);
__d(function(e,i,t,n){Object.defineProperty(n,"__esModule",{value:!0});var s=i(12),o=null,r=function(e){function i(e){babelHelpers.classCallCheck(this,i);var t=babelHelpers.possibleConstructorReturn(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,"ConexionModule"));return t._rnctx=e,t.winSource=void 0,t.origin=void 0,t.handleMark=t.handleMark.bind(t),t}return babelHelpers.inherits(i,e),babelHelpers.createClass(i,[{key:"conexionIframe",value:function(e){var i=this,t=new Promise(function(e,i){window.addEventListener("message",function(i){this.winSource=i.source,this.origin=i.origin,i.data.audioBack&&this.winSource.postMessage(JSON.stringify({msg:"Estado audio recibido correctamente"}),this.origin),i.data.urlBack&&this.winSource.postMessage(JSON.stringify({msg:"Url Back recibida correctamente"}),this.origin),i.data.imagenBack&&this.winSource.postMessage(JSON.stringify({msg:"Imagen Back recibida correctamente"}),this.origin),i.data.imgs&&this.winSource.postMessage(JSON.stringify({msg:"Im\xe1genes recibidas correctamente"}),this.origin),i.data.showPanel&&this.winSource.postMessage(JSON.stringify({msg:"Show Panel recibido correctamente"}),this.origin),i.data.marks&&this.winSource.postMessage(JSON.stringify({msg:"Marks recibidas correctamente"}),this.origin),e(i.data)}),function(){console.log("Problemas con la promesa")}});t.then(function(t){i._rnctx&&i._rnctx.invokeCallback(e,[t])});var n=decodeURIComponent(window.location.search);try{var s=n.split("?id="),r=s[1],a=r.split("&visor="),c=a[0];o=c,window.parent.postMessage(JSON.stringify({msg:"LOAD",id:c}),"*")}catch(e){console.log(e)}}},{key:"enVisor",value:function(e){var i=decodeURIComponent(window.location.search);try{var t=i.split("?id="),n=t[1],s=n.split("&visor="),o=s[1];this._rnctx&&this._rnctx.invokeCallback(e,[o])}catch(e){}}},{key:"handleMark",value:function(e,i){window.parent.postMessage(JSON.stringify({msg:"MARK",id:i,mark:e}),"*")}},{key:"handlePosition",value:function(e){window.parent.postMessage(JSON.stringify({msg:"POSITION",id:o,position:e}),"*")}}]),i}(s.Module);n.default=r},147);
;require(0);