diff --git a/src/lib/viewers/box3d/Box3DRenderer.js b/src/lib/viewers/box3d/Box3DRenderer.js index 627cd67b5..a6ef8826c 100644 --- a/src/lib/viewers/box3d/Box3DRenderer.js +++ b/src/lib/viewers/box3d/Box3DRenderer.js @@ -526,7 +526,7 @@ class Box3DRenderer extends EventEmitter { // If there are common entities for left-right controllers, load them first. if (!this.vrCommonLoadPromise) { if (commonEntities) { - this.vrCommonLoadPromise = this.box3d.addRemoteEntities( + this.vrCommonLoadPromise = this.box3d.importEntitiesFromUrl( `${this .staticBaseURI}third-party/model3d/${MODEL3D_STATIC_ASSETS_VERSION}/WebVR/${commonEntities}/entities.json`, { isExternal: true } @@ -537,7 +537,7 @@ class Box3DRenderer extends EventEmitter { } if (!this.vrGamepadLoadPromises[controllerName]) { this.vrGamepadLoadPromises[controllerName] = this.vrCommonLoadPromise.then(() => { - return this.box3d.addRemoteEntities( + return this.box3d.importEntitiesFromUrl( `${this .staticBaseURI}third-party/model3d/${MODEL3D_STATIC_ASSETS_VERSION}/WebVR/${controllerName}/entities.json`, { isExternal: true } diff --git a/src/lib/viewers/box3d/image360/Image360Renderer.js b/src/lib/viewers/box3d/image360/Image360Renderer.js index d9b4e43f3..f5be44a9e 100644 --- a/src/lib/viewers/box3d/image360/Image360Renderer.js +++ b/src/lib/viewers/box3d/image360/Image360Renderer.js @@ -89,7 +89,7 @@ class Image360Renderer extends Box3DRenderer { */ loadPanoramaFile(assetUrl) { /* istanbul ignore next */ - return this.box3d.addRemoteEntities(assetUrl).then( + return this.box3d.importEntitiesFromUrl(assetUrl).then( () => { this.imageAsset = this.box3d.getAssetByClass(Box3D.ImageAsset); this.textureAsset = this.box3d.createTexture2d(); diff --git a/src/lib/viewers/box3d/model3d/Model3DRenderer.js b/src/lib/viewers/box3d/model3d/Model3DRenderer.js index 2a7a75632..1646e1b1b 100644 --- a/src/lib/viewers/box3d/model3d/Model3DRenderer.js +++ b/src/lib/viewers/box3d/model3d/Model3DRenderer.js @@ -640,7 +640,7 @@ class Model3DRenderer extends Box3DRenderer { const camera = cameraObject.runtimeData; camera.position.set(0, 0, orbitController.getOrbitDistance()); camera.position.applyQuaternion(camera.quaternion); - camera.position.add(orbitController.originPoint); + camera.position.add(orbitController.pivotPoint.position); } /** diff --git a/src/lib/viewers/box3d/model3d/__tests__/Model3DRenderer-test.js b/src/lib/viewers/box3d/model3d/__tests__/Model3DRenderer-test.js index 6cb8add6c..07e852654 100644 --- a/src/lib/viewers/box3d/model3d/__tests__/Model3DRenderer-test.js +++ b/src/lib/viewers/box3d/model3d/__tests__/Model3DRenderer-test.js @@ -65,7 +65,7 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { when: () => {} }; renderer.box3d = { - addRemoteEntities: () => Promise.resolve(), + importEntitiesFromUrl: () => Promise.resolve(), canvas: { addEventListener: () => {}, removeEventListener: () => {} @@ -964,7 +964,8 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { position = sandbox.mock(pos); quaternion = { x: 1, y: 2, z: 3, w: 1 }; orbitCam = { - getOrbitDistance: () => orbitDist + getOrbitDistance: () => orbitDist, + pivotPoint: {position: pos} }; camera = { runtimeData: { diff --git a/src/third-party/model3d/1.12.0/box3d-runtime.min.js b/src/third-party/model3d/1.12.0/box3d-runtime.min.js index 0aaeca9f0..cc9beafe9 100644 --- a/src/third-party/model3d/1.12.0/box3d-runtime.min.js +++ b/src/third-party/model3d/1.12.0/box3d-runtime.min.js @@ -1,2 +1,2 @@ -(function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("THREE")):"function"==typeof define&&define.amd?define("Box3D",["THREE"],t):"object"==typeof exports?exports.Box3D=t(require("THREE")):e.Box3D=t(e.THREE)})(this,function(e){return function(e){function t(i){if(r[i])return r[i].exports;var n=r[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,i){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=243)}([function(e,t,r){"use strict";function i(e,t){function r(){this.constructor=e}v(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function n(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,i=Object.getOwnPropertySymbols(e);n=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,r,o):n(t,r))||o);return a>3&&o&&Object.defineProperty(t,r,o),o}function o(e,t){return function(r,i){t(r,i,e)}}function s(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t,r,i){return new(r||(r=Promise))(function(n,a){function o(e){try{u(i.next(e))}catch(e){a(e)}}function s(e){try{u(i.throw(e))}catch(e){a(e)}}function u(e){e.done?n(e.value):new r(function(t){t(e.value)}).then(o,s)}u((i=i.apply(e,t||[])).next())})}function p(e,t){function r(e){return function(t){return i([e,t])}}function i(r){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,a&&(o=a[2&r[0]?"return":r[0]?"throw":"next"])&&!(o=o.call(a,r[1])).done)return o;switch(a=0,o&&(r=[0,o.value]),r[0]){case 0:case 1:o=r;break;case 4:return u.label++,{value:r[1],done:!1};case 5:u.label++,a=r[1],r=[0];continue;case 7:r=u.ops.pop(),u.trys.pop();continue;default:if(o=u.trys,!(o=o.length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){u=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}function l(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o}function d(){for(var e=[],t=0;t1||n(e,t)})})}function n(e,t){try{a(c[e](t))}catch(e){u(h[0][3],e)}}function a(e){e.value instanceof f?Promise.resolve(e.value.v).then(o,s):u(h[0][2],e)}function o(e){n("next",e)}function s(e){n("throw",e)}function u(e,t){e(t),h.shift(),h.length&&n(h[0][0],h[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var p,c=r.apply(e,t||[]),h=[];return p={},i("next"),i("throw"),i("return"),p[Symbol.asyncIterator]=function(){return this},p}function y(e){function t(t,n){e[t]&&(r[t]=function(r){return(i=!i)?{value:f(e[t](r)),done:"return"===t}:n?n(r):r})}var r,i;return r={},t("next"),t("throw",function(e){throw e}),t("return"),r[Symbol.iterator]=function(){return this},r}function g(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator];return t?t.call(e):"function"==typeof h?h(e):e[Symbol.iterator]()}Object.defineProperty(t,"__esModule",{value:!0}),t.__extends=i,r.d(t,"__assign",function(){return b}),t.__rest=n,t.__decorate=a,t.__param=o,t.__metadata=s,t.__awaiter=u,t.__generator=p,t.__exportStar=c,t.__values=h,t.__read=l,t.__spread=d,t.__await=f,t.__asyncGenerator=m,t.__asyncDelegator=y,t.__asyncValues=g;var v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},b=Object.assign||function(e){for(var t,r=1,i=arguments.length;r=e&&(t.engine.off("update",i,t),t.trigger("endTimer"))};this.engine.on("update",i,this)},t.events={load:{parameters:[],action:!1,category:"Loading"},loadBase:{parameters:[],action:!1,category:"Loading"},loadDependencies:{parameters:[],action:!1,category:"Loading"},startTimer:{parameters:[{name:"time",description:"The time (in seconds) that will elapse before the 'endTimer' event will be fired.",type:"f",default:5}],action:!0,category:"General"},endTimer:{parameters:[],action:!1,category:"General"}},t.validators={},t.defaults={},t.schema={},t}(t.baseEntityMixins);t.default=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(9),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.initialize=function(){e.prototype.initialize.call(this),this.on("setVisible",this.setVisible,this),this.on("setInvisible",this.setInvisible,this),this.on("toggleVisibility",this.toggleVisibility,this),this.on("change:children",this.onChildrenChanged,this)},t.prototype.uninitialize=function(){this.off("setVisible",this.setVisible,this),this.off("setInvisible",this.setInvisible,this),this.off("toggleVisibility",this.toggleVisibility,this),this.off("change:children",this.onChildrenChanged,this),this.uninitPrefabBindings(),e.prototype.uninitialize.call(this)},t.prototype.getRootObject=function(){var e=this.getParentObject();return e?e.getRootObject():this},t.prototype.reset=function(){this.runtimeData&&(this.runtimeData.position.copy(this.getPosition()),this.runtimeData.quaternion.copy(this.getQuaternion()),this.runtimeData.scale.copy(this.getScale()))},t.prototype.createRuntimeData=function(e){this.runtimeData=new a.Object3D,this.runtimeData.name=this.getRuntimeName(),e()},t.prototype.clone=function(t,r){void 0===r&&(r=!0);var i=e.prototype.clone.call(this,t);if(i.set("parentId",null),i.set("prefabAssetId",this.get("prefabAssetId")),i.set("prefabObjectId",this.get("prefabObjectId")),r){this.getChildren().forEach(function(e){var t=e.clone(void 0,r);i.addChild(t)}),this.isInstanceTop()&&i.traverse(function(e){e.set("prefabInstanceId",i.id)})}return i},t.prototype.alignToPosition=function(e,t){var r=new a.Vector3(e.x||0,e.y||0,e.z||0),n=this.getQuaternion(),o=this.getScale(),s=this.getCenter(),u=new a.Quaternion(n.x,n.y,n.z,n.w),p=this.getBounds(),c={};c.min=new a.Vector3(p.min.x,p.min.y,p.min.z),c.max=new a.Vector3(p.max.x,p.max.y,p.max.z),(c.min.x>c.max.x||c.min.y>c.max.y||c.min.z>c.max.z)&&(c.min.x=c.min.y=c.min.z=0,c.max.x=c.max.y=c.max.z=0),c.min.applyQuaternion(u),c.max.applyQuaternion(u);var h=new a.Vector3(s.x,s.y,s.z);h.applyQuaternion(u),c.min.multiply(o),c.max.multiply(o),h.multiply(o),t&&Object.keys(t).forEach(function(e){var i=Math.min(c.min[e],c.max[e]),n=Math.max(c.min[e],c.max[e]),a=.5*t[e]+.5;r[e]-=(1-a)*i+a*n}),this.setProperty("position",i.__assign({},r))},t.prototype.getPosition=function(e){var t=e||new a.Vector3;return t.copy(this.getProperty("position")),t},t.prototype.setPosition=function(e,t,r){if(void 0===r)throw new Error("Calling setPosition with invalid arguments. Expected setPosition( x, y, z ).");this.setProperty("position",{x:e,y:t,z:r})},t.prototype.getQuaternion=function(e){var t=e||new a.Quaternion;return t.copy(this.getProperty("quaternion")),t},t.prototype.setQuaternion=function(e,t,r,i){if(void 0===i)throw new Error("Calling setQuaternion with invalid arguments. Expected setQuaternion( x, y, z, w ).");this.setProperty("quaternion",{x:e,y:t,z:r,w:i})},t.prototype.getScale=function(e){var t=e||new a.Vector3;return t.copy(this.getProperty("scale")),t},t.prototype.setScale=function(e,t,r){if(void 0===r)throw new Error("Calling setScale with invalid arguments. Expected setScale( x, y, z ).");this.setProperty("scale",{x:e,y:t,z:r})},t.prototype.getCenter=function(e){var t=e||new a.Vector3,r=this.getBounds();return t.copy(r.min),t.add(r.max),t.multiplyScalar(.5),t},t.prototype.setVisible=function(){this.setProperty("visible",!0),this.engine.needsRender=!0},t.prototype.setInvisible=function(){this.setProperty("visible",!1),this.engine.needsRender=!0},t.prototype.toggleVisibility=function(){var e=!this.getProperty("visible");this.setProperty("visible",e),this.engine.needsRender=!0},t.prototype.loadBase=function(t){e.prototype.loadBase.call(this,t),this.isInstance()&&this.initPrefabBindings()},t.prototype.reloadBase=function(t){var r=this;this.isInstance()&&this.uninitPrefabBindings();var i=this.runtimeData&&this.runtimeData.parent;i&&i.remove(this.runtimeData);var n=this.runtimeData&&this.runtimeData.children;e.prototype.reloadBase.call(this,function(){i&&i.add(r.runtimeData),n&&n.forEach(function(e){return r.runtimeData.add(e)}),"function"==typeof t&&t()})},t.prototype.unload=function(t){var r=this;if(void 0===t&&(t=!1),this.runtimeData&&this.runtimeData.parent&&this.runtimeData.parent.remove(this.runtimeData),t){this.getChildIds().forEach(function(e){var i=r.engine.getObjectById(e);i&&i.unload(t)})}e.prototype.unload.call(this)},t.prototype.destroy=function(){this.engine.destroyObjectById(this.id)},t.prototype.traverse=function(e){e(this,this.getParentObject()),this.getChildren().forEach(function(t){return t.traverse(e)})},t.prototype.traverseWhile=function(e){return!!e(this,this.getParentObject())||this.getChildren().some(function(t){return t.traverseWhile(e)})},t.prototype.traverseSome=function(e){e(this,this.getParentObject())||this.getChildren().forEach(function(t){return t.traverseSome(e)})},t.prototype.getAncestors=function(e){var t=this.getParentObject();return t?e&&!e(t)?t.getAncestors(e):[t].concat(t.getAncestors(e)):[]},t.prototype.getDescendants=function(e){var t=this,r=[],i="function"!=typeof e;return this.traverse(function(n){n!==t&&(i||e(n))&&r.push(n)}),r},t.prototype.getDescendant=function(e){var t,r=this,i="function"!=typeof e;return this.traverseWhile(function(n){if(n!==r&&!t&&(i||e(n)))return t=n,!0}),t},t.prototype.getDescendantById=function(e){return this.getDescendant(function(t){return t.id===e})},t.prototype.getDescendantByName=function(e){return this.getDescendant(function(t){return t.getName()===e})},t.prototype.getDescendantByType=function(e){return this.getDescendant(function(t){return t.type===e})},t.prototype.getDescendantByClass=function(e){return this.getDescendant(function(t){return t instanceof e})},t.prototype.getDescendantsByType=function(e){return this.getDescendants(function(t){return t.type===e})},t.prototype.getDescendantsByClass=function(e){return this.getDescendants(function(t){return t instanceof e})},t.prototype.getDescendantsByName=function(e){return this.getDescendants(function(t){return t.getName()===e})},t.prototype.getChildById=function(e){return-1!==this.sharedData.children.indexOf(e)?this.engine.getObjectById(e):null},t.prototype.getChild=function(e){var t=this.getChildren(e);return t.length?t[0]:null},t.prototype.getChildren=function(e){var t=this,r="function"!=typeof e;return this.getChildIds().filter(function(i){var n=t.getChildById(i);return n&&(r||e(n))}).map(function(e){return t.engine.getObjectById(e)})},t.prototype.getChildrenMap=function(e){var t={};return this.getChildren(e).forEach(function(e){e&&(t[e.id]=e)}),t},t.prototype.getParentObject=function(){return this.engine.getObjectById(this.get("parentId"))},t.prototype.addChild=function(e,t){this.addChildById(e.id,t)},t.prototype.addChildById=function(e,t){if(!this.engine.getObjectById(e))throw new Error("Can't find child object with id, "+e);this.engine.entityDispatcher.dispatchChildAdded(this.id,e,t)},t.prototype.removeChild=function(e,t){this.removeChildById(e.id,t)},t.prototype.removeChildById=function(e,t){if(!this.getChildById(e))return void n.default.warn("Object, "+e+", is not a child of this object");this.engine.entityDispatcher.dispatchChildRemoved(this.id,e,t)},t.prototype.getChildIds=function(e){return"function"!=typeof e?this.sharedData.children.slice():this.sharedData.children.filter(function(t){return e(t)})},t.prototype.setChildIds=function(e,t){void 0===t&&(t=!1),this.engine.entityDispatcher.dispatchChildChanged(this.id,e,t)},t.prototype.scaleToSize=function(e){var t={},r=this.getBounds();t.min=new a.Vector3(r.min.x,r.min.y,r.min.z),t.max=new a.Vector3(r.max.x,r.max.y,r.max.z);var i=t.min.x>t.max.x||t.min.y>t.max.y||t.min.z>t.max.z,n=t.min.distanceTo(t.max),o=n>0?e/n:1;(o<=0||i)&&(o=1),this.setProperty("scale",{x:o,y:o,z:o})},t.prototype.getBounds=function(e){var t=this.getProperty("bounds"),r=e||new a.Box3;return t?r.set(t.min,t.max):this.computeBounds(r)},t.prototype.getSphericalBounds=function(e){var t=e||new a.Sphere,r=this.getBounds();return t.radius=t.center.subVectors(r.max,r.min).multiplyScalar(.5).length(),t.center.addVectors(r.max,r.min).multiplyScalar(.5),t},t.prototype.getLocalBounds=function(e){var t=e||new a.Box3;return t.min.set(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),t.max.set(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),t},t.prototype.computeBounds=function(e){var t=this.getChildren(),r=this.getLocalBounds(e||new a.Box3),i=new a.Matrix4;return t.forEach(function(e){var t=e.computeBounds();t.isEmpty()||(i.compose(e.getPosition(),e.getQuaternion(),e.getScale()),t.applyMatrix4(i),r.union(t))}),this.setProperty("bounds",{min:{x:r.min.x,y:r.min.y,z:r.min.z},max:{x:r.max.x,y:r.max.y,z:r.max.z}}),r},t.prototype.getPreviousProperty=function(e){if(this.computePropertyFunctions[e]){var t=this.sharedData.previousProperties[e],r=void 0;return r=this.getPrefabObject()?this.getPrefabProperty(e):this.getDefaultProperty(e),this.computePropertyFunctions[e](t,r)}var i=this.sharedData.previousProperties[e];if(void 0!==i)return i;var n=this.getPrefabObject();return n?n.getProperty(e):this.getDefaultProperty(e)},t.prototype.getProperty=function(e){var t=this.getOwnProperty(e);if(this.computePropertyFunctions[e]){var r=void 0;return r=this.getPrefabObject()?this.getPrefabProperty(e):this.getDefaultProperty(e),this.computePropertyFunctions[e](t,r)}if(void 0!==t)return t;var i=this.getPrefabProperty(e);return i||this.getDefaultProperty(e)},t.prototype.getProperties=function(){var e=this,t=this.getDefaultProperties(),r={};return Object.keys(t).forEach(function(t){r[t]=e.getProperty(t)}),r},t.prototype.getInstanceTop=function(){var e=this.get("prefabInstanceId");return e?this.engine.getObjectById(e):null},t.prototype.getPrefabObject=function(){return this.engine.getObjectById(this.get("prefabObjectId"))},t.prototype.getPrefabProperty=function(e){var t=this.getPrefabObject();if(t)return t.getProperty(e)},t.prototype.isInstance=function(){return!!this.get("prefabObjectId")},t.prototype.isInstanceTop=function(){return this.get("prefabInstanceId")===this.id},t.prototype.breakPrefabLink=function(e){if(void 0===e&&(e=!0),!this.isInstance())throw new Error("breakPrefabLink: Can't call this on an entity that isn't an instance.");e&&this.getChildren().forEach(function(t){t.breakPrefabLink(e)}),this.uninitPrefabBindings(),this.mergeProperties(this.getPrefabObject());var t={};t.prefabInstanceId=void 0,t.prefabObjectId=void 0,t.prefabAssetId=void 0},t.prototype.applyPropertiesLoaded=function(t,r){if(e.prototype.applyPropertiesLoaded.call(this,t,r),t.hasOwnProperty("static")){var i=this.getProperty("static");this.runtimeData.matrixAutoUpdate=!i,this.runtimeData.rotationAutoUpdate=!i,i&&(this.runtimeData.matrixWorldNeedsUpdate=!0,this.runtimeData.updateMatrix())}if(t.hasOwnProperty("visible")&&(this.runtimeData.visible=this.getProperty("visible")),t.hasOwnProperty("castShadow")&&(this.runtimeData.castShadow=this.getProperty("castShadow")),t.hasOwnProperty("receiveShadow")&&(this.runtimeData.receiveShadow=this.getProperty("receiveShadow")),t.hasOwnProperty("frustumCulled")&&(this.runtimeData.frustumCulled=this.getProperty("frustumCulled")),t.hasOwnProperty("position")){var n=this.getPosition();this.runtimeData.position.set(n.x,n.y,n.z)}if(t.hasOwnProperty("quaternion")){var a=this.getQuaternion();this.runtimeData.quaternion.set(a.x,a.y,a.z,a.w)}if(t.hasOwnProperty("scale")){var o=this.getScale();this.runtimeData.scale.set(o.x,o.y,o.z)}this.engine.needsRender=!0},t.prototype.getRuntimeName=function(){return this.engine.getRuntimeName(this.getSid())},t.prototype.initPrefabBindings=function(){var e=this.getPrefabObject();e&&e.on("change:properties",this.onPrefabEntityChanged,this)},t.prototype.uninitPrefabBindings=function(){var e=this.getPrefabObject();e&&e.off("change:properties",this.onPrefabEntityChanged,this)},t.prototype.onPrefabEntityChanged=function(){n.default.warn("TODO - re-implement updating from prefab changes")},t.prototype.onChildLoaded=function(e){var t=this;this.when("loadBase",function(){t.runtimeData.add(e.runtimeData),t.engine.needsRender=!0})},t.prototype.onChildrenChanged=function(e,t){var r=this;t.forEach(function(e){e&&(e.set("parentId",null),r.unregisterDependency(e),r.stopListening(e,"loadBase",r.onChildLoaded),r.isBaseLoaded()&&e.isBaseLoaded()&&(r.runtimeData.remove(e.runtimeData),r.engine.needsRender=!0))}),e.forEach(function(e){var t=e.getParentObject();t&&t.id!==r.id&&t.removeChildById(e.id,!0),e.set("parentId",r.id),r.listenTo(e,"loadBase",r.onChildLoaded),e.isBaseLoaded()&&(r.isBaseLoaded()?(r.runtimeData.add(e.runtimeData),r.engine.needsRender=!0):r.when("loadBase",function(){r.runtimeData.add(e.runtimeData),r.engine.needsRender=!0})),r.registerDependency(e)}),this.unsetProperty("bounds"),this.getAncestors().forEach(function(e){return e.unsetProperty("bounds")})},t.events={toggleVisibility:{parameters:[],action:!0,category:"Rendering"},setVisible:{parameters:[],action:!0,category:"Rendering"},setInvisible:{parameters:[],action:!0,category:"Rendering"}},t}(o.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={LOAD:"load",STATE_CHANGE:"state_change",CANCEL:"cancel",ERROR:"error",PROGRESS:"progress",DONE:"done"};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(6),o=r(3);(function(e){e[e.Normal=101]="Normal",e[e.Stereo2dOverUnder=102]="Stereo2dOverUnder",e[e.Stereo2dUnderOver=103]="Stereo2dUnderOver",e[e.Stereo2dLeftRight=104]="Stereo2dLeftRight",e[e.Stereo2dRightLeft=105]="Stereo2dRightLeft",e[e.StereoCubeHorizontal=106]="StereoCubeHorizontal"})(t.ImageLayout||(t.ImageLayout={}));var s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.loadedBytes=0,t}return i.__extends(t,e),t.getThreeImageFormat=function(e){switch(e){case"alpha":return n.AlphaFormat;case"rgb":return n.RGBFormat;case"rgba":return n.RGBAFormat;case"luminance":return n.LuminanceFormat;case"luminanceAlpha":return n.LuminanceAlphaFormat;default:return o.default.warn("Unexpected format: "+e+", defaulting to THREE.RGBFormat"),n.RGBFormat}},t.getThreeImageEncoding=function(e){switch(e){case"linear":return n.LinearEncoding;case"srgb":return n.sRGBEncoding;case"gamma":return n.GammaEncoding;case"rgbe":return n.RGBEEncoding;case"logLuv":return n.LogLuvEncoding;case"rgbm7":return n.RGBM7Encoding;case"rgbm16":return n.RGBM16Encoding;case"rgbd":return n.RGBDEncoding;case"depth":return n.BasicDepthPacking;case"rgbaDepth":return n.RGBADepthPacking;default:return o.default.warn("Unexpected format: "+e+", defaulting to THREE.sRGBEncoding"),n.sRGBEncoding}},t.getThreeDataType=function(e){switch(e){case"uByte":return n.UnsignedByteType;case"byte":return n.ByteType;case"short":return n.ShortType;case"uShort":return n.UnsignedShortType;case"int":return n.IntType;case"uInt":return n.UnsignedIntType;case"float":return n.FloatType;case"halfFloat":return n.HalfFloatType;case"uShort4444":return n.UnsignedShort4444Type;case"uShort5551":return n.UnsignedShort5551Type;case"uShort565":return n.UnsignedShort565Type;default:return o.default.warn("Unexpected format: "+e+", defaulting to THREE.UnsignedByteType"),n.UnsignedByteType}},t.getChannelCountFromFormat=function(e){switch(e){case"alpha":case"luminance":return 1;case"luminanceAlpha":return 2;case"rgb":return 3;case"rgba":return 4;default:return 0}},t.prototype.unload=function(){this.loadedBytes=0,e.prototype.unload.call(this)},t.prototype.getChosenRepresentation=function(){return this.chosenRepresentation},t.prototype.getDataSizeLoadedSelf=function(){return this.loadedBytes},t.prototype.applyPropertiesUnloaded=function(t){void 0===t&&(t={}),e.prototype.applyPropertiesUnloaded.call(this,t),this.engine.trigger("imageChanged",this.id,t)},t.prototype.getDataSizeDownloadSelf=function(){return this.chosenRepresentation?this.chosenRepresentation.contentLength:1},t.prototype.getFormat=function(){return"rgb"},t.prototype.isPowerOfTwo=function(){var e=this.getWidth(),t=this.getHeight();return n.Math.isPowerOfTwo(e)&&n.Math.isPowerOfTwo(t)},t.prototype.getWidth=function(){var e=this.getMaxRepresentationWidth(),t=this.getMaxTextureSize();return Math.max(1,Math.min(t,e))},t.prototype.getHeight=function(){var e=this.getMaxRepresentationHeight(),t=this.getMaxTextureSize();return Math.max(1,Math.min(t,e))},t.prototype.getMaxRepresentationWidth=function(){return 0},t.prototype.getMaxRepresentationHeight=function(){return 0},t.prototype.getOriginalWidth=function(){return 0},t.prototype.getOriginalHeight=function(){return 0},t.prototype.getMaxTextureSize=function(){return Number.MAX_VALUE},t}(a.default);t.default=s},function(e,t,r){"use strict";function i(e,t){if(void 0!==e&&null!==e)return Array.isArray(e)?e.forEach(t):void Object.keys(e).forEach(function(r){t(e[r],r)})}function n(e){return Array.isArray(e)?[].concat.apply([],e.map(function(e){return n(e)})):e}function a(e,t){return e.reduce(function(e,r){return e[r[t]]=r,e},{})}function o(e,t){return n(u(e,t))}function s(e){return e}function u(e,t){var r;return void 0===e||null===e?e:Array.isArray(e)?e.map(t):(r={},Object.keys(e).forEach(function(i){r[i]=t(e[i],i)}),r)}function p(e,t){return Object.keys(e).reduce(function(r,i){return-1===t.indexOf(i)&&(r[i]=e[i]),r},{})}e.exports={each:i,flatMap:o,flatten:n,identity:s,indexBy:a,map:u,omit:p}},function(e,t,r){"use strict";function i(e,t){var r=Math.floor(e);return t||{r:(r>>16&255)/255,g:(r>>8&255)/255,b:(255&r)/255}}Object.defineProperty(t,"__esModule",{value:!0});var n,a=r(0),o=r(3),s=r(1),u=r(6),p=r(5),c=r(4),h=r(238);(function(e){e[e.STANDIN_TEXTURE_WHITE=0]="STANDIN_TEXTURE_WHITE",e[e.STANDIN_TEXTURE_WHITE_CUBE=1]="STANDIN_TEXTURE_WHITE_CUBE",e[e.STANDIN_TEXTURE_BLACK=2]="STANDIN_TEXTURE_BLACK",e[e.STANDIN_TEXTURE_BLACK_CUBE=3]="STANDIN_TEXTURE_BLACK_CUBE",e[e.STANDIN_TEXTURE_NORMAL=4]="STANDIN_TEXTURE_NORMAL"})(n=t.StandInTexture||(t.StandInTexture={}));var l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a.__extends(t,e),t.prototype.initialize=function(){e.prototype.initialize.call(this),this.listenTo(this.engine,"textureDeleted",this.onTextureDeleted)},t.prototype.uninitialize=function(){e.prototype.uninitialize.call(this),this.stopListening(this.engine,"textureDeleted",this.onTextureDeleted)},t.prototype.getProperty=function(t){var r=e.prototype.getProperty.call(this,t);if(void 0===r){var i=this.getShader().getProperty("parameters");i[t]&&(r=i[t].default)}return r},t.prototype.getDefaultProperties=function(){var t=e.prototype.getDefaultProperties.call(this),r=this.getShader().getProperty("parameters");return Object.keys(r).forEach(function(e){t[e]=r[e].default}),t},t.prototype.verifyProperty=function(r,i){return!t.schema.properties[r]||e.prototype.verifyProperty.call(this,r,i)},t.prototype.setProperty=function(r,n,a){if(t.schema.properties[r])return e.prototype.setProperty.call(this,r,n,a);var s=this.getShader(),u=s.getProperty("parameters");if(u[r]){var p,c=u[r].type;if("t"===c&&("string"==typeof n||null===n)||"f"===c&&"number"==typeof n||"b"===c&&"boolean"==typeof n||"i"===c&&"number"==typeof n&&Math.round(n)===n||"opt"===c&&u[r].options.hasOwnProperty(n))p=n;else if("c"===c){if(p=this.sharedData.properties.hasOwnProperty(r)&&"object"==typeof this.sharedData.properties[r]?this.sharedData.properties[r]:{r:0,g:0,b:0},"string"==typeof n){var h=n;"0x"!==h.slice(0,2)&&(h=String(parseInt(h,10)),h="0x"+h.toString()),i(parseInt(h,16),p)}else if("number"==typeof n){var l=Math.max(0,Math.max(16777215,n));i(l,p)}else if(n&&"number"==typeof n.r&&"number"==typeof n.g&&"number"==typeof n.b){p.r=n.r,p.g=n.g,p.b=n.b;var d=u[r].min,f=u[r].max;void 0!==d&&(p.r=Math.max(p.r,d),p.g=Math.max(p.g,d),p.b=Math.max(p.b,d)),void 0!==f&&(p.r=Math.min(p.r,f),p.g=Math.min(p.g,f),p.b=Math.min(p.b,f))}}else"v"===c.charAt(0)&&"number"==typeof n.x&&"number"==typeof n.y?(p=this.sharedData.properties.hasOwnProperty(r)?this.sharedData.properties[r]:{},p.x=n.x,p.y=n.y,"v3"===c&&"number"==typeof n.z?p.z=n.z:"v4"===c&&"number"==typeof n.z&&"number"==typeof n.w&&(p.z=n.z,p.w=n.w)):void 0===n?p=void 0:o.default.error("Wrong type specified for "+r);this.engine.entityDispatcher.dispatchPropertyChanged(this.id,r,p,a)}},t.prototype.getReferencedAssetsList=function(e){var t=this,r=[],i={},n=this.getShader(),a=n.getProperty("parameters");return p.forEach(a,function(n,a){var o,s;"t"===n.type&&(t.isParameterUsed(a)&&(o=t.getProperty(a)),o&&(s=t.engine.getAssetById(o),i[o]?e&&r.push(s):(i[o]=s,r.push(s))))}),r},t.prototype.getShader=function(){var t=e.prototype.getProperty.call(this,"shaderId");return this.engine.getAssetById(t)||(t=this.getDefaultProperty("shaderId")),this.engine.getAssetById(t)},t.prototype.isParameterEditable=function(e){var t=this.getShader();if(!t)return!1;var r=t.getProperty("parameters");return!!r[e]&&(!r[e].displayWhen||this.testParameterConditions(r[e].displayWhen))},t.prototype.getStandInTexture=function(e,t){var r=this.engine.getAssetById(this.getProperty(e));if(r){var i;return t?"normal"===t?i=n.STANDIN_TEXTURE_NORMAL:"bump"===t&&(i=r.isCubeMap()?n.STANDIN_TEXTURE_BLACK:n.STANDIN_TEXTURE_BLACK_CUBE):i=r.isCubeMap()?n.STANDIN_TEXTURE_WHITE_CUBE:n.STANDIN_TEXTURE_WHITE,this.engine.materialUtilities.getStandInTexture(i)}},t.prototype.unload=function(){var t=this;if(this.getDependencies().forEach(function(e){return t.stopListening(e,"load")}),this.runtimeData){this.engine.trigger("materialUnloaded",this.id),o.default.info(this.engine.getName()+" - Unloading material, "+this.getName());for(var r in this.runtimeData)this.runtimeData.hasOwnProperty(r)&&(this.runtimeData[r].dispose(),delete this.runtimeData[r]);this.runtimeData=null,e.prototype.unload.call(this)}},t.prototype.applyPropertiesLoaded=function(r,i){var n=this;if(e.prototype.applyPropertiesLoaded.call(this,r,i),r.hasOwnProperty("shaderId")){var a=this.getShader(),o=this.getPreviousProperty("shaderId");if(o!==a.id&&"init"!==i&&this.getThreeConstructor()!==this.getThreeConstructor(o))return void this.reloadBase();a.when("load",function(){p.forEach(t.materialObjectTypes,function(e,t){var r=n.runtimeData[t];r instanceof s.ShaderMaterial&&(r.vertexShader=a.runtimeData.vertexShader,r.fragmentShader=a.runtimeData.fragmentShader,r.uniforms=s.UniformsUtils.clone(a.runtimeData.uniforms),n.addSharedUniforms(r.uniforms)),r.needsUpdate=!0}),n.updateMaterialDefines(),n.updateShaderParameters(n.getProperties()),n.updateTransparency(),n.updateDerivatives(),n.engine.needsRender=!0}),a.isUnloaded()&&a.load()}else{var u=this.getShader(),c=u.getProperty("parameters"),h=!1,l=!1,d=!1;for(var f in r)if(r.hasOwnProperty(f)&&c[f]){if(c[f].transparency&&(h=!0),void 0!==c[f].derivatives&&(l=!0),u.getDependentParameters(f).length||c[f].forceUpdate){d=!0;break}this.updateShaderParameter(f)}d&&(this.updateMaterialDefines(),this.updateShaderParameters(this.getProperties()),h=!0,l=!0),h&&this.updateTransparency(),l&&this.updateDerivatives(),this.engine.needsRender=!0}},t.prototype.applyPropertiesUnloaded=function(t){var r=this;void 0===t&&(t={}),e.prototype.applyPropertiesUnloaded.call(this,t);var i,n,a=this.getShader(),o=a.getProperty("parameters"),s=!1;t&&(t.hasOwnProperty("shaderId")&&this.cleanShaderParameters(),p.forEach(t,function(e,t){o[t]&&("t"===o[t].type&&(i=r.getProperty(t),n=r.getPreviousProperty(t),r.isParameterUsed(t)?n!==i&&(r.registerDependencyById(i),r.unregisterDependencyById(n)):n!==i&&(s=!0)),(a.getDependentParameters(t).length||o[t].forceUpdate)&&(s=!0))}),s&&this.resetDependencies())},t.prototype.createRuntimeData=function(e){var r=this,i=this.getShader();i.when("load",function(){r.runtimeData={};var n={},a=r.getThreeConstructor();a===s.ShaderMaterial&&(n.vertexShader=i.runtimeData.vertexShader,n.fragmentShader=i.runtimeData.fragmentShader,n.uniforms=s.UniformsUtils.clone(i.runtimeData.uniforms),r.addSharedUniforms(n.uniforms)),Object.keys(t.materialObjectTypes).forEach(function(e){r.runtimeData[e]=new a(n),r.runtimeData[e].name=r.getName();var i=t.materialObjectTypes[e];p.forEach(i,function(t,i){r.runtimeData[e].hasOwnProperty(i)&&(r.runtimeData[e][i]=p.deepClone(t))})}),e()},this),i.isUnloaded()&&i.load()},t.prototype.getThreeConstructor=function(e){var t=e?this.engine.getAssetById(e):this.getShader();if(!t)throw new Error("Bad or unknown shader ID, "+e);t.isUnloaded()&&t.load();var r;switch(t.runtimeData.vertexShader){case"MeshStandardMaterial":r=s.MeshStandardMaterial;break;case"MeshPhysicalMaterial":r=s.MeshPhysicalMaterial;break;case"MeshPhongMaterial":r=s.MeshPhongMaterial;break;case"MeshLambertMaterial":r=s.MeshLambertMaterial;break;default:r=s.ShaderMaterial}return r},t.prototype.testParameterCondition=function(e,t){var r=this.getShader(),i=r.getProperty("parameters");if(!i[e])return!1;var n=this.getProperty(e);"t"===i[e].type&&(this.engine.getAssetById(n)||(n=null));for(var a in t)if(t.hasOwnProperty(a))switch(a){case"equals":if(!p.shallowEquals(n,t[a]))return!1;break;case"notEquals":if(p.shallowEquals(n,t[a]))return!1;break;case"equalsDefault":if(!p.shallowEquals(n,i[e].default))return!1;break;case"notEqualsDefault":if(p.shallowEquals(n,i[e].default))return!1;break;default:return!1}return!0},t.prototype.testParameterConditions=function(e){var t=!0;for(var r in e)if(e.hasOwnProperty(r))if("or"===r){if(!this.testParameterConditionsOr(e[r])){t=!1;break}}else if(!this.testParameterCondition(r,e[r])){t=!1;break}return t},t.prototype.testParameterConditionsOr=function(e){for(var t=!1,r=0,i=e;r1;if("NotFalsy"===t)return this.getProperty(e);if("HasAlpha"===t&&"t"===i[e].type){var n=this.engine.getAssetById(this.getProperty(e));return n&&"rgba"===n.getFormat()}}return!1},t.prototype.isParameterUsed=function(e){var t,r=this.getShader(),i=!1;if(r)return t=r.getProperty("parameters"),t[e]&&(i=!t[e].enabledWhen||this.testParameterConditions(t[e].enabledWhen)),i},t.prototype.onTextureLoaded=function(e){var r=this;if(!e.isLoadFailed()){var i=e.getThreeTexture();if(i){var n=this.getShader();if(n){var a=n.getProperty("parameters"),o=Object.keys(a).filter(function(t){return"t"===a[t].type&&r.isParameterUsed(t)&&r.getProperty(t)===e.id});o.forEach(function(e){r.setThreeValue(e,i)});o.some(function(e){return a[e].forceUpdate})&&Object.keys(t.materialObjectTypes).forEach(function(e){r.runtimeData[e].needsUpdate=!0}),this.engine.needsRender=!0}}}},t.prototype.updateShaderParameter=function(e){var r=this,i=this.getShader(),n=i.getProperty("parameters"),a=n[e];if(a){var o=!0,s=this.getProperty(e);switch(a.type.charAt(0)){case"t":var u=this.engine.getAssetById(s);if(u&&this.isParameterUsed(e)){var p=this.getPreviousProperty(e);if(p!==this.getProperty(e)){var c=this.engine.getEntityById(p);c&&this.stopListening(c,"loadBase",this.onTextureLoaded)}this.stopListening(u,"loadBase",this.onTextureLoaded),this.listenTo(u,"loadBase",this.onTextureLoaded),s=this.getStandInTexture(e,a.textureUsage),this.engine.needsRender=!0,u.isUnloaded()?u.load():u.isBaseLoaded()&&this.onTextureLoaded.call(this,u),u.isBaseLoaded()&&(o=!1)}else s=null;break;case"b":a.animation&&s&&(t.timeValueInUse=!0),s=s?1:0;break;case"v":a.animation&&(s.x||s.y||s.z||s.w)&&(t.timeValueInUse=!0);break;case"o":s=a.options[s]}o&&this.setThreeValue(e,s),a.forceUpdate&&Object.keys(t.materialObjectTypes).forEach(function(e){r.runtimeData[e].needsUpdate=!0})}},t.prototype.getThreeValue=function(e,t){var r,i=this.getShader(),n=i.getProperty("parameters"),a=n[e],o=a.uniformName||e;if(a.isRenderParam)r=this.runtimeData[t][o];else if(a.isUniform){var u=this.runtimeData[t].uniforms[o];r=u?u.value:null}if("c"===a.type)r||(r=new s.Color(a.default.r,a.default.g,a.default.b));else if("v"===a.type.charAt(0)&&!r){var p=a.default;switch(a.type.charAt(1)){case"4":r=new s.Vector4(p.x,p.y,p.z,p.w);break;case"3":r=new s.Vector3(p.x,p.y,p.z);break;case"2":r=new s.Vector2(p.x,p.y)}}return r},t.prototype.setThreeValue=function(e,r){var i=this;if(this.runtimeData){var n=this.getShader(),a=n.getProperty("parameters"),o=a[e],s=o.uniformName||e;Object.keys(t.materialObjectTypes).forEach(function(t){var n=i.getThreeValue(e,t);if("c"===o.type)n.setRGB(r.r,r.g,r.b);else if("b"===o.type)n=!!r;else if("v"===o.type.charAt(0))switch(o.type.charAt(1)){case"4":n.w=r.w;case"3":n.z=r.z;case"2":n.x=r.x,n.y=r.y}else"t"===o.type?(n&&r&&n.encoding===r.encoding&&n.mapping===r.mapping||(i.runtimeData[t].needsUpdate=!0),n=r):n=r;if(o.isUniform){var a=i.runtimeData[t].uniforms[s];if(!a)throw new Error("Trying to set non-existent uniform "+s);a.value=n}o.isRenderParam&&(i.runtimeData[t][s]=n)})}},t.prototype.setExtension=function(e,r){var i=this;this.runtimeData&&Object.keys(t.materialObjectTypes).forEach(function(t){i.runtimeData[t].extensions&&i.runtimeData[t].extensions.hasOwnProperty(e)&&(i.runtimeData[t].extensions[e]=r)})},t.prototype.onTextureDeleted=function(e){var t=this,r=this.getOwnProperties();Object.keys(r).filter(function(t){return r[t]===e}).forEach(function(e){t.setProperty(e,null)})},t.builtInAssetDescriptors={missingMaterial:{id:"missingMaterial",type:"material",properties:{name:"Missing Material",albedoColor:{r:.8275,g:.8275,b:.8275}}}},t.materialObjectTypes={static:{lights:!0,fog:!0,skinning:!1},skinned:{lights:!0,fog:!0,skinning:!0},staticTangents:{lights:!0,fog:!0,skinning:!1,defines:{USE_TANGENTS:!0}},skinnedTangents:{lights:!0,fog:!0,skinning:!0,defines:{USE_TANGENTS:!0}},depthStatic:{lights:!1,fog:!1,vertexColors:s.NoColors,skinning:!1,defines:{DEPTH_PASS:!0}},depthSkinned:{lights:!1,fog:!1,vertexColors:s.NoColors,skinning:!0,defines:{DEPTH_PASS:!0}}},t.sharedUniforms={time:{type:"f",value:0},screenDimensions:{type:"v4",value:new s.Vector4}},t.timeValueInUse=!1,t}(u.default);c.addSchemas("MaterialAsset",l),t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i;(function(e){e[e.BUFFER=1]="BUFFER",e[e.IMAGE=2]="IMAGE",e[e.VIDEO=3]="VIDEO",e[e.ENTITIES=4]="ENTITIES",e[e.JSON=5]="JSON"})(i||(i={})),t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(43),a=i.__assign({},n.default,{id:"baseObject",title:"BaseObjectDef",properties:i.__assign({},n.default.properties,{parentId:{type:"string",description:"The ID of the entity's parent."},prefabAssetId:{type:"string"},prefabObjectId:{type:"string"},prefabInstanceId:{type:"string"},children:{type:"array",items:{type:"string"},default:[],description:"The IDs of this entity's children."},previousChildren:{type:"array",items:{type:"string"},default:[],description:"The previous IDs of this entity's children."},properties:{$ref:"baseObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(44),a=i.__assign({},n.default,{id:"baseObjectProperties",title:"BaseObjectPropertiesDef",properties:i.__assign({},n.default.properties,{position:{$ref:"vector3.json",description:"The local-space position of the object.",default:{x:0,y:0,z:0}},quaternion:{$ref:"vector4.json",description:"The local-space orientation of the object.",default:{x:0,y:0,z:0,w:1}},scale:{$ref:"vector3.json",description:"The local-space scale of the object.",default:{x:1,y:1,z:1}},castShadow:{type:"boolean",description:"Controls whether this object casts a shadow.",default:!0},receiveShadow:{type:"boolean",description:"Controls whether casted shadows render on this object.",default:!0},visible:{type:"boolean",description:"Controls whether this object is visible or not.",default:!0},bounds:{$ref:"box3.json",description:"The local-space minimum and maximum extents of this object.#read-only"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){if("node"===e)return e;var t,r=e.match(/(edge(?=\/))\/?\s*(\d+)/i)||[],i=e.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return r.length&&(i=r),/trident/i.test(i[1])?(t=/\brv[ :]+(\d+)/g.exec(e)||[],"IE "+(t[1]||"")):"Chrome"===i[1]&&null!=(t=e.match(/\bOPR\/(\d+)/))?"Opera "+t[1]:(i=i[2]?[i[1],i[2]]:[navigator.appName,navigator.appVersion,"-?"],t=e.match(/version\/(\d+)/i),null!=t&&i.splice(1,1,t[1]),i.join(" "))},n={isMobile:void 0,isIOS:void 0,isAndroid:void 0,isMac:void 0,isLinux:void 0,isUnix:void 0,isWindows:void 0,isChrome:void 0,isFirefox:void 0,isSafari:void 0,isOpera:void 0,isEdge:void 0,isIpad:void 0,isNode:void 0,isIE:void 0,isIE11:void 0,isAndroidTablet:void 0,isTablet:void 0},a="undefined"!=typeof navigator?navigator.userAgent:"node",o=function(){var e=i(a),t={isMobile:/iphone|ipad|ipod|android|blackberry|bb10|mini|windows\sce|palm/i.test(a),isIOS:/iphone|ipad|ipod/i.test(a),isAndroid:/android/i.test(a),isMac:/mac/i.test(a),isLinux:/linux/i.test(a),isUnix:/x11/i.test(a),isWindows:/windows/i.test(a),isChrome:/chrome/i.test(a),isFirefox:/firefox/i.test(a),isSafari:/safari/i.test(a),isOpera:/opera/i.test(a),isEdge:/edge/i.test(a),isIpad:/ipad/i.test(a),isNode:"node"===a,isIE:/ie/i.test(e),isIE11:/ie 11/i.test(e)};t.isAndroidTablet=t.isAndroid&&!/mobile/i.test(a),t.isTablet=t.isIpad||t.isAndroidTablet,Object.keys(t).forEach(function(e){n[e]=t[e]})};o(),t.setUserAgent=function(e){a=e,o()},t.isMobile=function(){return n.isMobile},t.isIOS=function(){return n.isIOS},t.isAndroid=function(){return n.isAndroid},t.isMac=function(){return n.isMac},t.isLinux=function(){return n.isLinux},t.isUnix=function(){return n.isUnix},t.isWindows=function(){return n.isWindows},t.isChrome=function(){return n.isChrome},t.isFirefox=function(){return n.isFirefox},t.isSafari=function(){return n.isSafari},t.isOpera=function(){return n.isOpera},t.isEdge=function(){return n.isEdge},t.isAndroidTablet=function(){return n.isAndroidTablet},t.isIpad=function(){return n.isIpad},t.isTablet=function(){return n.isTablet},t.isIE=function(){return n.isIE},t.isIE11=function(){return n.isIE11},t.isNode=function(){return n.isNode}},function(e,t,r){var i=r(279),n=r(280),a=n;a.v1=i,a.v4=n,e.exports=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(9),s=r(6),u=r(12),p=r(12),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.createColorTexture=function(e,t,r,i){void 0===e&&(e=255),void 0===t&&(t=255),void 0===r&&(r=255);var n=a.RGBFormat,o=void 0!==i?4:3,s=new Uint8Array(o);s[0]=e,s[1]=t,s[2]=r,4===o&&(s[3]=i,n=a.RGBAFormat);var u=new a.DataTexture(s,1,1,n,void 0,void 0,void 0,void 0,void 0,void 0);return u.needsUpdate=!0,u},t.createColorTextureCube=function(e,r,i,n){void 0===e&&(e=255),void 0===r&&(r=255),void 0===i&&(i=255);var o=[0,1,2,3,4,5].map(function(a){return t.createColorTexture(e,r,i,n)}),s=new a.CubeTexture(o);return s.generateMipmaps=!1,s.format=o[0].format,s.minFilter=a.NearestFilter,s.magFilter=a.NearestFilter,s.needsUpdate=!0,s},t.getBytesPerPixel=function(e,t){var r=0;switch(t){case"float":case"uInt":case"int":r=4;break;case"halfFloat":case"short":case"uShort":r=2;break;case"uByte":case"byte":r=1;break;case"uShort4444":case"uShort5551":case"uShort565":return 2}return u.default.getChannelCountFromFormat(e)*r},t.getMissingTexture=function(){return t.missingTexture2d||(t.missingTexture2d=t.createColorTexture()),t.missingTexture2d},t.getMissingTextureCube=function(){return t.missingTextureCube||(t.missingTextureCube=t.createColorTextureCube()),t.missingTextureCube},t.prototype.initialize=function(){var t=this;e.prototype.initialize.call(this),this.listenTo(this.engine,"imageUnloaded",function(e){t.getProperty("imageId")===e&&t.unload()})},t.prototype.createRuntimeData=function(e){var r=this,i=function(){r.runtimeData=t.getMissingTexture(),r.setState(o.StateType.Base,o.State.Failed),r.trigger("loadProgress",r),"function"==typeof e&&e.call(r)},n=this.getImage();if(n){var a=function(t){if(!t.runtimeData)return void i();r.createTextureData(t.runtimeData),"function"==typeof e&&e.call(r)};this.listenTo(n,"load",a),n.isLoaded()&&a.call(this,n),n.isUnloaded()&&n.load()}else i()},t.prototype.createTextureData=function(e){n.default.warn("Need to implement createTextureData in derived class.")},t.prototype.reloadBase=function(){return this.runtimeData&&this.runtimeData.dispose(),e.prototype.reloadBase.call(this)},t.prototype.unload=function(){var t=this.getImage();t&&this.stopListening(t,"load"),this.runtimeData&&(this.engine.trigger("textureUnloaded",this.id),n.default.info(this.engine.getName()+" - Unloading texture, "+this.getName()),this.runtimeData.dispose()),e.prototype.unload.call(this)},t.prototype.applyPropertiesLoaded=function(t,r){e.prototype.applyPropertiesLoaded.call(this,t,r);var i=this.runtimeData instanceof a.WebGLRenderTarget?this.runtimeData.texture:this.runtimeData;t.hasOwnProperty("wrapModeU")&&(i.wrapS=this.getThreeAddressMode(this.getAddressModeU())),t.hasOwnProperty("wrapModeV")&&(i.wrapT=this.getThreeAddressMode(this.getAddressModeV())),t.hasOwnProperty("anisotropy")&&(i.anisotropy=this.getProperty("anisotropy")),t.hasOwnProperty("minFilter")&&(i.minFilter=this.getThreeFilter(this.getMinFilter())),t.hasOwnProperty("magFilter")&&(i.magFilter=this.getThreeFilter(this.getMagFilter())),t.hasOwnProperty("useMipmap")&&(i.generateMipmaps=this.isMipmapsEnabled()),t.hasOwnProperty("mapping")&&(i.mapping=this.getThreeMapping()),this.engine.needsRender=!0},t.prototype.applyPropertiesUnloaded=function(t){if(void 0===t&&(t={}),e.prototype.applyPropertiesUnloaded.call(this,t),t.hasOwnProperty("imageId")){var r=this.getPreviousProperty("imageId");if(r){var i=this.engine.getAssetById(r);i&&this.stopListening(i),this.unregisterDependencyById(r)}t.imageId&&this.registerDependencyById(this.getProperty("imageId"))}this.engine.trigger("textureChanged",this.id,t)},t.prototype.getAddressModeU=function(){return this.getSupportedAddressMode(this.getProperty("wrapModeU"))},t.prototype.getAddressModeV=function(){return this.getSupportedAddressMode(this.getProperty("wrapModeV"))},t.prototype.getSupportedAddressMode=function(e){var t=this.getImage();return t&&!t.isPowerOfTwo()?"clampToEdge":e},t.prototype.getLayout=function(){var e=this.getProperty("layout");if(e)return e;var t=this.getImage();return t?t.getProperty("layout"):p.ImageLayout.Normal},t.prototype.getWidth=function(){var e=this.getImage();return e?e.getWidth():1},t.prototype.getHeight=function(){var e=this.getImage();return e?e.getHeight():1},t.prototype.getMinFilter=function(){return this.getSupportedFilter(this.getProperty("minFilter"))},t.prototype.getMagFilter=function(){return this.getSupportedFilter(this.getProperty("magFilter"))},t.prototype.getSupportedFilter=function(e){var t=this.getDataType();if(!this.isLinearFilterAvailableForType(t))return"nearest";if(!this.isMipmapsEnabled())switch(e){default:case"nearest":case"nearestWithNearestMipmap":case"nearestWithLinearMipmap":return"nearest";case"linear":case"linearWithNearestMipmap":case"linearWithLinearMipmap":return"linear"}return e},t.prototype.getBytesPerPixel=function(){return t.getBytesPerPixel(this.getFormat(),this.getDataType())},t.prototype.getDataType=function(){var e=this.getProperty("type"),t=e,r=this.engine.getThreeRenderer(),i=r.extensions;switch(e){case"float":if(i.get("OES_texture_float")){t="float";break}case"halfFloat":t=i.get("OES_texture_half_float")?"halfFloat":"uByte";break;default:t=e}return t},t.prototype.getEncoding=function(){var e=this.getProperty("encoding");if(e)return e;var t=this.getImage();if(!t)return"srgb";var r=t.getChosenRepresentation();if(!r)return"srgb";switch(r.colorspace){case"rgb":case"gray":return"linear";default:return"srgb"}},t.prototype.getFormat=function(){if(!this.getOwnProperty("format")){var e=this.getImage();if(e)return e.getFormat()}return this.getProperty("format")},t.prototype.getThreeMapping=function(){switch(this.getProperty("mapping")){case"cubeReflection":return a.CubeReflectionMapping;case"cubeRefraction":return a.CubeRefractionMapping;case"equirectangularReflection":return a.EquirectangularReflectionMapping;case"EquirectangularRefraction":return a.EquirectangularRefractionMapping;case"sphericalReflection":return a.SphericalReflectionMapping;case"cubeUvReflection":return a.CubeUVReflectionMapping;case"cubeUvRefraction":return a.CubeUVRefractionMapping;default:return a.UVMapping}},t.prototype.getThreeFormat=function(){return u.default.getThreeImageFormat(this.getFormat())},t.prototype.getThreeDataType=function(){return u.default.getThreeDataType(this.getDataType())},t.prototype.getThreeEncoding=function(){return u.default.getThreeImageEncoding(this.getEncoding())},t.prototype.getMipCount=function(){if(!this.isMipmapsEnabled())return 1;var e=this.getWidth(),t=this.getHeight(),r=Math.max(e,t);return Math.floor(Math.log2(Math.max(r,1)))+1},t.prototype.getImage=function(){return this.engine.getAssetById(this.getProperty("imageId"))},t.prototype.getDataSizeInMemorySelf=function(){var e=this.getImage();if(e instanceof u.default){var r=e.getChosenRepresentation();if(!r)return e.getDataSizeInMemory();if(r.compression&&"zip"!==r.compression&&"jpeg"!==r.compression)return e.getDataSizeDownloadSelf();if(this.getHdrPackingType(r.channels))return this.getWidth()*this.getHeight()*t.getBytesPerPixel("rgb",this.getDataType())}return this.getWidth()*this.getHeight()*t.getBytesPerPixel(this.getFormat(),this.getDataType())},t.prototype.isCubeMap=function(){return!1},t.prototype.isLinearFilterAvailableForType=function(e){var t=this.engine.getThreeRenderer(),r=t.extensions;switch(e){case"halfFloat":return!!r.get("OES_texture_half_float_linear");case"float":return!!r.get("OES_texture_float_linear");default:return!0}},t.prototype.isMipmapsEnabled=function(){if(!this.isLinearFilterAvailableForType(this.getDataType()))return!1;var e=this.getImage();return!(e&&!e.isPowerOfTwo())&&this.getProperty("useMipmap")},t.prototype.getHdrPackingType=function(e){return e&&4===e.length&&"exponent"===e[3]?"rgbe":null},t.prototype.createDdsTexture=function(e,t){var r=this.parseDDS(e,!0),i=new a.CompressedTexture(null,0,0);i.format=r.format,i.generateMipmaps=!1;var n=function(e){return e.width<=t&&e.height<=t};if(r.isCubemap){i.flipY=!1;for(var o=i.image=[],s=r.mipmaps.length/r.mipmapCount,u=0;u>8&255,e>>16&255,e>>24&255)}(s)),x;u=!0,o=64,x.format=a.RGBAFormat}for(x.mipmapCount=1,131072&i[2]&&!1!==t&&(x.mipmapCount=Math.max(1,i[7])),x.isCubemap=!!(512&i[28]),x.width=i[4],x.height=i[3],p=i[1]+4,c=x.width,h=x.height,d=x.isCubemap?6:1,l=0;l=this.getMaterialCount())throw new Error("Invalid index parameter");var r=this.getMaterialIds()[e];if(r){var i=this.engine.getAssetById(r);if(i)return i}return t?this.engine.materialUtilities.getMissingMaterial():null},t.prototype.getPreviousMaterial=function(e,t){if(void 0===e&&(e=0),void 0===t&&(t=!0),e<0||e>=this.getMaterialCount())throw new Error("Invalid index parameter");var r=this.getPreviousMaterialIds()[e];if(r){var i=this.engine.getAssetById(r);if(i)return i}return t?this.engine.materialUtilities.getMissingMaterial():null},t.prototype.getMaterialCount=function(){return this.getMaterialIds().length},t.prototype.getMaterials=function(e){var t=this;void 0===e&&(e=!0);var r=this.getMaterialIds(),i=this.engine.materialUtilities.getMissingMaterial();return r.map(function(r){var n=t.engine.getAssetById(r);return n||(e?i:null)})},t.prototype.getSkinAsset=function(){var e=this.getProperty("skinId");return e?this.engine.getAssetById(e):null},t.prototype.isSkinned=function(){return null!==this.getSkinAsset()},t.prototype.applyPropertiesLoaded=function(t,r){var i=this;if(e.prototype.applyPropertiesLoaded.call(this,t,r),t.hasOwnProperty("geometryId")){var n=this.getPreviousProperty("geometryId"),a=this.getProperty("geometryId");if("init"===r&&this.registerChangeListener(a,this.onGeometryChanged,!1),this.registerChangeListener(n,this.onGeometryChanged,!1),this.registerChangeListener(a,this.onGeometryChanged,!0),"init"!==r)return void this.reloadBase()}if(t.hasOwnProperty("materials")){this.getPreviousMaterialIds().forEach(function(e){i.registerChangeListener(e,i.onMaterialChanged,!1)}),Array.isArray(this.runtimeData.material)||(this.runtimeData.material=[]);for(var o=this.getMaterialType(),s=this.getMaterialIds(),u=this.getGeometryAsset(),p=u?u.getMaxMaterialIndex("triangles"):0;s.length<=p;)s.push(null);s.forEach(function(e,t){i.registerChangeListener(e,i.onMaterialChanged,!0),i.loadAndAssignMaterial(i.runtimeData.material,t,e,o)})}if(t.hasOwnProperty("customDepthMaterial")){var c=this.getPreviousProperty("customDepthMaterial"),h=this.getProperty("customDepthMaterial");this.registerChangeListener(c,this.onMaterialChanged,!1),this.registerChangeListener(h,this.onMaterialChanged,!0),h&&this.loadAndAssignMaterial(this.runtimeData,"customDepthMaterial",h,this.getDepthMaterialType())}this.engine.needsRender=!0},t.prototype.loadAsset=function(e){if(!e)return Promise.resolve(null);var t=this.engine.getAssetById(e);return t?new Promise(function(r,i){t.when("load",function(){if(t.isLoadFailed())return void i(new Error('Asset "'+e+'" failed to load'));r(t)}),t.isLoaded()||t.load()}):Promise.reject(new Error('Asset "'+e+'" not found'))},t.prototype.onGeometryChanged=function(){this.reloadBase()},t.prototype.onMaterialChanged=function(e){var t=this;void 0===e&&(e={}),e.hasOwnProperty("shaderId")&&this.getMaterials().forEach(function(e,r){t.runtimeData.material[r]=e.getRuntimeData()[t.getMaterialType()]})},t.prototype.onMaterialDeleted=function(e){var t=this.getMaterialIds(),r=!1;t.forEach(function(i,n){i===e&&(t[n]=null,r=!0)}),r&&this.setProperty("materials",t)},t.prototype.revertMaterial=function(e){void 0===e&&(e=0),this.setMaterial(void 0,e)},t.prototype.setMaterial=function(e,t){if(void 0===t&&(t=0),t<0||t>=this.getMaterialCount())throw new Error("Invalid index parameter");var r=e instanceof s.default?e.id:e,i=(this.getOwnProperty("materials")||[]).slice();i[t]!==r&&(i[t]=r,this.setProperty("materials",i))},t.prototype.getMaterialIds=function(){return this.getProperty("materials")},t.prototype.applyPropertiesUnloaded=function(t){var r=this;if(void 0===t&&(t={}),e.prototype.applyPropertiesUnloaded.call(this,t),t.hasOwnProperty("materials")&&(this.getPreviousMaterials().forEach(function(e){return r.unregisterDependency(e)}),this.getMaterials().forEach(function(e){return r.registerDependency(e)})),t.hasOwnProperty("customDepthMaterial")){var i=this.getPreviousProperty("customDepthMaterial");i&&this.unregisterDependencyById(i);var n=this.getProperty("customDepthMaterial");n&&this.registerDependencyById(n)}if(t.hasOwnProperty("geometryId")){var a=this.getPreviousProperty("geometryId");a&&this.unregisterDependencyById(a);var o=this.getProperty("geometryId");o&&this.registerDependencyById(o)}},t.prototype.bindToHierarchy=function(){var e=this,t=this.getInstanceTop();t||(t=this.getRootObject());var r=this.getSkinAsset();if(!r)throw new Error("Cannot bind mesh to hierarchy because it does not have a skin asset");if(!r.isLoaded())throw new Error("Cannot bind mesh to hierarchy because the skin asset is not loaded");var i=this.runtimeData;if(!i)throw new Error("Cannot bind mesh to hierarchy because the mesh is not loaded");t.when("loadDependencies",function(){var n=t?t.getDescendants():[],o=n.map(function(e){return e.getRuntimeData()}),s=o.reduce(function(e,t){return e[t.name]=t,e},{}),u=r.getJointNames().map(function(t){var r=e.engine.getRuntimeName(t);return s[r]}),p=new a.Skeleton(u,r.getInverseBindMatrices());i.bind(p,r.getBindShapeMatrix())}),t.isUnloaded()||t.load()},t.prototype.createDefaultMesh=function(){var e=this.engine.geometryUtilities.getDefaultGeometry();this.createMesh(e)},t.prototype.createMesh=function(e){if(this.runtimeData)this.runtimeData.geometry=e;else{var t=this.isSkinned()?a.SkinnedMesh:a.Mesh,r=new t(e);r.name=this.getRuntimeName(),r.castShadow=!0,r.receiveShadow=!0,r.material=null,this.runtimeData=r}},t.prototype.createMeshLoaded=function(){var e=this.getGeometryAsset();if(e){if(!e.isLoaded())throw new Error("Cannot create mesh because geometry asset is not loaded");var t=this.getSkinAsset();if(t&&!t.isLoaded())throw new Error("Cannot create mesh because skin asset is not loaded");var r=u.default.primitiveType.TRIANGLES,i=e?e.getGeometry(r):void 0;this.createMesh(i),t&&this.bindToHierarchy()}},t.prototype.getDepthMaterialType=function(){var e=this.getMaterialType();return s.default.materialObjectTypes[e].skinning?"depthSkinned":"depthStatic"},t.prototype.getPreviousMaterials=function(e){void 0===e&&(e=!0);for(var t=[],r=this.getMaterialCount(),i=0;ie?t.video.width:e},0):0},t.prototype.getMaxRepresentationHeight=function(){var e=this.get("representations");return e?e.reduce(function(e,t){return t.video&&t.video.height>e?t.video.height:e},0):0},t.prototype.onUpdate=function(){if(this.runtimeData){var e=this.runtimeData.imageData;e&&!e.paused&&!e.error&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.engine.needsRender=!0)}},t.prototype.pause=function(){this.runtimeData&&this.runtimeData.image.pause()},t.prototype.play=function(e,t){this.runtimeData&&(e&&(this.runtimeData.imageData.currentTime=t),this.runtimeData.imageData.play())},t.prototype.stop=function(){this.runtimeData&&(this.runtimeData.imageData.pause(),this.runtimeData.imageData.currentTime=0)},t.prototype.toggle=function(){this.runtimeData&&(this.runtimeData.imageData.paused?this.play():this.pause())},t.prototype.getOriginalWidth=function(){return(this.getProperty("streams")||[]).reduce(function(e,t){return Math.max(t.width||0,e)},0)},t.prototype.getOriginalHeight=function(){return(this.getProperty("streams")||[]).reduce(function(e,t){return Math.max(t.height||0,e)},0)},t.prototype.getMaxTextureSize=function(){var t=this.engine.getRenderer();return t?t.getMaxTextureSize2d():e.prototype.getMaxTextureSize.call(this)},t.prototype.findRepresentation=function(e){void 0===e&&(e={});var t=this.get("representations");if(!t||0===t.length)return null;var r=Object.assign({maxHeight:1080},e),i=t.map(function(e){return r.maxHeight-(e.video||{}).height||0}),n=i.reduce(function(e,t,r){var n=e>=0?i[e]:Number.MAX_VALUE;return t>=0&&t=0?t[n]:null},t.events={pause:{parameters:[],action:!0,category:""},play:{parameters:[{name:"seek",type:"b",description:"",default:!1},{name:"seekTime",type:"f",description:"",default:0}],action:!0,category:""},stop:{parameters:[],action:!0,category:""},toggle:{parameters:[],action:!0,category:""}},t}(n.default);s.addSchemas("VideoAsset",u),t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n={side:{displayName:"Cull Mode",description:"This controls which side of the geometry will be visible.",type:"opt",isRenderParam:!0,options:{frontOnly:i.FrontSide,backOnly:i.BackSide,doubleSided:i.DoubleSide},default:"doubleSided"},wireframe:{displayName:"Wireframe",description:"This controls whether the material displays as a wireframe.",type:"b",isRenderParam:!0,default:!1},fog:{displayName:"Enable Fog",description:"This controls whether this material is affected by fog or not.",isRenderParam:!0,forceUpdate:!0,type:"b",default:!0},lights:{displayName:"Enable Lights",description:"This controls whether this material is affected by lights or not.",isRenderParam:!0,forceUpdate:!0,type:"b",default:!0},depthFunc:{displayName:"Depth Function",description:"The function to use when comparing the current depth value with the one that already exists in the buffer.",isRenderParam:!0,type:"opt",options:{never:i.NeverDepth,always:i.AlwaysDepth,lessThan:i.LessDepth,lessThanOrEqual:i.LessEqualDepth,equal:i.EqualDepth,greaterThanOrEqual:i.GreaterEqualDepth,greaterThan:i.GreaterDepth,notEqual:i.NotEqualDepth},default:"lessThanOrEqual"},depthWrite:{displayName:"Enable Depth Write",description:"This controls whether the depth values of a mesh rendered with this material are recorded.",isRenderParam:!0,type:"b",default:!0},depthTest:{displayName:"Enable Depth Test",description:"This controls whether a depth check is done before this material is rendered so that it can be occluded.",isRenderParam:!0,type:"b",default:!0},blending:{displayName:"Blending Mode",description:"This controls how the material will be blended with the color behind it.",isRenderParam:!0,type:"opt",options:{none:i.NoBlending,normal:i.NormalBlending,additive:i.AdditiveBlending,subtractive:i.SubtractiveBlending,multiplicative:i.MultiplyBlending,custom:i.CustomBlending},default:"normal",transparency:"GreaterThanOne"},blendEquation:{displayName:"Blending Equation",description:"The function to use when blending the current color with the one alreadyin the buffer. Enabled when using custom blending.",isRenderParam:!0,type:"opt",options:{add:i.AddEquation,subtract:i.SubtractEquation,reverseSubtract:i.ReverseSubtractEquation,minimum:i.MinEquation,maximum:i.MaxEquation},default:"add",displayWhen:{blending:{equals:"custom"}},enabledWhen:{blending:{equals:"custom"}}},blendSrc:{displayName:"Blend Source",description:"The first parameter to be used in the blend equation. Enabled when using custom blending.",isRenderParam:!0,type:"opt",options:{zero:i.ZeroFactor,one:i.OneFactor,sourceColor:i.SrcColorFactor,oneMinusSourceColor:i.OneMinusSrcColorFactor,sourceAlpha:i.SrcAlphaFactor,oneMinusSourceAlpha:i.OneMinusSrcAlphaFactor,destinationAlpha:i.DstAlphaFactor,oneMinusDestinationAlpha:i.OneMinusDstAlphaFactor},default:"sourceAlpha",displayWhen:{blending:{equals:"custom"}},enabledWhen:{blending:{equals:"custom"}}},blendDst:{displayName:"Blend Destination",description:"The second parameter to be used in the blend equation. Enabled when using custom blending.",isRenderParam:!0,type:"opt",options:{zero:i.ZeroFactor,one:i.OneFactor,sourceColor:i.SrcColorFactor,oneMinusSourceColor:i.OneMinusSrcColorFactor,sourceAlpha:i.SrcAlphaFactor,oneMinusSourceAlpha:i.OneMinusSrcAlphaFactor,destinationAlpha:i.DstAlphaFactor,oneMinusDestinationAlpha:i.OneMinusDstAlphaFactor,destinationColor:i.DstColorFactor,oneMinusDestinationColor:i.OneMinusDstColorFactor,sourceAlphaSaturate:i.SrcAlphaSaturateFactor},default:"one",displayWhen:{blending:{equals:"custom"}},enabledWhen:{blending:{equals:"custom"}}},useSeparateAlphaBlend:{displayName:"Separate Blend for Alpha",description:"Use different blend values for the alpha channel. Enabled when using custom blending.",type:"b",default:!1,displayWhen:{blending:{equals:"custom"}},enabledWhen:{blending:{equals:"custom"}}},blendEquationAlpha:{displayName:"Alpha Blend Equation",description:"The function to use when blending the current alpha with the one already in the buffer. Enabled when using custom blending and separate alpha blending.",isRenderParam:!0,type:"opt",options:{add:i.AddEquation,subtract:i.SubtractEquation,reverseSubtract:i.ReverseSubtractEquation,minimum:i.MinEquation,maximum:i.MaxEquation},default:"add",displayWhen:{blending:{equals:"custom"},useSeparateAlphaBlend:{equals:!0}},enabledWhen:{blending:{equals:"custom"},useSeparateAlphaBlend:{equals:!0}}},blendSrcAlpha:{displayName:"Alpha Blend Source",description:"The first parameter to be used in the alpha blend equation. Enabled whenusing custom blending and separate alpha blending.",isRenderParam:!0,type:"opt",options:{zero:i.ZeroFactor,one:i.OneFactor,sourceColor:i.SrcColorFactor,oneMinusSourceColor:i.OneMinusSrcColorFactor,sourceAlpha:i.SrcAlphaFactor,oneMinusSourceAlpha:i.OneMinusSrcAlphaFactor,destinationAlpha:i.DstAlphaFactor,oneMinusDestinationAlpha:i.OneMinusDstAlphaFactor},default:"sourceAlpha",displayWhen:{blending:{equals:"custom"},useSeparateAlphaBlend:{equals:!0}},enabledWhen:{blending:{equals:"custom"},useSeparateAlphaBlend:{equals:!0}}},blendDstAlpha:{displayName:"Alpha Blend Destination",description:"The second parameter to be used in the alpha blend equation.Enabled when using custom blending and separate alpha blending.",isRenderParam:!0,type:"opt",options:{zero:i.ZeroFactor,one:i.OneFactor,sourceColor:i.SrcColorFactor,oneMinusSourceColor:i.OneMinusSrcColorFactor,sourceAlpha:i.SrcAlphaFactor,oneMinusSourceAlpha:i.OneMinusSrcAlphaFactor,destinationAlpha:i.DstAlphaFactor,oneMinusDestinationAlpha:i.OneMinusDstAlphaFactor,destinationColor:i.DstColorFactor,oneMinusDestinationColor:i.OneMinusDstColorFactor,sourceAlphaSaturate:i.SrcAlphaSaturateFactor},default:"one",displayWhen:{blending:{equals:"custom"},useSeparateAlphaBlend:{equals:!0}},enabledWhen:{blending:{equals:"custom"},useSeparateAlphaBlend:{equals:!0}}},polygonOffset:{displayName:"Polygon Offset",description:"Turns on rendering with polygon offsets. This can be used to work around z-fighting.",isRenderParam:!0,type:"b",default:!1},polygonOffsetFactor:{displayName:"Polygon Offset Factor",description:"Scales the maximum Z slope, with respect to X or Y of the polygon.",isRenderParam:!0,type:"f",default:1},polygonOffsetUnits:{displayName:"Polygon Offset Units",description:"Scales the minimum resolvable depth buffer value.",isRenderParam:!0,type:"f",default:1},alphaTest:{displayName:"Alpha Test",description:'Pixels with an alpha value below the given value will not be rendered. This value will only be used when this material\'s Transparency blending mode is set to "Masked"',isRenderParam:!0,forceUpdate:!0,type:"f",default:.2,min:0,max:1,step:.001}};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(11),n=r(5);t.makeXhr=function(e){return function(t){return e(t.path,t.params).then(function(e){return t.loaderData.xhr=e,Promise.resolve(t)})}},t.loadXhr=function(e){return new Promise(function(t,r){e.setLoading();var n=function(e){return parseInt(e.getResponseHeader("Content-Length"),10)},a=function(e){return{total:e.lengthComputable&&e.target?n(e.target):0,loaded:e.loaded}},o=function(){e.loaderData.xhr.abort(),t(e),e.off(i.default.CANCEL,o)},s=function(){e.off(i.default.CANCEL,o),t(e)},u=function(t){e.off(i.default.CANCEL,o),r(t)};e.on(i.default.CANCEL,o),e.loaderData.xhr.send(),e.loaderData.xhr.addEventListener("load",s),e.loaderData.xhr.addEventListener("error",u),e.loaderData.xhr.addEventListener("progress",function(t){return e.trigger(i.default.PROGRESS,a(t))})})},t.requireStatus=function(e){return function(t){return e(t.loaderData.xhr.status)?Promise.resolve(t):Promise.reject(new Error("Failed to load: "+t.path+" status: "+t.loaderData.xhr.status))}},t.setResponseType=function(e){return function(t){return t.loaderData.xhr.responseType=t.params.responseType||e,Promise.resolve(t)}},t.setCustomHeaders=function(e){return e.params.headers&&n.forEach(e.params.headers,function(t,r){e.loaderData.xhr.setRequestHeader(r,t)}),Promise.resolve(e)},t.handleError=function(e){return function(t){return e.setError(t),Promise.reject(t)}},t.unlessCancelled=function(e){return function(t){return t.isCancelled()?Promise.resolve(t):e(t)}};var a=function(e,t,r){return function(i){return Math.min(t,e*Math.pow(r,i))}};t.retry=function(e,r,i,n,o){return void 0===i&&(i=a(250,12e4,2)),void 0===n&&(n=16),void 0===o&&(o=0),t.unlessCancelled(function(a){return r.reduce(function(e,t){return e.then(t)},Promise.resolve(a)).then(function(a){return new Promise(function(s,u){e(a)&&othis.pitchAngleBoundsMax?this.targetEuler.x=this.pitchAngleBoundsMax:this.targetEuler.x1&&n.default.warn('Clip "'+e+'" contains multiple layers, but AnimationAsset.prototype.createAnimation() only supports a single layer.');var o=this.getLayer(i.layers[0]),s=o?o.channels:[],u=s.map(function(e){return r.createKeyframeTrack(e,i.start,i.stop,t)});return new a.AnimationClip(i.name,i.stop-i.start,u)},t.prototype.createRuntimeData=function(e){var t=this;this.when("loadDependencies",function(){t.isDestroyed()||e()},this)},t.prototype.applyPropertiesUnloaded=function(t){void 0===t&&(t={}),e.prototype.applyPropertiesUnloaded.call(this,t),t.hasOwnProperty("channels")&&this.registerBufferDependency()},t.prototype.registerBufferDependency=function(){var e=this,t=this.getChannels(),r=[];t.forEach(function(e){r.push(e.times),r.push(e.values)}),r.forEach(function(t){var r=t.split("#");if(2!==r.length)throw new Error(e.engine.getName()+" - AnimationAsset: Invalid accessorId, "+t);e.registerDependencyById(r[0])})},t.prototype.createKeyframeTrack=function(e,t,r,i){var n=this,o=this.getChannel(e);if(!o)throw new Error(this.engine.getName()+" - AnimationAsset: Channel not found, "+e);var s=[e,t,r].join("#"),u=this.trackData[s];u||(u=this.createKeyframeTrackData(o,t,r),this.trackData[s]=u);var p=o.targetObject.map(function(e){var t=i?i[e]:e;return n.engine.getRuntimeName(t)}),c=p.join("/")+"."+o.targetProperty;return new("quaternion"===o.targetProperty?a.QuaternionKeyframeTrack:a.VectorKeyframeTrack)(c,u.times,u.values,null)},t.prototype.createKeyframeTrackData=function(e,t,r){var i=e.times.split("#"),n=i[0],a=i[1],o=this.engine.getEntityById(n);if(!o)throw new Error(this.engine.getName()+" - AnimationAsset: BufferAsset not found, "+n);var u=o.getAccessor(a),p=o.getArray(a);if(!u||!p)throw new Error(this.engine.getName()+" - AnimationAsset: Accessor not found, "+a);var c=e.values.split("#"),h=c[0],l=c[1],d=this.engine.getEntityById(h);if(!d)throw new Error(this.engine.getName()+" - AnimationAsset: BufferAsset not found, "+h);var f=d.getAccessor(l),m=d.getArray(l);if(!f||!m)throw new Error(this.engine.getName()+" - AnimationAsset: Accessor not found, "+l);var y,g=-1;for(y=0;y=t){g=y;break}var v=-1;for(y=p.length;y-- >0;)if(p[y]<=r){v=y;break}var b=g>=0?g:0,x=v>=0?v+1:p.length,P=s.default.getTypeSize(f.type),w=p.subarray(b,x),E=m.subarray(b*P,x*P);return{times:0===t?w:w.slice().map(function(e){return e-t}),values:E}},t}(o.default);p.addSchemas("AnimationAsset",c),t.default=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(6),a=r(4),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.uninitialize=function(){this.runtimeData&&this.runtimeData.pause(),e.prototype.uninitialize.call(this)},t.prototype.applyPropertiesLoaded=function(t,r){if(e.prototype.applyPropertiesLoaded.call(this,t,r),this.runtimeData&&(t.hasOwnProperty("loop")&&(this.runtimeData.loop=this.getProperty("loop")),t.hasOwnProperty("state")))switch(this.getProperty("state")){case"pause":this.runtimeData.pause();break;case"play":this.runtimeData.play()}},t}(n.default);a.addSchemas("AudioAsset",o),t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(20),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.createRuntimeData=function(e){this.createRTImageData(),this.trigger("loadProgress",this),e()},t.prototype.getLayout=function(){return this.getProperty("layout")},t.prototype.getWidth=function(){return this.getProperty("width")},t.prototype.getHeight=function(){return this.getProperty("height")},t.prototype.applyPropertiesLoaded=function(t,r){if(e.prototype.applyPropertiesLoaded.call(this,t,r),(t.hasOwnProperty("format")||t.hasOwnProperty("type")||t.hasOwnProperty("width")||t.hasOwnProperty("height"))&&"init"!==r)return void this.reloadBase();this.runtimeData.texture.encoding=this.getThreeEncoding()},t}(n.default);t.default=a},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(24),s=r(9),u=r(21),p=r(5),c=r(4),h=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(r,t),r.prototype.getBounds=function(e){var t=this.getProperty("bounds");return(e||new a.Box3).set(t.min,t.max)},r.prototype.getDataSizeInMemorySelf=function(){return 0},r.prototype.applyPropertiesUnloaded=function(e){t.prototype.applyPropertiesUnloaded.call(this,e),e.accessorId&&this.registerBufferDependency()},r.prototype.createRuntimeData=function(e){var t=this;this.when("loadDependencies",function(){if(!t.isDestroyed()){if(t.getDependencies().some(function(e){return e.isLoadFailed()}))t.setState(s.StateType.Base,s.State.Failed);else try{t.decode()}catch(e){n.default.error(e.toString()),t.setState(s.StateType.Base,s.State.Failed)}e()}})},r.prototype.createBufferAttribute=function(e,t,r,i){var n=r.num_points(),o=i.components_count(),s=n*o,u=new e.DracoFloat32Array;t.GetAttributeFloatForAllPoints(r,i,u);for(var p=new Float32Array(s),c=0;c0&&(f.addGroup(v,b,g),v+=b),g=P)}b=3*c-v,b>0&&f.addGroup(v,b,g),e.destroy(y)}else f.addGroup(0,3*c,-1);var w=this.getProperty("bounds"),E=new a.Vector3(w.min.x,w.min.y,w.min.z),T=new a.Vector3(w.max.x,w.max.y,w.max.z);f.boundingBox=new a.Box3(E,T),f.computeBoundingSphere(),this.addMissingAttributes(f),this.setGeometry(o.default.primitiveType.TRIANGLES,f)},r.prototype.decode=function(){var t=e.Module;if(!t)throw new Error("Draco module not found");var r=u.default.getBufferArray(this.engine,this.getProperty("accessorId")),i=new t.DecoderBuffer;i.Init(r,r.byteLength),i.Init(r,r.byteLength);var a=new t.WebIDLWrapper,o=a.GetEncodedGeometryType(i);if(o===t.TRIANGULAR_MESH){var s=a.DecodeMeshFromBuffer(i);this.createBufferGeometry(t,a,s),t.destroy(s)}else n.default.warn(this.engine.getName()+" - DracoGeometryAsset: Unrecognized geometry type '"+o+"'");t.destroy(a),t.destroy(i)},r.prototype.registerBufferDependency=function(){var e=this.getProperty("accessorId"),t=e.split("#");if(2!==t.length)throw new Error(this.engine.getName()+" - DracoGeometryAsset: Invalid accessorId, "+e);this.registerDependencyById(t[0])},r}(o.default);c.addSchemas("DracoGeometryAsset",h),t.default=h}).call(t,r(77))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(9),o=r(12),s=r(11),u=r(15),p=r(4),c=["red","green","blue"],h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.loadPriority=2,t}return i.__extends(t,e),t.prototype.unload=function(){this.runtimeData&&(this.engine.trigger("imageUnloaded",this.id),n.default.info(this.engine.getName()+" - Unloading image, "+this.getName()),e.prototype.unload.call(this))},t.prototype.getChosenRepresentation=function(){return this.chosenRepresentation},t.prototype.isCompressed=function(){return this.runtimeData?"jpeg"!==this.runtimeData.compression&&"zip"!==this.runtimeData.compression:this.getProperty("useCompression")},t.prototype.getCompressionFormat=function(){if(this.getProperty("useCompression")){var e=this.engine.getThreeRenderer();if(e){var t=e.extensions;if(t.get("WEBGL_compressed_texture_s3tc"))return"dxt";if(t.get("WEBGL_compressed_texture_pvrtc"))return"pvrtc"}}},t.prototype.getFormat=function(){var e=this.getChosenRepresentation();if(e.channels)switch(e.channels.length){case 4:return"alpha"===e.channels[3]?"rgba":"rgb";case 3:return"rgb";case 2:return"luminanceAlpha";case 1:return"luminance";default:return"rgb"}},t.prototype.getOriginalWidth=function(){return this.getProperty("width")||0},t.prototype.getOriginalHeight=function(){return this.getProperty("height")||0},t.prototype.getMaxRepresentationWidth=function(){var e=this.get("representations");return e?e.reduce(function(e,t){return t.width>e?t.width:e},0):0},t.prototype.getMaxRepresentationHeight=function(){var e=this.get("representations");return e?e.reduce(function(e,t){return t.height>e?t.height:e},0):0},t.prototype.getMaxTextureSize=function(){var t=this.engine.getRenderer();return t?t.getMaxTextureSize2d():e.prototype.getMaxTextureSize.call(this)},t.prototype.getImageResponseType=function(e){switch(e){case"image/vnd-ms.dds":return"arraybuffer";default:return"blob"}},t.prototype.applyPropertiesUnloaded=function(e){var t={maxSize:Math.max(this.getWidth(),this.getHeight()),compression:this.getCompressionFormat()};this.chosenRepresentation=this.findRepresentation(t)},t.prototype.applyPropertiesLoaded=function(t,r){e.prototype.applyPropertiesLoaded.call(this,t,r),t.hasOwnProperty("useCompression")&&this.getProperty("useCompression")!==this.getPreviousProperty("useCompression")&&"init"!==r&&this.reloadBase()},t.prototype.createRuntimeData=function(e){var t=this;if(!this.chosenRepresentation)throw new Error("No suitable representation found to load");this.loadLowResImage(e).then(function(){return t.loadHighResImage(e)}).catch(this.onImageLoadError.bind(this))},t.prototype.loadLowResImage=function(e){var t=this;if(this.loadPriority=2,!this.getProperty("stream"))return Promise.resolve();var r={maxSize:64},i=this.findRepresentation(r);return i?new Promise(function(r,n){var a=t.loadResource(i.src,u.default.IMAGE,e,{priority:t.loadPriority,responseType:t.getImageResponseType(i.contentType),isExternal:i.isExternal});a.once(s.default.LOAD,function(e){t.onImageLoad(e,i),t.loadPriority=8,r()}),a.once(s.default.CANCEL,function(){n(new Error("Failed to load low res texture"))}),a.once(s.default.ERROR,n)}):Promise.resolve()},t.prototype.loadHighResImage=function(e){var t=this;if(!this.isDestroyed())return new Promise(function(r,i){var n=function(e){t.isDestroyed()||(t.loadedBytes=t.getDataSizeDownload()*e.loaded/e.total,t.trigger("loadProgress",t))};t.setState(a.StateType.Base,a.State.InProgress);var o=t.chosenRepresentation,p=t.loadResource(o.src,u.default.IMAGE,e,{responseType:t.getImageResponseType(o.contentType),isExternal:o.isExternal,priority:t.loadPriority});p.once(s.default.PROGRESS,n),p.once(s.default.LOAD,function(e){t.onImageLoad(e,o)}),p.once(s.default.ERROR,i)})},t.prototype.onImageLoad=function(e,t){if(this.runtimeData||(this.runtimeData={}),this.runtimeData.contentType=t.contentType,this.runtimeData.compression=t.compression,this.runtimeData.colorspace=t.colorspace,this.runtimeData.channels=this.getOwnProperty("channels")||t.channels||c,this.runtimeData.width=t.width,this.runtimeData.height=t.height,!(e instanceof ArrayBuffer||e instanceof Image))throw new Error("Unknown container type for image data!");this.runtimeData.imageData=e,this.loadedBytes=this.getDataSizeDownload(),this.trigger("loadProgress",this)},t.prototype.onImageLoadError=function(e){this.isDestroyed()||(n.default.error("There was an error loading the image, "+this.getName(),e),this.setState(a.StateType.Base,a.State.Failed),this.loadedBytes=this.getDataSizeDownload(),this.trigger("loadProgress",this))},t.prototype.findRepresentation=function(e){void 0===e&&(e={});var t=this.get("representations");if(!t||0===t.length)return null;var r=Object.assign({maxSize:16384},e),i=t.filter(function(e){if(e.compression===r.compression)return!0;switch(e.compression){case"zip":case"jpeg":return!r.compression;case"dxt":case"dxt1":case"dxt5":return"dxt"===r.compression}return!1});0===i.length&&(i=t.filter(function(e){return"zip"===e.compression||"jpeg"===e.compression}));var n=i.filter(function(e){var t=e.channels||c;return!r.channels||t.toString()===r.channels.toString()});0===n.length&&(n=i);var a=["image/vnd-ms.dds"],o=n.filter(function(e){var t=Math.max(e.width,e.height),i=-1!==a.indexOf(e.contentType);return t<=r.maxSize||i}),s=o.reduce(function(e,t,r){return Math.max(t.width,t.height)>(e>=0?Math.max(o[e].width,o[e].height):0)?r:e},-1);return s>=0?o[s]:null},t}(o.default);p.addSchemas("ImageAsset",h),t.default=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(24),s=r(9),u=r(21),p=r(5),c=r(4),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.getDataSizeInMemorySelf=function(){var e=this,t=this.getProperty("attributes");return Object.keys(t).map(function(r){var i=t[r],n=u.default.getBufferAccessor(e.engine,i.accessorId);return u.default.getComponentTypeSize(n.componentType)*u.default.getTypeSize(n.type)*n.count}).reduce(function(e,t){return t+e},0)},t.prototype.applyPropertiesUnloaded=function(t){e.prototype.applyPropertiesUnloaded.call(this,t),(t.attributes||t.indices)&&this.registerBufferDependency()},t.prototype.createRuntimeData=function(e){var t=this;this.when("loadDependencies",function(){if(!t.isDestroyed()){if(t.getDependencies().some(function(e){return e.isLoadFailed()}))t.setState(s.StateType.Base,s.State.Failed);else try{t.createBufferGeometry()}catch(e){n.default.error(e.toString()),t.setState(s.StateType.Base,s.State.Failed)}e()}})},t.prototype.createAttributes=function(e){var t=this,r={indices:"index",positions:"position",normals:"normal",tangents:"tangent",colors:"color",uvs1:"uv",uvs2:"uv2",skinIndices:"skinIndex",skinWeights:"skinWeight"},i=Object.assign({indices:{accessorId:this.getProperty("indices")}},this.getProperty("attributes")),n={};return p.forEach(r,function(r,a){if(i.hasOwnProperty(a)){var o=i[a].accessorId;n[r]=t.createBufferAttribute(o,e[r])}}),n},t.prototype.createBufferAttribute=function(e,t){var r=u.default.getBufferAccessor(this.engine,e),i=u.default.getBufferArray(this.engine,e),n=u.default.getTypeSize(r.type);if(void 0===t||n===t)return new a.BufferAttribute(i,n);for(var o=new i.constructor(r.count*t),s=Math.min(n,t),p=0;p0){var p=t.getEngine();r={},s.forEach(o[0],function(e,t){var i=p.getObjectById(t),n=p.getObjectById(e);r[i.getSid()]=n.getSid()})}}if(!t.asset.getClip(t.clipId))return void(e&&e(new Error('Invalid clip ID "'+t.clipId+'"')));var c=t.asset.createClip(t.clipId,r);return c?(t.action=t.mixer.clipAction(c),t.action?(t.action.setLoop(t.loop?a.LoopRepeat:a.LoopOnce,1/0),t.action.timeScale=t.speed,t.action.time=t.startTime,t.action.weight=t.weight,t.action.clampWhenFinished=!0,t.action.paused=t.paused,t.dirty=!1,t.getEntity().trigger("animationLoaded"),void(e&&e(null,t))):void(e&&e(new Error("Failed to create THREE.AnimationAction")))):void(e&&e(new Error('Failed to create animation clip "'+t.clipId+'"')))}),void(this.asset.isUnloaded()&&this.asset.load())):void(e&&e(new Error("No asset assigned")))):void(e&&e(new Error("Mixer is not initialized")))},t.prototype.pause=function(){this.paused=!0,this.action&&(this.action.paused=this.paused)},t.prototype.play=function(){var e=this;if(this.paused=!1,this.dirty)return void this.load(function(t){if(t)return void n.default.error("Error playing animation: ",t.toString());e.play()});this.action&&(this.needsReset&&(this.action.reset(),this.action.time=this.startTime,this.needsReset=!1),this.action.play(),this.action.paused=this.paused)},t.prototype.playAnimation=function(e,t,r,i,n){void 0!==e&&this.setAsset(this.getEngine().getEntityById(e)),void 0!==t&&this.setClipId(t),this.loop=void 0!==r?r:this.loop,this.speed=void 0!==i?i:this.speed,this.startTime=void 0!==n?n:this.startTime,this.play()},t.prototype.release=function(){this.stop(),this.action&&(this.action.stop(),this.action=void 0)},t.prototype.setAsset=function(e){this.asset!==e&&(this.asset&&(this.stopListening(this.asset,"change:properties",this.onAssetChanged),this.unregisterDependency(this.asset)),this.asset=e,this.dirty=!0,this.asset&&(this.listenTo(this.asset,"change:properties",this.onAssetChanged),this.registerDependency(this.asset)))},t.prototype.setClipId=function(e){this.clipId!==e&&(this.clipId=e,this.dirty=!0)},t.prototype.setLoop=function(e){this.loop=e,this.action&&this.action.setLoop.apply(this.action,[this.loop?a.LoopRepeat:a.LoopOnce,1/0])},t.prototype.setSpeed=function(e){this.speed=e,this.action&&(this.action.timeScale=e)},t.prototype.setTime=function(e){this.action&&(this.action.time=e)},t.prototype.setWeight=function(e){this.weight=e,this.action&&(this.action.weight=this.weight)},t.prototype.onShutdown=function(){this.asset&&this.stopListening(this.asset,"stopListening",this.onAssetChanged),this.release(),this.getEntity().off("playAnimation",this.playAnimation,this),this.getEntity().off("pauseAnimation",this.pause,this),this.getEntity().off("stopAnimation",this.stop,this),this.getEntity().off("toggleAnimation",this.toggle,this)},t.prototype.stop=function(){this.action&&this.action.stop()},t.prototype.toggle=function(){this.isPlaying()?this.pause():this.play()},t.prototype.onUpdate=function(e){this.mixer&&(this.mixer.update(e),this.getEngine().needsRender=!0,this.ended&&(this.getEntity().trigger("endAnimation"),this.ended=!1))},t.prototype.onAssetChanged=function(){this.dirty=!0},t.prototype.onMixerEvent=function(e){e.action===this.action&&"finished"===e.type&&(this.needsReset=!0,this.ended=!0)},t}(o.default);t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(2),s=function(e){function t(){var t=e.call(this)||this;return t.context=null,t}return i.__extends(t,e),t.prototype.onStartup=function(){if(this.context=this.getEntity().engine.getAudioContext(),!this.context)return void n.default.warn("Failed to create Web Audio context.")},t.prototype.onUpdate=function(){if(this.hasRuntimeData()&&this.context){var e=this.getRuntimeData().matrixWorld,t=new a.Vector3(0,0,0).applyMatrix4(e),r=new a.Vector3(0,0,-1).applyMatrix4(e).sub(t).normalize(),i=new a.Vector3(0,1,0).applyMatrix4(e).sub(t).normalize();this.context.listener.setPosition(t.x,t.y,t.z),this.context.listener.setOrientation(r.x,r.y,r.z,i.x,i.y,i.z)}},t}(o.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(25),s=r(2),u=r(15),p=r(11),c=function(e){function t(){var t=e.call(this)||this;return t.gainNode=null,t.sourceNode=null,t.pannerNode=null,t.context=null,t.buffer=null,t.startTime=0,t.playOffset=0,t.state="stopped",t.element=null,t.isVideo=!1,t}return i.__extends(t,e),t.prototype.getGain=function(){return this.gain},t.prototype.getState=function(){return this.state},t.prototype.isLoop=function(){return this.loop},t.prototype.isPaused=function(){return"paused"===this.state},t.prototype.isPlaying=function(){return"playing"===this.state},t.prototype.isStopped=function(){return"stopped"===this.state},t.prototype.pause=function(){"playing"===this.state&&(this.playOffset=this.getCurrentTime(),this.state="paused",this.freeAudioGraph())},t.prototype.play=function(e){var t=this;void 0===e&&(e=0),"paused"!==this.state&&"stopped"!==this.state||(this.playOffset+=e,this.initAudioGraph(function(e){if(e)return void n.default.warn("Error playing audio: "+e);t.setGain(t.gain),t.setLoop(t.loop),t.stream?(t.element.currentTime=t.playOffset,t.element.play()):t.context?(t.startTime=t.context.currentTime,t.sourceNode.start(0,t.playOffset)):n.default.warn("No Web Audio context."),t.state="playing"}))},t.prototype.setGain=function(e){this.gain=e,this.gainNode?this.gainNode.gain.value=this.gain:this.element&&(this.element.volume=this.gain)},t.prototype.setLoop=function(e){this.loop=e,this.element?this.element.loop=this.loop:this.sourceNode&&(this.sourceNode.loop=this.loop)},t.prototype.stop=function(){"playing"!==this.state&&"paused"!==this.state||(this.playOffset=0,this.state="stopped",this.freeAudioGraph())},t.prototype.toggle=function(){"playing"===this.state?this.pause():this.play()},t.prototype.onStartup=function(){this.context=this.getEntity().engine.getAudioContext(),this.context?(this.gainNode=this.context.createGain(),this.pannerNode=this.context.createPanner()):(n.default.warn("No audio context, using fallback."),this.stream=!0,this.positional=!1),this.isVideo=this.asset instanceof o.default,this.isVideo&&(this.stream=!0),this.autoPlay?this.play():this.preload&&this.load(function(e,t){e&&n.default.warn(e)}),this.listenTo(this.getEntity(),"playAudio",this.play),this.listenTo(this.getEntity(),"pauseAudio",this.pause),this.listenTo(this.getEntity(),"stopAudio",this.stop),this.listenTo(this.getEntity(),"toggleAudio",this.toggle)},t.prototype.onUpdate=function(){if(this.hasRuntimeData()&&this.positional){var e=this.getRuntimeData().matrixWorld,t=new a.Vector3(0,0,0).applyMatrix4(e),r=new a.Vector3(0,0,1).applyMatrix4(e).sub(t).normalize();this.pannerNode.setPosition(t.x,t.y,t.z),this.pannerNode.setOrientation(r.x,r.y,r.z)}},t.prototype.initAudioGraph=function(e){var t=this;this.load(function(r,i){if(r)return e(r);if(!t.context)return e(null,null);var n=[];t.stream?t.sourceNode=t.context.createMediaElementSource(i):(t.sourceNode=t.context.createBufferSource(),t.sourceNode.buffer=i),n.push(t.sourceNode),n.push(t.gainNode),t.positional&&n.push(t.pannerNode),n.push(t.context.destination);for(var a=1;a0)){var i=this.getRuntimeData(),n=new a.Vector3,o=new a.Vector3;n.copy(i.position),o.copy(i.scale),i.position.set(0,0,0),i.scale.set(1,1,1),i.updateMatrix();var s=(new a.Matrix4).makeRotationX(.0174532925*(e.x||0)),u=(new a.Matrix4).makeRotationY(.0174532925*(e.y||0)),p=(new a.Matrix4).makeRotationZ(.0174532925*(e.z||0));p.multiply(u),p.multiply(s),t&&p.multiply(i.matrix),this.target.setFromRotationMatrix(p),r?(this.setRotation(this.target),this.getEntity().trigger("end_axis_rotation"),this.getEngine().needsRender=!0):this.time=this.speed,i.position.copy(n),i.scale.copy(o)}},t.prototype.setRotation=function(e){this.getEntity().setQuaternion(e.x,e.y,e.z,e.w),this.hasRuntimeData()&&!this.getRuntimeData().quaternion.equals(e)&&this.getRuntimeData().quaternion.copy(e),this.getEngine().needsRender=!0},t.prototype.getSign=function(e){return e>0?"+":"-"},t.prototype.onStartup=function(){this.listenTo(this.getEntity(),"rotate_on_axis",this.rotateOnWorldAxis),this.listenTo(this.getEntity(),"set_axes_orientation",this.setAxesOrientation)},t.prototype.onUpdate=function(e){this.time>=0&&this.hasRuntimeData()&&(this.time-=e,this.tempQuat.copy(this.getRuntimeData().quaternion),this.tempQuat.slerp(this.target,Math.min(1,Math.max(0,1-1/(this.speed/this.time)))),this.getEntity().setQuaternion(this.tempQuat.x,this.tempQuat.y,this.tempQuat.z,this.tempQuat.w),this.getEngine().needsRender=!0,this.time<0&&(this.setRotation(this.target),this.getEntity().trigger("end_axis_rotation")))},t}(o.default);t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(22),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.recursive=!0,t.boxGeometry=new n.BoxGeometry(1,1,1),t.topBoxMaterial=new n.MeshBasicMaterial({color:4607,wireframe:!0}),t.subBoxMaterial=new n.MeshBasicMaterial({color:16713728,wireframe:!0}),t.workBounds=new n.Box3,t.helpers=[],t}return i.__extends(t,e),t.prototype.onStartup=function(){var e=this,t=this.getEntity();this.recursive&&t.getDescendantsByType("mesh").forEach(function(t){e.createBoundingBox(t,e.subBoxMaterial)}),this.createBoundingBox(t,this.topBoxMaterial,!1)},t.prototype.onShutdown=function(){this.helpers.forEach(function(e){e.boxMesh.parent&&e.boxMesh.parent.remove(e.boxMesh)})},t.prototype.onEnable=function(){this.helpers.forEach(function(e){return e.boxMesh.visible=!0})},t.prototype.onDisable=function(){this.helpers.forEach(function(e){return e.boxMesh.visible=!1})},t.prototype.createBoundingBox=function(e,t,r){var i=this;void 0===r&&(r=!0),e&&e.when("loadBase",function(){var a=e instanceof o.default&&r?e.getLocalBounds(i.workBounds):e.getBounds(i.workBounds),s={boxMesh:new n.Mesh(i.boxGeometry,t),object:e,bounds:a};i.isEnabled()||(s.boxMesh.visible=!1),i.helpers.push(s),s.bounds.getSize(s.boxMesh.scale),s.bounds.getCenter(s.boxMesh.position),e.runtimeData.add(s.boxMesh)})},t}(a.default);t.default=s},function(e,t,r){"use strict";function i(e,t,r){var i=t-e;return Math.min(t,Math.max(e,e+i*r))}Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),a=r(2),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.perspectiveZoomMax=180,t.perspectiveZoomMin=0,t.orthoZoomMax=5,t.orthoZoomMin=0,t.perspectiveStep=4,t.orthographicStep=.2,t}return n.__extends(t,e),t.prototype.zoom=function(e){if(void 0===e&&(e=0),this.hasRuntimeData()&&this.isEnabled()){switch(this.getEntity().getProperty("cameraType")){case"perspective":this.zoomPerspective(e);break;case"orthographic":this.zoomOrthographic(e)}this.updateRenderer()}},t.prototype.lerpZoom=function(e){if(this.hasRuntimeData()&&this.isEnabled()){var t=this.getEntity(),r=Math.max(0,Math.min(1,e));switch(t.getProperty("cameraType")){case"perspective":this.lerpZoomPerspective(r);break;case"orthographic":this.lerpZoomOrtho(r)}this.updateRenderer()}},t.prototype.getZoomLevel=function(){var e,t,r=this.getEntity().getProperty("cameraType"),i=this.getRuntimeData();return"perspective"===r?(e=this.perspectiveZoomMax-this.perspectiveZoomMin,t=i.fov-this.perspectiveZoomMin):(e=this.orthoZoomMax-this.orthoZoomMin,t=i.top+Math.abs(i.bottom)-this.orthoZoomMin),t/e},t.prototype.setPerspectiveBounds=function(e,t){this.perspectiveZoomMin=e,this.perspectiveZoomMax=t,this.zoom()},t.prototype.setOrthographicBounds=function(e,t){this.orthoZoomMin=e,this.orthoZoomMax=t,this.zoom()},t.prototype.onStartup=function(){this.listenTo(this.getEntity(),"change:properties",this.onPropertyChanges),this.listenTo(this.getEntity(),"lerpZoom",this.lerpZoom),this.listenTo(this.getEntity(),"zoom",this.zoom)},t.prototype.zoomPerspective=function(e){var t=this.getRuntimeData(),r=t.fov,i=r+e*this.perspectiveStep,n=Math.min(this.perspectiveZoomMax,Math.max(this.perspectiveZoomMin,i));this.setFOV(n)},t.prototype.lerpZoomPerspective=function(e){var t=i(this.perspectiveZoomMin,this.perspectiveZoomMax,e);this.setFOV(t)},t.prototype.zoomOrthographic=function(e){var t=this.getRuntimeData(),r=2*t.top+e*this.orthographicStep,i=Math.min(this.orthoZoomMax,Math.max(this.orthoZoomMin,r));this.setOrthoBounds(i)},t.prototype.lerpZoomOrtho=function(e){var t=i(this.orthoZoomMin,this.orthoZoomMax,e);this.setOrthoBounds(t)},t.prototype.onPropertyChanges=function(e){e.cameraType&&this.zoom()},t.prototype.setFOV=function(e){this.getEntity().setProperty("fov",e)},t.prototype.setOrthoBounds=function(e){var t=this.getEntity().getAspectRatio();this.getEntity().setProperties({top:.5*e,bottom:.5*-e,right:t*e*.5,left:t*-e*.5})},t.prototype.updateRenderer=function(){this.getEngine().needsRender=!0},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=function(e){function t(){var t=e.call(this)||this;return t.framesElapsed=0,t.near=1,t.far=12e3,t.updateFrameInterval=0,t.cubeMaterial=void 0,t.tempRenderTexture=void 0,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.initCameras()},t.prototype.onShutdown=function(){this.hasRuntimeData()&&this.getRuntimeData().remove(this.cubeCamera)},t.prototype.onEntityLoaded=function(){this.getRuntimeData().add(this.cubeCamera)},t.prototype.onAttributesChanged=function(e){var t=this;-1!==e.indexOf("captureTexture")&&(this.captureTexture?(this.captureTexture.when("load",function(){t.tempRenderTexture&&t.tempRenderTexture.unload()}),this.captureTexture.isBaseUnloaded()&&this.captureTexture.load()):this.tempRenderTexture||this.createTempRenderTexture()),this.hasRuntimeData()&&(-1===e.indexOf("near")&&-1===e.indexOf("far")||(this.cameraPX.near=this.near,this.cameraPX.far=this.far,this.cameraPX.updateProjectionMatrix(),this.cameraNX.near=this.near,this.cameraNX.far=this.far,this.cameraNX.updateProjectionMatrix(),this.cameraPY.near=this.near,this.cameraPY.far=this.far,this.cameraPY.updateProjectionMatrix(),this.cameraNY.near=this.near,this.cameraNY.far=this.far,this.cameraNY.updateProjectionMatrix(),this.cameraPZ.near=this.near,this.cameraPZ.far=this.far,this.cameraPZ.updateProjectionMatrix(),this.cameraNZ.near=this.near,this.cameraNZ.far=this.far,this.cameraNZ.updateProjectionMatrix()),-1!==e.indexOf("debugView")&&this.cubeCamera.traverse(function(e){e instanceof n.PerspectiveCamera&&(e.cameraHelper||(e.cameraHelper=new n.CameraHelper(e),t.getRootThreeObject().add(e.cameraHelper)),e.cameraHelper.visible=!!t.debugView)}))},t.prototype.captureScene=function(){var e=this.getRenderer(),t=this.getRootThreeObject(),r=this.captureTexture?this.captureTexture.runtimeData:this.tempRenderTexture.runtimeData;if(r){var i=r.texture.generateMipmaps,n=[],a=[];r.texture.generateMipmaps=!1,this.renderPosX&&(a.push(0),n.push(this.cameraPX)),this.renderNegX&&(a.push(1),n.push(this.cameraNX)),this.renderPosY&&(a.push(2),n.push(this.cameraPY)),this.renderNegY&&(a.push(3),n.push(this.cameraNY)),this.renderPosZ&&(a.push(4),n.push(this.cameraPZ)),this.renderNegZ&&(a.push(5),n.push(this.cameraNZ)),n.forEach(function(o,s){s===n.length-1&&(r.texture.generateMipmaps=i),r.activeCubeFace=a[s],e.renderView(t,o,{renderTarget:r,clearColor:!0})}),r.needsUpdate=!0}},t.prototype.onPreRender=function(){this.getRootObject().isLoaded()&&++this.framesElapsed>=this.updateFrameInterval&&this.isEnabled()&&(this.framesElapsed=0,this.captureScene())},t.prototype.getCubeCamera=function(){return this.cubeCamera},t.prototype.createTempRenderTexture=function(){this.tempRenderTexture=this.getEngine().createRenderTextureCube({width:512,height:512,format:"rgba",type:"uByte"},"render_tex_cube"),this.tempRenderTexture.load()},t.prototype.initCameras=function(){this.cubeCamera=new n.Object3D;this.cameraPX=new n.PerspectiveCamera(90,1,this.near,this.far),this.cameraPX.up.set(0,-1,0),this.cameraPX.lookAt(new n.Vector3(1,0,0)),this.cubeCamera.add(this.cameraPX),this.cameraNX=new n.PerspectiveCamera(90,1,this.near,this.far),this.cameraNX.up.set(0,-1,0),this.cameraNX.lookAt(new n.Vector3(-1,0,0)),this.cubeCamera.add(this.cameraNX),this.cameraPY=new n.PerspectiveCamera(90,1,this.near,this.far),this.cameraPY.up.set(0,0,1),this.cameraPY.lookAt(new n.Vector3(0,1,0)),this.cubeCamera.add(this.cameraPY),this.cameraNY=new n.PerspectiveCamera(90,1,this.near,this.far),this.cameraNY.up.set(0,0,-1),this.cameraNY.lookAt(new n.Vector3(0,-1,0)),this.cubeCamera.add(this.cameraNY),this.cameraPZ=new n.PerspectiveCamera(90,1,this.near,this.far),this.cameraPZ.up.set(0,-1,0),this.cameraPZ.lookAt(new n.Vector3(0,0,1)),this.cubeCamera.add(this.cameraPZ),this.cameraNZ=new n.PerspectiveCamera(90,1,this.near,this.far),this.cameraNZ.up.set(0,-1,0),this.cameraNZ.lookAt(new n.Vector3(0,0,-1)),this.cubeCamera.add(this.cameraNZ)},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(5),o=r(1),s=r(2),u=function(e){function t(){var t=e.call(this)||this;return t.controlPoints=void 0,t.prevControlPointsLength=0,t.closed=!1,t.tempVector=new o.Vector3,t.tempVector4=new o.Vector4,t.tempMatrix=new o.Matrix4,t.visualizationCurveColor=2236962,t.visualizationSelectedCurveColor=874150,t.orientationHelpers=[],t.canTryUpdateAgain=!0,t.curveMaterial=void 0,t.curveGeometry=void 0,t.curveMesh=void 0,t.curveTessellation=200,t.selected=!1,t.updateStarted=!1,t}return i.__extends(t,e),t.prototype.onSelected=function(){this.selected=!0,this.curveMaterial&&this.curveMaterial.color.setHex(this.visualizationSelectedCurveColor),this.orientationHelpers.forEach(function(e){return e.traverse(function(e){e.visible=!0})})},t.prototype.onUnselected=function(){this.selected=!1,this.curveMaterial&&this.curveMaterial.color.setHex(this.visualizationCurveColor),this.orientationHelpers.forEach(function(e){return e.traverse(function(e){e.visible=!1})})},t.prototype.isCurveInit=function(){return this.curve.points.length>0},t.prototype.onStartup=function(){this.initCurve()},t.prototype.onAttributesChanged=function(){this.initCurve()},t.prototype.onShutdown=function(){this.cleanupCurveMesh(),this.cleanupOrientationHelpers(),this.cleanupCurveMaterial()},t.prototype.initCurve=function(){!this.updateStarted&&this.controlPoints&&this.controlPoints.length&&(this.updateStarted=!0,this.cleanupCurveMesh(),this.cleanupOrientationHelpers(),this.prevControlPointsLength=this.controlPoints.length,this.createCurve(),this.enableVisualizations&&(this.cleanupCurveMesh(),this.createCurveMesh(),this.updateOrientationHelpers()))},t.prototype.createCurve=function(){var e=this,t=this.controlPoints.map(function(t){return t.off("change:properties",e.updateCurve,e),new o.Vector3});this.curve=new o.CatmullRomCurve3(t),this.closed&&(this.curve.closed=!0);var r=this.getEntity().getRootObject();r.when("loadDependencies",function(t){r.runtimeData.updateMatrixWorld(!0),a.forEach(e.controlPoints,function(t,r){if(t){var i=t.getPosition();e.curve.points[r].set(i.x,i.y,i.z),e.tempMatrix.makeRotationFromQuaternion(t.runtimeData.quaternion);var n=e.tempMatrix.toArray();e.tempVector.set(n[0],n[1],n[2]),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,i,.25,16711680)),e.tempVector.set(n[4],n[5],n[6]),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,i,.25,65280)),e.tempVector.set(n[8],n[9],n[10]),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,i,.25,255)),t.on("change:properties",e.updateCurve,e)}else e.tempVector.set(0,0,0),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,e.tempVector,.25,16711680)),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,e.tempVector,.25,16711680)),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,e.tempVector,.25,16711680))}),e.updateCurve({}),e.updateStarted=!1,e.selected||e.onUnselected(),e.trigger("curveInit")},this)},t.prototype.updateCurve=function(e){var t=this,r=0;e.hasOwnProperty("position")&&(a.forEach(this.controlPoints,function(e){e&&(e.runtimeData.parent?(e.getPosition(t.tempVector),t.tempVector4.set(t.tempVector.x,t.tempVector.y,t.tempVector.z,1),t.tempVector4.applyMatrix4(e.runtimeData.parent.matrixWorld),t.curve.points[r].set(t.tempVector4.x,t.tempVector4.y,t.tempVector4.z),r++):t.canTryUpdateAgain&&(t.canTryUpdateAgain=!1,setTimeout(function(){n.default.info("Trying again"),t.updateCurve({})},10)))}),this.enableVisualizations&&(this.cleanupCurveMesh(),this.createCurveMesh()),this.canTryUpdateAgain=!0),e.hasOwnProperty("quaternion")&&this.updateOrientationHelpers()},t.prototype.cleanupCurveMaterial=function(){this.curveMaterial&&(this.curveMaterial.dispose(),this.curveMaterial=void 0)},t.prototype.cleanupOrientationHelpers=function(){var e=this;this.orientationHelpers.forEach(function(t){e.getRootThreeObject().remove(t)}),this.orientationHelpers=[]},t.prototype.cleanupCurveMesh=function(){this.enableVisualizations&&this.curveMesh&&(this.getRootThreeObject().remove(this.curveMesh),this.curveGeometry.dispose(),this.curveMesh.material=void 0)},t.prototype.createCurveMesh=function(){var e=this;this.curveMaterial||(this.curveMaterial=new o.MeshPhongMaterial({color:this.visualizationCurveColor,transparent:!1,opacity:.75,blending:o.AdditiveBlending})),this.curve.points.length&&(this.curveGeometry=new o.TubeGeometry(this.curve,this.curveTessellation,.1,8,this.closed),this.curveMesh=new o.Mesh(this.curveGeometry,this.curveMaterial),this.getRootObject().when("loadBase",function(){e.getRootThreeObject().add(e.curveMesh),a.forEach(e.orientationHelpers,function(t){e.getRootThreeObject().add(t)})},this),this.updateOrientationHelpers())},t.prototype.updateOrientationHelpers=function(){var e=this;this.controlPoints.forEach(function(t,r){var i=t.runtimeData;e.orientationHelpers[3*r].position.copy(e.curve.points[r]),e.orientationHelpers[3*r+1].position.copy(e.curve.points[r]),e.orientationHelpers[3*r+2].position.copy(e.curve.points[r]),e.tempMatrix.makeRotationFromQuaternion(i.quaternion);var n=e.tempMatrix.toArray();e.tempVector.set(n[0],n[1],n[2]),e.orientationHelpers[3*r].setDirection(e.tempVector),e.tempVector.set(n[4],n[5],n[6]),e.orientationHelpers[3*r+1].setDirection(e.tempVector),e.tempVector.set(n[8],n[9],n[10]),e.orientationHelpers[3*r+2].setDirection(e.tempVector)})},t}(s.default);t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(e){function t(){return e.call(this)||this}return i.__extends(t,e),t.prototype.onStartup=function(){var e=this;this.logTag=document.createElement("div"),this.logTag.id="consoleLogger",this.logTag.style.position="absolute",this.logTag.style.top="0",this.logTag.style.left="0",this.logTag.style.width="100%",this.logTag.style.height="100%",this.logTag.style.margin="0",this.logTag.style.padding="0",this.logTag.style.color="#000",this.logTag.style.background="rgba(0,0,0,0.5)",this.logTag.style.fontWeight="bold",this.logTag.style.textAlign="left",this.logTag.style.overflow="scroll",this.logTag.style["pointer-events"]="none",this.logTag.style["z-index"]="1",window.document.body.appendChild(this.logTag),this.oldLog=window.console.log,this.oldError=window.console.error,this.oldWarn=window.console.warn,window.console.log=window.console.error=window.console.warn=function(t){e.logTag.innerHTML+=t+"
"}},t.prototype.onShutdown=function(){this.logTag&&(window.document.body.removeChild(this.logTag),window.console.log=this.oldLog,window.console.error=this.oldError,window.console.warn=this.oldWarn,this.logTag=void 0)},t}(n.default);t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=r(278),o=function(e){function t(){var t=e.call(this)||this;return t.stats=new a,t.initialized=!1,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.stats.showPanel(0)},t.prototype.onPreUpdate=function(){this.isEnabled()&&this.stats.begin()},t.prototype.onPostRender=function(){this.isEnabled()&&this.stats.end()},t.prototype.onEnable=function(){document.body.appendChild(this.stats.dom),this.initialized=!0},t.prototype.onDisable=function(){this.initialized&&(document.body.removeChild(this.stats.dom),this.initialized=!1)},t}(n.default);t.default=o},function(e,t,r){"use strict";function i(e,t){if(e&&e.style)for(var r in t)t.hasOwnProperty(r)&&(e.style[r]=t[r])}function n(e,t){e.classList?e.classList.add(t):e.className+=" "+t}Object.defineProperty(t,"__esModule",{value:!0});var a=r(0),o=r(1),s=r(2),u=r(5),p=r(20),c=r(233),h={position:"absolute",left:"0",top:"0",padding:"8px","border-radius":"5px","font-family":"proxima_nova_regular,Helvetica,Arial,sans-serif","max-width":"25%","min-width":"25px",transition:"opacity 0.1s ease-in-out, background 0.1s ease-in-out",cursor:"pointer"},l=function(e){function t(){var t=e.call(this)||this;return t.renderEventName="render",t.textureRegistryById={},t}return a.__extends(t,e),t.prototype.onAwake=function(){this.getEngine().on("assetLoaded",this.registerTexture,this),this.getEngine().on("assetUnloaded",this.unregisterTexture,this)},t.prototype.onStartup=function(){var e=this;this.init2dScene(),this.initCubeScene(),this.renderEventName+="Group"+this.renderGroup,this.getEngine().on(this.renderEventName,this.renderView,this),this.listenTo(this.getEngine(),"rendererResize",this.resize),this.getEngine().getAssetsByClass(p.default).forEach(function(t){return e.registerTexture(t)}),this.resize()},t.prototype.onShutdown=function(){this.getEngine().off("assetLoaded",this.registerTexture,this),this.getEngine().off("assetUnloaded",this.unregisterTexture,this),this.getEngine().off(this.renderEventName,this.renderView,this)},t.prototype.init2dScene=function(){this.camera2D=new o.OrthographicCamera(-1,1,1,-1,0,1),this.scene2D=new o.Scene,this.material2D=new o.ShaderMaterial(c.default),this.material2D.transparent=!0,this.mesh2D=new o.Mesh(new o.PlaneGeometry(2,2),this.material2D),this.scene2D.add(this.mesh2D)},t.prototype.initCubeScene=function(){var e=o.ShaderLib.cube;this.sceneCube=new o.Scene,this.geoCube=new o.BoxGeometry(100,100,100),this.materialCube=new o.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:e.uniforms,depthWrite:!1,depthTest:!1,side:o.BackSide}),this.meshCube=new o.Mesh(this.geoCube,this.materialCube),this.cameraPX=new o.PerspectiveCamera(90,1,1,1e3),this.cameraPX.up.set(0,1,0),this.cameraPX.lookAt(new o.Vector3(1,0,0)),this.sceneCube.add(this.cameraPX),this.cameraNX=new o.PerspectiveCamera(90,1,1,1e3),this.cameraNX.up.set(0,1,0),this.cameraNX.lookAt(new o.Vector3(-1,0,0)),this.sceneCube.add(this.cameraNX),this.cameraPY=new o.PerspectiveCamera(90,1,1,1e3),this.cameraPY.up.set(0,0,-1),this.cameraPY.lookAt(new o.Vector3(0,1,0)),this.sceneCube.add(this.cameraPY),this.cameraNY=new o.PerspectiveCamera(90,1,1,1e3),this.cameraNY.up.set(0,0,1),this.cameraNY.lookAt(new o.Vector3(0,-1,0)),this.sceneCube.add(this.cameraNY),this.cameraPZ=new o.PerspectiveCamera(90,1,1,1e3),this.cameraPZ.up.set(0,1,0),this.cameraPZ.lookAt(new o.Vector3(0,0,1)),this.sceneCube.add(this.cameraPZ),this.cameraNZ=new o.PerspectiveCamera(90,1,1,1e3),this.cameraNZ.up.set(0,1,0),this.cameraNZ.lookAt(new o.Vector3(0,0,-1)),this.sceneCube.add(this.cameraNZ),this.sceneCube.add(this.meshCube)},t.prototype.setTexture=function(e){var t=this;this.currentTexture=this.textureRegistryById[e],this.currentTexture?this.currentTexture.load(function(){switch(t.currentTexture.type){case"renderTextureCube":case"textureCube":t.materialCube.uniforms.tCube.value=t.currentTexture.getThreeTexture();break;case"texture2D":case"renderTexture2D":t.material2D.uniforms.tDiffuse.value=t.currentTexture.getThreeTexture()}t.mesh2D.visible=!0,t.meshCube.visible=!0}):(this.mesh2D.visible=!1,this.meshCube.visible=!1)},t.prototype.updateViewport=function(){var e,t=this.getEngine().getRenderer().getWidth(),r=this.getEngine().getRenderer().getHeight();"%"===this.viewportBottom.slice(-1)?(e=.01*parseFloat(this.viewportBottom.slice(0,-1)),this.y=e*r):this.y=parseInt(this.viewportBottom,10),"%"===this.viewportLeft.slice(-1)?(e=.01*parseFloat(this.viewportLeft.slice(0,-1)),this.x=e*t):this.x=parseInt(this.viewportLeft,10),"%"===this.viewportWidth.slice(-1)?(e=.01*parseFloat(this.viewportWidth.slice(0,-1)),this.width=e*t):this.width=parseInt(this.viewportWidth,10),"%"===this.viewportHeight.slice(-1)?(e=.01*parseFloat(this.viewportHeight.slice(0,-1)),this.height=e*r):this.height=parseInt(this.viewportHeight,10),this.x<0&&(this.x+=t),this.y<0&&(this.y+=r)},t.prototype.updateTextureDropdown=function(){var e=this;this.isEnabled()&&setTimeout(function(){var t;if(!e.textureDropDown){if(e.textureDropDown=document.createElement("select"),e.textureDropDown.name="Textures",e.textureDropDown.id="Textures",n(e.textureDropDown,"debugger-dropdown"),i(e.textureDropDown,h),!e.getThreeRenderer())return;var r=e.getThreeRenderer().domElement;r.parentElement?r.parentElement.appendChild(e.textureDropDown):r.appendChild(e.textureDropDown),e.textureDropDown.onchange=function(){e.setTexture(e.textureDropDown.value)}}e.textureDropDown.options.length=0,t=document.createElement("option"),t.value=0,t.text="None",e.textureDropDown.appendChild(t),u.forEach(e.textureRegistryById,function(r,i){t=document.createElement("option"),t.value=i,t.text=""!==r.name?r.getName():i,e.textureDropDown.appendChild(t)}),e.textureDropDown.style.top=e.getEngine().getRenderer().getHeight()-e.y-e.height+"px",e.textureDropDown.style.left=e.x+"px",e.textureDropDown.style.zIndex="200"},0)},t.prototype.resize=function(){this.isEnabled()&&(this.updateTextureDropdown(),this.updateViewport())},t.prototype.renderView=function(){var e=this.getThreeRenderer();if(this.isEnabled()&&this.currentTexture)switch(e.setRenderTarget(null),this.currentTexture.type){case"texture2D":case"renderTexture2D":e.setViewport(this.x,this.y,this.width,this.height),e.render(this.scene2D,this.camera2D);break;case"textureCube":case"renderTextureCube":var t=.25*this.width,r=.3333*this.height;e.setViewport(this.x,this.y+r,t,r),e.render(this.sceneCube,this.cameraPX,null,!1),e.setViewport(this.x+1.999*t,this.y+r,t,r),e.render(this.sceneCube,this.cameraNX,null,!1),e.setViewport(this.x+t,this.y+1.99*r,t,r),e.render(this.sceneCube,this.cameraPY,null,!1),e.setViewport(this.x+t,this.y,t,r),e.render(this.sceneCube,this.cameraNY,null,!1),e.setViewport(this.x+t,this.y+r,t,r),e.render(this.sceneCube,this.cameraPZ,null,!1),e.setViewport(this.x+2.99*t,this.y+r,t,r),e.render(this.sceneCube,this.cameraNZ,null,!1)}},t.prototype.registerTexture=function(e){if(e)switch(e.type){case"renderTextureCube":case"textureCube":case"texture2D":case"renderTexture2D":this.textureRegistryById[e.id]=e}},t.prototype.unregisterTexture=function(e){e&&this.textureRegistryById[e.id]&&delete this.textureRegistryById[e.id]},t}(s.default);t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(){function e(e,t,r,i){this.targetEntityType=e,this.targetComponentName=t,this.propertyName=r,this.targetValue=i,this.previousValues={},this.lastTimeSavings=0,this.targetEntityType=e,this.targetComponentName=t,this.propertyName=r,this.targetValue=i}return e}();t.QualityChangeLevel=a;var o=function(e){function t(){var t=e.call(this)||this;return t.QualityChangeLevel=a,t.frameTimeThreshold=33.333333333,t.testInterval=2e3,t.qualityChangeLevels=[],t.currentLevel=t.qualityChangeLevels.length,t.elapsedRenderTime=0,t.framesRecorded=0,t.justStarted=!0,t.justAutoSteppedDown=!1,t.autoOptimize=!0,t}return i.__extends(t,e),t.prototype.setQualityChangeLevels=function(e){this.setMaxQuality(),this.qualityChangeLevels=e,this.currentLevel=this.qualityChangeLevels.length,this.isEnabled()&&(this.autoOptimize=!0)},t.prototype.setFrameTimeThreshold=function(e){this.frameTimeThreshold=e},t.prototype.setTestInterval=function(e){this.testInterval=e,this.elapsedRenderTime=0,this.framesRecorded=0},t.prototype.onPreUpdate=function(e){if(this.isEnabled()&&(this.elapsedRenderTime+=1e3*e,this.framesRecorded++,!(this.elapsedRenderTimethis.frameTimeThreshold?(this.stepRenderingQualityDown(),this.justAutoSteppedDown=!0):this.qualityChangeLevels[this.currentLevel]&&this.lastAvgFrameTime<.9*(this.frameTimeThreshold-this.qualityChangeLevels[this.currentLevel].lastTimeSavings)&&this.stepRenderingQualityUp()}},t.prototype.stepRenderingQualityDown=function(){for(var e=!0;e&&this.currentLevel>0;)this.currentLevel=this.currentLevel>1?this.currentLevel-1:0,e=!this.stepRenderingQuality(!1);e||(this.qualityChangeLevels[this.currentLevel].frameTimeAtDrop=this.lastAvgFrameTime)},t.prototype.stepRenderingQualityUp=function(){for(var e=!0;e&&this.currentLevelthis.time?1:n(Math.max(0,Math.min(1,this.currentTime/this.time)));this.objects.forEach(function(e,i){var n=e.runtimeData.parent.worldToLocal(h.copy(t.destinations[i])).clone(),a=t.direction>0?t.sources[i]:n,o=t.direction>0?n:t.sources[i];h.lerpVectors(a,o,r),e.setPosition(h.x,h.y,h.z)}),this.currentTime>this.time&&this.getEntity().trigger(this.direction>0?"endExplode":"endContract")}},t.prototype.reset=function(){var e=this;this.objects.forEach(function(t,r){t.setPosition(e.sources[r].x,e.sources[r].y,e.sources[r].z)}),this.objects.length=0,this.sources.length=0,this.destinations.length=0,this.currentTime=this.time},t.prototype.contract=function(){this.isEnabled()&&(this.direction=-1,this.currentTime=0,this.getEntity().trigger("beginContract"))},t.prototype.explode=function(e,t){var r=this;if(this.isEnabled()){this.reset();var i=this.getEntity().getDescendantsByType("mesh"),n=this.getEntity().getCenter();n.applyMatrix4(this.getRuntimeData().matrixWorld);var a=new p.Quaternion;a.setFromRotationMatrix(this.getRuntimeData().matrixWorld);var o=this.getFormationFunc(e||this.formation,i.length,n,a,t||this.scale).bind(this);i.forEach(function(e,t){o(t,h,e),r.objects.push(e),r.sources.push(e.getPosition()),r.destinations.push(h.clone())}),this.currentTime=0,this.direction=1,this.getEntity().trigger("beginExplode")}},t.prototype.toggleExplode=function(){this.direction>0?this.contract():this.explode()},t.prototype.getFormationFunc=function(e,t,r,i,n){switch(e){case"Grid":return a(t,r,n,i);case"Scale":return o(r,n);default:case"Circle":return s(t,r,n,i)}},t}(c.default);t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(e){function t(){var t=e.call(this)||this;return t.el=void 0,t.fsEnabled=!1,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.toggle=this.toggle.bind(this),this.getEntity().on("toggleFullscreen",this.toggle,this),this.listenTo(this.getGlobalEvents(),"fullscreen::toggle",this.toggle),this.listenTo(this.getGlobalEvents(),"fullscreen::enable",this.enableFullscreen),this.listenTo(this.getGlobalEvents(),"fullscreen::disable",this.disableFullscreen)},t.prototype.toggle=function(){this.fsEnabled?this.disableFullscreen():this.enableFullscreen()},t.prototype.enableFullscreen=function(){this.el||this.attachFullscreenAPI(),this.el.requestFullscreen(),this.fsEnabled=!0},t.prototype.disableFullscreen=function(){this.el||this.attachFullscreenAPI(),this.fsEnabled&&document.exitFullscreen(),this.fsEnabled=!1},t.prototype.attachFullscreenAPI=function(){this.el=this.getEngine().container,this.el.requestFullscreen=this.el.requestFullscreen||this.el.requestFullScreen||this.el.mozRequestFullscreen||this.el.mozRequestFullScreen||this.el.webkitRequestFullscreen||this.el.webkitRequestFullScreen||this.el.msRequestFullscreen||this.el.msRequestFullScreen,document.exitFullscreen=document.exitFullscreen||document.exitFullScreen||document.mozCancelFullscreen||document.mozCancelFullScreen||document.webkitExitFullscreen||document.webkitExitFullScreen||document.msExitFullscreen||document.msExitFullScreen,document.addEventListener("fullscreenchange",this.onFullscreenChange.bind(this),!1),document.addEventListener("mozfullscreenchange",this.onFullscreenChange.bind(this),!1),document.addEventListener("webkitfullscreenchange",this.onFullscreenChange.bind(this),!1),document.addEventListener("msfullscreenchange",this.onFullscreenChange.bind(this),!1)},t.prototype.onFullscreenChange=function(e){this.getGlobalEvents().trigger("fullscreen::change",e)},t}(n.default);t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(5),s=r(37),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.buttons=[],t.axes=[],t.workVector1=new n.Vector3,t.workVector2=new n.Vector3,t.workQuaternion1=new n.Quaternion,t.workQuaternion2=new n.Quaternion,t.workEuler=new n.Euler,t.meshControlMap={},t.updateAxes=!1,t.updateButtons=[],t.gamepadDevice=null,t}return i.__extends(t,e),t.prototype.onUpdate=function(e){var t=this;this.gamepadDevice||(this.gamepadDevice=this.getGamepadDevice(),this.gamepadDevice&&(this.listenTo(this.gamepadDevice,"gamepadButtonChanged",this.onGamepadButtonEvent),this.listenTo(this.gamepadDevice,"gamepadButtonTouched",this.onGamepadButtonEvent),this.listenTo(this.gamepadDevice,"gamepadButtonReleased",this.onGamepadButtonEvent),this.listenTo(this.gamepadDevice,"gamepadAxisChanged",this.onGamepadAxisEvent))),this.updateButtons.forEach(function(e,r){e&&t.updateButtonTransform(r)}),this.updateAxes&&(this.updateAxes=!1,this.updateAxesTransforms())},t.prototype.getAxisMeshes=function(e){return this.axes[e].map(function(e){return e.mesh})},t.prototype.getButtonMeshes=function(e){return this.buttons[e].map(function(e){return e.mesh})},t.prototype.onAttributesChanged=function(e){var t=this;-1===e.indexOf("axes")&&-1===e.indexOf("buttons")||(this.meshControlMap={},this.axes.forEach(function(e,r){e.forEach(function(e,i){var n=e.mesh;n&&(t.meshControlMap[n.id]||(t.meshControlMap[n.id]={axes:[],axesMeshIdx:[],buttons:[],buttonMeshIdx:[]}),t.meshControlMap[n.id].axes.push(r),t.meshControlMap[n.id].axesMeshIdx.push(i))})}),this.buttons.forEach(function(e,r){e.forEach(function(e,i){var n=e.mesh;n&&t.meshControlMap[n.id]&&(t.meshControlMap[n.id].buttons.push(r),t.meshControlMap[n.id].buttonMeshIdx.push(i))})}))},t.prototype.getGamepadDevice=function(){if(this.gamepadDevice)return this.gamepadDevice;var e=[this.getEntity()].concat(this.getEntity().getAncestors()),t=e.find(function(e){return!!e.getComponent(function(e){return e instanceof s.default})});return t?(this.gamepadDevice=t.getComponent(function(e){return e instanceof s.default}),this.gamepadDevice):(this.gamepadDevice=null,null)},t.prototype.onGamepadButtonEvent=function(e,t){this.currentGamepadState=e,this.updateButtons[t]=!0},t.prototype.updateButtonTransform=function(e){var t=this,r=this.currentGamepadState.buttons[e].value;this.buttons[e].forEach(function(i){if(i.mesh){switch(i.movementType){case"translate":t.workVector1.copy(i.offset).multiplyScalar(r),i.mesh.setPosition(t.workVector1.x,t.workVector1.y,t.workVector1.z);break;case"rotate":t.workVector2.copy(i.rotation).multiplyScalar(r),t.workEuler.setFromVector3(t.workVector2),t.workQuaternion1.setFromEuler(t.workEuler),t.workVector1.copy(i.pivot),t.workVector2.copy(t.workVector1).multiplyScalar(-1),t.workVector2.applyQuaternion(t.workQuaternion1),t.workVector2.add(t.workVector1),i.mesh.setQuaternion(t.workQuaternion1.x,t.workQuaternion1.y,t.workQuaternion1.z,t.workQuaternion1.w),i.mesh.setPosition(t.workVector2.x,t.workVector2.y,t.workVector2.z)}i.renderOnTouchOnly&&t.currentGamepadState.buttons[e].hasOwnProperty("touched")&&i.mesh.setProperty("visible",t.currentGamepadState.buttons[e].touched)}})},t.prototype.onGamepadAxisEvent=function(e,t){this.currentGamepadState=e,this.updateAxes=!0},t.prototype.updateAxesTransforms=function(){var e=this;o.forEach(this.meshControlMap,function(t,r){var i=e.getEngine().getObjectById(r);if(i){var n=e.axes[0][t.axesMeshIdx[0]].movementType;if(e.workVector1.set(0,0,0),t.axes.reduce(function(r,i,a){var o=e.axes[i][t.axesMeshIdx[a]];if(o.movementType!==n)return log.error("Can't perform multiple types of axis transformations on same mesh."),r;if("translate"===n){var s=e.currentGamepadState.axes[i];e.workVector2.copy(o.offset).multiplyScalar(s)}else"rotate"===n&&e.workVector2.copy(o.pivot).multiplyScalar(-1);return r.lerp(e.workVector2,0===a?1:.5)},e.workVector1),e.workQuaternion1.set(0,0,0,1),"rotate"===n&&(t.axes.reduce(function(r,i,n){var a=e.axes[i][t.axesMeshIdx[n]],o=e.currentGamepadState.axes[i];return e.workVector2.copy(a.rotation).multiplyScalar(o),e.workEuler.setFromVector3(e.workVector2),e.workQuaternion2.setFromEuler(e.workEuler),r.slerp(e.workQuaternion2,0===n?1:.5)},e.workQuaternion1),e.workVector2.copy(e.workVector1),e.workVector1.applyQuaternion(e.workQuaternion1),e.workVector2.multiplyScalar(-1),e.workVector1.add(e.workVector2)),i.setQuaternion(e.workQuaternion1.x,e.workQuaternion1.y,e.workQuaternion1.z,e.workQuaternion1.w),i.setPosition(e.workVector1.x,e.workVector1.y,e.workVector1.z),t.buttons.length){var a=t.buttons[0],o=e.currentGamepadState.buttons[a].value,s=e.buttons[a][0].offset;e.workVector2.copy(s).multiplyScalar(o),e.workVector2.applyQuaternion(e.workQuaternion1),e.workVector2.add(e.workVector1),i.setPosition(e.workVector2.x,e.workVector2.y,e.workVector2.z)}}})},t}(a.default);t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.gamepadStates=[],t}return i.__extends(t,e),t.prototype.onPreUpdate=function(e){if(this.isEnabled()&&navigator.getGamepads)for(var t=navigator.getGamepads(),r=0;r":187,"<":188,_:189,".":190,"/":191,"[":219,"]":221};var h=function(e){function r(){var t=e.call(this)||this;return t.mouseButtons={left:0,middle:1,right:2},t.inputQueue=[],t.inputPool=[],t.mouseButtonState=new Array(3),t.mouseButtonStatePrevious=new Array(3),t.mousePosition=new u.Vector2,t.mousePositionPercent=new u.Vector2,t.mousePreviousPosition=new u.Vector2,t.mouseDragState=new Array(3),t.mouseDragStatePrevious=new Array(3),t.mouseDragDistance=[new u.Vector2,new u.Vector2,new u.Vector2],t.touchPosition=new u.Vector2,t.touchPositionPercent=new u.Vector2,t.touchPreviousPosition=new u.Vector2,t.touchDragState=!1,t.touchDragStatePrevious=!1,t.doubleTapHandle=null,t.doubleTapPosition=new u.Vector2,t.listenForTouchStart=!1,t.listenForTouchEnd=!1,t.touchesStart=[],t.keyState=new Array(256),t.keyStatePrevious=new Array(256),t.canvas=null,t.pointerLockEnabled=!1,t}return i.__extends(r,e),r.prototype.mouseButtonDown=function(e){if("any"===e){for(var t in this.mouseButtons)if(this.mouseButtonState[this.mouseButtons[t]])return!0;return!1}return this.mouseButtonState[this.mouseButtons[e]]},r.prototype.mouseButtonUp=function(e){return!this.mouseButtonState[this.mouseButtons[e]]},r.prototype.mouseButtonPressed=function(e){return!(!this.mouseButtonState[this.mouseButtons[e]]||this.mouseButtonStatePrevious[this.mouseButtons[e]])},r.prototype.mouseButtonReleased=function(e){return!(this.mouseButtonState[this.mouseButtons[e]]||!this.mouseButtonStatePrevious[this.mouseButtons[e]])},r.prototype.keyPressed=function(e){return!(!this.keyState[t.keyCodes[e]]||this.keyStatePrevious[t.keyCodes[e]])},r.prototype.keyReleased=function(e){return!(this.keyState[t.keyCodes[e]]||!this.keyStatePrevious[t.keyCodes[e]])},r.prototype.keyDown=function(e){return!!this.keyState[t.keyCodes[e]]},r.prototype.keyUp=function(e){return!this.keyState[t.keyCodes[e]]},r.prototype.getMouseDragState=function(e){return this.mouseDragState[this.mouseButtons[e||"left"]]},r.prototype.getPreviousMouseDragState=function(e){return this.mouseDragStatePrevious[this.mouseButtons[e||"left"]]},r.prototype.getTouchDragState=function(){return this.touchDragState},r.prototype.getPreviousTouchDragState=function(){return this.touchDragStatePrevious},r.prototype.enablePointerLock=function(){this.pointerLockEnabled=!0,this.canvas.requestPointerLock()},r.prototype.disablePointerLock=function(){this.pointerLockEnabled=!1,document.exitPointerLock()},r.prototype.togglePointerLock=function(){this.pointerLockEnabled?this.enablePointerLock():this.disablePointerLock()},r.prototype.onStartup=function(){this.canvas=this.getEngine().canvas,this.canvas.requestPointerLock=this.canvas.requestPointerLock||this.canvas.mozRequestPointerLock||this.canvas.webkitRequestPointerLock,document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,this.clearKeyStates=this.clearKeyStates.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onMouseWheel=this.onMouseWheel.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onContextMenu=this.onContextMenu.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.onTouchCancel=this.onTouchCancel.bind(this),this.onTouchLeave=this.onTouchLeave.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.onDoubleClick=this.onDoubleClick.bind(this),this.onDoubleTap=this.onDoubleTap.bind(this),window.addEventListener("blur",this.clearKeyStates,!1),this.isEnabled()&&(this.mouseEvents.enable&&this.enableMouseEvents(),this.keyEvents.enable&&this.enableKeyEvents(),this.touchEvents.enable&&this.enableTouchEvents())},r.prototype.onPreUpdate=function(){if(this.isEnabled())for(;this.inputQueue.length>0;)this.getEngine().trigger(this.inputQueue[0].name,this.inputQueue[0].event),this.recycleInputEvent(this.inputQueue.splice(0,1)[0])},r.prototype.onPostUpdate=function(){if(this.isEnabled()){if(this.keyEvents.enable)for(var e=0;ethis.mouseEvents.dragBufferDistance&&(this.mouseDragState[t]=!0)}else this.mouseDragState[t]=!1;this.inputQueue.push(this.getInputEvent(e,"mouseMove"))},r.prototype.onMouseDown=function(e){if(this.getScenePercent(e,e),this.mouseUpBound||(this.mouseUpBound=!0,document.addEventListener("mouseup",this.onMouseUp)),Array.prototype.forEach.call(document.querySelectorAll("input, textarea, select, option"),function(e){e.blur()}),this.mouseEvents.preventDownDefault&&e.preventDefault(),this.mouseButtonState[e.button]=!0,this.inputQueue.push(this.getInputEvent(e,"mouseDown")),this.mouseEvents.eventHandler){var t=this.getKeyByValue(this.mouseButtons,e.button);t&&this.getGlobalEvents().trigger("mouse_down_"+t)}},r.prototype.onMouseUp=function(e){if(this.getScenePercent(e,e),this.mouseButtonState[e.button]=!1,this.mouseDragState[e.button]=!1,this.mouseDragDistance[e.button].x=0,this.mouseDragDistance[e.button].y=0,this.mouseButtonUp("left")&&this.mouseButtonUp("right")&&this.mouseButtonUp("middle")&&(this.mouseUpBound=!1,document.removeEventListener("mouseup",this.onMouseUp)),this.inputQueue.push(this.getInputEvent(e,"mouseUp")),this.mouseEvents.eventHandler){var t=this.getKeyByValue(this.mouseButtons,e.button);t&&this.getGlobalEvents().trigger("mouse_up_"+t)}},r.prototype.onDoubleClick=function(e){this.getScenePercent(e,e),Array.prototype.forEach.call(document.querySelectorAll("input, textarea, select, option"),function(e){e.blur()}),this.inputQueue.push(this.getInputEvent(e,"doubleClick"))},r.prototype.onMouseWheel=function(e){this.mouseEvents.preventScrollDefault&&e.preventDefault();var t;t=void 0!==e.wheelDeltaY?.025*e.wheelDeltaY:s.isIE()?-e.deltaY/40:-e.deltaY,this.inputQueue.push(this.getInputEvent(t,"mouseScroll"))},r.prototype.onMouseLeave=function(e){for(var t=0,r=this.mouseButtonState;tthis.touchEvents.dragBufferDistance)return void this.clearDoubleTapState();this.listenForTouchStart||this.listenForTouchEnd?!this.listenForTouchStart&&this.listenForTouchEnd?(this.clearDoubleTapState(),this.listenForTouchStart=!0):this.listenForTouchStart&&!this.listenForTouchEnd?(this.clearDoubleTapState(),this.listenForTouchStart=!0,this.listenForTouchEnd=!0,this.canvas.addEventListener("touchend",this.onDoubleTap)):(this.clearDoubleTapState(),this.onTouchEvent(e,"doubleTap")):(this.doubleTapPosition.copy(this.touchPosition),this.clearDoubleTapState(),this.canvas.addEventListener("touchend",this.onDoubleTap),this.listenForTouchEnd=!0),this.doubleTapHandle=setTimeout(this.clearDoubleTapState.bind(this),300)},r.prototype.clearDoubleTapState=function(){clearTimeout(this.doubleTapHandle),this.doubleTapHandle=null,this.listenForTouchStart=!1,this.listenForTouchEnd=!1,this.canvas.removeEventListener("touchend",this.onDoubleTap)},r.prototype.onTouchCancel=function(e){this.touchEvents.preventCancelDefault&&e.preventDefault(),this.touchDragState=!1;var t={};t.originalEvent=e,t.touches=[],this.inputQueue.push(this.getInputEvent(t,"touchCancel"))},r.prototype.onTouchLeave=function(e){this.touchEvents.preventLeaveDefault&&e.preventDefault(),this.touchDragState=!1,this.onTouchEvent(e,"touchLeave")},r.prototype.onTouchMove=function(e){this.touchEvents.preventMoveDefault&&e.preventDefault();var t={};t.originalEvent=e,t.touches=[];for(var r=0;rthis.touchEvents.dragBufferDistance&&(this.touchDragState=!0),t.touches.push(i)}t.touches.length&&(this.touchPosition.x=t.touches[t.touches.length-1].sceneX,this.touchPosition.y=t.touches[t.touches.length-1].sceneY,this.touchPositionPercent.x=t.touches[t.touches.length-1].scenePercentX,this.touchPositionPercent.y=t.touches[t.touches.length-1].scenePercentY),this.inputQueue.push(this.getInputEvent(t,"touchMove"))},r.prototype.onTouchEvent=function(e,t){var r={};r.originalEvent=e,r.touches=[];for(var i=0;i=0&&(this.sourceBoundingSphere.radius=this.boundingSphereOverrideRadius)),this.sceneRoot.isBaseLoaded()&&this.sphereMesh&&(this.sphereMesh.position.copy(this.sourceBoundingSphere.center),this.sphereMesh.scale.set(this.sourceBoundingSphere.radius,this.sourceBoundingSphere.radius,this.sourceBoundingSphere.radius)),this.previousIntersections=this.currentIntersections,this.currentIntersections={},this.firstIntersectionOnly){var r=t.find(this.intersectObject.bind(this));r&&(this.previousIntersections[r.id]||(this.trigger("beginIntersection",r),this.getEntity().trigger("beginIntersection",r)),this.currentIntersections[r.id]=r)}else t.filter(this.intersectObject.bind(this)).forEach(function(t){e.previousIntersections[t.id]||(e.trigger("beginIntersection",t),e.getEntity().trigger("beginIntersection",t)),e.currentIntersections[t.id]=t});return o.forEach(this.previousIntersections,function(t){e.currentIntersections[t.id]||(e.trigger("endIntersection",t),e.getEntity().trigger("endIntersection",t))}),this.currentIntersections}},t.prototype.onAttributesChanged=function(e){-1!==e.indexOf("debugVisualization")&&(this.sphereMesh.visible=this.debugVisualization)},t.prototype.onPreUpdate=function(){this.checkIntersectionAlways&&this.checkIntersection()},t.prototype.generateObjectList=function(){var e=this;if(this.objectFilter.length)return this.objectFilter;var t=[];return this.sceneRoot.traverseSome(function(r){return r===e.getEntity()||!(r===e.sceneRoot||e.objectTypeFilter.length&&!e.objectTypeFilter.some(function(e){return r.type===e}))&&void t.push(r)}),t},t.prototype.intersectObject=function(e){var t=e.runtimeData;return!!t&&(this.workMatrix.getInverse(t.matrixWorld),this.workBoundsSphere.copy(this.sourceBoundingSphere),this.workBoundsSphere.applyMatrix4(this.workMatrix),e.getBounds(this.workBoundingBox),this.workBoundingBox.intersectsSphere(this.workBoundsSphere))},t}(a.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=r(14),o=function(e){function t(){var t=e.call(this)||this;return t.setupMaterial=t.setupMaterial.bind(t),t}return i.__extends(t,e),t.prototype.onAwake=function(){var e=this;this.listenTo(this.getEngine(),"entityCreated",function(t){t instanceof a.default&&e.setupMaterial(t)})},t.prototype.onAttributesChanged=function(e){this.setupAllMaterials()},t.prototype.onDisable=function(){this.getEngine().getAssetsByClass(a.default).forEach(function(e){e.getShader().getProperty("parameters").reflectionTexture&&e.setProperty("reflectionTexture",null)})},t.prototype.onEnable=function(){this.setupAllMaterials()},t.prototype.setupAllMaterials=function(){this.getEngine().getAssetsByClass(a.default).forEach(this.setupMaterial)},t.prototype.setupMaterial=function(e){if(e&&this.isEnabled()){e.getShader().getProperty("parameters").reflectionTexture&&e.setProperty("reflectionTexture",this.getAttribute("radianceMap"))}},t}(n.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(10),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.playing=!0,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.tempVec=new n.Vector3,this.tempMatrix=new n.Matrix4,this.tempQuaternion=new n.Quaternion},t.prototype.onAttributesChanged=function(e){if(!this.playing){var t=this.getEntity();t instanceof o.default&&(this.getRuntimeData().position.copy(t.getPosition()),this.getRuntimeData().quaternion.copy(t.getQuaternion()))}},t.prototype.onEnable=function(){this.playing=!0},t.prototype.onDisable=function(){this.playing=!1;var e=this.getEntity();e instanceof o.default&&(this.getRuntimeData().position.copy(e.getPosition()),this.getRuntimeData().quaternion.copy(e.getQuaternion()))},t.prototype.onPostUpdate=function(){var e;if(this.hasRuntimeData()&&this.playing&&this.isEnabled()&&(e=this.getRuntimeData(),this.target&&this.target.runtimeData)){this.getEngine().needsRender=!0;var t=this.target.runtimeData;if(t.updateMatrixWorld(),this.tempVec.setFromMatrixPosition(t.matrixWorld),e.parent?this.tempMatrix.getInverse(e.parent.matrixWorld):this.tempMatrix.identity(),this.tempVec.applyMatrix4(this.tempMatrix),this.local){e.lookAt(this.tempVec);var r=this.getEntity();r instanceof o.default&&e.quaternion.multiply(r.getQuaternion())}else e.lookAt(this.tempVec)}},t.prototype.onShutdown=function(){},t}(a.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(41),s=function(e){function t(){var t=e.call(this)||this;return t.createScene(),t}return i.__extends(t,e),t.prototype.setLightingFromThreeScene=function(e){var t=this;this.resetSceneLighting(),e.traverse(function(e){e instanceof n.Light&&t.scene.add(e.clone())}),this.captureScene()},t.prototype.setLightingFromScene=function(e){var t=this;this.resetSceneLighting(),e.getDescendantsByClass(o.default).forEach(function(e){e.isUnloaded()&&e.loadBase(),t.scene.add(e.getRuntimeData().clone())}),this.captureScene()},t.prototype.onAwake=function(){this.listenTo(this.getEntity(),"change:properties",this.onMaterialChanges)},t.prototype.onEnable=function(){this.captureScene()},t.prototype.onEntityLoaded=function(){this.captureScene()},t.prototype.onAttributesChanged=function(e){-1!==e.indexOf("captureTexture")&&this.captureScene()},t.prototype.onMaterialChanges=function(e){this.captureScene()},t.prototype.createScene=function(){this.camera=new n.OrthographicCamera(-.5,.5,.5,-.5,1,80),this.scene=new n.Scene,this.createGeometry(),this.scene.add(this.sphereMesh),this.scene.add(this.planeMesh),this.scene.add(this.camera),this.camera.position.z=40,this.camera.position.y=20,this.camera.position.x=20,this.camera.lookAt(new n.Vector3(0,0,0)),this.planeMesh.lookAt(this.camera.position)},t.prototype.createGeometry=function(){this.geometry=new n.SphereBufferGeometry(.5,36,36),this.planeGeometry=new n.PlaneBufferGeometry(1,2);var e=Math.sqrt(.5),t=this.planeGeometry.attributes.normal;t.array=new Float32Array([-1,1,0,1,1,0,-1,-1,0,1,-1,0]);for(var r=0;r=1&&(n-=1);var a=1-i;if(r&&na){var P=1-(n-a)/i;f+=e*w/t*Math.max(.5*Math.cos(P*Math.PI+Math.PI)+.5,0)}else f+=e*w/t;(f>=1||f<0)&&(f%=1,d=0,s||(f=.99999999,c.playingCurveAnimation=!1,c.getEngine().off("update",c.curveAnim,c),c.curveAnim=void 0),c.getEntity().trigger("endAnimateAlongCurve"));var E=u.curve,T=E.getUtoTmapping(f);if(l.position.copy(E.getPoint(T)),"toCurve"===o){var S=E.getTangent(T);m.set(0,-1,0),y.crossVectors(S,m),g.crossVectors(S,y),m.copy(l.position),m.add(S),v.lookAt(l.position,m,g),l.quaternion.setFromRotationMatrix(v)}else if("toNode"===o){var D=u.closed?E.points.length:E.points.length-1,_=Math.floor(T*D),M=Math.ceil(T*D)%E.points.length,A=void 0;-1!==_&&(A=_>0?u.controlPoints[_]:u.controlPoints[0],A.getQuaternion(b)),-1!==M&&(A=M>0?u.controlPoints[M]:u.controlPoints[0],A.getQuaternion(x));var C=T*D-_;l.quaternion.copy(b),l.quaternion.slerp(x,C)}}};r+i>1&&(n.default.warn("Ease-In and Ease-Out value can't total more than 1.0."),r=.5,i=.5),t>0&&(this.playingCurveAnimation=!0,u.isCurveInit()?(this.curveAnim=E,this.getEngine().on("update",this.curveAnim,this)):u.on("curveInit",function(){c.curveAnim=E,c.getEngine().on("update",c.curveAnim,c)},this))}},t.prototype.onPauseCurveAnimation=function(){this.playingCurveAnimation=!1},t.prototype.onUnpauseCurveAnimation=function(){this.playingCurveAnimation=!0},t.prototype.animateToObject=function(e,t,r,i,o){var s=this,u=this.getEngine(),p=function(e){var p=s.getRuntimeData(),c=new a.Matrix4,h=0,l=0;r+i>1&&(n.default.warn("Ease-In and Ease-Out value can't total more than 1.0."),r=.5,i=.5);var d,f=1-r-i,m=1/(r/2+i/2+f),y=new a.Vector3;y.copy(p.position);var g=e.position,v=e.quaternion;if(v&&o&&(d=new a.Quaternion,d.copy(p.quaternion)),e.updateMatrixWorld(!0),g.setFromMatrixPosition(e.matrixWorld),c.extractRotation(e.matrixWorld),v.setFromRotationMatrix(c),t>0){var b=function(e){if(!s.getEntity()||!s.isEnabled())return void u.off("update",b,s);s.getEngine().needsRender=!0,h+=e;var n=h/t,a=1-i;if(r&&na){var f=1-(n-a)/i;l+=e*m/t*Math.max(.5*Math.cos(f*Math.PI+Math.PI)+.5,0)}else l+=e*m/t;l=Math.min(l,1),(l>=1||l<0)&&(s.getEngine().off("update",b,s),s.getEntity().trigger("endAnimateToObject")),p.position.copy(y),p.position.lerp(g,l),v&&o&&(p.quaternion.copy(d),p.quaternion.slerp(v,l))};s.getEngine().on("update",b,s)}else p.position.copy(g),v&&p.quaternion.copy(v),s.getEntity().trigger("endAnimateToObject")},c=this.getEngine().getEntityById(e);c.runtimeData?p(c.runtimeData):(c.once("loadBase",function(){p(c.runtimeData)},this),c.load())},t.prototype.animateTranslation=function(e,t,r,i,o){var s=this,u=this.getRuntimeData();u.position.copy(this.getEntity().getPosition()),u.quaternion.copy(this.getEntity().getQuaternion()),u.scale.copy(this.getEntity().getScale());var p=0,c=this.getEngine();t+r>1&&(n.default.warn("Ease-In and Ease-Out value can't total more than 1.0."),t=.5,r=.5);var h=e*t,l=new a.Vector3,d=new a.Vector3;d.copy(i);var f=d.length();if(u.updateMatrixWorld(),d.applyQuaternion(u.quaternion),d.normalize(),o){var m=(1-t-r)*e,y=.5*(t+r)*e;"middle"===o?(l.copy(i),l.multiplyScalar(-.5*(m+y)),u.position.add(l)):"end"===o&&(l.copy(i),l.multiplyScalar(-1*(m+y)),u.position.add(l))}if(e>0){var g=function(i){if(!s.getEntity()||!s.isEnabled())return void c.off("update",g,s);l.copy(d),s.getEngine().needsRender=!0,p+=i;var n=Math.min(p/e,1),a=1-r,o=e*a;if(t&&po){var y=1-(n-a)/r;l.multiplyScalar(i*f*Math.max(.5*Math.cos(y*Math.PI+Math.PI)+.5,0))}else l.multiplyScalar(i*f);p>=e&&(s.getEngine().off("update",g,s),s.getEntity().trigger("endAnimateTranslation")),u.position.add(l)};this.getEngine().on("update",g,this)}},t.prototype.animateRotation=function(e,t,r,i,o,s){var u=this,p=this.getRuntimeData();p.position.copy(this.getEntity().getPosition()),p.quaternion.copy(this.getEntity().getQuaternion()),p.scale.copy(this.getEntity().getScale());var c=0,h=this.getEngine();t+r>1&&(n.default.warn("Ease-In and Ease-Out value can't total more than 1.0."),t=.5,r=.5);var l=e*t,d=new a.Quaternion,f=new a.Quaternion,m=new a.Vector3,y=new a.Euler(i.x,i.y,i.z,s);if(d.setFromEuler(y),f.copy(d),p.updateMatrixWorld(),o){var g=(1-t-r)*e,v=.5*(t+r)*e;"middle"===o?(m.copy(i),m.multiplyScalar(-.5*(g+v)),y.set(m.x,m.y,m.z),d.setFromEuler(y),p.quaternion.multiply(d)):"end"===o&&(m.copy(i),m.multiplyScalar(-1*(g+v)),y.set(m.x,m.y,m.z),d.setFromEuler(y),p.quaternion.multiply(d))}if(e>0){var b=function(i){if(!u.getEntity()||!u.isEnabled())return void h.off("update",b,u);var n=1;u.getEngine().needsRender=!0,c+=i;var a=Math.min(c/e,1),o=1-r,s=e*o;if(t&&cs){var y=1-(a-o)/r;n*=i*Math.max(.5*Math.cos(y*Math.PI+Math.PI)+.5,0)}else n*=i;c>=e&&(u.getEngine().off("update",b,u),u.getEntity().trigger("endAnimateRotation")),d.set(0,0,0,1),d.slerp(f,n),p.quaternion.multiply(d)};this.getEngine().on("update",b,this)}},t.prototype.animateScale=function(e,t,r,i,o){var s=this,u=this.getRuntimeData();u.position.copy(this.getEntity().getPosition()),u.quaternion.copy(this.getEntity().getQuaternion()),u.scale.copy(this.getEntity().getScale());var p=0,c=this.getEngine();t+r>1&&(n.default.warn("Ease-In and Ease-Out value can't total more than 1.0."),t=.5,r=.5);var h=e*t,l=new a.Vector3;if(u.updateMatrixWorld(),o){var d=(1-t-r)*e,f=.5*(t+r)*e;"middle"===o?(l.copy(i),l.multiplyScalar(-.5*(d+f)),u.scale.add(l)):"end"===o&&(l.copy(i),l.multiplyScalar(-1*(d+f)),u.scale.add(l))}if(e>0){var m=function(n){if(!s.getEntity()||!s.isEnabled())return void c.off("update",m,s);l.copy(i),s.getEngine().needsRender=!0,p+=n;var a=Math.min(p/e,1),o=1-r,d=e*o;if(t&&pd){var y=1-(a-o)/r;l.multiplyScalar(n*Math.max(.5*Math.cos(y*Math.PI+Math.PI)+.5,0))}else l.multiplyScalar(n);p>=e&&(s.getEngine().off("update",m,s),s.getEntity().trigger("endAnimateScale")),u.scale.add(l)};this.getEngine().on("update",m,this)}},t}(o.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(39),s=r(22),u=r(18),p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.pickTrigger=null,t.enableHover=!1,t.pickingMaterialDef=void 0,t.meshRegistry={},t.meshList=[],t.pickingTexture=void 0,t.currentHoverObject=void 0,t.currentFrame=0,t}return i.__extends(t,e),t.prototype.registerMesh=function(e){var t=this;e instanceof s.default&&e.when("loadBase",function(r){t.getEntity().isDestroyed()||t.registerObject(e,e.runtimeData)},this)},t.prototype.unregisterMesh=function(e){e instanceof s.default&&this.unregisterObject(e,e.runtimeData)},t.prototype.onStartup=function(){this.getEngine().on("rendererResize",this.resize,this),this.initPickingMaterial(),this.initMeshRegistry(),this.getGlobalEvents().on("registerPickingObject",this.registerObject,this),this.getGlobalEvents().on("unregisterPickingObject",this.unregisterObject,this),this.resize()},t.prototype.onShutdown=function(){var e=this;this.getEngine().off("rendererResize",this.resize,this),this.getGlobalEvents().off("registerPickingObject",this.registerObject,this),this.getGlobalEvents().off("unregisterPickingObject",this.unregisterObject,this),this.pickingTexture&&(this.pickingTexture.dispose(),this.pickingTexture=void 0),Object.keys(this.meshRegistry).forEach(function(t){var r=e.meshRegistry[t];r.pickingMaterial&&r.pickingMaterial.dispose()}),this.meshRegistry={},this.meshList=[]},t.prototype.onAttributesChanged=function(e){-1!==e.indexOf("pickTrigger")&&(this.bindPickTrigger(this.getPreviousAttribute("pickTrigger"),!1),this.bindPickTrigger(this.pickTrigger))},t.prototype.onPostRender=function(){this.enableHover&&!u.isMobile()&&this.hoverUpdate()},t.prototype.bindPickTrigger=function(e,t){void 0===t&&(t=!0);var r=this.getEngine(),i=t?this.listenTo.bind(this):this.stopListening.bind(this);"Up"===e.substr(-2)?u.isMobile()?i(r,"touchEnd",this.pick):i(r,"mouseUp",this.pick):"Down"===e.substr(-4)?u.isMobile()?i(r,"touchStart",this.pick):i(r,"mouseDown",this.pick):"DoubleClick"===e.substr(-11)?u.isMobile()?i(r,"doubleTap",this.pickNoDrag):i(r,"doubleClick",this.pickNoDrag):"Click"===e.substr(-5)&&(u.isMobile()?i(r,"touchEnd",this.pickNoDrag):i(r,"mouseUp",this.pickNoDrag))},t.prototype.initPickingMaterial=function(){this.pickingMaterialDef={depthTest:!0,depthWrite:!0,transparent:!1,side:n.DoubleSide,uniforms:{color:{type:"c",value:16711680}},vertexShader:[n.ShaderChunk.common,n.ShaderChunk.skinning_pars_vertex,"void main() {",n.ShaderChunk.beginnormal_vertex,n.ShaderChunk.morphnormal_vertex,n.ShaderChunk.skinbase_vertex,n.ShaderChunk.skinnormal_vertex,n.ShaderChunk.defaultnormal_vertex,n.ShaderChunk.begin_vertex,n.ShaderChunk.displacementmap_vertex,n.ShaderChunk.morphtarget_vertex,n.ShaderChunk.skinning_vertex,n.ShaderChunk.project_vertex,n.ShaderChunk.logdepthbuf_vertex,n.ShaderChunk.clipping_planes_vertex,n.ShaderChunk.worldpos_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 color;",n.ShaderChunk.logdepthbuf_pars_fragment,"void main() {",n.ShaderChunk.logdepthbuf_fragment,"gl_FragColor = vec4( color, 1.0 );","}"].join("\n")}},t.prototype.initMeshRegistry=function(){this.listenTo(this.getEngine(),"entityCreated",this.registerMesh),this.listenTo(this.getEngine(),"entityDestroyed",this.unregisterMesh),this.getEngine().getObjectsByClass(s.default).forEach(this.registerMesh.bind(this))},t.prototype.resize=function(){var e=this.pickingTexture,t=this.getRenderer().getWidth(),r=this.getRenderer().getHeight();this.pickingTexture=new n.WebGLRenderTarget(Math.floor(t/4),Math.floor(r/4),{minFilter:n.LinearFilter}),this.pickingTexture.texture.generateMipmaps=!1,e&&e.dispose()},t.prototype.registerObject=function(e,t){if(!this.meshRegistry[t.id]){this.meshRegistry[t.id]={entity:e,runtimeData:t,prevMaterial:null,pickingMaterial:new n.ShaderMaterial(this.pickingMaterialDef),index:this.meshList.length},this.meshList.push(this.meshRegistry[t.id]);var r=this.meshRegistry[t.id].pickingMaterial;r.uniforms=n.UniformsUtils.clone(this.pickingMaterialDef.uniforms),r.uniforms.color.value=new n.Color(t.id),t instanceof n.SkinnedMesh&&(r.skinning=!0)}},t.prototype.unregisterObject=function(e,t){t&&this.meshRegistry[t.id]&&(this.meshRegistry[t.id].entity=null,this.meshRegistry[t.id].pickingMaterial.dispose(),this.meshList.splice(this.meshRegistry[t.id].index,1),delete this.meshRegistry[t.id])},t.prototype.pickNoDrag=function(e,t){this.getInput().getPreviousMouseDragState(this.getInput().mouseButtons[e.button])||this.pick(e,t)},t.prototype.pick=function(e,t){if(this.isEnabled()){if(!u.isMobile())if("left"===this.pickTrigger.substr(0,4)){if(0!==e.button)return}else if("right"===this.pickTrigger.substr(0,5)){if(2!==e.button)return}else if(1!==e.button)return;var r=e.offsetX,i=e.offsetY,n=this.pickMesh(r,i);if(n){var a=[n].concat(n.getAncestors());a.forEach(function(e){return e.trigger("pick")}),this.getEngine().globalEvents.trigger("objectsPicked",a.map(function(e){return e.id})),"function"==typeof t&&a.forEach(function(e){return t(e)})}else this.getEngine().globalEvents.trigger("objectsPicked",[])}},t.prototype.hoverUpdate=function(){var e=this;if(this.isEnabled()){if(this.currentFrame1||i>1)return null;var n,a=0;for(a=0;a0?this.currentLook:this.orbitCam.pivotPoint.position;this.srcLook.copy(n),i?this.lookAtPoint(i.point):this.resetToOrigin(),this.time=this.speed,this.srcZoom=this.zoomComponent.getZoomLevel()}},t.prototype.lookAtPoint=function(e){this.orbitCam.disable(),this.targetLook.copy(e),-1===this.lastFocusPosition.x&&this.lastFocusPosition.copy(this.targetLook),this.targetLook.distanceTo(this.lastFocusPosition)0&&this.onEnd()},t.prototype.onEnd=function(){this.time=-1,this.orbitCam.enable(),this.orbitCam.setPivotPosition(this.currentLook),this.orbitCam.setOrbitDistance(this.getRuntimeData().position.distanceTo(this.currentLook)),this.orbitCam.resetOrbitRotation()},t.prototype.getIntersection=function(e){this.raycaster.far=this.orbitCam.getOrbitDistance()+1,this.raycaster.setFromCamera(e,this.getRuntimeData());var t=this.raycaster.intersectObjects(this.getRootThreeObject().children,!0).filter(a);return t.length>0?t[0]:void 0},t}(u.default);t.default=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(38),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.position=new n.Vector2,t}return i.__extends(t,e),t.prototype.onStartup=function(){var e=this.getEngine();this.listenTo(e,"mouseDown",this.onMouseDown),this.listenTo(e,"mouseMove",this.onMouseMove),this.listenTo(e,"mouseScroll",this.onMouseScroll)},t.prototype.onMouseDown=function(e){if(this.isEnabled()){var t=this.getInput().mouseButtonDown("left");this.position.x=e.scenePercentX,this.position.y=e.scenePercentY;var r=t?o.orbitEvents.startOrbit:void 0;r&&this.trigger(r,this.position)}},t.prototype.onMouseMove=function(e){if(this.isEnabled()){var t=this.getInput().mouseButtonDown("left");this.position.x=t?e.scenePercentX:e.scenePercentDeltaX,this.position.y=t?e.scenePercentY:e.scenePercentDeltaY;var r=this.getInput().mouseButtonDown("right"),i=r?o.orbitEvents.pan:t?o.orbitEvents.orbit:void 0;i&&this.trigger(i,this.position)}},t.prototype.onMouseScroll=function(e){this.isEnabled()&&this.trigger(o.orbitEvents.zoom,e)},t}(a.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(38),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isOrbiting=!1,t.isPanning=!1,t.isZooming=!1,t.panMidpoint=new n.Vector2,t.lastPanMidpoint=new n.Vector2,t.panDelta=new n.Vector2,t.lastZoomDistance=0,t}return i.__extends(t,e),t.prototype.onStartup=function(){var e=this.getEngine();this.listenTo(e,"touchStart",this.cancelActions),this.listenTo(e,"touchCancel",this.cancelActions),this.listenTo(e,"touchLeave",this.cancelActions),this.listenTo(e,"touchEnd",this.cancelActions),this.listenTo(e,"touchMove",this.onTouchMove)},t.prototype.cancelActions=function(){this.isOrbiting=!1,this.isPanning=!1,this.isZooming=!1,this.panMidpoint.set(0,0),this.lastPanMidpoint.set(0,0),this.panDelta.set(0,0),this.lastZoomDistance=0},t.prototype.onTouchMove=function(e){this.isEnabled()&&e.touches.length&&(1===e.touches.length?this.onSingleTouchMove(e.touches[0]):this.onMultiTouchMove(e.touches[0],e.touches[1]))},t.prototype.onSingleTouchMove=function(e){var t=new n.Vector2(e.scenePercentX,e.scenePercentY);this.isOrbiting?this.orbit(t):(this.isOrbiting=!0,this.startOrbit(t))},t.prototype.onMultiTouchMove=function(e,t){var r=new n.Vector2(e.scenePercentX,e.scenePercentY),i=new n.Vector2(t.scenePercentX,t.scenePercentY);this.pan(r,i),this.zoom(r,i)},t.prototype.startOrbit=function(e){this.trigger(o.orbitEvents.startOrbit,e)},t.prototype.orbit=function(e){this.trigger(o.orbitEvents.orbit,e)},t.prototype.pan=function(e,t){this.panMidpoint.addVectors(e,t),this.panMidpoint.multiplyScalar(.5),this.isPanning||(this.isPanning=!0,this.lastPanMidpoint.copy(this.panMidpoint)),this.panDelta.subVectors(this.panMidpoint,this.lastPanMidpoint),this.panDelta.length()&&this.trigger(o.orbitEvents.pan,this.panDelta),this.lastPanMidpoint.copy(this.panMidpoint),this.panDelta.set(0,0)},t.prototype.zoom=function(e,t){var r=e.distanceTo(t);if(r){this.isZooming||(this.isZooming=!0,this.lastZoomDistance=r);var i=r-this.lastZoomDistance;i&&this.trigger(o.orbitEvents.zoom,20*i),this.lastZoomDistance=r}},t}(a.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=r(235),o=r(234),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.onAttributesChanged=function(e){if(-1!==e.indexOf("inputTexture")){var t=this.getPreviousAttribute("inputTexture"),r=this.getEngine().getAssetById(t);r&&(this.unregisterDependency(r),this.stopListening()),this.inputTexture&&(this.registerDependency(this.inputTexture),this.listenTo(this.inputTexture,"load",this.bindTexture))}this.getEntity().isBaseLoaded()&&this.inputTexture.isBaseLoaded()&&this.generateTexture()},t.prototype.onShutdown=function(){this.inputTexture&&this.unregisterDependency(this.inputTexture)},t.prototype.onEntityReady=function(){this.inputTexture&&this.inputTexture.isBaseLoaded()&&this.generateTexture()},t.prototype.bindTexture=function(){this.getEntity().isBaseLoaded()&&(this.stopListening(this.inputTexture,"change:properties",this.generateTexture),this.listenTo(this.inputTexture,"change:properties",this.generateTexture),this.generateTexture())},t.prototype.generateTexture=function(){var e=this.getThreeRenderer(),t=new a.default(this.inputTexture.getThreeTexture(),this.numSamples);t.update(e),this.getEntity().getProperty("width")===t.cubeLods[0].width&&this.getEntity().getProperty("height")===t.cubeLods[0].height||this.getEntity().setProperties({width:t.cubeLods[0].width,height:t.cubeLods[0].height});var r=new o.default(t.cubeLods);r.setDestinationTexture(this.getEntity().getRuntimeData()),r.update(e),t.dispose(),r.dispose(),this.getEngine().needsRender=!0},t}(n.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.skyboxScene=void 0,t.cameras=[null,null,null,null,null,null],t}return i.__extends(t,e),t.prototype.onAttributesChanged=function(e){if(-1!==e.indexOf("inputTexture")){var t=this.getPreviousAttribute("inputTexture"),r=this.getEngine().getAssetById(t);r&&(this.unregisterDependency(r),this.stopListening(r)),this.inputTexture&&(this.registerDependency(this.inputTexture),this.listenTo(this.inputTexture,"load",this.bindTexture))}},t.prototype.onStartup=function(){this.skyboxScene=new n.Scene,this.registerDependency(this.inputTexture),this.initCameras(),this.createSkybox()},t.prototype.onEntityReady=function(){this.inputTexture&&this.inputTexture.isBaseLoaded()&&this.updateTexture()},t.prototype.onShutdown=function(){this.inputTexture&&this.unregisterDependency(this.inputTexture),this.skyboxGeometry&&this.skyboxGeometry.dispose(),this.equirectMaterial&&this.equirectMaterial.dispose()},t.prototype.bindTexture=function(){this.getEntity().isBaseLoaded()&&(this.stopListening(this.inputTexture,"change:properties",this.updateTexture),this.listenTo(this.inputTexture,"change:properties",this.updateTexture),this.updateTexture())},t.prototype.updateTexture=function(){this.inputTexture.isBaseUnloaded()&&this.inputTexture.load(),this.inputTexture.isBaseLoaded()&&this.getEntity().isBaseLoaded()&&this.renderToCube()},t.prototype.createSkybox=function(){var e=n.ShaderLib.equirect;this.equirectMaterial=new n.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:e.uniforms,depthWrite:!1,side:n.BackSide}),this.skyboxGeometry=new n.BoxGeometry(100,100,100,1,1,1),this.skyboxMesh=new n.Mesh(this.skyboxGeometry,this.equirectMaterial),this.skyboxMesh.frustumCulled=!1,this.skyboxMesh.castShadow=!1,this.skyboxMesh.receiveShadow=!1,this.isEnabled()&&this.skyboxScene.add(this.skyboxMesh)},t.prototype.initCameras=function(){this.cameras[0]=new n.PerspectiveCamera(90,1,1,1e3),this.cameras[0].up.set(0,-1,0),this.cameras[0].lookAt(new n.Vector3(1,0,0)),this.skyboxScene.add(this.cameras[0]),this.cameras[1]=new n.PerspectiveCamera(90,1,1,1e3),this.cameras[1].up.set(0,-1,0),this.cameras[1].lookAt(new n.Vector3(-1,0,0)),this.skyboxScene.add(this.cameras[1]),this.cameras[2]=new n.PerspectiveCamera(90,1,1,1e3),this.cameras[2].up.set(0,0,1),this.cameras[2].lookAt(new n.Vector3(0,1,0)),this.skyboxScene.add(this.cameras[2]),this.cameras[3]=new n.PerspectiveCamera(90,1,1,1e3),this.cameras[3].up.set(0,0,-1),this.cameras[3].lookAt(new n.Vector3(0,-1,0)),this.skyboxScene.add(this.cameras[3]),this.cameras[4]=new n.PerspectiveCamera(90,1,1,1e3),this.cameras[4].up.set(0,-1,0),this.cameras[4].lookAt(new n.Vector3(0,0,1)),this.skyboxScene.add(this.cameras[4]),this.cameras[5]=new n.PerspectiveCamera(90,1,1,1e3),this.cameras[5].up.set(0,-1,0),this.cameras[5].lookAt(new n.Vector3(0,0,-1)),this.skyboxScene.add(this.cameras[5])},t.prototype.renderToCube=function(){if(this.hasRuntimeData()){this.equirectMaterial.uniforms.tEquirect.value=this.inputTexture.getThreeTexture();var e=this.getRuntimeData(),t=this.getThreeRenderer();e.texture.generateMipmaps=!1,t.setViewport(0,0,e.width,e.height);for(var r=0;r<5;r++)e.activeCubeFace=r,t.render(this.skyboxScene,this.cameras[r],e);e.texture.generateMipmaps=this.getEntity().getProperty("useMipmap"),e.activeCubeFace=5,t.render(this.skyboxScene,this.cameras[5],e),this.getEngine().needsRender=!0}},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.framesElapsed=0,t.reflectionNormal=new n.Vector3(0,1,0),t.reflectionPlane=new n.Plane,t.clipPlane=new n.Vector4,t.reflectionPosition=new n.Vector3,t.cameraWorldPosition=new n.Vector3,t.rotationMatrix=new n.Matrix4,t.lookAtPosition=new n.Vector3(0,0,-1),t.up=new n.Vector3(0,1,0),t.perspectiveCamera=null,t.orthoCamera=null,t}return i.__extends(t,e),t.prototype.captureScene=function(e,t){if(!t)throw new Error("Call to ReflectionCapture.captureScene without specifying a camera.");this.updateReflection(t);var r=this.captureTexture?this.captureTexture.runtimeData:null,i=r||this.tempRenderTexture.runtimeData;this.getRenderer().renderView(e,this.reflectionCamera,{renderTarget:i,clearDepth:!0,enableShadows:!1,enablePreRenderFunctions:!1})},t.prototype.onEntityReady=function(){this.initCameras(),this.initTexture()},t.prototype.onAttributesChanged=function(e){-1===e.indexOf("captureTexture")||this.getEntity().isUnloaded()||this.initTexture()},t.prototype.onPreRenderView=function(e,t){this.isEnabled()&&(this.framesElapsed>=this.updateFrameInterval?(this.captureScene(e,t),this.framesElapsed=0):this.framesElapsed++)},t.prototype.createTempRenderTexture=function(){this.tempRenderTexture=this.getEngine().createRenderTexture2d({width:512,height:512,format:"rgba",type:"uByte"},"render_tex_reflection"),this.tempRenderTexture.load()},t.prototype.initTexture=function(){var e=this;this.captureTexture?(this.captureTexture.when("load",function(){e.tempRenderTexture&&e.tempRenderTexture.unload()}),this.captureTexture.isBaseUnloaded()&&this.captureTexture.load()):this.createTempRenderTexture()},t.prototype.initCameras=function(){this.captureTexture&&this.captureTexture.load(),this.perspectiveCamera=new n.PerspectiveCamera,this.orthoCamera=new n.OrthographicCamera(-1,1,-1,1)},t.prototype.updateReflection=function(e){if(this.isEnabled()){var t=function(e){return e<0?-1:1};this.getEntity().runtimeData.updateMatrixWorld(),e.updateMatrixWorld(!1),this.reflectionPosition.setFromMatrixPosition(this.getEntity().runtimeData.matrixWorld),this.cameraWorldPosition.setFromMatrixPosition(e.matrixWorld),this.rotationMatrix.extractRotation(this.getEntity().runtimeData.matrixWorld),this.reflectionNormal.set(0,1,0),this.reflectionNormal.applyMatrix4(this.rotationMatrix);var r=this.reflectionPosition.clone().sub(this.cameraWorldPosition),i=r.reflect(this.reflectionNormal).negate();i.add(this.reflectionPosition),this.rotationMatrix.extractRotation(e.matrixWorld),this.lookAtPosition.set(0,0,-1),this.lookAtPosition.applyMatrix4(this.rotationMatrix),this.lookAtPosition.add(this.cameraWorldPosition);var a=this.reflectionPosition.clone().sub(this.lookAtPosition),o=a.reflect(this.reflectionNormal).negate();o.add(this.reflectionPosition),this.up.set(0,-1,0),this.up.applyMatrix4(this.rotationMatrix);var s=this.up.reflect(this.reflectionNormal).negate();if(e instanceof n.PerspectiveCamera&&this.perspectiveCamera)this.perspectiveCamera.aspect=e.aspect,this.perspectiveCamera.fov=e.fov,this.perspectiveCamera.near=e.near,this.perspectiveCamera.far=e.far,this.reflectionCamera=this.perspectiveCamera;else{if(!(e instanceof n.OrthographicCamera&&this.orthoCamera))return;this.orthoCamera.left=e.left,this.orthoCamera.right=e.right,this.orthoCamera.top=e.top,this.orthoCamera.bottom=e.bottom,this.orthoCamera.near=e.near,this.orthoCamera.far=e.far,this.reflectionCamera=this.orthoCamera}this.reflectionCamera.position.copy(i),this.reflectionCamera.up=s,this.reflectionCamera.lookAt(o),this.reflectionCamera.updateProjectionMatrix(),this.reflectionCamera.updateMatrixWorld(!1),this.reflectionCamera.matrixWorldInverse.getInverse(this.reflectionCamera.matrixWorld),this.reflectionPlane.setFromNormalAndCoplanarPoint(this.reflectionNormal,this.reflectionPosition),this.reflectionPlane.applyMatrix4(this.reflectionCamera.matrixWorldInverse),this.clipPlane.set(this.reflectionPlane.normal.x,this.reflectionPlane.normal.y,this.reflectionPlane.normal.z,this.reflectionPlane.constant);var u=new n.Vector4,p=this.reflectionCamera.projectionMatrix;p.copy(e.projectionMatrix),p.elements[8]*=-1,u.x=(t(this.clipPlane.x)+p.elements[8])/p.elements[0],u.y=(t(this.clipPlane.y)+p.elements[9])/p.elements[5],u.z=-1,u.w=(1+p.elements[10])/p.elements[14];var c=this.clipPlane.multiplyScalar(2/this.clipPlane.dot(u));p.elements[2]=c.x,p.elements[6]=c.y,p.elements[10]=c.z+1-this.clipBias,p.elements[14]=c.w}},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=r(15),o=r(11),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.instance=null,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.listenTo(this.getEntity(),"createRemoteInstance",this.createRemoteInstance),this.listenTo(this.getGlobalEvents(),"createRemoteInstance",this.createRemoteInstance)},t.prototype.createRemoteInstance=function(e){var t=this;if(this.isEnabled()){var r=this.getEngine();r.fetchRemoteRepresentationsFromBox(e).then(function(i){var n=i.representations.entries[0].content.url_template.replace("{+asset_path}","entities.json");r.resourceLoader.load(n,a.default.ENTITIES,{}).on(o.default.LOAD,function(i){var n=i.filter(function(e){return"prefab"===e.type}),a=n.filter(function(e){return r.getAssetById(e.id)}).map(function(e){return r.getAssetById(e.id)});a.length||(r.addEntities(i),a=n.filter(function(e){return r.getAssetById(e.id)}).map(function(e){return r.getAssetById(e.id)})),t.recreateInstance(a,e)})})}},t.prototype.recreateInstance=function(e,t){var r=this,i=this.getEngine();if(this.instance&&(this.instance.destroy(),this.instance=null),e.length>1)this.instance=i.createNode(),e.forEach(function(e){var t=i.getAssetById(e.id);r.instance.addChild(t.createInstance())});else{var n=i.getAssetById(e[0].id);this.instance=n.createInstance()}this.instance&&this.getEntity().addChild(this.instance),this.getEntity().trigger("remoteInstanceCreated",t),this.getGlobalEvents().trigger("remoteInstanceCreated",t)},t}(n.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(3),o=r(2),s=r(18),u=r(5),p=r(195),c=r(14),h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.threeRenderer=null,t.caps={},t.antialias=!1,t.preserveDrawingBuffer=!0,t.precision="highp",t.autoClear=!1,t.devicePixelRatio=1,t.shadowsEnabled=!0,t.shadowsEnabledMobile=!1,t.shadowType=n.PCFSoftShadowMap,t.shadowReverseSided=!1,t.maxTextureSize2d=Number.MAX_SAFE_INTEGER,t.maxTextureSizeCube=Number.MAX_SAFE_INTEGER,t.clearColor=new n.Color,t.clearAlpha=0,t.renderOnDemand=!0,t}return i.__extends(t,e),t.prototype.onAwake=function(){this.canvas=this.getEngine().canvas,this.initDefaultRenderer(),this.getEngine().setRenderer(this);var e=this.getThreeRenderer();e.gammaInput=!1,e.gammaOutput=!0},t.prototype.onStartup=function(){this.listenTo(this.getEngine(),"resize",this.onContainerResize),this.getEngine().renderOnDemand=this.renderOnDemand,this.shadowsEnabledMobile||(this.shadowsEnabled=s.isMobile()?this.shadowsEnabledMobile&&this.shadowsEnabled:this.shadowsEnabled),this.applyRenderSettings()},t.prototype.onShutdown=function(){this.threeRenderer&&(this.threeRenderer.context=null),this.threeRenderer=null,this.canvas=void 0},t.prototype.onAttributesChanged=function(e){var t=!1;-1!==e.indexOf("shadowsEnabledMobile")&&(t=!0),this.shadowsEnabled=s.isMobile()?this.shadowsEnabledMobile&&this.shadowsEnabled:this.shadowsEnabled,this.applyRenderSettings(),this.getEngine().renderOnDemand=this.renderOnDemand,-1!==e.indexOf("clearAlpha")&&this.threeRenderer.setClearColor(this.clearColor,this.clearAlpha),-1!==e.indexOf("clearColor")&&this.threeRenderer.setClearColor(this.clearColor,this.clearAlpha),-1!==e.indexOf("gammaOutput")&&(t=!0),-1!==e.indexOf("gammaInput")&&(t=!0),-1!==e.indexOf("shadowsEnabled")&&(t=!0),-1!==e.indexOf("shadowType")&&(this.shadowType=parseInt(String(this.shadowType),10),t=!0),-1!==e.indexOf("devicePixelRatio")&&this.onContainerResize(),t&&(a.default.info("Rebuilding materials!!!"),this.getEngine().trigger("rebuildMaterials"))},t.prototype.getGPUCapability=function(e){return this.caps[e]},t.prototype.getMaxTextureSize2d=function(){return this.maxTextureSize2d?Math.min(this.maxTextureSize2d,this.getGPUCapability("MAX_TEXTURE_SIZE")):this.getGPUCapability("MAX_TEXTURE_SIZE")},t.prototype.getMaxTextureSizeCube=function(){return this.maxTextureSizeCube?Math.min(this.maxTextureSizeCube,this.getGPUCapability("MAX_CUBE_MAP_TEXTURE_SIZE")):this.getGPUCapability("MAX_CUBE_MAP_TEXTURE_SIZE")},t.prototype.onPreRender=function(){this.threeRenderer.setRenderTarget(null),this.threeRenderer.clear(!0,!0,!0),this.threeRenderer.setViewport(0,0,this.getWidth(),this.getHeight())},t.prototype.renderView=function(e,t,r){void 0===r&&(r={});var i;if(t){r.enablePreRenderFunctions&&this.getEngine().trigger("preRenderView",e,t,r);var n=this.getCanvas().style;void 0===r.opacity||r.viewPort&&(r.viewPort.width!==this.getWidth()||r.viewPort.height!==this.getHeight())?1!==parseFloat(n.opacity)&&(n.opacity="1.0"):parseFloat(n.opacity)!==r.opacity&&(n.opacity=""+r.opacity),r.renderTarget?this.threeRenderer.setRenderTarget(r.renderTarget):this.threeRenderer.setRenderTarget(null),this.threeRenderer.clear(r.clearColor,r.clearDepth,r.clearStencil),r.viewPort&&(i=c.default.sharedUniforms.screenDimensions,i.value.x=r.viewPort.x,i.value.y=r.viewPort.y,i.value.z=r.viewPort.width*this.devicePixelRatio,i.value.w=r.viewPort.height*this.devicePixelRatio,this.threeRenderer.setViewport(r.viewPort.x,r.viewPort.y,r.viewPort.width,r.viewPort.height));var a=r.effect?r.effect:this.threeRenderer;r.renderTarget?a.render(e,t,r.renderTarget,!1):a.render(e,t),this.getEngine().trigger("postRenderView",e,t,r)}},t.prototype.getWidth=function(){return this.canvas.clientWidth?this.canvas.clientWidth:this.canvas.width/this.devicePixelRatio},t.prototype.getHeight=function(){return this.canvas.clientHeight?this.canvas.clientHeight:this.canvas.height/this.devicePixelRatio},t.prototype.getCanvasWidth=function(){return this.canvas.width},t.prototype.getCanvasHeight=function(){return this.canvas.height},t.prototype.getCanvas=function(){return this.threeRenderer.domElement},t.prototype.onContainerResize=function(){if(this.canvas.parentElement){var e=this.canvas.parentElement.clientWidth,t=this.canvas.parentElement.clientHeight;if(this.threeRenderer.setPixelRatio(this.devicePixelRatio),s.isIOS()){var r=this.canvas;this.threeRenderer.setSize(e,t,!1),r.style.width=e+1+"px",r.style.height=t+1+"px",setTimeout(function(){r.style.width=e+"px",r.style.height=t+"px"},100)}else this.threeRenderer.setSize(e,t,!0);this.getEngine().trigger("rendererResize")}else{var i=this.canvas.width/this.devicePixelRatio,n=this.canvas.height/this.devicePixelRatio;this.threeRenderer.setPixelRatio(this.devicePixelRatio),this.threeRenderer.setSize(i,n,!0)}},t.prototype.storeGpuCaps=function(){var e=this.threeRenderer.getContext();a.default.info("WebGL VENDOR is "+e.getParameter(e.VENDOR)),a.default.info("WebGL SHADING_LANGUAGE_VERSION is "+e.getParameter(e.SHADING_LANGUAGE_VERSION)),a.default.info("WebGL RENDERER is "+e.getParameter(e.RENDERER));var t=e.FRAGMENT_SHADER,r=e.LOW_FLOAT,i=e.MEDIUM_FLOAT,n=e.HIGH_FLOAT,o=e.getShaderPrecisionFormat(t,r);if(a.default.info("Fragment Shader lowp is "+o.precision),o=e.getShaderPrecisionFormat(t,i),a.default.info("Fragment Shader mediump is "+o.precision),o=e.getShaderPrecisionFormat(t,n),a.default.info("Fragment Shader highp is "+o.precision),!navigator.isCocoonJS){this.caps.MAX_COMBINED_TEXTURE_IMAGE_UNITS=0,this.caps.MAX_CUBE_MAP_TEXTURE_SIZE=0,this.caps.MAX_FRAGMENT_UNIFORM_VECTORS=0,this.caps.MAX_RENDERBUFFER_SIZE=0,this.caps.MAX_TEXTURE_IMAGE_UNITS=0,this.caps.MAX_TEXTURE_SIZE=0,this.caps.MAX_VARYING_VECTORS=0,this.caps.MAX_VERTEX_ATTRIBS=0,this.caps.MAX_VERTEX_TEXTURE_IMAGE_UNITS=0,this.caps.MAX_VERTEX_UNIFORM_VECTORS=0,this.caps.MAX_VIEWPORT_DIMS=0,this.caps.ALIASED_POINT_SIZE_RANGE=0,this.caps.ALIASED_LINE_WIDTH_RANGE=0,this.caps.SAMPLES=0,this.caps.SAMPLE_BUFFERS=0,this.caps.RED_BITS=0,this.caps.GREEN_BITS=0,this.caps.BLUE_BITS=0,this.caps.ALPHA_BITS=0,this.caps.DEPTH_BITS=0,this.caps.STENCIL_BITS=0,this.caps.SUBPIXEL_BITS=0,this.caps.COMPRESSED_TEXTURE_FORMATS=0,this.caps=u.map(this.caps,function(t,r){return e.getParameter(e[r])}),this.caps.EXTENSIONS=e.getSupportedExtensions();var s=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");this.caps.maxAnisotropy=s?e.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,a.default.info("GPU Capabilities:",this.caps)}},t.prototype.initDefaultRenderer=function(){if(!p.default.isWebGLEnabled())throw new Error("WebGL is not supported, no fallbacks available.");this.threeRenderer=new n.WebGLRenderer({canvas:this.canvas,antialias:this.antialias,preserveDrawingBuffer:this.preserveDrawingBuffer,alpha:!0,precision:this.precision,logarithmicDepthBuffer:this.logarithmicDepthBuffer}),this.threeRenderer.physicallyCorrectLights=!0,this.threeRenderer.setPixelRatio(this.devicePixelRatio>0?this.devicePixelRatio:window.devicePixelRatio),this.storeGpuCaps()},t.prototype.applyRenderSettings=function(){var e=this;this.threeRenderer&&(u.forEach(this,function(t,r){void 0!==e.threeRenderer[r]&&(e.threeRenderer[r]=t)}),this.devicePixelRatio>0||(this.devicePixelRatio=window.devicePixelRatio),this.threeRenderer.setClearColor(this.clearColor,this.clearAlpha),this.shadowsEnabled&&(this.threeRenderer.shadowMap.enabled=!0,this.threeRenderer.shadowMap.type=this.shadowType,this.threeRenderer.shadowMap.renderReverseSided=this.shadowReverseSided))},t}(o.default);t.default=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(10),s=new n.Vector3,u=new n.Euler,p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.quaternion=new n.Quaternion,t.currentGlobalQuaternion=new n.Quaternion,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.rotate=this.autoRotate,this.getEntity().on("startRotate",this.onStartRotate,this),this.getEntity().on("stopRotate",this.onStopRotate,this),this.getEntity().on("toggleRotate",this.onToggleRotate,this)},t.prototype.onShutdown=function(){this.getEntity().off("startRotate",this.onStartRotate,this),this.getEntity().off("stopRotate",this.onStopRotate,this),this.getEntity().off("toggleRotate",this.onToggleRotate,this)},t.prototype.onEnable=function(){this.rotate=this.autoRotate,this.initRotation()},t.prototype.onDisable=function(){var e=this.getEntity();e instanceof o.default&&(this.getRuntimeData().position.copy(e.getPosition()),this.getRuntimeData().quaternion.copy(e.getQuaternion()),this.rotate=!1)},t.prototype.onAttributesChanged=function(e){e.indexOf("rotation")&&this.rotation&&this.initRotation()},t.prototype.onEntityReady=function(){this.initialQuaternion=new n.Quaternion,this.initialQuaternion.copy(this.getRuntimeData().quaternion),this.initRotation()},t.prototype.onUpdate=function(e){this.rotate&&this.isEnabled()&&(this.getEngine().needsRender=!0,this.getRuntimeData()&&this.rotation&&(s.copy(this.rotation).multiplyScalar(e),u.set(s.x,s.y,s.z),this.quaternion.setFromEuler(u),this.local?this.getRuntimeData().quaternion.multiply(this.quaternion):(this.currentGlobalQuaternion.multiply(this.quaternion),this.getRuntimeData().quaternion.multiplyQuaternions(this.currentGlobalQuaternion,this.initialQuaternion))))},t.prototype.initRotation=function(){u.set(this.rotation.x,this.rotation.y,this.rotation.z),this.local?this.getRuntimeData().quaternion.copy(this.initialQuaternion):this.currentGlobalQuaternion.set(0,0,0,1)},t.prototype.onStartRotate=function(){this.rotate=!0},t.prototype.onStopRotate=function(){this.rotate=!1},t.prototype.onToggleRotate=function(){this.rotate=!this.rotate},t}(a.default);t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.onStartup=function(){this.listenTo(this.getEntity(),"change:properties",this.onPropertiesChanged),this.isEnabled()&&this.getEntity().scaleToSize(this.size)},t.prototype.onAttributesChanged=function(e){-1!==e.indexOf("size")&&this.isEnabled()&&this.getEntity().scaleToSize(this.size)},t.prototype.onDisable=function(){this.getEntity().setScale(1,1,1)},t.prototype.onEnable=function(){this.getEntity().scaleToSize(this.size)},t.prototype.onPropertiesChanged=function(e){e.hasOwnProperty("bounds")&&this.isEnabled()&&this.getEntity().scaleToSize(this.size)},t}(n.default);t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(247),s=r(246),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.autoLoad=!0,t.uniforms=null,t.noiseMat=null,t.initialized=!1,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.listenTo(this.getEntity(),"changeNoiseValues",this.changeNoiseValues),this.listenTo(this.getEntity(),"renderNoise",this.changeNoiseValues),this.uniforms={time:{type:"f",value:1},scale:{type:"v2",value:this.scale},offset:{type:"v2",value:this.offset},layerAmplitude:{type:"v4",value:this.layerAmplitude},layerScale:{type:"v4",value:this.layerScale}},this.noiseMat=new n.ShaderMaterial({uniforms:this.uniforms,vertexShader:o,fragmentShader:s}),this.cameraRTT=new n.OrthographicCamera(-.5,.5,.5,-.5,-10,10),this.cameraRTT.position.z=1,this.sceneRTT=new n.Scene,this.sceneRTT.add(this.cameraRTT),this.quadGeo=new n.PlaneGeometry(1,1),this.quadRTT=new n.Mesh(this.quadGeo,this.noiseMat),this.quadRTT.position.z=-5,this.sceneRTT.add(this.quadRTT),this.initialized=!0},t.prototype.onShutdown=function(){this.sceneRTT&&(this.sceneRTT.remove(this.cameraRTT),this.sceneRTT.remove(this.quadRTT)),this.sceneRTT=void 0,this.quadRTT=void 0,this.quadGeo&&this.quadGeo.dispose(),this.noiseMat&&this.noiseMat.dispose(),this.uniforms=void 0},t.prototype.onEntityReady=function(){this.autoLoad&&this.renderNoise()},t.prototype.onAttributesChanged=function(e){this.initialized&&(-1!==e.indexOf("scale")&&void 0!==this.scale.x&&(this.uniforms.scale.value.x=this.scale.x,this.uniforms.scale.value.y=this.scale.y),-1!==e.indexOf("offset")&&void 0!==this.offset.x&&(this.uniforms.offset.value.x=this.offset.x,this.uniforms.offset.value.y=this.offset.y),-1!==e.indexOf("layerScale")&&void 0!==this.layerScale.x&&(this.uniforms.layerScale.value.x=this.layerScale.x,this.uniforms.layerScale.value.y=this.layerScale.y,this.uniforms.layerScale.value.z=this.layerScale.z,this.uniforms.layerScale.value.w=this.layerScale.w),-1!==e.indexOf("layerAmplitude")&&void 0!==this.layerAmplitude.x&&(this.uniforms.layerAmplitude.value.x=this.layerAmplitude.x,this.uniforms.layerAmplitude.value.y=this.layerAmplitude.y,this.uniforms.layerAmplitude.value.z=this.layerAmplitude.z,this.uniforms.layerAmplitude.value.w=this.layerAmplitude.w),this.renderNoise())},t.prototype.renderNoise=function(){this.getThreeRenderer().render(this.sceneRTT,this.cameraRTT,this.getRuntimeData(),!0),this.getThreeRenderer().setRenderTarget(null)},t.prototype.changeNoiseValues=function(e,t,r,i){this.layerAmplitude=e,this.layerScale=t,this.scale=r,this.offset=i,this.onAttributesChanged(["layerAmplitude","layerScale","scale","offset"])},t}(a.default);t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(12),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.skyboxTexture=null,t.stereoEnabled=!1,t.size=100,t.skyboxMesh=null,t.skyboxMeshRightEye=null,t.skyboxGeometry=null,t.skyboxGeometryRightEye=null,t.skyboxMaterialCube=null,t.skyboxUniforms=null,t.skyboxVShader=null,t.skyboxPShader=null,t.skyboxMaterial2D=null,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.initMaterials()},t.prototype.onShutdown=function(){this.skyboxGeometry&&this.skyboxGeometry.dispose(),this.skyboxGeometryRightEye&&this.skyboxGeometryRightEye.dispose(),this.skyboxMaterialCube&&this.skyboxMaterialCube.dispose(),this.skyboxMaterial2D&&this.skyboxMaterial2D.dispose(),this.skyboxMesh=null,this.skyboxGeometry=null,this.skyboxGeometryRightEye=null,this.skyboxMaterialCube=null,this.skyboxMaterial2D=null,this.skyboxUniforms=null,this.skyboxTexture=null},t.prototype.getMesh=function(e){return void 0===e&&(e="left"),"left"===e?this.skyboxMesh:this.skyboxMeshRightEye},t.prototype.onAttributesChanged=function(e){if(-1!==e.indexOf("skyboxTexture")){var t=this.getPreviousAttribute("skyboxTexture");if(t){var r=this.getEngine().getEntityById(t);this.stopListening(r)}this.getEntity().unregisterDependencyById(this.getPreviousAttribute("skyboxTexture"));this.getEntity().getOwnDependencyInfo()[this.getAttribute("skyboxTexture")]||this.getEntity().registerDependencyById(this.getAttribute("skyboxTexture"))}this.getEntity().isBaseLoaded()&&(-1===e.indexOf("skyboxTexture")&&-1===e.indexOf("stereoEnabled")||this.initSkybox(),-1!==e.indexOf("size")&&this.skyboxMesh&&(this.skyboxMesh.scale.set(this.size,this.size,this.size),this.skyboxMeshRightEye.scale.set(this.size,this.size,this.size)))},t.prototype.onEnable=function(){this.getRuntimeData()&&(this.getRuntimeData().add(this.skyboxMesh),this.isStereo()&&this.getRuntimeData().add(this.skyboxMeshRightEye),this.skyboxTexture&&this.skyboxTexture.isUnloaded()&&this.skyboxTexture.load())},t.prototype.onDisable=function(){this.getRuntimeData()&&(this.getRuntimeData().remove(this.skyboxMesh),this.isStereo()&&this.getRuntimeData().remove(this.skyboxMeshRightEye))},t.prototype.onEntityReady=function(){this.initSkybox()},t.prototype.isStereo=function(){if(!this.skyboxTexture||!this.stereoEnabled)return!1;switch(this.skyboxTexture.getLayout()){case o.ImageLayout.Stereo2dOverUnder:case o.ImageLayout.Stereo2dUnderOver:case o.ImageLayout.Stereo2dLeftRight:case o.ImageLayout.Stereo2dRightLeft:return this.stereoEnabled;default:return!1}},t.prototype.initGeometry=function(){this.skyboxGeometry&&(this.skyboxGeometry.dispose(),this.skyboxGeometryRightEye.dispose()),this.skyboxGeometry=new n.SphereBufferGeometry(1,64,64),this.skyboxGeometryRightEye=this.skyboxGeometry.clone()},t.prototype.initStereoUvs=function(){if(this.skyboxTexture){var e=new n.Vector2,t=new n.Vector2,r=new n.Vector2,i=new n.Vector2;switch(this.skyboxTexture.getLayout()){case o.ImageLayout.Stereo2dOverUnder:e.set(1,.5),t.set(0,0),r.set(1,.5),i.set(0,.5);break;case o.ImageLayout.Stereo2dUnderOver:e.set(1,.5),t.set(0,.5),r.set(1,.5),i.set(0,0);break;case o.ImageLayout.Stereo2dLeftRight:e.set(.5,1),t.set(0,0),r.set(.5,1),i.set(.5,0);break;case o.ImageLayout.Stereo2dRightLeft:e.set(.5,1),t.set(.5,0),r.set(.5,1),i.set(0,0);break;default:return}for(var a=this.skyboxGeometry.getAttribute("uv").array,s=this.skyboxGeometryRightEye.getAttribute("uv").array,u=0;un&&i>0?(e.fillText(s,r,u),s=t+" ",u+=a):s=o}),e.fillText(s,r,u)},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.standing=!0,t.userHeight=6,t.frameData=window.hasOwnProperty("VRFrameData")?new VRFrameData:{},t.standingMatrix=new n.Matrix4,t.workVector=new n.Vector3,t.scale=1,t}return i.__extends(t,e),t.prototype.onPreUpdate=function(e){if(this.isEnabled()&&this.hasRuntimeData()){var t=this.getEngine(),r=t.getVrDisplay();if(r){t.needsRender=!0,r.getFrameData(this.frameData);var i=this.frameData.pose,n=this.getRuntimeData(),a=this.getEntity();null!==i.orientation&&(a.setQuaternion(i.orientation[0],i.orientation[1],i.orientation[2],i.orientation[3]),r.capabilities.hasPosition&&i.position&&a.setPosition(i.position[0],i.position[1],i.position[2]),this.standing&&r.stageParameters?(n.updateMatrix(),this.standingMatrix.fromArray(r.stageParameters.sittingToStandingTransform),n.applyMatrix(this.standingMatrix),a.setQuaternion(n.quaternion.x,n.quaternion.y,n.quaternion.z,n.quaternion.w),n.position.multiplyScalar(this.scale),a.setPosition(n.position.x,n.position.y,n.position.z)):(a.getPosition(this.workVector),this.workVector.multiplyScalar(this.scale),a.setPosition(this.workVector.x,this.workVector.y,this.workVector.z)))}}},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=r(18),o=r(3),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.scale=1,t.isPresenting=!1,t.wasPresenting=!1,t.vrDisplays=null,t.previousPixelRatio=1,t}return i.__extends(t,e),t.prototype.getScale=function(){return this.scale},t.prototype.setScale=function(e){this.scale=e},t.prototype.getDisplays=function(){return this.vrDisplays},t.prototype.onAwake=function(){var e=this;this.listenTo(this.getEngine(),"enableVrRendering",this.onEnableVr),this.listenTo(this.getEngine(),"disableVrRendering",this.onDisableVr),this.listenTo(this.getEngine(),"toggleVrRendering",this.onToggleVr),this.onVrDisplayPresentChange=this.onVrDisplayPresentChange.bind(this),window.addEventListener("vrdisplaypresentchange",this.onVrDisplayPresentChange,!1),navigator.getVRDisplays?navigator.getVRDisplays().then(function(t){e.vrDisplays=t,e.trigger("displaysInitialized")}):this.vrDisplays=[]},t.prototype.onShutdown=function(){e.prototype.onShutdown.call(this),window.removeEventListener("vrdisplaypresentchange",this.onVrDisplayPresentChange,!1)},t.prototype.onDisable=function(){this.isPresenting&&this.onDisableVr()},t.prototype.whenDisplaysAvailable=function(e){var t=this;this.vrDisplays?e.call(this,this.vrDisplays):this.listenToOnce(this,"displaysInitialized",function(){e.call(t,t.vrDisplays)})},t.prototype.onPostRender=function(e){var t=this.getEngine().getVrDisplay();t&&this.isPresenting&&t.submitFrame()},t.prototype.onEnableVr=function(){if(this.isEnabled()){if(!this.vrDisplays)return void this.listenToOnce(this,"displaysInitialized",this.onEnableVr.bind(this));if(this.vrDisplays.length){var e=this.vrDisplays[0];this.getEngine().setVrDisplay(e);var t=this.getRenderer().getCanvas();e.requestPresent([{source:t}]).catch(function(e){o.default.error("Failed to present to VR display",e.message)})}}},t.prototype.onDisableVr=function(){if(this.isPresenting){var e=this.getEngine().getVrDisplay();e&&(e.exitPresent(),this.getEngine().setVrDisplay(null))}},t.prototype.onToggleVr=function(){this.isPresenting?this.onDisableVr():this.onEnableVr()},t.prototype.onVrDisplayPresentChange=function(){this.wasPresenting=this.isPresenting;var e=this.getEngine().getVrDisplay();this.isPresenting=e&&e.isPresenting;var t=this.getThreeRenderer();if(this.isPresenting){var r=e.getEyeParameters("left"),i=r.renderWidth,n=r.renderHeight;if(!this.wasPresenting){if(this.previousPixelRatio=t.getPixelRatio(),a.isMobile()){var o=t.capabilities.maxTextureSize,s=2*i;s*this.previousPixelRatio>o&&(this.previousPixelRatio=Math.floor(o/s)),t.setPixelRatio(this.previousPixelRatio)}else t.setPixelRatio(1);t.setSize(2*i,n,!1),this.getEngine().trigger("vrRenderingEnabled")}}else this.wasPresenting&&(t.setPixelRatio(this.previousPixelRatio),this.getEngine().setVrDisplay(null),this.getEngine().trigger("resize"),this.getEngine().trigger("vrRenderingDisabled"))},t}(n.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(39),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.enablePreRenderFunctions=!0,t.enableShadows=!0,t.eyeTranslationL=new n.Vector3,t.eyeTranslationR=new n.Vector3,t.defaultLeftBounds=[0,0,.5,1],t.defaultRightBounds=[.5,0,.5,1],t.renderRectL={x:0,y:0,width:256,height:256},t.renderRectR={x:128,y:0,width:256,height:256},t.cameraL=new n.PerspectiveCamera,t.cameraR=new n.PerspectiveCamera,t.frameData=window.hasOwnProperty("VRFrameData")?new VRFrameData:{},t.scale=1,t}return i.__extends(t,e),t.prototype.renderView=function(t){if(this.isEnabled()&&this.hasRuntimeData()){var r=this.getRootObject();if(r.isBaseLoaded()){var i=r.getRuntimeData(),n=this.getEngine().getVrDisplay();if(!n)return e.prototype.renderView.call(this,t);var a=i.autoUpdate;a&&(i.updateMatrixWorld(),i.autoUpdate=!1);var o=n.getEyeParameters("left"),s=n.getEyeParameters("right");this.eyeTranslationL.fromArray(o.offset),this.eyeTranslationR.fromArray(s.offset);var u,p,c=this.getThreeRenderer(),h=c.getSize(),l=n.getLayers();if(l.length){var d=l[0];u=null!==d.leftBounds&&4===d.leftBounds.length?d.leftBounds:this.defaultLeftBounds,p=null!==d.rightBounds&&4===d.rightBounds.length?d.rightBounds:this.defaultRightBounds}else u=this.defaultLeftBounds,p=this.defaultRightBounds;this.renderRectL={x:Math.round(h.width*u[0]),y:Math.round(h.height*u[1]),width:Math.round(h.width*u[2]),height:Math.round(h.height*u[3])},this.renderRectR={x:Math.round(h.width*p[0]),y:Math.round(h.height*p[1]),width:Math.round(h.width*p[2]),height:Math.round(h.height*p[3])};var f=this.getRuntimeData();null===f.parent&&f.updateMatrixWorld(),f.matrixWorld.decompose(this.cameraL.position,this.cameraL.quaternion,this.cameraL.scale),f.matrixWorld.decompose(this.cameraR.position,this.cameraR.quaternion,this.cameraR.scale),this.cameraL.translateOnAxis(this.eyeTranslationL,this.scale),this.cameraR.translateOnAxis(this.eyeTranslationR,this.scale),n.depthNear=f.near,n.depthFar=f.far,n.getFrameData(this.frameData),this.cameraL.projectionMatrix.elements=this.frameData.leftProjectionMatrix,this.cameraR.projectionMatrix.elements=this.frameData.rightProjectionMatrix,c.setScissor(this.renderRectL.x,this.renderRectL.y,this.renderRectL.width,this.renderRectL.height),this.getRenderer().renderView(i,this.cameraL,{renderTarget:this.renderTarget,clearDepth:!0,clearColor:!0,viewPort:this.renderRectL,enablePreRenderFunctions:!0}),c.setScissor(this.renderRectR.x,this.renderRectR.y,this.renderRectR.width,this.renderRectR.height),this.getRenderer().renderView(i,this.cameraR,{renderTarget:this.renderTarget,clearDepth:!1,clearColor:!1,viewPort:this.renderRectR,enablePreRenderFunctions:!0}),a&&(i.autoUpdate=!0)}}},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultBoxApiBase="https://api.box.com"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(3),o=r(213),s=r(212),u=r(214),p=r(209),c=r(220),h=r(28),l=r(79),d=r(36),f=r(14),m=r(50),y=r(49),g=r(9),v=r(35),b=r(15),x=r(11),P=r(122),w=function(e){var t;return e&&e.jquery?e.get(0):"string"==typeof e?(t=document.querySelectorAll(e),t.length&&t[0]):e};t.engineMixins=y.default({},[u.default,s.default,h.default]);var E=function(e){function t(t){var r=e.call(this)||this;r.registeredGlobalEvents={},r.renderOnDemand=!1,r.needsRender=!0,r.container=void 0,r.globalEvents=void 0,r.engineName="Unnamed Instance of Box3D Engine",r.apiBase=P.defaultBoxApiBase,r.audioContext=void 0,r.paused=!1,r.runMode="player",r.runtimeNames={},r.nextRuntimeName=1,a.default.info("Engine Initialization"),r.globalScope=t.globalScope||window;return function(){if(r.globalEvents=t&&t.globalEvents||m.default,!r.globalEvents)throw new Error("No global event system supplied or found")}(),function(){r.container=r.container||w(t.container)}(),function(){if(r.canvas=r.canvas||w(t.canvas),r.canvas||(r.canvas=document.createElement("canvas"),r.container&&r.container.appendChild(r.canvas),r.canvasCreatedByEngine=!0),!(r.canvas instanceof HTMLCanvasElement))throw new Error("Failed to create canvas element")}(),function(){if(r.resourceLoader=t.resourceLoader,t.apiBase&&(r.apiBase=t.apiBase),!r.resourceLoader)throw new Error("No resource loader passed to Engine")}(),function(){r.materialUtilities=new c.default(r)}(),function(){r.geometryUtilities=new p.default}(),function(){r.engineName=t.engineName||r.engineName,r.clock=new n.Clock(!0),r.frameDelta=0,r.frameDeltaAggregate=0,r.frameCount=0,r.lastFrameDelta=r.getTimeNow(),r.avgFrameTime=0,r.paused=!1,r.documentVisible=!0,r.state="initializing",r.setRunMode(t.runMode),r.entityDispatcher=t.entityDispatcher||new o.default,r.entityDispatcher.addEngine(r)}(),function(){r.scriptRegistry=new l.default(r),Object.keys(d.default.builtInAssetDescriptors).forEach(function(e){r.createEntity(d.default.builtInAssetDescriptors[e])}),Object.keys(f.default.builtInAssetDescriptors).forEach(function(e){r.createEntity(f.default.builtInAssetDescriptors[e])})}(),function(){r.onResize=function(){r.needsRender=!0},r.onBlur=function(){r.trigger("blur")},r.onFocus=function(){r.trigger("focus")},r.onVisibilityChange=function(){var e=document.hidden||document.mozHidden||document.msHidden||document.webkitHidden;r.documentVisible&&e?r.documentVisible=!1:r.documentVisible||(r.frameDelta=0,r.lastFrameDelta=r.getTimeNow(),r.documentVisible=!0)},window.addEventListener("blur",r.onBlur),window.addEventListener("focus",r.onFocus),r.listenTo(r,"resize",r.onResize),document.addEventListener("visibilitychange",r.onVisibilityChange)}(),function(){r.globalScope[r.engineName]=r,r.update(),r.state="initialized"}(),r}return i.__extends(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this),a.default.info(this.engineName+" - Destroying engine."),window[this.engineName]&&delete window[this.engineName],this.baseRenderer=void 0,this.resourceLoader.destroy(),this.materialUtilities.destroy(),this.geometryUtilities.destroy(),window.removeEventListener("blur",this.onBlur),window.removeEventListener("focus",this.onFocus),this.stopListening(this,"resize",this.onResize),document.removeEventListener("visibilitychange",this.onVisibilityChange),this.onBlur=void 0,this.onFocus=void 0,this.onResize=void 0,this.onVisibilityChange=void 0,this.trigger("shutdown"),this.state="uninitializing",this.cancelAnimationFrame(this.animationRequestID),this.canvas&&this.canvas.parentNode&&this.canvasCreatedByEngine&&this.canvas.parentNode.removeChild(this.canvas),this.entityDispatcher&&this.entityDispatcher.removeEngine(this),this.clock=void 0,this.canvas=void 0,this.container=void 0,this.threeRenderer=void 0,this.baseRenderer=void 0,this.engineName=void 0,this.entityDispatcher=void 0,this.state="uninitialized"},t.prototype.getName=function(){return this.engineName},t.prototype.addEntities=function(e){return this.entityDispatcher?this.entityDispatcher.addEntities(e):[]},t.prototype.addEntitiesFromUrl=function(e){var t=this;return this.entityDispatcher?new Promise(function(r,i){fetch(e).then(function(e){return e.json()}).then(function(e){t.entityDispatcher.addEntities(e.entities),r(e.entities)}).catch(function(e){return i(e)})}):Promise.reject("Can't add entities without an EntityDispatcher assigned to the engine.")},t.prototype.addRemoteEntities=function(e,t){var r=this;return void 0===t&&(t={}),new Promise(function(i,n){r.resourceLoader.load(e,b.default.ENTITIES,t).on(x.default.LOAD,function(e){i(r.addEntities(e))}).on(x.default.ERROR,function(e){return n(e)})})},t.prototype.addRemoteEntitiesFromBox=function(e,t,r){var i=this;return void 0===t&&(t={}),this.fetchRemoteRepresentationsFromBox(e,t,r||this.apiBase).then(function(e){return i.addRemoteEntities(e.representations.entries[0].content.url_template.replace("{+asset_path}","entities.json"),t)})},t.prototype.fetchRemoteRepresentationsFromBox=function(e,t,r){var n=this;void 0===t&&(t={});var a=(r||this.apiBase)+"/2.0/files/"+e+"?fields=representations";return new Promise(function(e,r){return n.resourceLoader.load(a,b.default.JSON,i.__assign({headers:{"X-Rep-Hints":"[3d]"}},t)).on(x.default.LOAD,function(t){return e(t)}).on(x.default.ERROR,function(e){return r(e)})})},t.prototype.loadEntities=function(e,t,r){var i=this;void 0===r&&(r="load"),Promise.all(e.map(function(e){var t=e instanceof g.default?e.id:e;return new Promise(function(e,n){var a=i.getEntityById(t);a?(a.when(r,function(){e()}),a.isUnloaded()&&a.load()):n(new Error("Entity can't be found."))})})).then(function(){"function"==typeof t&&t.call(i)}).catch(function(e){"function"==typeof t&&(a.default.error("loadEntities error: "+e),t.call(i,e))})},t.prototype.setVrDisplay=function(e){var t=this;this.cancelAnimationFrame(this.animationRequestID),this.vrDevice=e,this.animationRequestID=this.requestAnimationFrame(function(){t.needsRender=!0,t.update()})},t.prototype.getVrDisplay=function(){return this.vrDevice},t.prototype.getApplication=function(){return this.getAssetsByClass(v.default).find(function(e){return e.isBaseLoaded()})},t.prototype.setRunMode=function(e){this.runMode="editor"===e?e:"player"},t.prototype.getRunMode=function(){return this.runMode},t.prototype.getRenderer=function(){return this.baseRenderer},t.prototype.setRenderer=function(e){this.baseRenderer&&(this.baseRenderer.onShutdown(),this.baseRenderer.stopListening()),this.baseRenderer=e,this.threeRenderer=e.threeRenderer},t.prototype.getThreeRenderer=function(){return this.threeRenderer},t.prototype.getGPUCapability=function(e){return this.baseRenderer.caps[e]},t.prototype.getAudioContext=function(){if(!this.audioContext){var e=this.globalScope.AudioContext||this.globalScope.webkitAudioContext;e&&(this.audioContext=new e,this.audioContext||a.default.warn(this.engineName+" - Failed to create Web Audio API context"))}return this.audioContext},t.prototype.getRuntimeName=function(e){return this.runtimeNames.hasOwnProperty(e)||(this.runtimeNames[e]=this.nextRuntimeName.toString(),this.nextRuntimeName++),this.runtimeNames[e]},t.prototype.pause=function(){this.paused||(this.paused=!0,this.clock.stop(),this.cancelAnimationFrame(this.animationRequestID),a.default.info(this.engineName+" engine has been paused."))},t.prototype.unpause=function(){this.paused&&(this.paused=!1,this.frameDelta=0,this.lastFrameDelta=this.getTimeNow(),this.clock.start(),a.default.info(this.engineName+" engine has been unpaused."),this.update())},t.prototype.getTimeNow=function(){return.001*(window.performance&&window.performance.now?window.performance.now():Date.now())},t.prototype.update=function(){var e=this;this.paused||(this.animationRequestID=this.requestAnimationFrame(function(){e.update()}),this.documentVisible&&(this.frameCount++,this.frameDelta=this.getTimeNow()-this.lastFrameDelta,this.lastFrameDelta=this.getTimeNow(),this.frameDeltaAggregate+=this.frameDelta,this.avgFrameTime=this.frameDeltaAggregate/this.frameCount,this.trigger("preUpdate",this.frameDelta),this.trigger("update",this.frameDelta),this.trigger("postUpdate",this.frameDelta),this.renderOnDemand&&!this.needsRender||(this.needsRender=!1,this.trigger("preRender",this.frameDelta),this.trigger("render",this.frameDelta),this.trigger("renderGroup1",this.frameDelta),this.trigger("renderGroup2",this.frameDelta),this.trigger("renderGroup3",this.frameDelta),this.trigger("renderGroup4",this.frameDelta),this.trigger("renderGroup5",this.frameDelta),this.trigger("renderGroup6",this.frameDelta),this.trigger("renderGroup7",this.frameDelta),this.trigger("renderGroup8",this.frameDelta),this.trigger("renderGroup9",this.frameDelta),this.trigger("renderGroup10",this.frameDelta),this.trigger("postRender",this.frameDelta))))},t.prototype.requestAnimationFrame=function(e){return this.vrDevice?this.vrDevice.requestAnimationFrame(e):requestAnimationFrame(e)},t.prototype.cancelAnimationFrame=function(e){return this.vrDevice?this.vrDevice.cancelAnimationFrame(e):cancelAnimationFrame(e)},t}(t.engineMixins);t.default=E},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={roughness:{displayName:"Roughness",description:"How rough the surface appears.",type:"f",min:0,max:1,default:.5,isRenderParam:!0},roughnessMap:{displayName:"Roughness Map",description:"A texture that stores the roughness info of the material.",type:"t",default:null,isRenderParam:!0,enabledWhen:{roughnessMap:{notEqualsDefault:!0}}},metalness:{displayName:"Metalness",description:"How metallic the surface appears (multiplied by the metalness texture).",type:"f",min:0,max:1,default:0,isRenderParam:!0,enabledWhen:{metalness:{notEqualsDefault:!0}}},metalnessMap:{displayName:"Metalness Map",description:"A texture that contains the metalness of the material.",type:"t",default:null,isRenderParam:!0,enabledWhen:{metalnessMap:{notEqualsDefault:!0}}}};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"accessor",title:"AccessorDef",type:"object",description:"A typed-view into raw binary data.",properties:{componentType:{type:"string",enum:["int8","uint8","int16","int32","uint32","float32","float64"],description:"These correspond to typed arrays: Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array."},type:{type:"string",enum:["scalar","vec2","vec3","vec4","mat2","mat3","mat4"],description:"Specifies if elements are scalars, vectors or matrices."},byteOffset:{type:"integer",description:"Byte offset into the binary data."},byteStride:{type:"integer",description:"The number of bytes between successive elements (0 indicates that the elements are tightly packed)."},count:{type:"integer",description:"The number of elements, not to be confused with the number of components or bytes. For example, the number of positions, not the number of floats."}},additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"animationAsset",title:"AnimationAssetDef",type:"object",properties:i.__assign({},n.default.properties,{type:{enum:["animation"]},properties:{$ref:"animationAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"animationAssetProperties",title:"AnimationAssetPropertiesDef",type:"object",properties:i.__assign({},n.default.properties,{clips:{type:"object",description:"The clips for the animation.",properties:{},additionalProperties:{$ref:"animationClip.json"},default:{}},layers:{type:"object",description:"The layers of the animation.",properties:{},additionalProperties:{$ref:"animationLayer.json"},defualt:{}},channels:{type:"object",description:"The channels for the animation.",properties:{},additionalProperties:{$ref:"animationChannel.json"},default:{}}}),required:["clips","layers","channels"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"animationChannel",title:"AnimationChannelDef",type:"object",description:"An animation channel.",properties:{name:{type:"string",description:"The channel's name."},targetObject:{type:"array",description:"The path of the object to animate.",items:{type:"string"},default:[]},targetProperty:{type:"string",description:"The path of the property to animate."},values:{type:"string",description:"The ID of the accessor for the channel values."},times:{type:"string",description:"The ID of the accessor for the channel times."},interpolation:{type:"string",enum:["linear"],description:"The interpolation type for the channel."}},required:["name","targetObject","targetProperty","values","times","interpolation"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"animationClip",title:"AnimationClipDef",type:"object",description:"An animation clip.",properties:{name:{type:"string",description:"The clip's name."},start:{type:"number",description:"The take's start time, in seconds.",default:0},stop:{type:"number",description:"The take's stop time, in seconds.",default:0},layers:{type:"array",items:{type:"string"},default:[]}},required:["name","start","stop","layers"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"animationLayer",title:"AnimationLayerDef",type:"object",description:"An animation layer.",properties:{name:{type:"string",description:"The layer's name."},blendMode:{enum:["additive"],description:"The layer's blend mode.",default:"additive"},blendWeight:{type:"number",description:"The layer's blend weight.",default:1},channels:{type:"array",items:{type:"string"},default:[]}},required:["name","blendMode","blendWeight","channels"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"applicationAsset",title:"ApplicationAssetDef",type:"object",properties:i.__assign({},n.default.properties,{type:{enum:["application"]},properties:{$ref:"applicationAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"applicationAssetProperties",title:"ApplicationAssetPropertiesDef",type:"object",properties:i.__assign({},n.default.properties,{startupSceneId:{type:["string","null"],description:"The prefab that will be loaded when the application loads.#entity-PrefabAsset"}}),required:["startupSceneId"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"audioAsset",title:"AudioAssetDef",type:"object",properties:i.__assign({},n.default.properties,{type:{enum:["audio"]},representations:i.__assign({},n.default.properties.representations,{type:{$ref:"audioRepresentation.json"}}),properties:{$ref:"audioAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"audioAssetProperties",title:"AudioAssetPropertiesDef"});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(32),a=i.__assign({},n.default,{id:"audioRepresentation",title:"AudioRepresentationDef",properties:i.__assign({},n.default.properties,{bitRate:{type:"number"},sampleRate:{type:"number"},stereo:{type:"boolean"},startTime:{type:"number"},duration:{type:"number"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"boneObject",title:"BoneObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["bone"]},properties:{$ref:"boneObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"boneObjectProperties",title:"BoneObjectPropertiesDef"});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"box3",title:"Box3Def",type:"object",properties:{min:{$ref:"vector3.json"},max:{$ref:"vector3.json"}},required:["min","max"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"bufferAsset",title:"BufferAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["buffer"]},properties:{$ref:"bufferAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"bufferAssetProperties",title:"BufferAssetPropertiesDef",properties:i.__assign({},n.default.properties,{src:{type:"string",description:"The URL of the binary file."},isExternal:{type:"boolean",description:"True is the asset should be loaded from outside of the base data provider/content provider.",default:!1},contentLength:{type:"number",description:"The HTTP Content-Length."},accessors:{type:"object",properties:{},additionalProperties:{$ref:"accessor.json"},description:"Typed-views into the binary file."}}),required:["src","contentLength"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"cameraObject",title:"CameraObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["camera"]},properties:{$ref:"cameraObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"cameraObjectProperties",title:"CameraObjectPropertiesDef",properties:i.__assign({},n.default.properties,{cameraType:{type:"string",description:"The projection type of the camera. e.g. perspective or orthographic",enum:["perspective","orthographic"],default:"perspective"},fov:{type:"number",description:"The field of view of the camera. i.e. angular size of view.",default:50,dependencies:{cameraType:["perspective"]}},aspect:{type:"number",description:"Aspect ratio of view. i.e. Width divided by height.",default:1.7777777777777777},near:{type:"number",description:"The near clipping plane of the camera. i.e. the closest distance rendered.",default:.1},far:{type:"number",description:"The far clipping plane of the camera. i.e. the furthest distance rendered.",default:12e3},right:{type:"number",description:"The right clipping plane of an orthographic camera.",default:10,dependencies:{cameraType:["orthographic"]}},left:{type:"number",description:"The left clipping plane of an orthographic camera.",default:-10,dependencies:{cameraType:["orthographic"]}},top:{type:"number",description:"The top clipping plane of an orthographic camera.",default:10,dependencies:{cameraType:["orthographic"]}},bottom:{type:"number",description:"The bottom clipping plane of an orthographic camera.",default:-10,dependencies:{cameraType:["orthographic"]}}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"colorRgb",title:"ColorRgb",type:"object",properties:{r:{type:"number",minimum:0,maximum:1},g:{type:"number",minimum:0,maximum:1},b:{type:"number",minimum:0,maximum:1}},required:["r","g","b"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"component",title:"ComponentDef",type:"object",properties:{id:{type:"string"},scriptId:{type:"string"},name:{type:"string"},enabled:{type:"boolean"},attributes:{type:"object",properties:{},additionalProperties:{$ref:"componentAttribute.json"}}},additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"componentAttribute",title:"ComponentAttributeDef",type:"object",properties:{type:{type:"string"},subType:{type:"object",properties:{type:{type:"string"},attributes:{}},additionalProperties:!1},attributes:{type:"array",items:{type:"object",properties:{type:{type:"string"},attributes:{}},additionalProperties:!1}}},additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"documentAsset",title:"DocumentAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["document"]},properties:{$ref:"documentAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"documentAssetProperties",title:"DocumentAssetPropertiesDef"});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"dracoAttribute",title:"DracoAttributeDef",type:"object",description:"Specifies the name and ID of a Draco attribute.",properties:{name:{type:"string",description:"The name of the this attribute. For example, texture's have a uvSet property that contains the name of a UV attribute."},id:{type:"string",description:"The ID of the Draco attribute."}},required:["name","id"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(29),a=i.__assign({},n.default,{id:"dracoGeometryAsset",title:"DracoGeometryAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["dracoGeometry"]},properties:{$ref:"dracoGeometryAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(30),a=i.__assign({},n.default,{id:"dracoGeometryAssetProperties",title:"DracoGeometryAssetPropertiesDef",properties:i.__assign({},n.default.properties,{accessorId:{type:["string","null"],description:"The ID of the accessor containing the draco geometry: #."},attributes:{type:"object",properties:{},additionalProperties:{$ref:"dracoAttribute.json"},description:"A collection of vertex attributes. All attributes must have the same number of elements."}}),required:["accessorId"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"eventScope",title:"EventScopeDef",type:"object",properties:{scopeName:{type:"string",enum:["global","this","entity","component"],default:"global"},entityId:{description:"The entity's name.",type:["string","null"],default:null},componentId:{description:"The entity's name.",type:["string","null"],default:null}},required:["scopeName"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(73),a=i.__assign({},n.default,{id:"imageAsset",title:"ImageAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["image"]},representations:i.__assign({},n.default.properties.representations,{type:{$ref:"imageRepresentation.json"}}),properties:{$ref:"imageAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(45),a=i.__assign({},n.default,{id:"imageAssetProperties",title:"ImageAssetPropertiesDef",properties:i.__assign({},n.default.properties,{useCompression:{type:"boolean",description:"True if we will try to use a hardware-compressed version of the image 'instead of a regular one. This depends on the hardware capabilities of the user and the data formats available.",default:!0}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(32),a={id:"imageRepresentation",title:"ImageRepresentationDef",properties:i.__assign({},n.default.properties,{src:{type:"string",description:"The URL of the representation."},channels:{type:"array",items:{type:"string",enum:["red","green","blue","alpha","gray","exponent"]}},compression:{type:"string",enum:["dxt","dxt1","dxt5","jpeg","zip"]},isExternal:{type:"boolean"},width:{type:"integer",description:"The width, in pixels, of the representation."},height:{type:"integer",description:"The height, in pixels, of the representation."},colorspace:{type:"string",enum:["srgb","rgb"]}}),required:["src"],additionalProperties:!1};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"lightObject",title:"LightObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["light"]},properties:{$ref:"lightObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"lightObjectProperties",title:"LightObjectPropertiesDef",properties:i.__assign({},n.default.properties,{lightType:{type:"string",description:"The type of light. e.g. directional, point, spot, etc.",enum:["directional","point","spot","hemisphere","ambient"],default:"directional"},color:{$ref:"colorRgb.json",description:"The color of the light in {r, g, b} form. Each channel is defined between 0.0 and 1.0.",default:{r:.7333,g:.7333,b:.7333}},intensity:{type:"number",description:"The brightness of the light.",minimum:0,default:1},distance:{type:"number",description:"A value that controls the falloff rate of the light.",default:0,minimum:0,dependencies:{lightType:["point","spot"]}},decay:{type:"number",description:"The decay exponent of the light falloff.",default:2,minimum:0,maximum:5,dependencies:{lightType:["point","spot"]}},angle:{type:"number",description:"The angle of the bright light at the center of the spotlight.",default:Math.PI/3,minimum:1,maximum:Math.PI,dependencies:{lightType:["spot"]}},penumbra:{type:"number",description:"The outer angle that defines the edge of the spotlight.",default:Math.PI/4,minimum:.001,maximum:Math.PI/2,dependencies:{lightType:["spot"]}},groundColor:{$ref:"colorRgb.json",description:"The color of the lower half of the hemisphere light.",dependencies:{lightType:["hemisphere"]},default:{r:.033,g:.333,b:.7333}},castShadow:{type:"boolean",description:"Whether or not the light casts a shadow.",dependencies:{lightType:["directional","spot","point"]},default:!1},receiveShadow:{description:"Doesn't apply to lights. #unused"},shadowCameraNear:{type:"number",description:"Near clip plane for the shadow rendering. i.e. how far from the light the shadow casting begins.",default:.1},shadowCameraFar:{type:"number",description:"Far clip plane for the shadow rendering. i.e. how far from the light the shadow casting ends.",default:20},shadowCameraLeft:{type:"number",description:"Left clip plane for the shadow rendering. i.e. how far to the left the shadow casting extends.",default:-10,dependencies:{lightType:["directional"]}},shadowCameraRight:{type:"number",description:"Right clip plane for the shadow rendering. i.e. how far to the right the shadow casting extends.",default:10,dependencies:{lightType:["directional"]}},shadowCameraTop:{type:"number",description:"Top clip plane for the shadow rendering. i.e. how far to the top the shadow casting extends.",default:10,dependencies:{lightType:["directional"]}},shadowCameraBottom:{type:"number",description:"Bottom clip plane for the shadow rendering. i.e. how far to the bottom the shadow casting extends.",default:-10,dependencies:{lightType:["directional"]}},shadowBias:{type:"number",description:"Small value for pushing shadow depth toward or away from the light. This can help reduce shadowing artifacts.",default:-.0015,step:1e-4,minimum:-.01,maximum:.01},shadowMapWidth:{type:"integer",default:1024,description:"Resolution of the shadow map texture used for this light. #read-only"},shadowMapHeight:{type:"integer",default:1024,description:"Resolution of the shadow map texture used for this light. #read-only"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"materialAsset",title:"MaterialAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["material"]},properties:{$ref:"materialAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"materialAssetProperties",title:"MaterialAssetPropertiesDef",properties:i.__assign({},n.default.properties,{shaderId:{type:"string",default:"fbx_surface_phong_shader"}}),additionalProperties:!0});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"meshAttribute",title:"MeshAttributeDef",type:"object",description:"Specifies a range of attribute data for the vertices of a mesh.",properties:{name:{type:"string",description:"The name of the this attribute. For example, texture's have a uvSet property that contains the name of a UV attribute."},accessorId:{type:["string","null"],description:"The ID of the buffer asset and accessor: #."}},required:["name","accessorId"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(29),a=i.__assign({},n.default,{id:"meshGeometryAsset",title:"MeshGeometryAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["meshGeometry"]},properties:{$ref:"meshGeometryAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(30),a=i.__assign({},n.default,{id:"meshGeometryAssetProperties",title:"MeshGeometryAssetPropertiesDef",properties:i.__assign({},n.default.properties,{attributes:{type:"object",properties:{},additionalProperties:{$ref:"meshAttribute.json"},description:"A collection of vertex attributes. All attributes must have the same number of elements.#unused"},indices:{type:["string","null"],description:"The ID of the accessor containing the vertex indices: #.#unused"},primitives:{type:"array",items:{$ref:"meshPrimitive.json"},description:"The primitives (points, lines, triangles) that make up the mesh.#unused"}}),required:["attributes","indices","primitives"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"meshObject",title:"MeshObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["mesh"]},properties:{$ref:"meshObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"meshObjectProperties",title:"MeshObjectPropertiesDef",properties:i.__assign({},n.default.properties,{customDepthMaterial:{type:["string","null"],description:"Material for doing custom depth rendering. This is used when the mesh is rendered in a depth pass, shadow, etc.",default:null},materials:{type:"array",description:"The array of materials used by this mesh. #entity-MaterialAsset",items:{type:["string","null"]},default:["missingMaterial"]},geometryId:{type:["string","null"],description:"The geometry used by this mesh. #entity-BaseGeometryAsset",default:null},skinId:{type:["string","null"],description:"The skin asset used by this mesh (if it uses skinning). #entity-SkinAsset",default:null}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={$schema:"http://json-schema.org/draft-04/schema",id:"meshPrimitve",title:"meshPrimitiveDef",type:"object",description:"A mesh primitive with an optional material assignment.",properties:{primitive:{enum:["points","lines","triangles"],description:"The type of primitive to render.",default:"triangles"},count:{type:"integer",description:"The number of vertices to draw.",default:0},start:{type:"integer",description:"The index of the first vertex to draw.",default:0},offset:{type:"integer",description:"An offset to apply to each index. This can be used to overcome the 16-bit index limit imposed by WebGL. For example, the first component of a vertex attribute with a value size of 3 would be referenced as follows: values[3 * (offset + indices[start + i])].",default:0},materialIndex:{type:"integer",description:"The index of the material to apply to the primitive being rendered.",default:0}},required:["primitve","count"],additionalProperties:!1}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"nodeObject",title:"NodeObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["node"]}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"nodeObjectProperties",title:"NodeObjectPropertiesDef",properties:i.__assign({},n.default.properties)});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"prefabAsset",title:"PrefabAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["prefab"]},properties:{$ref:"prefabAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"prefabAssetProperties",title:"PrefabAssetPropertiesDef",properties:i.__assign({},n.default.properties,{rootObjectId:{type:["string","null"],default:null,description:"The ID of the BaseObject that serves as the root node of a hierarchy. #entity-BaseObject"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(29),a=i.__assign({},n.default,{id:"primitiveGeometryAsset",title:"PrimitiveGeometryAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["primitiveGeometry"]},properties:{$ref:"primitiveGeometryAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(30),a=i.__assign({},n.default,{id:"primitiveGeometryAssetProperties",title:"PrimitiveGeometryAssetPropertiesDef",properties:i.__assign({},n.default.properties,{type:{type:"string",description:"The basic shape of the geometry.",default:"sphere",enum:["sphere","box","plane","torus","cylinder"]},radius:{type:"number",description:"The radius of the sphere/torus.",default:.5,minimum:0,dependencies:{type:["sphere","torus"]}},segmentsU:{type:"integer",description:"The number of segments along the first axis of the sphere/torus/cylinder.",default:24,minimum:0,dependencies:{type:["torus","sphere","cylinder"]}},segmentsV:{type:"integer",description:"The number of segments along the second axis of the sphere/torus/cylinder.",default:24,minimum:0,dependencies:{type:["torus","sphere","cylinder"]}},sizeX:{type:"number",description:"The size of the geometry along the x-axis.",default:1,dependencies:{type:["box","plane"]}},sizeY:{type:"number",description:"The size of the geometry along the y-axis.",default:1,dependencies:{type:["box","plane"]}},sizeZ:{type:"number",description:"The size of the geometry along the z-axis.",default:1,dependencies:{type:["box"]}},segmentsX:{type:"integer",description:"The number of segments (quads) of the geometry along the x-axis.",default:1,minimum:0,dependencies:{type:["box","plane"]}},segmentsY:{type:"integer",description:"The number of segments (quads) of the geometry along the y-axis.",default:1,minimum:0,dependencies:{type:["box","plane"]}},segmentsZ:{type:"integer",description:"The number of segments (quads) of the geometry along the z-axis.",default:1,minimum:0,dependencies:{type:["box"]}},radiusTop:{type:"number",description:"The radius of the top of the cylinder.",default:.5,minimum:0,dependencies:{type:["cylinder"]}},radiusBottom:{type:"number",description:"The radius at the bottom of the cylinder.",default:.5,minimum:0,dependencies:{type:["cylinder"]}},height:{type:"number",description:"The height of the cylinder.",default:1,minimum:0,dependencies:{type:["cylinder"]}},open:{type:"boolean",description:"Controls whether the cylinder has a top and bottom.",default:!1,dependencies:{type:["cylinder"]}},tubeRadius:{type:"number",description:"The radius of the tube of the torus.",default:.1,minimum:0,dependencies:{type:["torus"]}},arcAngle:{type:"number",description:"Controls the angle, in radians, that the torus is built with. Defaults to full torus (2PI).",default:6.283185307179586,minimum:0,maximum:6.283185307179586,dependencies:{type:["torus"]}},phiStart:{type:"number",description:"Controls the longitude, in radians, that the sphere construction starts at.",default:0,minimum:0,maximum:6.283185307179586,dependencies:{type:["sphere"]}},phiLength:{type:"number",description:"Controls the longitude, in radians, that the sphere construction ends at. Defaults to 2PI.",default:6.283185307179586,minimum:0,maximum:6.283185307179586,dependencies:{type:["sphere"]}},thetaStart:{type:"number",description:"Controls the angle, in radians, that the construction starts at.",default:0,minimum:0,maximum:6.283185307179586,dependencies:{type:["sphere","cylinder"]}},thetaLength:{type:"number",description:"Controls the angle, in radians, that the construction ends at. Defaults to PI.",default:3.141592653589793,minimum:0,maximum:6.283185307179586,dependencies:{type:["sphere","cylinder"]}}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(46),a=i.__assign({},n.default,{id:"renderTexture2DAsset",title:"RenderTexture2DAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["renderTexture2D"]},properties:{$ref:"renderTexture2DAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(47),a=i.__assign({},n.default,{id:"renderTexture2DAssetProperties",title:"RenderTexture2DAssetPropertiesDef"});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(46),a=i.__assign({},n.default,{id:"renderTextureCubeAsset",title:"RenderTextureCubeAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["renderTextureCube"]},properties:{$ref:"renderTextureCubeAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(47),a=i.__assign({},n.default,{id:"renderTextureCubeAssetProperties",title:"RenderTextureCubeAssetPropertiesDef",properties:i.__assign({},n.default.properties,{mappingType:{type:"string",enum:["null","uv","environment"],description:"This value is temporarily here for compatibility with three.js. Remove it when adding a separate transform object to textures.",default:"environment"},textureUse:{type:"string",enum:["standard","sphericalReflection","sphereReflection","shadow","light","bumpNormal"],description:"Hints at the type of data that the texture contains.",default:"sphericalReflection"},mapping:{type:"string",default:"cubeReflection",description:"The mapping of the texture when applied to a material.",enum:["cubeReflection","cubeRefraction"]}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"sceneObject",title:"SceneObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["scene"]},properties:{$ref:"sceneObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"sceneObjectProperties",title:"SceneObjectPropertiesDef",properties:i.__assign({},n.default.properties,{fogEnabled:{type:"boolean",description:"Enable fog in the scene.",default:!1},fogColor:{$ref:"colorRgb.json",description:"The color of the fog in {r, g, b} form. Each channel is defined between 0.0 and 1.0.",default:{r:.5,g:.5,b:.5}},fogDensity:{type:"number",description:"The density of the fog. A higher number represents denser fog.",default:4e-4,minimum:0,maximum:1}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"scriptAsset",title:"ScriptAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["script"]},properties:{$ref:"scriptAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"scriptAssetProperties",title:"ScriptAssetPropertiesDef",properties:i.__assign({},n.default.properties,{attributes:{type:"object",description:"The attributes of the component instanced from this script.",default:{}},description:{type:"string",description:"A description of the script, including what it would be used for.",default:""},events:{type:"object",description:"The events exposed by this script.",default:{}},externalDependencies:{type:"array",description:"Array of external files that need to be loaded for this script to work.",default:[]},filter:{type:"array",description:"An array of entity types to filter what entities this script can apply to.",items:{type:"string"},default:[]},category:{type:"string",description:"The name of a category that this script belongs to. Used for organizing large numbers of scripts.",default:""},executeIn:{type:"string",description:"Controls whether the script will run only in the editor, only in the player or in both.",enum:["player","editor","all"],default:"player"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"shaderAsset",title:"ShaderAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["shader"]},properties:{$ref:"shaderAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"shaderAssetProperties",title:"ShaderAssetPropertiesDef",properties:i.__assign({},n.default.properties,{parameters:{type:"object",description:"Parameters for the shader.",default:{},additionalProperties:{$ref:"shaderParameter.json"}},uniforms:{description:"List of uniforms for the shader, in THREE.js format of all properties not defined as a parameter.",type:"object",default:{}},vertexShader:{type:"string",description:"The actual text of the vertex shader.",default:""},fragmentShader:{type:"string",description:"The actual text of the fragment/pixel shader.",default:""}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={type:"object",id:"shaderConditions",title:"ShaderConditionsDef",properties:{or:{type:"array",items:{type:"object",properties:{},additionalProperties:!0}},equals:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"object"}]},notEquals:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"object"}]},equalsDefault:{type:"boolean"},notEqualsDefault:{type:"boolean"}},additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={id:"shaderParameter",title:"ShaderParameterDef",properties:{displayName:{type:"string"},description:{type:"string"},isRenderParam:{type:"boolean"},isUniform:{type:"boolean"},uniformName:{type:"string"},type:{type:"string",enum:["b","c","f","t","opt","v2","v3","v4"]},min:{type:"number"},max:{type:"number"},options:{type:"object",properties:{},additionalProperties:!0},displayWhen:{properties:{},additionalProperties:{$ref:"shaderConditions.json"}},enabledWhen:{properties:{},additionalProperties:{$ref:"shaderConditions.json"}},defines:{properties:{},additionalProperties:{oneOf:[{type:"string"},{type:"number"},{type:"integer"},{type:"boolean"}]}},derivatives:{type:"boolean"},default:{anyOf:[{type:"null"},{type:"string"},{type:"number"},{type:"integer"},{type:"boolean"},{type:"object",properties:{},additionalProperties:!0}]},transparency:{enum:["LessThanOne","GreaterThanOne","NotFalsy","HasAlpha"]},textureUsage:{enum:["bump","normal"]},forceUpdate:{type:"boolean"},textureType:{enum:["Cube"]},step:{type:"number"}},additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"skinAsset",title:"SkinAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["skin"]},properties:{$ref:"skinAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"skinAssetProperties",title:"SkinAssetPropertiesDef",properties:i.__assign({},n.default.properties,{bindShapeMatrix:{type:"array",description:"Bind shape matrix specifying how the mesh should be transformed into the right coordinate system for use with the joints.",items:{type:"number"},minItems:16,maxItems:16,default:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},inverseBindMatrices:{type:["string","null"],description:"The ID of the accessor containing the inverse bind matrices: #."},jointNames:{type:"array",description:"Names of the joints in this skin.",items:{type:"string"},uniqueItems:!0,default:[]}}),required:["bindShapeMatrix","inverseBindMatrices","jointNames"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(31),a=i.__assign({},n.default,{id:"texture2DAsset",title:"Texture2DAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["texture2D"]},properties:{$ref:"texture2DAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(23),a=i.__assign({},n.default,{id:"texture2DAssetProperties",title:"Texture2DAssetPropertiesDef"});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(31),a=i.__assign({},n.default,{id:"textureCubeAsset",title:"TextureCubeAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["textureCube"]},properties:{$ref:"textureCubeAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(23),a=i.__assign({},n.default,{id:"textureCubeAssetProperties",title:"TextureCubeAssetPropertiesDef",properties:i.__assign({},n.default.properties,{mappingType:{type:"string",description:"This value is temporarily here for compatibility with three.js. Remove it when adding a separate transform object to textures.",default:"environment"},textureUse:{type:"string",enum:["standard","sphericalReflection","sphereReflection","shadow","light","bumpNormal"],description:"Hints at the type of data that the texture contains.",default:"sphericalReflection"},mapping:{type:"string",default:"cubeReflection",description:"The mapping of the texture when applied to a material.",enum:["cubeReflection","cubeRefraction"]}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"vector2",title:"Vector2Def",type:"object",properties:{x:{type:"number"},y:{type:"number"}},required:["x","y"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"vector3",title:"Vector3Def",type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"}},required:["x","y","z"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"vector4",title:"Vector4Def",type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"},w:{type:"number"}},required:["x","y","z","w"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"videoAsset",title:"VideoAssetDef",type:"object",properties:i.__assign({},n.default.properties,{type:{enum:["video"]},representations:i.__assign({},n.default.properties.representations,{type:{$ref:"videoRepresentation.json"}}),properties:{$ref:"videoAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(45),a=r(23),o=i.__assign({},n.default,a.default,{id:"videoAssetProperties",title:"VideoAssetPropertiesDef",properties:i.__assign({},n.default.properties,a.default.properties,{autoPlay:{type:"boolean",description:"Automatically play the video when loaded.",default:!0},muted:{type:"boolean",description:"Mute the audio of the video, if any.",default:!0},loop:{type:"boolean",description:"Controls whether the video restarts automatically when it reaches the end.",default:!0},querySelector:{type:"string",description:"Optional query selector string to load the video data from an HTML5 video tag."}})});t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(32),a=i.__assign({},n.default,{id:"videoRepresentation",title:"VideoRepresentationDef",properties:i.__assign({},n.default.properties,{video:{type:"object",properties:{height:{type:"integer"},width:{type:"integer"}}}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e;try{e=window.WebGLRenderingContext?document.createElement("canvas").getContext("experimental-webgl"):void 0}catch(e){}var t=!!e,r=!!t&&!!e.getExtension("OES_texture_float"),i=!!t&&!(0===e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS));return e=void 0,{isWebGLEnabled:function(){return t},isFloatingPointTexturesEnabeled:function(){return r},isVertexTexturesEnabeled:function(){return i}}}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=function(e){return"node"===e.type||"camera"===e.type||"scene"===e.type||"light"===e.type||"mesh"===e.type||"bone"===e.type},t.isAsset=function(e){return!t.isObject(e)}},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t,r){var i=r(254);e.exports=function(e,t,r){if(i(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,i){return e.call(t,r,i)};case 3:return function(r,i,n){return e.call(t,r,i,n)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var r=0,i=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++r+i).toString(36))}},function(e,t,r){var i=r(269)("wks"),n=r(200),a=r(34).Symbol,o="function"==typeof a;(e.exports=function(e){return i[e]||(i[e]=o&&a[e]||(o?a:n)("Symbol."+e))}).store=i},function(e,t){function r(e,t){var r=t||0,n=i;return n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]}for(var i=[],n=0;n<256;++n)i[n]=(n+256).toString(16).substr(1);e.exports=r},function(e,t,r){(function(t){var r,i=t.crypto||t.msCrypto;if(i&&i.getRandomValues){var n=new Uint8Array(16);r=function(){return i.getRandomValues(n),n}}if(!r){var a=new Array(16);r=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),a[t]=e>>>((3&t)<<3)&255;return a}}e.exports=r}).call(t,r(77))},function(e,t,r){function i(e){return r(n(e))}function n(e){var t=a[e];if(!(t+1))throw new Error("Cannot find module '"+e+"'.");return t}var a={"./accessor":125,"./accessor.ts":125,"./animationAsset":126,"./animationAsset.ts":126,"./animationAssetProperties":127,"./animationAssetProperties.ts":127,"./animationChannel":128,"./animationChannel.ts":128,"./animationClip":129,"./animationClip.ts":129,"./animationLayer":130,"./animationLayer.ts":130,"./applicationAsset":131,"./applicationAsset.ts":131,"./applicationAssetProperties":132,"./applicationAssetProperties.ts":132,"./audioAsset":133,"./audioAsset.ts":133,"./audioAssetProperties":134,"./audioAssetProperties.ts":134,"./audioRepresentation":135,"./audioRepresentation.ts":135,"./baseAsset":7,"./baseAsset.ts":7,"./baseAssetProperties":8,"./baseAssetProperties.ts":8,"./baseEntity":43,"./baseEntity.ts":43,"./baseEntityProperties":44,"./baseEntityProperties.ts":44,"./baseGeometryAsset":29,"./baseGeometryAsset.ts":29,"./baseGeometryAssetProperties":30,"./baseGeometryAssetProperties.ts":30,"./baseImageAsset":73,"./baseImageAsset.ts":73,"./baseImageAssetProperties":45,"./baseImageAssetProperties.ts":45,"./baseObject":16,"./baseObject.ts":16,"./baseObjectProperties":17,"./baseObjectProperties.ts":17,"./baseRenderTextureAsset":46,"./baseRenderTextureAsset.ts":46,"./baseRenderTextureAssetProperties":47,"./baseRenderTextureAssetProperties.ts":47,"./baseTextureAsset":31,"./baseTextureAsset.ts":31,"./baseTextureAssetProperties":23,"./baseTextureAssetProperties.ts":23,"./boneObject":136,"./boneObject.ts":136,"./boneObjectProperties":137,"./boneObjectProperties.ts":137,"./box3":138,"./box3.ts":138,"./bufferAsset":139,"./bufferAsset.ts":139,"./bufferAssetProperties":140,"./bufferAssetProperties.ts":140,"./cameraObject":141,"./cameraObject.ts":141,"./cameraObjectProperties":142,"./cameraObjectProperties.ts":142,"./colorRgb":143,"./colorRgb.ts":143,"./commonImageProperties":48,"./commonImageProperties.ts":48,"./component":144,"./component.ts":144,"./componentAttribute":145,"./componentAttribute.ts":145,"./documentAsset":146,"./documentAsset.ts":146,"./documentAssetProperties":147,"./documentAssetProperties.ts":147,"./dracoAttribute":148,"./dracoAttribute.ts":148,"./dracoGeometryAsset":149,"./dracoGeometryAsset.ts":149,"./dracoGeometryAssetProperties":150,"./dracoGeometryAssetProperties.ts":150,"./eventScope":151,"./eventScope.ts":151,"./imageAsset":152,"./imageAsset.ts":152,"./imageAssetProperties":153,"./imageAssetProperties.ts":153,"./imageRepresentation":154,"./imageRepresentation.ts":154,"./index":4,"./index.ts":4,"./lightObject":155,"./lightObject.ts":155,"./lightObjectProperties":156,"./lightObjectProperties.ts":156,"./materialAsset":157,"./materialAsset.ts":157,"./materialAssetProperties":158,"./materialAssetProperties.ts":158,"./meshAttribute":159,"./meshAttribute.ts":159,"./meshGeometryAsset":160,"./meshGeometryAsset.ts":160,"./meshGeometryAssetProperties":161,"./meshGeometryAssetProperties.ts":161,"./meshObject":162,"./meshObject.ts":162,"./meshObjectProperties":163,"./meshObjectProperties.ts":163,"./meshPrimitive":164,"./meshPrimitive.ts":164,"./nodeObject":165,"./nodeObject.ts":165,"./nodeObjectProperties":166,"./nodeObjectProperties.ts":166,"./prefabAsset":167,"./prefabAsset.ts":167,"./prefabAssetProperties":168,"./prefabAssetProperties.ts":168,"./primitiveGeometryAsset":169,"./primitiveGeometryAsset.ts":169,"./primitiveGeometryAssetProperties":170,"./primitiveGeometryAssetProperties.ts":170,"./renderTexture2DAsset":171,"./renderTexture2DAsset.ts":171,"./renderTexture2DAssetProperties":172,"./renderTexture2DAssetProperties.ts":172,"./renderTextureCubeAsset":173,"./renderTextureCubeAsset.ts":173,"./renderTextureCubeAssetProperties":174,"./renderTextureCubeAssetProperties.ts":174,"./representation":32,"./representation.ts":32,"./sceneObject":175,"./sceneObject.ts":175,"./sceneObjectProperties":176,"./sceneObjectProperties.ts":176,"./scriptAsset":177,"./scriptAsset.ts":177,"./scriptAssetProperties":178,"./scriptAssetProperties.ts":178,"./shaderAsset":179,"./shaderAsset.ts":179,"./shaderAssetProperties":180,"./shaderAssetProperties.ts":180,"./shaderConditions":181,"./shaderConditions.ts":181,"./shaderParameter":182,"./shaderParameter.ts":182,"./skinAsset":183,"./skinAsset.ts":183,"./skinAssetProperties":184,"./skinAssetProperties.ts":184,"./texture2DAsset":185,"./texture2DAsset.ts":185,"./texture2DAssetProperties":186,"./texture2DAssetProperties.ts":186,"./textureCubeAsset":187,"./textureCubeAsset.ts":187,"./textureCubeAssetProperties":188,"./textureCubeAssetProperties.ts":188,"./vector2":189,"./vector2.ts":189,"./vector3":190,"./vector3.ts":190,"./vector4":191,"./vector4.ts":191,"./videoAsset":192,"./videoAsset.ts":192,"./videoAssetProperties":193,"./videoAssetProperties.ts":193,"./videoRepresentation":194,"./videoRepresentation.ts":194};i.keys=function(){return Object.keys(a)},i.resolve=n,e.exports=i,i.id=204},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0);t.version="0.0.0-semantic-release";var n=r(1);t.THREE=n;var a=r(241);t.Components=a;var o=r(122);t.Constants=o;var s=r(4);t.Schemas=s.default;var u=r(123);t.Engine=u.default;var p=r(79);t.ScriptRegistry=p.default;var c=r(9);t.BaseEntity=c.default;var h=r(52);t.AnimationAsset=h.default;var l=r(35);t.ApplicationAsset=l.default;var d=r(53);t.AudioAsset=d.default;var f=r(6);t.BaseAsset=f.default;var m=r(24);t.BaseGeometryAsset=m.default;var y=r(12);t.BaseImageAsset=y.default;var g=r(54);t.BaseRenderTextureAsset=g.default;var v=r(20);t.BaseTextureAsset=v.default;var b=r(21);t.BufferAsset=b.default;var x=r(78);t.DocumentAsset=x.default;var P=r(55);t.DracoGeometryAsset=P.default;var w=r(56);t.ImageAsset=w.default;var E=r(14);t.MaterialAsset=E.default;var T=r(57);t.MeshGeometryAsset=T.default;var S=r(58);t.PrefabAsset=S.default;var D=r(59);t.PrimitiveGeometryAsset=D.default;var _=r(60);t.RenderTexture2DAsset=_.default;var M=r(61);t.RenderTextureCubeAsset=M.default;var A=r(62);t.ScriptAsset=A.default;var C=r(36);t.ShaderAsset=C.default;var R=r(63);t.SkinAsset=R.default;var O=r(64);t.Texture2DAsset=O.default;var j=r(65);t.TextureCubeAsset=j.default;var I=r(25);t.VideoAsset=I.default;var k=r(10);t.BaseObject=k.default;var L=r(71);t.NodeObject=L.default;var B=r(69);t.BoneObject=B.default;var z=r(70);t.CameraObject=z.default;var N=r(41);t.LightObject=N.default;var V=r(22);t.MeshObject=V.default;var U=r(42);t.SceneObject=U.default;var F=r(15);t.LoadingType=F.default;var G=r(11);t.LoadingEvent=G.default;var q=r(72);t.LoadingState=q.default;var $=r(2);t.BaseComponent=$.default;var H=r(66);t.Handedness=H.Handedness;var W=r(67);t.RenderMode=W.RenderMode;var Q=r(3);t.log=Q.default;var X=r(232);t.XhrResourceLoader=X.default,i.__exportStar(r(18),t);var Z=r(50);t.globalEvents=Z.default;var Y=r(195);t.browserCaps=Y.default},function(e,t,r){r(274),e.exports=r(33).Array.find},function(e,t,r){r(275),e.exports=r(33).Math.log10},function(e,t,r){r(276),e.exports=r(33).Math.log2},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n=function(){function e(){var e=this;this.defaultGeometry=new i.BufferGeometry,this.defaultGeometry.setIndex(new i.BufferAttribute(new Uint16Array(0),1));var t={position:new i.BufferAttribute(new Float32Array(0),3),normal:new i.BufferAttribute(new Float32Array(0),3,!0),skinWeight:new i.BufferAttribute(new Float32Array(0),4,!0),skinIndex:new i.BufferAttribute(new Uint16Array(0),4,!0)};Object.keys(t).forEach(function(r){var i=t[r];e.defaultGeometry.addAttribute(r,i)})}return e.prototype.destroy=function(){this.defaultGeometry&&(this.defaultGeometry.dispose(),this.defaultGeometry=void 0)},e.prototype.getDefaultGeometry=function(){return this.defaultGeometry},e}();t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n=r(5),a=function(){function e(){this.components=[]}return e.prototype.initializeComponents=function(){this.listenTo(this.engine,"scriptDeleted",this.onScriptDeleted),this.listenTo(this,"change:component",this.onComponentChanged),this.listenTo(this,"remove:component",this.onComponentRemoved),this.listenTo(this,"add:component",this.onComponentAdded)},e.prototype.getComponentDescriptor=function(e){var t="function"!=typeof e,r=this.sharedData.components;return n.deepClone(r.find(function(r){return t||e(r)}))},e.prototype.getPreviousComponentDescriptor=function(e){var t="function"!=typeof e,r=this.sharedData.previousComponents;return n.deepClone(r.find(function(r){return t||e(r)}))},e.prototype.getComponentDescriptors=function(e){var t="function"!=typeof e;return this.sharedData.components.filter(function(r){return t||e(r)}).map(function(e){return n.deepClone(e)})},e.prototype.getComponentDescriptorById=function(e){return this.getComponentDescriptor(function(t){return t.id===e})},e.prototype.getPreviousComponentDescriptorById=function(e){return this.getPreviousComponentDescriptor(function(t){return t.id===e})},e.prototype.addComponent=function(e,t,r){void 0===t&&(t={}),void 0===r&&(r="");var i={scriptId:"string"==typeof e?e:e.id,attributes:t,enabled:!0,name:r};return this.engine.entityDispatcher.dispatchComponentAdded(this.id,i),this.components[this.components.length-1]},e.prototype.removeComponent=function(e){var t=e.getIndex();return t>=0&&(this.engine.entityDispatcher.dispatchComponentRemoved(this.id,t),!0)},e.prototype.getComponentByIndex=function(e){return this.components[e]||null},e.prototype.getComponentByName=function(e){return this.getComponent(function(t){return t.getName()===e})},e.prototype.getComponentsByName=function(e){return this.getComponents(function(t){return t.getName()===e})},e.prototype.getComponentByScriptId=function(e){return this.getComponent(function(t){return t.getScriptId()===e})},e.prototype.getComponentsByScriptId=function(e){return this.getComponents(function(t){return t.getScriptId()===e})},e.prototype.getComponentByScriptName=function(e){return this.getComponent(function(t){return t.getScriptName()===e})},e.prototype.getComponentsByScriptName=function(e){return this.getComponents(function(t){return t.getScriptName()===e})},e.prototype.getComponent=function(e){var t="function"!=typeof e;return this.components.find(function(r){return t||e(r)})},e.prototype.getComponentById=function(e){return this.getComponent(function(t){return t.getId()===e})},e.prototype.getComponents=function(e){var t="function"!=typeof e;return this.components.filter(function(r){return t||e(r)})},e.prototype.setComponents=function(e,t){var r=this;void 0===t&&(t=!1);for(var i=this.engine.entityDispatcher,n=this.sharedData.components.length;n>=0;n--)i.dispatchComponentRemoved(this.id,n);e.forEach(function(e){i.dispatchComponentAdded(r.id,e)})},e.prototype.startComponents=function(){var e=this;this.components.forEach(function(t){return e.startComponent(t)})},e.prototype.stopComponents=function(){var e=this;this.components.forEach(function(t){return e.stopComponent(t)})},e.prototype.onScriptDeleted=function(e){var t=this;this.getComponentsByScriptId(e).forEach(function(e){t.removeComponent(e)})},e.prototype.onComponentChanged=function(e,t){var r=this.getComponentByIndex(e);if(!r)throw new Error("Don't have a component at index "+e);if(t.attributes){this.assignAttributeValues(r,t.attributes);var i=Object.keys(t.attributes);r.trigger("attributesChanged",i)}void 0!==t.name&&(r.name=t.name)},e.prototype.onComponentAdded=function(e){var t=this,r=this.createComponentObject(e);r.trigger("awake"),this.assignAttributeValues(r);var i=r.getScriptAsset(),n=i.getProperty("executeIn"),a=i.getProperty("events");Object.keys(a).forEach(function(e){t.registerEvent(e,a[e],n)});var o=Object.keys(i.getProperty("attributes"));r.trigger("attributesChanged",o),this.isBaseUnloaded()||this.startComponent(r)},e.prototype.onComponentRemoved=function(e){var t=this,r=this.components[e];if(!r)throw new Error("Can't find component at index "+e+" to remove.");var i=r.getScriptAsset(),n=i.getProperty("events");Object.keys(n).forEach(function(e){t.unregisterEvent(e,n[e])}),this.stopComponent(r),this.components.splice(e,1)},e.prototype.translateAttributeValue=function(e,t,r,n){var a=this,o=this.engine;if(!r)throw new Error("Attribute "+t+" does not exist for this component.");switch(r.type){case"asset":e[t]=o.getAssetById(n);break;case"object":e[t]=o.getObjectById(n);break;case"custom":e[t]=e[t]||{},Object.keys(n).forEach(function(i){a.translateAttributeValue(e[t],i,r.attributes[i],n[i])});break;case"c":e[t]=e[t]||new i.Color,e[t].setRGB(n.r,n.g,n.b);break;case"a":e[t]=e[t]||[];var s;switch(r.subType.type){case"asset":n.forEach(function(r,i){e[t][i]=o.getAssetById(r)});break;case"object":n.forEach(function(r,i){e[t][i]=o.getObjectById(r)});break;case"custom":n.forEach(function(i,o){e[t][o]=e[t][o]||{},Object.keys(i).forEach(function(i){a.translateAttributeValue(e[t][o],i,r.subType.attributes[i],n[o][i])})});break;case"a":n.forEach(function(i,o){e[t][o]=e[t][o]||[],i.forEach(function(i,s){a.translateAttributeValue(e[t][o],s.toString(10),r.subType.subType,n[o][s])})});break;case"v2":s=i.Vector2;case"v3":s=s||i.Vector3;case"v4":s=s||i.Vector4;case"q":s=s||i.Quaternion,n.forEach(function(r,i){e[t][i]=e[t][i]||new s,e[t][i].copy(r)});break;default:n.forEach(function(r,i){e[t][i]=r})}break;case"v2":s=i.Vector2;case"v3":s=s||i.Vector3;case"v4":s=s||i.Vector4;case"q":s=s||i.Quaternion,e[t]=e[t]||new s,e[t].copy(n);break;default:e[t]=n}},e.prototype.assignAttributeValues=function(e,t){var r=this,i="object"!=typeof t,n=e.getScriptAsset(),a=n.getProperty("attributes")||{};Object.keys(a).forEach(function(n){if(i||t.hasOwnProperty(n)){var o=a[n],s=e.getAttribute(o.name);r.translateAttributeValue(e,o.name,o,s)}})},e.prototype.createComponentObject=function(e){var t=e.scriptId,r=this.engine.getAssetById(t);if(!r)throw new Error("Unable to find script asset for "+t);r.isUnloaded()&&r.load();var i=new r.sharedData.classConstructor;return this.components.push(i),Object.assign(i,{id:e.id,name:e.name,scriptName:r.getName(),scriptId:t,enabled:!!e.enabled,entity:this}),i.bindSelfEvents(),i},e.prototype.startComponent=function(e){e.trigger("startup")},e.prototype.stopComponent=function(e){e.trigger("shutdown")},e}();t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(9),n=r(3),a=function(){function e(){this.ownDependencies={},this.dependencies={}}return e.prototype.getOwnDependencies=function(){var e=this;return Object.keys(this.ownDependencies).map(function(t){return e.engine.getEntityById(t)}).filter(function(e){return e})},e.prototype.getOwnDependencyInfo=function(){return this.ownDependencies},e.prototype.getDependencies=function(e){var t=this,r="function"!=typeof e;return Object.keys(this.dependencies).map(function(e){return t.engine.getEntityById(e)}).filter(function(t){return r||e(t)})},e.prototype.getDependenciesByClass=function(e){return this.getDependencies(function(t){return t instanceof e})},e.prototype.getDependenciesByType=function(e){return this.getDependencies(function(t){return t.type===e})},e.prototype.getDependencyInfo=function(){return this.dependencies},e.prototype.registerDependencyById=function(e){this.registerDependency(this.engine.getEntityById(e))},e.prototype.registerDependency=function(e){var t=this;if(!e)return void n.default.warn("Trying to register invalid entity as a dependency.");var r=this.getOwnDependencyInfo(),a=e.id;r[a]?r[a].count++:(r[a]={count:1},r[a].onSubDependencyChange=function(e,i){if(r[a])for(var n=0;n=r.components.length-1)){var i=Math.min(Math.max(t,0),r.components.length-1);i<0||(r.previousComponents=r.components?r.components.slice():[],r.components.splice(i,1),this.fireExternalUpdate(e,{components:r.components}),this.engines.forEach(function(t){t.getEntityById(e).trigger("remove:component",i)}))}},e.prototype.dispatchComponentAdded=function(e,t){var r=this.entities[e];if(r){r.previousComponents=r.components?r.components.slice():[];var i=a.deepClone(t);i.id=i.id||n.v4(),i.name=i.name||"",i.attributes=i.attributes||{},i.enabled=!1!==i.enabled,r.components.push(i),this.fireExternalUpdate(e,{components:r.components}),this.engines.forEach(function(t){t.getEntityById(e).trigger("add:component",i)})}},e.prototype.fireExternalUpdate=function(e,t,r){var i=new u.default;i.type=r||"updateEntity",i.entityId=e,i.entityData=t,o.default.trigger("EntityUpdates",i)},e}();t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(52),n=r(35),a=r(53),o=r(6),s=r(10),u=r(69),p=r(21),c=r(70),h=r(78),l=r(55),d=r(56),f=r(41),m=r(14),y=r(22),g=r(57),v=r(71),b=r(58),x=r(59),P=r(60),w=r(61),E=r(42),T=r(62),S=r(36),D=r(63),_=r(64),M=r(65),A=r(25),C=function(){function e(){this.objects={},this.assets={}}return e.prototype.destroy=function(){var e=this;this.getAssets().forEach(function(t){return e.unregisterEntity(t)}),this.getObjects().forEach(function(t){return e.unregisterEntity(t)})},e.prototype.getAsset=function(e){return this.getEntity(e,this.assets)},e.prototype.getAssets=function(e){return this.getEntities(e,this.assets)},e.prototype.getAssetById=function(e){return this.assets[e]||null},e.prototype.getAssetByName=function(e){return this.getAsset(function(t){return t.getName()===e})},e.prototype.getAssetsByName=function(e){return this.getAssets(function(t){return t.getName()===e})},e.prototype.getAssetByClass=function(e){return this.getAsset(function(t){return t instanceof e})},e.prototype.getAssetByType=function(e){return this.getAsset(function(t){return t.type===e})},e.prototype.getAssetsByClass=function(e){return this.getAssets(function(t){return t instanceof e})},e.prototype.getAssetsByType=function(e){return this.getAssets(function(t){return t.type===e})},e.prototype.getObject=function(e){return this.getEntity(e,this.objects)},e.prototype.getObjects=function(e){return this.getEntities(e,this.objects)},e.prototype.getObjectById=function(e){return this.objects[e]||null},e.prototype.getObjectByName=function(e){return this.getObject(function(t){return t.getName()===e})},e.prototype.getObjectsByName=function(e){return this.getObjects(function(t){return t.getName()===e})},e.prototype.getObjectByClass=function(e){return this.getObject(function(t){return t instanceof e})},e.prototype.getObjectByType=function(e){return this.getObject(function(t){return t.type===e})},e.prototype.getObjectsByType=function(e){return this.getObjects(function(t){return t.type===e})},e.prototype.getObjectsByClass=function(e){return this.getObjects(function(t){return t instanceof e})},e.prototype.getEntity=function(e,t){if(!t)return this.getAsset(e)||this.getObject(e);var r=Object.keys(t).find(function(r){return e(t[r])});return t[r]},e.prototype.getEntities=function(e,t){if(!t)return this.getObjects(e).concat(this.getAssets(e));var r="function"!=typeof e;return Object.keys(t).filter(function(i){return r||e(t[i])}).map(function(e){return t[e]})},e.prototype.getEntityById=function(e){return this.assets[e]||this.objects[e]||null},e.prototype.getEntityByClass=function(e){return this.getEntity(function(t){return t instanceof e})},e.prototype.getEntityByType=function(e){return this.getEntity(function(t){return t.type===e})},e.prototype.getEntitiesByClass=function(e){return this.getEntities(function(t){return t instanceof e})},e.prototype.getEntitiesByType=function(e){return this.getEntities(function(t){return t.type===e})},e.prototype.getEntityByName=function(e){return this.getEntity(function(t){return t.getName()===e})},e.prototype.getEntitiesByName=function(e){return this.getEntities(function(t){return t.getName()===e})},e.prototype.unregisterEntityById=function(e){this.unregisterEntity(this.getEntityById(e))},e.prototype.unregisterEntity=function(e){e&&(e.uninitialize(),this.objects[e.id]?delete this.objects[e.id]:(e.off("load",this.onAssetLoaded,this),e.off("unload",this.onAssetUnloaded,this),delete this.assets[e.id]))},e.prototype.getClassType=function(e){switch(e){case i.default:return"animation";case n.default:return"application";case a.default:return"audio";case u.default:return"bone";case p.default:return"buffer";case c.default:return"camera";case h.default:return"document";case l.default:return"dracoGeometry";case d.default:return"image";case f.default:return"light";case m.default:return"material";case y.default:return"mesh";case g.default:return"meshGeometry";case v.default:return"node";case b.default:return"prefab";case x.default:return"primitiveGeometry";case P.default:return"renderTexture2D";case w.default:return"renderTextureCube";case E.default:return"scene";case T.default:return"script";case S.default:return"shader";case D.default:return"skin";case _.default:return"texture2D";case M.default:return"textureCube";case A.default:return"video";default:return null}},e.prototype.getEntityClass=function(t){return e.entityNameTypeMap[t]?e.entityNameTypeMap[t]:"object"===t?s.default:"asset"===t?o.default:null},e.prototype.registerEntity=function(e){var t=new(this.getEntityClass(e.type))(e);t.engine=this,t instanceof o.default?(this.assets[t.id]=t,t.on("load",this.onAssetLoaded,this),t.on("unload",this.onAssetUnloaded,this)):this.objects[t.id]=t},e.prototype.onAssetLoaded=function(e){this.trigger("assetLoaded",e)},e.prototype.onAssetUnloaded=function(e){this.trigger("assetUnloaded",e)},e.entityNameTypeMap={animation:i.default,application:n.default,audio:a.default,bone:u.default,buffer:p.default,camera:c.default,document:h.default,dracoGeometry:l.default,image:d.default,light:f.default,material:m.default,mesh:y.default,meshGeometry:g.default,node:v.default,prefab:b.default,primitiveGeometry:x.default,renderTexture2D:P.default,renderTextureCube:w.default,scene:E.default,script:T.default,shader:S.default,skin:D.default,texture2D:_.default,textureCube:M.default,video:A.default},e}();t.default=C},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){this.type="updateEntity",this.entityId="",this.entityData={}}return e}();t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(9),a=function(){function e(){this.events={}}return e.prototype.registerEvent=function(e,t,r){var i={parameters:t.parameters||[],action:!!t.action,category:t.category,refCount:1,executeIn:r},n=this.getRegisteredEventsFromScope(t);n[e]?(n[e].refCount++,"runtime"!==r&&"all"!==r||(n[e].executeIn=r)):n[e]=i},e.prototype.unregisterEvent=function(e,t){var r=this.getRegisteredEventsFromScope(t);r[e]&&0===--r[e].refCount&&delete r[e]},e.prototype.getAvailableEvents=function(e){void 0===e&&(e="player");for(var t=i.__assign({},this.constructor.events,this.events),r=Object.getPrototypeOf(this);r;){if(r.constructor.hasOwnProperty("events")){var n={};for(var a in r.constructor.events){var o=r.constructor.events[a],s=o.executeIn||"runtime";("editor"===e&&"runtime"!==s||"player"===e&&"editor"!==s)&&(n[a]=o)}t=i.__assign({},t,n)}r=Object.getPrototypeOf(r)}return t},e.prototype.getRegisteredEventsFromScope=function(e){if("other"===e.scope){if(e.filter&&e.filter.length){return this.engine.getEntityClass(e.filter[0]).events}return n.default.events}return"local"===e.scope?this.events:this.engine.registeredGlobalEvents},e}();t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e}();t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(40),a=r(26),o={id:"fbx_surface_lambert_shader",type:"shader",properties:{name:"FBX Surface Lambert Shader",vertexShader:"MeshLambertMaterial",fragmentShader:"MeshLambertMaterial",parameters:i.__assign({},n.default,a.default)}};t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(40),a=r(68),o=r(26),s={id:"fbx_surface_phong_shader",type:"shader",properties:{name:"FBX Surface Phong Shader",vertexShader:"MeshPhongMaterial",fragmentShader:"MeshPhongMaterial",parameters:i.__assign({},n.default,{specular:{displayName:"Specular Color",description:"The color reflected specularly by the surface from lights",type:"c",default:{r:1,g:1,b:1},min:0,max:1,isRenderParam:!0,uniformName:"specular"},specularTexture:{displayName:"Specular Map",description:"The color reflected specularly by the surface from lights",type:"t",default:null,isRenderParam:!0,uniformName:"specularMap",enabledWhen:{specularTexture:{notEqualsDefault:!0}}},shininess:{displayName:"Shininess",description:"The shininess exponent of the surface. Higher is glossier.",type:"f",default:30,min:0,max:512,isRenderParam:!0,uniformName:"shininess"}},a.default,o.default)}};t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(14),n=r(20),a=function(){function e(e){this.engine=e,this.standInTextures=[],this.engine=e,this.engine.on("rebuildMaterials",this.rebuildAll,this),this.engine.on("rendererResize",this.onResize,this),this.engine.on("update",this.update,this),this.standInTextures[i.StandInTexture.STANDIN_TEXTURE_WHITE]={texture:null,color:[255,255,255]},this.standInTextures[i.StandInTexture.STANDIN_TEXTURE_WHITE_CUBE]={texture:null,color:[255,255,255],type:"Cube"},this.standInTextures[i.StandInTexture.STANDIN_TEXTURE_BLACK]={texture:null,color:[0,0,0]},this.standInTextures[i.StandInTexture.STANDIN_TEXTURE_BLACK_CUBE]={texture:null,color:[0,0,0],type:"Cube"},this.standInTextures[i.StandInTexture.STANDIN_TEXTURE_NORMAL]={texture:null,color:[127,127,255]}}return e.prototype.destroy=function(){this.engine.off("rebuildMaterials",this.rebuildAll,this),this.engine.off("rendererResize",this.onResize,this),this.engine.off("update",this.update,this),this.standInTextures.forEach(function(e){e.texture&&e.texture.dispose()})},e.prototype.getMissingMaterial=function(){return this.engine.getAssetById("missingMaterial")},e.prototype.getStandInTexture=function(e){if(!this.standInTextures[e])return null;if(!this.standInTextures[e].texture){var t=this.standInTextures[e].color;"Cube"===this.standInTextures[e].type?this.standInTextures[e].texture=n.default.createColorTextureCube(t[0],t[1],t[2]):this.standInTextures[e].texture=n.default.createColorTexture(t[0],t[1],t[2])}return this.standInTextures[e].texture},e.prototype.update=function(e){i.default.timeValueInUse&&(this.engine.needsRender=!0),i.default.sharedUniforms.time.value=e},e.prototype.rebuildAll=function(){this.engine.getAssetsByClass(i.default).forEach(function(e){e.runtimeData&&Object.keys(i.default.materialObjectTypes).forEach(function(t){e.runtimeData[t].needsUpdate=!0})})},e.prototype.onResize=function(){var e=i.default.sharedUniforms.screenDimensions;e.value.x=0,e.value.y=0;var t=this.engine.getRenderer();t?(e.value.z=t.getCanvasWidth(),e.value.w=t.getCanvasHeight()):(e.value.z=128,e.value.w=128)},e}();t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(124),o=r(223),s=r(68),u=r(40),p=r(26),c={id:"three_physical_shader",type:"shader",properties:{name:"Three.js Physical Shader",vertexShader:"MeshPhysicalMaterial",fragmentShader:"MeshPhysicalMaterial",parameters:i.__assign({},u.default,a.default,s.default,o.default,p.default),uniforms:n.UniformsUtils.merge([n.UniformsLib.envmap,n.UniformsLib.fog,n.UniformsLib.lights])}};t.default=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(124),o=r(68),s=r(40),u=r(26),p={id:"three_standard_shader",type:"shader",properties:{name:"Three.js Standard Shader",vertexShader:"MeshStandardMaterial",fragmentShader:"MeshStandardMaterial",parameters:i.__assign({},s.default,a.default,o.default,u.default),uniforms:n.UniformsUtils.merge([n.UniformsLib.envmap,n.UniformsLib.fog,n.UniformsLib.lights])}};t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={clearCoat:{displayName:"Clear Coat Amount",description:"The strength/thickness of the clear coat on top of the material.",type:"f",min:0,max:1,default:0,isRenderParam:!0},clearCoatRoughness:{displayName:"Clear Coat Roughness",description:"How rough the clear coat surface appears.",type:"f",min:0,max:1,default:0,isRenderParam:!0}};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(28),a=r(72),o=r(11),s=r(231),u=r(49);t.loadableResourceMixins=u.default({},[n.default]);var p=function(e){function t(t,r,i){void 0===i&&(i={});var n=e.call(this)||this;if(n.path=t,n.type=r,n.params=i,n.state=a.default.STARTING,n.error=void 0,n.data=void 0,n.loaderData={},!t)throw new Error("Missing required `path` argument");if(!r)throw new Error("Missing required `type` argument");return n}return i.__extends(t,e),t.prototype.setState=function(e){switch(e){case a.default.STARTING:throw new s.default(this.state,e);case a.default.LOADING:if(this.state!==a.default.STARTING&&this.state!==a.default.LOADING)throw new s.default(this.state,e);break;case a.default.PROCESSING:if(this.state!==a.default.LOADING)throw new s.default(this.state,e);break;case a.default.COMPLETE:if(this.state!==a.default.PROCESSING)throw new s.default(this.state,e);break;case a.default.CANCELLED:if(this.state!==a.default.STARTING&&this.state!==a.default.LOADING&&this.state!==a.default.PROCESSING)throw new s.default(this.state,e);break;case a.default.ERROR:break;default:throw new Error("Unknown state: "+e)}return this.state=e,this.trigger(o.default.STATE_CHANGE,e),e},t.prototype.setLoading=function(){this.setState(a.default.LOADING)},t.prototype.setProcessing=function(){this.setState(a.default.PROCESSING)},t.prototype.setComplete=function(e){this.setState(a.default.COMPLETE),this.data=e,this.trigger(o.default.LOAD,e),this.done()},t.prototype.setError=function(e){this.setState(a.default.ERROR),this.error=e,this.trigger(o.default.ERROR,e),this.done()},t.prototype.setCancelled=function(){this.setState(a.default.CANCELLED),this.trigger(o.default.CANCEL),this.done()},t.prototype.isCancelled=function(){return this.state===a.default.CANCELLED},t.prototype.done=function(){this.trigger(o.default.DONE,this.state),this.off()},t}(t.loadableResourceMixins);t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(27),n=function(e){return e.setProcessing(),e.setComplete(e.loaderData.xhr.response),Promise.resolve(e)};t.default=function(e,t){return i.retry(function(e){return 202===e.loaderData.xhr.status},[i.unlessCancelled(i.makeXhr(t)),i.unlessCancelled(i.setResponseType("arraybuffer")),i.unlessCancelled(i.setCustomHeaders),i.unlessCancelled(i.loadXhr)])(e).then(i.unlessCancelled(i.requireStatus(function(e){return 200===e}))).then(i.unlessCancelled(n)).catch(i.handleError(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(249),n=r(196),a=r(27),o=function(e){e.setProcessing();var t="string"==typeof e.loaderData.xhr.response?JSON.parse(e.loaderData.xhr.response):e.loaderData.xhr.response,r=e.path.indexOf("?"),a=r>=0?r:e.path.length,o=e.path.slice(0,e.path.lastIndexOf("/",a)+1);if(void 0===t||void 0===t.version||t.version.major>4)return Promise.reject(new Error("Unsupported data version"));var s=new RegExp(/^(?:[a-z]+:)?\/\//i),u=new RegExp(/^\//),p=function(e){return!e.match(s)&&!e.match(u)},c=i.mapEntities(t.entities,t.version);return c.forEach(function(e){if(n.isAsset(e)&&e.representations&&e.representations.forEach(function(e){e.src&&p(e.src)&&(e.src=o+e.src)}),"buffer"===e.type){var t=e.properties;t.src&&p(t.src)&&(t.src=o+t.src)}}),e.setComplete(c),Promise.resolve(e)};t.default=function(e,t){return a.retry(function(e){return 202===e.loaderData.xhr.status},[a.unlessCancelled(a.makeXhr(t)),a.unlessCancelled(a.setResponseType("json")),a.unlessCancelled(a.setCustomHeaders),a.unlessCancelled(a.loadXhr)])(e).then(a.unlessCancelled(a.requireStatus(function(e){return 200===e}))).then(a.unlessCancelled(o)).catch(a.handleError(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(27),n=function(e){return new Promise(function(t){if(e.setProcessing(),e.loaderData.xhr.response instanceof Blob){var r=URL.createObjectURL(e.loaderData.xhr.response),i=new Image;i.onload=function(){e.setComplete(i),t(e)},i.src=r}else e.setComplete(e.loaderData.xhr.response),t(e)})};t.default=function(e,t){return i.retry(function(e){return 202===e.loaderData.xhr.status},[i.unlessCancelled(i.makeXhr(t)),i.unlessCancelled(i.setResponseType("blob")),i.unlessCancelled(i.setCustomHeaders),i.unlessCancelled(i.loadXhr)])(e).then(i.unlessCancelled(i.requireStatus(function(e){return 200===e}))).then(i.unlessCancelled(n)).catch(i.handleError(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(27),n=function(e){e.setProcessing();var t="string"==typeof e.loaderData.xhr.response?JSON.parse(e.loaderData.xhr.response):e.loaderData.xhr.response;return e.setComplete(t),Promise.resolve(e)};t.default=function(e,t){return i.retry(function(e){return 202===e.loaderData.xhr.status},[i.unlessCancelled(i.makeXhr(t)),i.unlessCancelled(i.setResponseType("json")),i.unlessCancelled(i.setCustomHeaders),i.unlessCancelled(i.loadXhr)])(e).then(i.unlessCancelled(i.requireStatus(function(e){return 200===e}))).then(i.unlessCancelled(n)).catch(i.handleError(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(27),n=function(e){return new Promise(function(t,r){e.setProcessing();var i=URL.createObjectURL(e.loaderData.xhr.response),n=document.createElement("video");n.addEventListener("loadeddata",function(){e.setComplete(n),t(e)}),n.addEventListener("error",function(){return r(new Error("Failed to load video"))}),n.src=i,n.load()})};t.default=function(e,t){return i.retry(function(e){return 202===e.loaderData.xhr.status},[i.unlessCancelled(i.makeXhr(t)),i.unlessCancelled(i.setResponseType("blob")),i.unlessCancelled(i.setCustomHeaders),i.unlessCancelled(i.loadXhr)])(e).then(i.unlessCancelled(i.requireStatus(function(e){return 200===e}))).then(i.unlessCancelled(n)).catch(i.handleError(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(3),n=r(11),a=r(9),o=function(){function e(){this.loadingResources=[]}return e.prototype.loadResource=function(e,t,r,o){var s=this;void 0===o&&(o={});var u=this.engine.resourceLoader.load(e,t,o);return this.loadingResources.push(u),u.on(n.default.ERROR,function(e){i.default.error(s.engine.getName()+" - ResourceLifecycle: Error loading "+s.type+","+s.getName()+", "+e.toString()),s.setState(a.StateType.Base,a.State.Failed)}),u.on(n.default.DONE,function(){s.loadingResources=s.loadingResources.filter(function(e){return e!==u}),"function"==typeof r&&r()}),u},e.prototype.abortRequests=function(){this.loadingResources.forEach(function(e){return e.setCancelled()})},e}();t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(72),a=function(e){function t(t,r){var i=e.call(this,'Illegal state transition "'+n.default[t]+'" -> "'+n.default[r]+'"')||this;return i.from=t,i.to=r,i}return i.__extends(t,e),t}(Error);t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(224),n=r(240),a=r(225),o=r(227),s=r(228),u=r(229),p=r(226),c=r(11),h=r(15),l=4,d=function(e,t){var r=new XMLHttpRequest;return r.open("GET",e),Promise.resolve(r)},f=[];f[h.default.BUFFER]=a.default,f[h.default.IMAGE]=o.default,f[h.default.VIDEO]=u.default,f[h.default.ENTITIES]=p.default,f[h.default.JSON]=s.default;var m=function(){function e(e,t){if(void 0===e&&(e=d),void 0===t&&(t=f),this.xhrPromise=e,this.strategies=t,this.resources={},!e)throw new Error("Must provide argument `xhrPromise`!");if(!t)throw new Error("Must provide argument `strategies`!");this.queue=n.default(l)}return e.prototype.destroy=function(){this.queue.destroy()},e.prototype.load=function(e,t,r){var n=this;if(!this.strategies[t])throw new Error("Unsupported type: "+t);if(this.resources[e])return this.resources[e];var a=this.resources[e]=new i.default(e,t,r);return this.queue.add(function(){return new Promise(function(r){var i=function(){delete n.resources[e],a.off(c.default.LOAD,i),a.off(c.default.ERROR,i),a.off(c.default.CANCEL,i),r(a)};a.once(c.default.LOAD,i),a.once(c.default.ERROR,i),a.once(c.default.CANCEL,i),n.strategies[t](a,n.xhrPromise)})},r.priority),a},e}();t.default=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = opacity * texel;","}"].join("\n")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n=function(){function e(e){this.cubeLods=e;var t=4*e[0].width;this.camera=new i.OrthographicCamera(.5*-t,.5*t,.5*-t,.5*t,0,1e3),this.scene=new i.Scene,this.scene.add(this.camera),this.objects=[];var r=[];r.push(new i.Vector2(0,0)),r.push(new i.Vector2(1,0)),r.push(new i.Vector2(2,0)),r.push(new i.Vector2(0,1)),r.push(new i.Vector2(1,1)),r.push(new i.Vector2(2,1));var n=t;t=e[0].width;var a=0,o=4;this.numLods=Math.log(e[0].width)/Math.log(2)-2;for(var s=0;s16&&(o*=2);for(var p=t>16?6:1,c=0,h=0,l=t,d=0;d16&&(t/=2)}}return e.prototype.setDestinationTexture=function(e){var t=this.cubeLods[0].width;this.CubeUVRenderTarget=e,this.CubeUVRenderTarget.setSize(t,t),this.CubeUVRenderTarget.texture.name="PMREMCubeUVPacker.cubeUv"},e.prototype.dispose=function(){this.cubeLods.forEach(function(e){e.dispose()}),this.cubeLods=[]},e.prototype.update=function(e){var t=e.gammaInput,r=e.gammaOutput,n=e.toneMapping,a=e.toneMappingExposure;e.gammaInput=!1,e.gammaOutput=!1,e.toneMapping=i.LinearToneMapping,e.toneMappingExposure=1,e.render(this.scene,this.camera,this.CubeUVRenderTarget,!1),e.toneMapping=n,e.toneMappingExposure=a,e.gammaInput=t,e.gammaOutput=r},e.prototype.getShader=function(){return new i.ShaderMaterial({uniforms:{faceIndex:{value:0},mapSize:{value:0},envMap:{value:null},testColor:{value:new i.Vector3(1,1,1)}},vertexShader:"precision highp float; varying vec2 vUv; void main() { vUv = uv; gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); }",fragmentShader:"precision highp float; varying vec2 vUv; uniform samplerCube envMap; uniform float mapSize; uniform vec3 testColor; uniform int faceIndex; void main() { vec3 sampleDirection; vec2 uv = vUv; uv = uv * 2.0 - 1.0; uv.y *= -1.0; if(faceIndex == 0) { sampleDirection = normalize(vec3(1.0, uv.y, -uv.x)); } else if(faceIndex == 1) { sampleDirection = normalize(vec3(uv.x, 1.0, uv.y)); } else if(faceIndex == 2) { sampleDirection = normalize(vec3(uv.x, uv.y, 1.0)); } else if(faceIndex == 3) { sampleDirection = normalize(vec3(-1.0, uv.y, uv.x)); } else if(faceIndex == 4) { sampleDirection = normalize(vec3(uv.x, -1.0, -uv.y)); } else { sampleDirection = normalize(vec3(-uv.x, uv.y, -1.0)); } vec4 color = envMapTexelToLinear( textureCube( envMap, sampleDirection ) ); gl_FragColor = linearToOutputTexel( color ); }",blending:i.CustomBlending,premultipliedAlpha:!1,blendSrc:i.OneFactor,blendDst:i.ZeroFactor,blendSrcAlpha:i.OneFactor,blendDstAlpha:i.ZeroFactor,blendEquation:i.AddEquation})},e}();t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n=function(){function e(e,t){void 0===t&&(t=32),this.sourceTexture=e,this.resolution=256,this.samplesPerLevel=t;var r=e.encoding===i.LinearEncoding||e.encoding===i.GammaEncoding||e.encoding===i.sRGBEncoding;this.sourceTexture.minFilter=r?i.LinearFilter:i.NearestFilter,this.sourceTexture.magFilter=r?i.LinearFilter:i.NearestFilter,this.sourceTexture.generateMipmaps=!1,this.cubeLods=[];var n=this.resolution,a={format:this.sourceTexture.format,magFilter:this.sourceTexture.magFilter,minFilter:this.sourceTexture.minFilter,type:this.sourceTexture.type,generateMipmaps:this.sourceTexture.generateMipmaps,anisotropy:this.sourceTexture.anisotropy,encoding:this.sourceTexture.encoding};this.numLods=Math.log(n)/Math.log(2)-2;for(var o=0;o\n varying vec2 vUv;\n uniform int faceIndex;\n uniform float roughness;\n uniform samplerCube envMap;\n uniform float mapSize;\n uniform vec3 testColor;\n uniform vec3 queryScale;\n \n float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n float a = ggxRoughness + 0.0001;\n a *= a;\n return ( 2.0 / a - 2.0 );\n }\n vec3 ImportanceSamplePhong(vec2 uv, mat3 vecSpace, float specPow) {\n float phi = uv.y * 2.0 * PI;\n float cosTheta = pow(1.0 - uv.x, 1.0 / (specPow + 1.0));\n float sinTheta = sqrt(1.0 - cosTheta * cosTheta);\n vec3 sampleDir = vec3(cos(phi) * sinTheta, sin(phi) * sinTheta, cosTheta);\n return vecSpace * sampleDir;\n }\n vec3 ImportanceSampleGGX( vec2 uv, mat3 vecSpace, float Roughness )\n {\n float a = Roughness * Roughness;\n float Phi = 2.0 * PI * uv.x;\n float CosTheta = sqrt( (1.0 - uv.y) / ( 1.0 + (a*a - 1.0) * uv.y ) );\n float SinTheta = sqrt( 1.0 - CosTheta * CosTheta );\n return vecSpace * vec3(SinTheta * cos( Phi ), SinTheta * sin( Phi ), CosTheta);\n }\n mat3 matrixFromVector(vec3 n) {\n float a = 1.0 / (1.0 + n.z);\n float b = -n.x * n.y * a;\n vec3 b1 = vec3(1.0 - n.x * n.x * a, b, -n.x);\n vec3 b2 = vec3(b, 1.0 - n.y * n.y * a, -n.y);\n return mat3(b1, b2, n);\n }\n \n vec4 testColorMap(float Roughness) {\n vec4 color;\n if(faceIndex == 0)\n color = vec4(1.0,0.0,0.0,1.0);\n else if(faceIndex == 1)\n color = vec4(0.0,1.0,0.0,1.0);\n else if(faceIndex == 2)\n color = vec4(0.0,0.0,1.0,1.0);\n else if(faceIndex == 3)\n color = vec4(1.0,1.0,0.0,1.0);\n else if(faceIndex == 4)\n color = vec4(0.0,1.0,1.0,1.0);\n else\n color = vec4(1.0,0.0,1.0,1.0);\n color *= ( 1.0 - Roughness );\n return color;\n }\n void main() {\n vec3 sampleDirection;\n vec2 uv = vUv*2.0 - 1.0;\n float offset = -1.0/mapSize;\n const float a = -1.0;\n const float b = 1.0;\n float c = -1.0 + offset;\n float d = 1.0 - offset;\n float bminusa = b - a;\n uv.x = (uv.x - a)/bminusa * d - (uv.x - b)/bminusa * c;\n uv.y = (uv.y - a)/bminusa * d - (uv.y - b)/bminusa * c;\n if (faceIndex==0) {\n sampleDirection = vec3(1.0, -uv.y, -uv.x);\n } else if (faceIndex==1) {\n sampleDirection = vec3(-1.0, -uv.y, uv.x);\n } else if (faceIndex==2) {\n sampleDirection = vec3(uv.x, 1.0, uv.y);\n } else if (faceIndex==3) {\n sampleDirection = vec3(uv.x, -1.0, -uv.y);\n } else if (faceIndex==4) {\n sampleDirection = vec3(uv.x, -uv.y, 1.0);\n } else {\n sampleDirection = vec3(-uv.x, -uv.y, -1.0);\n }\n mat3 vecSpace = matrixFromVector(normalize(sampleDirection * queryScale));\n vec3 rgbColor = vec3(0.0);\n const int NumSamples = SAMPLES_PER_LEVEL;\n vec3 vect;\n float weight = 0.0;\n for( int i = 0; i < NumSamples; i ++ ) {\n float sini = sin(float(i));\n float cosi = cos(float(i));\n float r = rand(vec2(sini, cosi));\n vect = ImportanceSampleGGX(vec2(float(i) / float(NumSamples), r), vecSpace, roughness);\n float dotProd = dot(vect, normalize(sampleDirection));\n weight += dotProd;\n vec3 color = envMapTexelToLinear(textureCube(envMap,vect)).rgb;\n rgbColor.rgb += color;\n }\n rgbColor /= float(NumSamples);\n //rgbColor = testColorMap( roughness ).rgb;\n gl_FragColor = linearToOutputTexel( vec4( rgbColor, 1.0 ) );\n }",blending:i.CustomBlending,blendSrc:i.OneFactor,blendDst:i.ZeroFactor,blendSrcAlpha:i.OneFactor,blendDstAlpha:i.ZeroFactor,blendEquation:i.AddEquation})},e}();t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n=function(){function e(e,t){void 0===t&&(t="tDiffuse"),this.enabled=!0,this.needsSwap=!0,this.renderToScreen=!1,this.clear=!1,this.textureId=t,this.uniforms=i.UniformsUtils.clone(e.uniforms),this.material=new i.ShaderMaterial({blending:i.NormalBlending,transparent:!0,uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader}),this.camera=new i.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new i.Scene,this.quad=new i.Mesh(new i.PlaneGeometry(2,2),null),this.scene.add(this.quad),this.prevViewPort=new i.Vector4}return e.prototype.render=function(e,t,r){this.uniforms[this.textureId]&&(this.uniforms[this.textureId].value=r),this.quad.material=this.material,this.renderToScreen?(this.viewPort&&e.setViewport(this.viewPort.x,this.viewPort.y,this.viewPort.width,this.viewPort.height),(this.clearColor||this.clearDepth)&&e.clear(!!this.clearColor,!!this.clearDepth,!1),e.render(this.scene,this.camera)):e.render(this.scene,this.camera,t,this.clear)},e.prototype.dispose=function(){this.quad.geometry.dispose(),this.quad=void 0,this.camera=void 0,this.scene=void 0,this.material.dispose(),this.material=void 0,this.uniforms=void 0},e}();t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={uniforms:{tDiffuse:{type:"t",value:null},rgbmMultiplier:{type:"f",value:9}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","#ifdef FLIP_Y","vUv.y = 1.0 - vUv.y;","#endif","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float rgbmMultiplier;","const mat3 InverseLogLuvMatrix = mat3(","6.0014, -2.7008, -1.7996,","-1.3320, 3.1029, -5.7721,","0.3008, -1.0882, 5.6268);","vec3 HDRDecodeLOGLUV(in vec4 vLogLuv)","{","float Le = vLogLuv.z * 255.0 + vLogLuv.w;","vec3 Xp_Y_XYZp;","Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);","Xp_Y_XYZp.z = Xp_Y_XYZp.y / vLogLuv.y;","Xp_Y_XYZp.x = vLogLuv.x * Xp_Y_XYZp.z;","vec3 vRGB = InverseLogLuvMatrix * Xp_Y_XYZp;","return vRGB;","}","vec3 HDRDecodeRGBM( vec4 rgbm ) {","return rgbmMultiplier * rgbm.rgb * rgbm.a;","}","vec3 HDRDecodeRGBD( vec4 rgbd ) {","return rgbd.rgb / max(rgbd.a, 0.003);","}","vec3 HDRDecodeRGBE( vec4 rgbe ) {","float f = exp2( rgbe.w * 255.0 - (128.0 + 0.0) );","return rgbe.rgb * f;","}","varying vec2 vUv;","void main() {","vec3 hdrColour;","#ifdef HDR_RGBM","hdrColour = HDRDecodeRGBM( texture2D( tDiffuse, vUv ) );","#elif defined(HDR_RGBD)","hdrColour = HDRDecodeRGBD( texture2D( tDiffuse, vUv ) );","#elif defined(HDR_RGBE)","hdrColour = HDRDecodeRGBE( texture2D( tDiffuse, vUv ) );","#elif defined(HDR_LOGLUV)","hdrColour = HDRDecodeLOGLUV( texture2D( tDiffuse, vUv ) );","#else","hdrColour = texture2D( tDiffuse, vUv ).xyz;","#endif","gl_FragColor = vec4( hdrColour, 1.0 );","}"].join("\n")}},function(e,t,r){"use strict";function i(e){return e.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z])([a-z])/,"$1_$2$3").toUpperCase()}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t="string"==typeof e?e:"";return t=t.replace(/_([a-z])/gi,function(e,t){return"_"+t.toUpperCase()}),t=t.replace(/\s+/g,"_"),t=t.replace(/([a-z])([0-9])/g,"$1_$2"),t=i(t)}},function(e,t,r){"use strict";function i(e,t){return e.id+"#"+t.id}function n(e){var t={};return t[e.id]=0,e.getChildren().forEach(function(r){var i=n(r);Object.assign(t,i),t[e.id]=Math.max(t[e.id],i[r.id]+1)}),t}function a(e,t,r){var n={};n[e.id]=t.id;var o=e.getChildren(),s=t.getChildren();return r[i(e,t)].children.forEach(function(e,t){var i=a(o[t],s[e],r);Object.assign(n,i)}),n}function o(e,t){var r=n(e),i=n(t),a=e.getDescendants();a.push(e);var o=t.getDescendants();o.push(t);for(var s=p.groupBy(a,function(e){return r[e.id]}),u=p.groupBy(o,function(e){return i[e.id]}),h=r[e.id],l=i[t.id],d=new c,f=0;f<=h;++f)for(var m=s[f],y=f;y<=l;++y)(function(e){var t=u[e];m.forEach(function(e){t.forEach(function(t){d.push({sourceNode:e,targetNode:t})})})})(y);return d}function s(e,t){for(var r={};!e.isEmpty();){var n=e.pop(),a=n.sourceNode,o=n.targetNode,s={included:!1,children:[]};if(r[i(a,o)]=s,t(a,o)){for(var u=a.getChildren(),p=o.getChildren(),c=0,h=0;h0&&i.length=0&&(i.splice(t,1),a())})})()},o=function(e,t){return t.priority-e.priority};return{add:function(e,i){if(void 0===i&&(i=t),i<0)throw new Error("Invalid priority "+i);if(!n)throw new Error("Queue is not running, cannot accept new promises");r.push({fn:e,priority:i}),r.sort(o),setTimeout(a(),0)},destroy:function(){n=!1,i.splice(0,i.length),r.splice(0,r.length)}}};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(80);t.AlignToPosition=i.default;var n=r(81);t.Animation=n.default;var a=r(82);t.AudioListener=a.default;var o=r(83);t.AudioSource=o.default;var s=r(84);t.AxisRotation=s.default;var u=r(85);t.BoundingBoxRenderer=u.default;var p=r(86);t.CameraZoom=p.default;var c=r(87);t.CubeMapCapture=c.default;var h=r(88);t.Curve=h.default;var l=r(89);t.DebugConsoleDisplay=l.default;var d=r(90);t.DebugPerformance=d.default;var f=r(91);t.DebugTextureViewer=f.default;var m=r(92);t.DynamicOptimizer=m.default;var y=r(93);t.EventHandler=y.default;var g=r(94);t.Exploder=g.default;var v=r(95);t.Fullscreen=v.default;var b=r(96);t.GamepadAnimator=b.default;var x=r(37);t.GamepadDevice=x.default;var P=r(97);t.GamepadInput=P.default;var w=r(98);t.Input=w.default;var E=r(99);t.IntersectionChecker=E.default;var T=r(100);t.LightEnvironment=T.default;var S=r(101);t.LookAtTarget=S.default;var D=r(102);t.MaterialCapture=D.default;var _=r(66);t.MotionGamepadDevice=_.default;var M=r(103);t.NormalMapGenerator=M.default;var A=r(104);t.ObjectAnimator=A.default;var C=r(105);t.ObjectPicker=C.default;var R=r(38);t.OrbitCamera=R.default;var O=r(106);t.OrbitCameraFocus=O.default;var j=r(107);t.OrbitDesktopInput=j.default;var I=r(108);t.OrbitTouchInput=I.default;var k=r(110);t.PanoramaToCubeMap=k.default;var L=r(109);t.PMREMGenerator=L.default;var B=r(111);t.ReflectionCapturePlanar=B.default;var z=r(112);t.RemoteInstance=z.default;var N=r(113);t.Renderer=N.default;var V=r(67);t.RenderModes=V.default;var U=r(39);t.RenderView=U.default;var F=r(114);t.Rotate=F.default;var G=r(115);t.ScaleToSize=G.default;var q=r(116);t.SimplexNoiseGenerator=q.default;var $=r(117);t.Skybox=$.default;var H=r(118);t.TextRenderer=H.default;var W=r(119);t.VrCameraController=W.default;var Q=r(120);t.VrPresenter=Q.default;var X=r(121);t.VrRenderView=X.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(80),n=r(81),a=r(82),o=r(83),s=r(84),u=r(85),p=r(86),c=r(87),h=r(88),l=r(89),d=r(90),f=r(91),m=r(92),y=r(93),g=r(94),v=r(95),b=r(96),x=r(37),P=r(97),w=r(98),E=r(99),T=r(100),S=r(101),D=r(102),_=r(66),M=r(103),A=r(104),C=r(105),R=r(38),O=r(106),j=r(107),I=r(108),k=r(110),L=r(109),B=r(111),z=r(112),N=r(113),V=r(67),U=r(39),F=r(114),G=r(115),q=r(116),$=r(117),H=r(118),W=r(119),Q=r(120),X=r(121);t.default=[[{id:"align_to_position",sid:"Align to Position",properties:{name:"Align to Position",description:"Aligns an object relative to a position using the object's bounding box.",attributes:{referencePosition:{name:"referencePosition",type:"v3",description:"The position to work relative to.",default:{x:0,y:0,z:0}},alignment:{name:"alignment",type:"v3",description:"An object of the form { x: x, y: y, z: z} where the values for x, y and z are between -1 and +1 and specify how the object is aligned relative to the object's bounds.",default:{x:0,y:0,z:0}}},filter:["object"],category:"Loading",executeIn:"all"}},i.default],[{id:"animation",sid:"Animation",properties:{name:"Animation",description:"Applies an animation to an object.",attributes:{asset:{name:"asset",type:"asset",description:"Animation asset",default:null,filter:{AnimationAsset:!0}},prefab:{name:"prefab",type:"asset",description:"Prefab asset imported with the animation.",default:null,filter:{PrefabAsset:!0}},clipId:{name:"clipId",type:"i",description:"The animation clip ID",default:null},loop:{name:"loop",type:"b",description:"Continuously replay the animation",default:!0},speed:{name:"speed",type:"f",description:"Playback speed",default:1,min:0,max:100},startTime:{name:"startTime",type:"f",description:"Begin playback at this time offset",default:0,min:0},weight:{name:"weight",type:"f",description:"Blending weight",default:1,min:0,max:1}},events:{playAnimation:{scope:"local",name:"playAnimation",action:!0,category:"Animation",parameters:[{name:"asset",type:"asset",description:"The animation asset to play.",default:null,filter:{AnimationAsset:!0}},{name:"clipId",type:"s",description:"The ID of the clip to play.",default:null},{name:"loop",type:"b",description:"Continuously replay the animation.",default:!0},{name:"speed",type:"f",description:"Playback speed.",default:1,min:0,max:100},{name:"startTime",type:"f",description:"Begin playback at this time offset.",default:0,min:0}]},pauseAnimation:{scope:"local",name:"pauseAnimation",action:!0,category:"Animation",parameters:[]},stopAnimation:{scope:"local",name:"stopAnimation",action:!0,category:"Animation",parameters:[]},toggleAnimation:{scope:"local",name:"toggleAnimation",action:!0,category:"Animation",parameters:[]},animationLoaded:{scope:"local",name:"animationLoaded",action:!1,category:"Animation",parameters:[]},endAnimation:{scope:"local",name:"endAnimation",action:!1,category:"Animation",parameters:[]}},filter:["object"],category:"Animation",executeIn:"player"}},n.default],[{id:"audio_listener",sid:"Audio Listener",properties:{name:"Audio Listener",description:"Audio listener for 3D, positional sound effects",category:"Audio",executeIn:"player"}},a.default],[{id:"audio_source",sid:"Audio Source",properties:{name:"Audio Source",description:"Controls playback of audio assets",attributes:{gain:{name:"gain",type:"f",description:"Volume control",default:1,min:0,max:100},autoPlay:{name:"autoPlay",type:"b",description:"Play the audio once loaded",default:!0},loop:{name:"loop",type:"b",description:"Continuously replay the audio",default:!0},preload:{name:"preload",type:"b",description:"Load the audio when the component is initialized",default:!0},positional:{name:"positional",type:"b",description:"Enable/disable 3D, positional audio effects",default:!1},stream:{name:"stream",type:"b",description:"Stream the audio",default:!1},asset:{name:"asset",type:"asset",description:"Audio or video asset",default:null,filter:{AudioAsset:!0,VideoAsset:!0}}},events:{playAudio:{scope:"local",name:"playAudio",action:!0,category:"Audio",parameters:[{name:"offset",type:"f",description:"Defined in seconds",default:0}]},pauseAudio:{scope:"local",name:"pauseAudio",action:!0,category:"Audio",parameters:[]},stopAudio:{scope:"local",name:"stopAudio",action:!0,category:"Audio",parameters:[]},toggleAudio:{scope:"local",name:"toggleAudio",action:!0,category:"Audio",parameters:[]}},category:"Audio",executeIn:"player"}},o.default],[{id:"axis_rotation",sid:"Axis Rotation",properties:{name:"Axis Rotation",description:"Set the rotation of any object.",attributes:{speed:{name:"speed",type:"f",description:"The speed that we rotate the object, if a transition is triggered",default:.4,max:100,min:.1}},events:{rotate_on_axis:{scope:"local",name:"rotate_on_axis",action:!0,category:"Transformation",parameters:[{name:"rotation",type:"v3",description:"Euler rotation about each axis, in degrees.",default:{x:0,y:0,z:0}},{name:"additive",type:"b",description:"Whether or not to add to the current rotation OR just set as world rotation.",default:!1},{name:"force",type:"b",description:"Force this to happen without a transition.",default:!1}]},set_axes_orientation:{scope:"local",name:"set_axes_orientation",action:!0,category:"Transformation",parameters:[{name:"up",type:"opt",description:"The up axis key.",options:{"+X":{x:1,y:0,z:0},"-X":{x:-1,y:0,z:0},"+Y":{x:0,y:1,z:0},"-Y":{x:0,y:-1,z:0},"+Z":{x:0,y:0,z:1},"-Z":{x:0,y:0,z:-1}},default:""},{name:"forward",type:"opt",description:"The forward axis key.",options:{"+X":{x:1,y:0,z:0},"-X":{x:-1,y:0,z:0},"+Y":{x:0,y:1,z:0},"-Y":{x:0,y:-1,z:0},"+Z":{x:0,y:0,z:1},"-Z":{x:0,y:0,z:-1}},default:""},{name:"transition",type:"b",description:"Whether or not to trigger a smooth transition.",default:!1}]},end_axes_rotation:{scope:"local",name:"end_axes_rotation",action:!1,category:"Transformation",parameters:[]}},filter:["object"],category:"User Defined",executeIn:"player"}},s.default],[{id:"bounding_box_renderer",sid:"BoundingBox Renderer",properties:{name:"BoundingBox Renderer",description:"Renders bounding boxes for objects in a hierarchy.",attributes:{recursive:{name:"recursive",type:"b",default:!0,description:"Automatically render bounding boxes for all meshes in the hierarchy"}},filter:["object"],category:"Rendering",executeIn:"all"}},u.default],[{id:"camera_zoom",sid:"Camera Zoom",properties:{name:"Camera Zoom",description:"Handles zooming with orthographic and perspective cameras.",attributes:{perspectiveZoomMax:{name:"perspectiveZoomMax",type:"f",description:"The maximum amount a perspective camera can be zoomed (out)",default:180,max:1e5,min:0},perspectiveZoomMin:{name:"perspectiveZoomMin",type:"f",description:"The minimum amount a perspective camera can be zoomed (in)",default:0,max:1e5,min:0},orthoZoomMax:{name:"orthoZoomMax",type:"f",description:"The maximum amount an orthographic camera can be zoomed (out)",default:5,max:1e5,min:0},orthoZoomMin:{name:"orthoZoomMin",type:"f",description:"The minimum amount an orthographic camera can be zoomed (in)",default:0,max:1e5,min:0},perspectiveStep:{name:"perspectiveStep",type:"f",description:"Used to unify zoom between ortho and perspective zoom (this.zoom(+-1))",default:4,max:1e5,min:0},orthographicStep:{name:"orthographicStep",type:"f",description:"Used to unify zoom between ortho and perspective zoom (this.zoom(+-1))",default:.2,max:1e5,min:0}},filter:["camera"],category:"Camera Controllers",executeIn:"all"}},p.default],[{id:"cube_map_capture",sid:"Cube-Map Capture",properties:{name:"Cube-Map Capture",description:"Renders the scene from the position of the object into a cube texture.",attributes:{captureTexture:{name:"captureTexture",type:"asset",description:"The RenderTextureCube to render the reflection to.",filter:{RenderTextureCubeAsset:!0},default:null},near:{name:"near",type:"f",description:"The closest distance to this object to render. Adjust this to avoid rendering local geometry to the texture.",default:.01},far:{name:"far",type:"f",description:"The furthest distance from this object to render.",default:16},updateFrameInterval:{name:"updateFrameInterval",type:"i",description:"The number of frames to skip in between updates of the reflection. Default is 0.",default:0},renderPosX:{name:"renderPosX",type:"b",description:"Render this side of the cube.",default:!0},renderPosY:{name:"renderPosY",type:"b",description:"Render this side of the cube.",default:!0},renderNegZ:{name:"renderNegZ",type:"b",description:"Render this side of the cube.",default:!0},renderNegX:{name:"renderNegX",type:"b",description:"Render this side of the cube.",default:!0},renderNegY:{name:"renderNegY",type:"b",description:"Render this side of the cube.",default:!0},renderPosZ:{name:"renderPosZ",type:"b",description:"Render this side of the cube.",default:!0},debugView:{name:"debugView",type:"b",description:"Render the camera helpers on the cube capture.",default:!1}},filter:["Object"],category:"Rendering",executeIn:"all"}},c.default],[{id:"curve",sid:"Curve",properties:{name:"Curve",description:"Creates a spline curve that can be used for various things, including making objects follow it. Add controls points to shape the curve.",attributes:{controlPoints:{name:"controlPoints",type:"a",subType:{type:"object"},description:"The list of objects that define the curve shape."},closed:{name:"closed",type:"b",description:"If toggled, the start and end of the curve will be smoothly joined.",default:!1},enableVisualizations:{name:"enableVisualizations",type:"b",description:"If true, visualization of the curve will be enabled.",default:!1}},filter:["object"],category:"General",executeIn:"all"}},h.default],[{id:"debug_console_display",sid:"Debug Console Display",properties:{name:"Debug Console Display",description:"A utility component for displaying a console log over the canvas (useful on mobile)",filter:["Application"],category:"Debug",executeIn:"player"}},l.default],[{id:"debug_performance",sid:"Debug Performance",properties:{name:"Debug Performance",description:"Displays an FPS counter when enabled.",filter:["Application"],category:"Debug",executeIn:"player"}},d.default],[{id:"debug_texture_viewer",sid:"Debug Texture Viewer",properties:{name:"Debug Texture Viewer",description:"Displays a dropdown with all available textures for debugging purposes.",attributes:{viewportLeft:{name:"viewportLeft",type:"s",description:"Left position of the viewport to be rendered by this camera.",default:"25%"},viewportBottom:{name:"viewportBottom",type:"s",description:"Bottom position of the viewport to be rendered by this camera.",default:"0px"},viewportWidth:{name:"viewportWidth",type:"s",description:"Width of the viewport to be rendered by this camera.",default:"50%"},viewportHeight:{name:"viewportHeight",type:"s",description:"Height of the viewport to be rendered by this camera.",default:"50%"},renderGroup:{name:"renderGroup",type:"i",description:"Render passes are done in order, based on the 'render group' value. Lower numbers render first.",default:9}},filter:["Application"],category:"Debug",executeIn:"player"}},f.default],[{id:"dynamic_optimizer",sid:"Dynamic Performance Optimizer",properties:{name:"Dynamic Performance Optimizer",description:"Controls the dynamic down-stepping of rendering features in an attempt to achieve target performance.",attributes:{frameTimeThreshold:{name:"frameTimeThreshold",type:"f",description:"The average time that a frame can take to render before the optimizer drops a quality level. Default threshold is 30 FPS = 1000 ms / 30 frames",default:33.333333333333},testInterval:{name:"testInterval",type:"f",description:"The amount of elapsed time (in ms) to average the frame time over. i.e. an optimization decision can be made every time this interval elapses.",default:2e3}},filter:["Application"],category:"Rendering",executeIn:"player"}},m.default],[{id:"event_handler",sid:"Event Handler",properties:{name:"Event Handler",description:'Binds to a "listener" event and maps its firing to a list of trigger events.',attributes:{listener:{name:"listener",type:"event",description:"The event to listen for. When this event is captured, all of the defined trigger events will be fired.",allowActions:!1,default:{scope:{type:"global"},name:null}},triggers:{name:"triggers",type:"a",subType:{type:"event"},description:"Fire each of these events in response to the captured listen event.",allowActions:!0,default:[]}},category:"Interaction",executeIn:"player"}},y.default],[{id:"exploder",sid:"Exploder",properties:{name:"Exploder",description:"Explodes your objects and their hierarchies into different formations. Great for showing off parts in a model!",attributes:{time:{name:"time",type:"f",default:1.5,min:.001,description:"The amount of time to explode and contract the child meshes"},scale:{name:"scale",type:"v3",default:{x:2,y:2,z:2},description:"The scale of the explosion"},formation:{name:"formation",type:"dd",description:"Formation to use when exploding the hierarchy of this object.",default:"Scale",options:{Circle:"Circle","Square Grid":"Grid","Scale Out":"Scale"}}},events:{playExplode:{scope:"local",name:"playExplode",action:!0,category:"Exploder",parameters:[]},playContract:{scope:"local",name:"playContract",action:!0,category:"Exploder",parameters:[]},toggleExplode:{scope:"local",name:"toggleExplode",action:!0,category:"Exploder",parameters:[]},resetExploder:{scope:"local",name:"resetExploder",action:!0,category:"Exploder",parameters:[]},playCircleExplode:{scope:"local",name:"playCircleExplode",action:!0,category:"Exploder",parameters:[{name:"Scale",type:"v3",description:"The scale to apply to the explosion",default:{x:1,y:1,z:1}}]},playGridExplode:{scope:"local",name:"playGridExplode",action:!0,category:"Exploder",parameters:[{name:"Scale",type:"v3",description:"The scale to apply to the explosion",default:{x:1,y:1,z:1}}]},playScaleExplode:{scope:"local",name:"playScaleExplode",action:!0,category:"Exploder",parameters:[{name:"Scale",type:"v3",description:"The scale to apply to the explosion",default:{x:2,y:2,z:2}}]},beginExplode:{scope:"other",name:"beginExplode",action:!1,category:"Exploder",parameters:[]},endExplode:{scope:"other",name:"endExplode",action:!1,category:"Exploder",parameters:[]},beginContract:{scope:"other",name:"beginContract",action:!1,category:"Exploder",parameters:[]},endContract:{scope:"other",name:"endContract",action:!1,category:"Exploder",parameters:[]}},filter:["object"],category:"Animation",executeIn:"player"}},g.default],[{id:"fullscreen",sid:"Fullscreen",properties:{name:"Fullscreen",description:"Harnesses the fullscreen API to make your app fullscreen!",events:{toggleFullscreen:{scope:"local",name:"toggleFullscreen",action:!0,category:"Rendering",parameters:[]}},filter:["application"],category:"Rendering",executeIn:"player"}},v.default],[{id:"gamepad_animator",sid:"Gamepad Animator",properties:{name:"Gamepad Animator",description:"A component for animating an object based on gamepad input. e.g. a model of the gamepad or surrogate.",attributes:{buttons:{name:"buttons",type:"a",description:"Array of structures that represent animation information of each button when fully pressed in local space.",subType:{type:"a",subType:{type:"custom",attributes:{mesh:{type:"object"},movementType:{type:"s",default:"translate"},offset:{type:"v3"},pivot:{type:"v3"},rotation:{type:"v3"},renderOnTouchOnly:{type:"b",default:!1}}},default:[]},default:[]},axes:{name:"axes",type:"a",description:"Array of structures that represent animation information of each axes when fully pressed in local space.",subType:{type:"a",subType:{type:"custom",attributes:{mesh:{type:"object"},movementType:{type:"s",default:"translate"},offset:{type:"v3"},pivot:{type:"v3"},rotation:{type:"v3"},renderOnTouchOnly:{type:"b",default:!1}}},default:[]},default:[]}},filter:["object"],category:"Input",executeIn:"player"}},b.default],[{id:"gamepad_device",sid:"Gamepad Device",properties:{name:"Gamepad Device",description:"Represents a single gamepad connected to the system. Component attributes can be used to configure which gamepad gets assigned.",filter:["object"],category:"Input",executeIn:"player"}},x.default],[{id:"gamepad_input",sid:"Gamepad Input",properties:{name:"Gamepad Input",description:"Gets list of connected gamepad controllers and fires events for gamepad actions.",filter:["application"],category:"Input",executeIn:"player"}},P.default],[{id:"input",sid:"Input",properties:{name:"Input",description:"The Box3D input component. Adding this will cause all mouse/touch and keyboard events to fire on the engine.",attributes:{mouseEvents:{name:"mouseEvents",type:"custom",description:"Mouse events to listen to.",attributes:{enable:{type:"b",default:!0,description:"Enable mouse events"},scroll:{type:"b",default:!0,description:"Listen to scroll events?"},preventScrollDefault:{type:"b",default:!1,description:"Prevent default scroll behavior"},move:{type:"b",default:!0,description:"Listen to mouse move events"},down:{type:"b",default:!0,description:"Listen to mouse down event"},preventDownDefault:{type:"b",default:!1,description:"Prevent default mouse down behavior"},up:{type:"b",default:!0,description:"Listen to mouse up event"},doubleClick:{type:"b",default:!0,description:"Listen to double click event"},leave:{type:"b",default:!0,description:"Listen to mouse leave event"},contextMenu:{type:"b",default:!0,description:"Listen for the context menu event (ie, right click)"},preventContextMenuDefault:{type:"b",default:!0,description:"Prevent context menu default behavior (ie, the context menu popping open)"},dragBufferDistance:{type:"f",default:12,name:"Drag Buffer Distance",description:"The distance from initial click that you need to move your mouse before a drag event is fired, in pixels"},eventHandler:{type:"b",default:!0,description:"Events fired from the mouse are picked up by the Event Handler"}}},touchEvents:{name:"touchEvents",type:"custom",description:"Touch events to listen to.",attributes:{enable:{type:"b",default:!0,description:"Enable touch events?"},start:{type:"b",default:!0,description:"Listen for Touch Start"},preventStartDefault:{type:"b",default:!1,description:"Prevent default behavior of touch start event"},end:{type:"b",default:!0,description:"Listen for touch end event"},preventEndDefault:{type:"b",default:!1},doubleTap:{type:"b",default:!0,description:"Listen for a touch double tap event"},cancel:{type:"b",default:!0,description:"Listen for touch cancel event"},preventCancelDefault:{type:"b",default:!1},leave:{type:"b",default:!0,description:"Listen for touch leave event"},preventLeaveDefault:{type:"b",default:!1},move:{type:"b",default:!0,description:"Listen for touch move event"},preventMoveDefault:{type:"b",default:!0,description:"Prevent default move behavior (ie, dragging the window)"},dragBufferDistance:{type:"f",default:12,name:"Drag Buffer Distance",description:"The distance from initial touch down that you need to move your finger before a drag event is fired, in pixels"},eventHandler:{type:"b",default:!0,description:"Events fired from the touches are picked up by the Event Handler"}}},keyEvents:{name:"keyEvents",type:"custom",description:"Keyboard events",attributes:{enable:{type:"b",default:!0,description:"Enable keyboard events"},down:{type:"b",default:!0,description:"Listen to key down events"},up:{type:"b",default:!0,description:"Listen to key up events"},preventDefault:{type:"b",default:!1,description:"Prevent default keypress behavior"},eventHandler:{type:"b",default:!0,description:"Events fired from the keys are picked up by the Event Handler"}}}},events:{mouse_down_left:{scope:"global",name:"mouse_down_left",action:!1,category:"Input - Mouse",parameters:[]},mouse_down_right:{scope:"global",name:"mouse_down_right",action:!1,category:"Input - Mouse",parameters:[]},mouse_down_middle:{scope:"global",name:"mouse_down_middle",action:!1,category:"Input - Mouse",parameters:[]},mouse_up_left:{scope:"global",name:"mouse_up_left",action:!1,category:"Input - Mouse",parameters:[]},mouse_up_right:{scope:"global",name:"mouse_up_right",action:!1,category:"Input - Mouse",parameters:[]},mouse_up_middle:{scope:"global",name:"mouse_up_middle",action:!1,category:"Input - Mouse",parameters:[]},keypress_a:{scope:"global",name:"keypress_a",action:!1,category:"Input - Keys",parameters:[]},keypress_b:{scope:"global",name:"keypress_b",action:!1,category:"Input - Keys",parameters:[]},keypress_c:{scope:"global",name:"keypress_c",action:!1,category:"Input - Keys",parameters:[]},keypress_d:{scope:"global",name:"keypress_d",action:!1,category:"Input - Keys",parameters:[]},keypress_f:{scope:"global",name:"keypress_f",action:!1,category:"Input - Keys",parameters:[]},keypress_g:{scope:"global",name:"keypress_g",action:!1,category:"Input - Keys",parameters:[]},keypress_e:{scope:"global",name:"keypress_e",action:!1,category:"Input - Keys",parameters:[]},keypress_h:{scope:"global",name:"keypress_h",action:!1,category:"Input - Keys",parameters:[]},keypress_i:{scope:"global",name:"keypress_i",action:!1,category:"Input - Keys",parameters:[]},keypress_j:{scope:"global",name:"keypress_j",action:!1,category:"Input - Keys",parameters:[]},keypress_k:{scope:"global",name:"keypress_k",action:!1,category:"Input - Keys",parameters:[]},keypress_l:{scope:"global",name:"keypress_l",action:!1,category:"Input - Keys",parameters:[]},keypress_m:{scope:"global",name:"keypress_m",action:!1,category:"Input - Keys",parameters:[]},keypress_n:{scope:"global",name:"keypress_n",action:!1,category:"Input - Keys",parameters:[]},keypress_o:{scope:"global",name:"keypress_o",action:!1,category:"Input - Keys",parameters:[]},keypress_p:{scope:"global",name:"keypress_p",action:!1,category:"Input - Keys",parameters:[]},keypress_q:{scope:"global",name:"keypress_q",action:!1,category:"Input - Keys",parameters:[]},keypress_r:{scope:"global",name:"keypress_r",action:!1,category:"Input - Keys",parameters:[]},keypress_s:{scope:"global",name:"keypress_s",action:!1,category:"Input - Keys",parameters:[]},keypress_t:{scope:"global",name:"keypress_t",action:!1,category:"Input - Keys",parameters:[]},keypress_u:{scope:"global",name:"keypress_u",action:!1,category:"Input - Keys",parameters:[]},keypress_v:{scope:"global",name:"keypress_v",action:!1,category:"Input - Keys",parameters:[]},keypress_w:{scope:"global",name:"keypress_w",action:!1,category:"Input - Keys",parameters:[]},keypress_x:{scope:"global",name:"keypress_x",action:!1,category:"Input - Keys",parameters:[]},keypress_y:{scope:"global",name:"keypress_y",action:!1,category:"Input - Keys",parameters:[]},keypress_z:{scope:"global",name:"keypress_z",action:!1,category:"Input - Keys",parameters:[]},keypress_up_arrow:{scope:"global",name:"keypress_up_arrow",action:!1,category:"Input - Keys",parameters:[]},keypress_down_arrow:{scope:"global",name:"keypress_down_arrow",action:!1,category:"Input - Keys",parameters:[]},keypress_left_arrow:{scope:"global",name:"keypress_left_arrow",action:!1,category:"Input - Keys",parameters:[]},keypress_right_arrow:{scope:"global",name:"keypress_right_arrow",action:!1,category:"Input - Keys",parameters:[]},keypress_space:{scope:"global",name:"keypress_space",action:!1,category:"Input - Keys",parameters:[]},touch_start:{scope:"global",name:"touch_start",action:!1,category:"Input - Touch",parameters:[]},touch_end:{scope:"global",name:"touch_end",action:!1,category:"Input - Touch",parameters:[]}},filter:["application"],category:"Input",executeIn:"all"}},w.default],[{id:"intersection_checker",sid:"Intersection Checker",properties:{name:"Intersection Checker",description:"This component checks if the entity that it's attached to intersects with any other objects. It can be configured to filter the checked objects, the type of intersection and when the intersection checks occur.",attributes:{objectTypeFilter:{name:"objectTypeFilter",type:"a",subType:{type:"dd"},description:"Array of type names to check for intersection with.",default:[],options:{Cameras:"camera",Lights:"light",Meshes:"mesh",Nodes:"node",Bones:"bone"}},objectFilter:{name:"objectFilter",type:"a",description:"An array of specific objects to check for intersection against.",subType:{type:"object"},default:[]},checkIntersectionAlways:{name:"checkIntersectionAlways",type:"b",description:'Whether this component will always be checking intersections. Otherwise, it will only check and report intersections only when the "checkIntersection" event is fired on this entity.',default:!1},boundingSphereOverrideRadius:{name:"boundingSphereOverrideRadius",type:"i",description:"The radius (in meters) around this object to use for checking object intersection (overrides using this object's regular bounding sphere)",default:-1},firstIntersectionOnly:{name:"firstIntersectionOnly",type:"b",description:"Option to stop checking intersections after the first one. True by default. This means that only one intersection event will be fired for each check.",default:!0},debugVisualization:{name:"debugVisualization",type:"b",description:"Option to turn on visualization of intersection sphere for this object.",default:!1}},filter:["object"],category:"Tools",executeIn:"player"}},E.default],[{id:"light_environment",sid:"Light Environment",properties:{name:"Light Environment",description:"Automatically assigns the given environment map to every material.",attributes:{radianceMap:{name:"radianceMap",type:"asset",description:"The radiance map texture asset.",filter:{Texture2DAsset:!0,RenderTexture2DAsset:!0,TextureCubeAsset:!0,RenderTextureCubeAsset:!0}}},filter:["scene"],category:"Rendering",executeIn:"all"}},T.default],[{id:"look_at_target",sid:"Look At Target",properties:{name:"Look At Target",description:"A component that automatically points the object at a target. This can be used for billboarding an object to the camera, making a character look at another, etc.",attributes:{target:{name:"target",type:"object",description:"The object that you want this object to point towards. e.g. for billboarding, this would be the camera used to render the scene."},local:{name:"local",type:"b",description:"If toggled, whatever rotation you have already applied to this object will be taken into account.",default:!1}},filter:["Object"],category:"General",executeIn:"player"}},S.default],[{id:"material_capture",sid:"Material Capture",properties:{name:"Material Capture",description:"A component that captures an image of a rendered material as a spherical map, complete with lighting. This image can then be applied (with a sphere map projection) to a mesh to achieve convincing material shading (although the mesh will appear with the same lighting from all directions).",attributes:{captureTexture:{name:"captureTexture",type:"asset",description:"The renderTexture2D asset which will be used to capture the material.",filter:{RenderTexture2DAsset:!0},default:null}},filter:["material"],category:"Rendering",executeIn:"all"}},D.default],[{id:"motion_gamepad_device",sid:"Motion Gamepad Device",properties:{name:"Motion Gamepad Device",description:"Represents a gamepad device with either 3DOF or 6DOF motion.",attributes:{handPreference:{name:"handPreference",type:"i",default:0,description:"The preference for the handedness of this controller."}},filter:["object"],category:"Input",executeIn:"player"}},_.default],[{id:"normal_map_generator",sid:"Normal Map Generator",properties:{name:"Normal Map Generator",description:"Generates a normal map from a greyscale heightmap.",attributes:{bumpTexture:{name:"bumpTexture",type:"asset",description:"The source height map.",filter:{Texture2DAsset:!0,RenderTexture2DAsset:!0}},smoothness:{name:"smoothness",type:"f",description:"Controls the smoothness of the result.",slider:!0,default:.25,min:1e-4,max:1},spread:{name:"spread",type:"f",description:"The spread value which is used by the shader.",slider:!0,default:4,min:1,max:10},autoLoad:{name:"autoLoad",type:"b",description:"If true, the normal map will be generated automatically on entity availability.",default:!0}},events:{renderNormalMap:{scope:"local",name:"renderNormalMap",action:!0,category:"Rendering",parameters:[]}},filter:["renderTexture2D"],category:"Rendering",executeIn:"all"}},M.default],[{id:"object_animator",sid:"Object Animator",properties:{name:"Object Animator",description:"Provides events for animating objects around the scene.",events:{playAnimateAlongCurve:{scope:"local",name:"playAnimateAlongCurve",action:!0,category:"Animation",parameters:[{name:"curve",type:"object",componentFilter:{Curve:!0}},{name:"animationTime",type:"f",description:"Time to animate to object. Defined in seconds",default:3},{name:"easeIn",type:"f",description:"The percentage of animation time spent speeding up.",default:.25,min:0,max:1},{name:"easeOut",type:"f",description:"The percentage of animation time spent slowing down.",default:.25,min:0,max:1},{name:"orientation",description:"Orient the object following the curve to either the direction of the curve or to the objects defining the curve.",type:"opt",default:"toCurve",options:{None:"None","To Curve":"toCurve","To Nodes":"toNode"}},{name:"loop",type:"b",default:!1}]},playAnimateToObject:{scope:"local",name:"playAnimateToObject",action:!0,category:"Animation",parameters:[{name:"object",type:"object",default:null},{name:"animationTime",type:"f",description:"Total time that the animation will take. Defined in seconds",default:3},{name:"easeIn",type:"f",description:"The percentage of animation time spent speeding up.",default:.25,min:0,max:1},{name:"easeOut",type:"f",description:"The percentage of animation time spent slowing down.",default:.25,min:0,max:1},{name:"update orientation",type:"b",default:!0}]},playAnimateTranslation:{scope:"local",name:"playAnimateTranslation",action:!0,category:"Animation",parameters:[{name:"animationTime",type:"f",description:"Time to animate. Defined in seconds",default:3},{name:"easeIn",type:"f",description:"The percentage of animation time spent speeding up.",default:.25,min:0,max:1},{name:"easeOut",type:"f",description:"The percentage of animation time spent slowing down.",default:.25,min:0,max:1},{name:"velocity",type:"v3",default:{x:0,y:0,z:1},min:-1,max:1},{name:"objectUsage",type:"opt",description:"Specify what part of the animation the current object's position represents.",default:"beginning",options:{Beginning:"beginning",Middle:"middle",End:"end"}}]},playAnimateRotation:{scope:"local",name:"playAnimateRotation",action:!0,category:"Animation",parameters:[{name:"animationTime",type:"f",description:"Time to animate to object. Defined in seconds",default:3},{name:"easeIn",type:"f",description:"The percentage of animation time spent speeding up.",default:.25,min:0,max:1},{name:"easeOut",type:"f",description:"The percentage of animation time spent slowing down.",default:.25,min:0,max:1},{name:"angularVelocity",type:"v3",default:{x:0,y:0,z:1},min:-100,max:100},{name:"objectUsage",type:"opt",description:"Specify what part of the animation the current object's rotation represents.",default:"beginning",options:{Beginning:"beginning",Middle:"middle",End:"end"}},{name:"axisOrder",type:"opt",description:"Specify the axis order that the angular velocity will be applied in.",default:"YXZ",options:{XYZ:"XYZ",YXZ:"YXZ",ZXY:"ZXY",XZY:"XZY",YZX:"YZX",ZYX:"ZYX"}}]},playAnimateScale:{scope:"local",name:"playAnimateScale",action:!0,category:"Animation",parameters:[{name:"animationTime",type:"f",description:"Time to animate to object. Defined in seconds",default:3},{name:"easeIn",type:"f",description:"The percentage of animation time spent speeding up.",default:.25,min:0,max:1},{name:"easeOut",type:"f",description:"The percentage of animation time spent slowing down.",default:.25,min:0,max:1},{name:"velocity",type:"v3",default:{x:0,y:0,z:1},min:-10,max:10},{name:"objectUsage",type:"opt",description:"Specify what part of the animation the current object's scale represents.",default:"beginning",options:{Beginning:"beginning",Middle:"middle",End:"end"}}]},pauseCurveAnimation:{scope:"local",name:"pauseCurveAnimation",action:!0,category:"Animation",parameters:[]},stopCurveAnimation:{scope:"local",name:"stopCurveAnimation",action:!0,category:"Animation",parameters:[]},unpauseCurveAnimation:{scope:"local",name:"unpauseCurveAnimation",action:!0,category:"Animation",parameters:[]},endAnimateAlongCurve:{scope:"local",name:"endAnimateAlongCurve",action:!1,category:"Animation",parameters:[]},endAnimateToObject:{scope:"local",name:"endAnimateToObject",action:!1,category:"Animation",parameters:[]},endAnimateTranslation:{scope:"local",name:"endAnimateTranslation",action:!1,category:"Animation",parameters:[]},endAnimateRotation:{scope:"local",name:"endAnimateRotation",action:!1,category:"Animation",parameters:[]},endAnimateScale:{scope:"local",name:"endAnimateScale",action:!1,category:"Animation",parameters:[]}},filter:["Object"],category:"Animation",executeIn:"player"}},A.default],[{id:"object_picker",sid:"Object Picker",properties:{name:"Object Picker",description:"Provides events for picking objects with mouse/touch",attributes:{pickTrigger:{name:"pickTrigger",type:"dd",description:"What mouse action will trigger the pick?",default:"leftMouseClick",options:{"Left Mouse Click":"leftMouseClick","Middle Mouse Click":"middleMouseClick","Right Mouse Click":"rightMouseClick","Left Mouse Down":"leftMouseDown","Middle Mouse Down":"middleMouseDown","Right Mouse Down":"rightMouseDown","Left Mouse Up":"leftMouseUp","Middle Mouse Up":"middleMouseUp","Right Mouse Up":"rightMouseUp","Left Mouse Double Click":"leftMouseDoubleClick","Middle Mouse Double Click":"middleMouseDoubleClick","Right Mouse Double Click":"rightMouseDoubleClick"}},enableHover:{name:"enableHover",type:"b",default:!1,advanced:!0,description:"Enable hover detection when mouse cursor is over a mesh. Note that this has a potential performance impact."},hoverFrameSkip:{name:"hoverFrameSkip",type:"i",description:"Skip this many frames in between hover checks.",default:1,min:0,max:60}},events:{objectsPicked:{scope:"global",name:"objectsPicked",action:!1,category:"General",parameters:[{name:"objectArray",type:"array",subType:"string",description:"The objects that have been picked.",default:null,filter:{BaseObject:!0}}]},objectHoverBegin:{scope:"global",name:"objectHoverBegin",action:!1,category:"General",parameters:[{name:"objectArray",type:"array",subType:"string",description:"The objects that has been hovered over.",default:[null],filter:{BaseObject:!0}}]},objectHoverEnd:{scope:"global",name:"objectHoverEnd",action:!1,category:"General",parameters:[{name:"objectArray",type:"array",subType:"string",description:"The objects that are no longer being hovered over.",default:[],filter:{BaseObject:!0}}]},pick:{scope:"other",name:"pick",action:!1,category:"General",filter:["object"],parameters:[]},beginHover:{scope:"other",name:"beginHover",action:!1,category:"General",filter:["object"],parameters:[]},endHover:{scope:"other",name:"endHover",action:!1,category:"General",filter:["object"],parameters:[]}},filter:["Application"],category:"General",executeIn:"player"}},C.default],[{id:"orbit_camera",sid:"Orbit Camera",properties:{name:"Orbit Camera",description:"Allows a camera to easily orbit a point in space.",attributes:{orbitDistance:{name:"orbitDistance",type:"f",description:"How far the camera is positioned from the pivot point.",default:2.5,max:1e5,min:.001},zoomPerspectiveBounds:{name:"zoomPerspectiveBounds",type:"v2",description:"Allows you to set how far the camera can zoom, for perspective cameras. X = min, Y = max",default:{x:5,y:90},max:{x:180,y:180},min:{x:1,y:1}},zoomOrthographicBounds:{name:"zoomOrthographicBounds",type:"v2",description:"Allows you to set how far the camera can zoom, for ortho cameras. X = min, Y = max",default:{x:.125,y:2.5},max:{x:5,y:5},min:{x:.01,y:.01}},panEnabled:{name:"panEnabled",type:"b",default:!0,description:"Allow the user to pan side-to-side and up and down with the camera."},zoomEnabled:{name:"zoomEnabled",type:"b",default:!0,description:"Allow the user to zoom in and out with the camera."},inertialDamping:{name:"inertialDamping",type:"f",default:.2,description:"How quickly the camera stops moving when input stops.",min:0,max:1},panSpeed:{name:"panSpeed",type:"f",description:"The speed that the camera moves when panning.",default:2,max:2e3,min:.1},orbitSpeed:{name:"orbitSpeed",type:"f",description:"The speed that the camera orbits the target.",default:2,max:1e3,min:1e-4},zoomSpeed:{name:"zoomSpeed",type:"f",description:"The speed that the camera moves while zooming in and out.",default:8,max:2e3,min:.1},pitchAngleBounds:{name:"pitchAngleBounds",type:"v2",description:"Allows you to set how far the camera can pitch (tilt) from horizontal.",default:{x:75,y:-75},max:{x:90,y:90},min:{x:-90,y:-90.001}}},filter:["camera"],category:"Camera Controllers",executeIn:"player"}},R.default],[{id:"orbit_camera_focus",sid:"Orbit Camera Focus",properties:{name:"Orbit Camera Focus",description:"A component that allows for easy focus on a point of an object.",attributes:{speed:{name:"speed",type:"f",description:"The speed that we move to focus on the target.",default:.8,max:100,min:.1},zoomSteps:{name:"zoomSteps",type:"i",description:"The number of steps it takes to zoom, from fully zoomed out to fully zoomed in.",default:5,max:100,min:0},zoomBuffer:{name:"zoomBuffer",type:"i",description:"The distance between each focal point move. Used to decide whether or not to zoom in.",default:.1,max:1e3,min:0}},filter:["camera"],category:"Camera Controllers",executeIn:"all"}},O.default],[{id:"orbit_desktop_input",sid:"Orbit Desktop Input",properties:{name:"Orbit Desktop Input",description:"Desktop input for Orbit Camera component",filter:["camera"],category:"Camera Components",executeIn:"all"}},j.default],[{id:"orbit_touch_input",sid:"Orbit Touch Input",properties:{name:"Orbit Touch Input",description:"Touch input for Orbit Camera component",filter:["camera"],category:"Camera Components",executeIn:"player"}},I.default],[{id:"panorama_to_cube_map",sid:"Panorama To Cube Map",properties:{name:"Panorama To Cube Map",description:"Converts a equirectangular map to a cube map.",attributes:{inputTexture:{name:"inputTexture",type:"asset",default:null,filter:{Texture2DAsset:!0,RenderTexture2DAsset:!0},description:"The texture to convert to a cube map."}},filter:["renderTextureCube"],category:"Rendering",executeIn:"all"}},k.default],[{id:"texture_to_pmrem_cubeuv",sid:"GeneratePMREM",properties:{name:"GeneratePMREM",description:"Generates a prefiltered mipmaped radiance environment map from a, preferably HDRI, input environment map. The entire result will be stored in this texture in the CubeUV layout.",attributes:{inputTexture:{name:"inputTexture",type:"asset",default:null,filter:{TextureCubeAsset:!0,RenderTextureCubeAsset:!0},description:"The cube texture to generate the PMREM for."},numSamples:{name:"numSamples",type:"i",default:32,description:"The number of samples per-texel when doing importance sampling."}},filter:["renderTexture2D"],category:"Rendering",executeIn:"all"}},L.default],[{id:"reflection_capture_planar",sid:"Reflection Capture Planar",properties:{name:"Reflection Capture Planar",description:"Renders a reflection along the plane represented by this object.",attributes:{captureTexture:{name:"captureTexture",type:"asset",description:"The RenderTexture2D to render the reflection to.",filter:{RenderTexture2DAsset:!0}},clipBias:{name:"clipBias",type:"f",description:"Pushes the rendered scene forward or backwards to adjust clipping with reflection plane.",default:.01},updateFrameInterval:{name:"updateFrameInterval",type:"i",description:"The number of frames to skip in between updates of the reflection. Default is 0.",default:0}},filter:["Object"],category:"Rendering",executeIn:"all"}},B.default],[{id:"remote_instance",sid:"Remote Instance",properties:{name:"Remote Instance",description:"Handles loading and instancing a 3D model at runtime from a Box file ID.",events:{createRemoteInstance:{scope:"global",name:"createRemoteInstance",action:!0,category:"Loading",parameters:[{name:"fileId",type:"string",description:"The Box file ID of the 3D model to load.",default:null}]},remoteInstanceCreated:{scope:"local",name:"remoteInstanceCreated",action:!1,category:"Loading",parameters:[{name:"fileId",type:"string",description:"The Box file ID of the 3D model that loaded.",default:null}]}},filter:["object"],category:"Loading",executeIn:"all"}},z.default],[{id:"box3d_renderer",sid:"Renderer",properties:{name:"Renderer",attributes:{antialias:{name:"antialias",type:"b",description:"Enable or disable anti aliasing of the rendered scene.",default:!0},preserveDrawingBuffer:{name:"preserveDrawingBuffer",type:"b",description:"Tells the browser to preserve drawing buffers between frames so that they are available to be read by the application.",default:!0},precision:{name:"precision",type:"dd",description:"The default floating point and integer precision to be used by the GPU.",default:"mediump",options:{Low:"lowp",Medium:"mediump",High:"highp"}},autoClear:{name:"autoClear",type:"b",description:"Automatically clear the render target before each render.",default:!1},devicePixelRatio:{name:"devicePixelRatio",type:"dd",default:0,options:{"Device Default":0,One:1,Two:2},description:"Override the default pixel ratio of the system. Higher values will cause rendering at higher resolution while lower values will force rendering at lower resolutions. You can also set this to use the device default (mobile devices usually have values greater than 1)."},shadowsEnabled:{name:"shadowsEnabled",type:"b",description:"Enable or disable rendering of shadows.",default:!0},shadowsEnabledMobile:{name:"shadowsEnabledMobile",type:"b",description:"Enable or disable rendering of shadows on mobile devices.",default:!1},shadowType:{name:"shadowType",type:"dd",description:"The type of shadow map to use. (PCF, Soft PCF or No Filtering)",options:{"Soft PCF":2,PCF:1,"No Filtering":0},default:2},shadowReverseSided:{name:"shadowReverseSided",type:"b",description:"Render shadows with reverse side of mesh.",default:!1},maxTextureSize2d:{name:"maxTextureSize2d",type:"i",description:"Clamp the maximum allowed dimension of a 2d texture. #power-of-two",default:32768,min:1024,max:32768},maxTextureSizeCube:{name:"maxTextureSizeCube",type:"i",description:"Clamp the maximum allowed dimension of a cube texture. #power-of-two",default:32768,min:512,max:32768},clearColor:{name:"clearColor",type:"c",description:"When the render target is cleared, this colour will be used",default:{r:0,g:0,b:0}},clearAlpha:{name:"clearAlpha",type:"f",description:"When the render target is cleared, this value will be used to clear the transparency",default:0,min:0,max:1,step:.001},renderOnDemand:{name:"renderOnDemand",type:"b",description:"When this is enabled, rendering will only happen when requested instead of every frame.",default:!0},logarithmicDepthBuffer:{name:"logarithmicDepthBuffer",type:"b",description:"Use logarithmic z values while rendering.",default:!1}},filter:["application"],category:"Rendering",executeIn:"player"}},N.default],[{id:"render_modes",sid:"Render Modes",properties:{name:"Render Modes",description:'A component for controlling the rendering style, allowing you to switch between "lit", "unlit", "untextured", etc., and enable/disable skeleton and wireframe visualization.',attributes:{renderMode:{name:"renderMode",type:"dd",description:"How to render the scene",default:0,options:{Lit:0,Unlit:1,Shape:2,Normals:3,Untextured:4,UVOverlay:5,SkinWeights:6}},skeletonsVisible:{name:"skeletonsVisible",type:"b",description:"Enable or disable skeleton rendering",default:!1},shapeTexture:{name:"shapeTexture",type:"asset",description:'The texture to use with the "Shape" render mode',filter:{Texture2DAsset:!0,RenderTexture2DAsset:!0},default:null},wireframesVisible:{name:"wireframesVisible",type:"b",description:"Enable or disable wireframe rendering",default:!1}},events:{resetSkeletons:{scope:"global",name:"resetSkeletons",action:!0,category:"Rendering",parameters:[]},setRenderMode:{scope:"global",name:"setRenderMode",action:!0,category:"Rendering",parameters:[{name:"renderMode",type:"n",description:"RenderMode.Lit, RenderMode.Unlit, etc.",default:"Lit"}]},setSkeletonsVisible:{scope:"global",name:"setSkeletonsVisible",action:!0,category:"Rendering",parameters:[{name:"visible",type:"b",description:"Whether or not skeletons are visible.",default:!1}]},setWireframesVisible:{scope:"global",name:"setWireframesVisible",action:!0,category:"Rendering",parameters:[{name:"visible",type:"b",description:"Whether or not wireframes are visible.",default:!1}]}},filter:["Application"],category:"Rendering",executeIn:"player"}},V.default],[{id:"render_view",sid:"Render View",properties:{name:"Render View",attributes:{viewportLeft:{name:"viewportLeft",type:"s",description:"Left position of the viewport to be rendered by this camera.",default:"0px"},viewportBottom:{name:"viewportBottom",type:"s",description:"Bottom position of the viewport to be rendered by this camera.",default:"0px"},viewportWidth:{name:"viewportWidth",type:"s",description:"Width of the viewport to be rendered by this camera.",default:"100%"},viewportHeight:{name:"viewportHeight",type:"s",description:"Height of the viewport to be rendered by this camera.",default:"100%"},renderGroup:{name:"renderGroup",type:"i",description:"Render passes are done in order, based on the 'render group' value. Lower numbers render first.",default:0},renderLayer:{name:"renderLayer",type:"i",description:"The layer that this camera will render. Objects that are in a different layer will not be rendered by this camera.",default:0,min:0},clearColor:{name:"clearColor",type:"b",description:"Enable/disable color buffer clearing",default:!1,advanced:!1},clearDepth:{name:"clearDepth",type:"b",description:"Enable/disable depth buffer clearing",default:!0,advanced:!1},renderTarget:{name:"renderTarget",type:"asset",description:"The render texture asset to use as a render target.",filter:{RenderTexture2DAsset:!0},default:null,advanced:!1},enablePreRenderFunctions:{name:"enablePreRenderFunctions",type:"b",description:"Run pre-render functions with this view. These include things like real-time reflections, which need to be rendered for each view separately.",default:!0},enableShadows:{name:"enableShadows",type:"b",description:"Render shadows for this view.",default:!0},opacity:{name:"opacity",type:"f",description:"The opacity value to use while rendering.",min:0,max:1,default:1},overrideCameraAspect:{name:"overrideCameraAspect",type:"f",description:"Override the aspect ratio of the camera using viewport settings.",min:0,default:!0},overrideScene:{name:"overrideScene",type:"asset",description:"Override which scene is rendered by this camera.",filter:{PrefabAsset:!0},default:null}},events:{enableRenderView:{scope:"local",name:"enableRenderView",category:"Rendering"},setViewport:{scope:"local",name:"setViewport",category:"Rendering",parameters:[{name:"viewportLeft",description:"Left position of the viewport to be rendered by this camera.",type:"s",default:"0px"},{name:"viewportBottom",description:"Bottom position of the viewport to be rendered by this camera.",type:"s",default:"0px"},{name:"viewportWidth",description:"Width of the viewport to be rendered by this camera.",type:"s",default:"100%"},{name:"viewportHeight",description:"Height of the viewport to be rendered by this camera.",type:"s",default:"100%"}]},disableRenderView:{scope:"local",name:"disableRenderView",category:"Rendering"},toggleRenderView:{scope:"local",name:"toggleRenderView",category:"Rendering"}},filter:["camera"],category:"Rendering",executeIn:"player"}},U.default],[{id:"rotate",sid:"Rotate",properties:{name:"Rotate",description:"A simple component which rotates the attached object.",attributes:{autoRotate:{name:"autoRotate",type:"b",description:"Automatically start the rotation upon load.",default:!0},rotation:{name:"rotation",type:"v3",description:"Amount of rotation per second about the x, y and z axes.",default:{x:0,y:.5,z:0}},local:{name:"local",type:"b",description:"Rotate relative to the local quaternion of the object. If false, the rotation will be relative to the world.",default:!1}},events:{startRotate:{scope:"local",name:"startRotate",action:!0,category:"Rotate",parameters:[]},stopRotate:{scope:"local",name:"stopRotate",action:!0,category:"Rotate",parameters:[]},toggleRotate:{scope:"local",name:"toggleRotate",action:!0,category:"Rotate",parameters:[]}},filter:["object"],category:"Animation",executeIn:"player"}},F.default],[{id:"scale_to_size",sid:"Scale to Size",properties:{name:"Scale to Size",description:"Handles scaling an entity (and everything under it) at runtime.",attributes:{size:{name:"size",type:"f",description:"The size that the object will be scaled to, in world units. The size is measured as the longest diagonal of the bounding box for the object.",default:1}},filter:["object"],category:"Loading",executeIn:"all"}},G.default],[{id:"simplex_noise_generator",sid:"Simplex Noise Generator",properties:{name:"Simplex Noise Generator",description:"Generates a texture using simplex noise.",attributes:{layerAmplitude:{name:"layerAmplitude",type:"v4",description:"The layer amplitude uniform value for the shader.",default:{x:.5,y:.4,z:.3,w:.125}},layerScale:{name:"layerScale",type:"v4",description:"The layer scale uniform value for the shader.",default:{x:.5,y:2,z:3,w:4}},scale:{name:"scale",type:"v2",description:"The scale uniform value for the shader.",default:{x:1,y:1}},offset:{name:"offset",type:"v2",description:"The offset uniform value for the shader.",default:{x:0,y:0}},autoLoad:{name:"autoLoad",type:"b",description:"Generate the simplex noise map automatically when the entity loads",default:!0}},events:{renderNoise:{scope:"local",name:"renderNoise",action:!0,category:"Rendering",parameters:[]},changeNoiseValues:{scope:"local",name:"changeNoiseValues",action:!0,category:"Rendering",parameters:[{name:"layerAmplitude",type:"v4",description:"",default:{x:.5,y:.4,z:.3,w:.125}},{name:"layerScale",type:"v4",description:"",default:{x:.5,y:2,z:3,w:4}},{name:"scale",type:"v2",description:"",default:{x:1,y:1}},{name:"offset",type:"v2",description:"",default:{x:0,y:0}}]}},filter:["renderTexture2D"],category:"Rendering",executeIn:"all"}},q.default],[{id:"skybox_renderer",sid:"Skybox",properties:{name:"Skybox",description:"Adds a skybox to the scene.",attributes:{skyboxTexture:{name:"skyboxTexture",type:"asset",description:"The texture asset to use for the skybox.",filter:{BaseTextureAsset:!0},default:null},stereoEnabled:{name:"stereoEnabled",type:"b",description:"Determines whether or not to render in stereoscopic mode.",default:!1},size:{name:"size",type:"f",description:"The size (uniform scale) of the skybox.",default:1e3,min:1,max:1e6}},filter:["scene"],category:"Rendering",executeIn:"all"}},$.default],[{id:"text_renderer",sid:"Text Renderer",properties:{name:"Text Renderer",description:"Render the desired text to the texture.",attributes:{text:{name:"text",type:"s",default:"My Text",description:"Text you want to display"},fontColor:{name:"fontColor",type:"c",default:{r:1,g:1,b:1},description:"Color of the text"},fontFamily:{name:"fontFamily",type:"s",default:"Calibri",description:"Font family to render"},pointSize:{name:"pointSize",type:"i",default:48,description:"Font size",min:2,max:100}},filter:["renderTexture2D"],category:"Text",executeIn:"all"}},H.default],[{id:"vr_camera_controller",sid:"VR Camera Controller",properties:{name:"VR Camera Controller",description:"Moves a camera based on the movement of a VR head-mounted display.",filter:["camera"],category:"Camera",executeIn:"player"}},W.default],[{id:"vr_presenter",sid:"VR Presenter",properties:{name:"VR Presenter",description:"Controls the enabling and disabling of WebVR presenting.",filter:["application"],category:"VR",executeIn:"player"}},Q.default],[{id:"vr_render_view",sid:"VR Render View",properties:{name:"VR Render View",description:"Render View component that enables a stereoscopic view when a VR display is presenting.",attributes:{viewportLeft:{name:"viewportLeft",type:"s",description:"Left position of the viewport to be rendered by this camera.",default:"0px"},viewportBottom:{name:"viewportBottom",type:"s",description:"Bottom position of the viewport to be rendered by this camera.",default:"0px"},viewportWidth:{name:"viewportWidth",type:"s",description:"Width of the viewport to be rendered by this camera.",default:"100%"},viewportHeight:{name:"viewportHeight",type:"s",description:"Height of the viewport to be rendered by this camera.",default:"100%"},renderGroup:{name:"renderGroup",type:"i",description:"Render passes are done in order, based on the 'render group' value. Lower numbers render first.",default:0},renderLayer:{name:"renderLayer",type:"i",description:"The layer that this camera will render. Objects that are in a different layer will not be rendered by this camera.",default:0,min:0},clearColor:{name:"clearColor",type:"b",description:"Enable/disable color buffer clearing",default:!1,advanced:!1},clearDepth:{name:"clearDepth",type:"b",description:"Enable/disable depth buffer clearing",default:!0,advanced:!1},renderTarget:{name:"renderTarget",type:"asset",description:"The render texture asset to use as a render target.",filter:{RenderTexture2DAsset:!0},default:null,advanced:!1},enablePreRenderFunctions:{name:"enablePreRenderFunctions",type:"b",description:"Run pre-render functions with this view. These include things like real-time reflections, which need to be rendered for each view separately.",default:!0,advanced:!0},enableShadows:{name:"enableShadows",type:"b",description:"Render shadows for this view.",default:!0,advanced:!0}},filter:["camera"],category:"Rendering",executeIn:"player"}},X.default]]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0);r(206),r(208),r(207),i.__exportStar(r(205),t)},function(e,t){e.exports="/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Normal map shader\n * - compute normals from bumpTexture\n */\nprecision lowp float;\nuniform float smoothness;\nuniform float spread;\nuniform vec2 resolution;\nuniform sampler2D bumpTexture;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec2 size = vec2( smoothness, 0.0 );\n vec3 off = vec3(-spread / resolution.x, 0.0, spread / resolution.y);\n\n vec4 wave = texture2D( bumpTexture, vUv);\n float s11 = wave.x;\n float s01 = texture2D( bumpTexture, vUv + off.xy ).x;\n float s21 = texture2D( bumpTexture, vUv + off.zy ).x;\n float s10 = texture2D( bumpTexture, vUv + off.yx ).x;\n float s12 = texture2D( bumpTexture, vUv + off.yz ).x;\n vec3 va = normalize(vec3( size.xy, s21-s01));\n vec3 vb = normalize(vec3( size.yx, s12-s10));\n vec3 norm = cross(va,vb);\n gl_FragColor = vec4( norm * 0.5 + 0.5, s11 );\n}\n"},function(e,t){e.exports="/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Normal map shader\n * - compute normals from bumpTexture\n */\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n"},function(e,t){e.exports="//\n// Description : Array and textureless GLSL 3D simplex noise function.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110409 (stegu)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n//\n//'precision lowp float;\nuniform float time;\nuniform vec4 layerAmplitude;\nuniform vec4 layerScale;\nvarying vec2 vUv;\n\nprecision highp float;\n\nvec4 permute( vec4 x ) {\n\n return mod( ( ( x * 34.0 ) + 1.0 ) * x, 289.0 );\n\n}\n\nvec4 taylorInvSqrt( vec4 r ) {\n\n return 1.79284291400159 - 0.85373472095314 * r;\n\n}\n\nfloat snoise( vec3 v ) {\n\n vec2 C = vec2( 1.0 / 6.0, 1.0 / 3.0 );\n const vec4 D = vec4( 0.0, 0.5, 1.0, 2.0 );\n\n // First corner\n\n vec3 i = floor( v + dot( v, C.yyy ) );\n vec3 x0 = v - i + dot( i, C.xxx );\n\n // Other corners\n\n vec3 g = step( x0.yzx, x0.xyz );\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n vec3 x1 = x0 - i1 + 1.0 * C.xxx;\n vec3 x2 = x0 - i2 + 2.0 * C.xxx;\n vec3 x3 = x0 - 1. + 3.0 * C.xxx;\n\n // Permutations\n\n i = mod( i, 289.0 );\n vec4 p = permute( permute( permute(\n i.z + vec4( 0.0, i1.z, i2.z, 1.0 ) )\n + i.y + vec4( 0.0, i1.y, i2.y, 1.0 ) )\n + i.x + vec4( 0.0, i1.x, i2.x, 1.0 ) );\n\n // Gradients\n // ( N*N points uniformly over a square, mapped onto an octahedron.)\n\n float n_ = 1.0 / 7.0; // N=7\n\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor( p * ns.z *ns.z ); // mod(p,N*N)\n\n vec4 x_ = floor( j * ns.z );\n vec4 y_ = floor( j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs( x ) - abs( y );\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n\n vec4 s0 = floor( b0 ) * 2.0 + 1.0;\n vec4 s1 = floor( b1 ) * 2.0 + 1.0;\n vec4 sh = -step( h, vec4( 0.0 ) );\n\n vec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;\n vec4 a1 = b1.xzyw + s1.xzyw * sh.zzww;\n\n vec3 p0 = vec3( a0.xy, h.x );\n vec3 p1 = vec3( a0.zw, h.y );\n vec3 p2 = vec3( a1.xy, h.z );\n vec3 p3 = vec3( a1.zw, h.w );\n\n // Normalise gradients\n\n vec4 norm = taylorInvSqrt( vec4( dot( p0, p0 ), dot( p1, p1 ),\n dot( p2, p2 ), dot( p3, p3 ) ) );\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n // Mix final noise value\n\n vec4 m = max( 0.6 - vec4( dot( x0, x0 ), dot( x1, x1 ),\n dot( x2, x2 ), dot( x3, x3 ) ), 0.0 );\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot( p0, x0 ), dot( p1, x1 ),\n dot( p2, x2 ), dot( p3, x3 ) ) );\n\n}\n\nfloat surface3( vec3 coord ) {\n\n float n = 0.0;\n\n n += layerAmplitude.x * abs( snoise( coord * layerScale.x ) );\n n += layerAmplitude.y * abs( snoise( coord * layerScale.y ) );\n n += layerAmplitude.z * abs( snoise( coord * layerScale.z ) );\n n += layerAmplitude.w * abs( snoise( coord * layerScale.w ) );\n\n return n;\n}\n\nvoid main( void ) {\n\n vec3 coord = vec3( vUv, -time );\n float n = surface3( coord );\n\n gl_FragColor = vec4( vec3( n, n, n ), 1.0 );\n\n}\n"},function(e,t){e.exports="varying vec2 vUv;\nuniform vec2 scale;\nuniform vec2 offset;\n\nvoid main() {\n vUv = uv * scale + offset;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n"},function(e,t,r){(function(t){var r,r;(function(t){e.exports=t()})(function(){var e;return function e(t,i,n){function a(s,u){if(!i[s]){if(!t[s]){var p="function"==typeof r&&r;if(!u&&p)return r(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var h=i[s]={exports:{}};t[s][0].call(h.exports,function(e){var r=t[s][1][e];return a(r||e)},h,h.exports,e,t,i,n)}return i[s].exports}for(var o="function"==typeof r&&r,s=0;s=1&&r<=12&&i>=1&&i<=m[r]}function a(e,t){var r=e.match(y);if(!r)return!1;var i=r[1],n=r[2],a=r[3],o=r[5];return i<=23&&n<=59&&a<=59&&(!t||o)}function o(e){var t=e.split(w);return 2==t.length&&n(t[0])&&a(t[1],!0)}function s(e){return e.length<=255&&g.test(e)}function u(e){return E.test(e)&&v.test(e)}function p(e){try{return new RegExp(e),!0}catch(e){return!1}}function c(e,t){if(e&&t)return e>t?1:et?1:e=0?{index:i,compiling:!0}:(i=this._compilations.length,this._compilations[i]={schema:e,root:t,baseId:r},{index:i,compiling:!1})}function o(e,t,r){var i=s.call(this,e,t,r);i>=0&&this._compilations.splice(i,1)}function s(e,t,r){for(var i=0;i=55296&&t<=56319&&n=t)throw new Error("Cannot access property/index "+i+" levels up, current level is "+t);return r[t-i]}if(i>t)throw new Error("Cannot access data "+i+" levels up, current level is "+t);if(a="data"+(t-i||""),!n)return a}for(var s=a,p=n.split("/"),c=0;c",T="result"+n,S=e.opts.v5&&o&&o.$data;if(S?(i+=" var schema"+n+" = "+e.util.getData(o.$data,a,e.dataPathArr)+"; ",v="schema"+n):v=o,w){var D=e.util.getData(P.$data,a,e.dataPathArr),_="exclusive"+n,M="op"+n,A="' + "+M+" + '";i+=" var schemaExcl"+n+" = "+D+"; ",D="schemaExcl"+n,i+=" if (typeof "+D+" != 'boolean' && "+D+" !== undefined) { "+h+" = false; ";var r=x,C=C||[];C.push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(r||"_formatExclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: '"+x+" should be boolean' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var R=i;i=C.pop(),!e.compositeRule&&p?e.async?i+=" throw new ValidationError(["+R+"]); ":i+=" validate.errors = ["+R+"]; return false; ":i+=" var err = "+R+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",p&&(f+="}",i+=" else { "),S&&(i+=" if ("+v+" === undefined) "+h+" = true; else if (typeof "+v+" != 'string') "+h+" = false; else { ",f+="}"),d&&(i+=" if (!"+g+") "+h+" = true; else { ",f+="}"),i+=" var "+T+" = "+g+"("+c+", ",i+=S?""+v:""+e.util.toQuotedString(o),i+=" ); if ("+T+" === undefined) "+h+" = false; var "+_+" = "+D+" === true; if ("+h+" === undefined) { "+h+" = "+_+" ? "+T+" "+E+" 0 : "+T+" "+E+"= 0; } if (!"+h+") var op"+n+" = "+_+" ? '"+E+"' : '"+E+"=';"}else{var _=!0===P,A=E;_||(A+="=");var M="'"+A+"'";S&&(i+=" if ("+v+" === undefined) "+h+" = true; else if (typeof "+v+" != 'string') "+h+" = false; else { ",f+="}"),d&&(i+=" if (!"+g+") "+h+" = true; else { ",f+="}"),i+=" var "+T+" = "+g+"("+c+", ",i+=S?""+v:""+e.util.toQuotedString(o),i+=" ); if ("+T+" === undefined) "+h+" = false; if ("+h+" === undefined) "+h+" = "+T+" "+E,_||(i+="="),i+=" 0;"}i+=f+"if (!"+h+") { ";var r=t,C=C||[];C.push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(r||"_formatLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+M+", limit: ",i+=S?""+v:""+e.util.toQuotedString(o),i+=" , exclusive: "+_+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be "+A+' "',i+=S?"' + "+v+" + '":""+e.util.escapeQuotes(o),i+="\"' "),e.opts.verbose&&(i+=" , schema: ",i+=S?"validate.schema"+s:""+e.util.toQuotedString(o),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var R=i;return i=C.pop(),!e.compositeRule&&p?e.async?i+=" throw new ValidationError(["+R+"]); ":i+=" validate.errors = ["+R+"]; return false; ":i+=" var err = "+R+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="}"}},{}],14:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(o||""),l=e.opts.v5&&s&&s.$data;l?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+a):i=s;var d="maximum"==t,f=d?"exclusiveMaximum":"exclusiveMinimum",m=e.schema[f],y=e.opts.v5&&m&&m.$data,g=d?"<":">",v=d?">":"<";if(y){var b=e.util.getData(m.$data,o,e.dataPathArr),x="exclusive"+a,P="op"+a,w="' + "+P+" + '";n+=" var schemaExcl"+a+" = "+b+"; ",b="schemaExcl"+a,n+=" var exclusive"+a+"; if (typeof "+b+" != 'boolean' && typeof "+b+" != 'undefined') { ";var r=f,E=E||[];E.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(r||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: '"+f+" should be boolean' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var T=n;n=E.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+T+"]); ":n+=" validate.errors = ["+T+"]; return false; ":n+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if( ",l&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" ((exclusive"+a+" = "+b+" === true) ? "+h+" "+v+"= "+i+" : "+h+" "+v+" "+i+") || "+h+" !== "+h+") { var op"+a+" = exclusive"+a+" ? '"+g+"' : '"+g+"=';"}else{var x=!0===m,w=g;x||(w+="=");var P="'"+w+"'";n+=" if ( ",l&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+h+" "+v,x&&(n+="="),n+=" "+i+" || "+h+" !== "+h+") {"}var r=t,E=E||[];E.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(r||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { comparison: "+P+", limit: "+i+", exclusive: "+x+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be "+w+" ",n+=l?"' + "+i:s+"'"),e.opts.verbose&&(n+=" , schema: ",n+=l?"validate.schema"+u:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var T=n;return n=E.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+T+"]); ":n+=" validate.errors = ["+T+"]; return false; ":n+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c&&(n+=" else { "),n}},{}],15:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(o||""),l=e.opts.v5&&s&&s.$data;l?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+a):i=s;var d="maxItems"==t?">":"<";n+="if ( ",l&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+h+".length "+d+" "+i+") { ";var r=t,f=f||[];f.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(r||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxItems"==t?"more":"less",n+=" than ",n+=l?"' + "+i+" + '":""+s,n+=" items' "),e.opts.verbose&&(n+=" , schema: ",n+=l?"validate.schema"+u:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var m=n;return n=f.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},{}],16:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(o||""),l=e.opts.v5&&s&&s.$data;l?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+a):i=s;var d="maxLength"==t?">":"<";n+="if ( ",l&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),!1===e.opts.unicode?n+=" "+h+".length ":n+=" ucs2length("+h+") ",n+=" "+d+" "+i+") { ";var r=t,f=f||[];f.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(r||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be ",n+="maxLength"==t?"longer":"shorter",n+=" than ",n+=l?"' + "+i+" + '":""+s,n+=" characters' "),e.opts.verbose&&(n+=" , schema: ",n+=l?"validate.schema"+u:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var m=n;return n=f.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},{}],17:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(o||""),l=e.opts.v5&&s&&s.$data;l?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+a):i=s;var d="maxProperties"==t?">":"<";n+="if ( ",l&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" Object.keys("+h+").length "+d+" "+i+") { ";var r=t,f=f||[];f.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(r||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxProperties"==t?"more":"less",n+=" than ",n+=l?"' + "+i+" + '":""+s,n+=" properties' "),e.opts.verbose&&(n+=" , schema: ",n+=l?"validate.schema"+u:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var m=n;return n=f.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},{}],18:[function(e,t,r){"use strict";t.exports=function(e,t){var r=" ",i=e.schema[t],n=e.schemaPath+e.util.getProperty(t),a=e.errSchemaPath+"/"+t,o=!e.opts.allErrors,s=e.util.copy(e),u="";s.level++;var p="valid"+s.level,c=s.baseId,h=!0,l=i;if(l)for(var d,f=-1,m=l.length-1;f "+S+") { ";var _=p+"["+S+"]";l.schema=T,l.schemaPath=o+"["+S+"]",l.errSchemaPath=s+"/"+S,l.errorPath=e.util.getPathExpr(e.errorPath,S,e.opts.jsonPointers,!0),l.dataPathArr[y]=S;var M=e.validate(l);l.baseId=v,e.util.varOccurences(M,g)<2?r+=" "+e.util.varReplace(M,g,_)+" ":r+=" var "+g+" = "+_+"; "+M+" ",r+=" } ",u&&(r+=" if ("+f+") { ",d+="}")}if("object"==typeof b&&e.util.schemaHasRules(b,e.RULES.all)){l.schema=b,l.schemaPath=e.schemaPath+".additionalItems",l.errSchemaPath=e.errSchemaPath+"/additionalItems",r+=" "+f+" = true; if ("+p+".length > "+a.length+") { for (var "+m+" = "+a.length+"; "+m+" < "+p+".length; "+m+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var _=p+"["+m+"]";l.dataPathArr[y]=m;var M=e.validate(l);l.baseId=v,e.util.varOccurences(M,g)<2?r+=" "+e.util.varReplace(M,g,_)+" ":r+=" var "+g+" = "+_+"; "+M+" ",u&&(r+=" if (!"+f+") break; "),r+=" } } ",u&&(r+=" if ("+f+") { ",d+="}")}}else if(e.util.schemaHasRules(a,e.RULES.all)){l.schema=a,l.schemaPath=o,l.errSchemaPath=s,r+=" for (var "+m+" = 0; "+m+" < "+p+".length; "+m+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var _=p+"["+m+"]";l.dataPathArr[y]=m;var M=e.validate(l);l.baseId=v,e.util.varOccurences(M,g)<2?r+=" "+e.util.varReplace(M,g,_)+" ":r+=" var "+g+" = "+_+"; "+M+" ",u&&(r+=" if (!"+f+") break; "),r+=" } ",u&&(r+=" if ("+f+") { ",d+="}")}return u&&(r+=" "+d+" if ("+h+" == errors) {"),r=e.util.cleanUpCode(r)}},{}],26:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,c="data"+(a||""),h=e.opts.v5&&o&&o.$data;h?(i+=" var schema"+n+" = "+e.util.getData(o.$data,a,e.dataPathArr)+"; ",r="schema"+n):r=o,i+="var division"+n+";if (",h&&(i+=" "+r+" !== undefined && ( typeof "+r+" != 'number' || "),i+=" (division"+n+" = "+c+" / "+r+", ",e.opts.multipleOfPrecision?i+=" Math.abs(Math.round(division"+n+") - division"+n+") > 1e-"+e.opts.multipleOfPrecision+" ":i+=" division"+n+" !== parseInt(division"+n+") ",i+=" ) ",h&&(i+=" ) "),i+=" ) { ";var l=l||[];l.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+r+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be multiple of ",i+=h?"' + "+r:o+"'"),e.opts.verbose&&(i+=" , schema: ",i+=h?"validate.schema"+s:""+o,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var d=i;return i=l.pop(),!e.compositeRule&&p?e.async?i+=" throw new ValidationError(["+d+"]); ":i+=" validate.errors = ["+d+"]; return false; ":i+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",p&&(i+=" else { "),i}},{}],27:[function(e,t,r){"use strict";t.exports=function(e,t){var r=" ",i=e.level,n=e.dataLevel,a=e.schema[t],o=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),c="errs__"+i,h=e.util.copy(e);h.level++;var l="valid"+h.level;if(e.util.schemaHasRules(a,e.RULES.all)){h.schema=a,h.schemaPath=o,h.errSchemaPath=s,r+=" var "+c+" = errors; ";var d=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1;var f;h.opts.allErrors&&(f=h.opts.allErrors,h.opts.allErrors=!1),r+=" "+e.validate(h)+" ",h.createErrors=!0,f&&(h.opts.allErrors=f),e.compositeRule=h.compositeRule=d,r+=" if ("+l+") { ";var m=m||[];m.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: {} ",!1!==e.opts.messages&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var y=r;r=m.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { errors = "+c+"; if (vErrors !== null) { if ("+c+") vErrors.length = "+c+"; else vErrors = null; } ",e.opts.allErrors&&(r+=" } ")}else r+=" var err = ",!1!==e.createErrors?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: {} ",!1!==e.opts.messages&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(r+=" if (false) { ");return r}},{}],28:[function(e,t,r){"use strict";t.exports=function(e,t){var r=" ",i=e.level,n=e.dataLevel,a=e.schema[t],o=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),c="valid"+i,h="errs__"+i,l=e.util.copy(e),d="";l.level++;var f="valid"+l.level;r+="var "+h+" = errors;var prevValid"+i+" = false;var "+c+" = false;";var m=l.baseId,y=e.compositeRule;e.compositeRule=l.compositeRule=!0;var g=a;if(g)for(var v,b=-1,x=g.length-1;b5)r+=" || validate.schema"+o+"["+m+"] ";else{var j=v;if(j)for(var I,k=-1,L=j.length-1;k= "+fe+"; ",s=e.errSchemaPath+"/patternGroups/minimum",r+=" if (!"+c+") { ";var W=W||[];W.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'patternGroups' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { reason: '"+ge+"', limit: "+ye+", pattern: '"+e.util.escapeQuotes(F)+"' } ",!1!==e.opts.messages&&(r+=" , message: 'should NOT have "+ve+" than "+ye+' properties matching pattern "'+e.util.escapeQuotes(F)+"\"' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var Q=r;r=W.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+Q+"]); ":r+=" validate.errors = ["+Q+"]; return false; ":r+=" var err = "+Q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",void 0!==me&&(r+=" else ")}if(void 0!==me){var ye=me,ge="maximum",ve="more";r+=" "+c+" = pgPropCount"+i+" <= "+me+"; ",s=e.errSchemaPath+"/patternGroups/maximum",r+=" if (!"+c+") { ";var W=W||[];W.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'patternGroups' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { reason: '"+ge+"', limit: "+ye+", pattern: '"+e.util.escapeQuotes(F)+"' } ",!1!==e.opts.messages&&(r+=" , message: 'should NOT have "+ve+" than "+ye+' properties matching pattern "'+e.util.escapeQuotes(F)+"\"' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var Q=r;r=W.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+Q+"]); ":r+=" validate.errors = ["+Q+"]; return false; ":r+=" var err = "+Q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } "}s=H,u&&(r+=" if ("+c+") { ",d+="}")}}}}return u&&(r+=" "+d+" if ("+h+" == errors) {"),r=e.util.cleanUpCode(r)}},{}],32:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],u=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,c="data"+(o||""),h="valid"+a;if("#"==s||"#/"==s)e.isRoot?(r=e.async,i="validate"):(r=!0===e.root.schema.$async,i="root.refVal[0]");else{var l=e.resolveRef(e.baseId,s,e.isRoot);if(void 0===l){var d="can't resolve reference "+s+" from id "+e.baseId;if("fail"==e.opts.missingRefs){console.log(d);var f=f||[];f.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { ref: '"+e.util.escapeQuotes(s)+"' } ",!1!==e.opts.messages&&(n+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(s)+"' "),e.opts.verbose&&(n+=" , schema: "+e.util.toQuotedString(s)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),n+=" } "):n+=" {} ";var m=n;n=f.pop(),!e.compositeRule&&p?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",p&&(n+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs){var y=new Error(d);throw y.missingRef=e.resolve.url(e.baseId,s),y.missingSchema=e.resolve.normalizeId(e.resolve.fullPath(y.missingRef)),y}console.log(d),p&&(n+=" if (true) { ")}}else if(l.inline){var g=e.util.copy(e);g.level++;var v="valid"+g.level;g.schema=l.schema,g.schemaPath="",g.errSchemaPath=s;var b=e.validate(g).replace(/validate\.schema/g,l.code);n+=" "+b+" ",p&&(n+=" if ("+v+") { ")}else r=!0===l.$async,i=l.code}if(i){var f=f||[];f.push(n),n="",e.opts.passContext?n+=" "+i+".call(this, ":n+=" "+i+"( ",n+=" "+c+", (dataPath || '')",'""'!=e.errorPath&&(n+=" + "+e.errorPath);n+=" , "+(o?"data"+(o-1||""):"parentData")+" , "+(o?e.dataPathArr[o]:"parentDataProperty")+", rootData) ";var x=n;if(n=f.pop(),r){if(!e.async)throw new Error("async schema referenced by sync schema");n+=" try { ",p&&(n+="var "+h+" ="),n+=" "+e.yieldAwait+" "+x+"; } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; } ",p&&(n+=" if ("+h+") { ")}else n+=" if (!"+x+") { if (vErrors === null) vErrors = "+i+".errors; else vErrors = vErrors.concat("+i+".errors); errors = vErrors.length; } ",p&&(n+=" else { ")}return n}},{}],33:[function(e,t,r){"use strict";t.exports=function(e,t){var r=" ",i=e.level,n=e.dataLevel,a=e.schema[t],o=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),c="valid"+i,h=e.opts.v5&&a&&a.$data;h&&(r+=" var schema"+i+" = "+e.util.getData(a.$data,n,e.dataPathArr)+"; ");var l="schema"+i;if(!h)if(a.length=e.opts.loopRequired;if(u)if(r+=" var missing"+i+"; ",x){h||(r+=" var "+l+" = validate.schema"+o+"; ");var P="i"+i,w="schema"+i+"["+P+"]",E="' + "+w+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(b,w,e.opts.jsonPointers)),r+=" var "+c+" = true; ",h&&(r+=" if (schema"+i+" === undefined) "+c+" = true; else if (!Array.isArray(schema"+i+")) "+c+" = false; else {"),r+=" for (var "+P+" = 0; "+P+" < "+l+".length; "+P+"++) { "+c+" = "+p+"["+l+"["+P+"]] !== undefined; if (!"+c+") break; } ",h&&(r+=" } "),r+=" if (!"+c+") { ";var T=T||[];T.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { missingProperty: '"+E+"' } ",!1!==e.opts.messages&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+E+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var S=r;r=T.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+S+"]); ":r+=" validate.errors = ["+S+"]; return false; ":r+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { "}else{r+=" if ( ";var D=d;if(D)for(var _,P=-1,M=D.length-1;P 1) { var i = "+c+".length, j; outer: for (;i--;) { for (j = i; j--;) { if (equal("+c+"[i], "+c+"[j])) { "+h+" = false; break outer; } } } } ",l&&(i+=" } "),i+=" if (!"+h+") { ";var d=d||[];d.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(i+=" , schema: ",i+=l?"validate.schema"+s:""+o,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var f=i;i=d.pop(),!e.compositeRule&&p?e.async?i+=" throw new ValidationError(["+f+"]); ":i+=" validate.errors = ["+f+"]; return false; ":i+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",p&&(i+=" else { ")}else p&&(i+=" if (true) { ");return i}},{}],36:[function(e,t,r){"use strict";t.exports=function(e,t){function r(t){return void 0!==e.schema[t.keyword]||"properties"==t.keyword&&(!1===e.schema.additionalProperties||"object"==typeof e.schema.additionalProperties||e.schema.patternProperties&&Object.keys(e.schema.patternProperties).length||e.opts.v5&&e.schema.patternGroups&&Object.keys(e.schema.patternGroups).length)}var i="",n=!0===e.schema.$async;if(e.isTop){var a=e.isTop,o=e.level=0,s=e.dataLevel=0,u="data";if(e.rootId=e.resolve.fullPath(e.root.schema.id),e.baseId=e.baseId||e.rootId,n){e.async=!0;var p="es7"==e.opts.async;e.yieldAwait=p?"await":"yield"}delete e.isTop,e.dataPathArr=[void 0],i+=" var validate = ",n?p?i+=" (async function ":("co*"==e.opts.async&&(i+="co.wrap"),i+="(function* "):i+=" (function ",i+=" (data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; var vErrors = null; ",i+=" var errors = 0; ",i+=" if (rootData === undefined) rootData = data;"}else{var o=e.level,s=e.dataLevel,u="data"+(s||"");if(e.schema.id&&(e.baseId=e.resolve.url(e.baseId,e.schema.id)),n&&!e.async)throw new Error("async schema in sync schema");i+=" var errs_"+o+" = errors;"}var c="valid"+o,h=!e.opts.allErrors,l="",d="",f=e.schema.type,m=Array.isArray(f);if(f&&e.opts.coerceTypes){var y=e.util.coerceToTypes(e.opts.coerceTypes,f);if(y){var g=e.schemaPath+".type",v=e.errSchemaPath+"/type",b=m?"checkDataTypes":"checkDataType";i+=" if ("+e.util[b](f,u,!0)+") { ";var x="dataType"+o,P="coerced"+o;i+=" var "+x+" = typeof "+u+"; ","array"==e.opts.coerceTypes&&(i+=" if ("+x+" == 'object' && Array.isArray("+u+")) "+x+" = 'array'; "),i+=" var "+P+" = undefined; ";var w="",E=y;if(E)for(var T,S=-1,D=E.length-1;S2&&(t=l.call(arguments,1)),r(t)})})}function o(e){return Promise.all(e.map(n,this))}function s(e){for(var t=new e.constructor,r=Object.keys(e),i=[],a=0;a="0"&&n<="9";)t+=n,p();if("."===n)for(t+=".";p()&&n>="0"&&n<="9";)t+=n;if("e"===n||"E"===n)for(t+=n,p(),"-"!==n&&"+"!==n||(t+=n,p());n>="0"&&n<="9";)t+=n,p();if(e=+t,isFinite(e))return e;u("Bad number")},h=function(){var e,t,r,i="";if('"'===n)for(;p();){if('"'===n)return p(),i;if("\\"===n)if(p(),"u"===n){for(r=0,t=0;t<4&&(e=parseInt(p(),16),isFinite(e));t+=1)r=16*r+e;i+=String.fromCharCode(r)}else{if("string"!=typeof s[n])break;i+=s[n]}else i+=n}u("Bad string")},l=function(){for(;n&&n<=" ";)p()},d=function(){switch(n){case"t":return p("t"),p("r"),p("u"),p("e"),!0;case"f":return p("f"),p("a"),p("l"),p("s"),p("e"),!1;case"n":return p("n"),p("u"),p("l"),p("l"),null}u("Unexpected '"+n+"'")},f=function(){var e=[];if("["===n){if(p("["),l(),"]"===n)return p("]"),e;for(;n;){if(e.push(o()),l(),"]"===n)return p("]"),e;p(","),l()}}u("Bad array")},m=function(){var e,t={};if("{"===n){if(p("{"),l(),"}"===n)return p("}"),t;for(;n;){if(e=h(),l(),p(":"),Object.hasOwnProperty.call(t,e)&&u('Duplicate key "'+e+'"'),t[e]=o(),l(),"}"===n)return p("}"),t;p(","),l()}}u("Bad object")};o=function(){switch(l(),n){case"{":return m();case"[":return f();case'"':return h();case"-":return c();default:return n>="0"&&n<="9"?c():d()}},t.exports=function(e,t){var r;return a=e,i=0,n=" ",r=o(),l(),n&&u("Syntax error"),"function"==typeof t?function e(r,i){var n,a,o=r[i];if(o&&"object"==typeof o)for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(a=e(o,n),void 0!==a?o[n]=a:delete o[n]);return t.call(r,i,o)}({"":r},""):r}},{}],45:[function(e,t,r){function i(e){return u.lastIndex=0,u.test(e)?'"'+e.replace(u,function(e){var t=p[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function n(e,t){var r,u,p,c,h,l=a,d=t[e];switch(d&&"object"==typeof d&&"function"==typeof d.toJSON&&(d=d.toJSON(e)),"function"==typeof s&&(d=s.call(t,e,d)),typeof d){case"string":return i(d);case"number":return isFinite(d)?String(d):"null";case"boolean":case"null":return String(d);case"object":if(!d)return"null";if(a+=o,h=[],"[object Array]"===Object.prototype.toString.apply(d)){for(c=d.length,r=0;r1&&(i=r[0]+"@",e=r[1]),e=e.replace(j,"."),i+o(e.split("."),t).join(".")}function u(e){for(var t,r,i=[],n=0,a=e.length;n=55296&&t<=56319&&n65535&&(e-=65536,t+=B(e>>>10&1023|55296),e=56320|1023&e),t+=B(e)}).join("")}function c(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:E}function h(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function l(e,t,r){var i=0;for(e=r?L(e/_):e>>1,e+=L(e/t);e>k*S>>1;i+=E)e=L(e/k);return L(i+(k+1)*e/(e+D))}function d(e){var t,r,i,n,o,s,u,h,d,f,m=[],y=e.length,g=0,v=A,b=M;for(r=e.lastIndexOf(C),r<0&&(r=0),i=0;i=128&&a("not-basic"),m.push(e.charCodeAt(i));for(n=r>0?r+1:0;n=y&&a("invalid-input"),h=c(e.charCodeAt(n++)),(h>=E||h>L((w-g)/s))&&a("overflow"),g+=h*s,d=u<=b?T:u>=b+S?S:u-b,!(hL(w/f)&&a("overflow"),s*=f;t=m.length+1,b=l(g-o,t,0==o),L(g/t)>w-v&&a("overflow"),v+=L(g/t),g%=t,m.splice(g++,0,v)}return p(m)}function f(e){var t,r,i,n,o,s,p,c,d,f,m,y,g,v,b,x=[];for(e=u(e),y=e.length,t=A,r=0,o=M,s=0;s=t&&mL((w-r)/g)&&a("overflow"),r+=(p-t)*g,t=p,s=0;sw&&a("overflow"),m==t){for(c=r,d=E;f=d<=o?T:d>=o+S?S:d-o,!(c= 0x80 (not a basic code point)","invalid-input":"Invalid input"},k=E-T,L=Math.floor,B=String.fromCharCode;if(x={version:"1.4.1",ucs2:{decode:u,encode:p},decode:d,encode:f,toASCII:y,toUnicode:m},"function"==typeof e&&"object"==typeof e.amd&&e.amd)e("punycode",function(){return x});else if(g&&v)if(i.exports==g)v.exports=x;else for(P in x)x.hasOwnProperty(P)&&(g[P]=x[P]);else r.punycode=x})(this)}).call(this,void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],47:[function(e,t,r){"use strict";function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,r,a){t=t||"&",r=r||"=";var o={};if("string"!=typeof e||0===e.length)return o;var s=/\+/g;e=e.split(t);var u=1e3;a&&"number"==typeof a.maxKeys&&(u=a.maxKeys);var p=e.length;u>0&&p>u&&(p=u);for(var c=0;c=0?(h=m.substr(0,y),l=m.substr(y+1)):(h=m,l=""),d=decodeURIComponent(h),f=decodeURIComponent(l),i(o,d)?n(o[d])?o[d].push(f):o[d]=[o[d],f]:o[d]=f}return o};var n=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],48:[function(e,t,r){"use strict";function i(e,t){if(e.map)return e.map(t);for(var r=[],i=0;i",'"',"`"," ","\r","\n","\t"],f=["{","}","|","\\","^","`"].concat(d),m=["'"].concat(f),y=["%","/","?",";","#"].concat(m),g=["/","?","#"],v=/^[+a-z0-9A-Z_-]{0,63}$/,b=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,x={javascript:!0,"javascript:":!0},P={javascript:!0,"javascript:":!0},w={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},E=e("querystring");i.prototype.parse=function(e,t,r){if(!p.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),n=-1!==i&&i127?I+="x":I+=j[k];if(!I.match(v)){var B=R.slice(0,D),z=R.slice(D+1),N=j.match(b);N&&(B.push(N[1]),z.unshift(N[2])),z.length&&(s="/"+z.join(".")+s),this.hostname=B.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),C||(this.hostname=u.toASCII(this.hostname));var V=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+V,this.href+=this.host,C&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!x[f])for(var D=0,O=m.length;D0)&&r.host.split("@");S&&(r.auth=S.shift(),r.host=r.hostname=S.shift())}return r.search=e.search,r.query=e.query,p.isNull(r.pathname)&&p.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!E.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var D=E.slice(-1)[0],_=(r.host||e.host||E.length>1)&&("."===D||".."===D)||""===D,M=0,A=E.length;A>=0;A--)D=E[A],"."===D?E.splice(A,1):".."===D?(E.splice(A,1),M++):M&&(E.splice(A,1),M--);if(!b&&!x)for(;M--;M)E.unshift("..");!b||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),_&&"/"!==E.join("/").substr(-1)&&E.push("");var C=""===E[0]||E[0]&&"/"===E[0].charAt(0);if(T){r.hostname=r.host=C?"":E.length?E.shift():"";var S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");S&&(r.auth=S.shift(),r.host=r.hostname=S.shift())}return b=b||r.host&&E.length,b&&!C&&E.unshift(""),E.length?r.pathname=E.join("/"):(r.pathname=null,r.path=null),p.isNull(r.pathname)&&p.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},i.prototype.parseHost=function(){var e=this.host,t=h.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{"./util":51,punycode:46,querystring:49}],51:[function(e,t,r){"use strict";t.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},{}],ajv:[function(e,t,r){"use strict";function i(e){return v.test(e)}function n(t){function r(e,t){var r;if("string"==typeof e){if(!(r=T(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var i=A(e);r=i.validate||C(i)}var n=r(t);return!0===r.$async?"*"==I._opts.async?m(n):n:(I.errors=r.errors,n)}function y(e,t){var r=A(e,void 0,t);return r.validate||C(r)}function x(e,t,r,i){if(Array.isArray(e))for(var n=0;nt.major?e:t.major>e.major?t:e.minor>t.minor?e:t}function n(e){var t=[];if(e.major<=1){var r=i(e,{major:1,minor:0});t.push(function(e){return d.mapToV2Entity(e,r)})}if(e.major<=2){var n=i(e,{major:2,minor:0});t.push(function(e){return f.mapToV3Entity(e,n)})}if(e.major<=3){var a=i(e,{major:3,minor:0});t.push(function(e){return m.mapToV4Entity(e,a)})}if(e.major<=4){var o=i(e,{major:4,minor:0});t.push(function(e){return y.mapToV5Entity(e,o)})}return t}function a(e,t){n(t).forEach(function(t){e=b(e,t)});var r=v(e,"id");return b(e,function(e){return({material:o,prefab:h}[e.type]||g)(e,r)})}function o(e,t){var r=e.properties;return r.shadingModel&&("phong"===r.shadingModel?r.shaderId="fbx_surface_phong_shader":r.shaderId="fbx_surface_lambert_shader",delete r.shadingModel),s(r,"diffuse"),u(r,"ambient"),u(r,"emissive"),s(r,"specular"),p(r),c(r.normalMapTexture,"linear",t),c(r.bumpTexture,"linear",t),c(r.displacementTexture,"linear",t),c(r.transparencyFactorTexture,"linear",t),r.normalScale&&void 0===r.normalScale.x&&(r.normalScale={x:r.normalScale,y:r.normalScale}),e}function s(e,t){var r=t+"Factor",i=t+"Texture",n=t+"FactorTexture";e[t]&&(e[i]?e[t]={r:e[r],g:e[r],b:e[r]}:e[n]?e[i]=e[n]:(e[t].r*=e[r],e[t].g*=e[r],e[t].b*=e[r]),delete e[r],delete e[n])}function u(e,t){var r=t+"Texture",i=t+"FactorTexture";e[i]&&(e[r]=e[i],delete e[i])}function p(e){var t=0;(e.transparencyFactor||e.transparencyFactorTexture)&&e.transparentColor&&e.transparentColor.r?e.transparencyFactorTexture||e.transparentColorTexture?e.transparencyFactor=0:(t=(e.transparentColor.r+e.transparentColor.g+e.transparentColor.b)/3,e.transparencyFactor*=t):e.transparencyFactor=0,e.transparencyFactor=Math.max(Math.min(1-e.transparencyFactor,1),0),delete e.transparentColor,delete e.transparentColorTexture}function c(e,t,r){var i=r[e];if(i){var n=r[i.properties.imageId];n&&(n.properties.encoding=t)}}function h(e){var t=l.v4(),r={type:"node",id:t,parentAssetId:e.id,sid:t,children:e.children,properties:{name:(e.properties.name||"Prefab")+"_root"}};return delete e.children,e.properties.rootObjectId=t,[e,r]}var l=r(19),d=r(250),f=r(251),m=r(252),y=r(253),g=r(13).identity,v=r(13).indexBy,b=r(13).flatMap;e.exports={mapEntities:a}},function(e,t,r){"use strict";function i(e){return e.payload&&(e.properties=e.payload,delete e.payload),e}function n(e){return e=i(e),({material:a}[e.type]||o)(e)}function a(e){return e.properties&&e.properties.properties&&(s(e.properties.properties,function(t,r){e.properties[r]=t}),delete e.properties.properties),e}var o=r(13).identity,s=r(13).each;e.exports={mapToV2Entity:n}},function(e,t,r){"use strict";function i(e){var t=e.split(new RegExp(/\\|\//));return 0===t.length?e:t[t.length-1]}function n(e){return e.name&&(e.sid=e.name,e.properties||(e.properties={}),e.properties.name=e.name,delete e.name),e}function a(e){return e=n(e),({texture2D:o}[e.type]||u)(e)}function o(e){var t=i(e.properties.filename),r={type:"document",id:s.v4(),sid:t,properties:{name:t,filename:e.properties.filename}};return e.properties.imageId=r.id+"#"+t,delete e.properties.filename,[e,r]}var s=r(19),u=r(13).identity;e.exports={mapToV3Entity:a}},function(e,t,r){"use strict";function i(e){return({meshGeometry:n}[e.type]||o)(e)}function n(e){var t={type:"buffer",id:a.v4(),sid:e.sid+"-buffer",properties:{name:e.sid+"-buffer",src:"geometry.bin",accessors:{}}};return s(e.properties.attributes,function(e,r){t.properties.accessors[r]={type:e.type,componentType:e.componentType,byteOffset:e.byteOffset,byteStride:0,count:e.count},e.accessorId=t.id+"#"+r,delete e.type,delete e.componentType,delete e.byteOffset,delete e.byteStride,delete e.count}),t.properties.accessors.indices={type:e.properties.indices.type,componentType:e.properties.indices.componentType,byteOffset:e.properties.indices.byteOffset,byteStride:0,count:e.properties.indices.count},e.properties.indices=t.id+"#indices",[e,t]}var a=r(19),o=r(13).identity,s=r(13).each;e.exports={mapToV4Entity:i}},function(e,t,r){"use strict";function i(e,t){return({image:n}[e.type]||a)(e,t)}function n(e,t){return t.minor<3&&e.hasOwnProperty("representations")&&(e.representations=e.representations.filter(function(e){return e.width<=4096&&e.height<=4096})),e}var a=r(13).identity;e.exports={mapToV5Entity:i}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,r){var i=r(201)("unscopables"),n=Array.prototype;void 0==n[i]&&r(76)(n,i,{}),e.exports=function(e){n[i][e]=!0}},function(e,t,r){var i=r(51);e.exports=function(e){if(!i(e))throw TypeError(e+" is not an object!");return e}},function(e,t,r){var i=r(198),n=r(264),a=r(272),o=r(271),s=r(259);e.exports=function(e,t){var r=1==e,u=2==e,p=3==e,c=4==e,h=6==e,l=5==e||h,d=t||s;return function(t,s,f){for(var m,y,g=a(t),v=n(g),b=i(s,f,3),x=o(v.length),P=0,w=r?d(t,x):u?d(t,0):void 0;x>P;P++)if((l||P in v)&&(m=v[P],y=b(m,P,g),e))if(r)w[P]=y;else if(y)switch(e){case 3:return!0;case 5:return m;case 6:return P;case 2:w.push(m)}else if(c)return!1;return h?-1:p||c?c:w}}},function(e,t,r){var i=r(51),n=r(265),a=r(201)("species");e.exports=function(e){var t;return n(e)&&(t=e.constructor,"function"!=typeof t||t!==Array&&!n(t.prototype)||(t=void 0),i(t)&&null===(t=t[a])&&(t=void 0)),void 0===t?Array:t}},function(e,t,r){var i=r(258);e.exports=function(e,t){return new(i(e))(t)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,r){var i=r(51),n=r(34).document,a=i(n)&&i(n.createElement);e.exports=function(e){return a?n.createElement(e):{}}},function(e,t){var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t,r){e.exports=!r(74)&&!r(199)(function(){return 7!=Object.defineProperty(r(261)("div"),"a",{get:function(){return 7}}).a})},function(e,t,r){var i=r(197);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==i(e)?e.split(""):Object(e)}},function(e,t,r){var i=r(197);e.exports=Array.isArray||function(e){return"Array"==i(e)}},function(e,t,r){var i=r(256),n=r(263),a=r(273),o=Object.defineProperty;t.f=r(74)?Object.defineProperty:function(e,t,r){if(i(e),t=a(t,!0),i(r),n)try{return o(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,r){var i=r(34),n=r(76),a=r(262),o=r(200)("src"),s=Function.toString,u=(""+s).split("toString");r(33).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,r,s){var p="function"==typeof r;p&&(a(r,"name")||n(r,"name",t)),e[t]!==r&&(p&&(a(r,o)||n(r,o,e[t]?""+e[t]:u.join(String(t)))),e===i?e[t]=r:s?e[t]?e[t]=r:n(e,t,r):(delete e[t],n(e,t,r)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[o]||s.call(this)})},function(e,t,r){var i=r(34),n=i["__core-js_shared__"]||(i["__core-js_shared__"]={});e.exports=function(e){return n[e]||(n[e]={})}},function(e,t){var r=Math.ceil,i=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?i:r)(e)}},function(e,t,r){var i=r(270),n=Math.min;e.exports=function(e){return e>0?n(i(e),9007199254740991):0}},function(e,t,r){var i=r(260);e.exports=function(e){return Object(i(e))}},function(e,t,r){var i=r(51);e.exports=function(e,t){if(!i(e))return e;var r,n;if(t&&"function"==typeof(r=e.toString)&&!i(n=r.call(e)))return n;if("function"==typeof(r=e.valueOf)&&!i(n=r.call(e)))return n;if(!t&&"function"==typeof(r=e.toString)&&!i(n=r.call(e)))return n;throw TypeError("Can't convert object to primitive value")}},function(e,t,r){"use strict";var i=r(75),n=r(257)(5),a=!0;"find"in[]&&Array(1).find(function(){a=!1}),i(i.P+i.F*a,"Array",{find:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}}),r(255)("find")},function(e,t,r){var i=r(75);i(i.S,"Math",{log10:function(e){return Math.log(e)*Math.LOG10E}})},function(e,t,r){var i=r(75);i(i.S,"Math",{log2:function(e){return Math.log(e)/Math.LN2}})},function(e,t,r){var i,n;(function(a,o){"use strict";i=o,void 0!==(n="function"==typeof i?i.call(t,r,t,e):i)&&(e.exports=n)})(0,function(){"use strict";function e(e){return typeof console!==s&&(void 0!==console[e]?t(console,e):void 0!==console.log?t(console,"log"):o)}function t(e,t){var r=e[t];if("function"==typeof r.bind)return r.bind(e);try{return Function.prototype.bind.call(r,e)}catch(t){return function(){return Function.prototype.apply.apply(r,[e,arguments])}}}function r(e,t,r){return function(){typeof console!==s&&(i.call(this,t,r),this[e].apply(this,arguments))}}function i(e,t){for(var r=0;r=0&&t<=c.levels.SILENT))throw"log.setLevel() called with invalid level: "+t;if(p=t,!1!==r&&a(t),i.call(c,t,e),typeof console===s&&to+1e3&&(u.update(1e3*s/(e-o),100),o=e,s=0,c)){var t=performance.memory;c.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){a=this.end()},domElement:n,setMode:r}};return e.Panel=function(e,t,r){var i=1/0,n=0,a=Math.round,o=a(window.devicePixelRatio||1),s=80*o,u=48*o,p=3*o,c=2*o,h=3*o,l=15*o,d=74*o,f=30*o,m=document.createElement("canvas");m.width=s,m.height=u,m.style.cssText="width:80px;height:48px";var y=m.getContext("2d");return y.font="bold "+9*o+"px Helvetica,Arial,sans-serif",y.textBaseline="top",y.fillStyle=r,y.fillRect(0,0,s,u),y.fillStyle=t,y.fillText(e,p,c),y.fillRect(h,l,d,f),y.fillStyle=r,y.globalAlpha=.9,y.fillRect(h,l,d,f),{dom:m,update:function(u,g){i=Math.min(i,u),n=Math.max(n,u),y.fillStyle=r,y.globalAlpha=1,y.fillRect(0,0,s,l),y.fillStyle=t,y.fillText(a(u)+" "+e+" ("+a(i)+"-"+a(n)+")",p,c),y.drawImage(m,h+o,l,d-o,f,h,l,d-o,f),y.fillRect(h+d-o,l,o,f),y.fillStyle=r,y.globalAlpha=.9,y.fillRect(h+d-o,l,o,a((1-u/g)*f))}}},e})},function(e,t,r){function i(e,t,r){var i=t&&r||0,n=t||[];e=e||{};var o=void 0!==e.clockseq?e.clockseq:u,h=void 0!==e.msecs?e.msecs:(new Date).getTime(),l=void 0!==e.nsecs?e.nsecs:c+1,d=h-p+(l-c)/1e4;if(d<0&&void 0===e.clockseq&&(o=o+1&16383),(d<0||h>p)&&void 0===e.nsecs&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");p=h,c=l,u=o,h+=122192928e5;var f=(1e4*(268435455&h)+l)%4294967296;n[i++]=f>>>24&255,n[i++]=f>>>16&255,n[i++]=f>>>8&255,n[i++]=255&f;var m=h/4294967296*1e4&268435455;n[i++]=m>>>8&255,n[i++]=255&m,n[i++]=m>>>24&15|16,n[i++]=m>>>16&255,n[i++]=o>>>8|128,n[i++]=255&o;for(var y=e.node||s,g=0;g<6;++g)n[i+g]=y[g];return t||a(n)}var n=r(203),a=r(202),o=n(),s=[1|o[0],o[1],o[2],o[3],o[4],o[5]],u=16383&(o[6]<<8|o[7]),p=0,c=0;e.exports=i},function(e,t,r){function i(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"==e?new Array(16):null,e=null),e=e||{};var o=e.random||(e.rng||n)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var s=0;s<16;++s)t[i+s]=o[s];return t||a(o)}var n=r(203),a=r(202);e.exports=i}])}); +(function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("THREE")):"function"==typeof define&&define.amd?define("Box3D",["THREE"],t):"object"==typeof exports?exports.Box3D=t(require("THREE")):e.Box3D=t(e.THREE)})(this,function(e){return function(e){function t(i){if(r[i])return r[i].exports;var n=r[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,i){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=243)}([function(e,t,r){"use strict";function i(e,t){function r(){this.constructor=e}v(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function n(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,i=Object.getOwnPropertySymbols(e);n=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,r,o):n(t,r))||o);return a>3&&o&&Object.defineProperty(t,r,o),o}function o(e,t){return function(r,i){t(r,i,e)}}function s(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t,r,i){return new(r||(r=Promise))(function(n,a){function o(e){try{u(i.next(e))}catch(e){a(e)}}function s(e){try{u(i.throw(e))}catch(e){a(e)}}function u(e){e.done?n(e.value):new r(function(t){t(e.value)}).then(o,s)}u((i=i.apply(e,t||[])).next())})}function p(e,t){function r(e){return function(t){return i([e,t])}}function i(r){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,a&&(o=a[2&r[0]?"return":r[0]?"throw":"next"])&&!(o=o.call(a,r[1])).done)return o;switch(a=0,o&&(r=[0,o.value]),r[0]){case 0:case 1:o=r;break;case 4:return u.label++,{value:r[1],done:!1};case 5:u.label++,a=r[1],r=[0];continue;case 7:r=u.ops.pop(),u.trys.pop();continue;default:if(o=u.trys,!(o=o.length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){u=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}function l(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o}function d(){for(var e=[],t=0;t1||n(e,t)})})}function n(e,t){try{a(c[e](t))}catch(e){u(h[0][3],e)}}function a(e){e.value instanceof f?Promise.resolve(e.value.v).then(o,s):u(h[0][2],e)}function o(e){n("next",e)}function s(e){n("throw",e)}function u(e,t){e(t),h.shift(),h.length&&n(h[0][0],h[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var p,c=r.apply(e,t||[]),h=[];return p={},i("next"),i("throw"),i("return"),p[Symbol.asyncIterator]=function(){return this},p}function y(e){function t(t,n){e[t]&&(r[t]=function(r){return(i=!i)?{value:f(e[t](r)),done:"return"===t}:n?n(r):r})}var r,i;return r={},t("next"),t("throw",function(e){throw e}),t("return"),r[Symbol.iterator]=function(){return this},r}function g(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator];return t?t.call(e):"function"==typeof h?h(e):e[Symbol.iterator]()}Object.defineProperty(t,"__esModule",{value:!0}),t.__extends=i,r.d(t,"__assign",function(){return b}),t.__rest=n,t.__decorate=a,t.__param=o,t.__metadata=s,t.__awaiter=u,t.__generator=p,t.__exportStar=c,t.__values=h,t.__read=l,t.__spread=d,t.__await=f,t.__asyncGenerator=m,t.__asyncDelegator=y,t.__asyncValues=g;var v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},b=Object.assign||function(e){for(var t,r=1,i=arguments.length;r=e&&(t.engine.off("update",i,t),t.trigger("endTimer"))};this.engine.on("update",i,this)},t.events={load:{parameters:[],action:!1,category:"Loading"},loadBase:{parameters:[],action:!1,category:"Loading"},loadDependencies:{parameters:[],action:!1,category:"Loading"},startTimer:{parameters:[{name:"time",description:"The time (in seconds) that will elapse before the 'endTimer' event will be fired.",type:"f",default:5}],action:!0,category:"General"},endTimer:{parameters:[],action:!1,category:"General"}},t.validators={},t.defaults={},t.schema={},t}(t.baseEntityMixins);t.default=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(9),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.initialize=function(){e.prototype.initialize.call(this),this.on("setVisible",this.setVisible,this),this.on("setInvisible",this.setInvisible,this),this.on("toggleVisibility",this.toggleVisibility,this),this.on("change:children",this.onChildrenChanged,this)},t.prototype.uninitialize=function(){this.off("setVisible",this.setVisible,this),this.off("setInvisible",this.setInvisible,this),this.off("toggleVisibility",this.toggleVisibility,this),this.off("change:children",this.onChildrenChanged,this),this.uninitPrefabBindings(),e.prototype.uninitialize.call(this)},t.prototype.getRootObject=function(){var e=this.getParentObject();return e?e.getRootObject():this},t.prototype.reset=function(){this.runtimeData&&(this.runtimeData.position.copy(this.getPosition()),this.runtimeData.quaternion.copy(this.getQuaternion()),this.runtimeData.scale.copy(this.getScale()))},t.prototype.createRuntimeData=function(e){this.runtimeData=new a.Object3D,this.runtimeData.name=this.getRuntimeName(),e()},t.prototype.clone=function(t,r){void 0===r&&(r=!0);var i=e.prototype.clone.call(this,t);if(i.set("parentId",null),i.set("prefabAssetId",this.get("prefabAssetId")),i.set("prefabObjectId",this.get("prefabObjectId")),r){this.getChildren().forEach(function(e){var t=e.clone(void 0,r);i.addChild(t)}),this.isInstanceTop()&&i.traverse(function(e){e.set("prefabInstanceId",i.id)})}return i},t.prototype.alignToPosition=function(e,t){var r=new a.Vector3(e.x||0,e.y||0,e.z||0),n=this.getQuaternion(),o=this.getScale(),s=this.getCenter(),u=new a.Quaternion(n.x,n.y,n.z,n.w),p=this.getBounds(),c={};c.min=new a.Vector3(p.min.x,p.min.y,p.min.z),c.max=new a.Vector3(p.max.x,p.max.y,p.max.z),(c.min.x>c.max.x||c.min.y>c.max.y||c.min.z>c.max.z)&&(c.min.x=c.min.y=c.min.z=0,c.max.x=c.max.y=c.max.z=0),c.min.applyQuaternion(u),c.max.applyQuaternion(u);var h=new a.Vector3(s.x,s.y,s.z);h.applyQuaternion(u),c.min.multiply(o),c.max.multiply(o),h.multiply(o),t&&Object.keys(t).forEach(function(e){var i=Math.min(c.min[e],c.max[e]),n=Math.max(c.min[e],c.max[e]),a=.5*t[e]+.5;r[e]-=(1-a)*i+a*n}),this.setProperty("position",i.__assign({},r))},t.prototype.getPosition=function(e){var t=e||new a.Vector3;return t.copy(this.getProperty("position")),t},t.prototype.setPosition=function(e,t,r){if(void 0===r)throw new Error("Calling setPosition with invalid arguments. Expected setPosition( x, y, z ).");this.setProperty("position",{x:e,y:t,z:r})},t.prototype.getQuaternion=function(e){var t=e||new a.Quaternion;return t.copy(this.getProperty("quaternion")),t},t.prototype.setQuaternion=function(e,t,r,i){if(void 0===i)throw new Error("Calling setQuaternion with invalid arguments. Expected setQuaternion( x, y, z, w ).");this.setProperty("quaternion",{x:e,y:t,z:r,w:i})},t.prototype.getScale=function(e){var t=e||new a.Vector3;return t.copy(this.getProperty("scale")),t},t.prototype.setScale=function(e,t,r){if(void 0===r)throw new Error("Calling setScale with invalid arguments. Expected setScale( x, y, z ).");this.setProperty("scale",{x:e,y:t,z:r})},t.prototype.getCenter=function(e){var t=e||new a.Vector3,r=this.getBounds();return t.copy(r.min),t.add(r.max),t.multiplyScalar(.5),t},t.prototype.setVisible=function(){this.setProperty("visible",!0),this.engine.needsRender=!0},t.prototype.setInvisible=function(){this.setProperty("visible",!1),this.engine.needsRender=!0},t.prototype.toggleVisibility=function(){var e=!this.getProperty("visible");this.setProperty("visible",e),this.engine.needsRender=!0},t.prototype.loadBase=function(t){e.prototype.loadBase.call(this,t),this.isInstance()&&this.initPrefabBindings()},t.prototype.reloadBase=function(t){var r=this;this.isInstance()&&this.uninitPrefabBindings();var i=this.runtimeData&&this.runtimeData.parent;i&&i.remove(this.runtimeData);var n=this.runtimeData&&this.runtimeData.children;e.prototype.reloadBase.call(this,function(){i&&i.add(r.runtimeData),n&&n.forEach(function(e){return r.runtimeData.add(e)}),"function"==typeof t&&t()})},t.prototype.unload=function(t){var r=this;if(void 0===t&&(t=!1),this.runtimeData&&this.runtimeData.parent&&this.runtimeData.parent.remove(this.runtimeData),t){this.getChildIds().forEach(function(e){var i=r.engine.getObjectById(e);i&&i.unload(t)})}e.prototype.unload.call(this)},t.prototype.destroy=function(){this.engine.destroyObjectById(this.id)},t.prototype.traverse=function(e){e(this,this.getParentObject()),this.getChildren().forEach(function(t){return t.traverse(e)})},t.prototype.traverseWhile=function(e){return!!e(this,this.getParentObject())||this.getChildren().some(function(t){return t.traverseWhile(e)})},t.prototype.traverseSome=function(e){e(this,this.getParentObject())||this.getChildren().forEach(function(t){return t.traverseSome(e)})},t.prototype.getAncestors=function(e){var t=this.getParentObject();return t?e&&!e(t)?t.getAncestors(e):[t].concat(t.getAncestors(e)):[]},t.prototype.getDescendants=function(e){var t=this,r=[],i="function"!=typeof e;return this.traverse(function(n){n!==t&&(i||e(n))&&r.push(n)}),r},t.prototype.getDescendant=function(e){var t,r=this,i="function"!=typeof e;return this.traverseWhile(function(n){if(n!==r&&!t&&(i||e(n)))return t=n,!0}),t},t.prototype.getDescendantById=function(e){return this.getDescendant(function(t){return t.id===e})},t.prototype.getDescendantByName=function(e){return this.getDescendant(function(t){return t.getName()===e})},t.prototype.getDescendantByType=function(e){return this.getDescendant(function(t){return t.type===e})},t.prototype.getDescendantByClass=function(e){return this.getDescendant(function(t){return t instanceof e})},t.prototype.getDescendantsByType=function(e){return this.getDescendants(function(t){return t.type===e})},t.prototype.getDescendantsByClass=function(e){return this.getDescendants(function(t){return t instanceof e})},t.prototype.getDescendantsByName=function(e){return this.getDescendants(function(t){return t.getName()===e})},t.prototype.getChildById=function(e){return-1!==this.sharedData.children.indexOf(e)?this.engine.getObjectById(e):null},t.prototype.getChild=function(e){var t=this.getChildren(e);return t.length?t[0]:null},t.prototype.getChildren=function(e){var t=this,r="function"!=typeof e;return this.getChildIds().filter(function(i){var n=t.getChildById(i);return n&&(r||e(n))}).map(function(e){return t.engine.getObjectById(e)})},t.prototype.getChildrenMap=function(e){var t={};return this.getChildren(e).forEach(function(e){e&&(t[e.id]=e)}),t},t.prototype.getParentObject=function(){return this.engine.getObjectById(this.get("parentId"))},t.prototype.addChild=function(e,t){this.addChildById(e.id,t)},t.prototype.addChildById=function(e,t){if(!this.engine.getObjectById(e))throw new Error("Can't find child object with id, "+e);this.engine.entityDispatcher.dispatchChildAdded(this.id,e,t)},t.prototype.removeChild=function(e,t){this.removeChildById(e.id,t)},t.prototype.removeChildById=function(e,t){if(!this.getChildById(e))return void n.default.warn("Object, "+e+", is not a child of this object");this.engine.entityDispatcher.dispatchChildRemoved(this.id,e,t)},t.prototype.getChildIds=function(e){return"function"!=typeof e?this.sharedData.children.slice():this.sharedData.children.filter(function(t){return e(t)})},t.prototype.setChildIds=function(e,t){void 0===t&&(t=!1),this.engine.entityDispatcher.dispatchChildChanged(this.id,e,t)},t.prototype.scaleToSize=function(e){var t={},r=this.getBounds();t.min=new a.Vector3(r.min.x,r.min.y,r.min.z),t.max=new a.Vector3(r.max.x,r.max.y,r.max.z);var i=t.min.x>t.max.x||t.min.y>t.max.y||t.min.z>t.max.z,n=t.min.distanceTo(t.max),o=n>0?e/n:1;(o<=0||i)&&(o=1),this.setProperty("scale",{x:o,y:o,z:o})},t.prototype.getBounds=function(e){var t=this.getProperty("bounds"),r=e||new a.Box3;return t?r.set(t.min,t.max):this.computeBounds(r)},t.prototype.getSphericalBounds=function(e){var t=e||new a.Sphere,r=this.getBounds();return t.radius=t.center.subVectors(r.max,r.min).multiplyScalar(.5).length(),t.center.addVectors(r.max,r.min).multiplyScalar(.5),t},t.prototype.getLocalBounds=function(e){var t=e||new a.Box3;return t.min.set(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),t.max.set(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),t},t.prototype.computeBounds=function(e){var t=this.getChildren(),r=this.getLocalBounds(e||new a.Box3),i=new a.Matrix4;return t.forEach(function(e){var t=e.computeBounds();t.isEmpty()||(i.compose(e.getPosition(),e.getQuaternion(),e.getScale()),t.applyMatrix4(i),r.union(t))}),this.setProperty("bounds",{min:{x:r.min.x,y:r.min.y,z:r.min.z},max:{x:r.max.x,y:r.max.y,z:r.max.z}}),r},t.prototype.getPreviousProperty=function(e){if(this.computePropertyFunctions[e]){var t=this.sharedData.previousProperties[e],r=void 0;return r=this.getPrefabObject()?this.getPrefabProperty(e):this.getDefaultProperty(e),this.computePropertyFunctions[e](t,r)}var i=this.sharedData.previousProperties[e];if(void 0!==i)return i;var n=this.getPrefabObject();return n?n.getProperty(e):this.getDefaultProperty(e)},t.prototype.getProperty=function(e){var t=this.getOwnProperty(e);if(this.computePropertyFunctions[e]){var r=void 0;return r=this.getPrefabObject()?this.getPrefabProperty(e):this.getDefaultProperty(e),this.computePropertyFunctions[e](t,r)}if(void 0!==t)return t;var i=this.getPrefabProperty(e);return i||this.getDefaultProperty(e)},t.prototype.getProperties=function(){var e=this,t=this.getDefaultProperties(),r={};return Object.keys(t).forEach(function(t){r[t]=e.getProperty(t)}),r},t.prototype.getInstanceTop=function(){var e=this.get("prefabInstanceId");return e?this.engine.getObjectById(e):null},t.prototype.getPrefabObject=function(){return this.engine.getObjectById(this.get("prefabObjectId"))},t.prototype.getPrefabProperty=function(e){var t=this.getPrefabObject();if(t)return t.getProperty(e)},t.prototype.isInstance=function(){return!!this.get("prefabObjectId")},t.prototype.isInstanceTop=function(){return this.get("prefabInstanceId")===this.id},t.prototype.breakPrefabLink=function(e){if(void 0===e&&(e=!0),!this.isInstance())throw new Error("breakPrefabLink: Can't call this on an entity that isn't an instance.");e&&this.getChildren().forEach(function(t){t.breakPrefabLink(e)}),this.uninitPrefabBindings(),this.mergeProperties(this.getPrefabObject());var t={};t.prefabInstanceId=void 0,t.prefabObjectId=void 0,t.prefabAssetId=void 0},t.prototype.applyPropertiesLoaded=function(t,r){if(e.prototype.applyPropertiesLoaded.call(this,t,r),t.hasOwnProperty("static")){var i=this.getProperty("static");this.runtimeData.matrixAutoUpdate=!i,this.runtimeData.rotationAutoUpdate=!i,i&&(this.runtimeData.matrixWorldNeedsUpdate=!0,this.runtimeData.updateMatrix())}if(t.hasOwnProperty("visible")&&(this.runtimeData.visible=this.getProperty("visible")),t.hasOwnProperty("castShadow")&&(this.runtimeData.castShadow=this.getProperty("castShadow")),t.hasOwnProperty("receiveShadow")&&(this.runtimeData.receiveShadow=this.getProperty("receiveShadow")),t.hasOwnProperty("frustumCulled")&&(this.runtimeData.frustumCulled=this.getProperty("frustumCulled")),t.hasOwnProperty("position")){var n=this.getPosition();this.runtimeData.position.set(n.x,n.y,n.z)}if(t.hasOwnProperty("quaternion")){var a=this.getQuaternion();this.runtimeData.quaternion.set(a.x,a.y,a.z,a.w)}if(t.hasOwnProperty("scale")){var o=this.getScale();this.runtimeData.scale.set(o.x,o.y,o.z)}this.engine.needsRender=!0},t.prototype.getRuntimeName=function(){return this.engine.getRuntimeName(this.getSid())},t.prototype.initPrefabBindings=function(){var e=this.getPrefabObject();e&&e.on("change:properties",this.onPrefabEntityChanged,this)},t.prototype.uninitPrefabBindings=function(){var e=this.getPrefabObject();e&&e.off("change:properties",this.onPrefabEntityChanged,this)},t.prototype.onPrefabEntityChanged=function(){n.default.warn("TODO - re-implement updating from prefab changes")},t.prototype.onChildLoaded=function(e){var t=this;this.when("loadBase",function(){t.runtimeData.add(e.runtimeData),t.engine.needsRender=!0})},t.prototype.onChildrenChanged=function(e,t){var r=this;t.forEach(function(e){e&&(e.set("parentId",null),r.unregisterDependency(e),r.stopListening(e,"loadBase",r.onChildLoaded),r.isBaseLoaded()&&e.isBaseLoaded()&&(r.runtimeData.remove(e.runtimeData),r.engine.needsRender=!0))}),e.forEach(function(e){var t=e.getParentObject();t&&t.id!==r.id&&t.removeChildById(e.id,!0),e.set("parentId",r.id),r.listenTo(e,"loadBase",r.onChildLoaded),e.isBaseLoaded()&&(r.isBaseLoaded()?(r.runtimeData.add(e.runtimeData),r.engine.needsRender=!0):r.when("loadBase",function(){r.runtimeData.add(e.runtimeData),r.engine.needsRender=!0})),r.registerDependency(e)}),this.unsetProperty("bounds"),this.getAncestors().forEach(function(e){return e.unsetProperty("bounds")})},t.events={toggleVisibility:{parameters:[],action:!0,category:"Rendering"},setVisible:{parameters:[],action:!0,category:"Rendering"},setInvisible:{parameters:[],action:!0,category:"Rendering"}},t}(o.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={LOAD:"load",STATE_CHANGE:"state_change",CANCEL:"cancel",ERROR:"error",PROGRESS:"progress",DONE:"done"};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(6),o=r(3);(function(e){e[e.Normal=101]="Normal",e[e.Stereo2dOverUnder=102]="Stereo2dOverUnder",e[e.Stereo2dUnderOver=103]="Stereo2dUnderOver",e[e.Stereo2dLeftRight=104]="Stereo2dLeftRight",e[e.Stereo2dRightLeft=105]="Stereo2dRightLeft",e[e.StereoCubeHorizontal=106]="StereoCubeHorizontal"})(t.ImageLayout||(t.ImageLayout={}));var s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.loadedBytes=0,t}return i.__extends(t,e),t.getThreeImageFormat=function(e){switch(e){case"alpha":return n.AlphaFormat;case"rgb":return n.RGBFormat;case"rgba":return n.RGBAFormat;case"luminance":return n.LuminanceFormat;case"luminanceAlpha":return n.LuminanceAlphaFormat;default:return o.default.warn("Unexpected format: "+e+", defaulting to THREE.RGBFormat"),n.RGBFormat}},t.getThreeImageEncoding=function(e){switch(e){case"linear":return n.LinearEncoding;case"srgb":return n.sRGBEncoding;case"gamma":return n.GammaEncoding;case"rgbe":return n.RGBEEncoding;case"logLuv":return n.LogLuvEncoding;case"rgbm7":return n.RGBM7Encoding;case"rgbm16":return n.RGBM16Encoding;case"rgbd":return n.RGBDEncoding;case"depth":return n.BasicDepthPacking;case"rgbaDepth":return n.RGBADepthPacking;default:return o.default.warn("Unexpected format: "+e+", defaulting to THREE.sRGBEncoding"),n.sRGBEncoding}},t.getThreeDataType=function(e){switch(e){case"uByte":return n.UnsignedByteType;case"byte":return n.ByteType;case"short":return n.ShortType;case"uShort":return n.UnsignedShortType;case"int":return n.IntType;case"uInt":return n.UnsignedIntType;case"float":return n.FloatType;case"halfFloat":return n.HalfFloatType;case"uShort4444":return n.UnsignedShort4444Type;case"uShort5551":return n.UnsignedShort5551Type;case"uShort565":return n.UnsignedShort565Type;default:return o.default.warn("Unexpected format: "+e+", defaulting to THREE.UnsignedByteType"),n.UnsignedByteType}},t.getChannelCountFromFormat=function(e){switch(e){case"alpha":case"luminance":return 1;case"luminanceAlpha":return 2;case"rgb":return 3;case"rgba":return 4;default:return 0}},t.prototype.unload=function(){this.loadedBytes=0,e.prototype.unload.call(this)},t.prototype.getChosenRepresentation=function(){return this.chosenRepresentation},t.prototype.getDataSizeLoadedSelf=function(){return this.loadedBytes},t.prototype.applyPropertiesUnloaded=function(t){void 0===t&&(t={}),e.prototype.applyPropertiesUnloaded.call(this,t),this.engine.trigger("imageChanged",this.id,t)},t.prototype.getDataSizeDownloadSelf=function(){return this.chosenRepresentation?this.chosenRepresentation.contentLength:1},t.prototype.getFormat=function(){return"rgb"},t.prototype.isPowerOfTwo=function(){var e=this.getWidth(),t=this.getHeight();return n.Math.isPowerOfTwo(e)&&n.Math.isPowerOfTwo(t)},t.prototype.getWidth=function(){var e=this.getMaxRepresentationWidth(),t=this.getMaxTextureSize();return Math.max(1,Math.min(t,e))},t.prototype.getHeight=function(){var e=this.getMaxRepresentationHeight(),t=this.getMaxTextureSize();return Math.max(1,Math.min(t,e))},t.prototype.getMaxRepresentationWidth=function(){return 0},t.prototype.getMaxRepresentationHeight=function(){return 0},t.prototype.getOriginalWidth=function(){return 0},t.prototype.getOriginalHeight=function(){return 0},t.prototype.getMaxTextureSize=function(){return Number.MAX_VALUE},t}(a.default);t.default=s},function(e,t,r){"use strict";function i(e,t){if(void 0!==e&&null!==e)return Array.isArray(e)?e.forEach(t):void Object.keys(e).forEach(function(r){t(e[r],r)})}function n(e){return Array.isArray(e)?[].concat.apply([],e.map(function(e){return n(e)})):e}function a(e,t){return e.reduce(function(e,r){return e[r[t]]=r,e},{})}function o(e,t){return n(u(e,t))}function s(e){return e}function u(e,t){var r;return void 0===e||null===e?e:Array.isArray(e)?e.map(t):(r={},Object.keys(e).forEach(function(i){r[i]=t(e[i],i)}),r)}function p(e,t){return Object.keys(e).reduce(function(r,i){return-1===t.indexOf(i)&&(r[i]=e[i]),r},{})}e.exports={each:i,flatMap:o,flatten:n,identity:s,indexBy:a,map:u,omit:p}},function(e,t,r){"use strict";function i(e,t){var r=Math.floor(e);return t||{r:(r>>16&255)/255,g:(r>>8&255)/255,b:(255&r)/255}}Object.defineProperty(t,"__esModule",{value:!0});var n,a=r(0),o=r(3),s=r(1),u=r(6),p=r(5),c=r(4),h=r(238);(function(e){e[e.STANDIN_TEXTURE_WHITE=0]="STANDIN_TEXTURE_WHITE",e[e.STANDIN_TEXTURE_WHITE_CUBE=1]="STANDIN_TEXTURE_WHITE_CUBE",e[e.STANDIN_TEXTURE_BLACK=2]="STANDIN_TEXTURE_BLACK",e[e.STANDIN_TEXTURE_BLACK_CUBE=3]="STANDIN_TEXTURE_BLACK_CUBE",e[e.STANDIN_TEXTURE_NORMAL=4]="STANDIN_TEXTURE_NORMAL"})(n=t.StandInTexture||(t.StandInTexture={}));var l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a.__extends(t,e),t.prototype.initialize=function(){e.prototype.initialize.call(this),this.listenTo(this.engine,"textureDeleted",this.onTextureDeleted)},t.prototype.uninitialize=function(){e.prototype.uninitialize.call(this),this.stopListening(this.engine,"textureDeleted",this.onTextureDeleted)},t.prototype.getProperty=function(t){var r=e.prototype.getProperty.call(this,t);if(void 0===r){var i=this.getShader().getProperty("parameters");i[t]&&(r=i[t].default)}return r},t.prototype.getDefaultProperties=function(){var t=e.prototype.getDefaultProperties.call(this),r=this.getShader().getProperty("parameters");return Object.keys(r).forEach(function(e){t[e]=r[e].default}),t},t.prototype.verifyProperty=function(r,i){return!t.schema.properties[r]||e.prototype.verifyProperty.call(this,r,i)},t.prototype.setProperty=function(r,n,a){if(t.schema.properties[r])return e.prototype.setProperty.call(this,r,n,a);var s=this.getShader(),u=s.getProperty("parameters");if(u[r]){var p,c=u[r].type;if("t"===c&&("string"==typeof n||null===n)||"f"===c&&"number"==typeof n||"b"===c&&"boolean"==typeof n||"i"===c&&"number"==typeof n&&Math.round(n)===n||"opt"===c&&u[r].options.hasOwnProperty(n))p=n;else if("c"===c){if(p=this.sharedData.properties.hasOwnProperty(r)&&"object"==typeof this.sharedData.properties[r]?this.sharedData.properties[r]:{r:0,g:0,b:0},"string"==typeof n){var h=n;"0x"!==h.slice(0,2)&&(h=String(parseInt(h,10)),h="0x"+h.toString()),i(parseInt(h,16),p)}else if("number"==typeof n){var l=Math.max(0,Math.max(16777215,n));i(l,p)}else if(n&&"number"==typeof n.r&&"number"==typeof n.g&&"number"==typeof n.b){p.r=n.r,p.g=n.g,p.b=n.b;var d=u[r].min,f=u[r].max;void 0!==d&&(p.r=Math.max(p.r,d),p.g=Math.max(p.g,d),p.b=Math.max(p.b,d)),void 0!==f&&(p.r=Math.min(p.r,f),p.g=Math.min(p.g,f),p.b=Math.min(p.b,f))}}else"v"===c.charAt(0)&&"number"==typeof n.x&&"number"==typeof n.y?(p=this.sharedData.properties.hasOwnProperty(r)?this.sharedData.properties[r]:{},p.x=n.x,p.y=n.y,"v3"===c&&"number"==typeof n.z?p.z=n.z:"v4"===c&&"number"==typeof n.z&&"number"==typeof n.w&&(p.z=n.z,p.w=n.w)):void 0===n?p=void 0:o.default.error("Wrong type specified for "+r);this.engine.entityDispatcher.dispatchPropertyChanged(this.id,r,p,a)}},t.prototype.getReferencedAssetsList=function(e){var t=this,r=[],i={},n=this.getShader(),a=n.getProperty("parameters");return p.forEach(a,function(n,a){var o,s;"t"===n.type&&(t.isParameterUsed(a)&&(o=t.getProperty(a)),o&&(s=t.engine.getAssetById(o),i[o]?e&&r.push(s):(i[o]=s,r.push(s))))}),r},t.prototype.getShader=function(){var t=e.prototype.getProperty.call(this,"shaderId");return this.engine.getAssetById(t)||(t=this.getDefaultProperty("shaderId")),this.engine.getAssetById(t)},t.prototype.isParameterEditable=function(e){var t=this.getShader();if(!t)return!1;var r=t.getProperty("parameters");return!!r[e]&&(!r[e].displayWhen||this.testParameterConditions(r[e].displayWhen))},t.prototype.getStandInTexture=function(e,t){var r=this.engine.getAssetById(this.getProperty(e));if(r){var i;return t?"normal"===t?i=n.STANDIN_TEXTURE_NORMAL:"bump"===t&&(i=r.isCubeMap()?n.STANDIN_TEXTURE_BLACK:n.STANDIN_TEXTURE_BLACK_CUBE):i=r.isCubeMap()?n.STANDIN_TEXTURE_WHITE_CUBE:n.STANDIN_TEXTURE_WHITE,this.engine.materialUtilities.getStandInTexture(i)}},t.prototype.unload=function(){var t=this;if(this.getDependencies().forEach(function(e){return t.stopListening(e,"load")}),this.runtimeData){this.engine.trigger("materialUnloaded",this.id),o.default.info(this.engine.getName()+" - Unloading material, "+this.getName());for(var r in this.runtimeData)this.runtimeData.hasOwnProperty(r)&&(this.runtimeData[r].dispose(),delete this.runtimeData[r]);this.runtimeData=null,e.prototype.unload.call(this)}},t.prototype.applyPropertiesLoaded=function(r,i){var n=this;if(e.prototype.applyPropertiesLoaded.call(this,r,i),r.hasOwnProperty("shaderId")){var a=this.getShader(),o=this.getPreviousProperty("shaderId");if(o!==a.id&&"init"!==i&&this.getThreeConstructor()!==this.getThreeConstructor(o))return void this.reloadBase();a.when("load",function(){p.forEach(t.materialObjectTypes,function(e,t){var r=n.runtimeData[t];r instanceof s.ShaderMaterial&&(r.vertexShader=a.runtimeData.vertexShader,r.fragmentShader=a.runtimeData.fragmentShader,r.uniforms=s.UniformsUtils.clone(a.runtimeData.uniforms),n.addSharedUniforms(r.uniforms)),r.needsUpdate=!0}),n.updateMaterialDefines(),n.updateShaderParameters(n.getProperties()),n.updateTransparency(),n.updateDerivatives(),n.engine.needsRender=!0}),a.isUnloaded()&&a.load()}else{var u=this.getShader(),c=u.getProperty("parameters"),h=!1,l=!1,d=!1;for(var f in r)if(r.hasOwnProperty(f)&&c[f]){if(c[f].transparency&&(h=!0),void 0!==c[f].derivatives&&(l=!0),u.getDependentParameters(f).length||c[f].forceUpdate){d=!0;break}this.updateShaderParameter(f)}d&&(this.updateMaterialDefines(),this.updateShaderParameters(this.getProperties()),h=!0,l=!0),h&&this.updateTransparency(),l&&this.updateDerivatives(),this.engine.needsRender=!0}},t.prototype.applyPropertiesUnloaded=function(t){var r=this;void 0===t&&(t={}),e.prototype.applyPropertiesUnloaded.call(this,t);var i,n,a=this.getShader(),o=a.getProperty("parameters"),s=!1;t&&(t.hasOwnProperty("shaderId")&&this.cleanShaderParameters(),p.forEach(t,function(e,t){o[t]&&("t"===o[t].type&&(i=r.getProperty(t),n=r.getPreviousProperty(t),r.isParameterUsed(t)?n!==i&&(r.registerDependencyById(i),r.unregisterDependencyById(n)):n!==i&&(s=!0)),(a.getDependentParameters(t).length||o[t].forceUpdate)&&(s=!0))}),s&&this.resetDependencies())},t.prototype.createRuntimeData=function(e){var r=this,i=this.getShader();i.when("load",function(){r.runtimeData={};var n={},a=r.getThreeConstructor();a===s.ShaderMaterial&&(n.vertexShader=i.runtimeData.vertexShader,n.fragmentShader=i.runtimeData.fragmentShader,n.uniforms=s.UniformsUtils.clone(i.runtimeData.uniforms),r.addSharedUniforms(n.uniforms)),Object.keys(t.materialObjectTypes).forEach(function(e){r.runtimeData[e]=new a(n),r.runtimeData[e].name=r.getName();var i=t.materialObjectTypes[e];p.forEach(i,function(t,i){r.runtimeData[e].hasOwnProperty(i)&&(r.runtimeData[e][i]=p.deepClone(t))})}),e()},this),i.isUnloaded()&&i.load()},t.prototype.getThreeConstructor=function(e){var t=e?this.engine.getAssetById(e):this.getShader();if(!t)throw new Error("Bad or unknown shader ID, "+e);t.isUnloaded()&&t.load();var r;switch(t.runtimeData.vertexShader){case"MeshStandardMaterial":r=s.MeshStandardMaterial;break;case"MeshPhysicalMaterial":r=s.MeshPhysicalMaterial;break;case"MeshPhongMaterial":r=s.MeshPhongMaterial;break;case"MeshLambertMaterial":r=s.MeshLambertMaterial;break;default:r=s.ShaderMaterial}return r},t.prototype.testParameterCondition=function(e,t){var r=this.getShader(),i=r.getProperty("parameters");if(!i[e])return!1;var n=this.getProperty(e);"t"===i[e].type&&(this.engine.getAssetById(n)||(n=null));for(var a in t)if(t.hasOwnProperty(a))switch(a){case"equals":if(!p.shallowEquals(n,t[a]))return!1;break;case"notEquals":if(p.shallowEquals(n,t[a]))return!1;break;case"equalsDefault":if(!p.shallowEquals(n,i[e].default))return!1;break;case"notEqualsDefault":if(p.shallowEquals(n,i[e].default))return!1;break;default:return!1}return!0},t.prototype.testParameterConditions=function(e){var t=!0;for(var r in e)if(e.hasOwnProperty(r))if("or"===r){if(!this.testParameterConditionsOr(e[r])){t=!1;break}}else if(!this.testParameterCondition(r,e[r])){t=!1;break}return t},t.prototype.testParameterConditionsOr=function(e){for(var t=!1,r=0,i=e;r1;if("NotFalsy"===t)return this.getProperty(e);if("HasAlpha"===t&&"t"===i[e].type){var n=this.engine.getAssetById(this.getProperty(e));return n&&"rgba"===n.getFormat()}}return!1},t.prototype.isParameterUsed=function(e){var t,r=this.getShader(),i=!1;if(r)return t=r.getProperty("parameters"),t[e]&&(i=!t[e].enabledWhen||this.testParameterConditions(t[e].enabledWhen)),i},t.prototype.onTextureLoaded=function(e){var r=this;if(!e.isLoadFailed()){var i=e.getThreeTexture();if(i){var n=this.getShader();if(n){var a=n.getProperty("parameters"),o=Object.keys(a).filter(function(t){return"t"===a[t].type&&r.isParameterUsed(t)&&r.getProperty(t)===e.id});o.forEach(function(e){r.setThreeValue(e,i)});o.some(function(e){return a[e].forceUpdate})&&Object.keys(t.materialObjectTypes).forEach(function(e){r.runtimeData[e].needsUpdate=!0}),this.engine.needsRender=!0}}}},t.prototype.updateShaderParameter=function(e){var r=this,i=this.getShader(),n=i.getProperty("parameters"),a=n[e];if(a){var o=!0,s=this.getProperty(e);switch(a.type.charAt(0)){case"t":var u=this.engine.getAssetById(s);if(u&&this.isParameterUsed(e)){var p=this.getPreviousProperty(e);if(p!==this.getProperty(e)){var c=this.engine.getEntityById(p);c&&this.stopListening(c,"loadBase",this.onTextureLoaded)}this.stopListening(u,"loadBase",this.onTextureLoaded),this.listenTo(u,"loadBase",this.onTextureLoaded),s=this.getStandInTexture(e,a.textureUsage),this.engine.needsRender=!0,u.isUnloaded()?u.load():u.isBaseLoaded()&&this.onTextureLoaded.call(this,u),u.isBaseLoaded()&&(o=!1)}else s=null;break;case"b":a.animation&&s&&(t.timeValueInUse=!0),s=s?1:0;break;case"v":a.animation&&(s.x||s.y||s.z||s.w)&&(t.timeValueInUse=!0);break;case"o":s=a.options[s]}o&&this.setThreeValue(e,s),a.forceUpdate&&Object.keys(t.materialObjectTypes).forEach(function(e){r.runtimeData[e].needsUpdate=!0})}},t.prototype.getThreeValue=function(e,t){var r,i=this.getShader(),n=i.getProperty("parameters"),a=n[e],o=a.uniformName||e;if(a.isRenderParam)r=this.runtimeData[t][o];else if(a.isUniform){var u=this.runtimeData[t].uniforms[o];r=u?u.value:null}if("c"===a.type)r||(r=new s.Color(a.default.r,a.default.g,a.default.b));else if("v"===a.type.charAt(0)&&!r){var p=a.default;switch(a.type.charAt(1)){case"4":r=new s.Vector4(p.x,p.y,p.z,p.w);break;case"3":r=new s.Vector3(p.x,p.y,p.z);break;case"2":r=new s.Vector2(p.x,p.y)}}return r},t.prototype.setThreeValue=function(e,r){var i=this;if(this.runtimeData){var n=this.getShader(),a=n.getProperty("parameters"),o=a[e],s=o.uniformName||e;Object.keys(t.materialObjectTypes).forEach(function(t){var n=i.getThreeValue(e,t);if("c"===o.type)n.setRGB(r.r,r.g,r.b);else if("b"===o.type)n=!!r;else if("v"===o.type.charAt(0))switch(o.type.charAt(1)){case"4":n.w=r.w;case"3":n.z=r.z;case"2":n.x=r.x,n.y=r.y}else"t"===o.type?(n&&r&&n.encoding===r.encoding&&n.mapping===r.mapping||(i.runtimeData[t].needsUpdate=!0),n=r):n=r;if(o.isUniform){var a=i.runtimeData[t].uniforms[s];if(!a)throw new Error("Trying to set non-existent uniform "+s);a.value=n}o.isRenderParam&&(i.runtimeData[t][s]=n)})}},t.prototype.setExtension=function(e,r){var i=this;this.runtimeData&&Object.keys(t.materialObjectTypes).forEach(function(t){i.runtimeData[t].extensions&&i.runtimeData[t].extensions.hasOwnProperty(e)&&(i.runtimeData[t].extensions[e]=r)})},t.prototype.onTextureDeleted=function(e){var t=this,r=this.getOwnProperties();Object.keys(r).filter(function(t){return r[t]===e}).forEach(function(e){t.setProperty(e,null)})},t.builtInAssetDescriptors={missingMaterial:{id:"missingMaterial",type:"material",properties:{name:"Missing Material",albedoColor:{r:.8275,g:.8275,b:.8275}}}},t.materialObjectTypes={static:{lights:!0,fog:!0,skinning:!1},skinned:{lights:!0,fog:!0,skinning:!0},staticTangents:{lights:!0,fog:!0,skinning:!1,defines:{USE_TANGENTS:!0}},skinnedTangents:{lights:!0,fog:!0,skinning:!0,defines:{USE_TANGENTS:!0}},depthStatic:{lights:!1,fog:!1,vertexColors:s.NoColors,skinning:!1,defines:{DEPTH_PASS:!0}},depthSkinned:{lights:!1,fog:!1,vertexColors:s.NoColors,skinning:!0,defines:{DEPTH_PASS:!0}}},t.sharedUniforms={time:{type:"f",value:0},screenDimensions:{type:"v4",value:new s.Vector4}},t.timeValueInUse=!1,t}(u.default);c.addSchemas("MaterialAsset",l),t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i;(function(e){e[e.BUFFER=1]="BUFFER",e[e.IMAGE=2]="IMAGE",e[e.VIDEO=3]="VIDEO",e[e.ENTITIES=4]="ENTITIES",e[e.JSON=5]="JSON"})(i||(i={})),t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(43),a=i.__assign({},n.default,{id:"baseObject",title:"BaseObjectDef",properties:i.__assign({},n.default.properties,{parentId:{type:"string",description:"The ID of the entity's parent."},prefabAssetId:{type:"string"},prefabObjectId:{type:"string"},prefabInstanceId:{type:"string"},children:{type:"array",items:{type:"string"},default:[],description:"The IDs of this entity's children."},previousChildren:{type:"array",items:{type:"string"},default:[],description:"The previous IDs of this entity's children."},properties:{$ref:"baseObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(44),a=i.__assign({},n.default,{id:"baseObjectProperties",title:"BaseObjectPropertiesDef",properties:i.__assign({},n.default.properties,{position:{$ref:"vector3.json",description:"The local-space position of the object.",default:{x:0,y:0,z:0}},quaternion:{$ref:"vector4.json",description:"The local-space orientation of the object.",default:{x:0,y:0,z:0,w:1}},scale:{$ref:"vector3.json",description:"The local-space scale of the object.",default:{x:1,y:1,z:1}},castShadow:{type:"boolean",description:"Controls whether this object casts a shadow.",default:!0},receiveShadow:{type:"boolean",description:"Controls whether casted shadows render on this object.",default:!0},visible:{type:"boolean",description:"Controls whether this object is visible or not.",default:!0},bounds:{$ref:"box3.json",description:"The local-space minimum and maximum extents of this object.#read-only"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){if("node"===e)return e;var t,r=e.match(/(edge(?=\/))\/?\s*(\d+)/i)||[],i=e.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return r.length&&(i=r),/trident/i.test(i[1])?(t=/\brv[ :]+(\d+)/g.exec(e)||[],"IE "+(t[1]||"")):"Chrome"===i[1]&&null!=(t=e.match(/\bOPR\/(\d+)/))?"Opera "+t[1]:(i=i[2]?[i[1],i[2]]:[navigator.appName,navigator.appVersion,"-?"],t=e.match(/version\/(\d+)/i),null!=t&&i.splice(1,1,t[1]),i.join(" "))},n={isMobile:void 0,isIOS:void 0,isAndroid:void 0,isMac:void 0,isLinux:void 0,isUnix:void 0,isWindows:void 0,isChrome:void 0,isFirefox:void 0,isSafari:void 0,isOpera:void 0,isEdge:void 0,isIpad:void 0,isNode:void 0,isIE:void 0,isIE11:void 0,isAndroidTablet:void 0,isTablet:void 0},a="undefined"!=typeof navigator?navigator.userAgent:"node",o=function(){var e=i(a),t={isMobile:/iphone|ipad|ipod|android|blackberry|bb10|mini|windows\sce|palm/i.test(a),isIOS:/iphone|ipad|ipod/i.test(a),isAndroid:/android/i.test(a),isMac:/mac/i.test(a),isLinux:/linux/i.test(a),isUnix:/x11/i.test(a),isWindows:/windows/i.test(a),isChrome:/chrome/i.test(a),isFirefox:/firefox/i.test(a),isSafari:/safari/i.test(a),isOpera:/opera/i.test(a),isEdge:/edge/i.test(a),isIpad:/ipad/i.test(a),isNode:"node"===a,isIE:/ie/i.test(e),isIE11:/ie 11/i.test(e)};t.isAndroidTablet=t.isAndroid&&!/mobile/i.test(a),t.isTablet=t.isIpad||t.isAndroidTablet,Object.keys(t).forEach(function(e){n[e]=t[e]})};o(),t.setUserAgent=function(e){a=e,o()},t.isMobile=function(){return n.isMobile},t.isIOS=function(){return n.isIOS},t.isAndroid=function(){return n.isAndroid},t.isMac=function(){return n.isMac},t.isLinux=function(){return n.isLinux},t.isUnix=function(){return n.isUnix},t.isWindows=function(){return n.isWindows},t.isChrome=function(){return n.isChrome},t.isFirefox=function(){return n.isFirefox},t.isSafari=function(){return n.isSafari},t.isOpera=function(){return n.isOpera},t.isEdge=function(){return n.isEdge},t.isAndroidTablet=function(){return n.isAndroidTablet},t.isIpad=function(){return n.isIpad},t.isTablet=function(){return n.isTablet},t.isIE=function(){return n.isIE},t.isIE11=function(){return n.isIE11},t.isNode=function(){return n.isNode}},function(e,t,r){var i=r(279),n=r(280),a=n;a.v1=i,a.v4=n,e.exports=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(9),s=r(6),u=r(12),p=r(12),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.createColorTexture=function(e,t,r,i){void 0===e&&(e=255),void 0===t&&(t=255),void 0===r&&(r=255);var n=a.RGBFormat,o=void 0!==i?4:3,s=new Uint8Array(o);s[0]=e,s[1]=t,s[2]=r,4===o&&(s[3]=i,n=a.RGBAFormat);var u=new a.DataTexture(s,1,1,n,void 0,void 0,void 0,void 0,void 0,void 0);return u.needsUpdate=!0,u},t.createColorTextureCube=function(e,r,i,n){void 0===e&&(e=255),void 0===r&&(r=255),void 0===i&&(i=255);var o=[0,1,2,3,4,5].map(function(a){return t.createColorTexture(e,r,i,n)}),s=new a.CubeTexture(o);return s.generateMipmaps=!1,s.format=o[0].format,s.minFilter=a.NearestFilter,s.magFilter=a.NearestFilter,s.needsUpdate=!0,s},t.getBytesPerPixel=function(e,t){var r=0;switch(t){case"float":case"uInt":case"int":r=4;break;case"halfFloat":case"short":case"uShort":r=2;break;case"uByte":case"byte":r=1;break;case"uShort4444":case"uShort5551":case"uShort565":return 2}return u.default.getChannelCountFromFormat(e)*r},t.getMissingTexture=function(){return t.missingTexture2d||(t.missingTexture2d=t.createColorTexture()),t.missingTexture2d},t.getMissingTextureCube=function(){return t.missingTextureCube||(t.missingTextureCube=t.createColorTextureCube()),t.missingTextureCube},t.prototype.initialize=function(){var t=this;e.prototype.initialize.call(this),this.listenTo(this.engine,"imageUnloaded",function(e){t.getProperty("imageId")===e&&t.unload()})},t.prototype.createRuntimeData=function(e){var r=this,i=function(){r.runtimeData=t.getMissingTexture(),r.setState(o.StateType.Base,o.State.Failed),r.trigger("loadProgress",r),"function"==typeof e&&e.call(r)},n=this.getImage();if(n){var a=function(t){if(!t.runtimeData)return void i();r.createTextureData(t.runtimeData),"function"==typeof e&&e.call(r)};this.listenTo(n,"load",a),n.isLoaded()&&a.call(this,n),n.isUnloaded()&&n.load()}else i()},t.prototype.createTextureData=function(e){n.default.warn("Need to implement createTextureData in derived class.")},t.prototype.reloadBase=function(){return this.runtimeData&&this.runtimeData.dispose(),e.prototype.reloadBase.call(this)},t.prototype.unload=function(){var t=this.getImage();t&&this.stopListening(t,"load"),this.runtimeData&&(this.engine.trigger("textureUnloaded",this.id),n.default.info(this.engine.getName()+" - Unloading texture, "+this.getName()),this.runtimeData.dispose()),e.prototype.unload.call(this)},t.prototype.applyPropertiesLoaded=function(t,r){e.prototype.applyPropertiesLoaded.call(this,t,r);var i=this.runtimeData instanceof a.WebGLRenderTarget?this.runtimeData.texture:this.runtimeData;t.hasOwnProperty("wrapModeU")&&(i.wrapS=this.getThreeAddressMode(this.getAddressModeU())),t.hasOwnProperty("wrapModeV")&&(i.wrapT=this.getThreeAddressMode(this.getAddressModeV())),t.hasOwnProperty("anisotropy")&&(i.anisotropy=this.getProperty("anisotropy")),t.hasOwnProperty("minFilter")&&(i.minFilter=this.getThreeFilter(this.getMinFilter())),t.hasOwnProperty("magFilter")&&(i.magFilter=this.getThreeFilter(this.getMagFilter())),t.hasOwnProperty("useMipmap")&&(i.generateMipmaps=this.isMipmapsEnabled()),t.hasOwnProperty("mapping")&&(i.mapping=this.getThreeMapping()),this.engine.needsRender=!0},t.prototype.applyPropertiesUnloaded=function(t){if(void 0===t&&(t={}),e.prototype.applyPropertiesUnloaded.call(this,t),t.hasOwnProperty("imageId")){var r=this.getPreviousProperty("imageId");if(r){var i=this.engine.getAssetById(r);i&&this.stopListening(i),this.unregisterDependencyById(r)}t.imageId&&this.registerDependencyById(this.getProperty("imageId"))}this.engine.trigger("textureChanged",this.id,t)},t.prototype.getAddressModeU=function(){return this.getSupportedAddressMode(this.getProperty("wrapModeU"))},t.prototype.getAddressModeV=function(){return this.getSupportedAddressMode(this.getProperty("wrapModeV"))},t.prototype.getSupportedAddressMode=function(e){var t=this.getImage();return t&&!t.isPowerOfTwo()?"clampToEdge":e},t.prototype.getLayout=function(){var e=this.getProperty("layout");if(e)return e;var t=this.getImage();return t?t.getProperty("layout"):p.ImageLayout.Normal},t.prototype.getWidth=function(){var e=this.getImage();return e?e.getWidth():1},t.prototype.getHeight=function(){var e=this.getImage();return e?e.getHeight():1},t.prototype.getMinFilter=function(){return this.getSupportedFilter(this.getProperty("minFilter"))},t.prototype.getMagFilter=function(){return this.getSupportedFilter(this.getProperty("magFilter"))},t.prototype.getSupportedFilter=function(e){var t=this.getDataType();if(!this.isLinearFilterAvailableForType(t))return"nearest";if(!this.isMipmapsEnabled())switch(e){default:case"nearest":case"nearestWithNearestMipmap":case"nearestWithLinearMipmap":return"nearest";case"linear":case"linearWithNearestMipmap":case"linearWithLinearMipmap":return"linear"}return e},t.prototype.getBytesPerPixel=function(){return t.getBytesPerPixel(this.getFormat(),this.getDataType())},t.prototype.getDataType=function(){var e=this.getProperty("type"),t=e,r=this.engine.getThreeRenderer(),i=r.extensions;switch(e){case"float":if(i.get("OES_texture_float")){t="float";break}case"halfFloat":t=i.get("OES_texture_half_float")?"halfFloat":"uByte";break;default:t=e}return t},t.prototype.getEncoding=function(){var e=this.getProperty("encoding");if(e)return e;var t=this.getImage();if(!t)return"srgb";var r=t.getChosenRepresentation();if(!r)return"srgb";switch(r.colorspace){case"rgb":case"gray":return"linear";default:return"srgb"}},t.prototype.getFormat=function(){if(!this.getOwnProperty("format")){var e=this.getImage();if(e)return e.getFormat()}return this.getProperty("format")},t.prototype.getThreeMapping=function(){switch(this.getProperty("mapping")){case"cubeReflection":return a.CubeReflectionMapping;case"cubeRefraction":return a.CubeRefractionMapping;case"equirectangularReflection":return a.EquirectangularReflectionMapping;case"EquirectangularRefraction":return a.EquirectangularRefractionMapping;case"sphericalReflection":return a.SphericalReflectionMapping;case"cubeUvReflection":return a.CubeUVReflectionMapping;case"cubeUvRefraction":return a.CubeUVRefractionMapping;default:return a.UVMapping}},t.prototype.getThreeFormat=function(){return u.default.getThreeImageFormat(this.getFormat())},t.prototype.getThreeDataType=function(){return u.default.getThreeDataType(this.getDataType())},t.prototype.getThreeEncoding=function(){return u.default.getThreeImageEncoding(this.getEncoding())},t.prototype.getMipCount=function(){if(!this.isMipmapsEnabled())return 1;var e=this.getWidth(),t=this.getHeight(),r=Math.max(e,t);return Math.floor(Math.log2(Math.max(r,1)))+1},t.prototype.getImage=function(){return this.engine.getAssetById(this.getProperty("imageId"))},t.prototype.getDataSizeInMemorySelf=function(){var e=this.getImage();if(e instanceof u.default){var r=e.getChosenRepresentation();if(!r)return e.getDataSizeInMemory();if(r.compression&&"zip"!==r.compression&&"jpeg"!==r.compression)return e.getDataSizeDownloadSelf();if(this.getHdrPackingType(r.channels))return this.getWidth()*this.getHeight()*t.getBytesPerPixel("rgb",this.getDataType())}return this.getWidth()*this.getHeight()*t.getBytesPerPixel(this.getFormat(),this.getDataType())},t.prototype.isCubeMap=function(){return!1},t.prototype.isLinearFilterAvailableForType=function(e){var t=this.engine.getThreeRenderer(),r=t.extensions;switch(e){case"halfFloat":return!!r.get("OES_texture_half_float_linear");case"float":return!!r.get("OES_texture_float_linear");default:return!0}},t.prototype.isMipmapsEnabled=function(){if(!this.isLinearFilterAvailableForType(this.getDataType()))return!1;var e=this.getImage();return!(e&&!e.isPowerOfTwo())&&this.getProperty("useMipmap")},t.prototype.getHdrPackingType=function(e){return e&&4===e.length&&"exponent"===e[3]?"rgbe":null},t.prototype.createDdsTexture=function(e,t){var r=this.parseDDS(e,!0),i=new a.CompressedTexture(null,0,0);i.format=r.format,i.generateMipmaps=!1;var n=function(e){return e.width<=t&&e.height<=t};if(r.isCubemap){i.flipY=!1;for(var o=i.image=[],s=r.mipmaps.length/r.mipmapCount,u=0;u>8&255,e>>16&255,e>>24&255)}(s)),x;u=!0,o=64,x.format=a.RGBAFormat}for(x.mipmapCount=1,131072&i[2]&&!1!==t&&(x.mipmapCount=Math.max(1,i[7])),x.isCubemap=!!(512&i[28]),x.width=i[4],x.height=i[3],p=i[1]+4,c=x.width,h=x.height,d=x.isCubemap?6:1,l=0;l=this.getMaterialCount())throw new Error("Invalid index parameter");var r=this.getMaterialIds()[e];if(r){var i=this.engine.getAssetById(r);if(i)return i}return t?this.engine.materialUtilities.getMissingMaterial():null},t.prototype.getPreviousMaterial=function(e,t){if(void 0===e&&(e=0),void 0===t&&(t=!0),e<0||e>=this.getMaterialCount())throw new Error("Invalid index parameter");var r=this.getPreviousMaterialIds()[e];if(r){var i=this.engine.getAssetById(r);if(i)return i}return t?this.engine.materialUtilities.getMissingMaterial():null},t.prototype.getMaterialCount=function(){return this.getMaterialIds().length},t.prototype.getMaterials=function(e){var t=this;void 0===e&&(e=!0);var r=this.getMaterialIds(),i=this.engine.materialUtilities.getMissingMaterial();return r.map(function(r){var n=t.engine.getAssetById(r);return n||(e?i:null)})},t.prototype.getSkinAsset=function(){var e=this.getProperty("skinId");return e?this.engine.getAssetById(e):null},t.prototype.isSkinned=function(){return null!==this.getSkinAsset()},t.prototype.applyPropertiesLoaded=function(t,r){var i=this;if(e.prototype.applyPropertiesLoaded.call(this,t,r),t.hasOwnProperty("geometryId")){var n=this.getPreviousProperty("geometryId"),a=this.getProperty("geometryId");if("init"===r&&this.registerChangeListener(a,this.onGeometryChanged,!1),this.registerChangeListener(n,this.onGeometryChanged,!1),this.registerChangeListener(a,this.onGeometryChanged,!0),"init"!==r)return void this.reloadBase()}if(t.hasOwnProperty("materials")){this.getPreviousMaterialIds().forEach(function(e){i.registerChangeListener(e,i.onMaterialChanged,!1)}),Array.isArray(this.runtimeData.material)||(this.runtimeData.material=[]);for(var o=this.getMaterialType(),s=this.getMaterialIds(),u=this.getGeometryAsset(),p=u?u.getMaxMaterialIndex("triangles"):0;s.length<=p;)s.push(null);s.forEach(function(e,t){i.registerChangeListener(e,i.onMaterialChanged,!0),i.loadAndAssignMaterial(i.runtimeData.material,t,e,o)})}if(t.hasOwnProperty("customDepthMaterial")){var c=this.getPreviousProperty("customDepthMaterial"),h=this.getProperty("customDepthMaterial");this.registerChangeListener(c,this.onMaterialChanged,!1),this.registerChangeListener(h,this.onMaterialChanged,!0),h&&this.loadAndAssignMaterial(this.runtimeData,"customDepthMaterial",h,this.getDepthMaterialType())}this.engine.needsRender=!0},t.prototype.loadAsset=function(e){if(!e)return Promise.resolve(null);var t=this.engine.getAssetById(e);return t?new Promise(function(r,i){t.when("load",function(){if(t.isLoadFailed())return void i(new Error('Asset "'+e+'" failed to load'));r(t)}),t.isLoaded()||t.load()}):Promise.reject(new Error('Asset "'+e+'" not found'))},t.prototype.onGeometryChanged=function(){this.reloadBase()},t.prototype.onMaterialChanged=function(e){var t=this;void 0===e&&(e={}),e.hasOwnProperty("shaderId")&&this.getMaterials().forEach(function(e,r){t.runtimeData.material[r]=e.getRuntimeData()[t.getMaterialType()]})},t.prototype.onMaterialDeleted=function(e){var t=this.getMaterialIds(),r=!1;t.forEach(function(i,n){i===e&&(t[n]=null,r=!0)}),r&&this.setProperty("materials",t)},t.prototype.revertMaterial=function(e){void 0===e&&(e=0),this.setMaterial(void 0,e)},t.prototype.setMaterial=function(e,t){if(void 0===t&&(t=0),t<0||t>=this.getMaterialCount())throw new Error("Invalid index parameter");var r=e instanceof s.default?e.id:e,i=(this.getOwnProperty("materials")||[]).slice();i[t]!==r&&(i[t]=r,this.setProperty("materials",i))},t.prototype.getMaterialIds=function(){return this.getProperty("materials")},t.prototype.applyPropertiesUnloaded=function(t){var r=this;if(void 0===t&&(t={}),e.prototype.applyPropertiesUnloaded.call(this,t),t.hasOwnProperty("materials")&&(this.getPreviousMaterials().forEach(function(e){return r.unregisterDependency(e)}),this.getMaterials().forEach(function(e){return r.registerDependency(e)})),t.hasOwnProperty("customDepthMaterial")){var i=this.getPreviousProperty("customDepthMaterial");i&&this.unregisterDependencyById(i);var n=this.getProperty("customDepthMaterial");n&&this.registerDependencyById(n)}if(t.hasOwnProperty("geometryId")){var a=this.getPreviousProperty("geometryId");a&&this.unregisterDependencyById(a);var o=this.getProperty("geometryId");o&&this.registerDependencyById(o)}},t.prototype.bindToHierarchy=function(){var e=this,t=this.getInstanceTop();t||(t=this.getRootObject());var r=this.getSkinAsset();if(!r)throw new Error("Cannot bind mesh to hierarchy because it does not have a skin asset");if(!r.isLoaded())throw new Error("Cannot bind mesh to hierarchy because the skin asset is not loaded");var i=this.runtimeData;if(!i)throw new Error("Cannot bind mesh to hierarchy because the mesh is not loaded");t.when("loadDependencies",function(){var n=t?t.getDescendants():[],o=n.map(function(e){return e.getRuntimeData()}),s=o.reduce(function(e,t){return e[t.name]=t,e},{}),u=r.getJointNames().map(function(t){var r=e.engine.getRuntimeName(t);return s[r]}),p=new a.Skeleton(u,r.getInverseBindMatrices());i.bind(p,r.getBindShapeMatrix())}),t.isUnloaded()||t.load()},t.prototype.createDefaultMesh=function(){var e=this.engine.geometryUtilities.getDefaultGeometry();this.createMesh(e)},t.prototype.createMesh=function(e){if(this.runtimeData)this.runtimeData.geometry=e;else{var t=this.isSkinned()?a.SkinnedMesh:a.Mesh,r=new t(e);r.name=this.getRuntimeName(),r.castShadow=!0,r.receiveShadow=!0,r.material=null,this.runtimeData=r}},t.prototype.createMeshLoaded=function(){var e=this.getGeometryAsset();if(e){if(!e.isLoaded())throw new Error("Cannot create mesh because geometry asset is not loaded");var t=this.getSkinAsset();if(t&&!t.isLoaded())throw new Error("Cannot create mesh because skin asset is not loaded");var r=u.default.primitiveType.TRIANGLES,i=e?e.getGeometry(r):void 0;this.createMesh(i),t&&this.bindToHierarchy()}},t.prototype.getDepthMaterialType=function(){var e=this.getMaterialType();return s.default.materialObjectTypes[e].skinning?"depthSkinned":"depthStatic"},t.prototype.getPreviousMaterials=function(e){void 0===e&&(e=!0);for(var t=[],r=this.getMaterialCount(),i=0;ie?t.video.width:e},0):0},t.prototype.getMaxRepresentationHeight=function(){var e=this.get("representations");return e?e.reduce(function(e,t){return t.video&&t.video.height>e?t.video.height:e},0):0},t.prototype.onUpdate=function(){if(this.runtimeData){var e=this.runtimeData.imageData;e&&!e.paused&&!e.error&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.engine.needsRender=!0)}},t.prototype.pause=function(){this.runtimeData&&this.runtimeData.image.pause()},t.prototype.play=function(e,t){this.runtimeData&&(e&&(this.runtimeData.imageData.currentTime=t),this.runtimeData.imageData.play())},t.prototype.stop=function(){this.runtimeData&&(this.runtimeData.imageData.pause(),this.runtimeData.imageData.currentTime=0)},t.prototype.toggle=function(){this.runtimeData&&(this.runtimeData.imageData.paused?this.play():this.pause())},t.prototype.getOriginalWidth=function(){return(this.getProperty("streams")||[]).reduce(function(e,t){return Math.max(t.width||0,e)},0)},t.prototype.getOriginalHeight=function(){return(this.getProperty("streams")||[]).reduce(function(e,t){return Math.max(t.height||0,e)},0)},t.prototype.getMaxTextureSize=function(){var t=this.engine.getRenderer();return t?t.getMaxTextureSize2d():e.prototype.getMaxTextureSize.call(this)},t.prototype.findRepresentation=function(e){void 0===e&&(e={});var t=this.get("representations");if(!t||0===t.length)return null;var r=Object.assign({maxHeight:1080},e),i=t.map(function(e){return r.maxHeight-(e.video||{}).height||0}),n=i.reduce(function(e,t,r){var n=e>=0?i[e]:Number.MAX_VALUE;return t>=0&&t=0?t[n]:null},t.events={pause:{parameters:[],action:!0,category:""},play:{parameters:[{name:"seek",type:"b",description:"",default:!1},{name:"seekTime",type:"f",description:"",default:0}],action:!0,category:""},stop:{parameters:[],action:!0,category:""},toggle:{parameters:[],action:!0,category:""}},t}(n.default);s.addSchemas("VideoAsset",u),t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n={side:{displayName:"Cull Mode",description:"This controls which side of the geometry will be visible.",type:"opt",isRenderParam:!0,options:{frontOnly:i.FrontSide,backOnly:i.BackSide,doubleSided:i.DoubleSide},default:"doubleSided"},wireframe:{displayName:"Wireframe",description:"This controls whether the material displays as a wireframe.",type:"b",isRenderParam:!0,default:!1},fog:{displayName:"Enable Fog",description:"This controls whether this material is affected by fog or not.",isRenderParam:!0,forceUpdate:!0,type:"b",default:!0},lights:{displayName:"Enable Lights",description:"This controls whether this material is affected by lights or not.",isRenderParam:!0,forceUpdate:!0,type:"b",default:!0},depthFunc:{displayName:"Depth Function",description:"The function to use when comparing the current depth value with the one that already exists in the buffer.",isRenderParam:!0,type:"opt",options:{never:i.NeverDepth,always:i.AlwaysDepth,lessThan:i.LessDepth,lessThanOrEqual:i.LessEqualDepth,equal:i.EqualDepth,greaterThanOrEqual:i.GreaterEqualDepth,greaterThan:i.GreaterDepth,notEqual:i.NotEqualDepth},default:"lessThanOrEqual"},depthWrite:{displayName:"Enable Depth Write",description:"This controls whether the depth values of a mesh rendered with this material are recorded.",isRenderParam:!0,type:"b",default:!0},depthTest:{displayName:"Enable Depth Test",description:"This controls whether a depth check is done before this material is rendered so that it can be occluded.",isRenderParam:!0,type:"b",default:!0},blending:{displayName:"Blending Mode",description:"This controls how the material will be blended with the color behind it.",isRenderParam:!0,type:"opt",options:{none:i.NoBlending,normal:i.NormalBlending,additive:i.AdditiveBlending,subtractive:i.SubtractiveBlending,multiplicative:i.MultiplyBlending,custom:i.CustomBlending},default:"normal",transparency:"GreaterThanOne"},blendEquation:{displayName:"Blending Equation",description:"The function to use when blending the current color with the one alreadyin the buffer. Enabled when using custom blending.",isRenderParam:!0,type:"opt",options:{add:i.AddEquation,subtract:i.SubtractEquation,reverseSubtract:i.ReverseSubtractEquation,minimum:i.MinEquation,maximum:i.MaxEquation},default:"add",displayWhen:{blending:{equals:"custom"}},enabledWhen:{blending:{equals:"custom"}}},blendSrc:{displayName:"Blend Source",description:"The first parameter to be used in the blend equation. Enabled when using custom blending.",isRenderParam:!0,type:"opt",options:{zero:i.ZeroFactor,one:i.OneFactor,sourceColor:i.SrcColorFactor,oneMinusSourceColor:i.OneMinusSrcColorFactor,sourceAlpha:i.SrcAlphaFactor,oneMinusSourceAlpha:i.OneMinusSrcAlphaFactor,destinationAlpha:i.DstAlphaFactor,oneMinusDestinationAlpha:i.OneMinusDstAlphaFactor},default:"sourceAlpha",displayWhen:{blending:{equals:"custom"}},enabledWhen:{blending:{equals:"custom"}}},blendDst:{displayName:"Blend Destination",description:"The second parameter to be used in the blend equation. Enabled when using custom blending.",isRenderParam:!0,type:"opt",options:{zero:i.ZeroFactor,one:i.OneFactor,sourceColor:i.SrcColorFactor,oneMinusSourceColor:i.OneMinusSrcColorFactor,sourceAlpha:i.SrcAlphaFactor,oneMinusSourceAlpha:i.OneMinusSrcAlphaFactor,destinationAlpha:i.DstAlphaFactor,oneMinusDestinationAlpha:i.OneMinusDstAlphaFactor,destinationColor:i.DstColorFactor,oneMinusDestinationColor:i.OneMinusDstColorFactor,sourceAlphaSaturate:i.SrcAlphaSaturateFactor},default:"one",displayWhen:{blending:{equals:"custom"}},enabledWhen:{blending:{equals:"custom"}}},useSeparateAlphaBlend:{displayName:"Separate Blend for Alpha",description:"Use different blend values for the alpha channel. Enabled when using custom blending.",type:"b",default:!1,displayWhen:{blending:{equals:"custom"}},enabledWhen:{blending:{equals:"custom"}}},blendEquationAlpha:{displayName:"Alpha Blend Equation",description:"The function to use when blending the current alpha with the one already in the buffer. Enabled when using custom blending and separate alpha blending.",isRenderParam:!0,type:"opt",options:{add:i.AddEquation,subtract:i.SubtractEquation,reverseSubtract:i.ReverseSubtractEquation,minimum:i.MinEquation,maximum:i.MaxEquation},default:"add",displayWhen:{blending:{equals:"custom"},useSeparateAlphaBlend:{equals:!0}},enabledWhen:{blending:{equals:"custom"},useSeparateAlphaBlend:{equals:!0}}},blendSrcAlpha:{displayName:"Alpha Blend Source",description:"The first parameter to be used in the alpha blend equation. Enabled whenusing custom blending and separate alpha blending.",isRenderParam:!0,type:"opt",options:{zero:i.ZeroFactor,one:i.OneFactor,sourceColor:i.SrcColorFactor,oneMinusSourceColor:i.OneMinusSrcColorFactor,sourceAlpha:i.SrcAlphaFactor,oneMinusSourceAlpha:i.OneMinusSrcAlphaFactor,destinationAlpha:i.DstAlphaFactor,oneMinusDestinationAlpha:i.OneMinusDstAlphaFactor},default:"sourceAlpha",displayWhen:{blending:{equals:"custom"},useSeparateAlphaBlend:{equals:!0}},enabledWhen:{blending:{equals:"custom"},useSeparateAlphaBlend:{equals:!0}}},blendDstAlpha:{displayName:"Alpha Blend Destination",description:"The second parameter to be used in the alpha blend equation.Enabled when using custom blending and separate alpha blending.",isRenderParam:!0,type:"opt",options:{zero:i.ZeroFactor,one:i.OneFactor,sourceColor:i.SrcColorFactor,oneMinusSourceColor:i.OneMinusSrcColorFactor,sourceAlpha:i.SrcAlphaFactor,oneMinusSourceAlpha:i.OneMinusSrcAlphaFactor,destinationAlpha:i.DstAlphaFactor,oneMinusDestinationAlpha:i.OneMinusDstAlphaFactor,destinationColor:i.DstColorFactor,oneMinusDestinationColor:i.OneMinusDstColorFactor,sourceAlphaSaturate:i.SrcAlphaSaturateFactor},default:"one",displayWhen:{blending:{equals:"custom"},useSeparateAlphaBlend:{equals:!0}},enabledWhen:{blending:{equals:"custom"},useSeparateAlphaBlend:{equals:!0}}},polygonOffset:{displayName:"Polygon Offset",description:"Turns on rendering with polygon offsets. This can be used to work around z-fighting.",isRenderParam:!0,type:"b",default:!1},polygonOffsetFactor:{displayName:"Polygon Offset Factor",description:"Scales the maximum Z slope, with respect to X or Y of the polygon.",isRenderParam:!0,type:"f",default:1},polygonOffsetUnits:{displayName:"Polygon Offset Units",description:"Scales the minimum resolvable depth buffer value.",isRenderParam:!0,type:"f",default:1},alphaTest:{displayName:"Alpha Test",description:'Pixels with an alpha value below the given value will not be rendered. This value will only be used when this material\'s Transparency blending mode is set to "Masked"',isRenderParam:!0,forceUpdate:!0,type:"f",default:.2,min:0,max:1,step:.001}};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(11),n=r(5);t.makeXhr=function(e){return function(t){return e(t.path,t.params).then(function(e){return t.loaderData.xhr=e,Promise.resolve(t)})}},t.loadXhr=function(e){return new Promise(function(t,r){e.setLoading();var n=function(e){return parseInt(e.getResponseHeader("Content-Length"),10)},a=function(e){return{total:e.lengthComputable&&e.target?n(e.target):0,loaded:e.loaded}},o=function(){e.loaderData.xhr.abort(),t(e),e.off(i.default.CANCEL,o)},s=function(){e.off(i.default.CANCEL,o),t(e)},u=function(t){e.off(i.default.CANCEL,o),r(t)};e.on(i.default.CANCEL,o),e.loaderData.xhr.send(),e.loaderData.xhr.addEventListener("load",s),e.loaderData.xhr.addEventListener("error",u),e.loaderData.xhr.addEventListener("progress",function(t){return e.trigger(i.default.PROGRESS,a(t))})})},t.requireStatus=function(e){return function(t){return e(t.loaderData.xhr.status)?Promise.resolve(t):Promise.reject(new Error("Failed to load: "+t.path+" status: "+t.loaderData.xhr.status))}},t.setResponseType=function(e){return function(t){return t.loaderData.xhr.responseType=t.params.responseType||e,Promise.resolve(t)}},t.setCustomHeaders=function(e){return e.params.headers&&n.forEach(e.params.headers,function(t,r){e.loaderData.xhr.setRequestHeader(r,t)}),Promise.resolve(e)},t.handleError=function(e){return function(t){return e.setError(t),Promise.reject(t)}},t.unlessCancelled=function(e){return function(t){return t.isCancelled()?Promise.resolve(t):e(t)}};var a=function(e,t,r){return function(i){return Math.min(t,e*Math.pow(r,i))}};t.retry=function(e,r,i,n,o){return void 0===i&&(i=a(250,12e4,2)),void 0===n&&(n=16),void 0===o&&(o=0),t.unlessCancelled(function(a){return r.reduce(function(e,t){return e.then(t)},Promise.resolve(a)).then(function(a){return new Promise(function(s,u){e(a)&&othis.pitchAngleBoundsMax?this.targetEuler.x=this.pitchAngleBoundsMax:this.targetEuler.x1&&n.default.warn('Clip "'+e+'" contains multiple layers, but AnimationAsset.prototype.createAnimation() only supports a single layer.');var o=this.getLayer(i.layers[0]),s=o?o.channels:[],u=s.map(function(e){return r.createKeyframeTrack(e,i.start,i.stop,t)});return new a.AnimationClip(i.name,i.stop-i.start,u)},t.prototype.createRuntimeData=function(e){var t=this;this.when("loadDependencies",function(){t.isDestroyed()||e()},this)},t.prototype.applyPropertiesUnloaded=function(t){void 0===t&&(t={}),e.prototype.applyPropertiesUnloaded.call(this,t),t.hasOwnProperty("channels")&&this.registerBufferDependency()},t.prototype.registerBufferDependency=function(){var e=this,t=this.getChannels(),r=[];t.forEach(function(e){r.push(e.times),r.push(e.values)}),r.forEach(function(t){var r=t.split("#");if(2!==r.length)throw new Error(e.engine.getName()+" - AnimationAsset: Invalid accessorId, "+t);e.registerDependencyById(r[0])})},t.prototype.createKeyframeTrack=function(e,t,r,i){var n=this,o=this.getChannel(e);if(!o)throw new Error(this.engine.getName()+" - AnimationAsset: Channel not found, "+e);var s=[e,t,r].join("#"),u=this.trackData[s];u||(u=this.createKeyframeTrackData(o,t,r),this.trackData[s]=u);var p=o.targetObject.map(function(e){var t=i?i[e]:e;return n.engine.getRuntimeName(t)}),c=p.join("/")+"."+o.targetProperty;return new("quaternion"===o.targetProperty?a.QuaternionKeyframeTrack:a.VectorKeyframeTrack)(c,u.times,u.values,null)},t.prototype.createKeyframeTrackData=function(e,t,r){var i=e.times.split("#"),n=i[0],a=i[1],o=this.engine.getEntityById(n);if(!o)throw new Error(this.engine.getName()+" - AnimationAsset: BufferAsset not found, "+n);var u=o.getAccessor(a),p=o.getArray(a);if(!u||!p)throw new Error(this.engine.getName()+" - AnimationAsset: Accessor not found, "+a);var c=e.values.split("#"),h=c[0],l=c[1],d=this.engine.getEntityById(h);if(!d)throw new Error(this.engine.getName()+" - AnimationAsset: BufferAsset not found, "+h);var f=d.getAccessor(l),m=d.getArray(l);if(!f||!m)throw new Error(this.engine.getName()+" - AnimationAsset: Accessor not found, "+l);var y,g=-1;for(y=0;y=t){g=y;break}var v=-1;for(y=p.length;y-- >0;)if(p[y]<=r){v=y;break}var b=g>=0?g:0,x=v>=0?v+1:p.length,P=s.default.getTypeSize(f.type),w=p.subarray(b,x),E=m.subarray(b*P,x*P);return{times:0===t?w:w.slice().map(function(e){return e-t}),values:E}},t}(o.default);p.addSchemas("AnimationAsset",c),t.default=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(6),a=r(4),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.uninitialize=function(){this.runtimeData&&this.runtimeData.pause(),e.prototype.uninitialize.call(this)},t.prototype.applyPropertiesLoaded=function(t,r){if(e.prototype.applyPropertiesLoaded.call(this,t,r),this.runtimeData&&(t.hasOwnProperty("loop")&&(this.runtimeData.loop=this.getProperty("loop")),t.hasOwnProperty("state")))switch(this.getProperty("state")){case"pause":this.runtimeData.pause();break;case"play":this.runtimeData.play()}},t}(n.default);a.addSchemas("AudioAsset",o),t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(20),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.createRuntimeData=function(e){this.createRTImageData(),this.trigger("loadProgress",this),e()},t.prototype.getLayout=function(){return this.getProperty("layout")},t.prototype.getWidth=function(){return this.getProperty("width")},t.prototype.getHeight=function(){return this.getProperty("height")},t.prototype.applyPropertiesLoaded=function(t,r){if(e.prototype.applyPropertiesLoaded.call(this,t,r),(t.hasOwnProperty("format")||t.hasOwnProperty("type")||t.hasOwnProperty("width")||t.hasOwnProperty("height"))&&"init"!==r)return void this.reloadBase();this.runtimeData.texture.encoding=this.getThreeEncoding()},t}(n.default);t.default=a},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(24),s=r(9),u=r(21),p=r(5),c=r(4),h=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(r,t),r.prototype.getBounds=function(e){var t=this.getProperty("bounds");return(e||new a.Box3).set(t.min,t.max)},r.prototype.getDataSizeInMemorySelf=function(){return 0},r.prototype.applyPropertiesUnloaded=function(e){t.prototype.applyPropertiesUnloaded.call(this,e),e.accessorId&&this.registerBufferDependency()},r.prototype.createRuntimeData=function(e){var t=this;this.when("loadDependencies",function(){if(!t.isDestroyed()){if(t.getDependencies().some(function(e){return e.isLoadFailed()}))t.setState(s.StateType.Base,s.State.Failed);else try{t.decode()}catch(e){n.default.error(e.toString()),t.setState(s.StateType.Base,s.State.Failed)}e()}})},r.prototype.createBufferAttribute=function(e,t,r,i){var n=r.num_points(),o=i.components_count(),s=n*o,u=new e.DracoFloat32Array;t.GetAttributeFloatForAllPoints(r,i,u);for(var p=new Float32Array(s),c=0;c0&&(f.addGroup(v,b,g),v+=b),g=P)}b=3*c-v,b>0&&f.addGroup(v,b,g),e.destroy(y)}else f.addGroup(0,3*c,-1);var w=this.getProperty("bounds"),E=new a.Vector3(w.min.x,w.min.y,w.min.z),T=new a.Vector3(w.max.x,w.max.y,w.max.z);f.boundingBox=new a.Box3(E,T),f.computeBoundingSphere(),this.addMissingAttributes(f),this.setGeometry(o.default.primitiveType.TRIANGLES,f)},r.prototype.decode=function(){var t=e.Module;if(!t)throw new Error("Draco module not found");var r=u.default.getBufferArray(this.engine,this.getProperty("accessorId")),i=new t.DecoderBuffer;i.Init(r,r.byteLength),i.Init(r,r.byteLength);var a=new t.WebIDLWrapper,o=a.GetEncodedGeometryType(i);if(o===t.TRIANGULAR_MESH){var s=a.DecodeMeshFromBuffer(i);this.createBufferGeometry(t,a,s),t.destroy(s)}else n.default.warn(this.engine.getName()+" - DracoGeometryAsset: Unrecognized geometry type '"+o+"'");t.destroy(a),t.destroy(i)},r.prototype.registerBufferDependency=function(){var e=this.getProperty("accessorId"),t=e.split("#");if(2!==t.length)throw new Error(this.engine.getName()+" - DracoGeometryAsset: Invalid accessorId, "+e);this.registerDependencyById(t[0])},r}(o.default);c.addSchemas("DracoGeometryAsset",h),t.default=h}).call(t,r(77))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(9),o=r(12),s=r(11),u=r(15),p=r(4),c=["red","green","blue"],h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.loadPriority=2,t}return i.__extends(t,e),t.prototype.unload=function(){this.runtimeData&&(this.engine.trigger("imageUnloaded",this.id),n.default.info(this.engine.getName()+" - Unloading image, "+this.getName()),e.prototype.unload.call(this))},t.prototype.getChosenRepresentation=function(){return this.chosenRepresentation},t.prototype.isCompressed=function(){return this.runtimeData?"jpeg"!==this.runtimeData.compression&&"zip"!==this.runtimeData.compression:this.getProperty("useCompression")},t.prototype.getCompressionFormat=function(){if(this.getProperty("useCompression")){var e=this.engine.getThreeRenderer();if(e){var t=e.extensions;if(t.get("WEBGL_compressed_texture_s3tc"))return"dxt";if(t.get("WEBGL_compressed_texture_pvrtc"))return"pvrtc"}}},t.prototype.getFormat=function(){var e=this.getChosenRepresentation();if(e.channels)switch(e.channels.length){case 4:return"alpha"===e.channels[3]?"rgba":"rgb";case 3:return"rgb";case 2:return"luminanceAlpha";case 1:return"luminance";default:return"rgb"}},t.prototype.getOriginalWidth=function(){return this.getProperty("width")||0},t.prototype.getOriginalHeight=function(){return this.getProperty("height")||0},t.prototype.getMaxRepresentationWidth=function(){var e=this.get("representations");return e?e.reduce(function(e,t){return t.width>e?t.width:e},0):0},t.prototype.getMaxRepresentationHeight=function(){var e=this.get("representations");return e?e.reduce(function(e,t){return t.height>e?t.height:e},0):0},t.prototype.getMaxTextureSize=function(){var t=this.engine.getRenderer();return t?t.getMaxTextureSize2d():e.prototype.getMaxTextureSize.call(this)},t.prototype.getImageResponseType=function(e){switch(e){case"image/vnd-ms.dds":return"arraybuffer";default:return"blob"}},t.prototype.applyPropertiesUnloaded=function(e){var t={maxSize:Math.max(this.getWidth(),this.getHeight()),compression:this.getCompressionFormat()};this.chosenRepresentation=this.findRepresentation(t)},t.prototype.applyPropertiesLoaded=function(t,r){e.prototype.applyPropertiesLoaded.call(this,t,r),t.hasOwnProperty("useCompression")&&this.getProperty("useCompression")!==this.getPreviousProperty("useCompression")&&"init"!==r&&this.reloadBase()},t.prototype.createRuntimeData=function(e){var t=this;if(!this.chosenRepresentation)throw new Error("No suitable representation found to load");this.loadLowResImage(e).then(function(){return t.loadHighResImage(e)}).catch(this.onImageLoadError.bind(this))},t.prototype.loadLowResImage=function(e){var t=this;if(this.loadPriority=2,!this.getProperty("stream"))return Promise.resolve();var r={maxSize:64},i=this.findRepresentation(r);return i?new Promise(function(r,n){var a=t.loadResource(i.src,u.default.IMAGE,e,{priority:t.loadPriority,responseType:t.getImageResponseType(i.contentType),isExternal:i.isExternal});a.once(s.default.LOAD,function(e){t.onImageLoad(e,i),t.loadPriority=8,r()}),a.once(s.default.CANCEL,function(){n(new Error("Failed to load low res texture"))}),a.once(s.default.ERROR,n)}):Promise.resolve()},t.prototype.loadHighResImage=function(e){var t=this;if(!this.isDestroyed())return new Promise(function(r,i){var n=function(e){t.isDestroyed()||(t.loadedBytes=t.getDataSizeDownload()*e.loaded/e.total,t.trigger("loadProgress",t))};t.setState(a.StateType.Base,a.State.InProgress);var o=t.chosenRepresentation,p=t.loadResource(o.src,u.default.IMAGE,e,{responseType:t.getImageResponseType(o.contentType),isExternal:o.isExternal,priority:t.loadPriority});p.once(s.default.PROGRESS,n),p.once(s.default.LOAD,function(e){t.onImageLoad(e,o)}),p.once(s.default.ERROR,i)})},t.prototype.onImageLoad=function(e,t){if(this.runtimeData||(this.runtimeData={}),this.runtimeData.contentType=t.contentType,this.runtimeData.compression=t.compression,this.runtimeData.colorspace=t.colorspace,this.runtimeData.channels=this.getOwnProperty("channels")||t.channels||c,this.runtimeData.width=t.width,this.runtimeData.height=t.height,!(e instanceof ArrayBuffer||e instanceof Image))throw new Error("Unknown container type for image data!");this.runtimeData.imageData=e,this.loadedBytes=this.getDataSizeDownload(),this.trigger("loadProgress",this)},t.prototype.onImageLoadError=function(e){this.isDestroyed()||(n.default.error("There was an error loading the image, "+this.getName(),e),this.setState(a.StateType.Base,a.State.Failed),this.loadedBytes=this.getDataSizeDownload(),this.trigger("loadProgress",this))},t.prototype.findRepresentation=function(e){void 0===e&&(e={});var t=this.get("representations");if(!t||0===t.length)return null;var r=Object.assign({maxSize:16384},e),i=t.filter(function(e){if(e.compression===r.compression)return!0;switch(e.compression){case"zip":case"jpeg":return!r.compression;case"dxt":case"dxt1":case"dxt5":return"dxt"===r.compression}return!1});0===i.length&&(i=t.filter(function(e){return"zip"===e.compression||"jpeg"===e.compression}));var n=i.filter(function(e){var t=e.channels||c;return!r.channels||t.toString()===r.channels.toString()});0===n.length&&(n=i);var a=["image/vnd-ms.dds"],o=n.filter(function(e){var t=Math.max(e.width,e.height),i=-1!==a.indexOf(e.contentType);return t<=r.maxSize||i}),s=o.reduce(function(e,t,r){return Math.max(t.width,t.height)>(e>=0?Math.max(o[e].width,o[e].height):0)?r:e},-1);return s>=0?o[s]:null},t}(o.default);p.addSchemas("ImageAsset",h),t.default=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(24),s=r(9),u=r(21),p=r(5),c=r(4),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.getDataSizeInMemorySelf=function(){var e=this,t=this.getProperty("attributes");return Object.keys(t).map(function(r){var i=t[r],n=u.default.getBufferAccessor(e.engine,i.accessorId);return u.default.getComponentTypeSize(n.componentType)*u.default.getTypeSize(n.type)*n.count}).reduce(function(e,t){return t+e},0)},t.prototype.applyPropertiesUnloaded=function(t){e.prototype.applyPropertiesUnloaded.call(this,t),(t.attributes||t.indices)&&this.registerBufferDependency()},t.prototype.createRuntimeData=function(e){var t=this;this.when("loadDependencies",function(){if(!t.isDestroyed()){if(t.getDependencies().some(function(e){return e.isLoadFailed()}))t.setState(s.StateType.Base,s.State.Failed);else try{t.createBufferGeometry()}catch(e){n.default.error(e.toString()),t.setState(s.StateType.Base,s.State.Failed)}e()}})},t.prototype.createAttributes=function(e){var t=this,r={indices:"index",positions:"position",normals:"normal",tangents:"tangent",colors:"color",uvs1:"uv",uvs2:"uv2",skinIndices:"skinIndex",skinWeights:"skinWeight"},i=Object.assign({indices:{accessorId:this.getProperty("indices")}},this.getProperty("attributes")),n={};return p.forEach(r,function(r,a){if(i.hasOwnProperty(a)){var o=i[a].accessorId;n[r]=t.createBufferAttribute(o,e[r])}}),n},t.prototype.createBufferAttribute=function(e,t){var r=u.default.getBufferAccessor(this.engine,e),i=u.default.getBufferArray(this.engine,e),n=u.default.getTypeSize(r.type);if(void 0===t||n===t)return new a.BufferAttribute(i,n);for(var o=new i.constructor(r.count*t),s=Math.min(n,t),p=0;p0){var p=t.getEngine();r={},s.forEach(o[0],function(e,t){var i=p.getObjectById(t),n=p.getObjectById(e);r[i.getSid()]=n.getSid()})}}if(!t.asset.getClip(t.clipId))return void(e&&e(new Error('Invalid clip ID "'+t.clipId+'"')));var c=t.asset.createClip(t.clipId,r);return c?(t.action=t.mixer.clipAction(c),t.action?(t.action.setLoop(t.loop?a.LoopRepeat:a.LoopOnce,1/0),t.action.timeScale=t.speed,t.action.time=t.startTime,t.action.weight=t.weight,t.action.clampWhenFinished=!0,t.action.paused=t.paused,t.dirty=!1,t.getEntity().trigger("animationLoaded"),void(e&&e(null,t))):void(e&&e(new Error("Failed to create THREE.AnimationAction")))):void(e&&e(new Error('Failed to create animation clip "'+t.clipId+'"')))}),void(this.asset.isUnloaded()&&this.asset.load())):void(e&&e(new Error("No asset assigned")))):void(e&&e(new Error("Mixer is not initialized")))},t.prototype.pause=function(){this.paused=!0,this.action&&(this.action.paused=this.paused)},t.prototype.play=function(){var e=this;if(this.paused=!1,this.dirty)return void this.load(function(t){if(t)return void n.default.error("Error playing animation: ",t.toString());e.play()});this.action&&(this.needsReset&&(this.action.reset(),this.action.time=this.startTime,this.needsReset=!1),this.action.play(),this.action.paused=this.paused)},t.prototype.playAnimation=function(e,t,r,i,n){void 0!==e&&this.setAsset(this.getEngine().getEntityById(e)),void 0!==t&&this.setClipId(t),this.loop=void 0!==r?r:this.loop,this.speed=void 0!==i?i:this.speed,this.startTime=void 0!==n?n:this.startTime,this.play()},t.prototype.release=function(){this.stop(),this.action&&(this.action.stop(),this.action=void 0)},t.prototype.setAsset=function(e){this.asset!==e&&(this.asset&&(this.stopListening(this.asset,"change:properties",this.onAssetChanged),this.unregisterDependency(this.asset)),this.asset=e,this.dirty=!0,this.asset&&(this.listenTo(this.asset,"change:properties",this.onAssetChanged),this.registerDependency(this.asset)))},t.prototype.setClipId=function(e){this.clipId!==e&&(this.clipId=e,this.dirty=!0)},t.prototype.setLoop=function(e){this.loop=e,this.action&&this.action.setLoop.apply(this.action,[this.loop?a.LoopRepeat:a.LoopOnce,1/0])},t.prototype.setSpeed=function(e){this.speed=e,this.action&&(this.action.timeScale=e)},t.prototype.setTime=function(e){this.action&&(this.action.time=e)},t.prototype.setWeight=function(e){this.weight=e,this.action&&(this.action.weight=this.weight)},t.prototype.onShutdown=function(){this.asset&&this.stopListening(this.asset,"stopListening",this.onAssetChanged),this.release(),this.getEntity().off("playAnimation",this.playAnimation,this),this.getEntity().off("pauseAnimation",this.pause,this),this.getEntity().off("stopAnimation",this.stop,this),this.getEntity().off("toggleAnimation",this.toggle,this)},t.prototype.stop=function(){this.action&&this.action.stop()},t.prototype.toggle=function(){this.isPlaying()?this.pause():this.play()},t.prototype.onUpdate=function(e){this.mixer&&(this.mixer.update(e),this.getEngine().needsRender=!0,this.ended&&(this.getEntity().trigger("endAnimation"),this.ended=!1))},t.prototype.onAssetChanged=function(){this.dirty=!0},t.prototype.onMixerEvent=function(e){e.action===this.action&&"finished"===e.type&&(this.needsReset=!0,this.ended=!0)},t}(o.default);t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(2),s=function(e){function t(){var t=e.call(this)||this;return t.context=null,t}return i.__extends(t,e),t.prototype.onStartup=function(){if(this.context=this.getEntity().engine.getAudioContext(),!this.context)return void n.default.warn("Failed to create Web Audio context.")},t.prototype.onUpdate=function(){if(this.hasRuntimeData()&&this.context){var e=this.getRuntimeData().matrixWorld,t=new a.Vector3(0,0,0).applyMatrix4(e),r=new a.Vector3(0,0,-1).applyMatrix4(e).sub(t).normalize(),i=new a.Vector3(0,1,0).applyMatrix4(e).sub(t).normalize();this.context.listener.setPosition(t.x,t.y,t.z),this.context.listener.setOrientation(r.x,r.y,r.z,i.x,i.y,i.z)}},t}(o.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(25),s=r(2),u=r(15),p=r(11),c=function(e){function t(){var t=e.call(this)||this;return t.gainNode=null,t.sourceNode=null,t.pannerNode=null,t.context=null,t.buffer=null,t.startTime=0,t.playOffset=0,t.state="stopped",t.element=null,t.isVideo=!1,t}return i.__extends(t,e),t.prototype.getGain=function(){return this.gain},t.prototype.getState=function(){return this.state},t.prototype.isLoop=function(){return this.loop},t.prototype.isPaused=function(){return"paused"===this.state},t.prototype.isPlaying=function(){return"playing"===this.state},t.prototype.isStopped=function(){return"stopped"===this.state},t.prototype.pause=function(){"playing"===this.state&&(this.playOffset=this.getCurrentTime(),this.state="paused",this.freeAudioGraph())},t.prototype.play=function(e){var t=this;void 0===e&&(e=0),"paused"!==this.state&&"stopped"!==this.state||(this.playOffset+=e,this.initAudioGraph(function(e){if(e)return void n.default.warn("Error playing audio: "+e);t.setGain(t.gain),t.setLoop(t.loop),t.stream?(t.element.currentTime=t.playOffset,t.element.play()):t.context?(t.startTime=t.context.currentTime,t.sourceNode.start(0,t.playOffset)):n.default.warn("No Web Audio context."),t.state="playing"}))},t.prototype.setGain=function(e){this.gain=e,this.gainNode?this.gainNode.gain.value=this.gain:this.element&&(this.element.volume=this.gain)},t.prototype.setLoop=function(e){this.loop=e,this.element?this.element.loop=this.loop:this.sourceNode&&(this.sourceNode.loop=this.loop)},t.prototype.stop=function(){"playing"!==this.state&&"paused"!==this.state||(this.playOffset=0,this.state="stopped",this.freeAudioGraph())},t.prototype.toggle=function(){"playing"===this.state?this.pause():this.play()},t.prototype.onStartup=function(){this.context=this.getEntity().engine.getAudioContext(),this.context?(this.gainNode=this.context.createGain(),this.pannerNode=this.context.createPanner()):(n.default.warn("No audio context, using fallback."),this.stream=!0,this.positional=!1),this.isVideo=this.asset instanceof o.default,this.isVideo&&(this.stream=!0),this.autoPlay?this.play():this.preload&&this.load(function(e,t){e&&n.default.warn(e)}),this.listenTo(this.getEntity(),"playAudio",this.play),this.listenTo(this.getEntity(),"pauseAudio",this.pause),this.listenTo(this.getEntity(),"stopAudio",this.stop),this.listenTo(this.getEntity(),"toggleAudio",this.toggle)},t.prototype.onUpdate=function(){if(this.hasRuntimeData()&&this.positional){var e=this.getRuntimeData().matrixWorld,t=new a.Vector3(0,0,0).applyMatrix4(e),r=new a.Vector3(0,0,1).applyMatrix4(e).sub(t).normalize();this.pannerNode.setPosition(t.x,t.y,t.z),this.pannerNode.setOrientation(r.x,r.y,r.z)}},t.prototype.initAudioGraph=function(e){var t=this;this.load(function(r,i){if(r)return e(r);if(!t.context)return e(null,null);var n=[];t.stream?t.sourceNode=t.context.createMediaElementSource(i):(t.sourceNode=t.context.createBufferSource(),t.sourceNode.buffer=i),n.push(t.sourceNode),n.push(t.gainNode),t.positional&&n.push(t.pannerNode),n.push(t.context.destination);for(var a=1;a0)){var i=this.getRuntimeData(),n=new a.Vector3,o=new a.Vector3;n.copy(i.position),o.copy(i.scale),i.position.set(0,0,0),i.scale.set(1,1,1),i.updateMatrix();var s=(new a.Matrix4).makeRotationX(.0174532925*(e.x||0)),u=(new a.Matrix4).makeRotationY(.0174532925*(e.y||0)),p=(new a.Matrix4).makeRotationZ(.0174532925*(e.z||0));p.multiply(u),p.multiply(s),t&&p.multiply(i.matrix),this.target.setFromRotationMatrix(p),r?(this.setRotation(this.target),this.getEntity().trigger("end_axis_rotation"),this.getEngine().needsRender=!0):this.time=this.speed,i.position.copy(n),i.scale.copy(o)}},t.prototype.setRotation=function(e){this.getEntity().setQuaternion(e.x,e.y,e.z,e.w),this.hasRuntimeData()&&!this.getRuntimeData().quaternion.equals(e)&&this.getRuntimeData().quaternion.copy(e),this.getEngine().needsRender=!0},t.prototype.getSign=function(e){return e>0?"+":"-"},t.prototype.onStartup=function(){this.listenTo(this.getEntity(),"rotate_on_axis",this.rotateOnWorldAxis),this.listenTo(this.getEntity(),"set_axes_orientation",this.setAxesOrientation)},t.prototype.onUpdate=function(e){this.time>=0&&this.hasRuntimeData()&&(this.time-=e,this.tempQuat.copy(this.getRuntimeData().quaternion),this.tempQuat.slerp(this.target,Math.min(1,Math.max(0,1-1/(this.speed/this.time)))),this.getEntity().setQuaternion(this.tempQuat.x,this.tempQuat.y,this.tempQuat.z,this.tempQuat.w),this.getEngine().needsRender=!0,this.time<0&&(this.setRotation(this.target),this.getEntity().trigger("end_axis_rotation")))},t}(o.default);t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(22),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.recursive=!0,t.boxGeometry=new n.BoxGeometry(1,1,1),t.topBoxMaterial=new n.MeshBasicMaterial({color:4607,wireframe:!0}),t.subBoxMaterial=new n.MeshBasicMaterial({color:16713728,wireframe:!0}),t.workBounds=new n.Box3,t.helpers=[],t}return i.__extends(t,e),t.prototype.onStartup=function(){var e=this,t=this.getEntity();this.recursive&&t.getDescendantsByType("mesh").forEach(function(t){e.createBoundingBox(t,e.subBoxMaterial)}),this.createBoundingBox(t,this.topBoxMaterial,!1)},t.prototype.onShutdown=function(){this.helpers.forEach(function(e){e.boxMesh.parent&&e.boxMesh.parent.remove(e.boxMesh)})},t.prototype.onEnable=function(){this.helpers.forEach(function(e){return e.boxMesh.visible=!0})},t.prototype.onDisable=function(){this.helpers.forEach(function(e){return e.boxMesh.visible=!1})},t.prototype.createBoundingBox=function(e,t,r){var i=this;void 0===r&&(r=!0),e&&e.when("loadBase",function(){var a=e instanceof o.default&&r?e.getLocalBounds(i.workBounds):e.getBounds(i.workBounds),s={boxMesh:new n.Mesh(i.boxGeometry,t),object:e,bounds:a};i.isEnabled()||(s.boxMesh.visible=!1),i.helpers.push(s),s.bounds.getSize(s.boxMesh.scale),s.bounds.getCenter(s.boxMesh.position),e.runtimeData.add(s.boxMesh)})},t}(a.default);t.default=s},function(e,t,r){"use strict";function i(e,t,r){var i=t-e;return Math.min(t,Math.max(e,e+i*r))}Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),a=r(2),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.perspectiveZoomMax=180,t.perspectiveZoomMin=0,t.orthoZoomMax=5,t.orthoZoomMin=0,t.perspectiveStep=4,t.orthographicStep=.2,t}return n.__extends(t,e),t.prototype.zoom=function(e){if(void 0===e&&(e=0),this.hasRuntimeData()&&this.isEnabled()){switch(this.getEntity().getProperty("cameraType")){case"perspective":this.zoomPerspective(e);break;case"orthographic":this.zoomOrthographic(e)}this.updateRenderer()}},t.prototype.lerpZoom=function(e){if(this.hasRuntimeData()&&this.isEnabled()){var t=this.getEntity(),r=Math.max(0,Math.min(1,e));switch(t.getProperty("cameraType")){case"perspective":this.lerpZoomPerspective(r);break;case"orthographic":this.lerpZoomOrtho(r)}this.updateRenderer()}},t.prototype.getZoomLevel=function(){var e,t,r=this.getEntity().getProperty("cameraType"),i=this.getRuntimeData();return"perspective"===r?(e=this.perspectiveZoomMax-this.perspectiveZoomMin,t=i.fov-this.perspectiveZoomMin):(e=this.orthoZoomMax-this.orthoZoomMin,t=i.top+Math.abs(i.bottom)-this.orthoZoomMin),t/e},t.prototype.setPerspectiveBounds=function(e,t){this.perspectiveZoomMin=e,this.perspectiveZoomMax=t,this.zoom()},t.prototype.setOrthographicBounds=function(e,t){this.orthoZoomMin=e,this.orthoZoomMax=t,this.zoom()},t.prototype.onStartup=function(){this.listenTo(this.getEntity(),"change:properties",this.onPropertyChanges),this.listenTo(this.getEntity(),"lerpZoom",this.lerpZoom),this.listenTo(this.getEntity(),"zoom",this.zoom)},t.prototype.zoomPerspective=function(e){var t=this.getRuntimeData(),r=t.fov,i=r+e*this.perspectiveStep,n=Math.min(this.perspectiveZoomMax,Math.max(this.perspectiveZoomMin,i));this.setFOV(n)},t.prototype.lerpZoomPerspective=function(e){var t=i(this.perspectiveZoomMin,this.perspectiveZoomMax,e);this.setFOV(t)},t.prototype.zoomOrthographic=function(e){var t=this.getRuntimeData(),r=2*t.top+e*this.orthographicStep,i=Math.min(this.orthoZoomMax,Math.max(this.orthoZoomMin,r));this.setOrthoBounds(i)},t.prototype.lerpZoomOrtho=function(e){var t=i(this.orthoZoomMin,this.orthoZoomMax,e);this.setOrthoBounds(t)},t.prototype.onPropertyChanges=function(e){e.cameraType&&this.zoom()},t.prototype.setFOV=function(e){this.getEntity().setProperty("fov",e)},t.prototype.setOrthoBounds=function(e){var t=this.getEntity().getAspectRatio();this.getEntity().setProperties({top:.5*e,bottom:.5*-e,right:t*e*.5,left:t*-e*.5})},t.prototype.updateRenderer=function(){this.getEngine().needsRender=!0},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=function(e){function t(){var t=e.call(this)||this;return t.framesElapsed=0,t.near=1,t.far=12e3,t.updateFrameInterval=0,t.cubeMaterial=void 0,t.tempRenderTexture=void 0,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.initCameras()},t.prototype.onShutdown=function(){this.hasRuntimeData()&&this.getRuntimeData().remove(this.cubeCamera)},t.prototype.onEntityLoaded=function(){this.getRuntimeData().add(this.cubeCamera)},t.prototype.onAttributesChanged=function(e){var t=this;-1!==e.indexOf("captureTexture")&&(this.captureTexture?(this.captureTexture.when("load",function(){t.tempRenderTexture&&t.tempRenderTexture.unload()}),this.captureTexture.isBaseUnloaded()&&this.captureTexture.load()):this.tempRenderTexture||this.createTempRenderTexture()),this.hasRuntimeData()&&(-1===e.indexOf("near")&&-1===e.indexOf("far")||(this.cameraPX.near=this.near,this.cameraPX.far=this.far,this.cameraPX.updateProjectionMatrix(),this.cameraNX.near=this.near,this.cameraNX.far=this.far,this.cameraNX.updateProjectionMatrix(),this.cameraPY.near=this.near,this.cameraPY.far=this.far,this.cameraPY.updateProjectionMatrix(),this.cameraNY.near=this.near,this.cameraNY.far=this.far,this.cameraNY.updateProjectionMatrix(),this.cameraPZ.near=this.near,this.cameraPZ.far=this.far,this.cameraPZ.updateProjectionMatrix(),this.cameraNZ.near=this.near,this.cameraNZ.far=this.far,this.cameraNZ.updateProjectionMatrix()),-1!==e.indexOf("debugView")&&this.cubeCamera.traverse(function(e){e instanceof n.PerspectiveCamera&&(e.cameraHelper||(e.cameraHelper=new n.CameraHelper(e),t.getRootThreeObject().add(e.cameraHelper)),e.cameraHelper.visible=!!t.debugView)}))},t.prototype.captureScene=function(){var e=this.getRenderer(),t=this.getRootThreeObject(),r=this.captureTexture?this.captureTexture.runtimeData:this.tempRenderTexture.runtimeData;if(r){var i=r.texture.generateMipmaps,n=[],a=[];r.texture.generateMipmaps=!1,this.renderPosX&&(a.push(0),n.push(this.cameraPX)),this.renderNegX&&(a.push(1),n.push(this.cameraNX)),this.renderPosY&&(a.push(2),n.push(this.cameraPY)),this.renderNegY&&(a.push(3),n.push(this.cameraNY)),this.renderPosZ&&(a.push(4),n.push(this.cameraPZ)),this.renderNegZ&&(a.push(5),n.push(this.cameraNZ)),n.forEach(function(o,s){s===n.length-1&&(r.texture.generateMipmaps=i),r.activeCubeFace=a[s],e.renderView(t,o,{renderTarget:r,clearColor:!0})}),r.needsUpdate=!0}},t.prototype.onPreRender=function(){this.getRootObject().isLoaded()&&++this.framesElapsed>=this.updateFrameInterval&&this.isEnabled()&&(this.framesElapsed=0,this.captureScene())},t.prototype.getCubeCamera=function(){return this.cubeCamera},t.prototype.createTempRenderTexture=function(){this.tempRenderTexture=this.getEngine().createRenderTextureCube({width:512,height:512,format:"rgba",type:"uByte"},"render_tex_cube"),this.tempRenderTexture.load()},t.prototype.initCameras=function(){this.cubeCamera=new n.Object3D;this.cameraPX=new n.PerspectiveCamera(90,1,this.near,this.far),this.cameraPX.up.set(0,-1,0),this.cameraPX.lookAt(new n.Vector3(1,0,0)),this.cubeCamera.add(this.cameraPX),this.cameraNX=new n.PerspectiveCamera(90,1,this.near,this.far),this.cameraNX.up.set(0,-1,0),this.cameraNX.lookAt(new n.Vector3(-1,0,0)),this.cubeCamera.add(this.cameraNX),this.cameraPY=new n.PerspectiveCamera(90,1,this.near,this.far),this.cameraPY.up.set(0,0,1),this.cameraPY.lookAt(new n.Vector3(0,1,0)),this.cubeCamera.add(this.cameraPY),this.cameraNY=new n.PerspectiveCamera(90,1,this.near,this.far),this.cameraNY.up.set(0,0,-1),this.cameraNY.lookAt(new n.Vector3(0,-1,0)),this.cubeCamera.add(this.cameraNY),this.cameraPZ=new n.PerspectiveCamera(90,1,this.near,this.far),this.cameraPZ.up.set(0,-1,0),this.cameraPZ.lookAt(new n.Vector3(0,0,1)),this.cubeCamera.add(this.cameraPZ),this.cameraNZ=new n.PerspectiveCamera(90,1,this.near,this.far),this.cameraNZ.up.set(0,-1,0),this.cameraNZ.lookAt(new n.Vector3(0,0,-1)),this.cubeCamera.add(this.cameraNZ)},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(5),o=r(1),s=r(2),u=function(e){function t(){var t=e.call(this)||this;return t.controlPoints=void 0,t.prevControlPointsLength=0,t.closed=!1,t.tempVector=new o.Vector3,t.tempVector4=new o.Vector4,t.tempMatrix=new o.Matrix4,t.visualizationCurveColor=2236962,t.visualizationSelectedCurveColor=874150,t.orientationHelpers=[],t.canTryUpdateAgain=!0,t.curveMaterial=void 0,t.curveGeometry=void 0,t.curveMesh=void 0,t.curveTessellation=200,t.selected=!1,t.updateStarted=!1,t}return i.__extends(t,e),t.prototype.onSelected=function(){this.selected=!0,this.curveMaterial&&this.curveMaterial.color.setHex(this.visualizationSelectedCurveColor),this.orientationHelpers.forEach(function(e){return e.traverse(function(e){e.visible=!0})})},t.prototype.onUnselected=function(){this.selected=!1,this.curveMaterial&&this.curveMaterial.color.setHex(this.visualizationCurveColor),this.orientationHelpers.forEach(function(e){return e.traverse(function(e){e.visible=!1})})},t.prototype.isCurveInit=function(){return this.curve.points.length>0},t.prototype.onStartup=function(){this.initCurve()},t.prototype.onAttributesChanged=function(){this.initCurve()},t.prototype.onShutdown=function(){this.cleanupCurveMesh(),this.cleanupOrientationHelpers(),this.cleanupCurveMaterial()},t.prototype.initCurve=function(){!this.updateStarted&&this.controlPoints&&this.controlPoints.length&&(this.updateStarted=!0,this.cleanupCurveMesh(),this.cleanupOrientationHelpers(),this.prevControlPointsLength=this.controlPoints.length,this.createCurve(),this.enableVisualizations&&(this.cleanupCurveMesh(),this.createCurveMesh(),this.updateOrientationHelpers()))},t.prototype.createCurve=function(){var e=this,t=this.controlPoints.map(function(t){return t.off("change:properties",e.updateCurve,e),new o.Vector3});this.curve=new o.CatmullRomCurve3(t),this.closed&&(this.curve.closed=!0);var r=this.getEntity().getRootObject();r.when("loadDependencies",function(t){r.runtimeData.updateMatrixWorld(!0),a.forEach(e.controlPoints,function(t,r){if(t){var i=t.getPosition();e.curve.points[r].set(i.x,i.y,i.z),e.tempMatrix.makeRotationFromQuaternion(t.runtimeData.quaternion);var n=e.tempMatrix.toArray();e.tempVector.set(n[0],n[1],n[2]),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,i,.25,16711680)),e.tempVector.set(n[4],n[5],n[6]),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,i,.25,65280)),e.tempVector.set(n[8],n[9],n[10]),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,i,.25,255)),t.on("change:properties",e.updateCurve,e)}else e.tempVector.set(0,0,0),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,e.tempVector,.25,16711680)),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,e.tempVector,.25,16711680)),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,e.tempVector,.25,16711680))}),e.updateCurve({}),e.updateStarted=!1,e.selected||e.onUnselected(),e.trigger("curveInit")},this)},t.prototype.updateCurve=function(e){var t=this,r=0;e.hasOwnProperty("position")&&(a.forEach(this.controlPoints,function(e){e&&(e.runtimeData.parent?(e.getPosition(t.tempVector),t.tempVector4.set(t.tempVector.x,t.tempVector.y,t.tempVector.z,1),t.tempVector4.applyMatrix4(e.runtimeData.parent.matrixWorld),t.curve.points[r].set(t.tempVector4.x,t.tempVector4.y,t.tempVector4.z),r++):t.canTryUpdateAgain&&(t.canTryUpdateAgain=!1,setTimeout(function(){n.default.info("Trying again"),t.updateCurve({})},10)))}),this.enableVisualizations&&(this.cleanupCurveMesh(),this.createCurveMesh()),this.canTryUpdateAgain=!0),e.hasOwnProperty("quaternion")&&this.updateOrientationHelpers()},t.prototype.cleanupCurveMaterial=function(){this.curveMaterial&&(this.curveMaterial.dispose(),this.curveMaterial=void 0)},t.prototype.cleanupOrientationHelpers=function(){var e=this;this.orientationHelpers.forEach(function(t){e.getRootThreeObject().remove(t)}),this.orientationHelpers=[]},t.prototype.cleanupCurveMesh=function(){this.enableVisualizations&&this.curveMesh&&(this.getRootThreeObject().remove(this.curveMesh),this.curveGeometry.dispose(),this.curveMesh.material=void 0)},t.prototype.createCurveMesh=function(){var e=this;this.curveMaterial||(this.curveMaterial=new o.MeshPhongMaterial({color:this.visualizationCurveColor,transparent:!1,opacity:.75,blending:o.AdditiveBlending})),this.curve.points.length&&(this.curveGeometry=new o.TubeGeometry(this.curve,this.curveTessellation,.1,8,this.closed),this.curveMesh=new o.Mesh(this.curveGeometry,this.curveMaterial),this.getRootObject().when("loadBase",function(){e.getRootThreeObject().add(e.curveMesh),a.forEach(e.orientationHelpers,function(t){e.getRootThreeObject().add(t)})},this),this.updateOrientationHelpers())},t.prototype.updateOrientationHelpers=function(){var e=this;this.controlPoints.forEach(function(t,r){var i=t.runtimeData;e.orientationHelpers[3*r].position.copy(e.curve.points[r]),e.orientationHelpers[3*r+1].position.copy(e.curve.points[r]),e.orientationHelpers[3*r+2].position.copy(e.curve.points[r]),e.tempMatrix.makeRotationFromQuaternion(i.quaternion);var n=e.tempMatrix.toArray();e.tempVector.set(n[0],n[1],n[2]),e.orientationHelpers[3*r].setDirection(e.tempVector),e.tempVector.set(n[4],n[5],n[6]),e.orientationHelpers[3*r+1].setDirection(e.tempVector),e.tempVector.set(n[8],n[9],n[10]),e.orientationHelpers[3*r+2].setDirection(e.tempVector)})},t}(s.default);t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(e){function t(){return e.call(this)||this}return i.__extends(t,e),t.prototype.onStartup=function(){var e=this;this.logTag=document.createElement("div"),this.logTag.id="consoleLogger",this.logTag.style.position="absolute",this.logTag.style.top="0",this.logTag.style.left="0",this.logTag.style.width="100%",this.logTag.style.height="100%",this.logTag.style.margin="0",this.logTag.style.padding="0",this.logTag.style.color="#000",this.logTag.style.background="rgba(0,0,0,0.5)",this.logTag.style.fontWeight="bold",this.logTag.style.textAlign="left",this.logTag.style.overflow="scroll",this.logTag.style["pointer-events"]="none",this.logTag.style["z-index"]="1",window.document.body.appendChild(this.logTag),this.oldLog=window.console.log,this.oldError=window.console.error,this.oldWarn=window.console.warn,window.console.log=window.console.error=window.console.warn=function(t){e.logTag.innerHTML+=t+"
"}},t.prototype.onShutdown=function(){this.logTag&&(window.document.body.removeChild(this.logTag),window.console.log=this.oldLog,window.console.error=this.oldError,window.console.warn=this.oldWarn,this.logTag=void 0)},t}(n.default);t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=r(278),o=function(e){function t(){var t=e.call(this)||this;return t.stats=new a,t.initialized=!1,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.stats.showPanel(0)},t.prototype.onPreUpdate=function(){this.isEnabled()&&this.stats.begin()},t.prototype.onPostRender=function(){this.isEnabled()&&this.stats.end()},t.prototype.onEnable=function(){document.body.appendChild(this.stats.dom),this.initialized=!0},t.prototype.onDisable=function(){this.initialized&&(document.body.removeChild(this.stats.dom),this.initialized=!1)},t}(n.default);t.default=o},function(e,t,r){"use strict";function i(e,t){if(e&&e.style)for(var r in t)t.hasOwnProperty(r)&&(e.style[r]=t[r])}function n(e,t){e.classList?e.classList.add(t):e.className+=" "+t}Object.defineProperty(t,"__esModule",{value:!0});var a=r(0),o=r(1),s=r(2),u=r(5),p=r(20),c=r(233),h={position:"absolute",left:"0",top:"0",padding:"8px","border-radius":"5px","font-family":"proxima_nova_regular,Helvetica,Arial,sans-serif","max-width":"25%","min-width":"25px",transition:"opacity 0.1s ease-in-out, background 0.1s ease-in-out",cursor:"pointer"},l=function(e){function t(){var t=e.call(this)||this;return t.renderEventName="render",t.textureRegistryById={},t}return a.__extends(t,e),t.prototype.onAwake=function(){this.getEngine().on("assetLoaded",this.registerTexture,this),this.getEngine().on("assetUnloaded",this.unregisterTexture,this)},t.prototype.onStartup=function(){var e=this;this.init2dScene(),this.initCubeScene(),this.renderEventName+="Group"+this.renderGroup,this.getEngine().on(this.renderEventName,this.renderView,this),this.listenTo(this.getEngine(),"rendererResize",this.resize),this.getEngine().getAssetsByClass(p.default).forEach(function(t){return e.registerTexture(t)}),this.resize()},t.prototype.onShutdown=function(){this.getEngine().off("assetLoaded",this.registerTexture,this),this.getEngine().off("assetUnloaded",this.unregisterTexture,this),this.getEngine().off(this.renderEventName,this.renderView,this)},t.prototype.init2dScene=function(){this.camera2D=new o.OrthographicCamera(-1,1,1,-1,0,1),this.scene2D=new o.Scene,this.material2D=new o.ShaderMaterial(c.default),this.material2D.transparent=!0,this.mesh2D=new o.Mesh(new o.PlaneGeometry(2,2),this.material2D),this.scene2D.add(this.mesh2D)},t.prototype.initCubeScene=function(){var e=o.ShaderLib.cube;this.sceneCube=new o.Scene,this.geoCube=new o.BoxGeometry(100,100,100),this.materialCube=new o.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:e.uniforms,depthWrite:!1,depthTest:!1,side:o.BackSide}),this.meshCube=new o.Mesh(this.geoCube,this.materialCube),this.cameraPX=new o.PerspectiveCamera(90,1,1,1e3),this.cameraPX.up.set(0,1,0),this.cameraPX.lookAt(new o.Vector3(1,0,0)),this.sceneCube.add(this.cameraPX),this.cameraNX=new o.PerspectiveCamera(90,1,1,1e3),this.cameraNX.up.set(0,1,0),this.cameraNX.lookAt(new o.Vector3(-1,0,0)),this.sceneCube.add(this.cameraNX),this.cameraPY=new o.PerspectiveCamera(90,1,1,1e3),this.cameraPY.up.set(0,0,-1),this.cameraPY.lookAt(new o.Vector3(0,1,0)),this.sceneCube.add(this.cameraPY),this.cameraNY=new o.PerspectiveCamera(90,1,1,1e3),this.cameraNY.up.set(0,0,1),this.cameraNY.lookAt(new o.Vector3(0,-1,0)),this.sceneCube.add(this.cameraNY),this.cameraPZ=new o.PerspectiveCamera(90,1,1,1e3),this.cameraPZ.up.set(0,1,0),this.cameraPZ.lookAt(new o.Vector3(0,0,1)),this.sceneCube.add(this.cameraPZ),this.cameraNZ=new o.PerspectiveCamera(90,1,1,1e3),this.cameraNZ.up.set(0,1,0),this.cameraNZ.lookAt(new o.Vector3(0,0,-1)),this.sceneCube.add(this.cameraNZ),this.sceneCube.add(this.meshCube)},t.prototype.setTexture=function(e){var t=this;this.currentTexture=this.textureRegistryById[e],this.currentTexture?this.currentTexture.load(function(){switch(t.currentTexture.type){case"renderTextureCube":case"textureCube":t.materialCube.uniforms.tCube.value=t.currentTexture.getThreeTexture();break;case"texture2D":case"renderTexture2D":t.material2D.uniforms.tDiffuse.value=t.currentTexture.getThreeTexture()}t.mesh2D.visible=!0,t.meshCube.visible=!0}):(this.mesh2D.visible=!1,this.meshCube.visible=!1)},t.prototype.updateViewport=function(){var e,t=this.getEngine().getRenderer().getWidth(),r=this.getEngine().getRenderer().getHeight();"%"===this.viewportBottom.slice(-1)?(e=.01*parseFloat(this.viewportBottom.slice(0,-1)),this.y=e*r):this.y=parseInt(this.viewportBottom,10),"%"===this.viewportLeft.slice(-1)?(e=.01*parseFloat(this.viewportLeft.slice(0,-1)),this.x=e*t):this.x=parseInt(this.viewportLeft,10),"%"===this.viewportWidth.slice(-1)?(e=.01*parseFloat(this.viewportWidth.slice(0,-1)),this.width=e*t):this.width=parseInt(this.viewportWidth,10),"%"===this.viewportHeight.slice(-1)?(e=.01*parseFloat(this.viewportHeight.slice(0,-1)),this.height=e*r):this.height=parseInt(this.viewportHeight,10),this.x<0&&(this.x+=t),this.y<0&&(this.y+=r)},t.prototype.updateTextureDropdown=function(){var e=this;this.isEnabled()&&setTimeout(function(){var t;if(!e.textureDropDown){if(e.textureDropDown=document.createElement("select"),e.textureDropDown.name="Textures",e.textureDropDown.id="Textures",n(e.textureDropDown,"debugger-dropdown"),i(e.textureDropDown,h),!e.getThreeRenderer())return;var r=e.getThreeRenderer().domElement;r.parentElement?r.parentElement.appendChild(e.textureDropDown):r.appendChild(e.textureDropDown),e.textureDropDown.onchange=function(){e.setTexture(e.textureDropDown.value)}}e.textureDropDown.options.length=0,t=document.createElement("option"),t.value=0,t.text="None",e.textureDropDown.appendChild(t),u.forEach(e.textureRegistryById,function(r,i){t=document.createElement("option"),t.value=i,t.text=""!==r.name?r.getName():i,e.textureDropDown.appendChild(t)}),e.textureDropDown.style.top=e.getEngine().getRenderer().getHeight()-e.y-e.height+"px",e.textureDropDown.style.left=e.x+"px",e.textureDropDown.style.zIndex="200"},0)},t.prototype.resize=function(){this.isEnabled()&&(this.updateTextureDropdown(),this.updateViewport())},t.prototype.renderView=function(){var e=this.getThreeRenderer();if(this.isEnabled()&&this.currentTexture)switch(e.setRenderTarget(null),this.currentTexture.type){case"texture2D":case"renderTexture2D":e.setViewport(this.x,this.y,this.width,this.height),e.render(this.scene2D,this.camera2D);break;case"textureCube":case"renderTextureCube":var t=.25*this.width,r=.3333*this.height;e.setViewport(this.x,this.y+r,t,r),e.render(this.sceneCube,this.cameraPX,null,!1),e.setViewport(this.x+1.999*t,this.y+r,t,r),e.render(this.sceneCube,this.cameraNX,null,!1),e.setViewport(this.x+t,this.y+1.99*r,t,r),e.render(this.sceneCube,this.cameraPY,null,!1),e.setViewport(this.x+t,this.y,t,r),e.render(this.sceneCube,this.cameraNY,null,!1),e.setViewport(this.x+t,this.y+r,t,r),e.render(this.sceneCube,this.cameraPZ,null,!1),e.setViewport(this.x+2.99*t,this.y+r,t,r),e.render(this.sceneCube,this.cameraNZ,null,!1)}},t.prototype.registerTexture=function(e){if(e)switch(e.type){case"renderTextureCube":case"textureCube":case"texture2D":case"renderTexture2D":this.textureRegistryById[e.id]=e}},t.prototype.unregisterTexture=function(e){e&&this.textureRegistryById[e.id]&&delete this.textureRegistryById[e.id]},t}(s.default);t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(){function e(e,t,r,i){this.targetEntityType=e,this.targetComponentName=t,this.propertyName=r,this.targetValue=i,this.previousValues={},this.lastTimeSavings=0,this.targetEntityType=e,this.targetComponentName=t,this.propertyName=r,this.targetValue=i}return e}();t.QualityChangeLevel=a;var o=function(e){function t(){var t=e.call(this)||this;return t.QualityChangeLevel=a,t.frameTimeThreshold=33.333333333,t.testInterval=2e3,t.qualityChangeLevels=[],t.currentLevel=t.qualityChangeLevels.length,t.elapsedRenderTime=0,t.framesRecorded=0,t.justStarted=!0,t.justAutoSteppedDown=!1,t.autoOptimize=!0,t}return i.__extends(t,e),t.prototype.setQualityChangeLevels=function(e){this.setMaxQuality(),this.qualityChangeLevels=e,this.currentLevel=this.qualityChangeLevels.length,this.isEnabled()&&(this.autoOptimize=!0)},t.prototype.setFrameTimeThreshold=function(e){this.frameTimeThreshold=e},t.prototype.setTestInterval=function(e){this.testInterval=e,this.elapsedRenderTime=0,this.framesRecorded=0},t.prototype.onPreUpdate=function(e){if(this.isEnabled()&&(this.elapsedRenderTime+=1e3*e,this.framesRecorded++,!(this.elapsedRenderTimethis.frameTimeThreshold?(this.stepRenderingQualityDown(),this.justAutoSteppedDown=!0):this.qualityChangeLevels[this.currentLevel]&&this.lastAvgFrameTime<.9*(this.frameTimeThreshold-this.qualityChangeLevels[this.currentLevel].lastTimeSavings)&&this.stepRenderingQualityUp()}},t.prototype.stepRenderingQualityDown=function(){for(var e=!0;e&&this.currentLevel>0;)this.currentLevel=this.currentLevel>1?this.currentLevel-1:0,e=!this.stepRenderingQuality(!1);e||(this.qualityChangeLevels[this.currentLevel].frameTimeAtDrop=this.lastAvgFrameTime)},t.prototype.stepRenderingQualityUp=function(){for(var e=!0;e&&this.currentLevelthis.time?1:n(Math.max(0,Math.min(1,this.currentTime/this.time)));this.objects.forEach(function(e,i){var n=e.runtimeData.parent.worldToLocal(h.copy(t.destinations[i])).clone(),a=t.direction>0?t.sources[i]:n,o=t.direction>0?n:t.sources[i];h.lerpVectors(a,o,r),e.setPosition(h.x,h.y,h.z)}),this.currentTime>this.time&&this.getEntity().trigger(this.direction>0?"endExplode":"endContract")}},t.prototype.reset=function(){var e=this;this.objects.forEach(function(t,r){t.setPosition(e.sources[r].x,e.sources[r].y,e.sources[r].z)}),this.objects.length=0,this.sources.length=0,this.destinations.length=0,this.currentTime=this.time},t.prototype.contract=function(){this.isEnabled()&&(this.direction=-1,this.currentTime=0,this.getEntity().trigger("beginContract"))},t.prototype.explode=function(e,t){var r=this;if(this.isEnabled()){this.reset();var i=this.getEntity().getDescendantsByType("mesh"),n=this.getEntity().getCenter();n.applyMatrix4(this.getRuntimeData().matrixWorld);var a=new p.Quaternion;a.setFromRotationMatrix(this.getRuntimeData().matrixWorld);var o=this.getFormationFunc(e||this.formation,i.length,n,a,t||this.scale).bind(this);i.forEach(function(e,t){o(t,h,e),r.objects.push(e),r.sources.push(e.getPosition()),r.destinations.push(h.clone())}),this.currentTime=0,this.direction=1,this.getEntity().trigger("beginExplode")}},t.prototype.toggleExplode=function(){this.direction>0?this.contract():this.explode()},t.prototype.getFormationFunc=function(e,t,r,i,n){switch(e){case"Grid":return a(t,r,n,i);case"Scale":return o(r,n);default:case"Circle":return s(t,r,n,i)}},t}(c.default);t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(e){function t(){var t=e.call(this)||this;return t.el=void 0,t.fsEnabled=!1,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.toggle=this.toggle.bind(this),this.getEntity().on("toggleFullscreen",this.toggle,this),this.listenTo(this.getGlobalEvents(),"fullscreen::toggle",this.toggle),this.listenTo(this.getGlobalEvents(),"fullscreen::enable",this.enableFullscreen),this.listenTo(this.getGlobalEvents(),"fullscreen::disable",this.disableFullscreen)},t.prototype.toggle=function(){this.fsEnabled?this.disableFullscreen():this.enableFullscreen()},t.prototype.enableFullscreen=function(){this.el||this.attachFullscreenAPI(),this.el.requestFullscreen(),this.fsEnabled=!0},t.prototype.disableFullscreen=function(){this.el||this.attachFullscreenAPI(),this.fsEnabled&&document.exitFullscreen(),this.fsEnabled=!1},t.prototype.attachFullscreenAPI=function(){this.el=this.getEngine().container,this.el.requestFullscreen=this.el.requestFullscreen||this.el.requestFullScreen||this.el.mozRequestFullscreen||this.el.mozRequestFullScreen||this.el.webkitRequestFullscreen||this.el.webkitRequestFullScreen||this.el.msRequestFullscreen||this.el.msRequestFullScreen,document.exitFullscreen=document.exitFullscreen||document.exitFullScreen||document.mozCancelFullscreen||document.mozCancelFullScreen||document.webkitExitFullscreen||document.webkitExitFullScreen||document.msExitFullscreen||document.msExitFullScreen,document.addEventListener("fullscreenchange",this.onFullscreenChange.bind(this),!1),document.addEventListener("mozfullscreenchange",this.onFullscreenChange.bind(this),!1),document.addEventListener("webkitfullscreenchange",this.onFullscreenChange.bind(this),!1),document.addEventListener("msfullscreenchange",this.onFullscreenChange.bind(this),!1)},t.prototype.onFullscreenChange=function(e){this.getGlobalEvents().trigger("fullscreen::change",e)},t}(n.default);t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(5),s=r(37),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.buttons=[],t.axes=[],t.workVector1=new n.Vector3,t.workVector2=new n.Vector3,t.workQuaternion1=new n.Quaternion,t.workQuaternion2=new n.Quaternion,t.workEuler=new n.Euler,t.meshControlMap={},t.updateAxes=!1,t.updateButtons=[],t.gamepadDevice=null,t}return i.__extends(t,e),t.prototype.onUpdate=function(e){var t=this;this.gamepadDevice||(this.gamepadDevice=this.getGamepadDevice(),this.gamepadDevice&&(this.listenTo(this.gamepadDevice,"gamepadButtonChanged",this.onGamepadButtonEvent),this.listenTo(this.gamepadDevice,"gamepadButtonTouched",this.onGamepadButtonEvent),this.listenTo(this.gamepadDevice,"gamepadButtonReleased",this.onGamepadButtonEvent),this.listenTo(this.gamepadDevice,"gamepadAxisChanged",this.onGamepadAxisEvent))),this.updateButtons.forEach(function(e,r){e&&t.updateButtonTransform(r)}),this.updateAxes&&(this.updateAxes=!1,this.updateAxesTransforms())},t.prototype.getAxisMeshes=function(e){return this.axes[e].map(function(e){return e.mesh})},t.prototype.getButtonMeshes=function(e){return this.buttons[e].map(function(e){return e.mesh})},t.prototype.onAttributesChanged=function(e){var t=this;-1===e.indexOf("axes")&&-1===e.indexOf("buttons")||(this.meshControlMap={},this.axes.forEach(function(e,r){e.forEach(function(e,i){var n=e.mesh;n&&(t.meshControlMap[n.id]||(t.meshControlMap[n.id]={axes:[],axesMeshIdx:[],buttons:[],buttonMeshIdx:[]}),t.meshControlMap[n.id].axes.push(r),t.meshControlMap[n.id].axesMeshIdx.push(i))})}),this.buttons.forEach(function(e,r){e.forEach(function(e,i){var n=e.mesh;n&&t.meshControlMap[n.id]&&(t.meshControlMap[n.id].buttons.push(r),t.meshControlMap[n.id].buttonMeshIdx.push(i))})}))},t.prototype.getGamepadDevice=function(){if(this.gamepadDevice)return this.gamepadDevice;var e=[this.getEntity()].concat(this.getEntity().getAncestors()),t=e.find(function(e){return!!e.getComponent(function(e){return e instanceof s.default})});return t?(this.gamepadDevice=t.getComponent(function(e){return e instanceof s.default}),this.gamepadDevice):(this.gamepadDevice=null,null)},t.prototype.onGamepadButtonEvent=function(e,t){this.currentGamepadState=e,this.updateButtons[t]=!0},t.prototype.updateButtonTransform=function(e){var t=this,r=this.currentGamepadState.buttons[e].value;this.buttons[e].forEach(function(i){if(i.mesh){switch(i.movementType){case"translate":t.workVector1.copy(i.offset).multiplyScalar(r),i.mesh.setPosition(t.workVector1.x,t.workVector1.y,t.workVector1.z);break;case"rotate":t.workVector2.copy(i.rotation).multiplyScalar(r),t.workEuler.setFromVector3(t.workVector2),t.workQuaternion1.setFromEuler(t.workEuler),t.workVector1.copy(i.pivot),t.workVector2.copy(t.workVector1).multiplyScalar(-1),t.workVector2.applyQuaternion(t.workQuaternion1),t.workVector2.add(t.workVector1),i.mesh.setQuaternion(t.workQuaternion1.x,t.workQuaternion1.y,t.workQuaternion1.z,t.workQuaternion1.w),i.mesh.setPosition(t.workVector2.x,t.workVector2.y,t.workVector2.z)}i.renderOnTouchOnly&&t.currentGamepadState.buttons[e].hasOwnProperty("touched")&&i.mesh.setProperty("visible",t.currentGamepadState.buttons[e].touched)}})},t.prototype.onGamepadAxisEvent=function(e,t){this.currentGamepadState=e,this.updateAxes=!0},t.prototype.updateAxesTransforms=function(){var e=this;o.forEach(this.meshControlMap,function(t,r){var i=e.getEngine().getObjectById(r);if(i){var n=e.axes[0][t.axesMeshIdx[0]].movementType;if(e.workVector1.set(0,0,0),t.axes.reduce(function(r,i,a){var o=e.axes[i][t.axesMeshIdx[a]];if(o.movementType!==n)return log.error("Can't perform multiple types of axis transformations on same mesh."),r;if("translate"===n){var s=e.currentGamepadState.axes[i];e.workVector2.copy(o.offset).multiplyScalar(s)}else"rotate"===n&&e.workVector2.copy(o.pivot).multiplyScalar(-1);return r.lerp(e.workVector2,0===a?1:.5)},e.workVector1),e.workQuaternion1.set(0,0,0,1),"rotate"===n&&(t.axes.reduce(function(r,i,n){var a=e.axes[i][t.axesMeshIdx[n]],o=e.currentGamepadState.axes[i];return e.workVector2.copy(a.rotation).multiplyScalar(o),e.workEuler.setFromVector3(e.workVector2),e.workQuaternion2.setFromEuler(e.workEuler),r.slerp(e.workQuaternion2,0===n?1:.5)},e.workQuaternion1),e.workVector2.copy(e.workVector1),e.workVector1.applyQuaternion(e.workQuaternion1),e.workVector2.multiplyScalar(-1),e.workVector1.add(e.workVector2)),i.setQuaternion(e.workQuaternion1.x,e.workQuaternion1.y,e.workQuaternion1.z,e.workQuaternion1.w),i.setPosition(e.workVector1.x,e.workVector1.y,e.workVector1.z),t.buttons.length){var a=t.buttons[0],o=e.currentGamepadState.buttons[a].value,s=e.buttons[a][0].offset;e.workVector2.copy(s).multiplyScalar(o),e.workVector2.applyQuaternion(e.workQuaternion1),e.workVector2.add(e.workVector1),i.setPosition(e.workVector2.x,e.workVector2.y,e.workVector2.z)}}})},t}(a.default);t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.gamepadStates=[],t}return i.__extends(t,e),t.prototype.onPreUpdate=function(e){if(this.isEnabled()&&navigator.getGamepads)for(var t=navigator.getGamepads(),r=0;r":187,"<":188,_:189,".":190,"/":191,"[":219,"]":221};var h=function(e){function r(){var t=e.call(this)||this;return t.mouseButtons={left:0,middle:1,right:2},t.inputQueue=[],t.inputPool=[],t.mouseButtonState=new Array(3),t.mouseButtonStatePrevious=new Array(3),t.mousePosition=new u.Vector2,t.mousePositionPercent=new u.Vector2,t.mousePreviousPosition=new u.Vector2,t.mouseDragState=new Array(3),t.mouseDragStatePrevious=new Array(3),t.mouseDragDistance=[new u.Vector2,new u.Vector2,new u.Vector2],t.touchPosition=new u.Vector2,t.touchPositionPercent=new u.Vector2,t.touchPreviousPosition=new u.Vector2,t.touchDragState=!1,t.touchDragStatePrevious=!1,t.doubleTapHandle=null,t.doubleTapPosition=new u.Vector2,t.listenForTouchStart=!1,t.listenForTouchEnd=!1,t.touchesStart=[],t.keyState=new Array(256),t.keyStatePrevious=new Array(256),t.canvas=null,t.pointerLockEnabled=!1,t}return i.__extends(r,e),r.prototype.mouseButtonDown=function(e){if("any"===e){for(var t in this.mouseButtons)if(this.mouseButtonState[this.mouseButtons[t]])return!0;return!1}return this.mouseButtonState[this.mouseButtons[e]]},r.prototype.mouseButtonUp=function(e){return!this.mouseButtonState[this.mouseButtons[e]]},r.prototype.mouseButtonPressed=function(e){return!(!this.mouseButtonState[this.mouseButtons[e]]||this.mouseButtonStatePrevious[this.mouseButtons[e]])},r.prototype.mouseButtonReleased=function(e){return!(this.mouseButtonState[this.mouseButtons[e]]||!this.mouseButtonStatePrevious[this.mouseButtons[e]])},r.prototype.keyPressed=function(e){return!(!this.keyState[t.keyCodes[e]]||this.keyStatePrevious[t.keyCodes[e]])},r.prototype.keyReleased=function(e){return!(this.keyState[t.keyCodes[e]]||!this.keyStatePrevious[t.keyCodes[e]])},r.prototype.keyDown=function(e){return!!this.keyState[t.keyCodes[e]]},r.prototype.keyUp=function(e){return!this.keyState[t.keyCodes[e]]},r.prototype.getMouseDragState=function(e){return this.mouseDragState[this.mouseButtons[e||"left"]]},r.prototype.getPreviousMouseDragState=function(e){return this.mouseDragStatePrevious[this.mouseButtons[e||"left"]]},r.prototype.getTouchDragState=function(){return this.touchDragState},r.prototype.getPreviousTouchDragState=function(){return this.touchDragStatePrevious},r.prototype.enablePointerLock=function(){this.pointerLockEnabled=!0,this.canvas.requestPointerLock()},r.prototype.disablePointerLock=function(){this.pointerLockEnabled=!1,document.exitPointerLock()},r.prototype.togglePointerLock=function(){this.pointerLockEnabled?this.enablePointerLock():this.disablePointerLock()},r.prototype.onStartup=function(){this.canvas=this.getEngine().canvas,this.canvas.requestPointerLock=this.canvas.requestPointerLock||this.canvas.mozRequestPointerLock||this.canvas.webkitRequestPointerLock,document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,this.clearKeyStates=this.clearKeyStates.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onMouseWheel=this.onMouseWheel.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onContextMenu=this.onContextMenu.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.onTouchCancel=this.onTouchCancel.bind(this),this.onTouchLeave=this.onTouchLeave.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.onDoubleClick=this.onDoubleClick.bind(this),this.onDoubleTap=this.onDoubleTap.bind(this),window.addEventListener("blur",this.clearKeyStates,!1),this.isEnabled()&&(this.mouseEvents.enable&&this.enableMouseEvents(),this.keyEvents.enable&&this.enableKeyEvents(),this.touchEvents.enable&&this.enableTouchEvents())},r.prototype.onPreUpdate=function(){if(this.isEnabled())for(;this.inputQueue.length>0;)this.getEngine().trigger(this.inputQueue[0].name,this.inputQueue[0].event),this.recycleInputEvent(this.inputQueue.splice(0,1)[0])},r.prototype.onPostUpdate=function(){if(this.isEnabled()){if(this.keyEvents.enable)for(var e=0;ethis.mouseEvents.dragBufferDistance&&(this.mouseDragState[t]=!0)}else this.mouseDragState[t]=!1;this.inputQueue.push(this.getInputEvent(e,"mouseMove"))},r.prototype.onMouseDown=function(e){if(this.getScenePercent(e,e),this.mouseUpBound||(this.mouseUpBound=!0,document.addEventListener("mouseup",this.onMouseUp)),Array.prototype.forEach.call(document.querySelectorAll("input, textarea, select, option"),function(e){e.blur()}),this.mouseEvents.preventDownDefault&&e.preventDefault(),this.mouseButtonState[e.button]=!0,this.inputQueue.push(this.getInputEvent(e,"mouseDown")),this.mouseEvents.eventHandler){var t=this.getKeyByValue(this.mouseButtons,e.button);t&&this.getGlobalEvents().trigger("mouse_down_"+t)}},r.prototype.onMouseUp=function(e){if(this.getScenePercent(e,e),this.mouseButtonState[e.button]=!1,this.mouseDragState[e.button]=!1,this.mouseDragDistance[e.button].x=0,this.mouseDragDistance[e.button].y=0,this.mouseButtonUp("left")&&this.mouseButtonUp("right")&&this.mouseButtonUp("middle")&&(this.mouseUpBound=!1,document.removeEventListener("mouseup",this.onMouseUp)),this.inputQueue.push(this.getInputEvent(e,"mouseUp")),this.mouseEvents.eventHandler){var t=this.getKeyByValue(this.mouseButtons,e.button);t&&this.getGlobalEvents().trigger("mouse_up_"+t)}},r.prototype.onDoubleClick=function(e){this.getScenePercent(e,e),Array.prototype.forEach.call(document.querySelectorAll("input, textarea, select, option"),function(e){e.blur()}),this.inputQueue.push(this.getInputEvent(e,"doubleClick"))},r.prototype.onMouseWheel=function(e){this.mouseEvents.preventScrollDefault&&e.preventDefault();var t;t=void 0!==e.wheelDeltaY?.025*e.wheelDeltaY:s.isIE()?-e.deltaY/40:-e.deltaY,this.inputQueue.push(this.getInputEvent(t,"mouseScroll"))},r.prototype.onMouseLeave=function(e){for(var t=0,r=this.mouseButtonState;tthis.touchEvents.dragBufferDistance)return void this.clearDoubleTapState();this.listenForTouchStart||this.listenForTouchEnd?!this.listenForTouchStart&&this.listenForTouchEnd?(this.clearDoubleTapState(),this.listenForTouchStart=!0):this.listenForTouchStart&&!this.listenForTouchEnd?(this.clearDoubleTapState(),this.listenForTouchStart=!0,this.listenForTouchEnd=!0,this.canvas.addEventListener("touchend",this.onDoubleTap)):(this.clearDoubleTapState(),this.onTouchEvent(e,"doubleTap")):(this.doubleTapPosition.copy(this.touchPosition),this.clearDoubleTapState(),this.canvas.addEventListener("touchend",this.onDoubleTap),this.listenForTouchEnd=!0),this.doubleTapHandle=setTimeout(this.clearDoubleTapState.bind(this),300)},r.prototype.clearDoubleTapState=function(){clearTimeout(this.doubleTapHandle),this.doubleTapHandle=null,this.listenForTouchStart=!1,this.listenForTouchEnd=!1,this.canvas.removeEventListener("touchend",this.onDoubleTap)},r.prototype.onTouchCancel=function(e){this.touchEvents.preventCancelDefault&&e.preventDefault(),this.touchDragState=!1;var t={};t.originalEvent=e,t.touches=[],this.inputQueue.push(this.getInputEvent(t,"touchCancel"))},r.prototype.onTouchLeave=function(e){this.touchEvents.preventLeaveDefault&&e.preventDefault(),this.touchDragState=!1,this.onTouchEvent(e,"touchLeave")},r.prototype.onTouchMove=function(e){this.touchEvents.preventMoveDefault&&e.preventDefault();var t={};t.originalEvent=e,t.touches=[];for(var r=0;rthis.touchEvents.dragBufferDistance&&(this.touchDragState=!0),t.touches.push(i)}t.touches.length&&(this.touchPosition.x=t.touches[t.touches.length-1].sceneX,this.touchPosition.y=t.touches[t.touches.length-1].sceneY,this.touchPositionPercent.x=t.touches[t.touches.length-1].scenePercentX,this.touchPositionPercent.y=t.touches[t.touches.length-1].scenePercentY),this.inputQueue.push(this.getInputEvent(t,"touchMove"))},r.prototype.onTouchEvent=function(e,t){var r={};r.originalEvent=e,r.touches=[];for(var i=0;i=0&&(this.sourceBoundingSphere.radius=this.boundingSphereOverrideRadius)),this.sceneRoot.isBaseLoaded()&&this.sphereMesh&&(this.sphereMesh.position.copy(this.sourceBoundingSphere.center),this.sphereMesh.scale.set(this.sourceBoundingSphere.radius,this.sourceBoundingSphere.radius,this.sourceBoundingSphere.radius)),this.previousIntersections=this.currentIntersections,this.currentIntersections={},this.firstIntersectionOnly){var r=t.find(this.intersectObject.bind(this));r&&(this.previousIntersections[r.id]||(this.trigger("beginIntersection",r),this.getEntity().trigger("beginIntersection",r)),this.currentIntersections[r.id]=r)}else t.filter(this.intersectObject.bind(this)).forEach(function(t){e.previousIntersections[t.id]||(e.trigger("beginIntersection",t),e.getEntity().trigger("beginIntersection",t)),e.currentIntersections[t.id]=t});return o.forEach(this.previousIntersections,function(t){e.currentIntersections[t.id]||(e.trigger("endIntersection",t),e.getEntity().trigger("endIntersection",t))}),this.currentIntersections}},t.prototype.onAttributesChanged=function(e){-1!==e.indexOf("debugVisualization")&&(this.sphereMesh.visible=this.debugVisualization)},t.prototype.onPreUpdate=function(){this.checkIntersectionAlways&&this.checkIntersection()},t.prototype.generateObjectList=function(){var e=this;if(this.objectFilter.length)return this.objectFilter;var t=[];return this.sceneRoot.traverseSome(function(r){return r===e.getEntity()||!(r===e.sceneRoot||e.objectTypeFilter.length&&!e.objectTypeFilter.some(function(e){return r.type===e}))&&void t.push(r)}),t},t.prototype.intersectObject=function(e){var t=e.runtimeData;return!!t&&(this.workMatrix.getInverse(t.matrixWorld),this.workBoundsSphere.copy(this.sourceBoundingSphere),this.workBoundsSphere.applyMatrix4(this.workMatrix),e.getBounds(this.workBoundingBox),this.workBoundingBox.intersectsSphere(this.workBoundsSphere))},t}(a.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=r(14),o=function(e){function t(){var t=e.call(this)||this;return t.setupMaterial=t.setupMaterial.bind(t),t}return i.__extends(t,e),t.prototype.onAwake=function(){var e=this;this.listenTo(this.getEngine(),"entityCreated",function(t){t instanceof a.default&&e.setupMaterial(t)})},t.prototype.onAttributesChanged=function(e){this.setupAllMaterials()},t.prototype.onDisable=function(){this.getEngine().getAssetsByClass(a.default).forEach(function(e){e.getShader().getProperty("parameters").reflectionTexture&&e.setProperty("reflectionTexture",null)})},t.prototype.onEnable=function(){this.setupAllMaterials()},t.prototype.setupAllMaterials=function(){this.getEngine().getAssetsByClass(a.default).forEach(this.setupMaterial)},t.prototype.setupMaterial=function(e){if(e&&this.isEnabled()){e.getShader().getProperty("parameters").reflectionTexture&&e.setProperty("reflectionTexture",this.getAttribute("radianceMap"))}},t}(n.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(10),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.playing=!0,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.tempVec=new n.Vector3,this.tempMatrix=new n.Matrix4,this.tempQuaternion=new n.Quaternion},t.prototype.onAttributesChanged=function(e){if(!this.playing){var t=this.getEntity();t instanceof o.default&&(this.getRuntimeData().position.copy(t.getPosition()),this.getRuntimeData().quaternion.copy(t.getQuaternion()))}},t.prototype.onEnable=function(){this.playing=!0},t.prototype.onDisable=function(){this.playing=!1;var e=this.getEntity();e instanceof o.default&&(this.getRuntimeData().position.copy(e.getPosition()),this.getRuntimeData().quaternion.copy(e.getQuaternion()))},t.prototype.onPostUpdate=function(){var e;if(this.hasRuntimeData()&&this.playing&&this.isEnabled()&&(e=this.getRuntimeData(),this.target&&this.target.runtimeData)){this.getEngine().needsRender=!0;var t=this.target.runtimeData;if(t.updateMatrixWorld(),this.tempVec.setFromMatrixPosition(t.matrixWorld),e.parent?this.tempMatrix.getInverse(e.parent.matrixWorld):this.tempMatrix.identity(),this.tempVec.applyMatrix4(this.tempMatrix),this.local){e.lookAt(this.tempVec);var r=this.getEntity();r instanceof o.default&&e.quaternion.multiply(r.getQuaternion())}else e.lookAt(this.tempVec)}},t.prototype.onShutdown=function(){},t}(a.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(41),s=function(e){function t(){var t=e.call(this)||this;return t.createScene(),t}return i.__extends(t,e),t.prototype.setLightingFromThreeScene=function(e){var t=this;this.resetSceneLighting(),e.traverse(function(e){e instanceof n.Light&&t.scene.add(e.clone())}),this.captureScene()},t.prototype.setLightingFromScene=function(e){var t=this;this.resetSceneLighting(),e.getDescendantsByClass(o.default).forEach(function(e){e.isUnloaded()&&e.loadBase(),t.scene.add(e.getRuntimeData().clone())}),this.captureScene()},t.prototype.onAwake=function(){this.listenTo(this.getEntity(),"change:properties",this.onMaterialChanges)},t.prototype.onEnable=function(){this.captureScene()},t.prototype.onEntityLoaded=function(){this.captureScene()},t.prototype.onAttributesChanged=function(e){-1!==e.indexOf("captureTexture")&&this.captureScene()},t.prototype.onMaterialChanges=function(e){this.captureScene()},t.prototype.createScene=function(){this.camera=new n.OrthographicCamera(-.5,.5,.5,-.5,1,80),this.scene=new n.Scene,this.createGeometry(),this.scene.add(this.sphereMesh),this.scene.add(this.planeMesh),this.scene.add(this.camera),this.camera.position.z=40,this.camera.position.y=20,this.camera.position.x=20,this.camera.lookAt(new n.Vector3(0,0,0)),this.planeMesh.lookAt(this.camera.position)},t.prototype.createGeometry=function(){this.geometry=new n.SphereBufferGeometry(.5,36,36),this.planeGeometry=new n.PlaneBufferGeometry(1,2);var e=Math.sqrt(.5),t=this.planeGeometry.attributes.normal;t.array=new Float32Array([-1,1,0,1,1,0,-1,-1,0,1,-1,0]);for(var r=0;r=1&&(n-=1);var a=1-i;if(r&&na){var P=1-(n-a)/i;f+=e*w/t*Math.max(.5*Math.cos(P*Math.PI+Math.PI)+.5,0)}else f+=e*w/t;(f>=1||f<0)&&(f%=1,d=0,s||(f=.99999999,c.playingCurveAnimation=!1,c.getEngine().off("update",c.curveAnim,c),c.curveAnim=void 0),c.getEntity().trigger("endAnimateAlongCurve"));var E=u.curve,T=E.getUtoTmapping(f);if(l.position.copy(E.getPoint(T)),"toCurve"===o){var S=E.getTangent(T);m.set(0,-1,0),y.crossVectors(S,m),g.crossVectors(S,y),m.copy(l.position),m.add(S),v.lookAt(l.position,m,g),l.quaternion.setFromRotationMatrix(v)}else if("toNode"===o){var D=u.closed?E.points.length:E.points.length-1,_=Math.floor(T*D),M=Math.ceil(T*D)%E.points.length,A=void 0;-1!==_&&(A=_>0?u.controlPoints[_]:u.controlPoints[0],A.getQuaternion(b)),-1!==M&&(A=M>0?u.controlPoints[M]:u.controlPoints[0],A.getQuaternion(x));var C=T*D-_;l.quaternion.copy(b),l.quaternion.slerp(x,C)}}};r+i>1&&(n.default.warn("Ease-In and Ease-Out value can't total more than 1.0."),r=.5,i=.5),t>0&&(this.playingCurveAnimation=!0,u.isCurveInit()?(this.curveAnim=E,this.getEngine().on("update",this.curveAnim,this)):u.on("curveInit",function(){c.curveAnim=E,c.getEngine().on("update",c.curveAnim,c)},this))}},t.prototype.onPauseCurveAnimation=function(){this.playingCurveAnimation=!1},t.prototype.onUnpauseCurveAnimation=function(){this.playingCurveAnimation=!0},t.prototype.animateToObject=function(e,t,r,i,o){var s=this,u=this.getEngine(),p=function(e){var p=s.getRuntimeData(),c=new a.Matrix4,h=0,l=0;r+i>1&&(n.default.warn("Ease-In and Ease-Out value can't total more than 1.0."),r=.5,i=.5);var d,f=1-r-i,m=1/(r/2+i/2+f),y=new a.Vector3;y.copy(p.position);var g=e.position,v=e.quaternion;if(v&&o&&(d=new a.Quaternion,d.copy(p.quaternion)),e.updateMatrixWorld(!0),g.setFromMatrixPosition(e.matrixWorld),c.extractRotation(e.matrixWorld),v.setFromRotationMatrix(c),t>0){var b=function(e){if(!s.getEntity()||!s.isEnabled())return void u.off("update",b,s);s.getEngine().needsRender=!0,h+=e;var n=h/t,a=1-i;if(r&&na){var f=1-(n-a)/i;l+=e*m/t*Math.max(.5*Math.cos(f*Math.PI+Math.PI)+.5,0)}else l+=e*m/t;l=Math.min(l,1),(l>=1||l<0)&&(s.getEngine().off("update",b,s),s.getEntity().trigger("endAnimateToObject")),p.position.copy(y),p.position.lerp(g,l),v&&o&&(p.quaternion.copy(d),p.quaternion.slerp(v,l))};s.getEngine().on("update",b,s)}else p.position.copy(g),v&&p.quaternion.copy(v),s.getEntity().trigger("endAnimateToObject")},c=this.getEngine().getEntityById(e);c.runtimeData?p(c.runtimeData):(c.once("loadBase",function(){p(c.runtimeData)},this),c.load())},t.prototype.animateTranslation=function(e,t,r,i,o){var s=this,u=this.getRuntimeData();u.position.copy(this.getEntity().getPosition()),u.quaternion.copy(this.getEntity().getQuaternion()),u.scale.copy(this.getEntity().getScale());var p=0,c=this.getEngine();t+r>1&&(n.default.warn("Ease-In and Ease-Out value can't total more than 1.0."),t=.5,r=.5);var h=e*t,l=new a.Vector3,d=new a.Vector3;d.copy(i);var f=d.length();if(u.updateMatrixWorld(),d.applyQuaternion(u.quaternion),d.normalize(),o){var m=(1-t-r)*e,y=.5*(t+r)*e;"middle"===o?(l.copy(i),l.multiplyScalar(-.5*(m+y)),u.position.add(l)):"end"===o&&(l.copy(i),l.multiplyScalar(-1*(m+y)),u.position.add(l))}if(e>0){var g=function(i){if(!s.getEntity()||!s.isEnabled())return void c.off("update",g,s);l.copy(d),s.getEngine().needsRender=!0,p+=i;var n=Math.min(p/e,1),a=1-r,o=e*a;if(t&&po){var y=1-(n-a)/r;l.multiplyScalar(i*f*Math.max(.5*Math.cos(y*Math.PI+Math.PI)+.5,0))}else l.multiplyScalar(i*f);p>=e&&(s.getEngine().off("update",g,s),s.getEntity().trigger("endAnimateTranslation")),u.position.add(l)};this.getEngine().on("update",g,this)}},t.prototype.animateRotation=function(e,t,r,i,o,s){var u=this,p=this.getRuntimeData();p.position.copy(this.getEntity().getPosition()),p.quaternion.copy(this.getEntity().getQuaternion()),p.scale.copy(this.getEntity().getScale());var c=0,h=this.getEngine();t+r>1&&(n.default.warn("Ease-In and Ease-Out value can't total more than 1.0."),t=.5,r=.5);var l=e*t,d=new a.Quaternion,f=new a.Quaternion,m=new a.Vector3,y=new a.Euler(i.x,i.y,i.z,s);if(d.setFromEuler(y),f.copy(d),p.updateMatrixWorld(),o){var g=(1-t-r)*e,v=.5*(t+r)*e;"middle"===o?(m.copy(i),m.multiplyScalar(-.5*(g+v)),y.set(m.x,m.y,m.z),d.setFromEuler(y),p.quaternion.multiply(d)):"end"===o&&(m.copy(i),m.multiplyScalar(-1*(g+v)),y.set(m.x,m.y,m.z),d.setFromEuler(y),p.quaternion.multiply(d))}if(e>0){var b=function(i){if(!u.getEntity()||!u.isEnabled())return void h.off("update",b,u);var n=1;u.getEngine().needsRender=!0,c+=i;var a=Math.min(c/e,1),o=1-r,s=e*o;if(t&&cs){var y=1-(a-o)/r;n*=i*Math.max(.5*Math.cos(y*Math.PI+Math.PI)+.5,0)}else n*=i;c>=e&&(u.getEngine().off("update",b,u),u.getEntity().trigger("endAnimateRotation")),d.set(0,0,0,1),d.slerp(f,n),p.quaternion.multiply(d)};this.getEngine().on("update",b,this)}},t.prototype.animateScale=function(e,t,r,i,o){var s=this,u=this.getRuntimeData();u.position.copy(this.getEntity().getPosition()),u.quaternion.copy(this.getEntity().getQuaternion()),u.scale.copy(this.getEntity().getScale());var p=0,c=this.getEngine();t+r>1&&(n.default.warn("Ease-In and Ease-Out value can't total more than 1.0."),t=.5,r=.5);var h=e*t,l=new a.Vector3;if(u.updateMatrixWorld(),o){var d=(1-t-r)*e,f=.5*(t+r)*e;"middle"===o?(l.copy(i),l.multiplyScalar(-.5*(d+f)),u.scale.add(l)):"end"===o&&(l.copy(i),l.multiplyScalar(-1*(d+f)),u.scale.add(l))}if(e>0){var m=function(n){if(!s.getEntity()||!s.isEnabled())return void c.off("update",m,s);l.copy(i),s.getEngine().needsRender=!0,p+=n;var a=Math.min(p/e,1),o=1-r,d=e*o;if(t&&pd){var y=1-(a-o)/r;l.multiplyScalar(n*Math.max(.5*Math.cos(y*Math.PI+Math.PI)+.5,0))}else l.multiplyScalar(n);p>=e&&(s.getEngine().off("update",m,s),s.getEntity().trigger("endAnimateScale")),u.scale.add(l)};this.getEngine().on("update",m,this)}},t}(o.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(39),s=r(22),u=r(18),p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.pickTrigger=null,t.enableHover=!1,t.pickingMaterialDef=void 0,t.meshRegistry={},t.meshList=[],t.pickingTexture=void 0,t.currentHoverObject=void 0,t.currentFrame=0,t}return i.__extends(t,e),t.prototype.registerMesh=function(e){var t=this;e instanceof s.default&&e.when("loadBase",function(r){t.getEntity().isDestroyed()||t.registerObject(e,e.runtimeData)},this)},t.prototype.unregisterMesh=function(e){e instanceof s.default&&this.unregisterObject(e,e.runtimeData)},t.prototype.onStartup=function(){this.getEngine().on("rendererResize",this.resize,this),this.initPickingMaterial(),this.initMeshRegistry(),this.getGlobalEvents().on("registerPickingObject",this.registerObject,this),this.getGlobalEvents().on("unregisterPickingObject",this.unregisterObject,this),this.resize()},t.prototype.onShutdown=function(){var e=this;this.getEngine().off("rendererResize",this.resize,this),this.getGlobalEvents().off("registerPickingObject",this.registerObject,this),this.getGlobalEvents().off("unregisterPickingObject",this.unregisterObject,this),this.pickingTexture&&(this.pickingTexture.dispose(),this.pickingTexture=void 0),Object.keys(this.meshRegistry).forEach(function(t){var r=e.meshRegistry[t];r.pickingMaterial&&r.pickingMaterial.dispose()}),this.meshRegistry={},this.meshList=[]},t.prototype.onAttributesChanged=function(e){-1!==e.indexOf("pickTrigger")&&(this.bindPickTrigger(this.getPreviousAttribute("pickTrigger"),!1),this.bindPickTrigger(this.pickTrigger))},t.prototype.onPostRender=function(){this.enableHover&&!u.isMobile()&&this.hoverUpdate()},t.prototype.bindPickTrigger=function(e,t){void 0===t&&(t=!0);var r=this.getEngine(),i=t?this.listenTo.bind(this):this.stopListening.bind(this);"Up"===e.substr(-2)?u.isMobile()?i(r,"touchEnd",this.pick):i(r,"mouseUp",this.pick):"Down"===e.substr(-4)?u.isMobile()?i(r,"touchStart",this.pick):i(r,"mouseDown",this.pick):"DoubleClick"===e.substr(-11)?u.isMobile()?i(r,"doubleTap",this.pickNoDrag):i(r,"doubleClick",this.pickNoDrag):"Click"===e.substr(-5)&&(u.isMobile()?i(r,"touchEnd",this.pickNoDrag):i(r,"mouseUp",this.pickNoDrag))},t.prototype.initPickingMaterial=function(){this.pickingMaterialDef={depthTest:!0,depthWrite:!0,transparent:!1,side:n.DoubleSide,uniforms:{color:{type:"c",value:16711680}},vertexShader:[n.ShaderChunk.common,n.ShaderChunk.skinning_pars_vertex,"void main() {",n.ShaderChunk.beginnormal_vertex,n.ShaderChunk.morphnormal_vertex,n.ShaderChunk.skinbase_vertex,n.ShaderChunk.skinnormal_vertex,n.ShaderChunk.defaultnormal_vertex,n.ShaderChunk.begin_vertex,n.ShaderChunk.displacementmap_vertex,n.ShaderChunk.morphtarget_vertex,n.ShaderChunk.skinning_vertex,n.ShaderChunk.project_vertex,n.ShaderChunk.logdepthbuf_vertex,n.ShaderChunk.clipping_planes_vertex,n.ShaderChunk.worldpos_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 color;",n.ShaderChunk.logdepthbuf_pars_fragment,"void main() {",n.ShaderChunk.logdepthbuf_fragment,"gl_FragColor = vec4( color, 1.0 );","}"].join("\n")}},t.prototype.initMeshRegistry=function(){this.listenTo(this.getEngine(),"entityCreated",this.registerMesh),this.listenTo(this.getEngine(),"entityDestroyed",this.unregisterMesh),this.getEngine().getObjectsByClass(s.default).forEach(this.registerMesh.bind(this))},t.prototype.resize=function(){var e=this.pickingTexture,t=this.getRenderer().getWidth(),r=this.getRenderer().getHeight();this.pickingTexture=new n.WebGLRenderTarget(Math.floor(t/4),Math.floor(r/4),{minFilter:n.LinearFilter}),this.pickingTexture.texture.generateMipmaps=!1,e&&e.dispose()},t.prototype.registerObject=function(e,t){if(!this.meshRegistry[t.id]){this.meshRegistry[t.id]={entity:e,runtimeData:t,prevMaterial:null,pickingMaterial:new n.ShaderMaterial(this.pickingMaterialDef),index:this.meshList.length},this.meshList.push(this.meshRegistry[t.id]);var r=this.meshRegistry[t.id].pickingMaterial;r.uniforms=n.UniformsUtils.clone(this.pickingMaterialDef.uniforms),r.uniforms.color.value=new n.Color(t.id),t instanceof n.SkinnedMesh&&(r.skinning=!0)}},t.prototype.unregisterObject=function(e,t){t&&this.meshRegistry[t.id]&&(this.meshRegistry[t.id].entity=null,this.meshRegistry[t.id].pickingMaterial.dispose(),this.meshList.splice(this.meshRegistry[t.id].index,1),delete this.meshRegistry[t.id])},t.prototype.pickNoDrag=function(e,t){this.getInput().getPreviousMouseDragState(this.getInput().mouseButtons[e.button])||this.pick(e,t)},t.prototype.pick=function(e,t){if(this.isEnabled()){if(!u.isMobile())if("left"===this.pickTrigger.substr(0,4)){if(0!==e.button)return}else if("right"===this.pickTrigger.substr(0,5)){if(2!==e.button)return}else if(1!==e.button)return;var r=e.offsetX,i=e.offsetY,n=this.pickMesh(r,i);if(n){var a=[n].concat(n.getAncestors());a.forEach(function(e){return e.trigger("pick")}),this.getEngine().globalEvents.trigger("objectsPicked",a.map(function(e){return e.id})),"function"==typeof t&&a.forEach(function(e){return t(e)})}else this.getEngine().globalEvents.trigger("objectsPicked",[])}},t.prototype.hoverUpdate=function(){var e=this;if(this.isEnabled()){if(this.currentFrame1||i>1)return null;var n,a=0;for(a=0;a0?this.currentLook:this.orbitCam.pivotPoint.position;this.srcLook.copy(n),i?this.lookAtPoint(i.point):this.resetToOrigin(),this.time=this.speed,this.srcZoom=this.zoomComponent.getZoomLevel()}},t.prototype.lookAtPoint=function(e){this.orbitCam.disable(),this.targetLook.copy(e),-1===this.lastFocusPosition.x&&this.lastFocusPosition.copy(this.targetLook),this.targetLook.distanceTo(this.lastFocusPosition)0&&this.onEnd()},t.prototype.onEnd=function(){this.time=-1,this.orbitCam.enable(),this.orbitCam.setPivotPosition(this.currentLook),this.orbitCam.setOrbitDistance(this.getRuntimeData().position.distanceTo(this.currentLook)),this.orbitCam.resetOrbitRotation()},t.prototype.getIntersection=function(e){this.raycaster.far=this.orbitCam.getOrbitDistance()+1,this.raycaster.setFromCamera(e,this.getRuntimeData());var t=this.raycaster.intersectObjects(this.getRootThreeObject().children,!0).filter(a);return t.length>0?t[0]:void 0},t}(u.default);t.default=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(38),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.position=new n.Vector2,t}return i.__extends(t,e),t.prototype.onStartup=function(){var e=this.getEngine();this.listenTo(e,"mouseDown",this.onMouseDown),this.listenTo(e,"mouseMove",this.onMouseMove),this.listenTo(e,"mouseScroll",this.onMouseScroll)},t.prototype.onMouseDown=function(e){if(this.isEnabled()){var t=this.getInput().mouseButtonDown("left");this.position.x=e.scenePercentX,this.position.y=e.scenePercentY;var r=t?o.orbitEvents.startOrbit:void 0;r&&this.trigger(r,this.position)}},t.prototype.onMouseMove=function(e){if(this.isEnabled()){var t=this.getInput().mouseButtonDown("left");this.position.x=t?e.scenePercentX:e.scenePercentDeltaX,this.position.y=t?e.scenePercentY:e.scenePercentDeltaY;var r=this.getInput().mouseButtonDown("right"),i=r?o.orbitEvents.pan:t?o.orbitEvents.orbit:void 0;i&&this.trigger(i,this.position)}},t.prototype.onMouseScroll=function(e){this.isEnabled()&&this.trigger(o.orbitEvents.zoom,e)},t}(a.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(38),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isOrbiting=!1,t.isPanning=!1,t.isZooming=!1,t.panMidpoint=new n.Vector2,t.lastPanMidpoint=new n.Vector2,t.panDelta=new n.Vector2,t.lastZoomDistance=0,t}return i.__extends(t,e),t.prototype.onStartup=function(){var e=this.getEngine();this.listenTo(e,"touchStart",this.cancelActions),this.listenTo(e,"touchCancel",this.cancelActions),this.listenTo(e,"touchLeave",this.cancelActions),this.listenTo(e,"touchEnd",this.cancelActions),this.listenTo(e,"touchMove",this.onTouchMove)},t.prototype.cancelActions=function(){this.isOrbiting=!1,this.isPanning=!1,this.isZooming=!1,this.panMidpoint.set(0,0),this.lastPanMidpoint.set(0,0),this.panDelta.set(0,0),this.lastZoomDistance=0},t.prototype.onTouchMove=function(e){this.isEnabled()&&e.touches.length&&(1===e.touches.length?this.onSingleTouchMove(e.touches[0]):this.onMultiTouchMove(e.touches[0],e.touches[1]))},t.prototype.onSingleTouchMove=function(e){var t=new n.Vector2(e.scenePercentX,e.scenePercentY);this.isOrbiting?this.orbit(t):(this.isOrbiting=!0,this.startOrbit(t))},t.prototype.onMultiTouchMove=function(e,t){var r=new n.Vector2(e.scenePercentX,e.scenePercentY),i=new n.Vector2(t.scenePercentX,t.scenePercentY);this.pan(r,i),this.zoom(r,i)},t.prototype.startOrbit=function(e){this.trigger(o.orbitEvents.startOrbit,e)},t.prototype.orbit=function(e){this.trigger(o.orbitEvents.orbit,e)},t.prototype.pan=function(e,t){this.panMidpoint.addVectors(e,t),this.panMidpoint.multiplyScalar(.5),this.isPanning||(this.isPanning=!0,this.lastPanMidpoint.copy(this.panMidpoint)),this.panDelta.subVectors(this.panMidpoint,this.lastPanMidpoint),this.panDelta.length()&&this.trigger(o.orbitEvents.pan,this.panDelta),this.lastPanMidpoint.copy(this.panMidpoint),this.panDelta.set(0,0)},t.prototype.zoom=function(e,t){var r=e.distanceTo(t);if(r){this.isZooming||(this.isZooming=!0,this.lastZoomDistance=r);var i=r-this.lastZoomDistance;i&&this.trigger(o.orbitEvents.zoom,20*i),this.lastZoomDistance=r}},t}(a.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=r(235),o=r(234),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.onAttributesChanged=function(e){if(-1!==e.indexOf("inputTexture")){var t=this.getPreviousAttribute("inputTexture"),r=this.getEngine().getAssetById(t);r&&(this.unregisterDependency(r),this.stopListening()),this.inputTexture&&(this.registerDependency(this.inputTexture),this.listenTo(this.inputTexture,"load",this.bindTexture))}this.getEntity().isBaseLoaded()&&this.inputTexture.isBaseLoaded()&&this.generateTexture()},t.prototype.onShutdown=function(){this.inputTexture&&this.unregisterDependency(this.inputTexture)},t.prototype.onEntityReady=function(){this.inputTexture&&this.inputTexture.isBaseLoaded()&&this.generateTexture()},t.prototype.bindTexture=function(){this.getEntity().isBaseLoaded()&&(this.stopListening(this.inputTexture,"change:properties",this.generateTexture),this.listenTo(this.inputTexture,"change:properties",this.generateTexture),this.generateTexture())},t.prototype.generateTexture=function(){var e=this.getThreeRenderer(),t=new a.default(this.inputTexture.getThreeTexture(),this.numSamples);t.update(e),this.getEntity().getProperty("width")===t.cubeLods[0].width&&this.getEntity().getProperty("height")===t.cubeLods[0].height||this.getEntity().setProperties({width:t.cubeLods[0].width,height:t.cubeLods[0].height});var r=new o.default(t.cubeLods);r.setDestinationTexture(this.getEntity().getRuntimeData()),r.update(e),t.dispose(),r.dispose(),this.getEngine().needsRender=!0},t}(n.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.skyboxScene=void 0,t.cameras=[null,null,null,null,null,null],t}return i.__extends(t,e),t.prototype.onAttributesChanged=function(e){if(-1!==e.indexOf("inputTexture")){var t=this.getPreviousAttribute("inputTexture"),r=this.getEngine().getAssetById(t);r&&(this.unregisterDependency(r),this.stopListening(r)),this.inputTexture&&(this.registerDependency(this.inputTexture),this.listenTo(this.inputTexture,"load",this.bindTexture))}},t.prototype.onStartup=function(){this.skyboxScene=new n.Scene,this.registerDependency(this.inputTexture),this.initCameras(),this.createSkybox()},t.prototype.onEntityReady=function(){this.inputTexture&&this.inputTexture.isBaseLoaded()&&this.updateTexture()},t.prototype.onShutdown=function(){this.inputTexture&&this.unregisterDependency(this.inputTexture),this.skyboxGeometry&&this.skyboxGeometry.dispose(),this.equirectMaterial&&this.equirectMaterial.dispose()},t.prototype.bindTexture=function(){this.getEntity().isBaseLoaded()&&(this.stopListening(this.inputTexture,"change:properties",this.updateTexture),this.listenTo(this.inputTexture,"change:properties",this.updateTexture),this.updateTexture())},t.prototype.updateTexture=function(){this.inputTexture.isBaseUnloaded()&&this.inputTexture.load(),this.inputTexture.isBaseLoaded()&&this.getEntity().isBaseLoaded()&&this.renderToCube()},t.prototype.createSkybox=function(){var e=n.ShaderLib.equirect;this.equirectMaterial=new n.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:e.uniforms,depthWrite:!1,side:n.BackSide}),this.skyboxGeometry=new n.BoxGeometry(100,100,100,1,1,1),this.skyboxMesh=new n.Mesh(this.skyboxGeometry,this.equirectMaterial),this.skyboxMesh.frustumCulled=!1,this.skyboxMesh.castShadow=!1,this.skyboxMesh.receiveShadow=!1,this.isEnabled()&&this.skyboxScene.add(this.skyboxMesh)},t.prototype.initCameras=function(){this.cameras[0]=new n.PerspectiveCamera(90,1,1,1e3),this.cameras[0].up.set(0,-1,0),this.cameras[0].lookAt(new n.Vector3(1,0,0)),this.skyboxScene.add(this.cameras[0]),this.cameras[1]=new n.PerspectiveCamera(90,1,1,1e3),this.cameras[1].up.set(0,-1,0),this.cameras[1].lookAt(new n.Vector3(-1,0,0)),this.skyboxScene.add(this.cameras[1]),this.cameras[2]=new n.PerspectiveCamera(90,1,1,1e3),this.cameras[2].up.set(0,0,1),this.cameras[2].lookAt(new n.Vector3(0,1,0)),this.skyboxScene.add(this.cameras[2]),this.cameras[3]=new n.PerspectiveCamera(90,1,1,1e3),this.cameras[3].up.set(0,0,-1),this.cameras[3].lookAt(new n.Vector3(0,-1,0)),this.skyboxScene.add(this.cameras[3]),this.cameras[4]=new n.PerspectiveCamera(90,1,1,1e3),this.cameras[4].up.set(0,-1,0),this.cameras[4].lookAt(new n.Vector3(0,0,1)),this.skyboxScene.add(this.cameras[4]),this.cameras[5]=new n.PerspectiveCamera(90,1,1,1e3),this.cameras[5].up.set(0,-1,0),this.cameras[5].lookAt(new n.Vector3(0,0,-1)),this.skyboxScene.add(this.cameras[5])},t.prototype.renderToCube=function(){if(this.hasRuntimeData()){this.equirectMaterial.uniforms.tEquirect.value=this.inputTexture.getThreeTexture();var e=this.getRuntimeData(),t=this.getThreeRenderer();e.texture.generateMipmaps=!1,t.setViewport(0,0,e.width,e.height);for(var r=0;r<5;r++)e.activeCubeFace=r,t.render(this.skyboxScene,this.cameras[r],e);e.texture.generateMipmaps=this.getEntity().getProperty("useMipmap"),e.activeCubeFace=5,t.render(this.skyboxScene,this.cameras[5],e),this.getEngine().needsRender=!0}},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.framesElapsed=0,t.reflectionNormal=new n.Vector3(0,1,0),t.reflectionPlane=new n.Plane,t.clipPlane=new n.Vector4,t.reflectionPosition=new n.Vector3,t.cameraWorldPosition=new n.Vector3,t.rotationMatrix=new n.Matrix4,t.lookAtPosition=new n.Vector3(0,0,-1),t.up=new n.Vector3(0,1,0),t.perspectiveCamera=null,t.orthoCamera=null,t}return i.__extends(t,e),t.prototype.captureScene=function(e,t){if(!t)throw new Error("Call to ReflectionCapture.captureScene without specifying a camera.");this.updateReflection(t);var r=this.captureTexture?this.captureTexture.runtimeData:null,i=r||this.tempRenderTexture.runtimeData;this.getRenderer().renderView(e,this.reflectionCamera,{renderTarget:i,clearDepth:!0,enableShadows:!1,enablePreRenderFunctions:!1})},t.prototype.onEntityReady=function(){this.initCameras(),this.initTexture()},t.prototype.onAttributesChanged=function(e){-1===e.indexOf("captureTexture")||this.getEntity().isUnloaded()||this.initTexture()},t.prototype.onPreRenderView=function(e,t){this.isEnabled()&&(this.framesElapsed>=this.updateFrameInterval?(this.captureScene(e,t),this.framesElapsed=0):this.framesElapsed++)},t.prototype.createTempRenderTexture=function(){this.tempRenderTexture=this.getEngine().createRenderTexture2d({width:512,height:512,format:"rgba",type:"uByte"},"render_tex_reflection"),this.tempRenderTexture.load()},t.prototype.initTexture=function(){var e=this;this.captureTexture?(this.captureTexture.when("load",function(){e.tempRenderTexture&&e.tempRenderTexture.unload()}),this.captureTexture.isBaseUnloaded()&&this.captureTexture.load()):this.createTempRenderTexture()},t.prototype.initCameras=function(){this.captureTexture&&this.captureTexture.load(),this.perspectiveCamera=new n.PerspectiveCamera,this.orthoCamera=new n.OrthographicCamera(-1,1,-1,1)},t.prototype.updateReflection=function(e){if(this.isEnabled()){var t=function(e){return e<0?-1:1};this.getEntity().runtimeData.updateMatrixWorld(),e.updateMatrixWorld(!1),this.reflectionPosition.setFromMatrixPosition(this.getEntity().runtimeData.matrixWorld),this.cameraWorldPosition.setFromMatrixPosition(e.matrixWorld),this.rotationMatrix.extractRotation(this.getEntity().runtimeData.matrixWorld),this.reflectionNormal.set(0,1,0),this.reflectionNormal.applyMatrix4(this.rotationMatrix);var r=this.reflectionPosition.clone().sub(this.cameraWorldPosition),i=r.reflect(this.reflectionNormal).negate();i.add(this.reflectionPosition),this.rotationMatrix.extractRotation(e.matrixWorld),this.lookAtPosition.set(0,0,-1),this.lookAtPosition.applyMatrix4(this.rotationMatrix),this.lookAtPosition.add(this.cameraWorldPosition);var a=this.reflectionPosition.clone().sub(this.lookAtPosition),o=a.reflect(this.reflectionNormal).negate();o.add(this.reflectionPosition),this.up.set(0,-1,0),this.up.applyMatrix4(this.rotationMatrix);var s=this.up.reflect(this.reflectionNormal).negate();if(e instanceof n.PerspectiveCamera&&this.perspectiveCamera)this.perspectiveCamera.aspect=e.aspect,this.perspectiveCamera.fov=e.fov,this.perspectiveCamera.near=e.near,this.perspectiveCamera.far=e.far,this.reflectionCamera=this.perspectiveCamera;else{if(!(e instanceof n.OrthographicCamera&&this.orthoCamera))return;this.orthoCamera.left=e.left,this.orthoCamera.right=e.right,this.orthoCamera.top=e.top,this.orthoCamera.bottom=e.bottom,this.orthoCamera.near=e.near,this.orthoCamera.far=e.far,this.reflectionCamera=this.orthoCamera}this.reflectionCamera.position.copy(i),this.reflectionCamera.up=s,this.reflectionCamera.lookAt(o),this.reflectionCamera.updateProjectionMatrix(),this.reflectionCamera.updateMatrixWorld(!1),this.reflectionCamera.matrixWorldInverse.getInverse(this.reflectionCamera.matrixWorld),this.reflectionPlane.setFromNormalAndCoplanarPoint(this.reflectionNormal,this.reflectionPosition),this.reflectionPlane.applyMatrix4(this.reflectionCamera.matrixWorldInverse),this.clipPlane.set(this.reflectionPlane.normal.x,this.reflectionPlane.normal.y,this.reflectionPlane.normal.z,this.reflectionPlane.constant);var u=new n.Vector4,p=this.reflectionCamera.projectionMatrix;p.copy(e.projectionMatrix),p.elements[8]*=-1,u.x=(t(this.clipPlane.x)+p.elements[8])/p.elements[0],u.y=(t(this.clipPlane.y)+p.elements[9])/p.elements[5],u.z=-1,u.w=(1+p.elements[10])/p.elements[14];var c=this.clipPlane.multiplyScalar(2/this.clipPlane.dot(u));p.elements[2]=c.x,p.elements[6]=c.y,p.elements[10]=c.z+1-this.clipBias,p.elements[14]=c.w}},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=r(15),o=r(11),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.instance=null,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.listenTo(this.getEntity(),"createRemoteInstance",this.createRemoteInstance),this.listenTo(this.getGlobalEvents(),"createRemoteInstance",this.createRemoteInstance)},t.prototype.createRemoteInstance=function(e){var t=this;if(this.isEnabled()){var r=this.getEngine();r.fetchRemoteRepresentationsFromBox(e).then(function(i){var n=i.representations.entries[0].content.url_template.replace("{+asset_path}","entities.json");r.resourceLoader.load(n,a.default.ENTITIES,{}).on(o.default.LOAD,function(i){var n=i.filter(function(e){return"prefab"===e.type}),a=n.filter(function(e){return r.getAssetById(e.id)}).map(function(e){return r.getAssetById(e.id)});a.length||(r.addEntities(i),a=n.filter(function(e){return r.getAssetById(e.id)}).map(function(e){return r.getAssetById(e.id)})),t.recreateInstance(a,e)})})}},t.prototype.recreateInstance=function(e,t){var r=this,i=this.getEngine();if(this.instance&&(this.instance.destroy(),this.instance=null),e.length>1)this.instance=i.createNode(),e.forEach(function(e){var t=i.getAssetById(e.id);r.instance.addChild(t.createInstance())});else{var n=i.getAssetById(e[0].id);this.instance=n.createInstance()}this.instance&&this.getEntity().addChild(this.instance),this.getEntity().trigger("remoteInstanceCreated",t),this.getGlobalEvents().trigger("remoteInstanceCreated",t)},t}(n.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(3),o=r(2),s=r(18),u=r(5),p=r(195),c=r(14),h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.threeRenderer=null,t.caps={},t.antialias=!1,t.preserveDrawingBuffer=!0,t.precision="highp",t.autoClear=!1,t.devicePixelRatio=1,t.shadowsEnabled=!0,t.shadowsEnabledMobile=!1,t.shadowType=n.PCFSoftShadowMap,t.shadowReverseSided=!1,t.maxTextureSize2d=Number.MAX_SAFE_INTEGER,t.maxTextureSizeCube=Number.MAX_SAFE_INTEGER,t.clearColor=new n.Color,t.clearAlpha=0,t.renderOnDemand=!0,t}return i.__extends(t,e),t.prototype.onAwake=function(){this.canvas=this.getEngine().canvas,this.initDefaultRenderer(),this.getEngine().setRenderer(this);var e=this.getThreeRenderer();e.gammaInput=!1,e.gammaOutput=!0},t.prototype.onStartup=function(){this.listenTo(this.getEngine(),"resize",this.onContainerResize),this.getEngine().renderOnDemand=this.renderOnDemand,this.shadowsEnabledMobile||(this.shadowsEnabled=s.isMobile()?this.shadowsEnabledMobile&&this.shadowsEnabled:this.shadowsEnabled),this.applyRenderSettings()},t.prototype.onShutdown=function(){this.threeRenderer&&(this.threeRenderer.context=null),this.threeRenderer=null,this.canvas=void 0},t.prototype.onAttributesChanged=function(e){var t=!1;-1!==e.indexOf("shadowsEnabledMobile")&&(t=!0),this.shadowsEnabled=s.isMobile()?this.shadowsEnabledMobile&&this.shadowsEnabled:this.shadowsEnabled,this.applyRenderSettings(),this.getEngine().renderOnDemand=this.renderOnDemand,-1!==e.indexOf("clearAlpha")&&this.threeRenderer.setClearColor(this.clearColor,this.clearAlpha),-1!==e.indexOf("clearColor")&&this.threeRenderer.setClearColor(this.clearColor,this.clearAlpha),-1!==e.indexOf("gammaOutput")&&(t=!0),-1!==e.indexOf("gammaInput")&&(t=!0),-1!==e.indexOf("shadowsEnabled")&&(t=!0),-1!==e.indexOf("shadowType")&&(this.shadowType=parseInt(String(this.shadowType),10),t=!0),-1!==e.indexOf("devicePixelRatio")&&this.onContainerResize(),t&&(a.default.info("Rebuilding materials!!!"),this.getEngine().trigger("rebuildMaterials"))},t.prototype.getGPUCapability=function(e){return this.caps[e]},t.prototype.getMaxTextureSize2d=function(){return this.maxTextureSize2d?Math.min(this.maxTextureSize2d,this.getGPUCapability("MAX_TEXTURE_SIZE")):this.getGPUCapability("MAX_TEXTURE_SIZE")},t.prototype.getMaxTextureSizeCube=function(){return this.maxTextureSizeCube?Math.min(this.maxTextureSizeCube,this.getGPUCapability("MAX_CUBE_MAP_TEXTURE_SIZE")):this.getGPUCapability("MAX_CUBE_MAP_TEXTURE_SIZE")},t.prototype.onPreRender=function(){this.threeRenderer.setRenderTarget(null),this.threeRenderer.clear(!0,!0,!0),this.threeRenderer.setViewport(0,0,this.getWidth(),this.getHeight())},t.prototype.renderView=function(e,t,r){void 0===r&&(r={});var i;if(t){r.enablePreRenderFunctions&&this.getEngine().trigger("preRenderView",e,t,r);var n=this.getCanvas().style;void 0===r.opacity||r.viewPort&&(r.viewPort.width!==this.getWidth()||r.viewPort.height!==this.getHeight())?1!==parseFloat(n.opacity)&&(n.opacity="1.0"):parseFloat(n.opacity)!==r.opacity&&(n.opacity=""+r.opacity),r.renderTarget?this.threeRenderer.setRenderTarget(r.renderTarget):this.threeRenderer.setRenderTarget(null),this.threeRenderer.clear(r.clearColor,r.clearDepth,r.clearStencil),r.viewPort&&(i=c.default.sharedUniforms.screenDimensions,i.value.x=r.viewPort.x,i.value.y=r.viewPort.y,i.value.z=r.viewPort.width*this.devicePixelRatio,i.value.w=r.viewPort.height*this.devicePixelRatio,this.threeRenderer.setViewport(r.viewPort.x,r.viewPort.y,r.viewPort.width,r.viewPort.height));var a=r.effect?r.effect:this.threeRenderer;r.renderTarget?a.render(e,t,r.renderTarget,!1):a.render(e,t),this.getEngine().trigger("postRenderView",e,t,r)}},t.prototype.getWidth=function(){return this.canvas.clientWidth?this.canvas.clientWidth:this.canvas.width/this.devicePixelRatio},t.prototype.getHeight=function(){return this.canvas.clientHeight?this.canvas.clientHeight:this.canvas.height/this.devicePixelRatio},t.prototype.getCanvasWidth=function(){return this.canvas.width},t.prototype.getCanvasHeight=function(){return this.canvas.height},t.prototype.getCanvas=function(){return this.threeRenderer.domElement},t.prototype.onContainerResize=function(){if(this.canvas.parentElement){var e=this.canvas.parentElement.clientWidth,t=this.canvas.parentElement.clientHeight;if(this.threeRenderer.setPixelRatio(this.devicePixelRatio),s.isIOS()){var r=this.canvas;this.threeRenderer.setSize(e,t,!1),r.style.width=e+1+"px",r.style.height=t+1+"px",setTimeout(function(){r.style.width=e+"px",r.style.height=t+"px"},100)}else this.threeRenderer.setSize(e,t,!0);this.getEngine().trigger("rendererResize")}else{var i=this.canvas.width/this.devicePixelRatio,n=this.canvas.height/this.devicePixelRatio;this.threeRenderer.setPixelRatio(this.devicePixelRatio),this.threeRenderer.setSize(i,n,!0)}},t.prototype.storeGpuCaps=function(){var e=this.threeRenderer.getContext();a.default.info("WebGL VENDOR is "+e.getParameter(e.VENDOR)),a.default.info("WebGL SHADING_LANGUAGE_VERSION is "+e.getParameter(e.SHADING_LANGUAGE_VERSION)),a.default.info("WebGL RENDERER is "+e.getParameter(e.RENDERER));var t=e.FRAGMENT_SHADER,r=e.LOW_FLOAT,i=e.MEDIUM_FLOAT,n=e.HIGH_FLOAT,o=e.getShaderPrecisionFormat(t,r);if(a.default.info("Fragment Shader lowp is "+o.precision),o=e.getShaderPrecisionFormat(t,i),a.default.info("Fragment Shader mediump is "+o.precision),o=e.getShaderPrecisionFormat(t,n),a.default.info("Fragment Shader highp is "+o.precision),!navigator.isCocoonJS){this.caps.MAX_COMBINED_TEXTURE_IMAGE_UNITS=0,this.caps.MAX_CUBE_MAP_TEXTURE_SIZE=0,this.caps.MAX_FRAGMENT_UNIFORM_VECTORS=0,this.caps.MAX_RENDERBUFFER_SIZE=0,this.caps.MAX_TEXTURE_IMAGE_UNITS=0,this.caps.MAX_TEXTURE_SIZE=0,this.caps.MAX_VARYING_VECTORS=0,this.caps.MAX_VERTEX_ATTRIBS=0,this.caps.MAX_VERTEX_TEXTURE_IMAGE_UNITS=0,this.caps.MAX_VERTEX_UNIFORM_VECTORS=0,this.caps.MAX_VIEWPORT_DIMS=0,this.caps.ALIASED_POINT_SIZE_RANGE=0,this.caps.ALIASED_LINE_WIDTH_RANGE=0,this.caps.SAMPLES=0,this.caps.SAMPLE_BUFFERS=0,this.caps.RED_BITS=0,this.caps.GREEN_BITS=0,this.caps.BLUE_BITS=0,this.caps.ALPHA_BITS=0,this.caps.DEPTH_BITS=0,this.caps.STENCIL_BITS=0,this.caps.SUBPIXEL_BITS=0,this.caps.COMPRESSED_TEXTURE_FORMATS=0,this.caps=u.map(this.caps,function(t,r){return e.getParameter(e[r])}),this.caps.EXTENSIONS=e.getSupportedExtensions();var s=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");this.caps.maxAnisotropy=s?e.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,a.default.info("GPU Capabilities:",this.caps)}},t.prototype.initDefaultRenderer=function(){if(!p.default.isWebGLEnabled())throw new Error("WebGL is not supported, no fallbacks available.");this.threeRenderer=new n.WebGLRenderer({canvas:this.canvas,antialias:this.antialias,preserveDrawingBuffer:this.preserveDrawingBuffer,alpha:!0,precision:this.precision,logarithmicDepthBuffer:this.logarithmicDepthBuffer}),this.threeRenderer.physicallyCorrectLights=!0,this.threeRenderer.setPixelRatio(this.devicePixelRatio>0?this.devicePixelRatio:window.devicePixelRatio),this.storeGpuCaps()},t.prototype.applyRenderSettings=function(){var e=this;this.threeRenderer&&(u.forEach(this,function(t,r){void 0!==e.threeRenderer[r]&&(e.threeRenderer[r]=t)}),this.devicePixelRatio>0||(this.devicePixelRatio=window.devicePixelRatio),this.threeRenderer.setClearColor(this.clearColor,this.clearAlpha),this.shadowsEnabled&&(this.threeRenderer.shadowMap.enabled=!0,this.threeRenderer.shadowMap.type=this.shadowType,this.threeRenderer.shadowMap.renderReverseSided=this.shadowReverseSided))},t}(o.default);t.default=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(10),s=new n.Vector3,u=new n.Euler,p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.quaternion=new n.Quaternion,t.currentGlobalQuaternion=new n.Quaternion,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.rotate=this.autoRotate,this.getEntity().on("startRotate",this.onStartRotate,this),this.getEntity().on("stopRotate",this.onStopRotate,this),this.getEntity().on("toggleRotate",this.onToggleRotate,this)},t.prototype.onShutdown=function(){this.getEntity().off("startRotate",this.onStartRotate,this),this.getEntity().off("stopRotate",this.onStopRotate,this),this.getEntity().off("toggleRotate",this.onToggleRotate,this)},t.prototype.onEnable=function(){this.rotate=this.autoRotate,this.initRotation()},t.prototype.onDisable=function(){var e=this.getEntity();e instanceof o.default&&(this.getRuntimeData().position.copy(e.getPosition()),this.getRuntimeData().quaternion.copy(e.getQuaternion()),this.rotate=!1)},t.prototype.onAttributesChanged=function(e){e.indexOf("rotation")&&this.rotation&&this.initRotation()},t.prototype.onEntityReady=function(){this.initialQuaternion=new n.Quaternion,this.initialQuaternion.copy(this.getRuntimeData().quaternion),this.initRotation()},t.prototype.onUpdate=function(e){this.rotate&&this.isEnabled()&&(this.getEngine().needsRender=!0,this.getRuntimeData()&&this.rotation&&(s.copy(this.rotation).multiplyScalar(e),u.set(s.x,s.y,s.z),this.quaternion.setFromEuler(u),this.local?this.getRuntimeData().quaternion.multiply(this.quaternion):(this.currentGlobalQuaternion.multiply(this.quaternion),this.getRuntimeData().quaternion.multiplyQuaternions(this.currentGlobalQuaternion,this.initialQuaternion))))},t.prototype.initRotation=function(){u.set(this.rotation.x,this.rotation.y,this.rotation.z),this.local?this.getRuntimeData().quaternion.copy(this.initialQuaternion):this.currentGlobalQuaternion.set(0,0,0,1)},t.prototype.onStartRotate=function(){this.rotate=!0},t.prototype.onStopRotate=function(){this.rotate=!1},t.prototype.onToggleRotate=function(){this.rotate=!this.rotate},t}(a.default);t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.onStartup=function(){this.listenTo(this.getEntity(),"change:properties",this.onPropertiesChanged),this.isEnabled()&&this.getEntity().scaleToSize(this.size)},t.prototype.onAttributesChanged=function(e){-1!==e.indexOf("size")&&this.isEnabled()&&this.getEntity().scaleToSize(this.size)},t.prototype.onDisable=function(){this.getEntity().setScale(1,1,1)},t.prototype.onEnable=function(){this.getEntity().scaleToSize(this.size)},t.prototype.onPropertiesChanged=function(e){e.hasOwnProperty("bounds")&&this.isEnabled()&&this.getEntity().scaleToSize(this.size)},t}(n.default);t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(247),s=r(246),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.autoLoad=!0,t.uniforms=null,t.noiseMat=null,t.initialized=!1,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.listenTo(this.getEntity(),"changeNoiseValues",this.changeNoiseValues),this.listenTo(this.getEntity(),"renderNoise",this.changeNoiseValues),this.uniforms={time:{type:"f",value:1},scale:{type:"v2",value:this.scale},offset:{type:"v2",value:this.offset},layerAmplitude:{type:"v4",value:this.layerAmplitude},layerScale:{type:"v4",value:this.layerScale}},this.noiseMat=new n.ShaderMaterial({uniforms:this.uniforms,vertexShader:o,fragmentShader:s}),this.cameraRTT=new n.OrthographicCamera(-.5,.5,.5,-.5,-10,10),this.cameraRTT.position.z=1,this.sceneRTT=new n.Scene,this.sceneRTT.add(this.cameraRTT),this.quadGeo=new n.PlaneGeometry(1,1),this.quadRTT=new n.Mesh(this.quadGeo,this.noiseMat),this.quadRTT.position.z=-5,this.sceneRTT.add(this.quadRTT),this.initialized=!0},t.prototype.onShutdown=function(){this.sceneRTT&&(this.sceneRTT.remove(this.cameraRTT),this.sceneRTT.remove(this.quadRTT)),this.sceneRTT=void 0,this.quadRTT=void 0,this.quadGeo&&this.quadGeo.dispose(),this.noiseMat&&this.noiseMat.dispose(),this.uniforms=void 0},t.prototype.onEntityReady=function(){this.autoLoad&&this.renderNoise()},t.prototype.onAttributesChanged=function(e){this.initialized&&(-1!==e.indexOf("scale")&&void 0!==this.scale.x&&(this.uniforms.scale.value.x=this.scale.x,this.uniforms.scale.value.y=this.scale.y),-1!==e.indexOf("offset")&&void 0!==this.offset.x&&(this.uniforms.offset.value.x=this.offset.x,this.uniforms.offset.value.y=this.offset.y),-1!==e.indexOf("layerScale")&&void 0!==this.layerScale.x&&(this.uniforms.layerScale.value.x=this.layerScale.x,this.uniforms.layerScale.value.y=this.layerScale.y,this.uniforms.layerScale.value.z=this.layerScale.z,this.uniforms.layerScale.value.w=this.layerScale.w),-1!==e.indexOf("layerAmplitude")&&void 0!==this.layerAmplitude.x&&(this.uniforms.layerAmplitude.value.x=this.layerAmplitude.x,this.uniforms.layerAmplitude.value.y=this.layerAmplitude.y,this.uniforms.layerAmplitude.value.z=this.layerAmplitude.z,this.uniforms.layerAmplitude.value.w=this.layerAmplitude.w),this.renderNoise())},t.prototype.renderNoise=function(){this.getThreeRenderer().render(this.sceneRTT,this.cameraRTT,this.getRuntimeData(),!0),this.getThreeRenderer().setRenderTarget(null)},t.prototype.changeNoiseValues=function(e,t,r,i){this.layerAmplitude=e,this.layerScale=t,this.scale=r,this.offset=i,this.onAttributesChanged(["layerAmplitude","layerScale","scale","offset"])},t}(a.default);t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(12),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.skyboxTexture=null,t.stereoEnabled=!1,t.size=100,t.skyboxMesh=null,t.skyboxMeshRightEye=null,t.skyboxGeometry=null,t.skyboxGeometryRightEye=null,t.skyboxMaterialCube=null,t.skyboxUniforms=null,t.skyboxVShader=null,t.skyboxPShader=null,t.skyboxMaterial2D=null,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.initMaterials()},t.prototype.onShutdown=function(){this.skyboxGeometry&&this.skyboxGeometry.dispose(),this.skyboxGeometryRightEye&&this.skyboxGeometryRightEye.dispose(),this.skyboxMaterialCube&&this.skyboxMaterialCube.dispose(),this.skyboxMaterial2D&&this.skyboxMaterial2D.dispose(),this.skyboxMesh=null,this.skyboxGeometry=null,this.skyboxGeometryRightEye=null,this.skyboxMaterialCube=null,this.skyboxMaterial2D=null,this.skyboxUniforms=null,this.skyboxTexture=null},t.prototype.getMesh=function(e){return void 0===e&&(e="left"),"left"===e?this.skyboxMesh:this.skyboxMeshRightEye},t.prototype.onAttributesChanged=function(e){if(-1!==e.indexOf("skyboxTexture")){var t=this.getPreviousAttribute("skyboxTexture");if(t){var r=this.getEngine().getEntityById(t);this.stopListening(r)}this.getEntity().unregisterDependencyById(this.getPreviousAttribute("skyboxTexture"));this.getEntity().getOwnDependencyInfo()[this.getAttribute("skyboxTexture")]||this.getEntity().registerDependencyById(this.getAttribute("skyboxTexture"))}this.getEntity().isBaseLoaded()&&(-1===e.indexOf("skyboxTexture")&&-1===e.indexOf("stereoEnabled")||this.initSkybox(),-1!==e.indexOf("size")&&this.skyboxMesh&&(this.skyboxMesh.scale.set(this.size,this.size,this.size),this.skyboxMeshRightEye.scale.set(this.size,this.size,this.size)))},t.prototype.onEnable=function(){this.getRuntimeData()&&(this.getRuntimeData().add(this.skyboxMesh),this.isStereo()&&this.getRuntimeData().add(this.skyboxMeshRightEye),this.skyboxTexture&&this.skyboxTexture.isUnloaded()&&this.skyboxTexture.load())},t.prototype.onDisable=function(){this.getRuntimeData()&&(this.getRuntimeData().remove(this.skyboxMesh),this.isStereo()&&this.getRuntimeData().remove(this.skyboxMeshRightEye))},t.prototype.onEntityReady=function(){this.initSkybox()},t.prototype.isStereo=function(){if(!this.skyboxTexture||!this.stereoEnabled)return!1;switch(this.skyboxTexture.getLayout()){case o.ImageLayout.Stereo2dOverUnder:case o.ImageLayout.Stereo2dUnderOver:case o.ImageLayout.Stereo2dLeftRight:case o.ImageLayout.Stereo2dRightLeft:return this.stereoEnabled;default:return!1}},t.prototype.initGeometry=function(){this.skyboxGeometry&&(this.skyboxGeometry.dispose(),this.skyboxGeometryRightEye.dispose()),this.skyboxGeometry=new n.SphereBufferGeometry(1,64,64),this.skyboxGeometryRightEye=this.skyboxGeometry.clone()},t.prototype.initStereoUvs=function(){if(this.skyboxTexture){var e=new n.Vector2,t=new n.Vector2,r=new n.Vector2,i=new n.Vector2;switch(this.skyboxTexture.getLayout()){case o.ImageLayout.Stereo2dOverUnder:e.set(1,.5),t.set(0,0),r.set(1,.5),i.set(0,.5);break;case o.ImageLayout.Stereo2dUnderOver:e.set(1,.5),t.set(0,.5),r.set(1,.5),i.set(0,0);break;case o.ImageLayout.Stereo2dLeftRight:e.set(.5,1),t.set(0,0),r.set(.5,1),i.set(.5,0);break;case o.ImageLayout.Stereo2dRightLeft:e.set(.5,1),t.set(.5,0),r.set(.5,1),i.set(0,0);break;default:return}for(var a=this.skyboxGeometry.getAttribute("uv").array,s=this.skyboxGeometryRightEye.getAttribute("uv").array,u=0;un&&i>0?(e.fillText(s,r,u),s=t+" ",u+=a):s=o}),e.fillText(s,r,u)},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.standing=!0,t.userHeight=6,t.frameData=window.hasOwnProperty("VRFrameData")?new VRFrameData:{},t.standingMatrix=new n.Matrix4,t.workVector=new n.Vector3,t.scale=1,t}return i.__extends(t,e),t.prototype.onPreUpdate=function(e){if(this.isEnabled()&&this.hasRuntimeData()){var t=this.getEngine(),r=t.getVrDisplay();if(r){t.needsRender=!0,r.getFrameData(this.frameData);var i=this.frameData.pose,n=this.getRuntimeData(),a=this.getEntity();null!==i.orientation&&(a.setQuaternion(i.orientation[0],i.orientation[1],i.orientation[2],i.orientation[3]),r.capabilities.hasPosition&&i.position&&a.setPosition(i.position[0],i.position[1],i.position[2]),this.standing&&r.stageParameters?(n.updateMatrix(),this.standingMatrix.fromArray(r.stageParameters.sittingToStandingTransform),n.applyMatrix(this.standingMatrix),a.setQuaternion(n.quaternion.x,n.quaternion.y,n.quaternion.z,n.quaternion.w),n.position.multiplyScalar(this.scale),a.setPosition(n.position.x,n.position.y,n.position.z)):(a.getPosition(this.workVector),this.workVector.multiplyScalar(this.scale),a.setPosition(this.workVector.x,this.workVector.y,this.workVector.z)))}}},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=r(18),o=r(3),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.scale=1,t.isPresenting=!1,t.wasPresenting=!1,t.vrDisplays=null,t.previousPixelRatio=1,t}return i.__extends(t,e),t.prototype.getScale=function(){return this.scale},t.prototype.setScale=function(e){this.scale=e},t.prototype.getDisplays=function(){return this.vrDisplays},t.prototype.onAwake=function(){var e=this;this.listenTo(this.getEngine(),"enableVrRendering",this.onEnableVr),this.listenTo(this.getEngine(),"disableVrRendering",this.onDisableVr),this.listenTo(this.getEngine(),"toggleVrRendering",this.onToggleVr),this.onVrDisplayPresentChange=this.onVrDisplayPresentChange.bind(this),window.addEventListener("vrdisplaypresentchange",this.onVrDisplayPresentChange,!1),navigator.getVRDisplays?navigator.getVRDisplays().then(function(t){e.vrDisplays=t,e.trigger("displaysInitialized")}):this.vrDisplays=[]},t.prototype.onShutdown=function(){e.prototype.onShutdown.call(this),window.removeEventListener("vrdisplaypresentchange",this.onVrDisplayPresentChange,!1)},t.prototype.onDisable=function(){this.isPresenting&&this.onDisableVr()},t.prototype.whenDisplaysAvailable=function(e){var t=this;this.vrDisplays?e.call(this,this.vrDisplays):this.listenToOnce(this,"displaysInitialized",function(){e.call(t,t.vrDisplays)})},t.prototype.onPostRender=function(e){var t=this.getEngine().getVrDisplay();t&&this.isPresenting&&t.submitFrame()},t.prototype.onEnableVr=function(){if(this.isEnabled()){if(!this.vrDisplays)return void this.listenToOnce(this,"displaysInitialized",this.onEnableVr.bind(this));if(this.vrDisplays.length){var e=this.vrDisplays[0];this.getEngine().setVrDisplay(e);var t=this.getRenderer().getCanvas();e.requestPresent([{source:t}]).catch(function(e){o.default.error("Failed to present to VR display",e.message)})}}},t.prototype.onDisableVr=function(){if(this.isPresenting){var e=this.getEngine().getVrDisplay();e&&(e.exitPresent(),this.getEngine().setVrDisplay(null))}},t.prototype.onToggleVr=function(){this.isPresenting?this.onDisableVr():this.onEnableVr()},t.prototype.onVrDisplayPresentChange=function(){this.wasPresenting=this.isPresenting;var e=this.getEngine().getVrDisplay();this.isPresenting=e&&e.isPresenting;var t=this.getThreeRenderer();if(this.isPresenting){var r=e.getEyeParameters("left"),i=r.renderWidth,n=r.renderHeight;if(!this.wasPresenting){if(this.previousPixelRatio=t.getPixelRatio(),a.isMobile()){var o=t.capabilities.maxTextureSize,s=2*i;s*this.previousPixelRatio>o&&(this.previousPixelRatio=Math.floor(o/s)),t.setPixelRatio(this.previousPixelRatio)}else t.setPixelRatio(1);t.setSize(2*i,n,!1),this.getEngine().trigger("vrRenderingEnabled")}}else this.wasPresenting&&(t.setPixelRatio(this.previousPixelRatio),this.getEngine().setVrDisplay(null),this.getEngine().trigger("resize"),this.getEngine().trigger("vrRenderingDisabled"))},t}(n.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(39),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.enablePreRenderFunctions=!0,t.enableShadows=!0,t.eyeTranslationL=new n.Vector3,t.eyeTranslationR=new n.Vector3,t.defaultLeftBounds=[0,0,.5,1],t.defaultRightBounds=[.5,0,.5,1],t.renderRectL={x:0,y:0,width:256,height:256},t.renderRectR={x:128,y:0,width:256,height:256},t.cameraL=new n.PerspectiveCamera,t.cameraR=new n.PerspectiveCamera,t.frameData=window.hasOwnProperty("VRFrameData")?new VRFrameData:{},t.scale=1,t}return i.__extends(t,e),t.prototype.renderView=function(t){if(this.isEnabled()&&this.hasRuntimeData()){var r=this.getRootObject();if(r.isBaseLoaded()){var i=r.getRuntimeData(),n=this.getEngine().getVrDisplay();if(!n)return e.prototype.renderView.call(this,t);var a=i.autoUpdate;a&&(i.updateMatrixWorld(),i.autoUpdate=!1);var o=n.getEyeParameters("left"),s=n.getEyeParameters("right");this.eyeTranslationL.fromArray(o.offset),this.eyeTranslationR.fromArray(s.offset);var u,p,c=this.getThreeRenderer(),h=c.getSize(),l=n.getLayers();if(l.length){var d=l[0];u=null!==d.leftBounds&&4===d.leftBounds.length?d.leftBounds:this.defaultLeftBounds,p=null!==d.rightBounds&&4===d.rightBounds.length?d.rightBounds:this.defaultRightBounds}else u=this.defaultLeftBounds,p=this.defaultRightBounds;this.renderRectL={x:Math.round(h.width*u[0]),y:Math.round(h.height*u[1]),width:Math.round(h.width*u[2]),height:Math.round(h.height*u[3])},this.renderRectR={x:Math.round(h.width*p[0]),y:Math.round(h.height*p[1]),width:Math.round(h.width*p[2]),height:Math.round(h.height*p[3])};var f=this.getRuntimeData();null===f.parent&&f.updateMatrixWorld(),f.matrixWorld.decompose(this.cameraL.position,this.cameraL.quaternion,this.cameraL.scale),f.matrixWorld.decompose(this.cameraR.position,this.cameraR.quaternion,this.cameraR.scale),this.cameraL.translateOnAxis(this.eyeTranslationL,this.scale),this.cameraR.translateOnAxis(this.eyeTranslationR,this.scale),n.depthNear=f.near,n.depthFar=f.far,n.getFrameData(this.frameData),this.cameraL.projectionMatrix.elements=this.frameData.leftProjectionMatrix,this.cameraR.projectionMatrix.elements=this.frameData.rightProjectionMatrix,c.setScissor(this.renderRectL.x,this.renderRectL.y,this.renderRectL.width,this.renderRectL.height),this.getRenderer().renderView(i,this.cameraL,{renderTarget:this.renderTarget,clearDepth:!0,clearColor:!0,viewPort:this.renderRectL,enablePreRenderFunctions:!0}),c.setScissor(this.renderRectR.x,this.renderRectR.y,this.renderRectR.width,this.renderRectR.height),this.getRenderer().renderView(i,this.cameraR,{renderTarget:this.renderTarget,clearDepth:!1,clearColor:!1,viewPort:this.renderRectR,enablePreRenderFunctions:!0}),a&&(i.autoUpdate=!0)}}},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultBoxApiBase="https://api.box.com"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(3),o=r(213),s=r(212),u=r(214),p=r(209),c=r(220),h=r(28),l=r(79),d=r(36),f=r(14),m=r(50),y=r(49),g=r(9),v=r(35),b=r(15),x=r(11),P=r(122),w=function(e){var t;return e&&e.jquery?e.get(0):"string"==typeof e?(t=document.querySelectorAll(e),t.length&&t[0]):e};t.engineMixins=y.default({},[u.default,s.default,h.default]);var E=function(e){function t(t){var r=e.call(this)||this;r.registeredGlobalEvents={},r.renderOnDemand=!1,r.needsRender=!0,r.container=void 0,r.globalEvents=void 0,r.engineName="Unnamed Instance of Box3D Engine",r.apiBase=P.defaultBoxApiBase,r.audioContext=void 0,r.paused=!1,r.runMode="player",r.runtimeNames={},r.nextRuntimeName=1,a.default.info("Engine Initialization"),r.globalScope=t.globalScope||window;return function(){if(r.globalEvents=t&&t.globalEvents||m.default,!r.globalEvents)throw new Error("No global event system supplied or found")}(),function(){r.container=r.container||w(t.container)}(),function(){if(r.canvas=r.canvas||w(t.canvas),r.canvas||(r.canvas=document.createElement("canvas"),r.container&&r.container.appendChild(r.canvas),r.canvasCreatedByEngine=!0),!(r.canvas instanceof HTMLCanvasElement))throw new Error("Failed to create canvas element")}(),function(){if(r.resourceLoader=t.resourceLoader,t.apiBase&&(r.apiBase=t.apiBase),!r.resourceLoader)throw new Error("No resource loader passed to Engine")}(),function(){r.materialUtilities=new c.default(r)}(),function(){r.geometryUtilities=new p.default}(),function(){r.engineName=t.engineName||r.engineName,r.clock=new n.Clock(!0),r.frameDelta=0,r.frameDeltaAggregate=0,r.frameCount=0,r.lastFrameDelta=r.getTimeNow(),r.avgFrameTime=0,r.paused=!1,r.documentVisible=!0,r.state="initializing",r.setRunMode(t.runMode),r.entityDispatcher=t.entityDispatcher||new o.default,r.entityDispatcher.addEngine(r)}(),function(){r.scriptRegistry=new l.default(r),Object.keys(d.default.builtInAssetDescriptors).forEach(function(e){r.createEntity(d.default.builtInAssetDescriptors[e])}),Object.keys(f.default.builtInAssetDescriptors).forEach(function(e){r.createEntity(f.default.builtInAssetDescriptors[e])})}(),function(){r.onResize=function(){r.needsRender=!0},r.onBlur=function(){r.trigger("blur")},r.onFocus=function(){r.trigger("focus")},r.onVisibilityChange=function(){var e=document.hidden||document.mozHidden||document.msHidden||document.webkitHidden;r.documentVisible&&e?r.documentVisible=!1:r.documentVisible||(r.frameDelta=0,r.lastFrameDelta=r.getTimeNow(),r.documentVisible=!0)},window.addEventListener("blur",r.onBlur),window.addEventListener("focus",r.onFocus),r.listenTo(r,"resize",r.onResize),document.addEventListener("visibilitychange",r.onVisibilityChange)}(),function(){r.globalScope[r.engineName]=r,r.update(),r.state="initialized"}(),r}return i.__extends(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this),a.default.info(this.engineName+" - Destroying engine."),window[this.engineName]&&delete window[this.engineName],this.baseRenderer=void 0,this.resourceLoader.destroy(),this.materialUtilities.destroy(),this.geometryUtilities.destroy(),window.removeEventListener("blur",this.onBlur),window.removeEventListener("focus",this.onFocus),this.stopListening(this,"resize",this.onResize),document.removeEventListener("visibilitychange",this.onVisibilityChange),this.onBlur=void 0,this.onFocus=void 0,this.onResize=void 0,this.onVisibilityChange=void 0,this.trigger("shutdown"),this.state="uninitializing",this.cancelAnimationFrame(this.animationRequestID),this.canvas&&this.canvas.parentNode&&this.canvasCreatedByEngine&&this.canvas.parentNode.removeChild(this.canvas),this.entityDispatcher&&this.entityDispatcher.removeEngine(this),this.clock=void 0,this.canvas=void 0,this.container=void 0,this.threeRenderer=void 0,this.baseRenderer=void 0,this.engineName=void 0,this.entityDispatcher=void 0,this.state="uninitialized"},t.prototype.getName=function(){return this.engineName},t.prototype.addEntities=function(e){return this.entityDispatcher?this.entityDispatcher.addEntities(e):[]},t.prototype.addEntitiesFromUrl=function(e){var t=this;return this.entityDispatcher?new Promise(function(r,i){fetch(e).then(function(e){return e.json()}).then(function(e){t.entityDispatcher.addEntities(e.entities),r(e.entities)}).catch(function(e){return i(e)})}):Promise.reject("Can't add entities without an EntityDispatcher assigned to the engine.")},t.prototype.importEntitiesFromUrl=function(e,t){var r=this;return void 0===t&&(t={}),new Promise(function(i,n){r.resourceLoader.load(e,b.default.ENTITIES,t).on(x.default.LOAD,function(e){i(r.addEntities(e))}).on(x.default.ERROR,function(e){return n(e)})})},t.prototype.importEntitiesByFileId=function(e,t,r){var i=this;return void 0===t&&(t={}),this.fetchRemoteRepresentationsFromBox(e,t,r||this.apiBase).then(function(e){return i.importEntitiesFromUrl(e.representations.entries[0].content.url_template.replace("{+asset_path}","entities.json"),t)})},t.prototype.loadEntities=function(e,t,r){var i=this;void 0===r&&(r="load"),Promise.all(e.map(function(e){var t=e instanceof g.default?e.id:e;return new Promise(function(e,n){var a=i.getEntityById(t);a?(a.when(r,function(){e()}),a.isUnloaded()&&a.load()):n(new Error("Entity can't be found."))})})).then(function(){"function"==typeof t&&t.call(i)}).catch(function(e){"function"==typeof t&&(a.default.error("loadEntities error: "+e),t.call(i,e))})},t.prototype.setVrDisplay=function(e){var t=this;this.cancelAnimationFrame(this.animationRequestID),this.vrDevice=e,this.animationRequestID=this.requestAnimationFrame(function(){t.needsRender=!0,t.update()})},t.prototype.getVrDisplay=function(){return this.vrDevice},t.prototype.getApplication=function(){return this.getAssetsByClass(v.default).find(function(e){return e.isBaseLoaded()})},t.prototype.setRunMode=function(e){this.runMode="editor"===e?e:"player"},t.prototype.getRunMode=function(){return this.runMode},t.prototype.getRenderer=function(){return this.baseRenderer},t.prototype.setRenderer=function(e){this.baseRenderer&&(this.baseRenderer.onShutdown(),this.baseRenderer.stopListening()),this.baseRenderer=e,this.threeRenderer=e.threeRenderer},t.prototype.getThreeRenderer=function(){return this.threeRenderer},t.prototype.getGPUCapability=function(e){return this.baseRenderer.caps[e]},t.prototype.getAudioContext=function(){if(!this.audioContext){var e=this.globalScope.AudioContext||this.globalScope.webkitAudioContext;e&&(this.audioContext=new e,this.audioContext||a.default.warn(this.engineName+" - Failed to create Web Audio API context"))}return this.audioContext},t.prototype.getRuntimeName=function(e){return this.runtimeNames.hasOwnProperty(e)||(this.runtimeNames[e]=this.nextRuntimeName.toString(),this.nextRuntimeName++),this.runtimeNames[e]},t.prototype.pause=function(){this.paused||(this.paused=!0,this.clock.stop(),this.cancelAnimationFrame(this.animationRequestID),a.default.info(this.engineName+" engine has been paused."))},t.prototype.unpause=function(){this.paused&&(this.paused=!1,this.frameDelta=0,this.lastFrameDelta=this.getTimeNow(),this.clock.start(),a.default.info(this.engineName+" engine has been unpaused."),this.update())},t.prototype.getTimeNow=function(){return.001*(window.performance&&window.performance.now?window.performance.now():Date.now())},t.prototype.update=function(){var e=this;this.paused||(this.animationRequestID=this.requestAnimationFrame(function(){e.update()}),this.documentVisible&&(this.frameCount++,this.frameDelta=this.getTimeNow()-this.lastFrameDelta,this.lastFrameDelta=this.getTimeNow(),this.frameDeltaAggregate+=this.frameDelta,this.avgFrameTime=this.frameDeltaAggregate/this.frameCount,this.trigger("preUpdate",this.frameDelta),this.trigger("update",this.frameDelta),this.trigger("postUpdate",this.frameDelta),this.renderOnDemand&&!this.needsRender||(this.needsRender=!1,this.trigger("preRender",this.frameDelta),this.trigger("render",this.frameDelta),this.trigger("renderGroup1",this.frameDelta),this.trigger("renderGroup2",this.frameDelta),this.trigger("renderGroup3",this.frameDelta),this.trigger("renderGroup4",this.frameDelta),this.trigger("renderGroup5",this.frameDelta),this.trigger("renderGroup6",this.frameDelta),this.trigger("renderGroup7",this.frameDelta),this.trigger("renderGroup8",this.frameDelta),this.trigger("renderGroup9",this.frameDelta),this.trigger("renderGroup10",this.frameDelta),this.trigger("postRender",this.frameDelta))))},t.prototype.fetchRemoteRepresentationsFromBox=function(e,t,r){var n=this;void 0===t&&(t={});var a=(r||this.apiBase)+"/2.0/files/"+e+"?fields=representations";return new Promise(function(e,r){return n.resourceLoader.load(a,b.default.JSON,i.__assign({headers:{"X-Rep-Hints":"[3d]"}},t)).on(x.default.LOAD,function(t){return e(t)}).on(x.default.ERROR,function(e){return r(e)})})},t.prototype.requestAnimationFrame=function(e){return this.vrDevice?this.vrDevice.requestAnimationFrame(e):requestAnimationFrame(e)},t.prototype.cancelAnimationFrame=function(e){return this.vrDevice?this.vrDevice.cancelAnimationFrame(e):cancelAnimationFrame(e)},t}(t.engineMixins);t.default=E},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={roughness:{displayName:"Roughness",description:"How rough the surface appears.",type:"f",min:0,max:1,default:.5,isRenderParam:!0},roughnessMap:{displayName:"Roughness Map",description:"A texture that stores the roughness info of the material.",type:"t",default:null,isRenderParam:!0,enabledWhen:{roughnessMap:{notEqualsDefault:!0}}},metalness:{displayName:"Metalness",description:"How metallic the surface appears (multiplied by the metalness texture).",type:"f",min:0,max:1,default:0,isRenderParam:!0,enabledWhen:{metalness:{notEqualsDefault:!0}}},metalnessMap:{displayName:"Metalness Map",description:"A texture that contains the metalness of the material.",type:"t",default:null,isRenderParam:!0,enabledWhen:{metalnessMap:{notEqualsDefault:!0}}}};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"accessor",title:"AccessorDef",type:"object",description:"A typed-view into raw binary data.",properties:{componentType:{type:"string",enum:["int8","uint8","int16","int32","uint32","float32","float64"],description:"These correspond to typed arrays: Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array."},type:{type:"string",enum:["scalar","vec2","vec3","vec4","mat2","mat3","mat4"],description:"Specifies if elements are scalars, vectors or matrices."},byteOffset:{type:"integer",description:"Byte offset into the binary data."},byteStride:{type:"integer",description:"The number of bytes between successive elements (0 indicates that the elements are tightly packed)."},count:{type:"integer",description:"The number of elements, not to be confused with the number of components or bytes. For example, the number of positions, not the number of floats."}},additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"animationAsset",title:"AnimationAssetDef",type:"object",properties:i.__assign({},n.default.properties,{type:{enum:["animation"]},properties:{$ref:"animationAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"animationAssetProperties",title:"AnimationAssetPropertiesDef",type:"object",properties:i.__assign({},n.default.properties,{clips:{type:"object",description:"The clips for the animation.",properties:{},additionalProperties:{$ref:"animationClip.json"},default:{}},layers:{type:"object",description:"The layers of the animation.",properties:{},additionalProperties:{$ref:"animationLayer.json"},defualt:{}},channels:{type:"object",description:"The channels for the animation.",properties:{},additionalProperties:{$ref:"animationChannel.json"},default:{}}}),required:["clips","layers","channels"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"animationChannel",title:"AnimationChannelDef",type:"object",description:"An animation channel.",properties:{name:{type:"string",description:"The channel's name."},targetObject:{type:"array",description:"The path of the object to animate.",items:{type:"string"},default:[]},targetProperty:{type:"string",description:"The path of the property to animate."},values:{type:"string",description:"The ID of the accessor for the channel values."},times:{type:"string",description:"The ID of the accessor for the channel times."},interpolation:{type:"string",enum:["linear"],description:"The interpolation type for the channel."}},required:["name","targetObject","targetProperty","values","times","interpolation"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"animationClip",title:"AnimationClipDef",type:"object",description:"An animation clip.",properties:{name:{type:"string",description:"The clip's name."},start:{type:"number",description:"The take's start time, in seconds.",default:0},stop:{type:"number",description:"The take's stop time, in seconds.",default:0},layers:{type:"array",items:{type:"string"},default:[]}},required:["name","start","stop","layers"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"animationLayer",title:"AnimationLayerDef",type:"object",description:"An animation layer.",properties:{name:{type:"string",description:"The layer's name."},blendMode:{enum:["additive"],description:"The layer's blend mode.",default:"additive"},blendWeight:{type:"number",description:"The layer's blend weight.",default:1},channels:{type:"array",items:{type:"string"},default:[]}},required:["name","blendMode","blendWeight","channels"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"applicationAsset",title:"ApplicationAssetDef",type:"object",properties:i.__assign({},n.default.properties,{type:{enum:["application"]},properties:{$ref:"applicationAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"applicationAssetProperties",title:"ApplicationAssetPropertiesDef",type:"object",properties:i.__assign({},n.default.properties,{startupSceneId:{type:["string","null"],description:"The prefab that will be loaded when the application loads.#entity-PrefabAsset"}}),required:["startupSceneId"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"audioAsset",title:"AudioAssetDef",type:"object",properties:i.__assign({},n.default.properties,{type:{enum:["audio"]},representations:i.__assign({},n.default.properties.representations,{type:{$ref:"audioRepresentation.json"}}),properties:{$ref:"audioAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"audioAssetProperties",title:"AudioAssetPropertiesDef"});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(32),a=i.__assign({},n.default,{id:"audioRepresentation",title:"AudioRepresentationDef",properties:i.__assign({},n.default.properties,{bitRate:{type:"number"},sampleRate:{type:"number"},stereo:{type:"boolean"},startTime:{type:"number"},duration:{type:"number"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"boneObject",title:"BoneObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["bone"]},properties:{$ref:"boneObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"boneObjectProperties",title:"BoneObjectPropertiesDef"});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"box3",title:"Box3Def",type:"object",properties:{min:{$ref:"vector3.json"},max:{$ref:"vector3.json"}},required:["min","max"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"bufferAsset",title:"BufferAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["buffer"]},properties:{$ref:"bufferAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"bufferAssetProperties",title:"BufferAssetPropertiesDef",properties:i.__assign({},n.default.properties,{src:{type:"string",description:"The URL of the binary file."},isExternal:{type:"boolean",description:"True is the asset should be loaded from outside of the base data provider/content provider.",default:!1},contentLength:{type:"number",description:"The HTTP Content-Length."},accessors:{type:"object",properties:{},additionalProperties:{$ref:"accessor.json"},description:"Typed-views into the binary file."}}),required:["src","contentLength"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"cameraObject",title:"CameraObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["camera"]},properties:{$ref:"cameraObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"cameraObjectProperties",title:"CameraObjectPropertiesDef",properties:i.__assign({},n.default.properties,{cameraType:{type:"string",description:"The projection type of the camera. e.g. perspective or orthographic",enum:["perspective","orthographic"],default:"perspective"},fov:{type:"number",description:"The field of view of the camera. i.e. angular size of view.",default:50,dependencies:{cameraType:["perspective"]}},aspect:{type:"number",description:"Aspect ratio of view. i.e. Width divided by height.",default:1.7777777777777777},near:{type:"number",description:"The near clipping plane of the camera. i.e. the closest distance rendered.",default:.1},far:{type:"number",description:"The far clipping plane of the camera. i.e. the furthest distance rendered.",default:12e3},right:{type:"number",description:"The right clipping plane of an orthographic camera.",default:10,dependencies:{cameraType:["orthographic"]}},left:{type:"number",description:"The left clipping plane of an orthographic camera.",default:-10,dependencies:{cameraType:["orthographic"]}},top:{type:"number",description:"The top clipping plane of an orthographic camera.",default:10,dependencies:{cameraType:["orthographic"]}},bottom:{type:"number",description:"The bottom clipping plane of an orthographic camera.",default:-10,dependencies:{cameraType:["orthographic"]}}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"colorRgb",title:"ColorRgb",type:"object",properties:{r:{type:"number",minimum:0,maximum:1},g:{type:"number",minimum:0,maximum:1},b:{type:"number",minimum:0,maximum:1}},required:["r","g","b"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"component",title:"ComponentDef",type:"object",properties:{id:{type:"string"},scriptId:{type:"string"},name:{type:"string"},enabled:{type:"boolean"},attributes:{type:"object",properties:{},additionalProperties:{$ref:"componentAttribute.json"}}},additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"componentAttribute",title:"ComponentAttributeDef",type:"object",properties:{type:{type:"string"},subType:{type:"object",properties:{type:{type:"string"},attributes:{}},additionalProperties:!1},attributes:{type:"array",items:{type:"object",properties:{type:{type:"string"},attributes:{}},additionalProperties:!1}}},additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"documentAsset",title:"DocumentAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["document"]},properties:{$ref:"documentAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"documentAssetProperties",title:"DocumentAssetPropertiesDef"});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"dracoAttribute",title:"DracoAttributeDef",type:"object",description:"Specifies the name and ID of a Draco attribute.",properties:{name:{type:"string",description:"The name of the this attribute. For example, texture's have a uvSet property that contains the name of a UV attribute."},id:{type:"string",description:"The ID of the Draco attribute."}},required:["name","id"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(29),a=i.__assign({},n.default,{id:"dracoGeometryAsset",title:"DracoGeometryAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["dracoGeometry"]},properties:{$ref:"dracoGeometryAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(30),a=i.__assign({},n.default,{id:"dracoGeometryAssetProperties",title:"DracoGeometryAssetPropertiesDef",properties:i.__assign({},n.default.properties,{accessorId:{type:["string","null"],description:"The ID of the accessor containing the draco geometry: #."},attributes:{type:"object",properties:{},additionalProperties:{$ref:"dracoAttribute.json"},description:"A collection of vertex attributes. All attributes must have the same number of elements."}}),required:["accessorId"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"eventScope",title:"EventScopeDef",type:"object",properties:{scopeName:{type:"string",enum:["global","this","entity","component"],default:"global"},entityId:{description:"The entity's name.",type:["string","null"],default:null},componentId:{description:"The entity's name.",type:["string","null"],default:null}},required:["scopeName"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(73),a=i.__assign({},n.default,{id:"imageAsset",title:"ImageAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["image"]},representations:i.__assign({},n.default.properties.representations,{type:{$ref:"imageRepresentation.json"}}),properties:{$ref:"imageAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(45),a=i.__assign({},n.default,{id:"imageAssetProperties",title:"ImageAssetPropertiesDef",properties:i.__assign({},n.default.properties,{useCompression:{type:"boolean",description:"True if we will try to use a hardware-compressed version of the image 'instead of a regular one. This depends on the hardware capabilities of the user and the data formats available.",default:!0}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(32),a={id:"imageRepresentation",title:"ImageRepresentationDef",properties:i.__assign({},n.default.properties,{src:{type:"string",description:"The URL of the representation."},channels:{type:"array",items:{type:"string",enum:["red","green","blue","alpha","gray","exponent"]}},compression:{type:"string",enum:["dxt","dxt1","dxt5","jpeg","zip"]},isExternal:{type:"boolean"},width:{type:"integer",description:"The width, in pixels, of the representation."},height:{type:"integer",description:"The height, in pixels, of the representation."},colorspace:{type:"string",enum:["srgb","rgb"]}}),required:["src"],additionalProperties:!1};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"lightObject",title:"LightObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["light"]},properties:{$ref:"lightObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"lightObjectProperties",title:"LightObjectPropertiesDef",properties:i.__assign({},n.default.properties,{lightType:{type:"string",description:"The type of light. e.g. directional, point, spot, etc.",enum:["directional","point","spot","hemisphere","ambient"],default:"directional"},color:{$ref:"colorRgb.json",description:"The color of the light in {r, g, b} form. Each channel is defined between 0.0 and 1.0.",default:{r:.7333,g:.7333,b:.7333}},intensity:{type:"number",description:"The brightness of the light.",minimum:0,default:1},distance:{type:"number",description:"A value that controls the falloff rate of the light.",default:0,minimum:0,dependencies:{lightType:["point","spot"]}},decay:{type:"number",description:"The decay exponent of the light falloff.",default:2,minimum:0,maximum:5,dependencies:{lightType:["point","spot"]}},angle:{type:"number",description:"The angle of the bright light at the center of the spotlight.",default:Math.PI/3,minimum:1,maximum:Math.PI,dependencies:{lightType:["spot"]}},penumbra:{type:"number",description:"The outer angle that defines the edge of the spotlight.",default:Math.PI/4,minimum:.001,maximum:Math.PI/2,dependencies:{lightType:["spot"]}},groundColor:{$ref:"colorRgb.json",description:"The color of the lower half of the hemisphere light.",dependencies:{lightType:["hemisphere"]},default:{r:.033,g:.333,b:.7333}},castShadow:{type:"boolean",description:"Whether or not the light casts a shadow.",dependencies:{lightType:["directional","spot","point"]},default:!1},receiveShadow:{description:"Doesn't apply to lights. #unused"},shadowCameraNear:{type:"number",description:"Near clip plane for the shadow rendering. i.e. how far from the light the shadow casting begins.",default:.1},shadowCameraFar:{type:"number",description:"Far clip plane for the shadow rendering. i.e. how far from the light the shadow casting ends.",default:20},shadowCameraLeft:{type:"number",description:"Left clip plane for the shadow rendering. i.e. how far to the left the shadow casting extends.",default:-10,dependencies:{lightType:["directional"]}},shadowCameraRight:{type:"number",description:"Right clip plane for the shadow rendering. i.e. how far to the right the shadow casting extends.",default:10,dependencies:{lightType:["directional"]}},shadowCameraTop:{type:"number",description:"Top clip plane for the shadow rendering. i.e. how far to the top the shadow casting extends.",default:10,dependencies:{lightType:["directional"]}},shadowCameraBottom:{type:"number",description:"Bottom clip plane for the shadow rendering. i.e. how far to the bottom the shadow casting extends.",default:-10,dependencies:{lightType:["directional"]}},shadowBias:{type:"number",description:"Small value for pushing shadow depth toward or away from the light. This can help reduce shadowing artifacts.",default:-.0015,step:1e-4,minimum:-.01,maximum:.01},shadowMapWidth:{type:"integer",default:1024,description:"Resolution of the shadow map texture used for this light. #read-only"},shadowMapHeight:{type:"integer",default:1024,description:"Resolution of the shadow map texture used for this light. #read-only"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"materialAsset",title:"MaterialAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["material"]},properties:{$ref:"materialAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"materialAssetProperties",title:"MaterialAssetPropertiesDef",properties:i.__assign({},n.default.properties,{shaderId:{type:"string",default:"fbx_surface_phong_shader"}}),additionalProperties:!0});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"meshAttribute",title:"MeshAttributeDef",type:"object",description:"Specifies a range of attribute data for the vertices of a mesh.",properties:{name:{type:"string",description:"The name of the this attribute. For example, texture's have a uvSet property that contains the name of a UV attribute."},accessorId:{type:["string","null"],description:"The ID of the buffer asset and accessor: #."}},required:["name","accessorId"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(29),a=i.__assign({},n.default,{id:"meshGeometryAsset",title:"MeshGeometryAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["meshGeometry"]},properties:{$ref:"meshGeometryAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(30),a=i.__assign({},n.default,{id:"meshGeometryAssetProperties",title:"MeshGeometryAssetPropertiesDef",properties:i.__assign({},n.default.properties,{attributes:{type:"object",properties:{},additionalProperties:{$ref:"meshAttribute.json"},description:"A collection of vertex attributes. All attributes must have the same number of elements.#unused"},indices:{type:["string","null"],description:"The ID of the accessor containing the vertex indices: #.#unused"},primitives:{type:"array",items:{$ref:"meshPrimitive.json"},description:"The primitives (points, lines, triangles) that make up the mesh.#unused"}}),required:["attributes","indices","primitives"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"meshObject",title:"MeshObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["mesh"]},properties:{$ref:"meshObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"meshObjectProperties",title:"MeshObjectPropertiesDef",properties:i.__assign({},n.default.properties,{customDepthMaterial:{type:["string","null"],description:"Material for doing custom depth rendering. This is used when the mesh is rendered in a depth pass, shadow, etc.",default:null},materials:{type:"array",description:"The array of materials used by this mesh. #entity-MaterialAsset",items:{type:["string","null"]},default:["missingMaterial"]},geometryId:{type:["string","null"],description:"The geometry used by this mesh. #entity-BaseGeometryAsset",default:null},skinId:{type:["string","null"],description:"The skin asset used by this mesh (if it uses skinning). #entity-SkinAsset",default:null}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={$schema:"http://json-schema.org/draft-04/schema",id:"meshPrimitve",title:"meshPrimitiveDef",type:"object",description:"A mesh primitive with an optional material assignment.",properties:{primitive:{enum:["points","lines","triangles"],description:"The type of primitive to render.",default:"triangles"},count:{type:"integer",description:"The number of vertices to draw.",default:0},start:{type:"integer",description:"The index of the first vertex to draw.",default:0},offset:{type:"integer",description:"An offset to apply to each index. This can be used to overcome the 16-bit index limit imposed by WebGL. For example, the first component of a vertex attribute with a value size of 3 would be referenced as follows: values[3 * (offset + indices[start + i])].",default:0},materialIndex:{type:"integer",description:"The index of the material to apply to the primitive being rendered.",default:0}},required:["primitve","count"],additionalProperties:!1}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"nodeObject",title:"NodeObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["node"]}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"nodeObjectProperties",title:"NodeObjectPropertiesDef",properties:i.__assign({},n.default.properties)});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"prefabAsset",title:"PrefabAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["prefab"]},properties:{$ref:"prefabAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"prefabAssetProperties",title:"PrefabAssetPropertiesDef",properties:i.__assign({},n.default.properties,{rootObjectId:{type:["string","null"],default:null,description:"The ID of the BaseObject that serves as the root node of a hierarchy. #entity-BaseObject"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(29),a=i.__assign({},n.default,{id:"primitiveGeometryAsset",title:"PrimitiveGeometryAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["primitiveGeometry"]},properties:{$ref:"primitiveGeometryAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(30),a=i.__assign({},n.default,{id:"primitiveGeometryAssetProperties",title:"PrimitiveGeometryAssetPropertiesDef",properties:i.__assign({},n.default.properties,{type:{type:"string",description:"The basic shape of the geometry.",default:"sphere",enum:["sphere","box","plane","torus","cylinder"]},radius:{type:"number",description:"The radius of the sphere/torus.",default:.5,minimum:0,dependencies:{type:["sphere","torus"]}},segmentsU:{type:"integer",description:"The number of segments along the first axis of the sphere/torus/cylinder.",default:24,minimum:0,dependencies:{type:["torus","sphere","cylinder"]}},segmentsV:{type:"integer",description:"The number of segments along the second axis of the sphere/torus/cylinder.",default:24,minimum:0,dependencies:{type:["torus","sphere","cylinder"]}},sizeX:{type:"number",description:"The size of the geometry along the x-axis.",default:1,dependencies:{type:["box","plane"]}},sizeY:{type:"number",description:"The size of the geometry along the y-axis.",default:1,dependencies:{type:["box","plane"]}},sizeZ:{type:"number",description:"The size of the geometry along the z-axis.",default:1,dependencies:{type:["box"]}},segmentsX:{type:"integer",description:"The number of segments (quads) of the geometry along the x-axis.",default:1,minimum:0,dependencies:{type:["box","plane"]}},segmentsY:{type:"integer",description:"The number of segments (quads) of the geometry along the y-axis.",default:1,minimum:0,dependencies:{type:["box","plane"]}},segmentsZ:{type:"integer",description:"The number of segments (quads) of the geometry along the z-axis.",default:1,minimum:0,dependencies:{type:["box"]}},radiusTop:{type:"number",description:"The radius of the top of the cylinder.",default:.5,minimum:0,dependencies:{type:["cylinder"]}},radiusBottom:{type:"number",description:"The radius at the bottom of the cylinder.",default:.5,minimum:0,dependencies:{type:["cylinder"]}},height:{type:"number",description:"The height of the cylinder.",default:1,minimum:0,dependencies:{type:["cylinder"]}},open:{type:"boolean",description:"Controls whether the cylinder has a top and bottom.",default:!1,dependencies:{type:["cylinder"]}},tubeRadius:{type:"number",description:"The radius of the tube of the torus.",default:.1,minimum:0,dependencies:{type:["torus"]}},arcAngle:{type:"number",description:"Controls the angle, in radians, that the torus is built with. Defaults to full torus (2PI).",default:6.283185307179586,minimum:0,maximum:6.283185307179586,dependencies:{type:["torus"]}},phiStart:{type:"number",description:"Controls the longitude, in radians, that the sphere construction starts at.",default:0,minimum:0,maximum:6.283185307179586,dependencies:{type:["sphere"]}},phiLength:{type:"number",description:"Controls the longitude, in radians, that the sphere construction ends at. Defaults to 2PI.",default:6.283185307179586,minimum:0,maximum:6.283185307179586,dependencies:{type:["sphere"]}},thetaStart:{type:"number",description:"Controls the angle, in radians, that the construction starts at.",default:0,minimum:0,maximum:6.283185307179586,dependencies:{type:["sphere","cylinder"]}},thetaLength:{type:"number",description:"Controls the angle, in radians, that the construction ends at. Defaults to PI.",default:3.141592653589793,minimum:0,maximum:6.283185307179586,dependencies:{type:["sphere","cylinder"]}}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(46),a=i.__assign({},n.default,{id:"renderTexture2DAsset",title:"RenderTexture2DAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["renderTexture2D"]},properties:{$ref:"renderTexture2DAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(47),a=i.__assign({},n.default,{id:"renderTexture2DAssetProperties",title:"RenderTexture2DAssetPropertiesDef"});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(46),a=i.__assign({},n.default,{id:"renderTextureCubeAsset",title:"RenderTextureCubeAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["renderTextureCube"]},properties:{$ref:"renderTextureCubeAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(47),a=i.__assign({},n.default,{id:"renderTextureCubeAssetProperties",title:"RenderTextureCubeAssetPropertiesDef",properties:i.__assign({},n.default.properties,{mappingType:{type:"string",enum:["null","uv","environment"],description:"This value is temporarily here for compatibility with three.js. Remove it when adding a separate transform object to textures.",default:"environment"},textureUse:{type:"string",enum:["standard","sphericalReflection","sphereReflection","shadow","light","bumpNormal"],description:"Hints at the type of data that the texture contains.",default:"sphericalReflection"},mapping:{type:"string",default:"cubeReflection",description:"The mapping of the texture when applied to a material.",enum:["cubeReflection","cubeRefraction"]}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"sceneObject",title:"SceneObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["scene"]},properties:{$ref:"sceneObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"sceneObjectProperties",title:"SceneObjectPropertiesDef",properties:i.__assign({},n.default.properties,{fogEnabled:{type:"boolean",description:"Enable fog in the scene.",default:!1},fogColor:{$ref:"colorRgb.json",description:"The color of the fog in {r, g, b} form. Each channel is defined between 0.0 and 1.0.",default:{r:.5,g:.5,b:.5}},fogDensity:{type:"number",description:"The density of the fog. A higher number represents denser fog.",default:4e-4,minimum:0,maximum:1}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"scriptAsset",title:"ScriptAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["script"]},properties:{$ref:"scriptAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"scriptAssetProperties",title:"ScriptAssetPropertiesDef",properties:i.__assign({},n.default.properties,{attributes:{type:"object",description:"The attributes of the component instanced from this script.",default:{}},description:{type:"string",description:"A description of the script, including what it would be used for.",default:""},events:{type:"object",description:"The events exposed by this script.",default:{}},externalDependencies:{type:"array",description:"Array of external files that need to be loaded for this script to work.",default:[]},filter:{type:"array",description:"An array of entity types to filter what entities this script can apply to.",items:{type:"string"},default:[]},category:{type:"string",description:"The name of a category that this script belongs to. Used for organizing large numbers of scripts.",default:""},executeIn:{type:"string",description:"Controls whether the script will run only in the editor, only in the player or in both.",enum:["player","editor","all"],default:"player"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"shaderAsset",title:"ShaderAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["shader"]},properties:{$ref:"shaderAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"shaderAssetProperties",title:"ShaderAssetPropertiesDef",properties:i.__assign({},n.default.properties,{parameters:{type:"object",description:"Parameters for the shader.",default:{},additionalProperties:{$ref:"shaderParameter.json"}},uniforms:{description:"List of uniforms for the shader, in THREE.js format of all properties not defined as a parameter.",type:"object",default:{}},vertexShader:{type:"string",description:"The actual text of the vertex shader.",default:""},fragmentShader:{type:"string",description:"The actual text of the fragment/pixel shader.",default:""}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={type:"object",id:"shaderConditions",title:"ShaderConditionsDef",properties:{or:{type:"array",items:{type:"object",properties:{},additionalProperties:!0}},equals:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"object"}]},notEquals:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"object"}]},equalsDefault:{type:"boolean"},notEqualsDefault:{type:"boolean"}},additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={id:"shaderParameter",title:"ShaderParameterDef",properties:{displayName:{type:"string"},description:{type:"string"},isRenderParam:{type:"boolean"},isUniform:{type:"boolean"},uniformName:{type:"string"},type:{type:"string",enum:["b","c","f","t","opt","v2","v3","v4"]},min:{type:"number"},max:{type:"number"},options:{type:"object",properties:{},additionalProperties:!0},displayWhen:{properties:{},additionalProperties:{$ref:"shaderConditions.json"}},enabledWhen:{properties:{},additionalProperties:{$ref:"shaderConditions.json"}},defines:{properties:{},additionalProperties:{oneOf:[{type:"string"},{type:"number"},{type:"integer"},{type:"boolean"}]}},derivatives:{type:"boolean"},default:{anyOf:[{type:"null"},{type:"string"},{type:"number"},{type:"integer"},{type:"boolean"},{type:"object",properties:{},additionalProperties:!0}]},transparency:{enum:["LessThanOne","GreaterThanOne","NotFalsy","HasAlpha"]},textureUsage:{enum:["bump","normal"]},forceUpdate:{type:"boolean"},textureType:{enum:["Cube"]},step:{type:"number"}},additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"skinAsset",title:"SkinAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["skin"]},properties:{$ref:"skinAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"skinAssetProperties",title:"SkinAssetPropertiesDef",properties:i.__assign({},n.default.properties,{bindShapeMatrix:{type:"array",description:"Bind shape matrix specifying how the mesh should be transformed into the right coordinate system for use with the joints.",items:{type:"number"},minItems:16,maxItems:16,default:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},inverseBindMatrices:{type:["string","null"],description:"The ID of the accessor containing the inverse bind matrices: #."},jointNames:{type:"array",description:"Names of the joints in this skin.",items:{type:"string"},uniqueItems:!0,default:[]}}),required:["bindShapeMatrix","inverseBindMatrices","jointNames"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(31),a=i.__assign({},n.default,{id:"texture2DAsset",title:"Texture2DAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["texture2D"]},properties:{$ref:"texture2DAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(23),a=i.__assign({},n.default,{id:"texture2DAssetProperties",title:"Texture2DAssetPropertiesDef"});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(31),a=i.__assign({},n.default,{id:"textureCubeAsset",title:"TextureCubeAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["textureCube"]},properties:{$ref:"textureCubeAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(23),a=i.__assign({},n.default,{id:"textureCubeAssetProperties",title:"TextureCubeAssetPropertiesDef",properties:i.__assign({},n.default.properties,{mappingType:{type:"string",description:"This value is temporarily here for compatibility with three.js. Remove it when adding a separate transform object to textures.",default:"environment"},textureUse:{type:"string",enum:["standard","sphericalReflection","sphereReflection","shadow","light","bumpNormal"],description:"Hints at the type of data that the texture contains.",default:"sphericalReflection"},mapping:{type:"string",default:"cubeReflection",description:"The mapping of the texture when applied to a material.",enum:["cubeReflection","cubeRefraction"]}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"vector2",title:"Vector2Def",type:"object",properties:{x:{type:"number"},y:{type:"number"}},required:["x","y"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"vector3",title:"Vector3Def",type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"}},required:["x","y","z"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"vector4",title:"Vector4Def",type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"},w:{type:"number"}},required:["x","y","z","w"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"videoAsset",title:"VideoAssetDef",type:"object",properties:i.__assign({},n.default.properties,{type:{enum:["video"]},representations:i.__assign({},n.default.properties.representations,{type:{$ref:"videoRepresentation.json"}}),properties:{$ref:"videoAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(45),a=r(23),o=i.__assign({},n.default,a.default,{id:"videoAssetProperties",title:"VideoAssetPropertiesDef",properties:i.__assign({},n.default.properties,a.default.properties,{autoPlay:{type:"boolean",description:"Automatically play the video when loaded.",default:!0},muted:{type:"boolean",description:"Mute the audio of the video, if any.",default:!0},loop:{type:"boolean",description:"Controls whether the video restarts automatically when it reaches the end.",default:!0},querySelector:{type:"string",description:"Optional query selector string to load the video data from an HTML5 video tag."}})});t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(32),a=i.__assign({},n.default,{id:"videoRepresentation",title:"VideoRepresentationDef",properties:i.__assign({},n.default.properties,{video:{type:"object",properties:{height:{type:"integer"},width:{type:"integer"}}}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e;try{e=window.WebGLRenderingContext?document.createElement("canvas").getContext("experimental-webgl"):void 0}catch(e){}var t=!!e,r=!!t&&!!e.getExtension("OES_texture_float"),i=!!t&&!(0===e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS));return e=void 0,{isWebGLEnabled:function(){return t},isFloatingPointTexturesEnabeled:function(){return r},isVertexTexturesEnabeled:function(){return i}}}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=function(e){return"node"===e.type||"camera"===e.type||"scene"===e.type||"light"===e.type||"mesh"===e.type||"bone"===e.type},t.isAsset=function(e){return!t.isObject(e)}},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t,r){var i=r(254);e.exports=function(e,t,r){if(i(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,i){return e.call(t,r,i)};case 3:return function(r,i,n){return e.call(t,r,i,n)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var r=0,i=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++r+i).toString(36))}},function(e,t,r){var i=r(269)("wks"),n=r(200),a=r(34).Symbol,o="function"==typeof a;(e.exports=function(e){return i[e]||(i[e]=o&&a[e]||(o?a:n)("Symbol."+e))}).store=i},function(e,t){function r(e,t){var r=t||0,n=i;return n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]}for(var i=[],n=0;n<256;++n)i[n]=(n+256).toString(16).substr(1);e.exports=r},function(e,t,r){(function(t){var r,i=t.crypto||t.msCrypto;if(i&&i.getRandomValues){var n=new Uint8Array(16);r=function(){return i.getRandomValues(n),n}}if(!r){var a=new Array(16);r=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),a[t]=e>>>((3&t)<<3)&255;return a}}e.exports=r}).call(t,r(77))},function(e,t,r){function i(e){return r(n(e))}function n(e){var t=a[e];if(!(t+1))throw new Error("Cannot find module '"+e+"'.");return t}var a={"./accessor":125,"./accessor.ts":125,"./animationAsset":126,"./animationAsset.ts":126,"./animationAssetProperties":127,"./animationAssetProperties.ts":127,"./animationChannel":128,"./animationChannel.ts":128,"./animationClip":129,"./animationClip.ts":129,"./animationLayer":130,"./animationLayer.ts":130,"./applicationAsset":131,"./applicationAsset.ts":131,"./applicationAssetProperties":132,"./applicationAssetProperties.ts":132,"./audioAsset":133,"./audioAsset.ts":133,"./audioAssetProperties":134,"./audioAssetProperties.ts":134,"./audioRepresentation":135,"./audioRepresentation.ts":135,"./baseAsset":7,"./baseAsset.ts":7,"./baseAssetProperties":8,"./baseAssetProperties.ts":8,"./baseEntity":43,"./baseEntity.ts":43,"./baseEntityProperties":44,"./baseEntityProperties.ts":44,"./baseGeometryAsset":29,"./baseGeometryAsset.ts":29,"./baseGeometryAssetProperties":30,"./baseGeometryAssetProperties.ts":30,"./baseImageAsset":73,"./baseImageAsset.ts":73,"./baseImageAssetProperties":45,"./baseImageAssetProperties.ts":45,"./baseObject":16,"./baseObject.ts":16,"./baseObjectProperties":17,"./baseObjectProperties.ts":17,"./baseRenderTextureAsset":46,"./baseRenderTextureAsset.ts":46,"./baseRenderTextureAssetProperties":47,"./baseRenderTextureAssetProperties.ts":47,"./baseTextureAsset":31,"./baseTextureAsset.ts":31,"./baseTextureAssetProperties":23,"./baseTextureAssetProperties.ts":23,"./boneObject":136,"./boneObject.ts":136,"./boneObjectProperties":137,"./boneObjectProperties.ts":137,"./box3":138,"./box3.ts":138,"./bufferAsset":139,"./bufferAsset.ts":139,"./bufferAssetProperties":140,"./bufferAssetProperties.ts":140,"./cameraObject":141,"./cameraObject.ts":141,"./cameraObjectProperties":142,"./cameraObjectProperties.ts":142,"./colorRgb":143,"./colorRgb.ts":143,"./commonImageProperties":48,"./commonImageProperties.ts":48,"./component":144,"./component.ts":144,"./componentAttribute":145,"./componentAttribute.ts":145,"./documentAsset":146,"./documentAsset.ts":146,"./documentAssetProperties":147,"./documentAssetProperties.ts":147,"./dracoAttribute":148,"./dracoAttribute.ts":148,"./dracoGeometryAsset":149,"./dracoGeometryAsset.ts":149,"./dracoGeometryAssetProperties":150,"./dracoGeometryAssetProperties.ts":150,"./eventScope":151,"./eventScope.ts":151,"./imageAsset":152,"./imageAsset.ts":152,"./imageAssetProperties":153,"./imageAssetProperties.ts":153,"./imageRepresentation":154,"./imageRepresentation.ts":154,"./index":4,"./index.ts":4,"./lightObject":155,"./lightObject.ts":155,"./lightObjectProperties":156,"./lightObjectProperties.ts":156,"./materialAsset":157,"./materialAsset.ts":157,"./materialAssetProperties":158,"./materialAssetProperties.ts":158,"./meshAttribute":159,"./meshAttribute.ts":159,"./meshGeometryAsset":160,"./meshGeometryAsset.ts":160,"./meshGeometryAssetProperties":161,"./meshGeometryAssetProperties.ts":161,"./meshObject":162,"./meshObject.ts":162,"./meshObjectProperties":163,"./meshObjectProperties.ts":163,"./meshPrimitive":164,"./meshPrimitive.ts":164,"./nodeObject":165,"./nodeObject.ts":165,"./nodeObjectProperties":166,"./nodeObjectProperties.ts":166,"./prefabAsset":167,"./prefabAsset.ts":167,"./prefabAssetProperties":168,"./prefabAssetProperties.ts":168,"./primitiveGeometryAsset":169,"./primitiveGeometryAsset.ts":169,"./primitiveGeometryAssetProperties":170,"./primitiveGeometryAssetProperties.ts":170,"./renderTexture2DAsset":171,"./renderTexture2DAsset.ts":171,"./renderTexture2DAssetProperties":172,"./renderTexture2DAssetProperties.ts":172,"./renderTextureCubeAsset":173,"./renderTextureCubeAsset.ts":173,"./renderTextureCubeAssetProperties":174,"./renderTextureCubeAssetProperties.ts":174,"./representation":32,"./representation.ts":32,"./sceneObject":175,"./sceneObject.ts":175,"./sceneObjectProperties":176,"./sceneObjectProperties.ts":176,"./scriptAsset":177,"./scriptAsset.ts":177,"./scriptAssetProperties":178,"./scriptAssetProperties.ts":178,"./shaderAsset":179,"./shaderAsset.ts":179,"./shaderAssetProperties":180,"./shaderAssetProperties.ts":180,"./shaderConditions":181,"./shaderConditions.ts":181,"./shaderParameter":182,"./shaderParameter.ts":182,"./skinAsset":183,"./skinAsset.ts":183,"./skinAssetProperties":184,"./skinAssetProperties.ts":184,"./texture2DAsset":185,"./texture2DAsset.ts":185,"./texture2DAssetProperties":186,"./texture2DAssetProperties.ts":186,"./textureCubeAsset":187,"./textureCubeAsset.ts":187,"./textureCubeAssetProperties":188,"./textureCubeAssetProperties.ts":188,"./vector2":189,"./vector2.ts":189,"./vector3":190,"./vector3.ts":190,"./vector4":191,"./vector4.ts":191,"./videoAsset":192,"./videoAsset.ts":192,"./videoAssetProperties":193,"./videoAssetProperties.ts":193,"./videoRepresentation":194,"./videoRepresentation.ts":194};i.keys=function(){return Object.keys(a)},i.resolve=n,e.exports=i,i.id=204},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0);t.version="0.0.0-semantic-release";var n=r(1);t.THREE=n;var a=r(241);t.Components=a;var o=r(122);t.Constants=o;var s=r(4);t.Schemas=s.default;var u=r(123);t.Engine=u.default;var p=r(79);t.ScriptRegistry=p.default;var c=r(9);t.BaseEntity=c.default;var h=r(52);t.AnimationAsset=h.default;var l=r(35);t.ApplicationAsset=l.default;var d=r(53);t.AudioAsset=d.default;var f=r(6);t.BaseAsset=f.default;var m=r(24);t.BaseGeometryAsset=m.default;var y=r(12);t.BaseImageAsset=y.default;var g=r(54);t.BaseRenderTextureAsset=g.default;var v=r(20);t.BaseTextureAsset=v.default;var b=r(21);t.BufferAsset=b.default;var x=r(78);t.DocumentAsset=x.default;var P=r(55);t.DracoGeometryAsset=P.default;var w=r(56);t.ImageAsset=w.default;var E=r(14);t.MaterialAsset=E.default;var T=r(57);t.MeshGeometryAsset=T.default;var S=r(58);t.PrefabAsset=S.default;var D=r(59);t.PrimitiveGeometryAsset=D.default;var _=r(60);t.RenderTexture2DAsset=_.default;var M=r(61);t.RenderTextureCubeAsset=M.default;var A=r(62);t.ScriptAsset=A.default;var C=r(36);t.ShaderAsset=C.default;var R=r(63);t.SkinAsset=R.default;var O=r(64);t.Texture2DAsset=O.default;var j=r(65);t.TextureCubeAsset=j.default;var I=r(25);t.VideoAsset=I.default;var k=r(10);t.BaseObject=k.default;var L=r(71);t.NodeObject=L.default;var B=r(69);t.BoneObject=B.default;var z=r(70);t.CameraObject=z.default;var N=r(41);t.LightObject=N.default;var V=r(22);t.MeshObject=V.default;var U=r(42);t.SceneObject=U.default;var F=r(15);t.LoadingType=F.default;var G=r(11);t.LoadingEvent=G.default;var q=r(72);t.LoadingState=q.default;var $=r(2);t.BaseComponent=$.default;var H=r(66);t.Handedness=H.Handedness;var W=r(67);t.RenderMode=W.RenderMode;var Q=r(3);t.log=Q.default;var X=r(232);t.XhrResourceLoader=X.default,i.__exportStar(r(18),t);var Z=r(50);t.globalEvents=Z.default;var Y=r(195);t.browserCaps=Y.default},function(e,t,r){r(274),e.exports=r(33).Array.find},function(e,t,r){r(275),e.exports=r(33).Math.log10},function(e,t,r){r(276),e.exports=r(33).Math.log2},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n=function(){function e(){var e=this;this.defaultGeometry=new i.BufferGeometry,this.defaultGeometry.setIndex(new i.BufferAttribute(new Uint16Array(0),1));var t={position:new i.BufferAttribute(new Float32Array(0),3),normal:new i.BufferAttribute(new Float32Array(0),3,!0),skinWeight:new i.BufferAttribute(new Float32Array(0),4,!0),skinIndex:new i.BufferAttribute(new Uint16Array(0),4,!0)};Object.keys(t).forEach(function(r){var i=t[r];e.defaultGeometry.addAttribute(r,i)})}return e.prototype.destroy=function(){this.defaultGeometry&&(this.defaultGeometry.dispose(),this.defaultGeometry=void 0)},e.prototype.getDefaultGeometry=function(){return this.defaultGeometry},e}();t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n=r(5),a=function(){function e(){this.components=[]}return e.prototype.initializeComponents=function(){this.listenTo(this.engine,"scriptDeleted",this.onScriptDeleted),this.listenTo(this,"change:component",this.onComponentChanged),this.listenTo(this,"remove:component",this.onComponentRemoved),this.listenTo(this,"add:component",this.onComponentAdded)},e.prototype.getComponentDescriptor=function(e){var t="function"!=typeof e,r=this.sharedData.components;return n.deepClone(r.find(function(r){return t||e(r)}))},e.prototype.getPreviousComponentDescriptor=function(e){var t="function"!=typeof e,r=this.sharedData.previousComponents;return n.deepClone(r.find(function(r){return t||e(r)}))},e.prototype.getComponentDescriptors=function(e){var t="function"!=typeof e;return this.sharedData.components.filter(function(r){return t||e(r)}).map(function(e){return n.deepClone(e)})},e.prototype.getComponentDescriptorById=function(e){return this.getComponentDescriptor(function(t){return t.id===e})},e.prototype.getPreviousComponentDescriptorById=function(e){return this.getPreviousComponentDescriptor(function(t){return t.id===e})},e.prototype.addComponent=function(e,t,r){void 0===t&&(t={}),void 0===r&&(r="");var i={scriptId:"string"==typeof e?e:e.id,attributes:t,enabled:!0,name:r};return this.engine.entityDispatcher.dispatchComponentAdded(this.id,i),this.components[this.components.length-1]},e.prototype.removeComponent=function(e){var t=e.getIndex();return t>=0&&(this.engine.entityDispatcher.dispatchComponentRemoved(this.id,t),!0)},e.prototype.getComponentByIndex=function(e){return this.components[e]||null},e.prototype.getComponentByName=function(e){return this.getComponent(function(t){return t.getName()===e})},e.prototype.getComponentsByName=function(e){return this.getComponents(function(t){return t.getName()===e})},e.prototype.getComponentByScriptId=function(e){return this.getComponent(function(t){return t.getScriptId()===e})},e.prototype.getComponentsByScriptId=function(e){return this.getComponents(function(t){return t.getScriptId()===e})},e.prototype.getComponentByScriptName=function(e){return this.getComponent(function(t){return t.getScriptName()===e})},e.prototype.getComponentsByScriptName=function(e){return this.getComponents(function(t){return t.getScriptName()===e})},e.prototype.getComponent=function(e){var t="function"!=typeof e;return this.components.find(function(r){return t||e(r)})},e.prototype.getComponentById=function(e){return this.getComponent(function(t){return t.getId()===e})},e.prototype.getComponents=function(e){var t="function"!=typeof e;return this.components.filter(function(r){return t||e(r)})},e.prototype.setComponents=function(e,t){var r=this;void 0===t&&(t=!1);for(var i=this.engine.entityDispatcher,n=this.sharedData.components.length;n>=0;n--)i.dispatchComponentRemoved(this.id,n);e.forEach(function(e){i.dispatchComponentAdded(r.id,e)})},e.prototype.startComponents=function(){var e=this;this.components.forEach(function(t){return e.startComponent(t)})},e.prototype.stopComponents=function(){var e=this;this.components.forEach(function(t){return e.stopComponent(t)})},e.prototype.onScriptDeleted=function(e){var t=this;this.getComponentsByScriptId(e).forEach(function(e){t.removeComponent(e)})},e.prototype.onComponentChanged=function(e,t){var r=this.getComponentByIndex(e);if(!r)throw new Error("Don't have a component at index "+e);if(t.attributes){this.assignAttributeValues(r,t.attributes);var i=Object.keys(t.attributes);r.trigger("attributesChanged",i)}void 0!==t.name&&(r.name=t.name)},e.prototype.onComponentAdded=function(e){var t=this,r=this.createComponentObject(e);r.trigger("awake"),this.assignAttributeValues(r);var i=r.getScriptAsset(),n=i.getProperty("executeIn"),a=i.getProperty("events");Object.keys(a).forEach(function(e){t.registerEvent(e,a[e],n)});var o=Object.keys(i.getProperty("attributes"));r.trigger("attributesChanged",o),this.isBaseUnloaded()||this.startComponent(r)},e.prototype.onComponentRemoved=function(e){var t=this,r=this.components[e];if(!r)throw new Error("Can't find component at index "+e+" to remove.");var i=r.getScriptAsset(),n=i.getProperty("events");Object.keys(n).forEach(function(e){t.unregisterEvent(e,n[e])}),this.stopComponent(r),this.components.splice(e,1)},e.prototype.translateAttributeValue=function(e,t,r,n){var a=this,o=this.engine;if(!r)throw new Error("Attribute "+t+" does not exist for this component.");switch(r.type){case"asset":e[t]=o.getAssetById(n);break;case"object":e[t]=o.getObjectById(n);break;case"custom":e[t]=e[t]||{},Object.keys(n).forEach(function(i){a.translateAttributeValue(e[t],i,r.attributes[i],n[i])});break;case"c":e[t]=e[t]||new i.Color,e[t].setRGB(n.r,n.g,n.b);break;case"a":e[t]=e[t]||[];var s;switch(r.subType.type){case"asset":n.forEach(function(r,i){e[t][i]=o.getAssetById(r)});break;case"object":n.forEach(function(r,i){e[t][i]=o.getObjectById(r)});break;case"custom":n.forEach(function(i,o){e[t][o]=e[t][o]||{},Object.keys(i).forEach(function(i){a.translateAttributeValue(e[t][o],i,r.subType.attributes[i],n[o][i])})});break;case"a":n.forEach(function(i,o){e[t][o]=e[t][o]||[],i.forEach(function(i,s){a.translateAttributeValue(e[t][o],s.toString(10),r.subType.subType,n[o][s])})});break;case"v2":s=i.Vector2;case"v3":s=s||i.Vector3;case"v4":s=s||i.Vector4;case"q":s=s||i.Quaternion,n.forEach(function(r,i){e[t][i]=e[t][i]||new s,e[t][i].copy(r)});break;default:n.forEach(function(r,i){e[t][i]=r})}break;case"v2":s=i.Vector2;case"v3":s=s||i.Vector3;case"v4":s=s||i.Vector4;case"q":s=s||i.Quaternion,e[t]=e[t]||new s,e[t].copy(n);break;default:e[t]=n}},e.prototype.assignAttributeValues=function(e,t){var r=this,i="object"!=typeof t,n=e.getScriptAsset(),a=n.getProperty("attributes")||{};Object.keys(a).forEach(function(n){if(i||t.hasOwnProperty(n)){var o=a[n],s=e.getAttribute(o.name);r.translateAttributeValue(e,o.name,o,s)}})},e.prototype.createComponentObject=function(e){var t=e.scriptId,r=this.engine.getAssetById(t);if(!r)throw new Error("Unable to find script asset for "+t);r.isUnloaded()&&r.load();var i=new r.sharedData.classConstructor;return this.components.push(i),Object.assign(i,{id:e.id,name:e.name,scriptName:r.getName(),scriptId:t,enabled:!!e.enabled,entity:this}),i.bindSelfEvents(),i},e.prototype.startComponent=function(e){e.trigger("startup")},e.prototype.stopComponent=function(e){e.trigger("shutdown")},e}();t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(9),n=r(3),a=function(){function e(){this.ownDependencies={},this.dependencies={}}return e.prototype.getOwnDependencies=function(){var e=this;return Object.keys(this.ownDependencies).map(function(t){return e.engine.getEntityById(t)}).filter(function(e){return e})},e.prototype.getOwnDependencyInfo=function(){return this.ownDependencies},e.prototype.getDependencies=function(e){var t=this,r="function"!=typeof e;return Object.keys(this.dependencies).map(function(e){return t.engine.getEntityById(e)}).filter(function(t){return r||e(t)})},e.prototype.getDependenciesByClass=function(e){return this.getDependencies(function(t){return t instanceof e})},e.prototype.getDependenciesByType=function(e){return this.getDependencies(function(t){return t.type===e})},e.prototype.getDependencyInfo=function(){return this.dependencies},e.prototype.registerDependencyById=function(e){this.registerDependency(this.engine.getEntityById(e))},e.prototype.registerDependency=function(e){var t=this;if(!e)return void n.default.warn("Trying to register invalid entity as a dependency.");var r=this.getOwnDependencyInfo(),a=e.id;r[a]?r[a].count++:(r[a]={count:1},r[a].onSubDependencyChange=function(e,i){if(r[a])for(var n=0;n=r.components.length-1)){var i=Math.min(Math.max(t,0),r.components.length-1);i<0||(r.previousComponents=r.components?r.components.slice():[],r.components.splice(i,1),this.fireExternalUpdate(e,{components:r.components}),this.engines.forEach(function(t){t.getEntityById(e).trigger("remove:component",i)}))}},e.prototype.dispatchComponentAdded=function(e,t){var r=this.entities[e];if(r){r.previousComponents=r.components?r.components.slice():[];var i=a.deepClone(t);i.id=i.id||n.v4(),i.name=i.name||"",i.attributes=i.attributes||{},i.enabled=!1!==i.enabled,r.components.push(i),this.fireExternalUpdate(e,{components:r.components}),this.engines.forEach(function(t){t.getEntityById(e).trigger("add:component",i)})}},e.prototype.fireExternalUpdate=function(e,t,r){var i=new u.default;i.type=r||"updateEntity",i.entityId=e,i.entityData=t,o.default.trigger("EntityUpdates",i)},e}();t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(52),n=r(35),a=r(53),o=r(6),s=r(10),u=r(69),p=r(21),c=r(70),h=r(78),l=r(55),d=r(56),f=r(41),m=r(14),y=r(22),g=r(57),v=r(71),b=r(58),x=r(59),P=r(60),w=r(61),E=r(42),T=r(62),S=r(36),D=r(63),_=r(64),M=r(65),A=r(25),C=function(){function e(){this.objects={},this.assets={}}return e.prototype.destroy=function(){var e=this;this.getAssets().forEach(function(t){return e.unregisterEntity(t)}),this.getObjects().forEach(function(t){return e.unregisterEntity(t)})},e.prototype.getAsset=function(e){return this.getEntity(e,this.assets)},e.prototype.getAssets=function(e){return this.getEntities(e,this.assets)},e.prototype.getAssetById=function(e){return this.assets[e]||null},e.prototype.getAssetByName=function(e){return this.getAsset(function(t){return t.getName()===e})},e.prototype.getAssetsByName=function(e){return this.getAssets(function(t){return t.getName()===e})},e.prototype.getAssetByClass=function(e){return this.getAsset(function(t){return t instanceof e})},e.prototype.getAssetByType=function(e){return this.getAsset(function(t){return t.type===e})},e.prototype.getAssetsByClass=function(e){return this.getAssets(function(t){return t instanceof e})},e.prototype.getAssetsByType=function(e){return this.getAssets(function(t){return t.type===e})},e.prototype.getObject=function(e){return this.getEntity(e,this.objects)},e.prototype.getObjects=function(e){return this.getEntities(e,this.objects)},e.prototype.getObjectById=function(e){return this.objects[e]||null},e.prototype.getObjectByName=function(e){return this.getObject(function(t){return t.getName()===e})},e.prototype.getObjectsByName=function(e){return this.getObjects(function(t){return t.getName()===e})},e.prototype.getObjectByClass=function(e){return this.getObject(function(t){return t instanceof e})},e.prototype.getObjectByType=function(e){return this.getObject(function(t){return t.type===e})},e.prototype.getObjectsByType=function(e){return this.getObjects(function(t){return t.type===e})},e.prototype.getObjectsByClass=function(e){return this.getObjects(function(t){return t instanceof e})},e.prototype.getEntity=function(e,t){if(!t)return this.getAsset(e)||this.getObject(e);var r=Object.keys(t).find(function(r){return e(t[r])});return t[r]},e.prototype.getEntities=function(e,t){if(!t)return this.getObjects(e).concat(this.getAssets(e));var r="function"!=typeof e;return Object.keys(t).filter(function(i){return r||e(t[i])}).map(function(e){return t[e]})},e.prototype.getEntityById=function(e){return this.assets[e]||this.objects[e]||null},e.prototype.getEntityByClass=function(e){return this.getEntity(function(t){return t instanceof e})},e.prototype.getEntityByType=function(e){return this.getEntity(function(t){return t.type===e})},e.prototype.getEntitiesByClass=function(e){return this.getEntities(function(t){return t instanceof e})},e.prototype.getEntitiesByType=function(e){return this.getEntities(function(t){return t.type===e})},e.prototype.getEntityByName=function(e){return this.getEntity(function(t){return t.getName()===e})},e.prototype.getEntitiesByName=function(e){return this.getEntities(function(t){return t.getName()===e})},e.prototype.unregisterEntityById=function(e){this.unregisterEntity(this.getEntityById(e))},e.prototype.unregisterEntity=function(e){e&&(e.uninitialize(),this.objects[e.id]?delete this.objects[e.id]:(e.off("load",this.onAssetLoaded,this),e.off("unload",this.onAssetUnloaded,this),delete this.assets[e.id]))},e.prototype.getClassType=function(e){switch(e){case i.default:return"animation";case n.default:return"application";case a.default:return"audio";case u.default:return"bone";case p.default:return"buffer";case c.default:return"camera";case h.default:return"document";case l.default:return"dracoGeometry";case d.default:return"image";case f.default:return"light";case m.default:return"material";case y.default:return"mesh";case g.default:return"meshGeometry";case v.default:return"node";case b.default:return"prefab";case x.default:return"primitiveGeometry";case P.default:return"renderTexture2D";case w.default:return"renderTextureCube";case E.default:return"scene";case T.default:return"script";case S.default:return"shader";case D.default:return"skin";case _.default:return"texture2D";case M.default:return"textureCube";case A.default:return"video";default:return null}},e.prototype.getEntityClass=function(t){return e.entityNameTypeMap[t]?e.entityNameTypeMap[t]:"object"===t?s.default:"asset"===t?o.default:null},e.prototype.registerEntity=function(e){var t=new(this.getEntityClass(e.type))(e);t.engine=this,t instanceof o.default?(this.assets[t.id]=t,t.on("load",this.onAssetLoaded,this),t.on("unload",this.onAssetUnloaded,this)):this.objects[t.id]=t},e.prototype.onAssetLoaded=function(e){this.trigger("assetLoaded",e)},e.prototype.onAssetUnloaded=function(e){this.trigger("assetUnloaded",e)},e.entityNameTypeMap={animation:i.default,application:n.default,audio:a.default,bone:u.default,buffer:p.default,camera:c.default,document:h.default,dracoGeometry:l.default,image:d.default,light:f.default,material:m.default,mesh:y.default,meshGeometry:g.default,node:v.default,prefab:b.default,primitiveGeometry:x.default,renderTexture2D:P.default,renderTextureCube:w.default,scene:E.default,script:T.default,shader:S.default,skin:D.default,texture2D:_.default,textureCube:M.default,video:A.default},e}();t.default=C},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){this.type="updateEntity",this.entityId="",this.entityData={}}return e}();t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(9),a=function(){function e(){this.events={}}return e.prototype.registerEvent=function(e,t,r){var i={parameters:t.parameters||[],action:!!t.action,category:t.category,refCount:1,executeIn:r},n=this.getRegisteredEventsFromScope(t);n[e]?(n[e].refCount++,"runtime"!==r&&"all"!==r||(n[e].executeIn=r)):n[e]=i},e.prototype.unregisterEvent=function(e,t){var r=this.getRegisteredEventsFromScope(t);r[e]&&0===--r[e].refCount&&delete r[e]},e.prototype.getAvailableEvents=function(e){void 0===e&&(e="player");for(var t=i.__assign({},this.constructor.events,this.events),r=Object.getPrototypeOf(this);r;){if(r.constructor.hasOwnProperty("events")){var n={};for(var a in r.constructor.events){var o=r.constructor.events[a],s=o.executeIn||"runtime";("editor"===e&&"runtime"!==s||"player"===e&&"editor"!==s)&&(n[a]=o)}t=i.__assign({},t,n)}r=Object.getPrototypeOf(r)}return t},e.prototype.getRegisteredEventsFromScope=function(e){if("other"===e.scope){if(e.filter&&e.filter.length){return this.engine.getEntityClass(e.filter[0]).events}return n.default.events}return"local"===e.scope?this.events:this.engine.registeredGlobalEvents},e}();t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e}();t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(40),a=r(26),o={id:"fbx_surface_lambert_shader",type:"shader",properties:{name:"FBX Surface Lambert Shader",vertexShader:"MeshLambertMaterial",fragmentShader:"MeshLambertMaterial",parameters:i.__assign({},n.default,a.default)}};t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(40),a=r(68),o=r(26),s={id:"fbx_surface_phong_shader",type:"shader",properties:{name:"FBX Surface Phong Shader",vertexShader:"MeshPhongMaterial",fragmentShader:"MeshPhongMaterial",parameters:i.__assign({},n.default,{specular:{displayName:"Specular Color",description:"The color reflected specularly by the surface from lights",type:"c",default:{r:1,g:1,b:1},min:0,max:1,isRenderParam:!0,uniformName:"specular"},specularTexture:{displayName:"Specular Map",description:"The color reflected specularly by the surface from lights",type:"t",default:null,isRenderParam:!0,uniformName:"specularMap",enabledWhen:{specularTexture:{notEqualsDefault:!0}}},shininess:{displayName:"Shininess",description:"The shininess exponent of the surface. Higher is glossier.",type:"f",default:30,min:0,max:512,isRenderParam:!0,uniformName:"shininess"}},a.default,o.default)}};t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(14),n=r(20),a=function(){function e(e){this.engine=e,this.standInTextures=[],this.engine=e,this.engine.on("rebuildMaterials",this.rebuildAll,this),this.engine.on("rendererResize",this.onResize,this),this.engine.on("update",this.update,this),this.standInTextures[i.StandInTexture.STANDIN_TEXTURE_WHITE]={texture:null,color:[255,255,255]},this.standInTextures[i.StandInTexture.STANDIN_TEXTURE_WHITE_CUBE]={texture:null,color:[255,255,255],type:"Cube"},this.standInTextures[i.StandInTexture.STANDIN_TEXTURE_BLACK]={texture:null,color:[0,0,0]},this.standInTextures[i.StandInTexture.STANDIN_TEXTURE_BLACK_CUBE]={texture:null,color:[0,0,0],type:"Cube"},this.standInTextures[i.StandInTexture.STANDIN_TEXTURE_NORMAL]={texture:null,color:[127,127,255]}}return e.prototype.destroy=function(){this.engine.off("rebuildMaterials",this.rebuildAll,this),this.engine.off("rendererResize",this.onResize,this),this.engine.off("update",this.update,this),this.standInTextures.forEach(function(e){e.texture&&e.texture.dispose()})},e.prototype.getMissingMaterial=function(){return this.engine.getAssetById("missingMaterial")},e.prototype.getStandInTexture=function(e){if(!this.standInTextures[e])return null;if(!this.standInTextures[e].texture){var t=this.standInTextures[e].color;"Cube"===this.standInTextures[e].type?this.standInTextures[e].texture=n.default.createColorTextureCube(t[0],t[1],t[2]):this.standInTextures[e].texture=n.default.createColorTexture(t[0],t[1],t[2])}return this.standInTextures[e].texture},e.prototype.update=function(e){i.default.timeValueInUse&&(this.engine.needsRender=!0),i.default.sharedUniforms.time.value=e},e.prototype.rebuildAll=function(){this.engine.getAssetsByClass(i.default).forEach(function(e){e.runtimeData&&Object.keys(i.default.materialObjectTypes).forEach(function(t){e.runtimeData[t].needsUpdate=!0})})},e.prototype.onResize=function(){var e=i.default.sharedUniforms.screenDimensions;e.value.x=0,e.value.y=0;var t=this.engine.getRenderer();t?(e.value.z=t.getCanvasWidth(),e.value.w=t.getCanvasHeight()):(e.value.z=128,e.value.w=128)},e}();t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(124),o=r(223),s=r(68),u=r(40),p=r(26),c={id:"three_physical_shader",type:"shader",properties:{name:"Three.js Physical Shader",vertexShader:"MeshPhysicalMaterial",fragmentShader:"MeshPhysicalMaterial",parameters:i.__assign({},u.default,a.default,s.default,o.default,p.default),uniforms:n.UniformsUtils.merge([n.UniformsLib.envmap,n.UniformsLib.fog,n.UniformsLib.lights])}};t.default=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(124),o=r(68),s=r(40),u=r(26),p={id:"three_standard_shader",type:"shader",properties:{name:"Three.js Standard Shader",vertexShader:"MeshStandardMaterial",fragmentShader:"MeshStandardMaterial",parameters:i.__assign({},s.default,a.default,o.default,u.default),uniforms:n.UniformsUtils.merge([n.UniformsLib.envmap,n.UniformsLib.fog,n.UniformsLib.lights])}};t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={clearCoat:{displayName:"Clear Coat Amount",description:"The strength/thickness of the clear coat on top of the material.",type:"f",min:0,max:1,default:0,isRenderParam:!0},clearCoatRoughness:{displayName:"Clear Coat Roughness",description:"How rough the clear coat surface appears.",type:"f",min:0,max:1,default:0,isRenderParam:!0}};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(28),a=r(72),o=r(11),s=r(231),u=r(49);t.loadableResourceMixins=u.default({},[n.default]);var p=function(e){function t(t,r,i){void 0===i&&(i={});var n=e.call(this)||this;if(n.path=t,n.type=r,n.params=i,n.state=a.default.STARTING,n.error=void 0,n.data=void 0,n.loaderData={},!t)throw new Error("Missing required `path` argument");if(!r)throw new Error("Missing required `type` argument");return n}return i.__extends(t,e),t.prototype.setState=function(e){switch(e){case a.default.STARTING:throw new s.default(this.state,e);case a.default.LOADING:if(this.state!==a.default.STARTING&&this.state!==a.default.LOADING)throw new s.default(this.state,e);break;case a.default.PROCESSING:if(this.state!==a.default.LOADING)throw new s.default(this.state,e);break;case a.default.COMPLETE:if(this.state!==a.default.PROCESSING)throw new s.default(this.state,e);break;case a.default.CANCELLED:if(this.state!==a.default.STARTING&&this.state!==a.default.LOADING&&this.state!==a.default.PROCESSING)throw new s.default(this.state,e);break;case a.default.ERROR:break;default:throw new Error("Unknown state: "+e)}return this.state=e,this.trigger(o.default.STATE_CHANGE,e),e},t.prototype.setLoading=function(){this.setState(a.default.LOADING)},t.prototype.setProcessing=function(){this.setState(a.default.PROCESSING)},t.prototype.setComplete=function(e){this.setState(a.default.COMPLETE),this.data=e,this.trigger(o.default.LOAD,e),this.done()},t.prototype.setError=function(e){this.setState(a.default.ERROR),this.error=e,this.trigger(o.default.ERROR,e),this.done()},t.prototype.setCancelled=function(){this.setState(a.default.CANCELLED),this.trigger(o.default.CANCEL),this.done()},t.prototype.isCancelled=function(){return this.state===a.default.CANCELLED},t.prototype.done=function(){this.trigger(o.default.DONE,this.state),this.off()},t}(t.loadableResourceMixins);t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(27),n=function(e){return e.setProcessing(),e.setComplete(e.loaderData.xhr.response),Promise.resolve(e)};t.default=function(e,t){return i.retry(function(e){return 202===e.loaderData.xhr.status},[i.unlessCancelled(i.makeXhr(t)),i.unlessCancelled(i.setResponseType("arraybuffer")),i.unlessCancelled(i.setCustomHeaders),i.unlessCancelled(i.loadXhr)])(e).then(i.unlessCancelled(i.requireStatus(function(e){return 200===e}))).then(i.unlessCancelled(n)).catch(i.handleError(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(249),n=r(196),a=r(27),o=function(e){e.setProcessing();var t="string"==typeof e.loaderData.xhr.response?JSON.parse(e.loaderData.xhr.response):e.loaderData.xhr.response,r=e.path.indexOf("?"),a=r>=0?r:e.path.length,o=e.path.slice(0,e.path.lastIndexOf("/",a)+1);if(void 0===t||void 0===t.version||t.version.major>4)return Promise.reject(new Error("Unsupported data version"));var s=new RegExp(/^(?:[a-z]+:)?\/\//i),u=new RegExp(/^\//),p=function(e){return!e.match(s)&&!e.match(u)},c=i.mapEntities(t.entities,t.version);return c.forEach(function(e){if(n.isAsset(e)&&e.representations&&e.representations.forEach(function(e){e.src&&p(e.src)&&(e.src=o+e.src)}),"buffer"===e.type){var t=e.properties;t.src&&p(t.src)&&(t.src=o+t.src)}}),e.setComplete(c),Promise.resolve(e)};t.default=function(e,t){return a.retry(function(e){return 202===e.loaderData.xhr.status},[a.unlessCancelled(a.makeXhr(t)),a.unlessCancelled(a.setResponseType("json")),a.unlessCancelled(a.setCustomHeaders),a.unlessCancelled(a.loadXhr)])(e).then(a.unlessCancelled(a.requireStatus(function(e){return 200===e}))).then(a.unlessCancelled(o)).catch(a.handleError(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(27),n=function(e){return new Promise(function(t){if(e.setProcessing(),e.loaderData.xhr.response instanceof Blob){var r=URL.createObjectURL(e.loaderData.xhr.response),i=new Image;i.onload=function(){e.setComplete(i),t(e)},i.src=r}else e.setComplete(e.loaderData.xhr.response),t(e)})};t.default=function(e,t){return i.retry(function(e){return 202===e.loaderData.xhr.status},[i.unlessCancelled(i.makeXhr(t)),i.unlessCancelled(i.setResponseType("blob")),i.unlessCancelled(i.setCustomHeaders),i.unlessCancelled(i.loadXhr)])(e).then(i.unlessCancelled(i.requireStatus(function(e){return 200===e}))).then(i.unlessCancelled(n)).catch(i.handleError(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(27),n=function(e){e.setProcessing();var t="string"==typeof e.loaderData.xhr.response?JSON.parse(e.loaderData.xhr.response):e.loaderData.xhr.response;return e.setComplete(t),Promise.resolve(e)};t.default=function(e,t){return i.retry(function(e){return 202===e.loaderData.xhr.status},[i.unlessCancelled(i.makeXhr(t)),i.unlessCancelled(i.setResponseType("json")),i.unlessCancelled(i.setCustomHeaders),i.unlessCancelled(i.loadXhr)])(e).then(i.unlessCancelled(i.requireStatus(function(e){return 200===e}))).then(i.unlessCancelled(n)).catch(i.handleError(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(27),n=function(e){return new Promise(function(t,r){e.setProcessing();var i=URL.createObjectURL(e.loaderData.xhr.response),n=document.createElement("video");n.addEventListener("loadeddata",function(){e.setComplete(n),t(e)}),n.addEventListener("error",function(){return r(new Error("Failed to load video"))}),n.src=i,n.load()})};t.default=function(e,t){return i.retry(function(e){return 202===e.loaderData.xhr.status},[i.unlessCancelled(i.makeXhr(t)),i.unlessCancelled(i.setResponseType("blob")),i.unlessCancelled(i.setCustomHeaders),i.unlessCancelled(i.loadXhr)])(e).then(i.unlessCancelled(i.requireStatus(function(e){return 200===e}))).then(i.unlessCancelled(n)).catch(i.handleError(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(3),n=r(11),a=r(9),o=function(){function e(){this.loadingResources=[]}return e.prototype.loadResource=function(e,t,r,o){var s=this;void 0===o&&(o={});var u=this.engine.resourceLoader.load(e,t,o);return this.loadingResources.push(u),u.on(n.default.ERROR,function(e){i.default.error(s.engine.getName()+" - ResourceLifecycle: Error loading "+s.type+","+s.getName()+", "+e.toString()),s.setState(a.StateType.Base,a.State.Failed)}),u.on(n.default.DONE,function(){s.loadingResources=s.loadingResources.filter(function(e){return e!==u}),"function"==typeof r&&r()}),u},e.prototype.abortRequests=function(){this.loadingResources.forEach(function(e){return e.setCancelled()})},e}();t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(72),a=function(e){function t(t,r){var i=e.call(this,'Illegal state transition "'+n.default[t]+'" -> "'+n.default[r]+'"')||this;return i.from=t,i.to=r,i}return i.__extends(t,e),t}(Error);t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(224),n=r(240),a=r(225),o=r(227),s=r(228),u=r(229),p=r(226),c=r(11),h=r(15),l=4,d=function(e,t){var r=new XMLHttpRequest;return r.open("GET",e),Promise.resolve(r)},f=[];f[h.default.BUFFER]=a.default,f[h.default.IMAGE]=o.default,f[h.default.VIDEO]=u.default,f[h.default.ENTITIES]=p.default,f[h.default.JSON]=s.default;var m=function(){function e(e,t){if(void 0===e&&(e=d),void 0===t&&(t=f),this.xhrPromise=e,this.strategies=t,this.resources={},!e)throw new Error("Must provide argument `xhrPromise`!");if(!t)throw new Error("Must provide argument `strategies`!");this.queue=n.default(l)}return e.prototype.destroy=function(){this.queue.destroy()},e.prototype.load=function(e,t,r){var n=this;if(!this.strategies[t])throw new Error("Unsupported type: "+t);if(this.resources[e])return this.resources[e];var a=this.resources[e]=new i.default(e,t,r);return this.queue.add(function(){return new Promise(function(r){var i=function(){delete n.resources[e],a.off(c.default.LOAD,i),a.off(c.default.ERROR,i),a.off(c.default.CANCEL,i),r(a)};a.once(c.default.LOAD,i),a.once(c.default.ERROR,i),a.once(c.default.CANCEL,i),n.strategies[t](a,n.xhrPromise)})},r.priority),a},e}();t.default=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = opacity * texel;","}"].join("\n")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n=function(){function e(e){this.cubeLods=e;var t=4*e[0].width;this.camera=new i.OrthographicCamera(.5*-t,.5*t,.5*-t,.5*t,0,1e3),this.scene=new i.Scene,this.scene.add(this.camera),this.objects=[];var r=[];r.push(new i.Vector2(0,0)),r.push(new i.Vector2(1,0)),r.push(new i.Vector2(2,0)),r.push(new i.Vector2(0,1)),r.push(new i.Vector2(1,1)),r.push(new i.Vector2(2,1));var n=t;t=e[0].width;var a=0,o=4;this.numLods=Math.log(e[0].width)/Math.log(2)-2;for(var s=0;s16&&(o*=2);for(var p=t>16?6:1,c=0,h=0,l=t,d=0;d16&&(t/=2)}}return e.prototype.setDestinationTexture=function(e){var t=this.cubeLods[0].width;this.CubeUVRenderTarget=e,this.CubeUVRenderTarget.setSize(t,t),this.CubeUVRenderTarget.texture.name="PMREMCubeUVPacker.cubeUv"},e.prototype.dispose=function(){this.cubeLods.forEach(function(e){e.dispose()}),this.cubeLods=[]},e.prototype.update=function(e){var t=e.gammaInput,r=e.gammaOutput,n=e.toneMapping,a=e.toneMappingExposure;e.gammaInput=!1,e.gammaOutput=!1,e.toneMapping=i.LinearToneMapping,e.toneMappingExposure=1,e.render(this.scene,this.camera,this.CubeUVRenderTarget,!1),e.toneMapping=n,e.toneMappingExposure=a,e.gammaInput=t,e.gammaOutput=r},e.prototype.getShader=function(){return new i.ShaderMaterial({uniforms:{faceIndex:{value:0},mapSize:{value:0},envMap:{value:null},testColor:{value:new i.Vector3(1,1,1)}},vertexShader:"precision highp float; varying vec2 vUv; void main() { vUv = uv; gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); }",fragmentShader:"precision highp float; varying vec2 vUv; uniform samplerCube envMap; uniform float mapSize; uniform vec3 testColor; uniform int faceIndex; void main() { vec3 sampleDirection; vec2 uv = vUv; uv = uv * 2.0 - 1.0; uv.y *= -1.0; if(faceIndex == 0) { sampleDirection = normalize(vec3(1.0, uv.y, -uv.x)); } else if(faceIndex == 1) { sampleDirection = normalize(vec3(uv.x, 1.0, uv.y)); } else if(faceIndex == 2) { sampleDirection = normalize(vec3(uv.x, uv.y, 1.0)); } else if(faceIndex == 3) { sampleDirection = normalize(vec3(-1.0, uv.y, uv.x)); } else if(faceIndex == 4) { sampleDirection = normalize(vec3(uv.x, -1.0, -uv.y)); } else { sampleDirection = normalize(vec3(-uv.x, uv.y, -1.0)); } vec4 color = envMapTexelToLinear( textureCube( envMap, sampleDirection ) ); gl_FragColor = linearToOutputTexel( color ); }",blending:i.CustomBlending,premultipliedAlpha:!1,blendSrc:i.OneFactor,blendDst:i.ZeroFactor,blendSrcAlpha:i.OneFactor,blendDstAlpha:i.ZeroFactor,blendEquation:i.AddEquation})},e}();t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n=function(){function e(e,t){void 0===t&&(t=32),this.sourceTexture=e,this.resolution=256,this.samplesPerLevel=t;var r=e.encoding===i.LinearEncoding||e.encoding===i.GammaEncoding||e.encoding===i.sRGBEncoding;this.sourceTexture.minFilter=r?i.LinearFilter:i.NearestFilter,this.sourceTexture.magFilter=r?i.LinearFilter:i.NearestFilter,this.sourceTexture.generateMipmaps=!1,this.cubeLods=[];var n=this.resolution,a={format:this.sourceTexture.format,magFilter:this.sourceTexture.magFilter,minFilter:this.sourceTexture.minFilter,type:this.sourceTexture.type,generateMipmaps:this.sourceTexture.generateMipmaps,anisotropy:this.sourceTexture.anisotropy,encoding:this.sourceTexture.encoding};this.numLods=Math.log(n)/Math.log(2)-2;for(var o=0;o\n varying vec2 vUv;\n uniform int faceIndex;\n uniform float roughness;\n uniform samplerCube envMap;\n uniform float mapSize;\n uniform vec3 testColor;\n uniform vec3 queryScale;\n \n float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n float a = ggxRoughness + 0.0001;\n a *= a;\n return ( 2.0 / a - 2.0 );\n }\n vec3 ImportanceSamplePhong(vec2 uv, mat3 vecSpace, float specPow) {\n float phi = uv.y * 2.0 * PI;\n float cosTheta = pow(1.0 - uv.x, 1.0 / (specPow + 1.0));\n float sinTheta = sqrt(1.0 - cosTheta * cosTheta);\n vec3 sampleDir = vec3(cos(phi) * sinTheta, sin(phi) * sinTheta, cosTheta);\n return vecSpace * sampleDir;\n }\n vec3 ImportanceSampleGGX( vec2 uv, mat3 vecSpace, float Roughness )\n {\n float a = Roughness * Roughness;\n float Phi = 2.0 * PI * uv.x;\n float CosTheta = sqrt( (1.0 - uv.y) / ( 1.0 + (a*a - 1.0) * uv.y ) );\n float SinTheta = sqrt( 1.0 - CosTheta * CosTheta );\n return vecSpace * vec3(SinTheta * cos( Phi ), SinTheta * sin( Phi ), CosTheta);\n }\n mat3 matrixFromVector(vec3 n) {\n float a = 1.0 / (1.0 + n.z);\n float b = -n.x * n.y * a;\n vec3 b1 = vec3(1.0 - n.x * n.x * a, b, -n.x);\n vec3 b2 = vec3(b, 1.0 - n.y * n.y * a, -n.y);\n return mat3(b1, b2, n);\n }\n \n vec4 testColorMap(float Roughness) {\n vec4 color;\n if(faceIndex == 0)\n color = vec4(1.0,0.0,0.0,1.0);\n else if(faceIndex == 1)\n color = vec4(0.0,1.0,0.0,1.0);\n else if(faceIndex == 2)\n color = vec4(0.0,0.0,1.0,1.0);\n else if(faceIndex == 3)\n color = vec4(1.0,1.0,0.0,1.0);\n else if(faceIndex == 4)\n color = vec4(0.0,1.0,1.0,1.0);\n else\n color = vec4(1.0,0.0,1.0,1.0);\n color *= ( 1.0 - Roughness );\n return color;\n }\n void main() {\n vec3 sampleDirection;\n vec2 uv = vUv*2.0 - 1.0;\n float offset = -1.0/mapSize;\n const float a = -1.0;\n const float b = 1.0;\n float c = -1.0 + offset;\n float d = 1.0 - offset;\n float bminusa = b - a;\n uv.x = (uv.x - a)/bminusa * d - (uv.x - b)/bminusa * c;\n uv.y = (uv.y - a)/bminusa * d - (uv.y - b)/bminusa * c;\n if (faceIndex==0) {\n sampleDirection = vec3(1.0, -uv.y, -uv.x);\n } else if (faceIndex==1) {\n sampleDirection = vec3(-1.0, -uv.y, uv.x);\n } else if (faceIndex==2) {\n sampleDirection = vec3(uv.x, 1.0, uv.y);\n } else if (faceIndex==3) {\n sampleDirection = vec3(uv.x, -1.0, -uv.y);\n } else if (faceIndex==4) {\n sampleDirection = vec3(uv.x, -uv.y, 1.0);\n } else {\n sampleDirection = vec3(-uv.x, -uv.y, -1.0);\n }\n mat3 vecSpace = matrixFromVector(normalize(sampleDirection * queryScale));\n vec3 rgbColor = vec3(0.0);\n const int NumSamples = SAMPLES_PER_LEVEL;\n vec3 vect;\n float weight = 0.0;\n for( int i = 0; i < NumSamples; i ++ ) {\n float sini = sin(float(i));\n float cosi = cos(float(i));\n float r = rand(vec2(sini, cosi));\n vect = ImportanceSampleGGX(vec2(float(i) / float(NumSamples), r), vecSpace, roughness);\n float dotProd = dot(vect, normalize(sampleDirection));\n weight += dotProd;\n vec3 color = envMapTexelToLinear(textureCube(envMap,vect)).rgb;\n rgbColor.rgb += color;\n }\n rgbColor /= float(NumSamples);\n //rgbColor = testColorMap( roughness ).rgb;\n gl_FragColor = linearToOutputTexel( vec4( rgbColor, 1.0 ) );\n }",blending:i.CustomBlending,blendSrc:i.OneFactor,blendDst:i.ZeroFactor,blendSrcAlpha:i.OneFactor,blendDstAlpha:i.ZeroFactor,blendEquation:i.AddEquation})},e}();t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n=function(){function e(e,t){void 0===t&&(t="tDiffuse"),this.enabled=!0,this.needsSwap=!0,this.renderToScreen=!1,this.clear=!1,this.textureId=t,this.uniforms=i.UniformsUtils.clone(e.uniforms),this.material=new i.ShaderMaterial({blending:i.NormalBlending,transparent:!0,uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader}),this.camera=new i.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new i.Scene,this.quad=new i.Mesh(new i.PlaneGeometry(2,2),null),this.scene.add(this.quad),this.prevViewPort=new i.Vector4}return e.prototype.render=function(e,t,r){this.uniforms[this.textureId]&&(this.uniforms[this.textureId].value=r),this.quad.material=this.material,this.renderToScreen?(this.viewPort&&e.setViewport(this.viewPort.x,this.viewPort.y,this.viewPort.width,this.viewPort.height),(this.clearColor||this.clearDepth)&&e.clear(!!this.clearColor,!!this.clearDepth,!1),e.render(this.scene,this.camera)):e.render(this.scene,this.camera,t,this.clear)},e.prototype.dispose=function(){this.quad.geometry.dispose(),this.quad=void 0,this.camera=void 0,this.scene=void 0,this.material.dispose(),this.material=void 0,this.uniforms=void 0},e}();t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={uniforms:{tDiffuse:{type:"t",value:null},rgbmMultiplier:{type:"f",value:9}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","#ifdef FLIP_Y","vUv.y = 1.0 - vUv.y;","#endif","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float rgbmMultiplier;","const mat3 InverseLogLuvMatrix = mat3(","6.0014, -2.7008, -1.7996,","-1.3320, 3.1029, -5.7721,","0.3008, -1.0882, 5.6268);","vec3 HDRDecodeLOGLUV(in vec4 vLogLuv)","{","float Le = vLogLuv.z * 255.0 + vLogLuv.w;","vec3 Xp_Y_XYZp;","Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);","Xp_Y_XYZp.z = Xp_Y_XYZp.y / vLogLuv.y;","Xp_Y_XYZp.x = vLogLuv.x * Xp_Y_XYZp.z;","vec3 vRGB = InverseLogLuvMatrix * Xp_Y_XYZp;","return vRGB;","}","vec3 HDRDecodeRGBM( vec4 rgbm ) {","return rgbmMultiplier * rgbm.rgb * rgbm.a;","}","vec3 HDRDecodeRGBD( vec4 rgbd ) {","return rgbd.rgb / max(rgbd.a, 0.003);","}","vec3 HDRDecodeRGBE( vec4 rgbe ) {","float f = exp2( rgbe.w * 255.0 - (128.0 + 0.0) );","return rgbe.rgb * f;","}","varying vec2 vUv;","void main() {","vec3 hdrColour;","#ifdef HDR_RGBM","hdrColour = HDRDecodeRGBM( texture2D( tDiffuse, vUv ) );","#elif defined(HDR_RGBD)","hdrColour = HDRDecodeRGBD( texture2D( tDiffuse, vUv ) );","#elif defined(HDR_RGBE)","hdrColour = HDRDecodeRGBE( texture2D( tDiffuse, vUv ) );","#elif defined(HDR_LOGLUV)","hdrColour = HDRDecodeLOGLUV( texture2D( tDiffuse, vUv ) );","#else","hdrColour = texture2D( tDiffuse, vUv ).xyz;","#endif","gl_FragColor = vec4( hdrColour, 1.0 );","}"].join("\n")}},function(e,t,r){"use strict";function i(e){return e.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z])([a-z])/,"$1_$2$3").toUpperCase()}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t="string"==typeof e?e:"";return t=t.replace(/_([a-z])/gi,function(e,t){return"_"+t.toUpperCase()}),t=t.replace(/\s+/g,"_"),t=t.replace(/([a-z])([0-9])/g,"$1_$2"),t=i(t)}},function(e,t,r){"use strict";function i(e,t){return e.id+"#"+t.id}function n(e){var t={};return t[e.id]=0,e.getChildren().forEach(function(r){var i=n(r);Object.assign(t,i),t[e.id]=Math.max(t[e.id],i[r.id]+1)}),t}function a(e,t,r){var n={};n[e.id]=t.id;var o=e.getChildren(),s=t.getChildren();return r[i(e,t)].children.forEach(function(e,t){var i=a(o[t],s[e],r);Object.assign(n,i)}),n}function o(e,t){var r=n(e),i=n(t),a=e.getDescendants();a.push(e);var o=t.getDescendants();o.push(t);for(var s=p.groupBy(a,function(e){return r[e.id]}),u=p.groupBy(o,function(e){return i[e.id]}),h=r[e.id],l=i[t.id],d=new c,f=0;f<=h;++f)for(var m=s[f],y=f;y<=l;++y)(function(e){var t=u[e];m.forEach(function(e){t.forEach(function(t){d.push({sourceNode:e,targetNode:t})})})})(y);return d}function s(e,t){for(var r={};!e.isEmpty();){var n=e.pop(),a=n.sourceNode,o=n.targetNode,s={included:!1,children:[]};if(r[i(a,o)]=s,t(a,o)){for(var u=a.getChildren(),p=o.getChildren(),c=0,h=0;h0&&i.length=0&&(i.splice(t,1),a())})})()},o=function(e,t){return t.priority-e.priority};return{add:function(e,i){if(void 0===i&&(i=t),i<0)throw new Error("Invalid priority "+i);if(!n)throw new Error("Queue is not running, cannot accept new promises");r.push({fn:e,priority:i}),r.sort(o),setTimeout(a(),0)},destroy:function(){n=!1,i.splice(0,i.length),r.splice(0,r.length)}}};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(80);t.AlignToPosition=i.default;var n=r(81);t.Animation=n.default;var a=r(82);t.AudioListener=a.default;var o=r(83);t.AudioSource=o.default;var s=r(84);t.AxisRotation=s.default;var u=r(85);t.BoundingBoxRenderer=u.default;var p=r(86);t.CameraZoom=p.default;var c=r(87);t.CubeMapCapture=c.default;var h=r(88);t.Curve=h.default;var l=r(89);t.DebugConsoleDisplay=l.default;var d=r(90);t.DebugPerformance=d.default;var f=r(91);t.DebugTextureViewer=f.default;var m=r(92);t.DynamicOptimizer=m.default;var y=r(93);t.EventHandler=y.default;var g=r(94);t.Exploder=g.default;var v=r(95);t.Fullscreen=v.default;var b=r(96);t.GamepadAnimator=b.default;var x=r(37);t.GamepadDevice=x.default;var P=r(97);t.GamepadInput=P.default;var w=r(98);t.Input=w.default;var E=r(99);t.IntersectionChecker=E.default;var T=r(100);t.LightEnvironment=T.default;var S=r(101);t.LookAtTarget=S.default;var D=r(102);t.MaterialCapture=D.default;var _=r(66);t.MotionGamepadDevice=_.default;var M=r(103);t.NormalMapGenerator=M.default;var A=r(104);t.ObjectAnimator=A.default;var C=r(105);t.ObjectPicker=C.default;var R=r(38);t.OrbitCamera=R.default;var O=r(106);t.OrbitCameraFocus=O.default;var j=r(107);t.OrbitDesktopInput=j.default;var I=r(108);t.OrbitTouchInput=I.default;var k=r(110);t.PanoramaToCubeMap=k.default;var L=r(109);t.PMREMGenerator=L.default;var B=r(111);t.ReflectionCapturePlanar=B.default;var z=r(112);t.RemoteInstance=z.default;var N=r(113);t.Renderer=N.default;var V=r(67);t.RenderModes=V.default;var U=r(39);t.RenderView=U.default;var F=r(114);t.Rotate=F.default;var G=r(115);t.ScaleToSize=G.default;var q=r(116);t.SimplexNoiseGenerator=q.default;var $=r(117);t.Skybox=$.default;var H=r(118);t.TextRenderer=H.default;var W=r(119);t.VrCameraController=W.default;var Q=r(120);t.VrPresenter=Q.default;var X=r(121);t.VrRenderView=X.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(80),n=r(81),a=r(82),o=r(83),s=r(84),u=r(85),p=r(86),c=r(87),h=r(88),l=r(89),d=r(90),f=r(91),m=r(92),y=r(93),g=r(94),v=r(95),b=r(96),x=r(37),P=r(97),w=r(98),E=r(99),T=r(100),S=r(101),D=r(102),_=r(66),M=r(103),A=r(104),C=r(105),R=r(38),O=r(106),j=r(107),I=r(108),k=r(110),L=r(109),B=r(111),z=r(112),N=r(113),V=r(67),U=r(39),F=r(114),G=r(115),q=r(116),$=r(117),H=r(118),W=r(119),Q=r(120),X=r(121);t.default=[[{id:"align_to_position",sid:"Align to Position",properties:{name:"Align to Position",description:"Aligns an object relative to a position using the object's bounding box.",attributes:{referencePosition:{name:"referencePosition",type:"v3",description:"The position to work relative to.",default:{x:0,y:0,z:0}},alignment:{name:"alignment",type:"v3",description:"An object of the form { x: x, y: y, z: z} where the values for x, y and z are between -1 and +1 and specify how the object is aligned relative to the object's bounds.",default:{x:0,y:0,z:0}}},filter:["object"],category:"Loading",executeIn:"all"}},i.default],[{id:"animation",sid:"Animation",properties:{name:"Animation",description:"Applies an animation to an object.",attributes:{asset:{name:"asset",type:"asset",description:"Animation asset",default:null,filter:{AnimationAsset:!0}},prefab:{name:"prefab",type:"asset",description:"Prefab asset imported with the animation.",default:null,filter:{PrefabAsset:!0}},clipId:{name:"clipId",type:"i",description:"The animation clip ID",default:null},loop:{name:"loop",type:"b",description:"Continuously replay the animation",default:!0},speed:{name:"speed",type:"f",description:"Playback speed",default:1,min:0,max:100},startTime:{name:"startTime",type:"f",description:"Begin playback at this time offset",default:0,min:0},weight:{name:"weight",type:"f",description:"Blending weight",default:1,min:0,max:1}},events:{playAnimation:{scope:"local",name:"playAnimation",action:!0,category:"Animation",parameters:[{name:"asset",type:"asset",description:"The animation asset to play.",default:null,filter:{AnimationAsset:!0}},{name:"clipId",type:"s",description:"The ID of the clip to play.",default:null},{name:"loop",type:"b",description:"Continuously replay the animation.",default:!0},{name:"speed",type:"f",description:"Playback speed.",default:1,min:0,max:100},{name:"startTime",type:"f",description:"Begin playback at this time offset.",default:0,min:0}]},pauseAnimation:{scope:"local",name:"pauseAnimation",action:!0,category:"Animation",parameters:[]},stopAnimation:{scope:"local",name:"stopAnimation",action:!0,category:"Animation",parameters:[]},toggleAnimation:{scope:"local",name:"toggleAnimation",action:!0,category:"Animation",parameters:[]},animationLoaded:{scope:"local",name:"animationLoaded",action:!1,category:"Animation",parameters:[]},endAnimation:{scope:"local",name:"endAnimation",action:!1,category:"Animation",parameters:[]}},filter:["object"],category:"Animation",executeIn:"player"}},n.default],[{id:"audio_listener",sid:"Audio Listener",properties:{name:"Audio Listener",description:"Audio listener for 3D, positional sound effects",category:"Audio",executeIn:"player"}},a.default],[{id:"audio_source",sid:"Audio Source",properties:{name:"Audio Source",description:"Controls playback of audio assets",attributes:{gain:{name:"gain",type:"f",description:"Volume control",default:1,min:0,max:100},autoPlay:{name:"autoPlay",type:"b",description:"Play the audio once loaded",default:!0},loop:{name:"loop",type:"b",description:"Continuously replay the audio",default:!0},preload:{name:"preload",type:"b",description:"Load the audio when the component is initialized",default:!0},positional:{name:"positional",type:"b",description:"Enable/disable 3D, positional audio effects",default:!1},stream:{name:"stream",type:"b",description:"Stream the audio",default:!1},asset:{name:"asset",type:"asset",description:"Audio or video asset",default:null,filter:{AudioAsset:!0,VideoAsset:!0}}},events:{playAudio:{scope:"local",name:"playAudio",action:!0,category:"Audio",parameters:[{name:"offset",type:"f",description:"Defined in seconds",default:0}]},pauseAudio:{scope:"local",name:"pauseAudio",action:!0,category:"Audio",parameters:[]},stopAudio:{scope:"local",name:"stopAudio",action:!0,category:"Audio",parameters:[]},toggleAudio:{scope:"local",name:"toggleAudio",action:!0,category:"Audio",parameters:[]}},category:"Audio",executeIn:"player"}},o.default],[{id:"axis_rotation",sid:"Axis Rotation",properties:{name:"Axis Rotation",description:"Set the rotation of any object.",attributes:{speed:{name:"speed",type:"f",description:"The speed that we rotate the object, if a transition is triggered",default:.4,max:100,min:.1}},events:{rotate_on_axis:{scope:"local",name:"rotate_on_axis",action:!0,category:"Transformation",parameters:[{name:"rotation",type:"v3",description:"Euler rotation about each axis, in degrees.",default:{x:0,y:0,z:0}},{name:"additive",type:"b",description:"Whether or not to add to the current rotation OR just set as world rotation.",default:!1},{name:"force",type:"b",description:"Force this to happen without a transition.",default:!1}]},set_axes_orientation:{scope:"local",name:"set_axes_orientation",action:!0,category:"Transformation",parameters:[{name:"up",type:"opt",description:"The up axis key.",options:{"+X":{x:1,y:0,z:0},"-X":{x:-1,y:0,z:0},"+Y":{x:0,y:1,z:0},"-Y":{x:0,y:-1,z:0},"+Z":{x:0,y:0,z:1},"-Z":{x:0,y:0,z:-1}},default:""},{name:"forward",type:"opt",description:"The forward axis key.",options:{"+X":{x:1,y:0,z:0},"-X":{x:-1,y:0,z:0},"+Y":{x:0,y:1,z:0},"-Y":{x:0,y:-1,z:0},"+Z":{x:0,y:0,z:1},"-Z":{x:0,y:0,z:-1}},default:""},{name:"transition",type:"b",description:"Whether or not to trigger a smooth transition.",default:!1}]},end_axes_rotation:{scope:"local",name:"end_axes_rotation",action:!1,category:"Transformation",parameters:[]}},filter:["object"],category:"User Defined",executeIn:"player"}},s.default],[{id:"bounding_box_renderer",sid:"BoundingBox Renderer",properties:{name:"BoundingBox Renderer",description:"Renders bounding boxes for objects in a hierarchy.",attributes:{recursive:{name:"recursive",type:"b",default:!0,description:"Automatically render bounding boxes for all meshes in the hierarchy"}},filter:["object"],category:"Rendering",executeIn:"all"}},u.default],[{id:"camera_zoom",sid:"Camera Zoom",properties:{name:"Camera Zoom",description:"Handles zooming with orthographic and perspective cameras.",attributes:{perspectiveZoomMax:{name:"perspectiveZoomMax",type:"f",description:"The maximum amount a perspective camera can be zoomed (out)",default:180,max:1e5,min:0},perspectiveZoomMin:{name:"perspectiveZoomMin",type:"f",description:"The minimum amount a perspective camera can be zoomed (in)",default:0,max:1e5,min:0},orthoZoomMax:{name:"orthoZoomMax",type:"f",description:"The maximum amount an orthographic camera can be zoomed (out)",default:5,max:1e5,min:0},orthoZoomMin:{name:"orthoZoomMin",type:"f",description:"The minimum amount an orthographic camera can be zoomed (in)",default:0,max:1e5,min:0},perspectiveStep:{name:"perspectiveStep",type:"f",description:"Used to unify zoom between ortho and perspective zoom (this.zoom(+-1))",default:4,max:1e5,min:0},orthographicStep:{name:"orthographicStep",type:"f",description:"Used to unify zoom between ortho and perspective zoom (this.zoom(+-1))",default:.2,max:1e5,min:0}},filter:["camera"],category:"Camera Controllers",executeIn:"all"}},p.default],[{id:"cube_map_capture",sid:"Cube-Map Capture",properties:{name:"Cube-Map Capture",description:"Renders the scene from the position of the object into a cube texture.",attributes:{captureTexture:{name:"captureTexture",type:"asset",description:"The RenderTextureCube to render the reflection to.",filter:{RenderTextureCubeAsset:!0},default:null},near:{name:"near",type:"f",description:"The closest distance to this object to render. Adjust this to avoid rendering local geometry to the texture.",default:.01},far:{name:"far",type:"f",description:"The furthest distance from this object to render.",default:16},updateFrameInterval:{name:"updateFrameInterval",type:"i",description:"The number of frames to skip in between updates of the reflection. Default is 0.",default:0},renderPosX:{name:"renderPosX",type:"b",description:"Render this side of the cube.",default:!0},renderPosY:{name:"renderPosY",type:"b",description:"Render this side of the cube.",default:!0},renderNegZ:{name:"renderNegZ",type:"b",description:"Render this side of the cube.",default:!0},renderNegX:{name:"renderNegX",type:"b",description:"Render this side of the cube.",default:!0},renderNegY:{name:"renderNegY",type:"b",description:"Render this side of the cube.",default:!0},renderPosZ:{name:"renderPosZ",type:"b",description:"Render this side of the cube.",default:!0},debugView:{name:"debugView",type:"b",description:"Render the camera helpers on the cube capture.",default:!1}},filter:["Object"],category:"Rendering",executeIn:"all"}},c.default],[{id:"curve",sid:"Curve",properties:{name:"Curve",description:"Creates a spline curve that can be used for various things, including making objects follow it. Add controls points to shape the curve.",attributes:{controlPoints:{name:"controlPoints",type:"a",subType:{type:"object"},description:"The list of objects that define the curve shape."},closed:{name:"closed",type:"b",description:"If toggled, the start and end of the curve will be smoothly joined.",default:!1},enableVisualizations:{name:"enableVisualizations",type:"b",description:"If true, visualization of the curve will be enabled.",default:!1}},filter:["object"],category:"General",executeIn:"all"}},h.default],[{id:"debug_console_display",sid:"Debug Console Display",properties:{name:"Debug Console Display",description:"A utility component for displaying a console log over the canvas (useful on mobile)",filter:["Application"],category:"Debug",executeIn:"player"}},l.default],[{id:"debug_performance",sid:"Debug Performance",properties:{name:"Debug Performance",description:"Displays an FPS counter when enabled.",filter:["Application"],category:"Debug",executeIn:"player"}},d.default],[{id:"debug_texture_viewer",sid:"Debug Texture Viewer",properties:{name:"Debug Texture Viewer",description:"Displays a dropdown with all available textures for debugging purposes.",attributes:{viewportLeft:{name:"viewportLeft",type:"s",description:"Left position of the viewport to be rendered by this camera.",default:"25%"},viewportBottom:{name:"viewportBottom",type:"s",description:"Bottom position of the viewport to be rendered by this camera.",default:"0px"},viewportWidth:{name:"viewportWidth",type:"s",description:"Width of the viewport to be rendered by this camera.",default:"50%"},viewportHeight:{name:"viewportHeight",type:"s",description:"Height of the viewport to be rendered by this camera.",default:"50%"},renderGroup:{name:"renderGroup",type:"i",description:"Render passes are done in order, based on the 'render group' value. Lower numbers render first.",default:9}},filter:["Application"],category:"Debug",executeIn:"player"}},f.default],[{id:"dynamic_optimizer",sid:"Dynamic Performance Optimizer",properties:{name:"Dynamic Performance Optimizer",description:"Controls the dynamic down-stepping of rendering features in an attempt to achieve target performance.",attributes:{frameTimeThreshold:{name:"frameTimeThreshold",type:"f",description:"The average time that a frame can take to render before the optimizer drops a quality level. Default threshold is 30 FPS = 1000 ms / 30 frames",default:33.333333333333},testInterval:{name:"testInterval",type:"f",description:"The amount of elapsed time (in ms) to average the frame time over. i.e. an optimization decision can be made every time this interval elapses.",default:2e3}},filter:["Application"],category:"Rendering",executeIn:"player"}},m.default],[{id:"event_handler",sid:"Event Handler",properties:{name:"Event Handler",description:'Binds to a "listener" event and maps its firing to a list of trigger events.',attributes:{listener:{name:"listener",type:"event",description:"The event to listen for. When this event is captured, all of the defined trigger events will be fired.",allowActions:!1,default:{scope:{type:"global"},name:null}},triggers:{name:"triggers",type:"a",subType:{type:"event"},description:"Fire each of these events in response to the captured listen event.",allowActions:!0,default:[]}},category:"Interaction",executeIn:"player"}},y.default],[{id:"exploder",sid:"Exploder",properties:{name:"Exploder",description:"Explodes your objects and their hierarchies into different formations. Great for showing off parts in a model!",attributes:{time:{name:"time",type:"f",default:1.5,min:.001,description:"The amount of time to explode and contract the child meshes"},scale:{name:"scale",type:"v3",default:{x:2,y:2,z:2},description:"The scale of the explosion"},formation:{name:"formation",type:"dd",description:"Formation to use when exploding the hierarchy of this object.",default:"Scale",options:{Circle:"Circle","Square Grid":"Grid","Scale Out":"Scale"}}},events:{playExplode:{scope:"local",name:"playExplode",action:!0,category:"Exploder",parameters:[]},playContract:{scope:"local",name:"playContract",action:!0,category:"Exploder",parameters:[]},toggleExplode:{scope:"local",name:"toggleExplode",action:!0,category:"Exploder",parameters:[]},resetExploder:{scope:"local",name:"resetExploder",action:!0,category:"Exploder",parameters:[]},playCircleExplode:{scope:"local",name:"playCircleExplode",action:!0,category:"Exploder",parameters:[{name:"Scale",type:"v3",description:"The scale to apply to the explosion",default:{x:1,y:1,z:1}}]},playGridExplode:{scope:"local",name:"playGridExplode",action:!0,category:"Exploder",parameters:[{name:"Scale",type:"v3",description:"The scale to apply to the explosion",default:{x:1,y:1,z:1}}]},playScaleExplode:{scope:"local",name:"playScaleExplode",action:!0,category:"Exploder",parameters:[{name:"Scale",type:"v3",description:"The scale to apply to the explosion",default:{x:2,y:2,z:2}}]},beginExplode:{scope:"other",name:"beginExplode",action:!1,category:"Exploder",parameters:[]},endExplode:{scope:"other",name:"endExplode",action:!1,category:"Exploder",parameters:[]},beginContract:{scope:"other",name:"beginContract",action:!1,category:"Exploder",parameters:[]},endContract:{scope:"other",name:"endContract",action:!1,category:"Exploder",parameters:[]}},filter:["object"],category:"Animation",executeIn:"player"}},g.default],[{id:"fullscreen",sid:"Fullscreen",properties:{name:"Fullscreen",description:"Harnesses the fullscreen API to make your app fullscreen!",events:{toggleFullscreen:{scope:"local",name:"toggleFullscreen",action:!0,category:"Rendering",parameters:[]}},filter:["application"],category:"Rendering",executeIn:"player"}},v.default],[{id:"gamepad_animator",sid:"Gamepad Animator",properties:{name:"Gamepad Animator",description:"A component for animating an object based on gamepad input. e.g. a model of the gamepad or surrogate.",attributes:{buttons:{name:"buttons",type:"a",description:"Array of structures that represent animation information of each button when fully pressed in local space.",subType:{type:"a",subType:{type:"custom",attributes:{mesh:{type:"object"},movementType:{type:"s",default:"translate"},offset:{type:"v3"},pivot:{type:"v3"},rotation:{type:"v3"},renderOnTouchOnly:{type:"b",default:!1}}},default:[]},default:[]},axes:{name:"axes",type:"a",description:"Array of structures that represent animation information of each axes when fully pressed in local space.",subType:{type:"a",subType:{type:"custom",attributes:{mesh:{type:"object"},movementType:{type:"s",default:"translate"},offset:{type:"v3"},pivot:{type:"v3"},rotation:{type:"v3"},renderOnTouchOnly:{type:"b",default:!1}}},default:[]},default:[]}},filter:["object"],category:"Input",executeIn:"player"}},b.default],[{id:"gamepad_device",sid:"Gamepad Device",properties:{name:"Gamepad Device",description:"Represents a single gamepad connected to the system. Component attributes can be used to configure which gamepad gets assigned.",filter:["object"],category:"Input",executeIn:"player"}},x.default],[{id:"gamepad_input",sid:"Gamepad Input",properties:{name:"Gamepad Input",description:"Gets list of connected gamepad controllers and fires events for gamepad actions.",filter:["application"],category:"Input",executeIn:"player"}},P.default],[{id:"input",sid:"Input",properties:{name:"Input",description:"The Box3D input component. Adding this will cause all mouse/touch and keyboard events to fire on the engine.",attributes:{mouseEvents:{name:"mouseEvents",type:"custom",description:"Mouse events to listen to.",attributes:{enable:{type:"b",default:!0,description:"Enable mouse events"},scroll:{type:"b",default:!0,description:"Listen to scroll events?"},preventScrollDefault:{type:"b",default:!1,description:"Prevent default scroll behavior"},move:{type:"b",default:!0,description:"Listen to mouse move events"},down:{type:"b",default:!0,description:"Listen to mouse down event"},preventDownDefault:{type:"b",default:!1,description:"Prevent default mouse down behavior"},up:{type:"b",default:!0,description:"Listen to mouse up event"},doubleClick:{type:"b",default:!0,description:"Listen to double click event"},leave:{type:"b",default:!0,description:"Listen to mouse leave event"},contextMenu:{type:"b",default:!0,description:"Listen for the context menu event (ie, right click)"},preventContextMenuDefault:{type:"b",default:!0,description:"Prevent context menu default behavior (ie, the context menu popping open)"},dragBufferDistance:{type:"f",default:12,name:"Drag Buffer Distance",description:"The distance from initial click that you need to move your mouse before a drag event is fired, in pixels"},eventHandler:{type:"b",default:!0,description:"Events fired from the mouse are picked up by the Event Handler"}}},touchEvents:{name:"touchEvents",type:"custom",description:"Touch events to listen to.",attributes:{enable:{type:"b",default:!0,description:"Enable touch events?"},start:{type:"b",default:!0,description:"Listen for Touch Start"},preventStartDefault:{type:"b",default:!1,description:"Prevent default behavior of touch start event"},end:{type:"b",default:!0,description:"Listen for touch end event"},preventEndDefault:{type:"b",default:!1},doubleTap:{type:"b",default:!0,description:"Listen for a touch double tap event"},cancel:{type:"b",default:!0,description:"Listen for touch cancel event"},preventCancelDefault:{type:"b",default:!1},leave:{type:"b",default:!0,description:"Listen for touch leave event"},preventLeaveDefault:{type:"b",default:!1},move:{type:"b",default:!0,description:"Listen for touch move event"},preventMoveDefault:{type:"b",default:!0,description:"Prevent default move behavior (ie, dragging the window)"},dragBufferDistance:{type:"f",default:12,name:"Drag Buffer Distance",description:"The distance from initial touch down that you need to move your finger before a drag event is fired, in pixels"},eventHandler:{type:"b",default:!0,description:"Events fired from the touches are picked up by the Event Handler"}}},keyEvents:{name:"keyEvents",type:"custom",description:"Keyboard events",attributes:{enable:{type:"b",default:!0,description:"Enable keyboard events"},down:{type:"b",default:!0,description:"Listen to key down events"},up:{type:"b",default:!0,description:"Listen to key up events"},preventDefault:{type:"b",default:!1,description:"Prevent default keypress behavior"},eventHandler:{type:"b",default:!0,description:"Events fired from the keys are picked up by the Event Handler"}}}},events:{mouse_down_left:{scope:"global",name:"mouse_down_left",action:!1,category:"Input - Mouse",parameters:[]},mouse_down_right:{scope:"global",name:"mouse_down_right",action:!1,category:"Input - Mouse",parameters:[]},mouse_down_middle:{scope:"global",name:"mouse_down_middle",action:!1,category:"Input - Mouse",parameters:[]},mouse_up_left:{scope:"global",name:"mouse_up_left",action:!1,category:"Input - Mouse",parameters:[]},mouse_up_right:{scope:"global",name:"mouse_up_right",action:!1,category:"Input - Mouse",parameters:[]},mouse_up_middle:{scope:"global",name:"mouse_up_middle",action:!1,category:"Input - Mouse",parameters:[]},keypress_a:{scope:"global",name:"keypress_a",action:!1,category:"Input - Keys",parameters:[]},keypress_b:{scope:"global",name:"keypress_b",action:!1,category:"Input - Keys",parameters:[]},keypress_c:{scope:"global",name:"keypress_c",action:!1,category:"Input - Keys",parameters:[]},keypress_d:{scope:"global",name:"keypress_d",action:!1,category:"Input - Keys",parameters:[]},keypress_f:{scope:"global",name:"keypress_f",action:!1,category:"Input - Keys",parameters:[]},keypress_g:{scope:"global",name:"keypress_g",action:!1,category:"Input - Keys",parameters:[]},keypress_e:{scope:"global",name:"keypress_e",action:!1,category:"Input - Keys",parameters:[]},keypress_h:{scope:"global",name:"keypress_h",action:!1,category:"Input - Keys",parameters:[]},keypress_i:{scope:"global",name:"keypress_i",action:!1,category:"Input - Keys",parameters:[]},keypress_j:{scope:"global",name:"keypress_j",action:!1,category:"Input - Keys",parameters:[]},keypress_k:{scope:"global",name:"keypress_k",action:!1,category:"Input - Keys",parameters:[]},keypress_l:{scope:"global",name:"keypress_l",action:!1,category:"Input - Keys",parameters:[]},keypress_m:{scope:"global",name:"keypress_m",action:!1,category:"Input - Keys",parameters:[]},keypress_n:{scope:"global",name:"keypress_n",action:!1,category:"Input - Keys",parameters:[]},keypress_o:{scope:"global",name:"keypress_o",action:!1,category:"Input - Keys",parameters:[]},keypress_p:{scope:"global",name:"keypress_p",action:!1,category:"Input - Keys",parameters:[]},keypress_q:{scope:"global",name:"keypress_q",action:!1,category:"Input - Keys",parameters:[]},keypress_r:{scope:"global",name:"keypress_r",action:!1,category:"Input - Keys",parameters:[]},keypress_s:{scope:"global",name:"keypress_s",action:!1,category:"Input - Keys",parameters:[]},keypress_t:{scope:"global",name:"keypress_t",action:!1,category:"Input - Keys",parameters:[]},keypress_u:{scope:"global",name:"keypress_u",action:!1,category:"Input - Keys",parameters:[]},keypress_v:{scope:"global",name:"keypress_v",action:!1,category:"Input - Keys",parameters:[]},keypress_w:{scope:"global",name:"keypress_w",action:!1,category:"Input - Keys",parameters:[]},keypress_x:{scope:"global",name:"keypress_x",action:!1,category:"Input - Keys",parameters:[]},keypress_y:{scope:"global",name:"keypress_y",action:!1,category:"Input - Keys",parameters:[]},keypress_z:{scope:"global",name:"keypress_z",action:!1,category:"Input - Keys",parameters:[]},keypress_up_arrow:{scope:"global",name:"keypress_up_arrow",action:!1,category:"Input - Keys",parameters:[]},keypress_down_arrow:{scope:"global",name:"keypress_down_arrow",action:!1,category:"Input - Keys",parameters:[]},keypress_left_arrow:{scope:"global",name:"keypress_left_arrow",action:!1,category:"Input - Keys",parameters:[]},keypress_right_arrow:{scope:"global",name:"keypress_right_arrow",action:!1,category:"Input - Keys",parameters:[]},keypress_space:{scope:"global",name:"keypress_space",action:!1,category:"Input - Keys",parameters:[]},touch_start:{scope:"global",name:"touch_start",action:!1,category:"Input - Touch",parameters:[]},touch_end:{scope:"global",name:"touch_end",action:!1,category:"Input - Touch",parameters:[]}},filter:["application"],category:"Input",executeIn:"all"}},w.default],[{id:"intersection_checker",sid:"Intersection Checker",properties:{name:"Intersection Checker",description:"This component checks if the entity that it's attached to intersects with any other objects. It can be configured to filter the checked objects, the type of intersection and when the intersection checks occur.",attributes:{objectTypeFilter:{name:"objectTypeFilter",type:"a",subType:{type:"dd"},description:"Array of type names to check for intersection with.",default:[],options:{Cameras:"camera",Lights:"light",Meshes:"mesh",Nodes:"node",Bones:"bone"}},objectFilter:{name:"objectFilter",type:"a",description:"An array of specific objects to check for intersection against.",subType:{type:"object"},default:[]},checkIntersectionAlways:{name:"checkIntersectionAlways",type:"b",description:'Whether this component will always be checking intersections. Otherwise, it will only check and report intersections only when the "checkIntersection" event is fired on this entity.',default:!1},boundingSphereOverrideRadius:{name:"boundingSphereOverrideRadius",type:"i",description:"The radius (in meters) around this object to use for checking object intersection (overrides using this object's regular bounding sphere)",default:-1},firstIntersectionOnly:{name:"firstIntersectionOnly",type:"b",description:"Option to stop checking intersections after the first one. True by default. This means that only one intersection event will be fired for each check.",default:!0},debugVisualization:{name:"debugVisualization",type:"b",description:"Option to turn on visualization of intersection sphere for this object.",default:!1}},filter:["object"],category:"Tools",executeIn:"player"}},E.default],[{id:"light_environment",sid:"Light Environment",properties:{name:"Light Environment",description:"Automatically assigns the given environment map to every material.",attributes:{radianceMap:{name:"radianceMap",type:"asset",description:"The radiance map texture asset.",filter:{Texture2DAsset:!0,RenderTexture2DAsset:!0,TextureCubeAsset:!0,RenderTextureCubeAsset:!0}}},filter:["scene"],category:"Rendering",executeIn:"all"}},T.default],[{id:"look_at_target",sid:"Look At Target",properties:{name:"Look At Target",description:"A component that automatically points the object at a target. This can be used for billboarding an object to the camera, making a character look at another, etc.",attributes:{target:{name:"target",type:"object",description:"The object that you want this object to point towards. e.g. for billboarding, this would be the camera used to render the scene."},local:{name:"local",type:"b",description:"If toggled, whatever rotation you have already applied to this object will be taken into account.",default:!1}},filter:["Object"],category:"General",executeIn:"player"}},S.default],[{id:"material_capture",sid:"Material Capture",properties:{name:"Material Capture",description:"A component that captures an image of a rendered material as a spherical map, complete with lighting. This image can then be applied (with a sphere map projection) to a mesh to achieve convincing material shading (although the mesh will appear with the same lighting from all directions).",attributes:{captureTexture:{name:"captureTexture",type:"asset",description:"The renderTexture2D asset which will be used to capture the material.",filter:{RenderTexture2DAsset:!0},default:null}},filter:["material"],category:"Rendering",executeIn:"all"}},D.default],[{id:"motion_gamepad_device",sid:"Motion Gamepad Device",properties:{name:"Motion Gamepad Device",description:"Represents a gamepad device with either 3DOF or 6DOF motion.",attributes:{handPreference:{name:"handPreference",type:"i",default:0,description:"The preference for the handedness of this controller."}},filter:["object"],category:"Input",executeIn:"player"}},_.default],[{id:"normal_map_generator",sid:"Normal Map Generator",properties:{name:"Normal Map Generator",description:"Generates a normal map from a greyscale heightmap.",attributes:{bumpTexture:{name:"bumpTexture",type:"asset",description:"The source height map.",filter:{Texture2DAsset:!0,RenderTexture2DAsset:!0}},smoothness:{name:"smoothness",type:"f",description:"Controls the smoothness of the result.",slider:!0,default:.25,min:1e-4,max:1},spread:{name:"spread",type:"f",description:"The spread value which is used by the shader.",slider:!0,default:4,min:1,max:10},autoLoad:{name:"autoLoad",type:"b",description:"If true, the normal map will be generated automatically on entity availability.",default:!0}},events:{renderNormalMap:{scope:"local",name:"renderNormalMap",action:!0,category:"Rendering",parameters:[]}},filter:["renderTexture2D"],category:"Rendering",executeIn:"all"}},M.default],[{id:"object_animator",sid:"Object Animator",properties:{name:"Object Animator",description:"Provides events for animating objects around the scene.",events:{playAnimateAlongCurve:{scope:"local",name:"playAnimateAlongCurve",action:!0,category:"Animation",parameters:[{name:"curve",type:"object",componentFilter:{Curve:!0}},{name:"animationTime",type:"f",description:"Time to animate to object. Defined in seconds",default:3},{name:"easeIn",type:"f",description:"The percentage of animation time spent speeding up.",default:.25,min:0,max:1},{name:"easeOut",type:"f",description:"The percentage of animation time spent slowing down.",default:.25,min:0,max:1},{name:"orientation",description:"Orient the object following the curve to either the direction of the curve or to the objects defining the curve.",type:"opt",default:"toCurve",options:{None:"None","To Curve":"toCurve","To Nodes":"toNode"}},{name:"loop",type:"b",default:!1}]},playAnimateToObject:{scope:"local",name:"playAnimateToObject",action:!0,category:"Animation",parameters:[{name:"object",type:"object",default:null},{name:"animationTime",type:"f",description:"Total time that the animation will take. Defined in seconds",default:3},{name:"easeIn",type:"f",description:"The percentage of animation time spent speeding up.",default:.25,min:0,max:1},{name:"easeOut",type:"f",description:"The percentage of animation time spent slowing down.",default:.25,min:0,max:1},{name:"update orientation",type:"b",default:!0}]},playAnimateTranslation:{scope:"local",name:"playAnimateTranslation",action:!0,category:"Animation",parameters:[{name:"animationTime",type:"f",description:"Time to animate. Defined in seconds",default:3},{name:"easeIn",type:"f",description:"The percentage of animation time spent speeding up.",default:.25,min:0,max:1},{name:"easeOut",type:"f",description:"The percentage of animation time spent slowing down.",default:.25,min:0,max:1},{name:"velocity",type:"v3",default:{x:0,y:0,z:1},min:-1,max:1},{name:"objectUsage",type:"opt",description:"Specify what part of the animation the current object's position represents.",default:"beginning",options:{Beginning:"beginning",Middle:"middle",End:"end"}}]},playAnimateRotation:{scope:"local",name:"playAnimateRotation",action:!0,category:"Animation",parameters:[{name:"animationTime",type:"f",description:"Time to animate to object. Defined in seconds",default:3},{name:"easeIn",type:"f",description:"The percentage of animation time spent speeding up.",default:.25,min:0,max:1},{name:"easeOut",type:"f",description:"The percentage of animation time spent slowing down.",default:.25,min:0,max:1},{name:"angularVelocity",type:"v3",default:{x:0,y:0,z:1},min:-100,max:100},{name:"objectUsage",type:"opt",description:"Specify what part of the animation the current object's rotation represents.",default:"beginning",options:{Beginning:"beginning",Middle:"middle",End:"end"}},{name:"axisOrder",type:"opt",description:"Specify the axis order that the angular velocity will be applied in.",default:"YXZ",options:{XYZ:"XYZ",YXZ:"YXZ",ZXY:"ZXY",XZY:"XZY",YZX:"YZX",ZYX:"ZYX"}}]},playAnimateScale:{scope:"local",name:"playAnimateScale",action:!0,category:"Animation",parameters:[{name:"animationTime",type:"f",description:"Time to animate to object. Defined in seconds",default:3},{name:"easeIn",type:"f",description:"The percentage of animation time spent speeding up.",default:.25,min:0,max:1},{name:"easeOut",type:"f",description:"The percentage of animation time spent slowing down.",default:.25,min:0,max:1},{name:"velocity",type:"v3",default:{x:0,y:0,z:1},min:-10,max:10},{name:"objectUsage",type:"opt",description:"Specify what part of the animation the current object's scale represents.",default:"beginning",options:{Beginning:"beginning",Middle:"middle",End:"end"}}]},pauseCurveAnimation:{scope:"local",name:"pauseCurveAnimation",action:!0,category:"Animation",parameters:[]},stopCurveAnimation:{scope:"local",name:"stopCurveAnimation",action:!0,category:"Animation",parameters:[]},unpauseCurveAnimation:{scope:"local",name:"unpauseCurveAnimation",action:!0,category:"Animation",parameters:[]},endAnimateAlongCurve:{scope:"local",name:"endAnimateAlongCurve",action:!1,category:"Animation",parameters:[]},endAnimateToObject:{scope:"local",name:"endAnimateToObject",action:!1,category:"Animation",parameters:[]},endAnimateTranslation:{scope:"local",name:"endAnimateTranslation",action:!1,category:"Animation",parameters:[]},endAnimateRotation:{scope:"local",name:"endAnimateRotation",action:!1,category:"Animation",parameters:[]},endAnimateScale:{scope:"local",name:"endAnimateScale",action:!1,category:"Animation",parameters:[]}},filter:["Object"],category:"Animation",executeIn:"player"}},A.default],[{id:"object_picker",sid:"Object Picker",properties:{name:"Object Picker",description:"Provides events for picking objects with mouse/touch",attributes:{pickTrigger:{name:"pickTrigger",type:"dd",description:"What mouse action will trigger the pick?",default:"leftMouseClick",options:{"Left Mouse Click":"leftMouseClick","Middle Mouse Click":"middleMouseClick","Right Mouse Click":"rightMouseClick","Left Mouse Down":"leftMouseDown","Middle Mouse Down":"middleMouseDown","Right Mouse Down":"rightMouseDown","Left Mouse Up":"leftMouseUp","Middle Mouse Up":"middleMouseUp","Right Mouse Up":"rightMouseUp","Left Mouse Double Click":"leftMouseDoubleClick","Middle Mouse Double Click":"middleMouseDoubleClick","Right Mouse Double Click":"rightMouseDoubleClick"}},enableHover:{name:"enableHover",type:"b",default:!1,advanced:!0,description:"Enable hover detection when mouse cursor is over a mesh. Note that this has a potential performance impact."},hoverFrameSkip:{name:"hoverFrameSkip",type:"i",description:"Skip this many frames in between hover checks.",default:1,min:0,max:60}},events:{objectsPicked:{scope:"global",name:"objectsPicked",action:!1,category:"General",parameters:[{name:"objectArray",type:"array",subType:"string",description:"The objects that have been picked.",default:null,filter:{BaseObject:!0}}]},objectHoverBegin:{scope:"global",name:"objectHoverBegin",action:!1,category:"General",parameters:[{name:"objectArray",type:"array",subType:"string",description:"The objects that has been hovered over.",default:[null],filter:{BaseObject:!0}}]},objectHoverEnd:{scope:"global",name:"objectHoverEnd",action:!1,category:"General",parameters:[{name:"objectArray",type:"array",subType:"string",description:"The objects that are no longer being hovered over.",default:[],filter:{BaseObject:!0}}]},pick:{scope:"other",name:"pick",action:!1,category:"General",filter:["object"],parameters:[]},beginHover:{scope:"other",name:"beginHover",action:!1,category:"General",filter:["object"],parameters:[]},endHover:{scope:"other",name:"endHover",action:!1,category:"General",filter:["object"],parameters:[]}},filter:["Application"],category:"General",executeIn:"player"}},C.default],[{id:"orbit_camera",sid:"Orbit Camera",properties:{name:"Orbit Camera",description:"Allows a camera to easily orbit a point in space.",attributes:{orbitDistance:{name:"orbitDistance",type:"f",description:"How far the camera is positioned from the pivot point.",default:2.5,max:1e5,min:.001},zoomPerspectiveBounds:{name:"zoomPerspectiveBounds",type:"v2",description:"Allows you to set how far the camera can zoom, for perspective cameras. X = min, Y = max",default:{x:5,y:90},max:{x:180,y:180},min:{x:1,y:1}},zoomOrthographicBounds:{name:"zoomOrthographicBounds",type:"v2",description:"Allows you to set how far the camera can zoom, for ortho cameras. X = min, Y = max",default:{x:.125,y:2.5},max:{x:5,y:5},min:{x:.01,y:.01}},panEnabled:{name:"panEnabled",type:"b",default:!0,description:"Allow the user to pan side-to-side and up and down with the camera."},zoomEnabled:{name:"zoomEnabled",type:"b",default:!0,description:"Allow the user to zoom in and out with the camera."},inertialDamping:{name:"inertialDamping",type:"f",default:.2,description:"How quickly the camera stops moving when input stops.",min:0,max:1},panSpeed:{name:"panSpeed",type:"f",description:"The speed that the camera moves when panning.",default:2,max:2e3,min:.1},orbitSpeed:{name:"orbitSpeed",type:"f",description:"The speed that the camera orbits the target.",default:2,max:1e3,min:1e-4},zoomSpeed:{name:"zoomSpeed",type:"f",description:"The speed that the camera moves while zooming in and out.",default:8,max:2e3,min:.1},pitchAngleBounds:{name:"pitchAngleBounds",type:"v2",description:"Allows you to set how far the camera can pitch (tilt) from horizontal.",default:{x:75,y:-75},max:{x:90,y:90},min:{x:-90,y:-90.001}}},filter:["camera"],category:"Camera Controllers",executeIn:"player"}},R.default],[{id:"orbit_camera_focus",sid:"Orbit Camera Focus",properties:{name:"Orbit Camera Focus",description:"A component that allows for easy focus on a point of an object.",attributes:{speed:{name:"speed",type:"f",description:"The speed that we move to focus on the target.",default:.8,max:100,min:.1},zoomSteps:{name:"zoomSteps",type:"i",description:"The number of steps it takes to zoom, from fully zoomed out to fully zoomed in.",default:5,max:100,min:0},zoomBuffer:{name:"zoomBuffer",type:"i",description:"The distance between each focal point move. Used to decide whether or not to zoom in.",default:.1,max:1e3,min:0}},filter:["camera"],category:"Camera Controllers",executeIn:"all"}},O.default],[{id:"orbit_desktop_input",sid:"Orbit Desktop Input",properties:{name:"Orbit Desktop Input",description:"Desktop input for Orbit Camera component",filter:["camera"],category:"Camera Components",executeIn:"all"}},j.default],[{id:"orbit_touch_input",sid:"Orbit Touch Input",properties:{name:"Orbit Touch Input",description:"Touch input for Orbit Camera component",filter:["camera"],category:"Camera Components",executeIn:"player"}},I.default],[{id:"panorama_to_cube_map",sid:"Panorama To Cube Map",properties:{name:"Panorama To Cube Map",description:"Converts a equirectangular map to a cube map.",attributes:{inputTexture:{name:"inputTexture",type:"asset",default:null,filter:{Texture2DAsset:!0,RenderTexture2DAsset:!0},description:"The texture to convert to a cube map."}},filter:["renderTextureCube"],category:"Rendering",executeIn:"all"}},k.default],[{id:"texture_to_pmrem_cubeuv",sid:"GeneratePMREM",properties:{name:"GeneratePMREM",description:"Generates a prefiltered mipmaped radiance environment map from a, preferably HDRI, input environment map. The entire result will be stored in this texture in the CubeUV layout.",attributes:{inputTexture:{name:"inputTexture",type:"asset",default:null,filter:{TextureCubeAsset:!0,RenderTextureCubeAsset:!0},description:"The cube texture to generate the PMREM for."},numSamples:{name:"numSamples",type:"i",default:32,description:"The number of samples per-texel when doing importance sampling."}},filter:["renderTexture2D"],category:"Rendering",executeIn:"all"}},L.default],[{id:"reflection_capture_planar",sid:"Reflection Capture Planar",properties:{name:"Reflection Capture Planar",description:"Renders a reflection along the plane represented by this object.",attributes:{captureTexture:{name:"captureTexture",type:"asset",description:"The RenderTexture2D to render the reflection to.",filter:{RenderTexture2DAsset:!0}},clipBias:{name:"clipBias",type:"f",description:"Pushes the rendered scene forward or backwards to adjust clipping with reflection plane.",default:.01},updateFrameInterval:{name:"updateFrameInterval",type:"i",description:"The number of frames to skip in between updates of the reflection. Default is 0.",default:0}},filter:["Object"],category:"Rendering",executeIn:"all"}},B.default],[{id:"remote_instance",sid:"Remote Instance",properties:{name:"Remote Instance",description:"Handles loading and instancing a 3D model at runtime from a Box file ID.",events:{createRemoteInstance:{scope:"global",name:"createRemoteInstance",action:!0,category:"Loading",parameters:[{name:"fileId",type:"string",description:"The Box file ID of the 3D model to load.",default:null}]},remoteInstanceCreated:{scope:"local",name:"remoteInstanceCreated",action:!1,category:"Loading",parameters:[{name:"fileId",type:"string",description:"The Box file ID of the 3D model that loaded.",default:null}]}},filter:["object"],category:"Loading",executeIn:"all"}},z.default],[{id:"box3d_renderer",sid:"Renderer",properties:{name:"Renderer",attributes:{antialias:{name:"antialias",type:"b",description:"Enable or disable anti aliasing of the rendered scene.",default:!0},preserveDrawingBuffer:{name:"preserveDrawingBuffer",type:"b",description:"Tells the browser to preserve drawing buffers between frames so that they are available to be read by the application.",default:!0},precision:{name:"precision",type:"dd",description:"The default floating point and integer precision to be used by the GPU.",default:"mediump",options:{Low:"lowp",Medium:"mediump",High:"highp"}},autoClear:{name:"autoClear",type:"b",description:"Automatically clear the render target before each render.",default:!1},devicePixelRatio:{name:"devicePixelRatio",type:"dd",default:0,options:{"Device Default":0,One:1,Two:2},description:"Override the default pixel ratio of the system. Higher values will cause rendering at higher resolution while lower values will force rendering at lower resolutions. You can also set this to use the device default (mobile devices usually have values greater than 1)."},shadowsEnabled:{name:"shadowsEnabled",type:"b",description:"Enable or disable rendering of shadows.",default:!0},shadowsEnabledMobile:{name:"shadowsEnabledMobile",type:"b",description:"Enable or disable rendering of shadows on mobile devices.",default:!1},shadowType:{name:"shadowType",type:"dd",description:"The type of shadow map to use. (PCF, Soft PCF or No Filtering)",options:{"Soft PCF":2,PCF:1,"No Filtering":0},default:2},shadowReverseSided:{name:"shadowReverseSided",type:"b",description:"Render shadows with reverse side of mesh.",default:!1},maxTextureSize2d:{name:"maxTextureSize2d",type:"i",description:"Clamp the maximum allowed dimension of a 2d texture. #power-of-two",default:32768,min:1024,max:32768},maxTextureSizeCube:{name:"maxTextureSizeCube",type:"i",description:"Clamp the maximum allowed dimension of a cube texture. #power-of-two",default:32768,min:512,max:32768},clearColor:{name:"clearColor",type:"c",description:"When the render target is cleared, this colour will be used",default:{r:0,g:0,b:0}},clearAlpha:{name:"clearAlpha",type:"f",description:"When the render target is cleared, this value will be used to clear the transparency",default:0,min:0,max:1,step:.001},renderOnDemand:{name:"renderOnDemand",type:"b",description:"When this is enabled, rendering will only happen when requested instead of every frame.",default:!0},logarithmicDepthBuffer:{name:"logarithmicDepthBuffer",type:"b",description:"Use logarithmic z values while rendering.",default:!1}},filter:["application"],category:"Rendering",executeIn:"player"}},N.default],[{id:"render_modes",sid:"Render Modes",properties:{name:"Render Modes",description:'A component for controlling the rendering style, allowing you to switch between "lit", "unlit", "untextured", etc., and enable/disable skeleton and wireframe visualization.',attributes:{renderMode:{name:"renderMode",type:"dd",description:"How to render the scene",default:0,options:{Lit:0,Unlit:1,Shape:2,Normals:3,Untextured:4,UVOverlay:5,SkinWeights:6}},skeletonsVisible:{name:"skeletonsVisible",type:"b",description:"Enable or disable skeleton rendering",default:!1},shapeTexture:{name:"shapeTexture",type:"asset",description:'The texture to use with the "Shape" render mode',filter:{Texture2DAsset:!0,RenderTexture2DAsset:!0},default:null},wireframesVisible:{name:"wireframesVisible",type:"b",description:"Enable or disable wireframe rendering",default:!1}},events:{resetSkeletons:{scope:"global",name:"resetSkeletons",action:!0,category:"Rendering",parameters:[]},setRenderMode:{scope:"global",name:"setRenderMode",action:!0,category:"Rendering",parameters:[{name:"renderMode",type:"n",description:"RenderMode.Lit, RenderMode.Unlit, etc.",default:"Lit"}]},setSkeletonsVisible:{scope:"global",name:"setSkeletonsVisible",action:!0,category:"Rendering",parameters:[{name:"visible",type:"b",description:"Whether or not skeletons are visible.",default:!1}]},setWireframesVisible:{scope:"global",name:"setWireframesVisible",action:!0,category:"Rendering",parameters:[{name:"visible",type:"b",description:"Whether or not wireframes are visible.",default:!1}]}},filter:["Application"],category:"Rendering",executeIn:"player"}},V.default],[{id:"render_view",sid:"Render View",properties:{name:"Render View",attributes:{viewportLeft:{name:"viewportLeft",type:"s",description:"Left position of the viewport to be rendered by this camera.",default:"0px"},viewportBottom:{name:"viewportBottom",type:"s",description:"Bottom position of the viewport to be rendered by this camera.",default:"0px"},viewportWidth:{name:"viewportWidth",type:"s",description:"Width of the viewport to be rendered by this camera.",default:"100%"},viewportHeight:{name:"viewportHeight",type:"s",description:"Height of the viewport to be rendered by this camera.",default:"100%"},renderGroup:{name:"renderGroup",type:"i",description:"Render passes are done in order, based on the 'render group' value. Lower numbers render first.",default:0},renderLayer:{name:"renderLayer",type:"i",description:"The layer that this camera will render. Objects that are in a different layer will not be rendered by this camera.",default:0,min:0},clearColor:{name:"clearColor",type:"b",description:"Enable/disable color buffer clearing",default:!1,advanced:!1},clearDepth:{name:"clearDepth",type:"b",description:"Enable/disable depth buffer clearing",default:!0,advanced:!1},renderTarget:{name:"renderTarget",type:"asset",description:"The render texture asset to use as a render target.",filter:{RenderTexture2DAsset:!0},default:null,advanced:!1},enablePreRenderFunctions:{name:"enablePreRenderFunctions",type:"b",description:"Run pre-render functions with this view. These include things like real-time reflections, which need to be rendered for each view separately.",default:!0},enableShadows:{name:"enableShadows",type:"b",description:"Render shadows for this view.",default:!0},opacity:{name:"opacity",type:"f",description:"The opacity value to use while rendering.",min:0,max:1,default:1},overrideCameraAspect:{name:"overrideCameraAspect",type:"f",description:"Override the aspect ratio of the camera using viewport settings.",min:0,default:!0},overrideScene:{name:"overrideScene",type:"asset",description:"Override which scene is rendered by this camera.",filter:{PrefabAsset:!0},default:null}},events:{enableRenderView:{scope:"local",name:"enableRenderView",category:"Rendering"},setViewport:{scope:"local",name:"setViewport",category:"Rendering",parameters:[{name:"viewportLeft",description:"Left position of the viewport to be rendered by this camera.",type:"s",default:"0px"},{name:"viewportBottom",description:"Bottom position of the viewport to be rendered by this camera.",type:"s",default:"0px"},{name:"viewportWidth",description:"Width of the viewport to be rendered by this camera.",type:"s",default:"100%"},{name:"viewportHeight",description:"Height of the viewport to be rendered by this camera.",type:"s",default:"100%"}]},disableRenderView:{scope:"local",name:"disableRenderView",category:"Rendering"},toggleRenderView:{scope:"local",name:"toggleRenderView",category:"Rendering"}},filter:["camera"],category:"Rendering",executeIn:"player"}},U.default],[{id:"rotate",sid:"Rotate",properties:{name:"Rotate",description:"A simple component which rotates the attached object.",attributes:{autoRotate:{name:"autoRotate",type:"b",description:"Automatically start the rotation upon load.",default:!0},rotation:{name:"rotation",type:"v3",description:"Amount of rotation per second about the x, y and z axes.",default:{x:0,y:.5,z:0}},local:{name:"local",type:"b",description:"Rotate relative to the local quaternion of the object. If false, the rotation will be relative to the world.",default:!1}},events:{startRotate:{scope:"local",name:"startRotate",action:!0,category:"Rotate",parameters:[]},stopRotate:{scope:"local",name:"stopRotate",action:!0,category:"Rotate",parameters:[]},toggleRotate:{scope:"local",name:"toggleRotate",action:!0,category:"Rotate",parameters:[]}},filter:["object"],category:"Animation",executeIn:"player"}},F.default],[{id:"scale_to_size",sid:"Scale to Size",properties:{name:"Scale to Size",description:"Handles scaling an entity (and everything under it) at runtime.",attributes:{size:{name:"size",type:"f",description:"The size that the object will be scaled to, in world units. The size is measured as the longest diagonal of the bounding box for the object.",default:1}},filter:["object"],category:"Loading",executeIn:"all"}},G.default],[{id:"simplex_noise_generator",sid:"Simplex Noise Generator",properties:{name:"Simplex Noise Generator",description:"Generates a texture using simplex noise.",attributes:{layerAmplitude:{name:"layerAmplitude",type:"v4",description:"The layer amplitude uniform value for the shader.",default:{x:.5,y:.4,z:.3,w:.125}},layerScale:{name:"layerScale",type:"v4",description:"The layer scale uniform value for the shader.",default:{x:.5,y:2,z:3,w:4}},scale:{name:"scale",type:"v2",description:"The scale uniform value for the shader.",default:{x:1,y:1}},offset:{name:"offset",type:"v2",description:"The offset uniform value for the shader.",default:{x:0,y:0}},autoLoad:{name:"autoLoad",type:"b",description:"Generate the simplex noise map automatically when the entity loads",default:!0}},events:{renderNoise:{scope:"local",name:"renderNoise",action:!0,category:"Rendering",parameters:[]},changeNoiseValues:{scope:"local",name:"changeNoiseValues",action:!0,category:"Rendering",parameters:[{name:"layerAmplitude",type:"v4",description:"",default:{x:.5,y:.4,z:.3,w:.125}},{name:"layerScale",type:"v4",description:"",default:{x:.5,y:2,z:3,w:4}},{name:"scale",type:"v2",description:"",default:{x:1,y:1}},{name:"offset",type:"v2",description:"",default:{x:0,y:0}}]}},filter:["renderTexture2D"],category:"Rendering",executeIn:"all"}},q.default],[{id:"skybox_renderer",sid:"Skybox",properties:{name:"Skybox",description:"Adds a skybox to the scene.",attributes:{skyboxTexture:{name:"skyboxTexture",type:"asset",description:"The texture asset to use for the skybox.",filter:{BaseTextureAsset:!0},default:null},stereoEnabled:{name:"stereoEnabled",type:"b",description:"Determines whether or not to render in stereoscopic mode.",default:!1},size:{name:"size",type:"f",description:"The size (uniform scale) of the skybox.",default:1e3,min:1,max:1e6}},filter:["scene"],category:"Rendering",executeIn:"all"}},$.default],[{id:"text_renderer",sid:"Text Renderer",properties:{name:"Text Renderer",description:"Render the desired text to the texture.",attributes:{text:{name:"text",type:"s",default:"My Text",description:"Text you want to display"},fontColor:{name:"fontColor",type:"c",default:{r:1,g:1,b:1},description:"Color of the text"},fontFamily:{name:"fontFamily",type:"s",default:"Calibri",description:"Font family to render"},pointSize:{name:"pointSize",type:"i",default:48,description:"Font size",min:2,max:100}},filter:["renderTexture2D"],category:"Text",executeIn:"all"}},H.default],[{id:"vr_camera_controller",sid:"VR Camera Controller",properties:{name:"VR Camera Controller",description:"Moves a camera based on the movement of a VR head-mounted display.",filter:["camera"],category:"Camera",executeIn:"player"}},W.default],[{id:"vr_presenter",sid:"VR Presenter",properties:{name:"VR Presenter",description:"Controls the enabling and disabling of WebVR presenting.",filter:["application"],category:"VR",executeIn:"player"}},Q.default],[{id:"vr_render_view",sid:"VR Render View",properties:{name:"VR Render View",description:"Render View component that enables a stereoscopic view when a VR display is presenting.",attributes:{viewportLeft:{name:"viewportLeft",type:"s",description:"Left position of the viewport to be rendered by this camera.",default:"0px"},viewportBottom:{name:"viewportBottom",type:"s",description:"Bottom position of the viewport to be rendered by this camera.",default:"0px"},viewportWidth:{name:"viewportWidth",type:"s",description:"Width of the viewport to be rendered by this camera.",default:"100%"},viewportHeight:{name:"viewportHeight",type:"s",description:"Height of the viewport to be rendered by this camera.",default:"100%"},renderGroup:{name:"renderGroup",type:"i",description:"Render passes are done in order, based on the 'render group' value. Lower numbers render first.",default:0},renderLayer:{name:"renderLayer",type:"i",description:"The layer that this camera will render. Objects that are in a different layer will not be rendered by this camera.",default:0,min:0},clearColor:{name:"clearColor",type:"b",description:"Enable/disable color buffer clearing",default:!1,advanced:!1},clearDepth:{name:"clearDepth",type:"b",description:"Enable/disable depth buffer clearing",default:!0,advanced:!1},renderTarget:{name:"renderTarget",type:"asset",description:"The render texture asset to use as a render target.",filter:{RenderTexture2DAsset:!0},default:null,advanced:!1},enablePreRenderFunctions:{name:"enablePreRenderFunctions",type:"b",description:"Run pre-render functions with this view. These include things like real-time reflections, which need to be rendered for each view separately.",default:!0,advanced:!0},enableShadows:{name:"enableShadows",type:"b",description:"Render shadows for this view.",default:!0,advanced:!0}},filter:["camera"],category:"Rendering",executeIn:"player"}},X.default]]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0);r(206),r(208),r(207),i.__exportStar(r(205),t)},function(e,t){e.exports="/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Normal map shader\n * - compute normals from bumpTexture\n */\nprecision lowp float;\nuniform float smoothness;\nuniform float spread;\nuniform vec2 resolution;\nuniform sampler2D bumpTexture;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec2 size = vec2( smoothness, 0.0 );\n vec3 off = vec3(-spread / resolution.x, 0.0, spread / resolution.y);\n\n vec4 wave = texture2D( bumpTexture, vUv);\n float s11 = wave.x;\n float s01 = texture2D( bumpTexture, vUv + off.xy ).x;\n float s21 = texture2D( bumpTexture, vUv + off.zy ).x;\n float s10 = texture2D( bumpTexture, vUv + off.yx ).x;\n float s12 = texture2D( bumpTexture, vUv + off.yz ).x;\n vec3 va = normalize(vec3( size.xy, s21-s01));\n vec3 vb = normalize(vec3( size.yx, s12-s10));\n vec3 norm = cross(va,vb);\n gl_FragColor = vec4( norm * 0.5 + 0.5, s11 );\n}\n"},function(e,t){e.exports="/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Normal map shader\n * - compute normals from bumpTexture\n */\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n"},function(e,t){e.exports="//\n// Description : Array and textureless GLSL 3D simplex noise function.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110409 (stegu)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n//\n//'precision lowp float;\nuniform float time;\nuniform vec4 layerAmplitude;\nuniform vec4 layerScale;\nvarying vec2 vUv;\n\nprecision highp float;\n\nvec4 permute( vec4 x ) {\n\n return mod( ( ( x * 34.0 ) + 1.0 ) * x, 289.0 );\n\n}\n\nvec4 taylorInvSqrt( vec4 r ) {\n\n return 1.79284291400159 - 0.85373472095314 * r;\n\n}\n\nfloat snoise( vec3 v ) {\n\n vec2 C = vec2( 1.0 / 6.0, 1.0 / 3.0 );\n const vec4 D = vec4( 0.0, 0.5, 1.0, 2.0 );\n\n // First corner\n\n vec3 i = floor( v + dot( v, C.yyy ) );\n vec3 x0 = v - i + dot( i, C.xxx );\n\n // Other corners\n\n vec3 g = step( x0.yzx, x0.xyz );\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n vec3 x1 = x0 - i1 + 1.0 * C.xxx;\n vec3 x2 = x0 - i2 + 2.0 * C.xxx;\n vec3 x3 = x0 - 1. + 3.0 * C.xxx;\n\n // Permutations\n\n i = mod( i, 289.0 );\n vec4 p = permute( permute( permute(\n i.z + vec4( 0.0, i1.z, i2.z, 1.0 ) )\n + i.y + vec4( 0.0, i1.y, i2.y, 1.0 ) )\n + i.x + vec4( 0.0, i1.x, i2.x, 1.0 ) );\n\n // Gradients\n // ( N*N points uniformly over a square, mapped onto an octahedron.)\n\n float n_ = 1.0 / 7.0; // N=7\n\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor( p * ns.z *ns.z ); // mod(p,N*N)\n\n vec4 x_ = floor( j * ns.z );\n vec4 y_ = floor( j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs( x ) - abs( y );\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n\n vec4 s0 = floor( b0 ) * 2.0 + 1.0;\n vec4 s1 = floor( b1 ) * 2.0 + 1.0;\n vec4 sh = -step( h, vec4( 0.0 ) );\n\n vec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;\n vec4 a1 = b1.xzyw + s1.xzyw * sh.zzww;\n\n vec3 p0 = vec3( a0.xy, h.x );\n vec3 p1 = vec3( a0.zw, h.y );\n vec3 p2 = vec3( a1.xy, h.z );\n vec3 p3 = vec3( a1.zw, h.w );\n\n // Normalise gradients\n\n vec4 norm = taylorInvSqrt( vec4( dot( p0, p0 ), dot( p1, p1 ),\n dot( p2, p2 ), dot( p3, p3 ) ) );\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n // Mix final noise value\n\n vec4 m = max( 0.6 - vec4( dot( x0, x0 ), dot( x1, x1 ),\n dot( x2, x2 ), dot( x3, x3 ) ), 0.0 );\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot( p0, x0 ), dot( p1, x1 ),\n dot( p2, x2 ), dot( p3, x3 ) ) );\n\n}\n\nfloat surface3( vec3 coord ) {\n\n float n = 0.0;\n\n n += layerAmplitude.x * abs( snoise( coord * layerScale.x ) );\n n += layerAmplitude.y * abs( snoise( coord * layerScale.y ) );\n n += layerAmplitude.z * abs( snoise( coord * layerScale.z ) );\n n += layerAmplitude.w * abs( snoise( coord * layerScale.w ) );\n\n return n;\n}\n\nvoid main( void ) {\n\n vec3 coord = vec3( vUv, -time );\n float n = surface3( coord );\n\n gl_FragColor = vec4( vec3( n, n, n ), 1.0 );\n\n}\n"},function(e,t){e.exports="varying vec2 vUv;\nuniform vec2 scale;\nuniform vec2 offset;\n\nvoid main() {\n vUv = uv * scale + offset;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n"},function(e,t,r){(function(t){var r,r;(function(t){e.exports=t()})(function(){var e;return function e(t,i,n){function a(s,u){if(!i[s]){if(!t[s]){var p="function"==typeof r&&r;if(!u&&p)return r(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var h=i[s]={exports:{}};t[s][0].call(h.exports,function(e){var r=t[s][1][e];return a(r||e)},h,h.exports,e,t,i,n)}return i[s].exports}for(var o="function"==typeof r&&r,s=0;s=1&&r<=12&&i>=1&&i<=m[r]}function a(e,t){var r=e.match(y);if(!r)return!1;var i=r[1],n=r[2],a=r[3],o=r[5];return i<=23&&n<=59&&a<=59&&(!t||o)}function o(e){var t=e.split(w);return 2==t.length&&n(t[0])&&a(t[1],!0)}function s(e){return e.length<=255&&g.test(e)}function u(e){return E.test(e)&&v.test(e)}function p(e){try{return new RegExp(e),!0}catch(e){return!1}}function c(e,t){if(e&&t)return e>t?1:et?1:e=0?{index:i,compiling:!0}:(i=this._compilations.length,this._compilations[i]={schema:e,root:t,baseId:r},{index:i,compiling:!1})}function o(e,t,r){var i=s.call(this,e,t,r);i>=0&&this._compilations.splice(i,1)}function s(e,t,r){for(var i=0;i=55296&&t<=56319&&n=t)throw new Error("Cannot access property/index "+i+" levels up, current level is "+t);return r[t-i]}if(i>t)throw new Error("Cannot access data "+i+" levels up, current level is "+t);if(a="data"+(t-i||""),!n)return a}for(var s=a,p=n.split("/"),c=0;c",T="result"+n,S=e.opts.v5&&o&&o.$data;if(S?(i+=" var schema"+n+" = "+e.util.getData(o.$data,a,e.dataPathArr)+"; ",v="schema"+n):v=o,w){var D=e.util.getData(P.$data,a,e.dataPathArr),_="exclusive"+n,M="op"+n,A="' + "+M+" + '";i+=" var schemaExcl"+n+" = "+D+"; ",D="schemaExcl"+n,i+=" if (typeof "+D+" != 'boolean' && "+D+" !== undefined) { "+h+" = false; ";var r=x,C=C||[];C.push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(r||"_formatExclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: '"+x+" should be boolean' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var R=i;i=C.pop(),!e.compositeRule&&p?e.async?i+=" throw new ValidationError(["+R+"]); ":i+=" validate.errors = ["+R+"]; return false; ":i+=" var err = "+R+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",p&&(f+="}",i+=" else { "),S&&(i+=" if ("+v+" === undefined) "+h+" = true; else if (typeof "+v+" != 'string') "+h+" = false; else { ",f+="}"),d&&(i+=" if (!"+g+") "+h+" = true; else { ",f+="}"),i+=" var "+T+" = "+g+"("+c+", ",i+=S?""+v:""+e.util.toQuotedString(o),i+=" ); if ("+T+" === undefined) "+h+" = false; var "+_+" = "+D+" === true; if ("+h+" === undefined) { "+h+" = "+_+" ? "+T+" "+E+" 0 : "+T+" "+E+"= 0; } if (!"+h+") var op"+n+" = "+_+" ? '"+E+"' : '"+E+"=';"}else{var _=!0===P,A=E;_||(A+="=");var M="'"+A+"'";S&&(i+=" if ("+v+" === undefined) "+h+" = true; else if (typeof "+v+" != 'string') "+h+" = false; else { ",f+="}"),d&&(i+=" if (!"+g+") "+h+" = true; else { ",f+="}"),i+=" var "+T+" = "+g+"("+c+", ",i+=S?""+v:""+e.util.toQuotedString(o),i+=" ); if ("+T+" === undefined) "+h+" = false; if ("+h+" === undefined) "+h+" = "+T+" "+E,_||(i+="="),i+=" 0;"}i+=f+"if (!"+h+") { ";var r=t,C=C||[];C.push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(r||"_formatLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+M+", limit: ",i+=S?""+v:""+e.util.toQuotedString(o),i+=" , exclusive: "+_+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be "+A+' "',i+=S?"' + "+v+" + '":""+e.util.escapeQuotes(o),i+="\"' "),e.opts.verbose&&(i+=" , schema: ",i+=S?"validate.schema"+s:""+e.util.toQuotedString(o),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var R=i;return i=C.pop(),!e.compositeRule&&p?e.async?i+=" throw new ValidationError(["+R+"]); ":i+=" validate.errors = ["+R+"]; return false; ":i+=" var err = "+R+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="}"}},{}],14:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(o||""),l=e.opts.v5&&s&&s.$data;l?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+a):i=s;var d="maximum"==t,f=d?"exclusiveMaximum":"exclusiveMinimum",m=e.schema[f],y=e.opts.v5&&m&&m.$data,g=d?"<":">",v=d?">":"<";if(y){var b=e.util.getData(m.$data,o,e.dataPathArr),x="exclusive"+a,P="op"+a,w="' + "+P+" + '";n+=" var schemaExcl"+a+" = "+b+"; ",b="schemaExcl"+a,n+=" var exclusive"+a+"; if (typeof "+b+" != 'boolean' && typeof "+b+" != 'undefined') { ";var r=f,E=E||[];E.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(r||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: '"+f+" should be boolean' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var T=n;n=E.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+T+"]); ":n+=" validate.errors = ["+T+"]; return false; ":n+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if( ",l&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" ((exclusive"+a+" = "+b+" === true) ? "+h+" "+v+"= "+i+" : "+h+" "+v+" "+i+") || "+h+" !== "+h+") { var op"+a+" = exclusive"+a+" ? '"+g+"' : '"+g+"=';"}else{var x=!0===m,w=g;x||(w+="=");var P="'"+w+"'";n+=" if ( ",l&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+h+" "+v,x&&(n+="="),n+=" "+i+" || "+h+" !== "+h+") {"}var r=t,E=E||[];E.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(r||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { comparison: "+P+", limit: "+i+", exclusive: "+x+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be "+w+" ",n+=l?"' + "+i:s+"'"),e.opts.verbose&&(n+=" , schema: ",n+=l?"validate.schema"+u:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var T=n;return n=E.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+T+"]); ":n+=" validate.errors = ["+T+"]; return false; ":n+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c&&(n+=" else { "),n}},{}],15:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(o||""),l=e.opts.v5&&s&&s.$data;l?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+a):i=s;var d="maxItems"==t?">":"<";n+="if ( ",l&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+h+".length "+d+" "+i+") { ";var r=t,f=f||[];f.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(r||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxItems"==t?"more":"less",n+=" than ",n+=l?"' + "+i+" + '":""+s,n+=" items' "),e.opts.verbose&&(n+=" , schema: ",n+=l?"validate.schema"+u:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var m=n;return n=f.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},{}],16:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(o||""),l=e.opts.v5&&s&&s.$data;l?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+a):i=s;var d="maxLength"==t?">":"<";n+="if ( ",l&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),!1===e.opts.unicode?n+=" "+h+".length ":n+=" ucs2length("+h+") ",n+=" "+d+" "+i+") { ";var r=t,f=f||[];f.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(r||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be ",n+="maxLength"==t?"longer":"shorter",n+=" than ",n+=l?"' + "+i+" + '":""+s,n+=" characters' "),e.opts.verbose&&(n+=" , schema: ",n+=l?"validate.schema"+u:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var m=n;return n=f.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},{}],17:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(o||""),l=e.opts.v5&&s&&s.$data;l?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+a):i=s;var d="maxProperties"==t?">":"<";n+="if ( ",l&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" Object.keys("+h+").length "+d+" "+i+") { ";var r=t,f=f||[];f.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(r||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxProperties"==t?"more":"less",n+=" than ",n+=l?"' + "+i+" + '":""+s,n+=" properties' "),e.opts.verbose&&(n+=" , schema: ",n+=l?"validate.schema"+u:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var m=n;return n=f.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},{}],18:[function(e,t,r){"use strict";t.exports=function(e,t){var r=" ",i=e.schema[t],n=e.schemaPath+e.util.getProperty(t),a=e.errSchemaPath+"/"+t,o=!e.opts.allErrors,s=e.util.copy(e),u="";s.level++;var p="valid"+s.level,c=s.baseId,h=!0,l=i;if(l)for(var d,f=-1,m=l.length-1;f "+S+") { ";var _=p+"["+S+"]";l.schema=T,l.schemaPath=o+"["+S+"]",l.errSchemaPath=s+"/"+S,l.errorPath=e.util.getPathExpr(e.errorPath,S,e.opts.jsonPointers,!0),l.dataPathArr[y]=S;var M=e.validate(l);l.baseId=v,e.util.varOccurences(M,g)<2?r+=" "+e.util.varReplace(M,g,_)+" ":r+=" var "+g+" = "+_+"; "+M+" ",r+=" } ",u&&(r+=" if ("+f+") { ",d+="}")}if("object"==typeof b&&e.util.schemaHasRules(b,e.RULES.all)){l.schema=b,l.schemaPath=e.schemaPath+".additionalItems",l.errSchemaPath=e.errSchemaPath+"/additionalItems",r+=" "+f+" = true; if ("+p+".length > "+a.length+") { for (var "+m+" = "+a.length+"; "+m+" < "+p+".length; "+m+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var _=p+"["+m+"]";l.dataPathArr[y]=m;var M=e.validate(l);l.baseId=v,e.util.varOccurences(M,g)<2?r+=" "+e.util.varReplace(M,g,_)+" ":r+=" var "+g+" = "+_+"; "+M+" ",u&&(r+=" if (!"+f+") break; "),r+=" } } ",u&&(r+=" if ("+f+") { ",d+="}")}}else if(e.util.schemaHasRules(a,e.RULES.all)){l.schema=a,l.schemaPath=o,l.errSchemaPath=s,r+=" for (var "+m+" = 0; "+m+" < "+p+".length; "+m+"++) { ",l.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var _=p+"["+m+"]";l.dataPathArr[y]=m;var M=e.validate(l);l.baseId=v,e.util.varOccurences(M,g)<2?r+=" "+e.util.varReplace(M,g,_)+" ":r+=" var "+g+" = "+_+"; "+M+" ",u&&(r+=" if (!"+f+") break; "),r+=" } ",u&&(r+=" if ("+f+") { ",d+="}")}return u&&(r+=" "+d+" if ("+h+" == errors) {"),r=e.util.cleanUpCode(r)}},{}],26:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,c="data"+(a||""),h=e.opts.v5&&o&&o.$data;h?(i+=" var schema"+n+" = "+e.util.getData(o.$data,a,e.dataPathArr)+"; ",r="schema"+n):r=o,i+="var division"+n+";if (",h&&(i+=" "+r+" !== undefined && ( typeof "+r+" != 'number' || "),i+=" (division"+n+" = "+c+" / "+r+", ",e.opts.multipleOfPrecision?i+=" Math.abs(Math.round(division"+n+") - division"+n+") > 1e-"+e.opts.multipleOfPrecision+" ":i+=" division"+n+" !== parseInt(division"+n+") ",i+=" ) ",h&&(i+=" ) "),i+=" ) { ";var l=l||[];l.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+r+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be multiple of ",i+=h?"' + "+r:o+"'"),e.opts.verbose&&(i+=" , schema: ",i+=h?"validate.schema"+s:""+o,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var d=i;return i=l.pop(),!e.compositeRule&&p?e.async?i+=" throw new ValidationError(["+d+"]); ":i+=" validate.errors = ["+d+"]; return false; ":i+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",p&&(i+=" else { "),i}},{}],27:[function(e,t,r){"use strict";t.exports=function(e,t){var r=" ",i=e.level,n=e.dataLevel,a=e.schema[t],o=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),c="errs__"+i,h=e.util.copy(e);h.level++;var l="valid"+h.level;if(e.util.schemaHasRules(a,e.RULES.all)){h.schema=a,h.schemaPath=o,h.errSchemaPath=s,r+=" var "+c+" = errors; ";var d=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1;var f;h.opts.allErrors&&(f=h.opts.allErrors,h.opts.allErrors=!1),r+=" "+e.validate(h)+" ",h.createErrors=!0,f&&(h.opts.allErrors=f),e.compositeRule=h.compositeRule=d,r+=" if ("+l+") { ";var m=m||[];m.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: {} ",!1!==e.opts.messages&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var y=r;r=m.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { errors = "+c+"; if (vErrors !== null) { if ("+c+") vErrors.length = "+c+"; else vErrors = null; } ",e.opts.allErrors&&(r+=" } ")}else r+=" var err = ",!1!==e.createErrors?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: {} ",!1!==e.opts.messages&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(r+=" if (false) { ");return r}},{}],28:[function(e,t,r){"use strict";t.exports=function(e,t){var r=" ",i=e.level,n=e.dataLevel,a=e.schema[t],o=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),c="valid"+i,h="errs__"+i,l=e.util.copy(e),d="";l.level++;var f="valid"+l.level;r+="var "+h+" = errors;var prevValid"+i+" = false;var "+c+" = false;";var m=l.baseId,y=e.compositeRule;e.compositeRule=l.compositeRule=!0;var g=a;if(g)for(var v,b=-1,x=g.length-1;b5)r+=" || validate.schema"+o+"["+m+"] ";else{var j=v;if(j)for(var I,k=-1,L=j.length-1;k= "+fe+"; ",s=e.errSchemaPath+"/patternGroups/minimum",r+=" if (!"+c+") { ";var W=W||[];W.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'patternGroups' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { reason: '"+ge+"', limit: "+ye+", pattern: '"+e.util.escapeQuotes(F)+"' } ",!1!==e.opts.messages&&(r+=" , message: 'should NOT have "+ve+" than "+ye+' properties matching pattern "'+e.util.escapeQuotes(F)+"\"' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var Q=r;r=W.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+Q+"]); ":r+=" validate.errors = ["+Q+"]; return false; ":r+=" var err = "+Q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",void 0!==me&&(r+=" else ")}if(void 0!==me){var ye=me,ge="maximum",ve="more";r+=" "+c+" = pgPropCount"+i+" <= "+me+"; ",s=e.errSchemaPath+"/patternGroups/maximum",r+=" if (!"+c+") { ";var W=W||[];W.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'patternGroups' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { reason: '"+ge+"', limit: "+ye+", pattern: '"+e.util.escapeQuotes(F)+"' } ",!1!==e.opts.messages&&(r+=" , message: 'should NOT have "+ve+" than "+ye+' properties matching pattern "'+e.util.escapeQuotes(F)+"\"' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var Q=r;r=W.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+Q+"]); ":r+=" validate.errors = ["+Q+"]; return false; ":r+=" var err = "+Q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } "}s=H,u&&(r+=" if ("+c+") { ",d+="}")}}}}return u&&(r+=" "+d+" if ("+h+" == errors) {"),r=e.util.cleanUpCode(r)}},{}],32:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],u=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,c="data"+(o||""),h="valid"+a;if("#"==s||"#/"==s)e.isRoot?(r=e.async,i="validate"):(r=!0===e.root.schema.$async,i="root.refVal[0]");else{var l=e.resolveRef(e.baseId,s,e.isRoot);if(void 0===l){var d="can't resolve reference "+s+" from id "+e.baseId;if("fail"==e.opts.missingRefs){console.log(d);var f=f||[];f.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { ref: '"+e.util.escapeQuotes(s)+"' } ",!1!==e.opts.messages&&(n+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(s)+"' "),e.opts.verbose&&(n+=" , schema: "+e.util.toQuotedString(s)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),n+=" } "):n+=" {} ";var m=n;n=f.pop(),!e.compositeRule&&p?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",p&&(n+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs){var y=new Error(d);throw y.missingRef=e.resolve.url(e.baseId,s),y.missingSchema=e.resolve.normalizeId(e.resolve.fullPath(y.missingRef)),y}console.log(d),p&&(n+=" if (true) { ")}}else if(l.inline){var g=e.util.copy(e);g.level++;var v="valid"+g.level;g.schema=l.schema,g.schemaPath="",g.errSchemaPath=s;var b=e.validate(g).replace(/validate\.schema/g,l.code);n+=" "+b+" ",p&&(n+=" if ("+v+") { ")}else r=!0===l.$async,i=l.code}if(i){var f=f||[];f.push(n),n="",e.opts.passContext?n+=" "+i+".call(this, ":n+=" "+i+"( ",n+=" "+c+", (dataPath || '')",'""'!=e.errorPath&&(n+=" + "+e.errorPath);n+=" , "+(o?"data"+(o-1||""):"parentData")+" , "+(o?e.dataPathArr[o]:"parentDataProperty")+", rootData) ";var x=n;if(n=f.pop(),r){if(!e.async)throw new Error("async schema referenced by sync schema");n+=" try { ",p&&(n+="var "+h+" ="),n+=" "+e.yieldAwait+" "+x+"; } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; } ",p&&(n+=" if ("+h+") { ")}else n+=" if (!"+x+") { if (vErrors === null) vErrors = "+i+".errors; else vErrors = vErrors.concat("+i+".errors); errors = vErrors.length; } ",p&&(n+=" else { ")}return n}},{}],33:[function(e,t,r){"use strict";t.exports=function(e,t){var r=" ",i=e.level,n=e.dataLevel,a=e.schema[t],o=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),c="valid"+i,h=e.opts.v5&&a&&a.$data;h&&(r+=" var schema"+i+" = "+e.util.getData(a.$data,n,e.dataPathArr)+"; ");var l="schema"+i;if(!h)if(a.length=e.opts.loopRequired;if(u)if(r+=" var missing"+i+"; ",x){h||(r+=" var "+l+" = validate.schema"+o+"; ");var P="i"+i,w="schema"+i+"["+P+"]",E="' + "+w+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(b,w,e.opts.jsonPointers)),r+=" var "+c+" = true; ",h&&(r+=" if (schema"+i+" === undefined) "+c+" = true; else if (!Array.isArray(schema"+i+")) "+c+" = false; else {"),r+=" for (var "+P+" = 0; "+P+" < "+l+".length; "+P+"++) { "+c+" = "+p+"["+l+"["+P+"]] !== undefined; if (!"+c+") break; } ",h&&(r+=" } "),r+=" if (!"+c+") { ";var T=T||[];T.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { missingProperty: '"+E+"' } ",!1!==e.opts.messages&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+E+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var S=r;r=T.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+S+"]); ":r+=" validate.errors = ["+S+"]; return false; ":r+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { "}else{r+=" if ( ";var D=d;if(D)for(var _,P=-1,M=D.length-1;P 1) { var i = "+c+".length, j; outer: for (;i--;) { for (j = i; j--;) { if (equal("+c+"[i], "+c+"[j])) { "+h+" = false; break outer; } } } } ",l&&(i+=" } "),i+=" if (!"+h+") { ";var d=d||[];d.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(i+=" , schema: ",i+=l?"validate.schema"+s:""+o,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var f=i;i=d.pop(),!e.compositeRule&&p?e.async?i+=" throw new ValidationError(["+f+"]); ":i+=" validate.errors = ["+f+"]; return false; ":i+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",p&&(i+=" else { ")}else p&&(i+=" if (true) { ");return i}},{}],36:[function(e,t,r){"use strict";t.exports=function(e,t){function r(t){return void 0!==e.schema[t.keyword]||"properties"==t.keyword&&(!1===e.schema.additionalProperties||"object"==typeof e.schema.additionalProperties||e.schema.patternProperties&&Object.keys(e.schema.patternProperties).length||e.opts.v5&&e.schema.patternGroups&&Object.keys(e.schema.patternGroups).length)}var i="",n=!0===e.schema.$async;if(e.isTop){var a=e.isTop,o=e.level=0,s=e.dataLevel=0,u="data";if(e.rootId=e.resolve.fullPath(e.root.schema.id),e.baseId=e.baseId||e.rootId,n){e.async=!0;var p="es7"==e.opts.async;e.yieldAwait=p?"await":"yield"}delete e.isTop,e.dataPathArr=[void 0],i+=" var validate = ",n?p?i+=" (async function ":("co*"==e.opts.async&&(i+="co.wrap"),i+="(function* "):i+=" (function ",i+=" (data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; var vErrors = null; ",i+=" var errors = 0; ",i+=" if (rootData === undefined) rootData = data;"}else{var o=e.level,s=e.dataLevel,u="data"+(s||"");if(e.schema.id&&(e.baseId=e.resolve.url(e.baseId,e.schema.id)),n&&!e.async)throw new Error("async schema in sync schema");i+=" var errs_"+o+" = errors;"}var c="valid"+o,h=!e.opts.allErrors,l="",d="",f=e.schema.type,m=Array.isArray(f);if(f&&e.opts.coerceTypes){var y=e.util.coerceToTypes(e.opts.coerceTypes,f);if(y){var g=e.schemaPath+".type",v=e.errSchemaPath+"/type",b=m?"checkDataTypes":"checkDataType";i+=" if ("+e.util[b](f,u,!0)+") { ";var x="dataType"+o,P="coerced"+o;i+=" var "+x+" = typeof "+u+"; ","array"==e.opts.coerceTypes&&(i+=" if ("+x+" == 'object' && Array.isArray("+u+")) "+x+" = 'array'; "),i+=" var "+P+" = undefined; ";var w="",E=y;if(E)for(var T,S=-1,D=E.length-1;S2&&(t=l.call(arguments,1)),r(t)})})}function o(e){return Promise.all(e.map(n,this))}function s(e){for(var t=new e.constructor,r=Object.keys(e),i=[],a=0;a="0"&&n<="9";)t+=n,p();if("."===n)for(t+=".";p()&&n>="0"&&n<="9";)t+=n;if("e"===n||"E"===n)for(t+=n,p(),"-"!==n&&"+"!==n||(t+=n,p());n>="0"&&n<="9";)t+=n,p();if(e=+t,isFinite(e))return e;u("Bad number")},h=function(){var e,t,r,i="";if('"'===n)for(;p();){if('"'===n)return p(),i;if("\\"===n)if(p(),"u"===n){for(r=0,t=0;t<4&&(e=parseInt(p(),16),isFinite(e));t+=1)r=16*r+e;i+=String.fromCharCode(r)}else{if("string"!=typeof s[n])break;i+=s[n]}else i+=n}u("Bad string")},l=function(){for(;n&&n<=" ";)p()},d=function(){switch(n){case"t":return p("t"),p("r"),p("u"),p("e"),!0;case"f":return p("f"),p("a"),p("l"),p("s"),p("e"),!1;case"n":return p("n"),p("u"),p("l"),p("l"),null}u("Unexpected '"+n+"'")},f=function(){var e=[];if("["===n){if(p("["),l(),"]"===n)return p("]"),e;for(;n;){if(e.push(o()),l(),"]"===n)return p("]"),e;p(","),l()}}u("Bad array")},m=function(){var e,t={};if("{"===n){if(p("{"),l(),"}"===n)return p("}"),t;for(;n;){if(e=h(),l(),p(":"),Object.hasOwnProperty.call(t,e)&&u('Duplicate key "'+e+'"'),t[e]=o(),l(),"}"===n)return p("}"),t;p(","),l()}}u("Bad object")};o=function(){switch(l(),n){case"{":return m();case"[":return f();case'"':return h();case"-":return c();default:return n>="0"&&n<="9"?c():d()}},t.exports=function(e,t){var r;return a=e,i=0,n=" ",r=o(),l(),n&&u("Syntax error"),"function"==typeof t?function e(r,i){var n,a,o=r[i];if(o&&"object"==typeof o)for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(a=e(o,n),void 0!==a?o[n]=a:delete o[n]);return t.call(r,i,o)}({"":r},""):r}},{}],45:[function(e,t,r){function i(e){return u.lastIndex=0,u.test(e)?'"'+e.replace(u,function(e){var t=p[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function n(e,t){var r,u,p,c,h,l=a,d=t[e];switch(d&&"object"==typeof d&&"function"==typeof d.toJSON&&(d=d.toJSON(e)),"function"==typeof s&&(d=s.call(t,e,d)),typeof d){case"string":return i(d);case"number":return isFinite(d)?String(d):"null";case"boolean":case"null":return String(d);case"object":if(!d)return"null";if(a+=o,h=[],"[object Array]"===Object.prototype.toString.apply(d)){for(c=d.length,r=0;r1&&(i=r[0]+"@",e=r[1]),e=e.replace(j,"."),i+o(e.split("."),t).join(".")}function u(e){for(var t,r,i=[],n=0,a=e.length;n=55296&&t<=56319&&n65535&&(e-=65536,t+=B(e>>>10&1023|55296),e=56320|1023&e),t+=B(e)}).join("")}function c(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:E}function h(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function l(e,t,r){var i=0;for(e=r?L(e/_):e>>1,e+=L(e/t);e>k*S>>1;i+=E)e=L(e/k);return L(i+(k+1)*e/(e+D))}function d(e){var t,r,i,n,o,s,u,h,d,f,m=[],y=e.length,g=0,v=A,b=M;for(r=e.lastIndexOf(C),r<0&&(r=0),i=0;i=128&&a("not-basic"),m.push(e.charCodeAt(i));for(n=r>0?r+1:0;n=y&&a("invalid-input"),h=c(e.charCodeAt(n++)),(h>=E||h>L((w-g)/s))&&a("overflow"),g+=h*s,d=u<=b?T:u>=b+S?S:u-b,!(hL(w/f)&&a("overflow"),s*=f;t=m.length+1,b=l(g-o,t,0==o),L(g/t)>w-v&&a("overflow"),v+=L(g/t),g%=t,m.splice(g++,0,v)}return p(m)}function f(e){var t,r,i,n,o,s,p,c,d,f,m,y,g,v,b,x=[];for(e=u(e),y=e.length,t=A,r=0,o=M,s=0;s=t&&mL((w-r)/g)&&a("overflow"),r+=(p-t)*g,t=p,s=0;sw&&a("overflow"),m==t){for(c=r,d=E;f=d<=o?T:d>=o+S?S:d-o,!(c= 0x80 (not a basic code point)","invalid-input":"Invalid input"},k=E-T,L=Math.floor,B=String.fromCharCode;if(x={version:"1.4.1",ucs2:{decode:u,encode:p},decode:d,encode:f,toASCII:y,toUnicode:m},"function"==typeof e&&"object"==typeof e.amd&&e.amd)e("punycode",function(){return x});else if(g&&v)if(i.exports==g)v.exports=x;else for(P in x)x.hasOwnProperty(P)&&(g[P]=x[P]);else r.punycode=x})(this)}).call(this,void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],47:[function(e,t,r){"use strict";function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,r,a){t=t||"&",r=r||"=";var o={};if("string"!=typeof e||0===e.length)return o;var s=/\+/g;e=e.split(t);var u=1e3;a&&"number"==typeof a.maxKeys&&(u=a.maxKeys);var p=e.length;u>0&&p>u&&(p=u);for(var c=0;c=0?(h=m.substr(0,y),l=m.substr(y+1)):(h=m,l=""),d=decodeURIComponent(h),f=decodeURIComponent(l),i(o,d)?n(o[d])?o[d].push(f):o[d]=[o[d],f]:o[d]=f}return o};var n=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],48:[function(e,t,r){"use strict";function i(e,t){if(e.map)return e.map(t);for(var r=[],i=0;i",'"',"`"," ","\r","\n","\t"],f=["{","}","|","\\","^","`"].concat(d),m=["'"].concat(f),y=["%","/","?",";","#"].concat(m),g=["/","?","#"],v=/^[+a-z0-9A-Z_-]{0,63}$/,b=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,x={javascript:!0,"javascript:":!0},P={javascript:!0,"javascript:":!0},w={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},E=e("querystring");i.prototype.parse=function(e,t,r){if(!p.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),n=-1!==i&&i127?I+="x":I+=j[k];if(!I.match(v)){var B=R.slice(0,D),z=R.slice(D+1),N=j.match(b);N&&(B.push(N[1]),z.unshift(N[2])),z.length&&(s="/"+z.join(".")+s),this.hostname=B.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),C||(this.hostname=u.toASCII(this.hostname));var V=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+V,this.href+=this.host,C&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!x[f])for(var D=0,O=m.length;D0)&&r.host.split("@");S&&(r.auth=S.shift(),r.host=r.hostname=S.shift())}return r.search=e.search,r.query=e.query,p.isNull(r.pathname)&&p.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!E.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var D=E.slice(-1)[0],_=(r.host||e.host||E.length>1)&&("."===D||".."===D)||""===D,M=0,A=E.length;A>=0;A--)D=E[A],"."===D?E.splice(A,1):".."===D?(E.splice(A,1),M++):M&&(E.splice(A,1),M--);if(!b&&!x)for(;M--;M)E.unshift("..");!b||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),_&&"/"!==E.join("/").substr(-1)&&E.push("");var C=""===E[0]||E[0]&&"/"===E[0].charAt(0);if(T){r.hostname=r.host=C?"":E.length?E.shift():"";var S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");S&&(r.auth=S.shift(),r.host=r.hostname=S.shift())}return b=b||r.host&&E.length,b&&!C&&E.unshift(""),E.length?r.pathname=E.join("/"):(r.pathname=null,r.path=null),p.isNull(r.pathname)&&p.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},i.prototype.parseHost=function(){var e=this.host,t=h.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{"./util":51,punycode:46,querystring:49}],51:[function(e,t,r){"use strict";t.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},{}],ajv:[function(e,t,r){"use strict";function i(e){return v.test(e)}function n(t){function r(e,t){var r;if("string"==typeof e){if(!(r=T(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var i=A(e);r=i.validate||C(i)}var n=r(t);return!0===r.$async?"*"==I._opts.async?m(n):n:(I.errors=r.errors,n)}function y(e,t){var r=A(e,void 0,t);return r.validate||C(r)}function x(e,t,r,i){if(Array.isArray(e))for(var n=0;nt.major?e:t.major>e.major?t:e.minor>t.minor?e:t}function n(e){var t=[];if(e.major<=1){var r=i(e,{major:1,minor:0});t.push(function(e){return d.mapToV2Entity(e,r)})}if(e.major<=2){var n=i(e,{major:2,minor:0});t.push(function(e){return f.mapToV3Entity(e,n)})}if(e.major<=3){var a=i(e,{major:3,minor:0});t.push(function(e){return m.mapToV4Entity(e,a)})}if(e.major<=4){var o=i(e,{major:4,minor:0});t.push(function(e){return y.mapToV5Entity(e,o)})}return t}function a(e,t){n(t).forEach(function(t){e=b(e,t)});var r=v(e,"id");return b(e,function(e){return({material:o,prefab:h}[e.type]||g)(e,r)})}function o(e,t){var r=e.properties;return r.shadingModel&&("phong"===r.shadingModel?r.shaderId="fbx_surface_phong_shader":r.shaderId="fbx_surface_lambert_shader",delete r.shadingModel),s(r,"diffuse"),u(r,"ambient"),u(r,"emissive"),s(r,"specular"),p(r),c(r.normalMapTexture,"linear",t),c(r.bumpTexture,"linear",t),c(r.displacementTexture,"linear",t),c(r.transparencyFactorTexture,"linear",t),r.normalScale&&void 0===r.normalScale.x&&(r.normalScale={x:r.normalScale,y:r.normalScale}),e}function s(e,t){var r=t+"Factor",i=t+"Texture",n=t+"FactorTexture";e[t]&&(e[i]?e[t]={r:e[r],g:e[r],b:e[r]}:e[n]?e[i]=e[n]:(e[t].r*=e[r],e[t].g*=e[r],e[t].b*=e[r]),delete e[r],delete e[n])}function u(e,t){var r=t+"Texture",i=t+"FactorTexture";e[i]&&(e[r]=e[i],delete e[i])}function p(e){var t=0;(e.transparencyFactor||e.transparencyFactorTexture)&&e.transparentColor&&e.transparentColor.r?e.transparencyFactorTexture||e.transparentColorTexture?e.transparencyFactor=0:(t=(e.transparentColor.r+e.transparentColor.g+e.transparentColor.b)/3,e.transparencyFactor*=t):e.transparencyFactor=0,e.transparencyFactor=Math.max(Math.min(1-e.transparencyFactor,1),0),delete e.transparentColor,delete e.transparentColorTexture}function c(e,t,r){var i=r[e];if(i){var n=r[i.properties.imageId];n&&(n.properties.encoding=t)}}function h(e){var t=l.v4(),r={type:"node",id:t,parentAssetId:e.id,sid:t,children:e.children,properties:{name:(e.properties.name||"Prefab")+"_root"}};return delete e.children,e.properties.rootObjectId=t,[e,r]}var l=r(19),d=r(250),f=r(251),m=r(252),y=r(253),g=r(13).identity,v=r(13).indexBy,b=r(13).flatMap;e.exports={mapEntities:a}},function(e,t,r){"use strict";function i(e){return e.payload&&(e.properties=e.payload,delete e.payload),e}function n(e){return e=i(e),({material:a}[e.type]||o)(e)}function a(e){return e.properties&&e.properties.properties&&(s(e.properties.properties,function(t,r){e.properties[r]=t}),delete e.properties.properties),e}var o=r(13).identity,s=r(13).each;e.exports={mapToV2Entity:n}},function(e,t,r){"use strict";function i(e){var t=e.split(new RegExp(/\\|\//));return 0===t.length?e:t[t.length-1]}function n(e){return e.name&&(e.sid=e.name,e.properties||(e.properties={}),e.properties.name=e.name,delete e.name),e}function a(e){return e=n(e),({texture2D:o}[e.type]||u)(e)}function o(e){var t=i(e.properties.filename),r={type:"document",id:s.v4(),sid:t,properties:{name:t,filename:e.properties.filename}};return e.properties.imageId=r.id+"#"+t,delete e.properties.filename,[e,r]}var s=r(19),u=r(13).identity;e.exports={mapToV3Entity:a}},function(e,t,r){"use strict";function i(e){return({meshGeometry:n}[e.type]||o)(e)}function n(e){var t={type:"buffer",id:a.v4(),sid:e.sid+"-buffer",properties:{name:e.sid+"-buffer",src:"geometry.bin",accessors:{}}};return s(e.properties.attributes,function(e,r){t.properties.accessors[r]={type:e.type,componentType:e.componentType,byteOffset:e.byteOffset,byteStride:0,count:e.count},e.accessorId=t.id+"#"+r,delete e.type,delete e.componentType,delete e.byteOffset,delete e.byteStride,delete e.count}),t.properties.accessors.indices={type:e.properties.indices.type,componentType:e.properties.indices.componentType,byteOffset:e.properties.indices.byteOffset,byteStride:0,count:e.properties.indices.count},e.properties.indices=t.id+"#indices",[e,t]}var a=r(19),o=r(13).identity,s=r(13).each;e.exports={mapToV4Entity:i}},function(e,t,r){"use strict";function i(e,t){return({image:n}[e.type]||a)(e,t)}function n(e,t){return t.minor<3&&e.hasOwnProperty("representations")&&(e.representations=e.representations.filter(function(e){return e.width<=4096&&e.height<=4096})),e}var a=r(13).identity;e.exports={mapToV5Entity:i}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,r){var i=r(201)("unscopables"),n=Array.prototype;void 0==n[i]&&r(76)(n,i,{}),e.exports=function(e){n[i][e]=!0}},function(e,t,r){var i=r(51);e.exports=function(e){if(!i(e))throw TypeError(e+" is not an object!");return e}},function(e,t,r){var i=r(198),n=r(264),a=r(272),o=r(271),s=r(259);e.exports=function(e,t){var r=1==e,u=2==e,p=3==e,c=4==e,h=6==e,l=5==e||h,d=t||s;return function(t,s,f){for(var m,y,g=a(t),v=n(g),b=i(s,f,3),x=o(v.length),P=0,w=r?d(t,x):u?d(t,0):void 0;x>P;P++)if((l||P in v)&&(m=v[P],y=b(m,P,g),e))if(r)w[P]=y;else if(y)switch(e){case 3:return!0;case 5:return m;case 6:return P;case 2:w.push(m)}else if(c)return!1;return h?-1:p||c?c:w}}},function(e,t,r){var i=r(51),n=r(265),a=r(201)("species");e.exports=function(e){var t;return n(e)&&(t=e.constructor,"function"!=typeof t||t!==Array&&!n(t.prototype)||(t=void 0),i(t)&&null===(t=t[a])&&(t=void 0)),void 0===t?Array:t}},function(e,t,r){var i=r(258);e.exports=function(e,t){return new(i(e))(t)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,r){var i=r(51),n=r(34).document,a=i(n)&&i(n.createElement);e.exports=function(e){return a?n.createElement(e):{}}},function(e,t){var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t,r){e.exports=!r(74)&&!r(199)(function(){return 7!=Object.defineProperty(r(261)("div"),"a",{get:function(){return 7}}).a})},function(e,t,r){var i=r(197);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==i(e)?e.split(""):Object(e)}},function(e,t,r){var i=r(197);e.exports=Array.isArray||function(e){return"Array"==i(e)}},function(e,t,r){var i=r(256),n=r(263),a=r(273),o=Object.defineProperty;t.f=r(74)?Object.defineProperty:function(e,t,r){if(i(e),t=a(t,!0),i(r),n)try{return o(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,r){var i=r(34),n=r(76),a=r(262),o=r(200)("src"),s=Function.toString,u=(""+s).split("toString");r(33).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,r,s){var p="function"==typeof r;p&&(a(r,"name")||n(r,"name",t)),e[t]!==r&&(p&&(a(r,o)||n(r,o,e[t]?""+e[t]:u.join(String(t)))),e===i?e[t]=r:s?e[t]?e[t]=r:n(e,t,r):(delete e[t],n(e,t,r)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[o]||s.call(this)})},function(e,t,r){var i=r(34),n=i["__core-js_shared__"]||(i["__core-js_shared__"]={});e.exports=function(e){return n[e]||(n[e]={})}},function(e,t){var r=Math.ceil,i=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?i:r)(e)}},function(e,t,r){var i=r(270),n=Math.min;e.exports=function(e){return e>0?n(i(e),9007199254740991):0}},function(e,t,r){var i=r(260);e.exports=function(e){return Object(i(e))}},function(e,t,r){var i=r(51);e.exports=function(e,t){if(!i(e))return e;var r,n;if(t&&"function"==typeof(r=e.toString)&&!i(n=r.call(e)))return n;if("function"==typeof(r=e.valueOf)&&!i(n=r.call(e)))return n;if(!t&&"function"==typeof(r=e.toString)&&!i(n=r.call(e)))return n;throw TypeError("Can't convert object to primitive value")}},function(e,t,r){"use strict";var i=r(75),n=r(257)(5),a=!0;"find"in[]&&Array(1).find(function(){a=!1}),i(i.P+i.F*a,"Array",{find:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}}),r(255)("find")},function(e,t,r){var i=r(75);i(i.S,"Math",{log10:function(e){return Math.log(e)*Math.LOG10E}})},function(e,t,r){var i=r(75);i(i.S,"Math",{log2:function(e){return Math.log(e)/Math.LN2}})},function(e,t,r){var i,n;(function(a,o){"use strict";i=o,void 0!==(n="function"==typeof i?i.call(t,r,t,e):i)&&(e.exports=n)})(0,function(){"use strict";function e(e){return typeof console!==s&&(void 0!==console[e]?t(console,e):void 0!==console.log?t(console,"log"):o)}function t(e,t){var r=e[t];if("function"==typeof r.bind)return r.bind(e);try{return Function.prototype.bind.call(r,e)}catch(t){return function(){return Function.prototype.apply.apply(r,[e,arguments])}}}function r(e,t,r){return function(){typeof console!==s&&(i.call(this,t,r),this[e].apply(this,arguments))}}function i(e,t){for(var r=0;r=0&&t<=c.levels.SILENT))throw"log.setLevel() called with invalid level: "+t;if(p=t,!1!==r&&a(t),i.call(c,t,e),typeof console===s&&to+1e3&&(u.update(1e3*s/(e-o),100),o=e,s=0,c)){var t=performance.memory;c.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){a=this.end()},domElement:n,setMode:r}};return e.Panel=function(e,t,r){var i=1/0,n=0,a=Math.round,o=a(window.devicePixelRatio||1),s=80*o,u=48*o,p=3*o,c=2*o,h=3*o,l=15*o,d=74*o,f=30*o,m=document.createElement("canvas");m.width=s,m.height=u,m.style.cssText="width:80px;height:48px";var y=m.getContext("2d");return y.font="bold "+9*o+"px Helvetica,Arial,sans-serif",y.textBaseline="top",y.fillStyle=r,y.fillRect(0,0,s,u),y.fillStyle=t,y.fillText(e,p,c),y.fillRect(h,l,d,f),y.fillStyle=r,y.globalAlpha=.9,y.fillRect(h,l,d,f),{dom:m,update:function(u,g){i=Math.min(i,u),n=Math.max(n,u),y.fillStyle=r,y.globalAlpha=1,y.fillRect(0,0,s,l),y.fillStyle=t,y.fillText(a(u)+" "+e+" ("+a(i)+"-"+a(n)+")",p,c),y.drawImage(m,h+o,l,d-o,f,h,l,d-o,f),y.fillRect(h+d-o,l,o,f),y.fillStyle=r,y.globalAlpha=.9,y.fillRect(h+d-o,l,o,a((1-u/g)*f))}}},e})},function(e,t,r){function i(e,t,r){var i=t&&r||0,n=t||[];e=e||{};var o=void 0!==e.clockseq?e.clockseq:u,h=void 0!==e.msecs?e.msecs:(new Date).getTime(),l=void 0!==e.nsecs?e.nsecs:c+1,d=h-p+(l-c)/1e4;if(d<0&&void 0===e.clockseq&&(o=o+1&16383),(d<0||h>p)&&void 0===e.nsecs&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");p=h,c=l,u=o,h+=122192928e5;var f=(1e4*(268435455&h)+l)%4294967296;n[i++]=f>>>24&255,n[i++]=f>>>16&255,n[i++]=f>>>8&255,n[i++]=255&f;var m=h/4294967296*1e4&268435455;n[i++]=m>>>8&255,n[i++]=255&m,n[i++]=m>>>24&15|16,n[i++]=m>>>16&255,n[i++]=o>>>8|128,n[i++]=255&o;for(var y=e.node||s,g=0;g<6;++g)n[i+g]=y[g];return t||a(n)}var n=r(203),a=r(202),o=n(),s=[1|o[0],o[1],o[2],o[3],o[4],o[5]],u=16383&(o[6]<<8|o[7]),p=0,c=0;e.exports=i},function(e,t,r){function i(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"==e?new Array(16):null,e=null),e=e||{};var o=e.random||(e.rng||n)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var s=0;s<16;++s)t[i+s]=o[s];return t||a(o)}var n=r(203),a=r(202);e.exports=i}])}); //# sourceMappingURL=box3d-runtime.min.js.map \ No newline at end of file